@glubean/sdk 0.2.2 → 0.2.4

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 (45) hide show
  1. package/dist/bootstrap-registry.d.ts +38 -0
  2. package/dist/bootstrap-registry.d.ts.map +1 -0
  3. package/dist/bootstrap-registry.js +54 -0
  4. package/dist/bootstrap-registry.js.map +1 -0
  5. package/dist/contract-artifacts.d.ts +4 -1
  6. package/dist/contract-artifacts.d.ts.map +1 -1
  7. package/dist/contract-artifacts.js +26 -4
  8. package/dist/contract-artifacts.js.map +1 -1
  9. package/dist/contract-core.d.ts +13 -1
  10. package/dist/contract-core.d.ts.map +1 -1
  11. package/dist/contract-core.js +353 -6
  12. package/dist/contract-core.js.map +1 -1
  13. package/dist/contract-http/adapter.d.ts +1 -7
  14. package/dist/contract-http/adapter.d.ts.map +1 -1
  15. package/dist/contract-http/adapter.js +203 -192
  16. package/dist/contract-http/adapter.js.map +1 -1
  17. package/dist/contract-http/factory.d.ts.map +1 -1
  18. package/dist/contract-http/factory.js +23 -0
  19. package/dist/contract-http/factory.js.map +1 -1
  20. package/dist/contract-http/index.d.ts +1 -0
  21. package/dist/contract-http/index.d.ts.map +1 -1
  22. package/dist/contract-http/index.js +1 -0
  23. package/dist/contract-http/index.js.map +1 -1
  24. package/dist/contract-http/openapi.d.ts.map +1 -1
  25. package/dist/contract-http/openapi.js +26 -0
  26. package/dist/contract-http/openapi.js.map +1 -1
  27. package/dist/contract-http/types.d.ts +76 -12
  28. package/dist/contract-http/types.d.ts.map +1 -1
  29. package/dist/contract-http/types.js +45 -1
  30. package/dist/contract-http/types.js.map +1 -1
  31. package/dist/contract-types.d.ts +264 -20
  32. package/dist/contract-types.d.ts.map +1 -1
  33. package/dist/index.d.ts +7 -2
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +1 -8
  36. package/dist/index.js.map +1 -1
  37. package/dist/internal.d.ts +1 -0
  38. package/dist/internal.d.ts.map +1 -1
  39. package/dist/internal.js +3 -0
  40. package/dist/internal.js.map +1 -1
  41. package/dist/runner-input-channel.d.ts +95 -0
  42. package/dist/runner-input-channel.d.ts.map +1 -0
  43. package/dist/runner-input-channel.js +110 -0
  44. package/dist/runner-input-channel.js.map +1 -0
  45. package/package.json +1 -1
