@aigencydev/cli 0.3.9 → 0.5.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.
@@ -0,0 +1,103 @@
1
+ export const EXPOSED_TOOL_SCHEMAS = [
2
+ {
3
+ name: "read_file",
4
+ description: "Read a file's contents with optional line range",
5
+ parameters: {
6
+ type: "object",
7
+ properties: {
8
+ path: { type: "string", description: "File path to read" },
9
+ startLine: { type: "number", description: "Start line (1-based, optional)" },
10
+ endLine: { type: "number", description: "End line (optional)" },
11
+ },
12
+ required: ["path"],
13
+ },
14
+ },
15
+ {
16
+ name: "list_files",
17
+ description: "List files and directories in a path",
18
+ parameters: {
19
+ type: "object",
20
+ properties: {
21
+ path: { type: "string", description: "Directory path" },
22
+ recursive: { type: "boolean", description: "Recurse into subdirectories" },
23
+ maxDepth: { type: "number", description: "Max recursion depth" },
24
+ },
25
+ required: ["path"],
26
+ },
27
+ },
28
+ {
29
+ name: "search_files",
30
+ description: "Search file contents with regex or literal pattern",
31
+ parameters: {
32
+ type: "object",
33
+ properties: {
34
+ pattern: { type: "string", description: "Search pattern" },
35
+ path: { type: "string", description: "Directory to search in" },
36
+ isRegex: { type: "boolean", description: "Treat pattern as regex" },
37
+ caseSensitive: { type: "boolean", description: "Case sensitive search" },
38
+ maxResults: { type: "number", description: "Max results to return" },
39
+ },
40
+ required: ["pattern"],
41
+ },
42
+ },
43
+ {
44
+ name: "write_file",
45
+ description: "Create a new file or overwrite an existing file",
46
+ parameters: {
47
+ type: "object",
48
+ properties: {
49
+ path: { type: "string", description: "File path" },
50
+ content: { type: "string", description: "File content to write" },
51
+ },
52
+ required: ["path", "content"],
53
+ },
54
+ },
55
+ {
56
+ name: "edit_file",
57
+ description: "Replace a text block in an existing file",
58
+ parameters: {
59
+ type: "object",
60
+ properties: {
61
+ path: { type: "string", description: "File path" },
62
+ old_string: { type: "string", description: "Text to find" },
63
+ new_string: { type: "string", description: "Replacement text" },
64
+ },
65
+ required: ["path", "old_string", "new_string"],
66
+ },
67
+ },
68
+ {
69
+ name: "bash_execute",
70
+ description: "Execute a shell command (non-interactive, 5 min timeout)",
71
+ parameters: {
72
+ type: "object",
73
+ properties: {
74
+ command: { type: "string", description: "Shell command to run" },
75
+ working_directory: { type: "string", description: "Working directory (optional)" },
76
+ timeout_ms: { type: "number", description: "Timeout in milliseconds" },
77
+ },
78
+ required: ["command"],
79
+ },
80
+ },
81
+ {
82
+ name: "verify_project",
83
+ description: "Health check for Node.js/Next.js/React/Vite projects",
84
+ parameters: {
85
+ type: "object",
86
+ properties: {
87
+ path: { type: "string", description: "Project directory path" },
88
+ type: { type: "string", enum: ["auto", "next", "react", "vite", "node"], description: "Project type" },
89
+ },
90
+ required: ["path"],
91
+ },
92
+ },
93
+ {
94
+ name: "check_dependencies",
95
+ description: "Check system and project dependencies (Node.js, npm, git, etc.)",
96
+ parameters: {
97
+ type: "object",
98
+ properties: {
99
+ path: { type: "string", description: "Project directory (optional)" },
100
+ },
101
+ },
102
+ },
103
+ ];
@@ -9,6 +9,9 @@ import { saveMemoryToolHandler, readMemoryToolHandler, deleteMemoryToolHandler,
9
9
  import { writeTasksHandler, readTasksHandler } from "./task-tools.js";
10
10
  import { verifyProjectHandler } from "./verify-project.js";
11
11
  import { assertDoneHandler } from "./assert-done.js";
12
+ import { checkDependenciesHandler } from "./check-dependencies.js";
13
+ import { docsLookupHandler } from "./docs-lookup.js";
14
+ import { listComponentsHandler } from "./components.js";
12
15
  const HANDLERS = {
13
16
  read_file: readFileTool,
14
17
  list_files: listFilesTool,
@@ -24,6 +27,9 @@ const HANDLERS = {
24
27
  read_tasks: readTasksHandler,
25
28
  verify_project: verifyProjectHandler,
26
29
  assert_done: assertDoneHandler,
30
+ check_dependencies: checkDependenciesHandler,
31
+ docs_lookup: docsLookupHandler,
32
+ list_components: listComponentsHandler,
27
33
  };
28
34
  export function hasLocalTool(name) {
29
35
  return name in HANDLERS;
@@ -56,3 +62,6 @@ export async function dispatchLocalTool(toolName, params, ctx) {
56
62
  export function listLocalTools() {
57
63
  return Object.keys(HANDLERS);
58
64
  }
65
+ export function isMcpTool(name) {
66
+ return name.startsWith("mcp_");
67
+ }
@@ -57,6 +57,22 @@ export const writeFileTool = async (params, ctx) => {
57
57
  catch {
58
58
  isNew = true;
59
59
  }
60
+ if (!isNew && existingContent === content) {
61
+ return {
62
+ success: false,
63
+ output: "",
64
+ error: "Dosya zaten güncel — içerik aynı, yazma yapılmadı.",
65
+ metadata: {
66
+ path: check.displayPath,
67
+ is_new: false,
68
+ noop: true,
69
+ bytes: content.length,
70
+ added: 0,
71
+ removed: 0,
72
+ },
73
+ duration: Date.now() - start,
74
+ };
75
+ }
60
76
  const diff = summarizeDiff(existingContent, content);
61
77
  const previewLines = isNew
62
78
  ? content.split(/\r?\n/).slice(0, 20).join("\n")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigencydev/cli",
3
- "version": "0.3.9",
3
+ "version": "0.5.0",
4
4
  "description": "AIGENCY CLI — terminalden yapay zeka destekli kod üretimi, dosya yönetimi ve proje otomasyonu.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,6 +26,7 @@
26
26
  "node": ">=18.18.0"
27
27
  },
28
28
  "dependencies": {
29
+ "@modelcontextprotocol/sdk": "^1.29.0",
29
30
  "commander": "^12.1.0",
30
31
  "ink": "^5.0.1",
31
32
  "ink-spinner": "^5.0.0",