build
Import
Section titled “Import”import * as api from "@fungi.computer/oyster/build";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| class | AppPublisherError | Closed failure boundary for the four private composition stages. |
| class | WorkspaceBuildError | A nested package must own its build graph, never inherit its host’s. |
| type alias | ImmutableArtifactObjects | Write-once object storage for one artifact root. |
| type alias | StagedArtifactObject | One object ready to store under its reference. |
| type alias | StagedBuildOutput | A build’s output manifest and each distinct object it names. |
| type alias | WorkspaceBuildStep | One captured dependency build step. |
| type alias | AppBackendOutput | The checked Worker output of one App backend build. |
| type alias | DefinitionEmission | One App backend build and the declaration derived from it. |
| type alias | AppPublisherCoreConfigInput | App identity and caller-selected recipe inputs before normalization. |
| type alias | PinnedRecipe | Fully resolved recipe with its pinned toolchain. |
| type alias | CapturedSource | A source tree captured into a scoped local snapshot directory. |
| type alias | RawBuildOutput | Compiler bytes or a bounded collection of emitted UI assets. |
| type alias | UiBuildOutput | A complete HTML document or an asset collection. |
| type alias | BuildExecutorOutput | Raw executor result before the recipe owner assigns App surface meaning. |
| type alias | PreparedUiOutput | UI output paired with its immutable artifact media type. |
| type alias | BuildOutput | Complete, non-empty App content accepted by immutable artifact writers. |
| type alias | StoredArtifact | Reference and digest of the persisted App build root. |
| type alias | PreparedCandidate | A locally captured and built candidate awaiting native artifact/catalog custody. |
| type alias | SourceCapture | Four structural roles used by the private composition. |
| type alias | BuildExecutor | Compiles captured source and reads its matching declaration. |
| type alias | ArtifactWriter | Persists one complete App build as immutable artifacts. |
| type alias | ReleaseCreator | Release catalog role needed to record a built candidate. |
| type alias | AppPublisherOptions | Captured build inputs and the resource owners used to publish a candidate. |
| type alias | AppPublisher | Builds and records immutable App Release candidates. |
| type alias | AppCandidatePreparer | Builds a candidate before artifact storage and catalog publication. |
| type alias | AppPublisherStage | The bounded stages reported by AppPublisherError. |
| type alias | CapturedConfig | App identity and normalized recipe with its digest. |
| type alias | FirstPartyAppSourceDistribution | A first-party editable source tree ready to seed into an Artifacts template. |
| type alias | LocalBuildExecutorOptions | How one build executor is composed; never part of a recipe or request. |
| type alias | LocalAppPublisherOptions | Local Git, recipe and artifact directory configuration with a Release catalog. |
| type alias | WorkspaceBuildPolicy | The build policy one manifest declares. |
| type alias | BuildManifest | Manifest metadata with the App-owned build policy decoded. |
| type alias | WorkspaceBuild | One App page build derived from its manifests and package graph. |
| constant | dependencyBuildProgram | Captured-dependency build program with guarded filesystem access. |
| constant | workspaceBuildStepSchema | One captured dependency build step. Paths are relative to the captured snapshot
root. A TypeScript step compiles one config; a Tailwind step compiles one
stylesheet input into its output (the same path for an App’s own stylesheet,
which compiles in place). A script step runs the one package.json script a
workspace dependency names as its build (fungi.build.script), with pnpm, in
that package’s directory; only an admitted Computer build executes it. |
| constant | pinnedRecipeSchema | Canonical recipe policy shared by core and the local adapter. |
| constant | AppPublisherCoreConfigSchema | Core configuration contains only immutable App identity and recipe policy. |
| constant | appBackendExportConditions | Package-export conditions used by the pinned Workers builder. |
| constant | capturedPinnedRecipeSchema | Persisted, fully resolved recipe including its code-owned toolchain. |
| constant | bundledHtmlRecipe | Engine/toolchain-independent input: an already bundled, captured directory. The producer owns compilation; Publisher never discovers its build scripts. These ceilings cannot be raised by a publication request. |
| constant | workspaceBuildPolicySchema | package.json#fungi.build. An App manifest (the manifest nearest the entry)
declares its recipe beside the page policy: react, shellEntry, the workspace
packages whose declared stylesheets compile first (packageStylesheets) and its
own stylesheets, compiled in place, in order. A workspace package declares its
build products: extra TypeScript configs compiled after its
tsconfig.build.json, and its stylesheet input and output; or, instead of
TypeScript configs, the one package.json script that builds it (script),
which only an admitted Computer build runs. Every path is relative to the
manifest that declares it. Dependency-only metadata needs no App recipe; App
callers require one through appBuildRecipe. Unknown fields are refused, so a
builder never silently ignores a policy it does not know. |
| constant | workspaceProjectsArguments | The pnpm arguments that list a source tree’s workspace projects. |
| function | stageBuildOutput() | Stage a build’s bytes: the output manifest that names each object by its digest and size, and each distinct object once. |
| function | writeArtifactRoot() | Write the asset manifest and App root an output manifest names. The objects it names are already stored, and checked, by the caller. |
| function | readBundledHtml() | Read only regular files under the captured entry’s directory. No scripts, dependency hydration, URL rewriting, or access to the producer’s live build. |
| function | createDefinitionEmission() | Build one App backend and derive its declaration from that same build. |
| function | pinsCurrentToolchain() | Whether a pinned recipe pins this Publisher’s current toolchain (its build policy included). An executor refuses any other: a recipe pinned under another policy describes a build this code does not perform. |
| function | digestPinnedRecipe() | Hash every captured build and output-policy input in the Publisher recipe. |
| function | normalizeAppPublisherRecipe() | Decode and normalize Publisher-owned recipe policy for durable seed proof. |
| function | pinnedRecipeObjectBound() | The largest single object a build under this recipe may upload: no larger than the largest output bound the recipe could assign it under. |
| function | fitsPinnedRecipe() | Whether output built elsewhere (a Computer’s candidate manifest) is one this
recipe could assign: the same surfaces and maxOutputBytes bound the preparer
applies here. Asset sizes stay the artifact writer’s policy. |
| function | createAppCandidatePreparer() | Construct one private App Publisher with copied core configuration and roles. |
| function | createCapturedCandidatePreparer() | Prepare a candidate from a previously captured recipe. |
| function | commitPreparedCandidate() | Persist a prepared build through the native artifact and App Release owners. |
| function | createAppPublisher() | Compose capture, compilation, immutable writing and Release recording. |
| function | repositoryEnvironment() | Run a nested repository without inheriting the caller’s Git checkout. |
| function | artifactsGitEnvironment() | Git environment for one authenticated Artifacts fetch; caller validates token. |
| function | hostedArtifactsGitRemote() | Credential-free private route used by the hosted Publisher Git client. |
| function | boundedBundlePolicy() | Requests may tighten the catalog bounds, never raise them. |
| function | createLocalSourceCapture() | Local proving adapter; accepted source policy is intentionally fixed to main. |
| function | createLocalDirectorySourceCapture() | Capture saved App files for local authoring without modifying the customer’s repository. Provenance names the exact temporary Git snapshot, not an existing customer commit. Dependencies and local credentials are not source inputs. |
| function | createArtifactsSourceCapture() | Capture an exact Artifacts commit through a trusted host’s credential-free Git URL. |
| function | createLocalCommitSourceCapture() | Capture one explicit committed revision without manufacturing a branch. |
| function | createFirstPartyAppSourceDistribution() | Project one pinned first-party App and its pnpm workspace dependency graph without changing upstream files or manufacturing Git history. The caller records the returned provenance on the Artifacts template seed commit. |
| function | localSnapshotBuildOptions() | Exact pinned esbuild options shared by local builds and artifact-budget proofs. |
| function | createLocalBuildExecutor() | Local proving adapter; it builds only the captured extracted snapshot. |
| function | createLocalArtifactWriter() | Local proving adapter; the configured root is private and write-once. |
| function | createLocalAppPublisher() | Construct the complete local proving adapter around the provider-neutral core. |
| function | frozenSnapshotInstallArguments() | Frozen hydration policy. Cached bytes are verified and copied into each snapshot. |
| function | readBuildManifest() | Read package metadata once; only fungi.build rejects unknown fields. |
| function | appBuildRecipe() | Select an App recipe and root its paths in the captured source tree. |
| function | resolveWorkspaceBuild() | Derive one App’s page build from the captured source alone: the manifest nearest
entry must be the owning pnpm workspace (or standalone repository root). It
declares the App policy, its runtime imports select its compile roots; their
workspace: dependencies give the compile order, and each dependency’s manifest
declares its own extra build products. |
AppPublisherErrorclass
Section titled “AppPublisherError”Closed failure boundary for the four private composition stages.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AppPublisherError(stage, options?): AppPublisherError;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
stage |
AppPublisherStage |
options? |
ErrorOptions |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor;Properties
Section titled “Properties”readonly _tag: "AppPublisherError";readonly stage: AppPublisherStage;WorkspaceBuildErrorclass
Section titled “WorkspaceBuildError”A nested package must own its build graph, never inherit its host’s.
Extends
Section titled “Extends”Error
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WorkspaceBuildError(directory, ownerDirectory): WorkspaceBuildError;Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
directory |
string |
The nearer package, relative to the captured source root. |
ownerDirectory |
string |
The workspace whose dependencies would otherwise be inherited. |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor;Properties
Section titled “Properties”readonly code: "non_workspace_package" = "non_workspace_package";The nearest package is absent from pnpm’s workspace inventory.
directory
Section titled “directory”readonly directory: string;The nearer package, relative to the captured source root.
ownerDirectory
Section titled “ownerDirectory”readonly ownerDirectory: string;The workspace whose dependencies would otherwise be inherited.
ImmutableArtifactObjectstype alias
Section titled “ImmutableArtifactObjects”type ImmutableArtifactObjects = Readonly<{ create: Promise<"created" | "exists">; read: Promise<Uint8Array<ArrayBufferLike> | null>;}>;Write-once object storage for one artifact root.
StagedArtifactObjecttype alias
Section titled “StagedArtifactObject”type StagedArtifactObject = Readonly<{ artifactRef: ArtifactRef; bytes: Uint8Array; digest: Sha256Digest;}>;One object ready to store under its reference.
StagedBuildOutputtype alias
Section titled “StagedBuildOutput”type StagedBuildOutput = Readonly<{ manifest: CandidateOutputManifest; objects: readonly StagedArtifactObject[];}>;A build’s output manifest and each distinct object it names.
WorkspaceBuildSteptype alias
Section titled “WorkspaceBuildStep”type WorkspaceBuildStep = Schema.Schema.Type<typeof workspaceBuildStepSchema>;One captured dependency build step.
AppBackendOutputtype alias
Section titled “AppBackendOutput”type AppBackendOutput = Readonly<{ file: esbuild.OutputFile; inputs: readonly string[];}>;The checked Worker output of one App backend build.
DefinitionEmissiontype alias
Section titled “DefinitionEmission”type DefinitionEmission = Awaited<ReturnType<typeof createDefinitionEmission>>;One App backend build and the declaration derived from it.
AppPublisherCoreConfigInputtype alias
Section titled “AppPublisherCoreConfigInput”type AppPublisherCoreConfigInput = Schema.Codec.Encoded< typeof AppPublisherCoreConfigSchema>;App identity and caller-selected recipe inputs before normalization.
PinnedRecipetype alias
Section titled “PinnedRecipe”type PinnedRecipe = Schema.Schema.Type<typeof capturedPinnedRecipeSchema>;Fully resolved recipe with its pinned toolchain.
CapturedSourcetype alias
Section titled “CapturedSource”type CapturedSource = Readonly<{ sourceRevision: SourceRevision; sourceTreeDigest: Sha256Digest; snapshotPath: string;}>;A source tree captured into a scoped local snapshot directory.
RawBuildOutputtype alias
Section titled “RawBuildOutput”type RawBuildOutput = | Readonly<{ kind: "bytes"; bytes: Uint8Array; }> | Readonly<{ kind: "assets"; base: string; assets: readonly object[]; }>;Compiler bytes or a bounded collection of emitted UI assets.
UiBuildOutputtype alias
Section titled “UiBuildOutput”type UiBuildOutput = | Readonly<{ kind: "html"; bytes: Uint8Array; }> | Extract< RawBuildOutput, { kind: "assets"; } >;A complete HTML document or an asset collection.
BuildExecutorOutputtype alias
Section titled “BuildExecutorOutput”type BuildExecutorOutput = | RawBuildOutput | Readonly<{ kind: "app"; ui: PreparedUiOutput | null; backend: Uint8Array | null; }>;Raw executor result before the recipe owner assigns App surface meaning.
PreparedUiOutputtype alias
Section titled “PreparedUiOutput”type PreparedUiOutput = | Readonly<{ content: Extract< UiBuildOutput, { kind: "html"; } >; mediaType: "text/html; charset=utf-8"; }> | Readonly<{ content: Extract< UiBuildOutput, { kind: "assets"; } >; mediaType: "application/vnd.fungi.app-assets+json"; }>;UI output paired with its immutable artifact media type.
BuildOutputtype alias
Section titled “BuildOutput”type BuildOutput = | Readonly<{ kind: "ui"; ui: PreparedUiOutput; }> | Readonly<{ kind: "backend"; backend: Uint8Array; }> | (Readonly<{ kind: "app"; ui: PreparedUiOutput; backend: Uint8Array; }> & Readonly<{ declaration?: AppDeclaration; }>);Complete, non-empty App content accepted by immutable artifact writers.
StoredArtifacttype alias
Section titled “StoredArtifact”type StoredArtifact = Readonly<{ artifactRef: ArtifactRef; artifactDigest: Sha256Digest;}>;Reference and digest of the persisted App build root.
PreparedCandidatetype alias
Section titled “PreparedCandidate”type PreparedCandidate = Readonly<{ appId: AppId; releaseId: ReleaseId; output: BuildOutput; provenance: Readonly<{ sourceRevision: SourceRevision; sourceTreeDigest: Sha256Digest; buildRecipeDigest: Sha256Digest; }>;}>;A locally captured and built candidate awaiting native artifact/catalog custody.
SourceCapturetype alias
Section titled “SourceCapture”type SourceCapture = object;Four structural roles used by the private composition.
Properties
Section titled “Properties”capture
Section titled “capture”readonly capture: () => Effect.Effect<CapturedSource, unknown, Scope.Scope>;Acquire a snapshot whose cleanup follows the Effect scope.
Returns
Section titled “Returns”Effect.Effect<CapturedSource, unknown, Scope.Scope>
BuildExecutortype alias
Section titled “BuildExecutor”type BuildExecutor = object;Compiles captured source and reads its matching declaration.
Properties
Section titled “Properties”readonly build: (source, recipe) => Effect.Effect<BuildExecutorOutput, unknown, Scope.Scope>;Compile only the captured source under its pinned recipe.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
CapturedSource |
recipe |
PinnedRecipe |
Returns
Section titled “Returns”Effect.Effect<BuildExecutorOutput, unknown,
Scope.Scope>
declaration?
Section titled “declaration?”readonly optional declaration?: (source, recipe) => Effect.Effect<AppDeclaration, unknown>;Read the App’s declaration from the same captured tree. Every App, a fork included, declares through its own source; there is no other source.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
CapturedSource |
recipe |
PinnedRecipe |
Returns
Section titled “Returns”Effect.Effect<AppDeclaration, unknown>
ArtifactWritertype alias
Section titled “ArtifactWriter”type ArtifactWriter = object;Persists one complete App build as immutable artifacts.
Properties
Section titled “Properties”readonly write: (output) => Effect.Effect<StoredArtifact, unknown>;Persist the App root and return its reference and digest.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
output |
BuildOutput |
Returns
Section titled “Returns”Effect.Effect<StoredArtifact, unknown>
ReleaseCreatortype alias
Section titled “ReleaseCreator”type ReleaseCreator = Pick<AppReleaseCatalog, "createRelease">;Release catalog role needed to record a built candidate.
AppPublisherOptionstype alias
Section titled “AppPublisherOptions”type AppPublisherOptions = Readonly<{ config: AppPublisherCoreConfigInput; releaseCatalog: ReleaseCreator; sourceCapture: SourceCapture; buildExecutor: BuildExecutor; artifactWriter: ArtifactWriter;}>;Captured build inputs and the resource owners used to publish a candidate.
AppPublishertype alias
Section titled “AppPublisher”type AppPublisher = Readonly<{ createCandidate: (releaseId) => Effect.Effect<Release, AppPublisherError>;}>;Builds and records immutable App Release candidates.
AppCandidatePreparertype alias
Section titled “AppCandidatePreparer”type AppCandidatePreparer = Readonly<{ prepareCandidate: ( releaseId, ) => Effect.Effect<PreparedCandidate, AppPublisherError>;}>;Builds a candidate before artifact storage and catalog publication.
AppPublisherStagetype alias
Section titled “AppPublisherStage”type AppPublisherStage = "configuration" | "source" | "build" | "artifact" | "release";The bounded stages reported by AppPublisherError.
CapturedConfigtype alias
Section titled “CapturedConfig”type CapturedConfig = Readonly<{ appId: AppId; recipe: PinnedRecipe; buildRecipeDigest: Sha256Digest;}>;App identity and normalized recipe with its digest.
FirstPartyAppSourceDistributiontype alias
Section titled “FirstPartyAppSourceDistribution”type FirstPartyAppSourceDistribution = Readonly<{ appId: AppId; sourceRevision: SourceRevision; sourceTreeDigest: ReturnType<typeof parseSha256Digest>; appDirectory: string; files: readonly Readonly<{ path: string; contents: Uint8Array; }>[];}>;A first-party editable source tree ready to seed into an Artifacts template.
LocalBuildExecutorOptionstype alias
Section titled “LocalBuildExecutorOptions”type LocalBuildExecutorOptions = Readonly<{ packageStoreDirectory?: string; packageCacheDirectory?: string; packageScripts?: "run"; onPhase?: (phase, milliseconds) => void;}>;How one build executor is composed; never part of a recipe or request.
LocalAppPublisherOptionstype alias
Section titled “LocalAppPublisherOptions”type LocalAppPublisherOptions = Readonly<{ config: unknown; releaseCatalog: ReleaseCreator;}>;Local Git, recipe and artifact directory configuration with a Release catalog.
WorkspaceBuildPolicytype alias
Section titled “WorkspaceBuildPolicy”type WorkspaceBuildPolicy = Schema.Schema.Type< typeof workspaceBuildPolicySchema>;The build policy one manifest declares.
BuildManifesttype alias
Section titled “BuildManifest”type BuildManifest = ReturnType<typeof readBuildManifest>;Manifest metadata with the App-owned build policy decoded.
WorkspaceBuildtype alias
Section titled “WorkspaceBuild”type WorkspaceBuild = Readonly<{ directory: string; packageName: string; react: boolean; shellEntry?: string; dependencies: readonly string[]; steps: readonly WorkspaceBuildStep[];}>;One App page build derived from its manifests and package graph.
dependencyBuildProgramconstant
Section titled “dependencyBuildProgram”const dependencyBuildProgram: string = bundledDependencyBuildProgram;Captured-dependency build program with guarded filesystem access.
workspaceBuildStepSchemaconstant
Section titled “workspaceBuildStepSchema”const workspaceBuildStepSchema: Union< readonly [ Struct<{ kind: Literal<"typescript">; config: String; }>, Struct<{ kind: Literal<"tailwind">; input: String; output: String; }>, Struct<{ kind: Literal<"script">; directory: String; script: String; }>, ]>;One captured dependency build step. Paths are relative to the captured snapshot
root. A TypeScript step compiles one config; a Tailwind step compiles one
stylesheet input into its output (the same path for an App’s own stylesheet,
which compiles in place). A script step runs the one package.json script a
workspace dependency names as its build (fungi.build.script), with pnpm, in
that package’s directory; only an admitted Computer build executes it.
pinnedRecipeSchemaconstant
Section titled “pinnedRecipeSchema”const pinnedRecipeSchema: Struct<{ kind: optional<Literals<readonly ["bundled-html", "source-html"]>>; entry: String; assets: optional< Struct<{ maxManifestBytes: Number; maxObjects: Number; maxObjectBytes: Number; maxTotalBytes: Number; }> >; assetBase: optionalKey<String>; backend: Union< readonly [ Null, Struct<{ entry: optional<String>; runtime: Struct<{ kind: Literal<"durable-facet">; stateSchema: Number; }>; compatibilityDate: String; exportName: String; }>, ] >; maxOutputBytes: Number;}>;Canonical recipe policy shared by core and the local adapter.
AppPublisherCoreConfigSchemaconstant
Section titled “AppPublisherCoreConfigSchema”const AppPublisherCoreConfigSchema: Struct<{ appId: refine<AppId, String>; recipe: Struct<{ kind: optional<Literals<readonly ["bundled-html", "source-html"]>>; entry: String; assets: optional<Struct<{ maxManifestBytes: Number; maxObjects: Number; maxObjectBytes: Number; maxTotalBytes: Number; }>>; assetBase: optionalKey<String>; backend: Union<readonly [Null, Struct<{ entry: optional<String>; runtime: Struct<{ kind: Literal<...>; stateSchema: Number; }>; compatibilityDate: String; exportName: String; }>]>; maxOutputBytes: Number; }>;}>;Core configuration contains only immutable App identity and recipe policy.
appBackendExportConditionsconstant
Section titled “appBackendExportConditions”const appBackendExportConditions: readonly string[];Package-export conditions used by the pinned Workers builder.
capturedPinnedRecipeSchemaconstant
Section titled “capturedPinnedRecipeSchema”const capturedPinnedRecipeSchema: Struct<{ kind: optional<Literals<readonly ["bundled-html", "source-html"]>>; bundle: Literal<true>; entry: String; format: Literals<readonly ["html", "esm", "assets"]>; assets: optional< Struct<{ maxManifestBytes: Number; maxObjects: Number; maxObjectBytes: Number; maxTotalBytes: Number; }> >; assetBase: optionalKey<String>; toolchain: $Record<String, String>; maxOutputBytes: Number; platform: Literals<readonly ["browser", "neutral"]>; backend: Union< readonly [ Null, Struct<{ entry: optional<String>; runtime: Struct<{ kind: Literal<"durable-facet">; stateSchema: Number; }>; compatibilityDate: String; exportName: String; }>, ] >; target: Tuple<readonly [Literal<"es2022">]>;}>;Persisted, fully resolved recipe including its code-owned toolchain.
bundledHtmlRecipeconstant
Section titled “bundledHtmlRecipe”const bundledHtmlRecipe: Readonly<{ kind: "bundled-html"; toolchain: Readonly<{ recipe: "captured-bundled-html-v1"; }>; limits: Readonly<{ maxManifestBytes: 1048576; maxObjects: 1024; maxObjectBytes: 16777216; maxTotalBytes: 67108864; }>; extensions: readonly string[];}>;Engine/toolchain-independent input: an already bundled, captured directory. The producer owns compilation; Publisher never discovers its build scripts. These ceilings cannot be raised by a publication request.
workspaceBuildPolicySchemaconstant
Section titled “workspaceBuildPolicySchema”const workspaceBuildPolicySchema: Struct<{ kind: optional<Literals<readonly ["bundled-html", "source-html"]>>; assets: optional< Struct<{ maxManifestBytes: Number; maxObjects: Number; maxObjectBytes: Number; maxTotalBytes: Number; }> >; assetBase: optionalKey<String>; entry: optional<String>; backend: optional< Union< readonly [ Null, Struct<{ entry: optional<String>; runtime: Struct<{ kind: Literal<"durable-facet">; stateSchema: Number; }>; compatibilityDate: String; exportName: String; }>, ] > >; maxOutputBytes: optional<Number>; react: optional<Boolean>; shellEntry: optional<String>; packageStylesheets: optional<$Array<String>>; stylesheets: optional<$Array<String>>; typescript: optional<$Array<String>>; script: optional<NonEmptyString>; stylesheet: optional< Struct<{ input: String; output: String; }> >;}>;package.json#fungi.build. An App manifest (the manifest nearest the entry)
declares its recipe beside the page policy: react, shellEntry, the workspace
packages whose declared stylesheets compile first (packageStylesheets) and its
own stylesheets, compiled in place, in order. A workspace package declares its
build products: extra TypeScript configs compiled after its
tsconfig.build.json, and its stylesheet input and output; or, instead of
TypeScript configs, the one package.json script that builds it (script),
which only an admitted Computer build runs. Every path is relative to the
manifest that declares it. Dependency-only metadata needs no App recipe; App
callers require one through appBuildRecipe. Unknown fields are refused, so a
builder never silently ignores a policy it does not know.
workspaceProjectsArgumentsconstant
Section titled “workspaceProjectsArguments”const workspaceProjectsArguments: readonly string[];The pnpm arguments that list a source tree’s workspace projects.
stageBuildOutput()function
Section titled “stageBuildOutput()”function stageBuildOutput(output): StagedBuildOutput;Stage a build’s bytes: the output manifest that names each object by its digest and size, and each distinct object once.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
output |
BuildOutput |
Returns
Section titled “Returns”writeArtifactRoot()function
Section titled “writeArtifactRoot()”function writeArtifactRoot( manifest, objects, options,): Promise< Readonly<{ artifactRef: ArtifactRef; artifactDigest: Sha256Digest; }>>;Write the asset manifest and App root an output manifest names. The objects it names are already stored, and checked, by the caller.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
manifest |
| { declaration?: Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …; call: …; }>; events?: Readonly<Record<…, …>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly …[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: …; operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>; }>; kind: "ui"; ui: | { mediaType: "text/html; charset=utf-8"; content: { digest: Sha256Digest; byteLength: number; kind: "html"; }; } | { mediaType: "application/vnd.fungi.app-assets+json"; content: { kind: "assets"; base: string; assets: readonly object[]; }; }; } | { declaration?: Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …; call: …; }>; events?: Readonly<Record<…, …>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly …[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: …; operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>; }>; kind: "backend"; backend: { digest: Sha256Digest; byteLength: number; }; } | { declaration?: Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …; call: …; }>; events?: Readonly<Record<…, …>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly …[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: …; operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>; }>; kind: "app"; ui: | { mediaType: "text/html; charset=utf-8"; content: { digest: Sha256Digest; byteLength: number; kind: "html"; }; } | { mediaType: "application/vnd.fungi.app-assets+json"; content: { kind: "assets"; base: string; assets: readonly object[]; }; }; backend: { digest: Sha256Digest; byteLength: number; }; } |
objects |
ImmutableArtifactObjects |
options |
Readonly<{ rootArtifactRef: ArtifactRef; assetPolicy: AssetBuildPolicy | undefined; }> |
Returns
Section titled “Returns”Promise<Readonly<{ artifactRef: ArtifactRef; artifactDigest:
Sha256Digest; }>>
readBundledHtml()function
Section titled “readBundledHtml()”function readBundledHtml( snapshot, recipe,): Promise< Readonly<{ kind: "assets"; base: string; assets: readonly object[]; }>>;Read only regular files under the captured entry’s directory. No scripts, dependency hydration, URL rewriting, or access to the producer’s live build.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
snapshot |
string |
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
recipe.kind? |
"bundled-html" | "source-html" |
recipe.bundle |
true |
recipe.entry |
string |
recipe.format |
"html" | "assets" | "esm" |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
recipe.assets.maxManifestBytes |
number |
recipe.assets.maxObjects |
number |
recipe.assets.maxObjectBytes |
number |
recipe.assets.maxTotalBytes |
number |
recipe.assetBase? |
string |
recipe.toolchain |
{ [key: string]: string; } |
recipe.maxOutputBytes |
number |
recipe.platform |
"browser" | "neutral" |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
recipe.target |
readonly ["es2022"] |
Returns
Section titled “Returns”Promise<Readonly<{ kind: "assets"; base: string; assets:
readonly object[]; }>>
createDefinitionEmission()function
Section titled “createDefinitionEmission()”function createDefinitionEmission(source, recipe): Promise<{ entryPoints: (entry) => Record<string, string>; outdir: string; plugins: Plugin[]; worker: AppBackendOutput; declare: Promise<Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<...>>>; toolFamily?: Readonly<{ name: ...; list: ...; call: ...; }>; events?: Readonly<Record<..., ...>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (... | ...)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<...>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly ...[]; watch?: AppGillWatch; desktop?: Readonly<...>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: ...; operations: ...; }>[]; sync?: Readonly<{ method: ...; }>; }>; }>>;}>;Build one App backend and derive its declaration from that same build.
A declared fungi.backendDefinition adds a second, build-only entry that
derives the declaration with buildAppDeclaration(appBackend, fungi.app).
esbuild loads every path and resolves every import once per build, so the Worker
serves exactly the definition bytes and module resolution the declaration
describes. The Worker output is then checked to include that definition and no
build-only declaration code, and the declaration output to import nothing at
runtime.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
CapturedSource |
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
recipe.kind? |
"bundled-html" | "source-html" |
recipe.bundle |
true |
recipe.entry |
string |
recipe.format |
"html" | "assets" | "esm" |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
recipe.assets.maxManifestBytes |
number |
recipe.assets.maxObjects |
number |
recipe.assets.maxObjectBytes |
number |
recipe.assets.maxTotalBytes |
number |
recipe.assetBase? |
string |
recipe.toolchain |
{ [key: string]: string; } |
recipe.maxOutputBytes |
number |
recipe.platform |
"browser" | "neutral" |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
recipe.target |
readonly ["es2022"] |
Returns
Section titled “Returns”Promise<{ entryPoints: (entry) => Record<string, string>;
outdir: string; plugins: Plugin[]; worker:
AppBackendOutput; declare: Promise<Readonly<{
api?: Readonly<{ methods: Readonly<Record<string,
Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …;
call: …; }>; events?: Readonly<Record<…, …>>; }>;
displayName?: string; capabilities: readonly ( | "computer.list" |
"computer.readFile" | "computer.writeFile" | "computer.execute" |
"approvals" | "agent.list" | "agent.manage" | "agent.rename" |
"agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" |
"llm.generation" | "media.generation" | "games:servers" |
"git.repository" | "apps.open" | "apps.call" | "app.storage" |
"app.events.emit" | "team.workbenchHost" | "marketplace.browse" |
"marketplace.purchase" | "workflow.run" | "workflow.publish" |
"workflow.arm" | "world" | "channels.read" |
"channels.personal.manage")[]; calls?: readonly Readonly<{ appId:
string; methods: readonly string[]; }>[]; guidance?: string;
handlers: readonly "file.open"[]; receives?: readonly "git.push"[];
icon?: string; roles: readonly ("files" | "dashboard" | "inbox" |
"media" | "sessions" | "terminal")[]; storage?: readonly
Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes:
number; }>[]; commands?: readonly Readonly<{ id: string; title:
string; category: string; description?: string; sigil?: string;
projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{
id: string; source: string; title: string; params?: readonly
…[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[];
backend?: Readonly<{ bindings: readonly Readonly<{ name: …;
operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>;
}>>; }>
pinsCurrentToolchain()function
Section titled “pinsCurrentToolchain()”function pinsCurrentToolchain(recipe): boolean;Whether a pinned recipe pins this Publisher’s current toolchain (its build policy included). An executor refuses any other: a recipe pinned under another policy describes a build this code does not perform.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
recipe.kind? |
"bundled-html" | "source-html" |
recipe.bundle |
true |
recipe.entry |
string |
recipe.format |
"html" | "assets" | "esm" |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
recipe.assets.maxManifestBytes |
number |
recipe.assets.maxObjects |
number |
recipe.assets.maxObjectBytes |
number |
recipe.assets.maxTotalBytes |
number |
recipe.assetBase? |
string |
recipe.toolchain |
{ [key: string]: string; } |
recipe.maxOutputBytes |
number |
recipe.platform |
"browser" | "neutral" |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
recipe.target |
readonly ["es2022"] |
Returns
Section titled “Returns”boolean
digestPinnedRecipe()function
Section titled “digestPinnedRecipe()”function digestPinnedRecipe(recipe): Sha256Digest;Hash every captured build and output-policy input in the Publisher recipe.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
recipe.kind? |
"bundled-html" | "source-html" |
recipe.bundle |
true |
recipe.entry |
string |
recipe.format |
"html" | "assets" | "esm" |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
recipe.assets.maxManifestBytes |
number |
recipe.assets.maxObjects |
number |
recipe.assets.maxObjectBytes |
number |
recipe.assets.maxTotalBytes |
number |
recipe.assetBase? |
string |
recipe.toolchain |
{ [key: string]: string; } |
recipe.maxOutputBytes |
number |
recipe.platform |
"browser" | "neutral" |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
recipe.target |
readonly ["es2022"] |
Returns
Section titled “Returns”Sha256Digest
normalizeAppPublisherRecipe()function
Section titled “normalizeAppPublisherRecipe()”function normalizeAppPublisherRecipe(input): Readonly<{ recipe: PinnedRecipe; buildRecipeDigest: Sha256Digest;}>;Decode and normalize Publisher-owned recipe policy for durable seed proof.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ appId: string; recipe: { kind?: "bundled-html" | "source-html"; entry: string; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; maxOutputBytes: number; }; } |
input.appId |
string |
input.recipe |
{ kind?: "bundled-html" | "source-html"; entry: string; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; maxOutputBytes: number; } |
input.recipe.kind? |
"bundled-html" | "source-html" |
input.recipe.entry |
string |
input.recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
input.recipe.assets.maxManifestBytes |
number |
input.recipe.assets.maxObjects |
number |
input.recipe.assets.maxObjectBytes |
number |
input.recipe.assets.maxTotalBytes |
number |
input.recipe.assetBase? |
string |
input.recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
input.recipe.maxOutputBytes |
number |
Returns
Section titled “Returns”Readonly<{ recipe: PinnedRecipe; buildRecipeDigest:
Sha256Digest; }>
pinnedRecipeObjectBound()function
Section titled “pinnedRecipeObjectBound()”function pinnedRecipeObjectBound(recipe): number;The largest single object a build under this recipe may upload: no larger than the largest output bound the recipe could assign it under.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
recipe.kind? |
"bundled-html" | "source-html" |
recipe.bundle |
true |
recipe.entry |
string |
recipe.format |
"html" | "assets" | "esm" |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
recipe.assets.maxManifestBytes |
number |
recipe.assets.maxObjects |
number |
recipe.assets.maxObjectBytes |
number |
recipe.assets.maxTotalBytes |
number |
recipe.assetBase? |
string |
recipe.toolchain |
{ [key: string]: string; } |
recipe.maxOutputBytes |
number |
recipe.platform |
"browser" | "neutral" |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
recipe.target |
readonly ["es2022"] |
Returns
Section titled “Returns”number
fitsPinnedRecipe()function
Section titled “fitsPinnedRecipe()”function fitsPinnedRecipe(output, recipe): boolean;Whether output built elsewhere (a Computer’s candidate manifest) is one this
recipe could assign: the same surfaces and maxOutputBytes bound the preparer
applies here. Asset sizes stay the artifact writer’s policy.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
output |
| { declaration?: Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …; call: …; }>; events?: Readonly<Record<…, …>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly …[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: …; operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>; }>; kind: "ui"; ui: | { mediaType: "text/html; charset=utf-8"; content: { digest: Sha256Digest; byteLength: number; kind: "html"; }; } | { mediaType: "application/vnd.fungi.app-assets+json"; content: { kind: "assets"; base: string; assets: readonly object[]; }; }; } | { declaration?: Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …; call: …; }>; events?: Readonly<Record<…, …>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly …[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: …; operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>; }>; kind: "backend"; backend: { digest: Sha256Digest; byteLength: number; }; } | { declaration?: Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<…>>>; toolFamily?: Readonly<{ name: …; list: …; call: …; }>; events?: Readonly<Record<…, …>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly (… | …)[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<…>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly …[]; watch?: AppGillWatch; desktop?: Readonly<…>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: …; operations: …; }>[]; sync?: Readonly<{ method: …; }>; }>; }>; kind: "app"; ui: | { mediaType: "text/html; charset=utf-8"; content: { digest: Sha256Digest; byteLength: number; kind: "html"; }; } | { mediaType: "application/vnd.fungi.app-assets+json"; content: { kind: "assets"; base: string; assets: readonly object[]; }; }; backend: { digest: Sha256Digest; byteLength: number; }; } |
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
recipe.kind? |
"bundled-html" | "source-html" |
recipe.bundle |
true |
recipe.entry |
string |
recipe.format |
"html" | "assets" | "esm" |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
recipe.assets.maxManifestBytes |
number |
recipe.assets.maxObjects |
number |
recipe.assets.maxObjectBytes |
number |
recipe.assets.maxTotalBytes |
number |
recipe.assetBase? |
string |
recipe.toolchain |
{ [key: string]: string; } |
recipe.maxOutputBytes |
number |
recipe.platform |
"browser" | "neutral" |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
recipe.target |
readonly ["es2022"] |
Returns
Section titled “Returns”boolean
createAppCandidatePreparer()function
Section titled “createAppCandidatePreparer()”function createAppCandidatePreparer(options): AppCandidatePreparer;Construct one private App Publisher with copied core configuration and roles.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
Pick<AppPublisherOptions, "config" | "sourceCapture" | "buildExecutor"> |
Returns
Section titled “Returns”createCapturedCandidatePreparer()function
Section titled “createCapturedCandidatePreparer()”function createCapturedCandidatePreparer(config, options): AppCandidatePreparer;Prepare a candidate from a previously captured recipe.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config |
CapturedConfig |
options |
Pick<AppPublisherOptions, "sourceCapture" | "buildExecutor"> |
Returns
Section titled “Returns”commitPreparedCandidate()function
Section titled “commitPreparedCandidate()”function commitPreparedCandidate( prepared, options,): Effect<Release, AppPublisherError>;Persist a prepared build through the native artifact and App Release owners.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
prepared |
PreparedCandidate |
options |
Pick<AppPublisherOptions, "artifactWriter" | "releaseCatalog"> |
Returns
Section titled “Returns”Effect<Release, AppPublisherError>
createAppPublisher()function
Section titled “createAppPublisher()”function createAppPublisher(options): AppPublisher;Compose capture, compilation, immutable writing and Release recording.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
AppPublisherOptions |
Returns
Section titled “Returns”repositoryEnvironment()function
Section titled “repositoryEnvironment()”function repositoryEnvironment(): ProcessEnv;Run a nested repository without inheriting the caller’s Git checkout.
Returns
Section titled “Returns”ProcessEnv
artifactsGitEnvironment()function
Section titled “artifactsGitEnvironment()”function artifactsGitEnvironment(token): ProcessEnv;Git environment for one authenticated Artifacts fetch; caller validates token.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
token |
string |
Returns
Section titled “Returns”ProcessEnv
hostedArtifactsGitRemote()function
Section titled “hostedArtifactsGitRemote()”function hostedArtifactsGitRemote(endpoint, repository): string;Credential-free private route used by the hosted Publisher Git client.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
endpoint |
string |
repository |
string |
Returns
Section titled “Returns”string
boundedBundlePolicy()function
Section titled “boundedBundlePolicy()”function boundedBundlePolicy(policy, maxOutputBytes): boolean;Requests may tighten the catalog bounds, never raise them.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
policy |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
policy.maxManifestBytes |
number |
policy.maxObjects |
number |
policy.maxObjectBytes |
number |
policy.maxTotalBytes |
number |
maxOutputBytes |
number |
Returns
Section titled “Returns”boolean
createLocalSourceCapture()function
Section titled “createLocalSourceCapture()”function createLocalSourceCapture(repositoryPath): SourceCapture;Local proving adapter; accepted source policy is intentionally fixed to main.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
repositoryPath |
string |
Returns
Section titled “Returns”createLocalDirectorySourceCapture()function
Section titled “createLocalDirectorySourceCapture()”function createLocalDirectorySourceCapture(directory): SourceCapture;Capture saved App files for local authoring without modifying the customer’s repository. Provenance names the exact temporary Git snapshot, not an existing customer commit. Dependencies and local credentials are not source inputs.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
directory |
string |
Returns
Section titled “Returns”createArtifactsSourceCapture()function
Section titled “createArtifactsSourceCapture()”function createArtifactsSourceCapture(options): SourceCapture;Capture an exact Artifacts commit through a trusted host’s credential-free Git URL.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
{ remote: string; token: string; sourceRevision: SourceRevision; } |
options.remote |
string |
options.token |
string |
options.sourceRevision |
SourceRevision |
Returns
Section titled “Returns”createLocalCommitSourceCapture()function
Section titled “createLocalCommitSourceCapture()”function createLocalCommitSourceCapture( repositoryPath, sourceRevision,): SourceCapture;Capture one explicit committed revision without manufacturing a branch.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
repositoryPath |
string |
sourceRevision |
SourceRevision |
Returns
Section titled “Returns”createFirstPartyAppSourceDistribution()function
Section titled “createFirstPartyAppSourceDistribution()”function createFirstPartyAppSourceDistribution(options): Effect< Readonly<{ appId: AppId; sourceRevision: SourceRevision; sourceTreeDigest: Sha256Digest; appDirectory: string; files: readonly Readonly<{ path: string; contents: Uint8Array; }>[]; }>, unknown>;Project one pinned first-party App and its pnpm workspace dependency graph without changing upstream files or manufacturing Git history. The caller records the returned provenance on the Artifacts template seed commit.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
{ appId: string; source: CapturedSource; entry: string; } |
options.appId |
string |
options.source |
CapturedSource |
options.entry |
string |
Returns
Section titled “Returns”Effect<Readonly<{ appId: AppId; sourceRevision: SourceRevision;
sourceTreeDigest: Sha256Digest; appDirectory: string; files: readonly
Readonly<{ path: string; contents: Uint8Array; }>[]; }>,
unknown>
localSnapshotBuildOptions()function
Section titled “localSnapshotBuildOptions()”function localSnapshotBuildOptions(source, recipe, emission): BuildOptions;Exact pinned esbuild options shared by local builds and artifact-budget proofs.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
source |
CapturedSource |
- |
recipe |
{ kind?: "bundled-html" | "source-html"; bundle: true; entry: string; format: "html" | "assets" | "esm"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; toolchain: { [key: string]: string; }; maxOutputBytes: number; platform: "browser" | "neutral"; backend: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; target: readonly ["es2022"]; } |
- |
recipe.kind? |
"bundled-html" | "source-html" |
- |
recipe.bundle |
true |
- |
recipe.entry |
string |
- |
recipe.format |
"html" | "assets" | "esm" |
- |
recipe.assets? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
- |
recipe.assets.maxManifestBytes |
number |
- |
recipe.assets.maxObjects |
number |
- |
recipe.assets.maxObjectBytes |
number |
- |
recipe.assets.maxTotalBytes |
number |
- |
recipe.assetBase? |
string |
- |
recipe.toolchain |
{ [key: string]: string; } |
- |
recipe.maxOutputBytes |
number |
- |
recipe.platform |
"browser" | "neutral" |
- |
recipe.backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
- |
recipe.target |
readonly ["es2022"] |
- |
emission |
{ entryPoints: (entry) => Record<string, string>; outdir: string; plugins: Plugin[]; worker: AppBackendOutput; declare: Promise<Readonly<{ api?: Readonly<{ methods: Readonly<Record<string, Readonly<{ description: …; input: …; output: …; effect: …; requires: …; pending?: …; hidden?: …; anonymous?: …; present?: …; }>>>; toolFamily?: Readonly<{ name: string; list: string; call: string; }>; events?: Readonly<Record<string, Readonly<…>>>; }>; displayName?: string; capabilities: readonly ( | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage")[]; calls?: readonly Readonly<{ appId: string; methods: readonly string[]; }>[]; guidance?: string; handlers: readonly "file.open"[]; receives?: readonly "git.push"[]; icon?: string; roles: readonly ("files" | "dashboard" | "inbox" | "media" | "sessions" | "terminal")[]; storage?: readonly Readonly<{ key: string; scopes: readonly ("member" | "team")[]; maxBytes: number; }>[]; commands?: readonly Readonly<{ id: string; title: string; category: string; description?: string; sigil?: string; projections?: Readonly<{ bindings?: …; agent?: …; help?: …; menu?: …; palette?: …; slash?: …; }>; }>[]; gills?: readonly Readonly<{ id: string; source: string; title: string; params?: readonly Readonly<…>[]; watch?: AppGillWatch; desktop?: Readonly<{ sizes: …; }>; }>[]; backend?: Readonly<{ bindings: readonly Readonly<{ name: … | … | … | … | … | … | … | … | … | …; operations: readonly …[]; }>[]; sync?: Readonly<{ method: string; }>; }>; }>>; } |
- |
emission.entryPoints |
(entry) => Record<string, string> |
Entries for the one backend build: the Worker and, if defined, its declaration. |
emission.outdir |
string |
- |
emission.plugins |
Plugin[] |
- |
emission.worker |
- |
|
emission.declare |
- |
Returns
Section titled “Returns”BuildOptions
createLocalBuildExecutor()function
Section titled “createLocalBuildExecutor()”function createLocalBuildExecutor(options?): BuildExecutor;Local proving adapter; it builds only the captured extracted snapshot.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
LocalBuildExecutorOptions |
Returns
Section titled “Returns”createLocalArtifactWriter()function
Section titled “createLocalArtifactWriter()”function createLocalArtifactWriter(artifactRoot, assetPolicy?): ArtifactWriter;Local proving adapter; the configured root is private and write-once.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
artifactRoot |
string |
assetPolicy? |
{ maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; } |
assetPolicy.maxManifestBytes? |
number |
assetPolicy.maxObjects? |
number |
assetPolicy.maxObjectBytes? |
number |
assetPolicy.maxTotalBytes? |
number |
Returns
Section titled “Returns”createLocalAppPublisher()function
Section titled “createLocalAppPublisher()”function createLocalAppPublisher(options): AppPublisher;Construct the complete local proving adapter around the provider-neutral core.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
LocalAppPublisherOptions |
Returns
Section titled “Returns”frozenSnapshotInstallArguments()function
Section titled “frozenSnapshotInstallArguments()”function frozenSnapshotInstallArguments( packageStoreDirectory?, packageCacheDirectory?,): string[];Frozen hydration policy. Cached bytes are verified and copied into each snapshot.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
packageStoreDirectory? |
string |
packageCacheDirectory? |
string |
Returns
Section titled “Returns”string[]
readBuildManifest()function
Section titled “readBuildManifest()”function readBuildManifest(packageJson): object;Read package metadata once; only fungi.build rejects unknown fields.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
packageJson |
string |
Returns
Section titled “Returns”object
| Name | Type |
|---|---|
name? |
string |
dependencies? |
object |
scripts? |
object |
fungi |
object |
fungi.appId? |
AppId |
fungi.build |
| { kind?: "bundled-html" | "source-html"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; entry?: string; backend?: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; maxOutputBytes?: number; react?: boolean; shellEntry?: string; packageStylesheets?: readonly string[]; stylesheets?: readonly string[]; typescript?: readonly string[]; script?: string; stylesheet?: { input: string; output: string; }; } | undefined |
appBuildRecipe()function
Section titled “appBuildRecipe()”function appBuildRecipe(manifest, directory): object;Select an App recipe and root its paths in the captured source tree.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
manifest |
{ name?: string; dependencies?: { [key: string]: string; }; scripts?: { [key: string]: string; }; fungi: { appId?: AppId; build: | { kind?: "bundled-html" | "source-html"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; entry?: string; backend?: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; maxOutputBytes?: number; react?: boolean; shellEntry?: string; packageStylesheets?: readonly string[]; stylesheets?: readonly string[]; typescript?: readonly string[]; script?: string; stylesheet?: { input: string; output: string; }; } | undefined; }; } |
manifest.name? |
string |
manifest.dependencies? |
{ [key: string]: string; } |
manifest.scripts? |
{ [key: string]: string; } |
manifest.fungi |
{ appId?: AppId; build: | { kind?: "bundled-html" | "source-html"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; entry?: string; backend?: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; maxOutputBytes?: number; react?: boolean; shellEntry?: string; packageStylesheets?: readonly string[]; stylesheets?: readonly string[]; typescript?: readonly string[]; script?: string; stylesheet?: { input: string; output: string; }; } | undefined; } |
manifest.fungi.appId? |
AppId |
manifest.fungi.build |
| { kind?: "bundled-html" | "source-html"; assets?: { maxManifestBytes: number; maxObjects: number; maxObjectBytes: number; maxTotalBytes: number; }; assetBase?: string; entry?: string; backend?: | { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null; maxOutputBytes?: number; react?: boolean; shellEntry?: string; packageStylesheets?: readonly string[]; stylesheets?: readonly string[]; typescript?: readonly string[]; script?: string; stylesheet?: { input: string; output: string; }; } | undefined |
directory |
string |
Returns
Section titled “Returns”object
| Name | Type | Default value |
|---|---|---|
kind? |
"bundled-html" | "source-html" |
- |
entry |
string |
relativeEntrySchema |
assets? |
object |
- |
assets.maxManifestBytes |
number |
- |
assets.maxObjects |
number |
- |
assets.maxObjectBytes |
number |
- |
assets.maxTotalBytes |
number |
- |
assetBase? |
string |
- |
backend |
| { entry?: string; runtime: { kind: "durable-facet"; stateSchema: number; }; compatibilityDate: string; exportName: string; } | null |
- |
maxOutputBytes |
number |
- |
resolveWorkspaceBuild()function
Section titled “resolveWorkspaceBuild()”function resolveWorkspaceBuild(options): Promise< Readonly<{ directory: string; packageName: string; react: boolean; shellEntry?: string; dependencies: readonly string[]; steps: readonly ( | { kind: "typescript"; config: string; } | { kind: "tailwind"; input: string; output: string; } | { kind: "script"; directory: string; script: string; } )[]; }>>;Derive one App’s page build from the captured source alone: the manifest nearest
entry must be the owning pnpm workspace (or standalone repository root). It
declares the App policy, its runtime imports select its compile roots; their
workspace: dependencies give the compile order, and each dependency’s manifest
declares its own extra build products.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
options |
{ root: string; entry: string; backendEntry?: string | null; projects: string; } |
- |
options.root |
string |
- |
options.entry |
string |
- |
options.backendEntry? |
string | null |
The selected recipe’s backend, if it differs from the manifest recipe. |
options.projects |
string |
pnpm ls -r --depth -1 --json output for the same source tree. |
Returns
Section titled “Returns”Promise<Readonly<{ directory: string; packageName: string;
react: boolean; shellEntry?: string; dependencies: readonly
string[]; steps: readonly ( | { kind: "typescript"; config:
string; } | { kind: "tailwind"; input: string; output: string;
} | { kind: "script"; directory: string; script: string; })[];
}>>