@technomoron/agent-run 0.99.9 → 0.99.11

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,14 @@ CHANGES
4
4
  Unreleased (2026-04-24)
5
5
  -----------------------
6
6
 
7
+ Version 0.99.11 (2026-04-27)
8
+ ----------------------------
9
+ * Show the package version in `agent-run --help` and add `agent-run --version`.
10
+
11
+ Version 0.99.10 (2026-04-27)
12
+ ----------------------------
13
+ * Add `paths.globalMemoryDir` to render context and expose it from default Codex, Claude, AGENTS, and CLAUDE templates.
14
+
7
15
  Version 0.99.9 (2026-04-26)
8
16
  ---------------------------
9
17
  * Add `{config-root}/notes/memory` as an optional shared memory directory passed with `--add-dir` to Codex and Claude when it exists.
package/dist/agent-run.js CHANGED
@@ -22,6 +22,7 @@ const CONFIG_DIR_ENV = 'AGENT_CONFIG_DIR';
22
22
  const VERBOSE_ENV = 'AGENT_RUN_VERBOSE';
23
23
  const MANIFEST_FILE_NAME = 'agent-run.jsonc';
24
24
  const LOCAL_TEMPLATE_FILE_NAME = 'local.md.njk';
25
+ const PACKAGE_VERSION = '0.99.10';
25
26
  const UNEXPANDED_TEMPLATE_RE = /\{\{[^}]+\}\}|\{%[^%]+%\}/;
26
27
  const agentRunEnvCache = new Map();
