@yasaswy.nagavolu/agents 0.26.15 → 0.27.1

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 (77) hide show
  1. package/README.md +13 -0
  2. package/bin/cli.js +69 -15
  3. package/content/global/hooks/project_hook.sh +13 -11
  4. package/content/global/hooks/pyrun.js +461 -0
  5. package/content/global/hooks/store_guard.js +220 -0
  6. package/content/global/hooks/store_guard_rules.json +126 -0
  7. package/content/hooks/conclusion-scribe/README.md +1 -1
  8. package/content/hooks/conclusion-scribe/conclusion-scribe.env.example +3 -1
  9. package/content/hooks/tracker_proof_gate.py +1 -1
  10. package/content/manifest.json +169 -45
  11. package/content/proxy/README.md +28 -28
  12. package/content/proxy/agent_dispatch_guard.py +1 -1
  13. package/content/proxy/agent_model_guard.py +1 -1
  14. package/content/proxy/credential_mutation_guard.py +1 -1
  15. package/content/proxy/gitlab_mutation_guard.py +1 -1
  16. package/content/proxy/grilling_format_gate.py +16 -38
  17. package/content/proxy/handover_ledger_hook.py +1 -1
  18. package/content/proxy/headless_spawn_guard.py +1 -1
  19. package/content/proxy/managed_files_guard.py +1 -1
  20. package/content/proxy/prd_closing_gate.py +1 -1
  21. package/content/proxy/publish_guard.py +1 -1
  22. package/content/proxy/web_search_guard.py +1 -1
  23. package/content/skills/README.md +8 -0
  24. package/content/skills/graphic-novel-pipeline/SKILL.md +104 -0
  25. package/content/skills/graphic-novel-pipeline/scripts/build_review.py +105 -0
  26. package/content/skills/graphic-novel-pipeline/scripts/compile_prompts.py +356 -0
  27. package/content/skills/graphic-novel-pipeline/scripts/framing.py +74 -0
  28. package/content/skills/graphic-novel-pipeline/scripts/generate_all.py +355 -0
  29. package/content/skills/graphic-novel-pipeline/scripts/generate_art_gemini.py +161 -0
  30. package/content/skills/graphic-novel-pipeline/scripts/generate_art_meshy.py +255 -0
  31. package/content/skills/graphic-novel-pipeline/scripts/gn_common.py +203 -0
  32. package/content/skills/graphic-novel-pipeline/scripts/ledger_template.md +25 -0
  33. package/content/skills/graphic-novel-pipeline/scripts/naming.py +75 -0
  34. package/content/skills/graphic-novel-pipeline/scripts/new_version.py +70 -0
  35. package/content/skills/graphic-novel-pipeline/scripts/notext.py +93 -0
  36. package/content/skills/graphic-novel-pipeline/scripts/pipeline.py +347 -0
  37. package/content/skills/graphic-novel-pipeline/scripts/post_process.py +199 -0
  38. package/content/skills/graphic-novel-pipeline/scripts/sheets.py +266 -0
  39. package/content/skills/graphic-novel-pipeline/scripts/spend_guard.py +174 -0
  40. package/content/skills/graphic-novel-pipeline/scripts/theme.py +215 -0
  41. package/content/skills/graphic-novel-pipeline/templates/continuity.json +65 -0
  42. package/content/skills/graphic-novel-pipeline/templates/project.json +182 -0
  43. package/content/skills/graphic-novel-pipeline/templates/theme.json +65 -0
  44. package/content/skills/graphic-novel-pipeline/tests/_util.py +28 -0
  45. package/content/skills/graphic-novel-pipeline/tests/test_approve.py +86 -0
  46. package/content/skills/graphic-novel-pipeline/tests/test_framing.py +79 -0
  47. package/content/skills/graphic-novel-pipeline/tests/test_mark_flag.py +82 -0
  48. package/content/skills/graphic-novel-pipeline/tests/test_naming.py +126 -0
  49. package/content/skills/graphic-novel-pipeline/tests/test_notext.py +83 -0
  50. package/content/skills/graphic-novel-pipeline/tests/test_panel_refs.py +205 -0
  51. package/content/skills/graphic-novel-pipeline/tests/test_props_world.py +115 -0
  52. package/content/skills/graphic-novel-pipeline/tests/test_quantise.py +74 -0
  53. package/content/skills/graphic-novel-pipeline/tests/test_roles.py +89 -0
  54. package/content/skills/graphic-novel-pipeline/tests/test_sheets.py +189 -0
  55. package/content/skills/graphic-novel-pipeline/tests/test_spend_refs.py +400 -0
  56. package/content/skills/low-ram-advisor/SKILL.md +68 -0
  57. package/content/skills/low-ram-advisor/advisor.py +529 -0
  58. package/content/skills/low-ram-advisor/tests/test_advisor.py +533 -0
  59. package/content/skills/mattpocock-grilling/SKILL.md +3 -3
  60. package/lib/codex-compatibility.json +48 -0
  61. package/lib/codex-global-config.js +270 -0
  62. package/lib/codex-hook-adapter.js +22 -0
  63. package/lib/codex-lifecycle.js +77 -0
  64. package/lib/codex-toml.js +88 -0
  65. package/lib/codex-trust.js +37 -0
  66. package/lib/codex.js +182 -0
  67. package/lib/deployment.js +64 -0
  68. package/lib/discovery.js +28 -0
  69. package/lib/install.js +15 -6
  70. package/lib/manifest.js +20 -1
  71. package/lib/prepack.js +5 -2
  72. package/lib/pyrun.js +15 -0
  73. package/lib/pythonHooks.js +215 -0
  74. package/lib/shared-instructions.js +167 -0
  75. package/lib/update.js +7 -6
  76. package/lib/wiring.js +66 -90
  77. package/package.json +1 -1
