GeezerVison is showing github.com — fix: display MCP tag for prompts in autocomplete but not in prompt (#… · fsinbad/opencode@5249f04
File treeExpand file treeCollapse file tree Open diff view settings cli/cmd/tui/component/prompt
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -259,7 +259,7 @@ export function Autocomplete(props: { | 259 | 259 | const s = session() | 260 | 260 | for (const command of sync.data.command) { | 261 | 261 | results.push({ | 262 | | - display: "/" + command.name, | | 262 | + display: "/" + command.name + (command.mcp ? " (MCP)" : ""), | 263 | 263 | description: command.description, | 264 | 264 | onSelect: () => { | 265 | 265 | const newText = "/" + command.name + " " | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/command/index.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,6 +27,7 @@ export namespace Command { | 27 | 27 | description: z.string().optional(), | 28 | 28 | agent: z.string().optional(), | 29 | 29 | model: z.string().optional(), | | 30 | + mcp: z.boolean().optional(), | 30 | 31 | // workaround for zod not supporting async functions natively so we use getters | 31 | 32 | // https://zod.dev/v4/changelog?id=zfunction | 32 | 33 | template: z.promise(z.string()).or(z.string()), | @@ -94,6 +95,7 @@ export namespace Command { | 94 | 95 | for (const [name, prompt] of Object.entries(await MCP.prompts())) { | 95 | 96 | result[name] = { | 96 | 97 | name, | | 98 | + mcp: true, | 97 | 99 | description: prompt.description, | 98 | 100 | get template() { | 99 | 101 | // since a getter can't be async we need to manually return a promise here | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/mcp/index.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -195,7 +195,7 @@ export namespace MCP { | 195 | 195 | for (const prompt of prompts.prompts) { | 196 | 196 | const sanitizedClientName = clientName.replace(/[^a-zA-Z0-9_-]/g, "_") | 197 | 197 | const sanitizedPromptName = prompt.name.replace(/[^a-zA-Z0-9_-]/g, "_") | 198 | | - const key = sanitizedClientName + ":" + sanitizedPromptName + " (MCP)" | | 198 | + const key = sanitizedClientName + ":" + sanitizedPromptName | 199 | 199 |
| 200 | 200 | commands[key] = { ...prompt, client: clientName } | 201 | 201 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/sdk/js/src/v2/gen/types.gen.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1733,6 +1733,7 @@ export type Command = { | 1733 | 1733 | description?: string | 1734 | 1734 | agent?: string | 1735 | 1735 | model?: string | | 1736 | + mcp?: boolean | 1736 | 1737 | template: string | 1737 | 1738 | subtask?: boolean | 1738 | 1739 | hints: Array<string> | |
Collapse file Copy file name to clipboardExpand all lines: packages/sdk/openapi.json +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8982 | 8982 | "model": { | 8983 | 8983 | "type": "string" | 8984 | 8984 | }, | | 8985 | + "mcp": { | | 8986 | + "type": "boolean" | | 8987 | + }, | 8985 | 8988 | "template": { | 8986 | 8989 | "anyOf": [ | 8987 | 8990 | { | |
|