localant 1.0.1 → 1.1.0

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.
Files changed (178) hide show
  1. package/README.ja.md +185 -0
  2. package/README.md +137 -20
  3. package/SECURITY.md +63 -8
  4. package/assets/hero.png +0 -0
  5. package/assets/localant-icon.png +0 -0
  6. package/examples/skills/article-publisher/README.md +41 -0
  7. package/examples/skills/article-publisher/package.json +9 -0
  8. package/examples/skills/article-publisher/skill.json +134 -0
  9. package/examples/skills/article-publisher/src/index.ts +186 -0
  10. package/examples/skills/article-publisher/tests/skill.test.ts +72 -0
  11. package/package.json +26 -6
  12. package/packages/cli/dist/autostart.d.ts +14 -0
  13. package/packages/cli/dist/autostart.d.ts.map +1 -0
  14. package/packages/cli/dist/autostart.js +98 -0
  15. package/packages/cli/dist/autostart.js.map +1 -0
  16. package/packages/cli/dist/bin.js +214 -2
  17. package/packages/cli/dist/bin.js.map +1 -1
  18. package/packages/cli/dist/runtime.d.ts.map +1 -1
  19. package/packages/cli/dist/runtime.js +56 -8
  20. package/packages/cli/dist/runtime.js.map +1 -1
  21. package/packages/cli/dist/serveo-setup.d.ts +37 -0
  22. package/packages/cli/dist/serveo-setup.d.ts.map +1 -0
  23. package/packages/cli/dist/serveo-setup.js +168 -0
  24. package/packages/cli/dist/serveo-setup.js.map +1 -0
  25. package/packages/cli/dist/util.d.ts +6 -0
  26. package/packages/cli/dist/util.d.ts.map +1 -1
  27. package/packages/cli/dist/util.js +20 -0
  28. package/packages/cli/dist/util.js.map +1 -1
  29. package/packages/cli/package.json +1 -1
  30. package/packages/dashboard/dist/index.d.ts +5 -4
  31. package/packages/dashboard/dist/index.d.ts.map +1 -1
  32. package/packages/dashboard/dist/index.js +781 -44
  33. package/packages/dashboard/dist/index.js.map +1 -1
  34. package/packages/gateway/dist/gateway.d.ts +14 -1
  35. package/packages/gateway/dist/gateway.d.ts.map +1 -1
  36. package/packages/gateway/dist/gateway.js +59 -6
  37. package/packages/gateway/dist/gateway.js.map +1 -1
  38. package/packages/gateway/dist/index.d.ts +3 -0
  39. package/packages/gateway/dist/index.d.ts.map +1 -1
  40. package/packages/gateway/dist/index.js +3 -0
  41. package/packages/gateway/dist/index.js.map +1 -1
  42. package/packages/gateway/dist/managers/coding-agent-manager.d.ts +14 -0
  43. package/packages/gateway/dist/managers/coding-agent-manager.d.ts.map +1 -1
  44. package/packages/gateway/dist/managers/coding-agent-manager.js +21 -2
  45. package/packages/gateway/dist/managers/coding-agent-manager.js.map +1 -1
  46. package/packages/gateway/dist/managers/fs-manager.d.ts +73 -0
  47. package/packages/gateway/dist/managers/fs-manager.d.ts.map +1 -1
  48. package/packages/gateway/dist/managers/fs-manager.js +290 -6
  49. package/packages/gateway/dist/managers/fs-manager.js.map +1 -1
  50. package/packages/gateway/dist/managers/git-manager.d.ts +6 -0
  51. package/packages/gateway/dist/managers/git-manager.d.ts.map +1 -1
  52. package/packages/gateway/dist/managers/git-manager.js +24 -0
  53. package/packages/gateway/dist/managers/git-manager.js.map +1 -1
  54. package/packages/gateway/dist/managers/lsp-service.d.ts +88 -0
  55. package/packages/gateway/dist/managers/lsp-service.d.ts.map +1 -0
  56. package/packages/gateway/dist/managers/lsp-service.js +249 -0
  57. package/packages/gateway/dist/managers/lsp-service.js.map +1 -0
  58. package/packages/gateway/dist/managers/mcp-bridge.d.ts +2 -1
  59. package/packages/gateway/dist/managers/mcp-bridge.d.ts.map +1 -1
  60. package/packages/gateway/dist/managers/mcp-bridge.js +23 -2
  61. package/packages/gateway/dist/managers/mcp-bridge.js.map +1 -1
  62. package/packages/gateway/dist/managers/shell-manager.d.ts +19 -0
  63. package/packages/gateway/dist/managers/shell-manager.d.ts.map +1 -1
  64. package/packages/gateway/dist/managers/shell-manager.js +28 -0
  65. package/packages/gateway/dist/managers/shell-manager.js.map +1 -1
  66. package/packages/gateway/dist/managers/skill-runtime.d.ts +8 -0
  67. package/packages/gateway/dist/managers/skill-runtime.d.ts.map +1 -1
  68. package/packages/gateway/dist/managers/skill-runtime.js +15 -0
  69. package/packages/gateway/dist/managers/skill-runtime.js.map +1 -1
  70. package/packages/gateway/dist/managers/tunnel-manager.d.ts +19 -1
  71. package/packages/gateway/dist/managers/tunnel-manager.d.ts.map +1 -1
  72. package/packages/gateway/dist/managers/tunnel-manager.js +289 -8
  73. package/packages/gateway/dist/managers/tunnel-manager.js.map +1 -1
  74. package/packages/gateway/dist/security/command-guard.d.ts +3 -0
  75. package/packages/gateway/dist/security/command-guard.d.ts.map +1 -1
  76. package/packages/gateway/dist/security/command-guard.js +15 -7
  77. package/packages/gateway/dist/security/command-guard.js.map +1 -1
  78. package/packages/gateway/dist/security/path-guard.d.ts +3 -0
  79. package/packages/gateway/dist/security/path-guard.d.ts.map +1 -1
  80. package/packages/gateway/dist/security/path-guard.js +8 -2
  81. package/packages/gateway/dist/security/path-guard.js.map +1 -1
  82. package/packages/gateway/dist/stores/config-store.d.ts +10 -0
  83. package/packages/gateway/dist/stores/config-store.d.ts.map +1 -1
  84. package/packages/gateway/dist/stores/config-store.js +47 -3
  85. package/packages/gateway/dist/stores/config-store.js.map +1 -1
  86. package/packages/gateway/dist/stores/secret-vault.d.ts +19 -3
  87. package/packages/gateway/dist/stores/secret-vault.d.ts.map +1 -1
  88. package/packages/gateway/dist/stores/secret-vault.js +47 -6
  89. package/packages/gateway/dist/stores/secret-vault.js.map +1 -1
  90. package/packages/gateway/dist/tools/adapters.d.ts.map +1 -1
  91. package/packages/gateway/dist/tools/adapters.js +198 -7
  92. package/packages/gateway/dist/tools/adapters.js.map +1 -1
  93. package/packages/gateway/dist/tools/adb.d.ts.map +1 -1
  94. package/packages/gateway/dist/tools/adb.js +42 -0
  95. package/packages/gateway/dist/tools/adb.js.map +1 -1
  96. package/packages/gateway/dist/tools/agent.d.ts +10 -0
  97. package/packages/gateway/dist/tools/agent.d.ts.map +1 -0
  98. package/packages/gateway/dist/tools/agent.js +35 -0
  99. package/packages/gateway/dist/tools/agent.js.map +1 -0
  100. package/packages/gateway/dist/tools/aliases.d.ts +7 -0
  101. package/packages/gateway/dist/tools/aliases.d.ts.map +1 -0
  102. package/packages/gateway/dist/tools/aliases.js +64 -0
  103. package/packages/gateway/dist/tools/aliases.js.map +1 -0
  104. package/packages/gateway/dist/tools/bash.d.ts +10 -0
  105. package/packages/gateway/dist/tools/bash.d.ts.map +1 -0
  106. package/packages/gateway/dist/tools/bash.js +67 -0
  107. package/packages/gateway/dist/tools/bash.js.map +1 -0
  108. package/packages/gateway/dist/tools/browser.d.ts.map +1 -1
  109. package/packages/gateway/dist/tools/browser.js +9 -0
  110. package/packages/gateway/dist/tools/browser.js.map +1 -1
  111. package/packages/gateway/dist/tools/control.d.ts +8 -0
  112. package/packages/gateway/dist/tools/control.d.ts.map +1 -0
  113. package/packages/gateway/dist/tools/control.js +134 -0
  114. package/packages/gateway/dist/tools/control.js.map +1 -0
  115. package/packages/gateway/dist/tools/editing.d.ts +8 -0
  116. package/packages/gateway/dist/tools/editing.d.ts.map +1 -0
  117. package/packages/gateway/dist/tools/editing.js +102 -0
  118. package/packages/gateway/dist/tools/editing.js.map +1 -0
  119. package/packages/gateway/dist/tools/git.d.ts.map +1 -1
  120. package/packages/gateway/dist/tools/git.js +67 -0
  121. package/packages/gateway/dist/tools/git.js.map +1 -1
  122. package/packages/gateway/dist/tools/index.d.ts.map +1 -1
  123. package/packages/gateway/dist/tools/index.js +17 -2
  124. package/packages/gateway/dist/tools/index.js.map +1 -1
  125. package/packages/gateway/dist/tools/lsp.d.ts +10 -0
  126. package/packages/gateway/dist/tools/lsp.d.ts.map +1 -0
  127. package/packages/gateway/dist/tools/lsp.js +111 -0
  128. package/packages/gateway/dist/tools/lsp.js.map +1 -0
  129. package/packages/gateway/dist/tools/question.d.ts +10 -0
  130. package/packages/gateway/dist/tools/question.d.ts.map +1 -0
  131. package/packages/gateway/dist/tools/question.js +30 -0
  132. package/packages/gateway/dist/tools/question.js.map +1 -0
  133. package/packages/gateway/dist/tools/shell.d.ts +1 -1
  134. package/packages/gateway/dist/tools/shell.d.ts.map +1 -1
  135. package/packages/gateway/dist/tools/shell.js +15 -0
  136. package/packages/gateway/dist/tools/shell.js.map +1 -1
  137. package/packages/gateway/dist/tools/skill.d.ts.map +1 -1
  138. package/packages/gateway/dist/tools/skill.js +2 -7
  139. package/packages/gateway/dist/tools/skill.js.map +1 -1
  140. package/packages/gateway/dist/tools/system.js +2 -2
  141. package/packages/gateway/dist/tools/system.js.map +1 -1
  142. package/packages/gateway/dist/tools/validation.d.ts +3 -0
  143. package/packages/gateway/dist/tools/validation.d.ts.map +1 -0
  144. package/packages/gateway/dist/tools/validation.js +120 -0
  145. package/packages/gateway/dist/tools/validation.js.map +1 -0
  146. package/packages/mcp/dist/http-server.d.ts +1 -1
  147. package/packages/mcp/dist/http-server.d.ts.map +1 -1
  148. package/packages/mcp/dist/http-server.js +544 -20
  149. package/packages/mcp/dist/http-server.js.map +1 -1
  150. package/packages/mcp/dist/mcp-server.d.ts.map +1 -1
  151. package/packages/mcp/dist/mcp-server.js +5 -1
  152. package/packages/mcp/dist/mcp-server.js.map +1 -1
  153. package/packages/shared/dist/config.d.ts +146 -16
  154. package/packages/shared/dist/config.d.ts.map +1 -1
  155. package/packages/shared/dist/config.js +93 -7
  156. package/packages/shared/dist/config.js.map +1 -1
  157. package/packages/shared/dist/index.d.ts +2 -0
  158. package/packages/shared/dist/index.d.ts.map +1 -1
  159. package/packages/shared/dist/index.js +2 -0
  160. package/packages/shared/dist/index.js.map +1 -1
  161. package/packages/shared/dist/paths.d.ts +19 -2
  162. package/packages/shared/dist/paths.d.ts.map +1 -1
  163. package/packages/shared/dist/paths.js +50 -3
  164. package/packages/shared/dist/paths.js.map +1 -1
  165. package/packages/shared/dist/tool-profiles.d.ts +34 -0
  166. package/packages/shared/dist/tool-profiles.d.ts.map +1 -0
  167. package/packages/shared/dist/tool-profiles.js +188 -0
  168. package/packages/shared/dist/tool-profiles.js.map +1 -0
  169. package/packages/shared/dist/version.d.ts +9 -0
  170. package/packages/shared/dist/version.d.ts.map +1 -0
  171. package/packages/shared/dist/version.js +9 -0
  172. package/packages/shared/dist/version.js.map +1 -0
  173. package/scripts/postinstall.mjs +56 -0
  174. package/assets/icon.svg +0 -25
  175. package/packages/gateway/dist/tools/article.d.ts +0 -3
  176. package/packages/gateway/dist/tools/article.d.ts.map +0 -1
  177. package/packages/gateway/dist/tools/article.js +0 -230
  178. package/packages/gateway/dist/tools/article.js.map +0 -1
