@westonkd/sprint 0.1.1

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.
@@ -0,0 +1,2256 @@
1
+ {
2
+ "library": "sprint",
3
+ "version": "0.1.1",
4
+ "conventions": {
5
+ "componentAttribute": "data-sprint",
6
+ "partAttribute": "data-sprint-part",
7
+ "stateAttributePrefix": "data-sprint-",
8
+ "toolAttribute": "data-sprint-tool",
9
+ "ownerAttribute": "data-sprint-owner",
10
+ "regionAttribute": "data-sprint-region",
11
+ "agentViewFormat": "markdown",
12
+ "toolNaming": "<scope>-<verb>-<label-slug>",
13
+ "toolOutputLimit": 1500
14
+ },
15
+ "components": [
16
+ {
17
+ "name": "Alert",
18
+ "category": "feedback",
19
+ "summary": "A status message for the outcome of something that already happened: a notice, a warning, or a failure.",
20
+ "whenToUse": "Use to report the result of an action or a condition the person did not just cause: \"check your inbox\", \"invalid credentials\", \"this key expires soon\". Use tone=\"danger\" for failures, \"warning\" for conditions needing attention, \"info\" for neutral notices, and \"neutral\" for quiet confirmations. Pass onDismiss when the message can be acknowledged and cleared.",
21
+ "whenNotToUse": "Do not use for validation on a specific field; the field's own error prop places the message where the problem is. Do not use for confirmation of an action the person is about to take; that is a Dialog.",
22
+ "status": "experimental",
23
+ "props": {
24
+ "children": {
25
+ "kind": "node",
26
+ "description": "The message. Inline content only; it is flattened to text for the agent view.",
27
+ "required": true
28
+ },
29
+ "label": {
30
+ "kind": "string",
31
+ "description": "A short uppercase title above the message. Also derives the dismiss tool name, so prefer a stable phrase."
32
+ },
33
+ "tone": {
34
+ "kind": "enum",
35
+ "description": "The message's severity. Danger and warning announce assertively; info and neutral announce politely.",
36
+ "values": [
37
+ "neutral",
38
+ "info",
39
+ "warning",
40
+ "danger"
41
+ ],
42
+ "default": "info"
43
+ },
44
+ "onDismiss": {
45
+ "kind": "handler",
46
+ "description": "Called when the dismiss control is pressed. Providing it renders the control and registers the dismiss tool; the page owns removing the alert."
47
+ },
48
+ "agentName": {
49
+ "kind": "string",
50
+ "description": "Override the label used to derive the dismiss tool name. Required for a dismissible alert with no label."
51
+ },
52
+ "agentTool": {
53
+ "kind": "boolean",
54
+ "description": "Set false to render a dismissible alert without registering a tool.",
55
+ "default": true
56
+ }
57
+ },
58
+ "state": {
59
+ "tone": {
60
+ "description": "The alert's severity.",
61
+ "attribute": "data-sprint-tone",
62
+ "values": [
63
+ "neutral",
64
+ "info",
65
+ "warning",
66
+ "danger"
67
+ ]
68
+ },
69
+ "dismissible": {
70
+ "description": "Present when the alert has a dismiss control.",
71
+ "attribute": "data-sprint-dismissible"
72
+ }
73
+ },
74
+ "tools": {
75
+ "dismiss": {
76
+ "verb": "dismiss",
77
+ "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.",
78
+ "inputSchema": {
79
+ "type": "object",
80
+ "properties": {}
81
+ },
82
+ "readOnly": false,
83
+ "untrustedContent": true,
84
+ "registeredWhen": "The alert is mounted, has an onDismiss handler, and label or agentName provides a stable name.",
85
+ "unregisteredWhen": "The alert unmounts or loses its onDismiss handler."
86
+ }
87
+ },
88
+ "agentView": {
89
+ "example": "- **Alert** \"Check your inbox\" [dismissible, tone=info]"
90
+ },
91
+ "examples": [
92
+ {
93
+ "title": "A sign-in notice",
94
+ "description": "The default info tone for a neutral status message.",
95
+ "code": "<Alert label=\"Check your inbox\">We sent a sign-in link to nomad@escadrille.test.</Alert>"
96
+ },
97
+ {
98
+ "title": "A dismissible confirmation",
99
+ "description": "Providing onDismiss renders the dismiss control and registers the dismiss tool. Removing the alert is the page's job.",
100
+ "code": "<Alert tone=\"neutral\" label=\"Key revoked\" onDismiss={acknowledge}>The key can no longer authenticate.</Alert>"
101
+ },
102
+ {
103
+ "title": "A failure",
104
+ "description": "Danger announces assertively via role=alert.",
105
+ "code": "<Alert tone=\"danger\" label=\"Sign-in failed\">Wrong callsign or access code.</Alert>"
106
+ }
107
+ ],
108
+ "a11y": {
109
+ "role": "status",
110
+ "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."
111
+ }
112
+ },
113
+ {
114
+ "name": "Button",
115
+ "category": "action",
116
+ "summary": "A single action a person or an agent can trigger. Registers one press tool named from its own label.",
117
+ "whenToUse": "Use for any discrete action: submitting, confirming, dismissing, advancing a step. tone=\"action\" with block marks the one primary action in a view; tone=\"danger\" marks destructive actions.",
118
+ "whenNotToUse": "Do not use for navigation between pages; use a link. Do not use for toggling a persistent on/off state; that needs a switch or a checkbox.",
119
+ "status": "experimental",
120
+ "props": {
121
+ "children": {
122
+ "kind": "node",
123
+ "description": "The button label. Its text also derives the WebMCP tool name, so prefer a verb phrase like \"Prepare launch\" over \"OK\".",
124
+ "required": true
125
+ },
126
+ "tone": {
127
+ "kind": "enum",
128
+ "description": "Visual and semantic weight. Acid is rationed to one primary action per view.",
129
+ "values": [
130
+ "neutral",
131
+ "action",
132
+ "danger"
133
+ ],
134
+ "default": "neutral"
135
+ },
136
+ "block": {
137
+ "kind": "boolean",
138
+ "description": "Render as a full-width bar. Combine with tone=\"action\" for the primary action of a region.",
139
+ "default": false
140
+ },
141
+ "loading": {
142
+ "kind": "boolean",
143
+ "description": "Mark work in progress. Sets aria-busy, disables the control, and unregisters the press tool until it clears.",
144
+ "default": false
145
+ },
146
+ "disabled": {
147
+ "kind": "boolean",
148
+ "description": "Disable the control and unregister its press tool.",
149
+ "default": false
150
+ },
151
+ "agentName": {
152
+ "kind": "string",
153
+ "description": "Override the label used to derive the tool name. Set this on icon-only buttons, when two buttons would otherwise collide, and whenever the visible label contains changing values such as a count."
154
+ },
155
+ "agentTool": {
156
+ "kind": "boolean",
157
+ "description": "Set false to render the button without registering any WebMCP tool.",
158
+ "default": true
159
+ },
160
+ "onClick": {
161
+ "kind": "handler",
162
+ "description": "Standard click handler. The press tool dispatches a real click, so this runs for agent presses too."
163
+ }
164
+ },
165
+ "state": {
166
+ "tone": {
167
+ "description": "The button's current tone.",
168
+ "attribute": "data-sprint-tone",
169
+ "values": [
170
+ "neutral",
171
+ "action",
172
+ "danger"
173
+ ]
174
+ },
175
+ "block": {
176
+ "description": "Present when the button renders as a full-width bar.",
177
+ "attribute": "data-sprint-block"
178
+ },
179
+ "loading": {
180
+ "description": "Present while the button is busy.",
181
+ "attribute": "data-sprint-loading"
182
+ },
183
+ "disabled": {
184
+ "description": "Present when the button cannot be pressed.",
185
+ "attribute": "data-sprint-disabled"
186
+ }
187
+ },
188
+ "tools": {
189
+ "press": {
190
+ "verb": "press",
191
+ "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.",
192
+ "inputSchema": {
193
+ "type": "object",
194
+ "properties": {}
195
+ },
196
+ "readOnly": false,
197
+ "untrustedContent": true,
198
+ "registeredWhen": "The button is mounted, enabled, not loading, has a resolvable label, and no other component claims the same tool name.",
199
+ "unregisteredWhen": "The button unmounts, becomes disabled, or starts loading."
200
+ }
201
+ },
202
+ "agentView": {
203
+ "example": "- **Button** \"Prepare launch\" [tone=action] → tool `press-prepare-launch`"
204
+ },
205
+ "examples": [
206
+ {
207
+ "title": "Primary action",
208
+ "description": "The one rationed acid action bar for a view.",
209
+ "code": "<Button tone=\"action\" block onClick={prepare}>Prepare launch</Button>"
210
+ },
211
+ {
212
+ "title": "Destructive action",
213
+ "code": "<Button tone=\"danger\" onClick={purge}>Purge vault</Button>"
214
+ },
215
+ {
216
+ "title": "Busy state",
217
+ "description": "While loading the press tool is unregistered, so an agent cannot double-submit.",
218
+ "code": "<Button loading={saving} onClick={save}>Save loadout</Button>"
219
+ },
220
+ {
221
+ "title": "Disambiguating two identical labels",
222
+ "description": "Without agentName both buttons would claim press-save and neither would register a tool.",
223
+ "code": "<Button agentName=\"Save billing\">Save</Button>"
224
+ },
225
+ {
226
+ "title": "Keeping the tool name stable under a changing label",
227
+ "description": "A label carrying a value would otherwise rename the tool on every change, churning registration and staling any name an agent already holds.",
228
+ "code": "<Button agentName=\"Increment\">Increment ({count})</Button>"
229
+ }
230
+ ],
231
+ "a11y": {
232
+ "role": "button",
233
+ "keyboard": [
234
+ "Enter activates",
235
+ "Space activates"
236
+ ],
237
+ "notes": "Loading sets aria-busy and disables the control. Focus is an offset keyline, never a rounded ring."
238
+ }
239
+ },
240
+ {
241
+ "name": "Card",
242
+ "category": "navigation",
243
+ "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.",
244
+ "whenToUse": "Use it in a grid of comparable things a person picks between: components in a catalogue, results in a list, templates to start from. The title is the accessible name, so it is also what an agent selects on.",
245
+ "whenNotToUse": "Do not use it for a static region with a header; that is Panel. Do not put separate controls inside one, because the whole card is already a single control and nesting buttons inside a link is invalid.",
246
+ "status": "experimental",
247
+ "props": {
248
+ "label": {
249
+ "kind": "string",
250
+ "description": "The card's title, and its accessible name. Also derives the tool name when the card acts.",
251
+ "required": true
252
+ },
253
+ "children": {
254
+ "kind": "node",
255
+ "description": "A line or two describing the entry. Carried in the agent view as the body part."
256
+ },
257
+ "href": {
258
+ "kind": "string",
259
+ "description": "Destination, which makes the card a link. A card that navigates registers no tool by default."
260
+ },
261
+ "onClick": {
262
+ "kind": "handler",
263
+ "description": "What clicking does. Alone it makes the card a button that registers an open tool by default. Alongside href the card stays a link and the handler rides the click, so a client-side router can intercept the navigation."
264
+ },
265
+ "disabled": {
266
+ "kind": "boolean",
267
+ "description": "Disable an acting card and unregister its tool. Has no effect on a card that navigates.",
268
+ "default": false
269
+ },
270
+ "agentTool": {
271
+ "kind": "boolean",
272
+ "description": "Override the default: on for a card that acts, off for a card that navigates, because an agent can reach an href on its own."
273
+ },
274
+ "agentName": {
275
+ "kind": "string",
276
+ "description": "Override the label used to derive the tool name, when two cards share a title."
277
+ }
278
+ },
279
+ "state": {
280
+ "href": {
281
+ "description": "Where the card goes, when it navigates.",
282
+ "attribute": "data-sprint-href"
283
+ },
284
+ "disabled": {
285
+ "description": "Present when the card cannot be opened.",
286
+ "attribute": "data-sprint-disabled"
287
+ }
288
+ },
289
+ "tools": {
290
+ "open": {
291
+ "verb": "open",
292
+ "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.",
293
+ "inputSchema": {
294
+ "type": "object",
295
+ "properties": {}
296
+ },
297
+ "readOnly": false,
298
+ "untrustedContent": true,
299
+ "registeredWhen": "The card acts rather than navigates, is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
300
+ "unregisteredWhen": "The card unmounts, becomes disabled, or turns into a link by taking an href."
301
+ }
302
+ },
303
+ "agentView": {
304
+ "example": "- **Card** \"Button\" [href=#/Button]\n - part `title` \"Button\"\n - part `body` \"A single action a person or an agent can trigger.\""
305
+ },
306
+ "examples": [
307
+ {
308
+ "title": "A catalogue entry",
309
+ "description": "A card that navigates. No tool, because the href is already public.",
310
+ "code": "<Card label=\"Button\" href=\"#/Button\">\n A single action a person or an agent can trigger.\n</Card>"
311
+ },
312
+ {
313
+ "title": "A card that acts",
314
+ "description": "onClick instead of href, so the card registers open-start-from-blank and an agent can take it.",
315
+ "code": "<Card label=\"Start from blank\" onClick={create}>\n An empty page with the provider already wired up.\n</Card>"
316
+ }
317
+ ],
318
+ "a11y": {
319
+ "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."
320
+ }
321
+ },
322
+ {
323
+ "name": "Checkbox",
324
+ "category": "input",
325
+ "summary": "A single on/off choice recorded as form data. It registers one set tool that takes the end state rather than toggling.",
326
+ "whenToUse": "Use it for a boolean a form will submit: accepting terms, opting in, including something in a request. The set tool takes checked as true or false, so an agent states the end state and never has to read before writing.",
327
+ "whenNotToUse": "Do not use it for a setting that takes effect the moment it changes; that is a Switch. Do not use it for choosing one of several options, which is a SegmentedControl or a Select.",
328
+ "status": "experimental",
329
+ "props": {
330
+ "label": {
331
+ "kind": "string",
332
+ "description": "What checking it means. Names the box for a screen reader and derives the tool name, so prefer a statement such as \"Accept the terms\".",
333
+ "required": true
334
+ },
335
+ "checked": {
336
+ "kind": "boolean",
337
+ "description": "Whether the box is checked. The box is fully controlled.",
338
+ "required": true
339
+ },
340
+ "onChange": {
341
+ "kind": "handler",
342
+ "description": "Called with the new checked state. The set tool drives a real click, so this runs for agent changes too.",
343
+ "required": true
344
+ },
345
+ "hint": {
346
+ "kind": "string",
347
+ "description": "Guidance shown under the box and carried into the agent view. Replaced by error while one is set."
348
+ },
349
+ "error": {
350
+ "kind": "string",
351
+ "description": "A validation message. Marks the box invalid for people, screen readers, and agents alike."
352
+ },
353
+ "name": {
354
+ "kind": "string",
355
+ "description": "The native form name submitted with the surrounding form."
356
+ },
357
+ "disabled": {
358
+ "kind": "boolean",
359
+ "description": "Disable the box and unregister its set tool.",
360
+ "default": false
361
+ },
362
+ "required": {
363
+ "kind": "boolean",
364
+ "description": "Mark the box as one that must be checked.",
365
+ "default": false
366
+ },
367
+ "agentName": {
368
+ "kind": "string",
369
+ "description": "Override the label used to derive the tool name, when two boxes on a page would otherwise collide."
370
+ },
371
+ "agentTool": {
372
+ "kind": "boolean",
373
+ "description": "Set false to render the box without registering a set tool.",
374
+ "default": true
375
+ }
376
+ },
377
+ "state": {
378
+ "checked": {
379
+ "description": "Present while the box is checked.",
380
+ "attribute": "data-sprint-checked"
381
+ },
382
+ "disabled": {
383
+ "description": "Present when the box cannot be changed.",
384
+ "attribute": "data-sprint-disabled"
385
+ },
386
+ "required": {
387
+ "description": "Present when the box must be checked.",
388
+ "attribute": "data-sprint-required"
389
+ },
390
+ "invalid": {
391
+ "description": "Present while an error is set.",
392
+ "attribute": "data-sprint-invalid"
393
+ }
394
+ },
395
+ "tools": {
396
+ "set": {
397
+ "verb": "set",
398
+ "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.",
399
+ "inputSchema": {
400
+ "type": "object",
401
+ "properties": {
402
+ "checked": {
403
+ "type": "boolean",
404
+ "description": "The end state: true leaves the box checked, false leaves it unchecked."
405
+ }
406
+ },
407
+ "required": [
408
+ "checked"
409
+ ]
410
+ },
411
+ "readOnly": false,
412
+ "untrustedContent": true,
413
+ "registeredWhen": "The box is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
414
+ "unregisteredWhen": "The box unmounts or becomes disabled."
415
+ }
416
+ },
417
+ "agentView": {
418
+ "example": "- **Checkbox** \"Accept the terms\" [required] → tool `set-accept-the-terms`\n - part `error` \"Required before launch\""
419
+ },
420
+ "examples": [
421
+ {
422
+ "title": "A consent box",
423
+ "description": "In agent view the box renders as one control; pressing it toggles, while the set tool states the end state.",
424
+ "code": "<Checkbox\n label=\"Accept the terms\"\n checked={accepted}\n onChange={setAccepted}\n required\n/>"
425
+ },
426
+ {
427
+ "title": "An error on a required box",
428
+ "description": "The error marks the box invalid on every surface until it clears.",
429
+ "code": "<Checkbox\n label=\"Confirm the manifest\"\n checked={confirmed}\n onChange={setConfirmed}\n required\n error=\"Confirm before launch.\"\n/>"
430
+ },
431
+ {
432
+ "title": "A disabled box",
433
+ "description": "Disabled unregisters the tool, so an agent cannot change what a person could not.",
434
+ "code": "<Checkbox\n label=\"Telemetry\"\n checked\n disabled\n onChange={setTelemetry}\n/>"
435
+ }
436
+ ],
437
+ "a11y": {
438
+ "role": "checkbox",
439
+ "keyboard": [
440
+ "Space toggles",
441
+ "Tab moves through the box"
442
+ ],
443
+ "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."
444
+ }
445
+ },
446
+ {
447
+ "name": "CodeBlock",
448
+ "category": "display",
449
+ "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.",
450
+ "whenToUse": "Use it for any code a reader is meant to run or copy: an install snippet, an example, a generated tool descriptor. It scrolls horizontally rather than wrapping, so a long line stays a long line.",
451
+ "whenNotToUse": "Do not use it for a short inline identifier inside a sentence; use a code element inside Text. Do not use it for prose you want to look technical.",
452
+ "status": "experimental",
453
+ "props": {
454
+ "code": {
455
+ "kind": "string",
456
+ "description": "The snippet, verbatim. Newlines are preserved and this exact string is what an agent reads and what the copy control copies.",
457
+ "required": true
458
+ },
459
+ "caption": {
460
+ "kind": "string",
461
+ "description": "What the snippet is, shown in the band above it and used as the block's accessible name. Defaults to the language."
462
+ },
463
+ "language": {
464
+ "kind": "enum",
465
+ "description": "What the snippet is written in. Drives the caption default.",
466
+ "values": [
467
+ "tsx",
468
+ "json",
469
+ "bash",
470
+ "text"
471
+ ],
472
+ "default": "tsx"
473
+ },
474
+ "copyLabel": {
475
+ "kind": "string",
476
+ "description": "Label for the copy control.",
477
+ "default": "Copy"
478
+ }
479
+ },
480
+ "state": {
481
+ "language": {
482
+ "description": "The language the snippet is in.",
483
+ "attribute": "data-sprint-language",
484
+ "values": [
485
+ "tsx",
486
+ "json",
487
+ "bash",
488
+ "text"
489
+ ]
490
+ },
491
+ "lines": {
492
+ "description": "How many lines the snippet has.",
493
+ "attribute": "data-sprint-lines"
494
+ },
495
+ "copied": {
496
+ "description": "Present for a moment after the copy control has put the snippet on the clipboard.",
497
+ "attribute": "data-sprint-copied"
498
+ },
499
+ "token": {
500
+ "description": "On a highlight span: which token class it is. Colour comes from this, so a theme can recolour code without touching the component.",
501
+ "attribute": "data-sprint-token",
502
+ "values": [
503
+ "tag",
504
+ "attr",
505
+ "string",
506
+ "keyword",
507
+ "number",
508
+ "punct",
509
+ "comment"
510
+ ]
511
+ }
512
+ },
513
+ "agentView": {
514
+ "example": "- **CodeBlock** \"install\" [language=bash, lines=1]\n - part `copy` \"Copy\"\n - part `code` \"npm install sprint\""
515
+ },
516
+ "examples": [
517
+ {
518
+ "title": "An example snippet",
519
+ "description": "No caption, so the language names the block. It registers no WebMCP tool: an agent has nothing to gain from putting text on a person's clipboard, and it can already read the code.",
520
+ "code": "<CodeBlock code={'<Button tone=\"action\">Prepare launch</Button>'} />"
521
+ },
522
+ {
523
+ "title": "A captioned descriptor",
524
+ "code": "<CodeBlock\n caption=\"descriptor\"\n language=\"json\"\n code={JSON.stringify(descriptor, null, 2)}\n/>"
525
+ }
526
+ ],
527
+ "a11y": {
528
+ "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."
529
+ }
530
+ },
531
+ {
532
+ "name": "DescriptionList",
533
+ "category": "display",
534
+ "summary": "Labelled term–description pairs for the details of one thing: metadata, settings, profile fields.",
535
+ "whenToUse": "Use for the properties of a single entity: a token's created date and scopes, a session's device and last activity, a profile's fields. Each item pairs one term with one description.",
536
+ "whenNotToUse": "Do not use for many entities with the same fields; that is a Table. Do not put components inside term or description; both are flattened to text for the agent view, so only inline content survives. Do not use for prose sequences; that is a List.",
537
+ "status": "experimental",
538
+ "props": {
539
+ "label": {
540
+ "kind": "string",
541
+ "description": "The accessible name for the list, describing what entity it details.",
542
+ "required": true
543
+ },
544
+ "items": {
545
+ "kind": "array",
546
+ "description": "The pairs, in order. Each item is { term, description }; both are inline content flattened to text for the agent view.",
547
+ "required": true
548
+ },
549
+ "emptyLabel": {
550
+ "kind": "string",
551
+ "description": "Text shown when items is empty. The region keeps its frame.",
552
+ "default": "Empty"
553
+ }
554
+ },
555
+ "state": {
556
+ "items": {
557
+ "description": "The number of pairs.",
558
+ "attribute": "data-sprint-items"
559
+ },
560
+ "empty": {
561
+ "description": "Present when there are no pairs.",
562
+ "attribute": "data-sprint-empty"
563
+ }
564
+ },
565
+ "agentView": {
566
+ "example": "- **DescriptionList** \"Key sk-prod\" [items=2]"
567
+ },
568
+ "examples": [
569
+ {
570
+ "title": "Token metadata",
571
+ "code": "<DescriptionList\n label=\"Key sk-prod\"\n items={[\n { term: \"Created\", description: \"2026-08-01\" },\n { term: \"Last used\", description: \"2 hours ago\" },\n { term: \"Scopes\", description: \"read, write\" },\n ]}\n/>"
572
+ },
573
+ {
574
+ "title": "An empty list",
575
+ "description": "The region keeps its frame and states its emptiness.",
576
+ "code": "<DescriptionList label=\"Recovery codes\" items={[]} emptyLabel=\"None generated\" />"
577
+ }
578
+ ],
579
+ "a11y": {
580
+ "role": "definition list",
581
+ "notes": "Renders a native dl with an aria-label. Terms are dt elements and descriptions dd, so structure survives without styling."
582
+ }
583
+ },
584
+ {
585
+ "name": "Dialog",
586
+ "category": "overlay",
587
+ "summary": "A modal that interrupts the page for one decision: confirm a destructive action, complete a short step, acknowledge something before continuing.",
588
+ "whenToUse": "Use when the page must not continue until the person decides: confirming a revocation or deletion, a short focused form, a required acknowledgement. Keep one decision per dialog and put its actions inside as ordinary Buttons; tools registered inside the dialog compose their names under its label.",
589
+ "whenNotToUse": "Do not use for status messages; that is an Alert. Do not use for anything the person should be able to ignore; a modal takes the whole page hostage. Do not nest dialogs.",
590
+ "status": "experimental",
591
+ "props": {
592
+ "label": {
593
+ "kind": "string",
594
+ "description": "The dialog's title. Names the dialog for assistive tech, derives the close tool name, and scopes the names of tools registered inside.",
595
+ "required": true
596
+ },
597
+ "open": {
598
+ "kind": "boolean",
599
+ "description": "Whether the dialog is shown. A closed dialog renders nothing at all; the page owns this state.",
600
+ "required": true
601
+ },
602
+ "onClose": {
603
+ "kind": "handler",
604
+ "description": "Called when the person or an agent asks to close: the close control, Escape, or the close tool. Set open to false in response.",
605
+ "required": true
606
+ },
607
+ "children": {
608
+ "kind": "node",
609
+ "description": "The dialog's contents. Ordinary components; anything actionable registers its own tools, scoped under the dialog's label.",
610
+ "required": true
611
+ },
612
+ "headingLevel": {
613
+ "kind": "enum",
614
+ "description": "Render the title as a real heading at this level, joining the page outline.",
615
+ "values": [
616
+ "2",
617
+ "3",
618
+ "4"
619
+ ]
620
+ },
621
+ "owner": {
622
+ "kind": "string",
623
+ "description": "The tool name of the control that opened this dialog. Published as data-sprint-owner so a reading agent can attach the dialog to its opener."
624
+ },
625
+ "agentName": {
626
+ "kind": "string",
627
+ "description": "Override the label used to derive the close tool name."
628
+ },
629
+ "agentTool": {
630
+ "kind": "boolean",
631
+ "description": "Set false to render without registering the close tool.",
632
+ "default": true
633
+ }
634
+ },
635
+ "state": {
636
+ "open": {
637
+ "description": "Present while the dialog is shown. A closed dialog is absent from the DOM entirely.",
638
+ "attribute": "data-sprint-open"
639
+ }
640
+ },
641
+ "tools": {
642
+ "close": {
643
+ "verb": "close",
644
+ "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.",
645
+ "inputSchema": {
646
+ "type": "object",
647
+ "properties": {}
648
+ },
649
+ "readOnly": false,
650
+ "untrustedContent": true,
651
+ "registeredWhen": "The dialog is open. A closed dialog renders nothing and has no tools.",
652
+ "unregisteredWhen": "The dialog closes or unmounts."
653
+ }
654
+ },
655
+ "agentView": {
656
+ "example": "- **Dialog** \"Revoke key\" [open] with part `close` → tool `close-revoke-key`"
657
+ },
658
+ "examples": [
659
+ {
660
+ "title": "A destructive confirmation",
661
+ "description": "The confirm Button registers its tool only while the dialog is open, and its name is scoped under the dialog's label.",
662
+ "code": "<Dialog label=\"Revoke key\" open={confirming} onClose={() => setConfirming(false)}>\n <Stack gap=\"tight\">\n <Text>The key stops authenticating immediately. This cannot be undone.</Text>\n <Button tone=\"danger\" onClick={revoke}>Revoke sk-prod</Button>\n </Stack>\n</Dialog>"
663
+ },
664
+ {
665
+ "title": "Owned by its opener",
666
+ "description": "Passing the opener's tool name lets a reading agent attach the dialog to the control that produced it.",
667
+ "code": "<Dialog\n label=\"Rotate secret\"\n open={rotating}\n owner=\"press-rotate-secret\"\n onClose={() => setRotating(false)}\n>\n <Text>The current secret keeps working for one hour.</Text>\n</Dialog>"
668
+ }
669
+ ],
670
+ "a11y": {
671
+ "role": "dialog",
672
+ "keyboard": [
673
+ "Escape closes",
674
+ "Tab cycles within the dialog"
675
+ ],
676
+ "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."
677
+ }
678
+ },
679
+ {
680
+ "name": "Heading",
681
+ "category": "typography",
682
+ "summary": "A section title, rendered as a real h element at the level you pick so it joins the document outline.",
683
+ "whenToUse": "Use it for the title of a page or of a region inside one, and keep levels in document order so the outline an agent or a screen reader builds is the outline you meant.",
684
+ "whenNotToUse": "Do not use it for the label on a bordered region; Panel takes a label prop, draws its own header, and joins the outline through its headingLevel prop. Do not pick a level for its size, only for its place in the outline.",
685
+ "status": "experimental",
686
+ "props": {
687
+ "children": {
688
+ "kind": "node",
689
+ "description": "The title. Keep it short; long titles truncate in chrome.",
690
+ "required": true
691
+ },
692
+ "level": {
693
+ "kind": "enum",
694
+ "description": "Outline depth, rendered as the matching h element. 1 is the page title and there should be one per page.",
695
+ "values": [
696
+ "1",
697
+ "2",
698
+ "3",
699
+ "4"
700
+ ],
701
+ "default": "2"
702
+ }
703
+ },
704
+ "state": {
705
+ "level": {
706
+ "description": "The outline depth, and so the type voice in use.",
707
+ "attribute": "data-sprint-level",
708
+ "values": [
709
+ "1",
710
+ "2",
711
+ "3",
712
+ "4"
713
+ ]
714
+ }
715
+ },
716
+ "agentView": {
717
+ "example": "- **Heading** \"WebMCP tools\" [level=2]"
718
+ },
719
+ "examples": [
720
+ {
721
+ "title": "A page title",
722
+ "code": "<Heading level={1}>Button</Heading>"
723
+ },
724
+ {
725
+ "title": "A section title",
726
+ "description": "The default level, for a region inside a page.",
727
+ "code": "<Heading>Every variant</Heading>"
728
+ }
729
+ ]
730
+ },
731
+ {
732
+ "name": "Link",
733
+ "category": "navigation",
734
+ "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.",
735
+ "whenToUse": "Use it for anything that changes the address: a nav item, a cross-reference, a link out to a specification. Set active on the item matching the current route so the agent view and the human view agree about where you are. Under a client-side router, pass an onClick that prevents default and navigates; the handler rides the anchor in both views, so agent clicks and open tools go through the router too.",
736
+ "whenNotToUse": "Do not use it for an action that stays on the page; that is a Button. Do not register a tool on ordinary navigation: an agent can already reach a URL, and a page of links would flood its tool list for no gain.",
737
+ "status": "experimental",
738
+ "props": {
739
+ "href": {
740
+ "kind": "string",
741
+ "description": "The destination. Published as data-sprint-href and carried in the agent view, so the URL is readable without a click.",
742
+ "required": true
743
+ },
744
+ "children": {
745
+ "kind": "node",
746
+ "description": "The link text. It names the destination, so prefer the page's name over here or read more.",
747
+ "required": true
748
+ },
749
+ "active": {
750
+ "kind": "boolean",
751
+ "description": "Mark the link as the current location. Sets aria-current so a screen reader and an agent learn it the same way.",
752
+ "default": false
753
+ },
754
+ "external": {
755
+ "kind": "boolean",
756
+ "description": "Mark a destination outside this app. Opens in a new context and adds the usual rel protections.",
757
+ "default": false
758
+ },
759
+ "agentTool": {
760
+ "kind": "boolean",
761
+ "description": "Set true to register an open tool for this link. Off by default: navigation is reachable by URL, so a tool per link is cost without benefit.",
762
+ "default": false
763
+ },
764
+ "agentName": {
765
+ "kind": "string",
766
+ "description": "Override the label used to derive the tool name, for icon-only links or two links with the same text."
767
+ }
768
+ },
769
+ "state": {
770
+ "href": {
771
+ "description": "Where this link goes.",
772
+ "attribute": "data-sprint-href"
773
+ },
774
+ "active": {
775
+ "description": "Present when this link is the current location.",
776
+ "attribute": "data-sprint-active"
777
+ },
778
+ "external": {
779
+ "description": "Present when the destination is outside this app.",
780
+ "attribute": "data-sprint-external"
781
+ }
782
+ },
783
+ "tools": {
784
+ "open": {
785
+ "verb": "open",
786
+ "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.",
787
+ "inputSchema": {
788
+ "type": "object",
789
+ "properties": {}
790
+ },
791
+ "readOnly": false,
792
+ "untrustedContent": true,
793
+ "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.",
794
+ "unregisteredWhen": "The link unmounts or opts back out."
795
+ }
796
+ },
797
+ "agentView": {
798
+ "example": "- **Link** \"Button\" [active, href=#/Button]"
799
+ },
800
+ "examples": [
801
+ {
802
+ "title": "A nav item",
803
+ "code": "<Link href=\"#/Button\" active={route === \"Button\"}>Button</Link>"
804
+ },
805
+ {
806
+ "title": "A link out",
807
+ "code": "<Link href=\"https://developer.chrome.com/docs/ai/webmcp\" external>\n Chrome docs\n</Link>"
808
+ },
809
+ {
810
+ "title": "A link an agent may follow itself",
811
+ "description": "Opting in is for the one link that completes a task, not for a nav list.",
812
+ "code": "<Link href=\"#/checkout\" agentTool>Go to checkout</Link>"
813
+ }
814
+ ],
815
+ "a11y": {
816
+ "role": "link",
817
+ "keyboard": [
818
+ "Enter follows the link"
819
+ ],
820
+ "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."
821
+ }
822
+ },
823
+ {
824
+ "name": "List",
825
+ "category": "display",
826
+ "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.",
827
+ "whenToUse": "Use it for a short sequence of related points: rules, steps, links, caveats. Passing items as data rather than as children is what lets the agent view carry each one as its own part.",
828
+ "whenNotToUse": "Do not use it for records with fields; that is Table. Do not use it as a layout for cards or controls; that is Stack.",
829
+ "status": "experimental",
830
+ "props": {
831
+ "label": {
832
+ "kind": "string",
833
+ "description": "What the list is a list of. Names it for a screen reader and for the agent view.",
834
+ "required": true
835
+ },
836
+ "items": {
837
+ "kind": "array",
838
+ "description": "The items in order. Inline content, not components: each is flattened to text for the agent view.",
839
+ "required": true
840
+ },
841
+ "ordered": {
842
+ "kind": "boolean",
843
+ "description": "Number the items instead of bulleting them. Use it when the order is the point.",
844
+ "default": false
845
+ },
846
+ "emptyLabel": {
847
+ "kind": "string",
848
+ "description": "What the list says when it has no items.",
849
+ "default": "Empty"
850
+ }
851
+ },
852
+ "state": {
853
+ "items": {
854
+ "description": "How many items the list has.",
855
+ "attribute": "data-sprint-items"
856
+ },
857
+ "ordered": {
858
+ "description": "Present when the items are numbered rather than bulleted.",
859
+ "attribute": "data-sprint-ordered"
860
+ },
861
+ "empty": {
862
+ "description": "Present when the list has no items.",
863
+ "attribute": "data-sprint-empty"
864
+ },
865
+ "index": {
866
+ "description": "On an item: its 1-based position in the list.",
867
+ "attribute": "data-sprint-index"
868
+ }
869
+ },
870
+ "agentView": {
871
+ "example": "- **List** \"Tool rules\" [items=1]\n - part `item` \"One tool, one action.\" [index=1]"
872
+ },
873
+ "examples": [
874
+ {
875
+ "title": "A list of rules",
876
+ "code": "<List\n label=\"Tool rules\"\n items={[\n <>\n <strong>One tool, one action.</strong> Overlapping tools make selection\n harder.\n </>,\n ]}\n/>"
877
+ },
878
+ {
879
+ "title": "A numbered sequence",
880
+ "code": "<List\n ordered\n label=\"Steps\"\n items={[\"Register the tool.\", \"Drive the DOM.\", \"Return the new state.\"]}\n/>"
881
+ }
882
+ ],
883
+ "a11y": {
884
+ "role": "list",
885
+ "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."
886
+ }
887
+ },
888
+ {
889
+ "name": "MetaLine",
890
+ "category": "display",
891
+ "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.",
892
+ "whenToUse": "Use it for the compact strip of identifying metadata that belongs to a page, panel, or footer: version and build identifiers, timestamps, serial numbers, owners. Values are short and the line truncates rather than wraps.",
893
+ "whenNotToUse": "Do not use it for the details of a record a person is meant to study; that is a DescriptionList. Do not put anything interactive in it, and do not use it for prose.",
894
+ "status": "experimental",
895
+ "props": {
896
+ "entries": {
897
+ "kind": "array",
898
+ "description": "Term–detail pairs in display order: { term, detail }, both strings. Rendered as TERM: DETAIL, slash-separated, and carried as one line in the agent view. An empty array renders nothing.",
899
+ "required": true
900
+ }
901
+ },
902
+ "state": {
903
+ "entries": {
904
+ "description": "How many term–detail pairs the line carries.",
905
+ "attribute": "data-sprint-entries"
906
+ }
907
+ },
908
+ "agentView": {
909
+ "example": "- **MetaLine** \"SERIAL: NU-TYPE-CORE-A1 / ISSUED: 2744.07.22\" [entries=2]"
910
+ },
911
+ "examples": [
912
+ {
913
+ "title": "A build strip",
914
+ "description": "The manifest voice: uppercase mono, slash-separated, terms muted and details in ink.",
915
+ "code": "<MetaLine\n entries={[\n { term: \"Serial\", detail: \"NU-TYPE-CORE-A1\" },\n { term: \"Issued\", detail: \"2744.07.22\" },\n ]}\n/>"
916
+ },
917
+ {
918
+ "title": "Version chrome for a footer",
919
+ "description": "The line an app pins under its content or into a Shell rail.",
920
+ "code": "<MetaLine\n entries={[\n { term: \"Sprint\", detail: \"v0.0.0\" },\n { term: \"Channel\", detail: \"dev\" },\n { term: \"WebMCP\", detail: \"chrome 149\" },\n ]}\n/>"
921
+ }
922
+ ],
923
+ "a11y": {
924
+ "role": "paragraph",
925
+ "notes": "The separators are real text, so the accessible name is the same line the agent view carries. Nothing in the line is interactive."
926
+ }
927
+ },
928
+ {
929
+ "name": "Nav",
930
+ "category": "navigation",
931
+ "summary": "A labelled navigation landmark: the region that holds a page's links to elsewhere.",
932
+ "whenToUse": "Use it around any set of links whose job is getting around the app: a sidebar, a table of contents, a footer link block. The label names the landmark, so a person navigating by landmark, a screen reader, and an agent reading the page all know these links are wayfinding rather than content. Group related links inside it with NavGroup.",
933
+ "whenNotToUse": "Do not use it for a link that sits inside prose; a bare Link is already readable there. Do not use it for a set of actions that stay on the page; those are Buttons in a Stack.",
934
+ "status": "experimental",
935
+ "props": {
936
+ "label": {
937
+ "kind": "string",
938
+ "description": "What this navigation is for. Rendered as the landmark's accessible name, so two navs on one page stay distinguishable.",
939
+ "required": true
940
+ },
941
+ "children": {
942
+ "kind": "node",
943
+ "description": "Link components, or NavGroup components wrapping them.",
944
+ "required": true
945
+ }
946
+ },
947
+ "agentView": {
948
+ "example": "- **Nav** \"Workbench\""
949
+ },
950
+ "a11y": {
951
+ "role": "navigation",
952
+ "notes": "The label is the landmark's accessible name via aria-label. Active links inside it carry aria-current=page, so the current location is announced without any styling cue."
953
+ },
954
+ "relatedComponents": [
955
+ "NavGroup",
956
+ "Link",
957
+ "Shell"
958
+ ],
959
+ "examples": [
960
+ {
961
+ "title": "A grouped sidebar nav",
962
+ "description": "Each NavGroup names a cluster of destinations. The active link carries the current-page mark in every view.",
963
+ "code": "<Nav label=\"Docs\">\n <NavGroup label=\"Guides\">\n <Link href=\"#/guide/webmcp\">WebMCP</Link>\n </NavGroup>\n <NavGroup label=\"Components\">\n <Link href=\"#/Button\" active>Button</Link>\n <Link href=\"#/Table\">Table</Link>\n </NavGroup>\n</Nav>"
964
+ },
965
+ {
966
+ "title": "A flat nav",
967
+ "description": "A short list of destinations needs no grouping.",
968
+ "code": "<Nav label=\"Site\">\n <Link href=\"#/\">Home</Link>\n <Link href=\"#/pricing\">Pricing</Link>\n</Nav>"
969
+ }
970
+ ]
971
+ },
972
+ {
973
+ "name": "NavGroup",
974
+ "category": "navigation",
975
+ "summary": "A labelled cluster of links inside a Nav. The label names the group for screen readers and agents alike.",
976
+ "whenToUse": "Use it when a Nav holds more than one kind of destination: guides versus components, product versus account. The label tells every reader, including an agent scanning for the right link, what the links below it have in common.",
977
+ "whenNotToUse": "Do not use it outside a Nav; on its own it is just a heading over links, which Panel does better. Do not nest groups; one level of grouping is all a sidebar can carry.",
978
+ "status": "experimental",
979
+ "props": {
980
+ "label": {
981
+ "kind": "string",
982
+ "description": "What the links in this group have in common. Rendered as the rubric and as the group's accessible name.",
983
+ "required": true
984
+ },
985
+ "children": {
986
+ "kind": "node",
987
+ "description": "The Link components this group collects.",
988
+ "required": true
989
+ }
990
+ },
991
+ "agentView": {
992
+ "example": "- **NavGroup** \"Components\""
993
+ },
994
+ "a11y": {
995
+ "role": "group",
996
+ "notes": "The group carries its label as an accessible name, so screen readers announce the rubric when entering the cluster rather than reading an unlabelled run of links."
997
+ },
998
+ "relatedComponents": [
999
+ "Nav",
1000
+ "Link"
1001
+ ],
1002
+ "examples": [
1003
+ {
1004
+ "title": "A labelled group of links",
1005
+ "code": "<NavGroup label=\"Reference\">\n <Link href=\"https://developer.chrome.com/docs/ai/webmcp\" external>\n Chrome docs\n </Link>\n <Link href=\"https://github.com/webmachinelearning/webmcp\" external>\n Specification\n </Link>\n</NavGroup>"
1006
+ }
1007
+ ]
1008
+ },
1009
+ {
1010
+ "name": "PageHeader",
1011
+ "category": "layout",
1012
+ "summary": "The top of a page: its h1 title, the Tag chips that classify it, an optional page-level control, and a lede underneath.",
1013
+ "whenToUse": "Use it once per page, as the first thing inside the content region. The label becomes the page's only h1, so the document outline starts here. Put status or category Tags in tags, a control that affects the whole page in actions, and the introductory sentence or two in children as Text.",
1014
+ "whenNotToUse": "Do not use it for a section within a page; that is a Panel with a headingLevel. Do not put navigation in actions; the page's links belong in a Nav.",
1015
+ "status": "experimental",
1016
+ "props": {
1017
+ "label": {
1018
+ "kind": "string",
1019
+ "description": "The page title. Rendered as the page's h1.",
1020
+ "required": true
1021
+ },
1022
+ "tags": {
1023
+ "kind": "node",
1024
+ "description": "Tag components that classify the page, rendered on the title line. Keep it to two or three."
1025
+ },
1026
+ "actions": {
1027
+ "kind": "node",
1028
+ "description": "A control that acts on the whole page, rendered at the end of the title line."
1029
+ },
1030
+ "children": {
1031
+ "kind": "node",
1032
+ "description": "The lede: a Text or two introducing the page."
1033
+ }
1034
+ },
1035
+ "agentView": {
1036
+ "example": "- **PageHeader** \"Button\""
1037
+ },
1038
+ "a11y": {
1039
+ "notes": "The label renders as the page's h1, so keep to one PageHeader per page. Tags and the lede are ordinary content after it; the header element itself takes no landmark role because it sits inside main."
1040
+ },
1041
+ "relatedComponents": [
1042
+ "Panel",
1043
+ "Heading",
1044
+ "Tag"
1045
+ ],
1046
+ "examples": [
1047
+ {
1048
+ "title": "A titled page with a lede",
1049
+ "code": "<PageHeader label=\"Reports\">\n <Text>Everything the quarter produced, in one place.</Text>\n</PageHeader>"
1050
+ },
1051
+ {
1052
+ "title": "Status tags and a page-level control",
1053
+ "description": "Tags classify the page on the title line; the action slot holds the one control that affects the whole page.",
1054
+ "code": "<PageHeader\n label=\"Button\"\n tags={<Tag tone=\"warning\" filled>experimental</Tag>}\n actions={<Button agentTool={false}>Refresh</Button>}\n>\n <Text>A single action a person or an agent can trigger.</Text>\n</PageHeader>"
1055
+ }
1056
+ ]
1057
+ },
1058
+ {
1059
+ "name": "Panel",
1060
+ "category": "layout",
1061
+ "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.",
1062
+ "whenToUse": "Use it for every distinct region of a page: a section of documentation, a form, a readout, a preview. The label is the region's accessible name, so a person, a screen reader, and an agent all address the region by the same words.",
1063
+ "whenNotToUse": "Do not use it as a spacer or a plain box; that is Stack. Nesting reads clearly to about three deep, because each level alternates its ground and demotes its frame; past that, the depth cues repeat and the region wants a page of its own.",
1064
+ "status": "experimental",
1065
+ "props": {
1066
+ "label": {
1067
+ "kind": "string",
1068
+ "description": "What this region is. Rendered in the header band and used as the region's accessible name.",
1069
+ "required": true
1070
+ },
1071
+ "children": {
1072
+ "kind": "node",
1073
+ "description": "The region's content. An empty panel says it is empty rather than collapsing."
1074
+ },
1075
+ "headingLevel": {
1076
+ "kind": "enum",
1077
+ "description": "Render the label as a real heading at this outline depth, so the section is reachable when a screen reader navigates by headings. Set it on every panelled section of a page; leave it unset only for chrome such as a preview frame.",
1078
+ "values": [
1079
+ "2",
1080
+ "3",
1081
+ "4"
1082
+ ]
1083
+ },
1084
+ "actions": {
1085
+ "kind": "node",
1086
+ "description": "Controls that act on this region, rendered at the end of the header band. Keep it to one or two."
1087
+ },
1088
+ "flush": {
1089
+ "kind": "boolean",
1090
+ "description": "Drop the body padding, for content that draws its own edges such as a Table or a CodeBlock.",
1091
+ "default": false
1092
+ },
1093
+ "emptyLabel": {
1094
+ "kind": "string",
1095
+ "description": "What the panel says when it has no content.",
1096
+ "default": "Empty"
1097
+ }
1098
+ },
1099
+ "state": {
1100
+ "flush": {
1101
+ "description": "Present when the body carries no padding of its own.",
1102
+ "attribute": "data-sprint-flush"
1103
+ },
1104
+ "empty": {
1105
+ "description": "Present when the panel has no content. The panel still renders its keyline and says it is empty.",
1106
+ "attribute": "data-sprint-empty"
1107
+ }
1108
+ },
1109
+ "agentView": {
1110
+ "example": "- **Panel** \"WebMCP tools\""
1111
+ },
1112
+ "a11y": {
1113
+ "role": "region",
1114
+ "notes": "The section is a named landmark either way: the label is its accessible name. With headingLevel the label is also a heading element, so the page outline includes the region; without it the region is reachable only by landmark navigation."
1115
+ },
1116
+ "examples": [
1117
+ {
1118
+ "title": "A section of a page",
1119
+ "description": "headingLevel puts the label in the page outline, so a screen reader finds the section by heading as well as by landmark.",
1120
+ "code": "<Panel label=\"When to use\" headingLevel={2}>\n <Text>Use it for any discrete action.</Text>\n</Panel>"
1121
+ },
1122
+ {
1123
+ "title": "A panel with a control in its header",
1124
+ "description": "The header slot is for controls that act on the region, not for navigation.",
1125
+ "code": "<Panel\n label=\"Preview\"\n actions={<Button agentName=\"Reset preview\">Reset</Button>}\n>\n <Button tone=\"action\">Prepare launch</Button>\n</Panel>"
1126
+ },
1127
+ {
1128
+ "title": "A flush panel around a table",
1129
+ "description": "Content that draws its own keylines sits flush, so borders do not double up.",
1130
+ "code": "<Panel label=\"Conventions\" flush>\n <Table label=\"Conventions\" columns={columns} rows={rows} />\n</Panel>"
1131
+ },
1132
+ {
1133
+ "title": "Nested panels",
1134
+ "description": "Depth styles itself: the outermost panel carries a doubled keyline, each nested level alternates its ground, and nested headers demote to a dashed rule, so a reader ranks the levels without counting borders.",
1135
+ "code": "<Panel label=\"The shape\" headingLevel={2}>\n <Panel label=\"Human view\" headingLevel={3}>\n <Panel label=\"Crew\" headingLevel={4}>\n <Text>Registration fields live here.</Text>\n </Panel>\n </Panel>\n</Panel>"
1136
+ },
1137
+ {
1138
+ "title": "An empty region",
1139
+ "description": "An empty panel keeps its border and states that it is empty, rather than vanishing and leaving a person or an agent unsure whether it failed to load.",
1140
+ "code": "<Panel label=\"Registered tools\" emptyLabel=\"No tools registered\" />"
1141
+ }
1142
+ ]
1143
+ },
1144
+ {
1145
+ "name": "SecretField",
1146
+ "category": "display",
1147
+ "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.",
1148
+ "whenToUse": "Use to hand a person a secret the page holds. The mask is fixed-length so nothing leaks, and copy places the value on the clipboard without revealing it.",
1149
+ "whenNotToUse": "Do not use for entering a secret; that is a TextInput with type password. Do not use for values that are safe to read; a DescriptionList or CodeBlock keeps those on the agent surface where they belong.",
1150
+ "status": "experimental",
1151
+ "props": {
1152
+ "label": {
1153
+ "kind": "string",
1154
+ "description": "What the secret is, shown as the field's uppercase title.",
1155
+ "required": true
1156
+ },
1157
+ "value": {
1158
+ "kind": "string",
1159
+ "description": "The secret. Never appears in agent attributes, the agent view, or the copyable text stream; only reveal and copy touch it.",
1160
+ "required": true
1161
+ },
1162
+ "hint": {
1163
+ "kind": "string",
1164
+ "description": "Guidance below the value, e.g. \"Store it now. It is not shown again.\""
1165
+ },
1166
+ "defaultRevealed": {
1167
+ "kind": "boolean",
1168
+ "description": "Start revealed instead of masked.",
1169
+ "default": false
1170
+ }
1171
+ },
1172
+ "state": {
1173
+ "filled": {
1174
+ "description": "Present when the field holds a secret.",
1175
+ "attribute": "data-sprint-filled"
1176
+ },
1177
+ "revealed": {
1178
+ "description": "Present while the value is shown in clear text.",
1179
+ "attribute": "data-sprint-revealed"
1180
+ }
1181
+ },
1182
+ "agentView": {
1183
+ "example": "- **SecretField** \"API key\" [filled]"
1184
+ },
1185
+ "examples": [
1186
+ {
1187
+ "title": "A key shown once",
1188
+ "code": "<SecretField\n label=\"API key\"\n value={key}\n hint=\"Store it now. It is not shown again.\"\n/>"
1189
+ },
1190
+ {
1191
+ "title": "Starting revealed",
1192
+ "description": "For a value the person is expected to transcribe immediately.",
1193
+ "code": "<SecretField label=\"Recovery code\" value={code} defaultRevealed />"
1194
+ }
1195
+ ],
1196
+ "a11y": {
1197
+ "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."
1198
+ }
1199
+ },
1200
+ {
1201
+ "name": "SegmentedControl",
1202
+ "category": "input",
1203
+ "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.",
1204
+ "whenToUse": "Use it for two to four exclusive choices a person should be able to compare without opening anything: a view switch, a density setting, a filter. One tool with an enum beats one tool per option, and it keeps a page's tool count flat as options are added.",
1205
+ "whenNotToUse": "Do not use it for more than about four options or for long labels; that is a select. Do not use it for an on/off setting, which is a switch, and never for navigation.",
1206
+ "status": "experimental",
1207
+ "props": {
1208
+ "label": {
1209
+ "kind": "string",
1210
+ "description": "What is being chosen. Names the group for a screen reader and derives the tool name, so prefer a noun phrase such as \"Page view\".",
1211
+ "required": true
1212
+ },
1213
+ "options": {
1214
+ "kind": "array",
1215
+ "description": "The choices in display order: { value, label }. The label is what a person sees and what the select tool accepts, so an agent never has to know the value.",
1216
+ "required": true
1217
+ },
1218
+ "value": {
1219
+ "kind": "string",
1220
+ "description": "The value of the selected option. The control is fully controlled.",
1221
+ "required": true
1222
+ },
1223
+ "onChange": {
1224
+ "kind": "handler",
1225
+ "description": "Called with the newly selected value. The select tool drives a real click, so this runs for agent selections too.",
1226
+ "required": true
1227
+ },
1228
+ "disabled": {
1229
+ "kind": "boolean",
1230
+ "description": "Disable every option and unregister the select tool.",
1231
+ "default": false
1232
+ },
1233
+ "agentName": {
1234
+ "kind": "string",
1235
+ "description": "Override the label used to derive the tool name, when two controls on a page would otherwise collide."
1236
+ },
1237
+ "agentTool": {
1238
+ "kind": "boolean",
1239
+ "description": "Set false to render the control without registering a select tool.",
1240
+ "default": true
1241
+ }
1242
+ },
1243
+ "state": {
1244
+ "value": {
1245
+ "description": "The value of the option currently selected.",
1246
+ "attribute": "data-sprint-value"
1247
+ },
1248
+ "disabled": {
1249
+ "description": "Present when no option can be chosen.",
1250
+ "attribute": "data-sprint-disabled"
1251
+ }
1252
+ },
1253
+ "tools": {
1254
+ "select": {
1255
+ "verb": "select",
1256
+ "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.",
1257
+ "inputSchema": {
1258
+ "type": "object",
1259
+ "properties": {
1260
+ "option": {
1261
+ "type": "string",
1262
+ "description": "The visible label of the option to select, as shown on the control."
1263
+ }
1264
+ },
1265
+ "required": [
1266
+ "option"
1267
+ ]
1268
+ },
1269
+ "readOnly": false,
1270
+ "untrustedContent": true,
1271
+ "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.",
1272
+ "unregisteredWhen": "The control unmounts or becomes disabled."
1273
+ }
1274
+ },
1275
+ "agentView": {
1276
+ "example": "- **SegmentedControl** \"Page view\" [value=human] → tool `select-page-view`\n - part `option` \"human\" [checked]\n - part `option` \"agent\""
1277
+ },
1278
+ "examples": [
1279
+ {
1280
+ "title": "A view switch",
1281
+ "description": "In agent view each option renders as its own control, so an agent driving the DOM can click one without WebMCP.",
1282
+ "code": "<SegmentedControl\n label=\"Page view\"\n value={view}\n onChange={setView}\n options={[\n { value: \"human\", label: \"human\" },\n { value: \"agent\", label: \"agent\" },\n ]}\n/>"
1283
+ },
1284
+ {
1285
+ "title": "A disabled control",
1286
+ "description": "Disabled unregisters the tool, so an agent cannot select an option a person could not.",
1287
+ "code": "<SegmentedControl\n label=\"Density\"\n disabled\n value=\"dense\"\n onChange={setDensity}\n options={[\n { value: \"dense\", label: \"dense\" },\n { value: \"roomy\", label: \"roomy\" },\n ]}\n/>"
1288
+ }
1289
+ ],
1290
+ "a11y": {
1291
+ "role": "radiogroup",
1292
+ "keyboard": [
1293
+ "Arrow keys move to the next or previous option and select it",
1294
+ "Home selects the first option",
1295
+ "End selects the last option",
1296
+ "Tab enters and leaves the group once"
1297
+ ],
1298
+ "notes": "Roving tabindex: only the selected option is in the tab order. Selection follows focus, which is the expected behaviour for a radio group."
1299
+ }
1300
+ },
1301
+ {
1302
+ "name": "Select",
1303
+ "category": "input",
1304
+ "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.",
1305
+ "whenToUse": "Use it when one value is chosen from a list too long to lay out flat: a region, a squad, a category. Options are data ({ value, label }), the tool accepts the visible label, and in agent view every option renders as its own control, so an agent picks one without opening anything.",
1306
+ "whenNotToUse": "Do not use it for two to four short options a person should compare at a glance; that is a SegmentedControl. Do not use it for an on/off state, which is a Checkbox or a Switch, and never for navigation.",
1307
+ "status": "experimental",
1308
+ "props": {
1309
+ "label": {
1310
+ "kind": "string",
1311
+ "description": "What is being chosen. Names the control for a screen reader and derives the tool name, so prefer a noun phrase such as \"Region\".",
1312
+ "required": true
1313
+ },
1314
+ "options": {
1315
+ "kind": "array",
1316
+ "description": "The choices in display order: { value, label }. The label is what a person sees and what the select tool accepts, so an agent never has to know the value.",
1317
+ "required": true
1318
+ },
1319
+ "value": {
1320
+ "kind": "string",
1321
+ "description": "The value of the chosen option, or \"\" while nothing is chosen yet. The control is fully controlled.",
1322
+ "required": true
1323
+ },
1324
+ "onChange": {
1325
+ "kind": "handler",
1326
+ "description": "Called with the newly chosen value. The select tool drives a real change event, so this runs for agent selections too.",
1327
+ "required": true
1328
+ },
1329
+ "placeholder": {
1330
+ "kind": "string",
1331
+ "description": "Shown while value is \"\". Rendered as a disabled option, so a person cannot choose it back."
1332
+ },
1333
+ "hint": {
1334
+ "kind": "string",
1335
+ "description": "Guidance shown under the control and carried into the agent view. Replaced by error while one is set."
1336
+ },
1337
+ "error": {
1338
+ "kind": "string",
1339
+ "description": "A validation message. Marks the control invalid for people, screen readers, and agents alike."
1340
+ },
1341
+ "name": {
1342
+ "kind": "string",
1343
+ "description": "The native form name submitted with the surrounding form."
1344
+ },
1345
+ "disabled": {
1346
+ "kind": "boolean",
1347
+ "description": "Disable the control and unregister its select tool.",
1348
+ "default": false
1349
+ },
1350
+ "required": {
1351
+ "kind": "boolean",
1352
+ "description": "Mark the control required, visually and in the agent view.",
1353
+ "default": false
1354
+ },
1355
+ "agentName": {
1356
+ "kind": "string",
1357
+ "description": "Override the label used to derive the tool name, when two controls on a page would otherwise collide."
1358
+ },
1359
+ "agentTool": {
1360
+ "kind": "boolean",
1361
+ "description": "Set false to render the control without registering a select tool.",
1362
+ "default": true
1363
+ }
1364
+ },
1365
+ "state": {
1366
+ "value": {
1367
+ "description": "The value of the option currently chosen.",
1368
+ "attribute": "data-sprint-value"
1369
+ },
1370
+ "empty": {
1371
+ "description": "Present while no option is chosen.",
1372
+ "attribute": "data-sprint-empty"
1373
+ },
1374
+ "disabled": {
1375
+ "description": "Present when nothing can be chosen.",
1376
+ "attribute": "data-sprint-disabled"
1377
+ },
1378
+ "required": {
1379
+ "description": "Present when a choice must be made.",
1380
+ "attribute": "data-sprint-required"
1381
+ },
1382
+ "invalid": {
1383
+ "description": "Present while an error is set.",
1384
+ "attribute": "data-sprint-invalid"
1385
+ }
1386
+ },
1387
+ "tools": {
1388
+ "select": {
1389
+ "verb": "select",
1390
+ "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.",
1391
+ "inputSchema": {
1392
+ "type": "object",
1393
+ "properties": {
1394
+ "option": {
1395
+ "type": "string",
1396
+ "description": "The visible label of the option to choose, as a person reads it in the list."
1397
+ }
1398
+ },
1399
+ "required": [
1400
+ "option"
1401
+ ]
1402
+ },
1403
+ "readOnly": false,
1404
+ "untrustedContent": true,
1405
+ "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.",
1406
+ "unregisteredWhen": "The dropdown unmounts or becomes disabled."
1407
+ }
1408
+ },
1409
+ "agentView": {
1410
+ "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\""
1411
+ },
1412
+ "examples": [
1413
+ {
1414
+ "title": "A dropdown",
1415
+ "description": "In agent view each option renders as its own control, so a DOM-driving agent chooses one directly.",
1416
+ "code": "<Select\n label=\"Region\"\n value={region}\n onChange={setRegion}\n placeholder=\"Choose a region\"\n options={[\n { value: \"na-1\", label: \"North Atlantic\" },\n { value: \"eu-1\", label: \"Northern Europe\" },\n { value: \"ap-1\", label: \"East Asia\" },\n ]}\n/>"
1417
+ },
1418
+ {
1419
+ "title": "A required choice with an error",
1420
+ "description": "Empty plus required plus an error is how an unmade mandatory choice reads on every surface.",
1421
+ "code": "<Select\n label=\"Launch site\"\n value={site}\n onChange={setSite}\n required\n error=\"Choose a site before continuing.\"\n options={[\n { value: \"ksc\", label: \"Cape Canaveral\" },\n { value: \"vsfb\", label: \"Vandenberg\" },\n ]}\n/>"
1422
+ },
1423
+ {
1424
+ "title": "A disabled dropdown",
1425
+ "description": "Disabled unregisters the tool, so an agent cannot choose what a person could not.",
1426
+ "code": "<Select\n label=\"Relay\"\n disabled\n value=\"r-2\"\n onChange={setRelay}\n options={[\n { value: \"r-1\", label: \"Relay one\" },\n { value: \"r-2\", label: \"Relay two\" },\n ]}\n/>"
1427
+ }
1428
+ ],
1429
+ "a11y": {
1430
+ "role": "combobox",
1431
+ "keyboard": [
1432
+ "Arrow keys move through the options",
1433
+ "Enter or Space opens the list",
1434
+ "Escape closes it"
1435
+ ],
1436
+ "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."
1437
+ }
1438
+ },
1439
+ {
1440
+ "name": "Shell",
1441
+ "category": "layout",
1442
+ "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.",
1443
+ "whenToUse": "Use it once, at the root of an app view. Put the brand in bar, a Nav in side, and the page in children. It renders the main and complementary landmarks, a skip-to-content control for keyboard users, and the mobile drawer behaviour, so none of that is rebuilt per app. Like Stack it is silent in agent view: its regions speak for themselves.",
1444
+ "whenNotToUse": "Do not use it inside another Shell, or anywhere below the top of the page; a region within a page is a Panel. Do not use it just to put two columns next to each other; that is Stack.",
1445
+ "status": "experimental",
1446
+ "props": {
1447
+ "children": {
1448
+ "kind": "node",
1449
+ "description": "The page content. Rendered inside the main landmark.",
1450
+ "required": true
1451
+ },
1452
+ "side": {
1453
+ "kind": "node",
1454
+ "description": "The sidebar content, usually a Nav. On narrow viewports it becomes the drawer behind the menu button, and the drawer closes itself when a link inside it is followed."
1455
+ },
1456
+ "bar": {
1457
+ "kind": "node",
1458
+ "description": "What stays visible when the sidebar collapses to a top bar: typically the brand link. The menu button renders next to it automatically."
1459
+ },
1460
+ "sideLabel": {
1461
+ "kind": "string",
1462
+ "description": "Accessible name for the sidebar landmark.",
1463
+ "default": "Sidebar"
1464
+ },
1465
+ "skipLabel": {
1466
+ "kind": "string",
1467
+ "description": "Text of the skip control that moves focus to the main region. Visually hidden until focused.",
1468
+ "default": "Skip to content"
1469
+ },
1470
+ "menuLabel": {
1471
+ "kind": "string",
1472
+ "description": "Label of the drawer button while the drawer is closed.",
1473
+ "default": "Menu"
1474
+ },
1475
+ "closeLabel": {
1476
+ "kind": "string",
1477
+ "description": "Label of the drawer button while the drawer is open.",
1478
+ "default": "Close"
1479
+ }
1480
+ },
1481
+ "state": {
1482
+ "open": {
1483
+ "description": "Present while the mobile drawer is open. On wide viewports the sidebar is always visible and this state is inert.",
1484
+ "attribute": "data-sprint-open"
1485
+ }
1486
+ },
1487
+ "a11y": {
1488
+ "notes": "Renders the only main element and an aside named by sideLabel, so the page has its landmarks without any consumer wiring. The first focusable element is a skip control that moves focus to main without touching the URL, which keeps it safe in hash-routed apps. The drawer button carries aria-expanded and aria-controls."
1489
+ },
1490
+ "relatedComponents": [
1491
+ "Nav",
1492
+ "Panel",
1493
+ "Stack"
1494
+ ],
1495
+ "examples": [
1496
+ {
1497
+ "title": "A sidebar app shell",
1498
+ "description": "One Shell per view. The sidebar collapses to a top bar with a drawer on narrow screens, and an agent reading the page sees the nav and the content with no frame in between.",
1499
+ "code": "<Shell\n bar={<Link href=\"#/\">ACME</Link>}\n side={\n <Nav label=\"Main\">\n <Link href=\"#/reports\" active>Reports</Link>\n <Link href=\"#/settings\">Settings</Link>\n </Nav>\n }\n>\n <Panel label=\"Reports\" headingLevel={2}>\n <Text>Quarterly numbers land here.</Text>\n </Panel>\n</Shell>"
1500
+ }
1501
+ ]
1502
+ },
1503
+ {
1504
+ "name": "Stack",
1505
+ "category": "layout",
1506
+ "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.",
1507
+ "whenToUse": "Use it wherever two or more things sit next to each other. Prefer it over a bare div with inline styles so spacing stays on the scale. Stack is invisible in agent view: it emits no line, because an agent does not care how a region is arranged, only what is in it.",
1508
+ "whenNotToUse": "Do not use it to draw a bordered region with a header; that is Panel. Do not nest three deep to fake a grid; use direction=\"grid\".",
1509
+ "status": "experimental",
1510
+ "props": {
1511
+ "children": {
1512
+ "kind": "node",
1513
+ "description": "The items to lay out.",
1514
+ "required": true
1515
+ },
1516
+ "direction": {
1517
+ "kind": "enum",
1518
+ "description": "Axis. \"grid\" fills as many equal columns as fit, each at least min wide.",
1519
+ "values": [
1520
+ "row",
1521
+ "column",
1522
+ "grid"
1523
+ ],
1524
+ "default": "column"
1525
+ },
1526
+ "gap": {
1527
+ "kind": "enum",
1528
+ "description": "Space between items, from the space scale.",
1529
+ "values": [
1530
+ "none",
1531
+ "tight",
1532
+ "normal",
1533
+ "loose"
1534
+ ],
1535
+ "default": "normal"
1536
+ },
1537
+ "align": {
1538
+ "kind": "enum",
1539
+ "description": "Cross-axis alignment.",
1540
+ "values": [
1541
+ "start",
1542
+ "center",
1543
+ "end",
1544
+ "stretch",
1545
+ "baseline"
1546
+ ]
1547
+ },
1548
+ "justify": {
1549
+ "kind": "enum",
1550
+ "description": "Main-axis distribution.",
1551
+ "values": [
1552
+ "start",
1553
+ "center",
1554
+ "end",
1555
+ "between"
1556
+ ]
1557
+ },
1558
+ "wrap": {
1559
+ "kind": "boolean",
1560
+ "description": "Let a row wrap onto more lines instead of overflowing.",
1561
+ "default": false
1562
+ },
1563
+ "collapse": {
1564
+ "kind": "boolean",
1565
+ "description": "Stack a row into a column on narrow viewports. This is how a toolbar survives a phone.",
1566
+ "default": false
1567
+ },
1568
+ "min": {
1569
+ "kind": "string",
1570
+ "description": "Minimum track width for direction=\"grid\", as a CSS length. Tracks never exceed the container.",
1571
+ "default": "18rem"
1572
+ }
1573
+ },
1574
+ "state": {
1575
+ "direction": {
1576
+ "description": "The axis in use.",
1577
+ "attribute": "data-sprint-direction",
1578
+ "values": [
1579
+ "row",
1580
+ "column",
1581
+ "grid"
1582
+ ]
1583
+ },
1584
+ "gap": {
1585
+ "description": "The spacing step in use.",
1586
+ "attribute": "data-sprint-gap",
1587
+ "values": [
1588
+ "none",
1589
+ "tight",
1590
+ "normal",
1591
+ "loose"
1592
+ ]
1593
+ },
1594
+ "align": {
1595
+ "description": "Cross-axis alignment, when one was asked for.",
1596
+ "attribute": "data-sprint-align",
1597
+ "values": [
1598
+ "start",
1599
+ "center",
1600
+ "end",
1601
+ "stretch",
1602
+ "baseline"
1603
+ ]
1604
+ },
1605
+ "justify": {
1606
+ "description": "Main-axis distribution, when one was asked for.",
1607
+ "attribute": "data-sprint-justify",
1608
+ "values": [
1609
+ "start",
1610
+ "center",
1611
+ "end",
1612
+ "between"
1613
+ ]
1614
+ },
1615
+ "wrap": {
1616
+ "description": "Present when a row is allowed to wrap.",
1617
+ "attribute": "data-sprint-wrap"
1618
+ },
1619
+ "collapse": {
1620
+ "description": "Present when the row stacks into a column on narrow viewports.",
1621
+ "attribute": "data-sprint-collapse"
1622
+ }
1623
+ },
1624
+ "examples": [
1625
+ {
1626
+ "title": "A row of actions",
1627
+ "description": "Wrapping keeps a toolbar from overflowing on a narrow screen.",
1628
+ "code": "<Stack direction=\"row\" gap=\"tight\" wrap>\n <Button>Cancel</Button>\n <Button tone=\"action\">Confirm</Button>\n</Stack>"
1629
+ },
1630
+ {
1631
+ "title": "A responsive card grid",
1632
+ "description": "Tracks fill the container and never go below min, so this is one column on a phone and three on a desktop with no media query of your own.",
1633
+ "code": "<Stack direction=\"grid\" min=\"16rem\">\n <Card label=\"Button\" href=\"#/Button\">One action.</Card>\n <Card label=\"Table\" href=\"#/Table\">Rows and columns.</Card>\n</Stack>"
1634
+ },
1635
+ {
1636
+ "title": "A header bar that stacks on a phone",
1637
+ "code": "<Stack direction=\"row\" justify=\"between\" align=\"center\" collapse>\n <Heading level={1}>Button</Heading>\n <Tag tone=\"warning\">experimental</Tag>\n</Stack>"
1638
+ }
1639
+ ]
1640
+ },
1641
+ {
1642
+ "name": "Switch",
1643
+ "category": "input",
1644
+ "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.",
1645
+ "whenToUse": "Use it for a live setting: enabling telemetry, muting alerts, switching a feed. The set tool takes on as true or false, so an agent states the end state and never has to read before writing.",
1646
+ "whenNotToUse": "Do not use it for a boolean a form will submit later; that is a Checkbox, and the distinction is when the change takes effect. Do not use it to choose between two named modes a person should see side by side, which is a SegmentedControl.",
1647
+ "status": "experimental",
1648
+ "props": {
1649
+ "label": {
1650
+ "kind": "string",
1651
+ "description": "What the setting controls. Names the switch for a screen reader and derives the tool name, so prefer a noun phrase such as \"Live telemetry\".",
1652
+ "required": true
1653
+ },
1654
+ "on": {
1655
+ "kind": "boolean",
1656
+ "description": "Whether the setting is on. The switch is fully controlled.",
1657
+ "required": true
1658
+ },
1659
+ "onChange": {
1660
+ "kind": "handler",
1661
+ "description": "Called with the new state. The set tool drives a real click, so this runs for agent changes too.",
1662
+ "required": true
1663
+ },
1664
+ "disabled": {
1665
+ "kind": "boolean",
1666
+ "description": "Disable the switch and unregister its set tool.",
1667
+ "default": false
1668
+ },
1669
+ "agentName": {
1670
+ "kind": "string",
1671
+ "description": "Override the label used to derive the tool name, when two switches on a page would otherwise collide."
1672
+ },
1673
+ "agentTool": {
1674
+ "kind": "boolean",
1675
+ "description": "Set false to render the switch without registering a set tool.",
1676
+ "default": true
1677
+ }
1678
+ },
1679
+ "state": {
1680
+ "on": {
1681
+ "description": "Present while the setting is on.",
1682
+ "attribute": "data-sprint-on"
1683
+ },
1684
+ "disabled": {
1685
+ "description": "Present when the switch cannot be changed.",
1686
+ "attribute": "data-sprint-disabled"
1687
+ }
1688
+ },
1689
+ "tools": {
1690
+ "set": {
1691
+ "verb": "set",
1692
+ "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.",
1693
+ "inputSchema": {
1694
+ "type": "object",
1695
+ "properties": {
1696
+ "on": {
1697
+ "type": "boolean",
1698
+ "description": "The end state: true leaves the switch on, false leaves it off."
1699
+ }
1700
+ },
1701
+ "required": [
1702
+ "on"
1703
+ ]
1704
+ },
1705
+ "readOnly": false,
1706
+ "untrustedContent": true,
1707
+ "registeredWhen": "The switch is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
1708
+ "unregisteredWhen": "The switch unmounts or becomes disabled."
1709
+ }
1710
+ },
1711
+ "agentView": {
1712
+ "example": "- **Switch** \"Live telemetry\" [on] → tool `set-live-telemetry`"
1713
+ },
1714
+ "examples": [
1715
+ {
1716
+ "title": "A live setting",
1717
+ "description": "In agent view the switch renders as one control; pressing it toggles, while the set tool states the end state.",
1718
+ "code": "<Switch label=\"Live telemetry\" on={telemetry} onChange={setTelemetry} />"
1719
+ },
1720
+ {
1721
+ "title": "A disabled switch",
1722
+ "description": "Disabled unregisters the tool, so an agent cannot change what a person could not.",
1723
+ "code": "<Switch label=\"Ground link\" on disabled onChange={setLink} />"
1724
+ }
1725
+ ],
1726
+ "a11y": {
1727
+ "role": "switch",
1728
+ "keyboard": [
1729
+ "Space toggles",
1730
+ "Enter toggles"
1731
+ ],
1732
+ "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."
1733
+ }
1734
+ },
1735
+ {
1736
+ "name": "Table",
1737
+ "category": "display",
1738
+ "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.",
1739
+ "whenToUse": "Use it for any set of records with the same shape: props, attributes, conventions, results. Passing data instead of children is what lets the agent view carry the cells and the human view restack them on a phone.",
1740
+ "whenNotToUse": "Do not use it for page layout; that is Stack. Do not put components in cells: cells are flattened to text for the agent view, so a Button inside one would lose its tool.",
1741
+ "status": "experimental",
1742
+ "props": {
1743
+ "label": {
1744
+ "kind": "string",
1745
+ "description": "What this table is a table of. Used as its accessible name and read back by the agent view.",
1746
+ "required": true
1747
+ },
1748
+ "columns": {
1749
+ "kind": "array",
1750
+ "description": "Column definitions, in display order: { key, header, align?, width? }. The key addresses the cell in each row and appears on the cell as data-sprint-column.",
1751
+ "required": true
1752
+ },
1753
+ "rows": {
1754
+ "kind": "array",
1755
+ "description": "Rows in display order: { id?, cells }, where cells maps a column key to inline content. id names the row for an agent and defaults to its 1-based position.",
1756
+ "required": true
1757
+ },
1758
+ "emptyLabel": {
1759
+ "kind": "string",
1760
+ "description": "What the table says when it has no rows.",
1761
+ "default": "No rows"
1762
+ }
1763
+ },
1764
+ "state": {
1765
+ "columns": {
1766
+ "description": "How many columns the table has.",
1767
+ "attribute": "data-sprint-columns"
1768
+ },
1769
+ "rows": {
1770
+ "description": "How many rows the table currently has.",
1771
+ "attribute": "data-sprint-rows"
1772
+ },
1773
+ "empty": {
1774
+ "description": "Present when the table has no rows.",
1775
+ "attribute": "data-sprint-empty"
1776
+ },
1777
+ "column": {
1778
+ "description": "On a cell: which column it belongs to.",
1779
+ "attribute": "data-sprint-column"
1780
+ },
1781
+ "row": {
1782
+ "description": "On a cell: which row it belongs to.",
1783
+ "attribute": "data-sprint-row"
1784
+ },
1785
+ "align": {
1786
+ "description": "On a cell: the alignment its column asked for, if any.",
1787
+ "attribute": "data-sprint-align",
1788
+ "values": [
1789
+ "start",
1790
+ "end"
1791
+ ]
1792
+ }
1793
+ },
1794
+ "agentView": {
1795
+ "example": "- **Table** \"Props\" [columns=2, rows=1]\n | row | prop | kind |\n | --- | --- | --- |\n | tone | tone | enum |"
1796
+ },
1797
+ "examples": [
1798
+ {
1799
+ "title": "A reference table",
1800
+ "description": "Cells are addressable: [data-sprint-part=\"cell\"][data-sprint-column=\"kind\"] selects a column without knowing anything about the markup.",
1801
+ "code": "<Table\n label=\"Props\"\n columns={[\n { key: \"prop\", header: \"Prop\" },\n { key: \"kind\", header: \"Kind\" },\n ]}\n rows={[{ id: \"tone\", cells: { prop: <code>tone</code>, kind: \"enum\" } }]}\n/>"
1802
+ },
1803
+ {
1804
+ "title": "A table with no rows",
1805
+ "description": "An empty table keeps its header and says so, rather than rendering a bare keyline.",
1806
+ "code": "<Table\n label=\"Registered tools\"\n emptyLabel=\"No tools registered\"\n columns={[{ key: \"name\", header: \"Name\" }]}\n rows={[]}\n/>"
1807
+ }
1808
+ ],
1809
+ "a11y": {
1810
+ "role": "table",
1811
+ "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."
1812
+ }
1813
+ },
1814
+ {
1815
+ "name": "Tag",
1816
+ "category": "display",
1817
+ "summary": "A small chip that classifies the thing next to it: a status, a category, a count, a build string.",
1818
+ "whenToUse": "Use it for a short classification a person scans and an agent reads off the tone attribute, such as a release status, a read-only or write marker on a tool, or a version chip.",
1819
+ "whenNotToUse": "Do not use it for anything clickable; a Tag is inert, and a chip that acts is a Button. Do not put a sentence in one.",
1820
+ "status": "experimental",
1821
+ "props": {
1822
+ "children": {
1823
+ "kind": "node",
1824
+ "description": "The chip text. One or two words.",
1825
+ "required": true
1826
+ },
1827
+ "tone": {
1828
+ "kind": "enum",
1829
+ "description": "What class of thing this is. Acid is rationed, so reach for info or inert before action.",
1830
+ "values": [
1831
+ "neutral",
1832
+ "action",
1833
+ "danger",
1834
+ "info",
1835
+ "warning",
1836
+ "inert"
1837
+ ],
1838
+ "default": "neutral"
1839
+ },
1840
+ "filled": {
1841
+ "kind": "boolean",
1842
+ "description": "Render as a solid field of the tone with inverted ink, instead of a keyline. Use for the one chip that must be read first.",
1843
+ "default": false
1844
+ }
1845
+ },
1846
+ "state": {
1847
+ "tone": {
1848
+ "description": "The class of thing the chip marks.",
1849
+ "attribute": "data-sprint-tone",
1850
+ "values": [
1851
+ "neutral",
1852
+ "action",
1853
+ "danger",
1854
+ "info",
1855
+ "warning",
1856
+ "inert"
1857
+ ]
1858
+ },
1859
+ "filled": {
1860
+ "description": "Present when the chip is a solid field rather than a keyline.",
1861
+ "attribute": "data-sprint-filled"
1862
+ }
1863
+ },
1864
+ "agentView": {
1865
+ "example": "- **Tag** \"experimental\" [filled, tone=warning]"
1866
+ },
1867
+ "examples": [
1868
+ {
1869
+ "title": "A release status",
1870
+ "code": "<Tag tone=\"warning\" filled>experimental</Tag>"
1871
+ },
1872
+ {
1873
+ "title": "A category chip",
1874
+ "code": "<Tag>action</Tag>"
1875
+ },
1876
+ {
1877
+ "title": "Read-only against changes-state",
1878
+ "description": "Two tones doing the work a legend would otherwise have to do in prose.",
1879
+ "code": "<Tag tone={tool.readOnly ? \"info\" : \"danger\"}>\n {tool.readOnly ? \"read only\" : \"changes state\"}\n</Tag>"
1880
+ }
1881
+ ]
1882
+ },
1883
+ {
1884
+ "name": "Text",
1885
+ "category": "typography",
1886
+ "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.",
1887
+ "whenToUse": "Use it for every paragraph, caption, note, and inline status line, so tone carries meaning instead of an ad-hoc colour. tone=\"muted\" is the small print under a heading, tone=\"warning\" and tone=\"danger\" state that something is wrong, and tone=\"action\" confirms something is live.",
1888
+ "whenNotToUse": "Do not use it for a section title; that is Heading. Do not put components inside it: it flattens its children to a single string for the agent view, so a nested Button would lose its tool.",
1889
+ "status": "experimental",
1890
+ "props": {
1891
+ "children": {
1892
+ "kind": "node",
1893
+ "description": "The prose. Inline markup such as code or strong is fine; components are not.",
1894
+ "required": true
1895
+ },
1896
+ "tone": {
1897
+ "kind": "enum",
1898
+ "description": "What the text means, not just how it looks. Agents read this off the attribute.",
1899
+ "values": [
1900
+ "default",
1901
+ "muted",
1902
+ "action",
1903
+ "info",
1904
+ "warning",
1905
+ "danger"
1906
+ ],
1907
+ "default": "default"
1908
+ },
1909
+ "size": {
1910
+ "kind": "enum",
1911
+ "description": "Type size. \"small\" is the annotation size used for notes and captions.",
1912
+ "values": [
1913
+ "small",
1914
+ "normal"
1915
+ ],
1916
+ "default": "normal"
1917
+ },
1918
+ "as": {
1919
+ "kind": "enum",
1920
+ "description": "The element to render. Use span when the text sits inside another line of text.",
1921
+ "values": [
1922
+ "p",
1923
+ "span",
1924
+ "div"
1925
+ ],
1926
+ "default": "p"
1927
+ }
1928
+ },
1929
+ "state": {
1930
+ "tone": {
1931
+ "description": "What the text is saying about the thing it describes.",
1932
+ "attribute": "data-sprint-tone",
1933
+ "values": [
1934
+ "default",
1935
+ "muted",
1936
+ "action",
1937
+ "info",
1938
+ "warning",
1939
+ "danger"
1940
+ ]
1941
+ },
1942
+ "size": {
1943
+ "description": "The type size in use.",
1944
+ "attribute": "data-sprint-size",
1945
+ "values": [
1946
+ "small",
1947
+ "normal"
1948
+ ]
1949
+ }
1950
+ },
1951
+ "agentView": {
1952
+ "example": "- **Text** \"Tools stay registered across a view switch.\" [tone=muted]"
1953
+ },
1954
+ "examples": [
1955
+ {
1956
+ "title": "A lede",
1957
+ "code": "<Text>Every component renders normally for people and as text for agents.</Text>"
1958
+ },
1959
+ {
1960
+ "title": "A note under a heading",
1961
+ "description": "The small print that would otherwise be an untyped grey span.",
1962
+ "code": "<Text tone=\"muted\" size=\"small\">Registered while the button is enabled.</Text>"
1963
+ },
1964
+ {
1965
+ "title": "A live status line",
1966
+ "description": "Tone is the whole message here, so an agent reading the attribute learns the same thing a person learns from the colour.",
1967
+ "code": "<Text tone={ready ? \"action\" : \"warning\"} size=\"small\">\n {ready ? \"WebMCP is available in this browser.\" : \"WebMCP is unavailable here.\"}\n</Text>"
1968
+ }
1969
+ ]
1970
+ },
1971
+ {
1972
+ "name": "Textarea",
1973
+ "category": "input",
1974
+ "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.",
1975
+ "whenToUse": "Use it for free-form text that runs longer than a line: a description, a message body, a set of notes. In the agent view the current content is part of the component's state line, so an agent reads what is written without a separate query.",
1976
+ "whenNotToUse": "Do not use it for a single-line value, which is a TextInput. Do not use it for code a person should read rather than write; that is a CodeBlock. Long values make long state lines, so keep it off surfaces where the agent view must stay terse.",
1977
+ "status": "experimental",
1978
+ "props": {
1979
+ "label": {
1980
+ "kind": "string",
1981
+ "description": "What the area holds. Names it for a screen reader and derives the tool name, so prefer a noun phrase such as \"Mission notes\".",
1982
+ "required": true
1983
+ },
1984
+ "value": {
1985
+ "kind": "string",
1986
+ "description": "The area's current text. The area is fully controlled.",
1987
+ "required": true
1988
+ },
1989
+ "onChange": {
1990
+ "kind": "handler",
1991
+ "description": "Called with the new text on every change. The fill tool drives a real input event, so this runs for agent fills too.",
1992
+ "required": true
1993
+ },
1994
+ "rows": {
1995
+ "kind": "number",
1996
+ "description": "The visible line count before scrolling.",
1997
+ "default": 4
1998
+ },
1999
+ "placeholder": {
2000
+ "kind": "string",
2001
+ "description": "Ghost text shown while the area is empty."
2002
+ },
2003
+ "hint": {
2004
+ "kind": "string",
2005
+ "description": "Guidance shown under the area and carried into the agent view. Replaced by error while one is set."
2006
+ },
2007
+ "error": {
2008
+ "kind": "string",
2009
+ "description": "A validation message. Marks the area invalid for people, screen readers, and agents alike."
2010
+ },
2011
+ "name": {
2012
+ "kind": "string",
2013
+ "description": "The native form name submitted with the surrounding form."
2014
+ },
2015
+ "disabled": {
2016
+ "kind": "boolean",
2017
+ "description": "Disable the area and unregister its fill tool.",
2018
+ "default": false
2019
+ },
2020
+ "required": {
2021
+ "kind": "boolean",
2022
+ "description": "Mark the area required, visually and in the agent view.",
2023
+ "default": false
2024
+ },
2025
+ "agentName": {
2026
+ "kind": "string",
2027
+ "description": "Override the label used to derive the tool name, when two areas on a page would otherwise collide."
2028
+ },
2029
+ "agentTool": {
2030
+ "kind": "boolean",
2031
+ "description": "Set false to render the area without registering a fill tool.",
2032
+ "default": true
2033
+ }
2034
+ },
2035
+ "state": {
2036
+ "value": {
2037
+ "description": "The area's current text.",
2038
+ "attribute": "data-sprint-value"
2039
+ },
2040
+ "empty": {
2041
+ "description": "Present while the area holds no text.",
2042
+ "attribute": "data-sprint-empty"
2043
+ },
2044
+ "disabled": {
2045
+ "description": "Present when the area cannot be edited.",
2046
+ "attribute": "data-sprint-disabled"
2047
+ },
2048
+ "required": {
2049
+ "description": "Present when the area must be filled.",
2050
+ "attribute": "data-sprint-required"
2051
+ },
2052
+ "invalid": {
2053
+ "description": "Present while an error is set.",
2054
+ "attribute": "data-sprint-invalid"
2055
+ }
2056
+ },
2057
+ "tools": {
2058
+ "fill": {
2059
+ "verb": "fill",
2060
+ "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.",
2061
+ "inputSchema": {
2062
+ "type": "object",
2063
+ "properties": {
2064
+ "value": {
2065
+ "type": "string",
2066
+ "description": "The full text the area should contain afterwards, with real line breaks where line breaks belong. Replaces the current text."
2067
+ }
2068
+ },
2069
+ "required": [
2070
+ "value"
2071
+ ]
2072
+ },
2073
+ "readOnly": false,
2074
+ "untrustedContent": true,
2075
+ "registeredWhen": "The area is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
2076
+ "unregisteredWhen": "The area unmounts or becomes disabled."
2077
+ }
2078
+ },
2079
+ "agentView": {
2080
+ "example": "- **Textarea** \"Mission notes\" [empty] → tool `fill-mission-notes`\n - part `hint` \"What the relief crew needs to know\""
2081
+ },
2082
+ "examples": [
2083
+ {
2084
+ "title": "A notes area",
2085
+ "description": "Label, hint, and control are one component. In agent view it renders a live textarea an agent can type into.",
2086
+ "code": "<Textarea\n label=\"Mission notes\"\n value={notes}\n onChange={setNotes}\n hint=\"What the relief crew needs to know\"\n/>"
2087
+ },
2088
+ {
2089
+ "title": "A required area with an error",
2090
+ "description": "The error replaces the hint and marks the area invalid on every surface.",
2091
+ "code": "<Textarea\n label=\"Abort reason\"\n value={reason}\n onChange={setReason}\n required\n rows={3}\n error=\"State the reason before aborting.\"\n/>"
2092
+ }
2093
+ ],
2094
+ "a11y": {
2095
+ "role": "textbox",
2096
+ "keyboard": [
2097
+ "Standard text editing",
2098
+ "Enter inserts a line break"
2099
+ ],
2100
+ "notes": "The label element is associated via htmlFor. An error sets aria-invalid and is linked with aria-describedby, as is the hint."
2101
+ }
2102
+ },
2103
+ {
2104
+ "name": "TextInput",
2105
+ "category": "input",
2106
+ "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.",
2107
+ "whenToUse": "Use it for any free-form single-line value: a name, an email address, a search term. The label is part of the component, so a form never needs a separate label element, and the error prop is how validation reaches both a person and an agent.",
2108
+ "whenNotToUse": "Do not use it for multi-line text, which is a Textarea. Do not use it to pick from a known set of values; that is a Select or a SegmentedControl. Do not use it for an on/off state, which is a Checkbox or a Switch.",
2109
+ "status": "experimental",
2110
+ "props": {
2111
+ "label": {
2112
+ "kind": "string",
2113
+ "description": "What the field holds. Names the field for a screen reader and derives the tool name, so prefer a noun phrase such as \"Callsign\".",
2114
+ "required": true
2115
+ },
2116
+ "value": {
2117
+ "kind": "string",
2118
+ "description": "The field's current text. The field is fully controlled.",
2119
+ "required": true
2120
+ },
2121
+ "onChange": {
2122
+ "kind": "handler",
2123
+ "description": "Called with the new text on every change. The fill tool drives a real input event, so this runs for agent fills too.",
2124
+ "required": true
2125
+ },
2126
+ "type": {
2127
+ "kind": "enum",
2128
+ "description": "The input type. \"password\" masks the field everywhere: the value never appears in agent attributes, the agent view, or tool results.",
2129
+ "values": [
2130
+ "text",
2131
+ "email",
2132
+ "url",
2133
+ "search",
2134
+ "password"
2135
+ ],
2136
+ "default": "text"
2137
+ },
2138
+ "placeholder": {
2139
+ "kind": "string",
2140
+ "description": "Ghost text shown while the field is empty."
2141
+ },
2142
+ "hint": {
2143
+ "kind": "string",
2144
+ "description": "Guidance shown under the field and carried into the agent view. Replaced by error while one is set."
2145
+ },
2146
+ "error": {
2147
+ "kind": "string",
2148
+ "description": "A validation message. Marks the field invalid for people, screen readers, and agents alike."
2149
+ },
2150
+ "name": {
2151
+ "kind": "string",
2152
+ "description": "The native form name submitted with the surrounding form."
2153
+ },
2154
+ "autoComplete": {
2155
+ "kind": "string",
2156
+ "description": "The native autocomplete hint, forwarded to the input."
2157
+ },
2158
+ "disabled": {
2159
+ "kind": "boolean",
2160
+ "description": "Disable the field and unregister its fill tool.",
2161
+ "default": false
2162
+ },
2163
+ "required": {
2164
+ "kind": "boolean",
2165
+ "description": "Mark the field required, visually and in the agent view.",
2166
+ "default": false
2167
+ },
2168
+ "agentName": {
2169
+ "kind": "string",
2170
+ "description": "Override the label used to derive the tool name, when two fields on a page would otherwise collide."
2171
+ },
2172
+ "agentTool": {
2173
+ "kind": "boolean",
2174
+ "description": "Set false to render the field without registering a fill tool.",
2175
+ "default": true
2176
+ }
2177
+ },
2178
+ "state": {
2179
+ "value": {
2180
+ "description": "The field's current text. Never present on a password field, which reflects filled instead.",
2181
+ "attribute": "data-sprint-value"
2182
+ },
2183
+ "filled": {
2184
+ "description": "Present when a password field holds text.",
2185
+ "attribute": "data-sprint-filled"
2186
+ },
2187
+ "empty": {
2188
+ "description": "Present while the field holds no text.",
2189
+ "attribute": "data-sprint-empty"
2190
+ },
2191
+ "disabled": {
2192
+ "description": "Present when the field cannot be edited.",
2193
+ "attribute": "data-sprint-disabled"
2194
+ },
2195
+ "required": {
2196
+ "description": "Present when the field must be filled.",
2197
+ "attribute": "data-sprint-required"
2198
+ },
2199
+ "invalid": {
2200
+ "description": "Present while an error is set.",
2201
+ "attribute": "data-sprint-invalid"
2202
+ }
2203
+ },
2204
+ "tools": {
2205
+ "fill": {
2206
+ "verb": "fill",
2207
+ "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.",
2208
+ "inputSchema": {
2209
+ "type": "object",
2210
+ "properties": {
2211
+ "value": {
2212
+ "type": "string",
2213
+ "description": "The full text the field should contain afterwards. Replaces the current text rather than appending to it."
2214
+ }
2215
+ },
2216
+ "required": [
2217
+ "value"
2218
+ ]
2219
+ },
2220
+ "readOnly": false,
2221
+ "untrustedContent": true,
2222
+ "registeredWhen": "The field is mounted, enabled, has a resolvable label, and no other component claims the same tool name.",
2223
+ "unregisteredWhen": "The field unmounts or becomes disabled."
2224
+ }
2225
+ },
2226
+ "agentView": {
2227
+ "example": "- **TextInput** \"Callsign\" [empty, required] → tool `fill-callsign`\n - part `hint` \"Uppercase, three to eight letters\""
2228
+ },
2229
+ "examples": [
2230
+ {
2231
+ "title": "A labelled field",
2232
+ "description": "Label, hint, and control are one component. In agent view the hint becomes a part line and the field renders a live input an agent can type into.",
2233
+ "code": "<TextInput\n label=\"Callsign\"\n value={callsign}\n onChange={setCallsign}\n hint=\"Uppercase, three to eight letters\"\n placeholder=\"NOMAD\"\n/>"
2234
+ },
2235
+ {
2236
+ "title": "A validation error",
2237
+ "description": "The error replaces the hint, marks the field invalid on every surface, and reads back through the fill tool's result.",
2238
+ "code": "<TextInput\n label=\"Frequency\"\n value={frequency}\n onChange={setFrequency}\n required\n error=\"Out of band. Use 118.000 to 136.975.\"\n/>"
2239
+ },
2240
+ {
2241
+ "title": "A password",
2242
+ "description": "The value stays off every agent surface: state reflects filled or empty, and tool results never echo the text.",
2243
+ "code": "<TextInput\n label=\"Access code\"\n type=\"password\"\n value={code}\n onChange={setCode}\n autoComplete=\"current-password\"\n/>"
2244
+ }
2245
+ ],
2246
+ "a11y": {
2247
+ "role": "textbox",
2248
+ "keyboard": [
2249
+ "Standard text editing",
2250
+ "Tab moves through the field"
2251
+ ],
2252
+ "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."
2253
+ }
2254
+ }
2255
+ ]
2256
+ }