feat(skills): add receipt2csv skill#195
Open
hanzhcn wants to merge 33 commits intoConway-Research:mainfrom
Open
feat(skills): add receipt2csv skill#195hanzhcn wants to merge 33 commits intoConway-Research:mainfrom
hanzhcn wants to merge 33 commits intoConway-Research:mainfrom
Conversation
- Package name: @wangcai/receipt2csv - Version: 1.0.0 - Build script with TypeScript compilation - Keywords for discoverability - MIT license
- Target ES2020 for modern Node.js - CommonJS module format - Declaration files enabled - Output to dist/ directory
- Installation instructions - Quick start example - Full API reference (convert, getStats, batchConvert) - Pricing model documentation - PaymentRequiredError handling example - Supported receipt types - Links to full SKILL_SPEC.md
- Add PaymentRequiredResponse, ErrorResponse, HealthResponse interfaces - Add StatsResponse and ReviewResponse interfaces - Cast response.json() to proper types for strict TypeScript
- Created SUMMARY.md with execution details - Updated STATE.md with plan completion status - Added SDK package name decision
## 功能 - 收据图片转 CSV 技能包 - WangcaiSDK 类提供 convert(), getStats(), batchConvert() 等方法 - 支持 x402 支付协议 ## 使用场景 - Agent 需要处理报销收据 - 财务 Agent 需要结构化消费数据 - DAO 财务管理 ## 服务提供者 - Agent ID: 18893 - Name: GLM-wangcai - Pricing: Freemium (5 free, then $0.10/call)
- context.ts: 为 GLM-5 设置 temperature=0.1 提高稳定性 - router.ts: 将 tool message 转换为 user message (GLM-5 格式要求) - types.ts: 添加 GLM-5 相关类型定义 - 修复 GLM-5 不支持 system role 的问题 云端已验证运行正常
- config.ts: 更新心跳配置 - tasks.ts: 添加 self_check 自检任务 - tasks.ts: 添加 find_customers 主动获客任务 - conway/inference.ts: 优化 Conway 推理逻辑 - index.ts: 更新入口配置 这些任务已在云端运行验证
- filters.ts: 客户筛选逻辑,支持多维度过滤 - outreach.ts: 主动获客模块,实现商业策略 - utils/sanitize.ts: 安全清理工具,防止敏感信息泄露 这些模块已集成到云端心跳任务中
- WANGCAI_README.md: 旺财项目完整介绍 - SOUL.md: 商业灵魂定义 - findings.md: 问题发现和解决方案记录 - progress.md: 会话日志和进度追踪 - task_plan.md: 任务计划 - REVENUE_*.md: 收入报告和日志 - LAUNCH_ANNOUNCEMENT.md: 发布公告 - .gitignore: 更新忽略规则
- health_report.mjs: 旺财健康报告生成器 - auto_refuel.mjs: 自动补能脚本 - verify_payment_pro.mjs: 支付验证脚本 - security-check.sh: 安全检查脚本 - sanitize-log.sh: 日志脱敏脚本
- package.json: 新增依赖项 - sdk/: SDK 开发包配置
- .planning/: GSD 阶段规划文件(01-10阶段) - register-agent.mjs: Agent 注册脚本 - query-agent.mjs: Agent 查询脚本 - update-agent-uri.mjs: URI 更新脚本 - app.py: Python 服务入口 - docs/: 文档目录 - backups/: 备份目录
- deploy.sh: 一键部署脚本,包含代码同步、依赖安装、构建、重启 - .gitignore: 强化敏感文件排除规则 用法: ./scripts/deploy.sh [branch]
- auto_sync.sh: 云端自进化检查脚本,加入 MEMORY.md 记忆功能 - notify-push.sh: 本地推送后通知脚本 - setup-local-hooks.sh: 一键配置本地 Git Hooks 现在支持完整的自进化闭环: 1. 本地 git push → 弹窗通知 2. 云端每 10 分钟检查更新 3. 自动拉取、构建、重启 4. 写入 MEMORY.md 记录进化历史
- notify-push.sh: 更新为 Conway Terminal 域名 - setup-local-hooks.sh: 更新为 Conway Terminal 域名 - cloud-repair.sh: 新增一键修复脚本,包含: - 拉取最新代码 - 检查并修复 3006 端口服务 - 依赖安装和构建 - PM2 重启 - MEMORY.md 初始化 - crontab 自动同步配置
防翻车加固: - auto_sync.sh v2.0: 构建失败自动回滚、依赖变动检测、分红进度记录 新增工具: - dashboard.sh: 运营仪表盘,显示服务状态、财务、身份、自动化配置 - revive.sh: Web 终端一键复活脚本,修复 SSH、拉取代码、重启服务
包含完整的 dist/ 编译产物,让云端无需执行 pnpm build 原因: - 云端沙箱只有 512MB 内存 - pnpm install/build 会导致 Bus Error (OOM) - 采用"本地编译,云端热更新"策略
## 核心更新 ### auto_sync.sh v3.2 (双重验证版) - 服务启动必须同时满足: 平台 NORMAL + 资金 ≥ $10.00 - 资金不足时进入"等待回血"状态,不启动 PM2 - 记录资金等待状态到维护日志 - 退出码 3 表示资金不足 ### boot_loader.mjs (启动检测脚本) - 基于 SOUL.md v4.2 动态路由逻辑 - 检测 sandbox 状态和 short_id 存在性 - 返回 JSON 格式结果 (NORMAL/MAINTENANCE/ERROR) - 退出码: 0=正常, 1=错误, 2=维护模式 ### src/version.ts (版本同步) - VERSION = '4.2', VERSION_NAME = 'Dynamic Routing Enabled' - 与 SOUL.md 版本保持同步 - checkVersionConsistency() 运行时验证 ### SOUL.md v4.2 - 新增 Section III 动态路由逻辑 - 新增 Section VII MAINTENANCE_MODE - 新增 Section IX 上下文感知 Credits ### WANGCAI_README.md - 更新部署架构图 (三层架构) - 端口和子域名改为动态描述 - 新增核心注意事项 (A-E)
## 新增章节 ### Git 工作流与自进化机制 (v3.2) - 从 Fork 拉取 vs 从官方拉取的安全机制 - 完整代码更新流程图 (本地 → GitHub → VPS) - Git 保护机制说明 (防覆盖) - 关键脚本职责表 ### 退款恢复与新建沙箱流程 - 情况 A:现有沙箱恢复流程(自动) - 情况 B:新建沙箱流程(手动步骤) - 资金阈值与启动逻辑 (auto_sync.sh v3.2) - 当前状态检查清单 ## 目的 防止上下文重置(断片)后丢失关键运维知识, 让未来的执行 AI 能够快速理解完整工作流程。
## task_plan.md 更新 - 修正架构图为四层(本地 → GitHub → VPS → Sandbox → 链上) - 添加 VPS 作为"主权大脑"的说明 - 添加自进化系统 v3.2 章节 - 添加从 Fork 拉取的安全机制 - 版本历史更新到 v1.7.0 ## findings.md 更新 - 修正架构图为四层 - 添加新发现 Conway-Research#32-37: - Conway-Research#32: auto_sync.sh v3.2 双重验证版 - Conway-Research#33: boot_loader.mjs 启动检测脚本 - Conway-Research#34: src/version.ts 版本同步机制 - Conway-Research#35: 从 Fork 拉取的安全机制 - Conway-Research#36: 退款恢复与新建沙箱流程 - Conway-Research#37: SOUL.md v4.2 更新 ## progress.md 更新 - 添加 2026-02-24 Session 9 会话记录 - 修正财务数据(Credits $9.04 → $4.04) - 更新资金阈值表(v3.2 双重验证) - 添加当前状态说明(🟡 等待回血) ## 目的 保持四文件(WANGCAI_README.md + 三文件)与实际系统状态同步, 确保上下文重置后能快速恢复完整项目上下文。
- WANGCAI_README.md: 全面门户(架构、财务、标识符) - task_plan.md: 严格任务计划(当前阶段、待办) - findings.md: 严格技术发现(新增 Conway-Research#38 四文件冗余) - progress.md: 严格进度日志 总行数从 ~3176 减少到 1833 行(-42%)
- .gitignore: 采纳官方审计版本 - erc8004.ts: 自动合并成功(无冲突)
- 7 步完整流程(含 gh CLI 自动化 Fork 同步) - 每步包含工具、命令、注意事项 - 冲突处理原则:安全文件采纳官方,自定义保留本地 - 私钥安全保障机制
第一阶段 - GSD 24 策略深度分析: - 创建 docs/strategy_deep_dive.md(可行性分类) - 可立即执行: 8个 / 需要SDK: 10个 / 高风险: 6个 第二阶段 - 架构解耦与 P1 清理: - 重命名三文件 Phase 为"技术开发阶段" - 建立技术开发 ↔ GSD 商业策略对照表 - GSD STATE.md 添加"部署状态追踪" 第三阶段 - 环境自愈与 Watchdog: - 新增 scripts/gateway_watchdog.mjs(网关守护) - 502 自动检测与 PM2 重启 - 路径安全锁定(禁止 /Users/) 第四阶段 - 记忆立交桥: - 新增 scripts/sync_memory.ts(记忆同步) - 自动从 GSD 提取决策到 findings.md - 自动版本号更新 findings.md 新增 Conway-Research#40-42 技术发现
GSD 文件架构: - 新增 phases/01-infrastructure/PLAN.md (S-02 Loss Leader) - 新增 phases/02-customer-acquisition/PLAN.md (S-01, S-06) 自学习机制 (Section XII): - 新增 scripts/learning_loop.mjs (每6小时分析数据) - 新增 scripts/gsd_sync.mjs (GSD ↔ 三文件同步) - 关键指标追踪: 转化率、响应率、成功率、响应时间 - 自动生成优化建议到 findings.md SOUL.md v4.3 更新: - 新增 Section XII: 自学习机制 - 引用 GSD 商业策略系统 (24策略) - 版本同步到 src/version.ts
问题背景: - 2026-02-23 Claude AI 错误假设需要外部 VPS (107.175.6.137) - 导致一整天开发停滞调查"莫名扣款" - VPS IP 从未真正连接过,只是脚本中的示例文本 清理内容: - 删除 scripts/setup-auto-deploy.sh (完全基于 VPS 假设) - 更新 WANGCAI_README.md 架构图 v4.0 (Conway 三层架构) - 添加 SOUL.md Section XIII 架构原则 (防止再次误导) - 记录 findings.md Conway-Research#43 VPS 架构误导事件教训 - 更新 progress.md Session 12 清理记录 防护机制: - 官方架构优先: ARCHITECTURE.md → conways-rules.txt → WANGCAI_README.md - 禁止假设外部资源 - 代码必须能在 Conway Terminal 运行
- 更新 notify-push.sh 中的 Sandbox ID - 同步健康报告和部署脚本 - 更新 SOUL.md 架构原则
- gateway_watchdog.mjs: wangcai-live -> wangcai.life.conway.tech - self_check.mjs: 更新为新 Sandbox ID (4d75bbdd) - revive.sh: 更新服务端点 URL - setup-local-hooks.sh: 更新 Terminal URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
功能
添加收据图片转 CSV 技能包。
convert(),getStats(),batchConvert()等方法使用场景
测试
cd packages/skills/receipt2csv npm install npm run build服务提供者
Checklist