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.
Files changed (277) hide show
  1. package/README.md +16 -9
  2. package/deputy/AppIcon.icns +0 -0
  3. package/deputy/VERSION +1 -0
  4. package/deputy/helpers-Info.plist +27 -0
  5. package/deputy/prebuilt/Things API Helper.app/Contents/CodeResources +0 -0
  6. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/Info.plist +22 -0
  7. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/MacOS/things-reader +0 -0
  8. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/Resources/AppIcon.icns +0 -0
  9. package/deputy/prebuilt/Things API Helper.app/Contents/Helpers/things-reader.app/Contents/_CodeSignature/CodeResources +128 -0
  10. package/deputy/prebuilt/Things API Helper.app/Contents/Info.plist +27 -0
  11. package/deputy/prebuilt/Things API Helper.app/Contents/MacOS/things-deputy +0 -0
  12. package/deputy/prebuilt/Things API Helper.app/Contents/Resources/AppIcon.icns +0 -0
  13. package/deputy/prebuilt/Things API Helper.app/Contents/_CodeSignature/CodeResources +137 -0
  14. package/deputy/reader/Info.plist +22 -0
  15. package/deputy/reader/entitlements.plist +45 -0
  16. package/deputy/reader/main.swift +580 -0
  17. package/deputy/src/main.swift +133 -0
  18. package/deputy/src/osascript.swift +102 -0
  19. package/deputy/src/server.swift +373 -0
  20. package/deputy/src/sqlite.swift +121 -0
  21. package/deputy/src/tcc.swift +58 -0
  22. package/dist/audit/schema.d.ts +13 -1
  23. package/dist/audit/schema.js.map +1 -1
  24. package/dist/capability.d.ts +160 -0
  25. package/dist/capability.js +416 -0
  26. package/dist/capability.js.map +1 -0
  27. package/dist/cli/commands/doctor.js +181 -2
  28. package/dist/cli/commands/doctor.js.map +1 -1
  29. package/dist/cli/commands/helpers.d.ts +17 -0
  30. package/dist/cli/commands/helpers.js +275 -0
  31. package/dist/cli/commands/helpers.js.map +1 -0
  32. package/dist/cli/commands/op-result.d.ts +15 -0
  33. package/dist/cli/commands/op-result.js +45 -0
  34. package/dist/cli/commands/op-result.js.map +1 -0
  35. package/dist/cli/commands/reads.js +47 -1
  36. package/dist/cli/commands/reads.js.map +1 -1
  37. package/dist/cli/commands/setup.d.ts +9 -0
  38. package/dist/cli/commands/setup.js +63 -83
  39. package/dist/cli/commands/setup.js.map +1 -1
  40. package/dist/cli/commands/writes.d.ts +1 -1
  41. package/dist/cli/commands/writes.js +262 -109
  42. package/dist/cli/commands/writes.js.map +1 -1
  43. package/dist/cli/dry-run.d.ts +1 -1
  44. package/dist/cli/dry-run.js +1 -1
  45. package/dist/cli/glyphs.d.ts +23 -4
  46. package/dist/cli/glyphs.js +46 -19
  47. package/dist/cli/glyphs.js.map +1 -1
  48. package/dist/cli/help.d.ts +1 -1
  49. package/dist/cli/help.js +53 -27
  50. package/dist/cli/help.js.map +1 -1
  51. package/dist/cli/helpers-check.d.ts +10 -0
  52. package/dist/cli/helpers-check.js +59 -0
  53. package/dist/cli/helpers-check.js.map +1 -0
  54. package/dist/cli/main.js +22 -1
  55. package/dist/cli/main.js.map +1 -1
  56. package/dist/cli/period.d.ts +3 -1
  57. package/dist/cli/period.js +1 -1
  58. package/dist/cli/period.js.map +1 -1
  59. package/dist/cli/read-driver.js +26 -1
  60. package/dist/cli/read-driver.js.map +1 -1
  61. package/dist/cli/render.d.ts +31 -4
  62. package/dist/cli/render.js +127 -15
  63. package/dist/cli/render.js.map +1 -1
  64. package/dist/client.d.ts +22 -2
  65. package/dist/client.js +52 -15
  66. package/dist/client.js.map +1 -1
  67. package/dist/config.d.ts +31 -0
  68. package/dist/config.js +9 -0
  69. package/dist/config.js.map +1 -1
  70. package/dist/contracts.d.ts +6 -2
  71. package/dist/contracts.js +1 -1
  72. package/dist/contracts.js.map +1 -1
  73. package/dist/db/baselines/db-v26.js +8 -4
  74. package/dist/db/baselines/db-v26.js.map +1 -1
  75. package/dist/db/baselines/db-v27.d.ts +42 -0
  76. package/dist/db/baselines/db-v27.js +47 -0
  77. package/dist/db/baselines/db-v27.js.map +1 -0
  78. package/dist/db/baselines/index.js +2 -1
  79. package/dist/db/baselines/index.js.map +1 -1
  80. package/dist/db/locate.d.ts +4 -1
  81. package/dist/db/locate.js +3 -1
  82. package/dist/db/locate.js.map +1 -1
  83. package/dist/db/schema.d.ts +1 -1
  84. package/dist/db/schema.js +9 -0
  85. package/dist/db/schema.js.map +1 -1
  86. package/dist/deputy/bridge-worker.d.ts +1 -0
  87. package/dist/deputy/bridge-worker.js +79 -0
  88. package/dist/deputy/bridge-worker.js.map +1 -0
  89. package/dist/deputy/bridge.d.ts +14 -0
  90. package/dist/deputy/bridge.js +70 -0
  91. package/dist/deputy/bridge.js.map +1 -0
  92. package/dist/deputy/client.d.ts +19 -0
  93. package/dist/deputy/client.js +104 -0
  94. package/dist/deputy/client.js.map +1 -0
  95. package/dist/deputy/db-facade.d.ts +18 -0
  96. package/dist/deputy/db-facade.js +71 -0
  97. package/dist/deputy/db-facade.js.map +1 -0
  98. package/dist/deputy/files.d.ts +1 -0
  99. package/dist/deputy/files.js +16 -0
  100. package/dist/deputy/files.js.map +1 -0
  101. package/dist/deputy/install.d.ts +319 -0
  102. package/dist/deputy/install.js +1239 -0
  103. package/dist/deputy/install.js.map +1 -0
  104. package/dist/deputy/notice.d.ts +6 -0
  105. package/dist/deputy/notice.js +28 -0
  106. package/dist/deputy/notice.js.map +1 -0
  107. package/dist/deputy/notices.d.ts +31 -0
  108. package/dist/deputy/notices.js +94 -0
  109. package/dist/deputy/notices.js.map +1 -0
  110. package/dist/deputy/osa.d.ts +21 -0
  111. package/dist/deputy/osa.js +72 -0
  112. package/dist/deputy/osa.js.map +1 -0
  113. package/dist/deputy/protocol.d.ts +140 -0
  114. package/dist/deputy/protocol.js +143 -0
  115. package/dist/deputy/protocol.js.map +1 -0
  116. package/dist/deputy/routing.d.ts +84 -0
  117. package/dist/deputy/routing.js +422 -0
  118. package/dist/deputy/routing.js.map +1 -0
  119. package/dist/deputy/shortcuts-exec.d.ts +10 -0
  120. package/dist/deputy/shortcuts-exec.js +50 -0
  121. package/dist/deputy/shortcuts-exec.js.map +1 -0
  122. package/dist/diagnose.d.ts +57 -2
  123. package/dist/diagnose.js +105 -3
  124. package/dist/diagnose.js.map +1 -1
  125. package/dist/direct-setup.d.ts +78 -0
  126. package/dist/direct-setup.js +484 -0
  127. package/dist/direct-setup.js.map +1 -0
  128. package/dist/host-access.d.ts +63 -0
  129. package/dist/host-access.js +165 -0
  130. package/dist/host-access.js.map +1 -0
  131. package/dist/index.d.ts +31 -5
  132. package/dist/index.js +23 -1
  133. package/dist/index.js.map +1 -1
  134. package/dist/mcp/server.d.ts +27 -1
  135. package/dist/mcp/server.js +300 -97
  136. package/dist/mcp/server.js.map +1 -1
  137. package/dist/model/mappers.d.ts +12 -3
  138. package/dist/model/mappers.js +6 -1
  139. package/dist/model/mappers.js.map +1 -1
  140. package/dist/model/recurrence.d.ts +5 -1
  141. package/dist/model/recurrence.js +19 -1
  142. package/dist/model/recurrence.js.map +1 -1
  143. package/dist/model/template-projection.d.ts +26 -0
  144. package/dist/model/template-projection.js +113 -0
  145. package/dist/model/template-projection.js.map +1 -0
  146. package/dist/op-result.d.ts +55 -0
  147. package/dist/op-result.js +161 -0
  148. package/dist/op-result.js.map +1 -0
  149. package/dist/read/detail.js +7 -1
  150. package/dist/read/detail.js.map +1 -1
  151. package/dist/read/filter-contract.d.ts +1 -1
  152. package/dist/read/filter-contract.js +4 -0
  153. package/dist/read/filter-contract.js.map +1 -1
  154. package/dist/read/queries.js +8 -1
  155. package/dist/read/queries.js.map +1 -1
  156. package/dist/read/shape.js +4 -0
  157. package/dist/read/shape.js.map +1 -1
  158. package/dist/read/views.d.ts +35 -4
  159. package/dist/read/views.js +120 -18
  160. package/dist/read/views.js.map +1 -1
  161. package/dist/session-grant.d.ts +48 -0
  162. package/dist/session-grant.js +170 -0
  163. package/dist/session-grant.js.map +1 -0
  164. package/dist/surface-copy.d.ts +8 -0
  165. package/dist/surface-copy.js +8 -0
  166. package/dist/surface-copy.js.map +1 -1
  167. package/dist/sync-health.js +6 -2
  168. package/dist/sync-health.js.map +1 -1
  169. package/dist/wizard.d.ts +58 -0
  170. package/dist/wizard.js +167 -0
  171. package/dist/wizard.js.map +1 -0
  172. package/dist/write/accessibility-probe.js +4 -2
  173. package/dist/write/accessibility-probe.js.map +1 -1
  174. package/dist/write/automation-probe.js +5 -1
  175. package/dist/write/automation-probe.js.map +1 -1
  176. package/dist/write/availability.d.ts +1 -1
  177. package/dist/write/availability.js +10 -6
  178. package/dist/write/availability.js.map +1 -1
  179. package/dist/write/batch.d.ts +20 -0
  180. package/dist/write/batch.js +94 -15
  181. package/dist/write/batch.js.map +1 -1
  182. package/dist/write/capabilities.d.ts +9 -0
  183. package/dist/write/capabilities.js +2 -0
  184. package/dist/write/capabilities.js.map +1 -1
  185. package/dist/write/clear-reminder.js +1 -1
  186. package/dist/write/clear-reminder.js.map +1 -1
  187. package/dist/write/commands.d.ts +12 -1
  188. package/dist/write/commands.js +170 -237
  189. package/dist/write/commands.js.map +1 -1
  190. package/dist/write/experimental.d.ts +19 -0
  191. package/dist/write/experimental.js +50 -0
  192. package/dist/write/experimental.js.map +1 -1
  193. package/dist/write/failure-hints.d.ts +3 -1
  194. package/dist/write/failure-hints.js.map +1 -1
  195. package/dist/write/guards.js +19 -2
  196. package/dist/write/guards.js.map +1 -1
  197. package/dist/write/lock.d.ts +16 -13
  198. package/dist/write/lock.js +55 -0
  199. package/dist/write/lock.js.map +1 -1
  200. package/dist/write/make-repeating-project.js +9 -13
  201. package/dist/write/make-repeating-project.js.map +1 -1
  202. package/dist/write/move.js +14 -6
  203. package/dist/write/move.js.map +1 -1
  204. package/dist/write/operations.d.ts +64 -25
  205. package/dist/write/operations.js +7 -0
  206. package/dist/write/operations.js.map +1 -1
  207. package/dist/write/opid.d.ts +14 -0
  208. package/dist/write/opid.js +22 -0
  209. package/dist/write/opid.js.map +1 -1
  210. package/dist/write/param-schema.d.ts +124 -0
  211. package/dist/write/param-schema.js +747 -0
  212. package/dist/write/param-schema.js.map +1 -0
  213. package/dist/write/pipeline.d.ts +78 -2
  214. package/dist/write/pipeline.js +249 -4
  215. package/dist/write/pipeline.js.map +1 -1
  216. package/dist/write/pre-state.d.ts +8 -0
  217. package/dist/write/pre-state.js +62 -17
  218. package/dist/write/pre-state.js.map +1 -1
  219. package/dist/write/promote-clone.js +635 -367
  220. package/dist/write/promote-clone.js.map +1 -1
  221. package/dist/write/reorder.js +95 -29
  222. package/dist/write/reorder.js.map +1 -1
  223. package/dist/write/repeat-anchor.d.ts +30 -0
  224. package/dist/write/repeat-anchor.js +166 -1
  225. package/dist/write/repeat-anchor.js.map +1 -1
  226. package/dist/write/repeat-rule.d.ts +28 -1
  227. package/dist/write/repeat-rule.js +64 -4
  228. package/dist/write/repeat-rule.js.map +1 -1
  229. package/dist/write/resolution-timestamps.d.ts +11 -0
  230. package/dist/write/resolution-timestamps.js +83 -38
  231. package/dist/write/resolution-timestamps.js.map +1 -1
  232. package/dist/write/reversibility.js +4 -0
  233. package/dist/write/reversibility.js.map +1 -1
  234. package/dist/write/template-mutation.d.ts +137 -0
  235. package/dist/write/template-mutation.js +451 -0
  236. package/dist/write/template-mutation.js.map +1 -0
  237. package/dist/write/undo.js +10 -20
  238. package/dist/write/undo.js.map +1 -1
  239. package/dist/write/update-fields.d.ts +151 -0
  240. package/dist/write/update-fields.js +427 -0
  241. package/dist/write/update-fields.js.map +1 -0
  242. package/dist/write/vectors/applescript.js +10 -16
  243. package/dist/write/vectors/applescript.js.map +1 -1
  244. package/dist/write/vectors/registry.d.ts +1 -1
  245. package/dist/write/vectors/registry.js +10 -2
  246. package/dist/write/vectors/registry.js.map +1 -1
  247. package/dist/write/vectors/session-reachability.d.ts +55 -0
  248. package/dist/write/vectors/session-reachability.js +56 -8
  249. package/dist/write/vectors/session-reachability.js.map +1 -1
  250. package/dist/write/vectors/shortcuts.js +7 -16
  251. package/dist/write/vectors/shortcuts.js.map +1 -1
  252. package/dist/write/vectors/simulator.d.ts +16 -1
  253. package/dist/write/vectors/simulator.js +68 -12
  254. package/dist/write/vectors/simulator.js.map +1 -1
  255. package/dist/write/vectors/types.d.ts +124 -1
  256. package/dist/write/vectors/ui-recipes.d.ts +19 -0
  257. package/dist/write/vectors/ui-recipes.js +158 -38
  258. package/dist/write/vectors/ui-recipes.js.map +1 -1
  259. package/dist/write/vectors/ui.d.ts +89 -0
  260. package/dist/write/vectors/ui.js +504 -49
  261. package/dist/write/vectors/ui.js.map +1 -1
  262. package/dist/write/verify/delta.d.ts +21 -0
  263. package/dist/write/verify/delta.js.map +1 -1
  264. package/dist/write/verify/poller.d.ts +13 -0
  265. package/dist/write/verify/poller.js +38 -0
  266. package/dist/write/verify/poller.js.map +1 -1
  267. package/package.json +9 -1
  268. package/schema/envelope.schema.json +5 -3
  269. package/scripts/build-helpers.sh +109 -0
  270. package/scripts/deputy-cert-setup.sh +60 -0
  271. package/skills/things-cli/SKILL.md +12 -5
  272. package/skills/things-cli/references/contracts.md +1 -0
  273. package/skills/things-cli/references/data-model.md +3 -0
  274. package/skills/things-cli/references/errors.md +5 -1
  275. package/skills/things-cli/references/gui.md +1 -0
  276. package/skills/things-cli/references/repeating.md +75 -0
  277. package/skills/things-cli/references/tag-cleanup.md +64 -0
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Host identity and the Full Disk Access probe
3
+ * (docs/design/permissions-doctrine.md, Articles I and III).
4
+ *
5
+ * This module is deliberately dependency-light — it imports nothing that could
6
+ * import it back — so the routing layer, the capability verdict, and the
7
+ * helpers ceremonies can all consult the same prompt-free facts.
8
+ *
9
+ * Its facts serve DIRECT mode: whether this host app holds Full Disk Access,
10
+ * and what to call it in copy. The helpers path needs none of them — since
11
+ * helpers 1.3.0 the reader's rendezvous is a launchd-owned socket plus an
12
+ * installer-minted token in `<state>/reader`, ordinary files this process owns,
13
+ * so reaching the reader crosses no container boundary and raises no consent
14
+ * class from any host.
15
+ */
16
+ import { execFileSync } from "node:child_process";
17
+ import { closeSync, openSync, readFileSync, existsSync as realExistsSync } from "node:fs";
18
+ import { homedir } from "node:os";
19
+ import { join } from "node:path";
20
+ import {} from "./session-grant.js";
21
+ /** The user TCC database. Readable iff the calling process holds Full Disk Access. */
22
+ const TCC_DB_RELATIVE = "Library/Application Support/com.apple.TCC/TCC.db";
23
+ // ── Host identity ────────────────────────────────────────────────────────────
24
+ /**
25
+ * Terminals and agent harnesses whose display name we can state without asking
26
+ * LaunchServices. Only an exec-free shortcut: an unlisted host still resolves,
27
+ * it just pays one `lsappinfo` call on a copy path.
28
+ */
29
+ const KNOWN_HOSTS = {
30
+ "com.apple.Terminal": "Terminal",
31
+ "com.googlecode.iterm2": "iTerm2",
32
+ "com.mitchellh.ghostty": "Ghostty",
33
+ "dev.warp.Warp-Stable": "Warp",
34
+ "net.kovidgoyal.kitty": "kitty",
35
+ "io.alacritty": "Alacritty",
36
+ "com.microsoft.VSCode": "Visual Studio Code",
37
+ "com.anthropic.claude-code": "Claude Code",
38
+ "com.anthropic.claudefordesktop": "Claude",
39
+ };
40
+ /** TERM_PROGRAM values, for hosts that set it but expose no bundle id. */
41
+ const TERM_PROGRAM_NAMES = {
42
+ Apple_Terminal: "Terminal",
43
+ iTerm: "iTerm2",
44
+ "iTerm.app": "iTerm2",
45
+ ghostty: "Ghostty",
46
+ WarpTerminal: "Warp",
47
+ vscode: "Visual Studio Code",
48
+ Hyper: "Hyper",
49
+ WezTerm: "WezTerm",
50
+ };
51
+ /** The fallback used everywhere a host cannot be named — never a guess. */
52
+ const ANONYMOUS_HOST = "this terminal";
53
+ let hostNameMemo = null;
54
+ function lookupAppNameDefault(bundleId) {
55
+ try {
56
+ // LaunchServices knows the display name of every RUNNING app, which the
57
+ // host terminal always is. Quoted-value output: "LSDisplayName"="Ghostty".
58
+ const out = execFileSync("lsappinfo", ["info", "-only", "name", bundleId], {
59
+ encoding: "utf8",
60
+ timeout: 3000,
61
+ stdio: ["ignore", "pipe", "ignore"],
62
+ });
63
+ const match = /"LSDisplayName"\s*=\s*"([^"]+)"/.exec(out);
64
+ return match?.[1] ?? null;
65
+ }
66
+ catch {
67
+ return null;
68
+ }
69
+ }
70
+ /**
71
+ * The host app, resolved from the environment alone — no subprocess, so this is
72
+ * safe on the hot path. `__CFBundleIdentifier` is set by macOS when a process
73
+ * descends from an app bundle, which is how a terminal's shell (and everything
74
+ * it spawns) carries its emulator's identity.
75
+ */
76
+ export function hostApp(deps = {}) {
77
+ const env = deps.env ?? process.env;
78
+ const bundleId = env["__CFBundleIdentifier"] ?? null;
79
+ const termProgram = env["TERM_PROGRAM"] ?? "";
80
+ const name = (bundleId !== null ? KNOWN_HOSTS[bundleId] : undefined) ??
81
+ TERM_PROGRAM_NAMES[termProgram] ??
82
+ ANONYMOUS_HOST;
83
+ return { bundleId, name };
84
+ }
85
+ /**
86
+ * The host app's display name for COPY. Identical to {@link hostApp}'s name
87
+ * except for an unlisted bundle id, where LaunchServices is asked once per
88
+ * process. Only call this from a path that is about to print.
89
+ */
90
+ export function hostDisplayName(deps = {}) {
91
+ if (hostNameMemo !== null)
92
+ return hostNameMemo;
93
+ const host = hostApp(deps);
94
+ if (host.name !== ANONYMOUS_HOST || host.bundleId === null) {
95
+ hostNameMemo = host.name;
96
+ return hostNameMemo;
97
+ }
98
+ hostNameMemo = (deps.lookupAppName ?? lookupAppNameDefault)(host.bundleId) ?? ANONYMOUS_HOST;
99
+ return hostNameMemo;
100
+ }
101
+ /** Test seam: forget the one memo this module keeps (the host's display name). */
102
+ export function resetHostAccessForTests() {
103
+ hostNameMemo = null;
104
+ }
105
+ // ── The Full Disk Access probe ───────────────────────────────────────────────
106
+ /** Where the FDA probe reads. Exported so `doctor` and the ceremony can name it. */
107
+ export function tccDbPath(env = process.env) {
108
+ return join(env["HOME"] ?? homedir(), TCC_DB_RELATIVE);
109
+ }
110
+ function fdaProbeDefault(env) {
111
+ // ONE open(2), read-only, immediately closed. This file is FDA-class: macOS
112
+ // answers it with a plain EPERM rather than a dialog, which is precisely why
113
+ // the doctrine picks it as the probe (Article III). Deliberately NOT cached:
114
+ // read capability is ground truth per invocation.
115
+ const fd = openSync(tccDbPath(env), "r");
116
+ closeSync(fd);
117
+ }
118
+ /**
119
+ * Does the host app hold Full Disk Access? Prompt-free by construction. An
120
+ * EPERM (or the sandbox's EACCES) is the ordinary "no"; any other errno is
121
+ * reported as itself rather than folded into a false negative.
122
+ */
123
+ export function fdaGranted(deps = {}) {
124
+ const env = deps.env ?? process.env;
125
+ try {
126
+ (deps.fdaProbe ?? (() => fdaProbeDefault(env)))();
127
+ return { granted: true, code: null };
128
+ }
129
+ catch (err) {
130
+ return { granted: false, code: err.code ?? null };
131
+ }
132
+ }
133
+ // ── EPERM-safe rendezvous reads ──────────────────────────────────────────────
134
+ //
135
+ // The rendezvous is ours now, so these are ordinary reads of ordinary files.
136
+ // The belt stays on anyway: a `stat`/`open` that ends in EPERM (a stray chmod,
137
+ // a filesystem that answers oddly) is a STATE to report, never a crash out of
138
+ // a routing probe, and never a second attempt.
139
+ /**
140
+ * `existsSync` for a rendezvous path. It already swallows errno, but it is
141
+ * wrapped anyway so no future refactor can turn a denial into a throw, and so
142
+ * every rendezvous touch reads the same at the call site.
143
+ */
144
+ export function rendezvousExists(path) {
145
+ try {
146
+ return realExistsSync(path);
147
+ }
148
+ catch {
149
+ return false;
150
+ }
151
+ }
152
+ /**
153
+ * Read the reader's access token. Returns null instead of throwing when the
154
+ * read fails (ENOENT before the first install; EPERM if something outside our
155
+ * flows re-permissioned the file).
156
+ */
157
+ export function readRendezvousToken(path) {
158
+ try {
159
+ return readFileSync(path, "utf8").trim();
160
+ }
161
+ catch {
162
+ return null;
163
+ }
164
+ }
165
+ //# sourceMappingURL=host-access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host-access.js","sourceRoot":"","sources":["../src/host-access.ts"],"names":[],"mappings":"AAAA;;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Ac,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export type { Truncation, GroupBlock } from "./contracts.ts";
11
11
  export type { TodayBucketTotals, AreaBucketTotals, SectionTotals, UpcomingBlockTotals, } from "./read/truncation.ts";