package/README.md CHANGED
@@ -3,6 +3,15 @@
3
3
  CLI for installing the yasaswy.nagavolu agent/skill/hook bundle (Claude
4
4
  agents, skills, hooks, and supporting tooling).
5
5
 
6
+ The install, update, uninstall, and doctor commands target Claude Code and
7
+ Codex by default. Codex skills live in `~/.agents/skills`; Codex instructions,
8
+ hooks, agents, MCP servers, and the deployment ledger live under `~/.codex`.
9
+ Use `--runtime claude` or `--runtime codex` to select one runtime. `--codex-dir`
10
+ sets Codex's configuration home (or set `CODEX_HOME`). A custom
11
+ `--target-dir` keeps the legacy Claude-only behavior; use `--runtime both`
12
+ with both `--target-dir` and `--codex-dir` to install into isolated homes.
13
+ Codex reports unsupported Claude-only artifacts in its compatibility report.
14
+
6
15
  `install` opens an interactive checkbox menu of purpose-based bundles when
7
16
  run in a terminal, or installs one bundle non-interactively via
8
17
  `--bundle <key> --yes`. Every installed file's hash is recorded in a ledger
@@ -92,6 +101,10 @@ agents-cli install
92
101
  `--scan-root <dir>` checks every git repo directly under `<dir>` instead of the cwd repo. `install` and `update`
93
102
  accept the same `--scan-root` plus `--fix-project-hooks` and report (or fix) bare project hooks after the run.
94
103
  Paste-ready fix from inside any repo: `npx -y @yasaswy.nagavolu/agents@latest doctor --fix`.
104
+ It also fails on Python hook launch problems: a hook or statusline command starting with a bare `python`/`python3`/`py`
105
+ token (the Microsoft Store stub makes it fail), a missing `hooks/pyrun.js` launcher, an unresolvable interpreter, and a
106
+ WindowsApps python stub ahead of a real interpreter on PATH; `--fix` rewrites the bare tokens to
107
+ `node <target>/hooks/pyrun.js <script>` and never edits PATH or App Execution Aliases.
95
108
  It also flags a project `permissions.defaultMode` weaker than the global default in `~/.claude/settings.json`
