Skip to content
API reference

client-entry

Import
import * as api from "@fungi.computer/shiitake/client-entry";
Kind Export Description
type alias ClientChipV1 An admitted, display-only status chip.
type alias ClientTimelineCellV1 An admitted committed event with its producer identity and anchor.
type alias ClientContributionV1 The closed V1 presentation grammar returned by a client entry.
type alias ClientExtensionContextV1 Borrowed latest-value activity; each iterator subscribes separately.
type alias ClientEntryV1 Installed client protocol; projection decoding remains inside the author closure.
type alias ClientActivityStateV0 What a client observed about the Session, never an execution authority.
type alias ClientActivityV0 Activity already observed by the client. header is only the short heading of what blocks the Session; it never carries question bodies or answers.
constant clientChipSchemaV1 One display-only status chip; order is local to the entry.
constant clientTimelineCellSchemaV1 One committed presentation event with an explicit placement choice.
constant clientContributionSchemaV1 Closed, bounded presentation data shared by every renderer.
constant parseClientEntryV1 Admit exactly V1; installed executable code is not sandboxed.
function defineClientEntry() One typed author seam, usable with ordinary async attachment code.
function viewExtension() Decode one observed slot using its owning contract’s projection.

ClientChipV1type alias

Section titled “ClientChipV1”
Signature
type ClientChipV1 = typeof clientChipSchemaV1.Type;

An admitted, display-only status chip.


ClientTimelineCellV1type alias

Section titled “ClientTimelineCellV1”
Signature
type ClientTimelineCellV1 = typeof clientTimelineCellSchemaV1.Type;

An admitted committed event with its producer identity and anchor.


ClientContributionV1type alias

Section titled “ClientContributionV1”
Signature
type ClientContributionV1 = typeof clientContributionSchemaV1.Type;

The closed V1 presentation grammar returned by a client entry.


ClientExtensionContextV1type alias

Section titled “ClientExtensionContextV1”
Signature
type ClientExtensionContextV1 = Readonly<{
activity: AsyncIterable<ClientActivityV0>;
signal: AbortSignal;
onError: (error) => void;
}>;

Borrowed latest-value activity; each iterator subscribes separately.


ClientEntryV1type alias

Section titled “ClientEntryV1”
Signature
type ClientEntryV1 = Readonly<{
protocol: "shiitake.client/v1";
id: ExtensionId;
promptPresentation?: "footer";
attach?: (context) => Effect.Effect<void, Error, Scope.Scope>;
contribute?: (slot) => ClientContributionV1;
}>;

Installed client protocol; projection decoding remains inside the author closure.


ClientActivityStateV0type alias

Section titled “ClientActivityStateV0”
Signature
type ClientActivityStateV0 = "idle" | "working" | "blocked" | "unknown";

What a client observed about the Session, never an execution authority.


ClientActivityV0type alias

Section titled “ClientActivityV0”
Signature
type ClientActivityV0 = Readonly<{
state: ClientActivityStateV0;
header?: string;
}>;

Activity already observed by the client. header is only the short heading of what blocks the Session; it never carries question bodies or answers.

clientChipSchemaV1constant

Section titled “clientChipSchemaV1”
Signature
const clientChipSchemaV1: Struct<{
id: String;
order: Number;
row: Struct<{
id: String;
title: String;
detail: optional<String>;
tone: optional<
Literals<readonly ["attention", "running", "error", "settled", "muted"]>
>;
status: optional<
Struct<{
label: String;
tone: Literals<
readonly [
"neutral",
"primary",
"secondary",
"accent",
"success",
"info",
"warning",
"error",
]
>;
}>
>;
open: optional<
Struct<{
params: $Array<
Struct<{
key: String;
value: String;
}>
>;
}>
>;
}>;
compact: optional<String>;
}>;

One display-only status chip; order is local to the entry.


clientTimelineCellSchemaV1constant

Section titled “clientTimelineCellSchemaV1”
Signature
const clientTimelineCellSchemaV1: Struct<{
id: String;
sequence: Int;
at: Int;
commandId: NullOr<String>;
afterSequence: optionalKey<Int>;
rows: $Array<Struct<{
id: String;
title: String;
detail: optional<String>;
tone: optional<Literals<readonly ["attention", "running", "error", "settled", "muted"]>>;
status: optional<Struct<{
label: String;
tone: Literals<readonly ["neutral", "primary", "secondary", "accent", "success", "info", "warning", "error"]>;
}>>;
open: optional<Struct<{
params: $Array<Struct<{
key: ...;
value: ...;
}>>;
}>>;
actions: optional<$Array<Struct<{
id: String;
label: String;
input: optional<$Record<..., ...>>;
awaiting: optionalKey<Literal<...>>;
}>>>;
}>>;
}>;

