@fungi.computer/oyster 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +1082 -2
- package/dist/agents.d.ts +114 -0
- package/dist/agents.js +322 -0
- package/dist/app-builds.d.ts +151 -0
- package/dist/app-builds.js +355 -0
- package/dist/app-sandbox.d.ts +2 -0
- package/dist/app-sandbox.js +2 -0
- package/dist/app-sources.d.ts +46 -0
- package/dist/app-sources.js +335 -0
- package/dist/app-storage.d.ts +141 -0
- package/dist/app-storage.js +281 -0
- package/dist/apps/gate.d.ts +105 -0
- package/dist/apps/gate.js +273 -0
- package/dist/apps/index.d.ts +5 -0
- package/dist/apps/index.js +5 -0
- package/dist/apps/installation.d.ts +248 -0
- package/dist/apps/installation.js +307 -0
- package/dist/apps/operations.d.ts +8 -0
- package/dist/apps/operations.js +98 -0
- package/dist/apps/tools.d.ts +33 -0
- package/dist/apps/tools.js +17 -0
- package/dist/auth.d.ts +11 -0
- package/dist/auth.js +93 -0
- package/dist/backend-request.d.ts +3 -0
- package/dist/backend-request.js +53 -0
- package/dist/build/build-jobs.d.ts +128 -0
- package/dist/build/build-jobs.js +197 -0
- package/dist/build/build-step.d.ts +26 -0
- package/dist/build/build-step.js +20 -0
- package/dist/build/bundled-html.d.ts +7 -0
- package/dist/build/bundled-html.js +64 -0
- package/dist/build/definition-emission.d.ts +34 -0
- package/dist/build/definition-emission.js +201 -0
- package/dist/build/effect.d.ts +231 -0
- package/dist/build/effect.js +396 -0
- package/dist/build/git-environment.d.ts +6 -0
- package/dist/build/git-environment.js +48 -0
- package/dist/build/html-recipe.d.ts +20 -0
- package/dist/build/html-recipe.js +51 -0
- package/dist/build/local-build.d.ts +57 -0
- package/dist/build/local-build.js +1078 -0
- package/dist/build/r2-artifact-writer.d.ts +31 -0
- package/dist/build/r2-artifact-writer.js +179 -0
- package/dist/build/snapshot-package-store.d.ts +2 -0
- package/dist/build/snapshot-package-store.js +21 -0
- package/dist/build/snapshot-program-scripts.d.ts +6 -0
- package/dist/build/snapshot-program-scripts.js +2 -0
- package/dist/build/submission-contract.d.ts +384 -0
- package/dist/build/submission-contract.js +70 -0
- package/dist/build/workspace-build.d.ts +50 -0
- package/dist/build/workspace-build.js +156 -0
- package/dist/build-contract.d.ts +4 -0
- package/dist/build-contract.js +4 -0
- package/dist/build-jobs.d.ts +2 -0
- package/dist/build-jobs.js +2 -0
- package/dist/build.d.ts +11 -0
- package/dist/build.js +13 -0
- package/dist/capability-descriptor.d.ts +46 -0
- package/dist/capability-descriptor.js +51 -0
- package/dist/catalog-frame.d.ts +39 -0
- package/dist/catalog-frame.js +72 -0
- package/dist/cause-class.d.ts +19 -0
- package/dist/cause-class.js +54 -0
- package/dist/cloudflare.d.ts +123 -0
- package/dist/cloudflare.js +391 -0
- package/dist/computer-terminal.d.ts +38 -0
- package/dist/computer-terminal.js +410 -0
- package/dist/computer.d.ts +60 -0
- package/dist/computer.js +33 -0
- package/dist/event-recipients.d.ts +57 -0
- package/dist/event-recipients.js +144 -0
- package/dist/facet-invocation.d.ts +4 -0
- package/dist/facet-invocation.js +45 -0
- package/dist/files.d.ts +42 -0
- package/dist/files.js +123 -0
- package/dist/frame-binding-wire-script.d.ts +2 -0
- package/dist/frame-binding-wire-script.js +1 -0
- package/dist/frame-binding-wire.d.ts +28 -0
- package/dist/frame-binding-wire.js +54 -0
- package/dist/git-admission.d.ts +52 -0
- package/dist/git-admission.js +188 -0
- package/dist/git-auth.d.ts +11 -0
- package/dist/git-auth.js +27 -0
- package/dist/git-door.d.ts +35 -0
- package/dist/git-door.js +108 -0
- package/dist/git-journal.d.ts +31 -0
- package/dist/git-journal.js +188 -0
- package/dist/git.d.ts +31 -0
- package/dist/git.js +64 -0
- package/dist/guest-policy.d.ts +9 -0
- package/dist/guest-policy.js +13 -0
- package/dist/host.d.ts +244 -0
- package/dist/host.js +1043 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +320 -0
- package/dist/installation-consent.d.ts +79 -0
- package/dist/installation-consent.js +82 -0
- package/dist/internal/background-origins.d.ts +3 -0
- package/dist/internal/background-origins.js +8 -0
- package/dist/internal/delivery.d.ts +12 -0
- package/dist/internal/delivery.js +167 -0
- package/dist/internal/host-gate.d.ts +14 -0
- package/dist/internal/host-gate.js +62 -0
- package/dist/internal/registry-installations.d.ts +6 -0
- package/dist/internal/registry-installations.js +12 -0
- package/dist/invocation.d.ts +251 -0
- package/dist/invocation.js +377 -0
- package/dist/keys.d.ts +48 -0
- package/dist/keys.js +52 -0
- package/dist/mcp-owner.d.ts +27 -0
- package/dist/mcp-owner.js +143 -0
- package/dist/mcp.d.ts +89 -0
- package/dist/mcp.js +429 -0
- package/dist/media.d.ts +23 -0
- package/dist/media.js +12 -0
- package/dist/pack.d.ts +76 -0
- package/dist/pack.js +134 -0
- package/dist/page/capabilities.d.ts +23 -0
- package/dist/page/capabilities.js +256 -0
- package/dist/page/computer-handles.d.ts +79 -0
- package/dist/page/computer-handles.js +44 -0
- package/dist/page/lifetime.d.ts +6 -0
- package/dist/page/lifetime.js +19 -0
- package/dist/page/mount.d.ts +163 -0
- package/dist/page/mount.js +390 -0
- package/dist/page/storage.d.ts +3 -0
- package/dist/page/storage.js +82 -0
- package/dist/page/terminal.d.ts +5 -0
- package/dist/page/terminal.js +7 -0
- package/dist/page-script.d.ts +14 -0
- package/dist/page-script.js +5 -0
- package/dist/r2-files.d.ts +3 -0
- package/dist/r2-files.js +79 -0
- package/dist/release.d.ts +72 -0
- package/dist/release.js +164 -0
- package/dist/root-data.d.ts +86 -0
- package/dist/root-data.js +69 -0
- package/dist/shell/app-directory.d.ts +537 -0
- package/dist/shell/app-directory.js +195 -0
- package/dist/shell/browser-actions.d.ts +7 -0
- package/dist/shell/browser-actions.js +56 -0
- package/dist/shell/command-host.d.ts +112 -0
- package/dist/shell/command-host.js +502 -0
- package/dist/shell/commands.d.ts +25 -0
- package/dist/shell/commands.js +78 -0
- package/dist/shell/index.d.ts +8 -0
- package/dist/shell/index.js +8 -0
- package/dist/shell/keys.d.ts +41 -0
- package/dist/shell/keys.js +134 -0
- package/dist/shell/shell-module.d.ts +31 -0
- package/dist/shell/shell-module.js +37 -0
- package/dist/shell/window-manager.d.ts +124 -0
- package/dist/shell/window-manager.js +711 -0
- package/dist/shell/workbench-contract.d.ts +68 -0
- package/dist/shell/workbench-contract.js +1 -0
- package/dist/shell/workbench-host-types.d.ts +96 -0
- package/dist/shell/workbench-host-types.js +1 -0
- package/dist/shell/workbench-host.d.ts +34 -0
- package/dist/shell/workbench-host.js +347 -0
- package/dist/shell/workbench-model.d.ts +192 -0
- package/dist/shell/workbench-model.js +53 -0
- package/dist/shell/workbench.d.ts +4 -0
- package/dist/shell/workbench.js +2 -0
- package/dist/source/fork.d.ts +27 -0
- package/dist/source/fork.js +46 -0
- package/dist/source/index.d.ts +11 -0
- package/dist/source/index.js +11 -0
- package/dist/source/seed-receipt.d.ts +53 -0
- package/dist/source/seed-receipt.js +18 -0
- package/dist/source/team-source.d.ts +32 -0
- package/dist/source/team-source.js +42 -0
- package/dist/source/template-repository.d.ts +2 -0
- package/dist/source/template-repository.js +8 -0
- package/dist/source/template-write.d.ts +69 -0
- package/dist/source/template-write.js +344 -0
- package/dist/storage-frame.d.ts +64 -0
- package/dist/storage-frame.js +28 -0
- package/dist/tenant.d.ts +81 -0
- package/dist/tenant.js +71 -0
- package/dist/testing/capabilities.d.ts +29 -0
- package/dist/testing/capabilities.js +130 -0
- package/dist/testing/catalog.d.ts +3 -0
- package/dist/testing/catalog.js +53 -0
- package/dist/testing/index.d.ts +10 -0
- package/dist/testing/index.js +10 -0
- package/dist/testing/installation.d.ts +11 -0
- package/dist/testing/installation.js +25 -0
- package/dist/testing/native-worker.d.ts +21 -0
- package/dist/testing/native-worker.js +106 -0
- package/dist/testing/worker.d.ts +18 -0
- package/dist/testing/worker.js +67 -0
- package/dist/testing/workers-runtime.d.ts +24 -0
- package/dist/testing/workers-runtime.js +33 -0
- package/dist/webhook-delivery.d.ts +14 -0
- package/dist/webhook-delivery.js +17 -0
- package/dist/workers-git.d.ts +285 -0
- package/dist/workers-git.js +1174 -0
- package/dist/workers.d.ts +352 -0
- package/dist/workers.js +866 -0
- package/docs/api/README.md +82 -0
- package/docs/api/agents.md +332 -0
- package/docs/api/app-storage.md +209 -0
- package/docs/api/apps.md +1375 -0
- package/docs/api/auth.md +63 -0
- package/docs/api/build-contract.md +507 -0
- package/docs/api/build.md +1476 -0
- package/docs/api/cloudflare.md +421 -0
- package/docs/api/computer.md +203 -0
- package/docs/api/files.md +117 -0
- package/docs/api/git.md +470 -0
- package/docs/api/host.md +1328 -0
- package/docs/api/index.md +430 -0
- package/docs/api/invocation.md +738 -0
- package/docs/api/keys.md +175 -0
- package/docs/api/mcp.md +301 -0
- package/docs/api/media.md +40 -0
- package/docs/api/modules.md +42 -0
- package/docs/api/pack.md +138 -0
- package/docs/api/page/mount.md +298 -0
- package/docs/api/root-data.md +111 -0
- package/docs/api/shell/app-directory.md +332 -0
- package/docs/api/shell/command-host.md +224 -0
- package/docs/api/shell/commands.md +197 -0
- package/docs/api/shell/keys.md +183 -0
- package/docs/api/shell/shell-module.md +143 -0
- package/docs/api/shell/window-manager.md +267 -0
- package/docs/api/shell/workbench.md +186 -0
- package/docs/api/shell.md +1788 -0
- package/docs/api/tenant.md +194 -0
- package/docs/api/workers-git.md +1527 -0
- package/docs/api/workers.md +1678 -0
- package/docs/media/architecture.mmd +32 -0
- package/docs/media/architecture.png +0 -0
- package/docs/media/bonsai-network.png +0 -0
- package/docs/media/bonsai-repository.png +0 -0
- package/docs/site/agent-quickstart.mdx +349 -0
- package/examples/git/worker.ts +39 -0
- package/examples/git/wrangler.jsonc +32 -0
- package/examples/standalone/worker.ts +14 -0
- package/examples/standalone/wrangler.jsonc +21 -0
- package/package.json +249 -3
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import type { AppCommand, AppOpenRequest, FileNavigationInput, AppNavigationState, AppStatusAction, AppStatusItem } from "@fungi.computer/agar";
|
|
4
|
+
import type { AppOpenInput, AppRoleChoice } from "@fungi.computer/agar/apps";
|
|
5
|
+
import type { WhistleExecutionOrigin, WhistleJsonValue } from "@fungi.computer/whistle";
|
|
6
|
+
/** A request to resolve and mount one child App, by its own identity. */
|
|
7
|
+
export type WorkbenchChildLaunch = Readonly<{
|
|
8
|
+
windowId: string;
|
|
9
|
+
appId: string;
|
|
10
|
+
releaseId: string;
|
|
11
|
+
surfaceId: string;
|
|
12
|
+
href: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
openRequest: AppOpenRequest | null;
|
|
15
|
+
}>;
|
|
16
|
+
/** One invocation of a mounted child's own Release-declared command. */
|
|
17
|
+
export type WorkbenchCommandInvocation = Readonly<{
|
|
18
|
+
arguments?: WhistleJsonValue;
|
|
19
|
+
origin: WhistleExecutionOrigin;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* Events a mounted child raises toward its dashboard. A child's permission
|
|
23
|
+
* requests never reach the dashboard: the host asks the person itself. The
|
|
24
|
+
* host validates a
|
|
25
|
+
* child's commands against that child's own Release declaration before
|
|
26
|
+
* forwarding them, so the dashboard can present them but never widen them.
|
|
27
|
+
*/
|
|
28
|
+
export type WorkbenchChildEvents = Readonly<{
|
|
29
|
+
/** Ask this window's shell to open its existing Computer picker. */
|
|
30
|
+
onComputerChoice?: () => Promise<void>;
|
|
31
|
+
/** Ask the embedding host to follow a file navigation request. */
|
|
32
|
+
onNavigation?: (input: FileNavigationInput) => Promise<void>;
|
|
33
|
+
/** Ask the embedding host to open an App through its own admission policy. */
|
|
34
|
+
onAppOpen?: (input: AppOpenInput) => Promise<void>;
|
|
35
|
+
/** Ask the embedding host which App its role routing would open for a role. */
|
|
36
|
+
onAppRole?: (role: string) => Promise<AppRoleChoice>;
|
|
37
|
+
/** Report a changed child selection; the host returns whether it handled it. */
|
|
38
|
+
onSelectionChanged?: () => Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Replace the child's presented command set; an empty list clears it. Run
|
|
41
|
+
* one through the child's handle with `invokeCommand`.
|
|
42
|
+
*/
|
|
43
|
+
onCommands?: (commands: readonly AppCommand[]) => Promise<void>;
|
|
44
|
+
/** A reserved shell chord (the command palette) pressed inside the child. */
|
|
45
|
+
onReservedChord?: (input: Readonly<{
|
|
46
|
+
id: string;
|
|
47
|
+
repeat: boolean;
|
|
48
|
+
}>) => Promise<void>;
|
|
49
|
+
/** The child gained (`true`) or lost (`false`) input focus. */
|
|
50
|
+
onFocus?: (focused: boolean) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* The child's latest parsed navigation state; `null` once it disconnects.
|
|
53
|
+
* The dashboard shows a Back affordance from it.
|
|
54
|
+
*/
|
|
55
|
+
onNavigationState?: (state: AppNavigationState | null) => Promise<void>;
|
|
56
|
+
/** The child's latest status readouts; an empty list once it disconnects. */
|
|
57
|
+
onStatusItems?: (items: readonly AppStatusItem[]) => Promise<void>;
|
|
58
|
+
}>;
|
|
59
|
+
/** One mounted child App; every method proxies to its real host-owned mount. */
|
|
60
|
+
export type WorkbenchChildHandle = {
|
|
61
|
+
/** Show or hide the mounted child without changing its identity. */
|
|
62
|
+
setVisibility(visibility: "hidden" | "visible"): Promise<void>;
|
|
63
|
+
/** Update the launch descriptor of the existing mount. */
|
|
64
|
+
reconfigure(launch: WorkbenchChildLaunch): Promise<void>;
|
|
65
|
+
/** Ask whether the child permits a user-initiated close. */
|
|
66
|
+
requestClose(): Promise<boolean>;
|
|
67
|
+
/** Ask the child to go back one step in its own history; `true` when it did. */
|
|
68
|
+
requestBack(): Promise<boolean>;
|
|
69
|
+
/** Deliver the person's use of a child's status item; `true` when it acted. */
|
|
70
|
+
activateStatus(action: AppStatusAction): Promise<boolean>;
|
|
71
|
+
/** Run one of the child's currently presented commands. */
|
|
72
|
+
invokeCommand(commandId: string, input: WorkbenchCommandInvocation): Promise<WhistleJsonValue | undefined>;
|
|
73
|
+
/** Release the child mount and its resources. */
|
|
74
|
+
dispose(): Promise<void>;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* A platform destination the host offers the dashboard, such as opening
|
|
78
|
+
* a host settings page. The host owns the labels and the navigation;
|
|
79
|
+
* the dashboard only presents them and asks the host to follow one.
|
|
80
|
+
*/
|
|
81
|
+
export type WorkbenchPlatformDestination = Readonly<{
|
|
82
|
+
id: string;
|
|
83
|
+
label: string;
|
|
84
|
+
}>;
|
|
85
|
+
/** A declared Gill request addressed to one host-selected App surface. */
|
|
86
|
+
export declare const workbenchGillRequestSchema: Schema.Struct<{
|
|
87
|
+
readonly viewId: Schema.String;
|
|
88
|
+
readonly params: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
89
|
+
readonly after: Schema.optional<Schema.String>;
|
|
90
|
+
readonly options: Schema.optional<Schema.String>;
|
|
91
|
+
readonly surfaceId: Schema.String;
|
|
92
|
+
}>;
|
|
93
|
+
/** Decoded Gill request for a surface in the host directory. */
|
|
94
|
+
export type WorkbenchGillRequest = typeof workbenchGillRequestSchema.Type;
|
|
95
|
+
/** The member chooses a declared Gill and size in host-rendered Settings. */
|
|
96
|
+
export declare const desktopGillSelectionSchema: z.ZodObject<{
|
|
97
|
+
surfaceId: z.ZodString;
|
|
98
|
+
gillId: z.ZodString;
|
|
99
|
+
}, z.core.$strict>;
|
|
100
|
+
/** The identity of a Gill selected in a host-rendered settings view. */
|
|
101
|
+
export type DesktopGillSelection = z.output<typeof desktopGillSelectionSchema>;
|
|
102
|
+
/** The dashboard layout sizes currently assigned to one Gill. */
|
|
103
|
+
export declare const desktopGillSizesSchema: z.ZodArray<z.ZodEnum<{
|
|
104
|
+
S: "S";
|
|
105
|
+
M: "M";
|
|
106
|
+
L: "L";
|
|
107
|
+
}>>;
|
|
108
|
+
/** A selected Gill and the layout size requested for a new placement. */
|
|
109
|
+
export declare const desktopGillAdditionSchema: z.ZodObject<{
|
|
110
|
+
surfaceId: z.ZodString;
|
|
111
|
+
gillId: z.ZodString;
|
|
112
|
+
size: z.ZodEnum<{
|
|
113
|
+
S: "S";
|
|
114
|
+
M: "M";
|
|
115
|
+
L: "L";
|
|
116
|
+
}>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
/** A decoded request to add a Gill placement. */
|
|
119
|
+
export type DesktopGillAddition = z.output<typeof desktopGillAdditionSchema>;
|
|
120
|
+
/** A dashboard supplies its own arranger, not an endpoint for ordinary Apps. */
|
|
121
|
+
export type WorkbenchDesktopSettings = {
|
|
122
|
+
/** Read the sizes currently assigned to this Gill in the dashboard layout. */
|
|
123
|
+
readGill: (input: DesktopGillSelection) => Promise<z.output<typeof desktopGillSizesSchema>>;
|
|
124
|
+
/** Add a Gill at the requested size to the dashboard layout. */
|
|
125
|
+
addGill: (input: DesktopGillAddition) => Promise<void>;
|
|
126
|
+
/** Remove this Gill from the dashboard layout. */
|
|
127
|
+
removeGill: (input: DesktopGillSelection) => Promise<void>;
|
|
128
|
+
};
|
|
129
|
+
/** Shape of the arranger callbacks the shell supplies to its host. */
|
|
130
|
+
export declare const desktopSettingsHandlerSchema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
|
|
131
|
+
readGill: z.core.$InferOuterFunctionType<z.core.$ZodTuple<readonly [z.ZodObject<{
|
|
132
|
+
surfaceId: z.ZodString;
|
|
133
|
+
gillId: z.ZodString;
|
|
134
|
+
}, z.core.$strict>], z.core.$ZodFunctionOut>, z.ZodPromise<z.ZodPipe<z.ZodUnknown, z.ZodTransform<("S" | "M" | "L")[], unknown>>>>;
|
|
135
|
+
addGill: z.core.$InferOuterFunctionType<z.core.$ZodTuple<readonly [z.ZodObject<{
|
|
136
|
+
surfaceId: z.ZodString;
|
|
137
|
+
gillId: z.ZodString;
|
|
138
|
+
size: z.ZodEnum<{
|
|
139
|
+
S: "S";
|
|
140
|
+
M: "M";
|
|
141
|
+
L: "L";
|
|
142
|
+
}>;
|
|
143
|
+
}, z.core.$strict>], z.core.$ZodFunctionOut>, z.ZodPromise<z.ZodPipe<z.ZodUnknown, z.ZodTransform<void, unknown>>>>;
|
|
144
|
+
removeGill: z.core.$InferOuterFunctionType<z.core.$ZodTuple<readonly [z.ZodObject<{
|
|
145
|
+
surfaceId: z.ZodString;
|
|
146
|
+
gillId: z.ZodString;
|
|
147
|
+
}, z.core.$strict>], z.core.$ZodFunctionOut>, z.ZodPromise<z.ZodPipe<z.ZodUnknown, z.ZodTransform<void, unknown>>>>;
|
|
148
|
+
} & {
|
|
149
|
+
[Symbol.dispose](): void;
|
|
150
|
+
}, unknown>>;
|
|
151
|
+
/** A registration lease; close it when the dashboard unmounts. */
|
|
152
|
+
export type WorkbenchDesktopRegistration = {
|
|
153
|
+
/** Release this host registration. */
|
|
154
|
+
close(): Promise<void>;
|
|
155
|
+
};
|
|
156
|
+
/** A host-owned change subscription; close it when no longer visible. */
|
|
157
|
+
export type WorkbenchGillWatch = {
|
|
158
|
+
/** Release this host registration. */
|
|
159
|
+
close(): Promise<void>;
|
|
160
|
+
};
|
|
161
|
+
/** Runtime check for an App-open handoff arriving across an untrusted boundary. */
|
|
162
|
+
export declare const appOpenRequestSchema: Schema.Union<readonly [Schema.Struct<{
|
|
163
|
+
readonly kind: Schema.Literal<"compose">;
|
|
164
|
+
readonly requestId: Schema.String;
|
|
165
|
+
readonly text: Schema.String;
|
|
166
|
+
}>, Schema.Struct<{
|
|
167
|
+
readonly kind: Schema.Literal<"navigate">;
|
|
168
|
+
readonly requestId: Schema.String;
|
|
169
|
+
readonly params: Schema.$Array<Schema.Struct<{
|
|
170
|
+
readonly key: Schema.String;
|
|
171
|
+
readonly value: Schema.String;
|
|
172
|
+
}>>;
|
|
173
|
+
}>]>;
|
|
174
|
+
/** One Team Computer in a host's inventory: the wire of `computers()`. */
|
|
175
|
+
export declare const teamComputerSchema: z.ZodObject<{
|
|
176
|
+
computerId: z.ZodString;
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
createdAt: z.ZodNumber;
|
|
179
|
+
updatedAt: z.ZodNumber;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
/** A decoded Team Computer inventory record. */
|
|
182
|
+
export type TeamComputer = z.output<typeof teamComputerSchema>;
|
|
183
|
+
/** One page of a host's Team Computer inventory. */
|
|
184
|
+
export declare const teamComputerDirectorySchema: z.ZodObject<{
|
|
185
|
+
computers: z.ZodArray<z.ZodObject<{
|
|
186
|
+
computerId: z.ZodString;
|
|
187
|
+
name: z.ZodString;
|
|
188
|
+
createdAt: z.ZodNumber;
|
|
189
|
+
updatedAt: z.ZodNumber;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
192
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { rpcDataSchema, rpcHandleSchema, rpcMethod, rpcVoid, } from "@fungi.computer/agar/rpc";
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { gillRequestSchema } from "@fungi.computer/gills";
|
|
5
|
+
/** A declared Gill request addressed to one host-selected App surface. */
|
|
6
|
+
export const workbenchGillRequestSchema = Schema.Struct({
|
|
7
|
+
surfaceId: Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(513)),
|
|
8
|
+
...gillRequestSchema.fields,
|
|
9
|
+
});
|
|
10
|
+
/** The member chooses a declared Gill and size in host-rendered Settings. */
|
|
11
|
+
export const desktopGillSelectionSchema = z.strictObject({
|
|
12
|
+
surfaceId: z.string().min(1).max(256),
|
|
13
|
+
gillId: z.string().min(1).max(80),
|
|
14
|
+
});
|
|
15
|
+
/** The dashboard layout sizes currently assigned to one Gill. */
|
|
16
|
+
export const desktopGillSizesSchema = z.array(z.enum(["S", "M", "L"])).max(24);
|
|
17
|
+
/** A selected Gill and the layout size requested for a new placement. */
|
|
18
|
+
export const desktopGillAdditionSchema = desktopGillSelectionSchema.extend({
|
|
19
|
+
size: z.enum(["S", "M", "L"]),
|
|
20
|
+
});
|
|
21
|
+
/** Shape of the arranger callbacks the shell supplies to its host. */
|
|
22
|
+
export const desktopSettingsHandlerSchema = rpcHandleSchema({
|
|
23
|
+
readGill: rpcMethod(rpcDataSchema(desktopGillSizesSchema)).input([
|
|
24
|
+
desktopGillSelectionSchema,
|
|
25
|
+
]),
|
|
26
|
+
addGill: rpcVoid.input([desktopGillAdditionSchema]),
|
|
27
|
+
removeGill: rpcVoid.input([desktopGillSelectionSchema]),
|
|
28
|
+
});
|
|
29
|
+
/** Runtime check for an App-open handoff arriving across an untrusted boundary. */
|
|
30
|
+
export const appOpenRequestSchema = Schema.Union([
|
|
31
|
+
Schema.Struct({
|
|
32
|
+
kind: Schema.Literal("compose"),
|
|
33
|
+
requestId: Schema.String,
|
|
34
|
+
text: Schema.String,
|
|
35
|
+
}),
|
|
36
|
+
Schema.Struct({
|
|
37
|
+
kind: Schema.Literal("navigate"),
|
|
38
|
+
requestId: Schema.String,
|
|
39
|
+
params: Schema.Array(Schema.Struct({ key: Schema.String, value: Schema.String })),
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
42
|
+
/** One Team Computer in a host's inventory: the wire of `computers()`. */
|
|
43
|
+
export const teamComputerSchema = z.strictObject({
|
|
44
|
+
computerId: z.string().min(1),
|
|
45
|
+
name: z.string().min(1).max(256),
|
|
46
|
+
createdAt: z.number().int().nonnegative(),
|
|
47
|
+
updatedAt: z.number().int().nonnegative(),
|
|
48
|
+
});
|
|
49
|
+
/** One page of a host's Team Computer inventory. */
|
|
50
|
+
export const teamComputerDirectorySchema = z.strictObject({
|
|
51
|
+
computers: z.array(teamComputerSchema),
|
|
52
|
+
nextOffset: z.number().int().nonnegative().nullable(),
|
|
53
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AppId } from "@fungi.computer/puffball";
|
|
2
|
+
import type { TeamAppPublisherRegistry } from "@fungi.computer/puffball/publisher";
|
|
3
|
+
import type { Artifacts } from "@fungi.computer/burrow";
|
|
4
|
+
import type { PublisherTemplateSeedReceipts } from "./seed-receipt.js";
|
|
5
|
+
export type AppSourceForkResult = Readonly<{
|
|
6
|
+
kind: "forked";
|
|
7
|
+
appId: string;
|
|
8
|
+
repository: string;
|
|
9
|
+
}> | Readonly<{
|
|
10
|
+
kind: "unauthorized" | "conflict" | "provider_unavailable";
|
|
11
|
+
}>;
|
|
12
|
+
/** Fork a verified first-party template source into a Team-owned Artifacts
|
|
13
|
+
* repository (named by the host) and register it as its own App, recovering
|
|
14
|
+
* an existing fork idempotently. The
|
|
15
|
+
* native Artifacts fork is asynchronous; `artifacts.forkRepository` already
|
|
16
|
+
* owns waiting for it to become ready. */
|
|
17
|
+
export declare function forkAppSource(input: Readonly<{
|
|
18
|
+
teamId: string;
|
|
19
|
+
platformAppId: AppId;
|
|
20
|
+
appId: AppId;
|
|
21
|
+
/** The destination Artifacts repository's full provider name. */
|
|
22
|
+
repository: string;
|
|
23
|
+
}>, ports: Readonly<{
|
|
24
|
+
registry: Pick<TeamAppPublisherRegistry, "read" | "register">;
|
|
25
|
+
artifacts: Pick<Artifacts, "recoverForkRepository" | "readDefaultBranchHead" | "forkRepository">;
|
|
26
|
+
receipts: Pick<PublisherTemplateSeedReceipts, "read">;
|
|
27
|
+
}>): Promise<AppSourceForkResult>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { parseSourceRevision } from "@fungi.computer/puffball";
|
|
2
|
+
import { templateRepositoryForApp } from "./template-repository.js";
|
|
3
|
+
/** Fork a verified first-party template source into a Team-owned Artifacts
|
|
4
|
+
* repository (named by the host) and register it as its own App, recovering
|
|
5
|
+
* an existing fork idempotently. The
|
|
6
|
+
* native Artifacts fork is asynchronous; `artifacts.forkRepository` already
|
|
7
|
+
* owns waiting for it to become ready. */
|
|
8
|
+
export async function forkAppSource(input, ports) {
|
|
9
|
+
const { teamId, platformAppId, appId, repository } = input;
|
|
10
|
+
const { registry, artifacts, receipts } = ports;
|
|
11
|
+
const platform = await registry.read(platformAppId);
|
|
12
|
+
if (platform.kind !== "found" ||
|
|
13
|
+
platform.registration.source.provider !== "artifacts" ||
|
|
14
|
+
platform.registration.source.repository !==
|
|
15
|
+
templateRepositoryForApp(platformAppId))
|
|
16
|
+
return { kind: "unauthorized" };
|
|
17
|
+
const template = platform.registration.source.repository;
|
|
18
|
+
let fork = await artifacts.recoverForkRepository({ template, repository });
|
|
19
|
+
if (fork === null) {
|
|
20
|
+
const head = await artifacts.readDefaultBranchHead(template);
|
|
21
|
+
if (head === null)
|
|
22
|
+
return { kind: "provider_unavailable" };
|
|
23
|
+
const seedReceipt = await receipts.read(platformAppId, parseSourceRevision(`git:${head}`));
|
|
24
|
+
if (seedReceipt === null)
|
|
25
|
+
return { kind: "conflict" };
|
|
26
|
+
fork = await artifacts.forkRepository({
|
|
27
|
+
template,
|
|
28
|
+
repository,
|
|
29
|
+
expectedMainHead: head,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (fork.repository.name !== repository)
|
|
33
|
+
return { kind: "conflict" };
|
|
34
|
+
const forkRevision = parseSourceRevision(`git:${fork.mainHead}`);
|
|
35
|
+
if ((await receipts.read(platformAppId, forkRevision)) === null)
|
|
36
|
+
return { kind: "conflict" };
|
|
37
|
+
const registration = await registry.register({
|
|
38
|
+
appId,
|
|
39
|
+
teamId,
|
|
40
|
+
source: { provider: "artifacts", repository, branch: "main" },
|
|
41
|
+
templateSeed: { appId: platformAppId, revision: forkRevision },
|
|
42
|
+
});
|
|
43
|
+
if (registration.kind === "conflict")
|
|
44
|
+
return { kind: "conflict" };
|
|
45
|
+
return { kind: "forked", appId, repository };
|
|
46
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** App source seed receipts and the fork algorithm, owned generically here;
|
|
2
|
+
* the Publisher supplies D1 adapters and the retained Git admission
|
|
3
|
+
* transport. The Node-only template writer (`memfs` + `isomorphic-git`) is
|
|
4
|
+
* deliberately not re-exported here: it would drag that dependency into
|
|
5
|
+
* every Worker bundle that only needs the fork/provenance reads below (team
|
|
6
|
+
* rail's RPC surface has no use for it). Import it from
|
|
7
|
+
* `@fungi.computer/oyster/source/template-write` instead. */
|
|
8
|
+
export { templateRepositoryForApp } from "./template-repository.js";
|
|
9
|
+
export { seedReceiptInputSchema, sameReceipt, type PublisherTemplateSeedReceipt, type PublisherTemplateSeedReceipts, } from "./seed-receipt.js";
|
|
10
|
+
export { readTeamAppSeedProvenance, privateTeamBuildSource, TeamAppSourceError, } from "./team-source.js";
|
|
11
|
+
export { forkAppSource, type AppSourceForkResult } from "./fork.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** App source seed receipts and the fork algorithm, owned generically here;
|
|
2
|
+
* the Publisher supplies D1 adapters and the retained Git admission
|
|
3
|
+
* transport. The Node-only template writer (`memfs` + `isomorphic-git`) is
|
|
4
|
+
* deliberately not re-exported here: it would drag that dependency into
|
|
5
|
+
* every Worker bundle that only needs the fork/provenance reads below (team
|
|
6
|
+
* rail's RPC surface has no use for it). Import it from
|
|
7
|
+
* `@fungi.computer/oyster/source/template-write` instead. */
|
|
8
|
+
export { templateRepositoryForApp } from "./template-repository.js";
|
|
9
|
+
export { seedReceiptInputSchema, sameReceipt, } from "./seed-receipt.js";
|
|
10
|
+
export { readTeamAppSeedProvenance, privateTeamBuildSource, TeamAppSourceError, } from "./team-source.js";
|
|
11
|
+
export { forkAppSource } from "./fork.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { appIdSchema, sha256DigestSchema, sourceRevisionSchema } from "@fungi.computer/puffball/effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { type PinnedRecipe } from "../build-contract.js";
|
|
4
|
+
export declare const seedReceiptInputSchema: Schema.Struct<{
|
|
5
|
+
readonly appId: Schema.refine<import("@fungi.computer/puffball").AppId, Schema.String>;
|
|
6
|
+
readonly sourceRevision: Schema.refine<import("@fungi.computer/puffball").SourceRevision, Schema.String>;
|
|
7
|
+
readonly sourceTreeDigest: Schema.refine<import("@fungi.computer/puffball").Sha256Digest, Schema.String>;
|
|
8
|
+
readonly seedRevision: Schema.refine<import("@fungi.computer/puffball").SourceRevision, Schema.String>;
|
|
9
|
+
readonly recipe: Schema.Struct<{
|
|
10
|
+
readonly kind: Schema.optional<Schema.Literals<readonly ["bundled-html", "source-html"]>>;
|
|
11
|
+
readonly bundle: Schema.Literal<true>;
|
|
12
|
+
readonly entry: Schema.String;
|
|
13
|
+
readonly format: Schema.Literals<readonly ["html", "esm", "assets"]>;
|
|
14
|
+
readonly assets: Schema.optional<Schema.Struct<{
|
|
15
|
+
readonly maxManifestBytes: Schema.Number;
|
|
16
|
+
readonly maxObjects: Schema.Number;
|
|
17
|
+
readonly maxObjectBytes: Schema.Number;
|
|
18
|
+
readonly maxTotalBytes: Schema.Number;
|
|
19
|
+
}>>;
|
|
20
|
+
readonly assetBase: Schema.optionalKey<Schema.String>;
|
|
21
|
+
readonly toolchain: Schema.$Record<Schema.String, Schema.String>;
|
|
22
|
+
readonly maxOutputBytes: Schema.Number;
|
|
23
|
+
readonly platform: Schema.Literals<readonly ["browser", "neutral"]>;
|
|
24
|
+
readonly backend: Schema.Union<readonly [Schema.Null, Schema.Struct<{
|
|
25
|
+
readonly entry: Schema.optional<Schema.String>;
|
|
26
|
+
readonly runtime: Schema.Struct<{
|
|
27
|
+
readonly kind: Schema.Literal<"durable-facet">;
|
|
28
|
+
readonly stateSchema: Schema.Number;
|
|
29
|
+
}>;
|
|
30
|
+
readonly compatibilityDate: Schema.String;
|
|
31
|
+
readonly exportName: Schema.String;
|
|
32
|
+
}>]>;
|
|
33
|
+
readonly target: Schema.Tuple<readonly [Schema.Literal<"es2022">]>;
|
|
34
|
+
}>;
|
|
35
|
+
readonly buildRecipeDigest: Schema.refine<import("@fungi.computer/puffball").Sha256Digest, Schema.String>;
|
|
36
|
+
}>;
|
|
37
|
+
export type PublisherTemplateSeedReceipt = Readonly<{
|
|
38
|
+
appId: Schema.Schema.Type<typeof appIdSchema>;
|
|
39
|
+
repository: string;
|
|
40
|
+
sourceRevision: Schema.Schema.Type<typeof sourceRevisionSchema>;
|
|
41
|
+
sourceTreeDigest: Schema.Schema.Type<typeof sha256DigestSchema>;
|
|
42
|
+
seedRevision: Schema.Schema.Type<typeof sourceRevisionSchema>;
|
|
43
|
+
recipe: PinnedRecipe;
|
|
44
|
+
buildRecipeDigest: Schema.Schema.Type<typeof sha256DigestSchema>;
|
|
45
|
+
}>;
|
|
46
|
+
/** Append-only proof that an exact projected template was seeded, keyed by
|
|
47
|
+
* the template's repository and recorded seed revision. The Publisher's D1
|
|
48
|
+
* adapter is the only durable implementation; this is the port it fulfills. */
|
|
49
|
+
export type PublisherTemplateSeedReceipts = Readonly<{
|
|
50
|
+
read(appId: PublisherTemplateSeedReceipt["appId"], seedRevision: PublisherTemplateSeedReceipt["seedRevision"]): Promise<PublisherTemplateSeedReceipt | null>;
|
|
51
|
+
record(input: Schema.Schema.Type<typeof seedReceiptInputSchema>): Promise<PublisherTemplateSeedReceipt>;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const sameReceipt: (left: PublisherTemplateSeedReceipt, right: PublisherTemplateSeedReceipt) => boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { appIdSchema, sha256DigestSchema, sourceRevisionSchema, } from "@fungi.computer/puffball/effect";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import { capturedPinnedRecipeSchema, } from "../build-contract.js";
|
|
4
|
+
export const seedReceiptInputSchema = Schema.Struct({
|
|
5
|
+
appId: appIdSchema,
|
|
6
|
+
sourceRevision: sourceRevisionSchema,
|
|
7
|
+
sourceTreeDigest: sha256DigestSchema,
|
|
8
|
+
seedRevision: sourceRevisionSchema,
|
|
9
|
+
recipe: capturedPinnedRecipeSchema,
|
|
10
|
+
buildRecipeDigest: sha256DigestSchema,
|
|
11
|
+
});
|
|
12
|
+
export const sameReceipt = (left, right) => left.appId === right.appId &&
|
|
13
|
+
left.repository === right.repository &&
|
|
14
|
+
left.sourceRevision === right.sourceRevision &&
|
|
15
|
+
left.sourceTreeDigest === right.sourceTreeDigest &&
|
|
16
|
+
left.seedRevision === right.seedRevision &&
|
|
17
|
+
JSON.stringify(left.recipe) === JSON.stringify(right.recipe) &&
|
|
18
|
+
left.buildRecipeDigest === right.buildRecipeDigest;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TeamAppPublisherRegistry } from "@fungi.computer/puffball/publisher";
|
|
2
|
+
import type { PublisherTemplateSeedReceipt } from "./seed-receipt.js";
|
|
3
|
+
export declare class TeamAppSourceError extends Error {
|
|
4
|
+
readonly code: "denied" | "unavailable";
|
|
5
|
+
constructor(code: "denied" | "unavailable");
|
|
6
|
+
}
|
|
7
|
+
export declare function readTeamAppSeedProvenance(options: {
|
|
8
|
+
appId: string;
|
|
9
|
+
teamId: string;
|
|
10
|
+
registry: TeamAppPublisherRegistry;
|
|
11
|
+
readSeedReceipt(appId: PublisherTemplateSeedReceipt["appId"], seedRevision: PublisherTemplateSeedReceipt["seedRevision"]): Promise<PublisherTemplateSeedReceipt | null>;
|
|
12
|
+
}): Promise<Readonly<{
|
|
13
|
+
appId: string;
|
|
14
|
+
repository: string;
|
|
15
|
+
templateSeed: Readonly<{
|
|
16
|
+
appId: string;
|
|
17
|
+
revision: string;
|
|
18
|
+
}>;
|
|
19
|
+
recipe: PublisherTemplateSeedReceipt["recipe"];
|
|
20
|
+
buildRecipeDigest: PublisherTemplateSeedReceipt["buildRecipeDigest"];
|
|
21
|
+
}>>;
|
|
22
|
+
/** A fork keeps the seed's exact builder; private UI assets use Vite's relative base. */
|
|
23
|
+
export declare function privateTeamBuildSource(source: Awaited<ReturnType<typeof readTeamAppSeedProvenance>>): Readonly<{
|
|
24
|
+
appId: string;
|
|
25
|
+
repository: string;
|
|
26
|
+
templateSeed: Readonly<{
|
|
27
|
+
appId: string;
|
|
28
|
+
revision: string;
|
|
29
|
+
}>;
|
|
30
|
+
recipe: PublisherTemplateSeedReceipt["recipe"];
|
|
31
|
+
buildRecipeDigest: PublisherTemplateSeedReceipt["buildRecipeDigest"];
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { parseAppId } from "@fungi.computer/puffball";
|
|
2
|
+
import { digestPinnedRecipe } from "../build-contract.js";
|
|
3
|
+
import { templateRepositoryForApp } from "./template-repository.js";
|
|
4
|
+
export class TeamAppSourceError extends Error {
|
|
5
|
+
code;
|
|
6
|
+
constructor(code) {
|
|
7
|
+
super(`Team App source ${code}`);
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.name = "TeamAppSourceError";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export async function readTeamAppSeedProvenance(options) {
|
|
13
|
+
const appId = parseAppId(options.appId);
|
|
14
|
+
const authorization = await options.registry.authorize(appId, options.teamId);
|
|
15
|
+
if (authorization.kind !== "authorized")
|
|
16
|
+
throw new TeamAppSourceError("denied");
|
|
17
|
+
const registration = authorization.registration;
|
|
18
|
+
const templateSeed = registration.templateSeed;
|
|
19
|
+
if (registration.source.provider !== "artifacts" ||
|
|
20
|
+
templateSeed === undefined)
|
|
21
|
+
throw new TeamAppSourceError("unavailable");
|
|
22
|
+
const receipt = await options.readSeedReceipt(parseAppId(templateSeed.appId), templateSeed.revision);
|
|
23
|
+
if (receipt?.appId !== templateSeed.appId ||
|
|
24
|
+
receipt.seedRevision !== templateSeed.revision ||
|
|
25
|
+
receipt.repository !== templateRepositoryForApp(templateSeed.appId) ||
|
|
26
|
+
digestPinnedRecipe(receipt.recipe) !== receipt.buildRecipeDigest)
|
|
27
|
+
throw new TeamAppSourceError("unavailable");
|
|
28
|
+
return Object.freeze({
|
|
29
|
+
appId,
|
|
30
|
+
repository: registration.source.repository,
|
|
31
|
+
templateSeed,
|
|
32
|
+
recipe: receipt.recipe,
|
|
33
|
+
buildRecipeDigest: receipt.buildRecipeDigest,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** A fork keeps the seed's exact builder; private UI assets use Vite's relative base. */
|
|
37
|
+
export function privateTeamBuildSource(source) {
|
|
38
|
+
if (source.recipe.format !== "assets")
|
|
39
|
+
return source;
|
|
40
|
+
const recipe = { ...source.recipe, assetBase: "./" };
|
|
41
|
+
return { ...source, recipe, buildRecipeDigest: digestPinnedRecipe(recipe) };
|
|
42
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { parseAppId } from "@fungi.computer/puffball";
|
|
2
|
+
const TEMPLATE_REPOSITORY_PREFIX = "template-";
|
|
3
|
+
/** Derive the private editable source repository from its validated App identity. */
|
|
4
|
+
export function templateRepositoryForApp(appId) {
|
|
5
|
+
const parsed = parseAppId(appId);
|
|
6
|
+
// AppId's maximum 63-character suffix makes this repository at most 72 chars.
|
|
7
|
+
return `${TEMPLATE_REPOSITORY_PREFIX}${parsed.slice("app_".length)}`;
|
|
8
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import type { Artifacts } from "@fungi.computer/burrow";
|
|
3
|
+
import type { PublisherTemplateSeedReceipts } from "./seed-receipt.js";
|
|
4
|
+
/** A bounded operator source upload; decoding happens only at the Publisher boundary. */
|
|
5
|
+
export declare const TEMPLATE_WRITE_MAX_REQUEST_BYTES: number;
|
|
6
|
+
export declare const templateWriteInputSchema: Schema.Struct<{
|
|
7
|
+
readonly appId: Schema.refine<import("@fungi.computer/puffball").AppId, Schema.String>;
|
|
8
|
+
readonly sourceRevision: Schema.refine<import("@fungi.computer/puffball").SourceRevision, Schema.String>;
|
|
9
|
+
readonly sourceTreeDigest: Schema.refine<import("@fungi.computer/puffball").Sha256Digest, Schema.String>;
|
|
10
|
+
readonly recipe: Schema.Struct<{
|
|
11
|
+
readonly kind: Schema.optional<Schema.Literals<readonly ["bundled-html", "source-html"]>>;
|
|
12
|
+
readonly bundle: Schema.Literal<true>;
|
|
13
|
+
readonly entry: Schema.String;
|
|
14
|
+
readonly format: Schema.Literals<readonly ["html", "esm", "assets"]>;
|
|
15
|
+
readonly assets: Schema.optional<Schema.Struct<{
|
|
16
|
+
readonly maxManifestBytes: Schema.Number;
|
|
17
|
+
readonly maxObjects: Schema.Number;
|
|
18
|
+
readonly maxObjectBytes: Schema.Number;
|
|
19
|
+
readonly maxTotalBytes: Schema.Number;
|
|
20
|
+
}>>;
|
|
21
|
+
readonly assetBase: Schema.optionalKey<Schema.String>;
|
|
22
|
+
readonly toolchain: Schema.$Record<Schema.String, Schema.String>;
|
|
23
|
+
readonly maxOutputBytes: Schema.Number;
|
|
24
|
+
readonly platform: Schema.Literals<readonly ["browser", "neutral"]>;
|
|
25
|
+
readonly backend: Schema.Union<readonly [Schema.Null, Schema.Struct<{
|
|
26
|
+
readonly entry: Schema.optional<Schema.String>;
|
|
27
|
+
readonly runtime: Schema.Struct<{
|
|
28
|
+
readonly kind: Schema.Literal<"durable-facet">;
|
|
29
|
+
readonly stateSchema: Schema.Number;
|
|
30
|
+
}>;
|
|
31
|
+
readonly compatibilityDate: Schema.String;
|
|
32
|
+
readonly exportName: Schema.String;
|
|
33
|
+
}>]>;
|
|
34
|
+
readonly target: Schema.Tuple<readonly [Schema.Literal<"es2022">]>;
|
|
35
|
+
}>;
|
|
36
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
37
|
+
readonly path: Schema.String;
|
|
38
|
+
readonly contents: Schema.Uint8ArrayFromBase64;
|
|
39
|
+
}>>;
|
|
40
|
+
}>;
|
|
41
|
+
export type TemplateWriteInput = Schema.Schema.Type<typeof templateWriteInputSchema>;
|
|
42
|
+
/** The Publisher's own `exchangeGit` admission root (`source-git.ts`) stays the
|
|
43
|
+
* sole caller of that physical transport; this port only ever sees a Request
|
|
44
|
+
* in, a Response out, already bound to the one template repository. */
|
|
45
|
+
export type TemplateSourceTransport = Readonly<{
|
|
46
|
+
ensureRepository: Artifacts["ensureRepository"];
|
|
47
|
+
exchangeTemplateGit(repository: string, request: Request): Promise<Response>;
|
|
48
|
+
}>;
|
|
49
|
+
/** The only operator template-write result contains provenance, never custody. */
|
|
50
|
+
export declare function seedPublisherTemplate(receipts: PublisherTemplateSeedReceipts, transport: TemplateSourceTransport, rawAppId: string, request: Request): Promise<{
|
|
51
|
+
readonly kind: "invalid" | "too-large";
|
|
52
|
+
readonly receipt?: undefined;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "conflict";
|
|
55
|
+
readonly receipt?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: "recorded" | "existing";
|
|
58
|
+
readonly receipt: {
|
|
59
|
+
readonly appId: import("@fungi.computer/puffball").AppId;
|
|
60
|
+
readonly repository: string;
|
|
61
|
+
readonly sourceRevision: import("@fungi.computer/puffball").SourceRevision;
|
|
62
|
+
readonly sourceTreeDigest: import("@fungi.computer/puffball").Sha256Digest;
|
|
63
|
+
readonly seedRevision: import("@fungi.computer/puffball").SourceRevision;
|
|
64
|
+
readonly buildRecipeDigest: import("@fungi.computer/puffball").Sha256Digest;
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: "unavailable";
|
|
68
|
+
readonly receipt?: undefined;
|
|
69
|
+
}>;
|