@leitwerk-dev/test-support 0.4.0 → 0.4.2

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.
@@ -141,6 +141,7 @@ function createDefaultServerSetupDeps() {
141
141
  startProcess: async () => ({ ok: true, process: null }),
142
142
  abortProcess: async () => ({ ok: true, process: null }),
143
143
  retryProcess: async () => ({ ok: true, process: null }),
144
+ retryStartupAutomatically: async () => ({ ok: true, process: null }),
144
145
  continueFailedTurn: async () => ({ ok: true, process: null }),
145
146
  queueInputs: async () => ({ ok: true, process: null })
146
147
  },
@@ -222,4 +223,4 @@ export {
222
223
  createInMemoryExternalWriteLog,
223
224
  createTestServerSetupCapability
224
225
  };
225
- //# sourceMappingURL=chunk-DNUGHAYN.js.map
226
+ //# sourceMappingURL=chunk-RRE5BNSZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server-extension-test-harness.ts"],"sourcesContent":["import { type ExtensionCatalog, setupServerExtensions } from \"@leitwerk-dev/extension-runtime\";\nimport { buildExtensionCatalogFromModules } from \"@leitwerk-dev/extension-runtime/testing\";\nimport {\n\tbindExternalWrites,\n\ttype ExternalWriteLogRepoLike,\n} from \"@leitwerk-dev/external-writes/internal\";\nimport {\n\ttype CoreServerSetupDeps,\n\tcoreHostCapabilities,\n\tcreateCapabilityAccessor,\n\tcreateEventBus,\n\ttype IntegrationToolDefinition,\n\ttype LeitwerkExtensionModule,\n\ttype ProvidedCapability,\n\ttype ServerExtensionAPI,\n\ttype ServerExtensionEventMap,\n} from \"@leitwerk-dev/process-sdk\";\nimport { flushAsyncWork } from \"@leitwerk-dev/worker-protocol\";\n\nexport { flushAsyncWork };\n\n/** Register a test provider and expose its poll result without erasing its type. @public */\nexport function createPollingTestExtension<T>(\n\tmanifest: LeitwerkExtensionModule[\"manifest\"],\n\tsetup: (api: ServerExtensionAPI) =>\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tpoll(): Promise<T>;\n\t\t }\n\t\t| undefined,\n\t/** Disable scheduled polling so tests control every observation. @internal */\n\tmanual = false,\n) {\n\tlet provider: ReturnType<typeof setup>;\n\treturn {\n\t\t/** @internal */\n\t\tmanifest,\n\t\t/** @internal */\n\t\tsetupServer(api: ServerExtensionAPI) {\n\t\t\tprovider = setup(\n\t\t\t\tmanual\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...api,\n\t\t\t\t\t\t\tget<T>(token: import(\"@leitwerk-dev/process-sdk\").CapabilityToken<T>) {\n\t\t\t\t\t\t\t\tconst value = api.get(token);\n\t\t\t\t\t\t\t\treturn token === coreHostCapabilities.serverSetup && value && !Array.isArray(value)\n\t\t\t\t\t\t\t\t\t? ({\n\t\t\t\t\t\t\t\t\t\t\t...value,\n\t\t\t\t\t\t\t\t\t\t\tpolling: {\n\t\t\t\t\t\t\t\t\t\t\t\tcreate: ({ pollOnce }: { pollOnce: () => Promise<unknown> }) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\tpoll: pollOnce,\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t} as T)\n\t\t\t\t\t\t\t\t\t: value;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: api,\n\t\t\t);\n\t\t},\n\t\t/** @public */\n\t\tpoll() {\n\t\t\tif (!provider) throw new Error(`Test provider '${manifest.id}' has not been initialized`);\n\t\t\treturn provider.poll();\n\t\t},\n\t};\n}\n\n/** @internal */\nexport function createToolCollector(\n\twrites: ExternalWriteLogRepoLike = createInMemoryExternalWriteLog(),\n) {\n\tconst tools = new Map<string, IntegrationToolDefinition>();\n\tconst api = {\n\t\ttool: (tool: IntegrationToolDefinition) =>\n\t\t\ttools.set(tool.name, {\n\t\t\t\t...tool,\n\t\t\t\texecute: (ctx, args) =>\n\t\t\t\t\ttool.execute(\n\t\t\t\t\t\t{ ...ctx, externalWrites: bindExternalWrites(writes, ctx.process.id) },\n\t\t\t\t\t\targs,\n\t\t\t\t\t),\n\t\t\t}),\n\t} as unknown as ServerExtensionAPI;\n\treturn {\n\t\t/** @internal */\n\t\tapi,\n\t\t/** @internal */\n\t\ttools,\n\t};\n}\n\n/** @internal */\nexport interface InMemoryExternalWriteLog {\n\t/** @internal */\n\trecords: {\n\t\t/** @internal */\n\t\tdedupKey: string;\n\t}[];\n\t/** @internal */\n\thasDedupKey(key: string): boolean;\n\t/** @internal */\n\trecord(input: {\n\t\t/** @internal */\n\t\tdedupKey: string;\n\t}): {\n\t\t/** @internal */\n\t\tdedupKey: string;\n\t};\n\t/** @internal */\n\tgetDedupKeys(): ReadonlySet<string>;\n}\n\n/** @internal */\nexport function createInMemoryExternalWriteLog(): InMemoryExternalWriteLog {\n\tconst dedupKeys = new Set<string>();\n\tconst records: { dedupKey: string }[] = [];\n\treturn {\n\t\trecords,\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\trecords.push(input);\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\tpublications: {\n\t\t\tpublication: () => null,\n\t\t\tpublicationByExternalId: () => null,\n\t\t\treservePublication() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t\tfinishPublication() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t\treleaseRejectedPublication() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t\tmarkPublicationTriggered() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t},\n\t\tpolling: {\n\t\t\tcreate(options) {\n\t\t\t\treturn { poll: options.pollOnce };\n\t\t\t},\n\t\t},\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\tapplyProcessObservation: async () => ({ ok: true, process: null }),\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\tretryStartupAutomatically: 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\tresolveUiLauncherPreview: 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\tlaunchRuns: {\n\t\t\tasync startProgrammatic() {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t\tasync startWatcher() {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t},\n\t};\n}\n\n/** @public */\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\tlaunchRuns: { ...defaults.launchRuns, ...overrides.launchRuns },\n\t};\n}\n\n/** @internal */\nexport interface ServerExtensionTestHarness {\n\t/** @internal */\n\tcatalog: ExtensionCatalog;\n\t/** @internal */\n\tevents: ReturnType<typeof createEventBus>;\n\t/** @internal */\n\tserverSetup: CoreServerSetupDeps;\n\t/** @internal */\n\tstartHooks: Array<() => void | Promise<void>>;\n\t/** @internal */\n\tstopHooks: Array<() => void | Promise<void>>;\n\t/** @internal */\n\tflushAsyncWork: typeof flushAsyncWork;\n}\n\n/** @internal */\nexport async function setupServerExtensionTest(input: {\n\t/** @internal */\n\tmodules: readonly LeitwerkExtensionModule[];\n\t/** @internal */\n\tprovidedCapabilities?: readonly ProvidedCapability[];\n\t/** @internal */\n\tserverSetup?: Partial<CoreServerSetupDeps>;\n\t/** @internal */\n\tonStart?: (handler: () => void | Promise<void>) => void;\n\t/** @internal */\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"],"mappings":";AAAA,SAAgC,6BAA6B;AAC7D,SAAS,wCAAwC;AACjD;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EAEC;AAAA,EACA;AAAA,EACA;AAAA,OAMM;AACP,SAAS,sBAAsB;AAKxB,SAAS,2BACf,UACA,OAOA,SAAS,OACR;AACD,MAAI;AACJ,SAAO;AAAA;AAAA,IAEN;AAAA;AAAA,IAEA,YAAY,KAAyB;AACpC,iBAAW;AAAA,QACV,SACG;AAAA,UACA,GAAG;AAAA,UACH,IAAO,OAA+D;AACrE,kBAAM,QAAQ,IAAI,IAAI,KAAK;AAC3B,mBAAO,UAAU,qBAAqB,eAAe,SAAS,CAAC,MAAM,QAAQ,KAAK,IAC9E;AAAA,cACD,GAAG;AAAA,cACH,SAAS;AAAA,gBACR,QAAQ,CAAC,EAAE,SAAS,OAA6C;AAAA,kBAChE,MAAM;AAAA,gBACP;AAAA,cACD;AAAA,YACD,IACC;AAAA,UACJ;AAAA,QACD,IACC;AAAA,MACJ;AAAA,IACD;AAAA;AAAA,IAEA,OAAO;AACN,UAAI,CAAC,SAAU,OAAM,IAAI,MAAM,kBAAkB,SAAS,EAAE,4BAA4B;AACxF,aAAO,SAAS,KAAK;AAAA,IACtB;AAAA,EACD;AACD;AAGO,SAAS,oBACf,SAAmC,+BAA+B,GACjE;AACD,QAAM,QAAQ,oBAAI,IAAuC;AACzD,QAAM,MAAM;AAAA,IACX,MAAM,CAAC,SACN,MAAM,IAAI,KAAK,MAAM;AAAA,MACpB,GAAG;AAAA,MACH,SAAS,C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AAS,QAAQ,GAAG,UAAU,OAAO;AAAA,IAClD,aAAa,EAAE,GAAG,SAAS,aAAa,GAAG,UAAU,YAAY;AAAA,IACjE,UAAU,EAAE,GAAG,SAAS,UAAU,GAAG,UAAU,SAAS;AAAA,IACxD,gBAAgB,EAAE,GAAG,SAAS,gBAAgB,GAAG,UAAU,eAAe;AAAA,IAC1E,iBAAiB,EAAE,GAAG,SAAS,iBAAiB,GAAG,UAAU,gBAAgB;AAAA,IAC7E,iBAAiB,EAAE,GAAG,SAAS,iBAAiB,GAAG,UAAU,gBAAgB;AAAA,IAC7E,sBAAsB;AAAA,MACrB,GAAG,SAAS;AAAA,MACZ,GAAG,UAAU;AAAA,IACd;AAAA,IACA,sBAAsB;AAAA,MACrB,GAAG,SAAS;AAAA,MACZ,GAAG,UAAU;AAAA,IACd;AAAA,IACA,aAAa,EAAE,GAAG,SAAS,aAAa,GAAG,UAAU,YAAY;AAAA,IACjE,YAAY,EAAE,GAAG,SAAS,YAAY,GAAG,UAAU,WAAW;AAAA,EAC/D;AACD;","names":[]}
@@ -0,0 +1,4 @@
1
+ import type { DashboardResponseBody } from "@leitwerk-dev/protocol/http-contracts";
2
+ /** Representative server-ordered dashboard data, fresh for each test. @internal */
3
+ export declare function createDashboardFixture(): DashboardResponseBody;
4
+ //# sourceMappingURL=dashboard-fixture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-fixture.d.ts","sourceRoot":"","sources":["../src/dashboard-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAEnF,mFAAmF;AACnF,wBAAgB,sBAAsB,IAAI,qBAAqB,CA2F9D"}
@@ -1,4 +1,5 @@
1
1
  export { createCompactProcessDetailFixtureFactory } from "./compact-process-detail-fixture.js";
