@fungi.computer/oyster 0.28.1 → 0.29.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 +4 -0
- package/dist/apps/catalog.js +1 -1
- package/dist/apps/gate.d.ts +2 -1
- package/dist/apps/gate.js +10 -7
- package/dist/apps/index.d.ts +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/apps/installation.d.ts +27 -5
- package/dist/apps/installation.js +86 -29
- package/dist/apps/operations.d.ts +5 -0
- package/dist/apps/operations.js +49 -10
- package/dist/apps/permissions.d.ts +23 -7
- package/dist/apps/permissions.js +5 -1
- package/dist/authorization.d.ts +2 -1
- package/dist/boot-host-script.js +1 -1
- package/dist/build/candidate-cli.mjs +1823 -1833
- package/dist/embed-metafiles.js +2 -2
- package/dist/embed-scripts.js +1 -1
- package/dist/host.js +7 -2
- package/dist/installation-migration.d.ts +5 -0
- package/dist/installation-migration.js +78 -0
- package/dist/installation-operations.d.ts +8 -0
- package/dist/installation-operations.js +2 -0
- package/dist/invocation.d.ts +3 -3
- package/dist/page-script.js +2 -2
- package/dist/standalone/computer.d.ts +2 -2
- package/dist/standalone/registry.d.ts +2 -2
- package/dist/standalone/workflow-host.d.ts +6 -1
- package/dist/tenancy/cloudflare/registry.js +6 -2
- package/dist/tenancy/contracts.d.ts +4 -3
- package/dist/tenancy/index.js +2 -1
- package/dist/tenant.d.ts +2 -1
- package/dist/workers.js +2 -0
- package/docs/api/apps.md +108 -81
- package/docs/api/authorization.md +1 -1
- package/docs/api/git.md +4 -4
- package/docs/api/host.md +8 -2
- package/docs/api/invocation.md +87 -87
- package/docs/api/mcp.md +16 -16
- package/docs/api/tenancy.md +3 -3
- package/docs/api/tenant.md +1 -1
- package/docs/api/workers-git.md +157 -157
- package/docs/api/workers.md +231 -221
- package/package.json +17 -17
|
@@ -105,7 +105,7 @@ export declare class ComputerDO extends NativeComputerDO implements ComputerFetc
|
|
|
105
105
|
backendId: string;
|
|
106
106
|
error?: undefined;
|
|
107
107
|
} | {
|
|
108
|
-
error: "request_conflict" | "invalid" | "
|
|
108
|
+
error: "request_conflict" | "invalid" | "unknown_computer" | "not_enabled" | "local_limit" | "not_owner";
|
|
109
109
|
backendId?: undefined;
|
|
110
110
|
};
|
|
111
111
|
/** Detach the owner's machine and close its live connection. */
|
|
@@ -113,7 +113,7 @@ export declare class ComputerDO extends NativeComputerDO implements ComputerFetc
|
|
|
113
113
|
detached: boolean;
|
|
114
114
|
error?: undefined;
|
|
115
115
|
} | {
|
|
116
|
-
error: "request_conflict" | "invalid" | "
|
|
116
|
+
error: "request_conflict" | "invalid" | "unknown_computer" | "not_enabled" | "local_limit" | "not_owner";
|
|
117
117
|
detached?: undefined;
|
|
118
118
|
};
|
|
119
119
|
/** An admitted fleet control starts exactly this Computer's hosted backend. */
|
|
@@ -85,13 +85,13 @@ export declare abstract class StandaloneRegistry extends OysterRegistry implemen
|
|
|
85
85
|
backendId: string;
|
|
86
86
|
error?: undefined;
|
|
87
87
|
} & Disposable) | ({
|
|
88
|
-
error: "request_conflict" | "invalid" | "
|
|
88
|
+
error: "request_conflict" | "invalid" | "unknown_computer" | "not_enabled" | "local_limit" | "not_owner";
|
|
89
89
|
backendId?: undefined;
|
|
90
90
|
} & Disposable) | ({
|
|
91
91
|
detached: boolean;
|
|
92
92
|
error?: undefined;
|
|
93
93
|
} & Disposable) | ({
|
|
94
|
-
error: "request_conflict" | "invalid" | "
|
|
94
|
+
error: "request_conflict" | "invalid" | "unknown_computer" | "not_enabled" | "local_limit" | "not_owner";
|
|
95
95
|
detached?: undefined;
|
|
96
96
|
} & Disposable) | {
|
|
97
97
|
backends: {
|
|
@@ -106,6 +106,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
106
106
|
capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
107
107
|
capabilityApproved: true;
|
|
108
108
|
operations: readonly string[];
|
|
109
|
+
fingerprints: Readonly<Record<string, string>>;
|
|
109
110
|
resources: "tenant-scope" | readonly Readonly<{
|
|
110
111
|
kind: string;
|
|
111
112
|
id: string;
|
|
@@ -165,7 +166,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
165
166
|
method: string;
|
|
166
167
|
seal: string;
|
|
167
168
|
} | undefined;
|
|
168
|
-
role?: "member" | "owner" | undefined;
|
|
169
|
+
role?: "member" | "owner" | "admin" | undefined;
|
|
169
170
|
soleMember?: true | undefined;
|
|
170
171
|
workflow?: {
|
|
171
172
|
workflowId: string;
|
|
@@ -223,6 +224,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
223
224
|
capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
224
225
|
capabilityApproved: true;
|
|
225
226
|
operations: readonly string[];
|
|
227
|
+
fingerprints: Readonly<Record<string, string>>;
|
|
226
228
|
resources: "tenant-scope" | readonly Readonly<{
|
|
227
229
|
kind: string;
|
|
228
230
|
id: string;
|
|
@@ -290,6 +292,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
290
292
|
capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
291
293
|
capabilityApproved: true;
|
|
292
294
|
operations: readonly string[];
|
|
295
|
+
fingerprints: Readonly<Record<string, string>>;
|
|
293
296
|
resources: "tenant-scope" | readonly Readonly<{
|
|
294
297
|
kind: string;
|
|
295
298
|
id: string;
|
|
@@ -390,6 +393,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
390
393
|
capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
391
394
|
capabilityApproved: true;
|
|
392
395
|
operations: readonly string[];
|
|
396
|
+
fingerprints: Readonly<Record<string, string>>;
|
|
393
397
|
resources: "tenant-scope" | readonly Readonly<{
|
|
394
398
|
kind: string;
|
|
395
399
|
id: string;
|
|
@@ -471,6 +475,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
471
475
|
capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.instructions" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "media.share" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
|
|
472
476
|
capabilityApproved: true;
|
|
473
477
|
operations: readonly string[];
|
|
478
|
+
fingerprints: Readonly<Record<string, string>>;
|
|
474
479
|
resources: "tenant-scope" | readonly Readonly<{
|
|
475
480
|
kind: string;
|
|
476
481
|
id: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { teamRoles } from "@fungi.computer/cairn/team-role";
|
|
1
2
|
import { DurableObject } from "cloudflare:workers";
|
|
2
3
|
import * as Schema from "effect/Schema";
|
|
3
4
|
import { tenantIdSchema } from "../../tenant.js";
|
|
@@ -11,7 +12,7 @@ const tenantRow = Schema.Struct({
|
|
|
11
12
|
});
|
|
12
13
|
const membershipRow = Schema.Struct({
|
|
13
14
|
member_id: Schema.NonEmptyString,
|
|
14
|
-
role: Schema.Literals(
|
|
15
|
+
role: Schema.Literals(teamRoles),
|
|
15
16
|
membership_version: membershipVersionSchema,
|
|
16
17
|
});
|
|
17
18
|
const memberRow = Schema.Struct({ member_id: Schema.NonEmptyString });
|
|
@@ -33,7 +34,7 @@ const tenantAdmissionSchema = Schema.Struct({
|
|
|
33
34
|
}),
|
|
34
35
|
membership: Schema.NullOr(Schema.Struct({
|
|
35
36
|
memberId: Schema.NonEmptyString,
|
|
36
|
-
role: Schema.Literals(
|
|
37
|
+
role: Schema.Literals(teamRoles),
|
|
37
38
|
membershipVersion: membershipVersionSchema,
|
|
38
39
|
})),
|
|
39
40
|
}).pipe(Schema.brand("TenantAdmission"));
|
|
@@ -46,6 +47,9 @@ const createSchema = Schema.Struct({
|
|
|
46
47
|
class RegistryObject extends DurableObject {
|
|
47
48
|
constructor(ctx) {
|
|
48
49
|
super(ctx, {});
|
|
50
|
+
// A self-hosted Oyster stores only owner and member rows (the Team's admin role
|
|
51
|
+
// lives in Hub's Colony); the CHECK stays so existing stores open in place. Reads
|
|
52
|
+
// decode the shared TeamRole.
|
|
49
53
|
// Pre-launch registries require a fresh store; CREATE IF NOT EXISTS does not
|
|
50
54
|
// upgrade an old memberships table. No incremental migration is supported.
|
|
51
55
|
// DEFAULT 1 is only an insert placeholder: the AFTER INSERT trigger replaces
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TeamRole } from "@fungi.computer/cairn/team-role";
|
|
1
2
|
import type { OysterTenancy } from "../tenant.js";
|
|
2
3
|
import type { TenantId, TenantPrincipal, TenantScope } from "../tenant.js";
|
|
3
4
|
import type { Hono, MiddlewareHandler } from "hono";
|
|
@@ -30,7 +31,7 @@ export type Membership = Readonly<{
|
|
|
30
31
|
/** Canonical member ID minted or supplied by the registry owner. */
|
|
31
32
|
memberId: string;
|
|
32
33
|
/** Authority granted by this tenant's membership record. */
|
|
33
|
-
role:
|
|
34
|
+
role: TeamRole;
|
|
34
35
|
/** Positive safe revision owned by the registry; changes never reuse a deleted membership's revision. */
|
|
35
36
|
membershipVersion: number;
|
|
36
37
|
}>;
|
|
@@ -176,8 +177,8 @@ export type ReadonlyTenancy<Kind extends "origin" | "path" = "origin" | "path">
|
|
|
176
177
|
}>) | null>;
|
|
177
178
|
/** Admit requests and populate Hono context before reaching protected handlers. */
|
|
178
179
|
middleware(options?: Readonly<{
|
|
179
|
-
/** Require
|
|
180
|
-
role?:
|
|
180
|
+
/** Require at least this role; a higher role satisfies a lower one, keys/Agents satisfy neither. */
|
|
181
|
+
role?: TeamRole;
|
|
181
182
|
}>): MiddlewareHandler<{
|
|
182
183
|
/** Context fields supplied only after successful tenant admission. */
|
|
183
184
|
Variables: TenancyVariables;
|
package/dist/tenancy/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { teamRoleAtLeast } from "@fungi.computer/cairn/team-role";
|
|
1
2
|
import { isTenantOriginScheme } from "./registry-record.js";
|
|
2
3
|
import { createOysterTenancy } from "./oyster.js";
|
|
3
4
|
import { tenantScope } from "../tenant.js";
|
|
@@ -104,7 +105,7 @@ export function createTenancy(config) {
|
|
|
104
105
|
if (options.role !== undefined &&
|
|
105
106
|
(principal.actor.kind !== "member" ||
|
|
106
107
|
!("role" in principal) ||
|
|
107
|
-
(
|
|
108
|
+
!teamRoleAtLeast(principal.role, options.role)))
|
|
108
109
|
return context.json({ error: "forbidden" }, 403);
|
|
109
110
|
context.set("tenant", admission.tenant);
|
|
110
111
|
context.set("principal", principal);
|
package/dist/tenant.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TeamRole } from "@fungi.computer/cairn/team-role";
|
|
1
2
|
import type { HostActor } from "@fungi.computer/puffball/app-method-runtime";
|
|
2
3
|
import * as Schema from "effect/Schema";
|
|
3
4
|
import type { OysterAuth } from "./host.js";
|
|
@@ -16,7 +17,7 @@ export type TenantPrincipal = Readonly<{
|
|
|
16
17
|
kind: "member";
|
|
17
18
|
}>;
|
|
18
19
|
/** The member's admitted role; membership does not imply ownership. */
|
|
19
|
-
role:
|
|
20
|
+
role: TeamRole;
|
|
20
21
|
/** The host attests this member is the tenant's only member. */
|
|
21
22
|
soleMember?: true;
|
|
22
23
|
}> | Readonly<{
|
package/dist/workers.js
CHANGED
|
@@ -10,6 +10,7 @@ import { BOOT_DEADLINE_MS, BOOT_TRANSPORT_GRACE_MS, readBootUi, } from "./boot-g
|
|
|
10
10
|
import { checkBootPage } from "./browser/boot.js";
|
|
11
11
|
import { bindingSessions } from "./browser/sessions.js";
|
|
12
12
|
import { registryInstallations } from "./internal/registry-installations.js";
|
|
13
|
+
import { migrateInstallationRows } from "./installation-migration.js";
|
|
13
14
|
import { installationsFromOlderOyster } from "./older-oyster-store.js";
|
|
14
15
|
import { refuseOlderOysterStore } from "./older-oyster-store-refusal.js";
|
|
15
16
|
import { createInstallationOperations, } from "./installation-operations.js";
|
|
@@ -162,6 +163,7 @@ export class OysterRegistry extends DurableObject {
|
|
|
162
163
|
this.#installationsFromOlderOyster = installationsFromOlderOyster(ctx.storage.sql);
|
|
163
164
|
ctx.storage.sql.exec("CREATE TABLE IF NOT EXISTS oyster_approval_home (id INTEGER PRIMARY KEY CHECK (id = 1), tenant_id TEXT NOT NULL, origin TEXT NOT NULL) STRICT");
|
|
164
165
|
ctx.storage.sql.exec("CREATE TABLE IF NOT EXISTS installations (installation_id TEXT PRIMARY KEY, record TEXT NOT NULL) STRICT");
|
|
166
|
+
migrateInstallationRows(ctx.storage);
|
|
165
167
|
this.#installationStore = createInstallationStoreGeneration(ctx.storage);
|
|
166
168
|
ctx.storage.sql.exec("CREATE TABLE IF NOT EXISTS boot_capabilities (id TEXT PRIMARY KEY, token_digest TEXT NOT NULL, expires_at INTEGER NOT NULL, record TEXT NOT NULL) STRICT");
|
|
167
169
|
ensureAppSourceTables(ctx.storage.sql);
|