opencode-agents 1.1.0 → 1.1.1

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 CHANGED
@@ -27255,6 +27255,7 @@ async function addCommand(source, options2) {
27255
27255
  }
27256
27256
 
27257
27257
  // src/commands/list.ts
27258
+ var import_picocolors4 = __toESM(require_picocolors(), 1);
27258
27259
  async function listCommand(options2) {
27259
27260
  let platforms;
27260
27261
  if (options2.agent) {
@@ -27262,25 +27263,53 @@ async function listCommand(options2) {
27262
27263
  } else {
27263
27264
  platforms = ["opencode"];
27264
27265
  }
27265
- const scope = options2.global ? "global" : "project";
27266
+ console.log();
27267
+ let hasAnyAgents = false;
27266
27268
  for (const platform of platforms) {
27267
- const agents = listInstalledAgents(platform, options2.global);
27268
- if (agents.length === 0) {
27269
- logger.info(`No agents found for ${platform} (${scope})`);
27269
+ const projectAgents = listInstalledAgents(platform, false);
27270
+ const globalAgents = listInstalledAgents(platform, true);
27271
+ if (projectAgents.length === 0 && globalAgents.length === 0) {
27270
27272
  continue;
27271
27273
  }
27272
- console.log(source_default.bold(`
27273
- ${platform} agents (${scope}):
27274
- `));
27275
- for (const agent of agents) {
27276
- const name = agent.agent.name || agent.path.split(/[/\\]/).pop()?.replace(".md", "") || "unknown";
27277
- const mode = agent.agent.mode || "subagent";
27278
- const description = agent.agent.description || "No description";
27279
- console.log(` ${source_default.cyan(name)} ${source_default.gray(`[${mode}]`)}`);
27280
- console.log(` ${source_default.dim(description)}
27281
- `);
27274
+ hasAnyAgents = true;
27275
+ console.log(import_picocolors4.default.bold(import_picocolors4.default.cyan(`${platform} agents`)));
27276
+ console.log();
27277
+ if (projectAgents.length > 0) {
27278
+ console.log(` ${S_BRANCH} ${import_picocolors4.default.dim("Project")} ${import_picocolors4.default.dim("(./.opencode/agents/)")}`);
27279
+ projectAgents.forEach((agent, index) => {
27280
+ const isLast = index === projectAgents.length - 1 && globalAgents.length === 0;
27281
+ const prefix = isLast ? S_BRANCH_END : S_BRANCH;
27282
+ const name = agent.agent.name || agent.path.split(/[/\\]/).pop()?.replace(".md", "") || "unknown";
27283
+ const mode = agent.agent.mode || "subagent";
27284
+ console.log(` ${S_BAR} ${prefix} ${S_BULLET} ${import_picocolors4.default.bold(name)} ${import_picocolors4.default.dim(`[${mode}]`)}`);
27285
+ if (agent.agent.description) {
27286
+ console.log(` ${S_BAR} ${isLast ? " " : `${S_BAR} `} ${import_picocolors4.default.dim(agent.agent.description)}`);
27287
+ }
27288
+ });
27289
+ console.log();
27290
+ }
27291
+ if (globalAgents.length > 0) {
27292
+ console.log(` ${projectAgents.length > 0 ? S_BRANCH : S_BRANCH_END} ${import_picocolors4.default.dim("Global")} ${import_picocolors4.default.dim("(~/.config/opencode/agents/)")}`);
27293
+ globalAgents.forEach((agent, index) => {
27294
+ const isLast = index === globalAgents.length - 1;
27295
+ const prefix = isLast ? S_BRANCH_END : S_BRANCH;
27296
+ const name = agent.agent.name || agent.path.split(/[/\\]/).pop()?.replace(".md", "") || "unknown";
27297
+ const mode = agent.agent.mode || "subagent";
27298
+ console.log(` ${projectAgents.length > 0 ? S_BAR : " "} ${prefix} ${S_BULLET} ${import_picocolors4.default.bold(name)} ${import_picocolors4.default.dim(`[${mode}]`)}`);
27299
+ if (agent.agent.description) {
27300
+ console.log(` ${projectAgents.length > 0 ? S_BAR : " "} ${isLast ? " " : `${S_BAR} `} ${import_picocolors4.default.dim(agent.agent.description)}`);
27301
+ }
27302
+ });
27303
+ console.log();
27282
27304
  }
27283
27305
  }
27306
+ if (!hasAnyAgents) {
27307
+ R2.info(import_picocolors4.default.dim("No agents installed"));
27308
+ console.log();
27309
+ console.log(import_picocolors4.default.dim(" Try:"));
27310
+ console.log(import_picocolors4.default.dim(` npx opencode-agents add <repo>`));
27311
+ console.log();
27312
+ }
27284
27313
  }
27285
27314
 
27286
27315
  // src/commands/remove.ts