@sixb/agent 0.2.3 → 0.2.5

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 (149) hide show
  1. package/README.md +3 -3
  2. package/dist/agent-prompt.d.ts.map +1 -1
  3. package/dist/artifacts/layout-check/layout-check.d.ts +21 -24
  4. package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -1
  5. package/dist/artifacts/publish-tool.d.ts +26 -44
  6. package/dist/artifacts/publish-tool.d.ts.map +1 -1
  7. package/dist/ask-tool.d.ts +62 -0
  8. package/dist/ask-tool.d.ts.map +1 -0
  9. package/dist/attachments.d.ts +1 -1
  10. package/dist/attachments.d.ts.map +1 -1
  11. package/dist/background-commands.d.ts +3 -3
  12. package/dist/background-commands.d.ts.map +1 -1
  13. package/dist/background-notices.d.ts.map +1 -1
  14. package/dist/child-files.d.ts +1 -1
  15. package/dist/child-questions.d.ts +1 -1
  16. package/dist/index.d.ts +1 -2
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +10457 -7971
  19. package/dist/index.js.map +46 -38
  20. package/dist/run-agent-turn.d.ts +3 -14
  21. package/dist/run-agent-turn.d.ts.map +1 -1
  22. package/dist/run-conversation-turn.d.ts.map +1 -1
  23. package/dist/run-environment.d.ts +4 -1
  24. package/dist/run-environment.d.ts.map +1 -1
  25. package/dist/run-subagent.d.ts +1 -1
  26. package/dist/run-subagent.d.ts.map +1 -1
  27. package/dist/sandbox-api-context.d.ts.map +1 -1
  28. package/dist/search-script.d.ts +7 -0
  29. package/dist/search-script.d.ts.map +1 -0
  30. package/dist/skills/built-in.d.ts.map +1 -1
  31. package/dist/subagent-tools.d.ts +20 -1
  32. package/dist/subagent-tools.d.ts.map +1 -1
  33. package/dist/tools/background.d.ts +50 -18
  34. package/dist/tools/background.d.ts.map +1 -1
  35. package/dist/tools/bash.d.ts +1 -0
  36. package/dist/tools/bash.d.ts.map +1 -1
  37. package/dist/tools/edit-text.d.ts +22 -0
  38. package/dist/tools/edit-text.d.ts.map +1 -0
  39. package/dist/tools/edit.d.ts +54 -0
  40. package/dist/tools/edit.d.ts.map +1 -0
  41. package/dist/tools/file-writes.d.ts +52 -0
  42. package/dist/tools/file-writes.d.ts.map +1 -0
  43. package/dist/tools/glob.d.ts +41 -0
  44. package/dist/tools/glob.d.ts.map +1 -0
  45. package/dist/tools/grep.d.ts +64 -0
  46. package/dist/tools/grep.d.ts.map +1 -0
  47. package/dist/tools/model-spec.d.ts.map +1 -1
  48. package/dist/tools/read.d.ts +16 -3
  49. package/dist/tools/read.d.ts.map +1 -1
  50. package/dist/tools/sandbox-search.d.ts +26 -0
  51. package/dist/tools/sandbox-search.d.ts.map +1 -0
  52. package/dist/tools/search/command.d.ts +15 -0
  53. package/dist/tools/search/command.d.ts.map +1 -0
  54. package/dist/tools/search/gitignore.d.ts +28 -0
  55. package/dist/tools/search/gitignore.d.ts.map +1 -0
  56. package/dist/tools/search/glob.d.ts +15 -0
  57. package/dist/tools/search/glob.d.ts.map +1 -0
  58. package/dist/tools/search/main.d.ts +2 -0
  59. package/dist/tools/search/main.d.ts.map +1 -0
  60. package/dist/tools/search/match.d.ts +30 -0
  61. package/dist/tools/search/match.d.ts.map +1 -0
  62. package/dist/tools/search/pattern.d.ts +19 -0
  63. package/dist/tools/search/pattern.d.ts.map +1 -0
  64. package/dist/tools/search/read.d.ts +62 -0
  65. package/dist/tools/search/read.d.ts.map +1 -0
  66. package/dist/tools/search/request.d.ts +80 -0
  67. package/dist/tools/search/request.d.ts.map +1 -0
  68. package/dist/tools/search/search.d.ts +4 -0
  69. package/dist/tools/search/search.d.ts.map +1 -0
  70. package/dist/tools/search/walk.d.ts +43 -0
  71. package/dist/tools/search/walk.d.ts.map +1 -0
  72. package/dist/tools/tool-outputs.d.ts.map +1 -1
  73. package/dist/tools/view-file.d.ts +20 -23
  74. package/dist/tools/view-file.d.ts.map +1 -1
  75. package/dist/tools/web-fetch/tool.d.ts +1 -0
  76. package/dist/tools/web-fetch/tool.d.ts.map +1 -1
  77. package/dist/tools/web-search.d.ts +1 -0
  78. package/dist/tools/web-search.d.ts.map +1 -1
  79. package/dist/tools/write.d.ts +36 -0
  80. package/dist/tools/write.d.ts.map +1 -0
  81. package/dist/turn-inbox.d.ts +75 -0
  82. package/dist/turn-inbox.d.ts.map +1 -0
  83. package/package.json +6 -4
  84. package/src/agent-prompt.ts +10 -9
  85. package/src/agent-runtime/preflight.ts +1 -0
  86. package/src/artifacts/layout-check/check.cjs +176 -95
  87. package/src/artifacts/layout-check/layout-check.ts +118 -76
  88. package/src/artifacts/publish-tool.ts +123 -192
  89. package/src/ask-tool.ts +223 -0
  90. package/src/attachments.ts +7 -6
  91. package/src/background-commands.ts +5 -5
  92. package/src/background-notices.ts +5 -12
  93. package/src/child-files.ts +1 -1
  94. package/src/child-questions.ts +1 -1
  95. package/src/context-compaction.ts +4 -1
  96. package/src/generated/search.mjs +985 -0
  97. package/src/index.ts +1 -2
  98. package/src/run-agent-turn.ts +99 -133
  99. package/src/run-child.ts +1 -1
  100. package/src/run-conversation-turn.ts +8 -5
  101. package/src/run-environment.ts +40 -21
  102. package/src/run-subagent.ts +4 -4
  103. package/src/sandbox-api-context.ts +3 -0
  104. package/src/search-script-assets.d.ts +5 -0
  105. package/src/search-script.ts +9 -0
  106. package/src/skills/built-in.ts +16 -0
  107. package/src/skills/sixb-artifacts/SKILL.md +13 -13
  108. package/src/skills/sixb-artifacts/canvas.md +5 -4
  109. package/src/skills/sixb-artifacts/document.md +92 -5
  110. package/src/skills/sixb-artifacts/examples/document/service-proposal/design.css +114 -0
  111. package/src/skills/sixb-artifacts/examples/document/service-proposal/document.html +159 -0
  112. package/src/skills/sixb-artifacts/examples/document/service-proposal/images/fieldwise.svg +1 -0
  113. package/src/skills/sixb-artifacts/examples/document/service-proposal/images/harbor-pine.svg +1 -0
  114. package/src/skills/sixb-artifacts/page.md +2 -2
  115. package/src/skills/sixb-artifacts/queries.md +2 -1
  116. package/src/skills/sixb-artifacts/slides.md +2 -2
  117. package/src/subagent-tools.ts +115 -81
  118. package/src/tools/background.ts +227 -67
  119. package/src/tools/bash.ts +2 -1
  120. package/src/tools/edit-text.ts +241 -0
  121. package/src/tools/edit.ts +166 -0
  122. package/src/tools/file-writes.ts +270 -0
  123. package/src/tools/glob.ts +124 -0
  124. package/src/tools/grep.ts +190 -0
  125. package/src/tools/model-spec.ts +13 -13
  126. package/src/tools/read.ts +75 -9
  127. package/src/tools/sandbox-search.ts +219 -0
  128. package/src/tools/search/command.ts +116 -0
  129. package/src/tools/search/gitignore.ts +101 -0
  130. package/src/tools/search/glob.ts +90 -0
  131. package/src/tools/search/main.ts +9 -0
  132. package/src/tools/search/match.ts +278 -0
  133. package/src/tools/search/pattern.ts +178 -0
  134. package/src/tools/search/read.ts +237 -0
  135. package/src/tools/search/request.ts +101 -0
  136. package/src/tools/search/search.ts +297 -0
  137. package/src/tools/search/walk.ts +145 -0
  138. package/src/tools/tool-outputs.ts +9 -4
  139. package/src/tools/view-file.ts +78 -80
  140. package/src/tools/web-fetch/tool.ts +2 -1
  141. package/src/tools/web-search.ts +1 -0
  142. package/src/tools/write.ts +95 -0
  143. package/src/turn-inbox.ts +283 -0
  144. package/dist/artifacts/board-previews.d.ts +0 -41
  145. package/dist/artifacts/board-previews.d.ts.map +0 -1
  146. package/dist/ask-parent-tool.d.ts +0 -36
  147. package/dist/ask-parent-tool.d.ts.map +0 -1
  148. package/src/artifacts/board-previews.ts +0 -218
  149. package/src/ask-parent-tool.ts +0 -100
