clawvault 1.2.0 → 1.3.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/bin/clawvault.js +13 -4
- package/dist/{chunk-NITF7AHR.js → chunk-ALIUE5KY.js} +4 -0
- package/dist/commands/checkpoint.d.ts +2 -1
- package/dist/commands/checkpoint.js +3 -1
- package/dist/commands/recover.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -1
- package/package.json +3 -3
package/bin/clawvault.js
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
ClawVault,
|
|
15
15
|
createVault,
|
|
16
16
|
findVault,
|
|
17
|
-
VERSION,
|
|
18
17
|
hasQmd,
|
|
19
18
|
QmdUnavailableError,
|
|
20
19
|
QMD_INSTALL_URL
|
|
@@ -22,6 +21,16 @@ import {
|
|
|
22
21
|
|
|
23
22
|
const program = new Command();
|
|
24
23
|
|
|
24
|
+
const CLI_VERSION = (() => {
|
|
25
|
+
try {
|
|
26
|
+
const pkgUrl = new URL('../package.json', import.meta.url);
|
|
27
|
+
const pkg = JSON.parse(fs.readFileSync(pkgUrl, 'utf-8'));
|
|
28
|
+
return pkg.version || '0.0.0';
|
|
29
|
+
} catch {
|
|
30
|
+
return '0.0.0';
|
|
31
|
+
}
|
|
32
|
+
})();
|
|
33
|
+
|
|
25
34
|
// Helper to get vault (required for most commands)
|
|
26
35
|
// Checks: 1) explicit path, 2) CLAWVAULT_PATH env, 3) walk up from cwd
|
|
27
36
|
async function getVault(vaultPath) {
|
|
@@ -69,7 +78,7 @@ function printQmdMissing() {
|
|
|
69
78
|
program
|
|
70
79
|
.name('clawvault')
|
|
71
80
|
.description('🐘 An elephant never forgets. Structured memory for AI agents.')
|
|
72
|
-
.version(
|
|
81
|
+
.version(CLI_VERSION);
|
|
73
82
|
|
|
74
83
|
// === INIT ===
|
|
75
84
|
program
|
|
@@ -832,8 +841,8 @@ program
|
|
|
832
841
|
process.exit(1);
|
|
833
842
|
}
|
|
834
843
|
|
|
835
|
-
const {
|
|
836
|
-
await
|
|
844
|
+
const { cleanExit } = await import('../dist/commands/checkpoint.js');
|
|
845
|
+
await cleanExit(path.resolve(vaultPath));
|
|
837
846
|
console.log(chalk.green('✓ Clean exit recorded'));
|
|
838
847
|
} catch (err) {
|
|
839
848
|
console.error(chalk.red(`Error: ${err.message}`));
|
|
@@ -60,6 +60,9 @@ async function clearDirtyFlag(vaultPath) {
|
|
|
60
60
|
fs.unlinkSync(flagPath);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
async function cleanExit(vaultPath) {
|
|
64
|
+
await clearDirtyFlag(vaultPath);
|
|
65
|
+
}
|
|
63
66
|
async function checkDirtyDeath(vaultPath) {
|
|
64
67
|
const dir = path.join(vaultPath, CLAWVAULT_DIR);
|
|
65
68
|
const flagPath = path.join(dir, DIRTY_DEATH_FLAG);
|
|
@@ -90,6 +93,7 @@ export {
|
|
|
90
93
|
flush,
|
|
91
94
|
checkpoint,
|
|
92
95
|
clearDirtyFlag,
|
|
96
|
+
cleanExit,
|
|
93
97
|
checkDirtyDeath,
|
|
94
98
|
setSessionState
|
|
95
99
|
};
|
|
@@ -17,6 +17,7 @@ interface CheckpointData {
|
|
|
17
17
|
declare function flush(): Promise<CheckpointData | null>;
|
|
18
18
|
declare function checkpoint(options: CheckpointOptions): Promise<CheckpointData>;
|
|
19
19
|
declare function clearDirtyFlag(vaultPath: string): Promise<void>;
|
|
20
|
+
declare function cleanExit(vaultPath: string): Promise<void>;
|
|
20
21
|
declare function checkDirtyDeath(vaultPath: string): Promise<{
|
|
21
22
|
died: boolean;
|
|
22
23
|
checkpoint: CheckpointData | null;
|
|
@@ -24,4 +25,4 @@ declare function checkDirtyDeath(vaultPath: string): Promise<{
|
|
|
24
25
|
}>;
|
|
25
26
|
declare function setSessionState(vaultPath: string, sessionId: string): Promise<void>;
|
|
26
27
|
|
|
27
|
-
export { type CheckpointData, type CheckpointOptions, checkDirtyDeath, checkpoint, clearDirtyFlag, flush, setSessionState };
|
|
28
|
+
export { type CheckpointData, type CheckpointOptions, checkDirtyDeath, checkpoint, cleanExit, clearDirtyFlag, flush, setSessionState };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
checkDirtyDeath,
|
|
3
3
|
checkpoint,
|
|
4
|
+
cleanExit,
|
|
4
5
|
clearDirtyFlag,
|
|
5
6
|
flush,
|
|
6
7
|
setSessionState
|
|
7
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-ALIUE5KY.js";
|
|
8
9
|
export {
|
|
9
10
|
checkDirtyDeath,
|
|
10
11
|
checkpoint,
|
|
12
|
+
cleanExit,
|
|
11
13
|
clearDirtyFlag,
|
|
12
14
|
flush,
|
|
13
15
|
setSessionState
|
package/dist/commands/recover.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -433,6 +433,6 @@ declare function extractTags(content: string): string[];
|
|
|
433
433
|
* ```
|
|
434
434
|
*/
|
|
435
435
|
|
|
436
|
-
declare const VERSION
|
|
436
|
+
declare const VERSION: string;
|
|
437
437
|
|
|
438
438
|
export { type Category, ClawVault, DEFAULT_CATEGORIES, DEFAULT_CONFIG, type Document, type HandoffDocument, MEMORY_TYPES, type MemoryType, QMD_INSTALL_URL, QmdUnavailableError, SearchEngine, type SearchOptions, type SearchResult, type SessionRecap, type StoreOptions, type SyncOptions, type SyncResult, TYPE_TO_CATEGORY, VERSION, type VaultConfig, type VaultMeta, createVault, extractTags, extractWikiLinks, findVault, hasQmd, qmdEmbed, qmdUpdate };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import * as fs2 from "fs";
|
|
3
|
+
|
|
1
4
|
// src/lib/vault.ts
|
|
2
5
|
import * as fs from "fs";
|
|
3
6
|
import * as path2 from "path";
|
|
@@ -1212,7 +1215,16 @@ async function createVault(vaultPath, options = {}) {
|
|
|
1212
1215
|
}
|
|
1213
1216
|
|
|
1214
1217
|
// src/index.ts
|
|
1215
|
-
|
|
1218
|
+
function readPackageVersion() {
|
|
1219
|
+
try {
|
|
1220
|
+
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
1221
|
+
const pkg = JSON.parse(fs2.readFileSync(pkgUrl, "utf-8"));
|
|
1222
|
+
return pkg.version ?? "0.0.0";
|
|
1223
|
+
} catch {
|
|
1224
|
+
return "0.0.0";
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
var VERSION = readPackageVersion();
|
|
1216
1228
|
export {
|
|
1217
1229
|
ClawVault,
|
|
1218
1230
|
DEFAULT_CATEGORIES,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawvault",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "🐘 An elephant never forgets. Structured memory system for AI agents with Obsidian-compatible markdown and embedded semantic search.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
11
12
|
"import": "./dist/index.js",
|
|
12
|
-
"require": "./dist/index.cjs"
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|