@w6w/embed 0.2.27 → 0.2.29

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 (26) hide show
  1. package/dist/{ConfirmModal-Pv2-A_3U.js → ConfirmModal-WqBfWftD.js} +100 -83
  2. package/dist/{ConfirmModal-Pv2-A_3U.js.map → ConfirmModal-WqBfWftD.js.map} +1 -1
  3. package/dist/{CreateFunctionModal-B3LpcuI9.js → CreateFunctionModal-CCYi9deY.js} +2 -2
  4. package/dist/{CreateFunctionModal-B3LpcuI9.js.map → CreateFunctionModal-CCYi9deY.js.map} +1 -1
  5. package/dist/{DocumentFormModal-DieWYFi4.js → DocumentFormModal-CCIgA7pR.js} +2 -2
  6. package/dist/{DocumentFormModal-DieWYFi4.js.map → DocumentFormModal-CCIgA7pR.js.map} +1 -1
  7. package/dist/{ImportSpecModal-xwTzj4KB.js → ImportSpecModal-DoxsVxru.js} +2 -2
  8. package/dist/{ImportSpecModal-xwTzj4KB.js.map → ImportSpecModal-DoxsVxru.js.map} +1 -1
  9. package/dist/{ModelRoutesManager-DtByS4mE.js → ModelRoutesManager-DqeY1mdP.js} +110 -106
  10. package/dist/ModelRoutesManager-DqeY1mdP.js.map +1 -0
  11. package/dist/{WorkflowEditor-CvWkVmFn.js → WorkflowEditor-CBUwh85L.js} +3 -3
  12. package/dist/{WorkflowEditor-CvWkVmFn.js.map → WorkflowEditor-CBUwh85L.js.map} +1 -1
  13. package/dist/chrome/CallFromCodeButton.d.ts +12 -0
  14. package/dist/chrome/index.d.ts +1 -1
  15. package/dist/{editor-tools-CVYTsVFN.js → editor-tools--Y3wlBZE.js} +3 -3
  16. package/dist/{editor-tools-CVYTsVFN.js.map → editor-tools--Y3wlBZE.js.map} +1 -1
  17. package/dist/editor.mjs +1 -1
  18. package/dist/editors.mjs +6 -6
  19. package/dist/forms.mjs +321 -297
  20. package/dist/forms.mjs.map +1 -1
  21. package/dist/lists.mjs +1236 -1140
  22. package/dist/lists.mjs.map +1 -1
  23. package/dist/rail.mjs +1 -1
  24. package/dist/repos/connections.d.ts +1 -0
  25. package/package.json +4 -4
  26. package/dist/ModelRoutesManager-DtByS4mE.js.map +0 -1
@@ -1,34 +1,34 @@
1
- import { jsx as t, jsxs as a, Fragment as z } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as l, Fragment as B } from "react/jsx-runtime";
2
2
  import { ApiError as ee } from "@w6w/sdk";
3
- import { EmptyState as J, DataTable as te, EditButton as ne, DeleteButton as oe, useEnterSubmit as ae } from "@w6w/ui";
3
+ import { EmptyState as J, DataTable as te, RowActionsMenu as ne, useEnterSubmit as oe } from "@w6w/ui";
4
4
  import { useState as h } from "react";
5
- import { C as le, M as ie } from "./ConfirmModal-Pv2-A_3U.js";
6
- import { u as de } from "./project-context-Tvp-La7A.js";
7
- import { u as se } from "./ai-keys-D676ly41.js";
8
- import { u as ce } from "./connections-CzsCyIxY.js";
9
- import { u as re, a as ue, b as me, c as he, d as be, e as ge, f as ve, g as ye, r as w } from "./models-CI0vLJ6o.js";
5
+ import { C as ae, M as le } from "./ConfirmModal-WqBfWftD.js";
6
+ import { u as ie } from "./project-context-Tvp-La7A.js";
7
+ import { u as de } from "./ai-keys-D676ly41.js";
8
+ import { u as se } from "./connections-CzsCyIxY.js";
9
+ import { u as ce, a as re, b as ue, c as me, d as he, e as be, f as ge, g as ve, r as w } from "./models-CI0vLJ6o.js";
10
10
  const W = {
11
11
  invalid_route_name: "That route name is not valid. Use lowercase letters, digits and dashes (e.g. gpt-4o-fast): 3 to 39 characters, starting with a letter, no double dashes, not ending in a dash.",
12
12
  credential_scope_mismatch: "This route mixes account connections with each person's own key. Use one or the other for the whole route, including its fallbacks."
13
- }, B = {
13
+ }, G = {
14
14
  personal_key_required: "You have not added a key for this provider yet.",
15
15
  personal_key_unavailable: "Your key for this provider is disabled or can no longer be used.",
16
16
  user_context_required: "This route needs a signed-in person; it cannot run on its own.",
17
17
  ai_credential_policy_denied: "Your account's AI key policy does not allow this kind of key."
18
- }, fe = "This route is not ready for you to use.", R = "Each person uses their own key";
18
+ }, ye = "This route is not ready for you to use.", _ = "Each person uses their own key";
19
19
  function V(e) {
20
20
  return e instanceof ee ? Object.hasOwn(W, e.code) ? W[e.code] : e.message : e instanceof Error ? e.message : String(e);
21
21
  }
