@lyriel/openclaw-plugin 0.4.4 → 0.4.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/auto-update.js +134 -0
- package/dist/auto-update.js.map +1 -0
- package/dist/index.js +65 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Update-availability check for the Lyriel OpenClaw plugin.
|
|
2
|
+
//
|
|
3
|
+
// On gateway_start we hit the npm registry for the latest published version
|
|
4
|
+
// of @lyriel/openclaw-plugin. If a newer version exists, we log a one-line
|
|
5
|
+
// notice telling the user how to install it. We do NOT subprocess — OpenClaw
|
|
6
|
+
// blocks plugins that spawn external processes (rightly so), and a plugin
|
|
7
|
+
// that installs code is a real attack surface even when "we" wrote it.
|
|
8
|
+
//
|
|
9
|
+
// The install command itself runs in the user's terminal under their own
|
|
10
|
+
// shell, where they can audit it. This is the same pattern Hermes uses.
|
|
11
|
+
//
|
|
12
|
+
// Escape hatch:
|
|
13
|
+
// LYRIEL_NO_AUTOUPDATE=1 — skip the check entirely
|
|
14
|
+
// LYRIEL_UPDATE_CHANNEL — registry dist-tag to track (default "latest")
|
|
15
|
+
import { readFile } from "node:fs/promises";
|
|
16
|
+
import { dirname, join } from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
const PACKAGE_NAME = "@lyriel/openclaw-plugin";
|
|
19
|
+
const REGISTRY_BASE = "https://registry.npmjs.org";
|
|
20
|
+
const REGISTRY_TIMEOUT_MS = 4000;
|
|
21
|
+
function parseSemver(raw) {
|
|
22
|
+
const m = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(raw.trim());
|
|
23
|
+
if (!m)
|
|
24
|
+
return null;
|
|
25
|
+
return {
|
|
26
|
+
major: Number(m[1]),
|
|
27
|
+
minor: Number(m[2]),
|
|
28
|
+
patch: Number(m[3]),
|
|
29
|
+
pre: m[4] ?? null,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function compareSemver(a, b) {
|
|
33
|
+
if (a.major !== b.major)
|
|
34
|
+
return a.major - b.major;
|
|
35
|
+
if (a.minor !== b.minor)
|
|
36
|
+
return a.minor - b.minor;
|
|
37
|
+
if (a.patch !== b.patch)
|
|
38
|
+
return a.patch - b.patch;
|
|
39
|
+
// A version with a prerelease tag is *lower* than one without.
|
|
40
|
+
if (a.pre === null && b.pre !== null)
|
|
41
|
+
return 1;
|
|
42
|
+
if (a.pre !== null && b.pre === null)
|
|
43
|
+
return -1;
|
|
44
|
+
if (a.pre === b.pre)
|
|
45
|
+
return 0;
|
|
46
|
+
return (a.pre ?? "") < (b.pre ?? "") ? -1 : 1;
|
|
47
|
+
}
|
|
48
|
+
async function fetchJsonWithTimeout(url, timeoutMs) {
|
|
49
|
+
const controller = new AbortController();
|
|
50
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
51
|
+
try {
|
|
52
|
+
const res = await fetch(url, {
|
|
53
|
+
signal: controller.signal,
|
|
54
|
+
headers: { accept: "application/json" },
|
|
55
|
+
});
|
|
56
|
+
if (!res.ok) {
|
|
57
|
+
throw new Error(`registry returned ${res.status}`);
|
|
58
|
+
}
|
|
59
|
+
return await res.json();
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function findPluginVersion() {
|
|
66
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
67
|
+
for (let i = 0; i < 8; i++) {
|
|
68
|
+
try {
|
|
69
|
+
const pkgPath = join(dir, "package.json");
|
|
70
|
+
const raw = await readFile(pkgPath, "utf8");
|
|
71
|
+
const pkg = JSON.parse(raw);
|
|
72
|
+
if (typeof pkg.name === "string" &&
|
|
73
|
+
pkg.name === PACKAGE_NAME &&
|
|
74
|
+
typeof pkg.version === "string") {
|
|
75
|
+
return pkg.version;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// fall through and keep walking up
|
|
80
|
+
}
|
|
81
|
+
const parent = dirname(dir);
|
|
82
|
+
if (parent === dir)
|
|
83
|
+
break;
|
|
84
|
+
dir = parent;
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
async function fetchLatestVersion(distTag) {
|
|
89
|
+
const url = `${REGISTRY_BASE}/${PACKAGE_NAME.replace("/", "%2F")}/${encodeURIComponent(distTag)}`;
|
|
90
|
+
const body = (await fetchJsonWithTimeout(url, REGISTRY_TIMEOUT_MS));
|
|
91
|
+
return typeof body.version === "string" ? body.version : null;
|
|
92
|
+
}
|
|
93
|
+
export async function runAutoUpdate(logger) {
|
|
94
|
+
if (process.env.LYRIEL_NO_AUTOUPDATE === "1") {
|
|
95
|
+
return { status: "skipped", reason: "LYRIEL_NO_AUTOUPDATE=1" };
|
|
96
|
+
}
|
|
97
|
+
const distTag = (process.env.LYRIEL_UPDATE_CHANNEL ?? "latest").trim() || "latest";
|
|
98
|
+
const currentVersion = await findPluginVersion();
|
|
99
|
+
if (!currentVersion) {
|
|
100
|
+
return { status: "skipped", reason: "could not locate plugin package.json on disk" };
|
|
101
|
+
}
|
|
102
|
+
const current = parseSemver(currentVersion);
|
|
103
|
+
if (!current) {
|
|
104
|
+
return { status: "skipped", reason: `unparseable current version ${currentVersion}` };
|
|
105
|
+
}
|
|
106
|
+
let latestRaw;
|
|
107
|
+
try {
|
|
108
|
+
latestRaw = await fetchLatestVersion(distTag);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
return { status: "skipped", reason: `registry check failed: ${err.message}` };
|
|
112
|
+
}
|
|
113
|
+
if (!latestRaw) {
|
|
114
|
+
return { status: "skipped", reason: "registry returned no version" };
|
|
115
|
+
}
|
|
116
|
+
const latest = parseSemver(latestRaw);
|
|
117
|
+
if (!latest) {
|
|
118
|
+
return { status: "skipped", reason: `unparseable latest version ${latestRaw}` };
|
|
119
|
+
}
|
|
120
|
+
if (compareSemver(latest, current) <= 0) {
|
|
121
|
+
return { status: "current", version: currentVersion };
|
|
122
|
+
}
|
|
123
|
+
// Newer version available — log a one-liner with the upgrade command.
|
|
124
|
+
// We deliberately do NOT shell out: OpenClaw's security scanner blocks
|
|
125
|
+
// plugins that spawn external processes, and auto-installing code is
|
|
126
|
+
// a real attack surface even when the package is "ours."
|
|
127
|
+
const isMajor = latest.major !== current.major;
|
|
128
|
+
const prefix = isMajor
|
|
129
|
+
? `Lyriel plugin: NEW MAJOR available (${currentVersion} → ${latestRaw}) — review changelog before upgrading.`
|
|
130
|
+
: `Lyriel plugin: update available (${currentVersion} → ${latestRaw}).`;
|
|
131
|
+
logger.info(`${prefix} To upgrade: npm install -g ${PACKAGE_NAME}@${latestRaw} && openclaw plugins install ${PACKAGE_NAME}`);
|
|
132
|
+
return { status: "notified", from: currentVersion, to: latestRaw };
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=auto-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-update.js","sourceRoot":"","sources":["../auto-update.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,6EAA6E;AAC7E,0EAA0E;AAC1E,uEAAuE;AACvE,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,EAAE;AACF,gBAAgB;AAChB,sDAAsD;AACtD,4EAA4E;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,YAAY,GAAG,yBAAyB,CAAC;AAC/C,MAAM,aAAa,GAAG,4BAA4B,CAAC;AACnD,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAUjC,SAAS,WAAW,CAAC,GAAW;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,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;AACrE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
// baseUrl — defaults to https://lyriel.ai; override for dev
|
|
29
29
|
// surfaceSessionKey — optional pinned session key (otherwise auto-tracked)
|
|
30
30
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
31
|
+
import { toolPluginMetadataSymbol } from "openclaw/plugin-sdk/tool-plugin";
|
|
32
|
+
import { runAutoUpdate } from "./auto-update.js";
|
|
31
33
|
import { createInboxRunner } from "./inbox.js";
|
|
32
34
|
import { resolveTelegramSurface } from "./telegram.js";
|
|
33
35
|
import { buildToolDescriptors } from "./tools.js";
|
|
@@ -43,7 +45,7 @@ function parseConfig(raw) {
|
|
|
43
45
|
surfaceTelegramChatId: typeof o.surfaceTelegramChatId === "string" ? o.surfaceTelegramChatId : undefined,
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
|
-
|
|
48
|
+
const pluginEntry = definePluginEntry({
|
|
47
49
|
id: "lyriel",
|
|
48
50
|
name: "Lyriel",
|
|
49
51
|
description: "Lyriel plugin for OpenClaw — agent-mediated communication substrate. Long-polls /api/inbox, surfaces dispatches into the active session, and exposes five tools for asks and group plans.",
|
|
@@ -116,6 +118,10 @@ export default definePluginEntry({
|
|
|
116
118
|
},
|
|
117
119
|
});
|
|
118
120
|
api.on("gateway_start", async () => {
|
|
121
|
+
// Fire-and-forget — never block gateway_start on the registry or npm.
|
|
122
|
+
void runAutoUpdate(api.logger).catch((err) => {
|
|
123
|
+
api.logger.warn(`Lyriel plugin: auto-update check threw — ${err.message}`);
|
|
124
|
+
});
|
|
119
125
|
if (!apiKey) {
|
|
120
126
|
api.logger.warn("Lyriel plugin: gateway_start received but apiKey is empty — not starting inbox poll loop.");
|
|
121
127
|
return;
|
|
@@ -129,4 +135,62 @@ export default definePluginEntry({
|
|
|
129
135
|
});
|
|
130
136
|
},
|
|
131
137
|
});
|
|
138
|
+
// Attach the tool-plugin metadata symbol so OpenClaw's MCP bridge
|
|
139
|
+
// recognizes this plugin as a tool plugin and exposes its tools to
|
|
140
|
+
// the agent's tool inventory. WITHOUT this symbol, definePluginEntry-
|
|
141
|
+
// based plugins register tools in the gateway's plugin tool registry
|
|
142
|
+
// (and stock plugins like file-transfer that ship bundled work fine
|
|
143
|
+
// this way), but third-party plugins seem to need the metadata
|
|
144
|
+
// symbol present for the MCP bridge to pick them up.
|
|
145
|
+
//
|
|
146
|
+
// We attach it manually rather than using defineToolPlugin because
|
|
147
|
+
// defineToolPlugin's generated register() only registers tools — it
|
|
148
|
+
// has no path for our background inbox poll loop. By going via
|
|
149
|
+
// definePluginEntry + manual metadata attachment, we get both: the
|
|
150
|
+
// full register lifecycle for inbox + tools AND the metadata symbol
|
|
151
|
+
// that signals "expose these tools to the agent."
|
|
152
|
+
//
|
|
153
|
+
// The metadata mirrors what defineToolPlugin would have emitted: it's
|
|
154
|
+
// a static snapshot of the tool catalog (name + label + description +
|
|
155
|
+
// JSON-schema parameters) that the MCP bridge reads to advertise the
|
|
156
|
+
// tools to the agent's tools/list response. The actual handler
|
|
157
|
+
// dispatch still flows through the api.registerTool calls inside
|
|
158
|
+
// register() — the metadata is just the catalog surface.
|
|
159
|
+
//
|
|
160
|
+
// Note: parameters here are the *typebox schemas*; OpenClaw should
|
|
161
|
+
// convert them to JSON Schema for MCP advertisement. If MCP requires
|
|
162
|
+
// pre-converted JSON Schema, a follow-up will run the typebox schemas
|
|
163
|
+
// through @sinclair/typebox's `TypeCompiler` or similar at build time.
|
|
164
|
+
{
|
|
165
|
+
// Build descriptors once with an empty client config — only the
|
|
166
|
+
// shape metadata matters here, not the executors.
|
|
167
|
+
const sampleDescriptors = buildToolDescriptors({ apiKey: "", baseUrl: "" });
|
|
168
|
+
const metadata = {
|
|
169
|
+
id: pluginEntry.id,
|
|
170
|
+
name: pluginEntry.name,
|
|
171
|
+
description: pluginEntry.description,
|
|
172
|
+
activation: { onStartup: true },
|
|
173
|
+
configSchema: {
|
|
174
|
+
type: "object",
|
|
175
|
+
additionalProperties: false,
|
|
176
|
+
properties: {
|
|
177
|
+
apiKey: { type: "string" },
|
|
178
|
+
baseUrl: { type: "string", default: "https://lyriel.ai" },
|
|
179
|
+
surfaceSessionKey: { type: "string" },
|
|
180
|
+
surfaceTelegramChatId: { type: "string" },
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
tools: sampleDescriptors.map((t) => ({
|
|
184
|
+
name: t.name,
|
|
185
|
+
label: t.label ?? t.name,
|
|
186
|
+
description: t.description,
|
|
187
|
+
parameters: t.parameters,
|
|
188
|
+
})),
|
|
189
|
+
};
|
|
190
|
+
Object.defineProperty(pluginEntry, toolPluginMetadataSymbol, {
|
|
191
|
+
value: metadata,
|
|
192
|
+
enumerable: false,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
export default pluginEntry;
|
|
132
196
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,uEAAuE;AACvE,EAAE;AACF,sCAAsC;AACtC,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,mDAAmD;AACnD,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,oEAAoE;AACpE,0DAA0D;AAC1D,sDAAsD;AACtD,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,gDAAgD;AAChD,kEAAkE;AAClE,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,wEAAwE;AACxE,6EAA6E;AAE7E,OAAO,EAAE,iBAAiB,EAA0B,MAAM,kCAAkC,CAAC;
|
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