@sixb/agent 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -2
  3. package/dist/abort.d.ts +6 -0
  4. package/dist/abort.d.ts.map +1 -0
  5. package/dist/agent-prompt.d.ts +126 -0
  6. package/dist/agent-prompt.d.ts.map +1 -0
  7. package/dist/agent-runtime/errors.d.ts +13 -0
  8. package/dist/agent-runtime/errors.d.ts.map +1 -0
  9. package/dist/agent-runtime/preflight.d.ts +18 -0
  10. package/dist/agent-runtime/preflight.d.ts.map +1 -0
  11. package/dist/agent-runtime/profile.d.ts +14 -0
  12. package/dist/agent-runtime/profile.d.ts.map +1 -0
  13. package/dist/artifacts/layout-check/layout-check.d.ts +87 -0
  14. package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -0
  15. package/dist/artifacts/materialize.d.ts +115 -0
  16. package/dist/artifacts/materialize.d.ts.map +1 -0
  17. package/dist/artifacts/publish-tool.d.ts +86 -0
  18. package/dist/artifacts/publish-tool.d.ts.map +1 -0
  19. package/dist/ask-parent-tool.d.ts +36 -0
  20. package/dist/ask-parent-tool.d.ts.map +1 -0
  21. package/dist/attachments.d.ts +109 -0
  22. package/dist/attachments.d.ts.map +1 -0
  23. package/dist/child-files.d.ts +91 -0
  24. package/dist/child-files.d.ts.map +1 -0
  25. package/dist/child-questions.d.ts +24 -0
  26. package/dist/child-questions.d.ts.map +1 -0
  27. package/dist/computer-runner.d.ts +74 -0
  28. package/dist/computer-runner.d.ts.map +1 -0
  29. package/dist/context-budget.d.ts +34 -0
  30. package/dist/context-budget.d.ts.map +1 -0
  31. package/dist/context-compaction.d.ts +148 -0
  32. package/dist/context-compaction.d.ts.map +1 -0
  33. package/dist/context-guard.d.ts +69 -0
  34. package/dist/context-guard.d.ts.map +1 -0
  35. package/dist/conversation-memory.d.ts +21 -0
  36. package/dist/conversation-memory.d.ts.map +1 -0
  37. package/dist/conversation-messages.d.ts +33 -0
  38. package/dist/conversation-messages.d.ts.map +1 -0
  39. package/dist/errors.d.ts +46 -0
  40. package/dist/errors.d.ts.map +1 -0
  41. package/dist/execution-plan.d.ts +38 -0
  42. package/dist/execution-plan.d.ts.map +1 -0
  43. package/dist/failure.d.ts +14 -0
  44. package/dist/failure.d.ts.map +1 -0
  45. package/dist/family-mailbox.d.ts +60 -0
  46. package/dist/family-mailbox.d.ts.map +1 -0
  47. package/dist/file-ref.d.ts +6 -0
  48. package/dist/file-ref.d.ts.map +1 -0
  49. package/dist/image-attachments.d.ts +34 -0
  50. package/dist/image-attachments.d.ts.map +1 -0
  51. package/dist/index.d.ts +35 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +14387 -0
  54. package/dist/index.js.map +72 -0
  55. package/dist/inline-images.d.ts +28 -0
  56. package/dist/inline-images.d.ts.map +1 -0
  57. package/dist/message-authors.d.ts +34 -0
  58. package/dist/message-authors.d.ts.map +1 -0
  59. package/dist/message-times.d.ts +9 -0
  60. package/dist/message-times.d.ts.map +1 -0
  61. package/dist/model-adapters.d.ts +59 -0
  62. package/dist/model-adapters.d.ts.map +1 -0
  63. package/dist/model-lines.d.ts +16 -0
  64. package/dist/model-lines.d.ts.map +1 -0
  65. package/dist/prompt-cache.d.ts +28 -0
  66. package/dist/prompt-cache.d.ts.map +1 -0
  67. package/dist/requester.d.ts +15 -0
  68. package/dist/requester.d.ts.map +1 -0
  69. package/dist/run-agent-turn.d.ts +93 -0
  70. package/dist/run-agent-turn.d.ts.map +1 -0
  71. package/dist/run-child.d.ts +77 -0
  72. package/dist/run-child.d.ts.map +1 -0
  73. package/dist/run-conversation-turn.d.ts +42 -0
  74. package/dist/run-conversation-turn.d.ts.map +1 -0
  75. package/dist/run-credential.d.ts +22 -0
  76. package/dist/run-credential.d.ts.map +1 -0
  77. package/dist/run-environment.d.ts +145 -0
  78. package/dist/run-environment.d.ts.map +1 -0
  79. package/dist/run-fate.d.ts +15 -0
  80. package/dist/run-fate.d.ts.map +1 -0
  81. package/dist/run-files-lock.d.ts +16 -0
  82. package/dist/run-files-lock.d.ts.map +1 -0
  83. package/dist/run-sandbox.d.ts +60 -0
  84. package/dist/run-sandbox.d.ts.map +1 -0
  85. package/dist/run-subagent.d.ts +65 -0
  86. package/dist/run-subagent.d.ts.map +1 -0
  87. package/dist/run-workflow-agent-node.d.ts +46 -0
  88. package/dist/run-workflow-agent-node.d.ts.map +1 -0
  89. package/dist/sandbox-api-context.d.ts +34 -0
  90. package/dist/sandbox-api-context.d.ts.map +1 -0
  91. package/dist/sandbox-file-registry.d.ts +9 -0
  92. package/dist/sandbox-file-registry.d.ts.map +1 -0
  93. package/dist/sandbox-files.d.ts +71 -0
  94. package/dist/sandbox-files.d.ts.map +1 -0
  95. package/dist/sandbox-handle.d.ts +15 -0
  96. package/dist/sandbox-handle.d.ts.map +1 -0
  97. package/dist/sandbox-readiness.d.ts +8 -0
  98. package/dist/sandbox-readiness.d.ts.map +1 -0
  99. package/dist/skills/built-in.d.ts +15 -0
  100. package/dist/skills/built-in.d.ts.map +1 -0
  101. package/dist/subagent-context.d.ts +50 -0
  102. package/dist/subagent-context.d.ts.map +1 -0
  103. package/dist/subagent-continuation.d.ts +33 -0
  104. package/dist/subagent-continuation.d.ts.map +1 -0
  105. package/dist/subagent-inbox.d.ts +53 -0
  106. package/dist/subagent-inbox.d.ts.map +1 -0
  107. package/dist/subagent-tools.d.ts +293 -0
  108. package/dist/subagent-tools.d.ts.map +1 -0
  109. package/dist/thread-context.d.ts +17 -0
  110. package/dist/thread-context.d.ts.map +1 -0
  111. package/dist/tools/attachments.d.ts +11 -0
  112. package/dist/tools/attachments.d.ts.map +1 -0
  113. package/dist/tools/bash.d.ts +68 -0
  114. package/dist/tools/bash.d.ts.map +1 -0
  115. package/dist/tools/model-spec.d.ts +9 -0
  116. package/dist/tools/model-spec.d.ts.map +1 -0
  117. package/dist/tools/read.d.ts +43 -0
  118. package/dist/tools/read.d.ts.map +1 -0
  119. package/dist/tools/result-media.d.ts +65 -0
  120. package/dist/tools/result-media.d.ts.map +1 -0
  121. package/dist/tools/result-output.d.ts +18 -0
  122. package/dist/tools/result-output.d.ts.map +1 -0
  123. package/dist/tools/tool-files.d.ts +59 -0
  124. package/dist/tools/tool-files.d.ts.map +1 -0
  125. package/dist/tools/tool-outputs.d.ts +63 -0
  126. package/dist/tools/tool-outputs.d.ts.map +1 -0
  127. package/dist/tools/view-file.d.ts +40 -0
  128. package/dist/tools/view-file.d.ts.map +1 -0
  129. package/dist/tsconfig.json +5 -0
  130. package/dist/turn-runtime.d.ts +19 -0
  131. package/dist/turn-runtime.d.ts.map +1 -0
  132. package/dist/types.d.ts +83 -0
  133. package/dist/types.d.ts.map +1 -0
  134. package/dist/workflow-input-attachments.d.ts +18 -0
  135. package/dist/workflow-input-attachments.d.ts.map +1 -0
  136. package/package.json +59 -4
  137. package/src/abort.ts +40 -0
  138. package/src/agent-prompt.ts +860 -0
  139. package/src/agent-runtime/errors.ts +44 -0
  140. package/src/agent-runtime/preflight.ts +314 -0
  141. package/src/agent-runtime/profile.ts +23 -0
  142. package/src/artifacts/layout-check/check.cjs +478 -0
  143. package/src/artifacts/layout-check/layout-check.ts +460 -0
  144. package/src/artifacts/materialize.ts +380 -0
  145. package/src/artifacts/publish-tool.ts +700 -0
  146. package/src/ask-parent-tool.ts +100 -0
  147. package/src/attachments.ts +1041 -0
  148. package/src/child-files.ts +535 -0
  149. package/src/child-questions.ts +42 -0
  150. package/src/computer-runner.ts +336 -0
  151. package/src/context-budget.ts +177 -0
  152. package/src/context-compaction.ts +1349 -0
  153. package/src/context-guard.ts +826 -0
  154. package/src/conversation-memory.ts +45 -0
  155. package/src/conversation-messages.ts +86 -0
  156. package/src/errors.ts +85 -0
  157. package/src/execution-plan.ts +70 -0
  158. package/src/failure.ts +82 -0
  159. package/src/family-mailbox.ts +189 -0
  160. package/src/file-ref.ts +18 -0
  161. package/src/image-attachments.ts +322 -0
  162. package/src/index.ts +54 -0
  163. package/src/inline-images.ts +69 -0
  164. package/src/message-authors.ts +77 -0
  165. package/src/message-times.ts +24 -0
  166. package/src/model-adapters.ts +273 -0
  167. package/src/model-lines.ts +28 -0
  168. package/src/prompt-cache.ts +40 -0
  169. package/src/requester.ts +21 -0
  170. package/src/run-agent-turn.ts +509 -0
  171. package/src/run-child.ts +344 -0
  172. package/src/run-conversation-turn.ts +272 -0
  173. package/src/run-credential.ts +55 -0
  174. package/src/run-environment.ts +1216 -0
  175. package/src/run-fate.ts +51 -0
  176. package/src/run-files-lock.ts +118 -0
  177. package/src/run-sandbox.ts +63 -0
  178. package/src/run-subagent.ts +433 -0
  179. package/src/run-workflow-agent-node.ts +344 -0
  180. package/src/sandbox-api-context.ts +237 -0
  181. package/src/sandbox-file-registry.ts +26 -0
  182. package/src/sandbox-files.ts +326 -0
  183. package/src/sandbox-handle.ts +19 -0
  184. package/src/sandbox-readiness.ts +22 -0
  185. package/src/skills/built-in.ts +183 -0
  186. package/src/skills/sixb-artifacts/SKILL.md +95 -0
  187. package/src/skills/sixb-artifacts/canvas.md +104 -0
  188. package/src/skills/sixb-artifacts/document.md +63 -0
  189. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/first-job.html +42 -0
  190. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/region.html +29 -0
  191. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/shared.css +35 -0
  192. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/welcome.html +31 -0
  193. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/canvas.json +107 -0
  194. package/src/skills/sixb-artifacts/examples/canvas/retro/canvas.json +158 -0
  195. package/src/skills/sixb-artifacts/examples/document/incident-report/document.md +35 -0
  196. package/src/skills/sixb-artifacts/examples/document/operations-review/document.md +41 -0
  197. package/src/skills/sixb-artifacts/examples/document/operations-review/figures/restorations.svg +1 -0
  198. package/src/skills/sixb-artifacts/examples/page/collections-desk/index.html +169 -0
  199. package/src/skills/sixb-artifacts/examples/page/collections-desk/queries/overdue.json +13 -0
  200. package/src/skills/sixb-artifacts/examples/page/dispatch-board/data/dispatch.json +234 -0
  201. package/src/skills/sixb-artifacts/examples/page/dispatch-board/index.html +245 -0
  202. package/src/skills/sixb-artifacts/examples/page/fleet-planner/data/plan.json +53 -0
  203. package/src/skills/sixb-artifacts/examples/page/fleet-planner/index.html +462 -0
  204. package/src/skills/sixb-artifacts/examples/page/service-explorer/data/service.json +276 -0
  205. package/src/skills/sixb-artifacts/examples/page/service-explorer/index.html +549 -0
  206. package/src/skills/sixb-artifacts/examples/sheet/overdue-invoices/queries/overdue.json +13 -0
  207. package/src/skills/sixb-artifacts/examples/sheet/overdue-invoices/workbook.json +30 -0
  208. package/src/skills/sixb-artifacts/examples/sheet/parts-inventory/sheets/Inventory.csv +13 -0
  209. package/src/skills/sixb-artifacts/examples/sheet/parts-inventory/sheets/Spend.csv +6 -0
  210. package/src/skills/sixb-artifacts/examples/sheet/parts-inventory/workbook.json +47 -0
  211. package/src/skills/sixb-artifacts/examples/sheet/service-metrics/sheets/Quarters.csv +5 -0
  212. package/src/skills/sixb-artifacts/examples/sheet/service-metrics/sheets/Regions.csv +5 -0
  213. package/src/skills/sixb-artifacts/examples/sheet/service-metrics/workbook.json +78 -0
  214. package/src/skills/sixb-artifacts/examples/slides/launch-plan/index.html +63 -0
  215. package/src/skills/sixb-artifacts/examples/slides/q3-review/index.html +133 -0
  216. package/src/skills/sixb-artifacts/file.md +17 -0
  217. package/src/skills/sixb-artifacts/page.md +215 -0
  218. package/src/skills/sixb-artifacts/queries.md +66 -0
  219. package/src/skills/sixb-artifacts/references.md +68 -0
  220. package/src/skills/sixb-artifacts/sheet.md +223 -0
  221. package/src/skills/sixb-artifacts/slides.md +137 -0
  222. package/src/skills/sixb-memory/SKILL.md +68 -0
  223. package/src/skills/text-assets.d.ts +25 -0
  224. package/src/subagent-context.ts +182 -0
  225. package/src/subagent-continuation.ts +56 -0
  226. package/src/subagent-inbox.ts +101 -0
  227. package/src/subagent-tools.ts +1671 -0
  228. package/src/thread-context.ts +31 -0
  229. package/src/tools/attachments.ts +28 -0
  230. package/src/tools/bash.ts +233 -0
  231. package/src/tools/model-spec.ts +27 -0
  232. package/src/tools/read.ts +262 -0
  233. package/src/tools/result-media.ts +351 -0
  234. package/src/tools/result-output.ts +46 -0
  235. package/src/tools/tool-files.ts +204 -0
  236. package/src/tools/tool-outputs.ts +464 -0
  237. package/src/tools/view-file.ts +155 -0
  238. package/src/turn-runtime.ts +33 -0
  239. package/src/types.ts +91 -0
  240. package/src/workflow-input-attachments.ts +140 -0
