things-api 0.9.0 → 0.10.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 (214) hide show
  1. package/README.md +30 -11
  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/commands/area.d.ts +26 -3
  8. package/dist/cli/commands/area.js +125 -70
  9. package/dist/cli/commands/area.js.map +1 -1
  10. package/dist/cli/commands/doctor.d.ts +1 -1
  11. package/dist/cli/commands/doctor.js +44 -5
  12. package/dist/cli/commands/doctor.js.map +1 -1
  13. package/dist/cli/commands/mcp.js +23 -4
  14. package/dist/cli/commands/mcp.js.map +1 -1
  15. package/dist/cli/commands/project.d.ts +18 -1
  16. package/dist/cli/commands/project.js +69 -31
  17. package/dist/cli/commands/project.js.map +1 -1
  18. package/dist/cli/commands/reads.js +423 -157
  19. package/dist/cli/commands/reads.js.map +1 -1
  20. package/dist/cli/commands/repeat-flags.d.ts +20 -0
  21. package/dist/cli/commands/repeat-flags.js +76 -0
  22. package/dist/cli/commands/repeat-flags.js.map +1 -0
  23. package/dist/cli/commands/setup.js +2 -3
  24. package/dist/cli/commands/setup.js.map +1 -1
  25. package/dist/cli/commands/show.js +47 -24
  26. package/dist/cli/commands/show.js.map +1 -1
  27. package/dist/cli/commands/todo.d.ts +1 -1
  28. package/dist/cli/commands/todo.js +7 -6
  29. package/dist/cli/commands/todo.js.map +1 -1
  30. package/dist/cli/commands/writes.js +378 -148
  31. package/dist/cli/commands/writes.js.map +1 -1
  32. package/dist/cli/did-you-mean.d.ts +1 -1
  33. package/dist/cli/excess-args.d.ts +15 -0
  34. package/dist/cli/excess-args.js +51 -0
  35. package/dist/cli/excess-args.js.map +1 -0
  36. package/dist/cli/glyphs.d.ts +39 -2
  37. package/dist/cli/glyphs.js +91 -21
  38. package/dist/cli/glyphs.js.map +1 -1
  39. package/dist/cli/help.d.ts +54 -0
  40. package/dist/cli/help.js +355 -0
  41. package/dist/cli/help.js.map +1 -0
  42. package/dist/cli/main.js +32 -25
  43. package/dist/cli/main.js.map +1 -1
  44. package/dist/cli/period.d.ts +7 -0
  45. package/dist/cli/period.js +12 -0
  46. package/dist/cli/period.js.map +1 -1
  47. package/dist/cli/read-driver.d.ts +26 -19
  48. package/dist/cli/read-driver.js +67 -33
  49. package/dist/cli/read-driver.js.map +1 -1
  50. package/dist/cli/render.d.ts +92 -28
  51. package/dist/cli/render.js +318 -97
  52. package/dist/cli/render.js.map +1 -1
  53. package/dist/cli/resolve-invocation.d.ts +42 -4
  54. package/dist/cli/resolve-invocation.js +97 -14
  55. package/dist/cli/resolve-invocation.js.map +1 -1
  56. package/dist/cli/tag-filters.d.ts +59 -0
  57. package/dist/cli/tag-filters.js +57 -0
  58. package/dist/cli/tag-filters.js.map +1 -0
  59. package/dist/cli/verb-hint.d.ts +25 -0
  60. package/dist/cli/verb-hint.js +138 -0
  61. package/dist/cli/verb-hint.js.map +1 -0
  62. package/dist/cli/width.d.ts +135 -0
  63. package/dist/cli/width.js +313 -0
  64. package/dist/cli/width.js.map +1 -0
  65. package/dist/client.d.ts +137 -24
  66. package/dist/client.js +105 -16
  67. package/dist/client.js.map +1 -1
  68. package/dist/config.d.ts +11 -0
  69. package/dist/config.js +3 -0
  70. package/dist/config.js.map +1 -1
  71. package/dist/contracts.d.ts +87 -17
  72. package/dist/contracts.js +44 -1
  73. package/dist/contracts.js.map +1 -1
  74. package/dist/db/fingerprint.d.ts +12 -0
  75. package/dist/db/fingerprint.js +15 -1
  76. package/dist/db/fingerprint.js.map +1 -1
  77. package/dist/db/locate.js +1 -1
  78. package/dist/db/locate.js.map +1 -1
  79. package/dist/diagnose.d.ts +63 -0
  80. package/dist/diagnose.js +38 -1
  81. package/dist/diagnose.js.map +1 -1
  82. package/dist/index.d.ts +30 -4
  83. package/dist/index.js +35 -2
  84. package/dist/index.js.map +1 -1
  85. package/dist/mcp/server.d.ts +9 -1
  86. package/dist/mcp/server.js +691 -133
  87. package/dist/mcp/server.js.map +1 -1
  88. package/dist/model/entities.d.ts +31 -7
  89. package/dist/model/entities.js.map +1 -1
  90. package/dist/model/mappers.d.ts +7 -0
  91. package/dist/model/mappers.js +7 -2
  92. package/dist/model/mappers.js.map +1 -1
  93. package/dist/model/serialize.d.ts +28 -0
  94. package/dist/model/serialize.js +80 -0
  95. package/dist/model/serialize.js.map +1 -0
  96. package/dist/model/when-sugar.d.ts +47 -0
  97. package/dist/model/when-sugar.js +45 -0
  98. package/dist/model/when-sugar.js.map +1 -0
  99. package/dist/read/area-view.d.ts +8 -1
  100. package/dist/read/area-view.js +49 -13
  101. package/dist/read/area-view.js.map +1 -1
  102. package/dist/read/filter-contract.d.ts +117 -0
  103. package/dist/read/filter-contract.js +78 -0
  104. package/dist/read/filter-contract.js.map +1 -0
  105. package/dist/read/predicates.d.ts +30 -0
  106. package/dist/read/predicates.js +30 -0
  107. package/dist/read/predicates.js.map +1 -1
  108. package/dist/read/project-view.d.ts +12 -1
  109. package/dist/read/project-view.js +39 -8
  110. package/dist/read/project-view.js.map +1 -1
  111. package/dist/read/queries.d.ts +149 -6
  112. package/dist/read/queries.js +250 -31
  113. package/dist/read/queries.js.map +1 -1
  114. package/dist/read/sections.d.ts +51 -0
  115. package/dist/read/sections.js +37 -0
  116. package/dist/read/sections.js.map +1 -0
  117. package/dist/read/sidebar-order.js +2 -1
  118. package/dist/read/sidebar-order.js.map +1 -1
  119. package/dist/read/tags.d.ts +27 -3
  120. package/dist/read/tags.js +83 -12
  121. package/dist/read/tags.js.map +1 -1
  122. package/dist/read/truncation.d.ts +71 -0
  123. package/dist/read/{pagination.js → truncation.js} +103 -94
  124. package/dist/read/truncation.js.map +1 -0
  125. package/dist/read/views.d.ts +140 -16
  126. package/dist/read/views.js +264 -67
  127. package/dist/read/views.js.map +1 -1
  128. package/dist/surface-copy.d.ts +19 -0
  129. package/dist/surface-copy.js +32 -0
  130. package/dist/surface-copy.js.map +1 -1
  131. package/dist/sync-health.d.ts +78 -0
  132. package/dist/sync-health.js +312 -0
  133. package/dist/sync-health.js.map +1 -0
  134. package/dist/write/accessibility-probe.d.ts +12 -0
  135. package/dist/write/accessibility-probe.js +63 -0
  136. package/dist/write/accessibility-probe.js.map +1 -0
  137. package/dist/write/automation-probe.d.ts +7 -0
  138. package/dist/write/automation-probe.js +8 -1
  139. package/dist/write/automation-probe.js.map +1 -1
  140. package/dist/write/batch.js +4 -2
  141. package/dist/write/batch.js.map +1 -1
  142. package/dist/write/capabilities.d.ts +8 -0
  143. package/dist/write/capabilities.js +13 -6
  144. package/dist/write/capabilities.js.map +1 -1
  145. package/dist/write/commands.d.ts +2 -0
  146. package/dist/write/commands.js +562 -48
  147. package/dist/write/commands.js.map +1 -1
  148. package/dist/write/edit-checklist.js +3 -2
  149. package/dist/write/edit-checklist.js.map +1 -1
  150. package/dist/write/guards.d.ts +2 -7
  151. package/dist/write/guards.js +64 -6
  152. package/dist/write/guards.js.map +1 -1
  153. package/dist/write/heading.js +2 -0
  154. package/dist/write/heading.js.map +1 -1
  155. package/dist/write/lock.d.ts +40 -2
  156. package/dist/write/lock.js +91 -14
  157. package/dist/write/lock.js.map +1 -1
  158. package/dist/write/make-repeating-project.d.ts +4 -0
  159. package/dist/write/make-repeating-project.js +253 -0
  160. package/dist/write/make-repeating-project.js.map +1 -0
  161. package/dist/write/operations.d.ts +145 -1
  162. package/dist/write/operations.js +48 -0
  163. package/dist/write/operations.js.map +1 -1
  164. package/dist/write/pipeline.d.ts +19 -0
  165. package/dist/write/pipeline.js +109 -26
  166. package/dist/write/pipeline.js.map +1 -1
  167. package/dist/write/pre-state.d.ts +68 -3
  168. package/dist/write/pre-state.js +102 -3
  169. package/dist/write/pre-state.js.map +1 -1
  170. package/dist/write/reopen.js +3 -2
  171. package/dist/write/reopen.js.map +1 -1
  172. package/dist/write/reorder.js +27 -17
  173. package/dist/write/reorder.js.map +1 -1
  174. package/dist/write/repeat-rule.d.ts +22 -0
  175. package/dist/write/repeat-rule.js +258 -0
  176. package/dist/write/repeat-rule.js.map +1 -0
  177. package/dist/write/reversibility.js +49 -0
  178. package/dist/write/reversibility.js.map +1 -1
  179. package/dist/write/tag-refs.d.ts +47 -0
  180. package/dist/write/tag-refs.js +126 -0
  181. package/dist/write/tag-refs.js.map +1 -0
  182. package/dist/write/undo.d.ts +74 -5
  183. package/dist/write/undo.js +493 -80
  184. package/dist/write/undo.js.map +1 -1
  185. package/dist/write/vectors/registry.d.ts +17 -1
  186. package/dist/write/vectors/registry.js +18 -2
  187. package/dist/write/vectors/registry.js.map +1 -1
  188. package/dist/write/vectors/types.d.ts +119 -3
  189. package/dist/write/vectors/ui-certification.d.ts +48 -0
  190. package/dist/write/vectors/ui-certification.js +46 -0
  191. package/dist/write/vectors/ui-certification.js.map +1 -0
  192. package/dist/write/vectors/ui-drag.d.ts +188 -0
  193. package/dist/write/vectors/ui-drag.js +1095 -0
  194. package/dist/write/vectors/ui-drag.js.map +1 -0
  195. package/dist/write/vectors/ui-recipes.d.ts +70 -0
  196. package/dist/write/vectors/ui-recipes.js +558 -0
  197. package/dist/write/vectors/ui-recipes.js.map +1 -0
  198. package/dist/write/vectors/ui.d.ts +137 -0
  199. package/dist/write/vectors/ui.js +656 -0
  200. package/dist/write/vectors/ui.js.map +1 -0
  201. package/dist/write/verify/delta.d.ts +31 -3
  202. package/dist/write/verify/delta.js +22 -6
  203. package/dist/write/verify/delta.js.map +1 -1
  204. package/dist/write/verify/poller.js +1 -0
  205. package/dist/write/verify/poller.js.map +1 -1
  206. package/package.json +1 -1
  207. package/dist/cli/exit-codes.d.ts +0 -26
  208. package/dist/cli/exit-codes.js +0 -26
  209. package/dist/cli/exit-codes.js.map +0 -1
  210. package/dist/cli/output.d.ts +0 -42
  211. package/dist/cli/output.js +0 -16
  212. package/dist/cli/output.js.map +0 -1
  213. package/dist/read/pagination.d.ts +0 -104
  214. package/dist/read/pagination.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"period.js","sourceRoot":"","sources":["../../src/cli/period.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,GAAG;IAClB,SAAS;IACT,UAAU;IACV,OAAO;IACP,OAAO;IACP,KAAK;IACL,MAAM;IACN,MAAM;IACN,QAAQ;IACR,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;CACF,CAAC;AAEX,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAE5E,MAAM,YAAY,GAAG;IACnB,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;CACG,CAAC;AAEX,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;GAIG;AACH,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAE3C,SAAS,kBAAkB,CAAC,CAAkB,EAAE,GAAS,EAAE,IAAY;IACrE,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACxC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,IAAI,KAAK,GAAG;QAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;SACxC,IAAI,IAAI,KAAK,GAAG;QAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;SACjD,IAAI,IAAI,KAAK,GAAG;QAAE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C,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACjF,CAAC;IACD,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACtD,OAAO,EAAE,KAAK,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC9F,CAAC;IACD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACxC,OAAO,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC1E,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AACzC,CAAC"}
