@glubean/sdk 0.2.1 → 0.2.3

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 (119) 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/configure/http.d.ts +25 -0
  6. package/dist/configure/http.d.ts.map +1 -0
  7. package/dist/configure/http.js +88 -0
  8. package/dist/configure/http.js.map +1 -0
  9. package/dist/configure/index.d.ts +78 -0
  10. package/dist/configure/index.d.ts.map +1 -0
  11. package/dist/configure/index.js +78 -0
  12. package/dist/configure/index.js.map +1 -0
  13. package/dist/configure/plugin.d.ts +23 -0
  14. package/dist/configure/plugin.d.ts.map +1 -0
  15. package/dist/configure/plugin.js +81 -0
  16. package/dist/configure/plugin.js.map +1 -0
  17. package/dist/configure/runtime.d.ts +24 -0
  18. package/dist/configure/runtime.d.ts.map +1 -0
  19. package/dist/configure/runtime.js +45 -0
  20. package/dist/configure/runtime.js.map +1 -0
  21. package/dist/configure/template.d.ts +22 -0
  22. package/dist/configure/template.d.ts.map +1 -0
  23. package/dist/configure/template.js +34 -0
  24. package/dist/configure/template.js.map +1 -0
  25. package/dist/configure/vars.d.ts +20 -0
  26. package/dist/configure/vars.d.ts.map +1 -0
  27. package/dist/configure/vars.js +48 -0
  28. package/dist/configure/vars.js.map +1 -0
  29. package/dist/configure.d.ts +2 -133
  30. package/dist/configure.d.ts.map +1 -1
  31. package/dist/configure.js +2 -436
  32. package/dist/configure.js.map +1 -1
  33. package/dist/contract-artifacts.d.ts +268 -0
  34. package/dist/contract-artifacts.d.ts.map +1 -0
  35. package/dist/contract-artifacts.js +402 -0
  36. package/dist/contract-artifacts.js.map +1 -0
  37. package/dist/contract-core.d.ts +43 -1
  38. package/dist/contract-core.d.ts.map +1 -1
  39. package/dist/contract-core.js +376 -5
  40. package/dist/contract-core.js.map +1 -1
  41. package/dist/contract-http/adapter.d.ts +1 -7
  42. package/dist/contract-http/adapter.d.ts.map +1 -1
  43. package/dist/contract-http/adapter.js +221 -199
  44. package/dist/contract-http/adapter.js.map +1 -1
  45. package/dist/contract-http/factory.d.ts.map +1 -1
  46. package/dist/contract-http/factory.js +13 -14
  47. package/dist/contract-http/factory.js.map +1 -1
  48. package/dist/contract-http/index.d.ts +1 -0
  49. package/dist/contract-http/index.d.ts.map +1 -1
  50. package/dist/contract-http/index.js +1 -0
  51. package/dist/contract-http/index.js.map +1 -1
  52. package/dist/contract-http/openapi.d.ts +56 -7
  53. package/dist/contract-http/openapi.d.ts.map +1 -1
  54. package/dist/contract-http/openapi.js +371 -21
  55. package/dist/contract-http/openapi.js.map +1 -1
  56. package/dist/contract-http/types.d.ts +72 -24
  57. package/dist/contract-http/types.d.ts.map +1 -1
  58. package/dist/contract-http/types.js +45 -1
  59. package/dist/contract-http/types.js.map +1 -1
  60. package/dist/contract-types.d.ts +270 -30
  61. package/dist/contract-types.d.ts.map +1 -1
  62. package/dist/expect.d.ts +13 -0
  63. package/dist/expect.d.ts.map +1 -1
  64. package/dist/expect.js +18 -0
  65. package/dist/expect.js.map +1 -1
  66. package/dist/index.d.ts +57 -10
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +15 -8
  69. package/dist/index.js.map +1 -1
  70. package/dist/install-plugin.d.ts +94 -0
  71. package/dist/install-plugin.d.ts.map +1 -0
  72. package/dist/install-plugin.js +222 -0
  73. package/dist/install-plugin.js.map +1 -0
  74. package/dist/internal.d.ts +2 -0
  75. package/dist/internal.d.ts.map +1 -1
  76. package/dist/internal.js +8 -0
  77. package/dist/internal.js.map +1 -1
  78. package/dist/plugin.d.ts +45 -34
  79. package/dist/plugin.d.ts.map +1 -1
  80. package/dist/plugin.js +47 -34
  81. package/dist/plugin.js.map +1 -1
  82. package/dist/runner-input-channel.d.ts +95 -0
  83. package/dist/runner-input-channel.d.ts.map +1 -0
  84. package/dist/runner-input-channel.js +110 -0
  85. package/dist/runner-input-channel.js.map +1 -0
  86. package/dist/{test-builder.d.ts → test/builder.d.ts} +2 -2
  87. package/dist/test/builder.d.ts.map +1 -0
  88. package/dist/{test-builder.js → test/builder.js} +3 -3
  89. package/dist/{test-builder.js.map → test/builder.js.map} +1 -1
  90. package/dist/{each-builder.d.ts → test/each-builder.d.ts} +1 -1
  91. package/dist/test/each-builder.d.ts.map +1 -0
  92. package/dist/{each-builder.js → test/each-builder.js} +3 -3
  93. package/dist/test/each-builder.js.map +1 -0
  94. package/dist/{test-extend.d.ts → test/extend.d.ts} +3 -3
  95. package/dist/test/extend.d.ts.map +1 -0
  96. package/dist/{test-extend.js → test/extend.js} +5 -5
  97. package/dist/test/extend.js.map +1 -0
  98. package/dist/{test-utils.d.ts → test/utils.d.ts} +2 -2
  99. package/dist/test/utils.d.ts.map +1 -0
  100. package/dist/{test-utils.js → test/utils.js} +1 -1
  101. package/dist/test/utils.js.map +1 -0
  102. package/dist/types.d.ts +78 -7
  103. package/dist/types.d.ts.map +1 -1
  104. package/package.json +1 -1
  105. package/dist/contract-http/flow-helpers.d.ts +0 -12
  106. package/dist/contract-http/flow-helpers.d.ts.map +0 -1
  107. package/dist/contract-http/flow-helpers.js +0 -34
  108. package/dist/contract-http/flow-helpers.js.map +0 -1
  109. package/dist/contract-http/markdown.d.ts +0 -10
  110. package/dist/contract-http/markdown.d.ts.map +0 -1
  111. package/dist/contract-http/markdown.js +0 -21
  112. package/dist/contract-http/markdown.js.map +0 -1
  113. package/dist/each-builder.d.ts.map +0 -1
  114. package/dist/each-builder.js.map +0 -1
  115. package/dist/test-builder.d.ts.map +0 -1
  116. package/dist/test-extend.d.ts.map +0 -1
  117. package/dist/test-extend.js.map +0 -1
  118. package/dist/test-utils.d.ts.map +0 -1
  119. package/dist/test-utils.js.map +0 -1
