arkaos 2.0.1 → 2.0.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 (55) hide show
  1. package/VERSION +1 -1
  2. package/config/constitution.yaml +6 -0
  3. package/config/hooks/user-prompt-submit-v2.sh +33 -40
  4. package/core/budget/__init__.py +6 -0
  5. package/core/budget/__pycache__/__init__.cpython-313.pyc +0 -0
  6. package/core/budget/__pycache__/manager.cpython-313.pyc +0 -0
  7. package/core/budget/__pycache__/schema.cpython-313.pyc +0 -0
  8. package/core/budget/manager.py +193 -0
  9. package/core/budget/schema.py +82 -0
  10. package/core/knowledge/__init__.py +6 -0
  11. package/core/knowledge/__pycache__/__init__.cpython-313.pyc +0 -0
  12. package/core/knowledge/__pycache__/chunker.cpython-313.pyc +0 -0
  13. package/core/knowledge/__pycache__/embedder.cpython-313.pyc +0 -0
  14. package/core/knowledge/__pycache__/indexer.cpython-313.pyc +0 -0
  15. package/core/knowledge/__pycache__/vector_store.cpython-313.pyc +0 -0
  16. package/core/knowledge/chunker.py +121 -0
  17. package/core/knowledge/embedder.py +52 -0
  18. package/core/knowledge/indexer.py +97 -0
  19. package/core/knowledge/vector_store.py +213 -0
  20. package/core/obsidian/__init__.py +6 -0
  21. package/core/obsidian/__pycache__/__init__.cpython-313.pyc +0 -0
  22. package/core/obsidian/__pycache__/templates.cpython-313.pyc +0 -0
  23. package/core/obsidian/__pycache__/writer.cpython-313.pyc +0 -0
  24. package/core/obsidian/templates.py +76 -0
  25. package/core/obsidian/writer.py +148 -0
  26. package/core/orchestration/__init__.py +6 -0
  27. package/core/orchestration/__pycache__/__init__.cpython-313.pyc +0 -0
  28. package/core/orchestration/__pycache__/patterns.cpython-313.pyc +0 -0
  29. package/core/orchestration/__pycache__/protocol.cpython-313.pyc +0 -0
  30. package/core/orchestration/patterns.py +136 -0
  31. package/core/orchestration/protocol.py +96 -0
  32. package/core/runtime/__pycache__/subagent.cpython-313.pyc +0 -0
  33. package/core/runtime/subagent.py +5 -0
  34. package/core/squads/__pycache__/schema.cpython-313.pyc +0 -0
  35. package/core/squads/schema.py +3 -0
  36. package/core/squads/templates/project-squad.yaml +28 -0
  37. package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
  38. package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
  39. package/core/synapse/engine.py +5 -1
  40. package/core/synapse/layers.py +95 -9
  41. package/core/tasks/__pycache__/schema.cpython-313.pyc +0 -0
  42. package/core/tasks/schema.py +7 -0
  43. package/core/workflow/__pycache__/engine.cpython-313.pyc +0 -0
  44. package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
  45. package/core/workflow/engine.py +44 -0
  46. package/core/workflow/schema.py +1 -0
  47. package/departments/dev/agents/research-assistant.yaml +51 -0
  48. package/departments/kb/agents/data-collector.yaml +51 -0
  49. package/departments/ops/agents/doc-writer.yaml +51 -0
  50. package/departments/pm/agents/pm-director.yaml +1 -1
  51. package/installer/cli.js +36 -0
  52. package/installer/init.js +105 -0
  53. package/installer/migrate.js +4 -1
  54. package/package.json +1 -1
  55. package/pyproject.toml +5 -1
