@leitwerk-dev/test-support 0.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/LICENSE +13 -0
- package/dist/chunk-22HCVJEE.js +294 -0
- package/dist/chunk-22HCVJEE.js.map +1 -0
- package/dist/chunk-3MQO3NCX.js +15 -0
- package/dist/chunk-3MQO3NCX.js.map +1 -0
- package/dist/chunk-7ZK5QRGP.js +98 -0
- package/dist/chunk-7ZK5QRGP.js.map +1 -0
- package/dist/chunk-JUH3LUYK.js +28 -0
- package/dist/chunk-JUH3LUYK.js.map +1 -0
- package/dist/chunk-KIDBCGNW.js +84 -0
- package/dist/chunk-KIDBCGNW.js.map +1 -0
- package/dist/chunk-QFCJV2VA.js +600 -0
- package/dist/chunk-QFCJV2VA.js.map +1 -0
- package/dist/chunk-R4KVUGWR.js +83 -0
- package/dist/chunk-R4KVUGWR.js.map +1 -0
- package/dist/compact-process-detail-fixture.d.ts +6 -0
- package/dist/compact-process-detail-fixture.d.ts.map +1 -0
- package/dist/compact-process-detail-fixture.js +73 -0
- package/dist/compact-process-detail-fixture.js.map +1 -0
- package/dist/fakes/fake-git-ops.d.ts +22 -0
- package/dist/fakes/fake-git-ops.d.ts.map +1 -0
- package/dist/fakes/fake-git-ops.js +101 -0
- package/dist/fakes/fake-git-ops.js.map +1 -0
- package/dist/fakes/fake-llm.d.ts +21 -0
- package/dist/fakes/fake-llm.d.ts.map +1 -0
- package/dist/fakes/fake-llm.js +27 -0
- package/dist/fakes/fake-llm.js.map +1 -0
- package/dist/fakes/index.d.ts +3 -0
- package/dist/fakes/index.d.ts.map +1 -0
- package/dist/fakes/index.js +3 -0
- package/dist/fakes/index.js.map +1 -0
- package/dist/fixtures.d.ts +3 -0
- package/dist/fixtures.d.ts.map +1 -0
- package/dist/fixtures.js +3 -0
- package/dist/fixtures.js.map +1 -0
- package/dist/in-process-worker.d.ts +2 -0
- package/dist/in-process-worker.d.ts.map +1 -0
- package/dist/in-process-worker.js +2 -0
- package/dist/in-process-worker.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/integration-harness.d.ts +21 -0
- package/dist/integration-harness.d.ts.map +1 -0
- package/dist/integration-harness.js +38 -0
- package/dist/integration-harness.js.map +1 -0
- package/dist/integration.d.ts +5 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +5 -0
- package/dist/integration.js.map +1 -0
- package/dist/polling.d.ts +2 -0
- package/dist/polling.d.ts.map +1 -0
- package/dist/polling.js +14 -0
- package/dist/polling.js.map +1 -0
- package/dist/question-fixtures.d.ts +4 -0
- package/dist/question-fixtures.d.ts.map +1 -0
- package/dist/question-fixtures.js +26 -0
- package/dist/question-fixtures.js.map +1 -0
- package/dist/server-extension-test-harness.d.ts +31 -0
- package/dist/server-extension-test-harness.d.ts.map +1 -0
- package/dist/server-extension-test-harness.js +167 -0
- package/dist/server-extension-test-harness.js.map +1 -0
- package/dist/stub-worker-entry.d.ts +2 -0
- package/dist/stub-worker-entry.d.ts.map +1 -0
- package/dist/stub-worker-entry.js +10 -0
- package/dist/stub-worker-entry.js.map +1 -0
- package/dist/test-app.d.ts +23 -0
- package/dist/test-app.d.ts.map +1 -0
- package/dist/test-app.js +47 -0
- package/dist/test-app.js.map +1 -0
- package/dist/worker-testing/in-process-worker-spawn.d.ts +15 -0
- package/dist/worker-testing/in-process-worker-spawn.d.ts.map +1 -0
- package/dist/worker-testing/in-process-worker-spawn.js +61 -0
- package/dist/worker-testing/in-process-worker-spawn.js.map +1 -0
- package/dist/worker-testing/index.d.ts +8 -0
- package/dist/worker-testing/index.d.ts.map +1 -0
- package/dist/worker-testing/index.js +8 -0
- package/dist/worker-testing/index.js.map +1 -0
- package/dist/worker-testing/ipc-harness.d.ts +11 -0
- package/dist/worker-testing/ipc-harness.d.ts.map +1 -0
- package/dist/worker-testing/ipc-harness.js +17 -0
- package/dist/worker-testing/ipc-harness.js.map +1 -0
- package/dist/worker-testing/schema-driven-stub-pi.d.ts +8 -0
- package/dist/worker-testing/schema-driven-stub-pi.d.ts.map +1 -0
- package/dist/worker-testing/schema-driven-stub-pi.js +65 -0
- package/dist/worker-testing/schema-driven-stub-pi.js.map +1 -0
- package/dist/worker-testing/stub-pi-controls.d.ts +7 -0
- package/dist/worker-testing/stub-pi-controls.d.ts.map +1 -0
- package/dist/worker-testing/stub-pi-controls.js +10 -0
- package/dist/worker-testing/stub-pi-controls.js.map +1 -0
- package/dist/worker-testing/stub-pi-tree-handle.d.ts +92 -0
- package/dist/worker-testing/stub-pi-tree-handle.d.ts.map +1 -0
- package/dist/worker-testing/stub-pi-tree-handle.js +515 -0
- package/dist/worker-testing/stub-pi-tree-handle.js.map +1 -0
- package/dist/worker-testing/worker-runtime-harness.d.ts +53 -0
- package/dist/worker-testing/worker-runtime-harness.d.ts.map +1 -0
- package/dist/worker-testing/worker-runtime-harness.js +210 -0
- package/dist/worker-testing/worker-runtime-harness.js.map +1 -0
- package/dist/worker-testing/worker-start-payload.d.ts +25 -0
- package/dist/worker-testing/worker-start-payload.d.ts.map +1 -0
- package/dist/worker-testing/worker-start-payload.js +101 -0
- package/dist/worker-testing/worker-start-payload.js.map +1 -0
- package/dist/workspace-source-aliases.d.ts +6 -0
- package/dist/workspace-source-aliases.d.ts.map +1 -0
- package/dist/workspace-source-aliases.js +126 -0
- package/dist/workspace-source-aliases.js.map +1 -0
- package/package.json +66 -0
- package/src/compact-process-detail-fixture.ts +117 -0
- package/src/fakes/fake-git-ops.ts +109 -0
- package/src/fakes/fake-llm.ts +39 -0
- package/src/fakes/index.ts +2 -0
- package/src/fixtures.ts +2 -0
- package/src/in-process-worker.ts +4 -0
- package/src/index.ts +45 -0
- package/src/integration-harness.ts +75 -0
- package/src/integration.ts +14 -0
- package/src/polling.ts +17 -0
- package/src/question-fixtures.ts +32 -0
- package/src/server-extension-test-harness.ts +204 -0
- package/src/stub-worker-entry.ts +11 -0
- package/src/test-app.ts +82 -0
- package/src/worker-testing/in-process-worker-spawn.ts +84 -0
- package/src/worker-testing/index.ts +36 -0
- package/src/worker-testing/ipc-harness.ts +19 -0
- package/src/worker-testing/schema-driven-stub-pi.ts +83 -0
- package/src/worker-testing/stub-pi-controls.ts +16 -0
- package/src/worker-testing/stub-pi-tree-handle.ts +687 -0
- package/src/worker-testing/worker-runtime-harness.ts +280 -0
- package/src/worker-testing/worker-start-payload.ts +135 -0
- package/src/workspace-source-aliases.ts +171 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// src/compact-process-detail-fixture.ts
|
|
2
|
+
import {
|
|
3
|
+
createReadonlyEntryTree
|
|
4
|
+
} from "@leitwerk-dev/protocol";
|
|
5
|
+
import {
|
|
6
|
+
buildProcessUiSnapshotProjections,
|
|
7
|
+
buildTurnTraceIndexFromSession
|
|
8
|
+
} from "@leitwerk-dev/server/testing";
|
|
9
|
+
var EMPTY_TRACE = {
|
|
10
|
+
assistant: { text: "", thinking: "", lastUpdatedAt: null },
|
|
11
|
+
toolCalls: [],
|
|
12
|
+
traceItems: [],
|
|
13
|
+
usage: null,
|
|
14
|
+
piInput: null
|
|
15
|
+
};
|
|
16
|
+
function createCompactProcessDetailFixtureFactory() {
|
|
17
|
+
const reasoningSourceByInstanceId = /* @__PURE__ */ new Map();
|
|
18
|
+
function compact(input) {
|
|
19
|
+
const legacy = input;
|
|
20
|
+
if (!Array.isArray(legacy.turnRecords)) {
|
|
21
|
+
return input;
|
|
22
|
+
}
|
|
23
|
+
const sessionEntries = legacy.piSessionEntries ?? [];
|
|
24
|
+
const entryTree = createReadonlyEntryTree(sessionEntries);
|
|
25
|
+
const sessionTree = {
|
|
26
|
+
...entryTree,
|
|
27
|
+
treeFile: "ui-compact-fixture",
|
|
28
|
+
header: null,
|
|
29
|
+
getTree: () => []
|
|
30
|
+
};
|
|
31
|
+
const traceIndex = buildTurnTraceIndexFromSession({
|
|
32
|
+
tree: sessionTree,
|
|
33
|
+
turnRecords: legacy.turnRecords,
|
|
34
|
+
events: legacy.events
|
|
35
|
+
});
|
|
36
|
+
const signature = sessionEntries.length > 0 ? `test-session:${JSON.stringify(sessionEntries).length}` : null;
|
|
37
|
+
const projections = buildProcessUiSnapshotProjections({
|
|
38
|
+
process: legacy.process,
|
|
39
|
+
turnRecords: legacy.turnRecords,
|
|
40
|
+
turnAnnotations: legacy.turnAnnotations,
|
|
41
|
+
events: legacy.events,
|
|
42
|
+
inputs: legacy.inputs,
|
|
43
|
+
selectedTurn: legacy.selectedTurn ?? null,
|
|
44
|
+
primaryPathSnapshot: legacy.primaryPath,
|
|
45
|
+
sessionTree
|
|
46
|
+
});
|
|
47
|
+
const compactDetail = {
|
|
48
|
+
...projections,
|
|
49
|
+
instanceTree: legacy.instanceTree ?? { currentLeafId: null, nodes: [], edges: [] },
|
|
50
|
+
leafOutcomeSnapshots: legacy.leafOutcomeSnapshots,
|
|
51
|
+
questionRequests: [],
|
|
52
|
+
processDisplayName: legacy.processDisplayName,
|
|
53
|
+
processFlow: legacy.processFlow,
|
|
54
|
+
definesLeafOutcome: legacy.definesLeafOutcome,
|
|
55
|
+
selectedTurn: legacy.selectedTurn ?? null,
|
|
56
|
+
scheduledAction: legacy.scheduledAction ?? null,
|
|
57
|
+
modelConfiguration: legacy.modelConfiguration,
|
|
58
|
+
runDetails: legacy.runDetails,
|
|
59
|
+
launchConfiguration: legacy.launchConfiguration,
|
|
60
|
+
actions: legacy.actions,
|
|
61
|
+
toolRenderers: legacy.toolRenderers,
|
|
62
|
+
persistedModelSelectionWarning: null,
|
|
63
|
+
session: { signature }
|
|
64
|
+
};
|
|
65
|
+
reasoningSourceByInstanceId.set(projections.process.id, { signature, traceIndex });
|
|
66
|
+
return compactDetail;
|
|
67
|
+
}
|
|
68
|
+
function reasoningResponse(instanceId, turnRecordId) {
|
|
69
|
+
const source = reasoningSourceByInstanceId.get(instanceId);
|
|
70
|
+
return {
|
|
71
|
+
instanceId,
|
|
72
|
+
turnRecordId,
|
|
73
|
+
sessionSignature: source?.signature ?? null,
|
|
74
|
+
reasoning: source?.traceIndex[turnRecordId] ?? EMPTY_TRACE
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return { compact, reasoningResponse };
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
createCompactProcessDetailFixtureFactory
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=chunk-R4KVUGWR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/compact-process-detail-fixture.ts"],"sourcesContent":["import type {\n\tProcessEvent,\n\tProcessInput,\n\tProcessInstance,\n\tProcessProject,\n\tProcessTurnAnnotation,\n\tProcessTurnRecord,\n\tWorkerLease,\n} from \"@leitwerk-dev/domain\";\nimport {\n\tcreateReadonlyEntryTree,\n\ttype PiSessionEntry,\n\ttype ProcessDetailUiSnapshotResponseBody,\n\ttype TurnReasoningDetailResponseBody,\n\ttype TurnTraceSnapshot,\n} from \"@leitwerk-dev/protocol\";\nimport {\n\tbuildProcessUiSnapshotProjections,\n\tbuildTurnTraceIndexFromSession,\n\ttype ReadonlyPiSessionTree,\n} from \"@leitwerk-dev/server/testing\";\n\ntype LegacyProcessDetailFixture = ProcessDetailUiSnapshotResponseBody & {\n\tprocess: ProcessInstance;\n\tprojects: ProcessProject[];\n\tinputs: ProcessInput[];\n\tevents: ProcessEvent[];\n\tturnRecords: ProcessTurnRecord[];\n\tturnAnnotations: ProcessTurnAnnotation[];\n\tworkerLease: WorkerLease | null;\n\tpiSessionEntries: PiSessionEntry[];\n};\n\nconst EMPTY_TRACE: TurnTraceSnapshot = {\n\tassistant: { text: \"\", thinking: \"\", lastUpdatedAt: null },\n\ttoolCalls: [],\n\ttraceItems: [],\n\tusage: null,\n\tpiInput: null,\n};\n\nexport function createCompactProcessDetailFixtureFactory() {\n\tconst reasoningSourceByInstanceId = new Map<\n\t\tstring,\n\t\t{\n\t\t\tsignature: string | null;\n\t\t\ttraceIndex: Record<string, TurnTraceSnapshot>;\n\t\t}\n\t>();\n\n\tfunction compact(input: unknown): ProcessDetailUiSnapshotResponseBody {\n\t\tconst legacy = input as LegacyProcessDetailFixture;\n\t\tif (!Array.isArray(legacy.turnRecords)) {\n\t\t\treturn input as ProcessDetailUiSnapshotResponseBody;\n\t\t}\n\t\tconst sessionEntries = legacy.piSessionEntries ?? [];\n\t\tconst entryTree = createReadonlyEntryTree(sessionEntries);\n\t\tconst sessionTree = {\n\t\t\t...entryTree,\n\t\t\ttreeFile: \"ui-compact-fixture\",\n\t\t\theader: null,\n\t\t\tgetTree: () => [],\n\t\t} as unknown as ReadonlyPiSessionTree;\n\t\tconst traceIndex = buildTurnTraceIndexFromSession({\n\t\t\ttree: sessionTree,\n\t\t\tturnRecords: legacy.turnRecords,\n\t\t\tevents: legacy.events,\n\t\t});\n\t\tconst signature =\n\t\t\tsessionEntries.length > 0 ? `test-session:${JSON.stringify(sessionEntries).length}` : null;\n\t\tconst projections = buildProcessUiSnapshotProjections({\n\t\t\tprocess: legacy.process,\n\t\t\tturnRecords: legacy.turnRecords,\n\t\t\tturnAnnotations: legacy.turnAnnotations,\n\t\t\tevents: legacy.events,\n\t\t\tinputs: legacy.inputs,\n\t\t\tselectedTurn: legacy.selectedTurn ?? null,\n\t\t\tprimaryPathSnapshot: legacy.primaryPath,\n\t\t\tsessionTree,\n\t\t});\n\t\tconst compactDetail: ProcessDetailUiSnapshotResponseBody = {\n\t\t\t...projections,\n\t\t\tinstanceTree: legacy.instanceTree ?? { currentLeafId: null, nodes: [], edges: [] },\n\t\t\tleafOutcomeSnapshots: legacy.leafOutcomeSnapshots,\n\t\t\tquestionRequests: [],\n\t\t\tprocessDisplayName: legacy.processDisplayName,\n\t\t\tprocessFlow: legacy.processFlow,\n\t\t\tdefinesLeafOutcome: legacy.definesLeafOutcome,\n\t\t\tselectedTurn: legacy.selectedTurn ?? null,\n\t\t\tscheduledAction: legacy.scheduledAction ?? null,\n\t\t\tmodelConfiguration: legacy.modelConfiguration,\n\t\t\trunDetails: legacy.runDetails,\n\t\t\tlaunchConfiguration: legacy.launchConfiguration,\n\t\t\tactions: legacy.actions,\n\t\t\ttoolRenderers: legacy.toolRenderers,\n\t\t\tpersistedModelSelectionWarning: null,\n\t\t\tsession: { signature },\n\t\t};\n\t\treasoningSourceByInstanceId.set(projections.process.id, { signature, traceIndex });\n\t\treturn compactDetail;\n\t}\n\n\tfunction reasoningResponse(\n\t\tinstanceId: string,\n\t\tturnRecordId: string,\n\t): TurnReasoningDetailResponseBody {\n\t\tconst source = reasoningSourceByInstanceId.get(instanceId);\n\t\treturn {\n\t\t\tinstanceId,\n\t\t\tturnRecordId,\n\t\t\tsessionSignature: source?.signature ?? null,\n\t\t\treasoning: source?.traceIndex[turnRecordId] ?? EMPTY_TRACE,\n\t\t};\n\t}\n\n\treturn { compact, reasoningResponse };\n}\n"],"mappings":";AASA;AAAA,EACC;AAAA,OAKM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AAaP,IAAM,cAAiC;AAAA,EACtC,WAAW,EAAE,MAAM,IAAI,UAAU,IAAI,eAAe,KAAK;AAAA,EACzD,WAAW,CAAC;AAAA,EACZ,YAAY,CAAC;AAAA,EACb,OAAO;AAAA,EACP,SAAS;AACV;AAEO,SAAS,2CAA2C;AAC1D,QAAM,8BAA8B,oBAAI,IAMtC;AAEF,WAAS,QAAQ,OAAqD;AACrE,UAAM,SAAS;AACf,QAAI,CAAC,MAAM,QAAQ,OAAO,WAAW,GAAG;AACvC,aAAO;AAAA,IACR;AACA,UAAM,iBAAiB,OAAO,oBAAoB,CAAC;AACnD,UAAM,YAAY,wBAAwB,cAAc;AACxD,UAAM,cAAc;AAAA,MACnB,GAAG;AAAA,MACH,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,SAAS,MAAM,CAAC;AAAA,IACjB;AACA,UAAM,aAAa,+BAA+B;AAAA,MACjD,MAAM;AAAA,MACN,aAAa,OAAO;AAA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
|
1
|
+
import { type ProcessDetailUiSnapshotResponseBody, type TurnReasoningDetailResponseBody } from "@leitwerk-dev/protocol";
|
|
2
|
+
export declare function createCompactProcessDetailFixtureFactory(): {
|
|
3
|
+
compact: (input: unknown) => ProcessDetailUiSnapshotResponseBody;
|
|
4
|
+
reasoningResponse: (instanceId: string, turnRecordId: string) => TurnReasoningDetailResponseBody;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=compact-process-detail-fixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact-process-detail-fixture.d.ts","sourceRoot":"","sources":["../src/compact-process-detail-fixture.ts"],"names":[],"mappings":"AASA,OAAO,EAGN,KAAK,mCAAmC,EACxC,KAAK,+BAA+B,EAEpC,MAAM,wBAAwB,CAAC;AA0BhC,wBAAgB,wCAAwC;qBAS/B,OAAO,KAAG,mCAAmC;oCAqDxD,MAAM,gBACJ,MAAM,KAClB,+BAA+B;EAWlC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createReadonlyEntryTree, } from "@leitwerk-dev/protocol";
|
|
2
|
+
import { buildProcessUiSnapshotProjections, buildTurnTraceIndexFromSession, } from "@leitwerk-dev/server/testing";
|
|
3
|
+
const EMPTY_TRACE = {
|
|
4
|
+
assistant: { text: "", thinking: "", lastUpdatedAt: null },
|
|
5
|
+
toolCalls: [],
|
|
6
|
+
traceItems: [],
|
|
7
|
+
usage: null,
|
|
8
|
+
piInput: null,
|
|
9
|
+
};
|
|
10
|
+
export function createCompactProcessDetailFixtureFactory() {
|
|
11
|
+
const reasoningSourceByInstanceId = new Map();
|
|
12
|
+
function compact(input) {
|
|
13
|
+
const legacy = input;
|
|
14
|
+
if (!Array.isArray(legacy.turnRecords)) {
|
|
15
|
+
return input;
|
|
16
|
+
}
|
|
17
|
+
const sessionEntries = legacy.piSessionEntries ?? [];
|
|
18
|
+
const entryTree = createReadonlyEntryTree(sessionEntries);
|
|
19
|
+
const sessionTree = {
|
|
20
|
+
...entryTree,
|
|
21
|
+
treeFile: "ui-compact-fixture",
|
|
22
|
+
header: null,
|
|
23
|
+
getTree: () => [],
|
|
24
|
+
};
|
|
25
|
+
const traceIndex = buildTurnTraceIndexFromSession({
|
|
26
|
+
tree: sessionTree,
|
|
27
|
+
turnRecords: legacy.turnRecords,
|
|
28
|
+
events: legacy.events,
|
|
29
|
+
});
|
|
30
|
+
const signature = sessionEntries.length > 0 ? `test-session:${JSON.stringify(sessionEntries).length}` : null;
|
|
31
|
+
const projections = buildProcessUiSnapshotProjections({
|
|
32
|
+
process: legacy.process,
|
|
33
|
+
turnRecords: legacy.turnRecords,
|
|
34
|
+
turnAnnotations: legacy.turnAnnotations,
|
|
35
|
+
events: legacy.events,
|
|
36
|
+
inputs: legacy.inputs,
|
|
37
|
+
selectedTurn: legacy.selectedTurn ?? null,
|
|
38
|
+
primaryPathSnapshot: legacy.primaryPath,
|
|
39
|
+
sessionTree,
|
|
40
|
+
});
|
|
41
|
+
const compactDetail = {
|
|
42
|
+
...projections,
|
|
43
|
+
instanceTree: legacy.instanceTree ?? { currentLeafId: null, nodes: [], edges: [] },
|
|
44
|
+
leafOutcomeSnapshots: legacy.leafOutcomeSnapshots,
|
|
45
|
+
questionRequests: [],
|
|
46
|
+
processDisplayName: legacy.processDisplayName,
|
|
47
|
+
processFlow: legacy.processFlow,
|
|
48
|
+
definesLeafOutcome: legacy.definesLeafOutcome,
|
|
49
|
+
selectedTurn: legacy.selectedTurn ?? null,
|
|
50
|
+
scheduledAction: legacy.scheduledAction ?? null,
|
|
51
|
+
modelConfiguration: legacy.modelConfiguration,
|
|
52
|
+
runDetails: legacy.runDetails,
|
|
53
|
+
launchConfiguration: legacy.launchConfiguration,
|
|
54
|
+
actions: legacy.actions,
|
|
55
|
+
toolRenderers: legacy.toolRenderers,
|
|
56
|
+
persistedModelSelectionWarning: null,
|
|
57
|
+
session: { signature },
|
|
58
|
+
};
|
|
59
|
+
reasoningSourceByInstanceId.set(projections.process.id, { signature, traceIndex });
|
|
60
|
+
return compactDetail;
|
|
61
|
+
}
|
|
62
|
+
function reasoningResponse(instanceId, turnRecordId) {
|
|
63
|
+
const source = reasoningSourceByInstanceId.get(instanceId);
|
|
64
|
+
return {
|
|
65
|
+
instanceId,
|
|
66
|
+
turnRecordId,
|
|
67
|
+
sessionSignature: source?.signature ?? null,
|
|
68
|
+
reasoning: source?.traceIndex[turnRecordId] ?? EMPTY_TRACE,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return { compact, reasoningResponse };
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=compact-process-detail-fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact-process-detail-fixture.js","sourceRoot":"","sources":["../src/compact-process-detail-fixture.ts"],"names":[],"mappings":"AASA,OAAO,EACN,uBAAuB,GAKvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,iCAAiC,EACjC,8BAA8B,GAE9B,MAAM,8BAA8B,CAAC;AAatC,MAAM,WAAW,GAAsB;IACtC,SAAS,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE;IAC1D,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,IAAI;CACb,CAAC;AAEF,MAAM,UAAU,wCAAwC;IACvD,MAAM,2BAA2B,GAAG,IAAI,GAAG,EAMxC,CAAC;IAEJ,SAAS,OAAO,CAAC,KAAc;QAC9B,MAAM,MAAM,GAAG,KAAmC,CAAC;QACnD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;YACxC,OAAO,KAA4C,CAAC;QACrD,CAAC;QACD,MAAM,cAAc,GAAG,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC;QACrD,MAAM,SAAS,GAAG,uBAAuB,CAAC,cAAc,CAAC,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,CAAC,eAAe,IAAI,IAAI;YAC/C,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,8BAA8B,EAAE,IAAI;YACpC,OAAO,EAAE,EAAE,SAAS,EAAE;SACtB,CAAC;QACF,2BAA2B,CAAC,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,CAAC;QACnF,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,SAAS,iBAAiB,CACzB,UAAkB,EAClB,YAAoB;QAEpB,MAAM,MAAM,GAAG,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC3D,OAAO;YACN,UAAU;YACV,YAAY;YACZ,gBAAgB,EAAE,MAAM,EAAE,SAAS,IAAI,IAAI;YAC3C,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,WAAW;SAC1D,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type RepoTemplate = Record<string, string>;
|
|
2
|
+
/**
|
|
3
|
+
* Structurally compatible with RunRootGitOps — call sites annotate
|
|
4
|
+
* `const git: RunRootGitOps = new FakeGitOps(...)` so TS catches drift.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FakeGitOps {
|
|
7
|
+
private readonly templates;
|
|
8
|
+
readonly operations: string[];
|
|
9
|
+
private readonly files;
|
|
10
|
+
private readonly repoState;
|
|
11
|
+
constructor(templates: Map<string, RepoTemplate>);
|
|
12
|
+
private abs;
|
|
13
|
+
writeFile(repoDir: string, filePath: string, content: string): Promise<void>;
|
|
14
|
+
readFile(repoDir: string, filePath: string): Promise<string | null>;
|
|
15
|
+
clone(repoLocator: string, targetDir: string): Promise<void>;
|
|
16
|
+
checkout(repoDir: string, branch: string): Promise<void>;
|
|
17
|
+
createBranch(repoDir: string, branchName: string, _startPoint: string): Promise<void>;
|
|
18
|
+
branchExists(repoDir: string, branchName: string): Promise<boolean>;
|
|
19
|
+
getHeadSha(repoDir: string): Promise<string>;
|
|
20
|
+
listFiles(repoDir: string, pattern: string): Promise<string[]>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=fake-git-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-git-ops.d.ts","sourceRoot":"","sources":["../../src/fakes/fake-git-ops.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAElD;;;GAGG;AACH,qBAAa,UAAU;IAKV,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJtC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAM;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAuE;gBAEpE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC;IAEjE,OAAO,CAAC,GAAG;IAIL,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5E,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAInE,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB5D,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASxD,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrF,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnE,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW5C,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAyBpE"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
/**
|
|
3
|
+
* Structurally compatible with RunRootGitOps — call sites annotate
|
|
4
|
+
* `const git: RunRootGitOps = new FakeGitOps(...)` so TS catches drift.
|
|
5
|
+
*/
|
|
6
|
+
export class FakeGitOps {
|
|
7
|
+
templates;
|
|
8
|
+
operations = [];
|
|
9
|
+
files = new Map();
|
|
10
|
+
repoState = new Map();
|
|
11
|
+
constructor(templates) {
|
|
12
|
+
this.templates = templates;
|
|
13
|
+
}
|
|
14
|
+
abs(repoDir, filePath) {
|
|
15
|
+
return path.normalize(path.join(repoDir, filePath));
|
|
16
|
+
}
|
|
17
|
+
async writeFile(repoDir, filePath, content) {
|
|
18
|
+
this.operations.push(`writeFile:${filePath}`);
|
|
19
|
+
this.files.set(this.abs(repoDir, filePath), content);
|
|
20
|
+
}
|
|
21
|
+
async readFile(repoDir, filePath) {
|
|
22
|
+
return this.files.get(this.abs(repoDir, filePath)) ?? null;
|
|
23
|
+
}
|
|
24
|
+
async clone(repoLocator, targetDir) {
|
|
25
|
+
this.operations.push(`clone:${path.basename(targetDir)}`);
|
|
26
|
+
const n = path.normalize(targetDir);
|
|
27
|
+
const prefix = n + path.sep;
|
|
28
|
+
for (const k of [...this.files.keys()]) {
|
|
29
|
+
if (k === n || k.startsWith(prefix)) {
|
|
30
|
+
this.files.delete(k);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const tmpl = this.templates.get(repoLocator);
|
|
34
|
+
if (!tmpl) {
|
|
35
|
+
throw new Error(`unknown repo ${repoLocator}`);
|
|
36
|
+
}
|
|
37
|
+
for (const [rel, content] of Object.entries(tmpl)) {
|
|
38
|
+
this.files.set(path.join(targetDir, rel), content);
|
|
39
|
+
}
|
|
40
|
+
this.repoState.set(n, {
|
|
41
|
+
currentBranch: "main",
|
|
42
|
+
branches: new Set(["main"]),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async checkout(repoDir, branch) {
|
|
46
|
+
const st = this.repoState.get(path.normalize(repoDir));
|
|
47
|
+
if (!st) {
|
|
48
|
+
throw new Error("not a repo");
|
|
49
|
+
}
|
|
50
|
+
st.branches.add(branch);
|
|
51
|
+
st.currentBranch = branch;
|
|
52
|
+
}
|
|
53
|
+
async createBranch(repoDir, branchName, _startPoint) {
|
|
54
|
+
const st = this.repoState.get(path.normalize(repoDir));
|
|
55
|
+
if (!st) {
|
|
56
|
+
throw new Error("not a repo");
|
|
57
|
+
}
|
|
58
|
+
st.branches.add(branchName);
|
|
59
|
+
}
|
|
60
|
+
async branchExists(repoDir, branchName) {
|
|
61
|
+
const st = this.repoState.get(path.normalize(repoDir));
|
|
62
|
+
return st?.branches.has(branchName) ?? false;
|
|
63
|
+
}
|
|
64
|
+
async getHeadSha(repoDir) {
|
|
65
|
+
const st = this.repoState.get(path.normalize(repoDir));
|
|
66
|
+
if (!st) {
|
|
67
|
+
throw new Error("not a repo");
|
|
68
|
+
}
|
|
69
|
+
return Buffer.from(`${repoDir}:${st.currentBranch}`)
|
|
70
|
+
.toString("hex")
|
|
71
|
+
.slice(0, 40)
|
|
72
|
+
.padEnd(40, "0");
|
|
73
|
+
}
|
|
74
|
+
async listFiles(repoDir, pattern) {
|
|
75
|
+
const normRoot = path.normalize(repoDir);
|
|
76
|
+
const prefix = normRoot + path.sep;
|
|
77
|
+
const out = [];
|
|
78
|
+
for (const k of this.files.keys()) {
|
|
79
|
+
if (k !== normRoot && !k.startsWith(prefix)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const rel = k === normRoot ? "" : k.slice(prefix.length);
|
|
83
|
+
if (!rel) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const relPosix = rel.split(path.sep).join("/");
|
|
87
|
+
if (pattern === "**/AGENTS.md") {
|
|
88
|
+
if (relPosix.endsWith("AGENTS.md")) {
|
|
89
|
+
out.push(relPosix);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (pattern === "**/.cursor/skills/**/SKILL.md") {
|
|
93
|
+
if (/^\.cursor\/skills\/[^/]+\/SKILL\.md$/.test(relPosix)) {
|
|
94
|
+
out.push(relPosix);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return out.sort((a, b) => a.localeCompare(b));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=fake-git-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-git-ops.js","sourceRoot":"","sources":["../../src/fakes/fake-git-ops.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B;;;GAGG;AACH,MAAM,OAAO,UAAU;IAKO;IAJpB,UAAU,GAAa,EAAE,CAAC;IAClB,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAClC,SAAS,GAAG,IAAI,GAAG,EAA4D,CAAC;IAEjG,YAA6B,SAAoC;QAApC,cAAS,GAAT,SAAS,CAA2B;IAAG,CAAC;IAE7D,GAAG,CAAC,OAAe,EAAE,QAAgB;QAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,QAAgB,EA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AC;gBAChC,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;oBACpC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC;YACF,CAAC;iBAAM,IAAI,OAAO,KAAK,+BAA+B,EAAE,CAAC;gBACxD,IAAI,sCAAsC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC3D,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/C,CAAC;CACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface LlmResponse {
|
|
2
|
+
content: string;
|
|
3
|
+
toolCalls?: Array<{
|
|
4
|
+
name: string;
|
|
5
|
+
arguments: Record<string, unknown>;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
export type LlmHandler = (prompt: string) => LlmResponse;
|
|
9
|
+
/**
|
|
10
|
+
* Deterministic in-memory LLM fake for automated system tests.
|
|
11
|
+
* Responds with scripted outputs based on registered handlers.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FakeLlmProvider {
|
|
14
|
+
private handlers;
|
|
15
|
+
private callIndex;
|
|
16
|
+
readonly calls: string[];
|
|
17
|
+
onPrompt(handler: LlmHandler): void;
|
|
18
|
+
respond(prompt: string): LlmResponse;
|
|
19
|
+
reset(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=fake-llm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-llm.d.ts","sourceRoot":"","sources":["../../src/fakes/fake-llm.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,CAAC,CAAC;CACH;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,WAAW,CAAC;AAEzD;;;GAGG;AACH,qBAAa,eAAe;IAC3B,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,SAAS,CAAK;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAM;IAE9B,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IAInC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAUpC,KAAK,IAAI,IAAI;CAKb"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic in-memory LLM fake for automated system tests.
|
|
3
|
+
* Responds with scripted outputs based on registered handlers.
|
|
4
|
+
*/
|
|
5
|
+
export class FakeLlmProvider {
|
|
6
|
+
handlers = [];
|
|
7
|
+
callIndex = 0;
|
|
8
|
+
calls = [];
|
|
9
|
+
onPrompt(handler) {
|
|
10
|
+
this.handlers.push(handler);
|
|
11
|
+
}
|
|
12
|
+
respond(prompt) {
|
|
13
|
+
this.calls.push(prompt);
|
|
14
|
+
const handler = this.handlers[this.callIndex % this.handlers.length];
|
|
15
|
+
if (handler) {
|
|
16
|
+
this.callIndex++;
|
|
17
|
+
return handler(prompt);
|
|
18
|
+
}
|
|
19
|
+
return { content: "No handler registered for this prompt." };
|
|
20
|
+
}
|
|
21
|
+
reset() {
|
|
22
|
+
this.handlers = [];
|
|
23
|
+
this.callIndex = 0;
|
|
24
|
+
this.calls.length = 0;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=fake-llm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-llm.js","sourceRoot":"","sources":["../../src/fakes/fake-llm.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,OAAO,eAAe;IACnB,QAAQ,GAAiB,EAAE,CAAC;IAC5B,SAAS,GAAG,CAAC,CAAC;IACb,KAAK,GAAa,EAAE,CAAC;IAE9B,QAAQ,CAAC,OAAmB;QAC3B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,MAAc;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrE,IAAI,OAAO,EAAE,CAAC;YACb,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,wCAAwC,EAAE,CAAC;IAC9D,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IACvB,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fakes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fakes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAqB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAoB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/fixtures.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-process-worker.d.ts","sourceRoot":"","sources":["../src/in-process-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,0BAA0B,EAC1B,KAAK,2BAA2B,GAChC,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-process-worker.js","sourceRoot":"","sources":["../src/in-process-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,0BAA0B,GAE1B,MAAM,6CAA6C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { createCompactProcessDetailFixtureFactory } from "./compact-process-detail-fixture.js";
|
|
2
|
+
export { FakeGitOps, type RepoTemplate } from "./fakes/fake-git-ops.js";
|
|
3
|
+
export { FakeLlmProvider, type LlmResponse } from "./fakes/fake-llm.js";
|
|
4
|
+
export { createInProcessWorkerSpawn, type InProcessWorkerSpawnOptions, } from "./in-process-worker.js";
|
|
5
|
+
export { createIntegrationHarness, type IntegrationHarness, type IntegrationHarnessOptions, } from "./integration-harness.js";
|
|
6
|
+
export { waitForValue } from "./polling.js";
|
|
7
|
+
export { createInMemoryExternalWriteLog, createTestServerSetupCapability, type InMemoryExternalWriteLog, type ServerExtensionTestHarness, setupServerExtensionTest, } from "./server-extension-test-harness.js";
|
|
8
|
+
export { createTestApp, type TestApp, type TestAppOptions } from "./test-app.js";
|
|
9
|
+
export { baseEnvelope, flushAsyncWork, testConfigSnapshot, } from "./worker-testing/ipc-harness.js";
|
|
10
|
+
export { createSchemaDrivenStubPiFactory, createSchemaDrivenToolCallScriptResolver, synthesizeStubArgValue, synthesizeStubToolArgs, } from "./worker-testing/schema-driven-stub-pi.js";
|
|
11
|
+
export { createStubToolScriptController, type StubToolScriptController, } from "./worker-testing/stub-pi-controls.js";
|
|
12
|
+
export { StubPiTreeHandle, StubPiTreeHandleFactory, type StubPiTreeHandleFactoryOptions, type StubToolCallScriptCall, type StubToolCallScriptItem, type StubToolCallScriptResolver, type StubToolCallScriptResolverContext, } from "./worker-testing/stub-pi-tree-handle.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EACN,0BAA0B,EAC1B,KAAK,2BAA2B,GAChC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,wBAAwB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,+BAA+B,EAC/B,wCAAwC,EACxC,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,8BAA8B,EAC9B,KAAK,wBAAwB,GAC7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAC/B,KAAK,iCAAiC,GACtC,MAAM,yCAAyC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { createCompactProcessDetailFixtureFactory } from "./compact-process-detail-fixture.js";
|
|
2
|
+
export { FakeGitOps } from "./fakes/fake-git-ops.js";
|
|
3
|
+
export { FakeLlmProvider } from "./fakes/fake-llm.js";
|
|
4
|
+
export { createInProcessWorkerSpawn, } from "./in-process-worker.js";
|
|
5
|
+
export { createIntegrationHarness, } from "./integration-harness.js";
|
|
6
|
+
export { waitForValue } from "./polling.js";
|
|
7
|
+
export { createInMemoryExternalWriteLog, createTestServerSetupCapability, setupServerExtensionTest, } from "./server-extension-test-harness.js";
|
|
8
|
+
export { createTestApp } from "./test-app.js";
|
|
9
|
+
export { baseEnvelope, flushAsyncWork, testConfigSnapshot, } from "./worker-testing/ipc-harness.js";
|
|
10
|
+
export { createSchemaDrivenStubPiFactory, createSchemaDrivenToolCallScriptResolver, synthesizeStubArgValue, synthesizeStubToolArgs, } from "./worker-testing/schema-driven-stub-pi.js";
|
|
11
|
+
export { createStubToolScriptController, } from "./worker-testing/stub-pi-controls.js";
|
|
12
|
+
export { StubPiTreeHandle, StubPiTreeHandleFactory, } from "./worker-testing/stub-pi-tree-handle.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,qCAAqC,CAAC;AAC/F,OAAO,EAAE,UAAU,EAAqB,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAoB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EACN,0BAA0B,GAE1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,wBAAwB,GAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,EAG/B,wBAAwB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAqC,MAAM,eAAe,CAAC;AACjF,OAAO,EACN,YAAY,EACZ,cAAc,EACd,kBAAkB,GAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,+BAA+B,EAC/B,wCAAwC,EACxC,sBAAsB,EACtB,sBAAsB,GACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACN,8BAA8B,GAE9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,gBAAgB,EAChB,uBAAuB,GAMvB,MAAM,yCAAyC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ExtensionCatalog } from "@leitwerk-dev/extension-runtime";
|
|
2
|
+
import type { ProvidedCapability } from "@leitwerk-dev/process-sdk";
|
|
3
|
+
import { type AppContext, type AppOptions, type LeitwerkConfig } from "@leitwerk-dev/server";
|
|
4
|
+
export interface IntegrationHarness<TResources extends Record<string, unknown> = Record<string, never>> {
|
|
5
|
+
ctx: AppContext;
|
|
6
|
+
config: LeitwerkConfig;
|
|
7
|
+
address: string;
|
|
8
|
+
resources: TResources;
|
|
9
|
+
}
|
|
10
|
+
export interface IntegrationHarnessOptions<TResources extends Record<string, unknown> = Record<string, never>> {
|
|
11
|
+
config?: LeitwerkConfig;
|
|
12
|
+
configOverride?: (config: LeitwerkConfig) => void;
|
|
13
|
+
appOverrides?: Partial<AppOptions>;
|
|
14
|
+
listen?: boolean;
|
|
15
|
+
inProcessWorkers?: boolean;
|
|
16
|
+
extensionCatalog: ExtensionCatalog | Promise<ExtensionCatalog>;
|
|
17
|
+
preProvidedCapabilities?: readonly ProvidedCapability[];
|
|
18
|
+
resources?: TResources;
|
|
19
|
+
}
|
|
20
|
+
export declare function createIntegrationHarness<TResources extends Record<string, unknown> = Record<string, never>>(opts: IntegrationHarnessOptions<TResources>): Promise<IntegrationHarness<TResources>>;
|
|
21
|
+
//# sourceMappingURL=integration-harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-harness.d.ts","sourceRoot":"","sources":["../src/integration-harness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACN,KAAK,UAAU,EACf,KAAK,UAAU,EAGf,KAAK,cAAc,EACnB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,kBAAkB,CAClC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAElE,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,WAAW,yBAAyB,CACzC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAElE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC/D,uBAAuB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxD,SAAS,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,wBAAsB,wBAAwB,CAC7C,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACjE,IAAI,EAAE,yBAAyB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAuCtF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createAppContext, getDefaultConfig, } from "@leitwerk-dev/server";
|
|
2
|
+
import { createInProcessWorkerSpawn } from "./in-process-worker.js";
|
|
3
|
+
export async function createIntegrationHarness(opts) {
|
|
4
|
+
const config = opts.config ?? getDefaultConfig();
|
|
5
|
+
if (!opts.appOverrides?.workerRunnerRuntime) {
|
|
6
|
+
config.workers.runner = "local";
|
|
7
|
+
}
|
|
8
|
+
opts.configOverride?.(config);
|
|
9
|
+
const extensionCatalog = await Promise.resolve(opts.extensionCatalog);
|
|
10
|
+
const appOpts = {
|
|
11
|
+
logger: false,
|
|
12
|
+
config,
|
|
13
|
+
extensionCatalog,
|
|
14
|
+
preProvidedCapabilities: opts.preProvidedCapabilities,
|
|
15
|
+
...opts.appOverrides,
|
|
16
|
+
};
|
|
17
|
+
if (opts.inProcessWorkers !== false && !appOpts.localWorkerSpawnImpl) {
|
|
18
|
+
appOpts.localWorkerSpawnImpl = createInProcessWorkerSpawn({
|
|
19
|
+
extensionCatalog,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const ctx = await createAppContext(appOpts);
|
|
23
|
+
let address = "";
|
|
24
|
+
if (opts.listen !== false || config.workers.runner === "local") {
|
|
25
|
+
await ctx.app.listen({ host: "127.0.0.1", port: 0 });
|
|
26
|
+
const info = ctx.app.server.address();
|
|
27
|
+
const port = typeof info === "object" && info ? info.port : 0;
|
|
28
|
+
address = `http://127.0.0.1:${port}`;
|
|
29
|
+
ctx.config.server.base_url = address;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
ctx,
|
|
33
|
+
config,
|
|
34
|
+
address,
|
|
35
|
+
resources: opts.resources ?? {},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=integration-harness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-harness.js","sourceRoot":"","sources":["../src/integration-harness.ts"],"names":[],"mappings":"AAEA,OAAO,EAGN,gBAAgB,EAChB,gBAAgB,GAEhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAwBpE,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAE5C,IAA2C;IAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,gBAAgB,EAAE,CAAC;IACjD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,mBAAmB,EAAE,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC;IACjC,CAAC;IACD,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC;IAE9B,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAEtE,MAAM,OAAO,GAAe;QAC3B,MAAM,EAAE,KAAK;QACb,MAAM;QACN,gBAAgB;QAChB,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;QACrD,GAAG,IAAI,CAAC,YAAY;KACpB,CAAC;IAEF,IAAI,IAAI,CAAC,gBAAgB,KAAK,KAAK,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACtE,OAAO,CAAC,oBAAoB,GAAG,0BAA0B,CAAC;YACzD,gBAAgB;SAChB,CAAC,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAE5C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAChE,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QACrD,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,OAAO,GAAG,oBAAoB,IAAI,EAAE,CAAC;QACrC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;IACtC,CAAC;IAED,OAAO;QACN,GAAG;QACH,MAAM;QACN,OAAO;QACP,SAAS,EAAE,IAAI,CAAC,SAAS,IAAK,EAAiB;KAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createIntegrationHarness, type IntegrationHarness, type IntegrationHarnessOptions, } from "./integration-harness.js";
|
|
2
|
+
export { waitForValue } from "./polling.js";
|
|
3
|
+
export { createInMemoryExternalWriteLog, createTestServerSetupCapability, type InMemoryExternalWriteLog, type ServerExtensionTestHarness, setupServerExtensionTest, } from "./server-extension-test-harness.js";
|
|
4
|
+
export { createTestApp, type TestApp, type TestAppOptions } from "./test-app.js";
|
|
5
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,wBAAwB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { createIntegrationHarness, } from "./integration-harness.js";
|
|
2
|
+
export { waitForValue } from "./polling.js";
|
|
3
|
+
export { createInMemoryExternalWriteLog, createTestServerSetupCapability, setupServerExtensionTest, } from "./server-extension-test-harness.js";
|
|
4
|
+
export { createTestApp } from "./test-app.js";
|
|
5
|
+
//# sourceMappingURL=integration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.js","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,GAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,EAG/B,wBAAwB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAqC,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling.d.ts","sourceRoot":"","sources":["../src/polling.ts"],"names":[],"mappings":"AAAA,wBAAsB,YAAY,CAAC,CAAC,EACnC,IAAI,EAAE,MAAM,CAAC,EACb,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,EAChC,SAAS,SAAQ,GACf,OAAO,CAAC,CAAC,CAAC,CAYZ"}
|
package/dist/polling.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export async function waitForValue(read, predicate, timeoutMs = 5_000) {
|
|
2
|
+
const deadline = Date.now() + timeoutMs;
|
|
3
|
+
while (true) {
|
|
4
|
+
const value = read();
|
|
5
|
+
if (predicate(value)) {
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
if (Date.now() >= deadline) {
|
|
9
|
+
throw new Error("Timed out waiting for value");
|
|
10
|
+
}
|
|
11
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=polling.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling.js","sourceRoot":"","sources":["../src/polling.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,IAAa,EACb,SAAgC,EAChC,SAAS,GAAG,KAAK;IAEjB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;IACxC,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;QACrB,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC;QACd,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,EAAE,IAAI,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAChD,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IACzD,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NormalizedQuestion, ProcessQuestionRequest } from "@leitwerk-dev/domain";
|
|
2
|
+
export declare function createTestQuestion(overrides?: Partial<NormalizedQuestion>): NormalizedQuestion;
|
|
3
|
+
export declare function createTestQuestionRequest(overrides?: Partial<ProcessQuestionRequest>): ProcessQuestionRequest;
|
|
4
|
+
//# sourceMappingURL=question-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"question-fixtures.d.ts","sourceRoot":"","sources":["../src/question-fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,wBAAgB,kBAAkB,CACjC,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GACzC,kBAAkB,CAQpB;AAED,wBAAgB,yBAAyB,CACxC,SAAS,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC7C,sBAAsB,CAexB"}
|