things-api 0.13.0 → 0.14.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.
- package/README.md +2 -2
- package/dist/cli/commands/area.d.ts +5 -5
- package/dist/cli/commands/area.js +12 -7
- package/dist/cli/commands/area.js.map +1 -1
- package/dist/cli/commands/project.js +1 -1
- package/dist/cli/commands/project.js.map +1 -1
- package/dist/cli/commands/reads.js +21 -12
- package/dist/cli/commands/reads.js.map +1 -1
- package/dist/cli/commands/show.js +6 -2
- package/dist/cli/commands/show.js.map +1 -1
- package/dist/cli/commands/todo.js +1 -1
- package/dist/cli/commands/todo.js.map +1 -1
- package/dist/cli/commands/writes.js +116 -70
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/glyphs.d.ts +9 -2
- package/dist/cli/glyphs.js +11 -5
- package/dist/cli/glyphs.js.map +1 -1
- package/dist/cli/read-driver.d.ts +39 -9
- package/dist/cli/read-driver.js +37 -16
- package/dist/cli/read-driver.js.map +1 -1
- package/dist/cli/render.d.ts +25 -26
- package/dist/cli/render.js +57 -56
- package/dist/cli/render.js.map +1 -1
- package/dist/client.d.ts +92 -35
- package/dist/client.js +61 -18
- package/dist/client.js.map +1 -1
- package/dist/contracts.d.ts +23 -33
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +158 -144
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/dates.d.ts +26 -0
- package/dist/model/dates.js +46 -4
- package/dist/model/dates.js.map +1 -1
- package/dist/read/area-filter.d.ts +1 -1
- package/dist/read/area-filter.js +5 -4
- package/dist/read/area-filter.js.map +1 -1
- package/dist/read/area-view.d.ts +0 -11
- package/dist/read/area-view.js +1 -5
- package/dist/read/area-view.js.map +1 -1
- package/dist/read/project-view.d.ts +34 -19
- package/dist/read/project-view.js +26 -20
- package/dist/read/project-view.js.map +1 -1
- package/dist/read/scope.d.ts +1 -1
- package/dist/read/scope.js +5 -4
- package/dist/read/scope.js.map +1 -1
- package/dist/read/shape.d.ts +73 -14
- package/dist/read/shape.js +459 -151
- package/dist/read/shape.js.map +1 -1
- package/dist/read/truncation.d.ts +75 -2
- package/dist/read/truncation.js +69 -46
- package/dist/read/truncation.js.map +1 -1
- package/dist/read/views.d.ts +19 -18
- package/dist/read/views.js +5 -6
- package/dist/read/views.js.map +1 -1
- package/dist/surface-copy.d.ts +6 -0
- package/dist/surface-copy.js +6 -0
- package/dist/surface-copy.js.map +1 -1
- package/dist/write/batch.js +0 -1
- package/dist/write/batch.js.map +1 -1
- package/dist/write/commands.d.ts +25 -1
- package/dist/write/commands.js +256 -121
- package/dist/write/commands.js.map +1 -1
- package/dist/write/guards.js +27 -11
- package/dist/write/guards.js.map +1 -1
- package/dist/write/move.d.ts +26 -5
- package/dist/write/move.js +313 -2
- package/dist/write/move.js.map +1 -1
- package/dist/write/operations.d.ts +49 -19
- package/dist/write/operations.js +2 -2
- package/dist/write/operations.js.map +1 -1
- package/dist/write/pipeline.js +25 -4
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +48 -28
- package/dist/write/pre-state.js +134 -13
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/reorder.js +3 -3
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/resolution-timestamps.d.ts +34 -0
- package/dist/write/resolution-timestamps.js +286 -0
- package/dist/write/resolution-timestamps.js.map +1 -0
- package/dist/write/reversibility.js +5 -5
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/scope-guard.js +0 -5
- package/dist/write/scope-guard.js.map +1 -1
- package/dist/write/undo.d.ts +0 -6
- package/dist/write/undo.js +44 -4
- package/dist/write/undo.js.map +1 -1
- package/dist/write/vectors/applescript.js +14 -4
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/url-scheme.js +0 -8
- package/dist/write/vectors/url-scheme.js.map +1 -1
- package/dist/write/verify/delta.d.ts +16 -2
- package/dist/write/verify/delta.js +21 -2
- package/dist/write/verify/delta.js.map +1 -1
- package/package.json +1 -1
- package/schema/envelope.schema.json +2 -78
- package/skills/things-cli/SKILL.md +7 -5
- package/skills/things-cli/references/contracts.md +3 -4
- package/skills/things-cli/references/model.md +8 -8
- package/skills/things-cli/references/ordering.md +16 -7
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
},
|
|
97
97
|
"truncation": {
|
|
98
98
|
"$ref": "#/definitions/Truncation",
|
|
99
|
-
"description": "The read's completeness metadata (the single truncation shape). Present on any read that could drop rows — flat views (row `limit`), the
|
|
99
|
+
"description": "The read's completeness metadata (the single truncation shape) — the WHOLE-VIEW rollup. Present on any read that could drop rows — flat views (row `limit`), the `today` view, and grouped views (anytime/someday/`area show`). Per-bucket completeness rides INLINE on the data records' own `total` (R1), never on this envelope. `meta.truncation.truncated` is the universal \"did I see everything\" check."
|
|
100
100
|
},
|
|
101
101
|
"resolvedCommand": {
|
|
102
102
|
"type": "string",
|
|
@@ -198,87 +198,11 @@
|
|
|
198
198
|
},
|
|
199
199
|
"truncated": {
|
|
200
200
|
"type": "boolean"
|
|
201
|
-
},
|
|
202
|
-
"sections": {
|
|
203
|
-
"type": "array",
|
|
204
|
-
"items": {
|
|
205
|
-
"$ref": "#/definitions/SectionCount"
|
|
206
|
-
},
|
|
207
|
-
"description": "Per-section shown/total breakdown for a split flat view (Today); absent otherwise."
|
|
208
|
-
},
|
|
209
|
-
"blocks": {
|
|
210
|
-
"type": "array",
|
|
211
|
-
"items": {
|
|
212
|
-
"$ref": "#/definitions/GroupBlock"
|
|
213
|
-
},
|
|
214
|
-
"description": "Per-block nesting for a grouped view (anytime/someday/area card); absent otherwise."
|
|
215
201
|
}
|
|
216
202
|
},
|
|
217
203
|
"required": ["shown", "total", "limit", "truncated"],
|
|
218
204
|
"additionalProperties": false,
|
|
219
|
-
"description": "The single truncation-metadata shape for every read (the `meta.truncation` field). `shown` items were returned of `total` that matched after all filters; `limit` is the effective cap (null when the caller asked for all rows, and always null on a grouped view whose caps are per-block); `truncated` is the UNIVERSAL completeness check — true exactly when anything was dropped (`shown < total`, or any block hid rows). The dropped remainder is `total - shown`.\n\
|
|
220
|
-
},
|
|
221
|
-
"SectionCount": {
|
|
222
|
-
"type": "object",
|
|
223
|
-
"properties": {
|
|
224
|
-
"key": {
|
|
225
|
-
"type": "string",
|
|
226
|
-
"enum": ["today", "evening"]
|
|
227
|
-
},
|
|
228
|
-
"shown": {
|
|
229
|
-
"type": "number"
|
|
230
|
-
},
|
|
231
|
-
"total": {
|
|
232
|
-
"type": "number"
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
"required": ["key", "shown", "total"],
|
|
236
|
-
"additionalProperties": false,
|
|
237
|
-
"description": "Per-section counts for a SPLIT flat view — currently only `today`'s Today / This-Evening split. One entry per section IN RENDER ORDER, each reporting the rows `shown` of the `total` that matched after all filters. Lets a renderer keep a downstream section (This Evening) honest under a single global cap without a pre-truncation copy of the view."
|
|
238
|
-
},
|
|
239
|
-
"GroupBlock": {
|
|
240
|
-
"type": "object",
|
|
241
|
-
"properties": {
|
|
242
|
-
"kind": {
|
|
243
|
-
"type": "string",
|
|
244
|
-
"enum": ["loose", "area", "project", "projects"]
|
|
245
|
-
},
|
|
246
|
-
"ref": {
|
|
247
|
-
"type": ["string", "null"],
|
|
248
|
-
"description": "Container reference (area or project uuid); null for the loose block."
|
|
249
|
-
},
|
|
250
|
-
"title": {
|
|
251
|
-
"type": ["string", "null"],
|
|
252
|
-
"description": "Container title; null for the loose block."
|
|
253
|
-
},
|
|
254
|
-
"shown": {
|
|
255
|
-
"type": "number"
|
|
256
|
-
},
|
|
257
|
-
"total": {
|
|
258
|
-
"type": "number"
|
|
259
|
-
},
|
|
260
|
-
"limit": {
|
|
261
|
-
"type": ["number", "null"],
|
|
262
|
-
"description": "The cap that applied to THIS block (null = uncapped)."
|
|
263
|
-
},
|
|
264
|
-
"totalProjects": {
|
|
265
|
-
"type": "number",
|
|
266
|
-
"description": "Type split for blocks that mix project rows and to-dos (someday's loose/area blocks; projects always list first, so the hidden split is `totalProjects - min(shown, totalProjects)` projects, remainder to-dos). Absent on single-type blocks."
|
|
267
|
-
},
|
|
268
|
-
"totalTodos": {
|
|
269
|
-
"type": "number"
|
|
270
|
-
},
|
|
271
|
-
"children": {
|
|
272
|
-
"type": "array",
|
|
273
|
-
"items": {
|
|
274
|
-
"$ref": "#/definitions/GroupBlock"
|
|
275
|
-
},
|
|
276
|
-
"description": "Nested project blocks (anytime item-lists / someday active-project groups). Absent when none."
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
"required": ["kind", "ref", "title", "shown", "total", "limit"],
|
|
280
|
-
"additionalProperties": false,
|
|
281
|
-
"description": "One identity-carrying block of a grouped catalogue (anytime/someday) or a sectioned detail view (`area show`). Every header/section is always rendered; only the innermost item lists are capped. Emitted for every block that has rows to cap (`total > 0`) — including a block whose rows were ALL dropped (`shown: 0`), so no truncated header is untraceable. A block with no cappable rows of its own (`total: 0`) is omitted UNLESS it wraps truncated `children` — an area whose only capped content is its project item-lists still appears as their container.\n\nBlocks are NESTED: an area/loose block carries its project blocks in `children` — in anytime the project item-lists inside the area, in someday the active-project child groups found in that section. The `area show` `projects`/`area` blocks are siblings of one area and stay top-level."
|
|
205
|
+
"description": "The single truncation-metadata shape for every read (the `meta.truncation` field). `shown` items were returned of `total` that matched after all filters; `limit` is the effective cap (null when the caller asked for all rows, and always null on a grouped view whose caps are per-block); `truncated` is the UNIVERSAL completeness check — true exactly when anything was dropped (`shown < total`, or any block hid rows). The dropped remainder is `total - shown`.\n\nThis is the WHOLE-VIEW rollup only. Per-bucket completeness rides INLINE on the data records (read-shape v2 R1): each `children`/`sections`/`projects` bucket carries its own `total`, present iff it was capped. The pre-v2 `blocks[]` descriptor-join sidecar is RETIRED from the wire entirely (doctrine v2 PR 5) — the per-block detail the TTY renderers need is internal render plumbing ( {@link GroupBlock } ), never serialized."
|
|
282
206
|
},
|
|
283
207
|
"ErrorEnvelope": {
|
|
284
208
|
"type": "object",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: things-cli
|
|
3
3
|
description: Read and manage a user's tasks in the Things 3 app (macOS) through the `things` CLI — list views like Today/Inbox/Upcoming, search, and create, edit, schedule, complete, move, or organize to-dos, projects, areas, headings, and tags. Use whenever the user asks about their tasks, to-dos, projects, or anything in Things.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Things CLI
|
|
8
8
|
|
|
9
|
-
`things` is a command-line interface to the user's Things 3 task database. Reads are instant SQL queries; writes go through the app itself and are checked after they land. Use `things` when it is on your PATH; otherwise — or when `things --version` reports below
|
|
9
|
+
`things` is a command-line interface to the user's Things 3 task database. Reads are instant SQL queries; writes go through the app itself and are checked after they land. Use `things` when it is on your PATH; otherwise — or when `things --version` reports below the version stamped in this skill's `version:` frontmatter above (set at publish time; the commands and read-view JSON shapes documented here — including the bucketed `today` / project / area shapes — track the release this skill ships with) — substitute `npx -y things-api@latest` in every command (identical subcommands and flags), which always pairs the current commands with their current help.
|
|
10
10
|
|
|
11
11
|
`things --help` is the one-screen index; `things <group> --help` lists a group's verbs and flags (always current for the binary you invoke); `things help <topic>` opens a contract guide — topics: `agent`, `filters`, `ids`, `move`, `output`, `repeating`, `writes`.
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ version: 0.13.0
|
|
|
24
24
|
|
|
25
25
|
Reads decompose an item's position onto two derived, presence-keyed words (they REPLACED the old `start`/`logged`/`trashed`/`todaySection` fields):
|
|
26
26
|
|
|
27
|
-
- **`stage`** — the sidebar BUCKET: `inbox | upcoming | anytime | someday | logbook | trash`. Read view membership off it directly (a completed row is `logbook`, a trashed row `trash`, regardless of any other hint). Dropped
|
|
27
|
+
- **`stage`** — the sidebar BUCKET: `inbox | upcoming | anytime | someday | logbook | trash`. Read view membership off it directly (a completed row is `logbook`, a trashed row `trash`, regardless of any other hint). Dropped inside a section that already states it; present in mixed lists, `search`, `changes`, and `detail`.
|
|
28
28
|
- **`when`** — the TIME POSITION: `today | evening | a future ISO date`, or absent. `evening` implies today; someday is a bucket (→ `stage`), never a `when`. A due deadline pulls an undated row into Today (`when: "today"`); the app re-files it into Anytime, so it derives `stage: "anytime"` (it leaves the Inbox/Someday list).
|
|
29
29
|
- **`provisional: true`** marks a Today member the app has not yet materialized (the "N new to-dos" banner / `•` pip); see [references/banner.md](references/banner.md).
|
|
30
30
|
|
|
@@ -40,7 +40,7 @@ Commands take a `<ref>`: a UUID, a unique UUID prefix (≥ 6 chars), a Things sh
|
|
|
40
40
|
|
|
41
41
|
These hold regardless of the binary version; see [references/contracts.md](references/contracts.md) for the full text.
|
|
42
42
|
|
|
43
|
-
- **JSON envelope**: every `--json` response is `{ apiVersion, ok, kind, data, meta }`. Read results from `.data` (`.data.items`/`.data.sections`/`.data.item`/`.data.view` per `kind`), never `.items`; UUIDs are `.uuid`, not `.id`. Check `meta.truncation.truncated` before concluding "no match" or "that's everything". List/search rows are compact summaries whose `tags` may be incomplete — use `things show <ref> --json` for effective tags, checklist, notes, and placement.
|
|
43
|
+
- **JSON envelope**: every `--json` response is `{ apiVersion, ok, kind, data, meta }`. Read results from `.data` (`.data.items`/`.data.sections`/`.data.item`/`.data.view`/`.data.children` per `kind`; `today` is `.data.children.{today,evening}.items` with its count on `meta.counts`), never `.items`; UUIDs are `.uuid`, not `.id`. Check `meta.truncation.truncated` before concluding "no match" or "that's everything". List/search rows are compact summaries whose `tags` may be incomplete — use `things show <ref> --json` for effective tags, checklist, notes, and placement.
|
|
44
44
|
- **Exit codes**: `0` landed and checked · `2` usage · `3` verify-failed · `4` blocked · `5` drift-blocked · `6` unsupported · `7` environment (`1` is an internal bug). Nonzero means the change did NOT stick; the message names the fix.
|
|
45
45
|
- **Previews, undo & idempotency**: `--dry-run` is universal — accepted by every command, it guarantees nothing changes: on a read it returns the normal output unchanged, on a write it shows the exact plan without executing; `things undo` reverses recent changes made through this tool (each reversible write returns an `undoToken`); a single mutation may carry `--op-id <key>` so an ambiguous resubmission is recognized as already applied (the variadic `move`/`reorder` refuse it — use `things batch` with a per-line `opId`).
|
|
46
46
|
- **Preconditions**: referenced containers and tags must already exist — create nested structures outside-in and reuse each returned UUID.
|
|
@@ -56,7 +56,9 @@ Namespaced verb families — run `things <group> --help` for the verbs and `thin
|
|
|
56
56
|
|
|
57
57
|
**Scheduling is an update, not a move**: `things todo update <ref> --when today|evening|anytime|someday|YYYY-MM-DD` schedules or parks an item; `move` changes its CONTAINER only.
|
|
58
58
|
|
|
59
|
-
**Move vs reorder — keep them apart** (`things help move`). MOVE changes WHAT an item belongs to: `things todo move <refs…> --to-project|--to-heading|--to-area <ref>`, or the detach family `--no-heading` / `--loose` / `--inbox`; `things project move <refs…> --to-area <ref>|--no-area`. REORDER changes only ARRANGEMENT in place, never membership
|
|
59
|
+
**Move vs reorder — keep them apart** (`things help move`). MOVE changes WHAT an item belongs to: `things todo move <refs…> --to-project|--to-heading|--to-area <ref>`, or the detach family `--no-heading` / `--loose` / `--inbox`; `things project move <refs…> --to-area <ref>|--no-area`. REORDER changes only ARRANGEMENT in place, never membership. `things reorder <refs…> [--start|--end|--before <ref>|--after <ref>] [--in <target>]` is the ONE reorder verb across ALL kinds — to-dos, projects, a project's headings, AND sidebar areas — dispatching the protocol by kind. All refs must be one KIND (only to-dos and projects intermix, and only on the shared Today/Evening/day axes); a mixed-kind set, a cross-container set, a cross-axis anchor, and a non-member each fail closed with one precise message. Reorder is variadic (selection order = landing order); an anchor POSITIONS but never MIGRATES. A Today/Evening member sits on two axes (its Today slot and its container slot); a set coherent on both is REFUSED until you pass `--in` (`today|evening|anytime|someday|inbox`, or a project/area/heading ref — to-dos/projects only). Reordering a HEADING runs the native heading-block wire (children follow); an archived heading is reorderable but repositioning it brings it back to open (disclosed). `things project move-heading` (cross-project moves / demotion) and `things area reorder` remain as kind-specific spellings. The axes, gates, #V11 heading policy, and automatic fallbacks are in [references/ordering.md](references/ordering.md). (MCP exposes this as the single `reorder` tool.)
|
|
60
|
+
|
|
61
|
+
**Resolution timestamps** (`--created-at` / `--completed-at`, both to-dos and projects; ISO date or datetime — a bare date is NOON in the effective zone): `add --completed-at <iso> [--created-at <iso>]` creates the item already RESOLVED in the Logbook (the history-import / GTD-migration path); `add --created-at <iso>` alone is born-open with a backdated creation. On an EXISTING item, `update --created-at` rewrites creation (any status); `update --completed-at` rewrites the completion timestamp of an ALREADY-resolved item (a canceled one stays canceled) — an OPEN item is refused, pointing you at `complete --completed-at` (resolve-and-backdate completed) or `cancel --completed-at` (resolve-and-backdate canceled; the "Completed on" stamp applies to canceled items too). Backdating a resolved item can be a multi-leg, non-atomic sequence — the leg list is disclosed in the result and in `--dry-run`. A project `add --completed-at` cannot seed open `--todo` children (a completed-project import needs every child resolved).
|
|
60
62
|
|
|
61
63
|
**Guarded writes** surface their consequence and require an explicit flag: deleting a NON-EMPTY area needs `--allow-non-empty`, a permanent delete needs `--dangerously-permanent`, and a UI-driving op (e.g. `area reorder`) needs `--dangerously-drive-gui` plus `things config set ui-enabled true`. The full acknowledgment contract is in [references/errors.md](references/errors.md).
|
|
62
64
|
|
|
@@ -6,10 +6,9 @@ The apiVersion-stable contracts that hold regardless of which binary version you
|
|
|
6
6
|
|
|
7
7
|
Every `--json` response is an envelope `{ apiVersion, ok, kind, data, meta }`:
|
|
8
8
|
|
|
9
|
-
- Results are in `.data`, in exactly one of
|
|
10
|
-
- **
|
|
11
|
-
-
|
|
12
|
-
- Check `meta.truncation.truncated` before concluding "no match" or "that's everything": it is `true` exactly when any row was hidden (`shown < total`, or any grouped block capped). Raise `--limit`/`--all` or narrow the filter rather than assuming you saw everything.
|
|
9
|
+
- Results are in `.data`, in exactly one of five wrappers named by `kind`: `.data.item` (one entity), `.data.view` (an area/project card), `.data.items` (a flat list), `.data.sections` (a list split into named sections), or `.data.children` (the `today` view's two keyed buckets `{ today: {items, total?}, evening: {items, total?} }`). Never `.items` at the top level. Item UUIDs are in `.uuid`, not `.id`; emitted UUIDs are always full. The `today` view's whole-view count rides `meta.counts` (`{dueOrOverdue, other}`), not `data`.
|
|
10
|
+
- **Container refs and `type`.** A row's `area`/`project`/`heading` is a bare **title string**; a flat sibling `areaUuid`/`projectUuid`/`headingUuid` appears **only when that title would not resolve back** to the exact same item. **To act on a ref, pass `.areaUuid // .area`** (same for project/heading). For unattended pipelines or stored refs, use `--full` and key on uuids (the full tier always emits the `*Uuid` siblings). **Absent `type` = to-do** — `type` is present only for a `project`, `heading`, `area`, or `tag` ROW/candidate (a `project show` `headings[]` entry drops it — its slot already states it is a heading, and it emits a presence-keyed **`archived`** — the archive timestamp, present iff archived — instead of any status/stage; a heading is archive/unarchive only, never completed/canceled). **A `project show` view is `data.view = { project, children, headings[] }`** (read-shape v2): `children` is the un-headed body's stage buckets `{ anytime: {items, total?}, upcoming: [{when, items, total?} …], someday: {items, total?}, logbook: {items, total?} }` (the `upcoming` day-block array ends with a `{when: null, items}` resting block when a container holds date-less recurring templates); `headings[]` is EVERY heading in order — open, archived-unswept, AND archived-swept — each `{ uuid, title, archived?, children }` with the same recursive `children`. A swept heading's logged children ride ITS `children.logbook`; there is no `logbookHeadings` and no root `logbook` (the GUI's merged logbook region is TTY-only). **An `area show` view is `data.view = { area, children, projects }`** (read-shape v2): `area` is the area node (or `null` for the `loose` pseudo-area); `children` is the area's DIRECT to-dos as three stage buckets `{ anytime: {items, total?}, upcoming: [{when, items, total?} …], someday: {items, total?} }` (same `{when: null, items}` resting-block rule; NO `logbook` key — read an area's archive with `things logbook --area <ref>`); `projects` is the child-project rows as ONE record `{items, total?}` (a mixed-stage listing keeping each row's `stage`/`when`). A capped scope carries its inline `total` — `children.anytime` for `--area-limit`, `projects` for `--project-limit`; this view emits no `meta.truncation.blocks`. **The global `things upcoming` view is `data.sections = [{when, items, total?} …]`** (read-shape v2 PR 4): chronological DAY BLOCKS keyed by `when` (an ISO date — also the `--in <when>` reorder token), each the complete global day scope, then a trailing `{when: null, items}` block of date-less recurring templates when any exist. Rows KEEP `stage` (the view is mixed — future-dated `upcoming` rows beside deadline-forecast `anytime`/`someday` rows at their deadline day) and drop `when` inside their block (a scheduled row's `when` is the block key). To flatten: `.data.sections[].items[]`. A capped day block (the `--limit` cut straddled it) carries its inline `total`; the whole-view `shown/total/limit/truncated` rollup rides `meta.truncation` (no `blocks`). **The global `things anytime` / `things someday` views are `data.sections = [{ area, items, total? } …]`** (read-shape v2 PR 5): area-grouped sections in sidebar-rank order, `area` the area node (or `null` for the loose section). Each section's `items` are its flattened rows (area-direct/loose to-dos, then each project row with its capped children); the section carries its inline `total` iff those `items` were capped (by `--area-limit` / `--project-limit`). To flatten: `.data.sections[].items[]`. **NO view emits `meta.truncation.blocks[]` any longer — it is retired from the wire entirely (PR 5); per-bucket completeness is always the inline `total`.**
|
|
11
|
+
- Check `meta.truncation.truncated` before concluding "no match" or "that's everything": it is `true` exactly when any row was hidden (`shown < total` on the whole-view rollup, or any bucket's inline `total` exceeds its shown `items`). Raise `--limit` (or `--area-limit`/`--project-limit` on the grouped views) / `--all`, or narrow the filter, rather than assuming you saw everything.
|
|
13
12
|
- List/search rows are compact **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.
|
|
14
13
|
|
|
15
14
|
## Exit codes (writes are verified after they land)
|
|
@@ -17,7 +17,7 @@ Entities, relationships, and how the sidebar views are computed over them, as ex
|
|
|
17
17
|
|
|
18
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
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 or tagged, and its lifecycle is **archive/unarchive ONLY** — a heading is never completed or canceled (it has no canceled state). In a `project show` view
|
|
20
|
+
- A heading is a section label inside one project — not a task. It cannot be scheduled or tagged, and its lifecycle is **archive/unarchive ONLY** — a heading is never completed or canceled (it has no canceled state). In a `project show` view (read-shape v2) a heading is an entry of `headings[]` — `{ uuid, title, archived?, children }` — carrying no `status`/`stage`; it emits a presence-keyed **`archived`** (the ISO archive timestamp) when archived, absent when open. ALL headings live in that one `headings[]` array in order regardless of lifecycle class — open, archived-unswept, AND archived-swept; sweep state is NOT on the wire. A swept heading simply carries `archived` and its logged children ride ITS `children.logbook`; the GUI's grouping of swept headings into the logbook region is TTY-derived from that, not a separate wire array. Deleting/archiving a heading affects only the label, per the operation's contract.
|
|
21
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
22
|
- **Status**: open → completed or canceled (both land in the Logbook) or trashed (Trash; restorable until emptied). Reopen brings a logged item back.
|
|
23
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.
|
|
@@ -29,9 +29,9 @@ Entities, relationships, and how the sidebar views are computed over them, as ex
|
|
|
29
29
|
|
|
30
30
|
- **inbox** — untriaged to-dos (no container, no schedule).
|
|
31
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.
|
|
32
|
+
- **upcoming** — future-dated items, forward-ordered by date. JSON returns `data.sections = [{when, items, total?} …]` — chronological day blocks keyed by `when` (an ISO date), then a trailing `{when: null, items}` block of date-less recurring templates when any exist (flatten with `.data.sections[].items[]`).
|
|
33
|
+
- **anytime** — all active items kept without a specific date (standalone or filed). JSON returns `data.sections = [{area, items, total?} …]` — area-grouped sections (sidebar-rank order; `area` is `null` for the loose section), each carrying its inline `total` iff its rows were capped by `--area-limit`/`--project-limit` (flatten with `.data.sections[].items[]`).
|
|
34
|
+
- **someday** — items deliberately kept without a date. Same `data.sections = [{area, items, total?} …]` shape as anytime.
|
|
35
35
|
- **logbook** — completed/canceled items.
|
|
36
36
|
- **trash** — trashed items (restorable until the trash is emptied).
|
|
37
37
|
|
|
@@ -41,8 +41,8 @@ Entities, relationships, and how the sidebar views are computed over them, as ex
|
|
|
41
41
|
|
|
42
42
|
Reads decompose an item's position onto two derived, presence-keyed words (they REPLACED the old `start`/`startDate`/`logged`/`trashed`/`todaySection` wire fields, which no longer appear):
|
|
43
43
|
|
|
44
|
-
- **`stage`** — the sidebar BUCKET: `inbox | upcoming | anytime | someday | logbook | trash`. Read view membership off it directly. It is dropped inside a section/catalogue that
|
|
45
|
-
- **`when`** — the TIME POSITION: `today | evening | a future ISO date`, or absent (unscheduled and not in Today). `evening` implies today. Someday is a bucket, never a `when`. The `today` view
|
|
44
|
+
- **`stage`** — the sidebar BUCKET: `inbox | upcoming | anytime | someday | logbook | trash`. Read view membership off it directly. It is dropped inside a section/catalogue that already states it (the stage-pure `inbox`/`anytime`/`someday`/`logbook`/`trash` lists and the `today` view's two `children` buckets) and kept everywhere it is not implied (the mixed `upcoming` day blocks — future-dated `upcoming` rows beside deadline-forecast `anytime`/`someday` ones — plus `search`, `changes`, the projects/areas listings, and `detail`).
|
|
45
|
+
- **`when`** — the TIME POSITION: `today | evening | a future ISO date`, or absent (unscheduled and not in Today). `evening` implies today. Someday is a bucket, never a `when`. The `today` view returns `data.children = { today: {items, total?}, evening: {items, total?} }` — two keyed buckets (the bucket key states today/evening, so `when` is dropped inside them); the whole-view count rides `meta.counts` (`{dueOrOverdue, other}`).
|
|
46
46
|
- The two are DIFFERENT facts. A due deadline pulls an UNDATED row into Today: it reads `when: "today"` and derives `stage: "anytime"` — the app re-files a deadline-pulled Inbox/Someday row into Anytime at pull time (R13/BANNER1b), so it drops out of the Inbox/Someday lists and joins Anytime while its `when` reads `today`. Completed/canceled → `stage: "logbook"`, trashed → `stage: "trash"`, regardless of any other hint.
|
|
47
47
|
- `provisional: true` marks a Today member the app has not yet materialized — see [banner.md](banner.md).
|
|
48
48
|
|
|
@@ -53,9 +53,9 @@ Every row comes back at one of two densities, selected by view kind + flag, neve
|
|
|
53
53
|
- **Compact** (the list default) keeps identity + structural + non-default facts. A field at its default is OMITTED, so absence = the default: no `status` = open, no `checklist` = none, no `todos` = no child to-dos, no `when` = not in Today and unscheduled, no `provisional` = materialized. The full `notes` string is dropped and replaced by presence-keyed `hasNotes: true`; `startDate`, `created`, and `modified` are dropped.
|
|
54
54
|
- **Full** (`show`/`detail`, or a list forced with `--full`) is the whole record — the complete `notes`, the raw `startDate` substrate behind `when`, the checklist `items` array, and timestamps.
|
|
55
55
|
- Compact rows still carry the useful summaries: `checklist:{open,total}` on a to-do, `todos:{open,total}` on a project (app-maintained leaf-action counts — never headings, checklist items, or trashed rows), and `match:{field,text}` on a `search` hit whose match was NOT the title (`field` ∈ `heading | notes | checklist`).
|
|
56
|
-
- **Container absence rule:** inside a single-container node (a project/area card, an `anytime`/`someday` section) an item omits any ancestry the node already states, so absent `project`/`area` there means *inherited from the enclosing node*. A mixed list (`inbox`/`today`/`search`/`changes`) still names each row's own `project`/`area` (the `heading` ref is compact-dropped outside a project view; `--full` keeps it).
|
|
56
|
+
- **Container absence rule:** inside a single-container node (a project/area card, an `anytime`/`someday` section, a `project show` `headings[]` entry) an item omits any ancestry the node already states, so absent `project`/`area`/`heading` there means *inherited from the enclosing node*. A mixed list (`inbox`/`today`/`search`/`changes`) still names each row's own `project`/`area` (the `heading` ref is compact-dropped outside a project view; `--full` keeps it). In a read-shape v2 **`project show`** view membership is fully STRUCTURAL: every bucket row — un-headed body children AND rows nested under a `headings[]` entry, INCLUDING each `children.logbook` row — drops its `heading` ref, because its position states it. A swept child of an OPEN heading rides that heading's `children.logbook`; a swept child of an ARCHIVED heading rides the archived heading's `children.logbook`; the GUI's PROJECT-vs-HEADING logbook sublabel is TTY-derived from that structural placement, not from a per-row ref.
|
|
57
57
|
- **Container ref shape:** a container ref is a bare **title string** (`"area": "Family"`, `"project": "Groceries"`, `"heading": "Backlog"`). A flat sibling `areaUuid` / `projectUuid` / `headingUuid` (the full uuid) rides alongside **only when the bare title would not resolve back** to that exact item — a duplicate title in the same resolution scope, or a title that is itself a valid uuid prefix. **To act on a ref, pass `.areaUuid // .area`** (same for project/heading): the uuid when present, else the title. For unattended pipelines or stored refs, use `--full` and key on the uuids — the full tier emits every `*Uuid` sibling unconditionally. A row whose container project is a repeating template carries a flat `projectIsTemplate: true` (the JSON twin of the TTY `↻` glyph) — acting on such a row edits the blueprint, affecting future occurrences, so target the intended copy via `projectUuid` (a same-titled occurrence exists alongside the hidden template).
|
|
58
|
-
- **`type` is presence-keyed:** **absent `type` = to-do.** A row omits `type` when it is a to-do; `type` is present for a `project`, `heading`, `area`, or `tag` ROW (including in the error `candidates` shape). This is scoped to ROWS/candidates — a positional keyed
|
|
58
|
+
- **`type` is presence-keyed:** **absent `type` = to-do.** A row omits `type` when it is a to-do; `type` is present for a `project`, `heading`, `area`, or `tag` ROW (including in the error `candidates` shape). This is scoped to ROWS/candidates — a positional keyed node whose kind is fixed by its slot (a `project show` `headings[]` entry) drops `type` too, since its position already states it is a heading.
|
|
59
59
|
|
|
60
60
|
## Filters over views
|
|
61
61
|
|
|
@@ -21,15 +21,24 @@ The SKILL.md summary is enough for most calls; this page is the full contract. E
|
|
|
21
21
|
|
|
22
22
|
## Reorder — changing arrangement
|
|
23
23
|
|
|
24
|
-
`things reorder <refs…> [--
|
|
24
|
+
`things reorder <refs…> [--start | --end | --before <ref> | --after <ref>] [--in <target>]` is the ONE reorder verb across EVERY kind — to-dos, projects, a project's headings, AND sidebar areas — dispatching the protocol by kind (it replaced the old `todo reorder` subcommand and the raw `reorder --scope`). All refs must be one KIND; only to-dos and projects intermix, and only on the shared Today/Evening/day axes.
|
|
25
25
|
|
|
26
|
-
- **Bare (no position)**: the named items assemble as ONE block at the EARLIEST one's current slot, in argument order (`--
|
|
27
|
-
- **Positioned**: `--
|
|
26
|
+
- **Bare (no position)**: the named items assemble as ONE block at the EARLIEST one's current slot, in argument order (`--start` is NOT implied). Partial selection is fine — unmentioned siblings keep their order.
|
|
27
|
+
- **Positioned**: `--start`/`--end` send the block to the start/end of its scope; `--before <ref>`/`--after <ref>` place it relative to an anchor.
|
|
28
28
|
- **Selection order = landing order** (reverse by naming the refs backwards).
|
|
29
|
-
- **Mixed to-do + project refs are allowed** in the Today/Evening/day buckets those kinds share; elsewhere reorder operates within one container+bucket.
|
|
29
|
+
- **Mixed to-do + project refs are allowed** in the Today/Evening/day buckets those kinds share; elsewhere reorder operates within one container+bucket. A heading or area NEVER mixes with another kind — a mixed-kind set is refused with one message.
|
|
30
30
|
- **Deadline-forecast rows sort on their Upcoming day too (projects too).** A someday/anytime to-do OR project with a future **deadline** and no start date renders in the Upcoming block on its deadline day. `things reorder` treats it as a first-class member of that day-group: it sorts on the same axis as the day's scheduled rows and interleaves with them, so you can reorder a mixed set of scheduled rows, deadline-forecast to-dos, and deadline-forecast projects in one call. This works with `allow-experimental` OFF — it rides a public-URL deadline-cycle, not the private surface (still gated by `bounce-enabled`, like every multi-leg reorder). An INBOX to-do that merely carries the same deadline is NOT on that day's axis and is refused with a message saying so (schedule it, or take it out of the Inbox, first).
|
|
31
|
+
- **Resolved to-do movees (LOGSORT ORD-13):** an UNSWEPT completed/canceled to-do — one still struck-through in its live container body, before the Logbook sweep boundary — CAN be reordered in place: it re-ranks by index only, staying resolved (no reopen). This is permitted ONLY on the pure-native index reorder (a project/area/inbox/someday re-rank, which needs `allow-experimental` ON); a mixed OPEN + unswept-resolved set is fine. A SWEPT completed/canceled to-do (a Logbook resident) is refused, pointing at `things todo reopen` (reactivation) or `--completed-at` (to re-date it in the Logbook — sort order can't express Logbook re-dating). An unswept-resolved movee that would have to ride an uncertified path (a bounce/move fallback — e.g. `allow-experimental` OFF — or an `--in <date>` day-axis target) is likewise refused, telling you to reopen it first.
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
Headings and areas are now first-class `reorder` operands (see the two sections below); the kind-specific spellings `things project move-heading` (which ALSO does cross-project moves / demotion — the placement verb) and `things area reorder` (a single sidebar area) remain.
|
|
34
|
+
|
|
35
|
+
## Reordering a project's headings (#V11)
|
|
36
|
+
|
|
37
|
+
`things reorder <heading-refs…> --start|--end|--before <h>|--after <h>` re-ranks a project's headings in place, dispatching onto the certified native heading-block wire (children follow their heading). All headings must be in ONE project (cross-project is refused). `--in` does not apply (a heading has no stage/day/view axis). Archived headings (completed — unswept OR swept) are reorderable UNGUARDED, exactly like the GUI: the engine composes the minimal wire so an archived heading that need not move stays untouched, but when the target order forces an archived heading to move it PROCEEDS and DISCLOSES that repositioning it brought it back to open (result warning + `--dry-run` leg plan) — never silent. `things project move-heading` remains for cross-project moves and demotion.
|
|
38
|
+
|
|
39
|
+
## Reordering sidebar areas
|
|
40
|
+
|
|
41
|
+
`things reorder <area-refs…> --start|--end|--before <area>|--after <area>` re-ranks sidebar areas. This drives the local Things app (a sidebar drag), so it needs `--dangerously-drive-gui` plus `things config set ui-enabled true`; a set of areas is a sequence of drags (non-atomic, disclosed). An area reorder needs a position (there is no bucket to assemble a block in). `things area reorder <ref>` is the single-area spelling.
|
|
33
42
|
|
|
34
43
|
## Anchors POSITION, never MIGRATE
|
|
35
44
|
|
|
@@ -44,7 +53,7 @@ A Today/Evening member has TWO order slots: its slot in the Today VIEW (`todayIn
|
|
|
44
53
|
- `--in` accepts `today | evening | anytime | someday | inbox`, a project/area/heading ref (uuid or unique title), `upcoming` (the one future day the whole set shares), or a `YYYY-MM-DD` day-block. `loose` is refused (it is a read view, not a bucket).
|
|
45
54
|
- `--in <YYYY-MM-DD>` names one exact Upcoming day-block: every movee must be on that day (scheduled for it, or carrying it as a deadline) and the date must be strictly future (a today/past date is refused, pointing you at `--in today`). `--in upcoming` is the proxy — it derives the single future day the set shares and refuses (listing the per-item days) if they span days. Neither needs a shared container — a day-block is ONE cross-container sortability bucket.
|
|
46
55
|
- `--in someday` / `--in anytime` reorder within a shared container's stage list: every movee must BE that stage AND they must share one direct container (same project, heading, area, or all loose), else it is refused naming the mismatch. `--in inbox` needs only that every movee is inbox-stage.
|
|
47
|
-
- **One KIND per index token.** A stage-list token (`anytime`/`someday`/`inbox`) or a container ref sorts each object kind in its own order-space, so all movees must be the SAME kind — a mixed to-do + project set is refused naming each movee's kind, *even when they share a container* (an area's someday to-dos and someday projects are different index buckets). The `today`/`evening`/`upcoming`/`<YYYY-MM-DD>` day-and-view tokens are the exception: those axes intermix to-dos and projects. A **heading** has no stage/day/view order of its own
|
|
56
|
+
- **One KIND per index token.** A stage-list token (`anytime`/`someday`/`inbox`) or a container ref sorts each object kind in its own order-space, so all movees must be the SAME kind — a mixed to-do + project set is refused naming each movee's kind, *even when they share a container* (an area's someday to-dos and someday projects are different index buckets). The `today`/`evening`/`upcoming`/`<YYYY-MM-DD>` day-and-view tokens are the exception: those axes intermix to-dos and projects. A **heading** has no stage/day/view order of its own, so `--in` never applies to a heading set — reorder headings without `--in` (they dispatch onto the project's heading axis; see "Reordering a project's headings" above).
|
|
48
57
|
- The container form of `--in` is POLYMORPHIC — it tries project → area → heading — so a heading whose title is shadowed by a project or area of the same name would resolve to the wrong kind. Pin it with the heading's **decorated ref** `Heading [ref]` (or a bare uuid). Decorated refs (`Title [ref]`) work in every `<ref>` slot: the bracketed uuid/partial-uuid resolves and the title is an ignored comment. A literal title that really contains brackets still wins over the bracket parse (exact-title resolves first).
|
|
49
58
|
- `--in someday` / `--in anytime` / a container ref on a same-day forecast set reorders its CONTAINER index (its someday/anytime list order), never the day-block — the explicit axis is honored, not overridden by the day route.
|
|
50
59
|
- Forcing the container index axis on a Today/Evening member PRESERVES the Today/Evening flag — a flag-safe move protocol routes it off the de-Today path. Only the someday/inbox loose axes still refuse a flagged member (their re-entry cannot preserve the flag).
|
|
@@ -85,4 +94,4 @@ Everything non-template is sortable on every guaranteed surface above.
|
|
|
85
94
|
|
|
86
95
|
## MCP parity
|
|
87
96
|
|
|
88
|
-
The MCP server exposes reorder as
|
|
97
|
+
The MCP server exposes reorder as the single **`reorder`** tool — `refs`, an optional position (`start`/`end`/`before`/`after`), an optional `in` axis, and `dangerously_drive_gui` for area drags — mirroring `things reorder` across every kind. It calls the same library entry the CLI does, so the kind dispatch, the mixed-kind / cross-container / cross-axis refusals, the #V11 heading disclosure, the dual-axis refusal, the flag-safe routing, and the automatic fallbacks behave identically. (`reorder_areas` was folded into this tool and removed — plan PR D.)
|