clawvault 2.6.1 → 2.6.4
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/README.md +352 -20
- package/bin/clawvault.js +8 -2
- package/bin/command-runtime.js +9 -1
- package/bin/register-maintenance-commands.js +19 -0
- package/bin/register-query-commands.js +58 -6
- package/bin/register-workgraph-commands.js +451 -0
- package/dist/{chunk-VXEOHTSL.js → chunk-2JQ3O2YL.js} +1 -1
- package/dist/{chunk-VR5NE7PZ.js → chunk-2RAZ4ZFE.js} +1 -1
- package/dist/chunk-2ZDO52B4.js +52 -0
- package/dist/chunk-4BQTQMJP.js +93 -0
- package/dist/{chunk-MAKNAHAW.js → chunk-5PJ4STIC.js} +98 -8
- package/dist/{chunk-IEVLHNLU.js → chunk-627Q3QWK.js} +3 -3
- package/dist/{chunk-R6SXNSFD.js → chunk-6NYYDNNG.js} +3 -3
- package/dist/chunk-ECRZL5XR.js +50 -0
- package/dist/chunk-GNJL4YGR.js +79 -0
- package/dist/{chunk-OZ7RIXTO.js → chunk-IIOU45CK.js} +1 -1
- package/dist/chunk-L4HSSQ6T.js +152 -0
- package/dist/{chunk-XAVB4GB4.js → chunk-LIGHWOH6.js} +1 -1
- package/dist/{chunk-PBEE567J.js → chunk-LUBZXECN.js} +2 -2
- package/dist/{chunk-UEOUADMO.js → chunk-MFL6EEPF.js} +204 -35
- package/dist/chunk-MM6QGW3P.js +207 -0
- package/dist/{chunk-T76H47ZS.js → chunk-MNPUYCHQ.js} +1 -1
- package/dist/{chunk-TLGBDTYT.js → chunk-MPOSMDMU.js} +6 -6
- package/dist/{chunk-RVYA52PY.js → chunk-NJYJL5AA.js} +1 -1
- package/dist/{chunk-Q2J5YTUF.js → chunk-OQGYFZ4A.js} +669 -33
- package/dist/{chunk-ME37YNW3.js → chunk-P7SY3D4E.js} +3 -3
- package/dist/chunk-RHISK3SZ.js +189 -0
- package/dist/{chunk-3BTHWPMB.js → chunk-S5OJEGFG.js} +2 -2
- package/dist/{chunk-MGDEINGP.js → chunk-SS4B7P7V.js} +1 -1
- package/dist/chunk-U4O6C46S.js +154 -0
- package/dist/{chunk-ITPEXLHA.js → chunk-URXDAUVH.js} +24 -5
- package/dist/chunk-WIOLLGAD.js +190 -0
- package/dist/chunk-WMGIIABP.js +15 -0
- package/dist/{chunk-QVMXF7FY.js → chunk-X3SPPUFG.js} +50 -0
- package/dist/{chunk-THRJVD4L.js → chunk-Y6VJKXGL.js} +1 -1
- package/dist/{chunk-KL4NAOMO.js → chunk-YDWHS4LJ.js} +49 -9
- package/dist/{chunk-4VRIMU4O.js → chunk-YNIPYN4F.js} +4 -4
- package/dist/{chunk-HIHOUSXS.js → chunk-YXQCA6B7.js} +105 -1
- package/dist/cli/index.js +18 -16
- package/dist/commands/archive.js +3 -2
- package/dist/commands/backlog.js +1 -0
- package/dist/commands/blocked.js +1 -0
- package/dist/commands/canvas.js +1 -0
- package/dist/commands/checkpoint.js +1 -0
- package/dist/commands/compat.js +2 -1
- package/dist/commands/context.js +5 -3
- package/dist/commands/doctor.d.ts +10 -1
- package/dist/commands/doctor.js +11 -8
- package/dist/commands/embed.js +5 -3
- package/dist/commands/entities.js +2 -1
- package/dist/commands/graph.js +3 -2
- package/dist/commands/inject.d.ts +1 -1
- package/dist/commands/inject.js +4 -3
- package/dist/commands/kanban.js +1 -0
- package/dist/commands/link.js +2 -1
- package/dist/commands/migrate-observations.js +3 -2
- package/dist/commands/observe.js +8 -6
- package/dist/commands/project.js +1 -0
- package/dist/commands/rebuild-embeddings.d.ts +21 -0
- package/dist/commands/rebuild-embeddings.js +91 -0
- package/dist/commands/rebuild.js +6 -4
- package/dist/commands/recover.js +1 -0
- package/dist/commands/reflect.js +5 -4
- package/dist/commands/repair-session.js +1 -0
- package/dist/commands/replay.js +7 -6
- package/dist/commands/session-recap.js +1 -0
- package/dist/commands/setup.js +3 -2
- package/dist/commands/shell-init.js +2 -0
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +8 -6
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.js +35 -24
- package/dist/commands/sync-bd.js +3 -2
- package/dist/commands/tailscale.js +3 -2
- package/dist/commands/task.js +1 -0
- package/dist/commands/template.js +1 -0
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +4 -2
- package/dist/index.d.ts +333 -10
- package/dist/index.js +320 -33
- package/dist/{inject-x65KXWPk.d.ts → inject-DYUrDqQO.d.ts} +2 -2
- package/dist/ledger-B7g7jhqG.d.ts +44 -0
- package/dist/lib/auto-linker.js +1 -0
- package/dist/lib/canvas-layout.js +1 -0
- package/dist/lib/config.d.ts +27 -3
- package/dist/lib/config.js +4 -1
- package/dist/lib/entity-index.js +1 -0
- package/dist/lib/project-utils.js +1 -0
- package/dist/lib/session-repair.js +1 -0
- package/dist/lib/session-utils.js +1 -0
- package/dist/lib/tailscale.js +1 -0
- package/dist/lib/task-utils.js +1 -0
- package/dist/lib/template-engine.js +1 -0
- package/dist/lib/webdav.js +1 -0
- package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
- package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
- package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
- package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
- package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
- package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
- package/dist/registry-BR4326o0.d.ts +30 -0
- package/dist/store-CA-6sKCJ.d.ts +34 -0
- package/dist/thread-B9LhXNU0.d.ts +41 -0
- package/dist/transformers.node-A2ZRORSQ.js +46775 -0
- package/dist/{types-C74wgGL1.d.ts → types-BbWJoC1c.d.ts} +1 -1
- package/dist/workgraph/index.d.ts +5 -0
- package/dist/workgraph/index.js +23 -0
- package/dist/workgraph/ledger.d.ts +2 -0
- package/dist/workgraph/ledger.js +25 -0
- package/dist/workgraph/registry.d.ts +2 -0
- package/dist/workgraph/registry.js +19 -0
- package/dist/workgraph/store.d.ts +2 -0
- package/dist/workgraph/store.js +25 -0
- package/dist/workgraph/thread.d.ts +2 -0
- package/dist/workgraph/thread.js +25 -0
- package/dist/workgraph/types.d.ts +54 -0
- package/dist/workgraph/types.js +7 -0
- package/hooks/clawvault/HOOK.md +34 -4
- package/hooks/clawvault/handler.js +751 -8
- package/hooks/clawvault/handler.test.js +247 -0
- package/hooks/clawvault/openclaw.plugin.json +72 -0
- package/openclaw.plugin.json +84 -0
- package/package.json +8 -4
- package/dist/chunk-4QYGFWRM.js +0 -88
- package/dist/chunk-MXSSG3QU.js +0 -42
|
@@ -195,6 +195,55 @@ function checkHookHandlerSafety(options) {
|
|
|
195
195
|
}
|
|
196
196
|
return { label: "hook handler safety", status: "ok" };
|
|
197
197
|
}
|
|
198
|
+
function checkPluginManifest(options) {
|
|
199
|
+
const manifestRaw = readOptionalFile(resolveProjectFile("hooks/clawvault/openclaw.plugin.json", options.baseDir));
|
|
200
|
+
if (!manifestRaw) {
|
|
201
|
+
return {
|
|
202
|
+
label: "plugin manifest",
|
|
203
|
+
status: "error",
|
|
204
|
+
detail: "hooks/clawvault/openclaw.plugin.json not found",
|
|
205
|
+
hint: "Add openclaw.plugin.json to hooks/clawvault/ for config schema registration."
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
try {
|
|
209
|
+
const parsed = JSON.parse(manifestRaw);
|
|
210
|
+
if (!parsed.id || parsed.id !== "clawvault") {
|
|
211
|
+
return {
|
|
212
|
+
label: "plugin manifest",
|
|
213
|
+
status: "error",
|
|
214
|
+
detail: `Invalid plugin id: expected "clawvault", got "${parsed.id || "(missing)"}"`
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
if (!parsed.configSchema || typeof parsed.configSchema !== "object") {
|
|
218
|
+
return {
|
|
219
|
+
label: "plugin manifest",
|
|
220
|
+
status: "error",
|
|
221
|
+
detail: "Missing configSchema in plugin manifest",
|
|
222
|
+
hint: "Add configSchema to openclaw.plugin.json for config validation."
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const hasVaultPath = Boolean(parsed.configSchema.properties?.vaultPath);
|
|
226
|
+
if (!hasVaultPath) {
|
|
227
|
+
return {
|
|
228
|
+
label: "plugin manifest",
|
|
229
|
+
status: "warn",
|
|
230
|
+
detail: "configSchema missing vaultPath property",
|
|
231
|
+
hint: "Add vaultPath to configSchema.properties for vault path configuration."
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
return {
|
|
235
|
+
label: "plugin manifest",
|
|
236
|
+
status: "ok",
|
|
237
|
+
detail: `id: ${parsed.id}, configSchema defined`
|
|
238
|
+
};
|
|
239
|
+
} catch (err) {
|
|
240
|
+
return {
|
|
241
|
+
label: "plugin manifest",
|
|
242
|
+
status: "error",
|
|
243
|
+
detail: err?.message || "Unable to parse openclaw.plugin.json"
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}
|
|
198
247
|
function checkSkillMetadata(options) {
|
|
199
248
|
const skillRaw = readOptionalFile(resolveProjectFile("SKILL.md", options.baseDir));
|
|
200
249
|
if (!skillRaw) {
|
|
@@ -236,6 +285,7 @@ function checkOpenClawCompatibility(options = {}) {
|
|
|
236
285
|
const checks = [
|
|
237
286
|
checkOpenClawCli(),
|
|
238
287
|
checkPackageHookRegistration(options),
|
|
288
|
+
checkPluginManifest(options),
|
|
239
289
|
checkHookManifest(options),
|
|
240
290
|
checkHookManifestRequirements(options),
|
|
241
291
|
checkHookHandlerSafety(options),
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadVaultQmdConfig
|
|
3
|
+
} from "./chunk-WIOLLGAD.js";
|
|
1
4
|
import {
|
|
2
5
|
QmdUnavailableError,
|
|
3
6
|
SearchEngine,
|
|
@@ -6,7 +9,7 @@ import {
|
|
|
6
9
|
hasQmd,
|
|
7
10
|
qmdEmbed,
|
|
8
11
|
qmdUpdate
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5PJ4STIC.js";
|
|
10
13
|
import {
|
|
11
14
|
DEFAULT_CATEGORIES,
|
|
12
15
|
TYPE_TO_CATEGORY
|
|
@@ -29,7 +32,9 @@ var ClawVault = class {
|
|
|
29
32
|
initialized = false;
|
|
30
33
|
constructor(vaultPath) {
|
|
31
34
|
if (!hasQmd()) {
|
|
32
|
-
|
|
35
|
+
const error = new QmdUnavailableError("NOT_INSTALLED");
|
|
36
|
+
console.error(error.toUserMessage());
|
|
37
|
+
throw error;
|
|
33
38
|
}
|
|
34
39
|
this.config = {
|
|
35
40
|
path: path.resolve(vaultPath),
|
|
@@ -46,7 +51,9 @@ var ClawVault = class {
|
|
|
46
51
|
*/
|
|
47
52
|
async init(options = {}, initFlags) {
|
|
48
53
|
if (!hasQmd()) {
|
|
49
|
-
|
|
54
|
+
const error = new QmdUnavailableError("NOT_INSTALLED");
|
|
55
|
+
console.error(error.toUserMessage());
|
|
56
|
+
throw error;
|
|
50
57
|
}
|
|
51
58
|
const vaultPath = this.config.path;
|
|
52
59
|
const flags = initFlags || {};
|
|
@@ -200,7 +207,9 @@ var ClawVault = class {
|
|
|
200
207
|
*/
|
|
201
208
|
async load() {
|
|
202
209
|
if (!hasQmd()) {
|
|
203
|
-
|
|
210
|
+
const error = new QmdUnavailableError("NOT_INSTALLED");
|
|
211
|
+
console.error(error.toUserMessage());
|
|
212
|
+
throw error;
|
|
204
213
|
}
|
|
205
214
|
const vaultPath = this.config.path;
|
|
206
215
|
const configPath = path.join(vaultPath, CONFIG_FILE);
|
|
@@ -624,14 +633,15 @@ var ClawVault = class {
|
|
|
624
633
|
md += `## Recent Sessions
|
|
625
634
|
`;
|
|
626
635
|
for (const h of recap.recentHandoffs) {
|
|
636
|
+
const datePart = this.extractDatePart(h.created);
|
|
627
637
|
if (brief) {
|
|
628
|
-
md += `- **${
|
|
638
|
+
md += `- **${datePart}:** ${h.workingOn.slice(0, 2).join(", ")}`;
|
|
629
639
|
if (h.nextSteps.length > 0) md += ` \u2192 ${h.nextSteps[0]}`;
|
|
630
640
|
md += `
|
|
631
641
|
`;
|
|
632
642
|
} else {
|
|
633
643
|
md += `
|
|
634
|
-
### ${
|
|
644
|
+
### ${datePart}
|
|
635
645
|
`;
|
|
636
646
|
md += `**Working on:** ${h.workingOn.join(", ")}
|
|
637
647
|
`;
|
|
@@ -689,7 +699,7 @@ var ClawVault = class {
|
|
|
689
699
|
*/
|
|
690
700
|
parseHandoff(doc) {
|
|
691
701
|
return {
|
|
692
|
-
created: doc.frontmatter.date
|
|
702
|
+
created: this.toDateString(doc.frontmatter.date, doc.modified.toISOString()),
|
|
693
703
|
sessionKey: doc.frontmatter.sessionKey,
|
|
694
704
|
workingOn: doc.frontmatter.workingOn || [],
|
|
695
705
|
blocked: doc.frontmatter.blocked || [],
|
|
@@ -700,9 +710,39 @@ var ClawVault = class {
|
|
|
700
710
|
};
|
|
701
711
|
}
|
|
702
712
|
// === Private helpers ===
|
|
713
|
+
/**
|
|
714
|
+
* Safely convert a date value to ISO string format.
|
|
715
|
+
* Handles Date objects, strings, and undefined values.
|
|
716
|
+
*/
|
|
717
|
+
toDateString(value, fallback) {
|
|
718
|
+
if (value instanceof Date) {
|
|
719
|
+
return value.toISOString();
|
|
720
|
+
}
|
|
721
|
+
if (typeof value === "string" && value.length > 0) {
|
|
722
|
+
return value;
|
|
723
|
+
}
|
|
724
|
+
return fallback || (/* @__PURE__ */ new Date()).toISOString();
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Extract the date portion (YYYY-MM-DD) from an ISO date string or Date object.
|
|
728
|
+
* Provides safe handling for various date formats.
|
|
729
|
+
*/
|
|
730
|
+
extractDatePart(value) {
|
|
731
|
+
const dateStr = this.toDateString(value);
|
|
732
|
+
if (dateStr.includes("T")) {
|
|
733
|
+
return dateStr.split("T")[0];
|
|
734
|
+
}
|
|
735
|
+
return dateStr.slice(0, 10);
|
|
736
|
+
}
|
|
703
737
|
applyQmdConfig(meta) {
|
|
704
|
-
const
|
|
705
|
-
const
|
|
738
|
+
const explicitCollection = meta?.qmdCollection || this.config.qmdCollection;
|
|
739
|
+
const explicitRoot = meta?.qmdRoot || this.config.qmdRoot || this.config.path;
|
|
740
|
+
const qmdConfig = loadVaultQmdConfig(this.config.path);
|
|
741
|
+
const collection = explicitCollection || qmdConfig.qmdCollection || this.config.name;
|
|
742
|
+
const root = explicitRoot || qmdConfig.qmdRoot;
|
|
743
|
+
if (qmdConfig.autoDetected) {
|
|
744
|
+
console.warn(`[clawvault] Auto-detected qmd collection: ${collection}`);
|
|
745
|
+
}
|
|
706
746
|
this.config.qmdCollection = collection;
|
|
707
747
|
this.config.qmdRoot = root;
|
|
708
748
|
this.search.setVaultPath(this.config.path);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listConfig
|
|
3
|
+
} from "./chunk-URXDAUVH.js";
|
|
1
4
|
import {
|
|
2
5
|
requestLlmCompletion,
|
|
3
6
|
resolveLlmProvider
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
listConfig
|
|
7
|
-
} from "./chunk-ITPEXLHA.js";
|
|
7
|
+
} from "./chunk-YXQCA6B7.js";
|
|
8
8
|
import {
|
|
9
9
|
getMemoryGraph,
|
|
10
10
|
loadMemoryGraphIndex
|
|
@@ -1,13 +1,48 @@
|
|
|
1
1
|
// src/lib/llm-provider.ts
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import * as os from "os";
|
|
2
5
|
var DEFAULT_MODELS = {
|
|
3
6
|
anthropic: "claude-3-5-haiku-latest",
|
|
4
7
|
openai: "gpt-4o-mini",
|
|
5
|
-
gemini: "gemini-2.0-flash"
|
|
8
|
+
gemini: "gemini-2.0-flash",
|
|
9
|
+
xai: "grok-2-latest",
|
|
10
|
+
openclaw: "gpt-4o-mini"
|
|
6
11
|
};
|
|
12
|
+
var XAI_BASE_URL = "https://api.x.ai/v1";
|
|
13
|
+
function resolveOpenClawProvider() {
|
|
14
|
+
try {
|
|
15
|
+
const openclawHome = process.env.OPENCLAW_HOME?.trim() || path.join(os.homedir(), ".openclaw");
|
|
16
|
+
const modelsPath = path.join(openclawHome, "agents", "main", "agent", "models.json");
|
|
17
|
+
if (!fs.existsSync(modelsPath)) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const raw = JSON.parse(fs.readFileSync(modelsPath, "utf-8"));
|
|
21
|
+
if (!raw.providers || typeof raw.providers !== "object") {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
for (const [, provider] of Object.entries(raw.providers)) {
|
|
25
|
+
if (provider.baseUrl && provider.apiKey) {
|
|
26
|
+
const defaultModel = provider.models?.[0]?.id ?? "gpt-4o-mini";
|
|
27
|
+
return {
|
|
28
|
+
baseUrl: provider.baseUrl.replace(/\/+$/, ""),
|
|
29
|
+
apiKey: provider.apiKey,
|
|
30
|
+
api: provider.api ?? "openai-completions",
|
|
31
|
+
defaultModel
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
} catch {
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
7
39
|
function resolveLlmProvider() {
|
|
8
40
|
if (process.env.CLAWVAULT_NO_LLM) {
|
|
9
41
|
return null;
|
|
10
42
|
}
|
|
43
|
+
if (resolveOpenClawProvider()) {
|
|
44
|
+
return "openclaw";
|
|
45
|
+
}
|
|
11
46
|
if (process.env.ANTHROPIC_API_KEY) {
|
|
12
47
|
return "anthropic";
|
|
13
48
|
}
|
|
@@ -17,6 +52,9 @@ function resolveLlmProvider() {
|
|
|
17
52
|
if (process.env.GEMINI_API_KEY) {
|
|
18
53
|
return "gemini";
|
|
19
54
|
}
|
|
55
|
+
if (process.env.XAI_API_KEY) {
|
|
56
|
+
return "xai";
|
|
57
|
+
}
|
|
20
58
|
return null;
|
|
21
59
|
}
|
|
22
60
|
async function requestLlmCompletion(options) {
|
|
@@ -24,12 +62,18 @@ async function requestLlmCompletion(options) {
|
|
|
24
62
|
if (!provider) {
|
|
25
63
|
return "";
|
|
26
64
|
}
|
|
65
|
+
if (provider === "openclaw") {
|
|
66
|
+
return callOpenClaw(options);
|
|
67
|
+
}
|
|
27
68
|
if (provider === "anthropic") {
|
|
28
69
|
return callAnthropic(options, provider);
|
|
29
70
|
}
|
|
30
71
|
if (provider === "gemini") {
|
|
31
72
|
return callGemini(options, provider);
|
|
32
73
|
}
|
|
74
|
+
if (provider === "xai") {
|
|
75
|
+
return callXAI(options, provider);
|
|
76
|
+
}
|
|
33
77
|
return callOpenAI(options, provider);
|
|
34
78
|
}
|
|
35
79
|
async function callAnthropic(options, provider) {
|
|
@@ -88,6 +132,36 @@ async function callOpenAI(options, provider) {
|
|
|
88
132
|
const payload = await response.json();
|
|
89
133
|
return payload.choices?.[0]?.message?.content?.trim() ?? "";
|
|
90
134
|
}
|
|
135
|
+
async function callXAI(options, provider) {
|
|
136
|
+
const apiKey = process.env.XAI_API_KEY;
|
|
137
|
+
if (!apiKey) {
|
|
138
|
+
return "";
|
|
139
|
+
}
|
|
140
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
141
|
+
const messages = [];
|
|
142
|
+
if (options.systemPrompt?.trim()) {
|
|
143
|
+
messages.push({ role: "system", content: options.systemPrompt.trim() });
|
|
144
|
+
}
|
|
145
|
+
messages.push({ role: "user", content: options.prompt });
|
|
146
|
+
const response = await fetchImpl(`${XAI_BASE_URL}/chat/completions`, {
|
|
147
|
+
method: "POST",
|
|
148
|
+
headers: {
|
|
149
|
+
"content-type": "application/json",
|
|
150
|
+
authorization: `Bearer ${apiKey}`
|
|
151
|
+
},
|
|
152
|
+
body: JSON.stringify({
|
|
153
|
+
model: options.model ?? DEFAULT_MODELS[provider],
|
|
154
|
+
temperature: options.temperature ?? 0.1,
|
|
155
|
+
max_tokens: options.maxTokens ?? 1200,
|
|
156
|
+
messages
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
throw new Error(`xAI request failed (${response.status})`);
|
|
161
|
+
}
|
|
162
|
+
const payload = await response.json();
|
|
163
|
+
return payload.choices?.[0]?.message?.content?.trim() ?? "";
|
|
164
|
+
}
|
|
91
165
|
async function callGemini(options, provider) {
|
|
92
166
|
const apiKey = process.env.GEMINI_API_KEY;
|
|
93
167
|
if (!apiKey) {
|
|
@@ -115,6 +189,36 @@ async function callGemini(options, provider) {
|
|
|
115
189
|
const payload = await response.json();
|
|
116
190
|
return payload.candidates?.[0]?.content?.parts?.[0]?.text?.trim() ?? "";
|
|
117
191
|
}
|
|
192
|
+
async function callOpenClaw(options) {
|
|
193
|
+
const config = resolveOpenClawProvider();
|
|
194
|
+
if (!config) {
|
|
195
|
+
return "";
|
|
196
|
+
}
|
|
197
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
198
|
+
const messages = [];
|
|
199
|
+
if (options.systemPrompt?.trim()) {
|
|
200
|
+
messages.push({ role: "system", content: options.systemPrompt.trim() });
|
|
201
|
+
}
|
|
202
|
+
messages.push({ role: "user", content: options.prompt });
|
|
203
|
+
const response = await fetchImpl(`${config.baseUrl}/chat/completions`, {
|
|
204
|
+
method: "POST",
|
|
205
|
+
headers: {
|
|
206
|
+
"content-type": "application/json",
|
|
207
|
+
authorization: `Bearer ${config.apiKey}`
|
|
208
|
+
},
|
|
209
|
+
body: JSON.stringify({
|
|
210
|
+
model: options.model ?? config.defaultModel,
|
|
211
|
+
temperature: options.temperature ?? 0.1,
|
|
212
|
+
max_tokens: options.maxTokens ?? 1200,
|
|
213
|
+
messages
|
|
214
|
+
})
|
|
215
|
+
});
|
|
216
|
+
if (!response.ok) {
|
|
217
|
+
throw new Error(`OpenClaw provider request failed (${response.status})`);
|
|
218
|
+
}
|
|
219
|
+
const payload = await response.json();
|
|
220
|
+
return payload.choices?.[0]?.message?.content?.trim() ?? "";
|
|
221
|
+
}
|
|
118
222
|
|
|
119
223
|
export {
|
|
120
224
|
resolveLlmProvider,
|
package/dist/cli/index.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerCliCommands
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-MPOSMDMU.js";
|
|
4
|
+
import "../chunk-Y6VJKXGL.js";
|
|
5
5
|
import "../chunk-TIGW564L.js";
|
|
6
6
|
import "../chunk-IVRIKYFE.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-P7SY3D4E.js";
|
|
8
8
|
import "../chunk-P5EPF6MB.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-Q2J5YTUF.js";
|
|
9
|
+
import "../chunk-S5OJEGFG.js";
|
|
10
|
+
import "../chunk-MNPUYCHQ.js";
|
|
11
|
+
import "../chunk-LIGHWOH6.js";
|
|
12
|
+
import "../chunk-627Q3QWK.js";
|
|
13
|
+
import "../chunk-OQGYFZ4A.js";
|
|
15
14
|
import "../chunk-AZYOKJYC.js";
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-HRLWZGMA.js";
|
|
16
|
+
import "../chunk-YDWHS4LJ.js";
|
|
17
17
|
import "../chunk-FHFUXL6G.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-ECRZL5XR.js";
|
|
19
|
+
import "../chunk-WIOLLGAD.js";
|
|
20
|
+
import "../chunk-5PJ4STIC.js";
|
|
21
|
+
import "../chunk-YNIPYN4F.js";
|
|
22
|
+
import "../chunk-URXDAUVH.js";
|
|
23
|
+
import "../chunk-YXQCA6B7.js";
|
|
23
24
|
import "../chunk-2CDEETQN.js";
|
|
24
25
|
import "../chunk-MQUJNOHK.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-GNJL4YGR.js";
|
|
26
27
|
import "../chunk-ZZA73MFY.js";
|
|
27
28
|
import "../chunk-Z2XBWN7A.js";
|
|
28
29
|
import "../chunk-QWQ3TIKS.js";
|
|
29
30
|
import "../chunk-MFAWT5O5.js";
|
|
30
31
|
import "../chunk-7766SIJP.js";
|
|
32
|
+
import "../chunk-2ZDO52B4.js";
|
|
31
33
|
export {
|
|
32
34
|
registerCliCommands
|
|
33
35
|
};
|
package/dist/commands/archive.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
archiveCommand,
|
|
3
3
|
registerArchiveCommand
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-2RAZ4ZFE.js";
|
|
5
5
|
import "../chunk-MQUJNOHK.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-GNJL4YGR.js";
|
|
7
7
|
import "../chunk-Z2XBWN7A.js";
|
|
8
|
+
import "../chunk-2ZDO52B4.js";
|
|
8
9
|
export {
|
|
9
10
|
archiveCommand,
|
|
10
11
|
registerArchiveCommand
|
package/dist/commands/backlog.js
CHANGED
package/dist/commands/blocked.js
CHANGED
package/dist/commands/canvas.js
CHANGED
package/dist/commands/compat.js
CHANGED
package/dist/commands/context.js
CHANGED
|
@@ -3,13 +3,15 @@ import {
|
|
|
3
3
|
contextCommand,
|
|
4
4
|
formatContextMarkdown,
|
|
5
5
|
registerContextCommand
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-LIGHWOH6.js";
|
|
7
|
+
import "../chunk-YDWHS4LJ.js";
|
|
8
8
|
import "../chunk-FHFUXL6G.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-WIOLLGAD.js";
|
|
10
|
+
import "../chunk-5PJ4STIC.js";
|
|
10
11
|
import "../chunk-2CDEETQN.js";
|
|
11
12
|
import "../chunk-ZZA73MFY.js";
|
|
12
13
|
import "../chunk-Z2XBWN7A.js";
|
|
14
|
+
import "../chunk-2ZDO52B4.js";
|
|
13
15
|
export {
|
|
14
16
|
buildContext,
|
|
15
17
|
contextCommand,
|
|
@@ -4,13 +4,22 @@ interface DoctorCheck {
|
|
|
4
4
|
status: DoctorStatus;
|
|
5
5
|
detail?: string;
|
|
6
6
|
hint?: string;
|
|
7
|
+
category?: 'system' | 'migration' | 'health';
|
|
7
8
|
}
|
|
8
9
|
interface DoctorReport {
|
|
9
10
|
vaultPath?: string;
|
|
10
11
|
checks: DoctorCheck[];
|
|
11
12
|
warnings: number;
|
|
12
13
|
errors: number;
|
|
14
|
+
migrationIssues: MigrationIssue[];
|
|
13
15
|
}
|
|
16
|
+
interface MigrationIssue {
|
|
17
|
+
type: MigrationIssueType;
|
|
18
|
+
description: string;
|
|
19
|
+
autoFixable: boolean;
|
|
20
|
+
details?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
type MigrationIssueType = 'stale_collection_name' | 'missing_qmd_collection' | 'wrong_vault_path' | 'orphaned_collection' | 'missing_qmd_config' | 'legacy_config_format';
|
|
14
23
|
declare function doctor(vaultPath?: string): Promise<DoctorReport>;
|
|
15
24
|
|
|
16
|
-
export { type DoctorCheck, type DoctorReport, type DoctorStatus, doctor };
|
|
25
|
+
export { type DoctorCheck, type DoctorReport, type DoctorStatus, type MigrationIssue, type MigrationIssueType, doctor };
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
doctor
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-MFL6EEPF.js";
|
|
4
4
|
import "../chunk-7ZRP733D.js";
|
|
5
5
|
import "../chunk-4VQTUVH7.js";
|
|
6
6
|
import "../chunk-J7ZWCI2C.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-Q2J5YTUF.js";
|
|
7
|
+
import "../chunk-627Q3QWK.js";
|
|
8
|
+
import "../chunk-OQGYFZ4A.js";
|
|
10
9
|
import "../chunk-AZYOKJYC.js";
|
|
11
|
-
import "../chunk-
|
|
10
|
+
import "../chunk-HRLWZGMA.js";
|
|
11
|
+
import "../chunk-YDWHS4LJ.js";
|
|
12
12
|
import "../chunk-FHFUXL6G.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-WIOLLGAD.js";
|
|
14
|
+
import "../chunk-5PJ4STIC.js";
|
|
15
|
+
import "../chunk-URXDAUVH.js";
|
|
16
|
+
import "../chunk-YXQCA6B7.js";
|
|
15
17
|
import "../chunk-2CDEETQN.js";
|
|
16
18
|
import "../chunk-ZZA73MFY.js";
|
|
17
19
|
import "../chunk-Z2XBWN7A.js";
|
|
18
20
|
import "../chunk-QWQ3TIKS.js";
|
|
19
21
|
import "../chunk-MFAWT5O5.js";
|
|
20
22
|
import "../chunk-7766SIJP.js";
|
|
21
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-X3SPPUFG.js";
|
|
24
|
+
import "../chunk-2ZDO52B4.js";
|
|
22
25
|
export {
|
|
23
26
|
doctor
|
|
24
27
|
};
|
package/dist/commands/embed.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedCommand,
|
|
3
3
|
registerEmbedCommand
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-ECRZL5XR.js";
|
|
5
|
+
import "../chunk-WIOLLGAD.js";
|
|
6
|
+
import "../chunk-5PJ4STIC.js";
|
|
7
|
+
import "../chunk-GNJL4YGR.js";
|
|
8
|
+
import "../chunk-2ZDO52B4.js";
|
|
7
9
|
export {
|
|
8
10
|
embedCommand,
|
|
9
11
|
registerEmbedCommand
|
package/dist/commands/graph.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
graphCommand,
|
|
3
3
|
graphSummary
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IIOU45CK.js";
|
|
5
|
+
import "../chunk-GNJL4YGR.js";
|
|
6
6
|
import "../chunk-ZZA73MFY.js";
|
|
7
|
+
import "../chunk-2ZDO52B4.js";
|
|
7
8
|
export {
|
|
8
9
|
graphCommand,
|
|
9
10
|
graphSummary
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import 'commander';
|
|
2
|
-
export { I as InjectCommandOptions, a as InjectFormat, q as buildInjectionResult, v as injectCommand, x as registerInjectCommand } from '../inject-
|
|
2
|
+
export { I as InjectCommandOptions, a as InjectFormat, q as buildInjectionResult, v as injectCommand, x as registerInjectCommand } from '../inject-DYUrDqQO.js';
|
package/dist/commands/inject.js
CHANGED
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
buildInjectionResult,
|
|
3
3
|
injectCommand,
|
|
4
4
|
registerInjectCommand
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-YNIPYN4F.js";
|
|
6
|
+
import "../chunk-URXDAUVH.js";
|
|
7
|
+
import "../chunk-YXQCA6B7.js";
|
|
8
8
|
import "../chunk-2CDEETQN.js";
|
|
9
9
|
import "../chunk-ZZA73MFY.js";
|
|
10
|
+
import "../chunk-2ZDO52B4.js";
|
|
10
11
|
export {
|
|
11
12
|
buildInjectionResult,
|
|
12
13
|
injectCommand,
|
package/dist/commands/kanban.js
CHANGED
package/dist/commands/link.js
CHANGED
|
@@ -13,10 +13,11 @@ import {
|
|
|
13
13
|
} from "../chunk-J7ZWCI2C.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveVaultPath
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-GNJL4YGR.js";
|
|
17
17
|
import {
|
|
18
18
|
buildOrUpdateMemoryGraphIndex
|
|
19
19
|
} from "../chunk-ZZA73MFY.js";
|
|
20
|
+
import "../chunk-2ZDO52B4.js";
|
|
20
21
|
|
|
21
22
|
// src/commands/link.ts
|
|
22
23
|
import * as fs from "fs";
|
|
@@ -2,10 +2,11 @@ import {
|
|
|
2
2
|
migrateObservations,
|
|
3
3
|
migrateObservationsCommand,
|
|
4
4
|
registerMigrateObservationsCommand
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-2JQ3O2YL.js";
|
|
6
6
|
import "../chunk-FHFUXL6G.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-GNJL4YGR.js";
|
|
8
8
|
import "../chunk-Z2XBWN7A.js";
|
|
9
|
+
import "../chunk-2ZDO52B4.js";
|
|
9
10
|
export {
|
|
10
11
|
migrateObservations,
|
|
11
12
|
migrateObservationsCommand,
|