@fungi.computer/oyster 0.32.0 → 0.33.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.
Files changed (50) hide show
  1. package/README.md +59 -0
  2. package/dist/app-test-copies.d.ts +87 -0
  3. package/dist/app-test-copies.js +170 -0
  4. package/dist/app-test-copy-page.d.ts +4 -0
  5. package/dist/app-test-copy-page.js +89 -0
  6. package/dist/browser/operations.d.ts +1 -1
  7. package/dist/cloudflare.d.ts +68 -3
  8. package/dist/cloudflare.js +214 -3
  9. package/dist/embed-metafiles.js +2 -2
  10. package/dist/host.d.ts +16 -0
  11. package/dist/host.js +309 -1
  12. package/dist/installation-operations.d.ts +247 -8
  13. package/dist/installation-operations.js +145 -7
  14. package/dist/installation-recovery-page.d.ts +24 -0
  15. package/dist/installation-recovery-page.js +168 -0
  16. package/dist/older-oyster-store.d.ts +1 -1
  17. package/dist/older-oyster-store.js +2 -4
  18. package/dist/page/mount.d.ts +2 -101
  19. package/dist/page/mount.js +1 -22
  20. package/dist/page-config.d.ts +102 -0
  21. package/dist/page-config.js +24 -0
  22. package/dist/page-script.js +1 -1
  23. package/dist/recovery-style.d.ts +5 -0
  24. package/dist/recovery-style.js +32 -0
  25. package/dist/standalone/agents.d.ts +1 -1
  26. package/dist/upgrade/old-worker-http.d.ts +2 -0
  27. package/dist/upgrade/old-worker-http.js +22 -0
  28. package/dist/upgrade/old-worker-readonly.d.ts +14 -0
  29. package/dist/upgrade/old-worker-readonly.js +22 -0
  30. package/dist/upgrade/old-worker-sql.d.ts +10 -0
  31. package/dist/upgrade/old-worker-sql.js +68 -0
  32. package/dist/upgrade/old-worker-stream.d.ts +12 -0
  33. package/dist/upgrade/old-worker-stream.js +54 -0
  34. package/dist/upgrade/private-stage.d.ts +23 -0
  35. package/dist/upgrade/private-stage.js +109 -0
  36. package/dist/upgrade/standalone-001.d.ts +16 -0
  37. package/dist/upgrade/standalone-001.js +31 -0
  38. package/dist/upgrade/standalone-01.d.ts +37 -0
  39. package/dist/upgrade/standalone-01.js +55 -0
  40. package/dist/upgrade/standalone-02.d.ts +37 -0
  41. package/dist/upgrade/standalone-02.js +55 -0
  42. package/dist/workers.d.ts +15 -1
  43. package/dist/workers.js +117 -7
  44. package/docs/api/README.md +8 -3
  45. package/docs/api/cloudflare.md +57 -0
  46. package/docs/api/host.md +223 -14
  47. package/docs/api/page/mount.md +10 -78
  48. package/docs/api/workers-git.md +246 -1
  49. package/docs/api/workers.md +352 -14
  50. package/package.json +23 -10
