@oscaner-skills/cdd-engine 4.0.0 → 4.1.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/dist/face/host.js +10 -34
- package/dist/face/lifecycle.js +4 -1
- package/dist/face/termination.js +6 -1
- package/package.json +1 -1
package/dist/face/host.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// imported, never parsed:
|
|
6
6
|
//
|
|
7
7
|
// · HOSTS — the per-harness rows (cli / invoke / promptForm / output / ship /
|
|
8
|
-
// detect / install). The host-marker closure is single-sourced HERE: the
|
|
8
|
+
// detect / install / env). The host-marker closure is single-sourced HERE: the
|
|
9
9
|
// detect rows are the only copy of the marker env keys (the channel audit derives
|
|
10
10
|
// the env whitelist from them — never a second declaration). The promptForm
|
|
11
11
|
// column (§3.5) is the prompt-position semantics data contract — how the
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// to. M1 supersede (P5): the implement slot names the upstream
|
|
15
15
|
// `mattpocock-skills:implement` skill; the fix face carries no skill ref (its
|
|
16
16
|
// fix discipline lives as the FIX_SHELL typed instructions).
|
|
17
|
-
// · REFS — the per-harness slash reference forms (claude
|
|
17
|
+
// · REFS — the per-harness slash reference forms (claude uses the
|
|
18
18
|
// `/namespace:skill` form; pi the flat `/skill:<bare>` form — the pi flat
|
|
19
19
|
// namespace has no namespace-qualification syntax).
|
|
20
20
|
// · HostDetect — the module-level host judgment (the detection's single home):
|
|
@@ -53,32 +53,18 @@ export const INSTALL_ROWS = {
|
|
|
53
53
|
"claude plugin install impeccable@impeccable",
|
|
54
54
|
],
|
|
55
55
|
};
|
|
56
|
-
/** The per-harness host rows — claude /
|
|
56
|
+
/** The per-harness host rows — claude / pi adaptation facts. */
|
|
57
57
|
export const HOSTS = {
|
|
58
58
|
claude: {
|
|
59
59
|
promptForm: "ref-prefixed",
|
|
60
60
|
cli: "claude",
|
|
61
|
-
invoke: "-p --output-format text --dangerously-skip-permissions",
|
|
61
|
+
invoke: "-p --output-format text --dangerously-skip-permissions --exclude-dynamic-system-prompt-sections",
|
|
62
62
|
output: "text",
|
|
63
63
|
ship: "full",
|
|
64
64
|
detect: { env: "CLAUDE_CODE_SESSION_ID", aiAgentPrefix: "claude-code" },
|
|
65
65
|
install: INSTALL_ROWS,
|
|
66
66
|
capabilities: { parallel: true },
|
|
67
|
-
|
|
68
|
-
cursor: {
|
|
69
|
-
promptForm: "ref-prefixed",
|
|
70
|
-
cli: "cursor-agent",
|
|
71
|
-
invoke: "--print --output-format text --force",
|
|
72
|
-
output: "text",
|
|
73
|
-
ship: "full",
|
|
74
|
-
detect: { env: "CURSOR_TRACE_ID" },
|
|
75
|
-
install: {
|
|
76
|
-
kairos: "pending",
|
|
77
|
-
superpowers: "pending",
|
|
78
|
-
"mattpocock-skills": "pending",
|
|
79
|
-
impeccable: "pending",
|
|
80
|
-
},
|
|
81
|
-
capabilities: { parallel: "pending" },
|
|
67
|
+
env: { FORCE_PROMPT_CACHING_5M: "1" },
|
|
82
68
|
},
|
|
83
69
|
pi: {
|
|
84
70
|
promptForm: "ref-prefixed",
|
|
@@ -94,6 +80,7 @@ export const HOSTS = {
|
|
|
94
80
|
impeccable: ["npx impeccable install --providers=pi --scope=global -y"],
|
|
95
81
|
},
|
|
96
82
|
capabilities: { parallel: "pending" },
|
|
83
|
+
env: { PI_CACHE_RETENTION: "short" },
|
|
97
84
|
},
|
|
98
85
|
};
|
|
99
86
|
/** The dispatch table — the phase/type → skill-ref resolution. The implement slot
|
|
@@ -111,64 +98,53 @@ export const DISPATCH = {
|
|
|
111
98
|
},
|
|
112
99
|
};
|
|
113
100
|
/** The reference table — every `<pkg>:<skill>` cross-skill reference key and its
|
|
114
|
-
* per-harness slash form: claude
|
|
101
|
+
* per-harness slash form: claude uses `/namespace:skill`, pi the flat
|
|
115
102
|
* `/skill:<bare>` form. The `mattpocock-skills:implement` key is registered here
|
|
116
103
|
* (P5 — the implement dispatch's first-class refs-domain entry). */
|
|
117
104
|
export const REFS = {
|
|
118
105
|
"superpowers:brainstorming": {
|
|
119
106
|
claude: "/superpowers:brainstorming",
|
|
120
|
-
cursor: "/superpowers:brainstorming",
|
|
121
107
|
pi: "/skill:brainstorming",
|
|
122
108
|
},
|
|
123
109
|
"superpowers:writing-plans": {
|
|
124
110
|
claude: "/superpowers:writing-plans",
|
|
125
|
-
cursor: "/superpowers:writing-plans",
|
|
126
111
|
pi: "/skill:writing-plans",
|
|
127
112
|
},
|
|
128
113
|
"superpowers:finishing-a-development-branch": {
|
|
129
114
|
claude: "/superpowers:finishing-a-development-branch",
|
|
130
|
-
cursor: "/superpowers:finishing-a-development-branch",
|
|
131
115
|
pi: "/skill:finishing-a-development-branch",
|
|
132
116
|
},
|
|
133
117
|
"mattpocock-skills:implement": {
|
|
134
118
|
claude: "/mattpocock-skills:implement",
|
|
135
|
-
cursor: "/mattpocock-skills:implement",
|
|
136
119
|
pi: "/skill:implement",
|
|
137
120
|
},
|
|
138
121
|
"mattpocock-skills:code-review": {
|
|
139
122
|
claude: "/mattpocock-skills:code-review",
|
|
140
|
-
cursor: "/mattpocock-skills:code-review",
|
|
141
123
|
pi: "/skill:code-review",
|
|
142
124
|
},
|
|
143
125
|
"mattpocock-skills:grilling": {
|
|
144
126
|
claude: "/mattpocock-skills:grilling",
|
|
145
|
-
cursor: "/mattpocock-skills:grilling",
|
|
146
127
|
pi: "/skill:grilling",
|
|
147
128
|
},
|
|
148
129
|
"kairos:cdd-design": {
|
|
149
130
|
claude: "/kairos:cdd-design",
|
|
150
|
-
cursor: "/kairos:cdd-design",
|
|
151
131
|
pi: "/skill:cdd-design",
|
|
152
132
|
},
|
|
153
133
|
"kairos:cdd-spec-writer": {
|
|
154
134
|
claude: "/kairos:cdd-spec-writer",
|
|
155
|
-
cursor: "/kairos:cdd-spec-writer",
|
|
156
135
|
pi: "/skill:cdd-spec-writer",
|
|
157
136
|
},
|
|
158
137
|
"kairos:cdd-plan": {
|
|
159
138
|
claude: "/kairos:cdd-plan",
|
|
160
|
-
cursor: "/kairos:cdd-plan",
|
|
161
139
|
pi: "/skill:cdd-plan",
|
|
162
140
|
},
|
|
163
|
-
"kairos:cdd-dev": { claude: "/kairos:cdd-dev",
|
|
141
|
+
"kairos:cdd-dev": { claude: "/kairos:cdd-dev", pi: "/skill:cdd-dev" },
|
|
164
142
|
"kairos:cdd-close": {
|
|
165
143
|
claude: "/kairos:cdd-close",
|
|
166
|
-
cursor: "/kairos:cdd-close",
|
|
167
144
|
pi: "/skill:cdd-close",
|
|
168
145
|
},
|
|
169
146
|
"kairos:cdd-report": {
|
|
170
147
|
claude: "/kairos:cdd-report",
|
|
171
|
-
cursor: "/kairos:cdd-report",
|
|
172
148
|
pi: "/skill:cdd-report",
|
|
173
149
|
},
|
|
174
150
|
};
|
|
@@ -185,12 +161,12 @@ export const HOST_CONTRACT = {
|
|
|
185
161
|
// biome-ignore lint/complexity/noStaticOnlyClass: the module-level host-detect surface — the zero-bare-function discipline admits no standalone predicate functions.
|
|
186
162
|
export class HostDetect {
|
|
187
163
|
/** detect(env) — the first host detect row that matches, in the pinned order
|
|
188
|
-
* `claude` → `
|
|
164
|
+
* `claude` → `pi` (specific markers first, the generic AI_AGENT
|
|
189
165
|
* last). One row detects by its primary marker (a session env, presence/enum —
|
|
190
166
|
* a UUID CLAUDE_CODE_SESSION_ID is claude by presence) or by the AI_AGENT
|
|
191
167
|
* prefix (AI_AGENT=claude-code-…); no match returns `""`. */
|
|
192
168
|
static detect(env) {
|
|
193
|
-
for (const id of ["claude", "
|
|
169
|
+
for (const id of ["claude", "pi"]) {
|
|
194
170
|
const detect = HOSTS[id].detect;
|
|
195
171
|
if (detect.env !== undefined && detect.env !== "") {
|
|
196
172
|
const marker = env[detect.env];
|
package/dist/face/lifecycle.js
CHANGED
|
@@ -71,7 +71,7 @@ export class CliLifecycle {
|
|
|
71
71
|
};
|
|
72
72
|
this.#reviews = opts.reviews ?? null;
|
|
73
73
|
}
|
|
74
|
-
/** The host-harness id detected from the env — "claude" | "
|
|
74
|
+
/** The host-harness id detected from the env — "claude" | "pi" | "" —
|
|
75
75
|
* a delegation to the module-level judgment (HostDetect.detect, face/host.ts —
|
|
76
76
|
* the detection's single home; this instance method is the injectable-env
|
|
77
77
|
* adapter the lifecycle face rides, behavior unchanged). */
|
|
@@ -112,6 +112,9 @@ export class CliLifecycle {
|
|
|
112
112
|
cwd: this.#scene.workspace.root.repoRoot,
|
|
113
113
|
heartbeatPath: this.#scene.workspace.resolve("liveness.json"),
|
|
114
114
|
policy: TerminationPolicy.of(frame.phase),
|
|
115
|
+
// The host row's own child env — the TTL pin the terminator layers over the
|
|
116
|
+
// inherited env at spawn (the host difference is data, never a dispatcher branch).
|
|
117
|
+
env: row.env,
|
|
115
118
|
});
|
|
116
119
|
// The child's stdout rides the diagnostic channel — #reject reads it into the
|
|
117
120
|
// crash record on either failure face. Child Return is prose: the engine never
|
package/dist/face/termination.js
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
// The seam's two ends are value objects, so the whole child lifecycle speaks one
|
|
9
9
|
// shape:
|
|
10
10
|
// · `ChildRun` — one dispatch's full context (command/args/cwd + the heartbeat
|
|
11
|
-
// path the sampler writes + the termination policy of the phase
|
|
11
|
+
// path the sampler writes + the termination policy of the phase + the per-host
|
|
12
|
+
// dispatch env);
|
|
12
13
|
// · `ChildOutcome` — the child's result (its own exit code, verbatim streams)
|
|
13
14
|
// plus the `termination` fact: non-null ⟺ the round was cut short. The
|
|
14
15
|
// terminated round's downstream judgments all read that one fact, never the
|
|
@@ -392,6 +393,10 @@ export class Terminator {
|
|
|
392
393
|
cwd: run.cwd,
|
|
393
394
|
reject: false,
|
|
394
395
|
stripFinalNewline: false,
|
|
396
|
+
// The dispatch env is layered over the inherited one — the engine's per-host
|
|
397
|
+
// values win, the parent environment supplies the rest (the single merge point;
|
|
398
|
+
// the dispatcher carries zero host branches).
|
|
399
|
+
env: { ...process.env, ...run.env },
|
|
395
400
|
// fd 0 on /dev/null: a child that reads stdin sees EOF at once, never a pipe nobody closes.
|
|
396
401
|
stdin: "ignore",
|
|
397
402
|
killDescendants: true,
|