@nogataka/smart-edit 0.1.0 → 1.0.1
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/LICENSE +0 -1
- package/README.md +143 -66
- package/dist/cli.js +2 -2
- package/dist/devtools/generate_prompt_factory.js +5 -5
- package/dist/index.d.ts +33 -34
- package/dist/index.js +33 -34
- package/dist/interprompt/multilang_prompt.js +2 -2
- package/dist/interprompt/prompt_factory.js +2 -2
- package/dist/interprompt/util/class_decorators.d.ts +1 -1
- package/dist/interprompt/util/class_decorators.js +1 -1
- package/dist/{serena → smart-edit}/agent.d.ts +20 -20
- package/dist/{serena → smart-edit}/agent.js +43 -43
- package/dist/{serena → smart-edit}/analytics.d.ts +1 -1
- package/dist/{serena → smart-edit}/analytics.js +3 -3
- package/dist/smart-edit/cli.d.ts +9 -0
- package/dist/{serena → smart-edit}/cli.js +49 -99
- package/dist/{serena → smart-edit}/code_editor.d.ts +7 -7
- package/dist/{serena → smart-edit}/config/context_mode.d.ts +13 -13
- package/dist/{serena → smart-edit}/config/context_mode.js +12 -12
- package/dist/{serena/config/serena_config.d.ts → smart-edit/config/smart_edit_config.d.ts} +14 -14
- package/dist/{serena/config/serena_config.js → smart-edit/config/smart_edit_config.js} +31 -31
- package/dist/smart-edit/constants.d.ts +18 -0
- package/dist/smart-edit/constants.js +27 -0
- package/dist/{serena → smart-edit}/dashboard.d.ts +3 -3
- package/dist/{serena → smart-edit}/dashboard.js +10 -10
- package/dist/{serena → smart-edit}/gui_log_viewer.js +6 -6
- package/dist/{serena → smart-edit}/mcp.d.ts +40 -40
- package/dist/{serena → smart-edit}/mcp.js +38 -38
- package/dist/{serena → smart-edit}/project.d.ts +7 -7
- package/dist/{serena → smart-edit}/project.js +18 -18
- package/dist/{serena → smart-edit}/prompt_factory.d.ts +3 -3
- package/dist/{serena → smart-edit}/prompt_factory.js +1 -1
- package/dist/{serena → smart-edit}/resources/config/contexts/codex.yml +2 -2
- package/dist/{serena → smart-edit}/resources/config/contexts/context.template.yml +1 -1
- package/dist/{serena → smart-edit}/resources/config/contexts/ide-assistant.yml +2 -2
- package/dist/{serena → smart-edit}/resources/config/modes/mode.template.yml +1 -1
- package/dist/{serena → smart-edit}/resources/config/prompt_templates/simple_tool_outputs.yml +1 -1
- package/dist/smart-edit/resources/dashboard/dashboard.js +13 -0
- package/dist/smart-edit/resources/dashboard/index.css +1 -0
- package/dist/smart-edit/resources/dashboard/index.html +13 -0
- package/dist/{serena → smart-edit}/resources/project.template.yml +6 -6
- package/dist/{serena/resources/serena_config.template.yml → smart-edit/resources/smart_edit_config.template.yml} +14 -14
- package/dist/{serena → smart-edit}/symbol.d.ts +7 -7
- package/dist/{serena → smart-edit}/symbol.js +2 -2
- package/dist/{serena → smart-edit}/text_utils.js +2 -2
- package/dist/{serena → smart-edit}/tools/config_tools.d.ts +1 -1
- package/dist/{serena → smart-edit}/tools/config_tools.js +6 -6
- package/dist/{serena → smart-edit}/tools/memory_tools.d.ts +4 -4
- package/dist/{serena → smart-edit}/tools/memory_tools.js +5 -5
- package/dist/{serena → smart-edit}/tools/tools_base.d.ts +15 -15
- package/dist/{serena → smart-edit}/tools/tools_base.js +7 -7
- package/dist/{serena → smart-edit}/util/exception.d.ts +2 -2
- package/dist/{serena → smart-edit}/util/exception.js +2 -2
- package/dist/{serena → smart-edit}/util/file_system.js +3 -3
- package/dist/{serena → smart-edit}/util/git.js +3 -3
- package/dist/{serena → smart-edit}/util/inspection.d.ts +3 -3
- package/dist/{serena → smart-edit}/util/inspection.js +3 -3
- package/dist/{serena → smart-edit}/util/logging.d.ts +6 -6
- package/dist/{serena → smart-edit}/util/logging.js +7 -7
- package/dist/{serena → smart-edit}/util/shell.js +1 -1
- package/dist/smart-edit/version.d.ts +1 -0
- package/dist/{serena → smart-edit}/version.js +3 -3
- package/dist/{solidlsp → smart-lsp}/language_servers/autoload.js +1 -1
- package/dist/smart-lsp/language_servers/bash_language_server.d.ts +10 -0
- package/dist/{solidlsp → smart-lsp}/language_servers/bash_language_server.js +8 -8
- package/dist/{solidlsp → smart-lsp}/language_servers/clangd_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/clangd_language_server.js +9 -9
- package/dist/{solidlsp → smart-lsp}/language_servers/clojure_lsp.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/clojure_lsp.js +9 -9
- package/dist/{solidlsp → smart-lsp}/language_servers/common.d.ts +2 -2
- package/dist/{solidlsp → smart-lsp}/language_servers/common.js +1 -1
- package/dist/{solidlsp → smart-lsp}/language_servers/csharp_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/csharp_language_server.js +12 -12
- package/dist/smart-lsp/language_servers/dart_language_server.d.ts +10 -0
- package/dist/{solidlsp → smart-lsp}/language_servers/dart_language_server.js +13 -13
- package/dist/{solidlsp → smart-lsp}/language_servers/eclipse_jdtls.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/eclipse_jdtls.js +12 -12
- package/dist/{solidlsp → smart-lsp}/language_servers/erlang_language_server.d.ts +3 -3
- package/dist/{solidlsp → smart-lsp}/language_servers/erlang_language_server.js +6 -6
- package/dist/{solidlsp → smart-lsp}/language_servers/gopls.d.ts +3 -3
- package/dist/{solidlsp → smart-lsp}/language_servers/gopls.js +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/intelephense.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/intelephense.js +11 -11
- package/dist/{solidlsp → smart-lsp}/language_servers/jedi_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/jedi_server.js +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/kotlin_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/kotlin_language_server.js +9 -9
- package/dist/{solidlsp → smart-lsp}/language_servers/lua_ls.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/lua_ls.js +10 -10
- package/dist/{solidlsp → smart-lsp}/language_servers/nixd_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/nixd_language_server.js +7 -7
- package/dist/{solidlsp → smart-lsp}/language_servers/pyright_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/pyright_server.js +3 -3
- package/dist/{solidlsp → smart-lsp}/language_servers/r_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/r_language_server.js +5 -5
- package/dist/smart-lsp/language_servers/ruby_common.d.ts +10 -0
- package/dist/{solidlsp → smart-lsp}/language_servers/ruby_common.js +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/ruby_lsp.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/ruby_lsp.js +10 -10
- package/dist/{solidlsp → smart-lsp}/language_servers/rust_analyzer.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/rust_analyzer.js +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/solargraph.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/solargraph.js +10 -10
- package/dist/{solidlsp → smart-lsp}/language_servers/sourcekit_lsp.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/sourcekit_lsp.js +7 -7
- package/dist/{solidlsp → smart-lsp}/language_servers/terraform_ls.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/terraform_ls.js +14 -14
- package/dist/{solidlsp → smart-lsp}/language_servers/typescript_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/typescript_language_server.js +11 -11
- package/dist/{solidlsp → smart-lsp}/language_servers/vts_language_server.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/vts_language_server.js +10 -10
- package/dist/{solidlsp → smart-lsp}/language_servers/zls.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/language_servers/zls.js +6 -6
- package/dist/{solidlsp → smart-lsp}/ls.d.ts +25 -25
- package/dist/{solidlsp → smart-lsp}/ls.js +19 -19
- package/dist/{solidlsp → smart-lsp}/ls_config.d.ts +0 -5
- package/dist/{solidlsp → smart-lsp}/ls_config.js +0 -5
- package/dist/{solidlsp → smart-lsp}/ls_exceptions.d.ts +1 -1
- package/dist/{solidlsp → smart-lsp}/ls_exceptions.js +2 -2
- package/dist/{solidlsp → smart-lsp}/ls_handler.d.ts +7 -7
- package/dist/{solidlsp → smart-lsp}/ls_handler.js +12 -12
- package/dist/{solidlsp → smart-lsp}/ls_request.d.ts +4 -4
- package/dist/{solidlsp → smart-lsp}/ls_request.js +3 -3
- package/package.json +17 -3
- package/dist/serena/agno.d.ts +0 -111
- package/dist/serena/agno.js +0 -278
- package/dist/serena/cli.d.ts +0 -9
- package/dist/serena/constants.d.ts +0 -18
- package/dist/serena/constants.js +0 -27
- package/dist/serena/resources/dashboard/dashboard.js +0 -816
- package/dist/serena/resources/dashboard/index.html +0 -312
- package/dist/serena/resources/dashboard/jquery.min.js +0 -3
- package/dist/serena/version.d.ts +0 -1
- package/dist/solidlsp/language_servers/bash_language_server.d.ts +0 -10
- package/dist/solidlsp/language_servers/dart_language_server.d.ts +0 -10
- package/dist/solidlsp/language_servers/ruby_common.d.ts +0 -10
- /package/dist/{serena → smart-edit}/code_editor.js +0 -0
- /package/dist/{serena → smart-edit}/generated/generated_prompt_factory.d.ts +0 -0
- /package/dist/{serena → smart-edit}/generated/generated_prompt_factory.js +0 -0
- /package/dist/{serena → smart-edit}/gui_log_viewer.d.ts +0 -0
- /package/dist/{serena → smart-edit}/resources/config/contexts/agent.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/contexts/chatgpt.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/contexts/desktop-app.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/contexts/oaicompat-agent.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/internal_modes/jetbrains.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/modes/editing.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/modes/interactive.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/modes/no-onboarding.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/modes/onboarding.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/modes/one-shot.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/modes/planning.yml +0 -0
- /package/dist/{serena → smart-edit}/resources/config/prompt_templates/system_prompt.yml +0 -0
- /package/dist/{serena/resources/dashboard/serena-icon-16.svg → smart-edit/resources/dashboard/smart-edit-icon-16.svg} +0 -0
- /package/dist/{serena/resources/dashboard/serena-icon-32.svg → smart-edit/resources/dashboard/smart-edit-icon-32.svg} +0 -0
- /package/dist/{serena/resources/dashboard/serena-icon-48.svg → smart-edit/resources/dashboard/smart-edit-icon-48.svg} +0 -0
- /package/dist/{serena/resources/dashboard/serena-logs-dark-mode.svg → smart-edit/resources/dashboard/smart-edit-logs-dark-mode.svg} +0 -0
- /package/dist/{serena/resources/dashboard/serena-logs.svg → smart-edit/resources/dashboard/smart-edit-logs.svg} +0 -0
- /package/dist/{serena → smart-edit}/text_utils.d.ts +0 -0
- /package/dist/{serena → smart-edit}/tools/cmd_tools.d.ts +0 -0
- /package/dist/{serena → smart-edit}/tools/cmd_tools.js +0 -0
- /package/dist/{serena → smart-edit}/tools/file_tools.d.ts +0 -0
- /package/dist/{serena → smart-edit}/tools/file_tools.js +0 -0
- /package/dist/{serena → smart-edit}/tools/index.d.ts +0 -0
- /package/dist/{serena → smart-edit}/tools/index.js +0 -0
- /package/dist/{serena → smart-edit}/tools/symbol_tools.d.ts +0 -0
- /package/dist/{serena → smart-edit}/tools/symbol_tools.js +0 -0
- /package/dist/{serena → smart-edit}/tools/workflow_tools.d.ts +0 -0
- /package/dist/{serena → smart-edit}/tools/workflow_tools.js +0 -0
- /package/dist/{serena → smart-edit}/util/class_decorators.d.ts +0 -0
- /package/dist/{serena → smart-edit}/util/class_decorators.js +0 -0
- /package/dist/{serena → smart-edit}/util/file_system.d.ts +0 -0
- /package/dist/{serena → smart-edit}/util/general.d.ts +0 -0
- /package/dist/{serena → smart-edit}/util/general.js +0 -0
- /package/dist/{serena → smart-edit}/util/git.d.ts +0 -0
- /package/dist/{serena → smart-edit}/util/shell.d.ts +0 -0
- /package/dist/{serena → smart-edit}/util/thread.d.ts +0 -0
- /package/dist/{serena → smart-edit}/util/thread.js +0 -0
- /package/dist/{solidlsp → smart-lsp}/language_servers/autoload.d.ts +0 -0
- /package/dist/{solidlsp → smart-lsp}/ls_types.d.ts +0 -0
- /package/dist/{solidlsp → smart-lsp}/ls_types.js +0 -0
- /package/dist/{solidlsp → smart-lsp}/lsp_protocol_handler/server.d.ts +0 -0
- /package/dist/{solidlsp → smart-lsp}/lsp_protocol_handler/server.js +0 -0
- /package/dist/{solidlsp → smart-lsp}/util/subprocess_util.d.ts +0 -0
- /package/dist/{solidlsp → smart-lsp}/util/subprocess_util.js +0 -0
- /package/dist/{solidlsp → smart-lsp}/util/zip.d.ts +0 -0
- /package/dist/{solidlsp → smart-lsp}/util/zip.js +0 -0
|
@@ -5,23 +5,23 @@ import type { ServerOptions } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
5
5
|
import { type Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
6
6
|
import { type IncomingMessage, type ServerResponse, type Server as HttpServer } from 'node:http';
|
|
7
7
|
import type { URL as NodeURLType } from 'node:url';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { SmartEditAgentContext, SmartEditAgentMode } from './config/context_mode.js';
|
|
9
|
+
import { SmartEditConfig } from './config/smart_edit_config.js';
|
|
10
|
+
import { createSmartEditLogger } from './util/logging.js';
|
|
11
11
|
import type { MemoryLogHandler } from './util/logging.js';
|
|
12
|
-
import type {
|
|
13
|
-
export interface
|
|
14
|
-
agent:
|
|
12
|
+
import type { SmartEditAgentLike, Tool } from './tools/tools_base.js';
|
|
13
|
+
export interface SmartEditMCPRequestContext {
|
|
14
|
+
agent: SmartEditAgentLike;
|
|
15
15
|
}
|
|
16
|
-
export interface
|
|
16
|
+
export interface SmartEditAgentFactoryOptions {
|
|
17
17
|
project: string | null;
|
|
18
|
-
|
|
19
|
-
context:
|
|
20
|
-
modes:
|
|
18
|
+
smartEditConfig: SmartEditConfig;
|
|
19
|
+
context: SmartEditAgentContext;
|
|
20
|
+
modes: SmartEditAgentMode[];
|
|
21
21
|
memoryLogHandler?: MemoryLogHandler | null;
|
|
22
22
|
}
|
|
23
|
-
export type
|
|
24
|
-
export interface
|
|
23
|
+
export type SmartEditAgentFactory = (options: SmartEditAgentFactoryOptions) => SmartEditAgentLike;
|
|
24
|
+
export interface SmartEditMCPServerOptions {
|
|
25
25
|
host?: string;
|
|
26
26
|
port?: number;
|
|
27
27
|
modes?: Iterable<string>;
|
|
@@ -34,35 +34,35 @@ export interface SerenaMCPServerOptions {
|
|
|
34
34
|
serverInfo?: Implementation;
|
|
35
35
|
serverOptions?: ServerOptions;
|
|
36
36
|
}
|
|
37
|
-
export type
|
|
38
|
-
export interface
|
|
37
|
+
export type SmartEditHttpRequestHandler = (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
38
|
+
export interface SmartEditHttpServerOptions extends SmartEditMCPServerOptions {
|
|
39
39
|
path?: string;
|
|
40
40
|
transportOptions?: Partial<StreamableHTTPServerTransportOptions>;
|
|
41
41
|
sessionIdGenerator?: (() => string) | null;
|
|
42
42
|
}
|
|
43
|
-
export interface
|
|
43
|
+
export interface SmartEditHttpServerInstance {
|
|
44
44
|
httpServer: HttpServer;
|
|
45
45
|
transport: StreamableHTTPServerTransport;
|
|
46
46
|
mcpServer: McpServer;
|
|
47
47
|
url: NodeURLType;
|
|
48
48
|
close(): Promise<void>;
|
|
49
49
|
}
|
|
50
|
-
export interface
|
|
50
|
+
export interface SmartEditGrpcServerOptions extends SmartEditMCPServerOptions {
|
|
51
51
|
address?: string;
|
|
52
52
|
}
|
|
53
|
-
export declare abstract class
|
|
54
|
-
protected readonly context:
|
|
53
|
+
export declare abstract class SmartEditMCPFactory {
|
|
54
|
+
protected readonly context: SmartEditAgentContext;
|
|
55
55
|
protected readonly project: string | null;
|
|
56
56
|
private agent;
|
|
57
57
|
private requestContext;
|
|
58
58
|
protected constructor(context?: string, project?: string | null);
|
|
59
|
-
protected getAgent():
|
|
60
|
-
protected setAgent(agent:
|
|
61
|
-
protected getRequestContext():
|
|
59
|
+
protected getAgent(): SmartEditAgentLike;
|
|
60
|
+
protected setAgent(agent: SmartEditAgentLike): void;
|
|
61
|
+
protected getRequestContext(): SmartEditMCPRequestContext;
|
|
62
62
|
protected abstract instantiateAgent(options: {
|
|
63
|
-
|
|
64
|
-
modes:
|
|
65
|
-
}):
|
|
63
|
+
smartEditConfig: SmartEditConfig;
|
|
64
|
+
modes: SmartEditAgentMode[];
|
|
65
|
+
}): SmartEditAgentLike;
|
|
66
66
|
protected abstract iterTools(): Iterable<Tool>;
|
|
67
67
|
protected abstract getInitialInstructions(): string;
|
|
68
68
|
protected isOpenAiCompatibleContext(): boolean;
|
|
@@ -82,37 +82,37 @@ export declare abstract class SerenaMCPFactory {
|
|
|
82
82
|
private isIterable;
|
|
83
83
|
protected registerTools(server: McpServer, openAiToolCompatible: boolean): void;
|
|
84
84
|
private registerTool;
|
|
85
|
-
createMcpServer(options?:
|
|
86
|
-
protected getLogger(): ReturnType<typeof
|
|
85
|
+
createMcpServer(options?: SmartEditMCPServerOptions): McpServer;
|
|
86
|
+
protected getLogger(): ReturnType<typeof createSmartEditLogger>['logger'];
|
|
87
87
|
}
|
|
88
|
-
export interface
|
|
88
|
+
export interface SmartEditMCPFactorySingleProcessOptions {
|
|
89
89
|
context?: string;
|
|
90
90
|
project?: string | null;
|
|
91
91
|
memoryLogHandler?: MemoryLogHandler | null;
|
|
92
|
-
agentFactory?:
|
|
92
|
+
agentFactory?: SmartEditAgentFactory;
|
|
93
93
|
}
|
|
94
|
-
export declare class
|
|
94
|
+
export declare class SmartEditMCPFactorySingleProcess extends SmartEditMCPFactory {
|
|
95
95
|
private readonly memoryLogHandler;
|
|
96
96
|
private readonly agentFactory?;
|
|
97
97
|
private cachedTools;
|
|
98
|
-
constructor(options?:
|
|
99
|
-
protected instantiateAgent({
|
|
100
|
-
|
|
101
|
-
modes:
|
|
102
|
-
}):
|
|
98
|
+
constructor(options?: SmartEditMCPFactorySingleProcessOptions);
|
|
99
|
+
protected instantiateAgent({ smartEditConfig, modes }: {
|
|
100
|
+
smartEditConfig: SmartEditConfig;
|
|
101
|
+
modes: SmartEditAgentMode[];
|
|
102
|
+
}): SmartEditAgentLike;
|
|
103
103
|
protected iterTools(): Iterable<Tool>;
|
|
104
104
|
protected getInitialInstructions(): string;
|
|
105
105
|
}
|
|
106
|
-
export declare function
|
|
106
|
+
export declare function createSmartEditHttpRequestHandler({ transport, path, defaultHost }: {
|
|
107
107
|
transport: StreamableHTTPServerTransport;
|
|
108
108
|
path?: string;
|
|
109
109
|
defaultHost?: string;
|
|
110
|
-
}):
|
|
111
|
-
export declare function
|
|
112
|
-
export interface
|
|
110
|
+
}): SmartEditHttpRequestHandler;
|
|
111
|
+
export declare function createSmartEditHttpServer(factory: SmartEditMCPFactory, options?: SmartEditHttpServerOptions): Promise<SmartEditHttpServerInstance>;
|
|
112
|
+
export interface SmartEditStdioServerInstance {
|
|
113
113
|
transport: StdioServerTransport;
|
|
114
114
|
mcpServer: McpServer;
|
|
115
115
|
close(): Promise<void>;
|
|
116
116
|
}
|
|
117
|
-
export declare function
|
|
118
|
-
export declare function
|
|
117
|
+
export declare function createSmartEditStdioServer(factory: SmartEditMCPFactory, options?: SmartEditMCPServerOptions): Promise<SmartEditStdioServerInstance>;
|
|
118
|
+
export declare function createSmartEditGrpcServer(_factory: SmartEditMCPFactory, _options?: SmartEditGrpcServerOptions): Promise<never>;
|
|
@@ -8,15 +8,15 @@ import { URL as NodeURL } from 'node:url';
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
10
10
|
import { DEFAULT_CONTEXT, DEFAULT_MODES } from './constants.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { SmartEditAgentContext, SmartEditAgentMode } from './config/context_mode.js';
|
|
12
|
+
import { SmartEditConfig } from './config/smart_edit_config.js';
|
|
13
13
|
import { createRequire } from 'node:module';
|
|
14
14
|
import { showFatalExceptionSafe } from './util/exception.js';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { createSmartEditLogger } from './util/logging.js';
|
|
16
|
+
import { SmartEditAgent } from './agent.js';
|
|
17
17
|
const require = createRequire(import.meta.url);
|
|
18
18
|
const packageJson = require('../../package.json');
|
|
19
|
-
const { logger: log } =
|
|
19
|
+
const { logger: log } = createSmartEditLogger({ name: 'smart-edit.mcp' });
|
|
20
20
|
function unwrapZodObject(schema) {
|
|
21
21
|
if (!schema) {
|
|
22
22
|
return undefined;
|
|
@@ -202,9 +202,9 @@ function registerToolWithServer(server, options) {
|
|
|
202
202
|
registered.update({ outputSchema: options.outputSchema });
|
|
203
203
|
}
|
|
204
204
|
const serverWithTracking = server;
|
|
205
|
-
serverWithTracking.
|
|
205
|
+
serverWithTracking.__smartEditRegisteredTools ??= new Map();
|
|
206
206
|
const annotations = options.annotations && Object.keys(options.annotations).length > 0 ? options.annotations : undefined;
|
|
207
|
-
serverWithTracking.
|
|
207
|
+
serverWithTracking.__smartEditRegisteredTools.set(options.name, {
|
|
208
208
|
description: options.description,
|
|
209
209
|
annotations,
|
|
210
210
|
_meta: undefined,
|
|
@@ -212,18 +212,18 @@ function registerToolWithServer(server, options) {
|
|
|
212
212
|
});
|
|
213
213
|
return registered;
|
|
214
214
|
}
|
|
215
|
-
export class
|
|
215
|
+
export class SmartEditMCPFactory {
|
|
216
216
|
context;
|
|
217
217
|
project;
|
|
218
218
|
agent = null;
|
|
219
219
|
requestContext = null;
|
|
220
220
|
constructor(context = DEFAULT_CONTEXT, project = null) {
|
|
221
|
-
this.context =
|
|
221
|
+
this.context = SmartEditAgentContext.load(context);
|
|
222
222
|
this.project = project ?? null;
|
|
223
223
|
}
|
|
224
224
|
getAgent() {
|
|
225
225
|
if (!this.agent) {
|
|
226
|
-
throw new Error('
|
|
226
|
+
throw new Error('Smart-Edit agent has not been instantiated yet.');
|
|
227
227
|
}
|
|
228
228
|
return this.agent;
|
|
229
229
|
}
|
|
@@ -323,7 +323,7 @@ export class SerenaMCPFactory {
|
|
|
323
323
|
return names.map((name) => ({
|
|
324
324
|
uri: this.formatMemoryUri(name),
|
|
325
325
|
name,
|
|
326
|
-
description: '
|
|
326
|
+
description: 'Smart-Edit project memory entry',
|
|
327
327
|
mimeType: 'text/markdown'
|
|
328
328
|
}));
|
|
329
329
|
}
|
|
@@ -333,9 +333,9 @@ export class SerenaMCPFactory {
|
|
|
333
333
|
}
|
|
334
334
|
return [
|
|
335
335
|
{
|
|
336
|
-
name: '
|
|
337
|
-
uriTemplate: '
|
|
338
|
-
description: 'Template for accessing
|
|
336
|
+
name: 'smart-edit-memory',
|
|
337
|
+
uriTemplate: 'smart-edit://memory/{name}',
|
|
338
|
+
description: 'Template for accessing Smart-Edit project memory entries',
|
|
339
339
|
mimeType: 'text/markdown'
|
|
340
340
|
}
|
|
341
341
|
];
|
|
@@ -360,10 +360,10 @@ export class SerenaMCPFactory {
|
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
362
|
parseMemoryUri(uri) {
|
|
363
|
-
if (!uri.toLowerCase().startsWith('
|
|
363
|
+
if (!uri.toLowerCase().startsWith('smart-edit://memory/')) {
|
|
364
364
|
return null;
|
|
365
365
|
}
|
|
366
|
-
const suffix = uri.slice('
|
|
366
|
+
const suffix = uri.slice('smart-edit://memory/'.length);
|
|
367
367
|
if (!suffix) {
|
|
368
368
|
return null;
|
|
369
369
|
}
|
|
@@ -375,7 +375,7 @@ export class SerenaMCPFactory {
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
formatMemoryUri(name) {
|
|
378
|
-
return `
|
|
378
|
+
return `smart-edit://memory/${encodeURIComponent(name)}`;
|
|
379
379
|
}
|
|
380
380
|
async listMemories(manager) {
|
|
381
381
|
const listFn = this.bindManagerFunction(manager, ['listMemories', 'list_memories']);
|
|
@@ -474,9 +474,9 @@ export class SerenaMCPFactory {
|
|
|
474
474
|
: undefined;
|
|
475
475
|
const annotations = openAiToolCompatible
|
|
476
476
|
? {
|
|
477
|
-
'
|
|
478
|
-
...(inputJsonSchema ? { '
|
|
479
|
-
...(outputJsonSchema ? { '
|
|
477
|
+
'smart-edit/openaiToolCompatible': true,
|
|
478
|
+
...(inputJsonSchema ? { 'smart-edit/openaiToolInputSchema': inputJsonSchema } : {}),
|
|
479
|
+
...(outputJsonSchema ? { 'smart-edit/openaiToolOutputSchema': outputJsonSchema } : {})
|
|
480
480
|
}
|
|
481
481
|
: undefined;
|
|
482
482
|
const callback = async (args, extra) => {
|
|
@@ -552,7 +552,7 @@ export class SerenaMCPFactory {
|
|
|
552
552
|
}
|
|
553
553
|
createMcpServer(options = {}) {
|
|
554
554
|
try {
|
|
555
|
-
const config =
|
|
555
|
+
const config = SmartEditConfig.fromConfigFile();
|
|
556
556
|
if (options.enableWebDashboard !== undefined && options.enableWebDashboard !== null) {
|
|
557
557
|
config.webDashboard = options.enableWebDashboard;
|
|
558
558
|
}
|
|
@@ -571,9 +571,9 @@ export class SerenaMCPFactory {
|
|
|
571
571
|
config.toolTimeout = options.toolTimeout;
|
|
572
572
|
}
|
|
573
573
|
const modesInput = options.modes ? Array.from(options.modes) : Array.from(DEFAULT_MODES);
|
|
574
|
-
const modes = modesInput.map((mode) =>
|
|
574
|
+
const modes = modesInput.map((mode) => SmartEditAgentMode.load(mode));
|
|
575
575
|
const agent = this.instantiateAgent({
|
|
576
|
-
|
|
576
|
+
smartEditConfig: config,
|
|
577
577
|
modes
|
|
578
578
|
});
|
|
579
579
|
this.setAgent(agent);
|
|
@@ -606,7 +606,7 @@ const LOG_LEVEL_MAP = {
|
|
|
606
606
|
ERROR: 40,
|
|
607
607
|
CRITICAL: 50
|
|
608
608
|
};
|
|
609
|
-
export class
|
|
609
|
+
export class SmartEditMCPFactorySingleProcess extends SmartEditMCPFactory {
|
|
610
610
|
memoryLogHandler;
|
|
611
611
|
agentFactory;
|
|
612
612
|
cachedTools = null;
|
|
@@ -615,21 +615,21 @@ export class SerenaMCPFactorySingleProcess extends SerenaMCPFactory {
|
|
|
615
615
|
this.memoryLogHandler = options.memoryLogHandler ?? null;
|
|
616
616
|
this.agentFactory =
|
|
617
617
|
options.agentFactory ??
|
|
618
|
-
((factoryOptions) => new
|
|
618
|
+
((factoryOptions) => new SmartEditAgent({
|
|
619
619
|
project: factoryOptions.project,
|
|
620
|
-
|
|
620
|
+
smartEditConfig: factoryOptions.smartEditConfig,
|
|
621
621
|
context: factoryOptions.context,
|
|
622
622
|
modes: factoryOptions.modes,
|
|
623
623
|
memoryLogHandler: factoryOptions.memoryLogHandler ?? undefined
|
|
624
624
|
}));
|
|
625
625
|
}
|
|
626
|
-
instantiateAgent({
|
|
626
|
+
instantiateAgent({ smartEditConfig, modes }) {
|
|
627
627
|
if (!this.agentFactory) {
|
|
628
|
-
throw new Error('
|
|
628
|
+
throw new Error('SmartEditAgent factory not provided. Inject a factory via SmartEditMCPFactorySingleProcessOptions.agentFactory once the agent implementation is available.');
|
|
629
629
|
}
|
|
630
630
|
const agent = this.agentFactory({
|
|
631
631
|
project: this.project,
|
|
632
|
-
|
|
632
|
+
smartEditConfig,
|
|
633
633
|
context: this.context,
|
|
634
634
|
modes,
|
|
635
635
|
memoryLogHandler: this.memoryLogHandler
|
|
@@ -710,7 +710,7 @@ function respondWithJson(res, statusCode, body) {
|
|
|
710
710
|
});
|
|
711
711
|
res.end(JSON.stringify(body));
|
|
712
712
|
}
|
|
713
|
-
export function
|
|
713
|
+
export function createSmartEditHttpRequestHandler({ transport, path, defaultHost }) {
|
|
714
714
|
const normalizedPath = normalizeHttpPath(path);
|
|
715
715
|
const fallbackHost = defaultHost ?? '127.0.0.1';
|
|
716
716
|
return async (req, res) => {
|
|
@@ -793,7 +793,7 @@ function deriveServerUrl(address, path, fallbackHost) {
|
|
|
793
793
|
const resolvedHost = host === '::' || host === '0.0.0.0' ? fallbackHost : host;
|
|
794
794
|
return new NodeURL(`http://${resolvedHost}:${address.port}${path}`);
|
|
795
795
|
}
|
|
796
|
-
export async function
|
|
796
|
+
export async function createSmartEditHttpServer(factory, options = {}) {
|
|
797
797
|
const host = options.host ?? '127.0.0.1';
|
|
798
798
|
const port = options.port ?? 0;
|
|
799
799
|
const path = normalizeHttpPath(options.path);
|
|
@@ -807,7 +807,7 @@ export async function createSerenaHttpServer(factory, options = {}) {
|
|
|
807
807
|
});
|
|
808
808
|
const mcpServer = factory.createMcpServer(options);
|
|
809
809
|
await mcpServer.connect(httpTransport);
|
|
810
|
-
const handler =
|
|
810
|
+
const handler = createSmartEditHttpRequestHandler({
|
|
811
811
|
transport: httpTransport,
|
|
812
812
|
path,
|
|
813
813
|
defaultHost: host
|
|
@@ -829,7 +829,7 @@ export async function createSerenaHttpServer(factory, options = {}) {
|
|
|
829
829
|
}
|
|
830
830
|
};
|
|
831
831
|
}
|
|
832
|
-
class
|
|
832
|
+
class SmartEditStdioServerTransport extends StdioServerTransport {
|
|
833
833
|
stdin;
|
|
834
834
|
handleStreamEnd;
|
|
835
835
|
handleStreamClose;
|
|
@@ -881,8 +881,8 @@ class SerenaStdioServerTransport extends StdioServerTransport {
|
|
|
881
881
|
this.onerror?.(new Error(message));
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
export async function
|
|
885
|
-
const transport = new
|
|
884
|
+
export async function createSmartEditStdioServer(factory, options = {}) {
|
|
885
|
+
const transport = new SmartEditStdioServerTransport();
|
|
886
886
|
const mcpServer = factory.createMcpServer(options);
|
|
887
887
|
await mcpServer.connect(transport);
|
|
888
888
|
return {
|
|
@@ -893,12 +893,12 @@ export async function createSerenaStdioServer(factory, options = {}) {
|
|
|
893
893
|
}
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
|
-
export async function
|
|
896
|
+
export async function createSmartEditGrpcServer(_factory, _options = {}) {
|
|
897
897
|
try {
|
|
898
898
|
await import('@grpc/grpc-js');
|
|
899
899
|
}
|
|
900
900
|
catch (error) {
|
|
901
|
-
throw new Error('gRPCトランスポートPoCは未実装です。@grpc/grpc-js を導入後に
|
|
901
|
+
throw new Error('gRPCトランスポートPoCは未実装です。@grpc/grpc-js を導入後に createSmartEditGrpcServer を拡張してください。', { cause: error });
|
|
902
902
|
}
|
|
903
|
-
throw new Error('gRPCトランスポートPoCは未実装です。HTTPモードのPoCは
|
|
903
|
+
throw new Error('gRPCトランスポートPoCは未実装です。HTTPモードのPoCは createSmartEditHttpServer を利用してください。');
|
|
904
904
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type PathMatcher } from './util/file_system.js';
|
|
2
2
|
import { MatchedConsecutiveLines } from './text_utils.js';
|
|
3
|
-
import { ProjectConfig, type ProjectLike } from './config/
|
|
4
|
-
import {
|
|
5
|
-
import type { Language } from '../
|
|
3
|
+
import { ProjectConfig, type ProjectLike } from './config/smart_edit_config.js';
|
|
4
|
+
import { SmartLanguageServer } from '../smart-lsp/ls.js';
|
|
5
|
+
import type { Language } from '../smart-lsp/ls_config.js';
|
|
6
6
|
export interface ProjectSearchOptions {
|
|
7
7
|
pattern: string;
|
|
8
8
|
relative_path?: string;
|
|
@@ -33,8 +33,8 @@ export declare class Project implements ProjectLike {
|
|
|
33
33
|
get projectName(): string;
|
|
34
34
|
get project_name(): string;
|
|
35
35
|
get language(): Language;
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
pathToSmartEditDataFolder(): string;
|
|
37
|
+
path_to_smart_edit_data_folder(): string;
|
|
38
38
|
pathToProjectYml(): string;
|
|
39
39
|
path_to_project_yml(): string;
|
|
40
40
|
readFile(relativePath: string): string;
|
|
@@ -55,8 +55,8 @@ export declare class Project implements ProjectLike {
|
|
|
55
55
|
search_source_files_for_pattern(pattern: string, relative_path?: string, context_lines_before?: number, context_lines_after?: number, paths_include_glob?: string, paths_exclude_glob?: string): MatchedConsecutiveLines[];
|
|
56
56
|
retrieveContentAroundLine(relativeFilePath: string, line: number, contextLinesBefore?: number, contextLinesAfter?: number): MatchedConsecutiveLines;
|
|
57
57
|
retrieve_content_around_line(relative_file_path: string, line: number, context_lines_before?: number, context_lines_after?: number): MatchedConsecutiveLines;
|
|
58
|
-
createLanguageServer(options: CreateLanguageServerOptions):
|
|
59
|
-
private
|
|
58
|
+
createLanguageServer(options: CreateLanguageServerOptions): SmartLanguageServer;
|
|
59
|
+
private ensureSmartEditDataGitignore;
|
|
60
60
|
private _isIgnoredRelativePath;
|
|
61
61
|
private resolveLanguageMatcher;
|
|
62
62
|
}
|
|
@@ -2,14 +2,14 @@ import { Buffer } from 'node:buffer';
|
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import ignore from 'ignore';
|
|
5
|
-
import {
|
|
5
|
+
import { createSmartEditLogger } from './util/logging.js';
|
|
6
6
|
import { GitignoreParser, matchPath } from './util/file_system.js';
|
|
7
7
|
import { MatchedConsecutiveLines, searchFiles } from './text_utils.js';
|
|
8
|
-
import { DEFAULT_TOOL_TIMEOUT, ProjectConfig } from './config/
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { getLanguageFilenameMatcher } from '../
|
|
12
|
-
const { logger: log } =
|
|
8
|
+
import { DEFAULT_TOOL_TIMEOUT, ProjectConfig } from './config/smart_edit_config.js';
|
|
9
|
+
import { SMART_EDIT_MANAGED_DIR_IN_HOME, SMART_EDIT_MANAGED_DIR_NAME } from './constants.js';
|
|
10
|
+
import { SmartLanguageServer } from '../smart-lsp/ls.js';
|
|
11
|
+
import { getLanguageFilenameMatcher } from '../smart-lsp/ls_config.js';
|
|
12
|
+
const { logger: log } = createSmartEditLogger({ name: 'smart-edit.project', emitToConsole: true, level: 'info' });
|
|
13
13
|
class IgnoreMatcher {
|
|
14
14
|
engine;
|
|
15
15
|
constructor(patterns) {
|
|
@@ -60,7 +60,7 @@ export class Project {
|
|
|
60
60
|
this.projectRoot = path.resolve(init.projectRoot);
|
|
61
61
|
this.projectConfig = init.projectConfig;
|
|
62
62
|
this.isNewlyCreated = init.isNewlyCreated ?? false;
|
|
63
|
-
this.
|
|
63
|
+
this.ensureSmartEditDataGitignore();
|
|
64
64
|
const patterns = new Set();
|
|
65
65
|
for (const pattern of this.projectConfig.ignoredPaths) {
|
|
66
66
|
if (pattern) {
|
|
@@ -97,11 +97,11 @@ export class Project {
|
|
|
97
97
|
get language() {
|
|
98
98
|
return this.projectConfig.language;
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
return path.join(this.projectRoot,
|
|
100
|
+
pathToSmartEditDataFolder() {
|
|
101
|
+
return path.join(this.projectRoot, SMART_EDIT_MANAGED_DIR_NAME);
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
return this.
|
|
103
|
+
path_to_smart_edit_data_folder() {
|
|
104
|
+
return this.pathToSmartEditDataFolder();
|
|
105
105
|
}
|
|
106
106
|
pathToProjectYml() {
|
|
107
107
|
return path.join(this.projectRoot, ProjectConfig.relPathToProjectYml());
|
|
@@ -265,28 +265,28 @@ export class Project {
|
|
|
265
265
|
}
|
|
266
266
|
createLanguageServer(options) {
|
|
267
267
|
const lsTimeout = options.lsTimeout === undefined ? DEFAULT_TOOL_TIMEOUT - 5 : options.lsTimeout;
|
|
268
|
-
return
|
|
268
|
+
return SmartLanguageServer.create({
|
|
269
269
|
codeLanguage: this.projectConfig.language,
|
|
270
270
|
traceLspCommunication: options.traceLspCommunication,
|
|
271
271
|
startIndependentLspProcess: true,
|
|
272
272
|
ignoredPaths: this.projectConfig.ignoredPaths
|
|
273
273
|
}, { level: options.logLevel }, this.projectRoot, {
|
|
274
274
|
timeout: lsTimeout,
|
|
275
|
-
|
|
275
|
+
smartLspSettings: {
|
|
276
276
|
lsSpecificSettings: options.lsSpecificSettings ?? {},
|
|
277
|
-
|
|
278
|
-
projectDataRelativePath:
|
|
277
|
+
smartLspDir: SMART_EDIT_MANAGED_DIR_IN_HOME,
|
|
278
|
+
projectDataRelativePath: SMART_EDIT_MANAGED_DIR_NAME
|
|
279
279
|
}
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
|
-
|
|
283
|
-
const gitignorePath = path.join(this.
|
|
282
|
+
ensureSmartEditDataGitignore() {
|
|
283
|
+
const gitignorePath = path.join(this.pathToSmartEditDataFolder(), '.gitignore');
|
|
284
284
|
if (fs.existsSync(gitignorePath)) {
|
|
285
285
|
return;
|
|
286
286
|
}
|
|
287
287
|
ensureDirectoryExists(path.dirname(gitignorePath));
|
|
288
288
|
log.info(`Creating .gitignore file in ${gitignorePath}`);
|
|
289
|
-
fs.writeFileSync(gitignorePath, `/${
|
|
289
|
+
fs.writeFileSync(gitignorePath, `/${SmartLanguageServer.CACHE_FOLDER_NAME}\n`, {
|
|
290
290
|
encoding: 'utf-8'
|
|
291
291
|
});
|
|
292
292
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PromptFactory, type CreateOnboardingPromptParams, type CreateSystemPromptParams } from './generated/generated_prompt_factory.js';
|
|
2
2
|
import type { PromptFactoryBaseOptions } from '../interprompt/prompt_factory.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface SmartEditPromptFactoryOptions extends Partial<PromptFactoryBaseOptions> {
|
|
4
4
|
userPromptDir?: string;
|
|
5
5
|
internalPromptDir?: string;
|
|
6
6
|
}
|
|
7
7
|
export type CreateSystemPromptOptions = CreateSystemPromptParams;
|
|
8
8
|
export type CreateOnboardingPromptOptions = CreateOnboardingPromptParams;
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class SmartEditPromptFactory extends PromptFactory {
|
|
10
10
|
private readonly searchDirectories;
|
|
11
|
-
constructor(options?:
|
|
11
|
+
constructor(options?: SmartEditPromptFactoryOptions);
|
|
12
12
|
getPromptDirectories(): string[];
|
|
13
13
|
createSystemPrompt(options: CreateSystemPromptOptions): string;
|
|
14
14
|
listPromptTemplateNames(): string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import { PROMPT_TEMPLATES_DIR_IN_USER_HOME, PROMPT_TEMPLATES_DIR_INTERNAL } from './constants.js';
|
|
3
3
|
import { PromptFactory } from './generated/generated_prompt_factory.js';
|
|
4
|
-
export class
|
|
4
|
+
export class SmartEditPromptFactory extends PromptFactory {
|
|
5
5
|
searchDirectories;
|
|
6
6
|
constructor(options = {}) {
|
|
7
7
|
const userPromptDir = options.userPromptDir ?? PROMPT_TEMPLATES_DIR_IN_USER_HOME;
|
|
@@ -7,10 +7,10 @@ prompt: |
|
|
|
7
7
|
Don't attempt to use any excluded tools, instead rely on your own internal tools
|
|
8
8
|
for achieving the basic file or shell operations.
|
|
9
9
|
|
|
10
|
-
If
|
|
10
|
+
If smart-edit's tools can be used for achieving your task,
|
|
11
11
|
you should prioritize them. In particular, it is important that you avoid reading entire source code files,
|
|
12
12
|
unless it is strictly necessary! Instead, for exploring and reading code in a token-efficient manner,
|
|
13
|
-
you should use
|
|
13
|
+
you should use smart-edit's overview and symbolic search tools. The call of the read_file tool on an entire source code
|
|
14
14
|
file should only happen in exceptional cases, usually you should first explore the file (by itself or as part of exploring
|
|
15
15
|
the directory containing it) using the symbol_overview tool, and then make targeted reads using find_symbol and other symbolic tools.
|
|
16
16
|
For non-code files or for reads where you don't know the symbol's name path you can use the patterns searching tool,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# See
|
|
1
|
+
# See Smart-Edit's documentation for more details on concept of contexts.
|
|
2
2
|
description: Description of the context, not used in the code.
|
|
3
3
|
prompt: Prompt that will form part of the system prompt/initial instructions for agents started in this context.
|
|
4
4
|
excluded_tools: []
|
|
@@ -7,10 +7,10 @@ prompt: |
|
|
|
7
7
|
Don't attempt to use any excluded tools, instead rely on your own internal tools
|
|
8
8
|
for achieving the basic file or shell operations.
|
|
9
9
|
|
|
10
|
-
If
|
|
10
|
+
If smart-edit's tools can be used for achieving your task,
|
|
11
11
|
you should prioritize them. In particular, it is important that you avoid reading entire source code files,
|
|
12
12
|
unless it is strictly necessary! Instead, for exploring and reading code in a token-efficient manner,
|
|
13
|
-
you should use
|
|
13
|
+
you should use smart-edit's overview and symbolic search tools.
|
|
14
14
|
Before reading a full file, it is usually best to first explore the file using the symbol_overview tool,
|
|
15
15
|
and then make targeted reads using find_symbol and other symbolic tools.
|
|
16
16
|
For non-code files or for reads where you don't know the symbol's name path, you can use the pattern searching tool,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# See
|
|
1
|
+
# See Smart-Edit's documentation for more details on concept of modes.
|
|
2
2
|
description: Description of the mode, not used in the code.
|
|
3
3
|
prompt: Prompt that will form part of the message sent to the model when activating this mode.
|
|
4
4
|
excluded_tools: []
|
package/dist/{serena → smart-edit}/resources/config/prompt_templates/simple_tool_outputs.yml
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Some of
|
|
1
|
+
# Some of Smart-Edit's tools are just outputting a fixed text block without doing anything else.
|
|
2
2
|
# Such tools are meant to encourage the agent to think in a certain way, to stay on track
|
|
3
3
|
# and so on. The (templates for) outputs of these tools are contained here.
|
|
4
4
|
prompts:
|