@@ -0,0 +1,95 @@
1
+ /**
2
+ * @module runner-input-channel
3
+ *
4
+ * Process-local channel for runner-supplied case inputs. The dispatcher
5
+ * (`contract-core.ts`) reads from this channel when applying the §5.1
6
+ * runnable resolution algorithm. The runner harness writes to it before
7
+ * importing the user module.
8
+ *
9
+ * Two independent slots per testId (per attachment-model §8):
10
+ *
11
+ * - `explicit input` — fed via CLI `--input-json` / MCP `inputJson` /
12
+ * programmatic `input`. When present, the dispatcher runs the raw case
13
+ * with this input AFTER validating against the case's `needs` schema
14
+ * (§5.1 step 1). Bootstrap overlay is NOT invoked even if registered.
15
+ *
16
+ * - `bootstrap input` — fed via CLI `--bootstrap-json` /
17
+ * MCP `bootstrapInput` / programmatic `bootstrapInput`. Passed to the
18
+ * overlay's `run(ctx, params)` after validation against the overlay's
19
+ * `params` schema. Only meaningful when an overlay is registered AND
20
+ * the run uses overlay mode.
21
+ *
22
+ * - `force standalone` (debug) — for no-needs cases marked
23
+ * `runnability.requireAttachment: true`, allows bypassing the
24
+ * "requires attachment" guard. §6.3 escape valve. Author-debug only;
25
+ * warning emitted at runtime.
26
+ *
27
+ * The channel is process-local (a plain Map). Subprocess boundaries are
28
+ * the harness's responsibility — it serializes runner options, spawns the
29
+ * subprocess with env vars / args, and the harness's `setRuntime`-time
30
+ * code populates this channel before the user module imports.
31
+ *
32
+ * @internal
33
+ */
34
+ /**
35
+ * Set the explicit case input for a given testId. Subsequent dispatcher
36
+ * runs of that testId will take this path (§5.1 step 1) regardless of
37
+ * whether a bootstrap overlay is registered.
38
+ *
39
+ * @internal
40
+ */
41
+ export declare function setExplicitInput(testId: string, input: unknown): void;
42
+ /**
43
+ * Read the explicit case input for a given testId. Returns
44
+ * `{ has: true, value }` when present (including when value is
45
+ * `undefined` / `null` / `false`), `{ has: false }` otherwise.
46
+ *
47
+ * @internal
48
+ */
49
+ export declare function getExplicitInput(testId: string): {
50
+ has: true;
51
+ value: unknown;
52
+ } | {
53
+ has: false;
54
+ };
55
+ /**
56
+ * Set the bootstrap params for a given testId. Read by the dispatcher
57
+ * when invoking an overlay (§5.1 step 3a).
58
+ *
59
+ * @internal
60
+ */
61
+ export declare function setBootstrapInput(testId: string, input: unknown): void;
62
+ /**
63
+ * Read the bootstrap params for a given testId.
64
+ *
65
+ * @internal
66
+ */
67
+ export declare function getBootstrapInput(testId: string): {
68
+ has: true;
69
+ value: unknown;
70
+ } | {
71
+ has: false;
72
+ };
73
+ /**
74
+ * Mark a testId as force-standalone (§6.3 debug escape valve for
75
+ * `requireAttachment` no-needs cases). The dispatcher will bypass the
76
+ * `requireAttachment` guard for this testId; a runtime warning is
77
+ * emitted alongside.
78
+ *
79
+ * @internal
80
+ */
81
+ export declare function setForceStandalone(testId: string): void;
82
+ /**
83
+ * Check whether a testId is force-standalone.
84
+ *
85
+ * @internal
86
+ */
87
+ export declare function isForceStandalone(testId: string): boolean;
88
+ /**
89
+ * Clear all runner-supplied inputs. Test hook; not part of the public
90
+ * API. Called by harness teardown and by tests that want a clean slate.
91
+ *
92
+ * @internal
93
+ */
94
+ export declare function clearRunnerInputs(): void;
95
+ //# sourceMappingURL=runner-input-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-input-channel.d.ts","sourceRoot":"","sources":["../src/runner-input-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAcH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAErE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,GACb;IAAE,GAAG,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,CAGhD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GACb;IAAE,GAAG,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,GAAG,EAAE,KAAK,CAAA;CAAE,CAGhD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @module runner-input-channel
3
+ *
4
+ * Process-local channel for runner-supplied case inputs. The dispatcher
5
+ * (`contract-core.ts`) reads from this channel when applying the §5.1
6
+ * runnable resolution algorithm. The runner harness writes to it before
7
+ * importing the user module.
8
+ *
9
+ * Two independent slots per testId (per attachment-model §8):
10
+ *
11
+ * - `explicit input` — fed via CLI `--input-json` / MCP `inputJson` /
12
+ * programmatic `input`. When present, the dispatcher runs the raw case
13
+ * with this input AFTER validating against the case's `needs` schema
14
+ * (§5.1 step 1). Bootstrap overlay is NOT invoked even if registered.
15
+ *
16
+ * - `bootstrap input` — fed via CLI `--bootstrap-json` /
17
+ * MCP `bootstrapInput` / programmatic `bootstrapInput`. Passed to the
18
+ * overlay's `run(ctx, params)` after validation against the overlay's
19
+ * `params` schema. Only meaningful when an overlay is registered AND
20
+ * the run uses overlay mode.
21
+ *
22
+ * - `force standalone` (debug) — for no-needs cases marked
23
+ * `runnability.requireAttachment: true`, allows bypassing the
24
+ * "requires attachment" guard. §6.3 escape valve. Author-debug only;
25
+ * warning emitted at runtime.
26
+ *
27
+ * The channel is process-local (a plain Map). Subprocess boundaries are
28
+ * the harness's responsibility — it serializes runner options, spawns the
29
+ * subprocess with env vars / args, and the harness's `setRuntime`-time
30
+ * code populates this channel before the user module imports.
31
+ *
32
+ * @internal
33
+ */
34
+ const _state = {
35
+ explicit: new Map(),
36
+ bootstrap: new Map(),
37
+ forceStandalone: new Set(),
38
+ };
39
+ /**
40
+ * Set the explicit case input for a given testId. Subsequent dispatcher
41
+ * runs of that testId will take this path (§5.1 step 1) regardless of
42
+ * whether a bootstrap overlay is registered.
43
+ *
44
+ * @internal
45
+ */
46
+ export function setExplicitInput(testId, input) {
47
+ _state.explicit.set(testId, input);
48
+ }
49
+ /**
50
+ * Read the explicit case input for a given testId. Returns
51
+ * `{ has: true, value }` when present (including when value is
52
+ * `undefined` / `null` / `false`), `{ has: false }` otherwise.
53
+ *
54
+ * @internal
55
+ */
56
+ export function getExplicitInput(testId) {
57
+ if (!_state.explicit.has(testId))
58
+ return { has: false };
59
+ return { has: true, value: _state.explicit.get(testId) };
60
+ }
61
+ /**
62
+ * Set the bootstrap params for a given testId. Read by the dispatcher
63
+ * when invoking an overlay (§5.1 step 3a).
64
+ *
65
+ * @internal
66
+ */
67
+ export function setBootstrapInput(testId, input) {
68
+ _state.bootstrap.set(testId, input);
69
+ }
70
+ /**
71
+ * Read the bootstrap params for a given testId.
72
+ *
73
+ * @internal
74
+ */
75
+ export function getBootstrapInput(testId) {
76
+ if (!_state.bootstrap.has(testId))
77
+ return { has: false };
78
+ return { has: true, value: _state.bootstrap.get(testId) };
79
+ }
80
+ /**
81
+ * Mark a testId as force-standalone (§6.3 debug escape valve for
82
+ * `requireAttachment` no-needs cases). The dispatcher will bypass the
83
+ * `requireAttachment` guard for this testId; a runtime warning is
84
+ * emitted alongside.
85
+ *
86
+ * @internal
87
+ */
88
+ export function setForceStandalone(testId) {
89
+ _state.forceStandalone.add(testId);
90
+ }
91
+ /**
92
+ * Check whether a testId is force-standalone.
93
+ *
94
+ * @internal
95
+ */
96
+ export function isForceStandalone(testId) {
97
+ return _state.forceStandalone.has(testId);
98
+ }
99
+ /**
100
+ * Clear all runner-supplied inputs. Test hook; not part of the public
101
+ * API. Called by harness teardown and by tests that want a clean slate.
102
+ *
103
+ * @internal
104
+ */
105
+ export function clearRunnerInputs() {
106
+ _state.explicit.clear();
107
+ _state.bootstrap.clear();
108
+ _state.forceStandalone.clear();
109
+ }
110
+ //# sourceMappingURL=runner-input-channel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-input-channel.js","sourceRoot":"","sources":["../src/runner-input-channel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAQH,MAAM,MAAM,GAAiB;IAC3B,QAAQ,EAAE,IAAI,GAAG,EAAE;IACnB,SAAS,EAAE,IAAI,GAAG,EAAE;IACpB,eAAe,EAAE,IAAI,GAAG,EAAE;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,KAAc;IAC7D,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc;IAEd,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IACxD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,KAAc;IAC9D,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAA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