@fungi.computer/oyster 0.1.0 → 0.3.0

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 (292) hide show
  1. package/README.md +376 -72
  2. package/dist/agent-avatars.d.ts +103 -0
  3. package/dist/agent-avatars.js +66 -0
  4. package/dist/agents.d.ts +15 -4
  5. package/dist/agents.js +43 -4
  6. package/dist/app-builds.d.ts +81 -8
  7. package/dist/app-builds.js +210 -60
  8. package/dist/app-storage.d.ts +3 -3
  9. package/dist/approval-capability.d.ts +5 -0
  10. package/dist/approval-capability.js +46 -0
  11. package/dist/approval-home.d.ts +51 -0
  12. package/dist/approval-home.js +226 -0
  13. package/dist/apps/catalog.d.ts +335 -0
  14. package/dist/apps/catalog.js +46 -0
  15. package/dist/apps/gate.d.ts +26 -12
  16. package/dist/apps/gate.js +48 -22
  17. package/dist/apps/index.d.ts +3 -1
  18. package/dist/apps/index.js +3 -1
  19. package/dist/apps/installation.d.ts +147 -66
  20. package/dist/apps/installation.js +193 -86
  21. package/dist/apps/permissions.d.ts +247 -0
  22. package/dist/apps/permissions.js +255 -0
  23. package/dist/boot-capability-route.d.ts +15 -0
  24. package/dist/boot-capability-route.js +196 -0
  25. package/dist/boot-capability.d.ts +103 -0
  26. package/dist/boot-capability.js +141 -0
  27. package/dist/boot-construction.d.ts +12 -0
  28. package/dist/boot-construction.js +175 -0
  29. package/dist/boot-gate.d.ts +267 -0
  30. package/dist/boot-gate.js +236 -0
  31. package/dist/boot-host-script.d.ts +2 -0
  32. package/dist/boot-host-script.js +1 -0
  33. package/dist/boot-mount.d.ts +21 -0
  34. package/dist/boot-mount.js +65 -0
  35. package/dist/browser/boot.d.ts +73 -0
  36. package/dist/browser/boot.js +502 -0
  37. package/dist/browser/browser.d.ts +104 -0
  38. package/dist/browser/browser.js +374 -0
  39. package/dist/browser/capability-source.d.ts +76 -0
  40. package/dist/browser/capability-source.js +338 -0
  41. package/dist/browser/cdp-client.d.ts +56 -0
  42. package/dist/browser/cdp-client.js +184 -0
  43. package/dist/browser/errors.d.ts +79 -0
  44. package/dist/browser/errors.js +32 -0
  45. package/dist/browser/index.d.ts +16 -0
  46. package/dist/browser/index.js +14 -0
  47. package/dist/browser/lease-registry.d.ts +61 -0
  48. package/dist/browser/lease-registry.js +101 -0
  49. package/dist/browser/operations.d.ts +225 -0
  50. package/dist/browser/operations.js +137 -0
  51. package/dist/browser/page.d.ts +25 -0
  52. package/dist/browser/page.js +172 -0
  53. package/dist/browser/quick-reads.d.ts +29 -0
  54. package/dist/browser/quick-reads.js +160 -0
  55. package/dist/browser/sessions.d.ts +52 -0
  56. package/dist/browser/sessions.js +118 -0
  57. package/dist/browser/url-policy.d.ts +18 -0
  58. package/dist/browser/url-policy.js +58 -0
  59. package/dist/build/app-imports.d.ts +12 -0
  60. package/dist/build/app-imports.js +105 -0
  61. package/dist/build/build-policy.d.ts +5 -3
  62. package/dist/build/build-policy.js +5 -3
  63. package/dist/build/candidate-builder.d.ts +1 -1
  64. package/dist/build/candidate-cli.mjs +8428 -337
  65. package/dist/build/local-build.d.ts +2 -0
  66. package/dist/build/local-build.js +28 -6
  67. package/dist/build/snapshot-package-store.d.ts +1 -1
  68. package/dist/build/snapshot-package-store.js +7 -2
  69. package/dist/build/workspace-build.d.ts +92 -5
  70. package/dist/build/workspace-build.js +93 -19
  71. package/dist/build-egress.js +4 -4
  72. package/dist/build.d.ts +1 -1
  73. package/dist/build.js +1 -1
  74. package/dist/catalog-frame.js +1 -1
  75. package/dist/cloudflare.d.ts +13 -3
  76. package/dist/cloudflare.js +106 -8
  77. package/dist/frame-binding-wire-script.js +1 -1
  78. package/dist/frame-binding-wire.d.ts +1 -1
  79. package/dist/frame-binding-wire.js +5 -3
  80. package/dist/git-auth.d.ts +0 -2
  81. package/dist/git-auth.js +0 -2
  82. package/dist/git-journal.js +4 -4
  83. package/dist/git.d.ts +0 -1
  84. package/dist/git.js +0 -2
  85. package/dist/host.d.ts +39 -13
  86. package/dist/host.js +268 -142
  87. package/dist/index.d.ts +26 -15
  88. package/dist/index.js +40 -16
  89. package/dist/install-release-cli.d.ts +2 -0
  90. package/dist/install-release-cli.js +46 -0
  91. package/dist/installation-client.d.ts +43 -0
  92. package/dist/installation-client.js +178 -0
  93. package/dist/installation-execution.d.ts +11 -0
  94. package/dist/installation-execution.js +184 -0
  95. package/dist/installation-operations.d.ts +1437 -0
  96. package/dist/installation-operations.js +664 -0
  97. package/dist/installation-store-generation.d.ts +3 -0
  98. package/dist/installation-store-generation.js +16 -0
  99. package/dist/instance-id.d.ts +10 -0
  100. package/dist/instance-id.js +10 -0
  101. package/dist/instance-refusal.d.ts +11 -0
  102. package/dist/instance-refusal.js +21 -0
  103. package/dist/internal/delivery.js +4 -2
  104. package/dist/internal/host-gate.js +7 -1
  105. package/dist/internal/registry-installations.js +4 -4
  106. package/dist/keys.d.ts +5 -1
  107. package/dist/keys.js +10 -2
  108. package/dist/machine-link/authority.d.ts +89 -0
  109. package/dist/machine-link/authority.js +37 -0
  110. package/dist/machine-link/client.d.ts +66 -0
  111. package/dist/machine-link/client.js +94 -0
  112. package/dist/machine-link/delivery.d.ts +18 -0
  113. package/dist/machine-link/delivery.js +55 -0
  114. package/dist/machine-link/enrollment.d.ts +111 -0
  115. package/dist/machine-link/enrollment.js +286 -0
  116. package/dist/machine-link/fences.d.ts +37 -0
  117. package/dist/machine-link/fences.js +166 -0
  118. package/dist/machine-link/home.d.ts +20 -0
  119. package/dist/machine-link/home.js +24 -0
  120. package/dist/machine-link/host.d.ts +43 -0
  121. package/dist/machine-link/host.js +189 -0
  122. package/dist/machine-link/index.d.ts +15 -0
  123. package/dist/machine-link/index.js +15 -0
  124. package/dist/machine-link/link.d.ts +48 -0
  125. package/dist/machine-link/link.js +223 -0
  126. package/dist/machine-link/presence.d.ts +10 -0
  127. package/dist/machine-link/presence.js +25 -0
  128. package/dist/machine-link/workers.d.ts +6 -0
  129. package/dist/machine-link/workers.js +6 -0
  130. package/dist/mcp-owner.d.ts +2 -2
  131. package/dist/mcp-owner.js +41 -33
  132. package/dist/mcp.d.ts +15 -3
  133. package/dist/mcp.js +146 -25
  134. package/dist/pack.d.ts +14 -3
  135. package/dist/pack.js +44 -19
  136. package/dist/page/app-access.d.ts +7 -0
  137. package/dist/page/app-access.js +75 -0
  138. package/dist/page/boot-host.js +57 -0
  139. package/dist/page/capabilities.d.ts +3 -3
  140. package/dist/page/capabilities.js +16 -12
  141. package/dist/page/computer-handles.d.ts +3 -3
  142. package/dist/page/computer-target.d.ts +3 -0
  143. package/dist/page/computer-target.js +9 -0
  144. package/dist/page/mount.d.ts +23 -7
  145. package/dist/page/mount.js +152 -16
  146. package/dist/page-assets.d.ts +22 -0
  147. package/dist/page-assets.js +28 -0
  148. package/dist/page-script.d.ts +3 -0
  149. package/dist/page-script.js +5 -4
  150. package/dist/release.d.ts +13 -6
  151. package/dist/release.js +10 -7
  152. package/dist/root-data.d.ts +16 -6
  153. package/dist/root-data.js +2 -2
  154. package/dist/source/index.d.ts +1 -1
  155. package/dist/source/team-source.d.ts +20 -8
  156. package/dist/source/team-source.js +39 -10
  157. package/dist/source/template-seed.d.ts +2 -2
  158. package/dist/standalone/agent-mail.d.ts +24 -0
  159. package/dist/standalone/agent-mail.js +62 -0
  160. package/dist/standalone/agent-store.d.ts +9 -0
  161. package/dist/standalone/agent-store.js +30 -0
  162. package/dist/standalone/agents.d.ts +78 -12
  163. package/dist/standalone/agents.js +470 -59
  164. package/dist/standalone/app-builds-binding.d.ts +20 -2
  165. package/dist/standalone/app-builds-binding.js +151 -27
  166. package/dist/standalone/app-set.d.ts +5 -2
  167. package/dist/standalone/app-set.js +174 -143
  168. package/dist/standalone/browser.d.ts +11 -0
  169. package/dist/standalone/browser.js +72 -0
  170. package/dist/standalone/builds.d.ts +13 -4
  171. package/dist/standalone/builds.js +28 -44
  172. package/dist/standalone/computer-egress.d.ts +2 -0
  173. package/dist/standalone/computer-egress.js +13 -4
  174. package/dist/standalone/computer-fleet.d.ts +43 -0
  175. package/dist/standalone/computer-fleet.js +200 -0
  176. package/dist/standalone/computer.d.ts +44 -9
  177. package/dist/standalone/computer.js +132 -25
  178. package/dist/standalone/install-apps-cli.js +43 -6
  179. package/dist/standalone/instance.d.ts +2 -2
  180. package/dist/standalone/instance.js +8 -11
  181. package/dist/standalone/machine-link.d.ts +354 -0
  182. package/dist/standalone/machine-link.js +368 -0
  183. package/dist/standalone/media.d.ts +2 -2
  184. package/dist/standalone/media.js +19 -16
  185. package/dist/standalone/preview.d.ts +2 -2
  186. package/dist/standalone/preview.js +39 -12
  187. package/dist/standalone/registry.d.ts +149 -9
  188. package/dist/standalone/registry.js +299 -8
  189. package/dist/standalone/worker.d.ts +19 -5
  190. package/dist/standalone/worker.js +90 -54
  191. package/dist/standalone/workflow-binding.d.ts +28 -32
  192. package/dist/standalone/workflow-binding.js +20 -20
  193. package/dist/standalone/workflow-control.d.ts +4 -0
  194. package/dist/standalone/workflow-control.js +40 -0
  195. package/dist/standalone/workflow-events.d.ts +2 -2
  196. package/dist/standalone/workflow-events.js +9 -10
  197. package/dist/standalone/workflow-git-capture.js +4 -3
  198. package/dist/standalone/workflow-host.d.ts +177 -152
  199. package/dist/standalone/workflow-host.js +137 -30
  200. package/dist/standalone/workflow-node-capture.js +11 -4
  201. package/dist/standalone/workflow-schedules.d.ts +5 -2
  202. package/dist/standalone/workflow-schedules.js +9 -10
  203. package/dist/standalone/workflow-trigger-host.d.ts +88 -6
  204. package/dist/standalone/workflow-trigger-host.js +2 -2
  205. package/dist/standalone/workflow-webhooks.d.ts +22 -0
  206. package/dist/standalone/workflow-webhooks.js +39 -0
  207. package/dist/standalone/workflows.d.ts +203 -50
  208. package/dist/standalone/workflows.js +198 -39
  209. package/dist/storage-frame.d.ts +6 -6
  210. package/dist/testing/capabilities.js +14 -3
  211. package/dist/testing/installation.js +26 -2
  212. package/dist/testing/worker.js +1 -1
  213. package/dist/testing/workers-runtime.d.ts +8 -2
  214. package/dist/testing/workers-runtime.js +20 -2
  215. package/dist/webhook-abuse.d.ts +25 -0
  216. package/dist/webhook-abuse.js +54 -0
  217. package/dist/webhook-custody.d.ts +144 -0
  218. package/dist/webhook-custody.js +222 -0
  219. package/dist/webhook-ingress.d.ts +36 -0
  220. package/dist/webhook-ingress.js +146 -0
  221. package/dist/webhooks.d.ts +111 -0
  222. package/dist/webhooks.js +189 -0
  223. package/dist/workers-git.d.ts +12 -17
  224. package/dist/workers-git.js +60 -55
  225. package/dist/workers.d.ts +224 -13
  226. package/dist/workers.js +351 -51
  227. package/dist/workflow-agent-authority.d.ts +8 -0
  228. package/dist/workflow-agent-authority.js +42 -0
  229. package/dist/workflows.d.ts +66 -0
  230. package/dist/workflows.js +97 -0
  231. package/docs/api/README.md +63 -37
  232. package/docs/api/agents.md +17 -0
  233. package/docs/api/app-storage.md +1 -1
  234. package/docs/api/apps.md +1394 -543
  235. package/docs/api/browser/boot.md +132 -0
  236. package/docs/api/browser.md +1440 -0
  237. package/docs/api/build-contract.md +38 -25
  238. package/docs/api/build.md +263 -84
  239. package/docs/api/cloudflare.md +93 -7
  240. package/docs/api/git.md +3 -13
  241. package/docs/api/host.md +944 -118
  242. package/docs/api/index.md +320 -18
  243. package/docs/api/keys.md +24 -1
  244. package/docs/api/mcp.md +59 -12
  245. package/docs/api/modules.md +33 -40
  246. package/docs/api/pack.md +57 -8
  247. package/docs/api/page/mount.md +92 -4
  248. package/docs/api/workers-git.md +103 -24
  249. package/docs/api/workers.md +1581 -244
  250. package/docs/site/agent-quickstart.mdx +28 -14
  251. package/examples/standalone/worker.ts +3 -1
  252. package/examples/standalone/wrangler.jsonc +2 -0
  253. package/package.json +73 -69
  254. package/dist/installation-consent.d.ts +0 -79
  255. package/dist/installation-consent.js +0 -82
  256. package/dist/shell/app-directory.d.ts +0 -542
  257. package/dist/shell/app-directory.js +0 -199
  258. package/dist/shell/browser-actions.d.ts +0 -7
  259. package/dist/shell/browser-actions.js +0 -56
  260. package/dist/shell/command-host.d.ts +0 -112
  261. package/dist/shell/command-host.js +0 -502
  262. package/dist/shell/commands.d.ts +0 -25
  263. package/dist/shell/commands.js +0 -78
  264. package/dist/shell/index.d.ts +0 -8
  265. package/dist/shell/index.js +0 -8
  266. package/dist/shell/keys.d.ts +0 -41
  267. package/dist/shell/keys.js +0 -134
  268. package/dist/shell/shell-module.d.ts +0 -55
  269. package/dist/shell/shell-module.js +0 -86
  270. package/dist/shell/window-manager.d.ts +0 -124
  271. package/dist/shell/window-manager.js +0 -711
  272. package/dist/shell/workbench-contract.d.ts +0 -68
  273. package/dist/shell/workbench-directory.d.ts +0 -332
  274. package/dist/shell/workbench-directory.js +0 -35
  275. package/dist/shell/workbench-host-types.d.ts +0 -96
  276. package/dist/shell/workbench-host-types.js +0 -1
  277. package/dist/shell/workbench-host.d.ts +0 -34
  278. package/dist/shell/workbench-host.js +0 -347
  279. package/dist/shell/workbench-model.d.ts +0 -192
  280. package/dist/shell/workbench-model.js +0 -53
  281. package/dist/shell/workbench.d.ts +0 -4
  282. package/dist/shell/workbench.js +0 -2
  283. package/docs/api/shell/app-directory.md +0 -599
  284. package/docs/api/shell/command-host.md +0 -224
  285. package/docs/api/shell/commands.md +0 -197
  286. package/docs/api/shell/keys.md +0 -183
  287. package/docs/api/shell/shell-module.md +0 -204
  288. package/docs/api/shell/window-manager.md +0 -267
  289. package/docs/api/shell/workbench-directory.md +0 -119
  290. package/docs/api/shell/workbench.md +0 -205
  291. package/docs/api/shell.md +0 -1915
  292. /package/dist/{shell/workbench-contract.js → page/boot-host.d.ts} +0 -0
