@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,258 @@
1
+ ---
2
+ interface_language: zh
3
+ # ============================================================================
4
+ # tracker: 结构化任务源 (Jira)
5
+ # ============================================================================
6
+ # 本部署为飞书直连专用(feishu-direct 变体):未启用 Jira 任务源。
7
+ # 如需启用:把下方 kind 改为 jira 并取消填写以下字段(kind: none 时它们被忽略并告警)。
8
+ tracker:
9
+ # "jira" = 结构化任务源(调度器轮询派发);"none" = 无 Jira 源(飞书直连专用)。
10
+ kind: none
11
+
12
+ # ---- 以下字段仅在 kind: jira 时生效 --------------------------------------
13
+ # Jira REST API 端点。Cloud: https://your-domain.atlassian.net/rest/api/3
14
+ # 自托管: http://your-host:port/rest/api/2
15
+ # endpoint: https://your-domain.atlassian.net/rest/api/3
16
+
17
+ # 必填(jira 模式)。Jira API token。建议用 $VAR 环境变量引用,不写明文。
18
+ # Cloud: 账号设置 → 安全 → 创建 API token;自托管: 用户管理 → 生成 PAT
19
+ # api_key: $JIRA_API_TOKEN
20
+
21
+ # basic 模式必填 (Cloud email 或自托管用户名)。bearer 模式可省略。
22
+ # api_user: you@example.com
23
+
24
+ # 认证模式。"basic" = email + token (Cloud 常用);"bearer" = 仅 token (自托管 PAT)
25
+ # auth_mode: basic
26
+
27
+ # review 交接态名称。minimal 不用 review 暂停(无 MR),设 null。
28
+ # review_state: null
29
+
30
+ # 必填(jira 模式)。Jira 项目 key (如 "ENG")。与 project_slug 二选一。
31
+ # project_key: ENG
32
+
33
+ # project_key 的替代,二选一即可。
34
+ # project_slug: null
35
+
36
+ # 按指派人过滤。null = 不过滤。"me" = currentUser()。
37
+ # assignee: null
38
+
39
+ # 必需标签过滤。空 = 不过滤。
40
+ # required_labels: []
41
+
42
+ # 候选状态。只拉取处于这些状态的 issue 作为派发候选(三层状态模型见 docs/state-flow)。
43
+ # active_states:
44
+ # - 待办
45
+ # - 处理中
46
+
47
+ # 终态。处于这些状态的 issue 不会被派发,且启动时清理其工作区。
48
+ # terminal_states:
49
+ # - 完成
50
+ # - 关闭
51
+
52
+ # ============================================================================
53
+ # polling: 轮询节奏
54
+ # ============================================================================
55
+ polling:
56
+ # 轮询间隔 (毫秒)。默认 30000 = 30 秒。必须 > 0。
57
+ interval_ms: 30000
58
+
59
+ # ============================================================================
60
+ # workspace: per-task 工作区
61
+ # ============================================================================
62
+ workspace:
63
+ # 工作区根目录。~ 会展开为 home。相对路径基于 WORKFLOW.md 所在目录。
64
+ # 每个 issue 的工作区为 <root>/<sanitized_identifier>。
65
+ root: ~/tasking_workspaces
66
+
67
+ # ============================================================================
68
+ # hooks: 工作区生命周期钩子 (可选)
69
+ # ============================================================================
70
+ hooks:
71
+ # 所有 hook 的超时 (毫秒)。默认 60000 = 60 秒。必须 > 0。
72
+ timeout_ms: 60000
73
+
74
+ # 仅新工作区创建时运行。失败中止创建。常用于 git clone + 依赖安装。
75
+ after_create: null
76
+
77
+ # 每次 attempt 前运行。失败中止当前 attempt。
78
+ # before_run: |
79
+ # git pull --ff-only origin main
80
+
81
+ # 每次 attempt 后运行 (成功/失败/超时均执行)。失败仅记录。
82
+ after_run: null
83
+
84
+ # 工作区删除前运行 (issue 进入终态时)。失败仅记录,不阻塞删除。
85
+ # before_remove: |
86
+ # cd elixir && mix workspace.before_remove
87
+
88
+ # ============================================================================
89
+ # agent: 并发与重试策略
90
+ # ============================================================================
91
+ agent:
92
+ # 全局并发上限。同时运行的 opencode run 子进程数不超过此值。
93
+ max_concurrent_agents: 10
94
+
95
+ # 同一 worker 内的 turn 上限。达到后 worker 退出,调度续轮 retry。
96
+ # 建议起步设 3 避免首次 token 消耗过大。
97
+ max_turns: 20
98
+
99
+ # 退避上限 (毫秒)。默认 300000 = 5 分钟。
100
+ max_retry_backoff_ms: 300000
101
+
102
+ # 按状态限并发。空 = 不限。如 {"in progress": 2} 限制 In Progress 状态最多 2 个并发。
103
+ max_concurrent_agents_by_state: {}
104
+
105
+ # ============================================================================
106
+ # opencode: worker 子进程配置
107
+ # ============================================================================
108
+ opencode:
109
+ # opencode 启动命令。默认 "opencode run"。
110
+ command: opencode run
111
+
112
+ # opencode agent profile 名称。
113
+ agent: build
114
+
115
+ # 可选。已知 opencode agent profile 的咨询性目录(字符串数组)。供 `/agent` 命令展示并对未知名提示。
116
+ # 空目录(默认)=不校验,任何 `agent:<name>` 直通;非空=咨询性校验,未知名警告并回退默认。不作硬白名单。
117
+ agents: []
118
+
119
+ # 可选。opencode 模型 (provider/model 格式),映射 `--model`。默认 null(不配置,走 opencode 默认模型)。
120
+ model: null
121
+
122
+ # 可选。模型变体 (provider 特定推理档位,如 high/max/minimal),映射 `--variant`。默认 null(不配置)。与 model 彼此独立。
123
+ variant: null
124
+
125
+ # 单 turn 超时 (毫秒)。默认 3600000 = 1 小时。必须 > 0。
126
+ # 硬墙钟超时:无论活动状态如何,到点必杀。
127
+ turn_timeout_ms: 3600000
128
+
129
+ # 停滞超时 (毫秒)。超过此时间无活动则终止 worker。
130
+ # 默认 7200000 = 2 小时。设为 0 禁用停滞检测。
131
+ # scheduler 层兜底:当不活跃超时和墙钟超时都无法终止子进程时
132
+ # (如子进程拒绝响应 SIGTERM)。超时先 SIGTERM,10s 宽限未退出则
133
+ # 进程组 SIGKILL(见 docs/adr/0020);本项仅兜底升级路径自身失效。
134
+ # 建议设为大于 turn_timeout_ms 以避免正常 turn 被误杀。
135
+ stall_timeout_ms: 7200000
136
+
137
+ # 不活跃超时 (毫秒)。stdout/stderr 无数据超过此值则 SIGTERM 终止。
138
+ # 默认 600000 = 10 分钟。设为 0 禁用不活跃超时。
139
+ # subprocess 层:检查原始字节,收到数据时重置计时器。
140
+ inactivity_timeout_ms: 600000
141
+
142
+ # ============================================================================
143
+ # router: 非结构化源 (飞书) 的 route agent 分诊
144
+ # ============================================================================
145
+ # 未实现:当前仅解析,无运行时代码(预留供将来 route agent 实现)。
146
+ # router:
147
+ # 是否启用 route agent。启用后按 tick 有界运行,将飞书消息分诊为 Task。
148
+ # enabled: false
149
+
150
+ # route agent 使用的 opencode agent profile。
151
+ # agent: triage
152
+
153
+ # 单次 route agent 运行处理的 inbox 条目上限。
154
+ # batch_size: 20
155
+
156
+ # route agent 单次运行超时 (毫秒)。默认 120000 = 2 分钟。
157
+ # timeout_ms: 120000
158
+
159
+ # ============================================================================
160
+ # feishu: 飞书 ↔ Jira 评论桥 (REST 轮询,无公网端口)
161
+ # ============================================================================
162
+ feishu:
163
+ # 飞书入口(本变体的任务面):直连会话在固定目录跑 opencode(/chat 创建)。
164
+ # kind: jira 时另含评论镜像(话题 1:1 绑定 issue,双向镜像评论)。
165
+ enabled: true
166
+
167
+ # 飞书版本:feishu(国内版 open.feishu.cn)| lark(海外版 open.larksuite.com)。默认 feishu。
168
+ edition: feishu
169
+
170
+ # 飞书应用凭证。可明文,也可用 $VAR 环境变量引用。
171
+ app_id: $FEISHU_APP_ID
172
+ app_secret: $FEISHU_APP_SECRET
173
+
174
+ # intake 群 chat_id:承载所有 issue 线程的指定群(GET /im/v1/chats 取)。启用时必填。
175
+ intake_chat_id: $FEISHU_INTAKE_CHAT_ID
176
+
177
+ # 桥同步轮询节奏(毫秒),默认 5s。绑定线程定向轮询。
178
+ forward_interval_ms: 5000 # Jira→飞书评论镜像节奏,默认 5s;收消息走事件通道
179
+ sweep_interval_ms: 43200000 # 兜底清扫节奏(丢失补拉),默认 12h
180
+
181
+ # /issue 默认 issueType。仅 kind: jira 时必填(trackerless 下不使用)。
182
+ create_issue_type: Task
183
+
184
+ # webhook 模式专用(REST 轮询下不用,预留供将来 webhook 模式)。
185
+ # verification_token: $FEISHU_VERIFICATION_TOKEN
186
+ # encrypt_key: $FEISHU_ENCRYPT_KEY
187
+
188
+ # --------------------------------------------------------------------------
189
+ # 直连会话 (feishu.direct):绕过 Jira,在固定目录直接跑 opencode。
190
+ # feishu.enabled 为 true 时直连默认启用;段内 enabled: false 显式关闭。详见 docs/configuration.md。
191
+ # --------------------------------------------------------------------------
192
+ direct:
193
+ # 段内显式 false 关闭直连。
194
+ enabled: true
195
+
196
+ # 项目名 → 目录映射,供 `/chat <项目名> <消息>` 使用。对象形态 {path, auto_approve} 覆盖全局值。
197
+ # 例:
198
+ # projects:
199
+ # tasking: /home/me/workspace/tasking
200
+ # other: {path: /abs/dir, auto_approve: true}
201
+ projects:
202
+
203
+ # ad-hoc path 模式(`/chat /绝对路径 <消息>`)的目录前缀白名单;空 = 不限制。
204
+ path_roots: []
205
+
206
+ # true = 给 opencode run 传 --auto(自动放行未被显式拒绝的权限)。
207
+ # 默认 false:权限姿态由目标目录自己的 .opencode 权限配置决定。
208
+ auto_approve: false
209
+
210
+ # 镜像到飞书的事件量级:quiet(仅最终正文)| summary(正文 + 统计行)| detailed(默认,每 turn 一张过程卡片;折叠面板需飞书/Lark 客户端 >= V7.9)。
211
+ verbosity: detailed
212
+
213
+ # 直连 turn 的全局并发上限(独立于 Jira 的 max_concurrent_agents);同目录/同会话始终串行。
214
+ max_concurrent: 5
215
+
216
+ # 空闲多久后把会话标记为 expired(毫秒,不删除 opencode 磁盘 session)。默认 2592000000 = 30 天。
217
+ idle_ttl_ms: 2592000000
218
+
219
+ # ============================================================================
220
+ # server: HTTP 仪表板 (可选)
221
+ # ============================================================================
222
+ server:
223
+ # 仪表板端口。null = 不启动。设为 8080 则启动。
224
+ port: null
225
+
226
+ # 绑定地址。"0.0.0.0" = 全网卡 (外部可访问)。"127.0.0.1" = 仅本地。
227
+ host: 0.0.0.0
228
+
229
+ # ============================================================================
230
+ # logging: 文件日志 (可选)
231
+ # ============================================================================
232
+ logging:
233
+ file:
234
+ # 文件日志路径。null = 不写文件 (仅 stderr)。CLI 启动时默认为 ./tasking.log。
235
+ path: null
236
+
237
+ # 单文件最大字节数。超出后轮转。默认 10485760 = 10 MB。
238
+ max_bytes: 10485760
239
+
240
+ # 轮转备份数。保留最近 N 个备份文件。
241
+ max_files: 5
242
+
243
+ # ============================================================================
244
+ # env: 注入 worker 子进程的环境变量 (可选)
245
+ # ============================================================================
246
+ # 值支持 $VAR 间接引用 (与 tracker.api_key 相同语义)。
247
+ # 解析为空字符串时注入空字符串值。缺失的 env 段默认为空对象。
248
+ env:
249
+ # GitLab token,供 glab CLI 使用(minimal 通常不用 MR,可留空或按需配置)。
250
+ GITLAB_TOKEN: $GITLAB_TOKEN
251
+ GITLAB_HOST: $GITLAB_HOST
252
+ ---
253
+ <!-- tasking-workflow: feishu-direct -->
254
+
255
+ <!--
256
+ 直连会话不需要下面的工作流说明:你在飞书里发的消息就是给 agent 的任务指令。
257
+ 想接 Jira:重新运行 tasking init,选「接 Jira」即可。
258
+ -->
@@ -0,0 +1,362 @@
1
+ ---
2
+ interface_language: zh
3
+ # ============================================================================
4
+ # tracker: structured task source (Jira)
5
+ # ============================================================================
6
+ tracker:
7
+ # Required. Only "jira" is supported.
8
+ kind: jira
9
+
10
+ # Jira REST API endpoint. Cloud: https://your-domain.atlassian.net/rest/api/3
11
+ # Self-hosted: http://your-host:port/rest/api/2
12
+ endpoint: https://your-domain.atlassian.net/rest/api/3
13
+
14
+ # Required. Jira API token. Prefer a $VAR environment-variable reference; never commit plaintext.
15
+ # Cloud: Account settings → Security → Create API token
16
+ # Self-hosted: User management → Generate PAT
17
+ api_key: $JIRA_API_TOKEN
18
+
19
+ # Required in basic mode (Cloud email or self-hosted username). Omit in bearer mode.
20
+ api_user: you@example.com
21
+
22
+ # Auth mode. "basic" = email + token (common on Cloud); "bearer" = token only (self-hosted PAT)
23
+ auth_mode: basic
24
+
25
+ # Name of the review handoff state (e.g. "In Review").
26
+ # Keep this state out of active_states and terminal_states — it automatically becomes an implicit intermediate state.
27
+ # The agent transitions here after creating an MR; the scheduler stops the worker but preserves the workspace.
28
+ review_state: 代码评审中
29
+
30
+ # Required. 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 (pull all matching issues in the project). "me" = currentUser() (current API user).
37
+ assignee: null
38
+
39
+ # Required-label filter. Empty = no filter. E.g. ["tothemax"] dispatches only issues carrying that label.
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
+ # The review state stays out of active_states / terminal_states — it becomes an implicit intermediate state automatically.
47
+ # After human review there are two paths: back to the initial state = incremental fix (same branch);
48
+ # to the rework state = full reset (close MR, fresh branch).
49
+ active_states:
50
+ - 待办
51
+ - 处理中
52
+ - 合并中
53
+ - 重置处理
54
+
55
+ # Terminal states. Issues in these states are never dispatched, and their workspaces are cleaned up at startup.
56
+ terminal_states:
57
+ - 完成
58
+ - 关闭
59
+ - 取消
60
+ - 重复
61
+
62
+ # ============================================================================
63
+ # polling: polling cadence
64
+ # ============================================================================
65
+ polling:
66
+ # Poll interval (ms). Default 30000 = 30 seconds. Must be > 0.
67
+ interval_ms: 30000
68
+
69
+ # ============================================================================
70
+ # workspace: per-task workspace
71
+ # ============================================================================
72
+ workspace:
73
+ # Workspace root directory. ~ expands to home. Relative paths resolve against the WORKFLOW.md directory.
74
+ # Each issue gets <root>/<sanitized_identifier>.
75
+ root: ~/tasking_workspaces
76
+
77
+ # ============================================================================
78
+ # hooks: workspace lifecycle hooks (optional)
79
+ # ============================================================================
80
+ hooks:
81
+ # Timeout for all hooks (ms). Default 60000 = 60 seconds. Must be > 0.
82
+ timeout_ms: 60000
83
+
84
+ # Runs only when a new workspace is created. Failure aborts creation. Commonly git clone + dependency install.
85
+ after_create: null
86
+
87
+ # Runs before each attempt. Failure aborts the current attempt.
88
+ # before_run: |
89
+ # git pull --ff-only origin main
90
+
91
+ # Runs after each attempt (success/failure/timeout alike). Failures are logged only.
92
+ after_run: null
93
+
94
+ # Runs before workspace removal (issue reached a terminal state). Failures are logged only; removal is not blocked.
95
+ # before_remove: |
96
+ # cd elixir && mix workspace.before_remove
97
+
98
+ # ============================================================================
99
+ # agent: concurrency & retry policy
100
+ # ============================================================================
101
+ agent:
102
+ # Global concurrency cap. At most this many opencode run subprocesses run simultaneously.
103
+ max_concurrent_agents: 10
104
+
105
+ # Turn limit within a single worker. When reached, the worker exits and the scheduler schedules a continuation retry.
106
+ # Starting at 3 is recommended to avoid oversized first-run token consumption.
107
+ max_turns: 20
108
+
109
+ # Backoff ceiling (ms). Default 300000 = 5 minutes.
110
+ max_retry_backoff_ms: 300000
111
+
112
+ # Per-state concurrency limits. Empty = unlimited. E.g. {"in progress": 2} caps the In Progress state at 2 concurrent workers.
113
+ max_concurrent_agents_by_state: {}
114
+
115
+ # ============================================================================
116
+ # opencode: worker subprocess configuration
117
+ # ============================================================================
118
+ opencode:
119
+ # opencode launch command. Default "opencode run".
120
+ command: opencode run
121
+
122
+ # opencode agent profile name.
123
+ agent: build
124
+
125
+ # Optional. Advisory catalog of known opencode agent profiles (string array). Surfaced by the `/agent` command; warns on unknown names.
126
+ # 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.
127
+ agents: []
128
+
129
+ # Optional. opencode model (provider/model format), maps to `--model`. Default null (unset; uses opencode's default model).
130
+ model: null
131
+
132
+ # Optional. Model variant (provider-specific reasoning effort such as high/max/minimal), maps to `--variant`. Default null (unset). Independent of model.
133
+ variant: null
134
+
135
+ # Per-turn timeout (ms). Default 3600000 = 1 hour. Must be > 0.
136
+ # Hard wall-clock timeout: kills the turn when time is up regardless of activity.
137
+ turn_timeout_ms: 3600000
138
+
139
+ # Stall timeout (ms). Terminates the worker after this much time without activity.
140
+ # Default 7200000 = 2 hours. Set 0 to disable stall detection.
141
+ # Scheduler-level backstop: when neither the inactivity nor the wall-clock timeout can kill the subprocess
142
+ # (e.g. it refuses to honor SIGTERM). Timeouts SIGTERM first, then process-group
143
+ # SIGKILL after a 10s grace (see docs/adr/0020); this is only a backstop if
144
+ # the escalation itself fails.
145
+ # Set above turn_timeout_ms so normal turns are not mis-killed.
146
+ stall_timeout_ms: 7200000
147
+
148
+ # Inactivity timeout (ms). SIGTERM after stdout/stderr produces no data for this long.
149
+ # Default 600000 = 10 minutes. Set 0 to disable the inactivity timeout.
150
+ # Subprocess level: checks raw bytes and resets the timer whenever data arrives.
151
+ inactivity_timeout_ms: 600000
152
+
153
+ # ============================================================================
154
+ # router: route-agent triage for the unstructured source (Feishu)
155
+ # ============================================================================
156
+ # Not implemented: parsed only, no runtime code (reserved for a future route agent).
157
+ # router:
158
+ # Whether to enable the route agent. When enabled it runs in a bounded way per tick,
159
+ # triaging Feishu messages into Tasks.
160
+ # enabled: false
161
+
162
+ # opencode agent profile used by the route agent.
163
+ # agent: triage
164
+
165
+ # Max inbox entries processed per route-agent run.
166
+ # batch_size: 20
167
+
168
+ # Route-agent per-run timeout (ms). Default 120000 = 2 minutes.
169
+ # timeout_ms: 120000
170
+
171
+ # ============================================================================
172
+ # feishu: Feishu ↔ Jira comment bridge (REST polling, no public port)
173
+ # ============================================================================
174
+ feishu:
175
+ # When enabled, Feishu mirrors comments of existing Jira issues: threads bind 1:1 to issues, comments mirror both ways.
176
+ # Inbound uses REST polling (no webhooks, no exposed public port). See docs/feishu-quickstart.md.
177
+ enabled: false
178
+
179
+ # Feishu edition: feishu (China mainland, open.feishu.cn) | lark (overseas, open.larksuite.com). Defaults to feishu.
180
+ edition: feishu
181
+
182
+ # Feishu app credentials. Plaintext or a $VAR env reference both work.
183
+ app_id: $FEISHU_APP_ID
184
+ app_secret: $FEISHU_APP_SECRET
185
+
186
+ # Intake group chat_id: the dedicated group hosting all issue threads (get via GET /im/v1/chats). Required when enabled.
187
+ intake_chat_id: $FEISHU_INTAKE_CHAT_ID
188
+
189
+ # Jira→Feishu comment mirror cadence (ms), default 5s. Receiving runs over the event channel, not polling.
190
+ forward_interval_ms: 5000
191
+
192
+ # Sweep loss-backstop cadence (ms), default 12h. Catches offline windows; also fires at start and on WS reconnect.
193
+ sweep_interval_ms: 43200000
194
+
195
+ # Default issueType for /issue (tasking init lists the project's available types). Required when enabled.
196
+ create_issue_type: Task
197
+
198
+ # Webhook-mode only (unused under REST polling; reserved for a future webhook mode).
199
+ # verification_token: $FEISHU_VERIFICATION_TOKEN
200
+ # encrypt_key: $FEISHU_ENCRYPT_KEY
201
+
202
+ # --------------------------------------------------------------------------
203
+ # Direct sessions (feishu.direct): bypass Jira and run opencode in fixed directories.
204
+ # Enabled by default when feishu.enabled is true; an explicit enabled: false opts out. See docs/configuration.md.
205
+ # --------------------------------------------------------------------------
206
+ direct:
207
+ # An explicit false turns direct sessions off.
208
+ enabled: true
209
+
210
+ # Project name → directory map, used by `/chat <project> <msg>`. The object form {path, auto_approve} overrides the global value.
211
+ # Example:
212
+ # projects:
213
+ # tasking: /home/me/workspace/tasking
214
+ # other: {path: /abs/dir, auto_approve: true}
215
+ projects:
216
+
217
+ # Directory-prefix allow-list for ad-hoc path mode (`/chat /abs/path <msg>`); empty = unrestricted.
218
+ path_roots: []
219
+
220
+ # true = pass --auto to opencode run (auto-approve permissions not explicitly denied).
221
+ # Default false: the permission stance comes from the target directory's own .opencode config.
222
+ auto_approve: false
223
+
224
+ # 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).
225
+ verbosity: detailed
226
+
227
+ # Daemon-wide cap on concurrent direct turns (independent of Jira's max_concurrent_agents); per directory/session is always serial.
228
+ max_concurrent: 5
229
+
230
+ # Idle time before a session is marked expired (ms; it does not delete the opencode session on disk). Default 2592000000 = 30 days.
231
+ idle_ttl_ms: 2592000000
232
+
233
+ # ============================================================================
234
+ # server: HTTP dashboard (optional)
235
+ # ============================================================================
236
+ server:
237
+ # Dashboard port. null = do not start. Set e.g. 8080 to start.
238
+ port: null
239
+
240
+ # Bind address. "0.0.0.0" = all interfaces (externally reachable). "127.0.0.1" = local only.
241
+ host: 0.0.0.0
242
+
243
+ # ============================================================================
244
+ # logging: file logging (optional)
245
+ # ============================================================================
246
+ logging:
247
+ file:
248
+ # File log path. null = no file (stderr only). The CLI defaults to ./tasking.log at startup.
249
+ path: null
250
+
251
+ # Max bytes per file. Rotated once exceeded. Default 10485760 = 10 MB.
252
+ max_bytes: 10485760
253
+
254
+ # Rotation backup count. Keeps the most recent N backup files.
255
+ max_files: 5
256
+
257
+ # ============================================================================
258
+ # env: environment variables injected into worker subprocesses (optional)
259
+ # ============================================================================
260
+ # Values support $VAR indirection (same semantics as tracker.api_key).
261
+ # A variable resolving to an empty string is injected as an empty value. A missing env section defaults to {}.
262
+ env:
263
+ # GitLab token for the glab CLI. glab reads this env var automatically.
264
+ GITLAB_TOKEN: $GITLAB_TOKEN
265
+ GITLAB_HOST: $GITLAB_HOST
266
+ ---
267
+
268
+ <!-- tasking-workflow-lang: en -->
269
+
270
+ You are a coding agent running the grill-openspec workflow on: {{ task.identifier }} - {{ task.title }}
271
+
272
+ {% if task.description %}
273
+ ## Description
274
+ {{ task.description }}
275
+ {% endif %}
276
+
277
+ ## Skills (installed by `tasking init` into the target repo — the runtime daemon does NOT copy them)
278
+
279
+ This workflow uses four skills. They live in `.opencode/skills/`. `tasking init --workflow grill-openspec` installs them (plus `land`) into the target repo, which the `after_create` hook clones into each workspace — the runtime daemon does NOT copy them per-workspace. If any is missing, the target repo's `.opencode/skills/` is incomplete: re-run `tasking init` or commit the missing skill.
280
+ - `opsx-grill-with-docs` — interview to sharpen the plan; draft `CONTEXT.md` + `docs/adr/`
281
+ - `opsx-propose-with-tdd` — create the openspec change (proposal/design/tasks)
282
+ - `opsx-implement` — implement tasks + create MR
283
+ - `openspec-archive-change` — archive the openspec change (workspace close-out)
284
+ - `install-glab` — idempotently install the GitLab CLI; run before any `glab` step when `command -v glab` fails.
285
+
286
+ ## State model
287
+
288
+ Three state buckets control how the scheduler manages your task:
289
+ - **Active** ({{ active_states }}): the scheduler dispatches you here.
290
+ - **Review** (`{{ review_state }}`): the scheduler stops your worker but preserves the workspace. Wait for a human decision.
291
+ - **Terminal** ({{ terminal_states }}): the scheduler removes the workspace.
292
+
293
+ The state you are in only picks the bucket. Which **phase** you run is determined by YOU from artifacts — NOT from the state name. Never hardcode state names; query Jira transitions via the `jira_rest` MCP tool and pick by semantic match.
294
+
295
+ ## Phase routing — determine your phase from artifacts
296
+
297
+ On every dispatch, inspect in order:
298
+ 1. Is there an open MR? (check `glab mr list` or the git remote)
299
+ 2. Does an openspec change exist? (`openspec/changes/<name>/` with `tasks.md`)
300
+ 3. Does `CONTEXT.md` exist (grill drafted terms/decisions)?
301
+ 4. Was a grill comment posted? (read Jira comments for the marker `## 🔍 拷问 / Grill Questions`)
302
+
303
+ If uncertain at any step, read the latest Jira comments; if still uncertain, escalate (see Mid-run escalation below).
304
+
305
+ ## State hygiene when starting work
306
+
307
+ When you start a working phase (grill or implementation) on a dispatch: if the current Jira state is the initial active state (not yet "in progress"), query transitions via `jira_rest` (`GET /issue/{{ task.identifier }}/transitions`) and transition to the active state whose name semantically means "in progress / working" — pick by semantic match, do NOT hardcode the state name. Skip if already in progress. The merge phase needs no such transition (the human already moved it to the "merging" state).
308
+
309
+ ## Phase 1: grill
310
+
311
+ No grill comment exists in Jira yet (first dispatch, or a fresh workspace with no prior grill). Run the `opsx-grill-with-docs` skill:
312
+ - Resolve every fact you can from the codebase/environment first — do NOT ask the human what you can look up yourself.
313
+ - Draft `CONTEXT.md` and `docs/adr/*.md` for the terms and decisions you could resolve.
314
+ - Batch the remaining DECISIONS that truly need a human into ONE Jira comment with the marker header `## 🔍 拷问 / Grill Questions` (numbered questions, each with your recommended answer).
315
+ - Transition to `{{ review_state }}` and stop. Do NOT create an MR. Do NOT create an openspec change yet — that belongs to Phase 2.
316
+ - If you can resolve everything from the codebase (zero open decisions): skip the comment and the review pause, and go straight to Phase 2.
317
+
318
+ ### Re-dispatch after grill review (human answered, moved back to active)
319
+
320
+ Read Jira comments, find your grill comment, ingest the human's answers, and update `CONTEXT.md`/ADR. For any question the human did NOT answer: adopt your own recommended answer (note "unanswered — recommendation adopted" in a comment) and continue — keep momentum. Only if a question is truly blocking (you cannot proceed without an answer) do you re-post just that question and transition back to `{{ review_state }}`. Then proceed to Phase 2.
321
+
322
+ ## Phase 2: implement (propose-with-tdd + implement)
323
+
324
+ A grill comment exists in Jira AND the human has answered, and no MR exists yet. Run:
325
+ 1. `opsx-propose-with-tdd` — create the openspec change at `openspec/changes/<name>/` (proposal/design/tasks).
326
+ 2. `opsx-implement` — implement all tasks TDD-style (red → green). Commit the code AND `openspec/changes/<name>/` together into a feature branch named `feature/{{ task.identifier }}-<short-slug>`. Do NOT push to main.
327
+ 3. Push the feature branch and create a GitLab MR via `glab` (pre-authenticated via `GITLAB_TOKEN`).
328
+ 4. Sweep MR feedback and ensure CI is green.
329
+ 5. Add a Jira comment summarizing your changes (files, rationale, MR link) via `jira_rest`, then transition to `{{ review_state }}`. Stop.
330
+
331
+ ## Phase 3: merge (land + archive)
332
+
333
+ The current active state semantically means "merging" (approve-to-merge), OR an open MR exists and is approved. Determine the merge signal:
334
+ - If the current active state clearly conveys "merging" semantically → merge phase.
335
+ - Else (ambiguous) → check `glab mr view` for the MR approval status: approved → merge phase; not approved + review feedback → incremental fix (below).
336
+
337
+ In merge phase:
338
+ 1. Run the `land` skill to merge the MR.
339
+ 2. Run the `openspec-archive-change` skill to archive the openspec change. This is a workspace-local close-out — the archive lives in this workspace; the openspec change persists upstream because you committed `openspec/changes/<name>/` into the feature branch in Phase 2 and the MR was just merged.
340
+ 3. Transition to a terminal state ({{ terminal_states }}). The scheduler will then remove the workspace.
341
+
342
+ Before step 1 (merge), ensure all MR discussion threads are resolved: threads you addressed and threads you deliberately skipped (nitpicks / out-of-scope) must all be resolved — reply briefly on the skipped ones explaining why, then resolve. Resolve any unresolved blocking thread first. Use `glab` (`glab mr view` to list discussions, `glab api` to resolve via the GitLab discussions API).
343
+
344
+ ## Incremental fix (MR open, review feedback — do NOT re-grill)
345
+
346
+ An open MR exists with unresolved review feedback (not approved). Read the MR discussion threads via `glab` (`glab mr view` / `glab api`). For each thread: if you address it, reply with what you did and resolve the thread; if you deliberately don't address it (nitpick / out-of-scope), reply briefly explaining why and resolve it anyway. Then fix on the SAME branch, push (the MR auto-updates), ensure CI is green, transition back to `{{ review_state }}`. Do NOT re-grill. Do NOT re-propose.
347
+
348
+ ## Full reset (rework — do NOT re-grill)
349
+
350
+ If the current active state semantically means "rework/reset" (full redo): close the old MR, create a new branch from origin/main, and re-run `opsx-implement` against the EXISTING openspec change (`tasks.md` survives). Do NOT re-grill, do NOT re-propose — the plan (CONTEXT.md/ADR/openspec change) survives; only the code/MR is discarded. Transition back to `{{ review_state }}`.
351
+
352
+ ## Mid-run escalation (any phase)
353
+
354
+ If at any point you hit a decision you truly cannot make and need a human: post a Jira comment with the marker `## 🔍 拷问 / Grill Questions` containing the blocking question (with your recommended answer), transition to `{{ review_state }}`, and stop. On re-dispatch (human answered, moved back to active), resume the phase you were in — determine it from artifacts per the Phase routing above.
355
+
356
+ ## Transitions & tracking
357
+
358
+ - Always query available transitions first via `jira_rest` (`GET /issue/{{ task.identifier }}/transitions`) and pick the id by semantic name match — do NOT hardcode transition ids (they differ across Jira instances).
359
+ - Always add a comment before finishing, describing what you did.
360
+ - If you created or merged an MR, include the MR link in the comment.
361
+ - If you posted a grill comment, reference it.
362
+ - If you have output files (screenshots, logs, reports), upload them as Jira attachments via `jira_upload_attachment` MCP tool.