2
+ export { createDashboardFixture } from "./dashboard-fixture.js";
2
3
  export { createProcessFixture, createProjectFixture, type ProcessFixtureOptions, type ProcessFixturePosition, type ProjectFixtureOptions, } from "./process-fixtures.js";
3
4
  export { createTestQuestion, createTestQuestionRequest } from "./question-fixtures.js";
4
5
  export { createQuestionFixture, createQuestionRequestFixture, type QuestionFixture, type QuestionFixtureOptions, type QuestionFixtureResolution, type QuestionRequestFixture, type QuestionRequestFixtureOptions, } from "./supported-question-fixtures.js";
@@ -1 +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,EACN,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GAClC,MAAM,kCAAkC,CAAC"}
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,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACN,oBAAoB,EACpB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACvF,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GAClC,MAAM,kCAAkC,CAAC"}
package/dist/fixtures.js CHANGED
@@ -109,6 +109,100 @@ function createCompactProcessDetailFixtureFactory() {
109
109
  };
110
110
  }
111
111
 
112
+ // src/dashboard-fixture.ts
113
+ function createDashboardFixture() {
114
+ return {
115
+ generatedAt: "2026-10-14T10:30:00.000Z",
116
+ definitions: {
117
+ total: 4,
118
+ items: [
119
+ { id: "smoke", name: "Kubernetes Smoke" },
120
+ { id: "poem_creator_process", name: "Poem Creator" },
121
+ { id: "repo_change", name: "Repository Change" },
122
+ { id: "single_prompt_process", name: "Single Prompt" }
123
+ ]
124
+ },
125
+ watchers: {
126
+ total: 4,
127
+ enabled: 3,
128
+ items: [
129
+ { id: "paused", name: "Paused trigger", enabled: false },
130
+ { id: "poem", name: "Poem file", enabled: true },
131
+ { id: "repo", name: "Repository issues", enabled: true },
132
+ { id: "schedule", name: "Scheduled checks", enabled: true }
133
+ ]
134
+ },
135
+ skills: { total: 9, installed: 4, bundled: 5 },
136
+ processes: {
137
+ total: 27,
138
+ byStatus: [
139
+ { status: "running", count: 3 },
140
+ { status: "waiting", count: 5 },
141
+ { status: "error", count: 2 },
142
+ { status: "completed", count: 16 },
143
+ { status: "aborted", count: 1 }
144
+ ],
145
+ byDefinition: [
146
+ { processId: "single_prompt_process", name: "Single Prompt", count: 14 },
147
+ { processId: "poem_creator_process", name: "Poem Creator", count: 8 },
148
+ { processId: "repo_change", name: "Repository Change", count: 5 }
149
+ ]
150
+ },
151
+ costs: {
152
+ totalUsd: 8.4,
153
+ totalLlmTurnCount: 65,
154
+ pricedTurnCount: 60,
155
+ missingCostTurnCount: 5,
156
+ isPartial: true,
157
+ byModel: [
158
+ "gpt-6.1",
159
+ "gpt-6",
160
+ "gpt-6-mini",
161
+ "claude-sonnet",
162
+ "claude-haiku",
163
+ "historical-model"
164
+ ].map((modelId, index) => ({
165
+ providerId: index < 3 ? "openai" : "anthropic",
166
+ modelId,
167
+ costUsd: (6 - index) * 0.4,
168
+ turnCount: 10
169
+ }))
170
+ },
171
+ configuration: {
172
+ issues: [
173
+ {
174
+ id: "credential",
175
+ code: "missing_credential",
176
+ severity: "error",
177
+ message: "The review model profile needs a provider credential.",
178
+ sources: [{ label: "Review model", href: "/settings" }]
179
+ },
180
+ {
181
+ id: "default",
182
+ code: "missing_default",
183
+ severity: "warning",
184
+ message: "Repository Change has no default model profile.",
185
+ sources: [{ label: "Repository Change", href: "/settings" }]
186
+ },
187
+ {
188
+ id: "unavailable",
189
+ code: "unavailable_model",
190
+ severity: "error",
191
+ message: "A configured model is unavailable from its provider.",
192
+ sources: [{ label: "Model catalog", href: "/settings" }]
193
+ },
194
+ {
195
+ id: "override",
196
+ code: "invalid_override",
197
+ severity: "warning",
198
+ message: "A turn override references a removed model profile.",
199
+ sources: [{ label: "Turn settings", href: "/settings" }]
200
+ }
201
+ ]
202
+ }
203
+ };
204
+ }
205
+
112
206
  // src/question-fixtures.ts
