things-api 0.11.0 → 0.13.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 (208) hide show
  1. package/README.md +16 -5
  2. package/dist/audit/schema.d.ts +7 -0
  3. package/dist/audit/schema.js.map +1 -1
  4. package/dist/cli/canonical-ref.d.ts +21 -0
  5. package/dist/cli/canonical-ref.js +23 -0
  6. package/dist/cli/canonical-ref.js.map +1 -0
  7. package/dist/cli/commands/area.d.ts +18 -11
  8. package/dist/cli/commands/area.js +81 -77
  9. package/dist/cli/commands/area.js.map +1 -1
  10. package/dist/cli/commands/doctor.d.ts +1 -2
  11. package/dist/cli/commands/doctor.js +11 -1
  12. package/dist/cli/commands/doctor.js.map +1 -1
  13. package/dist/cli/commands/install-skill.d.ts +19 -4
  14. package/dist/cli/commands/install-skill.js +130 -52
  15. package/dist/cli/commands/install-skill.js.map +1 -1
  16. package/dist/cli/commands/mcp.js +21 -1
  17. package/dist/cli/commands/mcp.js.map +1 -1
  18. package/dist/cli/commands/project.d.ts +1 -0
  19. package/dist/cli/commands/project.js +92 -48
  20. package/dist/cli/commands/project.js.map +1 -1
  21. package/dist/cli/commands/reads.d.ts +5 -1
  22. package/dist/cli/commands/reads.js +110 -31
  23. package/dist/cli/commands/reads.js.map +1 -1
  24. package/dist/cli/commands/setup.js +11 -4
  25. package/dist/cli/commands/setup.js.map +1 -1
  26. package/dist/cli/commands/show.js +75 -36
  27. package/dist/cli/commands/show.js.map +1 -1
  28. package/dist/cli/commands/todo.js +2 -2
  29. package/dist/cli/commands/todo.js.map +1 -1
  30. package/dist/cli/commands/writes.js +795 -144
  31. package/dist/cli/commands/writes.js.map +1 -1
  32. package/dist/cli/did-you-mean.d.ts +14 -3
  33. package/dist/cli/did-you-mean.js +44 -7
  34. package/dist/cli/did-you-mean.js.map +1 -1
  35. package/dist/cli/dry-run.d.ts +55 -0
  36. package/dist/cli/dry-run.js +92 -0
  37. package/dist/cli/dry-run.js.map +1 -0
  38. package/dist/cli/glyphs.d.ts +16 -2
  39. package/dist/cli/glyphs.js +60 -12
  40. package/dist/cli/glyphs.js.map +1 -1
  41. package/dist/cli/help.js +69 -13
  42. package/dist/cli/help.js.map +1 -1
  43. package/dist/cli/main.js +8 -1
  44. package/dist/cli/main.js.map +1 -1
  45. package/dist/cli/move-hint.d.ts +3 -2
  46. package/dist/cli/move-hint.js +2 -2
  47. package/dist/cli/move-hint.js.map +1 -1
  48. package/dist/cli/read-driver.d.ts +53 -5
  49. package/dist/cli/read-driver.js +82 -15
  50. package/dist/cli/read-driver.js.map +1 -1
  51. package/dist/cli/ref-render.d.ts +14 -0
  52. package/dist/cli/ref-render.js +9 -0
  53. package/dist/cli/ref-render.js.map +1 -0
  54. package/dist/cli/render.d.ts +40 -14
  55. package/dist/cli/render.js +128 -55
  56. package/dist/cli/render.js.map +1 -1
  57. package/dist/cli/resolve-invocation.d.ts +7 -5
  58. package/dist/cli/resolve-invocation.js +16 -7
  59. package/dist/cli/resolve-invocation.js.map +1 -1
  60. package/dist/cli/skill-check.d.ts +12 -6
  61. package/dist/cli/skill-check.js +31 -14
  62. package/dist/cli/skill-check.js.map +1 -1
  63. package/dist/cli/skill.d.ts +8 -0
  64. package/dist/cli/skill.js +10 -0
  65. package/dist/cli/skill.js.map +1 -1
  66. package/dist/cli/verb-hint.js +1 -1
  67. package/dist/cli/verb-hint.js.map +1 -1
  68. package/dist/client.d.ts +158 -26
  69. package/dist/client.js +254 -38
  70. package/dist/client.js.map +1 -1
  71. package/dist/config.d.ts +66 -2
  72. package/dist/config.js +120 -12
  73. package/dist/config.js.map +1 -1
  74. package/dist/contracts.d.ts +187 -28
  75. package/dist/contracts.js +22 -1
  76. package/dist/contracts.js.map +1 -1
  77. package/dist/db/baselines/db-v26.js +4 -1
  78. package/dist/db/baselines/db-v26.js.map +1 -1
  79. package/dist/diagnose.d.ts +34 -2
  80. package/dist/diagnose.js +36 -1
  81. package/dist/diagnose.js.map +1 -1
  82. package/dist/index.d.ts +21 -8
  83. package/dist/index.js +26 -3
  84. package/dist/index.js.map +1 -1
  85. package/dist/mcp/server.d.ts +9 -0
  86. package/dist/mcp/server.js +790 -322
  87. package/dist/mcp/server.js.map +1 -1
  88. package/dist/model/entities.d.ts +57 -4
  89. package/dist/model/entities.js.map +1 -1
  90. package/dist/model/mappers.d.ts +2 -0
  91. package/dist/model/mappers.js +44 -2
  92. package/dist/model/mappers.js.map +1 -1
  93. package/dist/model/recurrence.d.ts +8 -1
  94. package/dist/model/recurrence.js.map +1 -1
  95. package/dist/model/serialize.js +15 -3
  96. package/dist/model/serialize.js.map +1 -1
  97. package/dist/read/area-filter.d.ts +76 -0
  98. package/dist/read/area-filter.js +58 -0
  99. package/dist/read/area-filter.js.map +1 -0
  100. package/dist/read/area-view.d.ts +22 -11
  101. package/dist/read/area-view.js +54 -28
  102. package/dist/read/area-view.js.map +1 -1
  103. package/dist/read/detail.js +15 -8
  104. package/dist/read/detail.js.map +1 -1
  105. package/dist/read/predicates.d.ts +18 -0
  106. package/dist/read/predicates.js +19 -0
  107. package/dist/read/predicates.js.map +1 -1
  108. package/dist/read/project-view.d.ts +91 -15
  109. package/dist/read/project-view.js +135 -37
  110. package/dist/read/project-view.js.map +1 -1
  111. package/dist/read/pseudo-area.d.ts +29 -0
  112. package/dist/read/pseudo-area.js +27 -0
  113. package/dist/read/pseudo-area.js.map +1 -0
  114. package/dist/read/queries.d.ts +175 -19
  115. package/dist/read/queries.js +376 -32
  116. package/dist/read/queries.js.map +1 -1
  117. package/dist/read/scope.d.ts +126 -0
  118. package/dist/read/scope.js +161 -0
  119. package/dist/read/scope.js.map +1 -0
  120. package/dist/read/search-rank.d.ts +2 -5
  121. package/dist/read/shape.d.ts +181 -0
  122. package/dist/read/shape.js +737 -0
  123. package/dist/read/shape.js.map +1 -0
  124. package/dist/read/show-target.d.ts +9 -1
  125. package/dist/read/show-target.js +77 -17
  126. package/dist/read/show-target.js.map +1 -1
  127. package/dist/read/stage.d.ts +199 -0
  128. package/dist/read/stage.js +125 -0
  129. package/dist/read/stage.js.map +1 -0
  130. package/dist/read/truncation.d.ts +7 -12
  131. package/dist/read/truncation.js +56 -21
  132. package/dist/read/truncation.js.map +1 -1
  133. package/dist/read/views.d.ts +68 -16
  134. package/dist/read/views.js +206 -52
  135. package/dist/read/views.js.map +1 -1
  136. package/dist/surface-copy.d.ts +16 -0
  137. package/dist/surface-copy.js +16 -0
  138. package/dist/surface-copy.js.map +1 -1
  139. package/dist/write/batch.d.ts +49 -10
  140. package/dist/write/batch.js +423 -71
  141. package/dist/write/batch.js.map +1 -1
  142. package/dist/write/commands.js +268 -55
  143. package/dist/write/commands.js.map +1 -1
  144. package/dist/write/guards.d.ts +1 -1
  145. package/dist/write/guards.js +71 -10
  146. package/dist/write/guards.js.map +1 -1
  147. package/dist/write/heading.d.ts +10 -1
  148. package/dist/write/heading.js +35 -5
  149. package/dist/write/heading.js.map +1 -1
  150. package/dist/write/make-repeating-project.d.ts +2 -2
  151. package/dist/write/make-repeating-project.js +9 -9
  152. package/dist/write/make-repeating-project.js.map +1 -1
  153. package/dist/write/move.d.ts +134 -0
  154. package/dist/write/move.js +1874 -0
  155. package/dist/write/move.js.map +1 -0
  156. package/dist/write/operations.d.ts +105 -19
  157. package/dist/write/operations.js +56 -7
  158. package/dist/write/operations.js.map +1 -1
  159. package/dist/write/opid.d.ts +31 -0
  160. package/dist/write/opid.js +30 -0
  161. package/dist/write/opid.js.map +1 -0
  162. package/dist/write/pipeline.d.ts +70 -3
  163. package/dist/write/pipeline.js +198 -33
  164. package/dist/write/pipeline.js.map +1 -1
  165. package/dist/write/pre-state.d.ts +172 -8
  166. package/dist/write/pre-state.js +467 -25
  167. package/dist/write/pre-state.js.map +1 -1
  168. package/dist/write/reorder.d.ts +23 -3
  169. package/dist/write/reorder.js +2106 -86
  170. package/dist/write/reorder.js.map +1 -1
  171. package/dist/write/reversibility.js +19 -7
  172. package/dist/write/reversibility.js.map +1 -1
  173. package/dist/write/scope-guard.d.ts +31 -0
  174. package/dist/write/scope-guard.js +162 -0
  175. package/dist/write/scope-guard.js.map +1 -0
  176. package/dist/write/undo.js +120 -13
  177. package/dist/write/undo.js.map +1 -1
  178. package/dist/write/vectors/applescript.js +16 -7
  179. package/dist/write/vectors/applescript.js.map +1 -1
  180. package/dist/write/vectors/shortcuts.js +1 -1
  181. package/dist/write/vectors/shortcuts.js.map +1 -1
  182. package/dist/write/vectors/simulator.js +83 -27
  183. package/dist/write/vectors/simulator.js.map +1 -1
  184. package/dist/write/vectors/types.d.ts +11 -0
  185. package/dist/write/vectors/ui-certification.d.ts +3 -3
  186. package/dist/write/vectors/ui-certification.js +41 -5
  187. package/dist/write/vectors/ui-certification.js.map +1 -1
  188. package/dist/write/vectors/ui-drag.d.ts +21 -1
  189. package/dist/write/vectors/ui-drag.js +138 -27
  190. package/dist/write/vectors/ui-drag.js.map +1 -1
  191. package/dist/write/vectors/ui-recipes.d.ts +21 -1
  192. package/dist/write/vectors/ui-recipes.js +166 -7
  193. package/dist/write/vectors/ui-recipes.js.map +1 -1
  194. package/dist/write/vectors/ui.d.ts +25 -1
  195. package/dist/write/vectors/ui.js +142 -33
  196. package/dist/write/vectors/ui.js.map +1 -1
  197. package/dist/write/verify/delta.d.ts +17 -1
  198. package/dist/write/verify/delta.js +106 -29
  199. package/dist/write/verify/delta.js.map +1 -1
  200. package/package.json +7 -1
  201. package/schema/envelope.schema.json +397 -0
  202. package/skills/things-cli/SKILL.md +36 -17
  203. package/skills/things-cli/references/banner.md +35 -0
  204. package/skills/things-cli/references/contracts.md +32 -9
  205. package/skills/things-cli/references/errors.md +57 -0
  206. package/skills/things-cli/references/gui.md +1 -1
  207. package/skills/things-cli/references/model.md +18 -7
  208. package/skills/things-cli/references/ordering.md +88 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A typed TypeScript library + CLI (`things`) for programmatic interaction with [Things 3](https://culturedcode.com/things/) by Cultured Code.
4
4
 
5
- **Status: read + write + MCP layers live and published to npm (v0.11.0 — see [CHANGELOG.md](CHANGELOG.md)).** Reads go straight to the local SQLite database (UI-exact Today ordering, sidebar-grouped Anytime/Someday with container-status cascade, decoded repeat rules, occurrence projections); writes run a verified pipeline over four write vectors — two lab-validated headless surfaces (the URL scheme + AppleScript) and two opt-in surfaces (Apple Shortcuts and an Accessibility-driven GUI vector) — with hazard guards, disruption-tier policy, a JSONL audit trail, batch mode, audit-replay undo (transactional across compound operations), full project lifecycle (complete/cancel/reopen/restore), heading rename/archive/unarchive with children policies, container detach, granular stateful checklists, tag hierarchy management incl. un-nesting, completion/creation backdating, Logbook imports, tiered fuzzy name resolution (uuid prefixes, `things:///show?id=` share links), and ordering across eight scopes (incl. a project's headings and the top-level sidebar projects). The Apple Shortcuts surface is wired for the two headless capabilities nothing else can do: creating a heading in an existing project (`things heading add`) and clearing a reminder from a date-scheduled item (`things todo clear-reminder`). Both run through bundled proxy shortcuts (`things setup shortcuts`) and are gated on their presence. The fourth vector — the Accessibility-driven GUI vector — is off by default and drives the local Things app to reach transforms that exist on no scriptable surface (repeat-rule editing on existing to-dos and projects, convert-to-project, sidebar area reorder); see [Accessibility GUI vector](#accessibility-gui-vector-optional-off-by-default) below. Single-item permanent delete stays interactive-only (its macOS consent has no always-allow) and is out of the headless pipeline. See [docs/design/](docs/design/) for the architecture and VM-lab design, [docs/lab/](docs/lab/harness.md) for the probe harness and campaign results the write layer is grounded in, and [docs/atlas/](docs/atlas/schema-v26.md) for the database↔UI map.
5
+ **Status: read + write + MCP layers live and published to npm (v0.13.0 — see [CHANGELOG.md](CHANGELOG.md)).** Reads go straight to the local SQLite database (UI-exact Today ordering, sidebar-grouped Anytime/Someday with container-status cascade, decoded repeat rules, occurrence projections); writes run a verified pipeline over four write vectors — two lab-validated headless surfaces (the URL scheme + AppleScript) and two opt-in surfaces (Apple Shortcuts and an Accessibility-driven GUI vector) — with hazard guards, disruption-tier policy, a JSONL audit trail, batch mode, audit-replay undo (transactional across compound operations), full project lifecycle (complete/cancel/reopen/restore), heading rename/archive/unarchive with children policies, container detach, granular stateful checklists, tag hierarchy management incl. un-nesting, completion/creation backdating, Logbook imports, tiered fuzzy name resolution (uuid prefixes, `things:///show?id=` share links), and ordering across eight scopes (incl. a project's headings and the top-level sidebar projects). The Apple Shortcuts surface is wired for the two headless capabilities nothing else can do: creating a heading in an existing project (`things heading add`) and clearing a reminder from a date-scheduled item (`things todo clear-reminder`). Both run through bundled proxy shortcuts (`things setup shortcuts`) and are gated on their presence. The fourth vector — the Accessibility-driven GUI vector — is off by default and drives the local Things app to reach transforms that exist on no scriptable surface (repeat-rule editing on existing to-dos and projects, convert-to-project, sidebar area reorder); see [Accessibility GUI vector](#accessibility-gui-vector-optional-off-by-default) below. Single-item permanent delete stays interactive-only (its macOS consent has no always-allow) and is out of the headless pipeline. See [docs/design/](docs/design/) for the architecture and VM-lab design, [docs/lab/](docs/lab/harness.md) for the probe harness and campaign results the write layer is grounded in, and [docs/atlas/](docs/atlas/schema-v26.md) for the database↔UI map.
6
6
 
7
7
  ```sh
8
8
  things today --json # read: your Today list, Evening split, UI order
@@ -13,6 +13,15 @@ things undo --dry-run # inverse plan for the last mutation (audit r
13
13
  things capabilities --op todo.delete # what's possible, per vector, with evidence
14
14
  ```
15
15
 
16
+ ## Why this wrapper is different
17
+
18
+ Most ways to script Things fire a URL or an AppleScript command and hope. This package is built on four commitments instead, and each is a checkable property of the response, not a claim in the docs:
19
+
20
+ - **Verified writes — `ok` means observed, not submitted.** Every mutation runs a read-after-write pipeline: it re-reads the database and confirms the expected change is actually present before returning `ok: true`. The app accepting a command and silently doing nothing (a real Things behavior) is reported as a failure (`verify-failed:silent-noop`), never as success. A caller can act on `ok: true` without a confirming read of its own.
21
+ - **Safety rails.** Writes go exclusively through official app surfaces — URL scheme, AppleScript, Shortcuts, and the opt-in Accessibility GUI vector — never direct SQLite writes (which corrupt Things Cloud sync). Every operation carries a disruption tier (0 invisible → 3 drives the live UI) and passes hazard guards before dispatch; disruptive and destructive actions require explicit acknowledgement flags, never an interactive prompt. A process can be jailed to one container with `--scope` (an area or project), and an out-of-scope item is byte-indistinguishable from a nonexistent one.
22
+ - **A written contract, not a vibe.** Every `--json` response is one instance of a small, stable envelope grammar (`apiVersion`, `ok`, `kind`, `data`, `meta`), with a frozen exit-code family, a one-word-one-meaning glossary, and a machine-readable error-code registry. The full contract — including the compatibility covenant that activates at v1.0 — is in **[docs/contract.md](docs/contract.md)**; the design rationale is in [docs/design/api-doctrine.md](docs/design/api-doctrine.md).
23
+ - **Agent-native by design.** Errors are self-correcting: an ambiguous name comes back with uuid-bearing candidates, a bare verb with the exact command to run instead, so an agent fixes its own mistake without another round-trip. Reads never cap silently — `meta.truncation.truncated` is the universal "did I see everything" check. And the wire is kept dense on purpose (empty fields pruned, no redundant discriminators), because when the consumer pays per token, information density is a correctness concern. Consumer-facing copy follows a strict behavior-not-mechanism contract ([docs/design/surface-copy.md](docs/design/surface-copy.md)).
24
+
16
25
  ## Requirements & first-run setup
17
26
 
18
27
  Things 3 installed and launched once, Node ≥ 24, and a handful of one-time macOS consents / Things settings depending on what you use (file-access consent for reads; "Enable Things URLs" + Automation consents for writes; an Accessibility grant for the optional GUI vector). **See [docs/setup.md](docs/setup.md)** — including the dedicated-automation-Mac checklist. `things doctor` validates your setup and prints remediation for anything missing.
@@ -48,6 +57,8 @@ asdf reshim nodejs # once, if you use asdf: expose the new `things` shim
48
57
 
49
58
  Edits under `src/` take effect immediately. The bin launcher ([bin/things.js](bin/things.js)) prefers `src/` when present and falls back to `dist/`, so published installs (`npm i -g things-api`, `npx things-api`) run the compiled output with identical behavior.
50
59
 
60
+ `npm run explore` starts a localhost-only debug view (default `127.0.0.1:5711`, `--port <n>` to change, `--no-open` to skip the browser): pick a preset or type any `things …` command and read the emitted envelope as a collapsible JSON tree, live against your default database. Reads run verbatim; every other command gets `--dry-run` force-appended server-side (the response echoes the exact argv that ran, forced flags included), so mutations can only ever produce plans. `THINGS_DB` / `THINGS_NOW` / `THINGS_TZ` set before launching apply to every command the view runs. Add `--public` to bind `0.0.0.0` for token-gated LAN access (phones/tablets on the same network): startup prints each LAN URL with a random per-launch `?key=` that plants a signed-in cookie on first open.
61
+
51
62
  ## Core principles
52
63
 
53
64
  - **Reads** go directly to Things' local SQLite database (read-only, WAL-aware). **Writes** go exclusively through official app surfaces — URL scheme, AppleScript, Shortcuts, and (opt-in) the Accessibility-driven GUI — never direct DB writes (sync corruption).
@@ -62,7 +73,7 @@ Edits under `src/` take effect immediately. The bin launcher ([bin/things.js](bi
62
73
  The CLI is designed to be driven by coding agents with no out-of-band knowledge. The contract:
63
74
 
64
75
  1. **Discovery**: `things --help` (a grouped one-line-per-command index; orientation detail lives behind `things help <topic>` — `agent`, `filters`, `ids`, `output`, `writes`), per-command `things <command> --help` (behavior, side effects, and the exact acknowledgement flag names a write needs — regression-tested as API; by design it does **not** carry vector/tier/hazard vocabulary, which is banned from help text by [docs/design/surface-copy.md](docs/design/surface-copy.md) — that classification lives in `capabilities`), and `things capabilities [--op <op>] --json` (the lab-validated operation × vector support matrix with disruption tiers, hazards, per-op certification status, and probe-evidence ids). Command invocation follows one grammar (`things <view>` · `things <type> <verb> <subject>` · loose `things <verb> <subject>` · bare `things <subject>`) with a single precedence chain — registered command/alias → view keyword → reference resolution — specified in [docs/design/cli-grammar.md](docs/design/cli-grammar.md).
65
- 2. **Structured output**: every command takes `--json` → versioned envelope `{ apiVersion, ok, kind, data|error, meta }` on stdout; human chatter goes to stderr only. List views are **bounded by default**: the flat/chronological views (`inbox`, `today`, `upcoming`, `logbook`, `trash`, `search`, `changes`) return at most 50 items — raise with `--limit <n>` or lift with `--all` — and carry exact truncation counts in `meta.truncation { shown, total, limit, truncated }` (the split `today` view also breaks the counts down per render section under `sections`). The grouped catalogues (`anytime`, `someday`) always show every area and project row and cap per block instead (no `--limit`): `--area-limit <n>` (default 30) per area block on both, `--project-limit <n>` (default 3) per project block on anytime, `--show-active-project-items [n]` for someday's trailing active-projects section — reporting `meta.grouped { truncated, blocks[] }`, where each block is identity-carrying (`kind`, `ref`, `title`, `shown`, `total`) and project blocks nest inside their area block under `children`. A read whose database schema no longer matches this build's validated fingerprint carries a non-blocking `meta.warnings` note (the read still returns best-effort; the same drift hard-blocks writes). Same defaults and metadata apply over MCP.
76
+ 2. **Structured output**: every command takes `--json` → versioned envelope `{ apiVersion, ok, kind, data|error, meta }` on stdout; human chatter goes to stderr only. List views are **bounded by default**: the flat/chronological views (`inbox`, `today`, `upcoming`, `logbook`, `trash`, `search`, `changes`) return at most 50 items — raise with `--limit <n>` or lift with `--all` — and carry exact truncation counts in `meta.truncation { shown, total, limit, truncated }` (the split `today` view also breaks the counts down per render section under `sections`). The grouped catalogues (`anytime`, `someday`) always show every area and project row and cap per block instead (no `--limit`): `--area-limit <n>` (default 30) per area block on both, `--project-limit <n>` (default 3) per project block on anytime, `--show-active-project-items [n]` for someday's trailing active-projects section — reporting the same `meta.truncation` shape with a per-block `blocks[]` breakdown (aggregate `shown`/`total`, `limit: null`), where each block is identity-carrying (`kind`, `ref`, `title`, `shown`, `total`) and project blocks nest inside their area block under `children`. A read whose database schema no longer matches this build's validated fingerprint carries a non-blocking `meta.warnings` note (the read still returns best-effort; the same drift hard-blocks writes). Same defaults and metadata apply over MCP.
66
77
  3. **Stable exit codes**: `0` ok · `2` usage · `3` verify-failed (mutation executed, expected delta never appeared) · `4` blocked (hazard guard or disruption policy; error carries `remediation`) · `5` drift-blocked · `6` unsupported (op has no supported vector — `things batch` also aggregates to 6 when its only failures are unsupported ops) · `7` environment.
67
78
  4. **Plan before executing**: every write supports `--dry-run` — compiled invocation (token-redacted), chosen vector, tier, hazards checked, expected delta. Nothing runs, nothing is audited.
68
79
  5. **No prompts, ever**: risky semantics are explicit flags — `--children require-resolved|auto-complete` (project completion cascades), `--acknowledge-checklist-reset` (checklist replacement destroys per-item state), `--acknowledge-project-reopen` (open child reopens a resolved project), `--dangerously-permanent` (area/tag delete and empty-trash skip the Trash), `--dangerously-drive-gui` (each Accessibility GUI-vector call).
@@ -93,7 +104,7 @@ Install (or update) it with one command:
93
104
  ```sh
94
105
  things install-skill # global: covers every agent harness the skills CLI detects
95
106
  things install-skill --project # into the current project's .agents instead
96
- things install-skill --check # compare installed vs bundled version, write nothing
107
+ things install-skill --check # compare installed vs this binary's version, write nothing
97
108
  ```
98
109
 
99
110
  Under the hood it hands the bundled skill to the [`skills` CLI](https://github.com/vercel-labs/skills) (`npx -y skills add …`), which keeps one canonical copy under `~/.agents/skills/` and materializes it into each detected agent's directory (`~/.claude/skills/`, `~/.codex/skills/`, …). When that tool or the network is unavailable it falls back to a plain copy into `~/.agents` and `~/.claude`. **Re-running `things install-skill` IS the update** — it replaces the skill wholesale — so prefer it over a generic `skills update` for this skill (a single, unambiguous update path).
@@ -104,7 +115,7 @@ Three entry angles, all converging on the same working setup:
104
115
  - **No install** → `npx things-api install-skill` places the skill; the skill itself falls back to `npx -y things-api@latest` for every command, so it works with no global binary on PATH.
105
116
  - **Skill first, zero npm knowledge** → `npx skills add mikegreiling/things-api` pulls the skill straight from GitHub (whatever `skills/things-cli/` currently holds).
106
117
 
107
- To keep the two sides from drifting, the `things` binary carries a version-stamped copy of the skill and (on human/`--help` output only, never `--json`) notes when the installed skill is well behind it. That notice reads the well-known skill directories under `~/.agents` and `~/.claude`; disable it with `THINGS_API_NO_SKILL_CHECK=1`.
118
+ To keep the two sides from drifting, `install-skill` stamps the copy it places with the running binary's own version, and (on human/`--help` output only, never `--json`) the binary notes when the installed skill is well behind that version. That notice reads the well-known skill directories under `~/.agents` and `~/.claude`; disable it with `THINGS_API_NO_SKILL_CHECK=1`.
108
119
 
109
120
  ## Architecture: one library, thin surfaces
110
121
 
@@ -130,6 +141,6 @@ The catalog is consolidated around a few verb-parameterized tools (a discriminat
130
141
  - **Create**: `add_area`, `add_tag`.
131
142
  - **Headings & reminders** (Shortcuts-backed where headless-impossible): `heading` (`action` create / rename / archive / unarchive / convert_to_project), `clear_reminder`.
132
143
  - **Recurrence via the Accessibility GUI ("ui") vector** (two-key gated — `ui-enabled` config + `dangerously_drive_gui` per call): `repeat` (`scope` todo / project; `action` start / reschedule / pause / resume / create). The `heading` convert_to_project action and the `reorder` areas scope ride the same gated GUI surface.
133
- - **Generic & discovery**: `run_operation` (the full 49-op catalog), `batch`, `reorder` (item ordering across scopes, plus `scope=areas` for the sidebar area order), `undo`, `capabilities`, `doctor`.
144
+ - **Generic & discovery**: `run_operation` (the full 52-op catalog), `batch`, `reorder` (item ordering across scopes, plus `scope=areas` for the sidebar area order), `undo`, `capabilities`, `doctor`.
134
145
 
135
146
  Every write tool takes `dry_run`; the GUI-driven variants additionally require `dangerously_drive_gui`; tools carry read-only/destructive annotations; hazard blocks come back as structured tool errors carrying the same remediation text the CLI prints. Tool descriptions follow the consumer-voice contract in [docs/design/surface-copy.md](docs/design/surface-copy.md).
@@ -26,6 +26,13 @@ export interface AuditRecord {
26
26
  * apart from a nonexistent one. Absent on ordinary (non-undo) mutations.
27
27
  */
28
28
  undoOf?: string;
29
+ /**
30
+ * Client idempotency id (ADDITIVE): a caller-supplied id for a batch line,
31
+ * recorded so a resubmitted batch can recognize an already-applied line (a
32
+ * later submission with the same `opId` on an `ok` record is skipped instead
33
+ * of re-created). Absent on records with no client idempotency id.
34
+ */
35
+ opId?: string;
29
36
  /** Normalized requested delta (params as given, post-normalization). */
30
37
  requested: Record<string, unknown>;
31
38
  /** Asserted-field subset of the pre-state (null when target didn't exist). */
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/audit/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAkDzC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CACvB,MAA0E;IAE1E,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;I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oed (`≡`) or suggested command renders for a resolved
3
+ * CONTAINER (area/project): its exact stored TITLE, bare, when that title
4
+ * round-trips through its own resolver — the SAME `promoter.roundTrips`
5
+ * predicate the JSON `*Uuid` promotion (src/read/shape.ts) and the inline
6
+ * container mentions (src/cli/render.ts) consult, so the three never disagree —
7
+ * else the fused decorated form `Title [8charPrefix]`, which re-resolves through
8
+ * the uuid-prefix tier of `area show` / `project show`. Shell-quoted (the shared
9
+ * ./shell-quote.ts rule) so a title with spaces or quotes stays copy-pasteable.
10
+ * Every command it builds re-resolves to the same entity by construction.
11
+ *
12
+ * To-dos are deliberately NOT handled here: a to-do is never resolvable by title
13
+ * (and its fused form has no read path — `todo show` / the loose router resolve
14
+ * only uuid/partial-uuid/share-link), so the loose router keeps echoing the
15
+ * uuid/partial-uuid it was given, already the shortest re-resolvable ref.
16
+ */
17
+ import { type RefPromoter } from "../index.ts";
18
+ export declare function canonicalRef(promoter: RefPromoter, kind: "area" | "project", entity: {
19
+ title: string;
20
+ uuid: string;
21
+ }): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The CANONICAL ref an echoed (`≡`) or suggested command renders for a resolved
3
+ * CONTAINER (area/project): its exact stored TITLE, bare, when that title
4
+ * round-trips through its own resolver — the SAME `promoter.roundTrips`
5
+ * predicate the JSON `*Uuid` promotion (src/read/shape.ts) and the inline
6
+ * container mentions (src/cli/render.ts) consult, so the three never disagree —
7
+ * else the fused decorated form `Title [8charPrefix]`, which re-resolves through
8
+ * the uuid-prefix tier of `area show` / `project show`. Shell-quoted (the shared
9
+ * ./shell-quote.ts rule) so a title with spaces or quotes stays copy-pasteable.
10
+ * Every command it builds re-resolves to the same entity by construction.
11
+ *
12
+ * To-dos are deliberately NOT handled here: a to-do is never resolvable by title
13
+ * (and its fused form has no read path — `todo show` / the loose router resolve
14
+ * only uuid/partial-uuid/share-link), so the loose router keeps echoing the
15
+ * uuid/partial-uuid it was given, already the shortest re-resolvable ref.
16
+ */
17
+ import { fusedRef } from "../index.js";
18
+ import { shellQuote } from "./shell-quote.js";
19
+ export function canonicalRef(promoter, kind, entity) {
20
+ const bare = promoter.roundTrips(kind, entity.title, entity.uuid);
21
+ return shellQuote(bare ? entity.title : fusedRef(entity.title, entity.uuid));
22
+ }
23
+ //# sourceMappingURL=canonical-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-ref.js","sourceRoot":"","sources":["../../src/cli/canonical-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAoB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,UAAU,YAAY,CAC1B,QAAqB,EACrB,IAAwB,EACxB,MAAuC;IAEvC,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC"}
@@ -3,35 +3,41 @@
3
3
  * under `things area` are registered by writes.ts on the same group).
4
4
  */
5
5
  import type { Command } from "commander";
6
- import { type AreaView, type GroupedLimits, type GroupedTruncation } from "../../index.ts";
6
+ import { type AreaView, type GroupedLimits, type Truncation } from "../../index.ts";
7
7
  import { type TagFlags } from "../tag-filters.ts";
8
8
  export interface AreaShowOpts {
9
9
  showLater?: boolean;
10
- /** Commander optional-value flag: true when bare, the raw string when given a count. */
11
- showLogged?: boolean | string;
12
10
  /**
13
11
  * Per-section caps: `project` bounds the project-ROWS section, `area` the
14
- * direct-to-dos section (null = uncapped). The toggled later/logged
15
- * sections keep their own existing bounds.
12
+ * direct-to-dos section (null = uncapped). The toggled later
13
+ * section keeps its own existing bounds.
16
14
  */
17
15
  limits?: GroupedLimits;
18
16
  /** The user's invocation, echoed by the per-section truncation footers. */
19
17
  hintBase?: string;
18
+ /**
19
+ * The live count of the area's logged rows (subtree-inclusive, past the
20
+ * log-move boundary — the same population `things logbook --area <ref>`
21
+ * returns). Drives the TTY logbook footer's count; omitted / 0 hides the line.
22
+ * TTY-only — the JSON area-view shape never carries it.
23
+ */
24
+ loggedCount?: number | undefined;
20
25
  }
21
26
  /**
22
27
  * GUI layout: active projects first (sidebar order), then the area's direct
23
28
  * to-dos. `--show-later` reveals the GUI's toggled sections — Upcoming
24
29
  * (future-scheduled projects, to-dos, and repeating templates intermixed in
25
30
  * date order) and Someday (someday projects as a leading block, then
26
- * someday to-dos). `--show-logged` reveals the full logbook.
31
+ * someday to-dos). The area logbook is NOT a view section — it is the bounded
32
+ * query `things logbook --area <ref>`; trashed rows live in `things trash`.
27
33
  *
28
34
  * `view` is the already-bounded card (its ACTIVE project rows and direct to-dos
29
- * capped; scheduled/someday project rows and the later/logged/trashed sections
30
- * intact) and `grouped` the per-block metadata carrying each capped section's
31
- * pre-cap total — so the "… N more" footers derive from metadata, never a
32
- * pre-cap copy of the view.
35
+ * capped; scheduled/someday project rows and the later section intact) and
36
+ * `grouped` the per-block metadata carrying each capped section's pre-cap total
37
+ * — so the "… N more" footers derive from metadata, never a pre-cap copy of the
38
+ * view.
33
39
  */
34
- export declare function renderAreaView(view: AreaView, grouped: GroupedTruncation, opts: AreaShowOpts): string[];
40
+ export declare function renderAreaView(view: AreaView, truncation: Truncation, opts: AreaShowOpts): string[];
35
41
  /** Options accepted by the area-show code path (shared by `area show` and `areas <ref>`). */
36
42
  export type AreaShowActionOpts = AreaShowOpts & TagFlags & {
37
43
  json?: boolean;
@@ -40,6 +46,7 @@ export type AreaShowActionOpts = AreaShowOpts & TagFlags & {
40
46
  areaLimit?: string;
41
47
  projectLimit?: string;
42
48
  all?: boolean;
49
+ full?: boolean;
43
50
  /** Content scope: keep only rows (loose to-dos + child projects) with an overdue own deadline. */
44
51
  overdue?: boolean;
45
52
  };
@@ -3,36 +3,29 @@ import { areaMark, thingsLink } from "../glyphs.js";
3
3
  import { Option } from "commander";
4
4
  import { openInThings, revealLine } from "./reads.js";
5
5
  import { renderNow, renderZone } from "../clock.js";
6
- import { invocation, parseCap, runRead, shellQuote, usageError, withClient, } from "../read-driver.js";
6
+ import { invocation, parseCap, runRead, usageError, withClient } from "../read-driver.js";
7
7
  import { disclosureHint, formatItem, quoteTitle, uuidDisplayWidth } from "../render.js";
8
8
  import { DidYouMeanError } from "../did-you-mean.js";
9
+ import { canonicalRef } from "../canonical-ref.js";
10
+ import { getInvocation, setInvocationCanonical } from "../resolve-invocation.js";
9
11
  import { showToggleFlags } from "./project.js";
10
- import { AREA_PREVIEW_LIMIT, GROUPED_ALL_DESC, isActiveProjectRow, isScheduledProjectRow, isSomedayProjectRow, localToday, } from "../../index.js";
12
+ import { AREA_PREVIEW_LIMIT, FULL_DESC, GROUPED_ALL_DESC, isLooseRef, LOOSE_OPEN_REFUSAL, isActiveProjectRow, isScheduledProjectRow, isSomedayProjectRow, localToday, ReferenceResolutionError, } from "../../index.js";
11
13
  import { addTagFilterOptions, CONTAINER_TAG_HINT, tagFilterFields, tagFlagConflict, tagInvocationParts, } from "../tag-filters.js";
12
- /** Bare `--show-logged` shows this many recent entries (areas accumulate thousands). */
13
- const RECENT_LOGGED_DEFAULT = 15;
14
- function loggedCount(showLogged) {
15
- if (showLogged === undefined)
16
- return 0;
17
- if (showLogged === true)
18
- return RECENT_LOGGED_DEFAULT;
19
- const n = Number(showLogged);
20
- return Number.isInteger(n) && n > 0 ? n : RECENT_LOGGED_DEFAULT;
21
- }
22
14
  /**
23
15
  * GUI layout: active projects first (sidebar order), then the area's direct
24
16
  * to-dos. `--show-later` reveals the GUI's toggled sections — Upcoming
25
17
  * (future-scheduled projects, to-dos, and repeating templates intermixed in
26
18
  * date order) and Someday (someday projects as a leading block, then
27
- * someday to-dos). `--show-logged` reveals the full logbook.
19
+ * someday to-dos). The area logbook is NOT a view section — it is the bounded
20
+ * query `things logbook --area <ref>`; trashed rows live in `things trash`.
28
21
  *
29
22
  * `view` is the already-bounded card (its ACTIVE project rows and direct to-dos
30
- * capped; scheduled/someday project rows and the later/logged/trashed sections
31
- * intact) and `grouped` the per-block metadata carrying each capped section's
32
- * pre-cap total — so the "… N more" footers derive from metadata, never a
33
- * pre-cap copy of the view.
23
+ * capped; scheduled/someday project rows and the later section intact) and
24
+ * `grouped` the per-block metadata carrying each capped section's pre-cap total
25
+ * — so the "… N more" footers derive from metadata, never a pre-cap copy of the
26
+ * view.
34
27
  */
35
- export function renderAreaView(view, grouped, opts) {
28
+ export function renderAreaView(view, truncation, opts) {
36
29
  const todayIso = localToday(renderNow(), renderZone());
37
30
  // The card's ACTIVE project rows are already capped in `view`; scheduled and
38
31
  // someday rows always survive and route to the Upcoming/Someday sections.
@@ -44,32 +37,34 @@ export function renderAreaView(view, grouped, opts) {
44
37
  ...view.projects
45
38
  .filter((p) => isScheduledProjectRow(p, todayIso))
46
39
  .map((p) => ({ date: p.startDate ?? "", item: p })),
47
- ...view.later.scheduled.flatMap((d) => d.items.map((t) => ({ date: d.date, item: t }))),
48
- ...view.later.repeating.map((t) => ({ date: t.repeating.nextOccurrence ?? "9999", item: t })),
40
+ ...view.scheduled.flatMap((d) => d.items.map((t) => ({ date: d.date, item: t }))),
41
+ ...view.repeating.map((t) => ({ date: t.repeating.nextOccurrence ?? "9999", item: t })),
49
42
  ].toSorted((a, b) => a.date.localeCompare(b.date));
50
- const logged = view.logged.slice(0, loggedCount(opts.showLogged));
51
43
  const shown = [
52
44
  ...activeProjects,
53
45
  ...view.active,
54
46
  ...(opts.showLater === true
55
- ? [...upcoming.map((u) => u.item), ...somedayProjects, ...view.later.someday]
47
+ ? [...upcoming.map((u) => u.item), ...somedayProjects, ...view.someday]
56
48
  : []),
57
- ...logged,
58
49
  ];
59
50
  const w = uuidDisplayWidth(shown);
60
51
  // Per-section caps (this view's sections are containers, so there is no
61
52
  // strict total limit): the project-ROWS block and the direct-to-dos block
62
53
  // truncate independently, each with its own exact-count footer. The card
63
- // preamble and the toggled later/logged sections are never capped. The pre-cap
54
+ // preamble and the toggled later section are never capped. The pre-cap
64
55
  // totals come from the metadata; `limits` supplies the footer's doubling.
65
56
  const limits = opts.limits ?? { area: null, project: null };
66
- const projectsBlock = grouped.blocks.find((b) => b.kind === "projects");
67
- const activeBlock = grouped.blocks.find((b) => b.kind === "area");
57
+ const projectsBlock = truncation.blocks?.find((b) => b.kind === "projects");
58
+ const activeBlock = truncation.blocks?.find((b) => b.kind === "area");
68
59
  const hiddenProjects = projectsBlock ? projectsBlock.total - projectsBlock.shown : 0;
69
60
  const hiddenActive = activeBlock ? activeBlock.total - activeBlock.shown : 0;
61
+ // The `loose` pseudo-area renders like an area card but has no uuid/uri/tags
62
+ // (the NULL area is a derived view).
63
+ const isLoose = view.area === null;
64
+ const areaTitle = view.area?.title ?? "Loose";
70
65
  // The user's invocation, echoed by every disclosure hint (falls back to a
71
66
  // canonical typed command when a caller omits it, e.g. a direct unit test).
72
- const base = opts.hintBase ?? `things area show ${quoteTitle(view.area.title)}`;
67
+ const base = opts.hintBase ?? `things area show ${isLoose ? "loose" : quoteTitle(areaTitle)}`;
73
68
  // A per-block TRUNCATION FOOTER (indented two spaces under its partially-
74
69
  // shown block): ` … N more <noun>s — `<base> <flag> <bigger>``.
75
70
  const sectionMore = (hidden, noun, flag, cap) => {
@@ -84,17 +79,17 @@ export function renderAreaView(view, grouped, opts) {
84
79
  // group in this view), so they get the bold project title from delta 1 but NO
85
80
  // underline; only ANYTIME treats projects as headings. So a project renders
86
81
  // exactly like any other row here — no projectTitle opt.
87
- const fmt = (i) => formatItem(i, w, { suppressArea: view.area.uuid });
82
+ const fmt = (i) => formatItem(i, w, { suppressArea: view.area?.uuid ?? null });
88
83
  const fmtProject = fmt;
89
84
  // Card header: glyph + name, the GUI's share link (carries the uuid — it
90
85
  // pastes back into any ref argument), then labeled meta lines. The opened
91
86
  // resource shows its tags green (GUI: list pills are gray).
92
- const lines = [
93
- `${bold("Area:")} ${areaMark()} ${bold(view.area.title)}`,
94
- ` ${dim("uri:")} ${thingsLink(view.area.uuid)}`,
95
- ];
96
- if (view.area.tags.length > 0)
97
- lines.push(` ${dim("tags:")} ${green(`#${view.area.tags.map((t) => t.title).join(" #")}`)}`);
87
+ const lines = [`${bold("Area:")} ${areaMark()} ${bold(areaTitle)}`];
88
+ if (view.area !== null) {
89
+ lines.push(` ${dim("uri:")} ${thingsLink(view.area.uuid)}`);
90
+ if (view.area.tags.length > 0)
91
+ lines.push(` ${dim("tags:")} ${green(`#${view.area.tags.map((t) => t.title).join(" #")}`)}`);
92
+ }
98
93
  const block = (rows) => {
99
94
  if (rows.length > 0)
100
95
  lines.push("", ...rows);
@@ -109,48 +104,31 @@ export function renderAreaView(view, grouped, opts) {
109
104
  if (upcoming.length > 0) {
110
105
  lines.push("", bold("── Upcoming ──"), ...upcoming.map((u) => fmt(u.item)));
111
106
  }
112
- if (somedayProjects.length > 0 || view.later.someday.length > 0) {
107
+ if (somedayProjects.length > 0 || view.someday.length > 0) {
113
108
  lines.push("", bold("── Someday ──"), ...somedayProjects.map(fmtProject));
114
- if (view.later.someday.length > 0) {
109
+ if (view.someday.length > 0) {
115
110
  if (somedayProjects.length > 0)
116
111
  lines.push("");
117
- lines.push(...view.later.someday.map(fmt));
112
+ lines.push(...view.someday.map(fmt));
118
113
  }
119
114
  }
120
115
  }
121
116
  // Default-hidden rows are never silent — a HIDDEN-SECTION placeholder (flush,
122
117
  // full command) stands where the Upcoming/Someday sections would render.
123
118
  if (opts.showLater !== true) {
124
- const hiddenLater = upcoming.length + somedayProjects.length + view.later.someday.length;
119
+ const hiddenLater = upcoming.length + somedayProjects.length + view.someday.length;
125
120
  if (hiddenLater > 0)
126
121
  lines.push("", disclosureHint(hiddenLater, "later item", [{ command: `${base} --show-later` }]));
127
122
  }
128
- // The full archive belongs to `things logbook --area <ref>` echoed
129
- // ready-to-paste with the real area name, like every other drill hint.
130
- const logbookCmd = `things logbook --area ${quoteTitle(view.area.title)}`;
131
- if (logged.length > 0) {
132
- // Truncation is loud: areas accumulate years of history. The header keeps
133
- // the shown-of-total count for orientation; the actionable drill rides a
134
- // section footer (matching the other truncated sections), never the header.
135
- const more = view.logged.length - logged.length;
136
- const header = more > 0
137
- ? `── Logged (${logged.length} of ${view.logged.length}) ──`
138
- : `── Logged (${view.logged.length}) ──`;
139
- lines.push("", bold(header), ...logged.map(fmt));
140
- if (more > 0)
141
- lines.push(dim(`… ${more} more — \`${logbookCmd}\``));
123
+ // The area logbook is not a card sectionit is the bounded query
124
+ // `things logbook --area <ref>` (a real area only; the loose pseudo-area
125
+ // accumulates no `logbook --area` archive). Trashed rows live in
126
+ // `things trash`. The footer carries a LIVE count of that archive; it is
127
+ // omitted entirely when the area has logged nothing (count 0 → no pointer).
128
+ const loggedCount = opts.loggedCount ?? 0;
129
+ if (!isLoose && loggedCount > 0) {
130
+ lines.push("", dim(`${loggedCount.toLocaleString("en-US")} logged item${loggedCount === 1 ? "" : "s"} — \`things logbook --area ${quoteTitle(areaTitle)}\``));
142
131
  }
143
- else if (view.logged.length > 0) {
144
- // Hidden-section placeholder: `--show-logged` reveals only the RECENT 15
145
- // (areas accumulate years), so it is labeled; the logbook drill reads its
146
- // own effect and needs none.
147
- lines.push("", disclosureHint(view.logged.length, "logged item", [
148
- { label: "recent", command: `${base} --show-logged` },
149
- { command: logbookCmd },
150
- ]));
151
- }
152
- if (view.trashed.length)
153
- lines.push("", bold(`── Trashed (${view.trashed.length}) ──`));
154
132
  return lines;
155
133
  }
156
134
  /**
@@ -174,12 +152,6 @@ export function runAreaShow(ref, opts) {
174
152
  const overdue = opts.overdue === true;
175
153
  const tagFilter = tagFilterFields(opts);
176
154
  const limits = { area: areaCap.limit, project: projectCap.limit };
177
- const hintBase = invocation("area show", [
178
- shellQuote(ref),
179
- ...showToggleFlags(opts),
180
- overdue && "--overdue",
181
- ...tagInvocationParts(opts),
182
- ]);
183
155
  runRead(opts, "area-view", (c) => {
184
156
  let bounded;
185
157
  try {
@@ -191,16 +163,42 @@ export function runAreaShow(ref, opts) {
191
163
  });
192
164
  }
193
165
  catch (err) {
194
- // Not-found gets a type-scoped did-you-mean; ambiguity is verbatim.
195
- if (err instanceof RangeError && !err.message.includes("ambiguous")) {
166
+ // An ambiguity is surfaced verbatim (its candidates ARE the list); a
167
+ // not-found gets a type-scoped did-you-mean.
168
+ if (err instanceof ReferenceResolutionError && err.code === "ambiguous")
169
+ throw err;
170
+ if (err instanceof RangeError) {
196
171
  throw new DidYouMeanError(err.message, ref, c.read.liteTitleSearch(ref, { type: "area" }));
197
172
  }
198
173
  throw err;
199
174
  }
175
+ // The disclosure footers (and, for the plural/namespace sugar, the `≡`
176
+ // echo) speak the area's CANONICAL ref — a bare round-tripping title, else
177
+ // the fused `Title [prefix]`; the `loose` pseudo-area (null area) keeps the
178
+ // reserved word. The typed `area show` carries no echo (classify canonical
179
+ // stays null); the `areas <ref>` / `area <ref>` sugars refine their
180
+ // classify-time canonical to this ref here.
181
+ const area = bounded.view.area;
182
+ const cref = area === null ? "loose" : canonicalRef(c.refPromoter(), "area", area);
183
+ const hintBase = invocation("area show", [
184
+ cref,
185
+ ...showToggleFlags(opts),
186
+ overdue && "--overdue",
187
+ ...tagInvocationParts(opts),
188
+ ]);
189
+ if (getInvocation()?.canonical !== null) {
190
+ setInvocationCanonical(invocation("area show", [cref]));
191
+ }
200
192
  return {
201
193
  data: bounded.view,
202
- grouped: bounded.grouped,
203
- lines: renderAreaView(bounded.view, bounded.grouped, { ...opts, limits, hintBase }),
194
+ truncation: bounded.truncation,
195
+ ...(bounded.notice !== undefined && { warnings: [bounded.notice] }),
196
+ lines: renderAreaView(bounded.view, bounded.truncation, {
197
+ ...opts,
198
+ limits,
199
+ hintBase,
200
+ loggedCount: bounded.loggedCount,
201
+ }),
204
202
  };
205
203
  }, () => []);
206
204
  }
@@ -210,14 +208,16 @@ export function registerAreaCommands(program) {
210
208
  .command("show <ref>")
211
209
  .description("Composite area view mirroring the native UI: active projects first, then the " +
212
210
  "area's direct to-dos. --show-later adds the Upcoming (date-ordered) and " +
213
- "Someday sections; --show-logged adds the full logbook. Tag filters match rows " +
214
- "directly and never descend into project contents. Target by uuid or unique name.")
211
+ "Someday sections. The area logbook is not a section here read it with " +
212
+ "`things logbook --area <ref>`. Tag filters match rows directly and never " +
213
+ "descend into project contents. Target by uuid or unique name, or the reserved " +
214
+ "word `loose` for the area-less items (the null-area composite).")
215
215
  .option("--show-later", "include Upcoming and Someday sections")
216
- .option("--show-logged [n]", "include the n most recently logged items (bare flag = 15; full history via `things logbook --area`)")
217
216
  .option("--project-limit <n>", `maximum project rows to show (default ${AREA_PREVIEW_LIMIT})`)
218
217
  .option("--area-limit <n>", `maximum direct to-dos to show (default ${AREA_PREVIEW_LIMIT})`)
219
218
  .option("--overdue", "only rows whose own deadline is past (due today is not overdue)")
220
219
  .option("--all", GROUPED_ALL_DESC)
220
+ .option("--full", FULL_DESC)
221
221
  .addOption(new Option("--limit <n>").hideHelp())
222
222
  .option("--json", "emit versioned JSON envelope on stdout")
223
223
  .option("--db <path>", "explicit database path");
@@ -231,10 +231,14 @@ export function registerAreaCommands(program) {
231
231
  .option("--db <path>", "explicit database path")
232
232
  .action((ref, opts) => {
233
233
  withClient(opts, "open", (c) => {
234
+ // The loose pseudo-area is a derived view — refuse by name, not a
235
+ // generic no-such-area error.
236
+ if (isLooseRef(ref))
237
+ throw new RangeError(LOOSE_OPEN_REFUSAL);
234
238
  const t = c.read.showTarget(ref);
235
239
  if (t.kind !== "area")
236
240
  throw new RangeError(`"${ref}" is a ${t.viaHeading === true ? "heading" : t.kind}, not an area (try \`things open\`)`);
237
- return openInThings(t.uuid, opts.db);
241
+ return openInThings(t.uuid, opts.db, opts.dryRun);
238
242
  }, (d) => [revealLine(d)]);
239
243
  });
240
244
  }
@@ -1 +1 @@
1
- {"version":3,"file":"area.js","sourceRoot":"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C,CAAC,GAAW,EAAE,IAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7E,IAAI;SACD,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CACV,kHAAkH,CACnH;SACA,MAAM,CAAC,QAAQ,EAAE,wCAAwC,CAAC;SAC1D,MAAM,CAAC,aAAa,EAAE,wBAAwB,CAAC;SAC/C,MAAM,CAAC,CAAC,GAAW,EAAE,IAAuD,EAAE,EAAE;QAC/E,UAAU,CACR,IAAI,EACJ,MAAM,EACN,CAAC,CAAC,EAAE,EAAE;YACJ,kEAAkE;YAClE,8BAA8B;YAC9B,IAAI,UAAU,CAAC,GAAG,CAAC;gBAAE,MAAM,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAAC;YAC9D,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;gBACnB,MAAM,IAAI,UAAU,CAClB,IAAI,GAAG,UAAU,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,qCAAqC,CACjG,CAAC;YACJ,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CACvB,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -3,7 +3,6 @@
3
3
  * Exit codes: 0 healthy; 5 drift/unknown-version; 7 environment problems.
4
4
  */
5
5
  import type { Command } from "commander";
6
- import { type DiagnoseReport, type DiagnoseResult } from "../../index.ts";
7
- export type DoctorReport = DiagnoseReport;
6
+ import { type DiagnoseResult } from "../../index.ts";
8
7
  export declare const runDoctor: (dbPath?: string) => DiagnoseResult;
9
8
  export declare function registerDoctor(program: Command): void;
@@ -1,4 +1,5 @@
1
1
  import { describeEnvironmentChanges, diagnose, errorEnvelope, okEnvelope, } from "../../index.js";
2
+ // Back-compat alias for pre-seam consumers of the CLI module.
2
3
  export const runDoctor = diagnose;
3
4
  function environmentLine(env) {
4
5
  if (env.lastVerifiedWrite === null) {
@@ -70,8 +71,17 @@ export function registerDoctor(program) {
70
71
  `db version: ${report.db.databaseVersion ?? "unknown"}`,
71
72
  `fingerprint: ${report.fingerprint.status} (${report.fingerprint.value.slice(0, 23)}…)`,
72
73
  ...report.fingerprint.detail.map((d) => ` drift: ${d}`),
73
- `app: ${report.app.installed ? "installed" : "NOT INSTALLED"}`,
74
+ `app: ${report.app.installed ? "installed" : "NOT INSTALLED"}${report.app.version !== null ? ` (Things ${report.app.version})` : ""}`,
75
+ ...(report.app.behavioralDrift
76
+ ? [
77
+ `behavioral: Things ${report.app.version} installed; behavioral laws last ` +
78
+ `certified against ${report.app.certifiedVersion} — run the drift suite to ` +
79
+ "re-certify (docs/lab/drift-runbook.md). Schema fingerprint is unaffected; " +
80
+ "writes stay enabled",
81
+ ]
82
+ : []),
74
83
  `writes: ${report.writes.enabled ? "enabled" : "DISABLED"} — ${report.writes.reason}`,
84
+ `scope: ${report.scope.detail}`,
75
85
  `experimental: ${report.experimental.reason}`,
76
86
  `environment: ${environmentLine(report.environment)}`,
77
87
  `automation: ${report.automation.status}${report.automation.status === "granted" ? "" : ` — ${report.automation.detail}`}`,
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,UAAU,GAIX,MAAM,gBAAgB,CAAC;AAIxB,MAAM,CAAC,MAAM,SAAS,GAAwC,QAAQ,CAAC;AAEvE,SAAS,eAAe,CAAC,GAAkC;IACzD,IAAI,GAAG,CAAC,iBAAiB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