Skip to content
API reference

plan/contract

Import
import * as api from "@fungi.computer/shiitake-extensions/plan";
Kind Export Description
type alias Plan One Session’s ordered checklist and optional explanation.
constant Plan One Session’s replaceable checklist, independent of goals and loops. No steps means no plan: replacing it with an empty checklist clears it.
constant PlanInput Checklist replacement that permits at most one in-progress step.
constant PlanProjection The current checklist and every committed replacement, clears included.
constant PlanCommandInput Arguments of the human /plan command: a bare call views, clear empties it.
constant planContract Session-owned human plan control and checklist projection.
function planIsOpen() Open work remains: some step is not completed. Cleared and finished plans are closed.
Signature
type Plan = Schema.Schema.Type<typeof Plan>;

One Session’s ordered checklist and optional explanation.

Planconstant

Section titled “Plan”
Signature
const Plan: Struct<{
explanation: optionalKey<String>;
steps: $Array<
Struct<{
step: String;
status: Literals<readonly ["pending", "in_progress", "completed"]>;
}>
>;
}>;

One Session’s replaceable checklist, independent of goals and loops. No steps means no plan: replacing it with an empty checklist clears it.


PlanInputconstant

Section titled “PlanInput”
Signature
const PlanInput: Struct<{
explanation: optionalKey<String>;
steps: $Array<
Struct<{
step: String;
status: Literals<readonly ["pending", "in_progress", "completed"]>;
}>
>;
}>;

Checklist replacement that permits at most one in-progress step.


PlanProjectionconstant

Section titled “PlanProjection”
Signature
const PlanProjection: Struct<{
plan: Struct<{
explanation: optionalKey<String>;
steps: $Array<
Struct<{
step: String;
status: Literals<readonly ["pending", "in_progress", "completed"]>;
}>
>;
}>;
history: Struct<{
nextSequence: Int;
omitted: Int;
events: $Array<
Struct<{
id: String;
sequence: Int;
at: Int;
commandId: NullOr<String>;
event: Codec<
{
explanation?: string;
steps: readonly object[];
},
{
explanation?: string;
steps: readonly object[];
},
never,
never
>;
}>
>;
}>;
}>;

The current checklist and every committed replacement, clears included.


PlanCommandInputconstant

Section titled “PlanCommandInput”
Signature
const PlanCommandInput: Union<
readonly [
Struct<{
action: Literal<"clear">;
}>,
Struct<{}>,
]
>;

Arguments of the human /plan command: a bare call views, clear empties it.


planContractconstant

Section titled “planContract”
Signature
const planContract: object;

Session-owned human plan control and checklist projection.

Name Type Default value Description
id string & Brand<"ExtensionId"> - Stable extension identity.
commands object - Human checklist controls.
commands.plan object - View or clear the current checklist.
commands.plan.scope "session" "session" The Session owns the checklist.
commands.plan.input Union<readonly [Struct<{ action: Literal<"clear">; }>, Struct<{ }>]> PlanCommandInput Decode the selected human control.
commands.plan.output declare<WhistleCatalogStepV1, WhistleCatalogStepV1> CatalogStep Return the server-owned conversation step.
projection object - Current checklist and its replacement history.
projection.schema Struct<{ plan: Struct<{ explanation: optionalKey<String>; steps: $Array<Struct<{ step: String; status: Literals<readonly […, …, …]>; }>>; }>; history: Struct<{ nextSequence: Int; omitted: Int; events: $Array<Struct<{ id: String; sequence: Int; at: Int; commandId: NullOr<String>; event: Codec<{ explanation?: …; steps: …; }, { explanation?: …; steps: …; }, never, never>; }>>; }>; }> PlanProjection Decoder for visible plan state.

planIsOpen()function

Section titled “planIsOpen()”
Signature
function planIsOpen(plan): boolean;

Open work remains: some step is not completed. Cleared and finished plans are closed.

Parameter Type Description
plan { explanation?: string; steps: readonly object[]; } -
plan.explanation? string Optional explanation for this checklist replacement.
plan.steps readonly object[] Ordered checklist; an empty array clears the plan.

boolean