things-api 0.10.0 → 0.12.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 (239) hide show
  1. package/README.md +50 -13
  2. package/dist/audit/schema.d.ts +7 -0
  3. package/dist/audit/schema.js.map +1 -1
  4. package/dist/cli/clock.d.ts +8 -0
  5. package/dist/cli/clock.js +24 -0
  6. package/dist/cli/clock.js.map +1 -0
  7. package/dist/cli/commands/area.d.ts +18 -11
  8. package/dist/cli/commands/area.js +61 -74
  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 +60 -0
  14. package/dist/cli/commands/install-skill.js +256 -0
  15. package/dist/cli/commands/install-skill.js.map +1 -0
  16. package/dist/cli/commands/mcp.js +9 -0
  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 +27 -34
  20. package/dist/cli/commands/project.js.map +1 -1
  21. package/dist/cli/commands/reads.d.ts +15 -2
  22. package/dist/cli/commands/reads.js +144 -44
  23. package/dist/cli/commands/reads.js.map +1 -1
  24. package/dist/cli/commands/setup.js +7 -2
  25. package/dist/cli/commands/setup.js.map +1 -1
  26. package/dist/cli/commands/show.js +38 -14
  27. package/dist/cli/commands/show.js.map +1 -1
  28. package/dist/cli/commands/todo.js +15 -9
  29. package/dist/cli/commands/todo.js.map +1 -1
  30. package/dist/cli/commands/writes.js +797 -174
  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 +26 -3
  34. package/dist/cli/did-you-mean.js.map +1 -1
  35. package/dist/cli/glyphs.d.ts +32 -2
  36. package/dist/cli/glyphs.js +83 -12
  37. package/dist/cli/glyphs.js.map +1 -1
  38. package/dist/cli/help.js +121 -16
  39. package/dist/cli/help.js.map +1 -1
  40. package/dist/cli/main.js +33 -2
  41. package/dist/cli/main.js.map +1 -1
  42. package/dist/cli/move-hint.d.ts +46 -0
  43. package/dist/cli/move-hint.js +196 -0
  44. package/dist/cli/move-hint.js.map +1 -0
  45. package/dist/cli/period.d.ts +2 -8
  46. package/dist/cli/period.js +44 -30
  47. package/dist/cli/period.js.map +1 -1
  48. package/dist/cli/read-driver.d.ts +43 -5
  49. package/dist/cli/read-driver.js +91 -15
  50. package/dist/cli/read-driver.js.map +1 -1
  51. package/dist/cli/render.d.ts +19 -8
  52. package/dist/cli/render.js +70 -27
  53. package/dist/cli/render.js.map +1 -1
  54. package/dist/cli/resolve-invocation.d.ts +2 -2
  55. package/dist/cli/resolve-invocation.js +3 -3
  56. package/dist/cli/resolve-invocation.js.map +1 -1
  57. package/dist/cli/skill-check.d.ts +27 -0
  58. package/dist/cli/skill-check.js +99 -0
  59. package/dist/cli/skill-check.js.map +1 -0
  60. package/dist/cli/skill.d.ts +70 -0
  61. package/dist/cli/skill.js +152 -0
  62. package/dist/cli/skill.js.map +1 -0
  63. package/dist/cli/tag-filters.d.ts +6 -2
  64. package/dist/cli/tag-filters.js +8 -6
  65. package/dist/cli/tag-filters.js.map +1 -1
  66. package/dist/cli/verb-hint.js +28 -3
  67. package/dist/cli/verb-hint.js.map +1 -1
  68. package/dist/cli/version.d.ts +4 -0
  69. package/dist/cli/version.js +18 -0
  70. package/dist/cli/version.js.map +1 -0
  71. package/dist/client.d.ts +171 -27
  72. package/dist/client.js +279 -40
  73. package/dist/client.js.map +1 -1
  74. package/dist/config.d.ts +66 -2
  75. package/dist/config.js +120 -12
  76. package/dist/config.js.map +1 -1
  77. package/dist/contracts.d.ts +186 -28
  78. package/dist/contracts.js +22 -1
  79. package/dist/contracts.js.map +1 -1
  80. package/dist/diagnose.d.ts +34 -2
  81. package/dist/diagnose.js +36 -1
  82. package/dist/diagnose.js.map +1 -1
  83. package/dist/index.d.ts +25 -9
  84. package/dist/index.js +22 -3
  85. package/dist/index.js.map +1 -1
  86. package/dist/mcp/server.d.ts +9 -0
  87. package/dist/mcp/server.js +1157 -684
  88. package/dist/mcp/server.js.map +1 -1
  89. package/dist/model/clock.d.ts +61 -0
  90. package/dist/model/clock.js +71 -0
  91. package/dist/model/clock.js.map +1 -0
  92. package/dist/model/dates.d.ts +26 -3
  93. package/dist/model/dates.js +84 -3
  94. package/dist/model/dates.js.map +1 -1
  95. package/dist/model/entities.d.ts +60 -3
  96. package/dist/model/entities.js.map +1 -1
  97. package/dist/model/mappers.d.ts +4 -2
  98. package/dist/model/mappers.js +66 -9
  99. package/dist/model/mappers.js.map +1 -1
  100. package/dist/model/recurrence.d.ts +8 -1
  101. package/dist/model/recurrence.js.map +1 -1
  102. package/dist/read/area-filter.d.ts +76 -0
  103. package/dist/read/area-filter.js +59 -0
  104. package/dist/read/area-filter.js.map +1 -0
  105. package/dist/read/area-view.d.ts +12 -12
  106. package/dist/read/area-view.js +58 -34
  107. package/dist/read/area-view.js.map +1 -1
  108. package/dist/read/detail.d.ts +1 -1
  109. package/dist/read/detail.js +26 -12
  110. package/dist/read/detail.js.map +1 -1
  111. package/dist/read/log-boundary.d.ts +1 -1
  112. package/dist/read/log-boundary.js +13 -3
  113. package/dist/read/log-boundary.js.map +1 -1
  114. package/dist/read/predicates.d.ts +18 -0
  115. package/dist/read/predicates.js +19 -0
  116. package/dist/read/predicates.js.map +1 -1
  117. package/dist/read/project-view.d.ts +32 -16
  118. package/dist/read/project-view.js +80 -45
  119. package/dist/read/project-view.js.map +1 -1
  120. package/dist/read/pseudo-area.d.ts +29 -0
  121. package/dist/read/pseudo-area.js +27 -0
  122. package/dist/read/pseudo-area.js.map +1 -0
  123. package/dist/read/queries.d.ts +108 -19
  124. package/dist/read/queries.js +212 -35
  125. package/dist/read/queries.js.map +1 -1
  126. package/dist/read/scope.d.ts +126 -0
  127. package/dist/read/scope.js +162 -0
  128. package/dist/read/scope.js.map +1 -0
  129. package/dist/read/search-rank.d.ts +2 -5
  130. package/dist/read/shape.d.ts +162 -0
  131. package/dist/read/shape.js +686 -0
  132. package/dist/read/shape.js.map +1 -0
  133. package/dist/read/show-target.d.ts +9 -1
  134. package/dist/read/show-target.js +45 -4
  135. package/dist/read/show-target.js.map +1 -1
  136. package/dist/read/snapshot.d.ts +1 -1
  137. package/dist/read/snapshot.js +9 -2
  138. package/dist/read/snapshot.js.map +1 -1
  139. package/dist/read/stage.d.ts +199 -0
  140. package/dist/read/stage.js +125 -0
  141. package/dist/read/stage.js.map +1 -0
  142. package/dist/read/truncation.d.ts +8 -6
  143. package/dist/read/truncation.js +35 -10
  144. package/dist/read/truncation.js.map +1 -1
  145. package/dist/read/views.d.ts +61 -20
  146. package/dist/read/views.js +240 -82
  147. package/dist/read/views.js.map +1 -1
  148. package/dist/surface-copy.d.ts +9 -0
  149. package/dist/surface-copy.js +9 -0
  150. package/dist/surface-copy.js.map +1 -1
  151. package/dist/write/accessibility-probe.d.ts +1 -1
  152. package/dist/write/accessibility-probe.js +8 -0
  153. package/dist/write/accessibility-probe.js.map +1 -1
  154. package/dist/write/automation-probe.d.ts +1 -1
  155. package/dist/write/automation-probe.js +8 -0
  156. package/dist/write/automation-probe.js.map +1 -1
  157. package/dist/write/batch.d.ts +49 -10
  158. package/dist/write/batch.js +423 -70
  159. package/dist/write/batch.js.map +1 -1
  160. package/dist/write/commands.d.ts +1 -1
  161. package/dist/write/commands.js +316 -66
  162. package/dist/write/commands.js.map +1 -1
  163. package/dist/write/guards.d.ts +1 -1
  164. package/dist/write/guards.js +94 -10
  165. package/dist/write/guards.js.map +1 -1
  166. package/dist/write/heading.d.ts +10 -1
  167. package/dist/write/heading.js +35 -5
  168. package/dist/write/heading.js.map +1 -1
  169. package/dist/write/make-repeating-project.d.ts +2 -2
  170. package/dist/write/make-repeating-project.js +9 -9
  171. package/dist/write/make-repeating-project.js.map +1 -1
  172. package/dist/write/move.d.ts +130 -0
  173. package/dist/write/move.js +1533 -0
  174. package/dist/write/move.js.map +1 -0
  175. package/dist/write/operations.d.ts +105 -19
  176. package/dist/write/operations.js +56 -7
  177. package/dist/write/operations.js.map +1 -1
  178. package/dist/write/opid.d.ts +31 -0
  179. package/dist/write/opid.js +30 -0
  180. package/dist/write/opid.js.map +1 -0
  181. package/dist/write/pipeline.d.ts +122 -3
  182. package/dist/write/pipeline.js +309 -52
  183. package/dist/write/pipeline.js.map +1 -1
  184. package/dist/write/planner.js +8 -1
  185. package/dist/write/planner.js.map +1 -1
  186. package/dist/write/pre-state.d.ts +197 -6
  187. package/dist/write/pre-state.js +427 -20
  188. package/dist/write/pre-state.js.map +1 -1
  189. package/dist/write/recurrence-rule-blob.d.ts +65 -0
  190. package/dist/write/recurrence-rule-blob.js +150 -0
  191. package/dist/write/recurrence-rule-blob.js.map +1 -0
  192. package/dist/write/reorder.d.ts +23 -3
  193. package/dist/write/reorder.js +1871 -85
  194. package/dist/write/reorder.js.map +1 -1
  195. package/dist/write/reversibility.js +19 -7
  196. package/dist/write/reversibility.js.map +1 -1
  197. package/dist/write/scope-guard.d.ts +31 -0
  198. package/dist/write/scope-guard.js +162 -0
  199. package/dist/write/scope-guard.js.map +1 -0
  200. package/dist/write/undo.js +120 -13
  201. package/dist/write/undo.js.map +1 -1
  202. package/dist/write/vectors/applescript.js +16 -7
  203. package/dist/write/vectors/applescript.js.map +1 -1
  204. package/dist/write/vectors/registry.d.ts +5 -7
  205. package/dist/write/vectors/registry.js +49 -2
  206. package/dist/write/vectors/registry.js.map +1 -1
  207. package/dist/write/vectors/shortcuts.js +1 -1
  208. package/dist/write/vectors/shortcuts.js.map +1 -1
  209. package/dist/write/vectors/simulator.d.ts +44 -0
  210. package/dist/write/vectors/simulator.js +1192 -0
  211. package/dist/write/vectors/simulator.js.map +1 -0
  212. package/dist/write/vectors/types.d.ts +46 -0
  213. package/dist/write/vectors/ui-certification.d.ts +10 -4
  214. package/dist/write/vectors/ui-certification.js +43 -10
  215. package/dist/write/vectors/ui-certification.js.map +1 -1
  216. package/dist/write/vectors/ui-drag.d.ts +21 -1
  217. package/dist/write/vectors/ui-drag.js +138 -27
  218. package/dist/write/vectors/ui-drag.js.map +1 -1
  219. package/dist/write/vectors/ui-recipes.d.ts +34 -1
  220. package/dist/write/vectors/ui-recipes.js +217 -6
  221. package/dist/write/vectors/ui-recipes.js.map +1 -1
  222. package/dist/write/vectors/ui.d.ts +40 -1
  223. package/dist/write/vectors/ui.js +196 -39
  224. package/dist/write/vectors/ui.js.map +1 -1
  225. package/dist/write/verify/delta.d.ts +127 -2
  226. package/dist/write/verify/delta.js +255 -16
  227. package/dist/write/verify/delta.js.map +1 -1
  228. package/dist/write/verify/poller.d.ts +7 -1
  229. package/dist/write/verify/poller.js +20 -1
  230. package/dist/write/verify/poller.js.map +1 -1
  231. package/package.json +24 -3
  232. package/schema/envelope.schema.json +383 -0
  233. package/skills/things-cli/SKILL.md +70 -0
  234. package/skills/things-cli/references/banner.md +35 -0
  235. package/skills/things-cli/references/contracts.md +62 -0
  236. package/skills/things-cli/references/errors.md +49 -0
  237. package/skills/things-cli/references/gui.md +11 -0
  238. package/skills/things-cli/references/model.md +60 -0
  239. package/skills/things-cli/references/ordering.md +71 -0
