arkaos 4.3.1 → 4.3.3

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 (48) hide show
  1. package/README.md +1 -1
  2. package/VERSION +1 -1
  3. package/arka/SKILL.md +4 -4
  4. package/arka/skills/costs/SKILL.md +1 -1
  5. package/arka/skills/fusion/SKILL.md +3 -3
  6. package/bin/arka +225 -0
  7. package/bin/arka-claude +64 -0
  8. package/bin/arka-claude.cmd +11 -0
  9. package/bin/arka-claude.ps1 +126 -0
  10. package/bin/arka-doctor +391 -0
  11. package/bin/arka-providers +261 -0
  12. package/bin/arka-py +46 -0
  13. package/bin/arka-py.cmd +9 -0
  14. package/bin/arka-py.ps1 +36 -0
  15. package/bin/arka-registry-gen +185 -0
  16. package/bin/arka-skill +300 -0
  17. package/bin/scheduler-daemon.py +48 -0
  18. package/config/claude-agents/marta-cqo.md +1 -1
  19. package/config/claude-agents/paulo-tech-lead.md +1 -1
  20. package/config/constitution.yaml +5 -5
  21. package/config/hooks/_lib/arka_python.ps1 +43 -0
  22. package/config/hooks/_lib/arka_python.sh +63 -0
  23. package/config/hooks/agent-provision.sh +8 -1
  24. package/config/hooks/cwd-changed.sh +6 -2
  25. package/config/hooks/post-tool-use-v2.sh +6 -2
  26. package/config/hooks/post-tool-use.sh +8 -17
  27. package/config/hooks/pre-tool-use.ps1 +8 -6
  28. package/config/hooks/pre-tool-use.sh +8 -17
  29. package/config/hooks/session-start.sh +23 -21
  30. package/config/hooks/stop.ps1 +7 -5
  31. package/config/hooks/stop.sh +8 -17
  32. package/config/hooks/token-hygiene.sh +5 -1
  33. package/config/hooks/user-prompt-submit-v2.sh +13 -9
  34. package/config/hooks/user-prompt-submit.sh +8 -17
  35. package/core/hooks/__pycache__/post_tool_use.cpython-312.pyc +0 -0
  36. package/core/hooks/__pycache__/pre_tool_use.cpython-312.pyc +0 -0
  37. package/core/runtime/__pycache__/cost_governor.cpython-312.pyc +0 -0
  38. package/core/runtime/__pycache__/llm_provider.cpython-312.pyc +0 -0
  39. package/core/runtime/__pycache__/openrouter_provider.cpython-312.pyc +0 -0
  40. package/core/workflow/state_reader.sh +12 -5
  41. package/departments/ops/skills/update/SKILL.md +2 -2
  42. package/departments/ops/skills/update/references/sync-engine.md +1 -1
  43. package/departments/quality/SKILL.md +1 -1
  44. package/installer/index.js +14 -0
  45. package/installer/update.js +31 -0
  46. package/package.json +6 -3
  47. package/pyproject.toml +1 -1
  48. package/scripts/seed_initial_patterns.py +1 -1
@@ -5,6 +5,13 @@
5
5
  # Dependencies: jq (required)
6
6
  # ============================================================================
7
7
 
8
+ # ─── Shared Python resolver (exports ARKA_PY) ──────────────────────────
9
+ # The lib is not a sibling here; try the in-repo path then the installed tree.
10
+ for _l in "$(dirname "${BASH_SOURCE[0]:-$0}")/../../config/hooks/_lib/arka_python.sh" "$HOME/.arkaos/config/hooks/_lib/arka_python.sh"; do
11
+ if [ -f "$_l" ]; then . "$_l"; break; fi
12
+ done
13
+ : "${ARKA_PY:=python3}"
14
+
8
15
  STATE_FILE="$HOME/.arkaos/workflow-state.json"
9
16
 
