@omnicross/core 0.4.4 → 0.4.5

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 (77) hide show
  1. package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
  2. package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
  3. package/dist/{chunk-MPFOC7AT.js → chunk-24W3DVGI.js} +1 -1
  4. package/dist/{chunk-GWC7HCZI.cjs → chunk-2DMOOZ4F.cjs} +1 -1
  5. package/dist/{chunk-NKVZ6Z3Y.cjs → chunk-4HMAS74X.cjs} +8 -3
  6. package/dist/{chunk-VFFCV4J6.cjs → chunk-CXRJMNJJ.cjs} +12 -6
  7. package/dist/{chunk-E5RCCGE7.cjs → chunk-DF5JXK36.cjs} +2 -2
  8. package/dist/{chunk-CGEZQC2G.cjs → chunk-F3TT5XPV.cjs} +2 -2
  9. package/dist/{chunk-EE7VP4O3.js → chunk-HQ7C3VB6.js} +1 -1
  10. package/dist/{chunk-ZJJBITUN.js → chunk-IAWLTZUP.js} +2 -2
  11. package/dist/{chunk-YV4JSBPA.js → chunk-L4L77G3X.js} +570 -96
  12. package/dist/{chunk-NTF7TLT7.js → chunk-LBIXTHP7.js} +11 -5
  13. package/dist/{chunk-UOOLU64V.cjs → chunk-LVQOCIES.cjs} +2 -2
  14. package/dist/{chunk-RX3BCX53.cjs → chunk-NCCEWVWY.cjs} +974 -500
  15. package/dist/{chunk-K6J2RIEX.js → chunk-NDJSLJIA.js} +1 -1
  16. package/dist/{chunk-F6P4DIBL.js → chunk-TLYFFUW4.js} +1 -1
  17. package/dist/{chunk-GL6XM527.js → chunk-TX7ZM4OI.js} +8 -3
  18. package/dist/{chunk-NCZDUBC2.js → chunk-WYUXJKMK.js} +1 -1
  19. package/dist/{chunk-NDIBVTBZ.cjs → chunk-XYFCNDJK.cjs} +2 -2
  20. package/dist/{chunk-X6GHTNDL.cjs → chunk-ZG57GAVU.cjs} +7 -7
  21. package/dist/completion/CompletionService.cjs +10 -10
  22. package/dist/completion/CompletionService.js +9 -9
  23. package/dist/completion.cjs +10 -10
  24. package/dist/completion.js +9 -9
  25. package/dist/index.cjs +12 -10
  26. package/dist/index.d.cts +3 -3
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +11 -9
  29. package/dist/outbound-api/routeResolver.d.cts +2 -2
  30. package/dist/outbound-api/routeResolver.d.ts +2 -2
  31. package/dist/outbound-api/types.d.cts +2 -2
  32. package/dist/outbound-api/types.d.ts +2 -2
  33. package/dist/outbound-api.cjs +12 -10
  34. package/dist/outbound-api.d.cts +46 -5
  35. package/dist/outbound-api.d.ts +46 -5
  36. package/dist/outbound-api.js +11 -9
  37. package/dist/pipeline/AccountAllowanceScheduling.d.cts +1 -1
  38. package/dist/pipeline/AccountAllowanceScheduling.d.ts +1 -1
  39. package/dist/pipeline/AccountRouteActivity.cjs +2 -2
  40. package/dist/pipeline/AccountRouteActivity.d.cts +33 -8
  41. package/dist/pipeline/AccountRouteActivity.d.ts +33 -8
  42. package/dist/pipeline/AccountRouteActivity.js +1 -1
  43. package/dist/pipeline/upstreamFetch.cjs +3 -3
  44. package/dist/pipeline/upstreamFetch.d.cts +15 -1
  45. package/dist/pipeline/upstreamFetch.d.ts +15 -1
  46. package/dist/pipeline/upstreamFetch.js +2 -2
  47. package/dist/ports.d.cts +1 -1
  48. package/dist/ports.d.ts +1 -1
  49. package/dist/provider-proxy/ProviderProxy.cjs +10 -10
  50. package/dist/provider-proxy/ProviderProxy.js +9 -9
  51. package/dist/provider-proxy/identity/codexCliHeaders.d.cts +6 -4
  52. package/dist/provider-proxy/identity/codexCliHeaders.d.ts +6 -4
  53. package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +2 -2
  54. package/dist/provider-proxy/identity/openCodeGoHeaders.js +1 -1
  55. package/dist/provider-proxy/ingress/providerProxyShared.cjs +12 -10
  56. package/dist/provider-proxy/ingress/providerProxyShared.d.cts +19 -1
  57. package/dist/provider-proxy/ingress/providerProxyShared.d.ts +19 -1
  58. package/dist/provider-proxy/ingress/providerProxyShared.js +11 -9
  59. package/dist/provider-proxy.cjs +10 -10
  60. package/dist/provider-proxy.d.cts +1 -1
  61. package/dist/provider-proxy.d.ts +1 -1
  62. package/dist/provider-proxy.js +9 -9
  63. package/dist/{routeResolver-C2z0pp-q.d.cts → routeResolver-BdNJvTZP.d.cts} +1 -1
  64. package/dist/{routeResolver-BLTleO4H.d.ts → routeResolver-zVoCx9r3.d.ts} +1 -1
  65. package/dist/transformer/transformers/AntigravityTransformer.cjs +6 -6
  66. package/dist/transformer/transformers/AntigravityTransformer.js +5 -5
  67. package/dist/transformer/transformers/antigravityFailover.cjs +7 -7
  68. package/dist/transformer/transformers/antigravityFailover.js +6 -6
  69. package/dist/transformer/transformers/antigravityIdentity.cjs +4 -4
  70. package/dist/transformer/transformers/antigravityIdentity.js +3 -3
  71. package/dist/transformer/transformers.cjs +8 -8
  72. package/dist/transformer/transformers.js +7 -7
  73. package/dist/transformer.cjs +8 -8
  74. package/dist/transformer.js +7 -7
  75. package/dist/{types-C6m-Db26.d.cts → types-Dt1bgHPg.d.cts} +63 -2
  76. package/dist/{types-Da735j2d.d.ts → types-IRPv4i1Y.d.ts} +63 -2
  77. package/package.json +2 -2
@@ -2,6 +2,7 @@ import { e as ImageApiLimits } from './types-VAHRysdP.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';
@@ -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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnicross/core",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
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.5",
60
60
  "busboy": "^1.6.0",
61
61
  "entities": "^6.0.1",
62
62
  "impit": "^0.14.4",