Skip to content
API reference

subagents/contract

Import
import * as api from "@fungi.computer/shiitake-extensions/subagents";
Kind Export Description
type alias SubagentState Display state of one created Agent’s conversation.
type alias Subagent Decoded footer row for a created Agent.
type alias SubagentsProjection Decoded list and expansion state projected into the footer.
constant maximumSubagents The most Agents one conversation’s footer lists; the rest are counted.
constant SubagentState What the human sees for one ordinary created Agent. waiting_on_agent is an open question that waits on the Agent that sent the work, calm until it is escalated; needs_you is attention that waits on a person; unavailable means its status could not be read, and is never shown as idle.
constant Subagent A footer row for an ordinary Agent created by this Agent, never merely sent work.
constant SubagentsProjection This Agent’s created Agents and how many are not listed. expanded is whether the footer lists each one; a person toggles it with /agents, and a collapsed footer keeps one summary row.
constant AnswerChildInput The question flow’s own steps, each naming the child whose Ask they answer. The footer owns the conversation; the child’s question owner commits it.
constant subagentsContract Created-Agent footer control and its visible projection.

SubagentStatetype alias

Section titled “SubagentState”
Signature
type SubagentState = typeof SubagentState.Type;

Display state of one created Agent’s conversation.


Signature
type Subagent = typeof Subagent.Type;

Decoded footer row for a created Agent.


SubagentsProjectiontype alias

Section titled “SubagentsProjection”
Signature
type SubagentsProjection = typeof SubagentsProjection.Type;

Decoded list and expansion state projected into the footer.

maximumSubagentsconstant

Section titled “maximumSubagents”
Signature
const maximumSubagents: 16 = 16;

The most Agents one conversation’s footer lists; the rest are counted.


SubagentStateconstant

Section titled “SubagentState”
Signature
const SubagentState: Literals<
readonly [
"working",
"waiting_on_agent",
"needs_you",
"idle",
"failed",
"unavailable",
]
>;

What the human sees for one ordinary created Agent. waiting_on_agent is an open question that waits on the Agent that sent the work, calm until it is escalated; needs_you is attention that waits on a person; unavailable means its status could not be read, and is never shown as idle.


Subagentconstant

Section titled “Subagent”
Signature
const Subagent: 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<Struct<{
id: String;
header: String;
question: String;
options: $Array<Struct<{
label: ...;
description: ...;
}>>;
multiple: optionalKey<Boolean>;
}>>;
}>>;
}>;

A footer row for an ordinary Agent created by this Agent, never merely sent work.


SubagentsProjectionconstant

Section titled “SubagentsProjection”
Signature
const SubagentsProjection: 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<Struct<{
id: ...;
header: ...;
question: ...;
options: ...;
multiple: ...;
}>>;
}>>;
}>>;
more: Int;
expanded: Boolean;
}>;

This Agent’s created Agents and how many are not listed. expanded is whether the footer lists each one; a person toggles it with /agents, and a collapsed footer keeps one summary row.


AnswerChildInputconstant

Section titled “AnswerChildInput”
Signature
const AnswerChildInput: Union<
Struct<
| {
askId: String;
requestId: String;
index: Number;
answers: $Record<
String,
Struct<{
selected: $Array<String>;
text: optionalKey<String>;
}>
>;
stage: Literal<"decision">;
answer: Struct<{
selected: $Array<String>;
text: optionalKey<String>;
}>;
agentId: String;
sessionId: String;
}
| {
askId: String;
agentId: String;
sessionId: String;
}
| {
agentId: String;
sessionId: String;
}
>[]
>;

The question flow’s own steps, each naming the child whose Ask they answer. The footer owns the conversation; the child’s question owner commits it.


subagentsContractconstant

Section titled “subagentsContract”
Signature
const subagentsContract: object;

Created-Agent footer control and its visible projection.

Name Type Default value Description
id string & Brand<"ExtensionId"> - Stable extension identity.
commands object - Human footer controls.
commands.agents object - Toggle the created-Agent footer between expanded and summarized views.
commands.agents.scope "session" "session" The Session owns its footer view.
commands.agents.input Struct<{ }> - No additional arguments are required.
commands.agents.output declare<WhistleCatalogStepV1, WhistleCatalogStepV1> CatalogStep Return the server-owned human control step.
commands.answerChild object - Answer a question an escalated sub-agent asks, from this conversation.
commands.answerChild.scope "session" "session" The Session owns its footer.
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.
commands.answerChild.output declare<WhistleCatalogStepV1, WhistleCatalogStepV1> CatalogStep Return the next human conversation step.
projection object - Footer rows and expansion state.
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; }> SubagentsProjection Decoder for the projected footer.