113
207
  function createTestQuestion(overrides = {}) {
114
208
  return {
@@ -181,6 +275,7 @@ function createQuestionRequestFixture(options = {}) {
181
275
  }
182
276
  export {
183
277
  createCompactProcessDetailFixtureFactory,
278
+ createDashboardFixture,
184
279
  createProcessFixture,
185
280
  createProjectFixture,
186
281
  createQuestionFixture,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compact-process-detail-fixture.ts","../src/question-fixtures.ts","../src/supported-question-fixtures.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 PrimaryPathSnapshot,\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 = Omit<ProcessDetailUiSnapshotResponseBody, \"primaryPath\"> & {\n\tprimaryPath: PrimaryPathSnapshot;\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\n/** @internal */\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\tliveTurnRecordId: string | null;\n\t\t}\n\t>();\n\n\t/** @internal */\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 active = legacy.primaryPath.turnState.activeTurn;\n\t\tif (active)\n\t\t\ttraceIndex[active.turnRecordId] = {\n\t\t\t\t...EMPTY_TRACE,\n\t\t\t\t...traceIndex[active.turnRecordId],\n\t\t\t\tassistant: active.assistant,\n\t\t\t\ttraceItems: active.traceItems,\n\t\t\t\tusage: active.usage,\n\t\t\t\ttoolCalls: active.toolCalls.map(({ result, ...tool }) => ({\n\t\t\t\t\t...tool,\n\t\t\t\t\tresultText:\n\t\t\t\t\t\ttypeof result === \"string\" ? result : result == null ? null : JSON.stringify(result),\n\t\t\t\t\ttruncated: false,\n\t\t\t\t})),\n\t\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\ttoolApprovalRequests: [],\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\tsessionTransfer: null,\n\t\t};\n\t\treasoningSourceByInstanceId.set(projections.process.id, {\n\t\t\tsignature,\n\t\t\ttraceIndex,\n\t\t\tliveTurnRecordId: active?.turnRecordId ?? null,\n\t\t});\n\t\treturn compactDetail;\n\t}\n\n\t/** @internal */\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\tstate: source?.liveTurnRecordId === turnRecordId ? \"live\" : \"committed\",\n\t\t\tthroughEventSequence: 0,\n\t\t\tsessionSignature: source?.signature ?? null,\n\t\t\treasoning: source?.traceIndex[turnRecordId] ?? EMPTY_TRACE,\n\t\t};\n\t}\n\n\treturn {\n\t\t/** @internal */\n\t\tcompact,\n\t\t/** @internal */\n\t\treasoningResponse,\n\t};\n}\n","import type { NormalizedQuestion, ProcessQuestionRequest } from \"@leitwerk-dev/domain\";\n\n/** @internal */\nexport function createTestQuestion(\n\toverrides: Partial<NormalizedQuestion> = {},\n): NormalizedQuestion {\n\treturn {\n\t\tid: \"question_1\",\n\t\tquestion: \"Choose a strategy\",\n\t\tselection: \"single\",\n\t\toptions: [{ id: \"question_1_option_1\", label: \"Safe\", details: \"Small change\" }],\n\t\t...overrides,\n\t};\n}\n\n/** @internal */\nexport function createTestQuestionRequest(\n\toverrides: Partial<ProcessQuestionRequest> = {},\n): ProcessQuestionRequest {\n\treturn {\n\t\tid: \"qst_1\",\n\t\tinstanceId: \"agt_1\",\n\t\tturnRecordId: \"trn_1\",\n\t\ttoolCallId: \"tool_1\",\n\t\tquestions: [createTestQuestion()],\n\t\tstatus: \"open\",\n\t\tanswers: null,\n\t\taskedAt: \"2026-01-01T00:00:00.000Z\",\n\t\tansweredAt: null,\n\t\tansweredBy: null,\n\t\tcancelledAt: null,\n\t\t...overrides,\n\t};\n}\n","import { type Actor, normalizeAskQuestionsInput } from \"@leitwerk-dev/domain\";\n\n/** A normalized question with stable option identities. @public */\nexport interface QuestionFixture {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tquestion: string;\n\t/** @public */\n\tselection: \"single\" | \"multiple\";\n\t/** @public */\n\toptions: readonly {\n\t\t/** @public */\n\t\tid: string;\n\t\t/** @public */\n\t\tlabel: string;\n\t\t/** @public */\n\t\tdetails: string | null;\n\t}[];\n}\n\n/** Correlated question request data without persistence access. @public */\nexport interface QuestionRequestFixture {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tinstanceId: string;\n\t/** @public */\n\tturnRecordId: string;\n\t/** @public */\n\ttoolCallId: string;\n\t/** @public */\n\tquestions: readonly QuestionFixture[];\n\t/** @public */\n\tstatus: \"open\" | \"answered\" | \"cancelled\";\n\t/** @public */\n\tanswers: readonly string[] | null;\n\t/** @public */\n\taskedAt: string;\n\t/** @public */\n\tansweredAt: string | null;\n\t/** @public */\n\tansweredBy: Actor | null;\n\t/** @public */\n\tcancelledAt: string | null;\n}\n\n/** Question content with generated stable option identities. @public */\nexport interface QuestionFixtureOptions {\n\t/** @public */\n\tquestion?: string;\n\t/** @public */\n\tselection?: \"single\" | \"multiple\";\n\t/** @public */\n\toptions?: readonly {\n\t\t/** @public */\n\t\tlabel: string;\n\t\t/** @public */\n\t\tdetails?: string | null;\n\t}[];\n}\n\n/** Normalize content using the application's question contract. @public */\nexport function createQuestionFixture(options: QuestionFixtureOptions = {}): QuestionFixture {\n\tconst [question] = normalizeAskQuestionsInput({\n\t\tquestions: [\n\t\t\t{\n\t\t\t\tquestion: options.question ?? \"Choose a strategy\",\n\t\t\t\tselection: options.selection ?? \"single\",\n\t\t\t\toptions: options.options ?? [{ label: \"Safe\", details: \"Small change\" }],\n\t\t\t},\n\t\t],\n\t});\n\tif (!question) throw new Error(\"Question normalization returned no question\");\n\treturn question;\n}\n\n/** Resolution determines status and all resolution timestamps. @public */\nexport type QuestionFixtureResolution =\n\t| {\n\t\t\t/** @public */\n\t\t\tstatus: \"answered\";\n\t\t\t/** @public */\n\t\t\tanswers: readonly string[];\n\t\t\t/** @public */\n\t\t\tactor?: Actor;\n\t }\n\t| {\n\t\t\t/** @public */\n\t\t\tstatus: \"cancelled\";\n\t };\n\n/** Reference inputs and question content, without durable status overrides. @public */\nexport interface QuestionRequestFixtureOptions {\n\t/** @public */\n\tid?: string;\n\t/** @public */\n\tprocess?: {\n\t\t/** @public */\n\t\tid: string;\n\t};\n\t/** @public */\n\tturn?: {\n\t\t/** @public */\n\t\tid: string;\n\t\t/** @public */\n\t\tinstanceId: string;\n\t};\n\t/** @public */\n\tquestions?: readonly QuestionFixtureOptions[];\n\t/** @public */\n\tresolution?: QuestionFixtureResolution;\n}\n\n/** Create a consistent request; reject conflicting process and turn references. @public */\nexport function createQuestionRequestFixture(\n\toptions: QuestionRequestFixtureOptions = {},\n): QuestionRequestFixture {\n\tconst instanceId = options.process?.id ?? options.turn?.instanceId ?? \"agt_test\";\n\tif (options.turn && options.turn.instanceId !== instanceId)\n\t\tthrow new Error(\"Question turn belongs to another process\");\n\tconst questions = normalizeAskQuestionsInput({\n\t\tquestions: (options.questions ?? [{}]).map((q) => ({\n\t\t\tquestion: q.question ?? \"Choose a strategy\",\n\t\t\tselection: q.selection ?? \"single\",\n\t\t\toptions: q.options ?? [{ label: \"Safe\" }],\n\t\t})),\n\t});\n\tconst resolution = options.resolution;\n\tif (resolution?.status === \"answered\" && resolution.answers.length !== questions.length)\n\t\tthrow new Error(\"Supply one answer per question\");\n\treturn {\n\t\tid: options.id ?? \"qst_test\",\n\t\tinstanceId,\n\t\tturnRecordId: options.turn?.id ?? \"trn_test\",\n\t\ttoolCallId: \"tool_test\",\n\t\tquestions,\n\t\tstatus: resolution?.status ?? \"open\",\n\t\taskedAt: \"2026-01-01T00:00:00.000Z\",\n\t\tanswers: resolution?.status === \"answered\" ? [...resolution.answers] : null,\n\t\tansweredAt: resolution?.status === \"answered\" ? \"2026-01-01T00:00:01.000Z\" : null,\n\t\tansweredBy:\n\t\t\tresolution?.status === \"answered\"\n\t\t\t\t? structuredClone(resolution.actor ?? { id: \"test-user\", kind: \"user\", provider: null })\n\t\t\t\t: null,\n\t\tcancelledAt: resolution?.status === \"cancelled\" ? \"2026-01-01T00:00:01.000Z\" : null,\n\t};\n}\n"],"mappings":";;;;;;AASA;AAAA,EACC;AAAA,OAMM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AAcP,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;AAGO,SAAS,2CAA2C;AAC1D,QAAM,8BAA8B,oBAAI,IAOtC;AAGF,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;AAAA,MACpB,QAAQ,OAAO;AAAA,IAChB,CAAC;AACD,UAAM,SAAS,OAAO,YAAY,UAAU;AAC5C,QAAI;AACH,iBAAW,OAAO,YAAY,IAAI;AAAA,QACjC,GAAG;AAAA,QACH,GAAG,WAAW,OAAO,YAAY;AAAA,QACjC,WAAW,OAAO;AAAA,QAClB,YAAY,OAAO;AAAA,QACnB,OAAO,OAAO;AAAA,QACd,WAAW,OAAO,UAAU,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,OAAO;AAAA,UACzD,GAAG;AAAA,UACH,YACC,OAAO,W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,QAAQ,KAAK,eAAe;AAC/C,UAAM,IAAI,MAAM,0CAA0C;AAC3D,QAAM,YAAY,2BAA2B;AAAA,IAC5C,YAAY,QAAQ,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO;AAAA,MAClD,UAAU,EAAE,YAAY;AAAA,MACxB,WAAW,EAAE,aAAa;AAAA,MAC1B,SAAS,EAAE,WAAW,CAAC,EAAE,OAAO,OAAO,CAAC;AAAA,IACzC,EAAE;AAAA,EACH,CAAC;AACD,QAAM,aAAa,QAAQ;AAC3B,MAAI,YAAY,WAAW,cAAc,WAAW,QAAQ,WAAW,UAAU;AAChF,UAAM,IAAI,MAAM,gCAAgC;AACjD,SAAO;AAAA,IACN,IAAI,QAAQ,MAAM;AAAA,IAClB;AAAA,IACA,cAAc,QAAQ,MAAM,MAAM;AAAA,IAClC,YAAY;AAAA,IACZ;AAAA,IACA,QAAQ,YAAY,UAAU;AAAA,IAC9B,SAAS;AAAA,IACT,SAAS,YAAY,WAAW,aAAa,CAAC,GAAG,WAAW,OAAO,IAAI;AAAA,IACvE,YAAY,YAAY,WAAW,aAAa,6BAA6B;AAAA,IAC7E,YACC,YAAY,WAAW,aACpB,gBAAgB,WAAW,SAAS,EAAE,IAAI,aAAa,MAAM,QAAQ,UAAU,KAAK,CAAC,IACrF;AAAA,IACJ,aAAa,YAAY,WAAW,cAAc,6BAA6B;AAAA,EAChF;AACD;","names":[]}
1
+ {"version":3,"sources":["../src/compact-process-detail-fixture.ts","../src/dashboard-fixture.ts","../src/question-fixtures.ts","../src/supported-question-fixtures.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 PrimaryPathSnapshot,\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 = Omit<ProcessDetailUiSnapshotResponseBody, \"primaryPath\"> & {\n\tprimaryPath: PrimaryPathSnapshot;\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\n/** @internal */\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\tliveTurnRecordId: string | null;\n\t\t}\n\t>();\n\n\t/** @internal */\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 active = legacy.primaryPath.turnState.activeTurn;\n\t\tif (active)\n\t\t\ttraceIndex[active.turnRecordId] = {\n\t\t\t\t...EMPTY_TRACE,\n\t\t\t\t...traceIndex[active.turnRecordId],\n\t\t\t\tassistant: active.assistant,\n\t\t\t\ttraceItems: active.traceItems,\n\t\t\t\tusage: active.usage,\n\t\t\t\ttoolCalls: active.toolCalls.map(({ result, ...tool }) => ({\n\t\t\t\t\t...tool,\n\t\t\t\t\tresultText:\n\t\t\t\t\t\ttypeof result === \"string\" ? result : result == null ? null : JSON.stringify(result),\n\t\t\t\t\ttruncated: false,\n\t\t\t\t})),\n\t\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\ttoolApprovalRequests: [],\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\tsessionTransfer: null,\n\t\t};\n\t\treasoningSourceByInstanceId.set(projections.process.id, {\n\t\t\tsignature,\n\t\t\ttraceIndex,\n\t\t\tliveTurnRecordId: active?.turnRecordId ?? null,\n\t\t});\n\t\treturn compactDetail;\n\t}\n\n\t/** @internal */\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\tstate: source?.liveTurnRecordId === turnRecordId ? \"live\" : \"committed\",\n\t\t\tthroughEventSequence: 0,\n\t\t\tsessionSignature: source?.signature ?? null,\n\t\t\treasoning: source?.traceIndex[turnRecordId] ?? EMPTY_TRACE,\n\t\t};\n\t}\n\n\treturn {\n\t\t/** @internal */\n\t\tcompact,\n\t\t/** @internal */\n\t\treasoningResponse,\n\t};\n}\n","import type { DashboardResponseBody } from \"@leitwerk-dev/protocol/http-contracts\";\n\n/** Representative server-ordered dashboard data, fresh for each test. @internal */\nexport function createDashboardFixture(): DashboardResponseBody {\n\treturn {\n\t\tgeneratedAt: \"2026-10-14T10:30:00.000Z\",\n\t\tdefinitions: {\n\t\t\ttotal: 4,\n\t\t\titems: [\n\t\t\t\t{ id: \"smoke\", name: \"Kubernetes Smoke\" },\n\t\t\t\t{ id: \"poem_creator_process\", name: \"Poem Creator\" },\n\t\t\t\t{ id: \"repo_change\", name: \"Repository Change\" },\n\t\t\t\t{ id: \"single_prompt_process\", name: \"Single Prompt\" },\n\t\t\t],\n\t\t},\n\t\twatchers: {\n\t\t\ttotal: 4,\n\t\t\tenabled: 3,\n\t\t\titems: [\n\t\t\t\t{ id: \"paused\", name: \"Paused trigger\", enabled: false },\n\t\t\t\t{ id: \"poem\", name: \"Poem file\", enabled: true },\n\t\t\t\t{ id: \"repo\", name: \"Repository issues\", enabled: true },\n\t\t\t\t{ id: \"schedule\", name: \"Scheduled checks\", enabled: true },\n\t\t\t],\n\t\t},\n\t\tskills: { total: 9, installed: 4, bundled: 5 },\n\t\tprocesses: {\n\t\t\ttotal: 27,\n\t\t\tbyStatus: [\n\t\t\t\t{ status: \"running\", count: 3 },\n\t\t\t\t{ status: \"waiting\", count: 5 },\n\t\t\t\t{ status: \"error\", count: 2 },\n\t\t\t\t{ status: \"completed\", count: 16 },\n\t\t\t\t{ status: \"aborted\", count: 1 },\n\t\t\t],\n\t\t\tbyDefinition: [\n\t\t\t\t{ processId: \"single_prompt_process\", name: \"Single Prompt\", count: 14 },\n\t\t\t\t{ processId: \"poem_creator_process\", name: \"Poem Creator\", count: 8 },\n\t\t\t\t{ processId: \"repo_change\", name: \"Repository Change\", count: 5 },\n\t\t\t],\n\t\t},\n\t\tcosts: {\n\t\t\ttotalUsd: 8.4,\n\t\t\ttotalLlmTurnCount: 65,\n\t\t\tpricedTurnCount: 60,\n\t\t\tmissingCostTurnCount: 5,\n\t\t\tisPartial: true,\n\t\t\tbyModel: [\n\t\t\t\t\"gpt-6.1\",\n\t\t\t\t\"gpt-6\",\n\t\t\t\t\"gpt-6-mini\",\n\t\t\t\t\"claude-sonnet\",\n\t\t\t\t\"claude-haiku\",\n\t\t\t\t\"historical-model\",\n\t\t\t].map((modelId, index) => ({\n\t\t\t\tproviderId: index < 3 ? \"openai\" : \"anthropic\",\n\t\t\t\tmodelId,\n\t\t\t\tcostUsd: (6 - index) * 0.4,\n\t\t\t\tturnCount: 10,\n\t\t\t})),\n\t\t},\n\t\tconfiguration: {\n\t\t\tissues: [\n\t\t\t\t{\n\t\t\t\t\tid: \"credential\",\n\t\t\t\t\tcode: \"missing_credential\",\n\t\t\t\t\tseverity: \"error\",\n\t\t\t\t\tmessage: \"The review model profile needs a provider credential.\",\n\t\t\t\t\tsources: [{ label: \"Review model\", href: \"/settings\" }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"default\",\n\t\t\t\t\tcode: \"missing_default\",\n\t\t\t\t\tseverity: \"warning\",\n\t\t\t\t\tmessage: \"Repository Change has no default model profile.\",\n\t\t\t\t\tsources: [{ label: \"Repository Change\", href: \"/settings\" }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"unavailable\",\n\t\t\t\t\tcode: \"unavailable_model\",\n\t\t\t\t\tseverity: \"error\",\n\t\t\t\t\tmessage: \"A configured model is unavailable from its provider.\",\n\t\t\t\t\tsources: [{ label: \"Model catalog\", href: \"/settings\" }],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"override\",\n\t\t\t\t\tcode: \"invalid_override\",\n\t\t\t\t\tseverity: \"warning\",\n\t\t\t\t\tmessage: \"A turn override references a removed model profile.\",\n\t\t\t\t\tsources: [{ label: \"Turn settings\", href: \"/settings\" }],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n}\n","import type { NormalizedQuestion, ProcessQuestionRequest } from \"@leitwerk-dev/domain\";\n\n/** @internal */\nexport function createTestQuestion(\n\toverrides: Partial<NormalizedQuestion> = {},\n): NormalizedQuestion {\n\treturn {\n\t\tid: \"question_1\",\n\t\tquestion: \"Choose a strategy\",\n\t\tselection: \"single\",\n\t\toptions: [{ id: \"question_1_option_1\", label: \"Safe\", details: \"Small change\" }],\n\t\t...overrides,\n\t};\n}\n\n/** @internal */\nexport function createTestQuestionRequest(\n\toverrides: Partial<ProcessQuestionRequest> = {},\n): ProcessQuestionRequest {\n\treturn {\n\t\tid: \"qst_1\",\n\t\tinstanceId: \"agt_1\",\n\t\tturnRecordId: \"trn_1\",\n\t\ttoolCallId: \"tool_1\",\n\t\tquestions: [createTestQuestion()],\n\t\tstatus: \"open\",\n\t\tanswers: null,\n\t\taskedAt: \"2026-01-01T00:00:00.000Z\",\n\t\tansweredAt: null,\n\t\tansweredBy: null,\n\t\tcancelledAt: null,\n\t\t...overrides,\n\t};\n}\n","import { type Actor, normalizeAskQuestionsInput } from \"@leitwerk-dev/domain\";\n\n/** A normalized question with stable option identities. @public */\nexport interface QuestionFixture {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tquestion: string;\n\t/** @public */\n\tselection: \"single\" | \"multiple\";\n\t/** @public */\n\toptions: readonly {\n\t\t/** @public */\n\t\tid: string;\n\t\t/** @public */\n\t\tlabel: string;\n\t\t/** @public */\n\t\tdetails: string | null;\n\t}[];\n}\n\n/** Correlated question request data without persistence access. @public */\nexport interface QuestionRequestFixture {\n\t/** @public */\n\tid: string;\n\t/** @public */\n\tinstanceId: string;\n\t/** @public */\n\tturnRecordId: string;\n\t/** @public */\n\ttoolCallId: string;\n\t/** @public */\n\tquestions: readonly QuestionFixture[];\n\t/** @public */\n\tstatus: \"open\" | \"answered\" | \"cancelled\";\n\t/** @public */\n\tanswers: readonly string[] | null;\n\t/** @public */\n\taskedAt: string;\n\t/** @public */\n\tansweredAt: string | null;\n\t/** @public */\n\tansweredBy: Actor | null;\n\t/** @public */\n\tcancelledAt: string | null;\n}\n\n/** Question content with generated stable option identities. @public */\nexport interface QuestionFixtureOptions {\n\t/** @public */\n\tquestion?: string;\n\t/** @public */\n\tselection?: \"single\" | \"multiple\";\n\t/** @public */\n\toptions?: readonly {\n\t\t/** @public */\n\t\tlabel: string;\n\t\t/** @public */\n\t\tdetails?: string | null;\n\t}[];\n}\n\n/** Normalize content using the application's question contract. @public */\nexport function createQuestionFixture(options: QuestionFixtureOptions = {}): QuestionFixture {\n\tconst [question] = normalizeAskQuestionsInput({\n\t\tquestions: [\n\t\t\t{\n\t\t\t\tquestion: options.question ?? \"Choose a strategy\",\n\t\t\t\tselection: options.selection ?? \"single\",\n\t\t\t\toptions: options.options ?? [{ label: \"Safe\", details: \"Small change\" }],\n\t\t\t},\n\t\t],\n\t});\n\tif (!question) throw new Error(\"Question normalization returned no question\");\n\treturn question;\n}\n\n/** Resolution determines status and all resolution timestamps. @public */\nexport type QuestionFixtureResolution =\n\t| {\n\t\t\t/** @public */\n\t\t\tstatus: \"answered\";\n\t\t\t/** @public */\n\t\t\tanswers: readonly string[];\n\t\t\t/** @public */\n\t\t\tactor?: Actor;\n\t }\n\t| {\n\t\t\t/** @public */\n\t\t\tstatus: \"cancelled\";\n\t };\n\n/** Reference inputs and question content, without durable status overrides. @public */\nexport interface QuestionRequestFixtureOptions {\n\t/** @public */\n\tid?: string;\n\t/** @public */\n\tprocess?: {\n\t\t/** @public */\n\t\tid: string;\n\t};\n\t/** @public */\n\tturn?: {\n\t\t/** @public */\n\t\tid: string;\n\t\t/** @public */\n\t\tinstanceId: string;\n\t};\n\t/** @public */\n\tquestions?: readonly QuestionFixtureOptions[];\n\t/** @public */\n\tresolution?: QuestionFixtureResolution;\n}\n\n/** Create a consistent request; reject conflicting process and turn references. @public */\nexport function createQuestionRequestFixture(\n\toptions: QuestionRequestFixtureOptions = {},\n): QuestionRequestFixture {\n\tconst instanceId = options.process?.id ?? options.turn?.instanceId ?? \"agt_test\";\n\tif (options.turn && options.turn.instanceId !== instanceId)\n\t\tthrow new Error(\"Question turn belongs to another process\");\n\tconst questions = normalizeAskQuestionsInput({\n\t\tquestions: (options.questions ?? [{}]).map((q) => ({\n\t\t\tquestion: q.question ?? \"Choose a strategy\",\n\t\t\tselection: q.selection ?? \"single\",\n\t\t\toptions: q.options ?? [{ label: \"Safe\" }],\n\t\t})),\n\t});\n\tconst resolution = options.resolution;\n\tif (resolution?.status === \"answered\" && resolution.answers.length !== questions.length)\n\t\tthrow new Error(\"Supply one answer per question\");\n\treturn {\n\t\tid: options.id ?? \"qst_test\",\n\t\tinstanceId,\n\t\tturnRecordId: options.turn?.id ?? \"trn_test\",\n\t\ttoolCallId: \"tool_test\",\n\t\tquestions,\n\t\tstatus: resolution?.status ?? \"open\",\n\t\taskedAt: \"2026-01-01T00:00:00.000Z\",\n\t\tanswers: resolution?.status === \"answered\" ? [...resolution.answers] : null,\n\t\tansweredAt: resolution?.status === \"answered\" ? \"2026-01-01T00:00:01.000Z\" : null,\n\t\tansweredBy:\n\t\t\tresolution?.status === \"answered\"\n\t\t\t\t? structuredClone(resolution.actor ?? { id: \"test-user\", kind: \"user\", provider: null })\n\t\t\t\t: null,\n\t\tcancelledAt: resolution?.status === \"cancelled\" ? \"2026-01-01T00:00:01.000Z\" : null,\n\t};\n}\n"],"mappings":";;;;;;AASA;AAAA,EACC;AAAA,OAMM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OAEM;AAcP,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;AAGO,SAAS,2CAA2C;AAC1D,QAAM,8BAA8B,oBAAI,IAOtC;AAGF,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;AAAA,MACpB,QAAQ,OAAO;AAAA,IAChB,CAAC;AACD,UAAM,SAAS,OAAO,YAAY,UAAU;AAC5C,QAAI;AACH,iBAAW,OAAO,YAAY,IAAI;AAAA,QACjC,GAAG;AAAA,QACH,GAAG,WAAW,OAAO,YAAY;AAAA,QACjC,WAAW,OAAO;AAAA,QAClB,YAAY,OAAO;AAAA,QACnB,OAAO,OAAO;AAAA,QACd,WAAW,OAAO,UAAU,IAAI,CAAC,EAAE,QAAQ,G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AAE,YAAY;AAAA,MACxB,WAAW,EAAE,aAAa;AAAA,MAC1B,SAAS,EAAE,WAAW,CAAC,EAAE,OAAO,OAAO,CAAC;AAAA,IACzC,EAAE;AAAA,EACH,CAAC;AACD,QAAM,aAAa,QAAQ;AAC3B,MAAI,YAAY,WAAW,cAAc,WAAW,QAAQ,WAAW,UAAU;AAChF,UAAM,IAAI,MAAM,gCAAgC;AACjD,SAAO;AAAA,IACN,IAAI,QAAQ,MAAM;AAAA,IAClB;AAAA,IACA,cAAc,QAAQ,MAAM,MAAM;AAAA,IAClC,YAAY;AAAA,IACZ;AAAA,IACA,QAAQ,YAAY,UAAU;AAAA,IAC9B,SAAS;AAAA,IACT,SAAS,YAAY,WAAW,aAAa,CAAC,GAAG,WAAW,OAAO,IAAI;AAAA,IACvE,YAAY,YAAY,WAAW,aAAa,6BAA6B;AAAA,IAC7E,YACC,YAAY,WAAW,aACpB,gBAAgB,WAAW,SAAS,EAAE,IAAI,aAAa,MAAM,QAAQ,UAAU,KAAK,CAAC,IACrF;AAAA,IACJ,aAAa,YAAY,WAAW,cAAc,6BAA6B;AAAA,EAChF;AACD;","names":[]}
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  createPollingTestExtension,
11
11
  createTestServerSetupCapability,
12
12
  createToolCollector
13
- } from "./chunk-DNUGHAYN.js";
13
+ } from "./chunk-RRE5BNSZ.js";
14
14
  import {
15
15
  FakeLlmProvider
16
16
  } from "./chunk-EXHTWQAE.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-RY6Y6V5E.js";
