opencode-courier 0.7.3 → 0.9.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 (57) hide show
  1. package/README.md +119 -136
  2. package/dist/index.js +23 -4
  3. package/dist/kernel/protocol.d.ts +2 -0
  4. package/dist/kernel/protocol.js +9 -1
  5. package/dist/memory/domain.d.ts +188 -0
  6. package/dist/memory/domain.js +209 -0
  7. package/dist/memory/events.d.ts +26 -0
  8. package/dist/memory/events.js +46 -0
  9. package/dist/memory/forget.d.ts +10 -0
  10. package/dist/memory/forget.js +20 -0
  11. package/dist/memory/index.d.ts +11 -0
  12. package/dist/memory/index.js +12 -0
  13. package/dist/memory/note.d.ts +37 -0
  14. package/dist/memory/note.js +29 -0
  15. package/dist/memory/pin.d.ts +8 -0
  16. package/dist/memory/pin.js +13 -0
  17. package/dist/memory/ports.d.ts +55 -0
  18. package/dist/memory/ports.js +1 -0
  19. package/dist/memory/recall.d.ts +27 -0
  20. package/dist/memory/recall.js +67 -0
  21. package/dist/memory/record.d.ts +7 -0
  22. package/dist/memory/record.js +124 -0
  23. package/dist/memory/rpc-handlers.d.ts +179 -0
  24. package/dist/memory/rpc-handlers.js +25 -0
  25. package/dist/memory/rpc.d.ts +299 -0
  26. package/dist/memory/rpc.js +71 -0
  27. package/dist/memory/store.d.ts +14 -0
  28. package/dist/memory/store.js +174 -0
  29. package/dist/memory/sweep.d.ts +7 -0
  30. package/dist/memory/sweep.js +16 -0
  31. package/dist/memory/text.d.ts +35 -0
  32. package/dist/memory/text.js +116 -0
  33. package/dist/memory/tools.d.ts +16 -0
  34. package/dist/memory/tools.js +78 -0
  35. package/dist/memory/tui.d.ts +82 -0
  36. package/dist/person/rpc.d.ts +4 -4
  37. package/dist/platform/json.d.ts +1 -0
  38. package/dist/platform/json.js +1 -0
  39. package/dist/rpc.d.ts +1 -0
  40. package/dist/rpc.js +1 -0
  41. package/dist/skill.js +10 -3
  42. package/dist/tree/context.d.ts +2 -2
  43. package/dist/tree/context.js +4 -3
  44. package/dist/tree/index.d.ts +6 -5
  45. package/dist/tree/index.js +5 -4
  46. package/dist/tree/mascot.js +1 -1
  47. package/dist/tree/ports.d.ts +4 -2
  48. package/dist/tree/roster.d.ts +17 -0
  49. package/dist/tree/roster.js +24 -0
  50. package/dist/tree/rpc-handlers.d.ts +20 -20
  51. package/dist/tree/rpc.d.ts +20 -20
  52. package/dist/tree/status.d.ts +5 -5
  53. package/dist/tree/subtree.d.ts +2 -2
  54. package/dist/tree/text.js +2 -1
  55. package/dist/tree/tui.d.ts +11 -3
  56. package/dist/tui.js +612 -123
  57. package/package.json +1 -1