@@ -0,0 +1,222 @@
1
+ /**
2
+ * @module install-plugin
3
+ *
4
+ * Plugin manifest installation driver — the single entry point for plugin-level
5
+ * global registration. Builds on top of the low-level primitives
6
+ * (`Expectation.extend`, `contract.register`) to provide:
7
+ *
8
+ * - **Plugin identity** — every manifest has a `name`, tracked for diagnostics.
9
+ * - **Conflict detection** — duplicate matcher/protocol names throw, whether the
10
+ * prior registration was from another plugin manifest or from a direct call
11
+ * to the low-level primitive.
12
+ * - **Idempotent install** — re-installing the same plugin (by `name`) is a no-op.
13
+ * - **Failed-setup isolation** — if a plugin's `setup()` throws, the plugin is
14
+ * marked as setup-failed; retrying the same plugin in the same process raises
15
+ * a clear error rather than silently re-registering matchers/contracts.
16
+ * - **Install-order hooks** — `setup()` runs after matchers/contracts are registered.
17
+ *
18
+ * `installPlugin` is the recommended surface for plugin authors. The primitives
19
+ * (`Expectation.extend`, `contract.register`) remain public for inline patching
20
+ * or prototyping. `installPlugin` still detects collisions against them — a
21
+ * plugin trying to register a matcher/protocol that a direct primitive call
22
+ * already owns will throw.
23
+ *
24
+ * @see {@link PluginManifest} in `./types.js`
25
+ */
26
+ import { Expectation } from "./expect.js";
27
+ import { contract, getAdapter, __unregisterProtocolForTesting } from "./contract-core.js";
28
+ /**
29
+ * Registry of fully installed plugins (matchers + contracts + setup all
30
+ * succeeded), keyed by manifest `name`. Feeds `listInstalledPlugins()`.
31
+ * @internal
32
+ */
33
+ const installed = new Map();
34
+ /**
35
+ * Plugins whose `setup()` threw. Matchers/contracts they registered remain
36
+ * on the globals (irreversible), but the plugin is NOT in `installed`.
37
+ * Retrying such a plugin in the same process throws immediately.
38
+ * @internal
39
+ */
40
+ const setupFailures = new Map();
41
+ /**
42
+ * Reverse index: which plugin owns which matcher name?
43
+ * Keyed by matcher name → plugin name.
44
+ * @internal
45
+ */
46
+ const matcherOwners = new Map();
47
+ /**
48
+ * Reverse index: which plugin owns which protocol name?
49
+ * Keyed by protocol name → plugin name.
50
+ * @internal
51
+ */
52
+ const protocolOwners = new Map();
53
+ /**
54
+ * Install one or more plugin manifests. Drives registration in strict order:
55
+ *
56
+ * 1. Validate the manifest shape.
57
+ * 2. Check each matcher/protocol name for conflicts (both across plugins and
58
+ * against direct primitive registrations). Throws on first conflict.
59
+ * 3. Register all matchers via `Expectation.extend`.
60
+ * 4. Register all contracts via `contract.register`.
61
+ * 5. Run `setup()` if present (awaited).
62
+ * 6. Record the plugin in the installed registry.
63
+ *
64
+ * Subsequent calls with an already-installed plugin (same `name`) are no-ops.
65
+ * Subsequent calls with a previously-setup-failed plugin throw.
66
+ *
67
+ * **Failure semantics**: if `setup()` throws, the process is left in a
68
+ * partially-initialized state (matchers/contracts from this plugin are on
69
+ * the globals but `installed` does not list the plugin). This state is
70
+ * **not recoverable within the same process** — the only clean remedy is to
71
+ * restart. Retrying the same plugin raises a clear error instead of silently
72
+ * re-registering.
73
+ *
74
+ * @param plugins One or more manifests to install, in order.
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * import { installPlugin } from "@glubean/sdk";
79
+ * import graphqlPlugin from "@glubean/graphql";
80
+ * import grpcPlugin from "@glubean/grpc";
81
+ *
82
+ * await installPlugin(graphqlPlugin, grpcPlugin);
83
+ * ```
84
+ */
85
+ export async function installPlugin(...plugins) {
86
+ for (const plugin of plugins) {
87
+ if (!plugin || typeof plugin !== "object" || typeof plugin.name !== "string") {
88
+ throw new Error("installPlugin: expected a PluginManifest with a string `name` field. " +
89
+ `Got: ${typeof plugin === "object" ? JSON.stringify(plugin) : typeof plugin}.`);
90
+ }
91
+ // Fast-path: successful re-install is idempotent.
92
+ if (installed.has(plugin.name)) {
93
+ if (typeof process !== "undefined" && process.env?.["GLUBEAN_DEBUG"]) {
94
+ process.stderr.write(`[glubean:debug] installPlugin: skipping duplicate install of "${plugin.name}"\n`);
95
+ }
96
+ continue;
97
+ }
98
+ // Failed-setup path: matchers/contracts from a prior failed attempt are
99
+ // still on the globals, so re-registering them would double-register.
100
+ // Throw with full context rather than silently continuing.
101
+ const prevFailure = setupFailures.get(plugin.name);
102
+ if (prevFailure) {
103
+ throw new Error(`installPlugin("${plugin.name}"): previous setup() attempt failed in this process ` +
104
+ `and left matchers/contracts partially registered. This state is not recoverable — ` +
105
+ `restart the process to retry. Original error: ${prevFailure.message}`);
106
+ }
107
+ // --- Pre-flight conflict checks --------------------------------------
108
+ // Done BEFORE any mutation so a conflict on the Nth matcher doesn't leave
109
+ // the first N-1 matchers on the prototype.
110
+ if (plugin.matchers) {
111
+ for (const name of Object.keys(plugin.matchers)) {
112
+ const existingOwner = matcherOwners.get(name);
113
+ if (existingOwner) {
114
+ throw new Error(`installPlugin("${plugin.name}"): matcher "${name}" is already registered ` +
115
+ `by plugin "${existingOwner}". ` +
116
+ `Each matcher name can only be owned by one plugin.`);
117
+ }
118
+ // Catch matchers registered via a direct `Expectation.extend()` call
119
+ // that bypassed installPlugin. Expectation.extend itself would throw
120
+ // when we try to register, but with a generic message — pre-check so
121
+ // the error names the plugin that's trying to register.
122
+ if (name in Expectation.prototype) {
123
+ throw new Error(`installPlugin("${plugin.name}"): matcher "${name}" already exists on Expectation.prototype ` +
124
+ `(likely registered by a direct Expectation.extend() call or a built-in matcher). ` +
125
+ `Matcher names must be unique across the entire process.`);
126
+ }
127
+ }
128
+ }
129
+ if (plugin.contracts) {
130
+ for (const protocol of Object.keys(plugin.contracts)) {
131
+ const existingOwner = protocolOwners.get(protocol);
132
+ if (existingOwner) {
133
+ throw new Error(`installPlugin("${plugin.name}"): protocol "${protocol}" is already registered ` +
134
+ `by plugin "${existingOwner}". ` +
135
+ `Each protocol name can only be owned by one plugin.`);
136
+ }
137
+ // Catch protocols registered via a direct `contract.register()` call
138
+ // that bypassed installPlugin. Unlike Expectation.extend, the current
139
+ // contract.register has no built-in duplicate guard — it would
140
+ // silently overwrite the live adapter. Pre-check via getAdapter().
141
+ if (getAdapter(protocol)) {
142
+ throw new Error(`installPlugin("${plugin.name}"): protocol "${protocol}" is already present in the contract registry ` +
143
+ `(likely registered by a direct contract.register() call). ` +
144
+ `Protocol names must be unique across the entire process.`);
145
+ }
146
+ }
147
+ }
148
+ // --- Mutations (past this point, prototype/registry get modified) ----
149
+ if (plugin.matchers) {
150
+ for (const [name, fn] of Object.entries(plugin.matchers)) {
151
+ Expectation.extend({ [name]: fn });
152
+ matcherOwners.set(name, plugin.name);
153
+ }
154
+ }
155
+ if (plugin.contracts) {
156
+ for (const [protocol, adapter] of Object.entries(plugin.contracts)) {
157
+ contract.register(protocol, adapter);
158
+ protocolOwners.set(protocol, plugin.name);
159
+ }
160
+ }
161
+ // --- Setup hook (failure leaves partial state) -----------------------
162
+ if (plugin.setup) {
163
+ try {
164
+ await plugin.setup();
165
+ }
166
+ catch (err) {
167
+ const error = err instanceof Error ? err : new Error(String(err));
168
+ setupFailures.set(plugin.name, error);
169
+ throw error;
170
+ }
171
+ }
172
+ installed.set(plugin.name, plugin);
173
+ }
174
+ }
175
+ /**
176
+ * Return a snapshot array of all successfully installed plugin manifests, in
177
+ * install order. Plugins whose `setup()` threw are **not** included.
178
+ *
179
+ * The returned array is a shallow copy — mutating it does not affect the
180
+ * installed state. Manifest objects themselves are returned by reference.
181
+ */
182
+ export function listInstalledPlugins() {
183
+ return [...installed.values()];
184
+ }
185
+ /**
186
+ * Clear all installed-plugin state. **Test-only.**
187
+ *
188
+ * Performs a **true reset**:
189
+ * 1. Unregisters every matcher previously installed via a plugin manifest
190
+ * from `Expectation.prototype`.
191
+ * 2. Unregisters every protocol adapter previously installed via a plugin
192
+ * manifest from the contract registry (`_adapters` + `contract[protocol]`).
193
+ * 3. Clears all internal tracking maps (`installed`, `matcherOwners`,
194
+ * `protocolOwners`, `setupFailures`).
195
+ *
196
+ * **Scope limits:**
197
+ * - Only touches registrations introduced via `installPlugin`. Matchers /
198
+ * protocols registered via a direct call to the primitive (bypassing
199
+ * `installPlugin`) are **not** tracked by the owner maps and therefore
200
+ * will not be removed.
201
+ * - Built-in Expectation matchers (defined on the class body, not added
202
+ * via `extend()`) are unaffected because `delete` on a class-syntax
203
+ * method is a no-op.
204
+ *
205
+ * Intended for test suites that install plugins, need to simulate a
206
+ * fresh process, and then install again.
207
+ *
208
+ * @internal
209
+ */
210
+ export function __resetInstalledPluginsForTesting() {
211
+ for (const [name] of matcherOwners) {
212
+ Expectation.__removeMatcherForTesting(name);
213
+ }
214
+ for (const [protocol] of protocolOwners) {
215
+ __unregisterProtocolForTesting(protocol);
216
+ }
217
+ installed.clear();
218
+ matcherOwners.clear();
219
+ protocolOwners.clear();
220
+ setupFailures.clear();
221
+ }
222
+ //# sourceMappingURL=install-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-plugin.js","sourceRoot":"","sources":["../src/install-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE1F;;;;GAIG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAiB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,cAAc,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAG,OAAyB;IAE5B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7E,MAAM,IAAI,KAAK,CACb,uEAAuE;gBACrE,QAAQ,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAA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,CAAC;IACvB,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC"}
@@ -11,6 +11,8 @@
11
11
  */