@@ -0,0 +1,168 @@
1
+ import { html } from "hono/html";
2
+ import { recoveryStyle } from "./recovery-style.js";
3
+ import { z } from "zod";
4
+ import { appTestCopySchema, } from "./app-test-copies.js";
5
+ import { installationCommandIds, installationRequestIdSchema, installationRecoverySelectionSchema, } from "./installation-operations.js";
6
+ export const installationRecoveryFormSchema = installationRecoverySelectionSchema.extend({
7
+ authorityVersion: z.coerce
8
+ .number()
9
+ .pipe(installationRecoverySelectionSchema.shape.authorityVersion),
10
+ requestId: installationRequestIdSchema,
11
+ });
12
+ /** Discard names a resource, not the creation request whose receipt may expire. */
13
+ export const appTestCopyDiscardFormSchema = installationRecoveryFormSchema
14
+ .omit({ requestId: true })
15
+ .extend({ copyId: appTestCopySchema.shape.copyId });
16
+ const fields = (authorityVersion, storeGeneration) => html `
17
+ <input type="hidden" name="authorityVersion" value="${authorityVersion}" />
18
+ <input type="hidden" name="storeGeneration" value="${storeGeneration}" />
19
+ `;
20
+ const rollbackMessage = (operation) => {
21
+ const app = operation.installationId;
22
+ switch (operation.state) {
23
+ case "pending":
24
+ return `Rolling back ${app}…`;
25
+ case "succeeded":
26
+ return `Rolled back ${app}`;
27
+ case "refused":
28
+ return `Rollback failed: ${operation.code.replaceAll("_", " ")}`;
29
+ case "unconfirmed":
30
+ return `Rollback not confirmed (${operation.outcome.replaceAll("_", " ")}). Check again.`;
31
+ }
32
+ };
33
+ /** No selected App, editable Shell, JavaScript or asset loader is needed. */
34
+ export async function installationRecoveryPage(entries, operation,
35
+ /** The App whose rollback awaits an in-page confirmation. */
36
+ confirming = null) {
37
+ return new Response(await html `<!doctype html>
38
+ <html lang="en">
39
+ <meta charset="utf-8" />
40
+ <meta name="viewport" content="width=device-width" />
41
+ <title>App recovery</title>
42
+ ${recoveryStyle}
43
+ <main>
44
+ <h1>App recovery</h1>
45
+ <p class="lede">
46
+ Roll an App back to its previous version. Your App's data stays as
47
+ it is; this doesn't undo anything the App already did.
48
+ </p>
49
+ ${operation === null
50
+ ? ""
51
+ : html `<div class="card" role="status">
52
+ <p><strong>${rollbackMessage(operation)}</strong></p>
53
+ <p><a href="">Check again</a></p>
54
+ </div>`}
55
+ ${entries.map(({ installation, recovery, copy, copyAuthority }) => html `
56
+ <section class="card">
57
+ <h2>${installation.installationId}</h2>
58
+ <p>
59
+ Running: current version
60
+ <small class="muted">${installation.release.releaseId}</small>
61
+ </p>
62
+ ${recovery === null
63
+ ? html `<p class="muted">
64
+ No earlier version to roll back to yet.
65
+ </p>`
66
+ : html `
67
+ <p>
68
+ Can roll back to: previous version
69
+ <small class="muted"
70
+ >${recovery.release.releaseId}</small
71
+ >
72
+ </p>
73
+ <p>
74
+ Last check:
75
+ ${recovery.uiCheck.kind.replaceAll("_", " ")}
76
+ ${recovery.uiCheck.kind === "not_checked"
77
+ ? html `<small class="muted"
78
+ >${recovery.uiCheck.code}</small
79
+ >`
80
+ : ""}
81
+ </p>
82
+ ${confirming === installation.installationId
83
+ ? html `<form
84
+ method="post"
85
+ action="/recovery/${installation.installationId}/rollback"
86
+ role="alertdialog"
87
+ aria-label="Confirm rollback"
88
+ >
89
+ <p>
90
+ <strong
91
+ >Roll back ${installation.installationId} to
92
+ the previous version?</strong
93
+ >
94
+ </p>
95
+ ${fields(recovery.authorityVersion, recovery.storeGeneration)}
96
+ <input
97
+ type="hidden"
98
+ name="requestId"
99
+ value="${installationCommandIds.request.generate()}"
100
+ />
101
+ <div class="row">
102
+ <button type="submit" class="primary">
103
+ Roll back
104
+ </button>
105
+ <a href="/recovery">Cancel</a>
106
+ </div>
107
+ </form>`
108
+ : html `<div class="row">
109
+ <a
110
+ class="button primary"
111
+ href="/recovery?confirm=${installation.installationId}"
112
+ >Roll back</a
113
+ >
114
+ </div>`}
115
+ `}
116
+ ${copyAuthority === null
117
+ ? html `<p class="muted">
118
+ Test copy not available for this App.
119
+ </p>`
120
+ : copy === null
121
+ ? html `<form
122
+ method="post"
123
+ action="/recovery/${installation.installationId}/test-copy"
124
+ >
125
+ ${fields(copyAuthority.selection.authorityVersion, copyAuthority.storeGeneration)}
126
+ <input
127
+ type="hidden"
128
+ name="requestId"
129
+ value="${installationCommandIds.request.generate()}"
130
+ />
131
+ <div class="row">
132
+ <button type="submit">Open test copy</button>
133
+ </div>
134
+ </form>`
135
+ : html `<p>
136
+ <a
137
+ href="/recovery/${installation.installationId}/test-copy/${copy.copyId}"
138
+ >Open test copy</a
139
+ >
140
+ <small class="muted"
141
+ >expires at
142
+ ${new Date(copy.expiresAt).toISOString()}</small
143
+ >
144
+ </p>
145
+ <form
146
+ method="post"
147
+ action="/recovery/${installation.installationId}/test-copy/${copy.copyId}/discard"
148
+ >
149
+ ${fields(copy.selection.authorityVersion, copy.storeGeneration)}
150
+ <input
151
+ type="hidden"
152
+ name="copyId"
153
+ value="${copy.copyId}"
154
+ />
155
+ <button type="submit">Discard test copy</button>
156
+ </form>`}
157
+ </section>
158
+ `)}
159
+ </main>
160
+ </html>`, {
161
+ headers: {
162
+ "Content-Type": "text/html; charset=utf-8",
163
+ "Cache-Control": "no-store",
164
+ "X-Content-Type-Options": "nosniff",
165
+ "Content-Security-Policy": "default-src 'none'; style-src 'unsafe-inline'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'",
166
+ },
167
+ });
168
+ }
@@ -2,7 +2,7 @@ import type { WatchdogSqliteOwner } from "@fungi.computer/watchdog";
2
2
  /** The closed error code a refused request carries. */
