Skip to content
API reference

inbox

Import
import * as api from "@fungi.computer/puffball/inbox";
Kind Export Description
type alias MemberInboxSession Parsed Session facts in the shared Inbox vocabulary.
type alias WorkflowReviewKey The run, node and iteration that identify one human review.
type alias WorkflowReviewInboxItem A reviewer-visible projection of a saved Workflow review.
type alias MemberInboxItem An Inbox row is a Session or a human Workflow review.
type alias MemberInboxDeltaItem One record carried by an Inbox row delta.
constant memberInboxSessionSchema One Session, projected by its Agent owner, with this member’s visit.
constant workflowReviewKeySchema A review’s engine identity, independent of its native delivery coordinates.
constant workflowReviewInboxItemSchema Facts delivered to an admitted reviewer by the run owner, never a fake Session.
constant memberInboxItemSchema The INBOX wire has one vocabulary on every host and App client.
constant memberInboxDeltaItemSchema A row replacement or an Agent-owned Session deletion.
function memberInboxKey() Stable identity of one Session across Agents.
function memberInboxItemKey() Stable placement across review transitions; Map iterations remain distinct.

MemberInboxSessiontype alias

Section titled “MemberInboxSession”
Signature
type MemberInboxSession = typeof memberInboxSessionSchema.Type;

Parsed Session facts in the shared Inbox vocabulary.


WorkflowReviewKeytype alias

Section titled “WorkflowReviewKey”
Signature
type WorkflowReviewKey = typeof workflowReviewKeySchema.Type;

The run, node and iteration that identify one human review.


WorkflowReviewInboxItemtype alias

Section titled “WorkflowReviewInboxItem”
Signature
type WorkflowReviewInboxItem = typeof workflowReviewInboxItemSchema.Type;

A reviewer-visible projection of a saved Workflow review.


MemberInboxItemtype alias

Section titled “MemberInboxItem”
Signature
type MemberInboxItem = typeof memberInboxItemSchema.Type;

An Inbox row is a Session or a human Workflow review.


MemberInboxDeltaItemtype alias

Section titled “MemberInboxDeltaItem”
Signature
type MemberInboxDeltaItem = typeof memberInboxDeltaItemSchema.Type;

One record carried by an Inbox row delta.

memberInboxSessionSchemaconstant

Section titled “memberInboxSessionSchema”
Signature
const memberInboxSessionSchema: Union<
readonly [
Struct<{
agentId: String;
sessionId: String;
title: String;
triggerId: optionalKey<String>;
createdAt: Number;
lastActivityAt: Number;
settledAt: optionalKey<Number>;
visitedAt: optionalKey<Number>;
state: Literals<readonly ["needs_you", "running", "errored", "done"]>;
}>,
Struct<{
agentId: String;
sessionId: String;
state: Literal<"unavailable">;
}>,
]
>;

One Session, projected by its Agent owner, with this member’s visit.


workflowReviewKeySchemaconstant

Section titled “workflowReviewKeySchema”
Signature
const workflowReviewKeySchema: Struct<{
runId: String;
nodeId: String;
iteration: String;
}>;

A review’s engine identity, independent of its native delivery coordinates.


workflowReviewInboxItemSchemaconstant

Section titled “workflowReviewInboxItemSchema”
Signature
const workflowReviewInboxItemSchema: Struct<{
kind: Literal<"workflow-review">;
key: Struct<{
runId: String;
nodeId: String;
iteration: String;
}>;
installationId: String;
workflowId: NullOr<String>;
workflowTitle: String;
reviewTitle: String;
reviewers: Literals<readonly ["runner", "owners"]>;
show: $Array<Codec<Json, Json, never, never>>;
choices: optionalKey<$Array<String>>;
openedAt: Number;
expiresAt: Number;
state: Literals<
readonly ["pending", "answered", "delivered", "timed_out", "closed"]
>;
}>;

Facts delivered to an admitted reviewer by the run owner, never a fake Session.


memberInboxItemSchemaconstant

Section titled “memberInboxItemSchema”
Signature
const memberInboxItemSchema: Union<
readonly [
Union<
readonly [
Struct<{
agentId: String;
sessionId: String;
title: String;
triggerId: optionalKey<String>;
createdAt: Number;
lastActivityAt: Number;
settledAt: optionalKey<Number>;
visitedAt: optionalKey<Number>;
state: Literals<readonly ["needs_you", "running", "errored", "done"]>;
}>,
Struct<{
agentId: String;
sessionId: String;
state: Literal<"unavailable">;
}>,
]
>,
Struct<{
kind: Literal<"workflow-review">;
key: Struct<{
runId: String;
nodeId: String;
iteration: String;
}>;
installationId: String;
workflowId: NullOr<String>;
workflowTitle: String;
reviewTitle: String;
reviewers: Literals<readonly ["runner", "owners"]>;
show: $Array<Codec<Json, Json, never, never>>;
choices: optionalKey<$Array<String>>;
openedAt: Number;
expiresAt: Number;
state: Literals<
readonly ["pending", "answered", "delivered", "timed_out", "closed"]
>;
}>,
]
>;

The INBOX wire has one vocabulary on every host and App client.


memberInboxDeltaItemSchemaconstant

Section titled “memberInboxDeltaItemSchema”
Signature
const memberInboxDeltaItemSchema: Union<
readonly [
Union<
readonly [
Union<
readonly [
Struct<{
agentId: String;
sessionId: String;
title: String;
triggerId: optionalKey<String>;
createdAt: Number;
lastActivityAt: Number;
settledAt: optionalKey<Number>;
visitedAt: optionalKey<Number>;
state: Literals<
readonly ["needs_you", "running", "errored", "done"]
>;
}>,
Struct<{
agentId: String;
sessionId: String;
state: Literal<"unavailable">;
}>,
]
>,
Struct<{
kind: Literal<"workflow-review">;
key: Struct<{
runId: String;
nodeId: String;
iteration: String;
}>;
installationId: String;
workflowId: NullOr<String>;
workflowTitle: String;
reviewTitle: String;
reviewers: Literals<readonly ["runner", "owners"]>;
show: $Array<Codec<Json, Json, never, never>>;
choices: optionalKey<$Array<String>>;
openedAt: Number;
expiresAt: Number;
state: Literals<
readonly ["pending", "answered", "delivered", "timed_out", "closed"]
>;
}>,
]
>,
Struct<{
agentId: String;
sessionId: String;
deleted: Literal<true>;
}>,
]
>;

A row replacement or an Agent-owned Session deletion.

memberInboxKey()function

Section titled “memberInboxKey()”
Signature
function memberInboxKey(agentId, sessionId): string;

Stable identity of one Session across Agents.

Parameter Type
agentId string
sessionId string

string


memberInboxItemKey()function

Section titled “memberInboxItemKey()”
Signature
function memberInboxItemKey(item): string;

Stable placement across review transitions; Map iterations remain distinct.

Parameter Type
item | { agentId: string; sessionId: string; title: string; triggerId?: string; createdAt: number; lastActivityAt: number; settledAt?: number; visitedAt?: number; state: "running" | "done" | "needs_you" | "errored"; } | { agentId: string; sessionId: string; state: "unavailable"; } | { kind: "workflow-review"; key: { runId: string; nodeId: string; iteration: string; }; installationId: string; workflowId: string | null; workflowTitle: string; reviewTitle: string; reviewers: "owners" | "runner"; show: readonly Json[]; choices?: readonly string[]; openedAt: number; expiresAt: number; state: "closed" | "pending" | "answered" | "delivered" | "timed_out"; } | { agentId: string; sessionId: string; deleted: true; }

string