12
12
  import type { RegisteredTestMeta } from "./types.js";
13
13
  export { getRuntime, setRuntime, runWithRuntime, installCarrier, createGlobalThisCarrier, createAlsCarrier, type RuntimeCarrier, type InternalRuntime, } from "./runtime-carrier.js";
14
+ export { __resetInstalledPluginsForTesting, } from "./install-plugin.js";
15
+ export { setExplicitInput, getExplicitInput, setBootstrapInput, getBootstrapInput, setForceStandalone, isForceStandalone, clearRunnerInputs, } from "./runner-input-channel.js";
14
16
  /**
15
17
  * Register a test to the global registry.
16
18
  * Called internally by the test builders.
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAW9B;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAE3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,kBAAkB,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EACL,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAWnC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAE3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,kBAAkB,EAAE,CAElD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
package/dist/internal.js CHANGED
@@ -10,6 +10,14 @@
10
10
  * @internal
11
11
  */
12
12
  export { getRuntime, setRuntime, runWithRuntime, installCarrier, createGlobalThisCarrier, createAlsCarrier, } from "./runtime-carrier.js";
13
+ // Internal-only test hook for plugin install state. Public callers use
14
+ // `installPlugin` / `listInstalledPlugins` from the main export. The matching
15
+ // bootstrap reset lives in `@glubean/runner/internal` alongside the bootstrap
16
+ // implementation (see runner/src/bootstrap.ts).
17
+ export { __resetInstalledPluginsForTesting, } from "./install-plugin.js";
18
+ // Runner input channel — runner harness populates these before importing
19
+ // the user module; dispatcher reads them when applying §5.1 algorithm.
20
+ export { setExplicitInput, getExplicitInput, setBootstrapInput, getBootstrapInput, setForceStandalone, isForceStandalone, clearRunnerInputs, } from "./runner-input-channel.js";
13
21
  /**
14
22
  * Global registry for test metadata.
15
23
  * Populated at import time when test files are loaded.
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,SAAS,GAAyB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAwB;IACnD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC"}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EACL,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,gBAAgB,GAGjB,MAAM,sBAAsB,CAAC;AAE9B,uEAAuE;AACvE,8EAA8E;AAC9E,8EAA8E;AAC9E,gDAAgD;AAChD,OAAO,EACL,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAE7B,yEAAyE;AACzE,uEAAuE;AACvE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,SAAS,GAAyB,EAAE,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAwB;IACnD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;AACvB,CAAC"}
package/dist/plugin.d.ts CHANGED
@@ -1,56 +1,67 @@
1
1
  /**
2
- * Plugin definition helper for Glubean SDK.
2
+ * Plugin authoring helpers.
3
3
  *
4
- * Plugin authors use `definePlugin()` to create plugin factories that
5
- * integrate with `configure({ plugins: { ... } })`. This is the recommended
6
- * way to define plugins — it handles the `PluginFactory` phantom type trick
7
- * so plugin authors don't need to understand it.
4
+ * Two APIs live here, one per concept:
8
5
  *
9
- * @example
10
- * ```ts
11
- * import { definePlugin } from "@glubean/sdk";
6
+ * 1. **`definePlugin(manifest)`** — declare a plugin manifest for global
7
+ * registration (matchers, protocol adapters, one-time setup). Consumed by
8
+ * {@link installPlugin} in `./install-plugin.js`. This is the primary API
9
+ * for plugin packages like `@glubean/graphql` and `@glubean/grpc`.
12
10
  *
13
- * export const myPlugin = (opts: MyOptions) =>
14
- * definePlugin((runtime) => {
15
- * const baseUrl = runtime.requireVar(opts.baseUrlKey);
16
- * return new MyClient(baseUrl);
17
- * });
18
- * ```
11
+ * 2. **`defineClientFactory(create)`** declare a lazy client factory for
12
+ * per-file injection via `configure({ plugins })`. This is what the
13
+ * legacy `definePlugin((runtime) => T)` signature used to do; the name
14
+ * has been corrected to describe what it actually is (a client factory,
15
+ * not a plugin).
16
+ *
17
+ * The legacy `definePlugin((runtime) => T)` overload was removed in Phase 3.
18
+ * Migrate call sites to `defineClientFactory((runtime) => T)` for the same
19
+ * behavior and better naming.
19
20
  *
20
21
  * @module plugin
21
22
  */
