@frockbot/frock-compose 0.0.0 → 0.7.292
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 +22 -2
- package/index.ts +18 -0
- package/package.json +33 -5
- package/plugin-worker-host.ts +2152 -0
- package/plugin-worker-wrapper.ts +1545 -0
package/README.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@frockbot/frock-compose`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Plugin worker host. Untrusted code — Bot-authored and third-party — runs in
|
|
4
|
+
a loaded Worker with only its named grants and no network beyond what the User
|
|
5
|
+
approved; this module is what loads it.
|
|
6
|
+
|
|
7
|
+
It mounts every Plugin a Composition generation names into one Dynamic Worker
|
|
8
|
+
per User, behind a generated index (`plugin-worker-wrapper.ts`) that imports
|
|
9
|
+
each Plugin's content-addressed artifact, narrows the capability stub into the
|
|
10
|
+
`ctx` a Plugin author writes against, hands a provider's services to the
|
|
11
|
+
Plugins mounted after it, and runs an open hook over every enabled Plugin that
|
|
12
|
+
declared it. The host orders providers before consumers, registers the tools
|
|
13
|
+
and hooks each Plugin's health report declares, and names the Plugins it could
|
|
14
|
+
not mount instead of failing the whole generation.
|
|
15
|
+
|
|
16
|
+
What a member declares about itself is a contract, not a host concern:
|
|
17
|
+
`PluginDescriptorV1` and the vocabularies it names live in
|
|
18
|
+
`@frockbot/core/contracts`, and the failure phases activation records live in
|
|
19
|
+
`@frockbot/core/durable/composition-failure`.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { PluginWorkerHost } from "@frockbot/frock-compose";
|
|
23
|
+
```
|
package/index.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// FrockBot Compose: the Plugin worker host.
|
|
2
|
+
//
|
|
3
|
+
// Untrusted code — Plugins the deployment seeded and Plugins a Bot wrote — runs
|
|
4
|
+
// in one loaded Worker per User with only its named grants and a
|
|
5
|
+
// `globalOutbound` that admits only the hosts the User approved. This module is
|
|
6
|
+
// what loads it: every Composition member's content-addressed artifact behind a
|
|
7
|
+
// generated index, the wrapper that narrows the capability stub into the `ctx`
|
|
8
|
+
// a Plugin author writes against, and the tool and hook registrations its
|
|
9
|
+
// health report declares.
|
|
10
|
+
export * from "./plugin-worker-host.ts";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
PLUGIN_WORKER_INDEX_VERSION,
|
|
14
|
+
PLUGIN_WORKER_MAIN_MODULE,
|
|
15
|
+
pluginWorkerIndexSourceV1,
|
|
16
|
+
pluginWorkerModuleMap,
|
|
17
|
+
pluginWorkerModulePathV1,
|
|
18
|
+
} from "./plugin-worker-wrapper.ts";
|
package/package.json
CHANGED
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/frock-compose",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"license": "
|
|
3
|
+
"version": "0.7.292",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"description": "The FrockBot Plugin worker host: loads a User's Plugins as one Dynamic Worker behind a generated index.",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./index.ts",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "bun test",
|
|
15
|
+
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@frockbot/core": "0.7.292"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/bun": "1.4.2",
|
|
22
|
+
"typescript": "^7.0.2"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"**/*.ts",
|
|
26
|
+
"README.md",
|
|
27
|
+
"!**/*.test.ts",
|
|
28
|
+
"!**/*.type-test.ts",
|
|
29
|
+
"!**/tsconfig*.json"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
6
34
|
"repository": {
|
|
7
35
|
"type": "git",
|
|
8
36
|
"url": "git+https://github.com/timoconnellaus/frockbot.git",
|
|
9
37
|
"directory": "frock-compose"
|
|
10
38
|
},
|
|
11
|
-
"
|
|
12
|
-
"
|
|
39
|
+
"frockbot": {
|
|
40
|
+
"npm": true
|
|
13
41
|
}
|
|
14
42
|
}
|