@westonkd/sprint 0.2.0 → 0.4.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 +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +658 -615
- 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
1
|
import { jsx as s, jsxs as A, Fragment as Re } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as ne, createContext as
|
|
3
|
-
import { flushSync as
|
|
4
|
-
const Q = "data-sprint", ae = "data-sprint-part", pe = "data-sprint-", ce = "data-sprint-tool",
|
|
2
|
+
import { useContext as ne, createContext as Oe, Fragment as Se, isValidElement as Et, useRef as m, useEffect as j, useState as Y, useCallback as B, useLayoutEffect as Mt, useId as le, useMemo as ee, Children as Je } from "react";
|
|
3
|
+
import { flushSync as It } from "react-dom";
|
|
4
|
+
const Q = "data-sprint", ae = "data-sprint-part", pe = "data-sprint-", ce = "data-sprint-tool", Qe = "data-sprint-owner", Ze = "data-sprint-agent", qt = "data-sprint-view", Ut = "data-sprint-view-copy", Wt = "data-sprint-theme", $e = "data-sprint-region", Bt = [
|
|
5
5
|
"part",
|
|
6
6
|
"tool",
|
|
7
7
|
"owner",
|
|
@@ -12,7 +12,7 @@ const Q = "data-sprint", ae = "data-sprint-part", pe = "data-sprint-", ce = "dat
|
|
|
12
12
|
"region",
|
|
13
13
|
"ornament"
|
|
14
14
|
];
|
|
15
|
-
function
|
|
15
|
+
function et(e, t = {}) {
|
|
16
16
|
const n = {
|
|
17
17
|
[Q]: e
|
|
18
18
|
};
|
|
@@ -21,7 +21,7 @@ function Ze(e, t = {}) {
|
|
|
21
21
|
o == null || o === !1 || (n[`${pe}${a}`] = o === !0 ? "" : String(o));
|
|
22
22
|
return n;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ya(e, t) {
|
|
25
25
|
const n = `[${Q}="${e}"]`;
|
|
26
26
|
return t ? `${n} [${ae}="${t}"]` : n;
|
|
27
27
|
}
|
|
@@ -34,7 +34,7 @@ function Pe(e, t) {
|
|
|
34
34
|
`);
|
|
35
35
|
return `${o > n / 2 ? a.slice(0, o) : a.trimEnd()}${xe}`;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function tt(e, t) {
|
|
38
38
|
if (t <= 0) return [e];
|
|
39
39
|
const n = e.split(`
|
|
40
40
|
`), a = [];
|
|
@@ -52,27 +52,27 @@ ${i}`;
|
|
|
52
52
|
}
|
|
53
53
|
return o !== "" && a.push(o), a.length === 0 ? [""] : a;
|
|
54
54
|
}
|
|
55
|
-
const te = 1500,
|
|
56
|
-
function
|
|
55
|
+
const te = 1500, Ie = 500, qe = 150;
|
|
56
|
+
function nt() {
|
|
57
57
|
return typeof document > "u" ? null : document.modelContext ?? null;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
59
|
+
function ka() {
|
|
60
|
+
return nt() !== null;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
if (e.description.length >
|
|
62
|
+
function _t(e) {
|
|
63
|
+
if (e.description.length > Ie)
|
|
64
64
|
throw new Error(
|
|
65
|
-
`Tool "${e.name}" description is ${e.description.length} characters; the platform limit is ${
|
|
65
|
+
`Tool "${e.name}" description is ${e.description.length} characters; the platform limit is ${Ie}.`
|
|
66
66
|
);
|
|
67
67
|
for (const [t, n] of Object.entries(e.inputSchema.properties)) {
|
|
68
68
|
const a = n.description ?? "";
|
|
69
|
-
if (a.length >
|
|
69
|
+
if (a.length > qe)
|
|
70
70
|
throw new Error(
|
|
71
|
-
`Tool "${e.name}" parameter "${t}" description is ${a.length} characters; the platform limit is ${
|
|
71
|
+
`Tool "${e.name}" parameter "${t}" description is ${a.length} characters; the platform limit is ${qe}.`
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function jt(e, t) {
|
|
76
76
|
for (const n of e.required ?? [])
|
|
77
77
|
if (t[n] === void 0) {
|
|
78
78
|
const a = Object.keys(e.properties).join(", ");
|
|
@@ -93,9 +93,9 @@ function It(e, t) {
|
|
|
93
93
|
}
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Vt(e) {
|
|
97
97
|
return { ...e, execute: async (n, a) => {
|
|
98
|
-
const o =
|
|
98
|
+
const o = jt(e.inputSchema, n ?? {});
|
|
99
99
|
if (o !== null) return o;
|
|
100
100
|
try {
|
|
101
101
|
const i = await e.execute(n ?? {}, a);
|
|
@@ -106,29 +106,29 @@ function Ut(e) {
|
|
|
106
106
|
}
|
|
107
107
|
} };
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
const n =
|
|
109
|
+
function Ft(e, t) {
|
|
110
|
+
_t(e);
|
|
111
|
+
const n = nt();
|
|
112
112
|
if (n === null || t.aborted) return !1;
|
|
113
|
-
const a = n.registerTool(
|
|
113
|
+
const a = n.registerTool(Vt(e), { signal: t });
|
|
114
114
|
return a instanceof Promise && a.catch((o) => {
|
|
115
115
|
console.warn(`Sprint could not register tool "${e.name}"`, o);
|
|
116
116
|
}), !0;
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
function
|
|
118
|
+
const Ht = "<scope>-<verb>-<label-slug>", ge = /* @__PURE__ */ new Map();
|
|
119
|
+
function I(e) {
|
|
120
120
|
const t = ge.get(e.name);
|
|
121
121
|
return t !== void 0 && t !== e && console.warn(
|
|
122
122
|
`Agent metadata for "${e.name}" was replaced. Two components sharing a name will collapse into one manifest entry.`
|
|
123
123
|
), ge.set(e.name, e), e;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Gt(e) {
|
|
126
126
|
return ge.get(e);
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Kt() {
|
|
129
129
|
return [...ge.values()].sort((e, t) => e.name.localeCompare(t.name));
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function Ta(e) {
|
|
132
132
|
return {
|
|
133
133
|
library: "sprint",
|
|
134
134
|
version: e,
|
|
@@ -137,90 +137,90 @@ function sa(e) {
|
|
|
137
137
|
partAttribute: ae,
|
|
138
138
|
stateAttributePrefix: pe,
|
|
139
139
|
toolAttribute: ce,
|
|
140
|
-
ownerAttribute:
|
|
141
|
-
regionAttribute:
|
|
140
|
+
ownerAttribute: Qe,
|
|
141
|
+
regionAttribute: $e,
|
|
142
142
|
agentViewFormat: "markdown",
|
|
143
|
-
toolNaming:
|
|
143
|
+
toolNaming: Ht,
|
|
144
144
|
toolOutputLimit: te
|
|
145
145
|
},
|
|
146
|
-
components:
|
|
146
|
+
components: Kt()
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function zt(e) {
|
|
150
150
|
return e.label === void 0 && e.parts.length === 0 && e.children.length === 0;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function at(e) {
|
|
153
153
|
let t = 0;
|
|
154
154
|
for (const n of e)
|
|
155
|
-
t += 1 +
|
|
155
|
+
t += 1 + at(n.children);
|
|
156
156
|
return t;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function ot(e) {
|
|
159
159
|
const t = Object.keys(e).sort();
|
|
160
160
|
return t.length === 0 ? "" : ` [${t.map((a) => {
|
|
161
161
|
const o = e[a];
|
|
162
162
|
return o === !0 ? a : `${a}=${o}`;
|
|
163
163
|
}).join(", ")}]`;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function it(e) {
|
|
166
166
|
return e === void 0 ? "" : ` "${e}"`;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function rt(e) {
|
|
169
169
|
return e === void 0 ? "" : ` → tool \`${e}\``;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return `${t}- part \`${e.part}\`${
|
|
171
|
+
function Xt(e, t) {
|
|
172
|
+
return `${t}- part \`${e.part}\`${it(e.label)}${ot(
|
|
173
173
|
e.state
|
|
174
|
-
)}${
|
|
174
|
+
)}${rt(e.tool)}`;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
const t =
|
|
178
|
-
return `- **${e.component}**${
|
|
176
|
+
function Yt(e) {
|
|
177
|
+
const t = zt(e) ? " (empty)" : "", n = e.owner === void 0 ? "" : ` (owned by \`${e.owner}\`)`;
|
|
178
|
+
return `- **${e.component}**${it(e.label)}${ot(
|
|
179
179
|
e.state
|
|
180
|
-
)}${
|
|
180
|
+
)}${rt(e.tool)}${n}${t}`;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
183
|
-
const a = [`${t}${
|
|
182
|
+
function st(e, t, n) {
|
|
183
|
+
const a = [`${t}${Yt(e)}`], o = `${t} `;
|
|
184
184
|
if (n.includeSummary && e.summary !== void 0)
|
|
185
185
|
for (const i of e.summary.split(`
|
|
186
186
|
`))
|
|
187
187
|
a.push(`${o}${i}`);
|
|
188
188
|
for (const i of e.parts)
|
|
189
|
-
a.push(
|
|
189
|
+
a.push(Xt(i, o));
|
|
190
190
|
for (const i of e.children)
|
|
191
|
-
a.push(...
|
|
191
|
+
a.push(...st(i, o, n));
|
|
192
192
|
return e.truncated && a.push(`${o}- … nested components omitted, depth limit reached`), a;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function Jt(e, t = {}) {
|
|
195
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((o) =>
|
|
198
|
+
return n.length === 0 ? "No Sprint components found." : n.flatMap((o) => st(o, "", a)).join(`
|
|
199
199
|
`);
|
|
200
200
|
}
|
|
201
|
-
const
|
|
201
|
+
const lt = (e) => Jt(e), de = Oe({
|
|
202
202
|
view: "human",
|
|
203
203
|
setView: () => {
|
|
204
204
|
},
|
|
205
205
|
controls: "always",
|
|
206
|
-
format:
|
|
206
|
+
format: lt,
|
|
207
207
|
owned: !1
|
|
208
|
-
}),
|
|
209
|
-
function
|
|
208
|
+
}), Qt = de.Provider;
|
|
209
|
+
function q() {
|
|
210
210
|
return ne(de).view;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Zt() {
|
|
213
213
|
return ne(de);
|
|
214
214
|
}
|
|
215
215
|
function G() {
|
|
216
216
|
return ne(de).controls;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function H() {
|
|
219
219
|
return ne(de).format;
|
|
220
220
|
}
|
|
221
|
-
const
|
|
221
|
+
const ct = Oe(0), fe = ct.Provider;
|
|
222
222
|
function be() {
|
|
223
|
-
return ne(
|
|
223
|
+
return ne(ct);
|
|
224
224
|
}
|
|
225
225
|
function R(e) {
|
|
226
226
|
const t = {};
|
|
@@ -239,7 +239,7 @@ function R(e) {
|
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
function M(e) {
|
|
242
|
-
return
|
|
242
|
+
return et(e.component, {
|
|
243
243
|
state: {
|
|
244
244
|
...e.state,
|
|
245
245
|
tool: e.tool,
|
|
@@ -248,19 +248,19 @@ function M(e) {
|
|
|
248
248
|
}
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
const t = { [
|
|
251
|
+
function dt(e) {
|
|
252
|
+
const t = { [Ze]: e.component };
|
|
253
253
|
return e.tool !== void 0 && (t[ce] = e.tool), t;
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function en(e, t) {
|
|
256
256
|
const n = {
|
|
257
|
-
[
|
|
257
|
+
[Ze]: e,
|
|
258
258
|
[ae]: t.part
|
|
259
259
|
};
|
|
260
260
|
return t.tool !== void 0 && (n[ce] = t.tool), n;
|
|
261
261
|
}
|
|
262
262
|
function L(e) {
|
|
263
|
-
const { [Q]: t, ...n } =
|
|
263
|
+
const { [Q]: t, ...n } = et("", {
|
|
264
264
|
part: e.part,
|
|
265
265
|
state: { ...e.state, tool: e.tool }
|
|
266
266
|
});
|
|
@@ -271,7 +271,7 @@ function ve(e, t) {
|
|
|
271
271
|
`);
|
|
272
272
|
}
|
|
273
273
|
function U(e) {
|
|
274
|
-
const { node: t, children: n } = e, a = be(), o =
|
|
274
|
+
const { node: t, children: n } = e, a = be(), o = H(), i = " ".repeat(a), l = ve(t, o).map((r) => `${i}${r}`);
|
|
275
275
|
return /* @__PURE__ */ A(fe, { value: a + 1, children: [
|
|
276
276
|
`${l.join(`
|
|
277
277
|
`)}
|
|
@@ -280,22 +280,22 @@ function U(e) {
|
|
|
280
280
|
] });
|
|
281
281
|
}
|
|
282
282
|
function we(e) {
|
|
283
|
-
const { node: t, onActivate: n, isActionable: a, children: o } = e, i = be(), l =
|
|
283
|
+
const { node: t, onActivate: n, isActionable: a, children: o } = e, i = be(), l = H(), r = " ".repeat(i), d = ve(t, l), c = d.length - t.parts.length, p = d.slice(0, c).map((u) => `${r}${u}`);
|
|
284
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 a !== void 0 && !a(
|
|
288
|
+
t.parts.map((u, g) => {
|
|
289
|
+
const h = d[c + g] ?? "", y = h.trimStart(), f = `${r}${h.slice(0, h.length - y.length)}`, b = `${u.part}-${u.label ?? g}`;
|
|
290
|
+
return a !== void 0 && !a(u, g) ? /* @__PURE__ */ s(Se, { children: `${f}${y}
|
|
291
291
|
` }, b) : /* @__PURE__ */ A(Se, { children: [
|
|
292
292
|
f,
|
|
293
293
|
/* @__PURE__ */ s(
|
|
294
294
|
"button",
|
|
295
295
|
{
|
|
296
296
|
type: "button",
|
|
297
|
-
...
|
|
298
|
-
onClick: () => n(
|
|
297
|
+
...en(t.component, u),
|
|
298
|
+
onClick: () => n(u, g),
|
|
299
299
|
children: y
|
|
300
300
|
}
|
|
301
301
|
),
|
|
@@ -306,24 +306,24 @@ function we(e) {
|
|
|
306
306
|
o
|
|
307
307
|
] });
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const { node: t, value: n, onValueChange: a, multiline: o = !1, masked: i = !1, ref: l } = e, r = be(), d =
|
|
309
|
+
function ut(e) {
|
|
310
|
+
const { node: t, value: n, onValueChange: a, multiline: o = !1, masked: i = !1, ref: l } = e, r = be(), d = H(), c = " ".repeat(r), p = ve(t, d).map((h) => `${c}${h}`), u = dt(t), g = o ? /* @__PURE__ */ s(
|
|
311
311
|
"textarea",
|
|
312
312
|
{
|
|
313
|
-
...
|
|
313
|
+
...u,
|
|
314
314
|
"aria-label": t.label,
|
|
315
315
|
value: n,
|
|
316
|
-
onChange: (
|
|
316
|
+
onChange: (h) => a(h.currentTarget.value),
|
|
317
317
|
ref: l
|
|
318
318
|
}
|
|
319
319
|
) : /* @__PURE__ */ s(
|
|
320
320
|
"input",
|
|
321
321
|
{
|
|
322
|
-
...
|
|
322
|
+
...u,
|
|
323
323
|
"aria-label": t.label,
|
|
324
324
|
type: i ? "password" : "text",
|
|
325
325
|
value: n,
|
|
326
|
-
onChange: (
|
|
326
|
+
onChange: (h) => a(h.currentTarget.value),
|
|
327
327
|
ref: l
|
|
328
328
|
}
|
|
329
329
|
);
|
|
@@ -337,12 +337,12 @@ function dt(e) {
|
|
|
337
337
|
`
|
|
338
338
|
] });
|
|
339
339
|
}
|
|
340
|
-
function
|
|
341
|
-
const { node: t, as: n = "button", href: a, children: o, ref: i, ...l } = e, r = be(), d =
|
|
340
|
+
function ue(e) {
|
|
341
|
+
const { node: t, as: n = "button", href: a, children: o, ref: i, ...l } = e, r = be(), d = H(), c = " ".repeat(r), [p = "", ...u] = ve(t, d), g = u.map((f) => `${c}${f}`), h = dt(t), y = n === "a" ? /* @__PURE__ */ s(
|
|
342
342
|
"a",
|
|
343
343
|
{
|
|
344
344
|
...l,
|
|
345
|
-
...
|
|
345
|
+
...h,
|
|
346
346
|
href: a ?? "#",
|
|
347
347
|
ref: i,
|
|
348
348
|
children: p
|
|
@@ -351,7 +351,7 @@ function he(e) {
|
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
353
|
...l,
|
|
354
|
-
...
|
|
354
|
+
...h,
|
|
355
355
|
ref: i,
|
|
356
356
|
children: p
|
|
357
357
|
}
|
|
@@ -367,7 +367,7 @@ ${g.join(`
|
|
|
367
367
|
o
|
|
368
368
|
] });
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function tn(e) {
|
|
371
371
|
return e.part === "cell" && typeof e.state.column == "string" && typeof e.state.row == "string";
|
|
372
372
|
}
|
|
373
373
|
function Ae(e) {
|
|
@@ -377,7 +377,7 @@ function Ue(e, t) {
|
|
|
377
377
|
return JSON.stringify([e, t]);
|
|
378
378
|
}
|
|
379
379
|
function ht(e) {
|
|
380
|
-
if (e.parts.length === 0 || !e.parts.every(
|
|
380
|
+
if (e.parts.length === 0 || !e.parts.every(tn)) return e;
|
|
381
381
|
const t = [], n = [], a = /* @__PURE__ */ new Map();
|
|
382
382
|
for (const i of e.parts) {
|
|
383
383
|
const l = String(i.state.column), r = String(i.state.row);
|
|
@@ -393,7 +393,7 @@ function ht(e) {
|
|
|
393
393
|
`);
|
|
394
394
|
return { ...e, parts: [], summary: o };
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function he(e) {
|
|
397
397
|
return e.replace(/\s+/g, " ").trim();
|
|
398
398
|
}
|
|
399
399
|
function Ne(e, t) {
|
|
@@ -406,7 +406,7 @@ function Ne(e, t) {
|
|
|
406
406
|
for (const a of e) Ne(a, t);
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
|
-
if (!
|
|
409
|
+
if (!Et(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") {
|
|
@@ -416,53 +416,53 @@ function Ne(e, t) {
|
|
|
416
416
|
Ne(n.children, t);
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function F(e) {
|
|
420
420
|
const t = [];
|
|
421
421
|
Ne(e, t);
|
|
422
|
-
const n =
|
|
422
|
+
const n = he(t.join(""));
|
|
423
423
|
return n === "" ? void 0 : n;
|
|
424
424
|
}
|
|
425
|
-
function
|
|
425
|
+
function nn(e) {
|
|
426
426
|
return e.getAttribute("aria-hidden") === "true" || e.hasAttribute("hidden");
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function pt(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
434
|
const a = e;
|
|
435
|
-
if (
|
|
435
|
+
if (nn(a) || n > 0 && a.hasAttribute(Q)) return;
|
|
436
436
|
const o = a.getAttribute("aria-label");
|
|
437
437
|
if (n > 0 && o !== null) {
|
|
438
438
|
t.push(o);
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
441
|
for (const i of Array.from(a.childNodes))
|
|
442
|
-
|
|
442
|
+
pt(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 i =
|
|
447
|
+
const i = he(t);
|
|
448
448
|
return i === "" ? void 0 : i;
|
|
449
449
|
}
|
|
450
450
|
const n = e.getAttribute("aria-labelledby");
|
|
451
451
|
if (n !== null) {
|
|
452
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
|
|
453
|
+
if (l.length > 0) return he(l.join(" "));
|
|
454
454
|
}
|
|
455
455
|
const a = [];
|
|
456
|
-
|
|
457
|
-
const o =
|
|
456
|
+
pt(e, a, 0);
|
|
457
|
+
const o = he(a.join(""));
|
|
458
458
|
return o === "" ? void 0 : o;
|
|
459
459
|
}
|
|
460
|
-
const
|
|
460
|
+
const an = new Set(Bt), on = /* @__PURE__ */ new Map([
|
|
461
461
|
["disabled", "disabled"],
|
|
462
462
|
["open", "open"],
|
|
463
463
|
["readonly", "readonly"],
|
|
464
464
|
["required", "required"]
|
|
465
|
-
]),
|
|
465
|
+
]), rn = /* @__PURE__ */ new Map([
|
|
466
466
|
["aria-disabled", "disabled"],
|
|
467
467
|
["aria-busy", "loading"],
|
|
468
468
|
["aria-expanded", "expanded"],
|
|
@@ -471,22 +471,22 @@ const Qt = new Set(Mt), Zt = /* @__PURE__ */ new Map([
|
|
|
471
471
|
["aria-pressed", "pressed"],
|
|
472
472
|
["aria-invalid", "invalid"]
|
|
473
473
|
]);
|
|
474
|
-
function
|
|
474
|
+
function gt(e) {
|
|
475
475
|
const t = {};
|
|
476
|
-
for (const [n, a] of
|
|
476
|
+
for (const [n, a] of rn) {
|
|
477
477
|
const o = e.getAttribute(n);
|
|
478
478
|
o === null || o === "false" || (t[a] = o === "true" || o === "" ? !0 : o);
|
|
479
479
|
}
|
|
480
|
-
for (const [n, a] of
|
|
480
|
+
for (const [n, a] of on)
|
|
481
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
484
|
const a = n.name.slice(pe.length);
|
|
485
|
-
a === "" ||
|
|
485
|
+
a === "" || an.has(a) || (t[a] = n.value === "" ? !0 : n.value);
|
|
486
486
|
}
|
|
487
487
|
return t;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function sn(e) {
|
|
490
490
|
const t = [], n = [], a = (o) => {
|
|
491
491
|
for (const i of Array.from(o.children)) {
|
|
492
492
|
if (i.hasAttribute(Q)) {
|
|
@@ -498,11 +498,11 @@ function tn(e) {
|
|
|
498
498
|
};
|
|
499
499
|
return a(e), { parts: t, children: n };
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function ln(e) {
|
|
502
502
|
const t = e.getAttribute(ae) ?? "", n = ye(e), a = e.getAttribute(ce);
|
|
503
503
|
return {
|
|
504
504
|
part: t,
|
|
505
|
-
state:
|
|
505
|
+
state: gt(e),
|
|
506
506
|
...n === void 0 ? {} : { label: n },
|
|
507
507
|
...a === null || a === "" ? {} : { tool: a }
|
|
508
508
|
};
|
|
@@ -510,23 +510,23 @@ function nn(e) {
|
|
|
510
510
|
function De(e, t = {}) {
|
|
511
511
|
const n = e.getAttribute(Q);
|
|
512
512
|
if (n === null) return null;
|
|
513
|
-
const a = t.maxDepth ?? 8, o = t.lookupMeta ??
|
|
513
|
+
const a = t.maxDepth ?? 8, o = t.lookupMeta ?? Gt, { parts: i, children: l } = sn(e), r = ye(e), d = o(n)?.summary, c = e.getAttribute(ce), p = e.getAttribute(Qe), u = a <= 0 && l.length > 0;
|
|
514
514
|
return ht({
|
|
515
515
|
component: n,
|
|
516
|
-
state:
|
|
517
|
-
parts: i.map(
|
|
518
|
-
children:
|
|
516
|
+
state: gt(e),
|
|
517
|
+
parts: i.map(ln),
|
|
518
|
+
children: u ? [] : l.map(
|
|
519
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
|
-
...e.hasAttribute(
|
|
526
|
-
...
|
|
525
|
+
...e.hasAttribute($e) ? { region: !0 } : {},
|
|
526
|
+
...u ? { truncated: !0 } : {}
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function mt(e) {
|
|
530
530
|
const t = [], n = (a) => {
|
|
531
531
|
for (const o of Array.from(a.children)) {
|
|
532
532
|
if (o.hasAttribute(Q)) {
|
|
@@ -538,7 +538,7 @@ function gt(e) {
|
|
|
538
538
|
};
|
|
539
539
|
return n(e), t;
|
|
540
540
|
}
|
|
541
|
-
function
|
|
541
|
+
function cn(e) {
|
|
542
542
|
const t = e.filter((i) => i.owner !== void 0);
|
|
543
543
|
if (t.length === 0) return e;
|
|
544
544
|
const n = /* @__PURE__ */ new Map(), a = (i) => {
|
|
@@ -555,9 +555,9 @@ function an(e) {
|
|
|
555
555
|
}
|
|
556
556
|
return e.filter((i) => !o.has(i));
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
const n =
|
|
560
|
-
return
|
|
558
|
+
function dn(e, t = {}) {
|
|
559
|
+
const n = mt(e).map((a) => De(a, t)).filter((a) => a !== null);
|
|
560
|
+
return cn(n);
|
|
561
561
|
}
|
|
562
562
|
function K() {
|
|
563
563
|
return new Promise((e) => {
|
|
@@ -586,14 +586,14 @@ function We(e, t, n) {
|
|
|
586
586
|
return d > 0 ? r.slice(0, d) : r;
|
|
587
587
|
}
|
|
588
588
|
const se = /* @__PURE__ */ new Map();
|
|
589
|
-
function
|
|
589
|
+
function un(e) {
|
|
590
590
|
const t = se.get(e);
|
|
591
591
|
if (t !== void 0) return t;
|
|
592
592
|
const n = { holders: /* @__PURE__ */ new Set(), listeners: /* @__PURE__ */ new Map() };
|
|
593
593
|
return se.set(e, n), n;
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
const a =
|
|
595
|
+
function hn(e, t, n) {
|
|
596
|
+
const a = un(e);
|
|
597
597
|
a.holders.add(t), a.listeners.set(t, n);
|
|
598
598
|
for (const [o, i] of a.listeners)
|
|
599
599
|
o !== t && i();
|
|
@@ -609,43 +609,43 @@ function Be(e, t) {
|
|
|
609
609
|
const n = se.get(e);
|
|
610
610
|
return n === void 0 ? !1 : n.holders.size === 1 && n.holders.has(t);
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function pn(e) {
|
|
613
613
|
return se.get(e)?.holders.size ?? 0;
|
|
614
614
|
}
|
|
615
|
-
const
|
|
615
|
+
const ft = Oe({ path: [] }), me = ft.Provider;
|
|
616
616
|
function ke() {
|
|
617
|
-
return ne(
|
|
617
|
+
return ne(ft).path;
|
|
618
618
|
}
|
|
619
619
|
function V(e) {
|
|
620
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
621
|
c.current.key !== d && (c.current = { key: d, value: o ?? t.inputSchema });
|
|
622
|
-
const p = c.current.value,
|
|
623
|
-
|
|
622
|
+
const p = c.current.value, u = m(null);
|
|
623
|
+
u.current === null && (u.current = /* @__PURE__ */ Symbol("sprint-tool"));
|
|
624
624
|
const g = m(l);
|
|
625
|
-
|
|
625
|
+
j(() => {
|
|
626
626
|
g.current = l;
|
|
627
627
|
});
|
|
628
|
-
const
|
|
629
|
-
return
|
|
630
|
-
const b =
|
|
631
|
-
if (
|
|
628
|
+
const h = a === void 0 ? n === void 0 ? null : We(r, t.verb, n) : We(r, t.verb, a), [y, f] = Y(!1);
|
|
629
|
+
return j(() => {
|
|
630
|
+
const b = u.current;
|
|
631
|
+
if (h === null || !i || b === null) {
|
|
632
632
|
f(!1);
|
|
633
633
|
return;
|
|
634
634
|
}
|
|
635
|
-
const w =
|
|
636
|
-
f(Be(
|
|
635
|
+
const w = hn(h, b, () => {
|
|
636
|
+
f(Be(h, b));
|
|
637
637
|
});
|
|
638
|
-
return
|
|
639
|
-
`Sprint tool name "${
|
|
640
|
-
), f(Be(
|
|
638
|
+
return pn(h) > 1 && console.warn(
|
|
639
|
+
`Sprint tool name "${h}" is claimed by more than one component. None of them will register a tool. Set agentName on all but one, or label them distinctly.`
|
|
640
|
+
), f(Be(h, b)), () => {
|
|
641
641
|
w(), f(!1);
|
|
642
642
|
};
|
|
643
|
-
}, [
|
|
644
|
-
if (!y ||
|
|
643
|
+
}, [h, i]), j(() => {
|
|
644
|
+
if (!y || h === null) return;
|
|
645
645
|
const b = new AbortController();
|
|
646
|
-
return
|
|
646
|
+
return Ft(
|
|
647
647
|
{
|
|
648
|
-
name:
|
|
648
|
+
name: h,
|
|
649
649
|
description: t.description,
|
|
650
650
|
inputSchema: p,
|
|
651
651
|
annotations: {
|
|
@@ -658,12 +658,12 @@ function V(e) {
|
|
|
658
658
|
), () => {
|
|
659
659
|
b.abort();
|
|
660
660
|
};
|
|
661
|
-
}, [y,
|
|
661
|
+
}, [y, h, t, p]), y && h !== null ? h : void 0;
|
|
662
662
|
}
|
|
663
663
|
function z(e) {
|
|
664
|
-
|
|
664
|
+
It(e);
|
|
665
665
|
}
|
|
666
|
-
const
|
|
666
|
+
const bt = {
|
|
667
667
|
verb: "dismiss",
|
|
668
668
|
description: "Dismiss this alert, exactly as a person clicking its dismiss control would. The page decides what dismissal means, usually removing the message. Returns the alert's state after the dismissal, or says the alert left the page.",
|
|
669
669
|
inputSchema: { type: "object", properties: {} },
|
|
@@ -671,7 +671,7 @@ const ft = {
|
|
|
671
671
|
untrustedContent: !0,
|
|
672
672
|
registeredWhen: "The alert is mounted, has an onDismiss handler, and label or agentName provides a stable name.",
|
|
673
673
|
unregisteredWhen: "The alert unmounts or loses its onDismiss handler."
|
|
674
|
-
},
|
|
674
|
+
}, _e = I({
|
|
675
675
|
name: "Alert",
|
|
676
676
|
category: "feedback",
|
|
677
677
|
summary: "A status message for the outcome of something that already happened: a notice, a warning, or a failure.",
|
|
@@ -720,7 +720,7 @@ const ft = {
|
|
|
720
720
|
}
|
|
721
721
|
},
|
|
722
722
|
tools: {
|
|
723
|
-
dismiss:
|
|
723
|
+
dismiss: bt
|
|
724
724
|
},
|
|
725
725
|
agentView: {
|
|
726
726
|
example: '- **Alert** "Check your inbox" [dismissible, tone=info]'
|
|
@@ -747,7 +747,7 @@ 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 xa(e) {
|
|
751
751
|
const {
|
|
752
752
|
tone: t = "info",
|
|
753
753
|
label: n,
|
|
@@ -756,16 +756,16 @@ function la(e) {
|
|
|
756
756
|
agentTool: i = !0,
|
|
757
757
|
children: l,
|
|
758
758
|
...r
|
|
759
|
-
} = e, d =
|
|
759
|
+
} = e, d = q(), c = G(), p = H(), u = m(null), g = m(a);
|
|
760
760
|
g.current = a;
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
const y = m(R({ component:
|
|
764
|
-
|
|
761
|
+
const h = m(p);
|
|
762
|
+
h.current = p;
|
|
763
|
+
const y = m(R({ component: _e.name })), f = m(!0);
|
|
764
|
+
j(() => (f.current = !0, () => {
|
|
765
765
|
f.current = !1;
|
|
766
766
|
}), []);
|
|
767
767
|
const b = a !== void 0, w = B(async () => {
|
|
768
|
-
const S =
|
|
768
|
+
const S = u.current;
|
|
769
769
|
if (S !== null)
|
|
770
770
|
S.click();
|
|
771
771
|
else {
|
|
@@ -774,30 +774,30 @@ function la(e) {
|
|
|
774
774
|
z(() => v());
|
|
775
775
|
}
|
|
776
776
|
return await K(), f.current ? `Dismissed. The alert is now:
|
|
777
|
-
${
|
|
777
|
+
${h.current([y.current])}` : "Dismissed. The alert is gone from the page.";
|
|
778
778
|
}, []), T = V({
|
|
779
|
-
spec:
|
|
779
|
+
spec: bt,
|
|
780
780
|
label: o ?? n,
|
|
781
781
|
enabled: i && b,
|
|
782
782
|
execute: w
|
|
783
|
-
}), C =
|
|
784
|
-
C !== void 0 &&
|
|
783
|
+
}), C = F(l), O = [];
|
|
784
|
+
C !== void 0 && O.push({ part: "message", label: C, state: {} }), b && O.push({
|
|
785
785
|
part: "dismiss",
|
|
786
786
|
label: "Dismiss",
|
|
787
787
|
state: {},
|
|
788
788
|
...T === void 0 ? {} : { tool: T }
|
|
789
789
|
});
|
|
790
|
-
const
|
|
791
|
-
component:
|
|
790
|
+
const $ = R({
|
|
791
|
+
component: _e.name,
|
|
792
792
|
label: n,
|
|
793
793
|
state: { tone: t, dismissible: b },
|
|
794
|
-
parts:
|
|
794
|
+
parts: O
|
|
795
795
|
});
|
|
796
|
-
if (y.current =
|
|
797
|
-
return !b || c === "never" ? /* @__PURE__ */ s(U, { node:
|
|
796
|
+
if (y.current = $, d === "agent")
|
|
797
|
+
return !b || c === "never" ? /* @__PURE__ */ s(U, { node: $ }) : /* @__PURE__ */ s(
|
|
798
798
|
we,
|
|
799
799
|
{
|
|
800
|
-
node:
|
|
800
|
+
node: $,
|
|
801
801
|
isActionable: (S) => S.part === "dismiss",
|
|
802
802
|
onActivate: () => a?.()
|
|
803
803
|
}
|
|
@@ -807,7 +807,7 @@ ${u.current([y.current])}` : "Dismissed. The alert is gone from the page.";
|
|
|
807
807
|
"div",
|
|
808
808
|
{
|
|
809
809
|
...r,
|
|
810
|
-
...M(
|
|
810
|
+
...M($),
|
|
811
811
|
role: E,
|
|
812
812
|
...n === void 0 ? {} : { "aria-label": n },
|
|
813
813
|
children: [
|
|
@@ -823,7 +823,7 @@ ${u.current([y.current])}` : "Dismissed. The alert is gone from the page.";
|
|
|
823
823
|
}),
|
|
824
824
|
type: "button",
|
|
825
825
|
"aria-label": "Dismiss",
|
|
826
|
-
ref:
|
|
826
|
+
ref: u,
|
|
827
827
|
onClick: () => a?.(),
|
|
828
828
|
children: "×"
|
|
829
829
|
}
|
|
@@ -832,7 +832,7 @@ ${u.current([y.current])}` : "Dismissed. The alert is gone from the page.";
|
|
|
832
832
|
}
|
|
833
833
|
);
|
|
834
834
|
}
|
|
835
|
-
const
|
|
835
|
+
const vt = {
|
|
836
836
|
verb: "press",
|
|
837
837
|
description: "Press this button, exactly as a person clicking it would. Returns the button's state after the press, so a follow-up read is usually unnecessary. Any work the press starts is not waited for; if the button enters a loading state the result says so.",
|
|
838
838
|
inputSchema: { type: "object", properties: {} },
|
|
@@ -840,7 +840,7 @@ const bt = {
|
|
|
840
840
|
untrustedContent: !0,
|
|
841
841
|
registeredWhen: "The button is mounted, enabled, not loading, has a resolvable label, and no other component claims the same tool name.",
|
|
842
842
|
unregisteredWhen: "The button unmounts, becomes disabled, or starts loading."
|
|
843
|
-
},
|
|
843
|
+
}, je = I({
|
|
844
844
|
name: "Button",
|
|
845
845
|
category: "action",
|
|
846
846
|
summary: "A single action a person or an agent can trigger. Registers one press tool named from its own label.",
|
|
@@ -908,7 +908,7 @@ const bt = {
|
|
|
908
908
|
}
|
|
909
909
|
},
|
|
910
910
|
tools: {
|
|
911
|
-
press:
|
|
911
|
+
press: vt
|
|
912
912
|
},
|
|
913
913
|
agentView: {
|
|
914
914
|
example: '- **Button** "Prepare launch" [tone=action] → tool `press-prepare-launch`'
|
|
@@ -945,10 +945,10 @@ const bt = {
|
|
|
945
945
|
notes: "Loading sets aria-busy and disables the control. Focus is an offset keyline, never a rounded ring."
|
|
946
946
|
}
|
|
947
947
|
});
|
|
948
|
-
function
|
|
948
|
+
function gn() {
|
|
949
949
|
return new MouseEvent("click", { bubbles: !0, cancelable: !0 });
|
|
950
950
|
}
|
|
951
|
-
function
|
|
951
|
+
function mn(e) {
|
|
952
952
|
const {
|
|
953
953
|
tone: t = "neutral",
|
|
954
954
|
block: n = !1,
|
|
@@ -960,24 +960,24 @@ function dn(e) {
|
|
|
960
960
|
children: d,
|
|
961
961
|
ref: c,
|
|
962
962
|
onClick: p,
|
|
963
|
-
...
|
|
964
|
-
} = e, g =
|
|
963
|
+
...u
|
|
964
|
+
} = e, g = q(), h = G(), y = H(), f = m(null), b = B(
|
|
965
965
|
(P) => {
|
|
966
966
|
f.current = P, typeof c == "function" ? c(P) : c != null && (c.current = P);
|
|
967
967
|
},
|
|
968
968
|
[c]
|
|
969
969
|
), w = o ?? (typeof d == "string" ? d : void 0), [T, C] = Y(void 0);
|
|
970
|
-
|
|
970
|
+
Mt(() => {
|
|
971
971
|
if (w !== void 0) return;
|
|
972
972
|
const P = f.current;
|
|
973
973
|
P !== null && C(ye(P));
|
|
974
974
|
});
|
|
975
|
-
const
|
|
975
|
+
const O = l || a, $ = w ?? T, E = m(p);
|
|
976
976
|
E.current = p;
|
|
977
|
-
const S = m(R({ component:
|
|
977
|
+
const S = m(R({ component: je.name })), v = m(y);
|
|
978
978
|
v.current = y;
|
|
979
979
|
const k = m(!0);
|
|
980
|
-
|
|
980
|
+
j(() => (k.current = !0, () => {
|
|
981
981
|
k.current = !1;
|
|
982
982
|
}), []);
|
|
983
983
|
const x = B(async () => {
|
|
@@ -985,26 +985,26 @@ function dn(e) {
|
|
|
985
985
|
if (P !== null)
|
|
986
986
|
P.click();
|
|
987
987
|
else {
|
|
988
|
-
const
|
|
989
|
-
if (
|
|
988
|
+
const _ = E.current;
|
|
989
|
+
if (_ === void 0)
|
|
990
990
|
return "This button renders no control in the current view and has no click handler.";
|
|
991
|
-
z(() =>
|
|
991
|
+
z(() => _(gn()));
|
|
992
992
|
}
|
|
993
993
|
return await K(), k.current ? `Pressed. The button is now:
|
|
994
994
|
${v.current([S.current])}` : "The press removed this button from the page.";
|
|
995
995
|
}, []), D = V({
|
|
996
|
-
spec:
|
|
997
|
-
label:
|
|
998
|
-
enabled: i &&
|
|
996
|
+
spec: vt,
|
|
997
|
+
label: $,
|
|
998
|
+
enabled: i && !O,
|
|
999
999
|
execute: x
|
|
1000
1000
|
}), N = R({
|
|
1001
|
-
component:
|
|
1002
|
-
label:
|
|
1001
|
+
component: je.name,
|
|
1002
|
+
label: $,
|
|
1003
1003
|
tool: D,
|
|
1004
|
-
state: { tone: t, block: n, loading: a, disabled:
|
|
1004
|
+
state: { tone: t, block: n, loading: a, disabled: O }
|
|
1005
1005
|
});
|
|
1006
|
-
return S.current = N, g === "agent" ?
|
|
1007
|
-
|
|
1006
|
+
return S.current = N, g === "agent" ? O || h === "never" ? /* @__PURE__ */ s(U, { node: N }) : /* @__PURE__ */ s(
|
|
1007
|
+
ue,
|
|
1008
1008
|
{
|
|
1009
1009
|
node: N,
|
|
1010
1010
|
type: r,
|
|
@@ -1015,18 +1015,18 @@ ${v.current([S.current])}` : "The press removed this button from the page.";
|
|
|
1015
1015
|
) : /* @__PURE__ */ s(
|
|
1016
1016
|
"button",
|
|
1017
1017
|
{
|
|
1018
|
-
...
|
|
1018
|
+
...u,
|
|
1019
1019
|
...M(N),
|
|
1020
1020
|
type: r,
|
|
1021
1021
|
ref: b,
|
|
1022
1022
|
onClick: p,
|
|
1023
|
-
disabled:
|
|
1023
|
+
disabled: O,
|
|
1024
1024
|
"aria-busy": a || void 0,
|
|
1025
1025
|
children: d
|
|
1026
1026
|
}
|
|
1027
1027
|
);
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1029
|
+
const wt = {
|
|
1030
1030
|
verb: "open",
|
|
1031
1031
|
description: "Open this card, exactly as a person clicking it would. What opening does is the card's own business: it may reveal detail in place, select this item, or start a flow. Returns the card's state after the click.",
|
|
1032
1032
|
inputSchema: { type: "object", properties: {} },
|
|
@@ -1034,7 +1034,7 @@ const vt = {
|
|
|
1034
1034
|
untrustedContent: !0,
|
|
1035
1035
|
registeredWhen: "The card acts rather than navigates, is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
|
|
1036
1036
|
unregisteredWhen: "The card unmounts, becomes disabled, or turns into a link by taking an href."
|
|
1037
|
-
}, Ve =
|
|
1037
|
+
}, Ve = I({
|
|
1038
1038
|
name: "Card",
|
|
1039
1039
|
category: "navigation",
|
|
1040
1040
|
summary: "One entry in a catalogue: a title, a line or two of body, and the whole block clickable. Give it an href and it is a link; give it onClick and it is an action that registers an open tool.",
|
|
@@ -1084,7 +1084,7 @@ const vt = {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
},
|
|
1086
1086
|
tools: {
|
|
1087
|
-
open:
|
|
1087
|
+
open: wt
|
|
1088
1088
|
},
|
|
1089
1089
|
agentView: {
|
|
1090
1090
|
example: '- **Card** "Button" [href=#/Button]\n - part `title` "Button"\n - part `body` "A single action a person or an agent can trigger."'
|
|
@@ -1109,7 +1109,7 @@ 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 Aa(e) {
|
|
1113
1113
|
const {
|
|
1114
1114
|
label: t,
|
|
1115
1115
|
children: n,
|
|
@@ -1120,7 +1120,7 @@ function ca(e) {
|
|
|
1120
1120
|
agentName: r,
|
|
1121
1121
|
ref: d,
|
|
1122
1122
|
...c
|
|
1123
|
-
} = e, p =
|
|
1123
|
+
} = e, p = q(), u = G(), g = H(), h = a !== void 0, y = !h && 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
|
},
|
|
@@ -1128,34 +1128,34 @@ function ca(e) {
|
|
|
1128
1128
|
), w = m(g);
|
|
1129
1129
|
w.current = g;
|
|
1130
1130
|
const T = m(R({ component: Ve.name })), C = m(!0);
|
|
1131
|
-
|
|
1131
|
+
j(() => (C.current = !0, () => {
|
|
1132
1132
|
C.current = !1;
|
|
1133
1133
|
}), []);
|
|
1134
|
-
const
|
|
1134
|
+
const O = B(async () => {
|
|
1135
1135
|
const x = f.current;
|
|
1136
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
|
-
}, []),
|
|
1139
|
-
spec:
|
|
1138
|
+
}, []), $ = V({
|
|
1139
|
+
spec: wt,
|
|
1140
1140
|
label: r ?? t,
|
|
1141
|
-
enabled: (l ?? !
|
|
1142
|
-
execute:
|
|
1143
|
-
}), E =
|
|
1141
|
+
enabled: (l ?? !h) && !y,
|
|
1142
|
+
execute: O
|
|
1143
|
+
}), E = F(n), S = [
|
|
1144
1144
|
{ part: "title", label: t, state: {} },
|
|
1145
1145
|
...E === void 0 ? [] : [{ part: "body", label: E, state: {} }]
|
|
1146
1146
|
], v = R({
|
|
1147
1147
|
component: Ve.name,
|
|
1148
1148
|
label: t,
|
|
1149
|
-
tool:
|
|
1149
|
+
tool: $,
|
|
1150
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 || u === "never" ? /* @__PURE__ */ s(U, { node: v }) : /* @__PURE__ */ s(
|
|
1155
|
+
ue,
|
|
1156
1156
|
{
|
|
1157
1157
|
node: v,
|
|
1158
|
-
as:
|
|
1158
|
+
as: h ? "a" : "button",
|
|
1159
1159
|
href: a,
|
|
1160
1160
|
ref: b,
|
|
1161
1161
|
onClick: o
|
|
@@ -1165,7 +1165,7 @@ ${w.current([T.current])}` : "Opening removed this card from the page.");
|
|
|
1165
1165
|
/* @__PURE__ */ s("span", { ...L({ part: "title", state: {} }), children: t }),
|
|
1166
1166
|
n === void 0 ? null : /* @__PURE__ */ s("span", { ...L({ part: "body", state: {} }), children: n })
|
|
1167
1167
|
] });
|
|
1168
|
-
return
|
|
1168
|
+
return h ? /* @__PURE__ */ s(
|
|
1169
1169
|
"a",
|
|
1170
1170
|
{
|
|
1171
1171
|
...c,
|
|
@@ -1190,7 +1190,7 @@ ${w.current([T.current])}` : "Opening removed this card from the page.");
|
|
|
1190
1190
|
}
|
|
1191
1191
|
);
|
|
1192
1192
|
}
|
|
1193
|
-
const
|
|
1193
|
+
const yt = {
|
|
1194
1194
|
verb: "set",
|
|
1195
1195
|
description: "Check or uncheck this box by stating the end state, exactly as a person clicking it would. Setting the state it already has succeeds and changes nothing, so the call is safe to retry. Returns the box's state after the call, so a follow-up read is unnecessary.",
|
|
1196
1196
|
inputSchema: {
|
|
@@ -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
|
+
}, Fe = I({
|
|
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.",
|
|
@@ -1281,7 +1281,7 @@ const wt = {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
},
|
|
1283
1283
|
tools: {
|
|
1284
|
-
set:
|
|
1284
|
+
set: yt
|
|
1285
1285
|
},
|
|
1286
1286
|
agentView: {
|
|
1287
1287
|
example: '- **Checkbox** "Accept the terms" [required] → tool `set-accept-the-terms`\n - part `error` "Required before launch"'
|
|
@@ -1325,10 +1325,10 @@ 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 fn(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 Ca(e) {
|
|
1332
1332
|
const {
|
|
1333
1333
|
label: t,
|
|
1334
1334
|
checked: n,
|
|
@@ -1340,16 +1340,16 @@ function da(e) {
|
|
|
1340
1340
|
required: d = !1,
|
|
1341
1341
|
agentName: c,
|
|
1342
1342
|
agentTool: p = !0,
|
|
1343
|
-
...
|
|
1344
|
-
} = e, g =
|
|
1343
|
+
...u
|
|
1344
|
+
} = e, g = q(), h = G(), y = H(), f = le(), b = m(null), w = m(a);
|
|
1345
1345
|
w.current = a;
|
|
1346
1346
|
const T = m(n);
|
|
1347
1347
|
T.current = n;
|
|
1348
1348
|
const C = m(y);
|
|
1349
1349
|
C.current = y;
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
|
|
1350
|
+
const O = m(R({ component: Fe.name })), $ = m(!0);
|
|
1351
|
+
j(() => ($.current = !0, () => {
|
|
1352
|
+
$.current = !1;
|
|
1353
1353
|
}), []);
|
|
1354
1354
|
const E = B(async (x) => {
|
|
1355
1355
|
const D = x.checked;
|
|
@@ -1357,18 +1357,18 @@ function da(e) {
|
|
|
1357
1357
|
return 'Pass "checked" as true or false; it states the end state.';
|
|
1358
1358
|
const N = D === T.current;
|
|
1359
1359
|
if (!N) {
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1360
|
+
const _ = b.current;
|
|
1361
|
+
_ !== null ? _.click() : z(() => w.current(D));
|
|
1362
1362
|
}
|
|
1363
|
-
return await K(),
|
|
1364
|
-
${C.current([
|
|
1363
|
+
return await K(), $.current ? `${N ? `Already ${D ? "checked" : "unchecked"}` : D ? "Checked" : "Unchecked"}. The checkbox is now:
|
|
1364
|
+
${C.current([O.current])}` : "The change removed this checkbox from the page.";
|
|
1365
1365
|
}, []), S = V({
|
|
1366
|
-
spec:
|
|
1366
|
+
spec: yt,
|
|
1367
1367
|
label: c ?? t,
|
|
1368
1368
|
enabled: p && !r,
|
|
1369
1369
|
execute: E
|
|
1370
1370
|
}), v = R({
|
|
1371
|
-
component:
|
|
1371
|
+
component: Fe.name,
|
|
1372
1372
|
label: t,
|
|
1373
1373
|
tool: S,
|
|
1374
1374
|
state: {
|
|
@@ -1377,11 +1377,11 @@ ${C.current([$.current])}` : "The change removed this checkbox from the page.";
|
|
|
1377
1377
|
required: d,
|
|
1378
1378
|
invalid: i !== void 0
|
|
1379
1379
|
},
|
|
1380
|
-
parts:
|
|
1380
|
+
parts: fn(i, o)
|
|
1381
1381
|
});
|
|
1382
|
-
if (
|
|
1383
|
-
return r ||
|
|
1384
|
-
|
|
1382
|
+
if (O.current = v, g === "agent")
|
|
1383
|
+
return r || h === "never" ? /* @__PURE__ */ s(U, { node: v }) : /* @__PURE__ */ s(
|
|
1384
|
+
ue,
|
|
1385
1385
|
{
|
|
1386
1386
|
node: v,
|
|
1387
1387
|
ref: (x) => {
|
|
@@ -1391,7 +1391,7 @@ ${C.current([$.current])}` : "The change removed this checkbox from the page.";
|
|
|
1391
1391
|
}
|
|
1392
1392
|
);
|
|
1393
1393
|
const k = i !== void 0 ? `${f}-error` : o !== void 0 ? `${f}-hint` : void 0;
|
|
1394
|
-
return /* @__PURE__ */ A("div", { ...
|
|
1394
|
+
return /* @__PURE__ */ A("div", { ...u, ...M(v), children: [
|
|
1395
1395
|
/* @__PURE__ */ A("label", { htmlFor: f, children: [
|
|
1396
1396
|
/* @__PURE__ */ s(
|
|
1397
1397
|
"input",
|
|
@@ -1423,7 +1423,7 @@ ${C.current([$.current])}` : "The change removed this checkbox from the page.";
|
|
|
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 bn = /(\/\/[^\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, vn = [
|
|
1427
1427
|
"comment",
|
|
1428
1428
|
"string",
|
|
1429
1429
|
"tag",
|
|
@@ -1432,19 +1432,19 @@ const un = /(\/\/[^\n]*)|("[^"]*"|'[^']*'|`[^`]*`)|(<\/?[A-Za-z][\w.-]*)|([\w-]+
|
|
|
1432
1432
|
"number",
|
|
1433
1433
|
"punct"
|
|
1434
1434
|
];
|
|
1435
|
-
function
|
|
1435
|
+
function wn(e) {
|
|
1436
1436
|
const t = [];
|
|
1437
1437
|
let n = 0;
|
|
1438
|
-
for (const a of e.matchAll(
|
|
1438
|
+
for (const a of e.matchAll(bn)) {
|
|
1439
1439
|
const o = a.index;
|
|
1440
1440
|
if (o === void 0) continue;
|
|
1441
1441
|
o > n && t.push({ kind: "plain", text: e.slice(n, o) });
|
|
1442
|
-
const i =
|
|
1442
|
+
const i = vn.find((l, r) => a[r + 1] !== void 0) ?? "plain";
|
|
1443
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
|
}
|
|
1447
|
-
const
|
|
1447
|
+
const yn = I({
|
|
1448
1448
|
name: "CodeBlock",
|
|
1449
1449
|
category: "display",
|
|
1450
1450
|
summary: "A snippet of code with a caption band and a copy control. In agent view the snippet is carried verbatim as the code part, so an agent reads the source instead of the highlighting.",
|
|
@@ -1514,16 +1514,16 @@ const mn = q({
|
|
|
1514
1514
|
a11y: {
|
|
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
|
-
}),
|
|
1518
|
-
function
|
|
1519
|
-
const { code: t, caption: n, language: a = "tsx", copyLabel: o = "Copy", ...i } = e, l =
|
|
1520
|
-
|
|
1517
|
+
}), kn = 1200;
|
|
1518
|
+
function Sa(e) {
|
|
1519
|
+
const { code: t, caption: n, language: a = "tsx", copyLabel: o = "Copy", ...i } = e, l = q(), [r, d] = Y(!1);
|
|
1520
|
+
j(() => {
|
|
1521
1521
|
if (!r) return;
|
|
1522
|
-
const
|
|
1523
|
-
return () => clearTimeout(
|
|
1522
|
+
const h = setTimeout(() => d(!1), kn);
|
|
1523
|
+
return () => clearTimeout(h);
|
|
1524
1524
|
}, [r]);
|
|
1525
|
-
const c = n ?? a, p = r ? "Copied" : o,
|
|
1526
|
-
component:
|
|
1525
|
+
const c = n ?? a, p = r ? "Copied" : o, u = R({
|
|
1526
|
+
component: yn.name,
|
|
1527
1527
|
label: c,
|
|
1528
1528
|
state: {
|
|
1529
1529
|
language: a,
|
|
@@ -1536,15 +1536,15 @@ function ha(e) {
|
|
|
1536
1536
|
{ part: "code", label: t, state: {} }
|
|
1537
1537
|
]
|
|
1538
1538
|
});
|
|
1539
|
-
if (l === "agent") return /* @__PURE__ */ s(U, { node:
|
|
1539
|
+
if (l === "agent") return /* @__PURE__ */ s(U, { node: u });
|
|
1540
1540
|
const g = () => {
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1541
|
+
const h = navigator.clipboard;
|
|
1542
|
+
h !== void 0 && h.writeText(t).then(
|
|
1543
1543
|
() => d(!0),
|
|
1544
1544
|
() => d(!1)
|
|
1545
1545
|
);
|
|
1546
1546
|
};
|
|
1547
|
-
return /* @__PURE__ */ A("figure", { ...i, ...M(
|
|
1547
|
+
return /* @__PURE__ */ A("figure", { ...i, ...M(u), "aria-label": c, children: [
|
|
1548
1548
|
/* @__PURE__ */ A("header", { children: [
|
|
1549
1549
|
/* @__PURE__ */ s("span", { children: c }),
|
|
1550
1550
|
/* @__PURE__ */ s(
|
|
@@ -1558,17 +1558,17 @@ function ha(e) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
)
|
|
1560
1560
|
] }),
|
|
1561
|
-
/* @__PURE__ */ s("pre", { ...L({ part: "code", state: {} }), children: /* @__PURE__ */ s("code", { children:
|
|
1561
|
+
/* @__PURE__ */ s("pre", { ...L({ part: "code", state: {} }), children: /* @__PURE__ */ s("code", { children: wn(t).map((h, y) => /* @__PURE__ */ s(
|
|
1562
1562
|
"span",
|
|
1563
1563
|
{
|
|
1564
|
-
"data-sprint-token":
|
|
1565
|
-
children:
|
|
1564
|
+
"data-sprint-token": h.kind === "plain" ? void 0 : h.kind,
|
|
1565
|
+
children: h.text
|
|
1566
1566
|
},
|
|
1567
|
-
`${y}-${
|
|
1567
|
+
`${y}-${h.text}`
|
|
1568
1568
|
)) }) })
|
|
1569
1569
|
] });
|
|
1570
1570
|
}
|
|
1571
|
-
const
|
|
1571
|
+
const Tn = I({
|
|
1572
1572
|
name: "DescriptionList",
|
|
1573
1573
|
category: "display",
|
|
1574
1574
|
summary: "Labelled term–description pairs for the details of one thing: metadata, settings, profile fields.",
|
|
@@ -1628,26 +1628,26 @@ const bn = q({
|
|
|
1628
1628
|
notes: "Renders a native dl with an aria-label. Terms are dt elements and descriptions dd, so structure survives without styling."
|
|
1629
1629
|
}
|
|
1630
1630
|
});
|
|
1631
|
-
function
|
|
1632
|
-
const t =
|
|
1631
|
+
function xn(e) {
|
|
1632
|
+
const t = F(e.term), n = F(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: a = "Empty", ...o } = e, i =
|
|
1638
|
-
const
|
|
1636
|
+
function Pa(e) {
|
|
1637
|
+
const { label: t, items: n, emptyLabel: a = "Empty", ...o } = e, i = q(), l = n.length === 0, r = n.map((c, p) => {
|
|
1638
|
+
const u = xn(c);
|
|
1639
1639
|
return {
|
|
1640
1640
|
part: "item",
|
|
1641
1641
|
state: { index: String(p + 1) },
|
|
1642
|
-
...
|
|
1642
|
+
...u === void 0 ? {} : { label: u }
|
|
1643
1643
|
};
|
|
1644
1644
|
}), d = R({
|
|
1645
|
-
component:
|
|
1645
|
+
component: Tn.name,
|
|
1646
1646
|
label: t,
|
|
1647
1647
|
state: { items: String(n.length), empty: l },
|
|
1648
1648
|
parts: r
|
|
1649
1649
|
});
|
|
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(
|
|
1650
|
+
return i === "agent" ? /* @__PURE__ */ s(U, { node: d }) : /* @__PURE__ */ s("dl", { ...o, ...M(d), "aria-label": t, children: l ? /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s("span", { children: a }) }) : n.map((c, p) => /* @__PURE__ */ A(
|
|
1651
1651
|
"div",
|
|
1652
1652
|
{
|
|
1653
1653
|
...L({
|
|
@@ -1659,10 +1659,10 @@ function ua(e) {
|
|
|
1659
1659
|
/* @__PURE__ */ s("dd", { children: c.description })
|
|
1660
1660
|
]
|
|
1661
1661
|
},
|
|
1662
|
-
`${p}-${String(
|
|
1662
|
+
`${p}-${String(F(c.term))}`
|
|
1663
1663
|
)) });
|
|
1664
1664
|
}
|
|
1665
|
-
const
|
|
1665
|
+
const kt = {
|
|
1666
1666
|
verb: "close",
|
|
1667
1667
|
description: "Close this dialog without taking its action, exactly as pressing its close control or Escape would. Anything entered inside the dialog may be discarded by the page. To take the dialog's action instead, use the tools its contents register while it is open.",
|
|
1668
1668
|
inputSchema: { type: "object", properties: {} },
|
|
@@ -1670,7 +1670,7 @@ const yt = {
|
|
|
1670
1670
|
untrustedContent: !0,
|
|
1671
1671
|
registeredWhen: "The dialog is open. A closed dialog renders nothing and has no tools.",
|
|
1672
1672
|
unregisteredWhen: "The dialog closes or unmounts."
|
|
1673
|
-
},
|
|
1673
|
+
}, An = I({
|
|
1674
1674
|
name: "Dialog",
|
|
1675
1675
|
category: "overlay",
|
|
1676
1676
|
summary: "A modal that interrupts the page for one decision: confirm a destructive action, complete a short step, acknowledge something before continuing.",
|
|
@@ -1724,7 +1724,7 @@ const yt = {
|
|
|
1724
1724
|
}
|
|
1725
1725
|
},
|
|
1726
1726
|
tools: {
|
|
1727
|
-
close:
|
|
1727
|
+
close: kt
|
|
1728
1728
|
},
|
|
1729
1729
|
agentView: {
|
|
1730
1730
|
example: '- **Dialog** "Revoke key" [open] with part `close` → tool `close-revoke-key`'
|
|
@@ -1759,7 +1759,7 @@ 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 Na(e) {
|
|
1763
1763
|
const {
|
|
1764
1764
|
label: t,
|
|
1765
1765
|
open: n,
|
|
@@ -1771,7 +1771,7 @@ function pa(e) {
|
|
|
1771
1771
|
children: d,
|
|
1772
1772
|
ref: c,
|
|
1773
1773
|
...p
|
|
1774
|
-
} = e,
|
|
1774
|
+
} = e, u = q(), g = G(), h = ke(), y = m(null), f = m(null), b = m(a);
|
|
1775
1775
|
b.current = a;
|
|
1776
1776
|
const w = m(n);
|
|
1777
1777
|
w.current = n;
|
|
@@ -1781,7 +1781,7 @@ function pa(e) {
|
|
|
1781
1781
|
},
|
|
1782
1782
|
[c]
|
|
1783
1783
|
);
|
|
1784
|
-
|
|
1784
|
+
j(() => {
|
|
1785
1785
|
if (!n) return;
|
|
1786
1786
|
const v = y.current;
|
|
1787
1787
|
if (v !== null)
|
|
@@ -1792,18 +1792,18 @@ function pa(e) {
|
|
|
1792
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
|
-
}, []),
|
|
1796
|
-
spec:
|
|
1795
|
+
}, []), O = V({
|
|
1796
|
+
spec: kt,
|
|
1797
1797
|
label: l ?? t,
|
|
1798
1798
|
enabled: r && n,
|
|
1799
1799
|
execute: C
|
|
1800
|
-
}),
|
|
1801
|
-
() => ({ path: [...
|
|
1802
|
-
[
|
|
1800
|
+
}), $ = ee(
|
|
1801
|
+
() => ({ path: [...h, t] }),
|
|
1802
|
+
[h, t]
|
|
1803
1803
|
);
|
|
1804
1804
|
if (!n) return null;
|
|
1805
1805
|
const E = R({
|
|
1806
|
-
component:
|
|
1806
|
+
component: An.name,
|
|
1807
1807
|
label: t,
|
|
1808
1808
|
owner: i,
|
|
1809
1809
|
region: !0,
|
|
@@ -1813,18 +1813,18 @@ function pa(e) {
|
|
|
1813
1813
|
part: "close",
|
|
1814
1814
|
label: "Close",
|
|
1815
1815
|
state: {},
|
|
1816
|
-
|
|
1816
|
+
...O === void 0 ? {} : { tool: O }
|
|
1817
1817
|
}
|
|
1818
1818
|
]
|
|
1819
1819
|
});
|
|
1820
|
-
if (
|
|
1820
|
+
if (u === "agent")
|
|
1821
1821
|
return /* @__PURE__ */ s(
|
|
1822
1822
|
we,
|
|
1823
1823
|
{
|
|
1824
1824
|
node: E,
|
|
1825
1825
|
isActionable: () => g !== "never",
|
|
1826
1826
|
onActivate: () => a(),
|
|
1827
|
-
children: /* @__PURE__ */ s(me, { value:
|
|
1827
|
+
children: /* @__PURE__ */ s(me, { value: $, children: d })
|
|
1828
1828
|
}
|
|
1829
1829
|
);
|
|
1830
1830
|
const S = o === void 0 ? "span" : `h${o}`;
|
|
@@ -1847,7 +1847,7 @@ function pa(e) {
|
|
|
1847
1847
|
...L({
|
|
1848
1848
|
part: "close",
|
|
1849
1849
|
state: {},
|
|
1850
|
-
|
|
1850
|
+
...O === void 0 ? {} : { tool: O }
|
|
1851
1851
|
}),
|
|
1852
1852
|
type: "button",
|
|
1853
1853
|
"aria-label": "Close",
|
|
@@ -1857,12 +1857,12 @@ function pa(e) {
|
|
|
1857
1857
|
}
|
|
1858
1858
|
)
|
|
1859
1859
|
] }),
|
|
1860
|
-
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(me, { value:
|
|
1860
|
+
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(me, { value: $, children: d }) })
|
|
1861
1861
|
]
|
|
1862
1862
|
}
|
|
1863
1863
|
);
|
|
1864
1864
|
}
|
|
1865
|
-
const
|
|
1865
|
+
const Cn = I({
|
|
1866
1866
|
name: "Heading",
|
|
1867
1867
|
category: "typography",
|
|
1868
1868
|
summary: "A section title, rendered as a real h element at the level you pick so it joins the document outline.",
|
|
@@ -1904,17 +1904,17 @@ const yn = q({
|
|
|
1904
1904
|
}
|
|
1905
1905
|
]
|
|
1906
1906
|
});
|
|
1907
|
-
function
|
|
1908
|
-
const { level: t = 2, children: n, ...a } = e, o =
|
|
1909
|
-
component:
|
|
1910
|
-
label:
|
|
1907
|
+
function La(e) {
|
|
1908
|
+
const { level: t = 2, children: n, ...a } = e, o = q(), i = R({
|
|
1909
|
+
component: Cn.name,
|
|
1910
|
+
label: F(n),
|
|
1911
1911
|
state: { level: String(t) }
|
|
1912
1912
|
});
|
|
1913
1913
|
if (o === "agent") return /* @__PURE__ */ s(U, { node: i });
|
|
1914
1914
|
const l = `h${t}`;
|
|
1915
1915
|
return /* @__PURE__ */ s(l, { ...a, ...M(i), children: n });
|
|
1916
1916
|
}
|
|
1917
|
-
const
|
|
1917
|
+
const Sn = I({
|
|
1918
1918
|
name: "Image",
|
|
1919
1919
|
category: "display",
|
|
1920
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.",
|
|
@@ -2009,9 +2009,9 @@ const kn = q({
|
|
|
2009
2009
|
},
|
|
2010
2010
|
relatedComponents: ["Card", "Panel"]
|
|
2011
2011
|
});
|
|
2012
|
-
function
|
|
2013
|
-
const { src: t, alt: n, caption: a, ratio: o = "auto", fit: i = "cover", ...l } = e, r =
|
|
2014
|
-
component:
|
|
2012
|
+
function Ra(e) {
|
|
2013
|
+
const { src: t, alt: n, caption: a, ratio: o = "auto", fit: i = "cover", ...l } = e, r = q(), [d, c] = Y("loading"), p = n === "" && a === void 0, u = a === void 0 ? [] : [{ part: "caption", label: a, state: {} }], g = R({
|
|
2014
|
+
component: Sn.name,
|
|
2015
2015
|
label: n === "" ? void 0 : n,
|
|
2016
2016
|
state: {
|
|
2017
2017
|
src: t,
|
|
@@ -2020,10 +2020,10 @@ function ma(e) {
|
|
|
2020
2020
|
decorative: p,
|
|
2021
2021
|
status: r === "agent" ? void 0 : d
|
|
2022
2022
|
},
|
|
2023
|
-
parts:
|
|
2023
|
+
parts: u
|
|
2024
2024
|
});
|
|
2025
2025
|
if (r === "agent") return p ? null : /* @__PURE__ */ s(U, { node: g });
|
|
2026
|
-
const
|
|
2026
|
+
const h = d === "error" ? n === "" ? "Image unavailable" : n : "Loading";
|
|
2027
2027
|
return /* @__PURE__ */ A(
|
|
2028
2028
|
"figure",
|
|
2029
2029
|
{
|
|
@@ -2041,14 +2041,14 @@ function ma(e) {
|
|
|
2041
2041
|
onError: () => c("error")
|
|
2042
2042
|
}
|
|
2043
2043
|
),
|
|
2044
|
-
d === "ready" ? null : /* @__PURE__ */ s("span", { "aria-hidden": "true", children: /* @__PURE__ */ s("span", { children:
|
|
2044
|
+
d === "ready" ? null : /* @__PURE__ */ s("span", { "aria-hidden": "true", children: /* @__PURE__ */ s("span", { children: h }) })
|
|
2045
2045
|
] }),
|
|
2046
2046
|
a === void 0 ? null : /* @__PURE__ */ s("figcaption", { ...L({ part: "caption", state: {} }), children: a })
|
|
2047
2047
|
]
|
|
2048
2048
|
}
|
|
2049
2049
|
);
|
|
2050
2050
|
}
|
|
2051
|
-
const
|
|
2051
|
+
const Tt = {
|
|
2052
2052
|
verb: "open",
|
|
2053
2053
|
description: "Follow this link and load its destination, exactly as a person clicking it would. The current page is replaced, so anything unsaved on it is lost and any tool registered by this page stops existing.",
|
|
2054
2054
|
inputSchema: { type: "object", properties: {} },
|
|
@@ -2056,7 +2056,7 @@ const kt = {
|
|
|
2056
2056
|
untrustedContent: !0,
|
|
2057
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.",
|
|
2058
2058
|
unregisteredWhen: "The link unmounts or opts back out."
|
|
2059
|
-
},
|
|
2059
|
+
}, Pn = I({
|
|
2060
2060
|
name: "Link",
|
|
2061
2061
|
category: "navigation",
|
|
2062
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.",
|
|
@@ -2109,7 +2109,7 @@ const kt = {
|
|
|
2109
2109
|
}
|
|
2110
2110
|
},
|
|
2111
2111
|
tools: {
|
|
2112
|
-
open:
|
|
2112
|
+
open: Tt
|
|
2113
2113
|
},
|
|
2114
2114
|
agentView: {
|
|
2115
2115
|
example: '- **Link** "Button" [active, href=#/Button]'
|
|
@@ -2137,7 +2137,7 @@ const kt = {
|
|
|
2137
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."
|
|
2138
2138
|
}
|
|
2139
2139
|
});
|
|
2140
|
-
function
|
|
2140
|
+
function Oa(e) {
|
|
2141
2141
|
const {
|
|
2142
2142
|
href: t,
|
|
2143
2143
|
active: n = !1,
|
|
@@ -2148,32 +2148,32 @@ function fa(e) {
|
|
|
2148
2148
|
ref: r,
|
|
2149
2149
|
onClick: d,
|
|
2150
2150
|
...c
|
|
2151
|
-
} = e, p =
|
|
2151
|
+
} = e, p = q(), u = G(), g = m(null), h = B(
|
|
2152
2152
|
(C) => {
|
|
2153
2153
|
g.current = C, typeof r == "function" ? r(C) : r != null && (r.current = C);
|
|
2154
2154
|
},
|
|
2155
2155
|
[r]
|
|
2156
|
-
), y = i ??
|
|
2156
|
+
), y = i ?? F(l), f = B(() => {
|
|
2157
2157
|
const C = g.current;
|
|
2158
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}.`);
|
|
2159
2159
|
}, [t]), b = V({
|
|
2160
|
-
spec:
|
|
2160
|
+
spec: Tt,
|
|
2161
2161
|
label: y,
|
|
2162
2162
|
enabled: o,
|
|
2163
2163
|
execute: f
|
|
2164
2164
|
}), w = R({
|
|
2165
|
-
component:
|
|
2166
|
-
label:
|
|
2165
|
+
component: Pn.name,
|
|
2166
|
+
label: F(l),
|
|
2167
2167
|
tool: b,
|
|
2168
2168
|
state: { href: t, active: n, external: a }
|
|
2169
2169
|
}), T = a ? { target: "_blank", rel: "noreferrer noopener" } : { target: void 0, rel: void 0 };
|
|
2170
|
-
return p === "agent" ?
|
|
2171
|
-
|
|
2170
|
+
return p === "agent" ? u === "never" ? /* @__PURE__ */ s(U, { node: w }) : /* @__PURE__ */ s(
|
|
2171
|
+
ue,
|
|
2172
2172
|
{
|
|
2173
2173
|
node: w,
|
|
2174
2174
|
as: "a",
|
|
2175
2175
|
href: t,
|
|
2176
|
-
ref:
|
|
2176
|
+
ref: h,
|
|
2177
2177
|
onClick: d,
|
|
2178
2178
|
target: T.target,
|
|
2179
2179
|
rel: T.rel
|
|
@@ -2184,7 +2184,7 @@ function fa(e) {
|
|
|
2184
2184
|
...c,
|
|
2185
2185
|
...M(w),
|
|
2186
2186
|
href: t,
|
|
2187
|
-
ref:
|
|
2187
|
+
ref: h,
|
|
2188
2188
|
onClick: d,
|
|
2189
2189
|
"aria-current": n ? "page" : void 0,
|
|
2190
2190
|
target: T.target,
|
|
@@ -2193,7 +2193,7 @@ function fa(e) {
|
|
|
2193
2193
|
}
|
|
2194
2194
|
);
|
|
2195
2195
|
}
|
|
2196
|
-
const
|
|
2196
|
+
const Nn = I({
|
|
2197
2197
|
name: "List",
|
|
2198
2198
|
category: "display",
|
|
2199
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.",
|
|
@@ -2270,16 +2270,16 @@ const xn = q({
|
|
|
2270
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."
|
|
2271
2271
|
}
|
|
2272
2272
|
});
|
|
2273
|
-
function
|
|
2274
|
-
const { label: t, items: n, ordered: a = !1, emptyLabel: o = "Empty", ...i } = e, l =
|
|
2275
|
-
const
|
|
2273
|
+
function $a(e) {
|
|
2274
|
+
const { label: t, items: n, ordered: a = !1, emptyLabel: o = "Empty", ...i } = e, l = q(), r = n.length === 0, d = n.map((u, g) => {
|
|
2275
|
+
const h = F(u);
|
|
2276
2276
|
return {
|
|
2277
2277
|
part: "item",
|
|
2278
2278
|
state: { index: String(g + 1) },
|
|
2279
|
-
...
|
|
2279
|
+
...h === void 0 ? {} : { label: h }
|
|
2280
2280
|
};
|
|
2281
2281
|
}), c = R({
|
|
2282
|
-
component:
|
|
2282
|
+
component: Nn.name,
|
|
2283
2283
|
label: t,
|
|
2284
2284
|
state: { items: String(n.length), ordered: a, empty: r },
|
|
2285
2285
|
parts: d
|
|
@@ -2291,21 +2291,21 @@ function ba(e) {
|
|
|
2291
2291
|
...M(c),
|
|
2292
2292
|
role: "list",
|
|
2293
2293
|
"aria-label": t,
|
|
2294
|
-
children: r ? /* @__PURE__ */ s("li", { children: o }) : n.map((
|
|
2294
|
+
children: r ? /* @__PURE__ */ s("li", { children: o }) : n.map((u, g) => /* @__PURE__ */ s(
|
|
2295
2295
|
"li",
|
|
2296
2296
|
{
|
|
2297
2297
|
...L({
|
|
2298
2298
|
part: "item",
|
|
2299
2299
|
state: { index: String(g + 1) }
|
|
2300
2300
|
}),
|
|
2301
|
-
children: /* @__PURE__ */ s("span", { children:
|
|
2301
|
+
children: /* @__PURE__ */ s("span", { children: u })
|
|
2302
2302
|
},
|
|
2303
|
-
`${g}-${String(
|
|
2303
|
+
`${g}-${String(F(u))}`
|
|
2304
2304
|
))
|
|
2305
2305
|
}
|
|
2306
2306
|
);
|
|
2307
2307
|
}
|
|
2308
|
-
const
|
|
2308
|
+
const Ln = I({
|
|
2309
2309
|
name: "MetaLine",
|
|
2310
2310
|
category: "display",
|
|
2311
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.",
|
|
@@ -2356,11 +2356,11 @@ const An = q({
|
|
|
2356
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."
|
|
2357
2357
|
}
|
|
2358
2358
|
});
|
|
2359
|
-
function
|
|
2360
|
-
const { entries: t, ...n } = e, a =
|
|
2359
|
+
function Da(e) {
|
|
2360
|
+
const { entries: t, ...n } = e, a = q();
|
|
2361
2361
|
if (t.length === 0) return null;
|
|
2362
2362
|
const o = t.map((l) => `${l.term}: ${l.detail}`).join(" / "), i = R({
|
|
2363
|
-
component:
|
|
2363
|
+
component: Ln.name,
|
|
2364
2364
|
label: o,
|
|
2365
2365
|
state: { entries: String(t.length) }
|
|
2366
2366
|
});
|
|
@@ -2375,7 +2375,7 @@ function va(e) {
|
|
|
2375
2375
|
] })
|
|
2376
2376
|
] }, `${l.term}-${r}`)) });
|
|
2377
2377
|
}
|
|
2378
|
-
const
|
|
2378
|
+
const Rn = I({
|
|
2379
2379
|
name: "Nav",
|
|
2380
2380
|
category: "navigation",
|
|
2381
2381
|
summary: "A labelled navigation landmark: the region that holds a page's links to elsewhere.",
|
|
@@ -2426,11 +2426,11 @@ const Cn = q({
|
|
|
2426
2426
|
}
|
|
2427
2427
|
]
|
|
2428
2428
|
});
|
|
2429
|
-
function
|
|
2430
|
-
const { label: t, children: n, ...a } = e, o =
|
|
2429
|
+
function Ea(e) {
|
|
2430
|
+
const { label: t, children: n, ...a } = e, o = q(), i = R({ component: Rn.name, label: t, region: !0 });
|
|
2431
2431
|
return o === "agent" ? /* @__PURE__ */ s(U, { node: i, children: n }) : /* @__PURE__ */ s("nav", { ...a, ...M(i), "aria-label": t, children: n });
|
|
2432
2432
|
}
|
|
2433
|
-
const
|
|
2433
|
+
const On = I({
|
|
2434
2434
|
name: "NavGroup",
|
|
2435
2435
|
category: "navigation",
|
|
2436
2436
|
summary: "A labelled cluster of links inside a Nav. The label names the group for screen readers and agents alike.",
|
|
@@ -2471,8 +2471,8 @@ const Sn = q({
|
|
|
2471
2471
|
}
|
|
2472
2472
|
]
|
|
2473
2473
|
});
|
|
2474
|
-
function
|
|
2475
|
-
const { label: t, children: n, ...a } = e, o =
|
|
2474
|
+
function Ma(e) {
|
|
2475
|
+
const { label: t, children: n, ...a } = e, o = q(), i = R({ component: On.name, label: t });
|
|
2476
2476
|
return o === "agent" ? /* @__PURE__ */ s(U, { node: i, children: n }) : (
|
|
2477
2477
|
// biome-ignore lint/a11y/useSemanticElements: the suggested fieldset groups form controls; this groups links, and group is the ARIA role for exactly that
|
|
2478
2478
|
/* @__PURE__ */ A("div", { ...a, ...M(i), role: "group", "aria-label": t, children: [
|
|
@@ -2481,7 +2481,7 @@ function ya(e) {
|
|
|
2481
2481
|
] })
|
|
2482
2482
|
);
|
|
2483
2483
|
}
|
|
2484
|
-
const
|
|
2484
|
+
const $n = I({
|
|
2485
2485
|
name: "PageHeader",
|
|
2486
2486
|
category: "layout",
|
|
2487
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.",
|
|
@@ -2534,9 +2534,9 @@ const Pn = q({
|
|
|
2534
2534
|
}
|
|
2535
2535
|
]
|
|
2536
2536
|
});
|
|
2537
|
-
function
|
|
2538
|
-
const { label: t, tags: n, actions: a, children: o, ...i } = e, l =
|
|
2539
|
-
component:
|
|
2537
|
+
function Ia(e) {
|
|
2538
|
+
const { label: t, tags: n, actions: a, children: o, ...i } = e, l = q(), r = R({
|
|
2539
|
+
component: $n.name,
|
|
2540
2540
|
label: t,
|
|
2541
2541
|
region: !0
|
|
2542
2542
|
});
|
|
@@ -2546,7 +2546,7 @@ function ka(e) {
|
|
|
2546
2546
|
a,
|
|
2547
2547
|
o
|
|
2548
2548
|
] });
|
|
2549
|
-
const d =
|
|
2549
|
+
const d = Je.toArray(o).length > 0;
|
|
2550
2550
|
return /* @__PURE__ */ A("header", { ...i, ...M(r), children: [
|
|
2551
2551
|
/* @__PURE__ */ A("div", { children: [
|
|
2552
2552
|
/* @__PURE__ */ A("div", { children: [
|
|
@@ -2558,7 +2558,7 @@ function ka(e) {
|
|
|
2558
2558
|
d ? /* @__PURE__ */ s("div", { children: o }) : null
|
|
2559
2559
|
] });
|
|
2560
2560
|
}
|
|
2561
|
-
const
|
|
2561
|
+
const Dn = I({
|
|
2562
2562
|
name: "Panel",
|
|
2563
2563
|
category: "layout",
|
|
2564
2564
|
summary: "A labelled region with a header band and an optional slot for the controls that act on it. Everything on a Sprint page lives inside one.",
|
|
@@ -2655,7 +2655,7 @@ const Nn = q({
|
|
|
2655
2655
|
}
|
|
2656
2656
|
]
|
|
2657
2657
|
});
|
|
2658
|
-
function
|
|
2658
|
+
function qa(e) {
|
|
2659
2659
|
const {
|
|
2660
2660
|
label: t,
|
|
2661
2661
|
headingLevel: n,
|
|
@@ -2664,8 +2664,8 @@ function Ta(e) {
|
|
|
2664
2664
|
emptyLabel: i = "Empty",
|
|
2665
2665
|
children: l,
|
|
2666
2666
|
...r
|
|
2667
|
-
} = e, d =
|
|
2668
|
-
component:
|
|
2667
|
+
} = e, d = q(), c = Je.toArray(l).length === 0, p = R({
|
|
2668
|
+
component: Dn.name,
|
|
2669
2669
|
label: t,
|
|
2670
2670
|
region: !0,
|
|
2671
2671
|
state: { flush: o, empty: c }
|
|
@@ -2675,16 +2675,16 @@ function Ta(e) {
|
|
|
2675
2675
|
a,
|
|
2676
2676
|
l
|
|
2677
2677
|
] });
|
|
2678
|
-
const
|
|
2678
|
+
const u = n === void 0 ? "span" : `h${n}`;
|
|
2679
2679
|
return /* @__PURE__ */ A("section", { ...r, ...M(p), "aria-label": t, children: [
|
|
2680
2680
|
/* @__PURE__ */ A("header", { children: [
|
|
2681
|
-
/* @__PURE__ */ s(
|
|
2681
|
+
/* @__PURE__ */ s(u, { children: t }),
|
|
2682
2682
|
a === void 0 ? null : /* @__PURE__ */ s("span", { children: a })
|
|
2683
2683
|
] }),
|
|
2684
2684
|
/* @__PURE__ */ s("div", { children: c ? /* @__PURE__ */ s("span", { children: i }) : l })
|
|
2685
2685
|
] });
|
|
2686
2686
|
}
|
|
2687
|
-
const
|
|
2687
|
+
const En = I({
|
|
2688
2688
|
name: "SecretField",
|
|
2689
2689
|
category: "display",
|
|
2690
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.",
|
|
@@ -2743,25 +2743,25 @@ const Ln = q({
|
|
|
2743
2743
|
a11y: {
|
|
2744
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."
|
|
2745
2745
|
}
|
|
2746
|
-
}),
|
|
2747
|
-
function
|
|
2748
|
-
const { label: t, value: n, hint: a, defaultRevealed: o = !1, ...i } = e, l =
|
|
2749
|
-
|
|
2746
|
+
}), Mn = "••••••••••••", In = 1200;
|
|
2747
|
+
function Ua(e) {
|
|
2748
|
+
const { label: t, value: n, hint: a, defaultRevealed: o = !1, ...i } = e, l = q(), [r, d] = Y(o), [c, p] = Y(!1);
|
|
2749
|
+
j(() => {
|
|
2750
2750
|
if (!c) return;
|
|
2751
|
-
const f = setTimeout(() => p(!1),
|
|
2751
|
+
const f = setTimeout(() => p(!1), In);
|
|
2752
2752
|
return () => clearTimeout(f);
|
|
2753
2753
|
}, [c]);
|
|
2754
|
-
const
|
|
2754
|
+
const u = () => {
|
|
2755
2755
|
const f = navigator.clipboard;
|
|
2756
2756
|
f !== void 0 && f.writeText(n).then(
|
|
2757
2757
|
() => p(!0),
|
|
2758
2758
|
() => p(!1)
|
|
2759
2759
|
);
|
|
2760
|
-
}, g = n !== "",
|
|
2761
|
-
component:
|
|
2760
|
+
}, g = n !== "", h = a === void 0 ? [] : [{ part: "hint", label: a, state: {} }], y = R({
|
|
2761
|
+
component: En.name,
|
|
2762
2762
|
label: t,
|
|
2763
2763
|
state: { filled: g, revealed: r },
|
|
2764
|
-
parts:
|
|
2764
|
+
parts: h
|
|
2765
2765
|
});
|
|
2766
2766
|
return l === "agent" ? /* @__PURE__ */ s(U, { node: y }) : /* @__PURE__ */ A("div", { ...i, ...M(y), children: [
|
|
2767
2767
|
/* @__PURE__ */ s("span", { ...L({ part: "label", state: {} }), children: t }),
|
|
@@ -2771,7 +2771,7 @@ function xa(e) {
|
|
|
2771
2771
|
{
|
|
2772
2772
|
...L({ part: "value", state: {} }),
|
|
2773
2773
|
"aria-label": r ? void 0 : "Hidden secret",
|
|
2774
|
-
children: r ? n :
|
|
2774
|
+
children: r ? n : Mn
|
|
2775
2775
|
}
|
|
2776
2776
|
),
|
|
2777
2777
|
/* @__PURE__ */ s(
|
|
@@ -2792,7 +2792,7 @@ function xa(e) {
|
|
|
2792
2792
|
state: c ? { copied: !0 } : {}
|
|
2793
2793
|
}),
|
|
2794
2794
|
type: "button",
|
|
2795
|
-
onClick:
|
|
2795
|
+
onClick: u,
|
|
2796
2796
|
children: c ? "Copied" : "Copy"
|
|
2797
2797
|
}
|
|
2798
2798
|
)
|
|
@@ -2817,7 +2817,7 @@ const ie = {
|
|
|
2817
2817
|
untrustedContent: !0,
|
|
2818
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.",
|
|
2819
2819
|
unregisteredWhen: "The control unmounts or becomes disabled."
|
|
2820
|
-
},
|
|
2820
|
+
}, He = I({
|
|
2821
2821
|
name: "SegmentedControl",
|
|
2822
2822
|
category: "input",
|
|
2823
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.",
|
|
@@ -2916,7 +2916,7 @@ const ie = {
|
|
|
2916
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."
|
|
2917
2917
|
}
|
|
2918
2918
|
});
|
|
2919
|
-
function
|
|
2919
|
+
function qn(e) {
|
|
2920
2920
|
const t = ie.inputSchema.properties.option;
|
|
2921
2921
|
return {
|
|
2922
2922
|
...ie.inputSchema,
|
|
@@ -2926,7 +2926,7 @@ function On(e) {
|
|
|
2926
2926
|
}
|
|
2927
2927
|
};
|
|
2928
2928
|
}
|
|
2929
|
-
function
|
|
2929
|
+
function Wa(e) {
|
|
2930
2930
|
const {
|
|
2931
2931
|
label: t,
|
|
2932
2932
|
options: n,
|
|
@@ -2936,14 +2936,14 @@ function Aa(e) {
|
|
|
2936
2936
|
agentName: l,
|
|
2937
2937
|
agentTool: r = !0,
|
|
2938
2938
|
...d
|
|
2939
|
-
} = e, c =
|
|
2940
|
-
|
|
2939
|
+
} = e, c = q(), p = G(), u = H(), g = m(/* @__PURE__ */ new Map()), h = m(o);
|
|
2940
|
+
h.current = o;
|
|
2941
2941
|
const y = m(n);
|
|
2942
2942
|
y.current = n;
|
|
2943
|
-
const f = m(
|
|
2944
|
-
f.current =
|
|
2945
|
-
const b = m(R({ component:
|
|
2946
|
-
|
|
2943
|
+
const f = m(u);
|
|
2944
|
+
f.current = u;
|
|
2945
|
+
const b = m(R({ component: He.name })), w = m(!0);
|
|
2946
|
+
j(() => (w.current = !0, () => {
|
|
2947
2947
|
w.current = !1;
|
|
2948
2948
|
}), []);
|
|
2949
2949
|
const T = B((k) => {
|
|
@@ -2952,7 +2952,7 @@ function Aa(e) {
|
|
|
2952
2952
|
x.click();
|
|
2953
2953
|
return;
|
|
2954
2954
|
}
|
|
2955
|
-
z(() =>
|
|
2955
|
+
z(() => h.current(k));
|
|
2956
2956
|
}, []), C = B(
|
|
2957
2957
|
async (k) => {
|
|
2958
2958
|
const x = typeof k.option == "string" ? k.option : "", D = y.current, N = D.find((P) => P.label === x);
|
|
@@ -2960,10 +2960,10 @@ function Aa(e) {
|
|
|
2960
2960
|
${f.current([b.current])}` : "The selection removed this control from the page.");
|
|
2961
2961
|
},
|
|
2962
2962
|
[T]
|
|
2963
|
-
),
|
|
2963
|
+
), O = ee(() => qn(n), [n]), $ = V({
|
|
2964
2964
|
spec: ie,
|
|
2965
2965
|
label: l ?? t,
|
|
2966
|
-
inputSchema:
|
|
2966
|
+
inputSchema: O,
|
|
2967
2967
|
enabled: r && !i,
|
|
2968
2968
|
execute: C
|
|
2969
2969
|
}), E = n.map((k) => ({
|
|
@@ -2974,17 +2974,17 @@ ${f.current([b.current])}` : "The selection removed this control from the page."
|
|
|
2974
2974
|
...i ? { disabled: !0 } : {}
|
|
2975
2975
|
}
|
|
2976
2976
|
})), S = R({
|
|
2977
|
-
component:
|
|
2977
|
+
component: He.name,
|
|
2978
2978
|
label: t,
|
|
2979
|
-
tool:
|
|
2979
|
+
tool: $,
|
|
2980
2980
|
state: { value: a, disabled: i },
|
|
2981
2981
|
parts: E
|
|
2982
2982
|
});
|
|
2983
2983
|
b.current = S;
|
|
2984
2984
|
const v = (k) => {
|
|
2985
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,
|
|
2987
|
-
|
|
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, _ = n[P];
|
|
2987
|
+
_ !== void 0 && (k.preventDefault(), g.current.get(_.value)?.focus(), T(_.value));
|
|
2988
2988
|
};
|
|
2989
2989
|
return c === "agent" ? i || p === "never" ? /* @__PURE__ */ s(U, { node: S }) : /* @__PURE__ */ s(
|
|
2990
2990
|
we,
|
|
@@ -3043,7 +3043,7 @@ const re = {
|
|
|
3043
3043
|
untrustedContent: !0,
|
|
3044
3044
|
registeredWhen: "The dropdown is mounted, enabled, has a resolvable label, and no other component claims the same tool name. The registered schema enumerates the current option labels.",
|
|
3045
3045
|
unregisteredWhen: "The dropdown unmounts or becomes disabled."
|
|
3046
|
-
}, Ge =
|
|
3046
|
+
}, Ge = I({
|
|
3047
3047
|
name: "Select",
|
|
3048
3048
|
category: "input",
|
|
3049
3049
|
summary: "A dropdown of mutually exclusive options behind a native select, carrying its own label, hint, and error. It registers a single select tool whose schema enumerates the option labels currently on offer.",
|
|
@@ -3191,18 +3191,18 @@ const re = {
|
|
|
3191
3191
|
notes: "A native select element, so the platform owns the listbox interaction. The label is associated via htmlFor; errors set aria-invalid and link with aria-describedby."
|
|
3192
3192
|
}
|
|
3193
3193
|
});
|
|
3194
|
-
function
|
|
3194
|
+
function xt(e, t) {
|
|
3195
3195
|
const n = e instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, a = Object.getOwnPropertyDescriptor(n, "value")?.set;
|
|
3196
3196
|
a !== void 0 && (a.call(e, t), e.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
3197
3197
|
}
|
|
3198
|
-
function
|
|
3198
|
+
function Un(e, t) {
|
|
3199
3199
|
const n = Object.getOwnPropertyDescriptor(
|
|
3200
3200
|
HTMLSelectElement.prototype,
|
|
3201
3201
|
"value"
|
|
3202
3202
|
)?.set;
|
|
3203
3203
|
n !== void 0 && (n.call(e, t), e.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
3204
3204
|
}
|
|
3205
|
-
function
|
|
3205
|
+
function Wn(e) {
|
|
3206
3206
|
const t = re.inputSchema.properties.option;
|
|
3207
3207
|
return {
|
|
3208
3208
|
...re.inputSchema,
|
|
@@ -3212,10 +3212,10 @@ function En(e) {
|
|
|
3212
3212
|
}
|
|
3213
3213
|
};
|
|
3214
3214
|
}
|
|
3215
|
-
function
|
|
3215
|
+
function Bn(e, t) {
|
|
3216
3216
|
return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
|
|
3217
3217
|
}
|
|
3218
|
-
function
|
|
3218
|
+
function Ba(e) {
|
|
3219
3219
|
const {
|
|
3220
3220
|
label: t,
|
|
3221
3221
|
options: n,
|
|
@@ -3227,36 +3227,36 @@ function Ca(e) {
|
|
|
3227
3227
|
name: d,
|
|
3228
3228
|
disabled: c = !1,
|
|
3229
3229
|
required: p = !1,
|
|
3230
|
-
agentName:
|
|
3230
|
+
agentName: u,
|
|
3231
3231
|
agentTool: g = !0,
|
|
3232
|
-
...
|
|
3233
|
-
} = e, y =
|
|
3232
|
+
...h
|
|
3233
|
+
} = e, y = q(), f = G(), b = H(), w = le(), T = m(null), C = m(o);
|
|
3234
3234
|
C.current = o;
|
|
3235
|
-
const
|
|
3236
|
-
|
|
3237
|
-
const
|
|
3238
|
-
|
|
3235
|
+
const O = m(n);
|
|
3236
|
+
O.current = n;
|
|
3237
|
+
const $ = m(b);
|
|
3238
|
+
$.current = b;
|
|
3239
3239
|
const E = m(R({ component: Ge.name })), S = m(!0);
|
|
3240
|
-
|
|
3240
|
+
j(() => (S.current = !0, () => {
|
|
3241
3241
|
S.current = !1;
|
|
3242
3242
|
}), []);
|
|
3243
3243
|
const v = B((W) => {
|
|
3244
3244
|
const X = T.current;
|
|
3245
3245
|
if (X !== null) {
|
|
3246
|
-
|
|
3246
|
+
Un(X, W);
|
|
3247
3247
|
return;
|
|
3248
3248
|
}
|
|
3249
3249
|
z(() => C.current(W));
|
|
3250
3250
|
}, []), k = B(
|
|
3251
3251
|
async (W) => {
|
|
3252
|
-
const X = typeof W.option == "string" ? W.option : "", oe =
|
|
3252
|
+
const X = typeof W.option == "string" ? W.option : "", oe = O.current, Me = oe.find((Te) => Te.label === X);
|
|
3253
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:
|
|
3254
|
-
${
|
|
3254
|
+
${$.current([E.current])}` : "The selection removed this dropdown from the page.");
|
|
3255
3255
|
},
|
|
3256
3256
|
[v]
|
|
3257
|
-
), x = ee(() =>
|
|
3257
|
+
), x = ee(() => Wn(n), [n]), D = V({
|
|
3258
3258
|
spec: re,
|
|
3259
|
-
label:
|
|
3259
|
+
label: u ?? t,
|
|
3260
3260
|
inputSchema: x,
|
|
3261
3261
|
enabled: g && !c,
|
|
3262
3262
|
execute: k
|
|
@@ -3267,7 +3267,7 @@ ${O.current([E.current])}` : "The selection removed this dropdown from the page.
|
|
|
3267
3267
|
...W.value === a ? { checked: !0 } : {},
|
|
3268
3268
|
...c ? { disabled: !0 } : {}
|
|
3269
3269
|
}
|
|
3270
|
-
})),
|
|
3270
|
+
})), _ = R({
|
|
3271
3271
|
component: Ge.name,
|
|
3272
3272
|
label: t,
|
|
3273
3273
|
tool: D,
|
|
@@ -3278,13 +3278,13 @@ ${O.current([E.current])}` : "The selection removed this dropdown from the page.
|
|
|
3278
3278
|
required: p,
|
|
3279
3279
|
invalid: r !== void 0
|
|
3280
3280
|
},
|
|
3281
|
-
parts: [...P, ...
|
|
3281
|
+
parts: [...P, ...Bn(r, l)]
|
|
3282
3282
|
});
|
|
3283
|
-
if (E.current =
|
|
3284
|
-
return c || f === "never" ? /* @__PURE__ */ s(U, { node:
|
|
3283
|
+
if (E.current = _, y === "agent")
|
|
3284
|
+
return c || f === "never" ? /* @__PURE__ */ s(U, { node: _ }) : /* @__PURE__ */ s(
|
|
3285
3285
|
we,
|
|
3286
3286
|
{
|
|
3287
|
-
node:
|
|
3287
|
+
node: _,
|
|
3288
3288
|
isActionable: (W) => W.part === "option",
|
|
3289
3289
|
onActivate: (W, X) => {
|
|
3290
3290
|
const oe = n[X];
|
|
@@ -3293,7 +3293,7 @@ ${O.current([E.current])}` : "The selection removed this dropdown from the page.
|
|
|
3293
3293
|
}
|
|
3294
3294
|
);
|
|
3295
3295
|
const J = r !== void 0 ? `${w}-error` : l !== void 0 ? `${w}-hint` : void 0;
|
|
3296
|
-
return /* @__PURE__ */ A("div", { ...
|
|
3296
|
+
return /* @__PURE__ */ A("div", { ...h, ...M(_), children: [
|
|
3297
3297
|
/* @__PURE__ */ s("label", { htmlFor: w, children: t }),
|
|
3298
3298
|
/* @__PURE__ */ s("span", { ...L({ part: "control", state: {} }), children: /* @__PURE__ */ A(
|
|
3299
3299
|
"select",
|
|
@@ -3329,7 +3329,7 @@ ${O.current([E.current])}` : "The selection removed this dropdown from the page.
|
|
|
3329
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
|
|
3330
3330
|
] });
|
|
3331
3331
|
}
|
|
3332
|
-
const
|
|
3332
|
+
const _n = I({
|
|
3333
3333
|
name: "Shell",
|
|
3334
3334
|
category: "layout",
|
|
3335
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.",
|
|
@@ -3401,7 +3401,7 @@ const qn = q({
|
|
|
3401
3401
|
}
|
|
3402
3402
|
]
|
|
3403
3403
|
});
|
|
3404
|
-
function
|
|
3404
|
+
function _a(e) {
|
|
3405
3405
|
const {
|
|
3406
3406
|
side: t,
|
|
3407
3407
|
bar: n,
|
|
@@ -3411,11 +3411,11 @@ function Sa(e) {
|
|
|
3411
3411
|
closeLabel: l = "Close",
|
|
3412
3412
|
children: r,
|
|
3413
3413
|
...d
|
|
3414
|
-
} = e, c =
|
|
3414
|
+
} = e, c = q(), [p, u] = Y(!1), g = le(), h = m(null), y = B((b) => {
|
|
3415
3415
|
const w = b.target;
|
|
3416
|
-
w instanceof Element && w.closest("a") !== null &&
|
|
3416
|
+
w instanceof Element && w.closest("a") !== null && u(!1);
|
|
3417
3417
|
}, []), f = R({
|
|
3418
|
-
component:
|
|
3418
|
+
component: _n.name,
|
|
3419
3419
|
region: !0,
|
|
3420
3420
|
state: { open: p }
|
|
3421
3421
|
});
|
|
@@ -3424,27 +3424,27 @@ function Sa(e) {
|
|
|
3424
3424
|
t,
|
|
3425
3425
|
r
|
|
3426
3426
|
] }) : /* @__PURE__ */ A("div", { ...d, ...M(f), children: [
|
|
3427
|
-
/* @__PURE__ */ s("button", { type: "button", onClick: () =>
|
|
3427
|
+
/* @__PURE__ */ s("button", { type: "button", onClick: () => h.current?.focus(), children: o }),
|
|
3428
3428
|
/* @__PURE__ */ A("aside", { "aria-label": a, children: [
|
|
3429
3429
|
/* @__PURE__ */ A("div", { children: [
|
|
3430
3430
|
n,
|
|
3431
3431
|
/* @__PURE__ */ s("span", { children: /* @__PURE__ */ s(
|
|
3432
|
-
|
|
3432
|
+
mn,
|
|
3433
3433
|
{
|
|
3434
3434
|
agentTool: !1,
|
|
3435
3435
|
"aria-expanded": p,
|
|
3436
3436
|
"aria-controls": g,
|
|
3437
|
-
onClick: () =>
|
|
3437
|
+
onClick: () => u(!p),
|
|
3438
3438
|
children: p ? l : i
|
|
3439
3439
|
}
|
|
3440
3440
|
) })
|
|
3441
3441
|
] }),
|
|
3442
3442
|
/* @__PURE__ */ s("div", { id: g, onClick: y, children: t })
|
|
3443
3443
|
] }),
|
|
3444
|
-
/* @__PURE__ */ s("main", { ref:
|
|
3444
|
+
/* @__PURE__ */ s("main", { ref: h, tabIndex: -1, children: r })
|
|
3445
3445
|
] });
|
|
3446
3446
|
}
|
|
3447
|
-
const
|
|
3447
|
+
const jn = I({
|
|
3448
3448
|
name: "Stack",
|
|
3449
3449
|
category: "layout",
|
|
3450
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.",
|
|
@@ -3551,7 +3551,7 @@ const In = q({
|
|
|
3551
3551
|
}
|
|
3552
3552
|
]
|
|
3553
3553
|
});
|
|
3554
|
-
function
|
|
3554
|
+
function ja(e) {
|
|
3555
3555
|
const {
|
|
3556
3556
|
direction: t = "column",
|
|
3557
3557
|
gap: n = "normal",
|
|
@@ -3563,15 +3563,15 @@ function Pa(e) {
|
|
|
3563
3563
|
children: d,
|
|
3564
3564
|
style: c,
|
|
3565
3565
|
...p
|
|
3566
|
-
} = e,
|
|
3567
|
-
component:
|
|
3566
|
+
} = e, u = q(), g = R({
|
|
3567
|
+
component: jn.name,
|
|
3568
3568
|
state: { direction: t, gap: n, align: a, justify: o, wrap: i, collapse: l }
|
|
3569
3569
|
});
|
|
3570
|
-
if (
|
|
3571
|
-
const
|
|
3572
|
-
return /* @__PURE__ */ s("div", { ...p, ...M(g), style:
|
|
3570
|
+
if (u === "agent") return /* @__PURE__ */ s(Re, { children: d });
|
|
3571
|
+
const h = r === void 0 ? c : { ...c, "--sprint-stack-min": r };
|
|
3572
|
+
return /* @__PURE__ */ s("div", { ...p, ...M(g), style: h, children: d });
|
|
3573
3573
|
}
|
|
3574
|
-
const
|
|
3574
|
+
const At = {
|
|
3575
3575
|
verb: "set",
|
|
3576
3576
|
description: "Switch this setting on or off by stating the end state, exactly as a person clicking it would. The change takes effect immediately. Setting the state it already has succeeds and changes nothing, so the call is safe to retry. Returns the switch's state after the call.",
|
|
3577
3577
|
inputSchema: {
|
|
@@ -3588,7 +3588,7 @@ const xt = {
|
|
|
3588
3588
|
untrustedContent: !0,
|
|
3589
3589
|
registeredWhen: "The switch is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
|
|
3590
3590
|
unregisteredWhen: "The switch unmounts or becomes disabled."
|
|
3591
|
-
}, Ke =
|
|
3591
|
+
}, Ke = I({
|
|
3592
3592
|
name: "Switch",
|
|
3593
3593
|
category: "input",
|
|
3594
3594
|
summary: "An on/off setting that takes effect the moment it changes. It registers one set tool that takes the end state rather than toggling.",
|
|
@@ -3637,7 +3637,7 @@ const xt = {
|
|
|
3637
3637
|
}
|
|
3638
3638
|
},
|
|
3639
3639
|
tools: {
|
|
3640
|
-
set:
|
|
3640
|
+
set: At
|
|
3641
3641
|
},
|
|
3642
3642
|
agentView: {
|
|
3643
3643
|
example: '- **Switch** "Live telemetry" [on] → tool `set-live-telemetry`'
|
|
@@ -3660,7 +3660,7 @@ const xt = {
|
|
|
3660
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."
|
|
3661
3661
|
}
|
|
3662
3662
|
});
|
|
3663
|
-
function
|
|
3663
|
+
function Va(e) {
|
|
3664
3664
|
const {
|
|
3665
3665
|
label: t,
|
|
3666
3666
|
on: n,
|
|
@@ -3670,7 +3670,7 @@ function Na(e) {
|
|
|
3670
3670
|
agentTool: l = !0,
|
|
3671
3671
|
ref: r,
|
|
3672
3672
|
...d
|
|
3673
|
-
} = e, c =
|
|
3673
|
+
} = e, c = q(), p = G(), u = H(), g = m(null), h = B(
|
|
3674
3674
|
(E) => {
|
|
3675
3675
|
g.current = E, typeof r == "function" ? r(E) : r != null && (r.current = E);
|
|
3676
3676
|
},
|
|
@@ -3679,10 +3679,10 @@ function Na(e) {
|
|
|
3679
3679
|
y.current = a;
|
|
3680
3680
|
const f = m(n);
|
|
3681
3681
|
f.current = n;
|
|
3682
|
-
const b = m(
|
|
3683
|
-
b.current =
|
|
3682
|
+
const b = m(u);
|
|
3683
|
+
b.current = u;
|
|
3684
3684
|
const w = m(R({ component: Ke.name })), T = m(!0);
|
|
3685
|
-
|
|
3685
|
+
j(() => (T.current = !0, () => {
|
|
3686
3686
|
T.current = !1;
|
|
3687
3687
|
}), []);
|
|
3688
3688
|
const C = B(async (E) => {
|
|
@@ -3696,27 +3696,27 @@ function Na(e) {
|
|
|
3696
3696
|
}
|
|
3697
3697
|
return await K(), T.current ? `${v ? `Already ${S ? "on" : "off"}` : `Switched ${S ? "on" : "off"}`}. The switch is now:
|
|
3698
3698
|
${b.current([w.current])}` : "The change removed this switch from the page.";
|
|
3699
|
-
}, []),
|
|
3700
|
-
spec:
|
|
3699
|
+
}, []), O = V({
|
|
3700
|
+
spec: At,
|
|
3701
3701
|
label: i ?? t,
|
|
3702
3702
|
enabled: l && !o,
|
|
3703
3703
|
execute: C
|
|
3704
|
-
}),
|
|
3704
|
+
}), $ = R({
|
|
3705
3705
|
component: Ke.name,
|
|
3706
3706
|
label: t,
|
|
3707
|
-
tool:
|
|
3707
|
+
tool: O,
|
|
3708
3708
|
state: { on: n, disabled: o }
|
|
3709
3709
|
});
|
|
3710
|
-
return w.current =
|
|
3710
|
+
return w.current = $, c === "agent" ? o || p === "never" ? /* @__PURE__ */ s(U, { node: $ }) : /* @__PURE__ */ s(ue, { node: $, ref: h, onClick: () => a(!n) }) : /* @__PURE__ */ A(
|
|
3711
3711
|
"button",
|
|
3712
3712
|
{
|
|
3713
3713
|
...d,
|
|
3714
|
-
...M(
|
|
3714
|
+
...M($),
|
|
3715
3715
|
type: "button",
|
|
3716
3716
|
role: "switch",
|
|
3717
3717
|
"aria-checked": n,
|
|
3718
3718
|
disabled: o,
|
|
3719
|
-
ref:
|
|
3719
|
+
ref: h,
|
|
3720
3720
|
onClick: () => a(!n),
|
|
3721
3721
|
children: [
|
|
3722
3722
|
/* @__PURE__ */ s(
|
|
@@ -3732,7 +3732,7 @@ ${b.current([w.current])}` : "The change removed this switch from the page.";
|
|
|
3732
3732
|
}
|
|
3733
3733
|
);
|
|
3734
3734
|
}
|
|
3735
|
-
const
|
|
3735
|
+
const Vn = I({
|
|
3736
3736
|
name: "Table",
|
|
3737
3737
|
category: "display",
|
|
3738
3738
|
summary: "A data grid built from columns and rows rather than from markup. In the agent stream it reads as a compact Markdown table; in the DOM each cell is addressable as a part carrying its column and row. On a narrow screen every row restacks into a labelled block instead of scrolling sideways.",
|
|
@@ -3826,35 +3826,35 @@ const Un = q({
|
|
|
3826
3826
|
function Le(e, t) {
|
|
3827
3827
|
return e.id ?? String(t + 1);
|
|
3828
3828
|
}
|
|
3829
|
-
function
|
|
3829
|
+
function Ct(e, t) {
|
|
3830
3830
|
return {
|
|
3831
3831
|
column: e.key,
|
|
3832
3832
|
row: t,
|
|
3833
3833
|
...e.align === void 0 ? {} : { align: e.align }
|
|
3834
3834
|
};
|
|
3835
3835
|
}
|
|
3836
|
-
function
|
|
3836
|
+
function Fn(e, t) {
|
|
3837
3837
|
return t.flatMap(
|
|
3838
3838
|
(n, a) => e.map((o) => {
|
|
3839
|
-
const i =
|
|
3839
|
+
const i = F(n.cells[o.key]);
|
|
3840
3840
|
return {
|
|
3841
3841
|
part: "cell",
|
|
3842
|
-
state:
|
|
3842
|
+
state: Ct(o, Le(n, a)),
|
|
3843
3843
|
...i === void 0 ? {} : { label: i }
|
|
3844
3844
|
};
|
|
3845
3845
|
})
|
|
3846
3846
|
);
|
|
3847
3847
|
}
|
|
3848
|
-
function
|
|
3849
|
-
const { label: t, columns: n, rows: a, emptyLabel: o = "No rows", ...i } = e, l =
|
|
3850
|
-
component:
|
|
3848
|
+
function Fa(e) {
|
|
3849
|
+
const { label: t, columns: n, rows: a, emptyLabel: o = "No rows", ...i } = e, l = q(), r = a.length === 0, d = R({
|
|
3850
|
+
component: Vn.name,
|
|
3851
3851
|
label: t,
|
|
3852
3852
|
state: {
|
|
3853
3853
|
columns: String(n.length),
|
|
3854
3854
|
rows: String(a.length),
|
|
3855
3855
|
empty: r
|
|
3856
3856
|
},
|
|
3857
|
-
parts:
|
|
3857
|
+
parts: Fn(n, a)
|
|
3858
3858
|
});
|
|
3859
3859
|
return l === "agent" ? /* @__PURE__ */ s(U, { node: ht(d) }) : /* @__PURE__ */ A("table", { ...i, ...M(d), role: "table", "aria-label": t, children: [
|
|
3860
3860
|
/* @__PURE__ */ s("thead", { role: "rowgroup", children: /* @__PURE__ */ s("tr", { role: "row", children: n.map((c) => /* @__PURE__ */ s(
|
|
@@ -3868,24 +3868,24 @@ function La(e) {
|
|
|
3868
3868
|
},
|
|
3869
3869
|
c.key
|
|
3870
3870
|
)) }) }),
|
|
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((
|
|
3871
|
+
/* @__PURE__ */ s("tbody", { role: "rowgroup", children: r ? /* @__PURE__ */ s("tr", { role: "row", children: /* @__PURE__ */ s("td", { role: "cell", colSpan: n.length, children: /* @__PURE__ */ s("span", { children: o }) }) }) : a.map((c, p) => /* @__PURE__ */ s("tr", { role: "row", children: n.map((u) => /* @__PURE__ */ A(
|
|
3872
3872
|
"td",
|
|
3873
3873
|
{
|
|
3874
3874
|
role: "cell",
|
|
3875
3875
|
...L({
|
|
3876
3876
|
part: "cell",
|
|
3877
|
-
state:
|
|
3877
|
+
state: Ct(u, Le(c, p))
|
|
3878
3878
|
}),
|
|
3879
3879
|
children: [
|
|
3880
|
-
/* @__PURE__ */ s("span", { "aria-hidden": "true", children:
|
|
3881
|
-
/* @__PURE__ */ s("div", { children: c.cells[
|
|
3880
|
+
/* @__PURE__ */ s("span", { "aria-hidden": "true", children: u.header }),
|
|
3881
|
+
/* @__PURE__ */ s("div", { children: c.cells[u.key] })
|
|
3882
3882
|
]
|
|
3883
3883
|
},
|
|
3884
|
-
|
|
3884
|
+
u.key
|
|
3885
3885
|
)) }, Le(c, p))) })
|
|
3886
3886
|
] });
|
|
3887
3887
|
}
|
|
3888
|
-
const
|
|
3888
|
+
const Hn = I({
|
|
3889
3889
|
name: "Tag",
|
|
3890
3890
|
category: "display",
|
|
3891
3891
|
summary: "A small chip that classifies the thing next to it: a status, a category, a count, a build string.",
|
|
@@ -3942,15 +3942,15 @@ const Bn = q({
|
|
|
3942
3942
|
}
|
|
3943
3943
|
]
|
|
3944
3944
|
});
|
|
3945
|
-
function
|
|
3946
|
-
const { tone: t = "neutral", filled: n = !1, children: a, ...o } = e, i =
|
|
3947
|
-
component:
|
|
3948
|
-
label:
|
|
3945
|
+
function Ha(e) {
|
|
3946
|
+
const { tone: t = "neutral", filled: n = !1, children: a, ...o } = e, i = q(), l = R({
|
|
3947
|
+
component: Hn.name,
|
|
3948
|
+
label: F(a),
|
|
3949
3949
|
state: { tone: t, filled: n }
|
|
3950
3950
|
});
|
|
3951
3951
|
return i === "agent" ? /* @__PURE__ */ s(U, { node: l }) : /* @__PURE__ */ s("span", { ...o, ...M(l), children: a });
|
|
3952
3952
|
}
|
|
3953
|
-
const
|
|
3953
|
+
const Gn = I({
|
|
3954
3954
|
name: "Text",
|
|
3955
3955
|
category: "typography",
|
|
3956
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.",
|
|
@@ -4016,15 +4016,15 @@ const jn = q({
|
|
|
4016
4016
|
}
|
|
4017
4017
|
]
|
|
4018
4018
|
});
|
|
4019
|
-
function
|
|
4020
|
-
const { tone: t = "default", size: n = "normal", as: a = "p", children: o, ...i } = e, l =
|
|
4021
|
-
component:
|
|
4022
|
-
label:
|
|
4019
|
+
function Ga(e) {
|
|
4020
|
+
const { tone: t = "default", size: n = "normal", as: a = "p", children: o, ...i } = e, l = q(), r = R({
|
|
4021
|
+
component: Gn.name,
|
|
4022
|
+
label: F(o),
|
|
4023
4023
|
state: { tone: t, size: n }
|
|
4024
4024
|
});
|
|
4025
4025
|
return l === "agent" ? /* @__PURE__ */ s(U, { node: r }) : /* @__PURE__ */ s(a, { ...i, ...M(r), children: o });
|
|
4026
4026
|
}
|
|
4027
|
-
const
|
|
4027
|
+
const St = {
|
|
4028
4028
|
verb: "fill",
|
|
4029
4029
|
description: "Replace this text area's content with the value provided, exactly as a person typing it would. The value is the full text it ends up containing, line breaks included; pass an empty string to clear it. Returns the area's state after the change, so a follow-up read is unnecessary.",
|
|
4030
4030
|
inputSchema: {
|
|
@@ -4041,7 +4041,7 @@ const Ct = {
|
|
|
4041
4041
|
untrustedContent: !0,
|
|
4042
4042
|
registeredWhen: "The area is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
|
|
4043
4043
|
unregisteredWhen: "The area unmounts or becomes disabled."
|
|
4044
|
-
}, ze =
|
|
4044
|
+
}, ze = I({
|
|
4045
4045
|
name: "Textarea",
|
|
4046
4046
|
category: "input",
|
|
4047
4047
|
summary: "A multi-line text area carrying its own label, hint, and error. Fully controlled, and it registers one fill tool that replaces the whole content with an explicit value, line breaks included.",
|
|
@@ -4128,7 +4128,7 @@ const Ct = {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
},
|
|
4130
4130
|
tools: {
|
|
4131
|
-
fill:
|
|
4131
|
+
fill: St
|
|
4132
4132
|
},
|
|
4133
4133
|
agentView: {
|
|
4134
4134
|
example: '- **Textarea** "Mission notes" [empty] → tool `fill-mission-notes`\n - part `hint` "What the relief crew needs to know"'
|
|
@@ -4163,10 +4163,10 @@ const Ct = {
|
|
|
4163
4163
|
notes: "The label element is associated via htmlFor. An error sets aria-invalid and is linked with aria-describedby, as is the hint."
|
|
4164
4164
|
}
|
|
4165
4165
|
});
|
|
4166
|
-
function
|
|
4166
|
+
function Kn(e, t) {
|
|
4167
4167
|
return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
|
|
4168
4168
|
}
|
|
4169
|
-
function
|
|
4169
|
+
function Ka(e) {
|
|
4170
4170
|
const {
|
|
4171
4171
|
label: t,
|
|
4172
4172
|
value: n,
|
|
@@ -4178,15 +4178,15 @@ function Oa(e) {
|
|
|
4178
4178
|
name: d,
|
|
4179
4179
|
disabled: c = !1,
|
|
4180
4180
|
required: p = !1,
|
|
4181
|
-
agentName:
|
|
4181
|
+
agentName: u,
|
|
4182
4182
|
agentTool: g = !0,
|
|
4183
|
-
...
|
|
4184
|
-
} = e, y =
|
|
4183
|
+
...h
|
|
4184
|
+
} = e, y = q(), f = G(), b = H(), w = le(), T = m(null), C = m(a);
|
|
4185
4185
|
C.current = a;
|
|
4186
|
-
const
|
|
4187
|
-
|
|
4188
|
-
const
|
|
4189
|
-
|
|
4186
|
+
const O = m(b);
|
|
4187
|
+
O.current = b;
|
|
4188
|
+
const $ = m(R({ component: ze.name })), E = m(!0);
|
|
4189
|
+
j(() => (E.current = !0, () => {
|
|
4190
4190
|
E.current = !1;
|
|
4191
4191
|
}), []);
|
|
4192
4192
|
const S = B(async (D) => {
|
|
@@ -4194,11 +4194,11 @@ function Oa(e) {
|
|
|
4194
4194
|
if (typeof N != "string")
|
|
4195
4195
|
return 'Pass "value" as a string holding the full text the area should contain.';
|
|
4196
4196
|
const P = T.current;
|
|
4197
|
-
return P !== null ?
|
|
4198
|
-
${
|
|
4197
|
+
return P !== null ? xt(P, N) : z(() => C.current(N)), await K(), E.current ? `Filled. The area is now:
|
|
4198
|
+
${O.current([$.current])}` : "The change removed this area from the page.";
|
|
4199
4199
|
}, []), v = V({
|
|
4200
|
-
spec:
|
|
4201
|
-
label:
|
|
4200
|
+
spec: St,
|
|
4201
|
+
label: u ?? t,
|
|
4202
4202
|
enabled: g && !c,
|
|
4203
4203
|
execute: S
|
|
4204
4204
|
}), k = R({
|
|
@@ -4212,11 +4212,11 @@ ${$.current([O.current])}` : "The change removed this area from the page.";
|
|
|
4212
4212
|
required: p,
|
|
4213
4213
|
invalid: r !== void 0
|
|
4214
4214
|
},
|
|
4215
|
-
parts:
|
|
4215
|
+
parts: Kn(r, l)
|
|
4216
4216
|
});
|
|
4217
|
-
if (
|
|
4217
|
+
if ($.current = k, y === "agent")
|
|
4218
4218
|
return c || f === "never" ? /* @__PURE__ */ s(U, { node: k }) : /* @__PURE__ */ s(
|
|
4219
|
-
|
|
4219
|
+
ut,
|
|
4220
4220
|
{
|
|
4221
4221
|
node: k,
|
|
4222
4222
|
value: n,
|
|
@@ -4228,7 +4228,7 @@ ${$.current([O.current])}` : "The change removed this area from the page.";
|
|
|
4228
4228
|
}
|
|
4229
4229
|
);
|
|
4230
4230
|
const x = r !== void 0 ? `${w}-error` : l !== void 0 ? `${w}-hint` : void 0;
|
|
4231
|
-
return /* @__PURE__ */ A("div", { ...
|
|
4231
|
+
return /* @__PURE__ */ A("div", { ...h, ...M(k), children: [
|
|
4232
4232
|
/* @__PURE__ */ s("label", { htmlFor: w, children: t }),
|
|
4233
4233
|
/* @__PURE__ */ s(
|
|
4234
4234
|
"textarea",
|
|
@@ -4252,7 +4252,7 @@ ${$.current([O.current])}` : "The change removed this area from the page.";
|
|
|
4252
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
|
|
4253
4253
|
] });
|
|
4254
4254
|
}
|
|
4255
|
-
const
|
|
4255
|
+
const Pt = {
|
|
4256
4256
|
verb: "fill",
|
|
4257
4257
|
description: "Replace this field's text with the value provided, exactly as a person typing it would. The value is the full text the field ends up containing; pass an empty string to clear it. Returns the field's state after the change, so a follow-up read is unnecessary.",
|
|
4258
4258
|
inputSchema: {
|
|
@@ -4269,7 +4269,7 @@ const St = {
|
|
|
4269
4269
|
untrustedContent: !0,
|
|
4270
4270
|
registeredWhen: "The field is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
|
|
4271
4271
|
unregisteredWhen: "The field unmounts or becomes disabled."
|
|
4272
|
-
}, Xe =
|
|
4272
|
+
}, Xe = I({
|
|
4273
4273
|
name: "TextInput",
|
|
4274
4274
|
category: "input",
|
|
4275
4275
|
summary: "A single-line text field carrying its own label, hint, and error. Fully controlled, and it registers one fill tool that replaces the field's text with an explicit value.",
|
|
@@ -4365,7 +4365,7 @@ const St = {
|
|
|
4365
4365
|
}
|
|
4366
4366
|
},
|
|
4367
4367
|
tools: {
|
|
4368
|
-
fill:
|
|
4368
|
+
fill: Pt
|
|
4369
4369
|
},
|
|
4370
4370
|
agentView: {
|
|
4371
4371
|
example: '- **TextInput** "Callsign" [empty, required] → tool `fill-callsign`\n - part `hint` "Uppercase, three to eight letters"'
|
|
@@ -4411,10 +4411,10 @@ const St = {
|
|
|
4411
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."
|
|
4412
4412
|
}
|
|
4413
4413
|
});
|
|
4414
|
-
function
|
|
4414
|
+
function zn(e, t) {
|
|
4415
4415
|
return e !== void 0 ? [{ part: "error", label: e, state: {} }] : t !== void 0 ? [{ part: "hint", label: t, state: {} }] : [];
|
|
4416
4416
|
}
|
|
4417
|
-
function
|
|
4417
|
+
function za(e) {
|
|
4418
4418
|
const {
|
|
4419
4419
|
label: t,
|
|
4420
4420
|
value: n,
|
|
@@ -4426,29 +4426,29 @@ function Da(e) {
|
|
|
4426
4426
|
name: d,
|
|
4427
4427
|
autoComplete: c,
|
|
4428
4428
|
disabled: p = !1,
|
|
4429
|
-
required:
|
|
4429
|
+
required: u = !1,
|
|
4430
4430
|
agentName: g,
|
|
4431
|
-
agentTool:
|
|
4431
|
+
agentTool: h = !0,
|
|
4432
4432
|
...y
|
|
4433
|
-
} = e, f =
|
|
4434
|
-
|
|
4435
|
-
const
|
|
4436
|
-
|
|
4433
|
+
} = e, f = q(), b = G(), w = H(), T = le(), C = m(null), O = m(a);
|
|
4434
|
+
O.current = a;
|
|
4435
|
+
const $ = m(w);
|
|
4436
|
+
$.current = w;
|
|
4437
4437
|
const E = m(R({ component: Xe.name })), S = m(!0);
|
|
4438
|
-
|
|
4438
|
+
j(() => (S.current = !0, () => {
|
|
4439
4439
|
S.current = !1;
|
|
4440
4440
|
}), []);
|
|
4441
4441
|
const v = o === "password", k = B(async (P) => {
|
|
4442
|
-
const
|
|
4443
|
-
if (typeof
|
|
4442
|
+
const _ = P.value;
|
|
4443
|
+
if (typeof _ != "string")
|
|
4444
4444
|
return 'Pass "value" as a string holding the full text the field should contain.';
|
|
4445
4445
|
const J = C.current;
|
|
4446
|
-
return J !== null ?
|
|
4447
|
-
${
|
|
4446
|
+
return J !== null ? xt(J, _) : z(() => O.current(_)), await K(), S.current ? `Filled. The field is now:
|
|
4447
|
+
${$.current([E.current])}` : "The change removed this field from the page.";
|
|
4448
4448
|
}, []), x = V({
|
|
4449
|
-
spec:
|
|
4449
|
+
spec: Pt,
|
|
4450
4450
|
label: g ?? t,
|
|
4451
|
-
enabled:
|
|
4451
|
+
enabled: h && !p,
|
|
4452
4452
|
execute: k
|
|
4453
4453
|
}), D = R({
|
|
4454
4454
|
component: Xe.name,
|
|
@@ -4458,14 +4458,14 @@ ${O.current([E.current])}` : "The change removed this field from the page.";
|
|
|
4458
4458
|
...v ? { filled: n !== "" } : n === "" ? {} : { value: n },
|
|
4459
4459
|
empty: n === "",
|
|
4460
4460
|
disabled: p,
|
|
4461
|
-
required:
|
|
4461
|
+
required: u,
|
|
4462
4462
|
invalid: r !== void 0
|
|
4463
4463
|
},
|
|
4464
|
-
parts:
|
|
4464
|
+
parts: zn(r, l)
|
|
4465
4465
|
});
|
|
4466
4466
|
if (E.current = D, f === "agent")
|
|
4467
4467
|
return p || b === "never" ? /* @__PURE__ */ s(U, { node: D }) : /* @__PURE__ */ s(
|
|
4468
|
-
|
|
4468
|
+
ut,
|
|
4469
4469
|
{
|
|
4470
4470
|
node: D,
|
|
4471
4471
|
value: n,
|
|
@@ -4493,7 +4493,7 @@ ${O.current([E.current])}` : "The change removed this field from the page.";
|
|
|
4493
4493
|
name: d,
|
|
4494
4494
|
autoComplete: c,
|
|
4495
4495
|
disabled: p,
|
|
4496
|
-
required:
|
|
4496
|
+
required: u,
|
|
4497
4497
|
"aria-invalid": r !== void 0 || void 0,
|
|
4498
4498
|
"aria-describedby": N,
|
|
4499
4499
|
onChange: (P) => a(P.currentTarget.value)
|
|
@@ -4503,35 +4503,35 @@ ${O.current([E.current])}` : "The change removed this field from the page.";
|
|
|
4503
4503
|
] });
|
|
4504
4504
|
}
|
|
4505
4505
|
const Ee = 40;
|
|
4506
|
-
function
|
|
4506
|
+
function Xn(e) {
|
|
4507
4507
|
const t = e.label === void 0 ? "" : Z(e.label), n = t === "" ? Z(e.component) : `${Z(e.component)}-${t}`;
|
|
4508
4508
|
return n === "" ? "region" : n;
|
|
4509
4509
|
}
|
|
4510
|
-
function
|
|
4510
|
+
function Yn(e) {
|
|
4511
4511
|
const t = /* @__PURE__ */ new Map();
|
|
4512
4512
|
return e.map((n) => {
|
|
4513
|
-
const a =
|
|
4513
|
+
const a = Xn(n), o = t.get(a) ?? 0;
|
|
4514
4514
|
return t.set(a, o + 1), { key: o === 0 ? a : `${a}-${o + 1}`, node: n };
|
|
4515
4515
|
});
|
|
4516
4516
|
}
|
|
4517
|
-
function
|
|
4517
|
+
function Nt() {
|
|
4518
4518
|
if (typeof document > "u") return [];
|
|
4519
|
-
const e = document.body, t = new Set(
|
|
4519
|
+
const e = document.body, t = new Set(mt(e)), n = Array.from(e.querySelectorAll(`[${$e}]`)).filter(
|
|
4520
4520
|
(a) => !t.has(a)
|
|
4521
4521
|
);
|
|
4522
|
-
return
|
|
4523
|
-
...
|
|
4522
|
+
return Yn([
|
|
4523
|
+
...dn(e),
|
|
4524
4524
|
...n.map((a) => De(a)).filter((a) => a !== null)
|
|
4525
4525
|
]);
|
|
4526
4526
|
}
|
|
4527
|
-
const
|
|
4527
|
+
const Jn = {
|
|
4528
4528
|
verb: "list",
|
|
4529
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.",
|
|
4530
4530
|
inputSchema: { type: "object", properties: {} },
|
|
4531
4531
|
readOnly: !0,
|
|
4532
4532
|
untrustedContent: !0,
|
|
4533
4533
|
registeredWhen: "A root SprintProvider is mounted and WebMCP is available."
|
|
4534
|
-
},
|
|
4534
|
+
}, Qn = {
|
|
4535
4535
|
verb: "read",
|
|
4536
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.",
|
|
4537
4537
|
inputSchema: {
|
|
@@ -4553,27 +4553,27 @@ const Gn = {
|
|
|
4553
4553
|
untrustedContent: !0,
|
|
4554
4554
|
registeredWhen: "A root SprintProvider is mounted and WebMCP is available."
|
|
4555
4555
|
};
|
|
4556
|
-
function
|
|
4557
|
-
const t =
|
|
4556
|
+
function Zn(e) {
|
|
4557
|
+
const t = Nt();
|
|
4558
4558
|
if (t.length === 0) return "This page has no Sprint components.";
|
|
4559
4559
|
const n = t.map(({ key: a, node: o }) => {
|
|
4560
|
-
const i =
|
|
4560
|
+
const i = at(o.children), l = e([{ ...o, children: [], parts: [] }]).split(`
|
|
4561
4561
|
`)[0]?.replace(/^-\s*/, ""), r = i === 0 ? "" : ` (${i} nested)`;
|
|
4562
4562
|
return `- \`${a}\` — ${l ?? o.component}${r}`;
|
|
4563
4563
|
});
|
|
4564
4564
|
return [`${t.length} region(s):`, ...n].join(`
|
|
4565
4565
|
`);
|
|
4566
4566
|
}
|
|
4567
|
-
function
|
|
4568
|
-
const a =
|
|
4567
|
+
function ea(e, t, n) {
|
|
4568
|
+
const a = Nt(), o = a.map((d) => d.key), i = a.find((d) => d.key === t);
|
|
4569
4569
|
if (i === void 0)
|
|
4570
4570
|
return `No region named "${String(t)}". Available regions: ${o.join(", ") || "none"}.`;
|
|
4571
|
-
const l =
|
|
4571
|
+
const l = tt(e([i.node]), te - Ee), r = typeof n == "number" ? n : 1;
|
|
4572
4572
|
return r < 1 || r > l.length ? `Region "${i.key}" has ${l.length} page(s); page ${r} does not exist.` : `${l[r - 1] ?? ""}
|
|
4573
4573
|
|
|
4574
4574
|
(page ${r} of ${l.length})`;
|
|
4575
4575
|
}
|
|
4576
|
-
const
|
|
4576
|
+
const ta = {
|
|
4577
4577
|
verb: "set",
|
|
4578
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.',
|
|
4579
4579
|
inputSchema: {
|
|
@@ -4591,45 +4591,86 @@ const Yn = {
|
|
|
4591
4591
|
untrustedContent: !0,
|
|
4592
4592
|
registeredWhen: "A root SprintProvider is mounted and WebMCP is available."
|
|
4593
4593
|
};
|
|
4594
|
-
function
|
|
4594
|
+
function Lt() {
|
|
4595
4595
|
return typeof document > "u" ? "" : (document.body.textContent ?? "").replace(/\n{3,}/g, `
|
|
4596
4596
|
|
|
4597
4597
|
`).trim();
|
|
4598
4598
|
}
|
|
4599
|
-
function
|
|
4599
|
+
function na(e) {
|
|
4600
4600
|
const { enabled: t, format: n, view: a, setView: o } = e;
|
|
4601
4601
|
V({
|
|
4602
|
-
spec:
|
|
4602
|
+
spec: Jn,
|
|
4603
4603
|
label: "page regions",
|
|
4604
4604
|
enabled: t,
|
|
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.' :
|
|
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)
|
|
4606
4606
|
}), V({
|
|
4607
|
-
spec:
|
|
4607
|
+
spec: Qn,
|
|
4608
4608
|
label: "region",
|
|
4609
4609
|
enabled: t,
|
|
4610
|
-
execute: (i) => a === "agent" ?
|
|
4610
|
+
execute: (i) => a === "agent" ? aa(i.region, i.page) : ea(n, i.region, i.page)
|
|
4611
4611
|
}), V({
|
|
4612
|
-
spec:
|
|
4612
|
+
spec: ta,
|
|
4613
4613
|
label: "page view",
|
|
4614
4614
|
enabled: t,
|
|
4615
4615
|
execute: async (i) => {
|
|
4616
4616
|
const l = i.view === "agent" ? "agent" : "human";
|
|
4617
4617
|
return z(() => o(l)), await K(), l === "agent" ? `Page is now in agent view:
|
|
4618
4618
|
|
|
4619
|
-
${Pe(
|
|
4619
|
+
${Pe(Lt(), te - Ee)}` : "Page is now in human view.";
|
|
4620
4620
|
}
|
|
4621
4621
|
});
|
|
4622
4622
|
}
|
|
4623
|
-
function
|
|
4623
|
+
function aa(e, t) {
|
|
4624
4624
|
if (e !== "page")
|
|
4625
4625
|
return `No region named "${String(e)}". In agent view the whole page is one region, named "page".`;
|
|
4626
|
-
const n =
|
|
4626
|
+
const n = tt(Lt(), te - Ee), a = typeof t == "number" ? t : 1;
|
|
4627
4627
|
return a < 1 || a > n.length ? `Region "page" has ${n.length} page(s); page ${a} does not exist.` : `${n[a - 1] ?? ""}
|
|
4628
4628
|
|
|
4629
4629
|
(page ${a} of ${n.length})`;
|
|
4630
4630
|
}
|
|
4631
|
-
const
|
|
4632
|
-
function
|
|
4631
|
+
const Rt = "--sprint-gloss-x", Ot = "--sprint-gloss-fade", $t = "--sprint-cast-shift", oa = 22, ia = 78, ra = 28, sa = 0.25, Ye = (e, t, n) => Math.min(n, Math.max(t, e));
|
|
4632
|
+
function la() {
|
|
4633
|
+
return typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4634
|
+
}
|
|
4635
|
+
const ca = /* @__PURE__ */ new Set([
|
|
4636
|
+
"Button",
|
|
4637
|
+
"Card",
|
|
4638
|
+
"Tag",
|
|
4639
|
+
"SegmentedControl",
|
|
4640
|
+
"Switch",
|
|
4641
|
+
"Shell"
|
|
4642
|
+
]), da = /* @__PURE__ */ new Set(["option", "thumb"]);
|
|
4643
|
+
function ua(e, t) {
|
|
4644
|
+
const n = e.closest("[data-sprint-part]");
|
|
4645
|
+
if (n === null || !t.contains(n)) return null;
|
|
4646
|
+
const a = n.dataset.sprintPart;
|
|
4647
|
+
return a !== void 0 && da.has(a) ? n : null;
|
|
4648
|
+
}
|
|
4649
|
+
function Dt(e) {
|
|
4650
|
+
if (!(e instanceof Element)) return null;
|
|
4651
|
+
const t = e.closest("[data-sprint]");
|
|
4652
|
+
if (t === null) return null;
|
|
4653
|
+
const n = t.dataset.sprint;
|
|
4654
|
+
return n === void 0 || !ca.has(n) ? null : ua(e, t) ?? t;
|
|
4655
|
+
}
|
|
4656
|
+
function ha(e) {
|
|
4657
|
+
if (e.pointerType === "touch" || la()) return;
|
|
4658
|
+
const t = Dt(e.target);
|
|
4659
|
+
if (t === null) return;
|
|
4660
|
+
const n = t.getBoundingClientRect();
|
|
4661
|
+
if (n.width === 0 || n.height === 0) return;
|
|
4662
|
+
const a = Ye((e.clientX - n.left) / n.width * 100, oa, ia), o = (a - 50) / ra;
|
|
4663
|
+
t.style.setProperty(Rt, `${a.toFixed(1)}%`), t.style.setProperty(
|
|
4664
|
+
Ot,
|
|
4665
|
+
Ye(1 - Math.abs(o), sa, 1).toFixed(3)
|
|
4666
|
+
), t.style.setProperty($t, `${(o * -10).toFixed(1)}px`);
|
|
4667
|
+
}
|
|
4668
|
+
function pa(e) {
|
|
4669
|
+
const t = Dt(e.target);
|
|
4670
|
+
t !== null && (t.style.removeProperty(Rt), t.style.removeProperty(Ot), t.style.removeProperty($t), t.style.length === 0 && t.removeAttribute("style"));
|
|
4671
|
+
}
|
|
4672
|
+
const ga = 1200;
|
|
4673
|
+
function Xa(e) {
|
|
4633
4674
|
const {
|
|
4634
4675
|
children: t,
|
|
4635
4676
|
label: n,
|
|
@@ -4640,32 +4681,32 @@ function Ea(e) {
|
|
|
4640
4681
|
onViewChange: r,
|
|
4641
4682
|
agentControls: d,
|
|
4642
4683
|
theme: c
|
|
4643
|
-
} = e, p = ke(),
|
|
4684
|
+
} = e, p = ke(), u = Zt(), g = !u.owned, [h, y] = Y(l ?? "human"), f = i !== void 0, b = f || g || l !== void 0, w = f ? i : b ? h : u.view, T = B(
|
|
4644
4685
|
(N) => {
|
|
4645
4686
|
if (!b) {
|
|
4646
|
-
|
|
4687
|
+
u.setView(N);
|
|
4647
4688
|
return;
|
|
4648
4689
|
}
|
|
4649
4690
|
f || y(N), r?.(N);
|
|
4650
4691
|
},
|
|
4651
|
-
[b, f,
|
|
4652
|
-
), C = d ??
|
|
4653
|
-
() => ({ view: w, setView: T, controls: C, format:
|
|
4654
|
-
[w, T, C,
|
|
4692
|
+
[b, f, u, r]
|
|
4693
|
+
), C = d ?? u.controls, O = a ?? u.format ?? lt, $ = ee(
|
|
4694
|
+
() => ({ view: w, setView: T, controls: C, format: O, owned: b }),
|
|
4695
|
+
[w, T, C, O, b]
|
|
4655
4696
|
), E = ee(
|
|
4656
4697
|
() => ({ path: n === void 0 ? p : [...p, n] }),
|
|
4657
4698
|
[p, n]
|
|
4658
4699
|
);
|
|
4659
|
-
|
|
4700
|
+
na({
|
|
4660
4701
|
enabled: g && o,
|
|
4661
|
-
format:
|
|
4702
|
+
format: O,
|
|
4662
4703
|
view: w,
|
|
4663
4704
|
setView: T
|
|
4664
4705
|
});
|
|
4665
4706
|
const S = m(null), [v, k] = Y(!1);
|
|
4666
|
-
|
|
4707
|
+
j(() => {
|
|
4667
4708
|
if (!v) return;
|
|
4668
|
-
const N = setTimeout(() => k(!1),
|
|
4709
|
+
const N = setTimeout(() => k(!1), ga);
|
|
4669
4710
|
return () => clearTimeout(N);
|
|
4670
4711
|
}, [v]);
|
|
4671
4712
|
const x = () => {
|
|
@@ -4679,13 +4720,13 @@ function Ea(e) {
|
|
|
4679
4720
|
() => k(!1)
|
|
4680
4721
|
);
|
|
4681
4722
|
};
|
|
4682
|
-
return /* @__PURE__ */ s(
|
|
4723
|
+
return /* @__PURE__ */ s(Qt, { value: $, children: /* @__PURE__ */ A(me, { value: E, children: [
|
|
4683
4724
|
b && w === "agent" && C !== "never" ? /* @__PURE__ */ s(
|
|
4684
4725
|
"button",
|
|
4685
4726
|
{
|
|
4686
4727
|
type: "button",
|
|
4687
4728
|
"aria-label": v ? "Copied" : "Copy agent view",
|
|
4688
|
-
[
|
|
4729
|
+
[Ut]: "",
|
|
4689
4730
|
...v ? { "data-sprint-copied": "" } : {},
|
|
4690
4731
|
onClick: x
|
|
4691
4732
|
}
|
|
@@ -4694,140 +4735,142 @@ function Ea(e) {
|
|
|
4694
4735
|
"div",
|
|
4695
4736
|
{
|
|
4696
4737
|
ref: S,
|
|
4697
|
-
|
|
4698
|
-
|
|
4738
|
+
onPointerMove: w === "agent" ? void 0 : ha,
|
|
4739
|
+
onPointerOut: w === "agent" ? void 0 : pa,
|
|
4740
|
+
[qt]: w,
|
|
4741
|
+
...c === void 0 ? {} : { [Wt]: c },
|
|
4699
4742
|
children: t
|
|
4700
4743
|
}
|
|
4701
4744
|
)
|
|
4702
4745
|
] }) });
|
|
4703
4746
|
}
|
|
4704
|
-
function
|
|
4747
|
+
function Ya(e) {
|
|
4705
4748
|
const { children: t, label: n } = e, a = ke(), o = ee(() => ({ path: [...a, n] }), [a, n]);
|
|
4706
4749
|
return /* @__PURE__ */ s(me, { value: o, children: t });
|
|
4707
4750
|
}
|
|
4708
|
-
const
|
|
4709
|
-
version:
|
|
4710
|
-
},
|
|
4751
|
+
const ma = "0.4.0", fa = {
|
|
4752
|
+
version: ma
|
|
4753
|
+
}, Ja = fa.version;
|
|
4711
4754
|
export {
|
|
4712
|
-
|
|
4713
|
-
|
|
4755
|
+
Ze as AGENT_ATTRIBUTE,
|
|
4756
|
+
ue as AgentControl,
|
|
4714
4757
|
we as AgentControlGroup,
|
|
4715
4758
|
U as AgentLine,
|
|
4716
|
-
|
|
4759
|
+
Ya as AgentRegion,
|
|
4717
4760
|
me as AgentScopeProvider,
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4761
|
+
xa as Alert,
|
|
4762
|
+
mn as Button,
|
|
4763
|
+
kt as CLOSE_DIALOG_TOOL,
|
|
4721
4764
|
Q as COMPONENT_ATTRIBUTE,
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4765
|
+
Aa as Card,
|
|
4766
|
+
Ca as Checkbox,
|
|
4767
|
+
Sa as CodeBlock,
|
|
4768
|
+
bt as DISMISS_ALERT_TOOL,
|
|
4769
|
+
Pa as DescriptionList,
|
|
4770
|
+
Na as Dialog,
|
|
4771
|
+
St as FILL_TEXTAREA_TOOL,
|
|
4772
|
+
Pt as FILL_TOOL,
|
|
4773
|
+
La as Heading,
|
|
4774
|
+
Ra as Image,
|
|
4775
|
+
Oa as Link,
|
|
4776
|
+
$a as List,
|
|
4777
|
+
Da as MetaLine,
|
|
4778
|
+
Ea as Nav,
|
|
4779
|
+
Ma as NavGroup,
|
|
4780
|
+
wt as OPEN_CARD_TOOL,
|
|
4781
|
+
Tt as OPEN_LINK_TOOL,
|
|
4782
|
+
Qe as OWNER_ATTRIBUTE,
|
|
4783
|
+
qe as PARAM_DESCRIPTION_LIMIT,
|
|
4741
4784
|
ae as PART_ATTRIBUTE,
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4785
|
+
vt as PRESS_TOOL,
|
|
4786
|
+
Ia as PageHeader,
|
|
4787
|
+
qa as Panel,
|
|
4788
|
+
$e as REGION_ATTRIBUTE,
|
|
4789
|
+
Bt as RESERVED_STATE_KEYS,
|
|
4747
4790
|
re as SELECT_OPTION_TOOL,
|
|
4748
4791
|
ie as SELECT_TOOL,
|
|
4749
|
-
|
|
4750
|
-
|
|
4792
|
+
yt as SET_CHECKBOX_TOOL,
|
|
4793
|
+
At as SET_SWITCH_TOOL,
|
|
4751
4794
|
pe as STATE_ATTRIBUTE_PREFIX,
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4795
|
+
Ua as SecretField,
|
|
4796
|
+
Wa as SegmentedControl,
|
|
4797
|
+
Ba as Select,
|
|
4798
|
+
_a as Shell,
|
|
4799
|
+
Xa as SprintProvider,
|
|
4800
|
+
ja as Stack,
|
|
4801
|
+
Va as Switch,
|
|
4802
|
+
Wt as THEME_ATTRIBUTE,
|
|
4760
4803
|
ce as TOOL_ATTRIBUTE,
|
|
4761
|
-
|
|
4762
|
-
|
|
4804
|
+
Ie as TOOL_DESCRIPTION_LIMIT,
|
|
4805
|
+
Ht as TOOL_NAMING_CONVENTION,
|
|
4763
4806
|
te as TOOL_OUTPUT_LIMIT,
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4807
|
+
Fa as Table,
|
|
4808
|
+
Ha as Tag,
|
|
4809
|
+
Ga as Text,
|
|
4810
|
+
za as TextInput,
|
|
4811
|
+
Ka as Textarea,
|
|
4812
|
+
qt as VIEW_ATTRIBUTE,
|
|
4813
|
+
Ut as VIEW_COPY_ATTRIBUTE,
|
|
4771
4814
|
ye as accessibleText,
|
|
4772
4815
|
K as afterCommit,
|
|
4773
|
-
|
|
4816
|
+
et as agentAttributes,
|
|
4774
4817
|
M as agentAttributesFor,
|
|
4775
4818
|
L as agentPartAttributesFor,
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4819
|
+
en as agentPartControlAttributes,
|
|
4820
|
+
ya as agentSelector,
|
|
4821
|
+
_e as alertMeta,
|
|
4822
|
+
Ta as buildAgentManifest,
|
|
4780
4823
|
R as buildAgentNode,
|
|
4781
|
-
|
|
4824
|
+
je as buttonMeta,
|
|
4782
4825
|
Ve as cardMeta,
|
|
4783
|
-
|
|
4826
|
+
Fe as checkboxMeta,
|
|
4784
4827
|
Pe as clamp,
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4828
|
+
yn as codeBlockMeta,
|
|
4829
|
+
lt as defaultAgentFormat,
|
|
4830
|
+
I as defineAgentMeta,
|
|
4831
|
+
Tn as descriptionListMeta,
|
|
4832
|
+
An as dialogMeta,
|
|
4833
|
+
Gt as getAgentMeta,
|
|
4834
|
+
nt as getModelContext,
|
|
4835
|
+
Cn as headingMeta,
|
|
4836
|
+
Sn as imageMeta,
|
|
4837
|
+
ka as isModelContextAvailable,
|
|
4838
|
+
Pn as linkMeta,
|
|
4839
|
+
Kt as listAgentMeta,
|
|
4840
|
+
Nn as listMeta,
|
|
4841
|
+
Ln as metaLineMeta,
|
|
4842
|
+
On as navGroupMeta,
|
|
4843
|
+
Rn as navMeta,
|
|
4844
|
+
Yt as nodeLine,
|
|
4845
|
+
$n as pageHeaderMeta,
|
|
4846
|
+
tt as paginate,
|
|
4847
|
+
Dn as panelMeta,
|
|
4848
|
+
F as reactText,
|
|
4849
|
+
Ft as registerTool,
|
|
4850
|
+
En as secretFieldMeta,
|
|
4851
|
+
He as segmentedControlMeta,
|
|
4809
4852
|
Ge as selectMeta,
|
|
4810
4853
|
De as serializeElement,
|
|
4811
|
-
|
|
4812
|
-
|
|
4854
|
+
dn as serializeWithin,
|
|
4855
|
+
_n as shellMeta,
|
|
4813
4856
|
Z as slug,
|
|
4814
|
-
|
|
4857
|
+
jn as stackMeta,
|
|
4815
4858
|
Ke as switchMeta,
|
|
4816
|
-
|
|
4817
|
-
|
|
4859
|
+
Vn as tableMeta,
|
|
4860
|
+
Hn as tagMeta,
|
|
4818
4861
|
Xe as textInputMeta,
|
|
4819
|
-
|
|
4862
|
+
Gn as textMeta,
|
|
4820
4863
|
ze as textareaMeta,
|
|
4821
|
-
|
|
4822
|
-
|
|
4864
|
+
Jt as toMarkdown,
|
|
4865
|
+
wn as tokenize,
|
|
4823
4866
|
We as toolName,
|
|
4824
4867
|
G as useAgentControls,
|
|
4825
|
-
|
|
4868
|
+
H as useAgentFormat,
|
|
4826
4869
|
ke as useAgentScope,
|
|
4827
4870
|
V as useAgentTool,
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4871
|
+
q as useSprintView,
|
|
4872
|
+
Zt as useSprintViewControl,
|
|
4873
|
+
jt as validateInputs,
|
|
4874
|
+
Ja as version
|
|
4832
4875
|
};
|
|
4833
4876
|
//# sourceMappingURL=index.js.map
|