3
3
  export declare const olderOysterStoreCode = "store_from_older_oyster";
4
4
  /** The one message every refusal shows. */
5
- export declare const olderOysterStoreMessage = "This Oyster's data was created by Oyster 0.2 or earlier, which this version cannot read. Reset it (https://github.com/fungi-computer/oyster#upgrading-from-oyster-02-or-earlier) or redeploy 0.2.x. Old data is left untouched.";
5
+ export declare const olderOysterStoreMessage = "This Oyster's data was created by Oyster 0.2 or earlier, which this version cannot read. Keep the old Worker and its data untouched. Verify the old release before changing it: 0.0.1 needs a release-matched bridge; 0.1/0.2 must archive the reachable set through its own Worker before fresh setup under new names. If you cannot certify an archive, stop and keep the old Worker on its original release. This refusal deleted nothing and restored nothing.";
6
6
  /** Raised by a store owner that finds data written by Oyster 0.2 or earlier. */
7
7
  export declare class OlderOysterStoreError extends Error {
8
8
  constructor();
@@ -1,9 +1,7 @@
1
1
  /** The closed error code a refused request carries. */
2
2
  export const olderOysterStoreCode = "store_from_older_oyster";
3
- /** Where the reset steps live. */
4
- const olderOysterStoreGuide = "https://github.com/fungi-computer/oyster#upgrading-from-oyster-02-or-earlier";
5
3
  /** The one message every refusal shows. */
6
- export const olderOysterStoreMessage = `This Oyster's data was created by Oyster 0.2 or earlier, which this version cannot read. Reset it (${olderOysterStoreGuide}) or redeploy 0.2.x. Old data is left untouched.`;
4
+ export const olderOysterStoreMessage = "This Oyster's data was created by Oyster 0.2 or earlier, which this version cannot read. Keep the old Worker and its data untouched. Verify the old release before changing it: 0.0.1 needs a release-matched bridge; 0.1/0.2 must archive the reachable set through its own Worker before fresh setup under new names. If you cannot certify an archive, stop and keep the old Worker on its original release. This refusal deleted nothing and restored nothing.";
7
5
  /** Raised by a store owner that finds data written by Oyster 0.2 or earlier. */
8
6
  export class OlderOysterStoreError extends Error {
9
7
  constructor() {
@@ -38,6 +36,6 @@ export function buildJobsFromOlderOyster(sql) {
38
36
  export function olderOysterStoreResponse(request) {
39
37
  const status = 409;
40
38
  if (request.headers.get("accept")?.includes("text/html") === true)
41
- return new Response(`<!doctype html><meta charset="utf-8"><title>Oyster data needs a reset</title><body style="font:16px/1.5 system-ui;max-width:40rem;margin:4rem auto;padding:0 1rem"><h1>Oyster data needs a reset</h1><p>This Oyster's data was created by Oyster 0.2 or earlier, which this version cannot read. Old data is left untouched.</p><p><a href="${olderOysterStoreGuide}">Reset it</a> or redeploy 0.2.x.</p></body>`, { status, headers: { "content-type": "text/html; charset=utf-8" } });
39
+ return new Response(`<!doctype html><meta charset="utf-8"><title>Oyster upgrade stopped</title><body style="font:16px/1.5 system-ui;max-width:40rem;margin:4rem auto;padding:0 1rem"><h1>Oyster upgrade stopped</h1><p>${olderOysterStoreMessage}</p></body>`, { status, headers: { "content-type": "text/html; charset=utf-8" } });
42
40
  return Response.json({ error: olderOysterStoreCode, message: olderOysterStoreMessage }, { status });
43
41
  }
@@ -2,108 +2,11 @@ import { type AppOpenInput, type AppRoleChoice } from "@fungi.computer/agar/apps
2
2
  import { OysterAgentBrowserHost } from "./agent-browser.js";
3
3
  export type { OysterAgentBrowserHost } from "./agent-browser.js";
4
4
  import type { WhistleRuntime } from "@fungi.computer/whistle";
5
- import * as Schema from "effect/Schema";
5
+ export type { OysterAppConfig } from "../page-config.js";
6
6
  import { type AppPermissions, type AppSetup } from "@fungi.computer/agar";
7
+ import { type OysterAppConfig } from "../page-config.js";
7
8
  import { type AppHost, type AppHostLaunch, type AppHostHandlers } from "@fungi.computer/agar/host";
8
9
  import type { WhistleJsonValue } from "@fungi.computer/whistle";
9
- /** Current server-admitted configuration for one installed App page. */
10
- export declare const oysterAppConfigSchema: Schema.Struct<{
11
- readonly workbench: Schema.Boolean;
12
- /** The home shell Release's own module, imported top-level; null if it ships none. */
13
- readonly shellModuleUrl: Schema.NullOr<Schema.String>;
14
- readonly storage: Schema.Boolean;
15
- /** The Release declares `apps.open`; only an embedding shell can serve it. */
16
- readonly appsOpen: Schema.Boolean;
17
- readonly computerId: Schema.NullOr<Schema.String>;
18
- readonly authorityVersion: Schema.Int;
19
- readonly commands: Schema.$Array<Schema.Codec<Readonly<{
20
- id: string;
21
- title: string;
22
- category: string;
23
- description?: string | undefined;
24
- sigil?: string | undefined;
25
- projections?: Readonly<{
26
- bindings?: (Readonly<{
27
- order?: number | undefined;
28
- }> & Readonly<{
29
- values: readonly string[];
30
- }>) | undefined;
31
- agent?: (Readonly<{
32
- order?: number | undefined;
33
- }> & Readonly<{
34
- keybind?: string | undefined;
35
- }>) | undefined;
36
- help?: Readonly<{
37
- order?: number | undefined;
38
- }> | undefined;
39
- menu?: Readonly<{
40
- order?: number | undefined;
41
- }> | undefined;
42
- palette?: Readonly<{
43
- order?: number | undefined;
44
- }> | undefined;
45
- slash?: (Readonly<{
46
- order?: number | undefined;
47
- }> & Readonly<{
48
- aliases: readonly string[];
49
- }>) | undefined;
50
- }> | undefined;
51
- }>, Readonly<{
52
- id: string;
53
- title: string;
54
- category: string;
55
- description?: string | undefined;
56
- sigil?: string | undefined;
57
- projections?: Readonly<{
58
- bindings?: (Readonly<{
59
- order?: number | undefined;
60
- }> & Readonly<{
61
- values: readonly string[];
62
- }>) | undefined;
63
- agent?: (Readonly<{
64
- order?: number | undefined;
65
- }> & Readonly<{
66
- keybind?: string | undefined;
67
- }>) | undefined;
68
- help?: Readonly<{
69
- order?: number | undefined;
70
- }> | undefined;
71
- menu?: Readonly<{
72
- order?: number | undefined;
73
- }> | undefined;
74
- palette?: Readonly<{
75
- order?: number | undefined;
76
- }> | undefined;
77
- slash?: (Readonly<{
78
- order?: number | undefined;
79
- }> & Readonly<{
80
- aliases: readonly string[];
81
- }>) | undefined;
82
- }> | undefined;
83
- }>, never, never>>;
84
- readonly icon: Schema.NullOr<Schema.String>;
85
- readonly roles: Schema.$Array<Schema.String>;
86
- readonly installationId: Schema.String;
87
- readonly appId: Schema.String;
88
- readonly releaseId: Schema.String;
89
- readonly uiUrl: Schema.String;
90
- readonly backendUrl: Schema.String;
91
- readonly methodsUrl: Schema.String;
92
- readonly capabilities: Schema.$Array<Schema.Struct<{
93
- readonly id: Schema.String;
94
- readonly version: Schema.Number;
95
- readonly base: Schema.String;
96
- readonly methods: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
97
- readonly kind: Schema.Literal<"transport">;
98
- readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "ANY"]>;
99
- readonly path: Schema.String;
100
- }>, Schema.Struct<{
101
- readonly kind: Schema.Literals<readonly ["json", "read", "write"]>;
102
- readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]>;
103
- readonly path: Schema.String;
104
- }>]>>;
105
- }>>;
106
- }>;
107
10
  /** Role and App opens, routed by the embedding shell; the App never names a surface. */
