opencode-courier 0.12.0 → 0.13.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 +9 -8
- package/dist/index.js +7 -3
- package/dist/kernel/protocol.d.ts +2 -0
- package/dist/kernel/protocol.js +4 -0
- package/dist/memory/events.js +3 -1
- package/dist/memory/index.d.ts +2 -1
- package/dist/memory/index.js +2 -1
- package/dist/memory/lessons.d.ts +12 -0
- package/dist/memory/lessons.js +56 -0
- package/dist/memory/note.js +3 -0
- package/dist/memory/ports.d.ts +3 -1
- package/dist/memory/text.d.ts +11 -0
- package/dist/memory/text.js +22 -1
- package/dist/person/events.js +4 -1
- package/dist/person/permission.d.ts +1 -1
- package/dist/person/permission.js +1 -1
- package/dist/person/question/answer.d.ts +1 -1
- package/dist/person/question/answer.js +1 -1
- package/dist/person/question/lifecycle.d.ts +1 -1
- package/dist/person/question/lifecycle.js +1 -1
- package/dist/person/question/relay.js +1 -1
- package/dist/platform/events.d.ts +10 -2
- package/dist/platform/events.js +38 -8
- package/dist/skill.js +56 -59
- package/dist/tree/cleanup.js +2 -0
- package/dist/tree/context.d.ts +2 -2
- package/dist/tree/context.js +26 -10
- package/dist/tree/domain.d.ts +12 -0
- package/dist/tree/domain.js +10 -0
- package/dist/tree/events.js +21 -1
- package/dist/tree/group.js +3 -0
- package/dist/tree/index.d.ts +1 -1
- package/dist/tree/ports.d.ts +47 -7
- package/dist/tree/roster.d.ts +3 -11
- package/dist/tree/roster.js +4 -10
- package/dist/tree/send.js +46 -19
- package/dist/tree/spawn.js +57 -3
- package/dist/tree/standing.d.ts +17 -0
- package/dist/tree/standing.js +90 -0
- package/dist/tree/status.d.ts +3 -3
- package/dist/tree/status.js +4 -4
- package/dist/tree/stop.js +3 -0
- package/dist/tree/store.js +4 -2
- package/dist/tree/text.d.ts +37 -6
- package/dist/tree/text.js +74 -8
- package/dist/tree/tools.d.ts +0 -3
- package/dist/tree/tools.js +6 -19
- package/package.json +6 -6
package/dist/tree/tools.js
CHANGED
|
@@ -4,10 +4,10 @@ import { rethrow } from "../kernel/tool.js";
|
|
|
4
4
|
import { cleanup } from "./cleanup.js";
|
|
5
5
|
import { send } from "./send.js";
|
|
6
6
|
import { spawn } from "./spawn.js";
|
|
7
|
-
import { listChildren
|
|
7
|
+
import { listChildren } from "./status.js";
|
|
8
8
|
import { stop } from "./stop.js";
|
|
9
9
|
import { tree } from "./subtree.js";
|
|
10
|
-
import { childrenText, cleanupText, sendText, spawnText,
|
|
10
|
+
import { childrenText, cleanupText, sendText, spawnText, stopText, treeText } from "./text.js";
|
|
11
11
|
/**
|
|
12
12
|
* The tree's courier tools: their input schemas, descriptions, and what each returns. The descriptions are
|
|
13
13
|
* model-facing like the texts in `text.ts`, and snapshotted with them in `test/notices.test.ts`.
|
|
@@ -61,9 +61,6 @@ export const SendInput = Schema.Struct({
|
|
|
61
61
|
}).annotate({ description: "With a report: what you produced, listed in the message after your text in a fixed layout." })),
|
|
62
62
|
queue: Schema.optional(Schema.Boolean.annotate({ description: "Wait until the target's current turn ends instead of steering it now." })),
|
|
63
63
|
});
|
|
64
|
-
export const StatusInput = Schema.Struct({
|
|
65
|
-
sessionID: Schema.String.annotate({ description: "The session to look at." }),
|
|
66
|
-
});
|
|
67
64
|
export const ChildrenInput = Schema.Struct({
|
|
68
65
|
sessionID: Schema.optional(Schema.String.annotate({ description: "The session whose children to list; defaults to this one." })),
|
|
69
66
|
});
|
|
@@ -92,7 +89,7 @@ export function addTreeTools(tools, ports) {
|
|
|
92
89
|
"variant (reasoning effort) fit for the task. The session reports " +
|
|
93
90
|
"back with courier_send, which wakes this session, and you are told if its turn fails or ends without a report " +
|
|
94
91
|
"instead, it waits for a permission or it asks a question. Give a batch of parallel sessions one group name to " +
|
|
95
|
-
"be woken once, with all their reports, instead of once per report. DO NOT poll it or call
|
|
92
|
+
"be woken once, with all their reports, instead of once per report. DO NOT poll it or call courier_children in a " +
|
|
96
93
|
"loop: once you have started the sessions you need, end your turn by replying without calling more tools; each " +
|
|
97
94
|
"report, or each group's reports, starts a new turn in which you carry on. For long tasks, also courier_later a " +
|
|
98
95
|
"check-in for yourself in case it never reports, and courier_cancel it when it does.",
|
|
@@ -108,7 +105,8 @@ export function addTreeTools(tools, ports) {
|
|
|
108
105
|
description: "Deliver a message to another OpenCode session. If that session is idle, OpenCode starts a new turn for it. " +
|
|
109
106
|
"Use it to report back to the session that started you, with a status (done, partial, blocked or failed) and " +
|
|
110
107
|
"the artifacts you produced, or to steer a session you started. The status is carried as an attribute of the " +
|
|
111
|
-
"message; without one, a message to the session that started you is progress, not your report.
|
|
108
|
+
"message; without one, a message to the session that started you is progress, not your report. A message to a " +
|
|
109
|
+
"session you started carries no status: one given is dropped. If you were " +
|
|
112
110
|
"started in a group, a report with status done, partial or failed is held and delivered with the group's other " +
|
|
113
111
|
"reports; the result says so, and nothing more is needed from you.",
|
|
114
112
|
input: SendInput,
|
|
@@ -117,23 +115,12 @@ export function addTreeTools(tools, ports) {
|
|
|
117
115
|
return { content: sendText(input.sessionID, delivered), metadata: delivered };
|
|
118
116
|
},
|
|
119
117
|
});
|
|
120
|
-
tools.add({
|
|
121
|
-
name: "courier_status",
|
|
122
|
-
options: { codemode: false },
|
|
123
|
-
description: "Look once at a session's state and its last reply, e.g. on a scheduled check-in. Not for waiting: " +
|
|
124
|
-
"sessions you started report back on their own.",
|
|
125
|
-
input: StatusInput,
|
|
126
|
-
execute: async (input) => {
|
|
127
|
-
const result = await status(ports.courier, input).catch(rethrow("courier_status"));
|
|
128
|
-
return { content: statusText(result), metadata: result };
|
|
129
|
-
},
|
|
130
|
-
});
|
|
131
118
|
tools.add({
|
|
132
119
|
name: "courier_children",
|
|
133
120
|
options: { codemode: false },
|
|
134
121
|
description: "List the sessions this one started with courier_spawn, with each one's state and last reply, and for one " +
|
|
135
122
|
"started in a group, its group and whether its report is held, still out, or released, e.g. after a " +
|
|
136
|
-
"compaction or restart.
|
|
123
|
+
"compaction or restart. For a one-off look, e.g. on a scheduled check-in, not for waiting: sessions you started report back on their own.",
|
|
137
124
|
input: ChildrenInput,
|
|
138
125
|
execute: async (input, context) => {
|
|
139
126
|
const listed = await listChildren(ports.courier, input.sessionID || context.sessionID).catch(rethrow("courier_children"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-courier",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Multi-session orchestration for OpenCode V2: spawn child sessions, be woken by them. No polling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Ivo Pogace <71701666+ivopogace@users.noreply.github.com>",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"test:e2e": "e2e/run.sh"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@opencode/plugin": "2.
|
|
59
|
+
"@opencode/plugin": "2.2.0",
|
|
60
60
|
"effect": "4.0.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@opencode/plugin": "2.
|
|
64
|
-
"@opencode/theme": "2.
|
|
65
|
-
"@opentui/core": "0.
|
|
66
|
-
"@opentui/solid": "0.
|
|
63
|
+
"@opencode/plugin": "2.2.0",
|
|
64
|
+
"@opencode/theme": "2.2.0",
|
|
65
|
+
"@opentui/core": "0.7.0",
|
|
66
|
+
"@opentui/solid": "0.7.0",
|
|
67
67
|
"@types/bun": "1.4.2",
|
|
68
68
|
"@types/node": "26.6.4",
|
|
69
69
|
"effect": "4.0.1",
|