@anokye-labs/kbexplorer-engine 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.
@@ -0,0 +1,37 @@
1
+ import { E as EngineEnv, R as RepoSource, d as RepoData } from './repo-data-0JvFdLGv.cjs';
2
+ import { GraphStore, GraphStoreCacheKey, GraphStoreEntry, GraphStoreWrite, GraphStoreInvalidation, KBConfig, ContentHash, KBGraph } from '@anokye-labs/kbexplorer-core';
3
+ import { P as ProviderResult, S as SqliteByteStore, a as ProviderRegistry, T as TransformContext, b as GraphTransform } from './sqlite-runtime-CysPjjzX.cjs';
4
+ export { I as IndexedDbSqliteByteStore, M as MemorySqliteByteStore, l as loadSqlJs, o as openPersistedDatabase } from './sqlite-runtime-CysPjjzX.cjs';
5
+ import 'sql.js';
6
+
7
+ type GraphStoreMode = 'off' | 'sqlite';
8
+ interface GraphStoreOptions {
9
+ mode: GraphStoreMode;
10
+ }
11
+ declare function resolveGraphStoreOptions(env?: EngineEnv): GraphStoreOptions;
12
+ declare function isGraphStoreEnabled(env?: EngineEnv): boolean;
13
+
14
+ declare class SQLiteGraphStore<Value = ProviderResult> implements GraphStore<Value> {
15
+ private readonly db;
16
+ private readonly persist;
17
+ private constructor();
18
+ static create<Value = ProviderResult>(byteStore?: SqliteByteStore, locateFile?: (file: string) => string): Promise<SQLiteGraphStore<Value>>;
19
+ get(key: GraphStoreCacheKey): Promise<GraphStoreEntry<Value> | undefined>;
20
+ put(entry: GraphStoreWrite<Value>): Promise<void>;
21
+ delete(key: GraphStoreCacheKey): Promise<boolean>;
22
+ invalidate(match: GraphStoreInvalidation): Promise<number>;
23
+ private migrate;
24
+ private setMetadata;
25
+ private selectEntry;
26
+ private selectEntries;
27
+ private countEntries;
28
+ }
29
+
30
+ declare const GRAPH_STORE_DERIVATION_VERSION = "template-graph-derivation-v3";
31
+ declare const GRAPH_STORE_PROVIDER_ID = "provider-pipeline";
32
+ declare function buildProviderResultCacheKey(source: RepoSource, config: KBConfig, data: RepoData, providerId?: string, previousContentHash?: ContentHash): Promise<GraphStoreCacheKey>;
33
+
34
+ type ProviderCacheKeyBuilder = (providerId: string, previousContentHash: GraphStoreCacheKey['contentHash'] | undefined) => Promise<GraphStoreCacheKey>;
35
+ declare function orchestrateWithProviderResultStore(registry: ProviderRegistry, config: KBConfig, ctx: TransformContext, store: GraphStore<ProviderResult>, buildCacheKey: ProviderCacheKeyBuilder, transforms?: readonly GraphTransform[]): Promise<KBGraph>;
36
+
37
+ export { GRAPH_STORE_DERIVATION_VERSION, GRAPH_STORE_PROVIDER_ID, type GraphStoreMode, type GraphStoreOptions, type ProviderCacheKeyBuilder, SQLiteGraphStore, SqliteByteStore, buildProviderResultCacheKey, isGraphStoreEnabled, orchestrateWithProviderResultStore, resolveGraphStoreOptions };
@@ -0,0 +1,37 @@
1
+ import { E as EngineEnv, R as RepoSource, d as RepoData } from './repo-data-0JvFdLGv.js';
2
+ import { GraphStore, GraphStoreCacheKey, GraphStoreEntry, GraphStoreWrite, GraphStoreInvalidation, KBConfig, ContentHash, KBGraph } from '@anokye-labs/kbexplorer-core';
3
+ import { P as ProviderResult, S as SqliteByteStore, a as ProviderRegistry, T as TransformContext, b as GraphTransform } from './sqlite-runtime-CysPjjzX.js';
4
+ export { I as IndexedDbSqliteByteStore, M as MemorySqliteByteStore, l as loadSqlJs, o as openPersistedDatabase } from './sqlite-runtime-CysPjjzX.js';
5
+ import 'sql.js';
6
+
7
+ type GraphStoreMode = 'off' | 'sqlite';
8
+ interface GraphStoreOptions {
9
+ mode: GraphStoreMode;
10
+ }
11
+ declare function resolveGraphStoreOptions(env?: EngineEnv): GraphStoreOptions;
12
+ declare function isGraphStoreEnabled(env?: EngineEnv): boolean;
13
+
14
+ declare class SQLiteGraphStore<Value = ProviderResult> implements GraphStore<Value> {
15
+ private readonly db;
16
+ private readonly persist;
17
+ private constructor();
18
+ static create<Value = ProviderResult>(byteStore?: SqliteByteStore, locateFile?: (file: string) => string): Promise<SQLiteGraphStore<Value>>;
19
+ get(key: GraphStoreCacheKey): Promise<GraphStoreEntry<Value> | undefined>;
20
+ put(entry: GraphStoreWrite<Value>): Promise<void>;
21
+ delete(key: GraphStoreCacheKey): Promise<boolean>;
22
+ invalidate(match: GraphStoreInvalidation): Promise<number>;
23
+ private migrate;
24
+ private setMetadata;
25
+ private selectEntry;
26
+ private selectEntries;
27
+ private countEntries;
28
+ }
29
+
30
+ declare const GRAPH_STORE_DERIVATION_VERSION = "template-graph-derivation-v3";
31
+ declare const GRAPH_STORE_PROVIDER_ID = "provider-pipeline";
32
+ declare function buildProviderResultCacheKey(source: RepoSource, config: KBConfig, data: RepoData, providerId?: string, previousContentHash?: ContentHash): Promise<GraphStoreCacheKey>;
33
+
34
+ type ProviderCacheKeyBuilder = (providerId: string, previousContentHash: GraphStoreCacheKey['contentHash'] | undefined) => Promise<GraphStoreCacheKey>;
35
+ declare function orchestrateWithProviderResultStore(registry: ProviderRegistry, config: KBConfig, ctx: TransformContext, store: GraphStore<ProviderResult>, buildCacheKey: ProviderCacheKeyBuilder, transforms?: readonly GraphTransform[]): Promise<KBGraph>;
36
+
37
+ export { GRAPH_STORE_DERIVATION_VERSION, GRAPH_STORE_PROVIDER_ID, type GraphStoreMode, type GraphStoreOptions, type ProviderCacheKeyBuilder, SQLiteGraphStore, SqliteByteStore, buildProviderResultCacheKey, isGraphStoreEnabled, orchestrateWithProviderResultStore, resolveGraphStoreOptions };
package/dist/store.js ADDED
@@ -0,0 +1,7 @@
1
+ export { isGraphStoreEnabled, resolveGraphStoreOptions } from './chunk-BA526FDQ.js';
2
+ export { IndexedDbSqliteByteStore, MemorySqliteByteStore, SQLiteGraphStore, loadSqlJs, openPersistedDatabase } from './chunk-IWEURXYH.js';
3
+ export { orchestrateWithProviderResultStore } from './chunk-YTMIERYM.js';
4
+ import './chunk-DJ2DBEEK.js';
5
+ import './chunk-FJ4GTN4U.js';
6
+ import './chunk-JNQVSNLC.js';
7
+ export { GRAPH_STORE_DERIVATION_VERSION, GRAPH_STORE_PROVIDER_ID, buildProviderResultCacheKey } from './chunk-HXAS3BSD.js';
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@anokye-labs/kbexplorer-engine",
3
+ "version": "0.1.0",
4
+ "description": "Scaffolded kbexplorer engine package with runtime-agnostic placeholder entry points for orchestration, sources, and store integration.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/anokye-labs/kbexplorer-engine.git"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "type": "module",
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "main": "./dist/index.cjs",
23
+ "module": "./dist/index.js",
24
+ "types": "./dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "import": "./dist/index.js",
29
+ "require": "./dist/index.cjs"
30
+ },
31
+ "./sources": {
32
+ "types": "./dist/sources.d.ts",
33
+ "import": "./dist/sources.js",
34
+ "require": "./dist/sources.cjs"
35
+ },
36
+ "./store": {
37
+ "types": "./dist/store.d.ts",
38
+ "import": "./dist/store.js",
39
+ "require": "./dist/store.cjs"
40
+ }
41
+ },
42
+ "scripts": {
43
+ "build": "tsup",
44
+ "typecheck": "tsc --noEmit",
45
+ "test": "vitest run",
46
+ "prepare": "npm run build",
47
+ "prepack": "npm run build"
48
+ },
49
+ "dependencies": {
50
+ "@anokye-labs/kbexplorer-core": "^0.5.1",
51
+ "@anokye-labs/kbexplorer-provider-rich-markdown": "^0.1.2",
52
+ "marked": "^18.0.0",
53
+ "sanitize-html": "^2.17.5",
54
+ "sql.js": "^1.13.0",
55
+ "yaml": "^2.6.0"
56
+ },
57
+ "devDependencies": {
58
+ "@anokye-labs/kbexplorer-example-quotes": "file:examples/quotes-provider",
59
+ "@types/node": "^24.0.0",
60
+ "@types/sanitize-html": "^2.16.1",
61
+ "@types/sql.js": "^1.4.11",
62
+ "jsdom": "^26.0.0",
63
+ "tsup": "^8.5.0",
64
+ "typescript": "^5.7.2",
65
+ "vitest": "^4.1.9"
66
+ },
67
+ "overrides": {
68
+ "esbuild": "^0.28.1"
69
+ }
70
+ }