things-api 0.11.0 → 0.12.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 (192) hide show
  1. package/README.md +16 -5
  2. package/dist/audit/schema.d.ts +7 -0
  3. package/dist/audit/schema.js.map +1 -1
  4. package/dist/cli/commands/area.d.ts +18 -11
  5. package/dist/cli/commands/area.js +55 -67
  6. package/dist/cli/commands/area.js.map +1 -1
  7. package/dist/cli/commands/doctor.d.ts +1 -2
  8. package/dist/cli/commands/doctor.js +11 -1
  9. package/dist/cli/commands/doctor.js.map +1 -1
  10. package/dist/cli/commands/install-skill.d.ts +19 -4
  11. package/dist/cli/commands/install-skill.js +101 -52
  12. package/dist/cli/commands/install-skill.js.map +1 -1
  13. package/dist/cli/commands/mcp.js +9 -0
  14. package/dist/cli/commands/mcp.js.map +1 -1
  15. package/dist/cli/commands/project.d.ts +1 -0
  16. package/dist/cli/commands/project.js +20 -28
  17. package/dist/cli/commands/project.js.map +1 -1
  18. package/dist/cli/commands/reads.js +100 -28
  19. package/dist/cli/commands/reads.js.map +1 -1
  20. package/dist/cli/commands/show.js +32 -8
  21. package/dist/cli/commands/show.js.map +1 -1
  22. package/dist/cli/commands/todo.js +1 -1
  23. package/dist/cli/commands/todo.js.map +1 -1
  24. package/dist/cli/commands/writes.js +769 -143
  25. package/dist/cli/commands/writes.js.map +1 -1
  26. package/dist/cli/did-you-mean.d.ts +14 -3
  27. package/dist/cli/did-you-mean.js +26 -3
  28. package/dist/cli/did-you-mean.js.map +1 -1
  29. package/dist/cli/glyphs.d.ts +16 -2
  30. package/dist/cli/glyphs.js +60 -12
  31. package/dist/cli/glyphs.js.map +1 -1
  32. package/dist/cli/help.js +67 -12
  33. package/dist/cli/help.js.map +1 -1
  34. package/dist/cli/main.js +1 -1
  35. package/dist/cli/main.js.map +1 -1
  36. package/dist/cli/move-hint.d.ts +3 -2
  37. package/dist/cli/move-hint.js +2 -2
  38. package/dist/cli/move-hint.js.map +1 -1
  39. package/dist/cli/read-driver.d.ts +43 -5
  40. package/dist/cli/read-driver.js +81 -15
  41. package/dist/cli/read-driver.js.map +1 -1
  42. package/dist/cli/render.d.ts +19 -8
  43. package/dist/cli/render.js +59 -25
  44. package/dist/cli/render.js.map +1 -1
  45. package/dist/cli/resolve-invocation.d.ts +2 -2
  46. package/dist/cli/resolve-invocation.js +3 -3
  47. package/dist/cli/resolve-invocation.js.map +1 -1
  48. package/dist/cli/skill-check.d.ts +12 -6
  49. package/dist/cli/skill-check.js +31 -14
  50. package/dist/cli/skill-check.js.map +1 -1
  51. package/dist/cli/skill.d.ts +8 -0
  52. package/dist/cli/skill.js +10 -0
  53. package/dist/cli/skill.js.map +1 -1
  54. package/dist/cli/verb-hint.js +1 -1
  55. package/dist/cli/verb-hint.js.map +1 -1
  56. package/dist/client.d.ts +140 -19
  57. package/dist/client.js +253 -38
  58. package/dist/client.js.map +1 -1
  59. package/dist/config.d.ts +66 -2
  60. package/dist/config.js +120 -12
  61. package/dist/config.js.map +1 -1
  62. package/dist/contracts.d.ts +176 -28
  63. package/dist/contracts.js +22 -1
  64. package/dist/contracts.js.map +1 -1
  65. package/dist/diagnose.d.ts +34 -2
  66. package/dist/diagnose.js +36 -1
  67. package/dist/diagnose.js.map +1 -1
  68. package/dist/index.d.ts +19 -8
  69. package/dist/index.js +19 -3
  70. package/dist/index.js.map +1 -1
  71. package/dist/mcp/server.d.ts +9 -0
  72. package/dist/mcp/server.js +733 -304
  73. package/dist/mcp/server.js.map +1 -1
  74. package/dist/model/entities.d.ts +46 -3
  75. package/dist/model/entities.js.map +1 -1
  76. package/dist/model/mappers.d.ts +2 -0
  77. package/dist/model/mappers.js +41 -2
  78. package/dist/model/mappers.js.map +1 -1
  79. package/dist/model/recurrence.d.ts +8 -1
  80. package/dist/model/recurrence.js.map +1 -1
  81. package/dist/read/area-filter.d.ts +76 -0
  82. package/dist/read/area-filter.js +59 -0
  83. package/dist/read/area-filter.js.map +1 -0
  84. package/dist/read/area-view.d.ts +11 -11
  85. package/dist/read/area-view.js +50 -28
  86. package/dist/read/area-view.js.map +1 -1
  87. package/dist/read/detail.js +15 -8
  88. package/dist/read/detail.js.map +1 -1
  89. package/dist/read/predicates.d.ts +18 -0
  90. package/dist/read/predicates.js +19 -0
  91. package/dist/read/predicates.js.map +1 -1
  92. package/dist/read/project-view.d.ts +31 -15
  93. package/dist/read/project-view.js +72 -39
  94. package/dist/read/project-view.js.map +1 -1
  95. package/dist/read/pseudo-area.d.ts +29 -0
  96. package/dist/read/pseudo-area.js +27 -0
  97. package/dist/read/pseudo-area.js.map +1 -0
  98. package/dist/read/queries.d.ts +105 -18
  99. package/dist/read/queries.js +185 -30
  100. package/dist/read/queries.js.map +1 -1
  101. package/dist/read/scope.d.ts +126 -0
  102. package/dist/read/scope.js +162 -0
  103. package/dist/read/scope.js.map +1 -0
  104. package/dist/read/search-rank.d.ts +2 -5
  105. package/dist/read/shape.d.ts +162 -0
  106. package/dist/read/shape.js +686 -0
  107. package/dist/read/shape.js.map +1 -0
  108. package/dist/read/show-target.d.ts +9 -1
  109. package/dist/read/show-target.js +45 -4
  110. package/dist/read/show-target.js.map +1 -1
  111. package/dist/read/stage.d.ts +199 -0
  112. package/dist/read/stage.js +125 -0
  113. package/dist/read/stage.js.map +1 -0
  114. package/dist/read/truncation.d.ts +7 -5
  115. package/dist/read/truncation.js +33 -8
  116. package/dist/read/truncation.js.map +1 -1
  117. package/dist/read/views.d.ts +49 -9
  118. package/dist/read/views.js +193 -40
  119. package/dist/read/views.js.map +1 -1
  120. package/dist/surface-copy.d.ts +9 -0
  121. package/dist/surface-copy.js +9 -0
  122. package/dist/surface-copy.js.map +1 -1
  123. package/dist/write/batch.d.ts +49 -10
  124. package/dist/write/batch.js +423 -71
  125. package/dist/write/batch.js.map +1 -1
  126. package/dist/write/commands.js +266 -55
  127. package/dist/write/commands.js.map +1 -1
  128. package/dist/write/guards.d.ts +1 -1
  129. package/dist/write/guards.js +71 -10
  130. package/dist/write/guards.js.map +1 -1
  131. package/dist/write/heading.d.ts +10 -1
  132. package/dist/write/heading.js +35 -5
  133. package/dist/write/heading.js.map +1 -1
  134. package/dist/write/make-repeating-project.d.ts +2 -2
  135. package/dist/write/make-repeating-project.js +9 -9
  136. package/dist/write/make-repeating-project.js.map +1 -1
  137. package/dist/write/move.d.ts +130 -0
  138. package/dist/write/move.js +1533 -0
  139. package/dist/write/move.js.map +1 -0
  140. package/dist/write/operations.d.ts +105 -19
  141. package/dist/write/operations.js +56 -7
  142. package/dist/write/operations.js.map +1 -1
  143. package/dist/write/opid.d.ts +31 -0
  144. package/dist/write/opid.js +30 -0
  145. package/dist/write/opid.js.map +1 -0
  146. package/dist/write/pipeline.d.ts +70 -3
  147. package/dist/write/pipeline.js +198 -33
  148. package/dist/write/pipeline.js.map +1 -1
  149. package/dist/write/pre-state.d.ts +162 -8
  150. package/dist/write/pre-state.js +385 -20
  151. package/dist/write/pre-state.js.map +1 -1
  152. package/dist/write/reorder.d.ts +23 -3
  153. package/dist/write/reorder.js +1871 -85
  154. package/dist/write/reorder.js.map +1 -1
  155. package/dist/write/reversibility.js +19 -7
  156. package/dist/write/reversibility.js.map +1 -1
  157. package/dist/write/scope-guard.d.ts +31 -0
  158. package/dist/write/scope-guard.js +162 -0
  159. package/dist/write/scope-guard.js.map +1 -0
  160. package/dist/write/undo.js +120 -13
  161. package/dist/write/undo.js.map +1 -1
  162. package/dist/write/vectors/applescript.js +16 -7
  163. package/dist/write/vectors/applescript.js.map +1 -1
  164. package/dist/write/vectors/shortcuts.js +1 -1
  165. package/dist/write/vectors/shortcuts.js.map +1 -1
  166. package/dist/write/vectors/simulator.js +83 -27
  167. package/dist/write/vectors/simulator.js.map +1 -1
  168. package/dist/write/vectors/types.d.ts +11 -0
  169. package/dist/write/vectors/ui-certification.d.ts +3 -3
  170. package/dist/write/vectors/ui-certification.js +41 -5
  171. package/dist/write/vectors/ui-certification.js.map +1 -1
  172. package/dist/write/vectors/ui-drag.d.ts +21 -1
  173. package/dist/write/vectors/ui-drag.js +138 -27
  174. package/dist/write/vectors/ui-drag.js.map +1 -1
  175. package/dist/write/vectors/ui-recipes.d.ts +21 -1
  176. package/dist/write/vectors/ui-recipes.js +166 -7
  177. package/dist/write/vectors/ui-recipes.js.map +1 -1
  178. package/dist/write/vectors/ui.d.ts +25 -1
  179. package/dist/write/vectors/ui.js +142 -33
  180. package/dist/write/vectors/ui.js.map +1 -1
  181. package/dist/write/verify/delta.d.ts +17 -1
  182. package/dist/write/verify/delta.js +106 -29
  183. package/dist/write/verify/delta.js.map +1 -1
  184. package/package.json +7 -1
  185. package/schema/envelope.schema.json +383 -0
  186. package/skills/things-cli/SKILL.md +34 -17
  187. package/skills/things-cli/references/banner.md +35 -0
  188. package/skills/things-cli/references/contracts.md +30 -9
  189. package/skills/things-cli/references/errors.md +49 -0
  190. package/skills/things-cli/references/gui.md +1 -1
  191. package/skills/things-cli/references/model.md +15 -6
  192. package/skills/things-cli/references/ordering.md +71 -0
