MCPcopy Create free account
hub / github.com/anomalyco/opencode / showSubagent

Function showSubagent

packages/opencode/src/cli/cmd/run/demo.ts:176–216  ·  view source on GitHub ↗
(
  state: State,
  input: {
    sessionID: string
    partID: string
    callID: string
    label: string
    description: string
    status: "running" | "completed" | "cancelled" | "error"
    title?: string
    toolCalls?: number
    commits: StreamCommit[]
  },
)

Source from the content-addressed store, hash-verified

174}
175
176function showSubagent(
177 state: State,
178 input: {
179 sessionID: string
180 partID: string
181 callID: string
182 label: string
183 description: string
184 status: "running" | "completed" | "cancelled" | "error"
185 title?: string
186 toolCalls?: number
187 commits: StreamCommit[]
188 },
189) {
190 state.footer.event({
191 type: "stream.subagent",
192 state: {
193 tabs: [
194 {
195 sessionID: input.sessionID,
196 partID: input.partID,
197 callID: input.callID,
198 label: input.label,
199 description: input.description,
200 status: input.status,
201 title: input.title,
202 toolCalls: input.toolCalls,
203 lastUpdatedAt: Date.now(),
204 },
205 ],
206 details: {
207 [input.sessionID]: {
208 sessionID: input.sessionID,
209 commits: input.commits,
210 },
211 },
212 permissions: [],
213 questions: [],
214 },
215 })
216}
217
218function wait(ms: number, signal?: AbortSignal): Promise<void> {
219 return new Promise((resolve) => {

Callers 1

emitTaskFunction · 0.85

Calls 1

eventMethod · 0.45

Tested by

no test coverage detected