package/README.ja.md ADDED
@@ -0,0 +1,185 @@
1
+ <p align="center">
2
+ <img src="assets/hero.png" width="320" alt="LocalAnt — ChatGPT ネイティブのローカル MCP ゲートウェイ" />
3
+ </p>
4
+
5
+ # LocalAnt
6
+
7
+ <p align="center">
8
+ <a href="https://github.com/yuga-hashimoto/localant/actions/workflows/ci.yml"><img src="https://github.com/yuga-hashimoto/localant/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
9
+ <a href="https://www.npmjs.com/package/localant"><img src="https://img.shields.io/npm/v/localant.svg" alt="npm version" /></a>
10
+ <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/localant.svg" alt="node version" /></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license" /></a>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="README.md">English</a> · <b>日本語</b>
16
+ </p>
17
+
18
+ > **ChatGPT を頭脳に、あなたのローカル PC を手足にする。**
19
+
20
+ `LocalAnt` は、ChatGPT を頭脳として、ローカル PC を実行環境として使うための
21
+ ツールです。
22
+
23
+ 安全で権限管理された「スキル」を MCP 経由で ChatGPT に公開します。
24
+ 許可済みコマンドの実行、プロジェクトの調査、ファイル操作、Claude Code や Codex
25
+ などのコーディングエージェントの呼び出し、ブラウザ / ADB の操作、記事の公開、
26
+ 独自スキルの作成 —— すべてが**デフォルト拒否**のセキュリティモデル、ローカル承認、
27
+ 完全な監査ログの背後で動作します。
28
+
29
+ ```text
30
+ ChatGPT
31
+ ↓ Apps SDK / MCP コネクタ(Streamable HTTP /mcp)
32
+ LocalAnt ── ゲートウェイ · リスクエンジン · 承認キュー · 監査ログ · ダッシュボード
33
+ ↓ ローカル PC
34
+ ├─ シェル(allowlist)· ファイルシステム(allowlist)· Git
35
+ ├─ Claude Code / Codex(計画 → 承認 → 実行 → 検証 → 差分)
36
+ ├─ ブラウザ(Playwright・分離プロファイル)· Android(ADB)
37
+ ├─ 記事(Zenn / Qiita / note)· カスタムスキル
38
+ └─ アダプタ: OpenClaw · Desktop Commander · 任意の MCP サーバ
39
+ ```
40
+
41
+ ---
42
+
43
+ ## LocalAnt とは?
44
+
45
+ ChatGPT のための**ローカルファースト MCP ゲートウェイ**です。ChatGPT は会話 UI
46
+ 兼意思決定者、あなたの PC が実行環境になります。ゲートウェイは **140 以上の権限
47
+ 管理されたツール**を Model Context Protocol で公開し、ChatGPT の開発者モード
48
+ コネクタから呼び出せます。
49
+
50
+ ## なぜ ChatGPT が頭脳で、ローカル PC が手足なのか?
51
+
52
+ - ChatGPT は推論・計画・会話が得意です。
53
+ - あなたの PC には、実際のコード・ファイル・デバイス・ツールがあります。
54
+ - ChatGPT に生のシェルを渡すのは危険です。代わりに、リスクの高い操作はローカル
55
+ 承認を挟んだ**厳選された権限付きの操作面**を提供します。
56
+
57
+ ## 特長
58
+
59
+ - 🔒 **デフォルト拒否のセキュリティ**: ディレクトリ / コマンドの allowlist、
60
+ blocklist、パス・シンボリックリンクのトラバーサル防止、シークレット保管庫 + マスキング。
61
+ - ✅ **ローカル承認キュー**: リスク2以上のツールはダッシュボードまたは CLI での
62
+ 明示的な承認が必須。ChatGPT 側の確認だけでは決して信用しません。
63
+ - 🧾 **完全な監査ログ**: すべてのツール呼び出しを記録(シークレットはマスキング)。
64
+ - 🧩 **スキルシステム**: 作成・検証・有効化・実行・git からの導入・公開、そして
65
+ **ChatGPT からのスキル生成**(常に無効状態で保存)。
66
+ - 🤖 **コーディングエージェント**: Claude Code / Codex を駆動(計画 → 承認 → 実行
67
+ → 検証 → 差分)。
68
+ - 🖥️ **ローカルダッシュボード**: ステータス・承認・監査・スキル・プロジェクト・
69
+ シークレット・エージェント。
70
+ - 🌐 **3分セットアップ**: Cloudflare Tunnel / ngrok とクリップボードコピー対応。
71
+ - 🔌 **アダプタ**: OpenClaw、Desktop Commander、任意の MCP サーバ。
72
+
73
+ ## 3分セットアップ
74
+
75
+ ```bash
76
+ npx -y localant setup
77
+ ```
78
+
79
+ または:
80
+
81
+ ```bash
82
+ npm install -g localant
83
+ localant setup
84
+ ```
85
+
86
+ `setup` は環境チェック、設定の初期化、認証トークン生成、組み込みスキルの有効化、
87
+ ゲートウェイ + ダッシュボードの起動、公開トンネルの作成、MCP URL のクリップボード
88
+ コピー、ChatGPT 接続手順の表示までを行います。
89
+
90
+ ## ChatGPT の設定
91
+
92
+ 1. ChatGPT →**設定 → アプリとコネクタ**
93
+ 2. **詳細設定 → 開発者モードをオン**
94
+ 3. **コネクタ → 作成**
95
+ 4. **MCP URL**(`https://…/mcp?key=<token>`)を貼り付け
96
+ 5. **認証**を**なし**にする(URLにトークンが含まれているため)
97
+ 6. 名前を **LocalAnt** にする
98
+ 7. ChatGPT に「ローカルアプリのヘルスチェックを実行して」と頼む
99
+
100
+ トークンは URL に埋め込まれているため、カスタムヘッダが使えない環境でもコネクタ
101
+ が認証できます。`Authorization: Bearer <token>` も利用できます(こちらを推奨)。
102
+ 詳細は [docs/chatgpt-setup.md](docs/chatgpt-setup.md)。
103
+
104
+ ## セキュリティモデル
105
+
106
+ | リスク | 意味 | 承認 |
107
+ |------|---------|------|
108
+ | 0 | 読み取り専用 | 不要 |
109
+ | 1 | 安全な下書き書き込み | 設定次第(既定は不要) |
110
+ | 2 | ファイル変更 | **必須** |
111
+ | 3 | シェル / エージェント / ネットワーク書き込み | **必須** |
112
+ | 4 | 破壊的 / 公開 / デプロイ | **二重承認** |
113
+
114
+ - 既定では生のシェルなし —— allowlist に対する `shell_run_allowed_command` のみ。
115
+ - ファイルアクセスは**許可ディレクトリ**に限定。機微なパス(`~/.ssh`、`~/.aws`、
116
+ `/etc` など)は常にブロックし、シンボリックリンクによる脱出も検出します。
117
+ - シークレットは暗号化されたローカル保管庫に保存され、ツール出力・監査ログから
118
+ **マスキング**されます。
119
+ - 生成 / 導入したスキルはレビューするまで**既定で無効**です。
120
+
121
+ 詳細は [SECURITY.md](SECURITY.md)。トークンは秘密を失わずに
122
+ `localant token rotate` でいつでも再発行できます。
123
+
124
+ ## スキル
125
+
126
+ スキルは拡張の単位です。
127
+
128
+ ```text
129
+ skills/<name>/
130
+ skill.json # マニフェスト: 権限 + リスク + ツールスキーマ
131
+ README.md LICENSE CHANGELOG.md
132
+ src/index.ts # defineSkill({...})
133
+ tests/index.test.ts
134
+ examples/
135
+ ```
136
+
137
+ ```ts
138
+ import { defineSkill, z } from "@LocalAnt/skill-sdk";
139
+
140
+ export default defineSkill({
141
+ name: "hello-world",
142
+ tools: {
143
+ hello: {
144
+ description: "Say hello",
145
+ riskLevel: 0,
146
+ inputSchema: z.object({ name: z.string() }),
147
+ handler: async ({ name }) => ({ content: `Hello ${name}` }),
148
+ },
149
+ },
150
+ });
151
+ ```
152
+
153
+ 詳細は [docs/skills.md](docs/skills.md)。
154
+
155
+ ## 記事の公開
156
+
157
+ - **Zenn**: GitHub リポジトリ方式。`published:false` で `articles/<slug>.md` を
158
+ 書き出し、PR ブランチも作成可能。(`zenn_*`)
159
+ - **Qiita**: 保管庫の `QIITA_TOKEN` を使った公式 API。非公開を優先。(`qiita_*`)
160
+ - **note**: ローカルの下書きファイル優先。公開には note-mcp アダプタが必要。(`note_*`)
161
+
162
+ 公開操作は**リスク4(二重承認)**です。詳細は [docs/articles.md](docs/articles.md)。
163
+
164
+ ## CLI
165
+
166
+ ```bash
167
+ localant setup | start | stop | restart | status | doctor | update | uninstall
168
+ localant token rotate | show # 認証トークンを再発行(シークレットは保持)
169
+ localant tunnel status
170
+ localant approvals list | approve <id> [--session] | deny <id>
171
+ localant skills list | info <name> | enable <name> | disable <name> | install <git-url>
172
+ localant projects list | add <path> [--name <n>] | remove <id>
173
+ localant secrets set <name> [value] | list | remove <name>
174
+ ```
175
+
176
+ ## コントリビュート
177
+
178
+ コントリビューション歓迎です(特にテストとセキュリティ強化)。セットアップ・
179
+ コーディング規約・リリース手順は [CONTRIBUTING.md](CONTRIBUTING.md)、今後の方針は
180
+ [ROADMAP.md](ROADMAP.md) を参照してください。脆弱性は
181
+ [SECURITY.md](SECURITY.md) に従って非公開で報告してください。
182
+
183
+ ## ライセンス
184
+
185
+ MIT —— [LICENSE](LICENSE) を参照。
package/README.md CHANGED
@@ -1,9 +1,20 @@
1
1
  <p align="center">
