bluera-knowledge 0.9.30 → 0.9.31

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/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runMCPServer
4
- } from "./chunk-SZNTYLYT.js";
4
+ } from "./chunk-OGEY66FZ.js";
5
5
  import {
6
6
  IntelligentCrawler
7
- } from "./chunk-DNOIM7BO.js";
7
+ } from "./chunk-2SJHNRXD.js";
8
8
  import {
9
9
  ASTParser,
10
10
  ChunkingService,
@@ -16,7 +16,7 @@ import {
16
16
  err,
17
17
  extractRepoName,
18
18
  ok
19
- } from "./chunk-NJUMU4X2.js";
19
+ } from "./chunk-RWSXP3PQ.js";
20
20
  import "./chunk-L2YVNC63.js";
21
21
 
22
22
  // src/index.ts
@@ -87,12 +87,14 @@ function createStoreCommand(getOptions) {
87
87
  store.command("create <name>").description("Create a new store pointing to a local path or URL").requiredOption("-t, --type <type>", "Store type: file (local dir), repo (git), web (crawled site)").requiredOption("-s, --source <path>", "Local path for file/repo stores, URL for web stores").option("-d, --description <desc>", "Optional description for the store").option("--tags <tags>", "Comma-separated tags for filtering").action(async (name, options) => {
88
88
  const globalOpts = getOptions();
89
89
  const services = await createServices(globalOpts.config, globalOpts.dataDir);
90
+ let exitCode = 0;
90
91
  try {
92
+ const isUrl = options.source.startsWith("http://") || options.source.startsWith("https://");
91
93
  const result = await services.store.create({
92
94
  name,
93
95
  type: options.type,
94
- path: options.type !== "web" ? options.source : void 0,
95
- url: options.type === "web" ? options.source : void 0,
96
+ path: options.type === "file" || options.type === "repo" && !isUrl ? options.source : void 0,
97
+ url: options.type === "web" || options.type === "repo" && isUrl ? options.source : void 0,
96
98
  description: options.description,
97
99
  tags: options.tags?.split(",").map((t) => t.trim())
98
100
  });
@@ -106,11 +108,14 @@ Created store: ${result.data.name} (${result.data.id})
106
108
  }
107
109
  } else {
108
110
  console.error(`Error: ${result.error.message}`);
109
- process.exit(1);
111
+ exitCode = 1;
110
112
  }
111
113
  } finally {
112
114
  await destroyServices(services);
113
115
  }
116
+ if (exitCode !== 0) {
117
+ process.exit(exitCode);
118
+ }
114
119
  });
115
120
  store.command("info <store>").description("Show store details: ID, type, path/URL, timestamps").action(async (storeIdOrName) => {
116
121
  const globalOpts = getOptions();