exomind 0.1.1 → 0.1.3

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/cli.js CHANGED
@@ -3116,7 +3116,59 @@ var {
3116
3116
  Help
3117
3117
  } = import_index.default;
3118
3118
 
3119
+ // package.json
3120
+ var package_default = {
3121
+ name: "exomind",
3122
+ version: "0.1.3",
3123
+ description: "ExoMind \u8DE8\u5E73\u53F0\u547D\u4EE4\u884C\u5BA2\u6237\u7AEF \u2014 \u901A\u8FC7 REST \u4E0E ExoMind \u77E5\u8BC6\u5E93\u4EA4\u4E92(ingest/query/search/review),\u66FF\u4EE3 Windows \u4E0D\u53EF\u7528\u7684 MCP \u5BA2\u6237\u7AEF\u3002",
3124
+ bin: {
3125
+ exomind: "dist/cli.js"
3126
+ },
3127
+ files: [
3128
+ "dist",
3129
+ "skill"
3130
+ ],
3131
+ engines: {
3132
+ node: ">=18"
3133
+ },
3134
+ scripts: {
3135
+ build: "tsup",
3136
+ dev: "tsup --watch",
3137
+ test: "node --test --import tsx test/*.test.ts",
3138
+ prepublishOnly: "npm run build"
3139
+ },
3140
+ dependencies: {},
3141
+ devDependencies: {
3142
+ "@types/node": "^22.10.0",
3143
+ commander: "^12.1.0",
3144
+ picocolors: "^1.1.1",
3145
+ tsup: "^8.3.5",
3146
+ tsx: "^4.19.2",
3147
+ typescript: "^5.7.2"
3148
+ },
3149
+ keywords: [
3150
+ "exomind",
3151
+ "knowledge-base",
3152
+ "cli",
3153
+ "mcp-alternative",
3154
+ "cross-platform"
3155
+ ],
3156
+ license: "MIT",
3157
+ repository: {
3158
+ type: "git",
3159
+ url: "https://github.com/helloworldtang/exomind-cli.git"
3160
+ },
3161
+ homepage: "https://github.com/helloworldtang/exomind-cli#readme",
3162
+ bugs: {
3163
+ url: "https://github.com/helloworldtang/exomind-cli/issues"
3164
+ }
3165
+ };
3166
+
3119
3167
  // src/api.ts
