@fungi.computer/shiitake-extensions 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +43 -13
  2. package/dist/almanac/contract.d.ts +94 -0
  3. package/dist/almanac/contract.js +71 -5
  4. package/dist/goal/client.d.ts +5 -2
  5. package/dist/goal/client.js +66 -72
  6. package/dist/goal/contract.d.ts +181 -64
  7. package/dist/goal/contract.js +102 -12
  8. package/dist/goal/host.js +188 -113
  9. package/dist/home/contract.d.ts +18 -0
  10. package/dist/home/contract.js +24 -3
  11. package/dist/home/host.d.ts +3 -0
  12. package/dist/home/host.js +1 -2
  13. package/dist/home/routing.js +13 -24
  14. package/dist/internal/history.d.ts +16 -0
  15. package/dist/internal/history.js +8 -0
  16. package/dist/loop/client.d.ts +1 -1
  17. package/dist/loop/client.js +28 -34
  18. package/dist/loop/contract.d.ts +113 -84
  19. package/dist/loop/contract.js +77 -9
  20. package/dist/loop/host.d.ts +1 -0
  21. package/dist/loop/host.js +17 -30
  22. package/dist/plan/client.d.ts +1 -1
  23. package/dist/plan/contract.d.ts +33 -0
  24. package/dist/plan/contract.js +28 -3
  25. package/dist/plan/host.js +12 -7
  26. package/dist/question/client.d.ts +1 -1
  27. package/dist/question/contract.d.ts +158 -0
  28. package/dist/question/contract.js +92 -7
  29. package/dist/question/host.js +34 -20
  30. package/dist/roster/conversation-agents.d.ts +31 -0
  31. package/dist/roster/conversation-agents.js +114 -0
  32. package/dist/roster.js +1 -0
  33. package/dist/skills/host.d.ts +1 -0
  34. package/dist/skills/host.js +22 -17
  35. package/dist/skills/source.d.ts +34 -0
  36. package/dist/subagents/client.d.ts +1 -1
  37. package/dist/subagents/client.js +43 -12
  38. package/dist/subagents/contract.d.ts +46 -8
  39. package/dist/subagents/contract.js +38 -8
  40. package/dist/subagents/host.d.ts +20 -8
  41. package/dist/subagents/host.js +58 -12
  42. package/docs/api/README.md +35 -0
  43. package/docs/api/almanac/contract.md +90 -0
  44. package/docs/api/almanac/host.md +19 -0
  45. package/docs/api/goal/client.md +26 -0
  46. package/docs/api/goal/contract.md +247 -0
  47. package/docs/api/goal/host.md +29 -0
  48. package/docs/api/home/contract.md +58 -0
  49. package/docs/api/home/host.md +55 -0
  50. package/docs/api/loop/client.md +25 -0
  51. package/docs/api/loop/contract.md +159 -0
  52. package/docs/api/loop/host.md +30 -0
  53. package/docs/api/plan/client.md +26 -0
  54. package/docs/api/plan/contract.md +163 -0
  55. package/docs/api/plan/host.md +19 -0
  56. package/docs/api/question/client.md +25 -0
  57. package/docs/api/question/contract.md +377 -0
  58. package/docs/api/question/host.md +19 -0
  59. package/docs/api/roster/conversation-agents.md +80 -0
  60. package/docs/api/roster.md +40 -0
  61. package/docs/api/skills/host.md +39 -0
  62. package/docs/api/skills/source.md +104 -0
  63. package/docs/api/subagents/client.md +26 -0
  64. package/docs/api/subagents/contract.md +131 -0
  65. package/docs/api/subagents/host.md +115 -0
  66. package/package.json +14 -8
