@fungi.computer/shiitake-extensions 0.6.6 → 0.6.7
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.
- package/README.md +30 -17
- package/dist/goal/client.js +6 -2
- package/dist/goal/contract.d.ts +98 -10
- package/dist/goal/contract.js +50 -1
- package/dist/goal/host.js +68 -13
- package/dist/goal/prompts.js +1 -0
- package/dist/question/client.js +13 -2
- package/dist/question/contract.d.ts +70 -4
- package/dist/question/contract.js +14 -2
- package/dist/question/host.js +224 -122
- package/dist/subagents/client.js +28 -10
- package/dist/subagents/contract.d.ts +93 -0
- package/dist/subagents/contract.js +49 -0
- package/dist/subagents/host.d.ts +3 -3
- package/dist/subagents/host.js +77 -14
- package/dist/subagents/presentation.d.ts +4 -0
- package/dist/subagents/presentation.js +9 -0
- package/docs/api/goal/contract.md +35 -26
- package/docs/api/question/contract.md +62 -30
- package/docs/api/subagents/contract.md +51 -14
- package/docs/api/subagents/host.md +4 -4
- package/package.json +6 -6
|
@@ -67,6 +67,7 @@ const GoalPauseCause: Struct<{
|
|
|
67
67
|
kind: Literals<
|
|
68
68
|
readonly [
|
|
69
69
|
"person",
|
|
70
|
+
"delegator",
|
|
70
71
|
"blocked",
|
|
71
72
|
"stalled",
|
|
72
73
|
"cancelled",
|
|
@@ -95,6 +96,7 @@ const Goal: Struct<{
|
|
|
95
96
|
kind: Literals<
|
|
96
97
|
readonly [
|
|
97
98
|
"person",
|
|
99
|
+
"delegator",
|
|
98
100
|
"blocked",
|
|
99
101
|
"stalled",
|
|
100
102
|
"cancelled",
|
|
@@ -120,6 +122,7 @@ const EndedGoal: Struct<{
|
|
|
120
122
|
objective: String;
|
|
121
123
|
outcome: Literals<readonly ["achieved", "cleared"]>;
|
|
122
124
|
reason: NullOr<String>;
|
|
125
|
+
clearedBy: optionalKey<NonEmptyString>;
|
|
123
126
|
endedAt: Int;
|
|
124
127
|
afterSequence: Int;
|
|
125
128
|
}>;
|
|
@@ -182,6 +185,7 @@ const GoalProjection: Struct<{
|
|
|
182
185
|
kind: Literals<
|
|
183
186
|
readonly [
|
|
184
187
|
"person",
|
|
188
|
+
"delegator",
|
|
185
189
|
"blocked",
|
|
186
190
|
"stalled",
|
|
187
191
|
"cancelled",
|
|
@@ -200,6 +204,7 @@ const GoalProjection: Struct<{
|
|
|
200
204
|
objective: String;
|
|
201
205
|
outcome: Literals<readonly ["achieved", "cleared"]>;
|
|
202
206
|
reason: NullOr<String>;
|
|
207
|
+
clearedBy: optionalKey<NonEmptyString>;
|
|
203
208
|
endedAt: Int;
|
|
204
209
|
afterSequence: Int;
|
|
205
210
|
}>
|
|
@@ -222,29 +227,33 @@ Session-owned goal controls and their visible projection.
|
|
|
222
227
|
|
|
223
228
|
#### Type Declaration
|
|
224
229
|
|
|
225
|
-
| Name | Type
|
|
226
|
-
| --------------------------------------------- |
|
|
227
|
-
| <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\>
|
|
228
|
-
| <a id="property-commands"></a> `commands` | `object`
|
|
229
|
-
| `commands.
|
|
230
|
-
| `commands.
|
|
231
|
-
| `commands.
|
|
232
|
-
| `commands.
|
|
233
|
-
| `commands.
|
|
234
|
-
| `commands.
|
|
235
|
-
| `commands.
|
|
236
|
-
| `commands.
|
|
237
|
-
| `commands.
|
|
238
|
-
| `commands.
|
|
239
|
-
| `commands.
|
|
240
|
-
| `commands.
|
|
241
|
-
| `commands.
|
|
242
|
-
| `commands.
|
|
243
|
-
| `commands.
|
|
244
|
-
| `commands.
|
|
245
|
-
| `commands.
|
|
246
|
-
| `commands.
|
|
247
|
-
| `commands.
|
|
248
|
-
| `commands.
|
|
249
|
-
|
|
|
250
|
-
| `
|
|
230
|
+
| Name | Type | Default value | Description |
|
|
231
|
+
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------- |
|
|
232
|
+
| <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\> | - | Stable extension identity. |
|
|
233
|
+
| <a id="property-commands"></a> `commands` | `object` | - | Goal commands admitted by the Session owner. |
|
|
234
|
+
| `commands.controlAgent` | `object` | - | Exact first delegator's controls; never an ordinary person command. |
|
|
235
|
+
| `commands.controlAgent.scope` | `"session"` | `"session"` | The child's Session owns this goal. |
|
|
236
|
+
| `commands.controlAgent.input` | `Struct`\<\{ `action`: `Literals`\<readonly \[`"pause"`, `"resume"`, `"clear"`\]\>; `reason`: `String`; \}\> | - | Requested control; caller identity comes only from the host. |
|
|
237
|
+
| `commands.controlAgent.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"paused"`\>; `goal`: `Struct`\<\{ `revision`: `String`; `objective`: `String`; `state`: `Literals`\<readonly \[..., ...\]\>; `startedAt`: `Int`; `pauseCause`: `NullOr`\<`Struct`\<...\>\>; \}\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"resumed"`\>; `goal`: `Struct`\<\{ `revision`: `String`; `objective`: `String`; `state`: `Literals`\<readonly \[..., ...\]\>; `startedAt`: `Int`; `pauseCause`: `NullOr`\<`Struct`\<...\>\>; \}\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"cleared"`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"no_goal"`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"refused"`\>; `reason`: `Literals`\<readonly \[`"not_delegator"`, `"not_paused_by_delegator"`\]\>; \}\>\]\> | - | Applied control or an explicit refusal without mutation. |
|
|
238
|
+
| `commands.goal` | `object` | - | Open or answer the human goal controls. |
|
|
239
|
+
| `commands.goal.scope` | `"session"` | `"session"` | The Session owns this goal. |
|
|
240
|
+
| `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"`, `"clear-ask"`\]\>; `confirmed`: `optional`\<`Boolean`\>; \}\>, `Struct`\<\{ \}\>\]\> | `GoalCommandInput` | Decode the control action. |
|
|
241
|
+
| `commands.goal.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the server-owned conversation step. |
|
|
242
|
+
| `commands.pause` | `object` | - | Pause work on the current goal. |
|
|
243
|
+
| `commands.pause.scope` | `"session"` | `"session"` | The Session owns this goal. |
|
|
244
|
+
| `commands.pause.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
|
|
245
|
+
| `commands.pause.output` | `Struct`\<\{ `revision`: `String`; `objective`: `String`; `state`: `Literals`\<readonly \[`"active"`, `"paused"`\]\>; `startedAt`: `Int`; `pauseCause`: `NullOr`\<`Struct`\<\{ `kind`: `Literals`\<readonly \[`"person"`, `"delegator"`, `"blocked"`, `"stalled"`, `"cancelled"`, `"failed"`, `"no-terminal"`\]\>; `detail`: `NullOr`\<`String`\>; \}\>\>; \}\> | `Goal` | Return the paused goal. |
|
|
246
|
+
| `commands.resume` | `object` | - | Resume work on a paused goal. |
|
|
247
|
+
| `commands.resume.scope` | `"session"` | `"session"` | The Session owns this goal. |
|
|
248
|
+
| `commands.resume.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
|
|
249
|
+
| `commands.resume.output` | `Struct`\<\{ `revision`: `String`; `objective`: `String`; `state`: `Literals`\<readonly \[`"active"`, `"paused"`\]\>; `startedAt`: `Int`; `pauseCause`: `NullOr`\<`Struct`\<\{ `kind`: `Literals`\<readonly \[`"person"`, `"delegator"`, `"blocked"`, `"stalled"`, `"cancelled"`, `"failed"`, `"no-terminal"`\]\>; `detail`: `NullOr`\<`String`\>; \}\>\>; \}\> | `Goal` | Return the active goal. |
|
|
250
|
+
| `commands.clear` | `object` | - | Clear the current objective. |
|
|
251
|
+
| `commands.clear.scope` | `"session"` | `"session"` | The Session owns this goal. |
|
|
252
|
+
| `commands.clear.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
|
|
253
|
+
| `commands.clear.output` | `Struct`\<\{ \}\> | - | A successful clear has no result fields. |
|
|
254
|
+
| `commands.set` | `object` | - | Set an objective against the revision the person saw. |
|
|
255
|
+
| `commands.set.scope` | `"session"` | `"session"` | The Session owns this goal. |
|
|
256
|
+
| `commands.set.input` | `Struct`\<\{ `objective`: `String`; `expectedRevision`: `NullOr`\<`String`\>; `requestId`: `String`; `adoptCommandId`: `optionalKey`\<`String`\>; \}\> | - | Decode the new objective and replacement fence. |
|
|
257
|
+
| `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. |
|
|
258
|
+
| <a id="property-projection"></a> `projection` | `object` | - | Current and ended goals visible to clients. |
|
|
259
|
+
| `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`\>; `clearedBy`: `optionalKey`\<`NonEmptyString`\>; `endedAt`: `Int`; `afterSequence`: `Int`; \}\>\>; `omitted`: `Int`; \}\> | `GoalProjection` | Decoder for the goal projection. |
|
|
@@ -146,6 +146,19 @@ const OpenAsk: Struct<{
|
|
|
146
146
|
name: NonEmptyString;
|
|
147
147
|
}>
|
|
148
148
|
>;
|
|
149
|
+
escalated: optionalKey<
|
|
150
|
+
Struct<{
|
|
151
|
+
by: Struct<{
|
|
152
|
+
agentId: NonEmptyString;
|
|
153
|
+
sessionId: NonEmptyString;
|
|
154
|
+
name: NonEmptyString;
|
|
155
|
+
}>;
|
|
156
|
+
reason: Literals<
|
|
157
|
+
readonly ["escalated", "sender_archived", "sender_absent"]
|
|
158
|
+
>;
|
|
159
|
+
note: optionalKey<String>;
|
|
160
|
+
}>
|
|
161
|
+
>;
|
|
149
162
|
questions: $Array<
|
|
150
163
|
Struct<{
|
|
151
164
|
id: String;
|
|
@@ -181,6 +194,15 @@ const AskProjection: Struct<{
|
|
|
181
194
|
sessionId: NonEmptyString;
|
|
182
195
|
name: NonEmptyString;
|
|
183
196
|
}>>;
|
|
197
|
+
escalated: optionalKey<Struct<{
|
|
198
|
+
by: Struct<{
|
|
199
|
+
agentId: NonEmptyString;
|
|
200
|
+
sessionId: NonEmptyString;
|
|
201
|
+
name: NonEmptyString;
|
|
202
|
+
}>;
|
|
203
|
+
reason: Literals<readonly ["escalated", "sender_archived", "sender_absent"]>;
|
|
204
|
+
note: optionalKey<String>;
|
|
205
|
+
}>>;
|
|
184
206
|
questions: $Array<Struct<{
|
|
185
207
|
id: String;
|
|
186
208
|
header: String;
|
|
@@ -388,6 +410,15 @@ The Agent that answered, as the host authenticated it.
|
|
|
388
410
|
```ts
|
|
389
411
|
const EscalateResult: Union<
|
|
390
412
|
readonly [
|
|
413
|
+
Struct<{
|
|
414
|
+
result: Literal<"escalated">;
|
|
415
|
+
to: Literal<"agent">;
|
|
416
|
+
waitingOn: Struct<{
|
|
417
|
+
agentId: NonEmptyString;
|
|
418
|
+
sessionId: NonEmptyString;
|
|
419
|
+
name: NonEmptyString;
|
|
420
|
+
}>;
|
|
421
|
+
}>,
|
|
391
422
|
Struct<{
|
|
392
423
|
result: Literal<"escalated">;
|
|
393
424
|
to: Literal<"person">;
|
|
@@ -425,6 +456,7 @@ Outcome of the Agent an Ask waits on passing it on.
|
|
|
425
456
|
```ts
|
|
426
457
|
const EscalateInput: Struct<{
|
|
427
458
|
askId: String;
|
|
459
|
+
note: optional<String>;
|
|
428
460
|
}>;
|
|
429
461
|
```
|
|
430
462
|
|
|
@@ -477,33 +509,33 @@ host.
|
|
|
477
509
|
|
|
478
510
|
#### Type Declaration
|
|
479
511
|
|
|
480
|
-
| Name | Type
|
|
481
|
-
| --------------------------------------------- |
|
|
482
|
-
| <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\>
|
|
483
|
-
| <a id="property-commands"></a> `commands` | `object`
|
|
484
|
-
| `commands.answerFlow` | `object`
|
|
485
|
-
| `commands.answerFlow.scope` | `"session"`
|
|
486
|
-
| `commands.answerFlow.input` | `Union`\<readonly \[`Struct`\<\{ `askId`: `String`; `requestId`: `String`; `index`: `Number`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: `$Array`\<...\>; `text`: `optionalKey`\<...\>; \}\>\>; `stage`: `Literal`\<`"decision"`\>; `answer`: `Struct`\<\{ `selected`: `$Array`\<`String`\>; `text`: `optionalKey`\<`String`\>; \}\>; \}\>, `Struct`\<\{ `askId`: `String`; \}\>, `Struct`\<\{ \}\>\]\>
|
|
487
|
-
| `commands.answerFlow.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\>
|
|
488
|
-
| `commands.answer` | `object`
|
|
489
|
-
| `commands.answer.scope` | `"session"`
|
|
490
|
-
| `commands.answer.input` | `Struct`\<\{ `askId`: `String`; `requestId`: `String`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: `$Array`\<`String`\>; `text`: `optionalKey`\<`String`\>; \}\>\>; \}\>
|
|
491
|
-
| `commands.answer.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"accepted"`\>; `via`: `Literals`\<readonly \[`"in_turn"`, `"follow_up"`\]\>; `commandId`: `optionalKey`\<`String`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"closed"`\>; `status`: `Literals`\<readonly \[`"answered"`, `"declined"`, `"withdrawn"`, `"expired"`, `"cancelled"`, `"undeliverable"`\]\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"not_found"`\>; \}\>\]\>
|
|
492
|
-
| `commands.answerAgent` | `object`
|
|
493
|
-
| `commands.answerAgent.scope` | `"session"`
|
|
494
|
-
| `commands.answerAgent.input` | `Struct`\<\{ `askId`: `String`; `requestId`: `String`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: `$Array`\<`String`\>; `text`: `optionalKey`\<`String`\>; \}\>\>; \}\>
|
|
495
|
-
| `commands.answerAgent.output` | `Struct`\<\{ `result`: `Union`\<readonly \[`Union`\<readonly \[`Struct`\<\{ `result`: ...; `via`: ...; `commandId`: ...; \}\>, `Struct`\<\{ `result`: ...; `status`: ...; \}\>, `Struct`\<\{ `result`: ...; \}\>\]\>, `Struct`\<\{ `result`: `Literal`\<`"refused"`\>; `reason`: `Literal`\<`"not_sender"`\>; \}\>\]\>; `answeredBy`: `Struct`\<\{ `kind`: `Literal`\<`"agent"`\>; `agentId`: `String`; \}\>; \}\>
|
|
496
|
-
| `commands.escalateAgent` | `object`
|
|
497
|
-
| `commands.escalateAgent.scope` | `"session"`
|
|
498
|
-
| `commands.escalateAgent.input` | `Struct`\<\{ `askId`: `String`; \}\>
|
|
499
|
-
| `commands.escalateAgent.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"escalated"`\>; `to`: `Literal`\<`"person"`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"closed"`\>; `status`: `Literals`\<readonly \[`"answered"`, `"declined"`, `"withdrawn"`, `"expired"`, `"cancelled"`, `"undeliverable"`\]\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"not_found"`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"refused"`\>; `reason`: `Literal`\<`"not_sender"`\>; \}\>\]\>
|
|
500
|
-
| `commands.decline` | `object`
|
|
501
|
-
| `commands.decline.scope` | `"session"`
|
|
502
|
-
| `commands.decline.input` | `Struct`\<\{ `askId`: `String`; `requestId`: `String`; `note`: `optionalKey`\<`String`\>; \}\>
|
|
503
|
-
| `commands.decline.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"accepted"`\>; `via`: `Literals`\<readonly \[`"in_turn"`, `"follow_up"`\]\>; `commandId`: `optionalKey`\<`String`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"closed"`\>; `status`: `Literals`\<readonly \[`"answered"`, `"declined"`, `"withdrawn"`, `"expired"`, `"cancelled"`, `"undeliverable"`\]\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"not_found"`\>; \}\>\]\>
|
|
504
|
-
| `commands.list` | `object`
|
|
505
|
-
| `commands.list.scope` | `"session"`
|
|
506
|
-
| `commands.list.input` | `Struct`\<\{ \}\>
|
|
507
|
-
| `commands.list.output` | `Struct`\<\{ `asks`: `$Array`\<`Struct`\<\{ `askId`: `String`; `waitingOn`: `optionalKey`\<`Struct`\<\{ `agentId`: ...; `sessionId`: ...; `name`: ...; \}\>\>; `questions`: `$Array`\<`Struct`\<\{ `id`: ...; `header`: ...; `question`: ...; `options`: ...; `multiple`: ...; \}\>\>; `status`: `Literals`\<readonly \[`"live"`, `"parked"`\]\>; `createdAt`: `Number`; `expiresAt`: `NullOr`\<`Number`\>; \}\>\>; \}\>
|
|
508
|
-
| <a id="property-projection"></a> `projection` | `object`
|
|
509
|
-
| `projection.schema` | `Struct`\<\{ `asks`: `$Array`\<`Struct`\<\{ `askId`: `String`; `waitingOn`: `optionalKey`\<`Struct`\<\{ `agentId`: `NonEmptyString`; `sessionId`: `NonEmptyString`; `name`: `NonEmptyString`; \}\>\>; `questions`: `$Array`\<`Struct`\<\{ `id`: `String`; `header`: `String`; `question`: `String`; `options`: `$Array`\<...\>; `multiple`: `optionalKey`\<...\>; \}\>\>; `status`: `Literals`\<readonly \[`"live"`, `"parked"`\]\>; `createdAt`: `Number`; `expiresAt`: `NullOr`\<`Number`\>; \}\>\>; \}\>
|
|
512
|
+
| Name | Type | Default value | Description |
|
|
513
|
+
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ----------------------------------------------------------------------- |
|
|
514
|
+
| <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\> | - | Stable extension identity. |
|
|
515
|
+
| <a id="property-commands"></a> `commands` | `object` | - | Human question controls admitted by the Session owner. |
|
|
516
|
+
| `commands.answerFlow` | `object` | - | Advance the server-owned answer conversation. |
|
|
517
|
+
| `commands.answerFlow.scope` | `"session"` | `"session"` | The Session owns its asks and replies. |
|
|
518
|
+
| `commands.answerFlow.input` | `Union`\<readonly \[`Struct`\<\{ `askId`: `String`; `requestId`: `String`; `index`: `Number`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: `$Array`\<...\>; `text`: `optionalKey`\<...\>; \}\>\>; `stage`: `Literal`\<`"decision"`\>; `answer`: `Struct`\<\{ `selected`: `$Array`\<`String`\>; `text`: `optionalKey`\<`String`\>; \}\>; \}\>, `Struct`\<\{ `askId`: `String`; \}\>, `Struct`\<\{ \}\>\]\> | `AnswerFlowInput` | Decode the current answer-draft step. |
|
|
519
|
+
| `commands.answerFlow.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the next human conversation step. |
|
|
520
|
+
| `commands.answer` | `object` | - | Submit a person's completed answers. |
|
|
521
|
+
| `commands.answer.scope` | `"session"` | `"session"` | The Session owns this ask. |
|
|
522
|
+
| `commands.answer.input` | `Struct`\<\{ `askId`: `String`; `requestId`: `String`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: `$Array`\<`String`\>; `text`: `optionalKey`\<`String`\>; \}\>\>; \}\> | `AnswerInput` | Decode the answer submission. |
|
|
523
|
+
| `commands.answer.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"accepted"`\>; `via`: `Literals`\<readonly \[`"in_turn"`, `"follow_up"`\]\>; `commandId`: `optionalKey`\<`String`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"closed"`\>; `status`: `Literals`\<readonly \[`"answered"`, `"declined"`, `"withdrawn"`, `"expired"`, `"cancelled"`, `"undeliverable"`\]\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"not_found"`\>; \}\>\]\> | `HumanResult` | Return admission or the ask's terminal state. |
|
|
524
|
+
| `commands.answerAgent` | `object` | - | Submit the answer of the Agent this Ask waits on; never a human answer. |
|
|
525
|
+
| `commands.answerAgent.scope` | `"session"` | `"session"` | The child Session owns the Ask; caller authority is host context. |
|
|
526
|
+
| `commands.answerAgent.input` | `Struct`\<\{ `askId`: `String`; `requestId`: `String`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: `$Array`\<`String`\>; `text`: `optionalKey`\<`String`\>; \}\>\>; \}\> | `AnswerInput` | Decode the answer submission without any caller-supplied actor. |
|
|
527
|
+
| `commands.answerAgent.output` | `Struct`\<\{ `result`: `Union`\<readonly \[`Union`\<readonly \[`Struct`\<\{ `result`: ...; `via`: ...; `commandId`: ...; \}\>, `Struct`\<\{ `result`: ...; `status`: ...; \}\>, `Struct`\<\{ `result`: ...; \}\>\]\>, `Struct`\<\{ `result`: `Literal`\<`"refused"`\>; `reason`: `Literal`\<`"not_sender"`\>; \}\>\]\>; `answeredBy`: `Struct`\<\{ `kind`: `Literal`\<`"agent"`\>; `agentId`: `String`; \}\>; \}\> | - | Attribute the accepted answer to its authenticated Agent. |
|
|
528
|
+
| `commands.escalateAgent` | `object` | - | Pass the Ask on from the Agent it waits on; never a human action. |
|
|
529
|
+
| `commands.escalateAgent.scope` | `"session"` | `"session"` | The child Session owns the Ask; caller authority is host context. |
|
|
530
|
+
| `commands.escalateAgent.input` | `Struct`\<\{ `askId`: `String`; `note`: `optional`\<`String`\>; \}\> | `EscalateInput` | Decode the escalation without any caller-supplied recipient. |
|
|
531
|
+
| `commands.escalateAgent.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"escalated"`\>; `to`: `Literal`\<`"agent"`\>; `waitingOn`: `Struct`\<\{ `agentId`: `NonEmptyString`; `sessionId`: `NonEmptyString`; `name`: `NonEmptyString`; \}\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"escalated"`\>; `to`: `Literal`\<`"person"`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"closed"`\>; `status`: `Literals`\<readonly \[`"answered"`, `"declined"`, `"withdrawn"`, `"expired"`, `"cancelled"`, `"undeliverable"`\]\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"not_found"`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"refused"`\>; `reason`: `Literal`\<`"not_sender"`\>; \}\>\]\> | `EscalateResult` | Where the Ask waits now, or why it did not move. |
|
|
532
|
+
| `commands.decline` | `object` | - | Decline an ask with an optional note. |
|
|
533
|
+
| `commands.decline.scope` | `"session"` | `"session"` | The Session owns this ask. |
|
|
534
|
+
| `commands.decline.input` | `Struct`\<\{ `askId`: `String`; `requestId`: `String`; `note`: `optionalKey`\<`String`\>; \}\> | `DeclineInput` | Decode the decline submission. |
|
|
535
|
+
| `commands.decline.output` | `Union`\<readonly \[`Struct`\<\{ `result`: `Literal`\<`"accepted"`\>; `via`: `Literals`\<readonly \[`"in_turn"`, `"follow_up"`\]\>; `commandId`: `optionalKey`\<`String`\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"closed"`\>; `status`: `Literals`\<readonly \[`"answered"`, `"declined"`, `"withdrawn"`, `"expired"`, `"cancelled"`, `"undeliverable"`\]\>; \}\>, `Struct`\<\{ `result`: `Literal`\<`"not_found"`\>; \}\>\]\> | `HumanResult` | Return admission or the ask's terminal state. |
|
|
536
|
+
| `commands.list` | `object` | - | Read the Session's open asks. |
|
|
537
|
+
| `commands.list.scope` | `"session"` | `"session"` | The Session owns the ask collection. |
|
|
538
|
+
| `commands.list.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
|
|
539
|
+
| `commands.list.output` | `Struct`\<\{ `asks`: `$Array`\<`Struct`\<\{ `askId`: `String`; `waitingOn`: `optionalKey`\<`Struct`\<\{ `agentId`: ...; `sessionId`: ...; `name`: ...; \}\>\>; `escalated`: `optionalKey`\<`Struct`\<\{ `by`: ...; `reason`: ...; `note`: ...; \}\>\>; `questions`: `$Array`\<`Struct`\<\{ `id`: ...; `header`: ...; `question`: ...; `options`: ...; `multiple`: ...; \}\>\>; `status`: `Literals`\<readonly \[`"live"`, `"parked"`\]\>; `createdAt`: `Number`; `expiresAt`: `NullOr`\<`Number`\>; \}\>\>; \}\> | `AskProjection` | Decode the currently visible asks. |
|
|
540
|
+
| <a id="property-projection"></a> `projection` | `object` | - | Open asks visible to Session clients. |
|
|
541
|
+
| `projection.schema` | `Struct`\<\{ `asks`: `$Array`\<`Struct`\<\{ `askId`: `String`; `waitingOn`: `optionalKey`\<`Struct`\<\{ `agentId`: `NonEmptyString`; `sessionId`: `NonEmptyString`; `name`: `NonEmptyString`; \}\>\>; `escalated`: `optionalKey`\<`Struct`\<\{ `by`: `Struct`\<...\>; `reason`: `Literals`\<...\>; `note`: `optionalKey`\<...\>; \}\>\>; `questions`: `$Array`\<`Struct`\<\{ `id`: `String`; `header`: `String`; `question`: `String`; `options`: `$Array`\<...\>; `multiple`: `optionalKey`\<...\>; \}\>\>; `status`: `Literals`\<readonly \[`"live"`, `"parked"`\]\>; `createdAt`: `Number`; `expiresAt`: `NullOr`\<`Number`\>; \}\>\>; \}\> | `AskProjection` | Decoder for projected asks. |
|
|
@@ -50,6 +50,16 @@ The most Agents one conversation's footer lists; the rest are counted.
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
+
### maximumCountedSubagents
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
const maximumCountedSubagents: 256 = 256;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Private status-read ceiling; children past it are explicitly not read.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
53
63
|
### SubagentState
|
|
54
64
|
|
|
55
65
|
```ts
|
|
@@ -82,6 +92,10 @@ const Subagent: Struct<{
|
|
|
82
92
|
state: Literals<readonly ["working", "waiting_on_agent", "needs_you", "idle", "failed", "unavailable"]>;
|
|
83
93
|
attention: optionalKey<String>;
|
|
84
94
|
waitingOn: optionalKey<String>;
|
|
95
|
+
escalated: optionalKey<Struct<{
|
|
96
|
+
by: String;
|
|
97
|
+
reason: Literals<readonly ["escalated", "sender_archived", "sender_absent"]>;
|
|
98
|
+
}>>;
|
|
85
99
|
ask: optionalKey<Struct<{
|
|
86
100
|
askId: String;
|
|
87
101
|
questions: $Array<Struct<{
|
|
@@ -114,6 +128,10 @@ const SubagentsProjection: Struct<{
|
|
|
114
128
|
state: Literals<readonly ["working", "waiting_on_agent", "needs_you", "idle", "failed", "unavailable"]>;
|
|
115
129
|
attention: optionalKey<String>;
|
|
116
130
|
waitingOn: optionalKey<String>;
|
|
131
|
+
escalated: optionalKey<Struct<{
|
|
132
|
+
by: String;
|
|
133
|
+
reason: Literals<readonly ["escalated", "sender_archived", "sender_absent"]>;
|
|
134
|
+
}>>;
|
|
117
135
|
ask: optionalKey<Struct<{
|
|
118
136
|
askId: String;
|
|
119
137
|
questions: $Array<Struct<{
|
|
@@ -126,6 +144,25 @@ const SubagentsProjection: Struct<{
|
|
|
126
144
|
}>>;
|
|
127
145
|
}>>;
|
|
128
146
|
more: Int;
|
|
147
|
+
uncounted: Int;
|
|
148
|
+
counts: Struct<{
|
|
149
|
+
working: Int;
|
|
150
|
+
waiting_on_agent: Int;
|
|
151
|
+
needs_you: Int;
|
|
152
|
+
idle: Int;
|
|
153
|
+
failed: Int;
|
|
154
|
+
unavailable: Int;
|
|
155
|
+
}>;
|
|
156
|
+
escalated: Int;
|
|
157
|
+
waitingOn: $Array<Struct<{
|
|
158
|
+
name: String;
|
|
159
|
+
count: Int;
|
|
160
|
+
}>>;
|
|
161
|
+
escalatedBy: $Array<Struct<{
|
|
162
|
+
name: String;
|
|
163
|
+
reason: Literals<readonly ["escalated", "sender_archived", "sender_absent"]>;
|
|
164
|
+
count: Int;
|
|
165
|
+
}>>;
|
|
129
166
|
expanded: Boolean;
|
|
130
167
|
}>;
|
|
131
168
|
```
|
|
@@ -188,17 +225,17 @@ Created-Agent footer control and its visible projection.
|
|
|
188
225
|
|
|
189
226
|
#### Type Declaration
|
|
190
227
|
|
|
191
|
-
| Name | Type
|
|
192
|
-
| --------------------------------------------- |
|
|
193
|
-
| <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\>
|
|
194
|
-
| <a id="property-commands"></a> `commands` | `object`
|
|
195
|
-
| `commands.agents` | `object`
|
|
196
|
-
| `commands.agents.scope` | `"session"`
|
|
197
|
-
| `commands.agents.input` | `Struct`\<\{ \}\>
|
|
198
|
-
| `commands.agents.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\>
|
|
199
|
-
| `commands.answerChild` | `object`
|
|
200
|
-
| `commands.answerChild.scope` | `"session"`
|
|
201
|
-
| `commands.answerChild.input` | `Union`\<`Struct`\< \| \{ `askId`: `String`; `requestId`: `String`; `index`: `Number`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: ...; `text`: ...; \}\>\>; `stage`: `Literal`\<`"decision"`\>; `answer`: `Struct`\<\{ `selected`: `$Array`\<...\>; `text`: `optionalKey`\<...\>; \}\>; `agentId`: `String`; `sessionId`: `String`; \} \| \{ `askId`: `String`; `agentId`: `String`; `sessionId`: `String`; \} \| \{ `agentId`: `String`; `sessionId`: `String`; \}\>[]\>
|
|
202
|
-
| `commands.answerChild.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\>
|
|
203
|
-
| <a id="property-projection"></a> `projection` | `object`
|
|
204
|
-
| `projection.schema` | `Struct`\<\{ `agents`: `$Array`\<`Struct`\<\{ `agentId`: `String`; `name`: `String`; `sessionId`: `NullOr`\<`String`\>; `state`: `Literals`\<readonly \[`"working"`, `"waiting_on_agent"`, `"needs_you"`, `"idle"`, `"failed"`, `"unavailable"`\]\>; `attention`: `optionalKey`\<`String`\>; `waitingOn`: `optionalKey`\<`String`\>; `ask`: `optionalKey`\<`Struct`\<\{ `askId`: `String`; `questions`: `$Array`\<...\>; \}\>\>; \}\>\>; `more`: `Int`; `expanded`: `Boolean`; \}\>
|
|
228
|
+
| Name | Type | Default value | Description |
|
|
229
|
+
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ---------------------------------------------------------------------- |
|
|
230
|
+
| <a id="property-id"></a> `id` | `string` & `Brand`\<`"ExtensionId"`\> | - | Stable extension identity. |
|
|
231
|
+
| <a id="property-commands"></a> `commands` | `object` | - | Human footer controls. |
|
|
232
|
+
| `commands.agents` | `object` | - | Toggle the created-Agent footer between expanded and summarized views. |
|
|
233
|
+
| `commands.agents.scope` | `"session"` | `"session"` | The Session owns its footer view. |
|
|
234
|
+
| `commands.agents.input` | `Struct`\<\{ \}\> | - | No additional arguments are required. |
|
|
235
|
+
| `commands.agents.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the server-owned human control step. |
|
|
236
|
+
| `commands.answerChild` | `object` | - | Answer a question an escalated sub-agent asks, from this conversation. |
|
|
237
|
+
| `commands.answerChild.scope` | `"session"` | `"session"` | The Session owns its footer. |
|
|
238
|
+
| `commands.answerChild.input` | `Union`\<`Struct`\< \| \{ `askId`: `String`; `requestId`: `String`; `index`: `Number`; `answers`: `$Record`\<`String`, `Struct`\<\{ `selected`: ...; `text`: ...; \}\>\>; `stage`: `Literal`\<`"decision"`\>; `answer`: `Struct`\<\{ `selected`: `$Array`\<...\>; `text`: `optionalKey`\<...\>; \}\>; `agentId`: `String`; `sessionId`: `String`; \} \| \{ `askId`: `String`; `agentId`: `String`; `sessionId`: `String`; \} \| \{ `agentId`: `String`; `sessionId`: `String`; \}\>[]\> | `AnswerChildInput` | The next step of the child's answer conversation. |
|
|
239
|
+
| `commands.answerChild.output` | `declare`\<`WhistleCatalogStepV1`, `WhistleCatalogStepV1`\> | `CatalogStep` | Return the next human conversation step. |
|
|
240
|
+
| <a id="property-projection"></a> `projection` | `object` | - | Footer rows and expansion state. |
|
|
241
|
+
| `projection.schema` | `Struct`\<\{ `agents`: `$Array`\<`Struct`\<\{ `agentId`: `String`; `name`: `String`; `sessionId`: `NullOr`\<`String`\>; `state`: `Literals`\<readonly \[`"working"`, `"waiting_on_agent"`, `"needs_you"`, `"idle"`, `"failed"`, `"unavailable"`\]\>; `attention`: `optionalKey`\<`String`\>; `waitingOn`: `optionalKey`\<`String`\>; `escalated`: `optionalKey`\<`Struct`\<\{ `by`: `String`; `reason`: `Literals`\<...\>; \}\>\>; `ask`: `optionalKey`\<`Struct`\<\{ `askId`: `String`; `questions`: `$Array`\<...\>; \}\>\>; \}\>\>; `more`: `Int`; `uncounted`: `Int`; `counts`: `Struct`\<\{ `working`: `Int`; `waiting_on_agent`: `Int`; `needs_you`: `Int`; `idle`: `Int`; `failed`: `Int`; `unavailable`: `Int`; \}\>; `escalated`: `Int`; `waitingOn`: `$Array`\<`Struct`\<\{ `name`: `String`; `count`: `Int`; \}\>\>; `escalatedBy`: `$Array`\<`Struct`\<\{ `name`: `String`; `reason`: `Literals`\<readonly \[`"escalated"`, `"sender_archived"`, `"sender_absent"`\]\>; `count`: `Int`; \}\>\>; `expanded`: `Boolean`; \}\> | `SubagentsProjection` | Decoder for the projected footer. |
|
|
@@ -65,10 +65,10 @@ type SubagentSource = Readonly<{
|
|
|
65
65
|
}>;
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
The host's read-only facts. `read` returns ordinary created Agents,
|
|
69
|
-
`limit
|
|
70
|
-
Agent access (an `AgentControlDirectory`'s `open` fits), and
|
|
71
|
-
stops the Agent's work.
|
|
68
|
+
The host's read-only facts. `read` returns ordinary created Agents, up to
|
|
69
|
+
`limit` plus a count of those not read; `open` is the host's existing
|
|
70
|
+
per-operation Agent access (an `AgentControlDirectory`'s `open` fits), and
|
|
71
|
+
releasing it never stops the Agent's work.
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fungi.computer/shiitake-extensions",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"author": "Levi <levi@technomancy.dev>",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Botanical's product Shiitake extensions: goal, loop and Almanac on the generic extension surface",
|
|
@@ -116,14 +116,14 @@
|
|
|
116
116
|
"dependencies": {
|
|
117
117
|
"@fungi.computer/almanac": "0.2.1",
|
|
118
118
|
"@fungi.computer/cairn": "0.1.0",
|
|
119
|
-
"@fungi.computer/knapsack": "0.4.
|
|
120
|
-
"@fungi.computer/mycelium": "0.3.
|
|
121
|
-
"@fungi.computer/shiitake": "0.
|
|
122
|
-
"@fungi.computer/watchdog": "0.1.
|
|
119
|
+
"@fungi.computer/knapsack": "0.4.6",
|
|
120
|
+
"@fungi.computer/mycelium": "0.3.5",
|
|
121
|
+
"@fungi.computer/shiitake": "0.12.0",
|
|
122
|
+
"@fungi.computer/watchdog": "0.1.1",
|
|
123
123
|
"@fungi.computer/whistle": "0.3.0",
|
|
124
124
|
"effect": "4.0.2",
|
|
125
125
|
"zod": "4.4.3",
|
|
126
|
-
"@fungi.computer/gills": "0.2.
|
|
126
|
+
"@fungi.computer/gills": "0.2.2"
|
|
127
127
|
},
|
|
128
128
|
"license": "MIT",
|
|
129
129
|
"repository": {
|