@godv61/dsh-task-engine 0.6.1 → 0.8.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/lib/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
1
  /**
2
- * dsh-task-engine plugin: registers the model-facing `dev_task` tool (the hard
3
- * gate) and ships the bundled engineering skills.
2
+ * Host half of dsh-task-engine: mounts the `task-engine` Remote namespace that
3
+ * the browser workbench reads/writes, plus the browser half (declared via
4
+ * `dsh.client`). The model-facing `dev_task` tool and the shipped engineering
5
+ * skills live on the AGENT plane (`./agent`), so a session activates them only
6
+ * when its preset names the `@godv61/dsh-task-engine/agent` row.
4
7
  *
5
8
  * @module dsh-task-engine
6
9
  */
7
10
  import type { Context } from '@deepseek-ai/cordis';
8
11
  export declare const name = "task-engine";
9
- export declare const inject: string[];
10
12
  export declare function apply(ctx: Context): void;
package/lib/index.js CHANGED
@@ -1,392 +1,15 @@
1
1
  /**
2
- * dsh-task-engine plugin: registers the model-facing `dev_task` tool (the hard
3
- * gate) and ships the bundled engineering skills.
2
+ * Host half of dsh-task-engine: mounts the `task-engine` Remote namespace that
3
+ * the browser workbench reads/writes, plus the browser half (declared via
4
+ * `dsh.client`). The model-facing `dev_task` tool and the shipped engineering
5
+ * skills live on the AGENT plane (`./agent`), so a session activates them only
6
+ * when its preset names the `@godv61/dsh-task-engine/agent` row.
4
7
  *
5
8
  * @module dsh-task-engine
6
9
  */
7
- import { readFileSync, readdirSync } from 'node:fs';
8
- import { homedir } from 'node:os';
9
- import { join } from 'node:path';
10
- import { fileURLToPath } from 'node:url';
11
- import { defineTool } from '@deepseek-ai/dsh-tools';
12
10
  import TaskEngineController from "./controller.js";
13
- import { assertAdvance, bindingsForStage, checkFileScope, commitCheckpoint, legalTargets, loadWorkflow, newTask, validateCommitMessage, validateWorkflow, } from "./engine.js";
14
11
  export const name = 'task-engine';
