clawvault 2.4.1 → 2.4.2
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/register-core-commands.js +68 -8
- package/dist/{chunk-Q3WBH4P4.js → chunk-BMOQI62Q.js} +16 -5
- package/dist/{chunk-33GW63WK.js → chunk-XDCFXFGH.js} +1 -1
- package/dist/commands/context.js +2 -2
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/sleep.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/wake.js +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -22,22 +22,50 @@ export function registerCoreCommands(
|
|
|
22
22
|
.option('--minimal', 'Create minimal vault (memory categories only, no tasks/bases/graph)')
|
|
23
23
|
.action(async (vaultPath, options) => {
|
|
24
24
|
const targetPath = vaultPath || '.';
|
|
25
|
-
|
|
25
|
+
const resolvedPath = path.resolve(targetPath);
|
|
26
|
+
console.log(chalk.cyan(`\n🐘 Initializing ClawVault at ${resolvedPath}...\n`));
|
|
27
|
+
|
|
28
|
+
// Check for existing vault
|
|
29
|
+
const existingConfig = path.join(resolvedPath, '.clawvault.json');
|
|
30
|
+
if (fs.existsSync(existingConfig)) {
|
|
31
|
+
console.error(chalk.red(`Error: A ClawVault already exists at ${resolvedPath}`));
|
|
32
|
+
console.error(chalk.dim(' Use --force to reinitialize (not yet supported) or choose a different path.'));
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
26
35
|
|
|
27
36
|
try {
|
|
37
|
+
// Resolve --minimal shorthand
|
|
38
|
+
const isMinimal = !!options.minimal;
|
|
39
|
+
const skipBases = isMinimal || options.bases === false;
|
|
40
|
+
const skipTasks = isMinimal || !!options.noTasks;
|
|
41
|
+
const skipGraph = isMinimal || !!options.noGraph;
|
|
42
|
+
|
|
43
|
+
// Resolve custom categories
|
|
44
|
+
const { DEFAULT_CATEGORIES } = await import('../dist/index.js');
|
|
45
|
+
let categories = [...DEFAULT_CATEGORIES];
|
|
46
|
+
if (options.categories) {
|
|
47
|
+
const customCats = options.categories.split(',').map(c => c.trim()).filter(Boolean);
|
|
48
|
+
categories = customCats;
|
|
49
|
+
}
|
|
50
|
+
|
|
28
51
|
const vault = await createVault(targetPath, {
|
|
29
|
-
name: options.name || path.basename(
|
|
30
|
-
qmdCollection: options.qmdCollection
|
|
31
|
-
|
|
52
|
+
name: options.name || path.basename(resolvedPath),
|
|
53
|
+
qmdCollection: options.qmdCollection,
|
|
54
|
+
categories
|
|
55
|
+
}, { skipBases, skipTasks, skipGraph });
|
|
32
56
|
|
|
33
|
-
const
|
|
34
|
-
const memoryCategories =
|
|
35
|
-
const workCategories =
|
|
57
|
+
const vaultCategories = vault.getCategories();
|
|
58
|
+
const memoryCategories = vaultCategories.filter(c => !['templates', 'tasks', 'backlog'].includes(c));
|
|
59
|
+
const workCategories = vaultCategories.filter(c => ['tasks', 'backlog'].includes(c));
|
|
36
60
|
|
|
37
61
|
console.log(chalk.green('✓ Vault created'));
|
|
38
62
|
console.log(chalk.dim(` Memory: ${memoryCategories.join(', ')}`));
|
|
39
|
-
|
|
63
|
+
if (workCategories.length > 0) {
|
|
64
|
+
console.log(chalk.dim(` Work: ${workCategories.join(', ')}`));
|
|
65
|
+
}
|
|
40
66
|
console.log(chalk.dim(` Ledger: ledger/raw, ledger/observations, ledger/reflections`));
|
|
67
|
+
if (skipBases) console.log(chalk.dim(' Bases: skipped'));
|
|
68
|
+
if (skipGraph) console.log(chalk.dim(' Graph: skipped'));
|
|
41
69
|
|
|
42
70
|
console.log(chalk.cyan('\nSetting up qmd collection...'));
|
|
43
71
|
try {
|
|
@@ -55,6 +83,38 @@ export function registerCoreCommands(
|
|
|
55
83
|
console.log(chalk.yellow('⚠ qmd collection may already exist'));
|
|
56
84
|
}
|
|
57
85
|
|
|
86
|
+
// Apply theme if requested
|
|
87
|
+
if (options.theme && options.theme !== 'none') {
|
|
88
|
+
try {
|
|
89
|
+
const { setupCommand } = await import('../dist/commands/setup.js');
|
|
90
|
+
await setupCommand({
|
|
91
|
+
graphColors: true,
|
|
92
|
+
bases: false,
|
|
93
|
+
canvas: false,
|
|
94
|
+
theme: options.theme,
|
|
95
|
+
vault: resolvedPath
|
|
96
|
+
});
|
|
97
|
+
} catch {
|
|
98
|
+
console.log(chalk.yellow(`⚠ Could not apply ${options.theme} theme`));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Generate canvas if requested
|
|
103
|
+
if (options.canvas) {
|
|
104
|
+
try {
|
|
105
|
+
const { setupCommand } = await import('../dist/commands/setup.js');
|
|
106
|
+
await setupCommand({
|
|
107
|
+
graphColors: false,
|
|
108
|
+
bases: false,
|
|
109
|
+
canvas: options.canvas === true ? 'default' : options.canvas,
|
|
110
|
+
theme: 'none',
|
|
111
|
+
vault: resolvedPath
|
|
112
|
+
});
|
|
113
|
+
} catch {
|
|
114
|
+
console.log(chalk.yellow(`⚠ Could not generate canvas`));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
58
118
|
console.log(chalk.green('\n✅ ClawVault ready!\n'));
|
|
59
119
|
console.log(' ' + chalk.bold('Try these:'));
|
|
60
120
|
console.log(chalk.dim(' clawvault capture "my first thought" # quick capture'));
|
|
@@ -42,13 +42,19 @@ var ClawVault = class {
|
|
|
42
42
|
/**
|
|
43
43
|
* Initialize a new vault
|
|
44
44
|
*/
|
|
45
|
-
async init(options = {}) {
|
|
45
|
+
async init(options = {}, initFlags) {
|
|
46
46
|
if (!hasQmd()) {
|
|
47
47
|
throw new QmdUnavailableError();
|
|
48
48
|
}
|
|
49
49
|
const vaultPath = this.config.path;
|
|
50
|
+
const flags = initFlags || {};
|
|
50
51
|
this.config = { ...this.config, ...options };
|
|
51
52
|
this.applyQmdConfig();
|
|
53
|
+
if (flags.skipTasks) {
|
|
54
|
+
this.config.categories = this.config.categories.filter(
|
|
55
|
+
(c) => !["tasks", "backlog"].includes(c)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
52
58
|
if (!fs.existsSync(vaultPath)) {
|
|
53
59
|
fs.mkdirSync(vaultPath, { recursive: true });
|
|
54
60
|
}
|
|
@@ -83,8 +89,12 @@ var ClawVault = class {
|
|
|
83
89
|
qmdRoot: this.getQmdRoot()
|
|
84
90
|
};
|
|
85
91
|
fs.writeFileSync(configPath, JSON.stringify(meta, null, 2));
|
|
86
|
-
this.
|
|
87
|
-
|
|
92
|
+
if (!flags.skipBases && this.config.categories.includes("tasks")) {
|
|
93
|
+
this.createBasesFiles();
|
|
94
|
+
}
|
|
95
|
+
if (!flags.skipGraph) {
|
|
96
|
+
await this.syncMemoryGraphIndex({ forceFull: true });
|
|
97
|
+
}
|
|
88
98
|
this.initialized = true;
|
|
89
99
|
}
|
|
90
100
|
createBasesFiles() {
|
|
@@ -734,6 +744,7 @@ var ClawVault = class {
|
|
|
734
744
|
}
|
|
735
745
|
}
|
|
736
746
|
async createWelcomeNote() {
|
|
747
|
+
if (!this.config.categories.includes("inbox")) return;
|
|
737
748
|
const inboxPath = path.join(this.config.path, "inbox", "welcome.md");
|
|
738
749
|
if (fs.existsSync(inboxPath)) return;
|
|
739
750
|
const now = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -871,9 +882,9 @@ async function findVault(startPath = process.cwd()) {
|
|
|
871
882
|
}
|
|
872
883
|
return null;
|
|
873
884
|
}
|
|
874
|
-
async function createVault(vaultPath, options = {}) {
|
|
885
|
+
async function createVault(vaultPath, options = {}, initFlags) {
|
|
875
886
|
const vault = new ClawVault(vaultPath);
|
|
876
|
-
await vault.init(options);
|
|
887
|
+
await vault.init(options, initFlags);
|
|
877
888
|
return vault;
|
|
878
889
|
}
|
|
879
890
|
|
package/dist/commands/context.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
contextCommand,
|
|
4
4
|
formatContextMarkdown,
|
|
5
5
|
registerContextCommand
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-XDCFXFGH.js";
|
|
7
|
+
import "../chunk-BMOQI62Q.js";
|
|
8
8
|
import "../chunk-FDJIZKCW.js";
|
|
9
9
|
import "../chunk-L3DJ36BZ.js";
|
|
10
10
|
import "../chunk-ZZA73MFY.js";
|
package/dist/commands/doctor.js
CHANGED
package/dist/commands/sleep.js
CHANGED
package/dist/commands/status.js
CHANGED
package/dist/commands/wake.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,11 @@ declare class ClawVault {
|
|
|
32
32
|
/**
|
|
33
33
|
* Initialize a new vault
|
|
34
34
|
*/
|
|
35
|
-
init(options?: Partial<VaultConfig
|
|
35
|
+
init(options?: Partial<VaultConfig>, initFlags?: {
|
|
36
|
+
skipBases?: boolean;
|
|
37
|
+
skipTasks?: boolean;
|
|
38
|
+
skipGraph?: boolean;
|
|
39
|
+
}): Promise<void>;
|
|
36
40
|
private createBasesFiles;
|
|
37
41
|
/**
|
|
38
42
|
* Load an existing vault
|
|
@@ -161,7 +165,11 @@ declare function findVault(startPath?: string): Promise<ClawVault | null>;
|
|
|
161
165
|
/**
|
|
162
166
|
* Create a new vault
|
|
163
167
|
*/
|
|
164
|
-
declare function createVault(vaultPath: string, options?: Partial<VaultConfig
|
|
168
|
+
declare function createVault(vaultPath: string, options?: Partial<VaultConfig>, initFlags?: {
|
|
169
|
+
skipBases?: boolean;
|
|
170
|
+
skipTasks?: boolean;
|
|
171
|
+
skipGraph?: boolean;
|
|
172
|
+
}): Promise<ClawVault>;
|
|
165
173
|
|
|
166
174
|
/**
|
|
167
175
|
* ClawVault Search Engine - qmd Backend
|
package/dist/index.js
CHANGED
|
@@ -111,12 +111,12 @@ import {
|
|
|
111
111
|
normalizeContextProfileInput,
|
|
112
112
|
registerContextCommand,
|
|
113
113
|
resolveContextProfile
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-XDCFXFGH.js";
|
|
115
115
|
import {
|
|
116
116
|
ClawVault,
|
|
117
117
|
createVault,
|
|
118
118
|
findVault
|
|
119
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-BMOQI62Q.js";
|
|
120
120
|
import {
|
|
121
121
|
DEFAULT_CATEGORIES,
|
|
122
122
|
DEFAULT_CONFIG,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawvault",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Structured memory system for AI agents — typed storage, knowledge graph, task management, and Obsidian dashboards. An elephant never forgets. 🐘",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|