things-api 0.15.0 → 0.17.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 (145) hide show
  1. package/README.md +4 -4
  2. package/dist/audit/schema.d.ts +8 -0
  3. package/dist/audit/schema.js.map +1 -1
  4. package/dist/cli/commands/install-skill.js +9 -2
  5. package/dist/cli/commands/install-skill.js.map +1 -1
  6. package/dist/cli/commands/repeat-flags.d.ts +14 -4
  7. package/dist/cli/commands/repeat-flags.js +113 -33
  8. package/dist/cli/commands/repeat-flags.js.map +1 -1
  9. package/dist/cli/commands/todo.js +49 -2
  10. package/dist/cli/commands/todo.js.map +1 -1
  11. package/dist/cli/commands/writes.js +241 -66
  12. package/dist/cli/commands/writes.js.map +1 -1
  13. package/dist/cli/help.js +23 -13
  14. package/dist/cli/help.js.map +1 -1
  15. package/dist/cli/interrupt.d.ts +42 -0
  16. package/dist/cli/interrupt.js +105 -0
  17. package/dist/cli/interrupt.js.map +1 -0
  18. package/dist/cli/main.js +5 -0
  19. package/dist/cli/main.js.map +1 -1
  20. package/dist/cli/read-driver.d.ts +2 -2
  21. package/dist/cli/skill.d.ts +24 -0
  22. package/dist/cli/skill.js +40 -0
  23. package/dist/cli/skill.js.map +1 -1
  24. package/dist/client.d.ts +53 -12
  25. package/dist/client.js +9 -1
  26. package/dist/client.js.map +1 -1
  27. package/dist/config.d.ts +39 -0
  28. package/dist/config.js +16 -1
  29. package/dist/config.js.map +1 -1
  30. package/dist/contracts.d.ts +9 -2
  31. package/dist/contracts.js +1 -1
  32. package/dist/contracts.js.map +1 -1
  33. package/dist/index.d.ts +5 -2
  34. package/dist/index.js +7 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/mcp/server.js +132 -31
  37. package/dist/mcp/server.js.map +1 -1
  38. package/dist/model/entities.d.ts +35 -0
  39. package/dist/model/entities.js.map +1 -1
  40. package/dist/model/occurrences.d.ts +14 -1
  41. package/dist/model/occurrences.js +20 -4
  42. package/dist/model/occurrences.js.map +1 -1
  43. package/dist/model/recurrence.d.ts +60 -9
  44. package/dist/model/recurrence.js +76 -19
  45. package/dist/model/recurrence.js.map +1 -1
  46. package/dist/paths.d.ts +8 -0
  47. package/dist/paths.js +10 -0
  48. package/dist/paths.js.map +1 -1
  49. package/dist/read/detail.js +49 -1
  50. package/dist/read/detail.js.map +1 -1
  51. package/dist/read/queries.d.ts +12 -0
  52. package/dist/read/queries.js +14 -0
  53. package/dist/read/queries.js.map +1 -1
  54. package/dist/read/shape.d.ts +25 -22
  55. package/dist/read/shape.js +81 -55
  56. package/dist/read/shape.js.map +1 -1
  57. package/dist/read/stage.d.ts +5 -5
  58. package/dist/read/stage.js +2 -2
  59. package/dist/read/views.d.ts +1 -1
  60. package/dist/read/views.js +4 -4
  61. package/dist/surface-copy.d.ts +2 -2
  62. package/dist/surface-copy.js +2 -2
  63. package/dist/sync-health.js +2 -1
  64. package/dist/sync-health.js.map +1 -1
  65. package/dist/trace/tracer.d.ts +87 -0
  66. package/dist/trace/tracer.js +167 -0
  67. package/dist/trace/tracer.js.map +1 -0
  68. package/dist/write/batch.d.ts +28 -3
  69. package/dist/write/batch.js +162 -46
  70. package/dist/write/batch.js.map +1 -1
  71. package/dist/write/clear-reminder.js +24 -21
  72. package/dist/write/clear-reminder.js.map +1 -1
  73. package/dist/write/clone.d.ts +4 -0
  74. package/dist/write/clone.js +531 -0
  75. package/dist/write/clone.js.map +1 -0
  76. package/dist/write/commands.js +140 -49
  77. package/dist/write/commands.js.map +1 -1
  78. package/dist/write/completion-context.d.ts +57 -0
  79. package/dist/write/completion-context.js +49 -0
  80. package/dist/write/completion-context.js.map +1 -0
  81. package/dist/write/failure-hints.d.ts +10 -1
  82. package/dist/write/failure-hints.js +8 -0
  83. package/dist/write/failure-hints.js.map +1 -1
  84. package/dist/write/guards.d.ts +1 -1
  85. package/dist/write/guards.js +43 -5
  86. package/dist/write/guards.js.map +1 -1
  87. package/dist/write/make-repeating-project.d.ts +2 -3
  88. package/dist/write/make-repeating-project.js +2 -73
  89. package/dist/write/make-repeating-project.js.map +1 -1
  90. package/dist/write/move.js +8 -1
  91. package/dist/write/move.js.map +1 -1
  92. package/dist/write/operations.d.ts +140 -9
  93. package/dist/write/operations.js +4 -1
  94. package/dist/write/operations.js.map +1 -1
  95. package/dist/write/pipeline.d.ts +77 -0
  96. package/dist/write/pipeline.js +298 -20
  97. package/dist/write/pipeline.js.map +1 -1
  98. package/dist/write/pre-state.d.ts +1 -1
  99. package/dist/write/pre-state.js +9 -3
  100. package/dist/write/pre-state.js.map +1 -1
  101. package/dist/write/preserve-modified.d.ts +55 -0
  102. package/dist/write/preserve-modified.js +106 -0
  103. package/dist/write/preserve-modified.js.map +1 -0
  104. package/dist/write/promote-clone.d.ts +32 -0
  105. package/dist/write/promote-clone.js +867 -0
  106. package/dist/write/promote-clone.js.map +1 -0
  107. package/dist/write/repeat-anchor.d.ts +110 -0
  108. package/dist/write/repeat-anchor.js +238 -0
  109. package/dist/write/repeat-anchor.js.map +1 -0
  110. package/dist/write/repeat-asserts.d.ts +28 -0
  111. package/dist/write/repeat-asserts.js +169 -0
  112. package/dist/write/repeat-asserts.js.map +1 -0
  113. package/dist/write/repeat-rule.js +27 -12
  114. package/dist/write/repeat-rule.js.map +1 -1
  115. package/dist/write/resolution-timestamps.js +22 -0
  116. package/dist/write/resolution-timestamps.js.map +1 -1
  117. package/dist/write/reversibility.js +27 -14
  118. package/dist/write/reversibility.js.map +1 -1
  119. package/dist/write/undo.d.ts +11 -1
  120. package/dist/write/undo.js +126 -10
  121. package/dist/write/undo.js.map +1 -1
  122. package/dist/write/vectors/session-reachability.d.ts +78 -0
  123. package/dist/write/vectors/session-reachability.js +103 -0
  124. package/dist/write/vectors/session-reachability.js.map +1 -0
  125. package/dist/write/vectors/simulator.js +100 -30
  126. package/dist/write/vectors/simulator.js.map +1 -1
  127. package/dist/write/vectors/types.d.ts +117 -10
  128. package/dist/write/vectors/ui-certification.d.ts +1 -1
  129. package/dist/write/vectors/ui-certification.js +10 -3
  130. package/dist/write/vectors/ui-certification.js.map +1 -1
  131. package/dist/write/vectors/ui-recipes.d.ts +8 -0
  132. package/dist/write/vectors/ui-recipes.js +120 -22
  133. package/dist/write/vectors/ui-recipes.js.map +1 -1
  134. package/dist/write/vectors/ui.d.ts +79 -13
  135. package/dist/write/vectors/ui.js +415 -59
  136. package/dist/write/vectors/ui.js.map +1 -1
  137. package/dist/write/verify/delta.d.ts +12 -14
  138. package/dist/write/verify/delta.js +35 -34
  139. package/dist/write/verify/delta.js.map +1 -1
  140. package/package.json +1 -1
  141. package/schema/envelope.schema.json +22 -0
  142. package/skills/things-cli/SKILL.md +7 -3
  143. package/skills/things-cli/references/banner.md +1 -1
  144. package/skills/things-cli/references/contracts.md +17 -9
  145. package/skills/things-cli/references/data-model.md +2 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A typed TypeScript library + CLI (`things`) for programmatic interaction with [Things 3](https://culturedcode.com/things/) by Cultured Code.
4
4
 
5
- **Status: read + write + MCP layers live and published to npm (v0.15.0 — see [CHANGELOG.md](CHANGELOG.md)).** Reads go straight to the local SQLite database (UI-exact Today ordering, sidebar-grouped Anytime/Someday with container-status cascade, decoded repeat rules, occurrence projections); writes run a verified pipeline over four write vectors — two lab-validated headless surfaces (the URL scheme + AppleScript) and two opt-in surfaces (Apple Shortcuts and an Accessibility-driven GUI vector) — with hazard guards, disruption-tier policy, a JSONL audit trail, batch mode, audit-replay undo (transactional across compound operations), full project lifecycle (complete/cancel/reopen/restore), heading rename/archive/unarchive with children policies, container detach, granular stateful checklists, tag hierarchy management incl. un-nesting, completion/creation backdating, Logbook imports, tiered fuzzy name resolution (uuid prefixes, `things:///show?id=` share links), and ordering across eight scopes (incl. a project's headings and the top-level sidebar projects). The Apple Shortcuts surface is wired for the two headless capabilities nothing else can do: creating a heading in an existing project (`things heading add`) and clearing a reminder from a date-scheduled item (`things todo clear-reminder`). Both run through bundled proxy shortcuts (`things setup shortcuts`) and are gated on their presence. The fourth vector — the Accessibility-driven GUI vector — is off by default and drives the local Things app to reach transforms that exist on no scriptable surface (repeat-rule editing on existing to-dos and projects, convert-to-project, sidebar area reorder); see [Accessibility GUI vector](#accessibility-gui-vector-optional-off-by-default) below. Single-item permanent delete stays interactive-only (its macOS consent has no always-allow) and is out of the headless pipeline. See [docs/design/](docs/design/) for the architecture and VM-lab design, [docs/lab/](docs/lab/harness.md) for the probe harness and campaign results the write layer is grounded in, and [docs/atlas/](docs/atlas/schema-v26.md) for the database↔UI map.
5
+ **Status: read + write + MCP layers live and published to npm (v0.17.0 — see [CHANGELOG.md](CHANGELOG.md)).** Reads go straight to the local SQLite database (UI-exact Today ordering, sidebar-grouped Anytime/Someday with container-status cascade, decoded repeat rules, occurrence projections); writes run a verified pipeline over four write vectors — two lab-validated headless surfaces (the URL scheme + AppleScript) and two opt-in surfaces (Apple Shortcuts and an Accessibility-driven GUI vector) — with hazard guards, disruption-tier policy, a JSONL audit trail, batch mode, audit-replay undo (transactional across compound operations), full project lifecycle (complete/cancel/reopen/restore), heading rename/archive/unarchive with children policies, container detach, granular stateful checklists, tag hierarchy management incl. un-nesting, completion/creation backdating, Logbook imports, tiered fuzzy name resolution (uuid prefixes, `things:///show?id=` share links), and kind-neutral in-place reordering within any container or view (one `things reorder <refs…> [--start|--end|--before|--after] --in <target>` verb — Today/Evening, a project, an area, a heading's children, someday, inbox — plus `project move-heading` for the headings themselves and `area reorder` for the sidebar). The Apple Shortcuts surface is wired for the two headless capabilities nothing else can do: creating a heading in an existing project (`things project add-heading`) and clearing a reminder from a date-scheduled item (`things todo clear-reminder`). Both run through bundled proxy shortcuts (`things setup shortcuts`) and are gated on their presence. The fourth vector — the Accessibility-driven GUI vector — is off by default and drives the local Things app to reach transforms that exist on no scriptable surface (repeat-rule editing on existing to-dos and projects, convert-to-project, sidebar area reorder); see [Accessibility GUI vector](#accessibility-gui-vector-optional-off-by-default) below. Single-item permanent delete stays interactive-only (its macOS consent has no always-allow) and is out of the headless pipeline. See [docs/design/](docs/design/) for the architecture and VM-lab design, [docs/lab/](docs/lab/harness.md) for the probe harness and campaign results the write layer is grounded in, and [docs/atlas/](docs/atlas/schema-v26.md) for the database↔UI map.
6
6
 
7
7
  ```sh
8
8
  things today --json # read: your Today list, Evening split, UI order
@@ -36,7 +36,7 @@ things setup shortcuts # opens an install sheet per missing shortcut — click
36
36
 
37
37
  On each shortcut's first run macOS asks for permission — choose **Always Allow** so later runs are unattended (the two delete shortcuts re-ask on every run by design; Apple offers no always-allow for deletion). `things setup shortcuts --check` and `things doctor` report installation state.
38
38
 
39
- Once installed, these Shortcuts-only operations become available as ordinary commands: `things heading add <project> <title>` (create a heading in an existing project) and `things todo clear-reminder <uuid>` (clear a date-scheduled to-do's reminder while keeping its date). Both are also exposed over MCP (the `heading` tool's create action, and `clear_reminder`). If a required shortcut is missing, the command is blocked up front with a pointer back to `things setup shortcuts` — nothing is dispatched.
39
+ Once installed, these Shortcuts-only operations become available as ordinary commands: `things project add-heading <project> <title>` (create a heading in an existing project) and `things todo clear-reminder <uuid>` (clear a date-scheduled to-do's reminder while keeping its date). Both are also exposed over MCP (the `heading` tool's add-heading action, and `clear_reminder`). If a required shortcut is missing, the command is blocked up front with a pointer back to `things setup shortcuts` — nothing is dispatched.
40
40
 
41
41
  ### Accessibility GUI vector (optional, off by default)
42
42
 
@@ -73,7 +73,7 @@ Edits under `src/` take effect immediately. The bin launcher ([bin/things.js](bi
73
73
  The CLI is designed to be driven by coding agents with no out-of-band knowledge. The contract:
74
74
 
75
75
  1. **Discovery**: `things --help` (a grouped one-line-per-command index; orientation detail lives behind `things help <topic>` — `agent`, `filters`, `ids`, `output`, `writes`), per-command `things <command> --help` (behavior, side effects, and the exact acknowledgement flag names a write needs — regression-tested as API; by design it does **not** carry vector/tier/hazard vocabulary, which is banned from help text by [docs/design/surface-copy.md](docs/design/surface-copy.md) — that classification lives in `capabilities`), and `things capabilities [--op <op>] --json` (the lab-validated operation × vector support matrix with disruption tiers, hazards, per-op certification status, and probe-evidence ids). Command invocation follows one grammar (`things <view>` · `things <type> <verb> <subject>` · loose `things <verb> <subject>` · bare `things <subject>`) with a single precedence chain — registered command/alias → view keyword → reference resolution — specified in [docs/design/cli-grammar.md](docs/design/cli-grammar.md).
76
- 2. **Structured output**: every command takes `--json` → versioned envelope `{ apiVersion, ok, kind, data|error, meta }` on stdout; human chatter goes to stderr only. List views are **bounded by default**: the flat/chronological views (`inbox`, `today`, `upcoming`, `logbook`, `trash`, `search`, `changes`) return at most 50 items — raise with `--limit <n>` or lift with `--all` — and carry exact truncation counts in `meta.truncation { shown, total, limit, truncated }` (the split `today` view also breaks the counts down per render section under `sections`). The grouped catalogues (`anytime`, `someday`) always show every area and project row and cap per block instead (no `--limit`): `--area-limit <n>` (default 30) per area block on both, `--project-limit <n>` (default 3) per project block on anytime, `--show-active-project-items [n]` for someday's trailing active-projects section — reporting the same `meta.truncation` shape with a per-block `blocks[]` breakdown (aggregate `shown`/`total`, `limit: null`), where each block is identity-carrying (`kind`, `ref`, `title`, `shown`, `total`) and project blocks nest inside their area block under `children`. A read whose database schema no longer matches this build's validated fingerprint carries a non-blocking `meta.warnings` note (the read still returns best-effort; the same drift hard-blocks writes). Same defaults and metadata apply over MCP.
76
+ 2. **Structured output**: every command takes `--json` → versioned envelope `{ apiVersion, ok, kind, data|error, meta }` on stdout; human chatter goes to stderr only. List views are **bounded by default**: the flat/chronological views (`inbox`, `today`, `upcoming`, `logbook`, `trash`, `search`, `changes`) return at most 50 items — raise with `--limit <n>` or lift with `--all` — and carry exact truncation counts in `meta.truncation { shown, total, limit, truncated }` (the split `today` view returns `data.children = { today, evening }` two keyed buckets, each carrying an inline `total` when that bucket was capped). The grouped catalogues (`anytime`, `someday`) always show every area and project row and cap per block instead (no `--limit`): `--area-limit <n>` (default 30) per area block on both, `--project-limit <n>` (default 3) per project block on anytime, `--show-active-project-items [n]` for someday's trailing active-projects section — and each capped block carries its own inline `total` on the bucket record it describes (present iff its rows were truncated), so a hidden count maps directly to the bucket it was hidden from; the whole-view `shown`/`total`/`limit`/`truncated` rollup still rides `meta.truncation` (the separate per-block `blocks[]` sidecar has been retired). A read whose database schema no longer matches this build's validated fingerprint carries a non-blocking `meta.warnings` note (the read still returns best-effort; the same drift hard-blocks writes). Same defaults and metadata apply over MCP.
77
77
  3. **Stable exit codes**: `0` ok · `2` usage · `3` verify-failed (mutation executed, expected delta never appeared) · `4` blocked (hazard guard or disruption policy; error carries `remediation`) · `5` drift-blocked · `6` unsupported (op has no supported vector — `things batch` also aggregates to 6 when its only failures are unsupported ops) · `7` environment.
78
78
  4. **Plan before executing**: every write supports `--dry-run` — compiled invocation (token-redacted), chosen vector, tier, hazards checked, expected delta. Nothing runs, nothing is audited.
79
79
  5. **No prompts, ever**: risky semantics are explicit flags — `--children require-resolved|auto-complete` (project completion cascades), `--acknowledge-checklist-reset` (checklist replacement destroys per-item state), `--acknowledge-project-reopen` (open child reopens a resolved project), `--dangerously-permanent` (area/tag delete and empty-trash skip the Trash), `--dangerously-drive-gui` (each Accessibility GUI-vector call).
@@ -141,6 +141,6 @@ The catalog is consolidated around a few verb-parameterized tools (a discriminat
141
141
  - **Create**: `add_area`, `add_tag`.
142
142
  - **Headings & reminders** (Shortcuts-backed where headless-impossible): `heading` (`action` create / rename / archive / unarchive / convert_to_project), `clear_reminder`.
143
143
  - **Recurrence via the Accessibility GUI ("ui") vector** (two-key gated — `ui-enabled` config + `dangerously_drive_gui` per call): `repeat` (`scope` todo / project; `action` start / reschedule / pause / resume / create). The `heading` convert_to_project action and the `reorder` areas scope ride the same gated GUI surface.
144
- - **Generic & discovery**: `run_operation` (the full 53-op catalog), `batch`, `reorder` (item ordering across scopes, plus `scope=areas` for the sidebar area order), `undo`, `capabilities`, `doctor`.
144
+ - **Generic & discovery**: `run_operation` (the full 56-op catalog), `batch`, `reorder` (item ordering across scopes, plus `scope=areas` for the sidebar area order), `undo`, `capabilities`, `doctor`.
145
145
 
146
146
  Every write tool takes `dry_run`; the GUI-driven variants additionally require `dangerously_drive_gui`; tools carry read-only/destructive annotations; hazard blocks come back as structured tool errors carrying the same remediation text the CLI prints. Tool descriptions follow the consumer-voice contract in [docs/design/surface-copy.md](docs/design/surface-copy.md).
@@ -33,6 +33,14 @@ export interface AuditRecord {
33
33
  * of re-created). Absent on records with no client idempotency id.
34
34
  */
35
35
  opId?: string;
36
+ /**
37
+ * `--preserve-modified` capture (ADDITIVE): the pre-write `userModificationDate`
38
+ * of each captured target row (uuid → epoch seconds, or null for a row the op
39
+ * created), recorded on the `ok` record only when the flag was active. Cheap
40
+ * provenance that enables a future SYMMETRIC undo (restore the umd the mutation
41
+ * bumped) without a separate read. Absent on writes made without the flag.
42
+ */
43
+ preModDates?: Record<string, number | null>;
36
44
  /** Normalized requested delta (params as given, post-normalization). */
37
45
  requested: Record<string, unknown>;
38
46
  /** Asserted-field subset of the pre-state (null when target didn't exist). */
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/audit/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAyDzC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CACvB,MAA0E;IAE1E,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACzD,yEAAyE;IACzE,wEAAwE;IACxE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAC9B,MAAM,CAAC,EAAE;QACT,MAAM,CAAC,EAAE;QACT,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,IAAI;QACX,MAAM,CAAC,IAAI,IAAI,EAAE;KAClB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChF,OAAO,KAAK,MAAM,EAAE,CAAC;AACvB,CAAC"}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/audit/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAiEzC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CACvB,MAA0E;IAE1E,IAAI,MAAM,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACzD,yEAAyE;IACzE,wEAAwE;IACxE,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC;QAC9B,MAAM,CAAC,EAAE;QACT,MAAM,CAAC,EAAE;QACT,MAAM,CAAC,KAAK;QACZ,MAAM,CAAC,IAAI;QACX,MAAM,CAAC,IAAI,IAAI,EAAE;KAClB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChF,OAAO,KAAK,MAAM,EAAE,CAAC;AACvB,CAAC"}
@@ -23,7 +23,7 @@ import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, write
23
23
  import { tmpdir } from "node:os";
24
24
  import { dirname, join } from "node:path";
25
25
  import { ExitCode, okEnvelope, simFenceActive } from "../../index.js";
26
- import { bundledSkillDir, compareSemver, installedSkillVersion, isLegacyDevStamp, resolveHome, SKILL_NAME, skillLocations, stampSkillVersion, } from "../skill.js";
26
+ import { appendDevBugReportingSection, bundledSkillDir, compareSemver, installedSkillVersion, isDevVersion, isLegacyDevStamp, resolveHome, SKILL_NAME, skillLocations, stampSkillVersion, } from "../skill.js";
27
27
  import { CLI_VERSION } from "../version.js";
28
28
  /**
29
29
  * Materialize a stamped copy of the bundled skill in a temp dir and run `fn`
@@ -42,7 +42,14 @@ export function withStampedSkillDir(srcDir, version, fn) {
42
42
  const staged = join(tmp, SKILL_NAME);
43
43
  cpSync(srcDir, staged, { recursive: true });
44
44
  const mdPath = join(staged, "SKILL.md");
45
- writeFileSync(mdPath, stampSkillVersion(readFileSync(mdPath, "utf8"), version));
45
+ let md = stampSkillVersion(readFileSync(mdPath, "utf8"), version);
46
+ // A dev checkout (`-dev` version) gets the "Filing bugs and feature requests"
47
+ // CTA appended; a published install (stamped release version) never does.
48
+ // Done at the source copy so every location the installer materializes —
49
+ // canonical, ~/.claude, and any skills-CLI-detected agent dir — inherits it.
50
+ if (isDevVersion(version))
51
+ md = appendDevBugReportingSection(md);
52
+ writeFileSync(mdPath, md);
46
53
  return fn(staged);
47
54
  }
48
55
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"install-skill.js","sourceRoot":"","sources":["../../../src/cli/commands/install-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAqB,MAAM,gBAAgB,CAAC;AACzF,OAAO,EACL,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,cAAc,EACd,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAqC5C;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;YACnB,aAAa,EAAE,WAAW;YAC1B,SAAS,EAAE,cAAc,EAAE;YAC3B,YAAY,EAAE,mBAAmB;YACjC,QAAQ,EAAE,eAAe;SAC1B,CAAC,CAAC;QACH,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACvB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACxE,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC9B,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -6,15 +6,25 @@
6
6
  * command with none of them behaves exactly as before.
7
7
  */
8
8
  import type { Command } from "commander";
9
- import type { RepeatFrequency, RepeatRuleParams } from "../../index.ts";
9
+ import type { AddRepeatingRuleFields, RepeatFrequency, RepeatRuleParams } from "../../index.ts";
10
10
  /** The extended fields (everything a rule carries beyond uuid/frequency/interval). */
11
11
  export type RepeatRuleFlagFields = Omit<RepeatRuleParams, "uuid" | "frequency" | "interval">;
12
12
  /** Attach the full-vocabulary options to a repeat command. */
13
13
  export declare function addRepeatRuleFlags(cmd: Command): Command;
14
+ /**
15
+ * The CALENDAR-ANCHOR subset of the rule flags — for the add-repeating
16
+ * composites, whose base add already owns `--deadline <date>` / `--reminder`
17
+ * (the item's own), so the rule-level `--deadline` / `--reminder` /
18
+ * `--start-days-earlier` (which would collide) are intentionally absent. A
19
+ * deadlined repeat is set with a follow-up `reschedule-repeat`.
20
+ */
21
+ export declare function addRepeatCalendarFlags(cmd: Command): Command;
22
+ /** Map the calendar-anchor rule flags (add-repeating), excluding the base-add-owned fields. */
23
+ export declare function addRepeatingRuleFieldsFromOpts(opts: Record<string, unknown>, frequency: RepeatFrequency, interval: number): AddRepeatingRuleFields;
14
24
  /**
15
25
  * Build the extended rule fields from CLI options (present keys only —
16
- * exactOptionalPropertyTypes). Combination validity is enforced downstream
17
- * (the same refusals the library raises), so a wrong-frequency flag surfaces a
18
- * clear error rather than being silently applied.
26
+ * exactOptionalPropertyTypes). A wrong-frequency anchor flag is REFUSED here
27
+ * (UIC6-l), never silently dropped; other combination validity (e.g. weekdays on
28
+ * a non-weekly rule) is enforced downstream by assertRepeatRule.
19
29
  */
20
30
  export declare function repeatRuleFlagsFromOpts(opts: Record<string, unknown>, frequency: RepeatFrequency): RepeatRuleFlagFields;
@@ -9,10 +9,35 @@ export function addRepeatRuleFlags(cmd) {
9
9
  .option("--yearly-month <n>", "yearly only: the month (1–12)")
10
10
  .option("--ends-after <n>", "stop after N occurrences (1–999)")
11
11
  .option("--ends-on <date>", "YYYY-MM-DD — stop after this date")
12
+ .option("--when <date>", "YYYY-MM-DD — the first occurrence (drives the Repeat dialog's Next field); " +
13
+ "make-repeating defaults to the item's scheduled date")
12
14
  .option("--reminder <time>", "HH:mm — a reminder time on each occurrence")
13
15
  .option("--deadline", "give each occurrence a deadline")
14
16
  .option("--start-days-earlier <n>", "with --deadline: start each occurrence N days before its deadline");
15
17
  }
18
+ /**
19
+ * The CALENDAR-ANCHOR subset of the rule flags — for the add-repeating
20
+ * composites, whose base add already owns `--deadline <date>` / `--reminder`
21
+ * (the item's own), so the rule-level `--deadline` / `--reminder` /
22
+ * `--start-days-earlier` (which would collide) are intentionally absent. A
23
+ * deadlined repeat is set with a follow-up `reschedule-repeat`.
24
+ */
25
+ export function addRepeatCalendarFlags(cmd) {
26
+ return cmd
27
+ .option("--after-completion", "repeat N units AFTER each occurrence is completed (not on a fixed schedule)")
28
+ .option("--weekdays <days>", "weekly only: comma-separated weekdays, e.g. monday,wednesday,friday")
29
+ .option("--on-day <day>", "monthly/yearly only: a day of the month (1–31, or 'last')")
30
+ .option("--on-weekday <weekday>", "monthly/yearly only: a weekday for an nth-weekday rule (with --on-ordinal)")
31
+ .option("--on-ordinal <n>", "monthly/yearly only: which weekday (1–5, or 'last') with --on-weekday")
32
+ .option("--yearly-month <n>", "yearly only: the month (1–12)")
33
+ .option("--ends-after <n>", "stop after N occurrences (1–999)")
34
+ .option("--ends-on <date>", "YYYY-MM-DD — stop after this date");
35
+ }
36
+ /** Map the calendar-anchor rule flags (add-repeating), excluding the base-add-owned fields. */
37
+ export function addRepeatingRuleFieldsFromOpts(opts, frequency, interval) {
38
+ const { reminder: _r, deadline: _d, startDaysEarlier: _s, ...rest } = repeatRuleFlagsFromOpts(opts, frequency);
39
+ return { frequency, interval, ...rest };
40
+ }
16
41
  // The raw CLI strings are cast to the vocabulary types WITHOUT validation here —
17
42
  // assertRepeatRule downstream refuses a bad day/ordinal/weekday with a clear
18
43
  // message, so the CLI never has to duplicate the domain checks.
@@ -32,45 +57,100 @@ function dayAnchor(opts) {
32
57
  return undefined;
33
58
  }
34
59
  /**
35
- * Build the extended rule fields from CLI options (present keys only
36
- * exactOptionalPropertyTypes). Combination validity is enforced downstream
37
- * (the same refusals the library raises), so a wrong-frequency flag surfaces a
38
- * clear error rather than being silently applied.
60
+ * The CALENDAR-ANCHOR flags that apply only to a SUBSET of frequencies, and the
61
+ * frequencies that consume each. A present anchor flag on any other frequency is
62
+ * a hard error never a silent drop (UIC6-l). Exhaustive over the anchor flag
63
+ * set; a new anchor flag must earn a row here (and the mapper below consumes it).
64
+ * `weekdays` is intentionally ABSENT: it is mapped unconditionally and refused
65
+ * downstream by assertRepeatRule ("weekdays apply only to a weekly rule"), the
66
+ * mapped-contradiction path — this table is only for the SILENTLY-dropped anchors.
39
67
  */
40
- export function repeatRuleFlagsFromOpts(opts, frequency) {
41
- const fields = {};
42
- if (opts["afterCompletion"] === true)
43
- fields.afterCompletion = true;
44
- if (typeof opts["weekdays"] === "string") {
45
- fields.weekdays = opts["weekdays"]
68
+ const ANCHOR_FLAG_FREQUENCIES = {
69
+ onDay: ["monthly", "yearly"],
70
+ onWeekday: ["monthly", "yearly"],
71
+ onOrdinal: ["monthly", "yearly"],
72
+ yearlyMonth: ["yearly"],
73
+ };
74
+ /** The user-facing flag spelling for a camelCase option key (error messages). */
75
+ const ANCHOR_FLAG_SPELLING = {
76
+ onDay: "--on-day",
77
+ onWeekday: "--on-weekday",
78
+ onOrdinal: "--on-ordinal",
79
+ yearlyMonth: "--yearly-month",
80
+ };
81
+ /**
82
+ * Refuse a calendar-anchor flag supplied on a frequency that does not consume it
83
+ * (UIC6-l): `--frequency weekly --on-day 15` errors instead of silently running a
84
+ * plain weekly rule. Behavioral message — names the flag + the frequency it
85
+ * belongs to, never a mechanism.
86
+ */
87
+ function assertAnchorFlagsMatchFrequency(opts, frequency) {
88
+ for (const [key, allowed] of Object.entries(ANCHOR_FLAG_FREQUENCIES)) {
89
+ if (opts[key] === undefined)
90
+ continue;
91
+ if (!allowed.includes(frequency)) {
92
+ const flag = ANCHOR_FLAG_SPELLING[key] ?? key;
93
+ throw new RangeError(`${flag} applies only to a ${allowed.join(" or ")} rule — this rule is ${frequency}`);
94
+ }
95
+ }
96
+ }
97
+ /**
98
+ * EXHAUSTIVE over every field of {@link RepeatRuleFlagFields}: each rule param is
99
+ * derived from the CLI options by exactly one entry, so a new param added to
100
+ * RepeatRuleParams breaks compilation here until it earns a flag mapping. This is
101
+ * what makes an accepted-but-dropped flag impossible for this vocabulary (the
102
+ * UIC6-l class) — the wrong-frequency guard above catches the inverse (a flag
103
+ * with no consuming frequency). Each entry returns the mapped value or
104
+ * `undefined` (absent — exactOptionalPropertyTypes).
105
+ */
106
+ const FLAG_MAP = {
107
+ afterCompletion: (opts) => (opts["afterCompletion"] === true ? true : undefined),
108
+ weekdays: (opts) => typeof opts["weekdays"] === "string"
109
+ ? opts["weekdays"]
46
110
  .split(",")
47
111
  .map((d) => d.trim().toLowerCase())
48
- .filter((d) => d.length > 0);
49
- }
50
- const anchor = dayAnchor(opts);
51
- if (frequency === "monthly" && anchor !== undefined) {
52
- fields.monthly = anchor;
53
- }
54
- if (frequency === "yearly") {
112
+ .filter((d) => d.length > 0)
113
+ : undefined,
114
+ monthly: (_opts, frequency, anchor) => frequency === "monthly" && anchor !== undefined ? anchor : undefined,
115
+ yearly: (opts, frequency, anchor) => {
116
+ if (frequency !== "yearly")
117
+ return undefined;
55
118
  const month = opts["yearlyMonth"];
56
- if (month !== undefined || anchor !== undefined) {
57
- const base = { month: Number(month) };
58
- fields.yearly = (anchor === undefined ? base : { ...base, ...anchor });
119
+ if (month === undefined && anchor === undefined)
120
+ return undefined;
121
+ const base = { month: Number(month) };
122
+ return (anchor === undefined ? base : { ...base, ...anchor });
123
+ },
124
+ ends: (opts) => {
125
+ if (opts["endsAfter"] !== undefined)
126
+ return { kind: "after", count: Number(opts["endsAfter"]) };
127
+ if (typeof opts["endsOn"] === "string")
128
+ return { kind: "on-date", date: opts["endsOn"] };
129
+ return undefined;
130
+ },
131
+ reminder: (opts) => (typeof opts["reminder"] === "string" ? opts["reminder"] : undefined),
132
+ next: (opts) => (typeof opts["when"] === "string" ? opts["when"] : undefined),
133
+ deadline: (opts) => (opts["deadline"] === true ? true : undefined),
134
+ startDaysEarlier: (opts) => opts["startDaysEarlier"] !== undefined ? Number(opts["startDaysEarlier"]) : undefined,
135
+ };
136
+ /**
137
+ * Build the extended rule fields from CLI options (present keys only —
138
+ * exactOptionalPropertyTypes). A wrong-frequency anchor flag is REFUSED here
139
+ * (UIC6-l), never silently dropped; other combination validity (e.g. weekdays on
140
+ * a non-weekly rule) is enforced downstream by assertRepeatRule.
141
+ */
142
+ export function repeatRuleFlagsFromOpts(opts, frequency) {
143
+ assertAnchorFlagsMatchFrequency(opts, frequency);
144
+ const anchor = dayAnchor(opts);
145
+ const fields = {};
146
+ for (const key of Object.keys(FLAG_MAP)) {
147
+ const value = FLAG_MAP[key](opts, frequency, anchor);
148
+ if (value !== undefined) {
149
+ // The map's per-key return type is exactly RepeatRuleFlagFields[K]; the
150
+ // index write is safe but TS cannot narrow K across the loop.
151
+ fields[key] = value;
59
152
  }
60
153
  }
61
- if (opts["endsAfter"] !== undefined) {
62
- fields.ends = { kind: "after", count: Number(opts["endsAfter"]) };
63
- }
64
- else if (typeof opts["endsOn"] === "string") {
65
- fields.ends = { kind: "on-date", date: opts["endsOn"] };
66
- }
67
- if (typeof opts["reminder"] === "string")
68
- fields.reminder = opts["reminder"];
69
- if (opts["deadline"] === true)
70
- fields.deadline = true;
71
- if (opts["startDaysEarlier"] !== undefined) {
72
- fields.startDaysEarlier = Number(opts["startDaysEarlier"]);
73
- }
74
154
  return fields;
75
155
  }
76
156
  //# sourceMappingURL=repeat-flags.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repeat-flags.js","sourceRoot":"","sources":["../../../src/cli/commands/repeat-flags.ts"],"names":[],"mappings":"AAqBA,8DAA8D;AAC9D,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,OAAO,GAAG;SACP,MAAM,CACL,oBAAoB,EACpB,6EAA6E,CAC9E;SACA,MAAM,CACL,mBAAmB,EACnB,qEAAqE,CACtE;SACA,MAAM,CAAC,gBAAgB,EAAE,2DAA2D,CAAC;SACrF,MAAM,CACL,wBAAwB,EACxB,4EAA4E,CAC7E;SACA,MAAM,CACL,kBAAkB,EAClB,uEAAuE,CACxE;SACA,MAAM,CAAC,oBAAoB,EAAE,+BAA+B,CAAC;SAC7D,MAAM,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;SAC9D,MAAM,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;SAC/D,MAAM,CAAC,mBAAmB,EAAE,4CAA4C,CAAC;SACzE,MAAM,CAAC,YAAY,EAAE,iCAAiC,CAAC;SACvD,MAAM,CACL,0BAA0B,EAC1B,mEAAmE,CACpE,CAAC;AACN,CAAC;AAED,iFAAiF;AACjF,6EAA6E;AAC7E,gEAAgE;AAChE,SAAS,SAAS,CAAC,IAA6B;IAC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,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"repeat-flags.js","sourceRoot":"","sources":["../../../src/cli/commands/repeat-flags.ts"],"names":[],"mappings":"AAsBA,8DAA8D;AAC9D,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,OAAO,GAAG;SACP,MAAM,CACL,oBAAoB,EACpB,6EAA6E,CAC9E;SACA,MAAM,CACL,mBAAmB,EACnB,qEAAqE,CACtE;SACA,MAAM,CAAC,gBAAgB,EAAE,2DAA2D,CAAC;SACrF,MAAM,CACL,wBAAwB,EACxB,4EAA4E,CAC7E;SACA,MAAM,CACL,kBAAkB,EAClB,uEAAuE,CACxE;SACA,MAAM,CAAC,oBAAoB,EAAE,+BAA+B,CAAC;SAC7D,MAAM,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;SAC9D,MAAM,CAAC,kBAAkB,EAAE,mCAAmC,CAAC;SAC/D,MAAM,CACL,eAAe,EACf,6EAA6E;QAC3E,sDAAsD,CACzD;SACA,MAAM,CAAC,mBAAmB,EAAE,4CAA4C,CAAC;SACzE,MAAM,CAAC,YAAY,EAAE,iCAAiC,CAAC;SACvD,MAAM,CACL,0BAA0B,EAC1B,mEAAmE,CACpE,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,OAAO,GAAG;SACP,MAAM,CACL,oBAAoB,EACpB,6EAA6E,CAC9E;SACA,MAAM,CACL,mBAAmB,EACnB,qEAAqE,CACtE;SACA,MAAM,CAAC,gBAAgB,EAAE,2DAA2D,CAAC;SACrF,MAAM,CACL,wBAAwB,EACxB,4EAA4E,CAC7E;SACA,MAAM,CACL,kBAAkB,EAClB,uEAAuE,CACxE;SACA,MAAM,CAAC,oBAAoB,EAAE,+BAA+B,CAAC;SAC7D,MAAM,CAAC,kBAAkB,EAAE,kCAAkC,CA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
8
  // The opened resource shows its tags green (GUI: list pills are gray).
9
9
  const tagList = (tags) => green(`#${tags.map((t) => t.title).join(" #")}`);
10
+ /** The unit noun the after-completion caption phrases (singular; pluralized by the caller). */
11
+ const REPEAT_UNIT_NOUN = {
12
+ daily: "day",
13
+ weekly: "week",
14
+ monthly: "month",
15
+ yearly: "year",
16
+ };
17
+ /**
18
+ * The GUI's lower-corner repeat caption for a repeating INSTANCE, from its
19
+ * template's joined context (src/read/detail.ts `repeats`): FIXED mode reads
20
+ * `on <date>` (the "Repeats on Aug 19" projection); after-completion reads
21
+ * `<N> <unit>(s) after completion` (the "Repeats 1 day after completion" form —
22
+ * N/unit are the rule's own interval + frequency, singular/plural correct).
23
+ * Returns null when the context carries no renderable caption (no decodable rule,
24
+ * or a fixed rule with no projected date). The `paused` flag is surfaced
25
+ * SEPARATELY so the caller can fold it into the merged `repeats:` line with the
26
+ * instance-of handle. See {@link renderDetail}.
27
+ */
28
+ function repeatContextValue(ctx, todayIso) {
29
+ const rule = ctx.rule;
30
+ if (rule === undefined)
31
+ return null;
32
+ if (rule.type === "fixed") {
33
+ return ctx.next != null ? `on ${shortDate(ctx.next, todayIso)}` : null;
34
+ }
35
+ const noun = REPEAT_UNIT_NOUN[rule.unit] ?? rule.unit;
36
+ const n = rule.interval;
37
+ return `${n} ${noun}${n === 1 ? "" : "s"} after completion`;
38
+ }
10
39
  /**
11
40
  * The detail card, project-card grammar: type-labeled title row (the box
12
41
  * carries open/completed/canceled; only `trashed` needs words), uri, then
@@ -83,8 +112,26 @@ export function renderDetail(item) {
83
112
  const state = item.repeating.nextOccurrence != null && st === "waiting" ? "scheduled" : st;
84
113
  meta("repeating", `TEMPLATE, ${state} (occurrences appear in upcoming)`);
85
114
  }
86
- if (item.repeating.isInstance)
87
- meta("repeating", `instance of ${item.repeating.templateUuid}`);
115
+ if (item.repeating.isInstance) {
116
+ // ONE merged line: the GUI's lower-corner caption plus the instance-of write
117
+ // handle, e.g. `repeats: on Aug 19 (instance of <uuid>)` /
118
+ // `repeats: 1 day after completion (instance of <uuid>)`; a paused template
119
+ // folds in as `(paused; instance of <uuid>)`. With no renderable caption
120
+ // (dangling FK / undecodable rule) the line is just `instance of <uuid>`
121
+ // (paused appended). JSON wire is unchanged (`instanceOf` + `repeats` stay
122
+ // separate keys, src/read/shape.ts).
123
+ const tmpl = item.repeating.templateUuid;
124
+ const instanceOf = `instance of ${tmpl}`;
125
+ const ctx = item.repeating.repeats;
126
+ const caption = ctx !== undefined ? repeatContextValue(ctx, todayIso) : null;
127
+ const paused = ctx?.paused === true;
128
+ if (caption !== null) {
129
+ meta("repeats", `${caption} (${paused ? "paused; " : ""}${instanceOf})`);
130
+ }
131
+ else {
132
+ meta("repeats", `${instanceOf}${paused ? dim(" (paused)") : ""}`);
133
+ }
134
+ }
88
135
  if (item.notes !== "")
89
136
  lines.push("", item.notes);
90
137
  if (item.type === "to-do" && item.checklist && item.checklist.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"todo.js","sourceRoot":"","sources":["../../../src/cli/commands/todo.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAgB,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,uEAAuE;AACvE,MAAM,OAAO,GA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