@contractspec/integration.runtime 2.8.0 → 2.10.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.js CHANGED
@@ -253,6 +253,28 @@ class IntegrationCallGuard {
253
253
  return "PROVIDER_ERROR";
254
254
  }
255
255
  }
256
+ var DEFAULT_HEALTH_STRATEGY_ORDER = [
257
+ "official-api",
258
+ "official-mcp",
259
+ "aggregator-api",
260
+ "aggregator-mcp",
261
+ "unofficial"
262
+ ];
263
+ function resolveHealthStrategyOrder(options) {
264
+ const ordered = options?.strategyOrder && options.strategyOrder.length > 0 ? options.strategyOrder : [...DEFAULT_HEALTH_STRATEGY_ORDER];
265
+ if (options?.allowUnofficial) {
266
+ return [...ordered];
267
+ }
268
+ return ordered.filter((item) => item !== "unofficial");
269
+ }
270
+ function isUnofficialHealthProviderAllowed(providerKey, options) {
271
+ if (!options?.allowUnofficial)
272
+ return false;
273
+ if (!options.unofficialAllowList || options.unofficialAllowList.length === 0) {
274
+ return true;
275
+ }
276
+ return options.unofficialAllowList.includes(providerKey);
277
+ }
256
278
  function ensureConnectionReady(integration) {
257
279
  const status = integration.connection.status;
258
280
  if (status === "disconnected" || status === "error") {
@@ -815,8 +837,10 @@ function safeCanHandle(provider, reference) {
815
837
  }
816
838
  }
817
839
  export {
840
+ resolveHealthStrategyOrder,
818
841
  parseSecretUri,
819
842
  normalizeSecretPayload,
843
+ isUnofficialHealthProviderAllowed,
820
844
  ensureConnectionReady,
821
845
  connectionStatusLabel,
822
846
  SecretProviderManager,
@@ -824,5 +848,6 @@ export {
824
848
  IntegrationHealthService,
825
849
  IntegrationCallGuard,
826
850
  GcpSecretManagerProvider,
827
- EnvSecretProvider
851
+ EnvSecretProvider,
852
+ DEFAULT_HEALTH_STRATEGY_ORDER
828
853
  };
@@ -252,6 +252,28 @@ class IntegrationCallGuard {
252
252
  return "PROVIDER_ERROR";
253
253
  }
254
254
  }
255
+ var DEFAULT_HEALTH_STRATEGY_ORDER = [
256
+ "official-api",
257
+ "official-mcp",
258
+ "aggregator-api",
259
+ "aggregator-mcp",
260
+ "unofficial"
261
+ ];
262
+ function resolveHealthStrategyOrder(options) {
263
+ const ordered = options?.strategyOrder && options.strategyOrder.length > 0 ? options.strategyOrder : [...DEFAULT_HEALTH_STRATEGY_ORDER];
264
+ if (options?.allowUnofficial) {
265
+ return [...ordered];
266
+ }
267
+ return ordered.filter((item) => item !== "unofficial");
268
+ }
269
+ function isUnofficialHealthProviderAllowed(providerKey, options) {
270
+ if (!options?.allowUnofficial)
271
+ return false;
272
+ if (!options.unofficialAllowList || options.unofficialAllowList.length === 0) {
273
+ return true;
274
+ }
275
+ return options.unofficialAllowList.includes(providerKey);
276
+ }
255
277
  function ensureConnectionReady(integration) {
256
278
  const status = integration.connection.status;
257
279
  if (status === "disconnected" || status === "error") {
@@ -814,8 +836,10 @@ function safeCanHandle(provider, reference) {
814
836
  }
815
837
  }
816
838
  export {
839
+ resolveHealthStrategyOrder,
817
840
  parseSecretUri,
818
841
  normalizeSecretPayload,
842
+ isUnofficialHealthProviderAllowed,
819
843
  ensureConnectionReady,
820
844
  connectionStatusLabel,
821
845
  SecretProviderManager,
@@ -823,5 +847,6 @@ export {
823
847
  IntegrationHealthService,
824
848
  IntegrationCallGuard,
825
849
  GcpSecretManagerProvider,
826
- EnvSecretProvider
850
+ EnvSecretProvider,
851
+ DEFAULT_HEALTH_STRATEGY_ORDER
827
852
  };
@@ -182,6 +182,28 @@ class IntegrationCallGuard {
182
182
  return "PROVIDER_ERROR";
183
183
  }
184
184
  }
185
+ var DEFAULT_HEALTH_STRATEGY_ORDER = [
186
+ "official-api",
187
+ "official-mcp",
188
+ "aggregator-api",
189
+ "aggregator-mcp",
190
+ "unofficial"
191
+ ];
192
+ function resolveHealthStrategyOrder(options) {
193
+ const ordered = options?.strategyOrder && options.strategyOrder.length > 0 ? options.strategyOrder : [...DEFAULT_HEALTH_STRATEGY_ORDER];
194
+ if (options?.allowUnofficial) {
195
+ return [...ordered];
196
+ }
197
+ return ordered.filter((item) => item !== "unofficial");
198
+ }
199
+ function isUnofficialHealthProviderAllowed(providerKey, options) {
200
+ if (!options?.allowUnofficial)
201
+ return false;
202
+ if (!options.unofficialAllowList || options.unofficialAllowList.length === 0) {
203
+ return true;
204
+ }
205
+ return options.unofficialAllowList.includes(providerKey);
206
+ }
185
207
  function ensureConnectionReady(integration) {
186
208
  const status = integration.connection.status;
187
209
  if (status === "disconnected" || status === "error") {
@@ -202,7 +224,10 @@ function connectionStatusLabel(status) {
202
224
  }
203
225
  }
204
226
  export {
227
+ resolveHealthStrategyOrder,
228
+ isUnofficialHealthProviderAllowed,
205
229
  ensureConnectionReady,
206
230
  connectionStatusLabel,
207
- IntegrationCallGuard
231
+ IntegrationCallGuard,
232
+ DEFAULT_HEALTH_STRATEGY_ORDER
208
233
  };
package/dist/runtime.d.ts CHANGED
@@ -90,5 +90,14 @@ export declare class IntegrationCallGuard {
90
90
  private makeContext;
91
91
  private errorCodeFor;
92
92
  }
93
+ export type HealthTransportStrategy = 'official-api' | 'official-mcp' | 'aggregator-api' | 'aggregator-mcp' | 'unofficial';
94
+ export interface HealthRuntimeStrategyOptions {
95
+ strategyOrder?: HealthTransportStrategy[];
96
+ allowUnofficial?: boolean;
97
+ unofficialAllowList?: string[];
98
+ }
99
+ export declare const DEFAULT_HEALTH_STRATEGY_ORDER: readonly HealthTransportStrategy[];
100
+ export declare function resolveHealthStrategyOrder(options?: HealthRuntimeStrategyOptions): HealthTransportStrategy[];
101
+ export declare function isUnofficialHealthProviderAllowed(providerKey: string, options?: HealthRuntimeStrategyOptions): boolean;
93
102
  export declare function ensureConnectionReady(integration: ResolvedIntegration): void;
94
103
  export declare function connectionStatusLabel(status: ConnectionStatus): string;
package/dist/runtime.js CHANGED
@@ -183,6 +183,28 @@ class IntegrationCallGuard {
183
183
  return "PROVIDER_ERROR";
184
184
  }
185
185
  }
186
+ var DEFAULT_HEALTH_STRATEGY_ORDER = [
187
+ "official-api",
188
+ "official-mcp",
189
+ "aggregator-api",
190
+ "aggregator-mcp",
191
+ "unofficial"
192
+ ];
193
+ function resolveHealthStrategyOrder(options) {
194
+ const ordered = options?.strategyOrder && options.strategyOrder.length > 0 ? options.strategyOrder : [...DEFAULT_HEALTH_STRATEGY_ORDER];
195
+ if (options?.allowUnofficial) {
196
+ return [...ordered];
197
+ }
198
+ return ordered.filter((item) => item !== "unofficial");
199
+ }
200
+ function isUnofficialHealthProviderAllowed(providerKey, options) {
201
+ if (!options?.allowUnofficial)
202
+ return false;
203
+ if (!options.unofficialAllowList || options.unofficialAllowList.length === 0) {
204
+ return true;
205
+ }
206
+ return options.unofficialAllowList.includes(providerKey);
207
+ }
186
208
  function ensureConnectionReady(integration) {
187
209
  const status = integration.connection.status;
188
210
  if (status === "disconnected" || status === "error") {
@@ -203,7 +225,10 @@ function connectionStatusLabel(status) {
203
225
  }
204
226
  }
205
227
  export {
228
+ resolveHealthStrategyOrder,
229
+ isUnofficialHealthProviderAllowed,
206
230
  ensureConnectionReady,
207
231
  connectionStatusLabel,
208
- IntegrationCallGuard
232
+ IntegrationCallGuard,
233
+ DEFAULT_HEALTH_STRATEGY_ORDER
209
234
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/integration.runtime",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Runtime integration with secret management",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -31,16 +31,16 @@
31
31
  "typecheck": "tsc --noEmit"
32
32
  },
33
33
  "dependencies": {
34
- "@contractspec/lib.contracts-spec": "2.8.0",
35
- "@contractspec/lib.contracts-integrations": "2.8.0",
36
- "@contractspec/lib.logger": "2.8.0",
34
+ "@contractspec/lib.contracts-spec": "2.10.0",
35
+ "@contractspec/lib.contracts-integrations": "2.10.0",
36
+ "@contractspec/lib.logger": "2.9.0",
37
37
  "@google-cloud/secret-manager": "^6.1.1",
38
38
  "google-gax": "^5.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@contractspec/tool.typescript": "2.8.0",
41
+ "@contractspec/tool.typescript": "2.9.0",
42
42
  "typescript": "^5.9.3",
43
- "@contractspec/tool.bun": "2.8.0"
43
+ "@contractspec/tool.bun": "2.9.0"
44
44
  },
45
45
  "exports": {
46
46
  ".": {