@omnicross/core 0.4.4 → 0.4.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.
Files changed (109) hide show
  1. package/dist/{CompletionService-BniP7j88.d.cts → CompletionService-BJu4AWVc.d.cts} +1 -1
  2. package/dist/{CompletionService-BqrKPwfA.d.ts → CompletionService-C4W2gBi_.d.ts} +1 -1
  3. package/dist/{ProviderProxy-Ckr6oTrE.d.ts → ProviderProxy-DxsNi3cO.d.ts} +1 -1
  4. package/dist/{ProviderProxy-Bz_nkOwq.d.cts → ProviderProxy-OuQPYW2I.d.cts} +1 -1
  5. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
  6. package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
  7. package/dist/{chunk-NKVZ6Z3Y.cjs → chunk-4HMAS74X.cjs} +8 -3
  8. package/dist/{chunk-MPFOC7AT.js → chunk-5XG6FR5F.js} +2 -2
  9. package/dist/{chunk-VFFCV4J6.cjs → chunk-CXRJMNJJ.cjs} +12 -6
  10. package/dist/{chunk-E5RCCGE7.cjs → chunk-DF5JXK36.cjs} +2 -2
  11. package/dist/{chunk-NCZDUBC2.js → chunk-DRUT7H5H.js} +1 -1
  12. package/dist/{chunk-RX3BCX53.cjs → chunk-DV7656NN.cjs} +1208 -527
  13. package/dist/{chunk-CGEZQC2G.cjs → chunk-F3TT5XPV.cjs} +2 -2
  14. package/dist/{chunk-EE7VP4O3.js → chunk-HQ7C3VB6.js} +1 -1
  15. package/dist/{chunk-ZJJBITUN.js → chunk-IAWLTZUP.js} +2 -2
  16. package/dist/{chunk-57Y2EA2G.cjs → chunk-JGRNVH7C.cjs} +1 -1
  17. package/dist/{chunk-NTF7TLT7.js → chunk-LBIXTHP7.js} +11 -5
  18. package/dist/{chunk-GWC7HCZI.cjs → chunk-LWBXQXZ3.cjs} +1 -1
  19. package/dist/{chunk-7PIUVCKK.js → chunk-MZCJL3QU.js} +1 -1
  20. package/dist/{chunk-K6J2RIEX.js → chunk-NDJSLJIA.js} +1 -1
  21. package/dist/{chunk-UOOLU64V.cjs → chunk-QLVRJ5FS.cjs} +4 -4
  22. package/dist/{chunk-F6P4DIBL.js → chunk-TLYFFUW4.js} +1 -1
  23. package/dist/{chunk-YV4JSBPA.js → chunk-TU4BB776.js} +789 -108
  24. package/dist/{chunk-GL6XM527.js → chunk-TX7ZM4OI.js} +8 -3
  25. package/dist/{chunk-ZMERU7D3.js → chunk-VXHN5IDL.js} +1 -1
  26. package/dist/{chunk-NDIBVTBZ.cjs → chunk-XYFCNDJK.cjs} +2 -2
  27. package/dist/{chunk-X6GHTNDL.cjs → chunk-ZG57GAVU.cjs} +7 -7
  28. package/dist/{chunk-QWNUOR7F.cjs → chunk-ZTN2PVKO.cjs} +1 -1
  29. package/dist/completion/CompletionService.cjs +12 -12
  30. package/dist/completion/CompletionService.d.cts +2 -2
  31. package/dist/completion/CompletionService.d.ts +2 -2
  32. package/dist/completion/CompletionService.js +11 -11
  33. package/dist/completion.cjs +12 -12
  34. package/dist/completion.d.cts +2 -2
  35. package/dist/completion.d.ts +2 -2
  36. package/dist/completion.js +11 -11
  37. package/dist/image-generation.d.cts +4 -4
  38. package/dist/image-generation.d.ts +4 -4
  39. package/dist/index.cjs +14 -12
  40. package/dist/index.d.cts +7 -7
  41. package/dist/index.d.ts +7 -7
  42. package/dist/index.js +13 -11
  43. package/dist/openai-operation.d.cts +1 -1
  44. package/dist/openai-operation.d.ts +1 -1
  45. package/dist/outbound-api/routeResolver.cjs +2 -2
  46. package/dist/outbound-api/routeResolver.d.cts +5 -5
  47. package/dist/outbound-api/routeResolver.d.ts +5 -5
  48. package/dist/outbound-api/routeResolver.js +1 -1
  49. package/dist/outbound-api/subscriptionRegistryPort.d.cts +9 -1
  50. package/dist/outbound-api/subscriptionRegistryPort.d.ts +9 -1
  51. package/dist/outbound-api/types.d.cts +5 -5
  52. package/dist/outbound-api/types.d.ts +5 -5
  53. package/dist/outbound-api.cjs +14 -12
  54. package/dist/outbound-api.d.cts +49 -8
  55. package/dist/outbound-api.d.ts +49 -8
  56. package/dist/outbound-api.js +13 -11
  57. package/dist/pipeline/AccountAllowanceScheduling.d.cts +4 -4
  58. package/dist/pipeline/AccountAllowanceScheduling.d.ts +4 -4
  59. package/dist/pipeline/AccountRouteActivity.cjs +2 -2
  60. package/dist/pipeline/AccountRouteActivity.d.cts +33 -8
  61. package/dist/pipeline/AccountRouteActivity.d.ts +33 -8
  62. package/dist/pipeline/AccountRouteActivity.js +1 -1
  63. package/dist/pipeline/SubscriptionAuthSource.d.cts +11 -0
  64. package/dist/pipeline/SubscriptionAuthSource.d.ts +11 -0
  65. package/dist/pipeline/upstreamFetch.cjs +3 -3
  66. package/dist/pipeline/upstreamFetch.d.cts +15 -1
  67. package/dist/pipeline/upstreamFetch.d.ts +15 -1
  68. package/dist/pipeline/upstreamFetch.js +2 -2
  69. package/dist/ports.d.cts +4 -4
  70. package/dist/ports.d.ts +4 -4
  71. package/dist/provider-proxy/ProviderProxy.cjs +12 -12
  72. package/dist/provider-proxy/ProviderProxy.d.cts +2 -2
  73. package/dist/provider-proxy/ProviderProxy.d.ts +2 -2
  74. package/dist/provider-proxy/ProviderProxy.js +11 -11
  75. package/dist/provider-proxy/identity/codexCliHeaders.d.cts +6 -4
  76. package/dist/provider-proxy/identity/codexCliHeaders.d.ts +6 -4
  77. package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +2 -2
  78. package/dist/provider-proxy/identity/openCodeGoHeaders.js +1 -1
  79. package/dist/provider-proxy/ingress/providerProxyShared.cjs +20 -12
  80. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +54 -2
  81. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +54 -2
  82. package/dist/provider-proxy/ingress/providerProxyShared.js +19 -11
  83. package/dist/provider-proxy/types.d.cts +1 -1
  84. package/dist/provider-proxy/types.d.ts +1 -1
  85. package/dist/provider-proxy.cjs +12 -12
  86. package/dist/provider-proxy.d.cts +6 -6
  87. package/dist/provider-proxy.d.ts +6 -6
  88. package/dist/provider-proxy.js +11 -11
  89. package/dist/{routeResolver-C2z0pp-q.d.cts → routeResolver-BQYMEXer.d.cts} +2 -2
  90. package/dist/{routeResolver-BLTleO4H.d.ts → routeResolver-DTfyzaFb.d.ts} +2 -2
  91. package/dist/transformer/transformers/AntigravityTransformer.cjs +6 -6
  92. package/dist/transformer/transformers/AntigravityTransformer.js +5 -5
  93. package/dist/transformer/transformers/OpenAITransformer.cjs +2 -2
  94. package/dist/transformer/transformers/OpenAITransformer.js +1 -1
  95. package/dist/transformer/transformers/antigravityFailover.cjs +7 -7
  96. package/dist/transformer/transformers/antigravityFailover.js +6 -6
  97. package/dist/transformer/transformers/antigravityIdentity.cjs +4 -4
  98. package/dist/transformer/transformers/antigravityIdentity.js +3 -3
  99. package/dist/transformer/transformers.cjs +9 -9
  100. package/dist/transformer/transformers.js +8 -8
  101. package/dist/transformer.cjs +9 -9
  102. package/dist/transformer.js +8 -8
  103. package/dist/{types-C6m-Db26.d.cts → types-BpSkj2JA.d.cts} +66 -5
  104. package/dist/{types-BVwJQ9ZS.d.cts → types-BsZ1s_a_.d.cts} +1 -1
  105. package/dist/{types-By9Tg6-I.d.ts → types-Di8VH1c9.d.ts} +12 -0
  106. package/dist/{types-BSIJdsyl.d.cts → types-Dpr5IAaP.d.cts} +12 -0
  107. package/dist/{types-Da735j2d.d.ts → types-EReErShW.d.ts} +66 -5
  108. package/dist/{types-VAHRysdP.d.ts → types-USaixzVP.d.ts} +1 -1
  109. package/package.json +2 -2
