arkaos 2.0.2 → 2.1.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 (46) hide show
  1. package/VERSION +1 -1
  2. package/config/constitution.yaml +2 -0
  3. package/config/hooks/user-prompt-submit-v2.sh +11 -0
  4. package/core/budget/__pycache__/__init__.cpython-313.pyc +0 -0
  5. package/core/budget/__pycache__/manager.cpython-313.pyc +0 -0
  6. package/core/budget/__pycache__/schema.cpython-313.pyc +0 -0
  7. package/core/knowledge/__init__.py +6 -0
  8. package/core/knowledge/__pycache__/__init__.cpython-313.pyc +0 -0
  9. package/core/knowledge/__pycache__/chunker.cpython-313.pyc +0 -0
  10. package/core/knowledge/__pycache__/embedder.cpython-313.pyc +0 -0
  11. package/core/knowledge/__pycache__/indexer.cpython-313.pyc +0 -0
  12. package/core/knowledge/__pycache__/ingest.cpython-313.pyc +0 -0
  13. package/core/knowledge/__pycache__/vector_store.cpython-313.pyc +0 -0
  14. package/core/knowledge/chunker.py +121 -0
  15. package/core/knowledge/embedder.py +52 -0
  16. package/core/knowledge/indexer.py +97 -0
  17. package/core/knowledge/ingest.py +270 -0
  18. package/core/knowledge/vector_store.py +213 -0
  19. package/core/obsidian/__pycache__/__init__.cpython-313.pyc +0 -0
  20. package/core/obsidian/__pycache__/templates.cpython-313.pyc +0 -0
  21. package/core/obsidian/__pycache__/writer.cpython-313.pyc +0 -0
  22. package/core/orchestration/__pycache__/__init__.cpython-313.pyc +0 -0
  23. package/core/orchestration/__pycache__/patterns.cpython-313.pyc +0 -0
  24. package/core/orchestration/__pycache__/protocol.cpython-313.pyc +0 -0
  25. package/core/runtime/__pycache__/subagent.cpython-313.pyc +0 -0
  26. package/core/runtime/subagent.py +5 -0
  27. package/core/squads/__pycache__/schema.cpython-313.pyc +0 -0
  28. package/core/squads/schema.py +3 -0
  29. package/core/squads/templates/project-squad.yaml +28 -0
  30. package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
  31. package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
  32. package/core/synapse/engine.py +5 -1
  33. package/core/synapse/layers.py +95 -9
  34. package/core/tasks/__pycache__/schema.cpython-313.pyc +0 -0
  35. package/core/tasks/schema.py +1 -0
  36. package/core/workflow/__pycache__/engine.cpython-313.pyc +0 -0
  37. package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
  38. package/departments/dev/agents/research-assistant.yaml +51 -0
  39. package/departments/kb/agents/data-collector.yaml +51 -0
  40. package/departments/ops/agents/doc-writer.yaml +51 -0
  41. package/departments/pm/agents/pm-director.yaml +1 -1
  42. package/installer/cli.js +49 -0
  43. package/installer/init.js +105 -0
  44. package/installer/migrate.js +4 -1
  45. package/package.json +1 -1
  46. package/pyproject.toml +16 -1
package/installer/cli.js CHANGED
@@ -36,8 +36,10 @@ ArkaOS v${VERSION} — The Operating System for AI Agent Teams
36
36
  Usage:
37
37
  npx arkaos install Install ArkaOS in current environment
38
38
  npx arkaos install --runtime <runtime> Install for specific runtime
39
+ npx arkaos init Initialize project config (.arkaos.json)
39
40
  npx arkaos update Update to latest version
40
41
  npx arkaos migrate Migrate from v1 to v2
42
+ npx arkaos dashboard Start monitoring dashboard
41
43
  npx arkaos doctor Run health checks
42
44
  npx arkaos uninstall Remove ArkaOS
43
45
 
@@ -57,6 +59,8 @@ Runtimes:
57
59
  Examples:
58
60
  npx arkaos install Auto-detect runtime and install
59
61
  npx arkaos install --runtime codex Install for Codex CLI specifically
62
+ npx arkaos index Index knowledge base (Obsidian vault)
63
+ npx arkaos search "query" Search indexed knowledge
60
64
  npx arkaos doctor Verify installation health
