Skip to content
API reference

API reference

Kind Export Description
type alias WorkflowPublishedDefinitionContext The installation identity and Git access read from the Workflow publication context.
type alias WorkflowPublishedReader How a host reads one published Workflow definition back out of Git. The Trellis App owns the Git layout (drafts, versions, the copy index); this port only wraps that read into the braid-shaped PublishedDefinition.
type alias WorkflowRunListItem Decoded run row with its pinned publication and display metadata.
type alias ViewerReply Calling member identity, or a refusal returned by the viewer read.
type alias RunDelivery Agent and Session selected to receive run endings.
type alias WorkflowTriggerTarget Published trigger, pinned commit, selected bindings and optional run delivery.
type alias WorkflowTriggerArmTarget Host binding input carries the App-owned immutable row digest, never caller input.
type alias WorkflowDraft One Workflow file’s decoded content.
type alias WorkflowDocument A Workflow file’s content at the commit it was read from.
type alias WorkflowReadGit Read-only Git operations needed to traverse and decode library files.
constant provenanceSchema Source Workflow and commit recorded when importing or forking a document.
constant runBase Shared run request fields: identity, bindings, JSON input and optional delivery.
constant publishedRun Run request pinned to either a published version or an exact Git commit.
constant document Wire document containing definition, node layout, provenance and commit.
constant revisionSchema Nonnegative revision used to fence draft replacements.
constant draftDocument Editable document with a draft revision instead of a published commit.
constant publishedDocument Published document identified by Workflow, version, commit and content digest.
constant saveReply Draft save result, including revision conflict or validation issues.
constant shareReview Share review listing Git access, write/external nodes and trigger configuration.
constant shareCopyReply Import/fork result with the saved draft and review, or a typed refusal.
constant shareExportReply Exported bundle bytes and digest, or a missing/oversized bundle result.
constant publicationIds Mint and validate identities for asynchronous Workflow publication attempts.
constant publicationIdSchema Publication identity accepted by the maintained publication id family.
constant publicationFailure Publication failure categories returned by the host.
constant publicationComplete Completed publication’s exact commit and assigned version.
constant publicationPending Pending publication identified for subsequent status reads.
constant publicationFailed Failed publication and its typed failure reason.
constant publicationStatus Current publication outcome, including an unknown publication identity.
constant publicationElsewhere Another publication attempt currently owns the publication operation.
constant publishReply Publication command result, including pending work, conflict or validation issues.
constant version Published version with commit identity, commit time and commit message.
constant workflow Identify one Workflow within the library.
constant listings Bounded library rows with draft revision and optional published reference.
constant history Bounded Git history rows without a published-version number.
constant libraryPageInput A missing index is not an empty Git repository; only write paths reconstruct it.
constant libraryPage One library page with an optional exclusive cursor for the next page.
constant libraryListing Indexed library page, or an explicit indication that its index is missing.
constant rebuilding A missing screen copy needs an explicit foreground rebuild, never a hidden Git read.
constant documentRead Draft/published document read, absence, or an explicit copy-rebuild state.
constant versionsRead Published version rows, or an explicit copy-rebuild state.
constant rebuildCopiesInput Bounded copy-rebuild continuation, optionally targeting one pinned document.
constant rebuildCopiesReply Copy-rebuild progress and the cursor needed to continue unfinished work.
constant workflowIdSchema Lowercase Workflow slug used by library files and host commands.
constant catalogInputSchema Select the palette index, or one installation’s complete port declarations.
constant catalogReplySchema App method declarations admitted by the host for the current invocation.
constant workflowIssueSchema Validation issue with optional graph, node, trigger, port or edge location.
constant runReply Run admission result, including replay/conflict, invalid input or refusal.
constant cancelReplySchema Cancellation result, an already-terminal run, or an authority refusal.
constant runOutcomeSchema Lifecycle outcome reported for a Workflow run.
constant statusReply Bounded run status snapshot with events, reviews, output and error.
constant answerReviewReply Result of answering a waiting run review, or an invocation refusal.
constant scheduleArmReplySchema Schedule-trigger admission or its refusal details.
constant triggerDisarmReplySchema Trigger disarm result, including an absent trigger or denied invocation.
constant schedulesReplySchema Visible schedule-trigger rows with their next due time and lifecycle state.
constant workflowRunSourceSchema Origin category recorded for a run: manual, schedule, event, Agent or key.
constant workflowRunInitiatedBySchema The Agent Session (sessionId) stays host-side; the wire names only the Agent/key and its grantor.
constant runsReplySchema Bounded recent-run rows with their source, initiator and pinned commit.
constant eventArmReplySchema Event-trigger admission or its refusal details.
constant eventTriggersReplySchema Visible event-trigger rows with emitter, event and current state.
constant repositoryWorkflowSourceSchema A registered repository App as the host reports it to the calling installation: read-only identity from the source owner and the live caller. Hosts and Apps share this wire; an App never imports the host package for it. Reading it neither registers a repository nor selects or runs a Computer.
constant runsInputSchema The App’s WORKFLOWS.runs read, scoped to one Workflow when given.
constant runListItemSchema One listed run, from the stored source of truth plus the App’s own copy of the published document at commit; display metadata never comes from Git.
constant viewerReplySchema The calling member’s own id, so the Runs UI can tell its own runs from a teammate’s (an owner now sees every run in the installation, not only their own) without guessing identity from the list itself.
constant workflowRunRequestIds Typed id codec for Workflow run requests: mint and validate workflow_request_* ids. Hosts derive run ids from the request.
constant runDeliverySchema The Agent Session (chat) that receives the ending of every run it covers.
constant chatsReplySchema One chat the member may choose for run reports: an existing Agent Session.
constant triggerTargetSchema The published trigger supplies cadence or event matching; the host supplies authority scope.
constant scheduleDisarmInputSchema Identify the schedule-trigger registration to disarm.
constant eventDisarmInputSchema Identify the event-trigger registration to disarm.
constant triggerListInputSchema Trigger listing takes no caller-supplied filters.
constant workflowLibraryRepository The read side of a Workflows library’s Git layout, shared by the Workflows App and the hosts that read its published definitions: one repository, trellis, one workflows/<id>.json file per Workflow (its definition plus layout and optional provenance), and one <id>@v<n> tag per published version on main’s ancestry.
constant workflowDraftSchema Decode stored definition, node layout and optional import/fork provenance.
function createWorkflowPublishedDefinitionPort() Trigger arm verification uses current admitted Git; direct starts carry the App’s original row.
function workflowFilePath() Where one Workflow’s file lives in its library repository.
function workflowFiles() Read the immediate Workflow directory without following symlinks or submodules.
function changedWorkflowIds() Changed Workflow IDs in one accepted ref update, including deletions and mode changes.
function inspectWorkflowFile() Decode a pushed file separately from the admitted catalog’s semantic validation.
function readWorkflowAt() One Workflow’s file at commit, or null when it is absent or invalid.
function versionRefs() A Workflow’s published versions, newest first, from its <id>@v<n> tags.
function workflowCommitIsAncestor() Batched first-parent reads retain every merge parent; the caller owns its IO budget.
function listingGit() Each Git object read at most once while one listing runs.
function readPublishedWorkflow() One published Workflow: a version tag, or a commit, on main’s ancestry. copied answers from a caller’s own read copy of that commit when it has one; otherwise the file is read from Git within a bounded read budget.