@@ -1,22 +1,28 @@
1
- /**
2
- * The read driver: open the client, stamp the envelope meta, and emit either
3
- * the `--json` envelope or human lines (with the TTY-only title preamble,
4
- * normalized-form echo, and truncation hint). Plus the shared `--limit`/`--all`
5
- * cap parsing and the invocation-echo helpers every read command reuses. No
6
- * commander dependency — command registration lives in the command modules.
7
- */
8
- import { type ThingsClient } from "../client.ts";
9
- import { type GroupedPagination, type Pagination } from "../contracts.ts";
1
+ import { type GroupedTruncation, type ThingsClient, type Truncation } from "../index.ts";
10
2
  export interface GlobalReadOpts {
11
3
  json?: boolean;
12
4
  db?: string;
13
5
  }
6
+ /**
7
+ * The single usage-error emitter every command surface routes flag/argument
8
+ * errors through, so `--json` is honored uniformly: under `--json` a
9
+ * `{ok:false, error:{code:"usage", …}}` envelope goes to STDOUT (machine
10
+ * consumers read one stream); otherwise the prose `error:` line goes to
11
+ * STDERR. `details` carries the same machine-readable `candidates`/`suggestions`
12
+ * shape the resolver errors use. Always sets the Usage exit code.
13
+ */
14
+ export declare function usageError(opts: {
15
+ json?: boolean;
16
+ }, message: string, details?: {
17
+ candidates?: unknown[];
18
+ suggestions?: string[];
19
+ }): void;
14
20
  export interface PagedResult<T> {
15
21
  data: T;
16
22
  /** Flat-view truncation — carried into meta and the appended hint. */
17
- pagination?: Pagination;
23
+ truncation?: Truncation;
18
24
  /** Grouped-view (anytime/someday) per-block truncation — carried into meta. */
19
- grouped?: GroupedPagination;
25
+ grouped?: GroupedTruncation;
20
26
  /**
21
27
  * Precomputed human lines. Grouped views render inside `fn` (where the full
22
28
  * per-block totals live) and hand the finished lines back here; when absent,
@@ -26,7 +32,7 @@ export interface PagedResult<T> {
26
32
  }
27
33
  /**
28
34
  * The shared read driver: open the client, stamp the envelope meta (including
29
- * fingerprint + optional pagination), and either emit the `--json` envelope or
35
+ * fingerprint + optional truncation), and either emit the `--json` envelope or
30
36
  * render human lines. When `hintBase` is given and the result was truncated,
31
37
  * the muted "N more items" hint (reconstructing the user's own invocation) is
32
38
  * appended to the human output — never to `--json`. When `header` names a view,
@@ -55,22 +61,23 @@ export type LimitResolution = {
55
61
  export declare function parseLimit(opts: {
56
62
  limit?: string;
57
63
  all?: boolean;
64
+ json?: boolean;
58
65
  }): LimitResolution;
59
66
  /**
60
67
  * Resolve one cap flag (`--limit`, `--area-limit`, `--project-limit`) against
61
68
  * `--all`: positive integer required, `--all` conflicts with an explicit
62
- * value and otherwise lifts the cap (null). The conflict/default decision is
63
- * the shared {@link resolveCap}; this surface adds the string→integer
64
- * validation and the usage-error emission.
69
+ * value and otherwise lifts the cap (null). This surface owns the string→integer
70
+ * validation and the usage-error emission; the client re-applies the same
71
+ * conflict/default semantics on the resolved value it receives.
65
72
  */
66
- export declare function parseCap(flag: string, value: string | undefined, defaultLimit: number, all: boolean): LimitResolution;
73
+ export declare function parseCap(flag: string, value: string | undefined, defaultLimit: number, all: boolean, json?: boolean): LimitResolution;
67
74
  export { shellQuote } from "./shell-quote.ts";
68
75
  /** Reconstruct `things <name> <flags…>`, dropping falsy/empty parts. */
69
76
  export declare function invocation(name: string, parts: Array<string | false | undefined>): string;
70
77
  /**
71
- * The unified truncation hint: a muted `── N more items — see more: … · all:
72
- * … ──` line whose commands echo the user's actual invocation, so a bigger
78
+ * The unified truncation hint: a muted `── N more items — see more: … · … ──`
79
+ * line whose commands echo the user's actual invocation, so a bigger
73
80
  * `--limit` or `--all` is one copy-paste away. Returns null when nothing was
74
81
  * dropped or the caller already asked for every row.
75
82
  */
76
- export declare function truncationHint(base: string, pagination: Pagination): string | null;
83
+ export declare function truncationHint(base: string, truncation: Truncation): string | null;
@@ -5,19 +5,32 @@
5
5
  * cap parsing and the invocation-echo helpers every read command reuses. No
6
6
  * commander dependency — command registration lives in the command modules.
7
7
  */
8
- import { openThings } from "../client.js";
9
- import { ThingsDbNotFoundError } from "../db/locate.js";
10
- import { ThingsDbOpenError } from "../db/connection.js";
11
8
  import { getInvocation } from "./resolve-invocation.js";
12
9
  import { dim } from "./style.js";
13
10
  import { viewHeaderLines } from "./render.js";
14
11
  import { candidatesJson, DidYouMeanError, renderDidYouMean } from "./did-you-mean.js";
15
- import { errorEnvelope, ExitCode, okEnvelope, } from "../contracts.js";
16
- import { resolveCap } from "../read/caps.js";
17
- import { DEFAULT_LIST_LIMIT } from "../read/pagination.js";
12
+ import { DEFAULT_LIST_LIMIT, errorEnvelope, ExitCode, okEnvelope, omitEmpty, openThings, ReferenceResolutionError, schemaWarnings, ThingsDbNotFoundError, ThingsDbOpenError, } from "../index.js";
13
+ /**
14
+ * The single usage-error emitter every command surface routes flag/argument
15
+ * errors through, so `--json` is honored uniformly: under `--json` a
16
+ * `{ok:false, error:{code:"usage", …}}` envelope goes to STDOUT (machine
17
+ * consumers read one stream); otherwise the prose `error:` line goes to
18
+ * STDERR. `details` carries the same machine-readable `candidates`/`suggestions`
19
+ * shape the resolver errors use. Always sets the Usage exit code.
20
+ */
21
+ export function usageError(opts, message, details) {
22
+ if (opts.json === true) {
23
+ const meta = { dbVersion: null, fingerprint: "unknown", elapsedMs: 0 };
24
+ process.stdout.write(`${JSON.stringify(errorEnvelope({ code: "usage", message, ...(details !== undefined && { details }) }, meta))}\n`);
25
+ }
26
+ else {
27
+ process.stderr.write(`error: ${message}\n`);
28
+ }
29
+ process.exitCode = ExitCode.Usage;
30
+ }
18
31
  /**
19
32
  * The shared read driver: open the client, stamp the envelope meta (including
20
- * fingerprint + optional pagination), and either emit the `--json` envelope or
33
+ * fingerprint + optional truncation), and either emit the `--json` envelope or
21
34
  * render human lines. When `hintBase` is given and the result was truncated,
22
35
  * the muted "N more items" hint (reconstructing the user's own invocation) is
23
36
  * appended to the human output — never to `--json`. When `header` names a view,
@@ -28,15 +41,17 @@ export function runRead(opts, kind, fn, render, hintBase, header) {
28
41
  // An empty --db would silently fall through to the default database path —
29
42
  // reject it loudly instead of reading somewhere the caller did not name.
30
43
  if (opts.db !== undefined && opts.db.trim() === "") {
31
- process.stderr.write("error: --db requires a non-empty path\n");
32
- process.exitCode = ExitCode.Usage;
44
+ usageError(opts, "--db requires a non-empty path");
33
45
  return;
34
46
  }
35
47
  let client = null;
36
48
  try {
37
49
  client = openThings(opts.db ? { dbPath: opts.db } : {});
38
50
  const fp = client.fingerprint();
39
- const { data, pagination, grouped, lines: precomputed } = fn(client);
51
+ // Reads never block on a schema change they warn (design decision). The
52
+ // note reuses the same cached fingerprint the write path gates on.
53
+ const warnings = schemaWarnings(client.schemaStatus());
54
+ const { data, truncation, grouped, lines: precomputed } = fn(client);
40
55
  // The canonical command a sugar invocation normalized to — known now that
41
56
  // `fn` has resolved any reference. Present only for the routing sugars
42
57
  // (bare noun, keyword-in-show, uuid/share-link routing); null otherwise.
@@ -45,20 +60,27 @@ export function runRead(opts, kind, fn, render, hintBase, header) {
45
60
  dbVersion: fp.observation.databaseVersion,
46
61
  fingerprint: fp.kind === "ok" ? "ok" : fp.kind === "drift" ? "drift" : "unknown",
47
62
  elapsedMs: Date.now() - started,
48
- ...(pagination !== undefined && { pagination }),
63
+ ...(truncation !== undefined && { truncation }),
49
64
  ...(grouped !== undefined && { grouped }),
50
65
  ...(resolvedCommand !== null && { resolvedCommand }),
66
+ ...(warnings.length > 0 && { warnings }),
51
67
  };
52
- if (fp.kind !== "ok") {
53
- process.stderr.write(`warning: schema fingerprint ${meta.fingerprint} reads best-effort, writes disabled (run \`things doctor\`)\n`);
68
+ // Human output gets the note once on STDERR (never mixed into the piped
69
+ // stdout rows); the --json envelope carries it in meta.warnings instead.
70
+ if (!opts.json) {
71
+ for (const warning of warnings)
72
+ process.stderr.write(`warning: ${warning}\n`);
54
73
  }
55
74
  if (opts.json) {
56
- process.stdout.write(`${JSON.stringify(okEnvelope(kind, data, meta))}\n`);
75
+ // Omit-empty applies to the entity/data payload only (contracts.md); the
76
+ // envelope meta/truncation is untouched, and the human render below keeps
77
+ // the full, unpruned `data`.
78
+ process.stdout.write(`${JSON.stringify(okEnvelope(kind, omitEmpty(data), meta))}\n`);
57
79
  }
58
80
  else {
59
81
  const lines = precomputed ?? render(data);
60
- if (pagination !== undefined && hintBase !== undefined) {
61
- const hint = truncationHint(hintBase, pagination);
82
+ if (truncation !== undefined && hintBase !== undefined) {
83
+ const hint = truncationHint(hintBase, truncation);
62
84
  if (hint !== null)
63
85
  lines.push("", hint);
64
86
  }
@@ -101,6 +123,18 @@ export function runRead(opts, kind, fn, render, hintBase, header) {
101
123
  process.exitCode = ExitCode.Usage;
102
124
  return;
103
125
  }
126
+ // An unresolved uuid/partial-uuid/name (ambiguous or not-found) is a
127
+ // usage-class failure carrying machine-readable candidates.
128
+ if (err instanceof ReferenceResolutionError) {
129
+ if (opts.json) {
130
+ process.stdout.write(`${JSON.stringify(errorEnvelope({ code: err.code, message: err.message, details: { candidates: err.candidates } }, meta))}\n`);
131
+ }
132
+ else {
133
+ process.stderr.write(`error: ${err.message}\n`);
134
+ }
135
+ process.exitCode = ExitCode.Usage;
136
+ return;
137
+ }
104
138
  const isEnv = err instanceof ThingsDbNotFoundError || err instanceof ThingsDbOpenError;
105
139
  const message = err instanceof Error ? err.message : String(err);
106
140
  if (opts.json) {
@@ -130,28 +164,28 @@ export function withClient(opts, kind, fn, render) {
130
164
  * with `--all`.
131
165
  */
132
166
  export function parseLimit(opts) {
133
- return parseCap("--limit", opts.limit, DEFAULT_LIST_LIMIT, opts.all === true);
167
+ return parseCap("--limit", opts.limit, DEFAULT_LIST_LIMIT, opts.all === true, opts.json === true);
134
168
  }
135
169
  /**
136
170
  * Resolve one cap flag (`--limit`, `--area-limit`, `--project-limit`) against
137
171
  * `--all`: positive integer required, `--all` conflicts with an explicit
138
- * value and otherwise lifts the cap (null). The conflict/default decision is
139
- * the shared {@link resolveCap}; this surface adds the string→integer
140
- * validation and the usage-error emission.
172
+ * value and otherwise lifts the cap (null). This surface owns the string→integer
173
+ * validation and the usage-error emission; the client re-applies the same
174
+ * conflict/default semantics on the resolved value it receives.
141
175
  */
142
- export function parseCap(flag, value, defaultLimit, all) {
176
+ export function parseCap(flag, value, defaultLimit, all, json = false) {
143
177
  const n = value === undefined ? undefined : Number(value);
144
- const decision = resolveCap(n, all, defaultLimit);
178
+ // Resolve --all/value into a cap: an explicit value beside --all is a
179
+ // conflict; --all alone lifts the cap (null); otherwise the value or default.
180
+ const decision = all && n !== undefined ? "conflict" : all ? null : (n ?? defaultLimit);
145
181
  // Conflict takes precedence over value validation (an explicit value beside
146
182
  // --all is rejected before we scrutinize the value itself).
147
183
  if (decision === "conflict") {
148
- process.stderr.write(`error: ${flag} and --all are mutually exclusive\n`);
149
- process.exitCode = ExitCode.Usage;
184
+ usageError({ json }, `${flag} and --all are mutually exclusive`);
150
185
  return { ok: false };
151
186
  }
152
187
  if (n !== undefined && (!Number.isInteger(n) || n < 1)) {
153
- process.stderr.write(`error: ${flag} must be a positive integer\n`);
154
- process.exitCode = ExitCode.Usage;
188
+ usageError({ json }, `${flag} must be a positive integer`);
155
189
  return { ok: false };
156
190
  }
157
191
  return { ok: true, limit: decision };
@@ -166,16 +200,16 @@ export function invocation(name, parts) {
166
200
  ].join(" ");
167
201
  }
168
202
  /**
169
- * The unified truncation hint: a muted `── N more items — see more: … · all:
170
- * … ──` line whose commands echo the user's actual invocation, so a bigger
203
+ * The unified truncation hint: a muted `── N more items — see more: … · … ──`
204
+ * line whose commands echo the user's actual invocation, so a bigger
171
205
  * `--limit` or `--all` is one copy-paste away. Returns null when nothing was
172
206
  * dropped or the caller already asked for every row.
173
207
  */
174
- export function truncationHint(base, pagination) {
175
- if (!pagination.truncated || pagination.limit === null)
208
+ export function truncationHint(base, truncation) {
209
+ if (!truncation.truncated || truncation.limit === null)
176
210
  return null;
177
- const more = pagination.total - pagination.shown;
178
- const bigger = pagination.limit * 2;
179
- return dim(`── ${more} more item${more === 1 ? "" : "s"} — see more: \`${base} --limit ${bigger}\` · all: \`${base} --all\` ──`);
211
+ const more = truncation.total - truncation.shown;
212
+ const bigger = truncation.limit * 2;
213
+ return dim(`── ${more} more item${more === 1 ? "" : "s"} — see more: \`${base} --limit ${bigger}\` · \`${base} --all\` ──`);
180
214
  }
181
215
  //# sourceMappingURL=read-driver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-driver.js","sourceRoot":"","sources":["../../src/cli/read-driver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,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E;AACxE,MAAM,UAAU,UAAU,CAAC,IAAY,EAAE,KAAwC;IAC/E,OAAO;QACL,QAAQ;QACR,IAAI;QACJ,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;KACvE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,UAAsB;IACjE,IAAI,CAAC,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IACjD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC;IACpC,OAAO,GAAG,CACR,MAAM,IAAI,aAAa,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,kBAAkB,IAAI,YAAY,MAAM,UAAU,IAAI,aAAa,CAChH,CAAC;AACJ,CAAC"}
@@ -7,8 +7,8 @@
7
7
  * (agents and humans both need stable references); colors engage on a TTY only
8
8
  * (../cli/style.ts).
9
9
  */
10
- import { type ListItem, type SidebarSection, type TodayView } from "../read/views.ts";
11
- import { type GroupedLimits } from "../read/pagination.ts";
10
+ import { type GroupedLimits, type GroupedTruncation, type ListItem, type SectionCount, type SidebarSection, type TodayView } from "../index.ts";
11
+ import { stripSgr } from "./width.ts";
12
12
  /**
13
13
  * A view's TTY-only title preamble: bold view name + its dim Things deep link,
14
14
  * then a blank line — e.g. `Anytime (things:///show?id=anytime)`. The id is the
@@ -17,7 +17,8 @@ import { type GroupedLimits } from "../read/pagination.ts";
17
17
  * of `--json`; the caller gates on both.
18
18
  */
19
19
  export declare function viewHeaderLines(view: string): string[];
20
- export declare const stripAnsi: (s: string) => string;
20
+ /** Re-export the canonical ANSI-stripper (impl in ./width.ts) the legend and `--json` legend path use it. */
21
+ export declare const stripAnsi: typeof stripSgr;
21
22
  /**
22
23
  * The `things legend` layout: the visual language grouped into sections
23
24
  * (`── To-dos ──`, …), each row the glyph as it actually renders (color on a
@@ -27,8 +28,12 @@ export declare const stripAnsi: (s: string) => string;
27
28
  export declare function renderLegend(): string[];
28
29
  export interface FormatOpts {
29
30
  /**
30
- * Render a grouped project TITLE row: bold+underlined title (the GUI's
31
- * project-header look) — the circle glyph and count chip still apply.
31
+ * Render this project as a group HEADING: underline the title (its heading
32
+ * ROLE — the project heads the to-do group beneath it, anytime/someday).
33
+ * Bold is UNIVERSAL for project titles (projectTitleAccent, the render-
34
+ * language delta-1 law), so this adds ONLY the underline; the circle glyph
35
+ * and count chip still apply. A plain project ROW (e.g. area-detail's top
36
+ * projects, the projects sidebar) omits this — bold without underline.
32
37
  */
33
38
  projectTitle?: boolean;
34
39
  /** Container uuids already implied by surrounding output — their context suffix is dropped. */
@@ -38,20 +43,29 @@ export interface FormatOpts {
38
43
  now?: Date;
39
44
  /** Pre-styled Today/Evening mark (★/⏾), rendered right after the box — GUI position. */
40
45
  mark?: string | null;
41
- /** Dim status word after the box (the GUI's waiting/paused/ended chips on repeating templates). */
42
- statusWord?: string;
43
46
  /** Suppress the ‹date› chip (rows under a day header already carry the date). */
44
47
  hideDateChip?: boolean;
48
+ /**
49
+ * The container's normal IS the resolved state (the Logbook): completed rows
50
+ * render plain and canceled rows keep their strikethrough but drop the dim —
51
+ * a row marks only its DEVIATIONS from the container. Mixed contexts
52
+ * (project/area show, search --logged/--trashed) omit this, so a resolved row
53
+ * among open ones stays dim/dim-strike. Never changes the status GLYPHS.
54
+ */
55
+ resolvedNormal?: boolean;
45
56
  }
46
57
  /**
47
58
  * One item line:
48
59
  * `<uuid-prefix> <box> [★|⏾] [logged-date] [‹chip›] <title> [‹n›] [⍾] [≡] [≔] (container) #tags [⚑ deadline]`.
49
60
  * Repeating templates seat ↻ INSIDE the box (`[↻]`/`(↻)`) rather than as a
50
- * separate mark; open project rows render their circle and title blue.
51
- * The box is the glyph-language state carrier (../glyphs.ts): `[ ]`-family
52
- * for to-dos, `( )`-family for projects state survives with color
53
- * stripped. Completed titles dim; canceled titles dim+strike (the `[×]`
54
- * mark keeps the state when strike/ANSI is unavailable). Human output shows
61
+ * separate mark; open project circles render blue, and project TITLES render
62
+ * bold + default-colored in every state (projectTitleAccent the render-
63
+ * language law). The box is the glyph-language state carrier (../glyphs.ts):
64
+ * `[ ]`-family for to-dos, `( )`-family for projects — state survives with
65
+ * color stripped. Completed titles dim; canceled titles dim+strike (the `[×]`
66
+ * mark keeps the state when strike/ANSI is unavailable) — except where a view
67
+ * declares resolved its norm (Logbook, `resolvedNormal`), where completed is
68
+ * plain and canceled keeps only its strike. Human output shows
55
69
  * a SHORTENED uuid prefix (every command accepts unique prefixes >= 6
56
70
  * chars); `uuidWidth` is the display length from uuidDisplayWidth — never
57
71
  * below 8 so a copied prefix stays unique across the whole database, not
@@ -68,6 +82,12 @@ export declare function formatItem(item: ListItem, uuidWidth?: number, opts?: Fo
68
82
  * startDate is exactly today — the UI's daily expiry), null otherwise.
69
83
  */
70
84
  export declare function todayMark(item: ListItem, now?: Date): string | null;
85
+ /** Minimum displayed-prefix length: shorter prefixes collide across the DB. */
86
+ export declare const UUID_DISPLAY_MIN = 8;
87
+ /** The full-form TTY row floor — worst-case furniture + full deadline. See {@link computeFitFloors}. */
88
+ export declare const FULL_FIT_FLOOR: number;
89
+ /** The compact-form TTY row floor — worst-case furniture + compact deadline. See {@link computeFitFloors}. */
90
+ export declare const COMPACT_FIT_FLOOR: number;
71
91
  /**
72
92
  * Display width for a list's uuid column: the shortest prefix that is
73
93
  * unique WITHIN the list, floored at UUID_DISPLAY_MIN (list-local
@@ -92,15 +112,24 @@ export declare function renderList(items: ListItem[]): string[];
92
112
  * the per-row ★/⏾, where the marker still carries information.
93
113
  *
94
114
  * This Evening mirrors the GUI: it renders ONLY when evening items exist —
95
- * a truly-empty evening has no header at all. `full` is the pre-cap view and
96
- * `shown` the rows that survived the global `--limit`; the split lets the
97
- * section stay honest under truncation. When the cap hid some or all evening
98
- * rows, an honest muted hint counts the hidden ones and names the `--limit`
99
- * that reveals them never the misleading `(empty)` a truncated evening used
100
- * to show. `base` is the user's own invocation (flags echoed). The global
101
- * footer (row driver) still reports the whole-view remainder separately.
115
+ * a truly-empty evening has no header at all. `view` is the rows that survived
116
+ * the global `--limit`; `sections` is the metadata's pre-cap per-section counts
117
+ * ({@link SectionCount}) the Today/This-Evening totals the hint math needs, so
118
+ * the section stays honest under truncation without a pre-cap copy of the view.
119
+ * When the cap hid some or all evening rows, an honest muted hint counts the
120
+ * hidden ones and points at the isolated `--evening` view never the misleading
121
+ * `(empty)` a truncated evening used to show. (In `--evening` mode that pointer
122
+ * is redundant, so the hint keeps the `--limit`/`--all` levers instead.) `base`
123
+ * is the user's own invocation (flags echoed). The global footer (row driver)
124
+ * still reports the whole-view remainder separately.
125
+ *
126
+ * `options.eveningOnly` (the `--evening` section filter) renders ONLY the This
127
+ * Evening block — the Today header and its `(empty)` placeholder are suppressed
128
+ * because that section is deliberately filtered out, not merely empty.
102
129
  */
103
- export declare function renderToday(full: TodayView, shown: TodayView, base: string): string[];
130
+ export declare function renderToday(view: TodayView, sections: SectionCount[] | undefined, base: string, options?: {
131
+ eveningOnly?: boolean;
132
+ }): string[];
104
133
  /**
105
134
  * Search rows: a standard list row, plus — for a project surfaced by a HEADING
106
135
  * title match — a muted `(via heading "…")` suffix crediting the heading whose
@@ -136,6 +165,12 @@ export declare function renderProjectsSidebar(items: ListItem[], hints?: LaterHi
136
165
  * absent), with the trailing Repeating To-Dos section: templates with no
137
166
  * set next occurrence, carrying their waiting/paused/ended status word and
138
167
  * the bare ⚑ when the rule will assign a deadline per occurrence.
168
+ *
169
+ * Deadline-forecast rows (UPC1) keep startDate=null but carry a real future
170
+ * deadline; they group under their DEADLINE date via COALESCE(startDate,
171
+ * deadline) — no when-date pill (the header carries the date; formatItem's
172
+ * chip keys on startDate, so a null-startDate row shows only the ⚑ deadline
173
+ * flag, mirroring the GUI's bare-flag anatomy).
139
174
  */
140
175
  export declare function renderUpcoming(items: ListItem[], now?: Date): string[];
141
176
  /**
@@ -143,6 +178,9 @@ export declare function renderUpcoming(items: ListItem[], now?: Date): string[];
143
178
  * — `── July ──` within the current year, `── March 2025 ──` beyond (finer
144
179
  * than the GUI's bare per-year buckets, deliberately). Truncation past the
145
180
  * row limit is reported by the shared hint the command appends, not here.
181
+ * Resolved is the Logbook's NORM, so rows pass `resolvedNormal`: completed
182
+ * titles render plain and canceled titles keep their strikethrough but drop
183
+ * the dim (the blue `[✓]`/`[×]` marks and logged date are unchanged).
146
184
  */
147
185
  export declare function renderLogbook(items: ListItem[], now?: Date): string[];
148
186
  /**
@@ -157,16 +195,42 @@ export declare function renderLogbook(items: ListItem[], now?: Date): string[];
157
195
  * with the Today-membership mark (★, or ⏾ for This-Evening members).
158
196
  */
159
197
  export declare function renderSections(sections: SidebarSection[], star?: boolean): string[];
198
+ /** Single-quote a title for a copy-pasteable drill-down command. */
199
+ export declare function quoteTitle(title: string): string;
200
+ /**
201
+ * The one disclosure-hint grammar (docs/design/render-language.md § Disclosure
202
+ * hints): a muted `… <count> <noun> — [label:] `command` [· [label:] `command`]`.
203
+ * Every muted hint that discloses more content routes through here so the
204
+ * grammar lives in ONE place (the same one-law pattern as projectTitleAccent).
205
+ *
206
+ * `count` pluralizes `noun` (pass a `{ one, many }` pair when the plural is not
207
+ * a trailing `s`); each action is a FULL command echoing the user's own
208
+ * invocation, and a `label` prefixes an action only where it adds semantics the
209
+ * command text doesn't carry (e.g. `recent:` before a capped `--show-logged`).
210
+ * `indent` marks a TRUNCATION FOOTER — two spaces under its partially-shown
211
+ * section — whereas a HIDDEN-SECTION placeholder stays flush at the position
212
+ * its unrendered section would occupy.
213
+ */
214
+ export declare function disclosureHint(count: number, noun: string | {
215
+ one: string;
216
+ many: string;
217
+ }, actions: Array<{
218
+ label?: string;
219
+ command: string;
220
+ }>, opts?: {
221
+ indent?: boolean;
222
+ }): string;
160
223
  /**
161
224
  * The anytime preview: the FULL block skeleton — every area header and every
162
- * project row — always renders; `limits.area` caps the loose block and each
163
- * area's direct to-dos, `limits.project` each project's to-dos. A truncated
164
- * block trails a muted `… N more — \`things (project|area) show '…'\``
165
- * drill-down (the loose block has no container, so it shows only the count),
166
- * and the view ends with one line escalating the caps that hit. Today members
167
- * are starred. Mirrors renderSections' layout exactly.
225
+ * project row — always renders; the `sections` are the already-bounded view
226
+ * and `grouped` the per-block metadata that carries each block's pre-cap total,
227
+ * so a truncated block trails a muted `… N more — \`things (project|area) show
228
+ * '…'\`` drill-down (the loose block has no container, so it shows only the
229
+ * count), and the view ends with one line escalating the caps that hit
230
+ * (`limits` supplies the doubling). Today members are starred. Mirrors
231
+ * renderSections' layout exactly.
168
232
  */
169
- export declare function renderAnytimePreview(sections: SidebarSection[], limits: GroupedLimits, base: string): string[];
233
+ export declare function renderAnytimePreview(sections: SidebarSection[], grouped: GroupedTruncation, limits: GroupedLimits, base: string): string[];
170
234
  /**
171
235
  * The someday preview, mirroring the GUI (side-by-side, 2026-07-12): inside
172
236
  * each group the project rows render as PLAIN items — `(~)` circle, count
@@ -179,4 +243,4 @@ export declare function renderAnytimePreview(sections: SidebarSection[], limits:
179
243
  * When the toggle is off and such items exist, a muted bottom hint counts
180
244
  * them and names the flag.
181
245
  */
182
- export declare function renderSomedayPreview(sections: SidebarSection[], limits: GroupedLimits, base: string, showActive: boolean, hiddenActiveItems: number): string[];
246
+ export declare function renderSomedayPreview(sections: SidebarSection[], grouped: GroupedTruncation, limits: GroupedLimits, base: string, showActive: boolean, hiddenActiveItems: number): string[];