11
11
  import {
12
12
  createTestServerSetupCapability
13
- } from "./chunk-DNUGHAYN.js";
13
+ } from "./chunk-RRE5BNSZ.js";
14
14
  import {
15
15
  createInProcessWorkerSpawn
16
16
  } from "./chunk-3RWI5WJK.js";
package/dist/process.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-RY6Y6V5E.js";
7
7
  import {
8
8
  createTestServerSetupCapability
9
- } from "./chunk-DNUGHAYN.js";
9
+ } from "./chunk-RRE5BNSZ.js";
10
10
 
11
11
  // src/process.ts
12
12
  import { bindExternalWrites } from "@leitwerk-dev/external-writes/internal";
@@ -1 +1 @@
1
- {"version":3,"file":"server-extension-test-harness.d.ts","sourceRoot":"","sources":["../src/server-extension-test-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAyB,MAAM,iCAAiC,CAAC;AAE/F,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,KAAK,mBAAmB,EAGxB,cAAc,EACd,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,4FAA4F;AAC5F,wBAAgB,0BAA0B,CAAC,CAAC,EAC3C,QAAQ,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAC7C,KAAK,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAC5B;IACA,gBAAgB;IAChB,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClB,GACD,SAAS;AACZ,8EAA8E;AAC9E,MAAM,UAAQ;IAIb,gBAAgB;;;;;;;;;;;IAEhB,gBAAgB;qBACC,kBAAkB;IAsBnC,cAAc;;EAMf;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAClC,MAAM,GAAE,wBAA2D;IAelE,gBAAgB;;IAEhB,gBAAgB;;EAGjB;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAwB;IACxC,gBAAgB;IAChB,OAAO,EAAE;QACR,gBAAgB;QAChB,QAAQ,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,gBAAgB;IAChB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;I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B;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACvD,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAsCtC"}
1
+ {"version":3,"file":"server-extension-test-harness.d.ts","sourceRoot":"","sources":["../src/server-extension-test-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAyB,MAAM,iCAAiC,CAAC;AAE/F,OAAO,EAEN,KAAK,wBAAwB,EAC7B,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACN,KAAK,mBAAmB,EAGxB,cAAc,EACd,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,4FAA4F;AAC5F,wBAAgB,0BAA0B,CAAC,CAAC,EAC3C,QAAQ,EAAE,uBAAuB,CAAC,UAAU,CAAC,EAC7C,KAAK,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAC5B;IACA,gBAAgB;IAChB,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;CAClB,GACD,SAAS;AACZ,8EAA8E;AAC9E,MAAM,UAAQ;IAIb,gBAAgB;;;;;;;;;;;IAEhB,gBAAgB;qBACC,kBAAkB;IAsBnC,cAAc;;EAMf;AAED,gBAAgB;AAChB,wBAAgB,mBAAmB,CAClC,MAAM,GAAE,wBAA2D;IAelE,gBAAgB;;IAEhB,gBAAgB;;EAGjB;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAwB;IACxC,gBAAgB;IAChB,OAAO,EAAE;QACR,gBAAgB;QAChB,QAAQ,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,gBAAgB;IAChB,WAAW,CAAC,GAAG,EAAE,MAAM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I,CAAC;IACxD,gBAAgB;IAChB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACvD,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAsCtC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leitwerk-dev/test-support",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/leitwerk-dev/leitwerk.git",
@@ -49,14 +49,14 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@earendil-works/pi-coding-agent": "^0.87.0",
52
- "@leitwerk-dev/domain": "0.4.0",
53
- "@leitwerk-dev/extension-runtime": "0.4.0",
54
- "@leitwerk-dev/process-sdk": "0.4.0",
55
- "@leitwerk-dev/protocol": "0.4.0",
56
- "@leitwerk-dev/server": "0.4.0",
57
- "@leitwerk-dev/worker": "0.4.0",
58
- "@leitwerk-dev/worker-protocol": "0.4.0",
59
- "@leitwerk-dev/external-writes": "0.4.0"
52
+ "@leitwerk-dev/domain": "0.4.2",
53
+ "@leitwerk-dev/extension-runtime": "0.4.2",
54
+ "@leitwerk-dev/process-sdk": "0.4.2",
55
+ "@leitwerk-dev/protocol": "0.4.2",
56
+ "@leitwerk-dev/server": "0.4.2",
57
+ "@leitwerk-dev/worker": "0.4.2",
58
+ "@leitwerk-dev/worker-protocol": "0.4.2",
59
+ "@leitwerk-dev/external-writes": "0.4.2"
60
60
  },
61
61
  "devDependencies": {
62
62
  "tsup": "^8.5.1"
@@ -0,0 +1,95 @@
1
+ import type { DashboardResponseBody } from "@leitwerk-dev/protocol/http-contracts";
2
+
3
+ /** Representative server-ordered dashboard data, fresh for each test. @internal */
4
+ export function createDashboardFixture(): DashboardResponseBody {
5
+ return {
6
+ generatedAt: "2026-10-14T10:30:00.000Z",
7
+ definitions: {
8
+ total: 4,
9
+ items: [
10
+ { id: "smoke", name: "Kubernetes Smoke" },
11
+ { id: "poem_creator_process", name: "Poem Creator" },
12
+ { id: "repo_change", name: "Repository Change" },
13
+ { id: "single_prompt_process", name: "Single Prompt" },
14
+ ],
15
+ },
16
+ watchers: {
17
+ total: 4,
18
+ enabled: 3,
19
+ items: [
20
+ { id: "paused", name: "Paused trigger", enabled: false },
21
+ { id: "poem", name: "Poem file", enabled: true },
22
+ { id: "repo", name: "Repository issues", enabled: true },
23
+ { id: "schedule", name: "Scheduled checks", enabled: true },
24
+ ],
25
+ },
26
+ skills: { total: 9, installed: 4, bundled: 5 },
27
+ processes: {
28
+ total: 27,
29
+ byStatus: [
30
+ { status: "running", count: 3 },
31
+ { status: "waiting", count: 5 },
32
+ { status: "error", count: 2 },
33
+ { status: "completed", count: 16 },
34
+ { status: "aborted", count: 1 },
35
+ ],
36
+ byDefinition: [
37
+ { processId: "single_prompt_process", name: "Single Prompt", count: 14 },
38
+ { processId: "poem_creator_process", name: "Poem Creator", count: 8 },
39
+ { processId: "repo_change", name: "Repository Change", count: 5 },
40
+ ],
41
+ },
42
+ costs: {
43
+ totalUsd: 8.4,
44
+ totalLlmTurnCount: 65,
45
+ pricedTurnCount: 60,
46
+ missingCostTurnCount: 5,
47
+ isPartial: true,
48
+ byModel: [
49
+ "gpt-6.1",
50
+ "gpt-6",
51
+ "gpt-6-mini",
52
+ "claude-sonnet",
53
+ "claude-haiku",
54
+ "historical-model",
55
+ ].map((modelId, index) => ({
56
+ providerId: index < 3 ? "openai" : "anthropic",
57
+ modelId,
58
+ costUsd: (6 - index) * 0.4,
59
+ turnCount: 10,
60
+ })),
61
+ },
62
+ configuration: {
63
+ issues: [
64
+ {
65
+ id: "credential",
66
+ code: "missing_credential",
67
+ severity: "error",
68
+ message: "The review model profile needs a provider credential.",
69
+ sources: [{ label: "Review model", href: "/settings" }],
70
+ },
71
+ {
72
+ id: "default",
73
+ code: "missing_default",
74
+ severity: "warning",
75
+ message: "Repository Change has no default model profile.",
76
+ sources: [{ label: "Repository Change", href: "/settings" }],
77
+ },
78
+ {
79
+ id: "unavailable",
80
+ code: "unavailable_model",
81
+ severity: "error",
82
+ message: "A configured model is unavailable from its provider.",
83
+ sources: [{ label: "Model catalog", href: "/settings" }],
84
+ },
85
+ {
86
+ id: "override",
87
+ code: "invalid_override",
88
+ severity: "warning",
89
+ message: "A turn override references a removed model profile.",
90
+ sources: [{ label: "Turn settings", href: "/settings" }],
91
+ },
92
+ ],
93
+ },
94
+ };
95
+ }
package/src/fixtures.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { createCompactProcessDetailFixtureFactory } from "./compact-process-detail-fixture.js";
2
+ export { createDashboardFixture } from "./dashboard-fixture.js";
2
3
  export {
3
4
  createProcessFixture,
4
5
  createProjectFixture,
@@ -192,6 +192,7 @@ function createDefaultServerSetupDeps(): CoreServerSetupDeps {
192
192
  startProcess: async () => ({ ok: true, process: null }),
193
193
  abortProcess: async () => ({ ok: true, process: null }),
194
194
  retryProcess: async () => ({ ok: true, process: null }),
195
+ retryStartupAutomatically: async () => ({ ok: true, process: null }),
195
196
  continueFailedTurn: async () => ({ ok: true, process: null }),
196
197
  queueInputs: async () => ({ ok: true, process: null }),
197
198
  },
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/server-extension-test-harness.ts"],"sourcesContent":["import { type ExtensionCatalog, setupServerExtensions } from \"@leitwerk-dev/extension-runtime\";\nimport { buildExtensionCatalogFromModules } from \"@leitwerk-dev/extension-runtime/testing\";\nimport {\n\tbindExternalWrites,\n\ttype ExternalWriteLogRepoLike,\n} from \"@leitwerk-dev/external-writes/internal\";\nimport {\n\ttype CoreServerSetupDeps,\n\tcoreHostCapabilities,\n\tcreateCapabilityAccessor,\n\tcreateEventBus,\n\ttype IntegrationToolDefinition,\n\ttype LeitwerkExtensionModule,\n\ttype ProvidedCapability,\n\ttype ServerExtensionAPI,\n\ttype ServerExtensionEventMap,\n} from \"@leitwerk-dev/process-sdk\";\nimport { flushAsyncWork } from \"@leitwerk-dev/worker-protocol\";\n\nexport { flushAsyncWork };\n\n/** Register a test provider and expose its poll result without erasing its type. @public */\nexport function createPollingTestExtension<T>(\n\tmanifest: LeitwerkExtensionModule[\"manifest\"],\n\tsetup: (api: ServerExtensionAPI) =>\n\t\t| {\n\t\t\t\t/** @internal */\n\t\t\t\tpoll(): Promise<T>;\n\t\t }\n\t\t| undefined,\n\t/** Disable scheduled polling so tests control every observation. @internal */\n\tmanual = false,\n) {\n\tlet provider: ReturnType<typeof setup>;\n\treturn {\n\t\t/** @internal */\n\t\tmanifest,\n\t\t/** @internal */\n\t\tsetupServer(api: ServerExtensionAPI) {\n\t\t\tprovider = setup(\n\t\t\t\tmanual\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...api,\n\t\t\t\t\t\t\tget<T>(token: import(\"@leitwerk-dev/process-sdk\").CapabilityToken<T>) {\n\t\t\t\t\t\t\t\tconst value = api.get(token);\n\t\t\t\t\t\t\t\treturn token === coreHostCapabilities.serverSetup && value && !Array.isArray(value)\n\t\t\t\t\t\t\t\t\t? ({\n\t\t\t\t\t\t\t\t\t\t\t...value,\n\t\t\t\t\t\t\t\t\t\t\tpolling: {\n\t\t\t\t\t\t\t\t\t\t\t\tcreate: ({ pollOnce }: { pollOnce: () => Promise<unknown> }) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\tpoll: pollOnce,\n\t\t\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t} as T)\n\t\t\t\t\t\t\t\t\t: value;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: api,\n\t\t\t);\n\t\t},\n\t\t/** @public */\n\t\tpoll() {\n\t\t\tif (!provider) throw new Error(`Test provider '${manifest.id}' has not been initialized`);\n\t\t\treturn provider.poll();\n\t\t},\n\t};\n}\n\n/** @internal */\nexport function createToolCollector(\n\twrites: ExternalWriteLogRepoLike = createInMemoryExternalWriteLog(),\n) {\n\tconst tools = new Map<string, IntegrationToolDefinition>();\n\tconst api = {\n\t\ttool: (tool: IntegrationToolDefinition) =>\n\t\t\ttools.set(tool.name, {\n\t\t\t\t...tool,\n\t\t\t\texecute: (ctx, args) =>\n\t\t\t\t\ttool.execute(\n\t\t\t\t\t\t{ ...ctx, externalWrites: bindExternalWrites(writes, ctx.process.id) },\n\t\t\t\t\t\targs,\n\t\t\t\t\t),\n\t\t\t}),\n\t} as unknown as ServerExtensionAPI;\n\treturn {\n\t\t/** @internal */\n\t\tapi,\n\t\t/** @internal */\n\t\ttools,\n\t};\n}\n\n/** @internal */\nexport interface InMemoryExternalWriteLog {\n\t/** @internal */\n\trecords: {\n\t\t/** @internal */\n\t\tdedupKey: string;\n\t}[];\n\t/** @internal */\n\thasDedupKey(key: string): boolean;\n\t/** @internal */\n\trecord(input: {\n\t\t/** @internal */\n\t\tdedupKey: string;\n\t}): {\n\t\t/** @internal */\n\t\tdedupKey: string;\n\t};\n\t/** @internal */\n\tgetDedupKeys(): ReadonlySet<string>;\n}\n\n/** @internal */\nexport function createInMemoryExternalWriteLog(): InMemoryExternalWriteLog {\n\tconst dedupKeys = new Set<string>();\n\tconst records: { dedupKey: string }[] = [];\n\treturn {\n\t\trecords,\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\trecords.push(input);\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\tpublications: {\n\t\t\tpublication: () => null,\n\t\t\tpublicationByExternalId: () => null,\n\t\t\treservePublication() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t\tfinishPublication() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t\treleaseRejectedPublication() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t\tmarkPublicationTriggered() {\n\t\t\t\tthrow new Error(\"Configure publication storage for this test\");\n\t\t\t},\n\t\t},\n\t\tpolling: {\n\t\t\tcreate(options) {\n\t\t\t\treturn { poll: options.pollOnce };\n\t\t\t},\n\t\t},\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\tapplyProcessObservation: async () => ({ ok: true, process: null }),\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\tresolveUiLauncherPreview: 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\tlaunchRuns: {\n\t\t\tasync startProgrammatic() {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t\tasync startWatcher() {\n\t\t\t\tthrow new Error(\"not used\");\n\t\t\t},\n\t\t},\n\t};\n}\n\n/** @public */\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\tlaunchRuns: { ...defaults.launchRuns, ...overrides.launchRuns },\n\t};\n}\n\n/** @internal */\nexport interface ServerExtensionTestHarness {\n\t/** @internal */\n\tcatalog: ExtensionCatalog;\n\t/** @internal */\n\tevents: ReturnType<typeof createEventBus>;\n\t/** @internal */\n\tserverSetup: CoreServerSetupDeps;\n\t/** @internal */\n\tstartHooks: Array<() => void | Promise<void>>;\n\t/** @internal */\n\tstopHooks: Array<() => void | Promise<void>>;\n\t/** @internal */\n\tflushAsyncWork: typeof flushAsyncWork;\n}\n\n/** @internal */\nexport async function setupServerExtensionTest(input: {\n\t/** @internal */\n\tmodules: readonly LeitwerkExtensionModule[];\n\t/** @internal */\n\tprovidedCapabilities?: readonly ProvidedCapability[];\n\t/** @internal */\n\tserverSetup?: Partial<CoreServerSetupDeps>;\n\t/** @internal */\n\tonStart?: (handler: () => void | Promise<void>) => void;\n\t/** @internal */\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"],"mappings":";AAAA,SAAgC,6BAA6B;AAC7D,SAAS,wCAAwC;AACjD;AAAA,EACC;AAAA,OAEM;AACP;AAAA,EAEC;AAAA,EACA;AAAA,EACA;AAAA,OAMM;AACP,SAAS,sBAAsB;AAKxB,SAAS,2BACf,UACA,OAOA,SAAS,OACR;AACD,MAAI;AACJ,SAAO;AAAA;AAAA,IAEN;AAAA;AAAA,IAEA,YAAY,KAAyB;AACpC,iBAAW;AAAA,QACV,SACG;AAAA,UACA,GAAG;AAAA,UACH,IAAO,OAA+D;AACrE,kBAAM,QAAQ,IAAI,IAAI,KAAK;AAC3B,mBAAO,UAAU,qBAAqB,eAAe,SAAS,CAAC,MAAM,QAAQ,KAAK,IAC9E;AAAA,cACD,GAAG;AAAA,cACH,SAAS;AAAA,gBACR,QAAQ,CAAC,EAAE,SAAS,OAA6C;AAAA,kBAChE,MAAM;AAAA,gBACP;AAAA,cACD;AAAA,YACD,IACC;AAAA,UACJ;AAAA,QACD,IACC;AAAA,MACJ;AAAA,IACD;AAAA;AAAA,IAEA,OAAO;AACN,UAAI,CAAC,SAAU,OAAM,IAAI,MAAM,kBAAkB,SAAS,EAAE,4BAA4B;AACxF,aAAO,SAAS,KAAK;AAAA,IACtB;AAAA,EACD;AACD;AAGO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