arkaos 2.10.0 → 2.11.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.
- package/README.md +318 -107
- package/VERSION +1 -1
- package/config/hooks/cwd-changed.ps1 +144 -0
- package/config/hooks/post-tool-use.ps1 +347 -0
- package/config/hooks/post-tool-use.sh +6 -6
- package/config/hooks/pre-compact.ps1 +238 -0
- package/config/hooks/pre-compact.sh +10 -6
- package/config/hooks/session-start.ps1 +109 -0
- package/config/hooks/session-start.sh +1 -1
- package/config/hooks/user-prompt-submit.ps1 +287 -0
- package/config/hooks/user-prompt-submit.sh +5 -2
- package/config/statusline.ps1 +160 -0
- package/core/cognition/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/cognition/capture/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/cognition/capture/__pycache__/collector.cpython-313.pyc +0 -0
- package/core/cognition/capture/__pycache__/store.cpython-313.pyc +0 -0
- package/core/cognition/insights/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/cognition/insights/__pycache__/store.cpython-313.pyc +0 -0
- package/core/cognition/memory/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/cognition/memory/__pycache__/obsidian.cpython-313.pyc +0 -0
- package/core/cognition/memory/__pycache__/schemas.cpython-313.pyc +0 -0
- package/core/cognition/memory/__pycache__/vector.cpython-313.pyc +0 -0
- package/core/cognition/memory/__pycache__/writer.cpython-313.pyc +0 -0
- package/core/cognition/research/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/cognition/research/__pycache__/profiler.cpython-313.pyc +0 -0
- package/core/cognition/scheduler/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/cognition/scheduler/__pycache__/cli.cpython-313.pyc +0 -0
- package/core/cognition/scheduler/__pycache__/daemon.cpython-313.pyc +0 -0
- package/core/cognition/scheduler/__pycache__/platform.cpython-313.pyc +0 -0
- package/core/cognition/scheduler/daemon.py +77 -21
- package/core/cognition/scheduler/platform.py +43 -12
- package/core/knowledge/__pycache__/vector_store.cpython-313.pyc +0 -0
- package/core/knowledge/vector_store.py +50 -25
- package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
- package/core/synapse/layers.py +2 -2
- package/installer/adapters/claude-code.js +72 -45
- package/installer/cli.js +19 -6
- package/installer/doctor.js +130 -18
- package/installer/index.js +592 -149
- package/installer/platform.js +20 -0
- package/installer/prompts.js +109 -5
- package/installer/python-resolver.js +251 -0
- package/installer/update.js +497 -62
- package/package.json +1 -1
- package/pyproject.toml +2 -2
- package/scripts/start-dashboard.ps1 +271 -0
package/installer/doctor.js
CHANGED
|
@@ -2,50 +2,75 @@ import { existsSync, readFileSync } 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";
|
|
5
|
+
import { getArkaosPython, getVenvPython, canImportCore, getRepoRoot } from "./python-resolver.js";
|
|
6
|
+
import { IS_WINDOWS, HOOK_EXT, CMD_FINDER } from "./platform.js";
|
|
5
7
|
|
|
6
8
|
const INSTALL_DIR = join(homedir(), ".arkaos");
|
|
7
9
|
|
|
10
|
+
// Resolve a single command via the platform-native locator. Returns true
|
|
11
|
+
// when the command is discoverable on PATH, false otherwise. stderr is
|
|
12
|
+
// suppressed through Node's stdio option so the probe does not print
|
|
13
|
+
// noise when the command is missing.
|
|
14
|
+
function commandExists(cmd) {
|
|
15
|
+
const finder = CMD_FINDER;
|
|
16
|
+
try {
|
|
17
|
+
execSync(`${finder} ${cmd}`, { stdio: ["pipe", "pipe", "ignore"] });
|
|
18
|
+
return true;
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
8
24
|
const checks = [
|
|
9
25
|
{
|
|
10
26
|
name: "install-dir",
|
|
11
27
|
description: "ArkaOS installation directory exists",
|
|
12
28
|
severity: "fail",
|
|
13
29
|
check: () => existsSync(INSTALL_DIR),
|
|
14
|
-
fix: "Run: npx arkaos install",
|
|
30
|
+
fix: () => "Run: npx arkaos install",
|
|
15
31
|
},
|
|
16
32
|
{
|
|
17
33
|
name: "manifest",
|
|
18
34
|
description: "Install manifest present",
|
|
19
35
|
severity: "fail",
|
|
20
36
|
check: () => existsSync(join(INSTALL_DIR, "install-manifest.json")),
|
|
21
|
-
fix: "Run: npx arkaos install",
|
|
37
|
+
fix: () => "Run: npx arkaos install",
|
|
22
38
|
},
|
|
23
39
|
{
|
|
24
40
|
name: "python",
|
|
25
41
|
description: "Python 3.11+ available",
|
|
26
42
|
severity: "fail",
|
|
27
43
|
check: () => {
|
|
44
|
+
const py = getArkaosPython();
|
|
45
|
+
if (!py) return false;
|
|
28
46
|
try {
|
|
29
|
-
const v = execSync("
|
|
47
|
+
const v = execSync(`"${py}" --version 2>&1`, { stdio: "pipe" }).toString();
|
|
30
48
|
const m = v.match(/(\d+)\.(\d+)/);
|
|
31
49
|
return m && parseInt(m[1]) >= 3 && parseInt(m[2]) >= 11;
|
|
32
50
|
} catch { return false; }
|
|
33
51
|
},
|
|
34
|
-
fix: "Install Python 3.11+: https://python.org",
|
|
52
|
+
fix: () => "Install Python 3.11+: https://python.org",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "venv",
|
|
56
|
+
description: "ArkaOS virtual environment exists",
|
|
57
|
+
severity: "warn",
|
|
58
|
+
check: () => existsSync(getVenvPython()),
|
|
59
|
+
fix: () => "Run: npx arkaos@latest update (creates venv automatically)",
|
|
35
60
|
},
|
|
36
61
|
{
|
|
37
62
|
name: "hooks-dir",
|
|
38
63
|
description: "Hook scripts installed",
|
|
39
64
|
severity: "fail",
|
|
40
|
-
check: () => existsSync(join(INSTALL_DIR, "config", "hooks",
|
|
41
|
-
fix: "Run: npx arkaos install --force",
|
|
65
|
+
check: () => existsSync(join(INSTALL_DIR, "config", "hooks", `user-prompt-submit${HOOK_EXT}`)),
|
|
66
|
+
fix: () => "Run: npx arkaos install --force",
|
|
42
67
|
},
|
|
43
68
|
{
|
|
44
69
|
name: "constitution",
|
|
45
70
|
description: "Constitution YAML present",
|
|
46
71
|
severity: "warn",
|
|
47
72
|
check: () => existsSync(join(INSTALL_DIR, "config", "constitution.yaml")),
|
|
48
|
-
fix: "Run: npx arkaos install --force",
|
|
73
|
+
fix: () => "Run: npx arkaos install --force",
|
|
49
74
|
},
|
|
50
75
|
{
|
|
51
76
|
name: "repo-path",
|
|
@@ -57,29 +82,93 @@ const checks = [
|
|
|
57
82
|
const root = readFileSync(p, "utf-8").trim();
|
|
58
83
|
return existsSync(root);
|
|
59
84
|
},
|
|
60
|
-
fix: "Run: npx arkaos install --force",
|
|
85
|
+
fix: () => "Run: npx arkaos install --force",
|
|
61
86
|
},
|
|
62
87
|
{
|
|
63
88
|
name: "profile",
|
|
64
89
|
description: "User profile exists",
|
|
65
90
|
severity: "warn",
|
|
66
91
|
check: () => existsSync(join(INSTALL_DIR, "profile.json")),
|
|
67
|
-
fix: "Run: npx arkaos install",
|
|
92
|
+
fix: () => "Run: npx arkaos install",
|
|
68
93
|
},
|
|
69
94
|
{
|
|
70
95
|
name: "python-core",
|
|
71
96
|
description: "Python core engine importable",
|
|
72
97
|
severity: "warn",
|
|
73
|
-
check: () =>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
check: () => canImportCore(),
|
|
99
|
+
fix: () => {
|
|
100
|
+
const py = getArkaosPython();
|
|
101
|
+
const root = getRepoRoot();
|
|
102
|
+
if (py && root) {
|
|
103
|
+
return `Run: "${py}" -m pip install -e "${root}"`;
|
|
104
|
+
}
|
|
105
|
+
return "Run: npx arkaos@latest update (reinstalls Python core)";
|
|
78
106
|
},
|
|
79
|
-
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "scheduler",
|
|
110
|
+
description: "Cognitive scheduler config deployed",
|
|
111
|
+
severity: "warn",
|
|
112
|
+
check: () => existsSync(join(INSTALL_DIR, "schedules.yaml")),
|
|
113
|
+
fix: () => "Run: npx arkaos@latest update (deploys scheduler)",
|
|
80
114
|
},
|
|
81
115
|
];
|
|
82
116
|
|
|
117
|
+
// ─── Windows-only checks ───────────────────────────────────────────────
|
|
118
|
+
// Appended conditionally so non-Windows runs are byte-for-byte unchanged.
|
|
119
|
+
if (IS_WINDOWS) {
|
|
120
|
+
checks.push(
|
|
121
|
+
{
|
|
122
|
+
name: "powershell",
|
|
123
|
+
description: "PowerShell 5.1+ available",
|
|
124
|
+
severity: "fail",
|
|
125
|
+
check: () => {
|
|
126
|
+
try {
|
|
127
|
+
const out = execSync(
|
|
128
|
+
'powershell -NoProfile -Command "$PSVersionTable.PSVersion.Major"',
|
|
129
|
+
{ stdio: ["pipe", "pipe", "ignore"] }
|
|
130
|
+
).toString().trim();
|
|
131
|
+
const major = parseInt(out, 10);
|
|
132
|
+
return Number.isFinite(major) && major >= 5;
|
|
133
|
+
} catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
fix: () => "Install Windows PowerShell 5.1+ (ships with every Windows 10/11).",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: "arka-claude-wrapper",
|
|
141
|
+
description: "arka-claude wrapper installed (.cmd + .ps1)",
|
|
142
|
+
severity: "warn",
|
|
143
|
+
check: () =>
|
|
144
|
+
existsSync(join(INSTALL_DIR, "bin", "arka-claude.cmd")) &&
|
|
145
|
+
existsSync(join(INSTALL_DIR, "bin", "arka-claude.ps1")),
|
|
146
|
+
fix: () => "Run: npx arkaos install --force",
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "schtasks",
|
|
150
|
+
description: "schtasks available (cognitive scheduler backend)",
|
|
151
|
+
severity: "warn",
|
|
152
|
+
check: () => commandExists("schtasks"),
|
|
153
|
+
fix: () => "schtasks ships with Windows by default; verify %WINDIR%\\System32 is on PATH.",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "venv-scripts",
|
|
157
|
+
description: "Venv Python at %USERPROFILE%\\.arkaos\\venv\\Scripts\\python.exe",
|
|
158
|
+
severity: "warn",
|
|
159
|
+
check: () => {
|
|
160
|
+
const venvPy = getVenvPython();
|
|
161
|
+
// Only meaningful if venv exists at all. The "venv" check above
|
|
162
|
+
// covers absence; this one guards against a macOS-shaped venv
|
|
163
|
+
// being mistaken for a Windows venv (bin/ instead of Scripts/).
|
|
164
|
+
if (!existsSync(join(INSTALL_DIR, "venv"))) return true;
|
|
165
|
+
return existsSync(venvPy) && venvPy.toLowerCase().endsWith("\\scripts\\python.exe");
|
|
166
|
+
},
|
|
167
|
+
fix: () => "Remove %USERPROFILE%\\.arkaos\\venv and run: npx arkaos@latest update",
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
83
172
|
export async function doctor() {
|
|
84
173
|
console.log("\n ArkaOS Doctor — Health Checks\n");
|
|
85
174
|
|
|
@@ -88,11 +177,34 @@ export async function doctor() {
|
|
|
88
177
|
let failed = 0;
|
|
89
178
|
|
|
90
179
|
for (const check of checks) {
|
|
91
|
-
|
|
92
|
-
|
|
180
|
+
// A single check that throws must not crash the rest of the doctor.
|
|
181
|
+
// Treat the exception as "check failed" and record a short hint so
|
|
182
|
+
// the user can see what blew up. Also keep any stack-trace noise
|
|
183
|
+
// out of the console output.
|
|
184
|
+
let ok = false;
|
|
185
|
+
let checkError = null;
|
|
186
|
+
try {
|
|
187
|
+
ok = !!check.check();
|
|
188
|
+
} catch (err) {
|
|
189
|
+
checkError = err && err.message ? String(err.message).split("\n")[0].slice(0, 120) : String(err);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const icon = ok
|
|
193
|
+
? "\x1b[32m\u2713\x1b[0m"
|
|
194
|
+
: (check.severity === "fail" ? "\x1b[31m\u2717\x1b[0m" : "\x1b[33m!\x1b[0m");
|
|
93
195
|
console.log(` ${icon} ${check.description}`);
|
|
196
|
+
|
|
94
197
|
if (!ok) {
|
|
95
|
-
|
|
198
|
+
if (checkError) {
|
|
199
|
+
console.log(` Error: ${checkError}`);
|
|
200
|
+
}
|
|
201
|
+
let fixHint;
|
|
202
|
+
try {
|
|
203
|
+
fixHint = check.fix();
|
|
204
|
+
} catch (err) {
|
|
205
|
+
fixHint = "(fix hint unavailable)";
|
|
206
|
+
}
|
|
207
|
+
console.log(` Fix: ${fixHint}`);
|
|
96
208
|
if (check.severity === "fail") failed++;
|
|
97
209
|
else warned++;
|
|
98
210
|
} else {
|