@make-u-free/migi 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@make-u-free/migi",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Your AI right-hand agent. Works anywhere, with any LLM API.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/agent.js CHANGED
@@ -25,6 +25,14 @@ export class MigiAgent {
25
25
  - 主体的に提案する。「ついでにこれもやっておきましょうか?」
26
26
  - 壁打ちのときはカジュアルに寄り添う
27
27
 
28
+ ## 自律的な行動
29
+ - タスクを依頼されたら、完了するまで自分で考えて動き続ける
30
+ - エラーが出ても即座にユーザーに聞かない。まず自分でエラーを読んで原因を考え、修正を試みる
31
+ - 同じエラーを3回以上繰り返した場合のみユーザーに報告する
32
+ - ファイルを読む・コマンドを実行する・結果を確認する、というループを自分で回す
33
+ - 「どうしますか?」と聞く前に、自分でできることをやりきる
34
+ - 完了したらまとめて報告する。途中経過は簡潔に
35
+
28
36
  ## メモリ
29
37
  - ユーザーが「覚えておいて」「記録して」「remember」と言ったら、必ず memory.md に書き出す
30
38
  - グローバルメモリ: ${homedir()}/.migi/memory.md(どのワークスペースでも使う情報)
@@ -8,15 +8,29 @@ const AUTO_APPROVED = new Set(['read_file', 'list_files', 'search_content'])
8
8
  * bin/migi.js から readline の question 関数を受け取る
9
9
  */
10
10
  export function createPermissionChecker(promptFn) {
11
+ let approveAll = false
12
+
11
13
  return async function checkPermission(toolName, args) {
12
14
  if (AUTO_APPROVED.has(toolName)) return true
15
+ if (approveAll) {
16
+ console.log(chalk.dim(` [${toolName}] 自動承認`))
17
+ return true
18
+ }
13
19
 
14
20
  console.log(chalk.yellow('\n ⚡ 実行確認'))
15
21
  console.log(chalk.dim(` ツール : ${toolName}`))
16
22
  if (args.path) console.log(chalk.dim(` パス : ${args.path}`))
17
23
  if (args.command) console.log(chalk.dim(` コマンド: ${args.command}`))
18
24
 
19
- const answer = await promptFn(chalk.yellow(' 実行しますか? [y/N] '))
20
- return answer.trim().toLowerCase() === 'y'
25
+ const answer = await promptFn(chalk.yellow(' 実行しますか? [y/a/N] y=yes a=以降すべてyes N=no > '))
26
+ const input = answer.trim().toLowerCase()
27
+
28
+ if (input === 'a') {
29
+ approveAll = true
30
+ console.log(chalk.green(' 以降の操作をすべて自動承認します。'))
31
+ return true
32
+ }
33
+
34
+ return input === 'y'
21
35
  }
22
36
  }