things-api 0.10.0 → 0.11.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 (151) hide show
  1. package/README.md +38 -12
  2. package/dist/cli/clock.d.ts +8 -0
  3. package/dist/cli/clock.js +24 -0
  4. package/dist/cli/clock.js.map +1 -0
  5. package/dist/cli/commands/area.js +8 -9
  6. package/dist/cli/commands/area.js.map +1 -1
  7. package/dist/cli/commands/install-skill.d.ts +45 -0
  8. package/dist/cli/commands/install-skill.js +207 -0
  9. package/dist/cli/commands/install-skill.js.map +1 -0
  10. package/dist/cli/commands/project.js +7 -6
  11. package/dist/cli/commands/project.js.map +1 -1
  12. package/dist/cli/commands/reads.d.ts +15 -2
  13. package/dist/cli/commands/reads.js +45 -17
  14. package/dist/cli/commands/reads.js.map +1 -1
  15. package/dist/cli/commands/setup.js +7 -2
  16. package/dist/cli/commands/setup.js.map +1 -1
  17. package/dist/cli/commands/show.js +6 -6
  18. package/dist/cli/commands/show.js.map +1 -1
  19. package/dist/cli/commands/todo.js +14 -8
  20. package/dist/cli/commands/todo.js.map +1 -1
  21. package/dist/cli/commands/writes.js +29 -32
  22. package/dist/cli/commands/writes.js.map +1 -1
  23. package/dist/cli/glyphs.d.ts +16 -0
  24. package/dist/cli/glyphs.js +23 -0
  25. package/dist/cli/glyphs.js.map +1 -1
  26. package/dist/cli/help.js +56 -6
  27. package/dist/cli/help.js.map +1 -1
  28. package/dist/cli/main.js +33 -2
  29. package/dist/cli/main.js.map +1 -1
  30. package/dist/cli/move-hint.d.ts +45 -0
  31. package/dist/cli/move-hint.js +196 -0
  32. package/dist/cli/move-hint.js.map +1 -0
  33. package/dist/cli/period.d.ts +2 -8
  34. package/dist/cli/period.js +44 -30
  35. package/dist/cli/period.js.map +1 -1
  36. package/dist/cli/read-driver.js +11 -1
  37. package/dist/cli/read-driver.js.map +1 -1
  38. package/dist/cli/render.js +16 -7
  39. package/dist/cli/render.js.map +1 -1
  40. package/dist/cli/skill-check.d.ts +21 -0
  41. package/dist/cli/skill-check.js +82 -0
  42. package/dist/cli/skill-check.js.map +1 -0
  43. package/dist/cli/skill.d.ts +62 -0
  44. package/dist/cli/skill.js +142 -0
  45. package/dist/cli/skill.js.map +1 -0
  46. package/dist/cli/tag-filters.d.ts +6 -2
  47. package/dist/cli/tag-filters.js +8 -6
  48. package/dist/cli/tag-filters.js.map +1 -1
  49. package/dist/cli/verb-hint.js +27 -2
  50. package/dist/cli/verb-hint.js.map +1 -1
  51. package/dist/cli/version.d.ts +4 -0
  52. package/dist/cli/version.js +18 -0
  53. package/dist/cli/version.js.map +1 -0
  54. package/dist/client.d.ts +35 -12
  55. package/dist/client.js +42 -18
  56. package/dist/client.js.map +1 -1
  57. package/dist/contracts.d.ts +11 -1
  58. package/dist/contracts.js +1 -1
  59. package/dist/contracts.js.map +1 -1
  60. package/dist/index.d.ts +6 -1
  61. package/dist/index.js +3 -0
  62. package/dist/index.js.map +1 -1
  63. package/dist/mcp/server.js +550 -506
  64. package/dist/mcp/server.js.map +1 -1
  65. package/dist/model/clock.d.ts +61 -0
  66. package/dist/model/clock.js +71 -0
  67. package/dist/model/clock.js.map +1 -0
  68. package/dist/model/dates.d.ts +26 -3
  69. package/dist/model/dates.js +84 -3
  70. package/dist/model/dates.js.map +1 -1
  71. package/dist/model/entities.d.ts +17 -3
  72. package/dist/model/entities.js.map +1 -1
  73. package/dist/model/mappers.d.ts +2 -2
  74. package/dist/model/mappers.js +25 -7
  75. package/dist/model/mappers.js.map +1 -1
  76. package/dist/read/area-view.d.ts +1 -1
  77. package/dist/read/area-view.js +8 -6
  78. package/dist/read/area-view.js.map +1 -1
  79. package/dist/read/detail.d.ts +1 -1
  80. package/dist/read/detail.js +11 -4
  81. package/dist/read/detail.js.map +1 -1
  82. package/dist/read/log-boundary.d.ts +1 -1
  83. package/dist/read/log-boundary.js +13 -3
  84. package/dist/read/log-boundary.js.map +1 -1
  85. package/dist/read/project-view.d.ts +1 -1
  86. package/dist/read/project-view.js +8 -6
  87. package/dist/read/project-view.js.map +1 -1
  88. package/dist/read/queries.d.ts +3 -1
  89. package/dist/read/queries.js +27 -5
  90. package/dist/read/queries.js.map +1 -1
  91. package/dist/read/snapshot.d.ts +1 -1
  92. package/dist/read/snapshot.js +9 -2
  93. package/dist/read/snapshot.js.map +1 -1
  94. package/dist/read/truncation.d.ts +1 -1
  95. package/dist/read/truncation.js +2 -2
  96. package/dist/read/truncation.js.map +1 -1
  97. package/dist/read/views.d.ts +12 -11
  98. package/dist/read/views.js +48 -43
  99. package/dist/read/views.js.map +1 -1
  100. package/dist/write/accessibility-probe.d.ts +1 -1
  101. package/dist/write/accessibility-probe.js +8 -0
  102. package/dist/write/accessibility-probe.js.map +1 -1
  103. package/dist/write/automation-probe.d.ts +1 -1
  104. package/dist/write/automation-probe.js +8 -0
  105. package/dist/write/automation-probe.js.map +1 -1
  106. package/dist/write/batch.js +3 -2
  107. package/dist/write/batch.js.map +1 -1
  108. package/dist/write/commands.d.ts +1 -1
  109. package/dist/write/commands.js +54 -15
  110. package/dist/write/commands.js.map +1 -1
  111. package/dist/write/guards.d.ts +1 -1
  112. package/dist/write/guards.js +23 -0
  113. package/dist/write/guards.js.map +1 -1
  114. package/dist/write/pipeline.d.ts +54 -2
  115. package/dist/write/pipeline.js +112 -20
  116. package/dist/write/pipeline.js.map +1 -1
  117. package/dist/write/planner.js +8 -1
  118. package/dist/write/planner.js.map +1 -1
  119. package/dist/write/pre-state.d.ts +37 -0
  120. package/dist/write/pre-state.js +42 -0
  121. package/dist/write/pre-state.js.map +1 -1
  122. package/dist/write/recurrence-rule-blob.d.ts +65 -0
  123. package/dist/write/recurrence-rule-blob.js +150 -0
  124. package/dist/write/recurrence-rule-blob.js.map +1 -0
  125. package/dist/write/vectors/registry.d.ts +5 -7
  126. package/dist/write/vectors/registry.js +49 -2
  127. package/dist/write/vectors/registry.js.map +1 -1
  128. package/dist/write/vectors/simulator.d.ts +44 -0
  129. package/dist/write/vectors/simulator.js +1136 -0
  130. package/dist/write/vectors/simulator.js.map +1 -0
  131. package/dist/write/vectors/types.d.ts +35 -0
  132. package/dist/write/vectors/ui-certification.d.ts +9 -3
  133. package/dist/write/vectors/ui-certification.js +3 -6
  134. package/dist/write/vectors/ui-certification.js.map +1 -1
  135. package/dist/write/vectors/ui-recipes.d.ts +13 -0
  136. package/dist/write/vectors/ui-recipes.js +52 -0
  137. package/dist/write/vectors/ui-recipes.js.map +1 -1
  138. package/dist/write/vectors/ui.d.ts +15 -0
  139. package/dist/write/vectors/ui.js +54 -6
  140. package/dist/write/vectors/ui.js.map +1 -1
  141. package/dist/write/verify/delta.d.ts +110 -1
  142. package/dist/write/verify/delta.js +177 -15
  143. package/dist/write/verify/delta.js.map +1 -1
  144. package/dist/write/verify/poller.d.ts +7 -1
  145. package/dist/write/verify/poller.js +20 -1
  146. package/dist/write/verify/poller.js.map +1 -1
  147. package/package.json +18 -3
  148. package/skills/things-cli/SKILL.md +53 -0
  149. package/skills/things-cli/references/contracts.md +41 -0
  150. package/skills/things-cli/references/gui.md +11 -0
  151. package/skills/things-cli/references/model.md +51 -0
