@omnicross/core 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/NOTICE +57 -57
- package/README.md +22 -15
- package/dist/{CompletionService-kNA17cfI.d.cts → CompletionService-BiJqftc-.d.cts} +1 -1
- package/dist/{CompletionService-C3BX0Ovy.d.ts → CompletionService-NXN_Av5W.d.ts} +1 -1
- package/dist/{ProviderProxy-QdwNV6l1.d.cts → ProviderProxy-CgIcCVwk.d.cts} +1 -1
- package/dist/{ProviderProxy--ROec6VI.d.ts → ProviderProxy-DYoY5XoT.d.ts} +1 -1
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +6 -6
- package/dist/auth/GeminiCodeAssistProjectResolver.js +4 -4
- package/dist/chunk-32SRZFFP.cjs +153 -0
- package/dist/chunk-4JOU54M5.js +200 -0
- package/dist/{chunk-2UTGX6FM.js → chunk-4VVCXVB7.js} +1 -1
- package/dist/{chunk-EPN67EGP.cjs → chunk-5UK3KLE2.cjs} +9 -1
- package/dist/chunk-6DDYNS2B.cjs +384 -0
- package/dist/{chunk-HKB656B4.js → chunk-6OC3ORW6.js} +55 -287
- package/dist/chunk-6OKXH2TW.js +320 -0
- package/dist/{chunk-XELFM7KL.cjs → chunk-7B56AJBB.cjs} +6275 -2421
- package/dist/{chunk-YWL7YZWS.cjs → chunk-7LRTPNFL.cjs} +5 -0
- package/dist/{chunk-CCVRRJOX.js → chunk-7PIUVCKK.js} +9 -2
- package/dist/{chunk-IIRPUVPH.cjs → chunk-7ZHBN75N.cjs} +3 -1
- package/dist/{chunk-UAPBLNN2.js → chunk-AQDON6MB.js} +8 -0
- package/dist/{chunk-RJ5ZGNI3.js → chunk-CFSGYFOZ.js} +1 -1
- package/dist/chunk-CTKM773J.cjs +3919 -0
- package/dist/chunk-DEIUR2TH.js +3919 -0
- package/dist/{chunk-WNKWAEUR.js → chunk-EYGBM2VC.js} +3 -1
- package/dist/{chunk-NGYOO5TO.js → chunk-FJNKXOWE.js} +9 -9
- package/dist/chunk-FX325I5Q.cjs +320 -0
- package/dist/chunk-G4CZIUIB.cjs +200 -0
- package/dist/chunk-HCOQQAZE.cjs +123 -0
- package/dist/{chunk-55FMGZ3L.js → chunk-HN74IGEO.js} +1 -1
- package/dist/{chunk-ZY6KU6P3.js → chunk-HOMUGKHR.js} +8 -5
- package/dist/{chunk-AOFWNWLT.cjs → chunk-IUL4VWNU.cjs} +22 -1
- package/dist/{chunk-5LNYGCIW.cjs → chunk-KIQ2HA2A.cjs} +5 -5
- package/dist/{chunk-MUHWHQVM.cjs → chunk-KQBLZMP6.cjs} +4 -3
- package/dist/chunk-LFEH7CEO.js +384 -0
- package/dist/chunk-N76KU6F5.js +123 -0
- package/dist/{chunk-CMVXX7ON.cjs → chunk-NOITAVHA.cjs} +114 -58
- package/dist/{chunk-Q27JY5RG.cjs → chunk-OIKREZVQ.cjs} +7 -4
- package/dist/{chunk-RJUONLUQ.cjs → chunk-OST5RJOJ.cjs} +1 -1
- package/dist/chunk-QIIAMBTM.js +153 -0
- package/dist/{chunk-56QD3YW6.cjs → chunk-QWNUOR7F.cjs} +11 -4
- package/dist/{chunk-S3DYFEBE.js → chunk-R4VCO2CB.js} +10 -1
- package/dist/{chunk-ZQQUD66M.cjs → chunk-SQMAEDNE.cjs} +63 -295
- package/dist/{chunk-4VZX5F4T.cjs → chunk-T6NWPIYZ.cjs} +5 -2
- package/dist/{chunk-P7EM6BND.cjs → chunk-TVYA5JSQ.cjs} +10 -10
- package/dist/{chunk-EBLFCNPY.js → chunk-U47LQXPB.js} +5 -2
- package/dist/{chunk-N7OOJI5V.js → chunk-V2UKUTJ3.js} +5 -0
- package/dist/{chunk-45FHEOKW.js → chunk-V53ZEFXC.js} +92 -36
- package/dist/{chunk-OC6DOOFX.cjs → chunk-VXRTQZF2.cjs} +5 -5
- package/dist/{chunk-CQIJCPMF.js → chunk-WSJE42SG.js} +5149 -1295
- package/dist/{chunk-RICPANBY.cjs → chunk-WX2E2G7H.cjs} +13 -4
- package/dist/{chunk-DE2SRBFZ.js → chunk-X335TJNS.js} +4 -3
- package/dist/{chunk-N2EIM2XJ.js → chunk-ZLNHPUFA.js} +22 -1
- package/dist/completion/CompletionService.cjs +30 -27
- package/dist/completion/CompletionService.d.cts +3 -2
- package/dist/completion/CompletionService.d.ts +3 -2
- package/dist/completion/CompletionService.js +29 -26
- package/dist/completion.cjs +38 -35
- package/dist/completion.d.cts +3 -2
- package/dist/completion.d.ts +3 -2
- package/dist/completion.js +37 -34
- package/dist/image-generation.cjs +52 -0
- package/dist/image-generation.d.cts +93 -0
- package/dist/image-generation.d.ts +93 -0
- package/dist/image-generation.js +52 -0
- package/dist/index.cjs +126 -31
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +143 -48
- package/dist/openai-operation.cjs +18 -0
- package/dist/openai-operation.d.cts +19 -0
- package/dist/openai-operation.d.ts +19 -0
- package/dist/openai-operation.js +18 -0
- package/dist/outbound-api/auditCapture.cjs +3 -3
- package/dist/outbound-api/auditCapture.d.cts +19 -2
- package/dist/outbound-api/auditCapture.d.ts +19 -2
- package/dist/outbound-api/auditCapture.js +2 -2
- package/dist/outbound-api/auditRedact.cjs +2 -2
- package/dist/outbound-api/auditRedact.js +1 -1
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +7 -4
- package/dist/outbound-api/routeResolver.d.ts +7 -4
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +2 -1
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +2 -1
- package/dist/outbound-api/types.d.cts +6 -3
- package/dist/outbound-api/types.d.ts +6 -3
- package/dist/outbound-api.cjs +49 -32
- package/dist/outbound-api.d.cts +97 -10
- package/dist/outbound-api.d.ts +97 -10
- package/dist/outbound-api.js +48 -31
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +18 -15
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +18 -15
- package/dist/pipeline/LlmConfigProviderAuth.cjs +3 -3
- package/dist/pipeline/LlmConfigProviderAuth.js +2 -2
- package/dist/pipeline/SubscriptionAccountHealth.cjs +2 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +7 -0
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +7 -0
- package/dist/pipeline/SubscriptionAccountHealth.js +1 -1
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.d.cts +11 -6
- package/dist/pipeline/executeProviderCall.d.ts +11 -6
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +2 -2
- package/dist/pipeline/upstreamFetch.d.cts +5 -0
- package/dist/pipeline/upstreamFetch.d.ts +5 -0
- package/dist/pipeline/upstreamFetch.js +1 -1
- package/dist/ports.d.cts +6 -3
- package/dist/ports.d.ts +6 -3
- package/dist/provider-proxy/ProviderProxy.cjs +30 -27
- package/dist/provider-proxy/ProviderProxy.d.cts +3 -2
- package/dist/provider-proxy/ProviderProxy.d.ts +3 -2
- package/dist/provider-proxy/ProviderProxy.js +29 -26
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +4 -2
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +26 -6
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +26 -6
- package/dist/provider-proxy/identity/codexCliHeaders.js +5 -3
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +32 -27
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +21 -8
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +21 -8
- package/dist/provider-proxy/ingress/providerProxyShared.js +31 -26
- package/dist/provider-proxy/types.d.cts +14 -483
- package/dist/provider-proxy/types.d.ts +14 -483
- package/dist/provider-proxy.cjs +44 -27
- package/dist/provider-proxy.d.cts +30 -8
- package/dist/provider-proxy.d.ts +30 -8
- package/dist/provider-proxy.js +43 -26
- package/dist/{routeResolver-C0mkkZaM.d.ts → routeResolver-CTCcSHWu.d.ts} +4 -2
- package/dist/{routeResolver-CVFE8KKe.d.cts → routeResolver-rpKQLyDO.d.cts} +4 -2
- package/dist/transformer/TransformerChainExecutor.cjs +2 -2
- package/dist/transformer/TransformerChainExecutor.d.cts +2 -2
- package/dist/transformer/TransformerChainExecutor.d.ts +2 -2
- package/dist/transformer/TransformerChainExecutor.js +1 -1
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.cjs +16 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.cts +53 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.d.ts +53 -0
- package/dist/transformer/transformers/AnthropicOpenAIToAnthropicStream.js +16 -0
- package/dist/transformer/transformers/AnthropicTransformer.cjs +4 -3
- package/dist/transformer/transformers/AnthropicTransformer.js +3 -2
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +4 -4
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +3 -3
- package/dist/transformer/transformers/GeminiTransformer.cjs +4 -4
- package/dist/transformer/transformers/GeminiTransformer.js +3 -3
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -3
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAITransformer.cjs +3 -3
- package/dist/transformer/transformers/OpenAITransformer.js +2 -2
- package/dist/transformer/transformers.cjs +10 -9
- package/dist/transformer/transformers.js +13 -12
- package/dist/transformer/types.d.cts +39 -4
- package/dist/transformer/types.d.ts +39 -4
- package/dist/transformer.cjs +14 -13
- package/dist/transformer.js +14 -13
- package/dist/{types-BB8pxk_3.d.ts → types-5T223WYQ.d.ts} +183 -23
- package/dist/types-Bd72H4SB.d.ts +196 -0
- package/dist/types-CVRge76p.d.ts +1115 -0
- package/dist/types-CbglB73l.d.cts +196 -0
- package/dist/types-DsHBBk3h.d.cts +1115 -0
- package/dist/{types-C2MwkLah.d.cts → types-jjU24eYG.d.cts} +183 -23
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +12 -2
- package/dist/usage/usage-recorder.d.ts +12 -2
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +20 -3
- package/dist/usage.d.cts +154 -0
- package/dist/usage.d.ts +154 -0
- package/dist/usage.js +20 -3
- package/package.json +69 -64
- package/dist/chunk-7C7DET6S.js +0 -154
- package/dist/chunk-7VU7V2E4.js +0 -0
- package/dist/chunk-EYZYXJTJ.cjs +0 -1
- package/dist/chunk-FCR77GYM.cjs +0 -33
- package/dist/chunk-K5NM7VAH.js +0 -33
- package/dist/chunk-XPIOJQS2.cjs +0 -154
- /package/dist/{chunk-XXFYLL7R.js → chunk-ECZ3ZE2C.js} +0 -0
- /package/dist/{chunk-3SCOLIPT.cjs → chunk-MXI2PWIC.cjs} +0 -0
|
@@ -104,6 +104,11 @@ var SubscriptionAccountHealth = (_class = class {
|
|
|
104
104
|
const preExisting = this.records.get(key);
|
|
105
105
|
const record = _nullishCoalesce(preExisting, () => ( {}));
|
|
106
106
|
const status = input.status;
|
|
107
|
+
if (input.upstreamErrorType) {
|
|
108
|
+
console.info(
|
|
109
|
+
`[AccountHealth] upstream error type ${input.upstreamErrorType} (provider=${providerId} status=${String(status)})`
|
|
110
|
+
);
|
|
111
|
+
}
|
|
107
112
|
const wasUnhealthyBefore = preExisting ? this.isUnhealthyAt(preExisting, now) : false;
|
|
108
113
|
let anomalyState;
|
|
109
114
|
let recovered = false;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
extractReasoningIntent,
|
|
3
|
+
recordDroppedField,
|
|
3
4
|
resolveReasoningPlan
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZLNHPUFA.js";
|
|
5
6
|
|
|
6
7
|
// src/transformer/transformers/OpenAITransformer.ts
|
|
7
8
|
var FOREIGN_MESSAGE_KEYS = ["cache_control", "thinking"];
|
|
8
|
-
var FOREIGN_BODY_KEYS = ["meta", "reasoning", "thinking"];
|
|
9
|
+
var FOREIGN_BODY_KEYS = ["meta", "reasoning", "thinking", "top_k", "metadata_user_id", "_transformWarnings"];
|
|
9
10
|
function normalizeContent(content) {
|
|
10
11
|
if (!Array.isArray(content)) return content;
|
|
11
12
|
const cleaned = content.map((block) => {
|
|
@@ -36,6 +37,12 @@ var OpenAITransformer = class {
|
|
|
36
37
|
if (FOREIGN_BODY_KEYS.includes(key)) continue;
|
|
37
38
|
out[key] = source[key];
|
|
38
39
|
}
|
|
40
|
+
if (request.metadata_user_id !== void 0) {
|
|
41
|
+
out.user = request.metadata_user_id;
|
|
42
|
+
}
|
|
43
|
+
if (request.top_k !== void 0) {
|
|
44
|
+
recordDroppedField(request, "top_k", "openai-chat");
|
|
45
|
+
}
|
|
39
46
|
if (Array.isArray(request.messages)) {
|
|
40
47
|
out.messages = request.messages.map((message) => {
|
|
41
48
|
const src = message;
|
|
@@ -30,6 +30,7 @@ var TransformerChainExecutor = class {
|
|
|
30
30
|
providerName: provider.name
|
|
31
31
|
};
|
|
32
32
|
let requestBody = request;
|
|
33
|
+
let endpointRequest;
|
|
33
34
|
let config = {};
|
|
34
35
|
let bypass = false;
|
|
35
36
|
bypass = this.shouldBypassTransformers(
|
|
@@ -60,6 +61,7 @@ var TransformerChainExecutor = class {
|
|
|
60
61
|
this.logger.error(`transformRequestOut error: ${this.getErrorMessage(error)}`);
|
|
61
62
|
throw error;
|
|
62
63
|
}
|
|
64
|
+
endpointRequest = requestBody;
|
|
63
65
|
}
|
|
64
66
|
if (!bypass && chain.providerTransformers.length > 0) {
|
|
65
67
|
this.logger.debug(`Executing ${chain.providerTransformers.length} provider transformers`);
|
|
@@ -118,7 +120,7 @@ var TransformerChainExecutor = class {
|
|
|
118
120
|
true
|
|
119
121
|
);
|
|
120
122
|
}
|
|
121
|
-
return { requestBody, config, bypass };
|
|
123
|
+
return { requestBody, endpointRequest, config, bypass };
|
|
122
124
|
}
|
|
123
125
|
/**
|
|
124
126
|
* Execute the response transformation chain
|
|
@@ -10,12 +10,14 @@ var UsageRecorder = class {
|
|
|
10
10
|
this.logger = logger;
|
|
11
11
|
this.defer = options.defer ?? ((fn) => setTimeout(fn, 0));
|
|
12
12
|
this.onRecord = options.onRecord;
|
|
13
|
+
this.onEvent = options.onEvent;
|
|
13
14
|
}
|
|
14
15
|
store;
|
|
15
16
|
pricing;
|
|
16
17
|
logger;
|
|
17
18
|
defer;
|
|
18
19
|
onRecord;
|
|
20
|
+
onEvent;
|
|
19
21
|
/**
|
|
20
22
|
* Record one LLM request. Returns immediately — the actual store insert is
|
|
21
23
|
* deferred so the caller's response path is unblocked.
|
|
@@ -85,6 +87,12 @@ var UsageRecorder = class {
|
|
|
85
87
|
...input.cacheKeySource !== void 0 ? { cacheKeySource: input.cacheKeySource } : {},
|
|
86
88
|
...input.cacheKeyInjected !== void 0 ? { cacheKeyInjected: input.cacheKeyInjected } : {}
|
|
87
89
|
};
|
|
90
|
+
if (this.onEvent) {
|
|
91
|
+
try {
|
|
92
|
+
this.onEvent(row, Date.now());
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
}
|
|
88
96
|
try {
|
|
89
97
|
return await this.store.insert(row);
|
|
90
98
|
} catch (err) {
|
|
@@ -158,7 +158,7 @@ function fetchUpstream(url, init, ctx) {
|
|
|
158
158
|
const redactBodies = ctx.redactBodies === true;
|
|
159
159
|
const requestBody = redactBodies ? REDACTED_BODY : typeof init.body === "string" ? init.body : null;
|
|
160
160
|
const providerId = ctx.providerId;
|
|
161
|
-
const accountId = ctx.accountId;
|
|
161
|
+
const accountId = ctx.traceAccountFingerprint ?? ctx.accountId;
|
|
162
162
|
return doFetchWithActivity().then((res) => {
|
|
163
163
|
const clone = res.clone();
|
|
164
164
|
const status = res.status;
|