@patwoodman/dsh-sdlc-flow-tools 0.4.0-beta.19 → 0.4.0-beta.21
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 +11 -0
- package/lib/index.js +12 -1
- package/lib/plan.js +11 -0
- package/lib/plugin.js +26 -1
- package/lib/report.js +15 -0
- package/package.json +5 -2
package/lib/dispatch.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/sdlc-tools/src/dispatch.js — the Lead's dispatch/approval slice
|
|
3
|
+
* (spec v3 C.3/C.4): propose a dispatch, approve a transition, record a
|
|
4
|
+
* decision. `sdlc_plan_delta` has its own `./plan` entry.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { DISPATCH_TOOLS } from './index.js';
|
|
8
|
+
import { toolSubsetPlugin } from './plugin.js';
|
|
9
|
+
|
|
10
|
+
export const name = 'sdlc-tools/dispatch';
|
|
11
|
+
export const apply = toolSubsetPlugin(DISPATCH_TOOLS);
|
package/lib/index.js
CHANGED
|
@@ -16,6 +16,17 @@ export const WORKER_TOOLS = ['sdlc_report_result', 'sdlc_claim_check', 'sdlc_req
|
|
|
16
16
|
export const LEAD_TOOLS = ['sdlc_dispatch_task', 'sdlc_approve_transition', 'sdlc_record_decision', 'sdlc_plan_delta'];
|
|
17
17
|
export const ALL_TOOLS = [...WORKER_TOOLS, ...LEAD_TOOLS];
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* The three preset-plane slices (spec C.3). Each is a real loader entry with
|
|
21
|
+
* its own subpath export — the preset rows name them directly, so a worker's
|
|
22
|
+
* catalog is the report slice and the Lead's is report + dispatch + plan.
|
|
23
|
+
* They register TOOLS ONLY: the /sdlc command surface belongs to the host
|
|
24
|
+
* `sdlc-tools` row, not to every mounted preset.
|
|
25
|
+
*/
|
|
26
|
+
export const REPORT_TOOLS = [...WORKER_TOOLS];
|
|
27
|
+
export const DISPATCH_TOOLS = LEAD_TOOLS.filter((name) => name !== 'sdlc_plan_delta');
|
|
28
|
+
export const PLAN_TOOLS = ['sdlc_plan_delta'];
|
|
29
|
+
|
|
19
30
|
export const COMMANDS = [
|
|
20
31
|
'run', 'status', 'tasks', 'workers', 'models', 'logs', 'verify', 'resume', 'stop',
|
|
21
32
|
'explain', 'retry', 'elevate', 'approve', 'reject', 'doctor', 'config', 'init', 'lock', 'selftest',
|
|
@@ -227,4 +238,4 @@ export function validateToolArgs(name, args = {}) {
|
|
|
227
238
|
return errors.length ? { ok: false, error: errors.join('; ') } : { ok: true };
|
|
228
239
|
}
|
|
229
240
|
|
|
230
|
-
export default { TOOL_DEFS, WORKER_TOOLS, LEAD_TOOLS, COMMANDS, createHandlers, writeOutbox };
|
|
241
|
+
export default { TOOL_DEFS, WORKER_TOOLS, LEAD_TOOLS, REPORT_TOOLS, DISPATCH_TOOLS, PLAN_TOOLS, COMMANDS, createHandlers, writeOutbox };
|
package/lib/plan.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/sdlc-tools/src/plan.js — the Lead's plan-delta slice (spec v3
|
|
3
|
+
* C.3/C.4). Kept separate so the preset row can name exactly the tool it
|
|
4
|
+
* grants instead of re-mounting the whole tools plugin.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { PLAN_TOOLS } from './index.js';
|
|
8
|
+
import { toolSubsetPlugin } from './plugin.js';
|
|
9
|
+
|
|
10
|
+
export const name = 'sdlc-tools/plan';
|
|
11
|
+
export const apply = toolSubsetPlugin(PLAN_TOOLS);
|
package/lib/plugin.js
CHANGED
|
@@ -18,13 +18,20 @@ function pkgVersion() {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Register tool definitions on a DSH context.
|
|
23
|
+
*
|
|
24
|
+
* `config.tools` narrows the set to those names (the preset slices); omitting
|
|
25
|
+
* it registers the complete surface (the host `sdlc-tools` row).
|
|
26
|
+
*/
|
|
22
27
|
export function registerTools(ctx, config = {}) {
|
|
23
28
|
const registered = [];
|
|
29
|
+
const selected = Array.isArray(config.tools) ? new Set(config.tools) : null;
|
|
24
30
|
const worktreePath = config.worktreePath ?? process.cwd();
|
|
25
31
|
const handlers = createHandlers({ worktreePath, runMeta: config.runMeta ?? {} });
|
|
26
32
|
|
|
27
33
|
for (const [name, def] of Object.entries(TOOL_DEFS)) {
|
|
34
|
+
if (selected !== null && !selected.has(name)) continue;
|
|
28
35
|
const handler = handlers[name];
|
|
29
36
|
if (!handler) continue;
|
|
30
37
|
registered.push(name);
|
|
@@ -67,6 +74,24 @@ export function registerCommands(ctx, config = {}) {
|
|
|
67
74
|
return registered;
|
|
68
75
|
}
|
|
69
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Build a loader entry for one preset-plane tool slice.
|
|
79
|
+
*
|
|
80
|
+
* The preset rows use the package's `./report`, `./dispatch` and `./plan`
|
|
81
|
+
* exports, each of which is one of these. A slice registers only its tools
|
|
82
|
+
* and NEVER the command surface: the host `sdlc-tools` row owns commands, and
|
|
83
|
+
* mounting them once per preset would collide on the second mount.
|
|
84
|
+
* @param {string[]} toolNames - the exact tool names this entry registers.
|
|
85
|
+
* @returns {(ctx: object, config?: object) => undefined}
|
|
86
|
+
*/
|
|
87
|
+
export function toolSubsetPlugin(toolNames) {
|
|
88
|
+
const tools = [...toolNames];
|
|
89
|
+
return function applyToolSubset(ctx, config = {}) {
|
|
90
|
+
setSelftestMeta({ version: pkgVersion() });
|
|
91
|
+
contributeSelftest({ tools: registerTools(ctx, { ...config, tools }) });
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
70
95
|
/**
|
|
71
96
|
* Loader entry. MUST return nothing: the Cordis runner interprets a plugin's
|
|
72
97
|
* return value as an effect (`TypeError: Invalid effect` for a
|
package/lib/report.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* packages/sdlc-tools/src/report.js — the worker preset's propose-only result
|
|
3
|
+
* slice (spec v3 C.3/C.4).
|
|
4
|
+
*
|
|
5
|
+
* The preset rows name this subpath, not the package root: `lib/index.js` is
|
|
6
|
+
* data only, so the loader would reject it with "never started". Each slice is
|
|
7
|
+
* a real loader entry and registers tools only — commands stay with the host
|
|
8
|
+
* `sdlc-tools` row.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { REPORT_TOOLS } from './index.js';
|
|
12
|
+
import { toolSubsetPlugin } from './plugin.js';
|
|
13
|
+
|
|
14
|
+
export const name = 'sdlc-tools/report';
|
|
15
|
+
export const apply = toolSubsetPlugin(REPORT_TOOLS);
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patwoodman/dsh-sdlc-flow-tools",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.21",
|
|
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",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./lib/index.js",
|
|
9
9
|
"./plugin": "./lib/plugin.js",
|
|
10
|
+
"./report": "./lib/report.js",
|
|
11
|
+
"./dispatch": "./lib/dispatch.js",
|
|
12
|
+
"./plan": "./lib/plan.js",
|
|
10
13
|
"./package.json": "./package.json",
|
|
11
14
|
"./locale/*.json": "./locale/*.json",
|
|
12
15
|
"./icon": "./icon.svg",
|
|
@@ -49,6 +52,6 @@
|
|
|
49
52
|
"url": "https://github.com/pwoodman/dsh-sdlc/issues"
|
|
50
53
|
},
|
|
51
54
|
"dependencies": {
|
|
52
|
-
"@patwoodman/dsh-sdlc-flow-core": "0.4.0-beta.
|
|
55
|
+
"@patwoodman/dsh-sdlc-flow-core": "0.4.0-beta.21"
|
|
53
56
|
}
|
|
54
57
|
}
|