12
12
  export { diagnose } from "./diagnose.ts";
13
13
  export type { DiagnoseOptions, DiagnoseReport, DiagnoseResult } from "./diagnose.ts";
14
+ export { opResult } from "./op-result.ts";
15
+ export type { OpResultData, OpResultOptions, OpResultStatus } from "./op-result.ts";
14
16
  export { probeAutomation } from "./write/automation-probe.ts";
15
17
  export type { AutomationProbeDeps, AutomationProbeResult, AutomationProbeStatus, } from "./write/automation-probe.ts";
16
18
  export { createEnvironmentTracker, describeEnvironmentChanges, diffEnvironment, } from "./write/environment.ts";
@@ -18,17 +20,21 @@ export type { EnvironmentChange, EnvironmentTracker, EnvironmentTuple, } from ".
18
20
  export type { FailureHint, LikelyCause } from "./write/failure-hints.ts";
19
21
  export { capabilitiesTable } from "./write/capabilities.ts";
20
22
  export type { CapabilityEntry } from "./write/capabilities.ts";
21
- export { describeConfig, getConfigKey, saveConfigKey } from "./config.ts";
23
+ export { assertOperationParams, ParamSchemaError, PARAM_SCHEMAS, paramSummary, validateOperationParams, } from "./write/param-schema.ts";
24
+ export type { FieldKind, FieldSpec, ParamSummary } from "./write/param-schema.ts";
25
+ export { describeConfig, getConfigKey, loadConfig, saveConfigKey } from "./config.ts";
22
26
  export type { ConfigKeyView } from "./config.ts";
