@tothemax/tasking 0.0.0-stage → 0.6.15

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 (246) hide show
  1. package/README.md +119 -2
  2. package/README.zh-CN.md +120 -0
  3. package/assets/skills/install-glab/SKILL.md +70 -0
  4. package/assets/skills/land/SKILL.md +63 -0
  5. package/assets/skills/land/land_watch.py +312 -0
  6. package/assets/skills/openspec-archive-change/SKILL.md +114 -0
  7. package/assets/skills/opsx-grill-with-docs/SKILL.md +193 -0
  8. package/assets/skills/opsx-implement/SKILL.md +258 -0
  9. package/assets/skills/opsx-propose-with-tdd/SKILL.md +271 -0
  10. package/assets/workflows/WORKFLOW.code-mr.en.md.example +345 -0
  11. package/assets/workflows/WORKFLOW.code-mr.md.example +339 -0
  12. package/assets/workflows/WORKFLOW.feishu-direct.en.md.example +267 -0
  13. package/assets/workflows/WORKFLOW.feishu-direct.md.example +258 -0
  14. package/assets/workflows/WORKFLOW.grill-openspec.en.md.example +362 -0
  15. package/assets/workflows/WORKFLOW.grill-openspec.md.example +356 -0
  16. package/assets/workflows/WORKFLOW.minimal.en.md.example +296 -0
  17. package/assets/workflows/WORKFLOW.minimal.md.example +289 -0
  18. package/dist/adapters/feishu/events.d.ts +55 -0
  19. package/dist/adapters/feishu/events.d.ts.map +1 -0
  20. package/dist/adapters/feishu/events.js +184 -0
  21. package/dist/adapters/feishu/events.js.map +1 -0
  22. package/dist/adapters/feishu/index.d.ts +2 -0
  23. package/dist/adapters/feishu/index.d.ts.map +1 -0
  24. package/dist/adapters/feishu/index.js +2 -0
  25. package/dist/adapters/feishu/index.js.map +1 -0
  26. package/dist/adapters/feishu/probe.d.ts +31 -0
  27. package/dist/adapters/feishu/probe.d.ts.map +1 -0
  28. package/dist/adapters/feishu/probe.js +179 -0
  29. package/dist/adapters/feishu/probe.js.map +1 -0
  30. package/dist/adapters/feishu/source.d.ts +124 -0
  31. package/dist/adapters/feishu/source.d.ts.map +1 -0
  32. package/dist/adapters/feishu/source.js +715 -0
  33. package/dist/adapters/feishu/source.js.map +1 -0
  34. package/dist/adapters/jira/index.d.ts +2 -0
  35. package/dist/adapters/jira/index.d.ts.map +1 -0
  36. package/dist/adapters/jira/index.js +2 -0
  37. package/dist/adapters/jira/index.js.map +1 -0
  38. package/dist/adapters/jira/tracker.d.ts +63 -0
  39. package/dist/adapters/jira/tracker.d.ts.map +1 -0
  40. package/dist/adapters/jira/tracker.js +402 -0
  41. package/dist/adapters/jira/tracker.js.map +1 -0
  42. package/dist/bridge/binding-store.d.ts +93 -0
  43. package/dist/bridge/binding-store.d.ts.map +1 -0
  44. package/dist/bridge/binding-store.js +365 -0
  45. package/dist/bridge/binding-store.js.map +1 -0
  46. package/dist/bridge/commands.d.ts +45 -0
  47. package/dist/bridge/commands.d.ts.map +1 -0
  48. package/dist/bridge/commands.js +197 -0
  49. package/dist/bridge/commands.js.map +1 -0
  50. package/dist/bridge/comment-bridge.d.ts +116 -0
  51. package/dist/bridge/comment-bridge.d.ts.map +1 -0
  52. package/dist/bridge/comment-bridge.js +1473 -0
  53. package/dist/bridge/comment-bridge.js.map +1 -0
  54. package/dist/cli/daemon-info.d.ts +17 -0
  55. package/dist/cli/daemon-info.d.ts.map +1 -0
  56. package/dist/cli/daemon-info.js +64 -0
  57. package/dist/cli/daemon-info.js.map +1 -0
  58. package/dist/cli/daemon.d.ts +27 -0
  59. package/dist/cli/daemon.d.ts.map +1 -0
  60. package/dist/cli/daemon.js +77 -0
  61. package/dist/cli/daemon.js.map +1 -0
  62. package/dist/cli/doctor.d.ts +7 -0
  63. package/dist/cli/doctor.d.ts.map +1 -0
  64. package/dist/cli/doctor.js +156 -0
  65. package/dist/cli/doctor.js.map +1 -0
  66. package/dist/cli/event-channel.d.ts +16 -0
  67. package/dist/cli/event-channel.d.ts.map +1 -0
  68. package/dist/cli/event-channel.js +51 -0
  69. package/dist/cli/event-channel.js.map +1 -0
  70. package/dist/cli/help.d.ts +3 -0
  71. package/dist/cli/help.d.ts.map +1 -0
  72. package/dist/cli/help.js +155 -0
  73. package/dist/cli/help.js.map +1 -0
  74. package/dist/cli/index.d.ts +3 -0
  75. package/dist/cli/index.d.ts.map +1 -0
  76. package/dist/cli/index.js +774 -0
  77. package/dist/cli/index.js.map +1 -0
  78. package/dist/cli/init.d.ts +64 -0
  79. package/dist/cli/init.d.ts.map +1 -0
  80. package/dist/cli/init.js +1296 -0
  81. package/dist/cli/init.js.map +1 -0
  82. package/dist/cli/instance-lock.d.ts +13 -0
  83. package/dist/cli/instance-lock.d.ts.map +1 -0
  84. package/dist/cli/instance-lock.js +53 -0
  85. package/dist/cli/instance-lock.js.map +1 -0
  86. package/dist/cli/prompts.d.ts +13 -0
  87. package/dist/cli/prompts.d.ts.map +1 -0
  88. package/dist/cli/prompts.js +26 -0
  89. package/dist/cli/prompts.js.map +1 -0
  90. package/dist/cli/style.d.ts +26 -0
  91. package/dist/cli/style.d.ts.map +1 -0
  92. package/dist/cli/style.js +58 -0
  93. package/dist/cli/style.js.map +1 -0
  94. package/dist/cli/tui-helpers.d.ts +5 -0
  95. package/dist/cli/tui-helpers.d.ts.map +1 -0
  96. package/dist/cli/tui-helpers.js +124 -0
  97. package/dist/cli/tui-helpers.js.map +1 -0
  98. package/dist/cli/workflow-path.d.ts +12 -0
  99. package/dist/cli/workflow-path.d.ts.map +1 -0
  100. package/dist/cli/workflow-path.js +37 -0
  101. package/dist/cli/workflow-path.js.map +1 -0
  102. package/dist/config/config-types.d.ts +180 -0
  103. package/dist/config/config-types.d.ts.map +1 -0
  104. package/dist/config/config-types.js +71 -0
  105. package/dist/config/config-types.js.map +1 -0
  106. package/dist/config/dotenv.d.ts +2 -0
  107. package/dist/config/dotenv.d.ts.map +1 -0
  108. package/dist/config/dotenv.js +10 -0
  109. package/dist/config/dotenv.js.map +1 -0
  110. package/dist/config/index.d.ts +6 -0
  111. package/dist/config/index.d.ts.map +1 -0
  112. package/dist/config/index.js +6 -0
  113. package/dist/config/index.js.map +1 -0
  114. package/dist/config/loader.d.ts +5 -0
  115. package/dist/config/loader.d.ts.map +1 -0
  116. package/dist/config/loader.js +304 -0
  117. package/dist/config/loader.js.map +1 -0
  118. package/dist/config/manager.d.ts +31 -0
  119. package/dist/config/manager.d.ts.map +1 -0
  120. package/dist/config/manager.js +110 -0
  121. package/dist/config/manager.js.map +1 -0
  122. package/dist/config/resolver.d.ts +6 -0
  123. package/dist/config/resolver.d.ts.map +1 -0
  124. package/dist/config/resolver.js +267 -0
  125. package/dist/config/resolver.js.map +1 -0
  126. package/dist/config/validator.d.ts +9 -0
  127. package/dist/config/validator.d.ts.map +1 -0
  128. package/dist/config/validator.js +70 -0
  129. package/dist/config/validator.js.map +1 -0
  130. package/dist/direct/card.d.ts +49 -0
  131. package/dist/direct/card.d.ts.map +1 -0
  132. package/dist/direct/card.js +274 -0
  133. package/dist/direct/card.js.map +1 -0
  134. package/dist/direct/command.d.ts +12 -0
  135. package/dist/direct/command.d.ts.map +1 -0
  136. package/dist/direct/command.js +23 -0
  137. package/dist/direct/command.js.map +1 -0
  138. package/dist/direct/manager.d.ts +159 -0
  139. package/dist/direct/manager.d.ts.map +1 -0
  140. package/dist/direct/manager.js +1862 -0
  141. package/dist/direct/manager.js.map +1 -0
  142. package/dist/mcp/inject.d.ts +5 -0
  143. package/dist/mcp/inject.d.ts.map +1 -0
  144. package/dist/mcp/inject.js +51 -0
  145. package/dist/mcp/inject.js.map +1 -0
  146. package/dist/mcp/jira-server.d.ts +29 -0
  147. package/dist/mcp/jira-server.d.ts.map +1 -0
  148. package/dist/mcp/jira-server.js +288 -0
  149. package/dist/mcp/jira-server.js.map +1 -0
  150. package/dist/observability/activity-store.d.ts +29 -0
  151. package/dist/observability/activity-store.d.ts.map +1 -0
  152. package/dist/observability/activity-store.js +32 -0
  153. package/dist/observability/activity-store.js.map +1 -0
  154. package/dist/observability/config-view.d.ts +19 -0
  155. package/dist/observability/config-view.d.ts.map +1 -0
  156. package/dist/observability/config-view.js +61 -0
  157. package/dist/observability/config-view.js.map +1 -0
  158. package/dist/observability/http-dashboard.d.ts +36 -0
  159. package/dist/observability/http-dashboard.d.ts.map +1 -0
  160. package/dist/observability/http-dashboard.js +297 -0
  161. package/dist/observability/http-dashboard.js.map +1 -0
  162. package/dist/observability/log-buffer.d.ts +21 -0
  163. package/dist/observability/log-buffer.d.ts.map +1 -0
  164. package/dist/observability/log-buffer.js +69 -0
  165. package/dist/observability/log-buffer.js.map +1 -0
  166. package/dist/observability/logger.d.ts +37 -0
  167. package/dist/observability/logger.d.ts.map +1 -0
  168. package/dist/observability/logger.js +114 -0
  169. package/dist/observability/logger.js.map +1 -0
  170. package/dist/observability/snapshot.d.ts +11 -0
  171. package/dist/observability/snapshot.d.ts.map +1 -0
  172. package/dist/observability/snapshot.js +59 -0
  173. package/dist/observability/snapshot.js.map +1 -0
  174. package/dist/observability/terminal-dashboard.d.ts +155 -0
  175. package/dist/observability/terminal-dashboard.d.ts.map +1 -0
  176. package/dist/observability/terminal-dashboard.js +1598 -0
  177. package/dist/observability/terminal-dashboard.js.map +1 -0
  178. package/dist/observability/wrap.d.ts +4 -0
  179. package/dist/observability/wrap.d.ts.map +1 -0
  180. package/dist/observability/wrap.js +80 -0
  181. package/dist/observability/wrap.js.map +1 -0
  182. package/dist/scheduler/index.d.ts +2 -0
  183. package/dist/scheduler/index.d.ts.map +1 -0
  184. package/dist/scheduler/index.js +2 -0
  185. package/dist/scheduler/index.js.map +1 -0
  186. package/dist/scheduler/scheduler.d.ts +52 -0
  187. package/dist/scheduler/scheduler.d.ts.map +1 -0
  188. package/dist/scheduler/scheduler.js +535 -0
  189. package/dist/scheduler/scheduler.js.map +1 -0
  190. package/dist/shared/agent-resolver.d.ts +11 -0
  191. package/dist/shared/agent-resolver.d.ts.map +1 -0
  192. package/dist/shared/agent-resolver.js +20 -0
  193. package/dist/shared/agent-resolver.js.map +1 -0
  194. package/dist/shared/errors.d.ts +14 -0
  195. package/dist/shared/errors.d.ts.map +1 -0
  196. package/dist/shared/errors.js +24 -0
  197. package/dist/shared/errors.js.map +1 -0
  198. package/dist/shared/index.d.ts +4 -0
  199. package/dist/shared/index.d.ts.map +1 -0
  200. package/dist/shared/index.js +4 -0
  201. package/dist/shared/index.js.map +1 -0
  202. package/dist/shared/info-card.d.ts +24 -0
  203. package/dist/shared/info-card.d.ts.map +1 -0
  204. package/dist/shared/info-card.js +46 -0
  205. package/dist/shared/info-card.js.map +1 -0
  206. package/dist/shared/types.d.ts +148 -0
  207. package/dist/shared/types.d.ts.map +1 -0
  208. package/dist/shared/types.js +15 -0
  209. package/dist/shared/types.js.map +1 -0
  210. package/dist/translate/card.d.ts +2 -0
  211. package/dist/translate/card.d.ts.map +1 -0
  212. package/dist/translate/card.js +17 -0
  213. package/dist/translate/card.js.map +1 -0
  214. package/dist/translate/dict.d.ts +7 -0
  215. package/dist/translate/dict.d.ts.map +1 -0
  216. package/dist/translate/dict.js +895 -0
  217. package/dist/translate/dict.js.map +1 -0
  218. package/dist/translate/locale.d.ts +8 -0
  219. package/dist/translate/locale.d.ts.map +1 -0
  220. package/dist/translate/locale.js +75 -0
  221. package/dist/translate/locale.js.map +1 -0
  222. package/dist/translate/normalize.d.ts +4 -0
  223. package/dist/translate/normalize.d.ts.map +1 -0
  224. package/dist/translate/normalize.js +38 -0
  225. package/dist/translate/normalize.js.map +1 -0
  226. package/dist/translate/output.d.ts +3 -0
  227. package/dist/translate/output.d.ts.map +1 -0
  228. package/dist/translate/output.js +16 -0
  229. package/dist/translate/output.js.map +1 -0
  230. package/dist/worker/prompt.d.ts +11 -0
  231. package/dist/worker/prompt.d.ts.map +1 -0
  232. package/dist/worker/prompt.js +153 -0
  233. package/dist/worker/prompt.js.map +1 -0
  234. package/dist/worker/runner.d.ts +101 -0
  235. package/dist/worker/runner.d.ts.map +1 -0
  236. package/dist/worker/runner.js +448 -0
  237. package/dist/worker/runner.js.map +1 -0
  238. package/dist/workspace/index.d.ts +2 -0
  239. package/dist/workspace/index.d.ts.map +1 -0
  240. package/dist/workspace/index.js +2 -0
  241. package/dist/workspace/index.js.map +1 -0
  242. package/dist/workspace/manager.d.ts +37 -0
  243. package/dist/workspace/manager.d.ts.map +1 -0
  244. package/dist/workspace/manager.js +157 -0
  245. package/dist/workspace/manager.js.map +1 -0
  246. package/package.json +65 -4
