agentscfg 0.1.0-alpha.3 → 0.1.0-alpha.4

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.cjs +42 -49
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -63,7 +63,7 @@ Run `agentscfg <command> --help` for detailed help on each command.
63
63
  ## Outputs
64
64
 
65
65
  - Claude Code: `CLAUDE.md`, `.claude/skills/<skill>/...`
66
- - OpenCode: `.opencode/agent/default.md`, `.opencode/skill/<skill>/...`
66
+ - OpenCode: `.opencode/skill/<skill>/...` (agent/config files come from `.agentscfg/targets/opencode/**`)
67
67
  - Codex CLI: `AGENTS.md`, `.codex/skills/<skill>/...`
68
68
 
69
69
  ### Target Mappings
package/dist/cli.cjs CHANGED
@@ -26791,7 +26791,7 @@ var findRepoRoot = (start3) => Effect_exports.gen(function* (_) {
26791
26791
  });
26792
26792
 
26793
26793
  // package.json
26794
- var version = "0.1.0-alpha.3";
26794
+ var version = "0.1.0-alpha.4";
26795
26795
 
26796
26796
  // src/cli/commands/init.ts
26797
26797
  var import_node_path4 = __toESM(require("node:path"), 1);
@@ -27176,29 +27176,6 @@ var compileInstructions = (cfg, instructions, outputs) => Effect_exports.gen(fun
27176
27176
  );
27177
27177
  outputsList.push({ path: outputs.codex, content, sha });
27178
27178
  }
