@tothemax/tasking 0.0.0-stage → 0.6.16

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 (247) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -2
  3. package/README.zh-CN.md +122 -0
  4. package/assets/skills/install-glab/SKILL.md +70 -0
  5. package/assets/skills/land/SKILL.md +63 -0
  6. package/assets/skills/land/land_watch.py +312 -0
  7. package/assets/skills/openspec-archive-change/SKILL.md +114 -0
  8. package/assets/skills/opsx-grill-with-docs/SKILL.md +193 -0
  9. package/assets/skills/opsx-implement/SKILL.md +258 -0
  10. package/assets/skills/opsx-propose-with-tdd/SKILL.md +271 -0
  11. package/assets/workflows/WORKFLOW.code-mr.en.md.example +345 -0
  12. package/assets/workflows/WORKFLOW.code-mr.md.example +339 -0
  13. package/assets/workflows/WORKFLOW.feishu-direct.en.md.example +267 -0
  14. package/assets/workflows/WORKFLOW.feishu-direct.md.example +258 -0
  15. package/assets/workflows/WORKFLOW.grill-openspec.en.md.example +362 -0
  16. package/assets/workflows/WORKFLOW.grill-openspec.md.example +356 -0
  17. package/assets/workflows/WORKFLOW.minimal.en.md.example +296 -0
  18. package/assets/workflows/WORKFLOW.minimal.md.example +289 -0
  19. package/dist/adapters/feishu/events.d.ts +55 -0
  20. package/dist/adapters/feishu/events.d.ts.map +1 -0
  21. package/dist/adapters/feishu/events.js +184 -0
  22. package/dist/adapters/feishu/events.js.map +1 -0
  23. package/dist/adapters/feishu/index.d.ts +2 -0
  24. package/dist/adapters/feishu/index.d.ts.map +1 -0
  25. package/dist/adapters/feishu/index.js +2 -0
  26. package/dist/adapters/feishu/index.js.map +1 -0
  27. package/dist/adapters/feishu/probe.d.ts +31 -0
  28. package/dist/adapters/feishu/probe.d.ts.map +1 -0
  29. package/dist/adapters/feishu/probe.js +179 -0
  30. package/dist/adapters/feishu/probe.js.map +1 -0
  31. package/dist/adapters/feishu/source.d.ts +124 -0
  32. package/dist/adapters/feishu/source.d.ts.map +1 -0
  33. package/dist/adapters/feishu/source.js +715 -0
  34. package/dist/adapters/feishu/source.js.map +1 -0
  35. package/dist/adapters/jira/index.d.ts +2 -0
  36. package/dist/adapters/jira/index.d.ts.map +1 -0
  37. package/dist/adapters/jira/index.js +2 -0
  38. package/dist/adapters/jira/index.js.map +1 -0
  39. package/dist/adapters/jira/tracker.d.ts +63 -0
  40. package/dist/adapters/jira/tracker.d.ts.map +1 -0
  41. package/dist/adapters/jira/tracker.js +402 -0
  42. package/dist/adapters/jira/tracker.js.map +1 -0
  43. package/dist/bridge/binding-store.d.ts +93 -0
  44. package/dist/bridge/binding-store.d.ts.map +1 -0
  45. package/dist/bridge/binding-store.js +365 -0
  46. package/dist/bridge/binding-store.js.map +1 -0
  47. package/dist/bridge/commands.d.ts +45 -0
  48. package/dist/bridge/commands.d.ts.map +1 -0
  49. package/dist/bridge/commands.js +197 -0
  50. package/dist/bridge/commands.js.map +1 -0
  51. package/dist/bridge/comment-bridge.d.ts +116 -0
  52. package/dist/bridge/comment-bridge.d.ts.map +1 -0
  53. package/dist/bridge/comment-bridge.js +1473 -0
  54. package/dist/bridge/comment-bridge.js.map +1 -0
  55. package/dist/cli/daemon-info.d.ts +17 -0
  56. package/dist/cli/daemon-info.d.ts.map +1 -0
  57. package/dist/cli/daemon-info.js +64 -0
  58. package/dist/cli/daemon-info.js.map +1 -0
  59. package/dist/cli/daemon.d.ts +27 -0
  60. package/dist/cli/daemon.d.ts.map +1 -0
  61. package/dist/cli/daemon.js +77 -0
  62. package/dist/cli/daemon.js.map +1 -0
  63. package/dist/cli/doctor.d.ts +7 -0
  64. package/dist/cli/doctor.d.ts.map +1 -0
  65. package/dist/cli/doctor.js +156 -0
  66. package/dist/cli/doctor.js.map +1 -0
  67. package/dist/cli/event-channel.d.ts +16 -0
  68. package/dist/cli/event-channel.d.ts.map +1 -0
  69. package/dist/cli/event-channel.js +51 -0
  70. package/dist/cli/event-channel.js.map +1 -0
  71. package/dist/cli/help.d.ts +3 -0
  72. package/dist/cli/help.d.ts.map +1 -0
  73. package/dist/cli/help.js +155 -0
  74. package/dist/cli/help.js.map +1 -0
  75. package/dist/cli/index.d.ts +3 -0
  76. package/dist/cli/index.d.ts.map +1 -0
  77. package/dist/cli/index.js +774 -0
  78. package/dist/cli/index.js.map +1 -0
  79. package/dist/cli/init.d.ts +64 -0
  80. package/dist/cli/init.d.ts.map +1 -0
  81. package/dist/cli/init.js +1296 -0
  82. package/dist/cli/init.js.map +1 -0
  83. package/dist/cli/instance-lock.d.ts +13 -0
  84. package/dist/cli/instance-lock.d.ts.map +1 -0
  85. package/dist/cli/instance-lock.js +53 -0
  86. package/dist/cli/instance-lock.js.map +1 -0
  87. package/dist/cli/prompts.d.ts +13 -0
  88. package/dist/cli/prompts.d.ts.map +1 -0
  89. package/dist/cli/prompts.js +26 -0
  90. package/dist/cli/prompts.js.map +1 -0
  91. package/dist/cli/style.d.ts +26 -0
  92. package/dist/cli/style.d.ts.map +1 -0
  93. package/dist/cli/style.js +58 -0
  94. package/dist/cli/style.js.map +1 -0
  95. package/dist/cli/tui-helpers.d.ts +5 -0
  96. package/dist/cli/tui-helpers.d.ts.map +1 -0
  97. package/dist/cli/tui-helpers.js +124 -0
  98. package/dist/cli/tui-helpers.js.map +1 -0
  99. package/dist/cli/workflow-path.d.ts +12 -0
  100. package/dist/cli/workflow-path.d.ts.map +1 -0
  101. package/dist/cli/workflow-path.js +37 -0
  102. package/dist/cli/workflow-path.js.map +1 -0
  103. package/dist/config/config-types.d.ts +180 -0
  104. package/dist/config/config-types.d.ts.map +1 -0
  105. package/dist/config/config-types.js +71 -0
  106. package/dist/config/config-types.js.map +1 -0
  107. package/dist/config/dotenv.d.ts +2 -0
  108. package/dist/config/dotenv.d.ts.map +1 -0
  109. package/dist/config/dotenv.js +10 -0
  110. package/dist/config/dotenv.js.map +1 -0
  111. package/dist/config/index.d.ts +6 -0
  112. package/dist/config/index.d.ts.map +1 -0
  113. package/dist/config/index.js +6 -0
  114. package/dist/config/index.js.map +1 -0
  115. package/dist/config/loader.d.ts +5 -0
  116. package/dist/config/loader.d.ts.map +1 -0
  117. package/dist/config/loader.js +304 -0
  118. package/dist/config/loader.js.map +1 -0
  119. package/dist/config/manager.d.ts +31 -0
  120. package/dist/config/manager.d.ts.map +1 -0
  121. package/dist/config/manager.js +110 -0
  122. package/dist/config/manager.js.map +1 -0
  123. package/dist/config/resolver.d.ts +6 -0
  124. package/dist/config/resolver.d.ts.map +1 -0
  125. package/dist/config/resolver.js +267 -0
  126. package/dist/config/resolver.js.map +1 -0
  127. package/dist/config/validator.d.ts +9 -0
  128. package/dist/config/validator.d.ts.map +1 -0
  129. package/dist/config/validator.js +70 -0
  130. package/dist/config/validator.js.map +1 -0
  131. package/dist/direct/card.d.ts +49 -0
  132. package/dist/direct/card.d.ts.map +1 -0
  133. package/dist/direct/card.js +274 -0
  134. package/dist/direct/card.js.map +1 -0
  135. package/dist/direct/command.d.ts +12 -0
  136. package/dist/direct/command.d.ts.map +1 -0
  137. package/dist/direct/command.js +23 -0
  138. package/dist/direct/command.js.map +1 -0
  139. package/dist/direct/manager.d.ts +159 -0
  140. package/dist/direct/manager.d.ts.map +1 -0
  141. package/dist/direct/manager.js +1862 -0
  142. package/dist/direct/manager.js.map +1 -0
  143. package/dist/mcp/inject.d.ts +5 -0
  144. package/dist/mcp/inject.d.ts.map +1 -0
  145. package/dist/mcp/inject.js +51 -0
  146. package/dist/mcp/inject.js.map +1 -0
  147. package/dist/mcp/jira-server.d.ts +29 -0
  148. package/dist/mcp/jira-server.d.ts.map +1 -0
  149. package/dist/mcp/jira-server.js +288 -0
  150. package/dist/mcp/jira-server.js.map +1 -0
  151. package/dist/observability/activity-store.d.ts +29 -0
  152. package/dist/observability/activity-store.d.ts.map +1 -0
  153. package/dist/observability/activity-store.js +32 -0
  154. package/dist/observability/activity-store.js.map +1 -0
  155. package/dist/observability/config-view.d.ts +19 -0
  156. package/dist/observability/config-view.d.ts.map +1 -0
  157. package/dist/observability/config-view.js +61 -0
  158. package/dist/observability/config-view.js.map +1 -0
  159. package/dist/observability/http-dashboard.d.ts +36 -0
  160. package/dist/observability/http-dashboard.d.ts.map +1 -0
  161. package/dist/observability/http-dashboard.js +297 -0
  162. package/dist/observability/http-dashboard.js.map +1 -0
  163. package/dist/observability/log-buffer.d.ts +21 -0
  164. package/dist/observability/log-buffer.d.ts.map +1 -0
  165. package/dist/observability/log-buffer.js +69 -0
  166. package/dist/observability/log-buffer.js.map +1 -0
  167. package/dist/observability/logger.d.ts +37 -0
  168. package/dist/observability/logger.d.ts.map +1 -0
  169. package/dist/observability/logger.js +114 -0
  170. package/dist/observability/logger.js.map +1 -0
  171. package/dist/observability/snapshot.d.ts +11 -0
  172. package/dist/observability/snapshot.d.ts.map +1 -0
  173. package/dist/observability/snapshot.js +59 -0
  174. package/dist/observability/snapshot.js.map +1 -0
  175. package/dist/observability/terminal-dashboard.d.ts +155 -0
  176. package/dist/observability/terminal-dashboard.d.ts.map +1 -0
  177. package/dist/observability/terminal-dashboard.js +1598 -0
  178. package/dist/observability/terminal-dashboard.js.map +1 -0
  179. package/dist/observability/wrap.d.ts +4 -0
  180. package/dist/observability/wrap.d.ts.map +1 -0
  181. package/dist/observability/wrap.js +80 -0
  182. package/dist/observability/wrap.js.map +1 -0
  183. package/dist/scheduler/index.d.ts +2 -0
  184. package/dist/scheduler/index.d.ts.map +1 -0
  185. package/dist/scheduler/index.js +2 -0
  186. package/dist/scheduler/index.js.map +1 -0
  187. package/dist/scheduler/scheduler.d.ts +52 -0
  188. package/dist/scheduler/scheduler.d.ts.map +1 -0
  189. package/dist/scheduler/scheduler.js +535 -0
  190. package/dist/scheduler/scheduler.js.map +1 -0
  191. package/dist/shared/agent-resolver.d.ts +11 -0
  192. package/dist/shared/agent-resolver.d.ts.map +1 -0
  193. package/dist/shared/agent-resolver.js +20 -0
  194. package/dist/shared/agent-resolver.js.map +1 -0
  195. package/dist/shared/errors.d.ts +14 -0
  196. package/dist/shared/errors.d.ts.map +1 -0
  197. package/dist/shared/errors.js +24 -0
  198. package/dist/shared/errors.js.map +1 -0
  199. package/dist/shared/index.d.ts +4 -0
  200. package/dist/shared/index.d.ts.map +1 -0
  201. package/dist/shared/index.js +4 -0
  202. package/dist/shared/index.js.map +1 -0
  203. package/dist/shared/info-card.d.ts +24 -0
  204. package/dist/shared/info-card.d.ts.map +1 -0
  205. package/dist/shared/info-card.js +46 -0
  206. package/dist/shared/info-card.js.map +1 -0
  207. package/dist/shared/types.d.ts +148 -0
  208. package/dist/shared/types.d.ts.map +1 -0
  209. package/dist/shared/types.js +15 -0
  210. package/dist/shared/types.js.map +1 -0
  211. package/dist/translate/card.d.ts +2 -0
  212. package/dist/translate/card.d.ts.map +1 -0
  213. package/dist/translate/card.js +17 -0
  214. package/dist/translate/card.js.map +1 -0
  215. package/dist/translate/dict.d.ts +7 -0
  216. package/dist/translate/dict.d.ts.map +1 -0
  217. package/dist/translate/dict.js +895 -0
  218. package/dist/translate/dict.js.map +1 -0
  219. package/dist/translate/locale.d.ts +8 -0
  220. package/dist/translate/locale.d.ts.map +1 -0
  221. package/dist/translate/locale.js +75 -0
  222. package/dist/translate/locale.js.map +1 -0
  223. package/dist/translate/normalize.d.ts +4 -0
  224. package/dist/translate/normalize.d.ts.map +1 -0
  225. package/dist/translate/normalize.js +38 -0
  226. package/dist/translate/normalize.js.map +1 -0
  227. package/dist/translate/output.d.ts +3 -0
  228. package/dist/translate/output.d.ts.map +1 -0
  229. package/dist/translate/output.js +16 -0
  230. package/dist/translate/output.js.map +1 -0
  231. package/dist/worker/prompt.d.ts +11 -0
  232. package/dist/worker/prompt.d.ts.map +1 -0
  233. package/dist/worker/prompt.js +153 -0
  234. package/dist/worker/prompt.js.map +1 -0
  235. package/dist/worker/runner.d.ts +101 -0
  236. package/dist/worker/runner.d.ts.map +1 -0
  237. package/dist/worker/runner.js +448 -0
  238. package/dist/worker/runner.js.map +1 -0
  239. package/dist/workspace/index.d.ts +2 -0
  240. package/dist/workspace/index.d.ts.map +1 -0
  241. package/dist/workspace/index.js +2 -0
  242. package/dist/workspace/index.js.map +1 -0
  243. package/dist/workspace/manager.d.ts +37 -0
  244. package/dist/workspace/manager.d.ts.map +1 -0
  245. package/dist/workspace/manager.js +157 -0
  246. package/dist/workspace/manager.js.map +1 -0
  247. package/package.json +70 -4
