things-api 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +30 -11
  2. package/dist/audit/log.js +56 -2
  3. package/dist/audit/log.js.map +1 -1
  4. package/dist/audit/schema.d.ts +26 -8
  5. package/dist/audit/schema.js +42 -1
  6. package/dist/audit/schema.js.map +1 -1
  7. package/dist/cli/commands/area.d.ts +26 -3
  8. package/dist/cli/commands/area.js +125 -70
  9. package/dist/cli/commands/area.js.map +1 -1
  10. package/dist/cli/commands/doctor.d.ts +1 -1
  11. package/dist/cli/commands/doctor.js +44 -5
  12. package/dist/cli/commands/doctor.js.map +1 -1
  13. package/dist/cli/commands/mcp.js +23 -4
  14. package/dist/cli/commands/mcp.js.map +1 -1
  15. package/dist/cli/commands/project.d.ts +18 -1
  16. package/dist/cli/commands/project.js +69 -31
  17. package/dist/cli/commands/project.js.map +1 -1
  18. package/dist/cli/commands/reads.js +423 -157
  19. package/dist/cli/commands/reads.js.map +1 -1
  20. package/dist/cli/commands/repeat-flags.d.ts +20 -0
  21. package/dist/cli/commands/repeat-flags.js +76 -0
  22. package/dist/cli/commands/repeat-flags.js.map +1 -0
  23. package/dist/cli/commands/setup.js +2 -3
  24. package/dist/cli/commands/setup.js.map +1 -1
  25. package/dist/cli/commands/show.js +47 -24
  26. package/dist/cli/commands/show.js.map +1 -1
  27. package/dist/cli/commands/todo.d.ts +1 -1
  28. package/dist/cli/commands/todo.js +7 -6
  29. package/dist/cli/commands/todo.js.map +1 -1
  30. package/dist/cli/commands/writes.js +378 -148
  31. package/dist/cli/commands/writes.js.map +1 -1
  32. package/dist/cli/did-you-mean.d.ts +1 -1
  33. package/dist/cli/excess-args.d.ts +15 -0
  34. package/dist/cli/excess-args.js +51 -0
  35. package/dist/cli/excess-args.js.map +1 -0
  36. package/dist/cli/glyphs.d.ts +39 -2
  37. package/dist/cli/glyphs.js +91 -21
  38. package/dist/cli/glyphs.js.map +1 -1
  39. package/dist/cli/help.d.ts +54 -0
  40. package/dist/cli/help.js +355 -0
  41. package/dist/cli/help.js.map +1 -0
  42. package/dist/cli/main.js +32 -25
  43. package/dist/cli/main.js.map +1 -1
  44. package/dist/cli/period.d.ts +7 -0
  45. package/dist/cli/period.js +12 -0
  46. package/dist/cli/period.js.map +1 -1
  47. package/dist/cli/read-driver.d.ts +26 -19
  48. package/dist/cli/read-driver.js +67 -33
  49. package/dist/cli/read-driver.js.map +1 -1
  50. package/dist/cli/render.d.ts +92 -28
  51. package/dist/cli/render.js +318 -97
  52. package/dist/cli/render.js.map +1 -1
  53. package/dist/cli/resolve-invocation.d.ts +42 -4
  54. package/dist/cli/resolve-invocation.js +97 -14
  55. package/dist/cli/resolve-invocation.js.map +1 -1
  56. package/dist/cli/tag-filters.d.ts +59 -0
  57. package/dist/cli/tag-filters.js +57 -0
  58. package/dist/cli/tag-filters.js.map +1 -0
  59. package/dist/cli/verb-hint.d.ts +25 -0
  60. package/dist/cli/verb-hint.js +138 -0
  61. package/dist/cli/verb-hint.js.map +1 -0
  62. package/dist/cli/width.d.ts +135 -0
  63. package/dist/cli/width.js +313 -0
  64. package/dist/cli/width.js.map +1 -0
  65. package/dist/client.d.ts +137 -24
  66. package/dist/client.js +105 -16
  67. package/dist/client.js.map +1 -1
  68. package/dist/config.d.ts +11 -0
  69. package/dist/config.js +3 -0
  70. package/dist/config.js.map +1 -1
  71. package/dist/contracts.d.ts +87 -17
  72. package/dist/contracts.js +44 -1
  73. package/dist/contracts.js.map +1 -1
  74. package/dist/db/fingerprint.d.ts +12 -0
  75. package/dist/db/fingerprint.js +15 -1
  76. package/dist/db/fingerprint.js.map +1 -1
  77. package/dist/db/locate.js +1 -1
  78. package/dist/db/locate.js.map +1 -1
  79. package/dist/diagnose.d.ts +63 -0
  80. package/dist/diagnose.js +38 -1
  81. package/dist/diagnose.js.map +1 -1
  82. package/dist/index.d.ts +30 -4
  83. package/dist/index.js +35 -2
  84. package/dist/index.js.map +1 -1
  85. package/dist/mcp/server.d.ts +9 -1
  86. package/dist/mcp/server.js +691 -133
  87. package/dist/mcp/server.js.map +1 -1
  88. package/dist/model/entities.d.ts +31 -7
  89. package/dist/model/entities.js.map +1 -1
  90. package/dist/model/mappers.d.ts +7 -0
  91. package/dist/model/mappers.js +7 -2
  92. package/dist/model/mappers.js.map +1 -1
  93. package/dist/model/serialize.d.ts +28 -0
  94. package/dist/model/serialize.js +80 -0
  95. package/dist/model/serialize.js.map +1 -0
  96. package/dist/model/when-sugar.d.ts +47 -0
  97. package/dist/model/when-sugar.js +45 -0
  98. package/dist/model/when-sugar.js.map +1 -0
  99. package/dist/read/area-view.d.ts +8 -1
  100. package/dist/read/area-view.js +49 -13
  101. package/dist/read/area-view.js.map +1 -1
  102. package/dist/read/filter-contract.d.ts +117 -0
  103. package/dist/read/filter-contract.js +78 -0
  104. package/dist/read/filter-contract.js.map +1 -0
  105. package/dist/read/predicates.d.ts +30 -0
  106. package/dist/read/predicates.js +30 -0
  107. package/dist/read/predicates.js.map +1 -1
  108. package/dist/read/project-view.d.ts +12 -1
  109. package/dist/read/project-view.js +39 -8
  110. package/dist/read/project-view.js.map +1 -1
  111. package/dist/read/queries.d.ts +149 -6
  112. package/dist/read/queries.js +250 -31
  113. package/dist/read/queries.js.map +1 -1
  114. package/dist/read/sections.d.ts +51 -0
  115. package/dist/read/sections.js +37 -0
  116. package/dist/read/sections.js.map +1 -0
  117. package/dist/read/sidebar-order.js +2 -1
  118. package/dist/read/sidebar-order.js.map +1 -1
  119. package/dist/read/tags.d.ts +27 -3
  120. package/dist/read/tags.js +83 -12
  121. package/dist/read/tags.js.map +1 -1
  122. package/dist/read/truncation.d.ts +71 -0
  123. package/dist/read/{pagination.js → truncation.js} +103 -94
  124. package/dist/read/truncation.js.map +1 -0
  125. package/dist/read/views.d.ts +140 -16
  126. package/dist/read/views.js +264 -67
  127. package/dist/read/views.js.map +1 -1
  128. package/dist/surface-copy.d.ts +19 -0
  129. package/dist/surface-copy.js +32 -0
  130. package/dist/surface-copy.js.map +1 -1
  131. package/dist/sync-health.d.ts +78 -0
  132. package/dist/sync-health.js +312 -0
  133. package/dist/sync-health.js.map +1 -0
  134. package/dist/write/accessibility-probe.d.ts +12 -0
  135. package/dist/write/accessibility-probe.js +63 -0
  136. package/dist/write/accessibility-probe.js.map +1 -0
  137. package/dist/write/automation-probe.d.ts +7 -0
  138. package/dist/write/automation-probe.js +8 -1
  139. package/dist/write/automation-probe.js.map +1 -1
  140. package/dist/write/batch.js +4 -2
  141. package/dist/write/batch.js.map +1 -1
  142. package/dist/write/capabilities.d.ts +8 -0
  143. package/dist/write/capabilities.js +13 -6
  144. package/dist/write/capabilities.js.map +1 -1
  145. package/dist/write/commands.d.ts +2 -0
  146. package/dist/write/commands.js +562 -48
  147. package/dist/write/commands.js.map +1 -1
  148. package/dist/write/edit-checklist.js +3 -2
  149. package/dist/write/edit-checklist.js.map +1 -1
  150. package/dist/write/guards.d.ts +2 -7
  151. package/dist/write/guards.js +64 -6
  152. package/dist/write/guards.js.map +1 -1
  153. package/dist/write/heading.js +2 -0
  154. package/dist/write/heading.js.map +1 -1
  155. package/dist/write/lock.d.ts +40 -2
  156. package/dist/write/lock.js +91 -14
  157. package/dist/write/lock.js.map +1 -1
  158. package/dist/write/make-repeating-project.d.ts +4 -0
  159. package/dist/write/make-repeating-project.js +253 -0
  160. package/dist/write/make-repeating-project.js.map +1 -0
  161. package/dist/write/operations.d.ts +145 -1
  162. package/dist/write/operations.js +48 -0
  163. package/dist/write/operations.js.map +1 -1
  164. package/dist/write/pipeline.d.ts +19 -0
  165. package/dist/write/pipeline.js +109 -26
  166. package/dist/write/pipeline.js.map +1 -1
  167. package/dist/write/pre-state.d.ts +68 -3
  168. package/dist/write/pre-state.js +102 -3
  169. package/dist/write/pre-state.js.map +1 -1
  170. package/dist/write/reopen.js +3 -2
  171. package/dist/write/reopen.js.map +1 -1
  172. package/dist/write/reorder.js +27 -17
  173. package/dist/write/reorder.js.map +1 -1
  174. package/dist/write/repeat-rule.d.ts +22 -0
  175. package/dist/write/repeat-rule.js +258 -0
  176. package/dist/write/repeat-rule.js.map +1 -0
  177. package/dist/write/reversibility.js +49 -0
  178. package/dist/write/reversibility.js.map +1 -1
  179. package/dist/write/tag-refs.d.ts +47 -0
  180. package/dist/write/tag-refs.js +126 -0
  181. package/dist/write/tag-refs.js.map +1 -0
  182. package/dist/write/undo.d.ts +74 -5
  183. package/dist/write/undo.js +493 -80
  184. package/dist/write/undo.js.map +1 -1
  185. package/dist/write/vectors/registry.d.ts +17 -1
  186. package/dist/write/vectors/registry.js +18 -2
  187. package/dist/write/vectors/registry.js.map +1 -1
  188. package/dist/write/vectors/types.d.ts +119 -3
  189. package/dist/write/vectors/ui-certification.d.ts +48 -0
  190. package/dist/write/vectors/ui-certification.js +46 -0
  191. package/dist/write/vectors/ui-certification.js.map +1 -0
  192. package/dist/write/vectors/ui-drag.d.ts +188 -0
  193. package/dist/write/vectors/ui-drag.js +1095 -0
  194. package/dist/write/vectors/ui-drag.js.map +1 -0
  195. package/dist/write/vectors/ui-recipes.d.ts +70 -0
  196. package/dist/write/vectors/ui-recipes.js +558 -0
  197. package/dist/write/vectors/ui-recipes.js.map +1 -0
  198. package/dist/write/vectors/ui.d.ts +137 -0
  199. package/dist/write/vectors/ui.js +656 -0
  200. package/dist/write/vectors/ui.js.map +1 -0
  201. package/dist/write/verify/delta.d.ts +31 -3
  202. package/dist/write/verify/delta.js +22 -6
  203. package/dist/write/verify/delta.js.map +1 -1
  204. package/dist/write/verify/poller.js +1 -0
  205. package/dist/write/verify/poller.js.map +1 -1
  206. package/package.json +1 -1
  207. package/dist/cli/exit-codes.d.ts +0 -26
  208. package/dist/cli/exit-codes.js +0 -26
  209. package/dist/cli/exit-codes.js.map +0 -1
  210. package/dist/cli/output.d.ts +0 -42
  211. package/dist/cli/output.js +0 -16
  212. package/dist/cli/output.js.map +0 -1
  213. package/dist/read/pagination.d.ts +0 -104
  214. package/dist/read/pagination.js.map +0 -1