@@ -0,0 +1,5 @@
1
+ Quarter,Quarter end,Calls,Within SLA,Service revenue,Parts cost,Margin
2
+ Q4 2025,2025-12-31,3214,0.861,1842000,512300,
3
+ Q1 2026,2026-03-31,3302,0.874,1906500,524800,
4
+ Q2 2026,2026-06-30,3394,0.88,1952700,531900,
5
+ Q3 2026,2026-09-30,3801,0.94,2140200,548680,
@@ -0,0 +1,5 @@
1
+ Region,Visits,Within SLA,Change,Parts cost,Lead
2
+ North,1284,0.961,0.042,182400,https://ops.northline.example/regions/north
3
+ Central,962,0.934,0.068,141950,https://ops.northline.example/regions/central
4
+ South,1107,0.918,-0.013,166020,https://ops.northline.example/regions/south
5
+ Coastal,448,0.95,0.021,58310,https://ops.northline.example/regions/coastal
@@ -0,0 +1,78 @@
1
+ {
2
+ "sheets": [
3
+ {
4
+ "name": "Quarters",
5
+ "columns": {
6
+ "Calls": "number",
7
+ "Within SLA": { "type": "percent", "decimals": 1 },
8
+ "Service revenue": { "type": "currency", "currency": "USD", "compact": true },
9
+ "Parts cost": { "type": "currency", "currency": "USD", "compact": true },
10
+ "Quarter end": "date",
11
+ "Margin": {
12
+ "type": "percent",
13
+ "decimals": 1,
14
+ "formula": "([@Service revenue]-[@Parts cost])/[@Service revenue]"
15
+ }
16
+ },
17
+ "descriptions": {
18
+ "Within SLA": "Priority calls restored inside the agreed time, of all priority calls.",
19
+ "Margin": "Service revenue less parts cost, over service revenue."
20
+ },
21
+ "totals": {
22
+ "Calls": "sum",
23
+ "Within SLA": "average",
24
+ "Service revenue": "sum",
25
+ "Parts cost": "sum",
26
+ "Margin": "average"
27
+ }
28
+ },
29
+ {
30
+ "name": "Regions",
31
+ "frozenColumns": 1,
32
+ "columns": {
33
+ "Visits": "number",
34
+ "Within SLA": { "type": "percent", "decimals": 1 },
35
+ "Change": { "type": "percent", "decimals": 1, "signed": true },
36
+ "Parts cost": { "type": "currency", "currency": "USD" },
37
+ "Lead": "link"
38
+ },
39
+ "descriptions": { "Change": "Within SLA against the quarter before, in points." },
40
+ "totals": { "Visits": "sum", "Within SLA": "average", "Parts cost": "sum" }
41
+ }
42
+ ],
43
+ "charts": [
44
+ {
45
+ "name": "sla-trend",
46
+ "type": "line",
47
+ "sheet": "Quarters",
48
+ "x": "Quarter",
49
+ "y": "Within SLA",
50
+ "title": "Priority restorations within SLA"
51
+ },
52
+ {
53
+ "name": "revenue",
54
+ "type": "bar",
55
+ "sheet": "Quarters",
56
+ "x": "Quarter",
57
+ "y": ["Service revenue", "Parts cost"],
58
+ "title": "Service revenue and parts cost by quarter"
59
+ },
60
+ {
61
+ "name": "revenue-margin",
62
+ "type": "bar",
63
+ "sheet": "Quarters",
64
+ "x": "Quarter",
65
+ "y": "Service revenue",
66
+ "line": "Margin",
67
+ "title": "Service revenue, and its margin after parts"
68
+ },
69
+ {
70
+ "name": "visits-cost",
71
+ "type": "scatter",
72
+ "sheet": "Regions",
73
+ "x": "Visits",
74
+ "y": "Parts cost",
75
+ "title": "Parts cost against visits, by region"
76
+ }
77
+ ]
78
+ }
@@ -0,0 +1,63 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Dispatch board launch plan</title>
6
+ </head>
7
+ <body>
8
+ <section class="slide title">
9
+ <p class="eyebrow"><span>Field operations</span><span>Launch plan</span></p>
10
+ <h1>Dispatch board</h1>
11
+ <p>Every region on the board by January, starting with the one that needs it most</p>
12
+ <p class="source">October 2026</p>
13
+ </section>
14
+
15
+ <section class="slide section">
16
+ <p class="eyebrow">Part one</p>
17
+ <h2>Why South goes first</h2>
18
+ </section>
19
+
20
+ <section class="slide split">
21
+ <p class="eyebrow">The problem</p>
22
+ <h2>South loses the most time to manual dispatch</h2>
23
+ <p>Dispatchers in South rebuild routes by phone when a technician runs late, which adds about 40 minutes to each late call.</p>
24
+ <div class="callout">The board reroutes in seconds, and South had the most late calls in Q3.</div>
25
+ <p class="source">Source: Dispatch logs, Q3 2026</p>
26
+ </section>
27
+
28
+ <section class="slide">
29
+ <p class="eyebrow">Rollout</p>
30
+ <h2>Four steps, one region at a time</h2>
31
+ <ol>
32
+ <li><strong>October:</strong> South, with daily check-ins for two weeks</li>
33
+ <li><strong>November:</strong> Central, after South’s lessons are written up</li>
34
+ <li><strong>December:</strong> North and Coastal together</li>
35
+ <li><strong>January:</strong> the phone dispatch line closes</li>
36
+ </ol>
37
+ </section>
38
+
39
+ <section class="slide stat">
40
+ <p class="eyebrow">The goal</p>
41
+ <h2>On site within the window, 96% of the time</h2>
42
+ <div class="stats">
43
+ <div><div class="value">96%</div><div class="label">Priority restorations within SLA by Q2 2027</div></div>
44
+ <div><div class="value">94%</div><div class="label">Where we are today, Q3 2026</div></div>
45
+ </div>
46
+ <p class="source">Source: Field service records, Q3 2026</p>
47
+ </section>
48
+
49
+ <section class="slide table">
50
+ <p class="eyebrow">Owners</p>
51
+ <h2>Each step has one owner</h2>
52
+ <table>
53
+ <thead><tr><th>Step</th><th>Owner</th><th>Done when</th></tr></thead>
54
+ <tbody>
55
+ <tr><td>South</td><td>Regional lead, South</td><td>Two weeks without phone reroutes</td></tr>
56
+ <tr><td>Central</td><td>Regional lead, Central</td><td>Lessons from South written up</td></tr>
57
+ <tr><td>North and Coastal</td><td>Operations manager</td><td>Both regions live</td></tr>
58
+ <tr><td>Phone line</td><td>Head of field operations</td><td>Line closed, calls redirected</td></tr>
59
+ </tbody>
60
+ </table>
61
+ </section>
62
+ </body>
63
+ </html>
@@ -0,0 +1,133 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Q3 2026 operations review</title>
6
+ </head>
7
+ <body>
8
+ <section class="slide title">
9
+ <p class="eyebrow"><span>Q3 2026</span><span>Operations review</span></p>
10
+ <h1>Q3 review</h1>
11
+ <p>Restorations within SLA reached 94% while calls rose 12%</p>
12
+ <p class="source">October 22, 2026</p>
13
+ </section>
14
+
15
+ <section class="slide stat">
16
+ <p class="eyebrow">Highlights</p>
17
+ <h2>Every headline number moved the right way</h2>
18
+ <div class="stats">
19
+ <div><div class="value">94%</div><div class="label">Restored within SLA, up 6 points</div></div>
20
+ <div><div class="value">$2.14M</div><div class="label">Service revenue, up 9.6%</div></div>
21
+ <div><div class="value">$144</div><div class="label">Parts cost per visit, down $7</div></div>
22
+ </div>
23
+ <p class="source">Source: Field service records, Q3 2026</p>
24
+ </section>
25
+
26
+ <section class="slide chart">
27
+ <p class="eyebrow">Service levels</p>
28
+ <h2>Restorations kept pace as priority calls rose 12%</h2>
29
+ <figure>
30
+ <ul class="legend">
31
+ <li style="--swatch: var(--chart-1)">Restored within SLA</li>
32
+ <li style="--swatch: var(--chart-4)">Priority calls</li>
33
+ </ul>
34
+ <svg viewBox="0 0 1088 330" role="img" aria-label="Priority calls and restorations within SLA by quarter. Calls rise from 3,120 in Q4 2025 to 3,801 in Q3 2026; restorations within SLA rise from 2,686 to 3,573, 94.0% of calls.">
35
+ <g font-size="20" fill="var(--muted-foreground)" text-anchor="end">
36
+ <text x="64" y="17">4,000</text>
37
+ <text x="64" y="87">3,000</text>
38
+ <text x="64" y="157">2,000</text>
39
+ <text x="64" y="227">1,000</text>
40
+ <text x="64" y="297">0</text>
41
+ </g>
42
+ <g stroke="var(--border)" stroke-width="1">
43
+ <line x1="80" x2="1088" y1="10" y2="10"/>
44
+ <line x1="80" x2="1088" y1="80" y2="80"/>
45
+ <line x1="80" x2="1088" y1="150" y2="150"/>
46
+ <line x1="80" x2="1088" y1="220" y2="220"/>
47
+ </g>
48
+ <g fill="var(--chart-1)">
49
+ <rect x="143" y="102" width="56" height="188" rx="3"/>
50
+ <rect x="395" y="92" width="56" height="198" rx="3"/>
51
+ <rect x="647" y="81" width="56" height="209" rx="3"/>
52
+ <rect x="899" y="40" width="56" height="250" rx="3"/>
53
+ </g>
54
+ <g fill="var(--chart-4)">
55
+ <rect x="213" y="72" width="56" height="218" rx="3"/>
56
+ <rect x="465" y="63" width="56" height="227" rx="3"/>
57
+ <rect x="717" y="53" width="56" height="237" rx="3"/>
58
+ <rect x="969" y="24" width="56" height="266" rx="3"/>
59
+ </g>
60
+ <line x1="80" x2="1088" y1="290" y2="290" stroke="var(--muted-foreground)" stroke-opacity="0.5"/>
61
+ <text x="927" y="28" font-size="22" font-weight="600" text-anchor="middle" fill="var(--foreground)">94.0%</text>
62
+ <g font-size="20" fill="var(--muted-foreground)" text-anchor="middle">
63
+ <text x="206" y="324">Q4 2025</text>
64
+ <text x="458" y="324">Q1 2026</text>
65
+ <text x="710" y="324">Q2 2026</text>
66
+ <text x="962" y="324">Q3 2026</text>
67
+ </g>
68
+ </svg>
69
+ </figure>
70
+ <p class="source">Source: Field service records, Q4 2025 to Q3 2026</p>
71
+ </section>
72
+
73
+ <section class="slide table">
74
+ <p class="eyebrow">Regions</p>
75
+ <h2>South is the only region that slipped</h2>
76
+ <table>
77
+ <thead>
78
+ <tr><th>Region</th><th class="num">Visits</th><th class="num">Within SLA</th><th class="num">Change</th></tr>
79
+ </thead>
80
+ <tbody>
81
+ <tr><td>North</td><td class="num">1,284</td><td class="num">96.1%</td><td class="num">+4.2 pts</td></tr>
82
+ <tr><td>Central</td><td class="num">962</td><td class="num">93.4%</td><td class="num">+6.8 pts</td></tr>
83
+ <tr><td>South</td><td class="num">1,107</td><td class="num">91.8%</td><td class="num">−1.3 pts</td></tr>
84
+ <tr><td>Coastal</td><td class="num">448</td><td class="num">95.0%</td><td class="num">+2.1 pts</td></tr>
85
+ </tbody>
86
+ </table>
87
+ <p class="source">Source: Field service records, Q3 2026. Two senior South technicians were on leave in August.</p>
88
+ </section>
89
+
90
+ <section class="slide split">
91
+ <p class="eyebrow">Parts</p>
92
+ <h2>Compressor lead times are the main risk</h2>
93
+ <ul>
94
+ <li>Three open cases are waiting on compressors</li>
95
+ <li>Stock two at the Central depot</li>
96
+ <li>Approve the Harbor Point replacement by October 31</li>
97
+ </ul>
98
+ <svg viewBox="0 0 600 250" role="img" aria-label="Supplier lead time in weeks: compressors 9, fan motors 4, control boards 3, valves 2.">
99
+ <text x="0" y="22" font-size="22" fill="var(--muted-foreground)">Supplier lead time, weeks</text>
100
+ <g font-size="22" fill="var(--foreground)">
101
+ <text x="0" y="73" font-weight="600">Compressors</text>
102
+ <text x="0" y="128">Fan motors</text>
103
+ <text x="0" y="183">Control boards</text>
104
+ <text x="0" y="238">Valves</text>
105
+ </g>
106
+ <g fill="var(--muted)">
107
+ <rect x="180" y="52" width="340" height="28" rx="4"/>
108
+ <rect x="180" y="107" width="340" height="28" rx="4"/>
109
+ <rect x="180" y="162" width="340" height="28" rx="4"/>
110
+ <rect x="180" y="217" width="340" height="28" rx="4"/>
111
+ </g>
112
+ <rect x="180" y="52" width="306" height="28" rx="4" fill="var(--chart-1)"/>
113
+ <g fill="var(--chart-4)">
114
+ <rect x="180" y="107" width="136" height="28" rx="4"/>
115
+ <rect x="180" y="162" width="102" height="28" rx="4"/>
116
+ <rect x="180" y="217" width="68" height="28" rx="4"/>
117
+ </g>
118
+ <g font-size="22" fill="var(--foreground)" text-anchor="end">
119
+ <text x="600" y="73" font-weight="600">9</text>
120
+ <text x="600" y="128">4</text>
121
+ <text x="600" y="183">3</text>
122
+ <text x="600" y="238">2</text>
123
+ </g>
124
+ </svg>
125
+ <p class="source">Source: Supplier quotes, September 2026</p>
126
+ </section>
127
+
128
+ <section class="slide quote">
129
+ <blockquote>“The unit was back on before the morning shift started. That’s what we pay for.”</blockquote>
130
+ <cite>Facilities manager, Harbor Point</cite>
131
+ </section>
132
+ </body>
133
+ </html>
@@ -0,0 +1,17 @@
1
+ # Files
2
+
3
+ A `file` artifact is exactly one file, delivered as it is. Publish one when the user asked for a
4
+ format (PDF, DOCX, XLSX, PPTX, CSV), or when the deliverable is a binary such as an image or an
5
+ archive. When no format was asked for, write a `document`, a `sheet`, or `slides` instead.
6
+
7
+ ```text
8
+ publish_artifact({ path: "work/service-report.pdf", kind: "file", title: "Harbor Point service report" })
9
+ ```
10
+
11
+ - The artifact keeps the file's name, which is what the user downloads. Name it for the
12
+ deliverable: `harbor-point-service-report.pdf`, not `output.pdf`.
13
+ - The app shows images, PDFs, Markdown, CSV and TSV tables, and plain text in place. Other formats
14
+ download.
15
+ - Check the file before publishing it: render documents, decks, and spreadsheets with
16
+ `sixb-render` and inspect the previews; open a CSV and check its header row and a few rows.
17
+ - Publish each file the user asked for as its own artifact.
@@ -0,0 +1,215 @@
1
+ # Pages
2
+
3
+ A page is a small web app the user opens beside the conversation: `index.html` and the files it
4
+ loads beside it. Sixb adds its kit and runtime to the page, which draw plain HTML in the app's
5
+ theme and dark mode. Publish one for what the reader works with, not just reads: a calculator, a
6
+ planner, a dashboard with filters, an explainer with controls.
7
+
8
+ | The deliverable | Publish |
9
+ | --- | --- |
10
+ | Read top to bottom | a `document` |
11
+ | Rows to sort, sum, chart, or download | a `sheet` |
12
+ | Presented in a meeting | `slides` |
13
+ | Changed by the reader to see what follows | a `page` |
14
+
15
+ ```text
16
+ work/fleet-planner/
17
+ ├── index.html
18
+ ├── style.css optional, for what the kit doesn't cover
19
+ ├── app.js optional; a short script can sit in index.html
20
+ ├── queries/jobs.json the project's objects it reads live, with sixb.query
21
+ └── data/regions.json the data it was given, as a file
22
+ ```
23
+
24
+ ```html
25
+ <!doctype html>
26
+ <html lang="en">
27
+ <head>
28
+ <meta charset="utf-8">
29
+ <title>Fleet planner</title>
30
+ </head>
31
+ <body>
32
+ <main>
33
+ <p class="eyebrow">Q4 2026 · Field service</p>
34
+ <h1>Fleet planner</h1>
35
+ <p class="lede">Crews and vans next quarter's visits need, by region.</p>
36
+ <div class="grid">
37
+ <div class="card stat"><div class="label">Crews needed</div><div class="value" id="crews">–</div></div>
38
+ </div>
39
+ </main>
40
+ <script>
41
+ fetch("data/regions.json").then((response) => response.json()).then(render)
42
+ </script>
43
+ </body>
44
+ </html>
45
+ ```
46
+
47
+ The `<title>`, else the first `<h1>`, names the page in cards and lists.
48
+
49
+ ## The kit
50
+
51
+ Write plain HTML first: the kit already draws it like the app.
52
+
53
+ - `<main>` is a centered column, 1120px at most, with room around it, narrower on a phone.
54
+ - Headings, paragraphs, lists, links, `<code>`, and `<hr>` have a measured type scale.
55
+ - `<table>`: hairline rows and quiet headers; `class="num"` on number cells aligns them.
56
+ - `<label>`, `<input>`, `<select>`, `<textarea>`, and `<button>` look like the app's controls.
57
+ `class="secondary"` and `class="ghost"` give quieter buttons; `class="button"` on a link draws it
58
+ as one. Wrap a label and its field in `<div class="field">`.
59
+
60
+ | Class | Is |
61
+ | --- | --- |
62
+ | `eyebrow` | A small label above a heading: the period, the team |
63
+ | `lede` | The page's one-sentence summary under its heading |
64
+ | `card` | A panel on the page's surface, for a group of controls or a figure; cards stack 16px apart |
65
+ | `grid` | Cards in columns that wrap: 3 or 4 across on a laptop, 1 on a phone |
66
+ | `row` | Things side by side that wrap: buttons, tags |
67
+ | `stat` | A number that matters, in a card: `.label`, `.value`, `.delta` |
68
+ | `tag` | A small pill: a status, a category |
69
+ | `callout` | The one point to remember, on a shaded panel |
70
+ | `note` | An aside or a source, in smaller, muted text |
71
+ | `table-scroll` | A box a wide table scrolls in, so the page doesn't |
72
+
73
+ Colors come from the theme, so a page follows light and dark mode. Use the variables, not fixed
74
+ colors: `--foreground`, `--muted-foreground`, `--background`, `--card`, `--muted`, `--primary`,
75
+ `--border`, `--chart-1` to `--chart-5`, `--font-sans`, `--font-mono`, `--radius`. Only when the user
76
+ asks for a look, add `theme.json` (see `document.md`) or set the variables in your CSS. The page's
77
+ own CSS overrides the kit.
78
+
79
+ The theme is monochrome. For a status that needs a color, such as short or over, define your own
80
+ with a dark-mode value, and use it sparingly:
81
+
82
+ ```css
83
+ :root { --over: #c2410c; --ok: #15803d; }
84
+ html.dark { --over: #fb923c; --ok: #4ade80; }
85
+ ```
86
+
87
+ ## Write
88
+
89
+ - Put the controls where the reader starts, and show the result change as they change them,
90
+ without a submit button.
91
+ - Lead with the numbers that matter as `.stat` cards; put detail in tables below.
92
+ - Format numbers for the reader: `new Intl.NumberFormat().format(1284)`. Label units.
93
+ - Build controls the reader changes: segmented controls, sliders, switches, chips (radios and
94
+ checkboxes drawn as the examples draw them), search, sortable tables.
95
+ - For one simple chart, an inline `<svg>` in the theme's chart variables is enough; for charts the
96
+ reader hovers, zooms, or filters, use a library (below).
97
+ - No emoji as icons, no decorative gradients, glows, or drop shadows.
98
+
99
+ ## What runs
100
+
101
+ The page runs its own scripts in a sandboxed frame. It loads only its own files and libraries from
102
+ cdn.jsdelivr.net, cdnjs.cloudflare.com, unpkg.com, and Google Fonts; nothing else on the network.
103
+
104
+ - Read the project's objects live, not a copy: declare a query as `queries/<name>.json` beside
105
+ `index.html` (`queries.md` says how to write one) and read it with `sixb.query("<name>")`. Each
106
+ reader runs it with their own rights as the page opens, so its rows are current and hold only
107
+ what that reader may see. The page can't reach the API any other way.
108
+
109
+ ```js
110
+ // In <script type="module">, which can await at its top.
111
+ const status = document.querySelector("#status")
112
+ status.textContent = "Loading invoices…"
113
+ try {
114
+ const { objects, total, truncated } = await sixb.query("overdue")
115
+ // objects: [{ primaryId, objectTypeId, properties: { amount: 1200, … }, redactions? }, …]
116
+ // A facets query resolves to { kind: "facets", total, facets }.
117
+ render(objects)
118
+ status.textContent = truncated ? `The first ${objects.length} of ${total}` : ""
119
+ } catch (error) {
120
+ status.textContent = `The invoices could not be read: ${error.message}`
121
+ }
122
+ ```
123
+
124
+ Draw a loading state until it answers and an error state when it rejects: its message says why,
125
+ such as a type the reader can't view. A query takes no parameters: filter, sort, and group its
126
+ rows in the page as the reader changes the controls.
127
+
128
+ A value the reader isn't cleared for is missing from `properties` and listed in the row's
129
+ `redactions` (`{ amount: { reason: "missing_clearance" } }`): a permission they lack. Show it as
130
+ locked, with that reason ("You don't have permission to see Amount"), never as 0 or empty, and
131
+ never total, chart, or compare over it: a figure that reads it is locked too.
132
+ - The rows move while the page is open: when the objects a query reads change, the window gets
133
+ `sixb:query` with the query's name in `event.detail.name`. Read it again and draw, keeping what
134
+ the reader set: `addEventListener("sixb:query", (event) => event.detail.name === "overdue" && load())`.
135
+ - Copy values into JSON files beside the page only when `queries.md` says to copy, such as a
136
+ snapshot or figures the user gave you, and read them with `fetch("data/regions.json")`.
137
+ - Load a library from a CDN, by exact version, when it does real work: ECharts for interactive
138
+ charts (`https://cdn.jsdelivr.net/npm/echarts@5.5.1/dist/echarts.min.js`), SortableJS for drag
139
+ and drop (`https://cdn.jsdelivr.net/npm/sortablejs@1.15.2/Sortable.min.js`). Say on the page what
140
+ failed when `window.echarts` is missing, instead of showing nothing.
141
+ - A chart drawn on a canvas keeps the colors it was drawn in. Read the variables with
142
+ `getComputedStyle(document.documentElement)` each time you draw, and draw again on
143
+ `addEventListener("sixb:theme", draw)`, which fires when the app sends its theme and when the
144
+ reader switches mode.
145
+ - Skip animations when `matchMedia("(prefers-reduced-motion: reduce)")` matches (ECharts:
146
+ `animation: false`). The check measures with reduced motion, so its screenshots show charts drawn.
147
+ - Keep what the reader sets with `sixb.state`, so they come back to it: their inputs, filters,
148
+ pinned scenarios, a checklist. It is kept for each reader, across the page's versions, and
149
+ there is no other storage (`localStorage` throws in the sandbox). Values are JSON: at most 64 KB
150
+ a key, 100 keys, and 1 MB in all. Give inputs sensible defaults for a first visit, and a Reset
151
+ that deletes what it kept.
152
+
153
+ ```js
154
+ const kept = await sixb.state.get("inputs") // the value, or undefined the first time
155
+ await sixb.state.set("inputs", { rate: 450, occupancy: 84 })
156
+ await sixb.state.delete("inputs")
157
+ const keys = await sixb.state.keys() // ["inputs", "pinned"]
158
+ ```
159
+
160
+ Write after the reader stops moving a control (a 300 ms pause), not on every step. The check
161
+ keeps values in memory, so a page that uses them checks as it runs. The reader can clear them
162
+ with *Reset page data* in the viewer.
163
+ - A link to another artifact (`<a href="artifact:…">`) opens it beside the conversation; a link to
164
+ a web page opens in a new tab. Open pages with links: the frame can't open windows
165
+ (`window.open`) or go to another address itself.
166
+ - `<sixb-embed src="artifact:…#chart=revenue"></sixb-embed>` shows another artifact on the page: a
167
+ chart, a range, a section, a slide (see `references.md`). Size the box with CSS like any block;
168
+ it is the column's width and 16:9 unless you say otherwise. The app draws the artifact over it,
169
+ live, as the page scrolls. Use one instead of redrawing a chart a sheet already draws.
170
+
171
+ ## Narrow screens
172
+
173
+ The reader may open the page on a phone, 390px wide. The kit's `<main>`, `.grid`, and `.row`
174
+ already reflow; make your own layout do the same.
175
+
176
+ - Lay out columns with CSS grid or flex that collapse under about 760px:
177
+ `grid-template-columns: minmax(0, 1fr)`, so a wide table can't widen the column. Cards in your own
178
+ grid take `margin: 0`; the gap spaces them.
179
+ - Put a wide table in `<div class="table-scroll">`.
180
+ - No fixed widths wider than 360px, and no text under 12px. Controls at least 24px each way; the
181
+ kit's are 36px.
182
+
183
+ ## Check
184
+
185
+ Publishing refuses a page without `index.html`.
186
+
187
+ Once a page publishes, Sixb loads it in the sandbox's browser at 1280px and at a phone's 390px, in
188
+ light and in dark mode or in the one mode its `theme.json` pins, and warns about anything past the
189
+ screen's right edge, drawn over other text, or cut off; text under 12px; a control under 24px;
190
+ text under WCAG AA contrast; an image that did not load; or a script error. Each warning names the
191
+ width, the element as CSS names it, and where it is on the page. The result names the screenshots,
192
+ `desktop.png` and `phone.png`, each the page's top 4000px, under `$SIXB_CONTEXT_DIR/checks/`. The page's
193
+ queries run as the user who asked, so the screenshots show their rows; a query that fails for them
194
+ is a warning, and the page is checked with `sixb.query` rejecting.
195
+
196
+ 1. Open both screenshots with `view_file` and look at them as the reader will: does the page read
197
+ well, and do its numbers make sense?
198
+ 2. Fix what the warnings name and what you see, in the page's files.
199
+ 3. Publish the next version with `publish_artifact_version`, and check again.
200
+
201
+ A script error means the page may show nothing at all: fix it first.
202
+
203
+ ## Examples
204
+
205
+ `examples/page/` holds four finished pages built on the kit:
206
+
207
+ - `fleet-planner`: scenarios, sliders, a switch, and region chips drive animated stats, an ECharts
208
+ chart of crews needed against crews available, and a table with sparklines. It keeps the
209
+ reader's settings with `sixb.state`.
210
+ - `service-explorer`: nine months of service as a calendar heatmap, a zoomable trend, causes, and
211
+ a sortable table; a day picked anywhere fills a panel with every region that day.
212
+ - `dispatch-board`: work orders dragged between crews with SortableJS, live capacity meters, a
213
+ skill check on each drop, a filter and search, and auto-assign.
214
+ - `collections-desk`: live overdue invoices from `queries/overdue.json`, read with `sixb.query`,
215
+ with loading and error states, stats, and chips and a search that filter the rows in the page.
@@ -0,0 +1,66 @@
1
+ # Queries
2
+
3
+ A query reads the project's objects each time the artifact is opened, as whoever opens it: they see
4
+ the rows they may view, and a value they are not cleared for shows locked. Data from the project
5
+ goes in a query, not a copy, so the artifact stays current: a sheet shows its rows (`sheet.md`, Live
6
+ rows), and a page, a deck, or a canvas board reads them with `sixb.query` (`page.md`).
7
+
8
+ ## Write one
9
+
10
+ A query is a file `queries/<name>.json` in the artifact's directory, holding what `sixb objects
11
+ query --file` runs. Read `sixb objects query --help` for the nodes and predicates, and a type's
12
+ file under `$SIXB_ONTOLOGY_DIR` for its properties, links, and which ones a query may filter or
13
+ sort by.
14
+
15
+ ```text
16
+ work/overdue/
17
+ ├── workbook.json
18
+ └── queries/
19
+ └── overdue.json
20
+ ```
21
+
22
+ ```json
23
+ {
24
+ "kind": "expand",
25
+ "expansions": [{ "linkId": "customer", "direction": "outgoing" }],
26
+ "input": {
27
+ "kind": "filter",
28
+ "input": { "kind": "start", "objectTypeId": "Invoice" },
29
+ "predicate": { "op": "eq", "propertyId": "status", "value": "overdue" }
30
+ }
31
+ }
32
+ ```
33
+
34
+ - Name it for what it returns, in lowercase letters, digits, and hyphens: `overdue`,
35
+ `open-cases`. A sheet names it in `"query"`; a page passes it to `sixb.query("overdue")`.
36
+ - Run it before publishing: `sixb objects query --file work/overdue/queries/overdue.json`. It
37
+ returns what the artifact will show you; a reader with other rights sees other rows.
38
+ - `expand` adds a linked object's properties to each row, such as the customer's name: a sheet's
39
+ `"from": "customer.name"` reads it.
40
+ - Bound it with `limit`, `filter`, and `sort`, not `page`: Sixb pages it, up to 10,000 rows.
41
+ `vector` and `rerank` are refused, since every reader would pay for the search.
42
+ - Publishing refuses a query that returns a marked property the user who asked can't read, on the
43
+ rows or on an object `expand` attaches, which returns all of its properties. List what the
44
+ artifact needs with a `project` node, wrapped only by `expand`, `sort`, or `limit`:
45
+ `{ "kind": "project", "input": …, "properties": ["number", "dueDate"] }`. A live sheet's `from`
46
+ must be among them.
47
+ - To count rows by value, such as invoices by status, the file holds a query and its facets
48
+ instead: `{ "query": …, "facets": [{ "propertyId": "status", "limit": 10 }] }`. Run it with
49
+ `sixb objects facets --file`; `objects query` refuses it. A page reads its result,
50
+ `{ "kind": "facets", "total", "facets" }`, each facet's values with their counts; a sheet can't
51
+ show one, since it shows rows.
52
+ - A version holds up to 20 queries. Publishing runs each one as the user who asked, and refuses
53
+ one they could not run.
54
+ - What an open artifact shows is read again when the objects its queries read change, so the
55
+ figures you saw are those of when you ran it: date the ones you cite (`SKILL.md`, Publish).
56
+
57
+ ## When to copy instead
58
+
59
+ Write the values into the artifact, a CSV for a sheet or a JSON file beside a page, when they are
60
+ not the project's live data:
61
+
62
+ - A snapshot the user asked for: "as of September 30", "the numbers we presented". Say in the
63
+ title or a description that it is a snapshot, and of when.
64
+ - Data from the web, a file the user attached, or a tool's output.
65
+ - A computation a query and a sheet's formulas can't do, over more rows than you can copy: copy the
66
+ result, and say what it was computed from.