WorkflowPublishedDefinitionContexttype alias

Section titled “WorkflowPublishedDefinitionContext”
Signature
type WorkflowPublishedDefinitionContext = Pick<
WorkflowPublicationContext,
"installationId" | "git"
>;

The installation identity and Git access read from the Workflow publication context.


WorkflowPublishedReadertype alias

Section titled “WorkflowPublishedReader”
Signature
type WorkflowPublishedReader = Readonly<{
published: Promise<Readonly<{
definition: WorkflowDefinition;
commit: string;
version: number | null;
}> | null>;
}>;

How a host reads one published Workflow definition back out of Git. The Trellis App owns the Git layout (drafts, versions, the copy index); this port only wraps that read into the braid-shaped PublishedDefinition.


WorkflowRunListItemtype alias

Section titled “WorkflowRunListItem”
Signature
type WorkflowRunListItem = z.output<typeof runListItemSchema>;

Decoded run row with its pinned publication and display metadata.


ViewerReplytype alias

Section titled “ViewerReply”
Signature
type ViewerReply = z.output<typeof viewerReplySchema>;

Calling member identity, or a refusal returned by the viewer read.


RunDeliverytype alias

Section titled “RunDelivery”
Signature
type RunDelivery = z.output<typeof runDeliverySchema>;

Agent and Session selected to receive run endings.


WorkflowTriggerTargettype alias

Section titled “WorkflowTriggerTarget”
Signature
type WorkflowTriggerTarget = z.output<typeof triggerTargetSchema>;

Published trigger, pinned commit, selected bindings and optional run delivery.


WorkflowTriggerArmTargettype alias

Section titled “WorkflowTriggerArmTarget”
Signature
type WorkflowTriggerArmTarget = WorkflowTriggerTarget &
Readonly<{
digest: string;
}>;

Host binding input carries the App-owned immutable row digest, never caller input.


WorkflowDrafttype alias

Section titled “WorkflowDraft”
Signature
type WorkflowDraft = typeof workflowDraftSchema.Type;

One Workflow file’s decoded content.


WorkflowDocumenttype alias

Section titled “WorkflowDocument”
Signature
type WorkflowDocument = WorkflowDraft & object;

A Workflow file’s content at the commit it was read from.

Name Type Description
commit string Exact Git commit from which the document was read.

WorkflowReadGittype alias

Section titled “WorkflowReadGit”
Signature
type WorkflowReadGit = Pick<GitBinding, "readCommit" | "readTree" | "readBlob">;

Read-only Git operations needed to traverse and decode library files.

provenanceSchemaconstant

Section titled “provenanceSchema”
Signature
const provenanceSchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodLiteral<"import">;
workflowId: ZodString;
version: ZodNumber;
commit: ZodString;
sha256: ZodString &
ZodType<
string & object,
string,
$ZodTypeInternals<string & object, string>
>;
origin: ZodOptional<ZodString>;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"fork">;
workflowId: ZodString;
commit: ZodString;
},
$strict
>,
]
>
>;

Source Workflow and commit recorded when importing or forking a document.


runBaseconstant

Section titled “runBase”
Signature
const runBase: ZodObject<
{
requestId: ZodString;
workflowId: ZodString;
bindings: ZodRecord<
ZodLazy<ZodString>,
ZodUnion<
readonly [
ZodString,
ZodLazy<
ZodObject<
{
kind: ZodLiteral<"team-source">;
},
$strict
>
>,
]
>
>;
input: ZodRecord<ZodString, ZodJSONSchema>;
delivery: ZodOptional<
ZodObject<
{
agentId: ZodString;
sessionId: ZodString;
},
$strict
>
>;
},
$strict
>;

Shared run request fields: identity, bindings, JSON input and optional delivery.


publishedRunconstant

Section titled “publishedRun”
Signature
const publishedRun: ZodLazy<ZodUnion<readonly [ZodObject<{
requestId: ZodString;
workflowId: ZodString;
bindings: ZodRecord<ZodLazy<ZodString>, ZodUnion<readonly [ZodString, ZodLazy<ZodObject<{
kind: ...;
}, $strict>>]>>;
input: ZodRecord<ZodString, ZodJSONSchema>;
delivery: ZodOptional<ZodObject<{
agentId: ZodString;
sessionId: ZodString;
}, $strict>>;
version: ZodNumber;
}, $strict>, ZodObject<{
requestId: ZodString;
workflowId: ZodString;
bindings: ZodRecord<ZodLazy<ZodString>, ZodUnion<readonly [ZodString, ZodLazy<ZodObject<{
kind: ...;
}, $strict>>]>>;
input: ZodRecord<ZodString, ZodJSONSchema>;
delivery: ZodOptional<ZodObject<{
agentId: ZodString;
sessionId: ZodString;
}, $strict>>;
commit: ZodString;
}, $strict>]>>;

Run request pinned to either a published version or an exact Git commit.


documentconstant

Section titled “document”
Signature
const document: ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<readonly [ZodObject<{
kind: ZodLiteral<"import">;
workflowId: ZodString;
version: ZodNumber;
commit: ZodString;
sha256: ZodString & ZodType<... & ..., string, $ZodTypeInternals<..., ...>>;
origin: ZodOptional<ZodString>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"fork">;
workflowId: ZodString;
commit: ZodString;
}, $strict>]>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ZodNumber;
y: ZodNumber;
}, $strict>>;
commit: ZodString;
}, $strict>;

Wire document containing definition, node layout, provenance and commit.


revisionSchemaconstant

Section titled “revisionSchema”
Signature
const revisionSchema: ZodNumber;

Nonnegative revision used to fence draft replacements.


draftDocumentconstant

