API reference
loop/contract
Import
Section titled “Import”import * as api from "@fungi.computer/shiitake-extensions/loop";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | Loop | One Session’s loop. |
| constant | LoopCron | A named cron cadence evaluated in one IANA time zone. |
| constant | Loop | One Session’s loop as every client sees it. |
| constant | LoopCommandInput | Arguments of the human /loop command. start carries the typed text:
<prompt> paces itself, <N>m <prompt> or <N>h <prompt> runs on an interval.
A bare call opens the controls. |
| constant | LoopProjection | Loop’s contract: Session-scope controls and one projection slot. |
| constant | loopContract | Session-owned loop controls and their visible state. |
Looptype alias
Section titled “Loop”type Loop = Schema.Schema.Type<typeof Loop>;One Session’s loop.
LoopCronconstant
Section titled “LoopCron”const LoopCron: Struct<{ expression: String; timeZone: String;}>;A named cron cadence evaluated in one IANA time zone.
Loopconstant
Section titled “Loop”const Loop: Struct<{ loopId: String; origin: Literals<readonly ["human", "model"]>; expiresAt: NullOr<Int>; prompt: String; mode: Literals<readonly ["self_paced", "fixed_interval"]>; cron: NullOr< Struct<{ expression: String; timeZone: String; }> >; state: Literals< readonly ["active", "paused", "finished", "failed", "cancelled"] >; commandId: String; reason: NullOr<String>; nextDueAt: NullOr<Int>; lastError: NullOr<String>; consecutiveFailures: Int;}>;One Session’s loop as every client sees it.
LoopCommandInputconstant
Section titled “LoopCommandInput”const LoopCommandInput: Union< readonly [ Struct<{ action: Literal<"start">; text: String; requestId: String; }>, Struct<{ action: Literals< readonly ["status", "pause", "resume", "stop", "stop-ask", "new"] >; confirmed: optional<Boolean>; }>, Struct<{}>, ]>;Arguments of the human /loop command. start carries the typed text:
<prompt> paces itself, <N>m <prompt> or <N>h <prompt> runs on an interval.
A bare call opens the controls.
LoopProjectionconstant
Section titled “LoopProjection”const LoopProjection: Struct<{ loop: Struct<{ loopId: String; origin: Literals<readonly ["human", "model"]>; expiresAt: NullOr<Int>; prompt: String; mode: Literals<readonly ["self_paced", "fixed_interval"]>; cron: NullOr< Struct<{ expression: String; timeZone: String; }> >; state: Literals< readonly ["active", "paused", "finished", "failed", "cancelled"] >; commandId: String; reason: NullOr<String>; nextDueAt: NullOr<Int>; lastError: NullOr<String>; consecutiveFailures: Int; }>;}>;Loop’s contract: Session-scope controls and one projection slot.
loopContractconstant
Section titled “loopContract”const loopContract: object;Session-owned loop controls and their visible state.