@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.
- package/README.md +376 -72
- package/dist/agent-avatars.d.ts +103 -0
- package/dist/agent-avatars.js +66 -0
- package/dist/agents.d.ts +15 -4
- package/dist/agents.js +43 -4
- 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 +26 -12
- package/dist/apps/gate.js +48 -22
- package/dist/apps/index.d.ts +3 -1
- package/dist/apps/index.js +3 -1
- package/dist/apps/installation.d.ts +147 -66
- package/dist/apps/installation.js +193 -86
- 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 +8428 -337
- 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-egress.js +4 -4
- 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 +106 -8
- package/dist/frame-binding-wire-script.js +1 -1
- package/dist/frame-binding-wire.d.ts +1 -1
- package/dist/frame-binding-wire.js +5 -3
- package/dist/git-auth.d.ts +0 -2
- package/dist/git-auth.js +0 -2
- package/dist/git-journal.js +4 -4
- 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 +26 -15
- package/dist/index.js +40 -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 -7
- 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 +78 -12
- package/dist/standalone/agents.js +470 -59
- package/dist/standalone/app-builds-binding.d.ts +20 -2
- package/dist/standalone/app-builds-binding.js +151 -27
- 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 +132 -25
- 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 +39 -12
- 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 +28 -32
- package/dist/standalone/workflow-binding.js +20 -20
- 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 +177 -152
- package/dist/standalone/workflow-host.js +137 -30
- 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 +88 -6
- 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 +203 -50
- 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 -55
- 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 -69
- package/dist/installation-consent.d.ts +0 -79
- package/dist/installation-consent.js +0 -82
- package/dist/shell/app-directory.d.ts +0 -542
- package/dist/shell/app-directory.js +0 -199
- 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 -124
- package/dist/shell/window-manager.js +0 -711
- 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 -347
- package/dist/shell/workbench-model.d.ts +0 -192
- 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type ModuleRegistration } from "@fungi.computer/mycelium";
|
|
3
|
+
import { cancelReplySchema, statusReply } from "@fungi.computer/workflows-wire";
|
|
4
|
+
import type { ReleaseId } from "@fungi.computer/puffball";
|
|
5
|
+
import { appComputerAdmissionRefusalSchema } from "@fungi.computer/agar/computer-contracts";
|
|
6
|
+
export { createWorkflowWebhooks, workflowWebhookCommandSchema, workflowWebhookControlResponse, } from "./webhooks.js";
|
|
7
|
+
export { workflowWebhookRefusal } from "./webhook-ingress.js";
|
|
8
|
+
/** Existing authoring operations available to an admitted Agent App invocation. */
|
|
9
|
+
export declare const agentWorkflowOperationSchema: z.ZodEnum<{
|
|
10
|
+
catalog: "catalog";
|
|
11
|
+
armSchedule: "armSchedule";
|
|
12
|
+
disarmSchedule: "disarmSchedule";
|
|
13
|
+
schedules: "schedules";
|
|
14
|
+
armEventTrigger: "armEventTrigger";
|
|
15
|
+
disarmEventTrigger: "disarmEventTrigger";
|
|
16
|
+
eventTriggers: "eventTriggers";
|
|
17
|
+
}>;
|
|
18
|
+
export declare const agentAppWorkflowRequestSchema: z.ZodObject<{
|
|
19
|
+
authorityVersion: z.ZodNumber;
|
|
20
|
+
method: z.ZodString;
|
|
21
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
releaseId: z.ZodPipe<z.ZodString, z.ZodCustom<ReleaseId, ReleaseId>>;
|
|
23
|
+
installationId: z.ZodString;
|
|
24
|
+
computerId: z.ZodNullable<z.ZodString>;
|
|
25
|
+
operation: z.ZodEnum<{
|
|
26
|
+
catalog: "catalog";
|
|
27
|
+
armSchedule: "armSchedule";
|
|
28
|
+
disarmSchedule: "disarmSchedule";
|
|
29
|
+
schedules: "schedules";
|
|
30
|
+
armEventTrigger: "armEventTrigger";
|
|
31
|
+
disarmEventTrigger: "disarmEventTrigger";
|
|
32
|
+
eventTriggers: "eventTriggers";
|
|
33
|
+
}>;
|
|
34
|
+
requestId: z.ZodUUID;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type AgentAppWorkflowRequest = z.output<typeof agentAppWorkflowRequestSchema>;
|
|
37
|
+
export type AgentAppWorkflowPreparation = z.output<typeof appComputerAdmissionRefusalSchema> | Readonly<{
|
|
38
|
+
kind: "admitted";
|
|
39
|
+
attachmentId: string;
|
|
40
|
+
attachmentVersion: number;
|
|
41
|
+
grantorMemberId: string;
|
|
42
|
+
computerId: string | null;
|
|
43
|
+
authorityVersion: number;
|
|
44
|
+
releaseId: string;
|
|
45
|
+
appId: string;
|
|
46
|
+
}>;
|
|
47
|
+
/** Neutral identity shared by both host catalogs. */
|
|
48
|
+
export declare const WORKFLOW_CONTROL_MODULE_ID = "workflow-control";
|
|
49
|
+
/**
|
|
50
|
+
* Host-bound calls re-admit their principal on every execution.
|
|
51
|
+
*
|
|
52
|
+
* @inline
|
|
53
|
+
*/
|
|
54
|
+
export type WorkflowControl = Readonly<{
|
|
55
|
+
/** Read an admitted run's current status, or null when it is unavailable. */
|
|
56
|
+
status(runId: string): Promise<z.output<typeof statusReply> | null>;
|
|
57
|
+
/** Cancel an admitted run through the host's current Workflow authority. */
|
|
58
|
+
cancel(runId: string): Promise<z.output<typeof cancelReplySchema>>;
|
|
59
|
+
}>;
|
|
60
|
+
/** The same module and parsed execution closures serve either host. */
|
|
61
|
+
export type WorkflowControlModule = Readonly<{
|
|
62
|
+
module: ModuleRegistration;
|
|
63
|
+
operations: Readonly<Record<"status" | "cancel", (input: z.core.util.JSONType) => Promise<z.core.util.JSONType>>>;
|
|
64
|
+
}>;
|
|
65
|
+
/** Parsed MCP and Agent operations over the host's live Workflow authority. */
|
|
66
|
+
export declare function createMcpWorkflowControl(control: WorkflowControl): WorkflowControlModule;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { Mycelium } from "@fungi.computer/mycelium";
|
|
3
|
+
import { cancelReplySchema } from "@fungi.computer/workflows-wire";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { releaseIdSchema } from "@fungi.computer/puffball/effect";
|
|
6
|
+
import { causeClass } from "./cause-class.js";
|
|
7
|
+
export { createWorkflowWebhooks, workflowWebhookCommandSchema, workflowWebhookControlResponse, } from "./webhooks.js";
|
|
8
|
+
export { workflowWebhookRefusal } from "./webhook-ingress.js";
|
|
9
|
+
/** Existing authoring operations available to an admitted Agent App invocation. */
|
|
10
|
+
export const agentWorkflowOperationSchema = z.enum([
|
|
11
|
+
"catalog",
|
|
12
|
+
"schedules",
|
|
13
|
+
"armSchedule",
|
|
14
|
+
"disarmSchedule",
|
|
15
|
+
"eventTriggers",
|
|
16
|
+
"armEventTrigger",
|
|
17
|
+
"disarmEventTrigger",
|
|
18
|
+
]);
|
|
19
|
+
export const agentAppWorkflowRequestSchema = z.strictObject({
|
|
20
|
+
authorityVersion: z.number().int().nonnegative(),
|
|
21
|
+
method: z.string().min(1).max(128),
|
|
22
|
+
sessionId: z.string().min(1).max(256).optional(),
|
|
23
|
+
releaseId: z.string().pipe(z.custom(Schema.is(releaseIdSchema))),
|
|
24
|
+
installationId: z.string().min(1).max(256),
|
|
25
|
+
computerId: z.string().min(1).max(256).nullable(),
|
|
26
|
+
operation: agentWorkflowOperationSchema,
|
|
27
|
+
requestId: z.uuidv7(),
|
|
28
|
+
});
|
|
29
|
+
/** Neutral identity shared by both host catalogs. */
|
|
30
|
+
export const WORKFLOW_CONTROL_MODULE_ID = "workflow-control";
|
|
31
|
+
const jsonValue = z.json();
|
|
32
|
+
function retain(spec) {
|
|
33
|
+
return async (input) => spec.output.parseAsync(await spec.execute(await spec.input.parseAsync(input)));
|
|
34
|
+
}
|
|
35
|
+
/** Parsed MCP and Agent operations over the host's live Workflow authority. */
|
|
36
|
+
export function createMcpWorkflowControl(control) {
|
|
37
|
+
const input = z.strictObject({ runId: z.string().min(1).max(256) });
|
|
38
|
+
const specs = {
|
|
39
|
+
cancel: {
|
|
40
|
+
description: "Cancel a run you started or administer. Completed runs remain terminal.",
|
|
41
|
+
input,
|
|
42
|
+
output: z.union([
|
|
43
|
+
cancelReplySchema,
|
|
44
|
+
z.strictObject({ kind: z.literal("error"), error: z.string() }),
|
|
45
|
+
]),
|
|
46
|
+
execute: async ({ runId }) => {
|
|
47
|
+
try {
|
|
48
|
+
return cancelReplySchema.parse(await control.cancel(runId));
|
|
49
|
+
}
|
|
50
|
+
catch (cause) {
|
|
51
|
+
console.error("Workflow cancellation unavailable", causeClass(cause));
|
|
52
|
+
return {
|
|
53
|
+
kind: "error",
|
|
54
|
+
error: "Workflow cancellation unavailable",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
status: {
|
|
60
|
+
description: "Read the live status and step projection of a Workflow run.",
|
|
61
|
+
input,
|
|
62
|
+
output: z.discriminatedUnion("kind", [
|
|
63
|
+
z.object({ kind: z.literal("found"), snapshot: jsonValue }),
|
|
64
|
+
z.object({ kind: z.literal("error"), error: z.string() }),
|
|
65
|
+
]),
|
|
66
|
+
execute: async ({ runId }) => {
|
|
67
|
+
try {
|
|
68
|
+
const snapshot = await control.status(runId);
|
|
69
|
+
return snapshot === null
|
|
70
|
+
? { kind: "error", error: "Workflow run not found" }
|
|
71
|
+
: { kind: "found", snapshot };
|
|
72
|
+
}
|
|
73
|
+
catch (cause) {
|
|
74
|
+
console.error("Workflow status unavailable", causeClass(cause));
|
|
75
|
+
return {
|
|
76
|
+
kind: "error",
|
|
77
|
+
error: "Workflow status unavailable",
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
module: Mycelium.module({
|
|
85
|
+
id: WORKFLOW_CONTROL_MODULE_ID,
|
|
86
|
+
name: "workflows",
|
|
87
|
+
operations: {
|
|
88
|
+
cancel: Mycelium.operation({ ...specs.cancel, replay: "unsafe" }),
|
|
89
|
+
status: Mycelium.operation({ ...specs.status, replay: "safe" }),
|
|
90
|
+
},
|
|
91
|
+
}),
|
|
92
|
+
operations: {
|
|
93
|
+
cancel: retain(specs.cancel),
|
|
94
|
+
status: retain(specs.status),
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
package/docs/api/README.md
CHANGED
|
@@ -6,43 +6,35 @@
|
|
|
6
6
|
|
|
7
7
|
# Oyster API overview
|
|
8
8
|
|
|
9
|
-
| Import
|
|
10
|
-
|
|
|
11
|
-
| `@fungi.computer/oyster`
|
|
12
|
-
| `@fungi.computer/oyster`
|
|
13
|
-
| `@fungi.computer/oyster`
|
|
14
|
-
| `@fungi.computer/oyster`
|
|
15
|
-
| `@fungi.computer/oyster`
|
|
16
|
-
| `@fungi.computer/oyster`
|
|
17
|
-
| `@fungi.computer/oyster/invocation`
|
|
18
|
-
| `@fungi.computer/oyster/cloudflare`
|
|
19
|
-
| `@fungi.computer/oyster/apps`
|
|
20
|
-
| `@fungi.computer/oyster/host`
|
|
21
|
-
| `@fungi.computer/oyster/auth`
|
|
22
|
-
| `@fungi.computer/oyster/tenant`
|
|
23
|
-
| `@fungi.computer/oyster/workers`
|
|
24
|
-
| `@fungi.computer/oyster/pack`
|
|
25
|
-
| `@fungi.computer/oyster/build`
|
|
26
|
-
| `@fungi.computer/oyster/build-contract`
|
|
27
|
-
| `@fungi.computer/oyster/app-storage`
|
|
28
|
-
| `@fungi.computer/oyster/app-storage`
|
|
29
|
-
| `@fungi.computer/oyster/mcp`
|
|
30
|
-
| `@fungi.computer/oyster/agents`
|
|
31
|
-
| `@fungi.computer/oyster/computer`
|
|
32
|
-
| `@fungi.computer/oyster/media`
|
|
33
|
-
| `@fungi.computer/oyster/files`
|
|
34
|
-
| `@fungi.computer/oyster/root-data`
|
|
35
|
-
| `@fungi.computer/oyster/page`
|
|
36
|
-
| `@fungi.computer/oyster/
|
|
37
|
-
| `@fungi.computer/oyster/
|
|
38
|
-
| `@fungi.computer/oyster/shell/command-host` | `createAppSurfaceCommandHost` | Admit declared commands and own focus and contribution lifetimes. |
|
|
39
|
-
| `@fungi.computer/oyster/shell/keys` | `installShellKeys`, `parseChord` | Match chords and optionally install DOM key dispatch. |
|
|
40
|
-
| `@fungi.computer/oyster/shell/commands` | `shellCommands` | Declare shell commands over embedding-host callbacks. |
|
|
41
|
-
| `@fungi.computer/oyster/shell/window-manager` | `createWindowManager` | Own window generations, visibility and disposal over a mount adapter. |
|
|
42
|
-
| `@fungi.computer/oyster/shell/app-directory` | Directory schemas | Decode host-neutral addresses and App metadata before permissions. |
|
|
43
|
-
| `@fungi.computer/oyster/shell/shell-module` | `importShellModule`, `ShellMountInput`, `MountShell` | Load the picked shell Release's `mountShell` module from the host's own origin and hand it the workbench, storage and methods. |
|
|
44
|
-
| `@fungi.computer/oyster/git` | `EventSink`, `createGitDoor`, `signStandardWebhook` | The EVENTS binding contract, the git smart-HTTP door and Standard Webhooks signing. `GitBinding` comes from `@fungi.computer/agar/git`. |
|
|
45
|
-
| `@fungi.computer/oyster/workers-git` | `oysterGitRoot`, `createOysterGitWorker`, `ownerOrKeyTenancy`, `oysterWorkerGit`, `gitAdminRoutes` | One Git root whose `hostFor` serves HTTP, MCP and Instances, or `host.git` and key/webhook routes for your own host. |
|
|
9
|
+
| Import | Export | Purpose |
|
|
10
|
+
| --------------------------------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `@fungi.computer/oyster` | `createAppInstance` | Run one App Instance's lifecycle and admission over host-supplied ports. |
|
|
12
|
+
| `@fungi.computer/oyster` | `InstancePorts` | The storage, artifact resolution, abort, purge and connection ports a host supplies. |
|
|
13
|
+
| `@fungi.computer/oyster` | `selectionSchema` | Decode the owner-issued selection that authorizes a request. |
|
|
14
|
+
| `@fungi.computer/oyster` | `ownerStateSchema` | Decode a complete owner state: `enabled`, `disabled` or `deleted`. |
|
|
15
|
+
| `@fungi.computer/oyster` | `AppInstanceError` | Typed rejection with a stable `code` from `appInstanceErrorCodeSchema`. |
|
|
16
|
+
| `@fungi.computer/oyster` | `instanceIds` | Mint and recognize App Instance IDs. |
|
|
17
|
+
| `@fungi.computer/oyster/invocation` | `createInvocationGate`, `invocationFacts`, `InvocationFrame` | Run each request in one frame of host-admitted caller facts, with its deadline and abort signal. |
|
|
18
|
+
| `@fungi.computer/oyster/cloudflare` | `createCloudflareAppInstance` | Run an Instance in a SQLite Durable Object with a Worker Loader facet (workerd or celld). |
|
|
19
|
+
| `@fungi.computer/oyster/apps` | `Installation`, `applyInstallationCommand`, `admits`, `approvedBindingGrants` | Pure installation approvals and admission; host-owned commits and tenant freshness. |
|
|
20
|
+
| `@fungi.computer/oyster/host` | `createOyster` | The Oyster App server: a Hono app over host adapters for sign-in, Releases, installations and Instances. |
|
|
21
|
+
| `@fungi.computer/oyster/auth` | `ownerKeyAuth`, `ownerOrKeyAuth` | Owner-key sign-in (a Bearer key or the login cookie, compared in constant time) and named agent keys as Team-key principals. |
|
|
22
|
+
| `@fungi.computer/oyster/tenant` | `TenantScope`, `tenantScope`, `singleTenant`, `OysterTenancy` | Host-resolved tenant identity and the scope that prefixes registry, key and repository names. |
|
|
23
|
+
| `@fungi.computer/oyster/workers` | `createOysterWorker` | A standalone single-owner Oyster on Workers or celld: R2 Releases, a registry and one Durable Object per Instance. |
|
|
24
|
+
| `@fungi.computer/oyster/pack` | `packRelease`, `installRelease`, `installFromSource`, `publishSource` | Build a committed App through the canonical recipe compiler and install its Release on an Oyster over HTTP. |
|
|
25
|
+
| `@fungi.computer/oyster/build` | `createAppCandidatePreparer`, `createLocalBuildExecutor` | Node-only source capture, pinned compilation and local artifact writing. |
|
|
26
|
+
| `@fungi.computer/oyster/build-contract` | Recipe schemas and candidate orchestration | The Worker-safe half of `./build`, without the executor. |
|
|
27
|
+
| `@fungi.computer/oyster/app-storage` | `AppStorageBinding` | `env.APP_STORAGE` for methods and lifecycle handlers: lifecycle writes go to the team layer and reach `appStorage.watch`. |
|
|
28
|
+
| `@fungi.computer/oyster/app-storage` | `createAppStorage`, `appStorageSchemaStatements` | SQLite owner for declared keys, live member/lifecycle admission, revision checks and watch invalidations. |
|
|
29
|
+
| `@fungi.computer/oyster/mcp` | `oysterAppMethods`, `oysterComputerTools`, `oysterMcpCatalogLoad` | Installed App methods and the host's Computer as Mycelium modules for the shared MCP endpoint, scoped to the caller. |
|
|
30
|
+
| `@fungi.computer/oyster/agents` | `OysterAgents`, `agentCapabilities`, `agentApprovalRoutes` | The host's Agent slot, its App capabilities and the owner-only approval routes. |
|
|
31
|
+
| `@fungi.computer/oyster/computer` | `computerSlots`, `ComputerTerminalHost` | Computer ports, processes and terminal routes supplied by the host; execution stays in the Computer runtime. |
|
|
32
|
+
| `@fungi.computer/oyster/media` | `mediaSlot` | The media capability slot a host fills; Oyster owns routing, never generation. |
|
|
33
|
+
| `@fungi.computer/oyster/files` | `FileSource` | Files Apps reach through Agar's `computer.*` file contracts, with a compare-and-swap replace. |
|
|
34
|
+
| `@fungi.computer/oyster/root-data` | `createOysterRootData` | Installation and verified Release owners as shared workbench metadata for a standalone root. |
|
|
35
|
+
| `@fungi.computer/oyster/page` | `mountOysterPage`, `connectOysterApp`, `readOysterPageConfig` | Mount one installed App's sandboxed frame and connect its admitted slots. |
|
|
36
|
+
| `@fungi.computer/oyster/git` | `EventSink`, `createGitDoor`, `signStandardWebhook` | The EVENTS binding contract, the git smart-HTTP door and Standard Webhooks signing. `GitBinding` comes from `@fungi.computer/agar/git`. |
|
|
37
|
+
| `@fungi.computer/oyster/workers-git` | `oysterGitRoot`, `createOysterGitWorker`, `ownerOrKeyTenancy`, `oysterWorkerGit`, `gitAdminRoutes` | One Git root whose `hostFor` serves HTTP, MCP and Instances, or `host.git` and key/webhook routes for your own host. |
|
|
46
38
|
|
|
47
39
|
The host owns admission: it decides who may apply owner state and which
|
|
48
40
|
selection a request carries. Oyster owns what happens to one Instance once the
|
|
@@ -50,6 +42,40 @@ host has that authority: owner-state replay and conflict rules, Release
|
|
|
50
42
|
resolution, state-schema compatibility, fencing on disable and purge on delete.
|
|
51
43
|
The generated module pages below include every port and record type.
|
|
52
44
|
|
|
45
|
+
## App Agent send API — breaking change
|
|
46
|
+
|
|
47
|
+
An App with the `AGENTS.send` binding sends into an existing authorized Session:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
const intent = {
|
|
51
|
+
agentId,
|
|
52
|
+
sessionId,
|
|
53
|
+
requestId: crypto.randomUUID(),
|
|
54
|
+
text: "Continue this work",
|
|
55
|
+
delivery: "followUp" as const,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const accepted = await env.AGENTS.send(intent);
|
|
59
|
+
// If the outcome is UNKNOWN, retry env.AGENTS.send(intent), unchanged.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`requestId` is required, non-empty, and bounded to 256 UTF-8 bytes. Mint it once
|
|
63
|
+
per user intent, outside the send/retry function, and retain the same input
|
|
64
|
+
until the outcome is known. An UNKNOWN response is not evidence that admission
|
|
65
|
+
failed: the recipient may already have accepted the work. Retrying that same
|
|
66
|
+
intent must not create another delivery. A new intent needs a new request ID.
|
|
67
|
+
|
|
68
|
+
The App bridge forwards the caller's ID. The standalone adapter no longer mints
|
|
69
|
+
one, and neither path substitutes a transport `callId`. An omitted ID is
|
|
70
|
+
refused; there is no compatibility form. Grove's `sendMessage` method requires
|
|
71
|
+
and forwards the same field. Admission, the existing send budget, and follow-up
|
|
72
|
+
delivery policy are unchanged.
|
|
73
|
+
|
|
74
|
+
**BREAKING CHANGE:** App `AGENTS.send` and Grove `sendMessage` now require
|
|
75
|
+
caller-owned `requestId`. Update existing Apps and their retry state before
|
|
76
|
+
using this API. This release note does not authorize a version bump or
|
|
77
|
+
publication.
|
|
78
|
+
|
|
53
79
|
## Guest execution policy
|
|
54
80
|
|
|
55
81
|
`createOyster({ ...host, guestLimits: { cpuMs: 250, subRequests: 10 } })`
|
package/docs/api/agents.md
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
type OysterAgent = Readonly<{
|
|
17
17
|
agentId: string;
|
|
18
18
|
name: string;
|
|
19
|
+
avatar: Avatar;
|
|
19
20
|
sessionOperations: readonly ("agent.read" | "agent.send" | "agent.manage")[];
|
|
20
21
|
}>;
|
|
21
22
|
```
|
|
@@ -160,6 +161,7 @@ type OysterAgents = Readonly<{
|
|
|
160
161
|
readonly Readonly<{
|
|
161
162
|
agentId: string;
|
|
162
163
|
name: string;
|
|
164
|
+
avatar: Avatar;
|
|
163
165
|
sessionOperations: readonly (
|
|
164
166
|
"agent.read" | "agent.send" | "agent.manage"
|
|
165
167
|
)[];
|
|
@@ -169,6 +171,7 @@ type OysterAgents = Readonly<{
|
|
|
169
171
|
Readonly<{
|
|
170
172
|
agentId: string;
|
|
171
173
|
name: string;
|
|
174
|
+
avatar: Avatar;
|
|
172
175
|
sessionOperations: readonly (
|
|
173
176
|
"agent.read" | "agent.send" | "agent.manage"
|
|
174
177
|
)[];
|
|
@@ -178,6 +181,7 @@ type OysterAgents = Readonly<{
|
|
|
178
181
|
| Readonly<{
|
|
179
182
|
agentId: string;
|
|
180
183
|
name: string;
|
|
184
|
+
avatar: Avatar;
|
|
181
185
|
sessionOperations: readonly (
|
|
182
186
|
"agent.read" | "agent.send" | "agent.manage"
|
|
183
187
|
)[];
|
|
@@ -186,6 +190,19 @@ type OysterAgents = Readonly<{
|
|
|
186
190
|
error: "not_found" | "name_taken" | "not_granted";
|
|
187
191
|
}>
|
|
188
192
|
>;
|
|
193
|
+
setAvatar: Promise<
|
|
194
|
+
| Readonly<{
|
|
195
|
+
agentId: string;
|
|
196
|
+
name: string;
|
|
197
|
+
avatar: Avatar;
|
|
198
|
+
sessionOperations: readonly (
|
|
199
|
+
"agent.read" | "agent.send" | "agent.manage"
|
|
200
|
+
)[];
|
|
201
|
+
}>
|
|
202
|
+
| Readonly<{
|
|
203
|
+
error: "not_found" | "not_granted";
|
|
204
|
+
}>
|
|
205
|
+
>;
|
|
189
206
|
policyStatus: Promise<Readonly<{
|
|
190
207
|
status: "pending" | "approved";
|
|
191
208
|
revision: string;
|
package/docs/api/app-storage.md
CHANGED
|
@@ -131,7 +131,7 @@ Whether `writer` may mutate `scope`; anything else is `owner_required`.
|
|
|
131
131
|
| Parameter | Type |
|
|
132
132
|
| --------- | --------------------------------------- |
|
|
133
133
|
| `writer` | [`AppStorageWriter`](#appstoragewriter) |
|
|
134
|
-
| `scope` | `"
|
|
134
|
+
| `scope` | `"member"` \| `"team"` |
|
|
135
135
|
|
|
136
136
|
#### Returns
|
|
137
137
|
|