@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
package/dist/release.d.ts
CHANGED
|
@@ -20,6 +20,14 @@ export type ArtifactHeads = Readonly<{
|
|
|
20
20
|
/** Describe the object at `artifactRef`, or `null` when absent. */
|
|
21
21
|
head: (artifactRef: ArtifactRef) => Promise<ArtifactHead | null>;
|
|
22
22
|
}>;
|
|
23
|
+
/** A store that can stream immutable object bytes without materializing them. */
|
|
24
|
+
export type ArtifactStreams = Readonly<{
|
|
25
|
+
/**
|
|
26
|
+
* Open a one-shot byte stream, or return `null` when absent. The signal owns
|
|
27
|
+
* cancellation of both source opening where supported and subsequent reads.
|
|
28
|
+
*/
|
|
29
|
+
stream: (artifactRef: ArtifactRef, signal?: AbortSignal) => Promise<ReadableStream<Uint8Array> | null>;
|
|
30
|
+
}>;
|
|
23
31
|
/** Why a Release could not be read; the host maps it to an HTTP refusal. */
|
|
24
32
|
export declare class ReleaseError extends Error {
|
|
25
33
|
readonly code: "artifact_missing" | "digest_mismatch" | "invalid_release" | "asset_missing";
|
|
@@ -55,14 +63,13 @@ export declare function readVerified(store: ArtifactStore, artifactRef: Artifact
|
|
|
55
63
|
/** Decode an untrusted Release record, as an install request carries it. */
|
|
56
64
|
export declare function parseRelease(value: unknown): Release;
|
|
57
65
|
/**
|
|
58
|
-
* Read a Release root and verify
|
|
59
|
-
*
|
|
66
|
+
* Read a Release root and verify its UI build and backend descriptor.
|
|
67
|
+
* `readAssets` verifies UI object bodies when true. When false, it reads the
|
|
68
|
+
* asset manifest needed to resolve references but does not read any UI object
|
|
69
|
+
* body, including standalone HTML.
|
|
60
70
|
*/
|
|
61
71
|
export declare function verifyRelease(store: ArtifactStore, release: Release, policy?: AssetBuildPolicy,
|
|
62
|
-
/**
|
|
63
|
-
* Read and check every UI asset now. Serving can skip this: each asset is
|
|
64
|
-
* verified against its digest when it is read.
|
|
65
|
-
*/
|
|
72
|
+
/** Read and check every UI object now. Serving verifies each on demand. */
|
|
66
73
|
readAssets?: boolean): Promise<VerifiedRelease>;
|
|
67
74
|
/**
|
|
68
75
|
* Resolve a Release to its verified durable backend without reading its UI:
|
package/dist/release.js
CHANGED
|
@@ -49,14 +49,13 @@ export function parseRelease(value) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Read a Release root and verify
|
|
53
|
-
*
|
|
52
|
+
* Read a Release root and verify its UI build and backend descriptor.
|
|
53
|
+
* `readAssets` verifies UI object bodies when true. When false, it reads the
|
|
54
|
+
* asset manifest needed to resolve references but does not read any UI object
|
|
55
|
+
* body, including standalone HTML.
|
|
54
56
|
*/
|
|
55
57
|
export async function verifyRelease(store, release, policy = defaultAssetPolicy,
|
|
56
|
-
/**
|
|
57
|
-
* Read and check every UI asset now. Serving can skip this: each asset is
|
|
58
|
-
* verified against its digest when it is read.
|
|
59
|
-
*/
|
|
58
|
+
/** Read and check every UI object now. Serving verifies each on demand. */
|
|
60
59
|
readAssets = true) {
|
|
61
60
|
const rootBytes = await readVerified(store, release.artifact.artifactRef, release.artifact.artifactDigest);
|
|
62
61
|
let build;
|
|
@@ -70,8 +69,12 @@ readAssets = true) {
|
|
|
70
69
|
}
|
|
71
70
|
let ui = null;
|
|
72
71
|
if ("ui" in build) {
|
|
73
|
-
const bytes =
|
|
72
|
+
const bytes = readAssets || build.ui.mediaType === assetBuildMediaType
|
|
73
|
+
? await readVerified(store, build.ui.artifactRef, build.ui.digest)
|
|
74
|
+
: null;
|
|
74
75
|
if (build.ui.mediaType === assetBuildMediaType) {
|
|
76
|
+
if (bytes === null)
|
|
77
|
+
throw new ReleaseError("invalid_release", "Asset manifest is required to verify its object references");
|
|
75
78
|
let assets;
|
|
76
79
|
try {
|
|
77
80
|
assets = decodeAssetBuild(bytes, policy);
|
package/dist/root-data.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import type { Release } from "@fungi.computer/puffball";
|
|
2
2
|
import { createAppStorage } from "./app-storage.js";
|
|
3
3
|
import type { InstallationStore, verifyRelease } from "./host.js";
|
|
4
|
-
import { type AppDirectoryEntry } from "
|
|
5
|
-
|
|
4
|
+
import { type AppDirectoryEntry } from "@fungi.computer/nacre/app-directory";
|
|
5
|
+
/**
|
|
6
|
+
* A destination the host offers the dashboard. This is a structural twin of
|
|
7
|
+
* Nacre's `WorkbenchPlatformDestination`: importing that type would put
|
|
8
|
+
* Nacre's DOM-typed workbench declarations on every Worker entry that reaches
|
|
9
|
+
* root data.
|
|
10
|
+
*/
|
|
11
|
+
type PlatformDestination = Readonly<{
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}>;
|
|
6
15
|
/** Role choices belong to the root owner, independently of Release declarations. */
|
|
7
16
|
export type OysterRootRoles = Readonly<Record<string, Readonly<{
|
|
8
17
|
surfaceId: string | null;
|
|
@@ -33,7 +42,7 @@ export declare function createOysterRootData(options: OysterRootDataOptions): {
|
|
|
33
42
|
openInstallation(authorize: () => import("effect/Effect").Effect<import("./app-storage.js").AppStorageInstallationAdmission, Error>): {
|
|
34
43
|
read: (key: string) => import("effect/Effect").Effect<{
|
|
35
44
|
readonly value: import("effect/Schema").Json;
|
|
36
|
-
readonly source: "
|
|
45
|
+
readonly source: "member" | "team" | "none";
|
|
37
46
|
readonly team: {
|
|
38
47
|
readonly value: import("effect/Schema").Json;
|
|
39
48
|
readonly revision: number;
|
|
@@ -54,7 +63,7 @@ export declare function createOysterRootData(options: OysterRootDataOptions): {
|
|
|
54
63
|
open(authorize: () => import("effect/Effect").Effect<import("./app-storage.js").AppStorageAdmission, Error>): {
|
|
55
64
|
read: (key: string) => import("effect/Effect").Effect<{
|
|
56
65
|
readonly value: import("effect/Schema").Json;
|
|
57
|
-
readonly source: "
|
|
66
|
+
readonly source: "member" | "team" | "none";
|
|
58
67
|
readonly team: {
|
|
59
68
|
readonly value: import("effect/Schema").Json;
|
|
60
69
|
readonly revision: number;
|
|
@@ -74,7 +83,7 @@ export declare function createOysterRootData(options: OysterRootDataOptions): {
|
|
|
74
83
|
events: (key: string) => import("effect/Stream").Stream<{
|
|
75
84
|
readonly appId: string;
|
|
76
85
|
readonly key: string;
|
|
77
|
-
readonly scope: "
|
|
86
|
+
readonly scope: "member" | "team";
|
|
78
87
|
readonly revision: number;
|
|
79
88
|
} | null, import("@fungi.computer/agar").AppStorageError, never>;
|
|
80
89
|
};
|
|
@@ -82,5 +91,6 @@ export declare function createOysterRootData(options: OysterRootDataOptions): {
|
|
|
82
91
|
/** Project the current installations without minting permissions or role choices. */
|
|
83
92
|
directory(): Promise<OysterRootDirectory>;
|
|
84
93
|
/** No standalone platform navigation destination is implemented yet. */
|
|
85
|
-
platformDestinations(): readonly
|
|
94
|
+
platformDestinations(): readonly PlatformDestination[];
|
|
86
95
|
};
|
|
96
|
+
export {};
|
package/dist/root-data.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveAppRoles, } from "@fungi.computer/puffball/app";
|
|
2
2
|
import { createAppStorage } from "./app-storage.js";
|
|
3
|
-
import { addressKey, appDirectoryEntrySchema, } from "
|
|
3
|
+
import { addressKey, appDirectoryEntrySchema, } from "@fungi.computer/nacre/app-directory";
|
|
4
4
|
/** Data adapters for a standalone workbench over the root's existing owners. */
|
|
5
5
|
export function createOysterRootData(options) {
|
|
6
6
|
const storage = createAppStorage(options);
|
|
@@ -31,7 +31,7 @@ export function createOysterRootData(options) {
|
|
|
31
31
|
displayName: declaration?.displayName,
|
|
32
32
|
icon: declaration?.icon ?? null,
|
|
33
33
|
releaseId: installation.release.releaseId,
|
|
34
|
-
authorityVersion: installation.authorityVersion,
|
|
34
|
+
authorityVersion: installation.authority.authorityVersion,
|
|
35
35
|
enforcement: null,
|
|
36
36
|
handlers: [...(declaration?.handlers ?? [])],
|
|
37
37
|
roles: [...(declaration?.roles ?? [])],
|
package/dist/source/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* never import it: use `@fungi.computer/oyster/source/template-push`. */
|
|
6
6
|
export { templateRepositoryForApp } from "./template-repository.js";
|
|
7
7
|
export { seedReceiptInputSchema, sameReceipt, type PublisherTemplateSeedReceipt, type PublisherTemplateSeedReceipts, } from "./seed-receipt.js";
|
|
8
|
-
export { readTeamAppSeedProvenance, privateTeamBuildSource, TeamAppSourceError, } from "./team-source.js";
|
|
8
|
+
export { readTeamAppSeedProvenance, privateTeamBuildSource, TeamAppSourceError, type TeamAppSeedProvenance, } from "./team-source.js";
|
|
9
9
|
export { parseTemplateSeedClaim, recordTemplateSeed, templateSeedClaimSchema, TEMPLATE_SEED_CLAIM_MAX_BYTES, type TemplateSeedClaim, } from "./template-seed.js";
|
|
10
10
|
export { forkAppSource, type AppSourceForkResult } from "./fork.js";
|
|
@@ -4,12 +4,9 @@ export declare class TeamAppSourceError extends Error {
|
|
|
4
4
|
readonly code: "denied" | "unavailable";
|
|
5
5
|
constructor(code: "denied" | "unavailable");
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
registry: TeamAppPublisherRegistry;
|
|
11
|
-
readSeedReceipt(appId: PublisherTemplateSeedReceipt["appId"], seedRevision: PublisherTemplateSeedReceipt["seedRevision"]): Promise<PublisherTemplateSeedReceipt | null>;
|
|
12
|
-
}): Promise<Readonly<{
|
|
7
|
+
/** What a Team build runs: the App's source repository and the seed receipt
|
|
8
|
+
* whose recipe builds it. */
|
|
9
|
+
export type TeamAppSeedProvenance = Readonly<{
|
|
13
10
|
appId: string;
|
|
14
11
|
repository: string;
|
|
15
12
|
templateSeed: Readonly<{
|
|
@@ -18,9 +15,24 @@ export declare function readTeamAppSeedProvenance(options: {
|
|
|
18
15
|
}>;
|
|
19
16
|
recipe: PublisherTemplateSeedReceipt["recipe"];
|
|
20
17
|
buildRecipeDigest: PublisherTemplateSeedReceipt["buildRecipeDigest"];
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Read the source revision a Team build runs and the seed receipt that builds
|
|
21
|
+
* it. A template App uses the receipt of the exact commit it builds, failing
|
|
22
|
+
* closed when that commit was never seeded; a fork uses its pinned seed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readTeamAppSeedProvenance(options: {
|
|
25
|
+
appId: string;
|
|
26
|
+
teamId: string;
|
|
27
|
+
registry: TeamAppPublisherRegistry;
|
|
28
|
+
readSeedReceipt(appId: PublisherTemplateSeedReceipt["appId"], seedRevision: PublisherTemplateSeedReceipt["seedRevision"]): Promise<PublisherTemplateSeedReceipt | null>;
|
|
29
|
+
readDefaultBranchHead(repository: string): Promise<string | null>;
|
|
30
|
+
}): Promise<Readonly<{
|
|
31
|
+
source: TeamAppSeedProvenance;
|
|
32
|
+
sourceRevision: PublisherTemplateSeedReceipt["seedRevision"];
|
|
21
33
|
}>>;
|
|
22
|
-
/** A
|
|
23
|
-
export declare function privateTeamBuildSource(source:
|
|
34
|
+
/** A Team build keeps the seed's exact builder; private UI assets use Vite's relative base. */
|
|
35
|
+
export declare function privateTeamBuildSource(source: TeamAppSeedProvenance): Readonly<{
|
|
24
36
|
appId: string;
|
|
25
37
|
repository: string;
|
|
26
38
|
templateSeed: Readonly<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseAppId } from "@fungi.computer/puffball";
|
|
1
|
+
import { parseAppId, parseSourceRevision } from "@fungi.computer/puffball";
|
|
2
2
|
import { digestPinnedRecipe } from "../build-contract.js";
|
|
3
3
|
import { templateRepositoryForApp } from "./template-repository.js";
|
|
4
4
|
export class TeamAppSourceError extends Error {
|
|
@@ -9,16 +9,42 @@ export class TeamAppSourceError extends Error {
|
|
|
9
9
|
this.name = "TeamAppSourceError";
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* A first-party template App builds its own template, so each seeded commit
|
|
14
|
+
* carries its own recipe. A fork builds its own repository with the recipe of
|
|
15
|
+
* the seed it was forked from.
|
|
16
|
+
*/
|
|
17
|
+
function seedKind(registration, templateSeed) {
|
|
18
|
+
return templateSeed.appId === registration.appId &&
|
|
19
|
+
registration.source.repository ===
|
|
20
|
+
templateRepositoryForApp(registration.appId)
|
|
21
|
+
? "template"
|
|
22
|
+
: "fork";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Read the source revision a Team build runs and the seed receipt that builds
|
|
26
|
+
* it. A template App uses the receipt of the exact commit it builds, failing
|
|
27
|
+
* closed when that commit was never seeded; a fork uses its pinned seed.
|
|
28
|
+
*/
|
|
12
29
|
export async function readTeamAppSeedProvenance(options) {
|
|
13
30
|
const appId = parseAppId(options.appId);
|
|
14
31
|
const authorization = await options.registry.authorize(appId, options.teamId);
|
|
15
32
|
if (authorization.kind !== "authorized")
|
|
16
33
|
throw new TeamAppSourceError("denied");
|
|
17
34
|
const registration = authorization.registration;
|
|
18
|
-
const
|
|
19
|
-
if (registration.source.provider !== "artifacts" ||
|
|
20
|
-
|
|
35
|
+
const pinned = registration.templateSeed;
|
|
36
|
+
if (registration.source.provider !== "artifacts" || pinned === undefined)
|
|
37
|
+
throw new TeamAppSourceError("unavailable");
|
|
38
|
+
const head = await options.readDefaultBranchHead(registration.source.repository);
|
|
39
|
+
if (head === null)
|
|
21
40
|
throw new TeamAppSourceError("unavailable");
|
|
41
|
+
const sourceRevision = parseSourceRevision(`git:${head}`);
|
|
42
|
+
const templateSeed = {
|
|
43
|
+
appId: pinned.appId,
|
|
44
|
+
revision: seedKind(registration, pinned) === "template"
|
|
45
|
+
? sourceRevision
|
|
46
|
+
: pinned.revision,
|
|
47
|
+
};
|
|
22
48
|
const receipt = await options.readSeedReceipt(parseAppId(templateSeed.appId), templateSeed.revision);
|
|
23
49
|
if (receipt?.appId !== templateSeed.appId ||
|
|
24
50
|
receipt.seedRevision !== templateSeed.revision ||
|
|
@@ -26,14 +52,17 @@ export async function readTeamAppSeedProvenance(options) {
|
|
|
26
52
|
digestPinnedRecipe(receipt.recipe) !== receipt.buildRecipeDigest)
|
|
27
53
|
throw new TeamAppSourceError("unavailable");
|
|
28
54
|
return Object.freeze({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
55
|
+
source: Object.freeze({
|
|
56
|
+
appId,
|
|
57
|
+
repository: registration.source.repository,
|
|
58
|
+
templateSeed: Object.freeze(templateSeed),
|
|
59
|
+
recipe: receipt.recipe,
|
|
60
|
+
buildRecipeDigest: receipt.buildRecipeDigest,
|
|
61
|
+
}),
|
|
62
|
+
sourceRevision,
|
|
34
63
|
});
|
|
35
64
|
}
|
|
36
|
-
/** A
|
|
65
|
+
/** A Team build keeps the seed's exact builder; private UI assets use Vite's relative base. */
|
|
37
66
|
export function privateTeamBuildSource(source) {
|
|
38
67
|
if (source.recipe.format !== "assets")
|
|
39
68
|
return source;
|
|
@@ -51,7 +51,7 @@ export declare function parseTemplateSeedClaim(body: string): TemplateSeedClaim
|
|
|
51
51
|
*/
|
|
52
52
|
export declare function recordTemplateSeed(receipts: PublisherTemplateSeedReceipts, artifacts: Pick<Artifacts, "readDefaultBranchHead">, rawAppId: string, claim: TemplateSeedClaim): Promise<{
|
|
53
53
|
readonly kind: "conflict";
|
|
54
|
-
|
|
54
|
+
receipt?: undefined;
|
|
55
55
|
} | {
|
|
56
56
|
readonly kind: "recorded" | "existing";
|
|
57
57
|
readonly receipt: {
|
|
@@ -64,5 +64,5 @@ export declare function recordTemplateSeed(receipts: PublisherTemplateSeedReceip
|
|
|
64
64
|
};
|
|
65
65
|
} | {
|
|
66
66
|
readonly kind: "unavailable";
|
|
67
|
-
|
|
67
|
+
receipt?: undefined;
|
|
68
68
|
}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AgentMail, agentMailRoute } from "@fungi.computer/shiitake/delegation";
|
|
2
|
+
/** Standalone borrows Shiitake's one Watchdog and Carrier's ordinary durable lane. */
|
|
3
|
+
export declare function agentMail(options: Omit<ConstructorParameters<typeof AgentMail>[0], "post" | "drain"> & {
|
|
4
|
+
namespace: Parameters<typeof agentMailRoute>[0];
|
|
5
|
+
}): {
|
|
6
|
+
host: Required<Pick<Readonly<{
|
|
7
|
+
meta?: import("@fungi.computer/shiitake").HostMetaOptions;
|
|
8
|
+
model: import("@fungi.computer/shiitake").ModelSource;
|
|
9
|
+
instructions: import("@fungi.computer/shiitake").InstructionSource;
|
|
10
|
+
tools?: readonly [] | import("@fungi.computer/shiitake/cloudflare").CloudflareShiitakeTools;
|
|
11
|
+
storagePressure?: import("@fungi.computer/shiitake").StoragePressureCheck;
|
|
12
|
+
compaction?: import("@fungi.computer/shiitake").CompactionOptions;
|
|
13
|
+
extensions: import("@fungi.computer/shiitake").ExtensionRosterV0;
|
|
14
|
+
initialize?: (agent: import("@fungi.computer/shiitake").ShiitakeOwnerAgent) => Promise<void>;
|
|
15
|
+
hostWork?: readonly import("@fungi.computer/shiitake/cloudflare").CloudflareHostWork[];
|
|
16
|
+
hostJobs?: import("@fungi.computer/shiitake/cloudflare").CloudflareHostJobs;
|
|
17
|
+
mailRoom?: import("@fungi.computer/bird-dog/effect").BirdDogEffect;
|
|
18
|
+
acp?: (agent: import("@fungi.computer/shiitake").ShiitakeOwnerAgent) => Promise<import("@fungi.computer/shiitake/cloudflare").CloudflareShiitakeAcpServer>;
|
|
19
|
+
}>, "mailRoom" | "hostJobs" | "hostWork">>;
|
|
20
|
+
deliver: (value: Parameters<AgentMail["send"]>[0]) => Promise<Readonly<{
|
|
21
|
+
status: "accepted";
|
|
22
|
+
commandId: string;
|
|
23
|
+
}>>;
|
|
24
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createPost } from "@fungi.computer/carrier/post";
|
|
2
|
+
import { AgentMail, agentMailRoute } from "@fungi.computer/shiitake/delegation";
|
|
3
|
+
/** Standalone borrows Shiitake's one Watchdog and Carrier's ordinary durable lane. */
|
|
4
|
+
export function agentMail(options) {
|
|
5
|
+
const routes = {
|
|
6
|
+
agentMail: agentMailRoute(options.namespace, options.replySettlement),
|
|
7
|
+
};
|
|
8
|
+
let post;
|
|
9
|
+
let tick;
|
|
10
|
+
const runtime = () => {
|
|
11
|
+
if (post === undefined)
|
|
12
|
+
throw new Error("Agent Post is not open");
|
|
13
|
+
return post;
|
|
14
|
+
};
|
|
15
|
+
const recover = async () => {
|
|
16
|
+
let cursor;
|
|
17
|
+
do {
|
|
18
|
+
cursor = await runtime().enqueueDue(64, cursor);
|
|
19
|
+
} while (cursor !== undefined);
|
|
20
|
+
};
|
|
21
|
+
const drain = async () => {
|
|
22
|
+
await recover();
|
|
23
|
+
if (tick === undefined)
|
|
24
|
+
throw new Error("Agent Post lane is not open");
|
|
25
|
+
await tick();
|
|
26
|
+
};
|
|
27
|
+
const mail = new AgentMail({ ...options, post: runtime, drain });
|
|
28
|
+
const host = {
|
|
29
|
+
mailRoom: mail.mailRoom(),
|
|
30
|
+
hostJobs: {
|
|
31
|
+
lane: "post",
|
|
32
|
+
open: (owner) => {
|
|
33
|
+
post = createPost({
|
|
34
|
+
routes,
|
|
35
|
+
owner: options.storage,
|
|
36
|
+
transactional: owner.transactional,
|
|
37
|
+
readJob: owner.readJob,
|
|
38
|
+
now: Date.now,
|
|
39
|
+
scheduleWake: options.wake,
|
|
40
|
+
});
|
|
41
|
+
tick = owner.tickConcurrent;
|
|
42
|
+
return { execute: (job) => runtime().execute(job) };
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
hostWork: [
|
|
46
|
+
{
|
|
47
|
+
pending: () => {
|
|
48
|
+
const nextWakeAt = runtime().nextWake();
|
|
49
|
+
return {
|
|
50
|
+
due: nextWakeAt !== null && nextWakeAt <= Date.now(),
|
|
51
|
+
nextWakeAt,
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
run: drain,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
host,
|
|
60
|
+
deliver: (value) => mail.send(value),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColdSessionPage, ColdSessionPageRequest } from "@fungi.computer/shiitake";
|
|
2
|
+
import type { CloudflareShiitakeOptions } from "@fungi.computer/shiitake/cloudflare";
|
|
3
|
+
import { type DurableObjectSizedStorage } from "@fungi.computer/zookeeper";
|
|
4
|
+
/**
|
|
5
|
+
* An Oyster Agent's store keeping: Zookeeper's admission check and patrol over
|
|
6
|
+
* the one Durable Object budget. Shiitake's agent pack only; the Pi Durable
|
|
7
|
+
* pack keeps its own store.
|
|
8
|
+
*/
|
|
9
|
+
export declare function agentStoreKeeping(storage: DurableObjectSizedStorage, readColdSessions: (request: ColdSessionPageRequest) => Promise<ColdSessionPage>): Required<Pick<CloudflareShiitakeOptions, "hostWork" | "storagePressure">>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { durableObjectStorageBudget, openPatrol, openStoragePressure, } from "@fungi.computer/zookeeper";
|
|
2
|
+
/** Log what a Zookeeper patrol pass measured; a quiet store logs nothing. */
|
|
3
|
+
function reportPatrol(report) {
|
|
4
|
+
if (report.status === "quiet")
|
|
5
|
+
return;
|
|
6
|
+
if (report.status === "unavailable") {
|
|
7
|
+
console.warn("agent zookeeper patrol unavailable", {
|
|
8
|
+
stage: report.source,
|
|
9
|
+
code: report.failure,
|
|
10
|
+
});
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
console.info("agent zookeeper patrol measured", {
|
|
14
|
+
storeBytes: report.usedBytes,
|
|
15
|
+
sessionBytes: report.sessionBytes,
|
|
16
|
+
sessionCount: report.sessions,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An Oyster Agent's store keeping: Zookeeper's admission check and patrol over
|
|
21
|
+
* the one Durable Object budget. Shiitake's agent pack only; the Pi Durable
|
|
22
|
+
* pack keeps its own store.
|
|
23
|
+
*/
|
|
24
|
+
export function agentStoreKeeping(storage, readColdSessions) {
|
|
25
|
+
const budget = durableObjectStorageBudget(storage);
|
|
26
|
+
return {
|
|
27
|
+
hostWork: [openPatrol({ budget, readColdSessions, report: reportPatrol })],
|
|
28
|
+
storagePressure: openStoragePressure(budget),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type StandaloneTenancyEnv } from "./tenancy.js";
|
|
2
|
+
import type { PostEnvelope } from "@fungi.computer/carrier/post";
|
|
3
|
+
import { type StandaloneMachineLinkBindings, type StandaloneMachineJoinResult } from "./machine-link.js";
|
|
4
|
+
import { type MachineAgentSettlementPrincipal, type MachineAgentHome, type MachineEnrollment, type MachineLinkCaller, type MachineLinkIdentity } from "../machine-link/index.js";
|
|
2
5
|
import { DurableObject } from "cloudflare:workers";
|
|
3
6
|
import type { StandaloneComputerEnv } from "./computer.js";
|
|
4
7
|
import { ShiitakeDO } from "@fungi.computer/shiitake/cloudflare";
|
|
@@ -6,6 +9,7 @@ import type { CloudflareShiitakeOptions } from "@fungi.computer/shiitake/cloudfl
|
|
|
6
9
|
import { type AiBinding } from "@earendil-works/pi-ai/api/cloudflare-ai-binding";
|
|
7
10
|
import * as Schema from "effect/Schema";
|
|
8
11
|
import { type FrameBindingProps } from "../cloudflare.js";
|
|
12
|
+
import type { Avatar } from "@fungi.computer/sprite/avatar";
|
|
9
13
|
import type { InvocationFrame } from "../invocation.js";
|
|
10
14
|
import type { OysterJson } from "../host.js";
|
|
11
15
|
import { type FleetMessage } from "@fungi.computer/shiitake/fleet";
|
|
@@ -19,10 +23,12 @@ import { type AgentMcpServer, type AgentMcpServerInput, type AgentMcpServerRefus
|
|
|
19
23
|
import type { AgentPolicyActor, OysterAgents, OysterSessionRow } from "../agents.js";
|
|
20
24
|
/** The model door an agent runs on; Shiitake's own contract. */
|
|
21
25
|
export type StandaloneModelSource = CloudflareShiitakeOptions["model"];
|
|
22
|
-
/** One directory entry: an agent's id and
|
|
26
|
+
/** One directory entry: an agent's id, display name and own avatar. */
|
|
23
27
|
export type AgentEntry = Readonly<{
|
|
24
28
|
agentId: string;
|
|
29
|
+
createdBy: string | null;
|
|
25
30
|
name: string;
|
|
31
|
+
avatar: Avatar;
|
|
26
32
|
}>;
|
|
27
33
|
/** Bindings the agent host reads. */
|
|
28
34
|
export type StandaloneAgentsEnv = Readonly<{
|
|
@@ -49,7 +55,7 @@ export type StandaloneAgentsEnv = Readonly<{
|
|
|
49
55
|
AGENT_DIRECTORY: DurableObjectNamespace<AgentDirectory>;
|
|
50
56
|
}>;
|
|
51
57
|
/** An agent host's whole env: its own bindings and the Oyster's. */
|
|
52
|
-
export type StandaloneAgentEnv = StandaloneAgentsEnv & OysterWorkerEnv & StandaloneComputerEnv;
|
|
58
|
+
export type StandaloneAgentEnv = StandaloneAgentsEnv & OysterWorkerEnv & StandaloneComputerEnv & StandaloneMachineLinkBindings;
|
|
53
59
|
declare const policyDirectorySchema: Schema.Struct<{
|
|
54
60
|
readonly directoryName: Schema.NonEmptyString;
|
|
55
61
|
readonly tenantId: Schema.brand<Schema.String, "OysterTenantId">;
|
|
@@ -63,7 +69,24 @@ export type AgentInboxRows = Readonly<{
|
|
|
63
69
|
export declare abstract class StandaloneAgentBase<Env extends StandaloneAgentEnv = StandaloneAgentEnv> extends ShiitakeDO<Env> {
|
|
64
70
|
#private;
|
|
65
71
|
/** The deployable root's host for this Agent's pinned tenant. */
|
|
66
|
-
protected abstract hostFor(scope: TenantScope): OysterHost
|
|
72
|
+
protected abstract hostFor(scope: TenantScope): Promise<OysterHost>;
|
|
73
|
+
private uiOwner;
|
|
74
|
+
private machineClient;
|
|
75
|
+
private ui;
|
|
76
|
+
protected hostFetch(request: Request): Promise<Response> | undefined;
|
|
77
|
+
protected closeShiitake(): Promise<void>;
|
|
78
|
+
private controlDirectory;
|
|
79
|
+
private delegationOwner;
|
|
80
|
+
private delegation;
|
|
81
|
+
/** Host-only mail admission; an HTTP caller never receives this binding. */
|
|
82
|
+
deliver(envelope: PostEnvelope): Promise<import("@fungi.computer/carrier/post").PostDeliveryResult>;
|
|
83
|
+
private mailOwner;
|
|
84
|
+
private conversationAgentsOwner;
|
|
85
|
+
/** The Agents each of this Agent's conversations created or sent work to. */
|
|
86
|
+
private conversationAgents;
|
|
87
|
+
private mail;
|
|
88
|
+
/** Undefined is disclosure refusal; unavailable evidence fails before RPC. */
|
|
89
|
+
settlement(principal: MachineAgentSettlementPrincipal, sessionId: string, commandId: string): Promise<string | undefined>;
|
|
67
90
|
/** The root host for this Agent's pinned policy directory; unpinned Agents have no App tools. */
|
|
68
91
|
private appHost;
|
|
69
92
|
/** Choose this agent's model door; override to plug in another. */
|
|
@@ -85,7 +108,7 @@ export declare abstract class StandaloneAgentBase<Env extends StandaloneAgentEnv
|
|
|
85
108
|
addMcpServer(input: AgentMcpServerInput): Promise<AgentMcpServer | AgentMcpServerRefusal>;
|
|
86
109
|
/** Host-only: disconnect one MCP server. */
|
|
87
110
|
removeMcpServer(serverId: string): Promise<boolean>;
|
|
88
|
-
protected shiitakeOptions(): CloudflareShiitakeOptions
|
|
111
|
+
protected shiitakeOptions(): Promise<CloudflareShiitakeOptions>;
|
|
89
112
|
/** Send an installation-admitted message through fleet Session operations. */
|
|
90
113
|
sendFromApp(installationId: string, sessionId: string, message: FleetMessage): Promise<{
|
|
91
114
|
sessionId: string;
|
|
@@ -100,7 +123,45 @@ export declare abstract class StandaloneAgentBase<Env extends StandaloneAgentEnv
|
|
|
100
123
|
/** Names this Oyster's agents and remembers which Sessions the member opened. */
|
|
101
124
|
export declare class AgentDirectory extends DurableObject<StandaloneAgentEnv> {
|
|
102
125
|
private readonly directory;
|
|
126
|
+
private readonly avatars;
|
|
103
127
|
private composedTenancy;
|
|
128
|
+
private machineEnrollmentOwner;
|
|
129
|
+
private machineFencesOwner;
|
|
130
|
+
private machineScope;
|
|
131
|
+
private machineEnrollment;
|
|
132
|
+
/** Host-only join: consumption, enrollment and directory share one commit. */
|
|
133
|
+
enrollMachine(keyId: string, input: MachineEnrollment): Promise<StandaloneMachineJoinResult>;
|
|
134
|
+
machineDevice(id: MachineLinkIdentity): Promise<import("../machine-link/authority.js").MachineLinkDeviceFacts>;
|
|
135
|
+
machineFence(id: MachineLinkIdentity): Promise<Readonly<{
|
|
136
|
+
teamId: string;
|
|
137
|
+
deviceId: string;
|
|
138
|
+
} & {
|
|
139
|
+
live: boolean;
|
|
140
|
+
fenceEpoch: number;
|
|
141
|
+
}> | null>;
|
|
142
|
+
machineDirectory(id: MachineLinkIdentity): Promise<{
|
|
143
|
+
agentId: import("@fungi.computer/shiitake/fleet").AgentId;
|
|
144
|
+
name: string;
|
|
145
|
+
}[]>;
|
|
146
|
+
machineTarget(caller: MachineLinkCaller, agentId: string, requester: string | null): Promise<Readonly<{
|
|
147
|
+
teamId: string;
|
|
148
|
+
callerAgentId: string;
|
|
149
|
+
targetAgentId: string;
|
|
150
|
+
actorAgentId: string;
|
|
151
|
+
callerHome: MachineAgentHome;
|
|
152
|
+
targetHome: MachineAgentHome;
|
|
153
|
+
}>>;
|
|
154
|
+
machineKeyRetired(deviceId: string): boolean;
|
|
155
|
+
/** Catalog home only; no hosted DO is opened to discover a machine home. */
|
|
156
|
+
agentHome(agentId: string): Promise<MachineAgentHome | null>;
|
|
157
|
+
private machineFences;
|
|
158
|
+
private armMachineFenceAlarm;
|
|
159
|
+
/** Only the current canonical owner can retire a device, before fence push. */
|
|
160
|
+
revokeMachineDevice(memberId: string, deviceId: string): Promise<{
|
|
161
|
+
kind: "unconfirmed" | "confirmed";
|
|
162
|
+
fenceEpoch: number;
|
|
163
|
+
} | null>;
|
|
164
|
+
alarm(): Promise<void>;
|
|
104
165
|
private grant;
|
|
105
166
|
constructor(ctx: DurableObjectState, env: StandaloneAgentEnv);
|
|
106
167
|
list(): readonly AgentEntry[];
|
|
@@ -111,7 +172,11 @@ export declare class AgentDirectory extends DurableObject<StandaloneAgentEnv> {
|
|
|
111
172
|
rename(agentId: string, name: string, principal: OysterPrincipal): AgentEntry | Readonly<{
|
|
112
173
|
error: "not_found" | "name_taken" | "not_granted";
|
|
113
174
|
}>;
|
|
114
|
-
|
|
175
|
+
/** Owner-only avatar change; the Agent wears it in every App and list. */
|
|
176
|
+
setAvatar(agentId: string, avatar: Avatar, principal: OysterPrincipal): AgentEntry | Readonly<{
|
|
177
|
+
error: "not_found" | "not_granted";
|
|
178
|
+
}>;
|
|
179
|
+
create(name: string, requestId: string, principal: OysterPrincipal, actor: AgentPolicyActor, avatar?: Avatar, createdBy?: string | null): AgentEntry & {
|
|
115
180
|
policyRevision: string | null;
|
|
116
181
|
};
|
|
117
182
|
private writePolicy;
|
|
@@ -153,10 +218,10 @@ export declare const agentFrameMethods: {
|
|
|
153
218
|
decodeResult: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
154
219
|
readonly items: readonly ({
|
|
155
220
|
readonly agentId: string;
|
|
156
|
-
readonly title: string;
|
|
157
|
-
readonly state: "done" | "running" | "needs_you" | "errored";
|
|
158
|
-
readonly createdAt: number;
|
|
159
221
|
readonly sessionId: string;
|
|
222
|
+
readonly createdAt: number;
|
|
223
|
+
readonly title: string;
|
|
224
|
+
readonly state: "done" | "running" | "errored" | "needs_you";
|
|
160
225
|
readonly lastActivityAt: number;
|
|
161
226
|
readonly triggerId?: string | undefined;
|
|
162
227
|
readonly settledAt?: number | undefined;
|
|
@@ -166,21 +231,21 @@ export declare const agentFrameMethods: {
|
|
|
166
231
|
readonly sessionId: string;
|
|
167
232
|
readonly state: "unavailable";
|
|
168
233
|
} | {
|
|
169
|
-
readonly kind: "workflow-review";
|
|
170
|
-
readonly installationId: string;
|
|
171
234
|
readonly key: {
|
|
172
235
|
readonly runId: string;
|
|
173
236
|
readonly nodeId: string;
|
|
174
237
|
readonly iteration: string;
|
|
175
238
|
};
|
|
176
|
-
readonly
|
|
239
|
+
readonly kind: "workflow-review";
|
|
240
|
+
readonly installationId: string;
|
|
241
|
+
readonly expiresAt: number;
|
|
177
242
|
readonly workflowId: string | null;
|
|
243
|
+
readonly state: "pending" | "delivered" | "answered" | "timed_out" | "closed";
|
|
178
244
|
readonly workflowTitle: string;
|
|
179
245
|
readonly reviewTitle: string;
|
|
180
246
|
readonly reviewers: "runner" | "owners";
|
|
181
247
|
readonly show: readonly Schema.Json[];
|
|
182
248
|
readonly openedAt: number;
|
|
183
|
-
readonly expiresAt: number;
|
|
184
249
|
readonly choices?: readonly string[] | undefined;
|
|
185
250
|
})[];
|
|
186
251
|
readonly next: null;
|
|
@@ -204,6 +269,7 @@ export declare const agentFrameMethods: {
|
|
|
204
269
|
decodeArgs: (raw: readonly unknown[]) => [{
|
|
205
270
|
agentId: string;
|
|
206
271
|
sessionId: string;
|
|
272
|
+
requestId: string;
|
|
207
273
|
text: string;
|
|
208
274
|
delivery: "followUp";
|
|
209
275
|
}];
|