@frockbot/plugin-package-publisher 0.3.8 → 0.3.10
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/package.json +9 -9
- package/src/agent.test.ts +72 -0
- package/src/agent.ts +17 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/plugin-package-publisher",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"typecheck": "vue-tsc --noEmit -p tsconfig.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@frockbot/kernel-contracts": "0.3.
|
|
27
|
-
"@frockbot/plugin-prompt": "0.3.
|
|
28
|
-
"@frockbot/plugin-tools": "0.3.
|
|
29
|
-
"@frockbot/client-core": "0.3.
|
|
30
|
-
"@frockbot/client-ui": "0.3.
|
|
31
|
-
"@frockbot/plugin-shell": "0.3.
|
|
26
|
+
"@frockbot/kernel-contracts": "0.3.10",
|
|
27
|
+
"@frockbot/plugin-prompt": "0.3.10",
|
|
28
|
+
"@frockbot/plugin-tools": "0.3.10",
|
|
29
|
+
"@frockbot/client-core": "0.3.10",
|
|
30
|
+
"@frockbot/client-ui": "0.3.10",
|
|
31
|
+
"@frockbot/plugin-shell": "0.3.10",
|
|
32
32
|
"cordis": "4.0.0-rc.8",
|
|
33
33
|
"vue": "3.5.41"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@frockbot/computer-core": "0.3.
|
|
37
|
-
"@frockbot/plugin-testkit": "0.3.
|
|
36
|
+
"@frockbot/computer-core": "0.3.10",
|
|
37
|
+
"@frockbot/plugin-testkit": "0.3.10",
|
|
38
38
|
"@types/bun": "1.4.0",
|
|
39
39
|
"@vitejs/plugin-vue": "6.0.8",
|
|
40
40
|
"typescript": "5.9.3",
|
package/src/agent.test.ts
CHANGED
|
@@ -156,6 +156,78 @@ describe("Package Publisher Agent contribution", () => {
|
|
|
156
156
|
await harness.dispose();
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
+
// A deployment with no Computer registers no Computer tool, so a prompt that
|
|
160
|
+
// still promises one sends the model hunting for a sandbox it cannot reach.
|
|
161
|
+
test("promises no Computer when the deployment has none", async () => {
|
|
162
|
+
const harness = await createPluginHarness([
|
|
163
|
+
ComputerRegistry,
|
|
164
|
+
SystemPromptRegistry,
|
|
165
|
+
ToolRegistry,
|
|
166
|
+
]);
|
|
167
|
+
const fiber = await harness.mount(
|
|
168
|
+
createPackagePublisherAgentPlugin(
|
|
169
|
+
{
|
|
170
|
+
read: () => Promise.resolve(history),
|
|
171
|
+
publish: () => {
|
|
172
|
+
throw new Error("not called");
|
|
173
|
+
},
|
|
174
|
+
rollback: () => {
|
|
175
|
+
throw new Error("not called");
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
userId: "user-1",
|
|
180
|
+
defaultProviderId: "fixture",
|
|
181
|
+
configured: false,
|
|
182
|
+
},
|
|
183
|
+
),
|
|
184
|
+
);
|
|
185
|
+
const prompt = await harness.root.systemPrompt.assemble({
|
|
186
|
+
sessionId: "session-1",
|
|
187
|
+
provider: "fixture",
|
|
188
|
+
model: "fixture",
|
|
189
|
+
turnType: "chat",
|
|
190
|
+
});
|
|
191
|
+
expect(prompt.text).not.toContain("Computer");
|
|
192
|
+
expect(prompt.text).not.toContain("/home/box");
|
|
193
|
+
// The Package Publisher still says what it does; only the Computer
|
|
194
|
+
// sentence goes.
|
|
195
|
+
expect(prompt.text).toContain("publish_setup");
|
|
196
|
+
await fiber.dispose();
|
|
197
|
+
await harness.dispose();
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
test("keeps the Computer sentence when a Computer is configured", async () => {
|
|
201
|
+
const harness = await createPluginHarness([
|
|
202
|
+
ComputerRegistry,
|
|
203
|
+
SystemPromptRegistry,
|
|
204
|
+
ToolRegistry,
|
|
205
|
+
]);
|
|
206
|
+
const fiber = await harness.mount(
|
|
207
|
+
createPackagePublisherAgentPlugin(
|
|
208
|
+
{
|
|
209
|
+
read: () => Promise.resolve(history),
|
|
210
|
+
publish: () => {
|
|
211
|
+
throw new Error("not called");
|
|
212
|
+
},
|
|
213
|
+
rollback: () => {
|
|
214
|
+
throw new Error("not called");
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
{ userId: "user-1", defaultProviderId: "fixture" },
|
|
218
|
+
),
|
|
219
|
+
);
|
|
220
|
+
const prompt = await harness.root.systemPrompt.assemble({
|
|
221
|
+
sessionId: "session-1",
|
|
222
|
+
provider: "fixture",
|
|
223
|
+
model: "fixture",
|
|
224
|
+
turnType: "chat",
|
|
225
|
+
});
|
|
226
|
+
expect(prompt.text).toContain("/home/box/setup using the Computer");
|
|
227
|
+
await fiber.dispose();
|
|
228
|
+
await harness.dispose();
|
|
229
|
+
});
|
|
230
|
+
|
|
159
231
|
test("satisfies built-in Package conventions", () => {
|
|
160
232
|
expect(verifyPluginPackage({ packageJson, manifest })).toMatchObject({
|
|
161
233
|
name: "@frockbot/plugin-package-publisher",
|
package/src/agent.ts
CHANGED
|
@@ -27,6 +27,17 @@ export interface PackagePublisherAgentHost {
|
|
|
27
27
|
export interface PackagePublisherAgentConfig {
|
|
28
28
|
userId: string;
|
|
29
29
|
defaultProviderId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Whether this deployment has a Computer at all.
|
|
32
|
+
*
|
|
33
|
+
* The Package Publisher's workspace lives on the Computer, so on a host with
|
|
34
|
+
* no Computer there is nothing true to say about editing a setup there. A
|
|
35
|
+
* prompt that promises a Computer the host does not have sends the model
|
|
36
|
+
* hunting for one and inventing a sandbox. `undefined` keeps the sentence,
|
|
37
|
+
* so a host that does not know either way behaves as before — the same
|
|
38
|
+
* convention `plugin-computer`'s `configured` uses.
|
|
39
|
+
*/
|
|
40
|
+
configured?: boolean;
|
|
30
41
|
}
|
|
31
42
|
|
|
32
43
|
async function executeText(
|
|
@@ -96,6 +107,7 @@ export function createPackagePublisherAgentPlugin(
|
|
|
96
107
|
if (!defaultProviderId) {
|
|
97
108
|
throw new Error("Package Publisher provider id must be non-empty");
|
|
98
109
|
}
|
|
110
|
+
const computerConfigured = config.configured !== false;
|
|
99
111
|
const plugin: Plugin.Function = (ctx) => {
|
|
100
112
|
const list: ToolDefinition = {
|
|
101
113
|
name: "list_setup_revisions",
|
|
@@ -257,7 +269,11 @@ export function createPackagePublisherAgentPlugin(
|
|
|
257
269
|
render: () =>
|
|
258
270
|
[
|
|
259
271
|
"## Editable setup",
|
|
260
|
-
|
|
272
|
+
...(computerConfigured
|
|
273
|
+
? [
|
|
274
|
+
`Edit and test the User's shared setup in ${SETUP_DIRECTORY} using the Computer.`,
|
|
275
|
+
]
|
|
276
|
+
: []),
|
|
261
277
|
`Publishing archives the current Git HEAD and reads ${SETUP_APPLICATION_FILE} from that fixed folder; file editing itself is not owned by the Package Publisher.`,
|
|
262
278
|
"Commit the intended source, run the setup's required checks, and call publish_setup only after they pass.",
|
|
263
279
|
].join("\n"),
|