things-api 0.13.0 → 0.15.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 +3 -3
- package/dist/cli/commands/area.d.ts +5 -5
- package/dist/cli/commands/area.js +13 -8
- package/dist/cli/commands/area.js.map +1 -1
- package/dist/cli/commands/project.js +2 -2
- package/dist/cli/commands/project.js.map +1 -1
- package/dist/cli/commands/reads.js +94 -16
- package/dist/cli/commands/reads.js.map +1 -1
- package/dist/cli/commands/show.js +6 -2
- 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 +136 -70
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/glyphs.d.ts +9 -2
- package/dist/cli/glyphs.js +20 -15
- package/dist/cli/glyphs.js.map +1 -1
- package/dist/cli/help.js +4 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/read-driver.d.ts +45 -9
- package/dist/cli/read-driver.js +39 -16
- package/dist/cli/read-driver.js.map +1 -1
- package/dist/cli/render.d.ts +57 -27
- package/dist/cli/render.js +117 -65
- package/dist/cli/render.js.map +1 -1
- package/dist/client.d.ts +127 -38
- package/dist/client.js +86 -22
- package/dist/client.js.map +1 -1
- package/dist/contracts.d.ts +35 -34
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +212 -148
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/dates.d.ts +26 -0
- package/dist/model/dates.js +46 -4
- package/dist/model/dates.js.map +1 -1
- package/dist/model/entities.d.ts +61 -39
- package/dist/model/entities.js +0 -4
- package/dist/model/entities.js.map +1 -1
- package/dist/model/mappers.js +24 -43
- package/dist/model/mappers.js.map +1 -1
- package/dist/read/area-filter.d.ts +1 -1
- package/dist/read/area-filter.js +5 -4
- package/dist/read/area-filter.js.map +1 -1
- package/dist/read/area-view.d.ts +0 -11
- package/dist/read/area-view.js +7 -11
- package/dist/read/area-view.js.map +1 -1
- package/dist/read/detail.js +2 -2
- package/dist/read/detail.js.map +1 -1
- package/dist/read/filter-contract.d.ts +1 -1
- package/dist/read/filter-contract.js +3 -0
- package/dist/read/filter-contract.js.map +1 -1
- package/dist/read/log-boundary.d.ts +46 -2
- package/dist/read/log-boundary.js +43 -2
- package/dist/read/log-boundary.js.map +1 -1
- package/dist/read/predicates.d.ts +13 -0
- package/dist/read/predicates.js +13 -0
- package/dist/read/predicates.js.map +1 -1
- package/dist/read/project-view.d.ts +34 -19
- package/dist/read/project-view.js +31 -25
- package/dist/read/project-view.js.map +1 -1
- package/dist/read/scope.d.ts +1 -1
- package/dist/read/scope.js +5 -4
- package/dist/read/scope.js.map +1 -1
- package/dist/read/search-rank.js +2 -2
- package/dist/read/search-rank.js.map +1 -1
- package/dist/read/shape.d.ts +78 -18
- package/dist/read/shape.js +496 -185
- package/dist/read/shape.js.map +1 -1
- package/dist/read/snapshot.js +2 -2
- package/dist/read/snapshot.js.map +1 -1
- package/dist/read/stage.d.ts +31 -13
- package/dist/read/stage.js +28 -11
- package/dist/read/stage.js.map +1 -1
- package/dist/read/truncation.d.ts +75 -2
- package/dist/read/truncation.js +69 -46
- package/dist/read/truncation.js.map +1 -1
- package/dist/read/views.d.ts +81 -18
- package/dist/read/views.js +136 -17
- package/dist/read/views.js.map +1 -1
- package/dist/surface-copy.d.ts +6 -0
- package/dist/surface-copy.js +6 -0
- package/dist/surface-copy.js.map +1 -1
- package/dist/write/batch.js +0 -1
- package/dist/write/batch.js.map +1 -1
- package/dist/write/clear-reminder.js +3 -1
- package/dist/write/clear-reminder.js.map +1 -1
- package/dist/write/commands.d.ts +25 -1
- package/dist/write/commands.js +350 -134
- package/dist/write/commands.js.map +1 -1
- package/dist/write/guards.js +36 -16
- package/dist/write/guards.js.map +1 -1
- package/dist/write/move.d.ts +26 -5
- package/dist/write/move.js +358 -2
- package/dist/write/move.js.map +1 -1
- package/dist/write/operations.d.ts +50 -19
- package/dist/write/operations.js +3 -2
- package/dist/write/operations.js.map +1 -1
- package/dist/write/pipeline.js +28 -7
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +89 -28
- package/dist/write/pre-state.js +197 -19
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/reorder.js +52 -5
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/resolution-timestamps.d.ts +34 -0
- package/dist/write/resolution-timestamps.js +286 -0
- package/dist/write/resolution-timestamps.js.map +1 -0
- package/dist/write/reversibility.js +10 -5
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/scope-guard.js +2 -5
- package/dist/write/scope-guard.js.map +1 -1
- package/dist/write/undo.d.ts +1 -7
- package/dist/write/undo.js +63 -16
- package/dist/write/undo.js.map +1 -1
- package/dist/write/vectors/applescript.js +23 -4
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/simulator.js +210 -9
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/url-scheme.js +0 -8
- package/dist/write/vectors/url-scheme.js.map +1 -1
- package/dist/write/verify/delta.d.ts +71 -12
- package/dist/write/verify/delta.js +94 -12
- package/dist/write/verify/delta.js.map +1 -1
- package/package.json +1 -1
- package/schema/envelope.schema.json +19 -70
- package/skills/things-cli/SKILL.md +13 -9
- package/skills/things-cli/references/contracts.md +3 -4
- package/skills/things-cli/references/{model.md → data-model.md} +10 -8
- package/skills/things-cli/references/ordering.md +18 -7
package/dist/model/entities.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { IsoDate, ReminderTime } from "./dates.ts";
|
|
|
6
6
|
import type { RepeatRule } from "./recurrence.ts";
|
|
7
7
|
export type TaskStatus = "open" | "canceled" | "completed";
|
|
8
8
|
export type StartState = "inbox" | "active" | "someday";
|
|
9
|
-
export type TodaySection = "today" | "evening";
|
|
10
9
|
export type TaskType = "to-do" | "project" | "heading";
|
|
11
10
|
/** Lightweight reference to another entity. */
|
|
12
11
|
export interface Ref {
|
|
@@ -66,11 +65,24 @@ export interface RepeatingInfo {
|
|
|
66
65
|
*/
|
|
67
66
|
latestInstance?: string;
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
/**
|
|
69
|
+
* The internal DERIVATION SUBSTRATE bag — the entity fields that feed the
|
|
70
|
+
* emission-time derivations (`stage` / `when` / `provisional`) and the human
|
|
71
|
+
* render / write-verify paths, but never ride the JSON wire. Segregated into
|
|
72
|
+
* this nested bag (one-vocabulary audit, Batch 2, Option B) so that everything
|
|
73
|
+
* OUTSIDE `derived` is consumer vocabulary and everything INSIDE never reaches
|
|
74
|
+
* the wire: `src/read/shape.ts` drops the whole substrate in ONE `delete
|
|
75
|
+
* o.derived`, and the wire-key-inventory lock test guarantees a new substrate
|
|
76
|
+
* field cannot leak. A programmatic consumer wanting the wire words should reach
|
|
77
|
+
* for the exported {@link entityStage}/{@link entityWhen}/{@link
|
|
78
|
+
* entityProvisional} helpers (a clock-derived read) rather than these raw fields.
|
|
79
|
+
*/
|
|
80
|
+
export interface DerivedSubstrate {
|
|
81
|
+
/**
|
|
82
|
+
* Raw start-state (inbox | active | someday). Feeds `stage`/`when`; cannot be
|
|
83
|
+
* renamed to `stage` (raw vs the clock-derived taxonomy).
|
|
84
|
+
*/
|
|
85
|
+
start: StartState;
|
|
74
86
|
/**
|
|
75
87
|
* In the GUI's Logbook. Completion and logged are SEPARATE states: a
|
|
76
88
|
* closed item stays checked in its original list until the app's
|
|
@@ -78,24 +90,6 @@ interface TaskCommon {
|
|
|
78
90
|
*/
|
|
79
91
|
logged: boolean;
|
|
80
92
|
trashed: boolean;
|
|
81
|
-
start: StartState;
|
|
82
|
-
/** The "When" date (packed int in DB), null when unscheduled. */
|
|
83
|
-
startDate: IsoDate | null;
|
|
84
|
-
/**
|
|
85
|
-
* Today-view section ("today" | "evening"), meaningful ONLY for items actually
|
|
86
|
-
* in Today under the evaluation clock: start=active, dated, and not
|
|
87
|
-
* future-scheduled (overdue rows stay in Today). Anytime (undated) and
|
|
88
|
-
* Upcoming (future startDate) rows carry a raw startBucket in the DB but are
|
|
89
|
-
* NOT in Today, so this is null for them.
|
|
90
|
-
*
|
|
91
|
-
* INTERNAL-ONLY (R10.1): this field is NOT on the JSON wire — it was retired
|
|
92
|
-
* as redundant with the presence-keyed {@link TaskCommon.evening} marker
|
|
93
|
-
* (`todaySection === "evening"` ⇔ `evening: true`). It survives on the
|
|
94
|
-
* in-memory entity for the human render (evening styling) and the write-verify
|
|
95
|
-
* schedule delta, which still read it; the read-shaping transform deletes it
|
|
96
|
-
* from the emitted copy. Use TodayView.evening for UI-faithful placement.
|
|
97
|
-
*/
|
|
98
|
-
todaySection: TodaySection | null;
|
|
99
93
|
/**
|
|
100
94
|
* Presence-keyed Today-view marker (`true` or absent) — derived with the Today
|
|
101
95
|
* view's own two-arm membership (a scheduled `startDate <= today`, OR an
|
|
@@ -108,24 +102,43 @@ interface TaskCommon {
|
|
|
108
102
|
/**
|
|
109
103
|
* Presence-keyed This-Evening marker (`true` or absent) — the evening
|
|
110
104
|
* sub-section of Today (`startBucket=1` AND `startDate` exactly today). Implies
|
|
111
|
-
* {@link
|
|
105
|
+
* {@link DerivedSubstrate.today}. Set only when true.
|
|
112
106
|
*/
|
|
113
107
|
evening?: true;
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
/**
|
|
109
|
+
* The RAW stored reminder byte (`HH:mm`), possibly STALE — null when the row
|
|
110
|
+
* carries no reminder at all. This is the substrate the write engine reads for
|
|
111
|
+
* its pre-state/delta predictions; the honest, live-gated value a consumer sees
|
|
112
|
+
* is the top-level {@link TaskCommon.reminder} (which this feeds).
|
|
113
|
+
*
|
|
114
|
+
* §9n: the app keeps the reminder byte in the DB forever, even once the row's
|
|
115
|
+
* `startDate` goes strictly past — at that point the GUI hides the bell
|
|
116
|
+
* (presentation-dead) but the byte is NOT gone: RE-SCHEDULING the item to
|
|
117
|
+
* today/future REVIVES the reminder. The write engine therefore must predict
|
|
118
|
+
* and verify against this raw byte, never the live-gated top-level value (a
|
|
119
|
+
* past-dated `add --reminder` stores the byte; a `clear-dated-reminder` must
|
|
120
|
+
* verify the byte itself is gone, not merely that the live view reads empty).
|
|
121
|
+
* Computed at materialize (mappers) with no clock gating.
|
|
122
|
+
*/
|
|
116
123
|
reminder: ReminderTime | null;
|
|
124
|
+
}
|
|
125
|
+
interface TaskCommon {
|
|
126
|
+
uuid: string;
|
|
127
|
+
title: string;
|
|
128
|
+
notes: string;
|
|
129
|
+
status: TaskStatus;
|
|
130
|
+
/** The "When" date (packed int in DB), null when unscheduled. */
|
|
131
|
+
startDate: IsoDate | null;
|
|
132
|
+
deadline: IsoDate | null;
|
|
117
133
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* clock, exactly like the {@link today}/{@link evening} markers. INTERNAL: it
|
|
125
|
-
* gates the read-shaping `reminder` emit and the human-render bell, and is
|
|
126
|
-
* stripped from the JSON wire by the shaping transform. Set only when true.
|
|
134
|
+
* Time-of-day reminder (`HH:mm`, 24h) — the LIVE value only: it is null once the
|
|
135
|
+
* reminder is presentation-dead (its row's `startDate` gone strictly past, §9n),
|
|
136
|
+
* exactly what a consumer/renderer should honor. Live-gated at the mapper under
|
|
137
|
+
* the response clock (the {@link reminderIsLive} predicate). The RAW stored byte
|
|
138
|
+
* (which survives a stale schedule and is revived by re-scheduling) lives in the
|
|
139
|
+
* substrate as {@link DerivedSubstrate.reminder}; the write engine reads THAT.
|
|
127
140
|
*/
|
|
128
|
-
|
|
141
|
+
reminder: ReminderTime | null;
|
|
129
142
|
area: Ref | null;
|
|
130
143
|
/** Direct tags only, by name — mirrors DB truth (inherited tags are computed; see inheritedTags). */
|
|
131
144
|
tags: TagRef[];
|
|
@@ -142,6 +155,11 @@ interface TaskCommon {
|
|
|
142
155
|
created: Date;
|
|
143
156
|
modified: Date;
|
|
144
157
|
stopped: Date | null;
|
|
158
|
+
/**
|
|
159
|
+
* The internal derivation substrate (raw lifecycle + Today/reminder markers) —
|
|
160
|
+
* NEVER on the JSON wire. See {@link DerivedSubstrate}.
|
|
161
|
+
*/
|
|
162
|
+
derived: DerivedSubstrate;
|
|
145
163
|
}
|
|
146
164
|
export interface Todo extends TaskCommon {
|
|
147
165
|
type: "to-do";
|
|
@@ -216,11 +234,15 @@ export interface ChecklistItem {
|
|
|
216
234
|
export type AnyTask = Todo | Project | Heading;
|
|
217
235
|
/** Items grouped under one ISO date (Upcoming days, project "later" groups). */
|
|
218
236
|
export interface IsoDateGroup<T> {
|
|
219
|
-
|
|
237
|
+
/**
|
|
238
|
+
* The ISO day the group sits under — named `when` to speak the same time-axis
|
|
239
|
+
* word the read wire and the `--in <when>` reorder token use (one name per
|
|
240
|
+
* concept; the render/view builders never translate it).
|
|
241
|
+
*/
|
|
242
|
+
when: string;
|
|
220
243
|
items: T[];
|
|
221
244
|
}
|
|
222
245
|
export declare const TASK_TYPE_FROM_DB: Record<number, TaskType>;
|
|
223
246
|
export declare const TASK_STATUS_FROM_DB: Record<number, TaskStatus>;
|
|
224
247
|
export declare const START_STATE_FROM_DB: Record<number, StartState>;
|
|
225
|
-
export declare const TODAY_SECTION_FROM_DB: Record<number, TodaySection>;
|
|
226
248
|
export {};
|
package/dist/model/entities.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/model/entities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entities.js","sourceRoot":"","sources":["../../src/model/entities.ts"],"names":[],"mappings":"AAmQA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IACzD,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,SAAS;CACb,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAA+B;IAC7D,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,WAAW;CACf,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAA+B;IAC7D,CAAC,EAAE,OAAO;IACV,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,SAAS;CACb,CAAC"}
|
package/dist/model/mappers.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Pure row → entity mappers. Rows are the explicit-column SELECTs defined by
|
|
3
3
|
* the schema manifest; encodings per docs/atlas/schema-v26.md.
|
|
4
4
|
*/
|
|
5
|
-
import { START_STATE_FROM_DB, TASK_STATUS_FROM_DB,
|
|
5
|
+
import { START_STATE_FROM_DB, TASK_STATUS_FROM_DB, } from "./entities.js";
|
|
6
6
|
import { decodeEpochReal, decodePackedDate, decodeReminderTime } from "./dates.js";
|
|
7
7
|
import { reminderIsLive } from "../read/stage.js";
|
|
8
8
|
export class EnumDomainError extends RangeError {
|
|
@@ -24,32 +24,6 @@ function mapStart(row) {
|
|
|
24
24
|
throw new EnumDomainError("start", row.start, row.uuid);
|
|
25
25
|
return start;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
28
|
-
* `todaySection` is meaningful ONLY for items actually in the Today view. The
|
|
29
|
-
* DB stores a raw `startBucket` (0/1) on EVERY active row — prod carries
|
|
30
|
-
* startBucket=0 on every undated Anytime to-do, and future-scheduled
|
|
31
|
-
* (Upcoming) rows carry it too — so the raw bucket cannot be surfaced as-is:
|
|
32
|
-
* emitting "today" for an Anytime/Upcoming item wrongly implies Today
|
|
33
|
-
* membership (architecture.md; the MCP server note). We gate on the injected
|
|
34
|
-
* clock's `packedToday`: the field is emitted only when the row is active,
|
|
35
|
-
* dated, and not future-scheduled ("evening" via startBucket=1, else "today");
|
|
36
|
-
* overdue scheduled rows (startDate < today) stay in Today and keep it.
|
|
37
|
-
* Undated or future-dated rows OMIT the field (null).
|
|
38
|
-
*/
|
|
39
|
-
function mapTodaySection(row, packedToday) {
|
|
40
|
-
if (row.startBucket === null)
|
|
41
|
-
return null;
|
|
42
|
-
const section = TODAY_SECTION_FROM_DB[row.startBucket];
|
|
43
|
-
if (!section)
|
|
44
|
-
throw new EnumDomainError("startBucket", row.startBucket, row.uuid);
|
|
45
|
-
if ((row.start ?? 0) !== 1)
|
|
46
|
-
return null; // not start=active → not in Today
|
|
47
|
-
if (row.startDate === null)
|
|
48
|
-
return null; // undated (Anytime)
|
|
49
|
-
if (row.startDate > packedToday)
|
|
50
|
-
return null; // future startDate (Upcoming)
|
|
51
|
-
return section;
|
|
52
|
-
}
|
|
53
27
|
function mapRepeating(row) {
|
|
54
28
|
const isTemplate = row.rt1_recurrenceRule !== null || row.repeater !== null;
|
|
55
29
|
const templateUuid = row.rt1_repeatingTemplate;
|
|
@@ -95,29 +69,24 @@ function todayMarkers(row, packedToday) {
|
|
|
95
69
|
}
|
|
96
70
|
function commonFields(row, refs, tags, packedToday) {
|
|
97
71
|
const startDate = decodePackedDate(row.startDate);
|
|
98
|
-
|
|
72
|
+
// The RAW stored reminder byte — kept in `derived` verbatim (possibly stale)
|
|
73
|
+
// for the write engine's pre-state/delta predictions (§9n: a stale byte is
|
|
74
|
+
// revived by re-scheduling, so the raw value must survive on the substrate).
|
|
75
|
+
const rawReminder = decodeReminderTime(row.reminderTime);
|
|
99
76
|
// §9n: a reminder byte renders only while startDate is today-or-future — a
|
|
100
|
-
// strictly-past startDate leaves the byte in the DB but presentation-dead.
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
104
|
-
//
|
|
105
|
-
const reminderLive =
|
|
77
|
+
// strictly-past startDate leaves the byte in the DB but presentation-dead. The
|
|
78
|
+
// top-level `reminder` a consumer sees is the LIVE value only (null when
|
|
79
|
+
// stale), live-gated here under the response clock (as todayMarkers gates
|
|
80
|
+
// Today/Evening). decodePackedDate(packedToday) is today's ISO; reminderIsLive
|
|
81
|
+
// keeps null-startDate reminders (defensive).
|
|
82
|
+
const reminderLive = rawReminder !== null && reminderIsLive(startDate, decodePackedDate(packedToday) ?? "");
|
|
83
|
+
const reminder = reminderLive ? rawReminder : null;
|
|
106
84
|
return {
|
|
107
|
-
...todayMarkers(row, packedToday),
|
|
108
|
-
...(reminderLive ? { reminderLive: true } : {}),
|
|
109
85
|
uuid: row.uuid,
|
|
110
86
|
title: row.title ?? "",
|
|
111
87
|
notes: row.notes ?? "",
|
|
112
88
|
status: mapStatus(row),
|
|
113
|
-
// Refined by markLogged (read layer): closed AND past the log-move
|
|
114
|
-
// boundary. Defaulting to closed-implies-logged keeps paths that skip
|
|
115
|
-
// the boundary (writes' result checks) on the old semantics.
|
|
116
|
-
logged: mapStatus(row) !== "open",
|
|
117
|
-
trashed: row.trashed === 1,
|
|
118
|
-
start: mapStart(row),
|
|
119
89
|
startDate,
|
|
120
|
-
todaySection: mapTodaySection(row, packedToday),
|
|
121
90
|
// A template's own `deadline` column is not a real date: it is NULL
|
|
122
91
|
// (deadline-less) or a far-future sentinel (4001-01-01, deadlined) that
|
|
123
92
|
// flags whether spawned instances deadline. Surface it via
|
|
@@ -137,6 +106,18 @@ function commonFields(row, refs, tags, packedToday) {
|
|
|
137
106
|
created: decodeEpochReal(row.creationDate) ?? new Date(0),
|
|
138
107
|
modified: decodeEpochReal(row.userModificationDate) ?? new Date(0),
|
|
139
108
|
stopped: decodeEpochReal(row.stopDate),
|
|
109
|
+
// The internal derivation substrate — never on the wire (DerivedSubstrate).
|
|
110
|
+
derived: {
|
|
111
|
+
...todayMarkers(row, packedToday),
|
|
112
|
+
// The RAW reminder byte (possibly stale) — the write engine's substrate.
|
|
113
|
+
reminder: rawReminder,
|
|
114
|
+
// Refined by markLogged (read layer): closed AND past the log-move
|
|
115
|
+
// boundary. Defaulting to closed-implies-logged keeps paths that skip
|
|
116
|
+
// the boundary (writes' result checks) on the old semantics.
|
|
117
|
+
logged: mapStatus(row) !== "open",
|
|
118
|
+
trashed: row.trashed === 1,
|
|
119
|
+
start: mapStart(row),
|
|
120
|
+
},
|
|
140
121
|
};
|
|
141
122
|
}
|
|
142
123
|
export function mapTodo(row, refs, tags, packedToday) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../src/model/mappers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"mappers.js","sourceRoot":"","sources":["../../src/model/mappers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,GASpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyDlD,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAC7C,YAAY,KAAa,EAAE,KAAc,EAAE,IAAY;QACrD,KAAK,CACH,cAAc,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,uCAAuC;YACpF,+CAA+C,CAClD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED,SAAS,SAAS,CAAC,GAAqC;IACtD,MAAM,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CAAC,GAA2C;IAC3D,MAAM,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IAClD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,eAAe,CAAC,O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J,CAAC"}
|
|
@@ -68,7 +68,7 @@ export declare function filterListByArea<T extends ListItem>(items: T[], areaUui
|
|
|
68
68
|
*/
|
|
69
69
|
export declare function filterSectionsByArea(sections: SidebarSection[], areaUuid: string): SidebarSection[];
|
|
70
70
|
/**
|
|
71
|
-
* Filter the
|
|
71
|
+
* Filter the Today split to the target area. The counts are recomputed over the
|
|
72
72
|
* surviving OPEN members so they reflect exactly the rows the view now returns —
|
|
73
73
|
* the same treatment {@link todayView} gives its `eveningOnly` filter — never a
|
|
74
74
|
* count that includes dropped rows.
|
package/dist/read/area-filter.js
CHANGED
|
@@ -44,15 +44,16 @@ export function filterSectionsByArea(sections, areaUuid) {
|
|
|
44
44
|
.filter((s) => s.items.length > 0);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Filter the
|
|
47
|
+
* Filter the Today split to the target area. The counts are recomputed over the
|
|
48
48
|
* surviving OPEN members so they reflect exactly the rows the view now returns —
|
|
49
49
|
* the same treatment {@link todayView} gives its `eveningOnly` filter — never a
|
|
50
50
|
* count that includes dropped rows.
|
|
51
51
|
*/
|
|
52
52
|
export function filterTodayByArea(view, areaUuid, todayIso) {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
53
|
+
const today = view.today.filter((i) => itemInArea(i, areaUuid));
|
|
54
|
+
const evening = view.evening.filter((i) => itemInArea(i, areaUuid));
|
|
55
|
+
const open = [...today, ...evening].filter((i) => i.status === "open");
|
|
55
56
|
const dueOrOverdue = open.filter((i) => i.deadline !== null && i.deadline <= todayIso).length;
|
|
56
|
-
return {
|
|
57
|
+
return { today, evening, counts: { dueOrOverdue, other: open.length - dueOrOverdue } };
|
|
57
58
|
}
|
|
58
59
|
//# sourceMappingURL=area-filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area-filter.js","sourceRoot":"","sources":["../../src/read/area-filter.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC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K,EAAE,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACvE,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,MAAM,CAAC;IAC9F,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,YAAY,EAAE,EAAE,CAAC;AACzF,CAAC"}
|
package/dist/read/area-view.d.ts
CHANGED
|
@@ -12,17 +12,6 @@ import { type ViewFilter } from "./views.ts";
|
|
|
12
12
|
export interface AreaView {
|
|
13
13
|
/** The area, or `null` for the `loose` pseudo-area (the NULL-area composite). */
|
|
14
14
|
area: Area | null;
|
|
15
|
-
/**
|
|
16
|
-
* ALL live (non-logbook) DIRECT to-dos of the area, in `index` order, each
|
|
17
|
-
* carrying `stage` + `when` — the flat wire representation (read-shape doctrine
|
|
18
|
-
* §3.13's area-view `items[]`). Area direct to-dos are never headed and never
|
|
19
|
-
* project-nested, so they are fully self-describing once `area` (the card
|
|
20
|
-
* states it) is dropped. The structured buckets below (`active`, `scheduled`,
|
|
21
|
-
* `someday`, `repeating`) re-group the SAME to-dos into the GUI render layout
|
|
22
|
-
* for the byte-stable TTY (the library owns the clock + `todayIndex`).
|
|
23
|
-
* `projects[]` is the SEPARATE order axis (sidebar rank) and is NOT folded in.
|
|
24
|
-
*/
|
|
25
|
-
items: Todo[];
|
|
26
15
|
/** Open, unscheduled/current direct to-dos, by index. */
|
|
27
16
|
active: Todo[];
|
|
28
17
|
/** The area's open projects in sidebar order (someday projects included). */
|
package/dist/read/area-view.js
CHANGED
|
@@ -14,7 +14,7 @@ import { tagFilter } from "./views.js";
|
|
|
14
14
|
// while capping the active rows) and the human renderer, so the split is
|
|
15
15
|
// defined ONCE and the two never drift.
|
|
16
16
|
/** A someday project row: open, incubated, no start date. */
|
|
17
|
-
export const isSomedayProjectRow = (p) => p.status === "open" && p.start === "someday" && p.startDate === null;
|
|
17
|
+
export const isSomedayProjectRow = (p) => p.status === "open" && p.derived.start === "someday" && p.startDate === null;
|
|
18
18
|
/** A future-scheduled project row (start date strictly after `todayIso`). */
|
|
19
19
|
export const isScheduledProjectRow = (p, todayIso) => p.status === "open" && p.startDate !== null && p.startDate > todayIso;
|
|
20
20
|
/** An active project row — everything that is neither someday nor future-scheduled. */
|
|
@@ -67,8 +67,8 @@ export function areaView(db, ref, now, filter = {}, zone) {
|
|
|
67
67
|
const refs = makeRefResolver(db);
|
|
68
68
|
const tagsOf = (rows) => fetchTagsForTasks(db, rows.map((r) => r.uuid));
|
|
69
69
|
const boundary = logBoundary(db, now, zone);
|
|
70
|
-
// The view's injected clock — gates
|
|
71
|
-
// mapper AND drives the scheduled/overdue bucketing below.
|
|
70
|
+
// The view's injected clock — gates the today/evening markers (and reminder
|
|
71
|
+
// liveness) in the mapper AND drives the scheduled/overdue bucketing below.
|
|
72
72
|
const packedToday = encodePackedDate(localToday(now, zone));
|
|
73
73
|
// OWN-DEADLINE UNIFORM: `--overdue` filters BOTH displayed row kinds by each
|
|
74
74
|
// row's OWN deadline (open, strictly before today) via the shared OVERDUE
|
|
@@ -115,7 +115,7 @@ export function areaView(db, ref, now, filter = {}, zone) {
|
|
|
115
115
|
// Completion ≠ logged: closed-but-unswept items stay checked in the
|
|
116
116
|
// active block, like the GUI. Logged rows (past the log boundary) are
|
|
117
117
|
// NOT a view section — they live in `things logbook --area <ref>`.
|
|
118
|
-
if (!todo.logged)
|
|
118
|
+
if (!todo.derived.logged)
|
|
119
119
|
active.push(todo);
|
|
120
120
|
continue;
|
|
121
121
|
}
|
|
@@ -137,15 +137,11 @@ export function areaView(db, ref, now, filter = {}, zone) {
|
|
|
137
137
|
// Within a day the UI sorts by todayIndex ASC (Upcoming drag order).
|
|
138
138
|
for (const { date, todo } of scheduledRows.toSorted((a, b) => a.date.localeCompare(b.date) || a.ti - b.ti)) {
|
|
139
139
|
const last = scheduled[scheduled.length - 1];
|
|
140
|
-
if (last && last.
|
|
140
|
+
if (last && last.when === date)
|
|
141
141
|
last.items.push(todo);
|
|
142
142
|
else
|
|
143
|
-
scheduled.push({ date, items: [todo] });
|
|
143
|
+
scheduled.push({ when: date, items: [todo] });
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
// `todos` fetch is already `ORDER BY index ASC`). Excludes swept logged rows
|
|
147
|
-
// (the area view has no logbook section — they live in `things logbook --area`).
|
|
148
|
-
const items = todos.map((t) => t.todo).filter((td) => !td.logged);
|
|
149
|
-
return { area, items, active, projects, scheduled, someday, repeating };
|
|
145
|
+
return { area, active, projects, scheduled, someday, repeating };
|
|
150
146
|
}
|
|
151
147
|
//# sourceMappingURL=area-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area-view.js","sourceRoot":"","sources":["../../src/read/area-view.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,UAAU,EAAE,OAAO,EAAgB,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,SAAS,EAAmB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"area-view.js","sourceRoot":"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AC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CACtD,EAAE,CAAC;QACF,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7C,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;YAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;YACjD,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AACnE,CAAC"}
|
package/dist/read/detail.js
CHANGED
|
@@ -4,8 +4,8 @@ import { encodePackedDate, localToday } from "../model/dates.js";
|
|
|
4
4
|
import { fetchChecklistRows, fetchTagsForTasks, fetchTaskByUuid, latestInstanceUuid, makeHeadingProjectResolver, makeRefResolver, } from "./queries.js";
|
|
5
5
|
import { logBoundary, markLogged } from "./log-boundary.js";
|
|
6
6
|
import { inheritedTagsFor } from "./tags.js";
|
|
7
|
-
// `now`/`zone` supply the evaluation clock used to gate
|
|
8
|
-
//
|
|
7
|
+
// `now`/`zone` supply the evaluation clock used to gate the today/evening markers
|
|
8
|
+
// (and reminder liveness) in the mapper. They default to the host clock —
|
|
9
9
|
// matching this module's existing logBoundary default; the client facade passes
|
|
10
10
|
// the injected clock so a pinned-clock `show` reads under the consumer's Today.
|
|
11
11
|
export function byUuid(db, uuid, now = new Date(), zone) {
|
package/dist/read/detail.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail.js","sourceRoot":"","sources":["../../src/read/detail.ts"],"names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,CAAC,KAAK,IAAI;gBAAE,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;QAChC,IAAI,GAAG,CAAC,kBAAkB,KAAK,IAAI,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,oBAAoB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACvE,CAAC;YAAC,MAAM,CAAC;gBACP,mEAAmE;gBACnE,6DAA6D;YAC/D,CAAC;QACH,CAAC;QACD,6EAA6E;QAC7E,0EAA0E;QAC1E,MAAM,MAAM,GAAG,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAChD,IAAI,MAAM,KAAK,IAAI;YAAE,MAAM,CAAC,SAAS,CAAC,cAAc,GAAG,MAAM,CAAC;IAChE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAgB,EAAE,QAAgB;IAC7D,OAAO,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { ViewFilter } from "./views.ts";
|
|
21
21
|
/** Every read view whose filter applicability the contract governs. */
|
|
22
|
-
export type ViewName = "today" | "inbox" | "anytime" | "someday" | "upcoming" | "logbook" | "trash" | "search" | "changes" | "projects" | "areas" | "project-show" | "area-show";
|
|
22
|
+
export type ViewName = "today" | "inbox" | "anytime" | "someday" | "upcoming" | "logbook" | "trash" | "search" | "changes" | "deadlines" | "projects" | "areas" | "project-show" | "area-show";
|
|
23
23
|
/**
|
|
24
24
|
* How a view's tag filter behaves:
|
|
25
25
|
* - `inherited` — FLAT views: a `--tag` matches direct OR container-inherited
|
|
@@ -18,6 +18,9 @@ export const FILTER_CONTRACT = {
|
|
|
18
18
|
search: { overdue: true, tag: "inherited", bound: "flat", statusWidening: true },
|
|
19
19
|
// Sync feed: neither overdue nor tags apply.
|
|
20
20
|
changes: { overdue: false, tag: "rejected", bound: "flat", statusWidening: false },
|
|
21
|
+
// Deadline horizon (R9 query view): overdue narrows to open, past-deadline
|
|
22
|
+
// rows; tags are inheritance-inclusive (flat view); flat row cap.
|
|
23
|
+
deadlines: { overdue: true, tag: "inherited", bound: "flat", statusWidening: false },
|
|
21
24
|
// Projects LIST is a FLAT view — each project row filtered by its own
|
|
22
25
|
// (inheritance-inclusive) tags; overdue keeps past-deadline projects.
|
|
23
26
|
projects: { overdue: true, tag: "inherited", bound: "none", statusWidening: false },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-contract.js","sourceRoot":"","sources":["../../src/read/filter-contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter-contract.js","sourceRoot":"","sources":["../../src/read/filter-contract.ts"],"names":[],"mappings":"AAoEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqC;IAC/D,4EAA4E;IAC5E,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE;IAChF,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE;IAChF,uDAAuD;IACvD,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE;IACrF,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE;IACrF,iFAAiF;IACjF,QA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EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,eAAe,EAAE,CAAC;IACvD,CAAC;IACD,IACE,IAAI,CAAC,OAAO,KAAK,IAAI;QACrB,IAAI,CAAC,cAAc;QACnB,CAAC,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,EACpE,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,kBAAkB,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM,EAAE,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE;KACtF,CAAC;AACJ,CAAC"}
|
|
@@ -21,9 +21,53 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import type { DatabaseSync } from "node:sqlite";
|
|
23
23
|
export declare function logBoundary(db: DatabaseSync, now?: Date, zone?: string): Date;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The Cultured Code words for the "Move completed items to Logbook" cadence —
|
|
26
|
+
* the exact Settings-dropdown labels (`logInterval` 0=Immediately · 1=Daily ·
|
|
27
|
+
* 4=Manually; there is NO weekly/monthly in Things 3.22.x, oddities §8c). Kept
|
|
28
|
+
* in the app's own vocabulary so consumer copy never invents a lifecycle word.
|
|
29
|
+
*/
|
|
30
|
+
export type LogCadence = "Immediately" | "Daily" | "Manually";
|
|
31
|
+
/**
|
|
32
|
+
* A VIEW-LEVEL fact about the Logbook: the log-move cadence in Cultured Code's
|
|
33
|
+
* own Settings words, plus — under Daily and Manually — the instant of the last
|
|
34
|
+
* explicit log (`TMSettings.manualLogDate`), as an ISO-8601 string (an INSTANT,
|
|
35
|
+
* so a consumer renders its calendar day in their own zone; the wire carries the
|
|
36
|
+
* exact instant). Rides `meta.logging` on the wire (never a data row) — the
|
|
37
|
+
* `meta.counts` precedent for a whole-view aggregate.
|
|
38
|
+
*/
|
|
39
|
+
export interface LogState {
|
|
40
|
+
cadence: LogCadence;
|
|
41
|
+
/** ISO-8601 instant of the last explicit log — present under Daily and Manually. */
|
|
42
|
+
lastLoggedAt?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Read the log-move cadence fact from the `TMSettings` singleton. The golden
|
|
46
|
+
* default is Immediately (`logInterval` absent/0 → boundary is `now`, so nothing
|
|
47
|
+
* is ever pending). `manualLogDate` is surfaced as `lastLoggedAt` under Daily AND
|
|
48
|
+
* Manually — a manual `log completed now` works under any cadence, and under Daily
|
|
49
|
+
* a `manualLogDate` newer than the daily edge IS the effective boundary
|
|
50
|
+
* (`logBoundary = max(interval edge, manualLogDate)` above), so the stamp is
|
|
51
|
+
* operationally LIVE information, not just history. Under Immediately it is OMITTED
|
|
52
|
+
* (the boundary is `now`, so any stored value is inert — a settings-flip artifact,
|
|
53
|
+
* never the operative boundary); the asymmetry is deliberate.
|
|
54
|
+
*/
|
|
55
|
+
export declare function logState(db: DatabaseSync): LogState;
|
|
56
|
+
/**
|
|
57
|
+
* How many closed items sit resolved-but-NOT-yet-logged — the boundary predicate
|
|
58
|
+
* INVERTED (`status IN (2,3) AND stopDate > logBoundary`). This is the count an
|
|
59
|
+
* AppleScript `log completed now` would move into the Logbook; it is 0 under the
|
|
60
|
+
* default Immediately cadence (the boundary is `now`). Feeds `log-now`'s pre-read
|
|
61
|
+
* so the result can disclose how many items were logged (and the count==0 no-op).
|
|
62
|
+
*/
|
|
63
|
+
export declare function pendingLogCount(db: DatabaseSync, now?: Date, zone?: string): number;
|
|
64
|
+
/** The current `TMSettings.manualLogDate` (epoch seconds), or null. */
|
|
65
|
+
export declare function manualLogDateEpoch(db: DatabaseSync): number | null;
|
|
66
|
+
/** Stamp `derived.logged` on mapped entities (closed AND at/before the boundary). */
|
|
25
67
|
export declare function markLogged<T extends {
|
|
26
68
|
status: string;
|
|
27
69
|
stopped: Date | null;
|
|
28
|
-
|
|
70
|
+
derived: {
|
|
71
|
+
logged: boolean;
|
|
72
|
+
};
|
|
29
73
|
}>(items: T[], boundary: Date): T[];
|
|
@@ -38,10 +38,51 @@ export function logBoundary(db, now = new Date(), zone) {
|
|
|
38
38
|
}
|
|
39
39
|
return manual !== null && manual > auto ? manual : auto;
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Read the log-move cadence fact from the `TMSettings` singleton. The golden
|
|
43
|
+
* default is Immediately (`logInterval` absent/0 → boundary is `now`, so nothing
|
|
44
|
+
* is ever pending). `manualLogDate` is surfaced as `lastLoggedAt` under Daily AND
|
|
45
|
+
* Manually — a manual `log completed now` works under any cadence, and under Daily
|
|
46
|
+
* a `manualLogDate` newer than the daily edge IS the effective boundary
|
|
47
|
+
* (`logBoundary = max(interval edge, manualLogDate)` above), so the stamp is
|
|
48
|
+
* operationally LIVE information, not just history. Under Immediately it is OMITTED
|
|
49
|
+
* (the boundary is `now`, so any stored value is inert — a settings-flip artifact,
|
|
50
|
+
* never the operative boundary); the asymmetry is deliberate.
|
|
51
|
+
*/
|
|
52
|
+
export function logState(db) {
|
|
53
|
+
const row = db.prepare("SELECT logInterval, manualLogDate FROM TMSettings").get();
|
|
54
|
+
const interval = row?.logInterval ?? 0;
|
|
55
|
+
const cadence = interval === 0 ? "Immediately" : interval === 1 ? "Daily" : "Manually";
|
|
56
|
+
const manual = row?.manualLogDate ?? null;
|
|
57
|
+
return cadence !== "Immediately" && manual !== null
|
|
58
|
+
? { cadence, lastLoggedAt: new Date(manual * 1000).toISOString() }
|
|
59
|
+
: { cadence };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* How many closed items sit resolved-but-NOT-yet-logged — the boundary predicate
|
|
63
|
+
* INVERTED (`status IN (2,3) AND stopDate > logBoundary`). This is the count an
|
|
64
|
+
* AppleScript `log completed now` would move into the Logbook; it is 0 under the
|
|
65
|
+
* default Immediately cadence (the boundary is `now`). Feeds `log-now`'s pre-read
|
|
66
|
+
* so the result can disclose how many items were logged (and the count==0 no-op).
|
|
67
|
+
*/
|
|
68
|
+
export function pendingLogCount(db, now = new Date(), zone) {
|
|
69
|
+
const boundaryEpoch = logBoundary(db, now, zone).getTime() / 1000;
|
|
70
|
+
const row = db
|
|
71
|
+
.prepare("SELECT COUNT(*) AS n FROM TMTask WHERE trashed = 0 AND status IN (2, 3) " +
|
|
72
|
+
"AND stopDate IS NOT NULL AND stopDate > ?")
|
|
73
|
+
.get(boundaryEpoch);
|
|
74
|
+
return row.n;
|
|
75
|
+
}
|
|
76
|
+
/** The current `TMSettings.manualLogDate` (epoch seconds), or null. */
|
|
77
|
+
export function manualLogDateEpoch(db) {
|
|
78
|
+
const row = db.prepare("SELECT manualLogDate FROM TMSettings").get();
|
|
79
|
+
return row?.manualLogDate ?? null;
|
|
80
|
+
}
|
|
81
|
+
/** Stamp `derived.logged` on mapped entities (closed AND at/before the boundary). */
|
|
42
82
|
export function markLogged(items, boundary) {
|
|
43
83
|
for (const item of items) {
|
|
44
|
-
item.logged =
|
|
84
|
+
item.derived.logged =
|
|
85
|
+
item.status !== "open" && item.stopped !== null && item.stopped <= boundary;
|
|
45
86
|
}
|
|
46
87
|
return items;
|
|
47
88
|
}
|