exomind 0.12.0 → 0.13.1
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 +40 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
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.
|
|
3122
|
+
version: "0.13.1",
|
|
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"
|
|
@@ -4736,13 +4736,48 @@ async function deletePage(client, opts, args) {
|
|
|
4736
4736
|
return;
|
|
4737
4737
|
}
|
|
4738
4738
|
}
|
|
4739
|
-
const r = await client.del(`/pages/${encPath(target)}
|
|
4739
|
+
const r = await client.del(`/pages/${encPath(target)}`, { timeoutMs: 6e4 });
|
|
4740
4740
|
output(r, () => {
|
|
4741
4741
|
console.log(ok(`\u5DF2\u5220\u9664: ${r.path}`));
|
|
4742
4742
|
if (r.trash_path) console.log(dim(`\u56DE\u6536\u7AD9: ${r.trash_path} \u2014 exomind trash \u67E5\u770B / trash restore \u6062\u590D`));
|
|
4743
4743
|
});
|
|
4744
4744
|
}
|
|
4745
4745
|
|
|
4746
|
+
// src/page_path.ts
|
|
4747
|
+
function encPath2(p) {
|
|
4748
|
+
return p.split("/").map(encodeURIComponent).join("/");
|
|
4749
|
+
}
|
|
4750
|
+
async function resolvePagePath(client, page) {
|
|
4751
|
+
const dirs = ["entities", "concepts", "summaries", "synthesis", "qa", "raw/articles"];
|
|
4752
|
+
for (const d of dirs) {
|
|
4753
|
+
const cand = `${d}/${page}.md`;
|
|
4754
|
+
try {
|
|
4755
|
+
await client.get(`/pages/${encPath2(cand)}`, void 0, { timeoutMs: 15e3 });
|
|
4756
|
+
return cand;
|
|
4757
|
+
} catch {
|
|
4758
|
+
}
|
|
4759
|
+
}
|
|
4760
|
+
throw new Error(`\u9875\u9762\u4E0D\u5B58\u5728: ${page}(\u5148 exomind search \u5B9A\u4F4D)`);
|
|
4761
|
+
}
|
|
4762
|
+
|
|
4763
|
+
// src/commands/get.ts
|
|
4764
|
+
async function get(client, _opts, args) {
|
|
4765
|
+
const page = args.join(" ").trim();
|
|
4766
|
+
if (!page) throw new Error("\u8BF7\u63D0\u4F9B\u9875\u9762\u8DEF\u5F84\u6216\u5B9E\u4F53\u540D: exomind get entities/Redis.md");
|
|
4767
|
+
let target = page;
|
|
4768
|
+
if (!page.includes("/") && !page.endsWith(".md")) {
|
|
4769
|
+
target = await resolvePagePath(client, page);
|
|
4770
|
+
}
|
|
4771
|
+
const r = await client.get(`/pages/${encPath2(target)}`, void 0, { timeoutMs: 3e4 });
|
|
4772
|
+
output(r, () => {
|
|
4773
|
+
console.log(`${bold(r.title)} ${dim(`(${r.path})`)}`);
|
|
4774
|
+
if (r.tags?.length) console.log(dim(`\u6807\u7B7E: ${r.tags.join(", ")}`));
|
|
4775
|
+
console.log(dim(`\u66F4\u65B0: ${r.mtime ?? ""} \xB7 ${r.size_bytes ?? 0} \u5B57\u8282`));
|
|
4776
|
+
console.log("");
|
|
4777
|
+
console.log(truncate(String(r.body ?? ""), 2e3));
|
|
4778
|
+
});
|
|
4779
|
+
}
|
|
4780
|
+
|
|
4746
4781
|
// src/commands/trash.ts
|
|
4747
4782
|
async function trash(client, opts, args) {
|
|
4748
4783
|
const action = args[0];
|
|
@@ -4779,7 +4814,8 @@ async function doList2(client, opts) {
|
|
|
4779
4814
|
async function doRestore(client, trashPath) {
|
|
4780
4815
|
const p = (trashPath ?? "").trim();
|
|
4781
4816
|
if (!p) throw new Error('\u8BF7\u63D0\u4F9B\u56DE\u6536\u7AD9\u8DEF\u5F84: exomind trash restore ".trash/202609/entities/Redis.md"');
|
|
4782
|
-
|
|
4817
|
+
console.log(dim("\u6062\u590D\u4E2D\u2026\u5927\u77E5\u8BC6\u5E93\u5237\u7D22\u5F15\u53EF\u80FD\u9700\u8981\u4E00\u4E24\u5206\u949F,\u8BF7\u52FF\u5173\u95ED"));
|
|
4818
|
+
const r = await client.post("/trash/restore", { trash_path: p }, { timeoutMs: opTimeout(3e5) });
|
|
4783
4819
|
output(r, () => console.log(ok(`\u5DF2\u6062\u590D \u2192 ${r.path}`)));
|
|
4784
4820
|
}
|
|
4785
4821
|
|
|
@@ -5243,6 +5279,7 @@ program2.command("ingest [content...]").description("\u5BFC\u5165\u77E5\u8BC6: \
|
|
|
5243
5279
|
(v) => parseInt(v, 10) || 3,
|
|
5244
5280
|
3
|
|
5245
5281
|
).action(run(ingest));
|
|
5282
|
+
program2.command("get <page...>").description("\u83B7\u53D6\u6307\u5B9A\u8BB0\u5FC6(\u9875\u9762\u8BE6\u60C5):\u8DEF\u5F84(entities/Redis.md)\u6216\u88F8\u5B9E\u4F53\u540D(Redis)").action(run((client, opts, args) => get(client, opts, args)));
|
|
5246
5283
|
program2.command("delete <page...>").description(
|
|
5247
5284
|
"\u5220\u9664\u77E5\u8BC6\u9875(\u8F6F\u5220\u9664:\u5165\u670D\u52A1\u7AEF\u56DE\u6536\u7AD9,\u53EF\u6062\u590D)\u3002\u652F\u6301\u8DEF\u5F84(entities/Redis.md)\u6216\u88F8\u5B9E\u4F53\u540D(Redis)"
|
|
5248
5285
|
).option("-y, --yes", "\u8DF3\u8FC7\u786E\u8BA4").action(run((client, opts, args) => deletePage(client, opts, args)));
|