@glittering0717/ai-browser 2.1.8 → 2.1.9
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/package.json +3 -2
- package/scripts/release.cjs +35 -3
- package/src/shared/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glittering0717/ai-browser",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
4
4
|
"description": "AI-native browser — renders pixels for humans, structured semantic-tree API for agents. No screenshots, no OCR, no coordinate guessing.",
|
|
5
5
|
"main": "src/main/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -80,7 +80,8 @@
|
|
|
80
80
|
"build": "node scripts/build_dmg.cjs",
|
|
81
81
|
"verify:build": "node scripts/verify_build.cjs",
|
|
82
82
|
"install:app": "node scripts/install_app.cjs",
|
|
83
|
-
"dialog": "node e2e/dialog_ws.cjs"
|
|
83
|
+
"dialog": "node e2e/dialog_ws.cjs",
|
|
84
|
+
"verify:app": "node e2e/shipped_ws.cjs"
|
|
84
85
|
},
|
|
85
86
|
"dependencies": {
|
|
86
87
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
package/scripts/release.cjs
CHANGED
|
@@ -115,7 +115,7 @@ mark('版本号');
|
|
|
115
115
|
step(fullTests ? '全量测试' : '发版闸门测试');
|
|
116
116
|
const testFiles = fullTests
|
|
117
117
|
? []
|
|
118
|
-
: ['tests/test_version.js', 'tests/test_imports.js', 'tests/test_api_budget.js', 'tests/test_mcp_tools.js'];
|
|
118
|
+
: ['tests/test_version.js', 'tests/test_imports.js', 'tests/test_api_budget.js', 'tests/test_mcp_tools.js', 'tests/test_release_loop.js'];
|
|
119
119
|
const t = spawnSync('npx', ['vitest', 'run', ...testFiles, '--no-file-parallelism'], {
|
|
120
120
|
cwd: ROOT, encoding: 'utf8',
|
|
121
121
|
});
|
|
@@ -184,7 +184,12 @@ let releaseOk = false;
|
|
|
184
184
|
releaseOk = true;
|
|
185
185
|
mark('github release');
|
|
186
186
|
} else {
|
|
187
|
-
|
|
187
|
+
// 标题尽量带上人话摘要:notes 的第一行通常写成 "# v2.1.8 — xxx",
|
|
188
|
+
// 直接用它,releases 列表就不会是一串光秃秃的版本号。
|
|
189
|
+
let releaseTitle = `v${to}`;
|
|
190
|
+
const headLine = String(notes || '').split('\n')[0].replace(/^#+\s*/, '').trim();
|
|
191
|
+
if (headLine.startsWith(`v${to}`) && headLine.length > `v${to}`.length) releaseTitle = headLine;
|
|
192
|
+
const argv = ['release', 'create', `v${to}`, '--verify-tag', '--latest', '--title', releaseTitle];
|
|
188
193
|
if (notesFile) {
|
|
189
194
|
argv.push('--notes-file', notesFile);
|
|
190
195
|
} else {
|
|
@@ -378,10 +383,37 @@ if (process.platform !== 'darwin') {
|
|
|
378
383
|
}
|
|
379
384
|
}
|
|
380
385
|
|
|
386
|
+
// ---- 8. 验收"装好的那个 App" ----------------------------------------------
|
|
387
|
+
// 前面每一步验的都是"仓库里的东西":测试跑 dev 树、verify_build 比 asar 里的
|
|
388
|
+
// 字节。但用户双击的是 /Applications 里那个包,**没有人跑过它**。
|
|
389
|
+
// 2026-10-24 两次事故(App 落后 4 个版本 / 对话框修复只在 dev 生效)都出在这一层。
|
|
390
|
+
// 现在装完立刻用 e2e/shipped_ws.cjs 直接 spawn 这个包,跑对话框和多标签关键路径。
|
|
391
|
+
step('验收已安装的 App(在打包产物上跑,不是 dev 树)');
|
|
392
|
+
if (process.platform !== 'darwin' || args.includes('--no-install')) {
|
|
393
|
+
warn('跳过(非 macOS 或 --no-install)');
|
|
394
|
+
} else {
|
|
395
|
+
const vEnv = { ...process.env, AI_BROWSER_PORT: '9233' };
|
|
396
|
+
delete vEnv.ELECTRON_RUN_AS_NODE;
|
|
397
|
+
delete vEnv.NODE_OPTIONS;
|
|
398
|
+
const vr = spawnSync(process.execPath, ['e2e/shipped_ws.cjs'], {
|
|
399
|
+
cwd: ROOT, encoding: 'utf8', env: vEnv,
|
|
400
|
+
});
|
|
401
|
+
const vrOut = `${vr.stdout || ''}${vr.stderr || ''}`;
|
|
402
|
+
const tally = (vrOut.match(/PASS=(\d+) FAIL=(\d+)/) || []).slice(1);
|
|
403
|
+
if (vr.status === 0) {
|
|
404
|
+
ok(`已安装的 App 通过验收(PASS=${tally[0] || '?'})`);
|
|
405
|
+
mark('产物验收');
|
|
406
|
+
} else {
|
|
407
|
+
fail(`已安装的 App 验收失败(PASS=${tally[0] || '?'} FAIL=${tally[1] || '?'})—— 桌面上那个包的行为和源码不一致:`);
|
|
408
|
+
console.log((vrOut.split('\n').filter((l) => /FAIL \||ERR|失败明细/.test(l)).slice(0, 12)).map((l) => ' ' + l).join('\n'));
|
|
409
|
+
warn('补救:npm run verify:app (默认验 /Applications/AI Browser.app,可用 AIB_APP= 指定)');
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
381
413
|
// ---- 摘要 -----------------------------------------------------------------
|
|
382
414
|
console.log(`\n${c(36)}── v${to} 发版摘要 ──${c(0)}`);
|
|
383
415
|
console.log(' 已完成: ' + (done.length ? done.join(' → ') : '(无)'));
|
|
384
|
-
const skipped = ['版本号', '测试', 'commit', 'tag', 'git push', 'github release', '打包', '打包校验', 'release asset', 'npm publish', 'mcp registry', '安装']
|
|
416
|
+
const skipped = ['版本号', '测试', 'commit', 'tag', 'git push', 'github release', '打包', '打包校验', 'release asset', 'npm publish', 'mcp registry', '安装', '产物验收']
|
|
385
417
|
.filter((s) => !done.includes(s));
|
|
386
418
|
if (skipped.length) console.log(` 未完成: ${skipped.join(', ')}`);
|
|
387
419
|
process.exit(skipped.length ? 2 : 0);
|
package/src/shared/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// Kept in JS (not imported from package.json) to avoid Node import-attribute
|
|
3
3
|
// (JSON module) compatibility issues inside Electron. package.json "version"
|
|
4
4
|
// is manually synced to this value; tests assert they match.
|
|
5
|
-
export const VERSION = '2.1.
|
|
5
|
+
export const VERSION = '2.1.9';
|