things-api 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/deputy/VERSION +1 -0
- package/deputy/helpers-Info.plist +23 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/CodeResources +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/Info.plist +20 -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/Helpers/things-reader.app/Contents/_CodeSignature/CodeResources +115 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Info.plist +23 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/_CodeSignature/CodeResources +125 -0
- package/deputy/reader/Info.plist +20 -0
- package/deputy/reader/entitlements.plist +15 -0
- package/deputy/reader/main.swift +491 -0
- package/deputy/src/main.swift +133 -0
- package/deputy/src/osascript.swift +102 -0
- package/deputy/src/server.swift +350 -0
- package/deputy/src/sqlite.swift +121 -0
- package/dist/cli/commands/doctor.js +55 -2
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/helpers.d.ts +17 -0
- package/dist/cli/commands/helpers.js +148 -0
- package/dist/cli/commands/helpers.js.map +1 -0
- package/dist/cli/commands/op-result.d.ts +15 -0
- package/dist/cli/commands/op-result.js +39 -0
- package/dist/cli/commands/op-result.js.map +1 -0
- package/dist/cli/commands/repeat-flags.d.ts +3 -3
- package/dist/cli/commands/repeat-flags.js +90 -33
- package/dist/cli/commands/repeat-flags.js.map +1 -1
- package/dist/cli/commands/writes.js +79 -6
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/help.js +13 -2
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/helpers-check.d.ts +10 -0
- package/dist/cli/helpers-check.js +59 -0
- package/dist/cli/helpers-check.js.map +1 -0
- package/dist/cli/interrupt.d.ts +42 -0
- package/dist/cli/interrupt.js +105 -0
- package/dist/cli/interrupt.js.map +1 -0
- package/dist/cli/main.js +27 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/client.js +19 -2
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +70 -0
- package/dist/config.js +25 -1
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +9 -2
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/db/baselines/db-v26.js +8 -4
- package/dist/db/baselines/db-v26.js.map +1 -1
- package/dist/db/baselines/db-v27.d.ts +42 -0
- package/dist/db/baselines/db-v27.js +47 -0
- package/dist/db/baselines/db-v27.js.map +1 -0
- package/dist/db/baselines/index.js +2 -1
- package/dist/db/baselines/index.js.map +1 -1
- package/dist/db/locate.d.ts +4 -1
- package/dist/db/locate.js +3 -1
- package/dist/db/locate.js.map +1 -1
- package/dist/db/schema.d.ts +1 -1
- package/dist/db/schema.js +9 -0
- package/dist/db/schema.js.map +1 -1
- package/dist/deputy/bridge-worker.d.ts +1 -0
- package/dist/deputy/bridge-worker.js +79 -0
- package/dist/deputy/bridge-worker.js.map +1 -0
- package/dist/deputy/bridge.d.ts +14 -0
- package/dist/deputy/bridge.js +70 -0
- package/dist/deputy/bridge.js.map +1 -0
- package/dist/deputy/client.d.ts +19 -0
- package/dist/deputy/client.js +104 -0
- package/dist/deputy/client.js.map +1 -0
- package/dist/deputy/db-facade.d.ts +18 -0
- package/dist/deputy/db-facade.js +71 -0
- package/dist/deputy/db-facade.js.map +1 -0
- package/dist/deputy/files.d.ts +1 -0
- package/dist/deputy/files.js +16 -0
- package/dist/deputy/files.js.map +1 -0
- package/dist/deputy/install.d.ts +105 -0
- package/dist/deputy/install.js +467 -0
- package/dist/deputy/install.js.map +1 -0
- package/dist/deputy/notice.d.ts +6 -0
- package/dist/deputy/notice.js +28 -0
- package/dist/deputy/notice.js.map +1 -0
- package/dist/deputy/notices.d.ts +31 -0
- package/dist/deputy/notices.js +94 -0
- package/dist/deputy/notices.js.map +1 -0
- package/dist/deputy/osa.d.ts +21 -0
- package/dist/deputy/osa.js +72 -0
- package/dist/deputy/osa.js.map +1 -0
- package/dist/deputy/protocol.d.ts +86 -0
- package/dist/deputy/protocol.js +106 -0
- package/dist/deputy/protocol.js.map +1 -0
- package/dist/deputy/routing.d.ts +63 -0
- package/dist/deputy/routing.js +338 -0
- package/dist/deputy/routing.js.map +1 -0
- package/dist/deputy/shortcuts-exec.d.ts +10 -0
- package/dist/deputy/shortcuts-exec.js +50 -0
- package/dist/deputy/shortcuts-exec.js.map +1 -0
- package/dist/diagnose.d.ts +43 -1
- package/dist/diagnose.js +64 -2
- package/dist/diagnose.js.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +25 -7
- package/dist/mcp/server.js.map +1 -1
- package/dist/model/mappers.d.ts +12 -3
- package/dist/model/mappers.js +6 -1
- package/dist/model/mappers.js.map +1 -1
- package/dist/model/occurrences.d.ts +14 -1
- package/dist/model/occurrences.js +20 -4
- package/dist/model/occurrences.js.map +1 -1
- package/dist/model/recurrence.d.ts +64 -9
- package/dist/model/recurrence.js +94 -19
- package/dist/model/recurrence.js.map +1 -1
- package/dist/model/template-projection.d.ts +26 -0
- package/dist/model/template-projection.js +113 -0
- package/dist/model/template-projection.js.map +1 -0
- package/dist/op-result.d.ts +46 -0
- package/dist/op-result.js +156 -0
- package/dist/op-result.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.js +10 -0
- package/dist/paths.js.map +1 -1
- package/dist/read/detail.js +7 -1
- package/dist/read/detail.js.map +1 -1
- package/dist/read/queries.js +8 -1
- package/dist/read/queries.js.map +1 -1
- package/dist/read/views.d.ts +6 -4
- package/dist/read/views.js +60 -18
- package/dist/read/views.js.map +1 -1
- package/dist/sync-health.js +8 -3
- package/dist/sync-health.js.map +1 -1
- package/dist/trace/tracer.d.ts +87 -0
- package/dist/trace/tracer.js +167 -0
- package/dist/trace/tracer.js.map +1 -0
- package/dist/write/accessibility-probe.js +4 -2
- package/dist/write/accessibility-probe.js.map +1 -1
- package/dist/write/automation-probe.js +5 -1
- package/dist/write/automation-probe.js.map +1 -1
- package/dist/write/availability.js +7 -3
- package/dist/write/availability.js.map +1 -1
- package/dist/write/clear-reminder.js +24 -21
- package/dist/write/clear-reminder.js.map +1 -1
- package/dist/write/commands.js +95 -45
- package/dist/write/commands.js.map +1 -1
- package/dist/write/completion-context.d.ts +57 -0
- package/dist/write/completion-context.js +49 -0
- package/dist/write/completion-context.js.map +1 -0
- package/dist/write/experimental.d.ts +19 -0
- package/dist/write/experimental.js +50 -0
- package/dist/write/experimental.js.map +1 -1
- package/dist/write/failure-hints.d.ts +10 -1
- package/dist/write/failure-hints.js +8 -0
- package/dist/write/failure-hints.js.map +1 -1
- package/dist/write/guards.d.ts +1 -1
- package/dist/write/guards.js +10 -0
- package/dist/write/guards.js.map +1 -1
- package/dist/write/move.js +14 -6
- package/dist/write/move.js.map +1 -1
- package/dist/write/operations.d.ts +40 -7
- package/dist/write/pipeline.d.ts +41 -0
- package/dist/write/pipeline.js +289 -19
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +1 -1
- package/dist/write/pre-state.js +35 -17
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/promote-clone.js +434 -19
- package/dist/write/promote-clone.js.map +1 -1
- package/dist/write/reorder.js +76 -27
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/repeat-anchor.d.ts +140 -0
- package/dist/write/repeat-anchor.js +403 -0
- package/dist/write/repeat-anchor.js.map +1 -0
- package/dist/write/repeat-asserts.d.ts +28 -0
- package/dist/write/repeat-asserts.js +169 -0
- package/dist/write/repeat-asserts.js.map +1 -0
- package/dist/write/repeat-rule.js +37 -12
- package/dist/write/repeat-rule.js.map +1 -1
- package/dist/write/vectors/applescript.js +7 -16
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/session-reachability.d.ts +133 -0
- package/dist/write/vectors/session-reachability.js +151 -0
- package/dist/write/vectors/session-reachability.js.map +1 -0
- package/dist/write/vectors/shortcuts.js +5 -14
- package/dist/write/vectors/shortcuts.js.map +1 -1
- package/dist/write/vectors/simulator.d.ts +16 -1
- package/dist/write/vectors/simulator.js +122 -32
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/types.d.ts +183 -10
- package/dist/write/vectors/ui-recipes.d.ts +8 -0
- package/dist/write/vectors/ui-recipes.js +246 -58
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +156 -14
- package/dist/write/vectors/ui.js +846 -84
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/verify/delta.d.ts +12 -14
- package/dist/write/verify/delta.js +35 -34
- package/dist/write/verify/delta.js.map +1 -1
- package/dist/write/verify/poller.d.ts +13 -0
- package/dist/write/verify/poller.js +38 -0
- package/dist/write/verify/poller.js.map +1 -1
- package/package.json +8 -1
- package/schema/envelope.schema.json +22 -0
- package/scripts/build-helpers.sh +104 -0
- package/scripts/deputy-cert-setup.sh +60 -0
- package/skills/things-cli/SKILL.md +11 -3
- package/skills/things-cli/references/errors.md +4 -0
- package/skills/things-cli/references/repeating.md +69 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assessOffRuleFirst } from "./repeat-anchor.js";
|
|
1
2
|
import { WEEKDAYS, } from "./operations.js";
|
|
2
3
|
const FREQUENCIES = ["daily", "weekly", "monthly", "yearly"];
|
|
3
4
|
/** Weekday name → rule encoding (wd 0 = Sunday). */
|
|
@@ -95,6 +96,18 @@ export function assertRepeatRule(params) {
|
|
|
95
96
|
params.yearly !== undefined) {
|
|
96
97
|
throw new RangeError("an after-completion rule has no calendar day — remove weekdays/monthly/yearly, or drop afterCompletion for a fixed schedule");
|
|
97
98
|
}
|
|
99
|
+
// ANCH1 (issue #476, golden-v2/3.22.12): an after-completion repeat can't be
|
|
100
|
+
// given an end bound through this path — after-completion mode does not expose
|
|
101
|
+
// the Ends control the fixed schedule does, so BOTH an end date and an
|
|
102
|
+
// occurrence count fail to apply (an ends-on-date drive dies looking for the
|
|
103
|
+
// "on date" option; an ends-after drive silently fails to set the count).
|
|
104
|
+
// Refuse it BEFORE any mutation rather than letting the GUI drive die and roll
|
|
105
|
+
// back. `never` (the default, no bound) is fine.
|
|
106
|
+
if (params.ends !== undefined && params.ends.kind !== "never") {
|
|
107
|
+
throw new RangeError("an after-completion repeat can't be given an end bound through this command — create it " +
|
|
108
|
+
"without an end (it repeats until you stop it), or use a fixed schedule (drop " +
|
|
109
|
+
"afterCompletion) to end on a date or after a number of times");
|
|
110
|
+
}
|
|
98
111
|
}
|
|
99
112
|
if (params.weekdays !== undefined) {
|
|
100
113
|
if (params.frequency !== "weekly") {
|
|
@@ -133,16 +146,19 @@ export function assertRepeatRule(params) {
|
|
|
133
146
|
if (!/^\d{1,2}:\d{2}$/.test(params.reminder)) {
|
|
134
147
|
throw new RangeError(`invalid reminder ${JSON.stringify(params.reminder)} — expected HH:mm`);
|
|
135
148
|
}
|
|
136
|
-
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
// ANCH2 (docs/lab/anch2-next-field.md): the reminder-time AXDateTimeArea IS
|
|
150
|
+
// drivable — UIC6-g's "ignores programmatic time entry" was a targeting
|
|
151
|
+
// artifact (the old set-datetime primitive wrote into the "first" date area,
|
|
152
|
+
// never the reminder). With deterministic targeting the picker commits the
|
|
153
|
+
// requested time exactly (probes: 09:00, 14:30), so --reminder is honored.
|
|
154
|
+
}
|
|
155
|
+
if (params.next !== undefined) {
|
|
156
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(params.next)) {
|
|
157
|
+
throw new RangeError(`invalid next ${JSON.stringify(params.next)} — expected YYYY-MM-DD`);
|
|
158
|
+
}
|
|
159
|
+
if (params.afterCompletion === true) {
|
|
160
|
+
throw new RangeError("a first-occurrence date (next/--when) does not apply to an after-completion repeat — it has no calendar");
|
|
161
|
+
}
|
|
146
162
|
}
|
|
147
163
|
if (params.startDaysEarlier !== undefined) {
|
|
148
164
|
if (!Number.isInteger(params.startDaysEarlier) || params.startDaysEarlier < 0) {
|
|
@@ -152,17 +168,26 @@ export function assertRepeatRule(params) {
|
|
|
152
168
|
throw new RangeError("startDaysEarlier requires a deadline (it counts days before the deadline)");
|
|
153
169
|
}
|
|
154
170
|
}
|
|
171
|
+
// DACON1: an EXPLICIT calendar anchor that disagrees with `--when` requests an
|
|
172
|
+
// OFF-RULE first occurrence (first on `--when`, the anchor thereafter). The app
|
|
173
|
+
// HONORS this for weekly/yearly (allowed — disclosed at the call sites), but a
|
|
174
|
+
// MONTHLY rule's dialog snaps the first occurrence to the anchor day, so that
|
|
175
|
+
// shape is inexpressible and fail-closed here before any mutation. On-rule
|
|
176
|
+
// requests and `--when`-only (derived-anchor) requests return null.
|
|
177
|
+
const offRule = assessOffRuleFirst(params);
|
|
178
|
+
if (offRule?.kind === "dishonored")
|
|
179
|
+
throw new RangeError(offRule.refusal);
|
|
155
180
|
}
|
|
156
181
|
/** The mutually-exclusive Ends bound of a decoded rule, or null if inexpressible. */
|
|
157
182
|
function endsOf(rule) {
|
|
158
183
|
const hasDate = rule.endDate !== null;
|
|
159
|
-
const hasCount = rule.
|
|
184
|
+
const hasCount = rule.occurrenceCount !== null;
|
|
160
185
|
if (hasDate && hasCount)
|
|
161
186
|
return null; // dialog's Ends is single-choice
|
|
162
187
|
if (hasDate)
|
|
163
188
|
return { ends: { kind: "on-date", date: rule.endDate } };
|
|
164
189
|
if (hasCount)
|
|
165
|
-
return { ends: { kind: "after", count: rule.
|
|
190
|
+
return { ends: { kind: "after", count: rule.occurrenceCount } };
|
|
166
191
|
return { ends: { kind: "never" } };
|
|
167
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AC,eAAe,CAAC;IAClD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Things launches it with focus steal (A40/A41), which the pipeline's
|
|
6
6
|
* ensure-running step prevents.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { osaExec } from "../../deputy/osa.js";
|
|
9
9
|
export const APPLESCRIPT_MATRIX = {
|
|
10
10
|
"todo.add": {
|
|
11
11
|
support: "yes",
|
|
@@ -238,21 +238,12 @@ export const APPLESCRIPT_MATRIX = {
|
|
|
238
238
|
export function escapeAppleScript(value) {
|
|
239
239
|
return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"');
|
|
240
240
|
}
|
|
241
|
-
function runOsascript(script) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const timedOut = err !== null && err.killed === true;
|
|
248
|
-
resolve({
|
|
249
|
-
exitCode: err === null ? 0 : (err.code ?? 1),
|
|
250
|
-
stdout: String(stdout),
|
|
251
|
-
stderr: String(stderr),
|
|
252
|
-
...(timedOut && { timedOut: true }),
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
});
|
|
241
|
+
async function runOsascript(script) {
|
|
242
|
+
// The deadline kill (timedOut) is a distinct signal from a nonzero exit: an
|
|
243
|
+
// osascript that never returns is the shape of an unanswered macOS consent
|
|
244
|
+
// dialog — surfaced for failure attribution. osaExec preserves that signal
|
|
245
|
+
// on both the direct and the deputy-routed path.
|
|
246
|
+
return osaExec(script, { timeoutMs: 30_000 });
|
|
256
247
|
}
|
|
257
248
|
export function createAppleScriptVector() {
|
|
258
249
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applescript.js","sourceRoot":"","sources":["../../../src/write/vectors/applescript.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"applescript.js","sourceRoot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CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,EAAE,EAAE,aAAa;QACjB,MAAM,EAAE,kBAAkB;QAC1B,OAAO,CAAC,UAA8B;YACpC,OAAO,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-reachability preflight for the dialog-class ui-drive ops (SESSGATE,
|
|
3
|
+
* issue #480). A dialog-class op (make/reschedule a repeat, convert a to-do or
|
|
4
|
+
* heading to a project, move a heading) opens a SHEET on the main Things window
|
|
5
|
+
* and then waits for that sheet through the Accessibility tree. When the Mac's
|
|
6
|
+
* screen is LOCKED, or the user is in a FULL-SCREEN app whose Space hides all
|
|
7
|
+
* ordinary windows, System Events enumerates ZERO windows for every process
|
|
8
|
+
* (it sees only the current Space) — so the sheet opens on an AX-UNREACHABLE
|
|
9
|
+
* window and the dialog-wait times out. Worse, the still-open modal sheet then
|
|
10
|
+
* blocks AppleScript mutations app-wide (a seed auto-trash silently no-ops), and
|
|
11
|
+
* the AX-blind Escape cleanup cannot even confirm the sheet is gone.
|
|
12
|
+
*
|
|
13
|
+
* Proven live on the maintainer's host (2026-08-16): System Events reported 0
|
|
14
|
+
* windows for Things, Finder, AND Safari while Things' own AppleScript dictionary
|
|
15
|
+
* reported 1 visible normal window. This module reproduces that discriminator
|
|
16
|
+
* cheaply BEFORE any mutation, so a locked/fullscreen session refuses fast
|
|
17
|
+
* (`blocked`, exit 4) with zero side effects instead of cascading.
|
|
18
|
+
*
|
|
19
|
+
* The signals (one stable osascript shape):
|
|
20
|
+
* - `thingsAs` — Things' own AppleScript window count (`count windows`);
|
|
21
|
+
* - `thingsAx` — the System Events (AX) window count for the Things process;
|
|
22
|
+
* - `allAx` — the AX window count summed across every foreground app.
|
|
23
|
+
*
|
|
24
|
+
* The discriminator (interpretReachability):
|
|
25
|
+
* - thingsAx >= 1 -> reachable (a Things window is AX-visible);
|
|
26
|
+
* - thingsAx = 0 AND allAx = 0 -> "session": the screen is locked or a
|
|
27
|
+
* full-screen app hides every window;
|
|
28
|
+
* - thingsAx = 0 AND allAx > 0 -> "window": Things' window is on another
|
|
29
|
+
* Space (thingsAs >= 1) or there is none
|
|
30
|
+
* (thingsAs <= 0);
|
|
31
|
+
* - anything unparseable (probe error) -> reachable (fail-OPEN: the gate is an
|
|
32
|
+
* EARLY guard, never a replacement for the
|
|
33
|
+
* drive's own fail-closed canary/waits —
|
|
34
|
+
* a flaky probe must not block valid ops).
|
|
35
|
+
*/
|
|
36
|
+
import type { HazardId } from "../guards.ts";
|
|
37
|
+
import type { UiCommand, UiRunResult } from "./ui.ts";
|
|
38
|
+
/** Runtime signal from a live probe (or a test seam). -1 = the count could not be read. */
|
|
39
|
+
export interface ReachabilityCounts {
|
|
40
|
+
thingsAs: number;
|
|
41
|
+
thingsAx: number;
|
|
42
|
+
allAx: number;
|
|
43
|
+
}
|
|
44
|
+
export type ReachabilityVerdict = {
|
|
45
|
+
reachable: true;
|
|
46
|
+
} | {
|
|
47
|
+
reachable: false;
|
|
48
|
+
/**
|
|
49
|
+
* "session" — the whole session is AX-blind (locked screen / full-screen
|
|
50
|
+
* app): the HIGH-CONFIDENCE certain-failure case, blocked by BOTH the
|
|
51
|
+
* orchestrator pre-seed gate and the ui-vector in-drive gate. "window" —
|
|
52
|
+
* only Things' window is unreachable (another Space / no window): blocked
|
|
53
|
+
* by the in-drive gate (after the reveal, which would have surfaced a
|
|
54
|
+
* window in a healthy session), but NOT by the pre-seed gate (the reveal
|
|
55
|
+
* may still resolve it, so refusing before seeding would be a false
|
|
56
|
+
* positive).
|
|
57
|
+
*/
|
|
58
|
+
scope: "session" | "window";
|
|
59
|
+
detail: string;
|
|
60
|
+
remediation: string;
|
|
61
|
+
};
|
|
62
|
+
/** The runtime hazard the gate reports (enforced in the ui vector / orchestrators, not a pre-read guard). */
|
|
63
|
+
export declare const H_UI_SESSION_UNREACHABLE: HazardId;
|
|
64
|
+
/**
|
|
65
|
+
* One stable osascript shape returning the three window counts as "AS AX ALL".
|
|
66
|
+
* Every count is wrapped so a lock-time error (a window lookup that throws on an
|
|
67
|
+
* AX-blind session) degrades to -1 rather than failing the whole script.
|
|
68
|
+
*
|
|
69
|
+
* PERF1 scoping — behavior-preserving. The app-wide `allAx` walk (System Events
|
|
70
|
+
* enumerating every foreground process's windows) is near-free on the empty lab
|
|
71
|
+
* golden but seconds-long on a busy real desktop (measured 8s+ on the
|
|
72
|
+
* maintainer's host, 2026-08-18). Two changes cut that cost WITHOUT changing any
|
|
73
|
+
* verdict `interpretReachability` can produce:
|
|
74
|
+
* - The walk runs ONLY when `thingsAx = 0`. When Things has an AX-visible
|
|
75
|
+
* window (`thingsAx >= 1`, the common healthy case) the verdict is already
|
|
76
|
+
* "reachable" regardless of `allAx`, so the walk is pure waste — skipped, and
|
|
77
|
+
* `allAx` is left at -1 (never consulted on that branch). When `thingsAx < 0`
|
|
78
|
+
* (AX unreadable) the gate fail-opens on `thingsAx`, so the walk is likewise
|
|
79
|
+
* skipped and irrelevant.
|
|
80
|
+
* - When the walk IS needed, it SHORT-CIRCUITS on the first window-bearing app
|
|
81
|
+
* and reports `allAx = 1` (not the sum). The discriminator only ever tests
|
|
82
|
+
* `allAx === 0` vs `allAx > 0` (0 => whole session AX-blind / locked;
|
|
83
|
+
* > 0 => Things' window is merely on another Space or absent), so a boolean
|
|
84
|
+
* "any other window?" yields byte-identical verdicts while avoiding the cost
|
|
85
|
+
* of materializing every app's full window list.
|
|
86
|
+
*/
|
|
87
|
+
export declare function axSessionReachabilityScript(): string;
|
|
88
|
+
/** Parse the "AS AX ALL" line into counts; null when the shape is unrecognizable (probe error). */
|
|
89
|
+
export declare function parseReachabilityCounts(stdout: string): ReachabilityCounts | null;
|
|
90
|
+
/**
|
|
91
|
+
* Turn raw counts (or a probe error, `null`) into a verdict. Fail-OPEN on an
|
|
92
|
+
* unreadable probe: the gate is an early guard, not the sole line of defense.
|
|
93
|
+
*/
|
|
94
|
+
export declare function interpretReachability(counts: ReachabilityCounts | null): ReachabilityVerdict;
|
|
95
|
+
/** Run the probe through the injected runner and interpret it (fail-open on transport error). */
|
|
96
|
+
export declare function probeSessionReachability(run: (command: UiCommand, timeoutMs: number) => Promise<UiRunResult>, timeoutMs: number): Promise<ReachabilityVerdict>;
|
|
97
|
+
/**
|
|
98
|
+
* TTL for the intra-invocation reachability memo (PERF1). A promote composite
|
|
99
|
+
* probes reachability TWICE — once at the orchestrator's pre-seed gate, once at
|
|
100
|
+
* the in-drive gate after the reveal — ~20s apart on a busy host (both paid the
|
|
101
|
+
* full probe cost before this memo). 30s spans that gap with margin while
|
|
102
|
+
* expiring well before an unrelated later operation could reuse a stale verdict.
|
|
103
|
+
*/
|
|
104
|
+
export declare const REACHABILITY_CACHE_TTL_MS = 30000;
|
|
105
|
+
/**
|
|
106
|
+
* A short-lived memo of a REACHABLE verdict, shared between a promote composite's
|
|
107
|
+
* pre-seed gate and its in-drive gate so the two do not both pay the full probe
|
|
108
|
+
* cost (PERF1). `probe` returns a still-fresh memoized reachable verdict, else
|
|
109
|
+
* probes live and memoizes the result when (and only when) it is reachable;
|
|
110
|
+
* `invalidate` drops the memo (call after any action that changes window/session
|
|
111
|
+
* state, e.g. a relocation).
|
|
112
|
+
*
|
|
113
|
+
* Only a `reachable` verdict is memoized: a not-reachable verdict (locked /
|
|
114
|
+
* wrong-Space) must ALWAYS be re-evaluated fresh, because the in-drive gate probes
|
|
115
|
+
* AFTER the reveal — which surfaces a window in a healthy session and so can
|
|
116
|
+
* legitimately turn a pre-seed "window" verdict into "reachable" (reusing a stale
|
|
117
|
+
* "window" would fire a spurious relocation). A reachable verdict is stable across
|
|
118
|
+
* the reveal; if the session DEGRADES (locks / window moves) inside the cached
|
|
119
|
+
* window, the drive's dialog-wait fails and the cleanup path's OWN independent
|
|
120
|
+
* blindness probe (clearDialog, deliberately NOT routed through this memo) handles
|
|
121
|
+
* it — so a memoized reachable verdict is safe. Restricting the memo to reachable
|
|
122
|
+
* verdicts also keeps the "refuse locked / relocate wrong-Space / disclose"
|
|
123
|
+
* SESSGATE behavior byte-identical: every refusal and relocation decision is still
|
|
124
|
+
* taken on a fresh probe.
|
|
125
|
+
*/
|
|
126
|
+
export interface ReachabilityProbeCache {
|
|
127
|
+
/** Return a still-fresh memoized reachable verdict, else probe live and (if reachable) memoize it. */
|
|
128
|
+
probe(run: (command: UiCommand, timeoutMs: number) => Promise<UiRunResult>, timeoutMs: number): Promise<ReachabilityVerdict>;
|
|
129
|
+
/** Drop the memo (call after any action that changes window/session state, e.g. a relocation). */
|
|
130
|
+
invalidate(): void;
|
|
131
|
+
}
|
|
132
|
+
/** Build an intra-invocation reachability memo (PERF1). `now`/`ttlMs` are injectable for tests. */
|
|
133
|
+
export declare function createReachabilityCache(ttlMs?: number, now?: () => number): ReachabilityProbeCache;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/** The runtime hazard the gate reports (enforced in the ui vector / orchestrators, not a pre-read guard). */
|
|
2
|
+
export const H_UI_SESSION_UNREACHABLE = "H-UI-SESSION-UNREACHABLE";
|
|
3
|
+
/** A recognizable token in the probe script so a test runner can key off the reachability command. */
|
|
4
|
+
const PROBE_MARKER = "-- sessgate-reachability probe";
|
|
5
|
+
/**
|
|
6
|
+
* One stable osascript shape returning the three window counts as "AS AX ALL".
|
|
7
|
+
* Every count is wrapped so a lock-time error (a window lookup that throws on an
|
|
8
|
+
* AX-blind session) degrades to -1 rather than failing the whole script.
|
|
9
|
+
*
|
|
10
|
+
* PERF1 scoping — behavior-preserving. The app-wide `allAx` walk (System Events
|
|
11
|
+
* enumerating every foreground process's windows) is near-free on the empty lab
|
|
12
|
+
* golden but seconds-long on a busy real desktop (measured 8s+ on the
|
|
13
|
+
* maintainer's host, 2026-08-18). Two changes cut that cost WITHOUT changing any
|
|
14
|
+
* verdict `interpretReachability` can produce:
|
|
15
|
+
* - The walk runs ONLY when `thingsAx = 0`. When Things has an AX-visible
|
|
16
|
+
* window (`thingsAx >= 1`, the common healthy case) the verdict is already
|
|
17
|
+
* "reachable" regardless of `allAx`, so the walk is pure waste — skipped, and
|
|
18
|
+
* `allAx` is left at -1 (never consulted on that branch). When `thingsAx < 0`
|
|
19
|
+
* (AX unreadable) the gate fail-opens on `thingsAx`, so the walk is likewise
|
|
20
|
+
* skipped and irrelevant.
|
|
21
|
+
* - When the walk IS needed, it SHORT-CIRCUITS on the first window-bearing app
|
|
22
|
+
* and reports `allAx = 1` (not the sum). The discriminator only ever tests
|
|
23
|
+
* `allAx === 0` vs `allAx > 0` (0 => whole session AX-blind / locked;
|
|
24
|
+
* > 0 => Things' window is merely on another Space or absent), so a boolean
|
|
25
|
+
* "any other window?" yields byte-identical verdicts while avoiding the cost
|
|
26
|
+
* of materializing every app's full window list.
|
|
27
|
+
*/
|
|
28
|
+
export function axSessionReachabilityScript() {
|
|
29
|
+
return `${PROBE_MARKER}
|
|
30
|
+
set thingsAs to -1
|
|
31
|
+
try
|
|
32
|
+
tell application "Things3" to set thingsAs to count windows
|
|
33
|
+
end try
|
|
34
|
+
set thingsAx to -1
|
|
35
|
+
set allAx to -1
|
|
36
|
+
tell application "System Events"
|
|
37
|
+
try
|
|
38
|
+
set thingsAx to count (windows of process "Things3")
|
|
39
|
+
end try
|
|
40
|
+
if thingsAx is 0 then
|
|
41
|
+
try
|
|
42
|
+
set allAx to 0
|
|
43
|
+
repeat with proc in (application processes whose background only is false)
|
|
44
|
+
try
|
|
45
|
+
if (count (windows of proc)) > 0 then
|
|
46
|
+
set allAx to 1
|
|
47
|
+
exit repeat
|
|
48
|
+
end if
|
|
49
|
+
end try
|
|
50
|
+
end repeat
|
|
51
|
+
end try
|
|
52
|
+
end if
|
|
53
|
+
end tell
|
|
54
|
+
return ((thingsAs as integer) as text) & " " & ((thingsAx as integer) as text) & " " & ((allAx as integer) as text)`;
|
|
55
|
+
}
|
|
56
|
+
/** Parse the "AS AX ALL" line into counts; null when the shape is unrecognizable (probe error). */
|
|
57
|
+
export function parseReachabilityCounts(stdout) {
|
|
58
|
+
const parts = stdout.trim().split(/\s+/).map(Number);
|
|
59
|
+
if (parts.length !== 3 || parts.some((n) => !Number.isFinite(n)))
|
|
60
|
+
return null;
|
|
61
|
+
const [thingsAs, thingsAx, allAx] = parts;
|
|
62
|
+
return { thingsAs, thingsAx, allAx };
|
|
63
|
+
}
|
|
64
|
+
const SESSION_DETAIL = "Things has no window available on the screen you're viewing — the Mac's screen is locked, or a " +
|
|
65
|
+
"full-screen app is covering the desktop. This operation opens a dialog in Things, which cannot " +
|
|
66
|
+
"appear in that state.";
|
|
67
|
+
const SESSION_REMEDIATION = "Unlock the Mac, or leave the full-screen app so a Things window is visible on the current " +
|
|
68
|
+
"desktop, then run this again.";
|
|
69
|
+
const OTHER_SPACE_DETAIL = "The Things window is on another desktop. This operation opens a dialog in Things, which cannot " +
|
|
70
|
+
"appear on the screen you're viewing.";
|
|
71
|
+
const OTHER_SPACE_REMEDIATION = "Switch to the desktop showing Things (or move its window to the current desktop), then run this " +
|
|
72
|
+
"again.";
|
|
73
|
+
const NO_WINDOW_DETAIL = "Things has no open window. This operation opens a dialog in Things, which has nowhere to appear.";
|
|
74
|
+
const NO_WINDOW_REMEDIATION = "Open a Things window (click Things so a list is showing), then run this again.";
|
|
75
|
+
/**
|
|
76
|
+
* Turn raw counts (or a probe error, `null`) into a verdict. Fail-OPEN on an
|
|
77
|
+
* unreadable probe: the gate is an early guard, not the sole line of defense.
|
|
78
|
+
*/
|
|
79
|
+
export function interpretReachability(counts) {
|
|
80
|
+
// Probe error, or the AX count itself could not be read (Accessibility not
|
|
81
|
+
// granted / System Events hiccup) — do not block; the drive's own canary and
|
|
82
|
+
// dialog-wait remain fail-closed downstream.
|
|
83
|
+
if (counts === null || counts.thingsAx < 0)
|
|
84
|
+
return { reachable: true };
|
|
85
|
+
if (counts.thingsAx >= 1)
|
|
86
|
+
return { reachable: true };
|
|
87
|
+
// thingsAx === 0: no Things window is AX-visible on the current Space.
|
|
88
|
+
if (counts.allAx === 0) {
|
|
89
|
+
// Every foreground app reports zero windows -> the whole session is AX-blind
|
|
90
|
+
// (locked screen or a full-screen Space hiding all windows).
|
|
91
|
+
return {
|
|
92
|
+
reachable: false,
|
|
93
|
+
scope: "session",
|
|
94
|
+
detail: SESSION_DETAIL,
|
|
95
|
+
remediation: SESSION_REMEDIATION,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
// Other apps DO have windows, so the session is not locked — only Things'
|
|
99
|
+
// window is unreachable: it is on another Space (thingsAs >= 1) or absent.
|
|
100
|
+
if (counts.thingsAs >= 1) {
|
|
101
|
+
return {
|
|
102
|
+
reachable: false,
|
|
103
|
+
scope: "window",
|
|
104
|
+
detail: OTHER_SPACE_DETAIL,
|
|
105
|
+
remediation: OTHER_SPACE_REMEDIATION,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
reachable: false,
|
|
110
|
+
scope: "window",
|
|
111
|
+
detail: NO_WINDOW_DETAIL,
|
|
112
|
+
remediation: NO_WINDOW_REMEDIATION,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Run the probe through the injected runner and interpret it (fail-open on transport error). */
|
|
116
|
+
export async function probeSessionReachability(run, timeoutMs) {
|
|
117
|
+
const res = await run({
|
|
118
|
+
primitive: "resolve",
|
|
119
|
+
label: "session-reachability probe",
|
|
120
|
+
script: axSessionReachabilityScript(),
|
|
121
|
+
}, timeoutMs);
|
|
122
|
+
if (!res.ok)
|
|
123
|
+
return { reachable: true }; // fail-open: a probe transport error never blocks
|
|
124
|
+
return interpretReachability(parseReachabilityCounts(res.stdout));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* TTL for the intra-invocation reachability memo (PERF1). A promote composite
|
|
128
|
+
* probes reachability TWICE — once at the orchestrator's pre-seed gate, once at
|
|
129
|
+
* the in-drive gate after the reveal — ~20s apart on a busy host (both paid the
|
|
130
|
+
* full probe cost before this memo). 30s spans that gap with margin while
|
|
131
|
+
* expiring well before an unrelated later operation could reuse a stale verdict.
|
|
132
|
+
*/
|
|
133
|
+
export const REACHABILITY_CACHE_TTL_MS = 30_000;
|
|
134
|
+
/** Build an intra-invocation reachability memo (PERF1). `now`/`ttlMs` are injectable for tests. */
|
|
135
|
+
export function createReachabilityCache(ttlMs = REACHABILITY_CACHE_TTL_MS, now = Date.now) {
|
|
136
|
+
let entry = null;
|
|
137
|
+
return {
|
|
138
|
+
async probe(run, timeoutMs) {
|
|
139
|
+
if (entry !== null && entry.verdict.reachable && now() - entry.at < ttlMs) {
|
|
140
|
+
return entry.verdict;
|
|
141
|
+
}
|
|
142
|
+
const verdict = await probeSessionReachability(run, timeoutMs);
|
|
143
|
+
entry = { verdict, at: now() };
|
|
144
|
+
return verdict;
|
|
145
|
+
},
|
|
146
|
+
invalidate() {
|
|
147
|
+
entry = null;
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=session-reachability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-reachability.js","sourceRoot":"","sources":["../../../src/write/vectors/session-reachability.ts"],"names":[],"mappings":"AAgEA,6GAA6G;AAC7G,MAAM,CAAC,MAAM,wBAAwB,GAAa,0BAA0B,CAAC;AAE7E,sGAAsG;AACtG,MAAM,YAAY,GAAG,gCAAgC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,GAAG,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;oHAyB4F,CAAC;AACrH,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACrD,IAAI,K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AC/D,KAAK,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC;YAC/B,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,UAAU;YACR,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* run that HANGS against the deadline is the shape of an unanswered first-run
|
|
14
14
|
* consent dialog (classified as consent-needed by failure-hints).
|
|
15
15
|
*/
|
|
16
|
-
import { execFile } from "node:child_process";
|
|
17
16
|
import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
18
17
|
import { tmpdir } from "node:os";
|
|
19
18
|
import { join } from "node:path";
|
|
19
|
+
import { shortcutsRunExec } from "../../deputy/shortcuts-exec.js";
|
|
20
20
|
/** First-run consent can stall the run; give it generous headroom. */
|
|
21
21
|
const SHORTCUTS_TIMEOUT_MS = 25_000;
|
|
22
22
|
export const SHORTCUTS_MATRIX = {
|
|
@@ -46,19 +46,10 @@ export const SHORTCUTS_MATRIX = {
|
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
function defaultRun(shortcut, inputPath, outputPath) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const timedOut = err !== null && err.killed === true;
|
|
54
|
-
resolve({
|
|
55
|
-
exitCode: err === null ? 0 : (err.code ?? 1),
|
|
56
|
-
stdout: String(stdout),
|
|
57
|
-
stderr: String(stderr),
|
|
58
|
-
...(timedOut && { timedOut: true }),
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
});
|
|
49
|
+
// Deputy-routed when active (src/deputy/shortcuts-exec.ts) so the Shortcuts
|
|
50
|
+
// surface shares the deputy's stable identity; direct otherwise. The
|
|
51
|
+
// deadline-kill consent signature (timedOut) survives both paths.
|
|
52
|
+
return shortcutsRunExec(shortcut, inputPath, outputPath, SHORTCUTS_TIMEOUT_MS);
|
|
62
53
|
}
|
|
63
54
|
export function createShortcutsVector(run = defaultRun) {
|
|
64
55
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../../src/write/vectors/shortcuts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../../src/write/vectors/shortcuts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,sEAAsE;AACtE,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC5C,qBAAqB,EAAE;QACrB,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,WAAW;QACvB,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,KAAK,EACH,+EAA+E;YAC/E,kFAAkF;YAClF,oFAAoF;YACpF,oDAAoD;KACvD;IACD,2BAA2B,EAAE;QAC3B,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,WAAW;QACvB,QAAQ,EAAE,CAAC,SAAS,CAAC;QACrB,KAAK,EACH,yFAAyF;YACzF,qFAAqF;YACrF,0FAA0F;YAC1F,mFAAmF;YACnF,2FAA2F;YAC3F,4FAA4F;YAC5F,4FAA4F;YAC5F,sFAAsF;KACzF;CACF,CAAC;AAaF,SAAS,UAAU,CACjB,QAAgB,EAChB,SAAiB,EACjB,UAAkB;IAElB,4EAA4E;IAC5E,qEAAqE;IACrE,kEAA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umps the real database version, the fence refuses to
|
|
11
11
|
* simulate until the whole modeling chain is consciously re-verified —
|
|
12
12
|
* a schema tripwire, not a compatibility claim.
|
|
13
|
+
*
|
|
14
|
+
* 27 (Things 3.23) since 2026-08-22. The 26→27 DDL delta is INDEX-ONLY (the
|
|
15
|
+
* fingerprint is unchanged by construction — src/db/baselines/db-v27.ts), but
|
|
16
|
+
* the DATA semantics moved, which is what these appliers model:
|
|
17
|
+
* - every TMTask row now carries all four maintained counters; the `-1`
|
|
18
|
+
* "uninitialised" sentinel is back-filled with a computed 0 on the classes
|
|
19
|
+
* that can never hold one (leaf counts on to-dos, checklist counts on
|
|
20
|
+
* projects/headings). Rows with real counts were untouched.
|
|
21
|
+
* - `rt1_nextInstanceStartDate` is TEMPLATE-SCOPED, not retired: NULL on every
|
|
22
|
+
* non-template row, retained byte-identical on every repeating template
|
|
23
|
+
* that had one.
|
|
24
|
+
* Both were re-measured in-lab and confirmed against a live 3.23 library
|
|
25
|
+
* (docs/lab/gv4-323-campaign.md §2.1/§2.2, correcting the first host reading in
|
|
26
|
+
* docs/lab/dbv27-migration-diff.md). The migration-time spawn-cursor rewrite the
|
|
27
|
+
* host appeared to show did NOT reproduce (§2.3) and is deliberately NOT modeled.
|
|
13
28
|
*/
|
|
14
|
-
export declare const SIMULATED_DATABASE_VERSION =
|
|
29
|
+
export declare const SIMULATED_DATABASE_VERSION = 27;
|
|
15
30
|
/** Whether the simulator's triple fence is satisfied for `dbPath`. */
|
|
16
31
|
export declare function simulatorFenceActive(dbPath: string, env?: NodeJS.ProcessEnv): boolean;
|
|
17
32
|
/**
|