@omnicross/core 0.4.3 → 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.
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -4
- package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -3
- package/dist/{chunk-MPFOC7AT.js → chunk-24W3DVGI.js} +1 -1
- package/dist/{chunk-WYECWQ3J.cjs → chunk-2DMOOZ4F.cjs} +1 -1
- package/dist/{chunk-NKVZ6Z3Y.cjs → chunk-4HMAS74X.cjs} +8 -3
- package/dist/{chunk-M6PKXP6T.js → chunk-4LSZ7NFM.js} +14 -2
- package/dist/{chunk-VFFCV4J6.cjs → chunk-CXRJMNJJ.cjs} +12 -6
- package/dist/{chunk-E5RCCGE7.cjs → chunk-DF5JXK36.cjs} +2 -2
- package/dist/{chunk-CGEZQC2G.cjs → chunk-F3TT5XPV.cjs} +2 -2
- package/dist/{chunk-EE7VP4O3.js → chunk-HQ7C3VB6.js} +1 -1
- package/dist/{chunk-ZJJBITUN.js → chunk-IAWLTZUP.js} +2 -2
- package/dist/{chunk-SWY2LTMR.js → chunk-L4L77G3X.js} +574 -100
- package/dist/{chunk-NTF7TLT7.js → chunk-LBIXTHP7.js} +11 -5
- package/dist/{chunk-UOOLU64V.cjs → chunk-LVQOCIES.cjs} +2 -2
- package/dist/{chunk-J5XMB5KY.cjs → chunk-NCCEWVWY.cjs} +978 -504
- package/dist/{chunk-K6J2RIEX.js → chunk-NDJSLJIA.js} +1 -1
- package/dist/{chunk-AFH5CEMF.cjs → chunk-SQU2FGXI.cjs} +15 -3
- package/dist/{chunk-F6P4DIBL.js → chunk-TLYFFUW4.js} +1 -1
- package/dist/{chunk-GL6XM527.js → chunk-TX7ZM4OI.js} +8 -3
- package/dist/{chunk-HRBXQ5AC.js → chunk-WYUXJKMK.js} +1 -1
- package/dist/{chunk-NDIBVTBZ.cjs → chunk-XYFCNDJK.cjs} +2 -2
- package/dist/{chunk-X6GHTNDL.cjs → chunk-ZG57GAVU.cjs} +7 -7
- package/dist/completion/CompletionService.cjs +11 -11
- package/dist/completion/CompletionService.js +10 -10
- package/dist/completion.cjs +11 -11
- package/dist/completion.js +10 -10
- package/dist/index.cjs +13 -11
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -10
- package/dist/outbound-api/routeResolver.d.cts +2 -2
- package/dist/outbound-api/routeResolver.d.ts +2 -2
- package/dist/outbound-api/types.d.cts +2 -2
- package/dist/outbound-api/types.d.ts +2 -2
- package/dist/outbound-api.cjs +13 -11
- package/dist/outbound-api.d.cts +46 -5
- package/dist/outbound-api.d.ts +46 -5
- package/dist/outbound-api.js +12 -10
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +1 -1
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +1 -1
- package/dist/pipeline/AccountRouteActivity.cjs +2 -2
- package/dist/pipeline/AccountRouteActivity.d.cts +33 -8
- package/dist/pipeline/AccountRouteActivity.d.ts +33 -8
- package/dist/pipeline/AccountRouteActivity.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +3 -3
- package/dist/pipeline/upstreamFetch.d.cts +15 -1
- package/dist/pipeline/upstreamFetch.d.ts +15 -1
- package/dist/pipeline/upstreamFetch.js +2 -2
- package/dist/ports.d.cts +1 -1
- package/dist/ports.d.ts +1 -1
- package/dist/provider-proxy/ProviderProxy.cjs +11 -11
- package/dist/provider-proxy/ProviderProxy.js +10 -10
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +6 -2
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +42 -11
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +42 -11
- package/dist/provider-proxy/identity/codexCliHeaders.js +6 -2
- package/dist/provider-proxy/identity/openCodeGoHeaders.cjs +2 -2
- package/dist/provider-proxy/identity/openCodeGoHeaders.js +1 -1
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +13 -11
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +19 -1
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +19 -1
- package/dist/provider-proxy/ingress/providerProxyShared.js +12 -10
- package/dist/provider-proxy.cjs +11 -11
- package/dist/provider-proxy.d.cts +1 -1
- package/dist/provider-proxy.d.ts +1 -1
- package/dist/provider-proxy.js +10 -10
- package/dist/{routeResolver-C2z0pp-q.d.cts → routeResolver-BdNJvTZP.d.cts} +1 -1
- package/dist/{routeResolver-BLTleO4H.d.ts → routeResolver-zVoCx9r3.d.ts} +1 -1
- package/dist/transformer/transformers/AntigravityTransformer.cjs +6 -6
- package/dist/transformer/transformers/AntigravityTransformer.js +5 -5
- package/dist/transformer/transformers/antigravityFailover.cjs +7 -7
- package/dist/transformer/transformers/antigravityFailover.js +6 -6
- package/dist/transformer/transformers/antigravityIdentity.cjs +4 -4
- package/dist/transformer/transformers/antigravityIdentity.js +3 -3
- package/dist/transformer/transformers.cjs +8 -8
- package/dist/transformer/transformers.js +7 -7
- package/dist/transformer.cjs +8 -8
- package/dist/transformer.js +7 -7
- package/dist/{types-C6m-Db26.d.cts → types-Dt1bgHPg.d.cts} +63 -2
- package/dist/{types-Da735j2d.d.ts → types-IRPv4i1Y.d.ts} +63 -2
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
BuiltinTransformers,
|
|
4
4
|
getBuiltinTransformers,
|
|
5
5
|
registerBuiltinTransformers
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-24W3DVGI.js";
|
|
7
7
|
import {
|
|
8
8
|
OpenAIResponseTransformer
|
|
9
9
|
} from "../chunk-V53ZEFXC.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isAntigravitySandboxFailoverEnabled,
|
|
22
22
|
maybeAntigravityFailoverUrl,
|
|
23
23
|
setAntigravitySandboxFailover
|
|
24
|
-
} from "../chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
60
|
+
import "../chunk-LBIXTHP7.js";
|
|
61
61
|
import "../chunk-3WD4HTR2.js";
|
|
62
62
|
import "../chunk-FYPKKMB3.js";
|
|
63
|
-
import "../chunk-
|
|
63
|
+
import "../chunk-TX7ZM4OI.js";
|
|
64
64
|
export {
|
|
65
65
|
ANTIGRAVITY_ENDPOINT,
|
|
66
66
|
ANTIGRAVITY_FORCED_TOOL_ASSET_VERSION,
|
package/dist/transformer.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-QVOB2DNX.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkLVQOCIEScjs = require('./chunk-LVQOCIES.cjs');
|
|
5
5
|
require('./chunk-NOITAVHA.cjs');
|
|
6
6
|
require('./chunk-QWNUOR7F.cjs');
|
|
7
7
|
require('./chunk-47E3I5PF.cjs');
|
|
8
8
|
require('./chunk-5RSZYQJH.cjs');
|
|
9
9
|
require('./chunk-VGBJPHHD.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
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-
|
|
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-
|
|
36
|
+
require('./chunk-CXRJMNJJ.cjs');
|
|
37
37
|
require('./chunk-235MXAGX.cjs');
|
|
38
38
|
require('./chunk-VYOBVPNB.cjs');
|
|
39
|
-
require('./chunk-
|
|
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 =
|
|
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 = _chunkLVQOCIEScjs.registerBuiltinTransformers; exports.resolveReasoningEffort = _chunkIUL4VWNUcjs.resolveReasoningEffort; exports.resolveReasoningPlan = _chunkIUL4VWNUcjs.resolveReasoningPlan; exports.resolveReasoningTokenLimit = _chunkIUL4VWNUcjs.resolveReasoningTokenLimit; exports.resolveRequestReasoning = _chunkIUL4VWNUcjs.resolveRequestReasoning; exports.resolveTargetModelCapabilities = _chunkIUL4VWNUcjs.resolveTargetModelCapabilities;
|
package/dist/transformer.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import "./chunk-WTQMX2Q6.js";
|
|
2
2
|
import {
|
|
3
3
|
registerBuiltinTransformers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-24W3DVGI.js";
|
|
5
5
|
import "./chunk-V53ZEFXC.js";
|
|
6
6
|
import "./chunk-7PIUVCKK.js";
|
|
7
7
|
import "./chunk-TKZ3DZS5.js";
|
|
8
8
|
import "./chunk-FU7EAR73.js";
|
|
9
9
|
import "./chunk-IDPMD4B7.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
36
|
+
import "./chunk-LBIXTHP7.js";
|
|
37
37
|
import "./chunk-3WD4HTR2.js";
|
|
38
38
|
import "./chunk-FYPKKMB3.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-TX7ZM4OI.js";
|
|
40
40
|
export {
|
|
41
41
|
THINK_LEVELS,
|
|
42
42
|
TransformerChainExecutor,
|
|
@@ -2,6 +2,7 @@ import { e as ImageApiLimits } from './types-BVwJQ9ZS.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';
|
|
@@ -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
|
-
/**
|
|
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
|
|
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 };
|
|
@@ -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
|
-
/**
|
|
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
|
|
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.
|
|
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.
|
|
59
|
+
"@omnicross/contracts": "^0.4.5",
|
|
60
60
|
"busboy": "^1.6.0",
|
|
61
61
|
"entities": "^6.0.1",
|
|
62
62
|
"impit": "^0.14.4",
|