@leitwerk-dev/test-support 0.1.9 → 0.2.1

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.
Files changed (143) hide show
  1. package/dist/{chunk-KIDBCGNW.js → chunk-2PCDTYVH.js} +26 -26
  2. package/dist/chunk-2PCDTYVH.js.map +1 -0
  3. package/dist/chunk-5BZSJ4OO.js +192 -0
  4. package/dist/chunk-5BZSJ4OO.js.map +1 -0
  5. package/dist/{chunk-QFCJV2VA.js → chunk-ECAWLVYB.js} +224 -17
  6. package/dist/chunk-ECAWLVYB.js.map +1 -0
  7. package/dist/{chunk-JUH3LUYK.js → chunk-EXHTWQAE.js} +5 -1
  8. package/dist/chunk-EXHTWQAE.js.map +1 -0
  9. package/dist/compact-process-detail-fixture.d.ts +3 -0
  10. package/dist/compact-process-detail-fixture.d.ts.map +1 -1
  11. package/dist/fakes/fake-git-ops.d.ts +12 -0
  12. package/dist/fakes/fake-git-ops.d.ts.map +1 -1
  13. package/dist/fakes/fake-llm.d.ts +11 -0
  14. package/dist/fakes/fake-llm.d.ts.map +1 -1
  15. package/dist/fakes/index.d.ts +1 -1
  16. package/dist/fakes/index.d.ts.map +1 -1
  17. package/dist/fakes/index.js +111 -2
  18. package/dist/fakes/index.js.map +1 -1
  19. package/dist/fixtures.js +137 -2
  20. package/dist/fixtures.js.map +1 -1
  21. package/dist/http-launch.d.ts +9 -0
  22. package/dist/http-launch.d.ts.map +1 -0
  23. package/dist/index.d.ts +24 -12
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +113 -12
  26. package/dist/index.js.map +1 -1
  27. package/dist/integration-harness.d.ts +36 -1
  28. package/dist/integration-harness.d.ts.map +1 -1
  29. package/dist/integration.d.ts +3 -3
  30. package/dist/integration.d.ts.map +1 -1
  31. package/dist/integration.js +184 -4
  32. package/dist/integration.js.map +1 -1
  33. package/dist/local-git.d.ts +231 -0
  34. package/dist/local-git.d.ts.map +1 -0
  35. package/dist/local-git.js +428 -0
  36. package/dist/local-git.js.map +1 -0
  37. package/dist/model-provider-fixtures.d.ts +15 -0
  38. package/dist/model-provider-fixtures.d.ts.map +1 -0
  39. package/dist/polling.d.ts +2 -1
  40. package/dist/polling.d.ts.map +1 -1
  41. package/dist/process-driver.d.ts +14 -0
  42. package/dist/process-driver.d.ts.map +1 -0
  43. package/dist/question-fixtures.d.ts +2 -0
  44. package/dist/question-fixtures.d.ts.map +1 -1
  45. package/dist/server-extension-test-harness.d.ts +57 -2
  46. package/dist/server-extension-test-harness.d.ts.map +1 -1
  47. package/dist/stub-worker-entry.js +9 -5
  48. package/dist/stub-worker-entry.js.map +1 -1
  49. package/dist/test-diagnostics.d.ts +14 -0
  50. package/dist/test-diagnostics.d.ts.map +1 -0
  51. package/dist/worker-testing/in-process-worker-spawn.d.ts +21 -0
  52. package/dist/worker-testing/in-process-worker-spawn.d.ts.map +1 -1
  53. package/dist/worker-testing/index.d.ts +6 -7
  54. package/dist/worker-testing/index.d.ts.map +1 -1
  55. package/dist/worker-testing/index.js +381 -7
  56. package/dist/worker-testing/index.js.map +1 -1
  57. package/dist/worker-testing/schema-driven-stub-pi.d.ts +5 -0
  58. package/dist/worker-testing/schema-driven-stub-pi.d.ts.map +1 -1
  59. package/dist/worker-testing/stub-pi-controls.d.ts +4 -0
  60. package/dist/worker-testing/stub-pi-controls.d.ts.map +1 -1
  61. package/dist/worker-testing/stub-pi-tree-handle.d.ts +93 -1
  62. package/dist/worker-testing/stub-pi-tree-handle.d.ts.map +1 -1
  63. package/dist/worker-testing/worker-runtime-harness.d.ts +37 -2
  64. package/dist/worker-testing/worker-runtime-harness.d.ts.map +1 -1
  65. package/dist/worker-testing/worker-start-payload.d.ts +17 -1
  66. package/dist/worker-testing/worker-start-payload.d.ts.map +1 -1
  67. package/package.json +15 -9
  68. package/src/compact-process-detail-fixture.ts +37 -3
  69. package/src/fakes/fake-git-ops.ts +12 -0
  70. package/src/fakes/fake-llm.ts +11 -0
  71. package/src/fakes/index.ts +1 -1
  72. package/src/http-launch.ts +88 -0
  73. package/src/index.ts +31 -41
  74. package/src/integration-harness.ts +100 -9
  75. package/src/integration.ts +3 -9
  76. package/src/local-git.ts +499 -0
  77. package/src/model-provider-fixtures.ts +36 -0
  78. package/src/polling.ts +3 -2
  79. package/src/process-driver.ts +63 -0
  80. package/src/question-fixtures.ts +2 -0
  81. package/src/server-extension-test-harness.ts +100 -6
  82. package/src/test-diagnostics.ts +69 -0
  83. package/src/worker-testing/in-process-worker-spawn.ts +49 -2
  84. package/src/worker-testing/index.ts +4 -26
  85. package/src/worker-testing/schema-driven-stub-pi.ts +8 -1
  86. package/src/worker-testing/stub-pi-controls.ts +4 -0
  87. package/src/worker-testing/stub-pi-tree-handle.ts +301 -21
  88. package/src/worker-testing/worker-runtime-harness.ts +57 -6
  89. package/src/worker-testing/worker-start-payload.ts +18 -1
  90. package/dist/chunk-3MQO3NCX.js +0 -15
  91. package/dist/chunk-3MQO3NCX.js.map +0 -1
  92. package/dist/chunk-7ZK5QRGP.js +0 -98
  93. package/dist/chunk-7ZK5QRGP.js.map +0 -1
  94. package/dist/chunk-JUH3LUYK.js.map +0 -1
  95. package/dist/chunk-KIDBCGNW.js.map +0 -1
  96. package/dist/chunk-QFCJV2VA.js.map +0 -1
  97. package/dist/chunk-R4KVUGWR.js +0 -83
  98. package/dist/chunk-R4KVUGWR.js.map +0 -1
  99. package/dist/chunk-ST2C4VKX.js +0 -297
  100. package/dist/chunk-ST2C4VKX.js.map +0 -1
  101. package/dist/compact-process-detail-fixture.js +0 -73
  102. package/dist/compact-process-detail-fixture.js.map +0 -1
  103. package/dist/fakes/fake-git-ops.js +0 -101
  104. package/dist/fakes/fake-git-ops.js.map +0 -1
  105. package/dist/fakes/fake-llm.js +0 -27
  106. package/dist/fakes/fake-llm.js.map +0 -1
  107. package/dist/in-process-worker.js +0 -2
  108. package/dist/in-process-worker.js.map +0 -1
  109. package/dist/integration-harness.js +0 -38
  110. package/dist/integration-harness.js.map +0 -1
  111. package/dist/polling.js +0 -14
  112. package/dist/polling.js.map +0 -1
  113. package/dist/question-fixtures.js +0 -26
  114. package/dist/question-fixtures.js.map +0 -1
  115. package/dist/server-extension-test-harness.js +0 -169
  116. package/dist/server-extension-test-harness.js.map +0 -1
  117. package/dist/test-app.d.ts +0 -23
  118. package/dist/test-app.d.ts.map +0 -1
  119. package/dist/test-app.js +0 -47
  120. package/dist/test-app.js.map +0 -1
  121. package/dist/worker-testing/in-process-worker-spawn.js +0 -61
  122. package/dist/worker-testing/in-process-worker-spawn.js.map +0 -1
  123. package/dist/worker-testing/ipc-harness.d.ts +0 -11
  124. package/dist/worker-testing/ipc-harness.d.ts.map +0 -1
  125. package/dist/worker-testing/ipc-harness.js +0 -17
  126. package/dist/worker-testing/ipc-harness.js.map +0 -1
  127. package/dist/worker-testing/schema-driven-stub-pi.js +0 -65
  128. package/dist/worker-testing/schema-driven-stub-pi.js.map +0 -1
  129. package/dist/worker-testing/stub-pi-controls.js +0 -10
  130. package/dist/worker-testing/stub-pi-controls.js.map +0 -1
  131. package/dist/worker-testing/stub-pi-tree-handle.js +0 -515
  132. package/dist/worker-testing/stub-pi-tree-handle.js.map +0 -1
  133. package/dist/worker-testing/worker-runtime-harness.js +0 -231
  134. package/dist/worker-testing/worker-runtime-harness.js.map +0 -1
  135. package/dist/worker-testing/worker-start-payload.js +0 -101
  136. package/dist/worker-testing/worker-start-payload.js.map +0 -1
  137. package/dist/workspace-source-aliases.d.ts +0 -6
  138. package/dist/workspace-source-aliases.d.ts.map +0 -1
  139. package/dist/workspace-source-aliases.js +0 -126
  140. package/dist/workspace-source-aliases.js.map +0 -1
  141. package/src/test-app.ts +0 -82
  142. package/src/worker-testing/ipc-harness.ts +0 -19
  143. package/src/workspace-source-aliases.ts +0 -171
