@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.
- package/LICENSE +21 -0
- package/README.md +121 -2
- package/README.zh-CN.md +122 -0
- package/assets/skills/install-glab/SKILL.md +70 -0
- package/assets/skills/land/SKILL.md +63 -0
- package/assets/skills/land/land_watch.py +312 -0
- package/assets/skills/openspec-archive-change/SKILL.md +114 -0
- package/assets/skills/opsx-grill-with-docs/SKILL.md +193 -0
- package/assets/skills/opsx-implement/SKILL.md +258 -0
- package/assets/skills/opsx-propose-with-tdd/SKILL.md +271 -0
- package/assets/workflows/WORKFLOW.code-mr.en.md.example +345 -0
- package/assets/workflows/WORKFLOW.code-mr.md.example +339 -0
- package/assets/workflows/WORKFLOW.feishu-direct.en.md.example +267 -0
- package/assets/workflows/WORKFLOW.feishu-direct.md.example +258 -0
- package/assets/workflows/WORKFLOW.grill-openspec.en.md.example +362 -0
- package/assets/workflows/WORKFLOW.grill-openspec.md.example +356 -0
- package/assets/workflows/WORKFLOW.minimal.en.md.example +296 -0
- package/assets/workflows/WORKFLOW.minimal.md.example +289 -0
- package/dist/adapters/feishu/events.d.ts +55 -0
- package/dist/adapters/feishu/events.d.ts.map +1 -0
- package/dist/adapters/feishu/events.js +184 -0
- package/dist/adapters/feishu/events.js.map +1 -0
- package/dist/adapters/feishu/index.d.ts +2 -0
- package/dist/adapters/feishu/index.d.ts.map +1 -0
- package/dist/adapters/feishu/index.js +2 -0
- package/dist/adapters/feishu/index.js.map +1 -0
- package/dist/adapters/feishu/probe.d.ts +31 -0
- package/dist/adapters/feishu/probe.d.ts.map +1 -0
- package/dist/adapters/feishu/probe.js +179 -0
- package/dist/adapters/feishu/probe.js.map +1 -0
- package/dist/adapters/feishu/source.d.ts +124 -0
- package/dist/adapters/feishu/source.d.ts.map +1 -0
- package/dist/adapters/feishu/source.js +715 -0
- package/dist/adapters/feishu/source.js.map +1 -0
- package/dist/adapters/jira/index.d.ts +2 -0
- package/dist/adapters/jira/index.d.ts.map +1 -0
- package/dist/adapters/jira/index.js +2 -0
- package/dist/adapters/jira/index.js.map +1 -0
- package/dist/adapters/jira/tracker.d.ts +63 -0
- package/dist/adapters/jira/tracker.d.ts.map +1 -0
- package/dist/adapters/jira/tracker.js +402 -0
- package/dist/adapters/jira/tracker.js.map +1 -0
- package/dist/bridge/binding-store.d.ts +93 -0
- package/dist/bridge/binding-store.d.ts.map +1 -0
- package/dist/bridge/binding-store.js +365 -0
- package/dist/bridge/binding-store.js.map +1 -0
- package/dist/bridge/commands.d.ts +45 -0
- package/dist/bridge/commands.d.ts.map +1 -0
- package/dist/bridge/commands.js +197 -0
- package/dist/bridge/commands.js.map +1 -0
- package/dist/bridge/comment-bridge.d.ts +116 -0
- package/dist/bridge/comment-bridge.d.ts.map +1 -0
- package/dist/bridge/comment-bridge.js +1473 -0
- package/dist/bridge/comment-bridge.js.map +1 -0
- package/dist/cli/daemon-info.d.ts +17 -0
- package/dist/cli/daemon-info.d.ts.map +1 -0
- package/dist/cli/daemon-info.js +64 -0
- package/dist/cli/daemon-info.js.map +1 -0
- package/dist/cli/daemon.d.ts +27 -0
- package/dist/cli/daemon.d.ts.map +1 -0
- package/dist/cli/daemon.js +77 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +156 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/event-channel.d.ts +16 -0
- package/dist/cli/event-channel.d.ts.map +1 -0
- package/dist/cli/event-channel.js +51 -0
- package/dist/cli/event-channel.js.map +1 -0
- package/dist/cli/help.d.ts +3 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +155 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +774 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +64 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +1296 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/instance-lock.d.ts +13 -0
- package/dist/cli/instance-lock.d.ts.map +1 -0
- package/dist/cli/instance-lock.js +53 -0
- package/dist/cli/instance-lock.js.map +1 -0
- package/dist/cli/prompts.d.ts +13 -0
- package/dist/cli/prompts.d.ts.map +1 -0
- package/dist/cli/prompts.js +26 -0
- package/dist/cli/prompts.js.map +1 -0
- package/dist/cli/style.d.ts +26 -0
- package/dist/cli/style.d.ts.map +1 -0
- package/dist/cli/style.js +58 -0
- package/dist/cli/style.js.map +1 -0
- package/dist/cli/tui-helpers.d.ts +5 -0
- package/dist/cli/tui-helpers.d.ts.map +1 -0
- package/dist/cli/tui-helpers.js +124 -0
- package/dist/cli/tui-helpers.js.map +1 -0
- package/dist/cli/workflow-path.d.ts +12 -0
- package/dist/cli/workflow-path.d.ts.map +1 -0
- package/dist/cli/workflow-path.js +37 -0
- package/dist/cli/workflow-path.js.map +1 -0
- package/dist/config/config-types.d.ts +180 -0
- package/dist/config/config-types.d.ts.map +1 -0
- package/dist/config/config-types.js +71 -0
- package/dist/config/config-types.js.map +1 -0
- package/dist/config/dotenv.d.ts +2 -0
- package/dist/config/dotenv.d.ts.map +1 -0
- package/dist/config/dotenv.js +10 -0
- package/dist/config/dotenv.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +5 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +304 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/manager.d.ts +31 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +110 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/resolver.d.ts +6 -0
- package/dist/config/resolver.d.ts.map +1 -0
- package/dist/config/resolver.js +267 -0
- package/dist/config/resolver.js.map +1 -0
- package/dist/config/validator.d.ts +9 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +70 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/direct/card.d.ts +49 -0
- package/dist/direct/card.d.ts.map +1 -0
- package/dist/direct/card.js +274 -0
- package/dist/direct/card.js.map +1 -0
- package/dist/direct/command.d.ts +12 -0
- package/dist/direct/command.d.ts.map +1 -0
- package/dist/direct/command.js +23 -0
- package/dist/direct/command.js.map +1 -0
- package/dist/direct/manager.d.ts +159 -0
- package/dist/direct/manager.d.ts.map +1 -0
- package/dist/direct/manager.js +1862 -0
- package/dist/direct/manager.js.map +1 -0
- package/dist/mcp/inject.d.ts +5 -0
- package/dist/mcp/inject.d.ts.map +1 -0
- package/dist/mcp/inject.js +51 -0
- package/dist/mcp/inject.js.map +1 -0
- package/dist/mcp/jira-server.d.ts +29 -0
- package/dist/mcp/jira-server.d.ts.map +1 -0
- package/dist/mcp/jira-server.js +288 -0
- package/dist/mcp/jira-server.js.map +1 -0
- package/dist/observability/activity-store.d.ts +29 -0
- package/dist/observability/activity-store.d.ts.map +1 -0
- package/dist/observability/activity-store.js +32 -0
- package/dist/observability/activity-store.js.map +1 -0
- package/dist/observability/config-view.d.ts +19 -0
- package/dist/observability/config-view.d.ts.map +1 -0
- package/dist/observability/config-view.js +61 -0
- package/dist/observability/config-view.js.map +1 -0
- package/dist/observability/http-dashboard.d.ts +36 -0
- package/dist/observability/http-dashboard.d.ts.map +1 -0
- package/dist/observability/http-dashboard.js +297 -0
- package/dist/observability/http-dashboard.js.map +1 -0
- package/dist/observability/log-buffer.d.ts +21 -0
- package/dist/observability/log-buffer.d.ts.map +1 -0
- package/dist/observability/log-buffer.js +69 -0
- package/dist/observability/log-buffer.js.map +1 -0
- package/dist/observability/logger.d.ts +37 -0
- package/dist/observability/logger.d.ts.map +1 -0
- package/dist/observability/logger.js +114 -0
- package/dist/observability/logger.js.map +1 -0
- package/dist/observability/snapshot.d.ts +11 -0
- package/dist/observability/snapshot.d.ts.map +1 -0
- package/dist/observability/snapshot.js +59 -0
- package/dist/observability/snapshot.js.map +1 -0
- package/dist/observability/terminal-dashboard.d.ts +155 -0
- package/dist/observability/terminal-dashboard.d.ts.map +1 -0
- package/dist/observability/terminal-dashboard.js +1598 -0
- package/dist/observability/terminal-dashboard.js.map +1 -0
- package/dist/observability/wrap.d.ts +4 -0
- package/dist/observability/wrap.d.ts.map +1 -0
- package/dist/observability/wrap.js +80 -0
- package/dist/observability/wrap.js.map +1 -0
- package/dist/scheduler/index.d.ts +2 -0
- package/dist/scheduler/index.d.ts.map +1 -0
- package/dist/scheduler/index.js +2 -0
- package/dist/scheduler/index.js.map +1 -0
- package/dist/scheduler/scheduler.d.ts +52 -0
- package/dist/scheduler/scheduler.d.ts.map +1 -0
- package/dist/scheduler/scheduler.js +535 -0
- package/dist/scheduler/scheduler.js.map +1 -0
- package/dist/shared/agent-resolver.d.ts +11 -0
- package/dist/shared/agent-resolver.d.ts.map +1 -0
- package/dist/shared/agent-resolver.js +20 -0
- package/dist/shared/agent-resolver.js.map +1 -0
- package/dist/shared/errors.d.ts +14 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +24 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/info-card.d.ts +24 -0
- package/dist/shared/info-card.d.ts.map +1 -0
- package/dist/shared/info-card.js +46 -0
- package/dist/shared/info-card.js.map +1 -0
- package/dist/shared/types.d.ts +148 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +15 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/translate/card.d.ts +2 -0
- package/dist/translate/card.d.ts.map +1 -0
- package/dist/translate/card.js +17 -0
- package/dist/translate/card.js.map +1 -0
- package/dist/translate/dict.d.ts +7 -0
- package/dist/translate/dict.d.ts.map +1 -0
- package/dist/translate/dict.js +895 -0
- package/dist/translate/dict.js.map +1 -0
- package/dist/translate/locale.d.ts +8 -0
- package/dist/translate/locale.d.ts.map +1 -0
- package/dist/translate/locale.js +75 -0
- package/dist/translate/locale.js.map +1 -0
- package/dist/translate/normalize.d.ts +4 -0
- package/dist/translate/normalize.d.ts.map +1 -0
- package/dist/translate/normalize.js +38 -0
- package/dist/translate/normalize.js.map +1 -0
- package/dist/translate/output.d.ts +3 -0
- package/dist/translate/output.d.ts.map +1 -0
- package/dist/translate/output.js +16 -0
- package/dist/translate/output.js.map +1 -0
- package/dist/worker/prompt.d.ts +11 -0
- package/dist/worker/prompt.d.ts.map +1 -0
- package/dist/worker/prompt.js +153 -0
- package/dist/worker/prompt.js.map +1 -0
- package/dist/worker/runner.d.ts +101 -0
- package/dist/worker/runner.d.ts.map +1 -0
- package/dist/worker/runner.js +448 -0
- package/dist/worker/runner.js.map +1 -0
- package/dist/workspace/index.d.ts +2 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/index.js +2 -0
- package/dist/workspace/index.js.map +1 -0
- package/dist/workspace/manager.d.ts +37 -0
- package/dist/workspace/manager.d.ts.map +1 -0
- package/dist/workspace/manager.js +157 -0
- package/dist/workspace/manager.js.map +1 -0
- package/package.json +70 -4
|
@@ -0,0 +1,356 @@
|
|
|
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
|
+
You are a coding agent running the grill-openspec workflow on: {{ task.identifier }} - {{ task.title }}
|
|
265
|
+
|
|
266
|
+
{% if task.description %}
|
|
267
|
+
## Description
|
|
268
|
+
{{ task.description }}
|
|
269
|
+
{% endif %}
|
|
270
|
+
|
|
271
|
+
## Skills (installed by `tasking init` into the target repo — the runtime daemon does NOT copy them)
|
|
272
|
+
|
|
273
|
+
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.
|
|
274
|
+
- `opsx-grill-with-docs` — interview to sharpen the plan; draft `CONTEXT.md` + `docs/adr/`
|
|
275
|
+
- `opsx-propose-with-tdd` — create the openspec change (proposal/design/tasks)
|
|
276
|
+
- `opsx-implement` — implement tasks + create MR
|
|
277
|
+
- `openspec-archive-change` — archive the openspec change (workspace close-out)
|
|
278
|
+
- `install-glab` — idempotently install the GitLab CLI; run before any `glab` step when `command -v glab` fails.
|
|
279
|
+
|
|
280
|
+
## State model
|
|
281
|
+
|
|
282
|
+
Three state buckets control how the scheduler manages your task:
|
|
283
|
+
- **Active** ({{ active_states }}): the scheduler dispatches you here.
|
|
284
|
+
- **Review** (`{{ review_state }}`): the scheduler stops your worker but preserves the workspace. Wait for a human decision.
|
|
285
|
+
- **Terminal** ({{ terminal_states }}): the scheduler removes the workspace.
|
|
286
|
+
|
|
287
|
+
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.
|
|
288
|
+
|
|
289
|
+
## Phase routing — determine your phase from artifacts
|
|
290
|
+
|
|
291
|
+
On every dispatch, inspect in order:
|
|
292
|
+
1. Is there an open MR? (check `glab mr list` or the git remote)
|
|
293
|
+
2. Does an openspec change exist? (`openspec/changes/<name>/` with `tasks.md`)
|
|
294
|
+
3. Does `CONTEXT.md` exist (grill drafted terms/decisions)?
|
|
295
|
+
4. Was a grill (拷问) comment posted? (read Jira comments for the marker `## 🔍 拷问 / Grill Questions`)
|
|
296
|
+
|
|
297
|
+
If uncertain at any step, read the latest Jira comments; if still uncertain, escalate (see 运行中升级 below).
|
|
298
|
+
|
|
299
|
+
## 工作开始时的状态卫生
|
|
300
|
+
|
|
301
|
+
When you start a working phase (grill or 实施) 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 合并 phase needs no such transition (the human already moved it to the "merging" state).
|
|
302
|
+
|
|
303
|
+
## 阶段 1:grill(拷问)
|
|
304
|
+
|
|
305
|
+
No grill comment exists in Jira yet (first dispatch, or a fresh workspace with no prior grill). Run the `opsx-grill-with-docs` skill:
|
|
306
|
+
- Resolve every fact you can from the codebase/environment first — do NOT ask the human what you can look up yourself.
|
|
307
|
+
- Draft `CONTEXT.md` and `docs/adr/*.md` for the terms and decisions you could resolve.
|
|
308
|
+
- 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).
|
|
309
|
+
- Transition to `{{ review_state }}` and stop. Do NOT create an MR. Do NOT create an openspec change yet — that belongs to 阶段 2.
|
|
310
|
+
- If you can resolve everything from the codebase (zero open decisions): skip the comment and the review pause, and go straight to 阶段 2.
|
|
311
|
+
|
|
312
|
+
### Re-dispatch after grill review (human answered, moved back to active)
|
|
313
|
+
|
|
314
|
+
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 "未答采用推荐" 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 阶段 2.
|
|
315
|
+
|
|
316
|
+
## 阶段 2:实施(propose-with-tdd + implement)
|
|
317
|
+
|
|
318
|
+
A grill comment exists in Jira AND the human has answered, and no MR exists yet. Run:
|
|
319
|
+
1. `opsx-propose-with-tdd` — create the openspec change at `openspec/changes/<name>/` (proposal/design/tasks).
|
|
320
|
+
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.
|
|
321
|
+
3. Push the feature branch and create a GitLab MR via `glab` (pre-authenticated via `GITLAB_TOKEN`).
|
|
322
|
+
4. Sweep MR feedback and ensure CI is green.
|
|
323
|
+
5. Add a Jira comment summarizing your changes (files, rationale, MR link) via `jira_rest`, then transition to `{{ review_state }}`. Stop.
|
|
324
|
+
|
|
325
|
+
## 阶段 3:合并(land + archive)
|
|
326
|
+
|
|
327
|
+
The current active state semantically means "merging" (approve-to-merge), OR an open MR exists and is approved. Determine the merge signal:
|
|
328
|
+
- If the current active state clearly conveys "merging" semantically → merge phase.
|
|
329
|
+
- Else (ambiguous) → check `glab mr view` for the MR approval status: approved → merge phase; not approved + review feedback → 增量修复 (below).
|
|
330
|
+
|
|
331
|
+
In merge phase:
|
|
332
|
+
1. Run the `land` skill to merge the MR.
|
|
333
|
+
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 阶段 2 and the MR was just merged.
|
|
334
|
+
3. Transition to a terminal state ({{ terminal_states }}). The scheduler will then remove the workspace.
|
|
335
|
+
|
|
336
|
+
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).
|
|
337
|
+
|
|
338
|
+
## 增量修复(MR open, review feedback — do NOT re-grill)
|
|
339
|
+
|
|
340
|
+
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.
|
|
341
|
+
|
|
342
|
+
## 全量重置(rework — do NOT re-grill)
|
|
343
|
+
|
|
344
|
+
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 }}`.
|
|
345
|
+
|
|
346
|
+
## 运行中升级(any phase)
|
|
347
|
+
|
|
348
|
+
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.
|
|
349
|
+
|
|
350
|
+
## Transitions & tracking
|
|
351
|
+
|
|
352
|
+
- 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).
|
|
353
|
+
- Always add a comment before finishing, describing what you did.
|
|
354
|
+
- If you created or merged an MR, include the MR link in the comment.
|
|
355
|
+
- If you posted a grill comment, reference it.
|
|
356
|
+
- If you have output files (screenshots, logs, reports), upload them as Jira attachments via `jira_upload_attachment` MCP tool.
|
|
@@ -0,0 +1,296 @@
|
|
|
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. Minimal needs no review pause (no MR); keep null.
|
|
26
|
+
# To pause for review, set a state name (e.g. "In Review"); keep it out of active/terminal to make it an implicit intermediate state.
|
|
27
|
+
review_state: null
|
|
28
|
+
|
|
29
|
+
# Required. Jira project key (e.g. "ENG"). Mutually exclusive with project_slug.
|
|
30
|
+
project_key: ENG
|
|
31
|
+
|
|
32
|
+
# Alternative to project_key; set either one.
|
|
33
|
+
project_slug: null
|
|
34
|
+
|
|
35
|
+
# Filter by assignee. null = no filter (pull all matching issues in the project). "me" = currentUser() (current API user).
|
|
36
|
+
assignee: null
|
|
37
|
+
|
|
38
|
+
# Required-label filter. Empty = no filter. E.g. ["tothemax"] dispatches only issues carrying that label.
|
|
39
|
+
required_labels: []
|
|
40
|
+
|
|
41
|
+
# Candidate states. Only issues currently in these states are pulled as dispatch candidates.
|
|
42
|
+
# NOTE: State names differ across Jira deployments — adjust them to match YOUR Jira instance
|
|
43
|
+
# (these placeholder values are Chinese because the canonical zh deployment uses them).
|
|
44
|
+
# Three-tier state model: active (dispatch) / neither-review (stop worker, keep workspace) / terminal (clean up workspace).
|
|
45
|
+
# Minimal: active→work→terminal two-state flow, no review bucket.
|
|
46
|
+
active_states:
|
|
47
|
+
- 待办
|
|
48
|
+
- 处理中
|
|
49
|
+
|
|
50
|
+
# Terminal states. Issues in these states are never dispatched, and their workspaces are cleaned up at startup.
|
|
51
|
+
terminal_states:
|
|
52
|
+
- 完成
|
|
53
|
+
- 关闭
|
|
54
|
+
- 取消
|
|
55
|
+
- 重复
|
|
56
|
+
|
|
57
|
+
# ============================================================================
|
|
58
|
+
# polling: polling cadence
|
|
59
|
+
# ============================================================================
|
|
60
|
+
polling:
|
|
61
|
+
# Poll interval (ms). Default 30000 = 30 seconds. Must be > 0.
|
|
62
|
+
interval_ms: 30000
|
|
63
|
+
|
|
64
|
+
# ============================================================================
|
|
65
|
+
# workspace: per-task workspace
|
|
66
|
+
# ============================================================================
|
|
67
|
+
workspace:
|
|
68
|
+
# Workspace root directory. ~ expands to home. Relative paths resolve against the WORKFLOW.md directory.
|
|
69
|
+
# Each issue gets <root>/<sanitized_identifier>.
|
|
70
|
+
root: ~/tasking_workspaces
|
|
71
|
+
|
|
72
|
+
# ============================================================================
|
|
73
|
+
# hooks: workspace lifecycle hooks (optional)
|
|
74
|
+
# ============================================================================
|
|
75
|
+
hooks:
|
|
76
|
+
# Timeout for all hooks (ms). Default 60000 = 60 seconds. Must be > 0.
|
|
77
|
+
timeout_ms: 60000
|
|
78
|
+
|
|
79
|
+
# Runs only when a new workspace is created. Failure aborts creation. Commonly git clone + dependency install.
|
|
80
|
+
after_create: null
|
|
81
|
+
|
|
82
|
+
# Runs before each attempt. Failure aborts the current attempt.
|
|
83
|
+
# before_run: |
|
|
84
|
+
# git pull --ff-only origin main
|
|
85
|
+
|
|
86
|
+
# Runs after each attempt (success/failure/timeout alike). Failures are logged only.
|
|
87
|
+
after_run: null
|
|
88
|
+
|
|
89
|
+
# Runs before workspace removal (issue reached a terminal state). Failures are logged only; removal is not blocked.
|
|
90
|
+
# before_remove: |
|
|
91
|
+
# cd elixir && mix workspace.before_remove
|
|
92
|
+
|
|
93
|
+
# ============================================================================
|
|
94
|
+
# agent: concurrency & retry policy
|
|
95
|
+
# ============================================================================
|
|
96
|
+
agent:
|
|
97
|
+
# Global concurrency cap. At most this many opencode run subprocesses run simultaneously.
|
|
98
|
+
max_concurrent_agents: 10
|
|
99
|
+
|
|
100
|
+
# Turn limit within a single worker. When reached, the worker exits and the scheduler schedules a continuation retry.
|
|
101
|
+
# Starting at 3 is recommended to avoid oversized first-run token consumption.
|
|
102
|
+
max_turns: 20
|
|
103
|
+
|
|
104
|
+
# Backoff ceiling (ms). Default 300000 = 5 minutes.
|
|
105
|
+
max_retry_backoff_ms: 300000
|
|
106
|
+
|
|
107
|
+
# Per-state concurrency limits. Empty = unlimited. E.g. {"in progress": 2} caps the In Progress state at 2 concurrent workers.
|
|
108
|
+
max_concurrent_agents_by_state: {}
|
|
109
|
+
|
|
110
|
+
# ============================================================================
|
|
111
|
+
# opencode: worker subprocess configuration
|
|
112
|
+
# ============================================================================
|
|
113
|
+
opencode:
|
|
114
|
+
# opencode launch command. Default "opencode run".
|
|
115
|
+
command: opencode run
|
|
116
|
+
|
|
117
|
+
# opencode agent profile name.
|
|
118
|
+
agent: build
|
|
119
|
+
|
|
120
|
+
# Optional. Advisory catalog of known opencode agent profiles (string array). Surfaced by the `/agent` command; warns on unknown names.
|
|
121
|
+
# 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.
|
|
122
|
+
agents: []
|
|
123
|
+
|
|
124
|
+
# Optional. opencode model (provider/model format), maps to `--model`. Default null (unset; uses opencode's default model).
|
|
125
|
+
model: null
|
|
126
|
+
|
|
127
|
+
# Optional. Model variant (provider-specific reasoning effort such as high/max/minimal), maps to `--variant`. Default null (unset). Independent of model.
|
|
128
|
+
variant: null
|
|
129
|
+
|
|
130
|
+
# Per-turn timeout (ms). Default 3600000 = 1 hour. Must be > 0.
|
|
131
|
+
# Hard wall-clock timeout: kills the turn when time is up regardless of activity.
|
|
132
|
+
turn_timeout_ms: 3600000
|
|
133
|
+
|
|
134
|
+
# Stall timeout (ms). Terminates the worker after this much time without activity.
|
|
135
|
+
# Default 7200000 = 2 hours. Set 0 to disable stall detection.
|
|
136
|
+
# Scheduler-level backstop: when neither the inactivity nor the wall-clock timeout can kill the subprocess
|
|
137
|
+
# (e.g. it refuses to honor SIGTERM). Timeouts SIGTERM first, then process-group
|
|
138
|
+
# SIGKILL after a 10s grace (see docs/adr/0020); this is only a backstop if
|
|
139
|
+
# the escalation itself fails.
|
|
140
|
+
# Set above turn_timeout_ms so normal turns are not mis-killed.
|
|
141
|
+
stall_timeout_ms: 7200000
|
|
142
|
+
|
|
143
|
+
# Inactivity timeout (ms). SIGTERM after stdout/stderr produces no data for this long.
|
|
144
|
+
# Default 600000 = 10 minutes. Set 0 to disable the inactivity timeout.
|
|
145
|
+
# Subprocess level: checks raw bytes and resets the timer whenever data arrives.
|
|
146
|
+
inactivity_timeout_ms: 600000
|
|
147
|
+
|
|
148
|
+
# ============================================================================
|
|
149
|
+
# router: route-agent triage for the unstructured source (Feishu)
|
|
150
|
+
# ============================================================================
|
|
151
|
+
# Not implemented: parsed only, no runtime code (reserved for a future route agent).
|
|
152
|
+
# router:
|
|
153
|
+
# Whether to enable the route agent. When enabled it runs in a bounded way per tick,
|
|
154
|
+
# triaging Feishu messages into Tasks.
|
|
155
|
+
# enabled: false
|
|
156
|
+
|
|
157
|
+
# opencode agent profile used by the route agent.
|
|
158
|
+
# agent: triage
|
|
159
|
+
|
|
160
|
+
# Max inbox entries processed per route-agent run.
|
|
161
|
+
# batch_size: 20
|
|
162
|
+
|
|
163
|
+
# Route-agent per-run timeout (ms). Default 120000 = 2 minutes.
|
|
164
|
+
# timeout_ms: 120000
|
|
165
|
+
|
|
166
|
+
# ============================================================================
|
|
167
|
+
# feishu: Feishu ↔ Jira comment bridge (REST polling, no public port)
|
|
168
|
+
# ============================================================================
|
|
169
|
+
feishu:
|
|
170
|
+
# When enabled, Feishu mirrors comments of existing Jira issues: threads bind 1:1 to issues, comments mirror both ways.
|
|
171
|
+
# Inbound uses REST polling (no webhooks, no exposed public port). See docs/feishu-quickstart.md.
|
|
172
|
+
enabled: false
|
|
173
|
+
|
|
174
|
+
# Feishu edition: feishu (China mainland, open.feishu.cn) | lark (overseas, open.larksuite.com). Defaults to feishu.
|
|
175
|
+
edition: feishu
|
|
176
|
+
|
|
177
|
+
# Feishu app credentials. Plaintext or a $VAR env reference both work.
|
|
178
|
+
app_id: $FEISHU_APP_ID
|
|
179
|
+
app_secret: $FEISHU_APP_SECRET
|
|
180
|
+
|
|
181
|
+
# Intake group chat_id: the dedicated group hosting all issue threads (get via GET /im/v1/chats). Required when enabled.
|
|
182
|
+
intake_chat_id: $FEISHU_INTAKE_CHAT_ID
|
|
183
|
+
|
|
184
|
+
# Jira→Feishu comment mirror cadence (ms), default 5s. Receiving runs over the event channel, not polling.
|
|
185
|
+
forward_interval_ms: 5000
|
|
186
|
+
|
|
187
|
+
# Sweep loss-backstop cadence (ms), default 12h. Catches offline windows; also fires at start and on WS reconnect.
|
|
188
|
+
sweep_interval_ms: 43200000
|
|
189
|
+
|
|
190
|
+
# Default issueType for /issue (tasking init lists the project's available types). Required when enabled.
|
|
191
|
+
create_issue_type: Task
|
|
192
|
+
|
|
193
|
+
# Webhook-mode only (unused under REST polling; reserved for a future webhook mode).
|
|
194
|
+
# verification_token: $FEISHU_VERIFICATION_TOKEN
|
|
195
|
+
# encrypt_key: $FEISHU_ENCRYPT_KEY
|
|
196
|
+
|
|
197
|
+
# --------------------------------------------------------------------------
|
|
198
|
+
# Direct sessions (feishu.direct): bypass Jira and run opencode in fixed directories.
|
|
199
|
+
# Enabled by default when feishu.enabled is true; an explicit enabled: false opts out. See docs/configuration.md.
|
|
200
|
+
# --------------------------------------------------------------------------
|
|
201
|
+
direct:
|
|
202
|
+
# An explicit false turns direct sessions off.
|
|
203
|
+
enabled: true
|
|
204
|
+
|
|
205
|
+
# Project name → directory map, used by `/chat <project> <msg>`. The object form {path, auto_approve} overrides the global value.
|
|
206
|
+
# Example:
|
|
207
|
+
# projects:
|
|
208
|
+
# tasking: /home/me/workspace/tasking
|
|
209
|
+
# other: {path: /abs/dir, auto_approve: true}
|
|
210
|
+
projects:
|
|
211
|
+
|
|
212
|
+
# Directory-prefix allow-list for ad-hoc path mode (`/chat /abs/path <msg>`); empty = unrestricted.
|
|
213
|
+
path_roots: []
|
|
214
|
+
|
|
215
|
+
# true = pass --auto to opencode run (auto-approve permissions not explicitly denied).
|
|
216
|
+
# Default false: the permission stance comes from the target directory's own .opencode config.
|
|
217
|
+
auto_approve: false
|
|
218
|
+
|
|
219
|
+
# 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).
|
|
220
|
+
verbosity: detailed
|
|
221
|
+
|
|
222
|
+
# Daemon-wide cap on concurrent direct turns (independent of Jira's max_concurrent_agents); per directory/session is always serial.
|
|
223
|
+
max_concurrent: 5
|
|
224
|
+
|
|
225
|
+
# Idle time before a session is marked expired (ms; it does not delete the opencode session on disk). Default 2592000000 = 30 days.
|
|
226
|
+
idle_ttl_ms: 2592000000
|
|
227
|
+
|
|
228
|
+
# ============================================================================
|
|
229
|
+
# server: HTTP dashboard (optional)
|
|
230
|
+
# ============================================================================
|
|
231
|
+
server:
|
|
232
|
+
# Dashboard port. null = do not start. Set e.g. 8080 to start.
|
|
233
|
+
port: null
|
|
234
|
+
|
|
235
|
+
# Bind address. "0.0.0.0" = all interfaces (externally reachable). "127.0.0.1" = local only.
|
|
236
|
+
host: 0.0.0.0
|
|
237
|
+
|
|
238
|
+
# ============================================================================
|
|
239
|
+
# logging: file logging (optional)
|
|
240
|
+
# ============================================================================
|
|
241
|
+
logging:
|
|
242
|
+
file:
|
|
243
|
+
# File log path. null = no file (stderr only). The CLI defaults to ./tasking.log at startup.
|
|
244
|
+
path: null
|
|
245
|
+
|
|
246
|
+
# Max bytes per file. Rotated once exceeded. Default 10485760 = 10 MB.
|
|
247
|
+
max_bytes: 10485760
|
|
248
|
+
|
|
249
|
+
# Rotation backup count. Keeps the most recent N backup files.
|
|
250
|
+
max_files: 5
|
|
251
|
+
|
|
252
|
+
# ============================================================================
|
|
253
|
+
# env: environment variables injected into worker subprocesses (optional)
|
|
254
|
+
# ============================================================================
|
|
255
|
+
# Values support $VAR indirection (same semantics as tracker.api_key).
|
|
256
|
+
# A variable resolving to an empty string is injected as an empty value. A missing env section defaults to {}.
|
|
257
|
+
env:
|
|
258
|
+
# GitLab token for the glab CLI (the minimal variant usually needs no MR; leave empty or configure as needed).
|
|
259
|
+
GITLAB_TOKEN: $GITLAB_TOKEN
|
|
260
|
+
GITLAB_HOST: $GITLAB_HOST
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
<!-- tasking-workflow-lang: en -->
|
|
264
|
+
|
|
265
|
+
You are a coding agent working on: {{ task.identifier }} - {{ task.title }}
|
|
266
|
+
|
|
267
|
+
{% if task.description %}
|
|
268
|
+
## Description
|
|
269
|
+
{{ task.description }}
|
|
270
|
+
{% endif %}
|
|
271
|
+
|
|
272
|
+
## State model
|
|
273
|
+
|
|
274
|
+
- **Active** ({{ active_states }}): the scheduler dispatches you here.
|
|
275
|
+
- **Terminal** ({{ terminal_states }}): the scheduler removes the workspace.
|
|
276
|
+
|
|
277
|
+
This minimal workflow has no review pause and no merge request. Do the task in the working directory, upload the results to Jira, then transition to a terminal state.
|
|
278
|
+
|
|
279
|
+
## Workflow
|
|
280
|
+
|
|
281
|
+
1. Query available transitions via the `jira_rest` MCP tool (`GET /issue/{{ task.identifier }}/transitions`). Transition from the current state to the active state whose name semantically means "in progress / working" — pick the id by semantic match, do NOT hardcode the transition id. Skip if already in progress.
|
|
282
|
+
2. Complete the task in the working directory. Work directly here — do NOT create a git branch, do NOT create a merge request, do NOT use `glab`. (If the task genuinely requires a code merge request, ask the human to switch this task's workflow; do not improvise one here.)
|
|
283
|
+
3. Upload the results to Jira:
|
|
284
|
+
- Add a summary comment via the `jira_rest` MCP tool (`POST /issue/{{ task.identifier }}/comment`) describing what you did, the outcome, and any caveats.
|
|
285
|
+
- If you produced output files (reports, logs, screenshots, documents), upload them as Jira attachments via the `jira_upload_attachment` MCP tool.
|
|
286
|
+
4. Query available transitions again (`GET /issue/{{ task.identifier }}/transitions`). Transition to a terminal state whose name semantically means "done / completed" — pick the id by semantic match, do NOT hardcode it. The scheduler will then remove the workspace.
|
|
287
|
+
|
|
288
|
+
{% if attempt %}
|
|
289
|
+
This is attempt {{ attempt }}. If a previous attempt left partial work, inspect the working directory and Jira comments to resume; otherwise start the workflow above. If stuck, check `tasking.log` for execution failures.
|
|
290
|
+
{% endif %}
|
|
291
|
+
|
|
292
|
+
## Tracking
|
|
293
|
+
|
|
294
|
+
- Always add a summary comment before finishing, describing what you did.
|
|
295
|
+
- If you have output files, upload them as attachments via `jira_upload_attachment`.
|
|
296
|
+
- Do NOT transition to a terminal state until the results are uploaded.
|