arkaos 4.3.6 → 4.5.0

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 (110) hide show
  1. package/VERSION +1 -1
  2. package/bin/arka-py +22 -7
  3. package/config/hooks/_lib/arka_python.ps1 +31 -0
  4. package/config/hooks/_lib/arka_python.sh +38 -0
  5. package/config/hooks/post-tool-use.ps1 +8 -0
  6. package/config/hooks/post-tool-use.sh +11 -5
  7. package/config/hooks/pre-tool-use.ps1 +11 -6
  8. package/config/hooks/pre-tool-use.sh +11 -6
  9. package/config/hooks/session-start.ps1 +10 -0
  10. package/config/hooks/session-start.sh +5 -0
  11. package/config/hooks/stop.ps1 +9 -1
  12. package/config/hooks/stop.sh +11 -5
  13. package/config/hooks/user-prompt-submit.ps1 +18 -0
  14. package/config/hooks/user-prompt-submit.sh +11 -5
  15. package/config/mcp-policy.yaml +8 -8
  16. package/core/agents/__pycache__/__init__.cpython-312.pyc +0 -0
  17. package/core/agents/__pycache__/loader.cpython-312.pyc +0 -0
  18. package/core/agents/__pycache__/registry_gen.cpython-313.pyc +0 -0
  19. package/core/agents/__pycache__/schema.cpython-312.pyc +0 -0
  20. package/core/agents/registry_gen.py +3 -2
  21. package/core/cognition/scheduler/__pycache__/daemon.cpython-313.pyc +0 -0
  22. package/core/cognition/scheduler/daemon.py +7 -3
  23. package/core/forge/__pycache__/orchestrator.cpython-313.pyc +0 -0
  24. package/core/forge/orchestrator.py +2 -1
  25. package/core/hooks/__pycache__/_shared.cpython-313.pyc +0 -0
  26. package/core/hooks/__pycache__/_shared.cpython-314.pyc +0 -0
  27. package/core/hooks/__pycache__/stop.cpython-313.pyc +0 -0
  28. package/core/hooks/__pycache__/stop.cpython-314.pyc +0 -0
  29. package/core/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
  30. package/core/hooks/_shared.py +29 -9
  31. package/core/hooks/stop.py +4 -3
  32. package/core/hooks/user_prompt_submit.py +5 -4
  33. package/core/knowledge/__pycache__/indexer.cpython-313.pyc +0 -0
  34. package/core/knowledge/__pycache__/vector_store.cpython-313.pyc +0 -0
  35. package/core/knowledge/indexer.py +1 -1
  36. package/core/knowledge/vector_store.py +10 -3
  37. package/core/runtime/__pycache__/model_routing_check.cpython-313.pyc +0 -0
  38. package/core/runtime/__pycache__/model_routing_context.cpython-313.pyc +0 -0
  39. package/core/runtime/__pycache__/native_usage.cpython-313.pyc +0 -0
  40. package/core/runtime/__pycache__/native_usage.cpython-314.pyc +0 -0
  41. package/core/runtime/gateway/__pycache__/__init__.cpython-313.pyc +0 -0
  42. package/core/runtime/gateway/__pycache__/__main__.cpython-313.pyc +0 -0
  43. package/core/runtime/gateway/__pycache__/litellm_config.cpython-313.pyc +0 -0
  44. package/core/runtime/native_usage.py +2 -1
  45. package/core/shared/__pycache__/temp_paths.cpython-313.pyc +0 -0
  46. package/core/shared/__pycache__/temp_paths.cpython-314.pyc +0 -0
  47. package/core/shared/temp_paths.py +40 -0
  48. package/core/synapse/__pycache__/kb_cache.cpython-313.pyc +0 -0
  49. package/core/synapse/__pycache__/kb_cache.cpython-314.pyc +0 -0
  50. package/core/synapse/kb_cache.py +3 -2
  51. package/core/sync/__pycache__/agent_provisioner.cpython-313.pyc +0 -0
  52. package/core/sync/__pycache__/ai_mcp_decider.cpython-313.pyc +0 -0
  53. package/core/sync/__pycache__/content_syncer.cpython-313.pyc +0 -0
  54. package/core/sync/__pycache__/descriptor_syncer.cpython-313.pyc +0 -0
  55. package/core/sync/__pycache__/discovery.cpython-313.pyc +0 -0
  56. package/core/sync/__pycache__/engine.cpython-313.pyc +0 -0
  57. package/core/sync/__pycache__/manifest.cpython-313.pyc +0 -0
  58. package/core/sync/__pycache__/mcp_optimizer.cpython-313.pyc +0 -0
  59. package/core/sync/__pycache__/mcp_syncer.cpython-313.pyc +0 -0
  60. package/core/sync/__pycache__/policy_loader.cpython-313.pyc +0 -0
  61. package/core/sync/__pycache__/reporter.cpython-313.pyc +0 -0
  62. package/core/sync/__pycache__/settings_syncer.cpython-313.pyc +0 -0
  63. package/core/sync/agent_provisioner.py +5 -5
  64. package/core/sync/ai_mcp_decider.py +2 -2
  65. package/core/sync/content_syncer.py +14 -14
  66. package/core/sync/descriptor_syncer.py +2 -2
  67. package/core/sync/discovery.py +4 -4
  68. package/core/sync/engine.py +4 -4
  69. package/core/sync/manifest.py +1 -1
  70. package/core/sync/mcp_optimizer.py +5 -5
  71. package/core/sync/mcp_syncer.py +7 -3
  72. package/core/sync/policy_loader.py +1 -1
  73. package/core/sync/reporter.py +1 -1
  74. package/core/sync/settings_syncer.py +2 -2
  75. package/core/terminal/__pycache__/session.cpython-313.pyc +0 -0
  76. package/core/terminal/__pycache__/session_windows.cpython-313.pyc +0 -0
  77. package/core/terminal/session.py +66 -11
  78. package/core/terminal/session_windows.py +211 -0
  79. package/core/workflow/__pycache__/flow_authorization.cpython-313.pyc +0 -0
  80. package/core/workflow/__pycache__/flow_authorization.cpython-314.pyc +0 -0
  81. package/core/workflow/__pycache__/flow_enforcer.cpython-313.pyc +0 -0
  82. package/core/workflow/__pycache__/flow_enforcer.cpython-314.pyc +0 -0
  83. package/core/workflow/__pycache__/marker_cache.cpython-313.pyc +0 -0
  84. package/core/workflow/__pycache__/marker_cache.cpython-314.pyc +0 -0
  85. package/core/workflow/__pycache__/research_gate.cpython-313.pyc +0 -0
  86. package/core/workflow/__pycache__/research_gate.cpython-314.pyc +0 -0
  87. package/core/workflow/flow_authorization.py +2 -1
  88. package/core/workflow/flow_enforcer.py +2 -1
  89. package/core/workflow/marker_cache.py +2 -1
  90. package/core/workflow/research_gate.py +2 -1
  91. package/dashboard/app/pages/index.vue +6 -1
  92. package/departments/dev/skills/mcp/SKILL.md +3 -1
  93. package/departments/ops/skills/update/references/sync-engine.md +2 -1
  94. package/departments/quality/agents/copy-director.yaml +2 -0
  95. package/departments/quality/agents/tech-director.yaml +2 -0
  96. package/installer/cli.js +5 -4
  97. package/installer/core-snapshot.js +53 -0
  98. package/installer/doctor.js +8 -3
  99. package/installer/index.js +29 -6
  100. package/installer/migrate.js +7 -4
  101. package/installer/update.js +13 -0
  102. package/knowledge/agents-registry-v2.json +487 -120
  103. package/package.json +1 -1
  104. package/pyproject.toml +2 -1
  105. package/scripts/__pycache__/dashboard-api.cpython-313.pyc +0 -0
  106. package/scripts/__pycache__/synapse-bridge.cpython-313.pyc +0 -0
  107. package/scripts/dashboard-api.py +69 -33
  108. package/scripts/knowledge-index.py +35 -2
  109. package/scripts/start-dashboard.ps1 +34 -14
  110. package/scripts/synapse-bridge.py +3 -1