27179
- if (outputs.opencode) {
27180
- const body = [
27181
- "---",
27182
- "name: default",
27183
- "purpose: Generated default agent from canonical instructions",
27184
- "---",
27185
- "",
27186
- "# Default Agent (Generated by agentscfg)",
27187
- "",
27188
- "## Base",
27189
- baseNormalized,
27190
- "",
27191
- includeProject ? "## Project" : void 0,
27192
- includeProject ? projectNormalized ?? "" : void 0,
27193
- "",
27194
- footer(".opencode/agent/default.md", includeProject, sha)
27195
- ].filter((line) => line !== void 0).join("\n");
27196
- const content = applyNewlines(
27197
- ensureTrailingNewline(normalizeLf(body)),
27198
- cfg.output.newlines
27199
- );
27200
- outputsList.push({ path: outputs.opencode, content, sha });
27201
- }
27202
27179
  return {
27203
27180
  sha,
27204
27181
  includeProject,
@@ -27234,7 +27211,6 @@ var opencodeClaudeCompatSkillsRoot = (repoRoot) => import_node_path8.default.joi
27234
27211
  var expectedOutputPaths = (repoRoot) => /* @__PURE__ */ new Set([
27235
27212
  claudeInstructionPath(repoRoot),
27236
27213
  codexInstructionPath(repoRoot),
27237
- opencodeInstructionPath(repoRoot),
27238
27214
  mcpConfigPath(repoRoot)
27239
27215
  ]);
27240
27216
  var isExpectedOutput = (repoRoot, targetPath) => expectedOutputPaths(repoRoot).has(targetPath);
@@ -27396,8 +27372,7 @@ var planWorkspace = (ws, options) => Effect_exports.gen(function* (_) {
27396
27372
  const instructionOutputs = yield* _(
27397
27373
  compileInstructions(ws.cfg, ws.instructions, {
27398
27374
  claude: targets.has("claude") ? claudeInstructionPath(ws.repoRoot) : void 0,
27399
- codex: targets.has("codex") ? codexInstructionPath(ws.repoRoot) : void 0,
27400
- opencode: targets.has("opencode") ? opencodeInstructionPath(ws.repoRoot) : void 0
27375
+ codex: targets.has("codex") ? codexInstructionPath(ws.repoRoot) : void 0
27401
27376
  })
27402
27377
  );
27403
27378
  const normalizeOutputContent = (input) => applyNewlines2(
@@ -28227,7 +28202,6 @@ var doctorCommand = (repoRoot) => Effect_exports.gen(function* (_) {
28227
28202
  const outputPaths = [
28228
28203
  claudeInstructionPath(repoRoot),
28229
28204
  import_node_path11.default.join(repoRoot, ".claude"),
28230
- opencodeInstructionPath(repoRoot),
28231
28205
  import_node_path11.default.join(repoRoot, ".opencode"),
28232
28206
  codexInstructionPath(repoRoot),
28233
28207
  import_node_path11.default.join(repoRoot, ".codex"),
@@ -28268,10 +28242,10 @@ var getInstructionPath = (target, repoRoot) => {
28268
28242
  switch (target) {
28269
28243
  case "claude":
28270
28244
  return claudeInstructionPath(repoRoot);
28271
- case "opencode":
28272
- return opencodeInstructionPath(repoRoot);
28273
28245
  case "codex":
28274
28246
  return codexInstructionPath(repoRoot);
28247
+ case "opencode":
28248
+ return null;
28275
28249
  }
28276
28250
  };
28277
28251
  var getSkillsRoot = (target, repoRoot) => {
@@ -28316,31 +28290,48 @@ var statusCommand = (repoRoot, options) => Effect_exports.gen(function* (_) {
28316
28290
  const pendingWritePaths = new Set(
28317
28291
  plan.ops.filter((op) => op.type === "WriteFile").map((op) => op.path)
28318
28292
  );
28319
- const pendingCopyPaths = new Set(
28320
- plan.ops.filter((op) => op.type === "CopyDir").map((op) => op.to)
28321
- );
28293
+ const joinRelPath = (root, rel) => import_node_path12.default.join(root, ...rel.split("/"));
28294
+ const pendingCopyFilePaths = /* @__PURE__ */ new Set();
28295
+ for (const op of plan.ops) {
28296
+ if (op.type !== "CopyDir")
28297
+ continue;
28298
+ for (const file of op.files) {
28299
+ pendingCopyFilePaths.add(joinRelPath(op.to, file.rel));
28300
+ }
28301
+ }
28302
+ const hasPendingCopyFor = (targetPath) => pendingCopyFilePaths.has(targetPath);
28303
+ const hasPendingCopyUnder = (targetDir) => {
28304
+ for (const p of pendingCopyFilePaths) {
28305
+ if (p === targetDir || p.startsWith(targetDir + import_node_path12.default.sep)) {
28306
+ return true;
28307
+ }
28308
+ }
28309
+ return false;
28310
+ };
28322
28311
  for (const target of targetNames) {
28323
28312
  const enabled2 = ws.cfg.targets[target].enabled;
28324
28313
  const instructionPath = getInstructionPath(target, repoRoot);
28325
28314
  const skillsRootPath = getSkillsRoot(target, repoRoot);
28326
- const instructionExists = yield* _(exists4(instructionPath));
28315
+ const instructionExists = instructionPath ? yield* _(exists4(instructionPath)) : false;
28327
28316
  const skillsRootExists = yield* _(exists4(skillsRootPath));
28328
28317
  let instructionStatus;
28329
- if (!enabled2) {
28330
- instructionStatus = instructionExists ? "synced" : "missing";
28331
- } else if (!instructionExists) {
28332
- instructionStatus = "missing";
28333
- } else if (pendingWritePaths.has(instructionPath)) {
28334
- instructionStatus = "outdated";
28335
- } else {
28336
- instructionStatus = "synced";
28318
+ if (instructionPath) {
28319
+ if (!enabled2) {
28320
+ instructionStatus = instructionExists ? "synced" : "missing";
28321
+ } else if (!instructionExists) {
28322
+ instructionStatus = "missing";
28323
+ } else if (pendingWritePaths.has(instructionPath) || hasPendingCopyFor(instructionPath)) {
28324
+ instructionStatus = "outdated";
28325
+ } else {
28326
+ instructionStatus = "synced";
28327
+ }
28337
28328
  }
28338
28329
  let skillsStatus;
28339
28330
  if (!enabled2) {
28340
28331
  skillsStatus = skillsRootExists ? "synced" : "missing";
28341
28332
  } else if (!skillsRootExists && ws.skills.length > 0) {
28342
28333
  skillsStatus = "missing";
28343
- } else if (Array.from(pendingCopyPaths).some((p) => p.startsWith(skillsRootPath))) {
28334
+ } else if (hasPendingCopyUnder(skillsRootPath)) {
28344
28335
  skillsStatus = "outdated";
28345
28336
  } else {
28346
28337
  skillsStatus = "synced";
@@ -28348,10 +28339,10 @@ var statusCommand = (repoRoot, options) => Effect_exports.gen(function* (_) {
28348
28339
  targets.push({
28349
28340
  name: target,
28350
28341
  enabled: enabled2,
28351
- instruction: {
28342
+ instruction: instructionPath ? {
28352
28343
  path: import_node_path12.default.relative(repoRoot, instructionPath),
28353
- status: instructionStatus
28354
- },
28344
+ status: instructionStatus ?? "missing"
28345
+ } : void 0,
28355
28346
  skillsRoot: {
28356
28347
  path: import_node_path12.default.relative(repoRoot, skillsRootPath),
28357
28348
  status: skillsStatus
@@ -28555,7 +28546,7 @@ var resolveSource = (repoRoot, from) => {
28555
28546
  };
28556
28547
  var buildTargetExcludes = (from) => {
28557
28548
  if (from === "opencode") {
28558
- return (rel) => rel === "skill" || rel.startsWith("skill/") || rel === "agent/default.md";
28549
+ return (rel) => rel === "skill" || rel.startsWith("skill/");
28559
28550
  }
28560
28551
  if (from === "claude" || from === "codex") {
28561
28552
  return (rel) => rel === "skills" || rel.startsWith("skills/");
@@ -28762,8 +28753,10 @@ var renderStatusReport = (report) => {
28762
28753
  for (const target of report.targets) {
28763
28754
  const enabledLabel = target.enabled ? "" : dim(" (disabled)");
28764
28755
  lines.push(bold(`${target.name}${enabledLabel}`));
28765
- const instIcon = statusIcon(target.instruction.status);
28766
- lines.push(` ${instIcon} ${target.instruction.path}`);
28756
+ if (target.instruction) {
28757
+ const instIcon = statusIcon(target.instruction.status);
28758
+ lines.push(` ${instIcon} ${target.instruction.path}`);
28759
+ }
28767
28760
  const skillsIcon = statusIcon(target.skillsRoot.status);
28768
28761
  lines.push(` ${skillsIcon} ${target.skillsRoot.path}/`);
28769
28762
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentscfg",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.4",
4
4
  "type": "module",
5
5
  "main": "./dist/cli.cjs",
6
6
  "bin": {