{"version":"2.1.275","anchor":"plugin-originated-slash-actions-now-include-promptfill-and","canonical_anchor":"new-plugin-hook-api-promptread","heading":"Slash commands and plugins can now append or insert into the input box, not just replace it","tier":"use","area":"Plugins","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.275\/e\/plugin-originated-slash-actions-now-include-promptfill-and","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.275","markdown":"### Slash commands and plugins can now append or insert into the input box, not just replace it\n\nPlugins and hooks can fill the prompt input box in replace, append, or insert mode, with new APIs to read and stamp these actions\n\n**What**\n\nThe internal system plugins and hooks use to put text into your input box (the \"draft\") has been extended.\n\n- The `fillDraft` API, used by plugins and hooks to populate the input box, now takes a mode: `replace` (the old default, replaces everything), `append` (adds text to the end of what's already there), or `insert` (inserts text at your cursor position).\n\n- A companion `readDraft` API (also exposed as the hook method `$.prompt.read`) lets a plugin read the current input box text and cursor position before deciding what to do.\n\n- Slash-command-triggered plugin actions of type `prompt.fill` (defaulting to `replace` mode) and `prompt.suggest` now get the same default plugin-origin metadata that `command.run` actions already had.\n\n- A new settings layer called `memory` was added alongside the existing managed\/user\/project\/local layers, and the replace\/append\/insert modes are validated against an explicit list, with an error shown for invalid modes.\n\n**Why**\n\nThis gives plugins finer control over how they interact with whatever you're already typing, instead of always overwriting it. A plugin can now add a suggestion after your text or insert something right where your cursor is, and it can check what's already in the box first.\n\n- Area: Plugins\n- Names: `prompt.fill`, `prompt.suggest`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5"}