@@ -27,6 +27,18 @@ import operationsReview from "./sixb-artifacts/examples/document/operations-revi
27
27
  import restorationsFigure from "./sixb-artifacts/examples/document/operations-review/figures/restorations.svg" with {
28
28
  type: "text",
29
29
  }
30
+ import proposalDesign from "./sixb-artifacts/examples/document/service-proposal/design.css" with {
31
+ type: "text",
32
+ }
33
+ import proposalDocument from "./sixb-artifacts/examples/document/service-proposal/document.html" with {
34
+ type: "text",
35
+ }
36
+ import proposalLogo from "./sixb-artifacts/examples/document/service-proposal/images/fieldwise.svg" with {
37
+ type: "text",
38
+ }
39
+ import proposalClientLogo from "./sixb-artifacts/examples/document/service-proposal/images/harbor-pine.svg" with {
40
+ type: "text",
41
+ }
30
42
  import collectionsDeskPage from "./sixb-artifacts/examples/page/collections-desk/index.html" with {
31
43
  type: "text",
32
44
  }
@@ -102,6 +114,10 @@ export const BUILT_IN_SKILLS: readonly AgentSkillDefinition[] = Object.freeze([
102
114
  "examples/document/operations-review/document.md": operationsReview,
103
115
  "examples/document/operations-review/figures/restorations.svg": restorationsFigure,
104
116
  "examples/document/incident-report/document.md": incidentReport,
117
+ "examples/document/service-proposal/document.html": text(proposalDocument),
118
+ "examples/document/service-proposal/design.css": text(proposalDesign),
119
+ "examples/document/service-proposal/images/fieldwise.svg": proposalLogo,
120
+ "examples/document/service-proposal/images/harbor-pine.svg": proposalClientLogo,
105
121
  "sheet.md": sheetGuide,
106
122
  "references.md": referencesGuide,
107
123
  "slides.md": slidesGuide,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sixb-artifacts
3
- description: Publish a deliverable the user should see, such as a report, a write-up, a table of data, or a file they asked for, as an artifact, and revise it with update_artifact.
3
+ description: Publish a deliverable the user should see, such as a report, a write-up, a table of data, or a file they asked for, as an artifact, and revise it by publishing it again with its id.
4
4
  ---
5
5
 
6
6
  # Artifacts
@@ -15,7 +15,7 @@ the question, answer in the chat.
15
15
 
16
16
  | Kind | Publish it for | Read first |
17
17
  | --- | --- | --- |
18
- | `document` | A report, brief, memo, plan, or write-up: anything read top to bottom | `document.md` |
18
+ | `document` | A report, brief, memo, plan, or write-up: anything read top to bottom; designed, a proposal, contract, or letter in a business's own look | `document.md` |
19
19
  | `sheet` | Tabular data the reader sorts, sums, charts, or downloads: metrics, lists, trackers, exports | `sheet.md` |
20
20
  | `slides` | A deck to present: a review, a pitch, a plan for a meeting | `slides.md` |
21
21
  | `page` | A small web app the reader works with: a calculator, a planner, a dashboard with filters | `page.md` |
@@ -45,8 +45,8 @@ go beside each picture.
45
45
  cannot, tell the user the deliverable could not be published; never describe it as ready.
46
46
  4. Fix what each warning names and update the artifact when it matters to the reader. A
47
47
  deck also comes back with a screenshot of each slide, a page with one at a laptop's width and
48
- one at a phone's, and a canvas with one of each board: look at them (`slides.md`, `page.md`,
49
- `canvas.md`, Check).
48
+ one at a phone's, a designed document with one of each page, and a canvas with one of each
49
+ board: look at them (`slides.md`, `page.md`, `document.md`, `canvas.md`, Check).
50
50
  5. In the reply, say in a sentence or two what you published and what stands out. Do not paste
51
51
  its content, a path, or its id as text: the user sees the artifact. To show a chart or a range
52
52
  of it in place, use its address (`references.md`). A figure you cite from live data is the one
@@ -56,7 +56,7 @@ go beside each picture.
56
56
 
57
57
  ## Revise
58
58
 
59
- Your changes go to the artifact's current version, which stays open: each `update_artifact`
59
+ Your changes go to the artifact's current version, which stays open: each publish with its `id`
60
60
  replaces it. Only the user creates a version, which freezes it; your next update then opens a new
61
61
  one, and the created version stays as it was.
62
62
 
@@ -71,27 +71,27 @@ rm -rf work/q3-review && cp -r "$SIXB_ARTIFACTS_DIR/art_k3m9q2x7tp" work/q3-revi
71
71
  Edit the copy, then update the artifact from it:
72
72
 
73
73
  ```text
74
- update_artifact({ id: "art_k3m9q2x7tp", path: "work/q3-review", title: "Q3 operations review" })
74
+ publish_artifact({ id: "art_k3m9q2x7tp", path: "work/q3-review", title: "Q3 operations review" })
75
75
  → Updated "Q3 operations review": artifact art_k3m9q2x7tp, version 1 at revision 2.
76
76
  ```
77
77
 
78
78
  An entry with `"edited": true` was last written outside this conversation: most often a person's
79
- edit in the app, such as a sheet's cells or columns or a canvas's notes and layout, but also
80
- another conversation or the project's code. Start from it as it is, and keep its changes in yours
79
+ edit in the app, such as a sheet's cells or columns, a canvas's notes and layout, or a document's
80
+ blocks, designed or not, but also another conversation or the project's code. Start from it as it is, and keep its changes in yours
81
81
  unless the user asks you to undo them; say what you built on when you reply.
82
82
 
83
- When others changed a canvas while you worked, `update_artifact` merges your changes with theirs
84
- and writes the merged result into the folder you updated from: keep editing it.
83
+ When others changed a canvas or a document while you worked, the update merges your changes with
84
+ theirs and writes the merged result into the folder you updated from: keep editing it.
85
85
 
86
- If another kind of artifact changes while you work, `update_artifact` refuses rather than write
86
+ If another kind of artifact changes while you work, the update refuses rather than write
87
87
  over what it never saw, says who changed it, and installs it in place of your copy and in the
88
88
  folder you published it from. What your sub-agents wrote reaches both the same way. Start again from that copy,
89
89
  keep its changes, make yours again, and update it.
90
90
 
91
91
  An entry without a `directory` is not installed: the conversation's artifacts were too large to
92
92
  install together, or its files could not be read. Rebuild it in a working directory with the paths
93
- in its `files`, then update it. An update keeps the artifact's kind; the title may change. Call
94
- `publish_artifact` again only for a different deliverable.
93
+ in its `files`, then update it. An update keeps the artifact's kind; the title may change. Leave
94
+ out `id`, and pass a `kind`, only for a different deliverable.
95
95
 
96
96
  ## Artifacts that objects hold
97
97
 
@@ -167,15 +167,16 @@ text on a board.
167
167
  Once a canvas publishes, Sixb opens each board at its own size in the sandbox's browser, in light
168
168
  and dark mode or the one its `theme.json` pins, and warns as it does for a page, naming the board.
169
169
  The result names each board's screenshot, `<id>.png`, and `overview.png`, the whole canvas as it
170
- opens, under `$SIXB_CONTEXT_DIR/checks/`. The check also takes each board's preview, the picture
171
- readers see until they open it, so a board that looks wrong there looks wrong on the canvas too.
170
+ opens, under `$SIXB_CONTEXT_DIR/checks/`. Each board's preview, the picture readers see until
171
+ they open it, is taken the same way a few seconds later, so a board that looks wrong there looks
172
+ wrong on the canvas too.
172
173
 
173
- 1. Open the screenshots with `view_file` and look at each board as the reader will. Open
174
+ 1. Open the screenshots with `read` and look at each board as the reader will. Open
174
175
  `overview.png` to see whether the canvas reads at the zoom it opens at, and judge it as a
175
176
  designer would: one composition on one grid, words at three levels, nothing that looks like a
176
177
  default or a draft.
177
178
  2. Fix what the warnings name and what you see, in the boards' files or `canvas.json`.
178
- 3. Update the artifact with `update_artifact`, and check again.
179
+ 3. Update the artifact with `publish_artifact` and its `id`, and check again.
179
180
 
180
181
  ## Comments
181
182
 
@@ -1,8 +1,11 @@
1
1
  # Documents
2
2
 
3
3
  A document is Markdown in `document.md`, with its images beside it. The app renders it as a page:
4
- a title and lede, a measured column, an outline of its sections, and figures, callouts, and tables
5
- set for reading.
4
+ a title and lede, a measured column, and figures, callouts, and tables set for reading.
5
+
6
+ A document that needs a design of its own, such as a proposal, a contract, a letter on letterhead,
7
+ or a report in a company's style, is HTML in `document.html` instead: see Designed documents below.
8
+ Everything else is Markdown.
6
9
 
7
10
  ## Structure
8
11
 
@@ -19,6 +22,9 @@ set for reading.
19
22
  GitHub-flavored Markdown: tables, task lists, strikethrough, autolinks, footnotes (`[^1]`), and
20
23
  fenced code blocks with a language. Raw HTML is not rendered.
21
24
 
25
+ Once people edit a document in the app, it is written back as its editor writes Markdown: `-`
26
+ bullets, `*emphasis*`, `**bold**`, `#` headings. Read it again before you change words in place.
27
+
22
28
  | Write | It renders as |
23
29
  | --- | --- |
24
30
  | `> [!NOTE]` as the first line of a quote | A callout. Also `[!TIP]`, `[!IMPORTANT]`, `[!WARNING]`, `[!CAUTION]` |
@@ -44,7 +50,7 @@ both light and dark pages, and label the axes and units.
44
50
 
45
51
  ## Theme
46
52
 
47
- A document takes the app's theme, light and dark. Only when the user asks for a look, add
53
+ A Markdown document takes the app's theme, light and dark. Only when the user asks for a look, add
48
54
  `theme.json` at the artifact's root:
49
55
 
50
56
  ```json
@@ -57,7 +63,88 @@ A document takes the app's theme, light and dark. Only when the user asks for a
57
63
  `--font-serif`, `--font-mono`, and `--radius`. Colors are hex, `rgb()`, `hsl()`, or `oklch()`;
58
64
  fonts are family names; `--radius` is a length such as `6px`.
59
65
 
66
+ ## Designed documents
67
+
68
+ Write one when the user asks for a document that should look like a business's own, or a project
69
+ skill gives you a design or a template for it. It renders exactly as its stylesheets say, on white
70
+ paper, in the app and as the pages it prints on.
71
+
72
+ ```text
73
+ work/proposal/
74
+ ├── document.html the document: semantic HTML, no document.md beside it
75
+ ├── design.css its design, linked with <link rel="stylesheet" href="design.css">
76
+ ├── fonts/ @font-face files, when the design names a font
77
+ └── images/ logos, figures, screenshots
78
+ ```
79
+
80
+ - **Paper.** Give the stylesheet an `@page` rule with a size and the margins:
81
+ `@page { size: letter; margin: 0.75in 0.85in; }` (or `A4`, or two lengths). That is what makes
82
+ pages: the reader sees them, downloads them as a PDF, and the layout check shoots each one. Keep
83
+ the margins there, not on `<body>`, and give `<body>` no width, margin, or padding of its own.
84
+ - **Editable.** People edit it block by block in the app. Write the `<body>` and `</body>` tags,
85
+ with nothing after `</body>` but `</html>`, and words in elements of their own (`<p>`, `<li>`,
86
+ `<td>`), not loose beside blocks: what does not fit is still kept, but edited word by word.
87
+ - **Markup.** Any HTML that lays out text, tables, figures, and pictures, styled by any CSS: grids,
88
+ columns, `::before` numbering, `<svg>`. No scripts, `on…` handlers, `<iframe>`, `<form>`, or
89
+ `<base>`: publishing refuses them. Images are files in the artifact (or another artifact's,
90
+ `artifact:<id>/<path>`); stylesheets are files in the artifact or Google Fonts.
91
+ - **Style by class**, not by `body > …`: as pages, the body's content is moved into the flow that
92
+ is cut into pages, so a selector on the body's children stops matching.
93
+ - **Pages break where you say.** `break-before: page` starts a section on a new page;
94
+ `break-inside: avoid` keeps a table row, a figure, or the signature block whole; `thead { display:
95
+ table-header-group; }` repeats a table's header on each page it runs onto. Nothing may be wider
96
+ than the space between the margins.
97
+ - **Phones.** On a phone it shows as one sheet at the screen's width, with your CSS. Stack every
98
+ multi-column grid in `@media screen and (max-width: 600px) { … }`, and size images with
99
+ `max-width: 100%`, so nothing runs off the side. Keep `screen` in it: paper as narrow as A5
100
+ would match it when printed.
101
+ - **Type in points**, as print is: body text around 10pt, labels no smaller than 6.5pt.
102
+ - **Headings** `h1`–`h3` make the outline and the sections an address can name, as in Markdown.
103
+ - **A project's design** comes as files in a project skill: copy its stylesheet, fonts, and images,
104
+ or its template, into your directory, and write the content into it. Never link to the skill's
105
+ folder: a version holds everything it shows, so a later change to the design never changes a
106
+ document already sent.
107
+
108
+ ### Live data
109
+
110
+ A designed document an object holds, such as a contract's proposal, shows that object's values as
111
+ each reader reads them, never a copy. Name its type in `<head>`, then mark each value; write in each
112
+ one what it should read, which it keeps where no object holds it yet (a template) and while it is
113
+ edited:
114
+
115
+ ```html
116
+ <meta name="sixb:object-type" content="Contract">
117
+ <h1 data-sixb-field="client.name">Harbor Co</h1>
118
+ <p>A fixed fee of <span data-sixb-field="fee" data-format="money" data-currency-field="currency">$4,000</span>.</p>
119
+ <tr data-sixb-each="milestones"><td data-sixb-field="title">Kickoff</td></tr>
120
+ <tr data-sixb-each="query:past-work"><td data-sixb-field="title">Phase 1</td>
121
+ <td data-sixb-field="signedAt" data-format="date">March 2, 2026</td></tr>
122
+ <span data-sixb-field="query:past-work.total">3</span>
123
+ ```
124
+
125
+ - A path reads the holder's properties, `scope.services[job-flow].amount` (a list's item by its
126
+ `id`), and through one link, `client.name`. Fields in a `data-sixb-each` element read its item.
127
+ - `data-sixb-each="query:<name>"` repeats per row of `queries/<name>.json` (`queries.md`), which
128
+ may start from the holder: `{ "kind": "traverse", "input": { "kind": "holder" }, … }`.
129
+ `query:<name>.total` is how many rows it matched; `query:<name>.facets.<property>` repeats per
130
+ facet value, with `value` and `count`.
131
+ - `data-format` is `money` (with `data-currency="USD"` or `data-currency-field`), `number`,
132
+ `percent` (0.25 reads 25%), or `date`, formatted for `<html lang>`. A total or an instalment is
133
+ a property the object keeps: a document computes nothing.
134
+ - Publishing warns `field_unknown` for a path the type doesn't hold. Freezing the version writes
135
+ the values in and keeps the fields, so the next version is live again; its PDF shows them as
136
+ whoever asks reads them.
137
+ - After a freeze, a `data-sixb-each` element appears once per item, one after the other: they are
138
+ one element, copied from the first, so change the first. One marked `data-sixb-empty` is a list
139
+ that was empty: keep it.
140
+
141
+ After publishing, open each `page-NN.png` the check returns: look at where each page breaks, for
142
+ anything cut off at a page's edge, and for a page left nearly empty. Open `phone.png` too, for
143
+ anything running off the side, then fix and update.
144
+
60
145
  ## Examples
61
146
 
62
- `examples/document/` holds two finished documents to start from: an operations review with a figure
63
- and a table, and an incident report with a timeline and follow-ups.
147
+ `examples/document/` holds three finished documents to start from: an operations review with a
148
+ figure and a table, an incident report with a timeline and follow-ups, and `service-proposal`, a
149
+ designed document on Letter paper: a cover, sections that each start a page, a timeline, pricing
150
+ tables, and a signature block.
@@ -0,0 +1,114 @@
1
+ /* The paper: US Letter with its margins. Pages and the PDF are cut from it. */
2
+ @page { size: letter; margin: 0.72in 0.84in; }
3
+
4
+ :root {
5
+ --accent: #0f766e;
6
+ --ink: #18181b;
7
+ --muted: #71717a;
8
+ --rule: #e4e4e7;
9
+ --wash: #f0fdfa;
10
+ }
11
+
12
+ body {
13
+ color: var(--ink);
14
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
15
+ font-size: 10pt;
16
+ line-height: 1.6;
17
+ }
18
+
19
+ h1, h2, h3 { margin: 0; letter-spacing: -0.02em; break-after: avoid; }
20
+ h2 { margin-bottom: 12px; font-size: 14pt; line-height: 1.25; }
21
+ h3 { margin: 20px 0 6px; font-size: 10.5pt; }
22
+ p { margin: 0 0 10px; }
23
+ ul, ol { margin: 0 0 12px; padding-left: 20px; }
24
+ li + li { margin-top: 4px; }
25
+ strong { font-weight: 700; }
26
+
27
+ .section-number { color: var(--accent); }
28
+ .page { break-before: page; }
29
+
30
+ /* The cover fills its page; the facts sit at its foot. */
31
+ .cover { display: flex; flex-direction: column; min-height: 9.4in; }
32
+ .cover header { display: flex; align-items: flex-start; justify-content: space-between; }
33
+ .logos { display: flex; align-items: center; gap: 18px; }
34
+ .logos img + img { padding-left: 18px; border-left: 1px solid var(--rule); }
35
+ .eyebrow {
36
+ margin: 0;
37
+ color: var(--muted);
38
+ font-size: 7pt;
39
+ font-weight: 700;
40
+ letter-spacing: 0.14em;
41
+ text-transform: uppercase;
42
+ }
43
+ .cover h1 { margin-top: 88px; font-size: 30pt; line-height: 1.1; letter-spacing: -0.03em; }
44
+ .prepared-for { margin-top: 14px; color: #52525b; }
45
+ .summary { margin-top: 44px; padding-top: 22px; border-top: 2px solid var(--accent); }
46
+ .summary .eyebrow { margin-bottom: 10px; color: var(--ink); }
47
+ .facts {
48
+ display: grid;
49
+ grid-template-columns: repeat(3, 1fr);
50
+ gap: 24px;
51
+ margin-top: auto;
52
+ padding-top: 16px;
53
+ border-top: 1px solid var(--rule);
54
+ }
55
+ .facts p { margin: 6px 0 0; font-size: 8.5pt; }
56
+
57
+ .columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
58
+ .columns h3 { margin-top: 0; padding-top: 10px; border-top: 1px solid var(--rule); }
59
+ .callout { margin: 18px 0; padding: 14px 16px; border: 1px solid #ccfbf1; background: var(--wash); }
60
+ .callout p:last-child { margin-bottom: 0; }
61
+
62
+ /* A numbered timeline down the page. */
63
+ .timeline { margin: 18px 0; padding: 0; list-style: none; }
64
+ .timeline li { position: relative; margin: 0; padding: 0 0 16px 40px; break-inside: avoid; }
65
+ .timeline li::before {
66
+ content: counter(list-item, decimal-leading-zero);
67
+ position: absolute;
68
+ left: 0;
69
+ top: 0;
70
+ width: 22px;
71
+ height: 22px;
72
+ border: 1px solid #99f6e4;
73
+ border-radius: 50%;
74
+ background: var(--wash);
75
+ color: var(--accent);
76
+ font-size: 6.5pt;
77
+ line-height: 20px;
78
+ text-align: center;
79
+ }
80
+ .timeline li:not(:last-child)::after {
81
+ content: "";
82
+ position: absolute;
83
+ left: 11px;
84
+ top: 26px;
85
+ bottom: 2px;
86
+ border-left: 1px solid var(--rule);
87
+ }
88
+ .timeline strong { display: block; }
89
+ .timeline p { margin: 2px 0 0; color: #52525b; }
90
+
91
+ table { width: 100%; margin: 12px 0 20px; border: 1px solid var(--rule); border-collapse: collapse; }
92
+ thead { display: table-header-group; }
93
+ th, td { padding: 7px 10px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
94
+ th { color: var(--muted); font-size: 6.5pt; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; background: #fafafa; }
95
+ tr { break-inside: avoid; }
96
+ .amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
97
+ tfoot td { font-weight: 700; }
98
+
99
+ /* Two parties side by side, a line to sign on each. */
100
+ .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--rule); break-inside: avoid; }
101
+ .signature-line { height: 44px; border-bottom: 1px solid #a1a1aa; }
102
+ .signatures .name { margin: 8px 0 0; font-weight: 600; }
103
+ .signatures .organization { margin: 0; color: var(--muted); font-size: 8pt; }
104
+ .signatures .dated { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
105
+ .signatures .dated span { display: block; padding-top: 22px; border-bottom: 1px solid #a1a1aa; color: var(--muted); font-size: 6.5pt; letter-spacing: 0.1em; text-transform: uppercase; }
106
+
107
+ /* On a phone the document is one sheet at the screen's width: the grids stack. */
108
+ @media screen and (max-width: 600px) {
109
+ .cover { min-height: 0; }
110
+ .columns, .facts, .signatures { grid-template-columns: 1fr; }
111
+ .cover header { flex-direction: column; gap: 12px; }
112
+ .cover h1 { margin-top: 48px; }
113
+ .logos { flex-wrap: wrap; }
114
+ }
@@ -0,0 +1,159 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Harbor &amp; Pine Landscaping: job flow proposal</title>
6
+ <link rel="stylesheet" href="design.css">
7
+ </head>
8
+ <body>
9
+ <section class="cover">
10
+ <header>
11
+ <div class="logos">
12
+ <img src="images/fieldwise.svg" alt="Fieldwise" width="132" height="32">
13
+ <img src="images/harbor-pine.svg" alt="Harbor &amp; Pine Landscaping" width="150" height="32">
14
+ </div>
15
+ <p class="eyebrow">Service proposal</p>
16
+ </header>
17
+
18
+ <h1>Harbor &amp; Pine Landscaping</h1>
19
+ <p class="prepared-for">Prepared for <strong>Harbor &amp; Pine Landscaping LLC</strong> · Dana Reyes</p>
20
+
21
+ <div class="summary">
22
+ <p class="eyebrow">Executive summary</p>
23
+ <p>Fieldwise will build one system around the way Harbor &amp; Pine already works. It connects
24
+ to QuickBooks, so the books stay where they are, and gives every job one path from first
25
+ call to paid that the whole crew can see.</p>
26
+ <p>The work takes about five weeks for a fixed fee of <strong>$4,000</strong>, with hosting
27
+ and maintenance at <strong>$200 a month</strong> after delivery.</p>
28
+ </div>
29
+
30
+ <div class="facts">
31
+ <div><p class="eyebrow">Prepared by</p><p>Sam Okafor · Fieldwise</p></div>
32
+ <div><p class="eyebrow">Proposal date</p><p>November 5, 2026</p></div>
33
+ <div><p class="eyebrow">Valid until</p><p>December 5, 2026</p></div>
34
+ </div>
35
+ </section>
36
+
37
+ <section class="page">
38
+ <h2><span class="section-number">1.</span> What changes for Harbor &amp; Pine</h2>
39
+ <div class="columns">
40
+ <div>
41
+ <h3>What we heard</h3>
42
+ <p>The business runs through Dana: calls, texts and what she keeps in her head. There is no
43
+ shared schedule, so the crew gets its plan from talking to her.</p>
44
+ <p>The aim is not more work, but the same work running smoothly without everything passing
45
+ through one person.</p>
46
+ </div>
47
+ <div>
48
+ <h3>What we saw in the books</h3>
49
+ <p>Work ranges from large custom projects to recurring maintenance and snow contracts.</p>
50
+ <p>Many estimates stay marked pending, so QuickBooks can't tell which ones are still
51
+ live.</p>
52
+ </div>
53
+ </div>
54
+ <h3>What we propose</h3>
55
+ <p>Keep what already works, walking the site and QuickBooks doing the books, and add one path
56
+ every job follows:</p>
57
+ <p><strong>Call → Site visit → Estimate → Won → Scheduled → In progress → Invoiced → Paid</strong></p>
58
+ <div class="callout">
59
+ <p><strong>The goal</strong></p>
60
+ <p>The same business, running more smoothly, with work moving through the company without
61
+ Dana carrying all of it.</p>
62
+ </div>
63
+ </section>
64
+
65
+ <section class="page">
66
+ <h2><span class="section-number">2.</span> Scope of work</h2>
67
+ <p>Fieldwise builds an app on top of QuickBooks, for the office computer and the crew's
68
+ phones. QuickBooks keeps the books; the app handles everything around each job.</p>
69
+ <h3>What we'll deliver</h3>
70
+ <ol>
71
+ <li><strong>Every job in one place.</strong> From first call to paid, including annual
72
+ contracts.</li>
73
+ <li><strong>Site visits to estimates.</strong> Photos and notes become a draft estimate you
74
+ price and send through QuickBooks.</li>
75
+ <li><strong>One shared schedule.</strong> The crew knows where to go, and customers get
76
+ updates.</li>
77
+ <li><strong>Extras and invoices.</strong> Approved extras carry onto the invoice, and payments
78
+ show on the job.</li>
79
+ </ol>
80
+ <h3>Your part</h3>
81
+ <ul>
82
+ <li>QuickBooks Online admin access</li>
83
+ <li>Your estimate terms and conditions</li>
84
+ <li>A short check-in each week</li>
85
+ </ul>
86
+ <h3>Not included</h3>
87
+ <p>Payroll, time tracking, and a customer login or portal.</p>
88
+ </section>
89
+
90
+ <section class="page">
91
+ <h2><span class="section-number">3.</span> Timeline</h2>
92
+ <p>Delivery is about three weeks from kickoff, with a review as each part comes together.</p>
93
+ <ol class="timeline">
94
+ <li><strong>Week 1: Kickoff and QuickBooks</strong>
95
+ <p>Connect QuickBooks and bring in customers, estimates, invoices and payments.</p></li>
96
+ <li><strong>Weeks 1–2: Jobs and customers</strong>
97
+ <p>Build the Today page, the jobs board and customer pages, then review them with you.</p></li>
98
+ <li><strong>Week 2: Site visits and estimates</strong>
99
+ <p>Build site visit capture and drafted estimates, then try them on a real job.</p></li>
100
+ <li><strong>Weeks 2–3: Schedule, crew and invoices</strong>
101
+ <p>Build the calendar, the crew view, extras and invoices.</p></li>
102
+ <li><strong>Weeks 4–5: Fixes and small changes</strong>
103
+ <p>Fix what comes up as you use it on real jobs.</p></li>
104
+ </ol>
105
+ </section>
106
+
107
+ <section class="page">
108
+ <h2><span class="section-number">4.</span> Pricing and payment terms</h2>
109
+ <p>The full scope is delivered for a <strong>fixed fee of $4,000</strong>.</p>
110
+ <table>
111
+ <thead><tr><th>Item</th><th>Includes</th><th class="amount">Fee</th></tr></thead>
112
+ <tbody>
113
+ <tr><td>Setup</td><td>Kickoff, QuickBooks connection, hosting, sign-in</td><td class="amount">$500</td></tr>
114
+ <tr><td>Jobs and customers</td><td>Today page, jobs board, customer pages</td><td class="amount">$900</td></tr>
115
+ <tr><td>Site visits and estimates</td><td>Photos, notes, drafted estimates in QuickBooks</td><td class="amount">$900</td></tr>
116
+ <tr><td>Schedule and crew</td><td>Shared calendar, crew view</td><td class="amount">$450</td></tr>
117
+ <tr><td>Extras and invoices</td><td>Approved extras, invoices in QuickBooks</td><td class="amount">$500</td></tr>
118
+ <tr><td>Testing and fixes</td><td>Real data testing, walkthrough, fixes</td><td class="amount">$750</td></tr>
119
+ </tbody>
120
+ <tfoot><tr><td colspan="2">Total fixed fee</td><td class="amount">$4,000</td></tr></tfoot>
121
+ </table>
122
+ <h3>Payment schedule</h3>
123
+ <table>
124
+ <thead><tr><th>Payment</th><th>When</th><th class="amount">Amount</th></tr></thead>
125
+ <tbody>
126
+ <tr><td>Kickoff</td><td>When work starts</td><td class="amount">$2,000</td></tr>
127
+ <tr><td>Delivery</td><td>When it is delivered</td><td class="amount">$2,000</td></tr>
128
+ </tbody>
129
+ </table>
130
+ <p>Invoices are due within 30 days.</p>
131
+ <h3>Hosting and maintenance</h3>
132
+ <p><strong>$200 a month</strong> after delivery, covering hosting, updates and fixes. Either
133
+ party can end it with 30 days' notice.</p>
134
+ </section>
135
+
136
+ <section class="page">
137
+ <h2><span class="section-number">5.</span> Acceptance and next steps</h2>
138
+ <p>By signing below, Harbor &amp; Pine Landscaping LLC authorizes Fieldwise to proceed with the
139
+ scope above for a fixed fee of <strong>$4,000</strong>, with hosting and maintenance at
140
+ <strong>$200 a month</strong> after delivery. Once it's signed, we'll schedule the kickoff.</p>
141
+ <div class="signatures">
142
+ <div>
143
+ <p class="eyebrow">For the service provider</p>
144
+ <div class="signature-line"></div>
145
+ <p class="name">Sam Okafor</p>
146
+ <p class="organization">Fieldwise</p>
147
+ <div class="dated"><span>Title</span><span>Date</span></div>
148
+ </div>
149
+ <div>
150
+ <p class="eyebrow">Accepted and agreed</p>
151
+ <div class="signature-line"></div>
152
+ <p class="name">Dana Reyes</p>
153
+ <p class="organization">Harbor &amp; Pine Landscaping LLC</p>
154
+ <div class="dated"><span>Title</span><span>Date</span></div>
155
+ </div>
156
+ </div>
157
+ </section>
158
+ </body>
159
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="132" height="32" viewBox="0 0 132 32"><path d="M2 26 L14 4 L26 26 Z" fill="#0f766e"/><path d="M14 4 L26 26 L18 26 Z" fill="#115e59"/><text x="34" y="23" font-family="Helvetica, Arial, sans-serif" font-size="19" font-weight="700" letter-spacing="-0.4" fill="#18181b">Fieldwise</text></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="150" height="32" viewBox="0 0 150 32"><circle cx="14" cy="16" r="12" fill="none" stroke="#3f3f46" stroke-width="2"/><path d="M14 7 L20 19 H8 Z M14 13 L21 25 H7 Z" fill="#3f3f46"/><text x="34" y="15" font-family="Georgia, serif" font-size="12" letter-spacing="1.6" fill="#27272a">HARBOR &amp; PINE</text><text x="34" y="27" font-family="Helvetica, Arial, sans-serif" font-size="7.5" letter-spacing="2.4" fill="#71717a">LANDSCAPING</text></svg>
@@ -193,10 +193,10 @@ width, the element as CSS names it, and where it is on the page. The result name
193
193
  queries run as the user who asked, so the screenshots show their rows; a query that fails for them
194
194
  is a warning, and the page is checked with `sixb.query` rejecting.
195
195
 
196
- 1. Open both screenshots with `view_file` and look at them as the reader will: does the page read
196
+ 1. Open both screenshots with `read` and look at them as the reader will: does the page read
197
197
  well, and do its numbers make sense?
198
198
  2. Fix what the warnings name and what you see, in the page's files.
199
- 3. Update the artifact with `update_artifact`, and check again.
199
+ 3. Update the artifact with `publish_artifact` and its `id`, and check again.
200
200
 
201
201
  A script error means the page may show nothing at all: fix it first.
202
202
 
@@ -3,7 +3,8 @@
3
3
  A query reads the project's objects each time the artifact is opened, as whoever opens it: they see
4
4
  the rows they may view, and a value they are not cleared for shows locked. Data from the project
5
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`).
6
+ rows), a page, a deck, or a canvas board reads them with `sixb.query` (`page.md`), and a designed
7
+ document shows them in its fields (`document.md`, Live data).
7
8
 
8
9
  ## Write one
9
10
 
@@ -122,10 +122,10 @@ an image that did not load; or an error while the deck loaded. Each warning name
122
122
  element as CSS names it (`p.kicker`), and where it is on the 1280×720 slide. The result names
123
123
  the screenshots, one per slide, under `$SIXB_CONTEXT_DIR/checks/`.
124
124
 
125
- 1. Open the screenshots with `view_file`, at least the slides a warning names, and look at each
125
+ 1. Open the screenshots with `read`, at least the slides a warning names, and look at each
126
126
  as the reader will: is anything crowded, misaligned, or unreadable?
127
127
  2. Fix what the warnings name and what you see, in the deck's files.
128
- 3. Update the artifact with `update_artifact`, and check again.
128
+ 3. Update the artifact with `publish_artifact` and its `id`, and check again.
129
129
 
130
130
  Contrast that fails only in dark mode means a fixed color: use the theme's variables. When the
131
131
  result says the check did not run, read `index.html` slide by slide instead.