108
11
  export type OysterAppOpenRouting = Readonly<{
109
12
  /** Open the declared intent through the App the Team chose for its role. */
@@ -140,8 +43,6 @@ export declare function oysterShellHandles(config: OysterAppConfig): {
140
43
  * Desktop chrome (menus, palette, status) belongs to the trusted shell.
141
44
  */
142
45
  export declare function mountOysterPage(): Promise<AppHost>;
143
- /** The host-admitted App configuration served by Oyster. */
144
- export type OysterAppConfig = typeof oysterAppConfigSchema.Type;
145
46
  /** One isolated App connection, with the slots this host admitted for it. */
146
47
  export type OysterAppConnectionOptions = Readonly<{
147
48
  config: OysterAppConfig;
@@ -24,10 +24,9 @@ import { agentList, agentManage, agentSessionRead, agentSessionWrite, } from "@f
24
24
  import { mediaGeneration } from "@fungi.computer/agar/media";
25
25
  import { MediaGeneration, mediaGenerationDescriptionSchema, } from "@fungi.computer/agar/media-json";
26
26
  import { registeredCapabilityHandle, } from "./capabilities.js";
27
- import { capabilityDescriptorSchema } from "../capability-descriptor.js";
27
+ import { oysterAppConfigSchema } from "../page-config.js";
28
28
  import { connectAppHost, } from "@fungi.computer/agar/host";
29
29
  import { parseJsonValue } from "@fungi.computer/whistle/wire";
30
- import { appDeclaredCommandSchema } from "@fungi.computer/puffball/app";
31
30
  import { TerminalCapability } from "./terminal.js";
32
31
  import { ComputerPortsHandle, ComputerProcessesHandle, } from "./computer-handles.js";
33
32
  function agentDirectory(capabilities) {
@@ -44,26 +43,6 @@ function agentDirectory(capabilities) {
44
43
  return directory;
45
44
  }
46
45
  /** Current server-admitted configuration for one installed App page. */
47
- export const oysterAppConfigSchema = Schema.Struct({
48
- workbench: Schema.Boolean,
49
- /** The home shell Release's own module, imported top-level; null if it ships none. */
50
- shellModuleUrl: Schema.NullOr(Schema.String),
51
- storage: Schema.Boolean,
52
- /** The Release declares `apps.open`; only an embedding shell can serve it. */
53
- appsOpen: Schema.Boolean,
54
- computerId: Schema.NullOr(Schema.String),
55
- authorityVersion: Schema.Int,
56
- commands: Schema.Array(appDeclaredCommandSchema),
57
- icon: Schema.NullOr(Schema.String),
58
- roles: Schema.Array(Schema.String),
59
- installationId: Schema.String,
60
- appId: Schema.String,
61
- releaseId: Schema.String,
62
- uiUrl: Schema.String,
63
- backendUrl: Schema.String,
64
- methodsUrl: Schema.String,
65
- capabilities: Schema.Array(capabilityDescriptorSchema),
66
- });
67
46
  async function answer(response) {
68
47
  if (response.status === 401 || response.status === 403)
69
48
  throw new AppError("App permission was denied", {
@@ -0,0 +1,102 @@
1
+ import * as Schema from "effect/Schema";
2
+ /** One host-admitted configuration, shared by Worker producers and browser mounts. */
3
+ export declare const oysterAppConfigSchema: Schema.Struct<{
4
+ readonly workbench: Schema.Boolean;
5
+ /** The home shell Release's own module, imported top-level; null if it ships none. */
6
+ readonly shellModuleUrl: Schema.NullOr<Schema.String>;
7
+ readonly storage: Schema.Boolean;
8
+ /** The Release declares `apps.open`; only an embedding shell can serve it. */
9
+ readonly appsOpen: Schema.Boolean;
10
+ readonly computerId: Schema.NullOr<Schema.String>;
11
+ readonly authorityVersion: Schema.Int;
12
+ readonly commands: Schema.$Array<Schema.Codec<Readonly<{
13
+ id: string;
14
+ title: string;
15
+ category: string;
16
+ description?: string | undefined;
17
+ sigil?: string | undefined;
18
+ projections?: Readonly<{
19
+ bindings?: (Readonly<{
20
+ order?: number | undefined;
21
+ }> & Readonly<{
22
+ values: readonly string[];
23
+ }>) | undefined;
24
+ agent?: (Readonly<{
25
+ order?: number | undefined;
26
+ }> & Readonly<{
27
+ keybind?: string | undefined;
28
+ }>) | undefined;
29
+ help?: Readonly<{
30
+ order?: number | undefined;
31
+ }> | undefined;
32
+ menu?: Readonly<{
33
+ order?: number | undefined;
34
+ }> | undefined;
35
+ palette?: Readonly<{
36
+ order?: number | undefined;
37
+ }> | undefined;
38
+ slash?: (Readonly<{
39
+ order?: number | undefined;
40
+ }> & Readonly<{
41
+ aliases: readonly string[];
42
+ }>) | undefined;
43
+ }> | undefined;
44
+ }>, Readonly<{
45
+ id: string;
46
+ title: string;
47
+ category: string;
48
+ description?: string | undefined;
49
+ sigil?: string | undefined;
50
+ projections?: Readonly<{
51
+ bindings?: (Readonly<{
52
+ order?: number | undefined;
53
+ }> & Readonly<{
54
+ values: readonly string[];
55
+ }>) | undefined;
56
+ agent?: (Readonly<{
57
+ order?: number | undefined;
58
+ }> & Readonly<{
59
+ keybind?: string | undefined;
60
+ }>) | undefined;
61
+ help?: Readonly<{
62
+ order?: number | undefined;
63
+ }> | undefined;
64
+ menu?: Readonly<{
65
+ order?: number | undefined;
66
+ }> | undefined;
67
+ palette?: Readonly<{
68
+ order?: number | undefined;
69
+ }> | undefined;
70
+ slash?: (Readonly<{
71
+ order?: number | undefined;
72
+ }> & Readonly<{
73
+ aliases: readonly string[];
74
+ }>) | undefined;
75
+ }> | undefined;
76
+ }>, never, never>>;
77
+ readonly icon: Schema.NullOr<Schema.String>;
78
+ readonly roles: Schema.$Array<Schema.String>;
79
+ readonly installationId: Schema.String;
80
+ readonly appId: Schema.String;
81
+ readonly releaseId: Schema.String;
82
+ readonly uiUrl: Schema.String;
83
+ readonly backendUrl: Schema.String;
84
+ readonly methodsUrl: Schema.String;
85
+ readonly capabilities: Schema.$Array<Schema.Struct<{
86
+ readonly id: Schema.String;
87
+ readonly version: Schema.Number;
88
+ readonly base: Schema.String;
89
+ readonly methods: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Struct<{
90
+ readonly kind: Schema.Literal<"transport">;
91
+ readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "ANY"]>;
92
+ readonly path: Schema.String;
93
+ }>, Schema.Struct<{
94
+ readonly kind: Schema.Literals<readonly ["json", "read", "write"]>;
95
+ readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]>;
96
+ readonly path: Schema.String;
97
+ }>]>>;
98
+ }>>;
99
+ }>;
100
+ /** The host-admitted App configuration served by Oyster. */
101
+ /** Host-authored configuration for the ordinary sandboxed App mount. */
102
+ export type OysterAppConfig = typeof oysterAppConfigSchema.Type;
@@ -0,0 +1,24 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { appDeclaredCommandSchema } from "@fungi.computer/puffball/app";
3
+ import { capabilityDescriptorSchema } from "./capability-descriptor.js";
4
+ /** One host-admitted configuration, shared by Worker producers and browser mounts. */
5
+ export const oysterAppConfigSchema = Schema.Struct({
6
+ workbench: Schema.Boolean,
7
+ /** The home shell Release's own module, imported top-level; null if it ships none. */
8
+ shellModuleUrl: Schema.NullOr(Schema.String),
9
+ storage: Schema.Boolean,
10
+ /** The Release declares `apps.open`; only an embedding shell can serve it. */
11
+ appsOpen: Schema.Boolean,
12
+ computerId: Schema.NullOr(Schema.String),
13
+ authorityVersion: Schema.Int,
14
+ commands: Schema.Array(appDeclaredCommandSchema),
15
+ icon: Schema.NullOr(Schema.String),
16
+ roles: Schema.Array(Schema.String),
17
+ installationId: Schema.String,
18
+ appId: Schema.String,
19
+ releaseId: Schema.String,
20
+ uiUrl: Schema.String,
21
+ backendUrl: Schema.String,
22
+ methodsUrl: Schema.String,
23
+ capabilities: Schema.Array(capabilityDescriptorSchema),
24
+ });