things-api 0.11.0 → 0.13.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 +16 -5
- package/dist/audit/schema.d.ts +7 -0
- package/dist/audit/schema.js.map +1 -1
- package/dist/cli/canonical-ref.d.ts +21 -0
- package/dist/cli/canonical-ref.js +23 -0
- package/dist/cli/canonical-ref.js.map +1 -0
- package/dist/cli/commands/area.d.ts +18 -11
- package/dist/cli/commands/area.js +81 -77
- package/dist/cli/commands/area.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +1 -2
- package/dist/cli/commands/doctor.js +11 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/install-skill.d.ts +19 -4
- package/dist/cli/commands/install-skill.js +130 -52
- package/dist/cli/commands/install-skill.js.map +1 -1
- package/dist/cli/commands/mcp.js +21 -1
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/project.d.ts +1 -0
- package/dist/cli/commands/project.js +92 -48
- package/dist/cli/commands/project.js.map +1 -1
- package/dist/cli/commands/reads.d.ts +5 -1
- package/dist/cli/commands/reads.js +110 -31
- package/dist/cli/commands/reads.js.map +1 -1
- package/dist/cli/commands/setup.js +11 -4
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/show.js +75 -36
- package/dist/cli/commands/show.js.map +1 -1
- package/dist/cli/commands/todo.js +2 -2
- package/dist/cli/commands/todo.js.map +1 -1
- package/dist/cli/commands/writes.js +795 -144
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/did-you-mean.d.ts +14 -3
- package/dist/cli/did-you-mean.js +44 -7
- package/dist/cli/did-you-mean.js.map +1 -1
- package/dist/cli/dry-run.d.ts +55 -0
- package/dist/cli/dry-run.js +92 -0
- package/dist/cli/dry-run.js.map +1 -0
- package/dist/cli/glyphs.d.ts +16 -2
- package/dist/cli/glyphs.js +60 -12
- package/dist/cli/glyphs.js.map +1 -1
- package/dist/cli/help.js +69 -13
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/main.js +8 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/move-hint.d.ts +3 -2
- package/dist/cli/move-hint.js +2 -2
- package/dist/cli/move-hint.js.map +1 -1
- package/dist/cli/read-driver.d.ts +53 -5
- package/dist/cli/read-driver.js +82 -15
- package/dist/cli/read-driver.js.map +1 -1
- package/dist/cli/ref-render.d.ts +14 -0
- package/dist/cli/ref-render.js +9 -0
- package/dist/cli/ref-render.js.map +1 -0
- package/dist/cli/render.d.ts +40 -14
- package/dist/cli/render.js +128 -55
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/resolve-invocation.d.ts +7 -5
- package/dist/cli/resolve-invocation.js +16 -7
- package/dist/cli/resolve-invocation.js.map +1 -1
- package/dist/cli/skill-check.d.ts +12 -6
- package/dist/cli/skill-check.js +31 -14
- package/dist/cli/skill-check.js.map +1 -1
- package/dist/cli/skill.d.ts +8 -0
- package/dist/cli/skill.js +10 -0
- package/dist/cli/skill.js.map +1 -1
- package/dist/cli/verb-hint.js +1 -1
- package/dist/cli/verb-hint.js.map +1 -1
- package/dist/client.d.ts +158 -26
- package/dist/client.js +254 -38
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +66 -2
- package/dist/config.js +120 -12
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +187 -28
- package/dist/contracts.js +22 -1
- package/dist/contracts.js.map +1 -1
- package/dist/db/baselines/db-v26.js +4 -1
- package/dist/db/baselines/db-v26.js.map +1 -1
- package/dist/diagnose.d.ts +34 -2
- package/dist/diagnose.js +36 -1
- package/dist/diagnose.js.map +1 -1
- package/dist/index.d.ts +21 -8
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +9 -0
- package/dist/mcp/server.js +790 -322
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/entities.d.ts +57 -4
- package/dist/model/entities.js.map +1 -1
- package/dist/model/mappers.d.ts +2 -0
- package/dist/model/mappers.js +44 -2
- package/dist/model/mappers.js.map +1 -1
- package/dist/model/recurrence.d.ts +8 -1
- package/dist/model/recurrence.js.map +1 -1
- package/dist/model/serialize.js +15 -3
- package/dist/model/serialize.js.map +1 -1
- package/dist/read/area-filter.d.ts +76 -0
- package/dist/read/area-filter.js +58 -0
- package/dist/read/area-filter.js.map +1 -0
- package/dist/read/area-view.d.ts +22 -11
- package/dist/read/area-view.js +54 -28
- package/dist/read/area-view.js.map +1 -1
- package/dist/read/detail.js +15 -8
- package/dist/read/detail.js.map +1 -1
- package/dist/read/predicates.d.ts +18 -0
- package/dist/read/predicates.js +19 -0
- package/dist/read/predicates.js.map +1 -1
- package/dist/read/project-view.d.ts +91 -15
- package/dist/read/project-view.js +135 -37
- package/dist/read/project-view.js.map +1 -1
- package/dist/read/pseudo-area.d.ts +29 -0
- package/dist/read/pseudo-area.js +27 -0
- package/dist/read/pseudo-area.js.map +1 -0
- package/dist/read/queries.d.ts +175 -19
- package/dist/read/queries.js +376 -32
- package/dist/read/queries.js.map +1 -1
- package/dist/read/scope.d.ts +126 -0
- package/dist/read/scope.js +161 -0
- package/dist/read/scope.js.map +1 -0
- package/dist/read/search-rank.d.ts +2 -5
- package/dist/read/shape.d.ts +181 -0
- package/dist/read/shape.js +737 -0
- package/dist/read/shape.js.map +1 -0
- package/dist/read/show-target.d.ts +9 -1
- package/dist/read/show-target.js +77 -17
- package/dist/read/show-target.js.map +1 -1
- package/dist/read/stage.d.ts +199 -0
- package/dist/read/stage.js +125 -0
- package/dist/read/stage.js.map +1 -0
- package/dist/read/truncation.d.ts +7 -12
- package/dist/read/truncation.js +56 -21
- package/dist/read/truncation.js.map +1 -1
- package/dist/read/views.d.ts +68 -16
- package/dist/read/views.js +206 -52
- package/dist/read/views.js.map +1 -1
- package/dist/surface-copy.d.ts +16 -0
- package/dist/surface-copy.js +16 -0
- package/dist/surface-copy.js.map +1 -1
- package/dist/write/batch.d.ts +49 -10
- package/dist/write/batch.js +423 -71
- package/dist/write/batch.js.map +1 -1
- package/dist/write/commands.js +268 -55
- package/dist/write/commands.js.map +1 -1
- package/dist/write/guards.d.ts +1 -1
- package/dist/write/guards.js +71 -10
- package/dist/write/guards.js.map +1 -1
- package/dist/write/heading.d.ts +10 -1
- package/dist/write/heading.js +35 -5
- package/dist/write/heading.js.map +1 -1
- package/dist/write/make-repeating-project.d.ts +2 -2
- package/dist/write/make-repeating-project.js +9 -9
- package/dist/write/make-repeating-project.js.map +1 -1
- package/dist/write/move.d.ts +134 -0
- package/dist/write/move.js +1874 -0
- package/dist/write/move.js.map +1 -0
- package/dist/write/operations.d.ts +105 -19
- package/dist/write/operations.js +56 -7
- package/dist/write/operations.js.map +1 -1
- package/dist/write/opid.d.ts +31 -0
- package/dist/write/opid.js +30 -0
- package/dist/write/opid.js.map +1 -0
- package/dist/write/pipeline.d.ts +70 -3
- package/dist/write/pipeline.js +198 -33
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +172 -8
- package/dist/write/pre-state.js +467 -25
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/reorder.d.ts +23 -3
- package/dist/write/reorder.js +2106 -86
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/reversibility.js +19 -7
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/scope-guard.d.ts +31 -0
- package/dist/write/scope-guard.js +162 -0
- package/dist/write/scope-guard.js.map +1 -0
- package/dist/write/undo.js +120 -13
- package/dist/write/undo.js.map +1 -1
- package/dist/write/vectors/applescript.js +16 -7
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/shortcuts.js +1 -1
- package/dist/write/vectors/shortcuts.js.map +1 -1
- package/dist/write/vectors/simulator.js +83 -27
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/types.d.ts +11 -0
- package/dist/write/vectors/ui-certification.d.ts +3 -3
- package/dist/write/vectors/ui-certification.js +41 -5
- package/dist/write/vectors/ui-certification.js.map +1 -1
- package/dist/write/vectors/ui-drag.d.ts +21 -1
- package/dist/write/vectors/ui-drag.js +138 -27
- package/dist/write/vectors/ui-drag.js.map +1 -1
- package/dist/write/vectors/ui-recipes.d.ts +21 -1
- package/dist/write/vectors/ui-recipes.js +166 -7
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +25 -1
- package/dist/write/vectors/ui.js +142 -33
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/verify/delta.d.ts +17 -1
- package/dist/write/verify/delta.js +106 -29
- package/dist/write/verify/delta.js.map +1 -1
- package/package.json +7 -1
- package/schema/envelope.schema.json +397 -0
- package/skills/things-cli/SKILL.md +36 -17
- package/skills/things-cli/references/banner.md +35 -0
- package/skills/things-cli/references/contracts.md +32 -9
- package/skills/things-cli/references/errors.md +57 -0
- package/skills/things-cli/references/gui.md +1 -1
- package/skills/things-cli/references/model.md +18 -7
- package/skills/things-cli/references/ordering.md +88 -0
package/dist/read/truncation.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { localToday } from "../model/dates.js";
|
|
2
2
|
import { isActiveProjectRow } from "./area-view.js";
|
|
3
3
|
import { AREA_PREVIEW_LIMIT, DEFAULT_LIST_LIMIT, PROJECT_PREVIEW_LIMIT } from "../surface-copy.js";
|
|
4
|
+
import { entityWhen } from "./stage.js";
|
|
4
5
|
import { partitionSomedaySection, splitSectionBlocks } from "./sections.js";
|
|
5
6
|
// The per-block cap shape and the structural section splitters live in
|
|
6
7
|
// ./sections.ts (imported for capping here). Re-exported so existing importers
|
|
@@ -13,6 +14,26 @@ const whole = (total, limit) => ({
|
|
|
13
14
|
limit,
|
|
14
15
|
truncated: false,
|
|
15
16
|
});
|
|
17
|
+
/**
|
|
18
|
+
* Roll a grouped view's per-block counts up into the unified {@link Truncation}
|
|
19
|
+
* envelope: `shown`/`total` sum every block's own rows plus its nested children,
|
|
20
|
+
* `limit` is null (a grouped view's caps are per-block, not a single row cap),
|
|
21
|
+
* and `blocks` carries the identity-bearing nesting for a consumer that wants
|
|
22
|
+
* the detail. `truncated` is the OR across the blocks (computed by the caller).
|
|
23
|
+
*/
|
|
24
|
+
function groupedTruncation(blocks, truncated) {
|
|
25
|
+
let shown = 0;
|
|
26
|
+
let total = 0;
|
|
27
|
+
for (const b of blocks) {
|
|
28
|
+
shown += b.shown;
|
|
29
|
+
total += b.total;
|
|
30
|
+
for (const c of b.children ?? []) {
|
|
31
|
+
shown += c.shown;
|
|
32
|
+
total += c.total;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return { shown, total, limit: null, truncated, blocks };
|
|
36
|
+
}
|
|
16
37
|
/** Flat list: slice to the limit; total is the full filtered length. */
|
|
17
38
|
export function truncateList(items, limit) {
|
|
18
39
|
const total = items.length;
|
|
@@ -24,16 +45,19 @@ export function truncateList(items, limit) {
|
|
|
24
45
|
};
|
|
25
46
|
}
|
|
26
47
|
/**
|
|
27
|
-
* Today
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
48
|
+
* Today view: the flat `items[]` is sliced in comparator order (Today-proper and
|
|
49
|
+
* This-Evening members interleaved by their SQL position), so a limit smaller
|
|
50
|
+
* than the Today-proper run trims the trailing This-Evening members. The
|
|
51
|
+
* whole-view `counts` aggregate is preserved unchanged. The truncation carries a
|
|
52
|
+
* per-render-section (`today`/`evening`) shown/total breakdown — derived per row
|
|
53
|
+
* from `when` (the SAME axis the wire and the TTY split on) — so the renderer can
|
|
31
54
|
* keep This Evening honest under the single global cap without a pre-cap copy.
|
|
32
55
|
*/
|
|
56
|
+
const isEveningRow = (i) => entityWhen(i) === "evening";
|
|
33
57
|
export function truncateToday(view, limit) {
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
58
|
+
const eveningTotal = view.items.filter(isEveningRow).length;
|
|
59
|
+
const total = view.items.length;
|
|
60
|
+
const todayTotal = total - eveningTotal;
|
|
37
61
|
const sections = (shownToday, shownEvening) => [
|
|
38
62
|
{ key: "today", shown: shownToday, total: todayTotal },
|
|
39
63
|
{ key: "evening", shown: shownEvening, total: eveningTotal },
|
|
@@ -44,17 +68,17 @@ export function truncateToday(view, limit) {
|
|
|
44
68
|
truncation: { ...whole(total, limit), sections: sections(todayTotal, eveningTotal) },
|
|
45
69
|
};
|
|
46
70
|
}
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
71
|
+
const items = view.items.slice(0, limit);
|
|
72
|
+
const shownEvening = items.filter(isEveningRow).length;
|
|
73
|
+
const shownToday = items.length - shownEvening;
|
|
50
74
|
return {
|
|
51
|
-
data: {
|
|
75
|
+
data: { items, counts: view.counts },
|
|
52
76
|
truncation: {
|
|
53
|
-
shown,
|
|
77
|
+
shown: items.length,
|
|
54
78
|
total,
|
|
55
79
|
limit,
|
|
56
80
|
truncated: true,
|
|
57
|
-
sections: sections(
|
|
81
|
+
sections: sections(shownToday, shownEvening),
|
|
58
82
|
},
|
|
59
83
|
};
|
|
60
84
|
}
|
|
@@ -108,7 +132,7 @@ export function previewSections(sections, limits) {
|
|
|
108
132
|
}
|
|
109
133
|
outSections.push({ area: section.area, items });
|
|
110
134
|
}
|
|
111
|
-
return { data: outSections,
|
|
135
|
+
return { data: outSections, truncation: groupedTruncation(blocks, truncated) };
|
|
112
136
|
}
|
|
113
137
|
/**
|
|
114
138
|
* Someday preview: every group survives; `limits.area` (null = no cap)
|
|
@@ -159,7 +183,7 @@ export function previewSomedaySections(sections, limits) {
|
|
|
159
183
|
}
|
|
160
184
|
outSections.push({ area: section.area, items });
|
|
161
185
|
}
|
|
162
|
-
return { data: outSections,
|
|
186
|
+
return { data: outSections, truncation: groupedTruncation(blocks, truncated) };
|
|
163
187
|
}
|
|
164
188
|
/**
|
|
165
189
|
* Sectioned cap for the `area show` detail view: its sections are containers,
|
|
@@ -169,7 +193,9 @@ export function previewSomedaySections(sections, limits) {
|
|
|
169
193
|
* rows are capped, while its future-scheduled and someday project rows always
|
|
170
194
|
* survive (the card renders them under its uncapped Upcoming/Someday sections),
|
|
171
195
|
* so the human view derives entirely from this bounded shape. The toggled
|
|
172
|
-
* later
|
|
196
|
+
* later list passes through untouched (the area carries no logged/trashed
|
|
197
|
+
* buckets — the logbook is `things logbook --area`, trash is `things trash`).
|
|
198
|
+
* Counts ride
|
|
173
199
|
* the same grouped-block shape the sidebar catalogues emit (kind "projects" =
|
|
174
200
|
* the active project-rows section). `now` classifies the schedule split.
|
|
175
201
|
*/
|
|
@@ -192,8 +218,8 @@ export function capAreaSections(view, limits, now, zone) {
|
|
|
192
218
|
truncated = true;
|
|
193
219
|
blocks.push({
|
|
194
220
|
kind: "projects",
|
|
195
|
-
ref: view.area
|
|
196
|
-
title: view.area
|
|
221
|
+
ref: view.area?.uuid ?? null,
|
|
222
|
+
title: view.area?.title ?? null,
|
|
197
223
|
shown: shownActive,
|
|
198
224
|
total: activeTotal,
|
|
199
225
|
limit: limits.project,
|
|
@@ -205,13 +231,22 @@ export function capAreaSections(view, limits, now, zone) {
|
|
|
205
231
|
truncated = true;
|
|
206
232
|
blocks.push({
|
|
207
233
|
kind: "area",
|
|
208
|
-
ref: view.area
|
|
209
|
-
title: view.area
|
|
234
|
+
ref: view.area?.uuid ?? null,
|
|
235
|
+
title: view.area?.title ?? null,
|
|
210
236
|
shown: active.length,
|
|
211
237
|
total: view.active.length,
|
|
212
238
|
limit: limits.area,
|
|
213
239
|
});
|
|
214
240
|
}
|
|
215
|
-
|
|
241
|
+
// The flat wire `items[]` mirrors the same cut: drop exactly the open/current
|
|
242
|
+
// direct to-dos the `active` cap removed (the "area" block reports them), so the
|
|
243
|
+
// wire item list and the truncation agree. The scheduled/someday/repeating
|
|
244
|
+
// direct to-dos always survive (they are the "later" rows the TTY toggles).
|
|
245
|
+
const droppedActive = new Set(view.active.slice(active.length).map((t) => t.uuid));
|
|
246
|
+
const items = view.items.filter((t) => !droppedActive.has(t.uuid));
|
|
247
|
+
return {
|
|
248
|
+
data: { ...view, projects, active, items },
|
|
249
|
+
truncation: groupedTruncation(blocks, truncated),
|
|
250
|
+
};
|
|
216
251
|
}
|
|
217
252
|
//# sourceMappingURL=truncation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"truncation.js","sourceRoot":"","sources":["../../src/read/truncation.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAiB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEnG,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAsB,MAAM,eAAe,CAAC;AAEhG,uEAAuE;AACvE,+EAA+E;AAC/E,yDAAyD;AACzD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAsB,CAAC;AAE3E,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,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC;QAC3B,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;KAC5D,CAAC;AACJ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CAAsB,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,OAAO;QACL,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE;QAC1C,UAAU,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC;KACjD,CAAC;AACJ,CAAC"}
|
package/dist/read/views.d.ts
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* List views mirroring the Things sidebar. Predicates derived from the
|
|
3
3
|
* validated research plus live probes (docs/atlas/schema-v26.md):
|
|
4
4
|
*
|
|
5
|
-
* - inbox: start=0
|
|
5
|
+
* - inbox: start=0, MINUS due-deadline-pulled undated rows (BANNER1 Q1b:
|
|
6
|
+
* a due/overdue unsuppressed deadline removes an undated Inbox row
|
|
7
|
+
* from the GUI Inbox list and files it under Today/Anytime, even
|
|
8
|
+
* while raw `start` still reads 0 — DEADLINE_PULLED, predicates.ts)
|
|
6
9
|
* - today: (startDate <= today AND start IN (1, 2)) OR a DUE DEADLINE
|
|
7
10
|
* with no startDate — a due/overdue deadline pulls an item into
|
|
8
11
|
* Today even from the Inbox; a FUTURE startDate suppresses it
|
|
@@ -35,7 +38,11 @@
|
|
|
35
38
|
* - anytime: ALL active items — unscheduled PLUS Today members (the UI
|
|
36
39
|
* renders Today members with a star; live-verified via screenshot
|
|
37
40
|
* 2026-07-02: starred = in Today, unstarred = unscheduled).
|
|
38
|
-
* Star equivalence: startDate != NULL && <= today.
|
|
41
|
+
* Star equivalence: startDate != NULL && <= today. Anytime is a
|
|
42
|
+
* SUPERSET of Today's to-dos (BANNER1b): a due-deadline pull re-files
|
|
43
|
+
* an undated Inbox/Someday row INTO Anytime (out of its origin
|
|
44
|
+
* bucket) even while raw `start` still reads 0/2 — so membership is
|
|
45
|
+
* ANYTIME_SELF OR DEADLINE_PULLED (predicates.ts).
|
|
39
46
|
* CONTAINER CASCADE (live-verified 2026-07-09): children of a
|
|
40
47
|
* project that is not itself anytime-visible (someday/future/
|
|
41
48
|
* logged/trashed) are excluded — the project row represents
|
|
@@ -67,7 +74,11 @@
|
|
|
67
74
|
* rt1_nextInstanceStartDate (UI parity; opt out via
|
|
68
75
|
* repeats:false). Occurrence deadline = start − rule.ts
|
|
69
76
|
* (instance-validated 2026-07-04).
|
|
70
|
-
* - someday: start=2 AND startDate IS NULL,
|
|
77
|
+
* - someday: start=2 AND startDate IS NULL, MINUS due-deadline-pulled rows
|
|
78
|
+
* (BANNER1 Q1b: a due/overdue unsuppressed deadline removes an
|
|
79
|
+
* undated Someday row from the GUI Someday list and files it under
|
|
80
|
+
* Today/Anytime — DEADLINE_PULLED, predicates.ts); container-less
|
|
81
|
+
* members only
|
|
71
82
|
* (project children appear ONLY via the activeProjectItems
|
|
72
83
|
* toggle, and only for anytime-active projects — mirrors the
|
|
73
84
|
* UI's "Show items from active projects"). Grouped in sidebar
|
|
@@ -157,19 +168,31 @@ export declare function tagFilter(db: DatabaseSync, filter: ViewFilter | undefin
|
|
|
157
168
|
binds: string[];
|
|
158
169
|
};
|
|
159
170
|
export interface TodayView {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
171
|
+
/**
|
|
172
|
+
* One flat list of every Today member in comparator order (the SQL ORDER BY),
|
|
173
|
+
* Today-proper and This-Evening members interleaved by their position — each
|
|
174
|
+
* row carries its `when` (`"today"` / `"evening"`), so the This-Evening
|
|
175
|
+
* sub-region is the `when === "evening"` subset, recoverable per row (the TTY
|
|
176
|
+
* re-projects the two render sections from it). Doctrine: JSON models semantic
|
|
177
|
+
* state (the flat members + their `when`); the Today/Evening split is GUI
|
|
178
|
+
* placement, derived from `when`, not a wire bucket.
|
|
179
|
+
*/
|
|
180
|
+
items: ListItem[];
|
|
181
|
+
/**
|
|
182
|
+
* The two whole-view aggregate counts (the app's sidebar count): open members
|
|
183
|
+
* whose deadline is due/overdue vs. the rest. A convenience aggregate carried
|
|
184
|
+
* on `meta.counts`, never a bucket — every input is on the rows.
|
|
185
|
+
*/
|
|
186
|
+
counts: {
|
|
164
187
|
dueOrOverdue: number;
|
|
165
188
|
other: number;
|
|
166
189
|
};
|
|
167
190
|
}
|
|
168
191
|
export interface TodayFilter extends ViewFilter {
|
|
169
192
|
/**
|
|
170
|
-
* Restrict to the This-Evening section:
|
|
171
|
-
*
|
|
172
|
-
*
|
|
193
|
+
* Restrict to the This-Evening section: only `when === "evening"` members are
|
|
194
|
+
* returned and the counts cover only those members. A section visibility
|
|
195
|
+
* toggle, not a volume change — the row limit still applies.
|
|
173
196
|
*/
|
|
174
197
|
eveningOnly?: boolean;
|
|
175
198
|
}
|
|
@@ -264,6 +287,14 @@ export interface LogbookFilter extends ViewFilter {
|
|
|
264
287
|
until?: Date;
|
|
265
288
|
}
|
|
266
289
|
export declare function logbookView(db: DatabaseSync, now?: Date, options?: LogbookFilter, zone?: string): ListItem[];
|
|
290
|
+
/**
|
|
291
|
+
* A cheap COUNT of one area's logged rows — the SAME subtree-inclusive scope
|
|
292
|
+
* (own area OR containing project's area) and log-move boundary logbookView
|
|
293
|
+
* applies, without materializing a single row. Feeds the `area show` TTY card's
|
|
294
|
+
* live logbook-footer count; real areas only (the loose pseudo-area accumulates
|
|
295
|
+
* no `logbook --area` archive).
|
|
296
|
+
*/
|
|
297
|
+
export declare function areaLoggedCount(db: DatabaseSync, areaUuid: string, now?: Date, zone?: string): number;
|
|
267
298
|
export declare function trashView(db: DatabaseSync, now?: Date, options?: {
|
|
268
299
|
limit?: number | null;
|
|
269
300
|
}, zone?: string): ListItem[];
|
|
@@ -279,7 +310,7 @@ export interface SearchOptions extends ViewFilter {
|
|
|
279
310
|
limit?: number | null;
|
|
280
311
|
/** Restrict to one project's children (headed children included). */
|
|
281
312
|
project?: string;
|
|
282
|
-
/** Restrict to one area's direct members. */
|
|
313
|
+
/** Restrict to one area's subtree (direct members plus its projects' children). Uuid or unique name. */
|
|
283
314
|
area?: string;
|
|
284
315
|
type?: "to-do" | "project";
|
|
285
316
|
/** Include completed/canceled items (default: open only). */
|
|
@@ -318,16 +349,37 @@ export interface LiteSearchResult {
|
|
|
318
349
|
candidates: LiteCandidate[];
|
|
319
350
|
/** Total matches before the cap. */
|
|
320
351
|
total: number;
|
|
352
|
+
/**
|
|
353
|
+
* Present ONLY when there were ZERO live matches (`total === 0`) yet the name
|
|
354
|
+
* DOES match dead rows — trashed and/or logbook (swept-completed) to-dos /
|
|
355
|
+
* projects. The counts feed the honest not-found hint (see
|
|
356
|
+
* `deadNameMatchHint`); the dead rows are NOT listed as candidates (domain
|
|
357
|
+
* scoping — a live-only pool never invites a dangling-ref op on a dead row).
|
|
358
|
+
*/
|
|
359
|
+
deadMatches?: {
|
|
360
|
+
trashed: number;
|
|
361
|
+
logbook: number;
|
|
362
|
+
};
|
|
321
363
|
}
|
|
322
364
|
export declare function liteTitleSearch(db: DatabaseSync, query: string, options?: {
|
|
323
365
|
type?: "to-do" | "project" | "area";
|
|
324
366
|
limit?: number;
|
|
325
367
|
}, now?: Date, zone?: string): LiteSearchResult;
|
|
326
|
-
/**
|
|
368
|
+
/**
|
|
369
|
+
* The match-provenance annotation on a search hit — WHERE the query matched
|
|
370
|
+
* when it was NOT the title. `field` names the matched text kind; `text` is the
|
|
371
|
+
* matched heading title, a bounded notes snippet centered on the hit, or the
|
|
372
|
+
* matched checklist item's title. PRESENCE-KEYED: a TITLE match carries NO
|
|
373
|
+
* annotation (absence = matched where you'd expect). Exactly one annotation max;
|
|
374
|
+
* when several fields match, precedence is title (none) > heading > notes >
|
|
375
|
+
* checklist.
|
|
376
|
+
*/
|
|
377
|
+
export interface SearchMatchAnnotation {
|
|
378
|
+
field: "heading" | "notes" | "checklist";
|
|
379
|
+
text: string;
|
|
380
|
+
}
|
|
381
|
+
/** A search result, optionally annotated with its non-title match provenance. */
|
|
327
382
|
export type SearchResultItem = ListItem & {
|
|
328
|
-
|
|
329
|
-
kind: "heading";
|
|
330
|
-
title: string;
|
|
331
|
-
};
|
|
383
|
+
match?: SearchMatchAnnotation;
|
|
332
384
|
};
|
|
333
385
|
export declare function searchView(db: DatabaseSync, query: string, options?: SearchOptions, now?: Date, zone?: string): SearchResultItem[];
|