altitude-design 0.2.1 → 0.3.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.
Files changed (295) hide show
  1. package/README.md +42 -7
  2. package/dist/adapters/codemirror.cjs +88 -0
  3. package/dist/adapters/codemirror.cjs.map +7 -0
  4. package/dist/adapters/codemirror.js +67 -0
  5. package/dist/adapters/codemirror.js.map +7 -0
  6. package/dist/adapters/react-flow.css +102 -0
  7. package/dist/adapters/tiptap.css +71 -0
  8. package/dist/altitude.css +3121 -244
  9. package/dist/altitude.iife.js +33 -5
  10. package/dist/altitude.no-fonts.css +3121 -244
  11. package/dist/chart-themes.cjs +195 -0
  12. package/dist/chart-themes.cjs.map +7 -0
  13. package/dist/chart-themes.js +165 -0
  14. package/dist/chart-themes.js.map +7 -0
  15. package/dist/cli/altitude.mjs +134 -0
  16. package/dist/guidance/README.md +32 -0
  17. package/dist/guidance/agent-setup.md +22 -0
  18. package/dist/guidance/app-skeleton.md +17 -0
  19. package/dist/guidance/evidence.json +95 -0
  20. package/dist/guidance/index.json +493 -0
  21. package/dist/guidance/llms.txt +20 -0
  22. package/dist/guidance/manifest.json +92 -0
  23. package/dist/guidance/pattern.schema.json +181 -0
  24. package/dist/guidance/patterns/agent-action.json +77 -0
  25. package/dist/guidance/patterns/agent-action.md +39 -0
  26. package/dist/guidance/patterns/assistant-conversation.json +77 -0
  27. package/dist/guidance/patterns/assistant-conversation.md +50 -0
  28. package/dist/guidance/patterns/async-collection.json +71 -0
  29. package/dist/guidance/patterns/async-collection.md +29 -0
  30. package/dist/guidance/patterns/audit-log.json +75 -0
  31. package/dist/guidance/patterns/audit-log.md +27 -0
  32. package/dist/guidance/patterns/auth.json +86 -0
  33. package/dist/guidance/patterns/auth.md +29 -0
  34. package/dist/guidance/patterns/billing.json +80 -0
  35. package/dist/guidance/patterns/billing.md +29 -0
  36. package/dist/guidance/patterns/consequential-action.json +76 -0
  37. package/dist/guidance/patterns/consequential-action.md +27 -0
  38. package/dist/guidance/patterns/developer-settings.json +79 -0
  39. package/dist/guidance/patterns/developer-settings.md +29 -0
  40. package/dist/guidance/patterns/edit-record.json +74 -0
  41. package/dist/guidance/patterns/edit-record.md +51 -0
  42. package/dist/guidance/patterns/import.json +77 -0
  43. package/dist/guidance/patterns/import.md +31 -0
  44. package/dist/guidance/patterns/members.json +77 -0
  45. package/dist/guidance/patterns/members.md +27 -0
  46. package/dist/guidance/patterns/onboarding.json +78 -0
  47. package/dist/guidance/patterns/onboarding.md +31 -0
  48. package/dist/guidance/patterns/review-submit.json +72 -0
  49. package/dist/guidance/patterns/review-submit.md +27 -0
  50. package/dist/guidance/patterns/screen-layout.json +79 -0
  51. package/dist/guidance/patterns/screen-layout.md +40 -0
  52. package/dist/guidance/patterns/settings.json +78 -0
  53. package/dist/guidance/patterns/settings.md +32 -0
  54. package/dist/guidance/patterns/sync.json +77 -0
  55. package/dist/guidance/patterns/sync.md +31 -0
  56. package/dist/guidance/principles.md +23 -0
  57. package/dist/guidance/references/build/checks/agent-action-pattern.mjs +57 -0
  58. package/dist/guidance/references/build/checks/agent-setup.mjs +78 -0
  59. package/dist/guidance/references/build/checks/assistant-conversation-pattern.mjs +49 -0
  60. package/dist/guidance/references/build/checks/audit-log-pattern.mjs +63 -0
  61. package/dist/guidance/references/build/checks/auth-pattern.mjs +67 -0
  62. package/dist/guidance/references/build/checks/billing-pattern.mjs +63 -0
  63. package/dist/guidance/references/build/checks/developer-settings-pattern.mjs +76 -0
  64. package/dist/guidance/references/build/checks/guidance.mjs +71 -0
  65. package/dist/guidance/references/build/checks/import-pattern.mjs +69 -0
  66. package/dist/guidance/references/build/checks/members-pattern.mjs +71 -0
  67. package/dist/guidance/references/build/checks/onboarding-pattern.mjs +54 -0
  68. package/dist/guidance/references/build/checks/pattern-types.mjs +13 -0
  69. package/dist/guidance/references/build/checks/pattern-workflows.mjs +226 -0
  70. package/dist/guidance/references/build/checks/primary-scope.mjs +49 -0
  71. package/dist/guidance/references/build/checks/render-tells.mjs +72 -0
  72. package/dist/guidance/references/build/checks/screen-layout-pattern.mjs +111 -0
  73. package/dist/guidance/references/build/checks/semantics.mjs +72 -0
  74. package/dist/guidance/references/build/checks/settings-pattern.mjs +73 -0
  75. package/dist/guidance/references/build/checks/sync-pattern.mjs +62 -0
  76. package/dist/guidance/references/build/checks/tells-lint.mjs +164 -0
  77. package/dist/guidance/references/build/fixtures/pattern-workflows.tsx +83 -0
  78. package/dist/guidance/references/build/fixtures/patterns/agent-action.jsx +60 -0
  79. package/dist/guidance/references/build/fixtures/patterns/app-skeleton.jsx +94 -0
  80. package/dist/guidance/references/build/fixtures/patterns/assistant-conversation.jsx +79 -0
  81. package/dist/guidance/references/build/fixtures/patterns/audit-log.jsx +81 -0
  82. package/dist/guidance/references/build/fixtures/patterns/auth.jsx +150 -0
  83. package/dist/guidance/references/build/fixtures/patterns/billing.jsx +96 -0
  84. package/dist/guidance/references/build/fixtures/patterns/developer-settings.jsx +95 -0
  85. package/dist/guidance/references/build/fixtures/patterns/import.jsx +102 -0
  86. package/dist/guidance/references/build/fixtures/patterns/members.jsx +106 -0
  87. package/dist/guidance/references/build/fixtures/patterns/onboarding.jsx +70 -0
  88. package/dist/guidance/references/build/fixtures/patterns/screen-layout-decision.jsx +74 -0
  89. package/dist/guidance/references/build/fixtures/patterns/screen-layout-editor.jsx +56 -0
  90. package/dist/guidance/references/build/fixtures/patterns/screen-layout-report.jsx +42 -0
  91. package/dist/guidance/references/build/fixtures/patterns/settings.jsx +73 -0
  92. package/dist/guidance/references/build/fixtures/patterns/sync.jsx +78 -0
  93. package/dist/guidance/references/project/components/src/pattern-async-collection.tsx +57 -0
  94. package/dist/guidance/references/project/components/src/pattern-consequential-action.tsx +77 -0
  95. package/dist/guidance/references/project/components/src/pattern-edit-record.tsx +127 -0
  96. package/dist/guidance/references/project/components/src/pattern-review-submit.tsx +47 -0
  97. package/dist/guidance/references/project/components/src/settings.tsx +79 -0
  98. package/dist/guidance/references/scripts/build-framework-fixture.mjs +20 -0
  99. package/dist/guidance/rules.json +653 -0
  100. package/dist/guidance/visual/Elevation.md +194 -0
  101. package/dist/guidance/visual/Fundamentals.md +83 -0
  102. package/dist/guidance/visual/Research.md +1620 -0
  103. package/dist/index.cjs +18795 -1925
  104. package/dist/index.cjs.map +4 -4
  105. package/dist/index.js +18795 -1925
  106. package/dist/index.js.map +4 -4
  107. package/dist/tokens.css +84 -84
  108. package/dist/tokens.json +301 -128
  109. package/dist/types/adapter-codemirror.d.ts +13 -0
  110. package/dist/types/agent-fleet.d.ts +166 -0
  111. package/dist/types/ai-label.d.ts +30 -0
  112. package/dist/types/app-shell.d.ts +83 -0
  113. package/dist/types/area-chart.d.ts +80 -0
  114. package/dist/types/artifact.d.ts +65 -0
  115. package/dist/types/bar-chart.d.ts +83 -0
  116. package/dist/types/bar-list.d.ts +35 -0
  117. package/dist/types/breadcrumb.d.ts +62 -0
  118. package/dist/types/chart-brush.d.ts +35 -0
  119. package/dist/types/chart-themes.d.ts +229 -0
  120. package/dist/types/chart.d.ts +570 -0
  121. package/dist/types/checklist.d.ts +71 -0
  122. package/dist/types/code-block.d.ts +32 -0
  123. package/dist/types/collections.d.ts +111 -4
  124. package/dist/types/color-picker.d.ts +38 -0
  125. package/dist/types/command.d.ts +6 -3
  126. package/dist/types/comment-thread.d.ts +48 -0
  127. package/dist/types/confirmation.d.ts +60 -0
  128. package/dist/types/context-menu.d.ts +17 -0
  129. package/dist/types/controls.d.ts +100 -17
  130. package/dist/types/conversation.d.ts +130 -0
  131. package/dist/types/copy-button.d.ts +19 -0
  132. package/dist/types/core.d.ts +139 -10
  133. package/dist/types/data-grid.d.ts +76 -0
  134. package/dist/types/date-picker.d.ts +96 -0
  135. package/dist/types/diff-view.d.ts +54 -0
  136. package/dist/types/dot-plot.d.ts +54 -0
  137. package/dist/types/edit-region.d.ts +121 -0
  138. package/dist/types/feature-gate.d.ts +22 -0
  139. package/dist/types/filter-bar.d.ts +65 -0
  140. package/dist/types/formatted-number.d.ts +38 -0
  141. package/dist/types/heatmap.d.ts +64 -0
  142. package/dist/types/in-place.d.ts +24 -0
  143. package/dist/types/index.d.ts +158 -15
  144. package/dist/types/inline-citation.d.ts +35 -0
  145. package/dist/types/inline-edit.d.ts +71 -0
  146. package/dist/types/input-otp.d.ts +37 -0
  147. package/dist/types/item-group.d.ts +104 -0
  148. package/dist/types/line-chart.d.ts +116 -0
  149. package/dist/types/link.d.ts +11 -0
  150. package/dist/types/markdown.d.ts +88 -0
  151. package/dist/types/meter.d.ts +43 -0
  152. package/dist/types/modal-state.d.ts +62 -0
  153. package/dist/types/nav.d.ts +8 -1
  154. package/dist/types/notifications.d.ts +42 -0
  155. package/dist/types/number-input.d.ts +30 -0
  156. package/dist/types/overlays.d.ts +51 -17
  157. package/dist/types/page-header.d.ts +27 -0
  158. package/dist/types/pagination.d.ts +29 -0
  159. package/dist/types/palette.d.ts +64 -0
  160. package/dist/types/password-input.d.ts +22 -0
  161. package/dist/types/pattern-assistant-conversation.d.ts +55 -0
  162. package/dist/types/pattern-async-collection.d.ts +34 -0
  163. package/dist/types/pattern-consequential-action.d.ts +53 -0
  164. package/dist/types/pattern-edit-record.d.ts +72 -0
  165. package/dist/types/pattern-review-submit.d.ts +43 -0
  166. package/dist/types/permission-matrix.d.ts +34 -0
  167. package/dist/types/plan-picker.d.ts +40 -0
  168. package/dist/types/prompt-input.d.ts +106 -0
  169. package/dist/types/property-list.d.ts +67 -0
  170. package/dist/types/question.d.ts +64 -0
  171. package/dist/types/relative-time.d.ts +21 -0
  172. package/dist/types/removal-receipt.d.ts +1180 -0
  173. package/dist/types/resizable.d.ts +48 -0
  174. package/dist/types/roving.d.ts +44 -0
  175. package/dist/types/save-bar.d.ts +38 -0
  176. package/dist/types/saved-views.d.ts +72 -0
  177. package/dist/types/scatter-chart.d.ts +60 -0
  178. package/dist/types/schedule.d.ts +80 -0
  179. package/dist/types/secret-field.d.ts +33 -0
  180. package/dist/types/select.d.ts +44 -2
  181. package/dist/types/separator.d.ts +11 -0
  182. package/dist/types/settings.d.ts +39 -0
  183. package/dist/types/sheet.d.ts +1 -1
  184. package/dist/types/sparkline.d.ts +46 -0
  185. package/dist/types/split-button.d.ts +21 -0
  186. package/dist/types/stat.d.ts +54 -0
  187. package/dist/types/stepper.d.ts +6 -3
  188. package/dist/types/suggestions.d.ts +29 -0
  189. package/dist/types/suspense.d.ts +12 -1
  190. package/dist/types/sync-indicator.d.ts +24 -0
  191. package/dist/types/tag-input.d.ts +65 -0
  192. package/dist/types/terminal.d.ts +33 -0
  193. package/dist/types/thread-list.d.ts +58 -0
  194. package/dist/types/time-input.d.ts +33 -0
  195. package/dist/types/timeline.d.ts +38 -0
  196. package/dist/types/toggle.d.ts +46 -0
  197. package/dist/types/toolbar.d.ts +34 -0
  198. package/dist/types/tour.d.ts +23 -0
  199. package/dist/types/trace.d.ts +65 -0
  200. package/dist/types/tree.d.ts +71 -0
  201. package/dist/types-cjs/adapter-codemirror.d.cts +13 -0
  202. package/dist/types-cjs/agent-fleet.d.cts +166 -0
  203. package/dist/types-cjs/ai-label.d.cts +30 -0
  204. package/dist/types-cjs/app-shell.d.cts +83 -0
  205. package/dist/types-cjs/area-chart.d.cts +80 -0
  206. package/dist/types-cjs/artifact.d.cts +65 -0
  207. package/dist/types-cjs/bar-chart.d.cts +83 -0
  208. package/dist/types-cjs/bar-list.d.cts +35 -0
  209. package/dist/types-cjs/breadcrumb.d.cts +62 -0
  210. package/dist/types-cjs/chart-brush.d.cts +35 -0
  211. package/dist/types-cjs/chart-themes.d.cts +229 -0
  212. package/dist/types-cjs/chart.d.cts +570 -0
  213. package/dist/types-cjs/checklist.d.cts +71 -0
  214. package/dist/types-cjs/code-block.d.cts +32 -0
  215. package/dist/types-cjs/collections.d.cts +246 -0
  216. package/dist/types-cjs/color-picker.d.cts +38 -0
  217. package/dist/types-cjs/command.d.cts +66 -0
  218. package/dist/types-cjs/comment-thread.d.cts +48 -0
  219. package/dist/types-cjs/confirmation.d.cts +60 -0
  220. package/dist/types-cjs/context-menu.d.cts +17 -0
  221. package/dist/types-cjs/controls.d.cts +360 -0
  222. package/dist/types-cjs/conversation.d.cts +130 -0
  223. package/dist/types-cjs/copy-button.d.cts +19 -0
  224. package/dist/types-cjs/core.d.cts +256 -0
  225. package/dist/types-cjs/data-grid.d.cts +76 -0
  226. package/dist/types-cjs/date-picker.d.cts +96 -0
  227. package/dist/types-cjs/diff-view.d.cts +54 -0
  228. package/dist/types-cjs/dot-plot.d.cts +54 -0
  229. package/dist/types-cjs/edit-region.d.cts +121 -0
  230. package/dist/types-cjs/empty.d.cts +24 -0
  231. package/dist/types-cjs/feature-gate.d.cts +22 -0
  232. package/dist/types-cjs/filter-bar.d.cts +65 -0
  233. package/dist/types-cjs/formatted-number.d.cts +38 -0
  234. package/dist/types-cjs/heatmap.d.cts +64 -0
  235. package/dist/types-cjs/in-place.d.cts +24 -0
  236. package/dist/types-cjs/index.d.cts +154 -0
  237. package/dist/types-cjs/inline-citation.d.cts +35 -0
  238. package/dist/types-cjs/inline-edit.d.cts +71 -0
  239. package/dist/types-cjs/input-otp.d.cts +37 -0
  240. package/dist/types-cjs/item-group.d.cts +104 -0
  241. package/dist/types-cjs/line-chart.d.cts +116 -0
  242. package/dist/types-cjs/link.d.cts +11 -0
  243. package/dist/types-cjs/markdown.d.cts +88 -0
  244. package/dist/types-cjs/meter.d.cts +43 -0
  245. package/dist/types-cjs/modal-state.d.cts +62 -0
  246. package/dist/types-cjs/nav.d.cts +25 -0
  247. package/dist/types-cjs/notifications.d.cts +42 -0
  248. package/dist/types-cjs/number-input.d.cts +30 -0
  249. package/dist/types-cjs/overlays.d.cts +170 -0
  250. package/dist/types-cjs/page-header.d.cts +27 -0
  251. package/dist/types-cjs/pagination.d.cts +29 -0
  252. package/dist/types-cjs/palette.d.cts +64 -0
  253. package/dist/types-cjs/password-input.d.cts +22 -0
  254. package/dist/types-cjs/pattern-assistant-conversation.d.cts +55 -0
  255. package/dist/types-cjs/pattern-async-collection.d.cts +34 -0
  256. package/dist/types-cjs/pattern-consequential-action.d.cts +53 -0
  257. package/dist/types-cjs/pattern-edit-record.d.cts +72 -0
  258. package/dist/types-cjs/pattern-review-submit.d.cts +43 -0
  259. package/dist/types-cjs/permission-matrix.d.cts +34 -0
  260. package/dist/types-cjs/pile.d.cts +27 -0
  261. package/dist/types-cjs/plan-picker.d.cts +40 -0
  262. package/dist/types-cjs/prompt-input.d.cts +106 -0
  263. package/dist/types-cjs/property-list.d.cts +67 -0
  264. package/dist/types-cjs/question.d.cts +64 -0
  265. package/dist/types-cjs/relative-time.d.cts +21 -0
  266. package/dist/types-cjs/removal-receipt.d.cts +1180 -0
  267. package/dist/types-cjs/resizable.d.cts +48 -0
  268. package/dist/types-cjs/roving.d.cts +44 -0
  269. package/dist/types-cjs/save-bar.d.cts +38 -0
  270. package/dist/types-cjs/saved-views.d.cts +72 -0
  271. package/dist/types-cjs/scatter-chart.d.cts +60 -0
  272. package/dist/types-cjs/schedule.d.cts +80 -0
  273. package/dist/types-cjs/secret-field.d.cts +33 -0
  274. package/dist/types-cjs/select.d.cts +109 -0
  275. package/dist/types-cjs/separator.d.cts +11 -0
  276. package/dist/types-cjs/settings.d.cts +39 -0
  277. package/dist/types-cjs/sheet.d.cts +27 -0
  278. package/dist/types-cjs/sparkline.d.cts +46 -0
  279. package/dist/types-cjs/split-button.d.cts +21 -0
  280. package/dist/types-cjs/stat.d.cts +54 -0
  281. package/dist/types-cjs/stepper.d.cts +26 -0
  282. package/dist/types-cjs/suggestions.d.cts +29 -0
  283. package/dist/types-cjs/suspense.d.cts +85 -0
  284. package/dist/types-cjs/sync-indicator.d.cts +24 -0
  285. package/dist/types-cjs/tag-input.d.cts +65 -0
  286. package/dist/types-cjs/terminal.d.cts +33 -0
  287. package/dist/types-cjs/thread-list.d.cts +58 -0
  288. package/dist/types-cjs/time-input.d.cts +33 -0
  289. package/dist/types-cjs/timeline.d.cts +38 -0
  290. package/dist/types-cjs/toggle.d.cts +46 -0
  291. package/dist/types-cjs/toolbar.d.cts +34 -0
  292. package/dist/types-cjs/tour.d.cts +23 -0
  293. package/dist/types-cjs/trace.d.cts +65 -0
  294. package/dist/types-cjs/tree.d.cts +71 -0
  295. package/package.json +89 -9
