| 1 | export const inject = ['tools', 'commands', 'prompt', 'skills', 'storage'] |
| 2 | export function apply(ctx, config) { |
| 3 | ctx.prompt.registerSection({ id: 'composition-note', text: config.text }) |
| 4 | ctx.skills.registerRoot({ path: 'source/skills' }) |
| 5 | ctx.commands.register({ name: 'composition-echo', description: 'Show the composed text.', handler: () => ({ kind: 'success', text: config.text }) }) |
| 6 | ctx.tools.register({ |
| 7 | name: 'composition_echo', description: 'Echo composed text through the existing approval gate.', |
| 8 | parameters: { type: 'object', properties: {}, additionalProperties: false }, |
| 9 | execute: async () => ({ text: config.text, count: (await ctx.storage.get('composition-example-count')) ?? null }), |
| 10 | }) |
| 11 | } |
| 12 |