22
- import type { GlubeanRuntime, PluginFactory } from "./types.js";
23
+ import type { ClientFactory, GlubeanRuntime, PluginManifest } from "./types.js";
23
24
  /**
24
- * Create a plugin factory. This is the recommended way to define plugins.
25
+ * Declare a lazy client factory.
25
26
  *
26
- * The factory function receives a `GlubeanRuntime` with access to vars,
27
- * secrets, HTTP client, and template resolution. It is called lazily on
27
+ * The factory function receives a `GlubeanRuntime` (vars / secrets / http /
28
+ * template resolution) and returns a client instance. It is invoked lazily on
28
29
  * first property access during test execution, not at module load time.
29
30
  *
30
- * @param create Factory function that receives the runtime and returns the plugin instance
31
- * @returns A `PluginFactory<T>` suitable for use in `configure({ plugins: { ... } })`
31
+ * Output is consumed by `configure({ plugins: { name: factory } })` for
32
+ * per-file client injection.
32
33
  *
33
- * @example Simple plugin
34
+ * @param create Factory function receiving the runtime; returns the client.
35
+ * @returns A `ClientFactory<T>` suitable for `configure({ plugins })`.
36
+ *
37
+ * @example Simple client
34
38
  * ```ts
35
- * export const myPlugin = (opts: { baseUrlKey: string }) =>
36
- * definePlugin((runtime) => {
39
+ * export const myClient = (opts: { baseUrlKey: string }) =>
40
+ * defineClientFactory((runtime) => {
37
41
  * const baseUrl = runtime.requireVar(opts.baseUrlKey);
38
42
  * return new MyClient(baseUrl);
39
43
  * });
40
44
  * ```
45
+ */
46
+ export declare function defineClientFactory<T>(create: (runtime: GlubeanRuntime) => T): ClientFactory<T>;
47
+ /**
48
+ * Declare a plugin manifest for global registration.
41
49
  *
42
- * @example Plugin with auth headers
50
+ * The returned manifest is consumed by `installPlugin(...manifests)` at
51
+ * bootstrap time. A manifest can declare custom matchers, protocol adapters,
52
+ * and a one-time `setup()` hook. See {@link PluginManifest}.
53
+ *
54
+ * @example Plugin manifest
43
55
  * ```ts
44
- * export const graphql = (opts: { endpoint: string; headers?: Record<string, string> }) =>
45
- * definePlugin((runtime) => {
46
- * const url = runtime.requireVar(opts.endpoint);
47
- * const headers: Record<string, string> = {};
48
- * for (const [k, v] of Object.entries(opts.headers ?? {})) {
49
- * headers[k] = runtime.resolveTemplate(v);
50
- * }
51
- * return createGraphQLClient(runtime.http, { endpoint: url, headers });
52
- * });
56
+ * export default definePlugin({
57
+ * name: "@glubean/graphql",
58
+ * matchers: { toHaveGraphqlData, toHaveGraphqlErrorCode },
59
+ * contracts: { graphql: graphqlAdapter },
60
+ * setup() {
61
+ * // Optional one-time registration work
62
+ * },
63
+ * });
53
64
  * ```
54
65
  */
