things-api 0.17.0 → 0.19.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 +16 -9
- package/deputy/AppIcon.icns +0 -0
- package/deputy/VERSION +1 -0
- package/deputy/helpers-Info.plist +27 -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 +22 -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/Resources/AppIcon.icns +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/_CodeSignature/CodeResources +128 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Info.plist +27 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/Resources/AppIcon.icns +0 -0
- package/deputy/prebuilt/Things API Helper.app/Contents/_CodeSignature/CodeResources +137 -0
- package/deputy/reader/Info.plist +22 -0
- package/deputy/reader/entitlements.plist +45 -0
- package/deputy/reader/main.swift +580 -0
- package/deputy/src/main.swift +133 -0
- package/deputy/src/osascript.swift +102 -0
- package/deputy/src/server.swift +373 -0
- package/deputy/src/sqlite.swift +121 -0
- package/deputy/src/tcc.swift +58 -0
- package/dist/audit/schema.d.ts +13 -1
- package/dist/audit/schema.js.map +1 -1
- package/dist/capability.d.ts +160 -0
- package/dist/capability.js +416 -0
- package/dist/capability.js.map +1 -0
- package/dist/cli/commands/doctor.js +181 -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 +275 -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 +45 -0
- package/dist/cli/commands/op-result.js.map +1 -0
- package/dist/cli/commands/reads.js +47 -1
- package/dist/cli/commands/reads.js.map +1 -1
- package/dist/cli/commands/setup.d.ts +9 -0
- package/dist/cli/commands/setup.js +63 -83
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/writes.d.ts +1 -1
- package/dist/cli/commands/writes.js +262 -109
- package/dist/cli/commands/writes.js.map +1 -1
- package/dist/cli/dry-run.d.ts +1 -1
- package/dist/cli/dry-run.js +1 -1
- package/dist/cli/glyphs.d.ts +23 -4
- package/dist/cli/glyphs.js +46 -19
- package/dist/cli/glyphs.js.map +1 -1
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +53 -27
- 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/main.js +22 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/period.d.ts +3 -1
- package/dist/cli/period.js +1 -1
- package/dist/cli/period.js.map +1 -1
- package/dist/cli/read-driver.js +26 -1
- package/dist/cli/read-driver.js.map +1 -1
- package/dist/cli/render.d.ts +31 -4
- package/dist/cli/render.js +127 -15
- package/dist/cli/render.js.map +1 -1
- package/dist/client.d.ts +22 -2
- package/dist/client.js +52 -15
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +31 -0
- package/dist/config.js +9 -0
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +6 -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 +319 -0
- package/dist/deputy/install.js +1239 -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 +140 -0
- package/dist/deputy/protocol.js +143 -0
- package/dist/deputy/protocol.js.map +1 -0
- package/dist/deputy/routing.d.ts +84 -0
- package/dist/deputy/routing.js +422 -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 +57 -2
- package/dist/diagnose.js +105 -3
- package/dist/diagnose.js.map +1 -1
- package/dist/direct-setup.d.ts +78 -0
- package/dist/direct-setup.js +484 -0
- package/dist/direct-setup.js.map +1 -0
- package/dist/host-access.d.ts +63 -0
- package/dist/host-access.js +165 -0
- package/dist/host-access.js.map +1 -0
- package/dist/index.d.ts +31 -5
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +27 -1
- package/dist/mcp/server.js +300 -97
- 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/recurrence.d.ts +5 -1
- package/dist/model/recurrence.js +19 -1
- 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 +55 -0
- package/dist/op-result.js +161 -0
- package/dist/op-result.js.map +1 -0
- package/dist/read/detail.js +7 -1
- package/dist/read/detail.js.map +1 -1
- package/dist/read/filter-contract.d.ts +1 -1
- package/dist/read/filter-contract.js +4 -0
- package/dist/read/filter-contract.js.map +1 -1
- package/dist/read/queries.js +8 -1
- package/dist/read/queries.js.map +1 -1
- package/dist/read/shape.js +4 -0
- package/dist/read/shape.js.map +1 -1
- package/dist/read/views.d.ts +35 -4
- package/dist/read/views.js +120 -18
- package/dist/read/views.js.map +1 -1
- package/dist/session-grant.d.ts +48 -0
- package/dist/session-grant.js +170 -0
- package/dist/session-grant.js.map +1 -0
- package/dist/surface-copy.d.ts +8 -0
- package/dist/surface-copy.js +8 -0
- package/dist/surface-copy.js.map +1 -1
- package/dist/sync-health.js +6 -2
- package/dist/sync-health.js.map +1 -1
- package/dist/wizard.d.ts +58 -0
- package/dist/wizard.js +167 -0
- package/dist/wizard.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.d.ts +1 -1
- package/dist/write/availability.js +10 -6
- package/dist/write/availability.js.map +1 -1
- package/dist/write/batch.d.ts +20 -0
- package/dist/write/batch.js +94 -15
- package/dist/write/batch.js.map +1 -1
- package/dist/write/capabilities.d.ts +9 -0
- package/dist/write/capabilities.js +2 -0
- package/dist/write/capabilities.js.map +1 -1
- package/dist/write/clear-reminder.js +1 -1
- package/dist/write/clear-reminder.js.map +1 -1
- package/dist/write/commands.d.ts +12 -1
- package/dist/write/commands.js +170 -237
- package/dist/write/commands.js.map +1 -1
- 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 +3 -1
- package/dist/write/failure-hints.js.map +1 -1
- package/dist/write/guards.js +19 -2
- package/dist/write/guards.js.map +1 -1
- package/dist/write/lock.d.ts +16 -13
- package/dist/write/lock.js +55 -0
- package/dist/write/lock.js.map +1 -1
- package/dist/write/make-repeating-project.js +9 -13
- package/dist/write/make-repeating-project.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 +64 -25
- package/dist/write/operations.js +7 -0
- package/dist/write/operations.js.map +1 -1
- package/dist/write/opid.d.ts +14 -0
- package/dist/write/opid.js +22 -0
- package/dist/write/opid.js.map +1 -1
- package/dist/write/param-schema.d.ts +124 -0
- package/dist/write/param-schema.js +747 -0
- package/dist/write/param-schema.js.map +1 -0
- package/dist/write/pipeline.d.ts +78 -2
- package/dist/write/pipeline.js +249 -4
- package/dist/write/pipeline.js.map +1 -1
- package/dist/write/pre-state.d.ts +8 -0
- package/dist/write/pre-state.js +62 -17
- package/dist/write/pre-state.js.map +1 -1
- package/dist/write/promote-clone.js +635 -367
- package/dist/write/promote-clone.js.map +1 -1
- package/dist/write/reorder.js +95 -29
- package/dist/write/reorder.js.map +1 -1
- package/dist/write/repeat-anchor.d.ts +30 -0
- package/dist/write/repeat-anchor.js +166 -1
- package/dist/write/repeat-anchor.js.map +1 -1
- package/dist/write/repeat-rule.d.ts +28 -1
- package/dist/write/repeat-rule.js +64 -4
- package/dist/write/repeat-rule.js.map +1 -1
- package/dist/write/resolution-timestamps.d.ts +11 -0
- package/dist/write/resolution-timestamps.js +83 -38
- package/dist/write/resolution-timestamps.js.map +1 -1
- package/dist/write/reversibility.js +4 -0
- package/dist/write/reversibility.js.map +1 -1
- package/dist/write/template-mutation.d.ts +137 -0
- package/dist/write/template-mutation.js +451 -0
- package/dist/write/template-mutation.js.map +1 -0
- package/dist/write/undo.js +10 -20
- package/dist/write/undo.js.map +1 -1
- package/dist/write/update-fields.d.ts +151 -0
- package/dist/write/update-fields.js +427 -0
- package/dist/write/update-fields.js.map +1 -0
- package/dist/write/vectors/applescript.js +10 -16
- package/dist/write/vectors/applescript.js.map +1 -1
- package/dist/write/vectors/registry.d.ts +1 -1
- package/dist/write/vectors/registry.js +10 -2
- package/dist/write/vectors/registry.js.map +1 -1
- package/dist/write/vectors/session-reachability.d.ts +55 -0
- package/dist/write/vectors/session-reachability.js +56 -8
- package/dist/write/vectors/session-reachability.js.map +1 -1
- package/dist/write/vectors/shortcuts.js +7 -16
- package/dist/write/vectors/shortcuts.js.map +1 -1
- package/dist/write/vectors/simulator.d.ts +16 -1
- package/dist/write/vectors/simulator.js +68 -12
- package/dist/write/vectors/simulator.js.map +1 -1
- package/dist/write/vectors/types.d.ts +124 -1
- package/dist/write/vectors/ui-recipes.d.ts +19 -0
- package/dist/write/vectors/ui-recipes.js +158 -38
- package/dist/write/vectors/ui-recipes.js.map +1 -1
- package/dist/write/vectors/ui.d.ts +89 -0
- package/dist/write/vectors/ui.js +504 -49
- package/dist/write/vectors/ui.js.map +1 -1
- package/dist/write/verify/delta.d.ts +21 -0
- 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 +9 -1
- package/schema/envelope.schema.json +5 -3
- package/scripts/build-helpers.sh +109 -0
- package/scripts/deputy-cert-setup.sh +60 -0
- package/skills/things-cli/SKILL.md +12 -5
- package/skills/things-cli/references/contracts.md +1 -0
- package/skills/things-cli/references/data-model.md +3 -0
- package/skills/things-cli/references/errors.md +5 -1
- package/skills/things-cli/references/gui.md +1 -0
- package/skills/things-cli/references/repeating.md +75 -0
- package/skills/things-cli/references/tag-cleanup.md +64 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The instance-scoped app-data grant marker (docs/design/permissions-doctrine.md,
|
|
3
|
+
* Article III).
|
|
4
|
+
*
|
|
5
|
+
* macOS has a consent class beneath Full Disk Access — "would like to access
|
|
6
|
+
* data from other apps" (`kTCCServiceSystemPolicyAppData`) — that covers the
|
|
7
|
+
* Things group container. It is MEASURED allow-once-per-responsible-process-
|
|
8
|
+
* instance: the grant is pinned to the running host app, and it dies when that
|
|
9
|
+
* app quits. It is also, by TCC's ask-on-access design, undetectable without
|
|
10
|
+
* FDA: the only way to learn whether you hold it is to open the file, and the
|
|
11
|
+
* open is what raises the modal. That is precisely what Article I forbids
|
|
12
|
+
* outside a ceremony.
|
|
13
|
+
*
|
|
14
|
+
* So the grant is not detected — it is WITNESSED. `things setup` deliberately
|
|
15
|
+
* provokes the modal, and if the container open then succeeds it writes this
|
|
16
|
+
* marker recording WHICH host-app instance the grant was minted for. A later
|
|
17
|
+
* invocation reads the marker and re-derives that instance's identity; if it
|
|
18
|
+
* still matches, the grant is necessarily still live and the container may be
|
|
19
|
+
* opened without risk of a dialog.
|
|
20
|
+
*
|
|
21
|
+
* The marker is NOT an "onboarded" flag and cannot become one: it records a
|
|
22
|
+
* live-instance fact (pid + that pid's start time), so it self-invalidates the
|
|
23
|
+
* moment the host app quits — because the grant it describes dies at the same
|
|
24
|
+
* instant. Nothing here can outlive what it describes.
|
|
25
|
+
*
|
|
26
|
+
* The one honest hole: a `tccutil reset` performed by the user mid-session
|
|
27
|
+
* revokes the grant while the app instance keeps running, so the marker stays
|
|
28
|
+
* valid and the next container open re-prompts. That is user-caused, visible,
|
|
29
|
+
* and recorded in the doctrine's enforcement inventory rather than papered over.
|
|
30
|
+
*/
|
|
31
|
+
import { execFileSync } from "node:child_process";
|
|
32
|
+
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
33
|
+
import { join } from "node:path";
|
|
34
|
+
import { stateDir } from "./paths.js";
|
|
35
|
+
/**
|
|
36
|
+
* How far apart two `kern.boottime` readings may sit and still describe the
|
|
37
|
+
* same boot. MEASURED 2026-08-24: macOS re-derives boot time from the current
|
|
38
|
+
* clock after sleep/wake, so the value drifts by minutes on a laptop that
|
|
39
|
+
* suspends — an exact match would invalidate the marker on every lid close.
|
|
40
|
+
* The pid + start-time pair is what actually carries the guarantee; boot time
|
|
41
|
+
* is only a coarse guard against pid reuse across a restart, and a restart
|
|
42
|
+
* moves it by far more than this.
|
|
43
|
+
*/
|
|
44
|
+
const BOOT_TIME_TOLERANCE_SEC = 3600;
|
|
45
|
+
export function sessionGrantPath(env = process.env) {
|
|
46
|
+
return join(stateDir(env), "session-grant.json");
|
|
47
|
+
}
|
|
48
|
+
function hostPidDefault(bundleId) {
|
|
49
|
+
try {
|
|
50
|
+
// LaunchServices answers for RUNNING apps only, which is exactly the
|
|
51
|
+
// question: a bundle id with no pid means that instance is gone.
|
|
52
|
+
const out = execFileSync("lsappinfo", ["info", "-only", "pid", bundleId], {
|
|
53
|
+
encoding: "utf8",
|
|
54
|
+
timeout: 3000,
|
|
55
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
56
|
+
});
|
|
57
|
+
const match = /"pid"\s*=\s*(\d+)/.exec(out);
|
|
58
|
+
const pid = match?.[1] !== undefined ? Number(match[1]) : Number.NaN;
|
|
59
|
+
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function processStartDefault(pid) {
|
|
66
|
+
try {
|
|
67
|
+
const out = execFileSync("ps", ["-p", String(pid), "-o", "lstart="], {
|
|
68
|
+
encoding: "utf8",
|
|
69
|
+
timeout: 3000,
|
|
70
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
71
|
+
});
|
|
72
|
+
const trimmed = out.trim();
|
|
73
|
+
return trimmed === "" ? null : trimmed;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
// A dead pid exits nonzero — the instance is gone, which is an answer.
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function bootTimeDefault() {
|
|
81
|
+
try {
|
|
82
|
+
const out = execFileSync("sysctl", ["-n", "kern.boottime"], {
|
|
83
|
+
encoding: "utf8",
|
|
84
|
+
timeout: 3000,
|
|
85
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
86
|
+
});
|
|
87
|
+
const match = /sec\s*=\s*(\d+)/.exec(out);
|
|
88
|
+
return match?.[1] !== undefined ? Number(match[1]) : null;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The live identity of the host app instance, or null when it is not running. */
|
|
95
|
+
function currentInstance(bundleId, deps) {
|
|
96
|
+
const pid = (deps.hostPid ?? hostPidDefault)(bundleId);
|
|
97
|
+
if (pid === null)
|
|
98
|
+
return null;
|
|
99
|
+
const start = (deps.processStart ?? processStartDefault)(pid);
|
|
100
|
+
return start === null ? null : { pid, start };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Record that a container open succeeded for the CURRENT host-app instance.
|
|
104
|
+
* Called by `things setup` only, and only after the open actually worked —
|
|
105
|
+
* writing this on any other occasion would turn a live-instance fact into the
|
|
106
|
+
* stored "onboarded" flag the doctrine forbids.
|
|
107
|
+
*/
|
|
108
|
+
export function witnessSessionGrant(bundleId, deps = {}) {
|
|
109
|
+
const env = deps.env ?? process.env;
|
|
110
|
+
const instance = currentInstance(bundleId, deps);
|
|
111
|
+
if (instance === null)
|
|
112
|
+
return null;
|
|
113
|
+
const marker = {
|
|
114
|
+
hostBundleId: bundleId,
|
|
115
|
+
hostPid: instance.pid,
|
|
116
|
+
hostStart: instance.start,
|
|
117
|
+
bootTime: (deps.bootTime ?? bootTimeDefault)() ?? 0,
|
|
118
|
+
witnessedAt: (deps.now ?? (() => new Date()))().toISOString(),
|
|
119
|
+
};
|
|
120
|
+
const path = sessionGrantPath(env);
|
|
121
|
+
mkdirSync(join(path, ".."), { recursive: true });
|
|
122
|
+
writeFileSync(path, `${JSON.stringify(marker, null, 2)}\n`, "utf8");
|
|
123
|
+
return marker;
|
|
124
|
+
}
|
|
125
|
+
/** Forget the marker (a ceremony that finds the grant gone clears the stale claim). */
|
|
126
|
+
export function clearSessionGrant(env = process.env) {
|
|
127
|
+
rmSync(sessionGrantPath(env), { force: true });
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Is a witnessed app-data grant still live for THIS host-app instance?
|
|
131
|
+
*
|
|
132
|
+
* Costs a marker read plus, only when a marker exists, two small process
|
|
133
|
+
* queries. Never runs at all when Full Disk Access already answers the
|
|
134
|
+
* question, which is the common direct-mode case.
|
|
135
|
+
*/
|
|
136
|
+
export function sessionGrantValid(bundleId, deps = {}) {
|
|
137
|
+
const env = deps.env ?? process.env;
|
|
138
|
+
if (bundleId === null) {
|
|
139
|
+
return { valid: false, reason: "this process has no host application identity" };
|
|
140
|
+
}
|
|
141
|
+
let marker;
|
|
142
|
+
try {
|
|
143
|
+
marker = JSON.parse(readFileSync(sessionGrantPath(env), "utf8"));
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return { valid: false, reason: "no app-data grant has been witnessed on this machine" };
|
|
147
|
+
}
|
|
148
|
+
if (marker.hostBundleId !== bundleId) {
|
|
149
|
+
return {
|
|
150
|
+
valid: false,
|
|
151
|
+
reason: `the witnessed grant belongs to ${marker.hostBundleId}, not ${bundleId}`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const instance = currentInstance(bundleId, deps);
|
|
155
|
+
if (instance === null) {
|
|
156
|
+
return { valid: false, reason: "the application that held the grant is no longer running" };
|
|
157
|
+
}
|
|
158
|
+
if (instance.pid !== marker.hostPid || instance.start !== marker.hostStart) {
|
|
159
|
+
return {
|
|
160
|
+
valid: false,
|
|
161
|
+
reason: "the application that held the grant has been restarted since",
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const boot = (deps.bootTime ?? bootTimeDefault)();
|
|
165
|
+
if (boot !== null && Math.abs(boot - marker.bootTime) > BOOT_TIME_TOLERANCE_SEC) {
|
|
166
|
+
return { valid: false, reason: "the machine has restarted since the grant was witnessed" };
|
|
167
|
+
}
|
|
168
|
+
return { valid: true, marker };
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=session-grant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-grant.js","sourceRoot":"","sources":["../src/session-grant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;GAQG;AACH,MAAM,uBAAuB,GAAG,IAAI,CAAC;AA2BrC,MAAM,UAAU,gBAAgB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACnE,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,oBAAoB,CAAC,CAAC;AACnD,CAAC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,IAAI,CAAC;QACH,qEAAqE;QACrE,iEAAiE;QACjE,MAAM,GAAG,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ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,sDAAsD,EAAE,CAAC;IAC1F,CAAC;IACD,IAAI,MAAM,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,kCAAkC,MAAM,CAAC,YAAY,SAAS,QAAQ,EAAE;SACjF,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACjD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,0DAA0D,EAAE,CAAC;IAC9F,CAAC;IACD,IAAI,QAAQ,CAAC,GAAG,KAAK,MAAM,CAAC,OAAO,IAAI,QAAQ,CAAC,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;QAC3E,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,8DAA8D;SACvE,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,eAAe,CAAC,EAAE,CAAC;IAClD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,uBAAuB,EAAE,CAAC;QAChF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,yDAAyD,EAAE,CAAC;IAC7F,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC"}
|
package/dist/surface-copy.d.ts
CHANGED
|
@@ -19,6 +19,14 @@ export declare const REMINDER_FORMAT = "HH:mm (24-hour)";
|
|
|
19
19
|
export declare const RESOLUTION_DATE_FORMAT = "ISO date or datetime; a date is noon in the effective zone";
|
|
20
20
|
/** How projects, areas, and tags may be referenced. */
|
|
21
21
|
export declare const REF_FORMAT = "uuid or unique name";
|
|
22
|
+
/**
|
|
23
|
+
* The notes-field format, shared by every `--notes`/`notes` surface: notes is a
|
|
24
|
+
* markdown field with multi-line support, not a plain text blob. Things renders
|
|
25
|
+
* the common markdown constructs while leaving the syntax characters in place,
|
|
26
|
+
* and links a bare URL on its own — so `[label](url)` stays literal text.
|
|
27
|
+
* Evidence: docs/lab/notesmd-results.md.
|
|
28
|
+
*/
|
|
29
|
+
export declare const NOTES_FORMAT = "markdown, multi-line; a bare URL becomes a link, [label](url) stays literal";
|
|
22
30
|
/**
|
|
23
31
|
* Time-window bound grammar shared by `--since`/`--until` flags: relative
|
|
24
32
|
* periods counted from today (`2w`/`3m`/`1y`) or whole calendar periods
|
package/dist/surface-copy.js
CHANGED
|
@@ -19,6 +19,14 @@ export const REMINDER_FORMAT = "HH:mm (24-hour)";
|
|
|
19
19
|
export const RESOLUTION_DATE_FORMAT = "ISO date or datetime; a date is noon in the effective zone";
|
|
20
20
|
/** How projects, areas, and tags may be referenced. */
|
|
21
21
|
export const REF_FORMAT = "uuid or unique name";
|
|
22
|
+
/**
|
|
23
|
+
* The notes-field format, shared by every `--notes`/`notes` surface: notes is a
|
|
24
|
+
* markdown field with multi-line support, not a plain text blob. Things renders
|
|
25
|
+
* the common markdown constructs while leaving the syntax characters in place,
|
|
26
|
+
* and links a bare URL on its own — so `[label](url)` stays literal text.
|
|
27
|
+
* Evidence: docs/lab/notesmd-results.md.
|
|
28
|
+
*/
|
|
29
|
+
export const NOTES_FORMAT = "markdown, multi-line; a bare URL becomes a link, [label](url) stays literal";
|
|
22
30
|
/**
|
|
23
31
|
* Time-window bound grammar shared by `--since`/`--until` flags: relative
|
|
24
32
|
* periods counted from today (`2w`/`3m`/`1y`) or whole calendar periods
|
package/dist/surface-copy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-copy.js","sourceRoot":"","sources":["../src/surface-copy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GA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AsD,CAAC;AAEhF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAG,mGAAmG,kBAAkB,gCAAgC,CAAC;AAErL,+DAA+D;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,4DAA4D,qBAAqB,sCAAsC,CAAC;AAE1J,kFAAkF;AAClF,MAAM,CAAC,MAAM,gBAAgB,GAAG,oDAAoD,CAAC;AAErF,oFAAoF;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,sEAAsE,UAAU,yCAAyC,CAAC;AAE1J;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAC1B,qJAAqJ,CAAC;AAExJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,obAAob,CAAC;AAEvb;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,MAAsD;IACnF,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,IAAI;YACP,OAAO,EAAE,CAAC;QACZ,KAAK,OAAO;YACV,OAAO;gBACL,wEAAwE;oBACtE,8CAA8C;aACjD,CAAC;QACJ,KAAK,iBAAiB;YACpB,OAAO;gBACL,6EAA6E;oBAC3E,8CAA8C;aACjD,CAAC;IACN,CAAC;AACH,CAAC"}
|
package/dist/sync-health.js
CHANGED
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
* command shape the URL-scheme availability read already uses.
|
|
19
19
|
*/
|
|
20
20
|
import { execFileSync } from "node:child_process";
|
|
21
|
-
import {
|
|
21
|
+
import { statSync } from "node:fs";
|
|
22
22
|
import { dirname, join } from "node:path";
|
|
23
|
+
import { readContainerFileSync } from "./deputy/files.js";
|
|
23
24
|
import { isThingsRunning } from "./write/automation-probe.js";
|
|
24
25
|
/** 2001-01-01T00:00:00Z expressed in Unix seconds (the NSDate epoch offset). */
|
|
25
26
|
const NSDATE_EPOCH_OFFSET_S = 978_307_200;
|
|
@@ -117,7 +118,10 @@ function defaultForegroundPlistPath(dbPath) {
|
|
|
117
118
|
function defaultReadForegroundMs(plistPath) {
|
|
118
119
|
let bytes;
|
|
119
120
|
try {
|
|
120
|
-
|
|
121
|
+
// Container-scoped read: rides the deputy when it is active, so the TCC
|
|
122
|
+
// file grant stays the deputy's (plutil below parses bytes locally and is
|
|
123
|
+
// consent-free either way).
|
|
124
|
+
bytes = readContainerFileSync(plistPath);
|
|
121
125
|
}
|
|
122
126
|
catch {
|
|
123
127
|
return null;
|
package/dist/sync-health.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-health.js","sourceRoot":"","sources":["../src/sync-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sync-health.js","sourceRoot":"","sources":["../src/sync-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAO9D,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAC1C,0FAA0F;AAC1F,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAC/C;;;;;GAKG;AACH,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAC/C,MAAM,2BAA2B,GAAG,CAAC,GAAG,GAA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AAK,CAAC;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/wizard.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The human stopped the ceremony — Ctrl-D at a gate, a `\x03`/`\x04` arriving
|
|
3
|
+
* as data, or a closed terminal. Every leg is resumable, so this is a clean
|
|
4
|
+
* stop and not a failure: the CLI prints the stopped line and exits nonzero.
|
|
5
|
+
*/
|
|
6
|
+
export declare class CeremonyStopped extends Error {
|
|
7
|
+
constructor(why?: string);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Run a ceremony's synchronous span with the process's DEFAULT SIGINT/SIGTERM
|
|
11
|
+
* disposition, so Ctrl-C really does stop it (see the module note above).
|
|
12
|
+
*
|
|
13
|
+
* The lifted listeners are restored on the way out. A `once` listener comes
|
|
14
|
+
* back as a plain one — the CLI's handler exits the process, so it cannot fire
|
|
15
|
+
* twice, and a ceremony that returns normally never reaches it at all.
|
|
16
|
+
*/
|
|
17
|
+
export declare function withDefaultInterrupts<T>(run: () => T): T;
|
|
18
|
+
export interface WizardDeps {
|
|
19
|
+
/**
|
|
20
|
+
* Is a human sitting here? Default: stdin AND stderr are both terminals —
|
|
21
|
+
* stdin because the gate has to be answerable, stderr because the explainers
|
|
22
|
+
* have to be visible even when stdout is a pipe carrying `--json`.
|
|
23
|
+
*/
|
|
24
|
+
interactive?: boolean;
|
|
25
|
+
/** Where explainers and questions are printed. Default: stderr. */
|
|
26
|
+
say?: (line: string) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Read one line from the human. Default: one line off /dev/tty. `null` means
|
|
29
|
+
* end of input — Ctrl-D, or a terminal that went away — and stops the
|
|
30
|
+
* ceremony rather than reading as a bare Enter.
|
|
31
|
+
*/
|
|
32
|
+
readLine?: () => string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface Wizard {
|
|
35
|
+
/** True when this run is a guided sitting rather than strict mode. */
|
|
36
|
+
readonly interactive: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Explain a dialog that is about to be raised, then wait for the human to say
|
|
39
|
+
* they are ready. A no-op in strict mode — there the upfront banner has
|
|
40
|
+
* already counted the dialogs and nobody is here to pace them.
|
|
41
|
+
*/
|
|
42
|
+
explain(lines: string[]): void;
|
|
43
|
+
/**
|
|
44
|
+
* Ask a yes/no question. `fallback` is the answer in strict mode (and the
|
|
45
|
+
* answer a bare Enter gives), so a non-interactive run is never blocked on
|
|
46
|
+
* one; the flag that decides it non-interactively is the caller's business.
|
|
47
|
+
*/
|
|
48
|
+
ask(question: string, fallback: boolean): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Offer a leg's alternatives: `lines` describes them, Enter takes the first
|
|
51
|
+
* one, and typing any of `keys` takes that one. Returns the chosen key, or
|
|
52
|
+
* `""` for Enter — which is also strict mode's silent answer, so the default
|
|
53
|
+
* has to be the choice an absent human would want.
|
|
54
|
+
*/
|
|
55
|
+
choose(lines: string[], keys: string[]): string;
|
|
56
|
+
}
|
|
57
|
+
/** Build the wizard for one ceremony run. Fully injectable for tests. */
|
|
58
|
+
export declare function createWizard(deps?: WizardDeps): Wizard;
|
package/dist/wizard.js
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ceremony wizard — Article V's mode-aware half
|
|
3
|
+
* (docs/design/permissions-doctrine.md).
|
|
4
|
+
*
|
|
5
|
+
* Both setup ceremonies (`things setup` and `things helpers setup`) share this
|
|
6
|
+
* machinery, because a human sitting at either one needs the same two things:
|
|
7
|
+
* to be told what is about to appear on screen BEFORE it appears, and to be
|
|
8
|
+
* allowed to get there at their own pace.
|
|
9
|
+
*
|
|
10
|
+
* At a TTY the ceremony is a WIZARD: each prompt-raising leg is preceded by one
|
|
11
|
+
* plain-language explainer naming the dialog by its actual words and the button
|
|
12
|
+
* to click, and then the ceremony waits for Enter. Off a TTY it is STRICT mode,
|
|
13
|
+
* exactly as before: the upfront banner counts the dialogs, waits are bounded,
|
|
14
|
+
* and an unanswered leg fails the run. The tier question is asked interactively
|
|
15
|
+
* when nothing else decided it, and answered by the flag when it did.
|
|
16
|
+
*
|
|
17
|
+
* TTY-ness is the ONLY signal used, and it selects wizard-vs-strict *inside* a
|
|
18
|
+
* ceremony only — never behavior anywhere else. There is deliberately no
|
|
19
|
+
* env-based agent sniffing anywhere in the package (Article V): Article I makes
|
|
20
|
+
* it unnecessary, because no ordinary command can raise a dialog for an agent
|
|
21
|
+
* to hang on in the first place.
|
|
22
|
+
*
|
|
23
|
+
* ## Why a ceremony runs with the DEFAULT signal disposition
|
|
24
|
+
*
|
|
25
|
+
* MEASURED 2026-08-24 (macOS 24.6, node under a pty): a ceremony's gates and
|
|
26
|
+
* bounded waits are SYNCHRONOUS — a blocking `read(2)` on /dev/tty, or
|
|
27
|
+
* `Atomics.wait` between polls — so they hold the event loop for their whole
|
|
28
|
+
* duration. The CLI installs `process.once("SIGINT", …)` at startup
|
|
29
|
+
* (../cli/interrupt.ts), and a registered JS listener replaces the kernel's
|
|
30
|
+
* default disposition with a libuv watcher that can only run a handler ON the
|
|
31
|
+
* event loop. With the loop held, the signal is queued and never dispatched,
|
|
32
|
+
* libuv restarts the EINTR'd read, and — because the line discipline keeps
|
|
33
|
+
* ISIG on, so ^C is consumed as a signal and never arrives as a byte — Ctrl-C
|
|
34
|
+
* is swallowed COMPLETELY: no handler, no exit, no input. Reproduced both at a
|
|
35
|
+
* gate and inside a poll; without the listener the same ^C kills node at once.
|
|
36
|
+
*
|
|
37
|
+
* The fix is {@link withDefaultInterrupts}: for the span of the ceremony the JS
|
|
38
|
+
* listeners are lifted, so the kernel terminates the process on ^C exactly as
|
|
39
|
+
* the copy promises, at the conventional 130. Deliberately NOT fixed by putting
|
|
40
|
+
* the terminal in raw mode to read ^C as `\x03`: raw mode is what would disable
|
|
41
|
+
* ISIG and *cause* this class of bug, and it leaves a terminal to restore on
|
|
42
|
+
* every exit path — including the ones a signal never lets us reach. The gate
|
|
43
|
+
* stays in canonical mode, so there is no terminal state to restore, and a
|
|
44
|
+
* `\x03`/`\x04` that does arrive as data (a harness feeding the gate, or
|
|
45
|
+
* Ctrl-D) is treated as a stop.
|
|
46
|
+
*/
|
|
47
|
+
import { closeSync, openSync, readSync } from "node:fs";
|
|
48
|
+
/** The controlling terminal, so a piped stdout/stdin cannot swallow the gate. */
|
|
49
|
+
const TTY_DEVICE = "/dev/tty";
|
|
50
|
+
/** Signals whose default disposition a ceremony restores while it blocks. */
|
|
51
|
+
const CEREMONY_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
52
|
+
/**
|
|
53
|
+
* The human stopped the ceremony — Ctrl-D at a gate, a `\x03`/`\x04` arriving
|
|
54
|
+
* as data, or a closed terminal. Every leg is resumable, so this is a clean
|
|
55
|
+
* stop and not a failure: the CLI prints the stopped line and exits nonzero.
|
|
56
|
+
*/
|
|
57
|
+
export class CeremonyStopped extends Error {
|
|
58
|
+
constructor(why = "stopped at the keyboard") {
|
|
59
|
+
super(`the setup ceremony was ${why}`);
|
|
60
|
+
this.name = "CeremonyStopped";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Run a ceremony's synchronous span with the process's DEFAULT SIGINT/SIGTERM
|
|
65
|
+
* disposition, so Ctrl-C really does stop it (see the module note above).
|
|
66
|
+
*
|
|
67
|
+
* The lifted listeners are restored on the way out. A `once` listener comes
|
|
68
|
+
* back as a plain one — the CLI's handler exits the process, so it cannot fire
|
|
69
|
+
* twice, and a ceremony that returns normally never reaches it at all.
|
|
70
|
+
*/
|
|
71
|
+
export function withDefaultInterrupts(run) {
|
|
72
|
+
const lifted = CEREMONY_SIGNALS.map((signal) => {
|
|
73
|
+
const listeners = process.listeners(signal);
|
|
74
|
+
for (const listener of listeners)
|
|
75
|
+
process.removeListener(signal, listener);
|
|
76
|
+
return { signal, listeners };
|
|
77
|
+
});
|
|
78
|
+
try {
|
|
79
|
+
return run();
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
for (const { signal, listeners } of lifted) {
|
|
83
|
+
for (const listener of listeners)
|
|
84
|
+
process.on(signal, listener);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function readLineDefault() {
|
|
89
|
+
let fd;
|
|
90
|
+
try {
|
|
91
|
+
fd = openSync(TTY_DEVICE, "r");
|
|
92
|
+
const buffer = Buffer.alloc(256);
|
|
93
|
+
const read = readSync(fd, buffer, 0, buffer.length, null);
|
|
94
|
+
// A zero-byte read is EOF, not an empty answer.
|
|
95
|
+
return read === 0 ? null : buffer.toString("utf8", 0, read).trim();
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
// No controlling terminal after all (a ceremony started under a harness
|
|
99
|
+
// that reported isTTY and then detached). Nobody can answer, so stop.
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
if (fd !== undefined) {
|
|
104
|
+
try {
|
|
105
|
+
closeSync(fd);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Nothing here can change the answer we already have.
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function interactiveDefault() {
|
|
114
|
+
return process.stdin.isTTY === true && process.stderr.isTTY === true;
|
|
115
|
+
}
|
|
116
|
+
/** Build the wizard for one ceremony run. Fully injectable for tests. */
|
|
117
|
+
export function createWizard(deps = {}) {
|
|
118
|
+
const interactive = deps.interactive ?? interactiveDefault();
|
|
119
|
+
const say = deps.say ?? ((line) => process.stderr.write(`${line}\n`));
|
|
120
|
+
const readLine = deps.readLine ?? readLineDefault;
|
|
121
|
+
/**
|
|
122
|
+
* One gate: block for the human, with the default signal disposition in
|
|
123
|
+
* force so Ctrl-C stops the ceremony. Throws {@link CeremonyStopped} on end
|
|
124
|
+
* of input, or on a `\x03`/`\x04` that reached us as data.
|
|
125
|
+
*/
|
|
126
|
+
const gate = () => {
|
|
127
|
+
const answer = withDefaultInterrupts(readLine);
|
|
128
|
+
if (answer === null)
|
|
129
|
+
throw new CeremonyStopped("stopped — no more input");
|
|
130
|
+
if (answer.includes("\u0003") || answer.includes("\u0004"))
|
|
131
|
+
throw new CeremonyStopped();
|
|
132
|
+
return answer.trim();
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
interactive,
|
|
136
|
+
explain(lines) {
|
|
137
|
+
if (!interactive)
|
|
138
|
+
return;
|
|
139
|
+
say("");
|
|
140
|
+
for (const line of lines)
|
|
141
|
+
say(line);
|
|
142
|
+
say(" press Enter when you are ready — Ctrl-C stops here, and rerunning resumes here");
|
|
143
|
+
gate();
|
|
144
|
+
},
|
|
145
|
+
ask(question, fallback) {
|
|
146
|
+
if (!interactive)
|
|
147
|
+
return fallback;
|
|
148
|
+
say("");
|
|
149
|
+
say(`${question} [${fallback ? "Y/n" : "y/N"}]`);
|
|
150
|
+
const answer = gate().toLowerCase();
|
|
151
|
+
if (answer === "")
|
|
152
|
+
return fallback;
|
|
153
|
+
return answer.startsWith("y");
|
|
154
|
+
},
|
|
155
|
+
choose(lines, keys) {
|
|
156
|
+
if (!interactive)
|
|
157
|
+
return "";
|
|
158
|
+
say("");
|
|
159
|
+
for (const line of lines)
|
|
160
|
+
say(line);
|
|
161
|
+
say(` press Enter, or type ${keys.join(" / ")} then Enter — Ctrl-C stops here, and rerunning resumes here`);
|
|
162
|
+
const answer = gate().toLowerCase();
|
|
163
|
+
return keys.find((key) => answer.startsWith(key)) ?? "";
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.js","sourceRoot":"","sources":["../src/wizard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExD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AC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -12,14 +12,16 @@
|
|
|
12
12
|
* resolves the "Items" menu every recipe enters through, so a missing menu
|
|
13
13
|
* (a Things update, or a non-English app) surfaces here too.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { osaExecSync } from "../deputy/osa.js";
|
|
16
16
|
import { isThingsRunning } from "./automation-probe.js";
|
|
17
17
|
import { simFenceActive } from "./vectors/simulator.js";
|
|
18
18
|
// Resolve the "Items" menu — the entry point of every ui recipe. Returns
|
|
19
19
|
// "true"/"false"; a permission failure throws before it can answer.
|
|
20
20
|
const PROBE_SCRIPT = 'tell application "System Events" to tell process "Things3" to return (exists menu "Items" of menu bar 1)';
|
|
21
21
|
function defaultRun(script, timeoutMs) {
|
|
22
|
-
|
|
22
|
+
// Deputy-routed when active (see automation-probe.ts) — in that mode the
|
|
23
|
+
// Accessibility question is about the deputy's grant, the one that matters.
|
|
24
|
+
return osaExecSync(script, timeoutMs);
|
|
23
25
|
}
|
|
24
26
|
export function probeAccessibility(deps = {}) {
|
|
25
27
|
if (simFenceActive()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessibility-probe.js","sourceRoot":"","sources":["../../src/write/accessibility-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"accessibility-probe.js","sourceRoot":"","sources":["../../src/write/accessibility-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAsBxD,yEAAyE;AACzE,oEAAoE;AACpE,MAAM,YAAY,GAChB,0GAA0G,C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AI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5E,OAAO;gBACL,MAAM,EAAE,QAAQ;gBAChB,MAAM,EACJ,wFAAwF;oBACxF,qFAAqF;oBACrF,gDAAgD;aACnD,CAAC;QACJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,cAAc;YACtB,MAAM,EAAE,wCAAwC,MAAM,CAAC,IAAI,EAAE,IAAI,eAAe,EAAE;SACnF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* the app.
|
|
8
8
|
*/
|
|
9
9
|
import { execFileSync } from "node:child_process";
|
|
10
|
+
import { osaExecSync } from "../deputy/osa.js";
|
|
10
11
|
import { automationGrantee } from "./failure-hints.js";
|
|
11
12
|
import { simFenceActive } from "./vectors/simulator.js";
|
|
12
13
|
const PROBE_SCRIPT = 'tell application "Things3" to count of areas';
|
|
@@ -27,7 +28,10 @@ export function isThingsRunning() {
|
|
|
27
28
|
}
|
|
28
29
|
const defaultIsAppRunning = isThingsRunning;
|
|
29
30
|
function defaultRun(script, timeoutMs) {
|
|
30
|
-
|
|
31
|
+
// Routed through the deputy when it is active: the probe then answers the
|
|
32
|
+
// right question — whether the DEPUTY (the process that sends every
|
|
33
|
+
// AppleEvent in that mode) holds the grant, not this transient CLI process.
|
|
34
|
+
return osaExecSync(script, timeoutMs);
|
|
31
35
|
}
|
|
32
36
|
export function probeAutomation(deps = {}) {
|
|
33
37
|
if (simFenceActive()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automation-probe.js","sourceRoot":"","sources":["../../src/write/automation-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAsBxD,MAAM,YAAY,GAAG,8CAA8C,CAA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AO;gBACL,MAAM,EAAE,QAAQ;gBAChB,MAAM,EACJ,qEAAqE,iBAAiB,EAAE,GAAG;oBAC3F,kFAAkF;oBAClF,uDAAuD;aAC1D,CAAC;QACJ,CAAC;QACD,OAAO;YACL,MAAM,EAAE,cAAc;YACtB,MAAM,EAAE,wCAAwC,MAAM,CAAC,IAAI,EAAE,IAAI,eAAe,EAAE;SACnF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -24,5 +24,5 @@ export interface AvailabilityDeps {
|
|
|
24
24
|
* holds the first URL write behind an enable dialog).
|
|
25
25
|
*/
|
|
26
26
|
export declare function readUrlSchemeEnabled(deps?: AvailabilityDeps): UrlSchemeState;
|
|
27
|
-
/** Which proxy shortcuts are installed (drives the Shortcuts surface + `setup
|
|
27
|
+
/** Which proxy shortcuts are installed (drives the Shortcuts surface + `setup`). */
|
|
28
28
|
export declare function readShortcutProxies(deps?: AvailabilityDeps): ShortcutsState;
|