@open-everywhere/adapters 0.7.0 → 0.8.1
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/agent/aws/sso.ts +0 -2
- package/agent/instrumentation.ts +67 -4
- package/agent/model/approval-judge.ts +3 -3
- package/agent/model/dream-judge.ts +8 -6
- package/agent/model/gateway-probe.ts +97 -11
- package/agent/model/gateway-vision.ts +10 -6
- package/agent/model/gateway.ts +448 -34
- package/agent/model/meeting-gateway.ts +37 -7
- package/agent/model/model-config-check.ts +243 -0
- package/agent/model/target-url.ts +38 -0
- package/agent/model/transcription-routes.ts +18 -4
- package/agent/oe-oauth/errors.ts +1 -1
- package/agent/oe-oauth/token-vault.ts +99 -29
- package/agent/oe-oauth/user-auth-flow.ts +4 -3
- package/agent/operator-holders.ts +47 -0
- package/agent/postgres/neon.ts +1 -1
- package/dist/agent/aws/sso.d.ts +1 -2
- package/dist/agent/aws/sso.d.ts.map +1 -1
- package/dist/agent/aws/sso.js +0 -2
- package/dist/agent/aws/sso.js.map +1 -1
- package/dist/agent/instrumentation.d.ts +23 -1
- package/dist/agent/instrumentation.d.ts.map +1 -1
- package/dist/agent/instrumentation.js +59 -3
- package/dist/agent/instrumentation.js.map +1 -1
- package/dist/agent/model/approval-judge.d.ts.map +1 -1
- package/dist/agent/model/approval-judge.js +3 -3
- package/dist/agent/model/approval-judge.js.map +1 -1
- package/dist/agent/model/dream-judge.d.ts +2 -0
- package/dist/agent/model/dream-judge.d.ts.map +1 -1
- package/dist/agent/model/dream-judge.js +6 -4
- package/dist/agent/model/dream-judge.js.map +1 -1
- package/dist/agent/model/gateway-probe.d.ts +22 -4
- package/dist/agent/model/gateway-probe.d.ts.map +1 -1
- package/dist/agent/model/gateway-probe.js +78 -11
- package/dist/agent/model/gateway-probe.js.map +1 -1
- package/dist/agent/model/gateway-vision.d.ts +4 -2
- package/dist/agent/model/gateway-vision.d.ts.map +1 -1
- package/dist/agent/model/gateway-vision.js +6 -4
- package/dist/agent/model/gateway-vision.js.map +1 -1
- package/dist/agent/model/gateway.d.ts +85 -12
- package/dist/agent/model/gateway.d.ts.map +1 -1
- package/dist/agent/model/gateway.js +418 -30
- package/dist/agent/model/gateway.js.map +1 -1
- package/dist/agent/model/meeting-gateway.d.ts +8 -2
- package/dist/agent/model/meeting-gateway.d.ts.map +1 -1
- package/dist/agent/model/meeting-gateway.js +29 -7
- package/dist/agent/model/meeting-gateway.js.map +1 -1
- package/dist/agent/model/model-config-check.d.ts +57 -0
- package/dist/agent/model/model-config-check.d.ts.map +1 -0
- package/dist/agent/model/model-config-check.js +207 -0
- package/dist/agent/model/model-config-check.js.map +1 -0
- package/dist/agent/model/target-url.d.ts +10 -0
- package/dist/agent/model/target-url.d.ts.map +1 -0
- package/dist/agent/model/target-url.js +32 -0
- package/dist/agent/model/target-url.js.map +1 -0
- package/dist/agent/model/transcription-routes.d.ts +3 -0
- package/dist/agent/model/transcription-routes.d.ts.map +1 -1
- package/dist/agent/model/transcription-routes.js +16 -4
- package/dist/agent/model/transcription-routes.js.map +1 -1
- package/dist/agent/oe-oauth/errors.d.ts +0 -7
- package/dist/agent/oe-oauth/errors.d.ts.map +1 -1
- package/dist/agent/oe-oauth/errors.js +1 -1
- package/dist/agent/oe-oauth/errors.js.map +1 -1
- package/dist/agent/oe-oauth/token-vault.d.ts +4 -3
- package/dist/agent/oe-oauth/token-vault.d.ts.map +1 -1
- package/dist/agent/oe-oauth/token-vault.js +88 -24
- package/dist/agent/oe-oauth/token-vault.js.map +1 -1
- package/dist/agent/oe-oauth/user-auth-flow.d.ts.map +1 -1
- package/dist/agent/oe-oauth/user-auth-flow.js +3 -2
- package/dist/agent/oe-oauth/user-auth-flow.js.map +1 -1
- package/dist/agent/operator-holders.d.ts +13 -0
- package/dist/agent/operator-holders.d.ts.map +1 -0
- package/dist/agent/operator-holders.js +40 -0
- package/dist/agent/operator-holders.js.map +1 -0
- package/dist/agent/postgres/neon.d.ts +0 -15
- package/dist/agent/postgres/neon.d.ts.map +1 -1
- package/dist/agent/postgres/neon.js +1 -1
- package/dist/agent/postgres/neon.js.map +1 -1
- package/package.json +19 -2
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
// The Vercel AI Gateway model backend — the reference `ModelBackend`.
|
|
2
|
-
//
|
|
1
|
+
// The Vercel AI Gateway model backend — the reference `ModelBackend`. It serves every `models.targets` entry of kind
|
|
2
|
+
// `vercel-ai-gateway` (OPE-2556): one provider per target, built at the target's first call from its `url`. The target's
|
|
3
|
+
// `providers.only` is a demand on every call through it; its `providers.order` and a route's `providerOrder` are
|
|
4
|
+
// preferences. A route or a stack role picks its target with `via` (absent: `gateway`).
|
|
5
|
+
//
|
|
6
|
+
// 🔴 THE ONE MODEL ADAPTER (OPE-2535). Every model call of this process reaches the gateway through THIS file:
|
|
7
|
+
// the turn model, the side calls (dream, facet and approval judges, meeting recap, image describer, gateway
|
|
8
|
+
// transcription), and a bare model id string (a declared subagent's `model`), which the AI SDK resolves through
|
|
9
|
+
// the default provider this module installs. That provider sends each bare id through the target of the role that
|
|
10
|
+
// names it, else the primary role's target (OPE-2566, core model/bare-model-via.ts). An app that registers no roles
|
|
11
|
+
// sends every bare id through `gateway`, and the process says so once when another target exists.
|
|
12
|
+
// Every model it hands out carries `models.dataPolicy` on every call (`policyModel`). A call that cannot carry the rows (a realtime client secret, a streaming-transcription token)
|
|
13
|
+
// refuses under a policy or a `providers.only` row. Two exceptions: under `eve dev` eve resolves a literal id through its own local gateway, and a
|
|
14
|
+
// default provider another module set first is kept behind a guard that refuses under a policy, and for a bare id whose target is not `gateway`. `npm run lint:model-adapter` refuses a module elsewhere that builds a gateway model itself.
|
|
3
15
|
import { gateway, createGateway } from "ai";
|
|
4
|
-
import { hostPlaneFetch, hostPlanePolicy, liveIdentity, resolvePrimaryModel, } from "@open-everywhere/core/agent/adapter-api.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
16
|
+
import { DEFAULT_MODEL_VIA, bareModelRoutesRegistered, bareModelVia, dataPolicyActive, dataPolicyRows, mergeDataPolicy, getSettings, hostPlaneFetch, hostPlanePolicy, liveIdentity, modelTargetFor, resolvePrimaryModel, useSelfHostEgress, } from "@open-everywhere/core/agent/adapter-api.js";
|
|
17
|
+
import { targetBaseUrl } from "./target-url.js";
|
|
18
|
+
export { DEPRECATED_GATEWAY_URL_ENV, targetBaseUrl } from "./target-url.js";
|
|
19
|
+
/** The deployment's targets, read at CALL time: settings register after this module loads. */
|
|
20
|
+
function currentTargets() {
|
|
21
|
+
return getSettings().models.targets;
|
|
22
|
+
}
|
|
10
23
|
/** The gateway's own host when {@link GATEWAY_BASE_URL} is unset. It must match the `ai` package's default base URL. */
|
|
11
24
|
export const DEFAULT_GATEWAY_HOST = "ai-gateway.vercel.sh";
|
|
12
25
|
/** The one host the model call reaches: the retarget's host, else the default. An unparseable retarget falls back to the default host. */
|
|
@@ -20,8 +33,22 @@ export function gatewayHost(baseUrl) {
|
|
|
20
33
|
return DEFAULT_GATEWAY_HOST;
|
|
21
34
|
}
|
|
22
35
|
}
|
|
23
|
-
/** The
|
|
24
|
-
|
|
36
|
+
/** The base URL each target resolved at its first use. READ ONCE per process: a target that changed mid-process
|
|
37
|
+
* would send two calls in one turn to two places. A change needs a restart. */
|
|
38
|
+
const TARGET_URLS = new Map();
|
|
39
|
+
function resolvedTargetUrl(name) {
|
|
40
|
+
if (!TARGET_URLS.has(name))
|
|
41
|
+
TARGET_URLS.set(name, targetBaseUrl(name, modelTargetFor(name, currentTargets())));
|
|
42
|
+
return TARGET_URLS.get(name);
|
|
43
|
+
}
|
|
44
|
+
/** The one host the `gateway` target's calls reach (its `url`, else the deprecated env var, else the default). */
|
|
45
|
+
export function gatewayTargetHost() {
|
|
46
|
+
return gatewayHost(resolvedTargetUrl(DEFAULT_MODEL_VIA));
|
|
47
|
+
}
|
|
48
|
+
/** The hosts of every configured target — what every host-plane push must keep declaring. */
|
|
49
|
+
function targetHosts() {
|
|
50
|
+
return Object.keys(currentTargets()).map((name) => gatewayHost(resolvedTargetUrl(name)));
|
|
51
|
+
}
|
|
25
52
|
/**
|
|
26
53
|
* THE HOST-PLANE UNION (OPE-2470). The proxy REPLACES its host plane on every push; it never merges
|
|
27
54
|
* (deploy/egress-proxy/control/handlers.ts `setHostPlane`). So this process keeps ONE host set, and every
|
|
@@ -29,9 +56,20 @@ export const GATEWAY_TARGET_HOST = gatewayHost(GATEWAY_BASE_URL);
|
|
|
29
56
|
* non-gateway transcription routes never push lists that drop each other. A caller adds its hosts with
|
|
30
57
|
* {@link sharedHostPlaneFetch} at boot; a grown set builds a new fetch, which pushes the union on its next call.
|
|
31
58
|
*/
|
|
32
|
-
const HOST_PLANE_HOSTS = [
|
|
33
|
-
let hostPlaneCurrent
|
|
34
|
-
let hostPlaneBuiltFor =
|
|
59
|
+
const HOST_PLANE_HOSTS = [];
|
|
60
|
+
let hostPlaneCurrent;
|
|
61
|
+
let hostPlaneBuiltFor = -1;
|
|
62
|
+
let targetHostsSeeded = false;
|
|
63
|
+
/** Add every target's host to the host plane, once. At CALL time: the targets are settings, which register after this
|
|
64
|
+
* module loads. */
|
|
65
|
+
function seedTargetHosts() {
|
|
66
|
+
if (targetHostsSeeded)
|
|
67
|
+
return;
|
|
68
|
+
targetHostsSeeded = true;
|
|
69
|
+
for (const h of targetHosts())
|
|
70
|
+
if (!HOST_PLANE_HOSTS.includes(h))
|
|
71
|
+
HOST_PLANE_HOSTS.unshift(h);
|
|
72
|
+
}
|
|
35
73
|
/**
|
|
36
74
|
* THE MODEL CALL'S TRANSPORT ON THE SELF-HOST PROXY TIER (OPE-2406). With an egress proxy wired, the model call goes out
|
|
37
75
|
* on the app's HOST PLANE: the proxy decides it against the host-plane list (the gateway host, plus the hosts of any
|
|
@@ -39,10 +77,11 @@ let hostPlaneBuiltFor = HOST_PLANE_HOSTS.length;
|
|
|
39
77
|
* its model while the session stays default-deny. Off that tier it is `undefined` and the provider keeps its default
|
|
40
78
|
* fetch, byte-identical to before. On it, the fetch always uses the newest union.
|
|
41
79
|
*/
|
|
42
|
-
const HOST_PLANE_FETCH =
|
|
80
|
+
const HOST_PLANE_FETCH = !useSelfHostEgress()
|
|
43
81
|
? undefined
|
|
44
82
|
: (input, init) => {
|
|
45
|
-
|
|
83
|
+
seedTargetHosts();
|
|
84
|
+
if (hostPlaneCurrent === undefined || hostPlaneBuiltFor !== HOST_PLANE_HOSTS.length) {
|
|
46
85
|
hostPlaneCurrent = hostPlaneFetch(HOST_PLANE_HOSTS);
|
|
47
86
|
hostPlaneBuiltFor = HOST_PLANE_HOSTS.length;
|
|
48
87
|
}
|
|
@@ -53,23 +92,372 @@ export function sharedHostPlaneFetch(hosts) {
|
|
|
53
92
|
// Validate BEFORE the list grows: a wildcard host throws here, at registration, and never reaches the shared list,
|
|
54
93
|
// where it would fail every model turn at the next rebuild. A blank name is skipped.
|
|
55
94
|
const named = hosts.map((h) => h.trim()).filter((h) => h !== "");
|
|
56
|
-
if (HOST_PLANE_FETCH !== undefined)
|
|
57
|
-
hostPlanePolicy(
|
|
95
|
+
if (HOST_PLANE_FETCH !== undefined && named.length > 0)
|
|
96
|
+
hostPlanePolicy(named);
|
|
58
97
|
for (const h of named)
|
|
59
98
|
if (!HOST_PLANE_HOSTS.includes(h))
|
|
60
99
|
HOST_PLANE_HOSTS.push(h);
|
|
61
100
|
return HOST_PLANE_FETCH;
|
|
62
101
|
}
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
102
|
+
/** One gateway provider per target, built at the target's first call. A target with no url off the proxy tier is the
|
|
103
|
+
* plain `gateway` export, byte-identical to before. */
|
|
104
|
+
const TARGET_PROVIDERS = new Map();
|
|
105
|
+
function targetProvider(via) {
|
|
106
|
+
const name = via ?? DEFAULT_MODEL_VIA;
|
|
107
|
+
let p = TARGET_PROVIDERS.get(name);
|
|
108
|
+
if (p === undefined) {
|
|
109
|
+
const baseURL = resolvedTargetUrl(name);
|
|
110
|
+
p =
|
|
111
|
+
baseURL !== undefined || HOST_PLANE_FETCH !== undefined
|
|
112
|
+
? createGateway({ ...(baseURL !== undefined ? { baseURL } : {}), ...(HOST_PLANE_FETCH !== undefined ? { fetch: HOST_PLANE_FETCH } : {}) })
|
|
113
|
+
: gateway;
|
|
114
|
+
TARGET_PROVIDERS.set(name, p);
|
|
115
|
+
}
|
|
116
|
+
return p;
|
|
117
|
+
}
|
|
118
|
+
// ── the data policy (OPE-2535) ─────────────────────────────────────────────────────────────────────
|
|
119
|
+
/**
|
|
120
|
+
* The Vercel AI Gateway options for one `models.dataPolicy`. Pure. An absent row adds no key, so the shipped `{}`
|
|
121
|
+
* changes no request byte.
|
|
122
|
+
*/
|
|
123
|
+
export function vercelDataPolicyOptions(p) {
|
|
124
|
+
return {
|
|
125
|
+
...(p.zeroRetention === true ? { zeroDataRetention: true } : {}),
|
|
126
|
+
...(p.noTraining === true ? { disallowPromptTraining: true } : {}),
|
|
127
|
+
...(p.region !== undefined ? { inferenceRegion: { scope: "zone", geoRegion: p.region } } : {}),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Put the policy on one call's options. Pure. The policy's keys WIN over the call's own gateway keys, so a call
|
|
132
|
+
* cannot weaken a row (`zeroDataRetention: false` on a call is overwritten). Every other key passes through. A
|
|
133
|
+
* policy that demands nothing returns the options unchanged.
|
|
134
|
+
*/
|
|
135
|
+
export function withDataPolicy(options, p) {
|
|
136
|
+
return withTargetRows(options, undefined, p);
|
|
137
|
+
}
|
|
138
|
+
/** Whether a target or a policy demands anything of a call: a `models.dataPolicy` row, a `providers.only` row, or a
|
|
139
|
+
* row of the target's own `dataPolicy`. */
|
|
140
|
+
function demandsAnything(t, p) {
|
|
141
|
+
return dataPolicyActive(p) || (t?.providers?.only?.length ?? 0) > 0 || (t?.dataPolicy !== undefined && dataPolicyActive(t.dataPolicy));
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The demands on a call, in the words of the settings file, for an error: `models.dataPolicy (region eu)`,
|
|
145
|
+
* `models.targets.gateway.providers.only (openai, azure)`, `models.targets.mistral.dataPolicy (zeroRetention)`, or
|
|
146
|
+
* several joined with " + ".
|
|
147
|
+
*/
|
|
148
|
+
export function demandLabel(p, t, via = DEFAULT_MODEL_VIA) {
|
|
149
|
+
const parts = [];
|
|
150
|
+
if (dataPolicyActive(p))
|
|
151
|
+
parts.push(`models.dataPolicy (${dataPolicyRows(p).join(", ")})`);
|
|
152
|
+
const only = t?.providers?.only;
|
|
153
|
+
if (only !== undefined && only.length > 0)
|
|
154
|
+
parts.push(`models.targets.${via}.providers.only (${only.join(", ")})`);
|
|
155
|
+
if (t?.dataPolicy !== undefined && dataPolicyActive(t.dataPolicy))
|
|
156
|
+
parts.push(`models.targets.${via}.dataPolicy (${dataPolicyRows(t.dataPolicy).join(", ")})`);
|
|
157
|
+
return parts.join(" + ");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Put a target's rows and the data policy on one call's options. Pure but for a refusal. The order of the merge:
|
|
161
|
+
* 1. the target's `options` are a FLOOR: a call's own key wins;
|
|
162
|
+
* 2. the target's `providers.order` applies when the call names no `order` (a route's `providerOrder` wins);
|
|
163
|
+
* 3. the target's `providers.only` is a DEMAND: a call's own `only` narrows it to the intersection, and an empty
|
|
164
|
+
* intersection REFUSES (an empty `only` would read as no filter at all);
|
|
165
|
+
* 4. the policy's keys win over everything. The policy is `models.dataPolicy` plus the target's own `dataPolicy` rows
|
|
166
|
+
* (OPE-2531): a target adds rows and never removes one.
|
|
167
|
+
* A target with no rows and a policy that demands nothing return the options unchanged, so the shipped value changes
|
|
168
|
+
* no request byte.
|
|
169
|
+
*/
|
|
170
|
+
export function withTargetRows(options, t, global, via = DEFAULT_MODEL_VIA) {
|
|
171
|
+
const floor = t?.options;
|
|
172
|
+
const only = t?.providers?.only;
|
|
173
|
+
const order = t?.providers?.order;
|
|
174
|
+
let p;
|
|
175
|
+
try {
|
|
176
|
+
p = mergeDataPolicy(global, t?.dataPolicy);
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
throw new Error(`models.targets.${via}.dataPolicy: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
180
|
+
}
|
|
181
|
+
if (floor === undefined && only === undefined && order === undefined && !dataPolicyActive(p))
|
|
182
|
+
return options;
|
|
183
|
+
const gw = (options.providerOptions?.["gateway"] ?? {});
|
|
184
|
+
const merged = { ...floor, ...gw };
|
|
185
|
+
if (order !== undefined && merged["order"] === undefined)
|
|
186
|
+
merged["order"] = [...order];
|
|
187
|
+
if (only !== undefined) {
|
|
188
|
+
const own = Array.isArray(gw["only"]) ? gw["only"] : undefined;
|
|
189
|
+
const allowed = own === undefined ? [...only] : own.filter((s) => typeof s === "string" && only.includes(s));
|
|
190
|
+
if (allowed.length === 0) {
|
|
191
|
+
throw new Error(`${demandLabel(global, t, via)}: the call's own provider list (${(own ?? []).join(", ")}) shares no provider with the target's, so it refuses`);
|
|
192
|
+
}
|
|
193
|
+
merged["only"] = allowed;
|
|
194
|
+
}
|
|
195
|
+
Object.assign(merged, vercelDataPolicyOptions(p));
|
|
196
|
+
return { ...options, providerOptions: { ...options.providerOptions, gateway: merged } };
|
|
197
|
+
}
|
|
198
|
+
/** The gateway's refusal when no provider meets a filter (a 400 `invalid_request_error`). Live text, 2026-10-14: "No provider for <id> supports the
|
|
199
|
+
* requested inference region." and "No available providers match the 'only' filter". The SDK keeps only the
|
|
200
|
+
* message (the error type is the generic `invalid_request_error`), so the match is on the text. */
|
|
201
|
+
const NO_PROVIDER = /\bno (?:available )?providers?\b/i;
|
|
202
|
+
/**
|
|
203
|
+
* Name the policy rows on a refusal the policy caused. A model with no provider that meets the rows fails with an
|
|
204
|
+
* error that says which rows, and which model: "models.dataPolicy (region eu): no provider serves …". Any other
|
|
205
|
+
* error, or any error with no policy set, passes through unchanged.
|
|
206
|
+
*/
|
|
207
|
+
export function dataPolicyCallError(modelId, p, err, t, via) {
|
|
208
|
+
if (!demandsAnything(t, p))
|
|
209
|
+
return err;
|
|
210
|
+
// Only a non-retryable 4xx is the policy's refusal. A 5xx with the same words is an outage: it passes unchanged,
|
|
211
|
+
// with its status and its retry flag, and it does not blame the rows.
|
|
212
|
+
const e = err;
|
|
213
|
+
if (typeof e?.statusCode !== "number" || e.statusCode < 400 || e.statusCode >= 500 || e.isRetryable === true)
|
|
214
|
+
return err;
|
|
215
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
216
|
+
if (!NO_PROVIDER.test(msg))
|
|
217
|
+
return err;
|
|
218
|
+
return new Error(`${demandLabel(p, t, via)}: no provider serves "${modelId}" under these rows. The call fails closed and does not fall back. Gateway said: ${msg}`, { cause: err });
|
|
219
|
+
}
|
|
220
|
+
/** The deployment's data policy, read at CALL time: settings register after this module loads. */
|
|
221
|
+
function currentDataPolicy() {
|
|
222
|
+
return getSettings().models.dataPolicy;
|
|
223
|
+
}
|
|
224
|
+
/** The model methods that send a request: every `do*` member (`doGenerate`, `doStream`, `doEmbed`, `doEvaluate`,
|
|
225
|
+
* `doRerank`, video's `doStart`, batch's `doStartBatch`, …). Each takes the call options first. */
|
|
226
|
+
const CALL_METHOD = /^do[A-Z]/;
|
|
227
|
+
/** Call methods that send no `providerOptions` at all, so the rows cannot ride them: the realtime client secret.
|
|
228
|
+
* Under a policy they refuse. */
|
|
229
|
+
const ROWLESS_METHODS = new Set(["doCreateClientSecret"]);
|
|
230
|
+
/** Put the rows on a call's options, and for a batch on each request's own options too: the SDK sends a batch
|
|
231
|
+
* request's `providerOptions` per request, so the top-level merge alone would leave a request's own `false`. */
|
|
232
|
+
function withRowsFor(prop, options, t, p, via) {
|
|
233
|
+
const merged = withTargetRows(options, t, p, via);
|
|
234
|
+
const requests = merged.requests;
|
|
235
|
+
if (prop !== "doStartBatch" || merged === options || !Array.isArray(requests))
|
|
236
|
+
return merged;
|
|
237
|
+
return {
|
|
238
|
+
...merged,
|
|
239
|
+
requests: requests.map((r) => {
|
|
240
|
+
const req = r;
|
|
241
|
+
return req !== null && typeof req === "object" ? { ...req, options: withTargetRows(req.options ?? {}, t, p, via) } : r;
|
|
242
|
+
}),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
/** The target a `via` names, read at CALL time. An unknown name throws: a call never guesses a target. */
|
|
246
|
+
function currentTarget(via) {
|
|
247
|
+
return modelTargetFor(via, currentTargets());
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Copy a provider member's own properties onto its wrapper. A function among them (`experimental_transcription.getToken`)
|
|
251
|
+
* mints a session token from the RAW model, and the client then opens the session itself, so the rows cannot ride it:
|
|
252
|
+
* under a policy it refuses. Used by both the policy provider and the foreign-provider guard.
|
|
253
|
+
*/
|
|
254
|
+
function withGuardedMemberProps(wrapped, member, name, via = DEFAULT_MODEL_VIA) {
|
|
255
|
+
for (const [k, v] of Object.entries(member)) {
|
|
256
|
+
wrapped[k] =
|
|
257
|
+
typeof v === "function"
|
|
258
|
+
? (...args) => {
|
|
259
|
+
const p = currentDataPolicy();
|
|
260
|
+
const t = currentTarget(via);
|
|
261
|
+
if (demandsAnything(t, p))
|
|
262
|
+
throw rowlessRefusal(p, `${name}.${k}`, t, via);
|
|
263
|
+
return v.apply(member, args);
|
|
264
|
+
}
|
|
265
|
+
: v;
|
|
266
|
+
}
|
|
267
|
+
return wrapped;
|
|
268
|
+
}
|
|
269
|
+
/** Refuse a call that cannot carry the rows. */
|
|
270
|
+
function rowlessRefusal(p, what, t, via) {
|
|
271
|
+
return new Error(`${demandLabel(p, t, via)}: ${what} cannot carry the rows, so it refuses`);
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* A model that carries the data policy on EVERY call it sends. A Proxy, so the model keeps its class, its
|
|
275
|
+
* `provider`, its `modelId` and every other member: eve and the AI SDK see the same object shape. Only the calls
|
|
276
|
+
* change: the policy merges into the options, and a refusal it caused names the rows.
|
|
277
|
+
*/
|
|
278
|
+
export function policyModel(model, via = DEFAULT_MODEL_VIA) {
|
|
279
|
+
return new Proxy(model, {
|
|
280
|
+
get(target, prop, receiver) {
|
|
281
|
+
const value = Reflect.get(target, prop, receiver);
|
|
282
|
+
if (typeof prop !== "string" || !CALL_METHOD.test(prop) || typeof value !== "function")
|
|
283
|
+
return value;
|
|
284
|
+
return async (options, ...rest) => {
|
|
285
|
+
const p = currentDataPolicy();
|
|
286
|
+
const t = currentTarget(via);
|
|
287
|
+
// A first argument that is not an options object has no `providerOptions` to carry the rows: refuse it under a
|
|
288
|
+
// demand rather than send it bare.
|
|
289
|
+
const isOptions = options !== null && typeof options === "object" && !Array.isArray(options);
|
|
290
|
+
if ((!isOptions || ROWLESS_METHODS.has(prop)) && demandsAnything(t, p))
|
|
291
|
+
throw rowlessRefusal(p, prop, t, via);
|
|
292
|
+
const sent = isOptions ? withRowsFor(prop, options, t, p, via) : options;
|
|
293
|
+
try {
|
|
294
|
+
return await value.call(receiver, sent, ...rest);
|
|
295
|
+
}
|
|
296
|
+
catch (err) {
|
|
297
|
+
throw dataPolicyCallError(String(target.modelId ?? "?"), p, err, t, via);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/** A gateway LANGUAGE model on the target `via` names (absent: `gateway`), with its url and the host-plane fetch,
|
|
304
|
+
* carrying the target's rows and the data policy. The one way a module outside this file gets a gateway model. */
|
|
305
|
+
export function gatewayLanguageModel(id, via) {
|
|
306
|
+
return policyModel(targetProvider(via)(id), via ?? DEFAULT_MODEL_VIA);
|
|
307
|
+
}
|
|
308
|
+
/** Marks the policy provider, across bundle copies of this module, so a second copy does not mistake it for a
|
|
309
|
+
* foreign provider. Answered by the proxy; the gateway provider itself is never written to. */
|
|
310
|
+
const OWN_PROVIDER = Symbol.for("open-everywhere.gateway.policyProvider");
|
|
311
|
+
/** The provider members that build nothing that sends a prompt: account reads and the tool catalogue. */
|
|
312
|
+
const NON_MODEL_MEMBERS = new Set(["getAvailableModels", "getCredits", "getSpendReport", "getGenerationInfo", "tools"]);
|
|
313
|
+
/**
|
|
314
|
+
* A provider whose every model-building member (`languageModel`, its `chat` alias, `evaluationModel`, `reranking`,
|
|
315
|
+
* `experimental_batch`, …) hands out policy models. A denylist, not an allow-list: a member the SDK adds later is
|
|
316
|
+
* wrapped by default. A member's own properties (`experimental_transcription.getToken`) stay on it.
|
|
317
|
+
*/
|
|
318
|
+
export function policyProvider(base) {
|
|
319
|
+
return new Proxy(base, {
|
|
320
|
+
apply(target, thisArg, args) {
|
|
321
|
+
const m = Reflect.apply(target, thisArg, args);
|
|
322
|
+
return m !== null && typeof m === "object" ? policyModel(m) : m;
|
|
323
|
+
},
|
|
324
|
+
get(target, prop, receiver) {
|
|
325
|
+
if (prop === OWN_PROVIDER)
|
|
326
|
+
return true;
|
|
327
|
+
const value = Reflect.get(target, prop, receiver);
|
|
328
|
+
if (typeof value !== "function" || NON_MODEL_MEMBERS.has(prop))
|
|
329
|
+
return value;
|
|
330
|
+
const wrapped = (...args) => {
|
|
331
|
+
const m = value.apply(target, args);
|
|
332
|
+
return m !== null && typeof m === "object" ? policyModel(m) : m;
|
|
333
|
+
};
|
|
334
|
+
return withGuardedMemberProps(wrapped, value, String(prop));
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
/** The target a member call's bare id goes through: its first argument, else the deployment default. */
|
|
339
|
+
function bareViaOf(args) {
|
|
340
|
+
noteUnregisteredBareIds();
|
|
341
|
+
return bareModelVia(typeof args[0] === "string" ? args[0] : "").via;
|
|
342
|
+
}
|
|
343
|
+
let bareGapNoted = false;
|
|
344
|
+
/**
|
|
345
|
+
* An app that does not register its roles (`agent/model/models.ts` from before 0.8.0) sends every bare id through
|
|
346
|
+
* `gateway`. When `models.targets` names another target, that may leave the target a role names, so the process says so
|
|
347
|
+
* once, at the first bare-id call, and the call goes on through `gateway` (OPE-2566). An all-gateway app logs nothing.
|
|
348
|
+
*/
|
|
349
|
+
function noteUnregisteredBareIds() {
|
|
350
|
+
if (bareGapNoted || bareModelRoutesRegistered())
|
|
351
|
+
return;
|
|
352
|
+
if (!Object.keys(currentTargets()).some((k) => k !== DEFAULT_MODEL_VIA))
|
|
353
|
+
return;
|
|
354
|
+
bareGapNoted = true;
|
|
355
|
+
console.error("[open-everywhere:model] a bare model id (a declared subagent's model, eve evaluate()) goes via gateway, because agent/model/models.ts " +
|
|
356
|
+
"does not call registerBareModelRoutes. Add the line from the 0.8.0 template so it takes its role's target. npm run check:model-config names this too.");
|
|
357
|
+
}
|
|
358
|
+
/** Test seam: let the next bare-id call note the gap again. */
|
|
359
|
+
export function _resetBareGapNoticeForTest() {
|
|
360
|
+
bareGapNoted = false;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* THE BARE-ID PROVIDER (OPE-2566). A provider that sends each bare id through the target its role names
|
|
364
|
+
* (core model/bare-model-via.ts): the role that names the id, else the primary role's target, else `gateway`. Every
|
|
365
|
+
* model it builds is a policy model on that target, so the target's url, provider pin and data-policy rows ride the
|
|
366
|
+
* call. It reads the table at CALL time: the app registers its roles after this module loads. A member's own
|
|
367
|
+
* properties (`experimental_transcription.getToken`) and the account reads use the deployment default's target.
|
|
368
|
+
* Exported for tests.
|
|
369
|
+
*/
|
|
370
|
+
export function bareIdProvider() {
|
|
371
|
+
const build = (prop, args) => {
|
|
372
|
+
const via = bareViaOf(args);
|
|
373
|
+
const p = targetProvider(via);
|
|
374
|
+
const m = prop === undefined ? Reflect.apply(p, undefined, args) : Reflect.get(p, prop).apply(p, args);
|
|
375
|
+
return m !== null && typeof m === "object" ? policyModel(m, via) : m;
|
|
376
|
+
};
|
|
377
|
+
return new Proxy(function bareIdGateway() { }, {
|
|
378
|
+
apply: (_t, _thisArg, args) => build(undefined, args),
|
|
379
|
+
get: (_t, prop) => {
|
|
380
|
+
if (prop === OWN_PROVIDER)
|
|
381
|
+
return true;
|
|
382
|
+
const via = bareModelVia("").via;
|
|
383
|
+
const value = Reflect.get(targetProvider(via), prop);
|
|
384
|
+
if (typeof value !== "function" || NON_MODEL_MEMBERS.has(prop))
|
|
385
|
+
return value;
|
|
386
|
+
return withGuardedMemberProps((...args) => build(prop, args), value, String(prop), via);
|
|
387
|
+
},
|
|
388
|
+
has: (_t, prop) => prop === OWN_PROVIDER || Reflect.has(targetProvider(bareModelVia("").via), prop),
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* THE DEFAULT PROVIDER. The AI SDK resolves a bare model id string through `globalThis.AI_SDK_DEFAULT_PROVIDER`,
|
|
393
|
+
* else its own plain `gateway`. eve passes a declared subagent's `model: "<id>"` to the SDK as that string, and
|
|
394
|
+
* eve's own `evaluate()` (auto-approval, auto routing, agentRouter) does the same. Without this those calls skip the
|
|
395
|
+
* data policy, the retarget and the host plane. This installs the bare-id provider there, so each call also goes
|
|
396
|
+
* through its role's target (OPE-2566).
|
|
397
|
+
*
|
|
398
|
+
* 🔴 A PROVIDER ANOTHER MODULE ALREADY SET is kept, because that module chose it. But it is not this adapter's, so
|
|
399
|
+
* it cannot carry the rows: under a data policy every call through it REFUSES (fail closed), and the boot says so.
|
|
400
|
+
*/
|
|
401
|
+
const sdkGlobal = globalThis;
|
|
402
|
+
const installed = sdkGlobal.AI_SDK_DEFAULT_PROVIDER;
|
|
403
|
+
if (installed === undefined || installed === null) {
|
|
404
|
+
sdkGlobal.AI_SDK_DEFAULT_PROVIDER = bareIdProvider();
|
|
405
|
+
}
|
|
406
|
+
else if ((typeof installed === "object" || typeof installed === "function") && installed !== null && installed[OWN_PROVIDER] !== true) {
|
|
407
|
+
console.error("[open-everywhere:model] AI_SDK_DEFAULT_PROVIDER was already set by another module. A bare model id resolves through it, " +
|
|
408
|
+
"and it cannot carry models.dataPolicy, so under a data policy every such call refuses.");
|
|
409
|
+
sdkGlobal.AI_SDK_DEFAULT_PROVIDER = foreignProviderGuard(installed);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* A foreign default provider, kept, behind a guard: with no policy it is untouched; under a policy every model call
|
|
413
|
+
* through it refuses, because nothing proves that provider honours the rows. The guard reads the target the bare id
|
|
414
|
+
* goes through (OPE-2566): that target's rows count, and a target other than `gateway` refuses too, because the
|
|
415
|
+
* foreign provider would send the call somewhere else. Exported for tests.
|
|
416
|
+
*/
|
|
417
|
+
export function foreignProviderGuard(base) {
|
|
418
|
+
const guardModel = (m, via) => new Proxy(m, {
|
|
419
|
+
get(target, prop, receiver) {
|
|
420
|
+
const value = Reflect.get(target, prop, receiver);
|
|
421
|
+
if (typeof prop !== "string" || !CALL_METHOD.test(prop) || typeof value !== "function")
|
|
422
|
+
return value;
|
|
423
|
+
return async (...args) => {
|
|
424
|
+
if (via !== DEFAULT_MODEL_VIA) {
|
|
425
|
+
throw new Error(`this call goes through the target "${via}", but it resolved through a default provider that is not the gateway adapter's, so it cannot reach that target, and it refuses`);
|
|
426
|
+
}
|
|
427
|
+
const p = currentDataPolicy();
|
|
428
|
+
const t = currentTarget(via);
|
|
429
|
+
if (demandsAnything(t, p)) {
|
|
430
|
+
throw new Error(`${demandLabel(p, t)}: this call resolved through a default provider that is not the gateway adapter's, so it cannot carry the rows, and it refuses`);
|
|
431
|
+
}
|
|
432
|
+
return await value.apply(receiver, args);
|
|
433
|
+
};
|
|
434
|
+
},
|
|
435
|
+
});
|
|
436
|
+
return new Proxy(base, {
|
|
437
|
+
apply(target, thisArg, args) {
|
|
438
|
+
const m = Reflect.apply(target, thisArg, args);
|
|
439
|
+
return m !== null && typeof m === "object" ? guardModel(m, bareViaOf(args)) : m;
|
|
440
|
+
},
|
|
441
|
+
get(target, prop, receiver) {
|
|
442
|
+
// A second bundle copy of this module must not guard (and report) the same provider twice.
|
|
443
|
+
if (prop === OWN_PROVIDER)
|
|
444
|
+
return true;
|
|
445
|
+
const value = Reflect.get(target, prop, receiver);
|
|
446
|
+
if (typeof value !== "function" || NON_MODEL_MEMBERS.has(prop))
|
|
447
|
+
return value;
|
|
448
|
+
return withGuardedMemberProps((...args) => {
|
|
449
|
+
const m = value.apply(target, args);
|
|
450
|
+
return m !== null && typeof m === "object" ? guardModel(m, bareViaOf(args)) : m;
|
|
451
|
+
}, value, String(prop));
|
|
452
|
+
},
|
|
453
|
+
});
|
|
454
|
+
}
|
|
68
455
|
/** Gateway pin keys a route replaces — a pin belongs to the id it was set with. */
|
|
69
456
|
const PIN_KEYS = ["only", "order"];
|
|
70
457
|
/**
|
|
71
458
|
* Map a route's provider hints onto one call's gateway options. Pure. A MODEL CHANGE strips the pin keys — a
|
|
72
|
-
* pin set for one model is broken for another — and a route's `
|
|
459
|
+
* pin set for one model is broken for another — and a route's `providerOrder` becomes `order`, never `only`. The
|
|
460
|
+
* target's own rows (`providers.only`, `providers.order`, `options`) join later, on every call (`withTargetRows`).
|
|
73
461
|
*/
|
|
74
462
|
export function applyGatewayOptions(route, options, ids, defaults) {
|
|
75
463
|
const base = (options.providerOptions?.gateway ?? defaults);
|
|
@@ -79,8 +467,8 @@ export function applyGatewayOptions(route, options, ids, defaults) {
|
|
|
79
467
|
for (const k of PIN_KEYS)
|
|
80
468
|
delete gatewayOpts[k];
|
|
81
469
|
}
|
|
82
|
-
if (route.
|
|
83
|
-
gatewayOpts = { ...(gatewayOpts ?? {}), order: [...route.
|
|
470
|
+
if (route.providerOrder !== undefined) {
|
|
471
|
+
gatewayOpts = { ...(gatewayOpts ?? {}), order: [...route.providerOrder] };
|
|
84
472
|
delete gatewayOpts["only"];
|
|
85
473
|
}
|
|
86
474
|
if (gatewayOpts === undefined)
|
|
@@ -90,12 +478,12 @@ export function applyGatewayOptions(route, options, ids, defaults) {
|
|
|
90
478
|
/** A gateway TRANSCRIPTION model, on the same provider (retarget and host-plane fetch included) the turn
|
|
91
479
|
* model uses. The meeting bot's `gateway` route (meeting-gateway.ts) reads it. */
|
|
92
480
|
export function gatewayTranscriptionModel(id) {
|
|
93
|
-
return
|
|
481
|
+
return policyModel(targetProvider(DEFAULT_MODEL_VIA).transcriptionModel(id));
|
|
94
482
|
}
|
|
95
|
-
/** The gateway ModelBackend (see core ModelBackend). */
|
|
96
|
-
export function gatewayModelBackend(defaults) {
|
|
483
|
+
/** The gateway ModelBackend (see core ModelBackend). `via` is the role's target; a route's own `via` wins. */
|
|
484
|
+
export function gatewayModelBackend(defaults, via) {
|
|
97
485
|
return {
|
|
98
|
-
model: (id) =>
|
|
486
|
+
model: (id, routeVia) => gatewayLanguageModel(id, routeVia ?? via),
|
|
99
487
|
applyOptions: (route, options, ids) => applyGatewayOptions(route, options, ids, defaults),
|
|
100
488
|
};
|
|
101
489
|
}
|
|
@@ -104,7 +492,7 @@ export function gatewayModelBackend(defaults) {
|
|
|
104
492
|
* scope. It ALWAYS returns a model, never null, and `event` carries the turn id this ctx does not.
|
|
105
493
|
*/
|
|
106
494
|
export function gatewayModelResolver(primary) {
|
|
107
|
-
const deps = { ...liveIdentity, backend: gatewayModelBackend(primary.gateway) };
|
|
495
|
+
const deps = { ...liveIdentity, backend: gatewayModelBackend(primary.gateway, primary.via) };
|
|
108
496
|
return (event, ctx) => resolvePrimaryModel(ctx, { primary: { id: primary.id } }, deps, event);
|
|
109
497
|
}
|
|
110
498
|
// There is deliberately NO exported compaction model here. eve 0.38.3 cannot run an authored
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../agent/model/gateway.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,2GAA2G;AAE3G,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,EAKL,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,4CAA4C,CAAC;AAIpD;;;GAGG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC;AAE/D,wHAAwH;AACxH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;A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EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,oBAAoB,CAAC,EAAE,EAAE,QAAQ,IAAI,GAAG,CAAC;QAClE,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC;KAC1F,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IACjE,MAAM,IAAI,GAAG,EAAE,GAAG,YAAY,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;IAC7F,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAsB,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACnH,CAAC;AAED,6FAA6F;AAC7F,gGAAgG;AAChG,yFAAyF;AACzF,+FAA+F;AAC/F,yCAAyC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TranscriptionInput, type TranscriptionRoute } from "@open-everywhere/core/agent/adapter-api.js";
|
|
1
|
+
import { type TranscriptionInput, type TranscriptionRoute, type VoiceTranscriber } from "@open-everywhere/core/agent/adapter-api.js";
|
|
2
2
|
import { type GatewayRoutedDefaults } from "./gateway.js";
|
|
3
3
|
import { type RoleTranscript, type TranscriptionDeps, type TranscriptionRoleSpec } from "./transcription-routes.js";
|
|
4
4
|
/** The injectable transcription call, so the legacy route is testable with no network. */
|
|
@@ -16,9 +16,15 @@ export interface TimedTranscriptionRoute extends TranscriptionRoute {
|
|
|
16
16
|
}): Promise<RoleTranscript>;
|
|
17
17
|
}
|
|
18
18
|
export declare function stackTranscriptionRoute(role: TranscriptionRoleSpec, deps?: TranscriptionDeps): TimedTranscriptionRoute;
|
|
19
|
+
/**
|
|
20
|
+
* The voice-clip transcriber (core channels/voice-clips.ts) on the stack's transcription role. The spend row names the
|
|
21
|
+
* model of the route that ANSWERED, so a fall-through bills under the fallback's model and not the primary's.
|
|
22
|
+
*/
|
|
23
|
+
export declare function voiceClipTranscriber(role: TranscriptionRoleSpec, deps?: TranscriptionDeps): VoiceTranscriber;
|
|
19
24
|
/**
|
|
20
25
|
* Boot registration from agent.ts, beside the dream judge: the recap rides the `utility` defaults, and the
|
|
21
|
-
* transcription route rides the stack's transcription role when the app passes one.
|
|
26
|
+
* transcription route rides the stack's transcription role when the app passes one. The role ALSO registers the
|
|
27
|
+
* voice-clip transcriber (OPE-2524), so an app that already passes its role hears voice clips with no app change.
|
|
22
28
|
*/
|
|
23
29
|
export declare function registerGatewayMeetingModels(defaults: GatewayRoutedDefaults, transcription?: TranscriptionRoleSpec): void;
|
|
24
30
|
//# sourceMappingURL=meeting-gateway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meeting-gateway.d.ts","sourceRoot":"","sources":["../../../agent/model/meeting-gateway.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meeting-gateway.d.ts","sourceRoot":"","sources":["../../../agent/model/meeting-gateway.ts"],"names":[],"mappings":"AAqBA,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAmD,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE3G,OAAO,EAA0C,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAE5J,0FAA0F;AAC1F,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAQxG,+GAA+G;AAC/G,wBAAgB,yBAAyB,CAAC,IAAI,GAAE,cAAkC,GAAG,kBAAkB,CAUtG;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE,eAAe,CAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACjI;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,GAAE,iBAAsB,GAAG,uBAAuB,CAc1H;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,EAAE,IAAI,GAAE,iBAAsB,GAAG,gBAAgB,CAOhH;AAeD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,aAAa,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAMzH"}
|