( tools: Tools, getToolPermissionContext: () => Promise<ToolPermissionContext>, agentInfo: AgentDefinitionsResult | null, )
| 520 | } |
| 521 | |
| 522 | async function countSlashCommandTokens( |
| 523 | tools: Tools, |
| 524 | getToolPermissionContext: () => Promise<ToolPermissionContext>, |
| 525 | agentInfo: AgentDefinitionsResult | null, |
| 526 | ): Promise<{ |
| 527 | slashCommandTokens: number |
| 528 | commandInfo: { totalCommands: number; includedCommands: number } |
| 529 | }> { |
| 530 | const info = await getSlashCommandInfo(getCwd()) |
| 531 | |
| 532 | const slashCommandTool = findSkillTool(tools) |
| 533 | if (!slashCommandTool) { |
| 534 | return { |
| 535 | slashCommandTokens: 0, |
| 536 | commandInfo: { totalCommands: 0, includedCommands: 0 }, |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | const slashCommandTokens = await countToolDefinitionTokens( |
| 541 | [slashCommandTool], |
| 542 | getToolPermissionContext, |
| 543 | agentInfo, |
| 544 | ) |
| 545 | |
| 546 | return { |
| 547 | slashCommandTokens, |
| 548 | commandInfo: { |
| 549 | totalCommands: info.totalCommands, |
| 550 | includedCommands: info.includedCommands, |
| 551 | }, |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | async function countSkillTokens( |
| 556 | tools: Tools, |
no test coverage detected