@kanadego/dsh-heartbeat 2.2.1 → 2.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/README.md +105 -311
- package/USAGE-GUIDE.md +357 -0
- package/client.js +186 -24
- package/dist/{bili-login-XQVEE4M6.js → bili-login-KDDU63Z2.js} +4 -4
- package/dist/{bindings-U2M3CO2D.js → bindings-LTSGGNIH.js} +3 -3
- package/dist/{chunk-LQKOYTRL.js → chunk-4OQXAHU5.js} +2 -2
- package/dist/{chunk-3QJJRXIR.js → chunk-5CVAW5AS.js} +11 -2
- package/dist/chunk-5CVAW5AS.js.map +1 -0
- package/dist/{chunk-IBBAISSW.js → chunk-66IUDHCY.js} +50 -1
- package/dist/chunk-66IUDHCY.js.map +1 -0
- package/dist/{chunk-3DNGY4DS.js → chunk-77UYDI2A.js} +2 -2
- package/dist/{chunk-AT32XCCI.js → chunk-AJ5JAQVB.js} +20 -3
- package/dist/chunk-AJ5JAQVB.js.map +1 -0
- package/dist/chunk-CRRN6UD3.js +389 -0
- package/dist/chunk-CRRN6UD3.js.map +1 -0
- package/dist/{chunk-ECXYNTEV.js → chunk-ERRPMYKB.js} +164 -152
- package/dist/chunk-ERRPMYKB.js.map +1 -0
- package/dist/{chunk-M72T5MZU.js → chunk-GOLMRQRW.js} +3 -2
- package/dist/{chunk-KZLVR4J7.js → chunk-IPTNSXOY.js} +2 -2
- package/dist/chunk-L54R23O2.js +262 -0
- package/dist/chunk-L54R23O2.js.map +1 -0
- package/dist/chunk-MHRAPKES.js +1081 -0
- package/dist/chunk-MHRAPKES.js.map +1 -0
- package/dist/{chunk-SIY3YHFY.js → chunk-MMI6OBEC.js} +2 -2
- package/dist/{chunk-CJK6RTMH.js → chunk-RPWQZYNW.js} +1485 -310
- package/dist/chunk-RPWQZYNW.js.map +1 -0
- package/dist/cli/index.js +244 -36
- package/dist/cli/index.js.map +1 -1
- package/dist/{focus-store-RNHBAFYS.js → focus-store-XGTPIVF6.js} +3 -3
- package/dist/{inbox-ZLX2MH7A.js → inbox-7GGEMBUD.js} +4 -4
- package/dist/index.d.ts +66 -1
- package/dist/index.js +556 -167
- package/dist/index.js.map +1 -1
- package/dist/{migrate-XFZU5EBE.js → migrate-25F53XIC.js} +6 -4
- package/dist/{orchestrator-5BHYQ77Y.js → orchestrator-4PJD7QYO.js} +25 -11
- package/dist/runtime-RGZKOFP3.js +15 -0
- package/dist/snapshot-J6LKNY57.js +27 -0
- package/dist/store-HM6ZMFKS.js +45 -0
- package/package.json +6 -3
- package/dist/chunk-3QJJRXIR.js.map +0 -1
- package/dist/chunk-AT32XCCI.js.map +0 -1
- package/dist/chunk-CJK6RTMH.js.map +0 -1
- package/dist/chunk-DLOYERAK.js +0 -87
- package/dist/chunk-DLOYERAK.js.map +0 -1
- package/dist/chunk-ECXYNTEV.js.map +0 -1
- package/dist/chunk-F2XVKX55.js +0 -413
- package/dist/chunk-F2XVKX55.js.map +0 -1
- package/dist/chunk-IBBAISSW.js.map +0 -1
- package/dist/chunk-N6SMIGYJ.js +0 -393
- package/dist/chunk-N6SMIGYJ.js.map +0 -1
- package/dist/chunk-XYBII5PR.js +0 -602
- package/dist/chunk-XYBII5PR.js.map +0 -1
- package/dist/pool-76VLAZER.js +0 -49
- package/dist/runtime-W2OWJIHY.js +0 -11
- package/dist/snapshot-SU2VGM4C.js +0 -16
- /package/dist/{bili-login-XQVEE4M6.js.map → bili-login-KDDU63Z2.js.map} +0 -0
- /package/dist/{bindings-U2M3CO2D.js.map → bindings-LTSGGNIH.js.map} +0 -0
- /package/dist/{chunk-LQKOYTRL.js.map → chunk-4OQXAHU5.js.map} +0 -0
- /package/dist/{chunk-3DNGY4DS.js.map → chunk-77UYDI2A.js.map} +0 -0
- /package/dist/{chunk-M72T5MZU.js.map → chunk-GOLMRQRW.js.map} +0 -0
- /package/dist/{chunk-KZLVR4J7.js.map → chunk-IPTNSXOY.js.map} +0 -0
- /package/dist/{chunk-SIY3YHFY.js.map → chunk-MMI6OBEC.js.map} +0 -0
- /package/dist/{focus-store-RNHBAFYS.js.map → focus-store-XGTPIVF6.js.map} +0 -0
- /package/dist/{inbox-ZLX2MH7A.js.map → inbox-7GGEMBUD.js.map} +0 -0
- /package/dist/{migrate-XFZU5EBE.js.map → migrate-25F53XIC.js.map} +0 -0
- /package/dist/{orchestrator-5BHYQ77Y.js.map → orchestrator-4PJD7QYO.js.map} +0 -0
- /package/dist/{pool-76VLAZER.js.map → runtime-RGZKOFP3.js.map} +0 -0
- /package/dist/{runtime-W2OWJIHY.js.map → snapshot-J6LKNY57.js.map} +0 -0
- /package/dist/{snapshot-SU2VGM4C.js.map → store-HM6ZMFKS.js.map} +0 -0
|
@@ -9,9 +9,11 @@ import {
|
|
|
9
9
|
decryptContainer,
|
|
10
10
|
encryptContainer,
|
|
11
11
|
isMigratablePath
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-AJ5JAQVB.js";
|
|
13
|
+
import "./chunk-CRRN6UD3.js";
|
|
14
|
+
import "./chunk-ERRPMYKB.js";
|
|
15
|
+
import "./chunk-GOLMRQRW.js";
|
|
16
|
+
import "./chunk-66IUDHCY.js";
|
|
15
17
|
export {
|
|
16
18
|
MIGRATE_FILES,
|
|
17
19
|
MIGRATE_MAGIC,
|
|
@@ -24,4 +26,4 @@ export {
|
|
|
24
26
|
encryptContainer,
|
|
25
27
|
isMigratablePath
|
|
26
28
|
};
|
|
27
|
-
//# sourceMappingURL=migrate-
|
|
29
|
+
//# sourceMappingURL=migrate-25F53XIC.js.map
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BeatAbortedError,
|
|
3
|
+
CONSOLIDATION_TURN_PREFIX,
|
|
3
4
|
DEFAULT_INTERVAL_JITTER_PCT,
|
|
5
|
+
DISPOSE_ABORT_TEXT,
|
|
4
6
|
ENGINE_ROOM_EXTRA_TOOLS,
|
|
5
7
|
HOME_ROTATE_EVENT_COUNT,
|
|
6
8
|
TOKEN_SAVER_IDLE_SECONDS,
|
|
7
9
|
TOKEN_SAVER_WAKE_MS,
|
|
10
|
+
TURN_END_FAILURE_REASONS,
|
|
8
11
|
agentLooksAlive,
|
|
9
12
|
agentTurn,
|
|
10
13
|
applyHeartbeatInterval,
|
|
14
|
+
attachPersonTools,
|
|
11
15
|
beat,
|
|
12
16
|
buildEngineRoomAllowList,
|
|
13
17
|
clampJitterPct,
|
|
14
18
|
classifySilentReason,
|
|
19
|
+
detachEngineRoomPersonTools,
|
|
15
20
|
focusPendingAt,
|
|
16
21
|
formatFocusClock,
|
|
17
22
|
formatFocusNote,
|
|
@@ -25,6 +30,7 @@ import {
|
|
|
25
30
|
looksPermanentResumeFailure,
|
|
26
31
|
makeHomeSetup,
|
|
27
32
|
markHomeRotateIfOverflow,
|
|
33
|
+
nativeVisionTurn,
|
|
28
34
|
parseJsonBlock,
|
|
29
35
|
pauseFocus,
|
|
30
36
|
pickSpokenLine,
|
|
@@ -37,6 +43,7 @@ import {
|
|
|
37
43
|
sessionEvents,
|
|
38
44
|
shouldArchiveRotatedHome,
|
|
39
45
|
shouldRotateHome,
|
|
46
|
+
silentAuditLine,
|
|
40
47
|
spokeTextSince,
|
|
41
48
|
startOrchestrator,
|
|
42
49
|
throwIfAborted,
|
|
@@ -44,30 +51,35 @@ import {
|
|
|
44
51
|
userActiveInBoundSessions,
|
|
45
52
|
waitForVisibleTool,
|
|
46
53
|
withTimeout
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
54
|
+
} from "./chunk-RPWQZYNW.js";
|
|
55
|
+
import "./chunk-MHRAPKES.js";
|
|
56
|
+
import "./chunk-5CVAW5AS.js";
|
|
57
|
+
import "./chunk-77UYDI2A.js";
|
|
58
|
+
import "./chunk-4OQXAHU5.js";
|
|
59
|
+
import "./chunk-IPTNSXOY.js";
|
|
60
|
+
import "./chunk-CRRN6UD3.js";
|
|
61
|
+
import "./chunk-ERRPMYKB.js";
|
|
62
|
+
import "./chunk-GOLMRQRW.js";
|
|
63
|
+
import "./chunk-66IUDHCY.js";
|
|
57
64
|
export {
|
|
58
65
|
BeatAbortedError,
|
|
66
|
+
CONSOLIDATION_TURN_PREFIX,
|
|
59
67
|
DEFAULT_INTERVAL_JITTER_PCT,
|
|
68
|
+
DISPOSE_ABORT_TEXT,
|
|
60
69
|
ENGINE_ROOM_EXTRA_TOOLS,
|
|
61
70
|
HOME_ROTATE_EVENT_COUNT,
|
|
62
71
|
TOKEN_SAVER_IDLE_SECONDS,
|
|
63
72
|
TOKEN_SAVER_WAKE_MS,
|
|
73
|
+
TURN_END_FAILURE_REASONS,
|
|
64
74
|
agentLooksAlive,
|
|
65
75
|
agentTurn,
|
|
66
76
|
applyHeartbeatInterval,
|
|
77
|
+
attachPersonTools,
|
|
67
78
|
beat,
|
|
68
79
|
buildEngineRoomAllowList,
|
|
69
80
|
clampJitterPct,
|
|
70
81
|
classifySilentReason,
|
|
82
|
+
detachEngineRoomPersonTools,
|
|
71
83
|
focusPendingAt,
|
|
72
84
|
formatFocusClock,
|
|
73
85
|
formatFocusNote,
|
|
@@ -81,6 +93,7 @@ export {
|
|
|
81
93
|
looksPermanentResumeFailure,
|
|
82
94
|
makeHomeSetup,
|
|
83
95
|
markHomeRotateIfOverflow,
|
|
96
|
+
nativeVisionTurn,
|
|
84
97
|
parseJsonBlock,
|
|
85
98
|
pauseFocus,
|
|
86
99
|
pickSpokenLine,
|
|
@@ -93,6 +106,7 @@ export {
|
|
|
93
106
|
sessionEvents,
|
|
94
107
|
shouldArchiveRotatedHome,
|
|
95
108
|
shouldRotateHome,
|
|
109
|
+
silentAuditLine,
|
|
96
110
|
spokeTextSince,
|
|
97
111
|
startOrchestrator,
|
|
98
112
|
throwIfAborted,
|
|
@@ -101,4 +115,4 @@ export {
|
|
|
101
115
|
waitForVisibleTool,
|
|
102
116
|
withTimeout
|
|
103
117
|
};
|
|
104
|
-
//# sourceMappingURL=orchestrator-
|
|
118
|
+
//# sourceMappingURL=orchestrator-4PJD7QYO.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCurrentDeliveryId,
|
|
3
|
+
getRuntime,
|
|
4
|
+
resetRuntimeForTest,
|
|
5
|
+
setCurrentDeliveryId,
|
|
6
|
+
setRuntime
|
|
7
|
+
} from "./chunk-5CVAW5AS.js";
|
|
8
|
+
export {
|
|
9
|
+
getCurrentDeliveryId,
|
|
10
|
+
getRuntime,
|
|
11
|
+
resetRuntimeForTest,
|
|
12
|
+
setCurrentDeliveryId,
|
|
13
|
+
setRuntime
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=runtime-RGZKOFP3.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SNAPSHOT_RETENTION_DAYS,
|
|
3
|
+
SNAPSHOT_THRESHOLD,
|
|
4
|
+
pruneSnapshots,
|
|
5
|
+
resolveRetentionDays,
|
|
6
|
+
snapshotDue,
|
|
7
|
+
snapshotIfDue,
|
|
8
|
+
snapshotProfile
|
|
9
|
+
} from "./chunk-CRRN6UD3.js";
|
|
10
|
+
import {
|
|
11
|
+
SNAPSHOT_ARCHIVE_NAME_RE,
|
|
12
|
+
SNAPSHOT_ARCHIVE_PREFIX
|
|
13
|
+
} from "./chunk-ERRPMYKB.js";
|
|
14
|
+
import "./chunk-GOLMRQRW.js";
|
|
15
|
+
import "./chunk-66IUDHCY.js";
|
|
16
|
+
export {
|
|
17
|
+
SNAPSHOT_ARCHIVE_NAME_RE,
|
|
18
|
+
SNAPSHOT_ARCHIVE_PREFIX,
|
|
19
|
+
SNAPSHOT_RETENTION_DAYS,
|
|
20
|
+
SNAPSHOT_THRESHOLD,
|
|
21
|
+
pruneSnapshots,
|
|
22
|
+
resolveRetentionDays,
|
|
23
|
+
snapshotDue,
|
|
24
|
+
snapshotIfDue,
|
|
25
|
+
snapshotProfile
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=snapshot-J6LKNY57.js.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARCHIVE_PREFIX,
|
|
3
|
+
SNAPSHOT_ARCHIVE_NAME_RE,
|
|
4
|
+
SNAPSHOT_ARCHIVE_PREFIX,
|
|
5
|
+
SNAPSHOT_FILE,
|
|
6
|
+
applyOpsToDoc,
|
|
7
|
+
journalFilePath,
|
|
8
|
+
listSnapshots,
|
|
9
|
+
loadProfile,
|
|
10
|
+
persistWithJournal,
|
|
11
|
+
profileFilePath,
|
|
12
|
+
readJournalTexts,
|
|
13
|
+
readSnapshotFile,
|
|
14
|
+
rebuildProfile,
|
|
15
|
+
replayJournal,
|
|
16
|
+
restoreAt,
|
|
17
|
+
runDeterministicAging,
|
|
18
|
+
snapshotFilePath,
|
|
19
|
+
verifyProfile,
|
|
20
|
+
wipeProfile
|
|
21
|
+
} from "./chunk-ERRPMYKB.js";
|
|
22
|
+
import "./chunk-GOLMRQRW.js";
|
|
23
|
+
import "./chunk-66IUDHCY.js";
|
|
24
|
+
export {
|
|
25
|
+
ARCHIVE_PREFIX,
|
|
26
|
+
SNAPSHOT_ARCHIVE_NAME_RE,
|
|
27
|
+
SNAPSHOT_ARCHIVE_PREFIX,
|
|
28
|
+
SNAPSHOT_FILE,
|
|
29
|
+
applyOpsToDoc,
|
|
30
|
+
journalFilePath,
|
|
31
|
+
listSnapshots,
|
|
32
|
+
loadProfile,
|
|
33
|
+
persistWithJournal,
|
|
34
|
+
profileFilePath,
|
|
35
|
+
readJournalTexts,
|
|
36
|
+
readSnapshotFile,
|
|
37
|
+
rebuildProfile,
|
|
38
|
+
replayJournal,
|
|
39
|
+
restoreAt,
|
|
40
|
+
runDeterministicAging,
|
|
41
|
+
snapshotFilePath,
|
|
42
|
+
verifyProfile,
|
|
43
|
+
wipeProfile
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=store-HM6ZMFKS.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanadego/dsh-heartbeat",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Heartbeat plugin for DeepSeek Harness: scheduled autonomous reflection loop with user profile, material pool, pace gate, and gated proactive expression.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"icon.svg",
|
|
49
49
|
"locale",
|
|
50
50
|
"README.md",
|
|
51
|
+
"USAGE-GUIDE.md",
|
|
51
52
|
"LICENSE"
|
|
52
53
|
],
|
|
53
54
|
"engines": {
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"qrcode": "^1.5.4"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
|
-
"@deepseek-ai/dsh-llm": "^0.
|
|
67
|
+
"@deepseek-ai/dsh-llm": "^0.2.2-rc.1 || ^0.2.3-0"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@deepseek-ai/dsh-llm": "^0.1.7-rc.1",
|
|
@@ -85,7 +86,9 @@
|
|
|
85
86
|
"patch": "./cordis.patch.yml"
|
|
86
87
|
},
|
|
87
88
|
"client": {
|
|
88
|
-
"inject": [
|
|
89
|
+
"inject": [
|
|
90
|
+
"@deepseek-ai/dsh-client-locale"
|
|
91
|
+
],
|
|
89
92
|
"platform": "web"
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/runtime.ts"],"sourcesContent":["// Runtime singleton shared by all modules after the plugin entry initializes.\n\nimport type { PathGuard } from './path-guard.js';\nimport type { WorkspacePaths } from './paths.js';\nimport type { Policy } from '../config/schema.js';\n\nexport interface HeartbeatRuntime {\n paths: WorkspacePaths;\n guard: PathGuard;\n policy: Policy;\n /** Live UI flags (M7): re-read by the RPC status endpoint for the card. */\n flags: {\n statusbarEnabled(): boolean;\n timeInjectMin(): number;\n idleMode(): boolean;\n /** Token-saver (v1.7.0): pause the whole beat while the user is away. */\n tokenSaver(): boolean;\n };\n}\n\nlet runtime: HeartbeatRuntime | null = null;\n\nexport function setRuntime(r: HeartbeatRuntime): void {\n runtime = r;\n}\n\nexport function getRuntime(): HeartbeatRuntime {\n if (!runtime) throw new Error('heartbeat runtime not initialized');\n return runtime;\n}\n\nexport function resetRuntimeForTest(): void {\n runtime = null;\n}\n"],"mappings":";AAoBA,IAAI,UAAmC;AAEhC,SAAS,WAAW,GAA2B;AACpD,YAAU;AACZ;AAEO,SAAS,aAA+B;AAC7C,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,mCAAmC;AACjE,SAAO;AACT;AAEO,SAAS,sBAA4B;AAC1C,YAAU;AACZ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/vault/migrate.ts"],"sourcesContent":["// Cross-machine migration (v1.8.0). DPAPI binds the sensitive stores to one\n// machine + account, so a new machine cannot read them — this module packs\n// the memory files into ONE passphrase-encrypted container (AES-256-GCM,\n// scrypt-derived key, node:crypto only) that can travel safely, and restores\n// them on the other side re-encrypted with the LOCAL DPAPI.\n//\n// Restore is byte-identical: for each file we record whether it was DPAPI\n// encrypted on disk (isEncrypted magic check) and write it back through the\n// same path — no per-module write semantics to keep in sync. Existing files\n// are backed up before overwrite (rule 4).\n\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport {\n createCipheriv,\n createDecipheriv,\n randomBytes,\n scryptSync,\n} from 'node:crypto';\nimport type { PathGuard } from '../core/path-guard.js';\nimport type { WorkspacePaths } from '../core/paths.js';\nimport { isEncrypted, loadEncryptedText, saveEncryptedText } from './vault.js';\n\nexport const MIGRATE_MAGIC = 'HBMIG1';\nexport const MIGRATE_VERSION = 1;\n/** scrypt cost for NEW containers (2^14 = Node's default, 16 MiB of work).\n * Reading is parameterised by the container's own kdf.N, so raising this\n * never orphans an existing export. */\nconst KDF_N = 163_84;\n/** Hard bounds for a container-supplied N: a hostile/broken container must not\n * be able to make the import allocate unbounded memory. */\nconst KDF_N_MIN = 1 << 12; // 2^12 = 4 MiB\nconst KDF_N_MAX = 1 << 16; // 2^16 = 64 MiB\n/** Node's scrypt maxmem defaults to 32 MiB, which N=2^15 already exceeds — a\n * legal container with a larger N would fail without an explicit cap. */\nconst SCRYPT_MAXMEM = 128 * 1024 * 1024;\nconst KEY_LEN = 32;\n\n/** Memory-relevant runtime files (dataDir-relative). Deliberately NOT here:\n * gate.json (machine-local counters + home session id — the new machine\n * builds its own) and screen snapshots (per-beat transients, not memory). */\nexport const MIGRATE_FILES = [\n 'profile.json',\n 'profile_snapshot.json',\n 'profile_inbox.jsonl',\n 'profile_journal.jsonl',\n 'profile_rhythm.json',\n 'sent.json',\n 'browse.json',\n 'seeds.jsonl',\n 'ledger.md',\n 'cursors.json',\n // v1.9.0: persona report log + topic preference stats\n 'seed_report.jsonl',\n 'preference.json',\n];\n\n/** HB-18: an import writes with the user's privileges inside data/, so the set\n * of names a container may touch is closed, not merely sanitised. Anything an\n * export can produce is here; everything else (gate.json, settings/, vault.key,\n * other modules' files) is refused. */\nconst MIGRATE_ARCHIVE_RE = /^profile_journal\\.archive-\\d+\\.jsonl$/;\nconst MIGRATE_WEEKLY_RE = /^weekly\\/[^/\\\\]+\\.json$/;\n\nexport function isMigratablePath(rel: string): boolean {\n if (MIGRATE_FILES.includes(rel)) return true;\n if (MIGRATE_ARCHIVE_RE.test(rel)) return true;\n if (MIGRATE_WEEKLY_RE.test(rel)) return true;\n return false;\n}\n\n/** HB-18: budget for a container-supplied payload. Generous next to a real\n * memory (a few MB), small next to what a hostile container would like. */\nexport const MIGRATE_MAX_FILES = 5_000;\nexport const MIGRATE_MAX_BYTES = 64 * 1024 * 1024;\n\nexport interface MigrateEntry {\n path: string; // dataDir-relative\n encrypted: boolean; // was DPAPI-encrypted on the source machine\n content: string;\n}\n\nexport interface MigrateProgress {\n packed: string[];\n missing: string[];\n}\n\nfunction collectWeeklyFiles(guard: PathGuard, paths: WorkspacePaths): string[] {\n const dir = path.join(paths.dataDir, 'weekly');\n try {\n return fs.readdirSync(guard.assert(dir))\n .filter((f) => f.endsWith('.json'))\n .map((f) => path.join('weekly', f).replace(/\\\\/g, '/'));\n } catch {\n return [];\n }\n}\n\n/** Journal archive shards (snapshot rotation output) travel with the memory. */\nfunction collectJournalArchives(guard: PathGuard, paths: WorkspacePaths): string[] {\n try {\n return fs.readdirSync(guard.assert(paths.dataDir))\n .filter((f) => f.startsWith('profile_journal.archive-') && f.endsWith('.jsonl'));\n } catch {\n return [];\n }\n}\n\n/** Read every migration file. A DPAPI file that fails to decrypt aborts the\n * export — a silent half-memory container would be worse than a loud error. */\nexport function collectMigrationEntries(guard: PathGuard, paths: WorkspacePaths): { entries: MigrateEntry[]; progress: MigrateProgress } {\n const entries: MigrateEntry[] = [];\n const packed: string[] = [];\n const missing: string[] = [];\n const rels = [...MIGRATE_FILES, ...collectJournalArchives(guard, paths), ...collectWeeklyFiles(guard, paths)];\n for (const rel of rels) {\n const abs = path.join(paths.dataDir, rel);\n let absCanon: string;\n try {\n absCanon = guard.assert(abs);\n } catch {\n missing.push(rel);\n continue;\n }\n if (!fs.existsSync(absCanon)) {\n missing.push(rel);\n continue;\n }\n const encrypted = isEncrypted(absCanon);\n const content = encrypted\n ? loadEncryptedText(guard, absCanon) ?? (() => { throw new Error(`cannot decrypt ${rel} on this machine`); })()\n : fs.readFileSync(absCanon, 'utf8');\n entries.push({ path: rel.replace(/\\\\/g, '/'), encrypted, content });\n packed.push(rel);\n }\n return { entries, progress: { packed, missing } };\n}\n\n/** Derive the key with the container's OWN cost parameter. `n` must already\n * have passed assertKdfN (export uses the current default). */\nfunction deriveKey(passphrase: string, salt: Buffer, n: number): Buffer {\n return scryptSync(passphrase, salt, KEY_LEN, { N: n, r: 8, p: 1, maxmem: SCRYPT_MAXMEM });\n}\n\n/** Validate the scrypt cost carried by a container. A missing/absurd N is a\n * BROKEN container — reported as such, never as \"wrong passphrase\" (before\n * 2026-10-06 the N in the container was ignored and the two were the same\n * error, so raising the cost would have orphaned every old export). */\nfunction assertKdfN(v: unknown): number {\n const n = Number(v);\n if (!Number.isInteger(n) || n <= 0 || (n & (n - 1)) !== 0) {\n throw new Error('migrate: container has invalid kdf parameters (N must be a power of two)');\n }\n if (n < KDF_N_MIN || n > KDF_N_MAX) {\n throw new Error(`migrate: container kdf N ${n} is outside the supported range [${KDF_N_MIN}, ${KDF_N_MAX}]`);\n }\n return n;\n}\n\n/** HB-18: a container does not get to decide how much work the import does. */\nfunction assertMigrateBudget(files: unknown[]): asserts files is MigrateEntry[] {\n if (files.length > MIGRATE_MAX_FILES) {\n throw new Error(`migrate: container lists ${files.length} files, over the ${MIGRATE_MAX_FILES} limit`);\n }\n let bytes = 0;\n for (const f of files) {\n const entry = f as { path?: unknown; content?: unknown } | null;\n if (!entry || typeof entry.path !== 'string' || typeof entry.content !== 'string') {\n throw new Error('migrate: container file entry is malformed');\n }\n bytes += Buffer.byteLength(entry.content, 'utf8');\n if (bytes > MIGRATE_MAX_BYTES) {\n throw new Error(`migrate: container payload exceeds ${MIGRATE_MAX_BYTES} bytes`);\n }\n }\n}\n\n/** Build the container file content. Everything sensitive lives inside the\n * ciphertext; the outer JSON carries only crypto parameters. */\nexport function encryptContainer(entries: MigrateEntry[], passphrase: string, now = new Date()): string {\n if (!passphrase) throw new Error('migrate: passphrase must not be empty');\n const salt = randomBytes(16);\n const iv = randomBytes(12);\n const key = deriveKey(passphrase, salt, KDF_N);\n const cipher = createCipheriv('aes-256-gcm', key, iv);\n const plain = Buffer.from(JSON.stringify({ version: MIGRATE_VERSION, createdAt: now.toISOString(), files: entries }), 'utf8');\n const data = Buffer.concat([cipher.update(plain), cipher.final()]);\n const tag = cipher.getAuthTag();\n return JSON.stringify({\n magic: MIGRATE_MAGIC,\n kdf: { name: 'scrypt', salt: salt.toString('hex'), N: KDF_N },\n iv: iv.toString('hex'),\n tag: tag.toString('hex'),\n data: data.toString('base64'),\n }, null, 1) + '\\n';\n}\n\n/** Parse + decrypt a container. Throws (loudly) on a wrong passphrase or a\n * corrupted file — never returns partial data. */\nexport function decryptContainer(text: string, passphrase: string): { createdAt: string; files: MigrateEntry[] } {\n let outer: { magic?: string; kdf?: { salt?: string; N?: unknown }; iv?: string; tag?: string; data?: string };\n try {\n outer = JSON.parse(text);\n } catch {\n throw new Error('migrate: not a migration container (bad JSON)');\n }\n if (outer.magic !== MIGRATE_MAGIC) throw new Error('migrate: not a migration container (bad magic)');\n const n = assertKdfN(outer.kdf?.N);\n const salt = Buffer.from(String(outer.kdf?.salt ?? ''), 'hex');\n const iv = Buffer.from(String(outer.iv ?? ''), 'hex');\n const tag = Buffer.from(String(outer.tag ?? ''), 'hex');\n // HB-18: refuse an oversized payload before decoding it. base64 runs ~4/3 of\n // the ciphertext, so this cheap length check bounds the allocation below.\n const dataB64 = String(outer.data ?? '');\n if (dataB64.length > MIGRATE_MAX_BYTES * 2) {\n throw new Error(`migrate: container payload is too large (${dataB64.length} base64 chars)`);\n }\n const data = Buffer.from(dataB64, 'base64');\n const key = deriveKey(passphrase, salt, n);\n const decipher = createDecipheriv('aes-256-gcm', key, iv);\n decipher.setAuthTag(tag);\n let plain: Buffer;\n try {\n plain = Buffer.concat([decipher.update(data), decipher.final()]);\n } catch {\n throw new Error('migrate: wrong passphrase or corrupted container');\n }\n const inner = JSON.parse(plain.toString('utf8')) as { version: number; createdAt: string; files: MigrateEntry[] };\n if (inner.version !== MIGRATE_VERSION) throw new Error(`migrate: unsupported container version ${inner.version}`);\n if (!Array.isArray(inner.files)) throw new Error('migrate: container has no file list');\n assertMigrateBudget(inner.files);\n return { createdAt: inner.createdAt, files: inner.files };\n}\n\nexport interface MigrateImportResult {\n restored: string[];\n backedUp: string[];\n skipped: string[];\n /** H-21: files put back from their backups after a failed commit phase. */\n rolledBack?: string[];\n /** H-21: set when the commit phase failed and the import was rolled back. */\n error?: string;\n}\n\n/**\n * Restore entries into the local dataDir, re-encrypting DPAPI files with the\n * LOCAL machine key.\n *\n * H-21: this used to be a per-file \"back up, then overwrite\" loop with no\n * pre-flight and no rollback — a failure halfway through left a mixed memory\n * (a new `profile.json` next to a stale `profile_journal.jsonl`). Now it runs\n * in two phases: stage every entry next to its target (nothing visible changes\n * yet), then commit each one by rename. A commit failure rolls the\n * already-committed files back from their backups.\n *\n * HB-06 (2026-10-17): the phases are all-or-nothing at BOTH ends. Earlier a\n * staging failure only skipped that entry and the rest were still committed,\n * so one bad path was enough to leave a half-migrated memory. Now any skipped\n * entry aborts the whole import with nothing written; the reason is returned\n * in `error` alongside the offending names.\n */\nexport function applyMigrationEntries(guard: PathGuard, paths: WorkspacePaths, files: MigrateEntry[], now = Date.now()): MigrateImportResult {\n const restored: string[] = [];\n const backedUp: string[] = [];\n const skipped: string[] = [];\n const stamp = new Date(now).toISOString().replace(/[-:T]/g, '').slice(0, 14);\n const staged: Array<{ rel: string; abs: string; incoming: string }> = [];\n for (const f of files) {\n const rel = String(f.path ?? '');\n // String-level rejection BEFORE the path is resolved: the guard's realpath\n // check already refuses escapes, but an import must not depend on another\n // module staying correct. HB-18: and the name must be one an export can\n // produce - a container may not reach settings/, gate.json or vault.key.\n if (!rel || rel.includes('..') || path.isAbsolute(rel) || !isMigratablePath(rel)) {\n skipped.push(rel);\n continue;\n }\n const abs = path.join(paths.dataDir, rel);\n let absCanon: string;\n try {\n absCanon = guard.assert(abs);\n } catch {\n skipped.push(rel); // path refused by the guard — never write it\n continue;\n }\n const incoming = `${absCanon}.incoming-${stamp}`;\n try {\n fs.mkdirSync(path.dirname(absCanon), { recursive: true });\n if (f.encrypted) saveEncryptedText(guard, incoming, f.content);\n else fs.writeFileSync(incoming, f.content, 'utf8');\n staged.push({ rel, abs: absCanon, incoming });\n } catch {\n skipped.push(rel);\n try {\n fs.rmSync(incoming, { force: true });\n } catch {\n /* nothing staged */\n }\n }\n }\n // HB-06: staging is the point of no return. A single entry that could not be\n // staged used to be skipped while the rest were committed, which left a\n // half-migrated memory (a new profile.json next to a stale journal). Any skip\n // now aborts the import with nothing written; the reason travels in `error`.\n if (skipped.length > 0) {\n for (const s of staged) {\n try {\n fs.rmSync(s.incoming, { force: true });\n } catch {\n /* nothing staged */\n }\n }\n return {\n restored: [],\n backedUp: [],\n skipped,\n error: `staging failed for ${skipped.length} file(s): ${skipped.join(', ')}; nothing was imported`,\n };\n }\n const committed: Array<{ rel: string; abs: string; backup: string | null }> = [];\n try {\n for (const s of staged) {\n let backup: string | null = null;\n if (fs.existsSync(s.abs)) {\n backup = `${s.abs}.bak-migrate-${stamp}`;\n fs.copyFileSync(s.abs, backup);\n backedUp.push(s.rel);\n }\n fs.renameSync(s.incoming, s.abs);\n committed.push({ rel: s.rel, abs: s.abs, backup });\n restored.push(s.rel);\n }\n return { restored, backedUp, skipped };\n } catch (e) {\n // Roll back so the dataDir never holds a half-migrated mix; staged files\n // that were never committed are simply dropped.\n const rolledBack: string[] = [];\n for (const c of committed.reverse()) {\n try {\n if (c.backup) fs.renameSync(c.backup, c.abs);\n else fs.rmSync(c.abs, { force: true });\n rolledBack.push(c.rel);\n } catch {\n /* best effort — the backup file itself is still on disk */\n }\n }\n for (const s of staged) {\n if (committed.some((c) => c.abs === s.abs)) continue;\n try {\n fs.rmSync(s.incoming, { force: true });\n } catch {\n /* already gone */\n }\n }\n return { restored: [], backedUp, skipped, rolledBack, error: String(e) };\n }\n}\n"],"mappings":";;;;;;;AAWA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAI/B,IAAM,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