exomind 0.1.2 → 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 +20 -10
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/skill/SKILL.md +15 -0
package/dist/cli.js
CHANGED
|
@@ -3119,7 +3119,7 @@ var {
|
|
|
3119
3119
|
// package.json
|
|
3120
3120
|
var package_default = {
|
|
3121
3121
|
name: "exomind",
|
|
3122
|
-
version: "0.1.
|
|
3122
|
+
version: "0.1.3",
|
|
3123
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
3124
|
bin: {
|
|
3125
3125
|
exomind: "dist/cli.js"
|
|
@@ -3165,6 +3165,10 @@ var package_default = {
|
|
|
3165
3165
|
};
|
|
3166
3166
|
|
|
3167
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
|
+
}
|
|
3168
3172
|
var ApiError = class extends Error {
|
|
3169
3173
|
status;
|
|
3170
3174
|
detail;
|
|
@@ -3303,6 +3307,9 @@ function setJsonMode(v) {
|
|
|
3303
3307
|
function isJsonMode() {
|
|
3304
3308
|
return JSON_MODE;
|
|
3305
3309
|
}
|
|
3310
|
+
function hint(msg) {
|
|
3311
|
+
if (!isJsonMode()) process.stderr.write(msg + "\n");
|
|
3312
|
+
}
|
|
3306
3313
|
function output(data, pretty) {
|
|
3307
3314
|
if (JSON_MODE) {
|
|
3308
3315
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -3639,9 +3646,10 @@ async function ingest(client, opts, args) {
|
|
|
3639
3646
|
const body = { content };
|
|
3640
3647
|
if (opts.title) body.title = opts.title;
|
|
3641
3648
|
if (opts.tag && opts.tag.length) body.tags = opts.tag;
|
|
3642
|
-
|
|
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) });
|
|
3643
3651
|
output(result, () => {
|
|
3644
|
-
console.log(ok("\u5DF2\u5BFC\u5165\u77E5\u8BC6\u5E93"));
|
|
3652
|
+
console.log(ok("\u5DF2\u5BFC\u5165\u670D\u52A1\u5668\u77E5\u8BC6\u5E93"));
|
|
3645
3653
|
if (opts.title) console.log(dim(` \u6807\u9898: ${opts.title}`));
|
|
3646
3654
|
console.log(` ${green("\u5B9E\u4F53")}: ${result.entities ?? 0} ${green("\u6982\u5FF5")}: ${result.concepts ?? 0}`);
|
|
3647
3655
|
if (result.summary) console.log(dim(` \u6458\u8981: ${truncate(result.summary, 120)}`));
|
|
@@ -3661,7 +3669,8 @@ async function query(client, opts, args) {
|
|
|
3661
3669
|
const body = { question };
|
|
3662
3670
|
if (opts.tag?.length) body.tags = opts.tag;
|
|
3663
3671
|
if (opts.model) body.model = opts.model;
|
|
3664
|
-
|
|
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) });
|
|
3665
3674
|
output(result, () => {
|
|
3666
3675
|
console.log(result.answer || dim("(\u65E0\u56DE\u7B54)"));
|
|
3667
3676
|
if (result.pages?.length) {
|
|
@@ -3793,7 +3802,8 @@ async function mark(client, opts, args) {
|
|
|
3793
3802
|
async function synthesize(client, opts, args) {
|
|
3794
3803
|
const topic = args.join(" ").trim();
|
|
3795
3804
|
if (!topic) throw new Error('\u8BF7\u63D0\u4F9B\u4E3B\u9898: exomind synthesize "Redis \u6301\u4E45\u5316"');
|
|
3796
|
-
|
|
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) });
|
|
3797
3807
|
output(result, () => {
|
|
3798
3808
|
console.log(bold(result.topic || topic));
|
|
3799
3809
|
if (result.content) console.log(`
|
|
@@ -3901,10 +3911,10 @@ async function login(_client, opts) {
|
|
|
3901
3911
|
)
|
|
3902
3912
|
);
|
|
3903
3913
|
}
|
|
3904
|
-
const
|
|
3914
|
+
const hint2 = token.length > 12 ? `${token.slice(0, 8)}\u2026${token.slice(-4)}` : token;
|
|
3905
3915
|
console.log(ok("\u767B\u5F55\u6210\u529F"));
|
|
3906
3916
|
console.log(dim(` \u670D\u52A1\u5668: ${baseUrl}`));
|
|
3907
|
-
console.log(dim(` \u51ED\u8BC1: ${
|
|
3917
|
+
console.log(dim(` \u51ED\u8BC1: ${hint2} (${token.startsWith("gh_") ? "GitHub token" : "API Key"})`));
|
|
3908
3918
|
}
|
|
3909
3919
|
|
|
3910
3920
|
// src/commands/whoami.ts
|
|
@@ -3920,14 +3930,14 @@ async function whoami(client) {
|
|
|
3920
3930
|
} catch {
|
|
3921
3931
|
me = {};
|
|
3922
3932
|
}
|
|
3923
|
-
const
|
|
3933
|
+
const hint2 = cfg.api_key.length > 12 ? `${cfg.api_key.slice(0, 8)}\u2026${cfg.api_key.slice(-4)}` : cfg.api_key;
|
|
3924
3934
|
const kind = cfg.api_key.startsWith("gh_") ? "GitHub token" : "API Key";
|
|
3925
3935
|
output(
|
|
3926
|
-
{ base_url: cfg.base_url, credential:
|
|
3936
|
+
{ base_url: cfg.base_url, credential: hint2, kind, ...me },
|
|
3927
3937
|
() => {
|
|
3928
3938
|
console.log(ok("\u5DF2\u767B\u5F55"));
|
|
3929
3939
|
console.log(dim(` \u670D\u52A1\u5668: ${cfg.base_url}`));
|
|
3930
|
-
console.log(dim(` \u51ED\u8BC1: ${
|
|
3940
|
+
console.log(dim(` \u51ED\u8BC1: ${hint2} (${kind})`));
|
|
3931
3941
|
if (me.authenticated) {
|
|
3932
3942
|
console.log(dim(` \u7528\u6237: ${me.name || me.login || "-"} (tenant: ${me.tenant_id || "-"})`));
|
|
3933
3943
|
}
|