{"_id":"@anokye-labs/kbexplorer-engine","_rev":"2-44caa0a995bedba69472555ab08b40bb","name":"@anokye-labs/kbexplorer-engine","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@anokye-labs/kbexplorer-engine","version":"0.1.0","license":"MIT","_id":"@anokye-labs/kbexplorer-engine@0.1.0","maintainers":[{"name":"hoopsomuah","email":"hoop@somuah.com"}],"homepage":"https://github.com/anokye-labs/kbexplorer-engine#readme","bugs":{"url":"https://github.com/anokye-labs/kbexplorer-engine/issues"},"dist":{"shasum":"68a8b68b6f83f515e1ac90240d88fd108a900135","tarball":"https://registry.npmjs.org/@anokye-labs/kbexplorer-engine/-/kbexplorer-engine-0.1.0.tgz","fileCount":37,"integrity":"sha512-vvMq/5ILBGW+f8EO+KGgpi3TOIJkLlAN1hloc9GhR5FdwxWgxB3E8c9BZiDb1MH0GwV38OoyIWQ4AZk6qxfUnQ==","signatures":[{"sig":"MEQCIDQ79/OV0QKE/K3uyl1+zcivL0CeTgD9xCdHHk3nuD43AiB5D14fvjeN4TFPb57XF6DOSiKclhBUvawWMrfNJvOkig==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":763173},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./store":{"types":"./dist/store.d.ts","import":"./dist/store.js","require":"./dist/store.cjs"},"./sources":{"types":"./dist/sources.d.ts","import":"./dist/sources.js","require":"./dist/sources.cjs"}},"gitHead":"9336273cad36b0b1303afe6f1d8c3f20fe4d6892","scripts":{"test":"vitest run","build":"tsup","prepack":"npm run build","prepare":"npm run build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"hoopsomuah","email":"hoop@somuah.com"},"overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/anokye-labs/kbexplorer-engine.git","type":"git"},"_npmVersion":"11.16.0","description":"Scaffolded kbexplorer engine package with runtime-agnostic placeholder entry points for orchestration, sources, and store integration.","directories":{},"_nodeVersion":"26.3.0","dependencies":{"yaml":"^2.6.0","marked":"^18.0.0","sql.js":"^1.13.0","sanitize-html":"^2.17.5","@anokye-labs/kbexplorer-core":"^0.5.1","@anokye-labs/kbexplorer-provider-rich-markdown":"^0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","jsdom":"^26.0.0","vitest":"^4.1.9","typescript":"^5.7.2","@types/node":"^24.0.0","@types/sql.js":"^1.4.11","@types/sanitize-html":"^2.16.1","@anokye-labs/kbexplorer-example-quotes":"file:examples/quotes-provider"},"_npmOperationalInternal":{"tmp":"tmp/kbexplorer-engine_0.1.0_1785021716892_0.015410596609005234","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@anokye-labs/kbexplorer-engine@0.1.1","bugs":{"url":"https://github.com/anokye-labs/kbexplorer-engine/issues"},"dist":{"shasum":"4057cd096119fe4630c7b8d72b71fc302b184e91","tarball":"https://registry.npmjs.org/@anokye-labs/kbexplorer-engine/-/kbexplorer-engine-0.1.1.tgz","integrity":"sha512-Py2wvWfQ2b90UtlTUHsK+wruMyuNu+ffUOjb6Scvj+fERalVjVX1pseye4bX5laT2b6rGylXzxyQoZ/iKQG73A==","fileCount":37,"unpackedSize":763173,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@anokye-labs%2fkbexplorer-engine@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCt6aDOIj1plfUYEWR49JJl3zSZZqf14rsmdUWgFwZzowIhAO065FgIAzxMKQvhAKA6v5fGohxt0bn3c9MQnuhZXUp5"}]},"main":"./dist/index.cjs","name":"@anokye-labs/kbexplorer-engine","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./store":{"types":"./dist/store.d.ts","import":"./dist/store.js","require":"./dist/store.cjs"},"./sources":{"types":"./dist/sources.d.ts","import":"./dist/sources.js","require":"./dist/sources.cjs"}},"gitHead":"e6bcc588d58495114e5aac9be93325647bab04e0","license":"MIT","scripts":{"test":"vitest run","build":"tsup","prepack":"npm run build","prepare":"npm run build","typecheck":"tsc --noEmit"},"version":"0.1.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:18a8c5d4-d3ca-41cd-9f1e-21aea15892b8"},"approver":{"name":"hoopsomuah","email":"hoop@somuah.com"}},"homepage":"https://github.com/anokye-labs/kbexplorer-engine#readme","overrides":{"esbuild":"^0.28.1"},"repository":{"url":"git+https://github.com/anokye-labs/kbexplorer-engine.git","type":"git"},"_npmVersion":"12.0.2","description":"Scaffolded kbexplorer engine package with runtime-agnostic placeholder entry points for orchestration, sources, and store integration.","directories":{},"maintainers":[{"name":"hoopsomuah","email":"hoop@somuah.com"}],"_nodeVersion":"22.23.2","dependencies":{"yaml":"^2.6.0","marked":"^18.0.0","sql.js":"^1.13.0","sanitize-html":"^2.17.5","@anokye-labs/kbexplorer-core":"^0.6.0","@anokye-labs/kbexplorer-provider-rich-markdown":"^0.1.3"},"publishConfig":{"access":"public"},"devDependencies":{"tsup":"^8.5.0","jsdom":"^26.0.0","vitest":"^4.1.9","typescript":"^5.7.2","@types/node":"^24.0.0","@types/sql.js":"^1.4.11","@types/sanitize-html":"^2.16.1","@anokye-labs/kbexplorer-example-quotes":"file:examples/quotes-provider"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kbexplorer-engine_0.1.1_1789030415262_0.005600223117695924"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-25T23:21:56.744Z","modified":"2026-09-10T08:53:35.768Z","0.1.0":"2026-07-25T23:21:57.099Z","0.1.1":"2026-09-10T08:53:35.413Z"},"bugs":{"url":"https://github.com/anokye-labs/kbexplorer-engine/issues"},"license":"MIT","homepage":"https://github.com/anokye-labs/kbexplorer-engine#readme","repository":{"url":"git+https://github.com/anokye-labs/kbexplorer-engine.git","type":"git"},"description":"Scaffolded kbexplorer engine package with runtime-agnostic placeholder entry points for orchestration, sources, and store integration.","maintainers":[{"name":"hoopsomuah","email":"hoop@somuah.com"}],"readme":"# @anokye-labs/kbexplorer-engine\n\nThe runtime-agnostic engine for kbexplorer: it turns a knowledge-base source\n(a manifest, the GitHub API, or a local directory) into a computed `KBGraph`,\nand provides a small scriptable query API over that graph. The core (`.`) entry\nstays portable across Node and browser-like environments; Node-specific pieces\n(like `FileSystemSource`) live behind the `./sources` subpath.\n\n## Develop\n\n```bash\nnpm install\nnpm run typecheck\nnpm run build\nnpm test\n```\n\n## Package shape\n\n- `.` — the engine core: graph building (`buildGraph`), the unified loader\n  (`loadKnowledgeBase`), the query helpers, providers, parsing, identity, and\n  supporting types.\n- `./sources` — source adapters (`ManifestSource`, `GitHubApiSource`,\n  `FileSystemSource`) and the `RepoSource` / `RepoData` contracts.\n- `./store` — the optional sqlite-backed graph store entry point.\n\n## Loading a knowledge base\n\n`loadKnowledgeBase` has two call shapes, distinguished by the first argument:\n\n```ts\nimport { loadKnowledgeBase } from '@anokye-labs/kbexplorer-engine';\nimport { GitHubApiSource, FileSystemSource } from '@anokye-labs/kbexplorer-engine/sources';\n\n// Config-first (scripting): returns a bare KBGraph.\n// With no `source`, a GitHubApiSource is built from config.source.\nconst graph = await loadKnowledgeBase(config);\nconst localGraph = await loadKnowledgeBase(config, { source: new FileSystemSource('./my-kb') });\n\n// Positional (advanced): returns { graph, config }. This is the SHA-pinned\n// contract consumed by kbexplorer-template — it is unchanged.\nconst { graph: g, config: c } = await loadKnowledgeBase(new GitHubApiSource(config.source), config);\n```\n\nThe two forms differ only in ergonomics and return shape; the positional form\nis fully preserved.\n\n## Query API\n\nPure, runtime-agnostic helpers over a computed `KBGraph`:\n\n```ts\nimport {\n  getNode, findNodes, neighbors, related, subgraph, shortestPath,\n} from '@anokye-labs/kbexplorer-engine';\n\ngetNode(graph, 'home');                         // KBNode | undefined\nfindNodes(graph, n => n.cluster === 'engine');  // KBNode[]\nneighbors(graph, 'home', { direction: 'out' }); // KBNode[]\nrelated(graph, 'home');                          // KBNode[] (precomputed index)\nsubgraph(graph, 'home', { radius: 2 });          // KBGraph neighborhood\nshortestPath(graph, 'home', 'loader');           // string[] | null\n```\n\n## Sources\n\n- `ManifestSource(manifest, config)` — a frozen, pre-built snapshot.\n- `GitHubApiSource(sourceConfig)` — the live GitHub API.\n- `FileSystemSource(rootDir, options?)` — **Node-only** adapter that walks a\n  local directory into the same `RepoData` bundle a manifest yields (authored\n  `content/`, `.github` structural files, `content-model/`, README).\n\n## Recipes\n\nRunnable examples of the scriptable API against an in-repo fixture live in\n[`docs/recipes.md`](./docs/recipes.md). CI builds the package and runs all eight\nscripts on every pull request.\n","readmeFilename":"README.md"}