things-api 0.9.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 (261) hide show
  1. package/README.md +57 -12
  2. package/dist/audit/log.js +56 -2
  3. package/dist/audit/log.js.map +1 -1
  4. package/dist/audit/schema.d.ts +26 -8
  5. package/dist/audit/schema.js +42 -1
  6. package/dist/audit/schema.js.map +1 -1
  7. package/dist/cli/clock.d.ts +8 -0
  8. package/dist/cli/clock.js +24 -0
  9. package/dist/cli/clock.js.map +1 -0
  10. package/dist/cli/commands/area.d.ts +26 -3
  11. package/dist/cli/commands/area.js +129 -75
  12. package/dist/cli/commands/area.js.map +1 -1
  13. package/dist/cli/commands/doctor.d.ts +1 -1
  14. package/dist/cli/commands/doctor.js +44 -5
  15. package/dist/cli/commands/doctor.js.map +1 -1
  16. package/dist/cli/commands/install-skill.d.ts +45 -0
  17. package/dist/cli/commands/install-skill.js +207 -0
  18. package/dist/cli/commands/install-skill.js.map +1 -0
  19. package/dist/cli/commands/mcp.js +23 -4
  20. package/dist/cli/commands/mcp.js.map +1 -1
  21. package/dist/cli/commands/project.d.ts +18 -1
  22. package/dist/cli/commands/project.js +74 -35
  23. package/dist/cli/commands/project.js.map +1 -1
  24. package/dist/cli/commands/reads.d.ts +15 -2
  25. package/dist/cli/commands/reads.js +459 -165
  26. package/dist/cli/commands/reads.js.map +1 -1
  27. package/dist/cli/commands/repeat-flags.d.ts +20 -0
  28. package/dist/cli/commands/repeat-flags.js +76 -0
  29. package/dist/cli/commands/repeat-flags.js.map +1 -0
  30. package/dist/cli/commands/setup.js +8 -4
  31. package/dist/cli/commands/setup.js.map +1 -1
  32. package/dist/cli/commands/show.js +53 -30
  33. package/dist/cli/commands/show.js.map +1 -1
  34. package/dist/cli/commands/todo.d.ts +1 -1
  35. package/dist/cli/commands/todo.js +20 -13
  36. package/dist/cli/commands/todo.js.map +1 -1
  37. package/dist/cli/commands/writes.js +388 -161
  38. package/dist/cli/commands/writes.js.map +1 -1
  39. package/dist/cli/did-you-mean.d.ts +1 -1
  40. package/dist/cli/excess-args.d.ts +15 -0
  41. package/dist/cli/excess-args.js +51 -0
  42. package/dist/cli/excess-args.js.map +1 -0
  43. package/dist/cli/glyphs.d.ts +55 -2
  44. package/dist/cli/glyphs.js +114 -21
  45. package/dist/cli/glyphs.js.map +1 -1
  46. package/dist/cli/help.d.ts +54 -0
  47. package/dist/cli/help.js +405 -0
  48. package/dist/cli/help.js.map +1 -0
  49. package/dist/cli/main.js +64 -26
  50. package/dist/cli/main.js.map +1 -1
  51. package/dist/cli/move-hint.d.ts +45 -0
  52. package/dist/cli/move-hint.js +196 -0
  53. package/dist/cli/move-hint.js.map +1 -0
  54. package/dist/cli/period.d.ts +9 -8
  55. package/dist/cli/period.js +56 -30
  56. package/dist/cli/period.js.map +1 -1
  57. package/dist/cli/read-driver.d.ts +26 -19
  58. package/dist/cli/read-driver.js +77 -33
  59. package/dist/cli/read-driver.js.map +1 -1
  60. package/dist/cli/render.d.ts +92 -28
  61. package/dist/cli/render.js +333 -103
  62. package/dist/cli/render.js.map +1 -1
  63. package/dist/cli/resolve-invocation.d.ts +42 -4
  64. package/dist/cli/resolve-invocation.js +97 -14
  65. package/dist/cli/resolve-invocation.js.map +1 -1
  66. package/dist/cli/skill-check.d.ts +21 -0
  67. package/dist/cli/skill-check.js +82 -0
  68. package/dist/cli/skill-check.js.map +1 -0
  69. package/dist/cli/skill.d.ts +62 -0
  70. package/dist/cli/skill.js +142 -0
  71. package/dist/cli/skill.js.map +1 -0
  72. package/dist/cli/tag-filters.d.ts +63 -0
  73. package/dist/cli/tag-filters.js +59 -0
  74. package/dist/cli/tag-filters.js.map +1 -0
  75. package/dist/cli/verb-hint.d.ts +25 -0
  76. package/dist/cli/verb-hint.js +163 -0
  77. package/dist/cli/verb-hint.js.map +1 -0
  78. package/dist/cli/version.d.ts +4 -0
  79. package/dist/cli/version.js +18 -0
  80. package/dist/cli/version.js.map +1 -0
  81. package/dist/cli/width.d.ts +135 -0
  82. package/dist/cli/width.js +313 -0
  83. package/dist/cli/width.js.map +1 -0
  84. package/dist/client.d.ts +160 -24
  85. package/dist/client.js +132 -19
  86. package/dist/client.js.map +1 -1
  87. package/dist/config.d.ts +11 -0
  88. package/dist/config.js +3 -0
  89. package/dist/config.js.map +1 -1
  90. package/dist/contracts.d.ts +97 -17
  91. package/dist/contracts.js +44 -1
  92. package/dist/contracts.js.map +1 -1
  93. package/dist/db/fingerprint.d.ts +12 -0
  94. package/dist/db/fingerprint.js +15 -1
  95. package/dist/db/fingerprint.js.map +1 -1
  96. package/dist/db/locate.js +1 -1
  97. package/dist/db/locate.js.map +1 -1
  98. package/dist/diagnose.d.ts +63 -0
  99. package/dist/diagnose.js +38 -1
  100. package/dist/diagnose.js.map +1 -1
  101. package/dist/index.d.ts +36 -5
  102. package/dist/index.js +38 -2
  103. package/dist/index.js.map +1 -1
  104. package/dist/mcp/server.d.ts +9 -1
  105. package/dist/mcp/server.js +1038 -436
  106. package/dist/mcp/server.js.map +1 -1
  107. package/dist/model/clock.d.ts +61 -0
  108. package/dist/model/clock.js +71 -0
  109. package/dist/model/clock.js.map +1 -0
  110. package/dist/model/dates.d.ts +26 -3
  111. package/dist/model/dates.js +84 -3
  112. package/dist/model/dates.js.map +1 -1
  113. package/dist/model/entities.d.ts +48 -10
  114. package/dist/model/entities.js.map +1 -1
  115. package/dist/model/mappers.d.ts +9 -2
  116. package/dist/model/mappers.js +32 -9
  117. package/dist/model/mappers.js.map +1 -1
  118. package/dist/model/serialize.d.ts +28 -0
  119. package/dist/model/serialize.js +80 -0
  120. package/dist/model/serialize.js.map +1 -0
  121. package/dist/model/when-sugar.d.ts +47 -0
  122. package/dist/model/when-sugar.js +45 -0
  123. package/dist/model/when-sugar.js.map +1 -0
  124. package/dist/read/area-view.d.ts +8 -1
  125. package/dist/read/area-view.js +55 -17
  126. package/dist/read/area-view.js.map +1 -1
  127. package/dist/read/detail.d.ts +1 -1
  128. package/dist/read/detail.js +11 -4
  129. package/dist/read/detail.js.map +1 -1
  130. package/dist/read/filter-contract.d.ts +117 -0
  131. package/dist/read/filter-contract.js +78 -0
  132. package/dist/read/filter-contract.js.map +1 -0
  133. package/dist/read/log-boundary.d.ts +1 -1
  134. package/dist/read/log-boundary.js +13 -3
  135. package/dist/read/log-boundary.js.map +1 -1
  136. package/dist/read/predicates.d.ts +30 -0
  137. package/dist/read/predicates.js +30 -0
  138. package/dist/read/predicates.js.map +1 -1
  139. package/dist/read/project-view.d.ts +12 -1
  140. package/dist/read/project-view.js +45 -12
  141. package/dist/read/project-view.js.map +1 -1
  142. package/dist/read/queries.d.ts +152 -7
  143. package/dist/read/queries.js +277 -36
  144. package/dist/read/queries.js.map +1 -1
  145. package/dist/read/sections.d.ts +51 -0
  146. package/dist/read/sections.js +37 -0
  147. package/dist/read/sections.js.map +1 -0
  148. package/dist/read/sidebar-order.js +2 -1
  149. package/dist/read/sidebar-order.js.map +1 -1
  150. package/dist/read/snapshot.d.ts +1 -1
  151. package/dist/read/snapshot.js +9 -2
  152. package/dist/read/snapshot.js.map +1 -1
  153. package/dist/read/tags.d.ts +27 -3
  154. package/dist/read/tags.js +83 -12
  155. package/dist/read/tags.js.map +1 -1
  156. package/dist/read/truncation.d.ts +71 -0
  157. package/dist/read/{pagination.js → truncation.js} +103 -94
  158. package/dist/read/truncation.js.map +1 -0
  159. package/dist/read/views.d.ts +147 -22
  160. package/dist/read/views.js +282 -80
  161. package/dist/read/views.js.map +1 -1
  162. package/dist/surface-copy.d.ts +19 -0
  163. package/dist/surface-copy.js +32 -0
  164. package/dist/surface-copy.js.map +1 -1
  165. package/dist/sync-health.d.ts +78 -0
  166. package/dist/sync-health.js +312 -0
  167. package/dist/sync-health.js.map +1 -0
  168. package/dist/write/accessibility-probe.d.ts +12 -0
  169. package/dist/write/accessibility-probe.js +71 -0
  170. package/dist/write/accessibility-probe.js.map +1 -0
  171. package/dist/write/automation-probe.d.ts +8 -1
  172. package/dist/write/automation-probe.js +16 -1
  173. package/dist/write/automation-probe.js.map +1 -1
  174. package/dist/write/batch.js +5 -2
  175. package/dist/write/batch.js.map +1 -1
  176. package/dist/write/capabilities.d.ts +8 -0
  177. package/dist/write/capabilities.js +13 -6
  178. package/dist/write/capabilities.js.map +1 -1
  179. package/dist/write/commands.d.ts +3 -1
  180. package/dist/write/commands.js +602 -49
  181. package/dist/write/commands.js.map +1 -1
  182. package/dist/write/edit-checklist.js +3 -2
  183. package/dist/write/edit-checklist.js.map +1 -1
  184. package/dist/write/guards.d.ts +2 -7
  185. package/dist/write/guards.js +87 -6
  186. package/dist/write/guards.js.map +1 -1
  187. package/dist/write/heading.js +2 -0
  188. package/dist/write/heading.js.map +1 -1
  189. package/dist/write/lock.d.ts +40 -2
  190. package/dist/write/lock.js +91 -14
  191. package/dist/write/lock.js.map +1 -1
  192. package/dist/write/make-repeating-project.d.ts +4 -0
  193. package/dist/write/make-repeating-project.js +253 -0
  194. package/dist/write/make-repeating-project.js.map +1 -0
  195. package/dist/write/operations.d.ts +145 -1
  196. package/dist/write/operations.js +48 -0
  197. package/dist/write/operations.js.map +1 -1
  198. package/dist/write/pipeline.d.ts +73 -2
  199. package/dist/write/pipeline.js +218 -43
  200. package/dist/write/pipeline.js.map +1 -1
  201. package/dist/write/planner.js +8 -1
  202. package/dist/write/planner.js.map +1 -1
  203. package/dist/write/pre-state.d.ts +105 -3
  204. package/dist/write/pre-state.js +144 -3
  205. package/dist/write/pre-state.js.map +1 -1
  206. package/dist/write/recurrence-rule-blob.d.ts +65 -0
  207. package/dist/write/recurrence-rule-blob.js +150 -0
  208. package/dist/write/recurrence-rule-blob.js.map +1 -0
  209. package/dist/write/reopen.js +3 -2
  210. package/dist/write/reopen.js.map +1 -1
  211. package/dist/write/reorder.js +27 -17
  212. package/dist/write/reorder.js.map +1 -1
  213. package/dist/write/repeat-rule.d.ts +22 -0
  214. package/dist/write/repeat-rule.js +258 -0
  215. package/dist/write/repeat-rule.js.map +1 -0
  216. package/dist/write/reversibility.js +49 -0
  217. package/dist/write/reversibility.js.map +1 -1
  218. package/dist/write/tag-refs.d.ts +47 -0
  219. package/dist/write/tag-refs.js +126 -0
  220. package/dist/write/tag-refs.js.map +1 -0
  221. package/dist/write/undo.d.ts +74 -5
  222. package/dist/write/undo.js +493 -80
  223. package/dist/write/undo.js.map +1 -1
  224. package/dist/write/vectors/registry.d.ts +15 -1
  225. package/dist/write/vectors/registry.js +65 -2
  226. package/dist/write/vectors/registry.js.map +1 -1
  227. package/dist/write/vectors/simulator.d.ts +44 -0
  228. package/dist/write/vectors/simulator.js +1136 -0
  229. package/dist/write/vectors/simulator.js.map +1 -0
  230. package/dist/write/vectors/types.d.ts +154 -3
  231. package/dist/write/vectors/ui-certification.d.ts +54 -0
  232. package/dist/write/vectors/ui-certification.js +43 -0
  233. package/dist/write/vectors/ui-certification.js.map +1 -0
  234. package/dist/write/vectors/ui-drag.d.ts +188 -0
  235. package/dist/write/vectors/ui-drag.js +1095 -0
  236. package/dist/write/vectors/ui-drag.js.map +1 -0
  237. package/dist/write/vectors/ui-recipes.d.ts +83 -0
  238. package/dist/write/vectors/ui-recipes.js +610 -0
  239. package/dist/write/vectors/ui-recipes.js.map +1 -0
  240. package/dist/write/vectors/ui.d.ts +152 -0
  241. package/dist/write/vectors/ui.js +704 -0
  242. package/dist/write/vectors/ui.js.map +1 -0
  243. package/dist/write/verify/delta.d.ts +141 -4
  244. package/dist/write/verify/delta.js +199 -21
  245. package/dist/write/verify/delta.js.map +1 -1
  246. package/dist/write/verify/poller.d.ts +7 -1
  247. package/dist/write/verify/poller.js +21 -1
  248. package/dist/write/verify/poller.js.map +1 -1
  249. package/package.json +18 -3
  250. package/skills/things-cli/SKILL.md +53 -0
  251. package/skills/things-cli/references/contracts.md +41 -0
  252. package/skills/things-cli/references/gui.md +11 -0
  253. package/skills/things-cli/references/model.md +51 -0
  254. package/dist/cli/exit-codes.d.ts +0 -26
  255. package/dist/cli/exit-codes.js +0 -26
  256. package/dist/cli/exit-codes.js.map +0 -1
  257. package/dist/cli/output.d.ts +0 -42
  258. package/dist/cli/output.js +0 -16
  259. package/dist/cli/output.js.map +0 -1
  260. package/dist/read/pagination.d.ts +0 -104
  261. package/dist/read/pagination.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"poller.js","sourceRoot":"","sources":["../../../src/write/verify/poller.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAA+B,EAC/B,SAAiB,EACjB,OAAmB,EAAE;IAErB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1F,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC;IACtB,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IACrC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,IAAI,GAA2B,IAAI,CAAC;IAExC,SAAS,CAAC;QACR,QAAQ,IAAI,CAAC,CAAC;QACd,IAAI,GAAG,QAAQ,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,OAAO;gBACL,IAAI,EAAE,IAAI;gBACV,QAAQ;gBACR,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO;gBAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,GAAG,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;aAClF,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,GAAG,GAAG,EAAE,GAAG,OAAO,C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,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;aAC1D,CAAC;QACJ,CAAC;QACD,0HAA0H;QAC1H,MAAM,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,24 @@
1
1
  {
2
2
  "name": "things-api",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Typed TypeScript library + CLI for Things 3 (Cultured Code) — verified writes, audit trail, schema-drift detection",
5
+ "homepage": "https://github.com/mikegreiling/things-api#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/mikegreiling/things-api/issues"
8
+ },
5
9
  "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/mikegreiling/things-api.git"
13
+ },
6
14
  "bin": {
7
15
  "things": "bin/things.js"
8
16
  },