@@ -91,7 +91,7 @@ export function convertToProjectRecipe(op, targetUuid) {
91
91
  */
92
92
  export function headingConvertToProjectRecipe(projectUuid, ordinal) {
93
93
  return {
94
- op: "heading.convert-to-project",
94
+ op: "project.promote-heading",
95
95
  targetUuid: projectUuid,
96
96
  steps: [
97
97
  {
@@ -200,12 +200,21 @@ const DIALOG_ADD_REMINDERS = dualForm(`checkbox "Add reminders"`);
200
200
  /** "Add deadlines" checkbox + the "start N days earlier" field it reveals as a DIRECT sheet child (text field 1 of the shell). */
201
201
  const DIALOG_ADD_DEADLINES = dualForm(`checkbox "Add deadlines"`);
202
202
  const DIALOG_START_EARLIER = dualForm("text field 1");
203
- /** After-completion unit pop-up options are singular (`day`/`week`/…), not the frequency word. */
203
+ /**
204
+ * After-completion cadence-unit pop-up labels. The options are NOT the frequency
205
+ * word (`weekly`) — they are the time unit, and the app PLURALIZES them by the
206
+ * interval: `week` at interval 1, `weeks` at interval > 1 (0½ defect (c)). The
207
+ * reschedule dialog opens pre-populated with the item's CURRENT interval, so a
208
+ * biweekly template's unit pop-up already reads the plural before the interval
209
+ * field is touched. Both labels are offered as select-popup candidates so the
210
+ * drive is plural-safe and order-independent (the driver clicks whichever
211
+ * exists). Singular first — the interval-1 case and the make-repeating default.
212
+ */
204
213
  const FREQ_TO_AC_UNIT = {
205
- daily: "day",
206
- weekly: "week",
207
- monthly: "month",
208
- yearly: "year",
214
+ daily: ["day", "days"],
215
+ weekly: ["week", "weeks"],
216
+ monthly: ["month", "months"],
217
+ yearly: ["year", "years"],
209
218
  };
210
219
  /** English display titles for the weekday / ordinal / month pop-ups (title-pinned, locale fail-closed). */
211
220
  const WEEKDAY_TITLE = {
@@ -251,6 +260,20 @@ function selectPopup(label, pathCandidates, value) {
251
260
  addressing: "title",
252
261
  };
253
262
  }
263
+ /**
264
+ * A select-popup that clicks the FIRST of several candidate menu-item LABELS
265
+ * that exists (the after-completion unit's singular/plural pair — defect (c)).
266
+ */
267
+ function selectPopupAny(label, pathCandidates, valueCandidates) {
268
+ return {
269
+ primitive: "select-popup",
270
+ label,
271
+ pathCandidates,
272
+ valueCandidates,
273
+ dynamic: true,
274
+ addressing: "title",
275
+ };
276
+ }
254
277
  function setField(label, pathCandidates, value) {
255
278
  return {
256
279
  primitive: "set-value",
@@ -324,7 +347,7 @@ function repeatDialogEntry(rule) {
324
347
  // "after completion" is the first frequency-pop-up option; picking it reveals
325
348
  // a secondary unit pop-up ("after completion, every N <unit>").
326
349
  steps.push(selectPopup("frequency = after completion", DIALOG_FREQUENCY, "after completion"));
327
- steps.push(selectPopup(`after-completion unit = ${rule.frequency}`, DIALOG_AC_UNIT, FREQ_TO_AC_UNIT[rule.frequency]));
350
+ steps.push(selectPopupAny(`after-completion unit = ${rule.frequency}`, DIALOG_AC_UNIT, FREQ_TO_AC_UNIT[rule.frequency]));
328
351
  }
329
352
  else {
330
353
  steps.push(selectPopup(`frequency = ${rule.frequency}`, DIALOG_FREQUENCY, rule.frequency));
@@ -572,6 +595,142 @@ export function projectRescheduleRepeatRecipe(targetUuid, frequency, interval, e
572
595
  ],
573
596
  };
574
597
  }
598
+ // ------------------------------------ cross-project heading move (HEADXPROJ)
599
+ //
600
+ // A heading relocates (with its children) to a DIFFERENT project via the heading
601
+ // row's `…` ellipsis → Move… menu → a keyboard-driven project picker (HEADXPROJ,
602
+ // reordgaps-results.md). No headless spelling exists on any vector. The heading
603
+ // `…` button is an AXUnknown whose AXDescription CARRIES the title
604
+ // (`"More. <title>"`), so — unlike the promote drive's positional row-select —
605
+ // the row is TITLE-addressable; but AXPress on it is INERT (§8j), so it is
606
+ // HID-clicked at its frame center (the click-element primitive), like the project
607
+ // repeat popover. The popover (Archive / Move… / Convert to Project… / Delete) is
608
+ // the same custom AXUnknown-window shape as the repeat popover.
609
+ //
610
+ // PROVISIONAL element paths (pending HXPC1 certification): the `…` button's
611
+ // container path, the popover-item enumeration, and the picker's search field are
612
+ // best-guess structural paths from the HEADXPROJ AX inventory; the certification
613
+ // sitting confirms/corrects them exactly as UIC1 corrected the repeat recipes.
614
+ /** The heading `…` "More. <title>" button — provisionally in the content table. */
615
+ function headingMoreButton(headingTitle) {
616
+ return `(first UI element of ${PROJECT_CONTENT_TABLE} whose description is "More. ${headingTitle}")`;
617
+ }
618
+ /** The ellipsis popover — a custom AXUnknown window (same shape as the repeat popover). */
619
+ const HEADING_ELLIPSIS_POPOVER = `(first window whose subrole is "AXUnknown" and size is not {40, 40})`;
620
+ const HEADING_POPOVER_ITEMS = `scroll area 1 of ${HEADING_ELLIPSIS_POPOVER}`;
621
+ /** The Move… project picker (a searchable list; provisionally a sheet of the main window). */
622
+ const HEADING_MOVE_PICKER = `sheet 1 of ${MAIN_WINDOW}`;
623
+ const HEADING_MOVE_PICKER_FIELD = `text field 1 of ${HEADING_MOVE_PICKER}`;
624
+ /**
625
+ * Move a HEADING to a different project via the ellipsis `Move…` menu (HEADXPROJ).
626
+ * `sourceProjectUuid` is revealed to render the heading row; `headingTitle` is the
627
+ * `"More. <title>"` click target; `destProjectTitle` is typed into the picker,
628
+ * then Return selects the filtered match. DB effect (HEADXPROJ): the heading row's
629
+ * `project` FK becomes the destination; its children follow via their intact
630
+ * heading FK (a single-row change — no child rewrite, no index churn).
631
+ */
632
+ export function moveHeadingToProjectRecipe(sourceProjectUuid, headingTitle, destProjectTitle) {
633
+ return {
634
+ op: "project.move-heading-to-project",
635
+ targetUuid: sourceProjectUuid,
636
+ steps: [
637
+ {
638
+ primitive: "reveal",
639
+ label: "reveal the source project in Things (things:///show?id=)",
640
+ value: sourceProjectUuid,
641
+ },
642
+ {
643
+ // NOT a fallback: the ellipsis + popover clicks are synthesized mouse
644
+ // input, which lands only on the foreground app (NATIVE1-e).
645
+ primitive: "activate",
646
+ label: "bring Things to the foreground (the pointer must reach the heading row)",
647
+ },
648
+ {
649
+ primitive: "click-element",
650
+ label: `open the heading's ellipsis menu ("More. ${headingTitle}")`,
651
+ path: headingMoreButton(headingTitle),
652
+ assertPath: HEADING_ELLIPSIS_POPOVER,
653
+ assertLabel: "the heading ellipsis menu",
654
+ assertTimeoutMs: 5000,
655
+ dynamic: true,
656
+ addressing: "title",
657
+ },
658
+ {
659
+ primitive: "click-element",
660
+ label: "ellipsis menu ▸ Move…",
661
+ path: `(first UI element of ${HEADING_POPOVER_ITEMS} whose description is "Move…")`,
662
+ assertPath: HEADING_MOVE_PICKER,
663
+ assertLabel: "the Move… project picker",
664
+ assertTimeoutMs: 5000,
665
+ dynamic: true,
666
+ addressing: "title",
667
+ },
668
+ {
669
+ primitive: "set-value",
670
+ label: `type the destination "${destProjectTitle}" into the Move… picker`,
671
+ path: HEADING_MOVE_PICKER_FIELD,
672
+ value: destProjectTitle,
673
+ dynamic: true,
674
+ addressing: "title",
675
+ },
676
+ {
677
+ primitive: "key",
678
+ label: "press Return to select the filtered destination project",
679
+ keys: "return",
680
+ dynamic: true,
681
+ addressing: "title",
682
+ },
683
+ ],
684
+ };
685
+ }
686
+ /**
687
+ * Dissolve a HEADING via the ellipsis `Delete` menu item (DISS1). Same
688
+ * `"More. <title>"` reveal as the cross-project move, driving Delete instead of
689
+ * Move…. DB effect (DISS1): the heading row is HARD-DELETED while its children
690
+ * become DIRECT project children (heading→NULL, project→parent, index preserved,
691
+ * NOT trashed) — no confirm sheet, so the Delete click is TERMINAL (the write
692
+ * pipeline's read-after-write is the verifier). The popover's Delete item is
693
+ * AX-description-enumerable and scoped to the popover so it never matches the
694
+ * main window's toolbar Delete.
695
+ */
696
+ export function dissolveHeadingRecipe(projectReveal, headingTitle) {
697
+ return {
698
+ op: "project.dissolve-heading",
699
+ targetUuid: projectReveal,
700
+ steps: [
701
+ {
702
+ primitive: "reveal",
703
+ label: "reveal the heading's project in Things (things:///show?id=)",
704
+ value: projectReveal,
705
+ },
706
+ {
707
+ // NOT a fallback: the ellipsis + popover clicks are synthesized mouse
708
+ // input, which lands only on the foreground app (NATIVE1-e).
709
+ primitive: "activate",
710
+ label: "bring Things to the foreground (the pointer must reach the heading row)",
711
+ },
712
+ {
713
+ primitive: "click-element",
714
+ label: `open the heading's ellipsis menu ("More. ${headingTitle}")`,
715
+ path: headingMoreButton(headingTitle),
716
+ assertPath: HEADING_ELLIPSIS_POPOVER,
717
+ assertLabel: "the heading ellipsis menu",
718
+ assertTimeoutMs: 5000,
719
+ dynamic: true,
720
+ addressing: "title",
721
+ },
722
+ {
723
+ // Terminal click — DISS1 confirmed NO confirmation sheet, the heading
724
+ // dissolves immediately; the read-after-write verifies (heading gone).
725
+ primitive: "click-element",
726
+ label: "ellipsis menu ▸ Delete (dissolve — children become direct project children)",
727
+ path: `(first UI element of ${HEADING_POPOVER_ITEMS} whose description is "Delete")`,
728
+ dynamic: true,
729
+ addressing: "title",
730
+ },
731
+ ],
732
+ };
733
+ }
575
734
  // ------------------------------------------------- sidebar AREA reorder
576
735
  /**
577
736
  * Move an area to a new sidebar position (AXDRAG1/AXDRAG2). The single
@@ -1 +1 @@
1
- {"version":3,"file":"ui-recipes.js","sourceRoot":"","sources":["../../../src/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KAAK,EAAE,SAAS,EAAE;aACxE;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -52,7 +52,7 @@ export declare function axPressScript(path: string): string;
52
52
  * moves focus. Foreground-bound (keystrokes reach the frontmost app) — the
53
53
  * reveal/activate preamble puts Things there. One stable command shape.
54
54
  */
55
- export declare function axSetValueScript(path: string, value: string): string;
55
+ export declare function axSetValueScript(path: string, value: string, attempts?: number): string;
56
56
  /**
57
57
  * select-popup: choose an item in a pop-up button by NAME. Setting `value` on a
58
58
  * Things pop-up button is a silent no-op (UIC1 / UI2-i) — the control must be
@@ -65,6 +65,19 @@ export declare function axSetValueScript(path: string, value: string): string;
65
65
  * stable command shape per primitive.
66
66
  */
67
67
  export declare function axSelectPopupScript(path: string, value: string): string;
68
+ /**
69
+ * select-popup with a CANDIDATE LABEL LIST: open the pop-up (self-healing, as
70
+ * above), then click the FIRST candidate menu item that EXISTS, failing closed
71
+ * (an `error`, so the step reports transport failure) when none do. This is how
72
+ * the after-completion cadence unit is driven: its label is SINGULAR at interval
73
+ * 1 (`week`) but PLURAL at interval > 1 (`weeks`), and a reschedule opens the
74
+ * dialog pre-populated with the item's current interval — so a biweekly
75
+ * repeater's unit pop-up reads `weeks` before the interval field is ever touched
76
+ * (0½ defect (c): the field report's drive died on `menu item "week" not
77
+ * found`). Trying both labels makes the selection order-independent and
78
+ * plural-safe. One stable command shape per primitive.
79
+ */
80
+ export declare function axSelectPopupCandidatesScript(path: string, values: string[]): string;
68
81
  /**
69
82
  * select-row: select a PROJECT row by title, purely via AX (UIC4-a). Walks the
70
83
  * content table's rows, issues the row `select` action on each (which REPLACES
@@ -105,6 +118,17 @@ export declare function axActivateScript(): string;
105
118
  export declare function axKeyScript(keys: string): string;
106
119
  /** The abort keystroke sent to dismiss a half-open sheet/popover on failure. */
107
120
  export declare function axAbortScript(): string;
121
+ /**
122
+ * sheet-open probe: is a modal SHEET attached to the Things standard window, OR
123
+ * a detached repeat-editor / popover window (an `AXUnknown` that is not the
124
+ * 40×40 utility window) present right now? Returns "true"/"false". Used to (d)
125
+ * VERIFY an abort actually dismissed the sheet before claiming it did, and (e)
126
+ * DIAGNOSE a canary miss that is really a leftover sheet from an earlier aborted
127
+ * drive disabling the menu bar. Wrapped in `try` blocks so a missing standard
128
+ * window (a rare transient) reads as "no sheet" rather than erroring. One stable
129
+ * command shape.
130
+ */
131
+ export declare function axSheetOpenScript(): string;
108
132
  /**
109
133
  * resolve-frame: read the element's on-screen frame (top-left origin, points)
110
134
  * from the live AX tree and print "x y w h". Used by `click-element` to target
@@ -69,17 +69,33 @@ export function axPressScript(path) {
69
69
  * moves focus. Foreground-bound (keystrokes reach the frontmost app) — the
70
70
  * reveal/activate preamble puts Things there. One stable command shape.
71
71
  */
72
- export function axSetValueScript(path, value) {
72
+ export function axSetValueScript(path, value, attempts = 3) {
73
+ const v = escapeAppleScript(value);
74
+ const n = Math.max(1, Math.trunc(attempts));
75
+ // CLOSED-LOOP (determinism doctrine): type, Tab-commit, then READ THE FIELD
76
+ // BACK and retry if it did not hold — the interval field, when it is the first
77
+ // numeric field after a frequency/type switch, races the dialog's group
78
+ // re-layout and reverts to 1 (UIC7, oddities §8l). Re-focus + re-type after a
79
+ // settle lands it once the re-layout has finished. Fail-closed (an `error`,
80
+ // i.e. a transport failure the pipeline re-verifies) if it never holds — the
81
+ // create/reschedule delta's rule assertion is the final DB-level authority.
73
82
  return `${SE}
74
83
  set tf to (${path})
75
- set focused of tf to true
76
- delay 0.15
77
- keystroke "a" using command down
78
- delay 0.1
79
- keystroke "${escapeAppleScript(value)}"
80
- delay 0.1
81
- key code 48
82
- delay 0.2
84
+ repeat ${n} times
85
+ set focused of tf to true
86
+ delay 0.15
87
+ keystroke "a" using command down
88
+ delay 0.1
89
+ keystroke "${v}"
90
+ delay 0.1
91
+ key code 48
92
+ delay 0.2
93
+ try
94
+ if ((value of tf) as text) is "${v}" then return "OK"
95
+ end try
96
+ delay 0.3
97
+ end repeat
98
+ error "field did not hold value \\"${v}\\" after ${n} attempt(s); last shown: " & ((value of tf) as text)
83
99
  end tell`;
84
100
  }
85
101
  /**
@@ -94,6 +110,22 @@ end tell`;
94
110
  * stable command shape per primitive.
95
111
  */
96
112
  export function axSelectPopupScript(path, value) {
113
+ return axSelectPopupCandidatesScript(path, [value]);
114
+ }
115
+ /**
116
+ * select-popup with a CANDIDATE LABEL LIST: open the pop-up (self-healing, as
117
+ * above), then click the FIRST candidate menu item that EXISTS, failing closed
118
+ * (an `error`, so the step reports transport failure) when none do. This is how
119
+ * the after-completion cadence unit is driven: its label is SINGULAR at interval
120
+ * 1 (`week`) but PLURAL at interval > 1 (`weeks`), and a reschedule opens the
121
+ * dialog pre-populated with the item's current interval — so a biweekly
122
+ * repeater's unit pop-up reads `weeks` before the interval field is ever touched
123
+ * (0½ defect (c): the field report's drive died on `menu item "week" not
124
+ * found`). Trying both labels makes the selection order-independent and
125
+ * plural-safe. One stable command shape per primitive.
126
+ */
127
+ export function axSelectPopupCandidatesScript(path, values) {
128
+ const list = values.map((v) => `"${escapeAppleScript(v)}"`).join(", ");
97
129
  return `${SE}
98
130
  set pu to (${path})
99
131
  repeat 20 times
@@ -101,7 +133,13 @@ export function axSelectPopupScript(path, value) {
101
133
  click pu
102
134
  delay 0.3
103
135
  end repeat
104
- click menu item "${escapeAppleScript(value)}" of menu 1 of pu
136
+ repeat with candidate in {${list}}
137
+ if (exists menu item candidate of menu 1 of pu) then
138
+ click menu item candidate of menu 1 of pu
139
+ return
140
+ end if
141
+ end repeat
142
+ error "none of the candidate menu items exist: " & {${list}}
105
143
  end tell`;
106
144
  }
107
145
  /**
@@ -194,6 +232,50 @@ export function axKeyScript(keys) {
194
232
  export function axAbortScript() {
195
233
  return `tell application "System Events" to key code 53`; // Escape
196
234
  }
235
+ /**
236
+ * sheet-open probe: is a modal SHEET attached to the Things standard window, OR
237
+ * a detached repeat-editor / popover window (an `AXUnknown` that is not the
238
+ * 40×40 utility window) present right now? Returns "true"/"false". Used to (d)
239
+ * VERIFY an abort actually dismissed the sheet before claiming it did, and (e)
240
+ * DIAGNOSE a canary miss that is really a leftover sheet from an earlier aborted
241
+ * drive disabling the menu bar. Wrapped in `try` blocks so a missing standard
242
+ * window (a rare transient) reads as "no sheet" rather than erroring. One stable
243
+ * command shape.
244
+ */
245
+ export function axSheetOpenScript() {
246
+ return `${SE}
247
+ set sheetOpen to false
248
+ try
249
+ if (exists sheet 1 of (first window whose subrole is "AXStandardWindow")) then set sheetOpen to true
250
+ end try
251
+ try
252
+ if ((count of (windows whose subrole is "AXUnknown" and size is not {40, 40})) > 0) then set sheetOpen to true
253
+ end try
254
+ return sheetOpen
255
+ end tell`;
256
+ }
257
+ /** Is a modal sheet / detached editor currently open? Fail-closed: an errored probe reads as "still open". */
258
+ async function sheetStillOpen(run) {
259
+ const res = await run({ primitive: "resolve", label: "sheet-open probe", script: axSheetOpenScript() }, STEP_TIMEOUT_MS);
260
+ // Only a clean "false" clears the sheet; a probe error is treated as "may
261
+ // still be open" (fail-closed doctrine — never claim dismissal we can't see).
262
+ return !(res.ok && res.stdout.trim() === "false");
263
+ }
264
+ /**
265
+ * Send Escape and VERIFY the sheet/popover is gone (0½ defect (d): the abort
266
+ * must never claim dismissal it did not confirm). Retries Escape ONCE if the
267
+ * first is not honored. Returns whether dismissal was verified — the caller
268
+ * words its partial-state report accordingly (fail-closed: on an unverifiable
269
+ * dismissal it must warn the sheet may remain open).
270
+ */
271
+ async function verifiedAbort(run) {
272
+ const escape = () => run({ primitive: "key", label: "abort (Escape)", script: axAbortScript() }, STEP_TIMEOUT_MS);
273
+ await escape();
274
+ if (!(await sheetStillOpen(run)))
275
+ return { dismissed: true };
276
+ await escape(); // one retry
277
+ return { dismissed: !(await sheetStillOpen(run)) };
278
+ }
197
279
  /**
198
280
  * resolve-frame: read the element's on-screen frame (top-left origin, points)
199
281
  * from the live AX tree and print "x y w h". Used by `click-element` to target
@@ -394,7 +476,9 @@ export function commandForStep(step, targetUuid) {
394
476
  return {
395
477
  primitive: "select-popup",
396
478
  label: step.label,
397
- script: axSelectPopupScript(step.path ?? "", step.value ?? ""),
479
+ script: step.valueCandidates !== undefined
480
+ ? axSelectPopupCandidatesScript(step.path ?? "", step.valueCandidates)
481
+ : axSelectPopupScript(step.path ?? "", step.value ?? ""),
398
482
  };
399
483
  case "set-datetime":
400
484
  return {
@@ -485,9 +569,20 @@ async function driveClickElement(step, run) {
485
569
  }
486
570
  async function drive(recipe, run, aux) {
487
571
  const done = [];
488
- const abort = () => run({ primitive: "key", label: "abort (Escape)", script: axAbortScript() }, STEP_TIMEOUT_MS);
489
- const partial = (failed, why, dismissed = true) => refusal(`ui drive stopped at "${failed}" (${why}). Completed: ${done.join(" ") || "nothing"}.` +
490
- (dismissed ? " The open sheet/popover was dismissed (Escape)." : ""));
572
+ // `dismissed`: true = abort verified the sheet gone; false = abort could NOT
573
+ // confirm dismissal (warn it may remain open defect (d): never claim a
574
+ // dismissal we did not see); undefined = no sheet was opened / no abort ran.
575
+ const partial = (failed, why, dismissed) => {
576
+ const base = `ui drive stopped at "${failed}" (${why}). Completed: ${done.join(" → ") || "nothing"}.`;
577
+ const cleanup = dismissed === true
578
+ ? " The open sheet/popover was dismissed (Escape, confirmed gone)."
579
+ : dismissed === false
580
+ ? " WARNING: a sheet or popover may still be open in Things — Escape did not dismiss it." +
581
+ " Dismiss it manually before retrying (a leftover sheet disables the menu bar and will" +
582
+ " make the next drive's preflight fail)."
583
+ : "";
584
+ return refusal(base + cleanup);
585
+ };
491
586
  // 0. Run the leading reveal/activate preamble BEFORE the canary. The Items
492
587
  // menu is context-dependent — its Repeat submenu (and the plain "Repeat…"
493
588
  // item) only materialize once a matching item is SELECTED (UIC1). Resolving
@@ -515,6 +610,19 @@ async function drive(recipe, run, aux) {
515
610
  // the canary resolves elements one at a time; a single miss aborts before anything is pressed, so parallelizing would waste work and blur which element failed
516
611
  const res = await run({ primitive: "resolve", label, script: axResolveScript(path) }, STEP_TIMEOUT_MS);
517
612
  if (!res.ok || res.stdout.trim() !== "true") {
613
+ // (e) A leftover modal sheet/popover from an earlier aborted drive disables
614
+ // the menu bar, so the Items ▸ Repeat path cannot resolve. Detect that
615
+ // FIRST and name it as the likely cause, ahead of the generic
616
+ // update/Accessibility/language guesses. Not auto-dismissed on a preflight:
617
+ // the leftover sheet may hold a half-entered rule, and this refusal already
618
+ // carries a clean remediation (the drive's own aborts DO dismiss+verify).
619
+ if (await sheetStillOpen(run)) {
620
+ return refusal(`ui preflight refused: element for "${label}" did not resolve (${path}). A modal sheet ` +
621
+ "or popover is currently open in Things — most likely left over from an earlier drive " +
622
+ "that aborted without dismissing it. An open sheet disables the menu bar, so the Repeat " +
623
+ "menu path cannot resolve. Dismiss the open sheet in Things (Escape or Cancel), then " +
624
+ "retry. Nothing was pressed.");
625
+ }
518
626
  return refusal(`ui preflight refused: element for "${label}" did not resolve (${path}) — a Things ` +
519
627
  "update may have changed the menu, Accessibility may not be granted, Things may not " +
520
628
  "be running, or the app may not be in English. Nothing was pressed.");
@@ -529,9 +637,9 @@ async function drive(recipe, run, aux) {
529
637
  // steps are strictly sequential: this wait must resolve before the step that acts on the awaited element runs
530
638
  const ok = await waitForAnyElement(step.pathCandidates ?? [step.path ?? ""], step.label, step.timeoutMs ?? STEP_TIMEOUT_MS, run);
531
639
  if (!ok) {
532
- // the abort keystroke must land before returning the partial-state report
533
- await abort();
534
- return partial(step.label, "the expected element never appeared within the timeout");
640
+ // the abort keystroke must land (and be verified) before returning the partial-state report
641
+ const { dismissed } = await verifiedAbort(run);
642
+ return partial(step.label, "the expected element never appeared within the timeout", dismissed);
535
643
  }
536
644
  done.push(step.label);
537
645
  continue;
@@ -540,12 +648,13 @@ async function drive(recipe, run, aux) {
540
648
  // The sidebar drag driver runs its own snapshot → scroll → drag →
541
649
  // DB-assert ladder (ui-drag.ts); every gesture anchors on frames it
542
650
  // resolves live, and a failed assert triggers a verified recovery drag.
651
+ // No sheet is involved in a drag, so no dismissal clause.
543
652
  if (step.drag === undefined)
544
- return partial(step.label, "no drag spec compiled", false);
653
+ return partial(step.label, "no drag spec compiled");
545
654
  // the drag ladder depends on the UI state the preamble produced
546
655
  const outcome = await driveSidebarAreaReorder(step.drag, run, aux);
547
656
  if (!outcome.ok)
548
- return partial(step.label, outcome.detail, false);
657
+ return partial(step.label, outcome.detail);
549
658
  done.push(`${step.label} (${outcome.detail})`);
550
659
  continue;
551
660
  }
@@ -555,10 +664,10 @@ async function drive(recipe, run, aux) {
555
664
  // the effective form must be resolved before this step can act on it
556
665
  const effective = await resolveStepPath(step, run);
557
666
  if (effective === null) {
558
- // dismiss whatever opened before reporting
559
- await abort();
667
+ // dismiss whatever opened (and verify) before reporting
668
+ const { dismissed } = await verifiedAbort(run);
560
669
  return partial(step.label, "none of its expected element shapes resolved (neither the attached sheet nor the " +
561
- "detached repeat editor window)");
670
+ "detached repeat editor window)", dismissed);
562
671
  }
563
672
  step = { ...step, path: effective };
564
673
  }
@@ -570,8 +679,8 @@ async function drive(recipe, run, aux) {
570
679
  // the selection must land before the menu that acts on it is pressed
571
680
  const res = await run(command, STEP_TIMEOUT_MS);
572
681
  if (!res.ok || res.stdout.trim() !== "OK") {
573
- // clear any transient state before reporting
574
- await abort();
682
+ // clear any transient state (and verify) before reporting
683
+ const { dismissed } = await verifiedAbort(run);
575
684
  const noMatch = step.primitive === "select-heading-row"
576
685
  ? "the project view exposed no selectable heading row at the target position — the " +
577
686
  "heading may have been converted/deleted already, or the project's headings changed"
@@ -581,7 +690,7 @@ async function drive(recipe, run, aux) {
581
690
  ? noMatch
582
691
  : res.timedOut === true
583
692
  ? "the row-selection step timed out"
584
- : res.stderr.trim() || "the row-selection step failed");
693
+ : res.stderr.trim() || "the row-selection step failed", dismissed);
585
694
  }
586
695
  done.push(step.label);
587
696
  continue;
@@ -592,10 +701,9 @@ async function drive(recipe, run, aux) {
592
701
  // the click depends on the UI state the previous step produced
593
702
  const outcome = await driveClickElement(step, run);
594
703
  if (!outcome.ok) {
595
- // dismiss whatever the click opened before reporting
596
- if (outcome.needsAbort === true)
597
- await abort();
598
- return partial(step.label, outcome.why ?? "the click failed");
704
+ // dismiss whatever the click opened (and verify) before reporting
705
+ const dismissed = outcome.needsAbort === true ? (await verifiedAbort(run)).dismissed : undefined;
706
+ return partial(step.label, outcome.why ?? "the click failed", dismissed);
599
707
  }
600
708
  done.push(step.label);
601
709
  continue;
@@ -603,10 +711,11 @@ async function drive(recipe, run, aux) {
603
711
  // each recipe step depends on the UI state the previous step produced; they cannot be parallelized
604
712
  const res = await run(command, STEP_TIMEOUT_MS);
605
713
  if (!res.ok) {
606
- // dismiss the half-open sheet/popover before reporting partial state
607
- if (step.primitive !== "reveal" && step.primitive !== "activate")
608
- await abort();
609
- return partial(step.label, res.timedOut === true ? "the step timed out" : res.stderr.trim() || "the step failed");
714
+ // dismiss the half-open sheet/popover (and verify) before reporting partial state
715
+ const dismissed = step.primitive !== "reveal" && step.primitive !== "activate"
716
+ ? (await verifiedAbort(run)).dismissed
717
+ : undefined;
718
+ return partial(step.label, res.timedOut === true ? "the step timed out" : res.stderr.trim() || "the step failed", dismissed);
610
719
  }
611
720
  done.push(step.label);
612
721
  }