@open-everywhere/adapters 0.6.0 → 0.8.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.
Files changed (94) hide show
  1. package/agent/aws/sso.ts +0 -2
  2. package/agent/directory/okta.ts +41 -2
  3. package/agent/instrumentation.ts +67 -4
  4. package/agent/model/approval-judge.ts +3 -3
  5. package/agent/model/dream-judge.ts +8 -6
  6. package/agent/model/gateway-probe.ts +97 -11
  7. package/agent/model/gateway-vision.ts +10 -6
  8. package/agent/model/gateway.ts +448 -34
  9. package/agent/model/meeting-gateway.ts +37 -7
  10. package/agent/model/model-config-check.ts +243 -0
  11. package/agent/model/target-url.ts +38 -0
  12. package/agent/model/transcription-routes.ts +18 -4
  13. package/agent/oe-oauth/config.ts +71 -3
  14. package/agent/oe-oauth/errors.ts +18 -1
  15. package/agent/oe-oauth/oauth-client.ts +118 -2
  16. package/agent/oe-oauth/token-vault.ts +446 -25
  17. package/agent/oe-oauth/user-auth-flow.ts +4 -3
  18. package/agent/operator-holders.ts +47 -0
  19. package/agent/postgres/neon.ts +1 -1
  20. package/dist/agent/aws/sso.d.ts +1 -2
  21. package/dist/agent/aws/sso.d.ts.map +1 -1
  22. package/dist/agent/aws/sso.js +0 -2
  23. package/dist/agent/aws/sso.js.map +1 -1
  24. package/dist/agent/directory/okta.d.ts +10 -0
  25. package/dist/agent/directory/okta.d.ts.map +1 -1
  26. package/dist/agent/directory/okta.js +34 -2
  27. package/dist/agent/directory/okta.js.map +1 -1
  28. package/dist/agent/instrumentation.d.ts +23 -1
  29. package/dist/agent/instrumentation.d.ts.map +1 -1
  30. package/dist/agent/instrumentation.js +59 -3
  31. package/dist/agent/instrumentation.js.map +1 -1
  32. package/dist/agent/model/approval-judge.d.ts.map +1 -1
  33. package/dist/agent/model/approval-judge.js +3 -3
  34. package/dist/agent/model/approval-judge.js.map +1 -1
  35. package/dist/agent/model/dream-judge.d.ts +2 -0
  36. package/dist/agent/model/dream-judge.d.ts.map +1 -1
  37. package/dist/agent/model/dream-judge.js +6 -4
  38. package/dist/agent/model/dream-judge.js.map +1 -1
  39. package/dist/agent/model/gateway-probe.d.ts +22 -4
  40. package/dist/agent/model/gateway-probe.d.ts.map +1 -1
  41. package/dist/agent/model/gateway-probe.js +78 -11
  42. package/dist/agent/model/gateway-probe.js.map +1 -1
  43. package/dist/agent/model/gateway-vision.d.ts +4 -2
  44. package/dist/agent/model/gateway-vision.d.ts.map +1 -1
  45. package/dist/agent/model/gateway-vision.js +6 -4
  46. package/dist/agent/model/gateway-vision.js.map +1 -1
  47. package/dist/agent/model/gateway.d.ts +85 -12
  48. package/dist/agent/model/gateway.d.ts.map +1 -1
  49. package/dist/agent/model/gateway.js +418 -30
  50. package/dist/agent/model/gateway.js.map +1 -1
  51. package/dist/agent/model/meeting-gateway.d.ts +8 -2
  52. package/dist/agent/model/meeting-gateway.d.ts.map +1 -1
  53. package/dist/agent/model/meeting-gateway.js +29 -7
  54. package/dist/agent/model/meeting-gateway.js.map +1 -1
  55. package/dist/agent/model/model-config-check.d.ts +57 -0
  56. package/dist/agent/model/model-config-check.d.ts.map +1 -0
  57. package/dist/agent/model/model-config-check.js +207 -0
  58. package/dist/agent/model/model-config-check.js.map +1 -0
  59. package/dist/agent/model/target-url.d.ts +10 -0
  60. package/dist/agent/model/target-url.d.ts.map +1 -0
  61. package/dist/agent/model/target-url.js +32 -0
  62. package/dist/agent/model/target-url.js.map +1 -0
  63. package/dist/agent/model/transcription-routes.d.ts +3 -0
  64. package/dist/agent/model/transcription-routes.d.ts.map +1 -1
  65. package/dist/agent/model/transcription-routes.js +16 -4
  66. package/dist/agent/model/transcription-routes.js.map +1 -1
  67. package/dist/agent/oe-oauth/config.d.ts +28 -2
  68. package/dist/agent/oe-oauth/config.d.ts.map +1 -1
  69. package/dist/agent/oe-oauth/config.js +40 -1
  70. package/dist/agent/oe-oauth/config.js.map +1 -1
  71. package/dist/agent/oe-oauth/errors.d.ts +14 -7
  72. package/dist/agent/oe-oauth/errors.d.ts.map +1 -1
  73. package/dist/agent/oe-oauth/errors.js +16 -1
  74. package/dist/agent/oe-oauth/errors.js.map +1 -1
  75. package/dist/agent/oe-oauth/oauth-client.d.ts +46 -0
  76. package/dist/agent/oe-oauth/oauth-client.d.ts.map +1 -1
  77. package/dist/agent/oe-oauth/oauth-client.js +82 -1
  78. package/dist/agent/oe-oauth/oauth-client.js.map +1 -1
  79. package/dist/agent/oe-oauth/token-vault.d.ts +19 -3
  80. package/dist/agent/oe-oauth/token-vault.d.ts.map +1 -1
  81. package/dist/agent/oe-oauth/token-vault.js +396 -22
  82. package/dist/agent/oe-oauth/token-vault.js.map +1 -1
  83. package/dist/agent/oe-oauth/user-auth-flow.d.ts.map +1 -1
  84. package/dist/agent/oe-oauth/user-auth-flow.js +3 -2
  85. package/dist/agent/oe-oauth/user-auth-flow.js.map +1 -1
  86. package/dist/agent/operator-holders.d.ts +13 -0
  87. package/dist/agent/operator-holders.d.ts.map +1 -0
  88. package/dist/agent/operator-holders.js +40 -0
  89. package/dist/agent/operator-holders.js.map +1 -0
  90. package/dist/agent/postgres/neon.d.ts +0 -15
  91. package/dist/agent/postgres/neon.d.ts.map +1 -1
  92. package/dist/agent/postgres/neon.js +1 -1
  93. package/dist/agent/postgres/neon.js.map +1 -1
  94. package/package.json +20 -2
