stellavault 0.4.4 → 0.5.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 +52 -16
- package/SECURITY.md +50 -0
- package/dist/stellavault.js +8968 -0
- package/package.json +70 -33
- package/.env.example +0 -12
- package/CHANGELOG.md +0 -106
- package/CLAUDE.md +0 -42
- package/CONTRIBUTING.md +0 -65
- package/index.html +0 -509
- package/packages/cli/bin/ekh.js +0 -2
- package/packages/cli/bin/stellavault.js +0 -2
- package/packages/cli/dist/commands/adr-cmd.d.ts +0 -7
- package/packages/cli/dist/commands/adr-cmd.js +0 -45
- package/packages/cli/dist/commands/ask-cmd.d.ts +0 -5
- package/packages/cli/dist/commands/ask-cmd.js +0 -36
- package/packages/cli/dist/commands/autopilot-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/autopilot-cmd.js +0 -76
- package/packages/cli/dist/commands/brief-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/brief-cmd.js +0 -82
- package/packages/cli/dist/commands/capture-cmd.d.ts +0 -7
- package/packages/cli/dist/commands/capture-cmd.js +0 -31
- package/packages/cli/dist/commands/card-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/card-cmd.js +0 -26
- package/packages/cli/dist/commands/clip-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/clip-cmd.js +0 -151
- package/packages/cli/dist/commands/cloud-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/cloud-cmd.js +0 -64
- package/packages/cli/dist/commands/compile-cmd.d.ts +0 -6
- package/packages/cli/dist/commands/compile-cmd.js +0 -30
- package/packages/cli/dist/commands/contradictions-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/contradictions-cmd.js +0 -34
- package/packages/cli/dist/commands/decay-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/decay-cmd.js +0 -48
- package/packages/cli/dist/commands/digest-cmd.d.ts +0 -5
- package/packages/cli/dist/commands/digest-cmd.js +0 -136
- package/packages/cli/dist/commands/draft-cmd.d.ts +0 -6
- package/packages/cli/dist/commands/draft-cmd.js +0 -110
- package/packages/cli/dist/commands/duplicates-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/duplicates-cmd.js +0 -30
- package/packages/cli/dist/commands/federate-cmd.d.ts +0 -5
- package/packages/cli/dist/commands/federate-cmd.js +0 -247
- package/packages/cli/dist/commands/fleeting-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/fleeting-cmd.js +0 -45
- package/packages/cli/dist/commands/flush-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/flush-cmd.js +0 -58
- package/packages/cli/dist/commands/gaps-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/gaps-cmd.js +0 -33
- package/packages/cli/dist/commands/graph-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/graph-cmd.js +0 -89
- package/packages/cli/dist/commands/index-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/index-cmd.js +0 -57
- package/packages/cli/dist/commands/ingest-cmd.d.ts +0 -9
- package/packages/cli/dist/commands/ingest-cmd.js +0 -195
- package/packages/cli/dist/commands/init-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/init-cmd.js +0 -161
- package/packages/cli/dist/commands/learn-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/learn-cmd.js +0 -48
- package/packages/cli/dist/commands/lint-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/lint-cmd.js +0 -61
- package/packages/cli/dist/commands/pack-cmd.d.ts +0 -15
- package/packages/cli/dist/commands/pack-cmd.js +0 -93
- package/packages/cli/dist/commands/review-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/review-cmd.js +0 -107
- package/packages/cli/dist/commands/search-cmd.d.ts +0 -4
- package/packages/cli/dist/commands/search-cmd.js +0 -38
- package/packages/cli/dist/commands/serve-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/serve-cmd.js +0 -14
- package/packages/cli/dist/commands/session-cmd.d.ts +0 -7
- package/packages/cli/dist/commands/session-cmd.js +0 -95
- package/packages/cli/dist/commands/status-cmd.d.ts +0 -2
- package/packages/cli/dist/commands/status-cmd.js +0 -33
- package/packages/cli/dist/commands/sync-cmd.d.ts +0 -5
- package/packages/cli/dist/commands/sync-cmd.js +0 -62
- package/packages/cli/dist/commands/vault-cmd.d.ts +0 -10
- package/packages/cli/dist/commands/vault-cmd.js +0 -54
- package/packages/cli/dist/index.d.ts +0 -2
- package/packages/cli/dist/index.js +0 -233
- package/packages/cli/package.json +0 -24
- package/packages/core/dist/api/dashboard.d.ts +0 -3
- package/packages/core/dist/api/dashboard.js +0 -135
- package/packages/core/dist/api/graph-data.d.ts +0 -11
- package/packages/core/dist/api/graph-data.js +0 -255
- package/packages/core/dist/api/pwa.d.ts +0 -3
- package/packages/core/dist/api/pwa.js +0 -77
- package/packages/core/dist/api/server.d.ts +0 -16
- package/packages/core/dist/api/server.js +0 -1122
- package/packages/core/dist/capture/voice.d.ts +0 -24
- package/packages/core/dist/capture/voice.js +0 -135
- package/packages/core/dist/cloud/index.d.ts +0 -3
- package/packages/core/dist/cloud/index.js +0 -2
- package/packages/core/dist/cloud/sync.d.ts +0 -29
- package/packages/core/dist/cloud/sync.js +0 -137
- package/packages/core/dist/config.d.ts +0 -35
- package/packages/core/dist/config.js +0 -63
- package/packages/core/dist/federation/credits.d.ts +0 -26
- package/packages/core/dist/federation/credits.js +0 -56
- package/packages/core/dist/federation/identity.d.ts +0 -14
- package/packages/core/dist/federation/identity.js +0 -74
- package/packages/core/dist/federation/index.d.ts +0 -7
- package/packages/core/dist/federation/index.js +0 -5
- package/packages/core/dist/federation/node.d.ts +0 -31
- package/packages/core/dist/federation/node.js +0 -216
- package/packages/core/dist/federation/privacy.d.ts +0 -8
- package/packages/core/dist/federation/privacy.js +0 -40
- package/packages/core/dist/federation/reputation.d.ts +0 -37
- package/packages/core/dist/federation/reputation.js +0 -139
- package/packages/core/dist/federation/search.d.ts +0 -19
- package/packages/core/dist/federation/search.js +0 -101
- package/packages/core/dist/federation/sharing.d.ts +0 -72
- package/packages/core/dist/federation/sharing.js +0 -246
- package/packages/core/dist/federation/trust.d.ts +0 -15
- package/packages/core/dist/federation/trust.js +0 -60
- package/packages/core/dist/federation/types.d.ts +0 -40
- package/packages/core/dist/federation/types.js +0 -3
- package/packages/core/dist/i18n/index.d.ts +0 -6
- package/packages/core/dist/i18n/index.js +0 -81
- package/packages/core/dist/i18n/note-strings.d.ts +0 -5
- package/packages/core/dist/i18n/note-strings.js +0 -94
- package/packages/core/dist/index.d.ts +0 -123
- package/packages/core/dist/index.js +0 -74
- package/packages/core/dist/indexer/chunker.d.ts +0 -14
- package/packages/core/dist/indexer/chunker.js +0 -148
- package/packages/core/dist/indexer/embedder.d.ts +0 -8
- package/packages/core/dist/indexer/embedder.js +0 -3
- package/packages/core/dist/indexer/index.d.ts +0 -28
- package/packages/core/dist/indexer/index.js +0 -74
- package/packages/core/dist/indexer/local-embedder.d.ts +0 -3
- package/packages/core/dist/indexer/local-embedder.js +0 -29
- package/packages/core/dist/indexer/scanner.d.ts +0 -11
- package/packages/core/dist/indexer/scanner.js +0 -148
- package/packages/core/dist/indexer/watcher.d.ts +0 -19
- package/packages/core/dist/indexer/watcher.js +0 -49
- package/packages/core/dist/intelligence/ask-engine.d.ts +0 -24
- package/packages/core/dist/intelligence/ask-engine.js +0 -142
- package/packages/core/dist/intelligence/auto-linker.d.ts +0 -19
- package/packages/core/dist/intelligence/auto-linker.js +0 -126
- package/packages/core/dist/intelligence/code-linker.d.ts +0 -20
- package/packages/core/dist/intelligence/code-linker.js +0 -88
- package/packages/core/dist/intelligence/contradiction-detector.d.ts +0 -20
- package/packages/core/dist/intelligence/contradiction-detector.js +0 -115
- package/packages/core/dist/intelligence/decay-engine.d.ts +0 -27
- package/packages/core/dist/intelligence/decay-engine.js +0 -190
- package/packages/core/dist/intelligence/draft-generator.d.ts +0 -25
- package/packages/core/dist/intelligence/draft-generator.js +0 -277
- package/packages/core/dist/intelligence/duplicate-detector.d.ts +0 -20
- package/packages/core/dist/intelligence/duplicate-detector.js +0 -55
- package/packages/core/dist/intelligence/file-extractors.d.ts +0 -13
- package/packages/core/dist/intelligence/file-extractors.js +0 -155
- package/packages/core/dist/intelligence/fsrs.d.ts +0 -43
- package/packages/core/dist/intelligence/fsrs.js +0 -70
- package/packages/core/dist/intelligence/gap-detector.d.ts +0 -25
- package/packages/core/dist/intelligence/gap-detector.js +0 -78
- package/packages/core/dist/intelligence/ingest-pipeline.d.ts +0 -32
- package/packages/core/dist/intelligence/ingest-pipeline.js +0 -245
- package/packages/core/dist/intelligence/knowledge-lint.d.ts +0 -27
- package/packages/core/dist/intelligence/knowledge-lint.js +0 -132
- package/packages/core/dist/intelligence/learning-path.d.ts +0 -31
- package/packages/core/dist/intelligence/learning-path.js +0 -53
- package/packages/core/dist/intelligence/notifications.d.ts +0 -31
- package/packages/core/dist/intelligence/notifications.js +0 -65
- package/packages/core/dist/intelligence/predictive-gaps.d.ts +0 -14
- package/packages/core/dist/intelligence/predictive-gaps.js +0 -74
- package/packages/core/dist/intelligence/semantic-versioning.d.ts +0 -37
- package/packages/core/dist/intelligence/semantic-versioning.js +0 -68
- package/packages/core/dist/intelligence/types.d.ts +0 -28
- package/packages/core/dist/intelligence/types.js +0 -3
- package/packages/core/dist/intelligence/wiki-compiler.d.ts +0 -30
- package/packages/core/dist/intelligence/wiki-compiler.js +0 -222
- package/packages/core/dist/intelligence/youtube-extractor.d.ts +0 -29
- package/packages/core/dist/intelligence/youtube-extractor.js +0 -321
- package/packages/core/dist/intelligence/zettelkasten.d.ts +0 -59
- package/packages/core/dist/intelligence/zettelkasten.js +0 -234
- package/packages/core/dist/mcp/custom-tools.d.ts +0 -29
- package/packages/core/dist/mcp/custom-tools.js +0 -70
- package/packages/core/dist/mcp/index.d.ts +0 -2
- package/packages/core/dist/mcp/index.js +0 -2
- package/packages/core/dist/mcp/server.d.ts +0 -51
- package/packages/core/dist/mcp/server.js +0 -174
- package/packages/core/dist/mcp/tools/agentic-graph.d.ts +0 -93
- package/packages/core/dist/mcp/tools/agentic-graph.js +0 -116
- package/packages/core/dist/mcp/tools/ask.d.ts +0 -29
- package/packages/core/dist/mcp/tools/ask.js +0 -43
- package/packages/core/dist/mcp/tools/brief.d.ts +0 -31
- package/packages/core/dist/mcp/tools/brief.js +0 -39
- package/packages/core/dist/mcp/tools/decay.d.ts +0 -33
- package/packages/core/dist/mcp/tools/decay.js +0 -32
- package/packages/core/dist/mcp/tools/decision-journal.d.ts +0 -78
- package/packages/core/dist/mcp/tools/decision-journal.js +0 -79
- package/packages/core/dist/mcp/tools/detect-gaps.d.ts +0 -24
- package/packages/core/dist/mcp/tools/detect-gaps.js +0 -47
- package/packages/core/dist/mcp/tools/export.d.ts +0 -29
- package/packages/core/dist/mcp/tools/export.js +0 -60
- package/packages/core/dist/mcp/tools/federated-search.d.ts +0 -29
- package/packages/core/dist/mcp/tools/federated-search.js +0 -36
- package/packages/core/dist/mcp/tools/generate-claude-md.d.ts +0 -35
- package/packages/core/dist/mcp/tools/generate-claude-md.js +0 -107
- package/packages/core/dist/mcp/tools/generate-draft.d.ts +0 -34
- package/packages/core/dist/mcp/tools/generate-draft.js +0 -120
- package/packages/core/dist/mcp/tools/get-document.d.ts +0 -35
- package/packages/core/dist/mcp/tools/get-document.js +0 -25
- package/packages/core/dist/mcp/tools/get-evolution.d.ts +0 -28
- package/packages/core/dist/mcp/tools/get-evolution.js +0 -70
- package/packages/core/dist/mcp/tools/get-related.d.ts +0 -32
- package/packages/core/dist/mcp/tools/get-related.js +0 -33
- package/packages/core/dist/mcp/tools/learning-path.d.ts +0 -23
- package/packages/core/dist/mcp/tools/learning-path.js +0 -45
- package/packages/core/dist/mcp/tools/link-code.d.ts +0 -34
- package/packages/core/dist/mcp/tools/link-code.js +0 -44
- package/packages/core/dist/mcp/tools/list-topics.d.ts +0 -15
- package/packages/core/dist/mcp/tools/list-topics.js +0 -18
- package/packages/core/dist/mcp/tools/search.d.ts +0 -39
- package/packages/core/dist/mcp/tools/search.js +0 -29
- package/packages/core/dist/mcp/tools/snapshot.d.ts +0 -47
- package/packages/core/dist/mcp/tools/snapshot.js +0 -84
- package/packages/core/dist/multi-vault/index.d.ts +0 -26
- package/packages/core/dist/multi-vault/index.js +0 -80
- package/packages/core/dist/pack/creator.d.ts +0 -21
- package/packages/core/dist/pack/creator.js +0 -105
- package/packages/core/dist/pack/exporter.d.ts +0 -4
- package/packages/core/dist/pack/exporter.js +0 -18
- package/packages/core/dist/pack/importer.d.ts +0 -10
- package/packages/core/dist/pack/importer.js +0 -55
- package/packages/core/dist/pack/index.d.ts +0 -6
- package/packages/core/dist/pack/index.js +0 -5
- package/packages/core/dist/pack/marketplace.d.ts +0 -14
- package/packages/core/dist/pack/marketplace.js +0 -90
- package/packages/core/dist/pack/pii-masker.d.ts +0 -7
- package/packages/core/dist/pack/pii-masker.js +0 -29
- package/packages/core/dist/pack/types.d.ts +0 -36
- package/packages/core/dist/pack/types.js +0 -3
- package/packages/core/dist/plugins/index.d.ts +0 -35
- package/packages/core/dist/plugins/index.js +0 -57
- package/packages/core/dist/plugins/webhooks.d.ts +0 -30
- package/packages/core/dist/plugins/webhooks.js +0 -79
- package/packages/core/dist/search/adaptive.d.ts +0 -16
- package/packages/core/dist/search/adaptive.js +0 -67
- package/packages/core/dist/search/bm25.d.ts +0 -4
- package/packages/core/dist/search/bm25.js +0 -10
- package/packages/core/dist/search/index.d.ts +0 -15
- package/packages/core/dist/search/index.js +0 -64
- package/packages/core/dist/search/rrf.d.ts +0 -7
- package/packages/core/dist/search/rrf.js +0 -21
- package/packages/core/dist/search/semantic.d.ts +0 -5
- package/packages/core/dist/search/semantic.js +0 -6
- package/packages/core/dist/store/index.d.ts +0 -3
- package/packages/core/dist/store/index.js +0 -2
- package/packages/core/dist/store/sqlite-vec.d.ts +0 -6
- package/packages/core/dist/store/sqlite-vec.js +0 -251
- package/packages/core/dist/store/types.d.ts +0 -20
- package/packages/core/dist/store/types.js +0 -3
- package/packages/core/dist/team/index.d.ts +0 -25
- package/packages/core/dist/team/index.js +0 -97
- package/packages/core/dist/types/chunk.d.ts +0 -23
- package/packages/core/dist/types/chunk.js +0 -3
- package/packages/core/dist/types/document.d.ts +0 -23
- package/packages/core/dist/types/document.js +0 -3
- package/packages/core/dist/types/graph.d.ts +0 -39
- package/packages/core/dist/types/graph.js +0 -3
- package/packages/core/dist/types/index.d.ts +0 -5
- package/packages/core/dist/types/index.js +0 -2
- package/packages/core/dist/types/search.d.ts +0 -39
- package/packages/core/dist/types/search.js +0 -3
- package/packages/core/dist/utils/retry.d.ts +0 -25
- package/packages/core/dist/utils/retry.js +0 -59
- package/packages/core/package.json +0 -67
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// stellavault lint — 지식 건강 검사 CLI
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { loadConfig, createKnowledgeHub, lintKnowledge } from '@stellavault/core';
|
|
4
|
-
export async function lintCommand() {
|
|
5
|
-
const config = loadConfig();
|
|
6
|
-
const hub = createKnowledgeHub(config);
|
|
7
|
-
console.error(chalk.dim('Scanning your knowledge base...'));
|
|
8
|
-
await hub.store.initialize();
|
|
9
|
-
const result = await lintKnowledge(hub.store);
|
|
10
|
-
// 건강도 점수
|
|
11
|
-
const scoreColor = result.score >= 80 ? chalk.green : result.score >= 50 ? chalk.yellow : chalk.red;
|
|
12
|
-
console.log('');
|
|
13
|
-
console.log(chalk.bold('Knowledge Health Report'));
|
|
14
|
-
console.log('─'.repeat(40));
|
|
15
|
-
console.log(`Score: ${scoreColor(result.score + '/100')}`);
|
|
16
|
-
console.log(`Documents: ${result.stats.totalDocs}`);
|
|
17
|
-
console.log('');
|
|
18
|
-
// 이슈
|
|
19
|
-
if (result.issues.length > 0) {
|
|
20
|
-
const critical = result.issues.filter(i => i.severity === 'critical');
|
|
21
|
-
const warnings = result.issues.filter(i => i.severity === 'warning');
|
|
22
|
-
const info = result.issues.filter(i => i.severity === 'info');
|
|
23
|
-
if (critical.length > 0) {
|
|
24
|
-
console.log(chalk.red(`Critical: ${critical.length}`));
|
|
25
|
-
for (const i of critical) {
|
|
26
|
-
console.log(chalk.red(` ✗ ${i.message}`));
|
|
27
|
-
if (i.suggestion)
|
|
28
|
-
console.log(chalk.dim(` → ${i.suggestion}`));
|
|
29
|
-
}
|
|
30
|
-
console.log('');
|
|
31
|
-
}
|
|
32
|
-
if (warnings.length > 0) {
|
|
33
|
-
console.log(chalk.yellow(`Warnings: ${warnings.length}`));
|
|
34
|
-
for (const i of warnings.slice(0, 10)) {
|
|
35
|
-
console.log(chalk.yellow(` ! ${i.message}`));
|
|
36
|
-
if (i.suggestion)
|
|
37
|
-
console.log(chalk.dim(` → ${i.suggestion}`));
|
|
38
|
-
}
|
|
39
|
-
if (warnings.length > 10)
|
|
40
|
-
console.log(chalk.dim(` ... and ${warnings.length - 10} more`));
|
|
41
|
-
console.log('');
|
|
42
|
-
}
|
|
43
|
-
if (info.length > 0) {
|
|
44
|
-
console.log(chalk.dim(`Info: ${info.length}`));
|
|
45
|
-
for (const i of info.slice(0, 5)) {
|
|
46
|
-
console.log(chalk.dim(` ℹ ${i.message}`));
|
|
47
|
-
}
|
|
48
|
-
console.log('');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// 제안
|
|
52
|
-
if (result.suggestions.length > 0) {
|
|
53
|
-
console.log(chalk.cyan('Suggestions:'));
|
|
54
|
-
for (const s of result.suggestions) {
|
|
55
|
-
console.log(` → ${s}`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
console.log('');
|
|
59
|
-
await hub.store.close?.();
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=lint-cmd.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare function packCreateCommand(name: string, options: {
|
|
2
|
-
fromSearch?: string;
|
|
3
|
-
fromCluster?: string;
|
|
4
|
-
author?: string;
|
|
5
|
-
license?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
limit?: string;
|
|
8
|
-
}): Promise<void>;
|
|
9
|
-
export declare function packExportCommand(name: string, options: {
|
|
10
|
-
output?: string;
|
|
11
|
-
}): Promise<void>;
|
|
12
|
-
export declare function packImportCommand(filePath: string): Promise<void>;
|
|
13
|
-
export declare function packListCommand(): Promise<void>;
|
|
14
|
-
export declare function packInfoCommand(name: string): Promise<void>;
|
|
15
|
-
//# sourceMappingURL=pack-cmd.d.ts.map
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// stellavault pack — Knowledge Pack 관리
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { resolve, join } from 'node:path';
|
|
4
|
-
import { readdirSync, existsSync, readFileSync, mkdirSync } from 'node:fs';
|
|
5
|
-
import { homedir } from 'node:os';
|
|
6
|
-
import { loadConfig, createKnowledgeHub, createPack, exportPack, importPack, packToSummary, } from '@stellavault/core';
|
|
7
|
-
const PACKS_DIR = join(homedir(), '.stellavault', 'packs');
|
|
8
|
-
export async function packCreateCommand(name, options) {
|
|
9
|
-
const config = loadConfig();
|
|
10
|
-
const hub = createKnowledgeHub(config);
|
|
11
|
-
await hub.store.initialize();
|
|
12
|
-
await hub.embedder.initialize();
|
|
13
|
-
console.error(chalk.dim('⏳ Creating pack...'));
|
|
14
|
-
const { pack, piiReport } = await createPack(hub.store, hub.searchEngine, hub.embedder, {
|
|
15
|
-
name,
|
|
16
|
-
fromSearch: options.fromSearch,
|
|
17
|
-
fromCluster: options.fromCluster ? parseInt(options.fromCluster) : undefined,
|
|
18
|
-
author: options.author ?? 'anonymous',
|
|
19
|
-
license: options.license ?? 'CC-BY-4.0',
|
|
20
|
-
description: options.description,
|
|
21
|
-
limit: options.limit ? parseInt(options.limit) : 100,
|
|
22
|
-
});
|
|
23
|
-
mkdirSync(PACKS_DIR, { recursive: true });
|
|
24
|
-
const outPath = join(PACKS_DIR, `${name}.sv-pack`);
|
|
25
|
-
exportPack(pack, outPath);
|
|
26
|
-
console.error(chalk.green(`✅ Pack created: ${name}`));
|
|
27
|
-
console.error(` 📦 ${pack.chunks.length} chunks`);
|
|
28
|
-
console.error(` 💾 ${outPath}`);
|
|
29
|
-
if (piiReport.redactedCount > 0) {
|
|
30
|
-
console.error(chalk.yellow(` 🔒 PII masked: ${piiReport.redactedCount} items (${piiReport.types.join(', ')})`));
|
|
31
|
-
}
|
|
32
|
-
await hub.store.close();
|
|
33
|
-
}
|
|
34
|
-
export async function packExportCommand(name, options) {
|
|
35
|
-
const srcPath = join(PACKS_DIR, `${name}.sv-pack`);
|
|
36
|
-
if (!existsSync(srcPath)) {
|
|
37
|
-
console.error(chalk.red(`❌ Pack not found: ${name}`));
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
const outPath = resolve(process.cwd(), options.output ?? `${name}.sv-pack`);
|
|
41
|
-
const content = readFileSync(srcPath, 'utf-8');
|
|
42
|
-
const { writeFileSync } = await import('node:fs');
|
|
43
|
-
writeFileSync(outPath, content);
|
|
44
|
-
console.error(chalk.green(`✅ Exported: ${outPath}`));
|
|
45
|
-
}
|
|
46
|
-
export async function packImportCommand(filePath) {
|
|
47
|
-
const absPath = resolve(process.cwd(), filePath);
|
|
48
|
-
if (!existsSync(absPath)) {
|
|
49
|
-
console.error(chalk.red(`❌ File not found: ${absPath}`));
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
const config = loadConfig();
|
|
53
|
-
const hub = createKnowledgeHub(config);
|
|
54
|
-
await hub.store.initialize();
|
|
55
|
-
await hub.embedder.initialize();
|
|
56
|
-
console.error(chalk.dim('⏳ Importing pack...'));
|
|
57
|
-
const result = await importPack(hub.store, hub.embedder, absPath);
|
|
58
|
-
console.error(chalk.green(`✅ Imported: ${result.imported} chunks`));
|
|
59
|
-
if (result.skipped > 0)
|
|
60
|
-
console.error(chalk.yellow(` ⏭️ Skipped: ${result.skipped}`));
|
|
61
|
-
if (result.modelMismatch) {
|
|
62
|
-
console.error(chalk.yellow(` ⚠️ Model mismatch — ${result.reEmbedded} chunks re-embedded`));
|
|
63
|
-
}
|
|
64
|
-
await hub.store.close();
|
|
65
|
-
}
|
|
66
|
-
export async function packListCommand() {
|
|
67
|
-
mkdirSync(PACKS_DIR, { recursive: true });
|
|
68
|
-
const files = readdirSync(PACKS_DIR).filter(f => f.endsWith('.sv-pack'));
|
|
69
|
-
if (files.length === 0) {
|
|
70
|
-
console.error(chalk.dim('No packs found. Create one: stellavault pack create <name> --from-search <query>'));
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
console.error(chalk.green(`📦 ${files.length} packs in ${PACKS_DIR}\n`));
|
|
74
|
-
for (const file of files) {
|
|
75
|
-
try {
|
|
76
|
-
const pack = JSON.parse(readFileSync(join(PACKS_DIR, file), 'utf-8'));
|
|
77
|
-
console.error(` ${chalk.bold(pack.name)} v${pack.version} — ${pack.chunks.length} chunks (${pack.license})`);
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
console.error(` ${file} (invalid)`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export async function packInfoCommand(name) {
|
|
85
|
-
const filePath = join(PACKS_DIR, `${name}.sv-pack`);
|
|
86
|
-
if (!existsSync(filePath)) {
|
|
87
|
-
console.error(chalk.red(`❌ Pack not found: ${name}`));
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
const pack = JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
91
|
-
console.error(packToSummary(pack));
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=pack-cmd.js.map
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// Design Ref: stellavault review — 일일 지식 리뷰 (FSRS 기반)
|
|
2
|
-
// Plan SC: "잊어가는 지식 리마인드 → 실제 액션"
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { createInterface } from 'node:readline';
|
|
5
|
-
import { loadConfig, createKnowledgeHub, DecayEngine } from '@stellavault/core';
|
|
6
|
-
export async function reviewCommand(options) {
|
|
7
|
-
const config = loadConfig();
|
|
8
|
-
const hub = createKnowledgeHub(config);
|
|
9
|
-
const count = parseInt(options.count ?? '5', 10);
|
|
10
|
-
console.error(chalk.dim('⏳ Initializing...'));
|
|
11
|
-
await hub.store.initialize();
|
|
12
|
-
const db = hub.store.getDb();
|
|
13
|
-
if (!db) {
|
|
14
|
-
console.error(chalk.red('❌ Cannot access database'));
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
const decayEngine = new DecayEngine(db);
|
|
18
|
-
const decaying = await decayEngine.getDecaying(0.6, count);
|
|
19
|
-
if (decaying.length === 0) {
|
|
20
|
-
console.log(chalk.green('\n✨ 모든 지식이 건강합니다! 리뷰할 노트가 없습니다.'));
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
console.log(chalk.green(`\n🧠 오늘의 리뷰 (${decaying.length}개)`));
|
|
24
|
-
console.log(chalk.dim('─'.repeat(50)));
|
|
25
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
26
|
-
const ask = (q) => new Promise(r => rl.question(q, r));
|
|
27
|
-
let reviewed = 0;
|
|
28
|
-
for (let i = 0; i < decaying.length; i++) {
|
|
29
|
-
const d = decaying[i];
|
|
30
|
-
const elapsed = Math.round((Date.now() - new Date(d.lastAccess).getTime()) / 86400000);
|
|
31
|
-
const rBar = '█'.repeat(Math.round(d.retrievability * 10))
|
|
32
|
-
+ '░'.repeat(10 - Math.round(d.retrievability * 10));
|
|
33
|
-
const color = d.retrievability < 0.3 ? chalk.red : chalk.yellow;
|
|
34
|
-
console.log(`\n${chalk.bold(`[${i + 1}/${decaying.length}]`)} ${chalk.cyan(d.title)}`);
|
|
35
|
-
console.log(` ${color(rBar)} R=${d.retrievability.toFixed(2)} | ${elapsed}일 전`);
|
|
36
|
-
const answer = await ask(chalk.dim(' → [y]열기 [n]스킵 [s]내일 다시 [q]종료: '));
|
|
37
|
-
if (answer.toLowerCase() === 'q') {
|
|
38
|
-
console.log(chalk.dim('\n리뷰 중단.'));
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
if (answer.toLowerCase() === 's') {
|
|
42
|
-
// Snooze: stability를 1일만 살짝 올려서 내일 다시 나오게
|
|
43
|
-
await decayEngine.recordAccess({
|
|
44
|
-
documentId: d.documentId,
|
|
45
|
-
type: 'view',
|
|
46
|
-
timestamp: new Date(Date.now() - 23 * 3600000).toISOString(), // 23시간 전으로 기록
|
|
47
|
-
});
|
|
48
|
-
console.log(chalk.dim(' ⏰ 내일 다시 리마인드'));
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
if (answer.toLowerCase() === 'y') {
|
|
52
|
-
// Obsidian에서 열기
|
|
53
|
-
const relFile = d.filePath
|
|
54
|
-
? d.filePath.replace(/\\/g, '/').replace(/\.md$/, '')
|
|
55
|
-
: d.title;
|
|
56
|
-
let vault = 'Evan';
|
|
57
|
-
try {
|
|
58
|
-
const doc = db.prepare('SELECT file_path FROM documents WHERE id = ?').get(d.documentId);
|
|
59
|
-
if (doc?.file_path) {
|
|
60
|
-
const fp = doc.file_path.replace(/\\/g, '/').replace(/\.md$/, '');
|
|
61
|
-
// vault 이름 = config.vaultPath의 마지막 디렉토리명
|
|
62
|
-
vault = config.vaultPath?.replace(/\\/g, '/').replace(/\/$/, '').split('/').pop() ?? 'Evan';
|
|
63
|
-
const uri = `obsidian://open?vault=${encodeURIComponent(vault)}&file=${encodeURIComponent(fp)}`;
|
|
64
|
-
const open = await import('open');
|
|
65
|
-
await open.default(uri);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch { /* fallback: no open */ }
|
|
69
|
-
// 접근 기록 → stability 업데이트
|
|
70
|
-
await decayEngine.recordAccess({
|
|
71
|
-
documentId: d.documentId,
|
|
72
|
-
type: 'view',
|
|
73
|
-
timestamp: new Date().toISOString(),
|
|
74
|
-
});
|
|
75
|
-
reviewed++;
|
|
76
|
-
console.log(chalk.green(' ✅ 열기 + 기억 강도 업데이트'));
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
console.log(chalk.dim(' ⏭️ 스킵'));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
rl.close();
|
|
83
|
-
console.log(chalk.dim('\n─'.repeat(50)));
|
|
84
|
-
console.log(chalk.green(`리뷰 완료! ${reviewed}/${decaying.length}개 열람`));
|
|
85
|
-
// streak 계산 (access_log에서 연속 일수)
|
|
86
|
-
try {
|
|
87
|
-
const days = db.prepare(`
|
|
88
|
-
SELECT DISTINCT date(accessed_at) as d FROM access_log
|
|
89
|
-
WHERE access_type = 'view'
|
|
90
|
-
ORDER BY d DESC LIMIT 30
|
|
91
|
-
`).all();
|
|
92
|
-
let streak = 0;
|
|
93
|
-
const today = new Date().toISOString().slice(0, 10);
|
|
94
|
-
for (let i = 0; i < days.length; i++) {
|
|
95
|
-
const expected = new Date(Date.now() - i * 86400000).toISOString().slice(0, 10);
|
|
96
|
-
if (days[i]?.d === expected)
|
|
97
|
-
streak++;
|
|
98
|
-
else
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
if (streak > 1) {
|
|
102
|
-
console.log(chalk.yellow(`🔥 ${streak}일 연속 리뷰!`));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
catch { /* streak 실패해도 무시 */ }
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=review-cmd.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { loadConfig, createSqliteVecStore, createLocalEmbedder, createSearchEngine } from '@stellavault/core';
|
|
3
|
-
export async function searchCommand(query, options, cmd) {
|
|
4
|
-
const globalOpts = cmd?.parent?.opts?.() ?? {};
|
|
5
|
-
const jsonMode = globalOpts.json;
|
|
6
|
-
const config = loadConfig();
|
|
7
|
-
const limit = parseInt(options.limit ?? '5', 10);
|
|
8
|
-
const store = createSqliteVecStore(config.dbPath);
|
|
9
|
-
await store.initialize();
|
|
10
|
-
const embedder = createLocalEmbedder(config.embedding.localModel);
|
|
11
|
-
await embedder.initialize();
|
|
12
|
-
const engine = createSearchEngine({ store, embedder, rrfK: config.search.rrfK });
|
|
13
|
-
const results = await engine.search({ query, limit });
|
|
14
|
-
await store.close();
|
|
15
|
-
if (jsonMode) {
|
|
16
|
-
console.log(JSON.stringify({
|
|
17
|
-
query, count: results.length,
|
|
18
|
-
results: results.map(r => ({
|
|
19
|
-
title: r.document.title, path: r.document.filePath,
|
|
20
|
-
score: r.score, heading: r.chunk.heading,
|
|
21
|
-
snippet: r.chunk.content.slice(0, 200),
|
|
22
|
-
})),
|
|
23
|
-
}, null, 2));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (results.length === 0) {
|
|
27
|
-
console.log(chalk.yellow('검색 결과가 없습니다.'));
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
console.log('');
|
|
31
|
-
for (let i = 0; i < results.length; i++) {
|
|
32
|
-
const r = results[i];
|
|
33
|
-
console.log(` ${chalk.bold(`${i + 1}.`)} ${chalk.cyan(`[${r.score.toFixed(3)}]`)} ${chalk.white(r.document.filePath)} ${chalk.dim(`§${r.chunk.heading}`)}`);
|
|
34
|
-
console.log(` ${chalk.dim(r.chunk.content.slice(0, 120).replace(/\n/g, ' '))}...`);
|
|
35
|
-
}
|
|
36
|
-
console.log('');
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=search-cmd.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { loadConfig, createKnowledgeHub } from '@stellavault/core';
|
|
3
|
-
export async function serveCommand() {
|
|
4
|
-
const config = loadConfig();
|
|
5
|
-
const hub = createKnowledgeHub(config);
|
|
6
|
-
await hub.store.initialize();
|
|
7
|
-
await hub.embedder.initialize();
|
|
8
|
-
const stats = await hub.store.getStats();
|
|
9
|
-
console.error(chalk.green('🚀 MCP Server running (stdio mode)'));
|
|
10
|
-
console.error(`📚 ${stats.documentCount} documents | ${stats.chunkCount} chunks`);
|
|
11
|
-
console.error(chalk.dim('💡 Claude Code: claude mcp add stellavault -- stellavault serve'));
|
|
12
|
-
await hub.mcpServer.startStdio();
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=serve-cmd.js.map
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
// stellavault session-save — 세션 요약을 daily log로 자동 저장
|
|
2
|
-
// 카파시 아키텍처: 세션 종료 시 대화의 핵심 결정/교훈/실행항목을 캡처
|
|
3
|
-
// Claude Code hooks의 pre-compact/session-end에서 호출됨
|
|
4
|
-
import chalk from 'chalk';
|
|
5
|
-
import { loadConfig } from '@stellavault/core';
|
|
6
|
-
import { writeFileSync, mkdirSync, existsSync, appendFileSync } from 'node:fs';
|
|
7
|
-
import { resolve, join } from 'node:path';
|
|
8
|
-
export async function sessionSaveCommand(options) {
|
|
9
|
-
const config = loadConfig();
|
|
10
|
-
if (!config.vaultPath) {
|
|
11
|
-
console.error(chalk.red('No vault configured. Run `stellavault init` first.'));
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
14
|
-
const folders = config.folders;
|
|
15
|
-
const logDir = resolve(config.vaultPath, folders.fleeting, '_daily-logs');
|
|
16
|
-
if (!existsSync(logDir))
|
|
17
|
-
mkdirSync(logDir, { recursive: true });
|
|
18
|
-
const now = new Date();
|
|
19
|
-
const dateStr = now.toISOString().split('T')[0];
|
|
20
|
-
const timeStr = now.toTimeString().split(' ')[0];
|
|
21
|
-
const logFile = join(logDir, `daily-log-${dateStr}.md`);
|
|
22
|
-
// stdin에서 요약 읽기 (Claude Code hook에서 파이프로 전달)
|
|
23
|
-
let summary = options.summary ?? '';
|
|
24
|
-
if (!summary && !process.stdin.isTTY) {
|
|
25
|
-
const chunks = [];
|
|
26
|
-
for await (const chunk of process.stdin) {
|
|
27
|
-
chunks.push(chunk);
|
|
28
|
-
}
|
|
29
|
-
summary = Buffer.concat(chunks).toString('utf-8').trim();
|
|
30
|
-
}
|
|
31
|
-
if (!summary) {
|
|
32
|
-
// 대화형: 직접 입력
|
|
33
|
-
console.log(chalk.dim('Enter session summary (Ctrl+D to finish):'));
|
|
34
|
-
const chunks = [];
|
|
35
|
-
for await (const chunk of process.stdin) {
|
|
36
|
-
chunks.push(chunk);
|
|
37
|
-
}
|
|
38
|
-
summary = Buffer.concat(chunks).toString('utf-8').trim();
|
|
39
|
-
}
|
|
40
|
-
if (!summary) {
|
|
41
|
-
console.error(chalk.yellow('No summary provided. Skipping.'));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
// daily log 엔트리 구성
|
|
45
|
-
const entry = [
|
|
46
|
-
'',
|
|
47
|
-
`## Session — ${timeStr}`,
|
|
48
|
-
'',
|
|
49
|
-
'### Summary',
|
|
50
|
-
summary,
|
|
51
|
-
'',
|
|
52
|
-
];
|
|
53
|
-
if (options.decisions) {
|
|
54
|
-
entry.push('### Decisions', options.decisions, '');
|
|
55
|
-
}
|
|
56
|
-
if (options.lessons) {
|
|
57
|
-
entry.push('### Lessons Learned', options.lessons, '');
|
|
58
|
-
}
|
|
59
|
-
if (options.actions) {
|
|
60
|
-
entry.push('### Action Items', options.actions, '');
|
|
61
|
-
}
|
|
62
|
-
entry.push('---', '');
|
|
63
|
-
// 파일이 없으면 헤더 생성, 있으면 append
|
|
64
|
-
if (!existsSync(logFile)) {
|
|
65
|
-
const header = [
|
|
66
|
-
'---',
|
|
67
|
-
`title: "Daily Log — ${dateStr}"`,
|
|
68
|
-
'type: fleeting',
|
|
69
|
-
'tags: ["daily-log", "session"]',
|
|
70
|
-
`created: ${now.toISOString()}`,
|
|
71
|
-
'---',
|
|
72
|
-
'',
|
|
73
|
-
`# Daily Log — ${dateStr}`,
|
|
74
|
-
'',
|
|
75
|
-
].join('\n');
|
|
76
|
-
writeFileSync(logFile, header + entry.join('\n'), 'utf-8');
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
appendFileSync(logFile, entry.join('\n'), 'utf-8');
|
|
80
|
-
}
|
|
81
|
-
console.log(chalk.green(`Session saved to daily log: ${dateStr}`));
|
|
82
|
-
console.log(chalk.dim(` File: ${logFile}`));
|
|
83
|
-
console.log(chalk.dim(` Time: ${timeStr}`));
|
|
84
|
-
console.log(chalk.dim(` Words: ${summary.split(/\s+/).length}`));
|
|
85
|
-
// 자동 compile 트리거
|
|
86
|
-
try {
|
|
87
|
-
const { compileWiki } = await import('@stellavault/core/intelligence/wiki-compiler');
|
|
88
|
-
const rawDir = resolve(config.vaultPath, folders.fleeting);
|
|
89
|
-
const wikiDir = resolve(config.vaultPath, folders.wiki);
|
|
90
|
-
compileWiki(rawDir, wikiDir);
|
|
91
|
-
console.log(chalk.dim(' Wiki: auto-compiled'));
|
|
92
|
-
}
|
|
93
|
-
catch { /* compile 실패해도 저장은 성공 */ }
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=session-cmd.js.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { loadConfig, createSqliteVecStore } from '@stellavault/core';
|
|
3
|
-
export async function statusCommand(_opts, cmd) {
|
|
4
|
-
const globalOpts = cmd?.parent?.opts?.() ?? {};
|
|
5
|
-
const jsonMode = globalOpts.json;
|
|
6
|
-
const config = loadConfig();
|
|
7
|
-
const store = createSqliteVecStore(config.dbPath);
|
|
8
|
-
await store.initialize();
|
|
9
|
-
const stats = await store.getStats();
|
|
10
|
-
const topics = await store.getTopics();
|
|
11
|
-
await store.close();
|
|
12
|
-
if (jsonMode) {
|
|
13
|
-
console.log(JSON.stringify({ ...stats, vaultPath: config.vaultPath, dbPath: config.dbPath, topics: topics.slice(0, 20) }, null, 2));
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
console.log('');
|
|
17
|
-
console.log(chalk.bold('📊 Stellavault Status'));
|
|
18
|
-
console.log('─'.repeat(40));
|
|
19
|
-
console.log(` 📄 Documents: ${stats.documentCount}`);
|
|
20
|
-
console.log(` 🧩 Chunks: ${stats.chunkCount}`);
|
|
21
|
-
console.log(` 🕐 Last indexed: ${stats.lastIndexed ?? 'never'}`);
|
|
22
|
-
console.log(` 💾 DB: ${config.dbPath}`);
|
|
23
|
-
console.log(` 📁 Vault: ${config.vaultPath || '(not set)'}`);
|
|
24
|
-
if (topics.length > 0) {
|
|
25
|
-
console.log('');
|
|
26
|
-
console.log(chalk.bold('🏷️ Top topics:'));
|
|
27
|
-
topics.slice(0, 10).forEach((t) => {
|
|
28
|
-
console.log(` #${t.topic} (${t.count})`);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
console.log('');
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=status-cmd.js.map
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Design Ref: stellavault sync — Notion↔Obsidian 동기화 CLI 통합
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { spawn } from 'node:child_process';
|
|
4
|
-
import { resolve } from 'node:path';
|
|
5
|
-
import { existsSync } from 'node:fs';
|
|
6
|
-
export async function syncCommand(options) {
|
|
7
|
-
const syncDir = resolve(process.cwd(), 'packages/sync');
|
|
8
|
-
const syncScript = resolve(syncDir, 'sync-to-obsidian.mjs');
|
|
9
|
-
if (!existsSync(syncScript)) {
|
|
10
|
-
console.error(chalk.red('❌ packages/sync/sync-to-obsidian.mjs not found'));
|
|
11
|
-
console.error(chalk.dim(' Run from project root: cd notion-obsidian-sync'));
|
|
12
|
-
process.exit(1);
|
|
13
|
-
}
|
|
14
|
-
// .env 확인
|
|
15
|
-
const envFile = resolve(syncDir, '.env');
|
|
16
|
-
if (!existsSync(envFile)) {
|
|
17
|
-
console.error(chalk.red('❌ packages/sync/.env not found'));
|
|
18
|
-
console.error(chalk.dim(' Copy .env.example → .env and set NOTION_TOKEN'));
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
if (options.upload) {
|
|
22
|
-
// PDCA 문서 → Notion 업로드
|
|
23
|
-
const uploadScript = resolve(syncDir, 'upload-pdca-to-notion.mjs');
|
|
24
|
-
if (!existsSync(uploadScript)) {
|
|
25
|
-
console.error(chalk.red('❌ upload-pdca-to-notion.mjs not found'));
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
console.error(chalk.dim('📤 Uploading PDCA documents to Notion...'));
|
|
29
|
-
await runScript(uploadScript, syncDir);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// Notion → Obsidian 동기화
|
|
33
|
-
console.error(chalk.dim('🔄 Syncing Notion → Obsidian...'));
|
|
34
|
-
await runScript(syncScript, syncDir);
|
|
35
|
-
if (options.watch) {
|
|
36
|
-
console.error(chalk.green('👀 Watch mode — syncing every 5 minutes'));
|
|
37
|
-
setInterval(async () => {
|
|
38
|
-
console.error(chalk.dim(`🔄 [${new Date().toLocaleTimeString()}] Re-syncing...`));
|
|
39
|
-
await runScript(syncScript, syncDir);
|
|
40
|
-
}, 5 * 60 * 1000);
|
|
41
|
-
// Keep alive
|
|
42
|
-
process.stdin.resume();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function runScript(scriptPath, cwd) {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
const child = spawn('node', [scriptPath], {
|
|
49
|
-
cwd,
|
|
50
|
-
stdio: 'inherit',
|
|
51
|
-
shell: true,
|
|
52
|
-
});
|
|
53
|
-
child.on('close', (code) => {
|
|
54
|
-
if (code === 0)
|
|
55
|
-
resolve();
|
|
56
|
-
else
|
|
57
|
-
reject(new Error(`Script exited with code ${code}`));
|
|
58
|
-
});
|
|
59
|
-
child.on('error', reject);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=sync-cmd.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare function vaultAddCommand(id: string, vaultPath: string, options: {
|
|
2
|
-
name?: string;
|
|
3
|
-
shared?: boolean;
|
|
4
|
-
}): Promise<void>;
|
|
5
|
-
export declare function vaultListCommand(): Promise<void>;
|
|
6
|
-
export declare function vaultRemoveCommand(id: string): Promise<void>;
|
|
7
|
-
export declare function vaultSearchAllCommand(query: string, options: {
|
|
8
|
-
limit?: string;
|
|
9
|
-
}): Promise<void>;
|
|
10
|
-
//# sourceMappingURL=vault-cmd.d.ts.map
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// sv vault add/list/remove/search-all — Cross-Vault (P3)
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { addVault, removeVault, listVaults, searchAllVaults, loadConfig, createSqliteVecStore, createLocalEmbedder } from '@stellavault/core';
|
|
4
|
-
export async function vaultAddCommand(id, vaultPath, options) {
|
|
5
|
-
const config = loadConfig();
|
|
6
|
-
const dbPath = vaultPath.replace(/\/$/, '') + '/.stellavault/index.db';
|
|
7
|
-
try {
|
|
8
|
-
const entry = addVault(id, options.name ?? id, vaultPath, dbPath, !!options.shared);
|
|
9
|
-
console.log(chalk.green(`\n ✅ Vault "${entry.name}" added (${entry.id})`));
|
|
10
|
-
console.log(chalk.dim(` Path: ${entry.path}\n DB: ${entry.dbPath}\n`));
|
|
11
|
-
}
|
|
12
|
-
catch (err) {
|
|
13
|
-
console.log(chalk.red(`\n ❌ ${err instanceof Error ? err.message : err}\n`));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export async function vaultListCommand() {
|
|
17
|
-
const vaults = listVaults();
|
|
18
|
-
if (vaults.length === 0) {
|
|
19
|
-
console.log(chalk.yellow('\n No vaults registered. Use: sv vault add <id> <path>\n'));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
console.log(chalk.bold('\n Registered Vaults'));
|
|
23
|
-
for (const v of vaults) {
|
|
24
|
-
console.log(` ${chalk.cyan(v.id)} ${v.name} ${chalk.dim(`(${v.path})`)}`);
|
|
25
|
-
}
|
|
26
|
-
console.log('');
|
|
27
|
-
}
|
|
28
|
-
export async function vaultRemoveCommand(id) {
|
|
29
|
-
if (removeVault(id)) {
|
|
30
|
-
console.log(chalk.green(`\n ✅ Vault "${id}" removed\n`));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
console.log(chalk.red(`\n ❌ Vault "${id}" not found\n`));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export async function vaultSearchAllCommand(query, options) {
|
|
37
|
-
const config = loadConfig();
|
|
38
|
-
const embedder = createLocalEmbedder(config.embedding.localModel);
|
|
39
|
-
await embedder.initialize();
|
|
40
|
-
console.log(chalk.dim(`\n Searching all vaults for "${query}"...`));
|
|
41
|
-
const results = await searchAllVaults(query, embedder, (dbPath) => createSqliteVecStore(dbPath), { limit: parseInt(options.limit ?? '10', 10) });
|
|
42
|
-
if (results.length === 0) {
|
|
43
|
-
console.log(chalk.yellow(' No results across vaults.\n'));
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
for (const r of results) {
|
|
47
|
-
const pct = Math.round(r.score * 100);
|
|
48
|
-
const color = pct >= 70 ? chalk.green : pct >= 40 ? chalk.yellow : chalk.dim;
|
|
49
|
-
console.log(` ${color(`${pct}%`)} ${chalk.bold(r.title)} ${chalk.dim(`[${r.vaultName}]`)}`);
|
|
50
|
-
console.log(` ${chalk.dim(r.snippet)}...`);
|
|
51
|
-
}
|
|
52
|
-
console.log('');
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=vault-cmd.js.map
|