@agentorg/cli 0.0.4 → 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 -111
- 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 +20 -298
- package/dist/node_modules/@agentorg/hub/dist/src/state.js +73 -456
- 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 -267
- package/dist/node_modules/@agentorg/interfaces/dist/src/hub.js +17 -145
- 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-01d69bc3888c2a53963f4413d47de909d129ad27c78e9af6d830bb50c3478419.agentorg +0 -0
- package/dist/bundled/sha256-84165e3be5c904fc971d983dab31102e07cca725d8629a6fd7d118fa3a0a88b8.agentorg +0 -0
- package/dist/bundled/sha256-ade9132b3f34b4c39db92adeadc7e540dc745e4a81b5b54f5d45bf9ec92bca75.agentorg +0 -0
- package/dist/bundled/sha256-f4330f5987f37d8cf3aeb44d2f831b573641a87186daa2f811f0c35ba04804f0.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 -51
- package/dist/src/model.js +0 -230
- 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
|
-
}, z.core.$strip>;
|
|
80
|
-
/** One line of an Actor's log, from its `ctx.log` or its process's own output. */
|
|
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
22
|
}, z.core.$strip>;
|
|
92
|
-
/** `hub.actors@1`: Actors
|
|
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,50 +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
|
-
/** Its newest log lines, oldest first. */
|
|
176
|
-
logs: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
177
|
-
actorId: z.ZodString;
|
|
178
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
179
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
180
|
-
lines: z.ZodArray<z.ZodObject<{
|
|
181
|
-
level: z.ZodEnum<{
|
|
182
|
-
error: "error";
|
|
183
|
-
info: "info";
|
|
184
|
-
warn: "warn";
|
|
185
|
-
}>;
|
|
186
|
-
message: z.ZodString;
|
|
187
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
188
|
-
module: z.ZodOptional<z.ZodString>;
|
|
189
|
-
at: z.ZodString;
|
|
190
|
-
}, z.core.$strip>>;
|
|
191
|
-
}, z.core.$strip>>;
|
|
192
72
|
}, {
|
|
193
73
|
/**
|
|
194
|
-
* An Actor's record may differ: it was made
|
|
195
|
-
*
|
|
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`.
|
|
196
76
|
*/
|
|
197
77
|
changed: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
198
78
|
actor: z.ZodString;
|
|
@@ -210,41 +90,20 @@ export declare const Binding: z.ZodObject<{
|
|
|
210
90
|
at: z.ZodString;
|
|
211
91
|
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
212
92
|
}, z.core.$strip>;
|
|
213
|
-
export declare const BindingRequest: z.ZodObject<{
|
|
214
|
-
consumer: z.ZodString;
|
|
215
|
-
slot: z.ZodString;
|
|
216
|
-
provider: z.ZodString;
|
|
217
|
-
export: z.ZodString;
|
|
218
|
-
requestId: z.ZodString;
|
|
219
|
-
needs: z.ZodEnum<{
|
|
220
|
-
export: "export";
|
|
221
|
-
slot: "slot";
|
|
222
|
-
}>;
|
|
223
|
-
reason: z.ZodString;
|
|
224
|
-
requestedBy: z.ZodString;
|
|
225
|
-
at: z.ZodString;
|
|
226
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
227
|
-
}, z.core.$strip>;
|
|
228
93
|
/**
|
|
229
94
|
* `hub.grants@1`: binding with the caller's own authority, so it is safe to give any Actor. A
|
|
230
95
|
* binding needs both ends: the export side (the provider, an Actor already bound to that export,
|
|
231
|
-
* or a manager) and the slot side (the consumer itself, or a manager).
|
|
232
|
-
* With one, it approves an open request from the other end, or becomes a request to that end's
|
|
233
|
-
* 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.
|
|
234
97
|
*/
|
|
235
98
|
export declare const hubGrants: import("@agentorg/sdk").RpcInterface<"hub.grants", {
|
|
236
|
-
/** A request made by `bind` has an empty reason; `request` gives one. */
|
|
237
99
|
bind: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
238
100
|
consumer: z.ZodString;
|
|
239
101
|
slot: z.ZodString;
|
|
240
102
|
provider: z.ZodString;
|
|
241
103
|
export: z.ZodString;
|
|
242
|
-
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
243
|
-
bound: z.ZodLiteral<true>;
|
|
244
104
|
}, z.core.$strip>, z.ZodObject<{
|
|
245
|
-
bound: z.ZodLiteral<
|
|
246
|
-
|
|
247
|
-
}, z.core.$strip>]>>;
|
|
105
|
+
bound: z.ZodLiteral<true>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
248
107
|
/** The consumer, the provider or a manager may unbind. */
|
|
249
108
|
unbind: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
250
109
|
consumer: z.ZodString;
|
|
@@ -253,135 +112,27 @@ export declare const hubGrants: import("@agentorg/sdk").RpcInterface<"hub.grants
|
|
|
253
112
|
/**
|
|
254
113
|
* Expose an `rpc` export to one Actor: a slot made on `to`, typed by the export's interface,
|
|
255
114
|
* named `as` (by default the provider's name camelCased, `_`, and the export's last part, made
|
|
256
|
-
* unique on `to`), and bound to the export, in one step. Its authority is a binding's
|
|
257
|
-
*
|
|
258
|
-
* by calling `expose` with the request's fields. The same export already exposed to `to`
|
|
259
|
-
* 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.
|
|
260
117
|
*/
|
|
261
118
|
expose: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
262
119
|
provider: z.ZodString;
|
|
263
120
|
export: z.ZodString;
|
|
264
121
|
to: z.ZodString;
|
|
265
122
|
as: z.ZodOptional<z.ZodString>;
|
|
266
|
-
}, z.core.$strip>, z.ZodUnion<readonly [z.ZodObject<{
|
|
267
|
-
exposed: z.ZodLiteral<true>;
|
|
268
|
-
slot: z.ZodString;
|
|
269
123
|
}, z.core.$strip>, z.ZodObject<{
|
|
270
|
-
exposed: z.ZodLiteral<
|
|
124
|
+
exposed: z.ZodLiteral<true>;
|
|
271
125
|
slot: z.ZodString;
|
|
272
|
-
|
|
273
|
-
}, z.core.$strip>]>>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
274
127
|
/** Remove a slot made by `expose`, with its binding: as `unbind`, the consumer, the provider or a manager may. */
|
|
275
128
|
unexpose: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
276
129
|
to: z.ZodString;
|
|
277
130
|
slot: z.ZodString;
|
|
278
131
|
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
279
|
-
|
|
280
|
-
consumer: z.ZodString;
|
|
281
|
-
slot: z.ZodString;
|
|
282
|
-
provider: z.ZodString;
|
|
283
|
-
export: z.ZodString;
|
|
284
|
-
reason: z.ZodString;
|
|
285
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
286
|
-
requestId: z.ZodString;
|
|
287
|
-
}, z.core.$strip>>;
|
|
288
|
-
/** The open requests the caller could approve. */
|
|
289
|
-
requests: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
290
|
-
requests: z.ZodArray<z.ZodObject<{
|
|
291
|
-
consumer: z.ZodString;
|
|
292
|
-
slot: z.ZodString;
|
|
293
|
-
provider: z.ZodString;
|
|
294
|
-
export: z.ZodString;
|
|
295
|
-
requestId: z.ZodString;
|
|
296
|
-
needs: z.ZodEnum<{
|
|
297
|
-
export: "export";
|
|
298
|
-
slot: "slot";
|
|
299
|
-
}>;
|
|
300
|
-
reason: z.ZodString;
|
|
301
|
-
requestedBy: z.ZodString;
|
|
302
|
-
at: z.ZodString;
|
|
303
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
304
|
-
}, z.core.$strip>>;
|
|
305
|
-
}, z.core.$strip>>;
|
|
306
|
-
decline: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
307
|
-
requestId: z.ZodString;
|
|
308
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
309
|
-
/**
|
|
310
|
-
* The caller's own requests and how each stands, newest first: how a requester that missed
|
|
311
|
-
* `decided` learns the outcome.
|
|
312
|
-
*/
|
|
313
|
-
mine: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
314
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
315
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
316
|
-
requests: z.ZodArray<z.ZodObject<{
|
|
317
|
-
consumer: z.ZodString;
|
|
318
|
-
slot: z.ZodString;
|
|
319
|
-
provider: z.ZodString;
|
|
320
|
-
export: z.ZodString;
|
|
321
|
-
requestId: z.ZodString;
|
|
322
|
-
needs: z.ZodEnum<{
|
|
323
|
-
export: "export";
|
|
324
|
-
slot: "slot";
|
|
325
|
-
}>;
|
|
326
|
-
reason: z.ZodString;
|
|
327
|
-
requestedBy: z.ZodString;
|
|
328
|
-
at: z.ZodString;
|
|
329
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
330
|
-
status: z.ZodEnum<{
|
|
331
|
-
approved: "approved";
|
|
332
|
-
closed: "closed";
|
|
333
|
-
declined: "declined";
|
|
334
|
-
open: "open";
|
|
335
|
-
}>;
|
|
336
|
-
}, z.core.$strip>>;
|
|
337
|
-
}, z.core.$strip>>;
|
|
338
|
-
}, {
|
|
339
|
-
/** A request the subscriber could approve. */
|
|
340
|
-
requested: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
341
|
-
consumer: z.ZodString;
|
|
342
|
-
slot: z.ZodString;
|
|
343
|
-
provider: z.ZodString;
|
|
344
|
-
export: z.ZodString;
|
|
345
|
-
requestId: z.ZodString;
|
|
346
|
-
needs: z.ZodEnum<{
|
|
347
|
-
export: "export";
|
|
348
|
-
slot: "slot";
|
|
349
|
-
}>;
|
|
350
|
-
reason: z.ZodString;
|
|
351
|
-
requestedBy: z.ZodString;
|
|
352
|
-
at: z.ZodString;
|
|
353
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
354
|
-
}, z.core.$strip>>;
|
|
355
|
-
/**
|
|
356
|
-
* A request the subscriber could approve, or made, was approved (its binding made), declined,
|
|
357
|
-
* or closed (its slot was bound to something else, or one end went away).
|
|
358
|
-
*/
|
|
359
|
-
decided: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
360
|
-
request: z.ZodObject<{
|
|
361
|
-
consumer: z.ZodString;
|
|
362
|
-
slot: z.ZodString;
|
|
363
|
-
provider: z.ZodString;
|
|
364
|
-
export: z.ZodString;
|
|
365
|
-
requestId: z.ZodString;
|
|
366
|
-
needs: z.ZodEnum<{
|
|
367
|
-
export: "export";
|
|
368
|
-
slot: "slot";
|
|
369
|
-
}>;
|
|
370
|
-
reason: z.ZodString;
|
|
371
|
-
requestedBy: z.ZodString;
|
|
372
|
-
at: z.ZodString;
|
|
373
|
-
exposed: z.ZodOptional<z.ZodLiteral<true>>;
|
|
374
|
-
}, z.core.$strip>;
|
|
375
|
-
status: z.ZodEnum<{
|
|
376
|
-
approved: "approved";
|
|
377
|
-
closed: "closed";
|
|
378
|
-
declined: "declined";
|
|
379
|
-
}>;
|
|
380
|
-
}, z.core.$strip>>;
|
|
381
|
-
}, 1>;
|
|
132
|
+
}, {}, 1>;
|
|
382
133
|
/**
|
|
383
134
|
* `hub.bindings@1`: management scope. An Actor bound to it is a manager: it holds both ends of
|
|
384
|
-
* every binding
|
|
135
|
+
* every binding, acting through `hub.grants@1`, which it needs
|
|
385
136
|
* as well. Here, the manager-wide reads.
|
|
386
137
|
*/
|
|
387
138
|
export declare const hubBindings: import("@agentorg/sdk").RpcInterface<"hub.bindings", {
|
|
@@ -405,7 +156,6 @@ export declare const ExportEntry: z.ZodObject<{
|
|
|
405
156
|
export: z.ZodString;
|
|
406
157
|
interface: z.ZodString;
|
|
407
158
|
hash: z.ZodString;
|
|
408
|
-
dynamic: z.ZodBoolean;
|
|
409
159
|
}, z.core.$strip>;
|
|
410
160
|
/** `hub.exports@1`: what each Actor offers right now. */
|
|
411
161
|
export declare const hubExports: import("@agentorg/sdk").RpcInterface<"hub.exports", {
|
|
@@ -417,7 +167,6 @@ export declare const hubExports: import("@agentorg/sdk").RpcInterface<"hub.expor
|
|
|
417
167
|
export: z.ZodString;
|
|
418
168
|
interface: z.ZodString;
|
|
419
169
|
hash: z.ZodString;
|
|
420
|
-
dynamic: z.ZodBoolean;
|
|
421
170
|
}, z.core.$strip>>;
|
|
422
171
|
}, z.core.$strip>>;
|
|
423
172
|
}, {
|
|
@@ -6,130 +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
|
-
});
|
|
85
|
-
/** One line of an Actor's log, from its `ctx.log` or its process's own output. */
|
|
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
30
|
});
|
|
93
|
-
/** `hub.actors@1`: Actors
|
|
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
|
-
/** Its newest log lines, oldest first. */
|
|
124
|
-
logs: method({
|
|
125
|
-
input: z.object({ actorId: Id, limit: z.number().int().min(1).max(1000).optional() }),
|
|
126
|
-
output: z.object({ lines: z.array(LogLine) }),
|
|
127
|
-
}),
|
|
128
55
|
},
|
|
129
56
|
events: {
|
|
130
57
|
/**
|
|
131
|
-
* An Actor's record may differ: it was made
|
|
132
|
-
*
|
|
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`.
|
|
133
60
|
*/
|
|
134
61
|
changed: event(z.object({ actor: Id })),
|
|
135
62
|
},
|
|
@@ -148,90 +75,36 @@ export const Binding = z.object({
|
|
|
148
75
|
/** A slot made at run time by `hub.grants.expose`: it goes with this binding. */
|
|
149
76
|
exposed: z.literal(true).optional(),
|
|
150
77
|
});
|
|
151
|
-
export const BindingRequest = z.object({
|
|
152
|
-
requestId: Id,
|
|
153
|
-
...Wiring,
|
|
154
|
-
/** The end the requester lacks: `export` (provider, holders, managers) or `slot` (consumer, managers). */
|
|
155
|
-
needs: z.enum(["export", "slot"]),
|
|
156
|
-
reason: z.string(),
|
|
157
|
-
requestedBy: Id,
|
|
158
|
-
at: z.string(),
|
|
159
|
-
/**
|
|
160
|
-
* A request to expose: `slot` is the name the slot will have on `consumer`, made when it is
|
|
161
|
-
* approved. Approve it with `expose({provider, export, to: consumer, as: slot})`.
|
|
162
|
-
*/
|
|
163
|
-
exposed: z.literal(true).optional(),
|
|
164
|
-
});
|
|
165
78
|
/**
|
|
166
79
|
* `hub.grants@1`: binding with the caller's own authority, so it is safe to give any Actor. A
|
|
167
80
|
* binding needs both ends: the export side (the provider, an Actor already bound to that export,
|
|
168
|
-
* or a manager) and the slot side (the consumer itself, or a manager).
|
|
169
|
-
* With one, it approves an open request from the other end, or becomes a request to that end's
|
|
170
|
-
* 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.
|
|
171
82
|
*/
|
|
172
83
|
export const hubGrants = defineInterface({
|
|
173
84
|
name: "hub.grants",
|
|
174
85
|
major: 1,
|
|
175
86
|
kind: "rpc",
|
|
176
87
|
methods: {
|
|
177
|
-
|
|
178
|
-
bind: method({
|
|
179
|
-
input: z.object(Wiring),
|
|
180
|
-
output: z.union([
|
|
181
|
-
z.object({ bound: z.literal(true) }),
|
|
182
|
-
z.object({ bound: z.literal(false), requestId: Id }),
|
|
183
|
-
]),
|
|
184
|
-
}),
|
|
88
|
+
bind: method({ input: z.object(Wiring), output: z.object({ bound: z.literal(true) }) }),
|
|
185
89
|
/** The consumer, the provider or a manager may unbind. */
|
|
186
90
|
unbind: method({ input: z.object({ consumer: Id, slot: Name }), output: Empty }),
|
|
187
91
|
/**
|
|
188
92
|
* Expose an `rpc` export to one Actor: a slot made on `to`, typed by the export's interface,
|
|
189
93
|
* named `as` (by default the provider's name camelCased, `_`, and the export's last part, made
|
|
190
|
-
* unique on `to`), and bound to the export, in one step. Its authority is a binding's
|
|
191
|
-
*
|
|
192
|
-
* by calling `expose` with the request's fields. The same export already exposed to `to`
|
|
193
|
-
* 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.
|
|
194
96
|
*/
|
|
195
97
|
expose: method({
|
|
196
98
|
input: z.object({ provider: Id, export: Name, to: Id, as: SlotName.optional() }),
|
|
197
|
-
output: z.
|
|
198
|
-
z.object({ exposed: z.literal(true), slot: SlotName }),
|
|
199
|
-
z.object({ exposed: z.literal(false), slot: SlotName, requestId: Id }),
|
|
200
|
-
]),
|
|
99
|
+
output: z.object({ exposed: z.literal(true), slot: SlotName }),
|
|
201
100
|
}),
|
|
202
101
|
/** Remove a slot made by `expose`, with its binding: as `unbind`, the consumer, the provider or a manager may. */
|
|
203
102
|
unexpose: method({ input: z.object({ to: Id, slot: SlotName }), output: Empty }),
|
|
204
|
-
request: method({
|
|
205
|
-
input: z.object({ ...Wiring, reason: z.string().min(1).max(1000) }),
|
|
206
|
-
output: z.object({ requestId: Id }),
|
|
207
|
-
}),
|
|
208
|
-
/** The open requests the caller could approve. */
|
|
209
|
-
requests: method({ input: Empty, output: z.object({ requests: z.array(BindingRequest) }) }),
|
|
210
|
-
decline: method({ input: z.object({ requestId: Id }), output: Empty }),
|
|
211
|
-
/**
|
|
212
|
-
* The caller's own requests and how each stands, newest first: how a requester that missed
|
|
213
|
-
* `decided` learns the outcome.
|
|
214
|
-
*/
|
|
215
|
-
mine: method({
|
|
216
|
-
input: z.object({ limit: z.number().int().min(1).max(1000).optional() }),
|
|
217
|
-
output: z.object({
|
|
218
|
-
requests: z.array(BindingRequest.extend({ status: z.enum(["open", "approved", "declined", "closed"]) })),
|
|
219
|
-
}),
|
|
220
|
-
}),
|
|
221
|
-
},
|
|
222
|
-
events: {
|
|
223
|
-
/** A request the subscriber could approve. */
|
|
224
|
-
requested: event(BindingRequest),
|
|
225
|
-
/**
|
|
226
|
-
* A request the subscriber could approve, or made, was approved (its binding made), declined,
|
|
227
|
-
* or closed (its slot was bound to something else, or one end went away).
|
|
228
|
-
*/
|
|
229
|
-
decided: event(z.object({ request: BindingRequest, status: z.enum(["approved", "declined", "closed"]) })),
|
|
230
103
|
},
|
|
231
104
|
});
|
|
232
105
|
/**
|
|
233
106
|
* `hub.bindings@1`: management scope. An Actor bound to it is a manager: it holds both ends of
|
|
234
|
-
* every binding
|
|
107
|
+
* every binding, acting through `hub.grants@1`, which it needs
|
|
235
108
|
* as well. Here, the manager-wide reads.
|
|
236
109
|
*/
|
|
237
110
|
export const hubBindings = defineInterface({
|
|
@@ -250,7 +123,6 @@ export const ExportEntry = z.object({
|
|
|
250
123
|
export: Name,
|
|
251
124
|
interface: z.string(),
|
|
252
125
|
hash: Hash,
|
|
253
|
-
dynamic: z.boolean(),
|
|
254
126
|
});
|
|
255
127
|
/** `hub.exports@1`: what each Actor offers right now. */
|
|
256
128
|
export const hubExports = defineInterface({
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
export { Account, accountLogin, LoginState } from "./account-login.js";
|
|
2
|
+
export { AgentStatus, Answers, agentProvider, Creatable, CreatableId, } from "./agent-provider.js";
|
|
3
|
+
export { agentSettings, SKILL_FILE_MAX, SkillEntry, SkillName, SkillPath, } from "./agent-settings.js";
|
|
2
4
|
export { ChatMessage, ChatState, ChatStatus, ChatTool, chat } from "./chat.js";
|
|
3
|
-
export {
|
|
4
|
-
export { Actor, ActorState, AuditEntry, Binding, BindingRequest, ExportEntry, hubActors, hubAudit, hubBindings, hubExports, hubGrants, hubPackages, LogLine, Package, } from "./hub.js";
|
|
5
|
-
export { Composition, installer } from "./installer.js";
|
|
5
|
+
export { Actor, ActorState, AuditEntry, Binding, ExportEntry, hubActors, hubAudit, hubBindings, hubExports, hubGrants, } from "./hub.js";
|
|
6
6
|
export { kv } from "./kv.js";
|
|
7
|
-
export { layout, Placement } from "./layout.js";
|
|
8
7
|
export { Item, llmSession, OutputItem, Tool } from "./llm-session.js";
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { uiView } from "./ui-view.js";
|
|
8
|
+
export { agents, ConnectionOrigin, connections, skills } from "./manager.js";
|
|
9
|
+
export { ConnectionKind, ConnectionParams, ConnectionSecrets, ConnectionState, ConnectionStatus, ConnectionTarget, ConnectionTool, mcpProvider, } from "./mcp-provider.js";
|
|
10
|
+
export { ToolEntry, tools } from "./tools.js";
|