@@ -11,15 +11,36 @@ export class ProjectNotFoundError extends Error {
11
11
  this.name = "ProjectNotFoundError";
12
12
  }
13
13
  }
14
- export function projectView(db, uuid, now, filter = {}) {
14
+ /** Append `value` to the list at `key`, creating it on first use. */
15
+ function pushInto(map, key, value) {
16
+ const list = map.get(key) ?? [];
17
+ list.push(value);
18
+ map.set(key, list);
19
+ }
20
+ /** Group scheduled rows into per-day buckets (date ASC, within-day todayIndex ASC). */
21
+ function groupByDate(rows) {
22
+ const out = [];
23
+ for (const { date, todo } of rows.toSorted((a, b) => a.date.localeCompare(b.date) || a.ti - b.ti)) {
24
+ const last = out[out.length - 1];
25
+ if (last && last.date === date)
26
+ last.items.push(todo);
27
+ else
28
+ out.push({ date, items: [todo] });
29
+ }
30
+ return out;
31
+ }
32
+ export function projectView(db, uuid, now, filter = {}, zone) {
15
33
  const overdue = filter.overdue === true;
16
34
  const projectRow = fetchTaskByUuid(db, uuid);
17
35
  if (!projectRow || projectRow.type !== 1)
18
36
  throw new ProjectNotFoundError(uuid);
19
37
  const refs = makeRefResolver(db);
38
+ // The view's injected clock — gates `todaySection` to Today members in the
39
+ // mapper AND drives the scheduled/overdue bucketing below.
40
+ const packedToday = encodePackedDate(localToday(now, zone));
20
41
  const tagsOf = (rows) => fetchTagsForTasks(db, rows.map((r) => r.uuid));
21
42
  const projectTags = tagsOf([projectRow]);
22
- const project = mapProject(projectRow, refs, projectTags.get(projectRow.uuid) ?? []);
43
+ const project = mapProject(projectRow, refs, projectTags.get(projectRow.uuid) ?? [], packedToday);
23
44
  // The card view surfaces area-inherited tags (the UI's tag filter honors them).
24
45
  project.inheritedTags = inheritedTagsFor(db, projectRow);
25
46
  const headingRows = fetchTaskRows(db, `t.type = 2 AND t.project = ? AND t.trashed = 0 ORDER BY t."index" ASC`, [uuid]);
@@ -30,7 +51,7 @@ export function projectView(db, uuid, now, filter = {}) {
30
51
  // itself always renders. Headings that keep no surviving child collapse
31
52
  // (below). Its single packed-today bind trails the two uuid binds.
32
53
  const overdueSql = overdue ? ` AND ${OVERDUE}` : "";
33
- const overdueBinds = overdue ? [encodePackedDate(localToday(now))] : [];
54
+ const overdueBinds = overdue ? [encodePackedDate(localToday(now, zone))] : [];
34
55
  // Tag scope (§9a): the child to-dos are filtered by a tag carried DIRECTLY on
35
56
  // the row — the container semantics. The project's own tags are inherited by
36
57
  // EVERY child, so an inheritance-inclusive `--tag` would be vacuous here;
@@ -40,36 +61,46 @@ export function projectView(db, uuid, now, filter = {}) {
40
61
  // the two uuid binds and lead the overdue bind, matching their left-to-right
41
62
  // order in the SQL.
42
63
  const tf = tagFilter(db, filter, { container: true });
43
- const childRows = fetchTaskRows(db, `t.type = 0 AND (t.project = ? OR t.heading IN (
64
+ const childRows = fetchTaskRows(db, `t.type = 0 AND t.trashed = 0 AND (t.project = ? OR t.heading IN (
44
65
  SELECT uuid FROM TMTask WHERE type = 2 AND project = ?
45
66
  ))${tf.sql}${overdueSql}
46
67
  ORDER BY t."index" ASC`, [uuid, uuid, ...tf.binds, ...overdueBinds]);
47
68
  const childTags = tagsOf(childRows);
48
- const boundary = logBoundary(db, now);
69
+ const boundary = logBoundary(db, now, zone);
49
70
  const todos = childRows.map((r) => ({
50
71
  row: r,
51
- todo: mapTodo(r, refs, childTags.get(r.uuid) ?? []),
72
+ todo: mapTodo(r, refs, childTags.get(r.uuid) ?? [], packedToday),
52
73
  }));
53
74
  markLogged([project, ...todos.map((t) => t.todo)], boundary);
54
- const packedToday = encodePackedDate(localToday(now));
75
+ // Project-level (UNHEADED) buckets.
55
76
  const active = [];
56
- const byHeading = new Map();
57
77
  const scheduledRows = [];
58
78
  const repeating = [];
59
79
  const someday = [];
60
80
  const logged = [];
61
- const trashed = [];
81
+ // Per-heading sub-buckets, keyed by heading uuid (§9 fidelity fix): a headed
82
+ // scheduled/someday/repeating child nests under its heading, NOT at the
83
+ // project level.
84
+ const headingItems = new Map();
85
+ const headingScheduled = new Map();
86
+ const headingSomeday = new Map();
87
+ const headingRepeating = new Map();
88
+ // Known (fetched, untrashed) headings — a child whose heading FK is not one
89
+ // of these falls back to the project-level (unheaded) buckets rather than
90
+ // vanishing (mirrors the render's historical loose fallback).
91
+ const headingSet = new Set(headings.map((h) => h.uuid));
92
+ const headingUuidOf = (row) => row.heading !== null && headingSet.has(row.heading) ? row.heading : null;
62
93
  // Every untrashed, non-template OPEN child, regardless of which bucket it
63
94
  // lands in below — surfaced (only when the project is itself resolved) as
64
95
  // the PLOG1 stranded-open-child count.
65
96
  let openChildren = 0;
66
97
  for (const { row, todo } of todos) {
67
- if (row.trashed === 1) {
68
- trashed.push(todo);
69
- continue;
70
- }
98
+ const h = headingUuidOf(row);
71
99
  if (todo.repeating.isTemplate) {
72
- repeating.push(todo);
100
+ if (h !== null)
101
+ pushInto(headingRepeating, h, todo);
102
+ else
103
+ repeating.push(todo);
73
104
  continue;
74
105
  }
75
106
  if (row.status === 0)
@@ -82,61 +113,65 @@ export function projectView(db, uuid, now, filter = {}) {
82
113
  logged.push(todo);
83
114
  continue;
84
115
  }
85
- if (row.heading) {
86
- const list = byHeading.get(row.heading) ?? [];
87
- list.push(todo);
88
- byHeading.set(row.heading, list);
89
- }
90
- else {
116
+ if (h !== null)
117
+ pushInto(headingItems, h, todo);
118
+ else
91
119
  active.push(todo);
92
- }
93
120
  continue;
94
121
  }
95
122
  if (row.start === 2 && row.startDate === null) {
96
- someday.push(todo);
123
+ if (h !== null)
124
+ pushInto(headingSomeday, h, todo);
125
+ else
126
+ someday.push(todo);
97
127
  continue;
98
128
  }
99
129
  if (row.startDate !== null && row.startDate > packedToday) {
100
- scheduledRows.push({
130
+ const sr = {
101
131
  date: decodePackedDate(row.startDate) ?? "",
102
132
  ti: row.todayIndex ?? 0,
103
133
  todo,
104
- });
105
- continue;
106
- }
107
- if (row.heading) {
108
- const list = byHeading.get(row.heading) ?? [];
109
- list.push(todo);
110
- byHeading.set(row.heading, list);
134
+ };
135
+ if (h !== null)
136
+ pushInto(headingScheduled, h, sr);
137
+ else
138
+ scheduledRows.push(sr);
111
139
  continue;
112
140
  }
113
- active.push(todo);
141
+ if (h !== null)
142
+ pushInto(headingItems, h, todo);
143
+ else
144
+ active.push(todo);
114
145
  }
115
146
  logged.sort((a, b) => (b.stopped?.getTime() ?? 0) - (a.stopped?.getTime() ?? 0));
116
- const scheduled = [];
117
147
  // Within a day the UI sorts by todayIndex ASC (Upcoming drag order).
118
- for (const { date, todo } of scheduledRows.toSorted((a, b) => a.date.localeCompare(b.date) || a.ti - b.ti)) {
119
- const last = scheduled[scheduled.length - 1];
120
- if (last && last.date === date)
121
- last.items.push(todo);
122
- else
123
- scheduled.push({ date, items: [todo] });
124
- }
148
+ const scheduled = groupByDate(scheduledRows);
125
149
  // Under any content scope (`--overdue` or a tag filter), a heading whose
126
150
  // children were all filtered out collapses rather than rendering an empty
127
- // section; a heading with a surviving child is kept. With no scope active
128
- // every heading renders (its own empty state).
151
+ // section; a heading with any surviving child (in ANY sub-bucket) is kept.
152
+ // With no scope active every heading renders (its own empty state).
129
153
  const contentScoped = overdue || tf.sql !== "";
130
154
  const headingGroups = headings
131
- .map((heading) => ({ heading, items: byHeading.get(heading.uuid) ?? [] }))
132
- .filter((g) => !contentScoped || g.items.length > 0);
155
+ .map((heading) => ({
156
+ heading,
157
+ items: headingItems.get(heading.uuid) ?? [],
158
+ scheduled: groupByDate(headingScheduled.get(heading.uuid) ?? []),
159
+ someday: headingSomeday.get(heading.uuid) ?? [],
160
+ repeating: headingRepeating.get(heading.uuid) ?? [],
161
+ }))
162
+ .filter((g) => !contentScoped ||
163
+ g.items.length > 0 ||
164
+ g.scheduled.length > 0 ||
165
+ g.someday.length > 0 ||
166
+ g.repeating.length > 0);
133
167
  return {
134
168
  project,
135
169
  active,
136
170
  headings: headingGroups,
137
- later: { scheduled, repeating, someday },
171
+ scheduled,
172
+ someday,
173
+ repeating,
138
174
  logged,
139
- trashed,
140
175
  openChildrenWhileResolved: project.status === "open" ? 0 : openChildren,
141
176
  };
142
177
  }
@@ -1 +1 @@
1
- {"version":3,"file":"project-view.js","sourceRoot":"","sources":["../../src/read/project-view.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAgB,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW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AC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAChE,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;QAC/C,SAAS,EAAE,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;KACpD,CAAC,CAAC;SACF,MAAM,CACL,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,aAAa;QACd,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAClB,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC;QACtB,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;QACpB,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CACzB,CAAC;IAEJ,OAAO;QACL,OAAO;QACP,MAAM;QACN,QAAQ,EAAE,aAAa;QACvB,SAAS;QACT,OAAO;QACP,SAAS;QACT,MAAM;QACN,yBAAyB,EAAE,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY;KACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The `loose` pseudo-area: a reserved, case-insensitive ref that addresses the
3
+ * NULL area (area-less items) as if it were an area, on READ surfaces only. It
4
+ * mirrors the GUI sidebar's leading loose block — area-less projects, then loose
5
+ * direct to-dos — plus the "Later Projects" someday/scheduled block under
6
+ * `--show-later`. The reserved word ALWAYS wins over a real area that happens to
7
+ * be named "Loose" (that area is reachable only by uuid); when one shadows, the
8
+ * read surfaces a resolution disclosure. Every WRITE verb and the `open` command
9
+ * refuse the reserved word by name — the pseudo-area is a derived view, not a
10
+ * mutable container.
11
+ */
12
+ import type { DatabaseSync } from "node:sqlite";
13
+ /** The reserved ref (lowercase canonical form) that names the loose pseudo-area. */
14
+ export declare const LOOSE_REF = "loose";
15
+ /** True when a ref names the reserved `loose` pseudo-area (case-insensitive, trimmed). */
16
+ export declare function isLooseRef(ref: string): boolean;
17
+ /**
18
+ * The uuid of a real area whose title case-insensitively equals the reserved
19
+ * word, if any — for the resolution-shadow disclosure. Lowest sidebar index
20
+ * wins on the (pathological) chance of duplicates. Returns undefined when no
21
+ * real area shadows the reserved word.
22
+ */
23
+ export declare function shadowingLooseArea(db: DatabaseSync): string | undefined;
24
+ /** The disclosure appended to a loose read when a real area shadows the reserved word. */
25
+ export declare function looseShadowNotice(uuid: string): string;
26
+ /** Refusal for opening the loose pseudo-area — it is a derived view, not an app screen. */
27
+ export declare const LOOSE_OPEN_REFUSAL = "the loose pseudo-area is a derived view \u2014 it cannot be opened; open a specific project or area by ref";
28
+ /** Refusal for `--to-area loose` — the reserved word is a read-only view, not a destination. */
29
+ export declare const LOOSE_TO_AREA_REFUSAL = "the loose pseudo-area is a derived view \u2014 it cannot be modified; to leave a to-do area-less use --loose (a project: --no-area), or target a real area named \"Loose\" by uuid";
@@ -0,0 +1,27 @@
1
+ /** The reserved ref (lowercase canonical form) that names the loose pseudo-area. */
2
+ export const LOOSE_REF = "loose";
3
+ /** True when a ref names the reserved `loose` pseudo-area (case-insensitive, trimmed). */
4
+ export function isLooseRef(ref) {
5
+ return ref.trim().toLowerCase() === LOOSE_REF;
6
+ }
7
+ /**
8
+ * The uuid of a real area whose title case-insensitively equals the reserved
9
+ * word, if any — for the resolution-shadow disclosure. Lowest sidebar index
10
+ * wins on the (pathological) chance of duplicates. Returns undefined when no
11
+ * real area shadows the reserved word.
12
+ */
13
+ export function shadowingLooseArea(db) {
14
+ const row = db
15
+ .prepare(`SELECT uuid FROM TMArea WHERE lower(title) = ? ORDER BY "index" ASC LIMIT 1`)
16
+ .get(LOOSE_REF);
17
+ return row?.uuid;
18
+ }
19
+ /** The disclosure appended to a loose read when a real area shadows the reserved word. */
20
+ export function looseShadowNotice(uuid) {
21
+ return `resolved to the loose pseudo-area; an area named "Loose" exists (uuid ${uuid}) — target it by uuid`;
22
+ }
23
+ /** Refusal for opening the loose pseudo-area — it is a derived view, not an app screen. */
24
+ export const LOOSE_OPEN_REFUSAL = "the loose pseudo-area is a derived view — it cannot be opened; open a specific project or area by ref";
25
+ /** Refusal for `--to-area loose` — the reserved word is a read-only view, not a destination. */
26
+ export const LOOSE_TO_AREA_REFUSAL = 'the loose pseudo-area is a derived view — it cannot be modified; to leave a to-do area-less use --loose (a project: --no-area), or target a real area named "Loose" by uuid';
27
+ //# sourceMappingURL=pseudo-area.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pseudo-area.js","sourceRoot":"","sources":["../../src/read/pseudo-area.ts"],"names":[],"mappings":"AAaA,oFAAoF;AACpF,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AAEjC,0FAA0F;AAC1F,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAgB;IACjD,MAAM,GAAG,GAAG,EAAE;SACX,OAAO,CAAC,6EAA6E,CAAC;SACtF,GAAG,CAAC,SAAS,CAAiC,CAAC;IAClD,OAAO,GAAG,EAAE,IAAI,CAAC;AACnB,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,yEAAyE,IAAI,uBAAuB,CAAC;AAC9G,CAAC;AAED,2FAA2F;AAC3F,MAAM,CAAC,MAAM,kBAAkB,GAC7B,uGAAuG,CAAC;AAE1G,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAChC,6KAA6K,CAAC"}
@@ -3,8 +3,9 @@
3
3
  * schema manifest so removed columns fail loudly (drift), never silently.
4
4
  */
5
5
  import type { DatabaseSync } from "node:sqlite";
6
- import type { Ref } from "../model/entities.ts";
6
+ import { type Ref } from "../model/entities.ts";
7
7
  import type { ChecklistRow, TaskRow } from "../model/mappers.ts";
8
+ import { type CandidateRef } from "./shape.ts";
8
9
  /** Rows that repeat via a template are normal; template rows are invisible in list views. */
9
10
  export declare const NOT_TEMPLATE = "(t.rt1_recurrenceRule IS NULL AND t.repeater IS NULL)";
10
11
  /**
@@ -83,37 +84,44 @@ export declare function stripThingsUri(ref: string): string;
83
84
  * that matches nothing reads identically wherever the miss is reported.
84
85
  */
85
86
  export declare function noUuidMatch(entity: string, ref: string): string;
86
- /** A disambiguation candidate for a reference-resolution failure. */
87
- export interface RefCandidate {
88
- uuid: string;
89
- title: string;
90
- /** Optional context that distinguishes same-named candidates (area for a project, parent path for a tag). */
91
- context?: string;
92
- }
93
87
  /**
94
88
  * A reference (uuid / partial-uuid / name) that did not resolve to exactly one
95
89
  * entity. Extends RangeError so every existing `instanceof RangeError` handler
96
90
  * keeps treating it as a usage-class failure — but the surfaces that know about
97
91
  * it (CLI --json envelope, MCP tool result) additionally lift the structured
98
- * `candidates` onto `error.details.candidates` so an agent can self-correct
92
+ * `candidates` onto `error.detail.candidates` so an agent can self-correct
99
93
  * without re-parsing the prose message. `code` mirrors the envelope error code.
100
94
  *
101
95
  * PUBLIC API — exported from src/index.ts. This is the one error the consumer
102
96
  * surfaces catch to render structured disambiguation; its `code`
103
- * ("not-found" | "ambiguous") and `candidates` ({@link RefCandidate}[]) are the
104
- * documented machine shape (docs/design/architecture.md, Consumer boundary).
97
+ * ("not-found" | "ambiguous") and `candidates` ({@link CandidateRef}[], the ONE
98
+ * fixed candidate shape) are the documented machine shape
99
+ * (docs/design/architecture.md, Consumer boundary). The list is capped at
100
+ * {@link CANDIDATE_CAP}; on overflow the `message` states the total.
105
101
  */
106
102
  export declare class ReferenceResolutionError extends RangeError {
107
103
  readonly code: "not-found" | "ambiguous";
108
104
  readonly ref: string;
109
- readonly candidates: RefCandidate[];
105
+ readonly candidates: CandidateRef[];
110
106
  constructor(message: string, opts: {
111
107
  code: "not-found" | "ambiguous";
112
108
  ref: string;
113
- candidates?: RefCandidate[];
109
+ candidates?: CandidateRef[];
114
110
  });
115
111
  }
116
- export declare function resolveTaskUuidPrefix(db: DatabaseSync, refRaw: string, entity?: string): string;
112
+ /**
113
+ * An optional membership clause (on alias `t`) restricting a resolver to
114
+ * in-scope rows — the container-scope no-oracle mechanism. When supplied, an
115
+ * out-of-scope row resolves to "not found" through the IDENTICAL code path a
116
+ * nonexistent one does, so the two are byte-indistinguishable. Built by
117
+ * `src/read/scope.ts`; queries.ts treats it as opaque SQL to avoid a runtime
118
+ * import cycle.
119
+ */
120
+ export interface ScopeClause {
121
+ where: string;
122
+ binds: (string | number)[];
123
+ }
124
+ export declare function resolveTaskUuidPrefix(db: DatabaseSync, refRaw: string, entity?: string, scope?: ScopeClause): string;
117
125
  /**
118
126
  * Fold a name to its match key: NFC + case-fold + strip all whitespace and
119
127
  * dashes/hyphens (ASCII hyphen, the U+2010–2015 dash block, U+2212 minus).
@@ -147,7 +155,21 @@ export interface NamedResolution {
147
155
  */
148
156
  export declare function resolveNamedRef(db: DatabaseSync, table: string, extraWhere: string, extraBinds: (string | number)[], refRaw: string, options?: {
149
157
  prefixTier?: boolean;
158
+ scopeWhere?: string;
159
+ scopeBinds?: (string | number)[];
160
+ /**
161
+ * An extra clause AND-ed into the NAME tiers ONLY (exact/case-insensitive/
162
+ * normalized title) — never the uuid-exact or uuid-prefix tiers. Lets a
163
+ * resolver narrow name resolution (e.g. project write targets to OPEN rows)
164
+ * while a UUID / partial-uuid — explicit intent — still reaches every row.
165
+ */
166
+ nameExtraWhere?: string;
150
167
  }): NamedResolution;
168
+ export declare function deadNameMatchHint(counts: {
169
+ trashed?: number;
170
+ logbook?: number;
171
+ completed?: number;
172
+ }): string;
151
173
  /**
152
174
  * Resolve a PROJECT write target from a uuid, partial-uuid, or unique name.
153
175
  * Project write verbs (`things project update <ref>`, etc.) accept names
@@ -159,11 +181,30 @@ export declare function resolveNamedRef(db: DatabaseSync, table: string, extraWh
159
181
  * targeted "that is a to-do, not a project" message rather than a misleading
160
182
  * not-found. Otherwise the ref resolves as a project NAME through the SAME
161
183
  * tiered {@link resolveNamedRef} matching the read side uses (shared core, not
162
- * a fork) across projects (trashed included, for `project restore`), fail-
163
- * closed with a candidate listing on an ambiguous name so a duplicated project
164
- * title is disambiguated by uuid rather than guessed.
184
+ * a fork).
185
+ *
186
+ * The NAME pool is LIVE + OPEN-scoped by default (`trashed = 0 AND status = 0`)
187
+ * — a trashed OR completed/canceled project never resolves-by-name or appears as
188
+ * an ambiguity candidate for an ordinary write verb. A completed project is
189
+ * excluded deliberately (broader than "logged", which needs the log-boundary
190
+ * clock this pure resolver lacks): placing an open child in it strands the child
191
+ * one sweep later (PLOG1). A name that matches ONLY non-open/trashed rows fails
192
+ * not-found with an honest hint (`things trash` / target-by-uuid) rather than a
193
+ * dead candidate. A UUID / partial-uuid resolves FIRST (via
194
+ * {@link resolveTaskUuidPrefix}, status-blind), so explicit-uuid intent still
195
+ * reaches a completed/logged project. `includeNonOpen` (the `project.reopen`
196
+ * verb — its whole point is a non-open target) widens the name pool to
197
+ * completed/canceled rows; `includeTrashed` (the trash-domain `project.restore`
198
+ * op) widens it to trashed rows so a restore-by-name can disambiguate them.
199
+ * Fail-closed with a candidate listing on an ambiguous name.
165
200
  */
166
- export declare function resolveProjectWriteTarget(db: DatabaseSync, refRaw: string): string;
201
+ export declare function resolveProjectWriteTarget(db: DatabaseSync, refRaw: string, scope?: {
202
+ task: ScopeClause;
203
+ named: {
204
+ where: string;
205
+ binds: (string | number)[];
206
+ };
207
+ }, includeTrashed?: boolean, includeNonOpen?: boolean): string;
167
208
  export declare function resolveTagUuid(db: DatabaseSync, ref: string): string;
168
209
  /**
169
210
  * Write destinations stay strict (a trashed project is not a valid target);
@@ -173,10 +214,37 @@ export declare function resolveTagUuid(db: DatabaseSync, ref: string): string;
173
214
  export declare function resolveProjectUuid(db: DatabaseSync, ref: string, options?: {
174
215
  trashed?: boolean;
175
216
  prefixTier?: boolean;
217
+ scopeWhere?: string;
218
+ scopeBinds?: (string | number)[];
176
219
  }): string;
177
220
  export declare function resolveAreaUuid(db: DatabaseSync, ref: string, options?: {
178
221
  prefixTier?: boolean;
222
+ scopeWhere?: string;
223
+ scopeBinds?: (string | number)[];
179
224
  }): string;
225
+ /**
226
+ * Resolve a HEADING SELECTOR (spec §2) inside one project through the SAME
227
+ * tiered core every other ref uses: exact title, or uuid (partial-uuid too).
228
+ * There is deliberately NO index/ordinal form — the "reindex hazard" makes an
229
+ * ordinal silently re-target a different heading after any reorder. An
230
+ * empty-string selector is a legal literal query (the app creates titleless
231
+ * headings); duplicates (or several titleless headings) are a resolution
232
+ * PRECONDITION, not an invariant, so ambiguity fails closed with uuid-bearing
233
+ * candidates (the H-DUPLICATE-TAG precedent). Shared by `todo add/move
234
+ * --heading` (via {@link resolveHeadingRef} → the H-AMBIGUOUS-HEADING guard)
235
+ * and by every project heading verb (via the thrower below).
236
+ */
237
+ export declare function resolveHeadingRef(db: DatabaseSync, projectUuid: string, refRaw: string): NamedResolution;
238
+ /**
239
+ * Resolve a heading selector to its uuid+title within a project, throwing a
240
+ * {@link ReferenceResolutionError} (with uuid candidates on ambiguity) the
241
+ * consumer surfaces render as a usage error. The project-scoped heading verbs
242
+ * and the MCP heading tool resolve through this.
243
+ */
244
+ export declare function resolveHeadingUuid(db: DatabaseSync, projectUuid: string, refRaw: string): {
245
+ uuid: string;
246
+ title: string;
247
+ };
180
248
  /**
181
249
  * A row's EFFECTIVE area: its own `area` link, else the area of its project,
182
250
  * else the area of its heading's project. To-dos nested in a project (or under a
@@ -193,6 +261,25 @@ export declare function resolveAreaUuid(db: DatabaseSync, ref: string, options?:
193
261
  export declare const EFFECTIVE_AREA = "COALESCE(\n t.area,\n (SELECT p.area FROM TMTask p WHERE p.uuid = t.project),\n (SELECT hp.area FROM TMTask h JOIN TMTask hp ON hp.uuid = h.project WHERE h.uuid = t.heading)\n)";
194
262
  export declare function fetchTaskRows(db: DatabaseSync, where: string, params?: unknown[]): TaskRow[];
195
263
  export declare function fetchTaskByUuid(db: DatabaseSync, uuid: string): TaskRow | null;
264
+ /**
265
+ * The uuid of a repeating template's LATEST spawned instance, or null when the
266
+ * template has none. The GUI-verified "Show Latest" law (SL1,
267
+ * docs/lab/sl1-show-latest.md, 2026-07-29): the pick is `max(creationDate)`
268
+ * among the template's instances — the most recently spawned occurrence — and
269
+ * NOTHING else. It is INDEPENDENT of `startDate`, `userModificationDate`,
270
+ * `stopDate`, and completion `status`: a completed newest-spawned instance is
271
+ * still the latest (the SL1 D1 case). No status filter; spans both to-do and
272
+ * project instances (`rt1_repeatingTemplate` points at the template regardless
273
+ * of type). `creationDate` is the occurrence midnight and unique per occurrence
274
+ * for a normal series, so ties are not expected.
275
+ *
276
+ * TRASHED instances are EXCLUDED (SL2, docs/lab/sl2-trash-dynamics.md, law L1):
277
+ * the GUI Show Latest never selects a trashed instance — it skips to the newest
278
+ * UNTRASHED one, and re-resolves live after an empty-trash. Only `trashed` is
279
+ * filtered; `status` is NOT (a COMPLETED newest-spawned instance is still the
280
+ * latest — SL1 D1). A template with no untrashed instances derives `null`.
281
+ */
282
+ export declare function latestInstanceUuid(db: DatabaseSync, templateUuid: string): string | null;
196
283
  export declare function fetchChecklistRows(db: DatabaseSync, taskUuid: string): ChecklistRow[];
197
284
  /**
198
285
  * Direct tags for a set of tasks, in one query. Returns uuid -> Ref[] in the
@@ -229,7 +316,9 @@ export declare function fetchTagsForTasks(db: DatabaseSync, taskUuids: string[])
229
316
  /**
230
317
  * Lazy heading-uuid -> owning-project Ref resolver, cached per instance.
231
318
  * Heading-nested to-dos carry project = NULL in the DB (the heading holds
232
- * the link); list views use this to surface the GUI's container label.
319
+ * the link); list views use this to surface the GUI's container label. The
320
+ * owning project's recurrence columns ride along so a to-do nested under a
321
+ * heading of a repeating-template project inherits the template mark.
233
322
  */
234
323
  export declare function makeHeadingProjectResolver(db: DatabaseSync): (headingUuid: string) => Ref | null;
235
324
  /** Lazy uuid -> Ref resolver over TMTask + TMArea titles, cached per instance. */