23
27
  export type { UndoItemResult, UndoOptions, UndoPlan, UndoStep } from "./write/undo.ts";
24
28
  export type { BatchItemResult, BatchOp, BatchOptions, BatchResult } from "./write/batch.ts";
25
29
  export type { ReorderResult } from "./write/reorder.ts";
26
30
  export type { MoveResult, MoveOk, MoveRefused, MoveLegFailed, MoveDryRun, MovePosition, PlacementClass, ProjectMoveDestination, ProjectMoveRequest, ReorderRequest, TodoMoveDestination, TodoMoveRequest, } from "./write/move.ts";
27
- export type { SearchOptions, SomedayFilter, UpcomingFilter, ViewFilter, ChangedItem, DeadlinesFilter, } from "./read/views.ts";
31
+ export type { SearchOptions, SomedayFilter, UpcomingFilter, ViewFilter, ChangedItem, DeadlinesFilter, RepeatersFilter, } from "./read/views.ts";
28
32
  export { FILTER_CONTRACT, hasTagPresence, tagFlagConflict, tagFilterFields, validateViewArgs, } from "./read/filter-contract.ts";
29
33
  export type { BoundModel, FilterArgs, FilterVocab, TagPresence, TagSemantics, ViewFilterSpec, ViewName, ViewValidation, } from "./read/filter-contract.ts";