Section titled “draftDocument”
Signature
const draftDocument: ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<readonly [ZodObject<{
kind: ZodLiteral<"import">;
workflowId: ZodString;
version: ZodNumber;
commit: ZodString;
sha256: ZodString & ZodType<... & ..., string, $ZodTypeInternals<..., ...>>;
origin: ZodOptional<ZodString>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"fork">;
workflowId: ZodString;
commit: ZodString;
}, $strict>]>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ZodNumber;
y: ZodNumber;
}, $strict>>;
revision: ZodNumber;
}, $strict>;

Editable document with a draft revision instead of a published commit.


publishedDocumentconstant

Section titled “publishedDocument”
Signature
const publishedDocument: ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<readonly [ZodObject<{
kind: ZodLiteral<"import">;
workflowId: ZodString;
version: ZodNumber;
commit: ZodString;
sha256: ZodString & ZodType<... & ..., string, $ZodTypeInternals<..., ...>>;
origin: ZodOptional<ZodString>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"fork">;
workflowId: ZodString;
commit: ZodString;
}, $strict>]>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ZodNumber;
y: ZodNumber;
}, $strict>>;
commit: ZodString;
workflowId: ZodString;
version: ZodNumber;
digest: ZodString & ZodType<string & object, string, $ZodTypeInternals<string & object, string>>;
}, $strict>;

Published document identified by Workflow, version, commit and content digest.


saveReplyconstant

Section titled “saveReply”
Signature
const saveReply: ZodUnion<readonly [ZodObject<{
kind: ZodLiteral<"saved">;
revision: ZodNumber;
}, $strict>, ZodObject<{
kind: ZodLiteral<"conflict">;
current: ZodNullable<ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<readonly [..., ...]>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ZodNumber;
y: ZodNumber;
}, $strict>>;
revision: ZodNumber;
}, $strict>>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"invalid">;
issues: ZodArray<ZodLazy<ZodObject<{
code: ZodString;
message: ZodString;
graph: ZodOptional<ZodString>;
node: ZodOptional<ZodString>;
trigger: ZodOptional<ZodString>;
port: ZodOptional<ZodString>;
edge: ZodOptional<ZodNumber>;
}, $strip>>>;
}, $strict>]>;

Draft save result, including revision conflict or validation issues.


shareReviewconstant

Section titled “shareReview”
Signature
const shareReview: ZodObject<
{
gitAccess: ZodArray<
ZodUnion<
readonly [
ZodObject<
{
binding: ZodLazy<ZodString>;
repository: ZodString;
branches: ZodLazy<ZodArray<ZodString>>;
graph: ZodString;
node: ZodString;
},
$strict
>,
ZodObject<
{
binding: ZodLazy<ZodString>;
repository: ZodUnion<
readonly [ZodString, ZodLiteral<"$trigger.repository">]
>;
access: ZodLiteral<"read">;
graph: ZodString;
node: ZodString;
},
$strict
>,
]
>
>;
writeNodes: ZodArray<
ZodObject<
{
graph: ZodString;
node: ZodString;
appId: ZodString;
method: ZodString;
effect: ZodEnum<{
write: "write";
external: "external";
}>;
},
$strict
>
>;
triggers: ZodArray<ZodJSONSchema>;
},
$strict
>;

Share review listing Git access, write/external nodes and trigger configuration.


shareCopyReplyconstant

Section titled “shareCopyReply”
Signature
const shareCopyReply: ZodLazy<ZodUnion<readonly [ZodObject<{
kind: ZodLiteral<"saved">;
revision: ZodNumber;
title: ZodString;
review: ZodObject<{
gitAccess: ZodArray<ZodUnion<readonly [ZodObject<..., ...>, ZodObject<..., ...>]>>;
writeNodes: ZodArray<ZodObject<{
graph: ZodString;
node: ZodString;
appId: ZodString;
method: ZodString;
effect: ZodEnum<...>;
}, $strict>>;
triggers: ZodArray<ZodJSONSchema>;
}, $strict>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"conflict">;
current: ZodNullable<ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<...>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ...;
y: ...;
}, $strict>>;
revision: ZodNumber;
}, $strict>>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"invalid">;
issues: ZodArray<ZodLazy<ZodObject<{
code: ZodString;
message: ZodString;
graph: ZodOptional<ZodString>;
node: ZodOptional<ZodString>;
trigger: ZodOptional<ZodString>;
port: ZodOptional<ZodString>;
edge: ZodOptional<ZodNumber>;
}, $strip>>>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"missing_apps">;
appIds: ZodArray<ZodString>;
}, $strict>, ZodObject<{
kind: ZodEnum<{
not_found: "not_found";
too_large: "too_large";
digest_mismatch: "digest_mismatch";
invalid_bundle: "invalid_bundle";
}>;
}, $strict>]>>;

Import/fork result with the saved draft and review, or a typed refusal.


shareExportReplyconstant

Section titled “shareExportReply”
Signature
const shareExportReply: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
bytes: ZodString;
sha256: ZodString &
ZodType<
string & object,
string,
$ZodTypeInternals<string & object, string>
>;
},
$strict
>,
ZodObject<
{
kind: ZodEnum<{
not_found: "not_found";
too_large: "too_large";
}>;
},
$strict
>,
]
>
>;

Exported bundle bytes and digest, or a missing/oversized bundle result.


publicationIdsconstant

Section titled “publicationIds”
Signature
const publicationIds: Readonly<{
publication: IdCodec<"workflow-publication", "publication", 1>;
}>;

Mint and validate identities for asynchronous Workflow publication attempts.


publicationIdSchemaconstant

Section titled “publicationIdSchema”
Signature
const publicationIdSchema: ZodLazy<
ZodString &
ZodType<
CairnId<"workflow-publication", "publication", 1>,
string,
$ZodTypeInternals<
CairnId<"workflow-publication", "publication", 1>,
string
>
>
>;

Publication identity accepted by the maintained publication id family.


publicationFailureconstant

Section titled “publicationFailure”
Signature
const publicationFailure: ZodEnum<{
too_large: "too_large";
git_conflict: "git_conflict";
publication_failed: "publication_failed";
access_changed: "access_changed";
}>;

Publication failure categories returned by the host.


publicationCompleteconstant

Section titled “publicationComplete”
Signature
const publicationComplete: ZodLazy<
ZodObject<
{
kind: ZodLiteral<"published">;
commit: ZodString;
version: ZodNumber;
},
$strict
>
>;

Completed publication’s exact commit and assigned version.


publicationPendingconstant

Section titled “publicationPending”
Signature
const publicationPending: ZodLazy<
ZodObject<
{
kind: ZodLiteral<"publishing">;
publicationId: ZodLazy<
ZodString &
ZodType<
CairnId<"workflow-publication", "publication", 1>,
string,
$ZodTypeInternals<
CairnId<"workflow-publication", "publication", 1>,
string
>
>
>;
},
$strict
>
>;

