@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.
Files changed (206) hide show
  1. package/README.md +18 -102
  2. package/dist/node_modules/@agentorg/hub/dist/src/hub-actor.d.ts +2 -7
  3. package/dist/node_modules/@agentorg/hub/dist/src/hub-actor.js +4 -144
  4. package/dist/node_modules/@agentorg/hub/dist/src/index.d.ts +1 -3
  5. package/dist/node_modules/@agentorg/hub/dist/src/index.js +1 -3
  6. package/dist/node_modules/@agentorg/hub/dist/src/router.d.ts +6 -57
  7. package/dist/node_modules/@agentorg/hub/dist/src/router.js +38 -413
  8. package/dist/node_modules/@agentorg/hub/dist/src/state.d.ts +17 -317
  9. package/dist/node_modules/@agentorg/hub/dist/src/state.js +42 -536
  10. package/dist/node_modules/@agentorg/hub/dist/src/validate.d.ts +1 -3
  11. package/dist/node_modules/@agentorg/hub/dist/src/validate.js +3 -15
  12. package/dist/node_modules/@agentorg/hub/package.json +0 -3
  13. package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.d.ts +132 -0
  14. package/dist/node_modules/@agentorg/interfaces/dist/src/agent-provider.js +105 -0
  15. package/dist/node_modules/@agentorg/interfaces/dist/src/agent-settings.d.ts +42 -0
  16. package/dist/node_modules/@agentorg/interfaces/dist/src/agent-settings.js +53 -0
  17. package/dist/node_modules/@agentorg/interfaces/dist/src/chat.d.ts +15 -0
  18. package/dist/node_modules/@agentorg/interfaces/dist/src/chat.js +14 -0
  19. package/dist/node_modules/@agentorg/interfaces/dist/src/hub.d.ts +16 -286
  20. package/dist/node_modules/@agentorg/interfaces/dist/src/hub.js +17 -159
  21. package/dist/node_modules/@agentorg/interfaces/dist/src/index.d.ts +6 -8
  22. package/dist/node_modules/@agentorg/interfaces/dist/src/index.js +6 -8
  23. package/dist/node_modules/@agentorg/interfaces/dist/src/kv.d.ts +2 -2
  24. package/dist/node_modules/@agentorg/interfaces/dist/src/kv.js +2 -2
  25. package/dist/node_modules/@agentorg/interfaces/dist/src/manager.d.ts +272 -0
  26. package/dist/node_modules/@agentorg/interfaces/dist/src/manager.js +185 -0
  27. package/dist/node_modules/@agentorg/interfaces/dist/src/mcp-provider.d.ts +88 -0
  28. package/dist/node_modules/@agentorg/interfaces/dist/src/mcp-provider.js +78 -0
  29. package/dist/node_modules/@agentorg/interfaces/dist/src/tools.d.ts +39 -0
  30. package/dist/node_modules/@agentorg/interfaces/dist/src/tools.js +43 -0
  31. package/dist/node_modules/@agentorg/manager/dist/src/index.d.ts +1 -0
  32. package/dist/node_modules/@agentorg/manager/dist/src/index.js +1 -0
  33. package/dist/node_modules/@agentorg/manager/dist/src/manager.d.ts +21 -0
  34. package/dist/node_modules/@agentorg/manager/dist/src/manager.js +528 -0
  35. package/dist/node_modules/@agentorg/manager/dist/src/skills.d.ts +25 -0
  36. package/dist/node_modules/@agentorg/manager/dist/src/skills.js +145 -0
  37. package/dist/node_modules/@agentorg/manager/package.json +30 -0
  38. package/dist/node_modules/@agentorg/mcp/dist/src/connection.d.ts +33 -0
  39. package/dist/node_modules/@agentorg/mcp/dist/src/connection.js +290 -0
  40. package/dist/node_modules/@agentorg/mcp/dist/src/index.d.ts +1 -0
  41. package/dist/node_modules/@agentorg/mcp/dist/src/index.js +1 -0
  42. package/dist/node_modules/@agentorg/mcp/dist/src/kinds.d.ts +50 -0
  43. package/dist/node_modules/@agentorg/mcp/dist/src/kinds.js +69 -0
  44. package/dist/node_modules/@agentorg/mcp/dist/src/provider.d.ts +22 -0
  45. package/dist/node_modules/@agentorg/mcp/dist/src/provider.js +167 -0
  46. package/dist/node_modules/@agentorg/mcp/package.json +31 -0
  47. package/dist/node_modules/@agentorg/sdk/dist/src/cli.js +3 -23
  48. package/dist/node_modules/@agentorg/sdk/dist/src/client.d.ts +4 -25
  49. package/dist/node_modules/@agentorg/sdk/dist/src/client.js +5 -55
  50. package/dist/node_modules/@agentorg/sdk/dist/src/errors.d.ts +1 -1
  51. package/dist/node_modules/@agentorg/sdk/dist/src/errors.js +3 -3
  52. package/dist/node_modules/@agentorg/sdk/dist/src/index.d.ts +2 -2
  53. package/dist/node_modules/@agentorg/sdk/dist/src/index.js +1 -1
  54. package/dist/node_modules/@agentorg/sdk/dist/src/interface.d.ts +6 -34
  55. package/dist/node_modules/@agentorg/sdk/dist/src/interface.js +3 -24
  56. package/dist/node_modules/@agentorg/sdk/dist/src/module-host.d.ts +8 -17
  57. package/dist/node_modules/@agentorg/sdk/dist/src/module-host.js +15 -87
  58. package/dist/node_modules/@agentorg/sdk/dist/src/module.d.ts +10 -76
  59. package/dist/node_modules/@agentorg/sdk/dist/src/module.js +3 -23
  60. package/dist/node_modules/@agentorg/sdk/dist/src/person-commands.js +0 -5
  61. package/dist/node_modules/@agentorg/sdk/dist/src/runtime.d.ts +3 -27
  62. package/dist/node_modules/@agentorg/sdk/dist/src/runtime.js +5 -100
  63. package/dist/node_modules/@agentorg/sdk/dist/src/testing.d.ts +7 -8
  64. package/dist/node_modules/@agentorg/sdk/dist/src/testing.js +12 -24
  65. package/dist/node_modules/@agentorg/sdk/package.json +4 -37
  66. package/dist/node_modules/@agentorg/shell/dist/app.css +3435 -739
  67. package/dist/node_modules/@agentorg/shell/dist/app.js +204 -202
  68. package/dist/node_modules/@agentorg/shell/package.json +18 -10
  69. package/dist/node_modules/@agentorg/wire/dist/src/frames.d.ts +2 -3
  70. package/dist/node_modules/@agentorg/wire/dist/src/frames.js +2 -3
  71. package/dist/node_modules/@agentorg/wire/dist/src/ops.d.ts +5 -34
  72. package/dist/node_modules/@agentorg/wire/dist/src/ops.js +2 -17
  73. package/dist/node_modules/assistant/dist/src/agent.d.ts +62 -0
  74. package/dist/node_modules/assistant/dist/src/agent.js +226 -0
  75. package/dist/node_modules/assistant/dist/src/engine.d.ts +23 -0
  76. package/dist/node_modules/assistant/dist/src/engine.js +88 -0
  77. package/dist/node_modules/assistant/dist/src/history.d.ts +97 -0
  78. package/dist/node_modules/assistant/dist/src/history.js +235 -0
  79. package/dist/node_modules/assistant/dist/src/local-store.d.ts +3 -0
  80. package/dist/node_modules/assistant/dist/src/local-store.js +58 -0
  81. package/dist/node_modules/assistant/dist/src/provider.d.ts +21 -0
  82. package/dist/node_modules/assistant/dist/src/provider.js +231 -0
  83. package/dist/node_modules/assistant/dist/src/settings.d.ts +17 -0
  84. package/dist/node_modules/assistant/dist/src/settings.js +43 -0
  85. package/dist/node_modules/assistant/dist/src/tools.d.ts +74 -0
  86. package/dist/node_modules/assistant/dist/src/tools.js +123 -0
  87. package/dist/node_modules/assistant/package.json +29 -0
  88. package/dist/node_modules/chatgpt/dist/src/account.d.ts +52 -0
  89. package/dist/node_modules/chatgpt/dist/src/account.js +270 -0
  90. package/dist/node_modules/chatgpt/dist/src/encoding.d.ts +7 -0
  91. package/dist/node_modules/chatgpt/dist/src/encoding.js +20 -0
  92. package/dist/node_modules/chatgpt/dist/src/file-store.d.ts +9 -0
  93. package/dist/node_modules/chatgpt/dist/src/file-store.js +68 -0
  94. package/dist/node_modules/chatgpt/dist/src/index.d.ts +1 -0
  95. package/dist/node_modules/chatgpt/dist/src/index.js +1 -0
  96. package/dist/node_modules/chatgpt/dist/src/jwt.d.ts +15 -0
  97. package/dist/node_modules/chatgpt/dist/src/jwt.js +37 -0
  98. package/dist/node_modules/chatgpt/dist/src/oauth.d.ts +43 -0
  99. package/dist/node_modules/chatgpt/dist/src/oauth.js +104 -0
  100. package/dist/node_modules/chatgpt/dist/src/program.d.ts +23 -0
  101. package/dist/node_modules/chatgpt/dist/src/program.js +41 -0
  102. package/dist/node_modules/chatgpt/dist/src/responses.d.ts +54 -0
  103. package/dist/node_modules/chatgpt/dist/src/responses.js +300 -0
  104. package/dist/node_modules/chatgpt/dist/src/serve.d.ts +65 -0
  105. package/dist/node_modules/chatgpt/dist/src/serve.js +46 -0
  106. package/dist/node_modules/chatgpt/package.json +33 -0
  107. package/dist/src/api.d.ts +5 -34
  108. package/dist/src/api.js +6 -68
  109. package/dist/src/cli.js +3 -7
  110. package/dist/src/gateway.d.ts +6 -7
  111. package/dist/src/gateway.js +39 -285
  112. package/dist/src/index.d.ts +4 -5
  113. package/dist/src/index.js +3 -4
  114. package/dist/src/notes.d.ts +11 -0
  115. package/dist/src/notes.js +64 -0
  116. package/dist/src/oauth.d.ts +16 -0
  117. package/dist/src/oauth.js +46 -0
  118. package/dist/src/programs.d.ts +29 -0
  119. package/dist/src/programs.js +171 -0
  120. package/package.json +3 -11
  121. package/dist/bundled/index.json +0 -6
  122. package/dist/bundled/sha256-0e91cc3d0e9762b81abc2427b5496b20f383abcd6fb97d928a8d50e956b54d1f.agentorg +0 -0
  123. package/dist/bundled/sha256-1f64ca62a0209d767d6aa6c4feb50b0653d60f10bebbc301f79bd3a37e0153c1.agentorg +0 -0
  124. package/dist/bundled/sha256-4055f8fddf6b90f3d356543f554b2a9e9a2c4a8827a8774f8f87952dc1692331.agentorg +0 -0
  125. package/dist/bundled/sha256-e356ea3c1899138a8494baf521556831006f38534fa9e92ae873e7e6956c3a46.agentorg +0 -0
  126. package/dist/node_modules/@agentorg/hub/dist/src/build.d.ts +0 -17
  127. package/dist/node_modules/@agentorg/hub/dist/src/build.js +0 -120
  128. package/dist/node_modules/@agentorg/hub/dist/src/logs.d.ts +0 -33
  129. package/dist/node_modules/@agentorg/hub/dist/src/logs.js +0 -162
  130. package/dist/node_modules/@agentorg/hub/dist/src/net.d.ts +0 -41
  131. package/dist/node_modules/@agentorg/hub/dist/src/net.js +0 -265
  132. package/dist/node_modules/@agentorg/hub/dist/src/processes.d.ts +0 -78
  133. package/dist/node_modules/@agentorg/hub/dist/src/processes.js +0 -485
  134. package/dist/node_modules/@agentorg/hub/dist/src/storage.d.ts +0 -38
  135. package/dist/node_modules/@agentorg/hub/dist/src/storage.js +0 -194
  136. package/dist/node_modules/@agentorg/interfaces/dist/src/http-egress.d.ts +0 -6
  137. package/dist/node_modules/@agentorg/interfaces/dist/src/http-egress.js +0 -7
  138. package/dist/node_modules/@agentorg/interfaces/dist/src/installer.d.ts +0 -191
  139. package/dist/node_modules/@agentorg/interfaces/dist/src/installer.js +0 -136
  140. package/dist/node_modules/@agentorg/interfaces/dist/src/layout.d.ts +0 -47
  141. package/dist/node_modules/@agentorg/interfaces/dist/src/layout.js +0 -52
  142. package/dist/node_modules/@agentorg/interfaces/dist/src/rules.d.ts +0 -35
  143. package/dist/node_modules/@agentorg/interfaces/dist/src/rules.js +0 -37
  144. package/dist/node_modules/@agentorg/interfaces/dist/src/storage-admin.d.ts +0 -23
  145. package/dist/node_modules/@agentorg/interfaces/dist/src/storage-admin.js +0 -31
  146. package/dist/node_modules/@agentorg/interfaces/dist/src/ui-shell.d.ts +0 -14
  147. package/dist/node_modules/@agentorg/interfaces/dist/src/ui-shell.js +0 -26
  148. package/dist/node_modules/@agentorg/interfaces/dist/src/ui-view.d.ts +0 -27
  149. package/dist/node_modules/@agentorg/interfaces/dist/src/ui-view.js +0 -26
  150. package/dist/node_modules/@agentorg/kit/dist/src/chat.d.ts +0 -37
  151. package/dist/node_modules/@agentorg/kit/dist/src/chat.js +0 -131
  152. package/dist/node_modules/@agentorg/kit/dist/src/components.d.ts +0 -94
  153. package/dist/node_modules/@agentorg/kit/dist/src/components.js +0 -66
  154. package/dist/node_modules/@agentorg/kit/dist/src/icons.d.ts +0 -17
  155. package/dist/node_modules/@agentorg/kit/dist/src/icons.js +0 -30
  156. package/dist/node_modules/@agentorg/kit/dist/src/index.d.ts +0 -6
  157. package/dist/node_modules/@agentorg/kit/dist/src/index.js +0 -10
  158. package/dist/node_modules/@agentorg/kit/dist/src/markdown.d.ts +0 -9
  159. package/dist/node_modules/@agentorg/kit/dist/src/markdown.js +0 -14
  160. package/dist/node_modules/@agentorg/kit/dist/src/resizable.d.ts +0 -5
  161. package/dist/node_modules/@agentorg/kit/dist/src/resizable.js +0 -8
  162. package/dist/node_modules/@agentorg/kit/dist/src/styles.d.ts +0 -11
  163. package/dist/node_modules/@agentorg/kit/dist/src/styles.js +0 -166
  164. package/dist/node_modules/@agentorg/kit/package.json +0 -44
  165. package/dist/node_modules/@agentorg/sdk/dist/frame/runtime.js +0 -753
  166. package/dist/node_modules/@agentorg/sdk/dist/host/runner.js +0 -21963
  167. package/dist/node_modules/@agentorg/sdk/dist/src/build.d.ts +0 -2
  168. package/dist/node_modules/@agentorg/sdk/dist/src/build.js +0 -2
  169. package/dist/node_modules/@agentorg/sdk/dist/src/client-http.d.ts +0 -24
  170. package/dist/node_modules/@agentorg/sdk/dist/src/client-http.js +0 -247
  171. package/dist/node_modules/@agentorg/sdk/dist/src/describe.d.ts +0 -13
  172. package/dist/node_modules/@agentorg/sdk/dist/src/describe.js +0 -16
  173. package/dist/node_modules/@agentorg/sdk/dist/src/frame-base.d.ts +0 -8
  174. package/dist/node_modules/@agentorg/sdk/dist/src/frame-base.js +0 -64
  175. package/dist/node_modules/@agentorg/sdk/dist/src/frame-entry.d.ts +0 -1
  176. package/dist/node_modules/@agentorg/sdk/dist/src/frame-entry.js +0 -35
  177. package/dist/node_modules/@agentorg/sdk/dist/src/frame-host.d.ts +0 -57
  178. package/dist/node_modules/@agentorg/sdk/dist/src/frame-host.js +0 -293
  179. package/dist/node_modules/@agentorg/sdk/dist/src/frame-protocol.d.ts +0 -124
  180. package/dist/node_modules/@agentorg/sdk/dist/src/frame-protocol.js +0 -16
  181. package/dist/node_modules/@agentorg/sdk/dist/src/frame.d.ts +0 -25
  182. package/dist/node_modules/@agentorg/sdk/dist/src/frame.js +0 -248
  183. package/dist/node_modules/@agentorg/sdk/dist/src/host-main.d.ts +0 -1
  184. package/dist/node_modules/@agentorg/sdk/dist/src/host-main.js +0 -60
  185. package/dist/node_modules/@agentorg/sdk/dist/src/host.d.ts +0 -25
  186. package/dist/node_modules/@agentorg/sdk/dist/src/host.js +0 -92
  187. package/dist/node_modules/@agentorg/sdk/dist/src/manifest-api.d.ts +0 -2
  188. package/dist/node_modules/@agentorg/sdk/dist/src/manifest-api.js +0 -2
  189. package/dist/node_modules/@agentorg/sdk/dist/src/manifest.d.ts +0 -56
  190. package/dist/node_modules/@agentorg/sdk/dist/src/manifest.js +0 -165
  191. package/dist/node_modules/@agentorg/sdk/dist/src/package.d.ts +0 -60
  192. package/dist/node_modules/@agentorg/sdk/dist/src/package.js +0 -538
  193. package/dist/node_modules/@agentorg/sdk/dist/src/tar.d.ts +0 -7
  194. package/dist/node_modules/@agentorg/sdk/dist/src/tar.js +0 -71
  195. package/dist/node_modules/@agentorg/shell/dist/agent-bindings.js +0 -59
  196. package/dist/node_modules/@agentorg/shell/src/agent-bindings.ts +0 -107
  197. package/dist/src/frames.d.ts +0 -23
  198. package/dist/src/frames.js +0 -78
  199. package/dist/src/layout.d.ts +0 -44
  200. package/dist/src/layout.js +0 -90
  201. package/dist/src/model.d.ts +0 -54
  202. package/dist/src/model.js +0 -299
  203. package/dist/src/rules.d.ts +0 -71
  204. package/dist/src/rules.js +0 -157
  205. package/dist/src/transfer.d.ts +0 -30
  206. package/dist/src/transfer.js +0 -110
