@technomoron/agent-run 0.99.4 → 0.99.6

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,15 @@ CHANGES
4
4
  Unreleased (2026-04-24)
5
5
  -----------------------
6
6
 
7
+ Version 0.99.6 (2026-04-26)
8
+ ---------------------------
9
+ * Allow `agent-run` to find the target command after wrapper arguments, so invocations like `agent-run --sandboxed --network codex` work the same as `agent-run codex --sandboxed --network`.
10
+
11
+ Version 0.99.5 (2026-04-25)
12
+ ---------------------------
13
+ * Bootstrap missing default global templates, manifests, local templates, and overrides before `agent-run codex`, `agent-run claude`, or `agent-run update` render a profile.
14
+ * Avoid rewriting the config-root `.gitignore` when it already contains the generated-file ignore entries.
15
+
7
16
  Version 0.99.4 (2026-04-24)
8
17
  ---------------------------
9
18
  * 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
@@ -97,14 +97,20 @@ function parseInvocation(invokedTool, argv) {
97
97
  if (inputArgs.length === 0) {
98
98
  fail('usage: agent-run <codex|claude|check|init|edit|update> [options] (run with --help for details)');
99
99
  }
100
- const firstArg = inputArgs.shift();
100
+ const firstArg = inputArgs[0];
101
101
  if (isHelpFlag(firstArg)) {
102
102
  printHelp('general');
103
103
  }
104
- command = normalizeCommandName(firstArg ?? '');
105
- if (command === null) {
104
+ const commandIndex = findCommandArgIndex(inputArgs);
105
+ if (commandIndex === -1) {
106
106
  fail(`unknown command: ${firstArg ?? ''} (run with --help for usage)`);
107
107
  }
108
+ const parsedCommand = normalizeCommandName(inputArgs[commandIndex] ?? '');
109
+ if (parsedCommand === null) {
110
+ fail(`unknown command: ${firstArg ?? ''} (run with --help for usage)`);
111
+ }
112
+ command = parsedCommand;
113
+ inputArgs.splice(commandIndex, 1);
108
114
  }
109
115
  if (command === 'check') {
110
116
  return parseCheckCommand(inputArgs);
@@ -123,6 +129,18 @@ function parseInvocation(invokedTool, argv) {
123
129
  }
124
130
  return parseRunCommand(command, inputArgs);
125
131
  }
132
+ function findCommandArgIndex(args) {
133
+ for (let index = 0; index < args.length; index += 1) {
134
+ const arg = args[index];
135
+ if (arg === '--') {
136
+ return -1;
137
+ }
138
+ if (normalizeCommandName(arg ?? '') !== null) {
139
+ return index;
140
+ }
141
+ }
142
+ return -1;
143
+ }
126
144
  function extractGlobalOptions(argv) {
127
145
  const args = [];
128
146
  let configRootOverride = null;
@@ -429,10 +447,13 @@ function runTool(parsed) {
429
447
  if (profileResult.profile === null) {
430
448
  fail(profileResult.reason);
431
449
  }
450
+ const profile = profileResult.profile;
451
+ const configRoot = defaultConfigRoot(projectRoot);
432
452
  const agentDir = resolveAgentDir(projectRoot);
433
453
  if (wrapperArgs.create) {
434
454
  runInit({ command: 'init', targetPath: projectRoot });
435
455
  }
456
+ ensureRunnableProfile(configRoot, agentDir, profile);
436
457
  syncAgentProfile(projectRoot, agentDir);
437
458
  if (command === 'codex') {
438
459
  runCodex(realBinary, permissionArgs, agentDir, args, projectRoot, wrapperArgs);
@@ -461,6 +482,16 @@ function runInit(parsed) {
461
482
  const rendered = syncAgentProfile(projectRoot, agentDir);
462
483
  printUpdateSummary(rendered);
463
484
  }
485
+ function ensureRunnableProfile(configRoot, agentDir, profile) {
486
+ ensureConfigRootLayout(configRoot);
487
+ ensureConfigRootGitignore(configRoot);
488
+ ensureDefaultGlobalTemplates(configRoot);
489
+ fs.mkdirSync(agentDir, { recursive: true });
490
+ ensureProfileOverridesDir(agentDir);
491
+ convertLegacyProfileIfNeeded(configRoot, agentDir, profile);
492
+ createDefaultManifestFile(agentDir, profile);
493
+ createDefaultLocalFile(agentDir, profile);
494
+ }
464
495
  function runEdit(parsed) {
465
496
  const projectRoot = findProjectRoot(parsed.targetPath);
466
497
  verbose(`edit target=${parsed.targetPath} projectRoot=${projectRoot}`);
@@ -490,10 +521,12 @@ function runUpdate(parsed) {
490
521
  const agentDir = resolveAgentDir(projectRoot);
491
522
  ensureConfigRootLayout(configRoot);
492
523
  ensureConfigRootGitignore(configRoot);
524
+ ensureDefaultGlobalTemplates(configRoot);
493
525
  fs.mkdirSync(agentDir, { recursive: true });
494
526
  ensureProfileOverridesDir(agentDir);
495
527
  convertLegacyProfileIfNeeded(configRoot, agentDir, profile);
496
528
  createDefaultManifestFile(agentDir, profile);
529
+ createDefaultLocalFile(agentDir, profile);
497
530
  const rendered = syncAgentProfile(projectRoot, agentDir);
498
531
  printUpdateSummary(rendered);
499
532
  }
@@ -578,12 +611,17 @@ function ensureConfigRootGitignore(configRoot) {
578
611
  const existing = fs.existsSync(gitignorePath) ? fs.readFileSync(gitignorePath, 'utf8').replace(/\r\n/g, '\n') : '';
579
612
  const lines = existing.length > 0 ? existing.replace(/\n+$/, '').split('\n') : [];
580
613
  const present = new Set(lines);
614
+ let changed = !fs.existsSync(gitignorePath);
581
615
  for (const entry of GENERATED_GITIGNORE_ENTRIES) {
582
616
  if (entry === '' || present.has(entry)) {
583
617
  continue;
584
618
  }
585
619
  lines.push(entry);
586
620
  present.add(entry);
621
+ changed = true;
622
+ }
623
+ if (!changed) {
624
+ return;
587
625
  }
588
626
  fs.writeFileSync(gitignorePath, `${lines.join('\n')}\n`, 'utf8');
589
627
  }
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.6",
4
4
  "packageManager": "pnpm@10.28.1",
5
5
  "bin": {
6
6
  "agent-run": "dist/agent-run.js"