96
109
  (for example `dontAsk` under a global `bypassPermissions`); `--fix` removes it from `settings.local.json`
97
110
  only, a committed `settings.json` is reported and never edited. The `permission_mode_enforce.js` hook
package/bin/cli.js CHANGED
@@ -17,7 +17,7 @@ const { updateBundles, UpdateError } = require('../lib/update');
17
17
  const { formatVersionBanner } = require('../lib/version-banner');
18
18
  const { bundleInstallState, installChip, installDetailLine, chipIsChange } = require('../lib/install-state');
19
19
  const { ledgerPath } = require('../lib/ledger');
20
- const { WiringError } = require('../lib/wiring');
20
+ const { WiringError, expectedWiringRecordsForManifest } = require('../lib/wiring');
21
21
  const { applyModels, formatPlan, ModelsError } = require('../lib/modelsApply');
22
22
  const { dispatchUsage, formatUsage } = require('../lib/modelsUsage');
23
23
  const {
@@ -39,6 +39,8 @@ const memoryIndexCheck = require('../lib/memoryIndexCheck');
39
39
  const projectHooks = require('../lib/projectHooks');
40
40
  const modeDrift = require('../lib/modeDrift');
41
41
  const permissionRules = require('../lib/permissionRules');
42
+ const pythonHooks = require('../lib/pythonHooks');
43
+ const pyrun = require('../lib/pyrun');
42
44
  const { checkModVersions } = require('../lib/claudeVersion');
43
45
 
44
46
  const PACKAGE_ROOT = path.join(__dirname, '..');
@@ -84,6 +86,11 @@ Usage:
84
86
  agents-cli runner <sub> [flags] Install and manage a self-hosted GitLab CI runner (see "Flags for runner")
85
87
  agents-cli --help Show this help
86
88
 
89
+ Runtime deployment:
90
+ --runtime <both|claude|codex> Default both; explicit --target-dir alone keeps legacy single-Claude behavior
91
+ --codex-dir <path> Override Codex configuration/instructions target; skills go to sibling .agents/skills
92
+ --runtime both with --target-dir requires --codex-dir. Both runtimes are attempted independently.
93
+
87
94
  Flags for install:
88
95
  --bundle <key> Bundle to install non-interactively — run "install" with no flags to list keys
89
96
  --yes Required with --bundle: confirms the non-interactive install
@@ -178,6 +185,12 @@ whose script file is missing, and a bare (non-launcher) project hook command, wh
178
185
  and so blocks every tool call when it is a PreToolUse hook. A launcher-form hook with a missing file fails open but is still
179
186
  reported. Without --fix nothing is modified.
180
187
 
188
+ doctor also fails on Python hook launch problems: a hook or statusline command in <target>/settings.json or the
189
+ project settings that starts with a bare python/python3/py token (the Microsoft Store stub makes it fail), a
190
+ hooks/pyrun.js launcher that is not installed, an interpreter that does not resolve, and a WindowsApps python stub
191
+ ahead of a real interpreter on PATH. --fix rewrites the bare tokens to "node <target>/hooks/pyrun.js <script>" in place;
192
+ it never edits PATH or App Execution Aliases.
193
+
181
194
  doctor also flags a project .claude/settings.json or settings.local.json whose permissions.defaultMode is weaker
182
195
  than the global default in <target>/settings.json (for example "dontAsk" under a global "bypassPermissions"), which
183
196
  silently downgrades every session in that repo. --fix removes the key from settings.local.json only; a committed
@@ -349,11 +362,10 @@ function installOneBundle({ bundleKey, bundleTitle, targetDir, targetConfig, ite
349
362
  if (result.settingsBackupFile) {
350
363
  console.log(` ${mark()} backed up existing settings.json to ${result.settingsBackupFile} before this CLI's first write`);
351
364
  }
352
- if (result.hooksSkippedNoPython.length > 0) {
353
- const names = result.hooksSkippedNoPython.map((h) => h.path).join(', ');
365
+ if (result.pythonUnresolved) {
354
366
  console.log(
355
- ` ${mark('skip')} skipped wiring ${result.hooksSkippedNoPython.length} Python hook(s) (${names}): no python3/python found on PATH. ` +
356
- `Install Python, then re-run: agents-cli install --bundle ${result.bundle} --yes`
367
+ ` ${mark('skip')} wired Python hook(s) cannot run yet: no Python 3.8+ interpreter found (Microsoft Store stubs are ignored). ` +
368
+ `Install Python 3 from python.org or set AGENTS_PYTHON; hooks pick it up on their next run.`
357
369
  );
358
370
  }
359
371
  if (result.mcpWired.length > 0) {
@@ -518,13 +530,13 @@ function fetchLatestVersion(pkgName, { timeoutMs = 1500 } = {}) {
518
530
  });
519
531
  }
520
532
 
521
- async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets, profile }) {
533
+ async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets, profile, captureSelection = false }) {
522
534
  const { manifest, manifestPath } = loadManifest(PACKAGE_ROOT);
523
535
  const repoRoot = path.dirname(manifestPath);
524
536
  const candidateBundles = advanced ? advancedMenuBundles(manifest, profile) : basicMenuBundles(manifest, profile);
525
537
  if (!candidateBundles.length) {
526
538
  console.log('No bundles are defined yet.');
527
- return 0;
539
+ return captureSelection ? { exitCode: 0, bundleKeys: [] } : 0;
528
540
  }
529
541
 
530
542
  const rows = candidateBundles.map((b) => describeBundleRow(b, manifest));
@@ -547,11 +559,11 @@ async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets
547
559
  const selectedKeys = await pickBundles(rows, { details, header, subheader });
548
560
  if (selectedKeys === null) {
549
561
  console.log('Cancelled — nothing installed.');
550
- return 0;
562
+ return captureSelection ? { exitCode: 0, bundleKeys: [] } : 0;
551
563
  }
552
564
  if (selectedKeys.length === 0) {
553
565
  console.log('Nothing selected — nothing installed.');
554
- return 0;
566
+ return captureSelection ? { exitCode: 0, bundleKeys: [] } : 0;
555
567
  }
556
568
 
557
569
  const plan = planSelection(manifest, selectedKeys);
@@ -588,7 +600,7 @@ async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets
588
600
  try {
589
601
  const result = installOneBundle({ bundleKey: bundle.key, bundleTitle: bundle.title, targetDir, targetConfig, itemPaths });
590
602
  installedBundles.push(bundle);
591
- installedResults.push({ bundle, result });
603
+ installedResults.push({ bundle, result, itemPaths });
592
604
  } catch (err) {
593
605
  if (err instanceof InstallError || err instanceof ManifestError || err instanceof LedgerError || err instanceof WiringError) {
594
606
  console.error(err.message);
@@ -612,10 +624,10 @@ async function runInteractiveMenu({ advanced, targetDir, targetConfig, noSecrets
612
624
 
613
625
  printFinalSummary({ installed: installedResults, skipped, targetBase: targetDir || defaultTargetBase() });
614
626
 
615
- return 0;
627
+ return captureSelection ? { exitCode: 0, bundleKeys: installedBundles.map(bundle => bundle.key), bundleSelections: installedResults.map(({ bundle, itemPaths }) => ({ bundleKey: bundle.key, ...(itemPaths ? { itemPaths } : {}) })) } : 0;
616
628
  }
617
629
 
618
- async function runInstall(argv) {
630
+ async function runInstall(argv, { captureSelection = false } = {}) {
619
631
  let args;
620
632
  try {
621
633
  args = parseInstallArgs(argv);
@@ -635,6 +647,7 @@ async function runInstall(argv) {
635
647
  targetConfig: args.targetConfig,
636
648
  noSecrets: args.noSecrets,
637
649
  profile: args.profile,
650
+ captureSelection,
638
651
  });
639
652
  }
640
653
 
@@ -1211,6 +1224,20 @@ Project hooks (${step.findings.length} finding(s), ${step.repos.length} repo(s)
1211
1224
  }
1212
1225
  }
1213
1226
 
1227
+ function printPythonLaunchReport(py) {
1228
+ if (py.fixed.length > 0) {
1229
+ console.log(`\nRewrote ${py.fixed.length} bare python hook command(s) to the pyrun launcher:`);
1230
+ for (const c of py.fixed) console.log(` ${c.file}\n - ${c.from}\n + ${c.to}`);
1231
+ }
1232
+ if (py.healthy) return;
1233
+ console.log('\nPython hook launch:');
1234
+ for (const f of py.findings) console.log(` ${pythonHooks.describeFinding(f)}`);
1235
+ for (const m of py.missingLaunchers) console.log(` ${m.file}: launcher not found: ${m.launcher}`);
1236
+ if (!py.interpreter.ok) console.log(` ${pyrun.unresolvedMessage(py.interpreter, null)}`);
1237
+ for (const stub of py.stubs) console.log(` ${pythonHooks.describeStub(stub)}`);
1238
+ if (py.findings.length > 0 && !py.fixRequested) console.log(` Fix: ${projectHooks.FIX_COMMAND}`);
1239
+ }
1240
+
1214
1241
  function printModeDriftReport(modes) {
1215
1242
  if (modes.fixed.length > 0) {
1216
1243
  console.log(`\nRemoved ${modes.fixed.length} defaultMode override(s) weaker than the global "${modes.globalMode}":`);
@@ -1313,11 +1340,25 @@ function runDoctor(argv) {
1313
1340
  console.error(hooks.error);
1314
1341
  return 1;
1315
1342
  }
1343
+ const { manifest } = loadManifest(PACKAGE_ROOT);
1344
+ const py = pythonHooks.checkPythonLaunch({
1345
+ ...scope,
1346
+ fix: args.fix,
1347
+ expectedRecords: expectedWiringRecordsForManifest(manifest, scope.targetBase),
1348
+ resolve: () => pyrun.resolvePython({ stateDir: path.join(scope.targetBase, 'state') }),
1349
+ ...(process.env.NODE_ENV === 'test' && !process.env.AGENTS_CLI_PATH_STUBS ? { stubs: () => [] } : {}),
1350
+ });
1351
+ py.fixRequested = args.fix;
1352
+ if (py.error) {
1353
+ console.error(py.error);
1354
+ return 1;
1355
+ }
1316
1356
  const { fixed } = hooks;
1317
1357
  result.projectHooks = { repos: hooks.repos, findings: hooks.findings, fixed };
1318
1358
  result.modeDrift = { globalMode: modes.globalMode, findings: modes.findings, fixed: modes.fixed };
1319
1359
  result.permissionRules = { findings: rules.findings, fixed: rules.fixed };
1320
- result.healthy = result.healthy && hooks.findings.length === 0 && modes.findings.length === 0 && rules.findings.length === 0;
1360
+ result.pythonLaunch = { files: py.files, findings: py.findings, fixed: py.fixed, missingLaunchers: py.missingLaunchers, interpreter: py.interpreter, stubs: py.stubs };
1361
+ result.healthy = result.healthy && hooks.findings.length === 0 && modes.findings.length === 0 && rules.findings.length === 0 && py.healthy;
1321
1362
 
1322
1363
  if (args.json) {
1323
1364
  console.log(JSON.stringify(result, null, 2));
@@ -1361,6 +1402,7 @@ function runDoctor(argv) {
1361
1402
  };
1362
1403
 
1363
1404
  if (result.healthy) {
1405
+ printPythonLaunchReport(py);
1364
1406
  console.log(`${result.targetBase}: healthy — no orphans, no missing files, no drift.`);
1365
1407
  printModVersions();
1366
1408
  printModValidation();
@@ -1388,6 +1430,7 @@ function runDoctor(argv) {
1388
1430
  printMemoryIndex();
1389
1431
  printRoutingMod();
1390
1432
  printProjectHooks();
1433
+ printPythonLaunchReport(py);
1391
1434
  printModeDrift();
1392
1435
  return 1;
1393
1436
  } catch (err) {
@@ -1399,8 +1442,19 @@ function runDoctor(argv) {
1399
1442
  }
1400
1443
  }
1401
1444
 
1402
- async function main(argv) {
1445
+ async function main(argv, { captureSelection = false } = {}) {
1403
1446
  const [command, ...rest] = argv;
1447
+ if (['install','update','uninstall','doctor'].includes(command)) {
1448
+ const parsed = require('../lib/deployment').parseDeploymentArgs(rest);
1449
+ if (parsed.runtime !== 'claude') return require('../lib/deployment').runDeployment({command,argv:rest,packageRoot:PACKAGE_ROOT,cliVersion:pkg.version,runPrimary:async args=>{
1450
+ if(!args.includes('--json'))return main([command,...args,'--runtime','claude'],{captureSelection:true});
1451
+ const lines=[],original=console.log;
1452
+ console.log=(...values)=>lines.push(values.map(String).join(' '));
1453
+ try{const primary=await main([command,...args,'--runtime','claude'],{captureSelection:true});const exitCode=typeof primary==='number'?primary:primary.exitCode;const output=lines.join('\n');let result={exitCode};if(typeof primary==='object')result={...primary,...result};try{result.json=JSON.parse(output);}catch{if(output)result.json={output};}return result;}
1454
+ finally{console.log=original;}
1455
+ }});
1456
+ rest.splice(0,rest.length,...parsed.args);
1457
+ }
1404
1458
 
1405
1459
  if (command === '--version' || command === '-v') {
1406
1460
  console.log(pkg.version);
@@ -1413,7 +1467,7 @@ async function main(argv) {
1413
1467
  }
1414
1468
 
1415
1469
  if (command === 'install') {
1416
- return withProjectHookStep(rest, runInstall);
1470
+ return withProjectHookStep(rest, args => runInstall(args, { captureSelection }));
1417
1471
  }
1418
1472
 
1419
1473
  if (command === 'uninstall') {
@@ -23,18 +23,20 @@ slashes() {
23
23
  done
24
24
  }
25
25
 
26
- # A real interpreter first; the WindowsApps python3 stub only as a last resort.
26
+ # The interpreter pyrun.js resolved (hooks/../state), else a real one on PATH; a WindowsApps stub is never used.
27
27
  find_python() {
28
- for pass in real stub; do
29
- for cand in python3 python py; do
30
- cmd="$(command -v "$cand" 2>/dev/null)" || continue
31
- case "$cmd" in
32
- *WindowsApps*) [ "$pass" = stub ] || continue ;;
33
- *) [ "$pass" = real ] || continue ;;
34
- esac
35
- echo "$cmd"
36
- return 0
37
- done
28
+ cached=""
29
+ cache="${0%/*}/../state/python-interpreter"
30
+ if [ -f "$cache" ]; then IFS= read -r cached < "$cache" || :; fi
31
+ if [ -n "$cached" ] && [ -f "$cached" ]; then
32
+ echo "$cached"
33
+ return 0
34
+ fi
35
+ for cand in python3 python py; do
36
+ cmd="$(command -v "$cand" 2>/dev/null)" || continue
37
+ case "$cmd" in *WindowsApps*) continue ;; esac
38
+ echo "$cmd"
39
+ return 0
38
40
  done
39
41
  return 1
40
42
  }