@@ -0,0 +1,78 @@
1
+ import { defineInterface, method } from "@agentorg/sdk";
2
+ import { z } from "zod";
3
+ import { Id } from "./hub.js";
4
+ /** A way a provider makes connections, such as `url` or `command`. */
5
+ export const ConnectionKind = z
6
+ .string()
7
+ .regex(/^[a-z][a-z0-9-]*$/)
8
+ .max(64);
9
+ /** `connecting` before its first success, `connected`, or `down` and being tried again. */
10
+ export const ConnectionState = z.enum(["connecting", "connected", "down"]);
11
+ /** A connection's tools, for people to read; a provider cuts a long description to fit. */
12
+ export const ConnectionTool = z.object({
13
+ name: z.string().min(1).max(128),
14
+ description: z.string().max(512).optional(),
15
+ });
16
+ /** How a connection stands now: `detail` says why it is down, and never holds a secret. */
17
+ export const ConnectionStatus = z.object({
18
+ state: ConnectionState,
19
+ detail: z.string().max(2000).optional(),
20
+ tools: z.array(ConnectionTool),
21
+ });
22
+ /** The parameters of a connection, fitting its kind's `params` schema. */
23
+ export const ConnectionParams = z.record(z.string(), z.json());
24
+ /**
25
+ * What a server needs and shouldn't be seen, by name, such as a bearer token. Write-only: the values
26
+ * cross once, in `create`, and go only to the provider's own private file.
27
+ */
28
+ export const ConnectionSecrets = z.record(z
29
+ .string()
30
+ .regex(/^[A-Za-z_][A-Za-z0-9_]*$/)
31
+ .max(256), z.string().min(1).max(16_384));
32
+ /** What a connection attaches to or runs, for people to read: never a secret. */
33
+ export const ConnectionTarget = z.string().min(1).max(4096);
34
+ /**
35
+ * `mcp.provider@1`: a program that makes connections to MCP servers. Each connection joins the
36
+ * Hub as its own Actor, whose id is `connection`, exporting `tools@1` as `tools`. MCP itself stays
37
+ * behind this interface.
38
+ *
39
+ * A secret a server needs is given once, in `create`'s `secrets`, and stays with the provider: its
40
+ * value is never in `params`, `target`, `detail`, or anything else read back. `status` and `remove` are refused `unknown` for a connection the
41
+ * provider doesn't hold.
42
+ */
43
+ export const mcpProvider = defineInterface({
44
+ name: "mcp.provider",
45
+ major: 1,
46
+ kind: "rpc",
47
+ methods: {
48
+ /** The kinds it offers; `params` and `secrets` are the JSON Schemas of what each one takes. */
49
+ kinds: method({
50
+ input: z.object({}),
51
+ output: z.object({
52
+ kinds: z.array(z.object({
53
+ kind: ConnectionKind,
54
+ title: z.string().min(1).max(128),
55
+ params: z.record(z.string(), z.json()),
56
+ secrets: z.record(z.string(), z.json()),
57
+ })),
58
+ }),
59
+ }),
60
+ /**
61
+ * Make a connection and its Actor, named `name`. It returns once the Actor has joined the Hub,
62
+ * whether or not the server has answered yet; `status` says how it stands. Refused `invalid`
63
+ * when `kind` isn't offered or `params` or `secrets` don't fit it.
64
+ */
65
+ create: method({
66
+ input: z.object({
67
+ kind: ConnectionKind,
68
+ params: ConnectionParams,
69
+ secrets: ConnectionSecrets.optional(),
70
+ name: z.string().min(1).max(128),
71
+ }),
72
+ output: z.object({ connection: Id, target: ConnectionTarget }),
73
+ }),
74
+ status: method({ input: z.object({ connection: Id }), output: ConnectionStatus }),
75
+ /** End the connection and close its Actor, which removes what was bound to it. */
76
+ remove: method({ input: z.object({ connection: Id }), output: z.object({}) }),
77
+ },
78
+ });
@@ -0,0 +1,39 @@
1
+ import { z } from "zod";
2
+ /** One tool: `inputSchema` is the JSON Schema of its arguments, as its server states it. */
3
+ export declare const ToolEntry: z.ZodObject<{
4
+ name: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
7
+ }, z.core.$strip>;
8
+ /**
9
+ * `tools@1`: a set of tools whose names and arguments are known only at run time. It is one fixed
10
+ * contract however the tools change, so a binding to it holds while they do: the Hub checks a
11
+ * call's envelope, and whoever runs the tool checks its arguments.
12
+ *
13
+ * A call is refused `unknown` when no tool has that name and `not_connected` when what runs the
14
+ * tools can't be reached now. A tool that ran and failed isn't a refusal: it answers with
15
+ * `failed`, and its `output` says why, for the caller's model to read.
16
+ *
17
+ * A provider fits what it has to these limits: it leaves out a tool whose name is too long or that
18
+ * won't fit one frame, cuts a long description, and cuts an output, saying that it did.
19
+ */
20
+ export declare const tools: import("@agentorg/sdk").RpcInterface<"tools", {
21
+ list: import("@agentorg/sdk").MethodSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
22
+ tools: z.ZodArray<z.ZodObject<{
23
+ name: z.ZodString;
24
+ description: z.ZodOptional<z.ZodString>;
25
+ inputSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
26
+ }, z.core.$strip>>;
27
+ }, z.core.$strip>>;
28
+ /** Run one tool. `output` is its result as text. */
29
+ call: import("@agentorg/sdk").MethodSpec<z.ZodObject<{
30
+ name: z.ZodString;
31
+ arguments: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
32
+ }, z.core.$strip>, z.ZodObject<{
33
+ output: z.ZodString;
34
+ failed: z.ZodOptional<z.ZodLiteral<true>>;
35
+ }, z.core.$strip>>;
36
+ }, {
37
+ /** The tools changed: `list` again. */
38
+ changed: import("@agentorg/sdk").EventSpec<z.ZodObject<{}, z.core.$strip>>;
39
+ }, 1>;
@@ -0,0 +1,43 @@
1
+ import { defineInterface, event, method } from "@agentorg/sdk";
2
+ import { z } from "zod";
3
+ const ToolName = z.string().min(1).max(128);
4
+ /** The most a call's output carries: what a model's function output can take. */
5
+ const OUTPUT_MAX = 200_000;
6
+ /** One tool: `inputSchema` is the JSON Schema of its arguments, as its server states it. */
7
+ export const ToolEntry = z.object({
8
+ name: ToolName,
9
+ description: z.string().max(16_384).optional(),
10
+ inputSchema: z.record(z.string(), z.json()),
11
+ });
12
+ /**
13
+ * `tools@1`: a set of tools whose names and arguments are known only at run time. It is one fixed
14
+ * contract however the tools change, so a binding to it holds while they do: the Hub checks a
15
+ * call's envelope, and whoever runs the tool checks its arguments.
16
+ *
17
+ * A call is refused `unknown` when no tool has that name and `not_connected` when what runs the
18
+ * tools can't be reached now. A tool that ran and failed isn't a refusal: it answers with
19
+ * `failed`, and its `output` says why, for the caller's model to read.
20
+ *
21
+ * A provider fits what it has to these limits: it leaves out a tool whose name is too long or that
22
+ * won't fit one frame, cuts a long description, and cuts an output, saying that it did.
23
+ */
24
+ export const tools = defineInterface({
25
+ name: "tools",
26
+ major: 1,
27
+ kind: "rpc",
28
+ methods: {
29
+ list: method({ input: z.object({}), output: z.object({ tools: z.array(ToolEntry) }) }),
30
+ /** Run one tool. `output` is its result as text. */
31
+ call: method({
32
+ input: z.object({ name: ToolName, arguments: z.record(z.string(), z.json()) }),
33
+ output: z.object({
34
+ output: z.string().max(OUTPUT_MAX),
35
+ failed: z.literal(true).optional(),
36
+ }),
37
+ }),
38
+ },
39
+ events: {
40
+ /** The tools changed: `list` again. */
41
+ changed: event(z.object({})),
42
+ },
43
+ });
@@ -0,0 +1 @@
1
+ export { type Manager, type ManagerOptions, startManager } from "./manager.js";
@@ -0,0 +1 @@
1
+ export { startManager } from "./manager.js";
@@ -0,0 +1,21 @@
1
+ import { type Log } from "@agentorg/sdk";
2
+ export interface ManagerOptions {
3
+ hubUrl: string;
4
+ /** Its own Actor, bound to `hub.actors@1`, `hub.grants@1` and `hub.bindings@1`, which make it a manager. */
5
+ actorId: string;
6
+ credential: string;
7
+ /** A private folder of its own, which holds its records and the skills. */
8
+ dir: string;
9
+ log?: Log;
10
+ }
11
+ export interface Manager {
12
+ /** Leave the Hub. What it keeps stays. */
13
+ close(): Promise<void>;
14
+ }
15
+ /**
16
+ * Run management as an Actor exporting `agents@1`, `connections@1`, `skills@1` and, as `settings`,
17
+ * `agent.settings@1`. It keeps only what the Hub can't know. A provider is connected by exposing
18
+ * its export to this Actor: the Hub's slots are the list of them, and what is exposed to an agent
19
+ * is the Hub's bindings. No status is stored, and no secret reaches it to keep.
20
+ */
21
+ export declare function startManager(options: ManagerOptions): Promise<Manager>;