@defai.digital/ax-cli 0.0.34
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/.automatosx/agents/aerospace-scientist.yaml +159 -0
- package/.automatosx/agents/architecture.yaml +244 -0
- package/.automatosx/agents/backend.yaml +172 -0
- package/.automatosx/agents/ceo.yaml +105 -0
- package/.automatosx/agents/creative-marketer.yaml +173 -0
- package/.automatosx/agents/cto.yaml +118 -0
- package/.automatosx/agents/data-scientist.yaml +200 -0
- package/.automatosx/agents/data.yaml +106 -0
- package/.automatosx/agents/design.yaml +115 -0
- package/.automatosx/agents/devops.yaml +124 -0
- package/.automatosx/agents/frontend.yaml +171 -0
- package/.automatosx/agents/fullstack.yaml +172 -0
- package/.automatosx/agents/mobile.yaml +185 -0
- package/.automatosx/agents/product.yaml +103 -0
- package/.automatosx/agents/quality.yaml +93 -0
- package/.automatosx/agents/quantum-engineer.yaml +167 -0
- package/.automatosx/agents/researcher.yaml +122 -0
- package/.automatosx/agents/security.yaml +115 -0
- package/.automatosx/agents/standard.yaml +214 -0
- package/.automatosx/agents/writer.yaml +122 -0
- package/.automatosx/feature-flags.json +13 -0
- package/.automatosx/memory/memory.db +0 -0
- package/.automatosx/providers/README.md +117 -0
- package/.automatosx/providers/grok-zai.yaml.template +61 -0
- package/.automatosx/providers/grok.yaml.template +71 -0
- package/.automatosx/status/backend-1763517593334-85037.json +9 -0
- package/.automatosx/status/quality-1763516867087-82043.json +9 -0
- package/.automatosx/status/quality-1763516976722-84817.json +9 -0
- package/.automatosx/status/security-1763517871950-87357.json +9 -0
- package/.automatosx/teams/business.yaml +56 -0
- package/.automatosx/teams/core.yaml +60 -0
- package/.automatosx/teams/design.yaml +58 -0
- package/.automatosx/teams/engineering.yaml +69 -0
- package/.automatosx/teams/research.yaml +56 -0
- package/.automatosx/templates/analyst.yaml +60 -0
- package/.automatosx/templates/assistant.yaml +48 -0
- package/.automatosx/templates/basic-agent.yaml +28 -0
- package/.automatosx/templates/code-reviewer.yaml +52 -0
- package/.automatosx/templates/debugger.yaml +63 -0
- package/.automatosx/templates/designer.yaml +69 -0
- package/.automatosx/templates/developer.yaml +60 -0
- package/.automatosx/templates/fullstack-developer.yaml +395 -0
- package/.automatosx/templates/qa-specialist.yaml +71 -0
- package/.claude/mcp/automatosx.json +244 -0
- package/.claude/settings.local.json +34 -0
- package/.grok/settings.json +37 -0
- package/LICENSE +26 -0
- package/README.md +518 -0
- package/automatosx/PRD/README.md +9 -0
- package/automatosx/tmp/README.md +10 -0
- package/automatosx.config.json +333 -0
- package/dist/agent/grok-agent.d.ts +52 -0
- package/dist/agent/grok-agent.js +627 -0
- package/dist/agent/grok-agent.js.map +1 -0
- package/dist/agent/index.d.ts +14 -0
- package/dist/agent/index.js +136 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/commands/mcp.d.ts +2 -0
- package/dist/commands/mcp.js +239 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/grok/client.d.ts +49 -0
- package/dist/grok/client.js +80 -0
- package/dist/grok/client.js.map +1 -0
- package/dist/grok/tools.d.ts +8 -0
- package/dist/grok/tools.js +349 -0
- package/dist/grok/tools.js.map +1 -0
- package/dist/hooks/use-enhanced-input.d.ts +37 -0
- package/dist/hooks/use-enhanced-input.js +214 -0
- package/dist/hooks/use-enhanced-input.js.map +1 -0
- package/dist/hooks/use-input-handler.d.ts +34 -0
- package/dist/hooks/use-input-handler.js +608 -0
- package/dist/hooks/use-input-handler.js.map +1 -0
- package/dist/hooks/use-input-history.d.ts +9 -0
- package/dist/hooks/use-input-history.js +69 -0
- package/dist/hooks/use-input-history.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +339 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/client.d.ts +31 -0
- package/dist/mcp/client.js +152 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/config.d.ts +13 -0
- package/dist/mcp/config.js +43 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/transports.d.ts +48 -0
- package/dist/mcp/transports.js +217 -0
- package/dist/mcp/transports.js.map +1 -0
- package/dist/schemas/index.d.ts +102 -0
- package/dist/schemas/index.js +105 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/tools/bash.d.ts +10 -0
- package/dist/tools/bash.js +82 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/confirmation-tool.d.ts +16 -0
- package/dist/tools/confirmation-tool.js +72 -0
- package/dist/tools/confirmation-tool.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.js +7 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/morph-editor.d.ts +36 -0
- package/dist/tools/morph-editor.js +308 -0
- package/dist/tools/morph-editor.js.map +1 -0
- package/dist/tools/search.d.ts +68 -0
- package/dist/tools/search.js +300 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/text-editor.d.ts +16 -0
- package/dist/tools/text-editor.js +526 -0
- package/dist/tools/text-editor.js.map +1 -0
- package/dist/tools/todo-tool.d.ts +20 -0
- package/dist/tools/todo-tool.js +129 -0
- package/dist/tools/todo-tool.js.map +1 -0
- package/dist/types/index.d.ts +30 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/app.d.ts +7 -0
- package/dist/ui/app.js +99 -0
- package/dist/ui/app.js.map +1 -0
- package/dist/ui/components/api-key-input.d.ts +7 -0
- package/dist/ui/components/api-key-input.js +80 -0
- package/dist/ui/components/api-key-input.js.map +1 -0
- package/dist/ui/components/chat-history.d.ts +8 -0
- package/dist/ui/components/chat-history.js +157 -0
- package/dist/ui/components/chat-history.js.map +1 -0
- package/dist/ui/components/chat-input.d.ts +9 -0
- package/dist/ui/components/chat-input.js +67 -0
- package/dist/ui/components/chat-input.js.map +1 -0
- package/dist/ui/components/chat-interface.d.ts +8 -0
- package/dist/ui/components/chat-interface.js +272 -0
- package/dist/ui/components/chat-interface.js.map +1 -0
- package/dist/ui/components/command-suggestions.d.ts +17 -0
- package/dist/ui/components/command-suggestions.js +22 -0
- package/dist/ui/components/command-suggestions.js.map +1 -0
- package/dist/ui/components/confirmation-dialog.d.ts +11 -0
- package/dist/ui/components/confirmation-dialog.js +105 -0
- package/dist/ui/components/confirmation-dialog.js.map +1 -0
- package/dist/ui/components/diff-renderer.d.ts +13 -0
- package/dist/ui/components/diff-renderer.js +186 -0
- package/dist/ui/components/diff-renderer.js.map +1 -0
- package/dist/ui/components/loading-spinner.d.ts +8 -0
- package/dist/ui/components/loading-spinner.js +59 -0
- package/dist/ui/components/loading-spinner.js.map +1 -0
- package/dist/ui/components/mcp-status.d.ts +5 -0
- package/dist/ui/components/mcp-status.js +36 -0
- package/dist/ui/components/mcp-status.js.map +1 -0
- package/dist/ui/components/model-selection.d.ts +12 -0
- package/dist/ui/components/model-selection.js +17 -0
- package/dist/ui/components/model-selection.js.map +1 -0
- package/dist/ui/shared/max-sized-box.d.ts +8 -0
- package/dist/ui/shared/max-sized-box.js +6 -0
- package/dist/ui/shared/max-sized-box.js.map +1 -0
- package/dist/ui/utils/code-colorizer.d.ts +2 -0
- package/dist/ui/utils/code-colorizer.js +7 -0
- package/dist/ui/utils/code-colorizer.js.map +1 -0
- package/dist/ui/utils/colors.d.ts +14 -0
- package/dist/ui/utils/colors.js +15 -0
- package/dist/ui/utils/colors.js.map +1 -0
- package/dist/ui/utils/markdown-renderer.d.ts +4 -0
- package/dist/ui/utils/markdown-renderer.js +23 -0
- package/dist/ui/utils/markdown-renderer.js.map +1 -0
- package/dist/utils/confirmation-service.d.ts +32 -0
- package/dist/utils/confirmation-service.js +109 -0
- package/dist/utils/confirmation-service.js.map +1 -0
- package/dist/utils/custom-instructions.d.ts +1 -0
- package/dist/utils/custom-instructions.js +17 -0
- package/dist/utils/custom-instructions.js.map +1 -0
- package/dist/utils/model-config.d.ts +28 -0
- package/dist/utils/model-config.js +42 -0
- package/dist/utils/model-config.js.map +1 -0
- package/dist/utils/settings-manager.d.ts +94 -0
- package/dist/utils/settings-manager.js +240 -0
- package/dist/utils/settings-manager.js.map +1 -0
- package/dist/utils/settings.d.ts +1 -0
- package/dist/utils/settings.js +4 -0
- package/dist/utils/settings.js.map +1 -0
- package/dist/utils/text-utils.d.ts +80 -0
- package/dist/utils/text-utils.js +182 -0
- package/dist/utils/text-utils.js.map +1 -0
- package/dist/utils/token-counter.d.ts +33 -0
- package/dist/utils/token-counter.js +78 -0
- package/dist/utils/token-counter.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getSettingsManager } from "../utils/settings-manager.js";
|
|
2
|
+
/**
|
|
3
|
+
* Load MCP configuration from project settings
|
|
4
|
+
*/
|
|
5
|
+
export function loadMCPConfig() {
|
|
6
|
+
const manager = getSettingsManager();
|
|
7
|
+
const projectSettings = manager.loadProjectSettings();
|
|
8
|
+
const servers = projectSettings.mcpServers ? Object.values(projectSettings.mcpServers) : [];
|
|
9
|
+
return { servers };
|
|
10
|
+
}
|
|
11
|
+
export function saveMCPConfig(config) {
|
|
12
|
+
const manager = getSettingsManager();
|
|
13
|
+
const mcpServers = {};
|
|
14
|
+
// Convert servers array to object keyed by name
|
|
15
|
+
for (const server of config.servers) {
|
|
16
|
+
mcpServers[server.name] = server;
|
|
17
|
+
}
|
|
18
|
+
manager.updateProjectSetting('mcpServers', mcpServers);
|
|
19
|
+
}
|
|
20
|
+
export function addMCPServer(config) {
|
|
21
|
+
const manager = getSettingsManager();
|
|
22
|
+
const projectSettings = manager.loadProjectSettings();
|
|
23
|
+
const mcpServers = projectSettings.mcpServers || {};
|
|
24
|
+
mcpServers[config.name] = config;
|
|
25
|
+
manager.updateProjectSetting('mcpServers', mcpServers);
|
|
26
|
+
}
|
|
27
|
+
export function removeMCPServer(serverName) {
|
|
28
|
+
const manager = getSettingsManager();
|
|
29
|
+
const projectSettings = manager.loadProjectSettings();
|
|
30
|
+
const mcpServers = projectSettings.mcpServers;
|
|
31
|
+
if (mcpServers) {
|
|
32
|
+
delete mcpServers[serverName];
|
|
33
|
+
manager.updateProjectSetting('mcpServers', mcpServers);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function getMCPServer(serverName) {
|
|
37
|
+
const manager = getSettingsManager();
|
|
38
|
+
const projectSettings = manager.loadProjectSettings();
|
|
39
|
+
return projectSettings.mcpServers?.[serverName];
|
|
40
|
+
}
|
|
41
|
+
// Predefined server configurations
|
|
42
|
+
export const PREDEFINED_SERVERS = {};
|
|
43
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/mcp/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAOlE;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACtD,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,UAAU,GAAoC,EAAE,CAAC;IAEvD,gDAAgD;IAChD,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,oBAAoB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAuB;IAClD,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACtD,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,IAAI,EAAE,CAAC;IAEpD,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACjC,OAAO,CAAC,oBAAoB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACtD,MAAM,UAAU,GAAG,eAAe,CAAC,UAAU,CAAC;IAE9C,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9B,OAAO,CAAC,oBAAoB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,eAAe,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IACtD,OAAO,eAAe,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,CAAC;AAClD,CAAC;AAED,mCAAmC;AACnC,MAAM,CAAC,MAAM,kBAAkB,GAAoC,EAAE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
export type TransportType = 'stdio' | 'http' | 'sse' | 'streamable_http';
|
|
4
|
+
export interface TransportConfig {
|
|
5
|
+
type: TransportType;
|
|
6
|
+
command?: string;
|
|
7
|
+
args?: string[];
|
|
8
|
+
env?: Record<string, string>;
|
|
9
|
+
url?: string;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface MCPTransport {
|
|
13
|
+
connect(): Promise<Transport>;
|
|
14
|
+
disconnect(): Promise<void>;
|
|
15
|
+
getType(): TransportType;
|
|
16
|
+
}
|
|
17
|
+
export declare class StdioTransport implements MCPTransport {
|
|
18
|
+
private config;
|
|
19
|
+
private transport?;
|
|
20
|
+
private process?;
|
|
21
|
+
constructor(config: TransportConfig);
|
|
22
|
+
connect(): Promise<Transport>;
|
|
23
|
+
disconnect(): Promise<void>;
|
|
24
|
+
getType(): TransportType;
|
|
25
|
+
}
|
|
26
|
+
export declare class HttpTransport extends EventEmitter implements MCPTransport {
|
|
27
|
+
private config;
|
|
28
|
+
private client?;
|
|
29
|
+
constructor(config: TransportConfig);
|
|
30
|
+
connect(): Promise<Transport>;
|
|
31
|
+
disconnect(): Promise<void>;
|
|
32
|
+
getType(): TransportType;
|
|
33
|
+
}
|
|
34
|
+
export declare class SSETransport extends EventEmitter implements MCPTransport {
|
|
35
|
+
private config;
|
|
36
|
+
constructor(config: TransportConfig);
|
|
37
|
+
connect(): Promise<Transport>;
|
|
38
|
+
disconnect(): Promise<void>;
|
|
39
|
+
getType(): TransportType;
|
|
40
|
+
}
|
|
41
|
+
export declare class StreamableHttpTransport extends EventEmitter implements MCPTransport {
|
|
42
|
+
private config;
|
|
43
|
+
constructor(config: TransportConfig);
|
|
44
|
+
connect(): Promise<Transport>;
|
|
45
|
+
disconnect(): Promise<void>;
|
|
46
|
+
getType(): TransportType;
|
|
47
|
+
}
|
|
48
|
+
export declare function createTransport(config: TransportConfig): MCPTransport;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
export class StdioTransport {
|
|
5
|
+
config;
|
|
6
|
+
transport;
|
|
7
|
+
process;
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
if (!config.command) {
|
|
11
|
+
throw new Error('Command is required for stdio transport');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
async connect() {
|
|
15
|
+
// Create transport with environment variables to suppress verbose output
|
|
16
|
+
const env = {
|
|
17
|
+
...process.env,
|
|
18
|
+
...this.config.env,
|
|
19
|
+
// Try to suppress verbose output from mcp-remote
|
|
20
|
+
MCP_REMOTE_QUIET: '1',
|
|
21
|
+
MCP_REMOTE_SILENT: '1',
|
|
22
|
+
DEBUG: '',
|
|
23
|
+
NODE_ENV: 'production'
|
|
24
|
+
};
|
|
25
|
+
this.transport = new StdioClientTransport({
|
|
26
|
+
command: this.config.command,
|
|
27
|
+
args: this.config.args || [],
|
|
28
|
+
env
|
|
29
|
+
});
|
|
30
|
+
return this.transport;
|
|
31
|
+
}
|
|
32
|
+
async disconnect() {
|
|
33
|
+
if (this.transport) {
|
|
34
|
+
await this.transport.close();
|
|
35
|
+
this.transport = undefined;
|
|
36
|
+
}
|
|
37
|
+
if (this.process) {
|
|
38
|
+
this.process.kill();
|
|
39
|
+
this.process = undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
getType() {
|
|
43
|
+
return 'stdio';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export class HttpTransport extends EventEmitter {
|
|
47
|
+
config;
|
|
48
|
+
client;
|
|
49
|
+
constructor(config) {
|
|
50
|
+
super();
|
|
51
|
+
this.config = config;
|
|
52
|
+
if (!config.url) {
|
|
53
|
+
throw new Error('URL is required for HTTP transport');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async connect() {
|
|
57
|
+
this.client = axios.create({
|
|
58
|
+
baseURL: this.config.url,
|
|
59
|
+
headers: {
|
|
60
|
+
'Content-Type': 'application/json',
|
|
61
|
+
...this.config.headers
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
// Test connection
|
|
65
|
+
try {
|
|
66
|
+
await this.client.get('/health');
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
// If health endpoint doesn't exist, assume connected
|
|
70
|
+
}
|
|
71
|
+
return new HttpClientTransport(this.client);
|
|
72
|
+
}
|
|
73
|
+
async disconnect() {
|
|
74
|
+
this.client = undefined;
|
|
75
|
+
}
|
|
76
|
+
getType() {
|
|
77
|
+
return 'http';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class SSETransport extends EventEmitter {
|
|
81
|
+
config;
|
|
82
|
+
constructor(config) {
|
|
83
|
+
super();
|
|
84
|
+
this.config = config;
|
|
85
|
+
if (!config.url) {
|
|
86
|
+
throw new Error('URL is required for SSE transport');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async connect() {
|
|
90
|
+
return new Promise((resolve, reject) => {
|
|
91
|
+
try {
|
|
92
|
+
// For Node.js environment, we'll use a simple HTTP-based approach
|
|
93
|
+
// In a real implementation, you'd use a proper SSE library like 'eventsource'
|
|
94
|
+
resolve(new SSEClientTransport(this.config.url));
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
reject(error);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
async disconnect() {
|
|
102
|
+
// Nothing to disconnect for SSE
|
|
103
|
+
}
|
|
104
|
+
getType() {
|
|
105
|
+
return 'sse';
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Custom HTTP Transport implementation
|
|
109
|
+
class HttpClientTransport extends EventEmitter {
|
|
110
|
+
client;
|
|
111
|
+
constructor(client) {
|
|
112
|
+
super();
|
|
113
|
+
this.client = client;
|
|
114
|
+
}
|
|
115
|
+
async start() {
|
|
116
|
+
// HTTP transport is connection-less, so we're always "started"
|
|
117
|
+
}
|
|
118
|
+
async close() {
|
|
119
|
+
// Nothing to close for HTTP transport
|
|
120
|
+
}
|
|
121
|
+
async send(message) {
|
|
122
|
+
try {
|
|
123
|
+
const response = await this.client.post('/rpc', message);
|
|
124
|
+
return response.data;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
throw new Error(`HTTP transport error: ${error}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Custom SSE Transport implementation
|
|
132
|
+
class SSEClientTransport extends EventEmitter {
|
|
133
|
+
url;
|
|
134
|
+
constructor(url) {
|
|
135
|
+
super();
|
|
136
|
+
this.url = url;
|
|
137
|
+
}
|
|
138
|
+
async start() {
|
|
139
|
+
// SSE transport is event-driven, so we're always "started"
|
|
140
|
+
}
|
|
141
|
+
async close() {
|
|
142
|
+
// Nothing to close for basic SSE transport
|
|
143
|
+
}
|
|
144
|
+
async send(message) {
|
|
145
|
+
// For bidirectional communication over SSE, we typically use HTTP POST
|
|
146
|
+
// for sending messages and SSE for receiving
|
|
147
|
+
try {
|
|
148
|
+
const response = await axios.post(this.url.replace('/sse', '/rpc'), message, {
|
|
149
|
+
headers: { 'Content-Type': 'application/json' }
|
|
150
|
+
});
|
|
151
|
+
return response.data;
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
throw new Error(`SSE transport error: ${error}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export class StreamableHttpTransport extends EventEmitter {
|
|
159
|
+
config;
|
|
160
|
+
constructor(config) {
|
|
161
|
+
super();
|
|
162
|
+
this.config = config;
|
|
163
|
+
if (!config.url) {
|
|
164
|
+
throw new Error('URL is required for streamable_http transport');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
async connect() {
|
|
168
|
+
return new Promise((resolve, reject) => {
|
|
169
|
+
try {
|
|
170
|
+
resolve(new StreamableHttpClientTransport(this.config.url, this.config.headers));
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
reject(error);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
async disconnect() {
|
|
178
|
+
// Nothing to disconnect for streamable HTTP
|
|
179
|
+
}
|
|
180
|
+
getType() {
|
|
181
|
+
return 'streamable_http';
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
// Custom Streamable HTTP Transport implementation for GitHub Copilot MCP
|
|
185
|
+
class StreamableHttpClientTransport extends EventEmitter {
|
|
186
|
+
constructor(_url, _headers) {
|
|
187
|
+
super();
|
|
188
|
+
}
|
|
189
|
+
async start() {
|
|
190
|
+
// Streamable HTTP transport is connection-less, so we're always "started"
|
|
191
|
+
}
|
|
192
|
+
async close() {
|
|
193
|
+
// Nothing to close for streamable HTTP transport
|
|
194
|
+
}
|
|
195
|
+
async send(message) {
|
|
196
|
+
console.log('StreamableHttpTransport: SSE endpoints require persistent connections, not suitable for MCP request-response pattern');
|
|
197
|
+
console.log('StreamableHttpTransport: Message that would be sent:', JSON.stringify(message));
|
|
198
|
+
// For now, return a mock response to indicate the transport type is not compatible
|
|
199
|
+
// with the MCP protocol's request-response pattern
|
|
200
|
+
throw new Error('StreamableHttpTransport: SSE endpoints are not compatible with MCP request-response pattern. GitHub Copilot MCP may require a different integration approach.');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
export function createTransport(config) {
|
|
204
|
+
switch (config.type) {
|
|
205
|
+
case 'stdio':
|
|
206
|
+
return new StdioTransport(config);
|
|
207
|
+
case 'http':
|
|
208
|
+
return new HttpTransport(config);
|
|
209
|
+
case 'sse':
|
|
210
|
+
return new SSETransport(config);
|
|
211
|
+
case 'streamable_http':
|
|
212
|
+
return new StreamableHttpTransport(config);
|
|
213
|
+
default:
|
|
214
|
+
throw new Error(`Unsupported transport type: ${config.type}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=transports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transports.js","sourceRoot":"","sources":["../../src/mcp/transports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAwB,MAAM,OAAO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I,OAAO,CAAC,GAAG,CAAC,sDAAsD,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;QAE7F,mFAAmF;QACnF,mDAAmD;QACnD,MAAM,IAAI,KAAK,CAAC,+JAA+J,CAAC,CAAC;IACnL,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,OAAO;YACV,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;QACpC,KAAK,MAAM;YACT,OAAO,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC;QACnC,KAAK,KAAK;YACR,OAAO,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,iBAAiB;YACpB,OAAO,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAC7C;YACE,MAAM,IAAI,KAAK,CAAC,+BAA+B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration schemas using Zod for runtime validation
|
|
4
|
+
*/
|
|
5
|
+
export declare const UserSettingsSchema: z.ZodObject<{
|
|
6
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
7
|
+
baseURL: z.ZodOptional<z.ZodString>;
|
|
8
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
9
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type UserSettings = z.infer<typeof UserSettingsSchema>;
|
|
12
|
+
export declare const ProjectSettingsSchema: z.ZodObject<{
|
|
13
|
+
model: z.ZodOptional<z.ZodString>;
|
|
14
|
+
mcpServers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
transport: z.ZodEnum<{
|
|
17
|
+
stdio: "stdio";
|
|
18
|
+
http: "http";
|
|
19
|
+
sse: "sse";
|
|
20
|
+
}>;
|
|
21
|
+
command: z.ZodOptional<z.ZodString>;
|
|
22
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
url: z.ZodOptional<z.ZodString>;
|
|
24
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
|
|
28
|
+
export declare const MCPServerConfigSchema: z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
transport: z.ZodEnum<{
|
|
31
|
+
stdio: "stdio";
|
|
32
|
+
http: "http";
|
|
33
|
+
sse: "sse";
|
|
34
|
+
}>;
|
|
35
|
+
command: z.ZodOptional<z.ZodString>;
|
|
36
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
|
+
url: z.ZodOptional<z.ZodString>;
|
|
38
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type MCPServerConfig = z.infer<typeof MCPServerConfigSchema>;
|
|
41
|
+
export declare const ToolExecutionSchema: z.ZodObject<{
|
|
42
|
+
name: z.ZodString;
|
|
43
|
+
arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type ToolExecution = z.infer<typeof ToolExecutionSchema>;
|
|
46
|
+
export declare const APIResponseSchema: z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
object: z.ZodString;
|
|
49
|
+
created: z.ZodNumber;
|
|
50
|
+
model: z.ZodString;
|
|
51
|
+
choices: z.ZodArray<z.ZodObject<{
|
|
52
|
+
index: z.ZodNumber;
|
|
53
|
+
message: z.ZodObject<{
|
|
54
|
+
role: z.ZodEnum<{
|
|
55
|
+
system: "system";
|
|
56
|
+
user: "user";
|
|
57
|
+
assistant: "assistant";
|
|
58
|
+
tool: "tool";
|
|
59
|
+
}>;
|
|
60
|
+
content: z.ZodNullable<z.ZodString>;
|
|
61
|
+
tool_calls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
type: z.ZodLiteral<"function">;
|
|
64
|
+
function: z.ZodObject<{
|
|
65
|
+
name: z.ZodString;
|
|
66
|
+
arguments: z.ZodString;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
finish_reason: z.ZodNullable<z.ZodEnum<{
|
|
71
|
+
length: "length";
|
|
72
|
+
stop: "stop";
|
|
73
|
+
tool_calls: "tool_calls";
|
|
74
|
+
content_filter: "content_filter";
|
|
75
|
+
}>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
prompt_tokens: z.ZodNumber;
|
|
79
|
+
completion_tokens: z.ZodNumber;
|
|
80
|
+
total_tokens: z.ZodNumber;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export type APIResponse = z.infer<typeof APIResponseSchema>;
|
|
84
|
+
/**
|
|
85
|
+
* Validation helper functions
|
|
86
|
+
*/
|
|
87
|
+
export declare function validateUserSettings(data: unknown): UserSettings;
|
|
88
|
+
export declare function validateProjectSettings(data: unknown): ProjectSettings;
|
|
89
|
+
export declare function validateMCPServerConfig(data: unknown): MCPServerConfig;
|
|
90
|
+
/**
|
|
91
|
+
* Safe parsing with error handling
|
|
92
|
+
*/
|
|
93
|
+
export declare function safeValidateUserSettings(data: unknown): {
|
|
94
|
+
success: boolean;
|
|
95
|
+
data?: UserSettings;
|
|
96
|
+
error?: z.ZodError;
|
|
97
|
+
};
|
|
98
|
+
export declare function safeValidateProjectSettings(data: unknown): {
|
|
99
|
+
success: boolean;
|
|
100
|
+
data?: ProjectSettings;
|
|
101
|
+
error?: z.ZodError;
|
|
102
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration schemas using Zod for runtime validation
|
|
4
|
+
*/
|
|
5
|
+
// User settings schema
|
|
6
|
+
export const UserSettingsSchema = z.object({
|
|
7
|
+
apiKey: z.string().optional(),
|
|
8
|
+
baseURL: z.string().url().optional(),
|
|
9
|
+
defaultModel: z.string().optional(),
|
|
10
|
+
models: z.array(z.string()).optional(),
|
|
11
|
+
});
|
|
12
|
+
// Project settings schema
|
|
13
|
+
export const ProjectSettingsSchema = z.object({
|
|
14
|
+
model: z.string().optional(),
|
|
15
|
+
mcpServers: z.record(z.string(), z.object({
|
|
16
|
+
name: z.string(),
|
|
17
|
+
transport: z.enum(['stdio', 'http', 'sse']),
|
|
18
|
+
command: z.string().optional(),
|
|
19
|
+
args: z.array(z.string()).optional(),
|
|
20
|
+
url: z.string().url().optional(),
|
|
21
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
22
|
+
})).optional(),
|
|
23
|
+
});
|
|
24
|
+
// MCP Server configuration schema
|
|
25
|
+
export const MCPServerConfigSchema = z.object({
|
|
26
|
+
name: z.string().min(1, 'Server name is required'),
|
|
27
|
+
transport: z.enum(['stdio', 'http', 'sse']),
|
|
28
|
+
command: z.string().optional(),
|
|
29
|
+
args: z.array(z.string()).optional(),
|
|
30
|
+
url: z.string().url().optional(),
|
|
31
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
32
|
+
}).refine((data) => {
|
|
33
|
+
if (data.transport === 'stdio') {
|
|
34
|
+
return !!data.command;
|
|
35
|
+
}
|
|
36
|
+
if (data.transport === 'http' || data.transport === 'sse') {
|
|
37
|
+
return !!data.url;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}, {
|
|
41
|
+
message: 'stdio transport requires command, http/sse requires url',
|
|
42
|
+
});
|
|
43
|
+
// Tool execution schema
|
|
44
|
+
export const ToolExecutionSchema = z.object({
|
|
45
|
+
name: z.string(),
|
|
46
|
+
arguments: z.record(z.string(), z.unknown()),
|
|
47
|
+
});
|
|
48
|
+
// API Response schema
|
|
49
|
+
export const APIResponseSchema = z.object({
|
|
50
|
+
id: z.string(),
|
|
51
|
+
object: z.string(),
|
|
52
|
+
created: z.number(),
|
|
53
|
+
model: z.string(),
|
|
54
|
+
choices: z.array(z.object({
|
|
55
|
+
index: z.number(),
|
|
56
|
+
message: z.object({
|
|
57
|
+
role: z.enum(['system', 'user', 'assistant', 'tool']),
|
|
58
|
+
content: z.string().nullable(),
|
|
59
|
+
tool_calls: z.array(z.object({
|
|
60
|
+
id: z.string(),
|
|
61
|
+
type: z.literal('function'),
|
|
62
|
+
function: z.object({
|
|
63
|
+
name: z.string(),
|
|
64
|
+
arguments: z.string(),
|
|
65
|
+
}),
|
|
66
|
+
})).optional(),
|
|
67
|
+
}),
|
|
68
|
+
finish_reason: z.enum(['stop', 'length', 'tool_calls', 'content_filter']).nullable(),
|
|
69
|
+
})),
|
|
70
|
+
usage: z.object({
|
|
71
|
+
prompt_tokens: z.number(),
|
|
72
|
+
completion_tokens: z.number(),
|
|
73
|
+
total_tokens: z.number(),
|
|
74
|
+
}).optional(),
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* Validation helper functions
|
|
78
|
+
*/
|
|
79
|
+
export function validateUserSettings(data) {
|
|
80
|
+
return UserSettingsSchema.parse(data);
|
|
81
|
+
}
|
|
82
|
+
export function validateProjectSettings(data) {
|
|
83
|
+
return ProjectSettingsSchema.parse(data);
|
|
84
|
+
}
|
|
85
|
+
export function validateMCPServerConfig(data) {
|
|
86
|
+
return MCPServerConfigSchema.parse(data);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Safe parsing with error handling
|
|
90
|
+
*/
|
|
91
|
+
export function safeValidateUserSettings(data) {
|
|
92
|
+
const result = UserSettingsSchema.safeParse(data);
|
|
93
|
+
if (result.success) {
|
|
94
|
+
return { success: true, data: result.data };
|
|
95
|
+
}
|
|
96
|
+
return { success: false, error: result.error };
|
|
97
|
+
}
|
|
98
|
+
export function safeValidateProjectSettings(data) {
|
|
99
|
+
const result = ProjectSettingsSchema.safeParse(data);
|
|
100
|
+
if (result.success) {
|
|
101
|
+
return { success: true, data: result.data };
|
|
102
|
+
}
|
|
103
|
+
return { success: false, error: result.error };
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAEH,uBAAuB;AACvB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAIH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;QACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAA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C,IAAa;IAKvD,MAAM,MAAM,GAAG,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToolResult } from '../types/index.js';
|
|
2
|
+
export declare class BashTool {
|
|
3
|
+
private currentDirectory;
|
|
4
|
+
private confirmationService;
|
|
5
|
+
execute(command: string, timeout?: number): Promise<ToolResult>;
|
|
6
|
+
getCurrentDirectory(): string;
|
|
7
|
+
listFiles(directory?: string): Promise<ToolResult>;
|
|
8
|
+
findFiles(pattern: string, directory?: string): Promise<ToolResult>;
|
|
9
|
+
grep(pattern: string, files?: string): Promise<ToolResult>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { exec } from 'child_process';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
import { ConfirmationService } from '../utils/confirmation-service.js';
|
|
4
|
+
const execAsync = promisify(exec);
|
|
5
|
+
/**
|
|
6
|
+
* Escape shell argument to prevent command injection
|
|
7
|
+
*/
|
|
8
|
+
function escapeShellArg(arg) {
|
|
9
|
+
// Replace single quotes with '\'' to safely escape them
|
|
10
|
+
return `'${arg.replace(/'/g, "'\\''")}'`;
|
|
11
|
+
}
|
|
12
|
+
export class BashTool {
|
|
13
|
+
currentDirectory = process.cwd();
|
|
14
|
+
confirmationService = ConfirmationService.getInstance();
|
|
15
|
+
async execute(command, timeout = 30000) {
|
|
16
|
+
try {
|
|
17
|
+
// Check if user has already accepted bash commands for this session
|
|
18
|
+
const sessionFlags = this.confirmationService.getSessionFlags();
|
|
19
|
+
if (!sessionFlags.bashCommands && !sessionFlags.allOperations) {
|
|
20
|
+
// Request confirmation showing the command
|
|
21
|
+
const confirmationResult = await this.confirmationService.requestConfirmation({
|
|
22
|
+
operation: 'Run bash command',
|
|
23
|
+
filename: command,
|
|
24
|
+
showVSCodeOpen: false,
|
|
25
|
+
content: `Command: ${command}\nWorking directory: ${this.currentDirectory}`
|
|
26
|
+
}, 'bash');
|
|
27
|
+
if (!confirmationResult.confirmed) {
|
|
28
|
+
return {
|
|
29
|
+
success: false,
|
|
30
|
+
error: confirmationResult.feedback || 'Command execution cancelled by user'
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (command.startsWith('cd ')) {
|
|
35
|
+
const newDir = command.substring(3).trim();
|
|
36
|
+
try {
|
|
37
|
+
process.chdir(newDir);
|
|
38
|
+
this.currentDirectory = process.cwd();
|
|
39
|
+
return {
|
|
40
|
+
success: true,
|
|
41
|
+
output: `Changed directory to: ${this.currentDirectory}`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
return {
|
|
46
|
+
success: false,
|
|
47
|
+
error: `Cannot change directory: ${error.message}`
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const { stdout, stderr } = await execAsync(command, {
|
|
52
|
+
cwd: this.currentDirectory,
|
|
53
|
+
timeout,
|
|
54
|
+
maxBuffer: 1024 * 1024
|
|
55
|
+
});
|
|
56
|
+
const output = stdout + (stderr ? `\nSTDERR: ${stderr}` : '');
|
|
57
|
+
return {
|
|
58
|
+
success: true,
|
|
59
|
+
output: output.trim() || 'Command executed successfully (no output)'
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return {
|
|
64
|
+
success: false,
|
|
65
|
+
error: `Command failed: ${error.message}`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
getCurrentDirectory() {
|
|
70
|
+
return this.currentDirectory;
|
|
71
|
+
}
|
|
72
|
+
async listFiles(directory = '.') {
|
|
73
|
+
return this.execute(`ls -la ${escapeShellArg(directory)}`);
|
|
74
|
+
}
|
|
75
|
+
async findFiles(pattern, directory = '.') {
|
|
76
|
+
return this.execute(`find ${escapeShellArg(directory)} -name ${escapeShellArg(pattern)} -type f`);
|
|
77
|
+
}
|
|
78
|
+
async grep(pattern, files = '.') {
|
|
79
|
+
return this.execute(`grep -r ${escapeShellArg(pattern)} ${escapeShellArg(files)}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=bash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC;;GAEG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,wDAAwD;IACxD,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;AAC3C,CAAC;AAED,MAAM,OAAO,QAAQ;IACX,gBAAgB,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,mBAAmB,GAAG,mBAAmB,CAAC,WAAW,EAAE,CAAC;IAGhE,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,UAAkB,KAAK;QACpD,IAAI,CAAC;YACH,oEAAoE;YACpE,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,eAAe,EAAE,CAAC;YAChE,IAAI,CAAC,YAAY,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC;gBAC9D,2CAA2C;gBAC3C,MAAM,kBAAkB,GAAG,MAA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CAAC,CAAC,EAAE,CAAC,CAAC;YAE9D,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,2CAA2C;aACrE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,mBAAmB,KAAK,CAAC,OAAO,EAAE;aAC1C,CAAC;QACJ,CAAC;IACH,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,YAAoB,GAAG;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAe,EAAE,YAAoB,GAAG;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,cAAc,CAAC,SAAS,CAAC,UAAU,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACpG,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAe,EAAE,QAAgB,GAAG;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,cAAc,CAAC,OAAO,CAAC,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrF,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ToolResult } from '../types/index.js';
|
|
2
|
+
export interface ConfirmationRequest {
|
|
3
|
+
operation: string;
|
|
4
|
+
filename: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
showVSCodeOpen?: boolean;
|
|
7
|
+
autoAccept?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare class ConfirmationTool {
|
|
10
|
+
private confirmationService;
|
|
11
|
+
constructor();
|
|
12
|
+
requestConfirmation(request: ConfirmationRequest): Promise<ToolResult>;
|
|
13
|
+
checkSessionAcceptance(): Promise<ToolResult>;
|
|
14
|
+
resetSession(): void;
|
|
15
|
+
isPending(): boolean;
|
|
16
|
+
}
|