agent-calling 1.0.2 → 1.0.3

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.
@@ -9,10 +9,8 @@
9
9
  },
10
10
  "mcpServers": {
11
11
  "claude-mcp": {
12
- "command": "node",
13
- "args": [
14
- "${extensionPath}/dist/index.js"
15
- ]
12
+ "command": "agent-calling",
13
+ "args": []
16
14
  }
17
15
  },
18
16
  "tools": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-calling",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A Gemini CLI plugin that wraps Claude CLI with path hijacking.",
5
5
  "bin": {
6
6
  "agent-calling": "./dist/index.js"
@@ -17,6 +17,7 @@
17
17
  "files": [
18
18
  "dist",
19
19
  "agents",
20
+ "scripts",
20
21
  "GEMINI.md",
21
22
  "gemini-extension.json"
22
23
  ],
@@ -27,7 +28,8 @@
27
28
  "build": "tsc",
28
29
  "prepublishOnly": "npm run build",
29
30
  "start": "node dist/index.js",
30
- "test": "echo \"Error: no test specified\" && exit 1"
31
+ "test": "echo \"Error: no test specified\" && exit 1",
32
+ "postinstall": "node scripts/install.js"
31
33
  },
32
34
  "keywords": [],
33
35
  "author": "",
@@ -0,0 +1,38 @@
1
+ // scripts/install-ext.js
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const os = require('os');
5
+
6
+ const targetDir = path.join(os.homedir(), '.gemini', 'extensions', 'agent-calling');
7
+
8
+ if (!fs.existsSync(targetDir)) {
9
+ fs.mkdirSync(targetDir, { recursive: true });
10
+ }
11
+
12
+ const resources = [
13
+ 'gemini-extension.json',
14
+ 'agents',
15
+ 'GEMINI.md'
16
+ ];
17
+
18
+ console.log('installing extension file to ~/.gemini/extensions/agent-calling...');
19
+
20
+ resources.forEach(res => {
21
+ // __dirname 指向 scripts 目录,所以需要回退一层到项目根目录
22
+ const srcPath = path.join(__dirname, '..', res);
23
+ const destPath = path.join(targetDir, res);
24
+
25
+ if (fs.existsSync(srcPath)) {
26
+ const stat = fs.statSync(srcPath);
27
+ if (stat.isDirectory()) {
28
+ // 递归复制文件夹
29
+ fs.cpSync(srcPath, destPath, { recursive: true, force: true });
30
+ } else {
31
+ // 复制单文件
32
+ fs.copyFileSync(srcPath, destPath);
33
+ }
34
+ console.log(`installed: ${res}`);
35
+ } else {
36
+ console.warn(`warning: not found path ${srcPath}`);
37
+ }
38
+ });