things-api 0.19.3 → 0.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/deputy/prebuilt/Things API Helper.app/Contents/CodeResources +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/MacOS/things-reader +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
- package/dist/audit/schema.d.ts +14 -0
- package/dist/audit/schema.js.map +1 -1
- package/dist/cli/commands/op-result.js +13 -1
- package/dist/cli/commands/op-result.js.map +1 -1
- package/dist/cli/commands/writes.js +51 -7
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.js +1 -1
- package/dist/mcp/server.js +7 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/op-result.d.ts +9 -0
- package/dist/op-result.js +5 -0
- package/dist/op-result.js.map +1 -1
- package/dist/write/batch.js +4 -1
- package/dist/write/batch.js.map +1 -1
- package/dist/write/clone.js +12 -6
- package/dist/write/clone.js.map +1 -1
- package/dist/write/disclosures.d.ts +263 -0
- package/dist/write/disclosures.js +265 -0
- package/dist/write/disclosures.js.map +1 -0
- package/dist/write/heading.js +4 -7
- package/dist/write/heading.js.map +1 -1
- package/dist/write/make-repeating-project.js +2 -1
- package/dist/write/make-repeating-project.js.map +1 -1
- package/dist/write/opid.js +5 -3
- package/dist/write/opid.js.map +1 -1
- package/dist/write/pipeline.d.ts +39 -1
- package/dist/write/pipeline.js +49 -23
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/promote-clone.js +46 -36
- package/dist/write/promote-clone.js.map +1 -1
- package/dist/write/reorder.js +45 -39
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/resolution-timestamps.js +4 -1
- package/dist/write/resolution-timestamps.js.map +1 -1
- package/dist/write/spawn-expectation.d.ts +135 -0
- package/dist/write/spawn-expectation.js +237 -0
- package/dist/write/spawn-expectation.js.map +1 -0
- package/dist/write/template-mutation.js +20 -33
- package/dist/write/template-mutation.js.map +1 -1
- package/dist/write/vectors/types.d.ts +12 -0
- package/dist/write/vectors/ui-recipes.js +11 -1
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui-state.d.ts +42 -0
- package/dist/write/vectors/ui-state.js +90 -3
- package/dist/write/vectors/ui-state.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +46 -2
- package/dist/write/vectors/ui.js +269 -142
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/verify/delta.d.ts +17 -2
- package/dist/write/verify/delta.js +46 -16
- package/dist/write/verify/delta.js.map +1 -1
- package/dist/write/verify/poller.d.ts +3 -2
- package/dist/write/verify/poller.js +3 -1
- package/dist/write/verify/poller.js.map +1 -1
- package/package.json +1 -1
- package/skills/things-cli/SKILL.md +1 -1
|
@@ -144,7 +144,19 @@ export const THINGS_PROCESS = "Things3";
|
|
|
144
144
|
*/
|
|
145
145
|
export function axUiStateScript() {
|
|
146
146
|
return `${UI_STATE_MARKER}
|
|
147
|
-
|
|
147
|
+
${CENSUS_BODY}
|
|
148
|
+
|
|
149
|
+
return ${censusRecord("linefeed")}`;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The census BODY — every probe, leaving its verdict in the AppleScript variables
|
|
153
|
+
* the record below reads. Split out of {@link axUiStateScript} (DRVLAT1, issue
|
|
154
|
+
* #633) so the SAME probes can run as the in-script prelude of a keystroke hop
|
|
155
|
+
* ({@link axFocusGuardPrelude}) rather than as a separate osascript round-trip.
|
|
156
|
+
* Nothing about the probes, their budgets or their order differs between the two
|
|
157
|
+
* uses: it is one body, compiled into two scripts.
|
|
158
|
+
*/
|
|
159
|
+
const CENSUS_BODY = `set frontName to ""
|
|
148
160
|
set frontIsThings to false
|
|
149
161
|
set focusRole to ""
|
|
150
162
|
set focusSub to ""
|
|
@@ -304,9 +316,84 @@ if not halted then
|
|
|
304
316
|
end try
|
|
305
317
|
end if
|
|
306
318
|
end if
|
|
307
|
-
end if
|
|
319
|
+
end if`;
|
|
320
|
+
/**
|
|
321
|
+
* The census RECORD, joined by `sep` — `linefeed` for the stand-alone census
|
|
322
|
+
* script, a single-line separator for the guard prelude's `log` line (a logged
|
|
323
|
+
* record has to survive as ONE stderr line to be recovered).
|
|
324
|
+
*/
|
|
325
|
+
function censusRecord(sep) {
|
|
326
|
+
return `"front=" & frontName & ${sep} & "isfront=" & frontIsThings & ${sep} & "running=" & thingsRunning & ${sep} & "form=" & sheetForm & ${sep} & "depth=" & sheetDepth & ${sep} & "kind=" & sheetKind & ${sep} & "census=" & census & ${sep} & "role=" & focusRole & ${sep} & "subrole=" & focusSub & ${sep} & "inspectable=" & canInspect & ${sep} & "stalled=" & stalled & ${sep} & "failed=" & failed`;
|
|
327
|
+
}
|
|
328
|
+
/** The stderr line prefix carrying a folded guard's census record. */
|
|
329
|
+
export const GUARD_LOG_PREFIX = "#FGCENSUS ";
|
|
330
|
+
/** The separator joining that record's fields on its single line. */
|
|
331
|
+
export const GUARD_LOG_SEP = " ~|~ ";
|
|
332
|
+
/**
|
|
333
|
+
* What a folded guard RAISES when it refuses. Deliberately a machine tag rather
|
|
334
|
+
* than a sentence: the refusal a caller reads is still built by
|
|
335
|
+
* {@link judgeFocusGuard} in TypeScript, from the census this same hop logged, so
|
|
336
|
+
* there is exactly ONE place the wording lives and the in-script judgement can
|
|
337
|
+
* never drift from it.
|
|
338
|
+
*/
|
|
339
|
+
export const GUARD_REFUSED_TAG = "#FGREFUSE";
|
|
340
|
+
/**
|
|
341
|
+
* The census as the IN-SCRIPT PRELUDE of the hop it guards (DRVLAT1, issue #633).
|
|
342
|
+
*
|
|
343
|
+
* The per-step focus guard used to be its own osascript round-trip: census hop,
|
|
344
|
+
* then keystroke hop. That is both a hop of latency per typed control AND a
|
|
345
|
+
* TOCTOU window — the screen can change between the census that approved the
|
|
346
|
+
* keystroke and the keystroke itself. Prepending the census to the very script
|
|
347
|
+
* that types closes both: the probes and the input now run in one process, in
|
|
348
|
+
* order, with nothing dispatched in between.
|
|
349
|
+
*
|
|
350
|
+
* The prelude LOGS its census record (stderr, one line) and then judges it
|
|
351
|
+
* IN-SCRIPT, raising {@link GUARD_REFUSED_TAG} — a bare tag — when the input must
|
|
352
|
+
* not be sent. The caller recovers the logged record, parses it into the same
|
|
353
|
+
* {@link UiState} the stand-alone census yields, and asks {@link judgeFocusGuard}
|
|
354
|
+
* for the sentence. So the DECISION is made before the keystroke, in-script, and
|
|
355
|
+
* the WORDING is still single-sourced in TypeScript.
|
|
356
|
+
*
|
|
357
|
+
* `expectedSheet` is the dialog the drive has observed itself driving; pass null
|
|
358
|
+
* where no dialog invariant applies.
|
|
359
|
+
*/
|
|
360
|
+
export function axFocusGuardPrelude(expectedSheet) {
|
|
361
|
+
const critical = CRITICAL_PROBES.map((p) => ` if stalled contains "${p} " then set fgBad to true
|
|
362
|
+
if failed contains "${p} " then set fgBad to true`).join("\n");
|
|
363
|
+
const sheetClause = expectedSheet === null
|
|
364
|
+
? ""
|
|
365
|
+
: `\n if sheetKind is not "${expectedSheet}" then set fgBad to true`;
|
|
366
|
+
return `${UI_STATE_MARKER}
|
|
367
|
+
${CENSUS_BODY}
|
|
308
368
|
|
|
309
|
-
|
|
369
|
+
log "${GUARD_LOG_PREFIX}" & ${censusRecord(`"${GUARD_LOG_SEP}"`)}
|
|
370
|
+
set fgBad to false
|
|
371
|
+
${critical}
|
|
372
|
+
if not canInspect then set fgBad to true
|
|
373
|
+
if not frontIsThings then set fgBad to true${sheetClause}
|
|
374
|
+
if fgBad then error "${GUARD_REFUSED_TAG}"
|
|
375
|
+
`;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Recover a folded guard's census from the hop's stderr: the parsed state (null
|
|
379
|
+
* when no record was logged) and the stderr with that line removed, so a failure
|
|
380
|
+
* message a caller reads never carries the machinery.
|
|
381
|
+
*/
|
|
382
|
+
export function parseGuardLog(stderr) {
|
|
383
|
+
const kept = [];
|
|
384
|
+
let record = null;
|
|
385
|
+
for (const line of stderr.split(/\r?\n/)) {
|
|
386
|
+
const at = line.indexOf(GUARD_LOG_PREFIX);
|
|
387
|
+
if (at >= 0) {
|
|
388
|
+
record = line.slice(at + GUARD_LOG_PREFIX.length);
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
kept.push(line);
|
|
392
|
+
}
|
|
393
|
+
return {
|
|
394
|
+
state: record === null ? null : parseUiState(record.split(GUARD_LOG_SEP).join("\n")),
|
|
395
|
+
stderr: kept.join("\n").trim(),
|
|
396
|
+
};
|
|
310
397
|
}
|
|
311
398
|
/**
|
|
312
399
|
* Parse the census record into a {@link UiState}. Returns null when the output
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-state.js","sourceRoot":"","sources":["../../../src/write/vectors/ui-state.ts"],"names":[],"mappings":"AAqDA,yEAAyE;AACzE,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;YAqB3B,eAAe;;;;;;;;;SASlB,CAAC;AA4BV,+EAA+E;AAC/E,MAAM,eAAe,GAAuB,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;AAE/E,2EAA2E;AAC3E,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAU;IACzD,SAAS;IACT,WAAW;IACX,QAAQ;IACR,UAAU;IACV,OAAO;CACR,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAgExC,8DAA8D;AAC9D,MAAM,UAAU,kBAAkB,CAAC,KAAqB;IACtD,IAAI,KAAK,KAAK,IAAI;QAAE,O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AO,GAAG,OAAO,EAAE,EAAE,CAAC;AACpD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAC5B,4FAA4F;IAC5F,qEAAqE,CAAC"}
|
|
@@ -63,6 +63,41 @@ export type UiRunner = (command: UiCommand, timeoutMs: number) => Promise<UiRunR
|
|
|
63
63
|
export declare const AX_FOCUS_GUARD_HANDLERS = "on fgFrontApp()\n\tset frontName to \"\"\n\ttry\n\t\ttell application \"System Events\" to set frontName to (name of first application process whose frontmost is true) as text\n\tend try\n\treturn frontName\nend fgFrontApp\n\non fgAssertFront(what)\n\tset f to my fgFrontApp()\n\tif f is \"Things3\" then return true\n\tif f is \"\" then\n\t\terror \"refused to \" & what & \": the frontmost application could not be read, so there is no proof the keystrokes would reach Things \u2014 nothing was typed\"\n\tend if\n\terror \"refused to \" & what & \": \" & f & \" is frontmost, not Things \u2014 a keystroke goes to whatever owns the screen, so nothing was typed\"\nend fgAssertFront";
|
|
64
64
|
/** resolve-element: does the element exist right now? Returns "true"/"false". */
|
|
65
65
|
export declare function axResolveScript(path: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* The AppleScript variable a folded candidate resolution binds the live element
|
|
68
|
+
* to. Every addressed script takes its target as `(<path>)`, so handing it this
|
|
69
|
+
* name — with {@link axCandidatePrelude} in front — makes the resolution and the
|
|
70
|
+
* action ONE hop instead of two (DRVLAT1, issue #633).
|
|
71
|
+
*/
|
|
72
|
+
export declare const STEP_ELEMENT_REF = "fgStepEl";
|
|
73
|
+
/**
|
|
74
|
+
* The message a folded candidate resolution raises when NONE of a step's expected
|
|
75
|
+
* element shapes appeared. Byte-identical to the driver's own wording for the
|
|
76
|
+
* separate-hop resolution it replaces, so a report reads the same either way.
|
|
77
|
+
*/
|
|
78
|
+
export declare const CANDIDATES_MISSED: string;
|
|
79
|
+
/**
|
|
80
|
+
* IN-SCRIPT CANDIDATE RESOLUTION (DRVLAT1, issue #633).
|
|
81
|
+
*
|
|
82
|
+
* A candidate-addressed step used to dispatch one `resolve` hop PER CANDIDATE PER
|
|
83
|
+
* POLL ROUND before the hop that acted on whichever answered — a process spawn
|
|
84
|
+
* each, on top of a 300ms JS-side poll floor. This prelude does the same work in
|
|
85
|
+
* the acting hop's own process: it polls the candidates in the SAME priority
|
|
86
|
+
* order, binds the first that exists to {@link STEP_ELEMENT_REF}, and fails closed
|
|
87
|
+
* with {@link CANDIDATES_MISSED} when the window elapses with none of them there.
|
|
88
|
+
*
|
|
89
|
+
* Collapsing it is also strictly better against TOCTOU: the element the script
|
|
90
|
+
* acts on is the one it just proved exists, with nothing dispatched in between.
|
|
91
|
+
*/
|
|
92
|
+
export declare function axCandidatePrelude(paths: string[], timeoutMs?: number): string;
|
|
93
|
+
/**
|
|
94
|
+
* wait: poll for ANY of the awaited element shapes to appear, IN-SCRIPT (DRVLAT1).
|
|
95
|
+
* One hop for the whole wait instead of one per candidate per round — which is
|
|
96
|
+
* what a slow host paid most: the dialog the drive is waiting for is exactly the
|
|
97
|
+
* thing that is slow when the app is busy. Returns "true", or "false" when the
|
|
98
|
+
* window elapses with none of them present (the driver's abort path is unchanged).
|
|
99
|
+
*/
|
|
100
|
+
export declare function axWaitAnyScript(paths: string[], timeoutMs: number): string;
|
|
66
101
|
/** press: AXPress the element. */
|
|
67
102
|
export declare function axPressScript(path: string): string;
|
|
68
103
|
/**
|
|
@@ -458,7 +493,7 @@ export declare function axSelectHeadingRowScript(tablePath: string, ordinal: num
|
|
|
458
493
|
* naming expected vs observed. Pure System Events + Things scripting, background-
|
|
459
494
|
* capable. One stable command shape per primitive.
|
|
460
495
|
*/
|
|
461
|
-
export declare function axAssertEligibleScript(targetUuid: string, menuItemPath: string): string;
|
|
496
|
+
export declare function axAssertEligibleScript(targetUuid: string, menuItemPath: string, settleMs?: number): string;
|
|
462
497
|
/** activate: foreground Things (the fallback preamble step). */
|
|
463
498
|
export declare function axActivateScript(): string;
|
|
464
499
|
/**
|
|
@@ -709,7 +744,16 @@ export declare function judgeFocusGuard(state: UiState | null, expectedSheet: Ui
|
|
|
709
744
|
* cannot see and would otherwise discover hours later on another device.
|
|
710
745
|
*/
|
|
711
746
|
export declare function describeCleanup(clear: ClearResult): string;
|
|
712
|
-
/**
|
|
747
|
+
/**
|
|
748
|
+
* Compile one recipe step into its primitive command (no dispatch).
|
|
749
|
+
*
|
|
750
|
+
* A CANDIDATE-ADDRESSED step compiles to ONE script that resolves its own element
|
|
751
|
+
* and then acts on it (DRVLAT1, issue #633): the addressed body is generated
|
|
752
|
+
* against {@link STEP_ELEMENT_REF} and {@link axCandidatePrelude} is prepended, so
|
|
753
|
+
* the resolution that used to be a separate `resolve` hop (or several) now rides
|
|
754
|
+
* the acting hop. Steps whose script is JXA, or that resolve their own target,
|
|
755
|
+
* are unaffected.
|
|
756
|
+
*/
|
|
713
757
|
export declare function commandForStep(step: UiStep, targetUuid: string): UiCommand;
|
|
714
758
|
/**
|
|
715
759
|
* The ui vector. Config-gated: when `ui.enabled` is false the matrix reports
|