@omnicross/core 0.1.6 → 0.1.7
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/ApiConverter.cjs +2 -2
- package/dist/ApiConverter.js +1 -1
- package/dist/auth/GeminiCodeAssistProjectResolver.cjs +4 -3
- package/dist/auth/GeminiCodeAssistProjectResolver.js +3 -2
- package/dist/{chunk-3Z5BQZFM.cjs → chunk-235MXAGX.cjs} +3 -1
- package/dist/{chunk-DLXZEZWO.cjs → chunk-2E42SAW3.cjs} +42 -4
- package/dist/{chunk-7AK7B36B.cjs → chunk-2Z4XM3H5.cjs} +6 -6
- package/dist/{chunk-OEWZUX4G.js → chunk-32O35CIF.js} +9 -20
- package/dist/chunk-3SCOLIPT.cjs +63 -0
- package/dist/{chunk-SYQF7OIR.js → chunk-3WD4HTR2.js} +2 -0
- package/dist/{chunk-SQYVORNP.cjs → chunk-4BB343BI.cjs} +527 -267
- package/dist/{chunk-AT7B7SOZ.js → chunk-5NJLQ6T6.js} +21 -10
- package/dist/chunk-5RSZYQJH.cjs +62 -0
- package/dist/{chunk-IFXJ2BG7.js → chunk-7C7DET6S.js} +51 -6
- package/dist/{chunk-UDCC7EMR.js → chunk-E3COOKUP.js} +307 -47
- package/dist/chunk-FU7EAR73.js +62 -0
- package/dist/{chunk-UX7VWA46.js → chunk-FXR6N3SR.js} +39 -1
- package/dist/{chunk-WYTEQ4Q5.cjs → chunk-GDIXXKF2.cjs} +21 -10
- package/dist/{chunk-WB6PH56J.js → chunk-GFIZ6LQI.js} +12 -8
- package/dist/chunk-GL6XM527.js +61 -0
- package/dist/{chunk-EJLH6NFT.cjs → chunk-J3QQ6JS5.cjs} +12 -8
- package/dist/{chunk-VRFBB5DB.js → chunk-MYYR3HZL.js} +4 -4
- package/dist/{chunk-YJVHCHQX.js → chunk-N7OOJI5V.js} +46 -2
- package/dist/chunk-NKVZ6Z3Y.cjs +61 -0
- package/dist/{chunk-SNYBEXLB.cjs → chunk-OJGQKHN5.cjs} +3 -1
- package/dist/chunk-OTZC4TNH.cjs +79 -0
- package/dist/{chunk-6VUQPOV3.cjs → chunk-OVQBNVSV.cjs} +10 -21
- package/dist/{chunk-4VLRHHFE.cjs → chunk-OXHNSZ53.cjs} +9 -11
- package/dist/{chunk-6CL5HTPQ.js → chunk-PEGTIPB3.js} +8 -10
- package/dist/chunk-PO3XB56Z.js +79 -0
- package/dist/{chunk-SIZQQD6T.js → chunk-RJ5ZGNI3.js} +42 -5
- package/dist/{chunk-KCVJWJST.cjs → chunk-RJUONLUQ.cjs} +47 -10
- package/dist/{chunk-BPKCU575.js → chunk-SOO562NM.js} +3 -1
- package/dist/{chunk-UNWKG6EI.cjs → chunk-XPIOJQS2.cjs} +51 -6
- package/dist/chunk-XXFYLL7R.js +63 -0
- package/dist/{chunk-YK57NMIF.cjs → chunk-YWL7YZWS.cjs} +47 -3
- package/dist/completion/CompletionService.cjs +23 -19
- package/dist/completion/CompletionService.d.cts +1 -0
- package/dist/completion/CompletionService.d.ts +1 -0
- package/dist/completion/CompletionService.js +22 -18
- package/dist/completion.cjs +23 -19
- package/dist/completion.d.cts +1 -0
- package/dist/completion.d.ts +1 -0
- package/dist/completion.js +22 -18
- package/dist/index.cjs +26 -22
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -22
- package/dist/outbound-api/auditCapture.cjs +2 -2
- package/dist/outbound-api/auditCapture.d.cts +3 -4
- package/dist/outbound-api/auditCapture.d.ts +3 -4
- package/dist/outbound-api/auditCapture.js +1 -1
- package/dist/outbound-api/routeResolver.d.cts +3 -2
- package/dist/outbound-api/routeResolver.d.ts +3 -2
- package/dist/outbound-api/subscriptionRegistryPort.d.cts +1 -0
- package/dist/outbound-api/subscriptionRegistryPort.d.ts +1 -0
- package/dist/outbound-api/types.d.cts +2 -1
- package/dist/outbound-api/types.d.ts +2 -1
- package/dist/outbound-api.cjs +23 -19
- package/dist/outbound-api.d.cts +7 -5
- package/dist/outbound-api.d.ts +7 -5
- package/dist/outbound-api.js +22 -18
- package/dist/pipeline/AccountAllowanceScheduling.d.cts +2 -1
- package/dist/pipeline/AccountAllowanceScheduling.d.ts +2 -1
- package/dist/pipeline/AccountRouteActivity.cjs +10 -0
- package/dist/pipeline/AccountRouteActivity.d.cts +61 -0
- package/dist/pipeline/AccountRouteActivity.d.ts +61 -0
- package/dist/pipeline/AccountRouteActivity.js +10 -0
- package/dist/pipeline/ServerOverloadCounter.cjs +16 -0
- package/dist/pipeline/ServerOverloadCounter.d.cts +77 -0
- package/dist/pipeline/ServerOverloadCounter.d.ts +77 -0
- package/dist/pipeline/ServerOverloadCounter.js +16 -0
- package/dist/pipeline/SubscriptionAccountHealth.cjs +4 -2
- package/dist/pipeline/SubscriptionAccountHealth.d.cts +32 -3
- package/dist/pipeline/SubscriptionAccountHealth.d.ts +32 -3
- package/dist/pipeline/SubscriptionAccountHealth.js +3 -1
- package/dist/pipeline/upstreamFetch.cjs +4 -3
- package/dist/pipeline/upstreamFetch.d.cts +35 -6
- package/dist/pipeline/upstreamFetch.d.ts +35 -6
- package/dist/pipeline/upstreamFetch.js +3 -2
- package/dist/pipeline/upstreamTrace.cjs +4 -2
- package/dist/pipeline/upstreamTrace.d.cts +22 -8
- package/dist/pipeline/upstreamTrace.d.ts +22 -8
- package/dist/pipeline/upstreamTrace.js +3 -1
- package/dist/ports.d.cts +1 -1
- package/dist/ports.d.ts +1 -1
- package/dist/provider-proxy/ProviderProxy.cjs +23 -19
- package/dist/provider-proxy/ProviderProxy.d.cts +1 -0
- package/dist/provider-proxy/ProviderProxy.d.ts +1 -0
- package/dist/provider-proxy/ProviderProxy.js +22 -18
- package/dist/provider-proxy/identity/codexCliHeaders.cjs +10 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.cts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.d.ts +45 -0
- package/dist/provider-proxy/identity/codexCliHeaders.js +10 -0
- package/dist/provider-proxy/ingress/providerProxyShared.cjs +23 -19
- package/dist/provider-proxy/ingress/providerProxyShared.d.cts +11 -1
- package/dist/provider-proxy/ingress/providerProxyShared.d.ts +11 -1
- package/dist/provider-proxy/ingress/providerProxyShared.js +22 -18
- package/dist/provider-proxy/matchText.cjs +2 -2
- package/dist/provider-proxy/matchText.d.cts +1 -3
- package/dist/provider-proxy/matchText.d.ts +1 -3
- package/dist/provider-proxy/matchText.js +1 -1
- package/dist/provider-proxy/types.d.cts +5 -0
- package/dist/provider-proxy/types.d.ts +5 -0
- package/dist/provider-proxy.cjs +23 -19
- package/dist/provider-proxy.d.cts +1 -0
- package/dist/provider-proxy.d.ts +1 -0
- package/dist/provider-proxy.js +22 -18
- package/dist/{routeResolver-CHTv_Bs5.d.ts → routeResolver-BxOfunbm.d.ts} +1 -1
- package/dist/{routeResolver-kepxnfcC.d.cts → routeResolver-D5OzD0iM.d.cts} +1 -1
- package/dist/transformer/transformers/AnthropicTransformer.cjs +3 -2
- package/dist/transformer/transformers/AnthropicTransformer.js +2 -1
- package/dist/transformer/transformers/OpenAIResponseTransformer.cjs +3 -2
- package/dist/transformer/transformers/OpenAIResponseTransformer.js +2 -1
- package/dist/transformer/transformers.cjs +7 -6
- package/dist/transformer/transformers.js +6 -5
- package/dist/transformer.cjs +9 -8
- package/dist/transformer.js +8 -7
- package/dist/{types-hsoKrVQS.d.ts → types-CqZD77rS.d.ts} +39 -0
- package/dist/{types-H3wGZSOo.d.cts → types-gjJ5lJ5n.d.cts} +39 -0
- package/dist/usage/pricing-engine.cjs +2 -2
- package/dist/usage/pricing-engine.d.cts +20 -0
- package/dist/usage/pricing-engine.d.ts +20 -0
- package/dist/usage/pricing-engine.js +1 -1
- package/dist/usage/usage-recorder.cjs +2 -2
- package/dist/usage/usage-recorder.d.cts +5 -1
- package/dist/usage/usage-recorder.d.ts +5 -1
- package/dist/usage/usage-recorder.js +1 -1
- package/dist/usage.cjs +3 -3
- package/dist/usage.js +2 -2
- package/package.json +1 -1
|
@@ -14,22 +14,36 @@
|
|
|
14
14
|
* (a `text/event-stream` included — `clone().text()` tees the stream so the
|
|
15
15
|
* relay keeps streaming the original while the clone is buffered for the
|
|
16
16
|
* trace), and appends one {@link UpstreamTraceRecord} JSON line. Relay calls
|
|
17
|
-
* carry an opaque `providerId`;
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* carry an opaque `providerId`; webhook / billing sends do not, so they are
|
|
18
|
+
* skipped (less noise). OAuth token-endpoint calls (interactive login + refresh)
|
|
19
|
+
* DO carry one — a failed login must be diagnosable — but they set the ctx's
|
|
20
|
+
* `redactBodies`, so their bodies are replaced with {@link REDACTED_BODY}.
|
|
21
|
+
* Tracing is fire-and-forget: a read/write failure is swallowed so the egress
|
|
22
|
+
* path is never affected.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
* A diagnostic caller may explicitly install a path via
|
|
25
|
+
* {@link setUpstreamTracePath}. The daemon's audit runtime intentionally does
|
|
26
|
+
* not install one: audit bodies have a single persistence path. Absent an
|
|
27
|
+
* explicit path the trace is a pure no-op — byte-identical zero regression.
|
|
24
28
|
*
|
|
25
29
|
* Secret discipline: request/response AUTHORIZATION + api-key HEADER values are
|
|
26
30
|
* masked (`***REDACTED***`) — they are OAuth bearer tokens, not the thing under
|
|
27
31
|
* test, and a plaintext trace file must not hold them. Header KEYS stay visible
|
|
28
32
|
* so presence is verifiable. The request/response BODIES are captured VERBATIM
|
|
29
|
-
* (a prompt / a codex SSE stream) — that is the whole point
|
|
33
|
+
* (a prompt / a codex SSE stream) — that is the whole point — EXCEPT on a
|
|
34
|
+
* credential exchange, where the body IS the secret (see {@link REDACTED_BODY}).
|
|
30
35
|
*
|
|
31
36
|
* @module @omnicross/core/pipeline/upstreamTrace
|
|
32
37
|
*/
|
|
38
|
+
/**
|
|
39
|
+
* Placeholder written in place of a request/response body whose content is a
|
|
40
|
+
* CREDENTIAL rather than the thing under test — an OAuth token exchange or
|
|
41
|
+
* refresh (`fetchUpstream` ctx `redactBodies`). Those calls are still traced so a
|
|
42
|
+
* failed login/refresh is diagnosable (url, status, duration, byte count), but a
|
|
43
|
+
* plaintext authorization code / access token / refresh token must never land in
|
|
44
|
+
* this file.
|
|
45
|
+
*/
|
|
46
|
+
declare const REDACTED_BODY = "***REDACTED (credential exchange)***";
|
|
33
47
|
/**
|
|
34
48
|
* Install (or clear, with `null`/blank) the trace file path. Idempotent — last
|
|
35
49
|
* write wins. The path is resolved by the daemon relative to the audit store.
|
|
@@ -82,4 +96,4 @@ declare function writeUpstreamTrace(record: UpstreamTraceRecord): Promise<void>;
|
|
|
82
96
|
/** TEST SEAM — clear the trace path so a suite starts from the no-trace baseline. */
|
|
83
97
|
declare function __resetUpstreamTraceForTests(): void;
|
|
84
98
|
|
|
85
|
-
export { type UpstreamTraceRecord, __resetUpstreamTraceForTests, getUpstreamTracePath, redactHeaders, setUpstreamTracePath, writeUpstreamTrace };
|
|
99
|
+
export { REDACTED_BODY, type UpstreamTraceRecord, __resetUpstreamTraceForTests, getUpstreamTracePath, redactHeaders, setUpstreamTracePath, writeUpstreamTrace };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
REDACTED_BODY,
|
|
2
3
|
__resetUpstreamTraceForTests,
|
|
3
4
|
getUpstreamTracePath,
|
|
4
5
|
redactHeaders,
|
|
5
6
|
setUpstreamTracePath,
|
|
6
7
|
writeUpstreamTrace
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-3WD4HTR2.js";
|
|
8
9
|
export {
|
|
10
|
+
REDACTED_BODY,
|
|
9
11
|
__resetUpstreamTraceForTests,
|
|
10
12
|
getUpstreamTracePath,
|
|
11
13
|
redactHeaders,
|
package/dist/ports.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { ProviderConfigSource } from './ports/provider-config-source.cjs';
|
|
|
5
5
|
export { UsageEventStore } from './ports/usage-event-store.cjs';
|
|
6
6
|
export { WebSearchBackend } from './ports/web-search-backend.cjs';
|
|
7
7
|
export { UsageRecorderImport as UsageSink } from './provider-proxy/types.cjs';
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-gjJ5lJ5n.cjs';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.cjs';
|
package/dist/ports.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { ProviderConfigSource } from './ports/provider-config-source.js';
|
|
|
5
5
|
export { UsageEventStore } from './ports/usage-event-store.js';
|
|
6
6
|
export { WebSearchBackend } from './ports/web-search-backend.js';
|
|
7
7
|
export { UsageRecorderImport as UsageSink } from './provider-proxy/types.js';
|
|
8
|
-
export { O as OutboundCredentialStore } from './types-
|
|
8
|
+
export { O as OutboundCredentialStore } from './types-CqZD77rS.js';
|
|
9
9
|
import '@omnicross/contracts/pricing-types';
|
|
10
10
|
import '@omnicross/contracts/llm-config';
|
|
11
11
|
import './transformer/types.js';
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-EJLH6NFT.cjs');
|
|
4
|
+
var _chunk4BB343BIcjs = require('../chunk-4BB343BI.cjs');
|
|
6
5
|
require('../chunk-HQP3K7PU.cjs');
|
|
7
6
|
require('../chunk-FZ46M34D.cjs');
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-3OPYJG76.cjs');
|
|
11
|
-
require('../chunk-7AK7B36B.cjs');
|
|
7
|
+
require('../chunk-2Z4XM3H5.cjs');
|
|
8
|
+
require('../chunk-OXHNSZ53.cjs');
|
|
12
9
|
require('../chunk-V4TXMEJS.cjs');
|
|
13
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-OVQBNVSV.cjs');
|
|
11
|
+
require('../chunk-5RSZYQJH.cjs');
|
|
14
12
|
require('../chunk-OF3BECU2.cjs');
|
|
15
|
-
require('../chunk-4VLRHHFE.cjs');
|
|
16
13
|
require('../chunk-EYZYXJTJ.cjs');
|
|
17
|
-
require('../chunk-
|
|
18
|
-
require('../chunk-
|
|
19
|
-
require('../chunk-
|
|
14
|
+
require('../chunk-2E42SAW3.cjs');
|
|
15
|
+
require('../chunk-OJGQKHN5.cjs');
|
|
16
|
+
require('../chunk-IIRPUVPH.cjs');
|
|
17
|
+
require('../chunk-GBHYAGX3.cjs');
|
|
18
|
+
require('../chunk-3OPYJG76.cjs');
|
|
19
|
+
require('../chunk-3SCOLIPT.cjs');
|
|
20
20
|
require('../chunk-RPII3E6Z.cjs');
|
|
21
21
|
require('../chunk-6RPZADX3.cjs');
|
|
22
|
+
require('../chunk-J3QQ6JS5.cjs');
|
|
23
|
+
require('../chunk-UIBD2YY5.cjs');
|
|
24
|
+
require('../chunk-R3HK6R4B.cjs');
|
|
25
|
+
require('../chunk-QXD4MV2X.cjs');
|
|
22
26
|
require('../chunk-NYUNU75A.cjs');
|
|
23
|
-
require('../chunk-
|
|
27
|
+
require('../chunk-OTZC4TNH.cjs');
|
|
28
|
+
require('../chunk-YWL7YZWS.cjs');
|
|
24
29
|
require('../chunk-YNJNTCSQ.cjs');
|
|
25
30
|
require('../chunk-SVNDB62D.cjs');
|
|
26
|
-
require('../chunk-UIBD2YY5.cjs');
|
|
27
31
|
require('../chunk-6QQG7YG3.cjs');
|
|
28
32
|
require('../chunk-25GXJCEZ.cjs');
|
|
29
33
|
require('../chunk-MUHWHQVM.cjs');
|
|
30
34
|
require('../chunk-Q27JY5RG.cjs');
|
|
31
|
-
require('../chunk-QXD4MV2X.cjs');
|
|
32
35
|
require('../chunk-APYG5QD7.cjs');
|
|
33
36
|
require('../chunk-L74VDN4A.cjs');
|
|
34
37
|
require('../chunk-4YINUUKQ.cjs');
|
|
@@ -36,16 +39,17 @@ require('../chunk-4VZX5F4T.cjs');
|
|
|
36
39
|
require('../chunk-QBZJ7P2T.cjs');
|
|
37
40
|
require('../chunk-4IH4EL7M.cjs');
|
|
38
41
|
require('../chunk-A2YMUCBT.cjs');
|
|
39
|
-
require('../chunk-
|
|
42
|
+
require('../chunk-XPIOJQS2.cjs');
|
|
40
43
|
require('../chunk-FCR77GYM.cjs');
|
|
41
44
|
require('../chunk-AEOZIDEB.cjs');
|
|
42
45
|
require('../chunk-XSVNC2UD.cjs');
|
|
43
|
-
require('../chunk-
|
|
46
|
+
require('../chunk-GDIXXKF2.cjs');
|
|
44
47
|
require('../chunk-OKMJLEXX.cjs');
|
|
45
48
|
require('../chunk-KBM2W6UY.cjs');
|
|
46
|
-
require('../chunk-
|
|
47
|
-
require('../chunk-
|
|
49
|
+
require('../chunk-RJUONLUQ.cjs');
|
|
50
|
+
require('../chunk-235MXAGX.cjs');
|
|
48
51
|
require('../chunk-HVBBDBS3.cjs');
|
|
52
|
+
require('../chunk-NKVZ6Z3Y.cjs');
|
|
49
53
|
require('../chunk-NZYN7C3P.cjs');
|
|
50
54
|
require('../chunk-JMJBSACD.cjs');
|
|
51
55
|
require('../chunk-GMMT7RVN.cjs');
|
|
@@ -53,4 +57,4 @@ require('../chunk-UNEFIWXI.cjs');
|
|
|
53
57
|
|
|
54
58
|
|
|
55
59
|
|
|
56
|
-
exports.ProviderProxy =
|
|
60
|
+
exports.ProviderProxy = _chunk4BB343BIcjs.ProviderProxy; exports.isLoopbackAddress = _chunk4BB343BIcjs.isLoopbackAddress;
|
|
@@ -2,6 +2,7 @@ export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-CnM
|
|
|
2
2
|
import './types.cjs';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import '@omnicross/contracts/completion-types';
|
|
5
|
+
import '@omnicross/contracts/usage-stats-types';
|
|
5
6
|
import '@omnicross/contracts/subscription-types';
|
|
6
7
|
import '@omnicross/contracts/usage-types';
|
|
7
8
|
import '../completion/ApiKeyPoolService.cjs';
|
|
@@ -2,6 +2,7 @@ export { P as ProviderProxy, i as isLoopbackAddress } from '../ProviderProxy-C-x
|
|
|
2
2
|
import './types.js';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
import '@omnicross/contracts/completion-types';
|
|
5
|
+
import '@omnicross/contracts/usage-stats-types';
|
|
5
6
|
import '@omnicross/contracts/subscription-types';
|
|
6
7
|
import '@omnicross/contracts/usage-types';
|
|
7
8
|
import '../completion/ApiKeyPoolService.js';
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ProviderProxy,
|
|
3
3
|
isLoopbackAddress
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-WB6PH56J.js";
|
|
4
|
+
} from "../chunk-E3COOKUP.js";
|
|
6
5
|
import "../chunk-VVEHS2LI.js";
|
|
7
6
|
import "../chunk-46RLHI7D.js";
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-DK4A7DLE.js";
|
|
11
|
-
import "../chunk-VRFBB5DB.js";
|
|
7
|
+
import "../chunk-MYYR3HZL.js";
|
|
8
|
+
import "../chunk-PEGTIPB3.js";
|
|
12
9
|
import "../chunk-LVUCAWMK.js";
|
|
13
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-32O35CIF.js";
|
|
11
|
+
import "../chunk-FU7EAR73.js";
|
|
14
12
|
import "../chunk-LB6EBS6Y.js";
|
|
15
|
-
import "../chunk-6CL5HTPQ.js";
|
|
16
13
|
import "../chunk-7VU7V2E4.js";
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-FXR6N3SR.js";
|
|
15
|
+
import "../chunk-SOO562NM.js";
|
|
16
|
+
import "../chunk-WNKWAEUR.js";
|
|
17
|
+
import "../chunk-MZNPGW5Q.js";
|
|
18
|
+
import "../chunk-DK4A7DLE.js";
|
|
19
|
+
import "../chunk-XXFYLL7R.js";
|
|
20
20
|
import "../chunk-XTEI64OU.js";
|
|
21
21
|
import "../chunk-XX6NQJMA.js";
|
|
22
|
+
import "../chunk-GFIZ6LQI.js";
|
|
23
|
+
import "../chunk-OE6TDIWW.js";
|
|
24
|
+
import "../chunk-DRWHTIIZ.js";
|
|
25
|
+
import "../chunk-JWC6APFQ.js";
|
|
22
26
|
import "../chunk-5ERIZW3D.js";
|
|
23
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-PO3XB56Z.js";
|
|
28
|
+
import "../chunk-N7OOJI5V.js";
|
|
24
29
|
import "../chunk-23S5OPIO.js";
|
|
25
30
|
import "../chunk-AVYJ4YBN.js";
|
|
26
|
-
import "../chunk-OE6TDIWW.js";
|
|
27
31
|
import "../chunk-OPRS4IQZ.js";
|
|
28
32
|
import "../chunk-2JYRIADS.js";
|
|
29
33
|
import "../chunk-DE2SRBFZ.js";
|
|
30
34
|
import "../chunk-ZY6KU6P3.js";
|
|
31
|
-
import "../chunk-JWC6APFQ.js";
|
|
32
35
|
import "../chunk-WLYIIEAF.js";
|
|
33
36
|
import "../chunk-TKJMZBAH.js";
|
|
34
37
|
import "../chunk-3QFXFCHG.js";
|
|
@@ -36,16 +39,17 @@ import "../chunk-EBLFCNPY.js";
|
|
|
36
39
|
import "../chunk-AQ5TNQB7.js";
|
|
37
40
|
import "../chunk-XEKD23J5.js";
|
|
38
41
|
import "../chunk-H5JUT3KV.js";
|
|
39
|
-
import "../chunk-
|
|
42
|
+
import "../chunk-7C7DET6S.js";
|
|
40
43
|
import "../chunk-K5NM7VAH.js";
|
|
41
44
|
import "../chunk-WNY4WMRF.js";
|
|
42
45
|
import "../chunk-OZFM4X3S.js";
|
|
43
|
-
import "../chunk-
|
|
46
|
+
import "../chunk-5NJLQ6T6.js";
|
|
44
47
|
import "../chunk-N5T4M4GU.js";
|
|
45
48
|
import "../chunk-TOVPMMHM.js";
|
|
46
|
-
import "../chunk-
|
|
47
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-RJ5ZGNI3.js";
|
|
50
|
+
import "../chunk-3WD4HTR2.js";
|
|
48
51
|
import "../chunk-MKF46GNZ.js";
|
|
52
|
+
import "../chunk-GL6XM527.js";
|
|
49
53
|
import "../chunk-CDHS2QDC.js";
|
|
50
54
|
import "../chunk-Y7FO65VT.js";
|
|
51
55
|
import "../chunk-FMOBD2OQ.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunk3SCOLIPTcjs = require('../../chunk-3SCOLIPT.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DEFAULT_CODEX_CLI_HEADERS = _chunk3SCOLIPTcjs.DEFAULT_CODEX_CLI_HEADERS; exports.codexAcceptHeader = _chunk3SCOLIPTcjs.codexAcceptHeader; exports.extractCodexClientHeaders = _chunk3SCOLIPTcjs.extractCodexClientHeaders;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* codexCliHeaders — the Codex CLI client headers the CODEX SUBSCRIPTION relay
|
|
3
|
+
* puts on every `chatgpt.com/backend-api/codex/responses` request.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS: like the claude relay, this path sent exactly `content-type`
|
|
6
|
+
* + `Authorization` (verified against a live `upstream-trace.jsonl`). Unlike the
|
|
7
|
+
* claude one it still got a 200 — ChatGPT's Codex backend does not currently
|
|
8
|
+
* reject a bare request — but the relayed call carried NONE of the markers a
|
|
9
|
+
* real `codex` CLI sends (`originator`, its UA, `version`, `openai-beta`,
|
|
10
|
+
* `session_id`), which is exactly the shape risk-control looks at.
|
|
11
|
+
*
|
|
12
|
+
* SCOPE: applied ONLY to the codex SUBSCRIPTION plan (`proxyProviderId ===
|
|
13
|
+
* 'codex'`, i.e. an OAuth ChatGPT account). A BYO OpenAI-compatible endpoint
|
|
14
|
+
* shares this relay and must stay byte-identical — sending it `originator:
|
|
15
|
+
* codex_cli_rs` would be wrong and could trip its own checks.
|
|
16
|
+
*
|
|
17
|
+
* Modeled on claude-relay-service (`routes/openaiRoutes.js`, the codex branch).
|
|
18
|
+
*
|
|
19
|
+
* NOT DONE HERE (deliberate, see the relay call site):
|
|
20
|
+
* - `chatgpt-account-id`: CRS sends the ChatGPT account id parsed out of the
|
|
21
|
+
* OAuth `id_token`. Guessing it wrong risks a 403 on a path that currently
|
|
22
|
+
* works, so it is left to a follow-up that can verify the value.
|
|
23
|
+
* - forcing `store: false` on the body: a body mutation with its own regression
|
|
24
|
+
* surface, tracked separately.
|
|
25
|
+
*
|
|
26
|
+
* @module provider-proxy/identity/codexCliHeaders
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Client markers a real `codex` CLI invocation carries. Used ONLY to fill a slot
|
|
30
|
+
* the caller left empty — a forwarded real value always wins, so a genuine Codex
|
|
31
|
+
* CLI keeps its own identity and only a caller that sent nothing gets these.
|
|
32
|
+
*
|
|
33
|
+
* `originator` is the load-bearing one: it is how the backend tells the Codex
|
|
34
|
+
* CLI apart from a generic Responses client, and CRS sends it unconditionally.
|
|
35
|
+
*/
|
|
36
|
+
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
37
|
+
/**
|
|
38
|
+
* Extract the caller's forwardable Codex CLI headers (lowercased keys). Ungated:
|
|
39
|
+
* passing along what the client actually sent is not fingerprint synthesis.
|
|
40
|
+
*/
|
|
41
|
+
declare function extractCodexClientHeaders(reqHeaders: Record<string, string | string[] | undefined>): Record<string, string>;
|
|
42
|
+
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
43
|
+
declare function codexAcceptHeader(isStream: boolean): string;
|
|
44
|
+
|
|
45
|
+
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* codexCliHeaders — the Codex CLI client headers the CODEX SUBSCRIPTION relay
|
|
3
|
+
* puts on every `chatgpt.com/backend-api/codex/responses` request.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS: like the claude relay, this path sent exactly `content-type`
|
|
6
|
+
* + `Authorization` (verified against a live `upstream-trace.jsonl`). Unlike the
|
|
7
|
+
* claude one it still got a 200 — ChatGPT's Codex backend does not currently
|
|
8
|
+
* reject a bare request — but the relayed call carried NONE of the markers a
|
|
9
|
+
* real `codex` CLI sends (`originator`, its UA, `version`, `openai-beta`,
|
|
10
|
+
* `session_id`), which is exactly the shape risk-control looks at.
|
|
11
|
+
*
|
|
12
|
+
* SCOPE: applied ONLY to the codex SUBSCRIPTION plan (`proxyProviderId ===
|
|
13
|
+
* 'codex'`, i.e. an OAuth ChatGPT account). A BYO OpenAI-compatible endpoint
|
|
14
|
+
* shares this relay and must stay byte-identical — sending it `originator:
|
|
15
|
+
* codex_cli_rs` would be wrong and could trip its own checks.
|
|
16
|
+
*
|
|
17
|
+
* Modeled on claude-relay-service (`routes/openaiRoutes.js`, the codex branch).
|
|
18
|
+
*
|
|
19
|
+
* NOT DONE HERE (deliberate, see the relay call site):
|
|
20
|
+
* - `chatgpt-account-id`: CRS sends the ChatGPT account id parsed out of the
|
|
21
|
+
* OAuth `id_token`. Guessing it wrong risks a 403 on a path that currently
|
|
22
|
+
* works, so it is left to a follow-up that can verify the value.
|
|
23
|
+
* - forcing `store: false` on the body: a body mutation with its own regression
|
|
24
|
+
* surface, tracked separately.
|
|
25
|
+
*
|
|
26
|
+
* @module provider-proxy/identity/codexCliHeaders
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Client markers a real `codex` CLI invocation carries. Used ONLY to fill a slot
|
|
30
|
+
* the caller left empty — a forwarded real value always wins, so a genuine Codex
|
|
31
|
+
* CLI keeps its own identity and only a caller that sent nothing gets these.
|
|
32
|
+
*
|
|
33
|
+
* `originator` is the load-bearing one: it is how the backend tells the Codex
|
|
34
|
+
* CLI apart from a generic Responses client, and CRS sends it unconditionally.
|
|
35
|
+
*/
|
|
36
|
+
declare const DEFAULT_CODEX_CLI_HEADERS: Readonly<Record<string, string>>;
|
|
37
|
+
/**
|
|
38
|
+
* Extract the caller's forwardable Codex CLI headers (lowercased keys). Ungated:
|
|
39
|
+
* passing along what the client actually sent is not fingerprint synthesis.
|
|
40
|
+
*/
|
|
41
|
+
declare function extractCodexClientHeaders(reqHeaders: Record<string, string | string[] | undefined>): Record<string, string>;
|
|
42
|
+
/** The `accept` a Codex CLI sends, which differs by streaming mode. */
|
|
43
|
+
declare function codexAcceptHeader(isStream: boolean): string;
|
|
44
|
+
|
|
45
|
+
export { DEFAULT_CODEX_CLI_HEADERS, codexAcceptHeader, extractCodexClientHeaders };
|
|
@@ -9,34 +9,37 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('../../chunk-EJLH6NFT.cjs');
|
|
12
|
+
var _chunk4BB343BIcjs = require('../../chunk-4BB343BI.cjs');
|
|
14
13
|
require('../../chunk-HQP3K7PU.cjs');
|
|
15
14
|
require('../../chunk-FZ46M34D.cjs');
|
|
16
|
-
require('../../chunk-
|
|
17
|
-
require('../../chunk-
|
|
18
|
-
require('../../chunk-3OPYJG76.cjs');
|
|
19
|
-
require('../../chunk-7AK7B36B.cjs');
|
|
15
|
+
require('../../chunk-2Z4XM3H5.cjs');
|
|
16
|
+
require('../../chunk-OXHNSZ53.cjs');
|
|
20
17
|
require('../../chunk-V4TXMEJS.cjs');
|
|
21
|
-
require('../../chunk-
|
|
18
|
+
require('../../chunk-OVQBNVSV.cjs');
|
|
19
|
+
require('../../chunk-5RSZYQJH.cjs');
|
|
22
20
|
require('../../chunk-OF3BECU2.cjs');
|
|
23
|
-
require('../../chunk-4VLRHHFE.cjs');
|
|
24
21
|
require('../../chunk-EYZYXJTJ.cjs');
|
|
25
|
-
require('../../chunk-
|
|
26
|
-
require('../../chunk-
|
|
27
|
-
require('../../chunk-
|
|
22
|
+
require('../../chunk-2E42SAW3.cjs');
|
|
23
|
+
require('../../chunk-OJGQKHN5.cjs');
|
|
24
|
+
require('../../chunk-IIRPUVPH.cjs');
|
|
25
|
+
require('../../chunk-GBHYAGX3.cjs');
|
|
26
|
+
require('../../chunk-3OPYJG76.cjs');
|
|
27
|
+
require('../../chunk-3SCOLIPT.cjs');
|
|
28
28
|
require('../../chunk-RPII3E6Z.cjs');
|
|
29
29
|
require('../../chunk-6RPZADX3.cjs');
|
|
30
|
+
require('../../chunk-J3QQ6JS5.cjs');
|
|
31
|
+
require('../../chunk-UIBD2YY5.cjs');
|
|
32
|
+
require('../../chunk-R3HK6R4B.cjs');
|
|
33
|
+
require('../../chunk-QXD4MV2X.cjs');
|
|
30
34
|
require('../../chunk-NYUNU75A.cjs');
|
|
31
|
-
require('../../chunk-
|
|
35
|
+
require('../../chunk-OTZC4TNH.cjs');
|
|
36
|
+
require('../../chunk-YWL7YZWS.cjs');
|
|
32
37
|
require('../../chunk-YNJNTCSQ.cjs');
|
|
33
38
|
require('../../chunk-SVNDB62D.cjs');
|
|
34
|
-
require('../../chunk-UIBD2YY5.cjs');
|
|
35
39
|
require('../../chunk-6QQG7YG3.cjs');
|
|
36
40
|
require('../../chunk-25GXJCEZ.cjs');
|
|
37
41
|
require('../../chunk-MUHWHQVM.cjs');
|
|
38
42
|
require('../../chunk-Q27JY5RG.cjs');
|
|
39
|
-
require('../../chunk-QXD4MV2X.cjs');
|
|
40
43
|
require('../../chunk-APYG5QD7.cjs');
|
|
41
44
|
require('../../chunk-L74VDN4A.cjs');
|
|
42
45
|
require('../../chunk-4YINUUKQ.cjs');
|
|
@@ -44,16 +47,17 @@ require('../../chunk-4VZX5F4T.cjs');
|
|
|
44
47
|
require('../../chunk-QBZJ7P2T.cjs');
|
|
45
48
|
require('../../chunk-4IH4EL7M.cjs');
|
|
46
49
|
require('../../chunk-A2YMUCBT.cjs');
|
|
47
|
-
require('../../chunk-
|
|
50
|
+
require('../../chunk-XPIOJQS2.cjs');
|
|
48
51
|
require('../../chunk-FCR77GYM.cjs');
|
|
49
52
|
require('../../chunk-AEOZIDEB.cjs');
|
|
50
53
|
require('../../chunk-XSVNC2UD.cjs');
|
|
51
|
-
require('../../chunk-
|
|
54
|
+
require('../../chunk-GDIXXKF2.cjs');
|
|
52
55
|
require('../../chunk-OKMJLEXX.cjs');
|
|
53
56
|
require('../../chunk-KBM2W6UY.cjs');
|
|
54
|
-
require('../../chunk-
|
|
55
|
-
require('../../chunk-
|
|
57
|
+
require('../../chunk-RJUONLUQ.cjs');
|
|
58
|
+
require('../../chunk-235MXAGX.cjs');
|
|
56
59
|
require('../../chunk-HVBBDBS3.cjs');
|
|
60
|
+
require('../../chunk-NKVZ6Z3Y.cjs');
|
|
57
61
|
require('../../chunk-NZYN7C3P.cjs');
|
|
58
62
|
require('../../chunk-JMJBSACD.cjs');
|
|
59
63
|
require('../../chunk-GMMT7RVN.cjs');
|
|
@@ -69,4 +73,4 @@ require('../../chunk-UNEFIWXI.cjs');
|
|
|
69
73
|
|
|
70
74
|
|
|
71
75
|
|
|
72
|
-
exports.aggregateAnthropicSseToJsonBody =
|
|
76
|
+
exports.aggregateAnthropicSseToJsonBody = _chunk4BB343BIcjs.aggregateAnthropicSseToJsonBody; exports.getAnthropicEndpointTransformer = _chunk4BB343BIcjs.getAnthropicEndpointTransformer; exports.getGeminiEndpointTransformer = _chunk4BB343BIcjs.getGeminiEndpointTransformer; exports.getResponsesEndpointTransformer = _chunk4BB343BIcjs.getResponsesEndpointTransformer; exports.getSharedExecutor = _chunk4BB343BIcjs.getSharedExecutor; exports.readBody = _chunk4BB343BIcjs.readBody; exports.relayResponse = _chunk4BB343BIcjs.relayResponse; exports.resolvePoolBoundKey = _chunk4BB343BIcjs.resolvePoolBoundKey; exports.writeBoundAccountError = _chunk4BB343BIcjs.writeBoundAccountError; exports.writeError = _chunk4BB343BIcjs.writeError;
|
|
@@ -5,6 +5,7 @@ import { TransformerChainExecutor } from '../../transformer/TransformerChainExec
|
|
|
5
5
|
import { Transformer } from '../../transformer/types.cjs';
|
|
6
6
|
import { ProviderProxyDeps } from '../types.cjs';
|
|
7
7
|
import '@omnicross/contracts/completion-types';
|
|
8
|
+
import '@omnicross/contracts/usage-stats-types';
|
|
8
9
|
import '@omnicross/contracts/subscription-types';
|
|
9
10
|
import '@omnicross/contracts/usage-types';
|
|
10
11
|
import '../../completion/ApiKeyPoolService.cjs';
|
|
@@ -77,7 +78,16 @@ interface StreamUsageTap {
|
|
|
77
78
|
*
|
|
78
79
|
* @returns the (upstream) JSON body text for non-stream responses, else `null`.
|
|
79
80
|
*/
|
|
80
|
-
declare function relayResponse(res: http.ServerResponse, providerResponse: Response, isStream: boolean, rewriteModel?: string, usageTap?: StreamUsageTap
|
|
81
|
+
declare function relayResponse(res: http.ServerResponse, providerResponse: Response, isStream: boolean, rewriteModel?: string, usageTap?: StreamUsageTap,
|
|
82
|
+
/**
|
|
83
|
+
* Read-only observer invoked with every parsed SSE `data:` event during a
|
|
84
|
+
* streaming relay. Never affects the relayed bytes (it runs on the ORIGINAL
|
|
85
|
+
* line, independent of the model-rewrite / usage-tap paths). Used to detect
|
|
86
|
+
* in-band errors that arrive AFTER a `200` — e.g. a Codex `response.failed`
|
|
87
|
+
* server-overload event. When present, forces the line-based relay path so
|
|
88
|
+
* events are parsed even without a `rewriteModel`/`usageTap`.
|
|
89
|
+
*/
|
|
90
|
+
onSseEvent?: (event: Record<string, unknown>) => void): Promise<string | null>;
|
|
81
91
|
/**
|
|
82
92
|
* Aggregate a streaming Anthropic `text/event-stream` body into ONE buffered
|
|
83
93
|
* Anthropic `message` JSON object — the inverse of the SDK's SSE wire format.
|
|
@@ -5,6 +5,7 @@ import { TransformerChainExecutor } from '../../transformer/TransformerChainExec
|
|
|
5
5
|
import { Transformer } from '../../transformer/types.js';
|
|
6
6
|
import { ProviderProxyDeps } from '../types.js';
|
|
7
7
|
import '@omnicross/contracts/completion-types';
|
|
8
|
+
import '@omnicross/contracts/usage-stats-types';
|
|
8
9
|
import '@omnicross/contracts/subscription-types';
|
|
9
10
|
import '@omnicross/contracts/usage-types';
|
|
10
11
|
import '../../completion/ApiKeyPoolService.js';
|
|
@@ -77,7 +78,16 @@ interface StreamUsageTap {
|
|
|
77
78
|
*
|
|
78
79
|
* @returns the (upstream) JSON body text for non-stream responses, else `null`.
|
|
79
80
|
*/
|
|
80
|
-
declare function relayResponse(res: http.ServerResponse, providerResponse: Response, isStream: boolean, rewriteModel?: string, usageTap?: StreamUsageTap
|
|
81
|
+
declare function relayResponse(res: http.ServerResponse, providerResponse: Response, isStream: boolean, rewriteModel?: string, usageTap?: StreamUsageTap,
|
|
82
|
+
/**
|
|
83
|
+
* Read-only observer invoked with every parsed SSE `data:` event during a
|
|
84
|
+
* streaming relay. Never affects the relayed bytes (it runs on the ORIGINAL
|
|
85
|
+
* line, independent of the model-rewrite / usage-tap paths). Used to detect
|
|
86
|
+
* in-band errors that arrive AFTER a `200` — e.g. a Codex `response.failed`
|
|
87
|
+
* server-overload event. When present, forces the line-based relay path so
|
|
88
|
+
* events are parsed even without a `rewriteModel`/`usageTap`.
|
|
89
|
+
*/
|
|
90
|
+
onSseEvent?: (event: Record<string, unknown>) => void): Promise<string | null>;
|
|
81
91
|
/**
|
|
82
92
|
* Aggregate a streaming Anthropic `text/event-stream` body into ONE buffered
|
|
83
93
|
* Anthropic `message` JSON object — the inverse of the SDK's SSE wire format.
|
|
@@ -9,34 +9,37 @@ import {
|
|
|
9
9
|
resolvePoolBoundKey,
|
|
10
10
|
writeBoundAccountError,
|
|
11
11
|
writeError
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-WB6PH56J.js";
|
|
12
|
+
} from "../../chunk-E3COOKUP.js";
|
|
14
13
|
import "../../chunk-VVEHS2LI.js";
|
|
15
14
|
import "../../chunk-46RLHI7D.js";
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
18
|
-
import "../../chunk-DK4A7DLE.js";
|
|
19
|
-
import "../../chunk-VRFBB5DB.js";
|
|
15
|
+
import "../../chunk-MYYR3HZL.js";
|
|
16
|
+
import "../../chunk-PEGTIPB3.js";
|
|
20
17
|
import "../../chunk-LVUCAWMK.js";
|
|
21
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-32O35CIF.js";
|
|
19
|
+
import "../../chunk-FU7EAR73.js";
|
|
22
20
|
import "../../chunk-LB6EBS6Y.js";
|
|
23
|
-
import "../../chunk-6CL5HTPQ.js";
|
|
24
21
|
import "../../chunk-7VU7V2E4.js";
|
|
25
|
-
import "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
27
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-FXR6N3SR.js";
|
|
23
|
+
import "../../chunk-SOO562NM.js";
|
|
24
|
+
import "../../chunk-WNKWAEUR.js";
|
|
25
|
+
import "../../chunk-MZNPGW5Q.js";
|
|
26
|
+
import "../../chunk-DK4A7DLE.js";
|
|
27
|
+
import "../../chunk-XXFYLL7R.js";
|
|
28
28
|
import "../../chunk-XTEI64OU.js";
|
|
29
29
|
import "../../chunk-XX6NQJMA.js";
|
|
30
|
+
import "../../chunk-GFIZ6LQI.js";
|
|
31
|
+
import "../../chunk-OE6TDIWW.js";
|
|
32
|
+
import "../../chunk-DRWHTIIZ.js";
|
|
33
|
+
import "../../chunk-JWC6APFQ.js";
|
|
30
34
|
import "../../chunk-5ERIZW3D.js";
|
|
31
|
-
import "../../chunk-
|
|
35
|
+
import "../../chunk-PO3XB56Z.js";
|
|
36
|
+
import "../../chunk-N7OOJI5V.js";
|
|
32
37
|
import "../../chunk-23S5OPIO.js";
|
|
33
38
|
import "../../chunk-AVYJ4YBN.js";
|
|
34
|
-
import "../../chunk-OE6TDIWW.js";
|
|
35
39
|
import "../../chunk-OPRS4IQZ.js";
|
|
36
40
|
import "../../chunk-2JYRIADS.js";
|
|
37
41
|
import "../../chunk-DE2SRBFZ.js";
|
|
38
42
|
import "../../chunk-ZY6KU6P3.js";
|
|
39
|
-
import "../../chunk-JWC6APFQ.js";
|
|
40
43
|
import "../../chunk-WLYIIEAF.js";
|
|
41
44
|
import "../../chunk-TKJMZBAH.js";
|
|
42
45
|
import "../../chunk-3QFXFCHG.js";
|
|
@@ -44,16 +47,17 @@ import "../../chunk-EBLFCNPY.js";
|
|
|
44
47
|
import "../../chunk-AQ5TNQB7.js";
|
|
45
48
|
import "../../chunk-XEKD23J5.js";
|
|
46
49
|
import "../../chunk-H5JUT3KV.js";
|
|
47
|
-
import "../../chunk-
|
|
50
|
+
import "../../chunk-7C7DET6S.js";
|
|
48
51
|
import "../../chunk-K5NM7VAH.js";
|
|
49
52
|
import "../../chunk-WNY4WMRF.js";
|
|
50
53
|
import "../../chunk-OZFM4X3S.js";
|
|
51
|
-
import "../../chunk-
|
|
54
|
+
import "../../chunk-5NJLQ6T6.js";
|
|
52
55
|
import "../../chunk-N5T4M4GU.js";
|
|
53
56
|
import "../../chunk-TOVPMMHM.js";
|
|
54
|
-
import "../../chunk-
|
|
55
|
-
import "../../chunk-
|
|
57
|
+
import "../../chunk-RJ5ZGNI3.js";
|
|
58
|
+
import "../../chunk-3WD4HTR2.js";
|
|
56
59
|
import "../../chunk-MKF46GNZ.js";
|
|
60
|
+
import "../../chunk-GL6XM527.js";
|
|
57
61
|
import "../../chunk-CDHS2QDC.js";
|
|
58
62
|
import "../../chunk-Y7FO65VT.js";
|
|
59
63
|
import "../../chunk-FMOBD2OQ.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkJ3QQ6JS5cjs = require('../chunk-J3QQ6JS5.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -13,4 +13,4 @@ var _chunkEJLH6NFTcjs = require('../chunk-EJLH6NFT.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.MATCH_TEXT_PER_MESSAGE_CAP =
|
|
16
|
+
exports.MATCH_TEXT_PER_MESSAGE_CAP = _chunkJ3QQ6JS5cjs.MATCH_TEXT_PER_MESSAGE_CAP; exports.MATCH_TEXT_RECENT_MESSAGES = _chunkJ3QQ6JS5cjs.MATCH_TEXT_RECENT_MESSAGES; exports.collectMatchText = _chunkJ3QQ6JS5cjs.collectMatchText; exports.deriveGatewaySessionKey = _chunkJ3QQ6JS5cjs.deriveGatewaySessionKey; exports.deriveSubscriptionSessionKey = _chunkJ3QQ6JS5cjs.deriveSubscriptionSessionKey; exports.flattenMatchText = _chunkJ3QQ6JS5cjs.flattenMatchText;
|
|
@@ -55,8 +55,6 @@ declare function collectMatchText(anthropicBody: Record<string, unknown>): strin
|
|
|
55
55
|
* SAME key for the same body.
|
|
56
56
|
*/
|
|
57
57
|
declare function deriveSubscriptionSessionKey(anthropicBody: Record<string, unknown>): string | undefined;
|
|
58
|
-
/** 32-bit FNV-1a hex digest — a small, dependency-free stable string hash for the
|
|
59
|
-
* session-affinity bucket key (NOT a security primitive). */
|
|
60
58
|
/**
|
|
61
59
|
* Source used to derive a gateway session-affinity key. The value is kept
|
|
62
60
|
* deliberately small and non-sensitive: callers only receive the hashed key,
|
|
@@ -88,7 +86,7 @@ type SessionRequestHeaders = Record<string, string | string[] | undefined>;
|
|
|
88
86
|
* final fallback is route-scoped (api key/session + endpoint) so a request
|
|
89
87
|
* with no usable metadata remains conservative and does not rotate accounts
|
|
90
88
|
* on every turn. Raw ids and prompts are never returned or logged; only their
|
|
91
|
-
*
|
|
89
|
+
* truncated SHA-256 digest is exposed as `key`.
|
|
92
90
|
*/
|
|
93
91
|
declare function deriveGatewaySessionKey(body: Record<string, unknown>, headers?: SessionRequestHeaders, options?: GatewaySessionKeyOptions): DerivedSessionKey;
|
|
94
92
|
|
|
@@ -55,8 +55,6 @@ declare function collectMatchText(anthropicBody: Record<string, unknown>): strin
|
|
|
55
55
|
* SAME key for the same body.
|
|
56
56
|
*/
|
|
57
57
|
declare function deriveSubscriptionSessionKey(anthropicBody: Record<string, unknown>): string | undefined;
|
|
58
|
-
/** 32-bit FNV-1a hex digest — a small, dependency-free stable string hash for the
|
|
59
|
-
* session-affinity bucket key (NOT a security primitive). */
|
|
60
58
|
/**
|
|
61
59
|
* Source used to derive a gateway session-affinity key. The value is kept
|
|
62
60
|
* deliberately small and non-sensitive: callers only receive the hashed key,
|
|
@@ -88,7 +86,7 @@ type SessionRequestHeaders = Record<string, string | string[] | undefined>;
|
|
|
88
86
|
* final fallback is route-scoped (api key/session + endpoint) so a request
|
|
89
87
|
* with no usable metadata remains conservative and does not rotate accounts
|
|
90
88
|
* on every turn. Raw ids and prompts are never returned or logged; only their
|
|
91
|
-
*
|
|
89
|
+
* truncated SHA-256 digest is exposed as `key`.
|
|
92
90
|
*/
|
|
93
91
|
declare function deriveGatewaySessionKey(body: Record<string, unknown>, headers?: SessionRequestHeaders, options?: GatewaySessionKeyOptions): DerivedSessionKey;
|
|
94
92
|
|