| 801 | } |
| 802 | |
| 803 | function detectSlashCommand(parts: ReturnType<typeof promptContentToParts>) { |
| 804 | const text = parts |
| 805 | .filter((part): part is Extract<(typeof parts)[number], { type: "text" }> => part.type === "text") |
| 806 | .map((part) => part.text) |
| 807 | .join("") |
| 808 | .trim() |
| 809 | if (!text.startsWith("/")) return |
| 810 | |
| 811 | const [name, ...rest] = text.slice(1).split(/\s+/) |
| 812 | if (!name) return |
| 813 | return { name, args: rest.join(" ").trim() } |
| 814 | } |
| 815 | |
| 816 | const promptResponse = Effect.fn("ACP.promptResponse")(function* ( |
| 817 | info: AssistantInfo, |