@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
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# Smart Edit
|
|
2
2
|
|
|
3
|
-
Smart Edit は、
|
|
3
|
+
Smart Edit は、TypeScript / Node.js 上で動作する MCP (Model Context Protocol) サーバーです。SmartLSP ベースの言語サーバー管理や Smart-Edit 固有のツール群を TypeScript で実装しています。
|
|
4
4
|
|
|
5
5
|
## 主な構成
|
|
6
6
|
|
|
7
|
-
| ディレクトリ / ファイル
|
|
8
|
-
|
|
|
9
|
-
| `src/
|
|
10
|
-
| `src/
|
|
11
|
-
| `src/
|
|
12
|
-
| `test/`
|
|
13
|
-
| `docs/`
|
|
14
|
-
| `tsconfig*.json`
|
|
7
|
+
| ディレクトリ / ファイル | 概要 |
|
|
8
|
+
| -------------------------- | ----------------------------------------------------------- |
|
|
9
|
+
| `src/smart-edit` | エージェント本体、CLI、各種ツール・コンフィグ周りのロジック |
|
|
10
|
+
| `src/smart-lsp` | SmartLSP 連携と言語サーバーごとのランタイム管理実装 |
|
|
11
|
+
| `src/smart-edit/resources` | Smart-Edit が自動生成・参照する YAML テンプレート群 |
|
|
12
|
+
| `test/` | Vitest によるユニットテスト・スモークテスト |
|
|
13
|
+
| `docs/` | 言語サーバー対応状況などの資料 |
|
|
14
|
+
| `tsconfig*.json` | ビルド・テスト・Lint 用 TypeScript 設定 |
|
|
15
15
|
|
|
16
16
|
## 環境要件
|
|
17
17
|
|
|
18
18
|
- Node.js >= 20.11.0
|
|
19
|
-
- pnpm (推奨:
|
|
19
|
+
- pnpm (推奨: v9 以降)
|
|
20
20
|
- macOS / Linux / Windows に対応(Windows では `ensureDefaultSubprocessOptions` により `windowsHide` などを自動付与)
|
|
21
21
|
- 言語サーバーの一部は追加のランタイム(`nix`, `rustup`, `gem`, `dotnet`, `go` など)や外部コマンドを必要とします
|
|
22
22
|
|
|
@@ -28,58 +28,82 @@ pnpm install
|
|
|
28
28
|
pnpm build
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
`pnpm build` を実行すると TypeScript のトランスパイルに加えて `src/
|
|
31
|
+
`pnpm build` を実行すると TypeScript のトランスパイルに加えて `src/smart-edit/resources/` 以下の YAML テンプレート類も `dist/smart-edit/resources/` にコピーされ、`npx` 経由で配布した際にもコンテキスト定義が参照できるようになります。
|
|
32
32
|
|
|
33
|
-
テストや開発時に外部バイナリのダウンロードを抑止したい場合は、`
|
|
33
|
+
テストや開発時に外部バイナリのダウンロードを抑止したい場合は、`SMART_EDIT_SKIP_RUNTIME_INSTALL=1` を設定してください。
|
|
34
34
|
|
|
35
35
|
## 開発用コマンド
|
|
36
36
|
|
|
37
|
-
| コマンド
|
|
38
|
-
|
|
|
39
|
-
| `pnpm lint`
|
|
40
|
-
| `pnpm test`
|
|
41
|
-
| `pnpm typecheck`
|
|
42
|
-
| `pnpm build`
|
|
43
|
-
| `pnpm format` / `pnpm format:check` | Prettier による整形
|
|
37
|
+
| コマンド | 説明 |
|
|
38
|
+
| ----------------------------------- | ---------------------------------- |
|
|
39
|
+
| `pnpm lint` | ESLint による静的解析 |
|
|
40
|
+
| `pnpm test` | Vitest 実行(ユニット / スモーク) |
|
|
41
|
+
| `pnpm typecheck` | `tsc --noEmit` での型検証 |
|
|
42
|
+
| `pnpm build` | 生成物を `dist/` に出力 |
|
|
43
|
+
| `pnpm format` / `pnpm format:check` | Prettier による整形 |
|
|
44
44
|
|
|
45
45
|
## ユーザーガイド
|
|
46
46
|
|
|
47
|
-
CLI
|
|
47
|
+
CLI は npm パッケージとして公開されており、`npx` または `node dist/cli.js` で呼び出します。
|
|
48
|
+
|
|
49
|
+
### CLI の呼び出し方法
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# npm パッケージを利用する場合(推奨)
|
|
53
|
+
npx @nogataka/smart-edit smart-edit <command>
|
|
54
|
+
|
|
55
|
+
# ローカル開発時
|
|
56
|
+
node dist/cli.js <command>
|
|
57
|
+
# または
|
|
58
|
+
pnpm exec tsx src/smart-edit/cli.ts <command>
|
|
59
|
+
```
|
|
48
60
|
|
|
49
61
|
### 1. 初期設定フロー
|
|
50
62
|
|
|
51
63
|
1. **smart-edit 管理ディレクトリの生成**
|
|
52
64
|
```bash
|
|
53
|
-
|
|
65
|
+
npx @nogataka/smart-edit smart-edit config edit
|
|
54
66
|
```
|
|
55
|
-
初回実行時は `~/.smart-edit/
|
|
67
|
+
初回実行時は `~/.smart-edit/smart_edit_config.yml` をテンプレートから生成し、既定エディタで開きます。
|
|
56
68
|
|
|
57
69
|
2. **プロジェクト設定 (project.yml) の生成**
|
|
58
70
|
```bash
|
|
59
|
-
|
|
71
|
+
npx @nogataka/smart-edit smart-edit project generate-yml /path/to/project
|
|
60
72
|
```
|
|
61
73
|
言語を手動指定したい場合は `--language <lang>` を付与します。生成された YAML をプロジェクトルートに配置してください。
|
|
62
74
|
|
|
63
75
|
3. **モード / コンテキストの確認とカスタマイズ**
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
|
|
76
|
+
```bash
|
|
77
|
+
# 一覧表示
|
|
78
|
+
npx @nogataka/smart-edit smart-edit mode list
|
|
79
|
+
npx @nogataka/smart-edit smart-edit context list
|
|
80
|
+
|
|
81
|
+
# テンプレートからコピー
|
|
82
|
+
npx @nogataka/smart-edit smart-edit mode create --from-internal default-editor
|
|
83
|
+
|
|
84
|
+
# 編集 / 削除
|
|
85
|
+
npx @nogataka/smart-edit smart-edit mode edit <name>
|
|
86
|
+
npx @nogataka/smart-edit smart-edit context delete <name>
|
|
87
|
+
```
|
|
69
88
|
|
|
70
89
|
4. **プロンプトテンプレートの更新**
|
|
71
|
-
独自プロンプトを用意する場合は、`src/
|
|
90
|
+
独自プロンプトを用意する場合は、`src/smart-edit/resources/prompt_templates/` 以下のテンプレートを `~/.smart-edit/prompt_templates/` にコピーして編集し、`prompts` グループコマンドで管理します。
|
|
72
91
|
|
|
73
92
|
### 2. MCP サーバーの起動
|
|
74
93
|
|
|
75
94
|
```bash
|
|
76
|
-
|
|
95
|
+
npx @nogataka/smart-edit smart-edit start-mcp-server \
|
|
77
96
|
--project /path/to/project \
|
|
78
97
|
--context ide-assistant \
|
|
79
98
|
--mode default-editor \
|
|
80
99
|
--transport stdio
|
|
81
100
|
```
|
|
82
101
|
|
|
102
|
+
ランタイムの自動インストールをスキップする場合は環境変数を設定します:
|
|
103
|
+
```bash
|
|
104
|
+
SMART_EDIT_SKIP_RUNTIME_INSTALL=1 npx @nogataka/smart-edit smart-edit start-mcp-server ...
|
|
105
|
+
```
|
|
106
|
+
|
|
83
107
|
主なオプション:
|
|
84
108
|
|
|
85
109
|
- `--transport`: `stdio` (既定) / `sse` / `streamable-http` から選択
|
|
@@ -90,6 +114,21 @@ SERENA_SKIP_RUNTIME_INSTALL=1 pnpm exec tsx src/serena/cli.ts start-mcp-server \
|
|
|
90
114
|
|
|
91
115
|
サーバー起動後は、必要に応じてダッシュボード (`--enable-web-dashboard`) や GUI ログビューア (`--enable-gui-log-window`) を利用できます。GUI ログは `GuiLogViewer` 経由でブラウザが自動起動し、`logs/` ディレクトリにも出力されます。
|
|
92
116
|
|
|
117
|
+
#### Web ダッシュボード機能
|
|
118
|
+
|
|
119
|
+
ダッシュボードは以下の機能を提供します:
|
|
120
|
+
|
|
121
|
+
| タブ | 機能 |
|
|
122
|
+
| ---------- | ---------------------------------------------------------------------- |
|
|
123
|
+
| Dashboard | プロジェクト概要、リアルタイムメトリクス、最近のアクティビティ |
|
|
124
|
+
| Logs | ログ検索・フィルタ(レベル別、ツール名別)、リアルタイムストリーミング |
|
|
125
|
+
| Statistics | API 呼び出し統計、トークン使用量チャート、ライブカウンター |
|
|
126
|
+
| Sessions | セッション履歴、JSON エクスポート、過去セッション比較 |
|
|
127
|
+
|
|
128
|
+
- ダークモード / ライトモード切替対応
|
|
129
|
+
- サイドバーナビゲーション(折りたたみ可能)
|
|
130
|
+
- モバイルレスポンシブ対応
|
|
131
|
+
|
|
93
132
|
#### MCP クライアント(Codex など)からの接続例
|
|
94
133
|
|
|
95
134
|
`npx` で公開パッケージを取得する場合、`mcp_servers.toml` の設定キーを `smart-edit` に合わせてください。
|
|
@@ -104,34 +143,82 @@ CLI 側の `--context` や `--mode` は必要に応じて追加してくださ
|
|
|
104
143
|
|
|
105
144
|
### 3. プロジェクト / ツール管理
|
|
106
145
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
- `project` グループのその他サブコマンド (`index`, `health-check` など) は現時点では未実装であり、実装予定時期を CLI がメッセージとして返します。
|
|
111
|
-
|
|
112
|
-
### 4. 主要な環境変数
|
|
113
|
-
|
|
114
|
-
| 変数 | 用途 |
|
|
115
|
-
| --- | --- |
|
|
116
|
-
| `SERENA_SKIP_RUNTIME_INSTALL` | `1` の場合、言語サーバーなど外部バイナリの自動インストールをスキップ |
|
|
117
|
-
| `SERENA_ASSUME_<LANG>` | 各言語サーバーで既存ランタイムを仮定(例: `SERENA_ASSUME_GOPLS`, `SERENA_ASSUME_NIXD`, `SERENA_ASSUME_SOURCEKIT`)|
|
|
118
|
-
| `SERENA_<LANG>_PATH` | バイナリパスの明示指定(例: `SERENA_RUBY_BINARY`, `SERENA_ZLS_PATH`)|
|
|
119
|
-
| `EDITOR` | `mode edit` 等で使用する既定エディタ |
|
|
120
|
-
| `SERENA_SKIP_EDITOR` | `1` の場合、CLI が自動でエディタを開かない |
|
|
121
|
-
|
|
122
|
-
環境変数の完全な一覧や詳細は `src/solidlsp/language_servers/*.ts` および `src/serena/config/*.ts` を参照してください。
|
|
146
|
+
```bash
|
|
147
|
+
# プロジェクト設定 YAML の生成
|
|
148
|
+
npx @nogataka/smart-edit smart-edit project generate-yml /path/to/project
|
|
123
149
|
|
|
124
|
-
|
|
150
|
+
# 有効化されているツールを確認
|
|
151
|
+
npx @nogataka/smart-edit smart-edit tools list
|
|
125
152
|
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
153
|
+
# ツールごとの説明を表示
|
|
154
|
+
npx @nogataka/smart-edit smart-edit tools list
|
|
155
|
+
```
|
|
129
156
|
|
|
130
|
-
|
|
157
|
+
### 4. メモリ機能
|
|
158
|
+
|
|
159
|
+
Smart Edit はプロジェクト固有のメモリ機能を提供します。AI エージェントがプロジェクトに関する情報を永続的に保存・参照できます。
|
|
160
|
+
|
|
161
|
+
| ツール | 説明 |
|
|
162
|
+
| -------------- | -------------------------- |
|
|
163
|
+
| `WriteMemory` | 名前付きメモリを保存 |
|
|
164
|
+
| `ReadMemory` | メモリの内容を読み込み |
|
|
165
|
+
| `ListMemories` | 保存済みメモリの一覧を取得 |
|
|
166
|
+
| `DeleteMemory` | メモリを削除 |
|
|
167
|
+
|
|
168
|
+
- 保存場所: `{プロジェクトルート}/.smart-edit/memories/`
|
|
169
|
+
- 形式: Markdown ファイル(`.md`)
|
|
170
|
+
- セッション間で完全に永続化(IDE 再起動、PC 再起動後も保持)
|
|
171
|
+
- プロジェクトごとに独立(他プロジェクトとは共有されない)
|
|
172
|
+
|
|
173
|
+
### 5. 主要な環境変数
|
|
174
|
+
|
|
175
|
+
| 変数 | 用途 |
|
|
176
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
177
|
+
| `SMART_EDIT_SKIP_RUNTIME_INSTALL` | `1` の場合、言語サーバーなど外部バイナリの自動インストールをスキップ |
|
|
178
|
+
| `SMART_EDIT_ASSUME_<LANG>` | 各言語サーバーで既存ランタイムを仮定(例: `SMART_EDIT_ASSUME_GOPLS`, `SMART_EDIT_ASSUME_NIXD`, `SMART_EDIT_ASSUME_SOURCEKIT`) |
|
|
179
|
+
| `SMART_EDIT_<LANG>_PATH` | バイナリパスの明示指定(例: `SMART_EDIT_RUBY_BINARY`, `SMART_EDIT_ZLS_PATH`) |
|
|
180
|
+
| `EDITOR` | `mode edit` 等で使用する既定エディタ |
|
|
181
|
+
| `SMART_EDIT_SKIP_EDITOR` | `1` の場合、CLI が自動でエディタを開かない |
|
|
182
|
+
|
|
183
|
+
環境変数の完全な一覧や詳細は `src/smart-lsp/language_servers/*.ts` および `src/smart-edit/config/*.ts` を参照してください。
|
|
184
|
+
|
|
185
|
+
### 6. 言語サーバー対応状況
|
|
186
|
+
|
|
187
|
+
以下の言語サーバーに対応しています:
|
|
188
|
+
|
|
189
|
+
| 言語 | サーバー | バージョン | ダウンロード元 | 備考 |
|
|
190
|
+
| ----------------------- | -------------------------- | -------------------- | --------------------------------- | ---------------------------------- |
|
|
191
|
+
| Bash | bash-language-server | 5.6.0 | npm | Node.js 20 以上必須 |
|
|
192
|
+
| C / C++ | clangd | 19.1.2 | GitHub Releases | LLVM プロジェクト |
|
|
193
|
+
| C# | csharp-language-server | 5.0.0-1.25329.6 | NuGet | .NET ランタイム必要 |
|
|
194
|
+
| Clojure | clojure-lsp | latest | GitHub Releases | Clojure 開発環境 |
|
|
195
|
+
| Dart | Dart SDK | 3.10.4 | Google Storage | Flutter SDK に同梱 |
|
|
196
|
+
| Erlang | erlang_ls | (PATH 検出) | 外部インストール | Erlang/OTP ランタイム必要 |
|
|
197
|
+
| Go | gopls | latest | `go install` | 公式 Go チームによる実装 |
|
|
198
|
+
| Java | Eclipse JDT.LS | 1.42.0 | GitHub (vscode-java) | Java 21 以上必須 |
|
|
199
|
+
| Kotlin | kotlin-language-server | 0.253.10629 | JetBrains CDN | JVM ランタイム必要 |
|
|
200
|
+
| Lua | lua-language-server | 3.15.0 | GitHub Releases | Lua 5.1〜5.5、LuaJIT 対応 |
|
|
201
|
+
| Nix | nixd | (PATH / nix profile) | 外部インストール | Nix 式のサポート |
|
|
202
|
+
| PHP | Intelephense | 1.16.4 | npm | 高機能 PHP サーバー |
|
|
203
|
+
| Python | Jedi Language Server | (PyPI) | pip | 軽量・高速 |
|
|
204
|
+
| Python | Pyright | (PyPI) | pip | Microsoft 製・型チェック強化 |
|
|
205
|
+
| R | R Language Server | (CRAN) | R package | CRAN パッケージ |
|
|
206
|
+
| Ruby | Ruby LSP | (gem) | RubyGems | Shopify 製・高速 |
|
|
207
|
+
| Ruby | Solargraph | (gem) | RubyGems | 従来からの定番 |
|
|
208
|
+
| Rust | rust-analyzer | (rustup) | rustup component | 公式推奨 |
|
|
209
|
+
| Swift | SourceKit-LSP | (PATH 検出) | Xcode / Swift Toolchain | Apple 公式 |
|
|
210
|
+
| Terraform | terraform-ls | 0.38.3 | HashiCorp Releases | HashiCorp 公式、Actions block 対応 |
|
|
211
|
+
| TypeScript / JavaScript | typescript-language-server | 5.1.3 (TS 5.9.3) | npm | tsserver ラッパー |
|
|
212
|
+
| Vue | VTS (Volar) | 0.3.0 | npm (@vtsls/language-server) | Vue 3 対応、TS 必須 |
|
|
213
|
+
| Zig | zls | (PATH 検出) | 外部インストール | Zig 公式 |
|
|
214
|
+
|
|
215
|
+
**除外**: AL Language Server, elixir_tools, OmniSharp(TypeScript 版では対象外)
|
|
216
|
+
|
|
217
|
+
**バージョン更新日**: 2026-02-01
|
|
131
218
|
|
|
132
219
|
### Claude Code への接続手順
|
|
133
220
|
|
|
134
|
-
Claude Code ではプロジェクトごとに MCP サーバーを追加します。smart-edit
|
|
221
|
+
Claude Code ではプロジェクトごとに MCP サーバーを追加します。smart-edit を使う場合の手順は以下の通りです。
|
|
135
222
|
|
|
136
223
|
1. プロジェクトのルートディレクトリで次のコマンドを実行します。
|
|
137
224
|
```bash
|
|
@@ -148,7 +235,7 @@ Claude Code ではプロジェクトごとに MCP サーバーを追加します
|
|
|
148
235
|
|
|
149
236
|
4. コンテキストやモードをカスタマイズしたい場合は、`~/.smart-edit/context/` 配下に YAML を配置した上で `--context` / `--mode` オプションで指定できます。
|
|
150
237
|
|
|
151
|
-
### Codex
|
|
238
|
+
### Codex CLI への接続手順
|
|
152
239
|
|
|
153
240
|
Codex CLI はグローバル設定で MCP サーバーを追加します。`~/.codex/config.toml` に以下のエントリを追加してください。
|
|
154
241
|
|
|
@@ -225,20 +312,10 @@ Claude Desktop の MCP 設定については [公式クイックスタート](ht
|
|
|
225
312
|
|
|
226
313
|
## トラブルシューティング
|
|
227
314
|
|
|
228
|
-
- 言語サーバーのダウンロードが失敗する場合: ネットワーク設定を確認し、必要に応じて `
|
|
229
|
-
- macOS で `pnpm test` 実行時に `EPERM: operation not permitted, listen` が発生する場合: `sudo` での実行か、環境ポート (`
|
|
230
|
-
- Windows でコンソールウィンドウが一瞬開く場合: 既に `ensureDefaultSubprocessOptions` が `windowsHide` を設定しますが、`
|
|
231
|
-
|
|
232
|
-
## 参考ドキュメント
|
|
233
|
-
|
|
234
|
-
- `docs/ts_port_implementation_plan.md`: TypeScript 移植全体の方針と決定事項
|
|
235
|
-
- `docs/ts_port_task_tracker.md`: サブタスク進捗・言語サーバー対応表
|
|
236
|
-
- `docs/lsp_server_execution_methods.md` ほか: SolidLSP 周辺仕様の補足資料
|
|
237
|
-
|
|
238
|
-
ドキュメントとコードは常に同期させる方針です。新しい機能やタスクを追加した際は、README と `docs/` の両方を更新してください。
|
|
315
|
+
- 言語サーバーのダウンロードが失敗する場合: ネットワーク設定を確認し、必要に応じて `SMART_EDIT_ASSUME_<LANG>` でローカルバイナリを指示します。
|
|
316
|
+
- macOS で `pnpm test` 実行時に `EPERM: operation not permitted, listen` が発生する場合: `sudo` での実行か、環境ポート (`SMART_EDIT_DASHBOARD_PORT` など) の明示指定をご検討ください。
|
|
317
|
+
- Windows でコンソールウィンドウが一瞬開く場合: 既に `ensureDefaultSubprocessOptions` が `windowsHide` を設定しますが、`SMART_EDIT_VERBOSE_PROCESS=1` を付与すると詳細ログで状況確認ができます。
|
|
239
318
|
|
|
240
319
|
## ライセンス
|
|
241
320
|
|
|
242
321
|
- 本リポジトリ(smart-edit)は MIT ライセンスで提供されます。詳細は [`LICENSE`](./LICENSE) を参照してください。
|
|
243
|
-
- Serena の Python 版 (<https://github.com/oraios/serena>) も MIT ライセンスで公開されています。本 TypeScript ポートは Python 版の実装・ドキュメントをベースに再構築しており、オリジナルの著作権表示(Oraios AI)を含めた形で継承しています。
|
|
244
|
-
- smart-edit への追加実装分は「smart-edit contributors」として明記しています。コントリビューションの際は、MIT ライセンスの条件に同意の上で PR を提出してください。
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import process from 'node:process';
|
|
3
|
-
import {
|
|
4
|
-
void
|
|
3
|
+
import { runSmartEditCli } from './smart-edit/cli.js';
|
|
4
|
+
void runSmartEditCli().catch((error) => {
|
|
5
5
|
console.error(error instanceof Error ? error.stack ?? error.message : error);
|
|
6
6
|
process.exitCode = 1;
|
|
7
7
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import { autogeneratePromptFactoryModule } from '../interprompt/prompt_factory.js';
|
|
4
|
-
import { PROMPT_TEMPLATES_DIR_INTERNAL, REPO_ROOT } from '../
|
|
5
|
-
import {
|
|
6
|
-
const { logger } =
|
|
4
|
+
import { PROMPT_TEMPLATES_DIR_INTERNAL, REPO_ROOT } from '../smart-edit/constants.js';
|
|
5
|
+
import { createSmartEditLogger } from '../smart-edit/util/logging.js';
|
|
6
|
+
const { logger } = createSmartEditLogger({ name: 'devtools.generate_prompt_factory' });
|
|
7
7
|
function resolveTargetPath(targetPath) {
|
|
8
8
|
if (targetPath) {
|
|
9
9
|
return path.resolve(targetPath);
|
|
10
10
|
}
|
|
11
|
-
return path.join(REPO_ROOT, 'src', '
|
|
11
|
+
return path.join(REPO_ROOT, 'src', 'smart-edit', 'generated', 'generated_prompt_factory.ts');
|
|
12
12
|
}
|
|
13
13
|
function resolvePromptsDir(promptsDir) {
|
|
14
14
|
if (promptsDir === undefined) {
|
|
@@ -74,7 +74,7 @@ function parseCliArguments(argv) {
|
|
|
74
74
|
return result;
|
|
75
75
|
}
|
|
76
76
|
function printHelp() {
|
|
77
|
-
const relativeTarget = path.relative(REPO_ROOT, path.join(REPO_ROOT, 'src', '
|
|
77
|
+
const relativeTarget = path.relative(REPO_ROOT, path.join(REPO_ROOT, 'src', 'smart-edit', 'generated', 'generated_prompt_factory.ts'));
|
|
78
78
|
logger.info([
|
|
79
79
|
'Usage: pnpm prompts:generate [options]',
|
|
80
80
|
'',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
|
|
34
|
-
import './solidlsp/language_servers/autoload.js';
|
|
1
|
+
export * from './smart-edit/constants.js';
|
|
2
|
+
export * from './smart-edit/gui_log_viewer.js';
|
|
3
|
+
export * from './smart-edit/util/exception.js';
|
|
4
|
+
export * from './smart-edit/util/general.js';
|
|
5
|
+
export * from './smart-edit/util/logging.js';
|
|
6
|
+
export * from './smart-edit/util/file_system.js';
|
|
7
|
+
export * from './smart-edit/util/shell.js';
|
|
8
|
+
export * from './smart-edit/util/git.js';
|
|
9
|
+
export * from './smart-edit/util/inspection.js';
|
|
10
|
+
export * from './smart-edit/util/thread.js';
|
|
11
|
+
export * from './smart-edit/util/class_decorators.js';
|
|
12
|
+
export * from './smart-edit/config/smart_edit_config.js';
|
|
13
|
+
export * from './smart-edit/config/context_mode.js';
|
|
14
|
+
export * from './smart-edit/analytics.js';
|
|
15
|
+
export * from './smart-edit/dashboard.js';
|
|
16
|
+
export * from './smart-edit/mcp.js';
|
|
17
|
+
export * from './smart-edit/cli.js';
|
|
18
|
+
export * from './smart-edit/prompt_factory.js';
|
|
19
|
+
export * from './smart-edit/code_editor.js';
|
|
20
|
+
export * from './smart-edit/symbol.js';
|
|
21
|
+
export * from './smart-edit/version.js';
|
|
22
|
+
export * from './smart-edit/agent.js';
|
|
23
|
+
export * from './smart-edit/project.js';
|
|
24
|
+
export * from './smart-lsp/ls_config.js';
|
|
25
|
+
export * from './smart-lsp/ls.js';
|
|
26
|
+
export * from './smart-lsp/ls_handler.js';
|
|
27
|
+
export * from './smart-lsp/ls_request.js';
|
|
28
|
+
export * from './smart-lsp/ls_exceptions.js';
|
|
29
|
+
export * from './smart-lsp/lsp_protocol_handler/server.js';
|
|
30
|
+
export * from './smart-lsp/ls_types.js';
|
|
31
|
+
export * from './smart-lsp/util/subprocess_util.js';
|
|
32
|
+
export * from './smart-lsp/util/zip.js';
|
|
33
|
+
import './smart-lsp/language_servers/autoload.js';
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
export * from './
|
|
16
|
-
export * from './
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './
|
|
19
|
-
export * from './
|
|
20
|
-
export * from './
|
|
21
|
-
export * from './
|
|
22
|
-
export * from './
|
|
23
|
-
export * from './
|
|
24
|
-
export * from './
|
|
25
|
-
export * from './
|
|
26
|
-
export * from './
|
|
27
|
-
export * from './
|
|
28
|
-
export * from './
|
|
29
|
-
export * from './
|
|
30
|
-
export * from './
|
|
31
|
-
export * from './
|
|
32
|
-
export * from './
|
|
33
|
-
|
|
34
|
-
import './solidlsp/language_servers/autoload.js';
|
|
1
|
+
export * from './smart-edit/constants.js';
|
|
2
|
+
export * from './smart-edit/gui_log_viewer.js';
|
|
3
|
+
export * from './smart-edit/util/exception.js';
|
|
4
|
+
export * from './smart-edit/util/general.js';
|
|
5
|
+
export * from './smart-edit/util/logging.js';
|
|
6
|
+
export * from './smart-edit/util/file_system.js';
|
|
7
|
+
export * from './smart-edit/util/shell.js';
|
|
8
|
+
export * from './smart-edit/util/git.js';
|
|
9
|
+
export * from './smart-edit/util/inspection.js';
|
|
10
|
+
export * from './smart-edit/util/thread.js';
|
|
11
|
+
export * from './smart-edit/util/class_decorators.js';
|
|
12
|
+
export * from './smart-edit/config/smart_edit_config.js';
|
|
13
|
+
export * from './smart-edit/config/context_mode.js';
|
|
14
|
+
export * from './smart-edit/analytics.js';
|
|
15
|
+
export * from './smart-edit/dashboard.js';
|
|
16
|
+
export * from './smart-edit/mcp.js';
|
|
17
|
+
export * from './smart-edit/cli.js';
|
|
18
|
+
export * from './smart-edit/prompt_factory.js';
|
|
19
|
+
export * from './smart-edit/code_editor.js';
|
|
20
|
+
export * from './smart-edit/symbol.js';
|
|
21
|
+
export * from './smart-edit/version.js';
|
|
22
|
+
export * from './smart-edit/agent.js';
|
|
23
|
+
export * from './smart-edit/project.js';
|
|
24
|
+
export * from './smart-lsp/ls_config.js';
|
|
25
|
+
export * from './smart-lsp/ls.js';
|
|
26
|
+
export * from './smart-lsp/ls_handler.js';
|
|
27
|
+
export * from './smart-lsp/ls_request.js';
|
|
28
|
+
export * from './smart-lsp/ls_exceptions.js';
|
|
29
|
+
export * from './smart-lsp/lsp_protocol_handler/server.js';
|
|
30
|
+
export * from './smart-lsp/ls_types.js';
|
|
31
|
+
export * from './smart-lsp/util/subprocess_util.js';
|
|
32
|
+
export * from './smart-lsp/util/zip.js';
|
|
33
|
+
import './smart-lsp/language_servers/autoload.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import yaml from 'yaml';
|
|
4
|
-
import {
|
|
4
|
+
import { createSmartEditLogger } from '../smart-edit/util/logging.js';
|
|
5
5
|
import { JinjaTemplate } from './jinja_template.js';
|
|
6
|
-
const { logger: log } =
|
|
6
|
+
const { logger: log } = createSmartEditLogger({ name: 'interprompt.multilang_prompt' });
|
|
7
7
|
export const DEFAULT_LANG_CODE = 'default';
|
|
8
8
|
export var LanguageFallbackMode;
|
|
9
9
|
(function (LanguageFallbackMode) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import {
|
|
4
|
+
import { createSmartEditLogger } from '../smart-edit/util/logging.js';
|
|
5
5
|
import { MultiLangPromptCollection, DEFAULT_LANG_CODE } from './multilang_prompt.js';
|
|
6
6
|
export class PromptFactoryBase {
|
|
7
7
|
langCode;
|
|
@@ -22,7 +22,7 @@ export class PromptFactoryBase {
|
|
|
22
22
|
export { PromptList, DEFAULT_LANG_CODE, LanguageFallbackMode } from './multilang_prompt.js';
|
|
23
23
|
const MODULE_PATH = fileURLToPath(import.meta.url);
|
|
24
24
|
const MODULE_JS_PATH = MODULE_PATH.replace(/\.ts$/, '.js');
|
|
25
|
-
const { logger: promptFactoryLogger } =
|
|
25
|
+
const { logger: promptFactoryLogger } = createSmartEditLogger({ name: 'interprompt.prompt_factory' });
|
|
26
26
|
function toPascalCase(value) {
|
|
27
27
|
return value
|
|
28
28
|
.split(/[^a-zA-Z0-9]+/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { singleton } from '../../
|
|
1
|
+
export { singleton } from '../../smart-edit/util/class_decorators.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { singleton } from '../../
|
|
1
|
+
export { singleton } from '../../smart-edit/util/class_decorators.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type ToolClass, type
|
|
1
|
+
import { type ToolClass, type SmartEditAgentLike, type AgentTaskHandle, type IssueTaskMetadata } from './tools/tools_base.js';
|
|
2
2
|
import type { Tool } from './tools/tools_base.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { SmartEditConfig } from './config/smart_edit_config.js';
|
|
4
|
+
import { SmartEditAgentContext, SmartEditAgentMode } from './config/context_mode.js';
|
|
5
5
|
import { MemoryLogHandler } from './util/logging.js';
|
|
6
|
-
import {
|
|
6
|
+
import { SmartEditPromptFactory } from './prompt_factory.js';
|
|
7
7
|
import { ToolUsageStats } from './analytics.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { SmartLanguageServer } from '../smart-lsp/ls.js';
|
|
9
9
|
import { LanguageServerCodeEditor } from './code_editor.js';
|
|
10
10
|
import { LanguageServerSymbolRetriever } from './symbol.js';
|
|
11
11
|
export declare class ProjectNotFoundError extends Error {
|
|
@@ -32,27 +32,27 @@ interface CreateLanguageServerOptions {
|
|
|
32
32
|
traceLspCommunication: boolean;
|
|
33
33
|
lsSpecificSettings: Record<string, unknown>;
|
|
34
34
|
}
|
|
35
|
-
type RegisteredProject =
|
|
35
|
+
type RegisteredProject = SmartEditConfig['projects'][number];
|
|
36
36
|
type ProjectConfig = RegisteredProject['projectConfig'];
|
|
37
37
|
interface AgentProject {
|
|
38
38
|
projectRoot: string;
|
|
39
39
|
isNewlyCreated?: boolean;
|
|
40
40
|
projectConfig: ProjectConfig;
|
|
41
41
|
projectName?: string;
|
|
42
|
-
createLanguageServer(options: CreateLanguageServerOptions):
|
|
42
|
+
createLanguageServer(options: CreateLanguageServerOptions): SmartLanguageServer;
|
|
43
43
|
}
|
|
44
|
-
export interface
|
|
44
|
+
export interface SmartEditAgentOptions {
|
|
45
45
|
project?: string | null;
|
|
46
46
|
projectActivationCallback?: () => void;
|
|
47
|
-
|
|
48
|
-
context?:
|
|
49
|
-
modes?:
|
|
47
|
+
smartEditConfig?: SmartEditConfig;
|
|
48
|
+
context?: SmartEditAgentContext;
|
|
49
|
+
modes?: SmartEditAgentMode[];
|
|
50
50
|
memoryLogHandler?: MemoryLogHandler;
|
|
51
51
|
}
|
|
52
|
-
export declare class
|
|
53
|
-
readonly
|
|
54
|
-
readonly promptFactory:
|
|
55
|
-
languageServer:
|
|
52
|
+
export declare class SmartEditAgent implements SmartEditAgentLike {
|
|
53
|
+
readonly smartEditConfig: SmartEditConfig;
|
|
54
|
+
readonly promptFactory: SmartEditPromptFactory;
|
|
55
|
+
languageServer: SmartLanguageServer | null;
|
|
56
56
|
memoriesManager: MemoriesManager | null;
|
|
57
57
|
linesRead: LinesRead | null;
|
|
58
58
|
private readonly projectActivationCallback?;
|
|
@@ -72,9 +72,9 @@ export declare class SerenaAgent implements SerenaAgentLike {
|
|
|
72
72
|
private _guiLogViewer;
|
|
73
73
|
private _toolUsageStats;
|
|
74
74
|
private disposed;
|
|
75
|
-
constructor(options?:
|
|
76
|
-
get context():
|
|
77
|
-
getContext():
|
|
75
|
+
constructor(options?: SmartEditAgentOptions);
|
|
76
|
+
get context(): SmartEditAgentContext;
|
|
77
|
+
getContext(): SmartEditAgentContext;
|
|
78
78
|
getToolDescriptionOverride(toolName: string): string | null;
|
|
79
79
|
get toolUsageStats(): ToolUsageStats | null;
|
|
80
80
|
get toolUsageStatsEnabled(): boolean;
|
|
@@ -85,8 +85,8 @@ export declare class SerenaAgent implements SerenaAgentLike {
|
|
|
85
85
|
getActiveToolClasses(): ToolClass[];
|
|
86
86
|
getExposedToolInstances(): Tool[];
|
|
87
87
|
toolIsActive(toolClass: ToolClass | string): boolean;
|
|
88
|
-
setModes(modes:
|
|
89
|
-
getActiveModes():
|
|
88
|
+
setModes(modes: SmartEditAgentMode[]): void;
|
|
89
|
+
getActiveModes(): SmartEditAgentMode[];
|
|
90
90
|
createSystemPrompt(): string;
|
|
91
91
|
issueTask<T>(task: () => Promise<T> | T, metadata?: IssueTaskMetadata): AgentTaskHandle<T>;
|
|
92
92
|
executeTask<T>(task: () => Promise<T> | T): Promise<T>;
|