One committed presentation event with an explicit placement choice.


clientContributionSchemaV1constant

Section titled “clientContributionSchemaV1”
Signature
const clientContributionSchemaV1: Struct<{
chips: $Array<Struct<{
id: String;
order: Number;
row: Struct<{
id: String;
title: String;
detail: optional<String>;
tone: optional<Literals<readonly ["attention", "running", "error", "settled", "muted"]>>;
status: optional<Struct<{
label: String;
tone: Literals<...>;
}>>;
open: optional<Struct<{
params: $Array<...>;
}>>;
}>;
compact: optional<String>;
}>>;
panel: $Array<Struct<{
id: String;
title: String;
detail: optional<String>;
tone: optional<Literals<readonly ["attention", "running", "error", "settled", "muted"]>>;
status: optional<Struct<{
label: String;
tone: Literals<readonly ["neutral", "primary", "secondary", "accent", "success", "info", "warning", "error"]>;
}>>;
open: optional<Struct<{
params: $Array<Struct<{
key: ...;
value: ...;
}>>;
}>>;
actions: optional<$Array<Struct<{
id: String;
label: String;
input: optional<$Record<..., ...>>;
awaiting: optionalKey<Literal<...>>;
}>>>;
inspection: optionalKey<Struct<{
commandId: String;
title: String;
rows: $Array<Struct<{
id: ...;
title: ...;
detail: ...;
tone: ...;
status: ...;
open: ...;
}>>;
}>>;
}>>;
timeline: Struct<{
cells: $Array<Struct<{
id: String;
sequence: Int;
at: Int;
commandId: NullOr<String>;
afterSequence: optionalKey<Int>;
rows: $Array<Struct<{
id: String;
title: String;
detail: optional<...>;
tone: optional<...>;
status: optional<...>;
open: optional<...>;
actions: optional<...>;
}>>;
}>>;
omitted: Int;
}>;
waiting: NullOr<Struct<{
summary: String;
cancel: Struct<{
id: String;
label: String;
input: optional<$Record<String, Codec<Json, Json, never, never>>>;
awaiting: optionalKey<Literal<"question">>;
}>;
}>>;
}>;

Closed, bounded presentation data shared by every renderer.


parseClientEntryV1constant

Section titled “parseClientEntryV1”
Signature
const parseClientEntryV1: (
input,
options?,
) => Readonly<{
protocol: "shiitake.client/v1";
id: string & Brand<"ExtensionId">;
promptPresentation?: "footer";
attach?: (context) => Effect<void, Error, Scope>;
contribute?: (slot) => object;
}> = decodeEntry;

Admit exactly V1; installed executable code is not sandboxed.

Parameter Type
input unknown
options? ParseOptions

Readonly<{ protocol: "shiitake.client/v1"; id: string & Brand<"ExtensionId">; promptPresentation?: "footer"; attach?: (context) => Effect<void, Error, Scope>; contribute?: (slot) => object; }>

defineClientEntry()function

Section titled “defineClientEntry()”
Signature
function defineClientEntry<C, P, PI>(contract, client): ClientEntryV1;

One typed author seam, usable with ordinary async attachment code.

Type Parameter
C extends Readonly<Record<string, Readonly<{ scope: "session" | "agent"; input: Codec<unknown>; output: Codec<unknown>; }>>>
P
PI
Parameter Type
contract ExtensionContractV0<C, P, PI>
client Readonly<{ promptPresentation?: ClientEntryV1["promptPresentation"]; attach?: (context) => | void | Promise<void> | Effect.Effect<void, Error, Scope.Scope>; contribute?: (view) => ClientContributionV1; }>

ClientEntryV1


viewExtension()function

Section titled “viewExtension()”
Signature
function viewExtension<C, P, PI>(contract, slot): ExtensionViewV0<P>;

Decode one observed slot using its owning contract’s projection.

Type Parameter
C extends Readonly<Record<string, Readonly<{ scope: "session" | "agent"; input: Codec<unknown>; output: Codec<unknown>; }>>>
P
PI
Parameter Type
contract ExtensionContractV0<C, P, PI>
slot ExtensionSlotV0 | undefined

ExtensionViewV0<P>