API reference
inbox
Import
Section titled “Import”import * as api from "@fungi.computer/puffball/inbox";Exports
Section titled “Exports”| 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”type MemberInboxSession = typeof memberInboxSessionSchema.Type;Parsed Session facts in the shared Inbox vocabulary.
WorkflowReviewKeytype alias
Section titled “WorkflowReviewKey”type WorkflowReviewKey = typeof workflowReviewKeySchema.Type;The run, node and iteration that identify one human review.
WorkflowReviewInboxItemtype alias
Section titled “WorkflowReviewInboxItem”type WorkflowReviewInboxItem = typeof workflowReviewInboxItemSchema.Type;A reviewer-visible projection of a saved Workflow review.
MemberInboxItemtype alias
Section titled “MemberInboxItem”type MemberInboxItem = typeof memberInboxItemSchema.Type;An Inbox row is a Session or a human Workflow review.
MemberInboxDeltaItemtype alias
Section titled “MemberInboxDeltaItem”type MemberInboxDeltaItem = typeof memberInboxDeltaItemSchema.Type;One record carried by an Inbox row delta.
memberInboxSessionSchemaconstant
Section titled “memberInboxSessionSchema”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”const workflowReviewKeySchema: Struct<{ runId: String; nodeId: String; iteration: String;}>;A review’s engine identity, independent of its native delivery coordinates.
workflowReviewInboxItemSchemaconstant
Section titled “workflowReviewInboxItemSchema”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”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”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()”function memberInboxKey(agentId, sessionId): string;Stable identity of one Session across Agents.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
agentId |
string |
sessionId |
string |
Returns
Section titled “Returns”string
memberInboxItemKey()function
Section titled “memberInboxItemKey()”function memberInboxItemKey(item): string;Stable placement across review transitions; Map iterations remain distinct.
Parameters
Section titled “Parameters”| 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; } |
Returns
Section titled “Returns”string