@@ -0,0 +1,247 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / goal/contract
8
+
9
+ # goal/contract
10
+
11
+ ## Type Aliases
12
+
13
+ ### GoalPauseCause
14
+
15
+ ```ts
16
+ type GoalPauseCause = Schema.Schema.Type<typeof GoalPauseCause>;
17
+ ```
18
+
19
+ Typed pause cause and optional explanation.
20
+
21
+ ---
22
+
23
+ ### Goal
24
+
25
+ ```ts
26
+ type Goal = Schema.Schema.Type<typeof Goal>;
27
+ ```
28
+
29
+ The current goal every client sees.
30
+
31
+ ---
32
+
33
+ ### EndedGoal
34
+
35
+ ```ts
36
+ type EndedGoal = Schema.Schema.Type<typeof EndedGoal>;
37
+ ```
38
+
39
+ One finished goal.
40
+
41
+ ## Variables
42
+
43
+ ### Objective
44
+
45
+ ```ts
46
+ const Objective: String;
47
+ ```
48
+
49
+ A goal objective: stored exactly as sent, never blank.
50
+
51
+ ---
52
+
53
+ ### GoalReason
54
+
55
+ ```ts
56
+ const GoalReason: String;
57
+ ```
58
+
59
+ Nonblank explanation recorded when a goal is achieved.
60
+
61
+ ---
62
+
63
+ ### GoalPauseCause
64
+
65
+ ```ts
66
+ const GoalPauseCause: Struct<{
67
+ kind: Literals<
68
+ readonly [
69
+ "person",
70
+ "blocked",
71
+ "stalled",
72
+ "cancelled",
73
+ "failed",
74
+ "no-terminal",
75
+ ]
76
+ >;
77
+ detail: NullOr<String>;
78
+ }>;
79
+ ```
80
+
81
+ Why work paused, independent of the words shown to a person.
82
+
83
+ ---
84
+
85
+ ### Goal
86
+
87
+ ```ts
88
+ const Goal: Struct<{
89
+ revision: String;
90
+ objective: String;
91
+ state: Literals<readonly ["active", "paused"]>;
92
+ startedAt: Int;
93
+ pauseCause: NullOr<
94
+ Struct<{
95
+ kind: Literals<
96
+ readonly [
97
+ "person",
98
+ "blocked",
99
+ "stalled",
100
+ "cancelled",
101
+ "failed",
102
+ "no-terminal",
103
+ ]
104
+ >;
105
+ detail: NullOr<String>;
106
+ }>
107
+ >;
108
+ }>;
109
+ ```
110
+
111
+ The current goal every client sees; provisional terminals stay private.
112
+
113
+ ---
114
+
115
+ ### EndedGoal
116
+
117
+ ```ts
118
+ const EndedGoal: Struct<{
119
+ sequence: Int;
120
+ objective: String;
121
+ outcome: Literals<readonly ["achieved", "cleared"]>;
122
+ reason: NullOr<String>;
123
+ endedAt: Int;
124
+ afterSequence: Int;
125
+ }>;
126
+ ```
127
+
128
+ One finished goal: history only, never current.
129
+
130
+ ---
131
+
132
+ ### endedGoalLimit
133
+
134
+ ```ts
135
+ const endedGoalLimit: 16 = 16;
136
+ ```
137
+
138
+ How many finished goals a Session keeps for its chat lines.
139
+
140
+ ---
141
+
142
+ ### GoalCommandInput
143
+
144
+ ```ts
145
+ const GoalCommandInput: Union<
146
+ readonly [
147
+ Struct<{
148
+ action: Literal<"set">;
149
+ objective: String;
150
+ requestId: String;
151
+ expectedRevision: optional<NullOr<String>>;
152
+ confirmed: optional<Boolean>;
153
+ }>,
154
+ Struct<{
155
+ action: Literals<readonly ["pause", "resume", "replace", "clear"]>;
156
+ }>,
157
+ Struct<{}>,
158
+ ]
159
+ >;
160
+ ```
161
+
162
+ Arguments of the human `/goal` command. A bare call opens the controls; each
163
+ reply is a catalog step, so the conversation stays on the server.
164
+
165
+ ---
166
+
167
+ ### GoalProjection
168
+
169
+ ```ts
170
+ const GoalProjection: Struct<{
171
+ goal: NullOr<
172
+ Struct<{
173
+ revision: String;
174
+ objective: String;
175
+ state: Literals<readonly ["active", "paused"]>;
176
+ startedAt: Int;
177
+ pauseCause: NullOr<
178
+ Struct<{
179
+ kind: Literals<
180
+ readonly [
181
+ "person",
182
+ "blocked",
183
+ "stalled",
184
+ "cancelled",
185
+ "failed",
186
+ "no-terminal",
187
+ ]
188
+ >;
189
+ detail: NullOr<String>;
190
+ }>
191
+ >;
192
+ }>
193
+ >;
194
+ ended: $Array<
195
+ Struct<{
196
+ sequence: Int;
197
+ objective: String;
198
+ outcome: Literals<readonly ["achieved", "cleared"]>;
199
+ reason: NullOr<String>;
200
+ endedAt: Int;
201
+ afterSequence: Int;
202
+ }>
203
+ >;
204
+ omitted: Int;
205
+ }>;
206
+ ```
207
+
208
+ Goal's contract: Session-scope human controls and one projection slot.
209
+
210
+ ---
211
+
212
+ ### goalContract
213
+
214
+ ```ts
215
+ const goalContract: object;
216
+ ```
217
+
218
+ Session-owned goal controls and their visible projection.
219
+
220
+ #### Type Declaration
221
+
222
+ | Name | Type | Default value | Description |
223
+ | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------- |
224
+ | <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\> | - | Stable extension identity. |
225
+ | <a id="property-commands"></a> `commands` | `object` | - | Goal commands admitted by the Session owner. |
226
+ | `commands.goal` | `object` | - | Open or answer the human goal controls. |
227
+ | `commands.goal.scope` | `"session"` | `"session"` | The Session owns this goal. |
228
+ | `commands.goal.input` | `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"`\]\>; \}\>, `Struct`\<\{ \}\>\]\> | `GoalCommandInput` | Decode the control action. |
229
+ | `commands.goal.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the server-owned conversation step. |
230
+ | `commands.pause` | `object` | - | Pause work on the current goal. |
231
+ | `commands.pause.scope` | `"session"` | `"session"` | The Session owns this goal. |
232
+ | `commands.pause.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
233
+ | `commands.pause.output` | `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`\>; \}\>\>; \}\> | `Goal` | Return the paused goal. |
234
+ | `commands.resume` | `object` | - | Resume work on a paused goal. |
235
+ | `commands.resume.scope` | `"session"` | `"session"` | The Session owns this goal. |
236
+ | `commands.resume.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
237
+ | `commands.resume.output` | `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`\>; \}\>\>; \}\> | `Goal` | Return the active goal. |
238
+ | `commands.clear` | `object` | - | Clear the current objective. |
239
+ | `commands.clear.scope` | `"session"` | `"session"` | The Session owns this goal. |
240
+ | `commands.clear.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
241
+ | `commands.clear.output` | `Struct`\<\{ \}\> | - | A successful clear has no result fields. |
242
+ | `commands.set` | `object` | - | Set an objective against the revision the person saw. |
243
+ | `commands.set.scope` | `"session"` | `"session"` | The Session owns this goal. |
244
+ | `commands.set.input` | `Struct`\<\{ `objective`: `String`; `expectedRevision`: `NullOr`\<`String`\>; `requestId`: `String`; \}\> | - | Decode the new objective and replacement fence. |
245
+ | `commands.set.output` | `Struct`\<\{ `goal`: `Struct`\<\{ `revision`: `String`; `objective`: `String`; `state`: `Literals`\<readonly \[`"active"`, `"paused"`\]\>; `startedAt`: `Int`; `pauseCause`: `NullOr`\<`Struct`\<\{ `kind`: `Literals`\<...\>; `detail`: `NullOr`\<...\>; \}\>\>; \}\>; `accepted`: `Struct`\<\{ `status`: `Literal`\<`"accepted"`\>; `commandId`: `String`; \}\>; \}\> | - | Return the goal and its admission receipt. |
246
+ | <a id="property-projection"></a> `projection` | `object` | - | Current and ended goals visible to clients. |
247
+ | `projection.schema` | `Struct`\<\{ `goal`: `NullOr`\<`Struct`\<\{ `revision`: `String`; `objective`: `String`; `state`: `Literals`\<readonly \[`"active"`, `"paused"`\]\>; `startedAt`: `Int`; `pauseCause`: `NullOr`\<`Struct`\<\{ `kind`: `Literals`\<...\>; `detail`: `NullOr`\<...\>; \}\>\>; \}\>\>; `ended`: `$Array`\<`Struct`\<\{ `sequence`: `Int`; `objective`: `String`; `outcome`: `Literals`\<readonly \[`"achieved"`, `"cleared"`\]\>; `reason`: `NullOr`\<`String`\>; `endedAt`: `Int`; `afterSequence`: `Int`; \}\>\>; `omitted`: `Int`; \}\> | `GoalProjection` | Decoder for the goal projection. |
@@ -0,0 +1,29 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / goal/host
8
+
9
+ # goal/host
10
+
11
+ ## Variables
12
+
13
+ ### goalCatalog
14
+
15
+ ```ts
16
+ const goalCatalog: Json;
17
+ ```
18
+
19
+ The commands this extension advertises to every client.
20
+
21
+ ---
22
+
23
+ ### goalExtension
24
+
25
+ ```ts
26
+ const goalExtension: RosteredExtensionV0;
27
+ ```
28
+
29
+ Botanical's Session goal, driven only by settled runs.
@@ -0,0 +1,58 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / home/contract
8
+
9
+ # home/contract
10
+
11
+ ## Type Aliases
12
+
13
+ ### Home
14
+
15
+ ```ts
16
+ type Home = Schema.Schema.Type<typeof Home>;
17
+ ```
18
+
19
+ Persisted Home selection for one Agent.
20
+
21
+ ## Variables
22
+
23
+ ### Home
24
+
25
+ ```ts
26
+ const Home: Struct<{
27
+ attachmentId: NullOr<String>;
28
+ }>;
29
+ ```
30
+
31
+ The Agent's recorded choice survives the chosen attachment being detached.
32
+
33
+ ---
34
+
35
+ ### homeContract
36
+
37
+ ```ts
38
+ const homeContract: object;
39
+ ```
40
+
41
+ Human selection changes Agent state; no model operation exposes this command.
42
+
43
+ #### Type Declaration
44
+
45
+ | Name | Type | Default value | Description |
46
+ | --------------------------------------------- | ------------------------------------------------------------------- | ------------- | ---------------------------------------------------------- |
47
+ | <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\> | - | Stable extension identity. |
48
+ | <a id="property-commands"></a> `commands` | `object` | - | Human selection and initial seeding operations. |
49
+ | `commands.home` | `object` | - | Open Home controls or select an attachment by name. |
50
+ | `commands.home.scope` | `"session"` | `"session"` | Human controls are opened from a Session. |
51
+ | `commands.home.input` | `Struct`\<\{ `name`: `optionalKey`\<`String`\>; \}\> | - | Decode an optional attachment name. |
52
+ | `commands.home.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the server-owned conversation step. |
53
+ | `commands.seed` | `object` | - | Seed the Agent's initial recorded Home choice. |
54
+ | `commands.seed.scope` | `"agent"` | `"agent"` | Home selection belongs to the Agent. |
55
+ | `commands.seed.input` | `Struct`\<\{ `attachmentId`: `NullOr`\<`String`\>; \}\> | `Home` | Decode the initial selection. |
56
+ | `commands.seed.output` | `Struct`\<\{ `seeded`: `Boolean`; \}\> | - | Report whether seeding changed the recorded choice. |
57
+ | <a id="property-projection"></a> `projection` | `object` | - | Recorded selection visible to clients, or no seeded state. |
58
+ | `projection.schema` | `NullOr`\<`Struct`\<\{ `attachmentId`: `NullOr`\<`String`\>; \}\>\> | - | Decoder for the optional Home state. |
@@ -0,0 +1,55 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / home/host
8
+
9
+ # home/host
10
+
11
+ ## Type Aliases
12
+
13
+ ### HomeComputer
14
+
15
+ ```ts
16
+ type HomeComputer = Readonly<{
17
+ name: string;
18
+ attachmentId: string;
19
+ port: FilesPort;
20
+ }>;
21
+ ```
22
+
23
+ Already-scoped authority supplied by the host, never constructed by Home.
24
+
25
+ ## Variables
26
+
27
+ ### homeGrant
28
+
29
+ ```ts
30
+ const homeGrant: ExtensionGrantV0;
31
+ ```
32
+
33
+ Hosts admit Home explicitly; no other extension receives the Files slot.
34
+
35
+ ## Functions
36
+
37
+ ### homeExtension()
38
+
39
+ ```ts
40
+ function homeExtension(options): RosteredExtensionV0;
41
+ ```
42
+
43
+ Agent-scope choice with per-run tools and prompt over one captured table.
44
+
45
+ #### Parameters
46
+
47
+ | Parameter | Type |
48
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
49
+ | `options` | \{ `computers`: \{ `read`: (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[]; \}; \} |
50
+ | `options.computers` | \{ `read`: (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[]; \} |
51
+ | `options.computers.read` | (`context`) => readonly `Readonly`\<\{ `name`: `string`; `attachmentId`: `string`; `port`: `FilesPort`; \}\>[] |
52
+
53
+ #### Returns
54
+
55
+ `RosteredExtensionV0`
@@ -0,0 +1,25 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / loop/client
8
+
9
+ # loop/client
10
+
11
+ ## Variables
12
+
13
+ ### default
14
+
15
+ ```ts
16
+ default: Readonly<{
17
+ protocol: "shiitake.client/v1";
18
+ id: string & Brand<"ExtensionId">;
19
+ promptPresentation?: "footer";
20
+ attach?: (context) => Effect<void, Error, Scope>;
21
+ contribute?: (slot) => object;
22
+ }>;
23
+ ```
24
+
25
+ Loop supplies its own absolute due copy and advertised stop intent.
@@ -0,0 +1,159 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / loop/contract
8
+
9
+ # loop/contract
10
+
11
+ ## Type Aliases
12
+
13
+ ### Loop
14
+
15
+ ```ts
16
+ type Loop = Schema.Schema.Type<typeof Loop>;
17
+ ```
18
+
19
+ One Session's loop.
20
+
21
+ ## Variables
22
+
23
+ ### LoopCron
24
+
25
+ ```ts
26
+ const LoopCron: Struct<{
27
+ expression: String;
28
+ timeZone: String;
29
+ }>;
30
+ ```
31
+
32
+ A named cron cadence evaluated in one IANA time zone.
33
+
34
+ ---
35
+
36
+ ### Loop
37
+
38
+ ```ts
39
+ const Loop: Struct<{
40
+ loopId: String;
41
+ origin: Literals<readonly ["human", "model"]>;
42
+ expiresAt: NullOr<Int>;
43
+ prompt: String;
44
+ mode: Literals<readonly ["self_paced", "fixed_interval"]>;
45
+ cron: NullOr<
46
+ Struct<{
47
+ expression: String;
48
+ timeZone: String;
49
+ }>
50
+ >;
51
+ state: Literals<
52
+ readonly ["active", "paused", "finished", "failed", "cancelled"]
53
+ >;
54
+ commandId: String;
55
+ reason: NullOr<String>;
56
+ nextDueAt: NullOr<Int>;
57
+ lastError: NullOr<String>;
58
+ }>;
59
+ ```
60
+
61
+ One Session's loop as every client sees it.
62
+
63
+ ---
64
+
65
+ ### LoopCommandInput
66
+
67
+ ```ts
68
+ const LoopCommandInput: Union<
69
+ readonly [
70
+ Struct<{
71
+ action: Literal<"start">;
72
+ text: String;
73
+ requestId: String;
74
+ }>,
75
+ Struct<{
76
+ action: Literals<readonly ["status", "pause", "resume", "stop", "new"]>;
77
+ }>,
78
+ Struct<{}>,
79
+ ]
80
+ >;
81
+ ```
82
+
83
+ Arguments of the human `/loop` command. `start` carries the typed text:
84
+ `<prompt>` paces itself, `<N>m <prompt>` or `<N>h <prompt>` runs on an interval.
85
+ A bare call opens the controls.
86
+
87
+ ---
88
+
89
+ ### LoopProjection
90
+
91
+ ```ts
92
+ const LoopProjection: Struct<{
93
+ loop: Struct<{
94
+ loopId: String;
95
+ origin: Literals<readonly ["human", "model"]>;
96
+ expiresAt: NullOr<Int>;
97
+ prompt: String;
98
+ mode: Literals<readonly ["self_paced", "fixed_interval"]>;
99
+ cron: NullOr<
100
+ Struct<{
101
+ expression: String;
102
+ timeZone: String;
103
+ }>
104
+ >;
105
+ state: Literals<
106
+ readonly ["active", "paused", "finished", "failed", "cancelled"]
107
+ >;
108
+ commandId: String;
109
+ reason: NullOr<String>;
110
+ nextDueAt: NullOr<Int>;
111
+ lastError: NullOr<String>;
112
+ }>;
113
+ }>;
114
+ ```
115
+
116
+ Loop's contract: Session-scope controls and one projection slot.
117
+
118
+ ---
119
+
120
+ ### loopContract
121
+
122
+ ```ts
123
+ const loopContract: object;
124
+ ```
125
+
126
+ Session-owned loop controls and their visible state.
127
+
128
+ #### Type Declaration
129
+
130
+ | Name | Type | Default value | Description |
131
+ | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------- |
132
+ | <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\> | - | Stable extension identity. |
133
+ | <a id="property-commands"></a> `commands` | `object` | - | Loop operations admitted by the Session owner. |
134
+ | `commands.loop` | `object` | - | Open or answer the human loop controls. |
135
+ | `commands.loop.scope` | `"session"` | `"session"` | The Session owns this loop. |
136
+ | `commands.loop.input` | `Union`\<readonly \[`Struct`\<\{ `action`: `Literal`\<`"start"`\>; `text`: `String`; `requestId`: `String`; \}\>, `Struct`\<\{ `action`: `Literals`\<readonly \[`"status"`, `"pause"`, `"resume"`, `"stop"`, `"new"`\]\>; \}\>, `Struct`\<\{ \}\>\]\> | `LoopCommandInput` | Decode the selected human action. |
137
+ | `commands.loop.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the server-owned conversation step. |
138
+ | `commands.startSelfPaced` | `object` | - | Start a loop whose next occurrence is chosen by the model. |
139
+ | `commands.startSelfPaced.scope` | `"session"` | `"session"` | The Session owns this loop. |
140
+ | `commands.startSelfPaced.input` | `Struct`\<\{ `prompt`: `String`; `requestId`: `String`; \}\> | - | Decode the repeated prompt and command identity. |
141
+ | `commands.startSelfPaced.output` | `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`\>; \}\>; `accepted`: `Struct`\<\{ `status`: `Literal`\<`"accepted"`\>; `commandId`: `String`; \}\>; \}\> | `StartResult` | Return the loop and admission receipt. |
142
+ | `commands.startFixedInterval` | `object` | - | Start a loop with a fixed cron cadence. |
143
+ | `commands.startFixedInterval.scope` | `"session"` | `"session"` | The Session owns this loop. |
144
+ | `commands.startFixedInterval.input` | `Struct`\<\{ `expression`: `String`; `timeZone`: `String`; `prompt`: `String`; `requestId`: `String`; \}\> | - | Decode the prompt, cadence and command identity. |
145
+ | `commands.startFixedInterval.output` | `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`\>; \}\>; `accepted`: `Struct`\<\{ `status`: `Literal`\<`"accepted"`\>; `commandId`: `String`; \}\>; \}\> | `StartResult` | Return the loop and admission receipt. |
146
+ | `commands.pause` | `object` | - | Suspend the current loop. |
147
+ | `commands.pause.scope` | `"session"` | `"session"` | The Session owns this loop. |
148
+ | `commands.pause.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
149
+ | `commands.pause.output` | `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`\>; \}\> | `Loop` | Return the paused loop. |
150
+ | `commands.resume` | `object` | - | Resume the current paused loop. |
151
+ | `commands.resume.scope` | `"session"` | `"session"` | The Session owns this loop. |
152
+ | `commands.resume.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
153
+ | `commands.resume.output` | `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`\>; \}\> | `Loop` | Return the resumed loop. |
154
+ | `commands.stop` | `object` | - | Stop future occurrences of the current loop. |
155
+ | `commands.stop.scope` | `"session"` | `"session"` | The Session owns this loop. |
156
+ | `commands.stop.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
157
+ | `commands.stop.output` | `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`\>; \}\> | `Loop` | Return the stopped loop. |
158
+ | <a id="property-projection"></a> `projection` | `object` | - | Current loop visible to Session clients. |
159
+ | `projection.schema` | `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`\>; \}\>; \}\> | `LoopProjection` | Decoder for projected loop state. |
@@ -0,0 +1,30 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/shiitake-extensions**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/shiitake-extensions](../README.md) / loop/host
8
+
9
+ # loop/host
10
+
11
+ ## Variables
12
+
13
+ ### loopCatalog
14
+
15
+ ```ts
16
+ const loopCatalog: Json;
17
+ ```
18
+
19
+ The commands this extension advertises to every client.
20
+
21
+ ---
22
+
23
+ ### loopExtension
24
+
25
+ ```ts
26
+ const loopExtension: RosteredExtensionV0;
27
+ ```
28
+
29
+ Durable Session loop implementation with prompts, controls and scheduled
30
+ occurrences.