2
- <img src="assets/icon.svg" width="96" height="96" alt="LocalAnt — ChatGPT-native Local MCP Gateway" />
2
+ <img src="assets/hero.png" width="320" alt="LocalAnt — ChatGPT-native Local MCP Gateway" />
3
3
  </p>
4
4
 
5
5
  # LocalAnt
6
6
 
7
+ <p align="center">
8
+ <a href="https://github.com/yuga-hashimoto/localant/actions/workflows/ci.yml"><img src="https://github.com/yuga-hashimoto/localant/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
9
+ <a href="https://www.npmjs.com/package/localant"><img src="https://img.shields.io/npm/v/localant.svg" alt="npm version" /></a>
10
+ <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/localant.svg" alt="node version" /></a>
11
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT license" /></a>
12
+ </p>
13
+
14
+ <p align="center">
15
+ <b>English</b> · <a href="README.ja.md">日本語</a>
16
+ </p>
17
+
7
18
  > **Use ChatGPT as the brain. Use your local computer as the hands.**
8
19
 
9
20
  `LocalAnt` lets you use ChatGPT as the brain and your local computer as the hands.
@@ -63,6 +74,55 @@ and audit.
63
74
  - 🌐 **3-minute setup** with Cloudflare Tunnel / ngrok and clipboard copy.
