@fungi.computer/oyster 0.42.0 → 0.43.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/dist/app-storage.d.ts +13 -1
- package/dist/app-storage.js +35 -2
- package/dist/host.d.ts +1 -1
- package/dist/host.js +9 -1
- package/dist/page/mount.d.ts +1 -0
- package/dist/page/storage.js +7 -1
- package/dist/page-script.js +1 -1
- package/dist/root-data.d.ts +10 -0
- package/dist/workers.d.ts +3 -1
- package/dist/workers.js +5 -0
- package/docs/api/host.md +1 -1
- package/docs/api/page/mount.md +5 -5
- package/docs/api/workers.md +50 -17
- package/package.json +10 -10
package/dist/root-data.d.ts
CHANGED
|
@@ -62,6 +62,11 @@ export declare function createOysterRootData(options: OysterRootDataOptions): {
|
|
|
62
62
|
reset: (input: import("@fungi.computer/agar").AppStorageReset) => import("effect/Effect").Effect<{
|
|
63
63
|
revision: number;
|
|
64
64
|
}, import("@fungi.computer/agar").AppStorageError, never>;
|
|
65
|
+
claim: (input: import("@fungi.computer/agar/storage-wire").AppStorageClaim) => import("effect/Effect").Effect<{
|
|
66
|
+
readonly value: import("effect/Schema").Json;
|
|
67
|
+
readonly revision: number;
|
|
68
|
+
readonly claimed: boolean;
|
|
69
|
+
}, import("@fungi.computer/agar").AppStorageError, never>;
|
|
65
70
|
};
|
|
66
71
|
open(authorize: () => import("effect/Effect").Effect<import("./app-storage.js").AppStorageAdmission, Error>): {
|
|
67
72
|
read: (key: string) => import("effect/Effect").Effect<{
|
|
@@ -83,6 +88,11 @@ export declare function createOysterRootData(options: OysterRootDataOptions): {
|
|
|
83
88
|
reset: (input: import("@fungi.computer/agar").AppStorageReset) => import("effect/Effect").Effect<{
|
|
84
89
|
revision: number;
|
|
85
90
|
}, import("@fungi.computer/agar").AppStorageError, never>;
|
|
91
|
+
claim: (input: import("@fungi.computer/agar/storage-wire").AppStorageClaim) => import("effect/Effect").Effect<{
|
|
92
|
+
readonly value: import("effect/Schema").Json;
|
|
93
|
+
readonly revision: number;
|
|
94
|
+
readonly claimed: boolean;
|
|
95
|
+
}, import("@fungi.computer/agar").AppStorageError, never>;
|
|
86
96
|
events: (key: string) => import("effect/Stream").Stream<{
|
|
87
97
|
readonly appId: string;
|
|
88
98
|
readonly key: string;
|
package/dist/workers.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { r2ArtifactStore, type FrameBindingReply, type FrameBindingMethod, type
|
|
|
26
26
|
import type { AppTestCopy, AppTestCopyAuthority } from "./app-test-copies.js";
|
|
27
27
|
import { type BackgroundFrameState, type InvocationFacts, type InvocationFrame } from "./invocation.js";
|
|
28
28
|
import { type InstallationCommit, type InstanceResult, type OysterAuth, type OysterHost, type OysterJson } from "./host.js";
|
|
29
|
-
import { type AppStorageResult, type AppStorageWrite, type AppStorageReset, type ResolvedAppStorage } from "@fungi.computer/agar/storage";
|
|
29
|
+
import { type AppStorageResult, type AppStorageWrite, type AppStorageReset, type AppStorageClaim, type AppStorageClaimed, type ResolvedAppStorage } from "@fungi.computer/agar/storage";
|
|
30
30
|
import { type OysterRootDirectory } from "./root-data.js";
|
|
31
31
|
import type { AppApi } from "@fungi.computer/puffball";
|
|
32
32
|
import type { AppDeclaration } from "@fungi.computer/puffball/app";
|
|
@@ -209,6 +209,8 @@ export declare class OysterRegistry<Env extends OysterWorkerEnv = OysterWorkerEn
|
|
|
209
209
|
storageReset(installationId: string, ownerId: string, input: AppStorageReset): Promise<AppStorageResult<{
|
|
210
210
|
revision: number;
|
|
211
211
|
}>>;
|
|
212
|
+
/** Claim one declared absent layer for the authenticated root owner, or read the layer already there. */
|
|
213
|
+
storageClaim(installationId: string, ownerId: string, input: AppStorageClaim): Promise<AppStorageResult<AppStorageClaimed>>;
|
|
212
214
|
/** Storage for a live owner method frame; no guest-selected installation or member. */
|
|
213
215
|
storageBackend(raw: InvocationFacts, method: string, args: readonly unknown[], tenantId: TenantId): Promise<OysterBindingResult>;
|
|
214
216
|
/** Open the existing App-storage invalidation stream under fresh owner admission. */
|
package/dist/workers.js
CHANGED
|
@@ -247,6 +247,10 @@ export class OysterRegistry extends DurableObject {
|
|
|
247
247
|
storageReset(installationId, ownerId, input) {
|
|
248
248
|
return this.storageResult(this.storageView(installationId, () => Promise.resolve(ownerId)).reset(input));
|
|
249
249
|
}
|
|
250
|
+
/** Claim one declared absent layer for the authenticated root owner, or read the layer already there. */
|
|
251
|
+
storageClaim(installationId, ownerId, input) {
|
|
252
|
+
return this.storageResult(this.storageView(installationId, () => Promise.resolve(ownerId)).claim(input));
|
|
253
|
+
}
|
|
250
254
|
/** Storage for a live owner method frame; no guest-selected installation or member. */
|
|
251
255
|
storageBackend(raw, method, args, tenantId) {
|
|
252
256
|
const facts = Schema.decodeUnknownSync(invocationFactsSchema, {
|
|
@@ -1419,6 +1423,7 @@ export function oysterWorkerHost(env, auth, options = {}) {
|
|
|
1419
1423
|
read: (key) => registry().storageRead(installationId, ownerId, key),
|
|
1420
1424
|
write: (input) => registry().storageWrite(installationId, ownerId, input),
|
|
1421
1425
|
reset: (input) => registry().storageReset(installationId, ownerId, input),
|
|
1426
|
+
claim: (input) => registry().storageClaim(installationId, ownerId, input),
|
|
1422
1427
|
events: (key) => registry().storageEvents(installationId, ownerId, key),
|
|
1423
1428
|
}),
|
|
1424
1429
|
},
|
package/docs/api/host.md
CHANGED
|
@@ -528,7 +528,7 @@ type OysterHost = Readonly<{
|
|
|
528
528
|
}>;
|
|
529
529
|
installing?: readonly InstallingApp[];
|
|
530
530
|
}>>;
|
|
531
|
-
storage: Pick<AppStorageWire, "read" | "write" | "reset"> & Readonly<{
|
|
531
|
+
storage: Pick<AppStorageWire, "read" | "write" | "reset" | "claim"> & Readonly<{
|
|
532
532
|
events: Promise<Response>;
|
|
533
533
|
}>;
|
|
534
534
|
}>;
|
package/docs/api/page/mount.md
CHANGED
|
@@ -239,11 +239,11 @@ would, without a frame between the shell and its host.
|
|
|
239
239
|
|
|
240
240
|
`object`
|
|
241
241
|
|
|
242
|
-
| Name | Type
|
|
243
|
-
| --------- |
|
|
244
|
-
| `storage` | \| `Readonly`\<\{ `read`: `Promise`\<\{ `value`: `Json`; `source`: `"member"` \| `"team"` \| `"none"`; `team`: \| \{ `value`: `Json`; `revision`: `number`; \} \| `null`; `member`: \| \{ `value`: `Json`; `revision`: `number`; \} \| `null`; `canWriteTeam`: `boolean`; \}\>; `write`: `Promise`\<\{ `revision`: `number`; \}\>; `reset`: `Promise`\<\{ `revision`: `number`; \}\>; `watch`: `Promise`\<`AppStorageWatch`\>; \}\> \| `null` | - |
|
|
245
|
-
| `methods` | `object`
|
|
246
|
-
| `call()` | (`method`, `input`) => `Promise`\<`WhistleJsonValue`\>
|
|
242
|
+
| Name | Type | Description |
|
|
243
|
+
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
244
|
+
| `storage` | \| `Readonly`\<\{ `read`: `Promise`\<\{ `value`: `Json`; `source`: `"member"` \| `"team"` \| `"none"`; `team`: \| \{ `value`: `Json`; `revision`: `number`; \} \| `null`; `member`: \| \{ `value`: `Json`; `revision`: `number`; \} \| `null`; `canWriteTeam`: `boolean`; \}\>; `write`: `Promise`\<\{ `revision`: `number`; \}\>; `reset`: `Promise`\<\{ `revision`: `number`; \}\>; `claim`: `Promise`\<\{ `value`: `Json`; `revision`: `number`; `claimed`: `boolean`; \}\>; `watch`: `Promise`\<`AppStorageWatch`\>; \}\> \| `null` | - |
|
|
245
|
+
| `methods` | `object` | - |
|
|
246
|
+
| `call()` | (`method`, `input`) => `Promise`\<`WhistleJsonValue`\> | Call the named method with JSON-encoded `input`; resolves with its JSON result. |
|
|
247
247
|
|
|
248
248
|
---
|
|
249
249
|
|