@openeryc/pi-coding-agent 0.75.37 → 0.75.39
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/CHANGELOG.md +11 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/components/mcp-selector.d.ts +23 -0
- package/dist/modes/interactive/components/mcp-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/mcp-selector.js +81 -0
- package/dist/modes/interactive/components/mcp-selector.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +2 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +63 -65
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.75.39] - 2026-05-28
|
|
4
|
+
|
|
5
|
+
## [0.75.38] - 2026-05-28
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `/mcp` now shows interactive selector with arrow-key navigation and Enter to toggle
|
|
9
|
+
- `/skills` command to browse loaded skills
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- MCP server management uses TUI selector instead of static text display
|
|
13
|
+
|
|
3
14
|
## [0.75.37] - 2026-05-28
|
|
4
15
|
|
|
5
16
|
### Fixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CA6BrE,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"goal\", description: \"Set session goal\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"mcp\", description: \"Show MCP server status and tools\" },\n\t{ name: \"skills\", description: \"Browse loaded skills\" },\n\t{ name: \"usage\", description: \"Show token usage and cost across all sessions\" },\n\t{ name: \"memory\", description: \"View or edit project memory (MEMORY.md)\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"cleanup\", description: \"Delete sessions older than retention period\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"update\", description: `Update ${APP_NAME} to the latest version` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
|
|
@@ -11,6 +11,7 @@ export const BUILTIN_SLASH_COMMANDS = [
|
|
|
11
11
|
{ name: "goal", description: "Set session goal" },
|
|
12
12
|
{ name: "session", description: "Show session info and stats" },
|
|
13
13
|
{ name: "mcp", description: "Show MCP server status and tools" },
|
|
14
|
+
{ name: "skills", description: "Browse loaded skills" },
|
|
14
15
|
{ name: "usage", description: "Show token usage and cost across all sessions" },
|
|
15
16
|
{ name: "memory", description: "View or edit project memory (MEMORY.md)" },
|
|
16
17
|
{ name: "changelog", description: "Show changelog entries" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAiBxC,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE;IAClE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,0CAA0C,EAAE;IAClF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;IAC/F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;IAChF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACvE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACrE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE;IACzD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE;IACjD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,kCAAkC,EAAE;IAChE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,+CAA+C,EAAE;IAC/E,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;IAC1E,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,wBAAwB,EAAE;IAC5D,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC/D,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gDAAgD,EAAE;IAC/E,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uDAAuD,EAAE;IACvF,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yCAAyC,EAAE;IACxE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACnE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACjE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6CAA6C,EAAE;IAC/E,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6DAA6D,EAAE;IAC9F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,QAAQ,wBAAwB,EAAE;IAC3E,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;CACjD,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"goal\", description: \"Set session goal\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"mcp\", description: \"Show MCP server status and tools\" },\n\t{ name: \"usage\", description: \"Show token usage and cost across all sessions\" },\n\t{ name: \"memory\", description: \"View or edit project memory (MEMORY.md)\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"cleanup\", description: \"Delete sessions older than retention period\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"update\", description: `Update ${APP_NAME} to the latest version` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAA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,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,yCAAyC,EAAE;IACxE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACnE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACjE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE;IACnD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6CAA6C,EAAE;IAC/E,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6DAA6D,EAAE;IAC9F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,QAAQ,wBAAwB,EAAE;IAC3E,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;CACjD,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"goal\", description: \"Set session goal\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"mcp\", description: \"Show MCP server status and tools\" },\n\t{ name: \"skills\", description: \"Browse loaded skills\" },\n\t{ name: \"usage\", description: \"Show token usage and cost across all sessions\" },\n\t{ name: \"memory\", description: \"View or edit project memory (MEMORY.md)\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"cleanup\", description: \"Delete sessions older than retention period\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"update\", description: `Update ${APP_NAME} to the latest version` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive MCP server selector.
|
|
3
|
+
* Shows configured servers with status, allows toggling.
|
|
4
|
+
*/
|
|
5
|
+
import { Container } from "@openeryc/pi-tui";
|
|
6
|
+
export interface McpServerItem {
|
|
7
|
+
name: string;
|
|
8
|
+
status: "connected" | "disconnected" | "disabled";
|
|
9
|
+
toolCount: number;
|
|
10
|
+
transport: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class McpSelectorComponent extends Container {
|
|
13
|
+
private items;
|
|
14
|
+
private selectedIndex;
|
|
15
|
+
private listContainer;
|
|
16
|
+
private onSelectCallback;
|
|
17
|
+
private onCancelCallback;
|
|
18
|
+
constructor(servers: McpServerItem[], onSelect: (name: string) => void, onCancel: () => void);
|
|
19
|
+
private statusColor;
|
|
20
|
+
private updateList;
|
|
21
|
+
handleInput(keyData: string): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=mcp-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/mcp-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAgC,MAAM,kBAAkB,CAAC;AAK3E,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,GAAG,cAAc,GAAG,UAAU,CAAC;IAClD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,oBAAqB,SAAQ,SAAS;IAClD,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,gBAAgB,CAAa;IAErC,YAAY,OAAO,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,EAgC3F;IAED,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,UAAU;IAclB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAcjC;CACD","sourcesContent":["/**\n * Interactive MCP server selector.\n * Shows configured servers with status, allows toggling.\n */\n\nimport { Container, getKeybindings, Spacer, Text } from \"@openeryc/pi-tui\";\nimport { theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint, rawKeyHint } from \"./keybinding-hints.ts\";\n\nexport interface McpServerItem {\n\tname: string;\n\tstatus: \"connected\" | \"disconnected\" | \"disabled\";\n\ttoolCount: number;\n\ttransport: string;\n}\n\nexport class McpSelectorComponent extends Container {\n\tprivate items: McpServerItem[];\n\tprivate selectedIndex = 0;\n\tprivate listContainer: Container;\n\tprivate onSelectCallback: (name: string) => void;\n\tprivate onCancelCallback: () => void;\n\n\tconstructor(servers: McpServerItem[], onSelect: (name: string) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tthis.items = servers;\n\t\tthis.onSelectCallback = onSelect;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"accent\", theme.bold(\"MCP Servers\")), 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"dim\", \"Enter = toggle | Esc = close\"), 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(\n\t\t\tnew Text(\n\t\t\t\trawKeyHint(\"↑↓\", \"navigate\") +\n\t\t\t\t\t\" \" +\n\t\t\t\t\tkeyHint(\"tui.select.confirm\", \"toggle\") +\n\t\t\t\t\t\" \" +\n\t\t\t\t\tkeyHint(\"tui.select.cancel\", \"close\"),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder());\n\n\t\tthis.updateList();\n\t}\n\n\tprivate statusColor(status: McpServerItem[\"status\"]): string {\n\t\tswitch (status) {\n\t\t\tcase \"connected\":\n\t\t\t\treturn theme.fg(\"success\", \"connected\");\n\t\t\tcase \"disconnected\":\n\t\t\t\treturn theme.fg(\"warning\", \"disconnected\");\n\t\t\tcase \"disabled\":\n\t\t\t\treturn theme.fg(\"muted\", \"disabled\");\n\t\t}\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tfor (let i = 0; i < this.items.length; i++) {\n\t\t\tconst item = this.items[i];\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst status = this.statusColor(item.status);\n\t\t\tconst info = `(${status} | ${item.transport}${item.toolCount > 0 ? ` | ${item.toolCount} tools` : \"\"})`;\n\t\t\tconst text = isSelected\n\t\t\t\t? theme.fg(\"accent\", \"→ \") + theme.fg(\"accent\", theme.bold(item.name)) + \" \" + info\n\t\t\t\t: ` ${theme.fg(\"text\", item.name)} ${theme.fg(\"dim\", info)}`;\n\t\t\tthis.listContainer.addChild(new Text(text, 1, 0));\n\t\t}\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\tif (kb.matches(keyData, \"tui.select.up\") || keyData === \"k\") {\n\t\t\tthis.selectedIndex = Math.max(0, this.selectedIndex - 1);\n\t\t\tthis.updateList();\n\t\t} else if (kb.matches(keyData, \"tui.select.down\") || keyData === \"j\") {\n\t\t\tthis.selectedIndex = Math.min(this.items.length - 1, this.selectedIndex + 1);\n\t\t\tthis.updateList();\n\t\t} else if (kb.matches(keyData, \"tui.select.confirm\") || keyData === \"\\n\") {\n\t\t\tconst selected = this.items[this.selectedIndex];\n\t\t\tif (selected) this.onSelectCallback(selected.name);\n\t\t} else if (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive MCP server selector.
|
|
3
|
+
* Shows configured servers with status, allows toggling.
|
|
4
|
+
*/
|
|
5
|
+
import { Container, getKeybindings, Spacer, Text } from "@openeryc/pi-tui";
|
|
6
|
+
import { theme } from "../theme/theme.js";
|
|
7
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
8
|
+
import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|
9
|
+
export class McpSelectorComponent extends Container {
|
|
10
|
+
items;
|
|
11
|
+
selectedIndex = 0;
|
|
12
|
+
listContainer;
|
|
13
|
+
onSelectCallback;
|
|
14
|
+
onCancelCallback;
|
|
15
|
+
constructor(servers, onSelect, onCancel) {
|
|
16
|
+
super();
|
|
17
|
+
this.items = servers;
|
|
18
|
+
this.onSelectCallback = onSelect;
|
|
19
|
+
this.onCancelCallback = onCancel;
|
|
20
|
+
this.addChild(new DynamicBorder());
|
|
21
|
+
this.addChild(new Spacer(1));
|
|
22
|
+
this.addChild(new Text(theme.fg("accent", theme.bold("MCP Servers")), 1, 0));
|
|
23
|
+
this.addChild(new Spacer(1));
|
|
24
|
+
this.addChild(new Text(theme.fg("dim", "Enter = toggle | Esc = close"), 1, 0));
|
|
25
|
+
this.addChild(new Spacer(1));
|
|
26
|
+
this.listContainer = new Container();
|
|
27
|
+
this.addChild(this.listContainer);
|
|
28
|
+
this.addChild(new Spacer(1));
|
|
29
|
+
this.addChild(new Text(rawKeyHint("↑↓", "navigate") +
|
|
30
|
+
" " +
|
|
31
|
+
keyHint("tui.select.confirm", "toggle") +
|
|
32
|
+
" " +
|
|
33
|
+
keyHint("tui.select.cancel", "close"), 1, 0));
|
|
34
|
+
this.addChild(new Spacer(1));
|
|
35
|
+
this.addChild(new DynamicBorder());
|
|
36
|
+
this.updateList();
|
|
37
|
+
}
|
|
38
|
+
statusColor(status) {
|
|
39
|
+
switch (status) {
|
|
40
|
+
case "connected":
|
|
41
|
+
return theme.fg("success", "connected");
|
|
42
|
+
case "disconnected":
|
|
43
|
+
return theme.fg("warning", "disconnected");
|
|
44
|
+
case "disabled":
|
|
45
|
+
return theme.fg("muted", "disabled");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
updateList() {
|
|
49
|
+
this.listContainer.clear();
|
|
50
|
+
for (let i = 0; i < this.items.length; i++) {
|
|
51
|
+
const item = this.items[i];
|
|
52
|
+
const isSelected = i === this.selectedIndex;
|
|
53
|
+
const status = this.statusColor(item.status);
|
|
54
|
+
const info = `(${status} | ${item.transport}${item.toolCount > 0 ? ` | ${item.toolCount} tools` : ""})`;
|
|
55
|
+
const text = isSelected
|
|
56
|
+
? theme.fg("accent", "→ ") + theme.fg("accent", theme.bold(item.name)) + " " + info
|
|
57
|
+
: ` ${theme.fg("text", item.name)} ${theme.fg("dim", info)}`;
|
|
58
|
+
this.listContainer.addChild(new Text(text, 1, 0));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
handleInput(keyData) {
|
|
62
|
+
const kb = getKeybindings();
|
|
63
|
+
if (kb.matches(keyData, "tui.select.up") || keyData === "k") {
|
|
64
|
+
this.selectedIndex = Math.max(0, this.selectedIndex - 1);
|
|
65
|
+
this.updateList();
|
|
66
|
+
}
|
|
67
|
+
else if (kb.matches(keyData, "tui.select.down") || keyData === "j") {
|
|
68
|
+
this.selectedIndex = Math.min(this.items.length - 1, this.selectedIndex + 1);
|
|
69
|
+
this.updateList();
|
|
70
|
+
}
|
|
71
|
+
else if (kb.matches(keyData, "tui.select.confirm") || keyData === "\n") {
|
|
72
|
+
const selected = this.items[this.selectedIndex];
|
|
73
|
+
if (selected)
|
|
74
|
+
this.onSelectCallback(selected.name);
|
|
75
|
+
}
|
|
76
|
+
else if (kb.matches(keyData, "tui.select.cancel")) {
|
|
77
|
+
this.onCancelCallback();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=mcp-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/mcp-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,E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CAAC,OAAO,EAAE,oBAAoB,CAAC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YAC1E,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAChD,IAAI,QAAQ;gBAAE,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,CAAC;aAAM,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE,CAAC;YACrD,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC;IAAA,CACD;CACD","sourcesContent":["/**\n * Interactive MCP server selector.\n * Shows configured servers with status, allows toggling.\n */\n\nimport { Container, getKeybindings, Spacer, Text } from \"@openeryc/pi-tui\";\nimport { theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint, rawKeyHint } from \"./keybinding-hints.ts\";\n\nexport interface McpServerItem {\n\tname: string;\n\tstatus: \"connected\" | \"disconnected\" | \"disabled\";\n\ttoolCount: number;\n\ttransport: string;\n}\n\nexport class McpSelectorComponent extends Container {\n\tprivate items: McpServerItem[];\n\tprivate selectedIndex = 0;\n\tprivate listContainer: Container;\n\tprivate onSelectCallback: (name: string) => void;\n\tprivate onCancelCallback: () => void;\n\n\tconstructor(servers: McpServerItem[], onSelect: (name: string) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tthis.items = servers;\n\t\tthis.onSelectCallback = onSelect;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"accent\", theme.bold(\"MCP Servers\")), 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new Text(theme.fg(\"dim\", \"Enter = toggle | Esc = close\"), 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(\n\t\t\tnew Text(\n\t\t\t\trawKeyHint(\"↑↓\", \"navigate\") +\n\t\t\t\t\t\" \" +\n\t\t\t\t\tkeyHint(\"tui.select.confirm\", \"toggle\") +\n\t\t\t\t\t\" \" +\n\t\t\t\t\tkeyHint(\"tui.select.cancel\", \"close\"),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder());\n\n\t\tthis.updateList();\n\t}\n\n\tprivate statusColor(status: McpServerItem[\"status\"]): string {\n\t\tswitch (status) {\n\t\t\tcase \"connected\":\n\t\t\t\treturn theme.fg(\"success\", \"connected\");\n\t\t\tcase \"disconnected\":\n\t\t\t\treturn theme.fg(\"warning\", \"disconnected\");\n\t\t\tcase \"disabled\":\n\t\t\t\treturn theme.fg(\"muted\", \"disabled\");\n\t\t}\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tfor (let i = 0; i < this.items.length; i++) {\n\t\t\tconst item = this.items[i];\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst status = this.statusColor(item.status);\n\t\t\tconst info = `(${status} | ${item.transport}${item.toolCount > 0 ? ` | ${item.toolCount} tools` : \"\"})`;\n\t\t\tconst text = isSelected\n\t\t\t\t? theme.fg(\"accent\", \"→ \") + theme.fg(\"accent\", theme.bold(item.name)) + \" \" + info\n\t\t\t\t: ` ${theme.fg(\"text\", item.name)} ${theme.fg(\"dim\", info)}`;\n\t\t\tthis.listContainer.addChild(new Text(text, 1, 0));\n\t\t}\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\tif (kb.matches(keyData, \"tui.select.up\") || keyData === \"k\") {\n\t\t\tthis.selectedIndex = Math.max(0, this.selectedIndex - 1);\n\t\t\tthis.updateList();\n\t\t} else if (kb.matches(keyData, \"tui.select.down\") || keyData === \"j\") {\n\t\t\tthis.selectedIndex = Math.min(this.items.length - 1, this.selectedIndex + 1);\n\t\t\tthis.updateList();\n\t\t} else if (kb.matches(keyData, \"tui.select.confirm\") || keyData === \"\\n\") {\n\t\t\tconst selected = this.items[this.selectedIndex];\n\t\t\tif (selected) this.onSelectCallback(selected.name);\n\t\t} else if (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -348,8 +348,8 @@ export declare class InteractiveMode {
|
|
|
348
348
|
private handleNameCommand;
|
|
349
349
|
private handleGoalCommand;
|
|
350
350
|
private handleSessionCommand;
|
|
351
|
-
private
|
|
352
|
-
private
|
|
351
|
+
private showMcpSelector;
|
|
352
|
+
private showSkillsSelector;
|
|
353
353
|
private handleUsageCommand;
|
|
354
354
|
private handleUpdateCommand;
|
|
355
355
|
private handleCleanupCommand;
|