64
75
  - 🔌 **Adapters** for OpenClaw, Desktop Commander, and arbitrary MCP servers.
65
76
 
77
+ ## ChatGPT as a local coding agent
78
+
79
+ LocalAnt is also a **ChatGPT-native local coding-agent runtime**. ChatGPT can
80
+ read, search, edit, run, test, and diff a project on your machine through MCP —
81
+ behind the same approval / audit / security pipeline as everything else.
82
+
83
+ It exposes the standard **Codex / Claude Code / OpenCode**-style tool names:
84
+
85
+ | Category | Tools |
86
+ |----------|-------|
87
+ | Read / search | `read` · `read_file_range` · `grep` · `glob` · `list_files` · `get_file_info` |
88
+ | Edit | `write` · `edit` · `multi_edit` · `apply_patch` · `move_file` · `copy_file` · `create_directory` · `delete_file` |
89
+ | Run | `bash` · `shell_run_background` · `shell_get_output` · `shell_stop` · `command_exists` |
90
+ | Git | `git_status` · `git_diff` · `git_add` · `git_commit` · `git_restore` · `git_stash` · `git_reset` · `git_apply_patch` · `git_is_dirty` |
91
+ | Validate | `project_run_tests` · `project_run_lint` · `project_run_typecheck` · `project_run_build` · `project_run_validation` · `project_get_package_scripts` |
92
+ | Code intel | `lsp_status` · `lsp_diagnostics` · `lsp_document_symbols` · `lsp_go_to_definition` · `lsp_find_references` · `lsp_hover` · `lsp_rename_symbol` |
93
+ | Approve | `approval_request` (the human approves in the dashboard / CLI) |
94
+ | Delegate | `agent_run` (claude-code · codex · opencode · openclaw · antigravity-cli · hermes-agent) |
95
+
96
+ > **No web search / web fetch / todo / "ask the user" tools** — ChatGPT already
97
+ > does web search, browsing, planning, and asking you directly, so tool-ifying
98
+ > those would only bloat the surface. LocalAnt exposes only what it *uniquely*
99
+ > provides: your local files, shell, git, toolchain, language server, browser,
100
+ > device, and agents.
101
+
102
+ `bash` runs through a real shell (pipelines and `&&` work) **but** every command
103
+ is screened by CommandGuard (blocked tokens, `rm -rf`, …), the `cwd` is validated
104
+ by PathGuard, and the call is gated by the security mode (approval in `strict`,
105
+ audited-but-ungated in `open`, ungated in `yolo` — with `CORE_BLOCKED_COMMAND_TOKENS`
106
+ rejected even in `yolo`).
107
+
108
+ **Tool profiles** keep the advertised surface sharp:
109
+
110
+ - `minimal` — the small delegation core (shell / agent / skill + read-only fs).
111
+ - `coding` — the full coding surface above (recommended for ChatGPT-as-coder).
112
+ - `full` — every tool (browser, adb, skill authoring, destructive git, secrets).
113
+
114
+ ```bash
115
+ localant tools profile coding # switch profile
116
+ localant tools list # see what's exposed
117
+ ```
118
+
119
+ Then just ask ChatGPT:
120
+
121
+ > "Look at this repo, fix the bug, run `pnpm validate`, and show me the `git diff`."
122
+
123
+ ChatGPT will check project/git state, `grep`/`glob` for the code, `edit`/`apply_patch`
124
+ the fix, `bash` the validation, iterate on errors, and return `git_diff`.
125
+
66
126
  ## 3-minute setup