@@ -12,6 +12,12 @@
12
12
  // ② REACHABILITY, from one GET of the gateway's PUBLIC model catalog — the same unauthenticated
13
13
  // endpoint `scripts/seed-model-catalog-cache.ts` reads.
14
14
  //
15
+ // ③ THE MODEL CONFIG (OPE-2556), when the app registered its models: one GET of the public
16
+ // `/v1/models/<id>/endpoints` read per model, judged against `models.targets` and `models.dataPolicy`
17
+ // (model-config-check.ts). A demand no provider can meet turns the row "no". The route is public, so the
18
+ // detail names no model, provider or target, and counts nothing. The answer is cached for ten minutes, so an
19
+ // anonymous caller cannot make the route fan out a read per request.
20
+ //
15
21
  // It does NOT prove the deployment's credential is ACCEPTED: the only call that proves that is an
16
22
  // inference call, which is neither cheap nor free, and a status route an unbounded caller can poke
17
23
  // must not be able to spend money. The detail string says so in as many words, because a status
@@ -19,18 +25,25 @@
19
25
  //
20
26
  // FAIL-SOFT and BOUNDED: a 2-second abort, and any throw answers "no" with no vendor error text
21
27
  // forwarded (a fetch failure's message carries the host, and the status route is public).
22
- import { registerStatusProbe, onVercel } from "@open-everywhere/core/agent/adapter-api.js";
28
+ import { DEFAULT_MODEL_VIA, getSettings, modelTargetFor, registerStatusProbe, onVercel, } from "@open-everywhere/core/agent/adapter-api.js";
29
+ import { checkModelConfig } from "./model-config-check.js";
30
+ import { targetBaseUrl } from "./target-url.js";
23
31
  /** The gateway's PUBLIC, unauthenticated model catalog — eve's own `AI_GATEWAY_MODELS_CATALOG_URL`. */
