@hasna/todos 0.15.52 → 0.16.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 (183) hide show
  1. package/CHANGELOG.md +1884 -0
  2. package/README.md +314 -37
  3. package/dist/ai-tools.d.ts.map +1 -1
  4. package/dist/ai.d.ts.map +1 -1
  5. package/dist/cli/cloud-router.d.ts +99 -51
  6. package/dist/cli/cloud-router.d.ts.map +1 -1
  7. package/dist/cli/commands/agent-commands.d.ts.map +1 -1
  8. package/dist/cli/commands/config-serve-commands.d.ts.map +1 -1
  9. package/dist/cli/commands/delegate.d.ts.map +1 -1
  10. package/dist/cli/commands/environment-snapshots.d.ts.map +1 -1
  11. package/dist/cli/commands/machines-api.d.ts +4 -0
  12. package/dist/cli/commands/machines-api.d.ts.map +1 -0
  13. package/dist/cli/commands/machines.d.ts.map +1 -1
  14. package/dist/cli/commands/mcp-hooks-commands.d.ts.map +1 -1
  15. package/dist/cli/commands/plan-commands.d.ts +3 -0
  16. package/dist/cli/commands/plan-commands.d.ts.map +1 -0
  17. package/dist/cli/commands/plan-template-commands.d.ts.map +1 -1
  18. package/dist/cli/commands/pr-group-commands.d.ts.map +1 -1
  19. package/dist/cli/commands/project-commands.d.ts.map +1 -1
  20. package/dist/cli/commands/query-commands.d.ts.map +1 -1
  21. package/dist/cli/commands/storage-commands.d.ts.map +1 -1
  22. package/dist/cli/commands/task-list-commands.d.ts +3 -0
  23. package/dist/cli/commands/task-list-commands.d.ts.map +1 -0
  24. package/dist/cli/commands/template-commands.d.ts +3 -0
  25. package/dist/cli/commands/template-commands.d.ts.map +1 -0
  26. package/dist/cli/helpers.d.ts.map +1 -1
  27. package/dist/cli/index.js +15128 -11093
  28. package/dist/cli/machine-api.d.ts +7 -0
  29. package/dist/cli/machine-api.d.ts.map +1 -0
  30. package/dist/cli/plan-read-api.d.ts +6 -0
  31. package/dist/cli/plan-read-api.d.ts.map +1 -0
  32. package/dist/cli/project-api.d.ts +119 -0
  33. package/dist/cli/project-api.d.ts.map +1 -0
  34. package/dist/cli/stage-a.d.ts +34 -4
  35. package/dist/cli/stage-a.d.ts.map +1 -1
  36. package/dist/cli/task-query-api.d.ts +21 -0
  37. package/dist/cli/task-query-api.d.ts.map +1 -0
  38. package/dist/cli/template-api.d.ts +7 -0
  39. package/dist/cli/template-api.d.ts.map +1 -0
  40. package/dist/contracts.js +835 -265
  41. package/dist/db/builtin-templates.d.ts +2 -33
  42. package/dist/db/builtin-templates.d.ts.map +1 -1
  43. package/dist/db/database.d.ts.map +1 -1
  44. package/dist/db/handoffs.d.ts.map +1 -1
  45. package/dist/db/machines.d.ts.map +1 -1
  46. package/dist/db/migrations.d.ts.map +1 -1
  47. package/dist/db/plans.d.ts.map +1 -1
  48. package/dist/db/retrospectives.d.ts.map +1 -1
  49. package/dist/db/schema.d.ts.map +1 -1
  50. package/dist/db/task-lists.d.ts.map +1 -1
  51. package/dist/db/task-runs.d.ts +2 -0
  52. package/dist/db/task-runs.d.ts.map +1 -1
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.d.ts.map +1 -1
  55. package/dist/index.js +3862 -1715
  56. package/dist/lib/assignee-validation.d.ts.map +1 -1
  57. package/dist/lib/builtin-template-library.d.ts +32 -0
  58. package/dist/lib/builtin-template-library.d.ts.map +1 -0
  59. package/dist/lib/cli-reference.d.ts.map +1 -1
  60. package/dist/lib/config.d.ts +10 -13
  61. package/dist/lib/config.d.ts.map +1 -1
  62. package/dist/lib/db-backup.d.ts +1 -1
  63. package/dist/lib/db-backup.d.ts.map +1 -1
  64. package/dist/lib/env.d.ts +18 -0
  65. package/dist/lib/env.d.ts.map +1 -0
  66. package/dist/lib/environment-snapshots.d.ts.map +1 -1
  67. package/dist/lib/gatherer.d.ts.map +1 -1
  68. package/dist/lib/headless-boundaries.d.ts +4 -3
  69. package/dist/lib/headless-boundaries.d.ts.map +1 -1
  70. package/dist/lib/local-encryption.d.ts +12 -0
  71. package/dist/lib/local-encryption.d.ts.map +1 -1
  72. package/dist/lib/local-opt-in.d.ts +90 -0
  73. package/dist/lib/local-opt-in.d.ts.map +1 -0
  74. package/dist/lib/paths.d.ts +9 -0
  75. package/dist/lib/paths.d.ts.map +1 -1
  76. package/dist/lib/plan-artifacts.d.ts +1 -0
  77. package/dist/lib/plan-artifacts.d.ts.map +1 -1
  78. package/dist/lib/plan-client-boundary.d.ts +2 -0
  79. package/dist/lib/plan-client-boundary.d.ts.map +1 -0
  80. package/dist/lib/plan-schedule.d.ts +6 -0
  81. package/dist/lib/plan-schedule.d.ts.map +1 -0
  82. package/dist/lib/project-panel.d.ts +6 -0
  83. package/dist/lib/project-panel.d.ts.map +1 -1
  84. package/dist/lib/project-receipt.d.ts +3 -0
  85. package/dist/lib/project-receipt.d.ts.map +1 -0
  86. package/dist/lib/sandbox-profiles.d.ts.map +1 -1
  87. package/dist/lib/shared-plan-artifacts.d.ts +14 -0
  88. package/dist/lib/shared-plan-artifacts.d.ts.map +1 -0
  89. package/dist/lib/sync.d.ts.map +1 -1
  90. package/dist/lib/task-list-client-boundary.d.ts +3 -0
  91. package/dist/lib/task-list-client-boundary.d.ts.map +1 -0
  92. package/dist/lib/task-routing.d.ts.map +1 -1
  93. package/dist/lib/template-client-boundary.d.ts +2 -0
  94. package/dist/lib/template-client-boundary.d.ts.map +1 -0
  95. package/dist/mcp/index.d.ts +1 -0
  96. package/dist/mcp/index.d.ts.map +1 -1
  97. package/dist/mcp/index.js +45271 -40452
  98. package/dist/mcp/plan-api.d.ts +6 -0
  99. package/dist/mcp/plan-api.d.ts.map +1 -0
  100. package/dist/mcp/remote-authority.d.ts +49 -0
  101. package/dist/mcp/remote-authority.d.ts.map +1 -0
  102. package/dist/mcp/task-coordination-api.d.ts +15 -0
  103. package/dist/mcp/task-coordination-api.d.ts.map +1 -0
  104. package/dist/mcp/task-list-api.d.ts +8 -0
  105. package/dist/mcp/task-list-api.d.ts.map +1 -0
  106. package/dist/mcp/token-utils.d.ts.map +1 -1
  107. package/dist/mcp/tools/environment-snapshots.d.ts.map +1 -1
  108. package/dist/mcp/tools/machines.d.ts.map +1 -1
  109. package/dist/mcp/tools/task-project-tools.d.ts.map +1 -1
  110. package/dist/mcp/tools/task-resources.d.ts.map +1 -1
  111. package/dist/mcp.d.ts +2 -2
  112. package/dist/mcp.d.ts.map +1 -1
  113. package/dist/mcp.js +44 -18
  114. package/dist/project-registration.js +2829 -556
  115. package/dist/registry.js +836 -266
  116. package/dist/release-provenance.json +6 -6
  117. package/dist/sdk/client.d.ts +51 -4
  118. package/dist/sdk/client.d.ts.map +1 -1
  119. package/dist/sdk/index.d.ts +2 -0
  120. package/dist/sdk/index.d.ts.map +1 -1
  121. package/dist/sdk/index.js +1209 -1080
  122. package/dist/sdk/resolve.d.ts +91 -0
  123. package/dist/sdk/resolve.d.ts.map +1 -0
  124. package/dist/sdk/v1.generated.d.ts +219 -3
  125. package/dist/sdk/v1.generated.d.ts.map +1 -1
  126. package/dist/server/auth-posture.d.ts +66 -7
  127. package/dist/server/auth-posture.d.ts.map +1 -1
  128. package/dist/server/client-ip.d.ts +39 -0
  129. package/dist/server/client-ip.d.ts.map +1 -0
  130. package/dist/server/cloud.d.ts +2 -1
  131. package/dist/server/cloud.d.ts.map +1 -1
  132. package/dist/server/index.d.ts +1 -1
  133. package/dist/server/index.js +20556 -15541
  134. package/dist/server/openapi.d.ts +1341 -83
  135. package/dist/server/openapi.d.ts.map +1 -1
  136. package/dist/server/port.d.ts +2 -2
  137. package/dist/server/port.d.ts.map +1 -1
  138. package/dist/server/routes.d.ts +3 -6
  139. package/dist/server/routes.d.ts.map +1 -1
  140. package/dist/server/serve.d.ts +2 -6
  141. package/dist/server/serve.d.ts.map +1 -1
  142. package/dist/server/v1.d.ts +3 -1
  143. package/dist/server/v1.d.ts.map +1 -1
  144. package/dist/storage/atomic-project-migration.d.ts +53 -0
  145. package/dist/storage/atomic-project-migration.d.ts.map +1 -0
  146. package/dist/storage/index.d.ts +3 -1
  147. package/dist/storage/index.d.ts.map +1 -1
  148. package/dist/storage/interfaces.d.ts +61 -0
  149. package/dist/storage/interfaces.d.ts.map +1 -1
  150. package/dist/storage/machine-registry.d.ts +36 -0
  151. package/dist/storage/machine-registry.d.ts.map +1 -0
  152. package/dist/storage/postgres-adapter.d.ts.map +1 -1
  153. package/dist/storage/postgres-sync.d.ts +2 -2
  154. package/dist/storage/postgres-sync.d.ts.map +1 -1
  155. package/dist/storage/run-artifact-creation-upload.d.ts +50 -0
  156. package/dist/storage/run-artifact-creation-upload.d.ts.map +1 -0
  157. package/dist/storage/s3-artifact-sync.d.ts +18 -0
  158. package/dist/storage/s3-artifact-sync.d.ts.map +1 -1
  159. package/dist/storage/sqlite-snapshot.d.ts +2 -0
  160. package/dist/storage/sqlite-snapshot.d.ts.map +1 -1
  161. package/dist/storage.d.ts +2 -2
  162. package/dist/storage.d.ts.map +1 -1
  163. package/dist/storage.js +2695 -322
  164. package/dist/task-manifest/postgres.d.ts +1 -1
  165. package/dist/task-manifest/sqlite.d.ts +1 -1
  166. package/dist/task-manifest.js +244 -73
  167. package/dist/task-subtree-transfer.js +198 -4
  168. package/dist/testing.d.ts +90 -29
  169. package/dist/testing.d.ts.map +1 -1
  170. package/dist/testing.js +34 -10
  171. package/dist/types/index.d.ts +40 -4
  172. package/dist/types/index.d.ts.map +1 -1
  173. package/docs/PLAN_API.md +93 -0
  174. package/docs/TASK_LIST_API.md +58 -0
  175. package/docs/TASK_QUERY_API.md +14 -0
  176. package/docs/TEMPLATE_API.md +18 -0
  177. package/docs/native-storage.md +405 -0
  178. package/package.json +18 -15
  179. package/postinstall.js +52 -1
  180. package/dashboard/dist/assets/index-BNQ4gJua.js +0 -342
  181. package/dashboard/dist/assets/index-DjzvHUWt.css +0 -1
  182. package/dashboard/dist/index.html +0 -13
  183. package/dashboard/dist/logo.jpg +0 -0
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Credential and authority resolution for the `@hasna/todos/sdk` surface.
3
+ *
4
+ * There is exactly ONE resolver on the fleet — the client chain in
5
+ * `@hasna/contracts/client` — and this module is the SDK's adapter onto it
6
+ * (2026-09-04 adoption ruling, hasna/apps#1720). The SDK used to carry its own
7
+ * chain: `TODOS_URL` for the authority and an unprefixed key name (or an `apiKey` field
8
+ * inside `~/.todos/config.json`) for the credential. Both are gone. A credential
9
+ * in `config.json` was a world-readable secret in a file the CLI also rewrites
10
+ * for unrelated settings, and the unprefixed names shadowed the canonical
11
+ * `HASNA_TODOS_API_URL` / `HASNA_TODOS_API_KEY` pair — an operator who exported
12
+ * the canonical pair got the localhost default anyway.
13
+ *
14
+ * The tiers are the fleet's five, resolved fresh on every call:
15
+ *
16
+ * 1. an explicit argument — `options.apiKey` / `options.baseUrl`
17
+ * 2. a deliberate env pointer — `HASNA_TODOS_API_KEY_OVERRIDE`, `HASNA_PROFILE`,
18
+ * `HASNA_TODOS_API_KEY_REF`
19
+ * 3. the macOS Keychain — `hasna.credentials.todos.api-key`
20
+ * 4. disk — `~/.hasna/todos/config/credentials` (0400/0600)
21
+ * 5. `HASNA_TODOS_API_KEY` — a legitimate tier, no deprecation notice
22
+ *
23
+ * with the authority following `HASNA_TODOS_API_URL`, the Keychain `api-url`
24
+ * item, the credentials file, and finally the fleet gateway
25
+ * `https://api.hasna.com/todos`. The legacy unprefixed `TODOS_*` spellings
26
+ * remain only as the resolver's silent alias fallback for one release.
27
+ *
28
+ * LOCAL MODE IS DELIBERATE, NEVER A FALLBACK FROM FAILURE. `TodosClient` speaks
29
+ * the `/api/*` plane that `todos-serve` exposes on a workstation, so the
30
+ * unhosted default — `http://localhost:19427`, no credential — is a real
31
+ * product mode rather than a silent degradation. It is therefore reachable in
32
+ * exactly two ways: the deliberate opt-in `HASNA_TODOS_LOCAL=1`, or an
33
+ * environment where NOTHING resolves at all. A credential that resolves but
34
+ * cannot be used, an unreadable credential file, an authority that is set but
35
+ * malformed — every one of those THROWS. And when local mode is selected the
36
+ * SDK says so, once per process, on stderr: a client silently talking to an
37
+ * empty local store while the operator believes it is on the fleet is the
38
+ * false-green this whole ruling exists to end.
39
+ */
40
+ import { type CredentialChainOptions } from "@hasna/contracts/client";
41
+ import { TodosV1Client, type TodosV1ClientOptions } from "./v1.generated.js";
42
+ /** The unhosted `todos-serve` a workstation runs. Never a hosted authority. */
43
+ export declare const TODOS_LOCAL_SERVE_URL = "http://localhost:19427";
44
+ type Env = Record<string, string | undefined>;
45
+ export interface TodosSdkTransport {
46
+ /** `"http"` for a resolved hosted authority, `"local-serve"` for the unhosted default. */
47
+ mode: "http" | "local-serve";
48
+ /**
49
+ * Origin (plus any gateway path prefix) WITHOUT the `/v1` suffix, so a caller
50
+ * that composes `/api/...` or `/v1/...` gets exactly one version segment.
51
+ */
52
+ baseUrl: string;
53
+ /** The credential, or null in local mode. */
54
+ apiKey: string | null;
55
+ /** WHERE the credential came from — an env key NAME, a Keychain reference, a path. Never a value. */
56
+ apiKeySource: string | null;
57
+ /** WHERE the authority came from, or `"local-serve"`. */
58
+ apiUrlSource: string;
59
+ }
60
+ export interface ResolveTodosSdkTransportOptions {
61
+ /** Tier 1: an explicit authority. Used verbatim, minus a trailing slash. */
62
+ baseUrl?: string | undefined;
63
+ /** Tier 1: an explicit credential. */
64
+ apiKey?: string | undefined;
65
+ /** Tier 1 profile selection and the injectable `security` runner tests use. */
66
+ credentials?: CredentialChainOptions;
67
+ /** Defaults to `process.env`. */
68
+ env?: Env;
69
+ /** Where the one-line local-mode notice goes. Defaults to `process.stderr`. */
70
+ notice?: (line: string) => void;
71
+ }
72
+ /** Reset the once-per-process local-mode notice. Test seam only. */
73
+ export declare function __resetTodosSdkLocalNotice(): void;
74
+ /**
75
+ * Resolve the SDK's authority and credential. Explicit arguments win; otherwise
76
+ * the @hasna/contracts chain decides, and only a fully unconfigured environment
77
+ * (or the deliberate opt-in) lands on the local serve.
78
+ */
79
+ export declare function resolveTodosSdkTransport(options?: ResolveTodosSdkTransportOptions): TodosSdkTransport;
80
+ /**
81
+ * Build the hosted `/v1` client with the fleet resolver behind it — the
82
+ * generated {@link TodosV1Client} takes an explicit `baseUrl` and has no
83
+ * environment surface of its own, which left every caller writing a private
84
+ * copy of the chain.
85
+ *
86
+ * Throws when no credential resolves: this client speaks only to the hosted
87
+ * authority, so there is no local mode to degrade to.
88
+ */
89
+ export declare function createTodosV1Client(options?: ResolveTodosSdkTransportOptions & Pick<TodosV1ClientOptions, "fetch" | "headers">): TodosV1Client;
90
+ export {};
91
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/sdk/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,EAKL,KAAK,sBAAsB,EAE5B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAG7E,+EAA+E;AAC/E,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,qGAAqG;IACrG,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,+BAA+B;IAC9C,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,+EAA+E;IAC/E,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,iCAAiC;IACjC,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,+EAA+E;IAC/E,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAID,oEAAoE;AACpE,wBAAgB,0BAA0B,IAAI,IAAI,CAEjD;AAiBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,+BAAoC,GAC5C,iBAAiB,CA+FnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,+BAA+B,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAM,GAC9F,aAAa,CAmDf"}
@@ -1,3 +1,19 @@
1
+ export interface MachineAuthority {
2
+ "tenant_id": string;
3
+ "kid": string;
4
+ }
5
+ export interface Machine {
6
+ "id": string;
7
+ "name": string;
8
+ "hostname": string;
9
+ "platform": string;
10
+ "last_seen_at": string;
11
+ "metadata": Record<string, unknown>;
12
+ "created_at": string;
13
+ "ssh_address": string;
14
+ "is_primary": boolean;
15
+ "archived_at": string;
16
+ }
1
17
  export interface Task {
2
18
  "id"?: string;
3
19
  "title"?: string;
@@ -18,6 +34,9 @@ export interface Task {
18
34
  "updated_at"?: string;
19
35
  }
20
36
  export interface Project {
37
+ "status"?: "active" | "completed" | "on_hold" | "archived";
38
+ "short_id"?: string | null;
39
+ "metadata"?: Record<string, unknown>;
21
40
  "id"?: string;
22
41
  "name"?: string;
23
42
  "path"?: string;
@@ -412,6 +431,7 @@ export interface ProjectResourcePage {
412
431
  "truncated": false;
413
432
  }
414
433
  export interface TaskList {
434
+ "status"?: "active" | "completed" | "archived";
415
435
  "id"?: string;
416
436
  "project_id"?: string | null;
417
437
  "slug"?: string;
@@ -500,7 +520,9 @@ export interface Plan {
500
520
  "agent_id"?: string | null;
501
521
  "name": string;
502
522
  "description"?: string | null;
503
- "status": "active" | "completed" | "archived";
523
+ "start_date"?: string | null;
524
+ "end_date"?: string | null;
525
+ "status": "active" | "completed" | "archived" | "planning" | "cancelled";
504
526
  "created_at": string;
505
527
  "updated_at": string;
506
528
  }
@@ -634,6 +656,9 @@ export interface TaskFailureResult {
634
656
  "retryTask"?: Task;
635
657
  }
636
658
  export interface CreateProjectInput {
659
+ "status"?: "active" | "completed" | "on_hold" | "archived";
660
+ "short_id"?: string | null;
661
+ "metadata"?: Record<string, unknown>;
637
662
  "name": string;
638
663
  "path": string;
639
664
  "description"?: string;
@@ -642,6 +667,9 @@ export interface CreateProjectInput {
642
667
  "parent_id"?: string;
643
668
  }
644
669
  export interface UpdateProjectInput {
670
+ "status"?: "active" | "completed" | "on_hold" | "archived";
671
+ "short_id"?: string | null;
672
+ "metadata"?: Record<string, unknown>;
645
673
  "name"?: string;
646
674
  "path"?: string;
647
675
  "description"?: string | null;
@@ -670,12 +698,21 @@ export interface PlanProjectLinkRollbackInput {
670
698
  "receipt_id": string;
671
699
  "expected_plan_revision": string;
672
700
  }
701
+ export interface PlanProjectLinkConflictResponse {
702
+ "error": string;
703
+ "code"?: string;
704
+ "conflict"?: boolean;
705
+ "operation_committed"?: true;
706
+ "current_state_matches_receipt"?: false;
707
+ "receipt"?: PlanProjectLinkReceipt;
708
+ }
673
709
  export interface ErrorResponse {
674
710
  "error": string;
675
711
  "code"?: string;
676
712
  "conflict"?: boolean;
677
713
  }
678
714
  export interface CreateTaskListInput {
715
+ "status"?: "active" | "completed" | "archived";
679
716
  "name": string;
680
717
  "slug"?: string;
681
718
  "project_id"?: string;
@@ -683,6 +720,7 @@ export interface CreateTaskListInput {
683
720
  "metadata"?: Record<string, unknown>;
684
721
  }
685
722
  export interface UpdateTaskListInput {
723
+ "status"?: "active" | "completed" | "archived";
686
724
  "slug"?: string;
687
725
  "name"?: string;
688
726
  "description"?: string;
@@ -703,7 +741,9 @@ export interface CreatePlanInput {
703
741
  "project_id"?: string;
704
742
  "task_list_id"?: string;
705
743
  "agent_id"?: string;
706
- "status"?: "active" | "completed" | "archived";
744
+ "start_date"?: string | null;
745
+ "end_date"?: string | null;
746
+ "status"?: "active" | "completed" | "archived" | "planning" | "cancelled";
707
747
  }
708
748
  export interface UpdatePlanInput {
709
749
  "name"?: string;
@@ -711,7 +751,9 @@ export interface UpdatePlanInput {
711
751
  "description"?: string;
712
752
  "task_list_id"?: string;
713
753
  "agent_id"?: string;
714
- "status"?: "active" | "completed" | "archived";
754
+ "start_date"?: string | null;
755
+ "end_date"?: string | null;
756
+ "status"?: "active" | "completed" | "archived" | "planning" | "cancelled";
715
757
  }
716
758
  export interface CreateTemplateInput {
717
759
  "name": string;
@@ -726,6 +768,7 @@ export interface CreateTemplateInput {
726
768
  "tasks"?: Array<CreateTemplateTaskInput>;
727
769
  }
728
770
  export interface UpdateTemplateInput {
771
+ "expected_version"?: number;
729
772
  "name"?: string;
730
773
  "title_pattern"?: string;
731
774
  "description"?: string | null;
@@ -1037,6 +1080,8 @@ export declare class TodosV1Client {
1037
1080
  "tasks"?: Array<Task>;
1038
1081
  "projects"?: Array<Project>;
1039
1082
  "projectMachinePaths"?: Array<Record<string, unknown>>;
1083
+ "machines"?: Array<Machine>;
1084
+ "expected_machine_authority"?: MachineAuthority;
1040
1085
  "plans"?: Array<Record<string, unknown>>;
1041
1086
  "agents"?: Array<Record<string, unknown>>;
1042
1087
  "taskLists"?: Array<Record<string, unknown>>;
@@ -1051,6 +1096,7 @@ export declare class TodosV1Client {
1051
1096
  }>;
1052
1097
  }, init?: RequestInit): Promise<{
1053
1098
  "received"?: number;
1099
+ "machine_authority"?: MachineAuthority;
1054
1100
  "result"?: {
1055
1101
  "inserted"?: number;
1056
1102
  "updated"?: number;
@@ -1066,6 +1112,29 @@ export declare class TodosV1Client {
1066
1112
  "applied": boolean;
1067
1113
  }>;
1068
1114
  }>;
1115
+ /** Read the complete shared machine registry */
1116
+ listMachines(init?: RequestInit): Promise<{
1117
+ "authority": MachineAuthority;
1118
+ "schema_version": 2;
1119
+ "machines": Array<Machine>;
1120
+ }>;
1121
+ /** Apply an atomic machine registry operation */
1122
+ mutateMachineRegistry(body: {
1123
+ "expected_authority": MachineAuthority;
1124
+ "action": "register" | "heartbeat" | "set-primary" | "archive" | "unarchive" | "delete" | "import";
1125
+ "name"?: string;
1126
+ "id"?: string;
1127
+ "options"?: Record<string, unknown>;
1128
+ "machines"?: Array<Machine>;
1129
+ }, init?: RequestInit): Promise<{
1130
+ "authority": MachineAuthority;
1131
+ "schema_version": 2;
1132
+ "machines": Array<Machine>;
1133
+ "machine"?: Machine;
1134
+ "inserted": number;
1135
+ "skipped": number;
1136
+ "deleted"?: boolean;
1137
+ }>;
1069
1138
  /** List plans */
1070
1139
  listPlans(query?: {
1071
1140
  "project_id"?: string;
@@ -1090,6 +1159,39 @@ export declare class TodosV1Client {
1090
1159
  updatePlan(id: string, body: UpdatePlanInput, init?: RequestInit): Promise<{
1091
1160
  "plan"?: Plan;
1092
1161
  }>;
1162
+ /** Read complete plan comment history */
1163
+ listPlanComments(id: string, query?: {
1164
+ "plan_read_contract"?: "1";
1165
+ }, init?: RequestInit): Promise<{
1166
+ "count": number;
1167
+ "comments": Array<{
1168
+ "id": string;
1169
+ "plan_id": string;
1170
+ "content": string;
1171
+ "created_at": string;
1172
+ "agent_id": string | null;
1173
+ "session_id": string | null;
1174
+ "type": "comment" | "progress" | "note";
1175
+ "progress_pct": number | null;
1176
+ }>;
1177
+ "history_selection"?: {
1178
+ "schema_version": 1;
1179
+ "plan_id": string;
1180
+ "complete": true;
1181
+ };
1182
+ }>;
1183
+ /** Delete a plan, detaching linked records only with force and preserving their content/history */
1184
+ deletePlanPreserving(id: string, body: {
1185
+ "force"?: boolean;
1186
+ }, init?: RequestInit): Promise<{
1187
+ "schema_version": 1;
1188
+ "plan_id": string;
1189
+ "deleted": boolean;
1190
+ "detached_task_ids": Array<string>;
1191
+ "detached_task_list_ids": Array<string>;
1192
+ "detached_tasks": number;
1193
+ "detached_task_lists": number;
1194
+ }>;
1093
1195
  /** Plan atomic linkage of an existing plan and every current member task to a project */
1094
1196
  planPlanProjectLink(id: string, query?: {
1095
1197
  "project_id": string;
@@ -1111,6 +1213,50 @@ export declare class TodosV1Client {
1111
1213
  appendPrGroupEvent(id: string, body: AppendPrGroupEventInput, init?: RequestInit): Promise<PrGroupMutationResult>;
1112
1214
  /** Fence the prior attempt and create or adopt a recovery generation */
1113
1215
  recoverPrGroup(id: string, body: RecoverPrGroupInput, init?: RequestInit): Promise<PrGroupMutationResult>;
1216
+ /** Inspect bounded atomic migration authority (explicit todos:migrate scope required) */
1217
+ getAtomicProjectMigrationCapability(init?: RequestInit): Promise<{
1218
+ "schema_version": 1;
1219
+ "authority": {
1220
+ "tenant_id": string;
1221
+ "kid": string;
1222
+ "deployment_id": string;
1223
+ };
1224
+ "supported_families": Array<string>;
1225
+ "supported_tombstones": Array<string>;
1226
+ "max_records": number;
1227
+ "max_bytes": number;
1228
+ "atomic": true;
1229
+ }>;
1230
+ /** Atomically reconcile a bounded project snapshot with durable replay receipts */
1231
+ importAtomicProjectSnapshot(body: {
1232
+ "schema_version": 1;
1233
+ "operation_id": string;
1234
+ "expected_authority": {
1235
+ "tenant_id": string;
1236
+ "kid": string;
1237
+ "deployment_id": string;
1238
+ };
1239
+ "snapshot_hash": string;
1240
+ "snapshot": Record<string, unknown>;
1241
+ }, init?: RequestInit): Promise<{
1242
+ "schema_version": 1;
1243
+ "operation_id": string;
1244
+ "snapshot_hash": string;
1245
+ "authority": {
1246
+ "tenant_id": string;
1247
+ "kid": string;
1248
+ "deployment_id": string;
1249
+ };
1250
+ "status": "complete";
1251
+ "records": Array<{
1252
+ "object_type": string;
1253
+ "object_id": string;
1254
+ "outcome": "inserted" | "updated" | "identical" | "superseded" | "deleted" | "detached";
1255
+ "before_hash": string | null;
1256
+ "after_hash": string;
1257
+ "source_hash": string;
1258
+ }>;
1259
+ }>;
1114
1260
  /** Read the live package-owned Projects to Todos registration capability */
1115
1261
  getProjectRegistrationCapability(init?: RequestInit): Promise<{
1116
1262
  "capability": ProjectRegistrationCapability;
@@ -1196,6 +1342,19 @@ export declare class TodosV1Client {
1196
1342
  updateProject(id: string, body: UpdateProjectInput, init?: RequestInit): Promise<{
1197
1343
  "project"?: Project;
1198
1344
  }>;
1345
+ /** Delete project identity and atomically detach linked records without deleting their content */
1346
+ deleteProjectPreserving(id: string, body: {
1347
+ "force"?: boolean;
1348
+ "require_completed_tasks"?: boolean;
1349
+ }, init?: RequestInit): Promise<{
1350
+ "schema_version": 1;
1351
+ "project_id": string;
1352
+ "deleted": boolean;
1353
+ "preserved_tasks": number;
1354
+ "preserved_plans": number;
1355
+ "detached_task_lists": number;
1356
+ "detached_child_projects": number;
1357
+ }>;
1199
1358
  /** Atomically rename a project and its canonical task list */
1200
1359
  renameProject(id: string, body: RenameProjectInput, init?: RequestInit): Promise<{
1201
1360
  "project"?: Project;
@@ -1241,6 +1400,18 @@ export declare class TodosV1Client {
1241
1400
  updateTaskList(id: string, body: UpdateTaskListInput, init?: RequestInit): Promise<{
1242
1401
  "task_list"?: TaskList;
1243
1402
  }>;
1403
+ /** Delete a task list, optionally detaching linked tasks and plans while retaining their content and history */
1404
+ deleteTaskListPreserving(id: string, body: {
1405
+ "force"?: boolean;
1406
+ }, init?: RequestInit): Promise<{
1407
+ "schema_version": 1;
1408
+ "task_list_id": string;
1409
+ "deleted": boolean;
1410
+ "detached_task_ids": Array<string>;
1411
+ "detached_plan_ids": Array<string>;
1412
+ "detached_tasks": number;
1413
+ "detached_plans": number;
1414
+ }>;
1244
1415
  /** Apply one exact task-manifest graph through the Todos authority */
1245
1416
  applyTaskManifest(body: TaskManifest, init?: RequestInit): Promise<TaskManifestApplyResponse>;
1246
1417
  /** Recover one exact task-manifest apply receipt from its managed plan id */
@@ -1278,6 +1449,8 @@ export declare class TodosV1Client {
1278
1449
  "project_id"?: string;
1279
1450
  "parent_id"?: string | null;
1280
1451
  "include_subtasks"?: boolean;
1452
+ "include_archived"?: boolean;
1453
+ "plan_read_contract"?: "1";
1281
1454
  "plan_id"?: string;
1282
1455
  "task_list_id"?: string;
1283
1456
  "assigned_to"?: string;
@@ -1290,6 +1463,12 @@ export declare class TodosV1Client {
1290
1463
  "tasks": Array<Task>;
1291
1464
  "count": number;
1292
1465
  "total": number;
1466
+ "selection"?: {
1467
+ "schema_version": 1;
1468
+ "plan_id": string;
1469
+ "include_subtasks": true;
1470
+ "include_archived": boolean;
1471
+ };
1293
1472
  }>;
1294
1473
  /** Create a task */
1295
1474
  createTask(body: CreateTaskInput, init?: RequestInit): Promise<{
@@ -1364,6 +1543,19 @@ export declare class TodosV1Client {
1364
1543
  createTemplate(body: CreateTemplateInput, init?: RequestInit): Promise<{
1365
1544
  "template"?: Template;
1366
1545
  }>;
1546
+ /** Atomically initialize server-owned bundled definitions, retaining existing same-name templates */
1547
+ initializeTemplates(body: Record<string, unknown>, init?: RequestInit): Promise<{
1548
+ "schema_version": 1;
1549
+ "created": number;
1550
+ "skipped": number;
1551
+ "names": Array<string>;
1552
+ "records": Array<{
1553
+ "definition_index": number;
1554
+ "ids": Array<string>;
1555
+ "name": string;
1556
+ "status": "created" | "skipped";
1557
+ }>;
1558
+ }>;
1367
1559
  /** Get one reusable task template with its checklist steps */
1368
1560
  getTemplate(id: string, init?: RequestInit): Promise<{
1369
1561
  "template"?: Template;
@@ -1376,6 +1568,30 @@ export declare class TodosV1Client {
1376
1568
  /** Update reusable template metadata and defaults */
1377
1569
  updateTemplate(id: string, body: UpdateTemplateInput, init?: RequestInit): Promise<{
1378
1570
  "template"?: Template;
1571
+ "history_write"?: {
1572
+ "schema_version": 1;
1573
+ "template_id": string;
1574
+ "previous_version": number;
1575
+ "version": number;
1576
+ "recorded": true;
1577
+ };
1578
+ }>;
1579
+ /** Read recorded template versions with explicit missing-version evidence */
1580
+ getTemplateHistory(id: string, init?: RequestInit): Promise<{
1581
+ "current_version": number;
1582
+ "versions": Array<{
1583
+ "id": string;
1584
+ "template_id": string;
1585
+ "version": number;
1586
+ "snapshot": string;
1587
+ "created_at": string;
1588
+ }>;
1589
+ "selection": {
1590
+ "schema_version": 1;
1591
+ "template_id": string;
1592
+ "complete": boolean;
1593
+ "missing_versions": Array<number>;
1594
+ };
1379
1595
  }>;
1380
1596
  }
1381
1597
  //# sourceMappingURL=v1.generated.d.ts.map