Pending publication identified for subsequent status reads.


publicationFailedconstant

Section titled “publicationFailed”
Signature
const publicationFailed: ZodLazy<
ZodObject<
{
kind: ZodLiteral<"failed">;
reason: ZodEnum<{
too_large: "too_large";
git_conflict: "git_conflict";
publication_failed: "publication_failed";
access_changed: "access_changed";
}>;
},
$strict
>
>;

Failed publication and its typed failure reason.


publicationStatusconstant

Section titled “publicationStatus”
Signature
const publicationStatus: ZodLazy<ZodUnion<readonly [ZodLazy<ZodObject<{
kind: ZodLiteral<"publishing">;
publicationId: ZodLazy<ZodString & ZodType<CairnId<"workflow-publication", "publication", 1>, string, $ZodTypeInternals<CairnId<..., ..., ...>, string>>>;
}, $strict>>, ZodLazy<ZodObject<{
kind: ZodLiteral<"published">;
commit: ZodString;
version: ZodNumber;
}, $strict>>, ZodLazy<ZodObject<{
kind: ZodLiteral<"failed">;
reason: ZodEnum<{
too_large: "too_large";
git_conflict: "git_conflict";
publication_failed: "publication_failed";
access_changed: "access_changed";
}>;
}, $strict>>, ZodObject<{
kind: ZodLiteral<"not_found">;
}, $strict>]>>;

Current publication outcome, including an unknown publication identity.


publicationElsewhereconstant

Section titled “publicationElsewhere”
Signature
const publicationElsewhere: ZodLazy<
ZodObject<
{
kind: ZodLiteral<"publishing_elsewhere">;
},
$strict
>
>;

Another publication attempt currently owns the publication operation.


publishReplyconstant

Section titled “publishReply”
Signature
const publishReply: ZodLazy<ZodUnion<readonly [ZodLazy<ZodObject<{
kind: ZodLiteral<"publishing_elsewhere">;
}, $strict>>, ZodLazy<ZodObject<{
kind: ZodLiteral<"published">;
commit: ZodString;
version: ZodNumber;
}, $strict>>, ZodLazy<ZodObject<{
kind: ZodLiteral<"publishing">;
publicationId: ZodLazy<ZodString & ZodType<CairnId<"workflow-publication", "publication", 1>, string, $ZodTypeInternals<CairnId<..., ..., ...>, string>>>;
}, $strict>>, ZodLazy<ZodObject<{
kind: ZodLiteral<"failed">;
reason: ZodEnum<{
too_large: "too_large";
git_conflict: "git_conflict";
publication_failed: "publication_failed";
access_changed: "access_changed";
}>;
}, $strict>>, ZodObject<{
kind: ZodLiteral<"conflict">;
head: ZodNullable<ZodString>;
}, $strict>, ZodObject<{
kind: ZodLiteral<"invalid">;
issues: ZodArray<ZodLazy<ZodObject<{
code: ZodString;
message: ZodString;
graph: ZodOptional<ZodString>;
node: ZodOptional<ZodString>;
trigger: ZodOptional<ZodString>;
port: ZodOptional<ZodString>;
edge: ZodOptional<ZodNumber>;
}, $strip>>>;
}, $strict>]>>;

Publication command result, including pending work, conflict or validation issues.


versionconstant

Section titled “version”
Signature
const version: ZodObject<
{
version: ZodNumber;
commit: ZodString;
committedAt: ZodNumber;
message: ZodString;
},
$strict
>;

Published version with commit identity, commit time and commit message.


workflowconstant

Section titled “workflow”
Signature
const workflow: ZodObject<
{
workflowId: ZodString;
},
$strict
>;

Identify one Workflow within the library.


listingsconstant

Section titled “listings”
Signature
const listings: ZodLazy<
ZodArray<
ZodObject<
{
workflowId: ZodString;
title: ZodString;
draftRevision: ZodNullable<ZodNumber>;
published: ZodNullable<
ZodObject<
{
commit: ZodString;
version: ZodNullable<ZodNumber>;
},
$strict
>
>;
},
$strict
>
>
>;

Bounded library rows with draft revision and optional published reference.


historyconstant

Section titled “history”
Signature
const history: ZodArray<
ZodObject<
{
commit: ZodString;
committedAt: ZodNumber;
message: ZodString;
},
$strict
>
>;

Bounded Git history rows without a published-version number.


libraryPageInputconstant

Section titled “libraryPageInput”
Signature
const libraryPageInput: ZodLazy<
ZodObject<
{
limit: ZodDefault<ZodNumber>;
after: ZodOptional<ZodString>;
},
$strict
>
>;

A missing index is not an empty Git repository; only write paths reconstruct it.


libraryPageconstant

Section titled “libraryPage”
Signature
const libraryPage: ZodLazy<ZodObject<{
items: ZodLazy<ZodArray<ZodObject<{
workflowId: ZodString;
title: ZodString;
draftRevision: ZodNullable<ZodNumber>;
published: ZodNullable<ZodObject<{
commit: ZodString;
version: ZodNullable<...>;
}, $strict>>;
}, $strict>>>;
next: ZodOptional<ZodString>;
}, $strict>>;

One library page with an optional exclusive cursor for the next page.


libraryListingconstant

Section titled “libraryListing”
Signature
const libraryListing: ZodLazy<ZodUnion<readonly [ZodLazy<ZodObject<{
items: ZodLazy<ZodArray<ZodObject<{
workflowId: ZodString;
title: ZodString;
draftRevision: ZodNullable<...>;
published: ZodNullable<...>;
}, $strict>>>;
next: ZodOptional<ZodString>;
}, $strict>>, ZodObject<{
kind: ZodLiteral<"unindexed">;
}, $strict>]>>;

Indexed library page, or an explicit indication that its index is missing.


rebuildingconstant

Section titled “rebuilding”
Signature
const rebuilding: ZodLazy<
ZodObject<
{
kind: ZodLiteral<"rebuilding">;
},
$strict
>
>;

A missing screen copy needs an explicit foreground rebuild, never a hidden Git read.


documentReadconstant