9
17
  "files": [
10
18
  "bin",
11
19
  "dist",
12
- "shortcuts"
20
+ "shortcuts",
21
+ "skills"
13
22
  ],
14
23
  "type": "module",
15
24
  "exports": {
@@ -21,7 +30,7 @@
21
30
  },
22
31
  "scripts": {
23
32
  "build": "tsc -p tsconfig.build.json",
24
- "prepublishOnly": "npm run check && npm run build",
33
+ "prepublishOnly": "npm run check && npm run build && node scripts/stamp-skill.mjs",
25
34
  "smoke:pack": "bash scripts/pack-smoke.sh",
26
35
  "typecheck": "tsc --noEmit",
27
36
  "lint": "oxlint",
@@ -33,6 +42,9 @@
33
42
  "lab:compare": "node lab/runner/main.ts compare",
34
43
  "lab:gc": "node lab/runner/main.ts gc",
35
44
  "lab:regress": "bash lab/scripts/regress.sh",
45
+ "bench": "node bench/runner.ts",
46
+ "bench:login": "node bench/login.ts",
47
+ "bench:report": "node bench/report.ts",
36
48
  "check": "npm run typecheck && npm run lint && npm run fmt:check && npm run test"
37
49
  },
38
50
  "dependencies": {
@@ -41,7 +53,10 @@
41
53
  "zod": "^4.4.3"
42
54
  },
