arkaos 4.32.0 → 4.34.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 (92) hide show
  1. package/README.md +1 -1
  2. package/THE-ARKAOS-GUIDE.md +1 -1
  3. package/VERSION +1 -1
  4. package/arka/SKILL.md +1 -1
  5. package/arka/skills/forge/references/workflows.md +10 -0
  6. package/config/claude-agents/architect.md +1 -1
  7. package/config/claude-agents/backend-dev.md +1 -1
  8. package/config/claude-agents/devops-eng.md +1 -1
  9. package/config/claude-agents/frontend-dev.md +1 -1
  10. package/config/claude-agents/ops-lead.md +1 -1
  11. package/config/claude-agents/pm-director.md +1 -1
  12. package/config/claude-agents/strategy-director.md +1 -1
  13. package/config/hooks/session-start.sh +1 -1
  14. package/config/skills-curated.yaml +2 -2
  15. package/config/skills-provenance.yaml +7 -0
  16. package/config/statusline.sh +6 -1
  17. package/core/hooks/session_start.py +69 -28
  18. package/departments/dev/agents/architect.yaml +1 -0
  19. package/departments/dev/agents/backend-dev.yaml +1 -0
  20. package/departments/dev/agents/devops-eng.yaml +1 -0
  21. package/departments/dev/agents/frontend-dev.yaml +1 -0
  22. package/departments/dev/agents/tech-lead.yaml +1 -0
  23. package/departments/dev/skills/diagram/SKILL.md +175 -0
  24. package/departments/dev/skills/diagram/examples/archify-repo-grid.architecture.json +57 -0
  25. package/departments/dev/skills/diagram/vendor/LICENSE +22 -0
  26. package/departments/dev/skills/diagram/vendor/SKILL.md +367 -0
  27. package/departments/dev/skills/diagram/vendor/assets/template.html +11470 -0
  28. package/departments/dev/skills/diagram/vendor/bin/archify.mjs +600 -0
  29. package/departments/dev/skills/diagram/vendor/bin/open-artifact.mjs +67 -0
  30. package/departments/dev/skills/diagram/vendor/examples/agent-run.lifecycle.json +71 -0
  31. package/departments/dev/skills/diagram/vendor/examples/agent-tool-call.workflow.json +111 -0
  32. package/departments/dev/skills/diagram/vendor/examples/async-job-roundtrip.sequence.json +62 -0
  33. package/departments/dev/skills/diagram/vendor/examples/cache-miss-request.sequence.json +82 -0
  34. package/departments/dev/skills/diagram/vendor/examples/deployment-release.lifecycle.json +50 -0
  35. package/departments/dev/skills/diagram/vendor/examples/event-stream.dataflow.json +58 -0
  36. package/departments/dev/skills/diagram/vendor/examples/incident-response.workflow.json +65 -0
  37. package/departments/dev/skills/diagram/vendor/examples/product-analytics.dataflow.json +77 -0
  38. package/departments/dev/skills/diagram/vendor/examples/production-deployment.architecture.json +70 -0
  39. package/departments/dev/skills/diagram/vendor/examples/release-delivery.workflow.json +63 -0
  40. package/departments/dev/skills/diagram/vendor/examples/web-app.architecture.json +47 -0
  41. package/departments/dev/skills/diagram/vendor/package-lock.json +80 -0
  42. package/departments/dev/skills/diagram/vendor/package.json +28 -0
  43. package/departments/dev/skills/diagram/vendor/recipes/scenarios.mjs +350 -0
  44. package/departments/dev/skills/diagram/vendor/renderers/architecture/grid.mjs +62 -0
  45. package/departments/dev/skills/diagram/vendor/renderers/architecture/render-architecture.mjs +490 -0
  46. package/departments/dev/skills/diagram/vendor/renderers/dataflow/README.md +93 -0
  47. package/departments/dev/skills/diagram/vendor/renderers/dataflow/render-dataflow.mjs +396 -0
  48. package/departments/dev/skills/diagram/vendor/renderers/lifecycle/README.md +103 -0
  49. package/departments/dev/skills/diagram/vendor/renderers/lifecycle/render-lifecycle.mjs +482 -0
  50. package/departments/dev/skills/diagram/vendor/renderers/sequence/README.md +96 -0
  51. package/departments/dev/skills/diagram/vendor/renderers/sequence/render-sequence.mjs +357 -0
  52. package/departments/dev/skills/diagram/vendor/renderers/shared/cli.mjs +176 -0
  53. package/departments/dev/skills/diagram/vendor/renderers/shared/generated-validators.mjs +13 -0
  54. package/departments/dev/skills/diagram/vendor/renderers/shared/geometry.mjs +992 -0
  55. package/departments/dev/skills/diagram/vendor/renderers/shared/layout-report.mjs +40 -0
  56. package/departments/dev/skills/diagram/vendor/renderers/shared/utils.mjs +156 -0
  57. package/departments/dev/skills/diagram/vendor/renderers/shared/validator.mjs +40 -0
  58. package/departments/dev/skills/diagram/vendor/renderers/workflow/README.md +114 -0
  59. package/departments/dev/skills/diagram/vendor/renderers/workflow/render-workflow.mjs +598 -0
  60. package/departments/dev/skills/diagram/vendor/schemas/README.md +93 -0
  61. package/departments/dev/skills/diagram/vendor/schemas/architecture.schema.json +125 -0
  62. package/departments/dev/skills/diagram/vendor/schemas/common.schema.json +62 -0
  63. package/departments/dev/skills/diagram/vendor/schemas/dataflow.schema.json +240 -0
  64. package/departments/dev/skills/diagram/vendor/schemas/lifecycle.schema.json +260 -0
  65. package/departments/dev/skills/diagram/vendor/schemas/sequence.schema.json +205 -0
  66. package/departments/dev/skills/diagram/vendor/schemas/workflow.schema.json +351 -0
  67. package/departments/dev/skills/diagram/vendor/scripts/check-render-output.mjs +774 -0
  68. package/departments/dev/skills/diagram/vendor/scripts/generate-validators.mjs +66 -0
  69. package/departments/dev/skills/diagram/vendor/scripts/render-examples.mjs +26 -0
  70. package/departments/dev/skills/spec/SKILL.md +19 -0
  71. package/departments/ops/agents/ops-lead.yaml +1 -0
  72. package/departments/pm/agents/pm-director.yaml +1 -0
  73. package/departments/strategy/agents/strategy-director.yaml +1 -0
  74. package/harness/codex/AGENTS.md +1 -1
  75. package/harness/copilot/copilot-instructions.md +1 -1
  76. package/harness/cursor/rules/arkaos.mdc +2 -2
  77. package/harness/gemini/GEMINI.md +1 -1
  78. package/harness/opencode/AGENTS.md +1 -1
  79. package/harness/zed/.rules +1 -1
  80. package/installer/autoupdate.js +249 -0
  81. package/installer/cli.js +7 -0
  82. package/installer/core-snapshot.js +5 -1
  83. package/installer/doctor.js +11 -0
  84. package/installer/index.js +11 -0
  85. package/installer/update.js +11 -0
  86. package/knowledge/agents-registry-v2.json +9 -1
  87. package/knowledge/skills-manifest.json +14 -1
  88. package/package.json +3 -2
  89. package/pyproject.toml +1 -1
  90. package/scripts/auto-update.sh +188 -0
  91. package/scripts/skill_validator.py +10 -2
  92. package/scripts/tools/docs_stats.py +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "4.32.0",