55
- export declare function definePlugin<T>(create: (runtime: GlubeanRuntime) => T): PluginFactory<T>;
66
+ export declare function definePlugin(manifest: PluginManifest): PluginManifest;
56
67
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,CAAC,GACrC,aAAa,CAAC,CAAC,CAAC,CAElB"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,MAAM,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,CAAC,GACrC,aAAa,CAAC,CAAC,CAAC,CAElB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,cAAc,CAErE"}
package/dist/plugin.js CHANGED
@@ -1,57 +1,70 @@
1
1
  /**
2
- * Plugin definition helper for Glubean SDK.
2
+ * Plugin authoring helpers.
3
3
  *
4
- * Plugin authors use `definePlugin()` to create plugin factories that
5
- * integrate with `configure({ plugins: { ... } })`. This is the recommended
6
- * way to define plugins — it handles the `PluginFactory` phantom type trick
7
- * so plugin authors don't need to understand it.
4
+ * Two APIs live here, one per concept:
8
5
  *
9
- * @example
10
- * ```ts
11
- * import { definePlugin } from "@glubean/sdk";
6
+ * 1. **`definePlugin(manifest)`** — declare a plugin manifest for global
7
+ * registration (matchers, protocol adapters, one-time setup). Consumed by
8
+ * {@link installPlugin} in `./install-plugin.js`. This is the primary API
9
+ * for plugin packages like `@glubean/graphql` and `@glubean/grpc`.
12
10
  *
13
- * export const myPlugin = (opts: MyOptions) =>
14
- * definePlugin((runtime) => {
15
- * const baseUrl = runtime.requireVar(opts.baseUrlKey);
16
- * return new MyClient(baseUrl);
17
- * });
18
- * ```
11
+ * 2. **`defineClientFactory(create)`** declare a lazy client factory for
12
+ * per-file injection via `configure({ plugins })`. This is what the
13
+ * legacy `definePlugin((runtime) => T)` signature used to do; the name
14
+ * has been corrected to describe what it actually is (a client factory,
15
+ * not a plugin).
16
+ *
17
+ * The legacy `definePlugin((runtime) => T)` overload was removed in Phase 3.
18
+ * Migrate call sites to `defineClientFactory((runtime) => T)` for the same
19
+ * behavior and better naming.
19
20
  *
20
21
  * @module plugin
21
22
  */
