@technomoron/agent-run 0.99.21 → 0.99.22

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
@@ -1,6 +1,13 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ Version 0.99.22 (2026-06-27)
5
+ ----------------------------
6
+ * Default generated Codex configs to `danger-full-access` while keeping `--sandboxed` as an explicit opt-in.
7
+ * Search common global config-root locations on Windows and Unix, including both `agent-config` and `agent-configs`.
8
+ * Fix release script package metadata reads under Git Bash on Windows.
9
+ * Document the config-root discovery order and add regression coverage for the generated sandbox mode and search candidates.
10
+
4
11
  Version 0.99.21 (2026-06-27)
5
12
  ----------------------------
6
13
  * Default project commands for `[code]/owner/repo` checkouts to `[code]/agent-config`.
package/README.md CHANGED
@@ -98,6 +98,15 @@ Config root:
98
98
  - override with `AGENT_CONFIG_ROOT=/path/to/agent-configs`
99
99
  - or set `AGENT_CONFIG_DIR=/path/to/agent-configs` or `AGENT_CONFIG_ROOT=/path/to/agent-configs` in `.agent-run.env`
100
100
 
101
+ For commands without a project root, `agent-run` looks for an existing config
102
+ root in these locations:
103
+
104
+ - Windows: `~/Documents/code/agent-config`, `~/Documents/code/agent-configs`,
105
+ `~/Desktop/code/agent-config`, `~/Desktop/code/agent-configs`,
106
+ `C:\code\agent-config`, `C:\code\agent-configs`
107
+ - Unix: `~/code/agent-config`, `~/code/agent-configs`, `~/agent-config`,
108
+ `~/agent-configs`, `~/.agent-config`, `~/.agent-configs`
109
+
101
110
  ## Commands
102
111
 
103
112
  Global flag:
package/dist/agent-run.js CHANGED
@@ -7,6 +7,7 @@ exports.resolveAgentDir = resolveAgentDir;
7
7
  exports.findProjectRoot = findProjectRoot;
8
8
  exports.resolveProfile = resolveProfile;
9
9
  exports.defaultConfigRoot = defaultConfigRoot;
10
+ exports.defaultConfigRootSearchCandidates = defaultConfigRootSearchCandidates;
10
11
  const childProcess = require("child_process");
11
12
  const fs = require("fs");
12
13
  const os = require("os");
@@ -23,7 +24,7 @@ const VERBOSE_ENV = 'AGENT_RUN_VERBOSE';
23
24
  const MANIFEST_FILE_NAME = 'agent-run.jsonc';
24
25
  const LOCAL_TEMPLATE_FILE_NAME = 'local.md.njk';
25
26
  const LIVE_DIR_NAME = 'live';
26
- const PACKAGE_VERSION = '0.99.16';
27
+ const PACKAGE_VERSION = '0.99.22';
27
28
  const UNEXPANDED_TEMPLATE_RE = /\{\{[^}]+\}\}|\{%[^%]+%\}/;
28
29
  const agentRunEnvCache = new Map();
