@patwoodman/dsh-sdlc-flow-tools 0.4.0-beta.21 → 0.4.0-beta.23
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/dispatch.js +1 -0
- package/lib/plan.js +1 -0
- package/lib/plugin.js +25 -13
- package/lib/report.js +1 -0
- package/package.json +2 -2
package/lib/dispatch.js
CHANGED
package/lib/plan.js
CHANGED
package/lib/plugin.js
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { readFileSync } from 'node:fs';
|
|
10
|
-
import { COMMANDS, TOOL_DEFS, WORKER_TOOLS, LEAD_TOOLS, ALL_TOOLS, DEBUG_COMMANDS, createHandlers } from './index.js';
|
|
10
|
+
import { COMMANDS, TOOL_DEFS, WORKER_TOOLS, LEAD_TOOLS, ALL_TOOLS, DEBUG_COMMANDS, createHandlers, validateToolArgs } from './index.js';
|
|
11
11
|
import { contributeSelftest, setSelftestMeta } from './selftest.js';
|
|
12
12
|
|
|
13
|
+
// Keep this metadata on every loader entry, including the preset slices.
|
|
14
|
+
export const inject = ['tools'];
|
|
15
|
+
|
|
13
16
|
function pkgVersion() {
|
|
14
17
|
try {
|
|
15
18
|
return JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
@@ -34,17 +37,23 @@ export function registerTools(ctx, config = {}) {
|
|
|
34
37
|
if (selected !== null && !selected.has(name)) continue;
|
|
35
38
|
const handler = handlers[name];
|
|
36
39
|
if (!handler) continue;
|
|
40
|
+
// Harness consumes raw JSON Schema + execute, not a handler callback.
|
|
41
|
+
// Registration errors must reject activation rather than report ghost tools.
|
|
42
|
+
ctx.tools.register({
|
|
43
|
+
...def,
|
|
44
|
+
execute: (args) => {
|
|
45
|
+
// Raw register() definitions do not get defineTool's argument wrapper.
|
|
46
|
+
const validation = validateToolArgs(name, args);
|
|
47
|
+
if (!validation.ok) throw new TypeError(`${name}: ${validation.error}`);
|
|
48
|
+
return handler(args);
|
|
49
|
+
},
|
|
50
|
+
output: {
|
|
51
|
+
// Proposals carry different JSON payloads; do not claim only { ok }.
|
|
52
|
+
schema: { type: 'object' },
|
|
53
|
+
render: (_args, value) => [{ type: 'text', text: def.output.render(value) }],
|
|
54
|
+
},
|
|
55
|
+
});
|
|
37
56
|
registered.push(name);
|
|
38
|
-
try {
|
|
39
|
-
if (typeof ctx?.tools?.register === 'function') {
|
|
40
|
-
ctx.tools.register({
|
|
41
|
-
...def,
|
|
42
|
-
handler: (args) => handler(args),
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
} catch (err) {
|
|
46
|
-
if (ctx?.logger?.warn) ctx.logger.warn('sdlc-tools: failed to register %s: %s', name, err?.message ?? err);
|
|
47
|
-
}
|
|
48
57
|
}
|
|
49
58
|
return registered;
|
|
50
59
|
}
|
|
@@ -52,11 +61,14 @@ export function registerTools(ctx, config = {}) {
|
|
|
52
61
|
/** Register the `/sdlc` command surface (interactive profiles only — E3). */
|
|
53
62
|
export function registerCommands(ctx, config = {}) {
|
|
54
63
|
const registered = [];
|
|
64
|
+
// Headless/preset compositions need no command adapter. Cordis optional
|
|
65
|
+
// services must be probed with get(), not undeclared ctx.commands access.
|
|
66
|
+
const commands = typeof ctx?.get === 'function' ? ctx.get('commands') : ctx?.commands;
|
|
55
67
|
for (const name of COMMANDS) {
|
|
56
68
|
registered.push(name);
|
|
57
69
|
try {
|
|
58
|
-
if (typeof
|
|
59
|
-
|
|
70
|
+
if (typeof commands?.register === 'function') {
|
|
71
|
+
commands.register({
|
|
60
72
|
definitionId: `sdlc.${name}`,
|
|
61
73
|
name: `sdlc ${name}`,
|
|
62
74
|
description: `SDLC orchestrator: ${name}`,
|
package/lib/report.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patwoodman/dsh-sdlc-flow-tools",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Model-facing propose-only tools (worker + lead) and the /sdlc command surface.",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -52,6 +52,6 @@
|
|
|
52
52
|
"url": "https://github.com/pwoodman/dsh-sdlc/issues"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@patwoodman/dsh-sdlc-flow-core": "0.4.0-beta.
|
|
55
|
+
"@patwoodman/dsh-sdlc-flow-core": "0.4.0-beta.23"
|
|
56
56
|
}
|
|
57
57
|
}
|