things-api 0.18.0 → 0.19.1

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 (224) hide show
  1. package/README.md +18 -9
  2. package/deputy/AppIcon.icns +0 -0
  3. package/deputy/VERSION +1 -1
  4. package/deputy/helpers-Info.plist +4 -0
  5. package/deputy/prebuilt/Things API Helper.app/Contents/CodeResources +0 -0
  6. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/Info.plist +3 -1
  7. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/MacOS/things-reader +0 -0
  8. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/Resources/AppIcon.icns +0 -0
  9. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/_CodeSignature/CodeResources +15 -2
  10. package/deputy/prebuilt/Things API Helper.app/Contents/Info.plist +5 -1
  11. package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
  12. package/deputy/prebuilt/Things API Helper.app/Contents/Resources/AppIcon.icns +0 -0
  13. package/deputy/prebuilt/Things API Helper.app/Contents/_CodeSignature/CodeResources +14 -2
  14. package/deputy/reader/Info.plist +2 -0
  15. package/deputy/reader/entitlements.plist +30 -0
  16. package/deputy/reader/main.swift +129 -40
  17. package/deputy/src/server.swift +25 -2
  18. package/deputy/src/tcc.swift +58 -0
  19. package/dist/audit/schema.d.ts +30 -1
  20. package/dist/audit/schema.js.map +1 -1
  21. package/dist/capability.d.ts +322 -0
  22. package/dist/capability.js +706 -0
  23. package/dist/capability.js.map +1 -0
  24. package/dist/cli/commands/doctor.d.ts +13 -1
  25. package/dist/cli/commands/doctor.js +141 -5
  26. package/dist/cli/commands/doctor.js.map +1 -1
  27. package/dist/cli/commands/helpers.js +189 -51
  28. package/dist/cli/commands/helpers.js.map +1 -1
  29. package/dist/cli/commands/mcp.js +8 -0
  30. package/dist/cli/commands/mcp.js.map +1 -1
  31. package/dist/cli/commands/op-result.js +6 -0
  32. package/dist/cli/commands/op-result.js.map +1 -1
  33. package/dist/cli/commands/reads.js +47 -1
  34. package/dist/cli/commands/reads.js.map +1 -1
  35. package/dist/cli/commands/repeat-flags.js +34 -2
  36. package/dist/cli/commands/repeat-flags.js.map +1 -1
  37. package/dist/cli/commands/setup.d.ts +9 -0
  38. package/dist/cli/commands/setup.js +76 -83
  39. package/dist/cli/commands/setup.js.map +1 -1
  40. package/dist/cli/commands/writes.d.ts +1 -1
  41. package/dist/cli/commands/writes.js +311 -142
  42. package/dist/cli/commands/writes.js.map +1 -1
  43. package/dist/cli/dry-run.d.ts +1 -1
  44. package/dist/cli/dry-run.js +1 -1
  45. package/dist/cli/glyphs.d.ts +23 -4
  46. package/dist/cli/glyphs.js +46 -19
  47. package/dist/cli/glyphs.js.map +1 -1
  48. package/dist/cli/help.d.ts +1 -1
  49. package/dist/cli/help.js +49 -27
  50. package/dist/cli/help.js.map +1 -1
  51. package/dist/cli/interrupt.d.ts +54 -6
  52. package/dist/cli/interrupt.js +78 -12
  53. package/dist/cli/interrupt.js.map +1 -1
  54. package/dist/cli/main.js +8 -5
  55. package/dist/cli/main.js.map +1 -1
  56. package/dist/cli/period.d.ts +3 -1
  57. package/dist/cli/period.js +1 -1
  58. package/dist/cli/period.js.map +1 -1
  59. package/dist/cli/read-driver.js +26 -1
  60. package/dist/cli/read-driver.js.map +1 -1
  61. package/dist/cli/render.d.ts +31 -4
  62. package/dist/cli/render.js +127 -15
  63. package/dist/cli/render.js.map +1 -1
  64. package/dist/client.d.ts +23 -3
  65. package/dist/client.js +36 -13
  66. package/dist/client.js.map +1 -1
  67. package/dist/contracts.d.ts +8 -4
  68. package/dist/contracts.js +1 -1
  69. package/dist/contracts.js.map +1 -1
  70. package/dist/deputy/install.d.ts +234 -6
  71. package/dist/deputy/install.js +843 -31
  72. package/dist/deputy/install.js.map +1 -1
  73. package/dist/deputy/notices.js +2 -2
  74. package/dist/deputy/notices.js.map +1 -1
  75. package/dist/deputy/protocol.d.ts +59 -5
  76. package/dist/deputy/protocol.js +48 -11
  77. package/dist/deputy/protocol.js.map +1 -1
  78. package/dist/deputy/routing.d.ts +37 -0
  79. package/dist/deputy/routing.js +181 -27
  80. package/dist/deputy/routing.js.map +1 -1
  81. package/dist/deputy/wake.d.ts +61 -0
  82. package/dist/deputy/wake.js +149 -0
  83. package/dist/deputy/wake.js.map +1 -0
  84. package/dist/diagnose.d.ts +19 -4
  85. package/dist/diagnose.js +64 -8
  86. package/dist/diagnose.js.map +1 -1
  87. package/dist/direct-setup.d.ts +104 -0
  88. package/dist/direct-setup.js +658 -0
  89. package/dist/direct-setup.js.map +1 -0
  90. package/dist/host-access.d.ts +75 -0
  91. package/dist/host-access.js +177 -0
  92. package/dist/host-access.js.map +1 -0
  93. package/dist/index.d.ts +20 -5
  94. package/dist/index.js +14 -1
  95. package/dist/index.js.map +1 -1
  96. package/dist/mcp/server.d.ts +27 -1
  97. package/dist/mcp/server.js +308 -109
  98. package/dist/mcp/server.js.map +1 -1
  99. package/dist/op-result.d.ts +9 -0
  100. package/dist/op-result.js +13 -1
  101. package/dist/op-result.js.map +1 -1
  102. package/dist/read/filter-contract.d.ts +1 -1
  103. package/dist/read/filter-contract.js +4 -0
  104. package/dist/read/filter-contract.js.map +1 -1
  105. package/dist/read/shape.js +4 -0
  106. package/dist/read/shape.js.map +1 -1
  107. package/dist/read/views.d.ts +29 -0
  108. package/dist/read/views.js +60 -0
  109. package/dist/read/views.js.map +1 -1
  110. package/dist/session-grant.d.ts +48 -0
  111. package/dist/session-grant.js +185 -0
  112. package/dist/session-grant.js.map +1 -0
  113. package/dist/surface-copy.d.ts +19 -3
  114. package/dist/surface-copy.js +19 -3
  115. package/dist/surface-copy.js.map +1 -1
  116. package/dist/wizard.d.ts +58 -0
  117. package/dist/wizard.js +174 -0
  118. package/dist/wizard.js.map +1 -0
  119. package/dist/write/availability.d.ts +1 -16
  120. package/dist/write/availability.js +10 -65
  121. package/dist/write/availability.js.map +1 -1
  122. package/dist/write/batch.d.ts +20 -0
  123. package/dist/write/batch.js +111 -21
  124. package/dist/write/batch.js.map +1 -1
  125. package/dist/write/capabilities.d.ts +9 -0
  126. package/dist/write/capabilities.js +2 -0
  127. package/dist/write/capabilities.js.map +1 -1
  128. package/dist/write/clear-reminder.js +1 -1
  129. package/dist/write/clear-reminder.js.map +1 -1
  130. package/dist/write/commands.d.ts +22 -7
  131. package/dist/write/commands.js +231 -254
  132. package/dist/write/commands.js.map +1 -1
  133. package/dist/write/failure-hints.d.ts +32 -7
  134. package/dist/write/failure-hints.js +9 -14
  135. package/dist/write/failure-hints.js.map +1 -1
  136. package/dist/write/guards.js +22 -4
  137. package/dist/write/guards.js.map +1 -1
  138. package/dist/write/lock.d.ts +16 -13
  139. package/dist/write/lock.js +55 -0
  140. package/dist/write/lock.js.map +1 -1
  141. package/dist/write/make-repeating-project.js +9 -13
  142. package/dist/write/make-repeating-project.js.map +1 -1
  143. package/dist/write/move.js +9 -12
  144. package/dist/write/move.js.map +1 -1
  145. package/dist/write/operations.d.ts +51 -29
  146. package/dist/write/operations.js +16 -0
  147. package/dist/write/operations.js.map +1 -1
  148. package/dist/write/opid.d.ts +72 -14
  149. package/dist/write/opid.js +152 -8
  150. package/dist/write/opid.js.map +1 -1
  151. package/dist/write/param-schema.d.ts +80 -0
  152. package/dist/write/param-schema.js +754 -0
  153. package/dist/write/param-schema.js.map +1 -0
  154. package/dist/write/pipeline.d.ts +110 -5
  155. package/dist/write/pipeline.js +288 -14
  156. package/dist/write/pipeline.js.map +1 -1
  157. package/dist/write/pre-state.d.ts +38 -16
  158. package/dist/write/pre-state.js +117 -22
  159. package/dist/write/pre-state.js.map +1 -1
  160. package/dist/write/promote-clone.js +658 -444
  161. package/dist/write/promote-clone.js.map +1 -1
  162. package/dist/write/reorder.js +25 -8
  163. package/dist/write/reorder.js.map +1 -1
  164. package/dist/write/repeat-collateral.d.ts +31 -0
  165. package/dist/write/repeat-collateral.js +153 -0
  166. package/dist/write/repeat-collateral.js.map +1 -0
  167. package/dist/write/repeat-rule.d.ts +28 -1
  168. package/dist/write/repeat-rule.js +54 -4
  169. package/dist/write/repeat-rule.js.map +1 -1
  170. package/dist/write/resolution-timestamps.d.ts +11 -0
  171. package/dist/write/resolution-timestamps.js +108 -40
  172. package/dist/write/resolution-timestamps.js.map +1 -1
  173. package/dist/write/reversibility.js +4 -0
  174. package/dist/write/reversibility.js.map +1 -1
  175. package/dist/write/template-mutation.d.ts +137 -0
  176. package/dist/write/template-mutation.js +598 -0
  177. package/dist/write/template-mutation.js.map +1 -0
  178. package/dist/write/undo.js +10 -20
  179. package/dist/write/undo.js.map +1 -1
  180. package/dist/write/update-fields.d.ts +151 -0
  181. package/dist/write/update-fields.js +427 -0
  182. package/dist/write/update-fields.js.map +1 -0
  183. package/dist/write/vectors/applescript.js +6 -10
  184. package/dist/write/vectors/applescript.js.map +1 -1
  185. package/dist/write/vectors/registry.d.ts +1 -1
  186. package/dist/write/vectors/registry.js +10 -2
  187. package/dist/write/vectors/registry.js.map +1 -1
  188. package/dist/write/vectors/shortcuts.js +2 -2
  189. package/dist/write/vectors/shortcuts.js.map +1 -1
  190. package/dist/write/vectors/simulator.js +15 -4
  191. package/dist/write/vectors/simulator.js.map +1 -1
  192. package/dist/write/vectors/types.d.ts +268 -1
  193. package/dist/write/vectors/ui-certification.js +63 -13
  194. package/dist/write/vectors/ui-certification.js.map +1 -1
  195. package/dist/write/vectors/ui-chord.d.ts +144 -0
  196. package/dist/write/vectors/ui-chord.js +428 -0
  197. package/dist/write/vectors/ui-chord.js.map +1 -0
  198. package/dist/write/vectors/ui-drag.d.ts +8 -4
  199. package/dist/write/vectors/ui-drag.js +2 -0
  200. package/dist/write/vectors/ui-drag.js.map +1 -1
  201. package/dist/write/vectors/ui-recipes.d.ts +70 -3
  202. package/dist/write/vectors/ui-recipes.js +482 -44
  203. package/dist/write/vectors/ui-recipes.js.map +1 -1
  204. package/dist/write/vectors/ui.d.ts +280 -10
  205. package/dist/write/vectors/ui.js +1068 -77
  206. package/dist/write/vectors/ui.js.map +1 -1
  207. package/dist/write/vectors/url-scheme.js +3 -0
  208. package/dist/write/vectors/url-scheme.js.map +1 -1
  209. package/dist/write/verify/delta.d.ts +62 -0
  210. package/dist/write/verify/delta.js +36 -2
  211. package/dist/write/verify/delta.js.map +1 -1
  212. package/dist/write/verify/poller.d.ts +4 -1
  213. package/dist/write/verify/poller.js +14 -0
  214. package/dist/write/verify/poller.js.map +1 -1
  215. package/package.json +2 -1
  216. package/schema/envelope.schema.json +6 -4
  217. package/scripts/build-helpers.sh +5 -0
  218. package/skills/things-cli/SKILL.md +5 -3
  219. package/skills/things-cli/references/contracts.md +1 -0
  220. package/skills/things-cli/references/data-model.md +3 -0
  221. package/skills/things-cli/references/errors.md +1 -1
  222. package/skills/things-cli/references/gui.md +1 -0
  223. package/skills/things-cli/references/repeating.md +6 -0
  224. package/skills/things-cli/references/tag-cleanup.md +64 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"param-schema.js","sourceRoot":"","sources":["../../src/write/param-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,eAAe,EACf,QAAQ,GAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAyCxE,MAAM,GAAG,GAAG,CAAC,QAAQ,GAAG,oBAAoB,EAAa,EAAE,CAAC,CAAC;IAC3D,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,IAAI;IACd,QAAQ;CACT,CAAC,CAAC;AAEH,sEAAsE;AACtE,MAAM,IAAI,GAAG,CAAC,QAAQ,GAAG,UAAU,EAAa,EAAE,CAAC,CAAC,EAAE,IAAI,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C,CAAC,CAAC;AAC3E,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAA2D,EAAE,CAAC;IACvE,KAAK,MAAM,EAAE,IAAI,eAAe,EAAE,CAAC;QACjC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAA8B,CAAC,EAAE,CAAC;YAC3F,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa;gBAAE,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -5,14 +5,16 @@ import type { DisruptionTier, ThingsApiConfig } from "../config.ts";
5
5
  import type { FingerprintStatus } from "../db/fingerprint.ts";
6
6
  import { type ResolvedScope } from "../read/scope.ts";
7
7
  import { type ShortcutsState } from "./availability.ts";
8
+ import { type UiCapability, type UrlSchemeCapability, type WriteCapability, type WriteCapabilityOptions } from "../capability.ts";
8
9
  import { type EnvironmentTracker } from "./environment.ts";
9
10
  import { type LikelyCause } from "./failure-hints.ts";
10
11
  import { type HazardId } from "./guards.ts";
12
+ import { type AcquireMutationLockOptions } from "./lock.ts";
11
13
  import { type Acknowledgements, type OperationKind, type OperationParamsMap } from "./operations.ts";
12
14
  import { type CompletionContext } from "./completion-context.ts";
13
15
  import { type PreserveModifiedFailure } from "./preserve-modified.ts";
14
16
  import type { VectorId, WriteVector } from "./vectors/types.ts";
15
- import { type DeltaSpec, type RepeatingDiscovery } from "./verify/delta.ts";
17
+ import { type DeltaSpec, type OccurrenceResolution, type RepeatingDiscovery } from "./verify/delta.ts";
16
18
  import { type PollerDeps } from "./verify/poller.ts";
17
19
  export interface WriteOptions extends Acknowledgements {
18
20
  /** Caps vector selection; defaults from the config profile. */
@@ -138,6 +140,17 @@ export type MutationResult = {
138
140
  * reschedule the repeat). Absent for every other op.
139
141
  */
140
142
  repeating?: RepeatingDiscovery;
143
+ /**
144
+ * Template-target composite outcome (ADDITIVE, presence-keyed): present
145
+ * when `complete`/`cancel`/`update --exception` was aimed at a REPEATING
146
+ * to-do, naming both uuids — the series the caller named and the
147
+ * occurrence the composite actually wrote — plus whether that occurrence
148
+ * was minted for this call (`minted`) and the date it carries. The
149
+ * result's own `uuid` is the occurrence (the row that changed, and what
150
+ * undo reaches); this field is how a caller learns WHICH occurrence that
151
+ * is without inferring it. Absent for every other op.
152
+ */
153
+ occurrence?: OccurrenceResolution;
141
154
  /** Advisory notes (e.g. a changed environment tuple — consent may re-prompt later). */
142
155
  warnings?: string[];
143
156
  /**
@@ -188,7 +201,19 @@ export type MutationResult = {
188
201
  } | {
189
202
  kind: "verify-failed";
190
203
  op: OperationKind;
191
- reason: "timeout" | "mismatch" | "silent-noop";
204
+ /**
205
+ * `timeout` / `mismatch` / `silent-noop` are the read-after-write verdicts.
206
+ * `ui-unreachable` is the ENVIRONMENT verdict (#512): a GUI drive stopped
207
+ * because the Things window was not reachable/answering, and the re-verify
208
+ * found nothing landed — the app never got the chance to accept or reject
209
+ * the command, so it must not be reported as a silent no-op.
210
+ * `collateral` is the UNEXPLAINED-DELTA verdict (CGRD1): the requested
211
+ * change WAS applied, but a field the caller never named moved with it and
212
+ * nothing in the rule vocabulary attributes the movement. The write landed,
213
+ * so a retry is the wrong move — `collateral` names the field and both
214
+ * values so the caller looks first.
215
+ */
216
+ reason: "timeout" | "mismatch" | "silent-noop" | "ui-unreachable" | "collateral";
192
217
  expected: DeltaSpec;
193
218
  observed: Record<string, unknown> | null;
194
219
  detail: string;
@@ -208,7 +233,13 @@ export type MutationResult = {
208
233
  } | {
209
234
  kind: "blocked";
210
235
  op: OperationKind;
211
- reason: "hazard" | "disruption-tier" | "drift" | "lock" | "environment" | "clock" | "scope";
236
+ /**
237
+ * `reconcile` is the IDEMPOTENCY refusal: a resubmission's `opId` matched
238
+ * an earlier attempt that never finished confirming, and that attempt's
239
+ * record carries nothing that can tell whether its change landed — so the
240
+ * caller is told to look rather than handed a guess (src/write/opid.ts).
241
+ */
242
+ reason: "hazard" | "disruption-tier" | "drift" | "lock" | "environment" | "clock" | "scope" | "reconcile";
212
243
  hazard?: HazardId;
213
244
  detail: string;
214
245
  remediation: string;
@@ -253,10 +284,23 @@ export interface WriteDeps {
253
284
  sdefProbe?: () => boolean;
254
285
  /** Consent-churn tripwire: tuple recorded per verified mutation (client wires the default). */
255
286
  environment?: EnvironmentTracker;
256
- /** Seam: on-disk 'Enable Things URLs' state for failure attribution (availability.ts). */
257
- urlSchemeEnabled?: () => boolean | null;
287
+ /**
288
+ * Seam: prompt-free "Enable Things URLs" standing, for the URL gate AND for
289
+ * failure attribution when that gate let the write through (capability.ts).
290
+ */
291
+ urlSchemeCapability?: () => UrlSchemeCapability;
258
292
  /** Seam: installed Things proxy shortcuts, for the pre-dispatch availability gate (availability.ts). */
259
293
  shortcutProxies?: () => ShortcutsState;
294
+ /**
295
+ * Seam: prompt-free app-automation standing, for the write gate
296
+ * (capability.ts). Takes the gate's PURPOSE, so what this dispatch asked for
297
+ * is observable — `dispatch` (start a closed Things before judging where its
298
+ * app control stands) or `survey` (report the dormancy; `auto-launch` is off,
299
+ * and the user's instruction not to start the app is obeyed here too).
300
+ */
301
+ writeCapability?: (options: WriteCapabilityOptions) => WriteCapability;
302
+ /** Seam: prompt-free GUI-driving standing, for the Article IV gate (capability.ts). */
303
+ uiCapability?: () => UiCapability;
260
304
  now?: () => Date;
261
305
  /** Default consumer IANA zone (client-resolved from THINGS_TZ); normalizes consumer `when` tokens. */
262
306
  zone?: string;
@@ -303,6 +347,24 @@ export declare function normalizeConsumerWhen(params: Record<string, unknown>, n
303
347
  detail: string;
304
348
  remediation: string;
305
349
  };
350
+ /**
351
+ * Run a COMPOSITE — a single verb the engine executes as several mutations —
352
+ * under ONE mutation lock held end-to-end, so it serializes against other
353
+ * writers as a whole instead of leg by leg. Every leg's own
354
+ * `acquireMutationLock` inside `body` is a reentrant no-op (see
355
+ * {@link withMutationLock}); the per-leg lock stays the base case for an
356
+ * ordinary single mutation.
357
+ *
358
+ * Wrap only the MUTATING tail: validation, dry-run planning, and the hazard /
359
+ * session gates belong outside, so a refusal never takes the lock. On contention
360
+ * the refusal is the same `blocked` / `lock` shape the pipeline returns for a
361
+ * single op, carrying the composite's own op name. No audit record is written
362
+ * for it — unlike the single-op path, nothing was attempted, so there is no leg
363
+ * to record.
364
+ */
365
+ export declare function runComposite(deps: WriteDeps, op: OperationKind, body: () => Promise<MutationResult>,
366
+ /** @internal test seam — see {@link AcquireMutationLockOptions}. */
367
+ lockOptions?: AcquireMutationLockOptions): Promise<MutationResult>;
306
368
  export declare function runMutation<K extends OperationKind>(deps: WriteDeps, op: K, params: OperationParamsMap[K], options?: WriteOptions): Promise<MutationResult>;
307
369
  /**
308
370
  * Build the single-op idempotency REPLAY result from the matched audit record —
@@ -312,6 +374,49 @@ export declare function runMutation<K extends OperationKind>(deps: WriteDeps, op
312
374
  * uses (only for a non-leg, reversible op — an irreversible op or a batch leg
313
375
  * carries none), and `title` rides `requested.title` when the record stored one
314
376
  * (the audit record has no dedicated title field — see the trail-record note).
377
+ *
378
+ * A template-target composite's summary record additionally stored WHICH
379
+ * occurrence it wrote ({@link OccurrenceResolution}); that rides back verbatim,
380
+ * so a retry that replays instead of executing still names the same two uuids
381
+ * the original call returned — the whole point of putting an `opId` on a verb
382
+ * that would otherwise mint a second occurrence.
315
383
  */
316
384
  export declare function replayResultFromRecord(record: AuditRecord): MutationResult;
385
+ /**
386
+ * Append a COMPOSITE's summary record — the single record that stands for a
387
+ * multi-leg verb on the trail. It is what `undo` targets (the legs are excluded
388
+ * from direct targeting) and, when the caller supplied one, the ONE record that
389
+ * carries the composite's `opId`, so a resubmission matches the whole verb
390
+ * exactly once instead of matching a leg (or nothing at all).
391
+ *
392
+ * Shared by both composite families — the resolution-timestamp flip-dance
393
+ * (resolution-timestamps.ts) and the template-target CNC composites
394
+ * (template-mutation.ts) — so the two cannot drift on what a summary record
395
+ * looks like.
396
+ *
397
+ * Two shapes, one record either way (mirroring the promote compounds'
398
+ * `appendPromoteSummary`):
399
+ * - the SUCCESS summary (default) — result `ok`, the single undoable unit;
400
+ * - an AMBIGUOUS summary (`ambiguous`) — result `verify-failed:timeout` with the
401
+ * presence oracle attached, written when a leg dispatched and never confirmed.
402
+ * It is not an undo target (undo reads `ok` records only); it exists so a
403
+ * resubmission carrying the same key re-reads state and decides instead of
404
+ * running the whole composite again.
405
+ */
406
+ export declare function appendCompositeSummary(deps: WriteDeps, args: {
407
+ startedAt: Date;
408
+ op: OperationKind;
409
+ uuid: string;
410
+ txnId: string;
411
+ invocation: string;
412
+ /** The composite's own request, as the caller expressed it. */
413
+ requested?: Record<string, unknown>;
414
+ /** How the composite as a whole reached the app (its most disruptive leg). */
415
+ vector?: VectorId;
416
+ disruption?: DisruptionTier;
417
+ options?: WriteOptions;
418
+ occurrence?: OccurrenceResolution;
419
+ /** The unconfirmed-outcome shape: the assertion a resubmission re-evaluates. */
420
+ ambiguous?: DeltaSpec;
421
+ }): string;
317
422
  export declare function fingerprintLabel(fp: FingerprintStatus, config: ThingsApiConfig): "ok" | "drift" | "user-accepted" | "unknown";
@@ -15,14 +15,16 @@ import { liveSeriesInstances, resolveProjectWriteTarget, resolveTaskUuidPrefix,
15
15
  import { namedProjectClause, taskMembershipClause } from "../read/scope.js";
16
16
  import { evaluateScope } from "./scope-guard.js";
17
17
  import { isThingsRunning } from "./automation-probe.js";
18
- import { readShortcutProxies, readUrlSchemeEnabled } from "./availability.js";
18
+ import { readShortcutProxies } from "./availability.js";
19
+ import { uiAllowed, uiCapability as uiCapabilityDefault, urlSchemeAllowed, urlSchemeCapability as urlSchemeCapabilityDefault, writeAllowed, writeCapability as writeCapabilityDefault, } from "../capability.js";
19
20
  import { COMMANDS } from "./commands.js";
20
21
  import { describeEnvironmentChanges, diffEnvironment, } from "./environment.js";
21
22
  import { privateReorderIsNoOp, sdefDeclaresPrivateReorder } from "./experimental.js";
22
23
  import { classifyTransportFailure, classifyVerifyFailure, } from "./failure-hints.js";
23
24
  import { evaluateGuards } from "./guards.js";
24
- import { acquireMutationLock, MutationLockError } from "./lock.js";
25
+ import { acquireMutationLock, MutationLockError, withMutationLock, } from "./lock.js";
25
26
  import { isHeadingTargetOp, } from "./operations.js";
27
+ import { assertOperationParams } from "./param-schema.js";
26
28
  import { computeCompletionContext } from "./completion-context.js";
27
29
  import { assessOffRuleFirst } from "./repeat-anchor.js";
28
30
  import { planVector } from "./planner.js";
@@ -31,6 +33,7 @@ import { restoreModDates, } from "./preserve-modified.js";
31
33
  import { REVERSIBILITY } from "./reversibility.js";
32
34
  import { certificationOf } from "./vectors/ui-certification.js";
33
35
  import { createDbReader, evaluateDelta, getField, } from "./verify/delta.js";
36
+ import { COLLATERAL_FIELD_PATHS, describeCollateral } from "./repeat-collateral.js";
34
37
  import { pollUntilVerified } from "./verify/poller.js";
35
38
  import { setInflight, trace } from "../trace/tracer.js";
36
39
  /**
@@ -188,7 +191,13 @@ function capturePre(spec, deps, pre) {
188
191
  };
189
192
  if (spec.mode === "update" || spec.mode === "state") {
190
193
  const extra = spec.mode === "update" ? (spec.capture ?? []) : [];
191
- captureFor(spec.uuid, [...spec.assert, ...extra]);
194
+ // The collateral diff needs the WHOLE watched vocabulary captured pre-op, not
195
+ // just the asserted subset — an unrequested field is by definition one the
196
+ // assertions do not name (CGRD1 guard 3).
197
+ const watched = spec.mode === "update" && spec.collateral !== undefined
198
+ ? COLLATERAL_FIELD_PATHS.map((field) => ({ field }))
199
+ : [];
200
+ captureFor(spec.uuid, [...spec.assert, ...extra, ...watched]);
192
201
  if (spec.mode === "state" && spec.cascade !== undefined) {
193
202
  for (const c of spec.cascade)
194
203
  captureFor(c.uuid, c.assert);
@@ -262,8 +271,59 @@ export function normalizeConsumerWhen(params, now, zone) {
262
271
  `This Evening), or set this host's system time zone to the consumer's so the calendars match`,
263
272
  };
264
273
  }
274
+ /**
275
+ * Run a COMPOSITE — a single verb the engine executes as several mutations —
276
+ * under ONE mutation lock held end-to-end, so it serializes against other
277
+ * writers as a whole instead of leg by leg. Every leg's own
278
+ * `acquireMutationLock` inside `body` is a reentrant no-op (see
279
+ * {@link withMutationLock}); the per-leg lock stays the base case for an
280
+ * ordinary single mutation.
281
+ *
282
+ * Wrap only the MUTATING tail: validation, dry-run planning, and the hazard /
283
+ * session gates belong outside, so a refusal never takes the lock. On contention
284
+ * the refusal is the same `blocked` / `lock` shape the pipeline returns for a
285
+ * single op, carrying the composite's own op name. No audit record is written
286
+ * for it — unlike the single-op path, nothing was attempted, so there is no leg
287
+ * to record.
288
+ */
289
+ export async function runComposite(deps, op, body,
290
+ /** @internal test seam — see {@link AcquireMutationLockOptions}. */
291
+ lockOptions = {}) {
292
+ try {
293
+ return await withMutationLock(deps.lockPath, body, lockOptions);
294
+ }
295
+ catch (err) {
296
+ if (err instanceof MutationLockError) {
297
+ return {
298
+ kind: "blocked",
299
+ op,
300
+ reason: "lock",
301
+ detail: err.message,
302
+ remediation: "wait for the concurrent mutation to finish and retry",
303
+ };
304
+ }
305
+ throw err;
306
+ }
307
+ }
265
308
  export async function runMutation(deps, op, params, options = {}) {
266
309
  const startedAt = deps.now?.() ?? new Date();
310
+ // Things' own "Enable Things URLs" standing, read at most ONCE per mutation
311
+ // and shared by the two places that want it: the pre-dispatch URL gate (5c)
312
+ // and, when that gate let the write through on an `unreadable` verdict, the
313
+ // failure attribution at the end. Memoized within this one invocation only —
314
+ // across invocations it is re-derived like every other capability, because
315
+ // the human can flip the setting between two commands.
316
+ let urlStanding;
317
+ const urlSchemeStanding = () => (urlStanding ??= (deps.urlSchemeCapability ?? urlSchemeCapabilityDefault)());
318
+ // 0. STRUCTURAL parameter check (#580) — FIRST, before uuid-prefix resolution
319
+ // and before anything reads the params: an untyped caller (MCP
320
+ // `run_operation`'s `params` pass-through, a JavaScript caller handing over
321
+ // parsed JSON, `things run`) must be refused on a malformed bag rather than
322
+ // have the malformed field inferred as absent. Throws ParamSchemaError (a
323
+ // RangeError) — an input-contract refusal, so nothing is locked, dispatched, or
324
+ // audited. The batch surface checks the SAME registry in its static preflight,
325
+ // one line earlier.
326
+ assertOperationParams(op, params);
267
327
  // Uuid params accept unique PREFIXES (>= 6 chars) — resolved to full uuids
268
328
  // here so guards/compiles/audit all see canonical ids. Throws (RangeError)
269
329
  // on unknown or ambiguous prefixes, like the title resolvers. PROJECT write
@@ -633,7 +693,100 @@ export async function runMutation(deps, op, params, options = {}) {
633
693
  reason: "environment",
634
694
  detail: `the Things proxy shortcut "${invocation.shortcut}" is not installed — this ` +
635
695
  "operation is delivered through it",
636
- remediation: "run `things setup shortcuts` to install the proxy shortcuts, then retry",
696
+ remediation: "run `things setup` to install the proxy shortcuts, then retry",
697
+ };
698
+ }
699
+ }
700
+ // 5c. THE URL-SCHEME GATE (URLEN1, #611). Things has its own switch for the
701
+ // URL scheme — Settings ▸ General ▸ "Enable Things URLs" — and both of its
702
+ // not-enabled states are invisible to the caller at dispatch time: an app
703
+ // told no discards the command in total silence, and an app nobody has
704
+ // answered the first-use "Things URL Scheme" dialog for PARKS the command
705
+ // behind that dialog. In each case `open -g` exits 0, nothing happens, and
706
+ // the verify reports a silent no-op long afterwards. The state is on disk
707
+ // and readable prompt-free, so it is read here and a not-enabled app is
708
+ // refused before anything is dispatched — which also keeps the app's own
709
+ // modal off an unattended screen. Keyed on the vector's DECLARATION, never
710
+ // on its id, for the same reason as the two gates below.
711
+ if (vector.dispatchesUrls === true && vector.simulates !== true) {
712
+ const capability = urlSchemeStanding();
713
+ if (!urlSchemeAllowed(capability)) {
714
+ audit({
715
+ result: blockedCode({ reason: "environment" }),
716
+ vector: vector.id,
717
+ disruption: effectiveTier,
718
+ invocation: invocation.redactedPayload,
719
+ });
720
+ return {
721
+ kind: "blocked",
722
+ op,
723
+ reason: "environment",
724
+ likelyCause: "feature-disabled",
725
+ detail: `this operation is delivered as a Things URL, and ${capability.detail}`,
726
+ remediation: capability.remediation.join("; "),
727
+ };
728
+ }
729
+ }
730
+ // 5d. THE WRITE GATE (docs/design/permissions-doctrine.md, Articles I+II).
731
+ // The AppleScript vector sends a real Apple Event, and on a machine macOS
732
+ // has no consent record for, that event IS the dialog. So the standing is
733
+ // established prompt-free first — the deputy's own handshake when it is
734
+ // onboarded, the host app's Automation record otherwise — and anything
735
+ // short of a grant refuses here, before the app is touched. An unknown
736
+ // standing is NOT resolved by trying: that is what `things setup` is for.
737
+ //
738
+ // The one thing that IS resolved here is LIVENESS (#617): with Things
739
+ // closed the deputy's determination has no answer, and this gate is the
740
+ // caller with dispatch intent, so it starts the app in the background and
741
+ // re-reads the standing before judging it. `auto-launch: false` is the
742
+ // user's instruction not to start Things for a write, so it withholds that
743
+ // — the verdict then reports the dormancy instead, and step 6 would have
744
+ // refused a moment later for the same reason.
745
+ if (vector.sendsAppleEvents === true && vector.simulates !== true) {
746
+ const capability = (deps.writeCapability ?? writeCapabilityDefault)({
747
+ purpose: config.autoLaunch ? "dispatch" : "survey",
748
+ });
749
+ if (!writeAllowed(capability)) {
750
+ audit({
751
+ result: blockedCode({ reason: "environment" }),
752
+ vector: vector.id,
753
+ disruption: effectiveTier,
754
+ invocation: invocation.redactedPayload,
755
+ });
756
+ return {
757
+ kind: "blocked",
758
+ op,
759
+ reason: "environment",
760
+ detail: `this operation drives the Things app, and ${capability.detail}`,
761
+ remediation: capability.remediation.join("; "),
762
+ };
763
+ }
764
+ }
765
+ // 5d. THE GUI GATE (docs/design/permissions-doctrine.md, Article IV).
766
+ // Driving the Things window needs Accessibility + Automation → System
767
+ // Events, and those are granted to the HELPER PAIR and to nothing else: on
768
+ // a machine holding neither, the first AX call raises an Accessibility
769
+ // prompt against whatever host app happens to be running us, which is the
770
+ // banned outcome. So standing is established prompt-free (the config key
771
+ // plus the deputy's own handshake) and anything short of it refuses here,
772
+ // naming exactly what is missing. Keyed on the vector's DECLARATION, never
773
+ // on its id — a fake substituted under "ui" drives no GUI and must not be
774
+ // gated on the developer's own TCC state.
775
+ if (vector.drivesGui === true && vector.simulates !== true) {
776
+ const capability = (deps.uiCapability ?? (() => uiCapabilityDefault()))();
777
+ if (!uiAllowed(capability)) {
778
+ audit({
779
+ result: blockedCode({ reason: "environment" }),
780
+ vector: vector.id,
781
+ disruption: effectiveTier,
782
+ invocation: invocation.redactedPayload,
783
+ });
784
+ return {
785
+ kind: "blocked",
786
+ op,
787
+ reason: "environment",
788
+ detail: `this operation drives the Things window, and ${capability.detail}`,
789
+ remediation: capability.remediation.join("; "),
637
790
  };
638
791
  }
639
792
  }
@@ -785,6 +938,10 @@ export async function runMutation(deps, op, params, options = {}) {
785
938
  invocation: invocation.redactedPayload,
786
939
  pre: flattenPreFields(preCapture.fields),
787
940
  observed: recovery.observed,
941
+ // The watchdog abort is THE ambiguous outcome — the detail below says
942
+ // so — so the assertion rides the record and a resubmission with the
943
+ // same opId re-reads state instead of risking the duplicate.
944
+ expected: delta,
788
945
  });
789
946
  const budgetS = Math.round(wd.budgetMs / 1000);
790
947
  const elapsedS = Math.round(wd.elapsedMs / 1000);
@@ -811,6 +968,47 @@ export async function runMutation(deps, op, params, options = {}) {
811
968
  ...(wd.tracePath != null && wd.tracePath !== "" && { tracePath: wd.tracePath }),
812
969
  };
813
970
  }
971
+ // The ui drive stopped because the Things WINDOW stopped answering
972
+ // (#512): the session went AX-blind mid-drive, or a step was killed by
973
+ // its own deadline. The re-verify above just proved nothing landed, so
974
+ // this is an ENVIRONMENT failure — reported as such, naming the step
975
+ // that stopped and how to make a retry work. It is NOT
976
+ // `silent-noop`, whose meaning ("the app accepted the command and
977
+ // changed nothing") tells a caller the app was reachable and it is safe
978
+ // to look for a rejected parameter. The reachability GATES refuse this
979
+ // shape before a mutation whenever the session is already blind; this
980
+ // branch is for a session that degrades under a running drive.
981
+ const unreachable = executeResult.uiUnreachable;
982
+ if (unreachable !== undefined) {
983
+ audit({
984
+ result: verifyFailedCode({ reason: "ui-unreachable" }),
985
+ vector: vector.id,
986
+ disruption: effectiveTier,
987
+ invocation: invocation.redactedPayload,
988
+ pre: flattenPreFields(preCapture.fields),
989
+ observed: recovery.observed,
990
+ });
991
+ return {
992
+ kind: "verify-failed",
993
+ op,
994
+ reason: "ui-unreachable",
995
+ expected: delta,
996
+ observed: recovery.observed,
997
+ detail: `the Things window could not be driven: the drive stopped at step ` +
998
+ `"${unreachable.step}" because ` +
999
+ (unreachable.cause === "unreachable"
1000
+ ? "no Things window was reachable on the screen you're viewing (the Mac is locked, " +
1001
+ "or a full-screen app is covering the desktop)"
1002
+ : "Things did not answer that step before its deadline") +
1003
+ ". A follow-up re-read found no change, so nothing landed" +
1004
+ (unreachable.clear === "may-remain"
1005
+ ? "; a sheet or popover may still be open in Things — dismiss it before retrying"
1006
+ : "") +
1007
+ ".",
1008
+ likelyCause: "ui-unreachable",
1009
+ hint: unreachable.remediation,
1010
+ };
1011
+ }
814
1012
  audit({
815
1013
  result: verifyFailedCode({ reason: "silent-noop" }),
816
1014
  vector: vector.id,
@@ -863,6 +1061,11 @@ export async function runMutation(deps, op, params, options = {}) {
863
1061
  pre: flattenPreFields(preCapture.fields),
864
1062
  observed: outcome.observed,
865
1063
  verify: { attempts: outcome.attempts, elapsedMs: outcome.elapsedMs },
1064
+ // The target, as far as it is known — the same uuid the intent marker
1065
+ // carries (null for a create whose row was never discovered). A FAILED
1066
+ // record used to leave this null even for an op that names its target,
1067
+ // which is the one thing a caller reading the record needs to look at.
1068
+ uuid: outcome.discoveredUuid ?? intentUuid,
866
1069
  };
867
1070
  if (outcome.kind === "ok") {
868
1071
  const uuid = outcome.discoveredUuid ??
@@ -967,13 +1170,6 @@ export async function runMutation(deps, op, params, options = {}) {
967
1170
  if (offRule?.kind === "honored")
968
1171
  warnings.push(offRule.disclosure.message);
969
1172
  }
970
- // #V11 heading-reorder disclosure: re-ranking an archived heading also
971
- // un-archives it (status→open). Never silent — name every reopened heading.
972
- if (pre.headingMove !== null && pre.headingMove.reopened.length > 0) {
973
- warnings.push("re-ranking these archived heading(s) brought them back to open " +
974
- `(un-archived): ${pre.headingMove.reopened.join(", ")} — repositioning an ` +
975
- "archived heading reopens it; their children stay resolved");
976
- }
977
1173
  if (vector.id === "ui") {
978
1174
  warnings.push("this change was applied by driving the local Things app through the Accessibility API");
979
1175
  // Surface the drive's own step summary (e.g. how a sidebar move was
@@ -1029,14 +1225,26 @@ export async function runMutation(deps, op, params, options = {}) {
1029
1225
  ...(warnings.length > 0 && { warnings }),
1030
1226
  };
1031
1227
  }
1032
- audit({ ...auditCommon, result: verifyFailedCode({ reason: outcome.kind }) });
1228
+ audit({
1229
+ ...auditCommon,
1230
+ result: verifyFailedCode({ reason: outcome.kind }),
1231
+ // A TIMEOUT is the one ambiguous verdict — the change may or may not have
1232
+ // landed — so the assertion this attempt was checking is recorded with it.
1233
+ // A resubmission carrying the same opId re-evaluates it against current
1234
+ // state instead of guessing (`replayIfApplied`, src/write/opid.ts).
1235
+ ...(outcome.kind === "timeout" && { expected: delta }),
1236
+ });
1033
1237
  return withHint({
1034
1238
  kind: "verify-failed",
1035
1239
  op,
1036
1240
  reason: outcome.kind,
1037
1241
  expected: delta,
1038
1242
  observed: outcome.observed,
1039
- detail: outcome.detail ??
1243
+ detail:
1244
+ // The collateral verdict carries its own sentence — which field moved,
1245
+ // from what to what, and why a retry is not the answer (CGRD1).
1246
+ (outcome.collateral !== undefined ? describeCollateral(outcome.collateral) : undefined) ??
1247
+ outcome.detail ??
1040
1248
  (outcome.kind === "silent-noop"
1041
1249
  ? "no observable change in the database (the app accepted the command but did nothing)"
1042
1250
  : outcome.kind === "timeout"
@@ -1045,7 +1253,14 @@ export async function runMutation(deps, op, params, options = {}) {
1045
1253
  }, classifyVerifyFailure({
1046
1254
  reason: outcome.kind,
1047
1255
  vector: vector.id,
1048
- urlSchemeEnabled: (deps.urlSchemeEnabled ?? (() => readUrlSchemeEnabled().enabled))(),
1256
+ // Keyed on the DECLARATION, exactly like gate 5c: a vector that opens
1257
+ // no URL cannot have failed for want of the app's URL authorization,
1258
+ // and asking would import the host's own Things settings into every
1259
+ // fake-vector engine test. For one that does, gate 5c already refused
1260
+ // every state we could POSITIVELY read as not-enabled, so what reaches
1261
+ // here is `enabled` or `unreadable` — the latter being exactly the case
1262
+ // the hint exists for.
1263
+ urlScheme: vector.dispatchesUrls === true ? urlSchemeStanding().mode : null,
1049
1264
  appWasRunning: appRunning,
1050
1265
  environmentChanges: envChanges,
1051
1266
  }));
@@ -1062,6 +1277,12 @@ export async function runMutation(deps, op, params, options = {}) {
1062
1277
  * uses (only for a non-leg, reversible op — an irreversible op or a batch leg
1063
1278
  * carries none), and `title` rides `requested.title` when the record stored one
1064
1279
  * (the audit record has no dedicated title field — see the trail-record note).
1280
+ *
1281
+ * A template-target composite's summary record additionally stored WHICH
1282
+ * occurrence it wrote ({@link OccurrenceResolution}); that rides back verbatim,
1283
+ * so a retry that replays instead of executing still names the same two uuids
1284
+ * the original call returned — the whole point of putting an `opId` on a verb
1285
+ * that would otherwise mint a second occurrence.
1065
1286
  */
1066
1287
  export function replayResultFromRecord(record) {
1067
1288
  const op = record.op;
@@ -1086,9 +1307,62 @@ export function replayResultFromRecord(record) {
1086
1307
  vector: (record.vector ?? "url-scheme"),
1087
1308
  tier: (record.disruption ?? 0),
1088
1309
  ...(token !== undefined && { undoToken: token }),
1310
+ ...(record.occurrence !== undefined && { occurrence: record.occurrence }),
1089
1311
  alreadyApplied: true,
1090
1312
  };
1091
1313
  }
1314
+ /**
1315
+ * Append a COMPOSITE's summary record — the single record that stands for a
1316
+ * multi-leg verb on the trail. It is what `undo` targets (the legs are excluded
1317
+ * from direct targeting) and, when the caller supplied one, the ONE record that
1318
+ * carries the composite's `opId`, so a resubmission matches the whole verb
1319
+ * exactly once instead of matching a leg (or nothing at all).
1320
+ *
1321
+ * Shared by both composite families — the resolution-timestamp flip-dance
1322
+ * (resolution-timestamps.ts) and the template-target CNC composites
1323
+ * (template-mutation.ts) — so the two cannot drift on what a summary record
1324
+ * looks like.
1325
+ *
1326
+ * Two shapes, one record either way (mirroring the promote compounds'
1327
+ * `appendPromoteSummary`):
1328
+ * - the SUCCESS summary (default) — result `ok`, the single undoable unit;
1329
+ * - an AMBIGUOUS summary (`ambiguous`) — result `verify-failed:timeout` with the
1330
+ * presence oracle attached, written when a leg dispatched and never confirmed.
1331
+ * It is not an undo target (undo reads `ok` records only); it exists so a
1332
+ * resubmission carrying the same key re-reads state and decides instead of
1333
+ * running the whole composite again.
1334
+ */
1335
+ export function appendCompositeSummary(deps, args) {
1336
+ const fp = deps.fingerprint();
1337
+ const record = {
1338
+ v: 1,
1339
+ ts: args.startedAt.toISOString(),
1340
+ actor: args.options?.actor ?? deps.config.actor,
1341
+ host: deps.config.host,
1342
+ op: args.op,
1343
+ uuid: args.uuid,
1344
+ vector: args.vector ?? "applescript",
1345
+ disruption: args.disruption ?? 0,
1346
+ invocation: args.invocation,
1347
+ requested: args.requested ?? {},
1348
+ txn: { id: args.txnId, role: "summary" },
1349
+ ...(args.options?.opId !== undefined && { opId: args.options.opId }),
1350
+ ...(args.occurrence !== undefined && { occurrence: args.occurrence }),
1351
+ ...(args.ambiguous !== undefined && { expected: args.ambiguous }),
1352
+ pre: null,
1353
+ observed: args.ambiguous === undefined ? { uuid: args.uuid } : null,
1354
+ result: args.ambiguous === undefined ? "ok" : "verify-failed:timeout",
1355
+ verify: null,
1356
+ durationMs: (deps.now?.() ?? new Date()).getTime() - args.startedAt.getTime(),
1357
+ env: {
1358
+ pkg: deps.pkgVersion ?? "0.0.1",
1359
+ dbVersion: fp.observation.databaseVersion,
1360
+ fingerprint: fingerprintLabel(fp, deps.config),
1361
+ },
1362
+ };
1363
+ deps.audit.append(record);
1364
+ return args.txnId;
1365
+ }
1092
1366
  export function fingerprintLabel(fp, config) {
1093
1367
  if (fp.kind === "ok")
1094
1368
  return "ok";