@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.
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 -111
  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 +20 -298
  9. package/dist/node_modules/@agentorg/hub/dist/src/state.js +73 -456
  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 -267
  20. package/dist/node_modules/@agentorg/interfaces/dist/src/hub.js +17 -145
  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-01d69bc3888c2a53963f4413d47de909d129ad27c78e9af6d830bb50c3478419.agentorg +0 -0
  123. package/dist/bundled/sha256-84165e3be5c904fc971d983dab31102e07cca725d8629a6fd7d118fa3a0a88b8.agentorg +0 -0
  124. package/dist/bundled/sha256-ade9132b3f34b4c39db92adeadc7e540dc745e4a81b5b54f5d45bf9ec92bca75.agentorg +0 -0
  125. package/dist/bundled/sha256-f4330f5987f37d8cf3aeb44d2f831b573641a87186daa2f811f0c35ba04804f0.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 -51
  202. package/dist/src/model.js +0 -230
  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,167 @@
1
+ import { chmodSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { hubActors, mcpProvider } from "@agentorg/interfaces";
4
+ import { Refused } from "@agentorg/sdk";
5
+ import { connect } from "@agentorg/sdk/client";
6
+ import { z } from "zod";
7
+ import { Connection } from "./connection.js";
8
+ import { KINDS, parseConnection, targetOf } from "./kinds.js";
9
+ /** What is kept of a connection between runs, in the provider's private file. */
10
+ const Stored = z.object({
11
+ credential: z.string(),
12
+ kind: z.string(),
13
+ params: z.record(z.string(), z.unknown()),
14
+ secrets: z.record(z.string(), z.string()),
15
+ });
16
+ const FILE = "connections.json";
17
+ const quiet = { info() { }, warn() { }, error() { } };
18
+ /**
19
+ * Run the built-in MCP provider as an Actor exporting `mcp.provider@1` as `provider`. It offers two
20
+ * kinds, `url` and `command`; a server it starts runs with this process's rights. Connections made earlier are joined again at the start.
21
+ */
22
+ export async function startMcpProvider(options) {
23
+ const log = options.log ?? quiet;
24
+ const { hubUrl, dir } = options;
25
+ mkdirSync(dir, { recursive: true, mode: 0o700 });
26
+ chmodSync(dir, 0o700);
27
+ const path = join(dir, FILE);
28
+ /** The file, entry by entry; one that can't be read is set aside and the rest still run. */
29
+ const read = () => {
30
+ let raw;
31
+ try {
32
+ raw = readFileSync(path, "utf8");
33
+ }
34
+ catch (error) {
35
+ if (error.code === "ENOENT")
36
+ return {};
37
+ throw error;
38
+ }
39
+ const entries = z.record(z.string(), z.unknown()).safeParse((() => {
40
+ try {
41
+ return JSON.parse(raw);
42
+ }
43
+ catch {
44
+ return undefined;
45
+ }
46
+ })());
47
+ if (!entries.success) {
48
+ renameSync(path, `${path}.unreadable-${Date.now()}`);
49
+ log.error("The connections file can't be read: it is set aside and starts empty.");
50
+ return {};
51
+ }
52
+ const kept = {};
53
+ for (const [id, entry] of Object.entries(entries.data)) {
54
+ const parsed = Stored.safeParse(entry);
55
+ if (parsed.success)
56
+ kept[id] = parsed.data;
57
+ else
58
+ log.error(`Connection ${id} can't be read, and is left out.`);
59
+ }
60
+ return kept;
61
+ };
62
+ const stored = read();
63
+ const save = () => {
64
+ writeFileSync(`${path}.tmp`, JSON.stringify(stored), { mode: 0o600, flush: true });
65
+ renameSync(`${path}.tmp`, path);
66
+ };
67
+ const connections = new Map();
68
+ const open = async (actorId, credential, spec, secrets) => {
69
+ const connection = new Connection(spec, secrets, log, options.timing);
70
+ await connection.join({ hubUrl, actorId, credential });
71
+ connections.set(actorId, connection);
72
+ return connection;
73
+ };
74
+ let closing = false;
75
+ const endAll = () => Promise.all([...connections.values()].map((c) => c.end()));
76
+ const held = (id) => {
77
+ const connection = connections.get(id);
78
+ if (!connection)
79
+ throw new Refused("unknown", `This provider holds no connection ${id}.`);
80
+ return connection;
81
+ };
82
+ for (const [actorId, { credential, kind, params, secrets }] of Object.entries(stored)) {
83
+ const { spec, secrets: hidden, why } = parseConnection(kind, params, secrets);
84
+ if (!spec) {
85
+ log.error(`Connection ${actorId} can't be read: ${why}`);
86
+ continue;
87
+ }
88
+ try {
89
+ (await open(actorId, credential, spec, hidden)).run();
90
+ }
91
+ catch (error) {
92
+ log.error(`Connection ${actorId} didn't rejoin the Hub: ${String(error)}`);
93
+ // The Hub no longer knows it: its Actor was closed while the provider was away.
94
+ if (error instanceof Refused && error.code === "forbidden") {
95
+ delete stored[actorId];
96
+ save();
97
+ }
98
+ }
99
+ }
100
+ const provider = await connect({
101
+ hubUrl,
102
+ actorId: options.actorId,
103
+ credential: options.credential,
104
+ slots: { actors: hubActors },
105
+ exports: { provider: mcpProvider },
106
+ log,
107
+ start(ctx) {
108
+ ctx.exports.provider.implement({
109
+ kinds: () => ({
110
+ kinds: KINDS.map(({ kind, title, params, secrets }) => ({
111
+ kind,
112
+ title,
113
+ params: JSON.parse(JSON.stringify(z.toJSONSchema(params))),
114
+ secrets: JSON.parse(JSON.stringify(z.toJSONSchema(secrets))),
115
+ })),
116
+ }),
117
+ async create({ kind, params, secrets, name }) {
118
+ const { spec, secrets: hidden, why } = parseConnection(kind, params, secrets);
119
+ if (!spec)
120
+ throw new Refused("invalid", why);
121
+ const { actorId, credential } = await ctx.slots.actors.call.create({ name });
122
+ let connection;
123
+ try {
124
+ connection = await open(actorId, credential, spec, hidden);
125
+ if (closing)
126
+ throw new Refused("unavailable", "This provider is stopping.");
127
+ stored[actorId] = { credential: credential, kind, params, secrets: hidden };
128
+ save();
129
+ connection.run();
130
+ }
131
+ catch (error) {
132
+ connections.delete(actorId);
133
+ delete stored[actorId];
134
+ await connection?.end();
135
+ await ctx.slots.actors.call.close({ actorId }).catch(() => { });
136
+ throw error;
137
+ }
138
+ return { connection: actorId, target: targetOf(spec) };
139
+ },
140
+ status: ({ connection }) => held(connection).status(),
141
+ async remove({ connection }) {
142
+ const found = held(connection);
143
+ await ctx.slots.actors.call.close({ actorId: connection });
144
+ connections.delete(connection);
145
+ delete stored[connection];
146
+ try {
147
+ save();
148
+ }
149
+ finally {
150
+ await found.end();
151
+ }
152
+ return {};
153
+ },
154
+ });
155
+ },
156
+ }).catch(async (error) => {
157
+ await endAll();
158
+ throw error;
159
+ });
160
+ return {
161
+ async close() {
162
+ closing = true;
163
+ await endAll();
164
+ provider.close();
165
+ },
166
+ };
167
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@agentorg/mcp",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "description": "The built-in MCP provider: each connection to an MCP server is an Actor offering tools@1",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/src/index.d.ts",
11
+ "default": "./dist/src/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist/src"
16
+ ],
17
+ "scripts": {
18
+ "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.json",
19
+ "test": "node --test \"dist/test/**/*.test.js\""
20
+ },
21
+ "dependencies": {
22
+ "@agentorg/interfaces": "0.0.0",
23
+ "@agentorg/sdk": "0.0.0",
24
+ "@modelcontextprotocol/client": "2.4.0",
25
+ "zod": "^4.6.7"
26
+ },
27
+ "devDependencies": {
28
+ "@agentorg/hub": "0.0.0",
29
+ "@modelcontextprotocol/server": "2.4.0"
30
+ }
31
+ }
@@ -8,22 +8,19 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
8
8
  return path;