3168
+ function opTimeout(defaultMs) {
3169
+ const n = Number(process.env.EXOMIND_TIMEOUT_MS);
3170
+ return Number.isFinite(n) && n > 0 ? n : defaultMs;
3171
+ }
3120
3172
  var ApiError = class extends Error {
3121
3173
  status;
3122
3174
  detail;
@@ -3255,6 +3307,9 @@ function setJsonMode(v) {
3255
3307
  function isJsonMode() {
3256
3308
  return JSON_MODE;
3257
3309
  }
3310
+ function hint(msg) {
3311
+ if (!isJsonMode()) process.stderr.write(msg + "\n");
3312
+ }
3258
3313
  function output(data, pretty) {
3259
3314
  if (JSON_MODE) {
3260
3315
  console.log(JSON.stringify(data, null, 2));
@@ -3591,9 +3646,10 @@ async function ingest(client, opts, args) {
3591
3646
  const body = { content };
3592
3647
  if (opts.title) body.title = opts.title;
3593
3648
  if (opts.tag && opts.tag.length) body.tags = opts.tag;
3594
- const result = await client.post("/ingest", body, { timeoutMs: 12e4 });
3649
+ hint("\u23F3 \u6444\u5165\u4E2D: \u670D\u52A1\u5668\u7528 LLM \u62BD\u53D6\u5B9E\u4F53/\u5173\u7CFB,\u957F\u5185\u5BB9\u53EF\u80FD 1-3 \u5206\u949F\u2026");
3650
+ const result = await client.post("/ingest", body, { timeoutMs: opTimeout(3e5) });
3595
3651
  output(result, () => {
3596
- console.log(ok("\u5DF2\u5BFC\u5165\u77E5\u8BC6\u5E93"));
3652
+ console.log(ok("\u5DF2\u5BFC\u5165\u670D\u52A1\u5668\u77E5\u8BC6\u5E93"));
3597
3653
  if (opts.title) console.log(dim(` \u6807\u9898: ${opts.title}`));
3598
3654
  console.log(` ${green("\u5B9E\u4F53")}: ${result.entities ?? 0} ${green("\u6982\u5FF5")}: ${result.concepts ?? 0}`);
3599
3655
  if (result.summary) console.log(dim(` \u6458\u8981: ${truncate(result.summary, 120)}`));
@@ -3613,7 +3669,8 @@ async function query(client, opts, args) {
3613
3669
  const body = { question };
3614
3670
  if (opts.tag?.length) body.tags = opts.tag;
3615
3671
  if (opts.model) body.model = opts.model;
3616
- const result = await client.post("/query", body, { timeoutMs: 12e4 });
3672
+ hint("\u23F3 \u67E5\u8BE2\u4E2D: LLM \u68C0\u7D22 + \u751F\u6210,\u53EF\u80FD 1-2 \u5206\u949F\u2026");
3673
+ const result = await client.post("/query", body, { timeoutMs: opTimeout(18e4) });
3617
3674
  output(result, () => {
3618
3675
  console.log(result.answer || dim("(\u65E0\u56DE\u7B54)"));
3619
3676
  if (result.pages?.length) {
@@ -3745,7 +3802,8 @@ async function mark(client, opts, args) {
3745
3802
  async function synthesize(client, opts, args) {
3746
3803
  const topic = args.join(" ").trim();
3747
3804
  if (!topic) throw new Error('\u8BF7\u63D0\u4F9B\u4E3B\u9898: exomind synthesize "Redis \u6301\u4E45\u5316"');
3748
- const result = await client.post("/synthesize", { topic, depth: opts.depth ?? 2 }, { timeoutMs: 18e4 });
3805
+ hint("\u23F3 \u7EFC\u5408\u4E2D: \u591A\u6E90\u805A\u5408 + \u6D1E\u5BDF,\u53EF\u80FD 2-4 \u5206\u949F\u2026");
3806
+ const result = await client.post("/synthesize", { topic, depth: opts.depth ?? 2 }, { timeoutMs: opTimeout(3e5) });
3749
3807
  output(result, () => {
3750
3808
  console.log(bold(result.topic || topic));
3751
3809
  if (result.content) console.log(`
@@ -3853,10 +3911,10 @@ async function login(_client, opts) {
3853
3911
  )
3854
3912
  );
3855
3913
  }
3856
- const hint = token.length > 12 ? `${token.slice(0, 8)}\u2026${token.slice(-4)}` : token;
3914
+ const hint2 = token.length > 12 ? `${token.slice(0, 8)}\u2026${token.slice(-4)}` : token;
3857
3915
  console.log(ok("\u767B\u5F55\u6210\u529F"));
3858
3916
  console.log(dim(` \u670D\u52A1\u5668: ${baseUrl}`));
3859
- console.log(dim(` \u51ED\u8BC1: ${hint} (${token.startsWith("gh_") ? "GitHub token" : "API Key"})`));
3917
+ console.log(dim(` \u51ED\u8BC1: ${hint2} (${token.startsWith("gh_") ? "GitHub token" : "API Key"})`));
3860
3918
  }
3861
3919
 
3862
3920
  // src/commands/whoami.ts
@@ -3872,14 +3930,14 @@ async function whoami(client) {
3872
3930
  } catch {
3873
3931
  me = {};
3874
3932
  }
3875
- const hint = cfg.api_key.length > 12 ? `${cfg.api_key.slice(0, 8)}\u2026${cfg.api_key.slice(-4)}` : cfg.api_key;
3933
+ const hint2 = cfg.api_key.length > 12 ? `${cfg.api_key.slice(0, 8)}\u2026${cfg.api_key.slice(-4)}` : cfg.api_key;
3876
3934
  const kind = cfg.api_key.startsWith("gh_") ? "GitHub token" : "API Key";
3877
3935
  output(
3878
- { base_url: cfg.base_url, credential: hint, kind, ...me },
3936
+ { base_url: cfg.base_url, credential: hint2, kind, ...me },
3879
3937
  () => {
3880
3938
  console.log(ok("\u5DF2\u767B\u5F55"));
3881
3939
  console.log(dim(` \u670D\u52A1\u5668: ${cfg.base_url}`));
3882
- console.log(dim(` \u51ED\u8BC1: ${hint} (${kind})`));
3940
+ console.log(dim(` \u51ED\u8BC1: ${hint2} (${kind})`));
3883
3941
  if (me.authenticated) {
3884
3942
  console.log(dim(` \u7528\u6237: ${me.name || me.login || "-"} (tenant: ${me.tenant_id || "-"})`));
3885
3943
  }
@@ -3944,7 +4002,7 @@ async function install(_client, opts) {
3944
4002
  }
3945
4003
 
3946
4004
  // src/cli.ts
3947
- var VERSION = "0.1.0";
4005
+ var VERSION = package_default.version;
3948
4006
  function collect(value, previous) {
3949
4007
  return [...previous ?? [], value];
3950
4008
  }