@@ -0,0 +1,92 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "version": "0.3.1",
4
+ "files": {
5
+ "agent-setup.md": "5b300079b150d6416b6dd00280a42110559c85d50b84a13ac6cf9e0329be9a21",
6
+ "app-skeleton.md": "bc70896a86f4c1dbd3467620562eec62ccf99a9356ff72a7eab8621f492554d9",
7
+ "evidence.json": "ac99cfcca61219a4a25c75adf84c89f6c3e47b3713a8fb8209180c824d565b1b",
8
+ "index.json": "8a840db2e00c75b87fe6aca5e066cc0af1d59305f0789a9f845b77e5330113f4",
9
+ "llms.txt": "c58ed1e25f99aed16c1003777230df4af94cdeabb39db73bc0122dd0885671b0",
10
+ "pattern.schema.json": "abcb37bd5de4a74f27ac079e587e5d288b23e491569a73971f1a31131a37d309",
11
+ "patterns/agent-action.json": "532915c25183d1a6093d9e14b929f3e49d29e400b116ef0612d933d70d49b09a",
12
+ "patterns/agent-action.md": "a11e9d98a84d8a0fae755bae3e618e7daa2608f1f853cfe88e2e58ee74cc01e7",
13
+ "patterns/assistant-conversation.json": "63d7321b87e90f0bbeaf75f12dcb6ffd5cee40dccd769b2b2062932f0b40f226",
14
+ "patterns/assistant-conversation.md": "41fa199f874b1849b3afe19d5c6cc498ddfd20c7cae198b4a2a1feac6747849d",
15
+ "patterns/async-collection.json": "b004d1edd6d9b5f03f4db5092bcd896914d66c8575da9efde47c9654ca3b83e6",
16
+ "patterns/async-collection.md": "4bcb8612436af5b730999d5a31e1f25eaad2ded4862c7639136a2f83b11cac4a",
17
+ "patterns/audit-log.json": "661471f05d07fae8ae0b920c5e1e674906e98829a3e6eed4f01b39c8d053d58a",
18
+ "patterns/audit-log.md": "2d245c2537fd874e09a44004c11a57a6a6b9504330df86263842a84afb0541af",
19
+ "patterns/auth.json": "c9439ecf8196750d887d7a99b135de89d926b365acfecc9a6f7b66d2bbb8c679",
20
+ "patterns/auth.md": "aba431dd58284485f6ae8472056342f72c643eeb7d77edd1eb92336f5bf1d5da",
21
+ "patterns/billing.json": "8a72249c29ebb5b5eefbd98294e3fcfe45b5ddcebf4f7f7e8aa409388bc882e5",
22
+ "patterns/billing.md": "9b9c639d868a0735d8be88d030fdec1db1f43e2bedb9dcb014e39ca79c1fe5bf",
23
+ "patterns/consequential-action.json": "e5a61a89753efed1408cf0b1a5826b607b19c3fbbabf7d3f0b1b2586df24b506",
24
+ "patterns/consequential-action.md": "f4efb5000325416d1b44c7f2ea906420cf8c1fd7b330e7754fac0ba5025c1fc4",
25
+ "patterns/developer-settings.json": "54443991d65410c20b2285caa2265b1662d60188b084969cad3dc6fe6a681fa1",
26
+ "patterns/developer-settings.md": "22eb20642649ad872a53771fd56bfd8051d18bb8cdf4756ccb6581c886db319b",
27
+ "patterns/edit-record.json": "7d4249bbbd1c0c09afc8e4f3d1e6e688d2404db29e17db44cd5445427c570537",
28
+ "patterns/edit-record.md": "a999de3810380ac20ae4045e5cb2dc3fae9d4d654f55a8d7da2fea4dfc3e746f",
29
+ "patterns/import.json": "d1a47a24a15bee87d177b173327d0ba4f9791b7345e3d33f3c97aa960816761f",
30
+ "patterns/import.md": "c44373f9639707b7b8e4ededdf3c3426dc3a75cd5e2b62577fdac4853c3cbaa1",
31
+ "patterns/members.json": "f2567081cd05f65c64f92890a79afd64864992ec66903755a20a7c1d4411702a",
32
+ "patterns/members.md": "b2a42c5f470ce8fd6d96d9630b5c6be452716053f9085cbc6ce87372087d5a43",
33
+ "patterns/onboarding.json": "e831f904db32cb01a48f11cba9ef77704d986e0adb8d53a139a54bd4124704ba",
34
+ "patterns/onboarding.md": "6948c0d7bc99334af1132d41f28b6ea9399b7491115160d5e664280131bad4c4",
35
+ "patterns/review-submit.json": "79b15332acc57fb48b0b99ba98a195d5f913e7875293b0acb6aa42f5425a982b",
36
+ "patterns/review-submit.md": "6a9d1886a48cad9e82da5c8b04d179425ec4fa925105d6f9ee50d4605dab3d87",
37
+ "patterns/screen-layout.json": "199ca3f20a7af1983bc7211406bbf87e43328e3d57c48d29524191de86507782",
38
+ "patterns/screen-layout.md": "7a6dd92249e1b8acbb5ab16afb15f5d3aa25e46fedf8d59eb40a4d892b22310e",
39
+ "patterns/settings.json": "9ae72e95cb61b5f41a22053d408c2a634c18746661fa1c2e41e98a5ef2b6e08f",
40
+ "patterns/settings.md": "dea76175e2b1b4347414c3716f0ff61fd584bf10b8fd45548449694c86027bbf",
41
+ "patterns/sync.json": "e127992aaba5ad797a0c27ff0f7903619511e9a02379b6932c66084d3690660e",
42
+ "patterns/sync.md": "9b6c6928fe19c6f28b88bd092997c0c0645aedddf02a25327a1c7c60969e3729",
43
+ "principles.md": "1c57c684c4b0029012a79d6a38b26b8821abf75852b14db2b18b7e7f6d364b32",
44
+ "README.md": "2b37096e2c13fbff4578c53ebbc38329f49a4050b9d1757125a42ab778785125",
45
+ "references/build/checks/agent-action-pattern.mjs": "166f5765839d2f60e7bd84cda2a834100306b3d5a80b4b45b79f2c2d33fce1e7",
46
+ "references/build/checks/agent-setup.mjs": "670c0786bdfc5739fceae14bd234a2a2c9c6672fbe6fd4e72b15f85647f4a1dd",
47
+ "references/build/checks/assistant-conversation-pattern.mjs": "f289529c2ee594ad28269337da762f00ae1143f8bb217cf36b1596a5a5363618",
48
+ "references/build/checks/audit-log-pattern.mjs": "af7770e7bf08caa9e1875161e4fc39509e4f0a84e612cdf79cb547cb6046af74",
49
+ "references/build/checks/auth-pattern.mjs": "7406cfa7c29c3bb3ac9075c8af079c6f7fd0bc296e81fef1c62667ec245c660b",
50
+ "references/build/checks/billing-pattern.mjs": "75e1809769420bc4c714ba0ddb1298489af7152603018d980182e6131182edc2",
51
+ "references/build/checks/developer-settings-pattern.mjs": "946cf163177db4aa4dfa30dac754d0229bc4b703ef1eac17a17dc35d19e2f093",
52
+ "references/build/checks/guidance.mjs": "65bca118879294288c14f296db3ba225ed953fb295e4010487fb7bae16c1bf51",
53
+ "references/build/checks/import-pattern.mjs": "6b98c0533bb0d8584ba0d677e579a0fdfdbdb5bd4663f261ecbdfb39181c45f6",
54
+ "references/build/checks/members-pattern.mjs": "bd550c7315dd6298efc1d524364dcfb505884a2e32bb9ed7c4995b53cc61a2a5",
55
+ "references/build/checks/onboarding-pattern.mjs": "721ef5a202365d3597985bff9ade68bf3312c309687e846ce9a1669dcc00cae2",
56
+ "references/build/checks/pattern-types.mjs": "858431d8b622af096b8a41f35df1789343f96aa07433e8a98185b8740a1ded19",
57
+ "references/build/checks/pattern-workflows.mjs": "72e708399c0141c2b62ca94ab96382eb0e000df9d5a54045be814e261d9a9bdc",
58
+ "references/build/checks/primary-scope.mjs": "b70634020cd8480ca97e7ee6350fdc9231684888009a6bd8d9ed216505aa2349",
59
+ "references/build/checks/render-tells.mjs": "93eae3f005f2a93654e111627a343440a7d87fa4b11c7c9403283b627fc1834c",
60
+ "references/build/checks/screen-layout-pattern.mjs": "c744bb32b29da50e2a1d852c1005b42addc0e1d7a98297e168f8ce7d51e4ad93",
61
+ "references/build/checks/semantics.mjs": "2ee7689b0472dba2e782ff19304e01018ca470b252fe7137e82bb36a3e0042c0",
62
+ "references/build/checks/settings-pattern.mjs": "77a8d8e431e5e25e4f4af5c92e7be1e664dbab5aac9f587b7819bd9c196b3907",
63
+ "references/build/checks/sync-pattern.mjs": "2cf9f1ac96be6c48948dea0ffab0fda0a909b5ff19e3e3f9835b6d8bcdd7fbef",
64
+ "references/build/checks/tells-lint.mjs": "f254fa9166f65a085d78cecf7ca66145151cd8b7868c732c25c44bbec2c2deac",
65
+ "references/build/fixtures/pattern-workflows.tsx": "6781938d83aa85f48c63fff98f9eb5b45fcb5531b6a49f902ec9d497f6e65265",
66
+ "references/build/fixtures/patterns/agent-action.jsx": "96d07566b1eb498be16436b9ce1d8b4148c0841cb73b3d421c8ab240bd115559",
67
+ "references/build/fixtures/patterns/app-skeleton.jsx": "d2d8e7d5373ee4d65c2e0ecc69451f35d9dfd4bed9f04cf66405cbe9c9478825",
68
+ "references/build/fixtures/patterns/assistant-conversation.jsx": "fda1f5ce21a8eb2f0f5da730cad9eb0ab65c91c9e46d69a88f9f6715434eda8a",
69
+ "references/build/fixtures/patterns/audit-log.jsx": "ec1183de4c94c0309824b4187c082f7ea76d50a09953224e4164b4fc5fa70780",
70
+ "references/build/fixtures/patterns/auth.jsx": "1b41c43b734deb75acd8bfd34dae445e627381884abd23512e37bfb1d644eabe",
71
+ "references/build/fixtures/patterns/billing.jsx": "8f56ab9e6d09d73f1ae9ad5d690ff20372f9279d23010d6db7ef5e2a79d0100a",
72
+ "references/build/fixtures/patterns/developer-settings.jsx": "7803d792f516b5a1ee823436c505802954865720f7c8dbae0742a1adc0b2d490",
73
+ "references/build/fixtures/patterns/import.jsx": "3b4148a99bf90a477ae01a0905cae75200bc53427ea197cc2bcda0a9c2469ca2",
74
+ "references/build/fixtures/patterns/members.jsx": "2b25e2f0734a273b6d7366c746573a906b90d613164b7003fe6fd3e426496286",
75
+ "references/build/fixtures/patterns/onboarding.jsx": "3ae1325880efa862b84b5d9bcc0691bf6029e1f1ac031bb99adb6c0527c498a9",
76
+ "references/build/fixtures/patterns/screen-layout-decision.jsx": "409d5ce48ddef3ca5de3427155e901f06d142938474894e9eabbc167c910c47a",
77
+ "references/build/fixtures/patterns/screen-layout-editor.jsx": "a93c41d7590fd98fae48403c49e4d4e793b4e92e4cf5b8cc66e30ed0aa55ba68",
78
+ "references/build/fixtures/patterns/screen-layout-report.jsx": "5de2691104456175ef51d2e1d11c85b4075341457e8acd3d5495615c2fbeb0a9",
79
+ "references/build/fixtures/patterns/settings.jsx": "92b9b472351f9a8a3479ab04f7890b1b3cbc356cf81926ff0c280f1bdbf0c435",
80
+ "references/build/fixtures/patterns/sync.jsx": "8474f762f7c63c4bd99fd337b080df1a788b4b92b2ced7fac5aaa1379b1a1eaf",
81
+ "references/project/components/src/pattern-async-collection.tsx": "9e4df2265d1de6f269278eb4a42d8d63b3ef74a881a455eb17102be477ecbf4d",
82
+ "references/project/components/src/pattern-consequential-action.tsx": "ffe49b7a9fa978e9177c6f3d839d311bdd3da913a6eeedc241800b10fc3287f7",
83
+ "references/project/components/src/pattern-edit-record.tsx": "7e83cfdfdb85f6927667dae58f7392c1738dd05ff7a53c75209a875779c9db9d",
84
+ "references/project/components/src/pattern-review-submit.tsx": "b452f90e7a160774678aa886626aa48dea535211bc367a17d628ac84bed5ee58",
85
+ "references/project/components/src/settings.tsx": "957a04e37936746f2b6b4086d8e2f866ce71f7fb9dded8ba81fff56840206e01",
86
+ "references/scripts/build-framework-fixture.mjs": "1b4a2d7ece0459d2c4df2ec067d8d3b9d00110f2af1cef3be6042ab8f9ea90c9",
87
+ "rules.json": "607eed605aa834ab2e6557b44df0899a3851b684060566c73fbe1639df4575ae",
88
+ "visual/Elevation.md": "100532c631803e9a97018b9da5ffff60acf7d80559f9f162ba9e371f5510371f",
89
+ "visual/Fundamentals.md": "65120fd170ff8ea9f50b1498bfedc8c45dbe1a616bfccc32664213e5404d3a32",
90
+ "visual/Research.md": "ca9931eb15547b86cff525126cba2a09e6e0751ad2739a60f453c83ed8d84216"
91
+ }
92
+ }
@@ -0,0 +1,181 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Altitude task pattern",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion",
8
+ "id",
9
+ "version",
10
+ "title",
11
+ "purpose",
12
+ "authority",
13
+ "applicability",
14
+ "maturity",
15
+ "evidenceStatus",
16
+ "document",
17
+ "implementation",
18
+ "intents",
19
+ "useWhen",
20
+ "avoidWhen",
21
+ "alternatives",
22
+ "requiredInputs",
23
+ "states",
24
+ "transitions",
25
+ "rules",
26
+ "sources",
27
+ "exceptions",
28
+ "examples",
29
+ "verification"
30
+ ],
31
+ "properties": {
32
+ "schemaVersion": {
33
+ "type": "integer",
34
+ "const": 1
35
+ },
36
+ "id": {
37
+ "type": "string",
38
+ "minLength": 1,
39
+ "pattern": "^[a-z]+(?:-[a-z]+)*$"
40
+ },
41
+ "version": {
42
+ "type": "integer",
43
+ "minimum": 1
44
+ },
45
+ "title": {
46
+ "type": "string",
47
+ "minLength": 1
48
+ },
49
+ "purpose": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ },
53
+ "authority": {
54
+ "type": "string",
55
+ "minLength": 1,
56
+ "enum": [
57
+ "normative-standard",
58
+ "contextual-pattern",
59
+ "heuristic",
60
+ "altitude-policy",
61
+ "experimental-hypothesis"
62
+ ]
63
+ },
64
+ "applicability": {
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "maturity": {
69
+ "type": "string",
70
+ "minLength": 1
71
+ },
72
+ "evidenceStatus": {
73
+ "type": "string",
74
+ "minLength": 1
75
+ },
76
+ "document": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ },
80
+ "implementation": {
81
+ "type": "string",
82
+ "minLength": 1
83
+ },
84
+ "intents": {
85
+ "type": "array",
86
+ "minItems": 1,
87
+ "items": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ }
91
+ },
92
+ "useWhen": {
93
+ "type": "array",
94
+ "minItems": 1,
95
+ "items": {
96
+ "type": "string",
97
+ "minLength": 1
98
+ }
99
+ },
100
+ "avoidWhen": {
101
+ "type": "array",
102
+ "minItems": 1,
103
+ "items": {
104
+ "type": "string",
105
+ "minLength": 1
106
+ }
107
+ },
108
+ "alternatives": {
109
+ "type": "array",
110
+ "minItems": 1,
111
+ "items": {
112
+ "type": "string",
113
+ "minLength": 1
114
+ }
115
+ },
116
+ "requiredInputs": {
117
+ "type": "array",
118
+ "minItems": 1,
119
+ "items": {
120
+ "type": "string",
121
+ "minLength": 1
122
+ }
123
+ },
124
+ "states": {
125
+ "type": "array",
126
+ "minItems": 1,
127
+ "items": {
128
+ "type": "string",
129
+ "minLength": 1
130
+ }
131
+ },
132
+ "transitions": {
133
+ "type": "array",
134
+ "minItems": 1,
135
+ "items": {
136
+ "type": "string",
137
+ "minLength": 1
138
+ }
139
+ },
140
+ "rules": {
141
+ "type": "array",
142
+ "minItems": 1,
143
+ "items": {
144
+ "type": "string",
145
+ "minLength": 1
146
+ }
147
+ },
148
+ "sources": {
149
+ "type": "array",
150
+ "minItems": 1,
151
+ "items": {
152
+ "type": "string",
153
+ "minLength": 1
154
+ }
155
+ },
156
+ "exceptions": {
157
+ "type": "array",
158
+ "minItems": 1,
159
+ "items": {
160
+ "type": "string",
161
+ "minLength": 1
162
+ }
163
+ },
164
+ "examples": {
165
+ "type": "array",
166
+ "minItems": 1,
167
+ "items": {
168
+ "type": "string",
169
+ "minLength": 1
170
+ }
171
+ },
172
+ "verification": {
173
+ "type": "array",
174
+ "minItems": 1,
175
+ "items": {
176
+ "type": "string",
177
+ "minLength": 1
178
+ }
179
+ }
180
+ }
181
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "agent-action",
4
+ "version": 1,
5
+ "title": "Agent action",
6
+ "intents": [
7
+ "agent",
8
+ "ai assistant",
9
+ "assistant",
10
+ "tool approval",
11
+ "human in the loop",
12
+ "copilot",
13
+ "ai action"
14
+ ],
15
+ "purpose": "Let an agent propose, wait for approval, run, recover and leave provenance, with each state drawn as one reading.",
16
+ "useWhen": [
17
+ "An embedded agent takes actions (sends, edits, deletes, runs code) on someone's behalf."
18
+ ],
19
+ "avoidWhen": [
20
+ "An assistant that only answers in text; use Conversation and PromptInput."
21
+ ],
22
+ "alternatives": [
23
+ "Use Conversation for answers only, and the consequential-action contract for a person's own destructive actions."
24
+ ],
25
+ "requiredInputs": [
26
+ "the plan as steps with tool calls",
27
+ "each step's runtime state",
28
+ "each step's consequence class",
29
+ "approve, reject and retry handlers",
30
+ "provenance of every change"
31
+ ],
32
+ "states": [
33
+ "planned",
34
+ "running",
35
+ "approval-requested",
36
+ "approved",
37
+ "executing",
38
+ "done",
39
+ "failed",
40
+ "rejected",
41
+ "undone"
42
+ ],
43
+ "transitions": [
44
+ "planned → running → done for a reversible step, with Undo",
45
+ "running → approval-requested for an external or irreversible step",
46
+ "approval-requested → approved → executing → done or failed",
47
+ "approval-requested → rejected",
48
+ "failed → running on Retry"
49
+ ],
50
+ "rules": [
51
+ "ALT-AGENT-001",
52
+ "ALT-ACTION-001",
53
+ "ALT-STATUS-001",
54
+ "ALT-VISUAL-003"
55
+ ],
56
+ "sources": [
57
+ "altitude-elevation",
58
+ "task-review",
59
+ "wcag22"
60
+ ],
61
+ "authority": "contextual-pattern",
62
+ "applicability": "Embedded agents that take actions on someone's behalf.",
63
+ "exceptions": [
64
+ "Require only states the agent runtime reports; what runs without approval is the application's decision."
65
+ ],
66
+ "maturity": "provisional",
67
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
68
+ "document": "patterns/agent-action.md",
69
+ "implementation": "build/fixtures/patterns/agent-action.jsx",
70
+ "examples": [
71
+ "build/fixtures/patterns/agent-action.jsx"
72
+ ],
73
+ "verification": [
74
+ "build/checks/agent-action-pattern.mjs",
75
+ "build/checks/pattern-types.mjs"
76
+ ]
77
+ }
@@ -0,0 +1,39 @@
1
+ # Agent action
2
+
3
+ Help someone delegate work to an agent that acts: it plans, shows its steps, waits for approval where the consequence warrants it, runs what's approved, reports back, recovers from failure, and leaves a record of who did what. It composes `Trace`, `Confirmation`, `AILabel` and, for the request, `PromptInput` and `Conversation`; destructive steps follow [Consequential action](consequential-action.md).
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply the agent's plan as steps with their tool calls, each step's state from the agent runtime, each step's consequence class (reversible with a real undo, external, or irreversible), approve and reject handlers that reach the runtime, a retry handler, and the provenance of every change (agent, model, approver, time). The application owns the agent runtime, tool permissions, what runs without approval, idempotent retries, the undo that makes a step reversible, and the audit trail. The interface never decides on its own that an action is safe.
8
+
9
+ ## States and transitions
10
+
11
+ Map each tool-call state to exactly one reading:
12
+
13
+ | Runtime state | Reading |
14
+ |---|---|
15
+ | planned | imprint: the step is there but nothing happened |
16
+ | running | the current step, raised on its wall, with its tool call behind a lid |
17
+ | approval-requested | **Proposed**: a raised `Confirmation` that asks, **never pending** |
18
+ | approved / executing | **pending**: it hovers until the result arrives |
19
+ | done | lands and settles, with what happened in words |
20
+ | failed | sinks into a trench, says what (and that nothing changed, when true), with Retry |
21
+ | rejected | flush, "Rejected", and the step says what didn't happen |
22
+
23
+ **Escalate by consequence.** A reversible step with a real undo may run without approval; it reports its result with Undo, as a `RemovalReceipt` does ("4 leads archived. You can undo this for 30 days."). An external or irreversible step (send, pay, delete, publish) requires a `Confirmation` that states the consequence concretely ("Theo Marsh, Ines Duarte and Sam Okafor will get an email…") with an approve button named by the outcome ("Send 3 emails"). The most severe use `escalate="hold"` or `escalate="dialog"` (a stationary Dialog).
24
+
25
+ **Never claim success the runtime hasn't confirmed**, and never let a streamed answer look like the record before it completes (`Message` streams on a dashed rule). **Provenance**: everything an agent changed carries an `AILabel` on the result ("Drafted with AI" once a person approved it) and an activity entry naming the agent and the approver.
26
+
27
+ ## Content, keyboard, focus and announcements
28
+
29
+ Steps are an ordered list; the current step is `aria-current`. Step changes are announced politely and throttled; approvals and failures immediately; never token by token. Approve and reject are ordinary buttons reachable by keyboard; a hold has a keyboard equivalent; focus stays where the person is unless a dialog opens. Tool-call input and output stay behind a disclosure, readable as text. Verify forced colors (Proposed, pending and failed stay distinguishable without colour), reduced motion (pending holds still, raised; no glow or gradient anywhere), zoom and RTL.
30
+
31
+ ## Recovery and working implementation
32
+
33
+ A failed step offers Retry and says whether anything changed. A rejected step leaves the rest of the plan to the runtime: it may continue, re-plan or stop, and the trace says which. An undone step says so. The working example in `build/fixtures/patterns/agent-action.jsx` (shipped as `references/build/fixtures/patterns/agent-action.jsx`) composes a run with a search, a reversible archive with Undo, an email that waits for approval, a permanent delete behind a stationary dialog, a failure with Retry, and a changed record with provenance. It is also the Storybook preview "Patterns/AgentActionPattern". [Metadata](agent-action.json) names the runtime and verification sources.
34
+
35
+ ## Rules, verification and evidence
36
+
37
+ `ALT-AGENT-001` covers the state mapping, escalation by consequence and provenance; `ALT-ACTION-001` covers consequential steps; `ALT-STATUS-001` covers announcements; `ALT-VISUAL-003` covers what must not rise (a proposal is not pending). `build/checks/agent-action-pattern.mjs` checks the example in a browser. See [rules](../rules.json) and Elevation.md's Proposed and Streaming readings. How much approval people want for which actions still needs evaluation with representative users.
38
+
39
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,77 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "assistant-conversation",
4
+ "version": 1,
5
+ "title": "Assistant conversation",
6
+ "intents": [
7
+ "chat",
8
+ "assistant",
9
+ "copilot",
10
+ "chatbot",
11
+ "agent conversation",
12
+ "ai chat"
13
+ ],
14
+ "purpose": "Send, stream, stop, retry and recover in a conversation with an assistant, without losing the person's words or claiming an answer is complete before it is.",
15
+ "useWhen": [
16
+ "A person writes to an assistant and reads its answers as they stream."
17
+ ],
18
+ "avoidWhen": [
19
+ "The agent's actions themselves (approve, run, recover); use the agent-action contract alongside this one."
20
+ ],
21
+ "alternatives": [
22
+ "Use agent-action for what the agent does, and consequential-action for a person's own destructive actions."
23
+ ],
24
+ "requiredInputs": [
25
+ "a stream that yields text and resolves only when complete",
26
+ "errors classified as offline, rate limited, context full, refused or outage",
27
+ "the restored answer and whether it completed, after a reload",
28
+ "the context window used, when known"
29
+ ],
30
+ "states": [
31
+ "ready",
32
+ "submitted",
33
+ "streaming",
34
+ "complete",
35
+ "stopped",
36
+ "failed",
37
+ "interrupted",
38
+ "awaiting-input",
39
+ "queued"
40
+ ],
41
+ "transitions": [
42
+ "ready → submitted → streaming → complete",
43
+ "streaming → stopped on Stop, keeping the partial answer",
44
+ "submitted or streaming → failed, keeping the message, with Retry",
45
+ "streaming → awaiting-input while a Confirmation or Question is open, then back",
46
+ "a reload during streaming → interrupted, with Retry",
47
+ "a message written while streaming → queued, sent when the turn ends"
48
+ ],
49
+ "rules": [
50
+ "ALT-CONVO-001",
51
+ "ALT-AGENT-001",
52
+ "ALT-STATUS-001",
53
+ "ALT-VISUAL-003"
54
+ ],
55
+ "sources": [
56
+ "altitude-elevation",
57
+ "task-review",
58
+ "wcag22"
59
+ ],
60
+ "authority": "contextual-pattern",
61
+ "applicability": "Conversations with an assistant, in products and harnesses.",
62
+ "exceptions": [
63
+ "Persistence, retention and the transport are the application's; the contract covers what the person sees."
64
+ ],
65
+ "maturity": "provisional",
66
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
67
+ "document": "patterns/assistant-conversation.md",
68
+ "implementation": "build/fixtures/patterns/assistant-conversation.jsx",
69
+ "examples": [
70
+ "build/fixtures/patterns/assistant-conversation.jsx"
71
+ ],
72
+ "verification": [
73
+ "build/checks/assistant-conversation-pattern.mjs",
74
+ "build/checks/pattern-types.mjs",
75
+ "build/checks/pattern-workflows.mjs"
76
+ ]
77
+ }
@@ -0,0 +1,50 @@
1
+ # Assistant conversation
2
+
3
+ Help someone talk to an assistant: send, read the answer as it streams, stop it, retry, edit, and recover from every way a turn can fail, without losing their words or being told an answer is finished before it is. It composes `PromptInput`, `Conversation`, `Message`, `Markdown`, `ConversationQueue`, `ConversationCheckpoint`, `Alert` and `Meter`; what the agent *does* follows [Agent action](agent-action.md). The hook `useAssistantTurn` holds the turn.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply a stream that yields text as it arrives and resolves only when the provider says the answer is complete (throw an `AssistantError` with its kind when it fails), the restored answer and whether it completed when the page reloads, and the context window used when you know it. The application owns the transport, persistence, retention, what "complete" means for its provider, compaction, and limits. The interface never marks an answer complete on its own.
8
+
9
+ ## States and transitions
10
+
11
+ | State | PromptInput | Message | Reading |
12
+ |---|---|---|---|
13
+ | ready | `ready` | — | the composer, its Send the view's one primary |
14
+ | submitted | `submitted` (Send is Stop) | — | the person's message in the log at once |
15
+ | streaming | `streaming` | `streaming` | the answer on the ground on a dashed rule, "Generating…" |
16
+ | complete | `ready` | `complete` | the rule goes solid, one afterglow, announced once |
17
+ | stopped | `ready` | `stopped` | the partial answer kept, "Stopped", Retry |
18
+ | failed | `error` | `error` | the message kept in the composer; the error in words, with what to do |
19
+ | interrupted | `ready` | `error` | after a reload: "Interrupted", Retry; never shown as complete |
20
+ | awaiting-input | `streaming` | `streaming` | a `Confirmation` or `Question` is open; the turn waits |
21
+ | queued | `streaming` | — | `ConversationQueue`: written, not sent |
22
+
23
+ **Never lose the person's words.** A double Enter sends once. A failed send keeps the message (`turn.input`): put it back in the composer. Stop keeps the partial answer as "Stopped". Regenerating and editing keep versions (`MessageActions versions`, `onEdit`); rewinding sets turns aside (`ConversationCheckpoint`) rather than deleting them.
24
+
25
+ **Completion is the stream's to say.** An answer settles only when the stream resolves. Late events from a turn that was stopped or superseded are dropped. After a reload, an answer that hadn't completed is "Interrupted" with Retry.
26
+
27
+ **Errors in words, each its own state:**
28
+ - **offline**: "We can't reach the assistant. Your message is kept; try again when you're back online."
29
+ - **rate limited**: "You've reached this hour's limit. Try again at 3:40 PM."
30
+ - **context full**: "This conversation is too long to continue. Start a new one with a summary."
31
+ - **refused**: the provider's words, or "The assistant can't help with that request."
32
+ - **outage**: "The assistant is unavailable right now. Your message is kept; try again in a few minutes."
33
+
34
+ Say them in an `Alert` resting on the page above the composer, with the action that helps (Retry, Start a new conversation), not as one generic "Something went wrong".
35
+
36
+ **The context window.** When you know how much is used, show a `Meter` in the composer toolbar with notches at 80% (caution) and 95% (critical), and say it ("80% of context used"). When the app compacts, mark the place with a checkpoint ("Summarised earlier messages").
37
+
38
+ ## Content, keyboard, focus and announcements
39
+
40
+ Focus stays in the composer through a turn. Each answer is announced once, on completion, never token by token; Stop and failure are announced. Enter during IME composition never sends. Escape closes an open list first, stops listening second, and only then stops generating. Verify forced colours (streaming dashed, stopped and failed distinguishable without colour), reduced motion, zoom and RTL.
41
+
42
+ ## Recovery and working implementation
43
+
44
+ Retry sends the kept input again; for rate limits it waits for the time it names. The working example in `build/fixtures/patterns/assistant-conversation.jsx` (also the Storybook preview "Patterns/AssistantConversationPattern") streams answers, stops, fails as offline, rate limited and context full, and restores an interrupted answer. [Metadata](assistant-conversation.json) names its sources and verification.
45
+
46
+ ## Rules, verification and evidence
47
+
48
+ `ALT-CONVO-001` covers the turn: no double sends, no lost words, truthful completion, errors in words. `ALT-AGENT-001` covers what the agent does; `ALT-STATUS-001` covers announcements; `ALT-VISUAL-003` covers what mustn't rise (a streaming answer isn't pending). `build/checks/assistant-conversation-pattern.mjs` checks the example in a browser; `build/checks/pattern-workflows.mjs` drives the hook through a double submit, a stale stream, a reload mid-stream and a rate limit. Whether these words help people recover faster still needs evaluation with representative users.
49
+
50
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,71 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "async-collection",
4
+ "version": 1,
5
+ "title": "Async collection",
6
+ "intents": [
7
+ "search",
8
+ "filter",
9
+ "browse",
10
+ "list",
11
+ "records",
12
+ "collection"
13
+ ],
14
+ "purpose": "Find records while understanding loading, empty and failure states.",
15
+ "useWhen": [
16
+ "Records arrive asynchronously and can be searched or refreshed."
17
+ ],
18
+ "avoidWhen": [
19
+ "Use static content for a known local list; use pagination when the service requires it."
20
+ ],
21
+ "alternatives": [
22
+ "Use static content for a known local list; use pagination when the service requires it."
23
+ ],
24
+ "requiredInputs": [
25
+ "load callback",
26
+ "stable getKey",
27
+ "query semantics",
28
+ "selection policy",
29
+ "permissions and pagination"
30
+ ],
31
+ "states": [
32
+ "initial-loading",
33
+ "populated",
34
+ "refreshing",
35
+ "first-use-empty",
36
+ "no-results",
37
+ "failure"
38
+ ],
39
+ "transitions": [
40
+ "initial-loading \u2192 populated or empty or failure",
41
+ "populated \u2192 refreshing \u2192 populated or failure",
42
+ "query change \u2192 loading \u2192 results or no-results",
43
+ "failure \u2192 retry; reset clears query"
44
+ ],
45
+ "rules": [
46
+ "ALT-COLLECTION-001",
47
+ "ALT-STATUS-001",
48
+ "ALT-VISUAL-001"
49
+ ],
50
+ "sources": [
51
+ "altitude-elevation",
52
+ "task-review",
53
+ "wcag22"
54
+ ],
55
+ "authority": "contextual-pattern",
56
+ "applicability": "Records arrive asynchronously and can be searched or refreshed.",
57
+ "exceptions": [
58
+ "Require only states supported by the application; do not fabricate capabilities."
59
+ ],
60
+ "maturity": "provisional",
61
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
62
+ "document": "patterns/async-collection.md",
63
+ "implementation": "project/components/src/pattern-async-collection.tsx",
64
+ "examples": [
65
+ "build/fixtures/pattern-workflows.tsx",
66
+ "scripts/build-framework-fixture.mjs"
67
+ ],
68
+ "verification": [
69
+ "build/checks/pattern-workflows.mjs"
70
+ ]
71
+ }
@@ -0,0 +1,29 @@
1
+ # Async collection
2
+
3
+ Help someone find and act on records while the data changes. Use asynchronous collections for search, filtering and browsing. A known local static list may need no loading state. Large service-backed datasets may need pagination or virtualization chosen by the application; this hook does not fetch every page or invent total counts.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply a `load` adapter, query, stable `getKey` and explicit selection policy. IDs must identify entities across sorting and refresh; array indexes do not. The app owns permission filtering, query parsing, pagination/cursors, URL/history, caching and whether reset means all records or an initial query. Never show an authorization failure as an empty dataset. Confirm which search fields and scopes the service supports.
8
+
9
+ ## States and transitions
10
+
11
+ Runtime phases are `loading`, `populated`, `refreshing`, `empty`, `no-results` and `failed`. Distinguish initial loading, populated, refreshing with retained content, first-use empty, filtered no-results and failure. First-use empty invites the relevant next action; no-results offers query correction/reset. A failed refresh retains prior results and identifies their staleness. A new query invalidates an older response. Retry repeats the current request; reset returns to the initial query. Selection either clears on query changes or is explicitly preserved; explain selected items outside the visible result set and reconcile removal by stable ID. Do not imply selection means permission to act.
12
+
13
+ ## Content, keyboard, focus and announcements
14
+
15
+ Label search and filters by their actual scope. Announce concise settled result counts, loading completion and failure through `WorkflowStatus`, avoiding noisy per-keystroke announcements. Use real links for record navigation, named buttons for actions, and native checkboxes for selection. Preserve focus in the search/filter control after updates; removal needs a deliberate next focus target. Use a semantic table for tabular relationships and a list for simple records; do not add grid keyboard behavior accidentally.
16
+
17
+ At narrow widths retain names, selection state and actions; wrap long text or supply an equivalent accessible detail view. Keep reading order logical in RTL. Test long queries, translated status, zoom, forced colors and reduced motion. A skeleton alone does not communicate loading to assistive technology.
18
+
19
+ ## Recovery and working implementation
20
+
21
+ Use `useAsyncCollection` with application-supplied loading and stable keys. Render every applicable `phase`, call `refresh` for retry, `reset` for query reset, and `toggleSelection` according to the chosen policy. Import the runtime from the main package export. The complete working composition, including controlled delay/rejection/recovery, is `build/fixtures/pattern-workflows.tsx`; its installed snapshot is under `references/build/fixtures/pattern-workflows.tsx`. Source and fixture paths are indexed in [metadata](async-collection.json). It demonstrates actual result state, not a decorative loading timer.
22
+
23
+ The application must connect query changes to its URL/history policy and verify Back/forward, deep links and reload where supported. Pagination must retain the correct query and selection semantics; a stale page response must not restore a prior filter. Cached data can remain usable on failure only when permission and freshness policies allow it.
24
+
25
+ ## Rules, verification and evidence
26
+
27
+ `ALT-COLLECTION-001` is an application integration obligation: test all applicable states, delayed responses, query changes, stable selection and reset against service fixtures. `ALT-STATUS-001` checks feedback semantics; `ALT-VISUAL-001` requires contextual visual review. See [metadata](async-collection.json) and [rules](../rules.json) for sources, exceptions and linked checks. This is a provisional contextual pattern, not a standard mandating every listed state in every product. Test actual search success and comprehension with representative people; engineering checks cannot determine appropriate information architecture.
28
+
29
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.