@u1in/loom-plugin-check-updates 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 u1in
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,54 @@
1
- # Temporary Holding Version
1
+ # @u1in/loom-plugin-check-updates
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 在构建期把一个只读的更新检查脚本写进产物,并在入口插一句执行提示。插件本身不查更新——真正的比较发生在技能执行时,对着该技能自己的发布地址做一次。
4
+
5
+ ```ts
6
+ import { defineConfig } from '@u1in/loom-core';
7
+ import { checkUpdates } from '@u1in/loom-plugin-check-updates';
8
+
9
+ export default defineConfig({
10
+ baseUrl: 'https://git.example.com/org/skills/-/raw/skill-release/skills/{{name}}/',
11
+ plugins: [checkUpdates()],
12
+ });
13
+ ```
14
+
15
+ 默认生成 `scripts/check-updates.mjs`,并在第一个标题后插入一段:
16
+
17
+ > **执行前**:运行 `node scripts/check-updates.mjs`(只读,3 秒内返回;无 node 跳过)。输出 `outdated` 时告知用户本地与上游版本并询问是否更新,不自行覆盖;输出其他内容忽略。
18
+
19
+ ## 脚本行为
20
+
21
+ 脚本读同级 `SKILL.md` 的 `metadata.version`,向上游取同一字段,比一次,向 stdout 输出一行 JSON。
22
+
23
+ | `status` | 含义 | 退出码 |
24
+ | --- | --- | --- |
25
+ | `current` | 版本相同 | 0 |
26
+ | `outdated` | 上游更高 | 0 |
27
+ | `ahead` | 本地更高,通常是本地改过版本 | 0 |
28
+ | `unknown` | 取不到本地或上游版本,`reason` 说明原因 | 2 |
29
+
30
+ - 版本按 SemVer 比较,含预发布标识:`0.2.0` 高于 `0.2.0-beta.1`。
31
+ - 上游版本缓存在用户缓存目录(`XDG_CACHE_HOME`、`LOCALAPPDATA` 或 `~/.cache` 下的 `loom/updates/`),不写安装目录。
32
+ - `--explain` 把本地版本、上游版本和来源地址打到 stderr;`--no-cache` 跳过缓存重新请求。
33
+ - 只读:不下载、不覆盖、不改安装目录里的任何文件。更新与否仍由用户决定。
34
+ - 上游不可达、超时、本地版本缺失都只输出 `unknown` 并退出 2,不阻塞技能。
35
+
36
+ ## 选项
37
+
38
+ | 字段 | 说明 |
39
+ | --- | --- |
40
+ | `skills` | 只作用于列出的 Skill,省略时作用于本次构建的全部 Skill。 |
41
+ | `file` | 脚本在产物里的路径,默认 `scripts/check-updates.mjs`,必须是 `.mjs` 或 `.js`。 |
42
+ | `source` | 上游 `SKILL.md` 的原文地址。省略时由 `baseUrl` 补上 `SKILL.md`。 |
43
+ | `notice` | 替换入口提示语,`false` 表示只发脚本不插提示。 |
44
+ | `ttlHours` | 上游版本缓存小时数,默认 `24`,`0` 表示每次都请求。 |
45
+ | `timeoutMs` | 单次请求超时,默认 `3000`。 |
46
+
47
+ ## 注意
48
+
49
+ - 插件按需安装,不随 Core 自动启用:它会改变技能的执行行为,应当由作者显式选择。
50
+ - 插件固定声明 `priority: 'early'`。它自己把提示语插在首个标题后,不参与 `prefixPlugin()` 的插入游标,所以先执行、随后被公共指引顶到下方,最终排在它们之后。
51
+ - 靠 `<import>` 展开的公共指引在变换之后才展开,无法用档位把它们排到提示语前面;需要那个顺序时把公共指引改成插件注入,或把 `notice` 设为 `false` 自己写一行。
52
+ - 自定义提示语照常参与插值与替换,可以写 `{{name}}`、`{{version}}`。
53
+ - 产物里已有同名文件时跳过并告警,作者自己的脚本优先。
54
+ - 没有 `baseUrl` 也没有 `source` 时构建失败——上游地址必须能在构建期确定,否则脚本无从比对。
@@ -0,0 +1,57 @@
1
+ import { Root } from 'mdast';
2
+
3
+ interface CheckUpdatesOptions {
4
+ /** 只作用于列出的 Skill,省略时作用于本次构建的全部 Skill。 */
5
+ skills?: string[];
6
+ /** 检查脚本在产物里的路径,必须是 .mjs 或 .js。 */
7
+ file?: string;
8
+ /** 上游 SKILL.md 的原文地址,省略时由 baseUrl 推导。 */
9
+ source?: string;
10
+ /** 替换入口里的提示语,false 表示只发脚本不插入提示。 */
11
+ notice?: string | false;
12
+ /** 上游版本的缓存小时数,0 表示每次都请求。 */
13
+ ttlHours?: number;
14
+ /** 单次请求超时毫秒数。 */
15
+ timeoutMs?: number;
16
+ }
17
+ /** 与 Core 的 EmitContext 对齐的最小子集,避免包间循环依赖。 */
18
+ interface CheckUpdatesEmitContext {
19
+ readonly skillName: string;
20
+ readonly metadata: Readonly<Record<string, unknown>>;
21
+ readonly baseUrl?: string;
22
+ hasOutputFile(path: string): boolean;
23
+ emit(path: string, content: string | Buffer): void;
24
+ }
25
+ /** 与 Core 的 PluginAPI 对齐的最小子集。 */
26
+ interface CheckUpdatesAPI {
27
+ readonly ctx: {
28
+ readonly config: {
29
+ skills: readonly {
30
+ name: string;
31
+ entry?: string;
32
+ }[];
33
+ };
34
+ logger: {
35
+ warn(message: string): void;
36
+ };
37
+ };
38
+ addTransform(fn: (tree: Root, ctx: {
39
+ skillName: string;
40
+ }) => Root, options?: {
41
+ phase?: 'before-replace' | 'after-replace';
42
+ }): void;
43
+ onEmitFiles(fn: (ctx: CheckUpdatesEmitContext) => void | Promise<void>): void;
44
+ }
45
+ /** 上游地址优先取显式配置,其次由发布地址补齐 SKILL.md。 */
46
+ declare const resolveUpstream: (baseUrl?: string, source?: string) => string | undefined;
47
+ /**
48
+ * 构建期把一个只读的更新检查脚本写进产物,并在入口插入一句执行提示。
49
+ * 插件本身不检查更新;真正的比较发生在技能执行时。
50
+ */
51
+ declare const checkUpdates: (input?: CheckUpdatesOptions) => {
52
+ name: string;
53
+ priority: "early";
54
+ apply: (api: CheckUpdatesAPI) => void;
55
+ };
56
+
57
+ export { type CheckUpdatesAPI, type CheckUpdatesEmitContext, type CheckUpdatesOptions, checkUpdates, resolveUpstream };
package/dist/index.js ADDED
@@ -0,0 +1,306 @@
1
+ // src/index.ts
2
+ import frontmatter from "remark-frontmatter";
3
+ import parse from "remark-parse";
4
+ import { unified } from "unified";
5
+ import { z } from "zod";
6
+
7
+ // src/runtime.ts
8
+ var RUNTIME = `#!/usr/bin/env node
9
+ // \u7531 @u1in/loom-plugin-check-updates \u751F\u6210\uFF0C\u8BF7\u52FF\u624B\u6539\u3002
10
+ // \u8BFB\u53D6\u540C\u7EA7 SKILL.md \u7684 metadata.version\uFF0C\u4E0E\u4E0A\u6E38\u526F\u672C\u6BD4\u8F83\uFF0C\u5411 stdout \u8F93\u51FA\u4E00\u884C JSON\u3002
11
+ // \u9000\u51FA\u7801\uFF1A0 \u8868\u793A\u68C0\u67E5\u5B8C\u6210\uFF08\u542B outdated\uFF09\uFF0C2 \u8868\u793A\u65E0\u6CD5\u5224\u65AD\u3002
12
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
13
+ import { homedir } from 'node:os';
14
+ import path from 'node:path';
15
+ import { fileURLToPath } from 'node:url';
16
+
17
+ const CONFIG = {
18
+ name: {{name}},
19
+ upstream: {{upstream}},
20
+ ttlHours: {{ttlHours}},
21
+ timeoutMs: {{timeoutMs}},
22
+ skillMd: {{skillMd}},
23
+ };
24
+
25
+ const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
26
+ const SKILL_MD = path.join(SCRIPT_DIR, CONFIG.skillMd);
27
+ const SEMVER = /^v?(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\+([0-9A-Za-z.-]+))?$/;
28
+
29
+ const unquote = (value) => {
30
+ const match = /^(['"])(.*)\\1$/.exec(value);
31
+ return match ? match[2] : value;
32
+ };
33
+
34
+ // \u53EA\u8BA4\u5757\u5F0F frontmatter \u91CC\u7684 metadata.version\uFF0C\u4E0E Loom \u5199\u51FA\u7684\u683C\u5F0F\u4E00\u81F4\u3002
35
+ const versionFromSkillMd = (text) => {
36
+ const block = /^---\\r?\\n([\\s\\S]*?)\\r?\\n---/.exec(text);
37
+ if (!block) return null;
38
+ let inside = false;
39
+ let fieldIndent = -1;
40
+ for (const line of block[1].split(/\\r?\\n/)) {
41
+ if (/^metadata:\\s*$/.test(line)) {
42
+ inside = true;
43
+ fieldIndent = -1;
44
+ continue;
45
+ }
46
+ if (!inside || !line.trim()) continue;
47
+ const indent = /^[ \\t]*/.exec(line)[0].length;
48
+ if (indent === 0) {
49
+ inside = false;
50
+ continue;
51
+ }
52
+ if (fieldIndent < 0) fieldIndent = indent;
53
+ if (indent !== fieldIndent) continue;
54
+ const field = /^version:\\s*(.+?)\\s*$/.exec(line.trim());
55
+ if (field) return unquote(field[1]);
56
+ }
57
+ return null;
58
+ };
59
+
60
+ const parseVersion = (value) => {
61
+ if (typeof value !== 'string') return null;
62
+ const match = SEMVER.exec(value.trim());
63
+ if (!match) return null;
64
+ return {
65
+ core: [Number(match[1]), Number(match[2]), Number(match[3])],
66
+ pre: match[4] ? match[4].split('.') : [],
67
+ };
68
+ };
69
+
70
+ // \u6309 SemVer \u6BD4\u8F83\uFF1A\u5148\u6BD4\u6570\u503C\uFF0C\u518D\u6BD4\u9884\u53D1\u5E03\u6807\u8BC6\uFF0C\u6B63\u5F0F\u7248\u9AD8\u4E8E\u540C\u53F7\u9884\u53D1\u5E03\u7248\u3002
71
+ const compareVersions = (left, right) => {
72
+ for (let index = 0; index < 3; index += 1)
73
+ if (left.core[index] !== right.core[index]) return left.core[index] < right.core[index] ? -1 : 1;
74
+ if (!left.pre.length && !right.pre.length) return 0;
75
+ if (!left.pre.length) return 1;
76
+ if (!right.pre.length) return -1;
77
+ const length = Math.max(left.pre.length, right.pre.length);
78
+ for (let index = 0; index < length; index += 1) {
79
+ const a = left.pre[index];
80
+ const b = right.pre[index];
81
+ if (a === undefined) return -1;
82
+ if (b === undefined) return 1;
83
+ const numericA = /^\\d+$/.test(a);
84
+ const numericB = /^\\d+$/.test(b);
85
+ if (numericA && numericB) {
86
+ if (Number(a) !== Number(b)) return Number(a) < Number(b) ? -1 : 1;
87
+ continue;
88
+ }
89
+ if (numericA !== numericB) return numericA ? -1 : 1;
90
+ if (a !== b) return a < b ? -1 : 1;
91
+ }
92
+ return 0;
93
+ };
94
+
95
+ // \u7F13\u5B58\u5199\u5728\u7528\u6237\u7F13\u5B58\u76EE\u5F55\uFF0C\u4E0D\u843D\u5B89\u88C5\u76EE\u5F55\uFF0C\u907F\u514D\u6C61\u67D3\u4EA7\u7269\u3002
96
+ const cacheFile = () => {
97
+ const base =
98
+ process.env.XDG_CACHE_HOME ||
99
+ (process.platform === 'win32' ? process.env.LOCALAPPDATA : undefined) ||
100
+ path.join(homedir(), '.cache');
101
+ return path.join(base, 'loom', 'updates', CONFIG.name + '.json');
102
+ };
103
+
104
+ const readCache = async () => {
105
+ try {
106
+ const value = JSON.parse(await readFile(cacheFile(), 'utf8'));
107
+ if (value && value.upstream === CONFIG.upstream && typeof value.version === 'string' && typeof value.at === 'number')
108
+ return value;
109
+ } catch {
110
+ // \u7F13\u5B58\u4E0D\u53EF\u7528\u4E0D\u5F71\u54CD\u7ED3\u8BBA\u3002
111
+ }
112
+ return null;
113
+ };
114
+
115
+ const writeCache = async (version) => {
116
+ try {
117
+ await mkdir(path.dirname(cacheFile()), { recursive: true });
118
+ await writeFile(
119
+ cacheFile(),
120
+ JSON.stringify({ upstream: CONFIG.upstream, version, at: Date.now() }) + '\\n',
121
+ );
122
+ } catch {
123
+ // \u5199\u4E0D\u8FDB\u7F13\u5B58\u4E0D\u5F71\u54CD\u672C\u8F6E\u7ED3\u8BBA\u3002
124
+ }
125
+ };
126
+
127
+ const remoteVersion = async (useCache) => {
128
+ if (useCache && CONFIG.ttlHours > 0) {
129
+ const cached = await readCache();
130
+ if (cached && Date.now() - cached.at < CONFIG.ttlHours * 3600000)
131
+ return { version: cached.version, cached: true };
132
+ }
133
+ const response = await fetch(CONFIG.upstream, {
134
+ signal: AbortSignal.timeout(CONFIG.timeoutMs),
135
+ redirect: 'follow',
136
+ });
137
+ if (!response.ok) throw new Error('HTTP ' + response.status);
138
+ const version = versionFromSkillMd(await response.text());
139
+ if (!version) throw new Error('upstream SKILL.md has no metadata.version');
140
+ await writeCache(version);
141
+ return { version, cached: false };
142
+ };
143
+
144
+ const finish = (result, code, explain) => {
145
+ process.stdout.write(JSON.stringify(result) + '\\n');
146
+ if (explain)
147
+ process.stderr.write(
148
+ 'local=' + result.local + ' remote=' + result.remote + ' upstream=' + result.upstream + ' cached=' + result.cached + '\\n',
149
+ );
150
+ process.exitCode = code;
151
+ };
152
+
153
+ const main = async () => {
154
+ const args = process.argv.slice(2);
155
+ const explain = args.includes('--explain');
156
+ const useCache = !args.includes('--no-cache');
157
+ const result = {
158
+ name: CONFIG.name,
159
+ status: 'unknown',
160
+ local: null,
161
+ remote: null,
162
+ upstream: CONFIG.upstream,
163
+ cached: false,
164
+ checked: Date.now(),
165
+ };
166
+
167
+ const text = await readFile(SKILL_MD, 'utf8').catch(() => null);
168
+ if (text === null) {
169
+ result.reason = 'cannot read ' + path.basename(SKILL_MD);
170
+ return finish(result, 2, explain);
171
+ }
172
+
173
+ result.local = versionFromSkillMd(text);
174
+ const local = parseVersion(result.local);
175
+ if (!local) {
176
+ result.reason = 'local version missing or unreadable';
177
+ return finish(result, 2, explain);
178
+ }
179
+
180
+ let remote;
181
+ try {
182
+ remote = await remoteVersion(useCache);
183
+ } catch (error) {
184
+ result.reason = 'upstream unavailable: ' + (error && error.message ? error.message : String(error));
185
+ return finish(result, 2, explain);
186
+ }
187
+
188
+ result.remote = remote.version;
189
+ result.cached = remote.cached;
190
+ const upstream = parseVersion(remote.version);
191
+ if (!upstream) {
192
+ result.reason = 'upstream version unreadable';
193
+ return finish(result, 2, explain);
194
+ }
195
+
196
+ const order = compareVersions(upstream, local);
197
+ result.status = order > 0 ? 'outdated' : order < 0 ? 'ahead' : 'current';
198
+ return finish(result, 0, explain);
199
+ };
200
+
201
+ main().catch((error) => {
202
+ process.stdout.write(
203
+ JSON.stringify({
204
+ name: CONFIG.name,
205
+ status: 'unknown',
206
+ upstream: CONFIG.upstream,
207
+ reason: String((error && error.message) || error),
208
+ }) + '\\n',
209
+ );
210
+ process.exitCode = 2;
211
+ });
212
+ `;
213
+ var renderRuntime = (input) => {
214
+ const skillMd = input.depth > 0 ? "../".repeat(input.depth) + "SKILL.md" : "SKILL.md";
215
+ const values = {
216
+ name: JSON.stringify(input.name),
217
+ upstream: JSON.stringify(input.upstream),
218
+ ttlHours: String(input.ttlHours),
219
+ timeoutMs: String(input.timeoutMs),
220
+ skillMd: JSON.stringify(skillMd)
221
+ };
222
+ const source = RUNTIME.replace(
223
+ /\{\{([A-Za-z]+)\}\}/g,
224
+ (match, key) => Object.hasOwn(values, key) ? values[key] ?? match : match
225
+ );
226
+ return source.endsWith("\n") ? source : source + "\n";
227
+ };
228
+
229
+ // src/index.ts
230
+ var DEFAULT_FILE = "scripts/check-updates.mjs";
231
+ var DEFAULT_TTL_HOURS = 24;
232
+ var DEFAULT_TIMEOUT_MS = 3e3;
233
+ var optionsSchema = z.object({
234
+ skills: z.array(z.string()).optional(),
235
+ file: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._/-]*\.(?:mjs|js)$/, "file must be a .mjs or .js path").optional(),
236
+ source: z.string().min(1).optional(),
237
+ notice: z.union([z.literal(false), z.string().min(1)]).optional(),
238
+ ttlHours: z.number().int().min(0).max(8760).optional(),
239
+ timeoutMs: z.number().int().min(100).max(6e4).optional()
240
+ }).strict();
241
+ var processor = unified().use(parse).use(frontmatter);
242
+ var defaultNotice = (file, seconds) => "**\u6267\u884C\u524D**\uFF1A\u8FD0\u884C `node " + file + "`\uFF08\u53EA\u8BFB\uFF0C" + seconds + " \u79D2\u5185\u8FD4\u56DE\uFF1B\u65E0 node \u8DF3\u8FC7\uFF09\u3002\u8F93\u51FA `outdated` \u65F6\u544A\u77E5\u7528\u6237\u672C\u5730\u4E0E\u4E0A\u6E38\u7248\u672C\u5E76\u8BE2\u95EE\u662F\u5426\u66F4\u65B0\uFF0C\u4E0D\u81EA\u884C\u8986\u76D6\uFF1B\u8F93\u51FA\u5176\u4ED6\u5185\u5BB9\u5FFD\u7565\u3002";
243
+ var parseOptions = (input) => {
244
+ const parsed = optionsSchema.safeParse(input);
245
+ if (parsed.success) return parsed.data;
246
+ const problems = parsed.error.issues.map((issue) => (issue.path.join(".") || "options") + ": " + issue.message).join("; ");
247
+ throw new Error("checkUpdates " + problems);
248
+ };
249
+ var resolveUpstream = (baseUrl, source) => {
250
+ if (source) return source;
251
+ if (!baseUrl) return void 0;
252
+ return (baseUrl.endsWith("/") ? baseUrl : baseUrl + "/") + "SKILL.md";
253
+ };
254
+ var checkUpdates = (input = {}) => {
255
+ const options = parseOptions(input);
256
+ const file = options.file ?? DEFAULT_FILE;
257
+ const ttlHours = options.ttlHours ?? DEFAULT_TTL_HOURS;
258
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
259
+ const seconds = Math.max(1, Math.round(timeoutMs / 1e3));
260
+ const noticeText = options.notice === false ? void 0 : options.notice ?? defaultNotice(file, seconds);
261
+ const depth = file.split("/").length - 1;
262
+ return {
263
+ name: "loom:check-updates",
264
+ // 先插入的提示语会被后插入的公共指引顶到下方,因此这一档由本插件固定。
265
+ priority: "early",
266
+ apply: (api) => {
267
+ const { config, logger } = api.ctx;
268
+ const names = new Set(config.skills.map((skill) => skill.name));
269
+ for (const name of options.skills ?? [])
270
+ if (!names.has(name)) throw new Error("Unknown skill: " + name);
271
+ if (noticeText) {
272
+ api.addTransform((tree, { skillName }) => {
273
+ if (options.skills && !options.skills.includes(skillName)) return tree;
274
+ const children = processor.parse(noticeText).children.filter(
275
+ (node) => node.type !== "yaml"
276
+ );
277
+ const heading = tree.children.findIndex((node) => node.type === "heading");
278
+ const frontmatterAt = tree.children.findIndex((node) => node.type === "yaml");
279
+ tree.children.splice(heading >= 0 ? heading + 1 : frontmatterAt + 1, 0, ...children);
280
+ return tree;
281
+ });
282
+ }
283
+ api.onEmitFiles((ctx) => {
284
+ if (options.skills && !options.skills.includes(ctx.skillName)) return;
285
+ const upstream = resolveUpstream(ctx.baseUrl, options.source);
286
+ if (!upstream)
287
+ throw new Error(
288
+ ctx.skillName + ": check-updates source is unknown, set baseUrl or checkUpdates.source"
289
+ );
290
+ if (ctx.hasOutputFile(file)) {
291
+ logger.warn(ctx.skillName + ": " + file + " exists in source or output, skipped");
292
+ return;
293
+ }
294
+ ctx.emit(
295
+ file,
296
+ renderRuntime({ name: ctx.skillName, upstream, ttlHours, timeoutMs, depth })
297
+ );
298
+ });
299
+ }
300
+ };
301
+ };
302
+ export {
303
+ checkUpdates,
304
+ resolveUpstream
305
+ };
306
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/runtime.ts"],"sourcesContent":["import type { Root } from 'mdast';\nimport frontmatter from 'remark-frontmatter';\nimport parse from 'remark-parse';\nimport { unified } from 'unified';\nimport { z } from 'zod';\nimport { renderRuntime } from './runtime';\n\nexport interface CheckUpdatesOptions {\n /** 只作用于列出的 Skill,省略时作用于本次构建的全部 Skill。 */\n skills?: string[];\n /** 检查脚本在产物里的路径,必须是 .mjs 或 .js。 */\n file?: string;\n /** 上游 SKILL.md 的原文地址,省略时由 baseUrl 推导。 */\n source?: string;\n /** 替换入口里的提示语,false 表示只发脚本不插入提示。 */\n notice?: string | false;\n /** 上游版本的缓存小时数,0 表示每次都请求。 */\n ttlHours?: number;\n /** 单次请求超时毫秒数。 */\n timeoutMs?: number;\n}\n\n/** 与 Core 的 EmitContext 对齐的最小子集,避免包间循环依赖。 */\nexport interface CheckUpdatesEmitContext {\n readonly skillName: string;\n readonly metadata: Readonly<Record<string, unknown>>;\n readonly baseUrl?: string;\n hasOutputFile(path: string): boolean;\n emit(path: string, content: string | Buffer): void;\n}\n\n/** 与 Core 的 PluginAPI 对齐的最小子集。 */\nexport interface CheckUpdatesAPI {\n readonly ctx: {\n readonly config: { skills: readonly { name: string; entry?: string }[] };\n logger: { warn(message: string): void };\n };\n addTransform(\n fn: (tree: Root, ctx: { skillName: string }) => Root,\n options?: { phase?: 'before-replace' | 'after-replace' },\n ): void;\n onEmitFiles(fn: (ctx: CheckUpdatesEmitContext) => void | Promise<void>): void;\n}\n\nconst DEFAULT_FILE = 'scripts/check-updates.mjs';\nconst DEFAULT_TTL_HOURS = 24;\nconst DEFAULT_TIMEOUT_MS = 3000;\n\nconst optionsSchema = z\n .object({\n skills: z.array(z.string()).optional(),\n file: z\n .string()\n .regex(/^[A-Za-z0-9][A-Za-z0-9._/-]*\\.(?:mjs|js)$/, 'file must be a .mjs or .js path')\n .optional(),\n source: z.string().min(1).optional(),\n notice: z.union([z.literal(false), z.string().min(1)]).optional(),\n ttlHours: z.number().int().min(0).max(8760).optional(),\n timeoutMs: z.number().int().min(100).max(60000).optional(),\n })\n .strict();\n\nconst processor = unified().use(parse).use(frontmatter);\n\nconst defaultNotice = (file: string, seconds: number): string =>\n '**执行前**:运行 `node ' +\n file +\n '`(只读,' +\n seconds +\n ' 秒内返回;无 node 跳过)。' +\n '输出 `outdated` 时告知用户本地与上游版本并询问是否更新,不自行覆盖;输出其他内容忽略。';\n\nconst parseOptions = (input: CheckUpdatesOptions) => {\n const parsed = optionsSchema.safeParse(input);\n if (parsed.success) return parsed.data;\n const problems = parsed.error.issues\n .map((issue) => (issue.path.join('.') || 'options') + ': ' + issue.message)\n .join('; ');\n throw new Error('checkUpdates ' + problems);\n};\n\n/** 上游地址优先取显式配置,其次由发布地址补齐 SKILL.md。 */\nexport const resolveUpstream = (baseUrl?: string, source?: string): string | undefined => {\n if (source) return source;\n if (!baseUrl) return undefined;\n return (baseUrl.endsWith('/') ? baseUrl : baseUrl + '/') + 'SKILL.md';\n};\n\n/**\n * 构建期把一个只读的更新检查脚本写进产物,并在入口插入一句执行提示。\n * 插件本身不检查更新;真正的比较发生在技能执行时。\n */\nexport const checkUpdates = (input: CheckUpdatesOptions = {}) => {\n const options = parseOptions(input);\n const file = options.file ?? DEFAULT_FILE;\n const ttlHours = options.ttlHours ?? DEFAULT_TTL_HOURS;\n const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n const seconds = Math.max(1, Math.round(timeoutMs / 1000));\n const noticeText =\n options.notice === false ? undefined : (options.notice ?? defaultNotice(file, seconds));\n const depth = file.split('/').length - 1;\n\n return {\n name: 'loom:check-updates',\n // 先插入的提示语会被后插入的公共指引顶到下方,因此这一档由本插件固定。\n priority: 'early' as const,\n apply: (api: CheckUpdatesAPI) => {\n const { config, logger } = api.ctx;\n const names = new Set(config.skills.map((skill) => skill.name));\n for (const name of options.skills ?? [])\n if (!names.has(name)) throw new Error('Unknown skill: ' + name);\n\n if (noticeText) {\n // 插在首个标题之后,排在所有公共指引之前;自定义提示语参与插值与替换。\n api.addTransform((tree, { skillName }) => {\n if (options.skills && !options.skills.includes(skillName)) return tree;\n const children = (processor.parse(noticeText) as Root).children.filter(\n (node) => node.type !== 'yaml',\n );\n const heading = tree.children.findIndex((node) => node.type === 'heading');\n const frontmatterAt = tree.children.findIndex((node) => node.type === 'yaml');\n tree.children.splice(heading >= 0 ? heading + 1 : frontmatterAt + 1, 0, ...children);\n return tree;\n });\n }\n\n api.onEmitFiles((ctx) => {\n if (options.skills && !options.skills.includes(ctx.skillName)) return;\n const upstream = resolveUpstream(ctx.baseUrl, options.source);\n if (!upstream)\n throw new Error(\n ctx.skillName + ': check-updates source is unknown, set baseUrl or checkUpdates.source',\n );\n if (ctx.hasOutputFile(file)) {\n logger.warn(ctx.skillName + ': ' + file + ' exists in source or output, skipped');\n return;\n }\n ctx.emit(\n file,\n renderRuntime({ name: ctx.skillName, upstream, ttlHours, timeoutMs, depth }),\n );\n });\n },\n };\n};\n","export interface RuntimeInput {\n /** Skill 名,用作缓存文件名。 */\n name: string;\n /** 上游 SKILL.md 的原文地址,构建期确定,写死在脚本里。 */\n upstream: string;\n /** 缓存有效期,0 表示每次都向上游请求。 */\n ttlHours: number;\n timeoutMs: number;\n /** 脚本目录到 Skill 根的层级,用来定位同级的 SKILL.md。 */\n depth: number;\n}\n\n/**\n * 随产物发出的检查脚本。零依赖、只读、失败一律降级为 status=unknown。\n * 这里用占位符拼装,避免与 TypeScript 的模板插值混淆。\n */\nconst RUNTIME = `#!/usr/bin/env node\n// 由 @u1in/loom-plugin-check-updates 生成,请勿手改。\n// 读取同级 SKILL.md 的 metadata.version,与上游副本比较,向 stdout 输出一行 JSON。\n// 退出码:0 表示检查完成(含 outdated),2 表示无法判断。\nimport { mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst CONFIG = {\n name: {{name}},\n upstream: {{upstream}},\n ttlHours: {{ttlHours}},\n timeoutMs: {{timeoutMs}},\n skillMd: {{skillMd}},\n};\n\nconst SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));\nconst SKILL_MD = path.join(SCRIPT_DIR, CONFIG.skillMd);\nconst SEMVER = /^v?(\\\\d+)\\\\.(\\\\d+)\\\\.(\\\\d+)(?:-([0-9A-Za-z.-]+))?(?:\\\\+([0-9A-Za-z.-]+))?$/;\n\nconst unquote = (value) => {\n const match = /^(['\"])(.*)\\\\1$/.exec(value);\n return match ? match[2] : value;\n};\n\n// 只认块式 frontmatter 里的 metadata.version,与 Loom 写出的格式一致。\nconst versionFromSkillMd = (text) => {\n const block = /^---\\\\r?\\\\n([\\\\s\\\\S]*?)\\\\r?\\\\n---/.exec(text);\n if (!block) return null;\n let inside = false;\n let fieldIndent = -1;\n for (const line of block[1].split(/\\\\r?\\\\n/)) {\n if (/^metadata:\\\\s*$/.test(line)) {\n inside = true;\n fieldIndent = -1;\n continue;\n }\n if (!inside || !line.trim()) continue;\n const indent = /^[ \\\\t]*/.exec(line)[0].length;\n if (indent === 0) {\n inside = false;\n continue;\n }\n if (fieldIndent < 0) fieldIndent = indent;\n if (indent !== fieldIndent) continue;\n const field = /^version:\\\\s*(.+?)\\\\s*$/.exec(line.trim());\n if (field) return unquote(field[1]);\n }\n return null;\n};\n\nconst parseVersion = (value) => {\n if (typeof value !== 'string') return null;\n const match = SEMVER.exec(value.trim());\n if (!match) return null;\n return {\n core: [Number(match[1]), Number(match[2]), Number(match[3])],\n pre: match[4] ? match[4].split('.') : [],\n };\n};\n\n// 按 SemVer 比较:先比数值,再比预发布标识,正式版高于同号预发布版。\nconst compareVersions = (left, right) => {\n for (let index = 0; index < 3; index += 1)\n if (left.core[index] !== right.core[index]) return left.core[index] < right.core[index] ? -1 : 1;\n if (!left.pre.length && !right.pre.length) return 0;\n if (!left.pre.length) return 1;\n if (!right.pre.length) return -1;\n const length = Math.max(left.pre.length, right.pre.length);\n for (let index = 0; index < length; index += 1) {\n const a = left.pre[index];\n const b = right.pre[index];\n if (a === undefined) return -1;\n if (b === undefined) return 1;\n const numericA = /^\\\\d+$/.test(a);\n const numericB = /^\\\\d+$/.test(b);\n if (numericA && numericB) {\n if (Number(a) !== Number(b)) return Number(a) < Number(b) ? -1 : 1;\n continue;\n }\n if (numericA !== numericB) return numericA ? -1 : 1;\n if (a !== b) return a < b ? -1 : 1;\n }\n return 0;\n};\n\n// 缓存写在用户缓存目录,不落安装目录,避免污染产物。\nconst cacheFile = () => {\n const base =\n process.env.XDG_CACHE_HOME ||\n (process.platform === 'win32' ? process.env.LOCALAPPDATA : undefined) ||\n path.join(homedir(), '.cache');\n return path.join(base, 'loom', 'updates', CONFIG.name + '.json');\n};\n\nconst readCache = async () => {\n try {\n const value = JSON.parse(await readFile(cacheFile(), 'utf8'));\n if (value && value.upstream === CONFIG.upstream && typeof value.version === 'string' && typeof value.at === 'number')\n return value;\n } catch {\n // 缓存不可用不影响结论。\n }\n return null;\n};\n\nconst writeCache = async (version) => {\n try {\n await mkdir(path.dirname(cacheFile()), { recursive: true });\n await writeFile(\n cacheFile(),\n JSON.stringify({ upstream: CONFIG.upstream, version, at: Date.now() }) + '\\\\n',\n );\n } catch {\n // 写不进缓存不影响本轮结论。\n }\n};\n\nconst remoteVersion = async (useCache) => {\n if (useCache && CONFIG.ttlHours > 0) {\n const cached = await readCache();\n if (cached && Date.now() - cached.at < CONFIG.ttlHours * 3600000)\n return { version: cached.version, cached: true };\n }\n const response = await fetch(CONFIG.upstream, {\n signal: AbortSignal.timeout(CONFIG.timeoutMs),\n redirect: 'follow',\n });\n if (!response.ok) throw new Error('HTTP ' + response.status);\n const version = versionFromSkillMd(await response.text());\n if (!version) throw new Error('upstream SKILL.md has no metadata.version');\n await writeCache(version);\n return { version, cached: false };\n};\n\nconst finish = (result, code, explain) => {\n process.stdout.write(JSON.stringify(result) + '\\\\n');\n if (explain)\n process.stderr.write(\n 'local=' + result.local + ' remote=' + result.remote + ' upstream=' + result.upstream + ' cached=' + result.cached + '\\\\n',\n );\n process.exitCode = code;\n};\n\nconst main = async () => {\n const args = process.argv.slice(2);\n const explain = args.includes('--explain');\n const useCache = !args.includes('--no-cache');\n const result = {\n name: CONFIG.name,\n status: 'unknown',\n local: null,\n remote: null,\n upstream: CONFIG.upstream,\n cached: false,\n checked: Date.now(),\n };\n\n const text = await readFile(SKILL_MD, 'utf8').catch(() => null);\n if (text === null) {\n result.reason = 'cannot read ' + path.basename(SKILL_MD);\n return finish(result, 2, explain);\n }\n\n result.local = versionFromSkillMd(text);\n const local = parseVersion(result.local);\n if (!local) {\n result.reason = 'local version missing or unreadable';\n return finish(result, 2, explain);\n }\n\n let remote;\n try {\n remote = await remoteVersion(useCache);\n } catch (error) {\n result.reason = 'upstream unavailable: ' + (error && error.message ? error.message : String(error));\n return finish(result, 2, explain);\n }\n\n result.remote = remote.version;\n result.cached = remote.cached;\n const upstream = parseVersion(remote.version);\n if (!upstream) {\n result.reason = 'upstream version unreadable';\n return finish(result, 2, explain);\n }\n\n const order = compareVersions(upstream, local);\n result.status = order > 0 ? 'outdated' : order < 0 ? 'ahead' : 'current';\n return finish(result, 0, explain);\n};\n\nmain().catch((error) => {\n process.stdout.write(\n JSON.stringify({\n name: CONFIG.name,\n status: 'unknown',\n upstream: CONFIG.upstream,\n reason: String((error && error.message) || error),\n }) + '\\\\n',\n );\n process.exitCode = 2;\n});\n`;\n\nexport const renderRuntime = (input: RuntimeInput): string => {\n const skillMd = input.depth > 0 ? '../'.repeat(input.depth) + 'SKILL.md' : 'SKILL.md';\n const values: Record<string, string> = {\n name: JSON.stringify(input.name),\n upstream: JSON.stringify(input.upstream),\n ttlHours: String(input.ttlHours),\n timeoutMs: String(input.timeoutMs),\n skillMd: JSON.stringify(skillMd),\n };\n const source = RUNTIME.replace(/\\{\\{([A-Za-z]+)\\}\\}/g, (match, key: string) =>\n Object.hasOwn(values, key) ? (values[key] ?? match) : match,\n );\n return source.endsWith('\\n') ? source : source + '\\n';\n};\n"],"mappings":";AACA,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,SAAS;;;ACYlB,IAAM,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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UAAU,MAAM,UAAU,EAAW,SAAS;AAAA,YAC9D,CAAC,SAAS,KAAK,SAAS;AAAA,UAC1B;AACA,gBAAM,UAAU,KAAK,SAAS,UAAU,CAAC,SAAS,KAAK,SAAS,SAAS;AACzE,gBAAM,gBAAgB,KAAK,SAAS,UAAU,CAAC,SAAS,KAAK,SAAS,MAAM;AAC5E,eAAK,SAAS,OAAO,WAAW,IAAI,UAAU,IAAI,gBAAgB,GAAG,GAAG,GAAG,QAAQ;AACnF,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AAEA,UAAI,YAAY,CAAC,QAAQ;AACvB,YAAI,QAAQ,UAAU,CAAC,QAAQ,OAAO,SAAS,IAAI,SAAS,EAAG;AAC/D,cAAM,WAAW,gBAAgB,IAAI,SAAS,QAAQ,MAAM;AAC5D,YAAI,CAAC;AACH,gBAAM,IAAI;AAAA,YACR,IAAI,YAAY;AAAA,UAClB;AACF,YAAI,IAAI,cAAc,IAAI,GAAG;AAC3B,iBAAO,KAAK,IAAI,YAAY,OAAO,OAAO,sCAAsC;AAChF;AAAA,QACF;AACA,YAAI;AAAA,UACF;AAAA,UACA,cAAc,EAAE,MAAM,IAAI,WAAW,UAAU,UAAU,WAAW,MAAM,CAAC;AAAA,QAC7E;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "@u1in/loom-plugin-check-updates",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Loom plugin that ships a read-only upstream version check with each Skill.",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "CHANGELOG.md"
15
+ ],
16
+ "dependencies": {
17
+ "@types/mdast": "^4.0.4",
18
+ "remark-frontmatter": "^5.0.0",
19
+ "remark-parse": "^11.0.0",
20
+ "unified": "^11.0.5",
21
+ "zod": "^3.24.0"
22
+ },
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/u1in/loom.git",
30
+ "directory": "packages/plugin-check-updates"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/u1in/loom/issues"
34
+ },
35
+ "homepage": "https://github.com/u1in/loom/tree/main/packages/plugin-check-updates",
36
+ "scripts": {
37
+ "build": "tsup",
38
+ "test": "vitest run --passWithNoTests",
39
+ "typecheck": "tsc --noEmit"
40
+ }
6
41
  }