bluera-knowledge 0.11.9 → 0.11.10

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.11.9",
3
+ "version": "0.11.10",
4
4
  "description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents.",
5
5
  "mcpServers": {
6
6
  "bluera-knowledge": {
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.11.10](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.10) (2026-01-10)
6
+
7
+
8
+ ### Features
9
+
10
+ * **scripts:** add post-release npm validation script ([e4c29a0](https://github.com/blueraai/bluera-knowledge/commit/e4c29a0c83907de4bc293a69a58412629457fb22))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **cli:** plugin-api commands now respect global options ([d3cca02](https://github.com/blueraai/bluera-knowledge/commit/d3cca02ffc679ffc187b76c7682f3cc177eabdea))
16
+ * **plugin:** properly close services after command execution ([eeaf743](https://github.com/blueraai/bluera-knowledge/commit/eeaf743750be73fd9c7a9e72440b2fd0fb5a53fa))
17
+ * **scripts:** show real-time output in validation script ([8a4bdec](https://github.com/blueraai/bluera-knowledge/commit/8a4bdec8b63c504d34ba35bfe19da795f7f7fd07))
18
+ * **scripts:** use mktemp for temp directories in validation script ([3107861](https://github.com/blueraai/bluera-knowledge/commit/3107861bd7a966016fde2a121469dd84756f39be))
19
+
5
20
  ## [0.11.9](https://github.com/blueraai/bluera-knowledge/compare/v0.11.6...v0.11.9) (2026-01-10)
6
21
 
7
22
 
package/dist/index.js CHANGED
@@ -779,28 +779,32 @@ async function handleAddRepo(args, options = {}) {
779
779
  options.dataDir,
780
780
  options.projectRoot ?? process.env["PWD"]
781
781
  );
782
- const storeName = args.name ?? extractRepoName(args.url);
783
- console.log(`Cloning ${args.url}...`);
784
- const result = await services.store.create({
785
- name: storeName,
786
- type: "repo",
787
- url: args.url,
788
- ...args.branch !== void 0 ? { branch: args.branch } : {}
789
- });
790
- if (!result.success) {
791
- console.error(`Error: ${result.error.message}`);
792
- process.exit(1);
793
- }
794
- console.log(`Created store: ${storeName} (${result.data.id})`);
795
- if ("path" in result.data) {
796
- console.log(`Location: ${result.data.path}`);
797
- }
798
- console.log("\nIndexing...");
799
- const indexResult = await services.index.indexStore(result.data);
800
- if (indexResult.success) {
801
- console.log(`Indexed ${String(indexResult.data.documentsIndexed)} files`);
802
- } else {
803
- console.error(`Indexing failed: ${indexResult.error.message}`);
782
+ try {
783
+ const storeName = args.name ?? extractRepoName(args.url);
784
+ console.log(`Cloning ${args.url}...`);
785
+ const result = await services.store.create({
786
+ name: storeName,
787
+ type: "repo",
788
+ url: args.url,
789
+ ...args.branch !== void 0 ? { branch: args.branch } : {}
790
+ });
791
+ if (!result.success) {
792
+ console.error(`Error: ${result.error.message}`);
793
+ process.exit(1);
794
+ }
795
+ console.log(`Created store: ${storeName} (${result.data.id})`);
796
+ if ("path" in result.data) {
797
+ console.log(`Location: ${result.data.path}`);
798
+ }
799
+ console.log("\nIndexing...");
800
+ const indexResult = await services.index.indexStore(result.data);
801
+ if (indexResult.success) {
802
+ console.log(`Indexed ${String(indexResult.data.documentsIndexed)} files`);
803
+ } else {
804
+ console.error(`Indexing failed: ${indexResult.error.message}`);
805
+ }
806
+ } finally {
807
+ await destroyServices(services);
804
808
  }
805
809
  }
806
810
  async function handleAddFolder(args, options = {}) {
@@ -809,28 +813,32 @@ async function handleAddFolder(args, options = {}) {
809
813
  options.dataDir,
810
814
  options.projectRoot ?? process.env["PWD"]
811
815
  );
812
- const { basename } = await import("path");
813
- const storeName = args.name ?? basename(args.path);
814
- console.log(`Adding folder: ${args.path}...`);
815
- const result = await services.store.create({
816
- name: storeName,
817
- type: "file",
818
- path: args.path
819
- });
820
- if (!result.success) {
821
- console.error(`Error: ${result.error.message}`);
822
- process.exit(1);
823
- }
824
- console.log(`Created store: ${storeName} (${result.data.id})`);
825
- if ("path" in result.data) {
826
- console.log(`Location: ${result.data.path}`);
827
- }
828
- console.log("\nIndexing...");
829
- const indexResult = await services.index.indexStore(result.data);
830
- if (indexResult.success) {
831
- console.log(`Indexed ${String(indexResult.data.documentsIndexed)} files`);
832
- } else {
833
- console.error(`Indexing failed: ${indexResult.error.message}`);
816
+ try {
817
+ const { basename } = await import("path");
818
+ const storeName = args.name ?? basename(args.path);
819
+ console.log(`Adding folder: ${args.path}...`);
820
+ const result = await services.store.create({
821
+ name: storeName,
822
+ type: "file",
823
+ path: args.path
824
+ });
825
+ if (!result.success) {
826
+ console.error(`Error: ${result.error.message}`);
827
+ process.exit(1);
828
+ }
829
+ console.log(`Created store: ${storeName} (${result.data.id})`);
830
+ if ("path" in result.data) {
831
+ console.log(`Location: ${result.data.path}`);
832
+ }
833
+ console.log("\nIndexing...");
834
+ const indexResult = await services.index.indexStore(result.data);
835
+ if (indexResult.success) {
836
+ console.log(`Indexed ${String(indexResult.data.documentsIndexed)} files`);
837
+ } else {
838
+ console.error(`Indexing failed: ${indexResult.error.message}`);
839
+ }
840
+ } finally {
841
+ await destroyServices(services);
834
842
  }
835
843
  }
836
844
  async function handleStores(options = {}) {
@@ -839,86 +847,94 @@ async function handleStores(options = {}) {
839
847
  options.dataDir,
840
848
  options.projectRoot ?? process.env["PWD"]
841
849
  );
842
- const stores = await services.store.list();
843
- if (stores.length === 0) {
844
- console.log("No stores found.");
845
- console.log("\nCreate a store with:");
846
- console.log(" /bluera-knowledge:add-repo <url> --name=<name>");
847
- console.log(" /bluera-knowledge:add-folder <path> --name=<name>");
848
- return;
849
- }
850
- console.log("| Name | Type | ID | Source |");
851
- console.log("|------|------|----|--------------------|");
852
- for (const store of stores) {
853
- const name = store.name;
854
- const type = store.type;
855
- const id = store.id;
856
- let source = "";
857
- if ("url" in store && store.url !== void 0) {
858
- source = store.url;
859
- } else if ("path" in store) {
860
- source = store.path;
861
- }
862
- console.log(`| ${name} | ${type} | ${id.substring(0, 8)}... | ${source} |`);
850
+ try {
851
+ const stores = await services.store.list();
852
+ if (stores.length === 0) {
853
+ console.log("No stores found.");
854
+ console.log("\nCreate a store with:");
855
+ console.log(" /bluera-knowledge:add-repo <url> --name=<name>");
856
+ console.log(" /bluera-knowledge:add-folder <path> --name=<name>");
857
+ return;
858
+ }
859
+ console.log("| Name | Type | ID | Source |");
860
+ console.log("|------|------|----|--------------------|");
861
+ for (const store of stores) {
862
+ const name = store.name;
863
+ const type = store.type;
864
+ const id = store.id;
865
+ let source = "";
866
+ if ("url" in store && store.url !== void 0) {
867
+ source = store.url;
868
+ } else if ("path" in store) {
869
+ source = store.path;
870
+ }
871
+ console.log(`| ${name} | ${type} | ${id.substring(0, 8)}... | ${source} |`);
872
+ }
873
+ } finally {
874
+ await destroyServices(services);
863
875
  }
864
876
  }
865
877
  async function handleSuggest(options = {}) {
866
878
  const projectRoot = options.projectRoot ?? process.env["PWD"] ?? process.cwd();
867
879
  console.log("Analyzing project dependencies...\n");
868
880
  const services = await createServices(options.config, options.dataDir, projectRoot);
869
- const analyzer = new DependencyUsageAnalyzer();
870
- const resolver = new RepoUrlResolver();
871
- const spinner = ora3("Scanning source files...").start();
872
- const result = await analyzer.analyze(projectRoot, (current, total, message) => {
873
- spinner.text = `${message} (${String(current)}/${String(total)})`;
874
- });
875
- spinner.stop();
876
- if (!result.success) {
877
- console.error(`Error: ${result.error.message}`);
878
- process.exit(1);
879
- }
880
- const { usages, totalFilesScanned, skippedFiles } = result.data;
881
- console.log(
882
- `\u2714 Scanned ${String(totalFilesScanned)} files${skippedFiles > 0 ? ` (skipped ${String(skippedFiles)})` : ""}
883
- `
884
- );
885
- if (usages.length === 0) {
886
- console.log("No external dependencies found in this project.");
887
- console.log("\nMake sure you have a package.json or requirements.txt file.");
888
- return;
889
- }
890
- const existingStores = await services.store.list();
891
- const existingRepoNames = new Set(existingStores.map((s) => s.name));
892
- const newUsages = usages.filter((u) => !existingRepoNames.has(u.packageName));
893
- if (newUsages.length === 0) {
894
- console.log("\u2714 All dependencies are already in knowledge stores!");
895
- return;
896
- }
897
- const topSuggestions = newUsages.slice(0, 5);
898
- console.log("Top dependencies by usage in this project:\n");
899
- topSuggestions.forEach((usage, i) => {
900
- console.log(`${String(i + 1)}. ${usage.packageName}`);
881
+ try {
882
+ const analyzer = new DependencyUsageAnalyzer();
883
+ const resolver = new RepoUrlResolver();
884
+ const spinner = ora3("Scanning source files...").start();
885
+ const result = await analyzer.analyze(projectRoot, (current, total, message) => {
886
+ spinner.text = `${message} (${String(current)}/${String(total)})`;
887
+ });
888
+ spinner.stop();
889
+ if (!result.success) {
890
+ console.error(`Error: ${result.error.message}`);
891
+ process.exit(1);
892
+ }
893
+ const { usages, totalFilesScanned, skippedFiles } = result.data;
901
894
  console.log(
902
- ` ${String(usage.importCount)} imports across ${String(usage.fileCount)} files
895
+ `\u2714 Scanned ${String(totalFilesScanned)} files${skippedFiles > 0 ? ` (skipped ${String(skippedFiles)})` : ""}
903
896
  `
904
897
  );
905
- });
906
- console.log("Searching for repository URLs...\n");
907
- for (const usage of topSuggestions) {
908
- const repoResult = await resolver.findRepoUrl(usage.packageName, usage.language);
909
- if (repoResult.url !== null) {
910
- console.log(`\u2714 ${usage.packageName}: ${repoResult.url}`);
911
- console.log(` /bluera-knowledge:add-repo ${repoResult.url} --name=${usage.packageName}
912
- `);
913
- } else {
914
- console.log(`\u2717 ${usage.packageName}: Could not find repository URL`);
898
+ if (usages.length === 0) {
899
+ console.log("No external dependencies found in this project.");
900
+ console.log("\nMake sure you have a package.json or requirements.txt file.");
901
+ return;
902
+ }
903
+ const existingStores = await services.store.list();
904
+ const existingRepoNames = new Set(existingStores.map((s) => s.name));
905
+ const newUsages = usages.filter((u) => !existingRepoNames.has(u.packageName));
906
+ if (newUsages.length === 0) {
907
+ console.log("\u2714 All dependencies are already in knowledge stores!");
908
+ return;
909
+ }
910
+ const topSuggestions = newUsages.slice(0, 5);
911
+ console.log("Top dependencies by usage in this project:\n");
912
+ topSuggestions.forEach((usage, i) => {
913
+ console.log(`${String(i + 1)}. ${usage.packageName}`);
915
914
  console.log(
916
- ` You can manually add it: /bluera-knowledge:add-repo <url> --name=${usage.packageName}
915
+ ` ${String(usage.importCount)} imports across ${String(usage.fileCount)} files
917
916
  `
918
917
  );
918
+ });
919
+ console.log("Searching for repository URLs...\n");
920
+ for (const usage of topSuggestions) {
921
+ const repoResult = await resolver.findRepoUrl(usage.packageName, usage.language);
922
+ if (repoResult.url !== null) {
923
+ console.log(`\u2714 ${usage.packageName}: ${repoResult.url}`);
924
+ console.log(` /bluera-knowledge:add-repo ${repoResult.url} --name=${usage.packageName}
925
+ `);
926
+ } else {
927
+ console.log(`\u2717 ${usage.packageName}: Could not find repository URL`);
928
+ console.log(
929
+ ` You can manually add it: /bluera-knowledge:add-repo <url> --name=${usage.packageName}
930
+ `
931
+ );
932
+ }
919
933
  }
934
+ console.log("Use the commands above to add repositories to your knowledge stores.");
935
+ } finally {
936
+ await destroyServices(services);
920
937
  }
921
- console.log("Use the commands above to add repositories to your knowledge stores.");
922
938
  }
923
939
 
924
940
  // src/cli/commands/plugin-api.ts