@@ -0,0 +1,558 @@
1
+ const ITEMS_MENU = `menu "Items" of menu bar 1`;
2
+ /**
3
+ * The main Things window. Sheets (confirm dialogs, the Repeat dialog) attach
4
+ * here — NOT to `window 1`, which is a 40×40 AXUnknown utility window that sits
5
+ * at index 1 (UIC1). Address by subrole so it survives window-title changes as
6
+ * the user navigates between lists.
7
+ */
8
+ const MAIN_WINDOW = `(first window whose subrole is "AXStandardWindow")`;
9
+ /** Reveal + (fallback) activate — the common preamble of every recipe. */
10
+ function preamble(targetUuid) {
11
+ return [
12
+ {
13
+ primitive: "reveal",
14
+ label: "reveal the target in Things (things:///show?id=)",
15
+ value: targetUuid,
16
+ },
17
+ {
18
+ primitive: "activate",
19
+ label: "bring Things to the foreground (skipped once background press is certified)",
20
+ activateFallback: true,
21
+ },
22
+ ];
23
+ }
24
+ /** A static menu-item press (canary-resolvable up front). */
25
+ function menuPress(label, path, canaryPath) {
26
+ return {
27
+ primitive: "press",
28
+ label,
29
+ path,
30
+ ...(canaryPath !== undefined && { canaryPath }),
31
+ addressing: "title",
32
+ };
33
+ }
34
+ const REPEAT_SUBMENU_ANCHOR = `menu item "Repeat" of ${ITEMS_MENU}`;
35
+ /** Wait for a dynamic element (sheet/popover) to appear, then abort on timeout. */
36
+ function waitFor(label, path, timeoutMs = 5000) {
37
+ return { primitive: "wait", label, path, timeoutMs, dynamic: true, addressing: "title" };
38
+ }
39
+ // --------------------------------------------------------------- tier 1
40
+ export function pauseRepeatRecipe(targetUuid) {
41
+ return {
42
+ op: "todo.pause-repeat",
43
+ targetUuid,
44
+ steps: [
45
+ ...preamble(targetUuid),
46
+ menuPress("Items ▸ Repeat ▸ Pause", `menu item "Pause" of menu 1 of menu item "Repeat" of ${ITEMS_MENU}`, REPEAT_SUBMENU_ANCHOR),
47
+ ],
48
+ };
49
+ }
50
+ export function resumeRepeatRecipe(targetUuid) {
51
+ return {
52
+ op: "todo.resume-repeat",
53
+ targetUuid,
54
+ steps: [
55
+ ...preamble(targetUuid),
56
+ menuPress("Items ▸ Repeat ▸ Resume", `menu item "Resume" of menu 1 of menu item "Repeat" of ${ITEMS_MENU}`, REPEAT_SUBMENU_ANCHOR),
57
+ ],
58
+ };
59
+ }
60
+ export function convertToProjectRecipe(op, targetUuid) {
61
+ return {
62
+ op,
63
+ targetUuid,
64
+ steps: [
65
+ ...preamble(targetUuid),
66
+ menuPress("Items ▸ Convert to Project…", `menu item "Convert to Project…" of ${ITEMS_MENU}`),
67
+ waitFor("the confirmation sheet", `sheet 1 of ${MAIN_WINDOW}`),
68
+ {
69
+ // The alert's primary button carries a stable, locale-proof
70
+ // AXIdentifier "action-button-1" (UIC1); prefer it over the English title.
71
+ primitive: "press",
72
+ label: 'confirm — press "Convert"',
73
+ path: `(first button of sheet 1 of ${MAIN_WINDOW} whose value of attribute "AXIdentifier" is "action-button-1")`,
74
+ dynamic: true,
75
+ addressing: "axidentifier",
76
+ },
77
+ ],
78
+ };
79
+ }
80
+ // The to-do stop-repeat recipe was REMOVED (roadmap build item 4): it never
81
+ // certified (its Stop popover lives only on the open card, reachable only by a
82
+ // mouse double-click — UIC1/UIC2-d) and no project.stop-repeat is built either
83
+ // (the project Stop then selecting the demoted project crashes Things — CRASH1
84
+ // / oddities §7 C5). See docs/design/ax-initiative.md and docs/design/ui-vector.md.
85
+ // --------------------------------------------------------------- tier 2
86
+ //
87
+ // The Repeat dialog is the SAME editor for a to-do and a project, and it
88
+ // presents in TWO forms: an attached `AXSheet` when Things is frontmost, and a
89
+ // DETACHED top-level `AXUnknown` window when backgrounded (UIC4-a). Its controls
90
+ // sit at the same container depth in both (UIC5-e), so every control is
91
+ // addressed by BOTH shapes (`pathCandidates`) and the driver dispatches against
92
+ // whichever resolves. The frequency pop-up + interval field + OK button were
93
+ // LAB-CERTIFIED (UIC1/UIC5); the full-vocabulary controls below (weekday set,
94
+ // monthly/yearly anchors, Ends bound, reminders/deadlines) are now LAB-CERTIFIED
95
+ // too (UIC6, 2026-07-15) — the sitting corrected their structural indices
96
+ // wholesale (the field-map best-guess was wrong; see docs/lab/uic6-rule-vocabulary.md).
97
+ // The reminder-time control is undrivable (its AXDateTimeArea ignores AX writes),
98
+ // so `--reminder` is refused upstream in assertRepeatRule; its recipe step is
99
+ // retained but unreachable.
100
+ /** The content list's table (row 0 = area/Someday header, then projects/to-dos). Confirmed UIC5. */
101
+ const PROJECT_CONTENT_TABLE = `table 1 of scroll area 1 of ${MAIN_WINDOW}`;
102
+ /** The Repeat editor when Things is frontmost — an attached sheet (interval nested in group 1, UIC1). */
103
+ const REPEAT_SHEET = `sheet 1 of ${MAIN_WINDOW}`;
104
+ /** The Repeat editor when Things is backgrounded — a detached AXUnknown window (UIC4-a). Its
105
+ * controls sit at the SAME depth as the sheet's (frequency a direct child, interval in group 1) — UIC5-e. */
106
+ const REPEAT_DETACHED = `(first window whose subrole is "AXUnknown" and size is not {40, 40})`;
107
+ /** The two dialog shells (sheet | detached window), in priority order. */
108
+ const DIALOG_SHELLS = [REPEAT_SHEET, REPEAT_DETACHED];
109
+ /** Address `inner` (an element specifier) inside BOTH dialog shells. */
110
+ function dualForm(inner) {
111
+ return DIALOG_SHELLS.map((shell) => `${inner} of ${shell}`);
112
+ }
113
+ // --- CERTIFIED controls (UIC1/UIC5) --------------------------------------
114
+ /** Frequency pop-up — a direct child of the dialog. */
115
+ const DIALOG_FREQUENCY = dualForm("pop up button 1");
116
+ /** Interval field — nested in group 1 (UIC5-e). */
117
+ const DIALOG_INTERVAL = dualForm("text field 1 of group 1");
118
+ /** OK button. */
119
+ const DIALOG_OK = dualForm(`button "OK"`);
120
+ // --- UIC6-CERTIFIED controls (corrected from the field-map best-guess) ---
121
+ // The dialog's rule controls (except the reminder/end-date pickers) all live in
122
+ // the cadence AXGroup (`group 1`); UIC6 sat the live tree and fixed the
123
+ // provisional structural indices. The invariant that made them addressable:
124
+ // the "Ends" pop-up is ALWAYS `pop up button 1 of group 1`, so the per-frequency
125
+ // pop-ups follow it (weekday=2; monthly mode=2/ordinal=3; yearly month=2/mode=3/
126
+ // ordinal=4). Titles/`_NS:` ids are never used (both drift). See
127
+ // docs/lab/uic6-rule-vocabulary.md for the per-control evidence.
128
+ /** After-completion cadence unit pop-up — the ONLY group pop-up in that mode. */
129
+ const DIALOG_AC_UNIT = dualForm("pop up button 1 of group 1");
130
+ /** Weekly day-of-week pop-up — pop up button 2 (Ends is pop up button 1). */
131
+ const DIALOG_WEEKDAY = dualForm("pop up button 2 of group 1");
132
+ /** Weekly "+" button that adds a weekday row (title-less AXButton — button 1 of the group). */
133
+ const DIALOG_ADD_WEEKDAY = dualForm("button 1 of group 1");
134
+ /** Monthly MODE pop-up (`day` · Sunday…Saturday) — pop up button 2. */
135
+ const DIALOG_MONTH_MODE = dualForm("pop up button 2 of group 1");
136
+ /** Monthly ORDINAL pop-up (`last` · 1st…31st) — pop up button 3. */
137
+ const DIALOG_MONTH_ORDINAL = dualForm("pop up button 3 of group 1");
138
+ /** Yearly MONTH pop-up — pop up button 2 (Ends 1, then month/mode/ordinal). */
139
+ const DIALOG_YEAR_MONTH = dualForm("pop up button 2 of group 1");
140
+ const DIALOG_YEAR_MODE = dualForm("pop up button 3 of group 1");
141
+ const DIALOG_YEAR_ORDINAL = dualForm("pop up button 4 of group 1");
142
+ /** "Ends" bound pop-up (`never` · `after` · `on date`) — always pop up button 1 of the group. */
143
+ const DIALOG_ENDS = dualForm("pop up button 1 of group 1");
144
+ /** "Ends after [n]" count field — becomes text field 1 of the group once shown (interval was set earlier while it was the sole field). */
145
+ const DIALOG_ENDS_COUNT = dualForm("text field 1 of group 1");
146
+ /** "Add reminders" checkbox (sheet-level, title-pinned). The time is an AXDateTimeArea driven by set-datetime. */
147
+ const DIALOG_ADD_REMINDERS = dualForm(`checkbox "Add reminders"`);
148
+ /** "Add deadlines" checkbox + the "start N days earlier" field it reveals as a DIRECT sheet child (text field 1 of the shell). */
149
+ const DIALOG_ADD_DEADLINES = dualForm(`checkbox "Add deadlines"`);
150
+ const DIALOG_START_EARLIER = dualForm("text field 1");
151
+ /** After-completion unit pop-up options are singular (`day`/`week`/…), not the frequency word. */
152
+ const FREQ_TO_AC_UNIT = {
153
+ daily: "day",
154
+ weekly: "week",
155
+ monthly: "month",
156
+ yearly: "year",
157
+ };
158
+ /** English display titles for the weekday / ordinal / month pop-ups (title-pinned, locale fail-closed). */
159
+ const WEEKDAY_TITLE = {
160
+ sunday: "Sunday",
161
+ monday: "Monday",
162
+ tuesday: "Tuesday",
163
+ wednesday: "Wednesday",
164
+ thursday: "Thursday",
165
+ friday: "Friday",
166
+ saturday: "Saturday",
167
+ };
168
+ const ORDINAL_TITLE = {
169
+ 1: "1st",
170
+ 2: "2nd",
171
+ 3: "3rd",
172
+ 4: "4th",
173
+ 5: "5th",
174
+ };
175
+ const MONTH_TITLE = [
176
+ "January",
177
+ "February",
178
+ "March",
179
+ "April",
180
+ "May",
181
+ "June",
182
+ "July",
183
+ "August",
184
+ "September",
185
+ "October",
186
+ "November",
187
+ "December",
188
+ ];
189
+ function ordinalTitle(ordinal) {
190
+ return ordinal === "last" ? "last" : ORDINAL_TITLE[ordinal];
191
+ }
192
+ function selectPopup(label, pathCandidates, value) {
193
+ return {
194
+ primitive: "select-popup",
195
+ label,
196
+ pathCandidates,
197
+ value,
198
+ dynamic: true,
199
+ addressing: "title",
200
+ };
201
+ }
202
+ function setField(label, pathCandidates, value) {
203
+ return {
204
+ primitive: "set-value",
205
+ label,
206
+ pathCandidates,
207
+ value,
208
+ dynamic: true,
209
+ addressing: "title",
210
+ };
211
+ }
212
+ function pressControl(label, pathCandidates) {
213
+ return { primitive: "press", label, pathCandidates, dynamic: true, addressing: "title" };
214
+ }
215
+ /**
216
+ * Set the dialog's date/time picker (reminder time / end-date bound). The
217
+ * control is an `AXDateTimeArea` located by role within the front dialog (UIC6),
218
+ * so it carries no element path — the driver's set-datetime primitive finds it.
219
+ * `spec` is `time:HH:mm` or `date:YYYY-MM-DD`.
220
+ */
221
+ function setDateTime(label, spec) {
222
+ return { primitive: "set-datetime", label, value: spec, dynamic: true, addressing: "title" };
223
+ }
224
+ /** Steps that drive the day anchor of a monthly rule into the mode + ordinal pop-ups. */
225
+ function monthlyAnchorSteps(anchor, mode, ordinal) {
226
+ if ("day" in anchor) {
227
+ // mode = "day"; ordinal names the day-of-month (or "last").
228
+ return [
229
+ selectPopup("monthly mode = day", mode, "day"),
230
+ selectPopup(`monthly day = ${anchor.day}`, ordinal, anchor.day === "last" ? "last" : ORDINAL_TITLE_ANY(anchor.day)),
231
+ ];
232
+ }
233
+ return [
234
+ selectPopup(`monthly weekday = ${anchor.weekday}`, mode, WEEKDAY_TITLE[anchor.weekday]),
235
+ selectPopup(`monthly ordinal = ${anchor.ordinal}`, ordinal, ordinalTitle(anchor.ordinal)),
236
+ ];
237
+ }
238
+ /** Day-of-month ordinal display (1st…31st). */
239
+ function ORDINAL_TITLE_ANY(day) {
240
+ const mod100 = day % 100;
241
+ if (mod100 >= 11 && mod100 <= 13)
242
+ return `${day}th`;
243
+ switch (day % 10) {
244
+ case 1:
245
+ return `${day}st`;
246
+ case 2:
247
+ return `${day}nd`;
248
+ case 3:
249
+ return `${day}rd`;
250
+ default:
251
+ return `${day}th`;
252
+ }
253
+ }
254
+ /**
255
+ * Build the ordered dialog-entry steps for the FULL rule vocabulary, every
256
+ * control addressed in BOTH dialog forms. A bare `{ frequency, interval }`
257
+ * emits exactly the certified frequency → interval → OK path; each optional
258
+ * field appends its own control steps before OK.
259
+ */
260
+ function repeatDialogEntry(rule) {
261
+ const steps = [
262
+ {
263
+ primitive: "wait",
264
+ label: "the Repeat dialog",
265
+ pathCandidates: DIALOG_FREQUENCY,
266
+ dynamic: true,
267
+ timeoutMs: 5000,
268
+ addressing: "title",
269
+ },
270
+ ];
271
+ if (rule.afterCompletion === true) {
272
+ // "after completion" is the first frequency-pop-up option; picking it reveals
273
+ // a secondary unit pop-up ("after completion, every N <unit>").
274
+ steps.push(selectPopup("frequency = after completion", DIALOG_FREQUENCY, "after completion"));
275
+ steps.push(selectPopup(`after-completion unit = ${rule.frequency}`, DIALOG_AC_UNIT, FREQ_TO_AC_UNIT[rule.frequency]));
276
+ }
277
+ else {
278
+ steps.push(selectPopup(`frequency = ${rule.frequency}`, DIALOG_FREQUENCY, rule.frequency));
279
+ }
280
+ steps.push(setField(`interval = ${rule.interval}`, DIALOG_INTERVAL, String(rule.interval)));
281
+ if (rule.weekdays !== undefined && rule.weekdays.length > 0) {
282
+ const [first, ...rest] = rule.weekdays;
283
+ if (first !== undefined) {
284
+ steps.push(selectPopup(`weekday = ${first}`, DIALOG_WEEKDAY, WEEKDAY_TITLE[first]));
285
+ }
286
+ // Each additional weekday: press "+" to add a row, then the new pop-up. The
287
+ // added pop-up's index shifts per row; UIC6 confirms the exact addressing —
288
+ // provisionally the same DIALOG_WEEKDAY pop-up re-driven after the add.
289
+ for (const day of rest) {
290
+ steps.push(pressControl(`add weekday row (${day})`, DIALOG_ADD_WEEKDAY));
291
+ steps.push(selectPopup(`weekday += ${day}`, DIALOG_WEEKDAY, WEEKDAY_TITLE[day]));
292
+ }
293
+ }
294
+ if (rule.monthly !== undefined) {
295
+ steps.push(...monthlyAnchorSteps(rule.monthly, DIALOG_MONTH_MODE, DIALOG_MONTH_ORDINAL));
296
+ }
297
+ if (rule.yearly !== undefined) {
298
+ const y = rule.yearly;
299
+ steps.push(selectPopup(`yearly month = ${y.month}`, DIALOG_YEAR_MONTH, MONTH_TITLE[y.month - 1] ?? ""));
300
+ steps.push(...monthlyAnchorSteps(y, DIALOG_YEAR_MODE, DIALOG_YEAR_ORDINAL));
301
+ }
302
+ if (rule.ends !== undefined && rule.ends.kind !== "never") {
303
+ if (rule.ends.kind === "after") {
304
+ steps.push(selectPopup("ends = after", DIALOG_ENDS, "after"));
305
+ steps.push(setField(`ends after = ${rule.ends.count}`, DIALOG_ENDS_COUNT, String(rule.ends.count)));
306
+ }
307
+ else {
308
+ steps.push(selectPopup("ends = on date", DIALOG_ENDS, "on date"));
309
+ steps.push(setDateTime(`ends on = ${rule.ends.date}`, `date:${rule.ends.date}`));
310
+ }
311
+ }
312
+ if (rule.reminder !== undefined) {
313
+ steps.push(pressControl("check Add reminders", DIALOG_ADD_REMINDERS));
314
+ steps.push(setDateTime(`reminder = ${rule.reminder}`, `time:${rule.reminder}`));
315
+ }
316
+ if (rule.deadline === true || (rule.startDaysEarlier ?? 0) > 0) {
317
+ steps.push(pressControl("check Add deadlines", DIALOG_ADD_DEADLINES));
318
+ if ((rule.startDaysEarlier ?? 0) > 0) {
319
+ steps.push(setField(`start ${rule.startDaysEarlier} days earlier`, DIALOG_START_EARLIER, String(rule.startDaysEarlier)));
320
+ }
321
+ }
322
+ steps.push(pressControl('press "OK"', DIALOG_OK));
323
+ return steps;
324
+ }
325
+ export function makeRepeatingRecipe(targetUuid, frequency, interval, extras = {}) {
326
+ return {
327
+ op: "todo.make-repeating",
328
+ targetUuid,
329
+ steps: [
330
+ ...preamble(targetUuid),
331
+ menuPress("Items ▸ Repeat…", `menu item "Repeat…" of ${ITEMS_MENU}`),
332
+ ...repeatDialogEntry({ frequency, interval, ...extras }),
333
+ ],
334
+ };
335
+ }
336
+ // ------------------------------------------------- make-repeating a PROJECT
337
+ //
338
+ // A project has no things:///show handle that selects it as a to-do (the reveal
339
+ // URL selects to-dos only, UIC1). UIC4 found the pure-AX path: reveal the
340
+ // project's CONTAINER (its AREA view, or the SOMEDAY view for an area-less
341
+ // someday project), then select the project as a content-table ROW (UIC4-a) —
342
+ // coordinate-free, background-capable, no focus steal. With the row selected,
343
+ // `Items ▸ Repeat…` is present + enabled and opens the SAME Repeat dialog as the
344
+ // to-do op. An area-less ANYTIME project has no selectable row (it renders as a
345
+ // header, UIC4-d) — the orchestrator coerces it to Someday first, so the recipe
346
+ // only ever handles the area / someday cases.
347
+ /**
348
+ * Make a PROJECT repeating (UIC4-f). `containerReveal` is the AREA uuid whose
349
+ * view renders the project as a row, or the literal "someday" for an area-less
350
+ * someday project; `title` is matched against the row's selection readback.
351
+ * The area-less-anytime case is handled by the orchestrator (Someday coercion)
352
+ * BEFORE this recipe runs, so it always reveals an area or the Someday view.
353
+ */
354
+ export function projectMakeRepeatingRecipe(containerReveal, projectUuid, title, frequency, interval, extras = {}) {
355
+ return {
356
+ op: "project.make-repeating",
357
+ targetUuid: projectUuid,
358
+ steps: [
359
+ {
360
+ primitive: "reveal",
361
+ label: `reveal the container in Things (things:///show?id=${containerReveal})`,
362
+ value: containerReveal,
363
+ },
364
+ {
365
+ // Not needed for correctness (pure AX is background-capable), a fallback only.
366
+ primitive: "activate",
367
+ label: "bring Things to the foreground (skipped once background AX is certified)",
368
+ activateFallback: true,
369
+ },
370
+ {
371
+ primitive: "select-row",
372
+ label: `select the project row for "${title}" (AXSelectedRows)`,
373
+ path: PROJECT_CONTENT_TABLE,
374
+ value: title,
375
+ addressing: "title",
376
+ },
377
+ // Items ▸ Repeat… materializes only once the row is selected (UIC1) — so it
378
+ // is waited-for + pressed dynamically, not resolved in the canary.
379
+ {
380
+ primitive: "wait",
381
+ label: "Items ▸ Repeat… (enabled once the project row is selected)",
382
+ path: `menu item "Repeat…" of ${ITEMS_MENU}`,
383
+ dynamic: true,
384
+ timeoutMs: 5000,
385
+ addressing: "title",
386
+ },
387
+ {
388
+ primitive: "press",
389
+ label: "Items ▸ Repeat…",
390
+ path: `menu item "Repeat…" of ${ITEMS_MENU}`,
391
+ dynamic: true,
392
+ addressing: "title",
393
+ },
394
+ ...repeatDialogEntry({ frequency, interval, ...extras }),
395
+ ],
396
+ };
397
+ }
398
+ export function rescheduleRepeatRecipe(targetUuid, frequency, interval, extras = {}) {
399
+ return {
400
+ op: "todo.reschedule-repeat",
401
+ targetUuid,
402
+ steps: [
403
+ ...preamble(targetUuid),
404
+ menuPress("Items ▸ Repeat ▸ Reschedule…", `menu item "Reschedule…" of menu 1 of menu item "Repeat" of ${ITEMS_MENU}`, REPEAT_SUBMENU_ANCHOR),
405
+ ...repeatDialogEntry({ frequency, interval, ...extras }),
406
+ ],
407
+ };
408
+ }
409
+ // --------------------------------------------------- repeating-PROJECT ops
410
+ //
411
+ // A repeating project has no Items ▸ Repeat submenu (a shown project is not a
412
+ // selected to-do — UIC2). Instead its view carries an always-visible REPEAT BAR
413
+ // (`text area 2` of the header cell); clicking it opens a custom popover
414
+ // [Change… · Pause↔Resume · Stop · Show Latest]. The bar is AX-resolvable and
415
+ // the popover items are AX-READABLE but INERT to AXPress (UIC2), so they are
416
+ // actuated with a synthetic MOUSE click at their AX-resolved frame center
417
+ // (the NATIVE1 primitive) — never a guessed pixel. The Repeat dialog the
418
+ // Change… item opens is a sheet, byte-identical to the to-do dialog, and is
419
+ // driven with pure AX (reusing repeatDialogEntry). NO project.stop-repeat is
420
+ // built: the project Stop then selecting the demoted project crashes Things
421
+ // (CRASH1 / oddities §7 C5).
422
+ //
423
+ // PROVISIONAL element paths (pending UIC3 certification): the header cell, the
424
+ // repeat bar, the popover, and the popover items are best-guess structural
425
+ // paths derived from the UIC2 AX inventory; the certification pass confirms or
426
+ // corrects them exactly as the to-do recipes were corrected in UIC1.
427
+ /** The header cell of the project view (row 1 of the content table). */
428
+ const PROJECT_HEADER_CELL = `UI element 1 of row 1 of table 1 of scroll area 1 of ${MAIN_WINDOW}`;
429
+ /** The always-visible repeat bar of a repeating project (UIC2/UIC3: text area 2). */
430
+ const PROJECT_REPEAT_BAR = `text area 2 of ${PROJECT_HEADER_CELL}`;
431
+ /**
432
+ * The popover opened by clicking the repeat bar. Confirmed by UIC3 discovery: it
433
+ * is a SEPARATE AXUnknown top-level window (≈215×220), NOT a `pop over` of the
434
+ * standard window — the same custom-window shape UIC2 found for the `…` menu.
435
+ * Two AXUnknown windows exist while it is open (the popover + a hidden 40×40
436
+ * utility window), so it is addressed by subrole AND by not being that 40×40
437
+ * utility window; its items live in the window's scroll area.
438
+ */
439
+ const PROJECT_REPEAT_POPOVER = `(first window whose subrole is "AXUnknown" and size is not {40, 40})`;
440
+ const PROJECT_REPEAT_POPOVER_ITEMS = `scroll area 1 of ${PROJECT_REPEAT_POPOVER}`;
441
+ /** A project view + foreground preamble — the mouse segment needs Things frontmost. */
442
+ function projectPreamble(targetUuid) {
443
+ return [
444
+ {
445
+ primitive: "reveal",
446
+ label: "reveal the project in Things (things:///show?id=)",
447
+ value: targetUuid,
448
+ },
449
+ {
450
+ // NOT a fallback here: the repeat-bar/popover clicks are synthesized mouse
451
+ // input, which lands only on the foreground app (NATIVE1-e).
452
+ primitive: "activate",
453
+ label: "bring Things to the foreground (the pointer must reach its repeat bar)",
454
+ },
455
+ ];
456
+ }
457
+ /** Click the always-visible repeat bar to open the [Change…/Pause/Stop/…] popover. */
458
+ function openProjectRepeatPopover() {
459
+ return {
460
+ primitive: "click-element",
461
+ label: "open the project's repeat menu (click the repeat bar)",
462
+ path: PROJECT_REPEAT_BAR,
463
+ assertPath: PROJECT_REPEAT_POPOVER,
464
+ assertLabel: "the repeat menu",
465
+ assertTimeoutMs: 5000,
466
+ addressing: "title",
467
+ };
468
+ }
469
+ /** Click a popover item by its AX description (frame-resolved, AXPress is inert). */
470
+ function popoverItemClick(label, description, assert) {
471
+ return {
472
+ primitive: "click-element",
473
+ label,
474
+ path: `(first UI element of ${PROJECT_REPEAT_POPOVER_ITEMS} whose description is "${description}")`,
475
+ // The popover only exists after openProjectRepeatPopover ran, so this is not
476
+ // canary-resolvable up front; its frame is resolved (fail-closed) at run time.
477
+ dynamic: true,
478
+ ...(assert !== undefined && {
479
+ assertPath: assert.path,
480
+ assertLabel: assert.label,
481
+ assertTimeoutMs: 5000,
482
+ }),
483
+ addressing: "title",
484
+ };
485
+ }
486
+ export function projectPauseRepeatRecipe(targetUuid) {
487
+ return {
488
+ op: "project.pause-repeat",
489
+ targetUuid,
490
+ steps: [
491
+ ...projectPreamble(targetUuid),
492
+ openProjectRepeatPopover(),
493
+ popoverItemClick("repeat menu ▸ Pause", "Pause"),
494
+ ],
495
+ };
496
+ }
497
+ export function projectResumeRepeatRecipe(targetUuid) {
498
+ return {
499
+ op: "project.resume-repeat",
500
+ targetUuid,
501
+ steps: [
502
+ ...projectPreamble(targetUuid),
503
+ openProjectRepeatPopover(),
504
+ popoverItemClick("repeat menu ▸ Resume", "Resume"),
505
+ ],
506
+ };
507
+ }
508
+ export function projectRescheduleRepeatRecipe(targetUuid, frequency, interval, extras = {}) {
509
+ return {
510
+ op: "project.reschedule-repeat",
511
+ targetUuid,
512
+ steps: [
513
+ ...projectPreamble(targetUuid),
514
+ openProjectRepeatPopover(),
515
+ popoverItemClick("repeat menu ▸ Change…", "Change…", {
516
+ path: `sheet 1 of ${MAIN_WINDOW}`,
517
+ label: "the Repeat dialog",
518
+ }),
519
+ ...repeatDialogEntry({ frequency, interval, ...extras }),
520
+ ],
521
+ };
522
+ }
523
+ // ------------------------------------------------- sidebar AREA reorder
524
+ /**
525
+ * Move an area to a new sidebar position (AXDRAG1/AXDRAG2). The single
526
+ * drag-reorder step is a COMPOSITE the driver expands into snapshot → scroll →
527
+ * drag → database-assert cycles (src/write/vectors/ui-drag.ts); there is no
528
+ * static element path to canary — the drag driver fails closed on its own
529
+ * frame resolution before any synthesis. Foreground-bound (HID drag).
530
+ */
531
+ export function areaReorderSidebarRecipe(target, placement) {
532
+ const destination = placement.kind === "before"
533
+ ? `above "${placement.title}"`
534
+ : placement.kind === "after"
535
+ ? `below "${placement.title}"`
536
+ : placement.kind === "first"
537
+ ? "to the top of the area list"
538
+ : "to the bottom of the area list";
539
+ return {
540
+ op: "area.reorder",
541
+ targetUuid: target.uuid,
542
+ steps: [
543
+ {
544
+ // NOT a fallback: the drag is synthesized mouse input, which lands
545
+ // only on the foreground app (NATIVE1-e).
546
+ primitive: "activate",
547
+ label: "bring Things to the foreground (the pointer must reach the sidebar)",
548
+ },
549
+ {
550
+ primitive: "drag-reorder",
551
+ label: `drag the area "${target.title}" ${destination}`,
552
+ dynamic: true,
553
+ drag: { targetUuid: target.uuid, targetTitle: target.title, placement },
554
+ },
555
+ ],
556
+ };
557
+ }
558
+ //# sourceMappingURL=ui-recipes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-recipes.js","sourceRoot":"","sources":["../../../src/write/vectors/ui-recipes.ts"],"names":[],"mappings":"AAkDA,MAAM,UAAU,GAAG,4BAA4B,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,GAAG,oDAAoD,CAAC;AAEzE,0EAA0E;AAC1E,SAAS,QAAQ,CAAC,UAAkB;IAClC,OAAO;QACL;YACE,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,kDAAkD;YACzD,KAAK,EAAE,UAAU;SAClB;QACD;YACE,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,6EAA6E;YACpF,gBAAgB,EAAE,IAAI;SACvB;KACF,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,SAAS,SAAS,CAAC,KAAa,EAAE,IAAY,EAAE,UAAmB;IACjE,OAAO;QACL,SAAS,EAAE,OAAO;QAClB,KAAK;QACL,IAAI;QACJ,GAAG,CAAC,UAAU,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,CAAC;QAC/C,UAAU,EAAE,OAAO;KACpB,CAAC;AACJ,CAAC;AAED,MAAM,qBAAqB,GAAG,yBAAyB,UAAU,EAAE,CAAC;AAEpE,mFAAmF;AACnF,SAAS,OAAO,CAAC,KAAa,EAAE,IAAY,EAAE,SAAS,GAAG,IAAI;IAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAC3F,CAAC;AAED,yEAAyE;AAEzE,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,OAAO;QACL,EAAE,EAAE,mBAAmB;QACvB,UAAU;QACV,KAAK,EAAE;YACL,GAAG,QAAQ,CAAC,UAAU,CAAC;YACvB,SAAS,CACP,wBAAwB,EACxB,wDAAwD,UAAU,EAAE,EACpE,qBAAqB,CACtB;SACF;KACF,CAA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