Download apps/vis/server/src/routes/subagents.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 601 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/server/src/routes/subagents.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/apps/vis/server/src/routes/subagents.ts
-
curl -L -o subagents.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/apps/vis/server/src/routes/subagents.ts
601 Bytes
| import { Hono } from 'hono'; | |
| import { KIMI_CODE_HOME } from '../config'; | |
| import { readSessionDetail } from '../lib/session-store'; | |
| import { buildAgentTree } from '../lib/agent-tree'; | |
| export function subagentsRoute(home: string = KIMI_CODE_HOME): Hono { | |
| const r = new Hono(); | |
| r.get('/:id/agents', async (c) => { | |
| const id = c.req.param('id'); | |
| const detail = await readSessionDetail(home, id); | |
| if (!detail) { | |
| return c.json({ error: 'session not found', code: 'NOT_FOUND' }, 404); | |
| } | |
| return c.json({ sessionId: id, tree: buildAgentTree(detail.agents) }); | |
| }); | |
| return r; | |
| } | |