@@ -3,13 +3,13 @@ import {
3
3
  BuiltinTransformers,
4
4
  getBuiltinTransformers,
5
5
  registerBuiltinTransformers
6
- } from "../chunk-MPFOC7AT.js";
6
+ } from "../chunk-5XG6FR5F.js";
7
7
  import {
8
8
  OpenAIResponseTransformer
9
9
  } from "../chunk-V53ZEFXC.js";
10
10
  import {
11
11
  OpenAITransformer
12
- } from "../chunk-7PIUVCKK.js";
12
+ } from "../chunk-MZCJL3QU.js";
13
13
  import {
14
14
  AnthropicTransformer
15
15
  } from "../chunk-TKZ3DZS5.js";
@@ -21,7 +21,7 @@ import {
21
21
  isAntigravitySandboxFailoverEnabled,
22
22
  maybeAntigravityFailoverUrl,
23
23
  setAntigravitySandboxFailover
24
- } from "../chunk-K6J2RIEX.js";
24
+ } from "../chunk-NDJSLJIA.js";
25
25
  import {
26
26
  ANTIGRAVITY_ENDPOINT,
27
27
  ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION,
@@ -31,7 +31,7 @@ import {
31
31
  checkForcedToolAssetDrift,
32
32
  deriveAntigravitySessionId,
33
33
  resolveAntigravityWireModelId
34
- } from "../chunk-ZJJBITUN.js";
34
+ } from "../chunk-IAWLTZUP.js";
35
35
  import {
36
36
  ANTIGRAVITY_MODEL_WIRE_PROFILES,
37
37
  DEFAULT_ANTIGRAVITY_VERSION,
@@ -40,12 +40,12 @@ import {
40
40
  getAntigravityUserAgent,
41
41
  getAntigravityVersion,
42
42
  parseAntigravityManifestVersion
43
- } from "../chunk-F6P4DIBL.js";
43
+ } from "../chunk-TLYFFUW4.js";
44
44
  import {
45
45
  GeminiTransformer
46
46
  } from "../chunk-OXBGNEYR.js";
47
47
  import "../chunk-XBQTVRMK.js";
