org-qmd 0.1.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/CHANGELOG.md +529 -0
- package/LICENSE +21 -0
- package/README.md +917 -0
- package/bin/qmd +32 -0
- package/dist/ast.d.ts +64 -0
- package/dist/ast.js +324 -0
- package/dist/cli/formatter.d.ts +120 -0
- package/dist/cli/formatter.js +350 -0
- package/dist/cli/qmd.d.ts +1 -0
- package/dist/cli/qmd.js +2820 -0
- package/dist/collections.d.ts +146 -0
- package/dist/collections.js +385 -0
- package/dist/db.d.ts +41 -0
- package/dist/db.js +75 -0
- package/dist/embedded-skills.d.ts +6 -0
- package/dist/embedded-skills.js +14 -0
- package/dist/index.d.ts +226 -0
- package/dist/index.js +234 -0
- package/dist/llm.d.ts +406 -0
- package/dist/llm.js +1174 -0
- package/dist/maintenance.d.ts +23 -0
- package/dist/maintenance.js +37 -0
- package/dist/mcp/server.d.ts +21 -0
- package/dist/mcp/server.js +653 -0
- package/dist/store.d.ts +993 -0
- package/dist/store.js +3806 -0
- package/package.json +101 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maintenance - Database cleanup operations for QMD.
|
|
3
|
+
*
|
|
4
|
+
* Wraps low-level store operations that the CLI needs for housekeeping.
|
|
5
|
+
* Takes an internal Store in the constructor — allowed to access DB directly.
|
|
6
|
+
*/
|
|
7
|
+
import type { Store } from "./store.js";
|
|
8
|
+
export declare class Maintenance {
|
|
9
|
+
private store;
|
|
10
|
+
constructor(store: Store);
|
|
11
|
+
/** Run VACUUM on the SQLite database to reclaim space */
|
|
12
|
+
vacuum(): void;
|
|
13
|
+
/** Remove content rows that are no longer referenced by any document */
|
|
14
|
+
cleanupOrphanedContent(): number;
|
|
15
|
+
/** Remove vector embeddings for content that no longer exists */
|
|
16
|
+
cleanupOrphanedVectors(): number;
|
|
17
|
+
/** Clear the LLM response cache (query expansion, reranking) */
|
|
18
|
+
clearLLMCache(): number;
|
|
19
|
+
/** Delete documents marked as inactive (removed from filesystem) */
|
|
20
|
+
deleteInactiveDocs(): number;
|
|
21
|
+
/** Clear all vector embeddings (forces re-embedding) */
|
|
22
|
+
clearEmbeddings(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maintenance - Database cleanup operations for QMD.
|
|
3
|
+
*
|
|
4
|
+
* Wraps low-level store operations that the CLI needs for housekeeping.
|
|
5
|
+
* Takes an internal Store in the constructor — allowed to access DB directly.
|
|
6
|
+
*/
|
|
7
|
+
import { vacuumDatabase, cleanupOrphanedContent, cleanupOrphanedVectors, deleteLLMCache, deleteInactiveDocuments, clearAllEmbeddings, } from "./store.js";
|
|
8
|
+
export class Maintenance {
|
|
9
|
+
store;
|
|
10
|
+
constructor(store) {
|
|
11
|
+
this.store = store;
|
|
12
|
+
}
|
|
13
|
+
/** Run VACUUM on the SQLite database to reclaim space */
|
|
14
|
+
vacuum() {
|
|
15
|
+
vacuumDatabase(this.store.db);
|
|
16
|
+
}
|
|
17
|
+
/** Remove content rows that are no longer referenced by any document */
|
|
18
|
+
cleanupOrphanedContent() {
|
|
19
|
+
return cleanupOrphanedContent(this.store.db);
|
|
20
|
+
}
|
|
21
|
+
/** Remove vector embeddings for content that no longer exists */
|
|
22
|
+
cleanupOrphanedVectors() {
|
|
23
|
+
return cleanupOrphanedVectors(this.store.db);
|
|
24
|
+
}
|
|
25
|
+
/** Clear the LLM response cache (query expansion, reranking) */
|
|
26
|
+
clearLLMCache() {
|
|
27
|
+
return deleteLLMCache(this.store.db);
|
|
28
|
+
}
|
|
29
|
+
/** Delete documents marked as inactive (removed from filesystem) */
|
|
30
|
+
deleteInactiveDocs() {
|
|
31
|
+
return deleteInactiveDocuments(this.store.db);
|
|
32
|
+
}
|
|
33
|
+
/** Clear all vector embeddings (forces re-embedding) */
|
|
34
|
+
clearEmbeddings() {
|
|
35
|
+
clearAllEmbeddings(this.store.db);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QMD MCP Server - Model Context Protocol server for QMD
|
|
3
|
+
*
|
|
4
|
+
* Exposes QMD search and document retrieval as MCP tools and resources.
|
|
5
|
+
* Documents are accessible via qmd:// URIs.
|
|
6
|
+
*
|
|
7
|
+
* Follows MCP spec 2025-06-18 for proper response types.
|
|
8
|
+
*/
|
|
9
|
+
export declare function startMcpServer(): Promise<void>;
|
|
10
|
+
export type HttpServerHandle = {
|
|
11
|
+
httpServer: import("http").Server;
|
|
12
|
+
port: number;
|
|
13
|
+
stop: () => Promise<void>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Start MCP server over Streamable HTTP (JSON responses, no SSE).
|
|
17
|
+
* Binds to localhost only. Returns a handle for shutdown and port discovery.
|
|
18
|
+
*/
|
|
19
|
+
export declare function startMcpHttpServer(port: number, options?: {
|
|
20
|
+
quiet?: boolean;
|
|
21
|
+
}): Promise<HttpServerHandle>;
|