9
9
  };
10
10
  import { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
11
- import { join, relative } from "node:path";
11
+ import { join } from "node:path";
12
12
  import { parseArgs } from "node:util";
13
13
  import { openChannel } from "./client.js";
14
14
  import { NotConnected, OutcomeUnknown, Refused } from "./errors.js";
15
- import { BuildError, buildPackage } from "./package.js";
16
15
  import { hubHome, personCall, UsageError } from "./person-commands.js";
17
16
  const USAGE = `Usage: agentorg <command> [--home DIR]
18
17
 
19
- build [package-dir] build a package into a .agentorg archive
20
18
  hub [--port N] run a Hub, serving on loopback
21
- add <file.agentorg> hub.packages.add
22
19
  actors | bindings | exports | audit each one's list
23
20
  bind <consumer.slot> <provider.export> hub.grants.bind
24
21
  call <slot> <method> [json] call one of the person's slots
25
22
 
26
- Commands other than build and hub act as the person, with the Hub home's person-credential.
23
+ Commands other than hub act as the person, with the Hub home's person-credential.
27
24
  The home is --home, else $AGENTORG_HUB_HOME, else
28
25
  $XDG_DATA_HOME/agentorg, else ~/.local/share/agentorg.
29
26
  `;
@@ -56,21 +53,6 @@ if (values.help) {
56
53
  process.exit(0);
57
54
  }
58
55
  const home = hubHome(values.home);
59
- async function build() {
60
- try {
61
- const built = await buildPackage(rest[0] ?? ".");
62
- write(process.stdout, `${built.manifest.name}@${built.manifest.version} ${built.hash}\n${relative(process.cwd(), built.file)}`);
63
- }
64
- catch (error) {
65
- // A BuildError says what to fix; anything else is a bug, so its stack is shown.
66
- write(process.stderr, error instanceof BuildError
67
- ? error.message
68
- : error instanceof Error
69
- ? (error.stack ?? error.message)
70
- : String(error));
71
- process.exit(1);
72
- }
73
- }
74
56
  /** Run a Hub in the home, and leave its address in `<home>/url` for the other commands. */
75
57
  async function hub() {
76
58
  if (values.port !== undefined && !/^\d{1,5}$/.test(values.port))
@@ -178,9 +160,7 @@ catch (error) {
178
160
  throw error;
179
161
  usage(error.message);
180
162
  }
181
- if (command === "build")
182
- await build();
183
- else if (command === "hub")
163
+ if (command === "hub")
184
164
  await hub();
185
165
  else if (call)
186
166
  await asPerson(call.slot, call.method, call.input);
@@ -1,6 +1,6 @@
1
1
  import { type Header, type WireError } from "@agentorg/wire";
2
2
  import { type DescribedInterface, type Interface } from "./interface.js";
3
- import { type Context, type Duplex, type ExportMap, type InterfaceMap, type Log } from "./module.js";
3
+ import { type Context, type ExportMap, type InterfaceMap, type Log } from "./module.js";
4
4
  /** A stream the Hub opens toward this Actor's exports, naming the export and who is calling. */
5
5
  export type Serve = Extract<Header, {
6
6
  op: "serve";
@@ -10,25 +10,11 @@ export interface ServeHandlers {
10
10
  call(serve: Serve, input: unknown): Promise<unknown>;
11
11
  /** Start sending an export's events; `end` stops them from this side. Returns how to stop. */
12
12
  subscribe(serve: Serve, send: (payload: unknown) => void, end: (error?: unknown) => void): () => void;
13
- /** Check that the export takes the stream (throwing a refusal if not), then return what runs it. */
14
- accept(serve: Serve): (stream: Duplex) => Promise<void>;
15
- /** The same for an `http` export: the stream carries HTTP/1.1 once accepted. */
16
- serveHttp(serve: Serve): (stream: Duplex) => Promise<void>;
17
13
  }
18
- /**
19
- * Where the channel goes: the Hub's WebSocket address with the Actor's credential, or a pipe the
20
- * Hub made for this Actor's process, whose hello needs no credential.
21
- */
22
- export type ChannelOptions = ChannelBase & ({
14
+ export interface ChannelOptions {
15
+ /** The Hub's WebSocket address. */
23
16
  hubUrl: string;
24
17
  credential: string;
25
- channel?: never;
26
- } | {
27
- channel: Duplex;
28
- hubUrl?: never;
29
- credential?: never;
30
- });
31
- interface ChannelBase {
32
18
  actorId: string;
33
19
  /**
34
20
  * Whether this channel may replace one the Actor already has (the default). With `false`, a
@@ -76,12 +62,6 @@ export interface Channel {
76
62
  call(slot: string, method: string, value: unknown): Promise<unknown>;
77
63
  /** Events from a slot's provider until it ends (`onEnd`) or is stopped; returns how to stop. */
78
64
  subscribe(slot: string, event: string, onEvent: (payload: unknown) => void, onEnd?: (error?: Error) => void): () => void;
79
- open(slot: string, params: unknown): Promise<Duplex>;
80
- /** A stream to an `http` slot's provider, carrying HTTP/1.1 once it accepts. */
81
- http(slot: string): Promise<Duplex>;
82
- /** Offer and withdraw run-time exports; they reach the Hub in the order they were made. */
83
- offer(name: string, iface: DescribedInterface): Promise<void>;
84
- withdraw(name: string): Promise<void>;
85
65
  close(): void;
86
66
  /** Settles when the channel ends. */
87
67
  readonly closed: Promise<void>;
@@ -128,8 +108,7 @@ type None = Record<never, Interface>;
128
108
  * `start`, and use slots from `onBind`. `start` runs before the channel opens, so the Hub never
129
109
  * reaches an export before it is implemented. A slot is bound when the Hub says so; `onBind` runs
130
110
  * when it becomes usable (bound, or its provider back), and `on` handlers subscribe while it is
131
- * usable. `exports.add` and `withdraw()` offer and withdraw over the channel. `http` slots and
132
- * exports speak HTTP/1.1 over the Hub's stream, one request per stream, with `node:http`.
111
+ * usable.
133
112
  */
134
113
  export declare function connect<const S extends InterfaceMap = None, const X extends ExportMap = None>(options: ConnectOptions<S, X>): Promise<Client<S, X>>;
135
114
  export {};
@@ -57,9 +57,7 @@ export async function openChannel(options) {
57
57
  ready = resolve;
58
58
  });
59
59
  try {
60
- const bytes = options.channel !== undefined
61
- ? options.channel
62
- : await webSocketChannel(new WebSocket(options.hubUrl));
60
+ const bytes = await webSocketChannel(new WebSocket(options.hubUrl));
63
61
  session = new Session(bytes, {
64
62
  client: true,
65
63
  onStream(stream) {
@@ -73,7 +71,7 @@ export async function openChannel(options) {
73
71
  });
74
72
  }
75
73
  catch {
76
- throw new NotConnected(`the Hub at ${options.hubUrl ?? "its pipe"}`);
74
+ throw new NotConnected(`the Hub at ${options.hubUrl}`);
77
75
  }
78
76
  async function serveStream(header, stream, reader) {
79
77
  if (header.op === "slot") {
@@ -119,14 +117,6 @@ export async function openChannel(options) {
119
117
  }
120
118
  if (header.kind === "subscribe")
121
119
  return subscribeStream(handlers, header, stream);
122
- if (header.kind === "open" || header.kind === "http") {
123
- const run = header.kind === "open" ? handlers.accept(header) : handlers.serveHttp(header);
124
- const writer = stream.writable.getWriter();
125
- await writer.write(encodeFrame(result({})));
126
- writer.releaseLock();
127
- // Accepted: from here the stream is raw bytes, so a failing handler can only reset it.
128
- return await run({ readable: reader.rest(), writable: stream.writable }).catch(() => stream.reset());
129
- }
130
120
  return stream.reset();
131
121
  }
132
122
  catch (error) {
@@ -195,7 +185,7 @@ export async function openChannel(options) {
195
185
  const hello = await exchange({
196
186
  op: "hello",
197
187
  actorId: options.actorId,
198
- ...(options.credential === undefined ? {} : { credential: options.credential }),
188
+ credential: options.credential,
199
189
  ...(options.declares ? { declares: options.declares } : {}),
200
190
  ...(options.replace === false ? { replace: false } : {}),
201
191
  }, "the Hub");
@@ -213,13 +203,6 @@ export async function openChannel(options) {
213
203
  throw new Refused("bad_output", "The Hub's answer isn't a result.");
214
204
  return body.result;
215
205
  };
216
- // Offers and withdrawals go one at a time, so the Hub sees them in the order they were made.
217
- let changes = Promise.resolve();
218
- const inOrder = (work) => {
219
- const next = changes.then(work, work);
220
- changes = next.catch(() => { });
221
- return next;
222
- };
223
206
  const closed = session.closed.then(() => {
224
207
  ended = true;
225
208
  bound.clear();
@@ -274,41 +257,9 @@ export async function openChannel(options) {
274
257
  stream.reset();
275
258
  };
276
259
  },
277
- open: (slot, params) => splice({ op: "open", slot, params }, slot),
278
- http: (slot) => splice({ op: "http", slot }, slot),
279
- offer: (name, iface) => inOrder(async () => {
280
- answered(await exchange({ op: "offer", name, interface: iface }, name), name);
281
- }),
282
- withdraw: (name) => inOrder(async () => {
283
- answered(await exchange({ op: "withdraw", name }, name), name);
284
- }),
285
260
  close: () => session.close(),
286
261
  closed,
287
262
  };
288
- /** Open a raw stream: send its header, read the one body that answers, then hand over the bytes. */
289
- async function splice(header, slot) {
290
- let stream;
291
- try {
292
- stream = session.open();
293
- const writer = stream.writable.getWriter();
294
- await writer.write(encodeFrame(header));
295
- writer.releaseLock();
296
- const reader = new FrameReader(stream.readable);
297
- const first = await reader.next();
298
- if (first === undefined)
299
- throw new NotConnected(slot);
300
- answered(parseBody(first), slot);
301
- return { readable: reader.rest(), writable: stream.writable };
302
- }
303
- catch (error) {
304
- stream?.reset();
305
- if (error instanceof Refused ||
306
- error instanceof NotConnected ||
307
- error instanceof OutcomeUnknown)
308
- throw error;
309
- throw new NotConnected(slot);
310
- }
311
- }
312
263
  }
313
264
  const quiet = { info() { }, warn() { }, error() { } };
314
265
  /**
@@ -317,8 +268,7 @@ const quiet = { info() { }, warn() { }, error() { } };
317
268
  * `start`, and use slots from `onBind`. `start` runs before the channel opens, so the Hub never
318
269
  * reaches an export before it is implemented. A slot is bound when the Hub says so; `onBind` runs
319
270
  * when it becomes usable (bound, or its provider back), and `on` handlers subscribe while it is
320
- * usable. `exports.add` and `withdraw()` offer and withdraw over the channel. `http` slots and
321
- * exports speak HTTP/1.1 over the Hub's stream, one request per stream, with `node:http`.
271
+ * usable.
322
272
  */
323
273
  export async function connect(options) {
324
274
  const slots = (options.slots ?? {});
@@ -326,7 +276,7 @@ export async function connect(options) {
326
276
  const log = options.log ?? quiet;
327
277
  // defineActor checks the names, as it does for a module.
328
278
  const definition = defineActor({ slots, exports, start: options.start ?? (() => { }) });
329
- const host = new ModuleHost("", slots, log);
279
+ const host = new ModuleHost(slots, log);
330
280
  const runtime = createRuntime(definition, {
331
281
  self: { actorId: options.actorId, module: "client" },
332
282
  log,
@@ -1,4 +1,4 @@
1
- /** A call on a slot that no export is bound to, or on an export that was withdrawn. */
1
+ /** A call on a slot that no export is bound to. */
2
2
  export declare class NotConnected extends Error {
3
3
  static [Symbol.hasInstance](value: unknown): boolean;
4
4
  readonly name = "NotConnected";
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Marks an SDK error class's prototype with its name. A package's bundles and the runner each carry
3
- * their own copy of the SDK, so `instanceof` on these three classes checks this mark rather than
2
+ * Marks an SDK error class's prototype with its name. Programs may carry their own copy of the SDK,
3
+ * so `instanceof` on these three classes checks this mark rather than
4
4
  * the class, and an error made by one copy is the same error to the other. A subclass is checked
5
5
  * as usual.
6
6
  */
@@ -12,7 +12,7 @@ const instanceOf = (asked, base, name, value) =>
12
12
  asked === base
13
13
  ? isBranded(value, name)
14
14
  : Function.prototype[Symbol.hasInstance].call(asked, value);
15
- /** A call on a slot that no export is bound to, or on an export that was withdrawn. */
15
+ /** A call on a slot that no export is bound to. */
16
16
  export class NotConnected extends Error {
17
17
  static [Symbol.hasInstance](value) {
18
18
  // biome-ignore lint/complexity/noThisInStatic: `this` is the class instanceof was asked about, a subclass included.
@@ -1,4 +1,4 @@
1
1
  export { canonicalJson, hashOf, sha256 } from "./canonical.js";
2
2
  export { NotConnected, OutcomeUnknown, Refused, type RefusedCode } from "./errors.js";
3
- export { compareInterfaces, type DescribedInterface, defineInterface, describeInterface, type EventSpec, type Events, event, type HttpInterface, hashInterface, type Interface, type InterfaceSchemas, interfaceId, type JsonSchema, type MethodSpec, type Methods, method, normalizeSchema, type RpcInterface, type StreamInterface, } from "./interface.js";
4
- export { type CallInfo, type Context, type Duplex, defineActor, defineWidget, type EmitOptions, type Export, type ExportMap, type ExposedSlot, type FrameRoot, type Handlers, type HttpExport, type HttpSlot, type InterfaceMap, isFrameInterface, isModuleDefinition, type Log, MODULE, type ModuleDefinition, type ModuleSpec, type Placement, type RpcExport, type RpcSlot, type Slot, type StreamExport, type StreamSlot, type ViewExport, } from "./module.js";
3
+ export { compareInterfaces, type DescribedInterface, defineInterface, describeInterface, type EventSpec, type Events, event, hashInterface, type Interface, type InterfaceSchemas, interfaceId, type JsonSchema, type MethodSpec, type Methods, method, normalizeSchema, type RpcInterface, } from "./interface.js";
4
+ export { type CallInfo, type Context, defineActor, type EmitOptions, type Export, type ExportMap, type ExposedSlot, type Handlers, type InterfaceMap, type Log, type ModuleDefinition, type ModuleSpec, type RpcExport, type RpcSlot, type Slot, } from "./module.js";
@@ -1,4 +1,4 @@
1
1
  export { canonicalJson, hashOf, sha256 } from "./canonical.js";
2
2
  export { NotConnected, OutcomeUnknown, Refused } from "./errors.js";
3
3
  export { compareInterfaces, defineInterface, describeInterface, event, hashInterface, interfaceId, method, normalizeSchema, } from "./interface.js";
4
- export { defineActor, defineWidget, isFrameInterface, isModuleDefinition, MODULE, } from "./module.js";
4
+ export { defineActor, } from "./module.js";
@@ -26,17 +26,7 @@ export interface RpcInterface<N extends string = string, M extends Methods = Met
26
26
  readonly methods: M;
27
27
  readonly events: E;
28
28
  }
29
- /** Raw bytes in a named protocol, the L4 shape; opening a stream takes parameters. */
30
- export interface StreamInterface<N extends string = string, O extends z.ZodType = z.ZodType> extends Named<N> {
31
- readonly kind: "stream";
32
- readonly protocol: string;
33
- readonly open: O;
34
- }
35
- /** HTTP/1.1 requests and responses on streams, the L7 shape. */
36
- export interface HttpInterface<N extends string = string> extends Named<N> {
37
- readonly kind: "http";
38
- }
39
- export type Interface = RpcInterface | StreamInterface | HttpInterface;
29
+ export type Interface = RpcInterface;
40
30
  /**
41
31
  * A named, versioned contract, identified by `name@major`. A slot binds only to an export of the
42
32
  * same `name@major` whose schemas hash the same.
@@ -48,36 +38,18 @@ export declare function defineInterface<const N extends string, M extends Method
48
38
  methods: M;
49
39
  events?: E;
50
40
  }): RpcInterface<N, M, E, V>;
51
- export declare function defineInterface<const N extends string, O extends z.ZodType>(spec: {
52
- name: N;
53
- major: number;
54
- kind: "stream";
55
- protocol: string;
56
- open: O;
57
- }): StreamInterface<N, O>;
58
- export declare function defineInterface<const N extends string>(spec: {
59
- name: N;
60
- major: number;
61
- kind: "http";
62
- }): HttpInterface<N>;
63
41
  export type JsonSchema = Record<string, unknown>;
64
- /** An interface's identity and JSON Schemas, as the manifest records them. */
42
+ /** An interface's identity and JSON Schemas. */
65
43
  export type InterfaceSchemas = {
66
44
  id: string;
67
- } & ({
45
+ } & {
68
46
  kind: "rpc";
69
47
  methods: Record<string, {
70
48
  input: JsonSchema;
71
49
  output: JsonSchema;
72
50
  }>;
73
51
  events: Record<string, JsonSchema>;
74
- } | {
75
- kind: "stream";
76
- protocol: string;
77
- open: JsonSchema;
78
- } | {
79
- kind: "http";
80
- });
52
+ };
81
53
  /** An interface's identity, JSON Schemas and hash. */
82
54
  export type DescribedInterface = InterfaceSchemas & {
83
55
  hash: string;
@@ -94,10 +66,10 @@ export declare function normalizeSchema(schema: JsonSchema): JsonSchema;
94
66
  /**
95
67
  * The hash of an interface: SHA-256 over the canonical JSON of its identity and normalized JSON
96
68
  * Schemas. Everything in those schemas is contract, `.describe()` text included, so a reader can
97
- * recompute the hash from the manifest alone.
69
+ * recompute the hash from them alone.
98
70
  */
99
71
  export declare function hashInterface(schemas: InterfaceSchemas): string;
100
- /** The interface as the manifest records it: identity, JSON Schemas and hash. */
72
+ /** The interface as it crosses the wire: identity, JSON Schemas and hash. */
101
73
  export declare function describeInterface(iface: Interface): DescribedInterface;
102
74
  /**
103
75
  * Whether a slot's interface and an export's can be bound: `same` is the same `name@major` with
@@ -26,20 +26,8 @@ export function defineInterface(spec) {
26
26
  throw new TypeError(`${id}: ${name} is both a method and an event.`);
27
27
  return { name: spec.name, major: spec.major, kind: "rpc", methods, events };
28
28
  }
29
- case "stream":
30
- if (!spec.protocol || !spec.open)
31
- throw new TypeError(`${id}: a stream interface names its protocol and its open schema.`);
32
- return {
33
- name: spec.name,
34
- major: spec.major,
35
- kind: "stream",
36
- protocol: spec.protocol,
37
- open: spec.open,
38
- };
39
- case "http":
40
- return { name: spec.name, major: spec.major, kind: "http" };
41
29
  default:
42
- throw new TypeError(`${id}: kind must be rpc, stream or http.`);
30
+ throw new TypeError(`${id}: kind must be rpc.`);
43
31
  }
44
32
  }
45
33
  /** `name@major`, the identity a slot and an export must share. */
@@ -135,26 +123,17 @@ function interfaceSchemas(iface) {
135
123
  jsonSchema(id, `event ${name}`, e.payload, "output"),
136
124
  ])),
137
125
  };
138
- case "stream":
139
- return {
140
- id,
141
- kind: "stream",
142
- protocol: iface.protocol,
143
- open: jsonSchema(id, "open", iface.open, "input"),
144
- };
145
- case "http":
146
- return { id, kind: "http" };
147
126
  }
148
127
  }
149
128
  /**
150
129
  * The hash of an interface: SHA-256 over the canonical JSON of its identity and normalized JSON
151
130
  * Schemas. Everything in those schemas is contract, `.describe()` text included, so a reader can
152
- * recompute the hash from the manifest alone.
131
+ * recompute the hash from them alone.
153
132
  */
154
133
  export function hashInterface(schemas) {
155
134
  return hashOf(schemas);
156
135
  }
157
- /** The interface as the manifest records it: identity, JSON Schemas and hash. */
136
+ /** The interface as it crosses the wire: identity, JSON Schemas and hash. */
158
137
  export function describeInterface(iface) {
159
138
  const schemas = interfaceSchemas(iface);
160
139
  return { ...schemas, hash: hashInterface(schemas) };
@@ -1,40 +1,31 @@
1
- import type { Channel, ChannelExposure, Serve, ServeHandlers } from "./client.js";
2
- import { Refused } from "./errors.js";
1
+ import type { Channel, ChannelExposure, ServeHandlers } from "./client.js";
3
2
  import type { InterfaceMap, Log } from "./module.js";
4
3
  import type { ModuleRuntime, RuntimeOptions } from "./runtime.js";
5
4
  /**
6
- * One module's runtime, joined to a channel. Its slots and exports are named on the wire with a
7
- * prefix: none for a program that connects itself, `<module>.` for a module in a package Actor's
8
- * process, where several share one channel. It binds slots as the Hub's notices say, subscribes
9
- * `on` handlers while a slot is usable, serves the Hub's streams to its exports, and offers and
10
- * withdraws run-time exports.
5
+ * A program's runtime, joined to its channel. It binds slots as the Hub's notices say, subscribes
6
+ * `on` handlers while a slot is usable, and serves the Hub's streams to its exports.
11
7
  */
12
8
  export declare class ModuleHost {
13
9
  #private;
14
- constructor(prefix: string, slots: InterfaceMap, log: Log);
10
+ constructor(slots: InterfaceMap, log: Log);
15
11
  get runtime(): ModuleRuntime<InterfaceMap, InterfaceMap>;
16
12
  set runtime(runtime: ModuleRuntime<InterfaceMap, InterfaceMap>);
17
13
  /** The runtime's hooks for this host: pass them to `createRuntime`. */
18
- hooks(): Pick<RuntimeOptions, "onEmit" | "onListen" | "onAdd" | "onWithdraw">;
14
+ hooks(): Pick<RuntimeOptions, "onEmit" | "onListen">;
19
15
  /**
20
16
  * A slot notice for one of this module's slots, by its local name: unbound, bound, or (for a
21
17
  * slot already bound) usable again because its provider came back.
22
18
  */
23
19
  onSlot(slot: string, isBound: boolean): void;
24
20
  /**
25
- * A notice for a slot made at run time: bound (or usable again) with its exposure, or gone. Its
26
- * name is the Actor's, with no module prefix: every module of the Actor has it.
21
+ * A notice for a slot made at run time: bound (or usable again) with its exposure, or gone.
27
22
  */
28
23
  onExposed(slot: string, exposure: ChannelExposure | undefined): void;
29
24
  /** How this module serves the Hub's streams, by its local export names. */
30
25
  readonly serve: ServeHandlers;
31
26
  /**
32
- * Join the opened channel: offer what was added during start, bind the slots the Hub's hello
33
- * said are bound, and leave nothing usable once the channel goes.
27
+ * Join the opened channel: bind the slots the Hub's hello said are bound, and leave nothing
28
+ * usable once the channel goes.
34
29
  */
35
30
  attach(channel: Channel): void;
36
31
  }
37
- /** A `serve` stream renamed to a module's local export name. */
38
- export declare const localServe: (serve: Serve, local: string) => Serve;
39
- /** A refusal for a name that names no module here. */
40
- export declare const noModule: (name: string) => Refused;