3
+ "version": "4.34.0",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
@@ -74,7 +74,8 @@
74
74
  "LICENSE",
75
75
  "!**/__pycache__/",
76
76
  "!**/*.pyc",
77
- "!**/.DS_Store"
77
+ "!**/.DS_Store",
78
+ "!departments/dev/skills/diagram/vendor/test/"
78
79
  ],
79
80
  "devDependencies": {
80
81
  "eslint": "^8.57.1"
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "4.32.0"
3
+ version = "4.34.0"
4
4
  description = "Core engine for ArkaOS — The Operating System for AI Agent Teams"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env bash
2
+ # ============================================================================
3
+ # ArkaOS — background auto-update (Foundation PR-1)
4
+ #
5
+ # Invoked daily by the io.wizardingcode.arkaos.updater unit (see
6
+ # installer/autoupdate.js) or manually via `npx arkaos autoupdate run`.
7
+ #
8
+ # Flow: registry check (curl, short timeout) → compare with the installed
9
+ # version (~/.arkaos/install-manifest.json) → headless `npx -y
10
+ # arkaos@latest update` → OS notification with the outcome. Project sync
11
+ # stays supervised: update.js resets sync-state.json, so the next Claude
12
+ # session surfaces [arka:update-available] and /arka update runs there.
13
+ #
14
+ # Every failure path logs and exits 0 — a broken check must never surface
15
+ # as a crashing login item.
16
+ # ============================================================================
17
+ set -u
18
+
19
+ ARKA_HOME="${HOME}/.arkaos"
20
+ LOG_DIR="${ARKA_HOME}/logs"
21
+ LOG="${LOG_DIR}/auto-update.log"
22
+ LOCK_DIR="${ARKA_HOME}/auto-update.lock"
23
+ MANIFEST="${ARKA_HOME}/install-manifest.json"
24
+ OPTOUT="${ARKA_HOME}/autoupdate.optout"
25
+ PROFILE="${ARKA_HOME}/profile.json"
26
+ REGISTRY_URL="https://registry.npmjs.org/arkaos/latest"
27
+
28
+ FORCE=0
29
+ [ "${1:-}" = "--force" ] && FORCE=1
30
+
31
+ mkdir -p "$LOG_DIR"
32
+
33
+ log() {
34
+ printf '%s %s\n' "$(date '+%Y-%m-%dT%H:%M:%S')" "$1" >> "$LOG"
35
+ }
36
+
37
+ # Keep the log bounded (~1MB cap, keep the newest half).
38
+ rotate_log() {
39
+ local size
40
+ size=$(wc -c < "$LOG" 2>/dev/null || echo 0)
41
+ if [ "${size:-0}" -gt 1048576 ]; then
42
+ tail -c 524288 "$LOG" > "${LOG}.tmp" && mv "${LOG}.tmp" "$LOG"
43
+ fi
44
+ }
45
+
46
+ # JSON field reader: venv python → python3 → sed (last resort).
47
+ json_field() {
48
+ local file="$1" field="$2"
49
+ local py="${ARKA_HOME}/venv/bin/python"
50
+ [ -x "$py" ] || py="$(command -v python3 || true)"
51
+ if [ -n "$py" ]; then
52
+ "$py" -c "import json,sys; print(json.load(open(sys.argv[1])).get(sys.argv[2],''))" \
53
+ "$file" "$field" 2>/dev/null && return 0
54
+ fi
55
+ sed -n "s/.*\"${field}\"[[:space:]]*:[[:space:]]*\"\([^\"]*\)\".*/\1/p" "$file" 2>/dev/null | head -1
56
+ }
57
+
58
+ notify() {
59
+ local msg="$1"
60
+ log "notify: $msg"
61
+ case "$(uname -s)" in
62
+ Darwin)
63
+ command -v osascript >/dev/null 2>&1 && \
64
+ osascript -e "display notification \"${msg}\" with title \"ArkaOS\"" >/dev/null 2>&1
65
+ ;;
66
+ Linux)
67
+ command -v notify-send >/dev/null 2>&1 && notify-send "ArkaOS" "$msg" >/dev/null 2>&1
68
+ ;;
69
+ esac
70
+ }
71
+
72
+ # Notification copy follows the installed profile language (pt → pt-PT).
73
+ LANG_CODE=""
74
+ [ -f "$PROFILE" ] && LANG_CODE="$(json_field "$PROFILE" language)"
75
+
76
+ msg_updated() {
77
+ if [ "$LANG_CODE" = "pt" ]; then
78
+ echo "Atualizado para v$1. Os projetos sincronizam na próxima sessão Claude."
79
+ else
80
+ echo "Updated to v$1. Projects sync on your next Claude session."
81
+ fi
82
+ }
83
+ msg_failed() {
84
+ if [ "$LANG_CODE" = "pt" ]; then
85
+ echo "Falha no auto-update (v$1). Corre: npx arkaos@latest update"
86
+ else
87
+ echo "Auto-update failed (v$1). Run: npx arkaos@latest update"
88
+ fi
89
+ }
90
+
91
+ rotate_log
92
+
93
+ # ── Opt-out and install guards ─────────────────────────────────────────
94
+ if [ -f "$OPTOUT" ]; then
95
+ log "skip: user opt-out marker present"
96
+ exit 0
97
+ fi
98
+ if [ ! -f "$MANIFEST" ]; then
99
+ log "skip: no install-manifest.json — ArkaOS not installed"
100
+ exit 0
101
+ fi
102
+
103
+ # ── Lock (mkdir is atomic); reclaim stale locks older than 2h ──────────
104
+ if ! mkdir "$LOCK_DIR" 2>/dev/null; then
105
+ if [ -n "$(find "$LOCK_DIR" -maxdepth 0 -mmin +120 2>/dev/null)" ]; then
106
+ log "reclaiming stale lock"
107
+ rmdir "$LOCK_DIR" 2>/dev/null || true
108
+ mkdir "$LOCK_DIR" 2>/dev/null || { log "skip: lock contention"; exit 0; }
109
+ else
110
+ log "skip: another auto-update run holds the lock"
111
+ exit 0
112
+ fi
113
+ fi
114
+ trap 'rmdir "$LOCK_DIR" 2>/dev/null' EXIT
115
+
116
+ # launchd/systemd environments miss the node toolchain locations; append
117
+ # (not prepend — explicit PATH entries, e.g. test stubs, must win).
118
+ export PATH="${PATH}:/opt/homebrew/bin:/usr/local/bin"
119
+
120
+ INSTALLED="$(json_field "$MANIFEST" version)"
121
+ if [ -z "$INSTALLED" ]; then
122
+ log "skip: could not read installed version from manifest"
123
+ exit 0
124
+ fi
125
+
126
+ if ! command -v curl >/dev/null 2>&1; then
127
+ log "skip: curl unavailable"
128
+ exit 0
129
+ fi
130
+ LATEST_JSON="$(curl -sf --max-time 15 "$REGISTRY_URL" 2>/dev/null || true)"
131
+ if [ -z "$LATEST_JSON" ]; then
132
+ log "skip: registry unreachable (offline?)"
133
+ exit 0
134
+ fi
135
+ TMP_JSON="${ARKA_HOME}/.autoupdate-latest.json"
136
+ printf '%s' "$LATEST_JSON" > "$TMP_JSON"
137
+ LATEST="$(json_field "$TMP_JSON" version)"
138
+ rm -f "$TMP_JSON"
139
+ if [ -z "$LATEST" ]; then
140
+ log "skip: could not parse registry response"
141
+ exit 0
142
+ fi
143
+
144
+ # Only ever move FORWARD: a dev/prerelease install newer than the
145
+ # registry `latest` must not be silently downgraded (QG, Francisca).
146
+ # Ordering compare via python; degraded fallback is plain inequality.
147
+ is_newer() { # is_newer LATEST INSTALLED → exit 0 when LATEST > INSTALLED
148
+ local py="${ARKA_HOME}/venv/bin/python"
149
+ [ -x "$py" ] || py="$(command -v python3 || true)"
150
+ if [ -n "$py" ]; then
151
+ "$py" -c '
152
+ import re, sys
153
+ def key(v):
154
+ core = re.split(r"[-+]", v, maxsplit=1)[0]
155
+ nums = [int(x) for x in re.findall(r"\d+", core)[:3]]
156
+ nums += [0] * (3 - len(nums))
157
+ return (nums, "-" not in v) # prerelease sorts below its release
158
+ sys.exit(0 if key(sys.argv[1]) > key(sys.argv[2]) else 1)' "$1" "$2" 2>/dev/null
159
+ return $?
160
+ fi
161
+ [ "$1" != "$2" ]
162
+ }
163
+
164
+ if [ "$FORCE" -ne 1 ]; then
165
+ if [ "$LATEST" = "$INSTALLED" ]; then
166
+ log "up to date (v${INSTALLED})"
167
+ exit 0
168
+ fi
169
+ if ! is_newer "$LATEST" "$INSTALLED"; then
170
+ log "installed v${INSTALLED} is ahead of registry v${LATEST} — skip"
171
+ exit 0
172
+ fi
173
+ fi
174
+
175
+ if ! command -v npx >/dev/null 2>&1; then
176
+ log "skip: npx unavailable — cannot apply v${LATEST}"
177
+ exit 0
178
+ fi
179
+
180
+ log "updating v${INSTALLED} → v${LATEST}"
181
+ if npx -y arkaos@latest update >> "$LOG" 2>&1; then
182
+ log "update to v${LATEST} succeeded"
183
+ notify "$(msg_updated "$LATEST")"
184
+ else
185
+ log "update to v${LATEST} FAILED (see log above)"
186
+ notify "$(msg_failed "$LATEST")"
187
+ fi
188
+ exit 0
@@ -187,8 +187,16 @@ def validate_skill(skill_dir: Path) -> SkillResult:
187
187
 
