@westonkd/sprint 0.1.2 → 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/agent-manifest.json +111 -1
- package/dist/index.cjs +62 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +100 -1
- package/dist/index.js +1082 -946
- package/dist/index.js.map +1 -1
- package/dist/sprint.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as ne, createContext as $e, Fragment as Se, isValidElement as
|
|
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",
|
|
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[
|
|
20
|
-
for (const [
|
|
21
|
-
|
|
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
|
|
24
|
+
function ia(e, t) {
|
|
25
25
|
const n = `[${Q}="${e}"]`;
|
|
26
|
-
return t ? `${n} [${
|
|
26
|
+
return t ? `${n} [${ae}="${t}"]` : n;
|
|
27
27
|
}
|
|
28
28
|
const xe = `
|
|
29
29
|
… truncated`;
|
|
30
|
-
function
|
|
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,
|
|
33
|
+
const n = t - xe.length, a = e.slice(0, n), o = a.lastIndexOf(`
|
|
34
34
|
`);
|
|
35
|
-
return `${
|
|
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
|
-
`),
|
|
41
|
-
let
|
|
42
|
-
for (const
|
|
43
|
-
const
|
|
44
|
-
${
|
|
45
|
-
if (
|
|
46
|
-
|
|
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 (
|
|
50
|
-
for (let
|
|
51
|
-
|
|
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
|
|
53
|
+
return o !== "" && a.push(o), a.length === 0 ? [""] : a;
|
|
54
54
|
}
|
|
55
|
-
const te = 1500, qe = 500,
|
|
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
|
|
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
|
|
69
|
-
if (
|
|
68
|
+
const a = n.description ?? "";
|
|
69
|
+
if (a.length > Ie)
|
|
70
70
|
throw new Error(
|
|
71
|
-
`Tool "${e.name}" parameter "${t}" description is ${
|
|
71
|
+
`Tool "${e.name}" parameter "${t}" description is ${a.length} characters; the platform limit is ${Ie}.`
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function It(e, t) {
|
|
76
76
|
for (const n of e.required ?? [])
|
|
77
77
|
if (t[n] === void 0) {
|
|
78
|
-
const
|
|
79
|
-
return `Missing required parameter "${n}". Expected parameters: ${
|
|
78
|
+
const a = Object.keys(e.properties).join(", ");
|
|
79
|
+
return `Missing required parameter "${n}". Expected parameters: ${a || "none"}.`;
|
|
80
80
|
}
|
|
81
|
-
for (const [n,
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
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
|
|
89
|
-
if (!(
|
|
90
|
-
return `Parameter "${n}" must be a ${
|
|
91
|
-
if (
|
|
92
|
-
return `Parameter "${n}" must be one of: ${
|
|
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
|
|
97
|
-
return { ...e, execute: async (n,
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
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
|
|
102
|
-
return
|
|
103
|
-
} catch (
|
|
104
|
-
const
|
|
105
|
-
return
|
|
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
|
|
114
|
-
return
|
|
115
|
-
console.warn(`Sprint could not register tool "${e.name}"`,
|
|
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
|
|
131
|
+
function sa(e) {
|
|
132
132
|
return {
|
|
133
133
|
library: "sprint",
|
|
134
134
|
version: e,
|
|
135
135
|
conventions: {
|
|
136
136
|
componentAttribute: Q,
|
|
137
|
-
partAttribute:
|
|
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
|
|
158
|
+
function at(e) {
|
|
159
159
|
const t = Object.keys(e).sort();
|
|
160
|
-
return t.length === 0 ? "" : ` [${t.map((
|
|
161
|
-
const
|
|
162
|
-
return
|
|
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
|
|
165
|
+
function ot(e) {
|
|
166
166
|
return e === void 0 ? "" : ` "${e}"`;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function it(e) {
|
|
169
169
|
return e === void 0 ? "" : ` → tool \`${e}\``;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return `${t}- part \`${e.part}\`${
|
|
171
|
+
function Ht(e, t) {
|
|
172
|
+
return `${t}- part \`${e.part}\`${ot(e.label)}${at(
|
|
173
173
|
e.state
|
|
174
|
-
)}${
|
|
174
|
+
)}${it(e.tool)}`;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function Ft(e) {
|
|
177
177
|
const t = Vt(e) ? " (empty)" : "", n = e.owner === void 0 ? "" : ` (owned by \`${e.owner}\`)`;
|
|
178
|
-
return `- **${e.component}**${
|
|
178
|
+
return `- **${e.component}**${ot(e.label)}${at(
|
|
179
179
|
e.state
|
|
180
|
-
)}${
|
|
180
|
+
)}${it(e.tool)}${n}${t}`;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const
|
|
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
|
|
185
|
+
for (const i of e.summary.split(`
|
|
186
186
|
`))
|
|
187
|
-
|
|
188
|
-
for (const
|
|
189
|
-
|
|
190
|
-
for (const
|
|
191
|
-
|
|
192
|
-
return e.truncated &&
|
|
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],
|
|
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((
|
|
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
|
|
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
|
|
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
|
|
225
|
+
function R(e) {
|
|
226
226
|
const t = {};
|
|
227
|
-
for (const [n,
|
|
228
|
-
|
|
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
|
-
[
|
|
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
|
|
274
|
-
const { node: t, children: n } = e,
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
`${
|
|
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:
|
|
284
|
-
return /* @__PURE__ */
|
|
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((
|
|
289
|
-
const
|
|
290
|
-
return
|
|
291
|
-
` }, b) : /* @__PURE__ */
|
|
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__ */
|
|
293
|
+
/* @__PURE__ */ s(
|
|
294
294
|
"button",
|
|
295
295
|
{
|
|
296
296
|
type: "button",
|
|
297
|
-
...Xt(t.component,
|
|
298
|
-
onClick: () => n(
|
|
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
|
-
|
|
306
|
+
o
|
|
307
307
|
] });
|
|
308
308
|
}
|
|
309
309
|
function dt(e) {
|
|
310
|
-
const { node: t, value: n, onValueChange:
|
|
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
|
-
...
|
|
313
|
+
...h,
|
|
314
314
|
"aria-label": t.label,
|
|
315
315
|
value: n,
|
|
316
|
-
onChange: (
|
|
317
|
-
ref:
|
|
316
|
+
onChange: (u) => a(u.currentTarget.value),
|
|
317
|
+
ref: l
|
|
318
318
|
}
|
|
319
|
-
) : /* @__PURE__ */
|
|
319
|
+
) : /* @__PURE__ */ s(
|
|
320
320
|
"input",
|
|
321
321
|
{
|
|
322
|
-
...
|
|
322
|
+
...h,
|
|
323
323
|
"aria-label": t.label,
|
|
324
|
-
type:
|
|
324
|
+
type: i ? "password" : "text",
|
|
325
325
|
value: n,
|
|
326
|
-
onChange: (
|
|
327
|
-
ref:
|
|
326
|
+
onChange: (u) => a(u.currentTarget.value),
|
|
327
|
+
ref: l
|
|
328
328
|
}
|
|
329
329
|
);
|
|
330
|
-
return /* @__PURE__ */
|
|
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
|
|
341
|
-
const { node: t, as: n = "button", href:
|
|
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
|
-
...
|
|
345
|
-
...
|
|
346
|
-
href:
|
|
347
|
-
ref:
|
|
344
|
+
...l,
|
|
345
|
+
...u,
|
|
346
|
+
href: a ?? "#",
|
|
347
|
+
ref: i,
|
|
348
348
|
children: p
|
|
349
349
|
}
|
|
350
|
-
) : /* @__PURE__ */
|
|
350
|
+
) : /* @__PURE__ */ s(
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
|
-
...
|
|
354
|
-
...
|
|
355
|
-
ref:
|
|
353
|
+
...l,
|
|
354
|
+
...u,
|
|
355
|
+
ref: i,
|
|
356
356
|
children: p
|
|
357
357
|
}
|
|
358
358
|
);
|
|
359
|
-
return /* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
376
|
+
function Ue(e, t) {
|
|
377
377
|
return JSON.stringify([e, t]);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function ht(e) {
|
|
380
380
|
if (e.parts.length === 0 || !e.parts.every(Yt)) return e;
|
|
381
|
-
const t = [], n = [],
|
|
382
|
-
for (const
|
|
383
|
-
const
|
|
384
|
-
t.includes(
|
|
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
|
|
386
|
+
const o = [
|
|
387
387
|
`| row | ${t.map(Ae).join(" | ")} |`,
|
|
388
388
|
`| --- | ${t.map(() => "---").join(" | ")} |`,
|
|
389
389
|
...n.map(
|
|
390
|
-
(
|
|
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:
|
|
394
|
+
return { ...e, parts: [], summary: o };
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ue(e) {
|
|
397
397
|
return e.replace(/\s+/g, " ").trim();
|
|
398
398
|
}
|
|
399
|
-
function
|
|
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
|
|
406
|
+
for (const a of e) Ne(a, t);
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
|
-
if (!
|
|
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
|
-
|
|
416
|
+
Ne(n.children, t);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function H(e) {
|
|
420
420
|
const t = [];
|
|
421
|
-
|
|
422
|
-
const n =
|
|
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
|
|
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
|
|
435
|
-
if (Jt(
|
|
436
|
-
const
|
|
437
|
-
if (n > 0 &&
|
|
438
|
-
t.push(
|
|
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
|
|
442
|
-
|
|
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
|
|
448
|
-
return
|
|
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
|
|
453
|
-
if (
|
|
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
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
return
|
|
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,
|
|
477
|
-
const
|
|
478
|
-
|
|
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,
|
|
481
|
-
e.hasAttribute(n) && (t[
|
|
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
|
|
485
|
-
|
|
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 = [],
|
|
491
|
-
for (const
|
|
492
|
-
if (
|
|
493
|
-
n.push(
|
|
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
|
-
|
|
496
|
+
i.hasAttribute(ae) && t.push(i), a(i);
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
|
-
return
|
|
499
|
+
return a(e), { parts: t, children: n };
|
|
500
500
|
}
|
|
501
501
|
function nn(e) {
|
|
502
|
-
const t = e.getAttribute(
|
|
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
|
-
...
|
|
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
|
|
514
|
-
return
|
|
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:
|
|
518
|
-
children:
|
|
519
|
-
(g) => De(g, { ...t, maxDepth:
|
|
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
|
-
...
|
|
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
|
-
...
|
|
526
|
+
...h ? { truncated: !0 } : {}
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
function gt(e) {
|
|
530
|
-
const t = [], n = (
|
|
531
|
-
for (const
|
|
532
|
-
if (
|
|
533
|
-
t.push(
|
|
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(
|
|
536
|
+
n(o);
|
|
537
537
|
}
|
|
538
538
|
};
|
|
539
539
|
return n(e), t;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
const t = e.filter((
|
|
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(),
|
|
545
|
-
|
|
546
|
-
for (const
|
|
547
|
-
|
|
548
|
-
for (const
|
|
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
|
|
551
|
-
const
|
|
552
|
-
for (const
|
|
553
|
-
const
|
|
554
|
-
|
|
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((
|
|
556
|
+
return e.filter((i) => !o.has(i));
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
const n = gt(e).map((
|
|
560
|
-
return
|
|
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
|
|
579
|
-
if (
|
|
580
|
-
const
|
|
581
|
-
for (;
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
if (
|
|
585
|
-
const
|
|
586
|
-
return d > 0 ?
|
|
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
|
|
597
|
-
|
|
598
|
-
for (const [
|
|
599
|
-
|
|
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 (
|
|
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
|
|
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:
|
|
621
|
-
c.current.key !== d && (c.current = { key: d, value:
|
|
622
|
-
const p = c.current.value,
|
|
623
|
-
|
|
624
|
-
const g = m(
|
|
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 =
|
|
626
|
+
g.current = l;
|
|
627
627
|
});
|
|
628
|
-
const
|
|
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 =
|
|
631
|
-
if (
|
|
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(
|
|
636
|
-
f(Be(
|
|
635
|
+
const w = sn(u, b, () => {
|
|
636
|
+
f(Be(u, b));
|
|
637
637
|
});
|
|
638
|
-
return ln(
|
|
639
|
-
`Sprint tool name "${
|
|
640
|
-
), f(Be(
|
|
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
|
-
}, [
|
|
644
|
-
if (!y ||
|
|
643
|
+
}, [u, i]), _(() => {
|
|
644
|
+
if (!y || u === null) return;
|
|
645
645
|
const b = new AbortController();
|
|
646
646
|
return Wt(
|
|
647
647
|
{
|
|
648
|
-
name:
|
|
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,
|
|
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
|
|
750
|
+
function la(e) {
|
|
751
751
|
const {
|
|
752
752
|
tone: t = "info",
|
|
753
753
|
label: n,
|
|
754
|
-
onDismiss:
|
|
755
|
-
agentName:
|
|
756
|
-
agentTool:
|
|
757
|
-
children:
|
|
758
|
-
...
|
|
759
|
-
} = e, d =
|
|
760
|
-
g.current =
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
const y = m(
|
|
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 =
|
|
768
|
-
const S =
|
|
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
|
-
${
|
|
777
|
+
${u.current([y.current])}` : "Dismissed. The alert is gone from the page.";
|
|
778
778
|
}, []), T = V({
|
|
779
779
|
spec: ft,
|
|
780
|
-
label:
|
|
781
|
-
enabled:
|
|
780
|
+
label: o ?? n,
|
|
781
|
+
enabled: i && b,
|
|
782
782
|
execute: w
|
|
783
|
-
}),
|
|
784
|
-
|
|
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:
|
|
794
|
+
parts: $
|
|
795
795
|
});
|
|
796
796
|
if (y.current = O, d === "agent")
|
|
797
|
-
return !b || c === "never" ? /* @__PURE__ */
|
|
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: () =>
|
|
802
|
+
onActivate: () => a?.()
|
|
803
803
|
}
|
|
804
804
|
);
|
|
805
805
|
const E = t === "danger" || t === "warning" ? "alert" : "status";
|
|
806
|
-
return /* @__PURE__ */
|
|
806
|
+
return /* @__PURE__ */ A(
|
|
807
807
|
"div",
|
|
808
808
|
{
|
|
809
|
-
...
|
|
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__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
b ? /* @__PURE__ */
|
|
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:
|
|
827
|
-
onClick: () =>
|
|
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:
|
|
956
|
-
agentName:
|
|
957
|
-
agentTool:
|
|
958
|
-
disabled:
|
|
959
|
-
type:
|
|
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
|
-
...
|
|
964
|
-
} = e, g =
|
|
965
|
-
(
|
|
966
|
-
f.current =
|
|
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 =
|
|
970
|
-
|
|
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
|
|
973
|
-
|
|
972
|
+
const P = f.current;
|
|
973
|
+
P !== null && C(ye(P));
|
|
974
974
|
});
|
|
975
|
-
const
|
|
975
|
+
const $ = l || a, O = w ?? T, E = m(p);
|
|
976
976
|
E.current = p;
|
|
977
|
-
const S = m(
|
|
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
|
|
985
|
-
if (
|
|
986
|
-
|
|
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:
|
|
998
|
+
enabled: i && !$,
|
|
999
999
|
execute: x
|
|
1000
|
-
}),
|
|
1000
|
+
}), N = R({
|
|
1001
1001
|
component: _e.name,
|
|
1002
1002
|
label: O,
|
|
1003
1003
|
tool: D,
|
|
1004
|
-
state: { tone: t, block: n, loading:
|
|
1004
|
+
state: { tone: t, block: n, loading: a, disabled: $ }
|
|
1005
1005
|
});
|
|
1006
|
-
return S.current =
|
|
1007
|
-
|
|
1006
|
+
return S.current = N, g === "agent" ? $ || u === "never" ? /* @__PURE__ */ s(U, { node: N }) : /* @__PURE__ */ s(
|
|
1007
|
+
he,
|
|
1008
1008
|
{
|
|
1009
|
-
node:
|
|
1010
|
-
type:
|
|
1009
|
+
node: N,
|
|
1010
|
+
type: r,
|
|
1011
1011
|
ref: b,
|
|
1012
1012
|
onClick: p,
|
|
1013
|
-
"aria-busy":
|
|
1013
|
+
"aria-busy": a || void 0
|
|
1014
1014
|
}
|
|
1015
|
-
) : /* @__PURE__ */
|
|
1015
|
+
) : /* @__PURE__ */ s(
|
|
1016
1016
|
"button",
|
|
1017
1017
|
{
|
|
1018
|
-
...
|
|
1019
|
-
...M(
|
|
1020
|
-
type:
|
|
1018
|
+
...h,
|
|
1019
|
+
...M(N),
|
|
1020
|
+
type: r,
|
|
1021
1021
|
ref: b,
|
|
1022
1022
|
onClick: p,
|
|
1023
|
-
disabled:
|
|
1024
|
-
"aria-busy":
|
|
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
|
|
1112
|
+
function ca(e) {
|
|
1113
1113
|
const {
|
|
1114
1114
|
label: t,
|
|
1115
1115
|
children: n,
|
|
1116
|
-
href:
|
|
1117
|
-
onClick:
|
|
1118
|
-
disabled:
|
|
1119
|
-
agentTool:
|
|
1120
|
-
agentName:
|
|
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 =
|
|
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(
|
|
1131
|
-
_(() => (
|
|
1132
|
-
|
|
1130
|
+
const T = m(R({ component: Ve.name })), C = m(!0);
|
|
1131
|
+
_(() => (C.current = !0, () => {
|
|
1132
|
+
C.current = !1;
|
|
1133
1133
|
}), []);
|
|
1134
|
-
const
|
|
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(),
|
|
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:
|
|
1141
|
-
enabled: (
|
|
1142
|
-
execute:
|
|
1143
|
-
}), E =
|
|
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:
|
|
1150
|
+
state: { href: a, disabled: y },
|
|
1151
1151
|
parts: S
|
|
1152
1152
|
});
|
|
1153
1153
|
if (T.current = v, p === "agent")
|
|
1154
|
-
return y ||
|
|
1155
|
-
|
|
1154
|
+
return y || h === "never" ? /* @__PURE__ */ s(U, { node: v }) : /* @__PURE__ */ s(
|
|
1155
|
+
he,
|
|
1156
1156
|
{
|
|
1157
1157
|
node: v,
|
|
1158
|
-
as:
|
|
1159
|
-
href:
|
|
1158
|
+
as: u ? "a" : "button",
|
|
1159
|
+
href: a,
|
|
1160
1160
|
ref: b,
|
|
1161
|
-
onClick:
|
|
1161
|
+
onClick: o
|
|
1162
1162
|
}
|
|
1163
1163
|
);
|
|
1164
|
-
const k = /* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
n === void 0 ? null : /* @__PURE__ */
|
|
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
|
|
1168
|
+
return u ? /* @__PURE__ */ s(
|
|
1169
1169
|
"a",
|
|
1170
1170
|
{
|
|
1171
1171
|
...c,
|
|
1172
1172
|
...M(v),
|
|
1173
|
-
href:
|
|
1173
|
+
href: a,
|
|
1174
1174
|
"aria-label": t,
|
|
1175
|
-
onClick:
|
|
1175
|
+
onClick: o,
|
|
1176
1176
|
ref: b,
|
|
1177
1177
|
children: k
|
|
1178
1178
|
}
|
|
1179
|
-
) : /* @__PURE__ */
|
|
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:
|
|
1187
|
-
onClick:
|
|
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
|
-
},
|
|
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
|
|
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
|
|
1331
|
+
function da(e) {
|
|
1332
1332
|
const {
|
|
1333
1333
|
label: t,
|
|
1334
1334
|
checked: n,
|
|
1335
|
-
onChange:
|
|
1336
|
-
hint:
|
|
1337
|
-
error:
|
|
1338
|
-
name:
|
|
1339
|
-
disabled:
|
|
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
|
-
...
|
|
1344
|
-
} = e, g =
|
|
1345
|
-
w.current =
|
|
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
|
|
1349
|
-
|
|
1350
|
-
const
|
|
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
|
|
1359
|
-
if (!
|
|
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 ? `${
|
|
1364
|
-
${
|
|
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 && !
|
|
1368
|
+
enabled: p && !r,
|
|
1369
1369
|
execute: E
|
|
1370
|
-
}), v =
|
|
1371
|
-
component:
|
|
1370
|
+
}), v = R({
|
|
1371
|
+
component: He.name,
|
|
1372
1372
|
label: t,
|
|
1373
1373
|
tool: S,
|
|
1374
1374
|
state: {
|
|
1375
1375
|
checked: n,
|
|
1376
|
-
disabled:
|
|
1376
|
+
disabled: r,
|
|
1377
1377
|
required: d,
|
|
1378
|
-
invalid:
|
|
1378
|
+
invalid: i !== void 0
|
|
1379
1379
|
},
|
|
1380
|
-
parts:
|
|
1380
|
+
parts: hn(i, o)
|
|
1381
1381
|
});
|
|
1382
|
-
if (
|
|
1383
|
-
return
|
|
1384
|
-
|
|
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: () =>
|
|
1390
|
+
onClick: () => a(!n)
|
|
1391
1391
|
}
|
|
1392
1392
|
);
|
|
1393
|
-
const k =
|
|
1394
|
-
return /* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
1396
|
-
/* @__PURE__ */
|
|
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:
|
|
1407
|
-
disabled:
|
|
1406
|
+
name: l,
|
|
1407
|
+
disabled: r,
|
|
1408
1408
|
required: d,
|
|
1409
|
-
"aria-invalid":
|
|
1409
|
+
"aria-invalid": i !== void 0 || void 0,
|
|
1410
1410
|
"aria-describedby": k,
|
|
1411
|
-
onChange: (x) =>
|
|
1411
|
+
onChange: (x) => a(x.currentTarget.checked)
|
|
1412
1412
|
}
|
|
1413
1413
|
),
|
|
1414
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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
|
|
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
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
|
|
1442
|
-
const
|
|
1443
|
-
t.push({ kind:
|
|
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
|
|
1519
|
-
const { code: t, caption: n, language:
|
|
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 (!
|
|
1522
|
-
const
|
|
1523
|
-
return () => clearTimeout(
|
|
1524
|
-
}, [
|
|
1525
|
-
const c = n ??
|
|
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:
|
|
1529
|
+
language: a,
|
|
1530
1530
|
lines: String(t.split(`
|
|
1531
1531
|
`).length),
|
|
1532
|
-
copied:
|
|
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 (
|
|
1539
|
+
if (l === "agent") return /* @__PURE__ */ s(U, { node: h });
|
|
1540
1540
|
const g = () => {
|
|
1541
|
-
const
|
|
1542
|
-
|
|
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__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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":
|
|
1565
|
-
children:
|
|
1564
|
+
"data-sprint-token": u.kind === "plain" ? void 0 : u.kind,
|
|
1565
|
+
children: u.text
|
|
1566
1566
|
},
|
|
1567
|
-
`${y}-${
|
|
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 =
|
|
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
|
|
1637
|
-
const { label: t, items: n, emptyLabel:
|
|
1638
|
-
const
|
|
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
|
-
...
|
|
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:
|
|
1648
|
-
parts:
|
|
1647
|
+
state: { items: String(n.length), empty: l },
|
|
1648
|
+
parts: r
|
|
1649
1649
|
});
|
|
1650
|
-
return
|
|
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__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ s("dt", { children: c.term }),
|
|
1659
|
+
/* @__PURE__ */ s("dd", { children: c.description })
|
|
1660
1660
|
]
|
|
1661
1661
|
},
|
|
1662
|
-
`${p}-${String(
|
|
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
|
|
1762
|
+
function pa(e) {
|
|
1763
1763
|
const {
|
|
1764
1764
|
label: t,
|
|
1765
1765
|
open: n,
|
|
1766
|
-
onClose:
|
|
1767
|
-
headingLevel:
|
|
1768
|
-
owner:
|
|
1769
|
-
agentName:
|
|
1770
|
-
agentTool:
|
|
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,
|
|
1775
|
-
b.current =
|
|
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
|
|
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
|
-
}, []),
|
|
1795
|
+
}, []), $ = V({
|
|
1796
1796
|
spec: yt,
|
|
1797
|
-
label:
|
|
1798
|
-
enabled:
|
|
1799
|
-
execute:
|
|
1797
|
+
label: l ?? t,
|
|
1798
|
+
enabled: r && n,
|
|
1799
|
+
execute: C
|
|
1800
1800
|
}), O = ee(
|
|
1801
|
-
() => ({ path: [...
|
|
1802
|
-
[
|
|
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:
|
|
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
|
-
|
|
1816
|
+
...$ === void 0 ? {} : { tool: $ }
|
|
1817
1817
|
}
|
|
1818
1818
|
]
|
|
1819
1819
|
});
|
|
1820
|
-
if (
|
|
1821
|
-
return /* @__PURE__ */
|
|
1820
|
+
if (h === "agent")
|
|
1821
|
+
return /* @__PURE__ */ s(
|
|
1822
1822
|
we,
|
|
1823
1823
|
{
|
|
1824
1824
|
node: E,
|
|
1825
1825
|
isActionable: () => g !== "never",
|
|
1826
|
-
onActivate: () =>
|
|
1827
|
-
children: /* @__PURE__ */
|
|
1826
|
+
onActivate: () => a(),
|
|
1827
|
+
children: /* @__PURE__ */ s(me, { value: O, children: d })
|
|
1828
1828
|
}
|
|
1829
1829
|
);
|
|
1830
|
-
const S =
|
|
1831
|
-
return /* @__PURE__ */
|
|
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(),
|
|
1839
|
+
v.preventDefault(), a();
|
|
1840
1840
|
},
|
|
1841
1841
|
children: [
|
|
1842
|
-
/* @__PURE__ */
|
|
1843
|
-
/* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1850
|
+
...$ === void 0 ? {} : { tool: $ }
|
|
1851
1851
|
}),
|
|
1852
1852
|
type: "button",
|
|
1853
1853
|
"aria-label": "Close",
|
|
1854
1854
|
ref: f,
|
|
1855
|
-
onClick: () =>
|
|
1855
|
+
onClick: () => a(),
|
|
1856
1856
|
children: "×"
|
|
1857
1857
|
}
|
|
1858
1858
|
)
|
|
1859
1859
|
] }),
|
|
1860
|
-
/* @__PURE__ */
|
|
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
|
|
1908
|
-
const { level: t = 2, children: n, ...
|
|
1907
|
+
function ga(e) {
|
|
1908
|
+
const { level: t = 2, children: n, ...a } = e, o = I(), i = R({
|
|
1909
1909
|
component: yn.name,
|
|
1910
|
-
label:
|
|
1910
|
+
label: H(n),
|
|
1911
1911
|
state: { level: String(t) }
|
|
1912
1912
|
});
|
|
1913
|
-
if (
|
|
1914
|
-
const
|
|
1915
|
-
return /* @__PURE__ */ l
|
|
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
|
-
},
|
|
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
|
|
2140
|
+
function fa(e) {
|
|
2007
2141
|
const {
|
|
2008
2142
|
href: t,
|
|
2009
2143
|
active: n = !1,
|
|
2010
|
-
external:
|
|
2011
|
-
agentTool:
|
|
2012
|
-
agentName:
|
|
2013
|
-
children:
|
|
2014
|
-
ref:
|
|
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 =
|
|
2018
|
-
(
|
|
2019
|
-
g.current =
|
|
2020
|
-
},
|
|
2021
|
-
[
|
|
2022
|
-
), y =
|
|
2023
|
-
const
|
|
2024
|
-
return
|
|
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:
|
|
2162
|
+
enabled: o,
|
|
2029
2163
|
execute: f
|
|
2030
|
-
}), w =
|
|
2031
|
-
component:
|
|
2032
|
-
label:
|
|
2164
|
+
}), w = R({
|
|
2165
|
+
component: Tn.name,
|
|
2166
|
+
label: H(l),
|
|
2033
2167
|
tool: b,
|
|
2034
|
-
state: { href: t, active: n, external:
|
|
2035
|
-
}), T =
|
|
2036
|
-
return p === "agent" ?
|
|
2037
|
-
|
|
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:
|
|
2176
|
+
ref: u,
|
|
2043
2177
|
onClick: d,
|
|
2044
2178
|
target: T.target,
|
|
2045
2179
|
rel: T.rel
|
|
2046
2180
|
}
|
|
2047
|
-
) : /* @__PURE__ */
|
|
2181
|
+
) : /* @__PURE__ */ s(
|
|
2048
2182
|
"a",
|
|
2049
2183
|
{
|
|
2050
2184
|
...c,
|
|
2051
2185
|
...M(w),
|
|
2052
2186
|
href: t,
|
|
2053
|
-
ref:
|
|
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:
|
|
2192
|
+
children: l
|
|
2059
2193
|
}
|
|
2060
2194
|
);
|
|
2061
2195
|
}
|
|
2062
|
-
const
|
|
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
|
|
2140
|
-
const { label: t, items: n, ordered:
|
|
2141
|
-
const
|
|
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
|
-
...
|
|
2279
|
+
...u === void 0 ? {} : { label: u }
|
|
2146
2280
|
};
|
|
2147
|
-
}), c =
|
|
2148
|
-
component:
|
|
2281
|
+
}), c = R({
|
|
2282
|
+
component: xn.name,
|
|
2149
2283
|
label: t,
|
|
2150
|
-
state: { items: String(n.length), ordered:
|
|
2284
|
+
state: { items: String(n.length), ordered: a, empty: r },
|
|
2151
2285
|
parts: d
|
|
2152
2286
|
});
|
|
2153
|
-
return
|
|
2154
|
-
|
|
2287
|
+
return l === "agent" ? /* @__PURE__ */ s(U, { node: c }) : /* @__PURE__ */ s(
|
|
2288
|
+
a ? "ol" : "ul",
|
|
2155
2289
|
{
|
|
2156
|
-
...
|
|
2290
|
+
...i,
|
|
2157
2291
|
...M(c),
|
|
2158
2292
|
role: "list",
|
|
2159
2293
|
"aria-label": t,
|
|
2160
|
-
children:
|
|
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__ */
|
|
2301
|
+
children: /* @__PURE__ */ s("span", { children: h })
|
|
2168
2302
|
},
|
|
2169
|
-
`${g}-${String(
|
|
2303
|
+
`${g}-${String(H(h))}`
|
|
2170
2304
|
))
|
|
2171
2305
|
}
|
|
2172
2306
|
);
|
|
2173
2307
|
}
|
|
2174
|
-
const
|
|
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
|
|
2226
|
-
const { entries: t, ...n } = e,
|
|
2359
|
+
function va(e) {
|
|
2360
|
+
const { entries: t, ...n } = e, a = I();
|
|
2227
2361
|
if (t.length === 0) return null;
|
|
2228
|
-
const
|
|
2229
|
-
component:
|
|
2230
|
-
label:
|
|
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
|
|
2234
|
-
|
|
2235
|
-
/* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
|
|
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__ */
|
|
2374
|
+
/* @__PURE__ */ s("span", { children: l.detail })
|
|
2241
2375
|
] })
|
|
2242
|
-
] }, `${
|
|
2376
|
+
] }, `${l.term}-${r}`)) });
|
|
2243
2377
|
}
|
|
2244
|
-
const
|
|
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
|
|
2296
|
-
const { label: t, children: n, ...
|
|
2297
|
-
return
|
|
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
|
|
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
|
|
2341
|
-
const { label: t, children: n, ...
|
|
2342
|
-
return
|
|
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__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
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
|
|
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
|
|
2404
|
-
const { label: t, tags: n, actions:
|
|
2405
|
-
component:
|
|
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 (
|
|
2410
|
-
return /* @__PURE__ */
|
|
2543
|
+
if (l === "agent")
|
|
2544
|
+
return /* @__PURE__ */ A(U, { node: r, children: [
|
|
2411
2545
|
n,
|
|
2412
|
-
|
|
2413
|
-
|
|
2546
|
+
a,
|
|
2547
|
+
o
|
|
2414
2548
|
] });
|
|
2415
|
-
const d = Ye.toArray(
|
|
2416
|
-
return /* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2419
|
-
/* @__PURE__ */
|
|
2420
|
-
n === void 0 ? null : /* @__PURE__ */
|
|
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
|
-
|
|
2556
|
+
a === void 0 ? null : /* @__PURE__ */ s("span", { children: a })
|
|
2423
2557
|
] }),
|
|
2424
|
-
d ? /* @__PURE__ */
|
|
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
|
|
2658
|
+
function Ta(e) {
|
|
2525
2659
|
const {
|
|
2526
2660
|
label: t,
|
|
2527
2661
|
headingLevel: n,
|
|
2528
|
-
actions:
|
|
2529
|
-
flush:
|
|
2530
|
-
emptyLabel:
|
|
2531
|
-
children:
|
|
2532
|
-
...
|
|
2533
|
-
} = e, d =
|
|
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:
|
|
2671
|
+
state: { flush: o, empty: c }
|
|
2538
2672
|
});
|
|
2539
2673
|
if (d === "agent")
|
|
2540
|
-
return /* @__PURE__ */
|
|
2541
|
-
|
|
2542
|
-
|
|
2674
|
+
return /* @__PURE__ */ A(U, { node: p, children: [
|
|
2675
|
+
a,
|
|
2676
|
+
l
|
|
2543
2677
|
] });
|
|
2544
|
-
const
|
|
2545
|
-
return /* @__PURE__ */
|
|
2546
|
-
/* @__PURE__ */
|
|
2547
|
-
/* @__PURE__ */
|
|
2548
|
-
|
|
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__ */
|
|
2684
|
+
/* @__PURE__ */ s("div", { children: c ? /* @__PURE__ */ s("span", { children: i }) : l })
|
|
2551
2685
|
] });
|
|
2552
2686
|
}
|
|
2553
|
-
const
|
|
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 = "••••••••••••",
|
|
2613
|
-
function
|
|
2614
|
-
const { label: t, value: n, hint:
|
|
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),
|
|
2751
|
+
const f = setTimeout(() => p(!1), $n);
|
|
2618
2752
|
return () => clearTimeout(f);
|
|
2619
2753
|
}, [c]);
|
|
2620
|
-
const
|
|
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 !== "",
|
|
2627
|
-
component:
|
|
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:
|
|
2630
|
-
parts:
|
|
2763
|
+
state: { filled: g, revealed: r },
|
|
2764
|
+
parts: u
|
|
2631
2765
|
});
|
|
2632
|
-
return
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2635
|
-
/* @__PURE__ */
|
|
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":
|
|
2640
|
-
children:
|
|
2773
|
+
"aria-label": r ? void 0 : "Hidden secret",
|
|
2774
|
+
children: r ? n : Rn
|
|
2641
2775
|
}
|
|
2642
2776
|
),
|
|
2643
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ s(
|
|
2644
2778
|
"button",
|
|
2645
2779
|
{
|
|
2646
2780
|
...L({ part: "reveal", state: {} }),
|
|
2647
2781
|
type: "button",
|
|
2648
|
-
"aria-pressed":
|
|
2782
|
+
"aria-pressed": r,
|
|
2649
2783
|
onClick: () => d((f) => !f),
|
|
2650
|
-
children:
|
|
2784
|
+
children: r ? "Hide" : "Reveal"
|
|
2651
2785
|
}
|
|
2652
2786
|
),
|
|
2653
|
-
/* @__PURE__ */
|
|
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:
|
|
2795
|
+
onClick: h,
|
|
2662
2796
|
children: c ? "Copied" : "Copy"
|
|
2663
2797
|
}
|
|
2664
2798
|
)
|
|
2665
2799
|
] }),
|
|
2666
|
-
|
|
2800
|
+
a === void 0 ? null : /* @__PURE__ */ s("p", { ...L({ part: "hint", state: {} }), children: a })
|
|
2667
2801
|
] });
|
|
2668
2802
|
}
|
|
2669
|
-
const
|
|
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
|
-
},
|
|
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:
|
|
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
|
|
2786
|
-
const t =
|
|
2919
|
+
function On(e) {
|
|
2920
|
+
const t = ie.inputSchema.properties.option;
|
|
2787
2921
|
return {
|
|
2788
|
-
...
|
|
2922
|
+
...ie.inputSchema,
|
|
2789
2923
|
properties: {
|
|
2790
|
-
...
|
|
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
|
|
2929
|
+
function Aa(e) {
|
|
2796
2930
|
const {
|
|
2797
2931
|
label: t,
|
|
2798
2932
|
options: n,
|
|
2799
|
-
value:
|
|
2800
|
-
onChange:
|
|
2801
|
-
disabled:
|
|
2802
|
-
agentName:
|
|
2803
|
-
agentTool:
|
|
2933
|
+
value: a,
|
|
2934
|
+
onChange: o,
|
|
2935
|
+
disabled: i = !1,
|
|
2936
|
+
agentName: l,
|
|
2937
|
+
agentTool: r = !0,
|
|
2804
2938
|
...d
|
|
2805
|
-
} = e, c =
|
|
2806
|
-
|
|
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(
|
|
2810
|
-
f.current =
|
|
2811
|
-
const b = m(
|
|
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(() =>
|
|
2822
|
-
}, []),
|
|
2955
|
+
z(() => u.current(k));
|
|
2956
|
+
}, []), C = B(
|
|
2823
2957
|
async (k) => {
|
|
2824
|
-
const x = typeof k.option == "string" ? k.option : "", D = y.current,
|
|
2825
|
-
return
|
|
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
|
-
),
|
|
2830
|
-
spec:
|
|
2831
|
-
label:
|
|
2832
|
-
inputSchema:
|
|
2833
|
-
enabled:
|
|
2834
|
-
execute:
|
|
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 ===
|
|
2840
|
-
...
|
|
2973
|
+
...k.value === a ? { checked: !0 } : {},
|
|
2974
|
+
...i ? { disabled: !0 } : {}
|
|
2841
2975
|
}
|
|
2842
|
-
})), S =
|
|
2843
|
-
component:
|
|
2976
|
+
})), S = R({
|
|
2977
|
+
component: Fe.name,
|
|
2844
2978
|
label: t,
|
|
2845
2979
|
tool: O,
|
|
2846
|
-
state: { value:
|
|
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) ||
|
|
2852
|
-
const D = n.findIndex((
|
|
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" ?
|
|
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__ */
|
|
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 ===
|
|
2874
|
-
return /* @__PURE__ */
|
|
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:
|
|
2881
|
-
disabled:
|
|
2882
|
-
ref: (
|
|
2883
|
-
|
|
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: () =>
|
|
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
|
|
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:
|
|
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,
|
|
3062
|
-
|
|
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
|
|
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
|
|
3072
|
-
const t =
|
|
3205
|
+
function En(e) {
|
|
3206
|
+
const t = re.inputSchema.properties.option;
|
|
3073
3207
|
return {
|
|
3074
|
-
...
|
|
3208
|
+
...re.inputSchema,
|
|
3075
3209
|
properties: {
|
|
3076
|
-
...
|
|
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
|
|
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
|
|
3218
|
+
function Ca(e) {
|
|
3085
3219
|
const {
|
|
3086
3220
|
label: t,
|
|
3087
3221
|
options: n,
|
|
3088
|
-
value:
|
|
3089
|
-
onChange:
|
|
3090
|
-
placeholder:
|
|
3091
|
-
hint:
|
|
3092
|
-
error:
|
|
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:
|
|
3230
|
+
agentName: h,
|
|
3097
3231
|
agentTool: g = !0,
|
|
3098
|
-
...
|
|
3099
|
-
} = e, y =
|
|
3100
|
-
|
|
3101
|
-
const
|
|
3102
|
-
|
|
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(
|
|
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
|
-
|
|
3246
|
+
Dn(X, W);
|
|
3113
3247
|
return;
|
|
3114
3248
|
}
|
|
3115
|
-
z(() =>
|
|
3249
|
+
z(() => C.current(W));
|
|
3116
3250
|
}, []), k = B(
|
|
3117
3251
|
async (W) => {
|
|
3118
|
-
const X = typeof W.option == "string" ? W.option : "",
|
|
3119
|
-
return Me === void 0 ? `No option named "${X}". This dropdown offers: ${
|
|
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(() =>
|
|
3124
|
-
spec:
|
|
3125
|
-
label:
|
|
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
|
-
}),
|
|
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 ===
|
|
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
|
-
...
|
|
3142
|
-
empty:
|
|
3275
|
+
...N === void 0 ? {} : { value: a },
|
|
3276
|
+
empty: N === void 0,
|
|
3143
3277
|
disabled: c,
|
|
3144
3278
|
required: p,
|
|
3145
|
-
invalid:
|
|
3279
|
+
invalid: r !== void 0
|
|
3146
3280
|
},
|
|
3147
|
-
parts: [...
|
|
3281
|
+
parts: [...P, ...Mn(r, l)]
|
|
3148
3282
|
});
|
|
3149
3283
|
if (E.current = j, y === "agent")
|
|
3150
|
-
return c || f === "never" ? /* @__PURE__ */
|
|
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
|
|
3157
|
-
|
|
3290
|
+
const oe = n[X];
|
|
3291
|
+
oe !== void 0 && v(oe.value);
|
|
3158
3292
|
}
|
|
3159
3293
|
}
|
|
3160
3294
|
);
|
|
3161
|
-
const
|
|
3162
|
-
return /* @__PURE__ */
|
|
3163
|
-
/* @__PURE__ */
|
|
3164
|
-
/* @__PURE__ */
|
|
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:
|
|
3306
|
+
value: N === void 0 ? "" : a,
|
|
3173
3307
|
name: d,
|
|
3174
3308
|
disabled: c,
|
|
3175
3309
|
required: p,
|
|
3176
|
-
"aria-invalid":
|
|
3177
|
-
"aria-describedby":
|
|
3178
|
-
onChange: (W) =>
|
|
3310
|
+
"aria-invalid": r !== void 0 || void 0,
|
|
3311
|
+
"aria-describedby": J,
|
|
3312
|
+
onChange: (W) => o(W.currentTarget.value),
|
|
3179
3313
|
children: [
|
|
3180
|
-
|
|
3181
|
-
n.map((W, X) => /* @__PURE__ */
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
3404
|
+
function Sa(e) {
|
|
3271
3405
|
const {
|
|
3272
3406
|
side: t,
|
|
3273
3407
|
bar: n,
|
|
3274
|
-
sideLabel:
|
|
3275
|
-
skipLabel:
|
|
3276
|
-
menuLabel:
|
|
3277
|
-
closeLabel:
|
|
3278
|
-
children:
|
|
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 =
|
|
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 &&
|
|
3283
|
-
}, []), f =
|
|
3284
|
-
component:
|
|
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__ */
|
|
3422
|
+
return c === "agent" ? /* @__PURE__ */ A(Re, { children: [
|
|
3289
3423
|
n,
|
|
3290
3424
|
t,
|
|
3291
|
-
|
|
3292
|
-
] }) : /* @__PURE__ */
|
|
3293
|
-
/* @__PURE__ */
|
|
3294
|
-
/* @__PURE__ */
|
|
3295
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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: () =>
|
|
3304
|
-
children: p ?
|
|
3437
|
+
onClick: () => h(!p),
|
|
3438
|
+
children: p ? l : i
|
|
3305
3439
|
}
|
|
3306
3440
|
) })
|
|
3307
3441
|
] }),
|
|
3308
|
-
/* @__PURE__ */
|
|
3442
|
+
/* @__PURE__ */ s("div", { id: g, onClick: y, children: t })
|
|
3309
3443
|
] }),
|
|
3310
|
-
/* @__PURE__ */
|
|
3444
|
+
/* @__PURE__ */ s("main", { ref: u, tabIndex: -1, children: r })
|
|
3311
3445
|
] });
|
|
3312
3446
|
}
|
|
3313
|
-
const
|
|
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
|
|
3554
|
+
function Pa(e) {
|
|
3421
3555
|
const {
|
|
3422
3556
|
direction: t = "column",
|
|
3423
3557
|
gap: n = "normal",
|
|
3424
|
-
align:
|
|
3425
|
-
justify:
|
|
3426
|
-
wrap:
|
|
3427
|
-
collapse:
|
|
3428
|
-
min:
|
|
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,
|
|
3433
|
-
component:
|
|
3434
|
-
state: { direction: t, gap: n, align:
|
|
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 (
|
|
3437
|
-
const
|
|
3438
|
-
return /* @__PURE__ */
|
|
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
|
|
3663
|
+
function Na(e) {
|
|
3530
3664
|
const {
|
|
3531
3665
|
label: t,
|
|
3532
3666
|
on: n,
|
|
3533
|
-
onChange:
|
|
3534
|
-
disabled:
|
|
3535
|
-
agentName:
|
|
3536
|
-
agentTool:
|
|
3537
|
-
ref:
|
|
3667
|
+
onChange: a,
|
|
3668
|
+
disabled: o = !1,
|
|
3669
|
+
agentName: i,
|
|
3670
|
+
agentTool: l = !0,
|
|
3671
|
+
ref: r,
|
|
3538
3672
|
...d
|
|
3539
|
-
} = e, c =
|
|
3673
|
+
} = e, c = I(), p = G(), h = F(), g = m(null), u = B(
|
|
3540
3674
|
(E) => {
|
|
3541
|
-
g.current = E, typeof
|
|
3675
|
+
g.current = E, typeof r == "function" ? r(E) : r != null && (r.current = E);
|
|
3542
3676
|
},
|
|
3543
|
-
[
|
|
3544
|
-
), y = m(
|
|
3545
|
-
y.current =
|
|
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(
|
|
3549
|
-
b.current =
|
|
3550
|
-
const w = m(
|
|
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
|
|
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
|
-
}, []),
|
|
3699
|
+
}, []), $ = V({
|
|
3566
3700
|
spec: xt,
|
|
3567
|
-
label:
|
|
3568
|
-
enabled:
|
|
3569
|
-
execute:
|
|
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:
|
|
3574
|
-
state: { on: n, disabled:
|
|
3707
|
+
tool: $,
|
|
3708
|
+
state: { on: n, disabled: o }
|
|
3575
3709
|
});
|
|
3576
|
-
return w.current = O, c === "agent" ?
|
|
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:
|
|
3585
|
-
ref:
|
|
3586
|
-
onClick: () =>
|
|
3718
|
+
disabled: o,
|
|
3719
|
+
ref: u,
|
|
3720
|
+
onClick: () => a(!n),
|
|
3587
3721
|
children: [
|
|
3588
|
-
/* @__PURE__ */
|
|
3722
|
+
/* @__PURE__ */ s(
|
|
3589
3723
|
"span",
|
|
3590
3724
|
{
|
|
3591
3725
|
...L({ part: "track", state: {} }),
|
|
3592
3726
|
"aria-hidden": "true",
|
|
3593
|
-
children: /* @__PURE__ */
|
|
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
|
|
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
|
|
3836
|
+
function Wn(e, t) {
|
|
3703
3837
|
return t.flatMap(
|
|
3704
|
-
(n,
|
|
3705
|
-
const
|
|
3838
|
+
(n, a) => e.map((o) => {
|
|
3839
|
+
const i = H(n.cells[o.key]);
|
|
3706
3840
|
return {
|
|
3707
3841
|
part: "cell",
|
|
3708
|
-
state: At(
|
|
3709
|
-
...
|
|
3842
|
+
state: At(o, Le(n, a)),
|
|
3843
|
+
...i === void 0 ? {} : { label: i }
|
|
3710
3844
|
};
|
|
3711
3845
|
})
|
|
3712
3846
|
);
|
|
3713
3847
|
}
|
|
3714
|
-
function
|
|
3715
|
-
const { label: t, columns: n, rows:
|
|
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(
|
|
3721
|
-
empty:
|
|
3854
|
+
rows: String(a.length),
|
|
3855
|
+
empty: r
|
|
3722
3856
|
},
|
|
3723
|
-
parts:
|
|
3857
|
+
parts: Wn(n, a)
|
|
3724
3858
|
});
|
|
3725
|
-
return
|
|
3726
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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(
|
|
3877
|
+
state: At(h, Le(c, p))
|
|
3744
3878
|
}),
|
|
3745
3879
|
children: [
|
|
3746
|
-
/* @__PURE__ */
|
|
3747
|
-
/* @__PURE__ */
|
|
3880
|
+
/* @__PURE__ */ s("span", { "aria-hidden": "true", children: h.header }),
|
|
3881
|
+
/* @__PURE__ */ s("div", { children: c.cells[h.key] })
|
|
3748
3882
|
]
|
|
3749
3883
|
},
|
|
3750
|
-
|
|
3751
|
-
)) },
|
|
3884
|
+
h.key
|
|
3885
|
+
)) }, Le(c, p))) })
|
|
3752
3886
|
] });
|
|
3753
3887
|
}
|
|
3754
|
-
const
|
|
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
|
|
3812
|
-
const { tone: t = "neutral", filled: n = !1, children:
|
|
3813
|
-
component:
|
|
3814
|
-
label:
|
|
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
|
|
3951
|
+
return i === "agent" ? /* @__PURE__ */ s(U, { node: l }) : /* @__PURE__ */ s("span", { ...o, ...M(l), children: a });
|
|
3818
3952
|
}
|
|
3819
|
-
const
|
|
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
|
|
3886
|
-
const { tone: t = "default", size: n = "normal", as:
|
|
3887
|
-
component:
|
|
3888
|
-
label:
|
|
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
|
|
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
|
|
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
|
|
4169
|
+
function Oa(e) {
|
|
4036
4170
|
const {
|
|
4037
4171
|
label: t,
|
|
4038
4172
|
value: n,
|
|
4039
|
-
onChange:
|
|
4040
|
-
rows:
|
|
4041
|
-
placeholder:
|
|
4042
|
-
hint:
|
|
4043
|
-
error:
|
|
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:
|
|
4181
|
+
agentName: h,
|
|
4048
4182
|
agentTool: g = !0,
|
|
4049
|
-
...
|
|
4050
|
-
} = e, y =
|
|
4051
|
-
|
|
4052
|
-
const
|
|
4053
|
-
|
|
4054
|
-
const O = m(
|
|
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
|
|
4060
|
-
if (typeof
|
|
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
|
|
4063
|
-
return
|
|
4064
|
-
${
|
|
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:
|
|
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:
|
|
4213
|
+
invalid: r !== void 0
|
|
4080
4214
|
},
|
|
4081
|
-
parts:
|
|
4215
|
+
parts: _n(r, l)
|
|
4082
4216
|
});
|
|
4083
4217
|
if (O.current = k, y === "agent")
|
|
4084
|
-
return c || f === "never" ? /* @__PURE__ */
|
|
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:
|
|
4224
|
+
onValueChange: a,
|
|
4091
4225
|
ref: (D) => {
|
|
4092
4226
|
T.current = D;
|
|
4093
4227
|
}
|
|
4094
4228
|
}
|
|
4095
4229
|
);
|
|
4096
|
-
const x =
|
|
4097
|
-
return /* @__PURE__ */
|
|
4098
|
-
/* @__PURE__ */
|
|
4099
|
-
/* @__PURE__ */
|
|
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:
|
|
4241
|
+
rows: o,
|
|
4108
4242
|
value: n,
|
|
4109
|
-
placeholder:
|
|
4243
|
+
placeholder: i,
|
|
4110
4244
|
name: d,
|
|
4111
4245
|
disabled: c,
|
|
4112
4246
|
required: p,
|
|
4113
|
-
"aria-invalid":
|
|
4247
|
+
"aria-invalid": r !== void 0 || void 0,
|
|
4114
4248
|
"aria-describedby": x,
|
|
4115
|
-
onChange: (D) =>
|
|
4249
|
+
onChange: (D) => a(D.currentTarget.value)
|
|
4116
4250
|
}
|
|
4117
4251
|
),
|
|
4118
|
-
|
|
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
|
|
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
|
|
4417
|
+
function Da(e) {
|
|
4284
4418
|
const {
|
|
4285
4419
|
label: t,
|
|
4286
4420
|
value: n,
|
|
4287
|
-
onChange:
|
|
4288
|
-
type:
|
|
4289
|
-
placeholder:
|
|
4290
|
-
hint:
|
|
4291
|
-
error:
|
|
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:
|
|
4429
|
+
required: h = !1,
|
|
4296
4430
|
agentName: g,
|
|
4297
|
-
agentTool:
|
|
4431
|
+
agentTool: u = !0,
|
|
4298
4432
|
...y
|
|
4299
|
-
} = e, f =
|
|
4300
|
-
|
|
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(
|
|
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 =
|
|
4308
|
-
const j =
|
|
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
|
|
4312
|
-
return
|
|
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:
|
|
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:
|
|
4328
|
-
invalid:
|
|
4461
|
+
required: h,
|
|
4462
|
+
invalid: r !== void 0
|
|
4329
4463
|
},
|
|
4330
|
-
parts:
|
|
4464
|
+
parts: Vn(r, l)
|
|
4331
4465
|
});
|
|
4332
4466
|
if (E.current = D, f === "agent")
|
|
4333
|
-
return p || b === "never" ? /* @__PURE__ */
|
|
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:
|
|
4340
|
-
ref: (
|
|
4341
|
-
|
|
4473
|
+
onValueChange: a,
|
|
4474
|
+
ref: (P) => {
|
|
4475
|
+
C.current = P;
|
|
4342
4476
|
}
|
|
4343
4477
|
}
|
|
4344
4478
|
);
|
|
4345
|
-
const
|
|
4346
|
-
return /* @__PURE__ */
|
|
4347
|
-
/* @__PURE__ */
|
|
4348
|
-
/* @__PURE__ */
|
|
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: (
|
|
4354
|
-
|
|
4487
|
+
ref: (P) => {
|
|
4488
|
+
C.current = P;
|
|
4355
4489
|
},
|
|
4356
|
-
type:
|
|
4490
|
+
type: o,
|
|
4357
4491
|
value: n,
|
|
4358
|
-
placeholder:
|
|
4492
|
+
placeholder: i,
|
|
4359
4493
|
name: d,
|
|
4360
4494
|
autoComplete: c,
|
|
4361
4495
|
disabled: p,
|
|
4362
|
-
required:
|
|
4363
|
-
"aria-invalid":
|
|
4364
|
-
"aria-describedby":
|
|
4365
|
-
onChange: (
|
|
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
|
-
|
|
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
|
|
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
|
|
4380
|
-
return t.set(
|
|
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
|
|
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
|
-
(
|
|
4520
|
+
(a) => !t.has(a)
|
|
4387
4521
|
);
|
|
4388
4522
|
return Fn([
|
|
4389
|
-
...
|
|
4390
|
-
...n.map((
|
|
4523
|
+
...on(e),
|
|
4524
|
+
...n.map((a) => De(a)).filter((a) => a !== null)
|
|
4391
4525
|
]);
|
|
4392
4526
|
}
|
|
4393
|
-
const
|
|
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
|
-
},
|
|
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
|
|
4423
|
-
const t =
|
|
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:
|
|
4426
|
-
const
|
|
4427
|
-
`)[0]?.replace(/^-\s*/, ""),
|
|
4428
|
-
return `- \`${
|
|
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
|
|
4434
|
-
const
|
|
4435
|
-
if (
|
|
4436
|
-
return `No region named "${String(t)}". Available regions: ${
|
|
4437
|
-
const
|
|
4438
|
-
return
|
|
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 ${
|
|
4574
|
+
(page ${r} of ${l.length})`;
|
|
4441
4575
|
}
|
|
4442
|
-
const
|
|
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
|
|
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
|
|
4466
|
-
const { enabled: t, format: n, view:
|
|
4599
|
+
function Jn(e) {
|
|
4600
|
+
const { enabled: t, format: n, view: a, setView: o } = e;
|
|
4467
4601
|
V({
|
|
4468
|
-
spec:
|
|
4602
|
+
spec: Gn,
|
|
4469
4603
|
label: "page regions",
|
|
4470
4604
|
enabled: t,
|
|
4471
|
-
execute: () =>
|
|
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:
|
|
4607
|
+
spec: Kn,
|
|
4474
4608
|
label: "region",
|
|
4475
4609
|
enabled: t,
|
|
4476
|
-
execute: (
|
|
4610
|
+
execute: (i) => a === "agent" ? Qn(i.region, i.page) : Xn(n, i.region, i.page)
|
|
4477
4611
|
}), V({
|
|
4478
|
-
spec:
|
|
4612
|
+
spec: Yn,
|
|
4479
4613
|
label: "page view",
|
|
4480
4614
|
enabled: t,
|
|
4481
|
-
execute: async (
|
|
4482
|
-
const
|
|
4483
|
-
return z(() =>
|
|
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
|
-
${
|
|
4619
|
+
${Pe(Nt(), te - Ee)}` : "Page is now in human view.";
|
|
4486
4620
|
}
|
|
4487
4621
|
});
|
|
4488
4622
|
}
|
|
4489
|
-
function
|
|
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(
|
|
4493
|
-
return
|
|
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 ${
|
|
4629
|
+
(page ${a} of ${n.length})`;
|
|
4496
4630
|
}
|
|
4497
|
-
const
|
|
4498
|
-
function
|
|
4631
|
+
const Zn = 1200;
|
|
4632
|
+
function Ea(e) {
|
|
4499
4633
|
const {
|
|
4500
4634
|
children: t,
|
|
4501
4635
|
label: n,
|
|
4502
|
-
format:
|
|
4503
|
-
pageTools:
|
|
4504
|
-
view:
|
|
4505
|
-
defaultView:
|
|
4506
|
-
onViewChange:
|
|
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(),
|
|
4510
|
-
(
|
|
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
|
-
|
|
4646
|
+
h.setView(N);
|
|
4513
4647
|
return;
|
|
4514
4648
|
}
|
|
4515
|
-
f || y(
|
|
4649
|
+
f || y(N), r?.(N);
|
|
4516
4650
|
},
|
|
4517
|
-
[b, f,
|
|
4518
|
-
),
|
|
4519
|
-
() => ({ view: w, setView: T, controls:
|
|
4520
|
-
[w, T,
|
|
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
|
-
|
|
4526
|
-
enabled: g &&
|
|
4527
|
-
format:
|
|
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] =
|
|
4665
|
+
const S = m(null), [v, k] = Y(!1);
|
|
4532
4666
|
_(() => {
|
|
4533
4667
|
if (!v) return;
|
|
4534
|
-
const
|
|
4535
|
-
return () => clearTimeout(
|
|
4668
|
+
const N = setTimeout(() => k(!1), Zn);
|
|
4669
|
+
return () => clearTimeout(N);
|
|
4536
4670
|
}, [v]);
|
|
4537
4671
|
const x = () => {
|
|
4538
|
-
const
|
|
4539
|
-
if (
|
|
4540
|
-
const
|
|
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
|
-
|
|
4677
|
+
N.writeText(P).then(
|
|
4544
4678
|
() => k(!0),
|
|
4545
4679
|
() => k(!1)
|
|
4546
4680
|
);
|
|
4547
4681
|
};
|
|
4548
|
-
return /* @__PURE__ */
|
|
4549
|
-
b && w === "agent" &&
|
|
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__ */
|
|
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
|
|
4571
|
-
const { children: t, label: n } = e,
|
|
4572
|
-
return /* @__PURE__ */
|
|
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
|
|
4575
|
-
version:
|
|
4576
|
-
},
|
|
4708
|
+
const ea = "0.2.0", ta = {
|
|
4709
|
+
version: ea
|
|
4710
|
+
}, qa = ta.version;
|
|
4577
4711
|
export {
|
|
4578
4712
|
Qe as AGENT_ATTRIBUTE,
|
|
4579
|
-
|
|
4713
|
+
he as AgentControl,
|
|
4580
4714
|
we as AgentControlGroup,
|
|
4581
|
-
|
|
4582
|
-
|
|
4715
|
+
U as AgentLine,
|
|
4716
|
+
Ma as AgentRegion,
|
|
4583
4717
|
me as AgentScopeProvider,
|
|
4584
|
-
|
|
4718
|
+
la as Alert,
|
|
4585
4719
|
dn as Button,
|
|
4586
4720
|
yt as CLOSE_DIALOG_TOOL,
|
|
4587
4721
|
Q as COMPONENT_ATTRIBUTE,
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4722
|
+
ca as Card,
|
|
4723
|
+
da as Checkbox,
|
|
4724
|
+
ha as CodeBlock,
|
|
4591
4725
|
ft as DISMISS_ALERT_TOOL,
|
|
4592
|
-
|
|
4593
|
-
|
|
4726
|
+
ua as DescriptionList,
|
|
4727
|
+
pa as Dialog,
|
|
4594
4728
|
Ct as FILL_TEXTAREA_TOOL,
|
|
4595
4729
|
St as FILL_TOOL,
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
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
|
-
|
|
4606
|
-
|
|
4740
|
+
Ie as PARAM_DESCRIPTION_LIMIT,
|
|
4741
|
+
ae as PART_ATTRIBUTE,
|
|
4607
4742
|
bt as PRESS_TOOL,
|
|
4608
|
-
|
|
4609
|
-
|
|
4743
|
+
ka as PageHeader,
|
|
4744
|
+
Ta as Panel,
|
|
4610
4745
|
Oe as REGION_ATTRIBUTE,
|
|
4611
4746
|
Mt as RESERVED_STATE_KEYS,
|
|
4612
|
-
|
|
4613
|
-
|
|
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
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
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
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
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
|
-
|
|
4777
|
+
ia as agentSelector,
|
|
4643
4778
|
je as alertMeta,
|
|
4644
|
-
|
|
4645
|
-
|
|
4779
|
+
sa as buildAgentManifest,
|
|
4780
|
+
R as buildAgentNode,
|
|
4646
4781
|
_e as buttonMeta,
|
|
4647
4782
|
Ve as cardMeta,
|
|
4648
|
-
|
|
4649
|
-
|
|
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
|
-
|
|
4659
|
-
|
|
4793
|
+
kn as imageMeta,
|
|
4794
|
+
ra as isModelContextAvailable,
|
|
4795
|
+
Tn as linkMeta,
|
|
4660
4796
|
_t as listAgentMeta,
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
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
|
-
|
|
4805
|
+
H as reactText,
|
|
4670
4806
|
Wt as registerTool,
|
|
4671
|
-
|
|
4672
|
-
|
|
4807
|
+
Ln as secretFieldMeta,
|
|
4808
|
+
Fe as segmentedControlMeta,
|
|
4673
4809
|
Ge as selectMeta,
|
|
4674
4810
|
De as serializeElement,
|
|
4675
|
-
|
|
4676
|
-
|
|
4811
|
+
on as serializeWithin,
|
|
4812
|
+
qn as shellMeta,
|
|
4677
4813
|
Z as slug,
|
|
4678
|
-
|
|
4814
|
+
In as stackMeta,
|
|
4679
4815
|
Ke as switchMeta,
|
|
4680
4816
|
Un as tableMeta,
|
|
4681
|
-
|
|
4817
|
+
Bn as tagMeta,
|
|
4682
4818
|
Xe as textInputMeta,
|
|
4683
|
-
|
|
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
|
-
|
|
4825
|
+
F as useAgentFormat,
|
|
4690
4826
|
ke as useAgentScope,
|
|
4691
4827
|
V as useAgentTool,
|
|
4692
|
-
|
|
4828
|
+
I as useSprintView,
|
|
4693
4829
|
zt as useSprintViewControl,
|
|
4694
|
-
|
|
4695
|
-
|
|
4830
|
+
It as validateInputs,
|
|
4831
|
+
qa as version
|
|
4696
4832
|
};
|
|
4697
4833
|
//# sourceMappingURL=index.js.map
|