@leitwerk-dev/test-support 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/{chunk-KPSK7EMY.js → chunk-5BZSJ4OO.js} +22 -157
  2. package/dist/chunk-5BZSJ4OO.js.map +1 -0
  3. package/dist/{chunk-2IICIB6D.js → chunk-E4Y7XND5.js} +40 -4
  4. package/dist/chunk-E4Y7XND5.js.map +1 -0
  5. package/dist/{chunk-JUH3LUYK.js → chunk-EXHTWQAE.js} +5 -1
  6. package/dist/chunk-EXHTWQAE.js.map +1 -0
  7. package/dist/chunk-KJVNI2UP.js +17 -0
  8. package/dist/chunk-KJVNI2UP.js.map +1 -0
  9. package/dist/{chunk-7I4OCTF3.js → chunk-OE4NHDVS.js} +15 -4
  10. package/dist/chunk-OE4NHDVS.js.map +1 -0
  11. package/dist/chunk-P2FF4AP7.js +72 -0
  12. package/dist/chunk-P2FF4AP7.js.map +1 -0
  13. package/dist/chunk-RY6Y6V5E.js +54 -0
  14. package/dist/chunk-RY6Y6V5E.js.map +1 -0
  15. package/dist/compact-process-detail-fixture.d.ts +3 -0
  16. package/dist/compact-process-detail-fixture.d.ts.map +1 -1
  17. package/dist/extension-integration-harness.d.ts +357 -0
  18. package/dist/extension-integration-harness.d.ts.map +1 -0
  19. package/dist/fakes/fake-git-ops.d.ts +12 -0
  20. package/dist/fakes/fake-git-ops.d.ts.map +1 -1
  21. package/dist/fakes/fake-llm.d.ts +11 -0
  22. package/dist/fakes/fake-llm.d.ts.map +1 -1
  23. package/dist/fakes/index.d.ts +1 -1
  24. package/dist/fakes/index.d.ts.map +1 -1
  25. package/dist/fakes/index.js +105 -4
  26. package/dist/fakes/index.js.map +1 -1
  27. package/dist/fixtures.d.ts +2 -0
  28. package/dist/fixtures.d.ts.map +1 -1
  29. package/dist/fixtures.js +157 -2
  30. package/dist/fixtures.js.map +1 -1
  31. package/dist/http-launch.d.ts +2 -1
  32. package/dist/http-launch.d.ts.map +1 -1
  33. package/dist/index.d.ts +6 -13
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +13 -119
  36. package/dist/index.js.map +1 -1
  37. package/dist/integration-harness.d.ts +36 -1
  38. package/dist/integration-harness.d.ts.map +1 -1
  39. package/dist/integration.d.ts +3 -3
  40. package/dist/integration.d.ts.map +1 -1
  41. package/dist/integration.js +693 -13
  42. package/dist/integration.js.map +1 -1
  43. package/dist/local-git.d.ts +105 -8
  44. package/dist/local-git.d.ts.map +1 -1
  45. package/dist/local-git.js +155 -24
  46. package/dist/local-git.js.map +1 -1
  47. package/dist/model-provider-fixtures.d.ts +9 -1
  48. package/dist/model-provider-fixtures.d.ts.map +1 -1
  49. package/dist/observations.d.ts +7 -0
  50. package/dist/observations.d.ts.map +1 -0
  51. package/dist/polling.d.ts +1 -0
  52. package/dist/polling.d.ts.map +1 -1
  53. package/dist/process-driver.d.ts +5 -1
  54. package/dist/process-driver.d.ts.map +1 -1
  55. package/dist/process-fixtures.d.ts +56 -0
  56. package/dist/process-fixtures.d.ts.map +1 -0
  57. package/dist/process.d.ts +440 -0
  58. package/dist/process.d.ts.map +1 -0
  59. package/dist/process.js +484 -0
  60. package/dist/process.js.map +1 -0
  61. package/dist/question-fixtures.d.ts +2 -0
  62. package/dist/question-fixtures.d.ts.map +1 -1
  63. package/dist/server-extension-test-harness.d.ts +43 -3
  64. package/dist/server-extension-test-harness.d.ts.map +1 -1
  65. package/dist/stub-worker-entry.js +1 -1
  66. package/dist/supported-question-fixtures.d.ts +96 -0
  67. package/dist/supported-question-fixtures.d.ts.map +1 -0
  68. package/dist/test-capability.d.ts +9 -0
  69. package/dist/test-capability.d.ts.map +1 -0
  70. package/dist/test-diagnostics.d.ts +14 -0
  71. package/dist/test-diagnostics.d.ts.map +1 -0
  72. package/dist/worker-testing/in-process-worker-spawn.d.ts +19 -1
  73. package/dist/worker-testing/in-process-worker-spawn.d.ts.map +1 -1
  74. package/dist/worker-testing/index.d.ts +6 -7
  75. package/dist/worker-testing/index.d.ts.map +1 -1
  76. package/dist/worker-testing/index.js +32 -22
  77. package/dist/worker-testing/index.js.map +1 -1
  78. package/dist/worker-testing/schema-driven-stub-pi.d.ts +5 -0
  79. package/dist/worker-testing/schema-driven-stub-pi.d.ts.map +1 -1
  80. package/dist/worker-testing/stub-pi-controls.d.ts +4 -0
  81. package/dist/worker-testing/stub-pi-controls.d.ts.map +1 -1
  82. package/dist/worker-testing/stub-pi-tree-handle.d.ts +78 -2
  83. package/dist/worker-testing/stub-pi-tree-handle.d.ts.map +1 -1
  84. package/dist/worker-testing/worker-runtime-harness.d.ts +37 -2
  85. package/dist/worker-testing/worker-runtime-harness.d.ts.map +1 -1
  86. package/dist/worker-testing/worker-start-payload.d.ts +17 -1
  87. package/dist/worker-testing/worker-start-payload.d.ts.map +1 -1
  88. package/package.json +14 -8
  89. package/src/compact-process-detail-fixture.ts +9 -1
  90. package/src/extension-integration-harness.ts +1059 -0
  91. package/src/fakes/fake-git-ops.ts +12 -0
  92. package/src/fakes/fake-llm.ts +11 -0
  93. package/src/fakes/index.ts +1 -1
  94. package/src/fixtures.ts +16 -0
  95. package/src/http-launch.ts +2 -1
  96. package/src/index.ts +13 -42
  97. package/src/integration-harness.ts +100 -9
  98. package/src/integration.ts +23 -9
  99. package/src/local-git.ts +196 -45
  100. package/src/model-provider-fixtures.ts +15 -2
  101. package/src/observations.ts +19 -0
  102. package/src/polling.ts +1 -0
  103. package/src/process-driver.ts +7 -1
  104. package/src/process-fixtures.ts +123 -0
  105. package/src/process.ts +768 -0
  106. package/src/question-fixtures.ts +2 -0
  107. package/src/server-extension-test-harness.ts +64 -7
  108. package/src/supported-question-fixtures.ts +168 -0
  109. package/src/test-capability.ts +9 -0
  110. package/src/test-diagnostics.ts +69 -0
  111. package/src/worker-testing/in-process-worker-spawn.ts +44 -4
  112. package/src/worker-testing/index.ts +4 -30
  113. package/src/worker-testing/schema-driven-stub-pi.ts +8 -1
  114. package/src/worker-testing/stub-pi-controls.ts +4 -0
  115. package/src/worker-testing/stub-pi-tree-handle.ts +87 -3
  116. package/src/worker-testing/worker-runtime-harness.ts +57 -6
  117. package/src/worker-testing/worker-start-payload.ts +17 -1
  118. package/dist/chunk-2IICIB6D.js.map +0 -1
  119. package/dist/chunk-3MQO3NCX.js +0 -15
  120. package/dist/chunk-3MQO3NCX.js.map +0 -1
  121. package/dist/chunk-7I4OCTF3.js.map +0 -1
  122. package/dist/chunk-7ZK5QRGP.js +0 -98
  123. package/dist/chunk-7ZK5QRGP.js.map +0 -1
  124. package/dist/chunk-JUH3LUYK.js.map +0 -1
  125. package/dist/chunk-KPSK7EMY.js.map +0 -1
  126. package/dist/chunk-MV4W6NOO.js +0 -105
  127. package/dist/chunk-MV4W6NOO.js.map +0 -1
  128. package/dist/test-app.d.ts +0 -23
  129. package/dist/test-app.d.ts.map +0 -1
  130. package/src/test-app.ts +0 -82
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/http-launch.ts","../src/model-provider-fixtures.ts"],"sourcesContent":["export {\n\tcreateTestConfigSnapshot as testConfigSnapshot,\n\tcreateTestIpcEnvelopeBase as baseEnvelope,\n\tflushAsyncWork,\n} from \"@leitwerk-dev/worker-protocol\";\nexport { createCompactProcessDetailFixtureFactory } from \"./compact-process-detail-fixture.js\";\nexport { FakeGitOps, type RepoTemplate } from \"./fakes/fake-git-ops.js\";\nexport { FakeLlmProvider, type LlmResponse } from \"./fakes/fake-llm.js\";\nexport { postImmediateLaunch, postImmediateLaunchRequest } from \"./http-launch.js\";\nexport {\n\tcreateInProcessWorkerSpawn,\n\ttype InProcessWorkerSpawnOptions,\n} from \"./in-process-worker.js\";\nexport {\n\tcreateIntegrationHarness,\n\ttype IntegrationHarness,\n\ttype IntegrationHarnessOptions,\n} from \"./integration-harness.js\";\nexport { fixtureModelProviders } from \"./model-provider-fixtures.js\";\nexport { waitForValue } from \"./polling.js\";\nexport {\n\tcreateInMemoryExternalWriteLog,\n\tcreatePollingTestExtension,\n\tcreateTestServerSetupCapability,\n\tcreateToolCollector,\n\ttype InMemoryExternalWriteLog,\n\ttype ServerExtensionTestHarness,\n\tsetupServerExtensionTest,\n} from \"./server-extension-test-harness.js\";\nexport { createTestApp, type TestApp, type TestAppOptions } from \"./test-app.js\";\nexport {\n\tcreateSchemaDrivenStubPiFactory,\n\tcreateSchemaDrivenToolCallScriptResolver,\n\tsynthesizeStubArgValue,\n\tsynthesizeStubToolArgs,\n} from \"./worker-testing/schema-driven-stub-pi.js\";\nexport {\n\tcreateStubToolScriptController,\n\ttype StubToolScriptController,\n} from \"./worker-testing/stub-pi-controls.js\";\nexport {\n\tStubPiTreeHandle,\n\tStubPiTreeHandleFactory,\n\ttype StubPiTreeHandleFactoryOptions,\n\ttype StubToolCallScriptCall,\n\ttype StubToolCallScriptItem,\n\ttype StubToolCallScriptResolver,\n\ttype StubToolCallScriptResolverContext,\n} from \"./worker-testing/stub-pi-tree-handle.js\";\n","import type { LaunchRun } from \"@leitwerk-dev/domain\";\n\n/** Accepts a launch-run request shape and waits for its admitted process commit. */\nexport async function postImmediateLaunchRequest(\n\tinput: string | URL | Request,\n\tinit?: RequestInit,\n): Promise<Response> {\n\tconst url = new URL(String(input));\n\tconst match = /^\\/api\\/launchers\\/([^/]+)\\/launch-runs$/.exec(url.pathname);\n\tif (!match?.[1]) throw new Error(`Expected an immediate launch-run URL, received '${url}'`);\n\tconst body = init?.body ? (JSON.parse(String(init.body)) as Record<string, unknown>) : {};\n\treturn postImmediateLaunch(url.origin, decodeURIComponent(match[1]), body);\n}\n\n/**\n * Admits an immediate launch through the public asynchronous HTTP contract and waits until the\n * process commit or a pre-commit failure is observable. Intended for integration-test setup.\n */\nexport async function postImmediateLaunch(\n\tserverBaseUrl: string,\n\tlauncherId: string,\n\tbody: Record<string, unknown>,\n): Promise<Response> {\n\tconst admitted = await fetch(\n\t\t`${serverBaseUrl.replace(/\\/$/, \"\")}/api/launchers/${encodeURIComponent(launcherId)}/launch-runs`,\n\t\t{\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\", \"idempotency-key\": crypto.randomUUID() },\n\t\t\tbody: JSON.stringify({ ...body, schedule: { mode: \"now\" } }),\n\t\t},\n\t);\n\tconst admittedBody = (await admitted.json()) as { launchRunId?: string };\n\tif (admitted.status !== 202 || !admittedBody.launchRunId) {\n\t\treturn new Response(JSON.stringify(admittedBody), {\n\t\t\tstatus: admitted.status,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t});\n\t}\n\n\tlet launchRun: LaunchRun;\n\tconst deadline = Date.now() + 10_000;\n\tfor (;;) {\n\t\tconst response = await fetch(\n\t\t\t`${serverBaseUrl.replace(/\\/$/, \"\")}/api/launch-runs/${admittedBody.launchRunId}`,\n\t\t);\n\t\tconst responseBody = (await response.json()) as { launchRun: LaunchRun };\n\t\tif (\n\t\t\tresponseBody.launchRun.instanceId ||\n\t\t\t[\"failed\", \"cancelled\"].includes(responseBody.launchRun.status)\n\t\t) {\n\t\t\tlaunchRun = responseBody.launchRun;\n\t\t\tbreak;\n\t\t}\n\t\tif (Date.now() >= deadline) throw new Error(\"Timed out waiting for immediate launch admission\");\n\t\tawait new Promise((resolve) => setTimeout(resolve, 10));\n\t}\n\n\tif (!launchRun.instanceId) {\n\t\tconst failure = launchRun.steps.find((step) => step.status === \"failed\");\n\t\treturn new Response(\n\t\t\tJSON.stringify({\n\t\t\t\terror: failure?.safeSummary ?? \"Launch failed\",\n\t\t\t\tlaunchRunId: launchRun.id,\n\t\t\t}),\n\t\t\t{ status: 400, headers: { \"content-type\": \"application/json\" } },\n\t\t);\n\t}\n\tconst detailResponse = await fetch(\n\t\t`${serverBaseUrl.replace(/\\/$/, \"\")}/api/processes/${encodeURIComponent(launchRun.instanceId)}`,\n\t);\n\tconst detail = (await detailResponse.json()) as { process: unknown; projects?: unknown[] };\n\tconst failure = launchRun.steps.find((step) => step.status === \"failed\");\n\treturn new Response(\n\t\tJSON.stringify({\n\t\t\tprocess: detail.process,\n\t\t\tprojects: detail.projects ?? [],\n\t\t\tlaunchRunId: launchRun.id,\n\t\t\t...(launchRun.status === \"failed\"\n\t\t\t\t? { error: failure?.safeSummary ?? \"Process was created, but startup failed\" }\n\t\t\t\t: {}),\n\t\t}),\n\t\t{\n\t\t\tstatus: launchRun.status === \"failed\" ? 200 : 201,\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t},\n\t);\n}\n","import {\n\tbuiltinPiProvider,\n\tdefineModelProvider,\n\tdefineModelProviders,\n} from \"@leitwerk-dev/process-sdk\";\n\nexport function fixtureModelProviders(\n\t...models: { id: string; modelId: string; piProvider?: string; server?: boolean }[]\n) {\n\treturn defineModelProviders((rawConfig) =>\n\t\tmodels.map(({ id, modelId, piProvider = id, server = false }) => ({\n\t\t\tdefinition: defineModelProvider({\n\t\t\t\tid,\n\t\t\t\tparseConfig: () => ({ config: {} }),\n\t\t\t\tworker: builtinPiProvider(piProvider),\n\t\t\t\t...(server ? { server: builtinPiProvider(piProvider) } : {}),\n\t\t\t\tmodels: () => [{ modelId, availability: \"available\" }],\n\t\t\t\tsecrets: () => ({}),\n\t\t\t}),\n\t\t\trawConfig,\n\t\t})),\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EAC6B;AAAA,EACC;AAAA,EAC7B;AAAA,OACM;;;ACDP,eAAsB,2BACrB,OACA,MACoB;AACpB,QAAM,MAAM,IAAI,IAAI,OAAO,KAAK,CAAC;AACjC,QAAM,QAAQ,2CAA2C,KAAK,IAAI,QAAQ;AAC1E,MAAI,CAAC,QAAQ,CAAC,EAAG,OAAM,IAAI,MAAM,mDAAmD,GAAG,GAAG;AAC1F,QAAM,OAAO,MAAM,OAAQ,KAAK,MAAM,OAAO,KAAK,IAAI,CAAC,IAAgC,CAAC;AACxF,SAAO,oBAAoB,IAAI,QAAQ,mBAAmB,MAAM,CAAC,CA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"]}
1
+ {"version":3,"sources":["../src/model-provider-fixtures.ts","../src/index.ts"],"sourcesContent":["import {\n\tbuiltinPiProvider,\n\tdefineModelProvider,\n\tdefineModelProviders,\n} from \"@leitwerk-dev/process-sdk\";\n\n/** @public */\nexport type FixtureModelProviderSet = ReturnType<typeof defineModelProviders>;\n\n/** @public */\nexport function fixtureModelProviders(\n\t...models: {\n\t\t/** @public */\n\t\tid: string;\n\t\t/** @public */\n\t\tmodelId: string;\n\t\t/** @internal */\n\t\tpiProvider?: string;\n\t\t/** @public */\n\t\tserver?: boolean;\n\t}[]\n): FixtureModelProviderSet {\n\treturn defineModelProviders((rawConfig) =>\n\t\tmodels.map(({ id, modelId, piProvider = id, server = false }) => ({\n\t\t\tdefinition: defineModelProvider({\n\t\t\t\tid,\n\t\t\t\tparseConfig: () => ({ config: {} }),\n\t\t\t\tworker: builtinPiProvider(piProvider),\n\t\t\t\t...(server ? { server: builtinPiProvider(piProvider) } : {}),\n\t\t\t\tmodels: () => [{ modelId, availability: \"available\" }],\n\t\t\t\tsecrets: () => ({}),\n\t\t\t}),\n\t\t\trawConfig,\n\t\t})),\n\t);\n}\n","import { createInMemoryExternalWriteLog as createInMemoryExternalWriteLogImpl } from \"./server-extension-test-harness.js\";\n\nexport { FakeLlmProvider } from \"./fakes/fake-llm.js\";\nexport { postImmediateLaunch, postImmediateLaunchRequest } from \"./http-launch.js\";\nexport {\n\ttype FixtureModelProviderSet,\n\tfixtureModelProviders,\n} from \"./model-provider-fixtures.js\";\nexport {\n\tcreatePollingTestExtension,\n\tcreateTestServerSetupCapability,\n\tcreateToolCollector,\n} from \"./server-extension-test-harness.js\";\n\n/** @internal */\nexport function createInMemoryExternalWriteLog(): ReturnType<\n\ttypeof createInMemoryExternalWriteLogImpl\n> {\n\treturn createInMemoryExternalWriteLogImpl();\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAMA,SAAS,yBACZ,QAUuB;AAC1B,SAAO;AAAA,IAAqB,CAAC,cAC5B,OAAO,IAAI,CAAC,EAAE,IAAI,SAAS,aAAa,IAAI,SAAS,MAAM,OAAO;AAAA,MACjE,YAAY,oBAAoB;AAAA,QAC/B;AAAA,QACA,aAAa,OAAO,EAAE,QAAQ,CAAC,EAAE;AAAA,QACjC,QAAQ,kBAAkB,UAAU;AAAA,QACpC,GAAI,SAAS,EAAE,QAAQ,kBAAkB,UAAU,EAAE,IAAI,CAAC;AAAA,QAC1D,QAAQ,MAAM,CAAC,EAAE,SAAS,cAAc,YAAY,CAAC;AAAA,QACrD,SAAS,OAAO,CAAC;AAAA,MAClB,CAAC;AAAA,MACD;AAAA,IACD,EAAE;AAAA,EACH;AACD;;;ACpBO,SAASA,kCAEd;AACD,SAAO,+BAAmC;AAC3C;","names":["createInMemoryExternalWriteLog"]}
@@ -1,21 +1,56 @@
1
1
  import type { ExtensionCatalog } from "@leitwerk-dev/extension-runtime";
2
2
  import type { ProvidedCapability } from "@leitwerk-dev/process-sdk";
3
3
  import { type AppContext, type AppOptions, type LeitwerkConfig } from "@leitwerk-dev/server";
4
+ import { type InProcessWorkerSpawnOptions } from "./in-process-worker.js";
5
+ /** @public */
4
6
  export interface IntegrationHarness<TResources extends Record<string, unknown> = Record<string, never>> {
7
+ /** @public */
5
8
  ctx: AppContext;
9
+ /** @public */
10
+ close(): Promise<void>;
11
+ /** @internal */
6
12
  config: LeitwerkConfig;
13
+ /** @public */
7
14
  address: string;
15
+ /** @internal */
8
16
  resources: TResources;
9
17
  }
18
+ /** @public */
10
19
  export interface IntegrationHarnessOptions<TResources extends Record<string, unknown> = Record<string, never>> {
20
+ /** @internal */
11
21
  config?: LeitwerkConfig;
22
+ /** @public */
12
23
  configOverride?: (config: LeitwerkConfig) => void;
24
+ /** @public */
13
25
  appOverrides?: Partial<AppOptions>;
26
+ /** @internal */
14
27
  listen?: boolean;
15
- inProcessWorkers?: boolean;
28
+ /** Start background services when binding a listener. Defaults to true. @public */
29
+ backgroundServices?: boolean;
30
+ /** @internal */
31
+ inProcessWorkers?: boolean | Omit<InProcessWorkerSpawnOptions, "extensionCatalog">;
32
+ /** @public */
16
33
  extensionCatalog: ExtensionCatalog | Promise<ExtensionCatalog>;
34
+ /** @internal */
17
35
  preProvidedCapabilities?: readonly ProvidedCapability[];
36
+ /** @internal */
18
37
  resources?: TResources;
19
38
  }
39
+ /** Owns disposable file-backed storage; close retains it for the next open, dispose removes it. @internal */
40
+ export declare function createPersistentIntegrationFixture(prefix: string, configure?: (config: LeitwerkConfig) => void): {
41
+ /** @internal */
42
+ root: string;
43
+ /** @internal */
44
+ createConfig: () => LeitwerkConfig;
45
+ /** @internal */
46
+ context(): AppContext;
47
+ /** @internal */
48
+ open(options: IntegrationHarnessOptions): Promise<IntegrationHarness<Record<string, never>>>;
49
+ /** @internal */
50
+ close: () => Promise<void>;
51
+ /** @internal */
52
+ dispose(): Promise<void>;
53
+ };
54
+ /** @public */
20
55
  export declare function createIntegrationHarness<TResources extends Record<string, unknown> = Record<string, never>>(opts: IntegrationHarnessOptions<TResources>): Promise<IntegrationHarness<TResources>>;
21
56
  //# sourceMappingURL=integration-harness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration-harness.d.ts","sourceRoot":"","sources":["../src/integration-harness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACN,KAAK,UAAU,EACf,KAAK,UAAU,EAGf,KAAK,cAAc,EACnB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,kBAAkB,CAClC,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAElE,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM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B;;EASjB;AACD,cAAc;AACd,wBAAsB,wBAAwB,CAC7C,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACjE,IAAI,EAAE,yBAAyB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAqDtF"}
@@ -1,6 +1,6 @@
1
- export { createIntegrationHarness, type IntegrationHarness, type IntegrationHarnessOptions, } from "./integration-harness.js";
1
+ export { type AcceptedTurnFixture, type AcceptedTurnReference, createExtensionIntegrationHarness, type ExtensionIntegrationHarness, type ExtensionIntegrationHarnessOptions, type ExtensionIntegrationProcess, type ExtensionIntegrationSnapshot, type ExtensionTestRequest, type ExtensionTestResponse, type IntegrationAnnotationObservation, type IntegrationApprovalObservation, type IntegrationEventObservation, type IntegrationInputObservation, type IntegrationLeafObservation, type IntegrationProcessInput, type IntegrationPromptObservation, type IntegrationToolCall, type IntegrationTurnResult, type IntegrationTurnScript, } from "./extension-integration-harness.js";
2
+ export { createIntegrationHarness, createPersistentIntegrationFixture, type IntegrationHarness, } from "./integration-harness.js";
2
3
  export { waitForValue } from "./polling.js";
3
4
  export { createProcessDriver } from "./process-driver.js";
4
- export { createInMemoryExternalWriteLog, createTestServerSetupCapability, type InMemoryExternalWriteLog, type ServerExtensionTestHarness, setupServerExtensionTest, } from "./server-extension-test-harness.js";
5
- export { createTestApp, type TestApp, type TestAppOptions } from "./test-app.js";
5
+ export { createTestServerSetupCapability } from "./server-extension-test-harness.js";
6
6
  //# sourceMappingURL=integration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,GAC9B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EACN,8BAA8B,EAC9B,+BAA+B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,wBAAwB,GACxB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../src/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,iCAAiC,EACjC,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EACvC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACrC,KAAK,8BAA8B,EACnC,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACN,wBAAwB,EACxB,kCAAkC,EAClC,KAAK,kBAAkB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,oCAAoC,CAAC"}