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