@westonkd/sprint 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as l, jsxs as C, Fragment as Le } from "react/jsx-runtime";
2
- import { useContext as ne, createContext as $e, Fragment as Se, isValidElement as Rt, useRef as m, useEffect as _, useState as J, useCallback as B, useLayoutEffect as Lt, useId as le, useMemo as ee, Children as Ye } from "react";
1
+ import { jsx as s, jsxs as A, Fragment as Re } from "react/jsx-runtime";
2
+ import { useContext as ne, createContext as $e, Fragment as Se, isValidElement as Lt, useRef as m, useEffect as _, useState as Y, useCallback as B, useLayoutEffect as Rt, useId as le, useMemo as ee, Children as Ye } from "react";
3
3
  import { flushSync as $t } from "react-dom";
4
- const Q = "data-sprint", oe = "data-sprint-part", pe = "data-sprint-", ce = "data-sprint-tool", Je = "data-sprint-owner", Qe = "data-sprint-agent", Ot = "data-sprint-view", Dt = "data-sprint-view-copy", Et = "data-sprint-theme", Oe = "data-sprint-region", Mt = [
4
+ const Q = "data-sprint", ae = "data-sprint-part", pe = "data-sprint-", ce = "data-sprint-tool", Je = "data-sprint-owner", Qe = "data-sprint-agent", Ot = "data-sprint-view", Dt = "data-sprint-view-copy", Et = "data-sprint-theme", Oe = "data-sprint-region", Mt = [
5
5
  "part",
6
6
  "tool",
7
7
  "owner",
@@ -16,47 +16,47 @@ function Ze(e, t = {}) {
16
16
  const n = {
17
17
  [Q]: e
18
18
  };
19
- t.part && (n[oe] = t.part);
20
- for (const [o, a] of Object.entries(t.state ?? {}))
21
- a == null || a === !1 || (n[`${pe}${o}`] = a === !0 ? "" : String(a));
19
+ t.part && (n[ae] = t.part);
20
+ for (const [a, o] of Object.entries(t.state ?? {}))
21
+ o == null || o === !1 || (n[`${pe}${a}`] = o === !0 ? "" : String(o));
22
22
  return n;
23
23
  }
24
- function ao(e, t) {
24
+ function ia(e, t) {
25
25
  const n = `[${Q}="${e}"]`;
26
- return t ? `${n} [${oe}="${t}"]` : n;
26
+ return t ? `${n} [${ae}="${t}"]` : n;
27
27
  }
28
28
  const xe = `
29
29
  … truncated`;
30
- function Ne(e, t) {
30
+ function Pe(e, t) {
31
31
  if (e.length <= t) return e;
32
32
  if (t <= xe.length) return e.slice(0, t);
33
- const n = t - xe.length, o = e.slice(0, n), a = o.lastIndexOf(`
33
+ const n = t - xe.length, a = e.slice(0, n), o = a.lastIndexOf(`
34
34
  `);
35
- return `${a > n / 2 ? o.slice(0, a) : o.trimEnd()}${xe}`;
35
+ return `${o > n / 2 ? a.slice(0, o) : a.trimEnd()}${xe}`;
36
36
  }
37
37
  function et(e, t) {
38
38
  if (t <= 0) return [e];
39
39
  const n = e.split(`
40
- `), o = [];
41
- let a = "";
42
- for (const r of n) {
43
- const s = a === "" ? r : `${a}
44
- ${r}`;
45
- if (s.length <= t) {
46
- a = s;
40
+ `), a = [];
41
+ let o = "";
42
+ for (const i of n) {
43
+ const l = o === "" ? i : `${o}
44
+ ${i}`;
45
+ if (l.length <= t) {
46
+ o = l;
47
47
  continue;
48
48
  }
49
- if (a !== "" && o.push(a), a = r.length <= t ? r : "", r.length > t)
50
- for (let i = 0; i < r.length; i += t)
51
- o.push(r.slice(i, i + t));
49
+ if (o !== "" && a.push(o), o = i.length <= t ? i : "", i.length > t)
50
+ for (let r = 0; r < i.length; r += t)
51
+ a.push(i.slice(r, r + t));
52
52
  }
53
- return a !== "" && o.push(a), o.length === 0 ? [""] : o;
53
+ return o !== "" && a.push(o), a.length === 0 ? [""] : a;
54
54
  }
55
- const te = 1500, qe = 500, Ue = 150;
55
+ const te = 1500, qe = 500, Ie = 150;
56
56
  function tt() {
57
57
  return typeof document > "u" ? null : document.modelContext ?? null;
58
58
  }
59
- function ro() {
59
+ function ra() {
60
60
  return tt() !== null;
61
61
  }
62
62
  function qt(e) {
@@ -65,44 +65,44 @@ function qt(e) {
65
65
  `Tool "${e.name}" description is ${e.description.length} characters; the platform limit is ${qe}.`
66
66
  );
67
67
  for (const [t, n] of Object.entries(e.inputSchema.properties)) {
68
- const o = n.description ?? "";
69
- if (o.length > Ue)
68
+ const a = n.description ?? "";
69
+ if (a.length > Ie)
70
70
  throw new Error(
71
- `Tool "${e.name}" parameter "${t}" description is ${o.length} characters; the platform limit is ${Ue}.`
71
+ `Tool "${e.name}" parameter "${t}" description is ${a.length} characters; the platform limit is ${Ie}.`
72
72
  );
73
73
  }
74
74
  }
75
- function Ut(e, t) {
75
+ function It(e, t) {
76
76
  for (const n of e.required ?? [])
77
77
  if (t[n] === void 0) {
78
- const o = Object.keys(e.properties).join(", ");
79
- return `Missing required parameter "${n}". Expected parameters: ${o || "none"}.`;
78
+ const a = Object.keys(e.properties).join(", ");
79
+ return `Missing required parameter "${n}". Expected parameters: ${a || "none"}.`;
80
80
  }
81
- for (const [n, o] of Object.entries(t)) {
82
- if (o === void 0) continue;
83
- const a = e.properties[n];
84
- if (a === void 0) {
81
+ for (const [n, a] of Object.entries(t)) {
82
+ if (a === void 0) continue;
83
+ const o = e.properties[n];
84
+ if (o === void 0) {
85
85
  const d = Object.keys(e.properties).join(", ");
86
86
  return `Unknown parameter "${n}". Expected parameters: ${d || "none"}.`;
87
87
  }
88
- const r = typeof o, s = a.type === "number" || a.type === "integer";
89
- if (!(a.type === "string" && r === "string" || s && r === "number" || a.type === "boolean" && r === "boolean"))
90
- return `Parameter "${n}" must be a ${a.type}, received ${r}.`;
91
- if (a.enum !== void 0 && !a.enum.includes(String(o)))
92
- return `Parameter "${n}" must be one of: ${a.enum.join(", ")}.`;
88
+ const i = typeof a, l = o.type === "number" || o.type === "integer";
89
+ if (!(o.type === "string" && i === "string" || l && i === "number" || o.type === "boolean" && i === "boolean"))
90
+ return `Parameter "${n}" must be a ${o.type}, received ${i}.`;
91
+ if (o.enum !== void 0 && !o.enum.includes(String(a)))
92
+ return `Parameter "${n}" must be one of: ${o.enum.join(", ")}.`;
93
93
  }
94
94
  return null;
95
95
  }
96
- function It(e) {
97
- return { ...e, execute: async (n, o) => {
98
- const a = Ut(e.inputSchema, n ?? {});
99
- if (a !== null) return a;
96
+ function Ut(e) {
97
+ return { ...e, execute: async (n, a) => {
98
+ const o = It(e.inputSchema, n ?? {});
99
+ if (o !== null) return o;
100
100
  try {
101
- const r = await e.execute(n ?? {}, o);
102
- return r === null ? null : Ne(r, te);
103
- } catch (r) {
104
- const s = r instanceof Error ? r.message : String(r);
105
- return Ne(`Tool "${e.name}" failed: ${s}`, te);
101
+ const i = await e.execute(n ?? {}, a);
102
+ return i === null ? null : Pe(i, te);
103
+ } catch (i) {
104
+ const l = i instanceof Error ? i.message : String(i);
105
+ return Pe(`Tool "${e.name}" failed: ${l}`, te);
106
106
  }
107
107
  } };
108
108
  }
@@ -110,9 +110,9 @@ function Wt(e, t) {
110
110
  qt(e);
111
111
  const n = tt();
112
112
  if (n === null || t.aborted) return !1;
113
- const o = n.registerTool(It(e), { signal: t });
114
- return o instanceof Promise && o.catch((a) => {
115
- console.warn(`Sprint could not register tool "${e.name}"`, a);
113
+ const a = n.registerTool(Ut(e), { signal: t });
114
+ return a instanceof Promise && a.catch((o) => {
115
+ console.warn(`Sprint could not register tool "${e.name}"`, o);
116
116
  }), !0;
117
117
  }
118
118
  const Bt = "<scope>-<verb>-<label-slug>", ge = /* @__PURE__ */ new Map();
@@ -128,13 +128,13 @@ function jt(e) {
128
128
  function _t() {
129
129
  return [...ge.values()].sort((e, t) => e.name.localeCompare(t.name));
130
130
  }
131
- function io(e) {
131
+ function sa(e) {
132
132
  return {
133
133
  library: "sprint",
134
134
  version: e,
135
135
  conventions: {
136
136
  componentAttribute: Q,
137
- partAttribute: oe,
137
+ partAttribute: ae,
138
138
  stateAttributePrefix: pe,
139
139
  toolAttribute: ce,
140
140
  ownerAttribute: Je,
@@ -155,47 +155,47 @@ function nt(e) {
155
155
  t += 1 + nt(n.children);
156
156
  return t;
157
157
  }
158
- function ot(e) {
158
+ function at(e) {
159
159
  const t = Object.keys(e).sort();
160
- return t.length === 0 ? "" : ` [${t.map((o) => {
161
- const a = e[o];
162
- return a === !0 ? o : `${o}=${a}`;
160
+ return t.length === 0 ? "" : ` [${t.map((a) => {
161
+ const o = e[a];
162
+ return o === !0 ? a : `${a}=${o}`;
163
163
  }).join(", ")}]`;
164
164
  }
165
- function at(e) {
165
+ function ot(e) {
166
166
  return e === void 0 ? "" : ` "${e}"`;
167
167
  }
168
- function rt(e) {
168
+ function it(e) {
169
169
  return e === void 0 ? "" : ` → tool \`${e}\``;
170
170
  }
171
- function Ft(e, t) {
172
- return `${t}- part \`${e.part}\`${at(e.label)}${ot(
171
+ function Ht(e, t) {
172
+ return `${t}- part \`${e.part}\`${ot(e.label)}${at(
173
173
  e.state
174
- )}${rt(e.tool)}`;
174
+ )}${it(e.tool)}`;
175
175
  }
176
- function Ht(e) {
176
+ function Ft(e) {
177
177
  const t = Vt(e) ? " (empty)" : "", n = e.owner === void 0 ? "" : ` (owned by \`${e.owner}\`)`;
178
- return `- **${e.component}**${at(e.label)}${ot(
178
+ return `- **${e.component}**${ot(e.label)}${at(
179
179
  e.state
180
- )}${rt(e.tool)}${n}${t}`;
180
+ )}${it(e.tool)}${n}${t}`;
181
181
  }
182
- function it(e, t, n) {
183
- const o = [`${t}${Ht(e)}`], a = `${t} `;
182
+ function rt(e, t, n) {
183
+ const a = [`${t}${Ft(e)}`], o = `${t} `;
184
184
  if (n.includeSummary && e.summary !== void 0)
185
- for (const r of e.summary.split(`
185
+ for (const i of e.summary.split(`
186
186
  `))
187
- o.push(`${a}${r}`);
188
- for (const r of e.parts)
189
- o.push(Ft(r, a));
190
- for (const r of e.children)
191
- o.push(...it(r, a, n));
192
- return e.truncated && o.push(`${a}- … nested components omitted, depth limit reached`), o;
187
+ a.push(`${o}${i}`);
188
+ for (const i of e.parts)
189
+ a.push(Ht(i, o));
190
+ for (const i of e.children)
191
+ a.push(...rt(i, o, n));
192
+ return e.truncated && a.push(`${o}- … nested components omitted, depth limit reached`), a;
193
193
  }
194
194
  function Gt(e, t = {}) {
195
- const n = Array.isArray(e) ? e : [e], o = {
195
+ const n = Array.isArray(e) ? e : [e], a = {
196
196
  includeSummary: t.includeSummary ?? !0
197
197
  };
198
- return n.length === 0 ? "No Sprint components found." : n.flatMap((a) => it(a, "", o)).join(`
198
+ return n.length === 0 ? "No Sprint components found." : n.flatMap((o) => rt(o, "", a)).join(`
199
199
  `);
200
200
  }
201
201
  const st = (e) => Gt(e), de = $e({
@@ -206,7 +206,7 @@ const st = (e) => Gt(e), de = $e({
206
206
  format: st,
207
207
  owned: !1
208
208
  }), Kt = de.Provider;
209
- function U() {
209
+ function I() {
210
210
  return ne(de).view;
211
211
  }
212
212
  function zt() {
@@ -215,17 +215,17 @@ function zt() {
215
215
  function G() {
216
216
  return ne(de).controls;
217
217
  }
218
- function H() {
218
+ function F() {
219
219
  return ne(de).format;
220
220
  }
221
221
  const lt = $e(0), fe = lt.Provider;
222
222
  function be() {
223
223
  return ne(lt);
224
224
  }
225
- function $(e) {
225
+ function R(e) {
226
226
  const t = {};
227
- for (const [n, o] of Object.entries(e.state ?? {}))
228
- o === !1 || o === null || o === void 0 || (t[n] = o);
227
+ for (const [n, a] of Object.entries(e.state ?? {}))
228
+ a === !1 || a === null || a === void 0 || (t[n] = a);
229
229
  return {
230
230
  component: e.component,
231
231
  state: t,
@@ -255,7 +255,7 @@ function ct(e) {
255
255
  function Xt(e, t) {
256
256
  const n = {
257
257
  [Qe]: e,
258
- [oe]: t.part
258
+ [ae]: t.part
259
259
  };
260
260
  return t.tool !== void 0 && (n[ce] = t.tool), n;
261
261
  }
@@ -270,32 +270,32 @@ function ve(e, t) {
270
270
  return t([e]).split(`
271
271
  `);
272
272
  }
273
- function I(e) {
274
- const { node: t, children: n } = e, o = be(), a = H(), r = " ".repeat(o), s = ve(t, a).map((i) => `${r}${i}`);
275
- return /* @__PURE__ */ C(fe, { value: o + 1, children: [
276
- `${s.join(`
273
+ function U(e) {
274
+ const { node: t, children: n } = e, a = be(), o = F(), i = " ".repeat(a), l = ve(t, o).map((r) => `${i}${r}`);
275
+ return /* @__PURE__ */ A(fe, { value: a + 1, children: [
276
+ `${l.join(`
277
277
  `)}
278
278
  `,
279
279
  n
280
280
  ] });
281
281
  }
282
282
  function we(e) {
283
- const { node: t, onActivate: n, isActionable: o, children: a } = e, r = be(), s = H(), i = " ".repeat(r), d = ve(t, s), c = d.length - t.parts.length, p = d.slice(0, c).map((u) => `${i}${u}`);
284
- return /* @__PURE__ */ C(fe, { value: r + 1, children: [
283
+ const { node: t, onActivate: n, isActionable: a, children: o } = e, i = be(), l = F(), r = " ".repeat(i), d = ve(t, l), c = d.length - t.parts.length, p = d.slice(0, c).map((h) => `${r}${h}`);
284
+ return /* @__PURE__ */ A(fe, { value: i + 1, children: [
285
285
  `${p.join(`
286
286
  `)}
287
287
  `,
288
- t.parts.map((u, g) => {
289
- const h = d[c + g] ?? "", y = h.trimStart(), f = `${i}${h.slice(0, h.length - y.length)}`, b = `${u.part}-${u.label ?? g}`;
290
- return o !== void 0 && !o(u, g) ? /* @__PURE__ */ l(Se, { children: `${f}${y}
291
- ` }, b) : /* @__PURE__ */ C(Se, { children: [
288
+ t.parts.map((h, g) => {
289
+ const u = d[c + g] ?? "", y = u.trimStart(), f = `${r}${u.slice(0, u.length - y.length)}`, b = `${h.part}-${h.label ?? g}`;
290
+ return a !== void 0 && !a(h, g) ? /* @__PURE__ */ s(Se, { children: `${f}${y}
291
+ ` }, b) : /* @__PURE__ */ A(Se, { children: [
292
292
  f,
293
- /* @__PURE__ */ l(
293
+ /* @__PURE__ */ s(
294
294
  "button",
295
295
  {
296
296
  type: "button",
297
- ...Xt(t.component, u),
298
- onClick: () => n(u, g),
297
+ ...Xt(t.component, h),
298
+ onClick: () => n(h, g),
299
299
  children: y
300
300
  }
301
301
  ),
@@ -303,31 +303,31 @@ function we(e) {
303
303
  `
304
304
  ] }, b);
305
305
  }),
306
- a
306
+ o
307
307
  ] });
308
308
  }
309
309
  function dt(e) {
310
- const { node: t, value: n, onValueChange: o, multiline: a = !1, masked: r = !1, ref: s } = e, i = be(), d = H(), c = " ".repeat(i), p = ve(t, d).map((h) => `${c}${h}`), u = ct(t), g = a ? /* @__PURE__ */ l(
310
+ const { node: t, value: n, onValueChange: a, multiline: o = !1, masked: i = !1, ref: l } = e, r = be(), d = F(), c = " ".repeat(r), p = ve(t, d).map((u) => `${c}${u}`), h = ct(t), g = o ? /* @__PURE__ */ s(
311
311
  "textarea",
312
312
  {
313
- ...u,
313
+ ...h,
314
314
  "aria-label": t.label,
315
315
  value: n,
316
- onChange: (h) => o(h.currentTarget.value),
317
- ref: s
316
+ onChange: (u) => a(u.currentTarget.value),
317
+ ref: l
318
318
  }
319
- ) : /* @__PURE__ */ l(
319
+ ) : /* @__PURE__ */ s(
320
320
  "input",
321
321
  {
322
- ...u,
322
+ ...h,
323
323
  "aria-label": t.label,
324
- type: r ? "password" : "text",
324
+ type: i ? "password" : "text",
325
325
  value: n,
326
- onChange: (h) => o(h.currentTarget.value),
327
- ref: s
326
+ onChange: (u) => a(u.currentTarget.value),
327
+ ref: l
328
328
  }
329
329
  );
330
- return /* @__PURE__ */ C(fe, { value: i + 1, children: [
330
+ return /* @__PURE__ */ A(fe, { value: r + 1, children: [
331
331
  `${p.join(`
332
332
  `)}
333
333
  `,
@@ -337,26 +337,26 @@ function dt(e) {
337
337
  `
338
338
  ] });
339
339
  }
340
- function ue(e) {
341
- const { node: t, as: n = "button", href: o, children: a, ref: r, ...s } = e, i = be(), d = H(), c = " ".repeat(i), [p = "", ...u] = ve(t, d), g = u.map((f) => `${c}${f}`), h = ct(t), y = n === "a" ? /* @__PURE__ */ l(
340
+ function he(e) {
341
+ const { node: t, as: n = "button", href: a, children: o, ref: i, ...l } = e, r = be(), d = F(), c = " ".repeat(r), [p = "", ...h] = ve(t, d), g = h.map((f) => `${c}${f}`), u = ct(t), y = n === "a" ? /* @__PURE__ */ s(
342
342
  "a",
343
343
  {
344
- ...s,
345
- ...h,
346
- href: o ?? "#",
347
- ref: r,
344
+ ...l,
345
+ ...u,
346
+ href: a ?? "#",
347
+ ref: i,
348
348
  children: p
349
349
  }
350
- ) : /* @__PURE__ */ l(
350
+ ) : /* @__PURE__ */ s(
351
351
  "button",
352
352
  {
353
- ...s,
354
- ...h,
355
- ref: r,
353
+ ...l,
354
+ ...u,
355
+ ref: i,
356
356
  children: p
357
357
  }
358
358
  );
359
- return /* @__PURE__ */ C(fe, { value: i + 1, children: [
359
+ return /* @__PURE__ */ A(fe, { value: r + 1, children: [
360
360
  c,
361
361
  y,
362
362
  g.length === 0 ? `
@@ -364,7 +364,7 @@ function ue(e) {
364
364
  ${g.join(`
365
365
  `)}
366
366
  `,
367
- a
367
+ o
368
368
  ] });
369
369
  }
370
370
  function Yt(e) {
@@ -373,89 +373,89 @@ function Yt(e) {
373
373
  function Ae(e) {
374
374
  return e.replace(/\|/g, "\\|").replace(/\s*\n\s*/g, " ");
375
375
  }
376
- function Ie(e, t) {
376
+ function Ue(e, t) {
377
377
  return JSON.stringify([e, t]);
378
378
  }
379
- function ut(e) {
379
+ function ht(e) {
380
380
  if (e.parts.length === 0 || !e.parts.every(Yt)) return e;
381
- const t = [], n = [], o = /* @__PURE__ */ new Map();
382
- for (const r of e.parts) {
383
- const s = String(r.state.column), i = String(r.state.row);
384
- t.includes(s) || t.push(s), n.includes(i) || n.push(i), o.set(Ie(i, s), r.label ?? "");
381
+ const t = [], n = [], a = /* @__PURE__ */ new Map();
382
+ for (const i of e.parts) {
383
+ const l = String(i.state.column), r = String(i.state.row);
384
+ t.includes(l) || t.push(l), n.includes(r) || n.push(r), a.set(Ue(r, l), i.label ?? "");
385
385
  }
386
- const a = [
386
+ const o = [
387
387
  `| row | ${t.map(Ae).join(" | ")} |`,
388
388
  `| --- | ${t.map(() => "---").join(" | ")} |`,
389
389
  ...n.map(
390
- (r) => `| ${Ae(r)} | ${t.map((s) => Ae(o.get(Ie(r, s)) ?? "")).join(" | ")} |`
390
+ (i) => `| ${Ae(i)} | ${t.map((l) => Ae(a.get(Ue(i, l)) ?? "")).join(" | ")} |`
391
391
  )
392
392
  ].join(`
393
393
  `);
394
- return { ...e, parts: [], summary: a };
394
+ return { ...e, parts: [], summary: o };
395
395
  }
396
- function he(e) {
396
+ function ue(e) {
397
397
  return e.replace(/\s+/g, " ").trim();
398
398
  }
399
- function Pe(e, t) {
399
+ function Ne(e, t) {
400
400
  if (e == null || typeof e == "boolean") return;
401
401
  if (typeof e == "string" || typeof e == "number") {
402
402
  t.push(String(e));
403
403
  return;
404
404
  }
405
405
  if (Array.isArray(e)) {
406
- for (const o of e) Pe(o, t);
406
+ for (const a of e) Ne(a, t);
407
407
  return;
408
408
  }
409
- if (!Rt(e)) return;
409
+ if (!Lt(e)) return;
410
410
  const n = e.props;
411
411
  if (!(n["aria-hidden"] === !0 || n["aria-hidden"] === "true")) {
412
412
  if (typeof n["aria-label"] == "string") {
413
413
  t.push(n["aria-label"]);
414
414
  return;
415
415
  }
416
- Pe(n.children, t);
416
+ Ne(n.children, t);
417
417
  }
418
418
  }
419
- function F(e) {
419
+ function H(e) {
420
420
  const t = [];
421
- Pe(e, t);
422
- const n = he(t.join(""));
421
+ Ne(e, t);
422
+ const n = ue(t.join(""));
423
423
  return n === "" ? void 0 : n;
424
424
  }
425
425
  function Jt(e) {
426
426
  return e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden");
427
427
  }
428
- function ht(e, t, n) {
428
+ function ut(e, t, n) {
429
429
  if (e.nodeType === Node.TEXT_NODE) {
430
430
  t.push(e.nodeValue ?? "");
431
431
  return;
432
432
  }
433
433
  if (e.nodeType !== Node.ELEMENT_NODE) return;
434
- const o = e;
435
- if (Jt(o) || n > 0 && o.hasAttribute(Q)) return;
436
- const a = o.getAttribute("aria-label");
437
- if (n > 0 && a !== null) {
438
- t.push(a);
434
+ const a = e;
435
+ if (Jt(a) || n > 0 && a.hasAttribute(Q)) return;
436
+ const o = a.getAttribute("aria-label");
437
+ if (n > 0 && o !== null) {
438
+ t.push(o);
439
439
  return;
440
440
  }
441
- for (const r of Array.from(o.childNodes))
442
- ht(r, t, n + 1);
441
+ for (const i of Array.from(a.childNodes))
442
+ ut(i, t, n + 1);
443
443
  }
444
444
  function ye(e) {
445
445
  const t = e.getAttribute("aria-label");
446
446
  if (t !== null) {
447
- const r = he(t);
448
- return r === "" ? void 0 : r;
447
+ const i = ue(t);
448
+ return i === "" ? void 0 : i;
449
449
  }
450
450
  const n = e.getAttribute("aria-labelledby");
451
451
  if (n !== null) {
452
- const r = e.ownerDocument, s = n.split(/\s+/).filter((i) => i !== "").map((i) => r.getElementById(i)).filter((i) => i !== null).map((i) => ye(i) ?? "").filter((i) => i !== "");
453
- if (s.length > 0) return he(s.join(" "));
452
+ const i = e.ownerDocument, l = n.split(/\s+/).filter((r) => r !== "").map((r) => i.getElementById(r)).filter((r) => r !== null).map((r) => ye(r) ?? "").filter((r) => r !== "");
453
+ if (l.length > 0) return ue(l.join(" "));
454
454
  }
455
- const o = [];
456
- ht(e, o, 0);
457
- const a = he(o.join(""));
458
- return a === "" ? void 0 : a;
455
+ const a = [];
456
+ ut(e, a, 0);
457
+ const o = ue(a.join(""));
458
+ return o === "" ? void 0 : o;
459
459
  }
460
460
  const Qt = new Set(Mt), Zt = /* @__PURE__ */ new Map([
461
461
  ["disabled", "disabled"],
@@ -473,91 +473,91 @@ const Qt = new Set(Mt), Zt = /* @__PURE__ */ new Map([
473
473
  ]);
474
474
  function pt(e) {
475
475
  const t = {};
476
- for (const [n, o] of en) {
477
- const a = e.getAttribute(n);
478
- a === null || a === "false" || (t[o] = a === "true" || a === "" ? !0 : a);
476
+ for (const [n, a] of en) {
477
+ const o = e.getAttribute(n);
478
+ o === null || o === "false" || (t[a] = o === "true" || o === "" ? !0 : o);
479
479
  }
480
- for (const [n, o] of Zt)
481
- e.hasAttribute(n) && (t[o] = !0);
480
+ for (const [n, a] of Zt)
481
+ e.hasAttribute(n) && (t[a] = !0);
482
482
  for (const n of Array.from(e.attributes)) {
483
483
  if (!n.name.startsWith(pe)) continue;
484
- const o = n.name.slice(pe.length);
485
- o === "" || Qt.has(o) || (t[o] = n.value === "" ? !0 : n.value);
484
+ const a = n.name.slice(pe.length);
485
+ a === "" || Qt.has(a) || (t[a] = n.value === "" ? !0 : n.value);
486
486
  }
487
487
  return t;
488
488
  }
489
489
  function tn(e) {
490
- const t = [], n = [], o = (a) => {
491
- for (const r of Array.from(a.children)) {
492
- if (r.hasAttribute(Q)) {
493
- n.push(r);
490
+ const t = [], n = [], a = (o) => {
491
+ for (const i of Array.from(o.children)) {
492
+ if (i.hasAttribute(Q)) {
493
+ n.push(i);
494
494
  continue;
495
495
  }
496
- r.hasAttribute(oe) && t.push(r), o(r);
496
+ i.hasAttribute(ae) && t.push(i), a(i);
497
497
  }
498
498
  };
499
- return o(e), { parts: t, children: n };
499
+ return a(e), { parts: t, children: n };
500
500
  }
501
501
  function nn(e) {
502
- const t = e.getAttribute(oe) ?? "", n = ye(e), o = e.getAttribute(ce);
502
+ const t = e.getAttribute(ae) ?? "", n = ye(e), a = e.getAttribute(ce);
503
503
  return {
504
504
  part: t,
505
505
  state: pt(e),
506
506
  ...n === void 0 ? {} : { label: n },
507
- ...o === null || o === "" ? {} : { tool: o }
507
+ ...a === null || a === "" ? {} : { tool: a }
508
508
  };
509
509
  }
510
510
  function De(e, t = {}) {
511
511
  const n = e.getAttribute(Q);
512
512
  if (n === null) return null;
513
- const o = t.maxDepth ?? 8, a = t.lookupMeta ?? jt, { parts: r, children: s } = tn(e), i = ye(e), d = a(n)?.summary, c = e.getAttribute(ce), p = e.getAttribute(Je), u = o <= 0 && s.length > 0;
514
- return ut({
513
+ const a = t.maxDepth ?? 8, o = t.lookupMeta ?? jt, { parts: i, children: l } = tn(e), r = ye(e), d = o(n)?.summary, c = e.getAttribute(ce), p = e.getAttribute(Je), h = a <= 0 && l.length > 0;
514
+ return ht({
515
515
  component: n,
516
516
  state: pt(e),
517
- parts: r.map(nn),
518
- children: u ? [] : s.map(
519
- (g) => De(g, { ...t, maxDepth: o - 1 })
517
+ parts: i.map(nn),
518
+ children: h ? [] : l.map(
519
+ (g) => De(g, { ...t, maxDepth: a - 1 })
520
520
  ).filter((g) => g !== null),
521
521
  ...d === void 0 ? {} : { summary: d },
522
- ...i === void 0 ? {} : { label: i },
522
+ ...r === void 0 ? {} : { label: r },
523
523
  ...c === null || c === "" ? {} : { tool: c },
524
524
  ...p === null || p === "" ? {} : { owner: p },
525
525
  ...e.hasAttribute(Oe) ? { region: !0 } : {},
526
- ...u ? { truncated: !0 } : {}
526
+ ...h ? { truncated: !0 } : {}
527
527
  });
528
528
  }
529
529
  function gt(e) {
530
- const t = [], n = (o) => {
531
- for (const a of Array.from(o.children)) {
532
- if (a.hasAttribute(Q)) {
533
- t.push(a);
530
+ const t = [], n = (a) => {
531
+ for (const o of Array.from(a.children)) {
532
+ if (o.hasAttribute(Q)) {
533
+ t.push(o);
534
534
  continue;
535
535
  }
536
- n(a);
536
+ n(o);
537
537
  }
538
538
  };
539
539
  return n(e), t;
540
540
  }
541
- function on(e) {
542
- const t = e.filter((r) => r.owner !== void 0);
541
+ function an(e) {
542
+ const t = e.filter((i) => i.owner !== void 0);
543
543
  if (t.length === 0) return e;
544
- const n = /* @__PURE__ */ new Map(), o = (r) => {
545
- r.tool && n.set(r.tool, r);
546
- for (const s of r.parts)
547
- s.tool && n.set(s.tool, r);
548
- for (const s of r.children) o(s);
544
+ const n = /* @__PURE__ */ new Map(), a = (i) => {
545
+ i.tool && n.set(i.tool, i);
546
+ for (const l of i.parts)
547
+ l.tool && n.set(l.tool, i);
548
+ for (const l of i.children) a(l);
549
549
  };
550
- for (const r of e) o(r);
551
- const a = /* @__PURE__ */ new Set();
552
- for (const r of t) {
553
- const s = r.owner === void 0 ? void 0 : n.get(r.owner);
554
- s === void 0 || s === r || (s.children.push(r), a.add(r));
550
+ for (const i of e) a(i);
551
+ const o = /* @__PURE__ */ new Set();
552
+ for (const i of t) {
553
+ const l = i.owner === void 0 ? void 0 : n.get(i.owner);
554
+ l === void 0 || l === i || (l.children.push(i), o.add(i));
555
555
  }
556
- return e.filter((r) => !a.has(r));
556
+ return e.filter((i) => !o.has(i));
557
557
  }
558
- function an(e, t = {}) {
559
- const n = gt(e).map((o) => De(o, t)).filter((o) => o !== null);
560
- return on(n);
558
+ function on(e, t = {}) {
559
+ const n = gt(e).map((a) => De(a, t)).filter((a) => a !== null);
560
+ return an(n);
561
561
  }
562
562
  function K() {
563
563
  return new Promise((e) => {
@@ -575,15 +575,15 @@ function Z(e) {
575
575
  return e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
576
576
  }
577
577
  function We(e, t, n) {
578
- const o = Z(n);
579
- if (o === "") return null;
580
- const a = [Z(t), o].filter((c) => c !== "").join("-"), r = e.map(Z).filter((c) => c !== "");
581
- for (; r.length > 0 && [...r, a].join("-").length > Ce; )
582
- r.shift();
583
- const s = [...r, a].join("-");
584
- if (s.length <= Ce) return s;
585
- const i = s.slice(0, Ce), d = i.lastIndexOf("-");
586
- return d > 0 ? i.slice(0, d) : i;
578
+ const a = Z(n);
579
+ if (a === "") return null;
580
+ const o = [Z(t), a].filter((c) => c !== "").join("-"), i = e.map(Z).filter((c) => c !== "");
581
+ for (; i.length > 0 && [...i, o].join("-").length > Ce; )
582
+ i.shift();
583
+ const l = [...i, o].join("-");
584
+ if (l.length <= Ce) return l;
585
+ const r = l.slice(0, Ce), d = r.lastIndexOf("-");
586
+ return d > 0 ? r.slice(0, d) : r;
587
587
  }
588
588
  const se = /* @__PURE__ */ new Map();
589
589
  function rn(e) {
@@ -593,16 +593,16 @@ function rn(e) {
593
593
  return se.set(e, n), n;
594
594
  }
595
595
  function sn(e, t, n) {
596
- const o = rn(e);
597
- o.holders.add(t), o.listeners.set(t, n);
598
- for (const [a, r] of o.listeners)
599
- a !== t && r();
596
+ const a = rn(e);
597
+ a.holders.add(t), a.listeners.set(t, n);
598
+ for (const [o, i] of a.listeners)
599
+ o !== t && i();
600
600
  return () => {
601
- if (o.holders.delete(t), o.listeners.delete(t), o.holders.size === 0) {
601
+ if (a.holders.delete(t), a.listeners.delete(t), a.holders.size === 0) {
602
602
  se.delete(e);
603
603
  return;
604
604
  }
605
- for (const a of o.listeners.values()) a();
605
+ for (const o of a.listeners.values()) o();
606
606
  };
607
607
  }
608
608
  function Be(e, t) {
@@ -617,35 +617,35 @@ function ke() {
617
617
  return ne(mt).path;
618
618
  }
619
619
  function V(e) {
620
- const { spec: t, label: n, nameOverride: o, inputSchema: a, enabled: r = !0, execute: s } = e, i = ke(), d = `${t.verb}|${a === void 0 ? "" : JSON.stringify(a)}`, c = m({ key: d, value: a ?? t.inputSchema });
621
- c.current.key !== d && (c.current = { key: d, value: a ?? t.inputSchema });
622
- const p = c.current.value, u = m(null);
623
- u.current === null && (u.current = /* @__PURE__ */ Symbol("sprint-tool"));
624
- const g = m(s);
620
+ const { spec: t, label: n, nameOverride: a, inputSchema: o, enabled: i = !0, execute: l } = e, r = ke(), d = `${t.verb}|${o === void 0 ? "" : JSON.stringify(o)}`, c = m({ key: d, value: o ?? t.inputSchema });
621
+ c.current.key !== d && (c.current = { key: d, value: o ?? t.inputSchema });
622
+ const p = c.current.value, h = m(null);
623
+ h.current === null && (h.current = /* @__PURE__ */ Symbol("sprint-tool"));
624
+ const g = m(l);
625
625
  _(() => {
626
- g.current = s;
626
+ g.current = l;
627
627
  });
628
- const h = o === void 0 ? n === void 0 ? null : We(i, t.verb, n) : We(i, t.verb, o), [y, f] = J(!1);
628
+ const u = a === void 0 ? n === void 0 ? null : We(r, t.verb, n) : We(r, t.verb, a), [y, f] = Y(!1);
629
629
  return _(() => {
630
- const b = u.current;
631
- if (h === null || !r || b === null) {
630
+ const b = h.current;
631
+ if (u === null || !i || b === null) {
632
632
  f(!1);
633
633
  return;
634
634
  }
635
- const w = sn(h, b, () => {
636
- f(Be(h, b));
635
+ const w = sn(u, b, () => {
636
+ f(Be(u, b));
637
637
  });
638
- return ln(h) > 1 && console.warn(
639
- `Sprint tool name "${h}" is claimed by more than one component. None of them will register a tool. Set agentName on all but one, or label them distinctly.`
640
- ), f(Be(h, b)), () => {
638
+ return ln(u) > 1 && console.warn(
639
+ `Sprint tool name "${u}" is claimed by more than one component. None of them will register a tool. Set agentName on all but one, or label them distinctly.`
640
+ ), f(Be(u, b)), () => {
641
641
  w(), f(!1);
642
642
  };
643
- }, [h, r]), _(() => {
644
- if (!y || h === null) return;
643
+ }, [u, i]), _(() => {
644
+ if (!y || u === null) return;
645
645
  const b = new AbortController();
646
646
  return Wt(
647
647
  {
648
- name: h,
648
+ name: u,
649
649
  description: t.description,
650
650
  inputSchema: p,
651
651
  annotations: {
@@ -658,7 +658,7 @@ function V(e) {
658
658
  ), () => {
659
659
  b.abort();
660
660
  };
661
- }, [y, h, t, p]), y && h !== null ? h : void 0;
661
+ }, [y, u, t, p]), y && u !== null ? u : void 0;
662
662
  }
663
663
  function z(e) {
664
664
  $t(e);
@@ -747,25 +747,25 @@ const ft = {
747
747
  notes: "Danger and warning render role=alert and announce assertively; info and neutral render role=status. The dismiss control is a labelled button. Render the alert when the condition occurs rather than toggling its visibility, or the announcement is lost."
748
748
  }
749
749
  });
750
- function so(e) {
750
+ function la(e) {
751
751
  const {
752
752
  tone: t = "info",
753
753
  label: n,
754
- onDismiss: o,
755
- agentName: a,
756
- agentTool: r = !0,
757
- children: s,
758
- ...i
759
- } = e, d = U(), c = G(), p = H(), u = m(null), g = m(o);
760
- g.current = o;
761
- const h = m(p);
762
- h.current = p;
763
- const y = m($({ component: je.name })), f = m(!0);
754
+ onDismiss: a,
755
+ agentName: o,
756
+ agentTool: i = !0,
757
+ children: l,
758
+ ...r
759
+ } = e, d = I(), c = G(), p = F(), h = m(null), g = m(a);
760
+ g.current = a;
761
+ const u = m(p);
762
+ u.current = p;
763
+ const y = m(R({ component: je.name })), f = m(!0);
764
764
  _(() => (f.current = !0, () => {
765
765
  f.current = !1;
766
766
  }), []);
767
- const b = o !== void 0, w = B(async () => {
768
- const S = u.current;
767
+ const b = a !== void 0, w = B(async () => {
768
+ const S = h.current;
769
769
  if (S !== null)
770
770
  S.click();
771
771
  else {
@@ -774,46 +774,46 @@ function so(e) {
774
774
  z(() => v());
775
775
  }
776
776
  return await K(), f.current ? `Dismissed. The alert is now:
777
- ${h.current([y.current])}` : "Dismissed. The alert is gone from the page.";
777
+ ${u.current([y.current])}` : "Dismissed. The alert is gone from the page.";
778
778
  }, []), T = V({
779
779
  spec: ft,
780
- label: a ?? n,
781
- enabled: r && b,
780
+ label: o ?? n,
781
+ enabled: i && b,
782
782
  execute: w
783
- }), A = F(s), R = [];
784
- A !== void 0 && R.push({ part: "message", label: A, state: {} }), b && R.push({
783
+ }), C = H(l), $ = [];
784
+ C !== void 0 && $.push({ part: "message", label: C, state: {} }), b && $.push({
785
785
  part: "dismiss",
786
786
  label: "Dismiss",
787
787
  state: {},
788
788
  ...T === void 0 ? {} : { tool: T }
789
789
  });
790
- const O = $({
790
+ const O = R({
791
791
  component: je.name,
792
792
  label: n,
793
793
  state: { tone: t, dismissible: b },
794
- parts: R
794
+ parts: $
795
795
  });
796
796
  if (y.current = O, d === "agent")
797
- return !b || c === "never" ? /* @__PURE__ */ l(I, { node: O }) : /* @__PURE__ */ l(
797
+ return !b || c === "never" ? /* @__PURE__ */ s(U, { node: O }) : /* @__PURE__ */ s(
798
798
  we,
799
799
  {
800
800
  node: O,
801
801
  isActionable: (S) => S.part === "dismiss",
802
- onActivate: () => o?.()
802
+ onActivate: () => a?.()
803
803
  }
804
804
  );
805
805
  const E = t === "danger" || t === "warning" ? "alert" : "status";
806
- return /* @__PURE__ */ C(
806
+ return /* @__PURE__ */ A(
807
807
  "div",
808
808
  {
809
- ...i,
809
+ ...r,
810
810
  ...M(O),
811
811
  role: E,
812
812
  ...n === void 0 ? {} : { "aria-label": n },
813
813
  children: [
814
- n === void 0 ? null : /* @__PURE__ */ l("strong", { ...L({ part: "title", state: {} }), children: n }),
815
- /* @__PURE__ */ l("div", { ...L({ part: "message", state: {} }), children: s }),
816
- b ? /* @__PURE__ */ l(
814
+ n === void 0 ? null : /* @__PURE__ */ s("strong", { ...L({ part: "title", state: {} }), children: n }),
815
+ /* @__PURE__ */ s("div", { ...L({ part: "message", state: {} }), children: l }),
816
+ b ? /* @__PURE__ */ s(
817
817
  "button",
818
818
  {
819
819
  ...L({
@@ -823,8 +823,8 @@ ${h.current([y.current])}` : "Dismissed. The alert is gone from the page.";
823
823
  }),
824
824
  type: "button",
825
825
  "aria-label": "Dismiss",
826
- ref: u,
827
- onClick: () => o?.(),
826
+ ref: h,
827
+ onClick: () => a?.(),
828
828
  children: "×"
829
829
  }
830
830
  ) : null
@@ -952,38 +952,38 @@ function dn(e) {
952
952
  const {
953
953
  tone: t = "neutral",
954
954
  block: n = !1,
955
- loading: o = !1,
956
- agentName: a,
957
- agentTool: r = !0,
958
- disabled: s = !1,
959
- type: i = "button",
955
+ loading: a = !1,
956
+ agentName: o,
957
+ agentTool: i = !0,
958
+ disabled: l = !1,
959
+ type: r = "button",
960
960
  children: d,
961
961
  ref: c,
962
962
  onClick: p,
963
- ...u
964
- } = e, g = U(), h = G(), y = H(), f = m(null), b = B(
965
- (N) => {
966
- f.current = N, typeof c == "function" ? c(N) : c != null && (c.current = N);
963
+ ...h
964
+ } = e, g = I(), u = G(), y = F(), f = m(null), b = B(
965
+ (P) => {
966
+ f.current = P, typeof c == "function" ? c(P) : c != null && (c.current = P);
967
967
  },
968
968
  [c]
969
- ), w = a ?? (typeof d == "string" ? d : void 0), [T, A] = J(void 0);
970
- Lt(() => {
969
+ ), w = o ?? (typeof d == "string" ? d : void 0), [T, C] = Y(void 0);
970
+ Rt(() => {
971
971
  if (w !== void 0) return;
972
- const N = f.current;
973
- N !== null && A(ye(N));
972
+ const P = f.current;
973
+ P !== null && C(ye(P));
974
974
  });
975
- const R = s || o, O = w ?? T, E = m(p);
975
+ const $ = l || a, O = w ?? T, E = m(p);
976
976
  E.current = p;
977
- const S = m($({ component: _e.name })), v = m(y);
977
+ const S = m(R({ component: _e.name })), v = m(y);
978
978
  v.current = y;
979
979
  const k = m(!0);
980
980
  _(() => (k.current = !0, () => {
981
981
  k.current = !1;
982
982
  }), []);
983
983
  const x = B(async () => {
984
- const N = f.current;
985
- if (N !== null)
986
- N.click();
984
+ const P = f.current;
985
+ if (P !== null)
986
+ P.click();
987
987
  else {
988
988
  const j = E.current;
989
989
  if (j === void 0)
@@ -995,33 +995,33 @@ ${v.current([S.current])}` : "The press removed this button from the page.";
995
995
  }, []), D = V({
996
996
  spec: bt,
997
997
  label: O,
998
- enabled: r && !R,
998
+ enabled: i && !$,
999
999
  execute: x
1000
- }), P = $({
1000
+ }), N = R({
1001
1001
  component: _e.name,
1002
1002
  label: O,
1003
1003
  tool: D,
1004
- state: { tone: t, block: n, loading: o, disabled: R }
1004
+ state: { tone: t, block: n, loading: a, disabled: $ }
1005
1005
  });
1006
- return S.current = P, g === "agent" ? R || h === "never" ? /* @__PURE__ */ l(I, { node: P }) : /* @__PURE__ */ l(
1007
- ue,
1006
+ return S.current = N, g === "agent" ? $ || u === "never" ? /* @__PURE__ */ s(U, { node: N }) : /* @__PURE__ */ s(
1007
+ he,
1008
1008
  {
1009
- node: P,
1010
- type: i,
1009
+ node: N,
1010
+ type: r,
1011
1011
  ref: b,
1012
1012
  onClick: p,
1013
- "aria-busy": o || void 0
1013
+ "aria-busy": a || void 0
1014
1014
  }
1015
- ) : /* @__PURE__ */ l(
1015
+ ) : /* @__PURE__ */ s(
1016
1016
  "button",
1017
1017
  {
1018
- ...u,
1019
- ...M(P),
1020
- type: i,
1018
+ ...h,
1019
+ ...M(N),
1020
+ type: r,
1021
1021
  ref: b,
1022
1022
  onClick: p,
1023
- disabled: R,
1024
- "aria-busy": o || void 0,
1023
+ disabled: $,
1024
+ "aria-busy": a || void 0,
1025
1025
  children: d
1026
1026
  }
1027
1027
  );
@@ -1109,82 +1109,82 @@ const vt = {
1109
1109
  notes: "The whole block is one control: a link when it has an href, a button when it acts. The title names it, and the body is read as its content rather than as part of the name."
1110
1110
  }
1111
1111
  });
1112
- function lo(e) {
1112
+ function ca(e) {
1113
1113
  const {
1114
1114
  label: t,
1115
1115
  children: n,
1116
- href: o,
1117
- onClick: a,
1118
- disabled: r = !1,
1119
- agentTool: s,
1120
- agentName: i,
1116
+ href: a,
1117
+ onClick: o,
1118
+ disabled: i = !1,
1119
+ agentTool: l,
1120
+ agentName: r,
1121
1121
  ref: d,
1122
1122
  ...c
1123
- } = e, p = U(), u = G(), g = H(), h = o !== void 0, y = !h && r, f = m(null), b = B(
1123
+ } = e, p = I(), h = G(), g = F(), u = a !== void 0, y = !u && i, f = m(null), b = B(
1124
1124
  (x) => {
1125
1125
  f.current = x, typeof d == "function" ? d(x) : d != null && (d.current = x);
1126
1126
  },
1127
1127
  [d]
1128
1128
  ), w = m(g);
1129
1129
  w.current = g;
1130
- const T = m($({ component: Ve.name })), A = m(!0);
1131
- _(() => (A.current = !0, () => {
1132
- A.current = !1;
1130
+ const T = m(R({ component: Ve.name })), C = m(!0);
1131
+ _(() => (C.current = !0, () => {
1132
+ C.current = !1;
1133
1133
  }), []);
1134
- const R = B(async () => {
1134
+ const $ = B(async () => {
1135
1135
  const x = f.current;
1136
- return x === null ? "This card renders no control in the current view." : (x.click(), await K(), A.current ? `Opened. The card is now:
1136
+ return x === null ? "This card renders no control in the current view." : (x.click(), await K(), C.current ? `Opened. The card is now:
1137
1137
  ${w.current([T.current])}` : "Opening removed this card from the page.");
1138
1138
  }, []), O = V({
1139
1139
  spec: vt,
1140
- label: i ?? t,
1141
- enabled: (s ?? !h) && !y,
1142
- execute: R
1143
- }), E = F(n), S = [
1140
+ label: r ?? t,
1141
+ enabled: (l ?? !u) && !y,
1142
+ execute: $
1143
+ }), E = H(n), S = [
1144
1144
  { part: "title", label: t, state: {} },
1145
1145
  ...E === void 0 ? [] : [{ part: "body", label: E, state: {} }]
1146
- ], v = $({
1146
+ ], v = R({
1147
1147
  component: Ve.name,
1148
1148
  label: t,
1149
1149
  tool: O,
1150
- state: { href: o, disabled: y },
1150
+ state: { href: a, disabled: y },
1151
1151
  parts: S
1152
1152
  });
1153
1153
  if (T.current = v, p === "agent")
1154
- return y || u === "never" ? /* @__PURE__ */ l(I, { node: v }) : /* @__PURE__ */ l(
1155
- ue,
1154
+ return y || h === "never" ? /* @__PURE__ */ s(U, { node: v }) : /* @__PURE__ */ s(
1155
+ he,
1156
1156
  {
1157
1157
  node: v,
1158
- as: h ? "a" : "button",
1159
- href: o,
1158
+ as: u ? "a" : "button",
1159
+ href: a,
1160
1160
  ref: b,
1161
- onClick: a
1161
+ onClick: o
1162
1162
  }
1163
1163
  );
1164
- const k = /* @__PURE__ */ C(Le, { children: [
1165
- /* @__PURE__ */ l("span", { ...L({ part: "title", state: {} }), children: t }),
1166
- n === void 0 ? null : /* @__PURE__ */ l("span", { ...L({ part: "body", state: {} }), children: n })
1164
+ const k = /* @__PURE__ */ A(Re, { children: [
1165
+ /* @__PURE__ */ s("span", { ...L({ part: "title", state: {} }), children: t }),
1166
+ n === void 0 ? null : /* @__PURE__ */ s("span", { ...L({ part: "body", state: {} }), children: n })
1167
1167
  ] });
1168
- return h ? /* @__PURE__ */ l(
1168
+ return u ? /* @__PURE__ */ s(
1169
1169
  "a",
1170
1170
  {
1171
1171
  ...c,
1172
1172
  ...M(v),
1173
- href: o,
1173
+ href: a,
1174
1174
  "aria-label": t,
1175
- onClick: a,
1175
+ onClick: o,
1176
1176
  ref: b,
1177
1177
  children: k
1178
1178
  }
1179
- ) : /* @__PURE__ */ l(
1179
+ ) : /* @__PURE__ */ s(
1180
1180
  "button",
1181
1181
  {
1182
1182
  ...c,
1183
1183
  ...M(v),
1184
1184
  type: "button",
1185
1185
  "aria-label": t,
1186
- disabled: r,
1187
- onClick: a,
1186
+ disabled: i,
1187
+ onClick: o,
1188
1188
  ref: b,
1189
1189
  children: k
1190
1190
  }
@@ -1207,7 +1207,7 @@ const wt = {
1207
1207
  untrustedContent: !0,
1208
1208
  registeredWhen: "The box is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
1209
1209
  unregisteredWhen: "The box unmounts or becomes disabled."
1210
- }, Fe = q({
1210
+ }, He = q({
1211
1211
  name: "Checkbox",
1212
1212
  category: "input",
1213
1213
  summary: "A single on/off choice recorded as form data. It registers one set tool that takes the end state rather than toggling.",
@@ -1325,29 +1325,29 @@ const wt = {
1325
1325
  notes: "A native checkbox input wrapped by its label, visually replaced by a keylined square. Focus draws an offset keyline around the square; errors set aria-invalid and link with aria-describedby."
1326
1326
  }
1327
1327
  });
1328
- function un(e, t) {
1328
+ function hn(e, t) {
1329
1329
  return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
1330
1330
  }
1331
- function co(e) {
1331
+ function da(e) {
1332
1332
  const {
1333
1333
  label: t,
1334
1334
  checked: n,
1335
- onChange: o,
1336
- hint: a,
1337
- error: r,
1338
- name: s,
1339
- disabled: i = !1,
1335
+ onChange: a,
1336
+ hint: o,
1337
+ error: i,
1338
+ name: l,
1339
+ disabled: r = !1,
1340
1340
  required: d = !1,
1341
1341
  agentName: c,
1342
1342
  agentTool: p = !0,
1343
- ...u
1344
- } = e, g = U(), h = G(), y = H(), f = le(), b = m(null), w = m(o);
1345
- w.current = o;
1343
+ ...h
1344
+ } = e, g = I(), u = G(), y = F(), f = le(), b = m(null), w = m(a);
1345
+ w.current = a;
1346
1346
  const T = m(n);
1347
1347
  T.current = n;
1348
- const A = m(y);
1349
- A.current = y;
1350
- const R = m($({ component: Fe.name })), O = m(!0);
1348
+ const C = m(y);
1349
+ C.current = y;
1350
+ const $ = m(R({ component: He.name })), O = m(!0);
1351
1351
  _(() => (O.current = !0, () => {
1352
1352
  O.current = !1;
1353
1353
  }), []);
@@ -1355,45 +1355,45 @@ function co(e) {
1355
1355
  const D = x.checked;
1356
1356
  if (typeof D != "boolean")
1357
1357
  return 'Pass "checked" as true or false; it states the end state.';
1358
- const P = D === T.current;
1359
- if (!P) {
1358
+ const N = D === T.current;
1359
+ if (!N) {
1360
1360
  const j = b.current;
1361
1361
  j !== null ? j.click() : z(() => w.current(D));
1362
1362
  }
1363
- return await K(), O.current ? `${P ? `Already ${D ? "checked" : "unchecked"}` : D ? "Checked" : "Unchecked"}. The checkbox is now:
1364
- ${A.current([R.current])}` : "The change removed this checkbox from the page.";
1363
+ return await K(), O.current ? `${N ? `Already ${D ? "checked" : "unchecked"}` : D ? "Checked" : "Unchecked"}. The checkbox is now:
1364
+ ${C.current([$.current])}` : "The change removed this checkbox from the page.";
1365
1365
  }, []), S = V({
1366
1366
  spec: wt,
1367
1367
  label: c ?? t,
1368
- enabled: p && !i,
1368
+ enabled: p && !r,
1369
1369
  execute: E
1370
- }), v = $({
1371
- component: Fe.name,
1370
+ }), v = R({
1371
+ component: He.name,
1372
1372
  label: t,
1373
1373
  tool: S,
1374
1374
  state: {
1375
1375
  checked: n,
1376
- disabled: i,
1376
+ disabled: r,
1377
1377
  required: d,
1378
- invalid: r !== void 0
1378
+ invalid: i !== void 0
1379
1379
  },
1380
- parts: un(r, a)
1380
+ parts: hn(i, o)
1381
1381
  });
1382
- if (R.current = v, g === "agent")
1383
- return i || h === "never" ? /* @__PURE__ */ l(I, { node: v }) : /* @__PURE__ */ l(
1384
- ue,
1382
+ if ($.current = v, g === "agent")
1383
+ return r || u === "never" ? /* @__PURE__ */ s(U, { node: v }) : /* @__PURE__ */ s(
1384
+ he,
1385
1385
  {
1386
1386
  node: v,
1387
1387
  ref: (x) => {
1388
1388
  b.current = x;
1389
1389
  },
1390
- onClick: () => o(!n)
1390
+ onClick: () => a(!n)
1391
1391
  }
1392
1392
  );
1393
- const k = r !== void 0 ? `${f}-error` : a !== void 0 ? `${f}-hint` : void 0;
1394
- return /* @__PURE__ */ C("div", { ...u, ...M(v), children: [
1395
- /* @__PURE__ */ C("label", { htmlFor: f, children: [
1396
- /* @__PURE__ */ l(
1393
+ const k = i !== void 0 ? `${f}-error` : o !== void 0 ? `${f}-hint` : void 0;
1394
+ return /* @__PURE__ */ A("div", { ...h, ...M(v), children: [
1395
+ /* @__PURE__ */ A("label", { htmlFor: f, children: [
1396
+ /* @__PURE__ */ s(
1397
1397
  "input",
1398
1398
  {
1399
1399
  id: f,
@@ -1403,15 +1403,15 @@ ${A.current([R.current])}` : "The change removed this checkbox from the page.";
1403
1403
  },
1404
1404
  type: "checkbox",
1405
1405
  checked: n,
1406
- name: s,
1407
- disabled: i,
1406
+ name: l,
1407
+ disabled: r,
1408
1408
  required: d,
1409
- "aria-invalid": r !== void 0 || void 0,
1409
+ "aria-invalid": i !== void 0 || void 0,
1410
1410
  "aria-describedby": k,
1411
- onChange: (x) => o(x.currentTarget.checked)
1411
+ onChange: (x) => a(x.currentTarget.checked)
1412
1412
  }
1413
1413
  ),
1414
- /* @__PURE__ */ l(
1414
+ /* @__PURE__ */ s(
1415
1415
  "span",
1416
1416
  {
1417
1417
  ...L({ part: "box", state: {} }),
@@ -1420,10 +1420,10 @@ ${A.current([R.current])}` : "The change removed this checkbox from the page.";
1420
1420
  ),
1421
1421
  t
1422
1422
  ] }),
1423
- r !== void 0 ? /* @__PURE__ */ l("p", { id: k, ...L({ part: "error", state: {} }), children: r }) : a !== void 0 ? /* @__PURE__ */ l("p", { id: k, ...L({ part: "hint", state: {} }), children: a }) : null
1423
+ i !== void 0 ? /* @__PURE__ */ s("p", { id: k, ...L({ part: "error", state: {} }), children: i }) : o !== void 0 ? /* @__PURE__ */ s("p", { id: k, ...L({ part: "hint", state: {} }), children: o }) : null
1424
1424
  ] });
1425
1425
  }
1426
- const hn = /(\/\/[^\n]*)|("[^"]*"|'[^']*'|`[^`]*`)|(<\/?[A-Za-z][\w.-]*)|([\w-]+(?==))|(\b(?:const|let|var|function|return|import|export|from|await|async|new|true|false|null|undefined)\b)|(\b\d+(?:\.\d+)?\b)|([<>/{}()[\];=,.]+)/g, pn = [
1426
+ const un = /(\/\/[^\n]*)|("[^"]*"|'[^']*'|`[^`]*`)|(<\/?[A-Za-z][\w.-]*)|([\w-]+(?==))|(\b(?:const|let|var|function|return|import|export|from|await|async|new|true|false|null|undefined)\b)|(\b\d+(?:\.\d+)?\b)|([<>/{}()[\];=,.]+)/g, pn = [
1427
1427
  "comment",
1428
1428
  "string",
1429
1429
  "tag",
@@ -1435,12 +1435,12 @@ const hn = /(\/\/[^\n]*)|("[^"]*"|'[^']*'|`[^`]*`)|(<\/?[A-Za-z][\w.-]*)|([\w-]+
1435
1435
  function gn(e) {
1436
1436
  const t = [];
1437
1437
  let n = 0;
1438
- for (const o of e.matchAll(hn)) {
1439
- const a = o.index;
1440
- if (a === void 0) continue;
1441
- a > n && t.push({ kind: "plain", text: e.slice(n, a) });
1442
- const r = pn.find((s, i) => o[i + 1] !== void 0) ?? "plain";
1443
- t.push({ kind: r, text: o[0] }), n = a + o[0].length;
1438
+ for (const a of e.matchAll(un)) {
1439
+ const o = a.index;
1440
+ if (o === void 0) continue;
1441
+ o > n && t.push({ kind: "plain", text: e.slice(n, o) });
1442
+ const i = pn.find((l, r) => a[r + 1] !== void 0) ?? "plain";
1443
+ t.push({ kind: i, text: a[0] }), n = o + a[0].length;
1444
1444
  }
1445
1445
  return n < e.length && t.push({ kind: "plain", text: e.slice(n) }), t;
1446
1446
  }
@@ -1515,39 +1515,39 @@ const mn = q({
1515
1515
  notes: "The frame is a figure named by its caption. The copy control is a real button and reports back in its own label once the snippet is on the clipboard; the label swap is a polite live region, so a screen reader hears the confirmation too."
1516
1516
  }
1517
1517
  }), fn = 1200;
1518
- function uo(e) {
1519
- const { code: t, caption: n, language: o = "tsx", copyLabel: a = "Copy", ...r } = e, s = U(), [i, d] = J(!1);
1518
+ function ha(e) {
1519
+ const { code: t, caption: n, language: a = "tsx", copyLabel: o = "Copy", ...i } = e, l = I(), [r, d] = Y(!1);
1520
1520
  _(() => {
1521
- if (!i) return;
1522
- const h = setTimeout(() => d(!1), fn);
1523
- return () => clearTimeout(h);
1524
- }, [i]);
1525
- const c = n ?? o, p = i ? "Copied" : a, u = $({
1521
+ if (!r) return;
1522
+ const u = setTimeout(() => d(!1), fn);
1523
+ return () => clearTimeout(u);
1524
+ }, [r]);
1525
+ const c = n ?? a, p = r ? "Copied" : o, h = R({
1526
1526
  component: mn.name,
1527
1527
  label: c,
1528
1528
  state: {
1529
- language: o,
1529
+ language: a,
1530
1530
  lines: String(t.split(`
1531
1531
  `).length),
1532
- copied: i
1532
+ copied: r
1533
1533
  },
1534
1534
  parts: [
1535
1535
  { part: "copy", label: p, state: {} },
1536
1536
  { part: "code", label: t, state: {} }
1537
1537
  ]
1538
1538
  });
1539
- if (s === "agent") return /* @__PURE__ */ l(I, { node: u });
1539
+ if (l === "agent") return /* @__PURE__ */ s(U, { node: h });
1540
1540
  const g = () => {
1541
- const h = navigator.clipboard;
1542
- h !== void 0 && h.writeText(t).then(
1541
+ const u = navigator.clipboard;
1542
+ u !== void 0 && u.writeText(t).then(
1543
1543
  () => d(!0),
1544
1544
  () => d(!1)
1545
1545
  );
1546
1546
  };
1547
- return /* @__PURE__ */ C("figure", { ...r, ...M(u), "aria-label": c, children: [
1548
- /* @__PURE__ */ C("header", { children: [
1549
- /* @__PURE__ */ l("span", { children: c }),
1550
- /* @__PURE__ */ l(
1547
+ return /* @__PURE__ */ A("figure", { ...i, ...M(h), "aria-label": c, children: [
1548
+ /* @__PURE__ */ A("header", { children: [
1549
+ /* @__PURE__ */ s("span", { children: c }),
1550
+ /* @__PURE__ */ s(
1551
1551
  "button",
1552
1552
  {
1553
1553
  type: "button",
@@ -1558,13 +1558,13 @@ function uo(e) {
1558
1558
  }
1559
1559
  )
1560
1560
  ] }),
1561
- /* @__PURE__ */ l("pre", { ...L({ part: "code", state: {} }), children: /* @__PURE__ */ l("code", { children: gn(t).map((h, y) => /* @__PURE__ */ l(
1561
+ /* @__PURE__ */ s("pre", { ...L({ part: "code", state: {} }), children: /* @__PURE__ */ s("code", { children: gn(t).map((u, y) => /* @__PURE__ */ s(
1562
1562
  "span",
1563
1563
  {
1564
- "data-sprint-token": h.kind === "plain" ? void 0 : h.kind,
1565
- children: h.text
1564
+ "data-sprint-token": u.kind === "plain" ? void 0 : u.kind,
1565
+ children: u.text
1566
1566
  },
1567
- `${y}-${h.text}`
1567
+ `${y}-${u.text}`
1568
1568
  )) }) })
1569
1569
  ] });
1570
1570
  }
@@ -1629,25 +1629,25 @@ const bn = q({
1629
1629
  }
1630
1630
  });
1631
1631
  function vn(e) {
1632
- const t = F(e.term), n = F(e.description);
1632
+ const t = H(e.term), n = H(e.description);
1633
1633
  if (!(t === void 0 && n === void 0))
1634
1634
  return `${t ?? ""}: ${n ?? ""}`;
1635
1635
  }
1636
- function ho(e) {
1637
- const { label: t, items: n, emptyLabel: o = "Empty", ...a } = e, r = U(), s = n.length === 0, i = n.map((c, p) => {
1638
- const u = vn(c);
1636
+ function ua(e) {
1637
+ const { label: t, items: n, emptyLabel: a = "Empty", ...o } = e, i = I(), l = n.length === 0, r = n.map((c, p) => {
1638
+ const h = vn(c);
1639
1639
  return {
1640
1640
  part: "item",
1641
1641
  state: { index: String(p + 1) },
1642
- ...u === void 0 ? {} : { label: u }
1642
+ ...h === void 0 ? {} : { label: h }
1643
1643
  };
1644
- }), d = $({
1644
+ }), d = R({
1645
1645
  component: bn.name,
1646
1646
  label: t,
1647
- state: { items: String(n.length), empty: s },
1648
- parts: i
1647
+ state: { items: String(n.length), empty: l },
1648
+ parts: r
1649
1649
  });
1650
- return r === "agent" ? /* @__PURE__ */ l(I, { node: d }) : /* @__PURE__ */ l("dl", { ...a, ...M(d), "aria-label": t, children: s ? /* @__PURE__ */ l("div", { children: o }) : n.map((c, p) => /* @__PURE__ */ C(
1650
+ return i === "agent" ? /* @__PURE__ */ s(U, { node: d }) : /* @__PURE__ */ s("dl", { ...o, ...M(d), "aria-label": t, children: l ? /* @__PURE__ */ s("div", { children: a }) : n.map((c, p) => /* @__PURE__ */ A(
1651
1651
  "div",
1652
1652
  {
1653
1653
  ...L({
@@ -1655,11 +1655,11 @@ function ho(e) {
1655
1655
  state: { index: String(p + 1) }
1656
1656
  }),
1657
1657
  children: [
1658
- /* @__PURE__ */ l("dt", { children: c.term }),
1659
- /* @__PURE__ */ l("dd", { children: c.description })
1658
+ /* @__PURE__ */ s("dt", { children: c.term }),
1659
+ /* @__PURE__ */ s("dd", { children: c.description })
1660
1660
  ]
1661
1661
  },
1662
- `${p}-${String(F(c.term))}`
1662
+ `${p}-${String(H(c.term))}`
1663
1663
  )) });
1664
1664
  }
1665
1665
  const yt = {
@@ -1759,20 +1759,20 @@ const yt = {
1759
1759
  notes: "A native dialog element shown with showModal, so focus containment, inerting the page behind, and Escape come from the browser. The title names the dialog via aria-label."
1760
1760
  }
1761
1761
  });
1762
- function po(e) {
1762
+ function pa(e) {
1763
1763
  const {
1764
1764
  label: t,
1765
1765
  open: n,
1766
- onClose: o,
1767
- headingLevel: a,
1768
- owner: r,
1769
- agentName: s,
1770
- agentTool: i = !0,
1766
+ onClose: a,
1767
+ headingLevel: o,
1768
+ owner: i,
1769
+ agentName: l,
1770
+ agentTool: r = !0,
1771
1771
  children: d,
1772
1772
  ref: c,
1773
1773
  ...p
1774
- } = e, u = U(), g = G(), h = ke(), y = m(null), f = m(null), b = m(o);
1775
- b.current = o;
1774
+ } = e, h = I(), g = G(), u = ke(), y = m(null), f = m(null), b = m(a);
1775
+ b.current = a;
1776
1776
  const w = m(n);
1777
1777
  w.current = n;
1778
1778
  const T = B(
@@ -1789,23 +1789,23 @@ function po(e) {
1789
1789
  v.open && (typeof v.close == "function" ? v.close() : v.open = !1);
1790
1790
  };
1791
1791
  }, [n]);
1792
- const A = B(async () => {
1792
+ const C = B(async () => {
1793
1793
  const v = f.current;
1794
1794
  return v !== null ? v.click() : z(() => b.current()), await K(), w.current ? "The page kept the dialog open." : "Closed. The dialog is gone from the page.";
1795
- }, []), R = V({
1795
+ }, []), $ = V({
1796
1796
  spec: yt,
1797
- label: s ?? t,
1798
- enabled: i && n,
1799
- execute: A
1797
+ label: l ?? t,
1798
+ enabled: r && n,
1799
+ execute: C
1800
1800
  }), O = ee(
1801
- () => ({ path: [...h, t] }),
1802
- [h, t]
1801
+ () => ({ path: [...u, t] }),
1802
+ [u, t]
1803
1803
  );
1804
1804
  if (!n) return null;
1805
- const E = $({
1805
+ const E = R({
1806
1806
  component: wn.name,
1807
1807
  label: t,
1808
- owner: r,
1808
+ owner: i,
1809
1809
  region: !0,
1810
1810
  state: { open: !0 },
1811
1811
  parts: [
@@ -1813,22 +1813,22 @@ function po(e) {
1813
1813
  part: "close",
1814
1814
  label: "Close",
1815
1815
  state: {},
1816
- ...R === void 0 ? {} : { tool: R }
1816
+ ...$ === void 0 ? {} : { tool: $ }
1817
1817
  }
1818
1818
  ]
1819
1819
  });
1820
- if (u === "agent")
1821
- return /* @__PURE__ */ l(
1820
+ if (h === "agent")
1821
+ return /* @__PURE__ */ s(
1822
1822
  we,
1823
1823
  {
1824
1824
  node: E,
1825
1825
  isActionable: () => g !== "never",
1826
- onActivate: () => o(),
1827
- children: /* @__PURE__ */ l(me, { value: O, children: d })
1826
+ onActivate: () => a(),
1827
+ children: /* @__PURE__ */ s(me, { value: O, children: d })
1828
1828
  }
1829
1829
  );
1830
- const S = a === void 0 ? "span" : `h${a}`;
1831
- return /* @__PURE__ */ C(
1830
+ const S = o === void 0 ? "span" : `h${o}`;
1831
+ return /* @__PURE__ */ A(
1832
1832
  "dialog",
1833
1833
  {
1834
1834
  ...p,
@@ -1836,28 +1836,28 @@ function po(e) {
1836
1836
  "aria-label": t,
1837
1837
  ref: T,
1838
1838
  onCancel: (v) => {
1839
- v.preventDefault(), o();
1839
+ v.preventDefault(), a();
1840
1840
  },
1841
1841
  children: [
1842
- /* @__PURE__ */ C("header", { children: [
1843
- /* @__PURE__ */ l(S, { children: t }),
1844
- /* @__PURE__ */ l(
1842
+ /* @__PURE__ */ A("header", { children: [
1843
+ /* @__PURE__ */ s(S, { children: t }),
1844
+ /* @__PURE__ */ s(
1845
1845
  "button",
1846
1846
  {
1847
1847
  ...L({
1848
1848
  part: "close",
1849
1849
  state: {},
1850
- ...R === void 0 ? {} : { tool: R }
1850
+ ...$ === void 0 ? {} : { tool: $ }
1851
1851
  }),
1852
1852
  type: "button",
1853
1853
  "aria-label": "Close",
1854
1854
  ref: f,
1855
- onClick: () => o(),
1855
+ onClick: () => a(),
1856
1856
  children: "×"
1857
1857
  }
1858
1858
  )
1859
1859
  ] }),
1860
- /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(me, { value: O, children: d }) })
1860
+ /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(me, { value: O, children: d }) })
1861
1861
  ]
1862
1862
  }
1863
1863
  );
@@ -1904,15 +1904,149 @@ const yn = q({
1904
1904
  }
1905
1905
  ]
1906
1906
  });
1907
- function go(e) {
1908
- const { level: t = 2, children: n, ...o } = e, a = U(), r = $({
1907
+ function ga(e) {
1908
+ const { level: t = 2, children: n, ...a } = e, o = I(), i = R({
1909
1909
  component: yn.name,
1910
- label: F(n),
1910
+ label: H(n),
1911
1911
  state: { level: String(t) }
1912
1912
  });
1913
- if (a === "agent") return /* @__PURE__ */ l(I, { node: r });
1914
- const s = `h${t}`;
1915
- return /* @__PURE__ */ l(s, { ...o, ...M(r), children: n });
1913
+ if (o === "agent") return /* @__PURE__ */ s(U, { node: i });
1914
+ const l = `h${t}`;
1915
+ return /* @__PURE__ */ s(l, { ...a, ...M(i), children: n });
1916
+ }
1917
+ const kn = q({
1918
+ name: "Image",
1919
+ category: "display",
1920
+ summary: "A framed picture in a slot that holds its shape. It is the one component whose content an agent cannot read, so alt is not decoration: it is the whole of what the agent gets, and the source URL is published beside it for an agent that can fetch pixels of its own.",
1921
+ whenToUse: 'Use it for any picture that carries meaning: a screenshot, a diagram, a photograph, a logo in running content. Describe it in alt as if to someone on the phone. Pass alt="" only for a picture that adds nothing, which then disappears from the agent view entirely.',
1922
+ whenNotToUse: "Do not use it for a decorative texture; that is the ornament vocabulary, which costs no request and no description. Do not use it for an icon whose meaning is already in adjacent text.",
1923
+ status: "experimental",
1924
+ props: {
1925
+ src: {
1926
+ kind: "string",
1927
+ description: "Where the pixels are. Published as data-sprint-src so an agent that can see can fetch the file itself.",
1928
+ required: !0
1929
+ },
1930
+ alt: {
1931
+ kind: "string",
1932
+ description: 'What the picture shows, in a sentence. This is the entire agent rendering of the image, so write it for a reader who will never see it. Empty means "this picture carries no meaning", and the component then renders nothing in agent view.',
1933
+ required: !0
1934
+ },
1935
+ caption: {
1936
+ kind: "string",
1937
+ description: "A visible line under the frame, for a credit, a date, or a figure number. It is read as well as seen, so it does not repeat alt."
1938
+ },
1939
+ ratio: {
1940
+ kind: "enum",
1941
+ description: "The shape the slot holds while the picture loads and if it fails. auto lets the file decide its own height once it arrives.",
1942
+ values: ["1:1", "4:3", "3:2", "16:9", "auto"],
1943
+ default: "auto"
1944
+ },
1945
+ fit: {
1946
+ kind: "enum",
1947
+ description: "How the picture fills a slot of a fixed ratio. cover crops it, contain letterboxes it. Ignored when ratio is auto.",
1948
+ values: ["cover", "contain"],
1949
+ default: "cover"
1950
+ }
1951
+ },
1952
+ state: {
1953
+ src: {
1954
+ description: "The image source, so an agent can fetch the file without the DOM.",
1955
+ attribute: "data-sprint-src"
1956
+ },
1957
+ status: {
1958
+ description: "Whether the pixels have arrived. Present only in the human rendering, because in agent view nothing is fetched and any value would be a guess.",
1959
+ attribute: "data-sprint-status",
1960
+ values: ["loading", "ready", "error"]
1961
+ },
1962
+ ratio: {
1963
+ description: "The shape the slot holds.",
1964
+ attribute: "data-sprint-ratio",
1965
+ values: ["1:1", "4:3", "3:2", "16:9", "auto"]
1966
+ },
1967
+ fit: {
1968
+ description: "Whether a fixed-ratio slot crops the picture or letterboxes it.",
1969
+ attribute: "data-sprint-fit",
1970
+ values: ["cover", "contain"]
1971
+ },
1972
+ decorative: {
1973
+ description: "Present when the image was declared meaningless with an empty alt and no caption. It renders nothing at all in agent view.",
1974
+ attribute: "data-sprint-decorative"
1975
+ }
1976
+ },
1977
+ agentView: {
1978
+ example: '- **Image** "Launch pad 39B under floodlights, gantry retracted" [fit=cover, ratio=16:9, src=media/pad-39b.svg]\n - part `caption` "Pad 39B, T-minus 4h"'
1979
+ },
1980
+ examples: [
1981
+ {
1982
+ title: "A described picture",
1983
+ description: "The alt text is the agent rendering. It registers no WebMCP tool: there is nothing to do to a picture, and the source URL is already on the element.",
1984
+ code: `<Image
1985
+ src="media/pad-39b.svg"
1986
+ alt="Launch pad 39B under floodlights, gantry retracted"
1987
+ ratio="16:9"
1988
+ />`
1989
+ },
1990
+ {
1991
+ title: "A captioned figure",
1992
+ description: "The caption is read as well as seen, and arrives as its own part, so it can say what alt should not repeat.",
1993
+ code: `<Image
1994
+ src="media/telemetry.svg"
1995
+ alt="Line chart of chamber pressure holding flat for nine minutes, then dropping"
1996
+ caption="Static fire 04, chamber pressure"
1997
+ ratio="3:2"
1998
+ fit="contain"
1999
+ />`
2000
+ },
2001
+ {
2002
+ title: "A picture that means nothing",
2003
+ description: "An empty alt is a claim, not an omission: it says this picture carries no meaning. The component then renders nothing in agent view, the way Stack does.",
2004
+ code: '<Image src="media/grain.svg" alt="" ratio="1:1" />'
2005
+ }
2006
+ ],
2007
+ a11y: {
2008
+ notes: "The frame is a figure named by its alt text, and the picture inside carries the same alt natively, so a fallback still reads when the file fails. A caption is a figcaption. While the picture is loading or after it has failed, the slot keeps its border and states its condition rather than collapsing; that band is aria-hidden, because on failure it shows the alt text a screen reader has already been given."
2009
+ },
2010
+ relatedComponents: ["Card", "Panel"]
2011
+ });
2012
+ function ma(e) {
2013
+ const { src: t, alt: n, caption: a, ratio: o = "auto", fit: i = "cover", ...l } = e, r = I(), [d, c] = Y("loading"), p = n === "" && a === void 0, h = a === void 0 ? [] : [{ part: "caption", label: a, state: {} }], g = R({
2014
+ component: kn.name,
2015
+ label: n === "" ? void 0 : n,
2016
+ state: {
2017
+ src: t,
2018
+ ratio: o,
2019
+ fit: i,
2020
+ decorative: p,
2021
+ status: r === "agent" ? void 0 : d
2022
+ },
2023
+ parts: h
2024
+ });
2025
+ if (r === "agent") return p ? null : /* @__PURE__ */ s(U, { node: g });
2026
+ const u = d === "error" ? n === "" ? "Image unavailable" : n : "Loading";
2027
+ return /* @__PURE__ */ A(
2028
+ "figure",
2029
+ {
2030
+ ...l,
2031
+ ...M(g),
2032
+ "aria-label": n === "" ? void 0 : n,
2033
+ children: [
2034
+ /* @__PURE__ */ A("div", { children: [
2035
+ /* @__PURE__ */ s(
2036
+ "img",
2037
+ {
2038
+ src: t,
2039
+ alt: n,
2040
+ onLoad: () => c("ready"),
2041
+ onError: () => c("error")
2042
+ }
2043
+ ),
2044
+ d === "ready" ? null : /* @__PURE__ */ s("span", { "aria-hidden": "true", children: /* @__PURE__ */ s("span", { children: u }) })
2045
+ ] }),
2046
+ a === void 0 ? null : /* @__PURE__ */ s("figcaption", { ...L({ part: "caption", state: {} }), children: a })
2047
+ ]
2048
+ }
2049
+ );
1916
2050
  }
1917
2051
  const kt = {
1918
2052
  verb: "open",
@@ -1922,7 +2056,7 @@ const kt = {
1922
2056
  untrustedContent: !0,
1923
2057
  registeredWhen: "The link opts in with agentTool, is mounted, has a resolvable label, and no other component claims the same tool name. Links register nothing by default.",
1924
2058
  unregisteredWhen: "The link unmounts or opts back out."
1925
- }, kn = q({
2059
+ }, Tn = q({
1926
2060
  name: "Link",
1927
2061
  category: "navigation",
1928
2062
  summary: "A navigation link. It publishes its destination as state, so an agent reading the page in text learns the URL rather than having to click to find out, and it renders a real anchor in both views.",
@@ -2003,63 +2137,63 @@ const kt = {
2003
2137
  notes: "active sets aria-current=page. External links open in a new context with rel=noreferrer noopener, and carry their outward mark as a pseudo-element with empty alternative text so it never reaches the accessible name or the tool name. Inside Text a link is underlined all the time, so colour is never the only thing distinguishing it from the prose around it."
2004
2138
  }
2005
2139
  });
2006
- function mo(e) {
2140
+ function fa(e) {
2007
2141
  const {
2008
2142
  href: t,
2009
2143
  active: n = !1,
2010
- external: o = !1,
2011
- agentTool: a = !1,
2012
- agentName: r,
2013
- children: s,
2014
- ref: i,
2144
+ external: a = !1,
2145
+ agentTool: o = !1,
2146
+ agentName: i,
2147
+ children: l,
2148
+ ref: r,
2015
2149
  onClick: d,
2016
2150
  ...c
2017
- } = e, p = U(), u = G(), g = m(null), h = B(
2018
- (A) => {
2019
- g.current = A, typeof i == "function" ? i(A) : i != null && (i.current = A);
2020
- },
2021
- [i]
2022
- ), y = r ?? F(s), f = B(() => {
2023
- const A = g.current;
2024
- return A === null ? "This link renders no element in the current view. Navigate to its href instead." : (A.click(), `Following ${A.getAttribute("href") ?? t}.`);
2151
+ } = e, p = I(), h = G(), g = m(null), u = B(
2152
+ (C) => {
2153
+ g.current = C, typeof r == "function" ? r(C) : r != null && (r.current = C);
2154
+ },
2155
+ [r]
2156
+ ), y = i ?? H(l), f = B(() => {
2157
+ const C = g.current;
2158
+ return C === null ? "This link renders no element in the current view. Navigate to its href instead." : (C.click(), `Following ${C.getAttribute("href") ?? t}.`);
2025
2159
  }, [t]), b = V({
2026
2160
  spec: kt,
2027
2161
  label: y,
2028
- enabled: a,
2162
+ enabled: o,
2029
2163
  execute: f
2030
- }), w = $({
2031
- component: kn.name,
2032
- label: F(s),
2164
+ }), w = R({
2165
+ component: Tn.name,
2166
+ label: H(l),
2033
2167
  tool: b,
2034
- state: { href: t, active: n, external: o }
2035
- }), T = o ? { target: "_blank", rel: "noreferrer noopener" } : { target: void 0, rel: void 0 };
2036
- return p === "agent" ? u === "never" ? /* @__PURE__ */ l(I, { node: w }) : /* @__PURE__ */ l(
2037
- ue,
2168
+ state: { href: t, active: n, external: a }
2169
+ }), T = a ? { target: "_blank", rel: "noreferrer noopener" } : { target: void 0, rel: void 0 };
2170
+ return p === "agent" ? h === "never" ? /* @__PURE__ */ s(U, { node: w }) : /* @__PURE__ */ s(
2171
+ he,
2038
2172
  {
2039
2173
  node: w,
2040
2174
  as: "a",
2041
2175
  href: t,
2042
- ref: h,
2176
+ ref: u,
2043
2177
  onClick: d,
2044
2178
  target: T.target,
2045
2179
  rel: T.rel
2046
2180
  }
2047
- ) : /* @__PURE__ */ l(
2181
+ ) : /* @__PURE__ */ s(
2048
2182
  "a",
2049
2183
  {
2050
2184
  ...c,
2051
2185
  ...M(w),
2052
2186
  href: t,
2053
- ref: h,
2187
+ ref: u,
2054
2188
  onClick: d,
2055
2189
  "aria-current": n ? "page" : void 0,
2056
2190
  target: T.target,
2057
2191
  rel: T.rel,
2058
- children: s
2192
+ children: l
2059
2193
  }
2060
2194
  );
2061
2195
  }
2062
- const Tn = q({
2196
+ const xn = q({
2063
2197
  name: "List",
2064
2198
  category: "display",
2065
2199
  summary: "A bulleted or numbered list built from an array of items. Each item is an addressable part carrying its position, so an agent can cite item three without counting lines.",
@@ -2136,42 +2270,42 @@ const Tn = q({
2136
2270
  notes: "A real ul or ol named by its label, with an explicit list role because the custom markers require list-style none and Safari would otherwise drop the list semantics. The item count is announced, and the markers are drawn as pseudo-elements."
2137
2271
  }
2138
2272
  });
2139
- function fo(e) {
2140
- const { label: t, items: n, ordered: o = !1, emptyLabel: a = "Empty", ...r } = e, s = U(), i = n.length === 0, d = n.map((u, g) => {
2141
- const h = F(u);
2273
+ function ba(e) {
2274
+ const { label: t, items: n, ordered: a = !1, emptyLabel: o = "Empty", ...i } = e, l = I(), r = n.length === 0, d = n.map((h, g) => {
2275
+ const u = H(h);
2142
2276
  return {
2143
2277
  part: "item",
2144
2278
  state: { index: String(g + 1) },
2145
- ...h === void 0 ? {} : { label: h }
2279
+ ...u === void 0 ? {} : { label: u }
2146
2280
  };
2147
- }), c = $({
2148
- component: Tn.name,
2281
+ }), c = R({
2282
+ component: xn.name,
2149
2283
  label: t,
2150
- state: { items: String(n.length), ordered: o, empty: i },
2284
+ state: { items: String(n.length), ordered: a, empty: r },
2151
2285
  parts: d
2152
2286
  });
2153
- return s === "agent" ? /* @__PURE__ */ l(I, { node: c }) : /* @__PURE__ */ l(
2154
- o ? "ol" : "ul",
2287
+ return l === "agent" ? /* @__PURE__ */ s(U, { node: c }) : /* @__PURE__ */ s(
2288
+ a ? "ol" : "ul",
2155
2289
  {
2156
- ...r,
2290
+ ...i,
2157
2291
  ...M(c),
2158
2292
  role: "list",
2159
2293
  "aria-label": t,
2160
- children: i ? /* @__PURE__ */ l("li", { children: a }) : n.map((u, g) => /* @__PURE__ */ l(
2294
+ children: r ? /* @__PURE__ */ s("li", { children: o }) : n.map((h, g) => /* @__PURE__ */ s(
2161
2295
  "li",
2162
2296
  {
2163
2297
  ...L({
2164
2298
  part: "item",
2165
2299
  state: { index: String(g + 1) }
2166
2300
  }),
2167
- children: /* @__PURE__ */ l("span", { children: u })
2301
+ children: /* @__PURE__ */ s("span", { children: h })
2168
2302
  },
2169
- `${g}-${String(F(u))}`
2303
+ `${g}-${String(H(h))}`
2170
2304
  ))
2171
2305
  }
2172
2306
  );
2173
2307
  }
2174
- const xn = q({
2308
+ const An = q({
2175
2309
  name: "MetaLine",
2176
2310
  category: "display",
2177
2311
  summary: "A slash-separated manifest line of term–detail pairs: serials, build strings, issue dates. It is chrome, not content, and in the agent view it reads as the same single line of text a person sees.",
@@ -2222,26 +2356,26 @@ const xn = q({
2222
2356
  notes: "The separators are real text, so the accessible name is the same line the agent view carries. Nothing in the line is interactive."
2223
2357
  }
2224
2358
  });
2225
- function bo(e) {
2226
- const { entries: t, ...n } = e, o = U();
2359
+ function va(e) {
2360
+ const { entries: t, ...n } = e, a = I();
2227
2361
  if (t.length === 0) return null;
2228
- const a = t.map((s) => `${s.term}: ${s.detail}`).join(" / "), r = $({
2229
- component: xn.name,
2230
- label: a,
2362
+ const o = t.map((l) => `${l.term}: ${l.detail}`).join(" / "), i = R({
2363
+ component: An.name,
2364
+ label: o,
2231
2365
  state: { entries: String(t.length) }
2232
2366
  });
2233
- return o === "agent" ? /* @__PURE__ */ l(I, { node: r }) : /* @__PURE__ */ l("p", { ...n, ...M(r), children: t.map((s, i) => /* @__PURE__ */ C(Se, { children: [
2234
- i > 0 ? " / " : null,
2235
- /* @__PURE__ */ C("span", { children: [
2236
- /* @__PURE__ */ C("span", { children: [
2237
- s.term,
2367
+ return a === "agent" ? /* @__PURE__ */ s(U, { node: i }) : /* @__PURE__ */ s("p", { ...n, ...M(i), children: t.map((l, r) => /* @__PURE__ */ A(Se, { children: [
2368
+ r > 0 ? " / " : null,
2369
+ /* @__PURE__ */ A("span", { children: [
2370
+ /* @__PURE__ */ A("span", { children: [
2371
+ l.term,
2238
2372
  ": "
2239
2373
  ] }),
2240
- /* @__PURE__ */ l("span", { children: s.detail })
2374
+ /* @__PURE__ */ s("span", { children: l.detail })
2241
2375
  ] })
2242
- ] }, `${s.term}-${i}`)) });
2376
+ ] }, `${l.term}-${r}`)) });
2243
2377
  }
2244
- const An = q({
2378
+ const Cn = q({
2245
2379
  name: "Nav",
2246
2380
  category: "navigation",
2247
2381
  summary: "A labelled navigation landmark: the region that holds a page's links to elsewhere.",
@@ -2292,11 +2426,11 @@ const An = q({
2292
2426
  }
2293
2427
  ]
2294
2428
  });
2295
- function vo(e) {
2296
- const { label: t, children: n, ...o } = e, a = U(), r = $({ component: An.name, label: t, region: !0 });
2297
- return a === "agent" ? /* @__PURE__ */ l(I, { node: r, children: n }) : /* @__PURE__ */ l("nav", { ...o, ...M(r), "aria-label": t, children: n });
2429
+ function wa(e) {
2430
+ const { label: t, children: n, ...a } = e, o = I(), i = R({ component: Cn.name, label: t, region: !0 });
2431
+ return o === "agent" ? /* @__PURE__ */ s(U, { node: i, children: n }) : /* @__PURE__ */ s("nav", { ...a, ...M(i), "aria-label": t, children: n });
2298
2432
  }
2299
- const Cn = q({
2433
+ const Sn = q({
2300
2434
  name: "NavGroup",
2301
2435
  category: "navigation",
2302
2436
  summary: "A labelled cluster of links inside a Nav. The label names the group for screen readers and agents alike.",
@@ -2337,17 +2471,17 @@ const Cn = q({
2337
2471
  }
2338
2472
  ]
2339
2473
  });
2340
- function wo(e) {
2341
- const { label: t, children: n, ...o } = e, a = U(), r = $({ component: Cn.name, label: t });
2342
- return a === "agent" ? /* @__PURE__ */ l(I, { node: r, children: n }) : (
2474
+ function ya(e) {
2475
+ const { label: t, children: n, ...a } = e, o = I(), i = R({ component: Sn.name, label: t });
2476
+ return o === "agent" ? /* @__PURE__ */ s(U, { node: i, children: n }) : (
2343
2477
  // biome-ignore lint/a11y/useSemanticElements: the suggested fieldset groups form controls; this groups links, and group is the ARIA role for exactly that
2344
- /* @__PURE__ */ C("div", { ...o, ...M(r), role: "group", "aria-label": t, children: [
2345
- /* @__PURE__ */ l("span", { children: t }),
2478
+ /* @__PURE__ */ A("div", { ...a, ...M(i), role: "group", "aria-label": t, children: [
2479
+ /* @__PURE__ */ s("span", { children: t }),
2346
2480
  n
2347
2481
  ] })
2348
2482
  );
2349
2483
  }
2350
- const Sn = q({
2484
+ const Pn = q({
2351
2485
  name: "PageHeader",
2352
2486
  category: "layout",
2353
2487
  summary: "The top of a page: its h1 title, the Tag chips that classify it, an optional page-level control, and a lede underneath.",
@@ -2400,28 +2534,28 @@ const Sn = q({
2400
2534
  }
2401
2535
  ]
2402
2536
  });
2403
- function yo(e) {
2404
- const { label: t, tags: n, actions: o, children: a, ...r } = e, s = U(), i = $({
2405
- component: Sn.name,
2537
+ function ka(e) {
2538
+ const { label: t, tags: n, actions: a, children: o, ...i } = e, l = I(), r = R({
2539
+ component: Pn.name,
2406
2540
  label: t,
2407
2541
  region: !0
2408
2542
  });
2409
- if (s === "agent")
2410
- return /* @__PURE__ */ C(I, { node: i, children: [
2543
+ if (l === "agent")
2544
+ return /* @__PURE__ */ A(U, { node: r, children: [
2411
2545
  n,
2412
- o,
2413
- a
2546
+ a,
2547
+ o
2414
2548
  ] });
2415
- const d = Ye.toArray(a).length > 0;
2416
- return /* @__PURE__ */ C("header", { ...r, ...M(i), children: [
2417
- /* @__PURE__ */ C("div", { children: [
2418
- /* @__PURE__ */ C("div", { children: [
2419
- /* @__PURE__ */ l("h1", { children: t }),
2420
- n === void 0 ? null : /* @__PURE__ */ l("span", { children: n })
2549
+ const d = Ye.toArray(o).length > 0;
2550
+ return /* @__PURE__ */ A("header", { ...i, ...M(r), children: [
2551
+ /* @__PURE__ */ A("div", { children: [
2552
+ /* @__PURE__ */ A("div", { children: [
2553
+ /* @__PURE__ */ s("h1", { children: t }),
2554
+ n === void 0 ? null : /* @__PURE__ */ s("span", { children: n })
2421
2555
  ] }),
2422
- o === void 0 ? null : /* @__PURE__ */ l("span", { children: o })
2556
+ a === void 0 ? null : /* @__PURE__ */ s("span", { children: a })
2423
2557
  ] }),
2424
- d ? /* @__PURE__ */ l("div", { children: a }) : null
2558
+ d ? /* @__PURE__ */ s("div", { children: o }) : null
2425
2559
  ] });
2426
2560
  }
2427
2561
  const Nn = q({
@@ -2521,36 +2655,36 @@ const Nn = q({
2521
2655
  }
2522
2656
  ]
2523
2657
  });
2524
- function ko(e) {
2658
+ function Ta(e) {
2525
2659
  const {
2526
2660
  label: t,
2527
2661
  headingLevel: n,
2528
- actions: o,
2529
- flush: a = !1,
2530
- emptyLabel: r = "Empty",
2531
- children: s,
2532
- ...i
2533
- } = e, d = U(), c = Ye.toArray(s).length === 0, p = $({
2662
+ actions: a,
2663
+ flush: o = !1,
2664
+ emptyLabel: i = "Empty",
2665
+ children: l,
2666
+ ...r
2667
+ } = e, d = I(), c = Ye.toArray(l).length === 0, p = R({
2534
2668
  component: Nn.name,
2535
2669
  label: t,
2536
2670
  region: !0,
2537
- state: { flush: a, empty: c }
2671
+ state: { flush: o, empty: c }
2538
2672
  });
2539
2673
  if (d === "agent")
2540
- return /* @__PURE__ */ C(I, { node: p, children: [
2541
- o,
2542
- s
2674
+ return /* @__PURE__ */ A(U, { node: p, children: [
2675
+ a,
2676
+ l
2543
2677
  ] });
2544
- const u = n === void 0 ? "span" : `h${n}`;
2545
- return /* @__PURE__ */ C("section", { ...i, ...M(p), "aria-label": t, children: [
2546
- /* @__PURE__ */ C("header", { children: [
2547
- /* @__PURE__ */ l(u, { children: t }),
2548
- o === void 0 ? null : /* @__PURE__ */ l("span", { children: o })
2678
+ const h = n === void 0 ? "span" : `h${n}`;
2679
+ return /* @__PURE__ */ A("section", { ...r, ...M(p), "aria-label": t, children: [
2680
+ /* @__PURE__ */ A("header", { children: [
2681
+ /* @__PURE__ */ s(h, { children: t }),
2682
+ a === void 0 ? null : /* @__PURE__ */ s("span", { children: a })
2549
2683
  ] }),
2550
- /* @__PURE__ */ l("div", { children: c ? /* @__PURE__ */ l("span", { children: r }) : s })
2684
+ /* @__PURE__ */ s("div", { children: c ? /* @__PURE__ */ s("span", { children: i }) : l })
2551
2685
  ] });
2552
2686
  }
2553
- const Pn = q({
2687
+ const Ln = q({
2554
2688
  name: "SecretField",
2555
2689
  category: "display",
2556
2690
  summary: "A sensitive value shown once or on demand: an API key, a recovery code, a signing secret. Masked by default with reveal and copy controls, and the value never reaches any agent surface.",
@@ -2609,48 +2743,48 @@ const Pn = q({
2609
2743
  a11y: {
2610
2744
  notes: "The reveal control is a toggle button with aria-pressed; the masked value is announced as a hidden secret rather than as bullet characters. Copy announces its success by swapping its label to Copied."
2611
2745
  }
2612
- }), Rn = "••••••••••••", Ln = 1200;
2613
- function To(e) {
2614
- const { label: t, value: n, hint: o, defaultRevealed: a = !1, ...r } = e, s = U(), [i, d] = J(a), [c, p] = J(!1);
2746
+ }), Rn = "••••••••••••", $n = 1200;
2747
+ function xa(e) {
2748
+ const { label: t, value: n, hint: a, defaultRevealed: o = !1, ...i } = e, l = I(), [r, d] = Y(o), [c, p] = Y(!1);
2615
2749
  _(() => {
2616
2750
  if (!c) return;
2617
- const f = setTimeout(() => p(!1), Ln);
2751
+ const f = setTimeout(() => p(!1), $n);
2618
2752
  return () => clearTimeout(f);
2619
2753
  }, [c]);
2620
- const u = () => {
2754
+ const h = () => {
2621
2755
  const f = navigator.clipboard;
2622
2756
  f !== void 0 && f.writeText(n).then(
2623
2757
  () => p(!0),
2624
2758
  () => p(!1)
2625
2759
  );
2626
- }, g = n !== "", h = o === void 0 ? [] : [{ part: "hint", label: o, state: {} }], y = $({
2627
- component: Pn.name,
2760
+ }, g = n !== "", u = a === void 0 ? [] : [{ part: "hint", label: a, state: {} }], y = R({
2761
+ component: Ln.name,
2628
2762
  label: t,
2629
- state: { filled: g, revealed: i },
2630
- parts: h
2763
+ state: { filled: g, revealed: r },
2764
+ parts: u
2631
2765
  });
2632
- return s === "agent" ? /* @__PURE__ */ l(I, { node: y }) : /* @__PURE__ */ C("div", { ...r, ...M(y), children: [
2633
- /* @__PURE__ */ l("span", { ...L({ part: "label", state: {} }), children: t }),
2634
- /* @__PURE__ */ C("div", { ...L({ part: "control", state: {} }), children: [
2635
- /* @__PURE__ */ l(
2766
+ return l === "agent" ? /* @__PURE__ */ s(U, { node: y }) : /* @__PURE__ */ A("div", { ...i, ...M(y), children: [
2767
+ /* @__PURE__ */ s("span", { ...L({ part: "label", state: {} }), children: t }),
2768
+ /* @__PURE__ */ A("div", { ...L({ part: "control", state: {} }), children: [
2769
+ /* @__PURE__ */ s(
2636
2770
  "output",
2637
2771
  {
2638
2772
  ...L({ part: "value", state: {} }),
2639
- "aria-label": i ? void 0 : "Hidden secret",
2640
- children: i ? n : Rn
2773
+ "aria-label": r ? void 0 : "Hidden secret",
2774
+ children: r ? n : Rn
2641
2775
  }
2642
2776
  ),
2643
- /* @__PURE__ */ l(
2777
+ /* @__PURE__ */ s(
2644
2778
  "button",
2645
2779
  {
2646
2780
  ...L({ part: "reveal", state: {} }),
2647
2781
  type: "button",
2648
- "aria-pressed": i,
2782
+ "aria-pressed": r,
2649
2783
  onClick: () => d((f) => !f),
2650
- children: i ? "Hide" : "Reveal"
2784
+ children: r ? "Hide" : "Reveal"
2651
2785
  }
2652
2786
  ),
2653
- /* @__PURE__ */ l(
2787
+ /* @__PURE__ */ s(
2654
2788
  "button",
2655
2789
  {
2656
2790
  ...L({
@@ -2658,15 +2792,15 @@ function To(e) {
2658
2792
  state: c ? { copied: !0 } : {}
2659
2793
  }),
2660
2794
  type: "button",
2661
- onClick: u,
2795
+ onClick: h,
2662
2796
  children: c ? "Copied" : "Copy"
2663
2797
  }
2664
2798
  )
2665
2799
  ] }),
2666
- o === void 0 ? null : /* @__PURE__ */ l("p", { ...L({ part: "hint", state: {} }), children: o })
2800
+ a === void 0 ? null : /* @__PURE__ */ s("p", { ...L({ part: "hint", state: {} }), children: a })
2667
2801
  ] });
2668
2802
  }
2669
- const re = {
2803
+ const ie = {
2670
2804
  verb: "select",
2671
2805
  description: "Select one of this control's options by its visible label, exactly as a person clicking it would. Only one option is selected at a time, so this replaces the current one. Returns the control's state after the change, so a follow-up read is unnecessary.",
2672
2806
  inputSchema: {
@@ -2683,7 +2817,7 @@ const re = {
2683
2817
  untrustedContent: !0,
2684
2818
  registeredWhen: "The control is mounted, enabled, has a resolvable label, and no other component claims the same tool name. The registered schema enumerates the current option labels.",
2685
2819
  unregisteredWhen: "The control unmounts or becomes disabled."
2686
- }, He = q({
2820
+ }, Fe = q({
2687
2821
  name: "SegmentedControl",
2688
2822
  category: "input",
2689
2823
  summary: "A short row of mutually exclusive options, all visible at once: a radio group that registers a single select tool whose schema enumerates the options currently on screen.",
@@ -2737,7 +2871,7 @@ const re = {
2737
2871
  }
2738
2872
  },
2739
2873
  tools: {
2740
- select: re
2874
+ select: ie
2741
2875
  },
2742
2876
  agentView: {
2743
2877
  example: '- **SegmentedControl** "Page view" [value=human] → tool `select-page-view`\n - part `option` "human" [checked]\n - part `option` "agent"'
@@ -2782,33 +2916,33 @@ const re = {
2782
2916
  notes: "Roving tabindex: only the selected option is in the tab order. Selection follows focus, which is the expected behaviour for a radio group."
2783
2917
  }
2784
2918
  });
2785
- function $n(e) {
2786
- const t = re.inputSchema.properties.option;
2919
+ function On(e) {
2920
+ const t = ie.inputSchema.properties.option;
2787
2921
  return {
2788
- ...re.inputSchema,
2922
+ ...ie.inputSchema,
2789
2923
  properties: {
2790
- ...re.inputSchema.properties,
2924
+ ...ie.inputSchema.properties,
2791
2925
  ...t === void 0 ? {} : { option: { ...t, enum: e.map((n) => n.label) } }
2792
2926
  }
2793
2927
  };
2794
2928
  }
2795
- function xo(e) {
2929
+ function Aa(e) {
2796
2930
  const {
2797
2931
  label: t,
2798
2932
  options: n,
2799
- value: o,
2800
- onChange: a,
2801
- disabled: r = !1,
2802
- agentName: s,
2803
- agentTool: i = !0,
2933
+ value: a,
2934
+ onChange: o,
2935
+ disabled: i = !1,
2936
+ agentName: l,
2937
+ agentTool: r = !0,
2804
2938
  ...d
2805
- } = e, c = U(), p = G(), u = H(), g = m(/* @__PURE__ */ new Map()), h = m(a);
2806
- h.current = a;
2939
+ } = e, c = I(), p = G(), h = F(), g = m(/* @__PURE__ */ new Map()), u = m(o);
2940
+ u.current = o;
2807
2941
  const y = m(n);
2808
2942
  y.current = n;
2809
- const f = m(u);
2810
- f.current = u;
2811
- const b = m($({ component: He.name })), w = m(!0);
2943
+ const f = m(h);
2944
+ f.current = h;
2945
+ const b = m(R({ component: Fe.name })), w = m(!0);
2812
2946
  _(() => (w.current = !0, () => {
2813
2947
  w.current = !1;
2814
2948
  }), []);
@@ -2818,41 +2952,41 @@ function xo(e) {
2818
2952
  x.click();
2819
2953
  return;
2820
2954
  }
2821
- z(() => h.current(k));
2822
- }, []), A = B(
2955
+ z(() => u.current(k));
2956
+ }, []), C = B(
2823
2957
  async (k) => {
2824
- const x = typeof k.option == "string" ? k.option : "", D = y.current, P = D.find((N) => N.label === x);
2825
- return P === void 0 ? `No option named "${x}". This control offers: ${D.map((N) => `"${N.label}"`).join(", ")}.` : (T(P.value), await K(), w.current ? `Selected. The control is now:
2958
+ const x = typeof k.option == "string" ? k.option : "", D = y.current, N = D.find((P) => P.label === x);
2959
+ return N === void 0 ? `No option named "${x}". This control offers: ${D.map((P) => `"${P.label}"`).join(", ")}.` : (T(N.value), await K(), w.current ? `Selected. The control is now:
2826
2960
  ${f.current([b.current])}` : "The selection removed this control from the page.");
2827
2961
  },
2828
2962
  [T]
2829
- ), R = ee(() => $n(n), [n]), O = V({
2830
- spec: re,
2831
- label: s ?? t,
2832
- inputSchema: R,
2833
- enabled: i && !r,
2834
- execute: A
2963
+ ), $ = ee(() => On(n), [n]), O = V({
2964
+ spec: ie,
2965
+ label: l ?? t,
2966
+ inputSchema: $,
2967
+ enabled: r && !i,
2968
+ execute: C
2835
2969
  }), E = n.map((k) => ({
2836
2970
  part: "option",
2837
2971
  label: k.label,
2838
2972
  state: {
2839
- ...k.value === o ? { checked: !0 } : {},
2840
- ...r ? { disabled: !0 } : {}
2973
+ ...k.value === a ? { checked: !0 } : {},
2974
+ ...i ? { disabled: !0 } : {}
2841
2975
  }
2842
- })), S = $({
2843
- component: He.name,
2976
+ })), S = R({
2977
+ component: Fe.name,
2844
2978
  label: t,
2845
2979
  tool: O,
2846
- state: { value: o, disabled: r },
2980
+ state: { value: a, disabled: i },
2847
2981
  parts: E
2848
2982
  });
2849
2983
  b.current = S;
2850
2984
  const v = (k) => {
2851
- if (!["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp", "Home", "End"].includes(k.key) || r) return;
2852
- const D = n.findIndex((Y) => Y.value === o), P = k.key === "ArrowRight" || k.key === "ArrowDown" ? 1 : -1, N = k.key === "Home" ? 0 : k.key === "End" ? n.length - 1 : (D + P + n.length) % n.length, j = n[N];
2985
+ if (!["ArrowRight", "ArrowDown", "ArrowLeft", "ArrowUp", "Home", "End"].includes(k.key) || i) return;
2986
+ const D = n.findIndex((J) => J.value === a), N = k.key === "ArrowRight" || k.key === "ArrowDown" ? 1 : -1, P = k.key === "Home" ? 0 : k.key === "End" ? n.length - 1 : (D + N + n.length) % n.length, j = n[P];
2853
2987
  j !== void 0 && (k.preventDefault(), g.current.get(j.value)?.focus(), T(j.value));
2854
2988
  };
2855
- return c === "agent" ? r || p === "never" ? /* @__PURE__ */ l(I, { node: S }) : /* @__PURE__ */ l(
2989
+ return c === "agent" ? i || p === "never" ? /* @__PURE__ */ s(U, { node: S }) : /* @__PURE__ */ s(
2856
2990
  we,
2857
2991
  {
2858
2992
  node: S,
@@ -2861,7 +2995,7 @@ ${f.current([b.current])}` : "The selection removed this control from the page."
2861
2995
  D !== void 0 && T(D.value);
2862
2996
  }
2863
2997
  }
2864
- ) : /* @__PURE__ */ l(
2998
+ ) : /* @__PURE__ */ s(
2865
2999
  "div",
2866
3000
  {
2867
3001
  ...d,
@@ -2870,20 +3004,20 @@ ${f.current([b.current])}` : "The selection removed this control from the page."
2870
3004
  "aria-label": t,
2871
3005
  onKeyDown: v,
2872
3006
  children: n.map((k, x) => {
2873
- const D = k.value === o, P = n.some((N) => N.value === o) ? D : x === 0;
2874
- return /* @__PURE__ */ l(
3007
+ const D = k.value === a, N = n.some((P) => P.value === a) ? D : x === 0;
3008
+ return /* @__PURE__ */ s(
2875
3009
  "button",
2876
3010
  {
2877
3011
  type: "button",
2878
3012
  role: "radio",
2879
3013
  "aria-checked": D,
2880
- tabIndex: P ? 0 : -1,
2881
- disabled: r,
2882
- ref: (N) => {
2883
- N === null ? g.current.delete(k.value) : g.current.set(k.value, N);
3014
+ tabIndex: N ? 0 : -1,
3015
+ disabled: i,
3016
+ ref: (P) => {
3017
+ P === null ? g.current.delete(k.value) : g.current.set(k.value, P);
2884
3018
  },
2885
3019
  ...L(E[x] ?? { part: "option", state: {} }),
2886
- onClick: () => a(k.value),
3020
+ onClick: () => o(k.value),
2887
3021
  children: k.label
2888
3022
  },
2889
3023
  k.value
@@ -2892,7 +3026,7 @@ ${f.current([b.current])}` : "The selection removed this control from the page."
2892
3026
  }
2893
3027
  );
2894
3028
  }
2895
- const ie = {
3029
+ const re = {
2896
3030
  verb: "select",
2897
3031
  description: "Choose one of this dropdown's options by its visible label, exactly as a person opening it and clicking one would. Only one option is chosen at a time, so this replaces the current choice. Returns the dropdown's state after the change, so a follow-up read is unnecessary.",
2898
3032
  inputSchema: {
@@ -2996,7 +3130,7 @@ const ie = {
2996
3130
  }
2997
3131
  },
2998
3132
  tools: {
2999
- select: ie
3133
+ select: re
3000
3134
  },
3001
3135
  agentView: {
3002
3136
  example: '- **Select** "Region" [value=eu-1] → tool `select-region`\n - part `option` "North Atlantic"\n - part `option` "Northern Europe" [checked]\n - part `option` "East Asia"'
@@ -3058,110 +3192,110 @@ const ie = {
3058
3192
  }
3059
3193
  });
3060
3194
  function Tt(e, t) {
3061
- const n = e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, o = Object.getOwnPropertyDescriptor(n, "value")?.set;
3062
- o !== void 0 && (o.call(e, t), e.dispatchEvent(new Event("input", { bubbles: !0 })));
3195
+ const n = e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(n, "value")?.set;
3196
+ a !== void 0 && (a.call(e, t), e.dispatchEvent(new Event("input", { bubbles: !0 })));
3063
3197
  }
3064
- function On(e, t) {
3198
+ function Dn(e, t) {
3065
3199
  const n = Object.getOwnPropertyDescriptor(
3066
3200
  HTMLSelectElement.prototype,
3067
3201
  "value"
3068
3202
  )?.set;
3069
3203
  n !== void 0 && (n.call(e, t), e.dispatchEvent(new Event("change", { bubbles: !0 })));
3070
3204
  }
3071
- function Dn(e) {
3072
- const t = ie.inputSchema.properties.option;
3205
+ function En(e) {
3206
+ const t = re.inputSchema.properties.option;
3073
3207
  return {
3074
- ...ie.inputSchema,
3208
+ ...re.inputSchema,
3075
3209
  properties: {
3076
- ...ie.inputSchema.properties,
3210
+ ...re.inputSchema.properties,
3077
3211
  ...t === void 0 ? {} : { option: { ...t, enum: e.map((n) => n.label) } }
3078
3212
  }
3079
3213
  };
3080
3214
  }
3081
- function En(e, t) {
3215
+ function Mn(e, t) {
3082
3216
  return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
3083
3217
  }
3084
- function Ao(e) {
3218
+ function Ca(e) {
3085
3219
  const {
3086
3220
  label: t,
3087
3221
  options: n,
3088
- value: o,
3089
- onChange: a,
3090
- placeholder: r,
3091
- hint: s,
3092
- error: i,
3222
+ value: a,
3223
+ onChange: o,
3224
+ placeholder: i,
3225
+ hint: l,
3226
+ error: r,
3093
3227
  name: d,
3094
3228
  disabled: c = !1,
3095
3229
  required: p = !1,
3096
- agentName: u,
3230
+ agentName: h,
3097
3231
  agentTool: g = !0,
3098
- ...h
3099
- } = e, y = U(), f = G(), b = H(), w = le(), T = m(null), A = m(a);
3100
- A.current = a;
3101
- const R = m(n);
3102
- R.current = n;
3232
+ ...u
3233
+ } = e, y = I(), f = G(), b = F(), w = le(), T = m(null), C = m(o);
3234
+ C.current = o;
3235
+ const $ = m(n);
3236
+ $.current = n;
3103
3237
  const O = m(b);
3104
3238
  O.current = b;
3105
- const E = m($({ component: Ge.name })), S = m(!0);
3239
+ const E = m(R({ component: Ge.name })), S = m(!0);
3106
3240
  _(() => (S.current = !0, () => {
3107
3241
  S.current = !1;
3108
3242
  }), []);
3109
3243
  const v = B((W) => {
3110
3244
  const X = T.current;
3111
3245
  if (X !== null) {
3112
- On(X, W);
3246
+ Dn(X, W);
3113
3247
  return;
3114
3248
  }
3115
- z(() => A.current(W));
3249
+ z(() => C.current(W));
3116
3250
  }, []), k = B(
3117
3251
  async (W) => {
3118
- const X = typeof W.option == "string" ? W.option : "", ae = R.current, Me = ae.find((Te) => Te.label === X);
3119
- return Me === void 0 ? `No option named "${X}". This dropdown offers: ${ae.map((Te) => `"${Te.label}"`).join(", ")}.` : (v(Me.value), await K(), S.current ? `Selected. The dropdown is now:
3252
+ const X = typeof W.option == "string" ? W.option : "", oe = $.current, Me = oe.find((Te) => Te.label === X);
3253
+ return Me === void 0 ? `No option named "${X}". This dropdown offers: ${oe.map((Te) => `"${Te.label}"`).join(", ")}.` : (v(Me.value), await K(), S.current ? `Selected. The dropdown is now:
3120
3254
  ${O.current([E.current])}` : "The selection removed this dropdown from the page.");
3121
3255
  },
3122
3256
  [v]
3123
- ), x = ee(() => Dn(n), [n]), D = V({
3124
- spec: ie,
3125
- label: u ?? t,
3257
+ ), x = ee(() => En(n), [n]), D = V({
3258
+ spec: re,
3259
+ label: h ?? t,
3126
3260
  inputSchema: x,
3127
3261
  enabled: g && !c,
3128
3262
  execute: k
3129
- }), P = n.find((W) => W.value === o), N = n.map((W) => ({
3263
+ }), N = n.find((W) => W.value === a), P = n.map((W) => ({
3130
3264
  part: "option",
3131
3265
  label: W.label,
3132
3266
  state: {
3133
- ...W.value === o ? { checked: !0 } : {},
3267
+ ...W.value === a ? { checked: !0 } : {},
3134
3268
  ...c ? { disabled: !0 } : {}
3135
3269
  }
3136
- })), j = $({
3270
+ })), j = R({
3137
3271
  component: Ge.name,
3138
3272
  label: t,
3139
3273
  tool: D,
3140
3274
  state: {
3141
- ...P === void 0 ? {} : { value: o },
3142
- empty: P === void 0,
3275
+ ...N === void 0 ? {} : { value: a },
3276
+ empty: N === void 0,
3143
3277
  disabled: c,
3144
3278
  required: p,
3145
- invalid: i !== void 0
3279
+ invalid: r !== void 0
3146
3280
  },
3147
- parts: [...N, ...En(i, s)]
3281
+ parts: [...P, ...Mn(r, l)]
3148
3282
  });
3149
3283
  if (E.current = j, y === "agent")
3150
- return c || f === "never" ? /* @__PURE__ */ l(I, { node: j }) : /* @__PURE__ */ l(
3284
+ return c || f === "never" ? /* @__PURE__ */ s(U, { node: j }) : /* @__PURE__ */ s(
3151
3285
  we,
3152
3286
  {
3153
3287
  node: j,
3154
3288
  isActionable: (W) => W.part === "option",
3155
3289
  onActivate: (W, X) => {
3156
- const ae = n[X];
3157
- ae !== void 0 && v(ae.value);
3290
+ const oe = n[X];
3291
+ oe !== void 0 && v(oe.value);
3158
3292
  }
3159
3293
  }
3160
3294
  );
3161
- const Y = i !== void 0 ? `${w}-error` : s !== void 0 ? `${w}-hint` : void 0;
3162
- return /* @__PURE__ */ C("div", { ...h, ...M(j), children: [
3163
- /* @__PURE__ */ l("label", { htmlFor: w, children: t }),
3164
- /* @__PURE__ */ l("span", { ...L({ part: "control", state: {} }), children: /* @__PURE__ */ C(
3295
+ const J = r !== void 0 ? `${w}-error` : l !== void 0 ? `${w}-hint` : void 0;
3296
+ return /* @__PURE__ */ A("div", { ...u, ...M(j), children: [
3297
+ /* @__PURE__ */ s("label", { htmlFor: w, children: t }),
3298
+ /* @__PURE__ */ s("span", { ...L({ part: "control", state: {} }), children: /* @__PURE__ */ A(
3165
3299
  "select",
3166
3300
  {
3167
3301
  id: w,
@@ -3169,21 +3303,21 @@ ${O.current([E.current])}` : "The selection removed this dropdown from the page.
3169
3303
  ref: (W) => {
3170
3304
  T.current = W;
3171
3305
  },
3172
- value: P === void 0 ? "" : o,
3306
+ value: N === void 0 ? "" : a,
3173
3307
  name: d,
3174
3308
  disabled: c,
3175
3309
  required: p,
3176
- "aria-invalid": i !== void 0 || void 0,
3177
- "aria-describedby": Y,
3178
- onChange: (W) => a(W.currentTarget.value),
3310
+ "aria-invalid": r !== void 0 || void 0,
3311
+ "aria-describedby": J,
3312
+ onChange: (W) => o(W.currentTarget.value),
3179
3313
  children: [
3180
- P === void 0 ? /* @__PURE__ */ l("option", { value: "", disabled: !0, children: r ?? "Choose" }) : null,
3181
- n.map((W, X) => /* @__PURE__ */ l(
3314
+ N === void 0 ? /* @__PURE__ */ s("option", { value: "", disabled: !0, children: i ?? "Choose" }) : null,
3315
+ n.map((W, X) => /* @__PURE__ */ s(
3182
3316
  "option",
3183
3317
  {
3184
3318
  value: W.value,
3185
3319
  ...L(
3186
- N[X] ?? { part: "option", state: {} }
3320
+ P[X] ?? { part: "option", state: {} }
3187
3321
  ),
3188
3322
  children: W.label
3189
3323
  },
@@ -3192,10 +3326,10 @@ ${O.current([E.current])}` : "The selection removed this dropdown from the page.
3192
3326
  ]
3193
3327
  }
3194
3328
  ) }),
3195
- i !== void 0 ? /* @__PURE__ */ l("p", { id: Y, ...L({ part: "error", state: {} }), children: i }) : s !== void 0 ? /* @__PURE__ */ l("p", { id: Y, ...L({ part: "hint", state: {} }), children: s }) : null
3329
+ r !== void 0 ? /* @__PURE__ */ s("p", { id: J, ...L({ part: "error", state: {} }), children: r }) : l !== void 0 ? /* @__PURE__ */ s("p", { id: J, ...L({ part: "hint", state: {} }), children: l }) : null
3196
3330
  ] });
3197
3331
  }
3198
- const Mn = q({
3332
+ const qn = q({
3199
3333
  name: "Shell",
3200
3334
  category: "layout",
3201
3335
  summary: "The page-level frame: a sidebar and a main content region, with the landmark wiring done once. On a phone the sidebar becomes a drawer behind a menu button.",
@@ -3267,50 +3401,50 @@ const Mn = q({
3267
3401
  }
3268
3402
  ]
3269
3403
  });
3270
- function Co(e) {
3404
+ function Sa(e) {
3271
3405
  const {
3272
3406
  side: t,
3273
3407
  bar: n,
3274
- sideLabel: o = "Sidebar",
3275
- skipLabel: a = "Skip to content",
3276
- menuLabel: r = "Menu",
3277
- closeLabel: s = "Close",
3278
- children: i,
3408
+ sideLabel: a = "Sidebar",
3409
+ skipLabel: o = "Skip to content",
3410
+ menuLabel: i = "Menu",
3411
+ closeLabel: l = "Close",
3412
+ children: r,
3279
3413
  ...d
3280
- } = e, c = U(), [p, u] = J(!1), g = le(), h = m(null), y = B((b) => {
3414
+ } = e, c = I(), [p, h] = Y(!1), g = le(), u = m(null), y = B((b) => {
3281
3415
  const w = b.target;
3282
- w instanceof Element && w.closest("a") !== null && u(!1);
3283
- }, []), f = $({
3284
- component: Mn.name,
3416
+ w instanceof Element && w.closest("a") !== null && h(!1);
3417
+ }, []), f = R({
3418
+ component: qn.name,
3285
3419
  region: !0,
3286
3420
  state: { open: p }
3287
3421
  });
3288
- return c === "agent" ? /* @__PURE__ */ C(Le, { children: [
3422
+ return c === "agent" ? /* @__PURE__ */ A(Re, { children: [
3289
3423
  n,
3290
3424
  t,
3291
- i
3292
- ] }) : /* @__PURE__ */ C("div", { ...d, ...M(f), children: [
3293
- /* @__PURE__ */ l("button", { type: "button", onClick: () => h.current?.focus(), children: a }),
3294
- /* @__PURE__ */ C("aside", { "aria-label": o, children: [
3295
- /* @__PURE__ */ C("div", { children: [
3425
+ r
3426
+ ] }) : /* @__PURE__ */ A("div", { ...d, ...M(f), children: [
3427
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => u.current?.focus(), children: o }),
3428
+ /* @__PURE__ */ A("aside", { "aria-label": a, children: [
3429
+ /* @__PURE__ */ A("div", { children: [
3296
3430
  n,
3297
- /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(
3431
+ /* @__PURE__ */ s("span", { children: /* @__PURE__ */ s(
3298
3432
  dn,
3299
3433
  {
3300
3434
  agentTool: !1,
3301
3435
  "aria-expanded": p,
3302
3436
  "aria-controls": g,
3303
- onClick: () => u(!p),
3304
- children: p ? s : r
3437
+ onClick: () => h(!p),
3438
+ children: p ? l : i
3305
3439
  }
3306
3440
  ) })
3307
3441
  ] }),
3308
- /* @__PURE__ */ l("div", { id: g, onClick: y, children: t })
3442
+ /* @__PURE__ */ s("div", { id: g, onClick: y, children: t })
3309
3443
  ] }),
3310
- /* @__PURE__ */ l("main", { ref: h, tabIndex: -1, children: i })
3444
+ /* @__PURE__ */ s("main", { ref: u, tabIndex: -1, children: r })
3311
3445
  ] });
3312
3446
  }
3313
- const qn = q({
3447
+ const In = q({
3314
3448
  name: "Stack",
3315
3449
  category: "layout",
3316
3450
  summary: "The one-dimensional layout primitive: a row, a column, or an auto-filling grid, with spacing drawn from the space scale. It renders a plain box and nothing else.",
@@ -3417,25 +3551,25 @@ const qn = q({
3417
3551
  }
3418
3552
  ]
3419
3553
  });
3420
- function So(e) {
3554
+ function Pa(e) {
3421
3555
  const {
3422
3556
  direction: t = "column",
3423
3557
  gap: n = "normal",
3424
- align: o,
3425
- justify: a,
3426
- wrap: r = !1,
3427
- collapse: s = !1,
3428
- min: i,
3558
+ align: a,
3559
+ justify: o,
3560
+ wrap: i = !1,
3561
+ collapse: l = !1,
3562
+ min: r,
3429
3563
  children: d,
3430
3564
  style: c,
3431
3565
  ...p
3432
- } = e, u = U(), g = $({
3433
- component: qn.name,
3434
- state: { direction: t, gap: n, align: o, justify: a, wrap: r, collapse: s }
3566
+ } = e, h = I(), g = R({
3567
+ component: In.name,
3568
+ state: { direction: t, gap: n, align: a, justify: o, wrap: i, collapse: l }
3435
3569
  });
3436
- if (u === "agent") return /* @__PURE__ */ l(Le, { children: d });
3437
- const h = i === void 0 ? c : { ...c, "--sprint-stack-min": i };
3438
- return /* @__PURE__ */ l("div", { ...p, ...M(g), style: h, children: d });
3570
+ if (h === "agent") return /* @__PURE__ */ s(Re, { children: d });
3571
+ const u = r === void 0 ? c : { ...c, "--sprint-stack-min": r };
3572
+ return /* @__PURE__ */ s("div", { ...p, ...M(g), style: u, children: d });
3439
3573
  }
3440
3574
  const xt = {
3441
3575
  verb: "set",
@@ -3526,32 +3660,32 @@ const xt = {
3526
3660
  notes: "A button with role switch and aria-checked, so the label and state read together. The thumb moves by a single-axis stepped translation and respects prefers-reduced-motion."
3527
3661
  }
3528
3662
  });
3529
- function No(e) {
3663
+ function Na(e) {
3530
3664
  const {
3531
3665
  label: t,
3532
3666
  on: n,
3533
- onChange: o,
3534
- disabled: a = !1,
3535
- agentName: r,
3536
- agentTool: s = !0,
3537
- ref: i,
3667
+ onChange: a,
3668
+ disabled: o = !1,
3669
+ agentName: i,
3670
+ agentTool: l = !0,
3671
+ ref: r,
3538
3672
  ...d
3539
- } = e, c = U(), p = G(), u = H(), g = m(null), h = B(
3673
+ } = e, c = I(), p = G(), h = F(), g = m(null), u = B(
3540
3674
  (E) => {
3541
- g.current = E, typeof i == "function" ? i(E) : i != null && (i.current = E);
3675
+ g.current = E, typeof r == "function" ? r(E) : r != null && (r.current = E);
3542
3676
  },
3543
- [i]
3544
- ), y = m(o);
3545
- y.current = o;
3677
+ [r]
3678
+ ), y = m(a);
3679
+ y.current = a;
3546
3680
  const f = m(n);
3547
3681
  f.current = n;
3548
- const b = m(u);
3549
- b.current = u;
3550
- const w = m($({ component: Ke.name })), T = m(!0);
3682
+ const b = m(h);
3683
+ b.current = h;
3684
+ const w = m(R({ component: Ke.name })), T = m(!0);
3551
3685
  _(() => (T.current = !0, () => {
3552
3686
  T.current = !1;
3553
3687
  }), []);
3554
- const A = B(async (E) => {
3688
+ const C = B(async (E) => {
3555
3689
  const S = E.on;
3556
3690
  if (typeof S != "boolean")
3557
3691
  return 'Pass "on" as true or false; it states the end state.';
@@ -3562,18 +3696,18 @@ function No(e) {
3562
3696
  }
3563
3697
  return await K(), T.current ? `${v ? `Already ${S ? "on" : "off"}` : `Switched ${S ? "on" : "off"}`}. The switch is now:
3564
3698
  ${b.current([w.current])}` : "The change removed this switch from the page.";
3565
- }, []), R = V({
3699
+ }, []), $ = V({
3566
3700
  spec: xt,
3567
- label: r ?? t,
3568
- enabled: s && !a,
3569
- execute: A
3570
- }), O = $({
3701
+ label: i ?? t,
3702
+ enabled: l && !o,
3703
+ execute: C
3704
+ }), O = R({
3571
3705
  component: Ke.name,
3572
3706
  label: t,
3573
- tool: R,
3574
- state: { on: n, disabled: a }
3707
+ tool: $,
3708
+ state: { on: n, disabled: o }
3575
3709
  });
3576
- return w.current = O, c === "agent" ? a || p === "never" ? /* @__PURE__ */ l(I, { node: O }) : /* @__PURE__ */ l(ue, { node: O, ref: h, onClick: () => o(!n) }) : /* @__PURE__ */ C(
3710
+ return w.current = O, c === "agent" ? o || p === "never" ? /* @__PURE__ */ s(U, { node: O }) : /* @__PURE__ */ s(he, { node: O, ref: u, onClick: () => a(!n) }) : /* @__PURE__ */ A(
3577
3711
  "button",
3578
3712
  {
3579
3713
  ...d,
@@ -3581,16 +3715,16 @@ ${b.current([w.current])}` : "The change removed this switch from the page.";
3581
3715
  type: "button",
3582
3716
  role: "switch",
3583
3717
  "aria-checked": n,
3584
- disabled: a,
3585
- ref: h,
3586
- onClick: () => o(!n),
3718
+ disabled: o,
3719
+ ref: u,
3720
+ onClick: () => a(!n),
3587
3721
  children: [
3588
- /* @__PURE__ */ l(
3722
+ /* @__PURE__ */ s(
3589
3723
  "span",
3590
3724
  {
3591
3725
  ...L({ part: "track", state: {} }),
3592
3726
  "aria-hidden": "true",
3593
- children: /* @__PURE__ */ l("span", { ...L({ part: "thumb", state: {} }) })
3727
+ children: /* @__PURE__ */ s("span", { ...L({ part: "thumb", state: {} }) })
3594
3728
  }
3595
3729
  ),
3596
3730
  t
@@ -3689,7 +3823,7 @@ const Un = q({
3689
3823
  notes: "Column headers keep scope=col in every layout. On narrow screens each cell repeats its column header visually, marked aria-hidden so the real header association is not announced twice."
3690
3824
  }
3691
3825
  });
3692
- function Re(e, t) {
3826
+ function Le(e, t) {
3693
3827
  return e.id ?? String(t + 1);
3694
3828
  }
3695
3829
  function At(e, t) {
@@ -3699,31 +3833,31 @@ function At(e, t) {
3699
3833
  ...e.align === void 0 ? {} : { align: e.align }
3700
3834
  };
3701
3835
  }
3702
- function In(e, t) {
3836
+ function Wn(e, t) {
3703
3837
  return t.flatMap(
3704
- (n, o) => e.map((a) => {
3705
- const r = F(n.cells[a.key]);
3838
+ (n, a) => e.map((o) => {
3839
+ const i = H(n.cells[o.key]);
3706
3840
  return {
3707
3841
  part: "cell",
3708
- state: At(a, Re(n, o)),
3709
- ...r === void 0 ? {} : { label: r }
3842
+ state: At(o, Le(n, a)),
3843
+ ...i === void 0 ? {} : { label: i }
3710
3844
  };
3711
3845
  })
3712
3846
  );
3713
3847
  }
3714
- function Po(e) {
3715
- const { label: t, columns: n, rows: o, emptyLabel: a = "No rows", ...r } = e, s = U(), i = o.length === 0, d = $({
3848
+ function La(e) {
3849
+ const { label: t, columns: n, rows: a, emptyLabel: o = "No rows", ...i } = e, l = I(), r = a.length === 0, d = R({
3716
3850
  component: Un.name,
3717
3851
  label: t,
3718
3852
  state: {
3719
3853
  columns: String(n.length),
3720
- rows: String(o.length),
3721
- empty: i
3854
+ rows: String(a.length),
3855
+ empty: r
3722
3856
  },
3723
- parts: In(n, o)
3857
+ parts: Wn(n, a)
3724
3858
  });
3725
- return s === "agent" ? /* @__PURE__ */ l(I, { node: ut(d) }) : /* @__PURE__ */ C("table", { ...r, ...M(d), role: "table", "aria-label": t, children: [
3726
- /* @__PURE__ */ l("thead", { role: "rowgroup", children: /* @__PURE__ */ l("tr", { role: "row", children: n.map((c) => /* @__PURE__ */ l(
3859
+ return l === "agent" ? /* @__PURE__ */ s(U, { node: ht(d) }) : /* @__PURE__ */ A("table", { ...i, ...M(d), role: "table", "aria-label": t, children: [
3860
+ /* @__PURE__ */ s("thead", { role: "rowgroup", children: /* @__PURE__ */ s("tr", { role: "row", children: n.map((c) => /* @__PURE__ */ s(
3727
3861
  "th",
3728
3862
  {
3729
3863
  role: "columnheader",
@@ -3734,24 +3868,24 @@ function Po(e) {
3734
3868
  },
3735
3869
  c.key
3736
3870
  )) }) }),
3737
- /* @__PURE__ */ l("tbody", { role: "rowgroup", children: i ? /* @__PURE__ */ l("tr", { role: "row", children: /* @__PURE__ */ l("td", { role: "cell", colSpan: n.length, children: a }) }) : o.map((c, p) => /* @__PURE__ */ l("tr", { role: "row", children: n.map((u) => /* @__PURE__ */ C(
3871
+ /* @__PURE__ */ s("tbody", { role: "rowgroup", children: r ? /* @__PURE__ */ s("tr", { role: "row", children: /* @__PURE__ */ s("td", { role: "cell", colSpan: n.length, children: o }) }) : a.map((c, p) => /* @__PURE__ */ s("tr", { role: "row", children: n.map((h) => /* @__PURE__ */ A(
3738
3872
  "td",
3739
3873
  {
3740
3874
  role: "cell",
3741
3875
  ...L({
3742
3876
  part: "cell",
3743
- state: At(u, Re(c, p))
3877
+ state: At(h, Le(c, p))
3744
3878
  }),
3745
3879
  children: [
3746
- /* @__PURE__ */ l("span", { "aria-hidden": "true", children: u.header }),
3747
- /* @__PURE__ */ l("div", { children: c.cells[u.key] })
3880
+ /* @__PURE__ */ s("span", { "aria-hidden": "true", children: h.header }),
3881
+ /* @__PURE__ */ s("div", { children: c.cells[h.key] })
3748
3882
  ]
3749
3883
  },
3750
- u.key
3751
- )) }, Re(c, p))) })
3884
+ h.key
3885
+ )) }, Le(c, p))) })
3752
3886
  ] });
3753
3887
  }
3754
- const Wn = q({
3888
+ const Bn = q({
3755
3889
  name: "Tag",
3756
3890
  category: "display",
3757
3891
  summary: "A small chip that classifies the thing next to it: a status, a category, a count, a build string.",
@@ -3808,15 +3942,15 @@ const Wn = q({
3808
3942
  }
3809
3943
  ]
3810
3944
  });
3811
- function Ro(e) {
3812
- const { tone: t = "neutral", filled: n = !1, children: o, ...a } = e, r = U(), s = $({
3813
- component: Wn.name,
3814
- label: F(o),
3945
+ function Ra(e) {
3946
+ const { tone: t = "neutral", filled: n = !1, children: a, ...o } = e, i = I(), l = R({
3947
+ component: Bn.name,
3948
+ label: H(a),
3815
3949
  state: { tone: t, filled: n }
3816
3950
  });
3817
- return r === "agent" ? /* @__PURE__ */ l(I, { node: s }) : /* @__PURE__ */ l("span", { ...a, ...M(s), children: o });
3951
+ return i === "agent" ? /* @__PURE__ */ s(U, { node: l }) : /* @__PURE__ */ s("span", { ...o, ...M(l), children: a });
3818
3952
  }
3819
- const Bn = q({
3953
+ const jn = q({
3820
3954
  name: "Text",
3821
3955
  category: "typography",
3822
3956
  summary: "A run of prose, sized and toned from the semantic scale. In agent view it renders as its own text content, so an agent reads the words rather than inferring them from styling.",
@@ -3882,13 +4016,13 @@ const Bn = q({
3882
4016
  }
3883
4017
  ]
3884
4018
  });
3885
- function Lo(e) {
3886
- const { tone: t = "default", size: n = "normal", as: o = "p", children: a, ...r } = e, s = U(), i = $({
3887
- component: Bn.name,
3888
- label: F(a),
4019
+ function $a(e) {
4020
+ const { tone: t = "default", size: n = "normal", as: a = "p", children: o, ...i } = e, l = I(), r = R({
4021
+ component: jn.name,
4022
+ label: H(o),
3889
4023
  state: { tone: t, size: n }
3890
4024
  });
3891
- return s === "agent" ? /* @__PURE__ */ l(I, { node: i }) : /* @__PURE__ */ l(o, { ...r, ...M(i), children: a });
4025
+ return l === "agent" ? /* @__PURE__ */ s(U, { node: r }) : /* @__PURE__ */ s(a, { ...i, ...M(r), children: o });
3892
4026
  }
3893
4027
  const Ct = {
3894
4028
  verb: "fill",
@@ -4029,45 +4163,45 @@ const Ct = {
4029
4163
  notes: "The label element is associated via htmlFor. An error sets aria-invalid and is linked with aria-describedby, as is the hint."
4030
4164
  }
4031
4165
  });
4032
- function jn(e, t) {
4166
+ function _n(e, t) {
4033
4167
  return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
4034
4168
  }
4035
- function $o(e) {
4169
+ function Oa(e) {
4036
4170
  const {
4037
4171
  label: t,
4038
4172
  value: n,
4039
- onChange: o,
4040
- rows: a = 4,
4041
- placeholder: r,
4042
- hint: s,
4043
- error: i,
4173
+ onChange: a,
4174
+ rows: o = 4,
4175
+ placeholder: i,
4176
+ hint: l,
4177
+ error: r,
4044
4178
  name: d,
4045
4179
  disabled: c = !1,
4046
4180
  required: p = !1,
4047
- agentName: u,
4181
+ agentName: h,
4048
4182
  agentTool: g = !0,
4049
- ...h
4050
- } = e, y = U(), f = G(), b = H(), w = le(), T = m(null), A = m(o);
4051
- A.current = o;
4052
- const R = m(b);
4053
- R.current = b;
4054
- const O = m($({ component: ze.name })), E = m(!0);
4183
+ ...u
4184
+ } = e, y = I(), f = G(), b = F(), w = le(), T = m(null), C = m(a);
4185
+ C.current = a;
4186
+ const $ = m(b);
4187
+ $.current = b;
4188
+ const O = m(R({ component: ze.name })), E = m(!0);
4055
4189
  _(() => (E.current = !0, () => {
4056
4190
  E.current = !1;
4057
4191
  }), []);
4058
4192
  const S = B(async (D) => {
4059
- const P = D.value;
4060
- if (typeof P != "string")
4193
+ const N = D.value;
4194
+ if (typeof N != "string")
4061
4195
  return 'Pass "value" as a string holding the full text the area should contain.';
4062
- const N = T.current;
4063
- return N !== null ? Tt(N, P) : z(() => A.current(P)), await K(), E.current ? `Filled. The area is now:
4064
- ${R.current([O.current])}` : "The change removed this area from the page.";
4196
+ const P = T.current;
4197
+ return P !== null ? Tt(P, N) : z(() => C.current(N)), await K(), E.current ? `Filled. The area is now:
4198
+ ${$.current([O.current])}` : "The change removed this area from the page.";
4065
4199
  }, []), v = V({
4066
4200
  spec: Ct,
4067
- label: u ?? t,
4201
+ label: h ?? t,
4068
4202
  enabled: g && !c,
4069
4203
  execute: S
4070
- }), k = $({
4204
+ }), k = R({
4071
4205
  component: ze.name,
4072
4206
  label: t,
4073
4207
  tool: v,
@@ -4076,27 +4210,27 @@ ${R.current([O.current])}` : "The change removed this area from the page.";
4076
4210
  empty: n === "",
4077
4211
  disabled: c,
4078
4212
  required: p,
4079
- invalid: i !== void 0
4213
+ invalid: r !== void 0
4080
4214
  },
4081
- parts: jn(i, s)
4215
+ parts: _n(r, l)
4082
4216
  });
4083
4217
  if (O.current = k, y === "agent")
4084
- return c || f === "never" ? /* @__PURE__ */ l(I, { node: k }) : /* @__PURE__ */ l(
4218
+ return c || f === "never" ? /* @__PURE__ */ s(U, { node: k }) : /* @__PURE__ */ s(
4085
4219
  dt,
4086
4220
  {
4087
4221
  node: k,
4088
4222
  value: n,
4089
4223
  multiline: !0,
4090
- onValueChange: o,
4224
+ onValueChange: a,
4091
4225
  ref: (D) => {
4092
4226
  T.current = D;
4093
4227
  }
4094
4228
  }
4095
4229
  );
4096
- const x = i !== void 0 ? `${w}-error` : s !== void 0 ? `${w}-hint` : void 0;
4097
- return /* @__PURE__ */ C("div", { ...h, ...M(k), children: [
4098
- /* @__PURE__ */ l("label", { htmlFor: w, children: t }),
4099
- /* @__PURE__ */ l(
4230
+ const x = r !== void 0 ? `${w}-error` : l !== void 0 ? `${w}-hint` : void 0;
4231
+ return /* @__PURE__ */ A("div", { ...u, ...M(k), children: [
4232
+ /* @__PURE__ */ s("label", { htmlFor: w, children: t }),
4233
+ /* @__PURE__ */ s(
4100
4234
  "textarea",
4101
4235
  {
4102
4236
  id: w,
@@ -4104,18 +4238,18 @@ ${R.current([O.current])}` : "The change removed this area from the page.";
4104
4238
  ref: (D) => {
4105
4239
  T.current = D;
4106
4240
  },
4107
- rows: a,
4241
+ rows: o,
4108
4242
  value: n,
4109
- placeholder: r,
4243
+ placeholder: i,
4110
4244
  name: d,
4111
4245
  disabled: c,
4112
4246
  required: p,
4113
- "aria-invalid": i !== void 0 || void 0,
4247
+ "aria-invalid": r !== void 0 || void 0,
4114
4248
  "aria-describedby": x,
4115
- onChange: (D) => o(D.currentTarget.value)
4249
+ onChange: (D) => a(D.currentTarget.value)
4116
4250
  }
4117
4251
  ),
4118
- i !== void 0 ? /* @__PURE__ */ l("p", { id: x, ...L({ part: "error", state: {} }), children: i }) : s !== void 0 ? /* @__PURE__ */ l("p", { id: x, ...L({ part: "hint", state: {} }), children: s }) : null
4252
+ r !== void 0 ? /* @__PURE__ */ s("p", { id: x, ...L({ part: "error", state: {} }), children: r }) : l !== void 0 ? /* @__PURE__ */ s("p", { id: x, ...L({ part: "hint", state: {} }), children: l }) : null
4119
4253
  ] });
4120
4254
  }
4121
4255
  const St = {
@@ -4277,46 +4411,46 @@ const St = {
4277
4411
  notes: "The label element is associated via htmlFor. An error sets aria-invalid and is linked with aria-describedby, as is the hint. Focus is an offset keyline, never a rounded ring."
4278
4412
  }
4279
4413
  });
4280
- function _n(e, t) {
4414
+ function Vn(e, t) {
4281
4415
  return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
4282
4416
  }
4283
- function Oo(e) {
4417
+ function Da(e) {
4284
4418
  const {
4285
4419
  label: t,
4286
4420
  value: n,
4287
- onChange: o,
4288
- type: a = "text",
4289
- placeholder: r,
4290
- hint: s,
4291
- error: i,
4421
+ onChange: a,
4422
+ type: o = "text",
4423
+ placeholder: i,
4424
+ hint: l,
4425
+ error: r,
4292
4426
  name: d,
4293
4427
  autoComplete: c,
4294
4428
  disabled: p = !1,
4295
- required: u = !1,
4429
+ required: h = !1,
4296
4430
  agentName: g,
4297
- agentTool: h = !0,
4431
+ agentTool: u = !0,
4298
4432
  ...y
4299
- } = e, f = U(), b = G(), w = H(), T = le(), A = m(null), R = m(o);
4300
- R.current = o;
4433
+ } = e, f = I(), b = G(), w = F(), T = le(), C = m(null), $ = m(a);
4434
+ $.current = a;
4301
4435
  const O = m(w);
4302
4436
  O.current = w;
4303
- const E = m($({ component: Xe.name })), S = m(!0);
4437
+ const E = m(R({ component: Xe.name })), S = m(!0);
4304
4438
  _(() => (S.current = !0, () => {
4305
4439
  S.current = !1;
4306
4440
  }), []);
4307
- const v = a === "password", k = B(async (N) => {
4308
- const j = N.value;
4441
+ const v = o === "password", k = B(async (P) => {
4442
+ const j = P.value;
4309
4443
  if (typeof j != "string")
4310
4444
  return 'Pass "value" as a string holding the full text the field should contain.';
4311
- const Y = A.current;
4312
- return Y !== null ? Tt(Y, j) : z(() => R.current(j)), await K(), S.current ? `Filled. The field is now:
4445
+ const J = C.current;
4446
+ return J !== null ? Tt(J, j) : z(() => $.current(j)), await K(), S.current ? `Filled. The field is now:
4313
4447
  ${O.current([E.current])}` : "The change removed this field from the page.";
4314
4448
  }, []), x = V({
4315
4449
  spec: St,
4316
4450
  label: g ?? t,
4317
- enabled: h && !p,
4451
+ enabled: u && !p,
4318
4452
  execute: k
4319
- }), D = $({
4453
+ }), D = R({
4320
4454
  component: Xe.name,
4321
4455
  label: t,
4322
4456
  tool: x,
@@ -4324,80 +4458,80 @@ ${O.current([E.current])}` : "The change removed this field from the page.";
4324
4458
  ...v ? { filled: n !== "" } : n === "" ? {} : { value: n },
4325
4459
  empty: n === "",
4326
4460
  disabled: p,
4327
- required: u,
4328
- invalid: i !== void 0
4461
+ required: h,
4462
+ invalid: r !== void 0
4329
4463
  },
4330
- parts: _n(i, s)
4464
+ parts: Vn(r, l)
4331
4465
  });
4332
4466
  if (E.current = D, f === "agent")
4333
- return p || b === "never" ? /* @__PURE__ */ l(I, { node: D }) : /* @__PURE__ */ l(
4467
+ return p || b === "never" ? /* @__PURE__ */ s(U, { node: D }) : /* @__PURE__ */ s(
4334
4468
  dt,
4335
4469
  {
4336
4470
  node: D,
4337
4471
  value: n,
4338
4472
  masked: v,
4339
- onValueChange: o,
4340
- ref: (N) => {
4341
- A.current = N;
4473
+ onValueChange: a,
4474
+ ref: (P) => {
4475
+ C.current = P;
4342
4476
  }
4343
4477
  }
4344
4478
  );
4345
- const P = i !== void 0 ? `${T}-error` : s !== void 0 ? `${T}-hint` : void 0;
4346
- return /* @__PURE__ */ C("div", { ...y, ...M(D), children: [
4347
- /* @__PURE__ */ l("label", { htmlFor: T, children: t }),
4348
- /* @__PURE__ */ l(
4479
+ const N = r !== void 0 ? `${T}-error` : l !== void 0 ? `${T}-hint` : void 0;
4480
+ return /* @__PURE__ */ A("div", { ...y, ...M(D), children: [
4481
+ /* @__PURE__ */ s("label", { htmlFor: T, children: t }),
4482
+ /* @__PURE__ */ s(
4349
4483
  "input",
4350
4484
  {
4351
4485
  id: T,
4352
4486
  ...L({ part: "input", state: {} }),
4353
- ref: (N) => {
4354
- A.current = N;
4487
+ ref: (P) => {
4488
+ C.current = P;
4355
4489
  },
4356
- type: a,
4490
+ type: o,
4357
4491
  value: n,
4358
- placeholder: r,
4492
+ placeholder: i,
4359
4493
  name: d,
4360
4494
  autoComplete: c,
4361
4495
  disabled: p,
4362
- required: u,
4363
- "aria-invalid": i !== void 0 || void 0,
4364
- "aria-describedby": P,
4365
- onChange: (N) => o(N.currentTarget.value)
4496
+ required: h,
4497
+ "aria-invalid": r !== void 0 || void 0,
4498
+ "aria-describedby": N,
4499
+ onChange: (P) => a(P.currentTarget.value)
4366
4500
  }
4367
4501
  ),
4368
- i !== void 0 ? /* @__PURE__ */ l("p", { id: P, ...L({ part: "error", state: {} }), children: i }) : s !== void 0 ? /* @__PURE__ */ l("p", { id: P, ...L({ part: "hint", state: {} }), children: s }) : null
4502
+ r !== void 0 ? /* @__PURE__ */ s("p", { id: N, ...L({ part: "error", state: {} }), children: r }) : l !== void 0 ? /* @__PURE__ */ s("p", { id: N, ...L({ part: "hint", state: {} }), children: l }) : null
4369
4503
  ] });
4370
4504
  }
4371
4505
  const Ee = 40;
4372
- function Vn(e) {
4506
+ function Hn(e) {
4373
4507
  const t = e.label === void 0 ? "" : Z(e.label), n = t === "" ? Z(e.component) : `${Z(e.component)}-${t}`;
4374
4508
  return n === "" ? "region" : n;
4375
4509
  }
4376
4510
  function Fn(e) {
4377
4511
  const t = /* @__PURE__ */ new Map();
4378
4512
  return e.map((n) => {
4379
- const o = Vn(n), a = t.get(o) ?? 0;
4380
- return t.set(o, a + 1), { key: a === 0 ? o : `${o}-${a + 1}`, node: n };
4513
+ const a = Hn(n), o = t.get(a) ?? 0;
4514
+ return t.set(a, o + 1), { key: o === 0 ? a : `${a}-${o + 1}`, node: n };
4381
4515
  });
4382
4516
  }
4383
- function Nt() {
4517
+ function Pt() {
4384
4518
  if (typeof document > "u") return [];
4385
4519
  const e = document.body, t = new Set(gt(e)), n = Array.from(e.querySelectorAll(`[${Oe}]`)).filter(
4386
- (o) => !t.has(o)
4520
+ (a) => !t.has(a)
4387
4521
  );
4388
4522
  return Fn([
4389
- ...an(e),
4390
- ...n.map((o) => De(o)).filter((o) => o !== null)
4523
+ ...on(e),
4524
+ ...n.map((a) => De(a)).filter((a) => a !== null)
4391
4525
  ]);
4392
4526
  }
4393
- const Hn = {
4527
+ const Gn = {
4394
4528
  verb: "list",
4395
4529
  description: "List the Sprint component regions on this page, with a one-line state summary for each. Call this first to discover region keys, then call read-region to read one in full. Regions nest: a page-level region contains the labelled panels listed after it, so read the smallest region that covers what you need.",
4396
4530
  inputSchema: { type: "object", properties: {} },
4397
4531
  readOnly: !0,
4398
4532
  untrustedContent: !0,
4399
4533
  registeredWhen: "A root SprintProvider is mounted and WebMCP is available."
4400
- }, Gn = {
4534
+ }, Kn = {
4401
4535
  verb: "read",
4402
4536
  description: "Read one region of the page as Markdown, including every component in it, its current state, and the tools that drive it. Long regions are paginated; the response ends with the page number and total.",
4403
4537
  inputSchema: {
@@ -4419,27 +4553,27 @@ const Hn = {
4419
4553
  untrustedContent: !0,
4420
4554
  registeredWhen: "A root SprintProvider is mounted and WebMCP is available."
4421
4555
  };
4422
- function Kn(e) {
4423
- const t = Nt();
4556
+ function zn(e) {
4557
+ const t = Pt();
4424
4558
  if (t.length === 0) return "This page has no Sprint components.";
4425
- const n = t.map(({ key: o, node: a }) => {
4426
- const r = nt(a.children), s = e([{ ...a, children: [], parts: [] }]).split(`
4427
- `)[0]?.replace(/^-\s*/, ""), i = r === 0 ? "" : ` (${r} nested)`;
4428
- return `- \`${o}\` — ${s ?? a.component}${i}`;
4559
+ const n = t.map(({ key: a, node: o }) => {
4560
+ const i = nt(o.children), l = e([{ ...o, children: [], parts: [] }]).split(`
4561
+ `)[0]?.replace(/^-\s*/, ""), r = i === 0 ? "" : ` (${i} nested)`;
4562
+ return `- \`${a}\` — ${l ?? o.component}${r}`;
4429
4563
  });
4430
4564
  return [`${t.length} region(s):`, ...n].join(`
4431
4565
  `);
4432
4566
  }
4433
- function zn(e, t, n) {
4434
- const o = Nt(), a = o.map((d) => d.key), r = o.find((d) => d.key === t);
4435
- if (r === void 0)
4436
- return `No region named "${String(t)}". Available regions: ${a.join(", ") || "none"}.`;
4437
- const s = et(e([r.node]), te - Ee), i = typeof n == "number" ? n : 1;
4438
- return i < 1 || i > s.length ? `Region "${r.key}" has ${s.length} page(s); page ${i} does not exist.` : `${s[i - 1] ?? ""}
4567
+ function Xn(e, t, n) {
4568
+ const a = Pt(), o = a.map((d) => d.key), i = a.find((d) => d.key === t);
4569
+ if (i === void 0)
4570
+ return `No region named "${String(t)}". Available regions: ${o.join(", ") || "none"}.`;
4571
+ const l = et(e([i.node]), te - Ee), r = typeof n == "number" ? n : 1;
4572
+ return r < 1 || r > l.length ? `Region "${i.key}" has ${l.length} page(s); page ${r} does not exist.` : `${l[r - 1] ?? ""}
4439
4573
 
4440
- (page ${i} of ${s.length})`;
4574
+ (page ${r} of ${l.length})`;
4441
4575
  }
4442
- const Xn = {
4576
+ const Yn = {
4443
4577
  verb: "set",
4444
4578
  description: 'Switch how this page renders. In "agent" view every Sprint component renders as plain Markdown text with no HTML elements, so the page can be read directly. In "human" view it renders normally. Tools keep working in both.',
4445
4579
  inputSchema: {
@@ -4457,96 +4591,96 @@ const Xn = {
4457
4591
  untrustedContent: !0,
4458
4592
  registeredWhen: "A root SprintProvider is mounted and WebMCP is available."
4459
4593
  };
4460
- function Pt() {
4594
+ function Nt() {
4461
4595
  return typeof document > "u" ? "" : (document.body.textContent ?? "").replace(/\n{3,}/g, `
4462
4596
 
4463
4597
  `).trim();
4464
4598
  }
4465
- function Yn(e) {
4466
- const { enabled: t, format: n, view: o, setView: a } = e;
4599
+ function Jn(e) {
4600
+ const { enabled: t, format: n, view: a, setView: o } = e;
4467
4601
  V({
4468
- spec: Hn,
4602
+ spec: Gn,
4469
4603
  label: "page regions",
4470
4604
  enabled: t,
4471
- execute: () => o === "agent" ? 'This page is in agent view and renders as one text document. Call read-region with region "page", or read the page text directly.' : Kn(n)
4605
+ execute: () => a === "agent" ? 'This page is in agent view and renders as one text document. Call read-region with region "page", or read the page text directly.' : zn(n)
4472
4606
  }), V({
4473
- spec: Gn,
4607
+ spec: Kn,
4474
4608
  label: "region",
4475
4609
  enabled: t,
4476
- execute: (r) => o === "agent" ? Jn(r.region, r.page) : zn(n, r.region, r.page)
4610
+ execute: (i) => a === "agent" ? Qn(i.region, i.page) : Xn(n, i.region, i.page)
4477
4611
  }), V({
4478
- spec: Xn,
4612
+ spec: Yn,
4479
4613
  label: "page view",
4480
4614
  enabled: t,
4481
- execute: async (r) => {
4482
- const s = r.view === "agent" ? "agent" : "human";
4483
- return z(() => a(s)), await K(), s === "agent" ? `Page is now in agent view:
4615
+ execute: async (i) => {
4616
+ const l = i.view === "agent" ? "agent" : "human";
4617
+ return z(() => o(l)), await K(), l === "agent" ? `Page is now in agent view:
4484
4618
 
4485
- ${Ne(Pt(), te - Ee)}` : "Page is now in human view.";
4619
+ ${Pe(Nt(), te - Ee)}` : "Page is now in human view.";
4486
4620
  }
4487
4621
  });
4488
4622
  }
4489
- function Jn(e, t) {
4623
+ function Qn(e, t) {
4490
4624
  if (e !== "page")
4491
4625
  return `No region named "${String(e)}". In agent view the whole page is one region, named "page".`;
4492
- const n = et(Pt(), te - Ee), o = typeof t == "number" ? t : 1;
4493
- return o < 1 || o > n.length ? `Region "page" has ${n.length} page(s); page ${o} does not exist.` : `${n[o - 1] ?? ""}
4626
+ const n = et(Nt(), te - Ee), a = typeof t == "number" ? t : 1;
4627
+ return a < 1 || a > n.length ? `Region "page" has ${n.length} page(s); page ${a} does not exist.` : `${n[a - 1] ?? ""}
4494
4628
 
4495
- (page ${o} of ${n.length})`;
4629
+ (page ${a} of ${n.length})`;
4496
4630
  }
4497
- const Qn = 1200;
4498
- function Do(e) {
4631
+ const Zn = 1200;
4632
+ function Ea(e) {
4499
4633
  const {
4500
4634
  children: t,
4501
4635
  label: n,
4502
- format: o,
4503
- pageTools: a = !0,
4504
- view: r,
4505
- defaultView: s,
4506
- onViewChange: i,
4636
+ format: a,
4637
+ pageTools: o = !0,
4638
+ view: i,
4639
+ defaultView: l,
4640
+ onViewChange: r,
4507
4641
  agentControls: d,
4508
4642
  theme: c
4509
- } = e, p = ke(), u = zt(), g = !u.owned, [h, y] = J(s ?? "human"), f = r !== void 0, b = f || g || s !== void 0, w = f ? r : b ? h : u.view, T = B(
4510
- (P) => {
4643
+ } = e, p = ke(), h = zt(), g = !h.owned, [u, y] = Y(l ?? "human"), f = i !== void 0, b = f || g || l !== void 0, w = f ? i : b ? u : h.view, T = B(
4644
+ (N) => {
4511
4645
  if (!b) {
4512
- u.setView(P);
4646
+ h.setView(N);
4513
4647
  return;
4514
4648
  }
4515
- f || y(P), i?.(P);
4649
+ f || y(N), r?.(N);
4516
4650
  },
4517
- [b, f, u, i]
4518
- ), A = d ?? u.controls, R = o ?? u.format ?? st, O = ee(
4519
- () => ({ view: w, setView: T, controls: A, format: R, owned: b }),
4520
- [w, T, A, R, b]
4651
+ [b, f, h, r]
4652
+ ), C = d ?? h.controls, $ = a ?? h.format ?? st, O = ee(
4653
+ () => ({ view: w, setView: T, controls: C, format: $, owned: b }),
4654
+ [w, T, C, $, b]
4521
4655
  ), E = ee(
4522
4656
  () => ({ path: n === void 0 ? p : [...p, n] }),
4523
4657
  [p, n]
4524
4658
  );
4525
- Yn({
4526
- enabled: g && a,
4527
- format: R,
4659
+ Jn({
4660
+ enabled: g && o,
4661
+ format: $,
4528
4662
  view: w,
4529
4663
  setView: T
4530
4664
  });
4531
- const S = m(null), [v, k] = J(!1);
4665
+ const S = m(null), [v, k] = Y(!1);
4532
4666
  _(() => {
4533
4667
  if (!v) return;
4534
- const P = setTimeout(() => k(!1), Qn);
4535
- return () => clearTimeout(P);
4668
+ const N = setTimeout(() => k(!1), Zn);
4669
+ return () => clearTimeout(N);
4536
4670
  }, [v]);
4537
4671
  const x = () => {
4538
- const P = navigator.clipboard;
4539
- if (P === void 0) return;
4540
- const N = (S.current?.textContent ?? "").replace(/\n{3,}/g, `
4672
+ const N = navigator.clipboard;
4673
+ if (N === void 0) return;
4674
+ const P = (S.current?.textContent ?? "").replace(/\n{3,}/g, `
4541
4675
 
4542
4676
  `).trim();
4543
- P.writeText(N).then(
4677
+ N.writeText(P).then(
4544
4678
  () => k(!0),
4545
4679
  () => k(!1)
4546
4680
  );
4547
4681
  };
4548
- return /* @__PURE__ */ l(Kt, { value: O, children: /* @__PURE__ */ C(me, { value: E, children: [
4549
- b && w === "agent" && A !== "never" ? /* @__PURE__ */ l(
4682
+ return /* @__PURE__ */ s(Kt, { value: O, children: /* @__PURE__ */ A(me, { value: E, children: [
4683
+ b && w === "agent" && C !== "never" ? /* @__PURE__ */ s(
4550
4684
  "button",
4551
4685
  {
4552
4686
  type: "button",
@@ -4556,7 +4690,7 @@ function Do(e) {
4556
4690
  onClick: x
4557
4691
  }
4558
4692
  ) : null,
4559
- /* @__PURE__ */ l(
4693
+ /* @__PURE__ */ s(
4560
4694
  "div",
4561
4695
  {
4562
4696
  ref: S,
@@ -4567,70 +4701,71 @@ function Do(e) {
4567
4701
  )
4568
4702
  ] }) });
4569
4703
  }
4570
- function Eo(e) {
4571
- const { children: t, label: n } = e, o = ke(), a = ee(() => ({ path: [...o, n] }), [o, n]);
4572
- return /* @__PURE__ */ l(me, { value: a, children: t });
4704
+ function Ma(e) {
4705
+ const { children: t, label: n } = e, a = ke(), o = ee(() => ({ path: [...a, n] }), [a, n]);
4706
+ return /* @__PURE__ */ s(me, { value: o, children: t });
4573
4707
  }
4574
- const Zn = "0.1.3", eo = {
4575
- version: Zn
4576
- }, Mo = eo.version;
4708
+ const ea = "0.2.0", ta = {
4709
+ version: ea
4710
+ }, qa = ta.version;
4577
4711
  export {
4578
4712
  Qe as AGENT_ATTRIBUTE,
4579
- ue as AgentControl,
4713
+ he as AgentControl,
4580
4714
  we as AgentControlGroup,
4581
- I as AgentLine,
4582
- Eo as AgentRegion,
4715
+ U as AgentLine,
4716
+ Ma as AgentRegion,
4583
4717
  me as AgentScopeProvider,
4584
- so as Alert,
4718
+ la as Alert,
4585
4719
  dn as Button,
4586
4720
  yt as CLOSE_DIALOG_TOOL,
4587
4721
  Q as COMPONENT_ATTRIBUTE,
4588
- lo as Card,
4589
- co as Checkbox,
4590
- uo as CodeBlock,
4722
+ ca as Card,
4723
+ da as Checkbox,
4724
+ ha as CodeBlock,
4591
4725
  ft as DISMISS_ALERT_TOOL,
4592
- ho as DescriptionList,
4593
- po as Dialog,
4726
+ ua as DescriptionList,
4727
+ pa as Dialog,
4594
4728
  Ct as FILL_TEXTAREA_TOOL,
4595
4729
  St as FILL_TOOL,
4596
- go as Heading,
4597
- mo as Link,
4598
- fo as List,
4599
- bo as MetaLine,
4600
- vo as Nav,
4601
- wo as NavGroup,
4730
+ ga as Heading,
4731
+ ma as Image,
4732
+ fa as Link,
4733
+ ba as List,
4734
+ va as MetaLine,
4735
+ wa as Nav,
4736
+ ya as NavGroup,
4602
4737
  vt as OPEN_CARD_TOOL,
4603
4738
  kt as OPEN_LINK_TOOL,
4604
4739
  Je as OWNER_ATTRIBUTE,
4605
- Ue as PARAM_DESCRIPTION_LIMIT,
4606
- oe as PART_ATTRIBUTE,
4740
+ Ie as PARAM_DESCRIPTION_LIMIT,
4741
+ ae as PART_ATTRIBUTE,
4607
4742
  bt as PRESS_TOOL,
4608
- yo as PageHeader,
4609
- ko as Panel,
4743
+ ka as PageHeader,
4744
+ Ta as Panel,
4610
4745
  Oe as REGION_ATTRIBUTE,
4611
4746
  Mt as RESERVED_STATE_KEYS,
4612
- ie as SELECT_OPTION_TOOL,
4613
- re as SELECT_TOOL,
4747
+ re as SELECT_OPTION_TOOL,
4748
+ ie as SELECT_TOOL,
4614
4749
  wt as SET_CHECKBOX_TOOL,
4615
4750
  xt as SET_SWITCH_TOOL,
4616
4751
  pe as STATE_ATTRIBUTE_PREFIX,
4617
- To as SecretField,
4618
- xo as SegmentedControl,
4619
- Ao as Select,
4620
- Co as Shell,
4621
- Do as SprintProvider,
4622
- So as Stack,
4623
- No as Switch,
4752
+ xa as SecretField,
4753
+ Aa as SegmentedControl,
4754
+ Ca as Select,
4755
+ Sa as Shell,
4756
+ Ea as SprintProvider,
4757
+ Pa as Stack,
4758
+ Na as Switch,
4624
4759
  Et as THEME_ATTRIBUTE,
4625
4760
  ce as TOOL_ATTRIBUTE,
4626
4761
  qe as TOOL_DESCRIPTION_LIMIT,
4627
4762
  Bt as TOOL_NAMING_CONVENTION,
4628
4763
  te as TOOL_OUTPUT_LIMIT,
4629
- Po as Table,
4630
- Ro as Tag,
4631
- Lo as Text,
4632
- Oo as TextInput,
4633
- $o as Textarea,
4764
+ La as Table,
4765
+ Ra as Tag,
4766
+ $a as Text,
4767
+ Da as TextInput,
4768
+ Oa as Textarea,
4634
4769
  Ot as VIEW_ATTRIBUTE,
4635
4770
  Dt as VIEW_COPY_ATTRIBUTE,
4636
4771
  ye as accessibleText,
@@ -4639,14 +4774,14 @@ export {
4639
4774
  M as agentAttributesFor,
4640
4775
  L as agentPartAttributesFor,
4641
4776
  Xt as agentPartControlAttributes,
4642
- ao as agentSelector,
4777
+ ia as agentSelector,
4643
4778
  je as alertMeta,
4644
- io as buildAgentManifest,
4645
- $ as buildAgentNode,
4779
+ sa as buildAgentManifest,
4780
+ R as buildAgentNode,
4646
4781
  _e as buttonMeta,
4647
4782
  Ve as cardMeta,
4648
- Fe as checkboxMeta,
4649
- Ne as clamp,
4783
+ He as checkboxMeta,
4784
+ Pe as clamp,
4650
4785
  mn as codeBlockMeta,
4651
4786
  st as defaultAgentFormat,
4652
4787
  q as defineAgentMeta,
@@ -4655,43 +4790,44 @@ export {
4655
4790
  jt as getAgentMeta,
4656
4791
  tt as getModelContext,
4657
4792
  yn as headingMeta,
4658
- ro as isModelContextAvailable,
4659
- kn as linkMeta,
4793
+ kn as imageMeta,
4794
+ ra as isModelContextAvailable,
4795
+ Tn as linkMeta,
4660
4796
  _t as listAgentMeta,
4661
- Tn as listMeta,
4662
- xn as metaLineMeta,
4663
- Cn as navGroupMeta,
4664
- An as navMeta,
4665
- Ht as nodeLine,
4666
- Sn as pageHeaderMeta,
4797
+ xn as listMeta,
4798
+ An as metaLineMeta,
4799
+ Sn as navGroupMeta,
4800
+ Cn as navMeta,
4801
+ Ft as nodeLine,
4802
+ Pn as pageHeaderMeta,
4667
4803
  et as paginate,
4668
4804
  Nn as panelMeta,
4669
- F as reactText,
4805
+ H as reactText,
4670
4806
  Wt as registerTool,
4671
- Pn as secretFieldMeta,
4672
- He as segmentedControlMeta,
4807
+ Ln as secretFieldMeta,
4808
+ Fe as segmentedControlMeta,
4673
4809
  Ge as selectMeta,
4674
4810
  De as serializeElement,
4675
- an as serializeWithin,
4676
- Mn as shellMeta,
4811
+ on as serializeWithin,
4812
+ qn as shellMeta,
4677
4813
  Z as slug,
4678
- qn as stackMeta,
4814
+ In as stackMeta,
4679
4815
  Ke as switchMeta,
4680
4816
  Un as tableMeta,
4681
- Wn as tagMeta,
4817
+ Bn as tagMeta,
4682
4818
  Xe as textInputMeta,
4683
- Bn as textMeta,
4819
+ jn as textMeta,
4684
4820
  ze as textareaMeta,
4685
4821
  Gt as toMarkdown,
4686
4822
  gn as tokenize,
4687
4823
  We as toolName,
4688
4824
  G as useAgentControls,
4689
- H as useAgentFormat,
4825
+ F as useAgentFormat,
4690
4826
  ke as useAgentScope,
4691
4827
  V as useAgentTool,
4692
- U as useSprintView,
4828
+ I as useSprintView,
4693
4829
  zt as useSprintViewControl,
4694
- Ut as validateInputs,
4695
- Mo as version
4830
+ It as validateInputs,
4831
+ qa as version
4696
4832
  };
4697
4833
  //# sourceMappingURL=index.js.map