@fungi.computer/oyster 0.56.2 → 0.57.1
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/agent-computer-source.js +4 -1
- package/dist/auth.d.ts +12 -4
- package/dist/auth.js +85 -24
- package/dist/boot-capability-route.js +5 -1
- package/dist/boot-gate.d.ts +5 -0
- package/dist/boot-gate.js +12 -2
- package/dist/boot-host-script.js +1 -1
- package/dist/boot-mount.d.ts +7 -1
- package/dist/boot-mount.js +11 -5
- package/dist/credential-migration-002.js +6 -1
- package/dist/embed-metafiles.js +2 -2
- package/dist/embed-scripts.js +2 -2
- package/dist/git.d.ts +8 -2
- package/dist/git.js +12 -3
- package/dist/hello-app-script.js +1 -1
- package/dist/host-page-assets.js +1 -1
- package/dist/host-page-lazy.d.ts +2 -0
- package/dist/host-page-lazy.js +8 -0
- package/dist/host-page.d.ts +22 -1
- package/dist/host-page.js +91 -12
- package/dist/host.d.ts +8 -0
- package/dist/host.js +60 -7
- package/dist/owner-sessions.d.ts +25 -0
- package/dist/owner-sessions.js +50 -0
- package/dist/page/boot-host.js +20 -2
- package/dist/page/port-preview.d.ts +1 -0
- package/dist/page/port-preview.js +33 -0
- package/dist/page-script.js +3 -3
- package/dist/platform-skills.generated.d.ts +1 -1
- package/dist/platform-skills.generated.js +1 -1
- package/dist/port-preview-entry.d.ts +84 -0
- package/dist/port-preview-entry.js +86 -0
- package/dist/standalone/agents.js +1 -0
- package/dist/standalone/builds.js +5 -0
- package/dist/standalone/candidate-preview.d.ts +25 -0
- package/dist/standalone/candidate-preview.js +265 -0
- package/dist/standalone/computer.d.ts +2 -3
- package/dist/standalone/computer.js +13 -9
- package/dist/standalone/preview.d.ts +9 -4
- package/dist/standalone/preview.js +35 -44
- package/dist/standalone/tenancy.d.ts +1 -1
- package/dist/standalone/tenancy.js +9 -1
- package/dist/standalone/worker.js +15 -2
- package/dist/starter-agent.js +5 -2
- package/dist/storage-frame.d.ts +3 -3
- package/dist/tenancy/owner-key.d.ts +4 -1
- package/dist/tenancy/owner-key.js +27 -2
- package/dist/upgrade/old-worker-http.js +2 -6
- package/dist/webhook-delivery.d.ts +1 -0
- package/dist/webhook-delivery.js +1 -1
- package/dist/workers-git.d.ts +19 -0
- package/dist/workers-git.js +108 -7
- package/dist/workers.d.ts +11 -0
- package/dist/workers.js +33 -1
- package/docs/api/README.md +14 -3
- package/docs/api/auth.md +96 -8
- package/docs/api/git.md +13 -7
- package/docs/api/host.md +2 -0
- package/docs/api/tenancy/owner-key.md +1 -0
- package/docs/api/workers-git.md +50 -0
- package/docs/api/workers.md +98 -16
- package/package.json +18 -18
package/dist/boot-mount.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import type { AppIdentity } from "@fungi.computer/agar";
|
|
2
|
+
import type { PreviewNotice } from "./host-page.js";
|
|
1
3
|
import type { BootUi } from "./boot-gate.js";
|
|
2
4
|
import { bootHostScript } from "#boot-host-script";
|
|
3
5
|
/** Resolve verified build paths with the browser's maintained URL semantics. */
|
|
4
6
|
export declare function bootAssetUrl(origin: string, base: string, path: string): string;
|
|
5
7
|
/** The trusted zero-grant parent and opaque candidate frame used by both hosts. */
|
|
6
|
-
export declare function bootParentDocument(identity:
|
|
8
|
+
export declare function bootParentDocument(identity: AppIdentity, entry: string, options: Readonly<{
|
|
9
|
+
bridge: string;
|
|
10
|
+
sandbox: string;
|
|
11
|
+
notice: PreviewNotice | null;
|
|
12
|
+
}>): Promise<string>;
|
|
7
13
|
/** CSP for the zero-grant candidate; all network-capable destinations remain denied. */
|
|
8
14
|
export declare function candidateSecurityHeaders(origin: string): {
|
|
9
15
|
"cache-control": string;
|
package/dist/boot-mount.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renderPreviewChrome } from "./host-page-lazy.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { bootHostScript } from "#boot-host-script";
|
|
3
4
|
/** Resolve verified build paths with the browser's maintained URL semantics. */
|
|
@@ -9,12 +10,17 @@ export function bootAssetUrl(origin, base, path) {
|
|
|
9
10
|
return new URL(path.startsWith("/") ? path.slice(1) : path, baseUrl).href;
|
|
10
11
|
}
|
|
11
12
|
/** The trusted zero-grant parent and opaque candidate frame used by both hosts. */
|
|
12
|
-
export function bootParentDocument(identity, entry,
|
|
13
|
-
const config = JSON.stringify({
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export async function bootParentDocument(identity, entry, options) {
|
|
14
|
+
const config = JSON.stringify({
|
|
15
|
+
identity,
|
|
16
|
+
entry,
|
|
17
|
+
expiresAt: options.notice?.expiresAt,
|
|
18
|
+
}).replaceAll("<", "\\u003c");
|
|
19
|
+
return `<!doctype html><html><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>App preview</title><body class="${options.notice === null ? "" : "preview-frame"}" style="margin:0;display:flex;flex-direction:column;height:100vh">
|
|
20
|
+
${options.notice === null ? "" : await renderPreviewChrome(options.notice)}
|
|
21
|
+
<iframe id="candidate" title="Candidate UI" sandbox="${options.sandbox}" style="width:100%;flex:1;min-height:0;border:0"></iframe>
|
|
16
22
|
<script id="boot-config" type="application/json">${config}</script>
|
|
17
|
-
<script type="module" src="${bridge}"></script></body></html>`;
|
|
23
|
+
<script type="module" src="${options.bridge}"></script></body></html>`;
|
|
18
24
|
}
|
|
19
25
|
/** CSP for the zero-grant candidate; all network-capable destinations remain denied. */
|
|
20
26
|
export function candidateSecurityHeaders(origin) {
|
|
@@ -11,7 +11,7 @@ async function migrateTable(store, sealer, step) {
|
|
|
11
11
|
throw new Error("Invalid table name");
|
|
12
12
|
if (!step.plaintext(columnsOf(store, step.table)))
|
|
13
13
|
return;
|
|
14
|
-
const rows = Schema.decodeUnknownSync(Schema.Array(rowSchema))(store.sql.exec(`SELECT * FROM ${step.table}`).toArray());
|
|
14
|
+
const rows = Schema.decodeUnknownSync(Schema.Array(rowSchema))(store.sql.exec(`SELECT * FROM ${step.table} ORDER BY rowid`).toArray());
|
|
15
15
|
// No keyring: plaintext rows stay closed to every reader until one exists.
|
|
16
16
|
if (rows.length !== 0 && sealer === undefined)
|
|
17
17
|
throw new CredentialError("unavailable");
|
|
@@ -26,6 +26,11 @@ async function migrateTable(store, sealer, step) {
|
|
|
26
26
|
// A concurrent attempt already finished; its rows are the current ones.
|
|
27
27
|
if (!step.plaintext(columnsOf(store, step.table)))
|
|
28
28
|
return;
|
|
29
|
+
// Sealing yields to other owner requests. Never copy a stale snapshot over
|
|
30
|
+
// a removal or update; leave the current table intact for the next retry.
|
|
31
|
+
const current = Schema.decodeUnknownSync(Schema.Array(rowSchema))(store.sql.exec(`SELECT * FROM ${step.table} ORDER BY rowid`).toArray());
|
|
32
|
+
if (JSON.stringify(current) !== JSON.stringify(rows))
|
|
33
|
+
throw new CredentialError("unavailable");
|
|
29
34
|
store.sql.exec(`ALTER TABLE ${step.table} RENAME TO ${legacy}`);
|
|
30
35
|
step.ensure(store.sql);
|
|
31
36
|
for (const values of sealed) {
|