things-api 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -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 +26 -3
- package/dist/cli/commands/area.js +125 -70
- 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 +18 -1
- package/dist/cli/commands/project.js +69 -31
- package/dist/cli/commands/project.js.map +1 -1
- package/dist/cli/commands/reads.js +423 -157
- 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.js +47 -24
- package/dist/cli/commands/show.js.map +1 -1
- package/dist/cli/commands/todo.d.ts +1 -1
- package/dist/cli/commands/todo.js +7 -6
- 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 +1 -1
- 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 +39 -2
- package/dist/cli/glyphs.js +91 -21
- 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 +32 -25
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/period.d.ts +7 -0
- package/dist/cli/period.js +12 -0
- package/dist/cli/period.js.map +1 -1
- package/dist/cli/read-driver.d.ts +26 -19
- package/dist/cli/read-driver.js +67 -33
- package/dist/cli/read-driver.js.map +1 -1
- package/dist/cli/render.d.ts +92 -28
- package/dist/cli/render.js +318 -97
- package/dist/cli/render.js.map +1 -1
- package/dist/cli/resolve-invocation.d.ts +42 -4
- package/dist/cli/resolve-invocation.js +97 -14
- package/dist/cli/resolve-invocation.js.map +1 -1
- 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 +137 -24
- package/dist/client.js +105 -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 +87 -17
- 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 +691 -133
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/entities.d.ts +31 -7
- package/dist/model/entities.js.map +1 -1
- package/dist/model/mappers.d.ts +7 -0
- package/dist/model/mappers.js +7 -2
- package/dist/model/mappers.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/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/predicates.d.ts +30 -0
- package/dist/read/predicates.js +30 -0
- package/dist/read/predicates.js.map +1 -1
- 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 +149 -6
- package/dist/read/queries.js +250 -31
- package/dist/read/queries.js.map +1 -1
- 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/sidebar-order.js +2 -1
- package/dist/read/sidebar-order.js.map +1 -1
- 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/{pagination.js → truncation.js} +103 -94
- package/dist/read/truncation.js.map +1 -0
- package/dist/read/views.d.ts +140 -16
- package/dist/read/views.js +264 -67
- package/dist/read/views.js.map +1 -1
- package/dist/surface-copy.d.ts +19 -0
- package/dist/surface-copy.js +32 -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 -6
- 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 +493 -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
- package/dist/read/pagination.d.ts +0 -104
- package/dist/read/pagination.js.map +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { DatabaseSync } from "node:sqlite";
|
|
2
|
+
import type { UiRunner } from "./ui.ts";
|
|
3
|
+
export type SidebarPlacement = {
|
|
4
|
+
kind: "before";
|
|
5
|
+
uuid: string;
|
|
6
|
+
title: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "after";
|
|
9
|
+
uuid: string;
|
|
10
|
+
title: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "first";
|
|
13
|
+
} | {
|
|
14
|
+
kind: "last";
|
|
15
|
+
};
|
|
16
|
+
export interface SidebarDragSpec {
|
|
17
|
+
targetUuid: string;
|
|
18
|
+
targetTitle: string;
|
|
19
|
+
placement: SidebarPlacement;
|
|
20
|
+
}
|
|
21
|
+
/** Ordered area state read from the database between hops (the assert seam). */
|
|
22
|
+
export interface AreaSidebarState {
|
|
23
|
+
/** Areas ordered by TMArea."index" (== sidebar order once materialized). */
|
|
24
|
+
areas: {
|
|
25
|
+
uuid: string;
|
|
26
|
+
title: string;
|
|
27
|
+
index: number;
|
|
28
|
+
}[];
|
|
29
|
+
/** Digest over every untrashed task's area assignment (invariance tripwire). */
|
|
30
|
+
assignmentsDigest: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Auxiliary seams the ui vector needs beyond osascript dispatch. The sidebar
|
|
34
|
+
* drag driver asserts the database between hops; the client wires `areaState`
|
|
35
|
+
* to the open connection. Absent (e.g. the capabilities surface, which never
|
|
36
|
+
* executes), a drag op refuses cleanly.
|
|
37
|
+
*/
|
|
38
|
+
export interface UiDriveAux {
|
|
39
|
+
areaState?: () => AreaSidebarState;
|
|
40
|
+
}
|
|
41
|
+
/** The client-side default aux: reads area order + assignments from the DB. */
|
|
42
|
+
export declare function createUiDriveAux(db: DatabaseSync): UiDriveAux;
|
|
43
|
+
export interface SidebarRect {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
w: number;
|
|
47
|
+
h: number;
|
|
48
|
+
}
|
|
49
|
+
export interface SidebarRowInfo extends SidebarRect {
|
|
50
|
+
/** Concatenated descendant static-text segments, joined with "|". */
|
|
51
|
+
text: string;
|
|
52
|
+
}
|
|
53
|
+
export interface SidebarSnapshot {
|
|
54
|
+
/** The sidebar scroll-area viewport rect (the visible band). */
|
|
55
|
+
viewport: SidebarRect | null;
|
|
56
|
+
/** Vertical scroll fraction 0..1 from the AXScrollBar, when exposed. */
|
|
57
|
+
scroll: number | null;
|
|
58
|
+
rows: SidebarRowInfo[];
|
|
59
|
+
}
|
|
60
|
+
/** Snapshot: sidebar rows (text + frames), viewport rect, scroll fraction. */
|
|
61
|
+
export declare function jxaSidebarSnapshotScript(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Scroll: move the pointer over the sidebar center (wheel events target the
|
|
64
|
+
* surface under the cursor), then post `clicks` line-unit wheel events.
|
|
65
|
+
* Positive clicks move the CONTENT down (earlier rows return, row y grows);
|
|
66
|
+
* negative clicks reveal lower rows (row y shrinks) — AXDRAG1-b.
|
|
67
|
+
*/
|
|
68
|
+
export declare function jxaSidebarScrollScript(clicks: number): string;
|
|
69
|
+
/**
|
|
70
|
+
* Drag: the NATIVE1 gesture verbatim — move, down, 3px wiggle to open the drag
|
|
71
|
+
* session, ~25 interpolated drag events, a settle so the drop indicator locks,
|
|
72
|
+
* then up. Coordinates are AX-resolved frames + slot-boundary geometry computed
|
|
73
|
+
* by the caller in the SAME snapshot generation.
|
|
74
|
+
*/
|
|
75
|
+
export declare function jxaSidebarDragScript(sx: number, sy: number, tx: number, ty: number): string;
|
|
76
|
+
/**
|
|
77
|
+
* Rung 2 — scroll-while-held (AXDRAG2-a: wheel events DO scroll the list while
|
|
78
|
+
* a drag is held, and AX frames re-resolve fresh mid-drag). One atomic
|
|
79
|
+
* gesture: grab the source, post wheel events until the anchor row's LIVE
|
|
80
|
+
* frame enters the visible band (direction re-derived every tick from the
|
|
81
|
+
* live frame), then move to the live-computed boundary and drop. No static
|
|
82
|
+
* corrections are needed — the mid-drag layout already reflects the lifted
|
|
83
|
+
* source. If the anchor never arrives within the tick budget, the script
|
|
84
|
+
* Escape-aborts (AXDRAG1-d: byte-identical index vector) and reports it.
|
|
85
|
+
*/
|
|
86
|
+
export declare function jxaSidebarHeldScrollDragScript(sx: number, sy: number, anchorTitle: string | null, // null = drop below the last row (to-last)
|
|
87
|
+
maxTicks: number): string;
|
|
88
|
+
/** Median height of the table's spacer rows (rows with no static text). */
|
|
89
|
+
export declare function medianSpacerHeight(rows: SidebarRowInfo[]): number | null;
|
|
90
|
+
/**
|
|
91
|
+
* Slot pitch estimate: the median y-delta between adjacent resolved area rows
|
|
92
|
+
* (falls back to entity-row height + spacer height when fewer than two area
|
|
93
|
+
* rows resolve).
|
|
94
|
+
*/
|
|
95
|
+
export declare function slotPitch(orderedAreaRows: {
|
|
96
|
+
title: string;
|
|
97
|
+
row: SidebarRowInfo;
|
|
98
|
+
}[], allRows: SidebarRowInfo[]): number;
|
|
99
|
+
/**
|
|
100
|
+
* The boundary Y that inserts ABOVE `ref`: the midpoint of the region between
|
|
101
|
+
* `ref` and the row immediately above it (the spacer row's center when a
|
|
102
|
+
* spacer sits there; the shared edge when rows are contiguous). With no row
|
|
103
|
+
* above, half a spacer height above `ref` (derived, not assumed).
|
|
104
|
+
*/
|
|
105
|
+
export declare function boundaryAboveRow(allRows: SidebarRowInfo[], ref: SidebarRowInfo): number;
|
|
106
|
+
/**
|
|
107
|
+
* The boundary Y that drops BELOW the final table row (to-last). The drop
|
|
108
|
+
* zone below the last entity IS the trailing spacer row when one exists
|
|
109
|
+
* (AXDRAG1-b landed to-last inside it) — its center keeps the drop in the
|
|
110
|
+
* scrollable band even when the list is pinned to the bottom.
|
|
111
|
+
*/
|
|
112
|
+
export declare function boundaryBelowLast(allRows: SidebarRowInfo[]): number | null;
|
|
113
|
+
export declare function parseSidebarSnapshot(stdout: string): SidebarSnapshot | null;
|
|
114
|
+
/**
|
|
115
|
+
* Does a row's static-text carry this exact title as a segment? Sidebar row
|
|
116
|
+
* text concatenates descendant static texts with "|" (AXDRAG1: e.g.
|
|
117
|
+
* "Area-05.|Source Toggle Template|Area-05") — an exact segment match avoids
|
|
118
|
+
* substring collisions; the trailing-dot variant covers the AXDescription-like
|
|
119
|
+
* first segment some rows carry.
|
|
120
|
+
*/
|
|
121
|
+
export declare function rowMatchesTitle(text: string, title: string): boolean;
|
|
122
|
+
/** All rows matching known area titles, in visual (y) order. */
|
|
123
|
+
export declare function areaRowsInOrder(rows: SidebarRowInfo[], titles: readonly string[]): {
|
|
124
|
+
title: string;
|
|
125
|
+
row: SidebarRowInfo;
|
|
126
|
+
}[];
|
|
127
|
+
/** Find a single area row by title; ambiguous or missing → null. */
|
|
128
|
+
export declare function findAreaRow(rows: SidebarRowInfo[], title: string): SidebarRowInfo | null;
|
|
129
|
+
/**
|
|
130
|
+
* The source's group span: lifting an area collapses its row AND its visible
|
|
131
|
+
* nested project rows. Computed from resolved frames as the distance from the
|
|
132
|
+
* source area row's top to the NEXT area row's top (falls back to the median
|
|
133
|
+
* slot pitch when the source is the last area).
|
|
134
|
+
*/
|
|
135
|
+
export declare function sourceGroupSpan(orderedAreaRows: {
|
|
136
|
+
title: string;
|
|
137
|
+
row: SidebarRowInfo;
|
|
138
|
+
}[], sourceTitle: string, allRows: SidebarRowInfo[]): number;
|
|
139
|
+
/**
|
|
140
|
+
* Static drop boundary Y for the requested placement, computed against the
|
|
141
|
+
* CURRENT snapshot. Every placement reduces to "insert above area R" (the
|
|
142
|
+
* mid-gap above R's row) except to-last, which drops below the final table row.
|
|
143
|
+
*/
|
|
144
|
+
export declare function staticBoundaryY(orderedAreaRows: {
|
|
145
|
+
title: string;
|
|
146
|
+
row: SidebarRowInfo;
|
|
147
|
+
}[], allRows: SidebarRowInfo[], sourceTitle: string, placement: SidebarPlacement): {
|
|
148
|
+
y: number;
|
|
149
|
+
anchor: string;
|
|
150
|
+
} | {
|
|
151
|
+
error: string;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Correct a static boundary for the mid-drag layout: a DOWNWARD drag (boundary
|
|
155
|
+
* below the source) sees everything below the source shift up by the source's
|
|
156
|
+
* group span the instant it is picked up (AXDRAG1-a). Upward drags use static
|
|
157
|
+
* coordinates unchanged.
|
|
158
|
+
*/
|
|
159
|
+
export declare function correctedDropY(staticY: number, sourceCenterY: number, span: number): number;
|
|
160
|
+
export declare function inBand(y: number, viewport: SidebarRect, pad?: number): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Grab/drop x: a fixed FRACTION of the row's resolved width (≈ the label area
|
|
163
|
+
* NATIVE1 clicked at x+170 on a 240px row), clear of the leading icon and the
|
|
164
|
+
* trailing counters — derived from the frame, not a pixel offset.
|
|
165
|
+
*/
|
|
166
|
+
export declare function grabPoint(row: SidebarRowInfo): {
|
|
167
|
+
x: number;
|
|
168
|
+
y: number;
|
|
169
|
+
};
|
|
170
|
+
/** Is the requested placement already satisfied in this DB state? */
|
|
171
|
+
export declare function placementSatisfied(state: AreaSidebarState, targetUuid: string, placement: SidebarPlacement): boolean;
|
|
172
|
+
export interface DragDriveResult {
|
|
173
|
+
ok: boolean;
|
|
174
|
+
/** Human-readable outcome (hop count, rung) or the refusal reason. */
|
|
175
|
+
detail: string;
|
|
176
|
+
/** A gesture may have landed before the failure — recovery state, honestly. */
|
|
177
|
+
recovered?: boolean;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The rung-2 anchor: every placement reduces to "drop above this area row"
|
|
181
|
+
* (title) or "drop below the last row" (null). `undefined` = unresolvable.
|
|
182
|
+
*/
|
|
183
|
+
export declare function rung2AnchorTitle(rows: SidebarRowInfo[], areaTitles: readonly string[], sourceTitle: string, placement: SidebarPlacement): string | null | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Drive the full ladder. `preState` is captured ONCE up front for the whole
|
|
186
|
+
* move (recovery + the caller's undo capture both key off it, not per hop).
|
|
187
|
+
*/
|
|
188
|
+
export declare function driveSidebarAreaReorder(spec: SidebarDragSpec, run: UiRunner, aux: UiDriveAux, sleep?: (ms: number) => Promise<void>): Promise<DragDriveResult>;
|