67
127
 
68
128
  ```bash
@@ -92,7 +152,8 @@ Connect ChatGPT:
92
152
  2. Advanced settings → Developer Mode ON
93
153
  3. Connectors → Create
94
154
  4. Paste the MCP URL above
95
- 5. Name it: LocalAnt
155
+ 5. Set Authentication to "None"
156
+ 6. Name it: LocalAnt
96
157
  ```
97
158
 
98
159
  > **From source** (this repo): `pnpm install && pnpm build && node packages/cli/dist/bin.js setup`
@@ -103,26 +164,53 @@ Connect ChatGPT:
103
164
  2. **Advanced settings → Developer Mode ON**
104
165
  3. **Connectors → Create**
105
166
  4. Paste the **MCP URL** (`https://…/mcp?key=<token>`)
106
- 5. Name it **LocalAnt**
107
- 6. Ask ChatGPT: *"Run health check on my local app"*
167
+ 5. Set **Authentication** to **None**
168
+ 6. Name it **LocalAnt**
169
+ 7. Ask ChatGPT: *"Run health check on my local app"*
108
170
 
109
171
  The token is embedded in the URL so the connector authenticates even where
110
172
  custom headers aren't available. You can also send `Authorization: Bearer <token>`.
111
173
  See [docs/chatgpt-setup.md](docs/chatgpt-setup.md).
