@omnicross/core 0.1.3 → 0.1.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/LICENSE +21 -21
- package/NOTICE +57 -57
- package/README.md +15 -15
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +6 -5
- package/dist/auth/GeminiCodeAssistProjectResolver.js +6 -5
- package/dist/{chunk-2DCNB7DF.cjs → chunk-3Q6Z6JTO.cjs} +154 -26
- package/dist/chunk-3QFXFCHG.js +33 -0
- package/dist/chunk-3Z5BQZFM.cjs +52 -0
- package/dist/{chunk-4VAVYUZS.cjs → chunk-4XMYPW46.cjs} +9 -9
- package/dist/chunk-4YINUUKQ.cjs +33 -0
- package/dist/{chunk-S4WBV25P.js → chunk-6QZGDLL4.js} +106 -23
- package/dist/{chunk-C72S6TTV.cjs → chunk-7FEBOPJO.cjs} +5 -4
- package/dist/chunk-APYG5QD7.cjs +50 -0
- package/dist/{chunk-5HTVET6E.js → chunk-BODMAL6G.js} +143 -15
- package/dist/{chunk-CWM2ZDU5.js → chunk-BPKCU575.js} +3 -10
- package/dist/{chunk-2FMI2B6V.cjs → chunk-CGKLE6IW.cjs} +350 -461
- package/dist/{chunk-BO4RFWBR.js → chunk-D3TDKWRP.js} +84 -3
- package/dist/{chunk-RSJ3TWJQ.cjs → chunk-DDMRUL76.cjs} +5 -5
- package/dist/chunk-FCR77GYM.cjs +33 -0
- package/dist/{chunk-4DECIFU7.js → chunk-FH2P4OCD.js} +178 -289
- package/dist/{chunk-N5QFKSDO.js → chunk-HRRYG2AX.js} +2 -1
- package/dist/{chunk-KUU2RNG6.cjs → chunk-HYN75H6G.cjs} +3 -0
- package/dist/{chunk-Z7LUNECE.js → chunk-IB3FDI4O.js} +5 -4
- package/dist/chunk-IFXJ2BG7.js +109 -0
- package/dist/{chunk-JO5NLTLY.js → chunk-IK3KE3AU.js} +3 -0
- package/dist/{chunk-C7PSERMH.js → chunk-IWQAX3CS.js} +1 -1
- package/dist/{chunk-YGXJGRFI.cjs → chunk-JWVTXXPX.cjs} +106 -23
- package/dist/{chunk-7YN22L2H.cjs → chunk-K52THW2C.cjs} +5 -5
- package/dist/chunk-K5NM7VAH.js +33 -0
- package/dist/{chunk-Y6OM7EV7.cjs → chunk-KFI44N2R.cjs} +2 -1
- package/dist/{chunk-Z7Y2NPHY.js → chunk-MFZ5437A.js} +1 -1
- package/dist/chunk-OE6TDIWW.js +22 -0
- package/dist/{chunk-MQNDWYPN.js → chunk-OQWKZCXP.js} +13 -6
- package/dist/chunk-OZFM4X3S.js +18 -0
- package/dist/chunk-PG7PS2NN.cjs +170 -0
- package/dist/{chunk-3QOSDDNI.cjs → chunk-SNYBEXLB.cjs} +6 -13
- package/dist/chunk-SYQF7OIR.js +52 -0
- package/dist/{chunk-CZHZGRU7.js → chunk-UHGVBFU3.js} +2 -0
- package/dist/chunk-UIBD2YY5.cjs +22 -0
- package/dist/chunk-UNWKG6EI.cjs +109 -0
- package/dist/{chunk-SVXC36MU.cjs → chunk-VACWOIRE.cjs} +2 -0
- package/dist/chunk-WLYIIEAF.js +50 -0
- package/dist/chunk-XSVNC2UD.cjs +18 -0
- package/dist/{chunk-FFALUUZZ.cjs → chunk-ZCIQ3L3R.cjs} +18 -11
- package/dist/completion/CompletionService.cjs +26 -19
- package/dist/completion/CompletionService.js +25 -18
- package/dist/completion.cjs +28 -21
- package/dist/completion.js +27 -20
- package/dist/index.cjs +35 -25
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +44 -34
- package/dist/keyPolicy-Cp0FntZl.d.cts +90 -0
- package/dist/keyPolicy-Cp0FntZl.d.ts +90 -0
- package/dist/outbound-api/auditCapture.cjs +9 -0
- package/dist/outbound-api/auditCapture.d.cts +54 -0
- package/dist/outbound-api/auditCapture.d.ts +54 -0
- package/dist/outbound-api/auditCapture.js +9 -0
- package/dist/outbound-api/auditRedact.cjs +8 -0
- package/dist/outbound-api/auditRedact.d.cts +30 -0
- package/dist/outbound-api/auditRedact.d.ts +30 -0
- package/dist/outbound-api/auditRedact.js +8 -0
- package/dist/outbound-api/billingCapture.cjs +8 -0
- package/dist/outbound-api/billingCapture.d.cts +61 -0
- package/dist/outbound-api/billingCapture.d.ts +61 -0
- package/dist/outbound-api/billingCapture.js +8 -0
- package/dist/outbound-api/quotaWarn.cjs +12 -0
- package/dist/outbound-api/quotaWarn.d.cts +43 -0
- package/dist/outbound-api/quotaWarn.d.ts +43 -0
- package/dist/outbound-api/quotaWarn.js +12 -0
- package/dist/outbound-api/routeResolver.cjs +2 -2
- package/dist/outbound-api/routeResolver.d.cts +3 -2
- package/dist/outbound-api/routeResolver.d.ts +3 -2
- package/dist/outbound-api/routeResolver.js +1 -1
- package/dist/outbound-api/types.d.cts +2 -1
- package/dist/outbound-api/types.d.ts +2 -1
- package/dist/outbound-api.cjs +33 -23
- package/dist/outbound-api.d.cts +9 -140
- package/dist/outbound-api.d.ts +9 -140
- package/dist/outbound-api.js +32 -22
- package/dist/pipeline/AuthSource.d.cts +6 -0
- package/dist/pipeline/AuthSource.d.ts +6 -0
- package/dist/pipeline/SubscriptionAuthSource.cjs +2 -2
- package/dist/pipeline/SubscriptionAuthSource.js +1 -1
- package/dist/pipeline/SubscriptionAuthStrategy.d.cts +6 -0
- package/dist/pipeline/SubscriptionAuthStrategy.d.ts +6 -0
- package/dist/pipeline/auditUsageStash.cjs +10 -0
- package/dist/pipeline/auditUsageStash.d.cts +37 -0
- package/dist/pipeline/auditUsageStash.d.ts +37 -0
- package/dist/pipeline/auditUsageStash.js +10 -0
- package/dist/pipeline/executeProviderCall.cjs +2 -2
- package/dist/pipeline/executeProviderCall.js +1 -1
- package/dist/pipeline/upstreamFetch.cjs +15 -0
- package/dist/pipeline/upstreamFetch.d.cts +89 -0
- package/dist/pipeline/upstreamFetch.d.ts +89 -0
- package/dist/pipeline/upstreamFetch.js +15 -0
- package/dist/pipeline/upstreamTrace.cjs +14 -0
- package/dist/pipeline/upstreamTrace.d.cts +85 -0
- package/dist/pipeline/upstreamTrace.d.ts +85 -0
- package/dist/pipeline/upstreamTrace.js +14 -0
- package/dist/pipeline/webhookEmit.cjs +10 -0
- package/dist/pipeline/webhookEmit.d.cts +36 -0
- package/dist/pipeline/webhookEmit.d.ts +36 -0
- package/dist/pipeline/webhookEmit.js +10 -0
- package/dist/ports.d.cts +2 -1
- package/dist/ports.d.ts +2 -1
- package/dist/provider-proxy/ProviderProxy.cjs +26 -19
- package/dist/provider-proxy/ProviderProxy.js +25 -18
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +28 -19
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +17 -1
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +17 -1
- package/dist/provider-proxy/ingress/providerProxyShared.js +27 -18
- package/dist/provider-proxy/types.d.cts +7 -0
- package/dist/provider-proxy/types.d.ts +7 -0
- package/dist/provider-proxy.cjs +26 -19
- package/dist/provider-proxy.js +25 -18
- package/dist/{routeResolver-B1NglTfe.d.ts → routeResolver-C4T7yClx.d.ts} +1 -1
- package/dist/{routeResolver-CbG5uBgm.d.cts → routeResolver-CB3tvJKy.d.cts} +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +2 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +1 -1
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiCodeAssistTransformer.js +2 -2
- package/dist/transformer/transformers/GeminiTransformer.cjs +3 -3
- package/dist/transformer/transformers/GeminiTransformer.js +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +2 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +1 -1
- package/dist/transformer/transformers/OpenCodeGoTransformer.cjs +2 -2
- package/dist/transformer/transformers/OpenCodeGoTransformer.js +1 -1
- 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-aBFFXoBz.d.cts → types-B8Arpxn0.d.cts} +14 -90
- package/dist/{types-6OUY_xfA.d.ts → types-lgPYQuZS.d.ts} +14 -90
- package/dist/usage/usage-recorder.cjs +3 -2
- package/dist/usage/usage-recorder.js +2 -1
- package/dist/usage.cjs +3 -2
- package/dist/usage.js +2 -1
- package/package.json +64 -64
- package/dist/chunk-S6JGLF3G.cjs +0 -89
- package/dist/{chunk-FTQ7IQUC.js → chunk-C6OV7GCC.js} +8 -8
package/dist/chunk-S6JGLF3G.cjs
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/pipeline/upstreamFetch.ts
|
|
2
|
-
var _undici = require('undici');
|
|
3
|
-
var _socks = require('socks');
|
|
4
|
-
var resolver = null;
|
|
5
|
-
var generation = 0;
|
|
6
|
-
var cache = /* @__PURE__ */ new Map();
|
|
7
|
-
function normalizeProxy(cfg) {
|
|
8
|
-
if ("url" in cfg) {
|
|
9
|
-
let u;
|
|
10
|
-
try {
|
|
11
|
-
u = new URL(cfg.url);
|
|
12
|
-
} catch (e) {
|
|
13
|
-
return void 0;
|
|
14
|
-
}
|
|
15
|
-
const proto = u.protocol.replace(/:$/, "").toLowerCase();
|
|
16
|
-
const kind2 = proto === "socks5" || proto === "socks" ? "socks5" : proto === "https" ? "https" : "http";
|
|
17
|
-
const port = u.port ? Number(u.port) : kind2 === "https" ? 443 : kind2 === "socks5" ? 1080 : 80;
|
|
18
|
-
if (!u.hostname || !Number.isFinite(port)) return void 0;
|
|
19
|
-
return {
|
|
20
|
-
kind: kind2,
|
|
21
|
-
host: u.hostname,
|
|
22
|
-
port,
|
|
23
|
-
username: u.username ? decodeURIComponent(u.username) : void 0,
|
|
24
|
-
password: u.password ? decodeURIComponent(u.password) : void 0
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
const kind = cfg.type === "socks5" ? "socks5" : cfg.type === "https" ? "https" : "http";
|
|
28
|
-
if (!cfg.host || !Number.isFinite(cfg.port)) return void 0;
|
|
29
|
-
return {
|
|
30
|
-
kind,
|
|
31
|
-
host: cfg.host,
|
|
32
|
-
port: cfg.port,
|
|
33
|
-
username: cfg.username || void 0,
|
|
34
|
-
password: cfg.password || void 0
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function proxyKey(p) {
|
|
38
|
-
return `${p.kind}://${_nullishCoalesce(p.username, () => ( ""))}:${_nullishCoalesce(p.password, () => ( ""))}@${p.host}:${p.port}`;
|
|
39
|
-
}
|
|
40
|
-
function socksConnector(p) {
|
|
41
|
-
const base = _undici.buildConnector.call(void 0, {});
|
|
42
|
-
return ((options, callback) => {
|
|
43
|
-
const destPort = Number(options.port) || (options.protocol === "https:" ? 443 : 80);
|
|
44
|
-
_socks.SocksClient.createConnection({
|
|
45
|
-
proxy: { host: p.host, port: p.port, type: 5, userId: p.username, password: p.password },
|
|
46
|
-
command: "connect",
|
|
47
|
-
destination: { host: options.hostname, port: destPort }
|
|
48
|
-
}).then(({ socket }) => {
|
|
49
|
-
base({ ...options, httpSocket: socket }, callback);
|
|
50
|
-
}).catch((err) => callback(err, null));
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function buildDispatcher(p) {
|
|
54
|
-
if (p.kind === "socks5") {
|
|
55
|
-
return new (0, _undici.Agent)({ connect: socksConnector(p) });
|
|
56
|
-
}
|
|
57
|
-
const auth = p.username != null ? `${encodeURIComponent(p.username)}:${encodeURIComponent(_nullishCoalesce(p.password, () => ( "")))}@` : "";
|
|
58
|
-
const uri = `${p.kind}://${auth}${p.host}:${p.port}`;
|
|
59
|
-
return new (0, _undici.ProxyAgent)({ uri });
|
|
60
|
-
}
|
|
61
|
-
function resolveUpstreamDispatcher(ctx) {
|
|
62
|
-
const active = resolver;
|
|
63
|
-
if (!active) return void 0;
|
|
64
|
-
let cfg;
|
|
65
|
-
try {
|
|
66
|
-
cfg = active(ctx);
|
|
67
|
-
} catch (e2) {
|
|
68
|
-
return void 0;
|
|
69
|
-
}
|
|
70
|
-
if (!cfg) return void 0;
|
|
71
|
-
const norm = normalizeProxy(cfg);
|
|
72
|
-
if (!norm) return void 0;
|
|
73
|
-
const key = `${generation}\0${proxyKey(norm)}`;
|
|
74
|
-
let dispatcher = cache.get(key);
|
|
75
|
-
if (!dispatcher) {
|
|
76
|
-
dispatcher = buildDispatcher(norm);
|
|
77
|
-
cache.set(key, dispatcher);
|
|
78
|
-
}
|
|
79
|
-
return dispatcher;
|
|
80
|
-
}
|
|
81
|
-
function fetchUpstream(url, init, ctx) {
|
|
82
|
-
const dispatcher = resolveUpstreamDispatcher({ ..._nullishCoalesce(ctx, () => ( {})), url });
|
|
83
|
-
if (!dispatcher) return fetch(url, init);
|
|
84
|
-
return fetch(url, { ...init, dispatcher });
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
exports.fetchUpstream = fetchUpstream;
|
|
@@ -237,6 +237,14 @@ function convertOpenAIResponseToAnthropic(openaiResponse) {
|
|
|
237
237
|
}
|
|
238
238
|
const message = choice.message;
|
|
239
239
|
const content = [];
|
|
240
|
+
const thinking = message.thinking;
|
|
241
|
+
if (thinking?.content) {
|
|
242
|
+
content.push({
|
|
243
|
+
type: "thinking",
|
|
244
|
+
thinking: thinking.content,
|
|
245
|
+
signature: thinking.signature
|
|
246
|
+
});
|
|
247
|
+
}
|
|
240
248
|
if (message.content) {
|
|
241
249
|
content.push({
|
|
242
250
|
type: "text",
|
|
@@ -262,14 +270,6 @@ function convertOpenAIResponseToAnthropic(openaiResponse) {
|
|
|
262
270
|
});
|
|
263
271
|
}
|
|
264
272
|
}
|
|
265
|
-
const thinking = message.thinking;
|
|
266
|
-
if (thinking?.content) {
|
|
267
|
-
content.push({
|
|
268
|
-
type: "thinking",
|
|
269
|
-
thinking: thinking.content,
|
|
270
|
-
signature: thinking.signature
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
273
|
const finishReason = choice.finish_reason;
|
|
274
274
|
const stopReasonMapping = {
|
|
275
275
|
stop: "end_turn",
|