spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / tests / fixtures / subjects-echoed.ts
22 lines · 582 BRaw
1import type { On } from 'claude-code'
2
3/**
4 * Answers the four subject events beneath every plugin as the engine's
5 * core would.
6 *
7 * The description and hidden flag the chain left, the agent offered, the
8 * spawn on the model `core`.
9 *
10 * @param on the test's `on`
11 */
12export function subjectsEchoed(on: On) {
13 on('tool.describe', ($, e) => ({ description: e.description }))
14
15 on('command.describe', ($, e) => ({
16 description: e.description,
17 isHidden: e.isHidden,
18 }))
19
20 on('agent.offer', () => ({ isOffered: true }))
21 on('agent.spawn', () => ({ model: 'core' }))
22}