@omnicross/core 0.1.10 → 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-QUSEZNYS.cjs → chunk-32SRZFFP.cjs} +4 -1
- package/dist/chunk-4JOU54M5.js +200 -0
- package/dist/{chunk-2UTGX6FM.js → chunk-4VVCXVB7.js} +1 -1
- package/dist/chunk-6DDYNS2B.cjs +384 -0
- package/dist/{chunk-HKB656B4.js → chunk-6OC3ORW6.js} +55 -287
- package/dist/{chunk-GXEZ2R3E.js → chunk-6OKXH2TW.js} +18 -7
- package/dist/{chunk-TIT74RIL.cjs → chunk-7B56AJBB.cjs} +6214 -2423
- 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-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-UWDW6PN3.cjs → chunk-FX325I5Q.cjs} +20 -9
- 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-6D4W22P4.js → chunk-QIIAMBTM.js} +4 -1
- 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-FEBAQI5A.js → chunk-WSJE42SG.js} +4964 -1173
- 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 +29 -26
- package/dist/completion/CompletionService.d.cts +3 -2
- package/dist/completion/CompletionService.d.ts +3 -2
- package/dist/completion/CompletionService.js +28 -25
- package/dist/completion.cjs +37 -34
- package/dist/completion.d.cts +3 -2
- package/dist/completion.d.ts +3 -2
- package/dist/completion.js +36 -33
- 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 +142 -47
- 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 +13 -2
- package/dist/outbound-api/auditCapture.d.ts +13 -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 +48 -31
- package/dist/outbound-api.d.cts +95 -9
- package/dist/outbound-api.d.ts +95 -9
- package/dist/outbound-api.js +47 -30
- 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 +29 -26
- package/dist/provider-proxy/ProviderProxy.d.cts +3 -2
- package/dist/provider-proxy/ProviderProxy.d.ts +3 -2
- package/dist/provider-proxy/ProviderProxy.js +28 -25
- 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 +31 -26
- 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 +30 -25
- package/dist/provider-proxy/types.d.cts +14 -483
- package/dist/provider-proxy/types.d.ts +14 -483
- package/dist/provider-proxy.cjs +43 -26
- package/dist/provider-proxy.d.cts +30 -8
- package/dist/provider-proxy.d.ts +30 -8
- package/dist/provider-proxy.js +42 -25
- 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.cjs +2 -2
- package/dist/usage.d.cts +6 -1
- package/dist/usage.d.ts +6 -1
- package/dist/usage.js +1 -1
- package/package.json +69 -64
- package/dist/chunk-FCR77GYM.cjs +0 -33
- package/dist/chunk-K5NM7VAH.js +0 -33
- /package/dist/{chunk-XXFYLL7R.js → chunk-ECZ3ZE2C.js} +0 -0
- /package/dist/{chunk-3SCOLIPT.cjs → chunk-MXI2PWIC.cjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
3
|
+
var _chunkQWNUOR7Fcjs = require('../../chunk-QWNUOR7F.cjs');
|
|
4
|
+
require('../../chunk-IUL4VWNU.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.OpenAITransformer =
|
|
7
|
+
exports.OpenAITransformer = _chunkQWNUOR7Fcjs.OpenAITransformer;
|
|
@@ -3,26 +3,27 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkTVYA5JSQcjs = require('../chunk-TVYA5JSQ.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkNOITAVHAcjs = require('../chunk-NOITAVHA.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkQWNUOR7Fcjs = require('../chunk-QWNUOR7F.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkSQMAEDNEcjs = require('../chunk-SQMAEDNE.cjs');
|
|
16
16
|
require('../chunk-5RSZYQJH.cjs');
|
|
17
|
+
require('../chunk-6DDYNS2B.cjs');
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
var
|
|
20
|
+
var _chunkKIQ2HA2Acjs = require('../chunk-KIQ2HA2A.cjs');
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
var
|
|
23
|
-
require('../chunk-
|
|
23
|
+
var _chunkVXRTQZF2cjs = require('../chunk-VXRTQZF2.cjs');
|
|
24
|
+
require('../chunk-WX2E2G7H.cjs');
|
|
24
25
|
require('../chunk-77USGNRW.cjs');
|
|
25
|
-
require('../chunk-
|
|
26
|
+
require('../chunk-IUL4VWNU.cjs');
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
|
|
@@ -33,4 +34,4 @@ require('../chunk-AOFWNWLT.cjs');
|
|
|
33
34
|
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
exports.AnthropicTransformer =
|
|
37
|
+
exports.AnthropicTransformer = _chunkSQMAEDNEcjs.AnthropicTransformer; exports.BUILTIN_TRANSFORMER_NAMES = _chunkTVYA5JSQcjs.BUILTIN_TRANSFORMER_NAMES; exports.BuiltinTransformers = _chunkTVYA5JSQcjs.BuiltinTransformers; exports.GeminiCodeAssistTransformer = _chunkVXRTQZF2cjs.GeminiCodeAssistTransformer; exports.GeminiTransformer = _chunkKIQ2HA2Acjs.GeminiTransformer; exports.OpenAIResponseTransformer = _chunkNOITAVHAcjs.OpenAIResponseTransformer; exports.OpenAITransformer = _chunkQWNUOR7Fcjs.OpenAITransformer; exports.getBuiltinTransformers = _chunkTVYA5JSQcjs.getBuiltinTransformers; exports.registerBuiltinTransformers = _chunkTVYA5JSQcjs.registerBuiltinTransformers;
|
|
@@ -3,26 +3,27 @@ import {
|
|
|
3
3
|
BuiltinTransformers,
|
|
4
4
|
getBuiltinTransformers,
|
|
5
5
|
registerBuiltinTransformers
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-FJNKXOWE.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "../chunk-
|
|
8
|
+
OpenAIResponseTransformer
|
|
9
|
+
} from "../chunk-V53ZEFXC.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "../chunk-
|
|
11
|
+
OpenAITransformer
|
|
12
|
+
} from "../chunk-7PIUVCKK.js";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
} from "../chunk-
|
|
14
|
+
AnthropicTransformer
|
|
15
|
+
} from "../chunk-6OC3ORW6.js";
|
|
16
16
|
import "../chunk-FU7EAR73.js";
|
|
17
|
+
import "../chunk-LFEH7CEO.js";
|
|
17
18
|
import {
|
|
18
|
-
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
GeminiTransformer
|
|
20
|
+
} from "../chunk-HN74IGEO.js";
|
|
20
21
|
import {
|
|
21
22
|
GeminiCodeAssistTransformer
|
|
22
|
-
} from "../chunk-
|
|
23
|
-
import "../chunk-
|
|
23
|
+
} from "../chunk-4VVCXVB7.js";
|
|
24
|
+
import "../chunk-R4VCO2CB.js";
|
|
24
25
|
import "../chunk-WYVGULTQ.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-ZLNHPUFA.js";
|
|
26
27
|
export {
|
|
27
28
|
AnthropicTransformer,
|
|
28
29
|
BUILTIN_TRANSFORMER_NAMES,
|
|
@@ -3,14 +3,34 @@ import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
|
3
3
|
export { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* transformWarnings — the `_transformWarnings` audit side-channel
|
|
7
|
+
* (`claude-api-transform-fidelity`, R7 / design D2).
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* When a decoded ingress field (top_k, metadata_user_id, stop on Responses,
|
|
10
|
+
* redacted_thinking, …) has NO representation on the target wire, the encoder
|
|
11
|
+
* records it here instead of silently dropping it: the entry carries the FIELD
|
|
12
|
+
* NAME and target only — NEVER the value (values may carry user content), so
|
|
13
|
+
* the channel is safe to log.
|
|
10
14
|
*
|
|
11
|
-
*
|
|
15
|
+
* The channel rides the Unified request (the `_serverSideTools` precedent) and
|
|
16
|
+
* is stripped at every encoder boundary — the OpenAI-chat blacklist lists it
|
|
17
|
+
* and the Responses/Gemini/Anthropic builders construct their bodies
|
|
18
|
+
* field-by-field — so it can never serialize into an upstream request.
|
|
19
|
+
*
|
|
20
|
+
* §9's `dropped_field{field}` metric is a module-level counter (no metrics
|
|
21
|
+
* registry in this repo — the same minimal-observability precedent as B's
|
|
22
|
+
* stop_reason counter) plus a once-per-field console.warn so a hot loop of
|
|
23
|
+
* dropping requests doesn't spam the log.
|
|
24
|
+
*
|
|
25
|
+
* @module transformer/transformWarnings
|
|
12
26
|
*/
|
|
13
27
|
|
|
28
|
+
/** One dropped-field audit entry. `field`/`target` names only — never values. */
|
|
29
|
+
interface DroppedFieldEntry {
|
|
30
|
+
field: string;
|
|
31
|
+
target: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
14
34
|
/**
|
|
15
35
|
* Thinking content with optional signature for extended context
|
|
16
36
|
*/
|
|
@@ -121,6 +141,19 @@ interface UnifiedChatRequest {
|
|
|
121
141
|
reasoning?: ReasoningConfig;
|
|
122
142
|
/** Native OpenAI Chat field retained by the identity-shaped ingress. */
|
|
123
143
|
reasoning_effort?: string;
|
|
144
|
+
/** Anthropic `stop_sequences` → the OpenAI chat `stop` / Gemini `stopSequences`. */
|
|
145
|
+
stop?: string[];
|
|
146
|
+
top_p?: number;
|
|
147
|
+
/** Anthropic-only sampling knob; Gemini `topK`, OpenAI wires have none. */
|
|
148
|
+
top_k?: number;
|
|
149
|
+
/** Anthropic `metadata.user_id` → OpenAI chat `user`. */
|
|
150
|
+
metadata_user_id?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Internal-only transform audit side channel (R7): field names dropped for a
|
|
153
|
+
* target wire, never values. Stripped at every encoder boundary — must never
|
|
154
|
+
* serialize into an upstream body. See `transformer/transformWarnings`.
|
|
155
|
+
*/
|
|
156
|
+
_transformWarnings?: DroppedFieldEntry[];
|
|
124
157
|
/**
|
|
125
158
|
* Internal-only routing metadata. Populated by callers (CompletionService /
|
|
126
159
|
* the host's engine adapters and proxy servers) so the usage-capture hook can attribute
|
|
@@ -398,6 +431,8 @@ interface ResolvedTransformerChain {
|
|
|
398
431
|
interface TransformRequestResult {
|
|
399
432
|
/** Transformed request body */
|
|
400
433
|
requestBody: unknown;
|
|
434
|
+
/** Post-endpoint, pre-target Unified request, when an endpoint decoder ran. */
|
|
435
|
+
endpointRequest?: UnifiedChatRequest;
|
|
401
436
|
/** Additional request configuration */
|
|
402
437
|
config: RequestConfig;
|
|
403
438
|
/** Whether to bypass further transformations */
|
|
@@ -3,14 +3,34 @@ import { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
|
3
3
|
export { ThinkLevel } from '@omnicross/contracts/completion-types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* transformWarnings — the `_transformWarnings` audit side-channel
|
|
7
|
+
* (`claude-api-transform-fidelity`, R7 / design D2).
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* When a decoded ingress field (top_k, metadata_user_id, stop on Responses,
|
|
10
|
+
* redacted_thinking, …) has NO representation on the target wire, the encoder
|
|
11
|
+
* records it here instead of silently dropping it: the entry carries the FIELD
|
|
12
|
+
* NAME and target only — NEVER the value (values may carry user content), so
|
|
13
|
+
* the channel is safe to log.
|
|
10
14
|
*
|
|
11
|
-
*
|
|
15
|
+
* The channel rides the Unified request (the `_serverSideTools` precedent) and
|
|
16
|
+
* is stripped at every encoder boundary — the OpenAI-chat blacklist lists it
|
|
17
|
+
* and the Responses/Gemini/Anthropic builders construct their bodies
|
|
18
|
+
* field-by-field — so it can never serialize into an upstream request.
|
|
19
|
+
*
|
|
20
|
+
* §9's `dropped_field{field}` metric is a module-level counter (no metrics
|
|
21
|
+
* registry in this repo — the same minimal-observability precedent as B's
|
|
22
|
+
* stop_reason counter) plus a once-per-field console.warn so a hot loop of
|
|
23
|
+
* dropping requests doesn't spam the log.
|
|
24
|
+
*
|
|
25
|
+
* @module transformer/transformWarnings
|
|
12
26
|
*/
|
|
13
27
|
|
|
28
|
+
/** One dropped-field audit entry. `field`/`target` names only — never values. */
|
|
29
|
+
interface DroppedFieldEntry {
|
|
30
|
+
field: string;
|
|
31
|
+
target: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
14
34
|
/**
|
|
15
35
|
* Thinking content with optional signature for extended context
|
|
16
36
|
*/
|
|
@@ -121,6 +141,19 @@ interface UnifiedChatRequest {
|
|
|
121
141
|
reasoning?: ReasoningConfig;
|
|
122
142
|
/** Native OpenAI Chat field retained by the identity-shaped ingress. */
|
|
123
143
|
reasoning_effort?: string;
|
|
144
|
+
/** Anthropic `stop_sequences` → the OpenAI chat `stop` / Gemini `stopSequences`. */
|
|
145
|
+
stop?: string[];
|
|
146
|
+
top_p?: number;
|
|
147
|
+
/** Anthropic-only sampling knob; Gemini `topK`, OpenAI wires have none. */
|
|
148
|
+
top_k?: number;
|
|
149
|
+
/** Anthropic `metadata.user_id` → OpenAI chat `user`. */
|
|
150
|
+
metadata_user_id?: string;
|
|
151
|
+
/**
|
|
152
|
+
* Internal-only transform audit side channel (R7): field names dropped for a
|
|
153
|
+
* target wire, never values. Stripped at every encoder boundary — must never
|
|
154
|
+
* serialize into an upstream body. See `transformer/transformWarnings`.
|
|
155
|
+
*/
|
|
156
|
+
_transformWarnings?: DroppedFieldEntry[];
|
|
124
157
|
/**
|
|
125
158
|
* Internal-only routing metadata. Populated by callers (CompletionService /
|
|
126
159
|
* the host's engine adapters and proxy servers) so the usage-capture hook can attribute
|
|
@@ -398,6 +431,8 @@ interface ResolvedTransformerChain {
|
|
|
398
431
|
interface TransformRequestResult {
|
|
399
432
|
/** Transformed request body */
|
|
400
433
|
requestBody: unknown;
|
|
434
|
+
/** Post-endpoint, pre-target Unified request, when an endpoint decoder ran. */
|
|
435
|
+
endpointRequest?: UnifiedChatRequest;
|
|
401
436
|
/** Additional request configuration */
|
|
402
437
|
config: RequestConfig;
|
|
403
438
|
/** Whether to bypass further transformations */
|
package/dist/transformer.cjs
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-QVOB2DNX.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-ZQQUD66M.cjs');
|
|
6
|
-
require('./chunk-5LNYGCIW.cjs');
|
|
7
|
-
require('./chunk-CMVXX7ON.cjs');
|
|
8
|
-
require('./chunk-5RSZYQJH.cjs');
|
|
9
|
-
require('./chunk-56QD3YW6.cjs');
|
|
4
|
+
var _chunk7ZHBN75Ncjs = require('./chunk-7ZHBN75N.cjs');
|
|
10
5
|
|
|
11
6
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-GBHYAGX3.cjs');
|
|
7
|
+
var _chunk3OPYJG76cjs = require('./chunk-3OPYJG76.cjs');
|
|
14
8
|
|
|
15
9
|
|
|
16
|
-
var
|
|
17
|
-
require('./chunk-
|
|
18
|
-
require('./chunk-
|
|
10
|
+
var _chunkTVYA5JSQcjs = require('./chunk-TVYA5JSQ.cjs');
|
|
11
|
+
require('./chunk-NOITAVHA.cjs');
|
|
12
|
+
require('./chunk-QWNUOR7F.cjs');
|
|
13
|
+
require('./chunk-SQMAEDNE.cjs');
|
|
14
|
+
require('./chunk-5RSZYQJH.cjs');
|
|
15
|
+
require('./chunk-6DDYNS2B.cjs');
|
|
16
|
+
require('./chunk-KIQ2HA2A.cjs');
|
|
17
|
+
require('./chunk-GBHYAGX3.cjs');
|
|
18
|
+
require('./chunk-VXRTQZF2.cjs');
|
|
19
|
+
require('./chunk-WX2E2G7H.cjs');
|
|
19
20
|
require('./chunk-77USGNRW.cjs');
|
|
20
21
|
|
|
21
22
|
|
|
@@ -26,7 +27,7 @@ require('./chunk-77USGNRW.cjs');
|
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
|
|
29
|
-
var
|
|
30
|
+
var _chunkIUL4VWNUcjs = require('./chunk-IUL4VWNU.cjs');
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
@@ -39,4 +40,4 @@ var _chunkAOFWNWLTcjs = require('./chunk-AOFWNWLT.cjs');
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
exports.THINK_LEVELS =
|
|
43
|
+
exports.THINK_LEVELS = _chunkIUL4VWNUcjs.THINK_LEVELS; exports.TransformerChainExecutor = _chunk7ZHBN75Ncjs.TransformerChainExecutor; exports.TransformerService = _chunk3OPYJG76cjs.TransformerService; exports.extractReasoningIntent = _chunkIUL4VWNUcjs.extractReasoningIntent; exports.normalizeThinkLevel = _chunkIUL4VWNUcjs.normalizeThinkLevel; exports.registerBuiltinTransformers = _chunkTVYA5JSQcjs.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,21 +1,22 @@
|
|
|
1
1
|
import "./chunk-WTQMX2Q6.js";
|
|
2
|
-
import {
|
|
3
|
-
registerBuiltinTransformers
|
|
4
|
-
} from "./chunk-NGYOO5TO.js";
|
|
5
|
-
import "./chunk-HKB656B4.js";
|
|
6
|
-
import "./chunk-55FMGZ3L.js";
|
|
7
|
-
import "./chunk-45FHEOKW.js";
|
|
8
|
-
import "./chunk-FU7EAR73.js";
|
|
9
|
-
import "./chunk-CCVRRJOX.js";
|
|
10
2
|
import {
|
|
11
3
|
TransformerChainExecutor
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-MZNPGW5Q.js";
|
|
4
|
+
} from "./chunk-EYGBM2VC.js";
|
|
14
5
|
import {
|
|
15
6
|
TransformerService
|
|
16
7
|
} from "./chunk-DK4A7DLE.js";
|
|
17
|
-
import
|
|
18
|
-
|
|
8
|
+
import {
|
|
9
|
+
registerBuiltinTransformers
|
|
10
|
+
} from "./chunk-FJNKXOWE.js";
|
|
11
|
+
import "./chunk-V53ZEFXC.js";
|
|
12
|
+
import "./chunk-7PIUVCKK.js";
|
|
13
|
+
import "./chunk-6OC3ORW6.js";
|
|
14
|
+
import "./chunk-FU7EAR73.js";
|
|
15
|
+
import "./chunk-LFEH7CEO.js";
|
|
16
|
+
import "./chunk-HN74IGEO.js";
|
|
17
|
+
import "./chunk-MZNPGW5Q.js";
|
|
18
|
+
import "./chunk-4VVCXVB7.js";
|
|
19
|
+
import "./chunk-R4VCO2CB.js";
|
|
19
20
|
import "./chunk-WYVGULTQ.js";
|
|
20
21
|
import {
|
|
21
22
|
THINK_LEVELS,
|
|
@@ -26,7 +27,7 @@ import {
|
|
|
26
27
|
resolveReasoningTokenLimit,
|
|
27
28
|
resolveRequestReasoning,
|
|
28
29
|
resolveTargetModelCapabilities
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZLNHPUFA.js";
|
|
30
31
|
export {
|
|
31
32
|
THINK_LEVELS,
|
|
32
33
|
TransformerChainExecutor,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { e as ImageApiLimits } from './types-Bd72H4SB.js';
|
|
1
2
|
import { ProxyConfig } from '@omnicross/contracts/account-tokens-types';
|
|
2
3
|
import { AuditConfig } from '@omnicross/contracts/audit-types';
|
|
3
4
|
import { BillingConfig } from '@omnicross/contracts/billing-types';
|
|
@@ -6,11 +7,49 @@ import { VoucherRecord, VoucherGrant, VoucherInfo, VoucherConfig } from '@omnicr
|
|
|
6
7
|
import { WebhookConfig } from '@omnicross/contracts/webhook-types';
|
|
7
8
|
import { L as Logger } from './logger-4GvQNzhE.js';
|
|
8
9
|
import { ProviderConfigSource } from './ports/provider-config-source.js';
|
|
9
|
-
import { P as ProviderProxy } from './ProviderProxy
|
|
10
|
-
import { ProviderProxyDeps } from './
|
|
10
|
+
import { P as ProviderProxy } from './ProviderProxy-DYoY5XoT.js';
|
|
11
|
+
import { W as ProviderProxyDeps } from './types-CVRge76p.js';
|
|
11
12
|
import { BoundAccountFallbackPolicy } from './pipeline/BoundAccountSelectionError.js';
|
|
12
13
|
import { c as KeySpend } from './keyPolicy-zdWTu3CQ.js';
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* anthropicCountTokens — the `POST /v1/messages/count_tokens` handler
|
|
17
|
+
* (`claude-api-routing-errors`, R2 passthrough+reject subset).
|
|
18
|
+
*
|
|
19
|
+
* Before this module, the substring `/v1/messages` match routed count_tokens
|
|
20
|
+
* into the FULL generation pipeline — every context-stats call burned a real
|
|
21
|
+
* upstream inference (BYO money, subscription 5h-window quota) and returned a
|
|
22
|
+
* Message JSON instead of `{"input_tokens":N}` (audit F-1, P0).
|
|
23
|
+
*
|
|
24
|
+
* Strategies (portfolio-locked default: `'auto'`):
|
|
25
|
+
* - **passthrough** (Anthropic-wire upstream — `plan.sameFormat`): strip the
|
|
26
|
+
* generation-only fields the count_tokens endpoint rejects (`stream`,
|
|
27
|
+
* `max_tokens`), rewrite `model` to the resolved upstream model, and POST to
|
|
28
|
+
* `<upstream>/v1/messages/count_tokens` via the SAME same-format fetches the
|
|
29
|
+
* generation path uses (credential injection, beta merge, claude header
|
|
30
|
+
* baseline all inherited). The response — success OR failure — relays
|
|
31
|
+
* verbatim with its real status (an Anthropic-wire error body already IS
|
|
32
|
+
* the official shape; wrapping it would violate the verbatim moat).
|
|
33
|
+
* - **estimate** (Change B; explicit config, or `auto` on a translation
|
|
34
|
+
* upstream): a PURE-LOCAL heuristic estimate (`anthropicCountEstimate.ts`)
|
|
35
|
+
* answered as `{"input_tokens":N}` with the `x-omnicross-count-estimate:
|
|
36
|
+
* true` marker header — zero upstream calls, never recorded as usage.
|
|
37
|
+
* - **reject** (explicit config, or `passthrough` degraded on a translation
|
|
38
|
+
* upstream): a clean Anthropic 404 `not_found_error` with ZERO upstream
|
|
39
|
+
* calls — Claude Code treats it as "endpoint absent" and falls back to its
|
|
40
|
+
* local usage estimation.
|
|
41
|
+
*
|
|
42
|
+
* A free endpoint: no usage recording, no concurrency gate (the outbound face
|
|
43
|
+
* bypasses its gate before dispatch), single attempt — no 401 refresh retry,
|
|
44
|
+
* no subscription health marking (a failed count_tokens must not cool an
|
|
45
|
+
* account that serves inference; the inference path drives those itself).
|
|
46
|
+
*
|
|
47
|
+
* @module provider-proxy/ingress/anthropicCountTokens
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/** The operator-facing strategy config (§10 `anthropic.countTokens.mode`). */
|
|
51
|
+
type CountTokensMode = 'auto' | 'passthrough' | 'estimate' | 'reject';
|
|
52
|
+
|
|
14
53
|
/**
|
|
15
54
|
* keySpendTracker — a cheap in-memory per-key accumulated-spend cache
|
|
16
55
|
* (`outbound-key-policy`, design D3).
|
|
@@ -201,23 +240,56 @@ interface VoucherDb {
|
|
|
201
240
|
voucherList(): Promise<VoucherRecord[]>;
|
|
202
241
|
}
|
|
203
242
|
|
|
204
|
-
/**
|
|
205
|
-
* Shared contract types for the outbound API server (`outbound-api-server`).
|
|
206
|
-
*
|
|
207
|
-
* The outbound server is a SEPARATE long-lived HTTP listener (distinct from the
|
|
208
|
-
* resident loopback `ProviderProxy`) that authenticates external callers via
|
|
209
|
-
* named API keys and routes their requests through the EXISTING `provider-proxy`
|
|
210
|
-
* ingress parsers + transformer — there is exactly one conversion stack.
|
|
211
|
-
*
|
|
212
|
-
* These types are kept in their own module so the server, router, auth, rate
|
|
213
|
-
* limiter, role detection, and route resolver can share shapes without circular
|
|
214
|
-
* imports.
|
|
215
|
-
*
|
|
216
|
-
* @module outbound-api/types
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
243
|
/** The four endpoints, 1:1 with the four wire-format ingress parsers. */
|
|
220
244
|
type OutboundEndpoint = 'chat' | 'responses' | 'messages' | 'gemini';
|
|
245
|
+
/** Named-key authorization vocabulary. Images is deliberately not a text route. */
|
|
246
|
+
type OutboundPermission = OutboundEndpoint | 'images';
|
|
247
|
+
interface ImagesServerConfig {
|
|
248
|
+
enabled: boolean;
|
|
249
|
+
provider: 'codex-subscription';
|
|
250
|
+
defaultModel: string;
|
|
251
|
+
modelAliases: Record<string, string>;
|
|
252
|
+
account: {
|
|
253
|
+
id?: string;
|
|
254
|
+
group?: string;
|
|
255
|
+
fallback: 'strict' | 'pool';
|
|
256
|
+
};
|
|
257
|
+
queue: {
|
|
258
|
+
maxConcurrentJobsPerAccount: number;
|
|
259
|
+
maxQueuedJobs: number;
|
|
260
|
+
queueTimeoutMs: number;
|
|
261
|
+
generationTimeoutMs: number;
|
|
262
|
+
};
|
|
263
|
+
temporary: {
|
|
264
|
+
maxActiveScopes: number;
|
|
265
|
+
maxTotalBytes: number;
|
|
266
|
+
maxTenantBytes: number;
|
|
267
|
+
staleAfterMs: number;
|
|
268
|
+
cleanupIntervalMs: number;
|
|
269
|
+
};
|
|
270
|
+
limits: ImageApiLimits;
|
|
271
|
+
references: {
|
|
272
|
+
ttlMs: number;
|
|
273
|
+
maxArtifactBytes: number;
|
|
274
|
+
maxTotalBytes: number;
|
|
275
|
+
maxTenantBytes: number;
|
|
276
|
+
maxEntries: number;
|
|
277
|
+
maxCalls: number;
|
|
278
|
+
maxResponses: number;
|
|
279
|
+
maxTombstones: number;
|
|
280
|
+
tombstoneTtlMs: number;
|
|
281
|
+
cleanupIntervalMs: number;
|
|
282
|
+
storageRoot?: string;
|
|
283
|
+
};
|
|
284
|
+
remote: {
|
|
285
|
+
enabled: boolean;
|
|
286
|
+
};
|
|
287
|
+
evidenceTtlMs: number;
|
|
288
|
+
}
|
|
289
|
+
/** Non-consuming, account-bound image model discovery injected by the daemon. */
|
|
290
|
+
interface ImageModelCatalogReader {
|
|
291
|
+
listAvailableModels(apiKeyId: string): Promise<readonly string[]>;
|
|
292
|
+
}
|
|
221
293
|
/** A `"providerId,modelId"` model reference (mirrors `RouterConfig` vocab). */
|
|
222
294
|
type ModelRef = string;
|
|
223
295
|
/** The detected request role; precedence background > default. */
|
|
@@ -513,6 +585,69 @@ interface FingerprintConfig {
|
|
|
513
585
|
/** Operator UA baseline for un-captured accounts (piece 4). Absent ⇒ none. */
|
|
514
586
|
ua?: string;
|
|
515
587
|
}
|
|
588
|
+
/**
|
|
589
|
+
* count_tokens strategy mode (§10 `anthropic.countTokens.mode`). ONE canonical
|
|
590
|
+
* union lives with the handler (`provider-proxy/ingress/anthropicCountTokens`);
|
|
591
|
+
* this alias re-exports it so the config-segment types and the runtime
|
|
592
|
+
* resolver can never drift apart (review B-M2).
|
|
593
|
+
*/
|
|
594
|
+
type AnthropicCountTokensMode = CountTokensMode;
|
|
595
|
+
/** `GET /v1/models` response shape selector (§10 `anthropic.modelsShape`). */
|
|
596
|
+
type AnthropicModelsShape = 'auto' | 'anthropic' | 'openai';
|
|
597
|
+
/**
|
|
598
|
+
* Anthropic-protocol tuning segment (`claude-api-protocol-fidelity`, §10
|
|
599
|
+
* skeleton — count_tokens strategy/budget, /v1/models shape, synthetic-SSE
|
|
600
|
+
* heartbeat). Persisted + normalized like the other segments; read live per
|
|
601
|
+
* request (count_tokens/models) or hot-applied via the module setter
|
|
602
|
+
* (heartbeat). `proxyOauthUsage` / `apiHello` land in the follow-up change.
|
|
603
|
+
*/
|
|
604
|
+
interface AnthropicConfigSegment {
|
|
605
|
+
/**
|
|
606
|
+
* `/v1/messages/count_tokens` strategy. `mode` absent ⇒ `'auto'`
|
|
607
|
+
* (Anthropic-wire upstream → passthrough; translation upstream → local
|
|
608
|
+
* estimate). `estimateBudgetMs` bounds the local estimator walk (default
|
|
609
|
+
* 2000; a pathological input degrades to a coarser estimate, never fails).
|
|
610
|
+
*/
|
|
611
|
+
countTokens?: {
|
|
612
|
+
mode?: AnthropicCountTokensMode;
|
|
613
|
+
estimateBudgetMs?: number;
|
|
614
|
+
};
|
|
615
|
+
/**
|
|
616
|
+
* `GET /v1/models` response shape. `'auto'` (default): a key authorized for
|
|
617
|
+
* the messages endpoint gets the Anthropic list shape, everyone else keeps
|
|
618
|
+
* the OpenAI shape; `'anthropic'` / `'openai'` force one shape (escape
|
|
619
|
+
* hatch for dual-protocol consumers).
|
|
620
|
+
*/
|
|
621
|
+
modelsShape?: AnthropicModelsShape;
|
|
622
|
+
/**
|
|
623
|
+
* Synthetic-SSE ping heartbeat interval (ms) for the TRANSLATION path only.
|
|
624
|
+
* Default 20000; ≤0 disables. Hot-applied at `applyConfig` — in-flight
|
|
625
|
+
* streams pick the new value at their next timer arm.
|
|
626
|
+
*/
|
|
627
|
+
heartbeatIntervalMs?: number;
|
|
628
|
+
/**
|
|
629
|
+
* Translate-path PDF text extraction budget (`claude-api-transform-fidelity`,
|
|
630
|
+
* R7). `budgetMs` default 2000 — bounds the synchronous zero-dependency
|
|
631
|
+
* text-layer walk; over-budget documents 400 explicitly (never silently
|
|
632
|
+
* dropped, never unbounded work).
|
|
633
|
+
*/
|
|
634
|
+
pdfTextExtraction?: {
|
|
635
|
+
budgetMs?: number;
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* Serve `GET /api/oauth/usage` on the outbound listener as a PURE-CACHE read
|
|
639
|
+
* of the shared Claude allowance store (R9). Default FALSE — off, the path
|
|
640
|
+
* keeps its current generic 404 byte-for-byte. When on, a messages-authorized
|
|
641
|
+
* key bound to a Claude subscription receives the api.anthropic.com usage
|
|
642
|
+
* wire shape; NO upstream call or refresh is ever triggered by the query.
|
|
643
|
+
*/
|
|
644
|
+
proxyOauthUsage?: boolean;
|
|
645
|
+
/**
|
|
646
|
+
* Answer `HEAD /api/hello` with a bare 200 at the listener level (R10 —
|
|
647
|
+
* clients probe "can this endpoint be safely rejected"). Default TRUE.
|
|
648
|
+
*/
|
|
649
|
+
apiHello?: boolean;
|
|
650
|
+
}
|
|
516
651
|
/**
|
|
517
652
|
* Layered upstream-proxy segment (upstream-proxy). Global + per-provider proxy
|
|
518
653
|
* config for outbound EGRESS to upstreams (NOT the inbound listener). Resolved
|
|
@@ -627,6 +762,14 @@ interface OutboundApiServerConfig {
|
|
|
627
762
|
* byte-identical zero regression, purely additive on the #4 key-policy.
|
|
628
763
|
*/
|
|
629
764
|
voucher?: VoucherConfig;
|
|
765
|
+
/**
|
|
766
|
+
* Anthropic-protocol tuning segment (claude-api-protocol-fidelity, §10).
|
|
767
|
+
* Optional in the persisted shape; `normalizeServerConfig` always fills it
|
|
768
|
+
* with the frozen defaults (auto/auto/20000).
|
|
769
|
+
*/
|
|
770
|
+
anthropic?: AnthropicConfigSegment;
|
|
771
|
+
/** Default-off Images serving policy; capability still requires fresh evidence. */
|
|
772
|
+
images?: ImagesServerConfig;
|
|
630
773
|
}
|
|
631
774
|
/** A live status snapshot the Settings tab renders. */
|
|
632
775
|
interface OutboundApiServerStatus {
|
|
@@ -641,6 +784,15 @@ interface OutboundApiServerStatus {
|
|
|
641
784
|
formats: OutboundFormatUrls | null;
|
|
642
785
|
/** The four format endpoint URLs over the LAN (only when network binding on). */
|
|
643
786
|
lanFormats: OutboundFormatUrls | null;
|
|
787
|
+
/** Additive Images endpoints; absent while Images is disabled. */
|
|
788
|
+
images?: {
|
|
789
|
+
generations: string;
|
|
790
|
+
edits: string;
|
|
791
|
+
} | null;
|
|
792
|
+
lanImages?: {
|
|
793
|
+
generations: string;
|
|
794
|
+
edits: string;
|
|
795
|
+
} | null;
|
|
644
796
|
}
|
|
645
797
|
/** The four format endpoint URLs for one base. */
|
|
646
798
|
interface OutboundFormatUrls {
|
|
@@ -667,8 +819,10 @@ interface OutboundApiKeyInfo {
|
|
|
667
819
|
revoked: boolean;
|
|
668
820
|
/** Intended consumer. Existing rows default to a general client key. */
|
|
669
821
|
kind?: 'client' | 'integration';
|
|
670
|
-
/**
|
|
671
|
-
allowedEndpoints
|
|
822
|
+
/** Exact effective permission list; legacy absent rows project to text-only permissions. */
|
|
823
|
+
allowedEndpoints: OutboundPermission[];
|
|
824
|
+
/** True when the stored row omitted permissions and compatibility defaults were projected. */
|
|
825
|
+
legacyPermissions: boolean;
|
|
672
826
|
/** When true the key is rejected unless the TCP peer is loopback. */
|
|
673
827
|
loopbackOnly?: boolean;
|
|
674
828
|
/**
|
|
@@ -746,6 +900,8 @@ interface OutboundApiKeyCreated {
|
|
|
746
900
|
name: string;
|
|
747
901
|
keyPrefix: string;
|
|
748
902
|
createdAt: number;
|
|
903
|
+
/** Exact effective permission list assigned to the new key. */
|
|
904
|
+
allowedEndpoints: OutboundPermission[];
|
|
749
905
|
plaintextOnce: string;
|
|
750
906
|
}
|
|
751
907
|
/**
|
|
@@ -773,8 +929,8 @@ interface OutboundKeyDbRow {
|
|
|
773
929
|
revokedAt: number | null;
|
|
774
930
|
/** Intended consumer. Existing rows without this field remain client keys. */
|
|
775
931
|
kind?: 'client' | 'integration';
|
|
776
|
-
/**
|
|
777
|
-
allowedEndpoints?:
|
|
932
|
+
/** Persisted exact permission list. Absent is a legacy text-only row. */
|
|
933
|
+
allowedEndpoints?: OutboundPermission[];
|
|
778
934
|
/** Restrict use to requests whose direct socket peer is loopback. */
|
|
779
935
|
loopbackOnly?: boolean;
|
|
780
936
|
/**
|
|
@@ -817,7 +973,7 @@ interface OutboundKeyDb {
|
|
|
817
973
|
keyPrefix: string;
|
|
818
974
|
createdAt?: number;
|
|
819
975
|
kind?: 'client' | 'integration';
|
|
820
|
-
allowedEndpoints?:
|
|
976
|
+
allowedEndpoints?: OutboundPermission[];
|
|
821
977
|
loopbackOnly?: boolean;
|
|
822
978
|
/**
|
|
823
979
|
* The generated plaintext secret. When the DB holds a `SecretBox` it
|
|
@@ -831,6 +987,8 @@ interface OutboundKeyDb {
|
|
|
831
987
|
outboundApiKeysRevoke(id: string): Promise<boolean>;
|
|
832
988
|
outboundApiKeysTouchLastUsed(id: string): Promise<boolean>;
|
|
833
989
|
outboundApiKeysSetEnabled(id: string, enabled: boolean): Promise<boolean>;
|
|
990
|
+
/** Atomically replace the exact key permission list. */
|
|
991
|
+
outboundApiKeysSetPermissions(id: string, permissions: OutboundPermission[]): Promise<boolean>;
|
|
834
992
|
/**
|
|
835
993
|
* Set (or clear) a key's per-key concurrency ceiling. `null` clears the field
|
|
836
994
|
* → unlimited (gate bypassed). Mirrors `outboundApiKeysSetEnabled`; returns
|
|
@@ -890,6 +1048,8 @@ interface OutboundApiDeps {
|
|
|
890
1048
|
readonly providerProxy: ProviderProxy;
|
|
891
1049
|
/** The proxy's app-session deps (reused verbatim for `routeRequest`). */
|
|
892
1050
|
readonly proxyDeps: ProviderProxyDeps;
|
|
1051
|
+
/** Optional fail-closed Images catalog; absent means no image model is advertised. */
|
|
1052
|
+
readonly imageModelCatalog?: ImageModelCatalogReader;
|
|
893
1053
|
/**
|
|
894
1054
|
* OPTIONAL unauthenticated `/health` provider (daemon-health-endpoint, D1
|
|
895
1055
|
* secondary mount). When wired (by the daemon bootstrap — core NEVER imports
|
|
@@ -917,4 +1077,4 @@ interface OutboundApiDeps {
|
|
|
917
1077
|
readonly logger?: Logger;
|
|
918
1078
|
}
|
|
919
1079
|
|
|
920
|
-
export { type AccountProbeConfig as A,
|
|
1080
|
+
export { type OutboundKeyModelRestrictionMode as $, type AccountProbeConfig as A, type VoucherDb as B, type ChatDispatchMode as C, computeVoucherGrant as D, ENDPOINT_MODEL_KINDS as E, type FingerprintConfig as F, type GatewayBinding as G, generateVoucherCode as H, type ImagesServerConfig as I, hashVoucherCode as J, type KeySpendReader as K, newVoucherId as L, type MessagesModelKind as M, startOfLocalDay as N, type OutboundKeyDb as O, startOfLocalWeek as P, toVoucherInfo as Q, type RequestRole as R, voucherCodePrefix as S, type ModelRef as T, type UserMessageQueueConfig as U, type VoucherCreateInput as V, type AnthropicConfigSegment as W, type AccountHealthConfig as X, type AnthropicCountTokensMode as Y, type AnthropicModelsShape as Z, type ImageModelCatalogReader as _, type AllowanceSchedulingConfig as a, 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 KeySpendSeeder as i, KeySpendTracker as j, type KindMappedEndpoint as k, type ModelKind as l, type ModelPrefixTargets as m, type OutboundApiDeps as n, type OutboundApiKeyCreated as o, type OutboundApiKeyInfo as p, type OutboundApiServerConfig as q, type OutboundApiServerStatus as r, type OutboundEndpoint as s, type OutboundFormatUrls as t, type OutboundKeyActivationMode as u, type OutboundKeyDbRow as v, type OutboundKeyPolicy as w, type OutboundPermission as x, type OutboundProxyConfig as y, type ResponsesModelKind as z };
|