@@ -0,0 +1,354 @@
1
+ import { createMachineEnrollment, type MachineEnrollment, type MachineLinkDeviceFacts, type MachineLinkIdentity, type MachineLinkFenceFact, type MachineLinkCaller, type MachineLinkTargetFacts, type MachineAgentHome } from "../machine-link/index.js";
2
+ import { type LiveOysterKey, type OysterKeyStore } from "../keys.js";
3
+ import type { WatchdogSqliteOwner } from "@fungi.computer/watchdog";
4
+ import { DurableObject } from "cloudflare:workers";
5
+ import { type MachineLinkAuthority, type MachineLinkFenceResult } from "../machine-link/index.js";
6
+ import type { PostEnvelope, PostDeliveryResult } from "@fungi.computer/carrier/post";
7
+ import type { MachineAgentOperation } from "@fungi.computer/seam/machine-link-protocol";
8
+ import { type TenantScope } from "../tenant.js";
9
+ import { type StandaloneTenancyEnv } from "./tenancy.js";
10
+ import type { StandaloneAgentsEnv, AgentDirectory } from "./agents.js";
11
+ /** Standalone's fresh directory projection for the shared hosted client. */
12
+ export declare function standaloneMachineAgentHome(options: {
13
+ identity(): Readonly<{
14
+ teamId: string;
15
+ agentId: string;
16
+ }> | null;
17
+ directory: {
18
+ getByName(name: string): Pick<AgentDirectory, "agentHome" | "machineTarget">;
19
+ };
20
+ }): (agentId: string) => Promise<MachineAgentHome>;
21
+ export type StandaloneMachineLinkBindings = Readonly<{
22
+ MACHINE_LINK: DurableObjectNamespace<MachineLinkDO>;
23
+ }>;
24
+ /** Everything the standalone machine link reads from its Worker. */
25
+ export type StandaloneMachineLinkEnv = StandaloneTenancyEnv & Pick<StandaloneAgentsEnv, "AGENTS" | "AGENT_DIRECTORY"> & StandaloneMachineLinkBindings;
26
+ export type StandaloneMachineJoinResult = Readonly<{
27
+ kind: "refused";
28
+ error: "not_allowed" | "request_conflict" | "capacity" | "invalid_enrollment";
29
+ }> | Readonly<{
30
+ kind: "enrolled";
31
+ value: Awaited<ReturnType<ReturnType<typeof createMachineEnrollment>["enroll"]>>;
32
+ }>;
33
+ /** Fresh host authority; no answer is retained by the adapter or the link. */
34
+ export declare function standaloneMachineLinkAuthority(env: StandaloneMachineLinkEnv): MachineLinkAuthority;
35
+ /** HTTP enrollment over the existing live KEYS and directory owners. */
36
+ export declare function standaloneMachineJoinRoutes(options: {
37
+ scope: TenantScope;
38
+ ownerId: () => Promise<string | null>;
39
+ keys: () => Pick<OysterKeyStore, "verify"> & {
40
+ live(keyId: string): Promise<LiveOysterKey | null>;
41
+ };
42
+ enroll(keyId: string, input: MachineEnrollment): Promise<StandaloneMachineJoinResult>;
43
+ }): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
44
+ "/local/mesh/join": {
45
+ $post: {
46
+ input: {
47
+ json: {
48
+ requestId: string;
49
+ publicKey: string;
50
+ machineLabel: string;
51
+ agents: {
52
+ name: string;
53
+ }[];
54
+ };
55
+ };
56
+ output: null;
57
+ outputFormat: "body";
58
+ status: 403;
59
+ } | {
60
+ input: {
61
+ json: {
62
+ requestId: string;
63
+ publicKey: string;
64
+ machineLabel: string;
65
+ agents: {
66
+ name: string;
67
+ }[];
68
+ };
69
+ };
70
+ output: {
71
+ error: string;
72
+ };
73
+ outputFormat: "json";
74
+ status: 400;
75
+ } | {
76
+ input: {
77
+ json: {
78
+ requestId: string;
79
+ publicKey: string;
80
+ machineLabel: string;
81
+ agents: {
82
+ name: string;
83
+ }[];
84
+ };
85
+ };
86
+ output: null;
87
+ outputFormat: "body";
88
+ status: 401;
89
+ } | {
90
+ input: {
91
+ json: {
92
+ requestId: string;
93
+ publicKey: string;
94
+ machineLabel: string;
95
+ agents: {
96
+ name: string;
97
+ }[];
98
+ };
99
+ };
100
+ output: {
101
+ error: "request_conflict" | "capacity";
102
+ };
103
+ outputFormat: "json";
104
+ status: 409;
105
+ } | {
106
+ input: {
107
+ json: {
108
+ requestId: string;
109
+ publicKey: string;
110
+ machineLabel: string;
111
+ agents: {
112
+ name: string;
113
+ }[];
114
+ };
115
+ };
116
+ output: {
117
+ error: string;
118
+ };
119
+ outputFormat: "json";
120
+ status: 400;
121
+ } | {
122
+ input: {
123
+ json: {
124
+ requestId: string;
125
+ publicKey: string;
126
+ machineLabel: string;
127
+ agents: {
128
+ name: string;
129
+ }[];
130
+ };
131
+ };
132
+ output: {
133
+ deviceId: string;
134
+ agents: {
135
+ selection: number;
136
+ agentId: string;
137
+ }[];
138
+ kind: string;
139
+ scopeId: string;
140
+ };
141
+ outputFormat: "json";
142
+ status: 200;
143
+ };
144
+ };
145
+ }, "/", "/local/mesh/join">;
146
+ /** Only join accepts an oyk credential; every subsequent dial uses Seam. */
147
+ export declare function standaloneMachineLinkRoutes(env: StandaloneMachineLinkEnv): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
148
+ "/local/mesh/join": {
149
+ $post: {
150
+ input: {
151
+ json: {
152
+ requestId: string;
153
+ publicKey: string;
154
+ machineLabel: string;
155
+ agents: {
156
+ name: string;
157
+ }[];
158
+ };
159
+ };
160
+ output: null;
161
+ outputFormat: "body";
162
+ status: 403;
163
+ } | {
164
+ input: {
165
+ json: {
166
+ requestId: string;
167
+ publicKey: string;
168
+ machineLabel: string;
169
+ agents: {
170
+ name: string;
171
+ }[];
172
+ };
173
+ };
174
+ output: {
175
+ error: string;
176
+ };
177
+ outputFormat: "json";
178
+ status: 400;
179
+ } | {
180
+ input: {
181
+ json: {
182
+ requestId: string;
183
+ publicKey: string;
184
+ machineLabel: string;
185
+ agents: {
186
+ name: string;
187
+ }[];
188
+ };
189
+ };
190
+ output: null;
191
+ outputFormat: "body";
192
+ status: 401;
193
+ } | {
194
+ input: {
195
+ json: {
196
+ requestId: string;
197
+ publicKey: string;
198
+ machineLabel: string;
199
+ agents: {
200
+ name: string;
201
+ }[];
202
+ };
203
+ };
204
+ output: {
205
+ error: "request_conflict" | "capacity";
206
+ };
207
+ outputFormat: "json";
208
+ status: 409;
209
+ } | {
210
+ input: {
211
+ json: {
212
+ requestId: string;
213
+ publicKey: string;
214
+ machineLabel: string;
215
+ agents: {
216
+ name: string;
217
+ }[];
218
+ };
219
+ };
220
+ output: {
221
+ error: string;
222
+ };
223
+ outputFormat: "json";
224
+ status: 400;
225
+ } | {
226
+ input: {
227
+ json: {
228
+ requestId: string;
229
+ publicKey: string;
230
+ machineLabel: string;
231
+ agents: {
232
+ name: string;
233
+ }[];
234
+ };
235
+ };
236
+ output: {
237
+ deviceId: string;
238
+ agents: {
239
+ selection: number;
240
+ agentId: string;
241
+ }[];
242
+ kind: string;
243
+ scopeId: string;
244
+ };
245
+ outputFormat: "json";
246
+ status: 200;
247
+ };
248
+ };
249
+ } & {
250
+ "/api/teams/:teamId/local/mesh/:deviceId/connect": {
251
+ $get: {
252
+ input: {
253
+ param: {
254
+ teamId: string;
255
+ } & {
256
+ deviceId: string;
257
+ };
258
+ };
259
+ output: {};
260
+ outputFormat: string;
261
+ status: import("hono/utils/http-status").StatusCode;
262
+ };
263
+ };
264
+ }, "/", "/api/teams/:teamId/local/mesh/:deviceId/connect">;
265
+ /** One device's link; directory, credentials and owner state remain elsewhere. */
266
+ export declare class MachineLinkDO extends DurableObject<StandaloneMachineLinkEnv> {
267
+ private readonly link;
268
+ fetch(request: Request): Promise<Response>;
269
+ deliver(id: MachineLinkIdentity, caller: MachineLinkCaller, agentId: string, envelope: PostEnvelope): Promise<PostDeliveryResult>;
270
+ operation(id: MachineLinkIdentity, caller: MachineLinkCaller, agentId: string, operation: MachineAgentOperation): Promise<import("effect/Schema").Json>;
271
+ applyFence(fact: MachineLinkFenceFact): Promise<MachineLinkFenceResult>;
272
+ preflightErasure(teamId: string, deviceId: string): Promise<void>;
273
+ eraseForTeam(teamId: string, deviceId: string): Promise<{
274
+ erased: boolean;
275
+ }>;
276
+ readErasure(): Promise<{
277
+ erased: boolean;
278
+ }>;
279
+ webSocketMessage(socket: WebSocket, message: string | ArrayBuffer): Promise<void>;
280
+ webSocketClose(socket: WebSocket, code: number, reason: string): void;
281
+ webSocketError(socket: WebSocket): void;
282
+ }
283
+ /** Enrollment and the ordinary directory share this one SQLite owner. */
284
+ export declare function createStandaloneMachineEnrollment(options: {
285
+ owner: WatchdogSqliteOwner;
286
+ scopeId: string;
287
+ ownerId: () => Promise<string | null>;
288
+ liveKey: (keyId: string) => Promise<LiveOysterKey | null>;
289
+ onAgentCreated: (agentId: string) => void;
290
+ }): {
291
+ admitDevice: (id: MachineLinkIdentity) => Promise<MachineLinkDeviceFacts>;
292
+ currentFence: (id: MachineLinkIdentity) => Promise<MachineLinkFenceFact | null>;
293
+ target: (caller: MachineLinkCaller, agentId: string, requester: string | null) => Promise<MachineLinkTargetFacts>;
294
+ publicDirectory(id: MachineLinkIdentity): Promise<{
295
+ agentId: import("@fungi.computer/shiitake/fleet").AgentId;
296
+ name: string;
297
+ }[]>;
298
+ enrollWithKey(keyId: string, input: MachineEnrollment): Promise<{
299
+ deviceId: string;
300
+ agents: {
301
+ selection: number;
302
+ agentId: string;
303
+ }[];
304
+ }>;
305
+ enroll: (rawMember: import("../machine-link/enrollment.js").MachineMember, raw: MachineEnrollment) => Promise<{
306
+ deviceId: string;
307
+ agents: {
308
+ selection: number;
309
+ agentId: string;
310
+ }[];
311
+ }>;
312
+ device: (deviceId: string) => {
313
+ deviceId: string;
314
+ memberId: string;
315
+ clientId: string;
316
+ loginId: string;
317
+ publicKey: string;
318
+ machineLabel: string;
319
+ fenceEpoch: number;
320
+ } | null;
321
+ home: (agentId: string) => MachineAgentHome | null;
322
+ revoke: (memberId: string, deviceId: string) => boolean;
323
+ authorizeDevice: (deviceId: string) => Promise<{
324
+ deviceId: string;
325
+ memberId: string;
326
+ clientId: string;
327
+ loginId: string;
328
+ publicKey: string;
329
+ machineLabel: string;
330
+ fenceEpoch: number;
331
+ }>;
332
+ retainedDevices: () => {
333
+ deviceId: string;
334
+ memberId: string;
335
+ clientId: string;
336
+ loginId: string;
337
+ revoked: boolean;
338
+ fenceEpoch: number;
339
+ }[];
340
+ fenceDevice: (deviceId: string) => number | null;
341
+ fenceMember: (memberId: string) => {
342
+ deviceId: string;
343
+ fenceEpoch: number;
344
+ }[];
345
+ fenceLogins: (memberId: string, selection: import("../machine-link/enrollment.js").MachineLoginSelection) => {
346
+ deviceId: string;
347
+ fenceEpoch: number;
348
+ }[];
349
+ retireAllForErasure: () => {
350
+ deviceId: string;
351
+ fenceEpoch: number;
352
+ }[];
353
+ keyRetired: (deviceId: string) => boolean;
354
+ };