22
23
  /**
23
- * Create a plugin factory. This is the recommended way to define plugins.
24
+ * Declare a lazy client factory.
24
25
  *
25
- * The factory function receives a `GlubeanRuntime` with access to vars,
26
- * secrets, HTTP client, and template resolution. It is called lazily on
26
+ * The factory function receives a `GlubeanRuntime` (vars / secrets / http /
27
+ * template resolution) and returns a client instance. It is invoked lazily on
27
28
  * first property access during test execution, not at module load time.
28
29
  *
29
- * @param create Factory function that receives the runtime and returns the plugin instance
30
- * @returns A `PluginFactory<T>` suitable for use in `configure({ plugins: { ... } })`
30
+ * Output is consumed by `configure({ plugins: { name: factory } })` for
31
+ * per-file client injection.
32
+ *
33
+ * @param create Factory function receiving the runtime; returns the client.
34
+ * @returns A `ClientFactory<T>` suitable for `configure({ plugins })`.
31
35
  *
32
- * @example Simple plugin
36
+ * @example Simple client
33
37
  * ```ts
34
- * export const myPlugin = (opts: { baseUrlKey: string }) =>
35
- * definePlugin((runtime) => {
38
+ * export const myClient = (opts: { baseUrlKey: string }) =>
39
+ * defineClientFactory((runtime) => {
36
40
  * const baseUrl = runtime.requireVar(opts.baseUrlKey);
37
41
  * return new MyClient(baseUrl);
38
42
  * });
39
43
  * ```
44
+ */
45
+ export function defineClientFactory(create) {
46
+ return { __type: undefined, create };
47
+ }
48
+ /**
49
+ * Declare a plugin manifest for global registration.
40
50
  *
41
- * @example Plugin with auth headers
51
+ * The returned manifest is consumed by `installPlugin(...manifests)` at
52
+ * bootstrap time. A manifest can declare custom matchers, protocol adapters,
53
+ * and a one-time `setup()` hook. See {@link PluginManifest}.
54
+ *
55
+ * @example Plugin manifest
42
56
  * ```ts
43
- * export const graphql = (opts: { endpoint: string; headers?: Record<string, string> }) =>
44
- * definePlugin((runtime) => {
45
- * const url = runtime.requireVar(opts.endpoint);
46
- * const headers: Record<string, string> = {};
47
- * for (const [k, v] of Object.entries(opts.headers ?? {})) {
48
- * headers[k] = runtime.resolveTemplate(v);
49
- * }
50
- * return createGraphQLClient(runtime.http, { endpoint: url, headers });
51
- * });
57
+ * export default definePlugin({
58
+ * name: "@glubean/graphql",
59
+ * matchers: { toHaveGraphqlData, toHaveGraphqlErrorCode },
60
+ * contracts: { graphql: graphqlAdapter },
61
+ * setup() {
62
+ * // Optional one-time registration work
63
+ * },
64
+ * });
52
65
  * ```
53
66
  */
54
- export function definePlugin(create) {
55
- return { __type: undefined, create };
67
+ export function definePlugin(manifest) {
68
+ return manifest;
56
69
  }
57
70
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,YAAY,CAC1B,MAAsC;IAEtC,OAAO,EAAE,MAAM,EAAE,SAAyB,EAAE,MAAM,EAAE,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAQH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAsC;IAEtC,OAAO,EAAE,MAAM,EAAE,SAAyB,EAAE,MAAM,EAAE,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,YAAY,CAAC,QAAwB;IACnD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -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"}