30
- export type { Acknowledgements, AreaAddParams, ContainerRef, HeadingPlacement, MoveHeadingParams, OperationKind, OperationParamsMap, ProjectAddParams, ProjectCompleteParams, ProjectMoveParams, ProjectUpdateParams, ReorderParams, ReorderScope, ReorderStrategy, TagAddParams, TagUpdateParams, AreaUpdateParams, TodoAddParams, TodoMoveParams, TodoUpdateParams, WhenValue, } from "./write/operations.ts";
34
+ export type { Acknowledgements, AreaAddParams, ContainerRef, HeadingPlacement, MoveHeadingParams, OperationKind, OperationParamsMap, ProjectAddParams, ProjectCompleteParams, ProjectMoveParams, ProjectUpdateParams, ReorderParams, ReorderScope, ReorderStrategy, TagAddParams, TagUpdateParams, AreaUpdateParams, TodoAddParams, TodoMoveParams, TodoUpdateParams, UpdateFields, WhenValue, } from "./write/operations.ts";
31
35
  export { OPERATION_KINDS } from "./write/operations.ts";
36
+ export { buildUpdatePatch, CLI_UPDATE_LABELS, MCP_UPDATE_LABELS } from "./write/update-fields.ts";
37
+ export type { UpdateInput, UpdateLabels, UpdatePatch, UpdatePatchResult, } from "./write/update-fields.ts";
32
38
  export type { MutationPlan, MutationResult, WriteOptions } from "./write/pipeline.ts";