188
188
 
189
189
  def discover_skills(root: Path) -> list[Path]:
190
- """Recursively find all directories containing SKILL.md."""
191
- skills = [Path(dp) for dp, _, fns in os.walk(root) if "SKILL.md" in fns]
190
+ """Recursively find all directories containing SKILL.md.
191
+
192
+ ``vendor/`` subtrees are pruned: vendored third-party payloads carry
193
+ their own upstream SKILL.md, which is not an ArkaOS skill.
194
+ """
195
+ skills: list[Path] = []
196
+ for dp, dns, fns in os.walk(root):
197
+ dns[:] = [d for d in dns if d != "vendor"]
198
+ if "SKILL.md" in fns:
199
+ skills.append(Path(dp))
192
200
  skills.sort(key=lambda p: str(p))
193
201
  return skills
194
202
 
@@ -57,10 +57,16 @@ def count_departments(root: Path) -> int:
57
57
 
58
58
 
59
59
  def count_skills(root: Path) -> dict:
60
- """Count SKILL.md files by area. 'core' = departments + arka."""
60
+ """Count SKILL.md files by area. 'core' = departments + arka.
61
+
62
+ vendor/ subtrees carry upstream third-party SKILL.md files (e.g. the
63
+ archify payload under dev/diagram) — not ArkaOS skills, never counted.
64
+ """
61
65
  def _n(rel: str) -> int:
62
66
  base = root / rel
63
- return len(list(base.rglob("SKILL.md"))) if base.is_dir() else 0
67
+ if not base.is_dir():
68
+ return 0
69
+ return sum(1 for f in base.rglob("SKILL.md") if "vendor" not in f.parts)
64
70
 
65
71
  dept, arka, market = _n("departments"), _n("arka"), _n("marketplace")
66
72
  # plugins/ is a GENERATED export-copy (scripts/marketplace_gen.py)