@agentic-sdlc-kit/mod-sdk 0.0.0-stage → 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/LICENSE +21 -0
- package/dist/capabilities/analyzer.d.ts +13 -0
- package/dist/capabilities/analyzer.d.ts.map +1 -0
- package/dist/capabilities/analyzer.js +58 -0
- package/dist/capabilities/analyzer.js.map +1 -0
- package/dist/capabilities/index.d.ts +2 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +3 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/manifest.d.ts +40 -0
- package/dist/capabilities/manifest.d.ts.map +1 -0
- package/dist/capabilities/manifest.js +35 -0
- package/dist/capabilities/manifest.js.map +1 -0
- package/dist/claude-code-shim.d.ts +22 -0
- package/dist/claude-code-shim.d.ts.map +1 -0
- package/dist/claude-code-shim.js +30 -0
- package/dist/claude-code-shim.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/compose.d.ts +3 -0
- package/dist/middleware/compose.d.ts.map +1 -0
- package/dist/middleware/compose.js +28 -0
- package/dist/middleware/compose.js.map +1 -0
- package/dist/middleware/index.d.ts +2 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +3 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/mock-runtime.d.ts +96 -0
- package/dist/testing/mock-runtime.d.ts.map +1 -0
- package/dist/testing/mock-runtime.js +379 -0
- package/dist/testing/mock-runtime.js.map +1 -0
- package/dist/types/events.d.ts +158 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +35 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +37 -3
- package/src/capabilities/analyzer.test.ts +77 -0
- package/src/capabilities/analyzer.ts +68 -0
- package/src/capabilities/index.ts +2 -0
- package/src/capabilities/manifest.ts +38 -0
- package/src/claude-code-shim.ts +43 -0
- package/src/index.ts +14 -0
- package/src/middleware/compose.test.ts +70 -0
- package/src/middleware/compose.ts +29 -0
- package/src/middleware/index.ts +2 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/mock-runtime.test.ts +264 -0
- package/src/testing/mock-runtime.ts +452 -0
- package/src/types/events.ts +275 -0
- package/src/types/index.ts +2 -0
- package/README.md +0 -3
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
// packages/mod-sdk/src/testing/mock-runtime.ts
|
|
2
|
+
//
|
|
3
|
+
// MockRuntime: captures registered handlers and lets tests fire events
|
|
4
|
+
// without launching Claude Code. This is the testing utility RESEARCH.md §6
|
|
5
|
+
// recommends ("packages/testing should make event middleware testable
|
|
6
|
+
// without starting a Claude Code session").
|
|
7
|
+
//
|
|
8
|
+
// The mock mirrors the REAL host contract (verified against
|
|
9
|
+
// @anthropic-ai/claude-code 2.1.329 — see types/events.ts header), so a
|
|
10
|
+
// test that passes here exercises the shapes Claude Code actually
|
|
11
|
+
// delivers:
|
|
12
|
+
// - tool.call events carry the tool's arguments as fields (e.command),
|
|
13
|
+
// tool.check carries them under e.input;
|
|
14
|
+
// - on(...) returns a registration with .catch(handler); when a hook
|
|
15
|
+
// throws, the .catch handler's return value replaces its contribution
|
|
16
|
+
// (and without one the hook is skipped, like the host does);
|
|
17
|
+
// - turn.step's next is an async generator, so `yield* next(e)` works;
|
|
18
|
+
// - $.ui.ask / $.process.run / $.clock.now / $.session.id are mocked
|
|
19
|
+
// explicitly (tests queue answers and process results) — nothing is
|
|
20
|
+
// fabricated behind the test's back;
|
|
21
|
+
// - $.clock.now / $.session.id / $.session.cwd / $.state.get / $.state.set
|
|
22
|
+
// are ASYNC and state reads resolve to StateRead<T> (unwrap `.value`),
|
|
23
|
+
// exactly as on the official engine.
|
|
24
|
+
function isAsyncGenerator(v) {
|
|
25
|
+
return (v !== null &&
|
|
26
|
+
typeof v === 'object' &&
|
|
27
|
+
typeof v.next === 'function' &&
|
|
28
|
+
typeof v[Symbol.asyncIterator] === 'function');
|
|
29
|
+
}
|
|
30
|
+
function matcherFieldMatches(field, value) {
|
|
31
|
+
if (field instanceof RegExp) {
|
|
32
|
+
return typeof value === 'string' && field.test(value);
|
|
33
|
+
}
|
|
34
|
+
if (Array.isArray(field)) {
|
|
35
|
+
return field.some((f) => matcherFieldMatches(f, value));
|
|
36
|
+
}
|
|
37
|
+
return field === value;
|
|
38
|
+
}
|
|
39
|
+
export class MockRuntime {
|
|
40
|
+
registrations = [];
|
|
41
|
+
logs = [];
|
|
42
|
+
statuses = [];
|
|
43
|
+
stateStore = {};
|
|
44
|
+
poisonedStateKeys = new Set();
|
|
45
|
+
fsStore = {};
|
|
46
|
+
fsListings = {};
|
|
47
|
+
// $.ui.ask: queued answers popped FIFO; when empty, ask REJECTS (nobody
|
|
48
|
+
// to ask — the same refusal a headless claude -p run produces).
|
|
49
|
+
askAnswers = [];
|
|
50
|
+
// $.process.run: queued results popped FIFO; when empty, run throws
|
|
51
|
+
// (tests must be explicit about what git/... would return).
|
|
52
|
+
processResults = [];
|
|
53
|
+
processCalls = [];
|
|
54
|
+
registeredCommands = [];
|
|
55
|
+
clockNowMs;
|
|
56
|
+
sessionIdentifier = 'session-mock';
|
|
57
|
+
sessionCwd = '/project';
|
|
58
|
+
// What the host's own behavior (the terminal next) resolves to.
|
|
59
|
+
hostResult;
|
|
60
|
+
// Chunks the host would stream for turn.step.
|
|
61
|
+
hostChunks = [];
|
|
62
|
+
constructor(nowMs = Date.parse('2026-11-20T12:00:00.000Z')) {
|
|
63
|
+
this.clockNowMs = nowMs;
|
|
64
|
+
}
|
|
65
|
+
api = {
|
|
66
|
+
ui: {
|
|
67
|
+
log: (msg) => {
|
|
68
|
+
this.logs.push(msg);
|
|
69
|
+
},
|
|
70
|
+
status: (text) => {
|
|
71
|
+
this.statuses.push(text);
|
|
72
|
+
},
|
|
73
|
+
ask: async (_question, _options) => {
|
|
74
|
+
const answer = this.askAnswers.shift();
|
|
75
|
+
if (answer === undefined) {
|
|
76
|
+
throw new Error('mock ask: nobody to ask (headless run)');
|
|
77
|
+
}
|
|
78
|
+
return answer;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
fs: {
|
|
82
|
+
read: async (path) => {
|
|
83
|
+
if (!(path in this.fsStore))
|
|
84
|
+
throw new Error(`mock fs: ${path} not found`);
|
|
85
|
+
return this.fsStore[path];
|
|
86
|
+
},
|
|
87
|
+
write: async (path, content) => {
|
|
88
|
+
this.fsStore[path] = content;
|
|
89
|
+
},
|
|
90
|
+
exists: async (path) => path in this.fsStore || path in this.fsListings,
|
|
91
|
+
list: async (path) => {
|
|
92
|
+
const listed = this.fsListings[path];
|
|
93
|
+
if (!listed)
|
|
94
|
+
throw new Error(`mock fs: ${path} not listable`);
|
|
95
|
+
return [...listed];
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
process: {
|
|
99
|
+
run: async (args) => {
|
|
100
|
+
this.processCalls.push(args);
|
|
101
|
+
const result = this.processResults.shift();
|
|
102
|
+
if (result === undefined) {
|
|
103
|
+
throw new Error(`mock process: no result queued for [${args.join(' ')}]`);
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
command: {
|
|
109
|
+
register: async (cmd) => {
|
|
110
|
+
this.registeredCommands.push({ name: cmd.name, description: cmd.description });
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
session: {
|
|
114
|
+
id: async () => this.sessionIdentifier,
|
|
115
|
+
cwd: async () => this.sessionCwd,
|
|
116
|
+
},
|
|
117
|
+
clock: {
|
|
118
|
+
now: async () => this.clockNowMs,
|
|
119
|
+
},
|
|
120
|
+
state: {
|
|
121
|
+
get: async (ref) => {
|
|
122
|
+
const key = MockRuntime.refKey(ref);
|
|
123
|
+
if (this.poisonedStateKeys.has(key)) {
|
|
124
|
+
throw new Error(`mock state: ${key} is poisoned`);
|
|
125
|
+
}
|
|
126
|
+
return { value: this.stateStore[key] };
|
|
127
|
+
},
|
|
128
|
+
set: async (ref, value) => {
|
|
129
|
+
this.stateStore[MockRuntime.refKey(ref)] = value;
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
http: {
|
|
133
|
+
fetch: async () => {
|
|
134
|
+
throw new Error('mock http: networkAccess not allowed in tests by default');
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* The `on` function passed to a Mod's register(). Captures registrations
|
|
140
|
+
* and returns a registration object with a .catch(handler) method, the
|
|
141
|
+
* same shape the real host returns.
|
|
142
|
+
*/
|
|
143
|
+
on = ((event, ...rest) => {
|
|
144
|
+
let matcher;
|
|
145
|
+
let handler;
|
|
146
|
+
if (rest.length === 1) {
|
|
147
|
+
const h = rest[0];
|
|
148
|
+
handler = h;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
matcher = rest[0];
|
|
152
|
+
handler = rest[1];
|
|
153
|
+
}
|
|
154
|
+
const registration = { event: event, matcher, handler };
|
|
155
|
+
this.registrations.push(registration);
|
|
156
|
+
return {
|
|
157
|
+
catch: (catchHandler) => {
|
|
158
|
+
registration.catchHandler = catchHandler;
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
/**
|
|
163
|
+
* Load a Mod by calling its register function with this runtime's `on`.
|
|
164
|
+
*/
|
|
165
|
+
load(register) {
|
|
166
|
+
register(this.on);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Fire an event. Builds the middleware chain from every registration
|
|
170
|
+
* whose matcher accepts the event (registration order = outside-in, the
|
|
171
|
+
* same order the host stacks hooks) and returns what the host would see.
|
|
172
|
+
*/
|
|
173
|
+
async fire(event, e) {
|
|
174
|
+
const matching = this.registrations.filter((r) => r.event === event && this.matcherMatches(r.matcher, e));
|
|
175
|
+
const result = { value: undefined, answered: false, forwarded: false, chunks: [] };
|
|
176
|
+
if (matching.length === 0) {
|
|
177
|
+
// No hook matches: the event goes straight to the host's own
|
|
178
|
+
// behavior, unimpeded.
|
|
179
|
+
return { value: this.hostResult, answered: false, forwarded: true, chunks: [] };
|
|
180
|
+
}
|
|
181
|
+
// The host's own behavior: for streaming events it is an async
|
|
182
|
+
// generator (so `yield* next(e)` delegates); otherwise it resolves to
|
|
183
|
+
// the configured host result.
|
|
184
|
+
const terminal = async (ev) => {
|
|
185
|
+
result.forwarded = true;
|
|
186
|
+
result.terminalEvent = ev;
|
|
187
|
+
return this.hostResult;
|
|
188
|
+
};
|
|
189
|
+
const terminalStream = async function* (ev) {
|
|
190
|
+
result.forwarded = true;
|
|
191
|
+
result.terminalEvent = ev;
|
|
192
|
+
for (const chunk of this.hostChunks) {
|
|
193
|
+
result.chunks.push(chunk);
|
|
194
|
+
yield chunk;
|
|
195
|
+
}
|
|
196
|
+
return this.hostResult;
|
|
197
|
+
};
|
|
198
|
+
const isStreaming = event === 'turn.step';
|
|
199
|
+
let chain = isStreaming
|
|
200
|
+
? (ev) => terminalStream.call(this, ev)
|
|
201
|
+
: (ev) => terminal(ev);
|
|
202
|
+
// Drain a generator to its return value (used on error/skip paths and
|
|
203
|
+
// once at the outermost level).
|
|
204
|
+
const drain = async (gen) => {
|
|
205
|
+
const it = gen[Symbol.asyncIterator]();
|
|
206
|
+
let r = await it.next();
|
|
207
|
+
while (!r.done) {
|
|
208
|
+
r = await it.next();
|
|
209
|
+
}
|
|
210
|
+
return r.value;
|
|
211
|
+
};
|
|
212
|
+
for (let i = matching.length - 1; i >= 0; i--) {
|
|
213
|
+
const reg = matching[i];
|
|
214
|
+
if (!reg)
|
|
215
|
+
continue;
|
|
216
|
+
const currentNext = chain;
|
|
217
|
+
const currentHandler = reg.handler;
|
|
218
|
+
const currentCatch = reg.catchHandler;
|
|
219
|
+
// Error path: a chained .catch handler replaces the hook's
|
|
220
|
+
// contribution; without one the host SKIPS the hook (the rest of
|
|
221
|
+
// the chain runs as if it weren't there).
|
|
222
|
+
const handleError = async (err, ev) => {
|
|
223
|
+
if (currentCatch !== undefined) {
|
|
224
|
+
return currentCatch(err);
|
|
225
|
+
}
|
|
226
|
+
const downstream = currentNext(ev);
|
|
227
|
+
if (isAsyncGenerator(downstream)) {
|
|
228
|
+
return drain(downstream);
|
|
229
|
+
}
|
|
230
|
+
return downstream;
|
|
231
|
+
};
|
|
232
|
+
// The link must pass a downstream GENERATOR through synchronously so
|
|
233
|
+
// an outer streaming handler can delegate with `yield* next(e)`.
|
|
234
|
+
chain = (ev) => {
|
|
235
|
+
let out;
|
|
236
|
+
try {
|
|
237
|
+
// The handler signature is ($, e, next).
|
|
238
|
+
out = currentHandler(this.api, ev, currentNext);
|
|
239
|
+
}
|
|
240
|
+
catch (err) {
|
|
241
|
+
return handleError(err, ev);
|
|
242
|
+
}
|
|
243
|
+
if (out !== null &&
|
|
244
|
+
typeof out === 'object' &&
|
|
245
|
+
typeof out.then === 'function' &&
|
|
246
|
+
!isAsyncGenerator(out)) {
|
|
247
|
+
// A plain async handler: route rejections through the error path.
|
|
248
|
+
return out.then(undefined, (err) => handleError(err, ev));
|
|
249
|
+
}
|
|
250
|
+
return out;
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
// Run the outermost link. A streaming handler surfaces a generator —
|
|
254
|
+
// drain it (its yields already forwarded through the chain).
|
|
255
|
+
let value;
|
|
256
|
+
const outer = chain(e);
|
|
257
|
+
if (isAsyncGenerator(outer)) {
|
|
258
|
+
value = await drain(outer);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
value = await outer;
|
|
262
|
+
}
|
|
263
|
+
result.value = value;
|
|
264
|
+
// `answered` = the chain produced a value the host alone would not
|
|
265
|
+
// have: a hook short-circuited (or rewrote the result) instead of
|
|
266
|
+
// merely forwarding the host's own behavior.
|
|
267
|
+
result.answered = value !== undefined && !(result.forwarded && value === this.hostResult);
|
|
268
|
+
return result;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Get the captured UI logs (from $.ui.log calls).
|
|
272
|
+
*/
|
|
273
|
+
getLogs() {
|
|
274
|
+
return [...this.logs];
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get the captured status lines (from $.ui.status calls).
|
|
278
|
+
*/
|
|
279
|
+
getStatuses() {
|
|
280
|
+
return [...this.statuses];
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Get the number of registrations for a given event.
|
|
284
|
+
*/
|
|
285
|
+
registrationCount(event) {
|
|
286
|
+
if (event === undefined)
|
|
287
|
+
return this.registrations.length;
|
|
288
|
+
return this.registrations.filter((r) => r.event === event).length;
|
|
289
|
+
}
|
|
290
|
+
/** Set mock filesystem content for $.fs.read. */
|
|
291
|
+
setFile(path, content) {
|
|
292
|
+
this.fsStore[path] = content;
|
|
293
|
+
}
|
|
294
|
+
/** Set a mock directory listing for $.fs.list. */
|
|
295
|
+
setListing(path, entries) {
|
|
296
|
+
this.fsListings[path] = entries;
|
|
297
|
+
}
|
|
298
|
+
/** Get the recorded state (for assertions). */
|
|
299
|
+
getState(ref) {
|
|
300
|
+
return this.stateStore[MockRuntime.refKey(ref)];
|
|
301
|
+
}
|
|
302
|
+
/** Set state a test wants a hook to read via $.state.get. */
|
|
303
|
+
setState(ref, value) {
|
|
304
|
+
this.stateStore[MockRuntime.refKey(ref)] = value;
|
|
305
|
+
}
|
|
306
|
+
/** Make $.state.get throw for a key (to exercise fail-closed .catch). */
|
|
307
|
+
poisonState(plugin, key) {
|
|
308
|
+
this.poisonedStateKeys.add(`${plugin}.${key}`);
|
|
309
|
+
}
|
|
310
|
+
/** Queue the labels $.ui.ask resolves to, in order (FIFO). */
|
|
311
|
+
queueAskAnswers(...answers) {
|
|
312
|
+
this.askAnswers.push(...answers);
|
|
313
|
+
}
|
|
314
|
+
/** Queue $.process.run results, in order (FIFO). */
|
|
315
|
+
queueProcessResults(...results) {
|
|
316
|
+
this.processResults.push(...results.map((r) => ({
|
|
317
|
+
stdout: r.stdout,
|
|
318
|
+
stderr: r.stderr ?? '',
|
|
319
|
+
exitCode: r.exitCode ?? 0,
|
|
320
|
+
})));
|
|
321
|
+
}
|
|
322
|
+
/** The argument arrays $.process.run was called with, in order. */
|
|
323
|
+
getProcessCalls() {
|
|
324
|
+
return [...this.processCalls];
|
|
325
|
+
}
|
|
326
|
+
/** Commands registered via $.command.register. */
|
|
327
|
+
getRegisteredCommands() {
|
|
328
|
+
return [...this.registeredCommands];
|
|
329
|
+
}
|
|
330
|
+
/** Set what the host's own behavior resolves to (the terminal next). */
|
|
331
|
+
setHostResult(value) {
|
|
332
|
+
this.hostResult = value;
|
|
333
|
+
}
|
|
334
|
+
/** Set the chunks the host streams for turn.step. */
|
|
335
|
+
setHostChunks(chunks) {
|
|
336
|
+
this.hostChunks = [...chunks];
|
|
337
|
+
}
|
|
338
|
+
/** Set the mock clock (ms since epoch) — `await $.clock.now()` returns it. */
|
|
339
|
+
setNow(nowMs) {
|
|
340
|
+
this.clockNowMs = nowMs;
|
|
341
|
+
}
|
|
342
|
+
/** Advance the mock clock. */
|
|
343
|
+
advanceClock(ms) {
|
|
344
|
+
this.clockNowMs += ms;
|
|
345
|
+
}
|
|
346
|
+
/** The current mock clock value. */
|
|
347
|
+
now() {
|
|
348
|
+
return this.clockNowMs;
|
|
349
|
+
}
|
|
350
|
+
/** Set the session identity `await $.session.id()` returns. */
|
|
351
|
+
setSession(sessionId, cwd = '/project') {
|
|
352
|
+
this.sessionIdentifier = sessionId;
|
|
353
|
+
this.sessionCwd = cwd;
|
|
354
|
+
}
|
|
355
|
+
static refKey(ref) {
|
|
356
|
+
return `${ref.plugin}.${ref.key}`;
|
|
357
|
+
}
|
|
358
|
+
matcherMatches(matcher, e) {
|
|
359
|
+
if (!matcher)
|
|
360
|
+
return true;
|
|
361
|
+
if (matcher.tool !== undefined) {
|
|
362
|
+
const tool = e.tool;
|
|
363
|
+
if (!matcherFieldMatches(matcher.tool, tool))
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
if (matcher.command !== undefined) {
|
|
367
|
+
const command = e.command;
|
|
368
|
+
if (!matcherFieldMatches(matcher.command, command))
|
|
369
|
+
return false;
|
|
370
|
+
}
|
|
371
|
+
if (matcher.isReadOnly !== undefined) {
|
|
372
|
+
const isReadOnly = e.isReadOnly;
|
|
373
|
+
if (!matcherFieldMatches(matcher.isReadOnly, isReadOnly))
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
//# sourceMappingURL=mock-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-runtime.js","sourceRoot":"","sources":["../../src/testing/mock-runtime.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,uEAAuE;AACvE,4EAA4E;AAC5E,sEAAsE;AACtE,4CAA4C;AAC5C,EAAE;AACF,4DAA4D;AAC5D,wEAAwE;AACxE,kEAAkE;AAClE,YAAY;AACZ,yEAAyE;AACzE,6CAA6C;AAC7C,uEAAuE;AACvE,0EAA0E;AAC1E,iEAAiE;AACjE,yEAAyE;AACzE,uEAAuE;AACvE,wEAAwE;AACxE,yCAAyC;AACzC,6EAA6E;AAC7E,2EAA2E;AAC3E,yCAAyC;AAqCzC,SAAS,gBAAgB,CAAC,CAAU;IAClC,OAAO,CACL,CAAC,KAAK,IAAI;QACV,OAAO,CAAC,KAAK,QAAQ;QACrB,OAAQ,CAAoB,CAAC,IAAI,KAAK,UAAU;QAChD,OAAQ,CAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,UAAU,CAClE,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,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AC,GAAG,EAAE,CAAC;IACpC,CAAC;IAEO,cAAc,CACpB,OAA4B,EAC5B,CAAa;QAEb,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAC1B,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAI,CAAmC,CAAC,IAAI,CAAC;YACvD,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC;QAC7D,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAClC,MAAM,OAAO,GAAI,CAAsC,CAAC,OAAO,CAAC;YAChE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;gBAAE,OAAO,KAAK,CAAC;QACnE,CAAC;QACD,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACrC,MAAM,UAAU,GAAI,CAAyC,CAAC,UAAU,CAAC;YACzE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;gBAAE,OAAO,KAAK,CAAC;QACzE,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export interface ToolCallEvent {
|
|
2
|
+
tool: string;
|
|
3
|
+
command?: string;
|
|
4
|
+
file_path?: string;
|
|
5
|
+
content?: string;
|
|
6
|
+
old_string?: string;
|
|
7
|
+
new_string?: string;
|
|
8
|
+
notebook_path?: string;
|
|
9
|
+
new_source?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface ToolCallResult {
|
|
13
|
+
deny?: string;
|
|
14
|
+
result?: unknown;
|
|
15
|
+
isError?: boolean;
|
|
16
|
+
text?: string;
|
|
17
|
+
context?: string[];
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface ToolCheckEvent {
|
|
21
|
+
tool: string;
|
|
22
|
+
input: {
|
|
23
|
+
command?: string;
|
|
24
|
+
file_path?: string;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
};
|
|
27
|
+
isReadOnly?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ToolCheckResult {
|
|
30
|
+
decision: 'allow' | 'ask' | 'deny';
|
|
31
|
+
reason?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface TurnUsage {
|
|
34
|
+
input_tokens?: number;
|
|
35
|
+
output_tokens?: number;
|
|
36
|
+
cache_read_input_tokens?: number;
|
|
37
|
+
cache_creation_input_tokens?: number;
|
|
38
|
+
model?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface TurnStepEvent {
|
|
41
|
+
model?: string;
|
|
42
|
+
effort?: string;
|
|
43
|
+
agentId?: string;
|
|
44
|
+
request?: unknown;
|
|
45
|
+
}
|
|
46
|
+
export interface TurnStepResult {
|
|
47
|
+
usage?: TurnUsage | null;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
export interface TurnStartEvent {
|
|
51
|
+
turnId: string;
|
|
52
|
+
}
|
|
53
|
+
export interface TurnCompleteEvent {
|
|
54
|
+
turnId?: string;
|
|
55
|
+
answer: string;
|
|
56
|
+
durationMs: number;
|
|
57
|
+
usage?: TurnUsage;
|
|
58
|
+
isAborted?: boolean;
|
|
59
|
+
agentId?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface AgentSpawnEvent {
|
|
62
|
+
name?: string;
|
|
63
|
+
subagentType?: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
model?: string;
|
|
66
|
+
isTeammate?: boolean;
|
|
67
|
+
resume?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface SessionStartEvent {
|
|
70
|
+
}
|
|
71
|
+
export interface SessionEndEvent {
|
|
72
|
+
reason?: 'clear' | 'resume' | 'logout' | 'prompt_input_exit' | 'other';
|
|
73
|
+
}
|
|
74
|
+
export interface CommandRunEvent {
|
|
75
|
+
command: string;
|
|
76
|
+
args?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface EventMap {
|
|
79
|
+
'tool.call': ToolCallEvent;
|
|
80
|
+
'tool.check': ToolCheckEvent;
|
|
81
|
+
'turn.start': TurnStartEvent;
|
|
82
|
+
'turn.step': TurnStepEvent;
|
|
83
|
+
'turn.complete': TurnCompleteEvent;
|
|
84
|
+
'agent.spawn': AgentSpawnEvent;
|
|
85
|
+
'session.start': SessionStartEvent;
|
|
86
|
+
'session.end': SessionEndEvent;
|
|
87
|
+
'command.run': CommandRunEvent;
|
|
88
|
+
}
|
|
89
|
+
export type EventName = keyof EventMap;
|
|
90
|
+
export type EventOf<N extends EventName> = EventMap[N];
|
|
91
|
+
export interface StateRef {
|
|
92
|
+
plugin: string;
|
|
93
|
+
key: string;
|
|
94
|
+
}
|
|
95
|
+
export interface StateRead<T> {
|
|
96
|
+
value: T | undefined;
|
|
97
|
+
}
|
|
98
|
+
export interface ProcessResult {
|
|
99
|
+
stdout: string;
|
|
100
|
+
stderr: string;
|
|
101
|
+
exitCode: number;
|
|
102
|
+
}
|
|
103
|
+
export interface ModsApi {
|
|
104
|
+
ui: {
|
|
105
|
+
log: (message: string) => void;
|
|
106
|
+
status: (text: string) => void;
|
|
107
|
+
ask: (question: string, options: ReadonlyArray<string>) => Promise<string>;
|
|
108
|
+
};
|
|
109
|
+
fs: {
|
|
110
|
+
read: (path: string) => Promise<string>;
|
|
111
|
+
write: (path: string, content: string) => Promise<void>;
|
|
112
|
+
exists: (path: string) => Promise<boolean>;
|
|
113
|
+
list: (path: string) => Promise<string[]>;
|
|
114
|
+
};
|
|
115
|
+
process: {
|
|
116
|
+
run: (args: ReadonlyArray<string>) => Promise<ProcessResult>;
|
|
117
|
+
};
|
|
118
|
+
command: {
|
|
119
|
+
register: (cmd: {
|
|
120
|
+
name: string;
|
|
121
|
+
description: string;
|
|
122
|
+
argumentHint?: string;
|
|
123
|
+
}) => Promise<void>;
|
|
124
|
+
};
|
|
125
|
+
session: {
|
|
126
|
+
id: () => Promise<string>;
|
|
127
|
+
cwd: () => Promise<string>;
|
|
128
|
+
};
|
|
129
|
+
clock: {
|
|
130
|
+
now: () => Promise<number>;
|
|
131
|
+
};
|
|
132
|
+
state: {
|
|
133
|
+
get: <T>(ref: StateRef) => Promise<StateRead<T>>;
|
|
134
|
+
set: <T>(ref: StateRef, value: T) => Promise<void>;
|
|
135
|
+
};
|
|
136
|
+
http: {
|
|
137
|
+
fetch: (url: string, init?: unknown) => Promise<unknown>;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export type Handler<N extends EventName> = ($: ModsApi, e: EventOf<N>, next: (e: EventOf<N>) => Promise<unknown> | unknown) => Promise<unknown> | unknown;
|
|
141
|
+
export type StreamHandler<N extends EventName> = ($: ModsApi, e: EventOf<N>, next: (e: EventOf<N>) => AsyncGenerator<unknown, unknown, unknown>) => AsyncGenerator<unknown, unknown, unknown>;
|
|
142
|
+
export interface Matcher {
|
|
143
|
+
tool?: string | ReadonlyArray<string> | RegExp;
|
|
144
|
+
command?: string;
|
|
145
|
+
isReadOnly?: boolean;
|
|
146
|
+
plugin?: string;
|
|
147
|
+
}
|
|
148
|
+
export interface Registration {
|
|
149
|
+
catch: (handler: (error: unknown) => unknown) => void;
|
|
150
|
+
}
|
|
151
|
+
export interface On {
|
|
152
|
+
<N extends EventName>(event: N, handler: Handler<N> | StreamHandler<N>): Registration;
|
|
153
|
+
<N extends EventName>(event: N, matcher: Matcher, handler: Handler<N> | StreamHandler<N>): Registration;
|
|
154
|
+
}
|
|
155
|
+
export interface RegisterFn {
|
|
156
|
+
(on: On, options?: Record<string, unknown>): void;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAmCA,MAAM,WAAW,aAA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4
|
+
// engine declarations (verified November 2026 against
|
|
5
|
+
// @anthropic-ai/claude-code 2.1.329 by probing `claude plugin validate`,
|
|
6
|
+
// whose type checker runs against the engine's own declarations — see
|
|
7
|
+
// plugins/<name>/.claude-plugin/types/claude-code/index.d.ts):
|
|
8
|
+
// - ModsApi ≡ the official EngineInterface (the `$` argument)
|
|
9
|
+
// - *Event ≡ the official *Input (ToolCallEvent ≡ ToolCallInput,
|
|
10
|
+
// AgentSpawnEvent ≡ AgentSpawnInput, ...)
|
|
11
|
+
// - ToolCallResult ≡ the official ToolCallResult<T>
|
|
12
|
+
//
|
|
13
|
+
// These shapes describe what the REAL host passes to a Mod:
|
|
14
|
+
// - tool.call: the tool's arguments are FIELDS of the event
|
|
15
|
+
// (e.command for Bash, e.file_path + e.content for Write, ...);
|
|
16
|
+
// tool.check carries them under e.input (untyped there officially).
|
|
17
|
+
// - turn.step streams: the hook is an async generator delegating with
|
|
18
|
+
// `const result = yield* next(e)`; the result carries the answering
|
|
19
|
+
// model under result.usage.model.
|
|
20
|
+
// - turn.start identifies the turn with e.turnId; turn.complete carries
|
|
21
|
+
// e.answer / e.durationMs / e.usage / e.isAborted / e.agentId.
|
|
22
|
+
// - $.clock.now / $.session.id / $.session.cwd / $.state.get are ASYNC
|
|
23
|
+
// on the official engine; state reads resolve to StateRead<T>, whose
|
|
24
|
+
// `.value` unwraps the stored value. MockRuntime mirrors all of this.
|
|
25
|
+
// - on(...) returns a registration whose .catch(handler) runs when the
|
|
26
|
+
// hook throws or times out (fail-closed error handling).
|
|
27
|
+
//
|
|
28
|
+
// The kit keeps its own export names above (ADR-0014: runtime-independent
|
|
29
|
+
// core); the plugins' hooks import the OFFICIAL names from 'claude-code'
|
|
30
|
+
// instead, vendored per plugin. When deployed in a real Claude Code
|
|
31
|
+
// environment, the engine lays its own declarations at
|
|
32
|
+
// .claude-plugin/types/claude-code/index.d.ts and they are the final
|
|
33
|
+
// authority.
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,sEAAsE;AACtE,sDAAsD;AACtD,yEAAyE;AACzE,sEAAsE;AACtE,+DAA+D;AAC/D,uEAAuE;AACvE,2EAA2E;AAC3E,gEAAgE;AAChE,sDAAsD;AACtD,EAAE;AACF,4DAA4D;AAC5D,8DAA8D;AAC9D,oEAAoE;AACpE,wEAAwE;AACxE,wEAAwE;AACxE,wEAAwE;AACxE,sCAAsC;AACtC,0EAA0E;AAC1E,mEAAmE;AACnE,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,6DAA6D;AAC7D,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,oEAAoE;AACpE,uDAAuD;AACvD,qEAAqE;AACrE,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentic-sdlc-kit/mod-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Mod Development Framework: typed event registration, Mods API surface, MockRuntime for tests, capability manifest, middleware composition. Runtime-independent; does not import claude-code.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./claude-code-shim": {
|
|
16
|
+
"types": "./dist/claude-code-shim.d.ts",
|
|
17
|
+
"import": "./dist/claude-code-shim.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"src"
|
|
23
|
+
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@agentic-sdlc-kit/contracts": "0.8.0",
|
|
26
|
+
"@agentic-sdlc-kit/core": "0.8.0",
|
|
27
|
+
"zod": "^3.23.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.5.0",
|
|
31
|
+
"vitest": "^2.0.0"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p tsconfig.json",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:contract": "vitest run src/**/*.test.ts",
|
|
38
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
39
|
+
}
|
|
6
40
|
}
|