@@ -0,0 +1,41 @@
1
+ # Stable contracts: envelope, exit codes, safety, recurrence
2
+
3
+ The apiVersion-stable contracts that hold regardless of which binary version you invoke. Mechanics — verbs, flags, per-operation preconditions — live in `things <group> --help` and `things help <topic>` and version with the binary; the contracts here do not.
4
+
5
+ ## JSON envelope
6
+
7
+ Every `--json` response is an envelope `{ ok, data, meta }`:
8
+
9
+ - Results are in `.data` (usually `.data[]`), **never** `.items`. Item UUIDs are in `.uuid`, not `.id`.
10
+ - Check `meta.truncation` (and `meta.grouped`) before concluding "no match" or "that's everything": if `shown < total`, raise `--limit` or narrow the filter rather than assuming you saw everything.
11
+ - List/search rows are **summaries**: their `tags` field is not necessarily the complete effective set, and placement can be partial. Use `things show <ref> --json` when notes, checklist, placement, or inherited/effective tags matter.
12
+
13
+ ## Exit codes (writes are verified after they land)
14
+
15
+ - `0` — the change landed and was verified.
16
+ - `2` — usage error: fix your invocation and retry.
17
+ - `3` — verify-failed: the change did NOT stick; the message carries the reason and usually the remediation.
18
+ - other — unexpected; stop and report.
19
+
20
+ A nonzero exit is informative, not a dead end — it means the write did not silently half-apply, so you are never left guessing whether it took. Read the message; it usually names the fix.
21
+
22
+ ## Safety & recovery
23
+
24
+ - `--dry-run` previews the exact plan (operation, target, expected change) for ANY write without executing — use it for anything destructive, bulk, or unfamiliar.
25
+ - `things undo` reverses recent changes made through this tool (its own audit trail, not arbitrary app history). Prefer a targeted fix when you know it; undo is the safety net.
26
+ - Deletes are TRASHES: `todo delete` moves to Trash and is restorable (`todo restore`). Emptying the trash is permanent and requires explicit user intent — don't do it unless asked.
27
+ - Ambiguous refs FAIL with the candidates listed — retry with a UUID or a unique prefix. Never guess between candidates for a destructive action; inspect details or ask.
28
+ - Referenced containers and tags must already exist. Create nested structures **outside-in** (area → project → heading → to-do), and prefer each newly returned UUID as the next reference so duplicate titles cannot redirect placement.
29
+ - Some operations are disruptive (may move focus in the app) and require `--allow-disruptive`, **including their dry runs**. `things capabilities` lists each operation's support and any preconditions.
30
+ - If a request needs a capability the tool reports as unsupported, say so plainly rather than improvising through unrelated commands.
31
+
32
+ ## Recurrence (contract summary)
33
+
34
+ Full rule vocabulary and worked examples: **`things help repeating`**. The stable contract:
35
+
36
+ - Turning an item into a **fixed** repeater REPLACES it: the original becomes a hidden template plus a fresh first occurrence, so its UUID changes. The response returns a `repeating` block — `instanceUuid` (the visible current occurrence; use it to reach the item), `templateUuid` (the recurring rule; use it for `reschedule-repeat`), and `replacedUuid` (the original). Use these rather than re-finding the item by title.
37
+ - `--after-completion` schedules the next occurrence N units after you complete the current one, and KEEPS the item's UUID.
38
+ - Repeating operations require `--allow-disruptive` (including dry runs) and a required `--interval <n>` alongside `--frequency` (`--interval 1` for every unit).
39
+ - New repeater: add the item first (`things todo add "<title>" --json`), then `things todo make-repeating <returned-uuid> --frequency <f> --interval 1 [--weekdays …] --allow-disruptive`.
40
+ - Multiple weekdays go in ONE rule (`--weekdays monday,thursday,friday`) — never create two repeaters for "every Thursday and Friday".
41
+ - `things show <ref> --json` on an occurrence exposes `repeating.templateUuid` — use it as the `<ref>` for `reschedule-repeat`.
@@ -0,0 +1,11 @@
1
+ # How the user sees Things (the app GUI)
2
+
3
+ Curated rendering facts — the bench loop may compress or relocate these but must never add or change their meaning without Mike's approval (bench/CONSTITUTION.md).
4
+
5
+ <!-- STATUS: v0 seeded from Mike's description 2026-07-17; awaiting his review pass. -->
6
+
7
+ - **Sidebar**: top-level views (Inbox, Today, Upcoming, Anytime, Someday, Logbook, Trash), then each **area** with its active **projects** nested beneath it — in the same order this CLI/API reports them. Reordering areas or projects changes what the user sees there.
8
+ - **List rows are compact**: a to-do in any list shows its title, tags, and deadline only. Its **notes and checklist are invisible until the user opens the item**. Put must-see-at-a-glance information in the title; supporting detail belongs in notes.
9
+ - **Project notes** are likewise visible only when the project itself is opened in project view — in lists, a project is just its title (and progress ring).
10
+ - **Today** shows the day's scheduled items, with **This Evening** as a separate section beneath. **Upcoming** is a forward-looking date-ordered calendar of scheduled items. **Logbook** is where completed/canceled items go — after completing something for the user, that's where they'll find it.
11
+ - When telling the user where something landed, name the container and view ("in project P under area A"; "it'll show in Today this evening").
@@ -0,0 +1,51 @@
1
+ # The Things data model (deep reference)
2
+
3
+ Entities, relationships, and how the sidebar views are computed over them, as exposed by the `things` CLI. The SKILL.md "Data model" section is the summary; this is the full version.
4
+
5
+ ## Entities
6
+
7
+ | Entity | Container | Can contain | Dates | Tags |
8
+ | --- | --- | --- | --- | --- |
9
+ | To-do | area, project, heading, or NONE (standalone) | checklist items | when, deadline, reminder | own + inherited |
10
+ | Checklist item | its to-do | — | — | — |
11
+ | Heading | its project | to-dos | — | none (inheritance passes through) |
12
+ | Project | area or standalone | headings, to-dos | when, deadline | own + inherited from area |
13
+ | Area | top level | projects, loose to-dos | — | own |
14
+ | Tag | tag hierarchy (may nest) | child tags | — | — |
15
+
16
+ ## Rules
17
+
18
+ - A to-do has at most ONE container, and may have none — standalone to-dos (no project, no area) are normal and appear at the top level of Anytime/Someday/Upcoming. Moving changes the container; completing or trashing does not.
19
+ - The **Inbox is a state, not a container**: "in the Inbox" means untriaged — no container AND no schedule. Filing or scheduling an inbox to-do moves it out (filing promotes it to Anytime); moving a to-do TO the Inbox clears both its container and its schedule.
20
+ - A heading is a section label inside one project — not a task. It cannot be scheduled, tagged, or completed; deleting/archiving it affects only the label, per the operation's contract.
21
+ - Tag inheritance flows downward: area → project → (through heading) → to-do. A to-do's *effective* tags = own tags ∪ project tags ∪ area tags. List output distinguishes own vs inherited tags.
22
+ - **Status**: open → completed or canceled (both land in the Logbook) or trashed (Trash; restorable until emptied). Reopen brings a logged item back.
23
+ - **when** (`today | evening | anytime | someday | YYYY-MM-DD`) controls which view an item appears in; **deadline** is an independent due date shown alongside the item; **reminder** is a time-of-day alert attached to a dated when.
24
+ - "Overdue" = open with a deadline strictly before today (a deadline of today is "due", not overdue).
25
+
26
+ ## Views (queries over the model)
27
+
28
+ `things inbox|today|upcoming|anytime|someday|logbook|trash` mirror the app's sidebar. Each is a query over the rules above, not a stored list:
29
+
30
+ - **inbox** — untriaged to-dos (no container, no schedule).
31
+ - **today** — items scheduled for today, with the **This Evening** section beneath.
32
+ - **upcoming** — future-dated items, forward-ordered by date.
33
+ - **anytime** — all active items kept without a specific date (standalone or filed).
34
+ - **someday** — items deliberately kept without a date.
35
+ - **logbook** — completed/canceled items.
36
+ - **trash** — trashed items (restorable until the trash is emptied).
37
+
38
+ `things projects`/`areas`/`tags` list containers; `things projects <ref>` / `things areas <ref>` / `things show <ref>` show one item's full detail — notes, checklist, effective tags — which the compact list rows do NOT display.
39
+
40
+ ### Reading view membership from JSON
41
+
42
+ When reasoning about which view an item belongs to from `--json`, key on the fields together, not on a single hint:
43
+
44
+ - `start: "inbox"` → Inbox; `start: "someday"` → Someday; `start: "active"` with no `startDate` → Anytime.
45
+ - A dated open item belongs to **Today** when dated for `meta.clock.today`, otherwise **Upcoming** when future-dated.
46
+ - `todaySection` only describes placement WITHIN Today (e.g. `evening`); it is NOT evidence that an undated item is in Today.
47
+ - Completed/canceled items are in the Logbook and trashed items in Trash, regardless of a stale-looking `logged` field.
48
+
49
+ ## Filters over views
50
+
51
+ Read filters compose with AND: `--tag <name>` (repeatable) / `--untagged` / `--exact-tag` for tags (in single-container `project show` / `area show` these match the row's own tags; in flat views they include inherited tags), `--overdue` (open items whose deadline is before today), `--limit N`, and `--since`/`--until` where offered. `things search <words>` matches title/notes over open items — widen with `--all`, `--logged`, `--trashed`; narrow with `--type project`. `things changes --since <moment>` is the pull-based substitute for a watch mode. Exact flags per command: `things <group> --help` and `things help filters`.