Section titled “documentRead”
Signature
const documentRead: ZodLazy<ZodUnion<readonly [ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<readonly [ZodObject<{
kind: ...;
workflowId: ...;
version: ...;
commit: ...;
sha256: ...;
origin: ...;
}, $strict>, ZodObject<{
kind: ...;
workflowId: ...;
commit: ...;
}, $strict>]>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ZodNumber;
y: ZodNumber;
}, $strict>>;
revision: ZodNumber;
}, $strict>, ZodObject<{
provenance: ZodOptional<ZodLazy<ZodUnion<readonly [ZodObject<{
kind: ...;
workflowId: ...;
version: ...;
commit: ...;
sha256: ...;
origin: ...;
}, $strict>, ZodObject<{
kind: ...;
workflowId: ...;
commit: ...;
}, $strict>]>>>;
definition: ZodRecord<ZodString, ZodJSONSchema>;
layout: ZodRecord<ZodString, ZodObject<{
x: ZodNumber;
y: ZodNumber;
}, $strict>>;
commit: ZodString;
}, $strict>, ZodNull, ZodLazy<ZodObject<{
kind: ZodLiteral<"rebuilding">;
}, $strict>>]>>;

Draft/published document read, absence, or an explicit copy-rebuild state.


versionsReadconstant

Section titled “versionsRead”
Signature
const versionsRead: ZodLazy<
ZodUnion<
readonly [
ZodArray<
ZodObject<
{
version: ZodNumber;
commit: ZodString;
committedAt: ZodNumber;
message: ZodString;
},
$strict
>
>,
ZodLazy<
ZodObject<
{
kind: ZodLiteral<"rebuilding">;
},
$strict
>
>,
]
>
>;

Published version rows, or an explicit copy-rebuild state.


rebuildCopiesInputconstant

Section titled “rebuildCopiesInput”
Signature
const rebuildCopiesInput: ZodLazy<
ZodObject<
{
cursor: ZodNullable<ZodString>;
target: ZodOptional<
ZodObject<
{
workflowId: ZodString;
at: ZodObject<
{
commit: ZodString;
},
$strict
>;
},
$strict
>
>;
},
$strict
>
>;

Bounded copy-rebuild continuation, optionally targeting one pinned document.


rebuildCopiesReplyconstant

Section titled “rebuildCopiesReply”
Signature
const rebuildCopiesReply: ZodLazy<
ZodObject<
{
done: ZodBoolean;
cursor: ZodNullable<ZodString>;
},
$strict
>
>;

Copy-rebuild progress and the cursor needed to continue unfinished work.


workflowIdSchemaconstant

Section titled “workflowIdSchema”
Signature
const workflowIdSchema: ZodString;

Lowercase Workflow slug used by library files and host commands.


catalogInputSchemaconstant

Section titled “catalogInputSchema”
Signature
const catalogInputSchema: ZodLazy<
ZodObject<
{
installationId: ZodOptional<ZodString>;
},
$strict
>
>;

Select the palette index, or one installation’s complete port declarations.


catalogReplySchemaconstant

Section titled “catalogReplySchema”
Signature
const catalogReplySchema: ZodLazy<ZodUnion<readonly [ZodObject<{
apps: ZodArray<ZodLazy<ZodObject<{
installationId: ZodString;
appId: ZodString;
displayName: ZodString;
icon: ZodOptional<ZodString>;
capabilities: ZodOptional<ZodArray<...>>;
workflowPublishGranted: ZodOptional<ZodBoolean>;
workflowRunGranted: ZodOptional<ZodBoolean>;
methods: ZodRecord<ZodString, ZodLazy<...>>;
events: ZodOptional<ZodRecord<..., ...>>;
}, $strict>>>;
}, $strict>, ZodObject<{
app: ZodLazy<ZodObject<{
installationId: ZodString;
appId: ZodString;
displayName: ZodString;
icon: ZodOptional<ZodString>;
capabilities: ZodOptional<ZodArray<ZodEnum<...>>>;
workflowPublishGranted: ZodOptional<ZodBoolean>;
workflowRunGranted: ZodOptional<ZodBoolean>;
methods: ZodRecord<ZodString, ZodJSONSchema>;
events: ZodOptional<ZodRecord<ZodString, ZodJSONSchema>>;
}, $strict>>;
}, $strict>, ZodObject<{
error: ZodString;
}, $strict>]>>;

App method declarations admitted by the host for the current invocation.


workflowIssueSchemaconstant

Section titled “workflowIssueSchema”
Signature
const workflowIssueSchema: ZodLazy<
ZodObject<
{
code: ZodString;
message: ZodString;
graph: ZodOptional<ZodString>;
node: ZodOptional<ZodString>;
trigger: ZodOptional<ZodString>;
port: ZodOptional<ZodString>;
edge: ZodOptional<ZodNumber>;
},
$strip
>
>;

Validation issue with optional graph, node, trigger, port or edge location.


runReplyconstant

Section titled “runReply”
Signature
const runReply: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodEnum<{
started: "started";
replay: "replay";
conflict: "conflict";
}>;
runId: ZodString;
planDigest: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"invalid">;
issues: ZodArray<
ZodLazy<
ZodObject<
{
code: ZodString;
message: ZodString;
graph: ZodOptional<ZodString>;
node: ZodOptional<ZodString>;
trigger: ZodOptional<ZodString>;
port: ZodOptional<ZodString>;
edge: ZodOptional<ZodNumber>;
},
$strip
>
>
>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Run admission result, including replay/conflict, invalid input or refusal.


cancelReplySchemaconstant

Section titled “cancelReplySchema”
Signature
const cancelReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodEnum<{
cancelled: "cancelled";
terminal: "terminal";
}>;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"refused">;
reason: ZodLiteral<"denied">;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Cancellation result, an already-terminal run, or an authority refusal.


runOutcomeSchemaconstant

Section titled “runOutcomeSchema”
Signature
const runOutcomeSchema: ZodEnum<{
cancelled: "cancelled";
terminal: "terminal";
active: "active";
}>;

Lifecycle outcome reported for a Workflow run.


statusReplyconstant

Section titled “statusReply”
Signature
const statusReply: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
runId: ZodString;
planDigest: ZodString;
outcome: ZodEnum<{
cancelled: "cancelled";
terminal: "terminal";
active: "active";
}>;
title: ZodString;
events: ZodArray<ZodRecord<ZodString, ZodJSONSchema>>;
reviews: ZodArray<ZodRecord<ZodString, ZodJSONSchema>>;
status: ZodString;
output: ZodJSONSchema;
error: ZodJSONSchema;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Bounded run status snapshot with events, reviews, output and error.


answerReviewReplyconstant

Section titled “answerReviewReply”
Signature
const answerReviewReply: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
result: ZodEnum<{
invalid: "invalid";
denied: "denied";
accepted: "accepted";
not_waiting: "not_waiting";
}>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Result of answering a waiting run review, or an invocation refusal.


scheduleArmReplySchemaconstant

Section titled “scheduleArmReplySchema”
Signature
const scheduleArmReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodLiteral<"armed">;
scheduleId: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"refused">;
reason: ZodString;
issues: ZodOptional<ZodArray<ZodJSONSchema>>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Schedule-trigger admission or its refusal details.


