@fungi.computer/oyster 0.2.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.
- package/README.md +376 -72
- package/dist/agents.d.ts +3 -2
- package/dist/agents.js +4 -2
- package/dist/app-builds.d.ts +81 -8
- package/dist/app-builds.js +210 -60
- package/dist/app-storage.d.ts +3 -3
- package/dist/approval-capability.d.ts +5 -0
- package/dist/approval-capability.js +46 -0
- package/dist/approval-home.d.ts +51 -0
- package/dist/approval-home.js +226 -0
- package/dist/apps/catalog.d.ts +335 -0
- package/dist/apps/catalog.js +46 -0
- package/dist/apps/gate.d.ts +20 -6
- package/dist/apps/gate.js +42 -16
- package/dist/apps/index.d.ts +3 -1
- package/dist/apps/index.js +3 -1
- package/dist/apps/installation.d.ts +132 -51
- package/dist/apps/installation.js +176 -70
- package/dist/apps/permissions.d.ts +247 -0
- package/dist/apps/permissions.js +255 -0
- package/dist/boot-capability-route.d.ts +15 -0
- package/dist/boot-capability-route.js +196 -0
- package/dist/boot-capability.d.ts +103 -0
- package/dist/boot-capability.js +141 -0
- package/dist/boot-construction.d.ts +12 -0
- package/dist/boot-construction.js +175 -0
- package/dist/boot-gate.d.ts +267 -0
- package/dist/boot-gate.js +236 -0
- package/dist/boot-host-script.d.ts +2 -0
- package/dist/boot-host-script.js +1 -0
- package/dist/boot-mount.d.ts +21 -0
- package/dist/boot-mount.js +65 -0
- package/dist/browser/boot.d.ts +73 -0
- package/dist/browser/boot.js +502 -0
- package/dist/browser/browser.d.ts +104 -0
- package/dist/browser/browser.js +374 -0
- package/dist/browser/capability-source.d.ts +76 -0
- package/dist/browser/capability-source.js +338 -0
- package/dist/browser/cdp-client.d.ts +56 -0
- package/dist/browser/cdp-client.js +184 -0
- package/dist/browser/errors.d.ts +79 -0
- package/dist/browser/errors.js +32 -0
- package/dist/browser/index.d.ts +16 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/lease-registry.d.ts +61 -0
- package/dist/browser/lease-registry.js +101 -0
- package/dist/browser/operations.d.ts +225 -0
- package/dist/browser/operations.js +137 -0
- package/dist/browser/page.d.ts +25 -0
- package/dist/browser/page.js +172 -0
- package/dist/browser/quick-reads.d.ts +29 -0
- package/dist/browser/quick-reads.js +160 -0
- package/dist/browser/sessions.d.ts +52 -0
- package/dist/browser/sessions.js +118 -0
- package/dist/browser/url-policy.d.ts +18 -0
- package/dist/browser/url-policy.js +58 -0
- package/dist/build/app-imports.d.ts +12 -0
- package/dist/build/app-imports.js +105 -0
- package/dist/build/build-policy.d.ts +5 -3
- package/dist/build/build-policy.js +5 -3
- package/dist/build/candidate-builder.d.ts +1 -1
- package/dist/build/candidate-cli.mjs +8375 -334
- package/dist/build/local-build.d.ts +2 -0
- package/dist/build/local-build.js +28 -6
- package/dist/build/snapshot-package-store.d.ts +1 -1
- package/dist/build/snapshot-package-store.js +7 -2
- package/dist/build/workspace-build.d.ts +92 -5
- package/dist/build/workspace-build.js +93 -19
- package/dist/build.d.ts +1 -1
- package/dist/build.js +1 -1
- package/dist/catalog-frame.js +1 -1
- package/dist/cloudflare.d.ts +13 -3
- package/dist/cloudflare.js +102 -4
- package/dist/frame-binding-wire-script.js +1 -1
- package/dist/frame-binding-wire.js +4 -2
- package/dist/git-auth.d.ts +0 -2
- package/dist/git-auth.js +0 -2
- package/dist/git.d.ts +0 -1
- package/dist/git.js +0 -2
- package/dist/host.d.ts +39 -13
- package/dist/host.js +268 -142
- package/dist/index.d.ts +25 -15
- package/dist/index.js +39 -16
- package/dist/install-release-cli.d.ts +2 -0
- package/dist/install-release-cli.js +46 -0
- package/dist/installation-client.d.ts +43 -0
- package/dist/installation-client.js +178 -0
- package/dist/installation-execution.d.ts +11 -0
- package/dist/installation-execution.js +184 -0
- package/dist/installation-operations.d.ts +1437 -0
- package/dist/installation-operations.js +664 -0
- package/dist/installation-store-generation.d.ts +3 -0
- package/dist/installation-store-generation.js +16 -0
- package/dist/instance-id.d.ts +10 -0
- package/dist/instance-id.js +10 -0
- package/dist/instance-refusal.d.ts +11 -0
- package/dist/instance-refusal.js +21 -0
- package/dist/internal/delivery.js +4 -2
- package/dist/internal/host-gate.js +7 -1
- package/dist/internal/registry-installations.js +4 -4
- package/dist/keys.d.ts +5 -1
- package/dist/keys.js +10 -2
- package/dist/machine-link/authority.d.ts +89 -0
- package/dist/machine-link/authority.js +37 -0
- package/dist/machine-link/client.d.ts +66 -0
- package/dist/machine-link/client.js +94 -0
- package/dist/machine-link/delivery.d.ts +18 -0
- package/dist/machine-link/delivery.js +55 -0
- package/dist/machine-link/enrollment.d.ts +111 -0
- package/dist/machine-link/enrollment.js +286 -0
- package/dist/machine-link/fences.d.ts +37 -0
- package/dist/machine-link/fences.js +166 -0
- package/dist/machine-link/home.d.ts +20 -0
- package/dist/machine-link/home.js +24 -0
- package/dist/machine-link/host.d.ts +43 -0
- package/dist/machine-link/host.js +189 -0
- package/dist/machine-link/index.d.ts +15 -0
- package/dist/machine-link/index.js +15 -0
- package/dist/machine-link/link.d.ts +48 -0
- package/dist/machine-link/link.js +223 -0
- package/dist/machine-link/presence.d.ts +10 -0
- package/dist/machine-link/presence.js +25 -0
- package/dist/machine-link/workers.d.ts +6 -0
- package/dist/machine-link/workers.js +6 -0
- package/dist/mcp-owner.d.ts +2 -2
- package/dist/mcp-owner.js +41 -33
- package/dist/mcp.d.ts +15 -3
- package/dist/mcp.js +146 -25
- package/dist/pack.d.ts +14 -3
- package/dist/pack.js +44 -19
- package/dist/page/app-access.d.ts +7 -0
- package/dist/page/app-access.js +75 -0
- package/dist/page/boot-host.js +57 -0
- package/dist/page/capabilities.d.ts +3 -3
- package/dist/page/capabilities.js +16 -12
- package/dist/page/computer-handles.d.ts +3 -3
- package/dist/page/computer-target.d.ts +3 -0
- package/dist/page/computer-target.js +9 -0
- package/dist/page/mount.d.ts +23 -3
- package/dist/page/mount.js +152 -16
- package/dist/page-assets.d.ts +22 -0
- package/dist/page-assets.js +28 -0
- package/dist/page-script.d.ts +3 -0
- package/dist/page-script.js +5 -4
- package/dist/release.d.ts +13 -6
- package/dist/release.js +10 -7
- package/dist/root-data.d.ts +16 -6
- package/dist/root-data.js +2 -2
- package/dist/source/index.d.ts +1 -1
- package/dist/source/team-source.d.ts +20 -8
- package/dist/source/team-source.js +39 -10
- package/dist/source/template-seed.d.ts +2 -2
- package/dist/standalone/agent-mail.d.ts +24 -0
- package/dist/standalone/agent-mail.js +62 -0
- package/dist/standalone/agent-store.d.ts +9 -0
- package/dist/standalone/agent-store.js +30 -0
- package/dist/standalone/agents.d.ts +68 -9
- package/dist/standalone/agents.js +428 -56
- package/dist/standalone/app-builds-binding.d.ts +20 -2
- package/dist/standalone/app-builds-binding.js +147 -23
- package/dist/standalone/app-set.d.ts +5 -2
- package/dist/standalone/app-set.js +174 -143
- package/dist/standalone/browser.d.ts +11 -0
- package/dist/standalone/browser.js +72 -0
- package/dist/standalone/builds.d.ts +13 -4
- package/dist/standalone/builds.js +28 -44
- package/dist/standalone/computer-egress.d.ts +2 -0
- package/dist/standalone/computer-egress.js +13 -4
- package/dist/standalone/computer-fleet.d.ts +43 -0
- package/dist/standalone/computer-fleet.js +200 -0
- package/dist/standalone/computer.d.ts +44 -9
- package/dist/standalone/computer.js +129 -22
- package/dist/standalone/install-apps-cli.js +43 -6
- package/dist/standalone/instance.d.ts +2 -2
- package/dist/standalone/instance.js +8 -11
- package/dist/standalone/machine-link.d.ts +354 -0
- package/dist/standalone/machine-link.js +368 -0
- package/dist/standalone/media.d.ts +2 -2
- package/dist/standalone/media.js +19 -16
- package/dist/standalone/preview.d.ts +2 -2
- package/dist/standalone/preview.js +37 -10
- package/dist/standalone/registry.d.ts +149 -9
- package/dist/standalone/registry.js +299 -8
- package/dist/standalone/worker.d.ts +19 -5
- package/dist/standalone/worker.js +90 -54
- package/dist/standalone/workflow-binding.d.ts +18 -22
- package/dist/standalone/workflow-binding.js +18 -18
- package/dist/standalone/workflow-control.d.ts +4 -0
- package/dist/standalone/workflow-control.js +40 -0
- package/dist/standalone/workflow-events.d.ts +2 -2
- package/dist/standalone/workflow-events.js +9 -10
- package/dist/standalone/workflow-git-capture.js +4 -3
- package/dist/standalone/workflow-host.d.ts +162 -161
- package/dist/standalone/workflow-host.js +101 -21
- package/dist/standalone/workflow-node-capture.js +11 -4
- package/dist/standalone/workflow-schedules.d.ts +5 -2
- package/dist/standalone/workflow-schedules.js +9 -10
- package/dist/standalone/workflow-trigger-host.d.ts +65 -5
- package/dist/standalone/workflow-trigger-host.js +2 -2
- package/dist/standalone/workflow-webhooks.d.ts +22 -0
- package/dist/standalone/workflow-webhooks.js +39 -0
- package/dist/standalone/workflows.d.ts +140 -43
- package/dist/standalone/workflows.js +198 -39
- package/dist/storage-frame.d.ts +6 -6
- package/dist/testing/capabilities.js +14 -3
- package/dist/testing/installation.js +26 -2
- package/dist/testing/worker.js +1 -1
- package/dist/testing/workers-runtime.d.ts +8 -2
- package/dist/testing/workers-runtime.js +20 -2
- package/dist/webhook-abuse.d.ts +25 -0
- package/dist/webhook-abuse.js +54 -0
- package/dist/webhook-custody.d.ts +144 -0
- package/dist/webhook-custody.js +222 -0
- package/dist/webhook-ingress.d.ts +36 -0
- package/dist/webhook-ingress.js +146 -0
- package/dist/webhooks.d.ts +111 -0
- package/dist/webhooks.js +189 -0
- package/dist/workers-git.d.ts +12 -17
- package/dist/workers-git.js +60 -52
- package/dist/workers.d.ts +224 -13
- package/dist/workers.js +351 -51
- package/dist/workflow-agent-authority.d.ts +8 -0
- package/dist/workflow-agent-authority.js +42 -0
- package/dist/workflows.d.ts +66 -0
- package/dist/workflows.js +97 -0
- package/docs/api/README.md +63 -37
- package/docs/api/agents.md +17 -0
- package/docs/api/app-storage.md +1 -1
- package/docs/api/apps.md +1394 -543
- package/docs/api/browser/boot.md +132 -0
- package/docs/api/browser.md +1440 -0
- package/docs/api/build-contract.md +38 -25
- package/docs/api/build.md +263 -84
- package/docs/api/cloudflare.md +93 -7
- package/docs/api/git.md +3 -13
- package/docs/api/host.md +944 -118
- package/docs/api/index.md +320 -18
- package/docs/api/keys.md +24 -1
- package/docs/api/mcp.md +59 -12
- package/docs/api/modules.md +33 -40
- package/docs/api/pack.md +57 -8
- package/docs/api/page/mount.md +92 -4
- package/docs/api/workers-git.md +103 -24
- package/docs/api/workers.md +1581 -244
- package/docs/site/agent-quickstart.mdx +28 -14
- package/examples/standalone/worker.ts +3 -1
- package/examples/standalone/wrangler.jsonc +2 -0
- package/package.json +73 -71
- package/dist/installation-consent.d.ts +0 -81
- package/dist/installation-consent.js +0 -84
- package/dist/shell/app-directory.d.ts +0 -542
- package/dist/shell/app-directory.js +0 -196
- package/dist/shell/browser-actions.d.ts +0 -7
- package/dist/shell/browser-actions.js +0 -56
- package/dist/shell/command-host.d.ts +0 -112
- package/dist/shell/command-host.js +0 -502
- package/dist/shell/commands.d.ts +0 -25
- package/dist/shell/commands.js +0 -78
- package/dist/shell/index.d.ts +0 -8
- package/dist/shell/index.js +0 -8
- package/dist/shell/keys.d.ts +0 -41
- package/dist/shell/keys.js +0 -134
- package/dist/shell/shell-module.d.ts +0 -55
- package/dist/shell/shell-module.js +0 -86
- package/dist/shell/window-manager.d.ts +0 -128
- package/dist/shell/window-manager.js +0 -730
- package/dist/shell/workbench-contract.d.ts +0 -68
- package/dist/shell/workbench-directory.d.ts +0 -332
- package/dist/shell/workbench-directory.js +0 -35
- package/dist/shell/workbench-host-types.d.ts +0 -96
- package/dist/shell/workbench-host-types.js +0 -1
- package/dist/shell/workbench-host.d.ts +0 -34
- package/dist/shell/workbench-host.js +0 -352
- package/dist/shell/workbench-model.d.ts +0 -194
- package/dist/shell/workbench-model.js +0 -53
- package/dist/shell/workbench.d.ts +0 -4
- package/dist/shell/workbench.js +0 -2
- package/docs/api/shell/app-directory.md +0 -599
- package/docs/api/shell/command-host.md +0 -224
- package/docs/api/shell/commands.md +0 -197
- package/docs/api/shell/keys.md +0 -183
- package/docs/api/shell/shell-module.md +0 -204
- package/docs/api/shell/window-manager.md +0 -267
- package/docs/api/shell/workbench-directory.md +0 -119
- package/docs/api/shell/workbench.md +0 -205
- package/docs/api/shell.md +0 -1915
- /package/dist/{shell/workbench-contract.js → page/boot-host.d.ts} +0 -0
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
import * as Schema from "effect/Schema";
|
|
2
|
-
import { AppError, parseAppStatusAction } from "@fungi.computer/agar";
|
|
3
|
-
import { parseJsonValue } from "@fungi.computer/whistle/wire";
|
|
4
|
-
import { desktopSettingsHandlerSchema, } from "./workbench-model.js";
|
|
5
|
-
import { createAppSurfaceCommandHost, } from "./command-host.js";
|
|
6
|
-
/** A dashboard may keep this many child Apps mounted at once. */
|
|
7
|
-
const maxChildren = 32;
|
|
8
|
-
const nonBlank = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(2_048)));
|
|
9
|
-
const visibilitySchema = Schema.Literals(["hidden", "visible"]);
|
|
10
|
-
// A dashboard presents a child's commands to people; it never acts as the
|
|
11
|
-
// child's Agent.
|
|
12
|
-
const commandInvocationSchema = Schema.Struct({
|
|
13
|
-
commandId: nonBlank,
|
|
14
|
-
origin: Schema.Literals([
|
|
15
|
-
"keyboard",
|
|
16
|
-
"palette",
|
|
17
|
-
"menu",
|
|
18
|
-
"browser",
|
|
19
|
-
"programmatic",
|
|
20
|
-
"slash",
|
|
21
|
-
"terminal",
|
|
22
|
-
]),
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Forward a child's Release-validated commands and reserved chords to the
|
|
26
|
-
* dashboard that presents them. Validation stays here, against the child's
|
|
27
|
-
* own Release declaration, so the dashboard can never widen them.
|
|
28
|
-
*/
|
|
29
|
-
function forwardCommands(log, validated, events, current) {
|
|
30
|
-
const present = (commands) => events.onCommands?.(commands) ?? Promise.resolve();
|
|
31
|
-
const handlers = {
|
|
32
|
-
registerCommands: async (input) => {
|
|
33
|
-
const contribution = await validated.handlers.registerCommands(input);
|
|
34
|
-
current.invoke = input.invoke;
|
|
35
|
-
await present(input.commands);
|
|
36
|
-
return {
|
|
37
|
-
update: (commands) => {
|
|
38
|
-
contribution.update(commands);
|
|
39
|
-
void present(commands).catch((cause) => {
|
|
40
|
-
log("team_workbench_commands_failed", {
|
|
41
|
-
stage: "update",
|
|
42
|
-
cause,
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
},
|
|
46
|
-
dispose: () => {
|
|
47
|
-
contribution.dispose();
|
|
48
|
-
if (current.invoke === input.invoke)
|
|
49
|
-
current.invoke = undefined;
|
|
50
|
-
void present([]).catch((cause) => {
|
|
51
|
-
log("team_workbench_commands_failed", {
|
|
52
|
-
stage: "dispose",
|
|
53
|
-
cause,
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
invokeReservedChord: async (input) => {
|
|
60
|
-
if (events.onReservedChord === undefined)
|
|
61
|
-
throw new Error("App reserved chord is unavailable");
|
|
62
|
-
await events.onReservedChord(input);
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
return Object.freeze({
|
|
66
|
-
handlers: Object.freeze(handlers),
|
|
67
|
-
dispose: validated.dispose,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* One mounted child App, proxying to its real host-owned mount. The shell
|
|
72
|
-
* holds this bounded handle; the host's lease machinery stays behind it.
|
|
73
|
-
*/
|
|
74
|
-
class MountedChildHandle {
|
|
75
|
-
surface;
|
|
76
|
-
commands;
|
|
77
|
-
reconfigureCurrent;
|
|
78
|
-
release;
|
|
79
|
-
#disposed = false;
|
|
80
|
-
constructor(surface, commands, reconfigureCurrent, release) {
|
|
81
|
-
this.surface = surface;
|
|
82
|
-
this.commands = commands;
|
|
83
|
-
this.reconfigureCurrent = reconfigureCurrent;
|
|
84
|
-
this.release = release;
|
|
85
|
-
}
|
|
86
|
-
async setVisibility(visibility) {
|
|
87
|
-
if (this.#disposed)
|
|
88
|
-
return;
|
|
89
|
-
await this.surface.setVisibility(Schema.decodeUnknownSync(visibilitySchema)(visibility));
|
|
90
|
-
}
|
|
91
|
-
async reconfigure(launch) {
|
|
92
|
-
if (this.#disposed)
|
|
93
|
-
return;
|
|
94
|
-
await this.reconfigureCurrent(launch);
|
|
95
|
-
}
|
|
96
|
-
async requestClose() {
|
|
97
|
-
if (this.#disposed)
|
|
98
|
-
return true;
|
|
99
|
-
return this.surface.requestClose();
|
|
100
|
-
}
|
|
101
|
-
async requestBack() {
|
|
102
|
-
if (this.#disposed)
|
|
103
|
-
return false;
|
|
104
|
-
return this.surface.requestBack();
|
|
105
|
-
}
|
|
106
|
-
async activateStatus(action) {
|
|
107
|
-
if (this.#disposed)
|
|
108
|
-
return false;
|
|
109
|
-
// The shell relays the person's click; parse it at the host's edge.
|
|
110
|
-
return this.surface.activateStatus(parseAppStatusAction(action));
|
|
111
|
-
}
|
|
112
|
-
async activateNavigation(activation) {
|
|
113
|
-
if (this.#disposed)
|
|
114
|
-
return false;
|
|
115
|
-
return this.surface.activateNavigation(activation);
|
|
116
|
-
}
|
|
117
|
-
async invokeCommand(commandId, input) {
|
|
118
|
-
const invoke = this.commands.invoke;
|
|
119
|
-
if (this.#disposed || invoke === undefined)
|
|
120
|
-
throw new AppError("That App command is unavailable", {
|
|
121
|
-
code: "CAPABILITY_DENIED",
|
|
122
|
-
retryable: false,
|
|
123
|
-
});
|
|
124
|
-
const parsed = Schema.decodeUnknownSync(commandInvocationSchema)({
|
|
125
|
-
commandId,
|
|
126
|
-
origin: input.origin,
|
|
127
|
-
});
|
|
128
|
-
return invoke(parsed.commandId, input.arguments === undefined
|
|
129
|
-
? { origin: parsed.origin }
|
|
130
|
-
: { arguments: parseJsonValue(input.arguments), origin: parsed.origin });
|
|
131
|
-
}
|
|
132
|
-
async dispose() {
|
|
133
|
-
if (this.#disposed)
|
|
134
|
-
return;
|
|
135
|
-
this.#disposed = true;
|
|
136
|
-
await this.release();
|
|
137
|
-
}
|
|
138
|
-
[Symbol.dispose]() {
|
|
139
|
-
void this.dispose();
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
class DesktopSettingsRegistration {
|
|
143
|
-
detach;
|
|
144
|
-
constructor(detach) {
|
|
145
|
-
this.detach = detach;
|
|
146
|
-
}
|
|
147
|
-
close() {
|
|
148
|
-
this.detach();
|
|
149
|
-
return Promise.resolve();
|
|
150
|
-
}
|
|
151
|
-
[Symbol.dispose]() {
|
|
152
|
-
this.detach();
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Child-window, command and callback lifetime for the trusted shell the host
|
|
157
|
-
* composes into its own document. Each child mounts inside the window slot
|
|
158
|
-
* the shell hands it, so the browser moves, clips and stacks it with that
|
|
159
|
-
* window; the host never positions a child itself.
|
|
160
|
-
*/
|
|
161
|
-
export class WorkbenchHost {
|
|
162
|
-
#hostWindow;
|
|
163
|
-
#options;
|
|
164
|
-
#commands = createAppSurfaceCommandHost();
|
|
165
|
-
#children = new Set();
|
|
166
|
-
#releases = [];
|
|
167
|
-
#desktopSettingsClose;
|
|
168
|
-
#settingsClose;
|
|
169
|
-
#finishSettings;
|
|
170
|
-
constructor(options) {
|
|
171
|
-
this.#hostWindow = options.hostWindow;
|
|
172
|
-
this.#options = options;
|
|
173
|
-
}
|
|
174
|
-
team() {
|
|
175
|
-
return this.#options.services.team();
|
|
176
|
-
}
|
|
177
|
-
computers(input) {
|
|
178
|
-
return this.#options.services.computers(input);
|
|
179
|
-
}
|
|
180
|
-
directory() {
|
|
181
|
-
return this.#options.services.directory();
|
|
182
|
-
}
|
|
183
|
-
requestGill(input) {
|
|
184
|
-
return this.#options.services.requestGill(input);
|
|
185
|
-
}
|
|
186
|
-
watchGillChanges(...input) {
|
|
187
|
-
return this.#options.services.watchGillChanges(...input);
|
|
188
|
-
}
|
|
189
|
-
async platformDestinations() {
|
|
190
|
-
return (await this.#options.platform.destinations()).map(({ id, label }) => ({ id, label }));
|
|
191
|
-
}
|
|
192
|
-
async openPlatformDestination(id) {
|
|
193
|
-
const parsed = Schema.decodeUnknownSync(nonBlank)(id);
|
|
194
|
-
const offered = await this.#options.platform.destinations();
|
|
195
|
-
if (!offered.some((destination) => destination.id === parsed))
|
|
196
|
-
throw new AppError("That destination is unavailable", {
|
|
197
|
-
code: "INVALID_ARGUMENT",
|
|
198
|
-
retryable: false,
|
|
199
|
-
});
|
|
200
|
-
this.#options.platform.open(parsed);
|
|
201
|
-
}
|
|
202
|
-
/** Describe the actual controls without offering unsupported Settings. */
|
|
203
|
-
settingsSections() {
|
|
204
|
-
const controls = this.#options.platform.controls;
|
|
205
|
-
return Promise.resolve(controls.sections?.slice() ?? null);
|
|
206
|
-
}
|
|
207
|
-
takeAppOpenRequest() {
|
|
208
|
-
return Promise.resolve(this.#options.platform.takeAppOpenRequest());
|
|
209
|
-
}
|
|
210
|
-
registerDesktopSettings(handler) {
|
|
211
|
-
return Promise.resolve().then(() => {
|
|
212
|
-
let parsed;
|
|
213
|
-
try {
|
|
214
|
-
parsed = desktopSettingsHandlerSchema.parse(handler);
|
|
215
|
-
}
|
|
216
|
-
catch (cause) {
|
|
217
|
-
throw new AppError("Desktop settings registration is invalid", {
|
|
218
|
-
code: "INVALID_ARGUMENT",
|
|
219
|
-
retryable: false,
|
|
220
|
-
cause,
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
this.#desktopSettingsClose?.();
|
|
224
|
-
const detach = this.#options.platform.controls.attachDesktopSettings(parsed);
|
|
225
|
-
let closed = false;
|
|
226
|
-
const close = () => {
|
|
227
|
-
if (closed)
|
|
228
|
-
return;
|
|
229
|
-
closed = true;
|
|
230
|
-
detach();
|
|
231
|
-
if (this.#desktopSettingsClose === close)
|
|
232
|
-
this.#desktopSettingsClose = undefined;
|
|
233
|
-
};
|
|
234
|
-
this.#desktopSettingsClose = close;
|
|
235
|
-
return new DesktopSettingsRegistration(close);
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
async openSettings(location) {
|
|
239
|
-
const parsed = this.#options.platform.controls.parseSettings(location);
|
|
240
|
-
const controls = this.#options.platform.controls;
|
|
241
|
-
if (this.#settingsClose !== undefined) {
|
|
242
|
-
const closed = this.#settingsClose;
|
|
243
|
-
controls.openSettings(parsed, { restoreFocus: false });
|
|
244
|
-
return closed;
|
|
245
|
-
}
|
|
246
|
-
const closed = new Promise((resolve) => {
|
|
247
|
-
const unsubscribe = controls.subscribeSettingsClosed(() => this.#finishSettings?.());
|
|
248
|
-
this.#finishSettings = () => {
|
|
249
|
-
unsubscribe();
|
|
250
|
-
this.#settingsClose = undefined;
|
|
251
|
-
this.#finishSettings = undefined;
|
|
252
|
-
resolve();
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
this.#settingsClose = closed;
|
|
256
|
-
// The shell restores its own invoker once Settings close; returning
|
|
257
|
-
// focus here would race that restoration.
|
|
258
|
-
controls.openSettings(parsed, { restoreFocus: false });
|
|
259
|
-
return closed;
|
|
260
|
-
}
|
|
261
|
-
memberAvatar() {
|
|
262
|
-
return this.#options.services.memberAvatar();
|
|
263
|
-
}
|
|
264
|
-
watchSettingsChanges(onChanged) {
|
|
265
|
-
const unsubscribe = this.#options.platform.controls.subscribeChanges(() => {
|
|
266
|
-
void onChanged().catch((cause) => {
|
|
267
|
-
this.#options.log("team_workbench_settings_notification_failed", {
|
|
268
|
-
cause,
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
this.#releases.push(unsubscribe);
|
|
273
|
-
return Promise.resolve();
|
|
274
|
-
}
|
|
275
|
-
/** The shell unmounted: stop notifying its callbacks. */
|
|
276
|
-
[Symbol.dispose]() {
|
|
277
|
-
this.#finishSettings?.();
|
|
278
|
-
this.#desktopSettingsClose?.();
|
|
279
|
-
this.#options.services.dispose();
|
|
280
|
-
for (const release of this.#releases.splice(0))
|
|
281
|
-
release();
|
|
282
|
-
}
|
|
283
|
-
async mount(container, input, events) {
|
|
284
|
-
const request = this.#options.resolveLaunch(input);
|
|
285
|
-
const mountId = request.launch.windowId;
|
|
286
|
-
if (this.#children.has(mountId))
|
|
287
|
-
throw new AppError("That App window is already open", {
|
|
288
|
-
code: "INVALID_ARGUMENT",
|
|
289
|
-
retryable: false,
|
|
290
|
-
});
|
|
291
|
-
if (this.#children.size >= maxChildren)
|
|
292
|
-
throw new AppError("Too many Apps are open", {
|
|
293
|
-
code: "INVALID_ARGUMENT",
|
|
294
|
-
retryable: false,
|
|
295
|
-
});
|
|
296
|
-
this.#children.add(mountId);
|
|
297
|
-
let prepared;
|
|
298
|
-
let commandMount;
|
|
299
|
-
const childCommands = { invoke: undefined };
|
|
300
|
-
const release = async () => {
|
|
301
|
-
try {
|
|
302
|
-
commandMount?.dispose();
|
|
303
|
-
if (prepared)
|
|
304
|
-
await prepared.dispose();
|
|
305
|
-
}
|
|
306
|
-
finally {
|
|
307
|
-
this.#children.delete(mountId);
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
try {
|
|
311
|
-
prepared = await this.#options.prepareChild(request.launch);
|
|
312
|
-
commandMount = forwardCommands(this.#options.log, this.#commands.mount(mountId, prepared.commands), events, childCommands);
|
|
313
|
-
const surface = await prepared.mount({
|
|
314
|
-
container,
|
|
315
|
-
hostWindow: this.#hostWindow,
|
|
316
|
-
...(request.title === undefined ? undefined : { title: request.title }),
|
|
317
|
-
commands: commandMount,
|
|
318
|
-
events,
|
|
319
|
-
onDesktopSettings: (surfaceId) => this.#options.services.suggestDesktopSettings(surfaceId),
|
|
320
|
-
onPermissionRequest: (permission) => this.#options.platform.controls.requestAppAccess({
|
|
321
|
-
surfaceId: request.launch.surfaceId,
|
|
322
|
-
title: request.title ?? request.launch.appId,
|
|
323
|
-
}, permission),
|
|
324
|
-
});
|
|
325
|
-
const reconfigureCurrent = async (next) => {
|
|
326
|
-
const nextRequest = this.#options.resolveLaunch(next);
|
|
327
|
-
if (nextRequest.launch.appId !== request.launch.appId ||
|
|
328
|
-
nextRequest.launch.releaseId !== request.launch.releaseId ||
|
|
329
|
-
nextRequest.launch.surfaceId !== request.launch.surfaceId)
|
|
330
|
-
throw new Error("App identity cannot change during reconfiguration");
|
|
331
|
-
await surface.reconfigure(nextRequest.launch);
|
|
332
|
-
};
|
|
333
|
-
return new MountedChildHandle(surface, childCommands, reconfigureCurrent, async () => {
|
|
334
|
-
try {
|
|
335
|
-
surface.dispose();
|
|
336
|
-
}
|
|
337
|
-
finally {
|
|
338
|
-
await release();
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
catch (error) {
|
|
343
|
-
await release();
|
|
344
|
-
throw error;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
reportAgentSessionSelection(windowId, selection) {
|
|
348
|
-
const parsed = Schema.decodeUnknownSync(nonBlank)(windowId);
|
|
349
|
-
this.#options.reportAgentSessionSelection(parsed, selection);
|
|
350
|
-
return Promise.resolve();
|
|
351
|
-
}
|
|
352
|
-
}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import * as Schema from "effect/Schema";
|
|
3
|
-
import type { AppCommand, AppOpenRequest, FileNavigationInput, AppNavigationActivation, AppNavigationState, AppStatusAction, AppStatusItem } from "@fungi.computer/agar";
|
|
4
|
-
import type { AppOpenInput, AppRoleChoice } from "@fungi.computer/agar/apps";
|
|
5
|
-
import type { WhistleExecutionOrigin, WhistleJsonValue } from "@fungi.computer/whistle";
|
|
6
|
-
/** A request to resolve and mount one child App, by its own identity. */
|
|
7
|
-
export type WorkbenchChildLaunch = Readonly<{
|
|
8
|
-
windowId: string;
|
|
9
|
-
appId: string;
|
|
10
|
-
releaseId: string;
|
|
11
|
-
surfaceId: string;
|
|
12
|
-
href: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
openRequest: AppOpenRequest | null;
|
|
15
|
-
}>;
|
|
16
|
-
/** One invocation of a mounted child's own Release-declared command. */
|
|
17
|
-
export type WorkbenchCommandInvocation = Readonly<{
|
|
18
|
-
arguments?: WhistleJsonValue;
|
|
19
|
-
origin: WhistleExecutionOrigin;
|
|
20
|
-
}>;
|
|
21
|
-
/**
|
|
22
|
-
* Events a mounted child raises toward its dashboard. A child's permission
|
|
23
|
-
* requests never reach the dashboard: the host asks the person itself. The
|
|
24
|
-
* host validates a
|
|
25
|
-
* child's commands against that child's own Release declaration before
|
|
26
|
-
* forwarding them, so the dashboard can present them but never widen them.
|
|
27
|
-
*/
|
|
28
|
-
export type WorkbenchChildEvents = Readonly<{
|
|
29
|
-
/** Ask this window's shell to open its existing Computer picker. */
|
|
30
|
-
onComputerChoice?: () => Promise<void>;
|
|
31
|
-
/** Ask the embedding host to follow a file navigation request. */
|
|
32
|
-
onNavigation?: (input: FileNavigationInput) => Promise<void>;
|
|
33
|
-
/** Ask the embedding host to open an App through its own admission policy. */
|
|
34
|
-
onAppOpen?: (input: AppOpenInput) => Promise<void>;
|
|
35
|
-
/** Ask the embedding host which App its role routing would open for a role. */
|
|
36
|
-
onAppRole?: (role: string) => Promise<AppRoleChoice>;
|
|
37
|
-
/** Report a changed child selection; the host returns whether it handled it. */
|
|
38
|
-
onSelectionChanged?: () => Promise<boolean>;
|
|
39
|
-
/**
|
|
40
|
-
* Replace the child's presented command set; an empty list clears it. Run
|
|
41
|
-
* one through the child's handle with `invokeCommand`.
|
|
42
|
-
*/
|
|
43
|
-
onCommands?: (commands: readonly AppCommand[]) => Promise<void>;
|
|
44
|
-
/** A reserved shell chord (the command palette) pressed inside the child. */
|
|
45
|
-
onReservedChord?: (input: Readonly<{
|
|
46
|
-
id: string;
|
|
47
|
-
repeat: boolean;
|
|
48
|
-
}>) => Promise<void>;
|
|
49
|
-
/** The child gained (`true`) or lost (`false`) input focus. */
|
|
50
|
-
onFocus?: (focused: boolean) => Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* The child's latest parsed navigation state; `null` once it disconnects.
|
|
53
|
-
* The dashboard shows a Back affordance from it.
|
|
54
|
-
*/
|
|
55
|
-
onNavigationState?: (state: AppNavigationState | null) => Promise<void>;
|
|
56
|
-
/** The child's latest status readouts; an empty list once it disconnects. */
|
|
57
|
-
onStatusItems?: (items: readonly AppStatusItem[]) => Promise<void>;
|
|
58
|
-
}>;
|
|
59
|
-
/** One mounted child App; every method proxies to its real host-owned mount. */
|
|
60
|
-
export type WorkbenchChildHandle = {
|
|
61
|
-
/** Show or hide the mounted child without changing its identity. */
|
|
62
|
-
setVisibility(visibility: "hidden" | "visible"): Promise<void>;
|
|
63
|
-
/** Update the launch descriptor of the existing mount. */
|
|
64
|
-
reconfigure(launch: WorkbenchChildLaunch): Promise<void>;
|
|
65
|
-
/** Ask whether the child permits a user-initiated close. */
|
|
66
|
-
requestClose(): Promise<boolean>;
|
|
67
|
-
/** Ask the child to go back one step in its own history; `true` when it did. */
|
|
68
|
-
requestBack(): Promise<boolean>;
|
|
69
|
-
/** Deliver the person's use of a child's status item; `true` when it acted. */
|
|
70
|
-
activateStatus(action: AppStatusAction): Promise<boolean>;
|
|
71
|
-
/** Deliver the person's use of a child's crumb or header command; `true` when it acted. */
|
|
72
|
-
activateNavigation(activation: AppNavigationActivation): Promise<boolean>;
|
|
73
|
-
/** Run one of the child's currently presented commands. */
|
|
74
|
-
invokeCommand(commandId: string, input: WorkbenchCommandInvocation): Promise<WhistleJsonValue | undefined>;
|
|
75
|
-
/** Release the child mount and its resources. */
|
|
76
|
-
dispose(): Promise<void>;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* A platform destination the host offers the dashboard, such as opening
|
|
80
|
-
* a host settings page. The host owns the labels and the navigation;
|
|
81
|
-
* the dashboard only presents them and asks the host to follow one.
|
|
82
|
-
*/
|
|
83
|
-
export type WorkbenchPlatformDestination = Readonly<{
|
|
84
|
-
id: string;
|
|
85
|
-
label: string;
|
|
86
|
-
}>;
|
|
87
|
-
/** A declared Gill request addressed to one host-selected App surface. */
|
|
88
|
-
export declare const workbenchGillRequestSchema: Schema.Struct<{
|
|
89
|
-
readonly viewId: Schema.String;
|
|
90
|
-
readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
91
|
-
readonly after: Schema.optional<Schema.String>;
|
|
92
|
-
readonly options: Schema.optional<Schema.String>;
|
|
93
|
-
readonly surfaceId: Schema.String;
|
|
94
|
-
}>;
|
|
95
|
-
/** Decoded Gill request for a surface in the host directory. */
|
|
96
|
-
export type WorkbenchGillRequest = typeof workbenchGillRequestSchema.Type;
|
|
97
|
-
/** The member chooses a declared Gill and size in host-rendered Settings. */
|
|
98
|
-
export declare const desktopGillSelectionSchema: z.ZodObject<{
|
|
99
|
-
surfaceId: z.ZodString;
|
|
100
|
-
gillId: z.ZodString;
|
|
101
|
-
}, z.core.$strict>;
|
|
102
|
-
/** The identity of a Gill selected in a host-rendered settings view. */
|
|
103
|
-
export type DesktopGillSelection = z.output<typeof desktopGillSelectionSchema>;
|
|
104
|
-
/** The dashboard layout sizes currently assigned to one Gill. */
|
|
105
|
-
export declare const desktopGillSizesSchema: z.ZodArray<z.ZodEnum<{
|
|
106
|
-
S: "S";
|
|
107
|
-
M: "M";
|
|
108
|
-
L: "L";
|
|
109
|
-
}>>;
|
|
110
|
-
/** A selected Gill and the layout size requested for a new placement. */
|
|
111
|
-
export declare const desktopGillAdditionSchema: z.ZodObject<{
|
|
112
|
-
surfaceId: z.ZodString;
|
|
113
|
-
gillId: z.ZodString;
|
|
114
|
-
size: z.ZodEnum<{
|
|
115
|
-
S: "S";
|
|
116
|
-
M: "M";
|
|
117
|
-
L: "L";
|
|
118
|
-
}>;
|
|
119
|
-
}, z.core.$strict>;
|
|
120
|
-
/** A decoded request to add a Gill placement. */
|
|
121
|
-
export type DesktopGillAddition = z.output<typeof desktopGillAdditionSchema>;
|
|
122
|
-
/** A dashboard supplies its own arranger, not an endpoint for ordinary Apps. */
|
|
123
|
-
export type WorkbenchDesktopSettings = {
|
|
124
|
-
/** Read the sizes currently assigned to this Gill in the dashboard layout. */
|
|
125
|
-
readGill: (input: DesktopGillSelection) => Promise<z.output<typeof desktopGillSizesSchema>>;
|
|
126
|
-
/** Add a Gill at the requested size to the dashboard layout. */
|
|
127
|
-
addGill: (input: DesktopGillAddition) => Promise<void>;
|
|
128
|
-
/** Remove this Gill from the dashboard layout. */
|
|
129
|
-
removeGill: (input: DesktopGillSelection) => Promise<void>;
|
|
130
|
-
};
|
|
131
|
-
/** Shape of the arranger callbacks the shell supplies to its host. */
|
|
132
|
-
export declare const desktopSettingsHandlerSchema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
|
|
133
|
-
readGill: z.core.$InferOuterFunctionType<z.core.$ZodTuple<readonly [z.ZodObject<{
|
|
134
|
-
surfaceId: z.ZodString;
|
|
135
|
-
gillId: z.ZodString;
|
|
136
|
-
}, z.core.$strict>], z.core.$ZodFunctionOut>, z.ZodPromise<z.ZodPipe<z.ZodUnknown, z.ZodTransform<("S" | "M" | "L")[], unknown>>>>;
|
|
137
|
-
addGill: z.core.$InferOuterFunctionType<z.core.$ZodTuple<readonly [z.ZodObject<{
|
|
138
|
-
surfaceId: z.ZodString;
|
|
139
|
-
gillId: z.ZodString;
|
|
140
|
-
size: z.ZodEnum<{
|
|
141
|
-
S: "S";
|
|
142
|
-
M: "M";
|
|
143
|
-
L: "L";
|
|
144
|
-
}>;
|
|
145
|
-
}, z.core.$strict>], z.core.$ZodFunctionOut>, z.ZodPromise<z.ZodPipe<z.ZodUnknown, z.ZodTransform<void, unknown>>>>;
|
|
146
|
-
removeGill: z.core.$InferOuterFunctionType<z.core.$ZodTuple<readonly [z.ZodObject<{
|
|
147
|
-
surfaceId: z.ZodString;
|
|
148
|
-
gillId: z.ZodString;
|
|
149
|
-
}, z.core.$strict>], z.core.$ZodFunctionOut>, z.ZodPromise<z.ZodPipe<z.ZodUnknown, z.ZodTransform<void, unknown>>>>;
|
|
150
|
-
} & {
|
|
151
|
-
[Symbol.dispose](): void;
|
|
152
|
-
}, unknown>>;
|
|
153
|
-
/** A registration lease; close it when the dashboard unmounts. */
|
|
154
|
-
export type WorkbenchDesktopRegistration = {
|
|
155
|
-
/** Release this host registration. */
|
|
156
|
-
close(): Promise<void>;
|
|
157
|
-
};
|
|
158
|
-
/** A host-owned change subscription; close it when no longer visible. */
|
|
159
|
-
export type WorkbenchGillWatch = {
|
|
160
|
-
/** Release this host registration. */
|
|
161
|
-
close(): Promise<void>;
|
|
162
|
-
};
|
|
163
|
-
/** Runtime check for an App-open handoff arriving across an untrusted boundary. */
|
|
164
|
-
export declare const appOpenRequestSchema: Schema.Union<readonly [Schema.Struct<{
|
|
165
|
-
readonly kind: Schema.Literal<"compose">;
|
|
166
|
-
readonly requestId: Schema.String;
|
|
167
|
-
readonly text: Schema.String;
|
|
168
|
-
}>, Schema.Struct<{
|
|
169
|
-
readonly kind: Schema.Literal<"navigate">;
|
|
170
|
-
readonly requestId: Schema.String;
|
|
171
|
-
readonly params: Schema.$Array<Schema.Struct<{
|
|
172
|
-
readonly key: Schema.String;
|
|
173
|
-
readonly value: Schema.String;
|
|
174
|
-
}>>;
|
|
175
|
-
}>]>;
|
|
176
|
-
/** One Team Computer in a host's inventory: the wire of `computers()`. */
|
|
177
|
-
export declare const teamComputerSchema: z.ZodObject<{
|
|
178
|
-
computerId: z.ZodString;
|
|
179
|
-
name: z.ZodString;
|
|
180
|
-
createdAt: z.ZodNumber;
|
|
181
|
-
updatedAt: z.ZodNumber;
|
|
182
|
-
}, z.core.$strict>;
|
|
183
|
-
/** A decoded Team Computer inventory record. */
|
|
184
|
-
export type TeamComputer = z.output<typeof teamComputerSchema>;
|
|
185
|
-
/** One page of a host's Team Computer inventory. */
|
|
186
|
-
export declare const teamComputerDirectorySchema: z.ZodObject<{
|
|
187
|
-
computers: z.ZodArray<z.ZodObject<{
|
|
188
|
-
computerId: z.ZodString;
|
|
189
|
-
name: z.ZodString;
|
|
190
|
-
createdAt: z.ZodNumber;
|
|
191
|
-
updatedAt: z.ZodNumber;
|
|
192
|
-
}, z.core.$strict>>;
|
|
193
|
-
nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
194
|
-
}, z.core.$strict>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { rpcDataSchema, rpcHandleSchema, rpcMethod, rpcVoid, } from "@fungi.computer/agar/rpc";
|
|
2
|
-
import * as z from "zod";
|
|
3
|
-
import * as Schema from "effect/Schema";
|
|
4
|
-
import { gillRequestSchema } from "@fungi.computer/gills";
|
|
5
|
-
/** A declared Gill request addressed to one host-selected App surface. */
|
|
6
|
-
export const workbenchGillRequestSchema = Schema.Struct({
|
|
7
|
-
surfaceId: Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(513)),
|
|
8
|
-
...gillRequestSchema.fields,
|
|
9
|
-
});
|
|
10
|
-
/** The member chooses a declared Gill and size in host-rendered Settings. */
|
|
11
|
-
export const desktopGillSelectionSchema = z.strictObject({
|
|
12
|
-
surfaceId: z.string().min(1).max(256),
|
|
13
|
-
gillId: z.string().min(1).max(80),
|
|
14
|
-
});
|
|
15
|
-
/** The dashboard layout sizes currently assigned to one Gill. */
|
|
16
|
-
export const desktopGillSizesSchema = z.array(z.enum(["S", "M", "L"])).max(24);
|
|
17
|
-
/** A selected Gill and the layout size requested for a new placement. */
|
|
18
|
-
export const desktopGillAdditionSchema = desktopGillSelectionSchema.extend({
|
|
19
|
-
size: z.enum(["S", "M", "L"]),
|
|
20
|
-
});
|
|
21
|
-
/** Shape of the arranger callbacks the shell supplies to its host. */
|
|
22
|
-
export const desktopSettingsHandlerSchema = rpcHandleSchema({
|
|
23
|
-
readGill: rpcMethod(rpcDataSchema(desktopGillSizesSchema)).input([
|
|
24
|
-
desktopGillSelectionSchema,
|
|
25
|
-
]),
|
|
26
|
-
addGill: rpcVoid.input([desktopGillAdditionSchema]),
|
|
27
|
-
removeGill: rpcVoid.input([desktopGillSelectionSchema]),
|
|
28
|
-
});
|
|
29
|
-
/** Runtime check for an App-open handoff arriving across an untrusted boundary. */
|
|
30
|
-
export const appOpenRequestSchema = Schema.Union([
|
|
31
|
-
Schema.Struct({
|
|
32
|
-
kind: Schema.Literal("compose"),
|
|
33
|
-
requestId: Schema.String,
|
|
34
|
-
text: Schema.String,
|
|
35
|
-
}),
|
|
36
|
-
Schema.Struct({
|
|
37
|
-
kind: Schema.Literal("navigate"),
|
|
38
|
-
requestId: Schema.String,
|
|
39
|
-
params: Schema.Array(Schema.Struct({ key: Schema.String, value: Schema.String })),
|
|
40
|
-
}),
|
|
41
|
-
]);
|
|
42
|
-
/** One Team Computer in a host's inventory: the wire of `computers()`. */
|
|
43
|
-
export const teamComputerSchema = z.strictObject({
|
|
44
|
-
computerId: z.string().min(1),
|
|
45
|
-
name: z.string().min(1).max(256),
|
|
46
|
-
createdAt: z.number().int().nonnegative(),
|
|
47
|
-
updatedAt: z.number().int().nonnegative(),
|
|
48
|
-
});
|
|
49
|
-
/** One page of a host's Team Computer inventory. */
|
|
50
|
-
export const teamComputerDirectorySchema = z.strictObject({
|
|
51
|
-
computers: z.array(teamComputerSchema),
|
|
52
|
-
nextOffset: z.number().int().nonnegative().nullable(),
|
|
53
|
-
});
|
package/dist/shell/workbench.js
DELETED