@godv61/dsh-task-engine 0.7.0 → 0.9.0
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/README.md +32 -14
- package/cordis.patch.yml +8 -7
- package/lib/agent.d.ts +13 -0
- package/lib/agent.js +18 -0
- package/lib/agent.js.map +1 -0
- package/lib/dev-task.d.ts +20 -0
- package/lib/dev-task.js +370 -0
- package/lib/dev-task.js.map +1 -0
- package/lib/index.d.ts +6 -3
- package/lib/index.js +8 -382
- package/lib/index.js.map +1 -1
- package/lib/seed-preset.d.ts +19 -0
- package/lib/seed-preset.js +59 -0
- package/lib/seed-preset.js.map +1 -0
- package/lib/shipped-skills.d.ts +16 -0
- package/lib/shipped-skills.js +48 -0
- package/lib/shipped-skills.js.map +1 -0
- package/package.json +11 -2
- package/preset/agent.cordis.yml +22 -0
- package/preset/enable.mjs +88 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# dsh-task-engine — agent-plane opt-in fragment.
|
|
2
|
+
#
|
|
3
|
+
# Copy these two rows into a preset's `agent.cordis.yml` to activate the
|
|
4
|
+
# engineering-delivery flow for that preset's sessions. Start from a copy of
|
|
5
|
+
# `standard`, then REPLACE its `persona` row with the one below and ADD the
|
|
6
|
+
# `task-engine-agent` row. (The bundle must also be installed via
|
|
7
|
+
# `dsh plugin add @godv61/dsh-task-engine` so the engine and workbench exist.)
|
|
8
|
+
#
|
|
9
|
+
# `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
|
|
10
|
+
|
|
11
|
+
- id: persona
|
|
12
|
+
name: '@deepseek-ai/dsh-persona'
|
|
13
|
+
config:
|
|
14
|
+
text: |-
|
|
15
|
+
You are an engineering-delivery coding agent, powered by the {{model}} model, running on DeepSeek Harness. Your working directory is {{cwd}}.
|
|
16
|
+
|
|
17
|
+
本仓库采用工程化交付流程,由 `dev_task` 工具硬性持有任务状态机:需求评审 → 设计 → 开发 → 交付 → 代码审核。阶段、流转门槛、提交格式都来自项目根 `.dsh/eng.json`(没有该文件则用内置默认)。任何开发类请求开始前,先加载 `eng-delivery` 技能。
|
|
18
|
+
|
|
19
|
+
铁律:一切阶段流转、确认、验证、评审和提交都必须通过 `dev_task`——它拒绝时是硬事实,必须修正前置条件,禁止绕过。只做任务范围内的本地提交;绝不 push、合并、创建 PR、执行数据库、操作 Jenkins、部署或发布。
|
|
20
|
+
|
|
21
|
+
- id: task-engine-agent
|
|
22
|
+
name: '@godv61/dsh-task-engine/agent'
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* One-shot activation helper: copy the shipped `standard` preset to a `eng`
|
|
4
|
+
* preset under `$DSH_HOME/.agent-presets`, swap its persona for the engineering
|
|
5
|
+
* persona, and append the `@godv61/dsh-task-engine/agent` row.
|
|
6
|
+
*
|
|
7
|
+
* Run after `dsh plugin --profile <name> add @godv61/dsh-task-engine`:
|
|
8
|
+
* node <this-file>
|
|
9
|
+
*
|
|
10
|
+
* The script writes files only under `$DSH_HOME/.agent-presets/eng`; it never
|
|
11
|
+
* touches the shipped preset install.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { createRequire } from 'node:module'
|
|
15
|
+
import { cp, mkdir, readFile, writeFile, stat } from 'node:fs/promises'
|
|
16
|
+
import { homedir } from 'node:os'
|
|
17
|
+
import { join } from 'node:path'
|
|
18
|
+
import { fileURLToPath } from 'node:url'
|
|
19
|
+
|
|
20
|
+
const require = createRequire(import.meta.url)
|
|
21
|
+
|
|
22
|
+
/** The persona block `standard` ships, in its exact indentation. */
|
|
23
|
+
const SHIPPED_PERSONA_BLOCK =
|
|
24
|
+
' text: >-\n'
|
|
25
|
+
+ ' You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.\n'
|
|
26
|
+
|
|
27
|
+
const AGENT_ROW = "\n- id: task-engine-agent\n name: '@godv61/dsh-task-engine/agent'\n"
|
|
28
|
+
|
|
29
|
+
async function exists(path) {
|
|
30
|
+
try {
|
|
31
|
+
await stat(path)
|
|
32
|
+
return true
|
|
33
|
+
} catch {
|
|
34
|
+
return false
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function main() {
|
|
39
|
+
let shippedRoot
|
|
40
|
+
try {
|
|
41
|
+
;({ SHIPPED_PRESET_ROOT: shippedRoot } = require('@deepseek-ai/dsh-agent-presets'))
|
|
42
|
+
} catch {
|
|
43
|
+
console.error('未找到 @deepseek-ai/dsh-agent-presets —— 请先执行 dsh plugin --profile <name> add @godv61/dsh-task-engine')
|
|
44
|
+
process.exitCode = 1
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const home = process.env.DSH_HOME ?? join(homedir(), '.dsh')
|
|
49
|
+
const source = join(shippedRoot, 'standard')
|
|
50
|
+
const target = join(home, '.agent-presets', 'eng')
|
|
51
|
+
|
|
52
|
+
if (await exists(target)) {
|
|
53
|
+
console.error(`预设 "eng" 已存在(${target}),本脚本不会覆盖;请先删除它再重跑,或改用它已有的 agent.cordis.yml。`)
|
|
54
|
+
process.exitCode = 1
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await mkdir(join(home, '.agent-presets'), { recursive: true })
|
|
59
|
+
await cp(source, target, { recursive: true })
|
|
60
|
+
|
|
61
|
+
const compPath = join(target, 'agent.cordis.yml')
|
|
62
|
+
let comp = await readFile(compPath, 'utf8')
|
|
63
|
+
|
|
64
|
+
const persona = (await readFile(fileURLToPath(new URL('./persona.md', import.meta.url)), 'utf8')).trimEnd()
|
|
65
|
+
if (comp.includes(SHIPPED_PERSONA_BLOCK)) {
|
|
66
|
+
const block = ' text: |-\n' + persona.split('\n').map(line => ' ' + line).join('\n') + '\n'
|
|
67
|
+
comp = comp.replace(SHIPPED_PERSONA_BLOCK, block)
|
|
68
|
+
} else {
|
|
69
|
+
console.warn('未能定位 standard 的 persona 段,跳过 persona 替换(仍会追加 agent 行)。')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!comp.includes("name: '@godv61/dsh-task-engine/agent'")) {
|
|
73
|
+
comp = comp.trimEnd() + '\n' + AGENT_ROW
|
|
74
|
+
}
|
|
75
|
+
await writeFile(compPath, comp, 'utf8')
|
|
76
|
+
|
|
77
|
+
await writeFile(
|
|
78
|
+
join(target, 'preset.yml'),
|
|
79
|
+
'name: 工程化开发引擎\n'
|
|
80
|
+
+ 'description: 通过 dev_task 工具硬性持有需求评审→设计→开发→交付→代码审核的状态机,按项目 .dsh/eng.json 配置流转与提交门禁。\n',
|
|
81
|
+
'utf8',
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
console.log('完成。已创建预设 "eng":persona 已替换为工程人设,并追加了 @godv61/dsh-task-engine/agent 行。')
|
|
85
|
+
console.log('新建会话时选择「工程化开发引擎」即可激活流程。')
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
await main()
|