Skip to content

Commit 3a78886

Browse files
laisoclaude
andcommitted
fix: Git ツール名を commitChanges から commit にリネーム (書籍 ch07.5 との整合)
書籍本文 ch07.5 節「cli.ts へのツール組み込み」では Git コミット用ツールが commit という名前で定義・import されている。リポジトリ側を本文に合わせて コミット用ツールの export 名と LLM ツール名 (Tool#name) を commit に揃える。 変更箇所: - src/tools/git.ts: export 名と name フィールド - bin/cli.ts: import と tools オブジェクト登録 - chapters/07-verification.ts: モックの name とログ Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 532b454 commit 3a78886

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

bin/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Agent } from '../src/core/agent';
33
import { loadInstructions } from '../src/core/prompt';
44
import { createModelFromEnv } from '../src/providers/modelFactory';
55
import { readFile, writeFile, editFile, execCommand } from '../src/tools';
6-
import { createBranch, commitChanges, pushBranch } from '../src/tools/git';
6+
import { createBranch, commit, pushBranch } from '../src/tools/git';
77
import { createPullRequest, createIssueComment } from '../src/tools/github';
88
import { mkdirSync, existsSync } from 'fs';
99
import { join } from 'path';
@@ -153,7 +153,7 @@ ${issueText}
153153
editFile,
154154
execCommand,
155155
createBranch,
156-
commitChanges,
156+
commit,
157157
pushBranch,
158158
createPullRequest,
159159
createIssueComment,

chapters/07-verification.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const mockCreateBranchTool = {
2020
};
2121

2222
const mockCommitTool = {
23-
name: 'commitChanges',
23+
name: 'commit',
2424
description: 'メッセージ付きで変更をコミットする。変更がない場合はコミットしない。',
2525
needsApproval: true,
2626
parameters: {
@@ -32,7 +32,7 @@ const mockCommitTool = {
3232
required: ["message", "files"]
3333
},
3434
execute: async (args: any) => {
35-
console.log(`[Mock] commitChanges called with: ${JSON.stringify(args)}`);
35+
console.log(`[Mock] commit called with: ${JSON.stringify(args)}`);
3636
return `コミットしました: ${args.message}`;
3737
}
3838
};

src/tools/git.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export const createBranch = {
7373
}
7474
};
7575

76-
export const commitChanges = {
77-
name: 'commitChanges',
76+
export const commit = {
77+
name: 'commit',
7878
description: 'メッセージ付きで変更をコミットする。変更がない場合はコミットしない。',
7979
needsApproval: true,
8080
parameters: {

0 commit comments

Comments
 (0)