attraverso 0.2.0 → 0.4.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 +39 -9
- package/assets/memfs2opfs-B4SpaLa4.js +399 -0
- package/assets/migrations/0015_stormy_blindfold.sql +9 -0
- package/assets/migrations/meta/0015_snapshot.json +1668 -0
- package/assets/migrations/meta/_journal.json +7 -0
- package/assets/nodefs-DEelVsw6.js +23 -0
- package/assets/opfs-ahp-CDfgZf23.js +394 -0
- package/assets/postgres-DCJiA8An.js +4649 -0
- package/initdb.wasm +0 -0
- package/lib/index.d.ts +145 -0
- package/lib/index.js +2394 -0
- package/migrations/0015_stormy_blindfold.sql +9 -0
- package/migrations/meta/0015_snapshot.json +1668 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +16 -1
- package/pglite.data +1141 -1165
- package/pglite.wasm +0 -0
- package/server.js +54168 -46925
- package/viewer/assets/favicon-BUxCK25s.svg +13 -0
- package/viewer/assets/index-B4AZhw2f.js +45 -0
- package/viewer/assets/index-BuEyBnDM.css +1 -0
- package/viewer/index.html +3 -2
- package/assets/nodefs-BbnD6x79.js +0 -33
- package/assets/opfs-ahp-CFnUNF4E.js +0 -308
- package/assets/postgres-X5RxLyOz.js +0 -5438
- package/viewer/assets/index--Q2Bqrsm.css +0 -1
- package/viewer/assets/index-Dk0TlY7z.js +0 -90
package/initdb.wasm
CHANGED
|
Binary file
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
export interface PlanOptions {
|
|
2
|
+
/** The plan as YAML, as an `attraverso.yaml` holds it. Absent or blank opens an empty plan. */
|
|
3
|
+
yaml?: string;
|
|
4
|
+
/**
|
|
5
|
+
* Called with the whole plan, re-serialised, after every change - the write-through a plan file gets on disk.
|
|
6
|
+
* Awaited, so a write resolves only once its save has; a save that throws fails the write that caused it.
|
|
7
|
+
* Saves run one at a time, in the order of the writes. Omitted, changes live only as long as the handle.
|
|
8
|
+
*/
|
|
9
|
+
save?: (yaml: string) => void | Promise<void>;
|
|
10
|
+
/** Who the event log and new comments name as the author. Defaults to `"claude"`, as the MCP tools write. */
|
|
11
|
+
actor?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface Plan {
|
|
14
|
+
/** Every project in the plan, by key. */
|
|
15
|
+
listProjects(): Promise<ProjectInfo[]>;
|
|
16
|
+
/** Create a project, seeded with the starter `protocol` section as `create_project` seeds it. */
|
|
17
|
+
createProject(input: NewProject): Promise<ProjectInfo>;
|
|
18
|
+
/** A handle on one project. Rejects when there is no project with that key. */
|
|
19
|
+
project(key: string): Promise<PlanProject>;
|
|
20
|
+
/** The plan as YAML right now: what `save` was last given, or would be. */
|
|
21
|
+
toYaml(): Promise<string>;
|
|
22
|
+
/** Release the database. The handle is unusable afterwards. */
|
|
23
|
+
close(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export interface PlanProject {
|
|
26
|
+
readonly key: string;
|
|
27
|
+
/** Live items, area then ref order, without bodies: a listing is an index. */
|
|
28
|
+
listItems(filter?: ItemFilter): Promise<ItemSummary[]>;
|
|
29
|
+
/** One item with its body, dependency refs and comments (newest first), or null when no item has that ref. */
|
|
30
|
+
getItem(ref: string): Promise<ItemDetail | null>;
|
|
31
|
+
createItem(input: NewItem): Promise<Item>;
|
|
32
|
+
/** Revise the title, body or dependencies (`deps` replaces the whole set). At least one must be given. */
|
|
33
|
+
editItem(ref: string, changes: ItemChanges): Promise<Item>;
|
|
34
|
+
setStatus(ref: string, status: string): Promise<Item>;
|
|
35
|
+
/** Comment on an item. Capped at 800 characters, as the tool is; a comment is always about an item (`CTX-15`). */
|
|
36
|
+
addComment(ref: string, body: string, options?: {
|
|
37
|
+
audience?: "user" | "agent";
|
|
38
|
+
}): Promise<Comment>;
|
|
39
|
+
/** Newest first. `ref` narrows to one item's comments; `null` to the older ones left on the project itself. */
|
|
40
|
+
listComments(options?: {
|
|
41
|
+
ref?: string | null;
|
|
42
|
+
audience?: "user" | "agent";
|
|
43
|
+
limit?: number;
|
|
44
|
+
}): Promise<Comment[]>;
|
|
45
|
+
/** A context section's markdown, or null when there is no section with that heading. */
|
|
46
|
+
getSection(heading: string): Promise<string | null>;
|
|
47
|
+
/** Create or replace a section. `after` places it after that heading, or first when `null`. */
|
|
48
|
+
setSection(heading: string, content: string, options?: {
|
|
49
|
+
after?: string | null;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
/** Full-text search over items, comments and sections, best first. */
|
|
52
|
+
search(query: string, options?: {
|
|
53
|
+
limit?: number;
|
|
54
|
+
}): Promise<SearchResult>;
|
|
55
|
+
}
|
|
56
|
+
export interface ProjectInfo {
|
|
57
|
+
key: string;
|
|
58
|
+
name: string;
|
|
59
|
+
/** Open vocabulary: "software", "learning", ... */
|
|
60
|
+
type: string;
|
|
61
|
+
direction: string | null;
|
|
62
|
+
}
|
|
63
|
+
export interface NewProject {
|
|
64
|
+
key: string;
|
|
65
|
+
name: string;
|
|
66
|
+
type: string;
|
|
67
|
+
direction?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ItemFilter {
|
|
70
|
+
area?: string;
|
|
71
|
+
status?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface ItemSummary {
|
|
74
|
+
/** The human ref, `AREA-3` or dotted `AREA-3.1` for a child. */
|
|
75
|
+
ref: string;
|
|
76
|
+
/** The ref's prefix. */
|
|
77
|
+
area: string;
|
|
78
|
+
/** The parent's ref for a dotted ref, otherwise null. Nesting is derived from the ref, never set apart from it. */
|
|
79
|
+
parent: string | null;
|
|
80
|
+
title: string;
|
|
81
|
+
status: string;
|
|
82
|
+
createdAt: string;
|
|
83
|
+
updatedAt: string;
|
|
84
|
+
closedAt: string | null;
|
|
85
|
+
/** Planned days, `YYYY-MM-DD`. */
|
|
86
|
+
start: string | null;
|
|
87
|
+
due: string | null;
|
|
88
|
+
}
|
|
89
|
+
export interface Item extends ItemSummary {
|
|
90
|
+
/** Markdown. Empty when the item has none. */
|
|
91
|
+
body: string;
|
|
92
|
+
}
|
|
93
|
+
export interface ItemDetail extends Item {
|
|
94
|
+
/** Refs this item depends on. */
|
|
95
|
+
deps: string[];
|
|
96
|
+
comments: Comment[];
|
|
97
|
+
}
|
|
98
|
+
export interface NewItem {
|
|
99
|
+
/** The ref prefix to allocate the next ref under. Optional when `ref` or `parent` implies it. */
|
|
100
|
+
area?: string;
|
|
101
|
+
/** An exact ref to take, rather than the next one. */
|
|
102
|
+
ref?: string;
|
|
103
|
+
/** Create beneath this ref, as its next child. */
|
|
104
|
+
parent?: string;
|
|
105
|
+
title: string;
|
|
106
|
+
body?: string;
|
|
107
|
+
/** Defaults to `to-do`. */
|
|
108
|
+
status?: string;
|
|
109
|
+
deps?: string[];
|
|
110
|
+
}
|
|
111
|
+
export interface ItemChanges {
|
|
112
|
+
title?: string;
|
|
113
|
+
body?: string;
|
|
114
|
+
deps?: string[];
|
|
115
|
+
}
|
|
116
|
+
export interface Comment {
|
|
117
|
+
id: string;
|
|
118
|
+
/** The item it is on, or null for a comment on the project itself. */
|
|
119
|
+
ref: string | null;
|
|
120
|
+
body: string;
|
|
121
|
+
audience: string;
|
|
122
|
+
actor: string;
|
|
123
|
+
at: string;
|
|
124
|
+
}
|
|
125
|
+
export interface SearchHit {
|
|
126
|
+
source: "item" | "comment" | "context";
|
|
127
|
+
/** The item the hit is about (its own ref, or the item a comment is on); null for the project's own. */
|
|
128
|
+
ref: string | null;
|
|
129
|
+
/** How to address the thing itself: a ref, a comment id, a section heading. */
|
|
130
|
+
id: string;
|
|
131
|
+
/** An item's title or a section's heading; null for a comment. */
|
|
132
|
+
title: string | null;
|
|
133
|
+
/** Matched fragments, terms wrapped in `**`. Quotes the text it matched, so treat it as that text. */
|
|
134
|
+
snippet: string;
|
|
135
|
+
rank: number;
|
|
136
|
+
audience: string | null;
|
|
137
|
+
at: string;
|
|
138
|
+
}
|
|
139
|
+
export interface SearchResult {
|
|
140
|
+
hits: SearchHit[];
|
|
141
|
+
/** True when nothing held every term and the search fell back to any of them. */
|
|
142
|
+
relaxed: boolean;
|
|
143
|
+
}
|
|
144
|
+
/** Open a plan from its YAML text. See `PlanOptions` for where changes go. */
|
|
145
|
+
export declare function openPlan(options?: PlanOptions): Promise<Plan>;
|