API reference
goal/contract
Import
Section titled “Import”import * as api from "@fungi.computer/shiitake-extensions/goal";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | GoalPauseCause | Typed pause cause and optional explanation. |
| type alias | Goal | The current goal every client sees. |
| type alias | EndedGoal | One finished goal. |
| constant | Objective | A goal objective: stored exactly as sent, never blank. |
| constant | GoalReason | Nonblank explanation recorded when a goal is achieved. |
| constant | GoalPauseCause | Why work paused, independent of the words shown to a person. |
| constant | Goal | The current goal every client sees; provisional terminals stay private. |
| constant | EndedGoal | One finished goal: history only, never current. |
| constant | endedGoalLimit | How many finished goals a Session keeps for its chat lines. |
| constant | GoalCommandInput | Arguments of the human /goal command. A bare call opens the controls; each
reply is a catalog step, so the conversation stays on the server. |
| constant | GoalProjection | Goal’s contract: Session-scope human controls and one projection slot. |
| constant | goalContract | Session-owned goal controls and their visible projection. |
GoalPauseCausetype alias
Section titled “GoalPauseCause”type GoalPauseCause = Schema.Schema.Type<typeof GoalPauseCause>;Typed pause cause and optional explanation.
Goaltype alias
Section titled “Goal”type Goal = Schema.Schema.Type<typeof Goal>;The current goal every client sees.
EndedGoaltype alias
Section titled “EndedGoal”type EndedGoal = Schema.Schema.Type<typeof EndedGoal>;One finished goal.
Objectiveconstant
Section titled “Objective”const Objective: String;A goal objective: stored exactly as sent, never blank.
GoalReasonconstant
Section titled “GoalReason”const GoalReason: String;Nonblank explanation recorded when a goal is achieved.
GoalPauseCauseconstant
Section titled “GoalPauseCause”const GoalPauseCause: Struct<{ kind: Literals< readonly [ "person", "blocked", "stalled", "cancelled", "failed", "no-terminal", ] >; detail: NullOr<String>;}>;Why work paused, independent of the words shown to a person.
Goalconstant
Section titled “Goal”const Goal: Struct<{ revision: String; objective: String; state: Literals<readonly ["active", "paused"]>; startedAt: Int; pauseCause: NullOr< Struct<{ kind: Literals< readonly [ "person", "blocked", "stalled", "cancelled", "failed", "no-terminal", ] >; detail: NullOr<String>; }> >;}>;The current goal every client sees; provisional terminals stay private.
EndedGoalconstant
Section titled “EndedGoal”const EndedGoal: Struct<{ sequence: Int; objective: String; outcome: Literals<readonly ["achieved", "cleared"]>; reason: NullOr<String>; endedAt: Int; afterSequence: Int;}>;One finished goal: history only, never current.
endedGoalLimitconstant
Section titled “endedGoalLimit”const endedGoalLimit: 16 = 16;How many finished goals a Session keeps for its chat lines.
GoalCommandInputconstant
Section titled “GoalCommandInput”const GoalCommandInput: Union< readonly [ Struct<{ action: Literal<"set">; objective: String; requestId: String; expectedRevision: optional<NullOr<String>>; confirmed: optional<Boolean>; }>, Struct<{ action: Literals< readonly ["pause", "resume", "replace", "clear", "clear-ask"] >; confirmed: optional<Boolean>; }>, Struct<{}>, ]>;Arguments of the human /goal command. A bare call opens the controls; each
reply is a catalog step, so the conversation stays on the server.
GoalProjectionconstant
Section titled “GoalProjection”const GoalProjection: Struct<{ goal: NullOr< Struct<{ revision: String; objective: String; state: Literals<readonly ["active", "paused"]>; startedAt: Int; pauseCause: NullOr< Struct<{ kind: Literals< readonly [ "person", "blocked", "stalled", "cancelled", "failed", "no-terminal", ] >; detail: NullOr<String>; }> >; }> >; ended: $Array< Struct<{ sequence: Int; objective: String; outcome: Literals<readonly ["achieved", "cleared"]>; reason: NullOr<String>; endedAt: Int; afterSequence: Int; }> >; omitted: Int;}>;Goal’s contract: Session-scope human controls and one projection slot.
goalContractconstant
Section titled “goalContract”const goalContract: object;Session-owned goal controls and their visible projection.