112
174
 
175
+ > **Tip — set a fixed URL so you never recreate the connector.** The default
176
+ > Quick Tunnel URL changes on every restart. Configure a fixed tunnel (ngrok
177
+ > static domain, a custom subdomain, or your own domain) in the dashboard
178
+ > **Settings** tab or with `localant config set tunnel.domain <domain>`. The
179
+ > auth token is persistent, so a stable URL means you connect ChatGPT **once**.
180
+ > Full instructions: [docs/chatgpt-setup.md → Keep a fixed URL](docs/chatgpt-setup.md#keep-a-fixed-url-dont-recreate-the-connector-every-time).
181
+
113
182
  ## Security model
114
183
 
115
- | Risk | Meaning | Approval |
116
- |------|---------|----------|
117
- | 0 | read-only | none |
118
- | 1 | safe write draft | config (default none) |
119
- | 2 | file modification | **required** |
120
- | 3 | shell / agent / network write | **required** |
121
- | 4 | destructive / publish / deploy | **double approval** |
122
-
123
- - No raw shell by default — only `shell_run_allowed_command` against an allowlist.
124
- - Filesystem access limited to **allowed directories**; sensitive paths
125
- (`~/.ssh`, `~/.aws`, `/etc`, …) are always blocked; symlink escapes are caught.
184
+ LocalAnt has three security modes (set `security.mode` in config or the
185
+ dashboard Settings tab):
186
+
187
+ | Mode | Filesystem / shell | Approval gates | For |
188
+ |------|--------------------|----------------|-----|
189
+ | **`open`** (default) | deny-list everything allowed except the sensitive blocklist + core blocked tokens | only risk-4 (destructive/publish) | personal single-user machines |
190
+ | `strict` | allow-list only allowed directories & commands | per risk level (see below) | shared / multi-user environments |
191
+ | `yolo` | deny-list (same as `open`) | none at all | trusted automation only |
192
+
193
+ The default is **`open`**: a deny-list model for personal use. There is no
194
+ directory or command allow-list to maintain ChatGPT can read/write anywhere
195
+ and run any command **except** the always-blocked items below.
196
+
197
+ **Strict-mode approval matrix:**
198
+
199
+ | Risk | Meaning | Approval (strict) | Approval (open) |
200
+ |------|---------|-------------------|-----------------|
201
+ | 0 | read-only | none | none |
202
+ | 1 | safe write draft | config (default none) | none |
203
+ | 2 | file modification | **required** | none |
204
+ | 3 | shell / agent / network write | **required** | none |
205
+ | 4 | destructive / publish / deploy | **double approval** | **double approval** |
206
+
207
+ **Always enforced, in every mode (including `open` and `yolo`):**
208
+
209
+ - Sensitive paths (`~/.ssh`, `~/.aws`, `~/.gnupg`, `/etc`, Keychains, …) are
210
+ **never** readable or writable; symlink escapes are caught.
211
+ - Core blocked commands — `sudo`, `su`, `dd`, `mkfs`, `fdisk`, `diskutil`,
212
+ `shutdown`, `reboot` — and `rm -rf` / `chmod 777` are **always rejected** and
213
+ cannot be removed from the blocklist.
126
214
  - Secrets live in an encrypted local vault and are **redacted** from tool
127
215
  output and the audit log.
128
216
  - Generated/installed skills are **disabled by default** until you review them.
@@ -131,9 +219,26 @@ Full details: [SECURITY.md](SECURITY.md).
131
219
 
132
220
  ## Dashboard
133
221
 
134
- A local-only dashboard (`http://127.0.0.1:8788`) shows status, the MCP endpoint
135
- (with copy button), pending approvals, the audit log, skills (enable/disable),
136
- projects, secret names, and coding agents.
222
+ A local-only dashboard (`http://127.0.0.1:8788`) is a full control panel — every
223
+ setting that's available on the CLI is editable from the web, and vice versa.
224
+ A live status badge and a pending-approvals counter update automatically.
225
+
226
+ - **Home** — status, MCP endpoint (copy), tunnel start/stop/restart, **Test
227
+ connection** (fetches the public URL to confirm ChatGPT can reach you), health
228
+ check.
229
+ - **Settings** — security mode (open/strict/yolo), risk policy, **auth token
230
+ reveal/rotate** (rotation takes effect with no restart), tunnel provider +
231
+ fixed-URL config with **Save & restart**, gateway/dashboard ports, allowed
232
+ directories/commands, blocked tokens (core tokens shown but locked), **bridged
233
+ MCP servers** (add/test/remove downstream stdio servers), and a raw JSON editor
234
+ with validation.
235
+ - **Skills** — create, enable/disable, inspect permissions (modal), uninstall.
236
+ - **Agents** — enable/disable (e.g. Codex), **launch plan/execute tasks** and
237
+ live-tail their logs.
238
+ - **Audit** — full-text search and click-through to the full input/output of any
239
+ entry.
240
+ - **Projects** — register/remove. **Secrets** — add/remove with reveal toggle
241
+ (names only). Plus a live **Approvals** queue.
137
242
 
138
243
  ## Skills
139
244
 
@@ -242,12 +347,16 @@ them behind the gateway's safety pipeline.
242
347
 
243
348
  ```bash
244
349
  localant setup | start | stop | restart | status | doctor | update | uninstall
350
+ localant token rotate | show # re-issue the auth token (secrets preserved)
245
351
  localant tunnel status
246
352
  localant dashboard | logs
247
353
  localant approvals list | approve <id> [--session] | deny <id>
248
354
  localant skills list | info <name> | enable <name> | disable <name> | install <git-url> | validate <name> | publish <name>
249
355
  localant projects list | add <path> [--name <n>] | remove <id>
250
356
  localant secrets set <name> [value] | list | remove <name>
357
+ localant tools list | profile <minimal|coding|full>
358
+ localant agents list | detect | run <agent> <projectId> <task> [--execute] | logs <taskId> | stop <taskId>
359
+ localant mcp list | test <name> | import-all
251
360
  ```
252
361
 
253
362
  ## Architecture
@@ -269,8 +378,9 @@ See [docs/architecture.md](docs/architecture.md).
269
378
 
270
379
  - **Does ChatGPT get a raw shell?** No. Only allowlisted commands run without
271
380
  approval; anything else needs an explicit local approval.
272
- - **Where is my config?** `~/Library/Application Support/LocalAnt` (macOS),
273
- `~/.config/LocalAnt` (Linux), `%APPDATA%/LocalAnt` (Windows).
381
+ - **Where is my config?** `~/.localant` on every platform (override with the
382
+ `LOCALANT_HOME` env var). A pre-1.x install under `~/Library/Application
383
+ Support/LocalAnt` / `~/.config/LocalAnt` is migrated automatically on first run.
274
384
  - **Do I need Claude Code/Codex/adb/Playwright?** Only for those specific tool
275
385
  families; they degrade gracefully with install guidance.
276
386
  - **Is the tunnel safe?** A public tunnel exposes the gateway; the auth token is
@@ -289,6 +399,13 @@ localant uninstall --purge # also deletes the config/data directory
289
399
  npm uninstall -g localant
290
400
  ```
291
401
 
402
+ ## Contributing
403
+
404
+ Contributions are welcome — especially tests and security hardening. See
405
+ [CONTRIBUTING.md](CONTRIBUTING.md) for setup, coding standards, and the release
406
+ process, and [ROADMAP.md](ROADMAP.md) for where the project is headed. Please
407
+ report vulnerabilities privately per [SECURITY.md](SECURITY.md).
408
+
292
409
  ## License
293
410
 
294
411
  MIT — see [LICENSE](LICENSE).
package/SECURITY.md CHANGED
@@ -12,7 +12,9 @@ describes the threat model and the controls that mitigate it.
12
12
  | Prompt-injected ChatGPT tries to read secrets/credentials | High | Secret vault (encrypted), redaction, sensitive-path blocklist |
13
13
  | Path traversal / symlink escape | High | `PathGuard` resolves realpaths and re-checks allowlist + blocklist |
14
14
  | Shell injection / command chaining | High | `CommandGuard` rejects pipes/redirection/substitution; allowlist prefix match; hard blocklist |
15
- | Public tunnel exposure | Medium | Mandatory auth token; dashboard warnings; tunnel is opt-out |
15
+ | Public tunnel exposure | Medium | Mandatory auth token; rate-limited `/mcp`; dashboard warnings; tunnel is opt-out |
16
+ | Malicious web page driving the local dashboard (CSRF / DNS-rebinding) | Medium | Dashboard `/api/*` requires a per-process token embedded only in the served HTML; non-local `Host` headers rejected |
17
+ | Token leakage via `?key=` in tunnel logs | Medium | Bearer header recommended; `localant token rotate` re-issues without losing secrets |
16
18
  | Malicious third-party skill | Medium | Skills disabled by default; per-skill permission manifest; isolated subprocess execution; only declared secrets injected |
17
19
  | Secret leakage to logs/responses | Medium | Deep redaction of known secret values + token-shaped strings |
18
20
 
@@ -54,20 +56,73 @@ human approves it; once-approvals are consumed after a single use.
54
56
 
55
57
  ## Shell safety
56
58
 
57
- - Allowlist prefix matching; pipeline/redirection/chaining/substitution rejected.
58
- - Hard blocklist enforced even after approval.
59
- - No shell interpreter validated commands are split to argv and executed
60
- directly with a timeout and output cap.
59
+ LocalAnt exposes two shell paths:
60
+
61
+ - **`shell_run_allowed_command`** (allowlist)allowlist prefix matching;
62
+ pipeline/redirection/chaining/substitution rejected; commands split to argv and
63
+ executed directly (no shell interpreter), with a timeout and output cap.
64
+ - **`bash`** (arbitrary, risk 3) — runs through a real shell (`bash -c`) so
65
+ pipelines and `&&` work, but **only after**:
66
+ - **CommandGuard** rejects blocked tokens (`sudo`, `su`, `dd`, `mkfs`,
67
+ `fdisk`, `diskutil`, `shutdown`, `reboot`, …) across *every* pipeline
68
+ segment, and rejects `rm -rf` / `chmod 777`;
69
+ - **PathGuard** validates the `cwd`;
70
+ - the security **mode policy** gates it (see below).
71
+
72
+ In **all** modes `CORE_BLOCKED_COMMAND_TOKENS` and `rm -rf` are rejected — even
73
+ in `yolo`, and even after approval. Background processes (`shell_run_background`)
74
+ go through the same guard.
75
+
76
+ ### Mode behaviour for `bash` (risk 3)
77
+
78
+ | Mode | `bash` behaviour |
79
+ |------|------------------|
80
+ | `strict` | requires approval; only allowlisted commands run without it |
81
+ | `open` | runs without approval but **always audited**; only risk-4 needs approval |
82
+ | `yolo` | runs without approval; blocklist + core tokens still rejected; audited |
61
83
 
62
84
  ## Secret safety
63
85
 
64
- - Secrets stored in an AES-256-GCM encrypted vault keyed from the local token.
65
- - Listing returns **names only**; values are never displayed.
86
+ - Secrets stored in an AES-256-GCM encrypted vault keyed from a **dedicated,
87
+ random vault key** held in `vault.key` (mode `0600`) — independent of the auth
88
+ token, so rotating the token never makes stored secrets undecryptable. Secrets
89
+ written by older versions (token-derived key) are transparently migrated.
90
+ - Listing returns **names only**; values are never displayed. `secret_set` stores
91
+ a value but **no tool ever returns it**; `secret_remove` is risk 4.
66
92
  - Tool output and audit entries are deep-redacted for known secret values and
67
- token-shaped strings.
93
+ token-shaped strings — including `bash` and coding-agent output.
68
94
  - Skills receive only the secret values they declare in their manifest, passed
69
95
  to an isolated subprocess — never the vault itself.
70
96
 
97
+ ## Dashboard safety
98
+
99
+ The dashboard binds to `127.0.0.1` only, but localhost binding alone does not
100
+ stop a malicious web page from issuing requests to it. Two additional controls
101
+ close that gap:
102
+
103
+ - **Per-process token**: every `/api/*` call must carry an `x-dashboard-token`
104
+ header. The token is embedded only in the dashboard HTML, which a cross-origin
105
+ page cannot read, and the custom header cannot be forged cross-origin without
106
+ a CORS preflight that is never granted — defeating CSRF.
107
+ - **Host allowlisting**: requests whose `Host` header is not local
108
+ (`localhost`, `127.0.0.1`, `::1`) are rejected, defeating DNS-rebinding.
109
+
110
+ ## Browser safety
111
+
112
+ - Browser automation uses an **isolated profile by default** — never your
113
+ day-to-day logged-in Chrome profile. Using a login-capable profile is an
114
+ explicit opt-in (`browser_use_profile`) and exposes your sessions to
115
+ automation; treat it as a strong-approval action.
116
+ - `browser_evaluate` (arbitrary in-page JS) is risk 4.
117
+
118
+ ## Network safety
119
+
120
+ - The public `/mcp` endpoint is rate-limited per client IP.
121
+ - Rotate the auth token at any time with `localant token rotate`; stored secrets
122
+ are preserved. Prefer `Authorization: Bearer <token>` over `?key=<token>` where
123
+ your client supports custom headers, since query strings can appear in proxy
124
+ and tunnel access logs.
125
+
71
126
  ## Skill safety
72
127
 
73
128
  - Generated and git-installed skills are saved **disabled**.
Binary file
Binary file
@@ -0,0 +1,41 @@
1
+ # Article Publisher (LocalAnt skill)
2
+
3
+ Draft and publish articles to **Zenn** (GitHub repo method), **Qiita** (official API),
4
+ and **note** / generic local drafts. This is the skill replacement for the former
5
+ built-in `zenn_*` / `qiita_*` / `note_*` / `article_create` tools.
6
+
7
+ ## Tools
8
+
9
+ | Tool | Notes |
10
+ |------|-------|
11
+ | `article_create` | Generic Markdown draft in the skill workspace. |
12
+ | `zenn_create_article` | Draft (`published:false`) under `<repoPath>/articles`. |
13
+ | `zenn_list_articles` | List article files in the repo. |
14
+ | `zenn_publish_article` | Flip `published:true` (then commit & push to publish). |
15
+ | `zenn_create_pr` | Commit changes on a new branch (`git` on PATH). |
16
+ | `qiita_create_private_article` | Create a private Qiita article. |
17
+ | `qiita_list_articles` | List your Qiita articles. |
18
+ | `qiita_publish_article` | Make a Qiita article public. |
19
+ | `note_create_draft` | Local note draft (note has no official write API). |
20
+
21
+ ## Setup
22
+
23
+ 1. **Qiita token** — store it as a secret named `QIITA_TOKEN` (dashboard → Secrets,
24
+ or `localant secrets set QIITA_TOKEN`). The skill reads it via `getSecret`; it is
25
+ never written by the skill. This replaces the old `qiita_configure_token` tool.
26
+ 2. **Zenn repo** — pass `repoPath` (your local Zenn content repo) on each Zenn call.
27
+ This replaces the old `zenn_configure_repo` tool.
28
+ 3. Enable the skill (skills are disabled by default), then call via `skill_run`:
29
+
30
+ ```
31
+ skill_run { name: "article-publisher", tool: "qiita_list_articles", input: {} }
32
+ ```
33
+
34
+ ## Differences from the old built-in tools
35
+
36
+ - `qiita_configure_token` → use standard secret management (`QIITA_TOKEN`).
37
+ - `zenn_configure_repo` → pass `repoPath` per call (stateless).
38
+ - `note_configure` / `note_publish_article` were thin MCP-bridge shims and are **not**
39
+ ported — note has no official public write API; publish manually or via an MCP bridge.
40
+ - Publish actions ran at risk 4 (double approval) as built-ins; as a skill they run
41
+ under `skill_run` (risk 3). Review before enabling.
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@localant-skill/article-publisher",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "dependencies": {
7
+ "@localant/skill-sdk": "workspace:*"
8
+ }
9
+ }