triggerDisarmReplySchemaconstant

Section titled “triggerDisarmReplySchema”
Signature
const triggerDisarmReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodEnum<{
disarmed: "disarmed";
not_found: "not_found";
}>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Trigger disarm result, including an absent trigger or denied invocation.


schedulesReplySchemaconstant

Section titled “schedulesReplySchema”
Signature
const schedulesReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
schedules: ZodArray<
ZodObject<
{
scheduleId: ZodString;
installationId: ZodString;
workflowId: ZodString;
triggerId: ZodString;
nextDueAt: ZodNumber;
state: ZodEnum<{
cancelled: "cancelled";
active: "active";
paused: "paused";
finished: "finished";
}>;
lastError: ZodNullable<ZodString>;
},
$strict
>
>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Visible schedule-trigger rows with their next due time and lifecycle state.


workflowRunSourceSchemaconstant

Section titled “workflowRunSourceSchema”
Signature
const workflowRunSourceSchema: ZodEnum<{
manual: "manual";
schedule: "schedule";
event: "event";
agent: "agent";
key: "key";
}>;

Origin category recorded for a run: manual, schedule, event, Agent or key.


workflowRunInitiatedBySchemaconstant

Section titled “workflowRunInitiatedBySchema”
Signature
const workflowRunInitiatedBySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodLiteral<"member">;
memberId: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"agent">;
agentId: ZodString;
grantorMemberId: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"key">;
keyId: ZodString;
grantorMemberId: ZodString;
},
$strict
>,
]
>
>;

The Agent Session (sessionId) stays host-side; the wire names only the Agent/key and its grantor.


runsReplySchemaconstant

Section titled “runsReplySchema”
Signature
const runsReplySchema: ZodLazy<ZodUnion<readonly [ZodObject<{
runs: ZodArray<ZodObject<{
runId: ZodString;
workflowId: ZodString;
commit: ZodString;
source: ZodEnum<{
manual: "manual";
schedule: "schedule";
event: "event";
agent: "agent";
key: "key";
}>;
triggerId: ZodOptional<ZodString>;
initiatedBy: ZodLazy<ZodUnion<readonly [..., ..., ...]>>;
startedAt: ZodNumber;
}, $strict>>;
}, $strict>, ZodObject<{
error: ZodString;
}, $strict>]>>;

Bounded recent-run rows with their source, initiator and pinned commit.


eventArmReplySchemaconstant

Section titled “eventArmReplySchema”
Signature
const eventArmReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodLiteral<"armed">;
eventTriggerId: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"refused">;
reason: ZodString;
issues: ZodOptional<ZodArray<ZodJSONSchema>>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Event-trigger admission or its refusal details.


eventTriggersReplySchemaconstant

Section titled “eventTriggersReplySchema”
Signature
const eventTriggersReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
eventTriggers: ZodArray<
ZodObject<
{
eventTriggerId: ZodString;
workflowId: ZodString;
triggerId: ZodString;
emitterInstallationId: ZodString;
event: ZodString;
state: ZodEnum<{
active: "active";
paused: "paused";
}>;
lastError: ZodNullable<ZodString>;
},
$strict
>
>;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

Visible event-trigger rows with emitter, event and current state.


repositoryWorkflowSourceSchemaconstant

Section titled “repositoryWorkflowSourceSchema”
Signature
const repositoryWorkflowSourceSchema: Struct<{
appId: refine<AppId, String>;
installationId: String;
callerAppId: refine<AppId, String>;
callerSourceRevision: refine<SourceRevision, String>;
}>;

A registered repository App as the host reports it to the calling installation: read-only identity from the source owner and the live caller. Hosts and Apps share this wire; an App never imports the host package for it. Reading it neither registers a repository nor selects or runs a Computer.


runsInputSchemaconstant

Section titled “runsInputSchema”
Signature
const runsInputSchema: ZodLazy<
ZodObject<
{
workflowId: ZodOptional<ZodString>;
},
$strict
>
>;

The App’s WORKFLOWS.runs read, scoped to one Workflow when given.


runListItemSchemaconstant

Section titled “runListItemSchema”
Signature
const runListItemSchema: ZodLazy<
ZodObject<
{
runId: ZodString;
workflowId: ZodString;
commit: ZodString;
version: ZodNullable<ZodNumber>;
startedAt: ZodNumber;
title: ZodNullable<ZodString>;
source: ZodEnum<{
manual: "manual";
schedule: "schedule";
event: "event";
agent: "agent";
key: "key";
}>;
triggerId: ZodOptional<ZodString>;
initiatedBy: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
kind: ZodLiteral<"member">;
memberId: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"agent">;
agentId: ZodString;
grantorMemberId: ZodString;
},
$strict
>,
ZodObject<
{
kind: ZodLiteral<"key">;
keyId: ZodString;
grantorMemberId: ZodString;
},
$strict
>,
]
>
>;
},
$strict
>
>;

One listed run, from the stored source of truth plus the App’s own copy of the published document at commit; display metadata never comes from Git.


viewerReplySchemaconstant

Section titled “viewerReplySchema”
Signature
const viewerReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
memberId: ZodString;
},
$strict
>,
ZodObject<
{
error: ZodString;
},
$strict
>,
]
>
>;

The calling member’s own id, so the Runs UI can tell its own runs from a teammate’s (an owner now sees every run in the installation, not only their own) without guessing identity from the list itself.


workflowRunRequestIdsconstant

Section titled “workflowRunRequestIds”
Signature
const workflowRunRequestIds: Readonly<{
request: IdCodec<"agar-workflow-run", "request", 1>;
}>;

Typed id codec for Workflow run requests: mint and validate workflow_request_* ids. Hosts derive run ids from the request.


runDeliverySchemaconstant

Section titled “runDeliverySchema”
Signature
const runDeliverySchema: ZodObject<
{
agentId: ZodString;
sessionId: ZodString;
},
$strict
>;

The Agent Session (chat) that receives the ending of every run it covers.


chatsReplySchemaconstant

Section titled “chatsReplySchema”
Signature
const chatsReplySchema: ZodLazy<
ZodUnion<
readonly [
ZodObject<
{
chats: ZodArray<
ZodObject<
{
agentId: ZodString;
sessionId: ZodString;
title: ZodString;
},
$strict
>
>;
},
$strict
>,
ZodObject<
{
error: ZodLiteral<"not_granted">;
},
$strict
>,
]
>
>;

One chat the member may choose for run reports: an existing Agent Session.


triggerTargetSchemaconstant