@@ -56,11 +56,11 @@ export declare function registerTreeRpc(rpc: Pick<Plugin.Context["rpc"], "regist
56
56
  readonly rows: readonly {
57
57
  readonly sessionID: string;
58
58
  readonly title: string;
59
- readonly parentID: string;
60
59
  readonly depth: number;
61
- readonly created: number;
62
60
  readonly isolated: boolean;
63
- readonly state: "running" | "idle" | "gone" | "stalled" | "waiting";
61
+ readonly parentID: string;
62
+ readonly created: number;
63
+ readonly state: "gone" | "stalled" | "running" | "idle" | "waiting";
64
64
  readonly waits: readonly ({
65
65
  readonly type: "permission";
66
66
  readonly action: string;
@@ -72,25 +72,25 @@ export declare function registerTreeRpc(rpc: Pick<Plugin.Context["rpc"], "regist
72
72
  readonly type: "form";
73
73
  readonly title: string;
74
74
  })[];
75
+ readonly stopped?: boolean | undefined;
76
+ readonly stalled?: number | undefined;
75
77
  readonly group?: {
76
78
  readonly name: string;
77
79
  readonly standing: string;
78
80
  } | undefined;
79
- readonly stopped?: boolean | undefined;
81
+ readonly cost?: number | undefined;
80
82
  readonly context?: number | undefined;
81
- readonly idle?: number | undefined;
83
+ readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
82
84
  readonly report?: {
83
85
  readonly progressed: boolean;
84
- readonly state: "reported" | "ended" | "owed";
86
+ readonly state: "ended" | "reported" | "owed";
85
87
  readonly status?: string | undefined;
86
88
  } | undefined;
87
- readonly stalled?: number | undefined;
88
- readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
89
+ readonly idle?: number | undefined;
89
90
  readonly tool?: {
90
91
  readonly name: string;
91
92
  readonly at: number;
92
93
  } | undefined;
93
- readonly cost?: number | undefined;
94
94
  }[];
95
95
  readonly stalled?: number | undefined;
96
96
  readonly truncated?: number | undefined;
@@ -98,11 +98,11 @@ export declare function registerTreeRpc(rpc: Pick<Plugin.Context["rpc"], "regist
98
98
  readonly rows: readonly {
99
99
  readonly sessionID: string;
100
100
  readonly title: string;
101
- readonly parentID: string;
102
101
  readonly depth: number;
103
- readonly created: number;
104
102
  readonly isolated: boolean;
105
- readonly state: "running" | "idle" | "gone" | "stalled" | "waiting";
103
+ readonly parentID: string;
104
+ readonly created: number;
105
+ readonly state: "gone" | "stalled" | "running" | "idle" | "waiting";
106
106
  readonly waits: readonly ({
107
107
  readonly type: "permission";
108
108
  readonly action: string;
@@ -114,25 +114,25 @@ export declare function registerTreeRpc(rpc: Pick<Plugin.Context["rpc"], "regist
114
114
  readonly type: "form";
115
115
  readonly title: string;
116
116
  })[];
117
+ readonly stopped?: boolean | undefined;
118
+ readonly stalled?: number | undefined;
117
119
  readonly group?: {
118
120
  readonly name: string;
119
121
  readonly standing: string;
120
122
  } | undefined;
121
- readonly stopped?: boolean | undefined;
123
+ readonly cost?: number | undefined;
122
124
  readonly context?: number | undefined;
123
- readonly idle?: number | undefined;
125
+ readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
124
126
  readonly report?: {
125
127
  readonly progressed: boolean;
126
- readonly state: "reported" | "ended" | "owed";
128
+ readonly state: "ended" | "reported" | "owed";
127
129
  readonly status?: string | undefined;
128
130
  } | undefined;
129
- readonly stalled?: number | undefined;
130
- readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
131
+ readonly idle?: number | undefined;
131
132
  readonly tool?: {
132
133
  readonly name: string;
133
134
  readonly at: number;
134
135
  } | undefined;
135
- readonly cost?: number | undefined;
136
136
  }[];
137
137
  readonly stalled?: number | undefined;
138
138
  readonly truncated?: number | undefined;
@@ -229,12 +229,12 @@ export declare function registerTreeRpc(rpc: Pick<Plugin.Context["rpc"], "regist
229
229
  readonly by: import("effect/Schema").String;
230
230
  }>;
231
231
  readonly output: import("effect/StandardSchema").StandardSchemaV1<{
232
- readonly outcome: "removed" | "gone" | "forgotten";
232
+ readonly outcome: "gone" | "removed" | "forgotten";
233
233
  } | {
234
234
  readonly outcome: "kept";
235
235
  readonly reason: string;
236
236
  }, {
237
- readonly outcome: "removed" | "gone" | "forgotten";
237
+ readonly outcome: "gone" | "removed" | "forgotten";
238
238
  } | {
239
239
  readonly outcome: "kept";
240
240
  readonly reason: string;
@@ -223,11 +223,11 @@ export declare const treeRpc: {
223
223
  readonly rows: readonly {
224
224
  readonly sessionID: string;
225
225
  readonly title: string;
226
- readonly parentID: string;
227
226
  readonly depth: number;
228
- readonly created: number;
229
227
  readonly isolated: boolean;
230
- readonly state: "running" | "idle" | "gone" | "stalled" | "waiting";
228
+ readonly parentID: string;
229
+ readonly created: number;
230
+ readonly state: "gone" | "stalled" | "running" | "idle" | "waiting";
231
231
  readonly waits: readonly ({
232
232
  readonly type: "permission";
233
233
  readonly action: string;
@@ -239,25 +239,25 @@ export declare const treeRpc: {
239
239
  readonly type: "form";
240
240
  readonly title: string;
241
241
  })[];
242
+ readonly stopped?: boolean | undefined;
243
+ readonly stalled?: number | undefined;
242
244
  readonly group?: {
243
245
  readonly name: string;
244
246
  readonly standing: string;
245
247
  } | undefined;
246
- readonly stopped?: boolean | undefined;
248
+ readonly cost?: number | undefined;
247
249
  readonly context?: number | undefined;
248
- readonly idle?: number | undefined;
250
+ readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
249
251
  readonly report?: {
250
252
  readonly progressed: boolean;
251
- readonly state: "reported" | "ended" | "owed";
253
+ readonly state: "ended" | "reported" | "owed";
252
254
  readonly status?: string | undefined;
253
255
  } | undefined;
254
- readonly stalled?: number | undefined;
255
- readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
256
+ readonly idle?: number | undefined;
256
257
  readonly tool?: {
257
258
  readonly name: string;
258
259
  readonly at: number;
259
260
  } | undefined;
260
- readonly cost?: number | undefined;
261
261
  }[];
262
262
  readonly stalled?: number | undefined;
263
263
  readonly truncated?: number | undefined;
@@ -265,11 +265,11 @@ export declare const treeRpc: {
265
265
  readonly rows: readonly {
266
266
  readonly sessionID: string;
267
267
  readonly title: string;
268
- readonly parentID: string;
269
268
  readonly depth: number;
270
- readonly created: number;
271
269
  readonly isolated: boolean;
272
- readonly state: "running" | "idle" | "gone" | "stalled" | "waiting";
270
+ readonly parentID: string;
271
+ readonly created: number;
272
+ readonly state: "gone" | "stalled" | "running" | "idle" | "waiting";
273
273
  readonly waits: readonly ({
274
274
  readonly type: "permission";
275
275
  readonly action: string;
@@ -281,25 +281,25 @@ export declare const treeRpc: {
281
281
  readonly type: "form";
282
282
  readonly title: string;
283
283
  })[];
284
+ readonly stopped?: boolean | undefined;
285
+ readonly stalled?: number | undefined;
284
286
  readonly group?: {
285
287
  readonly name: string;
286
288
  readonly standing: string;
287
289
  } | undefined;
288
- readonly stopped?: boolean | undefined;
290
+ readonly cost?: number | undefined;
289
291
  readonly context?: number | undefined;
290
- readonly idle?: number | undefined;
292
+ readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
291
293
  readonly report?: {
292
294
  readonly progressed: boolean;
293
- readonly state: "reported" | "ended" | "owed";
295
+ readonly state: "ended" | "reported" | "owed";
294
296
  readonly status?: string | undefined;
295
297
  } | undefined;
296
- readonly stalled?: number | undefined;
297
- readonly outcome?: "failed" | "interrupted" | "succeeded" | undefined;
298
+ readonly idle?: number | undefined;
298
299
  readonly tool?: {
299
300
  readonly name: string;
300
301
  readonly at: number;
301
302
  } | undefined;
302
- readonly cost?: number | undefined;
303
303
  }[];
304
304
  readonly stalled?: number | undefined;
305
305
  readonly truncated?: number | undefined;
@@ -415,12 +415,12 @@ export declare const treeRpc: {
415
415
  readonly by: Schema.String;
416
416
  }>;
417
417
  readonly output: import("effect/StandardSchema").StandardSchemaV1<{
418
- readonly outcome: "removed" | "gone" | "forgotten";
418
+ readonly outcome: "gone" | "removed" | "forgotten";
419
419
  } | {
420
420
  readonly outcome: "kept";
421
421
  readonly reason: string;
422
422
  }, {
423
- readonly outcome: "removed" | "gone" | "forgotten";
423
+ readonly outcome: "gone" | "removed" | "forgotten";
424
424
  } | {
425
425
  readonly outcome: "kept";
426
426
  readonly reason: string;
@@ -27,7 +27,7 @@ export declare function lastReply(messages: Awaited<ReturnType<Context["session"
27
27
  export declare function listChildren(ports: CourierPorts, parentID: string): Promise<({
28
28
  group: {
29
29
  name: string;
30
- report: "failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown";
30
+ report: "failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released";
31
31
  };
32
32
  directory: string;
33
33
  isolated: boolean;
@@ -57,7 +57,7 @@ export declare function listChildren(ports: CourierPorts, parentID: string): Pro
57
57
  error: string;
58
58
  group: {
59
59
  name: string;
60
- report: "failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown";
60
+ report: "failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released";
61
61
  };
62
62
  directory: string;
63
63
  isolated: boolean;
@@ -77,7 +77,7 @@ export declare function listChildren(ports: CourierPorts, parentID: string): Pro
77
77
  export declare function described(ports: CourierPorts, entry: RosterEntry): Promise<{
78
78
  group: {
79
79
  name: string;
80
- report: "failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown";
80
+ report: "failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released";
81
81
  };
82
82
  directory: string;
83
83
  isolated: boolean;
@@ -107,7 +107,7 @@ export declare function described(ports: CourierPorts, entry: RosterEntry): Prom
107
107
  error: string;
108
108
  group: {
109
109
  name: string;
110
- report: "failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown";
110
+ report: "failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released";
111
111
  };
112
112
  directory: string;
113
113
  isolated: boolean;
@@ -124,5 +124,5 @@ export declare function described(ports: CourierPorts, entry: RosterEntry): Prom
124
124
  title: string;
125
125
  }>;
126
126
  /** A child's standing in the join group its roster entry names, `unknown` when that cannot be read. */
127
- export declare function standingIn(ports: Pick<CourierPorts, "storage">, entry: RosterEntry, group: string): Promise<"failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown">;
127
+ export declare function standingIn(ports: Pick<CourierPorts, "storage">, entry: RosterEntry, group: string): Promise<"failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released">;
128
128
  export {};
@@ -60,7 +60,7 @@ export declare function tree(ports: CourierPorts, rootID: string): Promise<{
60
60
  depth: number;
61
61
  group: {
62
62
  name: string;
63
- report: "failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown";
63
+ report: "failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released";
64
64
  };
65
65
  directory: string;
66
66
  isolated: boolean;
@@ -104,7 +104,7 @@ export declare function tree(ports: CourierPorts, rootID: string): Promise<{
104
104
  error: string;
105
105
  group: {
106
106
  name: string;
107
- report: "failed" | "interrupted" | "deleted" | "dropped" | "held" | "out" | "released" | "unknown";
107
+ report: "failed" | "interrupted" | "out" | "unknown" | "deleted" | "dropped" | "held" | "released";
108
108
  };
109
109
  directory: string;
110
110
  isolated: boolean;
package/dist/tree/text.js CHANGED
@@ -64,7 +64,8 @@ export function rolePart(depth, limits) {
64
64
  const budget = `At most ${maxChildren} of the sessions you start run at once, and ${maxTotal} in the whole tree.`;
65
65
  if (depth === null)
66
66
  return (`${ROLE_PREFIX} root, no sessions started yet. Before a task that touches several files or areas, load the ` +
67
- `${SKILL_ID} skill and decide whether to split it across sessions (doing it yourself is fine), and say ` +
67
+ `${SKILL_ID} skill, call courier_recall once for how earlier trees in this project were split and how they went, ` +
68
+ `and decide whether to split it across sessions (doing it yourself is fine), and say ` +
68
69
  `which in one line of your reply: ${SPLIT_LINE}`);
69
70
  if (depth === 0)
70
71
  return (`${ROLE_PREFIX} root orchestrator. You started sessions with courier_spawn, and they may start their own, ` +
@@ -148,13 +148,21 @@ export declare function restBackground(theme: Context["theme"], { selected, hove
148
148
  selected: boolean;
149
149
  hovered: boolean;
150
150
  }): RGBA | undefined;
151
- /** The usage the `/courier` command shows for an input it does not know. */
151
+ /** The usage the `/courier` command shows for an input it does not know, before the further verbs' lines. */
152
152
  export declare const USAGE = "/courier tree opens the session tree; /courier stop [session] stops a session and those under it";
153
+ /** A further verb of the `/courier` command, which another module's TUI part supplies: what it runs, and its line of the usage. */
154
+ export type Verb = {
155
+ readonly run: () => void;
156
+ readonly usage: string;
157
+ };
158
+ /** The usage with the further verbs' lines. */
159
+ export declare const usageWith: (verbs: Readonly<Record<string, Verb>>) => string;
153
160
  /**
154
161
  * Adds the tree panel to the `session.panel` slot, opened by `/courier tree` or the palette, which follows the person
155
- * between sessions until closed, and `/courier stop <session>`, which stops a session under the open one once confirmed.
162
+ * between sessions until closed, and `/courier stop <session>`, which stops a session under the open one once confirmed;
163
+ * `verbs` are the command's further verbs, by name.
156
164
  */
157
- export declare function addTreePanel(ctx: Context): () => void;
165
+ export declare function addTreePanel(ctx: Context, verbs?: Readonly<Record<string, Verb>>): () => void;
158
166
  /**
159
167
  * Draws the person's attention when reports arrive: a join group's reports, released to the session that started them,
160
168
  * and a child's report to its parent, with the `subagent_done` sound. Read from the courier's own delivery metadata.