@fungi.computer/oyster 0.28.2 → 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/index.d.ts +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/apps/installation.d.ts +4 -3
- package/dist/apps/installation.js +21 -19
- 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/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 +1 -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/docs/api/apps.md +21 -8
- package/docs/api/authorization.md +1 -1
- package/docs/api/git.md +1 -1
- package/docs/api/host.md +2 -2
- package/docs/api/invocation.md +87 -87
- 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 +177 -177
- 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: {
|
|
@@ -166,7 +166,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
|
|
|
166
166
|
method: string;
|
|
167
167
|
seal: string;
|
|
168
168
|
} | undefined;
|
|
169
|
-
role?: "member" | "owner" | undefined;
|
|
169
|
+
role?: "member" | "owner" | "admin" | undefined;
|
|
170
170
|
soleMember?: true | undefined;
|
|
171
171
|
workflow?: {
|
|
172
172
|
workflowId: 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/docs/api/apps.md
CHANGED
|
@@ -244,7 +244,7 @@ Consent and resource semantics belong to the grant owner, not its UI.
|
|
|
244
244
|
```ts
|
|
245
245
|
type HostPrincipal = Readonly<{
|
|
246
246
|
actor: HostActor;
|
|
247
|
-
role:
|
|
247
|
+
role: TeamRole | null;
|
|
248
248
|
}>;
|
|
249
249
|
```
|
|
250
250
|
|
|
@@ -430,7 +430,7 @@ host-owned.
|
|
|
430
430
|
```ts
|
|
431
431
|
type GrantRefusal = Readonly<{
|
|
432
432
|
kind: "refused";
|
|
433
|
-
code: "stale_authority" | "
|
|
433
|
+
code: "stale_authority" | "not_approver" | "not_declared" | "invalid_command";
|
|
434
434
|
}>;
|
|
435
435
|
```
|
|
436
436
|
|
|
@@ -494,7 +494,7 @@ host-owned.
|
|
|
494
494
|
```ts
|
|
495
495
|
type InstallationContext = Readonly<{
|
|
496
496
|
by: HostActor;
|
|
497
|
-
role:
|
|
497
|
+
role: TeamRole | null;
|
|
498
498
|
expectedVersion: number | null;
|
|
499
499
|
declaration: AppDeclaration;
|
|
500
500
|
declaredOperations: DeclaredOperations;
|
|
@@ -1110,6 +1110,18 @@ Installation names cannot contain the tenant separator.
|
|
|
1110
1110
|
|
|
1111
1111
|
---
|
|
1112
1112
|
|
|
1113
|
+
### unstampedFingerprint
|
|
1114
|
+
|
|
1115
|
+
```ts
|
|
1116
|
+
const unstampedFingerprint: "unstamped" = "unstamped";
|
|
1117
|
+
```
|
|
1118
|
+
|
|
1119
|
+
Stands in for the fingerprint of an operation approved before fingerprints
|
|
1120
|
+
existed. The storage migration writes it; the first snapshot that carries the
|
|
1121
|
+
operation by name replaces it with the declared fingerprint (`carryGrant`).
|
|
1122
|
+
|
|
1123
|
+
---
|
|
1124
|
+
|
|
1113
1125
|
### approvedGrantSchema
|
|
1114
1126
|
|
|
1115
1127
|
```ts
|
|
@@ -1484,7 +1496,7 @@ const installationRefusalSchema: ZodLazy<
|
|
|
1484
1496
|
stale_authority: "stale_authority";
|
|
1485
1497
|
not_declared: "not_declared";
|
|
1486
1498
|
release_app_mismatch: "release_app_mismatch";
|
|
1487
|
-
|
|
1499
|
+
not_approver: "not_approver";
|
|
1488
1500
|
invalid_command: "invalid_command";
|
|
1489
1501
|
}>;
|
|
1490
1502
|
},
|
|
@@ -1924,7 +1936,8 @@ function applyGrantCommand(
|
|
|
1924
1936
|
},
|
|
1925
1937
|
Readonly<{
|
|
1926
1938
|
kind: "refused";
|
|
1927
|
-
code:
|
|
1939
|
+
code:
|
|
1940
|
+
"stale_authority" | "not_declared" | "not_approver" | "invalid_command";
|
|
1928
1941
|
}>
|
|
1929
1942
|
>;
|
|
1930
1943
|
```
|
|
@@ -1960,7 +1973,7 @@ readonly `string`[]; `fingerprints`: `Readonly`\<`Record`\<`string`,
|
|
|
1960
1973
|
`"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`:
|
|
1961
1974
|
`string`; \}; `at`: `number`; `authorityVersion`: `number`; \}\> \| `null`; \},
|
|
1962
1975
|
`Readonly`\<\{ `kind`: `"refused"`; `code`: `"stale_authority"` \|
|
|
1963
|
-
`"not_declared"` \| `"
|
|
1976
|
+
`"not_declared"` \| `"not_approver"` \| `"invalid_command"`; \}\>\>
|
|
1964
1977
|
|
|
1965
1978
|
---
|
|
1966
1979
|
|
|
@@ -1983,7 +1996,7 @@ function applyInstallationCommand(
|
|
|
1983
1996
|
| "stale_authority"
|
|
1984
1997
|
| "not_declared"
|
|
1985
1998
|
| "release_app_mismatch"
|
|
1986
|
-
| "
|
|
1999
|
+
| "not_approver"
|
|
1987
2000
|
| "invalid_command";
|
|
1988
2001
|
}
|
|
1989
2002
|
>;
|
|
@@ -2004,7 +2017,7 @@ Pure transition; hosts retain transactions, receipts, epochs and delivery.
|
|
|
2004
2017
|
`Result`\<`Readonly`\<\{ `next`: [`Installation`](#installation);
|
|
2005
2018
|
`authorityChanged`: `boolean`; \}\>, \{ `kind`: `"refused"`; `code`: \|
|
|
2006
2019
|
`"unavailable"` \| `"stale_authority"` \| `"not_declared"` \|
|
|
2007
|
-
`"release_app_mismatch"` \| `"
|
|
2020
|
+
`"release_app_mismatch"` \| `"not_approver"` \| `"invalid_command"`; \}\>
|
|
2008
2021
|
|
|
2009
2022
|
---
|
|
2010
2023
|
|
package/docs/api/git.md
CHANGED
package/docs/api/host.md
CHANGED
|
@@ -270,13 +270,13 @@ type OysterGitHost = Readonly<{
|
|
|
270
270
|
workflowPass?: Promise<Readonly<{
|
|
271
271
|
kind: "actor";
|
|
272
272
|
actor: HostActor;
|
|
273
|
-
role?:
|
|
273
|
+
role?: TeamRole;
|
|
274
274
|
workflow?: WorkflowAttestation & object;
|
|
275
275
|
}> | null>;
|
|
276
276
|
buildPass?: Promise<Readonly<{
|
|
277
277
|
kind: "actor";
|
|
278
278
|
actor: HostActor;
|
|
279
|
-
role?:
|
|
279
|
+
role?: TeamRole;
|
|
280
280
|
workflow?: WorkflowAttestation & object;
|
|
281
281
|
}> | null>;
|
|
282
282
|
git: Promise<
|