@@ -0,0 +1,339 @@
1
+ ---
2
+ interface_language: zh
3
+ # ============================================================================
4
+ # tracker: 结构化任务源 (Jira)
5
+ # ============================================================================
6
+ tracker:
7
+ # 必填。仅支持 "jira"。
8
+ kind: jira
9
+
10
+ # Jira REST API 端点。Cloud: https://your-domain.atlassian.net/rest/api/3
11
+ # 自托管: http://your-host:port/rest/api/2
12
+ endpoint: https://your-domain.atlassian.net/rest/api/3
13
+
14
+ # 必填。Jira API token。建议用 $VAR 环境变量引用,不写明文。
15
+ # Cloud: 账号设置 → 安全 → 创建 API token
16
+ # 自托管: 用户管理 → 生成 PAT
17
+ api_key: $JIRA_API_TOKEN
18
+
19
+ # basic 模式必填 (Cloud email 或自托管用户名)。bearer 模式可省略。
20
+ api_user: you@example.com
21
+
22
+ # 认证模式。"basic" = email + token (Cloud 常用);"bearer" = 仅 token (自托管 PAT)
23
+ auth_mode: basic
24
+
25
+ # review 交接态名称 (如 "代码评审中"、"In Review")。
26
+ # 此状态不放在 active_states 或 terminal_states 中,自动成为隐式中间态。
27
+ # agent 创建 MR 后转入此态,调度器停止 worker 但保留工作区。
28
+ review_state: 代码评审中
29
+
30
+ # 必填。Jira 项目 key (如 "ENG")。与 project_slug 二选一。
31
+ project_key: ENG
32
+
33
+ # project_key 的替代,二选一即可。
34
+ project_slug: null
35
+
36
+ # 按指派人过滤。null = 不过滤 (拉取项目内所有符合状态的)。"me" = currentUser() (当前 API 用户)。
37
+ assignee: null
38
+
39
+ # 必需标签过滤。空 = 不过滤。如 ["tothemax"] 表示只派发含此标签的 issue。
40
+ required_labels: []
41
+
42
+ # 候选状态。只拉取处于这些状态的 issue 作为派发候选。
43
+ # 注意: 不同的 Jira 部署状态名可能不同,需根据实际调整。
44
+ # 三层状态模型: active(派发) / neither-review(停 worker 保留工作区) / terminal(清理工作区)。
45
+ # review 态(如"代码评审中")不放在 active_states 或 terminal_states 中 — 自动成为隐式中间态。
46
+ # 人 review 后双路径: 移回初始态(如"待办")= 增量修复(同分支改); 移到返工态= 全量重置(关 MR、新分支)。
47
+ active_states:
48
+ - 待办
49
+ - 处理中
50
+ - 合并中
51
+ - 重置处理
52
+
53
+ # 终态。处于这些状态的 issue 不会被派发,且启动时清理其工作区。
54
+ terminal_states:
55
+ - 完成
56
+ - 关闭
57
+ - 取消
58
+ - 重复
59
+
60
+ # ============================================================================
61
+ # polling: 轮询节奏
62
+ # ============================================================================
63
+ polling:
64
+ # 轮询间隔 (毫秒)。默认 30000 = 30 秒。必须 > 0。
65
+ interval_ms: 30000
66
+
67
+ # ============================================================================
68
+ # workspace: per-task 工作区
69
+ # ============================================================================
70
+ workspace:
71
+ # 工作区根目录。~ 会展开为 home。相对路径基于 WORKFLOW.md 所在目录。
72
+ # 每个 issue 的工作区为 <root>/<sanitized_identifier>。
73
+ root: ~/tasking_workspaces
74
+
75
+ # ============================================================================
76
+ # hooks: 工作区生命周期钩子 (可选)
77
+ # ============================================================================
78
+ hooks:
79
+ # 所有 hook 的超时 (毫秒)。默认 60000 = 60 秒。必须 > 0。
80
+ timeout_ms: 60000
81
+
82
+ # 仅新工作区创建时运行。失败中止创建。常用于 git clone + 依赖安装。
83
+ after_create: null
84
+
85
+ # 每次 attempt 前运行。失败中止当前 attempt。
86
+ # before_run: |
87
+ # git pull --ff-only origin main
88
+
89
+ # 每次 attempt 后运行 (成功/失败/超时均执行)。失败仅记录。
90
+ after_run: null
91
+
92
+ # 工作区删除前运行 (issue 进入终态时)。失败仅记录,不阻塞删除。
93
+ # before_remove: |
94
+ # cd elixir && mix workspace.before_remove
95
+
96
+ # ============================================================================
97
+ # agent: 并发与重试策略
98
+ # ============================================================================
99
+ agent:
100
+ # 全局并发上限。同时运行的 opencode run 子进程数不超过此值。
101
+ max_concurrent_agents: 10
102
+
103
+ # 同一 worker 内的 turn 上限。达到后 worker 退出,调度续轮 retry。
104
+ # 建议起步设 3 避免首次 token 消耗过大。
105
+ max_turns: 20
106
+
107
+ # 退避上限 (毫秒)。默认 300000 = 5 分钟。
108
+ max_retry_backoff_ms: 300000
109
+
110
+ # 按状态限并发。空 = 不限。如 {"in progress": 2} 限制 In Progress 状态最多 2 个并发。
111
+ max_concurrent_agents_by_state: {}
112
+
113
+ # ============================================================================
114
+ # opencode: worker 子进程配置
115
+ # ============================================================================
116
+ opencode:
117
+ # opencode 启动命令。默认 "opencode run"。
118
+ command: opencode run
119
+
120
+ # opencode agent profile 名称。
121
+ agent: build
122
+
123
+ # 可选。已知 opencode agent profile 的咨询性目录(字符串数组)。供 `/agent` 命令展示并对未知名提示。
124
+ # 空目录(默认)=不校验,任何 `agent:<name>` 直通;非空=咨询性校验,未知名警告并回退默认。不作硬白名单。
125
+ agents: []
126
+
127
+ # 可选。opencode 模型 (provider/model 格式),映射 `--model`。默认 null(不配置,走 opencode 默认模型)。
128
+ model: null
129
+
130
+ # 可选。模型变体 (provider 特定推理档位,如 high/max/minimal),映射 `--variant`。默认 null(不配置)。与 model 彼此独立。
131
+ variant: null
132
+
133
+ # 单 turn 超时 (毫秒)。默认 3600000 = 1 小时。必须 > 0。
134
+ # 硬墙钟超时:无论活动状态如何,到点必杀。
135
+ turn_timeout_ms: 3600000
136
+
137
+ # 停滞超时 (毫秒)。超过此时间无活动则终止 worker。
138
+ # 默认 7200000 = 2 小时。设为 0 禁用停滞检测。
139
+ # scheduler 层兜底:当不活跃超时和墙钟超时都无法终止子进程时
140
+ # (如子进程拒绝响应 SIGTERM)。超时先 SIGTERM,10s 宽限未退出则
141
+ # 进程组 SIGKILL(见 docs/adr/0020);本项仅兜底升级路径自身失效。
142
+ # 建议设为大于 turn_timeout_ms 以避免正常 turn 被误杀。
143
+ stall_timeout_ms: 7200000
144
+
145
+ # 不活跃超时 (毫秒)。stdout/stderr 无数据超过此值则 SIGTERM 终止。
146
+ # 默认 600000 = 10 分钟。设为 0 禁用不活跃超时。
147
+ # subprocess 层:检查原始字节,收到数据时重置计时器。
148
+ inactivity_timeout_ms: 600000
149
+
150
+ # ============================================================================
151
+ # router: 非结构化源 (飞书) 的 route agent 分诊
152
+ # ============================================================================
153
+ # 未实现:当前仅解析,无运行时代码(预留供将来 route agent 实现)。
154
+ # router:
155
+ # 是否启用 route agent。启用后按 tick 有界运行,将飞书消息分诊为 Task。
156
+ # enabled: false
157
+
158
+ # route agent 使用的 opencode agent profile。
159
+ # agent: triage
160
+
161
+ # 单次 route agent 运行处理的 inbox 条目上限。
162
+ # batch_size: 20
163
+
164
+ # route agent 单次运行超时 (毫秒)。默认 120000 = 2 分钟。
165
+ # timeout_ms: 120000
166
+
167
+ # ============================================================================
168
+ # feishu: 飞书 ↔ Jira 评论桥 (REST 轮询,无公网端口)
169
+ # ============================================================================
170
+ feishu:
171
+ # 启用后飞书成已存在 Jira issue 的评论同步镜像:话题 1:1 绑定 issue,双向镜像评论。
172
+ # 入站用 REST 轮询(不收 webhook、不暴露公网端口)。详见 docs/feishu-quickstart.md。
173
+ enabled: false
174
+
175
+ # 飞书版本:feishu(国内版 open.feishu.cn)| lark(海外版 open.larksuite.com)。默认 feishu。
176
+ edition: feishu
177
+
178
+ # 飞书应用凭证。可明文,也可用 $VAR 环境变量引用。
179
+ app_id: $FEISHU_APP_ID
180
+ app_secret: $FEISHU_APP_SECRET
181
+
182
+ # intake 群 chat_id:承载所有 issue 线程的指定群(GET /im/v1/chats 取)。启用时必填。
183
+ intake_chat_id: $FEISHU_INTAKE_CHAT_ID
184
+
185
+ # Jira→飞书评论镜像节奏(毫秒),默认 5s。收消息走事件通道,不轮询。
186
+ forward_interval_ms: 5000
187
+
188
+ # Sweep 兜底清扫节奏(毫秒),默认 12h。补拉断线/停机窗口,启动与 WS 重连时也会触发。
189
+ sweep_interval_ms: 43200000
190
+
191
+ # /issue 默认 issueType(tasking init 时列出项目可用 type)。启用时必填。
192
+ create_issue_type: Task
193
+
194
+ # webhook 模式专用(REST 轮询下不用,预留供将来 webhook 模式)。
195
+ # verification_token: $FEISHU_VERIFICATION_TOKEN
196
+ # encrypt_key: $FEISHU_ENCRYPT_KEY
197
+
198
+ # --------------------------------------------------------------------------
199
+ # 直连会话 (feishu.direct):绕过 Jira,在固定目录直接跑 opencode。
200
+ # feishu.enabled 为 true 时直连默认启用;段内 enabled: false 显式关闭。详见 docs/configuration.md。
201
+ # --------------------------------------------------------------------------
202
+ direct:
203
+ # 段内显式 false 关闭直连。
204
+ enabled: true
205
+
206
+ # 项目名 → 目录映射,供 `/chat <项目名> <消息>` 使用。对象形态 {path, auto_approve} 覆盖全局值。
207
+ # 例:
208
+ # projects:
209
+ # tasking: /home/me/workspace/tasking
210
+ # other: {path: /abs/dir, auto_approve: true}
211
+ projects:
212
+
213
+ # ad-hoc path 模式(`/chat /绝对路径 <消息>`)的目录前缀白名单;空 = 不限制。
214
+ path_roots: []
215
+
216
+ # true = 给 opencode run 传 --auto(自动放行未被显式拒绝的权限)。
217
+ # 默认 false:权限姿态由目标目录自己的 .opencode 权限配置决定。
218
+ auto_approve: false
219
+
220
+ # 镜像到飞书的事件量级:quiet(仅最终正文)| summary(正文 + 统计行)| detailed(默认,每 turn 一张过程卡片;折叠面板需飞书/Lark 客户端 >= V7.9)。
221
+ verbosity: detailed
222
+
223
+ # 直连 turn 的全局并发上限(独立于 Jira 的 max_concurrent_agents);同目录/同会话始终串行。
224
+ max_concurrent: 5
225
+
226
+ # 空闲多久后把会话标记为 expired(毫秒,不删除 opencode 磁盘 session)。默认 2592000000 = 30 天。
227
+ idle_ttl_ms: 2592000000
228
+
229
+ # ============================================================================
230
+ # server: HTTP 仪表板 (可选)
231
+ # ============================================================================
232
+ server:
233
+ # 仪表板端口。null = 不启动。设为 8080 则启动。
234
+ port: null
235
+
236
+ # 绑定地址。"0.0.0.0" = 全网卡 (外部可访问)。"127.0.0.1" = 仅本地。
237
+ host: 0.0.0.0
238
+
239
+ # ============================================================================
240
+ # logging: 文件日志 (可选)
241
+ # ============================================================================
242
+ logging:
243
+ file:
244
+ # 文件日志路径。null = 不写文件 (仅 stderr)。CLI 启动时默认为 ./tasking.log。
245
+ path: null
246
+
247
+ # 单文件最大字节数。超出后轮转。默认 10485760 = 10 MB。
248
+ max_bytes: 10485760
249
+
250
+ # 轮转备份数。保留最近 N 个备份文件。
251
+ max_files: 5
252
+
253
+ # ============================================================================
254
+ # env: 注入 worker 子进程的环境变量 (可选)
255
+ # ============================================================================
256
+ # 值支持 $VAR 间接引用 (与 tracker.api_key 相同语义)。
257
+ # 解析为空字符串时注入空字符串值。缺失的 env 段默认为空对象。
258
+ env:
259
+ # GitLab token,供 glab CLI 使用。glab 自动读此环境变量。
260
+ GITLAB_TOKEN: $GITLAB_TOKEN
261
+ GITLAB_HOST: $GITLAB_HOST
262
+ ---
263
+
264
+ <!-- tasking-workflow: code-mr -->
265
+
266
+ You are a coding agent working on: {{ task.identifier }} - {{ task.title }}
267
+
268
+ {% if task.description %}
269
+ ## Description
270
+ {{ task.description }}
271
+ {% endif %}
272
+
273
+ ## Skills
274
+
275
+ Available skills in `.opencode/skills/`:
276
+ - `land` — MR landing playbook (CI/review monitoring, conflict resolution, squash-merge). Only read when you need to merge an MR.
277
+ - `install-glab` — idempotently install the GitLab CLI; run before any `glab` step when `command -v glab` fails.
278
+
279
+ ## State Flow
280
+
281
+ Three state buckets control how the scheduler manages your task:
282
+
283
+ - **Active** ({{ active_states }}): The scheduler dispatches agents in these states.
284
+ Includes initial state, in-progress state, merging state, and rework state.
285
+ - **Review** (`{{ review_state }}`): Transition here after creating MR. The scheduler
286
+ stops your worker but preserves the workspace. Wait for human review.
287
+ - **Terminal** ({{ terminal_states }}): The scheduler cleans the workspace.
288
+
289
+ ### Flow
290
+
291
+ 1. Start (active) → transition to in-progress state (active) before working
292
+ 2. Create MR, ensure CI green → transition to `{{ review_state }}` (review state)
293
+ 3. Human reviews — two paths:
294
+ - **Incremental fix**: human moves back to initial active state (MR still open) →
295
+ you get re-dispatched → fix on same branch → push → ensure CI green → back to `{{ review_state }}`
296
+ - **Full reset**: human moves to rework active state → you get re-dispatched →
297
+ close old MR, new branch from origin/main, start over → back to `{{ review_state }}`
298
+ 4. Human approves → moves to merging active state → you get re-dispatched →
299
+ read `land` skill → merge → transition to terminal state
300
+
301
+ ## Workflow
302
+
303
+ {% if attempt %}
304
+ This is attempt {{ attempt }}. Check the current Jira state and route accordingly:
305
+ - **Initial active state** (MR still open): incremental fix — read Jira comments for feedback, fix on same branch, push (MR auto-updates), ensure CI green, transition back to `{{ review_state }}`
306
+ - **Rework active state**: full reset — close old MR, new branch from origin/main, start over, transition back to `{{ review_state }}`
307
+ - **Merging active state**: read `land` skill to merge, then transition to terminal state
308
+ - **`{{ review_state }}`** (review state): do nothing — wait for human to move the task
309
+ If stuck, check `tasking.log` for execution failures. If you have an open merge request, read `land` skill.
310
+ {% else %}
311
+ This is the first attempt. Transition Jira to an in-progress active state (query transitions first via jira_rest MCP tool, find the id by name — do NOT hardcode it), then sync from origin/main into a new feature branch (see step 2 for the name), then read the codebase and understand the task before starting. NEVER commit or push directly to main — always work on a feature branch.
312
+ {% endif %}
313
+
314
+ ### For code tasks (workspace has a git repo):
315
+ 1. Transition Jira from current state to an in-progress active state (query transitions first via jira_rest MCP tool, find the id by name — do NOT hardcode it)
316
+ 2. Sync from origin/main into a new feature branch before making any change. Name it `feature/{{ task.identifier }}-<short-slug>` (e.g. `feature/{{ task.identifier }}-fix-login`). Do NOT commit, amend, or push to main directly — main is protected; all work goes on the feature branch.
317
+ 3. Make the necessary code changes on the feature branch
318
+ 4. Create a conventional commit on the feature branch
319
+ 5. Push the feature branch and create a GitLab MR from it via `glab mr create --source-branch feature/{{ task.identifier }}-<short-slug> --target-branch main` (glab is pre-authenticated via GITLAB_TOKEN). Do NOT push the feature branch to main.
320
+ 6. Sweep MR feedback, ensure CI is green
321
+ 7. Transition Jira to `{{ review_state }}`, add a comment summarizing your changes (files, rationale, MR link) via jira_rest MCP tool
322
+ 8. If you have output files (screenshots, logs, test reports), upload them as Jira attachments via jira_upload_attachment MCP tool
323
+ 9. Your worker will stop. Workspace is preserved. Wait for human review.
324
+
325
+ When re-dispatched from review (human moved your task):
326
+ - If back to initial active state (MR still open) → **incremental fix**: read MR discussion threads via `glab` (`glab mr view` / `glab api`) and Jira comments for feedback; for each thread — address substantive ones (reply with what you did + resolve), and briefly acknowledge + resolve nitpicks/out-of-scope ones; then fix on same branch, push (MR auto-updates), ensure CI green, transition back to `{{ review_state }}`
327
+ - If to rework active state → **full reset**: close old MR, new branch from origin/main, start over, transition back to `{{ review_state }}`
328
+ - If to merging active state → read `land` skill to merge; before merging ensure all MR discussion threads are resolved (addressed or acknowledged-and-resolved), resolve any unresolved blocking thread first, then transition to terminal state ({{ terminal_states }})
329
+
330
+ ### For non-code tasks (documentation, research, config):
331
+ 1. Complete the work
332
+ 2. Add a comment with a summary, query transitions, and transition directly to a terminal state (find the id by name via jira_rest MCP tool)
333
+ 3. If you have output files (reports, documents), upload them as Jira attachments via jira_upload_attachment MCP tool
334
+
335
+ ## Tracking
336
+ - Always add a comment before finishing, describing what you did
337
+ - If you created a MR, include the MR link in the comment
338
+ - If you have screenshots or demo links, include them in the comment
339
+ - If you have output files, upload them as attachments via jira_upload_attachment MCP tool
@@ -0,0 +1,267 @@
1
+ ---
2
+ interface_language: zh
3
+ # ============================================================================
4
+ # tracker: structured task source (Jira)
5
+ # ============================================================================
6
+ # This deployment runs Feishu direct sessions only (feishu-direct variant): no Jira source.
7
+ # To enable one: change kind below to jira and fill in the following fields
8
+ # (they are ignored — with a warning — while kind is none).
9
+ tracker:
10
+ # "jira" = structured source (scheduler polls and dispatches); "none" = no Jira source (direct-only).
11
+ kind: none
12
+
13
+ # ---- The following fields only take effect when kind is jira -------------
14
+ # Jira REST API endpoint. Cloud: https://your-domain.atlassian.net/rest/api/3
15
+ # Self-hosted: http://your-host:port/rest/api/2
16
+ # endpoint: https://your-domain.atlassian.net/rest/api/3
17
+
18
+ # Required (jira mode). Jira API token. Prefer a $VAR reference; never commit plaintext.
19
+ # api_key: $JIRA_API_TOKEN
20
+
21
+ # Required in basic mode (Cloud email or self-hosted username). Omit in bearer mode.
22
+ # api_user: you@example.com
23
+
24
+ # Auth mode. "basic" = email + token (common on Cloud); "bearer" = token only (self-hosted PAT)
25
+ # auth_mode: basic
26
+
27
+ # Name of the review handoff state; keep null for the minimal no-review flow.
28
+ # review_state: null
29
+
30
+ # Required (jira mode). Jira project key (e.g. "ENG"). Mutually exclusive with project_slug.
31
+ # project_key: ENG
32
+
33
+ # Alternative to project_key; set either one.
34
+ # project_slug: null
35
+
36
+ # Filter by assignee. null = no filter. "me" = currentUser().
37
+ # assignee: null
38
+
39
+ # Required-label filter. Empty = no filter.
40
+ # required_labels: []
41
+
42
+ # Candidate states. Only issues currently in these states are pulled as dispatch candidates.
43
+ # NOTE: State names differ across Jira deployments — adjust them to match YOUR Jira instance
44
+ # (these placeholder values are Chinese because the canonical zh deployment uses them).
45
+ # Three-tier state model: active (dispatch) / neither-review (stop worker, keep workspace) / terminal (clean up workspace).
46
+ # Minimal: active→work→terminal two-state flow, no review bucket.
47
+ # active_states:
48
+ # - 待办
49
+ # - 处理中
50
+
51
+ # Terminal states (workspaces cleaned up at startup when kind is jira).
52
+ # terminal_states:
53
+ # - 完成
54
+ # - 关闭
55
+
56
+ # ============================================================================
57
+ # polling: polling cadence
58
+ # ============================================================================
59
+ polling:
60
+ # Poll interval (ms). Default 30000 = 30 seconds. Must be > 0.
61
+ interval_ms: 30000
62
+
63
+ # ============================================================================
64
+ # workspace: per-task workspace
65
+ # ============================================================================
66
+ workspace:
67
+ # Workspace root directory. ~ expands to home. Relative paths resolve against the WORKFLOW.md directory.
68
+ # Each issue gets <root>/<sanitized_identifier>.
69
+ root: ~/tasking_workspaces
70
+
71
+ # ============================================================================
72
+ # hooks: workspace lifecycle hooks (optional)
73
+ # ============================================================================
74
+ hooks:
75
+ # Timeout for all hooks (ms). Default 60000 = 60 seconds. Must be > 0.
76
+ timeout_ms: 60000
77
+
78
+ # Runs only when a new workspace is created. Failure aborts creation. Commonly git clone + dependency install.
79
+ after_create: null
80
+
81
+ # Runs before each attempt. Failure aborts the current attempt.
82
+ # before_run: |
83
+ # git pull --ff-only origin main
84
+
85
+ # Runs after each attempt (success/failure/timeout alike). Failures are logged only.
86
+ after_run: null
87
+
88
+ # Runs before workspace removal (issue reached a terminal state). Failures are logged only; removal is not blocked.
89
+ # before_remove: |
90
+ # cd elixir && mix workspace.before_remove
91
+
92
+ # ============================================================================
93
+ # agent: concurrency & retry policy
94
+ # ============================================================================
95
+ agent:
96
+ # Global concurrency cap. At most this many opencode run subprocesses run simultaneously.
97
+ max_concurrent_agents: 10
98
+
99
+ # Turn limit within a single worker. When reached, the worker exits and the scheduler schedules a continuation retry.
100
+ # Starting at 3 is recommended to avoid oversized first-run token consumption.
101
+ max_turns: 20
102
+
103
+ # Backoff ceiling (ms). Default 300000 = 5 minutes.
104
+ max_retry_backoff_ms: 300000
105
+
106
+ # Per-state concurrency limits. Empty = unlimited. E.g. {"in progress": 2} caps the In Progress state at 2 concurrent workers.
107
+ max_concurrent_agents_by_state: {}
108
+
109
+ # ============================================================================
110
+ # opencode: worker subprocess configuration
111
+ # ============================================================================
112
+ opencode:
113
+ # opencode launch command. Default "opencode run".
114
+ command: opencode run
115
+
116
+ # opencode agent profile name.
117
+ agent: build
118
+
119
+ # Optional. Advisory catalog of known opencode agent profiles (string array). Surfaced by the `/agent` command; warns on unknown names.
120
+ # Empty array (default) = no validation, any `agent:<name>` passes through; non-empty = advisory validation, unknown names warn and fall back to the default. Not a hard allowlist.
121
+ agents: []
122
+
123
+ # Optional. opencode model (provider/model format), maps to `--model`. Default null (unset; uses opencode's default model).
124
+ model: null
125
+
126
+ # Optional. Model variant (provider-specific reasoning effort such as high/max/minimal), maps to `--variant`. Default null (unset). Independent of model.
127
+ variant: null
128
+
129
+ # Per-turn timeout (ms). Default 3600000 = 1 hour. Must be > 0.
130
+ # Hard wall-clock timeout: kills the turn when time is up regardless of activity.
131
+ turn_timeout_ms: 3600000
132
+
133
+ # Stall timeout (ms). Terminates the worker after this much time without activity.
134
+ # Default 7200000 = 2 hours. Set 0 to disable stall detection.
135
+ # Scheduler-level backstop: when neither the inactivity nor the wall-clock timeout can kill the subprocess
136
+ # (e.g. it refuses to honor SIGTERM). Timeouts SIGTERM first, then process-group
137
+ # SIGKILL after a 10s grace (see docs/adr/0020); this is only a backstop if
138
+ # the escalation itself fails.
139
+ # Set above turn_timeout_ms so normal turns are not mis-killed.
140
+ stall_timeout_ms: 7200000
141
+
142
+ # Inactivity timeout (ms). SIGTERM after stdout/stderr produces no data for this long.
143
+ # Default 600000 = 10 minutes. Set 0 to disable the inactivity timeout.
144
+ # Subprocess level: checks raw bytes and resets the timer whenever data arrives.
145
+ inactivity_timeout_ms: 600000
146
+
147
+ # ============================================================================
148
+ # router: route-agent triage for the unstructured source (Feishu)
149
+ # ============================================================================
150
+ # Not implemented: parsed only, no runtime code (reserved for a future route agent).
151
+ # router:
152
+ # Whether to enable the route agent. When enabled it runs in a bounded way per tick,
153
+ # triaging Feishu messages into Tasks.
154
+ # enabled: false
155
+
156
+ # opencode agent profile used by the route agent.
157
+ # agent: triage
158
+
159
+ # Max inbox entries processed per route-agent run.
160
+ # batch_size: 20
161
+
162
+ # Route-agent per-run timeout (ms). Default 120000 = 2 minutes.
163
+ # timeout_ms: 120000
164
+
165
+ # ============================================================================
166
+ # feishu: Feishu ↔ Jira comment bridge (REST polling, no public port)
167
+ # ============================================================================
168
+ feishu:
169
+ # When enabled, Feishu mirrors comments of existing Jira issues: threads bind 1:1 to issues, comments mirror both ways.
170
+ # Inbound uses REST polling (no webhooks, no exposed public port). See docs/feishu-quickstart.md.
171
+ enabled: true
172
+
173
+ # Feishu edition: feishu (China mainland, open.feishu.cn) | lark (overseas, open.larksuite.com). Defaults to feishu.
174
+ edition: feishu
175
+
176
+ # Feishu app credentials. Plaintext or a $VAR env reference both work.
177
+ app_id: $FEISHU_APP_ID
178
+ app_secret: $FEISHU_APP_SECRET
179
+
180
+ # Intake group chat_id: the dedicated group hosting all issue threads (get via GET /im/v1/chats). Required when enabled.
181
+ intake_chat_id: $FEISHU_INTAKE_CHAT_ID
182
+
183
+ # Jira→Feishu comment mirror cadence (ms), default 5s. Receiving runs over the event channel, not polling.
184
+ forward_interval_ms: 5000
185
+
186
+ # Sweep loss-backstop cadence (ms), default 12h. Catches offline windows; also fires at start and on WS reconnect.
187
+ sweep_interval_ms: 43200000
188
+
189
+ # Default issueType for /issue. Required only when kind is jira (unused in trackerless mode).
190
+ create_issue_type: Task
191
+
192
+ # Webhook-mode only (unused under REST polling; reserved for a future webhook mode).
193
+ # verification_token: $FEISHU_VERIFICATION_TOKEN
194
+ # encrypt_key: $FEISHU_ENCRYPT_KEY
195
+
196
+ # --------------------------------------------------------------------------
197
+ # Direct sessions (feishu.direct): bypass Jira and run opencode in fixed directories.
198
+ # Enabled by default when feishu.enabled is true; an explicit enabled: false opts out. See docs/configuration.md.
199
+ # --------------------------------------------------------------------------
200
+ direct:
201
+ # An explicit false turns direct sessions off.
202
+ enabled: true
203
+
204
+ # Project name → directory map, used by `/chat <project> <msg>`. The object form {path, auto_approve} overrides the global value.
205
+ # Example:
206
+ # projects:
207
+ # tasking: /home/me/workspace/tasking
208
+ # other: {path: /abs/dir, auto_approve: true}
209
+ projects:
210
+
211
+ # Directory-prefix allow-list for ad-hoc path mode (`/chat /abs/path <msg>`); empty = unrestricted.
212
+ path_roots: []
213
+
214
+ # true = pass --auto to opencode run (auto-approve permissions not explicitly denied).
215
+ # Default false: the permission stance comes from the target directory's own .opencode config.
216
+ auto_approve: false
217
+
218
+ # How much is mirrored to Feishu: quiet (final reply only) | summary (reply + stats line) | detailed (default; one process card per turn; collapsible panels need Feishu/Lark client >= V7.9).
219
+ verbosity: detailed
220
+
221
+ # Daemon-wide cap on concurrent direct turns (independent of Jira's max_concurrent_agents); per directory/session is always serial.
222
+ max_concurrent: 5
223
+
224
+ # Idle time before a session is marked expired (ms; it does not delete the opencode session on disk). Default 2592000000 = 30 days.
225
+ idle_ttl_ms: 2592000000
226
+
227
+ # ============================================================================
228
+ # server: HTTP dashboard (optional)
229
+ # ============================================================================
230
+ server:
231
+ # Dashboard port. null = do not start. Set e.g. 8080 to start.
232
+ port: null
233
+
234
+ # Bind address. "0.0.0.0" = all interfaces (externally reachable). "127.0.0.1" = local only.
235
+ host: 0.0.0.0
236
+
237
+ # ============================================================================
238
+ # logging: file logging (optional)
239
+ # ============================================================================
240
+ logging:
241
+ file:
242
+ # File log path. null = no file (stderr only). The CLI defaults to ./tasking.log at startup.
243
+ path: null
244
+
245
+ # Max bytes per file. Rotated once exceeded. Default 10485760 = 10 MB.
246
+ max_bytes: 10485760
247
+
248
+ # Rotation backup count. Keeps the most recent N backup files.
249
+ max_files: 5
250
+
251
+ # ============================================================================
252
+ # env: environment variables injected into worker subprocesses (optional)
253
+ # ============================================================================
254
+ # Values support $VAR indirection (same semantics as tracker.api_key).
255
+ # A variable resolving to an empty string is injected as an empty value. A missing env section defaults to {}.
256
+ env:
257
+ # GitLab token for the glab CLI (the minimal variant usually needs no MR; leave empty or configure as needed).
258
+ GITLAB_TOKEN: $GITLAB_TOKEN
259
+ GITLAB_HOST: $GITLAB_HOST
260
+ ---
261
+ <!-- tasking-workflow-lang: en -->
262
+ <!-- tasking-workflow: feishu-direct -->
263
+
264
+ <!--
265
+ Direct sessions need no workflow body: each Feishu message you send is the agent's task instruction.
266
+ To connect Jira later: re-run tasking init and choose "Connect Jira".
267
+ -->