Skip to content
API reference

pack

Import
import * as api from "@fungi.computer/oyster/pack";
Kind Export Description
class InstallationObservationError Observer failure supplies no installation outcome and never cancels its owner.
type alias PackOptions One committed repository and its canonical App build recipe.
type alias PackedRelease A packed Release on disk.
function packRelease() Build an exact local Git commit with the canonical compiler and artifact writer.
function installFromSource() Capture an Artifacts Git commit, build its Release, upload it to an Oyster, and install it, or switch an existing installation to it (installRelease). waitMs starts with the upload/observation phase after packing; a supplied caller signal retains its original lifetime through that phase.
function installRelease() Upload a packed Release to an Oyster and install it. The host installs a new installation (201) or switches an existing one to this Release (200), keeping its state. Uploads precede admission; this helper then waits for the correlated terminal owner receipt, not merely the HTTP acknowledgement. Uploads and observation share the caller signal or explicit waitMs; absent either, the installer owns a twenty-minute default. Expiry does not cancel admitted work and is reported as an unconfirmed observation, not refusal.
function publishSource() Project one exact first-party commit’s editable source, git push it to an Oyster’s own template for that App, and claim the pushed head, so APPS.fork and Computer builds can later read it. The operator owner key authenticates both; it reaches Git only through its config environment and no provider credential ever leaves the Oyster. Answers the claim response: { kind: "recorded" | "existing", receipt } on success.

InstallationObservationErrorclass

Section titled “InstallationObservationError”

Observer failure supplies no installation outcome and never cancels its owner.

  • Error
Signature
new InstallationObservationError(requestId, options?): InstallationObservationError;
Parameter Type
requestId string
options? ErrorOptions

InstallationObservationError

Signature
Error.constructor;
Signature
readonly requestId: string;

PackOptionstype alias

Section titled “PackOptions”
Signature
type PackOptions = Readonly<{
appId: string;
releaseId?: string;
sourceDirectory: string;
sourceRevision: string;
recipe: AppPublisherCoreConfigInput["recipe"];
packageStoreDirectory?: string;
outDirectory: string;
}>;

One committed repository and its canonical App build recipe.


PackedReleasetype alias

Section titled “PackedRelease”
Signature
type PackedRelease = Readonly<{
release: Release;
artifacts: readonly Readonly<{
artifactRef: ArtifactRef;
path: string;
}>[];
}>;

A packed Release on disk.

packRelease()function

Section titled “packRelease()”
Signature
function packRelease(options): Promise<
Readonly<{
release: Release;
artifacts: readonly Readonly<{
artifactRef: ArtifactRef;
path: string;
}>[];
}>
>;

Build an exact local Git commit with the canonical compiler and artifact writer.

Parameter Type
options PackOptions

Promise<Readonly<{ release: Release; artifacts: readonly Readonly<{ artifactRef: ArtifactRef; path: string; }>[]; }>>


installFromSource()function

Section titled “installFromSource()”
Signature
function installFromSource(input): Promise<Response>;

Capture an Artifacts Git commit, build its Release, upload it to an Oyster, and install it, or switch an existing installation to it (installRelease). waitMs starts with the upload/observation phase after packing; a supplied caller signal retains its original lifetime through that phase.

Parameter Type
input Readonly<{ appId: string; releaseId?: 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; }; source: Readonly<{ remote: string; token: string; sourceRevision: string; }>; packageStoreDirectory?: string; url: string; key: string; installationId: string; }> & Readonly<{ waitMs?: number; signal?: AbortSignal; }>

Promise<Response>


installRelease()function

Section titled “installRelease()”
Signature
function installRelease(input): Promise<Response>;

Upload a packed Release to an Oyster and install it. The host installs a new installation (201) or switches an existing one to this Release (200), keeping its state. Uploads precede admission; this helper then waits for the correlated terminal owner receipt, not merely the HTTP acknowledgement. Uploads and observation share the caller signal or explicit waitMs; absent either, the installer owns a twenty-minute default. Expiry does not cancel admitted work and is reported as an unconfirmed observation, not refusal.

Parameter Type
input Readonly<{ directory: string; url: string; key: string; installationId?: string; onAdmitted?: (operation) => void; }> & Readonly<{ waitMs?: number; signal?: AbortSignal; }>

Promise<Response>


publishSource()function

Section titled “publishSource()”
Signature
function publishSource(input): Promise<Response>;

Project one exact first-party commit’s editable source, git push it to an Oyster’s own template for that App, and claim the pushed head, so APPS.fork and Computer builds can later read it. The operator owner key authenticates both; it reaches Git only through its config environment and no provider credential ever leaves the Oyster. Answers the claim response: { kind: "recorded" | "existing", receipt } on success.

Parameter Type
input Readonly<{ appId: string; entry: string; repositoryPath: string; sourceRevision: string; recipe: PackOptions["recipe"]; url: string; key: string; }>

Promise<Response>