24
32
  export const GATEWAY_CATALOG_URL = "https://ai-gateway.vercel.sh/v1/models/catalog";
25
33
  /** How long the probe waits before it calls the gateway unreachable. */
26
34
  export const GATEWAY_PROBE_TIMEOUT_MS = 2_000;
35
+ /** The `gateway` target's base URL: `models.targets.gateway.url`, else the deprecated `OE_AI_GATEWAY_URL` in `env`. */
36
+ function gatewayBaseUrl(env = process.env) {
37
+ const targets = getSettings().models.targets;
38
+ return targetBaseUrl(DEFAULT_MODEL_VIA, modelTargetFor(DEFAULT_MODEL_VIA, targets), env);
39
+ }
27
40
  /**
28
- * The catalog URL this deployment probes. `OE_AI_GATEWAY_URL` retargets the whole gateway (a relay,
29
- * an on-prem proxy, a fixture), and it names the CHAT base (`…/v4/ai`), so the catalog is taken
30
- * from its ORIGIN rather than appended to it.
41
+ * The catalog URL this deployment probes. The `gateway` target's url (or the deprecated `OE_AI_GATEWAY_URL`)
42
+ * retargets the whole gateway (a relay, an on-prem proxy, a fixture), and it names the CHAT base (`…/v4/ai`), so the
43
+ * catalog is taken from its ORIGIN rather than appended to it.
31
44
  */
