@omnicross/core 0.1.4 → 0.1.6
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/ApiConverter.cjs +2 -2
- package/dist/ApiConverter.js +1 -1
- package/dist/{CompletionService-DdWaAxq0.d.ts → CompletionService-C3BX0Ovy.d.ts} +4 -3
- package/dist/{CompletionService-D3a47vdU.d.cts → CompletionService-kNA17cfI.d.cts} +4 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +7 -5
- package/dist/auth/GeminiCodeAssistProjectResolver.js +5 -3
- package/dist/{chunk-HRRYG2AX.js → chunk-23S5OPIO.js} +10 -1
- package/dist/chunk-25GXJCEZ.cjs +40 -0
- package/dist/chunk-2JYRIADS.js +40 -0
- package/dist/chunk-3Z5BQZFM.cjs +52 -0
- package/dist/{chunk-4VAVYUZS.cjs → chunk-4VLRHHFE.cjs} +82 -40
- package/dist/{chunk-VACWOIRE.cjs → chunk-4VZX5F4T.cjs} +39 -15
- package/dist/{chunk-FTQ7IQUC.js → chunk-6CL5HTPQ.js} +52 -10
- package/dist/chunk-6QQG7YG3.cjs +153 -0
- package/dist/{chunk-SU2GCLAC.cjs → chunk-6VUQPOV3.cjs} +359 -60
- package/dist/chunk-7AK7B36B.cjs +44 -0
- package/dist/{chunk-5ZQBEOMD.js → chunk-AT7B7SOZ.js} +25 -2
- package/dist/{chunk-IK3KE3AU.js → chunk-DE2SRBFZ.js} +1 -1
- package/dist/chunk-DLXZEZWO.cjs +285 -0
- package/dist/{chunk-UHGVBFU3.js → chunk-EBLFCNPY.js} +38 -14
- package/dist/chunk-EJLH6NFT.cjs +166 -0
- package/dist/chunk-HVBBDBS3.cjs +350 -0
- package/dist/{chunk-7Y47UCF2.js → chunk-IFXJ2BG7.js} +5 -38
- package/dist/{chunk-46ZIFWYG.cjs → chunk-IIRPUVPH.cjs} +7 -1
- package/dist/{chunk-YGXJGRFI.cjs → chunk-KBM2W6UY.cjs} +111 -24
- package/dist/{chunk-OCEUVQHW.cjs → chunk-KCVJWJST.cjs} +73 -3
- package/dist/chunk-LB6EBS6Y.js +69 -0
- package/dist/{chunk-C7PSERMH.js → chunk-LVUCAWMK.js} +1 -1
- package/dist/chunk-MKF46GNZ.js +350 -0
- package/dist/{chunk-HYN75H6G.cjs → chunk-MUHWHQVM.cjs} +1 -1
- package/dist/{chunk-Z7Y2NPHY.js → chunk-N5T4M4GU.js} +1 -1
- package/dist/{chunk-TIER4SUC.js → chunk-OEWZUX4G.js} +346 -47
- package/dist/chunk-OF3BECU2.cjs +69 -0
- package/dist/{chunk-RSJ3TWJQ.cjs → chunk-OKMJLEXX.cjs} +5 -5
- package/dist/chunk-OPRS4IQZ.js +153 -0
- package/dist/{chunk-XK5CIRMQ.js → chunk-SIZQQD6T.js} +72 -2
- package/dist/{chunk-DKPXN34V.cjs → chunk-SQYVORNP.cjs} +1334 -510
- package/dist/chunk-SYQF7OIR.js +52 -0
- package/dist/{chunk-S4WBV25P.js → chunk-TOVPMMHM.js} +111 -24
- package/dist/{chunk-QYTT6GE3.js → chunk-UDCC7EMR.js} +1093 -269
- package/dist/{chunk-E3UCVHLP.cjs → chunk-UNWKG6EI.cjs} +5 -38
- package/dist/{chunk-ZLX3KGXX.js → chunk-UX7VWA46.js} +135 -23
- package/dist/{chunk-7YN22L2H.cjs → chunk-V4TXMEJS.cjs} +5 -5
- package/dist/chunk-VRFBB5DB.js +44 -0
- package/dist/chunk-WB6PH56J.js +166 -0
- package/dist/{chunk-G2UTNSGU.js → chunk-WNKWAEUR.js} +7 -1
- package/dist/{chunk-SUEGJ75D.cjs → chunk-WYTEQ4Q5.cjs} +25 -2
- package/dist/{chunk-5ENKBSWO.js → chunk-YJVHCHQX.js} +42 -6
- package/dist/{chunk-VQY5W4YW.cjs → chunk-YK57NMIF.cjs} +44 -8
- package/dist/{chunk-KFI44N2R.cjs → chunk-YNJNTCSQ.cjs} +10 -1
- package/dist/completion/ApiKeyPoolService.cjs +12 -0
- package/dist/completion/ApiKeyPoolService.d.cts +6 -0
- package/dist/completion/ApiKeyPoolService.d.ts +6 -0
- package/dist/completion/ApiKeyPoolService.js +12 -0
- package/dist/completion/CompletionService.cjs +27 -24
- package/dist/completion/CompletionService.d.cts +2 -1
- package/dist/completion/CompletionService.d.ts +2 -1
- package/dist/completion/CompletionService.js +26 -23
- package/dist/completion.cjs +27 -24
- package/dist/completion.d.cts +2 -1
- package/dist/completion.d.ts +2 -1
- package/dist/completion.js +26 -23
- package/dist/index.cjs +53 -29
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +56 -32
- package/dist/{keyPolicy-Cp0FntZl.d.cts → keyPolicy-zdWTu3CQ.d.cts} +1 -1
- package/dist/{keyPolicy-Cp0FntZl.d.ts → keyPolicy-zdWTu3CQ.d.ts} +1 -1
- package/dist/outbound-api/auditCapture.cjs +2 -2
- package/dist/outbound-api/auditCapture.d.cts +5 -3
- package/dist/outbound-api/auditCapture.d.ts +5 -3
- package/dist/outbound-api/auditCapture.js +1 -1
- package/dist/outbound-api/quotaWarn.d.cts +1 -1
- package/dist/outbound-api/quotaWarn.d.ts +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +4 -3
- package/dist/outbound-api/routeResolver.d.ts +4 -3
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +1 -0
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +1 -0
- package/dist/outbound-api/types.d.cts +3 -2
- package/dist/outbound-api/types.d.ts +3 -2
- package/dist/outbound-api.cjs +49 -25
- package/dist/outbound-api.d.cts +127 -85
- package/dist/outbound-api.d.ts +127 -85
- package/dist/outbound-api.js +52 -28
- package/dist/pipeline/AccountAllowanceScheduling.cjs +15 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +90 -0
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +90 -0
- package/dist/pipeline/AccountAllowanceScheduling.js +15 -0
- package/dist/pipeline/AccountAllowanceStore.cjs +20 -0
- package/dist/pipeline/AccountAllowanceStore.d.cts +77 -0
- package/dist/pipeline/AccountAllowanceStore.d.ts +77 -0
- package/dist/pipeline/AccountAllowanceStore.js +20 -0
- package/dist/pipeline/AuthSource.d.cts +11 -2
- package/dist/pipeline/AuthSource.d.ts +11 -2
- package/dist/pipeline/BoundAccountSelectionError.cjs +10 -0
- package/dist/pipeline/BoundAccountSelectionError.d.cts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.d.ts +28 -0
- package/dist/pipeline/BoundAccountSelectionError.js +10 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.cts +1 -0
- package/dist/pipeline/LlmConfigProviderAuth.d.ts +1 -0
- package/dist/pipeline/SubscriptionAccountHealth.cjs +4 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +34 -6
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +34 -6
- package/dist/pipeline/SubscriptionAccountHealth.js +3 -1
- package/dist/pipeline/SubscriptionAuthSource.cjs +5 -2
- package/dist/pipeline/SubscriptionAuthSource.d.cts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.d.ts +1 -0
- package/dist/pipeline/SubscriptionAuthSource.js +4 -1
- package/dist/pipeline/SubscriptionAuthStrategy.d.cts +8 -3
- package/dist/pipeline/SubscriptionAuthStrategy.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +8 -3
- package/dist/pipeline/executeProviderCall.d.ts +8 -3
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/resolveProviderChain.d.cts +2 -3
- package/dist/pipeline/resolveProviderChain.d.ts +2 -3
- package/dist/pipeline/resolveSubscriptionChain.d.cts +1 -0
- package/dist/pipeline/resolveSubscriptionChain.d.ts +1 -0
- package/dist/pipeline/upstreamFetch.cjs +4 -2
- package/dist/pipeline/upstreamFetch.d.cts +6 -0
- package/dist/pipeline/upstreamFetch.d.ts +6 -0
- package/dist/pipeline/upstreamFetch.js +3 -1
- package/dist/pipeline/upstreamTrace.cjs +14 -0
- package/dist/pipeline/upstreamTrace.d.cts +85 -0
- package/dist/pipeline/upstreamTrace.d.ts +85 -0
- package/dist/pipeline/upstreamTrace.js +14 -0
- package/dist/ports/pricing-store.d.cts +4 -3
- package/dist/ports/pricing-store.d.ts +4 -3
- package/dist/ports.d.cts +4 -3
- package/dist/ports.d.ts +4 -3
- package/dist/provider-proxy/ProviderProxy.cjs +27 -24
- package/dist/provider-proxy/ProviderProxy.d.cts +1 -0
- package/dist/provider-proxy/ProviderProxy.d.ts +1 -0
- package/dist/provider-proxy/ProviderProxy.js +26 -23
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +31 -24
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +50 -5
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +50 -5
- package/dist/provider-proxy/ingress/providerProxyShared.js +30 -23
- package/dist/provider-proxy/matchText.cjs +4 -2
- package/dist/provider-proxy/matchText.d.cts +41 -6
- package/dist/provider-proxy/matchText.d.ts +41 -6
- package/dist/provider-proxy/matchText.js +3 -1
- package/dist/provider-proxy/types.d.cts +30 -2
- package/dist/provider-proxy/types.d.ts +30 -2
- package/dist/provider-proxy.cjs +27 -24
- package/dist/provider-proxy.d.cts +1 -0
- package/dist/provider-proxy.d.ts +1 -0
- package/dist/provider-proxy.js +26 -23
- package/dist/{routeResolver-C4T7yClx.d.ts → routeResolver-CHTv_Bs5.d.ts} +1 -1
- package/dist/{routeResolver-CB3tvJKy.d.cts → routeResolver-kepxnfcC.d.cts} +1 -1
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +2 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +1 -1
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
- package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.cts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.d.ts +1 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +1 -1
- package/dist/transformer/transformers/OpenAITransformer.cjs +6 -0
- package/dist/transformer/transformers/OpenAITransformer.d.cts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.d.ts +68 -0
- package/dist/transformer/transformers/OpenAITransformer.js +6 -0
- package/dist/transformer/transformers.cjs +8 -14
- package/dist/transformer/transformers.d.cts +12 -48
- package/dist/transformer/transformers.d.ts +12 -48
- package/dist/transformer/transformers.js +11 -17
- package/dist/transformer/types.d.cts +17 -0
- package/dist/transformer/types.d.ts +17 -0
- package/dist/transformer.cjs +11 -12
- package/dist/transformer.d.cts +1 -2
- package/dist/transformer.d.ts +1 -2
- package/dist/transformer.js +11 -12
- package/dist/{types-B8Arpxn0.d.cts → types-H3wGZSOo.d.cts} +134 -7
- package/dist/{types-lgPYQuZS.d.ts → types-hsoKrVQS.d.ts} +134 -7
- package/dist/usage/pricing-engine.cjs +2 -2
- package/dist/usage/pricing-engine.d.cts +9 -1
- package/dist/usage/pricing-engine.d.ts +9 -1
- package/dist/usage/pricing-engine.js +1 -1
- package/dist/usage.cjs +2 -2
- package/dist/usage.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-C72S6TTV.cjs +0 -49
- package/dist/chunk-DWKQZ2SK.cjs +0 -254
- package/dist/chunk-IAXWICZU.js +0 -69
- package/dist/chunk-QWBWGODS.cjs +0 -69
- package/dist/chunk-RGTR7CIO.cjs +0 -235
- package/dist/chunk-VPBAUQ2M.js +0 -235
- package/dist/chunk-YMFAJFQT.cjs +0 -173
- package/dist/chunk-Z7LUNECE.js +0 -49
- package/dist/chunk-ZJZAOKI7.js +0 -254
- package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +0 -6
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.cts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.d.ts +0 -51
- package/dist/transformer/transformers/OpenCodeGoTransformer.js +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.cjs +0 -6
- package/dist/transformer/transformers/ReasoningTransformer.d.cts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.d.ts +0 -47
- package/dist/transformer/transformers/ReasoningTransformer.js +0 -6
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BoundAccountFallbackPolicy } from './BoundAccountSelectionError.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* AuthSource — unified outbound-authentication strategy for the provider
|
|
3
5
|
* request pipeline.
|
|
@@ -54,10 +56,17 @@ interface AuthApplyHints {
|
|
|
54
56
|
reportSelection?: (accountId: string, isActive: boolean, remappedModel?: string) => void;
|
|
55
57
|
/**
|
|
56
58
|
* OPTIONAL preferred subscription account id (provider/subscription duality).
|
|
57
|
-
* When set
|
|
58
|
-
*
|
|
59
|
+
* When set, strict is the default; only the explicit `'pool'` policy permits
|
|
60
|
+
* pool fallback. BYO auth sources ignore both binding hints.
|
|
59
61
|
*/
|
|
60
62
|
preferredAccountId?: string;
|
|
63
|
+
/** Optional account group selected by a resource-level gateway binding. */
|
|
64
|
+
preferredAccountGroup?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Binding behavior. `'pool'` is an explicit opt-in; any other value used
|
|
67
|
+
* with a preferred account is treated as strict by the selector.
|
|
68
|
+
*/
|
|
69
|
+
boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
61
70
|
}
|
|
62
71
|
/**
|
|
63
72
|
* Result of {@link AuthSource.onResult}.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunk25GXJCEZcjs = require('../chunk-25GXJCEZ.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.BoundAccountSelectionError = _chunk25GXJCEZcjs.BoundAccountSelectionError; exports.boundAccountSelectionMessage = _chunk25GXJCEZcjs.boundAccountSelectionMessage; exports.isBoundAccountSelectionError = _chunk25GXJCEZcjs.isBoundAccountSelectionError;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret-free failure contract for a strict outbound subscription-account
|
|
3
|
+
* binding. The selector throws this value only when an endpoint explicitly (or
|
|
4
|
+
* by the migrated default) requires its bound account to serve the request.
|
|
5
|
+
*/
|
|
6
|
+
/** Persisted policy for an endpoint that binds a subscription account. */
|
|
7
|
+
type BoundAccountFallbackPolicy = 'strict' | 'pool';
|
|
8
|
+
/** Bounded reasons a strict bound account can refuse a request. */
|
|
9
|
+
type BoundAccountSelectionFailureReason = 'unavailable' | 'not-found' | 'disabled' | 'unhealthy' | 'model-incompatible' | 'allowance-paused' | 'empty-token';
|
|
10
|
+
/** Return the fixed public message for a validated failure reason. */
|
|
11
|
+
declare function boundAccountSelectionMessage(reason: BoundAccountSelectionFailureReason): string;
|
|
12
|
+
/**
|
|
13
|
+
* Stable, non-secret error thrown by strict account selection. Account ids and
|
|
14
|
+
* token material are intentionally absent from both the message and the wire
|
|
15
|
+
* projection; the reason is a small fixed vocabulary.
|
|
16
|
+
*/
|
|
17
|
+
declare class BoundAccountSelectionError extends Error {
|
|
18
|
+
readonly providerId: string;
|
|
19
|
+
readonly reason: BoundAccountSelectionFailureReason;
|
|
20
|
+
readonly resumeAt?: string | undefined;
|
|
21
|
+
readonly code: "bound_account_unavailable";
|
|
22
|
+
readonly status: 429 | 503;
|
|
23
|
+
constructor(providerId: string, reason: BoundAccountSelectionFailureReason, resumeAt?: string | undefined);
|
|
24
|
+
}
|
|
25
|
+
/** Structural guard that survives package/bundle boundaries. */
|
|
26
|
+
declare function isBoundAccountSelectionError(error: unknown): error is BoundAccountSelectionError;
|
|
27
|
+
|
|
28
|
+
export { type BoundAccountFallbackPolicy, BoundAccountSelectionError, type BoundAccountSelectionFailureReason, boundAccountSelectionMessage, isBoundAccountSelectionError };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret-free failure contract for a strict outbound subscription-account
|
|
3
|
+
* binding. The selector throws this value only when an endpoint explicitly (or
|
|
4
|
+
* by the migrated default) requires its bound account to serve the request.
|
|
5
|
+
*/
|
|
6
|
+
/** Persisted policy for an endpoint that binds a subscription account. */
|
|
7
|
+
type BoundAccountFallbackPolicy = 'strict' | 'pool';
|
|
8
|
+
/** Bounded reasons a strict bound account can refuse a request. */
|
|
9
|
+
type BoundAccountSelectionFailureReason = 'unavailable' | 'not-found' | 'disabled' | 'unhealthy' | 'model-incompatible' | 'allowance-paused' | 'empty-token';
|
|
10
|
+
/** Return the fixed public message for a validated failure reason. */
|
|
11
|
+
declare function boundAccountSelectionMessage(reason: BoundAccountSelectionFailureReason): string;
|
|
12
|
+
/**
|
|
13
|
+
* Stable, non-secret error thrown by strict account selection. Account ids and
|
|
14
|
+
* token material are intentionally absent from both the message and the wire
|
|
15
|
+
* projection; the reason is a small fixed vocabulary.
|
|
16
|
+
*/
|
|
17
|
+
declare class BoundAccountSelectionError extends Error {
|
|
18
|
+
readonly providerId: string;
|
|
19
|
+
readonly reason: BoundAccountSelectionFailureReason;
|
|
20
|
+
readonly resumeAt?: string | undefined;
|
|
21
|
+
readonly code: "bound_account_unavailable";
|
|
22
|
+
readonly status: 429 | 503;
|
|
23
|
+
constructor(providerId: string, reason: BoundAccountSelectionFailureReason, resumeAt?: string | undefined);
|
|
24
|
+
}
|
|
25
|
+
/** Structural guard that survives package/bundle boundaries. */
|
|
26
|
+
declare function isBoundAccountSelectionError(error: unknown): error is BoundAccountSelectionError;
|
|
27
|
+
|
|
28
|
+
export { type BoundAccountFallbackPolicy, BoundAccountSelectionError, type BoundAccountSelectionFailureReason, boundAccountSelectionMessage, isBoundAccountSelectionError };
|
|
@@ -2,6 +2,7 @@ import { LLMProvider } from '@omnicross/contracts/llm-config';
|
|
|
2
2
|
import { ApiKeyPoolService } from '../completion/ApiKeyPoolService.cjs';
|
|
3
3
|
import { AuthSource, AuthApplyHints, AuthResultOutcome } from './AuthSource.cjs';
|
|
4
4
|
import '../logger-4GvQNzhE.cjs';
|
|
5
|
+
import './BoundAccountSelectionError.cjs';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* LlmConfigProviderAuth — `AuthSource` for LLM-config provider rows.
|
|
@@ -2,6 +2,7 @@ import { LLMProvider } from '@omnicross/contracts/llm-config';
|
|
|
2
2
|
import { ApiKeyPoolService } from '../completion/ApiKeyPoolService.js';
|
|
3
3
|
import { AuthSource, AuthApplyHints, AuthResultOutcome } from './AuthSource.js';
|
|
4
4
|
import '../logger-4GvQNzhE.js';
|
|
5
|
+
import './BoundAccountSelectionError.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* LlmConfigProviderAuth — `AuthSource` for LLM-config provider rows.
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var _chunkVQY5W4YWcjs = require('../chunk-VQY5W4YW.cjs');
|
|
12
11
|
|
|
12
|
+
var _chunkYK57NMIFcjs = require('../chunk-YK57NMIF.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -19,4 +19,6 @@ var _chunkVQY5W4YWcjs = require('../chunk-VQY5W4YW.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT = _chunkYK57NMIFcjs.ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT; exports.AUTH_ERROR_TTL_MS = _chunkYK57NMIFcjs.AUTH_ERROR_TTL_MS; exports.OVERLOAD_ENABLED_DEFAULT = _chunkYK57NMIFcjs.OVERLOAD_ENABLED_DEFAULT; exports.OVERLOAD_TTL_MS = _chunkYK57NMIFcjs.OVERLOAD_TTL_MS; exports.SERVER_ERROR_TTL_MS = _chunkYK57NMIFcjs.SERVER_ERROR_TTL_MS; exports.SubscriptionAccountHealth = _chunkYK57NMIFcjs.SubscriptionAccountHealth; exports.__resetSharedAccountHealthForTests = _chunkYK57NMIFcjs.__resetSharedAccountHealthForTests; exports.getSharedAccountHealth = _chunkYK57NMIFcjs.getSharedAccountHealth; exports.resolveResetSeconds = _chunkYK57NMIFcjs.resolveResetSeconds; exports.setSharedAccountHealth = _chunkYK57NMIFcjs.setSharedAccountHealth;
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
declare const OVERLOAD_TTL_MS: number;
|
|
28
28
|
/** 529 overload cooldown enabled by default (LEAD OQ1). */
|
|
29
29
|
declare const OVERLOAD_ENABLED_DEFAULT = true;
|
|
30
|
-
/** Transient cooldown for a final
|
|
30
|
+
/** Transient cooldown for a final 401 or non-ban 403 response. */
|
|
31
31
|
declare const AUTH_ERROR_TTL_MS: number;
|
|
32
|
-
/** Transient cooldown for a 5xx
|
|
32
|
+
/** Transient cooldown for a 5xx response or network failure. */
|
|
33
33
|
declare const SERVER_ERROR_TTL_MS: number;
|
|
34
34
|
/** Per-account health record (all timers are epoch ms). Absent fields ⇒ healthy. */
|
|
35
35
|
interface HealthRecord {
|
|
@@ -89,6 +89,30 @@ interface AccountAnomalyEvent {
|
|
|
89
89
|
}
|
|
90
90
|
/** An anomaly listener (fire-and-forget; the emitter never awaits it). */
|
|
91
91
|
type AccountAnomalyListener = (event: AccountAnomalyEvent) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Admin-readable projection of the existing health event stream. It is kept in
|
|
94
|
+
* the tracker itself so webhooks and diagnostics consume the same edge events;
|
|
95
|
+
* this is not a second marking/event mechanism. Only opaque ids, timestamps,
|
|
96
|
+
* and coarse states are retained.
|
|
97
|
+
*/
|
|
98
|
+
type AccountHealthDiagnostic = {
|
|
99
|
+
kind: 'health-anomaly';
|
|
100
|
+
providerId: string;
|
|
101
|
+
accountId: string;
|
|
102
|
+
at: number;
|
|
103
|
+
state: AccountAnomalyState;
|
|
104
|
+
} | {
|
|
105
|
+
kind: 'health-recovery';
|
|
106
|
+
providerId: string;
|
|
107
|
+
accountId: string;
|
|
108
|
+
at: number;
|
|
109
|
+
};
|
|
110
|
+
interface AccountHealthDiagnosticFilter {
|
|
111
|
+
providerId?: string;
|
|
112
|
+
accountId?: string;
|
|
113
|
+
limit?: number;
|
|
114
|
+
}
|
|
115
|
+
declare const ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT = 200;
|
|
92
116
|
/** The inputs one upstream attempt contributes to health marking (design D3). */
|
|
93
117
|
interface RecordUpstreamOutcomeInput {
|
|
94
118
|
/** The final HTTP status, or `null` for a thrown / network failure. */
|
|
@@ -134,6 +158,7 @@ declare class SubscriptionAccountHealth {
|
|
|
134
158
|
private readonly records;
|
|
135
159
|
private readonly listeners;
|
|
136
160
|
private readonly anomalyListeners;
|
|
161
|
+
private readonly diagnostics;
|
|
137
162
|
private readonly now;
|
|
138
163
|
private overloadEnabled;
|
|
139
164
|
private overloadTtlMs;
|
|
@@ -150,14 +175,14 @@ declare class SubscriptionAccountHealth {
|
|
|
150
175
|
configure(opts: Pick<SubscriptionAccountHealthOptions, 'overloadEnabled' | 'overloadTtlMs' | 'authErrorTtlMs' | 'serverErrorTtlMs'>): void;
|
|
151
176
|
/**
|
|
152
177
|
* Whether an account may be scheduled RIGHT NOW. `blocked` → false; any timer
|
|
153
|
-
* still in the future → false. Expired timers are lazily deleted on read
|
|
154
|
-
*
|
|
178
|
+
* still in the future → false. Expired timers are lazily deleted on read so
|
|
179
|
+
* an elapsed cooldown restores the account WITHOUT a
|
|
155
180
|
* timer — but the recovery SIGNAL is the sweeper's job (`sweepRecoveries`), so
|
|
156
181
|
* this read never emits (correctness is independent of the tick).
|
|
157
182
|
*/
|
|
158
183
|
isSchedulable(providerId: string, accountId: string, now?: number): boolean;
|
|
159
184
|
/**
|
|
160
|
-
* The single marking entry point (design D3)
|
|
185
|
+
* The single marking entry point (design D3):
|
|
161
186
|
* - 429 + authoritative reset → `rateLimitEndAt`; a non-claude 429 may use
|
|
162
187
|
* `retryAfterSeconds`; a bare 429 (no resolvable reset) is NOT marked;
|
|
163
188
|
* - 529 → `overloadUntil` (gated by `overloadEnabled`);
|
|
@@ -194,6 +219,8 @@ declare class SubscriptionAccountHealth {
|
|
|
194
219
|
sweepRecoveries(now?: number): AccountRecoveryEvent[];
|
|
195
220
|
/** Admin-facing coarse status + cooldown-until for one account (secret-free). */
|
|
196
221
|
getStatus(providerId: string, accountId: string, now?: number): AccountHealthStatus;
|
|
222
|
+
/** Return newest-first, bounded, secret-free health edge diagnostics. */
|
|
223
|
+
getDiagnostics(filter?: AccountHealthDiagnosticFilter): AccountHealthDiagnostic[];
|
|
197
224
|
/**
|
|
198
225
|
* Register a recovery listener (the OQ3 seam #5 webhooks + #8 health-cron
|
|
199
226
|
* consume). Returns an unsubscribe function. Two edges fire it:
|
|
@@ -216,6 +243,7 @@ declare class SubscriptionAccountHealth {
|
|
|
216
243
|
*/
|
|
217
244
|
onAnomaly(listener: AccountAnomalyListener): () => void;
|
|
218
245
|
private emitAnomaly;
|
|
246
|
+
private recordDiagnostic;
|
|
219
247
|
/**
|
|
220
248
|
* Delete every EXPIRED timer field on the record in place; return whether any
|
|
221
249
|
* timer is STILL active (in the future). `blocked` is not a timer and is left
|
|
@@ -232,4 +260,4 @@ declare function setSharedAccountHealth(instance: SubscriptionAccountHealth): vo
|
|
|
232
260
|
/** Reset the shared singleton (tests / teardown only). */
|
|
233
261
|
declare function __resetSharedAccountHealthForTests(): void;
|
|
234
262
|
|
|
235
|
-
export { AUTH_ERROR_TTL_MS, type AccountAnomalyEvent, type AccountAnomalyListener, type AccountAnomalyState, type AccountHealthState, type AccountHealthStatus, type AccountRecoveryEvent, type AccountRecoveryListener, type HeadersLike, type HealthRecord, OVERLOAD_ENABLED_DEFAULT, OVERLOAD_TTL_MS, type RecordUpstreamOutcomeInput, SERVER_ERROR_TTL_MS, SubscriptionAccountHealth, type SubscriptionAccountHealthOptions, __resetSharedAccountHealthForTests, getSharedAccountHealth, resolveResetSeconds, setSharedAccountHealth };
|
|
263
|
+
export { ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT, AUTH_ERROR_TTL_MS, type AccountAnomalyEvent, type AccountAnomalyListener, type AccountAnomalyState, type AccountHealthDiagnostic, type AccountHealthDiagnosticFilter, type AccountHealthState, type AccountHealthStatus, type AccountRecoveryEvent, type AccountRecoveryListener, type HeadersLike, type HealthRecord, OVERLOAD_ENABLED_DEFAULT, OVERLOAD_TTL_MS, type RecordUpstreamOutcomeInput, SERVER_ERROR_TTL_MS, SubscriptionAccountHealth, type SubscriptionAccountHealthOptions, __resetSharedAccountHealthForTests, getSharedAccountHealth, resolveResetSeconds, setSharedAccountHealth };
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
declare const OVERLOAD_TTL_MS: number;
|
|
28
28
|
/** 529 overload cooldown enabled by default (LEAD OQ1). */
|
|
29
29
|
declare const OVERLOAD_ENABLED_DEFAULT = true;
|
|
30
|
-
/** Transient cooldown for a final
|
|
30
|
+
/** Transient cooldown for a final 401 or non-ban 403 response. */
|
|
31
31
|
declare const AUTH_ERROR_TTL_MS: number;
|
|
32
|
-
/** Transient cooldown for a 5xx
|
|
32
|
+
/** Transient cooldown for a 5xx response or network failure. */
|
|
33
33
|
declare const SERVER_ERROR_TTL_MS: number;
|
|
34
34
|
/** Per-account health record (all timers are epoch ms). Absent fields ⇒ healthy. */
|
|
35
35
|
interface HealthRecord {
|
|
@@ -89,6 +89,30 @@ interface AccountAnomalyEvent {
|
|
|
89
89
|
}
|
|
90
90
|
/** An anomaly listener (fire-and-forget; the emitter never awaits it). */
|
|
91
91
|
type AccountAnomalyListener = (event: AccountAnomalyEvent) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Admin-readable projection of the existing health event stream. It is kept in
|
|
94
|
+
* the tracker itself so webhooks and diagnostics consume the same edge events;
|
|
95
|
+
* this is not a second marking/event mechanism. Only opaque ids, timestamps,
|
|
96
|
+
* and coarse states are retained.
|
|
97
|
+
*/
|
|
98
|
+
type AccountHealthDiagnostic = {
|
|
99
|
+
kind: 'health-anomaly';
|
|
100
|
+
providerId: string;
|
|
101
|
+
accountId: string;
|
|
102
|
+
at: number;
|
|
103
|
+
state: AccountAnomalyState;
|
|
104
|
+
} | {
|
|
105
|
+
kind: 'health-recovery';
|
|
106
|
+
providerId: string;
|
|
107
|
+
accountId: string;
|
|
108
|
+
at: number;
|
|
109
|
+
};
|
|
110
|
+
interface AccountHealthDiagnosticFilter {
|
|
111
|
+
providerId?: string;
|
|
112
|
+
accountId?: string;
|
|
113
|
+
limit?: number;
|
|
114
|
+
}
|
|
115
|
+
declare const ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT = 200;
|
|
92
116
|
/** The inputs one upstream attempt contributes to health marking (design D3). */
|
|
93
117
|
interface RecordUpstreamOutcomeInput {
|
|
94
118
|
/** The final HTTP status, or `null` for a thrown / network failure. */
|
|
@@ -134,6 +158,7 @@ declare class SubscriptionAccountHealth {
|
|
|
134
158
|
private readonly records;
|
|
135
159
|
private readonly listeners;
|
|
136
160
|
private readonly anomalyListeners;
|
|
161
|
+
private readonly diagnostics;
|
|
137
162
|
private readonly now;
|
|
138
163
|
private overloadEnabled;
|
|
139
164
|
private overloadTtlMs;
|
|
@@ -150,14 +175,14 @@ declare class SubscriptionAccountHealth {
|
|
|
150
175
|
configure(opts: Pick<SubscriptionAccountHealthOptions, 'overloadEnabled' | 'overloadTtlMs' | 'authErrorTtlMs' | 'serverErrorTtlMs'>): void;
|
|
151
176
|
/**
|
|
152
177
|
* Whether an account may be scheduled RIGHT NOW. `blocked` → false; any timer
|
|
153
|
-
* still in the future → false. Expired timers are lazily deleted on read
|
|
154
|
-
*
|
|
178
|
+
* still in the future → false. Expired timers are lazily deleted on read so
|
|
179
|
+
* an elapsed cooldown restores the account WITHOUT a
|
|
155
180
|
* timer — but the recovery SIGNAL is the sweeper's job (`sweepRecoveries`), so
|
|
156
181
|
* this read never emits (correctness is independent of the tick).
|
|
157
182
|
*/
|
|
158
183
|
isSchedulable(providerId: string, accountId: string, now?: number): boolean;
|
|
159
184
|
/**
|
|
160
|
-
* The single marking entry point (design D3)
|
|
185
|
+
* The single marking entry point (design D3):
|
|
161
186
|
* - 429 + authoritative reset → `rateLimitEndAt`; a non-claude 429 may use
|
|
162
187
|
* `retryAfterSeconds`; a bare 429 (no resolvable reset) is NOT marked;
|
|
163
188
|
* - 529 → `overloadUntil` (gated by `overloadEnabled`);
|
|
@@ -194,6 +219,8 @@ declare class SubscriptionAccountHealth {
|
|
|
194
219
|
sweepRecoveries(now?: number): AccountRecoveryEvent[];
|
|
195
220
|
/** Admin-facing coarse status + cooldown-until for one account (secret-free). */
|
|
196
221
|
getStatus(providerId: string, accountId: string, now?: number): AccountHealthStatus;
|
|
222
|
+
/** Return newest-first, bounded, secret-free health edge diagnostics. */
|
|
223
|
+
getDiagnostics(filter?: AccountHealthDiagnosticFilter): AccountHealthDiagnostic[];
|
|
197
224
|
/**
|
|
198
225
|
* Register a recovery listener (the OQ3 seam #5 webhooks + #8 health-cron
|
|
199
226
|
* consume). Returns an unsubscribe function. Two edges fire it:
|
|
@@ -216,6 +243,7 @@ declare class SubscriptionAccountHealth {
|
|
|
216
243
|
*/
|
|
217
244
|
onAnomaly(listener: AccountAnomalyListener): () => void;
|
|
218
245
|
private emitAnomaly;
|
|
246
|
+
private recordDiagnostic;
|
|
219
247
|
/**
|
|
220
248
|
* Delete every EXPIRED timer field on the record in place; return whether any
|
|
221
249
|
* timer is STILL active (in the future). `blocked` is not a timer and is left
|
|
@@ -232,4 +260,4 @@ declare function setSharedAccountHealth(instance: SubscriptionAccountHealth): vo
|
|
|
232
260
|
/** Reset the shared singleton (tests / teardown only). */
|
|
233
261
|
declare function __resetSharedAccountHealthForTests(): void;
|
|
234
262
|
|
|
235
|
-
export { AUTH_ERROR_TTL_MS, type AccountAnomalyEvent, type AccountAnomalyListener, type AccountAnomalyState, type AccountHealthState, type AccountHealthStatus, type AccountRecoveryEvent, type AccountRecoveryListener, type HeadersLike, type HealthRecord, OVERLOAD_ENABLED_DEFAULT, OVERLOAD_TTL_MS, type RecordUpstreamOutcomeInput, SERVER_ERROR_TTL_MS, SubscriptionAccountHealth, type SubscriptionAccountHealthOptions, __resetSharedAccountHealthForTests, getSharedAccountHealth, resolveResetSeconds, setSharedAccountHealth };
|
|
263
|
+
export { ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT, AUTH_ERROR_TTL_MS, type AccountAnomalyEvent, type AccountAnomalyListener, type AccountAnomalyState, type AccountHealthDiagnostic, type AccountHealthDiagnosticFilter, type AccountHealthState, type AccountHealthStatus, type AccountRecoveryEvent, type AccountRecoveryListener, type HeadersLike, type HealthRecord, OVERLOAD_ENABLED_DEFAULT, OVERLOAD_TTL_MS, type RecordUpstreamOutcomeInput, SERVER_ERROR_TTL_MS, SubscriptionAccountHealth, type SubscriptionAccountHealthOptions, __resetSharedAccountHealthForTests, getSharedAccountHealth, resolveResetSeconds, setSharedAccountHealth };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT,
|
|
2
3
|
AUTH_ERROR_TTL_MS,
|
|
3
4
|
OVERLOAD_ENABLED_DEFAULT,
|
|
4
5
|
OVERLOAD_TTL_MS,
|
|
@@ -8,8 +9,9 @@ import {
|
|
|
8
9
|
getSharedAccountHealth,
|
|
9
10
|
resolveResetSeconds,
|
|
10
11
|
setSharedAccountHealth
|
|
11
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-YJVHCHQX.js";
|
|
12
13
|
export {
|
|
14
|
+
ACCOUNT_HEALTH_DIAGNOSTIC_LIMIT,
|
|
13
15
|
AUTH_ERROR_TTL_MS,
|
|
14
16
|
OVERLOAD_ENABLED_DEFAULT,
|
|
15
17
|
OVERLOAD_TTL_MS,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYNJNTCSQcjs = require('../chunk-YNJNTCSQ.cjs');
|
|
5
5
|
require('../chunk-SVNDB62D.cjs');
|
|
6
|
+
require('../chunk-6QQG7YG3.cjs');
|
|
7
|
+
require('../chunk-25GXJCEZ.cjs');
|
|
8
|
+
require('../chunk-HVBBDBS3.cjs');
|
|
6
9
|
|
|
7
10
|
|
|
8
11
|
|
|
9
|
-
exports.SubscriptionAuthSource =
|
|
12
|
+
exports.SubscriptionAuthSource = _chunkYNJNTCSQcjs.SubscriptionAuthSource; exports.stripAuthHeaders = _chunkYNJNTCSQcjs.stripAuthHeaders;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenCodeGoTokenConfig, OpenCodeGoScenario, OpenCodeGoModelEntry } from '@omnicross/contracts/subscription-types';
|
|
2
2
|
import { AuthSource, AuthApplyHints } from './AuthSource.cjs';
|
|
3
3
|
import { AuthStrategy } from './SubscriptionAuthStrategy.cjs';
|
|
4
|
+
import './BoundAccountSelectionError.cjs';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* SubscriptionAuthSource — `AuthSource` wrapping a subscription `AuthStrategy`.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenCodeGoTokenConfig, OpenCodeGoScenario, OpenCodeGoModelEntry } from '@omnicross/contracts/subscription-types';
|
|
2
2
|
import { AuthSource, AuthApplyHints } from './AuthSource.js';
|
|
3
3
|
import { AuthStrategy } from './SubscriptionAuthStrategy.js';
|
|
4
|
+
import './BoundAccountSelectionError.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* SubscriptionAuthSource — `AuthSource` wrapping a subscription `AuthStrategy`.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SubscriptionAuthSource,
|
|
3
3
|
stripAuthHeaders
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-23S5OPIO.js";
|
|
5
5
|
import "../chunk-AVYJ4YBN.js";
|
|
6
|
+
import "../chunk-OPRS4IQZ.js";
|
|
7
|
+
import "../chunk-2JYRIADS.js";
|
|
8
|
+
import "../chunk-MKF46GNZ.js";
|
|
6
9
|
export {
|
|
7
10
|
SubscriptionAuthSource,
|
|
8
11
|
stripAuthHeaders
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubscriptionProviderId, SubscriptionStatusEntry } from '@omnicross/contracts/subscription-types';
|
|
2
|
+
import { BoundAccountFallbackPolicy } from './BoundAccountSelectionError.cjs';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* SubscriptionAuthStrategy — the pluggable subscription-auth contract, defined
|
|
@@ -51,10 +52,14 @@ interface AuthApplyHints {
|
|
|
51
52
|
reportSelection?: (accountId: string, isActive: boolean, remappedModel?: string) => void;
|
|
52
53
|
/**
|
|
53
54
|
* OPTIONAL preferred subscription account id (provider/subscription duality).
|
|
54
|
-
* When set
|
|
55
|
-
*
|
|
55
|
+
* When set, strict is the default; only the explicit `'pool'` policy permits
|
|
56
|
+
* pool fallback. Absent bindings keep pool auto-scheduling.
|
|
56
57
|
*/
|
|
57
58
|
preferredAccountId?: string;
|
|
59
|
+
/** Optional account group selected by a resource-level gateway binding. */
|
|
60
|
+
preferredAccountGroup?: string;
|
|
61
|
+
/** `'pool'` is an explicit opt-in; strict is the default for bindings. */
|
|
62
|
+
boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
58
63
|
}
|
|
59
64
|
interface AuthStrategy {
|
|
60
65
|
/** Discriminator — also surfaced through `subscription:list` to renderers. */
|
|
@@ -87,4 +92,4 @@ interface AuthStrategy {
|
|
|
87
92
|
describeStatus(): Promise<SubscriptionStatusEntry>;
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
export type
|
|
95
|
+
export { type AuthApplyHints, type AuthStrategy, BoundAccountFallbackPolicy };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SubscriptionProviderId, SubscriptionStatusEntry } from '@omnicross/contracts/subscription-types';
|
|
2
|
+
import { BoundAccountFallbackPolicy } from './BoundAccountSelectionError.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* SubscriptionAuthStrategy — the pluggable subscription-auth contract, defined
|
|
@@ -51,10 +52,14 @@ interface AuthApplyHints {
|
|
|
51
52
|
reportSelection?: (accountId: string, isActive: boolean, remappedModel?: string) => void;
|
|
52
53
|
/**
|
|
53
54
|
* OPTIONAL preferred subscription account id (provider/subscription duality).
|
|
54
|
-
* When set
|
|
55
|
-
*
|
|
55
|
+
* When set, strict is the default; only the explicit `'pool'` policy permits
|
|
56
|
+
* pool fallback. Absent bindings keep pool auto-scheduling.
|
|
56
57
|
*/
|
|
57
58
|
preferredAccountId?: string;
|
|
59
|
+
/** Optional account group selected by a resource-level gateway binding. */
|
|
60
|
+
preferredAccountGroup?: string;
|
|
61
|
+
/** `'pool'` is an explicit opt-in; strict is the default for bindings. */
|
|
62
|
+
boundAccountFallbackPolicy?: BoundAccountFallbackPolicy;
|
|
58
63
|
}
|
|
59
64
|
interface AuthStrategy {
|
|
60
65
|
/** Discriminator — also surfaced through `subscription:list` to renderers. */
|
|
@@ -87,4 +92,4 @@ interface AuthStrategy {
|
|
|
87
92
|
describeStatus(): Promise<SubscriptionStatusEntry>;
|
|
88
93
|
}
|
|
89
94
|
|
|
90
|
-
export type
|
|
95
|
+
export { type AuthApplyHints, type AuthStrategy, BoundAccountFallbackPolicy };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMUHWHQVMcjs = require('../chunk-MUHWHQVM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.executeProviderCall =
|
|
6
|
+
exports.executeProviderCall = _chunkMUHWHQVMcjs.executeProviderCall;
|
|
@@ -101,8 +101,9 @@ interface ProviderCallContext {
|
|
|
101
101
|
*/
|
|
102
102
|
fetchFn: (url: string, headers: Record<string, string>, body: unknown) => Promise<Response>;
|
|
103
103
|
/**
|
|
104
|
-
* When `true`, the core runs `executeResponseChain` on
|
|
105
|
-
* response and returns the TRANSFORMED response
|
|
104
|
+
* When `true`, the core runs `executeResponseChain` on a SUCCESSFUL fetched
|
|
105
|
+
* response and returns the TRANSFORMED response; a failed (`!response.ok`)
|
|
106
|
+
* response is returned raw so its status and error body survive. When `false` (default),
|
|
106
107
|
* the core returns the RAW fetched response and the caller runs the
|
|
107
108
|
* response chain itself — this preserves call sites that gate on
|
|
108
109
|
* `response.ok` BEFORE the response chain (Adapter / Handler).
|
|
@@ -127,7 +128,11 @@ interface ProviderCallContext {
|
|
|
127
128
|
* before, and so the wire-capture / logging hooks keep their inputs.
|
|
128
129
|
*/
|
|
129
130
|
interface ProviderCallResult {
|
|
130
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Transformed response (runResponseChain=true AND the upstream response was
|
|
133
|
+
* `ok`), otherwise the RAW fetched response — see the `.ok` gate in the
|
|
134
|
+
* implementation for why failures are never transformed.
|
|
135
|
+
*/
|
|
131
136
|
response: Response;
|
|
132
137
|
/** Request-chain output body (pre-`prepareBody`). */
|
|
133
138
|
requestBody: unknown;
|
|
@@ -101,8 +101,9 @@ interface ProviderCallContext {
|
|
|
101
101
|
*/
|
|
102
102
|
fetchFn: (url: string, headers: Record<string, string>, body: unknown) => Promise<Response>;
|
|
103
103
|
/**
|
|
104
|
-
* When `true`, the core runs `executeResponseChain` on
|
|
105
|
-
* response and returns the TRANSFORMED response
|
|
104
|
+
* When `true`, the core runs `executeResponseChain` on a SUCCESSFUL fetched
|
|
105
|
+
* response and returns the TRANSFORMED response; a failed (`!response.ok`)
|
|
106
|
+
* response is returned raw so its status and error body survive. When `false` (default),
|
|
106
107
|
* the core returns the RAW fetched response and the caller runs the
|
|
107
108
|
* response chain itself — this preserves call sites that gate on
|
|
108
109
|
* `response.ok` BEFORE the response chain (Adapter / Handler).
|
|
@@ -127,7 +128,11 @@ interface ProviderCallContext {
|
|
|
127
128
|
* before, and so the wire-capture / logging hooks keep their inputs.
|
|
128
129
|
*/
|
|
129
130
|
interface ProviderCallResult {
|
|
130
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* Transformed response (runResponseChain=true AND the upstream response was
|
|
133
|
+
* `ok`), otherwise the RAW fetched response — see the `.ok` gate in the
|
|
134
|
+
* implementation for why failures are never transformed.
|
|
135
|
+
*/
|
|
131
136
|
response: Response;
|
|
132
137
|
/** Request-chain output body (pre-`prepareBody`). */
|
|
133
138
|
requestBody: unknown;
|
|
@@ -13,9 +13,8 @@ import '../transformer/TransformerService.cjs';
|
|
|
13
13
|
* block verbatim. This module extracts that single shared helper so the
|
|
14
14
|
* logic lives in exactly one place.
|
|
15
15
|
*
|
|
16
|
-
* IMPORTANT: body mutations that are proxy-specific (
|
|
17
|
-
*
|
|
18
|
-
* they remain at each call site as before.
|
|
16
|
+
* IMPORTANT: body mutations that are proxy-specific (thinkingLevel body-inject)
|
|
17
|
+
* are NOT part of this helper — they remain at each call site as before.
|
|
19
18
|
*
|
|
20
19
|
* @module pipeline/resolveProviderChain
|
|
21
20
|
*/
|
|
@@ -13,9 +13,8 @@ import '../transformer/TransformerService.js';
|
|
|
13
13
|
* block verbatim. This module extracts that single shared helper so the
|
|
14
14
|
* logic lives in exactly one place.
|
|
15
15
|
*
|
|
16
|
-
* IMPORTANT: body mutations that are proxy-specific (
|
|
17
|
-
*
|
|
18
|
-
* they remain at each call site as before.
|
|
16
|
+
* IMPORTANT: body mutations that are proxy-specific (thinkingLevel body-inject)
|
|
17
|
+
* are NOT part of this helper — they remain at each call site as before.
|
|
19
18
|
*
|
|
20
19
|
* @module pipeline/resolveProviderChain
|
|
21
20
|
*/
|
|
@@ -3,6 +3,7 @@ import { Transformer, ResolvedTransformerChain } from '../transformer/types.cjs'
|
|
|
3
3
|
import { SubscriptionAuthProfile } from './SubscriptionAuthSource.cjs';
|
|
4
4
|
import '@omnicross/contracts/subscription-types';
|
|
5
5
|
import './AuthSource.cjs';
|
|
6
|
+
import './BoundAccountSelectionError.cjs';
|
|
6
7
|
import './SubscriptionAuthStrategy.cjs';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -3,6 +3,7 @@ import { Transformer, ResolvedTransformerChain } from '../transformer/types.js';
|
|
|
3
3
|
import { SubscriptionAuthProfile } from './SubscriptionAuthSource.js';
|
|
4
4
|
import '@omnicross/contracts/subscription-types';
|
|
5
5
|
import './AuthSource.js';
|
|
6
|
+
import './BoundAccountSelectionError.js';
|
|
6
7
|
import './SubscriptionAuthStrategy.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkKCVJWJSTcjs = require('../chunk-KCVJWJST.cjs');
|
|
8
|
+
require('../chunk-3Z5BQZFM.cjs');
|
|
9
|
+
require('../chunk-HVBBDBS3.cjs');
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
13
15
|
|
|
14
|
-
exports.__resetUpstreamProxyForTests =
|
|
16
|
+
exports.__resetUpstreamProxyForTests = _chunkKCVJWJSTcjs.__resetUpstreamProxyForTests; exports.bumpUpstreamProxyGeneration = _chunkKCVJWJSTcjs.bumpUpstreamProxyGeneration; exports.fetchUpstream = _chunkKCVJWJSTcjs.fetchUpstream; exports.resolveUpstreamDispatcher = _chunkKCVJWJSTcjs.resolveUpstreamDispatcher; exports.setUpstreamProxyResolver = _chunkKCVJWJSTcjs.setUpstreamProxyResolver;
|
|
@@ -28,6 +28,12 @@ import { Dispatcher } from 'undici';
|
|
|
28
28
|
* FROZEN SEAM: `#7` (client fingerprint) attaches per-account TLS/agent behavior
|
|
29
29
|
* at this SAME dispatcher point — do not fork a second egress path.
|
|
30
30
|
*
|
|
31
|
+
* DEBUG TRACE: when the daemon installs an upstream-trace path (gated on the
|
|
32
|
+
* audit `captureBodies` opt-in), relay calls (`ctx.providerId` set) clone the
|
|
33
|
+
* response and append the FULL exchange (request + verbatim response incl. SSE)
|
|
34
|
+
* to the trace file. Absent a path (the default) it is a pure no-op — zero
|
|
35
|
+
* regression. See `upstreamTrace.ts`.
|
|
36
|
+
*
|
|
31
37
|
* @module @omnicross/core/pipeline/upstreamFetch
|
|
32
38
|
*/
|
|
33
39
|
|
|
@@ -28,6 +28,12 @@ import { Dispatcher } from 'undici';
|
|
|
28
28
|
* FROZEN SEAM: `#7` (client fingerprint) attaches per-account TLS/agent behavior
|
|
29
29
|
* at this SAME dispatcher point — do not fork a second egress path.
|
|
30
30
|
*
|
|
31
|
+
* DEBUG TRACE: when the daemon installs an upstream-trace path (gated on the
|
|
32
|
+
* audit `captureBodies` opt-in), relay calls (`ctx.providerId` set) clone the
|
|
33
|
+
* response and append the FULL exchange (request + verbatim response incl. SSE)
|
|
34
|
+
* to the trace file. Absent a path (the default) it is a pure no-op — zero
|
|
35
|
+
* regression. See `upstreamTrace.ts`.
|
|
36
|
+
*
|
|
31
37
|
* @module @omnicross/core/pipeline/upstreamFetch
|
|
32
38
|
*/
|
|
33
39
|
|
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
fetchUpstream,
|
|
5
5
|
resolveUpstreamDispatcher,
|
|
6
6
|
setUpstreamProxyResolver
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-SIZQQD6T.js";
|
|
8
|
+
import "../chunk-SYQF7OIR.js";
|
|
9
|
+
import "../chunk-MKF46GNZ.js";
|
|
8
10
|
export {
|
|
9
11
|
__resetUpstreamProxyForTests,
|
|
10
12
|
bumpUpstreamProxyGeneration,
|