61
65
  `);
62
66
  process.exit(0);
@@ -69,6 +73,12 @@ async function main() {
69
73
  await install({ runtime, path: values.path, force: values.force });
70
74
  break;
71
75
 
76
+ case "init": {
77
+ const { init } = await import("./init.js");
78
+ await init({ path: values.path || process.cwd() });
79
+ break;
80
+ }
81
+
72
82
  case "doctor":
73
83
  const { doctor } = await import("./doctor.js");
74
84
  await doctor();
@@ -89,6 +99,45 @@ async function main() {
89
99
  await migrate();
90
100
  break;
91
101
 
102
+ case "dashboard": {
103
+ const { execSync: execDash } = await import("node:child_process");
104
+ const repoRootDash = dirname(fileURLToPath(import.meta.url)).replace(/\/installer$/, "");
105
+ try {
106
+ execDash(`bash "${repoRootDash}/scripts/start-dashboard.sh"`, {
107
+ stdio: "inherit",
108
+ env: { ...process.env, ARKAOS_ROOT: repoRootDash },
109
+ });
110
+ } catch { process.exit(1); }
111
+ break;
112
+ }
113
+
114
+ case "index": {
115
+ const { execSync } = await import("node:child_process");
116
+ const indexArgs = positionals.slice(1).join(" ");
117
+ const repoRoot = dirname(fileURLToPath(import.meta.url)).replace(/\/installer$/, "");
118
+ try {
119
+ execSync(`python3 "${repoRoot}/scripts/knowledge-index.py" ${indexArgs || "--vault"}`, {
120
+ stdio: "inherit",
121
+ env: { ...process.env, ARKAOS_ROOT: repoRoot },
122
+ });
123
+ } catch { process.exit(1); }
124
+ break;
125
+ }
126
+
127
+ case "search": {
128
+ const { execSync } = await import("node:child_process");
129
+ const query = positionals.slice(1).join(" ");
130
+ if (!query) { console.error("Usage: npx arkaos search \"your query\""); process.exit(1); }
131
+ const repoRoot2 = dirname(fileURLToPath(import.meta.url)).replace(/\/installer$/, "");
132
+ try {
133
+ execSync(`python3 "${repoRoot2}/scripts/knowledge-index.py" --search "${query}"`, {
134
+ stdio: "inherit",
135
+ env: { ...process.env, ARKAOS_ROOT: repoRoot2 },
136
+ });
137
+ } catch { process.exit(1); }
138
+ break;
139
+ }
140
+
92
141
  default:
93
142
  console.error(`Unknown command: ${command}`);
94
143
  console.error('Run "npx arkaos help" for usage information.');
@@ -0,0 +1,105 @@
1
+ import { existsSync, readFileSync, writeFileSync, mkdirSync } from "node:fs";
2
+ import { join, basename } from "node:path";
3
+ import { execSync } from "node:child_process";
4
+
5
+ export async function init({ path }) {
6
+ const projectDir = path || process.cwd();
7
+ const configPath = join(projectDir, ".arkaos.json");
8
+ const projectName = basename(projectDir);
9
+
10
+ console.log(`\n ArkaOS Project Init — ${projectName}\n`);
11
+
12
+ // Detect existing config
13
+ if (existsSync(configPath)) {
14
+ const existing = JSON.parse(readFileSync(configPath, "utf-8"));
15
+ console.log(` Config already exists: ${configPath}`);
16
+ console.log(` Department: ${existing.department || "auto"}`);
17
+ console.log(` Stack: ${existing.stack || "auto"}`);
18
+ console.log(`\n To reconfigure, delete .arkaos.json and run again.\n`);
19
+ return;
20
+ }
21
+
22
+ // Auto-detect stack
23
+ const stack = detectStack(projectDir);
24
+ console.log(` Detected stack: ${stack}`);
25
+
26
+ // Auto-detect department
27
+ const department = detectDepartment(projectDir, stack);
28
+ console.log(` Default department: ${department}`);
29
+
30
+ // Create config
31
+ const config = {
32
+ name: projectName,
33
+ department,
34
+ stack,
35
+ created: new Date().toISOString(),
36
+ arkaos_version: "2",
37
+ settings: {
38
+ quality_gate: true,
39
+ obsidian_output: true,
40
+ auto_index: true,
41
+ },
42
+ };
43
+
44
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
45
+ console.log(` Created: ${configPath}`);
46
+
47
+ // Create .claude/settings.local.json if Claude Code project
48
+ const claudeDir = join(projectDir, ".claude");
49
+ const localSettings = join(claudeDir, "settings.local.json");
50
+ if (!existsSync(localSettings)) {
51
+ mkdirSync(claudeDir, { recursive: true });
52
+ writeFileSync(localSettings, JSON.stringify({
53
+ permissions: {},
54
+ hooks: {},
55
+ }, null, 2) + "\n");
56
+ console.log(` Created: .claude/settings.local.json`);
57
+ }
58
+
59
+ console.log(`
60
+ Project initialized for ArkaOS.
61
+
62
+ Config: .arkaos.json
63
+ Stack: ${stack}
64
+ Dept: ${department}
65
+
66
+ ArkaOS will auto-detect this project's context via Synapse L3.
67
+ Use /dev, /mkt, /brand etc. or just describe what you need.
68
+ `);
69
+ }
70
+
71
+ function detectStack(dir) {
72
+ if (existsSync(join(dir, "composer.json"))) return "laravel";
73
+ if (existsSync(join(dir, "nuxt.config.ts")) || existsSync(join(dir, "nuxt.config.js"))) return "nuxt";
74
+ if (existsSync(join(dir, "next.config.js")) || existsSync(join(dir, "next.config.ts")) || existsSync(join(dir, "next.config.mjs"))) return "nextjs";
75
+ if (existsSync(join(dir, "vite.config.ts"))) {
76
+ try {
77
+ const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf-8"));
78
+ if (pkg.dependencies?.vue) return "vue";
79
+ if (pkg.dependencies?.react) return "react";
80
+ } catch {}
81
+ return "vite";
82
+ }
83
+ if (existsSync(join(dir, "package.json"))) {
84
+ try {
85
+ const pkg = JSON.parse(readFileSync(join(dir, "package.json"), "utf-8"));
86
+ if (pkg.dependencies?.react) return "react";
87
+ if (pkg.dependencies?.vue) return "vue";
88
+ if (pkg.dependencies?.express) return "node-express";
89
+ return "node";
90
+ } catch {}
91
+ }
92
+ if (existsSync(join(dir, "pyproject.toml")) || existsSync(join(dir, "setup.py"))) return "python";
93
+ if (existsSync(join(dir, "Gemfile"))) return "ruby";
94
+ if (existsSync(join(dir, "go.mod"))) return "go";
95
+ if (existsSync(join(dir, "Cargo.toml"))) return "rust";
96
+ return "unknown";
97
+ }
98
+
99
+ function detectDepartment(dir, stack) {
100
+ // Code projects default to dev
101
+ if (["laravel", "nuxt", "nextjs", "react", "vue", "node", "python", "ruby", "go", "rust", "node-express", "vite"].includes(stack)) {
102
+ return "dev";
103
+ }
104
+ return "general";
105
+ }
@@ -1,4 +1,4 @@
1
- import { existsSync, readFileSync, renameSync, mkdirSync } from "node:fs";
1
+ import { existsSync, readFileSync, renameSync, mkdirSync, writeFileSync } 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";
@@ -105,6 +105,9 @@ export async function migrate() {
105
105
  process.exit(1);
106
106
  }
107
107
 
108
+ // Mark as migrated so hook stops alerting
109
+ writeFileSync(join(V2_PATH, "migrated-from-v1"), new Date().toISOString());
110
+
108
111
  console.log(`
109
112
  Migration complete!
110
113
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "2.0.2"
3
+ version = "2.1.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"}
@@ -28,6 +28,21 @@ dependencies = [
28
28
  ]
29
29
 
30
30
  [project.optional-dependencies]
31
+ knowledge = [
32
+ "fastembed>=0.8.0",
33
+ "sqlite-vss>=0.1.2",
34
+ ]
35
+ dashboard = [
36
+ "fastapi>=0.115.0",
37
+ "uvicorn>=0.32.0",
38
+ ]
39
+ ingest = [
40
+ "yt-dlp>=2024.0",
41
+ "faster-whisper>=1.0.0",
42
+ "pdfplumber>=0.11.0",
43
+ "beautifulsoup4>=4.12.0",
44
+ "requests>=2.31.0",
45
+ ]
31
46
  dev = [
32
47
  "pytest>=8.0",
33
48
  "pytest-cov>=5.0",