@@ -1,4 +1,4 @@
1
- import { existsSync, readFileSync, renameSync, mkdirSync, writeFileSync } from "node:fs";
1
+ import { existsSync, readFileSync, renameSync, mkdirSync, writeFileSync, cpSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { homedir } from "node:os";
4
4
  import { execSync } from "node:child_process";
@@ -75,7 +75,7 @@ export async function migrate() {
75
75
  const v2Digests = join(V2_PATH, "session-digests");
76
76
  if (existsSync(v1Digests) && !existsSync(v2Digests)) {
77
77
  try {
78
- execSync(`cp -r "${v1Digests}" "${v2Digests}"`, { stdio: "pipe" });
78
+ cpSync(v1Digests, v2Digests, { recursive: true });
79
79
  console.log(" Preserved session digests.");
80
80
  } catch {
81
81
  console.log(" Could not copy session digests.");
@@ -87,7 +87,7 @@ export async function migrate() {
87
87
  const v2Media = join(V2_PATH, "media");
88
88
  if (existsSync(v1Media) && !existsSync(v2Media)) {
89
89
  try {
90
- execSync(`cp -r "${v1Media}" "${v2Media}"`, { stdio: "pipe" });
90
+ cpSync(v1Media, v2Media, { recursive: true });
91
91
  console.log(" Preserved media files.");
92
92
  } catch {
93
93
  console.log(" Could not copy media files.");
@@ -101,7 +101,10 @@ export async function migrate() {
101
101
  } catch (err) {
102
102
  console.error(`\n Migration failed during install: ${err.message}`);
103
103
  console.error(` Your v1 backup is at: ${backupDir}`);
104
- console.error(` To restore: mv "${backupDir}" "${v1Dir}"\n`);
104
+ const restoreHint = process.platform === "win32"
105
+ ? `Move-Item "${backupDir}" "${v1Dir}"`
106
+ : `mv "${backupDir}" "${v1Dir}"`;
107
+ console.error(` To restore: ${restoreHint}\n`);
105
108
  process.exit(1);
106
109
  }
107
110
 
@@ -4,6 +4,7 @@ import { homedir } from "node:os";
4
4
  import { execSync } from "node:child_process";
5
5
  import { ensureVenv, ensureVenvHealthy, getArkaosPython, pipInstall } from "./python-resolver.js";
6
6
  import { copyHookLib } from "./hook-lib.js";
7
+ import { deployCoreSnapshot } from "./core-snapshot.js";
7
8
  import { getRuntimeConfig } from "./detect-runtime.js";
8
9
  import { loadAdapter } from "./index.js";
9
10
  import { migrateUserData, printMigrationReport } from "./migrate-user-data.js";
@@ -455,6 +456,18 @@ export async function update() {
455
456
  // different clone than the original install.
456
457
  console.log(" [7/8] Updating references...");
457
458
  writeFileSync(join(installDir, ".repo-path"), ARKAOS_ROOT);
459
+ // .repo-path points at the npx cache, which `npm cache clean` can purge;
460
+ // refresh the ~/.arkaos/lib snapshot so arka-py and the Python hooks
461
+ // always keep a validated fallback (see installer/core-snapshot.js).
462
+ // A failed snapshot must never fail the update — resolvers degrade to
463
+ // .repo-path (and any previous snapshot is preserved by the safe swap).
464
+ try {
465
+ if (deployCoreSnapshot(ARKAOS_ROOT, installDir)) {
466
+ console.log(" ✓ Core snapshot refreshed in ~/.arkaos/lib");
467
+ }
468
+ } catch (err) {
469
+ console.log(` ⚠ Core snapshot skipped (${err.message}) — arka-py falls back to .repo-path`);
470
+ }
458
471
  const skillsArkaosDir = join(homedir(), ".claude", "skills", "arkaos");
459
472
  if (existsSync(skillsArkaosDir)) {
460
473
  writeFileSync(join(skillsArkaosDir, ".arkaos-root"), ARKAOS_ROOT);