cli-calctool 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +9 -161
  2. package/cli.mjs +238 -0
  3. package/package.json +12 -14
  4. package/{skills/calctool → skill}/SKILL.md +9 -5
  5. package/{skills/calctool → skill}/skill.json +2 -2
  6. package/LICENSE +0 -201
  7. package/install.mjs +0 -442
  8. package/skills/blueprint/SKILL.md +0 -47
  9. package/skills/blueprint/install-meta.json +0 -7
  10. package/skills/blueprint/skill.json +0 -10
  11. package/skills/calctool/install-meta.json +0 -7
  12. package/skills/calctool/platform-template/README.md +0 -74
  13. package/skills/calctool/platform-template/index.html +0 -12
  14. package/skills/calctool/platform-template/package.json +0 -26
  15. package/skills/calctool/platform-template/src/App.tsx +0 -233
  16. package/skills/calctool/platform-template/src/authz.ts +0 -103
  17. package/skills/calctool/platform-template/src/engine/evaluate.ts +0 -114
  18. package/skills/calctool/platform-template/src/engine-definition.json +0 -195
  19. package/skills/calctool/platform-template/src/main.tsx +0 -13
  20. package/skills/calctool/platform-template/src/pipeline.ts +0 -80
  21. package/skills/calctool/platform-template/src/store.ts +0 -53
  22. package/skills/calctool/platform-template/tsconfig.json +0 -15
  23. package/skills/calctool/platform-template/vite.config.ts +0 -7
  24. package/skills/calctool/references/declarative-pages.md +0 -69
  25. package/skills/calctool/references/engine-meta-model.md +0 -123
  26. package/skills/calctool/references/finance-example.md +0 -132
  27. package/skills/calctool/references/formula-dsl.md +0 -92
  28. package/skills/calctool/references/import-ocr.md +0 -72
  29. package/skills/calctool/templates/ecommerce-ops/README.md +0 -27
  30. package/skills/calctool/templates/ecommerce-ops/domain-reference.yaml +0 -172
  31. package/skills/swarm/SKILL.md +0 -120
  32. package/skills/swarm/install-meta.json +0 -7
  33. package/skills/swarm/references/ops-heartbeat.md +0 -45
  34. package/skills/swarm/references/org-chart.md +0 -50
  35. package/skills/swarm/references/security-guard.md +0 -56
  36. package/skills/swarm/references/task-lifecycle.md +0 -53
  37. package/skills/swarm/references/traffic-light.md +0 -52
  38. package/skills/swarm/skill.json +0 -10
  39. package/skills/swarm/swarm-runtime.mjs +0 -600
  40. package/sources.json +0 -25
