@frockbot/plugin-package-publisher 0.3.1 → 0.3.3
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 +9 -3
- package/src/agent.ts +3 -0
- package/src/backend.ts +14 -0
- package/src/client/index.ts +11 -0
- package/src/user.ts +24 -0
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.3",
|
|
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.3",
|
|
27
|
+
"@frockbot/plugin-prompt": "0.3.3",
|
|
28
|
+
"@frockbot/plugin-tools": "0.3.3",
|
|
29
|
+
"@frockbot/client-core": "0.3.3",
|
|
30
|
+
"@frockbot/client-ui": "0.3.3",
|
|
31
|
+
"@frockbot/plugin-shell": "0.3.3",
|
|
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.3",
|
|
37
|
+
"@frockbot/plugin-testkit": "0.3.3",
|
|
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
|
@@ -46,7 +46,11 @@ async function execute(
|
|
|
46
46
|
signal: new AbortController().signal,
|
|
47
47
|
};
|
|
48
48
|
const prepared = await tools.prepare(
|
|
49
|
-
{
|
|
49
|
+
{
|
|
50
|
+
id: crypto.randomUUID(),
|
|
51
|
+
name: "call_dynamic_tool",
|
|
52
|
+
input: { namespace: "frockbot", toolName: name, arguments: input },
|
|
53
|
+
},
|
|
50
54
|
context,
|
|
51
55
|
);
|
|
52
56
|
if (prepared.kind !== "ready") throw new Error("tool was denied");
|
|
@@ -118,7 +122,7 @@ describe("Package Publisher Agent contribution", () => {
|
|
|
118
122
|
|
|
119
123
|
expect(
|
|
120
124
|
harness.root.tools.schemas({ turnType: "chat" }).map((tool) => tool.name),
|
|
121
|
-
).toEqual(["
|
|
125
|
+
).toEqual(["get_dynamic_tools", "call_dynamic_tool"]);
|
|
122
126
|
expect(
|
|
123
127
|
JSON.parse(
|
|
124
128
|
(await execute(harness.root.tools, "list_setup_revisions", {})).content,
|
|
@@ -146,7 +150,9 @@ describe("Package Publisher Agent contribution", () => {
|
|
|
146
150
|
});
|
|
147
151
|
|
|
148
152
|
await fiber.dispose();
|
|
149
|
-
expect(
|
|
153
|
+
expect(
|
|
154
|
+
harness.root.tools.schemas({ turnType: "chat" }).map((tool) => tool.name),
|
|
155
|
+
).toEqual(["get_dynamic_tools", "call_dynamic_tool"]);
|
|
150
156
|
await harness.dispose();
|
|
151
157
|
});
|
|
152
158
|
|
package/src/agent.ts
CHANGED
|
@@ -99,6 +99,7 @@ export function createPackagePublisherAgentPlugin(
|
|
|
99
99
|
const plugin: Plugin.Function = (ctx) => {
|
|
100
100
|
const list: ToolDefinition = {
|
|
101
101
|
name: "list_setup_revisions",
|
|
102
|
+
namespace: "frockbot",
|
|
102
103
|
// A general work tool: `executor` reach only.
|
|
103
104
|
admission: { subagentRoles: ["executor"] },
|
|
104
105
|
description:
|
|
@@ -123,6 +124,7 @@ export function createPackagePublisherAgentPlugin(
|
|
|
123
124
|
};
|
|
124
125
|
const publish: ToolDefinition = {
|
|
125
126
|
name: "publish_setup",
|
|
127
|
+
namespace: "frockbot",
|
|
126
128
|
// A general work tool: `executor` reach only.
|
|
127
129
|
admission: { subagentRoles: ["executor"] },
|
|
128
130
|
description: `Publish and activate the tested Git setup in ${SETUP_DIRECTORY}. The committed source is archived from HEAD, the built application is read from ${SETUP_APPLICATION_FILE}, and all required check results must be provided. This affects all Bots owned by the User.`,
|
|
@@ -217,6 +219,7 @@ export function createPackagePublisherAgentPlugin(
|
|
|
217
219
|
};
|
|
218
220
|
const rollback: ToolDefinition = {
|
|
219
221
|
name: "rollback_setup",
|
|
222
|
+
namespace: "frockbot",
|
|
220
223
|
// A general work tool: `executor` reach only.
|
|
221
224
|
admission: { subagentRoles: ["executor"] },
|
|
222
225
|
description:
|
package/src/backend.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
type PackageRevisionHistoryV1,
|
|
8
8
|
type RollbackPackageCommandV1,
|
|
9
9
|
} from "./shared.js";
|
|
10
|
+
import { defineGatewayContribution } from "@frockbot/kernel-contracts/contributions";
|
|
10
11
|
|
|
11
12
|
export interface PackagePublisherGatewayHost {
|
|
12
13
|
read(userId: string): Promise<PackageRevisionHistoryV1>;
|
|
@@ -123,3 +124,16 @@ export namespace createPackagePublisherBackendContribution {
|
|
|
123
124
|
lifecycle.mount(createPackagePublisherBackendContribution(host));
|
|
124
125
|
}
|
|
125
126
|
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The manifest's gateway `backend` entry, resolved by specifier. The
|
|
130
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
131
|
+
* branches on which Package it belongs to.
|
|
132
|
+
*/
|
|
133
|
+
export const backendContribution = defineGatewayContribution<
|
|
134
|
+
PackagePublisherGatewayHost,
|
|
135
|
+
PackagePublisherBackendRouteContribution
|
|
136
|
+
>({
|
|
137
|
+
specifier: "@frockbot/plugin-package-publisher/backend",
|
|
138
|
+
create: createPackagePublisherBackendContribution.plugin,
|
|
139
|
+
});
|
package/src/client/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
packagePublisherStateKey,
|
|
17
17
|
type PackagePublisherClientState,
|
|
18
18
|
} from "./state.js";
|
|
19
|
+
import { defineClientContribution } from "@frockbot/kernel-contracts/contributions";
|
|
19
20
|
|
|
20
21
|
export const packagePublisherClientPlugin: ClientPlugin = (ctx) => {
|
|
21
22
|
const surfaces = ctx.inject(clientSurfaceRegistryKey);
|
|
@@ -82,3 +83,13 @@ export const packagePublisherClientPlugin: ClientPlugin = (ctx) => {
|
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
export default packagePublisherClientPlugin;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The manifest's `client` entry, resolved by specifier. The application looks
|
|
89
|
+
* this descriptor up in its Contribution table; it never branches on which
|
|
90
|
+
* Package it belongs to.
|
|
91
|
+
*/
|
|
92
|
+
export const clientContribution = defineClientContribution<ClientPlugin>({
|
|
93
|
+
specifier: "@frockbot/plugin-package-publisher/client",
|
|
94
|
+
plugin: packagePublisherClientPlugin,
|
|
95
|
+
});
|
package/src/user.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type PublishPackageCommandV1,
|
|
12
12
|
type RollbackPackageCommandV1,
|
|
13
13
|
} from "./shared.js";
|
|
14
|
+
import { defineUserBackendContribution } from "@frockbot/kernel-contracts/contributions";
|
|
14
15
|
|
|
15
16
|
const STATE_KEY = "package-publisher:state:v1";
|
|
16
17
|
const RECEIPT_PREFIX = "package-publisher:receipt:";
|
|
@@ -470,3 +471,26 @@ export function createPackagePublisherUserPlugin(
|
|
|
470
471
|
): Plugin {
|
|
471
472
|
return () => lifecycle.mount(createPackagePublisherUserContribution(host));
|
|
472
473
|
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* What an application hands this Contribution: Package publication, under the
|
|
477
|
+
* Package's own key so one wide host object can satisfy every Package's slice
|
|
478
|
+
* without their fields colliding.
|
|
479
|
+
*/
|
|
480
|
+
export interface PackagePublisherUserApplicationHostV1 {
|
|
481
|
+
packagePublisher: PackagePublisherUserHost;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* The manifest's `user` entry, resolved by specifier. The
|
|
486
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
487
|
+
* branches on which Package it belongs to.
|
|
488
|
+
*/
|
|
489
|
+
export const userContribution = defineUserBackendContribution<
|
|
490
|
+
PackagePublisherUserApplicationHostV1,
|
|
491
|
+
PackagePublisherUserContribution
|
|
492
|
+
>({
|
|
493
|
+
specifier: "@frockbot/plugin-package-publisher/user",
|
|
494
|
+
create: (host, lifecycle) =>
|
|
495
|
+
createPackagePublisherUserPlugin(host.packagePublisher, lifecycle),
|
|
496
|
+
});
|