d75547b36d
新增 skill-pack-manifest 脚本统一计算并校验内置 AGC Skill 内容摘要,--write 模式自动递增清单版本并同步 SHA-256。 新增 check-skill-pack 只读门禁与 Node 回归测试,无参数默认只读,只有单个 --write 才进入写入模式。 AGC typecheck 与 release build 接入 Skill 清单指纹校验,内容漂移时直接列出 Skill 与实际摘要阻断构建。 修正 agc-client-projection 清单指纹并升级 Skill pack 版本到 2026-08-26.3。 升级 AGC 标准版到 0.1.10,同步 package、Cargo、Tauri 与 npm 工作区锁文件。 首页空输入占位符锚定到编辑区,避免整页滚动后占位文本脱离输入框。 更新 AGC 实施计划中 Skill 指纹同步与只读门禁说明。
50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { spawnSync } from 'node:child_process';
|
|
import fs from 'node:fs';
|
|
import os from 'node:os';
|
|
import path from 'node:path';
|
|
import test from 'node:test';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
import {
|
|
computeSkillContentFingerprint,
|
|
inspectSkillPack,
|
|
} from './skill-pack-manifest.mjs';
|
|
|
|
test('bundled skill pack manifest is synchronized', () => {
|
|
const result = inspectSkillPack();
|
|
assert.deepEqual(result.mismatches, []);
|
|
});
|
|
|
|
test('skill content fingerprint canonicalizes CRLF', () => {
|
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agc-skill-pack-'));
|
|
try {
|
|
fs.mkdirSync(path.join(root, 'demo'), { recursive: true });
|
|
const entry = {
|
|
name: 'demo',
|
|
files: ['SKILL.md'],
|
|
};
|
|
fs.writeFileSync(path.join(root, 'demo', 'SKILL.md'), 'line 1\nline 2\n');
|
|
const lf = computeSkillContentFingerprint(root, entry);
|
|
fs.writeFileSync(
|
|
path.join(root, 'demo', 'SKILL.md'),
|
|
'line 1\r\nline 2\r\n',
|
|
);
|
|
assert.equal(computeSkillContentFingerprint(root, entry), lf);
|
|
} finally {
|
|
fs.rmSync(root, { recursive: true, force: true });
|
|
}
|
|
});
|
|
|
|
test('check command without arguments remains read-only', () => {
|
|
const scriptPath = path.join(
|
|
path.dirname(fileURLToPath(import.meta.url)),
|
|
'check-skill-pack.mjs',
|
|
);
|
|
const result = spawnSync(process.execPath, [scriptPath], {
|
|
encoding: 'utf8',
|
|
});
|
|
assert.equal(result.status, 0, result.stderr);
|
|
assert.match(result.stdout, /\[skill-pack\] OK/u);
|
|
});
|