opencode-agents 1.1.1 → 1.1.2
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/dist/index.js +57 -74
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/commands/add.ts +23 -24
- package/src/commands/list.ts +9 -9
- package/src/core/installer.ts +0 -3
package/dist/index.js
CHANGED
|
@@ -9676,10 +9676,10 @@ var require_index_688c5d50 = __commonJS({
|
|
|
9676
9676
|
throw new Error("unknown meta: " + entry.type);
|
|
9677
9677
|
}
|
|
9678
9678
|
}
|
|
9679
|
-
abort(
|
|
9679
|
+
abort(error) {
|
|
9680
9680
|
this[ABORTED] = true;
|
|
9681
|
-
this.emit("abort",
|
|
9682
|
-
this.warn("TAR_ABORT",
|
|
9681
|
+
this.emit("abort", error);
|
|
9682
|
+
this.warn("TAR_ABORT", error, { recoverable: false });
|
|
9683
9683
|
}
|
|
9684
9684
|
write(chunk) {
|
|
9685
9685
|
if (this[ABORTED])
|
|
@@ -14907,10 +14907,10 @@ var require_index_688c5d50 = __commonJS({
|
|
|
14907
14907
|
var abs = this._makeAbs(f);
|
|
14908
14908
|
this.cache[abs] = "FILE";
|
|
14909
14909
|
if (abs === this.cwdAbs) {
|
|
14910
|
-
var
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
throw
|
|
14910
|
+
var error = new Error(er.code + " invalid cwd " + this.cwd);
|
|
14911
|
+
error.path = this.cwd;
|
|
14912
|
+
error.code = er.code;
|
|
14913
|
+
throw error;
|
|
14914
14914
|
}
|
|
14915
14915
|
break;
|
|
14916
14916
|
case "ENOENT":
|
|
@@ -15514,10 +15514,10 @@ var require_index_688c5d50 = __commonJS({
|
|
|
15514
15514
|
var abs = this._makeAbs(f);
|
|
15515
15515
|
this.cache[abs] = "FILE";
|
|
15516
15516
|
if (abs === this.cwdAbs) {
|
|
15517
|
-
var
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
this.emit("error",
|
|
15517
|
+
var error = new Error(er.code + " invalid cwd " + this.cwd);
|
|
15518
|
+
error.path = this.cwd;
|
|
15519
|
+
error.code = er.code;
|
|
15520
|
+
this.emit("error", error);
|
|
15521
15521
|
this.abort();
|
|
15522
15522
|
}
|
|
15523
15523
|
break;
|
|
@@ -16393,14 +16393,14 @@ var require_index_688c5d50 = __commonJS({
|
|
|
16393
16393
|
} else {
|
|
16394
16394
|
exports3.storage.removeItem("debug");
|
|
16395
16395
|
}
|
|
16396
|
-
} catch (
|
|
16396
|
+
} catch (error) {
|
|
16397
16397
|
}
|
|
16398
16398
|
}
|
|
16399
16399
|
function load() {
|
|
16400
16400
|
let r;
|
|
16401
16401
|
try {
|
|
16402
16402
|
r = exports3.storage.getItem("debug");
|
|
16403
|
-
} catch (
|
|
16403
|
+
} catch (error) {
|
|
16404
16404
|
}
|
|
16405
16405
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
16406
16406
|
r = process.env.DEBUG;
|
|
@@ -16410,7 +16410,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
16410
16410
|
function localstorage() {
|
|
16411
16411
|
try {
|
|
16412
16412
|
return localStorage;
|
|
16413
|
-
} catch (
|
|
16413
|
+
} catch (error) {
|
|
16414
16414
|
}
|
|
16415
16415
|
}
|
|
16416
16416
|
module3.exports = common(exports3);
|
|
@@ -16418,8 +16418,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
16418
16418
|
formatters.j = function(v) {
|
|
16419
16419
|
try {
|
|
16420
16420
|
return JSON.stringify(v);
|
|
16421
|
-
} catch (
|
|
16422
|
-
return "[UnexpectedJSONParseError]: " +
|
|
16421
|
+
} catch (error) {
|
|
16422
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
16423
16423
|
}
|
|
16424
16424
|
};
|
|
16425
16425
|
});
|
|
@@ -16518,7 +16518,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
16518
16518
|
221
|
|
16519
16519
|
];
|
|
16520
16520
|
}
|
|
16521
|
-
} catch (
|
|
16521
|
+
} catch (error) {
|
|
16522
16522
|
}
|
|
16523
16523
|
exports3.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
16524
16524
|
return /^debug_/i.test(key);
|
|
@@ -17429,11 +17429,11 @@ var require_index_688c5d50 = __commonJS({
|
|
|
17429
17429
|
hash
|
|
17430
17430
|
};
|
|
17431
17431
|
});
|
|
17432
|
-
} catch (
|
|
17432
|
+
} catch (error) {
|
|
17433
17433
|
throw new DegitError(`could not fetch remote ${repo.url}`, {
|
|
17434
17434
|
code: "COULD_NOT_FETCH",
|
|
17435
17435
|
url: repo.url,
|
|
17436
|
-
original:
|
|
17436
|
+
original: error
|
|
17437
17437
|
});
|
|
17438
17438
|
}
|
|
17439
17439
|
}
|
|
@@ -23421,9 +23421,9 @@ var require_async_iterator = __commonJS({
|
|
|
23421
23421
|
},
|
|
23422
23422
|
next: function next() {
|
|
23423
23423
|
var _this = this;
|
|
23424
|
-
var
|
|
23425
|
-
if (
|
|
23426
|
-
return Promise.reject(
|
|
23424
|
+
var error = this[kError];
|
|
23425
|
+
if (error !== null) {
|
|
23426
|
+
return Promise.reject(error);
|
|
23427
23427
|
}
|
|
23428
23428
|
if (this[kEnded]) {
|
|
23429
23429
|
return Promise.resolve(createIterResult(void 0, true));
|
|
@@ -23536,8 +23536,8 @@ var require_from = __commonJS({
|
|
|
23536
23536
|
try {
|
|
23537
23537
|
var info = gen[key](arg);
|
|
23538
23538
|
var value = info.value;
|
|
23539
|
-
} catch (
|
|
23540
|
-
reject(
|
|
23539
|
+
} catch (error) {
|
|
23540
|
+
reject(error);
|
|
23541
23541
|
return;
|
|
23542
23542
|
}
|
|
23543
23543
|
if (info.done) {
|
|
@@ -24567,16 +24567,16 @@ var require_pipeline = __commonJS({
|
|
|
24567
24567
|
if (streams.length < 2) {
|
|
24568
24568
|
throw new ERR_MISSING_ARGS("streams");
|
|
24569
24569
|
}
|
|
24570
|
-
var
|
|
24570
|
+
var error;
|
|
24571
24571
|
var destroys = streams.map(function(stream, i) {
|
|
24572
24572
|
var reading = i < streams.length - 1;
|
|
24573
24573
|
var writing = i > 0;
|
|
24574
24574
|
return destroyer(stream, reading, writing, function(err) {
|
|
24575
|
-
if (!
|
|
24575
|
+
if (!error) error = err;
|
|
24576
24576
|
if (err) destroys.forEach(call);
|
|
24577
24577
|
if (reading) return;
|
|
24578
24578
|
destroys.forEach(call);
|
|
24579
|
-
callback(
|
|
24579
|
+
callback(error);
|
|
24580
24580
|
});
|
|
24581
24581
|
});
|
|
24582
24582
|
return streams.reduce(pipe);
|
|
@@ -26912,7 +26912,6 @@ var logger = {
|
|
|
26912
26912
|
// src/core/installer.ts
|
|
26913
26913
|
async function installAgent(options2) {
|
|
26914
26914
|
const { source, sourcePath, global: global2, platforms, agentName, copy, selectedAgents } = options2;
|
|
26915
|
-
logger.info(`Installing agent from: ${source}`);
|
|
26916
26915
|
let tempDir;
|
|
26917
26916
|
let agents;
|
|
26918
26917
|
if (selectedAgents) {
|
|
@@ -26946,7 +26945,6 @@ async function installAgent(options2) {
|
|
|
26946
26945
|
} else {
|
|
26947
26946
|
copyFileSync2(sourcePath2, finalPath);
|
|
26948
26947
|
}
|
|
26949
|
-
logger.success(`Copied agent "${name}" to ${finalPath}`);
|
|
26950
26948
|
}
|
|
26951
26949
|
}
|
|
26952
26950
|
}
|
|
@@ -27099,20 +27097,6 @@ function showBanner() {
|
|
|
27099
27097
|
console.log(` ${import_picocolors2.default.dim("$")} ${import_picocolors2.default.cyan("npx opencode-agents find")} ${import_picocolors2.default.dim("Search for agents")}`);
|
|
27100
27098
|
console.log();
|
|
27101
27099
|
}
|
|
27102
|
-
function renderSkillCard(name, description, index) {
|
|
27103
|
-
console.log();
|
|
27104
|
-
console.log(` ${S_BAR}`);
|
|
27105
|
-
console.log(` ${S_BRANCH} ${import_picocolors2.default.cyan("Agent:")} ${import_picocolors2.default.bold(name)}`);
|
|
27106
|
-
console.log(` ${S_BAR}`);
|
|
27107
|
-
console.log(` ${S_BRANCH_END} ${import_picocolors2.default.dim(description)}`);
|
|
27108
|
-
console.log();
|
|
27109
|
-
}
|
|
27110
|
-
function success(message) {
|
|
27111
|
-
console.log(` ${import_picocolors2.default.green("\u2713")} ${message}`);
|
|
27112
|
-
}
|
|
27113
|
-
function error(message) {
|
|
27114
|
-
console.log(` ${import_picocolors2.default.red("\u2717")} ${message}`);
|
|
27115
|
-
}
|
|
27116
27100
|
|
|
27117
27101
|
// src/commands/add.ts
|
|
27118
27102
|
async function promptInstallLocation() {
|
|
@@ -27179,24 +27163,24 @@ async function addCommand(source, options2) {
|
|
|
27179
27163
|
let tempDir;
|
|
27180
27164
|
try {
|
|
27181
27165
|
tempDir = await fetchSource2(source);
|
|
27182
|
-
s.stop("Repository cloned");
|
|
27166
|
+
s.stop(import_picocolors3.default.green("\u2713 Repository cloned"));
|
|
27183
27167
|
} catch (err) {
|
|
27184
|
-
s.stop("Failed to clone repository");
|
|
27185
|
-
error(`Failed to fetch source: ${err instanceof Error ? err.message : String(err)}`);
|
|
27168
|
+
s.stop(import_picocolors3.default.red("\u2717 Failed to clone repository"));
|
|
27169
|
+
R2.error(`Failed to fetch source: ${err instanceof Error ? err.message : String(err)}`);
|
|
27186
27170
|
process.exit(1);
|
|
27187
27171
|
}
|
|
27188
27172
|
s.start("Discovering agents...");
|
|
27189
27173
|
let agents;
|
|
27190
27174
|
try {
|
|
27191
27175
|
agents = await discoverFromDirectory(tempDir);
|
|
27192
|
-
s.stop(
|
|
27176
|
+
s.stop(import_picocolors3.default.green(`\u2713 Found ${agents.length} agent(s)`));
|
|
27193
27177
|
} catch (err) {
|
|
27194
|
-
s.stop("Failed to discover agents");
|
|
27195
|
-
error(`Failed to discover agents: ${err instanceof Error ? err.message : String(err)}`);
|
|
27178
|
+
s.stop(import_picocolors3.default.red("\u2717 Failed to discover agents"));
|
|
27179
|
+
R2.error(`Failed to discover agents: ${err instanceof Error ? err.message : String(err)}`);
|
|
27196
27180
|
process.exit(1);
|
|
27197
27181
|
}
|
|
27198
27182
|
if (agents.length === 0) {
|
|
27199
|
-
error("No agents found in the source");
|
|
27183
|
+
R2.error("No agents found in the source");
|
|
27200
27184
|
process.exit(1);
|
|
27201
27185
|
}
|
|
27202
27186
|
let selectedAgents;
|
|
@@ -27210,14 +27194,15 @@ async function addCommand(source, options2) {
|
|
|
27210
27194
|
process.exit(0);
|
|
27211
27195
|
}
|
|
27212
27196
|
console.log();
|
|
27213
|
-
|
|
27214
|
-
|
|
27215
|
-
|
|
27216
|
-
|
|
27217
|
-
|
|
27218
|
-
);
|
|
27219
|
-
}
|
|
27220
|
-
|
|
27197
|
+
console.log(import_picocolors3.default.dim(` ${S_BRANCH} Selected agents:`));
|
|
27198
|
+
selectedAgents.forEach((agent, index) => {
|
|
27199
|
+
const isLast = index === selectedAgents.length - 1;
|
|
27200
|
+
const prefix = isLast ? S_BRANCH_END : S_BRANCH;
|
|
27201
|
+
const name = agent.agent.name || basename4(agent.path, ".md");
|
|
27202
|
+
console.log(` ${S_BAR} ${prefix} ${S_BULLET} ${import_picocolors3.default.bold(name)}`);
|
|
27203
|
+
});
|
|
27204
|
+
console.log();
|
|
27205
|
+
s.start("Installing agents...");
|
|
27221
27206
|
try {
|
|
27222
27207
|
let platforms;
|
|
27223
27208
|
if (options2.agent && options2.agent.length > 0) {
|
|
@@ -27236,16 +27221,14 @@ async function addCommand(source, options2) {
|
|
|
27236
27221
|
selectedAgents
|
|
27237
27222
|
};
|
|
27238
27223
|
await installAgent(installOptions);
|
|
27239
|
-
s.stop(import_picocolors3.default.green(
|
|
27240
|
-
console.log();
|
|
27241
|
-
success("Installation complete!");
|
|
27224
|
+
s.stop(import_picocolors3.default.green(`\u2713 Successfully installed ${selectedAgents.length} agent(s)`));
|
|
27242
27225
|
console.log();
|
|
27243
|
-
console.log(import_picocolors3.default.dim("
|
|
27244
|
-
console.log(import_picocolors3.default.dim(` npx opencode-agents list`));
|
|
27226
|
+
console.log(import_picocolors3.default.dim(" Next steps:"));
|
|
27227
|
+
console.log(import_picocolors3.default.dim(` npx opencode-agents list View installed agents`));
|
|
27245
27228
|
console.log();
|
|
27246
27229
|
} catch (err) {
|
|
27247
|
-
s.stop("Installation failed");
|
|
27248
|
-
error(`Failed to install agent: ${err instanceof Error ? err.message : String(err)}`);
|
|
27230
|
+
s.stop(import_picocolors3.default.red("\u2717 Installation failed"));
|
|
27231
|
+
R2.error(`Failed to install agent: ${err instanceof Error ? err.message : String(err)}`);
|
|
27249
27232
|
process.exit(1);
|
|
27250
27233
|
} finally {
|
|
27251
27234
|
if (existsSync4(tempDir) && tempDir.startsWith(tmpdir2())) {
|
|
@@ -27272,32 +27255,32 @@ async function listCommand(options2) {
|
|
|
27272
27255
|
continue;
|
|
27273
27256
|
}
|
|
27274
27257
|
hasAnyAgents = true;
|
|
27275
|
-
console.log(import_picocolors4.default.bold(import_picocolors4.default.cyan(
|
|
27258
|
+
console.log(import_picocolors4.default.bold(import_picocolors4.default.cyan(`\u25C6 ${platform} agents`)));
|
|
27276
27259
|
console.log();
|
|
27277
27260
|
if (projectAgents.length > 0) {
|
|
27278
|
-
console.log(` ${S_BRANCH} ${import_picocolors4.default.dim("Project")} ${import_picocolors4.default.dim("(./.opencode/agents/)")}`);
|
|
27261
|
+
console.log(` ${globalAgents.length > 0 ? S_BRANCH : S_BRANCH_END} ${import_picocolors4.default.dim("Project")} ${import_picocolors4.default.dim("(./.opencode/agents/)")}`);
|
|
27279
27262
|
projectAgents.forEach((agent, index) => {
|
|
27280
|
-
const isLast = index === projectAgents.length - 1
|
|
27263
|
+
const isLast = index === projectAgents.length - 1;
|
|
27281
27264
|
const prefix = isLast ? S_BRANCH_END : S_BRANCH;
|
|
27282
27265
|
const name = agent.agent.name || agent.path.split(/[/\\]/).pop()?.replace(".md", "") || "unknown";
|
|
27283
27266
|
const mode = agent.agent.mode || "subagent";
|
|
27284
|
-
console.log(` ${S_BAR} ${prefix} ${S_BULLET} ${import_picocolors4.default.bold(name)} ${import_picocolors4.default.dim(`[${mode}]`)}`);
|
|
27267
|
+
console.log(` ${globalAgents.length > 0 ? S_BAR : " "} ${prefix} ${S_BULLET} ${import_picocolors4.default.bold(name)} ${import_picocolors4.default.dim(`[${mode}]`)}`);
|
|
27285
27268
|
if (agent.agent.description) {
|
|
27286
|
-
console.log(` ${S_BAR} ${isLast ? " " : `${S_BAR} `} ${import_picocolors4.default.dim(agent.agent.description)}`);
|
|
27269
|
+
console.log(` ${globalAgents.length > 0 ? S_BAR : " "} ${isLast ? " " : `${S_BAR} `} ${import_picocolors4.default.dim(agent.agent.description)}`);
|
|
27287
27270
|
}
|
|
27288
27271
|
});
|
|
27289
27272
|
console.log();
|
|
27290
27273
|
}
|
|
27291
27274
|
if (globalAgents.length > 0) {
|
|
27292
|
-
console.log(` ${
|
|
27275
|
+
console.log(` ${S_BRANCH_END} ${import_picocolors4.default.dim("Global")} ${import_picocolors4.default.dim("(~/.config/opencode/agents/)")}`);
|
|
27293
27276
|
globalAgents.forEach((agent, index) => {
|
|
27294
27277
|
const isLast = index === globalAgents.length - 1;
|
|
27295
27278
|
const prefix = isLast ? S_BRANCH_END : S_BRANCH;
|
|
27296
27279
|
const name = agent.agent.name || agent.path.split(/[/\\]/).pop()?.replace(".md", "") || "unknown";
|
|
27297
27280
|
const mode = agent.agent.mode || "subagent";
|
|
27298
|
-
console.log(`
|
|
27281
|
+
console.log(` ${prefix} ${S_BULLET} ${import_picocolors4.default.bold(name)} ${import_picocolors4.default.dim(`[${mode}]`)}`);
|
|
27299
27282
|
if (agent.agent.description) {
|
|
27300
|
-
console.log(`
|
|
27283
|
+
console.log(` ${isLast ? " " : `${S_BAR} `} ${import_picocolors4.default.dim(agent.agent.description)}`);
|
|
27301
27284
|
}
|
|
27302
27285
|
});
|
|
27303
27286
|
console.log();
|
|
@@ -27306,7 +27289,7 @@ async function listCommand(options2) {
|
|
|
27306
27289
|
if (!hasAnyAgents) {
|
|
27307
27290
|
R2.info(import_picocolors4.default.dim("No agents installed"));
|
|
27308
27291
|
console.log();
|
|
27309
|
-
console.log(import_picocolors4.default.dim("
|
|
27292
|
+
console.log(import_picocolors4.default.dim(" To install an agent:"));
|
|
27310
27293
|
console.log(import_picocolors4.default.dim(` npx opencode-agents add <repo>`));
|
|
27311
27294
|
console.log();
|
|
27312
27295
|
}
|