@sensigo/realm-testing 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -13,5 +13,5 @@ export { runFixtureTests } from './runner/test-runner.js';
13
13
  export type { TestResult, RunFixtureTestsOptions } from './runner/test-runner.js';
14
14
  export { startGitHubMockServer } from './servers/github-mock-server.js';
15
15
  export type { GitHubMockServerHandle } from './servers/github-mock-server.js';
16
- export declare const VERSION = "0.14.1";
16
+ export declare const VERSION = "0.15.0";
17
17
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -17,5 +17,5 @@ export { testAdapter } from './helpers/test-adapter.js';
17
17
  export { runFixtureTests } from './runner/test-runner.js';
18
18
  // Servers
19
19
  export { startGitHubMockServer } from './servers/github-mock-server.js';
20
- export const VERSION = '0.14.1';
20
+ export const VERSION = '0.15.0';
21
21
  //# sourceMappingURL=index.js.map
@@ -1,9 +1,15 @@
1
- import { type RunStore, type WorkflowDefinition, type ResponseEnvelope } from '@sensigo/realm';
1
+ import { type RunStore, type WorkflowDefinition, type ResponseEnvelope, type ExtensionRegistry } from '@sensigo/realm';
2
2
  /**
3
3
  * Auto-responds to any open human gate on the run.
4
4
  * Reads gate_id and step_name from run.pending_gate, looks up the choice in
5
5
  * gateResponses[step_name], defaults to 'approve'. Calls submitHumanResponse.
6
+ *
7
+ * @param registry Optional project extension registry. When resolving the gate COMPLETES the
8
+ * run, the engine drains the run's `complete`/`always` finalizers; pass the registry that
9
+ * carries the workflow's finalizer handlers so those run in tests (mirrors the production
10
+ * gate-resolution drivers). Omit it for gate-free / default-handler / finalizer-free
11
+ * workflows — behavior is identical to before.
6
12
  * @throws Error if run.pending_gate is undefined.
7
13
  */
8
- export declare function createGateResponder(store: RunStore, definition: WorkflowDefinition, runId: string, gateResponses: Record<string, string>): Promise<ResponseEnvelope>;
14
+ export declare function createGateResponder(store: RunStore, definition: WorkflowDefinition, runId: string, gateResponses: Record<string, string>, registry?: ExtensionRegistry): Promise<ResponseEnvelope>;
9
15
  //# sourceMappingURL=mock-gate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock-gate.d.ts","sourceRoot":"","sources":["../../src/mocks/mock-gate.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,QAAQ,EACf,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,OAAO,CAAC,gBAAgB,CAAC,CAW3B"}
1
+ {"version":3,"file":"mock-gate.d.ts","sourceRoot":"","sources":["../../src/mocks/mock-gate.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,QAAQ,EACf,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAY3B"}
@@ -4,9 +4,15 @@ import { submitHumanResponse, } from '@sensigo/realm';
4
4
  * Auto-responds to any open human gate on the run.
5
5
  * Reads gate_id and step_name from run.pending_gate, looks up the choice in
6
6
  * gateResponses[step_name], defaults to 'approve'. Calls submitHumanResponse.
7
+ *
8
+ * @param registry Optional project extension registry. When resolving the gate COMPLETES the
9
+ * run, the engine drains the run's `complete`/`always` finalizers; pass the registry that
10
+ * carries the workflow's finalizer handlers so those run in tests (mirrors the production
11
+ * gate-resolution drivers). Omit it for gate-free / default-handler / finalizer-free
12
+ * workflows — behavior is identical to before.
7
13
  * @throws Error if run.pending_gate is undefined.
8
14
  */
9
- export async function createGateResponder(store, definition, runId, gateResponses) {
15
+ export async function createGateResponder(store, definition, runId, gateResponses, registry) {
10
16
  const run = await store.get(runId);
11
17
  if (run.pending_gate === undefined) {
12
18
  throw new Error('createGateResponder: run has no pending gate');
@@ -16,6 +22,7 @@ export async function createGateResponder(store, definition, runId, gateResponse
16
22
  runId,
17
23
  gateId: run.pending_gate.gate_id,
18
24
  choice,
25
+ ...(registry !== undefined ? { registry } : {}),
19
26
  });
20
27
  }
21
28
  //# sourceMappingURL=mock-gate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock-gate.js","sourceRoot":"","sources":["../../src/mocks/mock-gate.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EACL,mBAAmB,GAIpB,MAAM,gBAAgB,CAAC;AAExB;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAe,EACf,UAA8B,EAC9B,KAAa,EACb,aAAqC;IAErC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,GAAG,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC;IACtE,OAAO,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE;QAC5C,KAAK;QACL,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO;QAChC,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"mock-gate.js","sourceRoot":"","sources":["../../src/mocks/mock-gate.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EACL,mBAAmB,GAKpB,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAe,EACf,UAA8B,EAC9B,KAAa,EACb,aAAqC,EACrC,QAA4B;IAE5B,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,GAAG,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IACD,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC;IACtE,OAAO,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE;QAC5C,KAAK;QACL,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,OAAO;QAChC,MAAM;QACN,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChD,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sensigo/realm-testing",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,7 +38,7 @@
38
38
  "lint": "eslint src"
39
39
  },
40
40
  "dependencies": {
41
- "@sensigo/realm": "^0.14.1",
41
+ "@sensigo/realm": "^0.15.0",
42
42
  "js-yaml": "^4.2.0"
43
43
  },
44
44
  "devDependencies": {