@@ -1,53 +0,0 @@
1
- # 任务生命周期(task-lifecycle)
2
-
3
- 围绕项目 JSON 的任务全生命周期:派单 → 认领 → 执行 → 回传 → 验收,以及运维接替时的继承。
4
-
5
- ## 状态机
6
-
7
- ```
8
- dispatch claim execute report accept
9
- backlog ────────► assigned ───────► claimed ───────► running ───────► reported ───────► accepted
10
- │ │ │ │
11
- │ │ │ ├──► failed(可重试/转派)
12
- │ │ │ └──► blocked(红绿灯红)
13
- │ │ └──► stuck(心跳停止 → ops 收回 → 转派接替)
14
- └──► cancelled(决策层中止)
15
- ```
16
-
17
- ## 任务包字段(tasks.json)
18
-
19
- ```json
20
- {
21
- "taskId": "task-0001",
22
- "title": "迁移模块 A",
23
- "owner": null,
24
- "status": "backlog",
25
- "priority": "high",
26
- "dependsOn": ["task-0000"],
27
- "assignedBy": null,
28
- "claimedAt": null,
29
- "reportedAt": null,
30
- "report": null,
31
- "inheritedFrom": null
32
- }
33
- ```
34
-
35
- ## 动作
36
-
37
- | 动作 | 调用方 | 前置条件 | 效果 |
38
- |---|---|---|---|
39
- | `dispatch` | dispatcher | 任务在 backlog | 状态 → assigned,记录 assignedBy |
40
- | `claim` | worker | 任务在 assigned | 状态 → claimed,绑定 owner,记录 claimedAt |
41
- | `report` | worker | 任务在 claimed/running | 写入 report,状态 → reported |
42
- | `accept` | board | 任务在 reported | 状态 → accepted |
43
- | `reject` | board | 任务在 reported | 状态 → failed(可重派) |
44
- | `reclaim` | ops | 心跳停止/卡死 | 清空 owner,状态 → backlog(可再派) |
45
- | `cancel` | board | 任意非终态 | 状态 → cancelled |
46
-
47
- ## 继承(继承原任务列表继续执行)
48
-
49
- 运维接替时,新 worker 继承:
50
- - 原任务的 `report` 历史(已回传部分不丢失)
51
- - 原任务的 `dependsOn` 依赖
52
- - 原任务状态从 `claimed/running` 恢复,`inheritedFrom` 记录前任
53
- - 新 worker 可查看前任回传继续执行,不重复已完成部分
@@ -1,52 +0,0 @@
1
- # 红绿灯状态机与事件流(traffic-light)
2
-
3
- 每个任务与每个智能体都有实时红/黄/绿状态,进度与错误持续上报。
4
-
5
- ## 状态定义
6
-
7
- | 灯 | 含义 | 适用 |
8
- |---|---|---|
9
- | 🟢 green | 健康 / 完成 | 任务 accepted / 智能体心跳正常且进度正常 |
10
- | 🟡 yellow | 风险 / 延迟 | 任务 running 但超过预计时长 / 依赖未就绪 / 重试中 |
11
- | 🔴 red | 阻塞 / 失败 / 死亡 | 任务 failed/blocked / 智能体心跳停止 |
12
-
13
- ## 智能体健康(由 ops 维护)
14
-
15
- ```json
16
- {
17
- "agentId": "worker-0001",
18
- "role": "worker",
19
- "status": "green",
20
- "lastHeartbeatAt": "2026-08-17T12:00:00Z",
21
- "heartbeatMisses": 0,
22
- "currentTaskId": "task-0001",
23
- "progressPercent": 45
24
- }
25
- ```
26
-
27
- - 心跳间隔:默认 30s
28
- - 连续缺失 > 3 次 → status = red(死亡),触发 ops 回收
29
- - 单次缺失 → yellow(风险)
30
-
31
- ## 事件流
32
-
33
- 每个状态变化产生事件:
34
-
35
- ```json
36
- {
37
- "eventId": "evt-0001",
38
- "type": "traffic-light-changed",
39
- "subject": "task-0001",
40
- "from": "yellow",
41
- "to": "red",
42
- "reason": "heartbeat-stop",
43
- "at": "2026-08-17T12:03:00Z"
44
- }
45
- ```
46
-
47
- 可查询:`swarm-status` 返回全部任务与智能体的红绿灯快照。
48
-
49
- ## 汇报
50
-
51
- - 进度:`progressPercent` + `progressNote`(执行中持续上报)
52
- - 错误:`report` 失败时带错误码 + 消息,灯转红/黄,可重试或转派
@@ -1,10 +0,0 @@
1
- {
2
- "name": "swarm",
3
- "displayName": "Swarm",
4
- "description": "智能体蜂群编排:大脑调度 N 个子智能体,企业级组织架构规则 + 项目 JSON 任务派单/认领/回传 + 红绿灯状态 + 固定运维(心跳/回收/接替/继承)与安全守卫(注入检测/警报)。",
5
- "schemaVersion": "cli.request/1.0",
6
- "endpoint": "https://cli.tax/zj7fTPVh4p",
7
- "method": "POST",
8
- "version": "v0.2.0",
9
- "type": "Skill"
10
- }