@memtensor/memos-local-openclaw-plugin 1.0.2-beta.4 → 1.0.2-beta.6
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/capture/index.js +52 -8
- package/dist/capture/index.js.map +1 -1
- package/dist/ingest/chunker.d.ts +3 -4
- package/dist/ingest/chunker.d.ts.map +1 -1
- package/dist/ingest/chunker.js +19 -24
- package/dist/ingest/chunker.js.map +1 -1
- package/dist/ingest/providers/anthropic.d.ts +3 -1
- package/dist/ingest/providers/anthropic.d.ts.map +1 -1
- package/dist/ingest/providers/anthropic.js +90 -51
- package/dist/ingest/providers/anthropic.js.map +1 -1
- package/dist/ingest/providers/bedrock.d.ts +3 -1
- package/dist/ingest/providers/bedrock.d.ts.map +1 -1
- package/dist/ingest/providers/bedrock.js +90 -51
- package/dist/ingest/providers/bedrock.js.map +1 -1
- package/dist/ingest/providers/gemini.d.ts +3 -1
- package/dist/ingest/providers/gemini.d.ts.map +1 -1
- package/dist/ingest/providers/gemini.js +88 -51
- package/dist/ingest/providers/gemini.js.map +1 -1
- package/dist/ingest/providers/index.d.ts +3 -1
- package/dist/ingest/providers/index.d.ts.map +1 -1
- package/dist/ingest/providers/index.js +70 -30
- package/dist/ingest/providers/index.js.map +1 -1
- package/dist/ingest/providers/openai.d.ts +3 -1
- package/dist/ingest/providers/openai.d.ts.map +1 -1
- package/dist/ingest/providers/openai.js +91 -51
- package/dist/ingest/providers/openai.js.map +1 -1
- package/dist/ingest/task-processor.d.ts +1 -0
- package/dist/ingest/task-processor.d.ts.map +1 -1
- package/dist/ingest/task-processor.js +33 -9
- package/dist/ingest/task-processor.js.map +1 -1
- package/dist/ingest/worker.d.ts.map +1 -1
- package/dist/ingest/worker.js +29 -13
- package/dist/ingest/worker.js.map +1 -1
- package/dist/recall/engine.d.ts.map +1 -1
- package/dist/recall/engine.js +19 -14
- package/dist/recall/engine.js.map +1 -1
- package/dist/skill/bundled-memory-guide.d.ts +1 -5
- package/dist/skill/bundled-memory-guide.d.ts.map +1 -1
- package/dist/skill/bundled-memory-guide.js +38 -88
- package/dist/skill/bundled-memory-guide.js.map +1 -1
- package/dist/skill/evaluator.js +1 -1
- package/dist/storage/sqlite.d.ts +1 -2
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +90 -17
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/tools/memory-get.d.ts.map +1 -1
- package/dist/tools/memory-get.js +1 -3
- package/dist/tools/memory-get.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/update-check.d.ts +21 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +111 -0
- package/dist/update-check.js.map +1 -0
- package/dist/viewer/html.d.ts +1 -1
- package/dist/viewer/html.d.ts.map +1 -1
- package/dist/viewer/html.js +608 -234
- package/dist/viewer/html.js.map +1 -1
- package/dist/viewer/server.d.ts +2 -1
- package/dist/viewer/server.d.ts.map +1 -1
- package/dist/viewer/server.js +201 -90
- package/dist/viewer/server.js.map +1 -1
- package/index.ts +206 -198
- package/openclaw.plugin.json +3 -0
- package/package.json +6 -1
- package/scripts/postinstall.cjs +69 -2
- package/skill/memos-memory-guide/SKILL.md +73 -36
- package/src/capture/index.ts +52 -8
- package/src/ingest/chunker.ts +22 -30
- package/src/ingest/providers/anthropic.ts +100 -53
- package/src/ingest/providers/bedrock.ts +101 -53
- package/src/ingest/providers/gemini.ts +100 -53
- package/src/ingest/providers/index.ts +81 -35
- package/src/ingest/providers/openai.ts +101 -53
- package/src/ingest/task-processor.ts +29 -8
- package/src/ingest/worker.ts +31 -13
- package/src/recall/engine.ts +20 -13
- package/src/skill/bundled-memory-guide.ts +5 -87
- package/src/skill/evaluator.ts +1 -1
- package/src/storage/sqlite.ts +93 -21
- package/src/tools/memory-get.ts +1 -4
- package/src/types.ts +2 -9
- package/src/update-check.ts +96 -0
- package/src/viewer/html.ts +607 -233
- package/src/viewer/server.ts +152 -82
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel-aware update check against npm registry dist-tags.
|
|
3
|
+
* - Prerelease users (e.g. 1.0.2-beta.x) compare against beta tag only (semver gt).
|
|
4
|
+
* - Stable users compare against latest tag only (semver gt).
|
|
5
|
+
* - Beta users get optional stableChannel hint to install @latest when stable exists.
|
|
6
|
+
*/
|
|
7
|
+
// @ts-ignore — semver has no bundled types
|
|
8
|
+
import * as semver from "semver";
|
|
9
|
+
|
|
10
|
+
export interface UpdateCheckResult {
|
|
11
|
+
updateAvailable: boolean;
|
|
12
|
+
current: string;
|
|
13
|
+
/** Version on the channel we compared against (beta tag or latest tag). */
|
|
14
|
+
latest: string;
|
|
15
|
+
packageName: string;
|
|
16
|
+
/** Channel used for the primary comparison. */
|
|
17
|
+
channel: "beta" | "latest";
|
|
18
|
+
/** Full install command (includes @beta when updating on beta channel). */
|
|
19
|
+
installCommand: string;
|
|
20
|
+
/** When current is prerelease and registry has a stable latest — how to switch to stable. */
|
|
21
|
+
stableChannel?: { version: string; installCommand: string };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function isPrerelease(v: string): boolean {
|
|
25
|
+
return semver.prerelease(v) != null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Fetch registry package doc and compute update state.
|
|
30
|
+
*/
|
|
31
|
+
export async function computeUpdateCheck(
|
|
32
|
+
packageName: string,
|
|
33
|
+
current: string,
|
|
34
|
+
fetchImpl: typeof fetch,
|
|
35
|
+
timeoutMs = 8_000,
|
|
36
|
+
): Promise<UpdateCheckResult | null> {
|
|
37
|
+
if (!semver.valid(current)) return null;
|
|
38
|
+
|
|
39
|
+
const url = `https://registry.npmjs.org/${encodeURIComponent(packageName)}`;
|
|
40
|
+
const resp = await fetchImpl(url, { signal: AbortSignal.timeout(timeoutMs) });
|
|
41
|
+
if (!resp.ok) return null;
|
|
42
|
+
|
|
43
|
+
const data = (await resp.json()) as { "dist-tags"?: Record<string, string> };
|
|
44
|
+
const tags = data["dist-tags"] ?? {};
|
|
45
|
+
const latestTag = tags.latest;
|
|
46
|
+
const betaTag = tags.beta;
|
|
47
|
+
|
|
48
|
+
const onBeta = isPrerelease(current);
|
|
49
|
+
let updateAvailable = false;
|
|
50
|
+
let channel: "beta" | "latest" = "latest";
|
|
51
|
+
let targetVersion = current;
|
|
52
|
+
let installCommand = `openclaw plugins install ${packageName}`;
|
|
53
|
+
|
|
54
|
+
if (onBeta) {
|
|
55
|
+
channel = "beta";
|
|
56
|
+
// Beta users: only compare against beta tag; never suggest "updating" to stable via gt confusion.
|
|
57
|
+
if (betaTag && semver.valid(betaTag) && semver.gt(betaTag, current)) {
|
|
58
|
+
updateAvailable = true;
|
|
59
|
+
targetVersion = betaTag;
|
|
60
|
+
installCommand = `openclaw plugins install ${packageName}@beta`;
|
|
61
|
+
} else {
|
|
62
|
+
targetVersion = betaTag && semver.valid(betaTag) ? betaTag : current;
|
|
63
|
+
if (betaTag && semver.valid(betaTag) && semver.eq(betaTag, current)) {
|
|
64
|
+
installCommand = `openclaw plugins install ${packageName}@beta`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
// Stable users: compare against latest only.
|
|
69
|
+
if (latestTag && semver.valid(latestTag) && semver.gt(latestTag, current)) {
|
|
70
|
+
updateAvailable = true;
|
|
71
|
+
targetVersion = latestTag;
|
|
72
|
+
installCommand = `openclaw plugins install ${packageName}`;
|
|
73
|
+
} else {
|
|
74
|
+
targetVersion = latestTag && semver.valid(latestTag) ? latestTag : current;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Beta user + stable exists on latest: optional hint to switch to stable (not counted as "update").
|
|
79
|
+
let stableChannel: UpdateCheckResult["stableChannel"];
|
|
80
|
+
if (onBeta && latestTag && semver.valid(latestTag) && !isPrerelease(latestTag)) {
|
|
81
|
+
stableChannel = {
|
|
82
|
+
version: latestTag,
|
|
83
|
+
installCommand: `openclaw plugins install ${packageName}@latest`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
updateAvailable,
|
|
89
|
+
current,
|
|
90
|
+
latest: targetVersion,
|
|
91
|
+
packageName,
|
|
92
|
+
channel,
|
|
93
|
+
installCommand,
|
|
94
|
+
stableChannel,
|
|
95
|
+
};
|
|
96
|
+
}
|