chore: format code

This commit is contained in:
GitHub Action
2025-11-08 01:59:02 +00:00
parent 16357e8041
commit 34ff87d504
182 changed files with 940 additions and 3646 deletions

View File

@@ -14,10 +14,7 @@ export const TaskTool = Tool.define("task", async () => {
const description = DESCRIPTION.replace(
"{agents}",
agents
.map(
(a) =>
`- ${a.name}: ${a.description ?? "This subagent should only be called manually by the user."}`,
)
.map((a) => `- ${a.name}: ${a.description ?? "This subagent should only be called manually by the user."}`)
.join("\n"),
)
return {
@@ -29,8 +26,7 @@ export const TaskTool = Tool.define("task", async () => {
}),
async execute(params, ctx) {
const agent = await Agent.get(params.subagent_type)
if (!agent)
throw new Error(`Unknown agent type: ${params.subagent_type} is not a valid agent type`)
if (!agent) throw new Error(`Unknown agent type: ${params.subagent_type} is not a valid agent type`)
const session = await Session.create({
parentID: ctx.sessionID,
title: params.description + ` (@${agent.name} subagent)`,
@@ -95,9 +91,7 @@ export const TaskTool = Tool.define("task", async () => {
let all
all = await Session.messages({ sessionID: session.id })
all = all.filter((x) => x.info.role === "assistant")
all = all.flatMap(
(msg) => msg.parts.filter((x: any) => x.type === "tool") as MessageV2.ToolPart[],
)
all = all.flatMap((msg) => msg.parts.filter((x: any) => x.type === "tool") as MessageV2.ToolPart[])
return {
title: params.description,
metadata: {