@@ -0,0 +1,345 @@
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
+ <!-- tasking-workflow: code-mr -->
271
+
272
+ You are a coding agent working on: {{ task.identifier }} - {{ task.title }}
273
+
274
+ {% if task.description %}
275
+ ## Description
276
+ {{ task.description }}
277
+ {% endif %}
278
+
279
+ ## Skills
280
+
281
+ Available skills in `.opencode/skills/`:
282
+ - `land` — MR landing playbook (CI/review monitoring, conflict resolution, squash-merge). Only read when you need to merge an MR.
283
+ - `install-glab` — idempotently install the GitLab CLI; run before any `glab` step when `command -v glab` fails.
284
+
285
+ ## State Flow
286
+
287
+ Three state buckets control how the scheduler manages your task:
288
+
289
+ - **Active** ({{ active_states }}): The scheduler dispatches agents in these states.
290
+ Includes initial state, in-progress state, merging state, and rework state.
291
+ - **Review** (`{{ review_state }}`): Transition here after creating MR. The scheduler
292
+ stops your worker but preserves the workspace. Wait for human review.
293
+ - **Terminal** ({{ terminal_states }}): The scheduler cleans the workspace.
294
+
295
+ ### Flow
296
+
297
+ 1. Start (active) → transition to in-progress state (active) before working
298
+ 2. Create MR, ensure CI green → transition to `{{ review_state }}` (review state)
299
+ 3. Human reviews — two paths:
300
+ - **Incremental fix**: human moves back to initial active state (MR still open) →
301
+ you get re-dispatched → fix on same branch → push → ensure CI green → back to `{{ review_state }}`
302
+ - **Full reset**: human moves to rework active state → you get re-dispatched →
303
+ close old MR, new branch from origin/main, start over → back to `{{ review_state }}`
304
+ 4. Human approves → moves to merging active state → you get re-dispatched →
305
+ read `land` skill → merge → transition to terminal state
306
+
307
+ ## Workflow
308
+
309
+ {% if attempt %}
310
+ This is attempt {{ attempt }}. Check the current Jira state and route accordingly:
311
+ - **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 }}`
312
+ - **Rework active state**: full reset — close old MR, new branch from origin/main, start over, transition back to `{{ review_state }}`
313
+ - **Merging active state**: read `land` skill to merge, then transition to terminal state
314
+ - **`{{ review_state }}`** (review state): do nothing — wait for human to move the task
315
+ If stuck, check `tasking.log` for execution failures. If you have an open merge request, read `land` skill.
316
+ {% else %}
317
+ 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.
318
+ {% endif %}
319
+
320
+ ### For code tasks (workspace has a git repo):
321
+ 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)
322
+ 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.
323
+ 3. Make the necessary code changes on the feature branch
324
+ 4. Create a conventional commit on the feature branch
325
+ 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.
326
+ 6. Sweep MR feedback, ensure CI is green
327
+ 7. Transition Jira to `{{ review_state }}`, add a comment summarizing your changes (files, rationale, MR link) via jira_rest MCP tool
328
+ 8. If you have output files (screenshots, logs, test reports), upload them as Jira attachments via jira_upload_attachment MCP tool
329
+ 9. Your worker will stop. Workspace is preserved. Wait for human review.
330
+
331
+ When re-dispatched from review (human moved your task):
332
+ - 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 }}`
333
+ - If to rework active state → **full reset**: close old MR, new branch from origin/main, start over, transition back to `{{ review_state }}`
334
+ - 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 }})
335
+
336
+ ### For non-code tasks (documentation, research, config):
337
+ 1. Complete the work
338
+ 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)
339
+ 3. If you have output files (reports, documents), upload them as Jira attachments via jira_upload_attachment MCP tool
340
+
341
+ ## Tracking
342
+ - Always add a comment before finishing, describing what you did
343
+ - If you created a MR, include the MR link in the comment
344
+ - If you have screenshots or demo links, include them in the comment
345
+ - If you have output files, upload them as attachments via jira_upload_attachment MCP tool