32
45
  export function gatewayCatalogUrl(env = process.env) {
33
- const override = env.OE_AI_GATEWAY_URL?.trim();
46
+ const override = gatewayBaseUrl(env);
34
47
  if (!override)
35
48
  return GATEWAY_CATALOG_URL;
36
49
  try {
@@ -42,6 +55,54 @@ export function gatewayCatalogUrl(env = process.env) {
42
55
  return GATEWAY_CATALOG_URL;
43
56
  }
44
57
  }
58
+ /** How long one config-check answer is reused. */
59
+ const MODEL_CONFIG_CHECK_TTL_MS = 10 * 60_000;
60
+ const CONFIG_CHECK_CACHE = {};
61
+ let registeredModels;
62
+ /**
63
+ * Register the models the deployment can resolve, so the `model-route` probe also runs the live config check.
64
+ * Called once from the app's boot wiring, beside the other registrations.
65
+ */
66
+ export function registerModelConfigCheck(models) {
67
+ registeredModels = models;
68
+ }
69
+ /** The config-check answer in closed-vocabulary words, for the PUBLIC status route. Pure. */
70
+ function publicConfigWords(r) {
71
+ if (r.met === "no")
72
+ return "the model config has a models.dataPolicy, providers.only or target dataPolicy demand that no provider can serve for at least one model — run `npm run check:model-config` for the names";
73
+ // An unused `providers.only` name is a warning on a config that was fully measured: say so, not "not measured".
74
+ if (r.met === "unknown" && r.findings.every((f) => f.row.endsWith(".providers.only"))) {
75
+ return "the model config can be served; a providers.only name serves none of the checked models — run `npm run check:model-config` for the names";
76
+ }
77
+ if (r.met === "unknown")
78
+ return "the model config was not fully measured — run `npm run check:model-config` for the details";
79
+ return "the model config can be served";
80
+ }
81
+ /** Run the config check, or reuse an answer younger than {@link MODEL_CONFIG_CHECK_TTL_MS}. Never throws. */
82
+ async function cachedConfigCheck(deps, models) {
83
+ const cache = deps.cache ?? CONFIG_CHECK_CACHE;
84
+ const now = (deps.now ?? Date.now)();
85
+ if (cache.value !== undefined && now - cache.value.at < MODEL_CONFIG_CHECK_TTL_MS)
86
+ return cache.value.result;
87
+ const env = deps.env ?? process.env;
88
+ let result;
89
+ try {
90
+ const settings = getSettings().models;
91
+ result = await checkModelConfig({
92
+ models: models(),
93
+ targets: settings.targets,
94
+ policy: settings.dataPolicy,
95
+ baseUrlFor: (via) => targetBaseUrl(via, modelTargetFor(via, settings.targets), env),
96
+ timeoutMs: GATEWAY_PROBE_TIMEOUT_MS,
97
+ ...(deps.fetchImpl !== undefined ? { fetchImpl: deps.fetchImpl } : {}),
98
+ });
99
+ }
100
+ catch {
101
+ result = { met: "unknown", findings: [{ met: "unknown", row: "config", detail: "the model config could not be read" }], checked: 0 };
102
+ }
103
+ cache.value = { at: now, result };
104
+ return result;
105
+ }
45
106
  /** Run the probe once. Exported so a test drives every arm with no network. */
46
107
  export async function probeGatewayRoute(deps = {}) {
47
108
  const env = deps.env ?? process.env;
@@ -52,10 +113,10 @@ export async function probeGatewayRoute(deps = {}) {
52
113
  // owes nobody a model catalog and may need no key of ours. Both of this probe's facts are then
53
114
  // about the shipped Vercel gateway, not about the route the deployment actually uses — and
54
115
  // "measured, and it does not hold" would be false for a deployment whose models route fine.
55
- const retargeted = (env.OE_AI_GATEWAY_URL ?? "").trim().length > 0;
116
+ const retargeted = gatewayBaseUrl(env) !== undefined;
56
117
  if (!vercel && !keySet) {
57
118
  if (retargeted) {
58
- return { met: "unknown", detail: "the model route is retargeted by OE_AI_GATEWAY_URL and holds no AI_GATEWAY_API_KEY — a relay may need neither, so this was not measured" };
119
+ return { met: "unknown", detail: "the model route is retargeted (models.targets.gateway.url) and holds no AI_GATEWAY_API_KEY — a relay may need neither, so this was not measured" };
59
120
  }
60
121
  return { met: "no", detail: "no gateway credential: off Vercel the deployment needs AI_GATEWAY_API_KEY (on Vercel, OIDC authenticates it)" };
61
122
  }
@@ -74,10 +135,16 @@ export async function probeGatewayRoute(deps = {}) {
74
135
  }
75
136
  return { met: "no", detail: `the model gateway answered HTTP ${res.status} to a catalog read; the credential posture is ${credential}` };
76
137
  }
77
- return {
78
- met: "yes",
79
- detail: `the model gateway answered a catalog read and the credential posture is ${credential} — this does not prove an inference call is authorised`,
80
- };
138
+ const reached = `the model gateway answered a catalog read and the credential posture is ${credential} — this does not prove an inference call is authorised`;
139
+ const models = deps.models ?? registeredModels;
140
+ if (models === undefined)
141
+ return { met: "yes", detail: reached };
142
+ // ③ The config check. A demand no provider can meet makes the row "no": every call of that model would fail closed.
143
+ // An unknown part keeps "yes", because the route itself was measured, and the detail says what was not.
144
+ // 🔴 THE STATUS ROUTE IS PUBLIC, so the detail is closed-vocabulary prose: no model id, no provider slug, no target
145
+ // name and no count. `npm run check:model-config` names them, from the app.
146
+ const check = await cachedConfigCheck(deps, models);
147
+ return { met: check.met === "no" ? "no" : "yes", detail: `${reached}; ${publicConfigWords(check)}` };
81
148
  }
82
149
  catch {
83
150
  return { met: "no", detail: `the model gateway did not answer within ${GATEWAY_PROBE_TIMEOUT_MS} ms; the credential posture is ${credential}` };
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-probe.js","sourceRoot":"","sources":["../../../agent/model/gateway-probe.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,2EAA2E;AAC3E,EAAE;AACF,mGAAmG;AACnG,+FAA+F;AAC/F,EAAE;AACF,8DAA8D;AAC9D,EAAE;AACF,4FAA4F;AAC5F,mGAAmG;AACnG,iDAAiD;AACjD,kGAAkG;AAClG,6DAA6D;AAC7D,EAAE;AACF,kGAAkG;AAClG,mGAAmG;AACnG,gGAAgG;AAChG,sEAAsE;AACtE,EAAE;AACF,gGAAgG;AAChG,0FAA0F;AAE1F,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAoB,MAAM,4CAA4C,CAAC;AAE7G,uGAAuG;AACvG,MAAM,CAAC,MAAM,mBAAmB,GAAG,gDAAgD,CAAC;AAEpF,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IACpE,MAAM,QAAQ,GAAG,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,CAAC,QAAQ;QAAE,OAAO,mBAAmB,CAAC;IAC1C,IAAI,CAAC;QACH,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,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IAAI,EAAE,MAAM,EAAE,mCAAmC,GAAG,CAAC,MAAM,iDAAiD,UAAU,EAAE,EAAE,CAAC;QAC3I,CAAC;QACD,MAAM,OAAO,GAAG,2EAA2E,UAAU,wDAAwD,CAAC;QAC9J,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,gBAAgB,CAAC;QAC/C,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;QACjE,oHAAoH;QACpH,wGAAwG;QACxG,oHAAoH;QACpH,4EAA4E;QAC5E,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,KAAK,iBAAiB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IACvG,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,2CAA2C,wBAAwB,kCAAkC,UAAU,EAAE,EAAE,CAAC;IAClJ,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;AACH,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,yBAAyB;IACvC,mBAAmB,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAChE,CAAC"}
@@ -3,9 +3,11 @@ import { type ImageDescribeResult, type ImageDescribeUsage, type ImageDescriber
3
3
  export interface GatewayVisionDefaults {
4
4
  /** Gateway vision model id, e.g. "alibaba/qwen3-vl-instruct". */
5
5
  readonly id: string;
6
+ /** The `models.targets` entry the call goes through (OPE-2556). Absent: `gateway`. */
7
+ readonly via?: string;
6
8
  /**
7
- * providerOptions.gateway for the call, forwarded verbatim. Absent in the reference config: ZDR is the
8
- * gateway's org policy now. A self-host wanting a per-call posture passes one here.
9
+ * providerOptions.gateway for the call, forwarded verbatim. Absent in the reference config. The deployment's
10
+ * `models.dataPolicy` rows ride the call whatever this holds, and win over it.
9
11
  */
10
12
  readonly gateway?: Record<string, unknown>;
11
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-vision.d.ts","sourceRoot":"","sources":["../../../agent/model/gateway-vision.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EAEpB,MAAM,4CAA4C,CAAC;AAEpD,sDAAsD;AACtD,MAAM,WAAW,qBAAqB;IACpC,iEAAiE;IACjE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAWD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAiBnE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,KAAK,CAE/D;AAED;;0DAE0D;AAC1D,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACvG,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACrE,CAAC;IACF,QAAQ,C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AAM,CAAC;YAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACvG,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACrE,CAAC;IACF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB,GAAG,kBAAkB,CAuCxF;AAED;;yEAEyE;AACzE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,cAAc,CA8BrF;AAED;;mFAEmF;AACnF,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAEnF"}
@@ -1,6 +1,8 @@
1
- // Gateway transport for the image describer — core owns the seam. Zero-data-retention is enforced AT THE
2
- // GATEWAY by org policy; the call is fail-closed, reports its own spend, and must NOT stamp the model.
3
- import { gateway, generateText } from "ai";
1
+ // Gateway transport for the image describer — core owns the seam. The model comes from gateway.ts, so the call
2
+ // carries `models.dataPolicy` (OPE-2535); a gateway's own org policy applies on top. The call is fail-closed,
3
+ // reports its own spend, and must NOT stamp the model.
4
+ import { generateText } from "ai";
5
+ import { gatewayLanguageModel } from "./gateway.js";
4
6
  import { registerImageDescriber, } from "@open-everywhere/core/agent/adapter-api.js";
5
7
  // The instruction: describe, transcribe on-image text, reply STRICT JSON. Kept here rather than in core
6
8
  // because it is paired with THIS transport's message shape.
@@ -94,7 +96,7 @@ export function gatewayImageDescriber(defaults) {
94
96
  let res;
95
97
  try {
96
98
  res = await generateText({
97
- model: gateway(defaults.id),
99
+ model: gatewayLanguageModel(defaults.id, defaults.via),
98
100
  messages: [
99
101
  {
100
102
  role: "user",
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-vision.js","sourceRoot":"","sources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AG,CAAC,QAAQ,CAAC,OAAO,KAAK,SAAS;wBAChC,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAA2D,EAAE;wBAC7G,CAAC,CAAC,EAAE,CAAC;iBACR,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,uFAAuF;gBACvF,oFAAoF;gBACpF,MAAM,eAAe,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YAC1C,CAAC;YACD,6FAA6F;YAC7F,8FAA8F;YAC9F,OAAO,EAAE,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC;QACtF,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;mFAEmF;AACnF,MAAM,UAAU,6BAA6B,CAAC,QAA+B;IAC3E,sBAAsB,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,21 +1,94 @@
1
1
  import { gateway } from "ai";
2
- import { type ModelRoute, type ModelBackend, type RoutedCallOptions } from "@open-everywhere/core/agent/adapter-api.js";
2
+ import { type ModelRoute, type ModelBackend, type RoutedCallOptions, type ModelDataPolicy, type ModelTarget } from "@open-everywhere/core/agent/adapter-api.js";
3
+ export { DEPRECATED_GATEWAY_URL_ENV, targetBaseUrl } from "./target-url.js";
3
4
  type GatewayModel = ReturnType<typeof gateway>;
5
+ type GatewayProvider = typeof gateway;
4
6
  /** The gateway's own host when {@link GATEWAY_BASE_URL} is unset. It must match the `ai` package's default base URL. */
5
7
  export declare const DEFAULT_GATEWAY_HOST = "ai-gateway.vercel.sh";
6
8
  /** The one host the model call reaches: the retarget's host, else the default. An unparseable retarget falls back to the default host. */
7
9
  export declare function gatewayHost(baseUrl: string | undefined): string;
8
- /** The one host this deployment's gateway calls reach — what every host-plane push must keep declaring. */
9
- export declare const GATEWAY_TARGET_HOST: string;
10
+ /** The one host the `gateway` target's calls reach (its `url`, else the deprecated env var, else the default). */
11
+ export declare function gatewayTargetHost(): string;
10
12
  /** Add `hosts` to this process's host plane and return the shared fetch (undefined off the proxy tier). */
11
13
  export declare function sharedHostPlaneFetch(hosts: readonly string[]): typeof fetch | undefined;
12
- /** The gateway provider this backend resolves model ids through — retargeted only when
13
- * {@link GATEWAY_BASE_URL} names a different host. */
14
- declare const provider: import("@ai-sdk/gateway").GatewayProvider;
14
+ /**
15
+ * The Vercel AI Gateway options for one `models.dataPolicy`. Pure. An absent row adds no key, so the shipped `{}`
16
+ * changes no request byte.
17
+ */
18
+ export declare function vercelDataPolicyOptions(p: ModelDataPolicy): Record<string, unknown>;
19
+ /** The call-options shape every model kind shares: language, transcription and embedding calls all carry it. */
20
+ type ProviderOptionsCarrier = {
21
+ readonly providerOptions?: Record<string, unknown> | undefined;
22
+ };
23
+ /**
24
+ * Put the policy on one call's options. Pure. The policy's keys WIN over the call's own gateway keys, so a call
25
+ * cannot weaken a row (`zeroDataRetention: false` on a call is overwritten). Every other key passes through. A
26
+ * policy that demands nothing returns the options unchanged.
27
+ */
28
+ export declare function withDataPolicy<T extends ProviderOptionsCarrier>(options: T, p: ModelDataPolicy): T;
29
+ /**
30
+ * The demands on a call, in the words of the settings file, for an error: `models.dataPolicy (region eu)`,
31
+ * `models.targets.gateway.providers.only (openai, azure)`, `models.targets.mistral.dataPolicy (zeroRetention)`, or
32
+ * several joined with " + ".
33
+ */
34
+ export declare function demandLabel(p: ModelDataPolicy, t?: ModelTarget, via?: string): string;
35
+ /**
36
+ * Put a target's rows and the data policy on one call's options. Pure but for a refusal. The order of the merge:
37
+ * 1. the target's `options` are a FLOOR: a call's own key wins;
38
+ * 2. the target's `providers.order` applies when the call names no `order` (a route's `providerOrder` wins);
39
+ * 3. the target's `providers.only` is a DEMAND: a call's own `only` narrows it to the intersection, and an empty
40
+ * intersection REFUSES (an empty `only` would read as no filter at all);
41
+ * 4. the policy's keys win over everything. The policy is `models.dataPolicy` plus the target's own `dataPolicy` rows
42
+ * (OPE-2531): a target adds rows and never removes one.
43
+ * A target with no rows and a policy that demands nothing return the options unchanged, so the shipped value changes
44
+ * no request byte.
45
+ */
46
+ export declare function withTargetRows<T extends ProviderOptionsCarrier>(options: T, t: ModelTarget | undefined, global: ModelDataPolicy, via?: string): T;
47
+ /**
48
+ * Name the policy rows on a refusal the policy caused. A model with no provider that meets the rows fails with an
49
+ * error that says which rows, and which model: "models.dataPolicy (region eu): no provider serves …". Any other
50
+ * error, or any error with no policy set, passes through unchanged.
51
+ */
52
+ export declare function dataPolicyCallError(modelId: string, p: ModelDataPolicy, err: unknown, t?: ModelTarget, via?: string): unknown;
53
+ /**
54
+ * A model that carries the data policy on EVERY call it sends. A Proxy, so the model keeps its class, its
55
+ * `provider`, its `modelId` and every other member: eve and the AI SDK see the same object shape. Only the calls
56
+ * change: the policy merges into the options, and a refusal it caused names the rows.
57
+ */
58
+ export declare function policyModel<M extends object>(model: M, via?: string): M;
59
+ /** A gateway LANGUAGE model on the target `via` names (absent: `gateway`), with its url and the host-plane fetch,
60
+ * carrying the target's rows and the data policy. The one way a module outside this file gets a gateway model. */
61
+ export declare function gatewayLanguageModel(id: string, via?: string): GatewayModel;
62
+ /**
63
+ * A provider whose every model-building member (`languageModel`, its `chat` alias, `evaluationModel`, `reranking`,
64
+ * `experimental_batch`, …) hands out policy models. A denylist, not an allow-list: a member the SDK adds later is
65
+ * wrapped by default. A member's own properties (`experimental_transcription.getToken`) stay on it.
66
+ */
67
+ export declare function policyProvider<P extends object>(base: P): P;
68
+ /** Test seam: let the next bare-id call note the gap again. */
69
+ export declare function _resetBareGapNoticeForTest(): void;
70
+ /**
71
+ * THE BARE-ID PROVIDER (OPE-2566). A provider that sends each bare id through the target its role names
72
+ * (core model/bare-model-via.ts): the role that names the id, else the primary role's target, else `gateway`. Every
73
+ * model it builds is a policy model on that target, so the target's url, provider pin and data-policy rows ride the
74
+ * call. It reads the table at CALL time: the app registers its roles after this module loads. A member's own
75
+ * properties (`experimental_transcription.getToken`) and the account reads use the deployment default's target.
76
+ * Exported for tests.
77
+ */
78
+ export declare function bareIdProvider(): GatewayProvider;
79
+ /**
80
+ * A foreign default provider, kept, behind a guard: with no policy it is untouched; under a policy every model call
81
+ * through it refuses, because nothing proves that provider honours the rows. The guard reads the target the bare id
82
+ * goes through (OPE-2566): that target's rows count, and a target other than `gateway` refuses too, because the
83
+ * foreign provider would send the call somewhere else. Exported for tests.
84
+ */
85
+ export declare function foreignProviderGuard<P extends object>(base: P): P;
15
86
  /** Static defaults for one routed slot — mirrors what a plain string config said. */
16
87
  export interface GatewayRoutedDefaults {
17
- /** Default gateway model id (what unrouted channels use), e.g. "zai/glm-5.2". */
88
+ /** Default gateway model id (what unrouted channels use), e.g. "openai/gpt-6-luna". */
18
89
  readonly id: string;
90
+ /** The `models.targets` entry the role's calls go through (OPE-2556). A route's own `via` wins. Absent: `gateway`. */
91
+ readonly via?: string;
19
92
  /**
20
93
  * Gateway providerOptions applied when the CALL carries none — a floor, since turn calls carry their own.
21
94
  * Any gateway option is forwarded verbatim; this mapping has no allow-list of keys.
@@ -24,7 +97,8 @@ export interface GatewayRoutedDefaults {
24
97
  }
25
98
  /**
26
99
  * Map a route's provider hints onto one call's gateway options. Pure. A MODEL CHANGE strips the pin keys — a
27
- * pin set for one model is broken for another — and a route's `providers` becomes `order`, never `only`.
100
+ * pin set for one model is broken for another — and a route's `providerOrder` becomes `order`, never `only`. The
101
+ * target's own rows (`providers.only`, `providers.order`, `options`) join later, on every call (`withTargetRows`).
28
102
  */
29
103
  export declare function applyGatewayOptions(route: ModelRoute, options: RoutedCallOptions, ids: {
30
104
  readonly id: string;
@@ -32,13 +106,12 @@ export declare function applyGatewayOptions(route: ModelRoute, options: RoutedCa
32
106
  }, defaults?: Record<string, unknown>): RoutedCallOptions;
33
107
  /** A gateway TRANSCRIPTION model, on the same provider (retarget and host-plane fetch included) the turn
34
108
  * model uses. The meeting bot's `gateway` route (meeting-gateway.ts) reads it. */
35
- export declare function gatewayTranscriptionModel(id: string): ReturnType<typeof provider.transcriptionModel>;
36
- /** The gateway ModelBackend (see core ModelBackend). */
37
- export declare function gatewayModelBackend(defaults?: Record<string, unknown>): ModelBackend<GatewayModel>;
109
+ export declare function gatewayTranscriptionModel(id: string): ReturnType<GatewayProvider["transcriptionModel"]>;
110
+ /** The gateway ModelBackend (see core ModelBackend). `via` is the role's target; a route's own `via` wins. */
111
+ export declare function gatewayModelBackend(defaults?: Record<string, unknown>, via?: string): ModelBackend<GatewayModel>;
38
112
  /**
39
113
  * A `step.started` dynamic-model resolver. It MUST be `step.started`: eve discards a model INSTANCE at turn
40
114
  * scope. It ALWAYS returns a model, never null, and `event` carries the turn id this ctx does not.
41
115
  */
42
116
  export declare function gatewayModelResolver(primary: GatewayRoutedDefaults): (event: unknown, ctx: unknown) => Promise<GatewayModel>;
43
- export {};
44
117
  //# sourceMappingURL=gateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../agent/model/gateway.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAiB,MAAM,IAAI,CAAC;AAC5C,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAKvB,MAAM,4CAA4C,CAAC;AAEpD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAQ/C,wHAAwH;AACxH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,0IAA0I;AAC1I,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAO/D;AAED,2GAA2G;AAC3G,eAAO,MAAM,mBAAmB,QAAgC,CAAC;AA8BjE,2GAA2G;AAC3G,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,KAAK,GAAG,SAA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