@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,12 +1,10 @@
|
|
|
1
1
|
import type { DescribedInterface } from "@agentorg/sdk";
|
|
2
|
-
/** A part of an interface with its own schema: a method's input or output, an event
|
|
2
|
+
/** A part of an interface with its own schema: a method's input or output, or an event. */
|
|
3
3
|
export type Part = {
|
|
4
4
|
method: string;
|
|
5
5
|
side: "input" | "output";
|
|
6
6
|
} | {
|
|
7
7
|
event: string;
|
|
8
|
-
} | {
|
|
9
|
-
open: true;
|
|
10
8
|
};
|
|
11
9
|
/** How long checking one value may take, once compiled, before it is refused and its worker replaced. */
|
|
12
10
|
export declare const CHECK_BUDGET_MS = 250;
|
|
@@ -1,28 +1,16 @@
|
|
|
1
1
|
import { availableParallelism } from "node:os";
|
|
2
2
|
import { Worker } from "node:worker_threads";
|
|
3
3
|
import { Refused } from "@agentorg/sdk";
|
|
4
|
-
const describe = (part) => "method" in part
|
|
5
|
-
? `${part.method} ${part.side}`
|
|
6
|
-
: "event" in part
|
|
7
|
-
? `${part.event} event`
|
|
8
|
-
: "open";
|
|
4
|
+
const describe = (part) => "method" in part ? `${part.method} ${part.side}` : `${part.event} event`;
|
|
9
5
|
function schemaOf(iface, part) {
|
|
10
6
|
if ("method" in part)
|
|
11
|
-
return
|
|
7
|
+
return Object.hasOwn(iface.methods, part.method)
|
|
12
8
|
? iface.methods[part.method]?.[part.side]
|
|
13
9
|
: undefined;
|
|
14
|
-
|
|
15
|
-
return iface.kind === "rpc" && Object.hasOwn(iface.events, part.event)
|
|
16
|
-
? iface.events[part.event]
|
|
17
|
-
: undefined;
|
|
18
|
-
return iface.kind === "stream" ? iface.open : undefined;
|
|
10
|
+
return Object.hasOwn(iface.events, part.event) ? iface.events[part.event] : undefined;
|
|
19
11
|
}
|
|
20
12
|
const keyOf = (iface, part) => `${iface.hash} ${describe(part)}`;
|
|
21
13
|
function partsOf(iface) {
|
|
22
|
-
if (iface.kind === "stream")
|
|
23
|
-
return [{ open: true }];
|
|
24
|
-
if (iface.kind !== "rpc")
|
|
25
|
-
return [];
|
|
26
14
|
return [
|
|
27
15
|
...Object.keys(iface.methods).flatMap((method) => [
|
|
28
16
|
{ method, side: "input" },
|
|
@@ -23,12 +23,9 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@agentorg/interfaces": "0.0.0",
|
|
26
|
-
"@agentorg/kit": "0.0.0",
|
|
27
26
|
"@agentorg/sdk": "0.0.0",
|
|
28
27
|
"@agentorg/wire": "0.0.0",
|
|
29
28
|
"ajv": "^8.20.0",
|
|
30
|
-
"react": "^19.3.1",
|
|
31
|
-
"react-dom": "^19.3.1",
|
|
32
29
|
"ws": "^8.22.1",
|
|
33
30
|
"zod": "^4.6.7"
|
|
34
31
|
},
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A creatable's id, unique within its provider. */
|
|
3
|
+
export declare const CreatableId: z.ZodString;
|
|
4
|
+
/** What the person gives at creation, by the id of each ask. Never a secret. */
|
|
5
|
+
export declare const Answers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
6
|
+
/**
|
|
7
|
+
* A predefined set an agent is made from. Its skills are listed by name and files, `SKILL.md` among
|
|
8
|
+
* them; `skill` reads each file.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Creatable: z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
title: z.ZodString;
|
|
13
|
+
description: z.ZodString;
|
|
14
|
+
instructions: z.ZodString;
|
|
15
|
+
asks: z.ZodArray<z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
description: z.ZodOptional<z.ZodString>;
|
|
19
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
files: z.ZodArray<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
mcp: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
|
+
how: z.ZodLiteral<"pick">;
|
|
27
|
+
slot: z.ZodString;
|
|
28
|
+
title: z.ZodString;
|
|
29
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
+
how: z.ZodLiteral<"create">;
|
|
31
|
+
slot: z.ZodString;
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
kind: z.ZodString;
|
|
34
|
+
params: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
35
|
+
fromAnswers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
36
|
+
}, z.core.$strip>], "how">>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
/**
|
|
39
|
+
* How an agent stands now, as what runs it knows: `starting`, `running`, `stopped` by the person,
|
|
40
|
+
* or `down`, which it didn't ask for. `detail` says why it is down.
|
|
41
|
+
*/
|
|
42
|
+
export declare const AgentStatus: z.ZodObject<{
|
|
43
|
+
state: z.ZodEnum<{
|
|
44
|
+
down: "down";
|
|
45
|
+
running: "running";
|
|
46
|
+
starting: "starting";
|
|
47
|
+
stopped: "stopped";
|
|
48
|
+
}>;
|
|
49
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
/**
|
|
52
|
+
* `agent.provider@1`: a program that makes agents: an execution system and its way of running one.
|
|
53
|
+
* It says what it can create, and makes, starts, stops and removes the agents it made; each is an
|
|
54
|
+
* Actor. `status`, `start`, `stop` and `remove` are refused `unknown` for an agent it didn't make.
|
|
55
|
+
*/
|
|
56
|
+
export declare const agentProvider: import("@agentorg/sdk").RpcInterface<"agent.provider", {
|
|
57
|
+
creatable: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
creatables: z.ZodArray<z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
title: z.ZodString;
|
|
61
|
+
description: z.ZodString;
|
|
62
|
+
instructions: z.ZodString;
|
|
63
|
+
asks: z.ZodArray<z.ZodObject<{
|
|
64
|
+
id: z.ZodString;
|
|
65
|
+
title: z.ZodString;
|
|
66
|
+
description: z.ZodOptional<z.ZodString>;
|
|
67
|
+
optional: z.ZodOptional<z.ZodLiteral<true>>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
files: z.ZodArray<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
mcp: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
how: z.ZodLiteral<"pick">;
|
|
75
|
+
slot: z.ZodString;
|
|
76
|
+
title: z.ZodString;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
+
how: z.ZodLiteral<"create">;
|
|
79
|
+
slot: z.ZodString;
|
|
80
|
+
title: z.ZodString;
|
|
81
|
+
kind: z.ZodString;
|
|
82
|
+
params: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
83
|
+
fromAnswers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
84
|
+
}, z.core.$strip>], "how">>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
/** A file of a skill a creatable comes with. Refused `unknown` when there is no such file. */
|
|
88
|
+
skill: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
89
|
+
creatable: z.ZodString;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
path: z.ZodString;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
text: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
/**
|
|
96
|
+
* Make and start an agent of a creatable, named `name`. `settings` is the agent's slot typed
|
|
97
|
+
* `agent.settings@1`, for whoever serves it to bind, and `chat` its export typed `chat@1`.
|
|
98
|
+
* Refused `unknown` for a creatable it doesn't offer, and `invalid` when an ask with no
|
|
99
|
+
* `optional` has no answer.
|
|
100
|
+
*/
|
|
101
|
+
create: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
102
|
+
creatable: z.ZodString;
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
answers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
agent: z.ZodString;
|
|
107
|
+
settings: z.ZodString;
|
|
108
|
+
chat: z.ZodString;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
status: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
111
|
+
agent: z.ZodString;
|
|
112
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
+
state: z.ZodEnum<{
|
|
114
|
+
down: "down";
|
|
115
|
+
running: "running";
|
|
116
|
+
starting: "starting";
|
|
117
|
+
stopped: "stopped";
|
|
118
|
+
}>;
|
|
119
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
start: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
122
|
+
agent: z.ZodString;
|
|
123
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
124
|
+
/** It ends the agent's process; its record, bindings and connections stay. */
|
|
125
|
+
stop: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
126
|
+
agent: z.ZodString;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
128
|
+
/** Final: the agent's Actor is closed. */
|
|
129
|
+
remove: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
130
|
+
agent: z.ZodString;
|
|
131
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
132
|
+
}, {}, 1>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineInterface, method } from "@agentorg/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SKILL_FILE_MAX, SkillName, SkillPath } from "./agent-settings.js";
|
|
4
|
+
import { Id, Name, SlotName } from "./hub.js";
|
|
5
|
+
import { ConnectionKind, ConnectionParams } from "./mcp-provider.js";
|
|
6
|
+
const Title = z.string().min(1).max(128);
|
|
7
|
+
const Description = z.string().max(2000);
|
|
8
|
+
/** A creatable's id, unique within its provider. */
|
|
9
|
+
export const CreatableId = z
|
|
10
|
+
.string()
|
|
11
|
+
.regex(/^[a-z][a-z0-9-]*$/)
|
|
12
|
+
.max(64);
|
|
13
|
+
const AskId = z
|
|
14
|
+
.string()
|
|
15
|
+
.regex(/^[a-z][A-Za-z0-9_]*$/)
|
|
16
|
+
.max(64);
|
|
17
|
+
/** What the person gives at creation, by the id of each ask. Never a secret. */
|
|
18
|
+
export const Answers = z.record(AskId, z.string().max(4096));
|
|
19
|
+
/** One thing a creatable asks the person when an agent is made from it. */
|
|
20
|
+
const Ask = z.object({
|
|
21
|
+
id: AskId,
|
|
22
|
+
title: Title,
|
|
23
|
+
description: Description.optional(),
|
|
24
|
+
optional: z.literal(true).optional(),
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* An MCP connection an agent of this creatable needs, exposed to it as `slot`. With `pick`, the
|
|
28
|
+
* person picks one they have. With `create`, one is made for the agent through a connected provider
|
|
29
|
+
* offering `kind`, with `params`, each top-level parameter in `fromAnswers` set to the answer it
|
|
30
|
+
* names.
|
|
31
|
+
*/
|
|
32
|
+
const McpNeed = z.discriminatedUnion("how", [
|
|
33
|
+
z.object({ how: z.literal("pick"), slot: SlotName, title: Title }),
|
|
34
|
+
z.object({
|
|
35
|
+
how: z.literal("create"),
|
|
36
|
+
slot: SlotName,
|
|
37
|
+
title: Title,
|
|
38
|
+
kind: ConnectionKind,
|
|
39
|
+
params: ConnectionParams,
|
|
40
|
+
fromAnswers: z.record(z.string(), AskId).optional(),
|
|
41
|
+
}),
|
|
42
|
+
]);
|
|
43
|
+
/**
|
|
44
|
+
* A predefined set an agent is made from. Its skills are listed by name and files, `SKILL.md` among
|
|
45
|
+
* them; `skill` reads each file.
|
|
46
|
+
*/
|
|
47
|
+
export const Creatable = z.object({
|
|
48
|
+
id: CreatableId,
|
|
49
|
+
title: Title,
|
|
50
|
+
description: Description,
|
|
51
|
+
instructions: z.string().max(200_000),
|
|
52
|
+
asks: z.array(Ask).max(32),
|
|
53
|
+
skills: z.array(z.object({ name: SkillName, files: z.array(SkillPath).min(1).max(256) })).max(64),
|
|
54
|
+
mcp: z.array(McpNeed).max(32),
|
|
55
|
+
});
|
|
56
|
+
const OnAgent = z.object({ agent: Id });
|
|
57
|
+
/**
|
|
58
|
+
* How an agent stands now, as what runs it knows: `starting`, `running`, `stopped` by the person,
|
|
59
|
+
* or `down`, which it didn't ask for. `detail` says why it is down.
|
|
60
|
+
*/
|
|
61
|
+
export const AgentStatus = z.object({
|
|
62
|
+
state: z.enum(["starting", "running", "stopped", "down"]),
|
|
63
|
+
detail: z.string().max(2000).optional(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* `agent.provider@1`: a program that makes agents: an execution system and its way of running one.
|
|
67
|
+
* It says what it can create, and makes, starts, stops and removes the agents it made; each is an
|
|
68
|
+
* Actor. `status`, `start`, `stop` and `remove` are refused `unknown` for an agent it didn't make.
|
|
69
|
+
*/
|
|
70
|
+
export const agentProvider = defineInterface({
|
|
71
|
+
name: "agent.provider",
|
|
72
|
+
major: 1,
|
|
73
|
+
kind: "rpc",
|
|
74
|
+
methods: {
|
|
75
|
+
creatable: method({
|
|
76
|
+
input: z.object({}),
|
|
77
|
+
output: z.object({ creatables: z.array(Creatable) }),
|
|
78
|
+
}),
|
|
79
|
+
/** A file of a skill a creatable comes with. Refused `unknown` when there is no such file. */
|
|
80
|
+
skill: method({
|
|
81
|
+
input: z.object({ creatable: CreatableId, name: SkillName, path: SkillPath }),
|
|
82
|
+
output: z.object({ text: z.string().max(SKILL_FILE_MAX) }),
|
|
83
|
+
}),
|
|
84
|
+
/**
|
|
85
|
+
* Make and start an agent of a creatable, named `name`. `settings` is the agent's slot typed
|
|
86
|
+
* `agent.settings@1`, for whoever serves it to bind, and `chat` its export typed `chat@1`.
|
|
87
|
+
* Refused `unknown` for a creatable it doesn't offer, and `invalid` when an ask with no
|
|
88
|
+
* `optional` has no answer.
|
|
89
|
+
*/
|
|
90
|
+
create: method({
|
|
91
|
+
input: z.object({
|
|
92
|
+
creatable: CreatableId,
|
|
93
|
+
name: Title,
|
|
94
|
+
answers: Answers,
|
|
95
|
+
}),
|
|
96
|
+
output: z.object({ agent: Id, settings: Name, chat: Name }),
|
|
97
|
+
}),
|
|
98
|
+
status: method({ input: OnAgent, output: AgentStatus }),
|
|
99
|
+
start: method({ input: OnAgent, output: z.object({}) }),
|
|
100
|
+
/** It ends the agent's process; its record, bindings and connections stay. */
|
|
101
|
+
stop: method({ input: OnAgent, output: z.object({}) }),
|
|
102
|
+
/** Final: the agent's Actor is closed. */
|
|
103
|
+
remove: method({ input: OnAgent, output: z.object({}) }),
|
|
104
|
+
},
|
|
105
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** A skill's name, as the Agent Skills convention writes it. */
|
|
3
|
+
export declare const SkillName: z.ZodString;
|
|
4
|
+
/**
|
|
5
|
+
* A file of a skill: a relative path inside its folder, of plain segments, never `.` or `..`, with
|
|
6
|
+
* no backslash or control character.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SkillPath: z.ZodString;
|
|
9
|
+
/** The most one file of a skill holds, as text. */
|
|
10
|
+
export declare const SKILL_FILE_MAX: number;
|
|
11
|
+
/** What a list says of a skill, from its `SKILL.md` front matter. */
|
|
12
|
+
export declare const SkillEntry: z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
description: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/**
|
|
17
|
+
* `agent.settings@1`: what an agent is run with, read by the program that runs it. Each caller is
|
|
18
|
+
* answered with its own: the instructions it was given and the skills exposed to it, so an agent
|
|
19
|
+
* sees nothing of another's. It is read at each model request.
|
|
20
|
+
*/
|
|
21
|
+
export declare const agentSettings: import("@agentorg/sdk").RpcInterface<"agent.settings", {
|
|
22
|
+
get: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
instructions: z.ZodString;
|
|
24
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
description: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
29
|
+
/**
|
|
30
|
+
* A file of a skill exposed to the caller, `SKILL.md` if no `path`. Refused `unknown` when the
|
|
31
|
+
* skill isn't exposed to it or has no such file.
|
|
32
|
+
*/
|
|
33
|
+
skill: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
path: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
text: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, {
|
|
40
|
+
/** The caller's instructions or skills changed: read them again at the next request. */
|
|
41
|
+
changed: import("@agentorg/sdk").EventSpec<z.ZodObject<{}, z.core.$strip>>;
|
|
42
|
+
}, 1>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineInterface, event, method } from "@agentorg/sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** A skill's name, as the Agent Skills convention writes it. */
|
|
4
|
+
export const SkillName = z
|
|
5
|
+
.string()
|
|
6
|
+
.regex(/^[a-z0-9]+(-[a-z0-9]+)*$/)
|
|
7
|
+
.max(64);
|
|
8
|
+
/**
|
|
9
|
+
* A file of a skill: a relative path inside its folder, of plain segments, never `.` or `..`, with
|
|
10
|
+
* no backslash or control character.
|
|
11
|
+
*/
|
|
12
|
+
export const SkillPath = z
|
|
13
|
+
.string()
|
|
14
|
+
.regex(/^(?!\.\.?(\/|$))(?!.*\/\.\.?(\/|$))([^/\\\p{Cc}\p{Zl}\p{Zp}]+\/)*[^/\\\p{Cc}\p{Zl}\p{Zp}]+$/u)
|
|
15
|
+
.max(1024);
|
|
16
|
+
/** The most one file of a skill holds, as text. */
|
|
17
|
+
export const SKILL_FILE_MAX = 256 * 1024;
|
|
18
|
+
/** What a list says of a skill, from its `SKILL.md` front matter. */
|
|
19
|
+
export const SkillEntry = z.object({
|
|
20
|
+
name: SkillName,
|
|
21
|
+
description: z.string().max(1024),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* `agent.settings@1`: what an agent is run with, read by the program that runs it. Each caller is
|
|
25
|
+
* answered with its own: the instructions it was given and the skills exposed to it, so an agent
|
|
26
|
+
* sees nothing of another's. It is read at each model request.
|
|
27
|
+
*/
|
|
28
|
+
export const agentSettings = defineInterface({
|
|
29
|
+
name: "agent.settings",
|
|
30
|
+
major: 1,
|
|
31
|
+
kind: "rpc",
|
|
32
|
+
methods: {
|
|
33
|
+
get: method({
|
|
34
|
+
input: z.object({}),
|
|
35
|
+
output: z.object({
|
|
36
|
+
instructions: z.string().max(200_000),
|
|
37
|
+
skills: z.array(SkillEntry),
|
|
38
|
+
}),
|
|
39
|
+
}),
|
|
40
|
+
/**
|
|
41
|
+
* A file of a skill exposed to the caller, `SKILL.md` if no `path`. Refused `unknown` when the
|
|
42
|
+
* skill isn't exposed to it or has no such file.
|
|
43
|
+
*/
|
|
44
|
+
skill: method({
|
|
45
|
+
input: z.object({ name: SkillName, path: SkillPath.optional() }),
|
|
46
|
+
output: z.object({ text: z.string().max(SKILL_FILE_MAX) }),
|
|
47
|
+
}),
|
|
48
|
+
},
|
|
49
|
+
events: {
|
|
50
|
+
/** The caller's instructions or skills changed: read them again at the next request. */
|
|
51
|
+
changed: event(z.object({})),
|
|
52
|
+
},
|
|
53
|
+
});
|
|
@@ -125,6 +125,21 @@ export declare const chat: import("@agentorg/sdk").RpcInterface<"chat", {
|
|
|
125
125
|
retry: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
126
126
|
messageId: z.ZodString;
|
|
127
127
|
}, z.core.$strip>>;
|
|
128
|
+
/** The models this agent can use, and the one chosen; none chosen means the provider's default. */
|
|
129
|
+
models: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
130
|
+
models: z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
}, z.core.$strip>>;
|
|
134
|
+
current: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
/**
|
|
137
|
+
* Choose the model for this agent's next requests, kept with the agent; with no `model`, go
|
|
138
|
+
* back to the provider's default. Refused `unknown` when the model isn't one of `models`.
|
|
139
|
+
*/
|
|
140
|
+
setModel: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
|
|
141
|
+
model: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>;
|
|
128
143
|
}, {
|
|
129
144
|
message: import("@agentorg/sdk").EventSpec<z.ZodObject<{
|
|
130
145
|
id: z.ZodString;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineInterface, event, method } from "@agentorg/sdk";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
const MessageId = z.string().min(1).max(128);
|
|
4
|
+
const ChatModelId = z.string().min(1).max(128);
|
|
4
5
|
/**
|
|
5
6
|
* A tool call a `tool` message stands for: its name, whether it is `running` or ended `done` or
|
|
6
7
|
* `refused`, and its input (the call's JSON arguments) and output (its JSON result, or the
|
|
@@ -69,6 +70,19 @@ export const chat = defineInterface({
|
|
|
69
70
|
* message has been sent.
|
|
70
71
|
*/
|
|
71
72
|
retry: method({ input: z.object({}), output: z.object({ messageId: MessageId }) }),
|
|
73
|
+
/** The models this agent can use, and the one chosen; none chosen means the provider's default. */
|
|
74
|
+
models: method({
|
|
75
|
+
input: z.object({}),
|
|
76
|
+
output: z.object({
|
|
77
|
+
models: z.array(z.object({ id: ChatModelId, name: z.string().max(256) })),
|
|
78
|
+
current: ChatModelId.optional(),
|
|
79
|
+
}),
|
|
80
|
+
}),
|
|
81
|
+
/**
|
|
82
|
+
* Choose the model for this agent's next requests, kept with the agent; with no `model`, go
|
|
83
|
+
* back to the provider's default. Refused `unknown` when the model isn't one of `models`.
|
|
84
|
+
*/
|
|
85
|
+
setModel: method({ input: z.object({ model: ChatModelId.optional() }), output: z.object({}) }),
|
|
72
86
|
},
|
|
73
87
|
events: {
|
|
74
88
|
message: event(ChatMessage),
|