@frockbot/architecture-checks 0.1.4 → 0.2.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/architecture-checks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Automated checks for the constitutional rules that can be enforced mechanically.",
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@frockbot/computer-core": "0.
|
|
13
|
-
"@frockbot/connection-core": "0.
|
|
14
|
-
"@frockbot/kernel-agent-loop": "0.
|
|
15
|
-
"@frockbot/kernel-composition": "0.
|
|
16
|
-
"@frockbot/kernel-contracts": "0.
|
|
17
|
-
"@frockbot/kernel-do": "0.
|
|
18
|
-
"@frockbot/plugin-authoring": "0.
|
|
19
|
-
"@frockbot/plugin-computer": "0.
|
|
20
|
-
"@frockbot/plugin-memory": "0.
|
|
21
|
-
"@frockbot/plugin-models": "0.
|
|
22
|
-
"@frockbot/plugin-prompt": "0.
|
|
23
|
-
"@frockbot/plugin-provider-foundation": "0.
|
|
24
|
-
"@frockbot/plugin-provider-ollama-cloud": "0.
|
|
25
|
-
"@frockbot/plugin-skills": "0.
|
|
26
|
-
"@frockbot/plugin-tools": "0.
|
|
12
|
+
"@frockbot/computer-core": "0.2.0",
|
|
13
|
+
"@frockbot/connection-core": "0.2.0",
|
|
14
|
+
"@frockbot/kernel-agent-loop": "0.2.0",
|
|
15
|
+
"@frockbot/kernel-composition": "0.2.0",
|
|
16
|
+
"@frockbot/kernel-contracts": "0.2.0",
|
|
17
|
+
"@frockbot/kernel-do": "0.2.0",
|
|
18
|
+
"@frockbot/plugin-authoring": "0.2.0",
|
|
19
|
+
"@frockbot/plugin-computer": "0.2.0",
|
|
20
|
+
"@frockbot/plugin-memory": "0.2.0",
|
|
21
|
+
"@frockbot/plugin-models": "0.2.0",
|
|
22
|
+
"@frockbot/plugin-prompt": "0.2.0",
|
|
23
|
+
"@frockbot/plugin-provider-foundation": "0.2.0",
|
|
24
|
+
"@frockbot/plugin-provider-ollama-cloud": "0.2.0",
|
|
25
|
+
"@frockbot/plugin-skills": "0.2.0",
|
|
26
|
+
"@frockbot/plugin-tools": "0.2.0",
|
|
27
27
|
"cordis": "4.0.0-rc.8"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -187,15 +187,9 @@ describe("package authority boundaries", () => {
|
|
|
187
187
|
packageId: "bot-tool",
|
|
188
188
|
displayName: "Bot Tool",
|
|
189
189
|
version: "0.0.1",
|
|
190
|
-
|
|
190
|
+
tools: [{ name: "do_it", description: "does it", inputSchema: {} }],
|
|
191
191
|
};
|
|
192
|
-
for (const manifest of [
|
|
193
|
-
authoredManifestV1(base),
|
|
194
|
-
authoredManifestV1({
|
|
195
|
-
...base,
|
|
196
|
-
model: { providerId: "foundation", modelId: "small" },
|
|
197
|
-
}),
|
|
198
|
-
]) {
|
|
192
|
+
for (const manifest of [authoredManifestV1(base)]) {
|
|
199
193
|
const contributions = manifest.contributions as Record<string, unknown>;
|
|
200
194
|
expect(Object.keys(contributions).sort()).toEqual(
|
|
201
195
|
expect.arrayContaining(["runtime"]),
|
|
@@ -208,11 +202,7 @@ describe("package authority boundaries", () => {
|
|
|
208
202
|
},
|
|
209
203
|
);
|
|
210
204
|
}
|
|
211
|
-
expect(
|
|
212
|
-
Object.keys(contributions).every((kind) =>
|
|
213
|
-
["runtime", "model"].includes(kind),
|
|
214
|
-
),
|
|
215
|
-
).toBe(true);
|
|
205
|
+
expect(Object.keys(contributions)).toEqual(["runtime"]);
|
|
216
206
|
const serialized = JSON.stringify(manifest);
|
|
217
207
|
expect(serialized).not.toContain("trusted-main");
|
|
218
208
|
expect(serialized).not.toContain("desktop");
|
|
@@ -227,11 +217,11 @@ describe("package authority boundaries", () => {
|
|
|
227
217
|
expect(AUTHOR_PACKAGE_INPUT_SCHEMA_V1.additionalProperties).toBe(false);
|
|
228
218
|
expect(
|
|
229
219
|
Object.keys(AUTHOR_PACKAGE_INPUT_SCHEMA_V1.properties).sort(),
|
|
230
|
-
).toEqual(["displayName", "
|
|
220
|
+
).toEqual(["displayName", "hooks", "packageId", "source", "tools", "ui"]);
|
|
231
221
|
const valid = {
|
|
232
222
|
packageId: "bot-tool",
|
|
233
223
|
displayName: "Bot Tool",
|
|
234
|
-
|
|
224
|
+
tools: [{ name: "do_it", description: "does it", inputSchema: {} }],
|
|
235
225
|
source: "export const tools = [];\n",
|
|
236
226
|
};
|
|
237
227
|
for (const smuggled of [
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
import { authoredManifestV1 } from "@frockbot/plugin-authoring/shared";
|
|
5
|
+
|
|
6
|
+
const repoRoot = resolve(import.meta.dirname, "..", "..", "..");
|
|
7
|
+
const read = (path: string) => readFileSync(join(repoRoot, path), "utf8");
|
|
8
|
+
|
|
9
|
+
describe("non-first-party Package UI boundaries", () => {
|
|
10
|
+
test("a Bot-authored UI page renders with no Package JavaScript in the app origin", () => {
|
|
11
|
+
const manifest = authoredManifestV1({
|
|
12
|
+
packageId: "weather-page",
|
|
13
|
+
displayName: "Weather page",
|
|
14
|
+
version: "0.0.1",
|
|
15
|
+
tools: [
|
|
16
|
+
{ name: "weather_lookup", description: "Weather", inputSchema: {} },
|
|
17
|
+
],
|
|
18
|
+
ui: {
|
|
19
|
+
artifact: {
|
|
20
|
+
contentHash: "a".repeat(64),
|
|
21
|
+
size: 1,
|
|
22
|
+
mediaType: "text/html",
|
|
23
|
+
bundlerVersion: "frockbot-inline-html@1",
|
|
24
|
+
},
|
|
25
|
+
mounts: [{ slot: "frockbot.tool-result:weather_lookup" }],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const client = (manifest.contributions as Record<string, unknown>)
|
|
29
|
+
.client as Record<string, unknown>;
|
|
30
|
+
expect(client.kind).toBe("iframe");
|
|
31
|
+
expect(client).not.toHaveProperty("entry");
|
|
32
|
+
const host = read("packages/plugin-shell/src/client/PackageIframeHost.vue");
|
|
33
|
+
expect(host).toContain("<iframe");
|
|
34
|
+
expect(host).toContain(
|
|
35
|
+
"/packages/${props.contribution.artifact.contentHash}.html",
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("a page cannot read the app's cookies or storage", () => {
|
|
40
|
+
const host = read("packages/plugin-shell/src/client/PackageIframeHost.vue");
|
|
41
|
+
expect(host).toContain('sandbox="allow-scripts"');
|
|
42
|
+
expect(host).not.toContain("allow-same-origin");
|
|
43
|
+
expect(host).toContain("credentialless");
|
|
44
|
+
const wrangler = read("apps/cloudflare/wrangler.jsonc");
|
|
45
|
+
expect(wrangler).toContain('"pattern": "ui.bot.frockbot.com"');
|
|
46
|
+
expect(wrangler).toContain('"pattern": "bot.frockbot.com"');
|
|
47
|
+
});
|
|
48
|
+
});
|