dsh-cortex-memory 0.3.0 → 0.4.11
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 +41 -12
- package/client.js +33 -19
- package/cordis.patch.yml +1 -1
- package/index.js +8 -1
- package/package.json +3 -13
- package/src/adapters/shiori.js +1 -1
- package/src/api/routes.js +30 -3
- package/src/core/config.js +6 -0
- package/src/engines/develop.js +1 -1
- package/src/engines/extract.js +23 -4
- package/src/engines/growth.js +1 -1
- package/src/engines/life.js +57 -42
- package/src/engines/reflect.js +1 -1
- package/src/engines/retrieve.js +4 -0
- package/src/guardian/guardian.js +15 -1
- package/src/host/runtime.js +14 -4
- package/src/host/scheduler.js +11 -2
- package/src/llm/adapter.js +19 -7
- package/src/memory/query.js +1 -1
- package/src/self/appraisal.js +3 -3
- package/src/self/emotion.js +1 -1
- package/src/self/evolution.js +115 -4
- package/src/self/identity.js +1 -1
- package/src/self/policies.js +8 -1
- package/src/self/relationship.js +2 -2
- package/src/service/cortex.js +94 -13
- package/src/tools/definitions.js +19 -1
- package/src/web/search.js +97 -0
- package/bench/ab-engine.mjs +0 -60
- package/bench/ann-bench.mjs +0 -78
- package/bench/hnsw-bench.mjs +0 -79
- package/bench/locomo.js +0 -89
- package/bench/longmemeval.js +0 -83
- package/bench/metrics.js +0 -67
- package/bench/migration-bench.mjs +0 -69
- package/bench/run.js +0 -77
- package/bench/synthetic.js +0 -99
- package/bench/vector-ab.mjs +0 -76
- package/docs/install-windows.md +0 -144
- package/docs/models.md +0 -183
- package/docs/multimodal.md +0 -112
- package/docs/permissions.md +0 -49
- package/docs/privacy.md +0 -48
- package/docs/scopes.md +0 -142
- package/examples/README.md +0 -72
- package/examples/setup-cortex-bge.ps1 +0 -66
- package/examples/uninstall-cortex.ps1 +0 -91
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
[CmdletBinding()]
|
|
2
|
-
param(
|
|
3
|
-
[string]$Dsh = 'dsh',
|
|
4
|
-
[string]$Profile = 'desktop',
|
|
5
|
-
[string]$Package = 'dsh-cortex',
|
|
6
|
-
[switch]$KeepPatch
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
$ErrorActionPreference = 'Stop'
|
|
10
|
-
$dshCommand = Get-Command $Dsh -ErrorAction SilentlyContinue
|
|
11
|
-
if (-not $dshCommand) { throw "dsh command not found: $Dsh. Pass -Dsh with the path to dsh.cmd." }
|
|
12
|
-
$dshPath = $dshCommand.Source
|
|
13
|
-
$profilePath = Join-Path (Join-Path $HOME '.dsh\profiles') $Profile
|
|
14
|
-
if (-not (Test-Path $profilePath)) { throw "profile not found: $profilePath" }
|
|
15
|
-
|
|
16
|
-
$packageJson = Join-Path $profilePath 'package.json'
|
|
17
|
-
$installed = $false
|
|
18
|
-
if (Test-Path $packageJson) {
|
|
19
|
-
try {
|
|
20
|
-
$manifest = Get-Content -LiteralPath $packageJson -Raw | ConvertFrom-Json
|
|
21
|
-
$installed = $null -ne $manifest.dependencies.$Package
|
|
22
|
-
} catch { $installed = $false }
|
|
23
|
-
}
|
|
24
|
-
if ($installed) {
|
|
25
|
-
& $dshPath plugin --profile $Profile remove $Package
|
|
26
|
-
if ($LASTEXITCODE -ne 0) { throw "plugin remove failed with exit code $LASTEXITCODE" }
|
|
27
|
-
} else {
|
|
28
|
-
Write-Host "$Package is not installed in $Profile; skipping remove"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
$patchFile = Join-Path $profilePath 'cordis.patch.yml'
|
|
32
|
-
$configuredDataRoot = $null
|
|
33
|
-
if (Test-Path $patchFile) {
|
|
34
|
-
foreach ($line in [System.IO.File]::ReadAllLines($patchFile)) {
|
|
35
|
-
if ($line -match '^\s*dataRoot:\s*(.+)$') {
|
|
36
|
-
$configuredDataRoot = $matches[1].Trim().Trim("'").Trim('"')
|
|
37
|
-
break
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (-not $configuredDataRoot) {
|
|
42
|
-
$dshHome = Join-Path $HOME '.dsh'
|
|
43
|
-
$configuredDataRoot = if ($Profile -eq 'desktop') { Join-Path $dshHome 'cortex' } else { Join-Path (Join-Path $dshHome 'cortex\profiles') $Profile }
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (-not $KeepPatch) {
|
|
47
|
-
if (Test-Path $patchFile) {
|
|
48
|
-
$lines = [System.IO.File]::ReadAllLines($patchFile)
|
|
49
|
-
$ranges = New-Object System.Collections.Generic.List[object]
|
|
50
|
-
$start = -1
|
|
51
|
-
for ($i = 0; $i -lt $lines.Count; $i += 1) {
|
|
52
|
-
if ($lines[$i] -match '^- ') {
|
|
53
|
-
if ($start -ge 0) { $ranges.Add([pscustomobject]@{ From = $start; To = ($i - 1) }) }
|
|
54
|
-
$start = $i
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if ($start -ge 0) { $ranges.Add([pscustomobject]@{ From = $start; To = ($lines.Count - 1) }) }
|
|
58
|
-
|
|
59
|
-
$drop = @{}
|
|
60
|
-
foreach ($range in $ranges) {
|
|
61
|
-
$from = [int]$range.From
|
|
62
|
-
$to = [int]$range.To
|
|
63
|
-
$header = $lines[$from]
|
|
64
|
-
$body = ($lines[$from..$to] -join "`n")
|
|
65
|
-
if ($header -match '^- id:\s*cortex\s*$' -and $body -match 'name:\s*[''"]?dsh-cortex') {
|
|
66
|
-
for ($i = $from; $i -le $to; $i += 1) { $drop[$i] = $true }
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if ($drop.Count -gt 0) {
|
|
71
|
-
$remaining = @()
|
|
72
|
-
for ($i = 0; $i -lt $lines.Count; $i += 1) {
|
|
73
|
-
if (-not $drop.ContainsKey($i)) { $remaining += $lines[$i] }
|
|
74
|
-
}
|
|
75
|
-
$meaningful = @($remaining | Where-Object { $_.Trim() -and -not $_.Trim().StartsWith('#') })
|
|
76
|
-
$text = if ($meaningful.Count -eq 0) { "[]`n" } else { ($remaining -join "`n") + "`n" }
|
|
77
|
-
$utf8 = New-Object System.Text.UTF8Encoding($false)
|
|
78
|
-
[System.IO.File]::WriteAllText($patchFile, $text, $utf8)
|
|
79
|
-
Write-Host "removed cortex patch block from $patchFile"
|
|
80
|
-
} else {
|
|
81
|
-
Write-Host "no cortex patch block found in $patchFile"
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
& $dshPath --profile $Profile --dump-config | Out-Null
|
|
86
|
-
if ($LASTEXITCODE -ne 0) { Write-Warning "dump-config still fails; inspect $profilePath\cordis.patch.yml" }
|
|
87
|
-
else { Write-Host "dump-config ok" }
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
Write-Host "profile left in place: $profilePath"
|
|
91
|
-
Write-Host "cortex data was NOT deleted: $configuredDataRoot"
|