agntx 1.0.1 → 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.
- package/README.md +112 -17
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +278 -19
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +9 -4
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +95 -24
- package/dist/commands/remove.js.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +6 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/discover.d.ts +3 -1
- package/dist/lib/discover.d.ts.map +1 -1
- package/dist/lib/discover.js +17 -3
- package/dist/lib/discover.js.map +1 -1
- package/dist/lib/git.d.ts +2 -1
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +176 -38
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/install.d.ts +14 -2
- package/dist/lib/install.d.ts.map +1 -1
- package/dist/lib/install.js +30 -13
- package/dist/lib/install.js.map +1 -1
- package/dist/lib/parse.d.ts +2 -0
- package/dist/lib/parse.d.ts.map +1 -1
- package/dist/lib/parse.js +45 -12
- package/dist/lib/parse.js.map +1 -1
- package/dist/lib/preferences.d.ts +13 -0
- package/dist/lib/preferences.d.ts.map +1 -0
- package/dist/lib/preferences.js +102 -0
- package/dist/lib/preferences.js.map +1 -0
- package/dist/lib/tracking.d.ts +6 -2
- package/dist/lib/tracking.d.ts.map +1 -1
- package/dist/lib/tracking.js +24 -5
- package/dist/lib/tracking.js.map +1 -1
- package/dist/utils/prompts.d.ts +7 -1
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +271 -15
- package/dist/utils/prompts.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,16 +22,92 @@ npx agntx add vercel-labs/agents
|
|
|
22
22
|
npx agntx add vercel-labs/agents
|
|
23
23
|
npx agntx add https://github.com/vercel-labs/agents
|
|
24
24
|
npx agntx add vercel-labs/agents#main
|
|
25
|
+
npx agntx add vercel-labs/agents --mode symlink
|
|
26
|
+
npx agntx add vercel-labs/agents --mode copy
|
|
27
|
+
npx agntx add vercel-labs/agents --no-symlink
|
|
28
|
+
npx agntx https://github.com/vercel-labs/agents
|
|
29
|
+
npx agntx https://github.com/ruvnet/claude-flow/.agents
|
|
30
|
+
npx agntx https://github.com/ruvnet/claude-flow/.cursor
|
|
25
31
|
```
|
|
26
32
|
|
|
27
33
|
**Options:**
|
|
28
34
|
- `-g, --global` - Install to user-level (`~/.<agent>/agents/`) instead of project-level
|
|
29
35
|
- `-a, --agent <agents>` - Specify target agents: `cursor`, `claude`, `codex`, or `*` for all
|
|
30
36
|
- `-s, --agent-file <names>` - Specify agent names to install (use `*` for all)
|
|
37
|
+
- `--mode <symlink|copy>` - Install mode for tool directories (`symlink` recommended)
|
|
38
|
+
- `--no-symlink` - Shortcut for `--mode copy`
|
|
31
39
|
- `-l, --list` - List available agents in repo without installing
|
|
32
40
|
- `-y, --yes` - Skip confirmation prompts
|
|
41
|
+
- `-f, --force` - Overwrite existing installed files without prompting
|
|
33
42
|
- `--all` - Shorthand for `--agent-file '*' --agent '*' -y`
|
|
34
43
|
|
|
44
|
+
When running interactively (without `-y`), the wizard prompts for:
|
|
45
|
+
- agents to install
|
|
46
|
+
- target tools
|
|
47
|
+
- installation scope (`project` or `global`)
|
|
48
|
+
- install mode (`symlink` or `copy`)
|
|
49
|
+
- final proceed confirmation
|
|
50
|
+
|
|
51
|
+
### Install Mode and Canonical Storage
|
|
52
|
+
|
|
53
|
+
Install mode is independent from target tools.
|
|
54
|
+
|
|
55
|
+
`agntx` always materializes selected agents in a canonical directory first, then installs to selected tools:
|
|
56
|
+
|
|
57
|
+
- Project scope canonical dir: `.agents/agents/`
|
|
58
|
+
- Global scope canonical dir: `~/.agents/agents/`
|
|
59
|
+
|
|
60
|
+
In `symlink` mode (default on macOS/unix), tool files are symlinks to canonical files.
|
|
61
|
+
In `copy` mode, tool files are copied from canonical files.
|
|
62
|
+
|
|
63
|
+
Example (`cursor` only, project scope, `symlink` mode):
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
.agents/agents/my-agent.md # real file
|
|
67
|
+
.cursor/agents/my-agent.md # symlink to canonical file
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Note: symlink mode currently supports macOS/unix. Use `--mode copy` (or `--no-symlink`) otherwise.
|
|
71
|
+
|
|
72
|
+
### Wizard Defaults Cache
|
|
73
|
+
|
|
74
|
+
After a successful interactive install, `agntx` saves your defaults to:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
~/.agntx/preferences.json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Cached defaults include:
|
|
81
|
+
- selected target tools
|
|
82
|
+
- installation scope (`project` or `global`)
|
|
83
|
+
- install mode (`symlink` or `copy`)
|
|
84
|
+
|
|
85
|
+
Precedence rules:
|
|
86
|
+
- explicit CLI flags always win (`-g`, `-a`, `--mode`, `--no-symlink`)
|
|
87
|
+
- cache is used as the interactive default when flags are omitted
|
|
88
|
+
- `-y` / `--all` stays promptless and deterministic
|
|
89
|
+
|
|
90
|
+
### Source Directory Selection
|
|
91
|
+
|
|
92
|
+
By default, `agntx` only discovers agents in these source directories:
|
|
93
|
+
|
|
94
|
+
- `.agents/agents`
|
|
95
|
+
- `.cursor/agents`
|
|
96
|
+
- `.claude/agents`
|
|
97
|
+
|
|
98
|
+
If multiple directories are found, you'll be prompted to select one.
|
|
99
|
+
You can also select one directly in the GitHub URL suffix:
|
|
100
|
+
|
|
101
|
+
- `https://github.com/<owner>/<repo>/.agents` -> `.agents/agents`
|
|
102
|
+
- `https://github.com/<owner>/<repo>/.cursor` -> `.cursor/agents`
|
|
103
|
+
- `https://github.com/<owner>/<repo>/.claude` -> `.claude/agents`
|
|
104
|
+
|
|
105
|
+
If none of the standard source directories exist, install exits with a warning.
|
|
106
|
+
|
|
107
|
+
Installed agents preserve the source directory structure and original filenames.
|
|
108
|
+
|
|
109
|
+
To speed up large repositories, `agntx` fetches only these source directories via sparse checkout and falls back to a full checkout if sparse operations are not supported.
|
|
110
|
+
|
|
35
111
|
### Remove agents
|
|
36
112
|
|
|
37
113
|
```bash
|
|
@@ -115,6 +191,7 @@ Your agent's system prompt goes here.
|
|
|
115
191
|
|
|
116
192
|
### Project-level (current project only)
|
|
117
193
|
```
|
|
194
|
+
.agents/agents/
|
|
118
195
|
.cursor/agents/
|
|
119
196
|
.claude/agents/
|
|
120
197
|
.codex/agents/
|
|
@@ -122,6 +199,7 @@ Your agent's system prompt goes here.
|
|
|
122
199
|
|
|
123
200
|
### User-level (global, all projects)
|
|
124
201
|
```
|
|
202
|
+
~/.agents/agents/
|
|
125
203
|
~/.cursor/agents/
|
|
126
204
|
~/.claude/agents/
|
|
127
205
|
~/.codex/agents/
|
|
@@ -135,15 +213,9 @@ Your agent's system prompt goes here.
|
|
|
135
213
|
$ npx agntx add vercel-labs/agents
|
|
136
214
|
|
|
137
215
|
Fetching vercel-labs/agents...
|
|
216
|
+
Found 5 agents in .agents/agents
|
|
138
217
|
|
|
139
|
-
|
|
140
|
-
✓ code-review Review code for best practices
|
|
141
|
-
✓ pr-summary Generate PR summaries
|
|
142
|
-
✓ test-writer Write unit tests
|
|
143
|
-
✓ docs-generator Generate documentation
|
|
144
|
-
✓ refactor Suggest refactoring improvements
|
|
145
|
-
|
|
146
|
-
? Select agents to install: (Press <space> to select, <a> to toggle all)
|
|
218
|
+
? Select agents to install:
|
|
147
219
|
❯ ◉ code-review
|
|
148
220
|
◉ pr-summary
|
|
149
221
|
◯ test-writer
|
|
@@ -152,16 +224,39 @@ Found 5 agents:
|
|
|
152
224
|
|
|
153
225
|
? Select target agent tools:
|
|
154
226
|
❯ ◉ cursor
|
|
155
|
-
◉ claude
|
|
227
|
+
◉ claude code
|
|
156
228
|
◯ codex
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
229
|
+
───
|
|
230
|
+
- openclaw (coming soon)
|
|
231
|
+
- cline (coming soon)
|
|
232
|
+
|
|
233
|
+
? Select installation scope:
|
|
234
|
+
❯ Project (Install in current directory) (recommended)
|
|
235
|
+
Global (Install for all projects)
|
|
236
|
+
|
|
237
|
+
? Select install mode:
|
|
238
|
+
❯ symlink (recommended)
|
|
239
|
+
copy
|
|
240
|
+
|
|
241
|
+
? Proceed with installation?
|
|
242
|
+
- Source: vercel-labs/agents:.agents/agents
|
|
243
|
+
- Agents (2): code-review, pr-summary
|
|
244
|
+
- Tools: cursor, claude
|
|
245
|
+
- Scope: project
|
|
246
|
+
- Install mode: symlink
|
|
247
|
+
- Canonical directory: .agents/agents
|
|
248
|
+
|
|
249
|
+
Installing 2 agents using symlink mode to 2 tools (project scope)...
|
|
250
|
+
✓ code-review → .cursor/agents/code-review.md
|
|
251
|
+
✓ code-review → .claude/agents/code-review.md
|
|
252
|
+
✓ pr-summary → .cursor/agents/pr-summary.md
|
|
253
|
+
✓ pr-summary → .claude/agents/pr-summary.md
|
|
254
|
+
|
|
255
|
+
✓ Done! Installed 4 agent files.
|
|
256
|
+
ℹ Summary: 4 installed, 0 failed, 0 skipped.
|
|
257
|
+
ℹ cursor: 2 installed, 0 failed, 0 skipped
|
|
258
|
+
ℹ claude: 2 installed, 0 failed, 0 skipped
|
|
259
|
+
ℹ Saved install defaults to ~/.agntx/preferences.json
|
|
165
260
|
```
|
|
166
261
|
|
|
167
262
|
## License
|
package/dist/commands/add.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export interface AddOptions {
|
|
|
4
4
|
agentFile?: string;
|
|
5
5
|
list?: boolean;
|
|
6
6
|
yes?: boolean;
|
|
7
|
+
force?: boolean;
|
|
7
8
|
all?: boolean;
|
|
9
|
+
mode?: string;
|
|
10
|
+
symlink?: boolean;
|
|
8
11
|
}
|
|
9
12
|
export declare function addCommand(packageInput: string, options: AddOptions): Promise<void>;
|
|
10
13
|
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,UAAU;IACzB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAkBD,wBAAsB,UAAU,CAC9B,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CA6Xf"}
|
package/dist/commands/add.js
CHANGED
|
@@ -1,38 +1,145 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.addCommand = addCommand;
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
7
42
|
const ora_1 = __importDefault(require("ora"));
|
|
43
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
44
|
const git_1 = require("../lib/git");
|
|
9
45
|
const discover_1 = require("../lib/discover");
|
|
10
46
|
const install_1 = require("../lib/install");
|
|
11
47
|
const config_1 = require("../lib/config");
|
|
48
|
+
const preferences_1 = require("../lib/preferences");
|
|
12
49
|
const prompts_1 = require("../utils/prompts");
|
|
13
50
|
const output_1 = require("../utils/output");
|
|
51
|
+
function parseInstallMode(mode) {
|
|
52
|
+
if (mode === "symlink" || mode === "copy") {
|
|
53
|
+
return mode;
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function traceStep(message, active = false) {
|
|
58
|
+
const marker = active ? chalk_1.default.cyan("◇") : chalk_1.default.green("◆");
|
|
59
|
+
console.log(`${marker} ${message}`);
|
|
60
|
+
}
|
|
61
|
+
function traceRail() {
|
|
62
|
+
console.log(chalk_1.default.dim("│"));
|
|
63
|
+
}
|
|
14
64
|
async function addCommand(packageInput, options) {
|
|
15
|
-
const spinner = (0, ora_1.default)(
|
|
65
|
+
const spinner = (0, ora_1.default)();
|
|
16
66
|
try {
|
|
67
|
+
traceRail();
|
|
17
68
|
// Parse package identifier
|
|
18
69
|
const packageInfo = (0, git_1.resolvePackage)(packageInput);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const
|
|
70
|
+
const sourceUrl = `https://github.com/${packageInfo.owner}/${packageInfo.repo}.git${packageInfo.ref ? `#${packageInfo.ref}` : ""}`;
|
|
71
|
+
traceStep(`Source: ${sourceUrl}`);
|
|
72
|
+
traceRail();
|
|
73
|
+
// Clone or fetch repository (sparse to agent source directories).
|
|
74
|
+
spinner.start(`Cloning ${packageInfo.owner}/${packageInfo.repo}...`);
|
|
75
|
+
const sparsePaths = packageInfo.sourceRoot
|
|
76
|
+
? [packageInfo.sourceRoot]
|
|
77
|
+
: discover_1.STANDARD_SOURCE_ROOTS;
|
|
78
|
+
const repoPath = await (0, git_1.cloneOrFetchRepo)(packageInfo, sparsePaths);
|
|
79
|
+
spinner.stop();
|
|
80
|
+
traceStep("Repository cloned");
|
|
81
|
+
traceRail();
|
|
82
|
+
spinner.start("Discovering agents...");
|
|
83
|
+
// Resolve source directory
|
|
84
|
+
const availableSourceRoots = (0, discover_1.findAvailableSourceRoots)(repoPath);
|
|
85
|
+
let sourceRoot;
|
|
86
|
+
if (packageInfo.sourceRoot) {
|
|
87
|
+
sourceRoot = packageInfo.sourceRoot;
|
|
88
|
+
if (!availableSourceRoots.includes(sourceRoot)) {
|
|
89
|
+
spinner.fail(`Source directory not found: ${sourceRoot}`);
|
|
90
|
+
(0, output_1.warn)(`Available source directories: ${availableSourceRoots.length > 0
|
|
91
|
+
? availableSourceRoots.join(", ")
|
|
92
|
+
: discover_1.STANDARD_SOURCE_ROOTS.join(", ")}`);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
if (availableSourceRoots.length === 0) {
|
|
98
|
+
spinner.fail("No standard agent source directories found");
|
|
99
|
+
(0, output_1.warn)(`Expected one of: ${discover_1.STANDARD_SOURCE_ROOTS.join(", ")}`);
|
|
100
|
+
process.exit(1);
|
|
101
|
+
}
|
|
102
|
+
if (availableSourceRoots.length === 1) {
|
|
103
|
+
sourceRoot = availableSourceRoots[0];
|
|
104
|
+
}
|
|
105
|
+
else if (options.yes) {
|
|
106
|
+
spinner.fail("Multiple source directories found");
|
|
107
|
+
(0, output_1.warn)("Use a suffixed GitHub URL (/.agents, /.cursor, /.claude) to select one source directory.");
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
spinner.stop();
|
|
112
|
+
sourceRoot = await (0, prompts_1.selectSourceRoot)(availableSourceRoots);
|
|
113
|
+
spinner.start("Discovering agents...");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Discover agents from selected source directory only
|
|
117
|
+
const agents = await (0, discover_1.discoverAgents)(repoPath, sourceRoot);
|
|
25
118
|
if (agents.length === 0) {
|
|
26
119
|
spinner.fail("No agents found in repository");
|
|
27
120
|
return;
|
|
28
121
|
}
|
|
29
|
-
spinner.
|
|
122
|
+
spinner.stop();
|
|
123
|
+
traceStep(`Found ${agents.length} agent${agents.length === 1 ? "" : "s"} in ${sourceRoot}`);
|
|
124
|
+
traceRail();
|
|
125
|
+
// Warn on duplicate names in the selected source directory
|
|
126
|
+
const nameCounts = new Map();
|
|
127
|
+
for (const agent of agents) {
|
|
128
|
+
nameCounts.set(agent.name, (nameCounts.get(agent.name) || 0) + 1);
|
|
129
|
+
}
|
|
130
|
+
const duplicateNames = [...nameCounts.entries()]
|
|
131
|
+
.filter(([, count]) => count > 1)
|
|
132
|
+
.map(([name]) => name);
|
|
133
|
+
if (duplicateNames.length > 0) {
|
|
134
|
+
(0, output_1.warn)(`Duplicate agent names found in source directory: ${duplicateNames.join(", ")}`);
|
|
135
|
+
}
|
|
30
136
|
// List mode
|
|
31
137
|
if (options.list) {
|
|
32
138
|
console.log("\nAvailable agents:");
|
|
33
139
|
console.log((0, output_1.formatAgentList)(agents));
|
|
34
140
|
return;
|
|
35
141
|
}
|
|
142
|
+
const cachedPreferences = (0, preferences_1.readInstallPreferences)();
|
|
36
143
|
// Determine which agents to install
|
|
37
144
|
let agentsToInstall;
|
|
38
145
|
if (options.all || options.agentFile === "*") {
|
|
@@ -58,44 +165,196 @@ async function addCommand(packageInput, options) {
|
|
|
58
165
|
}
|
|
59
166
|
// Determine target agent tools
|
|
60
167
|
let targetTools;
|
|
168
|
+
const allTools = (0, config_1.getAllAgentTools)();
|
|
61
169
|
if (options.all || options.agent === "*") {
|
|
62
|
-
targetTools =
|
|
170
|
+
targetTools = allTools;
|
|
63
171
|
}
|
|
64
172
|
else if (options.agent) {
|
|
65
173
|
const tools = options.agent.split(",").map((t) => t.trim());
|
|
66
|
-
targetTools = tools.filter((t) =>
|
|
174
|
+
targetTools = tools.filter((t) => allTools.includes(t));
|
|
67
175
|
if (targetTools.length === 0) {
|
|
68
176
|
(0, output_1.error)("Invalid agent tool specified");
|
|
69
177
|
return;
|
|
70
178
|
}
|
|
71
179
|
}
|
|
72
180
|
else if (options.yes || options.all) {
|
|
73
|
-
targetTools =
|
|
181
|
+
targetTools = allTools;
|
|
74
182
|
}
|
|
75
183
|
else {
|
|
76
|
-
|
|
184
|
+
const defaultTools = cachedPreferences?.defaultTools?.filter((tool) => allTools.includes(tool));
|
|
185
|
+
targetTools = await (0, prompts_1.selectAgentTools)(allTools, defaultTools && defaultTools.length > 0 ? defaultTools : allTools);
|
|
77
186
|
if (targetTools.length === 0) {
|
|
78
187
|
(0, output_1.info)("No agent tools selected");
|
|
79
188
|
return;
|
|
80
189
|
}
|
|
81
190
|
}
|
|
191
|
+
// Determine installation scope independently from selected tools and mode
|
|
192
|
+
let installScope;
|
|
193
|
+
if (options.global) {
|
|
194
|
+
installScope = "global";
|
|
195
|
+
}
|
|
196
|
+
else if (options.yes || options.all) {
|
|
197
|
+
installScope = "project";
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
installScope = await (0, prompts_1.selectInstallationScope)(cachedPreferences?.defaultScope || "project");
|
|
201
|
+
}
|
|
202
|
+
const isGlobalInstall = installScope === "global";
|
|
203
|
+
// Determine install mode independently from target tool selection
|
|
204
|
+
let installMode;
|
|
205
|
+
if (options.mode) {
|
|
206
|
+
const parsedMode = parseInstallMode(options.mode.toLowerCase());
|
|
207
|
+
if (!parsedMode) {
|
|
208
|
+
(0, output_1.error)(`Invalid install mode: ${options.mode}. Use "symlink" or "copy".`);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
installMode = parsedMode;
|
|
212
|
+
}
|
|
213
|
+
else if (options.symlink === false) {
|
|
214
|
+
installMode = "copy";
|
|
215
|
+
}
|
|
216
|
+
else if (options.yes || options.all) {
|
|
217
|
+
installMode = "symlink";
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
installMode = await (0, prompts_1.selectInstallMode)(cachedPreferences?.defaultMode || "symlink");
|
|
221
|
+
}
|
|
82
222
|
// Install agents
|
|
83
|
-
const source = `${packageInfo.owner}/${packageInfo.repo}${packageInfo.ref ? `#${packageInfo.ref}` : ""}`;
|
|
84
|
-
const
|
|
85
|
-
|
|
223
|
+
const source = `${packageInfo.owner}/${packageInfo.repo}${packageInfo.ref ? `#${packageInfo.ref}` : ""}:${sourceRoot}`;
|
|
224
|
+
const canonicalDir = (0, config_1.getCanonicalAgentDir)(isGlobalInstall);
|
|
225
|
+
const scopeLabel = isGlobalInstall ? "global" : "project";
|
|
226
|
+
if (!options.yes && !options.all) {
|
|
227
|
+
const selectedAgentNames = agentsToInstall.map((agent) => agent.name);
|
|
228
|
+
const summarizedAgentNames = selectedAgentNames.length > 5
|
|
229
|
+
? `${selectedAgentNames.slice(0, 5).join(", ")} +${selectedAgentNames.length - 5} more`
|
|
230
|
+
: selectedAgentNames.join(", ");
|
|
231
|
+
const shouldProceed = await (0, prompts_1.confirmInstallPlan)([
|
|
232
|
+
`Source: ${source}`,
|
|
233
|
+
`Agents (${agentsToInstall.length}): ${summarizedAgentNames}`,
|
|
234
|
+
`Tools: ${targetTools.join(", ")}`,
|
|
235
|
+
`Scope: ${scopeLabel}`,
|
|
236
|
+
`Install mode: ${installMode}`,
|
|
237
|
+
`Canonical directory: ${canonicalDir}`,
|
|
238
|
+
]);
|
|
239
|
+
if (!shouldProceed) {
|
|
240
|
+
(0, output_1.info)("Installation cancelled");
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
(0, output_1.info)(`Installing ${agentsToInstall.length} agent${agentsToInstall.length === 1 ? "" : "s"} using ${installMode} mode to ${targetTools.length} tool${targetTools.length === 1 ? "" : "s"} (${scopeLabel} scope)...`);
|
|
245
|
+
let installedCount = 0;
|
|
246
|
+
let failedCount = 0;
|
|
247
|
+
let skippedCount = 0;
|
|
248
|
+
let canonicalFailureCount = 0;
|
|
249
|
+
let canonicalSkippedCount = 0;
|
|
250
|
+
const toolStats = new Map();
|
|
251
|
+
for (const tool of targetTools) {
|
|
252
|
+
toolStats.set(tool, { installed: 0, failed: 0, skipped: 0 });
|
|
253
|
+
}
|
|
86
254
|
for (const agent of agentsToInstall) {
|
|
255
|
+
const installPath = agent.installPath || path.basename(agent.path);
|
|
256
|
+
const sourcePath = path.join(repoPath, agent.path);
|
|
257
|
+
const canonicalPath = path.join(canonicalDir, installPath);
|
|
258
|
+
try {
|
|
259
|
+
let overwriteCanonical = true;
|
|
260
|
+
if (fs.existsSync(canonicalPath) && !options.force && !options.yes) {
|
|
261
|
+
overwriteCanonical = await (0, prompts_1.confirmAction)(`canonical: ${installPath} already exists. Overwrite?`, false);
|
|
262
|
+
}
|
|
263
|
+
if (!overwriteCanonical) {
|
|
264
|
+
(0, output_1.info)(`Skipped canonical: ${installPath}`);
|
|
265
|
+
canonicalSkippedCount++;
|
|
266
|
+
skippedCount += targetTools.length;
|
|
267
|
+
for (const tool of targetTools) {
|
|
268
|
+
const stats = toolStats.get(tool);
|
|
269
|
+
if (stats) {
|
|
270
|
+
stats.skipped++;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
// Canonical files are always concrete files, never symlinks.
|
|
276
|
+
await (0, install_1.materializeAgentFile)(sourcePath, canonicalDir, installPath, "copy", overwriteCanonical);
|
|
277
|
+
}
|
|
278
|
+
catch (err) {
|
|
279
|
+
(0, output_1.error)(`Failed to materialize canonical file for ${agent.name}: ${err instanceof Error ? err.message : String(err)}`);
|
|
280
|
+
canonicalFailureCount++;
|
|
281
|
+
failedCount += targetTools.length;
|
|
282
|
+
for (const tool of targetTools) {
|
|
283
|
+
const stats = toolStats.get(tool);
|
|
284
|
+
if (stats) {
|
|
285
|
+
stats.failed++;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
87
290
|
for (const tool of targetTools) {
|
|
88
|
-
const targetDir = (0, config_1.getAgentDirs)(tool,
|
|
291
|
+
const targetDir = (0, config_1.getAgentDirs)(tool, isGlobalInstall);
|
|
292
|
+
const targetPath = path.join(targetDir, installPath);
|
|
89
293
|
try {
|
|
90
|
-
|
|
91
|
-
(
|
|
294
|
+
let overwrite = true;
|
|
295
|
+
if (fs.existsSync(targetPath) && !options.force && !options.yes) {
|
|
296
|
+
overwrite = await (0, prompts_1.confirmAction)(`${tool}: ${installPath} already exists. Overwrite?`, false);
|
|
297
|
+
if (!overwrite) {
|
|
298
|
+
(0, output_1.info)(`Skipped ${tool}: ${installPath}`);
|
|
299
|
+
skippedCount++;
|
|
300
|
+
const stats = toolStats.get(tool);
|
|
301
|
+
if (stats) {
|
|
302
|
+
stats.skipped++;
|
|
303
|
+
}
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
await (0, install_1.installAgent)({
|
|
308
|
+
agent,
|
|
309
|
+
sourcePath: canonicalPath,
|
|
310
|
+
targetDir,
|
|
311
|
+
source,
|
|
312
|
+
mode: installMode,
|
|
313
|
+
canonicalPath,
|
|
314
|
+
overwrite
|
|
315
|
+
});
|
|
316
|
+
(0, output_1.success)(`${agent.name} → ${targetDir}/${installPath}`);
|
|
317
|
+
installedCount++;
|
|
318
|
+
const stats = toolStats.get(tool);
|
|
319
|
+
if (stats) {
|
|
320
|
+
stats.installed++;
|
|
321
|
+
}
|
|
92
322
|
}
|
|
93
323
|
catch (err) {
|
|
324
|
+
failedCount++;
|
|
325
|
+
const stats = toolStats.get(tool);
|
|
326
|
+
if (stats) {
|
|
327
|
+
stats.failed++;
|
|
328
|
+
}
|
|
94
329
|
(0, output_1.error)(`Failed to install ${agent.name} to ${tool}: ${err instanceof Error ? err.message : String(err)}`);
|
|
95
330
|
}
|
|
96
331
|
}
|
|
97
332
|
}
|
|
98
|
-
(0, output_1.success)(`Done! Installed ${
|
|
333
|
+
(0, output_1.success)(`Done! Installed ${installedCount} agent file${installedCount === 1 ? "" : "s"}.`);
|
|
334
|
+
(0, output_1.info)(`Summary: ${installedCount} installed, ${failedCount} failed, ${skippedCount} skipped.`);
|
|
335
|
+
for (const tool of targetTools) {
|
|
336
|
+
const stats = toolStats.get(tool);
|
|
337
|
+
if (!stats) {
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
(0, output_1.info)(`${tool}: ${stats.installed} installed, ${stats.failed} failed, ${stats.skipped} skipped`);
|
|
341
|
+
}
|
|
342
|
+
if (canonicalFailureCount > 0 || canonicalSkippedCount > 0) {
|
|
343
|
+
(0, output_1.info)(`Canonical: ${canonicalFailureCount} failed, ${canonicalSkippedCount} skipped`);
|
|
344
|
+
}
|
|
345
|
+
if (installedCount > 0) {
|
|
346
|
+
try {
|
|
347
|
+
(0, preferences_1.writeInstallPreferences)({
|
|
348
|
+
defaultTools: targetTools,
|
|
349
|
+
defaultScope: installScope,
|
|
350
|
+
defaultMode: installMode,
|
|
351
|
+
});
|
|
352
|
+
(0, output_1.info)(`Saved install defaults to ${(0, preferences_1.getPreferencesPath)()}`);
|
|
353
|
+
}
|
|
354
|
+
catch (err) {
|
|
355
|
+
(0, output_1.warn)(`Could not save install defaults: ${err instanceof Error ? err.message : String(err)}`);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
99
358
|
}
|
|
100
359
|
catch (err) {
|
|
101
360
|
spinner.fail(err instanceof Error ? err.message : String(err));
|
package/dist/commands/add.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":";;;;;AAmBA,gCAkHC;AApID,8CAAqB;AACrB,oCAA6D;AAC7D,8CAAgD;AAChD,4CAA6C;AAE7C,0CAAyE;AACzE,8CAAiE;AACjE,4CAAuE;AAWhE,KAAK,UAAU,UAAU,CAC9B,YAAoB,EACpB,OAAmB;IAEnB,MAAM,OAAO,GAAG,IAAA,aAAG,EAAC,wBAAwB,CAAC,CAAC,KAAK,EAAE,CAAA;IAErD,IAAI,CAAC;QACH,2BAA2B;QAC3B,MAAM,WAAW,GAAG,IAAA,oBAAc,EAAC,YAAY,CAAC,CAAA;QAChD,OAAO,CAAC,IAAI,GAAG,YAAY,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,IAAI,KAAK,CAAA;QAErE,4BAA4B;QAC5B,MAAM,QAA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CAAC,CAAC,CAAA;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4ErE"}
|
package/dist/commands/list.js
CHANGED
|
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.listCommand = listCommand;
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
41
42
|
const chalk_1 = __importDefault(require("chalk"));
|
|
42
43
|
const config_1 = require("../lib/config");
|
|
43
44
|
const tracking_1 = require("../lib/tracking");
|
|
@@ -56,10 +57,10 @@ async function listCommand(options) {
|
|
|
56
57
|
const agentDir = (0, config_1.getAgentDirs)(tool, options.global || false);
|
|
57
58
|
if (fs.existsSync(agentDir)) {
|
|
58
59
|
const installed = (0, tracking_1.getInstalledAgents)(agentDir);
|
|
59
|
-
for (const [
|
|
60
|
+
for (const [installedPath, info] of Object.entries(installed)) {
|
|
60
61
|
// Try to read description from the agent file
|
|
61
62
|
let description;
|
|
62
|
-
const agentPath =
|
|
63
|
+
const agentPath = path.join(agentDir, info.installedPath || installedPath);
|
|
63
64
|
if (fs.existsSync(agentPath)) {
|
|
64
65
|
try {
|
|
65
66
|
const content = fs.readFileSync(agentPath, "utf-8");
|
|
@@ -75,7 +76,11 @@ async function listCommand(options) {
|
|
|
75
76
|
// Ignore errors reading description
|
|
76
77
|
}
|
|
77
78
|
}
|
|
78
|
-
agentsByTool[tool].push({
|
|
79
|
+
agentsByTool[tool].push({
|
|
80
|
+
name: info.name,
|
|
81
|
+
mode: info.mode || (info.symlink ? "symlink" : "copy"),
|
|
82
|
+
description,
|
|
83
|
+
});
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
}
|
|
@@ -89,7 +94,7 @@ async function listCommand(options) {
|
|
|
89
94
|
console.log(` ${chalk_1.default.cyan(tool)}:`);
|
|
90
95
|
for (const agent of agents) {
|
|
91
96
|
const desc = agent.description ? ` ${agent.description}` : "";
|
|
92
|
-
console.log(` ${agent.name}${desc}`);
|
|
97
|
+
console.log(` ${agent.name} [${agent.mode}]${desc}`);
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
100
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,kCA4EC;AAvFD,uCAAwB;AACxB,2CAA4B;AAC5B,kDAAyB;AACzB,0CAAyE;AACzE,8CAAoD;AAO7C,KAAK,UAAU,WAAW,CAAC,OAAoB;IACpD,IAAI,CAAC;QACH,MAAM,WAAW,GAAgB,OAAO,CAAC,KAAK;YAC5C,CAAC,CAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAiB,CAAC,MAAM,CACnE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,yBAAgB,GAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CACtC;YACH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