|
@@ -28,6 +28,7 @@ import { useExit } from "../../context/exit"
|
|
|
import { Clipboard } from "../../util/clipboard"
|
|
import { Clipboard } from "../../util/clipboard"
|
|
|
import type { FilePart } from "@opencode-ai/sdk"
|
|
import type { FilePart } from "@opencode-ai/sdk"
|
|
|
import { TuiEvent } from "../../event"
|
|
import { TuiEvent } from "../../event"
|
|
|
|
|
+import { iife } from "@/util/iife"
|
|
|
|
|
|
|
|
export type PromptProps = {
|
|
export type PromptProps = {
|
|
|
sessionID?: string
|
|
sessionID?: string
|
|
@@ -363,8 +364,15 @@ export function Prompt(props: PromptProps) {
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
setStore("mode", "normal")
|
|
setStore("mode", "normal")
|
|
|
- } else if (inputText.startsWith("/")) {
|
|
|
|
|
- const [command, ...args] = inputText.split(" ")
|
|
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ inputText.startsWith("/") &&
|
|
|
|
|
+ iife(() => {
|
|
|
|
|
+ const command = inputText.split(" ")[0].slice(1)
|
|
|
|
|
+ console.log(command)
|
|
|
|
|
+ return sync.data.command.some((x) => x.name === command)
|
|
|
|
|
+ })
|
|
|
|
|
+ ) {
|
|
|
|
|
+ let [command, ...args] = inputText.split(" ")
|
|
|
sdk.client.session.command({
|
|
sdk.client.session.command({
|
|
|
path: {
|
|
path: {
|
|
|
id: sessionID,
|
|
id: sessionID,
|