15
- export const inject = ['tools', 'fs'];
16
- const DEFAULTS = JSON.parse(readFileSync(fileURLToPath(new URL('../defaults/eng.json', import.meta.url)), 'utf8'));
17
- /** Bundled commit-msg hook, copied into `.git/hooks/` by the `install_hook` operation. */
18
- const HOOK_TEMPLATE = readFileSync(fileURLToPath(new URL('../hooks/commit-msg', import.meta.url)), 'utf8');
19
- /** Pins the hook directory to CommonJS so the extensionless hook runs under any repo `type`. */
20
- const HOOK_PACKAGE_JSON = '{\n "type": "commonjs"\n}\n';
21
- async function readText(fs, relPath) {
22
- try {
23
- const target = await fs.resolve(relPath);
24
- return await fs.readText(target);
25
- }
26
- catch {
27
- return undefined;
28
- }
29
- }
30
- async function writeText(fs, relPath, content) {
31
- const target = await fs.resolve(relPath);
32
- await fs.writeText(target, content);
33
- }
34
- function sanitize(id) {
35
- return id.replace(/[^0-9a-zA-Z_-]/g, '-');
36
- }
37
- const taskPath = (id) => `.dsh/task-${sanitize(id)}.json`;
38
- /**
39
- * Resolve the effective workflow, distinguishing a missing config from a bad one.
40
- *
41
- * `default` means no `.dsh/eng.json` (bundled defaults). `project` means the
42
- * project config is present and structurally sound. `invalid` means the project
43
- * config exists but is unparsable or fails {@link validateWorkflow}; its
44
- * problems are surfaced so a misconfigured gate fails loudly instead of
45
- * silently degrading to the default.
46
- */
47
- async function resolveWorkflow(fs) {
48
- const raw = await readText(fs, '.dsh/eng.json');
49
- if (raw === undefined)
50
- return { config: DEFAULTS, problems: [], source: 'default' };
51
- let parsed;
52
- try {
53
- parsed = JSON.parse(raw);
54
- }
55
- catch (error) {
56
- return {
57
- config: DEFAULTS,
58
- problems: [`invalid JSON: ${error instanceof Error ? error.message : String(error)}`],
59
- source: 'invalid',
60
- };
61
- }
62
- const config = loadWorkflow(DEFAULTS, parsed);
63
- const problems = validateWorkflow(config);
64
- return { config, problems, source: problems.length === 0 ? 'project' : 'invalid' };
65
- }
66
- /** Write the bundled notch gate into `.git/hooks/` so `git commit` is mechanically gated. */
67
- async function installCommitHook(fs) {
68
- await writeText(fs, '.git/hooks/commit-msg', HOOK_TEMPLATE);
69
- await writeText(fs, '.git/hooks/package.json', HOOK_PACKAGE_JSON);
70
- }
71
- async function loadTask(fs, id) {
72
- const raw = await readText(fs, taskPath(id));
73
- if (raw === undefined)
74
- throw new Error(`no task "${id}" under ${taskPath(id)}`);
75
- const state = JSON.parse(raw);
76
- // Tasks recorded before these features lack the fields; treat them as empty.
77
- state.artifacts = state.artifacts ?? {};
78
- state.files = state.files ?? [];
79
- return state;
80
- }
81
- async function writeTask(fs, state) {
82
- await writeText(fs, taskPath(state.id), JSON.stringify(state, null, 2));
83
- }
84
- function dshHome() {
85
- return process.env.DSH_HOME ?? join(homedir(), '.dsh');
86
- }
87
- /** Read a rule file with a hard path, or undefined. */
88
- function readAbsRule(file) {
89
- try {
90
- return readFileSync(file, 'utf8');
91
- }
92
- catch {
93
- return undefined;
94
- }
95
- }
96
- /**
97
- * Resolve rule contents by name, project first, then user home, then bundled.
98
- * @param names - rule names from the current stage binding.
99
- * @param fs - sandboxed filesystem for the project-level lookup.
100
- * @returns the rules that resolved, in name order, with their bodies.
101
- */
102
- async function resolveRules(names, fs) {
103
- const result = [];
104
- for (const rawName of names) {
105
- const name = sanitize(rawName);
106
- if (name === '')
107
- continue;
108
- const project = await readText(fs, `.dsh/rules/${name}.md`);
109
- if (project !== undefined) {
110
- result.push({ name: rawName, content: project });
111
- continue;
112
- }
113
- const user = readAbsRule(join(dshHome(), 'rules', `${name}.md`));
114
- if (user !== undefined) {
115
- result.push({ name: rawName, content: user });
116
- continue;
117
- }
118
- const bundled = readAbsRule(fileURLToPath(new URL(`../rules/${name}.md`, import.meta.url)));
119
- if (bundled !== undefined)
120
- result.push({ name: rawName, content: bundled });
121
- }
122
- return result;
123
- }
124
- /**
125
- * Render a stage's progressive-disclosure payload: skill names to load via the
126
- * `skill` tool, plus the resolved rule bodies to follow. Empty text means the
127
- * stage declares no bindings.
128
- * @param stage - current stage.
129
- * @param workflow - effective workflow.
130
- * @param fs - host filesystem for project-rule resolution.
131
- * @returns the disclosure text, or an empty string.
132
- */
133
- async function renderBindings(stage, workflow, fs) {
134
- const binding = bindingsForStage(stage, workflow);
135
- const skills = binding?.skills ?? [];
136
- const ruleNames = binding?.rules ?? [];
137
- if (binding === undefined || (skills.length === 0 && ruleNames.length === 0))
138
- return '';
139
- const rules = await resolveRules(ruleNames, fs);
140
- const skillPart = skills.length > 0
141
- ? `skills to load: ${skills.join(', ')} (use the skill tool by name)`
142
- : 'skills to load: none';
143
- const rulePart = rules.length > 0
144
- ? `rules for this stage:\n${rules.map(r => `### ${r.name}\n${r.content}`).join('\n\n')}`
145
- : '';
146
- return [skillPart, rulePart].filter(Boolean).join('\n');
147
- }
148
- /** Normalize the tool's `items` argument into complete TaskItem records. */
149
- function normalizeItems(items) {
150
- return (items ?? []).map(item => ({
151
- id: String(item.id ?? ''),
152
- title: String(item.title ?? ''),
153
- status: item.status ?? 'todo',
154
- }));
155
- }
156
- const OPERATIONS = ['status', 'create', 'confirm', 'record', 'items', 'scope', 'advance', 'verify', 'review', 'commit', 'config', 'install_hook'];
157
- const TOOL_DESCRIPTION = 'Own the engineering delivery workflow as hard state. Read or create the task record, record a ' +
158
- 'confirmation or a stage artifact, advance one stage (rejected unless every configured guard already ' +
159
- 'holds, including the stage artifacts), record verification or review, and gate a commit on ' +
160
- 'stage/scope/message. The tool refuses illegal moves instead of degrading — treat a rejection as a ' +
161
- 'fact to fix, not a prompt to retry another way.';
162
12
  export function apply(ctx) {
163
13
  ctx.plugin(TaskEngineController);
164
- ctx.tools.register(defineTool({
165
- name: 'dev_task',
166
- description: TOOL_DESCRIPTION,
167
- parameters: {
168
- operation: { type: 'string', enum: [...OPERATIONS], required: true, description: 'Which task-record action to perform.' },
169
- task_id: { type: 'string', description: 'Task id (short stable id like GREET-001); required on create and every other operation.' },
170
- branch: { type: 'string', description: 'Current git branch (recorded on create).' },
171
- title: { type: 'string', description: 'Task title (create).' },
172
- work_size: { type: 'string', enum: ['tiny', 'standard', 'complex'], description: 'Workload tier (create).' },
173
- risk_level: { type: 'string', enum: ['standard', 'high_risk'], description: 'Risk tier (create).' },
174
- items: {
175
- type: 'array',
176
- description: 'Implementation items (create/update).',
177
- items: {
178
- type: 'object',
179
- additionalProperties: false,
180
- properties: {
181
- id: { type: 'string' },
182
- title: { type: 'string' },
183
- status: { type: 'string', enum: ['todo', 'doing', 'done'] },
184
- },
185
- },
186
- },
187
- field: { type: 'string', enum: ['requirement', 'solution'], description: 'Which confirmation (confirm).' },
188
- target_stage: { type: 'string', description: 'Stage to advance to (advance).' },
189
- passed: { type: 'boolean', description: 'Verification passed (verify).' },
190
- evidence: { type: 'array', items: { type: 'string' }, description: 'Verification evidence (verify).' },
191
- outcome: { type: 'string', enum: ['pass', 'blocked'], description: 'Review outcome (review).' },
192
- artifact: { type: 'string', description: 'Artifact id to record fields for (record).' },
193
- fields: {
194
- type: 'object',
195
- description: 'Field values for the artifact (record).',
196
- additionalProperties: true,
197
- },
198
- files: {
199
- type: 'array',
200
- items: { type: 'string' },
201
- description: 'Repo-relative paths in scope (create/scope) or being committed (commit).',
202
- },
203
- message: { type: 'string', description: 'Commit summary to validate (commit).' },
204
- hash: { type: 'string', description: 'Commit hash to record after the git commit (commit).' },
205
- },
206
- output: {
207
- schema: { type: 'string' },
208
- render(_args, value) {
209
- return [{ type: 'text', text: value }];
210
- },
211
- },
212
- async execute(args) {
213
- const a = args;
214
- if (a.operation === 'config') {
215
- const resolved = await resolveWorkflow(ctx.fs);
216
- return JSON.stringify({
217
- source: resolved.source,
218
- valid: resolved.problems.length === 0,
219
- problems: resolved.problems,
220
- workflow: resolved.config,
221
- }, null, 2);
222
- }
223
- if (a.operation === 'install_hook') {
224
- await installCommitHook(ctx.fs);
225
- return 'installed commit-msg hook at .git/hooks/commit-msg — git commit is now gated by the task state';
226
- }
227
- const resolved = await resolveWorkflow(ctx.fs);
228
- if (resolved.problems.length > 0) {
229
- throw new Error(`invalid .dsh/eng.json — fix the project config first:\n- ${resolved.problems.join('\n- ')}`);
230
- }
231
- const workflow = resolved.config;
232
- if (a.operation === 'create') {
233
- if (!a.task_id || !a.title || !a.branch) {
234
- throw new Error('create requires task_id, title, and branch');
235
- }
236
- const state = newTask({
237
- id: a.task_id,
238
- title: a.title,
239
- branch: a.branch,
240
- work_size: a.work_size ?? 'standard',
241
- risk_level: a.risk_level ?? 'standard',
242
- }, workflow);
243
- state.items = normalizeItems(a.items);
244
- state.files = a.files ?? [];
245
- await writeTask(ctx.fs, state);
246
- return `created ${state.id} at stage ${state.stage}; legal next: ${legalTargets(state.stage, workflow).join(', ') || 'none'}`;
247
- }
248
- if (!a.task_id)
249
- throw new Error('task_id is required for this operation');
250
- const state = await loadTask(ctx.fs, a.task_id);
251
- if (a.operation === 'status') {
252
- const binding = bindingsForStage(state.stage, workflow);
253
- const rules = await resolveRules(binding?.rules ?? [], ctx.fs);
254
- return JSON.stringify({
255
- id: state.id,
256
- stage: state.stage,
257
- risk_level: state.risk_level,
258
- work_size: state.work_size,
259
- requirement_confirmed: state.requirement_confirmed,
260
- solution_confirmed: state.solution_confirmed,
261
- items_done: `${state.items.filter(i => i.status === 'done').length}/${state.items.length}`,
262
- verification: state.verification,
263
- review: state.review,
264
- artifacts: state.artifacts,
265
- files: state.files,
266
- legal_next: legalTargets(state.stage, workflow),
267
- commit: commitCheckpoint(state, workflow),
268
- bindings: {
269
- skills: binding?.skills ?? [],
270
- rules: rules.map(r => ({ name: r.name, content: r.content })),
271
- },
272
- }, null, 2);
273
- }
274
- if (a.operation === 'commit') {
275
- const checkpoint = commitCheckpoint(state, workflow);
276
- if (!checkpoint.allowed)
277
- throw new Error(checkpoint.reason ?? 'no commit is due');
278
- if (workflow.commit.file_scope) {
279
- if (!a.files || a.files.length === 0) {
280
- throw new Error('commit requires files (the repo-relative paths being committed) when file_scope is on');
281
- }
282
- const scope = checkFileScope(state, a.files, workflow);
283
- if (!scope.ok) {
284
- throw new Error(scope.noScope
285
- ? 'task declares no file scope; record files first (create files=... or scope files=...)'
286
- : `commit touches files outside the task scope: ${scope.outside.join(', ')}`);
287
- }
288
- }
289
- const message = validateCommitMessage(a.message ?? '', workflow);
290
- if (!message.ok)
291
- throw new Error(message.errors.join('; '));
292
- if (a.hash)
293
- state.commits.push({ label: checkpoint.label, hash: a.hash });
294
- await writeTask(ctx.fs, state);
295
- return `commit approved (${checkpoint.label ?? ''}) — git add ${(a.files ?? []).join(' ')}; git commit -m "${a.message ?? ''}"`;
296
- }
297
- let note;
298
- switch (a.operation) {
299
- case 'confirm':
300
- if (a.field === 'requirement')
301
- state.requirement_confirmed = true;
302
- else if (a.field === 'solution')
303
- state.solution_confirmed = true;
304
- else
305
- throw new Error('confirm requires field: requirement|solution');
306
- break;
307
- case 'record': {
308
- if (!a.artifact)
309
- throw new Error('record requires artifact (the artifact id)');
310
- const def = workflow.artifacts.find(artifact => artifact.id === a.artifact);
311
- if (!def) {
312
- throw new Error(`unknown artifact "${a.artifact}"; declared: ${workflow.artifacts.map(x => x.id).join(', ') || 'none'}`);
313
- }
314
- const merged = { ...(state.artifacts[def.id] ?? {}) };
315
- for (const [field, value] of Object.entries(a.fields ?? {})) {
316
- if (!def.fields.includes(field)) {
317
- throw new Error(`artifact "${def.id}" has no field "${field}"; fields: ${def.fields.join(', ')}`);
318
- }
319
- merged[field] = value === undefined || value === null ? '' : String(value);
320
- }
321
- state.artifacts[def.id] = merged;
322
- const missing = def.fields.filter(field => !merged[field] || merged[field].trim() === '');
323
- note = missing.length === 0
324
- ? `recorded ${def.name} ("${def.id}") — all required fields present`
325
- : `recorded ${def.name} ("${def.id}"); still missing: ${missing.join(', ')}`;
326
- break;
327
- }
328
- case 'scope':
329
- state.files = a.files ?? [];
330
- note = `file scope set to ${state.files.length} files${state.files.length > 0 ? ': ' + state.files.join(', ') : ' (empty — commits are blocked until files are declared)'}`;
331
- break;
332
- case 'items':
333
- state.items = normalizeItems(a.items);
334
- note = `items set: ${state.items.map(i => `${i.id}:${i.status}`).join(', ') || 'none'}`;
335
- break;
336
- case 'advance': {
337
- const result = assertAdvance(state, a.target_stage ?? '', workflow);
338
- if (!result.ok)
339
- throw new Error(result.errors.join('; '));
340
- state.stage = a.target_stage;
341
- const disclosure = await renderBindings(state.stage, workflow, ctx.fs);
342
- note = disclosure === '' ? `advanced to ${state.stage}` : `advanced to ${state.stage}\n${disclosure}`;
343
- break;
344
- }
345
- case 'verify':
346
- state.verification = { passed: a.passed === true, evidence: a.evidence ?? [] };
347
- break;
348
- case 'review':
349
- if (a.outcome !== 'pass' && a.outcome !== 'blocked')
350
- throw new Error('review requires outcome: pass|blocked');
351
- state.review.outcome = a.outcome;
352
- break;
353
- default:
354
- throw new Error(`unknown operation ${a.operation}`);
355
- }
356
- await writeTask(ctx.fs, state);
357
- return note ?? `ok (stage ${state.stage})`;
358
- },
359
- }));
360
- // Ship the bundled engineering skills into this bundle's layer of the host
361
- // skill registry (optional surface: skip when the registry is absent).
362
- const skills = ctx.get('skills');
363
- if (skills !== undefined) {
364
- const skillsRoot = fileURLToPath(new URL('../skills/', import.meta.url));
365
- for (const entry of readdirSync(skillsRoot, { withFileTypes: true })) {
366
- if (!entry.isDirectory())
367
- continue;
368
- const raw = readFileSync(fileURLToPath(new URL(`../skills/${entry.name}/SKILL.md`, import.meta.url)), 'utf8');
369
- const m = raw.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
370
- if (!m)
371
- continue;
372
- const head = m[1];
373
- const body = m[2];
374
- const meta = {};
375
- for (const line of head.split('\n')) {
376
- const i = line.indexOf(':');
377
- if (i > 0)
378
- meta[line.slice(0, i).trim()] = line.slice(i + 1).trim();
379
- }
380
- if (!meta.name || !meta.description)
381
- continue;
382
- skills.register({
383
- name: meta.name,
384
- description: meta.description,
385
- ...(meta.whenToUse !== undefined ? { whenToUse: meta.whenToUse } : {}),
386
- content: body,
387
- source: 'custom',
388
- });
389
- }
390
- }
391
14
  }