Section titled “triggerTargetSchema”
Signature
const triggerTargetSchema: ZodLazy<
ZodObject<
{
workflowId: ZodString;
commit: ZodString;
triggerId: ZodString;
bindings: ZodRecord<
ZodLazy<ZodString>,
ZodUnion<
readonly [
ZodString,
ZodLazy<
ZodObject<
{
kind: ZodLiteral<"team-source">;
},
$strict
>
>,
]
>
>;
delivery: ZodOptional<
ZodObject<
{
agentId: ZodString;
sessionId: ZodString;
},
$strict
>
>;
},
$strict
>
>;

The published trigger supplies cadence or event matching; the host supplies authority scope.


scheduleDisarmInputSchemaconstant

Section titled “scheduleDisarmInputSchema”
Signature
const scheduleDisarmInputSchema: ZodObject<
{
scheduleId: ZodString;
},
$strict
>;

Identify the schedule-trigger registration to disarm.


eventDisarmInputSchemaconstant

Section titled “eventDisarmInputSchema”
Signature
const eventDisarmInputSchema: ZodObject<
{
eventTriggerId: ZodString;
},
$strict
>;

Identify the event-trigger registration to disarm.


triggerListInputSchemaconstant

Section titled “triggerListInputSchema”
Signature
const triggerListInputSchema: ZodObject<{}, $strict>;

Trigger listing takes no caller-supplied filters.


workflowLibraryRepositoryconstant

Section titled “workflowLibraryRepository”
Signature
const workflowLibraryRepository: "trellis" = "trellis";

The read side of a Workflows library’s Git layout, shared by the Workflows App and the hosts that read its published definitions: one repository, trellis, one workflows/<id>.json file per Workflow (its definition plus layout and optional provenance), and one <id>@v<n> tag per published version on main’s ancestry.


workflowDraftSchemaconstant

Section titled “workflowDraftSchema”
Signature
const workflowDraftSchema: Struct<{
definition: Struct<{
format: Literal<"fungi.workflow/v1">;
title: String;
description: optionalKey<String>;
apps: $Record<String, Struct<{
appId: String;
role: optionalKey<String>;
}>>;
subgraphs: optionalKey<$Record<String, Struct<{
input: $Record<String, Codec<Json, Json, never, never>>;
nodes: $Array<Union<readonly [..., ..., ..., ..., ..., ..., ..., ...]>>;
edges: $Array<Struct<{
from: ...;
to: ...;
}>>;
output: $Record<String, Struct<{
node: ...;
port: ...;
}>>;
}>>>;
triggers: optionalKey<$Array<Union<readonly [Struct<{
id: String;
on: Literal<...>;
title: optionalKey<...>;
when: optionalKey<...>;
input: optionalKey<...>;
}>, Struct<{
id: String;
on: Literal<...>;
title: optionalKey<...>;
cron: Struct<...>;
input: optionalKey<...>;
}>, Struct<{
id: String;
on: Literal<...>;
title: optionalKey<...>;
app: String;
event: String;
eventDigest: String;
when: optionalKey<...>;
input: optionalKey<...>;
repository: optionalKey<...>;
}>]>>>;
input: $Record<String, Codec<Json, Json, never, never>>;
nodes: $Array<Union<readonly [Struct<{
id: String;
kind: Literal<"code">;
source: String;
input: $Record<String, Codec<..., ..., ..., ...>>;
output: $Record<String, Codec<..., ..., ..., ...>>;
values: $Record<String, Codec<..., ..., ..., ...>>;
}>, Struct<{
id: String;
kind: Literal<"app">;
app: String;
method: String;
methodDigest: String;
values: $Record<String, Codec<..., ..., ..., ...>>;
gitAccess: optionalKey<declare<..., ...>>;
retry: optionalKey<Struct<...>>;
}>, Struct<{
id: String;
kind: Literal<"review">;
title: String;
detail: optionalKey<String>;
show: $Array<Struct<...>>;
reviewers: Literals<readonly [..., ...]>;
timeout: Number;
choices: optionalKey<$Array<...>>;
}>, Struct<{
id: String;
kind: Literal<"condition">;
test: Codec<Predicate, Predicate, never, never>;
}>, Struct<{
id: String;
kind: Literal<"map">;
over: Struct<{
node: ...;
port: ...;
}>;
body: String;
concurrency: Number;
maxItems: Number;
}>, Struct<{
id: String;
kind: Literal<"repeat">;
body: String;
maxRounds: Number;
until: Codec<Predicate, Predicate, never, never>;
}>, Struct<{
id: String;
kind: Literal<"wait">;
for: Number;
}>, Struct<{
id: String;
kind: Literal<"transform">;
fields: $Record<String, Codec<..., ..., ..., ...>>;
}>]>>;
edges: $Array<Struct<{
from: Struct<{
node: Union<readonly [..., ...]>;
port: String;
}>;
to: Struct<{
node: Union<readonly [..., ...]>;
port: String;
}>;
}>>;
output: $Record<String, Struct<{
node: Union<readonly [String, Literals<readonly [..., ...]>]>;
port: String;
}>>;
}>;
layout: $Record<String, Struct<{
x: Finite;
y: Finite;
}>>;
provenance: optionalKey<declare<
| {
kind: "import";
workflowId: string;
version: number;
commit: string;
sha256: string & object;
origin?: string;
}
| {
kind: "fork";
workflowId: string;
commit: string;
},
| {
kind: "import";
workflowId: string;
version: number;
commit: string;
sha256: string & object;
origin?: string;
}
| {
kind: "fork";
workflowId: string;
commit: string;
}>>;
}>;

Decode stored definition, node layout and optional import/fork provenance.

createWorkflowPublishedDefinitionPort()function

Section titled “createWorkflowPublishedDefinitionPort()”
Signature
function createWorkflowPublishedDefinitionPort(
createReader,
): PublishedDefinitionPort<WorkflowPublishedDefinitionContext>;

Trigger arm verification uses current admitted Git; direct starts carry the App’s original row.

Parameter Type
createReader (git) => WorkflowPublishedReader

PublishedDefinitionPort<WorkflowPublishedDefinitionContext>


workflowFilePath()function

Section titled “workflowFilePath()”
Signature
function workflowFilePath(id): string;

Where one Workflow’s file lives in its library repository.

Parameter Type
id string

string


workflowFiles()function

Section titled “workflowFiles()”
Signature
function workflowFiles(
git,
commit,
): Promise<
Readonly<{
name: string;
mode: string;
hash: string;
type: "commit" | "blob" | "tree";
}>[]
>;

Read the immediate Workflow directory without following symlinks or submodules.

Parameter Type
git WorkflowReadGit
commit string | null

Promise<Readonly<{ name: string; mode: string; hash: string; type: "commit" | "blob" | "tree"; }>[]>


