@intutic/shared-types 2.2.0 → 2.4.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/dist/anomaly.d.ts +6 -10
- package/dist/anomaly.d.ts.map +1 -1
- package/dist/anomaly.js +0 -2
- package/dist/anomaly.js.map +1 -1
- package/dist/api-contracts.d.ts +1 -1
- package/dist/api-contracts.js +1 -1
- package/dist/attenuation.d.ts +1 -1
- package/dist/attenuation.js +1 -1
- package/dist/auth.d.ts +116 -9
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +20 -5
- package/dist/auth.js.map +1 -1
- package/dist/billing.d.ts +1 -1
- package/dist/billing.js +1 -1
- package/dist/cloudProbe.d.ts +54 -0
- package/dist/cloudProbe.d.ts.map +1 -0
- package/dist/cloudProbe.js +254 -0
- package/dist/cloudProbe.js.map +1 -0
- package/dist/destructiveSql.d.ts +48 -0
- package/dist/destructiveSql.d.ts.map +1 -0
- package/dist/destructiveSql.js +43 -0
- package/dist/destructiveSql.js.map +1 -0
- package/dist/devInventory.d.ts +120 -0
- package/dist/devInventory.d.ts.map +1 -0
- package/dist/devInventory.js +80 -0
- package/dist/devInventory.js.map +1 -0
- package/dist/enums.d.ts +66 -21
- package/dist/enums.d.ts.map +1 -1
- package/dist/enums.js +55 -31
- package/dist/enums.js.map +1 -1
- package/dist/errors.js +3 -3
- package/dist/errors.js.map +1 -1
- package/dist/finops.d.ts +52 -2
- package/dist/finops.d.ts.map +1 -1
- package/dist/finops.js +15 -1
- package/dist/finops.js.map +1 -1
- package/dist/gateDecisions.d.ts +18 -0
- package/dist/gateDecisions.d.ts.map +1 -0
- package/dist/gateDecisions.js +20 -0
- package/dist/gateDecisions.js.map +1 -0
- package/dist/gateIdentity.d.ts +23 -0
- package/dist/gateIdentity.d.ts.map +1 -0
- package/dist/gateIdentity.js +32 -0
- package/dist/gateIdentity.js.map +1 -0
- package/dist/gateKind.d.ts +172 -0
- package/dist/gateKind.d.ts.map +1 -0
- package/dist/gateKind.js +160 -0
- package/dist/gateKind.js.map +1 -0
- package/dist/gateLimits.d.ts +170 -0
- package/dist/gateLimits.d.ts.map +1 -0
- package/dist/gateLimits.js +96 -0
- package/dist/gateLimits.js.map +1 -0
- package/dist/gitRemote.d.ts +17 -0
- package/dist/gitRemote.d.ts.map +1 -0
- package/dist/gitRemote.js +71 -0
- package/dist/gitRemote.js.map +1 -0
- package/dist/governanceCoverage.d.ts +1 -1
- package/dist/governanceCoverage.js +1 -1
- package/dist/guardrailIr.d.ts +9 -9
- package/dist/guardrailIr.d.ts.map +1 -1
- package/dist/guardrailIr.js +3 -3
- package/dist/guardrailIr.js.map +1 -1
- package/dist/guardrailRender.d.ts +1 -1
- package/dist/guardrailRender.js +1 -1
- package/dist/harnessRules.d.ts +74 -0
- package/dist/harnessRules.d.ts.map +1 -0
- package/dist/harnessRules.js +142 -0
- package/dist/harnessRules.js.map +1 -0
- package/dist/holdMessages.d.ts +25 -0
- package/dist/holdMessages.d.ts.map +1 -0
- package/dist/holdMessages.js +34 -0
- package/dist/holdMessages.js.map +1 -0
- package/dist/identity.d.ts +1 -1
- package/dist/identity.js +2 -2
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +42 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +161 -10
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +1 -1
- package/dist/mcpBudgets.d.ts +191 -0
- package/dist/mcpBudgets.d.ts.map +1 -0
- package/dist/mcpBudgets.js +144 -0
- package/dist/mcpBudgets.js.map +1 -0
- package/dist/mcpRegistryRecord.d.ts +143 -0
- package/dist/mcpRegistryRecord.d.ts.map +1 -0
- package/dist/mcpRegistryRecord.js +229 -0
- package/dist/mcpRegistryRecord.js.map +1 -0
- package/dist/mcpToolRisk.d.ts +82 -0
- package/dist/mcpToolRisk.d.ts.map +1 -0
- package/dist/mcpToolRisk.js +334 -0
- package/dist/mcpToolRisk.js.map +1 -0
- package/dist/modelCatalog.d.ts +2 -2
- package/dist/modelCatalog.generated.js +1 -1
- package/dist/modelCatalog.generated.js.map +1 -1
- package/dist/modelCatalog.js +2 -2
- package/dist/notifications.d.ts +24 -151
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notifications.js +266 -1
- package/dist/notifications.js.map +1 -1
- package/dist/phrases.d.ts +87 -0
- package/dist/phrases.d.ts.map +1 -0
- package/dist/phrases.js +241 -0
- package/dist/phrases.js.map +1 -0
- package/dist/piiDetectors.d.ts +97 -0
- package/dist/piiDetectors.d.ts.map +1 -0
- package/dist/piiDetectors.js +96 -0
- package/dist/piiDetectors.js.map +1 -0
- package/dist/piiDetectors.json +71 -0
- package/dist/policy.d.ts +1 -1
- package/dist/policy.js +1 -1
- package/dist/policyGuardrails.d.ts +127 -10
- package/dist/policyGuardrails.d.ts.map +1 -1
- package/dist/policyGuardrails.js +59 -6
- package/dist/policyGuardrails.js.map +1 -1
- package/dist/posturePresets.js +1 -1
- package/dist/posturePresets.js.map +1 -1
- package/dist/providerVerification.d.ts +36 -10
- package/dist/providerVerification.d.ts.map +1 -1
- package/dist/providerVerification.js +80 -20
- package/dist/providerVerification.js.map +1 -1
- package/dist/providers.d.ts +54 -17
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +135 -26
- package/dist/providers.js.map +1 -1
- package/dist/regoBuiltins.d.ts +42 -0
- package/dist/regoBuiltins.d.ts.map +1 -0
- package/dist/regoBuiltins.js +732 -0
- package/dist/regoBuiltins.js.map +1 -0
- package/dist/regoRules.d.ts +105 -0
- package/dist/regoRules.d.ts.map +1 -0
- package/dist/regoRules.js +407 -0
- package/dist/regoRules.js.map +1 -0
- package/dist/ruleLoadFailures.d.ts +15 -0
- package/dist/ruleLoadFailures.d.ts.map +1 -0
- package/dist/ruleLoadFailures.js +26 -0
- package/dist/ruleLoadFailures.js.map +1 -0
- package/dist/scriptScan.d.ts +5 -5
- package/dist/scriptScan.js +3 -3
- package/dist/sequence.d.ts +52 -0
- package/dist/sequence.d.ts.map +1 -0
- package/dist/sequence.js +127 -0
- package/dist/sequence.js.map +1 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +1 -1
- package/dist/skillScan.d.ts +3 -3
- package/dist/skillScan.d.ts.map +1 -1
- package/dist/skillScan.js +26 -4
- package/dist/skillScan.js.map +1 -1
- package/dist/sop.d.ts +5 -5
- package/dist/sop.js +2 -2
- package/dist/sourceProviders.d.ts +1 -8
- package/dist/sourceProviders.d.ts.map +1 -1
- package/dist/sourceProviders.js +2 -9
- package/dist/sourceProviders.js.map +1 -1
- package/dist/spendBudgets.d.ts +122 -0
- package/dist/spendBudgets.d.ts.map +1 -0
- package/dist/spendBudgets.js +92 -0
- package/dist/spendBudgets.js.map +1 -0
- package/dist/ssoGroupClearance.d.ts +18 -2
- package/dist/ssoGroupClearance.d.ts.map +1 -1
- package/dist/ssoGroupClearance.js +43 -4
- package/dist/ssoGroupClearance.js.map +1 -1
- package/dist/sync.d.ts +0 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +0 -1
- package/dist/sync.js.map +1 -1
- package/dist/taskManagement.d.ts +0 -2
- package/dist/taskManagement.d.ts.map +1 -1
- package/dist/taskManagement.js +0 -2
- package/dist/taskManagement.js.map +1 -1
- package/dist/toolPoison.d.ts +33 -0
- package/dist/toolPoison.d.ts.map +1 -0
- package/dist/toolPoison.js +85 -0
- package/dist/toolPoison.js.map +1 -0
- package/dist/upstreamRetry.d.ts +121 -0
- package/dist/upstreamRetry.d.ts.map +1 -0
- package/dist/upstreamRetry.js +90 -0
- package/dist/upstreamRetry.js.map +1 -0
- package/dist/usage.d.ts +186 -0
- package/dist/usage.d.ts.map +1 -1
- package/dist/wasmBinary.d.ts +25 -0
- package/dist/wasmBinary.d.ts.map +1 -0
- package/dist/wasmBinary.js +111 -0
- package/dist/wasmBinary.js.map +1 -0
- package/dist/wasmFuel.d.ts +52 -0
- package/dist/wasmFuel.d.ts.map +1 -0
- package/dist/wasmFuel.js +320 -0
- package/dist/wasmFuel.js.map +1 -0
- package/dist/wasmMemoryCap.d.ts +21 -0
- package/dist/wasmMemoryCap.d.ts.map +1 -0
- package/dist/wasmMemoryCap.js +58 -0
- package/dist/wasmMemoryCap.js.map +1 -0
- package/dist/wasmRuleDescriptor.d.ts +43 -0
- package/dist/wasmRuleDescriptor.d.ts.map +1 -0
- package/dist/wasmRuleDescriptor.js +65 -0
- package/dist/wasmRuleDescriptor.js.map +1 -0
- package/dist/workspaceSettings.d.ts +95 -17
- package/dist/workspaceSettings.d.ts.map +1 -1
- package/dist/workspaceSettings.js +2 -1
- package/dist/workspaceSettings.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providerVerification.js","sourceRoot":"","sources":["../src/providerVerification.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;
|
|
1
|
+
{"version":3,"file":"providerVerification.js","sourceRoot":"","sources":["../src/providerVerification.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAgDH,wDAgHC;AA0BD,kDAuBC;AAMD,kEAMC;AAGD,sCAQC;AAYD,sDAIC;AAtPD,mDAA6D;AAE7D;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,CAAS;IACrC,IAAI,GAAG,GAAG,CAAC,CAAC,MAAM,CAAA;IAClB,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG;QAAE,GAAG,EAAE,CAAA;IAC3C,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;AACxB,CAAC;AAgBD;;;;;;;;;;;;;;GAcG;AACH,SAAgB,sBAAsB,CACpC,QAAgB,EAChB,MAA8B;IAE9B,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA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AAO,KAAK,CAAC,QAAQ;QACnB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;QACxD,CAAC,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAA;AACnC,CAAC;AAED;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CAAC,UAAkB;IACtD,IAAI,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG;QAAE,OAAO,OAAO,CAAA;IACzD,IAAI,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,GAAG;QAAE,OAAO,SAAS,CAAA;IAC9D,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Multi-provider credential registry (
|
|
2
|
+
* Multi-provider credential registry (multi-provider key wizard).
|
|
3
3
|
*
|
|
4
4
|
* `services/control-plane/src/routes/providerCredentials.ts` originally
|
|
5
5
|
* hardcoded exactly 3 providers (anthropic/openai/gemini), each a single
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
* new provider's *field layout* is a data change here, not new code in
|
|
12
12
|
* every place that touches credentials.
|
|
13
13
|
*
|
|
14
|
+
* AWS Bedrock, Google Vertex AI and Azure OpenAI are routed by the proxy's
|
|
15
|
+
* `src/cloud` module: requests name them as `bedrock/<model id>`,
|
|
16
|
+
* `vertex/<model>` and `azure/<deployment>`, and the stored blob is the
|
|
17
|
+
* region/endpoint plus credential that module signs or authenticates with.
|
|
18
|
+
*
|
|
14
19
|
* Deliberately NOT exhaustive — LiteLLM supports 100+ providers. This is a
|
|
15
20
|
* representative slice spanning the shapes that actually differ (single
|
|
16
21
|
* key, multi-field cloud credential, self-hosted endpoint, structured
|
|
@@ -19,13 +24,16 @@
|
|
|
19
24
|
* of these shapes is adding one entry, not new plumbing.
|
|
20
25
|
*
|
|
21
26
|
* `routingLive: true` means `packages/proxy` actually forwards requests to
|
|
22
|
-
* this provider today (`
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* this provider today: it has an upstream for it (`provider_from_wire_id` in
|
|
28
|
+
* `proxy.rs`, which a proxy test holds this flag to). Gemini models are served
|
|
29
|
+
* on the Messages, Chat Completions and Responses routes, through the
|
|
30
|
+
* Gemini API translation; the proxy refuses the native `/v1beta/models/…`
|
|
31
|
+
* route, whose model is named in the URL. `routingLive: false` means the
|
|
32
|
+
* credential can be pre-provisioned here, but nothing in the proxy calls it
|
|
33
|
+
* yet — routing support is separate, real per-provider engineering (a new
|
|
34
|
+
* `Provider` enum variant, `get_model_provider`, pricing in `pricing.rs`),
|
|
35
|
+
* not a config change. The dashboard wizard must say so, not imply the key
|
|
36
|
+
* is live the moment it's saved.
|
|
29
37
|
*
|
|
30
38
|
* @module
|
|
31
39
|
*/
|
|
@@ -47,6 +55,15 @@ export interface ProviderDefinition {
|
|
|
47
55
|
/** Link to the provider's own API-key docs, shown in the wizard. */
|
|
48
56
|
docsUrl?: string;
|
|
49
57
|
fields: ProviderCredentialField[];
|
|
58
|
+
/**
|
|
59
|
+
* Alternative credential sets, at least one of which must be complete —
|
|
60
|
+
* e.g. Bedrock takes an access key pair OR a Bedrock API key. Each inner
|
|
61
|
+
* list names field keys that are required together. Fields named here
|
|
62
|
+
* are `required: false` individually.
|
|
63
|
+
*/
|
|
64
|
+
requiresOneOf?: string[][];
|
|
65
|
+
/** Shown above the fields: how requests name this provider's models. */
|
|
66
|
+
usageHint?: string;
|
|
50
67
|
/** See module doc — whether packages/proxy currently routes to this provider. */
|
|
51
68
|
routingLive: boolean;
|
|
52
69
|
}
|
|
@@ -74,8 +91,8 @@ export declare const PROVIDER_REGISTRY: ProviderDefinition[];
|
|
|
74
91
|
export declare function getProviderDefinition(id: string): ProviderDefinition | undefined;
|
|
75
92
|
export declare function isKnownProviderId(id: string): boolean;
|
|
76
93
|
/**
|
|
77
|
-
* DeepSeek's own API model ids — the only names the proxy routes to DeepSeek
|
|
78
|
-
*
|
|
94
|
+
* DeepSeek's own API model ids — the only names the proxy routes to DeepSeek,
|
|
95
|
+
* matched exactly and case-insensitively. Mirrors
|
|
79
96
|
* `DEEPSEEK_API_MODELS` in `packages/proxy/src/proxy.rs`; the parity test
|
|
80
97
|
* compares the two lists. Not a prefix: `deepseek-r1`,
|
|
81
98
|
* `deepseek-coder-v2-instruct` and other open-weight names are served by
|
|
@@ -89,15 +106,35 @@ export declare const DEEPSEEK_API_MODEL_IDS: readonly ["deepseek-chat", "deepsee
|
|
|
89
106
|
* `packages/proxy/src/proxy.rs` — the proxy's routing decision is the ground
|
|
90
107
|
* truth, and this exists so the control plane / dashboard can predict it
|
|
91
108
|
* (e.g. the BYO judge model "Test" flow fast-failing on an unprovisioned
|
|
92
|
-
* provider before making a real call
|
|
109
|
+
* provider before making a real call). A parity unit test pins this
|
|
93
110
|
* against the Rust source; if the heuristic changes there, change it here in
|
|
94
111
|
* the same commit.
|
|
95
112
|
*
|
|
96
|
-
* Order matters and matches the Rust exactly:
|
|
97
|
-
* (
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
113
|
+
* Order matters and matches the Rust exactly: a cloud prefix
|
|
114
|
+
* ({@link cloudProviderForModel}) → claude → gemini → '/' (OpenRouter's
|
|
115
|
+
* vendor/model namespacing — checked before the mistral prefixes so
|
|
116
|
+
* "mistralai/..." routes to OpenRouter) → an exact DeepSeek API id
|
|
117
|
+
* ({@link DEEPSEEK_API_MODEL_IDS}) → mistral prefixes → OpenAI as the
|
|
118
|
+
* default arm. A `config.yaml` model alias is not visible here: it lives in
|
|
119
|
+
* the proxy's own configuration.
|
|
120
|
+
*/
|
|
121
|
+
export declare function inferProviderForModel(model: string): CloudProviderId | 'anthropic' | 'gemini' | 'openrouter' | 'deepseek' | 'mistral' | 'openai';
|
|
122
|
+
/** Registry ids of the providers the proxy reaches through its cloud adapters. */
|
|
123
|
+
export type CloudProviderId = 'bedrock' | 'vertex_ai' | 'azure_openai';
|
|
124
|
+
/**
|
|
125
|
+
* The cloud provider a `bedrock/`, `vertex/` (or `vertex_ai/`) or `azure/`
|
|
126
|
+
* model name routes to — `crate::cloud::parse_prefixed` in the proxy.
|
|
127
|
+
*/
|
|
128
|
+
export declare function cloudProviderForModel(model: string): CloudProviderId | undefined;
|
|
129
|
+
/** Host suffixes a workspace's Azure endpoint may use — `AZURE_HOST_SUFFIXES` in the proxy. */
|
|
130
|
+
export declare const AZURE_ENDPOINT_HOST_SUFFIXES: readonly [".openai.azure.com", ".services.ai.azure.com", ".cognitiveservices.azure.com"];
|
|
131
|
+
/**
|
|
132
|
+
* The same checks the proxy applies when it reads a stored cloud credential
|
|
133
|
+
* (`cloud::config::from_workspace`), so a credential the proxy would refuse
|
|
134
|
+
* is refused when it is saved instead. Returns the reason, or `null`.
|
|
135
|
+
* Regions, locations and project ids become part of a hostname or URL path;
|
|
136
|
+
* the Azure endpoint is a host the gateway sends the key to, so it must be
|
|
137
|
+
* an Azure resource over TLS.
|
|
101
138
|
*/
|
|
102
|
-
export declare function
|
|
139
|
+
export declare function checkCloudCredentialFields(providerId: string, values: Record<string, string>): string | null;
|
|
103
140
|
//# sourceMappingURL=providers.d.ts.map
|
package/dist/providers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,6DAA6D;AAC7D,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAA;AAEhE,MAAM,WAAW,uBAAuB;IACtC,iFAAiF;IACjF,GAAG,E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AO,MAAM,4BAA4B,0FAI/B,CAAA;AAIV;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAuC5G"}
|
package/dist/providers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Multi-provider credential registry (
|
|
3
|
+
* Multi-provider credential registry (multi-provider key wizard).
|
|
4
4
|
*
|
|
5
5
|
* `services/control-plane/src/routes/providerCredentials.ts` originally
|
|
6
6
|
* hardcoded exactly 3 providers (anthropic/openai/gemini), each a single
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
* new provider's *field layout* is a data change here, not new code in
|
|
13
13
|
* every place that touches credentials.
|
|
14
14
|
*
|
|
15
|
+
* AWS Bedrock, Google Vertex AI and Azure OpenAI are routed by the proxy's
|
|
16
|
+
* `src/cloud` module: requests name them as `bedrock/<model id>`,
|
|
17
|
+
* `vertex/<model>` and `azure/<deployment>`, and the stored blob is the
|
|
18
|
+
* region/endpoint plus credential that module signs or authenticates with.
|
|
19
|
+
*
|
|
15
20
|
* Deliberately NOT exhaustive — LiteLLM supports 100+ providers. This is a
|
|
16
21
|
* representative slice spanning the shapes that actually differ (single
|
|
17
22
|
* key, multi-field cloud credential, self-hosted endpoint, structured
|
|
@@ -20,21 +25,26 @@
|
|
|
20
25
|
* of these shapes is adding one entry, not new plumbing.
|
|
21
26
|
*
|
|
22
27
|
* `routingLive: true` means `packages/proxy` actually forwards requests to
|
|
23
|
-
* this provider today (`
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* this provider today: it has an upstream for it (`provider_from_wire_id` in
|
|
29
|
+
* `proxy.rs`, which a proxy test holds this flag to). Gemini models are served
|
|
30
|
+
* on the Messages, Chat Completions and Responses routes, through the
|
|
31
|
+
* Gemini API translation; the proxy refuses the native `/v1beta/models/…`
|
|
32
|
+
* route, whose model is named in the URL. `routingLive: false` means the
|
|
33
|
+
* credential can be pre-provisioned here, but nothing in the proxy calls it
|
|
34
|
+
* yet — routing support is separate, real per-provider engineering (a new
|
|
35
|
+
* `Provider` enum variant, `get_model_provider`, pricing in `pricing.rs`),
|
|
36
|
+
* not a config change. The dashboard wizard must say so, not imply the key
|
|
37
|
+
* is live the moment it's saved.
|
|
30
38
|
*
|
|
31
39
|
* @module
|
|
32
40
|
*/
|
|
33
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.DEEPSEEK_API_MODEL_IDS = exports.PROVIDER_REGISTRY = exports.LIVE_ROUTING_PROVIDER_IDS = void 0;
|
|
42
|
+
exports.AZURE_ENDPOINT_HOST_SUFFIXES = exports.DEEPSEEK_API_MODEL_IDS = exports.PROVIDER_REGISTRY = exports.LIVE_ROUTING_PROVIDER_IDS = void 0;
|
|
35
43
|
exports.getProviderDefinition = getProviderDefinition;
|
|
36
44
|
exports.isKnownProviderId = isKnownProviderId;
|
|
37
45
|
exports.inferProviderForModel = inferProviderForModel;
|
|
46
|
+
exports.cloudProviderForModel = cloudProviderForModel;
|
|
47
|
+
exports.checkCloudCredentialFields = checkCloudCredentialFields;
|
|
38
48
|
/**
|
|
39
49
|
* The 3 providers this system supported before this registry existed —
|
|
40
50
|
* their storage format (`{provider}_api_key`, a flat string field) is
|
|
@@ -80,24 +90,40 @@ exports.PROVIDER_REGISTRY = [
|
|
|
80
90
|
{
|
|
81
91
|
id: 'azure_openai',
|
|
82
92
|
displayName: 'Azure OpenAI',
|
|
83
|
-
docsUrl: 'https://learn.microsoft.com/azure/ai-
|
|
93
|
+
docsUrl: 'https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource',
|
|
84
94
|
fields: [
|
|
95
|
+
{
|
|
96
|
+
key: 'endpoint',
|
|
97
|
+
label: 'Resource Endpoint',
|
|
98
|
+
type: 'text',
|
|
99
|
+
required: true,
|
|
100
|
+
placeholder: 'https://your-resource.openai.azure.com',
|
|
101
|
+
helpText: 'An *.openai.azure.com, *.services.ai.azure.com or *.cognitiveservices.azure.com resource URL.',
|
|
102
|
+
},
|
|
85
103
|
{ key: 'apiKey', label: 'API Key', type: 'password', required: true },
|
|
86
|
-
{ key: 'endpoint', label: 'Resource Endpoint', type: 'text', required: true, placeholder: 'https://your-resource.openai.azure.com' },
|
|
87
|
-
{ key: 'deploymentName', label: 'Deployment Name', type: 'text', required: true },
|
|
88
104
|
],
|
|
89
|
-
|
|
105
|
+
usageHint: 'Name a deployment as azure/<deployment> in the model field.',
|
|
106
|
+
routingLive: true,
|
|
90
107
|
},
|
|
91
108
|
{
|
|
92
109
|
id: 'bedrock',
|
|
93
110
|
displayName: 'AWS Bedrock',
|
|
94
111
|
docsUrl: 'https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.html',
|
|
95
112
|
fields: [
|
|
96
|
-
{ key: 'awsAccessKeyId', label: 'AWS Access Key ID', type: 'password', required: true },
|
|
97
|
-
{ key: 'awsSecretAccessKey', label: 'AWS Secret Access Key', type: 'password', required: true },
|
|
98
113
|
{ key: 'awsRegion', label: 'AWS Region', type: 'text', required: true, placeholder: 'us-east-1' },
|
|
114
|
+
{ key: 'awsAccessKeyId', label: 'AWS Access Key ID', type: 'password', required: false },
|
|
115
|
+
{ key: 'awsSecretAccessKey', label: 'AWS Secret Access Key', type: 'password', required: false },
|
|
116
|
+
{
|
|
117
|
+
key: 'apiKey',
|
|
118
|
+
label: 'Bedrock API Key',
|
|
119
|
+
type: 'password',
|
|
120
|
+
required: false,
|
|
121
|
+
helpText: 'Instead of an access key pair.',
|
|
122
|
+
},
|
|
99
123
|
],
|
|
100
|
-
|
|
124
|
+
requiresOneOf: [['awsAccessKeyId', 'awsSecretAccessKey'], ['apiKey']],
|
|
125
|
+
usageHint: 'Name a model as bedrock/<model id>, e.g. bedrock/anthropic.claude-opus-4-7.',
|
|
126
|
+
routingLive: true,
|
|
101
127
|
},
|
|
102
128
|
{
|
|
103
129
|
id: 'vertex_ai',
|
|
@@ -105,9 +131,11 @@ exports.PROVIDER_REGISTRY = [
|
|
|
105
131
|
docsUrl: 'https://cloud.google.com/vertex-ai/docs/authentication',
|
|
106
132
|
fields: [
|
|
107
133
|
{ key: 'projectId', label: 'GCP Project ID', type: 'text', required: true },
|
|
134
|
+
{ key: 'location', label: 'Location', type: 'text', required: false, placeholder: 'global' },
|
|
108
135
|
{ key: 'serviceAccountJson', label: 'Service Account JSON', type: 'textarea', required: true, helpText: 'The full JSON key file contents for a service account with Vertex AI access.' },
|
|
109
136
|
],
|
|
110
|
-
|
|
137
|
+
usageHint: 'Name a model as vertex/<model>, e.g. vertex/claude-sonnet-4-5@20250929 or vertex/gemini-2.5-pro.',
|
|
138
|
+
routingLive: true,
|
|
111
139
|
},
|
|
112
140
|
{
|
|
113
141
|
id: 'cohere',
|
|
@@ -131,7 +159,7 @@ exports.PROVIDER_REGISTRY = [
|
|
|
131
159
|
routingLive: true,
|
|
132
160
|
},
|
|
133
161
|
{
|
|
134
|
-
//
|
|
162
|
+
// The proxy routes DEEPSEEK_API_MODEL_IDS here, reading this blob
|
|
135
163
|
// (`deepseek_config`) the same way it reads Mistral's and OpenRouter's.
|
|
136
164
|
id: 'deepseek',
|
|
137
165
|
displayName: 'DeepSeek',
|
|
@@ -154,8 +182,8 @@ function isKnownProviderId(id) {
|
|
|
154
182
|
return exports.PROVIDER_REGISTRY.some((p) => p.id === id);
|
|
155
183
|
}
|
|
156
184
|
/**
|
|
157
|
-
* DeepSeek's own API model ids — the only names the proxy routes to DeepSeek
|
|
158
|
-
*
|
|
185
|
+
* DeepSeek's own API model ids — the only names the proxy routes to DeepSeek,
|
|
186
|
+
* matched exactly and case-insensitively. Mirrors
|
|
159
187
|
* `DEEPSEEK_API_MODELS` in `packages/proxy/src/proxy.rs`; the parity test
|
|
160
188
|
* compares the two lists. Not a prefix: `deepseek-r1`,
|
|
161
189
|
* `deepseek-coder-v2-instruct` and other open-weight names are served by
|
|
@@ -169,17 +197,22 @@ exports.DEEPSEEK_API_MODEL_IDS = ['deepseek-chat', 'deepseek-reasoner', 'deepsee
|
|
|
169
197
|
* `packages/proxy/src/proxy.rs` — the proxy's routing decision is the ground
|
|
170
198
|
* truth, and this exists so the control plane / dashboard can predict it
|
|
171
199
|
* (e.g. the BYO judge model "Test" flow fast-failing on an unprovisioned
|
|
172
|
-
* provider before making a real call
|
|
200
|
+
* provider before making a real call). A parity unit test pins this
|
|
173
201
|
* against the Rust source; if the heuristic changes there, change it here in
|
|
174
202
|
* the same commit.
|
|
175
203
|
*
|
|
176
|
-
* Order matters and matches the Rust exactly:
|
|
177
|
-
* (
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
204
|
+
* Order matters and matches the Rust exactly: a cloud prefix
|
|
205
|
+
* ({@link cloudProviderForModel}) → claude → gemini → '/' (OpenRouter's
|
|
206
|
+
* vendor/model namespacing — checked before the mistral prefixes so
|
|
207
|
+
* "mistralai/..." routes to OpenRouter) → an exact DeepSeek API id
|
|
208
|
+
* ({@link DEEPSEEK_API_MODEL_IDS}) → mistral prefixes → OpenAI as the
|
|
209
|
+
* default arm. A `config.yaml` model alias is not visible here: it lives in
|
|
210
|
+
* the proxy's own configuration.
|
|
181
211
|
*/
|
|
182
212
|
function inferProviderForModel(model) {
|
|
213
|
+
const cloud = cloudProviderForModel(model);
|
|
214
|
+
if (cloud)
|
|
215
|
+
return cloud;
|
|
183
216
|
const m = model.toLowerCase();
|
|
184
217
|
if (m.includes('claude'))
|
|
185
218
|
return 'anthropic';
|
|
@@ -194,4 +227,80 @@ function inferProviderForModel(model) {
|
|
|
194
227
|
}
|
|
195
228
|
return 'openai';
|
|
196
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* The cloud provider a `bedrock/`, `vertex/` (or `vertex_ai/`) or `azure/`
|
|
232
|
+
* model name routes to — `crate::cloud::parse_prefixed` in the proxy.
|
|
233
|
+
*/
|
|
234
|
+
function cloudProviderForModel(model) {
|
|
235
|
+
const slash = model.indexOf('/');
|
|
236
|
+
if (slash <= 0 || model.slice(slash + 1).trim() === '')
|
|
237
|
+
return undefined;
|
|
238
|
+
switch (model.slice(0, slash).toLowerCase()) {
|
|
239
|
+
case 'bedrock':
|
|
240
|
+
return 'bedrock';
|
|
241
|
+
case 'vertex':
|
|
242
|
+
case 'vertex_ai':
|
|
243
|
+
return 'vertex_ai';
|
|
244
|
+
case 'azure':
|
|
245
|
+
return 'azure_openai';
|
|
246
|
+
default:
|
|
247
|
+
return undefined;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/** Host suffixes a workspace's Azure endpoint may use — `AZURE_HOST_SUFFIXES` in the proxy. */
|
|
251
|
+
exports.AZURE_ENDPOINT_HOST_SUFFIXES = [
|
|
252
|
+
'.openai.azure.com',
|
|
253
|
+
'.services.ai.azure.com',
|
|
254
|
+
'.cognitiveservices.azure.com',
|
|
255
|
+
];
|
|
256
|
+
const CLOUD_NAME = /^[a-z0-9][a-z0-9-]{0,31}$/;
|
|
257
|
+
/**
|
|
258
|
+
* The same checks the proxy applies when it reads a stored cloud credential
|
|
259
|
+
* (`cloud::config::from_workspace`), so a credential the proxy would refuse
|
|
260
|
+
* is refused when it is saved instead. Returns the reason, or `null`.
|
|
261
|
+
* Regions, locations and project ids become part of a hostname or URL path;
|
|
262
|
+
* the Azure endpoint is a host the gateway sends the key to, so it must be
|
|
263
|
+
* an Azure resource over TLS.
|
|
264
|
+
*/
|
|
265
|
+
function checkCloudCredentialFields(providerId, values) {
|
|
266
|
+
switch (providerId) {
|
|
267
|
+
case 'bedrock':
|
|
268
|
+
return CLOUD_NAME.test(values.awsRegion ?? '') ? null : 'AWS Region must be a region name such as us-east-1';
|
|
269
|
+
case 'vertex_ai': {
|
|
270
|
+
if (!/^[a-z0-9-]{1,64}$/.test(values.projectId ?? ''))
|
|
271
|
+
return 'GCP Project ID must be a project id or number';
|
|
272
|
+
if (values.location !== undefined && !CLOUD_NAME.test(values.location)) {
|
|
273
|
+
return 'Location must be a location name such as us-east5 or global';
|
|
274
|
+
}
|
|
275
|
+
let doc;
|
|
276
|
+
try {
|
|
277
|
+
doc = JSON.parse(values.serviceAccountJson ?? '');
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
return 'Service Account JSON is not valid JSON';
|
|
281
|
+
}
|
|
282
|
+
const type = doc?.type;
|
|
283
|
+
return type === 'service_account' || type === 'authorized_user'
|
|
284
|
+
? null
|
|
285
|
+
: 'Service Account JSON must be a service_account (or authorized_user) credential file';
|
|
286
|
+
}
|
|
287
|
+
case 'azure_openai': {
|
|
288
|
+
let url;
|
|
289
|
+
try {
|
|
290
|
+
url = new URL(values.endpoint ?? '');
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return 'Resource Endpoint must be a URL';
|
|
294
|
+
}
|
|
295
|
+
const host = url.hostname.toLowerCase();
|
|
296
|
+
const label = exports.AZURE_ENDPOINT_HOST_SUFFIXES.map((sfx) => (host.endsWith(sfx) ? host.slice(0, -sfx.length) : null)).find((l) => l !== null);
|
|
297
|
+
const ok = url.protocol === 'https:' && url.port === '' && url.username === '' && !!label && /^[a-z0-9-]+$/.test(label);
|
|
298
|
+
return ok
|
|
299
|
+
? null
|
|
300
|
+
: 'Resource Endpoint must be https://<resource>.openai.azure.com, .services.ai.azure.com or .cognitiveservices.azure.com';
|
|
301
|
+
}
|
|
302
|
+
default:
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
197
306
|
//# sourceMappingURL=providers.js.map
|
package/dist/providers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;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EAAE,CAAC,CAAC,KAAK,IAAI,CAClB,CAAA;YACD,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,EAAE,IAAI,GAAG,CAAC,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACvH,OAAO,EAAE;gBACP,CAAC,CAAC,IAAI;gBACN,CAAC,CAAC,uHAAuH,CAAA;QAC7H,CAAC;QACD;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OPA builtins a compiled Rego policy asks the host to run — the TypeScript
|
|
3
|
+
* twin of `packages/proxy/src/wasm/opa_builtins.rs`.
|
|
4
|
+
*
|
|
5
|
+
* `opa build -t wasm` compiles most builtins into the module; the ones it
|
|
6
|
+
* imports through `opa_builtinN` are listed by name in the module's `builtins`
|
|
7
|
+
* export. These follow OPA's documented semantics (Go's `fmt`, `regexp`,
|
|
8
|
+
* `strings` and RFC 6902) and are checked against `opa eval` on the same
|
|
9
|
+
* inputs as the Rust host (`packages/proxy/tests/fixtures/rego/conformance.*`),
|
|
10
|
+
* so a policy decides the same way in the proxy, the MCP proxy and
|
|
11
|
+
* `intutic rules test`.
|
|
12
|
+
*
|
|
13
|
+
* Arguments arrive and results leave as JSON, so a Rego set reaches a builtin
|
|
14
|
+
* as an array. A thrown error makes the result undefined, as `opa eval` does
|
|
15
|
+
* outside strict mode.
|
|
16
|
+
*
|
|
17
|
+
* Differences from OPA, all also true of the Rust host unless noted:
|
|
18
|
+
* - a number written in exponent notation is formatted by `sprintf` as a float
|
|
19
|
+
* (OPA passes its source text);
|
|
20
|
+
* - `sprintf` refuses a field width or precision over 4096;
|
|
21
|
+
* - regular expressions run on JavaScript's engine here, with Go's `(?P<name>)`
|
|
22
|
+
* groups and leading `(?i)`/`(?s)`/`(?m)` flags translated; other RE2-only
|
|
23
|
+
* syntax is refused, and the MCP proxy's per-rule deadline bounds a pattern
|
|
24
|
+
* that backtracks;
|
|
25
|
+
* - integers beyond 2^53 lose precision here, where JSON numbers are doubles.
|
|
26
|
+
*
|
|
27
|
+
* @module
|
|
28
|
+
*/
|
|
29
|
+
/** Hash functions the host supplies; browser-safe callers may omit them. */
|
|
30
|
+
export interface RegoDigest {
|
|
31
|
+
(algorithm: 'sha1' | 'sha256', data: string): string;
|
|
32
|
+
}
|
|
33
|
+
export interface RegoBuiltinContext {
|
|
34
|
+
/** `time.now_ns()`: fixed for one evaluation, as in OPA. */
|
|
35
|
+
nowNs: bigint;
|
|
36
|
+
digest?: RegoDigest;
|
|
37
|
+
}
|
|
38
|
+
export type RegoBuiltin = (ctx: RegoBuiltinContext, args: unknown[]) => unknown;
|
|
39
|
+
/** Every builtin the host provides, by OPA name. */
|
|
40
|
+
export declare const REGO_HOST_BUILTINS: Readonly<Record<string, RegoBuiltin>>;
|
|
41
|
+
export declare const REGO_HOST_BUILTIN_NAMES: readonly string[];
|
|
42
|
+
//# sourceMappingURL=regoBuiltins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regoBuiltins.d.ts","sourceRoot":"","sources":["../src/regoBuiltins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CACrD;AAED,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAA;AAmjB/E,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAyFpE,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAA2C,CAAA"}
|