返回 CodeWhale
commands.mjs
1 // Second entry of a two-entry plugin: a command and a second tool, under the
2 // same owner as the first entry's tool.
3 export const name = 'two-entries-commands'
4 export const inject = ['tools', 'commands']
5
6 export function apply(ctx) {
7 ctx.tools.register({
8 name: 'two_second',
9 description: 'A tool from the second entry.',
10 parameters: { type: 'object', properties: {} },
11 execute: () => 'second',
12 })
13 ctx.commands.register({
14 name: 'two-hello',
15 description: 'A command from the second entry.',
16 handler: () => ({ kind: 'success', text: 'hello from the second entry' }),
17 })
18 }
19
19 lines Plain Text