@agentorg/cli 0.0.5 → 0.0.6
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 +18 -102
- package/dist/node_modules/@agentorg/hub/dist/src/hub-actor.d.ts +2 -7
- package/dist/node_modules/@agentorg/hub/dist/src/hub-actor.js +4 -144
- package/dist/node_modules/@agentorg/hub/dist/src/index.d.ts +1 -3
- package/dist/node_modules/@agentorg/hub/dist/src/index.js +1 -3
- package/dist/node_modules/@agentorg/hub/dist/src/router.d.ts +6 -57
- package/dist/node_modules/@agentorg/hub/dist/src/router.js +38 -413
- package/dist/node_modules/@agentorg/hub/dist/src/state.d.ts +17 -317
- package/dist/node_modules/@agentorg/hub/dist/src/state.js +42 -536
- package/dist/node_modules/@agentorg/hub/dist/src/validate.d.ts +1 -3
- package/dist/node_modules/@agentorg/hub/dist/src/validate.js +3 -15
- package/dist/node_modules/@agentorg/hub/package.json +0 -3
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.d.ts +132 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.js +105 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-settings.d.ts +42 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/agent-settings.js +53 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/chat.d.ts +15 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/chat.js +14 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/hub.d.ts +16 -286
- package/dist/node_modules/@agentorg/interfaces/dist/src/hub.js +17 -159
- package/dist/node_modules/@agentorg/interfaces/dist/src/index.d.ts +6 -8
- package/dist/node_modules/@agentorg/interfaces/dist/src/index.js +6 -8
- package/dist/node_modules/@agentorg/interfaces/dist/src/kv.d.ts +2 -2
- package/dist/node_modules/@agentorg/interfaces/dist/src/kv.js +2 -2
- package/dist/node_modules/@agentorg/interfaces/dist/src/manager.d.ts +272 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/manager.js +185 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/mcp-provider.d.ts +88 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/mcp-provider.js +78 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/tools.d.ts +39 -0
- package/dist/node_modules/@agentorg/interfaces/dist/src/tools.js +43 -0
- package/dist/node_modules/@agentorg/manager/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@agentorg/manager/dist/src/index.js +1 -0
- package/dist/node_modules/@agentorg/manager/dist/src/manager.d.ts +21 -0
- package/dist/node_modules/@agentorg/manager/dist/src/manager.js +528 -0
- package/dist/node_modules/@agentorg/manager/dist/src/skills.d.ts +25 -0
- package/dist/node_modules/@agentorg/manager/dist/src/skills.js +145 -0
- package/dist/node_modules/@agentorg/manager/package.json +30 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/connection.d.ts +33 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/connection.js +290 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/index.d.ts +1 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/index.js +1 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/kinds.d.ts +50 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/kinds.js +69 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/provider.d.ts +22 -0
- package/dist/node_modules/@agentorg/mcp/dist/src/provider.js +167 -0
- package/dist/node_modules/@agentorg/mcp/package.json +31 -0
- package/dist/node_modules/@agentorg/sdk/dist/src/cli.js +3 -23
- package/dist/node_modules/@agentorg/sdk/dist/src/client.d.ts +4 -25
- package/dist/node_modules/@agentorg/sdk/dist/src/client.js +5 -55
- package/dist/node_modules/@agentorg/sdk/dist/src/errors.d.ts +1 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/errors.js +3 -3
- package/dist/node_modules/@agentorg/sdk/dist/src/index.d.ts +2 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/index.js +1 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/interface.d.ts +6 -34
- package/dist/node_modules/@agentorg/sdk/dist/src/interface.js +3 -24
- package/dist/node_modules/@agentorg/sdk/dist/src/module-host.d.ts +8 -17
- package/dist/node_modules/@agentorg/sdk/dist/src/module-host.js +15 -87
- package/dist/node_modules/@agentorg/sdk/dist/src/module.d.ts +10 -76
- package/dist/node_modules/@agentorg/sdk/dist/src/module.js +3 -23
- package/dist/node_modules/@agentorg/sdk/dist/src/person-commands.js +0 -5
- package/dist/node_modules/@agentorg/sdk/dist/src/runtime.d.ts +3 -27
- package/dist/node_modules/@agentorg/sdk/dist/src/runtime.js +5 -100
- package/dist/node_modules/@agentorg/sdk/dist/src/testing.d.ts +7 -8
- package/dist/node_modules/@agentorg/sdk/dist/src/testing.js +12 -24
- package/dist/node_modules/@agentorg/sdk/package.json +4 -37
- package/dist/node_modules/@agentorg/shell/dist/app.css +3435 -739
- package/dist/node_modules/@agentorg/shell/dist/app.js +204 -202
- package/dist/node_modules/@agentorg/shell/package.json +18 -10
- package/dist/node_modules/@agentorg/wire/dist/src/frames.d.ts +2 -3
- package/dist/node_modules/@agentorg/wire/dist/src/frames.js +2 -3
- package/dist/node_modules/@agentorg/wire/dist/src/ops.d.ts +5 -34
- package/dist/node_modules/@agentorg/wire/dist/src/ops.js +2 -17
- package/dist/node_modules/assistant/dist/src/agent.d.ts +62 -0
- package/dist/node_modules/assistant/dist/src/agent.js +226 -0
- package/dist/node_modules/assistant/dist/src/engine.d.ts +23 -0
- package/dist/node_modules/assistant/dist/src/engine.js +88 -0
- package/dist/node_modules/assistant/dist/src/history.d.ts +97 -0
- package/dist/node_modules/assistant/dist/src/history.js +235 -0
- package/dist/node_modules/assistant/dist/src/local-store.d.ts +3 -0
- package/dist/node_modules/assistant/dist/src/local-store.js +58 -0
- package/dist/node_modules/assistant/dist/src/provider.d.ts +21 -0
- package/dist/node_modules/assistant/dist/src/provider.js +231 -0
- package/dist/node_modules/assistant/dist/src/settings.d.ts +17 -0
- package/dist/node_modules/assistant/dist/src/settings.js +43 -0
- package/dist/node_modules/assistant/dist/src/tools.d.ts +74 -0
- package/dist/node_modules/assistant/dist/src/tools.js +123 -0
- package/dist/node_modules/assistant/package.json +29 -0
- package/dist/node_modules/chatgpt/dist/src/account.d.ts +52 -0
- package/dist/node_modules/chatgpt/dist/src/account.js +270 -0
- package/dist/node_modules/chatgpt/dist/src/encoding.d.ts +7 -0
- package/dist/node_modules/chatgpt/dist/src/encoding.js +20 -0
- package/dist/node_modules/chatgpt/dist/src/file-store.d.ts +9 -0
- package/dist/node_modules/chatgpt/dist/src/file-store.js +68 -0
- package/dist/node_modules/chatgpt/dist/src/index.d.ts +1 -0
- package/dist/node_modules/chatgpt/dist/src/index.js +1 -0
- package/dist/node_modules/chatgpt/dist/src/jwt.d.ts +15 -0
- package/dist/node_modules/chatgpt/dist/src/jwt.js +37 -0
- package/dist/node_modules/chatgpt/dist/src/oauth.d.ts +43 -0
- package/dist/node_modules/chatgpt/dist/src/oauth.js +104 -0
- package/dist/node_modules/chatgpt/dist/src/program.d.ts +23 -0
- package/dist/node_modules/chatgpt/dist/src/program.js +41 -0
- package/dist/node_modules/chatgpt/dist/src/responses.d.ts +54 -0
- package/dist/node_modules/chatgpt/dist/src/responses.js +300 -0
- package/dist/node_modules/chatgpt/dist/src/serve.d.ts +65 -0
- package/dist/node_modules/chatgpt/dist/src/serve.js +46 -0
- package/dist/node_modules/chatgpt/package.json +33 -0
- package/dist/src/api.d.ts +5 -34
- package/dist/src/api.js +6 -68
- package/dist/src/cli.js +3 -7
- package/dist/src/gateway.d.ts +6 -7
- package/dist/src/gateway.js +39 -285
- package/dist/src/index.d.ts +4 -5
- package/dist/src/index.js +3 -4
- package/dist/src/notes.d.ts +11 -0
- package/dist/src/notes.js +64 -0
- package/dist/src/oauth.d.ts +16 -0
- package/dist/src/oauth.js +46 -0
- package/dist/src/programs.d.ts +29 -0
- package/dist/src/programs.js +171 -0
- package/package.json +3 -11
- package/dist/bundled/index.json +0 -6
- package/dist/bundled/sha256-0e91cc3d0e9762b81abc2427b5496b20f383abcd6fb97d928a8d50e956b54d1f.agentorg +0 -0
- package/dist/bundled/sha256-1f64ca62a0209d767d6aa6c4feb50b0653d60f10bebbc301f79bd3a37e0153c1.agentorg +0 -0
- package/dist/bundled/sha256-4055f8fddf6b90f3d356543f554b2a9e9a2c4a8827a8774f8f87952dc1692331.agentorg +0 -0
- package/dist/bundled/sha256-e356ea3c1899138a8494baf521556831006f38534fa9e92ae873e7e6956c3a46.agentorg +0 -0
- package/dist/node_modules/@agentorg/hub/dist/src/build.d.ts +0 -17
- package/dist/node_modules/@agentorg/hub/dist/src/build.js +0 -120
- package/dist/node_modules/@agentorg/hub/dist/src/logs.d.ts +0 -33
- package/dist/node_modules/@agentorg/hub/dist/src/logs.js +0 -162
- package/dist/node_modules/@agentorg/hub/dist/src/net.d.ts +0 -41
- package/dist/node_modules/@agentorg/hub/dist/src/net.js +0 -265
- package/dist/node_modules/@agentorg/hub/dist/src/processes.d.ts +0 -78
- package/dist/node_modules/@agentorg/hub/dist/src/processes.js +0 -485
- package/dist/node_modules/@agentorg/hub/dist/src/storage.d.ts +0 -38
- package/dist/node_modules/@agentorg/hub/dist/src/storage.js +0 -194
- package/dist/node_modules/@agentorg/interfaces/dist/src/http-egress.d.ts +0 -6
- package/dist/node_modules/@agentorg/interfaces/dist/src/http-egress.js +0 -7
- package/dist/node_modules/@agentorg/interfaces/dist/src/installer.d.ts +0 -191
- package/dist/node_modules/@agentorg/interfaces/dist/src/installer.js +0 -136
- package/dist/node_modules/@agentorg/interfaces/dist/src/layout.d.ts +0 -47
- package/dist/node_modules/@agentorg/interfaces/dist/src/layout.js +0 -52
- package/dist/node_modules/@agentorg/interfaces/dist/src/rules.d.ts +0 -35
- package/dist/node_modules/@agentorg/interfaces/dist/src/rules.js +0 -37
- package/dist/node_modules/@agentorg/interfaces/dist/src/storage-admin.d.ts +0 -23
- package/dist/node_modules/@agentorg/interfaces/dist/src/storage-admin.js +0 -31
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-shell.d.ts +0 -14
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-shell.js +0 -26
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-view.d.ts +0 -27
- package/dist/node_modules/@agentorg/interfaces/dist/src/ui-view.js +0 -26
- package/dist/node_modules/@agentorg/kit/dist/src/chat.d.ts +0 -37
- package/dist/node_modules/@agentorg/kit/dist/src/chat.js +0 -131
- package/dist/node_modules/@agentorg/kit/dist/src/components.d.ts +0 -94
- package/dist/node_modules/@agentorg/kit/dist/src/components.js +0 -66
- package/dist/node_modules/@agentorg/kit/dist/src/icons.d.ts +0 -17
- package/dist/node_modules/@agentorg/kit/dist/src/icons.js +0 -30
- package/dist/node_modules/@agentorg/kit/dist/src/index.d.ts +0 -6
- package/dist/node_modules/@agentorg/kit/dist/src/index.js +0 -10
- package/dist/node_modules/@agentorg/kit/dist/src/markdown.d.ts +0 -9
- package/dist/node_modules/@agentorg/kit/dist/src/markdown.js +0 -14
- package/dist/node_modules/@agentorg/kit/dist/src/resizable.d.ts +0 -5
- package/dist/node_modules/@agentorg/kit/dist/src/resizable.js +0 -8
- package/dist/node_modules/@agentorg/kit/dist/src/styles.d.ts +0 -11
- package/dist/node_modules/@agentorg/kit/dist/src/styles.js +0 -166
- package/dist/node_modules/@agentorg/kit/package.json +0 -44
- package/dist/node_modules/@agentorg/sdk/dist/frame/runtime.js +0 -753
- package/dist/node_modules/@agentorg/sdk/dist/host/runner.js +0 -21963
- package/dist/node_modules/@agentorg/sdk/dist/src/build.d.ts +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/build.js +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/client-http.d.ts +0 -24
- package/dist/node_modules/@agentorg/sdk/dist/src/client-http.js +0 -247
- package/dist/node_modules/@agentorg/sdk/dist/src/describe.d.ts +0 -13
- package/dist/node_modules/@agentorg/sdk/dist/src/describe.js +0 -16
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-base.d.ts +0 -8
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-base.js +0 -64
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-entry.d.ts +0 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-entry.js +0 -35
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-host.d.ts +0 -57
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-host.js +0 -293
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-protocol.d.ts +0 -124
- package/dist/node_modules/@agentorg/sdk/dist/src/frame-protocol.js +0 -16
- package/dist/node_modules/@agentorg/sdk/dist/src/frame.d.ts +0 -25
- package/dist/node_modules/@agentorg/sdk/dist/src/frame.js +0 -248
- package/dist/node_modules/@agentorg/sdk/dist/src/host-main.d.ts +0 -1
- package/dist/node_modules/@agentorg/sdk/dist/src/host-main.js +0 -60
- package/dist/node_modules/@agentorg/sdk/dist/src/host.d.ts +0 -25
- package/dist/node_modules/@agentorg/sdk/dist/src/host.js +0 -92
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest-api.d.ts +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest-api.js +0 -2
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest.d.ts +0 -56
- package/dist/node_modules/@agentorg/sdk/dist/src/manifest.js +0 -165
- package/dist/node_modules/@agentorg/sdk/dist/src/package.d.ts +0 -60
- package/dist/node_modules/@agentorg/sdk/dist/src/package.js +0 -538
- package/dist/node_modules/@agentorg/sdk/dist/src/tar.d.ts +0 -7
- package/dist/node_modules/@agentorg/sdk/dist/src/tar.js +0 -71
- package/dist/node_modules/@agentorg/shell/dist/agent-bindings.js +0 -59
- package/dist/node_modules/@agentorg/shell/src/agent-bindings.ts +0 -107
- package/dist/src/frames.d.ts +0 -23
- package/dist/src/frames.js +0 -78
- package/dist/src/layout.d.ts +0 -44
- package/dist/src/layout.js +0 -90
- package/dist/src/model.d.ts +0 -54
- package/dist/src/model.js +0 -299
- package/dist/src/rules.d.ts +0 -71
- package/dist/src/rules.js +0 -157
- package/dist/src/transfer.d.ts +0 -30
- package/dist/src/transfer.js +0 -110
|
@@ -1,52 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const Id: z.ZodString;
|
|
3
|
-
/** A slot or export: `name
|
|
3
|
+
/** A slot or export: `name`, or `module.name`. */
|
|
4
4
|
export declare const Name: z.ZodString;
|
|
5
|
-
export declare const Package: z.ZodObject<{
|
|
6
|
-
hash: z.ZodString;
|
|
7
|
-
name: z.ZodString;
|
|
8
|
-
version: z.ZodString;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
/** `hub.packages@1`: the content-addressed package store. */
|
|
11
|
-
export declare const hubPackages: import("@agentorg/sdk").RpcInterface<"hub.packages", {
|
|
12
|
-
/** Add a `.agentorg` archive from a path on the Hub's machine; it is verified first. */
|
|
13
|
-
add: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
14
|
-
path: z.ZodString;
|
|
15
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
-
hash: z.ZodString;
|
|
17
|
-
manifest: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
18
|
-
}, z.core.$strip>>;
|
|
19
|
-
list: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
20
|
-
packages: z.ZodArray<z.ZodObject<{
|
|
21
|
-
hash: z.ZodString;
|
|
22
|
-
name: z.ZodString;
|
|
23
|
-
version: z.ZodString;
|
|
24
|
-
}, z.core.$strip>>;
|
|
25
|
-
}, z.core.$strip>>;
|
|
26
|
-
get: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
27
|
-
hash: z.ZodString;
|
|
28
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
-
hash: z.ZodString;
|
|
30
|
-
manifest: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
31
|
-
}, z.core.$strip>>;
|
|
32
|
-
/** Refused while an Actor runs the package. */
|
|
33
|
-
remove: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
34
|
-
hash: z.ZodString;
|
|
35
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
36
|
-
/**
|
|
37
|
-
* Build a package from its source, given as data (`package.json` and files under `src/`, up to
|
|
38
|
-
* 768 KiB), and add it as `add` does. It's `agentorg build`'s build, reading no tsconfig; its
|
|
39
|
-
* files import only `@agentorg/sdk`, `@agentorg/interfaces`, `zod`, `react`, `react-dom` and
|
|
40
|
-
* `@agentorg/kit` by name, and nothing outside the package's folder, never by a pattern. A build that fails is
|
|
41
|
-
* `Refused("build")` with the build's message, so the source can be fixed and built again.
|
|
42
|
-
*/
|
|
43
|
-
build: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
44
|
-
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
45
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
46
|
-
hash: z.ZodString;
|
|
47
|
-
manifest: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
48
|
-
}, z.core.$strip>>;
|
|
49
|
-
}, {}, 1>;
|
|
50
5
|
export declare const ActorState: z.ZodEnum<{
|
|
51
6
|
closed: "closed";
|
|
52
7
|
created: "created";
|
|
@@ -64,43 +19,15 @@ export declare const Actor: z.ZodObject<{
|
|
|
64
19
|
stopped: "stopped";
|
|
65
20
|
}>;
|
|
66
21
|
connected: z.ZodBoolean;
|
|
67
|
-
restarts: z.ZodNumber;
|
|
68
|
-
lastExit: z.ZodOptional<z.ZodObject<{
|
|
69
|
-
code: z.ZodNullable<z.ZodNumber>;
|
|
70
|
-
signal: z.ZodNullable<z.ZodString>;
|
|
71
|
-
at: z.ZodString;
|
|
72
|
-
}, z.core.$strip>>;
|
|
73
|
-
host: z.ZodOptional<z.ZodObject<{
|
|
74
|
-
available: z.ZodBoolean;
|
|
75
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
76
|
-
}, z.core.$strip>>;
|
|
77
|
-
views: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
-
installedFor: z.ZodOptional<z.ZodString>;
|
|
79
22
|
}, z.core.$strip>;
|
|
80
|
-
/**
|
|
81
|
-
export declare const LogLine: z.ZodObject<{
|
|
82
|
-
level: z.ZodEnum<{
|
|
83
|
-
error: "error";
|
|
84
|
-
info: "info";
|
|
85
|
-
warn: "warn";
|
|
86
|
-
}>;
|
|
87
|
-
message: z.ZodString;
|
|
88
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
89
|
-
module: z.ZodOptional<z.ZodString>;
|
|
90
|
-
at: z.ZodString;
|
|
91
|
-
}, z.core.$strip>;
|
|
92
|
-
/** `hub.actors@1`: Actors and their lifecycle. */
|
|
23
|
+
/** `hub.actors@1`: Actors: who may join the Hub. */
|
|
93
24
|
export declare const hubActors: import("@agentorg/sdk").RpcInterface<"hub.actors", {
|
|
94
25
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
* (the creation is the slot side's yes), for example to its own `hub.grants@1`. `for` names
|
|
98
|
-
* the Actor it is made for, recorded as `installedFor`; only a manager may give it.
|
|
26
|
+
* An Actor for a program that connects itself, with a credential returned once. `bindings` wire the new Actor's slots at once, with the caller's export-side authority
|
|
27
|
+
* (the creation is the slot side's yes), for example to its own `hub.grants@1`.
|
|
99
28
|
*/
|
|
100
29
|
create: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
101
30
|
name: z.ZodString;
|
|
102
|
-
package: z.ZodOptional<z.ZodString>;
|
|
103
|
-
for: z.ZodOptional<z.ZodString>;
|
|
104
31
|
bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
105
32
|
slot: z.ZodString;
|
|
106
33
|
provider: z.ZodString;
|
|
@@ -108,7 +35,7 @@ export declare const hubActors: import("@agentorg/sdk").RpcInterface<"hub.actors
|
|
|
108
35
|
}, z.core.$strip>>>;
|
|
109
36
|
}, z.core.$strip>, z.ZodObject<{
|
|
110
37
|
actorId: z.ZodString;
|
|
111
|
-
credential: z.
|
|
38
|
+
credential: z.ZodString;
|
|
112
39
|
}, z.core.$strip>>;
|
|
113
40
|
list: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
114
41
|
actors: z.ZodArray<z.ZodObject<{
|
|
@@ -122,18 +49,6 @@ export declare const hubActors: import("@agentorg/sdk").RpcInterface<"hub.actors
|
|
|
122
49
|
stopped: "stopped";
|
|
123
50
|
}>;
|
|
124
51
|
connected: z.ZodBoolean;
|
|
125
|
-
restarts: z.ZodNumber;
|
|
126
|
-
lastExit: z.ZodOptional<z.ZodObject<{
|
|
127
|
-
code: z.ZodNullable<z.ZodNumber>;
|
|
128
|
-
signal: z.ZodNullable<z.ZodString>;
|
|
129
|
-
at: z.ZodString;
|
|
130
|
-
}, z.core.$strip>>;
|
|
131
|
-
host: z.ZodOptional<z.ZodObject<{
|
|
132
|
-
available: z.ZodBoolean;
|
|
133
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
134
|
-
}, z.core.$strip>>;
|
|
135
|
-
views: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
136
|
-
installedFor: z.ZodOptional<z.ZodString>;
|
|
137
52
|
}, z.core.$strip>>;
|
|
138
53
|
}, z.core.$strip>>;
|
|
139
54
|
get: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
@@ -149,69 +64,15 @@ export declare const hubActors: import("@agentorg/sdk").RpcInterface<"hub.actors
|
|
|
149
64
|
stopped: "stopped";
|
|
150
65
|
}>;
|
|
151
66
|
connected: z.ZodBoolean;
|
|
152
|
-
restarts: z.ZodNumber;
|
|
153
|
-
lastExit: z.ZodOptional<z.ZodObject<{
|
|
154
|
-
code: z.ZodNullable<z.ZodNumber>;
|
|
155
|
-
signal: z.ZodNullable<z.ZodString>;
|
|
156
|
-
at: z.ZodString;
|
|
157
|
-
}, z.core.$strip>>;
|
|
158
|
-
host: z.ZodOptional<z.ZodObject<{
|
|
159
|
-
available: z.ZodBoolean;
|
|
160
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
161
|
-
}, z.core.$strip>>;
|
|
162
|
-
views: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
-
installedFor: z.ZodOptional<z.ZodString>;
|
|
164
67
|
}, z.core.$strip>>;
|
|
165
|
-
start: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
166
|
-
actorId: z.ZodString;
|
|
167
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
168
|
-
stop: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
169
|
-
actorId: z.ZodString;
|
|
170
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
171
68
|
/** Final: its bindings, both ways, are removed. */
|
|
172
69
|
close: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
173
70
|
actorId: z.ZodString;
|
|
174
71
|
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
175
|
-
/**
|
|
176
|
-
* Run another package as the same package Actor: its id, its stores and every binding whose
|
|
177
|
-
* interfaces still match stay. A binding through a slot or export the new package drops, or
|
|
178
|
-
* declares as another interface, is dropped and listed in `dropped`; the new package's own
|
|
179
|
-
* wiring is made where its slot is unbound. A running Actor restarts on the new package.
|
|
180
|
-
* Only a manager may upgrade: the new package runs as the Actor and keeps what it was granted
|
|
181
|
-
* (its bindings and its store), which only a manager could grant anyway.
|
|
182
|
-
*/
|
|
183
|
-
upgrade: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
184
|
-
actorId: z.ZodString;
|
|
185
|
-
package: z.ZodString;
|
|
186
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
-
dropped: z.ZodArray<z.ZodObject<{
|
|
188
|
-
consumer: z.ZodString;
|
|
189
|
-
slot: z.ZodString;
|
|
190
|
-
provider: z.ZodString;
|
|
191
|
-
export: z.ZodString;
|
|
192
|
-
}, z.core.$strip>>;
|
|
193
|
-
}, z.core.$strip>>;
|
|
194
|
-
/** Its newest log lines, oldest first. */
|
|
195
|
-
logs: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
196
|
-
actorId: z.ZodString;
|
|
197
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
198
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
199
|
-
lines: z.ZodArray<z.ZodObject<{
|
|
200
|
-
level: z.ZodEnum<{
|
|
201
|
-
error: "error";
|
|
202
|
-
info: "info";
|
|
203
|
-
warn: "warn";
|
|
204
|
-
}>;
|
|
205
|
-
message: z.ZodString;
|
|
206
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
207
|
-
module: z.ZodOptional<z.ZodString>;
|
|
208
|
-
at: z.ZodString;
|
|
209
|
-
}, z.core.$strip>>;
|
|
210
|
-
}, z.core.$strip>>;
|
|
211
72
|
}, {
|
|
212
73
|
/**
|
|
213
|
-
* An Actor's record may differ: it was made
|
|
214
|
-
*
|
|
74
|
+
* An Actor's record may differ: it was made or closed, or it connected or went (`connected`).
|
|
75
|
+
* Read it again with `get` or `list`.
|
|
215
76
|
*/
|
|
216
77
|
changed: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
217
78
|
actor: z.ZodString;
|
|
@@ -229,41 +90,20 @@ export declare const Binding: z.ZodObject<{
|
|
|
229
90
|
at: z.ZodString;
|
|
230
91
|
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
231
92
|
}, z.core.$strip>;
|
|
232
|
-
export declare const BindingRequest: z.ZodObject<{
|
|
233
|
-
consumer: z.ZodString;
|
|
234
|
-
slot: z.ZodString;
|
|
235
|
-
provider: z.ZodString;
|
|
236
|
-
export: z.ZodString;
|
|
237
|
-
requestId: z.ZodString;
|
|
238
|
-
needs: z.ZodEnum<{
|
|
239
|
-
export: "export";
|
|
240
|
-
slot: "slot";
|
|
241
|
-
}>;
|
|
242
|
-
reason: z.ZodString;
|
|
243
|
-
requestedBy: z.ZodString;
|
|
244
|
-
at: z.ZodString;
|
|
245
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
246
|
-
}, z.core.$strip>;
|
|
247
93
|
/**
|
|
248
94
|
* `hub.grants@1`: binding with the caller's own authority, so it is safe to give any Actor. A
|
|
249
95
|
* binding needs both ends: the export side (the provider, an Actor already bound to that export,
|
|
250
|
-
* or a manager) and the slot side (the consumer itself, or a manager).
|
|
251
|
-
* With one, it approves an open request from the other end, or becomes a request to that end's
|
|
252
|
-
* approvers. With neither it is refused.
|
|
96
|
+
* or a manager) and the slot side (the consumer itself, or a manager). Without both it is refused.
|
|
253
97
|
*/
|
|
254
98
|
export declare const hubGrants: import("@agentorg/sdk").RpcInterface<"hub.grants", {
|
|
255
|
-
/** A request made by `bind` has an empty reason; `request` gives one. */
|
|
256
99
|
bind: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
257
100
|
consumer: z.ZodString;
|
|
258
101
|
slot: z.ZodString;
|
|
259
102
|
provider: z.ZodString;
|
|
260
103
|
export: z.ZodString;
|
|
261
|
-
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
262
|
-
bound: z.ZodLiteral<true>;
|
|
263
104
|
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
-
bound: z.ZodLiteral<
|
|
265
|
-
|
|
266
|
-
}, z.core.$strip>]>>;
|
|
105
|
+
bound: z.ZodLiteral<true>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
267
107
|
/** The consumer, the provider or a manager may unbind. */
|
|
268
108
|
unbind: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
269
109
|
consumer: z.ZodString;
|
|
@@ -272,135 +112,27 @@ export declare const hubGrants: import("@agentorg/sdk").RpcInterface<"hub.grants
|
|
|
272
112
|
/**
|
|
273
113
|
* Expose an `rpc` export to one Actor: a slot made on `to`, typed by the export's interface,
|
|
274
114
|
* named `as` (by default the provider's name camelCased, `_`, and the export's last part, made
|
|
275
|
-
* unique on `to`), and bound to the export, in one step. Its authority is a binding's
|
|
276
|
-
*
|
|
277
|
-
* by calling `expose` with the request's fields. The same export already exposed to `to`
|
|
278
|
-
* gives that slot back.
|
|
115
|
+
* unique on `to`), and bound to the export, in one step. Its authority is a binding's. The same export already
|
|
116
|
+
* exposed to `to` gives that slot back.
|
|
279
117
|
*/
|
|
280
118
|
expose: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
281
119
|
provider: z.ZodString;
|
|
282
120
|
export: z.ZodString;
|
|
283
121
|
to: z.ZodString;
|
|
284
122
|
as: z.ZodOptional<z.ZodString>;
|
|
285
|
-
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
286
|
-
exposed: z.ZodLiteral<true>;
|
|
287
|
-
slot: z.ZodString;
|
|
288
123
|
}, z.core.$strip>, z.ZodObject<{
|
|
289
|
-
exposed: z.ZodLiteral<
|
|
124
|
+
exposed: z.ZodLiteral<true>;
|
|
290
125
|
slot: z.ZodString;
|
|
291
|
-
|
|
292
|
-
}, z.core.$strip>]>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
293
127
|
/** Remove a slot made by `expose`, with its binding: as `unbind`, the consumer, the provider or a manager may. */
|
|
294
128
|
unexpose: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
295
129
|
to: z.ZodString;
|
|
296
130
|
slot: z.ZodString;
|
|
297
131
|
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
298
|
-
|
|
299
|
-
consumer: z.ZodString;
|
|
300
|
-
slot: z.ZodString;
|
|
301
|
-
provider: z.ZodString;
|
|
302
|
-
export: z.ZodString;
|
|
303
|
-
reason: z.ZodString;
|
|
304
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
305
|
-
requestId: z.ZodString;
|
|
306
|
-
}, z.core.$strip>>;
|
|
307
|
-
/** The open requests the caller could approve. */
|
|
308
|
-
requests: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
309
|
-
requests: z.ZodArray<z.ZodObject<{
|
|
310
|
-
consumer: z.ZodString;
|
|
311
|
-
slot: z.ZodString;
|
|
312
|
-
provider: z.ZodString;
|
|
313
|
-
export: z.ZodString;
|
|
314
|
-
requestId: z.ZodString;
|
|
315
|
-
needs: z.ZodEnum<{
|
|
316
|
-
export: "export";
|
|
317
|
-
slot: "slot";
|
|
318
|
-
}>;
|
|
319
|
-
reason: z.ZodString;
|
|
320
|
-
requestedBy: z.ZodString;
|
|
321
|
-
at: z.ZodString;
|
|
322
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
323
|
-
}, z.core.$strip>>;
|
|
324
|
-
}, z.core.$strip>>;
|
|
325
|
-
decline: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
326
|
-
requestId: z.ZodString;
|
|
327
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
328
|
-
/**
|
|
329
|
-
* The caller's own requests and how each stands, newest first: how a requester that missed
|
|
330
|
-
* `decided` learns the outcome.
|
|
331
|
-
*/
|
|
332
|
-
mine: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
333
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
334
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
335
|
-
requests: z.ZodArray<z.ZodObject<{
|
|
336
|
-
consumer: z.ZodString;
|
|
337
|
-
slot: z.ZodString;
|
|
338
|
-
provider: z.ZodString;
|
|
339
|
-
export: z.ZodString;
|
|
340
|
-
requestId: z.ZodString;
|
|
341
|
-
needs: z.ZodEnum<{
|
|
342
|
-
export: "export";
|
|
343
|
-
slot: "slot";
|
|
344
|
-
}>;
|
|
345
|
-
reason: z.ZodString;
|
|
346
|
-
requestedBy: z.ZodString;
|
|
347
|
-
at: z.ZodString;
|
|
348
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
349
|
-
status: z.ZodEnum<{
|
|
350
|
-
approved: "approved";
|
|
351
|
-
closed: "closed";
|
|
352
|
-
declined: "declined";
|
|
353
|
-
open: "open";
|
|
354
|
-
}>;
|
|
355
|
-
}, z.core.$strip>>;
|
|
356
|
-
}, z.core.$strip>>;
|
|
357
|
-
}, {
|
|
358
|
-
/** A request the subscriber could approve. */
|
|
359
|
-
requested: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
360
|
-
consumer: z.ZodString;
|
|
361
|
-
slot: z.ZodString;
|
|
362
|
-
provider: z.ZodString;
|
|
363
|
-
export: z.ZodString;
|
|
364
|
-
requestId: z.ZodString;
|
|
365
|
-
needs: z.ZodEnum<{
|
|
366
|
-
export: "export";
|
|
367
|
-
slot: "slot";
|
|
368
|
-
}>;
|
|
369
|
-
reason: z.ZodString;
|
|
370
|
-
requestedBy: z.ZodString;
|
|
371
|
-
at: z.ZodString;
|
|
372
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
373
|
-
}, z.core.$strip>>;
|
|
374
|
-
/**
|
|
375
|
-
* A request the subscriber could approve, or made, was approved (its binding made), declined,
|
|
376
|
-
* or closed (its slot was bound to something else, or one end went away).
|
|
377
|
-
*/
|
|
378
|
-
decided: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
379
|
-
request: z.ZodObject<{
|
|
380
|
-
consumer: z.ZodString;
|
|
381
|
-
slot: z.ZodString;
|
|
382
|
-
provider: z.ZodString;
|
|
383
|
-
export: z.ZodString;
|
|
384
|
-
requestId: z.ZodString;
|
|
385
|
-
needs: z.ZodEnum<{
|
|
386
|
-
export: "export";
|
|
387
|
-
slot: "slot";
|
|
388
|
-
}>;
|
|
389
|
-
reason: z.ZodString;
|
|
390
|
-
requestedBy: z.ZodString;
|
|
391
|
-
at: z.ZodString;
|
|
392
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
393
|
-
}, z.core.$strip>;
|
|
394
|
-
status: z.ZodEnum<{
|
|
395
|
-
approved: "approved";
|
|
396
|
-
closed: "closed";
|
|
397
|
-
declined: "declined";
|
|
398
|
-
}>;
|
|
399
|
-
}, z.core.$strip>>;
|
|
400
|
-
}, 1>;
|
|
132
|
+
}, {}, 1>;
|
|
401
133
|
/**
|
|
402
134
|
* `hub.bindings@1`: management scope. An Actor bound to it is a manager: it holds both ends of
|
|
403
|
-
* every binding
|
|
135
|
+
* every binding, acting through `hub.grants@1`, which it needs
|
|
404
136
|
* as well. Here, the manager-wide reads.
|
|
405
137
|
*/
|
|
406
138
|
export declare const hubBindings: import("@agentorg/sdk").RpcInterface<"hub.bindings", {
|
|
@@ -424,7 +156,6 @@ export declare const ExportEntry: z.ZodObject<{
|
|
|
424
156
|
export: z.ZodString;
|
|
425
157
|
interface: z.ZodString;
|
|
426
158
|
hash: z.ZodString;
|
|
427
|
-
dynamic: z.ZodBoolean;
|
|
428
159
|
}, z.core.$strip>;
|
|
429
160
|
/** `hub.exports@1`: what each Actor offers right now. */
|
|
430
161
|
export declare const hubExports: import("@agentorg/sdk").RpcInterface<"hub.exports", {
|
|
@@ -436,7 +167,6 @@ export declare const hubExports: import("@agentorg/sdk").RpcInterface<"hub.expor
|
|
|
436
167
|
export: z.ZodString;
|
|
437
168
|
interface: z.ZodString;
|
|
438
169
|
hash: z.ZodString;
|
|
439
|
-
dynamic: z.ZodBoolean;
|
|
440
170
|
}, z.core.$strip>>;
|
|
441
171
|
}, z.core.$strip>>;
|
|
442
172
|
}, {
|
|
@@ -6,144 +6,57 @@ import { z } from "zod";
|
|
|
6
6
|
*/
|
|
7
7
|
const Hash = z.string().regex(/^sha256-[0-9a-f]{64}$/);
|
|
8
8
|
export const Id = z.string().min(1).max(128);
|
|
9
|
-
/** A slot or export: `name
|
|
9
|
+
/** A slot or export: `name`, or `module.name`. */
|
|
10
10
|
export const Name = z
|
|
11
11
|
.string()
|
|
12
12
|
.regex(/^[a-z][A-Za-z0-9_]*(\.[a-z][A-Za-z0-9_]*)?$/)
|
|
13
13
|
.max(129);
|
|
14
14
|
const Empty = z.object({});
|
|
15
|
-
export const Package = z.object({ hash: Hash, name: z.string(), version: z.string() });
|
|
16
|
-
/** `hub.packages@1`: the content-addressed package store. */
|
|
17
|
-
export const hubPackages = defineInterface({
|
|
18
|
-
name: "hub.packages",
|
|
19
|
-
major: 1,
|
|
20
|
-
kind: "rpc",
|
|
21
|
-
methods: {
|
|
22
|
-
/** Add a `.agentorg` archive from a path on the Hub's machine; it is verified first. */
|
|
23
|
-
add: method({
|
|
24
|
-
input: z.object({ path: z.string().min(1).max(4096) }),
|
|
25
|
-
output: z.object({ hash: Hash, manifest: z.record(z.string(), z.json()) }),
|
|
26
|
-
}),
|
|
27
|
-
list: method({ input: Empty, output: z.object({ packages: z.array(Package) }) }),
|
|
28
|
-
get: method({
|
|
29
|
-
input: z.object({ hash: Hash }),
|
|
30
|
-
output: z.object({ hash: Hash, manifest: z.record(z.string(), z.json()) }),
|
|
31
|
-
}),
|
|
32
|
-
/** Refused while an Actor runs the package. */
|
|
33
|
-
remove: method({ input: z.object({ hash: Hash }), output: Empty }),
|
|
34
|
-
/**
|
|
35
|
-
* Build a package from its source, given as data (`package.json` and files under `src/`, up to
|
|
36
|
-
* 768 KiB), and add it as `add` does. It's `agentorg build`'s build, reading no tsconfig; its
|
|
37
|
-
* files import only `@agentorg/sdk`, `@agentorg/interfaces`, `zod`, `react`, `react-dom` and
|
|
38
|
-
* `@agentorg/kit` by name, and nothing outside the package's folder, never by a pattern. A build that fails is
|
|
39
|
-
* `Refused("build")` with the build's message, so the source can be fixed and built again.
|
|
40
|
-
*/
|
|
41
|
-
build: method({
|
|
42
|
-
input: z.object({ files: z.record(z.string().min(1).max(256), z.string()) }),
|
|
43
|
-
output: z.object({ hash: Hash, manifest: z.record(z.string(), z.json()) }),
|
|
44
|
-
}),
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
15
|
export const ActorState = z.enum(["created", "running", "stopped", "closed"]);
|
|
48
16
|
export const Actor = z.object({
|
|
49
17
|
actorId: Id,
|
|
50
18
|
name: z.string(),
|
|
51
19
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
20
|
+
* `external` for a program that connects itself; `builtin` for the `hub` Actor, which is the
|
|
21
|
+
* core itself. An Actor an earlier release ran from a package keeps that package's hash.
|
|
54
22
|
*/
|
|
55
23
|
package: z.union([Hash, z.literal("external"), z.literal("builtin")]),
|
|
56
24
|
state: ActorState,
|
|
57
25
|
/**
|
|
58
|
-
* Whether it has a channel to the Hub now:
|
|
59
|
-
*
|
|
60
|
-
* process is. The built-in Actors are the Hub itself and have none. `state` is what was asked
|
|
61
|
-
* for and this is what is: a running package Actor isn't connected while its process starts or
|
|
62
|
-
* restarts, and a stopping one stays connected until its process has gone.
|
|
26
|
+
* Whether it has a channel to the Hub now: while its program is connected (the person while the
|
|
27
|
+
* app runs: its gateway holds the person's channel). The hub is the core itself and has none.
|
|
63
28
|
*/
|
|
64
29
|
connected: z.boolean(),
|
|
65
|
-
/** Times the Hub restarted its process after a crash; 0 for Actors without one. */
|
|
66
|
-
restarts: z.number().int().min(0),
|
|
67
|
-
/** How its process last ended on its own, if it has: an exit code or a signal, and when. */
|
|
68
|
-
lastExit: z
|
|
69
|
-
.object({ code: z.number().int().nullable(), signal: z.string().nullable(), at: z.string() })
|
|
70
|
-
.optional(),
|
|
71
|
-
/**
|
|
72
|
-
* For a package Actor: whether this machine can run its host process now, and if not, why and
|
|
73
|
-
* what to do about it.
|
|
74
|
-
*/
|
|
75
|
-
host: z.object({ available: z.boolean(), reason: z.string().optional() }).optional(),
|
|
76
|
-
/** For a package Actor: its view modules, which the person's shell can place. */
|
|
77
|
-
views: z.array(z.string()).optional(),
|
|
78
|
-
/**
|
|
79
|
-
* The Actor it was created for, when a manager created it on another's behalf (the installer
|
|
80
|
-
* names its caller). Provenance only: the Hub grants nothing from it; only a rule the person
|
|
81
|
-
* turned on may act on it.
|
|
82
|
-
*/
|
|
83
|
-
installedFor: Id.optional(),
|
|
84
30
|
});
|
|
85
|
-
/**
|
|
86
|
-
export const LogLine = z.object({
|
|
87
|
-
level: z.enum(["info", "warn", "error"]),
|
|
88
|
-
message: z.string(),
|
|
89
|
-
data: z.record(z.string(), z.json()).optional(),
|
|
90
|
-
module: z.string().optional(),
|
|
91
|
-
at: z.string(),
|
|
92
|
-
});
|
|
93
|
-
/** `hub.actors@1`: Actors and their lifecycle. */
|
|
31
|
+
/** `hub.actors@1`: Actors: who may join the Hub. */
|
|
94
32
|
export const hubActors = defineInterface({
|
|
95
33
|
name: "hub.actors",
|
|
96
34
|
major: 1,
|
|
97
35
|
kind: "rpc",
|
|
98
36
|
methods: {
|
|
99
37
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* (the creation is the slot side's yes), for example to its own `hub.grants@1`. `for` names
|
|
103
|
-
* the Actor it is made for, recorded as `installedFor`; only a manager may give it.
|
|
38
|
+
* An Actor for a program that connects itself, with a credential returned once. `bindings` wire the new Actor's slots at once, with the caller's export-side authority
|
|
39
|
+
* (the creation is the slot side's yes), for example to its own `hub.grants@1`.
|
|
104
40
|
*/
|
|
105
41
|
create: method({
|
|
106
42
|
input: z.object({
|
|
107
43
|
name: z.string().min(1).max(128),
|
|
108
|
-
package: Hash.optional(),
|
|
109
|
-
for: Id.optional(),
|
|
110
44
|
bindings: z
|
|
111
45
|
.array(z.object({ slot: Name, provider: Id, export: Name }))
|
|
112
46
|
.max(64)
|
|
113
47
|
.optional(),
|
|
114
48
|
}),
|
|
115
|
-
output: z.object({ actorId: Id, credential: z.string()
|
|
49
|
+
output: z.object({ actorId: Id, credential: z.string() }),
|
|
116
50
|
}),
|
|
117
51
|
list: method({ input: Empty, output: z.object({ actors: z.array(Actor) }) }),
|
|
118
52
|
get: method({ input: z.object({ actorId: Id }), output: Actor }),
|
|
119
|
-
start: method({ input: z.object({ actorId: Id }), output: Empty }),
|
|
120
|
-
stop: method({ input: z.object({ actorId: Id }), output: Empty }),
|
|
121
53
|
/** Final: its bindings, both ways, are removed. */
|
|
122
54
|
close: method({ input: z.object({ actorId: Id }), output: Empty }),
|
|
123
|
-
/**
|
|
124
|
-
* Run another package as the same package Actor: its id, its stores and every binding whose
|
|
125
|
-
* interfaces still match stay. A binding through a slot or export the new package drops, or
|
|
126
|
-
* declares as another interface, is dropped and listed in `dropped`; the new package's own
|
|
127
|
-
* wiring is made where its slot is unbound. A running Actor restarts on the new package.
|
|
128
|
-
* Only a manager may upgrade: the new package runs as the Actor and keeps what it was granted
|
|
129
|
-
* (its bindings and its store), which only a manager could grant anyway.
|
|
130
|
-
*/
|
|
131
|
-
upgrade: method({
|
|
132
|
-
input: z.object({ actorId: Id, package: Hash }),
|
|
133
|
-
output: z.object({
|
|
134
|
-
dropped: z.array(z.object({ consumer: Id, slot: Name, provider: Id, export: Name })),
|
|
135
|
-
}),
|
|
136
|
-
}),
|
|
137
|
-
/** Its newest log lines, oldest first. */
|
|
138
|
-
logs: method({
|
|
139
|
-
input: z.object({ actorId: Id, limit: z.number().int().min(1).max(1000).optional() }),
|
|
140
|
-
output: z.object({ lines: z.array(LogLine) }),
|
|
141
|
-
}),
|
|
142
55
|
},
|
|
143
56
|
events: {
|
|
144
57
|
/**
|
|
145
|
-
* An Actor's record may differ: it was made
|
|
146
|
-
*
|
|
58
|
+
* An Actor's record may differ: it was made or closed, or it connected or went (`connected`).
|
|
59
|
+
* Read it again with `get` or `list`.
|
|
147
60
|
*/
|
|
148
61
|
changed: event(z.object({ actor: Id })),
|
|
149
62
|
},
|
|
@@ -162,90 +75,36 @@ export const Binding = z.object({
|
|
|
162
75
|
/** A slot made at run time by `hub.grants.expose`: it goes with this binding. */
|
|
163
76
|
exposed: z.literal(true).optional(),
|
|
164
77
|
});
|
|
165
|
-
export const BindingRequest = z.object({
|
|
166
|
-
requestId: Id,
|
|
167
|
-
...Wiring,
|
|
168
|
-
/** The end the requester lacks: `export` (provider, holders, managers) or `slot` (consumer, managers). */
|
|
169
|
-
needs: z.enum(["export", "slot"]),
|
|
170
|
-
reason: z.string(),
|
|
171
|
-
requestedBy: Id,
|
|
172
|
-
at: z.string(),
|
|
173
|
-
/**
|
|
174
|
-
* A request to expose: `slot` is the name the slot will have on `consumer`, made when it is
|
|
175
|
-
* approved. Approve it with `expose({provider, export, to: consumer, as: slot})`.
|
|
176
|
-
*/
|
|
177
|
-
exposed: z.literal(true).optional(),
|
|
178
|
-
});
|
|
179
78
|
/**
|
|
180
79
|
* `hub.grants@1`: binding with the caller's own authority, so it is safe to give any Actor. A
|
|
181
80
|
* binding needs both ends: the export side (the provider, an Actor already bound to that export,
|
|
182
|
-
* or a manager) and the slot side (the consumer itself, or a manager).
|
|
183
|
-
* With one, it approves an open request from the other end, or becomes a request to that end's
|
|
184
|
-
* approvers. With neither it is refused.
|
|
81
|
+
* or a manager) and the slot side (the consumer itself, or a manager). Without both it is refused.
|
|
185
82
|
*/
|
|
186
83
|
export const hubGrants = defineInterface({
|
|
187
84
|
name: "hub.grants",
|
|
188
85
|
major: 1,
|
|
189
86
|
kind: "rpc",
|
|
190
87
|
methods: {
|
|
191
|
-
|
|
192
|
-
bind: method({
|
|
193
|
-
input: z.object(Wiring),
|
|
194
|
-
output: z.union([
|
|
195
|
-
z.object({ bound: z.literal(true) }),
|
|
196
|
-
z.object({ bound: z.literal(false), requestId: Id }),
|
|
197
|
-
]),
|
|
198
|
-
}),
|
|
88
|
+
bind: method({ input: z.object(Wiring), output: z.object({ bound: z.literal(true) }) }),
|
|
199
89
|
/** The consumer, the provider or a manager may unbind. */
|
|
200
90
|
unbind: method({ input: z.object({ consumer: Id, slot: Name }), output: Empty }),
|
|
201
91
|
/**
|
|
202
92
|
* Expose an `rpc` export to one Actor: a slot made on `to`, typed by the export's interface,
|
|
203
93
|
* named `as` (by default the provider's name camelCased, `_`, and the export's last part, made
|
|
204
|
-
* unique on `to`), and bound to the export, in one step. Its authority is a binding's
|
|
205
|
-
*
|
|
206
|
-
* by calling `expose` with the request's fields. The same export already exposed to `to`
|
|
207
|
-
* gives that slot back.
|
|
94
|
+
* unique on `to`), and bound to the export, in one step. Its authority is a binding's. The same export already
|
|
95
|
+
* exposed to `to` gives that slot back.
|
|
208
96
|
*/
|
|
209
97
|
expose: method({
|
|
210
98
|
input: z.object({ provider: Id, export: Name, to: Id, as: SlotName.optional() }),
|
|
211
|
-
output: z.
|
|
212
|
-
z.object({ exposed: z.literal(true), slot: SlotName }),
|
|
213
|
-
z.object({ exposed: z.literal(false), slot: SlotName, requestId: Id }),
|
|
214
|
-
]),
|
|
99
|
+
output: z.object({ exposed: z.literal(true), slot: SlotName }),
|
|
215
100
|
}),
|
|
216
101
|
/** Remove a slot made by `expose`, with its binding: as `unbind`, the consumer, the provider or a manager may. */
|
|
217
102
|
unexpose: method({ input: z.object({ to: Id, slot: SlotName }), output: Empty }),
|
|
218
|
-
request: method({
|
|
219
|
-
input: z.object({ ...Wiring, reason: z.string().min(1).max(1000) }),
|
|
220
|
-
output: z.object({ requestId: Id }),
|
|
221
|
-
}),
|
|
222
|
-
/** The open requests the caller could approve. */
|
|
223
|
-
requests: method({ input: Empty, output: z.object({ requests: z.array(BindingRequest) }) }),
|
|
224
|
-
decline: method({ input: z.object({ requestId: Id }), output: Empty }),
|
|
225
|
-
/**
|
|
226
|
-
* The caller's own requests and how each stands, newest first: how a requester that missed
|
|
227
|
-
* `decided` learns the outcome.
|
|
228
|
-
*/
|
|
229
|
-
mine: method({
|
|
230
|
-
input: z.object({ limit: z.number().int().min(1).max(1000).optional() }),
|
|
231
|
-
output: z.object({
|
|
232
|
-
requests: z.array(BindingRequest.extend({ status: z.enum(["open", "approved", "declined", "closed"]) })),
|
|
233
|
-
}),
|
|
234
|
-
}),
|
|
235
|
-
},
|
|
236
|
-
events: {
|
|
237
|
-
/** A request the subscriber could approve. */
|
|
238
|
-
requested: event(BindingRequest),
|
|
239
|
-
/**
|
|
240
|
-
* A request the subscriber could approve, or made, was approved (its binding made), declined,
|
|
241
|
-
* or closed (its slot was bound to something else, or one end went away).
|
|
242
|
-
*/
|
|
243
|
-
decided: event(z.object({ request: BindingRequest, status: z.enum(["approved", "declined", "closed"]) })),
|
|
244
103
|
},
|
|
245
104
|
});
|
|
246
105
|
/**
|
|
247
106
|
* `hub.bindings@1`: management scope. An Actor bound to it is a manager: it holds both ends of
|
|
248
|
-
* every binding
|
|
107
|
+
* every binding, acting through `hub.grants@1`, which it needs
|
|
249
108
|
* as well. Here, the manager-wide reads.
|
|
250
109
|
*/
|
|
251
110
|
export const hubBindings = defineInterface({
|
|
@@ -264,7 +123,6 @@ export const ExportEntry = z.object({
|
|
|
264
123
|
export: Name,
|
|
265
124
|
interface: z.string(),
|
|
266
125
|
hash: Hash,
|
|
267
|
-
dynamic: z.boolean(),
|
|
268
126
|
});
|
|
269
127
|
/** `hub.exports@1`: what each Actor offers right now. */
|
|
270
128
|
export const hubExports = defineInterface({
|