29
30
  const GENERATED_GITIGNORE_ENTRIES = [
@@ -524,15 +525,19 @@ function runTool(parsed) {
524
525
  fail(profileResult.reason);
525
526
  }
526
527
  const profile = profileResult.profile;
527
- const configRoot = defaultConfigRoot(projectRoot);
528
- const agentDir = resolveAgentDir(projectRoot);
529
528
  if (wrapperArgs.show) {
529
+ const configRoot = defaultConfigRoot(projectRoot);
530
+ const agentDir = path.join(configRoot, profile);
531
+ verbose(`profile=${profile} configRoot=${configRoot} agentPath=${agentDir}`);
530
532
  showToolProfile(command, projectRoot, agentDir);
531
533
  return;
532
534
  }
533
535
  if (wrapperArgs.create) {
534
536
  runInit({ command: 'init', targetPath: projectRoot });
535
537
  }
538
+ const configRoot = defaultConfigRoot(projectRoot);
539
+ const agentDir = path.join(configRoot, profile);
540
+ verbose(`profile=${profile} configRoot=${configRoot} agentPath=${agentDir}`);
536
541
  ensureRunnableProfile(configRoot, agentDir, profile);
537
542
  if (wrapperArgs.generate) {
538
543
  const rendered = syncAgentProfile(projectRoot, agentDir);
@@ -588,8 +593,9 @@ function runInit(parsed) {
588
593
  return;
589
594
  }
590
595
  const profile = resolveProfile(projectRoot);
591
- const configRoot = defaultConfigRoot(projectRoot);
592
- const agentDir = resolveAgentDir(projectRoot);
596
+ const configRoot = defaultConfigRoot(projectRoot, { preferProjectRoot: true });
597
+ const agentDir = path.join(configRoot, profile);
598
+ verbose(`profile=${profile} configRoot=${configRoot} agentPath=${agentDir}`);
593
599
  ensureConfigRootLayout(configRoot);
594
600
  ensureConfigRootGitignore(configRoot);
595
601
  ensureDefaultGlobalTemplates(configRoot);
@@ -2232,7 +2238,7 @@ function parseBooleanEnv(value) {
2232
2238
  const normalized = value.trim().toLowerCase();
2233
2239
  return normalized === '1' || normalized === 'true' || normalized === 'yes' || normalized === 'on';
2234
2240
  }
2235
- function defaultConfigRoot(projectRoot) {
2241
+ function defaultConfigRoot(projectRoot, options = {}) {
2236
2242
  const overrideRoot = process.env[CONFIG_ROOT_OVERRIDE_ENV];
2237
2243
  if (overrideRoot) {
2238
2244
  return path.resolve(overrideRoot);
@@ -2255,9 +2261,15 @@ function defaultConfigRoot(projectRoot) {
2255
2261
  }
2256
2262
  }
2257
2263
  if (projectRoot) {
2258
- return defaultCodeConfigRoot(projectRoot);
2264
+ const projectConfigRoot = defaultCodeConfigRoot(projectRoot);
2265
+ if (options.preferProjectRoot || fs.existsSync(projectConfigRoot)) {
2266
+ return projectConfigRoot;
2267
+ }
2268
+ const discoveredConfigRoot = findExistingConfigRoot(defaultConfigRootSearchCandidates());
2269
+ return discoveredConfigRoot ?? projectConfigRoot;
2259
2270
  }
2260
- return path.join(os.homedir(), '.agent-config');
2271
+ const discoveredConfigRoot = findExistingConfigRoot(defaultConfigRootSearchCandidates());
2272
+ return discoveredConfigRoot ?? path.join(os.homedir(), '.agent-config');
2261
2273
  }
2262
2274
  function defaultCodeConfigRoot(projectRoot) {
2263
2275
  const resolvedProjectRoot = path.resolve(projectRoot);
@@ -2268,6 +2280,39 @@ function defaultCodeConfigRoot(projectRoot) {
2268
2280
  }
2269
2281
  return path.join(codeRoot, 'agent-config');
2270
2282
  }
2283
+ function findExistingConfigRoot(candidates) {
2284
+ for (const candidate of candidates) {
2285
+ if (fs.existsSync(candidate)) {
2286
+ return candidate;
2287
+ }
2288
+ }
2289
+ return null;
2290
+ }
2291
+ function defaultConfigRootSearchCandidates(_projectRoot, options = {}) {
2292
+ const platform = options.platform ?? process.platform;
2293
+ const pathApi = platform === 'win32' ? path.win32 : path.posix;
2294
+ const homeDir = options.homeDir ?? os.homedir();
2295
+ const configNames = ['agent-config', 'agent-configs'];
2296
+ const candidates = [];
2297
+ if (platform === 'win32') {
2298
+ for (const codeRoot of [pathApi.join(homeDir, 'Documents', 'code'), pathApi.join(homeDir, 'Desktop', 'code'), 'C:\\code']) {
2299
+ for (const configName of configNames) {
2300
+ candidates.push(pathApi.join(codeRoot, configName));
2301
+ }
2302
+ }
2303
+ return candidates;
2304
+ }
2305
+ for (const configName of configNames) {
2306
+ candidates.push(pathApi.join(homeDir, 'code', configName));
2307
+ }
2308
+ for (const configName of configNames) {
2309
+ candidates.push(pathApi.join(homeDir, configName));
2310
+ }
2311
+ for (const configName of configNames) {
2312
+ candidates.push(pathApi.join(homeDir, `.${configName}`));
2313
+ }
2314
+ return candidates;
2315
+ }
2271
2316
  function findRealBinary(tool) {
2272
2317
  const pathValue = process.env.PATH || '';
2273
2318
  const pathDirs = pathValue.split(path.delimiter).filter((entry) => entry.length > 0);
@@ -2740,7 +2785,7 @@ function defaultCodexConfigTemplate() {
2740
2785
  '# Generated by agent-run. Do not edit directly.',
2741
2786
  '',
2742
2787
  'project_doc_max_bytes = 65536',
2743
- 'sandbox_mode = "workspace-write"',
2788
+ 'sandbox_mode = "danger-full-access"',
2744
2789
  '',
2745
2790
  '[sandbox_workspace_write]',
2746
2791
  'writable_roots = [',
@@ -2782,7 +2827,7 @@ function defaultCodexConfigContent(context) {
2782
2827
  '# Generated by agent-run. Do not edit directly.',
2783
2828
  '',
2784
2829
  'project_doc_max_bytes = 65536',
2785
- 'sandbox_mode = "workspace-write"',
2830
+ 'sandbox_mode = "danger-full-access"',
2786
2831
  '',
2787
2832
  '[sandbox_workspace_write]',
2788
2833
  'writable_roots = [',
@@ -1,6 +1,6 @@
1
1
  # Starter global Codex config
2
2
  project_doc_max_bytes = 32768
3
- sandbox_mode = "workspace-write"
3
+ sandbox_mode = "danger-full-access"
4
4
 
5
5
  [sandbox_workspace_write]
6
6
  writable_roots = [
@@ -1,6 +1,6 @@
1
1
  # Starter profile Codex override
2
2
  project_doc_max_bytes = 65536
3
- sandbox_mode = "workspace-write"
3
+ sandbox_mode = "danger-full-access"
4
4
 
5
5
  [sandbox_workspace_write]
6
6
  writable_roots = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@technomoron/agent-run",
3
- "version": "0.99.21",
3
+ "version": "0.99.22",
4
4
  "packageManager": "pnpm@10.28.1",
5
5
  "bin": {
6
6
  "agent-run": "dist/agent-run.js"