@@ -0,0 +1,51 @@
1
+ id: doc-writer
2
+ name: Isabel
3
+ role: Documentation Writer
4
+ department: ops
5
+ tier: 3
6
+
7
+ behavioral_dna:
8
+ disc:
9
+ primary: S
10
+ secondary: C
11
+ communication_style: "Clear, structured, audience-aware"
12
+ under_pressure: "Focuses on clarity and completeness"
13
+ motivator: "Making complex things accessible"
14
+ enneagram:
15
+ type: 1
16
+ wing: 2
17
+ core_motivation: "To produce correct, helpful documentation"
18
+ core_fear: "Publishing inaccurate information"
19
+ subtype: social
20
+ big_five:
21
+ openness: 75
22
+ conscientiousness: 92
23
+ extraversion: 40
24
+ agreeableness: 80
25
+ neuroticism: 30
26
+ mbti:
27
+ type: ISFJ
28
+
29
+ authority:
30
+ veto: false
31
+ approve_budget: false
32
+ approve_architecture: false
33
+ approve_quality: false
34
+ block_release: false
35
+ block_delivery: false
36
+ orchestrate: false
37
+ delegates_to: []
38
+ escalates_to: ops-lead-daniel
39
+
40
+ expertise:
41
+ domains: ["technical-writing", "API-docs", "user-guides", "SOPs"]
42
+ frameworks: ["Diátaxis", "Google Developer Documentation Style"]
43
+ depth: proficient
44
+ years_equivalent: 5
45
+
46
+ communication:
47
+ language: en
48
+ tone: "Clear, concise, helpful"
49
+ vocabulary_level: accessible
50
+ preferred_format: "Step-by-step guides with examples"
51
+ avoid: ["jargon without explanation", "walls of text"]
@@ -42,7 +42,7 @@ authority:
42
42
  - product-owner
43
43
  - scrum-master
44
44
  - project-coordinator
45
- escalates_to: cto-marco
45
+ escalates_to: coo-sofia
46
46
 
47
47
  expertise:
48
48
  domains:
package/installer/cli.js CHANGED
@@ -36,6 +36,7 @@ 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
41
42
  npx arkaos doctor Run health checks
@@ -57,6 +58,8 @@ Runtimes:
57
58
  Examples:
58
59
  npx arkaos install Auto-detect runtime and install
59
60
  npx arkaos install --runtime codex Install for Codex CLI specifically
61
+ npx arkaos index Index knowledge base (Obsidian vault)
62
+ npx arkaos search "query" Search indexed knowledge
60
63
  npx arkaos doctor Verify installation health
61
64
  `);
62
65
  process.exit(0);
@@ -69,6 +72,12 @@ async function main() {
69
72
  await install({ runtime, path: values.path, force: values.force });
70
73
  break;
71
74
 
75
+ case "init": {
76
+ const { init } = await import("./init.js");
77
+ await init({ path: values.path || process.cwd() });
78
+ break;
79
+ }
80
+
72
81
  case "doctor":
73
82
  const { doctor } = await import("./doctor.js");
74
83
  await doctor();
@@ -89,6 +98,33 @@ async function main() {
89
98
  await migrate();
90
99
  break;
91
100
 
101
+ case "index": {
102
+ const { execSync } = await import("node:child_process");
103
+ const indexArgs = positionals.slice(1).join(" ");
104
+ const repoRoot = dirname(fileURLToPath(import.meta.url)).replace(/\/installer$/, "");
105
+ try {
106
+ execSync(`python3 "${repoRoot}/scripts/knowledge-index.py" ${indexArgs || "--vault"}`, {
107
+ stdio: "inherit",
108
+ env: { ...process.env, ARKAOS_ROOT: repoRoot },
109
+ });
110
+ } catch { process.exit(1); }
111
+ break;
112
+ }
113
+
114
+ case "search": {
115
+ const { execSync } = await import("node:child_process");
116
+ const query = positionals.slice(1).join(" ");
117
+ if (!query) { console.error("Usage: npx arkaos search \"your query\""); process.exit(1); }
118
+ const repoRoot2 = dirname(fileURLToPath(import.meta.url)).replace(/\/installer$/, "");
119
+ try {
120
+ execSync(`python3 "${repoRoot2}/scripts/knowledge-index.py" --search "${query}"`, {
121
+ stdio: "inherit",
122
+ env: { ...process.env, ARKAOS_ROOT: repoRoot2 },
123
+ });
124
+ } catch { process.exit(1); }
125
+ break;
126
+ }
127
+
92
128
  default:
93
129
  console.error(`Unknown command: ${command}`);
94
130
  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.1",
3
+ "version": "2.0.3",
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.1"
3
+ version = "2.0.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"}
@@ -28,6 +28,10 @@ dependencies = [
28
28
  ]
29
29
 
30
30
  [project.optional-dependencies]
31
+ knowledge = [
32
+ "fastembed>=0.8.0",
33
+ "sqlite-vss>=0.1.2",
34
+ ]
31
35
  dev = [
32
36
  "pytest>=8.0",
33
37
  "pytest-cov>=5.0",