22
- function G(e) {
23
- const l = e.fallbacks.length, c = l === 0 ? "" : ` · ${l} fallback${l === 1 ? "" : "s"}`;
24
- return `${e.credentialMode === "invoking_user" ? `${e.modelId} · ${R}` : `${e.modelId} via ${e.connectionId}`}${c}`;
22
+ function H(e) {
23
+ const a = e.fallbacks.length, c = a === 0 ? "" : ` · ${a} fallback${a === 1 ? "" : "s"}`;
24
+ return `${e.credentialMode === "invoking_user" ? `${e.modelId} · ${_}` : `${e.modelId} via ${e.connectionId}`}${c}`;
25
25
  }
26
- function Ce(e) {
27
- const { route: l } = e, i = ye(e.project, l.name).data;
26
+ function fe(e) {
27
+ const { route: a } = e, i = ve(e.project, a.name).data;
28
28
  if (!i) return null;
29
29
  const u = i.setup;
30
- return /* @__PURE__ */ a("div", { className: "muted small", "data-testid": `model-route-readiness-${l.name}`, children: [
31
- i.ready ? "Ready for you" : /* @__PURE__ */ t(z, { children: (i.issues.length > 0 ? i.issues : [{ code: "" }]).map((d) => /* @__PURE__ */ t("div", { children: Object.hasOwn(B, d.code) ? B[d.code] : fe }, d.code)) }),
30
+ return /* @__PURE__ */ l("div", { className: "muted small", "data-testid": `model-route-readiness-${a.name}`, children: [
31
+ i.ready ? "Ready for you" : /* @__PURE__ */ t(B, { children: (i.issues.length > 0 ? i.issues : [{ code: "" }]).map((d) => /* @__PURE__ */ t("div", { children: Object.hasOwn(G, d.code) ? G[d.code] : ye }, d.code)) }),
32
32
  i.ready === !1 && u != null && e.onSetupAiKey != null && /* @__PURE__ */ t(
33
33
  "button",
34
34
  {
@@ -38,32 +38,32 @@ function Ce(e) {
38
38
  var d;
39
39
  return (d = e.onSetupAiKey) == null ? void 0 : d.call(e, { providerAppId: u.providerAppId, modelId: u.modelId });
40
40
  },
41
- "data-testid": `model-route-setup-${l.name}`,
41
+ "data-testid": `model-route-setup-${a.name}`,
42
42
  children: "Add your key"
43
43
  }
44
44
  )
45
45
  ] });
46
46
  }
47
- function _e(e) {
48
- var N;
49
- const l = de(e.projectId), [c, i] = h(
47
+ function Ae(e) {
48
+ var M;
49
+ const a = ie(e.projectId), [c, i] = h(
50
50
  () => e.initialEditRouteId ? { routeId: e.initialEditRouteId, connection: e.initialConnection } : null
51
- ), [u, d] = h(null), [y, n] = h(null), k = re(l ?? void 0), m = ue(), I = k.data ?? [], f = l != null, M = (c == null ? void 0 : c.routeId) == null ? void 0 : I.find((o) => o.id === c.routeId), b = c != null && (c.routeId == null || M != null), C = [
51
+ ), [u, d] = h(null), [y, n] = h(null), k = ce(a ?? void 0), m = re(), I = k.data ?? [], f = a != null, N = (c == null ? void 0 : c.routeId) == null ? void 0 : I.find((o) => o.id === c.routeId), b = c != null && (c.routeId == null || N != null), C = [
52
52
  {
53
53
  key: "name",
54
54
  header: "Route",
55
- render: (o) => /* @__PURE__ */ a("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
55
+ render: (o) => /* @__PURE__ */ l("div", { className: "list-main", style: { maxWidth: 0, minWidth: "100%" }, children: [
56
56
  /* @__PURE__ */ t("strong", { className: "list-name", title: o.name, children: o.name }),
57
57
  " ",
58
58
  /* @__PURE__ */ t("span", { className: o.status === "broken" ? "tag warn" : "tag", children: o.status }),
59
- /* @__PURE__ */ t("div", { className: "muted small list-preview", title: G(o), children: G(o) }),
60
- o.credentialMode === "invoking_user" && l != null && /* @__PURE__ */ t(Ce, { project: l, route: o, onSetupAiKey: e.onSetupAiKey })
59
+ /* @__PURE__ */ t("div", { className: "muted small list-preview", title: H(o), children: H(o) }),
60
+ o.credentialMode === "invoking_user" && a != null && /* @__PURE__ */ t(fe, { project: a, route: o, onSetupAiKey: e.onSetupAiKey })
61
61
  ] })
62
62
  },
63
63
  {
64
64
  key: "connection",
65
65
  header: "Connection",
66
- render: (o) => o.credentialMode === "invoking_user" ? /* @__PURE__ */ t("span", { children: R }) : /* @__PURE__ */ t("code", { children: o.connectionId })
66
+ render: (o) => o.credentialMode === "invoking_user" ? /* @__PURE__ */ t("span", { children: _ }) : /* @__PURE__ */ t("code", { children: o.connectionId })
67
67
  },
68
68
  {
69
69
  key: "actions",
@@ -71,30 +71,34 @@ function _e(e) {
71
71
  align: "right",
72
72
  link: !1,
73
73
  actions: !0,
74
- render: (o) => /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
75
- /* @__PURE__ */ t(
76
- ne,
77
- {
78
- label: "Edit",
79
- onClick: () => i({ routeId: o.id }),
80
- "data-testid": `model-route-edit-${o.name}`
81
- }
82
- ),
83
- /* @__PURE__ */ t(
84
- oe,
85
- {
86
- label: "Delete",
87
- onClick: () => d(o),
88
- disabled: m.isPending,
89
- "data-testid": `model-route-delete-${o.name}`
90
- }
91
- )
92
- ] })
74
+ render: (o) => /* @__PURE__ */ t(
75
+ ne,
76
+ {
77
+ label: `Actions for ${o.name}`,
78
+ "data-testid": `model-route-actions-${o.name}`,
79
+ actions: [
80
+ {
81
+ label: "Edit",
82
+ icon: "edit",
83
+ onSelect: () => i({ routeId: o.id }),
84
+ "data-testid": `model-route-edit-${o.name}`
85
+ },
86
+ {
87
+ label: "Delete",
88
+ icon: "delete",
89
+ danger: !0,
90
+ disabled: m.isPending,
91
+ onSelect: () => d(o),
92
+ "data-testid": `model-route-delete-${o.name}`
93
+ }
94
+ ]
95
+ }
96
+ )
93
97
  }
94
98
  ];
95
- return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ a("section", { className: "section", children: [
96
- /* @__PURE__ */ a("div", { className: "section-head", children: [
97
- /* @__PURE__ */ a("div", { children: [
99
+ return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ l("section", { className: "section", children: [
100
+ /* @__PURE__ */ l("div", { className: "section-head", children: [
101
+ /* @__PURE__ */ l("div", { children: [
98
102
  /* @__PURE__ */ t("h3", { children: "Model routes" }),
99
103
  /* @__PURE__ */ t("p", { className: "muted small", children: "Give a model a name your workflows can use, such as “support-assistant”. Each route pairs a model with an integration. You can add fallback models if a call fails." })
100
104
  ] }),
@@ -111,9 +115,9 @@ function _e(e) {
111
115
  )
112
116
  ] }),
113
117
  y && /* @__PURE__ */ t("div", { className: "result error", role: "alert", "data-testid": "model-route-delete-error", children: y }),
114
- /* @__PURE__ */ a("div", { children: [
118
+ /* @__PURE__ */ l("div", { children: [
115
119
  k.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
116
- ((N = k.data) == null ? void 0 : N.length) === 0 && /* @__PURE__ */ t(J, { testId: "model-routes-empty", children: "No model routes yet. Add one to give callers a stable name for a model." }),
120
+ ((M = k.data) == null ? void 0 : M.length) === 0 && /* @__PURE__ */ t(J, { testId: "model-routes-empty", children: "No model routes yet. Add one to give callers a stable name for a model." }),
117
121
  I.length > 0 && /* @__PURE__ */ t(
118
122
  te,
119
123
  {
@@ -124,19 +128,19 @@ function _e(e) {
124
128
  }
125
129
  )
126
130
  ] }),
127
- b && l != null && c != null && /* @__PURE__ */ t(
128
- ke,
131
+ b && a != null && c != null && /* @__PURE__ */ t(
132
+ Ce,
129
133
  {
130
- project: l,
131
- initial: M,
134
+ project: a,
135
+ initial: N,
132
136
  initialConnection: c.connection,
133
137
  onSetupAiKey: e.onSetupAiKey,
134
138
  onClose: () => i(null),
135
139
  onSaved: () => i(null)
136
140
  }
137
141
  ),
138
- u != null && l != null && /* @__PURE__ */ t(
139
- le,
142
+ u != null && a != null && /* @__PURE__ */ t(
143
+ ae,
140
144
  {
141
145
  title: "Delete model route",
142
146
  message: `Delete the model route "${u.name}"? Calls that name it will fail until another route covers the model.`,
@@ -144,9 +148,9 @@ function _e(e) {
144
148
  onConfirm: () => {
145
149
  const o = u.name;
146
150
  n(null), m.mutate(
147
- { project: l, name: o },
151
+ { project: a, name: o },
148
152
  {
149
- onError: (E) => n(`Could not delete "${o}": ${V(E)}`)
153
+ onError: (S) => n(`Could not delete "${o}": ${V(S)}`)
150
154
  }
151
155
  ), d(null);
152
156
  },
@@ -155,18 +159,18 @@ function _e(e) {
155
159
  )
156
160
  ] }) });
157
161
  }
158
- function ke(e) {
162
+ function Ce(e) {
159
163
  var Q, T, Y, F, q, L, U;
160
- const l = !!e.initial, c = se(), [i, u] = h(
164
+ const a = !!e.initial, c = de(), [i, u] = h(
161
165
  ((Q = e.initial) == null ? void 0 : Q.credentialMode) ?? "account"
162
- ), d = i === "invoking_user", y = c || ((T = e.initial) == null ? void 0 : T.credentialMode) === "invoking_user", [n, k] = h(((Y = e.initial) == null ? void 0 : Y.name) ?? ""), [m, I] = h(((F = e.initial) == null ? void 0 : F.modelId) ?? ""), [f, M] = h(
166
+ ), d = i === "invoking_user", y = c || ((T = e.initial) == null ? void 0 : T.credentialMode) === "invoking_user", [n, k] = h(((Y = e.initial) == null ? void 0 : Y.name) ?? ""), [m, I] = h(((F = e.initial) == null ? void 0 : F.modelId) ?? ""), [f, N] = h(
163
167
  e.initialConnection ?? ((q = e.initial) == null ? void 0 : q.connectionId) ?? ""
164
- ), [b, C] = h(((L = e.initial) == null ? void 0 : L.fallbacks) ?? []), [N, o] = h(null), E = me({ status: "active" }), X = ce(), S = ((U = E.data) == null ? void 0 : U.models) ?? [], Z = he(), x = be(
168
+ ), [b, C] = h(((L = e.initial) == null ? void 0 : L.fallbacks) ?? []), [M, o] = h(null), S = ue({ status: "active" }), X = se(), E = ((U = S.data) == null ? void 0 : U.models) ?? [], Z = me(), x = he(
165
169
  X.data ?? [],
166
170
  Z.data ?? [],
167
171
  "complete"
168
- ), $ = E.isSuccess && S.length === 0, P = ge(), j = ve(), K = P.isPending || j.isPending, D = !!n && !!m && (d || !!f) && b.every((s) => !!s.model && (d || !!s.connection)) && !K;
169
- function O() {
172
+ ), p = S.isSuccess && E.length === 0, P = be(), j = ge(), K = P.isPending || j.isPending, O = !!n && !!m && (d || !!f) && b.every((s) => !!s.model && (d || !!s.connection)) && !K;
173
+ function D() {
170
174
  o(null);
171
175
  const s = {
172
176
  onSuccess: () => e.onSaved(),
@@ -198,22 +202,22 @@ function ke(e) {
198
202
  s
199
203
  );
200
204
  }
201
- const A = ae(O, { enabled: D });
202
- return /* @__PURE__ */ a(
203
- ie,
205
+ const A = oe(D, { enabled: O });
206
+ return /* @__PURE__ */ l(
207
+ le,
204
208
  {
205
209
  title: e.initial ? `Edit ${e.initial.name}` : "Add model route",
206
210
  onClose: e.onClose,
207
211
  children: [
208
- /* @__PURE__ */ a("div", { className: "modal-body", children: [
209
- /* @__PURE__ */ a("label", { className: "field", children: [
212
+ /* @__PURE__ */ l("div", { className: "modal-body", children: [
213
+ /* @__PURE__ */ l("label", { className: "field", children: [
210
214
  /* @__PURE__ */ t("span", { children: "Name" }),
211
215
  /* @__PURE__ */ t(
212
216
  "input",
213
217
  {
214
218
  type: "text",
215
219
  value: n,
216
- disabled: l,
220
+ disabled: a,
217
221
  onChange: (s) => k(s.target.value),
218
222
  placeholder: "e.g. gpt-4o-fast",
219
223
  maxLength: 64,
@@ -221,12 +225,12 @@ function ke(e) {
221
225
  ...A
222
226
  }
223
227
  ),
224
- !l && /* @__PURE__ */ t("span", { className: "hint", children: "3 to 39 characters: lowercase letters, digits and dashes, starting with a letter, no double dashes, not ending in a dash. Callers use this name; it cannot be renamed later." })
228
+ !a && /* @__PURE__ */ t("span", { className: "hint", children: "3 to 39 characters: lowercase letters, digits and dashes, starting with a letter, no double dashes, not ending in a dash. Callers use this name; it cannot be renamed later." })
225
229
  ] }),
226
- $ && /* @__PURE__ */ t(J, { testId: "model-route-catalog-empty", children: "The model catalog is empty. Open the Catalog tab to discover models; until then you can type ids by hand." }),
227
- y && /* @__PURE__ */ a("label", { className: "field", children: [
230
+ p && /* @__PURE__ */ t(J, { testId: "model-route-catalog-empty", children: "The model catalog is empty. Open the Catalog tab to discover models; until then you can type ids by hand." }),
231
+ y && /* @__PURE__ */ l("label", { className: "field", children: [
228
232
  /* @__PURE__ */ t("span", { children: "Credentials" }),
229
- /* @__PURE__ */ a(
233
+ /* @__PURE__ */ l(
230
234
  "select",
231
235
  {
232
236
  value: i,
@@ -240,23 +244,23 @@ function ke(e) {
240
244
  )
241
245
  ] }),
242
246
  /* @__PURE__ */ t(
243
- H,
247
+ z,
244
248
  {
245
249
  label: "",
246
250
  model: m,
247
251
  connection: f,
248
252
  onModel: I,
249
- onConnection: M,
250
- models: S,
253
+ onConnection: N,
254
+ models: E,
251
255
  connections: x,
252
- catalogEmpty: $,
256
+ catalogEmpty: p,
253
257
  hideConnection: d,
254
258
  testIdPrefix: "model-route",
255
259
  enterSubmit: A
256
260
  }
257
261
  ),
258
- d ? /* @__PURE__ */ a("div", { className: "hint", "data-testid": "model-route-own-key", children: [
259
- R,
262
+ d ? /* @__PURE__ */ l("div", { className: "hint", "data-testid": "model-route-own-key", children: [
263
+ _,
260
264
  ".",
261
265
  " ",
262
266
  e.onSetupAiKey != null && /* @__PURE__ */ t(
@@ -267,7 +271,7 @@ function ke(e) {
267
271
  onClick: () => {
268
272
  var s, r;
269
273
  return (r = e.onSetupAiKey) == null ? void 0 : r.call(e, {
270
- providerAppId: (s = S.find((g) => g.id === m)) == null ? void 0 : s.providerAppId,
274
+ providerAppId: (s = E.find((g) => g.id === m)) == null ? void 0 : s.providerAppId,
271
275
  modelId: m || void 0
272
276
  });
273
277
  },
@@ -276,22 +280,22 @@ function ke(e) {
276
280
  }
277
281
  )
278
282
  ] }) : /* @__PURE__ */ t("span", { className: "hint", children: "The connection holds the credentials for the model. Changing it fixes a broken route." }),
279
- /* @__PURE__ */ a("div", { className: "field", children: [
283
+ /* @__PURE__ */ l("div", { className: "field", children: [
280
284
  /* @__PURE__ */ t("span", { children: "Fallbacks" }),
281
285
  b.map((s, r) => (
282
286
  // biome-ignore lint/suspicious/noArrayIndexKey: rows have no identity beyond position
283
- /* @__PURE__ */ a("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
287
+ /* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)" }, children: [
284
288
  /* @__PURE__ */ t(
285
- H,
289
+ z,
286
290
  {
287
291
  label: `Fallback ${r + 1} `,
288
292
  model: s.model,
289
293
  connection: s.connection,
290
- onModel: (g) => C((p) => p.map((v, _) => _ === r ? { ...v, model: g } : v)),
291
- onConnection: (g) => C((p) => p.map((v, _) => _ === r ? { ...v, connection: g } : v)),
292
- models: S,
294
+ onModel: (g) => C(($) => $.map((v, R) => R === r ? { ...v, model: g } : v)),
295
+ onConnection: (g) => C(($) => $.map((v, R) => R === r ? { ...v, connection: g } : v)),
296
+ models: E,
293
297
  connections: x,
294
- catalogEmpty: $,
298
+ catalogEmpty: p,
295
299
  hideConnection: d,
296
300
  testIdPrefix: `model-route-fallback-${r}`,
297
301
  enterSubmit: A
@@ -302,7 +306,7 @@ function ke(e) {
302
306
  {
303
307
  type: "button",
304
308
  className: "btn ghost",
305
- onClick: () => C((g) => g.filter((p, v) => v !== r)),
309
+ onClick: () => C((g) => g.filter(($, v) => v !== r)),
306
310
  "data-testid": `model-route-fallback-${r}-remove`,
307
311
  children: "Remove"
308
312
  }
@@ -320,19 +324,19 @@ function ke(e) {
320
324
  }
321
325
  )
322
326
  ] }),
323
- N && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "model-route-error", children: N })
327
+ M && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "model-route-error", children: M })
324
328
  ] }),
325
- /* @__PURE__ */ a("div", { className: "modal-actions", children: [
329
+ /* @__PURE__ */ l("div", { className: "modal-actions", children: [
326
330
  /* @__PURE__ */ t("button", { type: "button", className: "btn ghost", onClick: e.onClose, children: "Cancel" }),
327
331
  /* @__PURE__ */ t(
328
332
  "button",
329
333
  {
330
334
  type: "button",
331
335
  className: "btn",
332
- disabled: !D,
333
- onClick: O,
336
+ disabled: !O,
337
+ onClick: D,
334
338
  "data-testid": "model-route-save",
335
- children: K ? "Saving…" : l ? "Save changes" : "Save route"
339
+ children: K ? "Saving…" : a ? "Save changes" : "Save route"
336
340
  }
337
341
  )
338
342
  ] })
@@ -340,11 +344,11 @@ function ke(e) {
340
344
  }
341
345
  );
342
346
  }
343
- function H(e) {
344
- const l = e.models.find((n) => n.id === e.model), c = l ? e.connections.filter((n) => n.appId === l.providerAppId) : e.connections, i = l != null && c.length > 0, u = i ? c : e.connections, d = u.some((n) => n.id === e.connection), y = e.models.some((n) => n.id === e.model);
345
- return /* @__PURE__ */ a(z, { children: [
346
- /* @__PURE__ */ a("div", { className: "field", children: [
347
- /* @__PURE__ */ a("span", { children: [
347
+ function z(e) {
348
+ const a = e.models.find((n) => n.id === e.model), c = a ? e.connections.filter((n) => n.appId === a.providerAppId) : e.connections, i = a != null && c.length > 0, u = i ? c : e.connections, d = u.some((n) => n.id === e.connection), y = e.models.some((n) => n.id === e.model);
349
+ return /* @__PURE__ */ l(B, { children: [
350
+ /* @__PURE__ */ l("div", { className: "field", children: [
351
+ /* @__PURE__ */ l("span", { children: [
348
352
  e.label,
349
353
  "Model"
350
354
  ] }),
@@ -359,7 +363,7 @@ function H(e) {
359
363
  "data-testid": `${e.testIdPrefix}-model`,
360
364
  ...e.enterSubmit
361
365
  }
362
- ) : /* @__PURE__ */ a(
366
+ ) : /* @__PURE__ */ l(
363
367
  "select",
364
368
  {
365
369
  value: e.model,
@@ -369,7 +373,7 @@ function H(e) {
369
373
  children: [
370
374
  /* @__PURE__ */ t("option", { value: "", children: "Select a model…" }),
371
375
  e.model && !y && /* @__PURE__ */ t("option", { value: e.model, children: e.model }),
372
- e.models.map((n) => /* @__PURE__ */ a("option", { value: n.id, children: [
376
+ e.models.map((n) => /* @__PURE__ */ l("option", { value: n.id, children: [
373
377
  n.displayName,
374
378
  " (",
375
379
  n.provider,
@@ -379,8 +383,8 @@ function H(e) {
379
383
  }
380
384
  )
381
385
  ] }),
382
- !e.hideConnection && /* @__PURE__ */ a("div", { className: "field", children: [
383
- /* @__PURE__ */ a("span", { children: [
386
+ !e.hideConnection && /* @__PURE__ */ l("div", { className: "field", children: [
387
+ /* @__PURE__ */ l("span", { children: [
384
388
  e.label,
385
389
  "Connection"
386
390
  ] }),
@@ -395,7 +399,7 @@ function H(e) {
395
399
  "data-testid": `${e.testIdPrefix}-connection`,
396
400
  ...e.enterSubmit
397
401
  }
398
- ) : /* @__PURE__ */ a(
402
+ ) : /* @__PURE__ */ l(
399
403
  "select",
400
404
  {
401
405
  value: e.connection,
@@ -405,7 +409,7 @@ function H(e) {
405
409
  children: [
406
410
  /* @__PURE__ */ t("option", { value: "", children: "Select a connection…" }),
407
411
  e.connection && !d && /* @__PURE__ */ t("option", { value: e.connection, children: e.connection }),
408
- u.map((n) => /* @__PURE__ */ a("option", { value: n.id, disabled: n.disabledReason != null, children: [
412
+ u.map((n) => /* @__PURE__ */ l("option", { value: n.id, disabled: n.disabledReason != null, children: [
409
413
  n.displayName,
410
414
  i ? "" : ` (${n.appId})`,
411
415
  n.disabledReason != null ? ` — ${n.disabledReason}` : ""
@@ -417,6 +421,6 @@ function H(e) {
417
421
  ] });
418
422
  }
419
423
  export {
420
- _e as M
424
+ Ae as M
421
425
  };
422
- //# sourceMappingURL=ModelRoutesManager-DtByS4mE.js.map
426
+ //# sourceMappingURL=ModelRoutesManager-DqeY1mdP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModelRoutesManager-DqeY1mdP.js","sources":["../src/forms/ModelRoutesManager.tsx"],"sourcesContent":["/**\n * `<ModelRoutesManager>` — list, add, edit and delete the project's model routes. A route is the\n * name callers ask for; it resolves to one model reached through one connection, plus optional\n * fallbacks. `broken` marks a route whose connection stopped working, so it stays visible (and\n * editable) instead of silently disappearing from the list.\n *\n * The project comes from `useEditorProject(projectId)`: omitted defers to `<W6WEmbedProvider\n * project>`; `null` or `\"\"` REFUSES — the list query is disabled, no `/model-routes` request is\n * sent and \"Add\" is disabled. Every write names the resolved project, never `undefined`.\n *\n * A route reaches its model one of two ways: through one fixed account connection, or through\n * \"each person's own key\" (`invoking_user`) — the caller's personal key for the provider. The mode\n * control appears only when the deployment allows personal keys (or the route already uses them).\n * An own-key route is checked per caller (`/readiness`); when the caller has no usable key and the\n * host passed `onSetupAiKey`, the row offers a way to add one. A host that reuses ONE\n * `QueryClient` across different people must clear it when the person changes.\n *\n * `initialEditRouteId` (with `initialConnection`) opens that route's editor on mount, prefilled:\n * the connection dependents view's reconnect affordance lands here, naming the replacement\n * connection. Both are read ONCE — remount to reopen the editor.\n */\nimport { ApiError } from \"@w6w/sdk\";\nimport {\n DataTable,\n type DataTableColumn,\n EmptyState,\n RowActionsMenu,\n useEnterSubmit,\n} from \"@w6w/ui\";\nimport { type ReactNode, useState } from \"react\";\nimport { ConfirmModal } from \"../chrome/ConfirmModal.tsx\";\nimport { Modal } from \"../chrome/Modal.tsx\";\nimport { useEditorProject } from \"../project-context.ts\";\nimport { useUserScopedCredentialsEnabled } from \"../repos/ai-keys.ts\";\nimport { useConnectionsQuery } from \"../repos/connections.ts\";\nimport {\n type ConnectionChoice,\n type Model,\n type ModelFallback,\n type ModelRoute,\n type ModelRouteCredentialMode,\n connectionChoices,\n routeTarget,\n useAllModelCatalogQuery,\n useCreateModelRouteMutation,\n useDeleteModelRouteMutation,\n useModelProvidersQuery,\n useModelRouteReadinessQuery,\n useModelRoutesQuery,\n useUpdateModelRouteMutation,\n} from \"../repos/models.ts\";\n\n/**\n * Actionable copy for the route write failures the server names by code. `invalid_route_name` is\n * a 400 the NAME field caused, so it states the rule instead of only echoing the server's\n * sentence; any other error falls back to its own message.\n */\nconst COPY: Record<string, string> = {\n invalid_route_name:\n \"That route name is not valid. Use lowercase letters, digits and dashes (e.g. gpt-4o-fast): 3 to 39 characters, starting with a letter, no double dashes, not ending in a dash.\",\n credential_scope_mismatch:\n \"This route mixes account connections with each person's own key. Use one or the other for the whole route, including its fallbacks.\",\n};\n\n/** Fixed copy per readiness issue code; the server's own `message` is never shown. */\nconst READINESS_COPY: Record<string, string> = {\n personal_key_required: \"You have not added a key for this provider yet.\",\n personal_key_unavailable: \"Your key for this provider is disabled or can no longer be used.\",\n user_context_required: \"This route needs a signed-in person; it cannot run on its own.\",\n ai_credential_policy_denied: \"Your account's AI key policy does not allow this kind of key.\",\n};\nconst READINESS_GENERIC = \"This route is not ready for you to use.\";\n\nconst OWN_KEY_COPY = \"Each person uses their own key\";\n\nexport function modelRouteErrorCopy(e: unknown): string {\n if (e instanceof ApiError) {\n if (Object.hasOwn(COPY, e.code)) return COPY[e.code];\n return e.message;\n }\n return e instanceof Error ? e.message : String(e);\n}\n\nexport interface ModelRoutesManagerProps {\n /**\n * The project whose routes are managed. Omitted: the `<W6WEmbedProvider project>`. `null` or\n * `\"\"`: no project — nothing is requested and nothing can be written.\n */\n projectId?: string | null;\n /** Open this route's editor on mount (read once). The dependents view's reconnect passes it. */\n initialEditRouteId?: string;\n /** Prefill the editor's connection — a reconnect names the connection that should replace it. */\n initialConnection?: string;\n /**\n * Host callback to add a personal key for a provider. Embed never imports a router: the host\n * navigates (Studio opens My AI keys). Without it no setup control is shown.\n */\n onSetupAiKey?: (target: { providerAppId?: string; modelId?: string }) => void;\n}\n\n/** Which route the editor has open: `routeId: null` is the create form. */\ninterface EditorState {\n routeId: string | null;\n connection?: string;\n}\n\n/** One-line summary of a route's resolution, safe against long ids. */\nfunction routeSummary(r: ModelRoute): string {\n const fallbacks = r.fallbacks.length;\n const tail = fallbacks === 0 ? \"\" : ` · ${fallbacks} fallback${fallbacks === 1 ? \"\" : \"s\"}`;\n const head =\n r.credentialMode === \"invoking_user\"\n ? `${r.modelId} · ${OWN_KEY_COPY}`\n : `${r.modelId} via ${r.connectionId}`;\n return `${head}${tail}`;\n}\n\n/** Per-caller readiness of one own-key route: code-specific copy, plus the host's setup link. */\nfunction RouteReadiness(props: {\n project: string;\n route: ModelRoute;\n onSetupAiKey?: ModelRoutesManagerProps[\"onSetupAiKey\"];\n}) {\n const { route } = props;\n const q = useModelRouteReadinessQuery(props.project, route.name);\n const r = q.data;\n if (!r) return null;\n const setup = r.setup;\n return (\n <div className=\"muted small\" data-testid={`model-route-readiness-${route.name}`}>\n {r.ready ? (\n \"Ready for you\"\n ) : (\n <>\n {(r.issues.length > 0 ? r.issues : [{ code: \"\" }]).map((i) => (\n <div key={i.code}>\n {Object.hasOwn(READINESS_COPY, i.code) ? READINESS_COPY[i.code] : READINESS_GENERIC}\n </div>\n ))}\n </>\n )}\n {r.ready === false && setup != null && props.onSetupAiKey != null && (\n <button\n type=\"button\"\n className=\"btn ghost\"\n onClick={() =>\n props.onSetupAiKey?.({ providerAppId: setup.providerAppId, modelId: setup.modelId })\n }\n data-testid={`model-route-setup-${route.name}`}\n >\n Add your key\n </button>\n )}\n </div>\n );\n}\n\nexport function ModelRoutesManager(props: ModelRoutesManagerProps): ReactNode {\n const project = useEditorProject(props.projectId);\n const [editor, setEditor] = useState<EditorState | null>(() =>\n props.initialEditRouteId\n ? { routeId: props.initialEditRouteId, connection: props.initialConnection }\n : null,\n );\n const [pending, setPending] = useState<ModelRoute | null>(null);\n const [deleteError, setDeleteError] = useState<string | null>(null);\n\n const routesQuery = useModelRoutesQuery(project ?? undefined);\n const deleteMut = useDeleteModelRouteMutation();\n const routes = routesQuery.data ?? [];\n const canCreate = project != null;\n // The reconnect flow names a route by id; the row itself arrives with the list.\n const editing = editor?.routeId == null ? undefined : routes.find((r) => r.id === editor.routeId);\n const editorReady = editor != null && (editor.routeId == null || editing != null);\n\n const columns: DataTableColumn<ModelRoute>[] = [\n {\n key: \"name\",\n header: \"Route\",\n render: (r) => (\n <div className=\"list-main\" style={{ maxWidth: 0, minWidth: \"100%\" }}>\n <strong className=\"list-name\" title={r.name}>\n {r.name}\n </strong>{\" \"}\n <span className={r.status === \"broken\" ? \"tag warn\" : \"tag\"}>{r.status}</span>\n <div className=\"muted small list-preview\" title={routeSummary(r)}>\n {routeSummary(r)}\n </div>\n {r.credentialMode === \"invoking_user\" && project != null && (\n <RouteReadiness project={project} route={r} onSetupAiKey={props.onSetupAiKey} />\n )}\n </div>\n ),\n },\n {\n key: \"connection\",\n header: \"Connection\",\n render: (r) =>\n r.credentialMode === \"invoking_user\" ? (\n <span>{OWN_KEY_COPY}</span>\n ) : (\n <code>{r.connectionId}</code>\n ),\n },\n {\n key: \"actions\",\n header: \"\",\n align: \"right\",\n link: false,\n actions: true,\n render: (r) => (\n <RowActionsMenu\n label={`Actions for ${r.name}`}\n data-testid={`model-route-actions-${r.name}`}\n actions={[\n {\n label: \"Edit\",\n icon: \"edit\",\n onSelect: () => setEditor({ routeId: r.id }),\n \"data-testid\": `model-route-edit-${r.name}`,\n },\n {\n label: \"Delete\",\n icon: \"delete\",\n danger: true,\n disabled: deleteMut.isPending,\n onSelect: () => setPending(r),\n \"data-testid\": `model-route-delete-${r.name}`,\n },\n ]}\n />\n ),\n },\n ];\n\n return (\n <div className=\"w6w-embed-root\">\n <section className=\"section\">\n <div className=\"section-head\">\n <div>\n <h3>Model routes</h3>\n <p className=\"muted small\">\n Give a model a name your workflows can use, such as “support-assistant”. Each route\n pairs a model with an integration. You can add fallback models if a call fails.\n </p>\n </div>\n <button\n type=\"button\"\n className=\"btn\"\n disabled={!canCreate}\n onClick={() => setEditor({ routeId: null })}\n data-testid=\"model-route-add\"\n >\n + Add route\n </button>\n </div>\n\n {deleteError && (\n <div className=\"result error\" role=\"alert\" data-testid=\"model-route-delete-error\">\n {deleteError}\n </div>\n )}\n\n <div>\n {routesQuery.isLoading && <p className=\"muted\">Loading…</p>}\n {routesQuery.data?.length === 0 && (\n <EmptyState testId=\"model-routes-empty\">\n No model routes yet. Add one to give callers a stable name for a model.\n </EmptyState>\n )}\n {routes.length > 0 && (\n <DataTable\n columns={columns}\n rows={routes}\n rowKey={(r) => r.id}\n testId=\"model-routes-table\"\n />\n )}\n </div>\n\n {editorReady && project != null && editor != null && (\n <RouteModal\n project={project}\n initial={editing}\n initialConnection={editor.connection}\n onSetupAiKey={props.onSetupAiKey}\n onClose={() => setEditor(null)}\n onSaved={() => setEditor(null)}\n />\n )}\n\n {pending != null && project != null && (\n <ConfirmModal\n title=\"Delete model route\"\n message={`Delete the model route \"${pending.name}\"? Calls that name it will fail until another route covers the model.`}\n confirmLabel=\"Delete\"\n onConfirm={() => {\n const name = pending.name;\n setDeleteError(null);\n deleteMut.mutate(\n { project, name },\n {\n onError: (e: unknown) =>\n setDeleteError(`Could not delete \"${name}\": ${modelRouteErrorCopy(e)}`),\n },\n );\n setPending(null);\n }}\n onClose={() => setPending(null)}\n />\n )}\n </section>\n </div>\n );\n}\n\n/**\n * Create/edit modal. The name is the route's address, so it is fixed once created (the server\n * patches by name); model and connection stay editable — a reconnect is exactly a connection\n * change.\n */\nfunction RouteModal(props: {\n project: string;\n initial?: ModelRoute;\n initialConnection?: string;\n onSetupAiKey?: ModelRoutesManagerProps[\"onSetupAiKey\"];\n onClose: () => void;\n onSaved: () => void;\n}) {\n const isEdit = !!props.initial;\n const userKeysEnabled = useUserScopedCredentialsEnabled();\n const [mode, setMode] = useState<ModelRouteCredentialMode>(\n props.initial?.credentialMode ?? \"account\",\n );\n const ownKey = mode === \"invoking_user\";\n const showModeControl = userKeysEnabled || props.initial?.credentialMode === \"invoking_user\";\n const [name, setName] = useState(props.initial?.name ?? \"\");\n const [model, setModel] = useState(props.initial?.modelId ?? \"\");\n const [connection, setConnection] = useState(\n props.initialConnection ?? props.initial?.connectionId ?? \"\",\n );\n const [fallbacks, setFallbacks] = useState<ModelFallback[]>(props.initial?.fallbacks ?? []);\n const [error, setError] = useState<string | null>(null);\n\n const catalog = useAllModelCatalogQuery({ status: \"active\" });\n const connectionsQuery = useConnectionsQuery();\n const models = catalog.data?.models ?? [];\n const providersQuery = useModelProvidersQuery();\n // Descriptor-driven: only designated providers, disabled with a reason when `complete` is not\n // supported. Never an app id or category guess.\n const connections = connectionChoices(\n connectionsQuery.data ?? [],\n providersQuery.data ?? [],\n \"complete\",\n );\n const catalogEmpty = catalog.isSuccess && models.length === 0;\n\n const createMut = useCreateModelRouteMutation();\n const updateMut = useUpdateModelRouteMutation();\n const saving = createMut.isPending || updateMut.isPending;\n const canSave =\n !!name &&\n !!model &&\n (ownKey || !!connection) &&\n fallbacks.every((f) => !!f.model && (ownKey || !!f.connection)) &&\n !saving;\n\n function save() {\n setError(null);\n const onSettled = {\n onSuccess: () => props.onSaved(),\n onError: (e: unknown) => setError(modelRouteErrorCopy(e)),\n };\n if (props.initial) {\n updateMut.mutate(\n {\n project: props.project,\n name: props.initial.name,\n patch: {\n ...routeTarget(mode, { model, connection }),\n fallbacks: fallbacks.map((f) => routeTarget(mode, f)),\n },\n },\n onSettled,\n );\n return;\n }\n createMut.mutate(\n {\n project: props.project,\n input: {\n name,\n ...routeTarget(mode, { model, connection }),\n ...(fallbacks.length > 0\n ? { fallbacks: fallbacks.map((f) => routeTarget(mode, f)) }\n : {}),\n },\n },\n onSettled,\n );\n }\n\n const enterSubmit = useEnterSubmit(save, { enabled: canSave });\n\n return (\n <Modal\n title={props.initial ? `Edit ${props.initial.name}` : \"Add model route\"}\n onClose={props.onClose}\n >\n <div className=\"modal-body\">\n <label className=\"field\">\n <span>Name</span>\n <input\n type=\"text\"\n value={name}\n disabled={isEdit}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"e.g. gpt-4o-fast\"\n maxLength={64}\n data-testid=\"model-route-name\"\n {...enterSubmit}\n />\n {!isEdit && (\n <span className=\"hint\">\n 3 to 39 characters: lowercase letters, digits and dashes, starting with a letter, no\n double dashes, not ending in a dash. Callers use this name; it cannot be renamed\n later.\n </span>\n )}\n </label>\n\n {catalogEmpty && (\n <EmptyState testId=\"model-route-catalog-empty\">\n The model catalog is empty. Open the Catalog tab to discover models; until then you can\n type ids by hand.\n </EmptyState>\n )}\n\n {showModeControl && (\n <label className=\"field\">\n <span>Credentials</span>\n <select\n value={mode}\n onChange={(e) => setMode(e.target.value as ModelRouteCredentialMode)}\n data-testid=\"model-route-mode\"\n >\n <option value=\"account\">One account connection</option>\n <option value=\"invoking_user\">Each person's own key</option>\n </select>\n </label>\n )}\n\n <PairFields\n label=\"\"\n model={model}\n connection={connection}\n onModel={setModel}\n onConnection={setConnection}\n models={models}\n connections={connections}\n catalogEmpty={catalogEmpty}\n hideConnection={ownKey}\n testIdPrefix=\"model-route\"\n enterSubmit={enterSubmit}\n />\n {ownKey ? (\n <div className=\"hint\" data-testid=\"model-route-own-key\">\n {OWN_KEY_COPY}.{\" \"}\n {props.onSetupAiKey != null && (\n <button\n type=\"button\"\n className=\"btn ghost\"\n onClick={() =>\n props.onSetupAiKey?.({\n providerAppId: models.find((m) => m.id === model)?.providerAppId,\n modelId: model || undefined,\n })\n }\n data-testid=\"model-route-manage-keys\"\n >\n Manage your AI keys\n </button>\n )}\n </div>\n ) : (\n <span className=\"hint\">\n The connection holds the credentials for the model. Changing it fixes a broken route.\n </span>\n )}\n\n <div className=\"field\">\n <span>Fallbacks</span>\n {fallbacks.map((f, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: rows have no identity beyond position\n <div key={i} style={{ display: \"flex\", gap: \"var(--w6w-sp-1-5)\" }}>\n <PairFields\n label={`Fallback ${i + 1} `}\n model={f.model}\n connection={f.connection}\n onModel={(v) =>\n setFallbacks((fs) => fs.map((x, j) => (j === i ? { ...x, model: v } : x)))\n }\n onConnection={(v) =>\n setFallbacks((fs) => fs.map((x, j) => (j === i ? { ...x, connection: v } : x)))\n }\n models={models}\n connections={connections}\n catalogEmpty={catalogEmpty}\n hideConnection={ownKey}\n testIdPrefix={`model-route-fallback-${i}`}\n enterSubmit={enterSubmit}\n />\n <button\n type=\"button\"\n className=\"btn ghost\"\n onClick={() => setFallbacks((fs) => fs.filter((_, j) => j !== i))}\n data-testid={`model-route-fallback-${i}-remove`}\n >\n Remove\n </button>\n </div>\n ))}\n <button\n type=\"button\"\n className=\"btn ghost\"\n onClick={() => setFallbacks((fs) => [...fs, { model: \"\", connection: \"\" }])}\n data-testid=\"model-route-fallback-add\"\n >\n + Add fallback\n </button>\n </div>\n\n {error && (\n <div className=\"result error\" data-testid=\"model-route-error\">\n {error}\n </div>\n )}\n </div>\n <div className=\"modal-actions\">\n <button type=\"button\" className=\"btn ghost\" onClick={props.onClose}>\n Cancel\n </button>\n <button\n type=\"button\"\n className=\"btn\"\n disabled={!canSave}\n onClick={save}\n data-testid=\"model-route-save\"\n >\n {saving ? \"Saving…\" : isEdit ? \"Save changes\" : \"Save route\"}\n </button>\n </div>\n </Modal>\n );\n}\n\ninterface PairFieldsProps {\n label: string;\n model: string;\n connection: string;\n onModel: (v: string) => void;\n onConnection: (v: string) => void;\n models: Model[];\n connections: ConnectionChoice[];\n catalogEmpty: boolean;\n /** Own-key mode: the route has no fixed connection, so no connection select at all. */\n hideConnection?: boolean;\n testIdPrefix: string;\n enterSubmit: Record<string, unknown>;\n}\n\n/**\n * A model + connection pair as selects fed by the catalog and the connections list. Connections\n * narrow to the chosen model's provider app; if none match, all are listed (labelled) so the\n * route can still be saved. An empty catalog falls back to free text.\n */\nfunction PairFields(p: PairFieldsProps) {\n const picked = p.models.find((m) => m.id === p.model);\n const matching = picked\n ? p.connections.filter((c) => c.appId === picked.providerAppId)\n : p.connections;\n const narrowed = picked != null && matching.length > 0;\n const options = narrowed ? matching : p.connections;\n const connHas = options.some((c) => c.id === p.connection);\n const modelHas = p.models.some((m) => m.id === p.model);\n return (\n <>\n <div className=\"field\">\n <span>{p.label}Model</span>\n {p.catalogEmpty ? (\n <input\n type=\"text\"\n value={p.model}\n onChange={(e) => p.onModel(e.target.value)}\n placeholder=\"model id\"\n aria-label={`${p.label}Model`}\n data-testid={`${p.testIdPrefix}-model`}\n {...p.enterSubmit}\n />\n ) : (\n <select\n value={p.model}\n onChange={(e) => p.onModel(e.target.value)}\n aria-label={`${p.label}Model`}\n data-testid={`${p.testIdPrefix}-model`}\n >\n <option value=\"\">Select a model…</option>\n {p.model && !modelHas && <option value={p.model}>{p.model}</option>}\n {p.models.map((m) => (\n <option key={m.id} value={m.id}>\n {m.displayName} ({m.provider})\n </option>\n ))}\n </select>\n )}\n </div>\n {!p.hideConnection && (\n <div className=\"field\">\n <span>{p.label}Connection</span>\n {p.catalogEmpty && p.connections.length === 0 ? (\n <input\n type=\"text\"\n value={p.connection}\n onChange={(e) => p.onConnection(e.target.value)}\n placeholder=\"connection id\"\n aria-label={`${p.label}Connection`}\n data-testid={`${p.testIdPrefix}-connection`}\n {...p.enterSubmit}\n />\n ) : (\n <select\n value={p.connection}\n onChange={(e) => p.onConnection(e.target.value)}\n aria-label={`${p.label}Connection`}\n data-testid={`${p.testIdPrefix}-connection`}\n >\n <option value=\"\">Select a connection…</option>\n {p.connection && !connHas && <option value={p.connection}>{p.connection}</option>}\n {options.map((c) => (\n <option key={c.id} value={c.id} disabled={c.disabledReason != null}>\n {c.displayName}\n {narrowed ? \"\" : ` (${c.appId})`}\n {c.disabledReason != null ? ` — ${c.disabledReason}` : \"\"}\n </option>\n ))}\n </select>\n )}\n </div>\n )}\n </>\n );\n}\n"],"names":["COPY","READINESS_COPY","READINESS_GENERIC","OWN_KEY_COPY","modelRouteErrorCopy","ApiError","routeSummary","r","fallbacks","tail","RouteReadiness","props","route","useModelRouteReadinessQuery","setup","jsxs","jsx","Fragment","i","_a","ModelRoutesManager","project","useEditorProject","editor","setEditor","useState","pending","setPending","deleteError","setDeleteError","routesQuery","useModelRoutesQuery","deleteMut","useDeleteModelRouteMutation","routes","canCreate","editing","editorReady","columns","RowActionsMenu","EmptyState","DataTable","RouteModal","ConfirmModal","name","e","isEdit","userKeysEnabled","useUserScopedCredentialsEnabled","mode","setMode","ownKey","showModeControl","_b","setName","_c","model","setModel","_d","connection","setConnection","_e","setFallbacks","_f","error","setError","catalog","useAllModelCatalogQuery","connectionsQuery","useConnectionsQuery","models","_g","providersQuery","useModelProvidersQuery","connections","connectionChoices","catalogEmpty","createMut","useCreateModelRouteMutation","updateMut","useUpdateModelRouteMutation","saving","canSave","f","save","onSettled","routeTarget","enterSubmit","useEnterSubmit","Modal","PairFields","m","v","fs","x","j","_","p","picked","matching","c","narrowed","options","connHas","modelHas"],"mappings":";;;;;;;;;AAyDA,MAAMA,IAA+B;AAAA,EACnC,oBACE;AAAA,EACF,2BACE;AACJ,GAGMC,IAAyC;AAAA,EAC7C,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,6BAA6B;AAC/B,GACMC,KAAoB,2CAEpBC,IAAe;AAEd,SAASC,EAAoB,GAAoB;AACtD,SAAI,aAAaC,KACX,OAAO,OAAOL,GAAM,EAAE,IAAI,IAAUA,EAAK,EAAE,IAAI,IAC5C,EAAE,UAEJ,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC;AAClD;AA0BA,SAASM,EAAaC,GAAuB;AAC3C,QAAMC,IAAYD,EAAE,UAAU,QACxBE,IAAOD,MAAc,IAAI,KAAK,MAAMA,CAAS,YAAYA,MAAc,IAAI,KAAK,GAAG;AAKzF,SAAO,GAHLD,EAAE,mBAAmB,kBACjB,GAAGA,EAAE,OAAO,MAAMJ,CAAY,KAC9B,GAAGI,EAAE,OAAO,QAAQA,EAAE,YAAY,EAC1B,GAAGE,CAAI;AACvB;AAGA,SAASC,GAAeC,GAIrB;AACD,QAAM,EAAE,OAAAC,MAAUD,GAEZJ,IADIM,GAA4BF,EAAM,SAASC,EAAM,IAAI,EACnD;AACZ,MAAI,CAACL,EAAG,QAAO;AACf,QAAMO,IAAQP,EAAE;AAChB,SACE,gBAAAQ,EAAC,SAAI,WAAU,eAAc,eAAa,yBAAyBH,EAAM,IAAI,IAC1E,UAAA;AAAA,IAAAL,EAAE,QACD,kBAEA,gBAAAS,EAAAC,GAAA,EACI,WAAAV,EAAE,OAAO,SAAS,IAAIA,EAAE,SAAS,CAAC,EAAE,MAAM,GAAA,CAAI,GAAG,IAAI,CAACW,MACtD,gBAAAF,EAAC,OAAA,EACE,UAAA,OAAO,OAAOf,GAAgBiB,EAAE,IAAI,IAAIjB,EAAeiB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as w, createElement as J, useId as wn, useCallback as E, useContext as Sn, useRef as S, useEffect as T, Suspense as kn, lazy as Nn } from "react";
6
6
  import { E as En, $ as Rn, W as Cn, Q as Pn, V as An, q as Tn, X as jn, v as On, B as In, A as Fn, N as Ln, a as Mn, z as Jn, n as Dn, y as Bn, t as Wn, b as $n } from "./workflows-Dz8LMjnt.js";
7
7
  import { H as xn, a as Kn } from "./editor-apps-HEOclsxL.js";
8
- import { M as ue } from "./ConfirmModal-Pv2-A_3U.js";
9
- import { d as Qn, W as _n, e as qn, R as Hn, P as Vn, b as zn, c as Gn } from "./editor-tools-CVYTsVFN.js";
8
+ import { M as ue } from "./ConfirmModal-WqBfWftD.js";
9
+ import { d as Qn, W as _n, e as qn, R as Hn, P as Vn, b as zn, c as Gn } from "./editor-tools--Y3wlBZE.js";
10
10
  import { u as Yn } from "./client-context-CX61Bgw-.js";
11
11
  import { u as Un } from "./use-workflow-draft-l3P5KZzw.js";
12
12
  import { r as Xn, h as Zn, e as es, f as ts, a as ns, d as ss, b as os, p as is, i as rs, g as as } from "./setup-incomplete-BHs3Lpfy.js";
@@ -1114,4 +1114,4 @@ export {
1114
1114
  Ws as a,
1115
1115
  Fs as b
1116
1116
  };
1117
- //# sourceMappingURL=WorkflowEditor-CvWkVmFn.js.map
1117
+ //# sourceMappingURL=WorkflowEditor-CBUwh85L.js.map