43
55
  "devDependencies": {
56
+ "@earendil-works/pi-agent-core": "0.80.10",
57
+ "@earendil-works/pi-ai": "0.80.10",
44
58
  "@types/node": "^24.13.2",
59
+ "just-bash": "3.1.0",
45
60
  "oxfmt": "^0.57.0",
46
61
  "oxlint": "^1.72.0",
47
62
  "typescript": "^6.0.3",
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: things-cli
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.11.0
5
+ ---
6
+
7
+ # Things CLI
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 verified after they land. Use `things` when it is on your PATH; otherwise — or when `things --version` reports below **0.11.0** — substitute `npx -y things-api@latest` in every command (identical subcommands and flags), which always pairs the current commands with their current help.
10
+
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`, `output`, `repeating`, `writes`.
12
+
13
+ ## Data model (read this first)
14
+
15
+ - **To-do** — the basic item: title, notes, an optional **checklist** (sub-steps), tags, schedule, deadline, reminder. Has at most ONE container — loose in an **area**, directly in a **project**, or under a **heading** inside a project — or **none at all** (standalone to-dos are normal, like standalone projects).
16
+ - **Inbox** — not a container but the *untriaged state*: an inbox to-do has no container and no schedule. Filing it into a container or scheduling it moves it out of the Inbox; moving something back TO the Inbox un-files AND un-schedules it.
17
+ - **Project** — a goal-sized container of to-dos, optionally divided by **headings** (section labels; a heading belongs to one project and cannot hold projects). Projects live in an area or stand alone. Projects can also have their own notes, tags, schedule, and deadline.
18
+ - **Area** — a top-level bucket (e.g. a sphere of responsibility) holding projects and loose to-dos. Areas have tags but no dates.
19
+ - **Tags** — form a hierarchy, and are **inherited downward**: a to-do effectively carries its own tags plus those of its project and area. Headings carry no tags, but inheritance flows through them from project to to-do.
20
+ - **Views** are queries over this model, matching the app's sidebar: `inbox` (unsorted), `today` (scheduled for today, incl. This Evening), `upcoming` (future-dated), `anytime` (all active), `someday` (kept without a date), `logbook` (completed/canceled), `trash`.
21
+ - **Scheduling vocabulary**: an item's *when* is `today | evening | anytime | someday | YYYY-MM-DD` — where the item sits/starts. A **deadline** is a separate due date. A **reminder** is a separate time-of-day alert parameter — never write `date@time` into *when*.
22
+
23
+ ## Referring to items
24
+
25
+ Commands take a `<ref>`: a UUID, a unique UUID prefix, or a (unique) title. Ambiguous refs fail with the candidates listed — pick one and retry. Discover UUIDs via any read command; add `--json` for stable machine output (UUIDs are in `.uuid`).
26
+
27
+ ## Stable contracts
28
+
29
+ These hold regardless of the binary version; see [references/contracts.md](references/contracts.md) for the full text.
30
+
31
+ - **JSON envelope**: every `--json` response is `{ ok, data, meta }`. Read results from `.data` (usually `.data[]`), never `.items`; UUIDs are `.uuid`, not `.id`. Check `meta.truncation` before concluding "no match" or "that's everything". List/search rows are summaries whose `tags` may be incomplete — use `things show <ref> --json` for effective tags, checklist, and placement.
32
+ - **Exit codes**: `0` landed and verified · `2` usage error · `3` verify-failed. Nonzero means the change did NOT stick; the message names the fix.
33
+ - **Previews, undo & gates**: `--dry-run` shows any write's exact plan without executing; `things undo` reverses recent changes made through this tool; repeating and other disruptive operations require `--allow-disruptive`, INCLUDING their dry runs.
34
+ - **Preconditions**: referenced containers and tags must already exist — create nested structures outside-in and reuse each returned UUID.
35
+ - **Recurrence**: converting to a *fixed* repeater REPLACES the item, returning a `repeating` block — use `instanceUuid` to reach the visible occurrence and `templateUuid` for `reschedule-repeat`. Full vocabulary: `things help repeating`.
36
+ - **View reasoning from JSON**: `start:"inbox"`→Inbox, `start:"someday"`→Someday, `start:"active"` with no `startDate`→Anytime; a dated open item is Today when dated for `meta.clock.today`, else Upcoming. `todaySection` only marks placement within Today and is NOT evidence an undated item is in Today. Completed/canceled → Logbook, trashed → Trash, regardless of a stale `logged` field.
37
+ - If the user requests a JSON reply schema, return exactly that object after the read or verified write.
38
+
39
+ ## Reading
40
+
41
+ Views and lookups — pass `--json` whenever you will act on the output: `things today | inbox | upcoming | anytime | someday | logbook | trash`, `things show <ref>` (full detail incl. notes + checklist + effective tags), `things projects [ref]`, `things areas [ref]`, `things tags`, `things search <words>`, `things changes --since <moment>`. Filters (`--tag`, `--untagged`, `--overdue`, `--limit N`, …) compose with AND — see `things help filters` and [references/model.md](references/model.md).
42
+
43
+ ## Writing
44
+
45
+ Namespaced verb families — run `things <group> --help` for the verbs and `things <group> <verb> --help` for exact flags: `things todo …` (add/update/complete/cancel/reopen/move/delete/restore/tags/checklist/make-repeating), `things project …`, `things area …`, `things heading …`, `things tag …`, plus `things batch` (JSONL of many changes), `things undo`, and `things reorder`.
46
+
47
+ **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 (`--area`/`--project`/`--heading`). Per-verb preconditions and the rest of the write vocabulary: `things help writes`, `things help repeating`, [references/contracts.md](references/contracts.md).
48
+
49
+ ## Going deeper
50
+
51
+ - [references/model.md](references/model.md) — the full data model, view-membership semantics, and filters.
52
+ - [references/contracts.md](references/contracts.md) — the JSON envelope, exit codes, safety/undo/ambiguity recovery, and the recurrence contract.
53
+ - [references/gui.md](references/gui.md) — how the user sees Things in the app (where results appear, what list rows show).
@@ -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`.
@@ -1,26 +0,0 @@
1
- /**
2
- * Stable exit-code contract for the `things` CLI.
3
- *
4
- * These values are part of the public API surface consumed by agents and
5
- * scripts. They must never be renumbered; add new codes at the end.
6
- * See docs/design/contracts.md.
7
- */
8
- export declare const ExitCode: {
9
- /** Success. */
10
- readonly Ok: 0;
11
- /** Unexpected internal error (bug, unhandled condition). */
12
- readonly Unexpected: 1;
13
- /** Usage error: unknown command, bad flags, invalid arguments. */
14
- readonly Usage: 2;
15
- /** Mutation executed but read-after-write verification failed (timeout, mismatch, or silent no-op). */
16
- readonly VerifyFailed: 3;
17
- /** Mutation refused before touching the app: hazard guard or disruption-tier policy. */
18
- readonly Blocked: 4;
19
- /** Writes disabled because the database schema fingerprint deviates from the known baseline. */
20
- readonly DriftBlocked: 5;
21
- /** Operation not supported by any available write vector. */
22
- readonly Unsupported: 6;
23
- /** Environment problem: database not found, Things not installed, permissions. */
24
- readonly Environment: 7;
25
- };
26
- export type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];
@@ -1,26 +0,0 @@
1
- /**
2
- * Stable exit-code contract for the `things` CLI.
3
- *
4
- * These values are part of the public API surface consumed by agents and
5
- * scripts. They must never be renumbered; add new codes at the end.
6
- * See docs/design/contracts.md.
7
- */
8
- export const ExitCode = {
9
- /** Success. */
10
- Ok: 0,
11
- /** Unexpected internal error (bug, unhandled condition). */
12
- Unexpected: 1,
13
- /** Usage error: unknown command, bad flags, invalid arguments. */
14
- Usage: 2,
15
- /** Mutation executed but read-after-write verification failed (timeout, mismatch, or silent no-op). */
16
- VerifyFailed: 3,
17
- /** Mutation refused before touching the app: hazard guard or disruption-tier policy. */
18
- Blocked: 4,
19
- /** Writes disabled because the database schema fingerprint deviates from the known baseline. */
20
- DriftBlocked: 5,
21
- /** Operation not supported by any available write vector. */
22
- Unsupported: 6,
23
- /** Environment problem: database not found, Things not installed, permissions. */
24
- Environment: 7,
25
- };
26
- //# sourceMappingURL=exit-codes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exit-codes.js","sourceRoot":"","sources":["../../src/cli/exit-codes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,eAAe;IACf,EAAE,EAAE,CAAC;IACL,4DAA4D;IAC5D,UAAU,EAAE,CAAC;IACb,kEAAkE;IAClE,KAAK,EAAE,CAAC;IACR,uGAAuG;IACvG,YAAY,EAAE,CAAC;IACf,wFAAwF;IACxF,OAAO,EAAE,CAAC;IACV,gGAAgG;IAChG,YAAY,EAAE,CAAC;IACf,6DAA6D;IAC7D,WAAW,EAAE,CAAC;IACd,kFAAkF;IAClF,WAAW,EAAE,CAAC;CACN,CAAC"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Versioned JSON envelope emitted by every CLI command under `--json`.
3
- *
4
- * Contract (see docs/design/contracts.md):
5
- * - Envelope JSON goes to stdout; all human/log chatter goes to stderr.
6
- * - `apiVersion` is bumped only on breaking envelope-shape changes.
7
- * - `data` is command-specific; `error` is present exactly when `ok` is false.
8
- */
9
- export declare const API_VERSION = 1;
10
- export interface EnvelopeMeta {
11
- /** Things database schema version (`Meta.databaseVersion`), null when no DB was opened. */
12
- dbVersion: number | null;
13
- /** Schema fingerprint status at the time of the command. */
14
- fingerprint: "ok" | "drift" | "user-accepted" | "unknown";
15
- /** Wall-clock duration of the command in milliseconds. */
16
- elapsedMs: number;
17
- }
18
- export interface OkEnvelope<T> {
19
- apiVersion: typeof API_VERSION;
20
- ok: true;
21
- /** Discriminator naming the payload shape, e.g. "today", "mutation-result". */
22
- kind: string;
23
- data: T;
24
- meta: EnvelopeMeta;
25
- }
26
- export interface ErrorEnvelope {
27
- apiVersion: typeof API_VERSION;
28
- ok: false;
29
- kind: "error";
30
- error: {
31
- /** Stable machine-readable code, mirrors the exit-code family (e.g. "verify-failed", "blocked"). */
32
- code: string;
33
- message: string;
34
- /** Actionable next step for the caller, when one exists. */
35
- remediation?: string;
36
- detail?: unknown;
37
- };
38
- meta: EnvelopeMeta;
39
- }
40
- export type Envelope<T> = OkEnvelope<T> | ErrorEnvelope;
41
- export declare function okEnvelope<T>(kind: string, data: T, meta: EnvelopeMeta): OkEnvelope<T>;
42
- export declare function errorEnvelope(error: ErrorEnvelope["error"], meta: EnvelopeMeta): ErrorEnvelope;
@@ -1,16 +0,0 @@
1
- /**
2
- * Versioned JSON envelope emitted by every CLI command under `--json`.
3
- *
4
- * Contract (see docs/design/contracts.md):
5
- * - Envelope JSON goes to stdout; all human/log chatter goes to stderr.
6
- * - `apiVersion` is bumped only on breaking envelope-shape changes.
7
- * - `data` is command-specific; `error` is present exactly when `ok` is false.
8
- */
9
- export const API_VERSION = 1;
10
- export function okEnvelope(kind, data, meta) {
11
- return { apiVersion: API_VERSION, ok: true, kind, data, meta };
12
- }
13
- export function errorEnvelope(error, meta) {
14
- return { apiVersion: API_VERSION, ok: false, kind: "error", error, meta };
15
- }
16
- //# sourceMappingURL=output.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/cli/output.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAqC7B,MAAM,UAAU,UAAU,CAAI,IAAY,EAAE,IAAO,EAAE,IAAkB;IACrE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAA6B,EAAE,IAAkB;IAC7E,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC5E,CAAC"}
@@ -1,104 +0,0 @@
1
- /**
2
- * Shared list-view truncation: turn a full, filtered result into the rows a
3
- * surface actually shows (default 50) plus the exact {@link Pagination}
4
- * metadata every surface reports so nothing is ever silently dropped. The
5
- * limit counts ITEMS in render order and truncates mid-group; grouped shapes
6
- * (the Today split, sidebar sections) drop the trailing groups that fall
7
- * entirely past the cut so no empty header survives. `limit === null` means
8
- * "all rows" (the caller passed --all / all: true).
9
- */
10
- import type { GroupedPagination, Pagination } from "../contracts.ts";
11
- import type { Ref } from "../model/entities.ts";
12
- import type { AreaView } from "./area-view.ts";
13
- import { AREA_PREVIEW_LIMIT, DEFAULT_LIST_LIMIT, PROJECT_PREVIEW_LIMIT } from "../surface-copy.ts";
14
- import type { ListItem, SidebarSection, TodayView } from "./views.ts";
15
- export { AREA_PREVIEW_LIMIT, DEFAULT_LIST_LIMIT, PROJECT_PREVIEW_LIMIT };
16
- /**
17
- * Per-block caps for the grouped catalogues: `area` bounds each area-direct
18
- * block (and the leading loose block), `project` each project's to-do list.
19
- * `null` = uncapped (the caller passed --all / all: true, or — for someday's
20
- * active-projects section — asked for every item).
21
- */
22
- export interface GroupedLimits {
23
- area: number | null;
24
- project: number | null;
25
- }
26
- /** Flat list: slice to the limit; total is the full filtered length. */
27
- export declare function paginateList<T>(items: T[], limit: number | null): {
28
- data: T[];
29
- pagination: Pagination;
30
- };
31
- /**
32
- * Today split: the cut runs across Today then This Evening in render order,
33
- * so a limit smaller than the Today block trims Evening to nothing. The badge
34
- * (a whole-view count summary) is preserved unchanged.
35
- */
36
- export declare function paginateToday(view: TodayView, limit: number | null): {
37
- data: TodayView;
38
- pagination: Pagination;
39
- };
40
- /**
41
- * Split one sidebar section into its innermost item blocks: the direct
42
- * to-dos that precede any project row, then one block per project (the
43
- * project row plus the to-dos that follow it until the next project).
44
- */
45
- export interface SectionBlocks {
46
- direct: ListItem[];
47
- projects: Array<{
48
- project: ListItem;
49
- items: ListItem[];
50
- }>;
51
- }
52
- export declare function splitSectionBlocks(section: SidebarSection): SectionBlocks;
53
- /**
54
- * Anytime: the block skeleton is ALWAYS complete — every area header and
55
- * every project row survives — and the caps apply INDEPENDENTLY to each
56
- * innermost item list: `limits.area` to the loose block and each area's
57
- * direct to-dos, `limits.project` to each project's to-dos. Returns the
58
- * per-block-truncated sections (project rows retained) plus the per-block
59
- * counts and a top-level `truncated` flag.
60
- */
61
- export declare function previewSections(sections: SidebarSection[], limits: GroupedLimits): {
62
- data: SidebarSection[];
63
- grouped: GroupedPagination;
64
- };
65
- /**
66
- * Someday sections split differently from anytime: PROJECT rows there are
67
- * plain ITEMS (a someday project stands for itself — its children are never
68
- * inline), so a section's "own" block is its project rows + container-less
69
- * to-dos together, and the to-dos that DO carry a project reference (the
70
- * activeProjectItems toggle) form separate per-project child groups.
71
- */
72
- export interface SomedayPartition {
73
- /** Project rows + direct to-dos, in section order. */
74
- own: ListItem[];
75
- /** Someday to-dos inside active projects, clustered per project. */
76
- children: Array<{
77
- project: Ref;
78
- items: ListItem[];
79
- }>;
80
- }
81
- export declare function partitionSomedaySection(section: SidebarSection): SomedayPartition;
82
- /**
83
- * Someday preview: every group survives; `limits.area` (null = no cap)
84
- * applies independently to each section's own block (project rows + direct
85
- * to-dos are items alike there), `limits.project` to each active project's
86
- * child group (the show-active-project-items toggle). Sections keep their
87
- * capped children after the own block, still clustered per project.
88
- */
89
- export declare function previewSomedaySections(sections: SidebarSection[], limits: GroupedLimits): {
90
- data: SidebarSection[];
91
- grouped: GroupedPagination;
92
- };
93
- /**
94
- * Sectioned cap for the `area show` detail view: its sections are containers,
95
- * so there is no strict total limit — instead `limits.project` bounds the
96
- * project-ROWS section and `limits.area` the direct-to-dos section (null =
97
- * uncapped). The toggled later/logged lists and the trashed bucket pass
98
- * through untouched. Counts ride the same grouped-block shape the sidebar
99
- * catalogues emit (kind "projects" = the project-rows section).
100
- */
101
- export declare function capAreaSections(view: AreaView, limits: GroupedLimits): {
102
- data: AreaView;
103
- grouped: GroupedPagination;
104
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/read/pagination.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGnG,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AAazE,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,KAAoB,EAAc,EAAE,CAAC,CAAC;IAClE,KAAK,EAAE,KAAK;IACZ,KAAK;IACL,KAAK;IACL,SAAS,EAAE,KAAK;CACjB,CAAC,CAAC;AAEH,wEAAwE;AACxE,MAAM,UAAU,YAAY,CAC1B,KAAU,EACV,KAAoB;IAEpB,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IAC3B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9F,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,KAA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