@getpipher/armory-todo 0.5.3 → 0.5.4
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 +11 -0
- package/package.json +9 -3
- package/src/index.d.ts +78 -0
- package/src/index.ts +39 -0
package/README.md
CHANGED
|
@@ -21,6 +21,17 @@
|
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
|
+
## Public API
|
|
25
|
+
|
|
26
|
+
The package `exports` entry (`./src/index.ts`) is the **stable public surface** —
|
|
27
|
+
`addTodo`, `listTodos`, `updateTodo`, `getTodo`, `completeTodo`, `parkTodo`,
|
|
28
|
+
`deleteTodo`, and the `Todo` / `AddInput` / `UpdateInput` / `ListFilter` /
|
|
29
|
+
`Priority` / `Status` / `Store` types (plus `TodoError`). Other `src/*` paths
|
|
30
|
+
are internal and may change without notice. Depend on `@getpipher/armory-todo`
|
|
31
|
+
(the public entry), never deep-import `src/*`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
24
35
|
## The problem
|
|
25
36
|
|
|
26
37
|
pi sessions are ephemeral conversation branches. A TODO you tell to session A is invisible to session B unless you manually write it to a notes file *and* remember to read it next time. Every existing pi todo extension (`@juicesharp/rpiv-todo`, `@xynogen/pix-todo`, `@gonrocca/zero-pi-todo`, …) is **conversation-branch-scoped** — they persist via pi's `appendEntry()` and survive compaction + `/reload` *within a single session*. None bridge across separate sessions, and none make a fresh session aware of pending work on its own.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpipher/armory-todo",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Global, cross-session TODO for pi \u2014 persists across all sessions and is auto-injected into every prompt. The disk-backed counterpart to branch-scoped pi todo extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/getpipher/armory-todo/issues"
|
|
23
23
|
},
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./src/index.d.ts",
|
|
27
|
+
"default": "./src/index.ts"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
24
30
|
"files": [
|
|
25
31
|
"extensions",
|
|
26
32
|
"src",
|
|
@@ -35,7 +41,7 @@
|
|
|
35
41
|
]
|
|
36
42
|
},
|
|
37
43
|
"scripts": {
|
|
38
|
-
"test": "for t in todo-store todo-title-notes todo-archive todo-config todo-migrate todo-health todo-hard-prune todo-auto-prune registry projects panel-data todo-caps todo-backup; do node test/$t.test.mts || exit 1; done"
|
|
44
|
+
"test": "for t in todo-store todo-title-notes todo-archive todo-config todo-migrate todo-health todo-hard-prune todo-auto-prune registry projects panel-data todo-caps todo-backup public-api; do node test/$t.test.mts || exit 1; done"
|
|
39
45
|
},
|
|
40
46
|
"peerDependencies": {
|
|
41
47
|
"@earendil-works/pi-ai": "*",
|
|
@@ -53,4 +59,4 @@
|
|
|
53
59
|
"optional": true
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
|
-
}
|
|
62
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// src/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Typed declarations for the public stable API of @getpipher/armory-todo.
|
|
4
|
+
*
|
|
5
|
+
* Consumed via the package `exports` `types` condition (see package.json) so
|
|
6
|
+
* that TypeScript consumers type-check against this declaration instead of
|
|
7
|
+
* pulling the raw `.ts` implementation source. Runtime (tsx/jiti/node) uses the
|
|
8
|
+
* `default` condition (`./src/index.ts`).
|
|
9
|
+
*
|
|
10
|
+
* Hand-written (no build step — getpipher convention). Keep in sync with
|
|
11
|
+
* src/index.ts re-exports.
|
|
12
|
+
*/
|
|
13
|
+
export type Priority = "low" | "med" | "high" | "critical";
|
|
14
|
+
export type Status = "open" | "in_progress" | "parked" | "done" | "cancelled";
|
|
15
|
+
|
|
16
|
+
export interface Todo {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
notes: string;
|
|
20
|
+
project: string;
|
|
21
|
+
tags: string[];
|
|
22
|
+
priority: Priority;
|
|
23
|
+
status: Status;
|
|
24
|
+
source: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
closedAt: string | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AddInput {
|
|
31
|
+
title: string;
|
|
32
|
+
notes?: string;
|
|
33
|
+
project?: string;
|
|
34
|
+
tags?: string[];
|
|
35
|
+
priority?: Priority;
|
|
36
|
+
source?: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface UpdateInput {
|
|
40
|
+
title?: string;
|
|
41
|
+
notes?: string;
|
|
42
|
+
project?: string;
|
|
43
|
+
tags?: string[];
|
|
44
|
+
priority?: Priority;
|
|
45
|
+
status?: Status;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ListFilter {
|
|
49
|
+
status?: Status | "all";
|
|
50
|
+
project?: string;
|
|
51
|
+
tag?: string;
|
|
52
|
+
text?: string;
|
|
53
|
+
since?: string;
|
|
54
|
+
before?: string;
|
|
55
|
+
limit?: number;
|
|
56
|
+
page?: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface Store {
|
|
60
|
+
version: 3;
|
|
61
|
+
updatedAt: string;
|
|
62
|
+
todos: Todo[];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class TodoError extends Error {}
|
|
66
|
+
|
|
67
|
+
export function addTodo(input: AddInput): Todo;
|
|
68
|
+
export function listTodos(filter?: ListFilter): Todo[];
|
|
69
|
+
export function updateTodo(id: string, patch: UpdateInput): Todo;
|
|
70
|
+
export function getTodo(id: string): Todo;
|
|
71
|
+
export function completeTodo(id: string): Todo;
|
|
72
|
+
export function parkTodo(id: string): Todo;
|
|
73
|
+
export function deleteTodo(id: string): Todo;
|
|
74
|
+
export function clearTodos(status?: Status): number;
|
|
75
|
+
export function renderOpenBlock(max?: number): string;
|
|
76
|
+
export function getStorePath(): string;
|
|
77
|
+
export function loadStore(): Store;
|
|
78
|
+
export function saveStore(store: Store): void;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Public stable API of @getpipher/armory-todo.
|
|
4
|
+
*
|
|
5
|
+
* This `exports` entry (see package.json) is the stable surface — the functions
|
|
6
|
+
* and types re-exported here. Other `src/*` paths are internal and may change
|
|
7
|
+
* without notice. Depend on `@getpipher/armory-todo` (this public entry), never
|
|
8
|
+
* deep-import `src/*`.
|
|
9
|
+
*
|
|
10
|
+
* Consumers (e.g. @getpipher/armory-fleet) import from here so that evolution
|
|
11
|
+
* of armory-todo is decoupled: a breaking change can only touch a consumer's
|
|
12
|
+
* adapter, never its core, and the version pin + CI typecheck catch drift.
|
|
13
|
+
*/
|
|
14
|
+
export {
|
|
15
|
+
addTodo,
|
|
16
|
+
listTodos,
|
|
17
|
+
updateTodo,
|
|
18
|
+
getTodo,
|
|
19
|
+
completeTodo,
|
|
20
|
+
parkTodo,
|
|
21
|
+
deleteTodo,
|
|
22
|
+
clearTodos,
|
|
23
|
+
renderOpenBlock,
|
|
24
|
+
getStorePath,
|
|
25
|
+
loadStore,
|
|
26
|
+
saveStore,
|
|
27
|
+
} from "./todo-store.ts";
|
|
28
|
+
|
|
29
|
+
export type {
|
|
30
|
+
Todo,
|
|
31
|
+
AddInput,
|
|
32
|
+
UpdateInput,
|
|
33
|
+
ListFilter,
|
|
34
|
+
Priority,
|
|
35
|
+
Status,
|
|
36
|
+
Store,
|
|
37
|
+
} from "./todo-store.ts";
|
|
38
|
+
|
|
39
|
+
export { TodoError } from "./todo-store.ts";
|