things-api 0.8.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.
- package/README.md +31 -11
- package/dist/audit/log.js +56 -2
- package/dist/audit/log.js.map +1 -1
- package/dist/audit/schema.d.ts +26 -8
- package/dist/audit/schema.js +42 -1
- package/dist/audit/schema.js.map +1 -1
- package/dist/cli/commands/area.d.ts +34 -2
- package/dist/cli/commands/area.js +140 -28
- package/dist/cli/commands/area.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +1 -1
- package/dist/cli/commands/doctor.js +44 -5
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/mcp.js +23 -4
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/project.d.ts +23 -1
- package/dist/cli/commands/project.js +82 -15
- package/dist/cli/commands/project.js.map +1 -1
- package/dist/cli/commands/reads.d.ts +6 -125
- package/dist/cli/commands/reads.js +649 -657
- package/dist/cli/commands/reads.js.map +1 -1
- package/dist/cli/commands/repeat-flags.d.ts +20 -0
- package/dist/cli/commands/repeat-flags.js +76 -0
- package/dist/cli/commands/repeat-flags.js.map +1 -0
- package/dist/cli/commands/setup.js +2 -3
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/show.d.ts +1 -1
- package/dist/cli/commands/show.js +169 -18
- package/dist/cli/commands/show.js.map +1 -1
- package/dist/cli/commands/snapshot.js +1 -1
- package/dist/cli/commands/snapshot.js.map +1 -1
- package/dist/cli/commands/todo.d.ts +1 -1
- package/dist/cli/commands/todo.js +21 -9
- package/dist/cli/commands/todo.js.map +1 -1
- package/dist/cli/commands/writes.js +378 -148
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/did-you-mean.d.ts +29 -0
- package/dist/cli/did-you-mean.js +53 -0
- package/dist/cli/did-you-mean.js.map +1 -0
- package/dist/cli/excess-args.d.ts +15 -0
- package/dist/cli/excess-args.js +51 -0
- package/dist/cli/excess-args.js.map +1 -0
- package/dist/cli/glyphs.d.ts +67 -7
- package/dist/cli/glyphs.js +202 -19
- package/dist/cli/glyphs.js.map +1 -1
- package/dist/cli/help.d.ts +54 -0
- package/dist/cli/help.js +355 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/main.js +36 -21
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/period.d.ts +39 -0
- package/dist/cli/period.js +141 -0
- package/dist/cli/period.js.map +1 -0
- package/dist/cli/read-driver.d.ts +83 -0
- package/dist/cli/read-driver.js +215 -0
- package/dist/cli/read-driver.js.map +1 -0
- package/dist/cli/render.d.ts +246 -0
- package/dist/cli/render.js +806 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/resolve-invocation.d.ts +116 -0
- package/dist/cli/resolve-invocation.js +261 -0
- package/dist/cli/resolve-invocation.js.map +1 -0
- package/dist/cli/shell-quote.d.ts +9 -0
- package/dist/cli/shell-quote.js +12 -0
- package/dist/cli/shell-quote.js.map +1 -0
- package/dist/cli/tag-filters.d.ts +59 -0
- package/dist/cli/tag-filters.js +57 -0
- package/dist/cli/tag-filters.js.map +1 -0
- package/dist/cli/verb-hint.d.ts +25 -0
- package/dist/cli/verb-hint.js +138 -0
- package/dist/cli/verb-hint.js.map +1 -0
- package/dist/cli/width.d.ts +135 -0
- package/dist/cli/width.js +313 -0
- package/dist/cli/width.js.map +1 -0
- package/dist/client.d.ts +146 -24
- package/dist/client.js +106 -16
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +136 -1
- package/dist/contracts.js +44 -1
- package/dist/contracts.js.map +1 -1
- package/dist/db/fingerprint.d.ts +12 -0
- package/dist/db/fingerprint.js +15 -1
- package/dist/db/fingerprint.js.map +1 -1
- package/dist/db/locate.js +1 -1
- package/dist/db/locate.js.map +1 -1
- package/dist/diagnose.d.ts +63 -0
- package/dist/diagnose.js +38 -1
- package/dist/diagnose.js.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.js +35 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +9 -1
- package/dist/mcp/server.js +850 -128
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/entities.d.ts +40 -7
- package/dist/model/entities.js.map +1 -1
- package/dist/model/mappers.d.ts +7 -0
- package/dist/model/mappers.js +20 -3
- package/dist/model/mappers.js.map +1 -1
- package/dist/model/occurrences.d.ts +6 -1
- package/dist/model/occurrences.js +9 -5
- package/dist/model/occurrences.js.map +1 -1
- package/dist/model/recurrence.d.ts +17 -8
- package/dist/model/recurrence.js.map +1 -1
- package/dist/model/serialize.d.ts +28 -0
- package/dist/model/serialize.js +80 -0
- package/dist/model/serialize.js.map +1 -0
- package/dist/model/when-sugar.d.ts +47 -0
- package/dist/model/when-sugar.js +45 -0
- package/dist/model/when-sugar.js.map +1 -0
- package/dist/read/area-view.d.ts +8 -1
- package/dist/read/area-view.js +49 -13
- package/dist/read/area-view.js.map +1 -1
- package/dist/read/caps.d.ts +14 -0
- package/dist/read/caps.js +21 -0
- package/dist/read/caps.js.map +1 -0
- package/dist/read/filter-contract.d.ts +117 -0
- package/dist/read/filter-contract.js +78 -0
- package/dist/read/filter-contract.js.map +1 -0
- package/dist/read/log-boundary.d.ts +9 -4
- package/dist/read/log-boundary.js.map +1 -1
- package/dist/read/predicates.d.ts +61 -0
- package/dist/read/predicates.js +78 -0
- package/dist/read/predicates.js.map +1 -0
- package/dist/read/project-view.d.ts +12 -1
- package/dist/read/project-view.js +39 -8
- package/dist/read/project-view.js.map +1 -1
- package/dist/read/queries.d.ts +156 -8
- package/dist/read/queries.js +261 -38
- package/dist/read/queries.js.map +1 -1
- package/dist/read/search-rank.d.ts +36 -0
- package/dist/read/search-rank.js +31 -0
- package/dist/read/search-rank.js.map +1 -0
- package/dist/read/sections.d.ts +51 -0
- package/dist/read/sections.js +37 -0
- package/dist/read/sections.js.map +1 -0
- package/dist/read/show-target.d.ts +13 -4
- package/dist/read/show-target.js +11 -2
- package/dist/read/show-target.js.map +1 -1
- package/dist/read/sidebar-order.d.ts +19 -0
- package/dist/read/sidebar-order.js +93 -0
- package/dist/read/sidebar-order.js.map +1 -0
- package/dist/read/tags.d.ts +27 -3
- package/dist/read/tags.js +83 -12
- package/dist/read/tags.js.map +1 -1
- package/dist/read/truncation.d.ts +71 -0
- package/dist/read/truncation.js +217 -0
- package/dist/read/truncation.js.map +1 -0
- package/dist/read/views.d.ts +177 -19
- package/dist/read/views.js +390 -213
- package/dist/read/views.js.map +1 -1
- package/dist/surface-copy.d.ts +42 -0
- package/dist/surface-copy.js +55 -0
- package/dist/surface-copy.js.map +1 -1
- package/dist/sync-health.d.ts +78 -0
- package/dist/sync-health.js +312 -0
- package/dist/sync-health.js.map +1 -0
- package/dist/write/accessibility-probe.d.ts +12 -0
- package/dist/write/accessibility-probe.js +63 -0
- package/dist/write/accessibility-probe.js.map +1 -0
- package/dist/write/automation-probe.d.ts +7 -0
- package/dist/write/automation-probe.js +8 -1
- package/dist/write/automation-probe.js.map +1 -1
- package/dist/write/batch.js +4 -2
- package/dist/write/batch.js.map +1 -1
- package/dist/write/capabilities.d.ts +8 -0
- package/dist/write/capabilities.js +13 -5
- package/dist/write/capabilities.js.map +1 -1
- package/dist/write/commands.d.ts +2 -0
- package/dist/write/commands.js +562 -48
- package/dist/write/commands.js.map +1 -1
- package/dist/write/edit-checklist.js +3 -2
- package/dist/write/edit-checklist.js.map +1 -1
- package/dist/write/guards.d.ts +2 -7
- package/dist/write/guards.js +64 -6
- package/dist/write/guards.js.map +1 -1
- package/dist/write/heading.js +2 -0
- package/dist/write/heading.js.map +1 -1
- package/dist/write/lock.d.ts +40 -2
- package/dist/write/lock.js +91 -14
- package/dist/write/lock.js.map +1 -1
- package/dist/write/make-repeating-project.d.ts +4 -0
- package/dist/write/make-repeating-project.js +253 -0
- package/dist/write/make-repeating-project.js.map +1 -0
- package/dist/write/operations.d.ts +145 -1
- package/dist/write/operations.js +48 -0
- package/dist/write/operations.js.map +1 -1
- package/dist/write/pipeline.d.ts +19 -0
- package/dist/write/pipeline.js +109 -26
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +68 -3
- package/dist/write/pre-state.js +102 -3
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/reopen.js +3 -2
- package/dist/write/reopen.js.map +1 -1
- package/dist/write/reorder.js +27 -17
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/repeat-rule.d.ts +22 -0
- package/dist/write/repeat-rule.js +258 -0
- package/dist/write/repeat-rule.js.map +1 -0
- package/dist/write/reversibility.js +49 -0
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/tag-refs.d.ts +47 -0
- package/dist/write/tag-refs.js +126 -0
- package/dist/write/tag-refs.js.map +1 -0
- package/dist/write/undo.d.ts +74 -5
- package/dist/write/undo.js +494 -80
- package/dist/write/undo.js.map +1 -1
- package/dist/write/vectors/registry.d.ts +17 -1
- package/dist/write/vectors/registry.js +18 -2
- package/dist/write/vectors/registry.js.map +1 -1
- package/dist/write/vectors/types.d.ts +119 -3
- package/dist/write/vectors/ui-certification.d.ts +48 -0
- package/dist/write/vectors/ui-certification.js +46 -0
- package/dist/write/vectors/ui-certification.js.map +1 -0
- package/dist/write/vectors/ui-drag.d.ts +188 -0
- package/dist/write/vectors/ui-drag.js +1095 -0
- package/dist/write/vectors/ui-drag.js.map +1 -0
- package/dist/write/vectors/ui-recipes.d.ts +70 -0
- package/dist/write/vectors/ui-recipes.js +558 -0
- package/dist/write/vectors/ui-recipes.js.map +1 -0
- package/dist/write/vectors/ui.d.ts +137 -0
- package/dist/write/vectors/ui.js +656 -0
- package/dist/write/vectors/ui.js.map +1 -0
- package/dist/write/verify/delta.d.ts +31 -3
- package/dist/write/verify/delta.js +22 -6
- package/dist/write/verify/delta.js.map +1 -1
- package/dist/write/verify/poller.js +1 -0
- package/dist/write/verify/poller.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/exit-codes.d.ts +0 -26
- package/dist/cli/exit-codes.js +0 -26
- package/dist/cli/exit-codes.js.map +0 -1
- package/dist/cli/output.d.ts +0 -42
- package/dist/cli/output.js +0 -16
- package/dist/cli/output.js.map +0 -1
|
@@ -0,0 +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,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AC,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"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type GroupedTruncation, type ThingsClient, type Truncation } from "../index.ts";
|
|
2
|
+
export interface GlobalReadOpts {
|
|
3
|
+
json?: boolean;
|
|
4
|
+
db?: string;
|
|
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;
|
|
20
|
+
export interface PagedResult<T> {
|
|
21
|
+
data: T;
|
|
22
|
+
/** Flat-view truncation — carried into meta and the appended hint. */
|
|
23
|
+
truncation?: Truncation;
|
|
24
|
+
/** Grouped-view (anytime/someday) per-block truncation — carried into meta. */
|
|
25
|
+
grouped?: GroupedTruncation;
|
|
26
|
+
/**
|
|
27
|
+
* Precomputed human lines. Grouped views render inside `fn` (where the full
|
|
28
|
+
* per-block totals live) and hand the finished lines back here; when absent,
|
|
29
|
+
* `render(data)` produces them.
|
|
30
|
+
*/
|
|
31
|
+
lines?: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The shared read driver: open the client, stamp the envelope meta (including
|
|
35
|
+
* fingerprint + optional truncation), and either emit the `--json` envelope or
|
|
36
|
+
* render human lines. When `hintBase` is given and the result was truncated,
|
|
37
|
+
* the muted "N more items" hint (reconstructing the user's own invocation) is
|
|
38
|
+
* appended to the human output — never to `--json`. When `header` names a view,
|
|
39
|
+
* its title preamble leads the human output on a TTY only (viewHeaderLines).
|
|
40
|
+
*/
|
|
41
|
+
export declare function runRead<T>(opts: GlobalReadOpts, kind: string, fn: (client: ThingsClient) => PagedResult<T>, render: (data: T) => string[], hintBase?: string, header?: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Structured single-payload read: `fn` produces the whole payload, `render`
|
|
44
|
+
* turns it into human lines. Generic so `fn`'s return type flows into
|
|
45
|
+
* `render`'s parameter — the compiler verifies the renderer matches the data.
|
|
46
|
+
*/
|
|
47
|
+
export declare function withClient<T>(opts: GlobalReadOpts, kind: string, fn: (client: ThingsClient) => T, render: (data: T) => string[]): void;
|
|
48
|
+
/** Result of resolving `--limit`/`--all`; `limit: null` means every row. */
|
|
49
|
+
export type LimitResolution = {
|
|
50
|
+
ok: true;
|
|
51
|
+
limit: number | null;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Resolve the shared `--limit`/`--all` pair (flat views) into a row cap
|
|
57
|
+
* (null = no cap), writing a loud usage error and setting the exit code on
|
|
58
|
+
* bad input: `--limit` must be a positive integer, and it may not combine
|
|
59
|
+
* with `--all`.
|
|
60
|
+
*/
|
|
61
|
+
export declare function parseLimit(opts: {
|
|
62
|
+
limit?: string;
|
|
63
|
+
all?: boolean;
|
|
64
|
+
json?: boolean;
|
|
65
|
+
}): LimitResolution;
|
|
66
|
+
/**
|
|
67
|
+
* Resolve one cap flag (`--limit`, `--area-limit`, `--project-limit`) against
|
|
68
|
+
* `--all`: positive integer required, `--all` conflicts with an explicit
|
|
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.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseCap(flag: string, value: string | undefined, defaultLimit: number, all: boolean, json?: boolean): LimitResolution;
|
|
74
|
+
export { shellQuote } from "./shell-quote.ts";
|
|
75
|
+
/** Reconstruct `things <name> <flags…>`, dropping falsy/empty parts. */
|
|
76
|
+
export declare function invocation(name: string, parts: Array<string | false | undefined>): string;
|
|
77
|
+
/**
|
|
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
|
|
80
|
+
* `--limit` or `--all` is one copy-paste away. Returns null when nothing was
|
|
81
|
+
* dropped or the caller already asked for every row.
|
|
82
|
+
*/
|
|
83
|
+
export declare function truncationHint(base: string, truncation: Truncation): string | null;
|
|
@@ -0,0 +1,215 @@
|
|
|
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 { getInvocation } from "./resolve-invocation.js";
|
|
9
|
+
import { dim } from "./style.js";
|
|
10
|
+
import { viewHeaderLines } from "./render.js";
|
|
11
|
+
import { candidatesJson, DidYouMeanError, renderDidYouMean } from "./did-you-mean.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
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The shared read driver: open the client, stamp the envelope meta (including
|
|
33
|
+
* fingerprint + optional truncation), and either emit the `--json` envelope or
|
|
34
|
+
* render human lines. When `hintBase` is given and the result was truncated,
|
|
35
|
+
* the muted "N more items" hint (reconstructing the user's own invocation) is
|
|
36
|
+
* appended to the human output — never to `--json`. When `header` names a view,
|
|
37
|
+
* its title preamble leads the human output on a TTY only (viewHeaderLines).
|
|
38
|
+
*/
|
|
39
|
+
export function runRead(opts, kind, fn, render, hintBase, header) {
|
|
40
|
+
const started = Date.now();
|
|
41
|
+
// An empty --db would silently fall through to the default database path —
|
|
42
|
+
// reject it loudly instead of reading somewhere the caller did not name.
|
|
43
|
+
if (opts.db !== undefined && opts.db.trim() === "") {
|
|
44
|
+
usageError(opts, "--db requires a non-empty path");
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let client = null;
|
|
48
|
+
try {
|
|
49
|
+
client = openThings(opts.db ? { dbPath: opts.db } : {});
|
|
50
|
+
const fp = client.fingerprint();
|
|
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);
|
|
55
|
+
// The canonical command a sugar invocation normalized to — known now that
|
|
56
|
+
// `fn` has resolved any reference. Present only for the routing sugars
|
|
57
|
+
// (bare noun, keyword-in-show, uuid/share-link routing); null otherwise.
|
|
58
|
+
const resolvedCommand = getInvocation()?.canonical ?? null;
|
|
59
|
+
const meta = {
|
|
60
|
+
dbVersion: fp.observation.databaseVersion,
|
|
61
|
+
fingerprint: fp.kind === "ok" ? "ok" : fp.kind === "drift" ? "drift" : "unknown",
|
|
62
|
+
elapsedMs: Date.now() - started,
|
|
63
|
+
...(truncation !== undefined && { truncation }),
|
|
64
|
+
...(grouped !== undefined && { grouped }),
|
|
65
|
+
...(resolvedCommand !== null && { resolvedCommand }),
|
|
66
|
+
...(warnings.length > 0 && { warnings }),
|
|
67
|
+
};
|
|
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`);
|
|
73
|
+
}
|
|
74
|
+
if (opts.json) {
|
|
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`);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
const lines = precomputed ?? render(data);
|
|
82
|
+
if (truncation !== undefined && hintBase !== undefined) {
|
|
83
|
+
const hint = truncationHint(hintBase, truncation);
|
|
84
|
+
if (hint !== null)
|
|
85
|
+
lines.push("", hint);
|
|
86
|
+
}
|
|
87
|
+
// The view title preamble is a TTY-only affordance (`things inbox | grep`
|
|
88
|
+
// must stay clean) and never rides --json — both gates already hold here.
|
|
89
|
+
const withHeader = header !== undefined && process.stdout.isTTY === true
|
|
90
|
+
? [...viewHeaderLines(header), ...lines]
|
|
91
|
+
: lines;
|
|
92
|
+
// The normalized-form echo: one dim line naming the canonical command a
|
|
93
|
+
// sugar invocation resolved to, adjacent to the header. Same gates as the
|
|
94
|
+
// preamble (TTY-only, never in --json) — canonical invocations echo
|
|
95
|
+
// nothing because `resolvedCommand` is null for them.
|
|
96
|
+
const out = resolvedCommand !== null && process.stdout.isTTY === true
|
|
97
|
+
? [dim(`≡ ${resolvedCommand}`), ...withHeader]
|
|
98
|
+
: withHeader;
|
|
99
|
+
process.stdout.write(`${out.join("\n")}\n`);
|
|
100
|
+
}
|
|
101
|
+
process.exitCode = ExitCode.Ok;
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
const meta = {
|
|
105
|
+
dbVersion: null,
|
|
106
|
+
fingerprint: "unknown",
|
|
107
|
+
elapsedMs: Date.now() - started,
|
|
108
|
+
};
|
|
109
|
+
// An unresolved show/bare-noun subject carries did-you-mean candidates: a
|
|
110
|
+
// usage-level failure (exit 2) with a lite title-search fallback, not the
|
|
111
|
+
// generic unexpected path.
|
|
112
|
+
if (err instanceof DidYouMeanError) {
|
|
113
|
+
if (opts.json) {
|
|
114
|
+
process.stdout.write(`${JSON.stringify(errorEnvelope({
|
|
115
|
+
code: "not-found",
|
|
116
|
+
message: err.message,
|
|
117
|
+
details: { candidates: candidatesJson(err) },
|
|
118
|
+
}, meta))}\n`);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
process.stderr.write(`${renderDidYouMean(err).join("\n")}\n`);
|
|
122
|
+
}
|
|
123
|
+
process.exitCode = ExitCode.Usage;
|
|
124
|
+
return;
|
|
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
|
+
}
|
|
138
|
+
const isEnv = err instanceof ThingsDbNotFoundError || err instanceof ThingsDbOpenError;
|
|
139
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
140
|
+
if (opts.json) {
|
|
141
|
+
process.stdout.write(`${JSON.stringify(errorEnvelope({ code: isEnv ? "environment" : "unexpected", message }, meta))}\n`);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
process.stderr.write(`error: ${message}\n`);
|
|
145
|
+
}
|
|
146
|
+
process.exitCode = isEnv ? ExitCode.Environment : ExitCode.Unexpected;
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
client?.close();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Structured single-payload read: `fn` produces the whole payload, `render`
|
|
154
|
+
* turns it into human lines. Generic so `fn`'s return type flows into
|
|
155
|
+
* `render`'s parameter — the compiler verifies the renderer matches the data.
|
|
156
|
+
*/
|
|
157
|
+
export function withClient(opts, kind, fn, render) {
|
|
158
|
+
runRead(opts, kind, (client) => ({ data: fn(client) }), render);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Resolve the shared `--limit`/`--all` pair (flat views) into a row cap
|
|
162
|
+
* (null = no cap), writing a loud usage error and setting the exit code on
|
|
163
|
+
* bad input: `--limit` must be a positive integer, and it may not combine
|
|
164
|
+
* with `--all`.
|
|
165
|
+
*/
|
|
166
|
+
export function parseLimit(opts) {
|
|
167
|
+
return parseCap("--limit", opts.limit, DEFAULT_LIST_LIMIT, opts.all === true, opts.json === true);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Resolve one cap flag (`--limit`, `--area-limit`, `--project-limit`) against
|
|
171
|
+
* `--all`: positive integer required, `--all` conflicts with an explicit
|
|
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.
|
|
175
|
+
*/
|
|
176
|
+
export function parseCap(flag, value, defaultLimit, all, json = false) {
|
|
177
|
+
const n = value === undefined ? undefined : Number(value);
|
|
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);
|
|
181
|
+
// Conflict takes precedence over value validation (an explicit value beside
|
|
182
|
+
// --all is rejected before we scrutinize the value itself).
|
|
183
|
+
if (decision === "conflict") {
|
|
184
|
+
usageError({ json }, `${flag} and --all are mutually exclusive`);
|
|
185
|
+
return { ok: false };
|
|
186
|
+
}
|
|
187
|
+
if (n !== undefined && (!Number.isInteger(n) || n < 1)) {
|
|
188
|
+
usageError({ json }, `${flag} must be a positive integer`);
|
|
189
|
+
return { ok: false };
|
|
190
|
+
}
|
|
191
|
+
return { ok: true, limit: decision };
|
|
192
|
+
}
|
|
193
|
+
export { shellQuote } from "./shell-quote.js";
|
|
194
|
+
/** Reconstruct `things <name> <flags…>`, dropping falsy/empty parts. */
|
|
195
|
+
export function invocation(name, parts) {
|
|
196
|
+
return [
|
|
197
|
+
"things",
|
|
198
|
+
name,
|
|
199
|
+
...parts.filter((p) => typeof p === "string" && p !== ""),
|
|
200
|
+
].join(" ");
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
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
|
|
205
|
+
* `--limit` or `--all` is one copy-paste away. Returns null when nothing was
|
|
206
|
+
* dropped or the caller already asked for every row.
|
|
207
|
+
*/
|
|
208
|
+
export function truncationHint(base, truncation) {
|
|
209
|
+
if (!truncation.truncated || truncation.limit === null)
|
|
210
|
+
return null;
|
|
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\` ──`);
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=read-driver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-driver.js","sourceRoot":"","sources":["../../src/cli/read-driver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAKlB,MAAM,aAAa,CAAC;AAOrB;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,IAAwB,EACxB,OAAe,EACf,OAA4D;IAE5D,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACvB,MAAM,IAAI,GAAiB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;QACrF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CACf,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,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AM,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"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure human-rendering family for the read views: the glyph-language item
|
|
3
|
+
* formatter, the flat and grouped list renderers, the sidebar/upcoming/logbook
|
|
4
|
+
* layouts, the anytime/someday previews, and the legend. No commander and no
|
|
5
|
+
* database access — every function maps already-fetched data to output lines,
|
|
6
|
+
* so the whole module is unit-testable in isolation. UUIDs are always shown
|
|
7
|
+
* (agents and humans both need stable references); colors engage on a TTY only
|
|
8
|
+
* (../cli/style.ts).
|
|
9
|
+
*/
|
|
10
|
+
import { type GroupedLimits, type GroupedTruncation, type ListItem, type SectionCount, type SidebarSection, type TodayView } from "../index.ts";
|
|
11
|
+
import { stripSgr } from "./width.ts";
|
|
12
|
+
/**
|
|
13
|
+
* A view's TTY-only title preamble: bold view name + its dim Things deep link,
|
|
14
|
+
* then a blank line — e.g. `Anytime (things:///show?id=anytime)`. The id is the
|
|
15
|
+
* app's documented show id (identical to the command name for these views).
|
|
16
|
+
* Suppressed off a TTY so `things inbox | grep …` stays clean, and never part
|
|
17
|
+
* of `--json`; the caller gates on both.
|
|
18
|
+
*/
|
|
19
|
+
export declare function viewHeaderLines(view: 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;
|
|
22
|
+
/**
|
|
23
|
+
* The `things legend` layout: the visual language grouped into sections
|
|
24
|
+
* (`── To-dos ──`, …), each row the glyph as it actually renders (color on a
|
|
25
|
+
* TTY) followed by its meaning. Content comes straight from glyphs.ts's LEGEND
|
|
26
|
+
* table, so it can never drift from what the list renderers emit.
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderLegend(): string[];
|
|
29
|
+
export interface FormatOpts {
|
|
30
|
+
/**
|
|
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.
|
|
37
|
+
*/
|
|
38
|
+
projectTitle?: boolean;
|
|
39
|
+
/** Container uuids already implied by surrounding output — their context suffix is dropped. */
|
|
40
|
+
suppressProject?: string | null;
|
|
41
|
+
suppressArea?: string | null;
|
|
42
|
+
/** Reference instant for date-relative tokens (tests pin this; defaults to now). */
|
|
43
|
+
now?: Date;
|
|
44
|
+
/** Pre-styled Today/Evening mark (★/⏾), rendered right after the box — GUI position. */
|
|
45
|
+
mark?: string | null;
|
|
46
|
+
/** Suppress the ‹date› chip (rows under a day header already carry the date). */
|
|
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;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* One item line:
|
|
59
|
+
* `<uuid-prefix> <box> [★|⏾] [logged-date] [‹chip›] <title> [‹n›] [⍾] [≡] [≔] (container) #tags [⚑ deadline]`.
|
|
60
|
+
* Repeating templates seat ↻ INSIDE the box (`[↻]`/`(↻)`) rather than as a
|
|
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
|
|
69
|
+
* a SHORTENED uuid prefix (every command accepts unique prefixes >= 6
|
|
70
|
+
* chars); `uuidWidth` is the display length from uuidDisplayWidth — never
|
|
71
|
+
* below 8 so a copied prefix stays unique across the whole database, not
|
|
72
|
+
* just the rendered list. Tags follow the title (`#`-prefixed, green — GUI
|
|
73
|
+
* color), after the count chip (projects), notes marker, and container.
|
|
74
|
+
* Heading-nested to-dos label their parent PROJECT (via headingProject),
|
|
75
|
+
* never the heading — GUI behavior. Colors engage on a TTY only
|
|
76
|
+
* (../style.ts); `--json` always carries full uuids.
|
|
77
|
+
*/
|
|
78
|
+
export declare function formatItem(item: ListItem, uuidWidth?: number, opts?: FormatOpts): string;
|
|
79
|
+
/**
|
|
80
|
+
* Row prefix in today-aware views: yellow ★ for Today members, cyan ⏾ for
|
|
81
|
+
* effective This-Evening members (raw evening assignment counts only while
|
|
82
|
+
* startDate is exactly today — the UI's daily expiry), null otherwise.
|
|
83
|
+
*/
|
|
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;
|
|
91
|
+
/**
|
|
92
|
+
* Display width for a list's uuid column: the shortest prefix that is
|
|
93
|
+
* unique WITHIN the list, floored at UUID_DISPLAY_MIN (list-local
|
|
94
|
+
* uniqueness at 2–3 chars would still collide database-wide).
|
|
95
|
+
*/
|
|
96
|
+
export declare function uuidDisplayWidth(items: Array<{
|
|
97
|
+
uuid: string;
|
|
98
|
+
}>): number;
|
|
99
|
+
/**
|
|
100
|
+
* Fit a uuid into the shared id column: truncate to `width` when longer, pad
|
|
101
|
+
* to it when shorter, so ids line up under one another regardless of prefix
|
|
102
|
+
* length. `width` is the value from uuidDisplayWidth.
|
|
103
|
+
*/
|
|
104
|
+
export declare function uuidCol(uuid: string, width: number): string;
|
|
105
|
+
export declare function renderList(items: ListItem[]): string[];
|
|
106
|
+
/**
|
|
107
|
+
* The `things today` split. The membership glyph lives in the SECTION HEADER,
|
|
108
|
+
* not on every row — a yellow ★ in the Today header (which also carries the
|
|
109
|
+
* sidebar badge split) and a blue ⏾ in the This Evening header — so the rows
|
|
110
|
+
* drop the redundant per-item marker (the same convention that suppresses a
|
|
111
|
+
* `(project)` context inside that project's own view). Every OTHER view keeps
|
|
112
|
+
* the per-row ★/⏾, where the marker still carries information.
|
|
113
|
+
*
|
|
114
|
+
* This Evening mirrors the GUI: it renders ONLY when evening items exist —
|
|
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.
|
|
129
|
+
*/
|
|
130
|
+
export declare function renderToday(view: TodayView, sections: SectionCount[] | undefined, base: string, options?: {
|
|
131
|
+
eveningOnly?: boolean;
|
|
132
|
+
}): string[];
|
|
133
|
+
/**
|
|
134
|
+
* Search rows: a standard list row, plus — for a project surfaced by a HEADING
|
|
135
|
+
* title match — a muted `(via heading "…")` suffix crediting the heading whose
|
|
136
|
+
* text matched (the parent project row stands in for the heading; the GUI has
|
|
137
|
+
* no bare heading row). Ordinary title/notes matches render as plain rows.
|
|
138
|
+
*/
|
|
139
|
+
export declare function renderSearch(items: ListItem[]): string[];
|
|
140
|
+
/** Hidden-later counts per sidebar group (null area = the loose block). */
|
|
141
|
+
export interface LaterHints {
|
|
142
|
+
/** Sidebar-ordered, INCLUDING groups whose every project is later. */
|
|
143
|
+
groups: Array<{
|
|
144
|
+
area: {
|
|
145
|
+
uuid: string;
|
|
146
|
+
title: string;
|
|
147
|
+
} | null;
|
|
148
|
+
hidden: number;
|
|
149
|
+
}>;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The sidebar mirror for `things projects`: loose projects first (the GUI
|
|
153
|
+
* lists them above the areas), then a `── ⬡ Area ──` header per area with
|
|
154
|
+
* its projects beneath (the redundant `(Area)` suffix suppressed). Items
|
|
155
|
+
* arrive from projectsView already in sidebar order — this only inserts the
|
|
156
|
+
* headers. Denser than renderSections on purpose: no title styling and no
|
|
157
|
+
* blank line per project (every row here IS a project). With `hints`,
|
|
158
|
+
* default-hidden later projects are never silent: each group trails a muted
|
|
159
|
+
* `…n later projects` count (a later-only area still gets its header), and
|
|
160
|
+
* the output ends with the flag that reveals them.
|
|
161
|
+
*/
|
|
162
|
+
export declare function renderProjectsSidebar(items: ListItem[], hints?: LaterHints): string[];
|
|
163
|
+
/**
|
|
164
|
+
* Upcoming rows under GUI-style date headers (empty periods are simply
|
|
165
|
+
* absent), with the trailing Repeating To-Dos section: templates with no
|
|
166
|
+
* set next occurrence, carrying their waiting/paused/ended status word and
|
|
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).
|
|
174
|
+
*/
|
|
175
|
+
export declare function renderUpcoming(items: ListItem[], now?: Date): string[];
|
|
176
|
+
/**
|
|
177
|
+
* Logbook rows under GUI-style date headings, month granularity throughout
|
|
178
|
+
* — `── July ──` within the current year, `── March 2025 ──` beyond (finer
|
|
179
|
+
* than the GUI's bare per-year buckets, deliberately). Truncation past the
|
|
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).
|
|
184
|
+
*/
|
|
185
|
+
export declare function renderLogbook(items: ListItem[], now?: Date): string[];
|
|
186
|
+
/**
|
|
187
|
+
* Sidebar-grouped views (anytime/someday), rendered the way the GUI reads:
|
|
188
|
+
* the area-less block headerless first, then one `── <area> ──` header per
|
|
189
|
+
* area; inside a section, loose to-dos first, then each project GROUP — a
|
|
190
|
+
* blank line, the project's bold+underlined title row, then its members.
|
|
191
|
+
* Container names implied by the grouping are not repeated on member rows
|
|
192
|
+
* (an area header covers its rows; a project title row covers the to-dos
|
|
193
|
+
* beneath it — a clustered child whose project row is absent, e.g. under a
|
|
194
|
+
* tag filter, keeps its `(project)` suffix). `star` prefixes each item line
|
|
195
|
+
* with the Today-membership mark (★, or ⏾ for This-Evening members).
|
|
196
|
+
*/
|
|
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;
|
|
223
|
+
/**
|
|
224
|
+
* The anytime preview: the FULL block skeleton — every area header and every
|
|
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.
|
|
232
|
+
*/
|
|
233
|
+
export declare function renderAnytimePreview(sections: SidebarSection[], grouped: GroupedTruncation, limits: GroupedLimits, base: string): string[];
|
|
234
|
+
/**
|
|
235
|
+
* The someday preview, mirroring the GUI (side-by-side, 2026-07-12): inside
|
|
236
|
+
* each group the project rows render as PLAIN items — `(~)` circle, count
|
|
237
|
+
* chip, no header styling, no surrounding blank lines — listed before the
|
|
238
|
+
* direct to-dos; `limits.area` caps each group's combined list. With
|
|
239
|
+
* `showActive` (the --show-active-project-items toggle) the someday to-dos
|
|
240
|
+
* living inside active projects append as a separate trailing
|
|
241
|
+
* `── From active projects ──` section — a flat run of project-header blocks
|
|
242
|
+
* (no area grouping), each capped at `limits.project` (null = every item).
|
|
243
|
+
* When the toggle is off and such items exist, a muted bottom hint counts
|
|
244
|
+
* them and names the flag.
|
|
245
|
+
*/
|
|
246
|
+
export declare function renderSomedayPreview(sections: SidebarSection[], grouped: GroupedTruncation, limits: GroupedLimits, base: string, showActive: boolean, hiddenActiveItems: number): string[];
|