arkaos 4.3.5 → 4.4.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/VERSION +1 -1
- package/arka/SKILL.md +1 -1
- package/bin/arka-claude +35 -4
- package/bin/arka-py +22 -7
- package/config/hooks/_lib/arka_python.ps1 +31 -0
- package/config/hooks/_lib/arka_python.sh +38 -0
- package/config/hooks/post-tool-use.ps1 +8 -0
- package/config/hooks/post-tool-use.sh +11 -5
- package/config/hooks/pre-tool-use.ps1 +11 -6
- package/config/hooks/pre-tool-use.sh +11 -6
- package/config/hooks/session-start.ps1 +10 -0
- package/config/hooks/session-start.sh +5 -0
- package/config/hooks/stop.ps1 +9 -1
- package/config/hooks/stop.sh +11 -5
- package/config/hooks/user-prompt-submit.ps1 +18 -0
- package/config/hooks/user-prompt-submit.sh +11 -5
- package/core/cognition/scheduler/__pycache__/daemon.cpython-313.pyc +0 -0
- package/core/cognition/scheduler/daemon.py +7 -3
- package/core/forge/__pycache__/orchestrator.cpython-313.pyc +0 -0
- package/core/forge/orchestrator.py +2 -1
- package/core/hooks/__pycache__/_shared.cpython-313.pyc +0 -0
- package/core/hooks/__pycache__/_shared.cpython-314.pyc +0 -0
- package/core/hooks/__pycache__/stop.cpython-313.pyc +0 -0
- package/core/hooks/__pycache__/stop.cpython-314.pyc +0 -0
- package/core/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
- package/core/hooks/_shared.py +29 -9
- package/core/hooks/stop.py +4 -3
- package/core/hooks/user_prompt_submit.py +5 -4
- package/core/knowledge/__pycache__/indexer.cpython-313.pyc +0 -0
- package/core/knowledge/__pycache__/vector_store.cpython-313.pyc +0 -0
- package/core/knowledge/indexer.py +1 -1
- package/core/knowledge/vector_store.py +10 -3
- package/core/runtime/__pycache__/model_router.cpython-312.pyc +0 -0
- package/core/runtime/__pycache__/model_router.cpython-314.pyc +0 -0
- package/core/runtime/__pycache__/model_routing_check.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/model_routing_context.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/native_usage.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/native_usage.cpython-314.pyc +0 -0
- package/core/runtime/gateway/__init__.py +28 -0
- package/core/runtime/gateway/__main__.py +30 -0
- package/core/runtime/gateway/__pycache__/__init__.cpython-312.pyc +0 -0
- package/core/runtime/gateway/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/runtime/gateway/__pycache__/__init__.cpython-314.pyc +0 -0
- package/core/runtime/gateway/__pycache__/__main__.cpython-313.pyc +0 -0
- package/core/runtime/gateway/__pycache__/litellm_config.cpython-312.pyc +0 -0
- package/core/runtime/gateway/__pycache__/litellm_config.cpython-313.pyc +0 -0
- package/core/runtime/gateway/__pycache__/litellm_config.cpython-314.pyc +0 -0
- package/core/runtime/gateway/litellm_config.py +205 -0
- package/core/runtime/model_routing_check.py +71 -0
- package/core/runtime/model_routing_context.py +22 -1
- package/core/runtime/native_usage.py +2 -1
- package/core/shared/__pycache__/temp_paths.cpython-313.pyc +0 -0
- package/core/shared/__pycache__/temp_paths.cpython-314.pyc +0 -0
- package/core/shared/temp_paths.py +40 -0
- package/core/synapse/__pycache__/kb_cache.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/kb_cache.cpython-314.pyc +0 -0
- package/core/synapse/kb_cache.py +3 -2
- package/core/sync/__pycache__/agent_provisioner.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/ai_mcp_decider.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/content_syncer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/descriptor_syncer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/discovery.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/manifest.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/mcp_optimizer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/mcp_syncer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/policy_loader.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/reporter.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/settings_syncer.cpython-313.pyc +0 -0
- package/core/sync/agent_provisioner.py +5 -5
- package/core/sync/ai_mcp_decider.py +2 -2
- package/core/sync/content_syncer.py +14 -14
- package/core/sync/descriptor_syncer.py +2 -2
- package/core/sync/discovery.py +4 -4
- package/core/sync/engine.py +4 -4
- package/core/sync/manifest.py +1 -1
- package/core/sync/mcp_optimizer.py +5 -5
- package/core/sync/mcp_syncer.py +3 -3
- package/core/sync/policy_loader.py +1 -1
- package/core/sync/reporter.py +1 -1
- package/core/sync/settings_syncer.py +2 -2
- package/core/terminal/__pycache__/session.cpython-313.pyc +0 -0
- package/core/terminal/__pycache__/session_windows.cpython-313.pyc +0 -0
- package/core/terminal/session.py +66 -11
- package/core/terminal/session_windows.py +211 -0
- package/core/workflow/__pycache__/flow_authorization.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/flow_authorization.cpython-314.pyc +0 -0
- package/core/workflow/__pycache__/flow_enforcer.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/flow_enforcer.cpython-314.pyc +0 -0
- package/core/workflow/__pycache__/marker_cache.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/marker_cache.cpython-314.pyc +0 -0
- package/core/workflow/__pycache__/research_gate.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/research_gate.cpython-314.pyc +0 -0
- package/core/workflow/flow_authorization.py +2 -1
- package/core/workflow/flow_enforcer.py +2 -1
- package/core/workflow/marker_cache.py +2 -1
- package/core/workflow/research_gate.py +2 -1
- package/dashboard/app/pages/index.vue +6 -1
- package/installer/cli.js +5 -4
- package/installer/core-snapshot.js +53 -0
- package/installer/doctor.js +8 -3
- package/installer/index.js +29 -6
- package/installer/migrate.js +7 -4
- package/installer/update.js +13 -0
- package/package.json +1 -1
- package/pyproject.toml +8 -1
- package/scripts/__pycache__/dashboard-api.cpython-313.pyc +0 -0
- package/scripts/__pycache__/synapse-bridge.cpython-313.pyc +0 -0
- package/scripts/dashboard-api.py +69 -33
- package/scripts/gateway-ensure.sh +93 -0
- package/scripts/knowledge-index.py +35 -2
- package/scripts/start-dashboard.ps1 +34 -14
- package/scripts/synapse-bridge.py +3 -1
|
@@ -30,6 +30,7 @@ $arkaosHome = Join-Path $env:USERPROFILE '.arkaos'
|
|
|
30
30
|
$pidFile = Join-Path $arkaosHome 'dashboard.pid'
|
|
31
31
|
$portFile = Join-Path $arkaosHome 'dashboard.ports'
|
|
32
32
|
$apiLog = Join-Path $arkaosHome 'api.log'
|
|
33
|
+
$apiErrLog = Join-Path $arkaosHome 'api.err.log'
|
|
33
34
|
|
|
34
35
|
$null = New-Item -ItemType Directory -Force -Path $arkaosHome -ErrorAction SilentlyContinue
|
|
35
36
|
|
|
@@ -132,7 +133,7 @@ try {
|
|
|
132
133
|
-ArgumentList @($dashboardApi, '--port', "$apiPort") `
|
|
133
134
|
-WorkingDirectory $arkaosRoot `
|
|
134
135
|
-RedirectStandardOutput $apiLog `
|
|
135
|
-
-RedirectStandardError $
|
|
136
|
+
-RedirectStandardError $apiErrLog `
|
|
136
137
|
-NoNewWindow `
|
|
137
138
|
-PassThru
|
|
138
139
|
} finally {
|
|
@@ -160,10 +161,10 @@ for ($i = 0; $i -lt 20; $i++) {
|
|
|
160
161
|
if ($apiReady) {
|
|
161
162
|
Write-Host " API: http://localhost:$apiPort" -ForegroundColor Green
|
|
162
163
|
} else {
|
|
163
|
-
Write-Host " ! API may still be starting (check log: $
|
|
164
|
-
if (Test-Path -LiteralPath $
|
|
164
|
+
Write-Host " ! API may still be starting (check log: $apiErrLog)" -ForegroundColor Yellow
|
|
165
|
+
if (Test-Path -LiteralPath $apiErrLog) {
|
|
165
166
|
try {
|
|
166
|
-
$lastError = (Get-Content -LiteralPath $
|
|
167
|
+
$lastError = (Get-Content -LiteralPath $apiErrLog -Tail 3 -ErrorAction SilentlyContinue | Select-Object -First 1)
|
|
167
168
|
if ($lastError) {
|
|
168
169
|
Write-Host " Last error: $lastError" -ForegroundColor DarkGray
|
|
169
170
|
}
|
|
@@ -180,11 +181,23 @@ $nuxtServer = Join-Path $nuxtOutput 'server\index.mjs'
|
|
|
180
181
|
|
|
181
182
|
function Start-NuxtDev {
|
|
182
183
|
param([int]$Port, [int]$ApiPort, [string]$WorkingDir)
|
|
183
|
-
#
|
|
184
|
-
#
|
|
184
|
+
# Launch node directly against the Nuxt CLI entry. The 'npx' shim is a
|
|
185
|
+
# .cmd on Windows, which Start-Process -NoNewWindow cannot exec ("%1 is
|
|
186
|
+
# not a valid Win32 application"), and wrapping it in cmd.exe yields a
|
|
187
|
+
# process tree that dies with the launcher. A direct node.exe child
|
|
188
|
+
# detaches cleanly and survives, like the API process.
|
|
185
189
|
$savedApi = $env:NUXT_PUBLIC_API_BASE
|
|
186
190
|
$env:NUXT_PUBLIC_API_BASE = "http://localhost:$ApiPort"
|
|
187
191
|
try {
|
|
192
|
+
$nuxtBin = Join-Path $WorkingDir 'node_modules\nuxt\bin\nuxt.mjs'
|
|
193
|
+
if (Test-Path -LiteralPath $nuxtBin) {
|
|
194
|
+
return Start-Process -FilePath 'node' `
|
|
195
|
+
-ArgumentList @($nuxtBin,'dev','--port',"$Port") `
|
|
196
|
+
-WorkingDirectory $WorkingDir `
|
|
197
|
+
-NoNewWindow `
|
|
198
|
+
-PassThru
|
|
199
|
+
}
|
|
200
|
+
# Fallback (non-Windows or missing local bin): the npx shim is fine.
|
|
188
201
|
return Start-Process -FilePath 'npx' `
|
|
189
202
|
-ArgumentList @('nuxt','dev','--port',"$Port") `
|
|
190
203
|
-WorkingDirectory $WorkingDir `
|
|
@@ -215,18 +228,25 @@ if (Test-Path -LiteralPath $nuxtServer) {
|
|
|
215
228
|
Write-Host " Starting UI (dev) on :$uiPort..."
|
|
216
229
|
$uiProc = Start-NuxtDev -Port $uiPort -ApiPort $apiPort -WorkingDir $dashboardDir
|
|
217
230
|
} else {
|
|
218
|
-
# Auto-install and start
|
|
219
|
-
|
|
220
|
-
|
|
231
|
+
# Auto-install and start. The dashboard pins pnpm (package.json
|
|
232
|
+
# packageManager) — npm's flat node_modules layout breaks Nuxt 4's
|
|
233
|
+
# server-entry resolution ("No entry found in rollupOptions.input"), so
|
|
234
|
+
# install with the pinned pnpm via corepack (always shipped with Node).
|
|
235
|
+
# corepack/pnpm are .cmd shims that Start-Process -NoNewWindow cannot
|
|
236
|
+
# exec directly on Windows, so route through cmd.exe.
|
|
237
|
+
Write-Host ' Installing dashboard dependencies (pnpm via corepack)...'
|
|
238
|
+
$savedPrompt = $env:COREPACK_ENABLE_DOWNLOAD_PROMPT
|
|
239
|
+
$env:COREPACK_ENABLE_DOWNLOAD_PROMPT = '0'
|
|
221
240
|
try {
|
|
222
|
-
Start-Process -FilePath $
|
|
223
|
-
-ArgumentList @('
|
|
241
|
+
Start-Process -FilePath $env:ComSpec `
|
|
242
|
+
-ArgumentList @('/c','corepack','pnpm','install') `
|
|
224
243
|
-WorkingDirectory $dashboardDir `
|
|
225
244
|
-NoNewWindow `
|
|
226
|
-
-Wait
|
|
227
|
-
-PassThru | Out-Null
|
|
245
|
+
-Wait | Out-Null
|
|
228
246
|
} catch {
|
|
229
|
-
Write-Host " ! Dashboard install failed
|
|
247
|
+
Write-Host " ! Dashboard install failed. API-only mode." -ForegroundColor Yellow
|
|
248
|
+
} finally {
|
|
249
|
+
$env:COREPACK_ENABLE_DOWNLOAD_PROMPT = $savedPrompt
|
|
230
250
|
}
|
|
231
251
|
if (Test-Path -LiteralPath $nuxtNodeModules) {
|
|
232
252
|
Write-Host " Starting UI (dev) on :$uiPort..."
|
|
@@ -24,12 +24,14 @@ from typing import Any
|
|
|
24
24
|
ARKAOS_ROOT = Path(os.environ.get("ARKAOS_ROOT", Path(__file__).resolve().parent.parent))
|
|
25
25
|
sys.path.insert(0, str(ARKAOS_ROOT))
|
|
26
26
|
|
|
27
|
+
from core.shared.temp_paths import arkaos_temp_dir # noqa: E402
|
|
28
|
+
|
|
27
29
|
# Layer tags carrying the actually-injected KB counts (ground truth for
|
|
28
30
|
# reconciling the model's self-reported `[arka:meta] kb=N`). The optional
|
|
29
31
|
# ` degraded=keyword` suffix (RAG honesty, PR-3 v4.1) must still count.
|
|
30
32
|
_KB_CONTEXT_TAG_RE = re.compile(r"\[kb-context:(\d+)[^\]]*\]")
|
|
31
33
|
_KNOWLEDGE_TAG_RE = re.compile(r"\[knowledge:(\d+) chunks?[^\]]*\]")
|
|
32
|
-
_KB_INJECTED_DIR =
|
|
34
|
+
_KB_INJECTED_DIR = arkaos_temp_dir("arkaos-kb-injected")
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
def _count_injected_kb(result: Any) -> tuple[int, int]:
|