48
- import "../chunk-EE7VP4O3.js";
48
+ import "../chunk-HQ7C3VB6.js";
49
49
  import {
50
50
  GeminiCodeAssistTransformer,
51
51
  buildCodeAssistUrl,
@@ -57,10 +57,10 @@ import {
57
57
  import "../chunk-YEHQ5FXZ.js";
58
58
  import "../chunk-WYVGULTQ.js";
59
59
  import "../chunk-ZLNHPUFA.js";
60
- import "../chunk-NTF7TLT7.js";
60
+ import "../chunk-LBIXTHP7.js";
61
61
  import "../chunk-3WD4HTR2.js";
62
62
  import "../chunk-FYPKKMB3.js";
63
- import "../chunk-GL6XM527.js";
63
+ import "../chunk-TX7ZM4OI.js";
64
64
  export {
65
65
  ANTIGRAVITY_ENDPOINT,
66
66
  ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION,
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-QVOB2DNX.cjs');
2
2
 
3
3
 
4
- var _chunkUOOLU64Vcjs = require('./chunk-UOOLU64V.cjs');
4
+ var _chunkQLVRJ5FScjs = require('./chunk-QLVRJ5FS.cjs');
5
5
  require('./chunk-NOITAVHA.cjs');
6
- require('./chunk-QWNUOR7F.cjs');
6
+ require('./chunk-ZTN2PVKO.cjs');
7
7
  require('./chunk-47E3I5PF.cjs');
8
8
  require('./chunk-5RSZYQJH.cjs');
9
9
  require('./chunk-VGBJPHHD.cjs');
10
- require('./chunk-CGEZQC2G.cjs');
11
- require('./chunk-X6GHTNDL.cjs');
12
- require('./chunk-E5RCCGE7.cjs');
10
+ require('./chunk-F3TT5XPV.cjs');
11
+ require('./chunk-ZG57GAVU.cjs');
12
+ require('./chunk-DF5JXK36.cjs');
13
13
  require('./chunk-BTSADEX4.cjs');
14
14
 
15
15
 
@@ -19,7 +19,7 @@ require('./chunk-GBHYAGX3.cjs');
19
19
 
20
20
  var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
21
21
  require('./chunk-KSMK45RD.cjs');
22
- require('./chunk-NDIBVTBZ.cjs');
22
+ require('./chunk-XYFCNDJK.cjs');
23
23
  require('./chunk-N3MGNLCU.cjs');
24
24
  require('./chunk-4NAMH4UE.cjs');
25
25
  require('./chunk-77USGNRW.cjs');
@@ -33,10 +33,10 @@ require('./chunk-77USGNRW.cjs');
33
33
 
34
34
 
35
35
  var _chunkIUL4VWNUcjs = require('./chunk-IUL4VWNU.cjs');
36
- require('./chunk-VFFCV4J6.cjs');
36
+ require('./chunk-CXRJMNJJ.cjs');
37
37
  require('./chunk-235MXAGX.cjs');
38
38
  require('./chunk-VYOBVPNB.cjs');
39
- require('./chunk-NKVZ6Z3Y.cjs');
39
+ require('./chunk-4HMAS74X.cjs');
40
40
 
41
41
 
42
42
 
@@ -49,4 +49,4 @@ require('./chunk-NKVZ6Z3Y.cjs');
49
49
 
50
50
 
51
51
 
52
- exports.THINK_LEVELS = _chunkIUL4VWNUcjs.THINK_LEVELS; exports.TransformerChainExecutor = _chunk7ZHBN75Ncjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.extractReasoningIntent = _chunkIUL4VWNUcjs.extractReasoningIntent; exports.normalizeThinkLevel = _chunkIUL4VWNUcjs.normalizeThinkLevel; exports.registerBuiltinTransformers = _chunkUOOLU64Vcjs.registerBuiltinTransformers; exports.resolveReasoningEffort = _chunkIUL4VWNUcjs.resolveReasoningEffort; exports.resolveReasoningPlan = _chunkIUL4VWNUcjs.resolveReasoningPlan; exports.resolveReasoningTokenLimit = _chunkIUL4VWNUcjs.resolveReasoningTokenLimit; exports.resolveRequestReasoning = _chunkIUL4VWNUcjs.resolveRequestReasoning; exports.resolveTargetModelCapabilities = _chunkIUL4VWNUcjs.resolveTargetModelCapabilities;
52
+ exports.THINK_LEVELS = _chunkIUL4VWNUcjs.THINK_LEVELS; exports.TransformerChainExecutor = _chunk7ZHBN75Ncjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.extractReasoningIntent = _chunkIUL4VWNUcjs.extractReasoningIntent; exports.normalizeThinkLevel = _chunkIUL4VWNUcjs.normalizeThinkLevel; exports.registerBuiltinTransformers = _chunkQLVRJ5FScjs.registerBuiltinTransformers; exports.resolveReasoningEffort = _chunkIUL4VWNUcjs.resolveReasoningEffort; exports.resolveReasoningPlan = _chunkIUL4VWNUcjs.resolveReasoningPlan; exports.resolveReasoningTokenLimit = _chunkIUL4VWNUcjs.resolveReasoningTokenLimit; exports.resolveRequestReasoning = _chunkIUL4VWNUcjs.resolveRequestReasoning; exports.resolveTargetModelCapabilities = _chunkIUL4VWNUcjs.resolveTargetModelCapabilities;
@@ -1,15 +1,15 @@
1
1
  import "./chunk-WTQMX2Q6.js";
2
2
  import {
3
3
  registerBuiltinTransformers
4
- } from "./chunk-MPFOC7AT.js";
4
+ } from "./chunk-5XG6FR5F.js";
5
5
  import "./chunk-V53ZEFXC.js";
6
- import "./chunk-7PIUVCKK.js";
6
+ import "./chunk-MZCJL3QU.js";
7
7
  import "./chunk-TKZ3DZS5.js";
8
8
  import "./chunk-FU7EAR73.js";
9
9
  import "./chunk-IDPMD4B7.js";
10
- import "./chunk-K6J2RIEX.js";
11
- import "./chunk-ZJJBITUN.js";
12
- import "./chunk-F6P4DIBL.js";
10
+ import "./chunk-NDJSLJIA.js";
11
+ import "./chunk-IAWLTZUP.js";
12
+ import "./chunk-TLYFFUW4.js";
13
13
  import "./chunk-OXBGNEYR.js";
14
14
  import {
15
15
  TransformerChainExecutor
@@ -19,7 +19,7 @@ import {
19
19
  TransformerService
20
20
  } from "./chunk-DK4A7DLE.js";
21
21
  import "./chunk-XBQTVRMK.js";
22
- import "./chunk-EE7VP4O3.js";
22
+ import "./chunk-HQ7C3VB6.js";
23
23
  import "./chunk-QSOHEDKO.js";
24
24
  import "./chunk-YEHQ5FXZ.js";
25
25
  import "./chunk-WYVGULTQ.js";
@@ -33,10 +33,10 @@ import {
33
33
  resolveRequestReasoning,
34
34
  resolveTargetModelCapabilities
35
35
  } from "./chunk-ZLNHPUFA.js";
36
- import "./chunk-NTF7TLT7.js";
36
+ import "./chunk-LBIXTHP7.js";
37
37
  import "./chunk-3WD4HTR2.js";
38
38
  import "./chunk-FYPKKMB3.js";
39
- import "./chunk-GL6XM527.js";
39
+ import "./chunk-TX7ZM4OI.js";
40
40
  export {
41
41
  THINK_LEVELS,
42
42
  TransformerChainExecutor,
@@ -1,14 +1,15 @@
1
- import { e as ImageApiLimits } from './types-BVwJQ9ZS.cjs';
1
+ import { e as ImageApiLimits } from './types-BsZ1s_a_.cjs';
2
2
  import { ProxyConfig } from '@omnicross/contracts/account-tokens-types';
3
3
  import { AuditConfig } from '@omnicross/contracts/audit-types';
4
4
  import { BillingConfig } from '@omnicross/contracts/billing-types';
5
+ import { ThinkLevel } from '@omnicross/contracts/completion-types';
5
6
  import { HealthReport } from '@omnicross/contracts/health-logging-types';
6
7
  import { VoucherRecord, VoucherGrant, VoucherInfo, VoucherConfig } from '@omnicross/contracts/voucher-types';
7
8
  import { WebhookConfig } from '@omnicross/contracts/webhook-types';
8
9
  import { L as Logger } from './logger-4GvQNzhE.cjs';
9
10
  import { ProviderConfigSource } from './ports/provider-config-source.cjs';
10
- import { P as ProviderProxy } from './ProviderProxy-Bz_nkOwq.cjs';
11
- import { W as ProviderProxyDeps } from './types-BSIJdsyl.cjs';
11
+ import { P as ProviderProxy } from './ProviderProxy-OuQPYW2I.cjs';
12
+ import { W as ProviderProxyDeps } from './types-Dpr5IAaP.cjs';
12
13
  import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.cjs';
13
14
  import { S as SearchApiProviderConfigs } from './types-CbCZqLGg.cjs';
14
15
  import { d as SearchFrontendModes } from './frontends-Doz0RaWu.cjs';
@@ -490,6 +491,13 @@ interface EndpointRoutingConfig {
490
491
  * the requested model id (bare or `providerId,modelId`).
491
492
  */
492
493
  backgroundModelIds?: string[];
494
+ /**
495
+ * Runtime-only default thinking level projected from the winning
496
+ * {@link GatewayModelMapping.effort} immediately before route resolution.
497
+ * Absent ⇒ no injection; a client's own reasoning intent always wins over
498
+ * this default. Legacy endpoint persistence never sets this field.
499
+ */
500
+ reasoningEffort?: GatewayMappingEffort;
493
501
  }
494
502
  /**
495
503
  * User-message serial-queue segment (per-upstream-account 防风控). Frozen
@@ -589,10 +597,26 @@ type GatewayBindingFallback = 'next' | 'fail';
589
597
  type GatewayBindingKeyScope = 'all' | 'selected';
590
598
  /** Whether the downstream model id is forwarded or explicitly remapped. */
591
599
  type GatewayBindingModelMode = 'passthrough' | 'mapped';
592
- /** One exact or `*` wildcard model-name rewrite owned by a downstream route. */
600
+ /**
601
+ * A mapping-pinned thinking level: one of the shared seven levels, OR a
602
+ * provider-native custom string for levels the shared domain doesn't know
603
+ * yet. Custom values ride the SAME-FORMAT wire verbatim (exactly what a user
604
+ * wants when our presets lag a new model); cross-format negotiation does not
605
+ * recognize them and simply leaves the request without injected thinking.
606
+ */
607
+ type GatewayMappingEffort = ThinkLevel | (string & {});
608
+ /**
609
+ * One exact or `*` wildcard model-name rewrite owned by a downstream route.
610
+ *
611
+ * `effort` is an OPTIONAL default thinking level for clients that cannot
612
+ * express one on the wire: it applies ONLY when the request carries no
613
+ * reasoning intent of its own (client-sent thinking/reasoning always wins);
614
+ * absent/undefined ⇒ the normal reasoning negotiation runs unchanged.
615
+ */
593
616
  interface GatewayModelMapping {
594
617
  source: string;
595
618
  target: ModelRef;
619
+ effort?: GatewayMappingEffort;
596
620
  }
597
621
  /**
598
622
  * Independent client-to-upstream route aggregate.
@@ -933,6 +957,15 @@ interface OutboundApiKeyInfo {
933
957
  restrictionMode?: OutboundKeyModelRestrictionMode;
934
958
  /** The model-id list the mode acts on (bare modelIds; empty allowlist denies all). */
935
959
  restrictedModels?: string[];
960
+ /**
961
+ * DIRECT upstream passthrough target (key→upstream binding): a BYO provider
962
+ * row (verbatim transparent relay) or a claude/kimi subscription account /
963
+ * group / pool (Anthropic-wire same-format relay). Absent ⇒ the key is served
964
+ * by the downstream routes. References only — never a credential.
965
+ */
966
+ boundUpstream?: GatewayBindingTarget;
967
+ /** LEGACY first-cut shape of `boundUpstream` (a bare BYO provider id). */
968
+ boundUpstreamProviderId?: string;
936
969
  /**
937
970
  * The key's OWN accumulated spend (outbound-key-policy), surfaced by the admin
938
971
  * so an operator sees spend-vs-limit. Present only when the host wired a spend
@@ -1041,6 +1074,25 @@ interface OutboundKeyDbRow {
1041
1074
  restrictionMode?: OutboundKeyModelRestrictionMode;
1042
1075
  /** The model-id list the mode acts on (bare modelIds). */
1043
1076
  restrictedModels?: string[];
1077
+ /**
1078
+ * DIRECT upstream passthrough (key→upstream binding). A `provider` target
1079
+ * relays every request VERBATIM to that BYO provider row — method, path,
1080
+ * query, and body pass through untouched, with only the auth headers swapped
1081
+ * to the provider's key (no gateway route, protocol translation, model
1082
+ * mapping, or usage metering). An `account` / `account-group` /
1083
+ * `account-pool` target (claude / kimi — subscriptions whose upstream speaks
1084
+ * the same Anthropic Messages wire as the client) is served by the messages
1085
+ * pipeline's same-format verbatim relay: OAuth swapped + auto-refreshed,
1086
+ * account scheduling, fingerprint replay, usage metering intact. Absent ⇒
1087
+ * the key is served by the downstream routes as before.
1088
+ */
1089
+ boundUpstream?: GatewayBindingTarget;
1090
+ /**
1091
+ * LEGACY shape of `boundUpstream` (a bare BYO provider id) — written by the
1092
+ * first cut of the feature. Read as `{ kind: 'provider', providerId }`;
1093
+ * `boundUpstream` wins when both are present.
1094
+ */
1095
+ boundUpstreamProviderId?: string;
1044
1096
  }
1045
1097
  interface OutboundKeyDb {
1046
1098
  outboundApiKeysList(): Promise<OutboundKeyDbRow[]>;
@@ -1075,6 +1127,15 @@ interface OutboundKeyDb {
1075
1127
  * (`omnicross-uqc-daemon`); test fakes implement it inline.
1076
1128
  */
1077
1129
  outboundApiKeysSetMaxConcurrency(id: string, maxConcurrency: number | null): Promise<boolean>;
1130
+ /**
1131
+ * Set (or clear) a key's DIRECT upstream passthrough target (`boundUpstream`):
1132
+ * a BYO provider row (verbatim transparent relay) or a claude/kimi
1133
+ * subscription account / group / pool (Anthropic-wire same-format relay).
1134
+ * `null` clears the field → the key returns to downstream-route serving.
1135
+ * Mirrors `outboundApiKeysSetMaxConcurrency`; returns `false` when the key is
1136
+ * missing. Target VALIDITY is enforced by the admin write edge, not here.
1137
+ */
1138
+ outboundApiKeysSetUpstream(id: string, target: GatewayBindingTarget | null): Promise<boolean>;
1078
1139
  /**
1079
1140
  * Set (or clear) a key's policy envelope (expiry / activation window / cost
1080
1141
  * limits / per-key rate) in one write (outbound-key-policy). Each field is
@@ -1167,4 +1228,4 @@ interface OutboundApiDeps {
1167
1228
  readonly searchRuntime?: SearchRuntime | null;
1168
1229
  }
1169
1230
 
1170
- export { type AnthropicConfigSegment as $, type AccountProbeConfig as A, type OutboundPermission as B, type ChatDispatchMode as C, DEFAULT_IMAGE_MODEL_ROUTES as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, type OutboundProxyConfig as H, IMAGE_PROVIDER_IDS as I, type ResponsesModelKind as J, type KeySpendReader as K, type VoucherDb as L, type MessagesModelKind as M, computeVoucherGrant as N, type OutboundKeyDb as O, generateVoucherCode as P, hashVoucherCode as Q, type RequestRole as R, type SearchServerConfig as S, newVoucherId as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, startOfLocalDay as W, startOfLocalWeek as X, toVoucherInfo as Y, voucherCodePrefix as Z, type ModelRef as _, type AllowanceSchedulingConfig as a, type AccountHealthConfig as a0, type AnthropicCountTokensMode as a1, type AnthropicModelsShape as a2, type ImageModelCatalogReader as a3, type OutboundKeyModelRestrictionMode as a4, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type ImageProviderId as i, type ImagesCodexAdapterConfig as j, type ImagesServerConfig as k, type KeySpendSeeder as l, KeySpendTracker as m, type KindMappedEndpoint as n, type ModelKind as o, type ModelPrefixTargets as p, type OutboundApiDeps as q, type OutboundApiKeyCreated as r, type OutboundApiKeyInfo as s, type OutboundApiServerConfig as t, type OutboundApiServerStatus as u, type OutboundEndpoint as v, type OutboundFormatUrls as w, type OutboundKeyActivationMode as x, type OutboundKeyDbRow as y, type OutboundKeyPolicy as z };
1231
+ export { type AnthropicConfigSegment as $, type AccountProbeConfig as A, type OutboundPermission as B, type ChatDispatchMode as C, DEFAULT_IMAGE_MODEL_ROUTES as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, type OutboundProxyConfig as H, IMAGE_PROVIDER_IDS as I, type ResponsesModelKind as J, type KeySpendReader as K, type VoucherDb as L, type MessagesModelKind as M, computeVoucherGrant as N, type OutboundKeyDb as O, generateVoucherCode as P, hashVoucherCode as Q, type RequestRole as R, type SearchServerConfig as S, newVoucherId as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, startOfLocalDay as W, startOfLocalWeek as X, toVoucherInfo as Y, voucherCodePrefix as Z, type ModelRef as _, type AllowanceSchedulingConfig as a, type GatewayMappingEffort as a0, type AccountHealthConfig as a1, type AnthropicCountTokensMode as a2, type AnthropicModelsShape as a3, type ImageModelCatalogReader as a4, type OutboundKeyModelRestrictionMode as a5, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type ImageProviderId as i, type ImagesCodexAdapterConfig as j, type ImagesServerConfig as k, type KeySpendSeeder as l, KeySpendTracker as m, type KindMappedEndpoint as n, type ModelKind as o, type ModelPrefixTargets as p, type OutboundApiDeps as q, type OutboundApiKeyCreated as r, type OutboundApiKeyInfo as s, type OutboundApiServerConfig as t, type OutboundApiServerStatus as u, type OutboundEndpoint as v, type OutboundFormatUrls as w, type OutboundKeyActivationMode as x, type OutboundKeyDbRow as y, type OutboundKeyPolicy as z };
@@ -1,6 +1,6 @@
1
1
  import * as _omnicross_contracts_image_generation_types from '@omnicross/contracts/image-generation-types';
2
2
  import { ImageArtifactMetadata, ImageRequestOptions } from '@omnicross/contracts/image-generation-types';
3
- import { I as ImageAsset, p as ImageReferenceLease, K as OpenAIOperationHandler, h as ImageOrchestrator, L as OpenAIOperationHandlerContext, s as ImageReferenceStore, u as ImageRetentionPolicy } from './types-BSIJdsyl.cjs';
3
+ import { I as ImageAsset, p as ImageReferenceLease, K as OpenAIOperationHandler, h as ImageOrchestrator, L as OpenAIOperationHandlerContext, s as ImageReferenceStore, u as ImageRetentionPolicy } from './types-Dpr5IAaP.cjs';
4
4
  import { FileHandle } from 'node:fs/promises';
5
5
 
6
6
  type ResourceKind = 'input' | 'spool';
@@ -713,6 +713,18 @@ interface SubscriptionDispatchProfile {
713
713
  * (which leave this unset). Purely additive (optional).
714
714
  */
715
715
  readonly resolveProviderTransformerNames?: (model: string, config?: unknown) => readonly string[];
716
+ /**
717
+ * OPTIONAL chat-bridge-only chain-name resolver (openai-chat-bridge OQ1
718
+ * closure; type-identical mirror on `SubscriptionAuthProfile`). The
719
+ * OpenAI-chat ingress consults it INSTEAD of
720
+ * `resolveProviderTransformerNames`/`providerTransformerNames` because a chat
721
+ * caller's wire is Unified: an anthropic-shape upstream needs the
722
+ * `['anthropic']` ENCODER, whereas the messages path's same-shape `[]` means
723
+ * "the caller already speaks Anthropic" — different answers for the same
724
+ * shape. Only opencodego sets it; absent ⇒ the chat ingress keeps the static
725
+ * `providerTransformerNames` (claude/kimi/grok route-to chains).
726
+ */
727
+ readonly chatBridgeTransformerNames?: (model: string, config?: unknown) => readonly string[];
716
728
  /** Optional model placeholder rewriter — only set for OpenCodeGo. */
717
729
  readonly modelMapper?: (sdkModel: string, summary: SubscriptionRequestSummary, config: OpenCodeGoTokenConfig | undefined) => {
718
730
  resolvedModel: string;
@@ -713,6 +713,18 @@ interface SubscriptionDispatchProfile {
713
713
  * (which leave this unset). Purely additive (optional).
714
714
  */
715
715
  readonly resolveProviderTransformerNames?: (model: string, config?: unknown) => readonly string[];
716
+ /**
717
+ * OPTIONAL chat-bridge-only chain-name resolver (openai-chat-bridge OQ1
718
+ * closure; type-identical mirror on `SubscriptionAuthProfile`). The
719
+ * OpenAI-chat ingress consults it INSTEAD of
720
+ * `resolveProviderTransformerNames`/`providerTransformerNames` because a chat
721
+ * caller's wire is Unified: an anthropic-shape upstream needs the
722
+ * `['anthropic']` ENCODER, whereas the messages path's same-shape `[]` means
723
+ * "the caller already speaks Anthropic" — different answers for the same
724
+ * shape. Only opencodego sets it; absent ⇒ the chat ingress keeps the static
725
+ * `providerTransformerNames` (claude/kimi/grok route-to chains).
726
+ */
727
+ readonly chatBridgeTransformerNames?: (model: string, config?: unknown) => readonly string[];
716
728
  /** Optional model placeholder rewriter — only set for OpenCodeGo. */
717
729
  readonly modelMapper?: (sdkModel: string, summary: SubscriptionRequestSummary, config: OpenCodeGoTokenConfig | undefined) => {
718
730
  resolvedModel: string;
@@ -1,14 +1,15 @@
1
- import { e as ImageApiLimits } from './types-VAHRysdP.js';
1
+ import { e as ImageApiLimits } from './types-USaixzVP.js';
2
2
  import { ProxyConfig } from '@omnicross/contracts/account-tokens-types';
3
3
  import { AuditConfig } from '@omnicross/contracts/audit-types';
4
4
  import { BillingConfig } from '@omnicross/contracts/billing-types';
5
+ import { ThinkLevel } from '@omnicross/contracts/completion-types';
5
6
  import { HealthReport } from '@omnicross/contracts/health-logging-types';
6
7
  import { VoucherRecord, VoucherGrant, VoucherInfo, VoucherConfig } from '@omnicross/contracts/voucher-types';
7
8
  import { WebhookConfig } from '@omnicross/contracts/webhook-types';
8
9
  import { L as Logger } from './logger-4GvQNzhE.js';
9
10
  import { ProviderConfigSource } from './ports/provider-config-source.js';
10
- import { P as ProviderProxy } from './ProviderProxy-Ckr6oTrE.js';
11
- import { W as ProviderProxyDeps } from './types-By9Tg6-I.js';
11
+ import { P as ProviderProxy } from './ProviderProxy-DxsNi3cO.js';
12
+ import { W as ProviderProxyDeps } from './types-Di8VH1c9.js';
12
13
  import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.js';
13
14
  import { S as SearchApiProviderConfigs } from './types-CbCZqLGg.js';
14
15
  import { d as SearchFrontendModes } from './frontends-Doz0RaWu.js';
@@ -490,6 +491,13 @@ interface EndpointRoutingConfig {
490
491
  * the requested model id (bare or `providerId,modelId`).
491
492
  */
492
493
  backgroundModelIds?: string[];
494
+ /**
495
+ * Runtime-only default thinking level projected from the winning
496
+ * {@link GatewayModelMapping.effort} immediately before route resolution.
497
+ * Absent ⇒ no injection; a client's own reasoning intent always wins over
498
+ * this default. Legacy endpoint persistence never sets this field.
499
+ */
500
+ reasoningEffort?: GatewayMappingEffort;
493
501
  }
494
502
  /**
495
503
  * User-message serial-queue segment (per-upstream-account 防风控). Frozen
@@ -589,10 +597,26 @@ type GatewayBindingFallback = 'next' | 'fail';
589
597
  type GatewayBindingKeyScope = 'all' | 'selected';
590
598
  /** Whether the downstream model id is forwarded or explicitly remapped. */
591
599
  type GatewayBindingModelMode = 'passthrough' | 'mapped';
592
- /** One exact or `*` wildcard model-name rewrite owned by a downstream route. */
600
+ /**
601
+ * A mapping-pinned thinking level: one of the shared seven levels, OR a
602
+ * provider-native custom string for levels the shared domain doesn't know
603
+ * yet. Custom values ride the SAME-FORMAT wire verbatim (exactly what a user
604
+ * wants when our presets lag a new model); cross-format negotiation does not
605
+ * recognize them and simply leaves the request without injected thinking.
606
+ */
607
+ type GatewayMappingEffort = ThinkLevel | (string & {});
608
+ /**
609
+ * One exact or `*` wildcard model-name rewrite owned by a downstream route.
610
+ *
611
+ * `effort` is an OPTIONAL default thinking level for clients that cannot
612
+ * express one on the wire: it applies ONLY when the request carries no
613
+ * reasoning intent of its own (client-sent thinking/reasoning always wins);
614
+ * absent/undefined ⇒ the normal reasoning negotiation runs unchanged.
615
+ */
593
616
  interface GatewayModelMapping {
594
617
  source: string;
595
618
  target: ModelRef;
619
+ effort?: GatewayMappingEffort;
596
620
  }
597
621
  /**
598
622
  * Independent client-to-upstream route aggregate.
@@ -933,6 +957,15 @@ interface OutboundApiKeyInfo {
933
957
  restrictionMode?: OutboundKeyModelRestrictionMode;
934
958
  /** The model-id list the mode acts on (bare modelIds; empty allowlist denies all). */
935
959
  restrictedModels?: string[];
960
+ /**
961
+ * DIRECT upstream passthrough target (key→upstream binding): a BYO provider
962
+ * row (verbatim transparent relay) or a claude/kimi subscription account /
963
+ * group / pool (Anthropic-wire same-format relay). Absent ⇒ the key is served
964
+ * by the downstream routes. References only — never a credential.
965
+ */
966
+ boundUpstream?: GatewayBindingTarget;
967
+ /** LEGACY first-cut shape of `boundUpstream` (a bare BYO provider id). */
968
+ boundUpstreamProviderId?: string;
936
969
  /**
937
970
  * The key's OWN accumulated spend (outbound-key-policy), surfaced by the admin
938
971
  * so an operator sees spend-vs-limit. Present only when the host wired a spend
@@ -1041,6 +1074,25 @@ interface OutboundKeyDbRow {
1041
1074
  restrictionMode?: OutboundKeyModelRestrictionMode;
1042
1075
  /** The model-id list the mode acts on (bare modelIds). */
1043
1076
  restrictedModels?: string[];
1077
+ /**
1078
+ * DIRECT upstream passthrough (key→upstream binding). A `provider` target
1079
+ * relays every request VERBATIM to that BYO provider row — method, path,
1080
+ * query, and body pass through untouched, with only the auth headers swapped
1081
+ * to the provider's key (no gateway route, protocol translation, model
1082
+ * mapping, or usage metering). An `account` / `account-group` /
1083
+ * `account-pool` target (claude / kimi — subscriptions whose upstream speaks
1084
+ * the same Anthropic Messages wire as the client) is served by the messages
1085
+ * pipeline's same-format verbatim relay: OAuth swapped + auto-refreshed,
1086
+ * account scheduling, fingerprint replay, usage metering intact. Absent ⇒
1087
+ * the key is served by the downstream routes as before.
1088
+ */
1089
+ boundUpstream?: GatewayBindingTarget;
1090
+ /**
1091
+ * LEGACY shape of `boundUpstream` (a bare BYO provider id) — written by the
1092
+ * first cut of the feature. Read as `{ kind: 'provider', providerId }`;
1093
+ * `boundUpstream` wins when both are present.
1094
+ */
1095
+ boundUpstreamProviderId?: string;
1044
1096
  }
1045
1097
  interface OutboundKeyDb {
1046
1098
  outboundApiKeysList(): Promise<OutboundKeyDbRow[]>;
@@ -1075,6 +1127,15 @@ interface OutboundKeyDb {
1075
1127
  * (`omnicross-uqc-daemon`); test fakes implement it inline.
1076
1128
  */
1077
1129
  outboundApiKeysSetMaxConcurrency(id: string, maxConcurrency: number | null): Promise<boolean>;
1130
+ /**
1131
+ * Set (or clear) a key's DIRECT upstream passthrough target (`boundUpstream`):
1132
+ * a BYO provider row (verbatim transparent relay) or a claude/kimi
1133
+ * subscription account / group / pool (Anthropic-wire same-format relay).
1134
+ * `null` clears the field → the key returns to downstream-route serving.
1135
+ * Mirrors `outboundApiKeysSetMaxConcurrency`; returns `false` when the key is
1136
+ * missing. Target VALIDITY is enforced by the admin write edge, not here.
1137
+ */
1138
+ outboundApiKeysSetUpstream(id: string, target: GatewayBindingTarget | null): Promise<boolean>;
1078
1139
  /**
1079
1140
  * Set (or clear) a key's policy envelope (expiry / activation window / cost
1080
1141
  * limits / per-key rate) in one write (outbound-key-policy). Each field is
@@ -1167,4 +1228,4 @@ interface OutboundApiDeps {
1167
1228
  readonly searchRuntime?: SearchRuntime | null;
1168
1229
  }
1169
1230
 
1170
- export { type AnthropicConfigSegment as $, type AccountProbeConfig as A, type OutboundPermission as B, type ChatDispatchMode as C, DEFAULT_IMAGE_MODEL_ROUTES as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, type OutboundProxyConfig as H, IMAGE_PROVIDER_IDS as I, type ResponsesModelKind as J, type KeySpendReader as K, type VoucherDb as L, type MessagesModelKind as M, computeVoucherGrant as N, type OutboundKeyDb as O, generateVoucherCode as P, hashVoucherCode as Q, type RequestRole as R, type SearchServerConfig as S, newVoucherId as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, startOfLocalDay as W, startOfLocalWeek as X, toVoucherInfo as Y, voucherCodePrefix as Z, type ModelRef as _, type AllowanceSchedulingConfig as a, type AccountHealthConfig as a0, type AnthropicCountTokensMode as a1, type AnthropicModelsShape as a2, type ImageModelCatalogReader as a3, type OutboundKeyModelRestrictionMode as a4, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type ImageProviderId as i, type ImagesCodexAdapterConfig as j, type ImagesServerConfig as k, type KeySpendSeeder as l, KeySpendTracker as m, type KindMappedEndpoint as n, type ModelKind as o, type ModelPrefixTargets as p, type OutboundApiDeps as q, type OutboundApiKeyCreated as r, type OutboundApiKeyInfo as s, type OutboundApiServerConfig as t, type OutboundApiServerStatus as u, type OutboundEndpoint as v, type OutboundFormatUrls as w, type OutboundKeyActivationMode as x, type OutboundKeyDbRow as y, type OutboundKeyPolicy as z };
1231
+ export { type AnthropicConfigSegment as $, type AccountProbeConfig as A, type OutboundPermission as B, type ChatDispatchMode as C, DEFAULT_IMAGE_MODEL_ROUTES as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, type OutboundProxyConfig as H, IMAGE_PROVIDER_IDS as I, type ResponsesModelKind as J, type KeySpendReader as K, type VoucherDb as L, type MessagesModelKind as M, computeVoucherGrant as N, type OutboundKeyDb as O, generateVoucherCode as P, hashVoucherCode as Q, type RequestRole as R, type SearchServerConfig as S, newVoucherId as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, startOfLocalDay as W, startOfLocalWeek as X, toVoucherInfo as Y, voucherCodePrefix as Z, type ModelRef as _, type AllowanceSchedulingConfig as a, type GatewayMappingEffort as a0, type AccountHealthConfig as a1, type AnthropicCountTokensMode as a2, type AnthropicModelsShape as a3, type ImageModelCatalogReader as a4, type OutboundKeyModelRestrictionMode as a5, type ConcurrencyQueueConfig as b, type EndpointRoutingConfig as c, type GatewayBindingFallback as d, type GatewayBindingKeyScope as e, type GatewayBindingModelMode as f, type GatewayBindingTarget as g, type GatewayModelMapping as h, type ImageProviderId as i, type ImagesCodexAdapterConfig as j, type ImagesServerConfig as k, type KeySpendSeeder as l, KeySpendTracker as m, type KindMappedEndpoint as n, type ModelKind as o, type ModelPrefixTargets as p, type OutboundApiDeps as q, type OutboundApiKeyCreated as r, type OutboundApiKeyInfo as s, type OutboundApiServerConfig as t, type OutboundApiServerStatus as u, type OutboundEndpoint as v, type OutboundFormatUrls as w, type OutboundKeyActivationMode as x, type OutboundKeyDbRow as y, type OutboundKeyPolicy as z };
@@ -1,6 +1,6 @@
1
1
  import * as _omnicross_contracts_image_generation_types from '@omnicross/contracts/image-generation-types';
2
2
  import { ImageArtifactMetadata, ImageRequestOptions } from '@omnicross/contracts/image-generation-types';
3
- import { I as ImageAsset, p as ImageReferenceLease, K as OpenAIOperationHandler, h as ImageOrchestrator, L as OpenAIOperationHandlerContext, s as ImageReferenceStore, u as ImageRetentionPolicy } from './types-By9Tg6-I.js';
3
+ import { I as ImageAsset, p as ImageReferenceLease, K as OpenAIOperationHandler, h as ImageOrchestrator, L as OpenAIOperationHandlerContext, s as ImageReferenceStore, u as ImageRetentionPolicy } from './types-Di8VH1c9.js';
4
4
  import { FileHandle } from 'node:fs/promises';
5
5
 
6
6
  type ResourceKind = 'input' | 'spool';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnicross/core",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Omnicross LLM serving core — provider dispatch, completion pipeline, transformers, and the provider proxy.",
5
5
  "license": "MIT",
6
6
  "author": "Sayo (https://github.com/Dumoedss)",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@mozilla/readability": "^0.6.0",
59
- "@omnicross/contracts": "^0.4.4",
59
+ "@omnicross/contracts": "^0.4.6",
60
60
  "busboy": "^1.6.0",
61
61
  "entities": "^6.0.1",
62
62
  "impit": "^0.14.4",