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,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE per-operation PARAMETER schema registry — the structural contract every
|
|
3
|
+
* untyped entry point (batch JSONL, MCP `run_operation`/`batch`, a JavaScript
|
|
4
|
+
* caller handing over parsed JSON) is held to BEFORE anything is dispatched.
|
|
5
|
+
*
|
|
6
|
+
* Why it exists (#580): the engine used to duck-test its own params — `todo.add`
|
|
7
|
+
* asked whether `params.project` LOOKED like a container (`.uuid`/`.title`
|
|
8
|
+
* present) and, when a bare uuid STRING was supplied instead, concluded the field
|
|
9
|
+
* was ABSENT. No `list-id` compiled, no destination assertion was emitted, the
|
|
10
|
+
* to-do landed in the Inbox, verification passed against the (empty) delta, and
|
|
11
|
+
* the batch reported success. Malformed input degraded silently into a different,
|
|
12
|
+
* plausible-looking mutation. The same genus lurks anywhere a shape is inferred
|
|
13
|
+
* rather than asserted, so the fix is structural: ONE registry, checked at the
|
|
14
|
+
* two choke points (the batch's static preflight and the mutation pipeline), and
|
|
15
|
+
* duck tests downgraded to belt-and-braces throws.
|
|
16
|
+
*
|
|
17
|
+
* Doctrine (decisions.md 2026-08-17, #491 RRF1 — the exhaustive-map law): the
|
|
18
|
+
* registry is EXHAUSTIVE on both axes. `PARAM_SCHEMAS` is a
|
|
19
|
+
* `{ [K in OperationKind]: … }`, so a new operation breaks compilation until it
|
|
20
|
+
* declares a schema; each op's schema is a `{ [F in keyof Params]-?: FieldSpec }`,
|
|
21
|
+
* so a new parameter breaks compilation until its shape is consciously named.
|
|
22
|
+
* Neither axis can be satisfied by an out-of-date literal.
|
|
23
|
+
*
|
|
24
|
+
* Hand-written, zero-dependency validation in the style of
|
|
25
|
+
* [repeat-rule.ts](./repeat-rule.ts) — NO zod. zod is a consumer-surface
|
|
26
|
+
* dependency confined to `src/mcp/server.ts` (the CLI guest bundle ships neither
|
|
27
|
+
* it nor the MCP SDK; see the lazy loader in `src/index.ts`).
|
|
28
|
+
*
|
|
29
|
+
* The contract:
|
|
30
|
+
* - a REQUIRED field must be present and the right shape; absent or `null` is a
|
|
31
|
+
* structural error;
|
|
32
|
+
* - an OPTIONAL field may be absent, explicitly `null`, or the right shape —
|
|
33
|
+
* any other type is a structural error (never a silent "treat as absent");
|
|
34
|
+
* - UNKNOWN keys are refused by name (a typo is never silently dropped);
|
|
35
|
+
* - a container reference is an OBJECT (`{"uuid": …}` / `{"title": …}`) — a bare
|
|
36
|
+
* string is refused with steering copy rather than normalized. One canonical
|
|
37
|
+
* shape (ALPHA-CONTRACT: no shorthand alias machinery pre-1.0).
|
|
38
|
+
*
|
|
39
|
+
* The check is purely STRUCTURAL. It says nothing about whether a uuid exists,
|
|
40
|
+
* whether two fields contradict each other (that stays with each command's
|
|
41
|
+
* `preRead`), or whether a `"$name"` batch temp-reference is declared (that stays
|
|
42
|
+
* with the batch's own `staticRefError`) — so `$`-prefixed strings pass every
|
|
43
|
+
* plain-string field and every container `uuid`, as they must.
|
|
44
|
+
*/
|
|
45
|
+
import { type OperationKind, type OperationParamsMap } from "./operations.ts";
|
|
46
|
+
/**
|
|
47
|
+
* The shape vocabulary. `custom` carries a hand-written validator for the shapes
|
|
48
|
+
* the primitives cannot express (a discriminated bag, a structured item list, a
|
|
49
|
+
* calendar anchor — those WRAP the engine's existing validators rather than
|
|
50
|
+
* restating them). `unvalidated` is the escape hatch and requires a WRITTEN
|
|
51
|
+
* reason; there are currently none.
|
|
52
|
+
*/
|
|
53
|
+
export type FieldKind = "string" | "boolean" | "number" | "stringArray" | "enum" | "container" | "custom" | "unvalidated";
|
|
54
|
+
export interface FieldSpec {
|
|
55
|
+
kind: FieldKind;
|
|
56
|
+
/** Absent (or explicitly `null`) is accepted. */
|
|
57
|
+
optional: boolean;
|
|
58
|
+
/** Behavioral description of the accepted shape — the "expected" half of every refusal. */
|
|
59
|
+
describe: string;
|
|
60
|
+
/** enum: the accepted values. */
|
|
61
|
+
values?: readonly string[];
|
|
62
|
+
/** string: reject the empty string. */
|
|
63
|
+
nonEmpty?: boolean;
|
|
64
|
+
/** number: whole numbers only, and the inclusive bounds. */
|
|
65
|
+
integer?: boolean;
|
|
66
|
+
min?: number;
|
|
67
|
+
max?: number;
|
|
68
|
+
/** custom: returns a refusal detail, or null when the value is well-shaped. */
|
|
69
|
+
validate?: (value: unknown, path: string) => string | null;
|
|
70
|
+
/** unvalidated: why this field carries no shape check. */
|
|
71
|
+
reason?: string;
|
|
72
|
+
}
|
|
73
|
+
/** The received-type half of a refusal, in the words a caller reading JSON uses. */
|
|
74
|
+
export declare function describeType(value: unknown): string;
|
|
75
|
+
type OpSchema<K extends OperationKind> = {
|
|
76
|
+
[F in keyof OperationParamsMap[K]]-?: FieldSpec;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The registry. EXHAUSTIVE on both axes by construction: a new
|
|
80
|
+
* {@link OperationKind} breaks compilation here, and a new parameter on any
|
|
81
|
+
* operation breaks compilation in that operation's entry.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PARAM_SCHEMAS: {
|
|
84
|
+
[K in OperationKind]: OpSchema<K>;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* The STRUCTURAL parameter check for one operation. Returns the FIRST refusal
|
|
88
|
+
* detail (JSON path · expected shape · received type), or null when the bag is
|
|
89
|
+
* well-shaped. Never throws; never mutates or normalizes the params.
|
|
90
|
+
*/
|
|
91
|
+
export declare function validateOperationParams(op: OperationKind, params: unknown): string | null;
|
|
92
|
+
/** A structural parameter refusal — an input-contract error, never an app failure. */
|
|
93
|
+
export declare class ParamSchemaError extends RangeError {
|
|
94
|
+
/** The operation whose parameter bag was refused. */
|
|
95
|
+
readonly op: OperationKind;
|
|
96
|
+
constructor(op: OperationKind, detail: string);
|
|
97
|
+
}
|
|
98
|
+
/** {@link validateOperationParams}, as a throwing assertion for the pipeline. */
|
|
99
|
+
export declare function assertOperationParams(op: OperationKind, params: unknown): void;
|
|
100
|
+
/** One parameter's machine-readable summary (the `capabilities` params column). */
|
|
101
|
+
export interface ParamSummary {
|
|
102
|
+
name: string;
|
|
103
|
+
kind: FieldKind;
|
|
104
|
+
optional: boolean;
|
|
105
|
+
/** Behavioral description of the accepted shape. */
|
|
106
|
+
expects: string;
|
|
107
|
+
/** enum only: the accepted values. */
|
|
108
|
+
values?: readonly string[];
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The per-op parameter summary `things capabilities` publishes, so the promise
|
|
112
|
+
* that the catalog carries "operation kinds AND their parameter shapes" is met by
|
|
113
|
+
* data rather than by prose.
|
|
114
|
+
*/
|
|
115
|
+
export declare function paramSummary(op: OperationKind): ParamSummary[];
|
|
116
|
+
/** Runtime completeness law: every cataloged operation declares a schema. */
|
|
117
|
+
export declare function operationsMissingSchema(): OperationKind[];
|
|
118
|
+
/** Every `unvalidated` escape in the registry, with its written reason (currently none). */
|
|
119
|
+
export declare function unvalidatedFields(): {
|
|
120
|
+
op: OperationKind;
|
|
121
|
+
field: string;
|
|
122
|
+
reason: string;
|
|
123
|
+
}[];
|
|
124
|
+
export {};
|