@technomoron/agent-run 0.99.4 → 0.99.5

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/CHANGES CHANGED
@@ -4,6 +4,11 @@ CHANGES
4
4
  Unreleased (2026-04-24)
5
5
  -----------------------
6
6
 
7
+ Version 0.99.5 (2026-04-25)
8
+ ---------------------------
9
+ * Bootstrap missing default global templates, manifests, local templates, and overrides before `agent-run codex`, `agent-run claude`, or `agent-run update` render a profile.
10
+ * Avoid rewriting the config-root `.gitignore` when it already contains the generated-file ignore entries.
11
+
7
12
  Version 0.99.4 (2026-04-24)
8
13
  ---------------------------
9
14
  * Refactor profile generation around `agent-run.jsonc` manifests, Nunjucks templates, generated Codex and Claude homes, and private per-profile runtime output.
package/dist/agent-run.js CHANGED
@@ -429,10 +429,13 @@ function runTool(parsed) {
429
429
  if (profileResult.profile === null) {
430
430
  fail(profileResult.reason);
431
431
  }
432
+ const profile = profileResult.profile;
433
+ const configRoot = defaultConfigRoot(projectRoot);
432
434
  const agentDir = resolveAgentDir(projectRoot);
433
435
  if (wrapperArgs.create) {
434
436
  runInit({ command: 'init', targetPath: projectRoot });
435
437
  }
438
+ ensureRunnableProfile(configRoot, agentDir, profile);
436
439
  syncAgentProfile(projectRoot, agentDir);
437
440
  if (command === 'codex') {
438
441
  runCodex(realBinary, permissionArgs, agentDir, args, projectRoot, wrapperArgs);
@@ -461,6 +464,16 @@ function runInit(parsed) {
461
464
  const rendered = syncAgentProfile(projectRoot, agentDir);
462
465
  printUpdateSummary(rendered);
463
466
  }
467
+ function ensureRunnableProfile(configRoot, agentDir, profile) {
468
+ ensureConfigRootLayout(configRoot);
469
+ ensureConfigRootGitignore(configRoot);
470
+ ensureDefaultGlobalTemplates(configRoot);
471
+ fs.mkdirSync(agentDir, { recursive: true });
472
+ ensureProfileOverridesDir(agentDir);
473
+ convertLegacyProfileIfNeeded(configRoot, agentDir, profile);
474
+ createDefaultManifestFile(agentDir, profile);
475
+ createDefaultLocalFile(agentDir, profile);
476
+ }
464
477
  function runEdit(parsed) {
465
478
  const projectRoot = findProjectRoot(parsed.targetPath);
466
479
  verbose(`edit target=${parsed.targetPath} projectRoot=${projectRoot}`);
@@ -490,10 +503,12 @@ function runUpdate(parsed) {
490
503
  const agentDir = resolveAgentDir(projectRoot);
491
504
  ensureConfigRootLayout(configRoot);
492
505
  ensureConfigRootGitignore(configRoot);
506
+ ensureDefaultGlobalTemplates(configRoot);
493
507
  fs.mkdirSync(agentDir, { recursive: true });
494
508
  ensureProfileOverridesDir(agentDir);
495
509
  convertLegacyProfileIfNeeded(configRoot, agentDir, profile);
496
510
  createDefaultManifestFile(agentDir, profile);
511
+ createDefaultLocalFile(agentDir, profile);
497
512
  const rendered = syncAgentProfile(projectRoot, agentDir);
498
513
  printUpdateSummary(rendered);
499
514
  }
@@ -578,12 +593,17 @@ function ensureConfigRootGitignore(configRoot) {
578
593
  const existing = fs.existsSync(gitignorePath) ? fs.readFileSync(gitignorePath, 'utf8').replace(/\r\n/g, '\n') : '';
579
594
  const lines = existing.length > 0 ? existing.replace(/\n+$/, '').split('\n') : [];
580
595
  const present = new Set(lines);
596
+ let changed = !fs.existsSync(gitignorePath);
581
597
  for (const entry of GENERATED_GITIGNORE_ENTRIES) {
582
598
  if (entry === '' || present.has(entry)) {
583
599
  continue;
584
600
  }
585
601
  lines.push(entry);
586
602
  present.add(entry);
603
+ changed = true;
604
+ }
605
+ if (!changed) {
606
+ return;
587
607
  }
588
608
  fs.writeFileSync(gitignorePath, `${lines.join('\n')}\n`, 'utf8');
589
609
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technomoron/agent-run",
3
- "version": "0.99.4",
3
+ "version": "0.99.5",
4
4
  "packageManager": "pnpm@10.28.1",
5
5
  "bin": {
6
6
  "agent-run": "dist/agent-run.js"