33
39
  export type { HazardId } from "./write/guards.ts";
34
40
  export { HAZARD_IDS } from "./write/guards.ts";
@@ -36,9 +42,10 @@ export type { CompiledInvocation, VectorId, VectorMatrix, VectorSupport, WriteVe
36
42
  export { APPLESCRIPT_MATRIX } from "./write/vectors/applescript.ts";
37
43
  export { URL_SCHEME_MATRIX } from "./write/vectors/url-scheme.ts";
38
44
  export { dbCarriesBenchMarker, simFenceActive } from "./write/vectors/simulator.ts";
39
- export type { DeltaSpec, FieldAssertion, RepeatingDiscovery } from "./write/verify/delta.ts";
45
+ export type { DeltaSpec, FieldAssertion, OccurrenceResolution, RepeatingDiscovery, } from "./write/verify/delta.ts";
40
46
  export type { AuditRecord } from "./audit/schema.ts";
41
- export type { DisruptionTier, Profile, ThingsApiConfig } from "./config.ts";
47
+ export type { DisruptionTier, HelpersMode, Profile, ThingsApiConfig } from "./config.ts";
48
+ export { HELPERS_MODES, parseHelpersMode } from "./config.ts";
42
49
  export type { AnyTask, Area, ChecklistItem, DerivedSubstrate, Heading, IsoDateGroup, Project, Ref, RepeatContext, RepeatingInfo, StartState, Tag, TaskStatus, TaskType, Todo, } from "./model/entities.ts";
43
50
  export type { IsoDate } from "./model/dates.ts";
44
51
  export { calendarDateInZone, dayBoundInstant, hostTimeZone, isValidTimeZone, } from "./model/dates.ts";
@@ -62,6 +69,15 @@ export { splitWhenSugar, CLI_WHEN_LABELS, MCP_WHEN_LABELS } from "./model/when-s
62
69
  export type { WhenSugar, WhenSugarLabels } from "./model/when-sugar.ts";
63
70
  export { ThingsDbNotFoundError } from "./db/locate.ts";
64
71
  export { ThingsDbOpenError } from "./db/connection.ts";
72
+ export { deputyPlistPath, deputySigningInfo, grantReader, helpersBundleCandidates, helpersDefaultBuildPath, helpersStatus, installedHelpersVersion, installHelpers, onboardHelpers, readerPlistPath, restartHelpers, uninstallHelpers, } from "./deputy/install.ts";
73
+ export type { DeputyHalfStatus, DeputySigning, HelpersInstallResult, HelpersOnboardResult, HelpersRevocation, HelpersStatus, HelpersUninstallDeps, HelpersUninstallOptions, HelpersUninstallResult, OnboardChannel, OnboardDeps, OnboardLeg, OnboardOptions, OnboardState, OnboardStep, OnboardTier, ReaderHalfStatus, } from "./deputy/install.ts";
74
+ export { deputyInstalledBinaryPath, EXPECTED_HELPERS_VERSION, helpersInstallDir, helpersInstalledBundlePath, readerInstalledAppPath, } from "./deputy/protocol.ts";
75
+ export type { AutomationPermission, DeputyAutomationStatus, DeputyHello, } from "./deputy/protocol.ts";
76
+ export { deputyRouting, helpersRouting, readerRouting } from "./deputy/routing.ts";
77
+ export type { DeputyRouting, HelpersRouting } from "./deputy/routing.ts";
78
+ export { emitHelpersNotice } from "./deputy/notice.ts";
79
+ export { computeHelpersNotice, HELPERS_HINT_INTERVAL_DAYS, lastHelpersHintAt, markHelpersHintShown, } from "./deputy/notices.ts";
80
+ export type { HelpersNotice, HelpersNoticeKind } from "./deputy/notices.ts";
65
81
  export type { Baseline, FingerprintStatus, SchemaObservation } from "./db/fingerprint.ts";
66
82
  export { aggregateExitCode, API_VERSION, blockedCode, errorEnvelope, ExitCode, mutationWireData, okEnvelope, PKG_VERSION, verifyFailedCode, } from "./contracts.ts";
67
83
  export type { Envelope, EnvelopeMeta, ErrorCode, ErrorEnvelope, OkEnvelope, WireData, WireEnvelope, WireOkEnvelope, WireOkKind, } from "./contracts.ts";
@@ -72,6 +88,7 @@ export { makeRefPromoter, titleRoundTrips } from "./read/queries.ts";
72
88
  export { fusedRef, REF_PREFIX_LEN } from "./read/queries.ts";
73
89
  export { instantDateIso, localToday } from "./model/dates.ts";
74
90
  export { templateStatus } from "./model/recurrence.ts";
91
+ export type { RepeatOffset, RepeatRule } from "./model/recurrence.ts";
75
92
  export { isTodayMember } from "./read/views.ts";
76
93
  export { entityProvisional, entityStage, entityWhen } from "./read/stage.ts";
77
94
  export type { When } from "./read/stage.ts";
@@ -89,6 +106,15 @@ export { BOUNCE_MAX_ITEMS } from "./write/reorder.ts";
89
106
  export type { AddRepeatingRuleFields, MonthlyAnchor, ProjectAddRepeatingParams, RepeatEnds, RepeatFrequency, RepeatRuleParams, TodoAddRepeatingParams, Weekday, WeekdayOrdinal, YearlyAnchor, } from "./write/operations.ts";
90
107
  export { shortcutProxies } from "./diagnose.ts";
91
108
  export type { ShortcutsState } from "./write/availability.ts";
109
+ export { fdaGranted, hostApp, hostDisplayName, readAllowed, readCapability, ReadCapabilityError, resetCapabilityForTests, tccDbPath, uiAllowed, uiCapability, UiCapabilityError, UI_DIRECT_ESCAPE_ENV, writeAllowed, writeCapability, WriteCapabilityError, THINGS_BUNDLE_ID, } from "./capability.ts";
110
+ export type { Capability, CapabilityDeps, FdaVerdict, HostApp, ReadCapability, ReadCapabilityMode, UiCapability, UiCapabilityMode, WriteCapability, WriteCapabilityMode, } from "./capability.ts";
111
+ export type { HostAccessDeps } from "./host-access.ts";
112
+ export { clearSessionGrant, sessionGrantPath, sessionGrantValid, witnessSessionGrant, } from "./session-grant.ts";
113
+ export type { SessionGrantDeps, SessionGrantMarker, SessionGrantVerdict } from "./session-grant.ts";
114
+ export { directSetup, surveySetup } from "./direct-setup.ts";
115
+ export { CeremonyStopped, createWizard, withDefaultInterrupts } from "./wizard.ts";
116
+ export type { Wizard, WizardDeps } from "./wizard.ts";
117
+ export type { DirectSetupDeps, DirectSetupResult, SetupLeg, SetupState, SetupStep, SetupSurvey, } from "./direct-setup.ts";
92
118
  export { closeCliTrace, getInflight, installCliTrace, resolveTraceEnabled, sanitizeArgv, trace, traceActive, tracePath, } from "./trace/tracer.ts";
93
119
  export type { InflightWrite, TraceEvent, TraceSink } from "./trace/tracer.ts";
94
120
  export { traceDir } from "./paths.ts";
package/dist/index.js CHANGED
@@ -7,19 +7,28 @@
7
7
  */
8
8
  export { openThings } from "./client.js";
9
9
  export { diagnose } from "./diagnose.js";
10
+ export { opResult } from "./op-result.js";
10
11
  export { probeAutomation } from "./write/automation-probe.js";
11
12
  export { createEnvironmentTracker, describeEnvironmentChanges, diffEnvironment, } from "./write/environment.js";
12
13
  export { capabilitiesTable } from "./write/capabilities.js";
13
- export { describeConfig, getConfigKey, saveConfigKey } from "./config.js";
14
+ // The per-operation PARAMETER schema (#580): the one structural contract every
15
+ // untyped entry point is held to. Exported so the consumer surfaces (CLI, MCP)
16
+ // reach it through this barrel rather than importing a write internal.
17
+ export { assertOperationParams, ParamSchemaError, PARAM_SCHEMAS, paramSummary, validateOperationParams, } from "./write/param-schema.js";
18
+ export { describeConfig, getConfigKey, loadConfig, saveConfigKey } from "./config.js";
14
19
  // The per-view read-filter contract: the declarative applicability table plus
15
20
  // the shared tag-conflict predicates both surfaces enforce. See
16
21
  // docs/design/architecture.md (Consumer boundary).
17
22
  export { FILTER_CONTRACT, hasTagPresence, tagFlagConflict, tagFilterFields, validateViewArgs, } from "./read/filter-contract.js";
18
23
  export { OPERATION_KINDS } from "./write/operations.js";
24
+ // The update vocabulary's one registry: consumer surfaces build their patch with
25
+ // this instead of hand-listing the fields (the #491 exhaustive-map doctrine).
26
+ export { buildUpdatePatch, CLI_UPDATE_LABELS, MCP_UPDATE_LABELS } from "./write/update-fields.js";
19
27
  export { HAZARD_IDS } from "./write/guards.js";
20
28
  export { APPLESCRIPT_MATRIX } from "./write/vectors/applescript.js";
21
29
  export { URL_SCHEME_MATRIX } from "./write/vectors/url-scheme.js";
22
30
  export { dbCarriesBenchMarker, simFenceActive } from "./write/vectors/simulator.js";
31
+ export { HELPERS_MODES, parseHelpersMode } from "./config.js";
23
32
  export { calendarDateInZone, dayBoundInstant, hostTimeZone, isValidTimeZone, } from "./model/dates.js";
24
33
  export { resolveClock, clockMeta, ClockError } from "./model/clock.js";
25
34
  export { isActiveProjectRow, isScheduledProjectRow, isSomedayProjectRow, } from "./read/area-view.js";
@@ -43,6 +52,13 @@ export { ScopeResolutionError } from "./read/scope.js";
43
52
  export { splitWhenSugar, CLI_WHEN_LABELS, MCP_WHEN_LABELS } from "./model/when-sugar.js";
44
53
  export { ThingsDbNotFoundError } from "./db/locate.js";
45
54
  export { ThingsDbOpenError } from "./db/connection.js";
55
+ // The helper pair (docs/design/agent-daemon.md §β1): lifecycle + routing
56
+ // state for the CLI `things helpers` command group and doctor.
57
+ export { deputyPlistPath, deputySigningInfo, grantReader, helpersBundleCandidates, helpersDefaultBuildPath, helpersStatus, installedHelpersVersion, installHelpers, onboardHelpers, readerPlistPath, restartHelpers, uninstallHelpers, } from "./deputy/install.js";
58
+ export { deputyInstalledBinaryPath, EXPECTED_HELPERS_VERSION, helpersInstallDir, helpersInstalledBundlePath, readerInstalledAppPath, } from "./deputy/protocol.js";
59
+ export { deputyRouting, helpersRouting, readerRouting } from "./deputy/routing.js";
60
+ export { emitHelpersNotice } from "./deputy/notice.js";
61
+ export { computeHelpersNotice, HELPERS_HINT_INTERVAL_DAYS, lastHelpersHintAt, markHelpersHintShown, } from "./deputy/notices.js";
46
62
  export { aggregateExitCode, API_VERSION, blockedCode, errorEnvelope, ExitCode, mutationWireData, okEnvelope, PKG_VERSION, verifyFailedCode, } from "./contracts.js";
47
63
  // ---------------------------------------------------------------------------
48
64
  // Consumer-surface support: everything below is exported so the CLI and MCP
@@ -76,6 +92,12 @@ export { BOUNCE_MAX_ITEMS } from "./write/reorder.js";
76
92
  // Shortcut-proxy availability: a proper library accessor (setup consumes it
77
93
  // without opening a database). See shortcutProxies in diagnose.ts.
78
94
  export { shortcutProxies } from "./diagnose.js";
95
+ // Prompt-free capability detection and the direct-path ceremony
96
+ // (docs/design/permissions-doctrine.md).
97
+ export { fdaGranted, hostApp, hostDisplayName, readAllowed, readCapability, ReadCapabilityError, resetCapabilityForTests, tccDbPath, uiAllowed, uiCapability, UiCapabilityError, UI_DIRECT_ESCAPE_ENV, writeAllowed, writeCapability, WriteCapabilityError, THINGS_BUNDLE_ID, } from "./capability.js";
98
+ export { clearSessionGrant, sessionGrantPath, sessionGrantValid, witnessSessionGrant, } from "./session-grant.js";
99
+ export { directSetup, surveySetup } from "./direct-setup.js";
100
+ export { CeremonyStopped, createWizard, withDefaultInterrupts } from "./wizard.js";
79
101
  // Dev-mode step-timeline trace (TRACE1, #487): the CLI write driver installs a
80
102
  // file sink (isDevVersion / config-forced) and the signal handler reads the
81
103
  // in-flight-write marker to emit an honest "interrupted, outcome uncertain"
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAmBzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAM9D,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA4B1E,8EAA8E;AAC9E,gEAAgE;AAChE,mDAAmD;AACnD,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAmCnC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAuBpF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC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nC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- import { type DisruptionTier, type OpenOptions } from "../index.ts";
2
+ import { type ReadCapability, type UiCapability, type WriteCapability, type DisruptionTier, type OpenOptions } from "../index.ts";
3
3
  export interface McpServerOptions {
4
4
  dbPath?: string;
5
5
  /**
@@ -21,5 +21,31 @@ export interface McpServerOptions {
21
21
  scope?: string;
22
22
  /** Test seam: forwarded to openThings (fake vectors, pinned clock, env). */
23
23
  openOptions?: OpenOptions;
24
+ /**
25
+ * Test seam: the startup capability survey (docs/design/permissions-doctrine.md,
26
+ * Article II). Real servers run the prompt-free survey once at startup; tests
27
+ * substitute a fixed verdict so a cell's outcome never depends on the
28
+ * developer's own macOS grants.
29
+ */
30
+ capability?: BakedCapability;
31
+ /** Where the one startup warning line goes. Default: stderr. */
32
+ onStartupWarning?: (line: string) => void;
33
+ }
34
+ /**
35
+ * What this server may do, decided ONCE before the first tool call
36
+ * (docs/design/permissions-doctrine.md, Article II).
37
+ *
38
+ * A daemon is exactly the wrong place to discover a missing grant: nobody is
39
+ * watching its stderr, a per-call re-survey would let capability change under
40
+ * an agent mid-conversation, and the grants a daemon holds are its LAUNCHER's,
41
+ * fixed for the process's whole life — a `things setup` run afterwards changes
42
+ * nothing until the daemon is restarted. So the verdict is baked: stated in the
43
+ * server instructions, enforced immediately on tools whose vector class is
44
+ * absent, and remediated with "kill the server, run setup, restart it".
45
+ */
46
+ export interface BakedCapability {
47
+ read: ReadCapability;
48
+ write: WriteCapability;
49
+ ui: UiCapability;
24
50
  }
25
51
  export declare function createThingsMcpServer(options?: McpServerOptions): McpServer;