@@ -1,297 +0,0 @@
1
- import {
2
- FakeLlmProvider
3
- } from "./chunk-JUH3LUYK.js";
4
- import {
5
- createInProcessWorkerSpawn,
6
- flushAsyncWork
7
- } from "./chunk-KIDBCGNW.js";
8
-
9
- // src/integration-harness.ts
10
- import {
11
- createAppContext,
12
- getDefaultConfig
13
- } from "@leitwerk-dev/server";
14
- async function createIntegrationHarness(opts) {
15
- const config = opts.config ?? getDefaultConfig();
16
- if (!opts.appOverrides?.workerRunnerRuntime) {
17
- config.workers.runner = "local";
18
- }
19
- opts.configOverride?.(config);
20
- const extensionCatalog = await Promise.resolve(opts.extensionCatalog);
21
- const appOpts = {
22
- logger: false,
23
- config,
24
- extensionCatalog,
25
- preProvidedCapabilities: opts.preProvidedCapabilities,
26
- ...opts.appOverrides
27
- };
28
- if (opts.inProcessWorkers !== false && !appOpts.localWorkerSpawnImpl) {
29
- appOpts.localWorkerSpawnImpl = createInProcessWorkerSpawn({
30
- extensionCatalog
31
- });
32
- }
33
- const ctx = await createAppContext(appOpts);
34
- let address = "";
35
- if (opts.listen !== false || config.workers.runner === "local") {
36
- await ctx.app.listen({ host: "127.0.0.1", port: 0 });
37
- const info = ctx.app.server.address();
38
- const port = typeof info === "object" && info ? info.port : 0;
39
- address = `http://127.0.0.1:${port}`;
40
- ctx.config.server.base_url = address;
41
- }
42
- return {
43
- ctx,
44
- config,
45
- address,
46
- resources: opts.resources ?? {}
47
- };
48
- }
49
-
50
- // src/polling.ts
51
- async function waitForValue(read, predicate, timeoutMs = 5e3) {
52
- const deadline = Date.now() + timeoutMs;
53
- while (true) {
54
- const value = read();
55
- if (predicate(value)) {
56
- return value;
57
- }
58
- if (Date.now() >= deadline) {
59
- throw new Error("Timed out waiting for value");
60
- }
61
- await new Promise((resolve) => setTimeout(resolve, 25));
62
- }
63
- }
64
-
65
- // src/server-extension-test-harness.ts
66
- import { setupServerExtensions } from "@leitwerk-dev/extension-runtime";
67
- import { buildExtensionCatalogFromModules } from "@leitwerk-dev/extension-runtime/testing";
68
- import {
69
- coreHostCapabilities,
70
- createCapabilityAccessor,
71
- createEventBus
72
- } from "@leitwerk-dev/process-sdk";
73
- function createInMemoryExternalWriteLog() {
74
- const dedupKeys = /* @__PURE__ */ new Set();
75
- return {
76
- hasDedupKey(key) {
77
- return dedupKeys.has(key);
78
- },
79
- record(input) {
80
- dedupKeys.add(input.dedupKey);
81
- return input;
82
- },
83
- getDedupKeys() {
84
- return dedupKeys;
85
- }
86
- };
87
- }
88
- function createDefaultServerSetupDeps() {
89
- return {
90
- serverBaseUrl: "https://leitwerk.example",
91
- components: {},
92
- externalWrites: createInMemoryExternalWriteLog(),
93
- repositoryCredentials: { register: () => {
94
- } },
95
- processes: {
96
- create: () => {
97
- throw new Error("not used");
98
- },
99
- getById: () => null,
100
- listAll: () => [],
101
- update: () => null
102
- },
103
- projects: {
104
- create: () => {
105
- throw new Error("not used");
106
- },
107
- getByInstanceAndKey: () => null,
108
- update: () => null,
109
- listByInstance: () => []
110
- },
111
- events: { create: () => {
112
- }, listByInstance: () => [] },
113
- broadcaster: { sendDurable: () => {
114
- } },
115
- commands: {
116
- getDeferredProcessActivationSnapshots: () => ({ outcome: "process_not_found" }),
117
- activateDeferredProcess: async () => ({
118
- ok: true,
119
- process: null,
120
- data: { outcome: "not_applicable" }
121
- }),
122
- parkDeferredProcessActivationFailure: async () => ({
123
- ok: true,
124
- process: null,
125
- data: { outcome: "parked" }
126
- }),
127
- startProcess: async () => ({ ok: true, process: null }),
128
- abortProcess: async () => ({ ok: true, process: null }),
129
- retryProcess: async () => ({ ok: true, process: null }),
130
- continueFailedTurn: async () => ({ ok: true, process: null }),
131
- queueInputs: async () => ({ ok: true, process: null })
132
- },
133
- processActions: {
134
- listVisibleActions: () => [],
135
- executeAction: async () => ({ ok: true, process: null })
136
- },
137
- externalSources: {
138
- listArmed: () => [],
139
- fire: async () => ({ ok: true, process: null })
140
- },
141
- getSupervisor: () => void 0,
142
- launcherService: {
143
- listUiLaunchers: () => [],
144
- resolveUiDefaults: async () => ({}),
145
- resolveUiOptions: async () => ({}),
146
- resolveUiRelaunchInput: async (_launcherId, previousInput) => ({ ...previousInput }),
147
- resolveUiLauncher: async () => ({ ok: false, errors: [] })
148
- },
149
- launcherRecentValues: {
150
- list: () => ({}),
151
- record: () => {
152
- }
153
- },
154
- launcherModelConfigs: {
155
- getSchema: async () => null,
156
- preview: async () => null
157
- },
158
- launchPlans: {
159
- async prepare(launchPlan, opts) {
160
- return {
161
- ok: true,
162
- launchPlan,
163
- modelConfig: opts?.modelConfig ?? {},
164
- warnings: []
165
- };
166
- }
167
- },
168
- processLaunches: {
169
- async createProcessFromLaunchConfig() {
170
- throw new Error("not used");
171
- },
172
- async createProcessFromLaunchPlan() {
173
- throw new Error("not used");
174
- }
175
- }
176
- };
177
- }
178
- function createTestServerSetupCapability(overrides = {}) {
179
- const defaults = createDefaultServerSetupDeps();
180
- return {
181
- ...defaults,
182
- ...overrides,
183
- processes: { ...defaults.processes, ...overrides.processes },
184
- projects: { ...defaults.projects, ...overrides.projects },
185
- events: { ...defaults.events, ...overrides.events },
186
- broadcaster: { ...defaults.broadcaster, ...overrides.broadcaster },
187
- commands: { ...defaults.commands, ...overrides.commands },
188
- processActions: { ...defaults.processActions, ...overrides.processActions },
189
- externalSources: { ...defaults.externalSources, ...overrides.externalSources },
190
- launcherService: { ...defaults.launcherService, ...overrides.launcherService },
191
- launcherRecentValues: {
192
- ...defaults.launcherRecentValues,
193
- ...overrides.launcherRecentValues
194
- },
195
- launcherModelConfigs: {
196
- ...defaults.launcherModelConfigs,
197
- ...overrides.launcherModelConfigs
198
- },
199
- launchPlans: { ...defaults.launchPlans, ...overrides.launchPlans },
200
- processLaunches: { ...defaults.processLaunches, ...overrides.processLaunches }
201
- };
202
- }
203
- async function setupServerExtensionTest(input) {
204
- const catalog = await buildExtensionCatalogFromModules(input.modules);
205
- const events = createEventBus();
206
- const serverSetup = createTestServerSetupCapability(input.serverSetup);
207
- const capabilities = createCapabilityAccessor([
208
- {
209
- token: coreHostCapabilities.serverSetup,
210
- value: serverSetup
211
- },
212
- ...input.providedCapabilities ?? []
213
- ]);
214
- const startHooks = [];
215
- const stopHooks = [];
216
- await setupServerExtensions(catalog, {
217
- events,
218
- provide: capabilities.provide.bind(capabilities),
219
- get: capabilities.get.bind(capabilities),
220
- require: capabilities.require.bind(capabilities),
221
- tool() {
222
- },
223
- onStart(handler) {
224
- startHooks.push(handler);
225
- input.onStart?.(handler);
226
- },
227
- onStop(handler) {
228
- stopHooks.push(handler);
229
- input.onStop?.(handler);
230
- }
231
- });
232
- return {
233
- catalog,
234
- events,
235
- serverSetup,
236
- startHooks,
237
- stopHooks,
238
- flushAsyncWork
239
- };
240
- }
241
-
242
- // src/test-app.ts
243
- import {
244
- createAppContext as createAppContext2,
245
- getDefaultConfig as getDefaultConfig2
246
- } from "@leitwerk-dev/server";
247
- async function createTestApp(opts) {
248
- const llm = new FakeLlmProvider();
249
- const config = getDefaultConfig2();
250
- config.workers.runner = "local";
251
- config.workers.shutdown_grace_period = "100ms";
252
- opts.configureConfig?.(config);
253
- const ctx = await createAppContext2({
254
- logger: false,
255
- config,
256
- // Default to in-process stub workers so integration tests do not boot the
257
- // real Pi runtime or touch a developer's ambient Pi setup.
258
- extensionCatalog: opts.extensionCatalog,
259
- preProvidedCapabilities: opts.preProvidedCapabilities,
260
- ...opts.inProcessWorkers !== false ? {
261
- localWorkerSpawnImpl: createInProcessWorkerSpawn({
262
- extensionCatalog: opts.extensionCatalog
263
- })
264
- } : {}
265
- });
266
- let address = "";
267
- if (opts.listen !== false || config.workers.runner === "local") {
268
- await ctx.app.listen({ host: "127.0.0.1", port: 0 });
269
- const addressInfo = ctx.app.server.address();
270
- const port = typeof addressInfo === "object" && addressInfo ? addressInfo.port : 0;
271
- address = `http://127.0.0.1:${port}`;
272
- ctx.config.server.base_url = address;
273
- }
274
- return {
275
- server: ctx.app,
276
- ctx,
277
- address,
278
- llm,
279
- ...opts.resources ?? {},
280
- close: async () => {
281
- await ctx.supervisor.shutdownAll("test_app_close");
282
- ctx.app.server.closeIdleConnections?.();
283
- ctx.app.server.closeAllConnections?.();
284
- await ctx.app.close();
285
- }
286
- };
287
- }
288
-
289
- export {
290
- createIntegrationHarness,
291
- waitForValue,
292
- createInMemoryExternalWriteLog,
293
- createTestServerSetupCapability,
294
- setupServerExtensionTest,
295
- createTestApp
296
- };
297
- //# sourceMappingURL=chunk-ST2C4VKX.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/integration-harness.ts","../src/polling.ts","../src/server-extension-test-harness.ts","../src/test-app.ts"],"sourcesContent":["import type { ExtensionCatalog } from \"@leitwerk-dev/extension-runtime\";\nimport type { ProvidedCapability } from \"@leitwerk-dev/process-sdk\";\nimport {\n\ttype AppContext,\n\ttype AppOptions,\n\tcreateAppContext,\n\tgetDefaultConfig,\n\ttype LeitwerkConfig,\n} from \"@leitwerk-dev/server\";\nimport { createInProcessWorkerSpawn } from \"./in-process-worker.js\";\n\nexport interface IntegrationHarness<\n\tTResources extends Record<string, unknown> = Record<string, never>,\n> {\n\tctx: AppContext;\n\tconfig: LeitwerkConfig;\n\taddress: string;\n\tresources: TResources;\n}\n\nexport interface IntegrationHarnessOptions<\n\tTResources extends Record<string, unknown> = Record<string, never>,\n> {\n\tconfig?: LeitwerkConfig;\n\tconfigOverride?: (config: LeitwerkConfig) => void;\n\tappOverrides?: Partial<AppOptions>;\n\tlisten?: boolean;\n\tinProcessWorkers?: boolean;\n\textensionCatalog: ExtensionCatalog | Promise<ExtensionCatalog>;\n\tpreProvidedCapabilities?: readonly ProvidedCapability[];\n\tresources?: TResources;\n}\n\nexport async function createIntegrationHarness<\n\tTResources extends Record<string, unknown> = Record<string, never>,\n>(opts: IntegrationHarnessOptions<TResources>): Promise<IntegrationHarness<TResources>> {\n\tconst config = opts.config ?? getDefaultConfig();\n\tif (!opts.appOverrides?.workerRunnerRuntime) {\n\t\tconfig.workers.runner = \"local\";\n\t}\n\topts.configOverride?.(config);\n\n\tconst extensionCatalog = await Promise.resolve(opts.extensionCatalog);\n\n\tconst appOpts: AppOptions = {\n\t\tlogger: false,\n\t\tconfig,\n\t\textensionCatalog,\n\t\tpreProvidedCapabilities: opts.preProvidedCapabilities,\n\t\t...opts.appOverrides,\n\t};\n\n\tif (opts.inProcessWorkers !== false && !appOpts.localWorkerSpawnImpl) {\n\t\tappOpts.localWorkerSpawnImpl = createInProcessWorkerSpawn({\n\t\t\textensionCatalog,\n\t\t});\n\t}\n\tconst ctx = await createAppContext(appOpts);\n\n\tlet address = \"\";\n\tif (opts.listen !== false || config.workers.runner === \"local\") {\n\t\tawait ctx.app.listen({ host: \"127.0.0.1\", port: 0 });\n\t\tconst info = ctx.app.server.address();\n\t\tconst port = typeof info === \"object\" && info ? info.port : 0;\n\t\taddress = `http://127.0.0.1:${port}`;\n\t\tctx.config.server.base_url = address;\n\t}\n\n\treturn {\n\t\tctx,\n\t\tconfig,\n\t\taddress,\n\t\tresources: opts.resources ?? ({} as TResources),\n\t};\n}\n","export async function waitForValue<T>(\n\tread: () => T,\n\tpredicate: (value: T) => boolean,\n\ttimeoutMs = 5_000,\n): Promise<T> {\n\tconst deadline = Date.now() + timeoutMs;\n\twhile (true) {\n\t\tconst value = read();\n\t\tif (predicate(value)) {\n\t\t\treturn value;\n\t\t}\n\t\tif (Date.now() >= deadline) {\n\t\t\tthrow new Error(\"Timed out waiting for value\");\n\t\t}\n\t\tawait new Promise((resolve) => setTimeout(resolve, 25));\n\t}\n}\n","import { type ExtensionCatalog, setupServerExtensions } from \"@leitwerk-dev/extension-runtime\";\nimport { buildExtensionCatalogFromModules } from \"@leitwerk-dev/extension-runtime/testing\";\nimport {\n\ttype CoreServerSetupDeps,\n\tcoreHostCapabilities,\n\tcreateCapabilityAccessor,\n\tcreateEventBus,\n\ttype LeitwerkExtensionModule,\n\ttype ProvidedCapability,\n\ttype ServerExtensionEventMap,\n} from \"@leitwerk-dev/process-sdk\";\nimport { flushAsyncWork } from \"./worker-testing/ipc-harness.js\";\n\nexport { flushAsyncWork };\n\nexport interface InMemoryExternalWriteLog {\n\thasDedupKey(key: string): boolean;\n\trecord(input: { dedupKey: string }): { dedupKey: string };\n\tgetDedupKeys(): ReadonlySet<string>;\n}\n\nexport function createInMemoryExternalWriteLog(): InMemoryExternalWriteLog {\n\tconst dedupKeys = new Set<string>();\n\treturn {\n\t\thasDedupKey(key: string) {\n\t\t\treturn dedupKeys.has(key);\n\t\t},\n\t\trecord(input: { dedupKey: string }) {\n\t\t\tdedupKeys.add(input.dedupKey);\n\t\t\treturn input;\n\t\t},\n\t\tgetDedupKeys() {\n\t\t\treturn dedupKeys;\n\t\t},\n\t};\n}\n\nfunction createDefaultServerSetupDeps(): CoreServerSetupDeps {\n\treturn {\n\t\tserverBaseUrl: \"https://leitwerk.example\",\n\t\tcomponents: {},\n\t\texternalWrites: createInMemoryExternalWriteLog(),\n\t\trepositoryCredentials: { register: () => {} },\n\t\tprocesses: {\n\t\t\tcreate: () => {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t\tgetById: () => null,\n\t\t\tlistAll: () => [],\n\t\t\tupdate: () => null,\n\t\t},\n\t\tprojects: {\n\t\t\tcreate: () => {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t\tgetByInstanceAndKey: () => null,\n\t\t\tupdate: () => null,\n\t\t\tlistByInstance: () => [],\n\t\t},\n\t\tevents: { create: () => {}, listByInstance: () => [] },\n\t\tbroadcaster: { sendDurable: () => {} },\n\t\tcommands: {\n\t\t\tgetDeferredProcessActivationSnapshots: () => ({ outcome: \"process_not_found\" }),\n\t\t\tactivateDeferredProcess: async () => ({\n\t\t\t\tok: true,\n\t\t\t\tprocess: null,\n\t\t\t\tdata: { outcome: \"not_applicable\" },\n\t\t\t}),\n\t\t\tparkDeferredProcessActivationFailure: async () => ({\n\t\t\t\tok: true,\n\t\t\t\tprocess: null,\n\t\t\t\tdata: { outcome: \"parked\" },\n\t\t\t}),\n\t\t\tstartProcess: async () => ({ ok: true, process: null }),\n\t\t\tabortProcess: async () => ({ ok: true, process: null }),\n\t\t\tretryProcess: async () => ({ ok: true, process: null }),\n\t\t\tcontinueFailedTurn: async () => ({ ok: true, process: null }),\n\t\t\tqueueInputs: async () => ({ ok: true, process: null }),\n\t\t},\n\t\tprocessActions: {\n\t\t\tlistVisibleActions: () => [],\n\t\t\texecuteAction: async () => ({ ok: true, process: null }),\n\t\t},\n\t\texternalSources: {\n\t\t\tlistArmed: () => [],\n\t\t\tfire: async () => ({ ok: true, process: null }),\n\t\t},\n\t\tgetSupervisor: () => undefined,\n\t\tlauncherService: {\n\t\t\tlistUiLaunchers: () => [],\n\t\t\tresolveUiDefaults: async () => ({}),\n\t\t\tresolveUiOptions: async () => ({}),\n\t\t\tresolveUiRelaunchInput: async (_launcherId, previousInput) => ({ ...previousInput }),\n\t\t\tresolveUiLauncher: async () => ({ ok: false as const, errors: [] }),\n\t\t},\n\t\tlauncherRecentValues: {\n\t\t\tlist: () => ({}),\n\t\t\trecord: () => {},\n\t\t},\n\t\tlauncherModelConfigs: {\n\t\t\tgetSchema: async () => null,\n\t\t\tpreview: async () => null,\n\t\t},\n\t\tlaunchPlans: {\n\t\t\tasync prepare(launchPlan, opts) {\n\t\t\t\treturn {\n\t\t\t\t\tok: true as const,\n\t\t\t\t\tlaunchPlan,\n\t\t\t\t\tmodelConfig: opts?.modelConfig ?? {},\n\t\t\t\t\twarnings: [],\n\t\t\t\t};\n\t\t\t},\n\t\t},\n\t\tprocessLaunches: {\n\t\t\tasync createProcessFromLaunchConfig() {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t\tasync createProcessFromLaunchPlan() {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport function createTestServerSetupCapability(\n\toverrides: Partial<CoreServerSetupDeps> = {},\n): CoreServerSetupDeps {\n\tconst defaults = createDefaultServerSetupDeps();\n\treturn {\n\t\t...defaults,\n\t\t...overrides,\n\t\tprocesses: { ...defaults.processes, ...overrides.processes },\n\t\tprojects: { ...defaults.projects, ...overrides.projects },\n\t\tevents: { ...defaults.events, ...overrides.events },\n\t\tbroadcaster: { ...defaults.broadcaster, ...overrides.broadcaster },\n\t\tcommands: { ...defaults.commands, ...overrides.commands },\n\t\tprocessActions: { ...defaults.processActions, ...overrides.processActions },\n\t\texternalSources: { ...defaults.externalSources, ...overrides.externalSources },\n\t\tlauncherService: { ...defaults.launcherService, ...overrides.launcherService },\n\t\tlauncherRecentValues: {\n\t\t\t...defaults.launcherRecentValues,\n\t\t\t...overrides.launcherRecentValues,\n\t\t},\n\t\tlauncherModelConfigs: {\n\t\t\t...defaults.launcherModelConfigs,\n\t\t\t...overrides.launcherModelConfigs,\n\t\t},\n\t\tlaunchPlans: { ...defaults.launchPlans, ...overrides.launchPlans },\n\t\tprocessLaunches: { ...defaults.processLaunches, ...overrides.processLaunches },\n\t};\n}\n\nexport interface ServerExtensionTestHarness {\n\tcatalog: ExtensionCatalog;\n\tevents: ReturnType<typeof createEventBus>;\n\tserverSetup: CoreServerSetupDeps;\n\tstartHooks: Array<() => void | Promise<void>>;\n\tstopHooks: Array<() => void | Promise<void>>;\n\tflushAsyncWork: typeof flushAsyncWork;\n}\n\nexport async function setupServerExtensionTest(input: {\n\tmodules: readonly LeitwerkExtensionModule[];\n\tprovidedCapabilities?: readonly ProvidedCapability[];\n\tserverSetup?: Partial<CoreServerSetupDeps>;\n\tonStart?: (handler: () => void | Promise<void>) => void;\n\tonStop?: (handler: () => void | Promise<void>) => void;\n}): Promise<ServerExtensionTestHarness> {\n\tconst catalog = await buildExtensionCatalogFromModules(input.modules);\n\tconst events = createEventBus<ServerExtensionEventMap>();\n\tconst serverSetup = createTestServerSetupCapability(input.serverSetup);\n\tconst capabilities = createCapabilityAccessor([\n\t\t{\n\t\t\ttoken: coreHostCapabilities.serverSetup,\n\t\t\tvalue: serverSetup,\n\t\t},\n\t\t...(input.providedCapabilities ?? []),\n\t]);\n\tconst startHooks: Array<() => void | Promise<void>> = [];\n\tconst stopHooks: Array<() => void | Promise<void>> = [];\n\n\tawait setupServerExtensions(catalog, {\n\t\tevents,\n\t\tprovide: capabilities.provide.bind(capabilities),\n\t\tget: capabilities.get.bind(capabilities),\n\t\trequire: capabilities.require.bind(capabilities),\n\t\ttool() {},\n\t\tonStart(handler) {\n\t\t\tstartHooks.push(handler);\n\t\t\tinput.onStart?.(handler);\n\t\t},\n\t\tonStop(handler) {\n\t\t\tstopHooks.push(handler);\n\t\t\tinput.onStop?.(handler);\n\t\t},\n\t});\n\n\treturn {\n\t\tcatalog,\n\t\tevents,\n\t\tserverSetup,\n\t\tstartHooks,\n\t\tstopHooks,\n\t\tflushAsyncWork,\n\t};\n}\n","import type { ExtensionCatalog } from \"@leitwerk-dev/extension-runtime\";\nimport type { ProvidedCapability } from \"@leitwerk-dev/process-sdk\";\nimport {\n\ttype AppContext,\n\tcreateAppContext,\n\tgetDefaultConfig,\n\ttype LeitwerkConfig,\n} from \"@leitwerk-dev/server\";\nimport type { FastifyInstance } from \"fastify\";\nimport { FakeLlmProvider } from \"./fakes/fake-llm.js\";\nimport { createInProcessWorkerSpawn } from \"./in-process-worker.js\";\n\nexport interface TestAppBase {\n\tserver: FastifyInstance;\n\tctx: AppContext;\n\taddress: string;\n\tllm: FakeLlmProvider;\n\tclose: () => Promise<void>;\n}\n\nexport type TestApp<TResources extends Record<string, unknown> = Record<string, never>> =\n\tTestAppBase & TResources;\n\nexport interface TestAppOptions<\n\tTResources extends Record<string, unknown> = Record<string, never>,\n> {\n\textensionCatalog: ExtensionCatalog | Promise<ExtensionCatalog>;\n\tpreProvidedCapabilities?: readonly ProvidedCapability[];\n\tresources?: TResources;\n\tlisten?: boolean;\n\tinProcessWorkers?: boolean;\n\tconfigureConfig?: (config: LeitwerkConfig) => void;\n}\n\nexport async function createTestApp<\n\tTResources extends Record<string, unknown> = Record<string, never>,\n>(opts: TestAppOptions<TResources>): Promise<TestApp<TResources>> {\n\tconst llm = new FakeLlmProvider();\n\tconst config = getDefaultConfig();\n\tconfig.workers.runner = \"local\";\n\tconfig.workers.shutdown_grace_period = \"100ms\";\n\topts.configureConfig?.(config);\n\n\tconst ctx = await createAppContext({\n\t\tlogger: false,\n\t\tconfig,\n\t\t// Default to in-process stub workers so integration tests do not boot the\n\t\t// real Pi runtime or touch a developer's ambient Pi setup.\n\t\textensionCatalog: opts.extensionCatalog,\n\t\tpreProvidedCapabilities: opts.preProvidedCapabilities,\n\t\t...(opts.inProcessWorkers !== false\n\t\t\t? {\n\t\t\t\t\tlocalWorkerSpawnImpl: createInProcessWorkerSpawn({\n\t\t\t\t\t\textensionCatalog: opts.extensionCatalog,\n\t\t\t\t\t}),\n\t\t\t\t}\n\t\t\t: {}),\n\t});\n\n\tlet address = \"\";\n\tif (opts.listen !== false || config.workers.runner === \"local\") {\n\t\tawait ctx.app.listen({ host: \"127.0.0.1\", port: 0 });\n\t\tconst addressInfo = ctx.app.server.address();\n\t\tconst port = typeof addressInfo === \"object\" && addressInfo ? addressInfo.port : 0;\n\t\taddress = `http://127.0.0.1:${port}`;\n\t\tctx.config.server.base_url = address;\n\t}\n\n\treturn {\n\t\tserver: ctx.app,\n\t\tctx,\n\t\taddress,\n\t\tllm,\n\t\t...(opts.resources ?? ({} as TResources)),\n\t\tclose: async () => {\n\t\t\tawait ctx.supervisor.shutdownAll(\"test_app_close\");\n\t\t\tctx.app.server.closeIdleConnections?.();\n\t\t\tctx.app.server.closeAllConnections?.();\n\t\t\tawait ctx.app.close();\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;;;AAEA;AAAA,EAGC;AAAA,EACA;AAAA,OAEM;AAyBP,eAAsB,yBAEpB,MAAsF;AACvF,QAAM,SAAS,KAAK,UAAU,iBAAiB;AAC/C,MAAI,CAAC,KAAK,cAAc,qBAAqB;AAC5C,WAAO,QAAQ,SAAS;AAAA,EACzB;AACA,OAAK,iBAAiB,MAAM;AAE5B,QAAM,mBAAmB,MAAM,QAAQ,QAAQ,KAAK,gBAAgB;AAEpE,QAAM,UAAsB;AAAA,IAC3B,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,yBAAyB,KAAK;AAAA,IAC9B,GA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;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,KAAK,aAAc,CAAC;AAAA,IACxB,OAAO,YAAY;AAClB,YAAM,IAAI,WAAW,YAAY,gBAAgB;AACjD,UAAI,IAAI,OAAO,uBAAuB;AACtC,UAAI,IAAI,OAAO,sBAAsB;AACrC,YAAM,IAAI,IAAI,MAAM;AAAA,IACrB;AAAA,EACD;AACD;","names":["createAppContext","getDefaultConfig","getDefaultConfig","createAppContext"]}
@@ -1,73 +0,0 @@
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
@@ -1 +0,0 @@
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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,EAAE,EAAE,EAAE;YAClF,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;YACjD,gBAAgB,EAAE,EAAE;YACpB,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,YAAY,EAAE,MAAM,CAAC,YAAY,IAAI,IAAI;YACzC,eAAe,EAAE,MAAM,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"}
@@ -1,101 +0,0 @@
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
@@ -1 +0,0 @@
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,EAAE,OAAe;QACjE,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,QAAQ,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,EA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AE,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"}
@@ -1,27 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export { createInProcessWorkerSpawn, } from "./worker-testing/in-process-worker-spawn.js";
2
- //# sourceMappingURL=in-process-worker.js.map
@@ -1 +0,0 @@
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"}
@@ -1,38 +0,0 @@
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
@@ -1 +0,0 @@
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"}
package/dist/polling.js DELETED
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,26 +0,0 @@
1
- export function createTestQuestion(overrides = {}) {
2
- return {
3
- id: "question_1",
4
- question: "Choose a strategy",
5
- selection: "single",
6
- options: [{ id: "question_1_option_1", label: "Safe", details: "Small change" }],
7
- ...overrides,
8
- };
9
- }
10
- export function createTestQuestionRequest(overrides = {}) {
11
- return {
12
- id: "qst_1",
13
- instanceId: "agt_1",
14
- turnRecordId: "trn_1",
15
- toolCallId: "tool_1",
16
- questions: [createTestQuestion()],
17
- status: "open",
18
- answers: null,
19
- askedAt: "2026-01-01T00:00:00.000Z",
20
- answeredAt: null,
21
- answeredBy: null,
22
- cancelledAt: null,
23
- ...overrides,
24
- };
25
- }
26
- //# sourceMappingURL=question-fixtures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"question-fixtures.js","sourceRoot":"","sources":["../src/question-fixtures.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,kBAAkB,CACjC,YAAyC,EAAE;IAE3C,OAAO;QACN,EAAE,EAAE,YAAY;QAChB,QAAQ,EAAE,mBAAmB;QAC7B,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;QAChF,GAAG,SAAS;KACZ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,YAA6C,EAAE;IAE/C,OAAO;QACN,EAAE,EAAE,OAAO;QACX,UAAU,EAAE,OAAO;QACnB,YAAY,EAAE,OAAO;QACrB,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,CAAC,kBAAkB,EAAE,CAAC;QACjC,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,0BAA0B;QACnC,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,IAAI;QACjB,GAAG,SAAS;KACZ,CAAC;AACH,CAAC"}