@hasna/todos 0.15.6 → 0.15.9

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 (61) hide show
  1. package/dist/cli/cloud-router.d.ts +13 -1
  2. package/dist/cli/cloud-router.d.ts.map +1 -1
  3. package/dist/cli/commands/project-commands.d.ts.map +1 -1
  4. package/dist/cli/commands/task-commands.d.ts.map +1 -1
  5. package/dist/cli/index.js +4858 -1995
  6. package/dist/contracts.js +247 -3
  7. package/dist/db/migrations.d.ts.map +1 -1
  8. package/dist/db/schema.d.ts.map +1 -1
  9. package/dist/db/task-lists.d.ts +5 -0
  10. package/dist/db/task-lists.d.ts.map +1 -1
  11. package/dist/index.d.ts +2 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2405 -27
  14. package/dist/lib/assignee-validation.d.ts +44 -0
  15. package/dist/lib/assignee-validation.d.ts.map +1 -1
  16. package/dist/lib/project-task-list-ensure.d.ts +19 -0
  17. package/dist/lib/project-task-list-ensure.d.ts.map +1 -0
  18. package/dist/mcp/index.js +3156 -374
  19. package/dist/mcp.js +7 -3
  20. package/dist/project-registration/authority.d.ts +45 -0
  21. package/dist/project-registration/authority.d.ts.map +1 -0
  22. package/dist/project-registration/backend.d.ts +83 -0
  23. package/dist/project-registration/backend.d.ts.map +1 -0
  24. package/dist/project-registration/http.d.ts +24 -0
  25. package/dist/project-registration/http.d.ts.map +1 -0
  26. package/dist/project-registration/index.d.ts +8 -0
  27. package/dist/project-registration/index.d.ts.map +1 -0
  28. package/dist/project-registration/postgres.d.ts +30 -0
  29. package/dist/project-registration/postgres.d.ts.map +1 -0
  30. package/dist/project-registration/schema.d.ts +3 -0
  31. package/dist/project-registration/schema.d.ts.map +1 -0
  32. package/dist/project-registration/sqlite.d.ts +17 -0
  33. package/dist/project-registration/sqlite.d.ts.map +1 -0
  34. package/dist/project-registration/types.d.ts +155 -0
  35. package/dist/project-registration/types.d.ts.map +1 -0
  36. package/dist/project-registration.d.ts +2 -0
  37. package/dist/project-registration.d.ts.map +1 -0
  38. package/dist/project-registration.js +18145 -0
  39. package/dist/registry.d.ts +1 -1
  40. package/dist/registry.d.ts.map +1 -1
  41. package/dist/registry.js +254 -3
  42. package/dist/release-provenance.json +5 -5
  43. package/dist/sdk/index.d.ts +1 -1
  44. package/dist/sdk/index.d.ts.map +1 -1
  45. package/dist/sdk/index.js +21 -0
  46. package/dist/sdk/v1.generated.d.ts +43 -0
  47. package/dist/sdk/v1.generated.d.ts.map +1 -1
  48. package/dist/server/cloud.d.ts +3 -0
  49. package/dist/server/cloud.d.ts.map +1 -1
  50. package/dist/server/index.js +5001 -2219
  51. package/dist/server/openapi.d.ts +311 -0
  52. package/dist/server/openapi.d.ts.map +1 -1
  53. package/dist/server/v1.d.ts +2 -1
  54. package/dist/server/v1.d.ts.map +1 -1
  55. package/dist/storage/interfaces.d.ts +11 -0
  56. package/dist/storage/interfaces.d.ts.map +1 -1
  57. package/dist/storage/local-sqlite.d.ts.map +1 -1
  58. package/dist/storage.js +242 -1
  59. package/dist/types/index.d.ts +29 -0
  60. package/dist/types/index.d.ts.map +1 -1
  61. package/package.json +7 -3
@@ -65,6 +65,50 @@ export type AssigneeVerdict = {
65
65
  message: string;
66
66
  candidates?: KnownAgent[];
67
67
  };
