dsh-capability-panel 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -11112,11 +11112,16 @@ function apply(ctx) {
11112
11112
  * whether to send is the user's call (Enter). A non-empty draft is
11113
11113
  * appended to, never replaced. Works for disabled skills too: the
11114
11114
  * disable shadow keeps userInvocable: true by design.
11115
+ *
11116
+ * The draft comes from the live input-state selector: the old
11117
+ * `props.input` snapshot is gone in newer hosts, and reading a stale
11118
+ * snapshot would REPLACE the user's draft instead of appending.
11115
11119
  */
11120
+ const composerDraft = props.useInput === void 0 ? props.input?.draft ?? "" : props.useInput((state) => state.draft);
11116
11121
  const insertCommand = (name) => {
11117
11122
  const actions = props.inputActions;
11118
11123
  if (actions === void 0) return;
11119
- const draft = props.input?.draft ?? "";
11124
+ const draft = composerDraft;
11120
11125
  actions.setDraft(draft.trim() === "" ? `/${name} ` : `${draft} /${name} `);
11121
11126
  close();
11122
11127
  };