10
17
  if [ ! -f "$STATE_FILE" ]; then
@@ -73,11 +80,11 @@ case "$CMD" in
73
80
  echo "none"
74
81
  exit 0
75
82
  fi
76
- if command -v python3 &>/dev/null; then
77
- _F_NAME=$(FORGE_FILE="$_FORGE_FILE" python3 -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(d.get('name',''))" 2>/dev/null)
78
- _F_STATUS=$(FORGE_FILE="$_FORGE_FILE" python3 -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(d.get('status',''))" 2>/dev/null)
79
- _F_PHASES=$(FORGE_FILE="$_FORGE_FILE" python3 -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(len(d.get('plan_phases',[])))" 2>/dev/null)
80
- _F_BRANCH=$(FORGE_FILE="$_FORGE_FILE" python3 -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(d.get('governance',{}).get('branch_strategy',''))" 2>/dev/null)
83
+ if command -v "$ARKA_PY" >/dev/null 2>&1; then
84
+ _F_NAME=$(FORGE_FILE="$_FORGE_FILE" "$ARKA_PY" -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(d.get('name',''))" 2>/dev/null)
85
+ _F_STATUS=$(FORGE_FILE="$_FORGE_FILE" "$ARKA_PY" -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(d.get('status',''))" 2>/dev/null)
86
+ _F_PHASES=$(FORGE_FILE="$_FORGE_FILE" "$ARKA_PY" -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(len(d.get('plan_phases',[])))" 2>/dev/null)
87
+ _F_BRANCH=$(FORGE_FILE="$_FORGE_FILE" "$ARKA_PY" -c "import yaml,os; d=yaml.safe_load(open(os.environ['FORGE_FILE'])); print(d.get('governance',{}).get('branch_strategy',''))" 2>/dev/null)
81
88
  echo "${_FORGE_ID}|${_F_NAME}|${_F_STATUS}|${_F_PHASES}|${_F_BRANCH}"
82
89
  else
83
90
  echo "${_FORGE_ID}|||0|"
@@ -23,7 +23,7 @@ Hybrid sync engine: Python handles deterministic operations (MCPs, settings, des
23
23
 
24
24
  1. **One-stop: npm refresh + engine (PR61 v2.78.0 orchestrator).**
25
25
  ```bash
26
- cd $ARKAOS_ROOT && python -m core.sync.update_orchestrator --home ~/.arkaos --skills ~/.claude/skills --output json
26
+ cd $ARKAOS_ROOT && ~/.arkaos/bin/arka-py -m core.sync.update_orchestrator --home ~/.arkaos --skills ~/.claude/skills --output json
27
27
  ```
28
28
  The orchestrator detects whether the running ArkaOS is behind npm
29
29
  latest. When stale, it shells out to `npx arkaos@latest update`
@@ -38,7 +38,7 @@ Hybrid sync engine: Python handles deterministic operations (MCPs, settings, des
38
38
  silently skips the npm step and falls through to the engine.
39
39
 
40
40
  Fallback (no orchestrator): the underlying engine still runs the
41
- same way via `python -m core.sync.engine ...` for callers that
41
+ same way via `~/.arkaos/bin/arka-py -m core.sync.engine ...` for callers that
42
42
  don't need the version-drift gate.
43
43
 
44
44
  2. **Phase 4 (intelligent, AI subagent):** After the engine completes, dispatch ONE subagent with the engine's JSON report + the feature registry (`core/sync/features/*.yaml`). The subagent injects/removes feature sections in each `~/.claude/skills/arka-{ecosystem}/SKILL.md` while preserving all custom content.
@@ -7,7 +7,7 @@ Referenced from SKILL.md. Read only when needed.
7
7
  Run the sync engine from the ArkaOS repo root:
8
8
 
9
9
  ```bash
10
- cd $ARKAOS_ROOT && python -m core.sync.engine --home ~/.arkaos --skills ~/.claude/skills --output json
10
+ cd $ARKAOS_ROOT && ~/.arkaos/bin/arka-py -m core.sync.engine --home ~/.arkaos --skills ~/.claude/skills --output json
11
11
  ```
12
12
 
13
13
  The engine handles deterministic operations and returns a JSON report.
@@ -24,7 +24,7 @@ Any Department Workflow:
24
24
  ...
25
25
  Phase N-1: QUALITY GATE
26
26
  1. Run the evidence engine over the project/diff:
27
- python -m core.governance.evidence_checks <project_dir> \
27
+ ~/.arkaos/bin/arka-py -m core.governance.evidence_checks <project_dir> \
28
28
  [--changed-files f1,f2] [--test-command '...'] --json
29
29
  2. Marta dispatches Eduardo + Francisca to INTERPRET the report:
30
30
  - Eduardo: spellcheck section + prose review of changed copy
@@ -165,6 +165,12 @@ export async function install({ runtime, path, force, skipSystem, withOllama })
165
165
  copyFileSync(cmdSrc, join(binDir, "arka-claude.cmd"));
166
166
  installed = true;
167
167
  }
168
+ // arka-py — the ArkaOS Python entrypoint SKILL.md commands invoke.
169
+ const pyPsSrc = join(ARKAOS_ROOT, "bin", "arka-py.ps1");
170
+ const pyCmdSrc = join(ARKAOS_ROOT, "bin", "arka-py.cmd");
171
+ if (existsSync(pyPsSrc)) copyFileSync(pyPsSrc, join(binDir, "arka-py.ps1"));
172
+ if (existsSync(pyCmdSrc)) copyFileSync(pyCmdSrc, join(binDir, "arka-py.cmd"));
173
+ if (existsSync(pyPsSrc) || existsSync(pyCmdSrc)) ok("arka-py interpreter shim installed (.cmd + .ps1)");
168
174
  if (installed) {
169
175
  ok("arka-claude wrapper installed (.cmd + .ps1)");
170
176
  console.log(` Add to PATH: setx PATH "%PATH%;%USERPROFILE%\\.arkaos\\bin"`);
@@ -179,6 +185,14 @@ export async function install({ runtime, path, force, skipSystem, withOllama })
179
185
  console.log(` Add to PATH: export PATH="$HOME/.arkaos/bin:$PATH"`);
180
186
  console.log(` Optional alias: alias claude="arka-claude"`);
181
187
  }
188
+ // arka-py — the ArkaOS Python entrypoint SKILL.md commands invoke so the
189
+ // agent never runs a bare `python` that lacks ArkaOS deps (pyyaml, ...).
190
+ const arkaPySrc = join(ARKAOS_ROOT, "bin", "arka-py");
191
+ if (existsSync(arkaPySrc)) {
192
+ copyFileSync(arkaPySrc, join(binDir, "arka-py"));
193
+ try { chmodSync(join(binDir, "arka-py"), 0o755); } catch {}
194
+ ok("arka-py interpreter shim installed");
195
+ }
182
196
  }
183
197
  const claudeMdSrc = join(ARKAOS_ROOT, "config", "user-claude.md");
184
198
  const userClaudeMd = join(homedir(), ".claude", "CLAUDE.md");
@@ -217,6 +217,24 @@ export async function update() {
217
217
  }
218
218
  console.log(" ✓ Hook scripts updated");
219
219
 
220
+ // Shared hook libraries (config/hooks/_lib/ — the Python interpreter
221
+ // resolver lives here). Keep in lockstep with index.js::installHooks:
222
+ // the hooks deployed above source _lib/arka_python.sh from the install
223
+ // dir, so skipping this copy leaves them falling back to a bare
224
+ // `python3` without ArkaOS deps.
225
+ const srcLibDir = join(srcHooksDir, "_lib");
226
+ if (existsSync(srcLibDir)) {
227
+ const destLibDir = join(destHooksDir, "_lib");
228
+ mkdirSync(destLibDir, { recursive: true });
229
+ cpSync(srcLibDir, destLibDir, { recursive: true });
230
+ try {
231
+ for (const f of readdirSync(destLibDir)) {
232
+ if (f.endsWith(".sh")) chmodSync(join(destLibDir, f), 0o755);
233
+ }
234
+ } catch {}
235
+ console.log(" ✓ Hook lib updated (_lib/)");
236
+ }
237
+
220
238
  // Re-register hooks in the runtime's settings file.
221
239
  // Without this, updating from an older version leaves settings.json
222
240
  // frozen at the previous hook spec (missing new hooks, stale timeouts).
@@ -248,6 +266,13 @@ export async function update() {
248
266
  if (existsSync(psSrc) || existsSync(cmdSrc)) {
249
267
  console.log(" ✓ arka-claude wrapper updated (.cmd + .ps1)");
250
268
  }
269
+ const pyPsSrc = join(ARKAOS_ROOT, "bin", "arka-py.ps1");
270
+ const pyCmdSrc = join(ARKAOS_ROOT, "bin", "arka-py.cmd");
271
+ if (existsSync(pyPsSrc)) copyFileSync(pyPsSrc, join(binDir, "arka-py.ps1"));
272
+ if (existsSync(pyCmdSrc)) copyFileSync(pyCmdSrc, join(binDir, "arka-py.cmd"));
273
+ if (existsSync(pyPsSrc) || existsSync(pyCmdSrc)) {
274
+ console.log(" ✓ arka-py interpreter shim updated (.cmd + .ps1)");
275
+ }
251
276
  } else {
252
277
  const wrapperSrc = join(ARKAOS_ROOT, "bin", "arka-claude");
253
278
  if (existsSync(wrapperSrc)) {
@@ -255,6 +280,12 @@ export async function update() {
255
280
  try { chmodSync(join(binDir, "arka-claude"), 0o755); } catch {}
256
281
  console.log(" ✓ arka-claude wrapper updated");
257
282
  }
283
+ const arkaPySrc = join(ARKAOS_ROOT, "bin", "arka-py");
284
+ if (existsSync(arkaPySrc)) {
285
+ copyFileSync(arkaPySrc, join(binDir, "arka-py"));
286
+ try { chmodSync(join(binDir, "arka-py"), 0o755); } catch {}
287
+ console.log(" ✓ arka-py interpreter shim updated");
288
+ }
258
289
  }
259
290
  const userClaudeMd = join(homedir(), ".claude", "CLAUDE.md");
260
291
  const claudeMdSrc = join(ARKAOS_ROOT, "config", "user-claude.md");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,7 +45,7 @@
45
45
  "departments/",
46
46
  "scripts/",
47
47
  "config/",
48
- "bin/arkaos",
48
+ "bin/",
49
49
  "arka/",
50
50
  "knowledge/",
51
51
  "dashboard/app/",
@@ -58,5 +58,8 @@
58
58
  "CONSTITUTION.md",
59
59
  "README.md",
60
60
  "LICENSE"
61
- ]
61
+ ],
62
+ "devDependencies": {
63
+ "eslint": "^8.57.1"
64
+ }
62
65
  }
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "4.3.1"
3
+ version = "4.3.3"
4
4
  description = "Core engine for ArkaOS — The Operating System for AI Agent Teams"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -175,7 +175,7 @@ def main() -> int:
175
175
  for card in _INITIAL_PATTERNS:
176
176
  record_pattern(card)
177
177
  print(f"Seeded {len(_INITIAL_PATTERNS)} pattern cards.")
178
- print("Inspect: python -m core.knowledge.pattern_cards_cli list")
178
+ print("Inspect: ~/.arkaos/bin/arka-py -m core.knowledge.pattern_cards_cli list")
179
179
  return 0
180
180
 
181
181