68
+ /**
69
+ * What a READ-side `--assigned <ref>` filter is about to do, when that is worth
70
+ * saying out loud. See {@link describeAssigneeFilter}.
71
+ */
72
+ export type AssigneeFilterNotice = {
73
+ kind: "ok";
74
+ } | {
75
+ kind: "ambiguous";
76
+ message: string;
77
+ candidates: KnownAgent[];
78
+ };
79
+ /**
80
+ * The read-path counterpart to {@link validateAssignee}, for `list --assigned`.
81
+ *
82
+ * WHY THIS EXISTS (todos task 0cbf512c). Both storage engines resolve an
83
+ * `assigned_to` filter through an alias set — `resolveAssignedToAliases`
84
+ * (db/database.ts) and `resolveAgentForAssignedFilter`
85
+ * (storage/postgres-adapter.ts). Both deliberately degrade an AMBIGUOUS name,
86
+ * one that case-insensitively occupies 2+ agent rows, to LITERAL-ONLY matching
87
+ * rather than picking a row at random. That choice is right and is not changed
88
+ * here: picking is how a task lands on a stranger.
89
+ *
90
+ * What was wrong is that the degradation was SILENT. Both call sites describe
91
+ * literal-only as "same as no match". It is not. "No match" returns zero rows
92
+ * and the caller can see it; literal-only returns a POPULATED, PLAUSIBLE,
93
+ * PARTIAL set at rc=0 with nothing on stderr, so a complete answer and a
94
+ * truncated one are indistinguishable.
95
+ *
96
+ * Measured live on the cloud store, @hasna/todos 0.15.6, 2026-08-07:
97
+ * `--assigned 01d4cc12` returned 190 rows (`{fabricius: 182, '01d4cc12': 8}`)
98
+ * while `--assigned fabricius` returned 182 and 0 bytes of stderr. Eight rows
99
+ * whose `assigned_to` holds a raw agent id are invisible to the name query that
100
+ * seat actually runs.
101
+ *
102
+ * This WARNS rather than refusing, which is the one place it departs from
103
+ * `validateAssignee`. A write can be refused and retried; a read is run by
104
+ * scripts and by every agent's own queue check, and making it exit non-zero
105
+ * would be a worse regression than the defect. The partial set is still the
106
+ * best available answer — it just has to say that it is partial.
107
+ *
108
+ * Bridging two rows into one identity is a separate identity-model decision and
109
+ * is deliberately NOT attempted here (todos task a37a7137).
110
+ */
111
+ export declare function describeAssigneeFilter(input: string, ctx: Pick<AssigneeContext, "agents">): AssigneeFilterNotice;
68
112
  /**
69
113
  * The canonical declarative seat roster, in the `AgentRoster` format shipped
70
114
  * by `@hasna/identities`. `identities` has no built-in path for it — every
@@ -1 +1 @@
1
- {"version":3,"file":"assignee-validation.d.ts","sourceRoot":"","sources":["../../src/lib/assignee-validation.ts"],"names":[],"mappings":"AA2CA,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,gEAAgE;IAChE,KAAK,EAAE,GAA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;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACnF;IACE,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEN;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG,oBAAoB,CAgChH;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAK9C;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAgC,GAAG,GAAG,CAAC,MAAM,CAAC,CAajF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,eAAe,CAsErF"}
@@ -0,0 +1,19 @@
1
+ import type { ProjectTaskListEnsureResult, ProjectTaskListRollbackResult } from "../types/index.js";
2
+ import type { TodosStorageAdapter } from "../storage/interfaces.js";
3
+ export declare const PROJECT_TASK_LIST_ENSURE_SCHEMA_VERSION: "todos.project-task-list-ensure.v1";
4
+ export type ProjectTaskListEnsureErrorCode = "PROJECT_NOT_FOUND" | "PROJECT_TASK_LIST_NOT_DECLARED" | "PROJECT_REVISION_CONFLICT" | "TASK_LIST_SCOPE_COLLISION" | "PROJECT_TASK_LIST_IDEMPOTENCY_KEY_INVALID" | "PROJECT_TASK_LIST_IDEMPOTENCY_CONFLICT" | "PROJECT_TASK_LIST_RECEIPT_NOT_FOUND" | "PROJECT_TASK_LIST_ROLLBACK_CONFLICT" | "PROJECT_TASK_LIST_ROLLBACK_HAS_DEPENDENTS";
5
+ export declare class ProjectTaskListEnsureError extends Error {
6
+ readonly code: ProjectTaskListEnsureErrorCode;
7
+ readonly details: Record<string, unknown>;
8
+ constructor(code: ProjectTaskListEnsureErrorCode, message: string, details?: Record<string, unknown>);
9
+ }
10
+ export declare function planProjectTaskListEnsure(store: TodosStorageAdapter, projectId: string): Promise<ProjectTaskListEnsureResult>;
11
+ export declare function applyProjectTaskListEnsure(store: TodosStorageAdapter, projectId: string, options: {
12
+ expected_project_revision: string;
13
+ idempotency_key?: string;
14
+ }): Promise<ProjectTaskListEnsureResult>;
15
+ export declare function rollbackProjectTaskListEnsure(store: TodosStorageAdapter, projectId: string, options: {
16
+ receipt_id: string;
17
+ expected_task_list_revision: string;
18
+ }): Promise<ProjectTaskListRollbackResult>;
19
+ //# sourceMappingURL=project-task-list-ensure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-task-list-ensure.d.ts","sourceRoot":"","sources":["../../src/lib/project-task-list-ensure.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,2BAA2B,EAC3B,6BAA6B,EAE9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,eAAO,MAAM,uCAAuC,EAClD,mCAA4C,CAAC;AAa/C,MAAM,MAAM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