392
15
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":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* Bundled engineering skills shipped with the package, registered into the
3
+ * calling scope's layer of the host skill registry. The registration runs on
4
+ * the AGENT plane (inside a preset) so only sessions on that preset carry the
5
+ * `eng-delivery` skill and its stage skills.
6
+ *
7
+ * @module dsh-task-engine/shipped-skills
8
+ */
9
+ import type { Context } from '@deepseek-ai/cordis';
10
+ /**
11
+ * Register the bundled `skills/` catalog (each directory's `SKILL.md` with
12
+ * `name`/`description`/`whenToUse` frontmatter). No-op when the skill registry
13
+ * is absent.
14
+ * @param ctx - the scoped context whose `skills` resolves to the host registry.
15
+ */
16
+ export declare function registerShippedSkills(ctx: Context): void;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Bundled engineering skills shipped with the package, registered into the
3
+ * calling scope's layer of the host skill registry. The registration runs on
4
+ * the AGENT plane (inside a preset) so only sessions on that preset carry the
5
+ * `eng-delivery` skill and its stage skills.
6
+ *
7
+ * @module dsh-task-engine/shipped-skills
8
+ */
9
+ import { readFileSync, readdirSync } from 'node:fs';
10
+ import { fileURLToPath } from 'node:url';
11
+ /**
12
+ * Register the bundled `skills/` catalog (each directory's `SKILL.md` with
13
+ * `name`/`description`/`whenToUse` frontmatter). No-op when the skill registry
14
+ * is absent.
15
+ * @param ctx - the scoped context whose `skills` resolves to the host registry.
16
+ */
17
+ export function registerShippedSkills(ctx) {
18
+ const skills = ctx.get('skills');
19
+ if (skills === undefined)
20
+ return;
21
+ const skillsRoot = fileURLToPath(new URL('../skills/', import.meta.url));
22
+ for (const entry of readdirSync(skillsRoot, { withFileTypes: true })) {
23
+ if (!entry.isDirectory())
24
+ continue;
25
+ const raw = readFileSync(fileURLToPath(new URL(`../skills/${entry.name}/SKILL.md`, import.meta.url)), 'utf8');
26
+ const m = raw.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
27
+ if (!m)
28
+ continue;
29
+ const head = m[1];
30
+ const body = m[2];
31
+ const meta = {};
32
+ for (const line of head.split('\n')) {
33
+ const i = line.indexOf(':');
34
+ if (i > 0)
35
+ meta[line.slice(0, i).trim()] = line.slice(i + 1).trim();
36
+ }
37
+ if (!meta.name || !meta.description)
38
+ continue;
39
+ skills.register({
40
+ name: meta.name,
41
+ description: meta.description,
42
+ ...(meta.whenToUse !== undefined ? { whenToUse: meta.whenToUse } : {}),
43
+ content: body,
44
+ source: 'custom',
45
+ });
46
+ }
47
+ }
48
+ //# sourceMappingURL=shipped-skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shipped-skills.js","sourceRoot":"","sources":["../src/shipped-skills.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAQxC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAChD,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAA8B,CAAA;IAC7D,IAAI,MAAM,KAAK,SAAS;QAAE,OAAM;IAChC,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACxE,KAAK,MAAM,KAAK,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACrE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAAE,SAAQ;QAClC,MAAM,GAAG,GAAG,YAAY,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,aAAa,KAAK,CAAC,IAAI,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;QAC7G,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAA;QACxD,IAAI,CAAC,CAAC;YAAE,SAAQ;QAChB,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAE,CAAA;QAClB,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAE,CAAA;QAClB,MAAM,IAAI,GAA2B,EAAE,CAAA;QACvC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC3B,IAAI,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACrE,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW;YAAE,SAAQ;QAC7C,MAAM,CAAC,QAAQ,CAAC;YACd,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@godv61/dsh-task-engine",
3
- "version": "0.6.1",
4
- "description": "Config-driven engineering delivery engine for DeepSeek Harness: a `dev_task` tool that hard-gates workflow stage transitions and commit scope/message, stage-level skill/rule bindings with progressive disclosure, and a browser settings page to edit each workspace's `.dsh/eng.json`.",
3
+ "version": "0.8.0",
4
+ "description": "Config-driven engineering delivery engine for DeepSeek Harness: a `dev_task` tool that hard-gates workflow stage transitions and commit scope/message, stage-level skill/rule bindings with progressive disclosure, a full-screen workbench to edit each workspace's flow, and preset-scoped activation — the tool and skills activate only for sessions on a preset that names the agent row.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -10,6 +10,10 @@
10
10
  "types": "./lib/index.d.ts",
11
11
  "default": "./lib/index.js"
12
12
  },
13
+ "./agent": {
14
+ "types": "./lib/agent.d.ts",
15
+ "default": "./lib/agent.js"
16
+ },
13
17
  "./client": "./lib/client.js",
14
18
  "./cordis.patch.yml": "./cordis.patch.yml",
15
19
  "./defaults/eng.json": "./defaults/eng.json",
@@ -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'