changedWorkflowIds()function

Section titled “changedWorkflowIds()”
Signature
function changedWorkflowIds(git, before, after): Promise<string[]>;

Changed Workflow IDs in one accepted ref update, including deletions and mode changes.

Parameter Type
git WorkflowReadGit
before string
after string

Promise<string[]>


inspectWorkflowFile()function

Section titled “inspectWorkflowFile()”
Signature
function inspectWorkflowFile(
git,
workflowId,
commit
): Promise<
| {
kind: "missing";
}
| {
kind: "valid";
draft: {
definition: {
format: "fungi.workflow/v1";
title: string;
description?: string;
apps: {
[key: string]: object;
};
subgraphs?: {
[key: string]: object;
};
triggers?: readonly (
| {
id: string;
on: "webhook";
title?: string;
when?: Predicate;
input?: {
[key: ...]: ...;
};
}
| {
id: string;
on: "schedule";
title?: string;
cron: {
expression: string;
timeZone: string;
};
input?: {
[key: ...]: ...;
};
}
| {
id: string;
on: "event";
title?: string;
app: string;
event: string;
eventDigest: string;
when?: Predicate;
input?: {
[key: ...]: ...;
};
repository?: Mapping;
})[];
input: {
[key: string]: Json;
};
nodes: readonly (
| {
id: string;
kind: "code";
source: string;
input: {
[key: string]: Json;
};
output: {
[key: string]: Json;
};
values: {
[key: string]: Mapping;
};
}
| {
id: string;
kind: "app";
app: string;
method: string;
methodDigest: string;
values: {
[key: string]: Mapping;
};
gitAccess?: | {
binding: string;
repository: string;
branches: ...[];
}
| {
binding: string;
repository: string;
access: "read";
};
retry?: {
attempts: number;
};
}
| {
id: string;
kind: "review";
title: string;
detail?: string;
show: readonly object[];
reviewers: "runner" | "owners";
timeout: number;
choices?: readonly object[];
}
| {
id: string;
kind: "condition";
test: Predicate;
}
| {
id: string;
kind: "map";
over: {
node: string;
port: string;
};
body: string;
concurrency: number;
maxItems: number;
}
| {
id: string;
kind: "repeat";
body: string;
maxRounds: number;
until: Predicate;
}
| {
id: string;
kind: "wait";
for: number;
}
| {
id: string;
kind: "transform";
fields: {
[key: string]: Mapping;
};
})[];
edges: readonly object[];
output: {
[key: string]: object;
};
};
layout: {
[key: string]: object;
};
provenance?: | {
kind: "import";
workflowId: string;
version: number;
commit: string;
sha256: string & object;
origin?: string;
}
| {
kind: "fork";
workflowId: string;
commit: string;
};
};
}
| {
kind: "invalid";
issues: readonly Issue[];
}>;

Decode a pushed file separately from the admitted catalog’s semantic validation.

Parameter Type
git WorkflowReadGit
workflowId string
commit string

Promise< | { kind: "missing"; } | { kind: "valid"; draft: { definition: { format: "fungi.workflow/v1"; title: string; description?: string; apps: { [key: string]: object; }; subgraphs?: { [key: string]: object; }; triggers?: readonly ( | { id: string; on: "webhook"; title?: string; when?: Predicate; input?: { [key: …]: …; }; } | { id: string; on: "schedule"; title?: string; cron: { expression: string; timeZone: string; }; input?: { [key: …]: …; }; } | { id: string; on: "event"; title?: string; app: string; event: string; eventDigest: string; when?: Predicate; input?: { [key: …]: …; }; repository?: Mapping; })[]; input: { [key: string]: Json; }; nodes: readonly ( | { id: string; kind: "code"; source: string; input: { [key: string]: Json; }; output: { [key: string]: Json; }; values: { [key: string]: Mapping; }; } | { id: string; kind: "app"; app: string; method: string; methodDigest: string; values: { [key: string]: Mapping; }; gitAccess?: | { binding: string; repository: string; branches: …[]; } | { binding: string; repository: string; access: "read"; }; retry?: { attempts: number; }; } | { id: string; kind: "review"; title: string; detail?: string; show: readonly object[]; reviewers: "runner" | "owners"; timeout: number; choices?: readonly object[]; } | { id: string; kind: "condition"; test: Predicate; } | { id: string; kind: "map"; over: { node: string; port: string; }; body: string; concurrency: number; maxItems: number; } | { id: string; kind: "repeat"; body: string; maxRounds: number; until: Predicate; } | { id: string; kind: "wait"; for: number; } | { id: string; kind: "transform"; fields: { [key: string]: Mapping; }; })[]; edges: readonly object[]; output: { [key: string]: object; }; }; layout: { [key: string]: object; }; provenance?: | { kind: "import"; workflowId: string; version: number; commit: string; sha256: string & object; origin?: string; } | { kind: "fork"; workflowId: string; commit: string; }; }; } | { kind: "invalid"; issues: readonly Issue[]; }>


readWorkflowAt()function

Section titled “readWorkflowAt()”
Signature
function readWorkflowAt(
git,
workflowId,
commit,
): Promise<WorkflowDocument | null>;

One Workflow’s file at commit, or null when it is absent or invalid.

Parameter Type
git WorkflowReadGit
workflowId string
commit string | null

Promise<WorkflowDocument | null>


versionRefs()function

Section titled “versionRefs()”
Signature
function versionRefs(workflowId, references): object[];

A Workflow’s published versions, newest first, from its <id>@v<n> tags.

Parameter Type
workflowId string
references object[]

object[]


workflowCommitIsAncestor()function

Section titled “workflowCommitIsAncestor()”
Signature
function workflowCommitIsAncestor(git, before, after): Promise<boolean>;

Batched first-parent reads retain every merge parent; the caller owns its IO budget.

Parameter Type
git GitBinding
before string
after string

Promise<boolean>


listingGit()function

Section titled “listingGit()”
Signature
function listingGit(git): WorkflowReadGit;

Each Git object read at most once while one listing runs.

Parameter Type
git GitBinding

WorkflowReadGit


readPublishedWorkflow()function

Section titled “readPublishedWorkflow()”
Signature
function readPublishedWorkflow(
git,
workflowId,
at,
copied?,
): Promise<(object & object & object) | null>;

One published Workflow: a version tag, or a commit, on main’s ancestry. copied answers from a caller’s own read copy of that commit when it has one; otherwise the file is read from Git within a bounded read budget.

Parameter Type
git GitBinding
workflowId string
at | { version: number; } | { commit: string; }
copied (commit) => WorkflowDocument | null

Promise<object & object & object | null>