API reference
plan/contract
Import
Section titled “Import”import * as api from "@fungi.computer/shiitake-extensions/plan";Exports
Section titled “Exports”| 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. |
Plantype alias
Section titled “Plan”type Plan = Schema.Schema.Type<typeof Plan>;One Session’s ordered checklist and optional explanation.
Planconstant
Section titled “Plan”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”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”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”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”const planContract: object;Session-owned human plan control and checklist projection.
Type Declaration
Section titled “Type Declaration”planIsOpen()function
Section titled “planIsOpen()”function planIsOpen(plan): boolean;Open work remains: some step is not completed. Cleared and finished plans are closed.
Parameters
Section titled “Parameters”| 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. |
Returns
Section titled “Returns”boolean