@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
@@ -1,68 +0,0 @@
1
- import type { AgentSessionSelection } from "@fungi.computer/agar";
2
- import type { GillReply } from "@fungi.computer/gills";
3
- import type { AppOpenInput } from "@fungi.computer/agar/apps";
4
- import type { WhistleJsonValue } from "@fungi.computer/whistle";
5
- import type { WorkbenchChildEvents, WorkbenchChildHandle, WorkbenchChildLaunch, WorkbenchGillRequest, WorkbenchGillWatch, WorkbenchPlatformDestination, WorkbenchDesktopSettings, WorkbenchDesktopRegistration } from "./workbench-model.js";
6
- /** Team dashboards additionally relay the selected Agent Session to the Hub. */
7
- export type TeamWorkbenchChildEvents = WorkbenchChildEvents & Readonly<{
8
- /** Relay a child's explicit Agent Session selection to its host. */
9
- onAgentSessionSelection: (selection: AgentSessionSelection | null) => Promise<void>;
10
- }>;
11
- /**
12
- * Team/Computer/App-directory reads and child-App hosting for the trusted
13
- * shell. The host composes the shell into its own top-level document, so the
14
- * shell runs with the host's escalated permissions; each child App still runs
15
- * in its own sandboxed frame with its own separately resolved approvals.
16
- */
17
- export type TeamWorkbenchHostHandle = {
18
- /** The authenticated Team hosting this dashboard; the caller parses it. */
19
- team(): Promise<WhistleJsonValue>;
20
- /** A page of the Team's Computer inventory; the caller parses it. */
21
- computers(input: Readonly<{
22
- limit: number;
23
- offset: number;
24
- }>): Promise<WhistleJsonValue>;
25
- /** The Team's effective App directory and role choices; the caller parses it. */
26
- directory(): Promise<WhistleJsonValue>;
27
- /** Invoke a declared Gill of an admitted App in this Team. No caller-provided resource data. */
28
- requestGill(input: WorkbenchGillRequest): Promise<GillReply>;
29
- /** Observe resource changes; only the host owns the authenticated stream. Close while covered. */
30
- watchGillChanges(input: WorkbenchGillRequest, onChanged: () => Promise<void>): Promise<WorkbenchGillWatch>;
31
- /**
32
- * Resolve, authorize and mount one child App inside `container`, the
33
- * shell's own slot in that App's window. The host never moves the child:
34
- * the shell keeps `container` attached and moves its window instead.
35
- */
36
- mount(container: HTMLElement, input: WorkbenchChildLaunch, events: TeamWorkbenchChildEvents): Promise<WorkbenchChildHandle>;
37
- /** Bind one mounted child's explicit Agent Session selection to the host. */
38
- reportAgentSessionSelection(windowId: string, selection: AgentSessionSelection | null): Promise<void>;
39
- /** The platform destinations the host currently offers. */
40
- platformDestinations(): Promise<readonly WorkbenchPlatformDestination[]>;
41
- /** Offered Settings categories, or null for unrestricted host controls. */
42
- settingsSections(): Promise<readonly string[] | null>;
43
- /** Ask the host to navigate to one offered platform destination. */
44
- openPlatformDestination(id: string): Promise<void>;
45
- /**
46
- * Take, once, the App-open handoff the visitor's Hub address carried (for
47
- * example `?open=inbox&intent=compose`). The host consumes it from its own
48
- * address; the dashboard opens it like any other `apps.open` request.
49
- */
50
- takeAppOpenRequest(): Promise<AppOpenInput | null>;
51
- /**
52
- * Open the host's own Team settings at a dashboard-defined location (the
53
- * host parses it). Administration there runs with the signed-in person's
54
- * own authority in host-rendered UI, never through the dashboard.
55
- * Resolves when Settings close, so the dashboard restores its own focus.
56
- */
57
- openSettings(location: WhistleJsonValue): Promise<void>;
58
- /** Bind the admitted dashboard's arranger to the host's member-consent UI.
59
- * Only the host invokes it; ordinary Apps can only open their own Settings. */
60
- registerDesktopSettings(handler: WorkbenchDesktopSettings): Promise<WorkbenchDesktopRegistration>;
61
- /**
62
- * Hear when host-rendered settings or App access consent changed the
63
- * Team's Apps or the person's settings, so the dashboard refreshes.
64
- */
65
- watchSettingsChanges(onChanged: () => Promise<void>): Promise<void>;
66
- /** The signed-in person's own avatar preference; the caller parses it. */
67
- memberAvatar(): Promise<WhistleJsonValue>;
68
- };
@@ -1,332 +0,0 @@
1
- import * as z from "zod";
2
- /** Desktop metadata shared by hosts; hosted administration stays in Settings. */
3
- export declare const workbenchDirectorySchema: z.ZodPipe<z.ZodObject<{
4
- apps: z.ZodArray<z.ZodObject<{
5
- address: z.ZodUnion<readonly [z.ZodObject<{
6
- kind: z.ZodLiteral<"default">;
7
- appId: z.ZodString;
8
- }, z.core.$strict>, z.ZodObject<{
9
- kind: z.ZodLiteral<"installation">;
10
- installationId: z.ZodString;
11
- }, z.core.$strict>]>;
12
- installationId: z.ZodNullable<z.ZodString>;
13
- surfaceId: z.ZodString;
14
- appId: z.ZodString;
15
- displayName: z.ZodOptional<z.ZodString>;
16
- icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
- releaseId: z.ZodNullable<z.ZodString>;
18
- authorityVersion: z.ZodNumber;
19
- enforcement: z.ZodNullable<z.ZodObject<{
20
- requestId: z.ZodString;
21
- address: z.ZodUnion<readonly [z.ZodObject<{
22
- kind: z.ZodLiteral<"default">;
23
- appId: z.ZodString;
24
- }, z.core.$strict>, z.ZodObject<{
25
- kind: z.ZodLiteral<"installation">;
26
- installationId: z.ZodString;
27
- }, z.core.$strict>]>;
28
- authorityVersion: z.ZodNumber;
29
- state: z.ZodEnum<{
30
- unaffected: "unaffected";
31
- pending: "pending";
32
- applied: "applied";
33
- expired: "expired";
34
- }>;
35
- outstanding: z.ZodNumber;
36
- }, z.core.$strict>>;
37
- handlers: z.ZodArray<z.ZodLiteral<"file.open">>;
38
- roles: z.ZodArray<z.ZodString>;
39
- declaredCapabilities: z.ZodArray<z.ZodString>;
40
- calls: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodTransform<readonly {
41
- readonly appId: string;
42
- readonly methods: readonly string[];
43
- }[], unknown>>>;
44
- commands: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<Readonly<{
45
- id: string;
46
- title: string;
47
- category: string;
48
- description?: string | undefined;
49
- sigil?: string | undefined;
50
- projections?: Readonly<{
51
- bindings?: (Readonly<{
52
- order?: number | undefined;
53
- }> & Readonly<{
54
- values: readonly string[];
55
- }>) | undefined;
56
- agent?: (Readonly<{
57
- order?: number | undefined;
58
- }> & Readonly<{
59
- keybind?: string | undefined;
60
- }>) | undefined;
61
- help?: Readonly<{
62
- order?: number | undefined;
63
- }> | undefined;
64
- menu?: Readonly<{
65
- order?: number | undefined;
66
- }> | undefined;
67
- palette?: Readonly<{
68
- order?: number | undefined;
69
- }> | undefined;
70
- slash?: (Readonly<{
71
- order?: number | undefined;
72
- }> & Readonly<{
73
- aliases: readonly string[];
74
- }>) | undefined;
75
- }> | undefined;
76
- }>[], unknown[]>>;
77
- gills: z.ZodPipe<z.ZodArray<z.ZodUnknown>, z.ZodTransform<import("./app-directory.js").AppDirectoryGill[], unknown[]>>;
78
- availability: z.ZodEnum<{
79
- available: "available";
80
- unavailable: "unavailable";
81
- }>;
82
- surface: z.ZodNullable<z.ZodObject<{
83
- stableRoute: z.ZodString;
84
- }, z.core.$strict>>;
85
- surfacePath: z.ZodString;
86
- computer: z.ZodOptional<z.ZodObject<{
87
- computerId: z.ZodString;
88
- name: z.ZodString;
89
- }, z.core.$strip>>;
90
- computerPermission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
91
- kind: z.ZodLiteral<"selected-computers">;
92
- computers: z.ZodArray<z.ZodObject<{
93
- computerId: z.ZodString;
94
- operations: z.ZodArray<z.ZodEnum<{
95
- "computer.list": "computer.list";
96
- "computer.readFile": "computer.readFile";
97
- "computer.writeFile": "computer.writeFile";
98
- "computer.execute": "computer.execute";
99
- }>>;
100
- }, z.core.$strict>>;
101
- }, z.core.$strict>, z.ZodObject<{
102
- kind: z.ZodLiteral<"all-team-computers">;
103
- operations: z.ZodArray<z.ZodEnum<{
104
- "computer.list": "computer.list";
105
- "computer.readFile": "computer.readFile";
106
- "computer.writeFile": "computer.writeFile";
107
- "computer.execute": "computer.execute";
108
- }>>;
109
- }, z.core.$strict>], "kind">>>;
110
- }, z.core.$strip>>;
111
- computer: z.ZodOptional<z.ZodObject<{
112
- computerId: z.ZodString;
113
- name: z.ZodString;
114
- }, z.core.$strip>>;
115
- roles: z.ZodRecord<z.ZodString, z.ZodObject<{
116
- surfaceId: z.ZodNullable<z.ZodString>;
117
- chosen: z.ZodBoolean;
118
- }, z.core.$strict>>;
119
- needsUpdate: z.ZodOptional<z.ZodArray<z.ZodObject<{
120
- installationId: z.ZodNullable<z.ZodString>;
121
- appId: z.ZodNullable<z.ZodString>;
122
- displayName: z.ZodString;
123
- }, z.core.$strict>>>;
124
- }, z.core.$strip>, z.ZodTransform<{
125
- apps: {
126
- address: {
127
- kind: "default";
128
- appId: string;
129
- } | {
130
- kind: "installation";
131
- installationId: string;
132
- };
133
- installationId: string | null;
134
- surfaceId: string;
135
- appId: string;
136
- releaseId: string | null;
137
- authorityVersion: number;
138
- enforcement: {
139
- requestId: string;
140
- address: {
141
- kind: "default";
142
- appId: string;
143
- } | {
144
- kind: "installation";
145
- installationId: string;
146
- };
147
- authorityVersion: number;
148
- state: "unaffected" | "pending" | "applied" | "expired";
149
- outstanding: number;
150
- } | null;
151
- handlers: "file.open"[];
152
- roles: string[];
153
- declaredCapabilities: string[];
154
- commands: Readonly<{
155
- id: string;
156
- title: string;
157
- category: string;
158
- description?: string | undefined;
159
- sigil?: string | undefined;
160
- projections?: Readonly<{
161
- bindings?: (Readonly<{
162
- order?: number | undefined;
163
- }> & Readonly<{
164
- values: readonly string[];
165
- }>) | undefined;
166
- agent?: (Readonly<{
167
- order?: number | undefined;
168
- }> & Readonly<{
169
- keybind?: string | undefined;
170
- }>) | undefined;
171
- help?: Readonly<{
172
- order?: number | undefined;
173
- }> | undefined;
174
- menu?: Readonly<{
175
- order?: number | undefined;
176
- }> | undefined;
177
- palette?: Readonly<{
178
- order?: number | undefined;
179
- }> | undefined;
180
- slash?: (Readonly<{
181
- order?: number | undefined;
182
- }> & Readonly<{
183
- aliases: readonly string[];
184
- }>) | undefined;
185
- }> | undefined;
186
- }>[];
187
- gills: import("./app-directory.js").AppDirectoryGill[];
188
- availability: "available" | "unavailable";
189
- surface: {
190
- stableRoute: string;
191
- } | null;
192
- surfacePath: string;
193
- displayName?: string | undefined;
194
- icon?: string | null | undefined;
195
- calls?: readonly {
196
- readonly appId: string;
197
- readonly methods: readonly string[];
198
- }[] | undefined;
199
- computer?: {
200
- computerId: string;
201
- name: string;
202
- } | undefined;
203
- computerPermission?: {
204
- kind: "selected-computers";
205
- computers: {
206
- computerId: string;
207
- operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
208
- }[];
209
- } | {
210
- kind: "all-team-computers";
211
- operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
212
- } | null | undefined;
213
- }[];
214
- roles: Record<string, {
215
- surfaceId: string | null;
216
- chosen: boolean;
217
- }>;
218
- computer?: {
219
- computerId: string;
220
- name: string;
221
- } | undefined;
222
- needsUpdate?: {
223
- installationId: string | null;
224
- appId: string | null;
225
- displayName: string;
226
- }[] | undefined;
227
- }, {
228
- apps: {
229
- address: {
230
- kind: "default";
231
- appId: string;
232
- } | {
233
- kind: "installation";
234
- installationId: string;
235
- };
236
- installationId: string | null;
237
- surfaceId: string;
238
- appId: string;
239
- releaseId: string | null;
240
- authorityVersion: number;
241
- enforcement: {
242
- requestId: string;
243
- address: {
244
- kind: "default";
245
- appId: string;
246
- } | {
247
- kind: "installation";
248
- installationId: string;
249
- };
250
- authorityVersion: number;
251
- state: "unaffected" | "pending" | "applied" | "expired";
252
- outstanding: number;
253
- } | null;
254
- handlers: "file.open"[];
255
- roles: string[];
256
- declaredCapabilities: string[];
257
- commands: Readonly<{
258
- id: string;
259
- title: string;
260
- category: string;
261
- description?: string | undefined;
262
- sigil?: string | undefined;
263
- projections?: Readonly<{
264
- bindings?: (Readonly<{
265
- order?: number | undefined;
266
- }> & Readonly<{
267
- values: readonly string[];
268
- }>) | undefined;
269
- agent?: (Readonly<{
270
- order?: number | undefined;
271
- }> & Readonly<{
272
- keybind?: string | undefined;
273
- }>) | undefined;
274
- help?: Readonly<{
275
- order?: number | undefined;
276
- }> | undefined;
277
- menu?: Readonly<{
278
- order?: number | undefined;
279
- }> | undefined;
280
- palette?: Readonly<{
281
- order?: number | undefined;
282
- }> | undefined;
283
- slash?: (Readonly<{
284
- order?: number | undefined;
285
- }> & Readonly<{
286
- aliases: readonly string[];
287
- }>) | undefined;
288
- }> | undefined;
289
- }>[];
290
- gills: import("./app-directory.js").AppDirectoryGill[];
291
- availability: "available" | "unavailable";
292
- surface: {
293
- stableRoute: string;
294
- } | null;
295
- surfacePath: string;
296
- displayName?: string | undefined;
297
- icon?: string | null | undefined;
298
- calls?: readonly {
299
- readonly appId: string;
300
- readonly methods: readonly string[];
301
- }[] | undefined;
302
- computer?: {
303
- computerId: string;
304
- name: string;
305
- } | undefined;
306
- computerPermission?: {
307
- kind: "selected-computers";
308
- computers: {
309
- computerId: string;
310
- operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
311
- }[];
312
- } | {
313
- kind: "all-team-computers";
314
- operations: ("computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute")[];
315
- } | null | undefined;
316
- }[];
317
- roles: Record<string, {
318
- surfaceId: string | null;
319
- chosen: boolean;
320
- }>;
321
- computer?: {
322
- computerId: string;
323
- name: string;
324
- } | undefined;
325
- needsUpdate?: {
326
- installationId: string | null;
327
- appId: string | null;
328
- displayName: string;
329
- }[] | undefined;
330
- }>>;
331
- /** One host's current desktop rows and actual role selections. */
332
- export type WorkbenchDirectory = z.output<typeof workbenchDirectorySchema>;
@@ -1,35 +0,0 @@
1
- import * as z from "zod";
2
- import { appDirectoryEntrySchema, appRoleSelectionSchema, appComputerPermissionSchema, } from "./app-directory.js";
3
- import { teamComputerSchema } from "./workbench-model.js";
4
- const computerChoiceSchema = teamComputerSchema
5
- .pick({ computerId: true, name: true })
6
- .strip();
7
- /** Desktop metadata shared by hosts; hosted administration stays in Settings. */
8
- export const workbenchDirectorySchema = z
9
- .object({
10
- apps: z.array(appDirectoryEntrySchema
11
- .extend({
12
- computer: computerChoiceSchema.optional(),
13
- computerPermission: appComputerPermissionSchema.nullable().optional(),
14
- })
15
- .strip()),
16
- /** Fixed standalone context, not a Team Computer permission or capability grant. */
17
- computer: computerChoiceSchema.optional(),
18
- roles: z.record(z.string().min(1), appRoleSelectionSchema),
19
- needsUpdate: z
20
- .array(z.strictObject({
21
- installationId: z.string().min(1).nullable(),
22
- appId: z.string().min(1).nullable(),
23
- displayName: z.string().min(1),
24
- }))
25
- .optional(),
26
- })
27
- .transform((directory) => directory.computer === undefined
28
- ? directory
29
- : {
30
- ...directory,
31
- apps: directory.apps.map((app) => ({
32
- ...app,
33
- computer: directory.computer,
34
- })),
35
- });
@@ -1,96 +0,0 @@
1
- import type { TeamWorkbenchChildEvents, TeamWorkbenchHostHandle } from "./workbench-contract.js";
2
- import type { AgentSessionSelection, AppPermissionOutcome, AppPermissionRequest } from "@fungi.computer/agar";
3
- import type { WhistleJsonValue } from "@fungi.computer/whistle";
4
- import type { AppCommandDeclaration, AppSurfaceCommandMount } from "./command-host.js";
5
- import type { WorkbenchChildHandle, WorkbenchChildLaunch, WorkbenchDesktopSettings, WorkbenchPlatformDestination } from "./workbench-model.js";
6
- /** A launch checked against the embedding host's own installation authority. */
7
- export type WorkbenchResolvedChild = Readonly<{
8
- launch: Omit<WorkbenchChildLaunch, "title">;
9
- title?: string;
10
- }>;
11
- /** The host's real mounted App; selection and lease replacement stay with it. */
12
- export type WorkbenchChildSurface = Pick<WorkbenchChildHandle, "setVisibility" | "requestClose" | "requestBack" | "activateStatus"> & {
13
- /** Release the mounted child or host-owned observations. */
14
- dispose(): void;
15
- /** Replace the host-admitted selection while retaining the child document. */
16
- reconfigure(launch: WorkbenchResolvedChild["launch"]): Promise<void>;
17
- };
18
- /** Inputs shared child-window mechanics supply to the host's admitted mount. */
19
- export type WorkbenchChildMountOptions = Readonly<{
20
- container: HTMLElement;
21
- hostWindow: Window;
22
- title?: string;
23
- events: TeamWorkbenchChildEvents;
24
- commands: AppSurfaceCommandMount;
25
- /** Suggest the child's admitted surface in host-rendered Settings. */
26
- onDesktopSettings: (surfaceId: string) => Promise<void>;
27
- /** Ask the host to obtain the person's approval for the child. */
28
- onPermissionRequest: (input: AppPermissionRequest) => Promise<AppPermissionOutcome>;
29
- }>;
30
- /** Host-owned admission and lifetime of one prepared child. */
31
- export type WorkbenchPreparedChild = Readonly<{
32
- commands: readonly AppCommandDeclaration[];
33
- /** Connect the prepared App using the shared window callbacks and commands. */
34
- mount(options: WorkbenchChildMountOptions): Promise<WorkbenchChildSurface>;
35
- /** Release preparation and lease resources, including a failed mount. */
36
- dispose(): Promise<void>;
37
- }>;
38
- /** Host services retain their own Team, account, Gill and consent authority. */
39
- export type WorkbenchHostServices = Pick<TeamWorkbenchHostHandle, "team" | "computers" | "directory" | "requestGill" | "watchGillChanges" | "memberAvatar"> & Readonly<{
40
- /** Offer host-owned desktop Settings for this currently admitted surface. */
41
- suggestDesktopSettings(surfaceId: string): Promise<void>;
42
- /** Release the mounted child or host-owned observations. */
43
- dispose(): void;
44
- }>;
45
- /** Controls offered by the real embedding host, never grants lent by the App. */
46
- export type WorkbenchHostControls = Readonly<{
47
- /** Implemented Settings categories; omission means the retained unrestricted controls. */
48
- sections?: readonly string[] | undefined;
49
- /** Validate a location against the Settings this host actually offers. */
50
- parseSettings(location: WhistleJsonValue): WhistleJsonValue;
51
- /** Open validated host-rendered Settings without racing dashboard focus. */
52
- openSettings(location: WhistleJsonValue, options: Readonly<{
53
- restoreFocus: boolean;
54
- }>): void;
55
- /** Notify when the host dialog has closed; return its unsubscribe action. */
56
- subscribeSettingsClosed(listener: () => void): () => void;
57
- /** Observe host Settings changes until the returned unsubscribe is called. */
58
- subscribeChanges(listener: () => void): () => void;
59
- /** Attach the dashboard arranger; return the host registration cleanup. */
60
- attachDesktopSettings(handler: WorkbenchDesktopSettings): () => void;
61
- /** Ask the person for the child's own access, never through the dashboard. */
62
- requestAppAccess(target: Readonly<{
63
- surfaceId: string;
64
- title: string;
65
- }>, input: AppPermissionRequest): Promise<AppPermissionOutcome>;
66
- }>;
67
- /** Retained host warning identifiers; adapters own their diagnostic sink. */
68
- export type WorkbenchWarningEvent = "team_workbench_commands_failed" | "team_workbench_settings_notification_failed" | "team_workbench_focus_notification_failed";
69
- /** Fields of a retained child/settings notification failure. */
70
- export type WorkbenchWarningFields = Readonly<{
71
- cause: unknown;
72
- }> | Readonly<{
73
- stage: "update" | "dispose";
74
- cause: unknown;
75
- }>;
76
- /** One workbench's child mechanics over host-owned admission and services. */
77
- export type WorkbenchHostOptions = Readonly<{
78
- hostWindow: Window;
79
- /** Check identity and launch address against this host's installation scope. */
80
- resolveLaunch(input: WorkbenchChildLaunch): WorkbenchResolvedChild;
81
- /** Prepare the child using its own current grants and lease owner. */
82
- prepareChild(launch: WorkbenchResolvedChild["launch"]): Promise<WorkbenchPreparedChild>;
83
- services: WorkbenchHostServices;
84
- /** Report a mounted child's explicit selection to the embedding host. */
85
- reportAgentSessionSelection(windowId: string, selection: AgentSessionSelection | null): void;
86
- platform: Readonly<{
87
- controls: WorkbenchHostControls;
88
- /** List only destinations the host currently implements. */
89
- destinations(): Promise<readonly WorkbenchPlatformDestination[]>;
90
- /** Follow a destination that the shared host verified was offered. */
91
- open(id: string): void;
92
- takeAppOpenRequest: TeamWorkbenchHostHandle["takeAppOpenRequest"];
93
- }>;
94
- /** Surface retained callback failures through the host's diagnostic sink. */
95
- log(event: WorkbenchWarningEvent, fields: WorkbenchWarningFields): void;
96
- }>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,34 +0,0 @@
1
- import type { TeamWorkbenchHostHandle, TeamWorkbenchChildEvents } from "./workbench-contract.js";
2
- import type { AgentSessionSelection } from "@fungi.computer/agar";
3
- import type { AppOpenInput } from "@fungi.computer/agar/apps";
4
- import type { WhistleJsonValue } from "@fungi.computer/whistle";
5
- import { type WorkbenchDesktopRegistration, type WorkbenchChildHandle, type WorkbenchChildLaunch, type WorkbenchPlatformDestination } from "./workbench-model.js";
6
- import type { WorkbenchHostOptions } from "./workbench-host-types.js";
7
- /**
8
- * Child-window, command and callback lifetime for the trusted shell the host
9
- * composes into its own document. Each child mounts inside the window slot
10
- * the shell hands it, so the browser moves, clips and stacks it with that
11
- * window; the host never positions a child itself.
12
- */
13
- export declare class WorkbenchHost implements TeamWorkbenchHostHandle {
14
- #private;
15
- constructor(options: WorkbenchHostOptions);
16
- team(): ReturnType<TeamWorkbenchHostHandle["team"]>;
17
- computers(input: Parameters<TeamWorkbenchHostHandle["computers"]>[0]): ReturnType<TeamWorkbenchHostHandle["computers"]>;
18
- directory(): ReturnType<TeamWorkbenchHostHandle["directory"]>;
19
- requestGill(input: Parameters<TeamWorkbenchHostHandle["requestGill"]>[0]): ReturnType<TeamWorkbenchHostHandle["requestGill"]>;
20
- watchGillChanges(...input: Parameters<TeamWorkbenchHostHandle["watchGillChanges"]>): ReturnType<TeamWorkbenchHostHandle["watchGillChanges"]>;
21
- platformDestinations(): Promise<readonly WorkbenchPlatformDestination[]>;
22
- openPlatformDestination(id: string): Promise<void>;
23
- /** Describe the actual controls without offering unsupported Settings. */
24
- settingsSections(): Promise<readonly string[] | null>;
25
- takeAppOpenRequest(): Promise<AppOpenInput | null>;
26
- registerDesktopSettings(handler: unknown): Promise<WorkbenchDesktopRegistration>;
27
- openSettings(location: WhistleJsonValue): Promise<void>;
28
- memberAvatar(): ReturnType<TeamWorkbenchHostHandle["memberAvatar"]>;
29
- watchSettingsChanges(onChanged: () => Promise<void>): Promise<void>;
30
- /** The shell unmounted: stop notifying its callbacks. */
31
- [Symbol.dispose](): void;
32
- mount(container: HTMLElement, input: WorkbenchChildLaunch, events: TeamWorkbenchChildEvents): Promise<WorkbenchChildHandle>;
33
- reportAgentSessionSelection(windowId: string, selection: AgentSessionSelection | null): Promise<void>;
34
- }