27
28
  const GENERATED_GITIGNORE_ENTRIES = [
@@ -114,6 +115,9 @@ function parseInvocation(invokedTool, argv) {
114
115
  if (isHelpFlag(firstArg)) {
115
116
  printHelp('general');
116
117
  }
118
+ if (isVersionFlag(firstArg)) {
119
+ printVersion();
120
+ }
117
121
  const commandIndex = findCommandArgIndex(inputArgs);
118
122
  if (commandIndex === -1) {
119
123
  fail(`unknown command: ${firstArg ?? ''} (run with --help for usage)`);
@@ -341,6 +345,13 @@ function parseMigrateConfigCommand(inputArgs) {
341
345
  function isHelpFlag(value) {
342
346
  return value === '-h' || value === '--help';
343
347
  }
348
+ function isVersionFlag(value) {
349
+ return value === '-V' || value === '--version';
350
+ }
351
+ function printVersion() {
352
+ process.stdout.write(`agent-run ${agentRunVersion()}\n`);
353
+ process.exit(0);
354
+ }
344
355
  function printHelp(topic) {
345
356
  process.stdout.write(renderHelp(topic));
346
357
  process.exit(0);
@@ -394,6 +405,8 @@ function renderHelp(topic) {
394
405
  case 'general':
395
406
  default:
396
407
  return [
408
+ `agent-run ${agentRunVersion()}`,
409
+ '',
397
410
  'Usage:',
398
411
  ' agent-run <codex|claude|check|init|edit|update> [options]',
399
412
  ' agent-run --init [config-root]',
@@ -410,6 +423,7 @@ function renderHelp(topic) {
410
423
  '',
411
424
  'Global options:',
412
425
  ' -h, --help Show this help text',
426
+ ' -V, --version Show the agent-run version',
413
427
  ' -v, --verbose Print path resolution and wrapper actions',
414
428
  ' --config-root DIR Override the agent-config root',
415
429
  ' --init [DIR] Copy the packaged starter config root to DIR (default ~/.agent-config)',
@@ -422,6 +436,19 @@ function renderHelp(topic) {
422
436
  ].join('\n');
423
437
  }
424
438
  }
439
+ function agentRunVersion() {
440
+ const packagePath = path.resolve(__dirname, '..', 'package.json');
441
+ try {
442
+ const pkg = JSON.parse(fs.readFileSync(packagePath, 'utf8'));
443
+ if (typeof pkg.version === 'string' && pkg.version.length > 0) {
444
+ return pkg.version;
445
+ }
446
+ }
447
+ catch {
448
+ return PACKAGE_VERSION;
449
+ }
450
+ return PACKAGE_VERSION;
451
+ }
425
452
  function normalizeCommandName(value) {
426
453
  if (!value) {
427
454
  return null;
@@ -972,6 +999,7 @@ function buildRenderContext(projectRoot, agentDir, configRoot, manifest, env) {
972
999
  reviewDir: resolveRuntimePath(configRoot, manifest.paths.reviewDir, env, baseContext),
973
1000
  reviewFile: resolveRuntimePath(configRoot, manifest.paths.reviewFile, env, baseContext),
974
1001
  memoriesDir: resolveRuntimePath(configRoot, manifest.paths.memoriesDir, env, baseContext),
1002
+ globalMemoryDir: globalMemoryDir(configRoot),
975
1003
  codexHomeDir: path.join(resolveRuntimePath(configRoot, manifest.paths.memoriesDir, env, baseContext), 'codex-home'),
976
1004
  overridesDir: path.join(agentDir, 'overrides'),
977
1005
  codexSkillsDir: path.join(agentDir, '.agents', 'skills'),
@@ -1525,9 +1553,12 @@ function runClaude(realBinary, permissionArgs, agentDir, configRoot, args, proje
1525
1553
  ], shouldUseShell(realBinary), env, projectRoot, (code) => postflightProjectCheck(projectRoot, agentDir, code));
1526
1554
  }
1527
1555
  function globalMemoryArgs(configRoot) {
1528
- const memoryDir = path.join(configRoot, 'notes', 'memory');
1556
+ const memoryDir = globalMemoryDir(configRoot);
1529
1557
  return fs.existsSync(memoryDir) ? ['--add-dir', memoryDir] : [];
1530
1558
  }
1559
+ function globalMemoryDir(configRoot) {
1560
+ return path.join(configRoot, 'notes', 'memory');
1561
+ }
1531
1562
  function postflightProjectCheck(projectRoot, agentDir, code) {
1532
1563
  const localAiFiles = findLocalAiFiles(projectRoot, agentDir);
1533
1564
  if (localAiFiles.length === 0) {
@@ -2216,6 +2247,12 @@ function defaultToolInstructionsTemplate(isClaude) {
2216
2247
  '{{ paths.memoriesDir }}',
2217
2248
  '```',
2218
2249
  '',
2250
+ 'Global memory directory:',
2251
+ '',
2252
+ '```text',
2253
+ '{{ paths.globalMemoryDir }}',
2254
+ '```',
2255
+ '',
2219
2256
  'Changes file:',
2220
2257
  '',
2221
2258
  '```text',
@@ -2251,7 +2288,8 @@ function defaultCodexConfigTemplate() {
2251
2288
  '[sandbox_workspace_write]',
2252
2289
  'writable_roots = [',
2253
2290
  ' "{{ projectRoot }}",',
2254
- ' "{{ agentDir }}"',
2291
+ ' "{{ agentDir }}",',
2292
+ ' "{{ paths.globalMemoryDir }}"',
2255
2293
  ']',
2256
2294
  'network_access = false',
2257
2295
  ''
@@ -2262,7 +2300,8 @@ function defaultClaudeSettingsTemplate() {
2262
2300
  '{',
2263
2301
  ' "env": {',
2264
2302
  ' "AGENT_DIR": "{{ agentDir }}",',
2265
- ' "AGENT_RUN_PROJECT_ROOT": "{{ projectRoot }}"',
2303
+ ' "AGENT_RUN_PROJECT_ROOT": "{{ projectRoot }}",',
2304
+ ' "AGENT_GLOBAL_MEMORY_DIR": "{{ paths.globalMemoryDir }}"',
2266
2305
  ' }',
2267
2306
  '}',
2268
2307
  ''
@@ -2278,7 +2317,8 @@ function defaultCodexConfigContent(context) {
2278
2317
  '[sandbox_workspace_write]',
2279
2318
  'writable_roots = [',
2280
2319
  ` ${jsonString(context.projectRoot)},`,
2281
- ` ${jsonString(context.agentDir)}`,
2320
+ ` ${jsonString(context.agentDir)},`,
2321
+ ` ${jsonString(context.paths.globalMemoryDir)}`,
2282
2322
  ']',
2283
2323
  'network_access = false',
2284
2324
  ''
@@ -2288,7 +2328,8 @@ function defaultClaudeSettingsContent(context) {
2288
2328
  return `${JSON.stringify({
2289
2329
  env: {
2290
2330
  AGENT_DIR: context.agentDir,
2291
- AGENT_RUN_PROJECT_ROOT: context.projectRoot
2331
+ AGENT_RUN_PROJECT_ROOT: context.projectRoot,
2332
+ AGENT_GLOBAL_MEMORY_DIR: context.paths.globalMemoryDir
2292
2333
  }
2293
2334
  }, null, 2)}\n`;
2294
2335
  }
@@ -12,6 +12,7 @@ Do not edit this generated file. Edit `agent-run.jsonc` and `local.md.njk`.
12
12
  - agentDir: `{{ agentDir }}`
13
13
  - reviewFile: `{{ paths.reviewFile }}`
14
14
  - memoriesDir: `{{ paths.memoriesDir }}`
15
+ - globalMemoryDir: `{{ paths.globalMemoryDir }}`
15
16
 
16
17
  ## Skills
17
18
 
@@ -5,3 +5,5 @@
5
5
 
6
6
  {% endfor %}
7
7
  Claude reads this file from the private agent directory.
8
+
9
+ globalMemoryDir: `{{ paths.globalMemoryDir }}`
@@ -2,6 +2,7 @@
2
2
  "env": {
3
3
  "AGENT_DIR": "{{ agentDir }}",
4
4
  "AGENT_RUN_PROJECT_ROOT": "{{ projectRoot }}",
5
+ "AGENT_GLOBAL_MEMORY_DIR": "{{ paths.globalMemoryDir }}",
5
6
  "STARTER_PROFILE": "{{ profile }}"
6
7
  }
7
8
  }
@@ -6,6 +6,7 @@ sandbox_mode = "workspace-write"
6
6
  writable_roots = [
7
7
  "{{ projectRoot }}",
8
8
  "{{ agentDir }}",
9
- "{{ paths.memoriesDir }}"
9
+ "{{ paths.memoriesDir }}",
10
+ "{{ paths.globalMemoryDir }}"
10
11
  ]
11
12
  network_access = false
@@ -2,6 +2,7 @@
2
2
  "env": {
3
3
  "AGENT_DIR": "{{ agentDir }}",
4
4
  "AGENT_RUN_PROJECT_ROOT": "{{ projectRoot }}",
5
+ "AGENT_GLOBAL_MEMORY_DIR": "{{ paths.globalMemoryDir }}",
5
6
  "STARTER_PROFILE": "{{ profile }}",
6
7
  "STARTER_OVERRIDE": "true"
7
8
  }
@@ -6,6 +6,7 @@ sandbox_mode = "workspace-write"
6
6
  writable_roots = [
7
7
  "{{ projectRoot }}",
8
8
  "{{ agentDir }}",
9
- "{{ paths.memoriesDir }}"
9
+ "{{ paths.memoriesDir }}",
10
+ "{{ paths.globalMemoryDir }}"
10
11
  ]
11
12
  network_access = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technomoron/agent-run",
3
- "version": "0.99.9",
3
+ "version": "0.99.11",
4
4
  "packageManager": "pnpm@10.28.1",
5
5
  "bin": {
6
6
  "agent-run": "dist/agent-run.js"