diff --git a/AGENTS.md b/AGENTS.md
index 78836a58..a2bc1ac4 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,7 @@
# Agent Workbench项目执行规范
+用户已澄清旧“等待审查/继续原任务”两张图来自1.25.4,不能代作1.25.5失败。1.25.5新图确实仍显示连接容量16000/2048;透传wire已不使用这些值,本轮1.25.6仅修正连接列表/编辑器/原连接的实际策略显示,并拆开源码发布与程序发布。源码导出不读服务/用户数据,不把正式数据对账当打包前置;npm run package:source为已提交Git源码,package/app默认只程序,历史证据需显式--with-evidence,原件不动。构建第二轮/相关25及网页11已过,Electron/独立包/实际升级仍待,不称已部署。见docs/QA-SOURCE-CAPACITY-1.25.6.md及docs/PACKAGING.md;下文1.25.5交付状态保持历史时点。
+
1.25.5已本地交付:来源5acb6571/候选20261106003510201,正式已实际stop/start为PID71628/instance37d6b536-c0dc-4cbf-9c51-095bbe779062,unrestricted/full已持久保存。重启后hasKey=false,临时Key需在模型中心补填;不读取/复制/解密/重存Key。85项目/104会话/17804事件,全部原工件保持;外部引航演示续接与新增会话40事件单列,首次final失败及只读复核均保留。32相关、新网页10/Electron11、714输入重建22/22、三归档与大历史跨版3组通过;旧0c130UI及976轮958/18按原来源保留。供应商稳定、自主交付、缓存/重复读取改善、真实预留边界及Purge仍未知。不委派/推送或续跑原项目。接续见docs/QA-OPEN-PERMISSIONS-1.25.5.md和docs/open-permissions-1.25.5-release-identity.json;下文旧版/待完成为历史时点。
e86候选三归档/714输入ZIP重建22/22、真实1.25.4隔离初装更新和原PID/临时合成认证/数据exact通过;正式attempt3却在最终写入4369804字节操作收据时被readState默认4MiB拒绝,254458ms退出8并回退。原PID55352/1.25.4/hasKey=true、85项目103会话17764事件及全原行导出工件/模型中心/指针再次exact。现取消默认状态收据体积上限,新增35000事件+outbox的大收据激活/回退及实际跨版本夹具。原测试12/13状态名误断言、Node/libuv build-20退出、目录过长两失败均保留;build-21已过。下一专项/新提交/不可变包/大历史跨版验收,再正式attempt4/full/open/实际重启。不能重放原失败安装,不触真实Key/原项目/委派/推送。
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 78f499d8..a54b3249 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Agent Workbench 更新记录
+## 1.25.6
+
+- 默认透传时,模型连接列表、编辑器与原连接设置统一显示“由上游决定”,不再把旧 16000/2048 等非活动容量声明显示成请求上限。上游目录容量独立标明信息来源。
+- 源码与程序可分别发布:`npm run package:source` 只导出已提交源码;`npm run package:app` 只生成程序与安装器。均不依赖用户项目数据,历史原始证据不再随每次常规发布重复打包。
+
## 1.25.5 · 默认透传、操作权限与自动Git回滚(已本地交付)
- 新安装默认完整历史透传,不附加输出token上限,不以本地上下文或累计额度拒发;轮数和响应等待默认不限。可显式改用手动额度,旧运行保持原契约。
diff --git a/README.md b/README.md
index 8a1285ca..6c815501 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# 本地 Agent 工作台
+当前已安装版本为 **1.25.5**。默认完整透传上下文与输出、自动应用文件并保留 Git 基线与回滚;操作权限按用户选择持久保存。1.25.6 正在修正模型连接的旧容量显示,并将源码发布与程序发布分开。见[打包说明](docs/PACKAGING.md)和[本次验证](docs/QA-SOURCE-CAPACITY-1.25.6.md)。下方各版本数字为历史交付记录。
+
当前本地正式版 **1.25.3**:[打开工作台](http://127.0.0.1:4318/?release=1.25.3)。模型中心可从上游获取型号目录,搜索、多选后手动指定或加入自动适配池;推理模式/强度按品牌与自定义兼容格式配套,能力元数据缺失时保留待确认。使用见[模型目录](docs/MODEL-CATALOG.md),验证与限制见[验收](docs/QA-MODEL-CATALOG-1.25.3.md)和[回顾](docs/RETROSPECTIVE-MODEL-CATALOG-1.25.3.md)。原进程、连接凭据及全部原数据保持;真实供应商兼容、自主工程交付和 Purge 收益仍待独立验证。以下为各版本历史记录。
1.22.0已本地上线:任务中准备Vite预览,桌面端右侧「浏览」查看真实页面并审批固定操作;原截图、动作和下载可核对,手机可观察同一原图。683项核心测试沿用C完整通过原轮、250组界面沿用B原轮,均已严格绑定输入;D独立重建及实际桌面、便携、安装/升级通过,原连接和全部历史保持。见[工作台](http://127.0.0.1:4318/?release=1.22.0)、[使用说明](docs/EMBEDDED-BROWSER.md)、[验收](docs/QA-1.22.md)、[回顾](docs/RETROSPECTIVE-1.22.md)和[发行身份](docs/embedded-browser-release-identity.json)。新iPhone与真实模型效果单列待验。以下为历史交付记录。
diff --git a/docs/PACKAGING.md b/docs/PACKAGING.md
new file mode 100644
index 00000000..25b01d74
--- /dev/null
+++ b/docs/PACKAGING.md
@@ -0,0 +1,21 @@
+# 源码发布、程序发布与本机升级
+
+源码和程序发布只处理工作台自身,不依赖用户在工作台里加入了哪些项目。项目文件、会话数据库、执行工件、模型连接凭据和 Key 都不进入发布包。
+
+## 单独发布源码
+
+运行 `npm run package:source`。此命令直接从 Git 的已提交 HEAD 导出源码 ZIP,并保存来源提交、Git tree、文件清单和归档 SHA-256。未提交修改不进入该包。它不连接工作台服务、不读取用户数据目录、不要求先构建或安装程序,也不打包运行时和历次实验的原始证据。
+
+源码包含产品源码、构建脚本、测试及夹具、锁定依赖、示例、许可证与文字说明。接收方使用 Node 24,执行 `npm ci`、`npm run build`,即可构建程序。需要实际外部引擎、Python 或历史证据的专项验收另行准备依赖,不把这些材料当成程序源码。
+
+## 单独发布程序
+
+提交本次源码并运行 `npm run build`,再运行 `npm run package:app`。此命令生成新的 Windows 程序目录、ZIP 与安装器,保留文件哈希清单和来源提交;不扫描或复制历次实验的原始证据,不读取正式工作台的项目数据。运行时和第三方依赖属于程序所需组件,随程序发布。
+
+`npm run package` 也默认只发布程序。需要兼容旧版全套归档时,显式运行 `node scripts/package.mjs --with-evidence --immutable`,才会同时生成带运行时的源码包和历史证据包。历史原件留在原处,不为每次改程序重复打包。
+
+## 更新已经安装的程序
+
+是否将某份程序包安装到正在使用的工作台,是发布包生成以后的独立操作。只有实际升级时,安装器才需要核对正在运行的任务、版本及原数据是否保留,并记录失败或回退结果。这些核对不属于源码打包,不要求项目开发成功,也不把用户项目带入发布包。
+
+专项验证使用自建项目和隔离数据目录。原真实模型错误、网络异常、重复读取与 Purge 未验证事项保留各自原记录,不作为新源码已经解决这些问题的证明。
diff --git a/docs/QA-SOURCE-CAPACITY-1.25.6.md b/docs/QA-SOURCE-CAPACITY-1.25.6.md
new file mode 100644
index 00000000..3a8cd2b6
--- /dev/null
+++ b/docs/QA-SOURCE-CAPACITY-1.25.6.md
@@ -0,0 +1,13 @@
+# 1.25.6:透传容量显示与独立源码发布
+
+用户确认最初的“等待审查/继续原任务”两张图来自 1.25.4,不能当作 1.25.5 的失败证据。新的 1.25.5 截图则确实在模型连接编辑器中显示上下文 16000、输出 2048。两组观察分别保留。
+
+已确认 1.25.5 的完全开放运行按透传构造请求,不使用这些旧容量声明裁剪上下文或附加输出上限。遗漏在于连接列表、编辑器和原连接设置仍将非活动数值显示成“上限”,让用户无法判断实际行为。
+
+本次修复默认透传下的三个入口,显示由上游决定,移除失效的额度输入和开发初始值按钮;目录容量仅在上游真实提供时显示并标为声明信息。主动启用手动额度后的编辑能力保留。没有重写旧 Run、用户连接容量声明或历史失败。
+
+源码发布新增 `npm run package:source`,直接导出已提交 Git 源码及锁定依赖,不接触服务、项目数据或凭据。程序发布新增 `npm run package:app`,独立构建程序 ZIP 和安装器,不复制历史原始证据。具体使用见 [打包说明](PACKAGING.md)。
+
+阶段验证:构建第二轮通过;首轮两个 TypeScript 分支缩窄错误已修复,原日志保留。三协议透传、容量及上游原文相关 25/25 通过;首相关轮 21 项 20 通过、1 个安装回退夹具未到达预期注入点而返回“本机状态文件不存在”,当轮曾与重新构建并行,串行单项复验通过;完整发行专项另行串行复核,不倒改首轮结果。独立源码包与不遍历历史证据的验证已通过。网页真实流程 11 组通过,覆盖 1440/390、连接编辑器、原连接入口、实际无输出上限请求、上游 429 原文、自动写入及回滚,未出现应用/继续审查按钮。Electron 与发行验证继续,正式服务仍是 1.25.5,不以源码已修改代替已经部署。
+
+历史真实供应商稳定性、自主工程交付、缓存收益、普遍重复读取改善、真实预留边界和 Purge 收益仍按原记录保持未验证。本次只使用合成模型服务,不读取或转存真实 Key,不续跑用户项目或旧实验。
diff --git a/package-lock.json b/package-lock.json
index 758c940f..2b94b7a2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "local-agent-workbench",
- "version": "1.25.5",
+ "version": "1.25.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "local-agent-workbench",
- "version": "1.25.5",
+ "version": "1.25.6",
"dependencies": {
"@babel/parser": "7.29.11",
"@peculiar/x509": "3.1.0",
diff --git a/package.json b/package.json
index 8f1c3f8c..c8eacfb5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "local-agent-workbench",
- "version": "1.25.5",
+ "version": "1.25.6",
"private": true,
"type": "module",
"description": "A local coding workbench with explicit tool execution, reviewable changes and recoverable sessions.",
@@ -48,7 +48,9 @@
"verify:evaluations-projects": "node scripts/verify-evaluations-projects.mjs",
"verify:evaluations-release": "node scripts/verify-evaluations-release.mjs",
"verify:environment": "node scripts/verify-environment-ui.mjs",
- "verify:embedded-browser": "node scripts/verify-embedded-browser.mjs"
+ "verify:embedded-browser": "node scripts/verify-embedded-browser.mjs",
+ "package:source": "node scripts/package-source.mjs",
+ "package:app": "node scripts/package.mjs --application-only --immutable"
},
"dependencies": {
"@babel/parser": "7.29.11",
diff --git a/scripts/documentation-bundle.mjs b/scripts/documentation-bundle.mjs
index cfe33616..913909a1 100644
--- a/scripts/documentation-bundle.mjs
+++ b/scripts/documentation-bundle.mjs
@@ -7,6 +7,25 @@ export const REQUIRED_REPORTS = Object.freeze(['docs/RESEARCH.md', 'docs/researc
const hash = bytes => createHash('sha256').update(bytes).digest('hex');
const simple = value => value.replaceAll('\\', '/');
+// Program publication carries readable guides, independently of historical
+// experiment archives and the data of any installed Workbench instance.
+export function createProgramGuides({ root, portableRoot, sourceCommit }) {
+ const selected = fs.readdirSync(path.join(root, 'docs')).filter(name => name.endsWith('.md')).map(name => 'docs/' + name);
+ for (const name of fs.readdirSync(path.join(root, 'docs/research'))) if (/\.(?:md|json)$/.test(name)) selected.push('docs/research/' + name);
+ const shipped = [];
+ for (const relative of selected) {
+ const source = path.join(root, relative);
+ if (!fs.lstatSync(source).isFile()) continue;
+ const target = path.join(portableRoot, relative); fs.mkdirSync(path.dirname(target), { recursive: true });
+ fs.copyFileSync(source, target);
+ const bytes = fs.readFileSync(target); shipped.push({ path: relative, bytes: bytes.length, sha256: hash(bytes) });
+ }
+ fs.copyFileSync(path.join(root, 'README.md'), path.join(portableRoot, 'README.md'));
+ const result = { schema: 1, sourceCommit, scope: 'Program and text guides only. Historical evidence stays at its original repository paths and is not required to run the program.', shipped };
+ fs.writeFileSync(path.join(portableRoot, 'DOCUMENTATION.json'), JSON.stringify(result, null, 2) + '\n');
+ return result;
+}
+
export function createDocumentationBundle({ root, portableRoot, evidenceRoot, archiveName, sourceCommit }) {
if (!/^[a-f0-9]{40}$/.test(sourceCommit) || !/^[A-Za-z0-9._-]+\.zip$/.test(archiveName)) throw new Error('Documentation needs the fixed source commit and separate archive name.');
if (fs.existsSync(evidenceRoot)) throw new Error('Historical evidence output must be a new directory.');
diff --git a/scripts/package-source.mjs b/scripts/package-source.mjs
new file mode 100644
index 00000000..197b9b5c
--- /dev/null
+++ b/scripts/package-source.mjs
@@ -0,0 +1,50 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { execFileSync } from 'node:child_process';
+import { createHash, randomUUID } from 'node:crypto';
+import { fileURLToPath } from 'node:url';
+
+// Export the committed program. No running host, user data directory, installed
+// application, credentials, build output or historical evidence is consulted.
+const directories = ['src', 'public', 'scripts', 'tests', 'examples', 'benchmarks', 'research', 'licenses'];
+const files = ['package.json', 'package-lock.json', 'vite.config.ts', 'tsconfig.json', 'index.html', 'mobile.html',
+ '.gitignore', '.gitattributes', 'README.md', 'CHANGELOG.md', 'DESIGN.md', 'AGENTS.md', 'THIRD_PARTY_NOTICES.txt',
+ 'Start-Workbench.cmd', 'Stop-Workbench.cmd', 'Start-Desktop.cmd'];
+const guide = name => /^docs\/[^/]+\.md$/.test(name) || /^docs\/research\/[^/]+\.(?:md|json)$/.test(name);
+
+export function packageSource({ root = process.cwd(), outputRoot = path.join(root, 'releases') } = {}) {
+ root = path.resolve(root); outputRoot = path.resolve(outputRoot);
+ const git = args => execFileSync('git', args, { cwd: root, windowsHide: true, maxBuffer: 32 * 1024 * 1024 });
+ const sourceCommit = git(['rev-parse', 'HEAD']).toString().trim();
+ const version = JSON.parse(git(['show', sourceCommit + ':package.json'])).version;
+ if (!/^\d+\.\d+\.\d+(?:-[a-z0-9.-]+)?$/i.test(version)) throw new Error('Invalid committed program version.');
+ const tree = git(['ls-tree', '-r', '--long', '-z', sourceCommit]).toString('utf8').split('\0').filter(Boolean).map(line => {
+ const match = /^(\d+) (\w+) ([a-f0-9]+)\s+(\d+|-)\t([\s\S]+)$/.exec(line);
+ if (!match) throw new Error('Invalid committed source entry.');
+ return { mode: match[1], type: match[2], gitBlob: match[3], bytes: Number(match[4]), path: match[5] };
+ });
+ const entries = tree.filter(row => files.includes(row.path) || directories.some(name => row.path.startsWith(name + '/')) || guide(row.path));
+ if (!entries.some(row => row.path === 'package-lock.json') || !entries.some(row => row.path.startsWith('src/'))) throw new Error('Committed source and dependency lock are required.');
+ if (entries.some(row => row.type !== 'blob' || !['100644', '100755'].includes(row.mode))) throw new Error('Source release requires regular committed files, without links or submodules.');
+ const roots = [...directories.filter(name => entries.some(row => row.path.startsWith(name + '/'))), ...files.filter(name => entries.some(row => row.path === name)), ...entries.filter(row => guide(row.path)).map(row => row.path)];
+ const name = `Agent-Workbench-${version}-source-code-${sourceCommit.slice(0, 8)}-${randomUUID()}`;
+ fs.mkdirSync(outputRoot, { recursive: true });
+ const archive = path.join(outputRoot, name + '.zip'), fd = fs.openSync(archive, 'wx');
+ try { execFileSync('git', ['archive', '--format=zip', '--prefix=Agent-Workbench-' + version + '-source/', sourceCommit, '--', ...roots], { cwd: root, windowsHide: true, stdio: ['ignore', fd, 'pipe'] }); }
+ finally { fs.closeSync(fd); }
+ const result = { kind: 'source-code', version, sourceCommit, sourceTree: git(['rev-parse', sourceCommit + '^{tree}']).toString().trim(),
+ path: archive, bytes: fs.statSync(archive).size, sha256: createHash('sha256').update(fs.readFileSync(archive)).digest('hex'),
+ createdAt: new Date().toISOString(), files: entries.map(({ path, bytes, gitBlob }) => ({ path, bytes, gitBlob })),
+ scope: 'Committed program, build scripts, tests, examples, dependency lock, licenses and text guides. No user projects, sessions, API credentials, installed runtimes or historical evidence archives. Build with Node 24, npm ci and npm run build. Historical acceptance drivers may require separately retained evidence or external engines.' };
+ fs.writeFileSync(path.join(outputRoot, name + '.json'), JSON.stringify(result, null, 2) + '\n', { flag: 'wx' });
+ return result;
+}
+
+if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
+ const args = process.argv.slice(2);
+ if (args.length === 1 && args[0] === '--help') console.log('node scripts/package-source.mjs — ZIP of committed program source only; no running Workbench, build, installation or user data required.');
+ else {
+ if (args.length) throw new Error('Use --help.');
+ const result = packageSource(); console.log(JSON.stringify({ ...result, files: result.files.length }, null, 2));
+ }
+}
diff --git a/scripts/package.mjs b/scripts/package.mjs
index bf07f6a7..eae73f74 100644
--- a/scripts/package.mjs
+++ b/scripts/package.mjs
@@ -6,13 +6,15 @@ import { planReaBundle, copyReaBundle } from './bundle-rea.mjs';
import { planBrowserBundle, copyBrowserBundle } from './bundle-browser.mjs';
import { planDesktopBundle, buildNativeLauncher, copyDesktopBundle } from './bundle-desktop.mjs';
import { buildWindowsInstaller } from './build-installer.mjs';
-import { createDocumentationBundle } from './documentation-bundle.mjs';
+import { createDocumentationBundle, createProgramGuides } from './documentation-bundle.mjs';
import { archiveWindowsDirectory } from './release-archive.mjs';
import { copyReleaseTree } from './release-copy.mjs';
const args = process.argv.slice(2);
-if (args.some(value => !['--help', '--immutable'].includes(value))) throw new Error('Unsupported argument; use --help.');
-if (args.includes('--help')) { console.log('node scripts/package.mjs [--immutable] - create new portable/source releases and archives; existing release folders are never refreshed.'); process.exit(0); }
+if (args.some(value => !['--help', '--immutable', '--application-only', '--with-evidence'].includes(value))) throw new Error('Unsupported argument; use --help.');
+if (args.includes('--help')) { console.log('node scripts/package.mjs [--immutable] [--with-evidence] - publish program/installer by default; explicitly add --with-evidence for legacy source/runtime/evidence archives. For source code only use npm run package:source. No installed user data is packaged.'); process.exit(0); }
+if (args.includes('--application-only') && args.includes('--with-evidence')) throw new Error('Select program publication or legacy evidence export.');
+const applicationOnly = !args.includes('--with-evidence');
const root = process.cwd();
if (execFileSync('git', ['status', '--porcelain', '--untracked-files=all'], { cwd: root, encoding: 'utf8', windowsHide: true }).trim()) throw new Error('Commit the reviewed release inputs before packaging; sourceCommit must identify the actual shipped sources.');
const meta = JSON.parse(fs.readFileSync('package.json', 'utf8'));
@@ -25,9 +27,9 @@ fs.mkdirSync(releases, { recursive: true });
const baseName = 'Agent-Workbench-' + meta.version;
const buildSuffix = args.includes('--immutable') || fs.existsSync(path.join(releases, baseName + '-win-x64')) ? '-' + new Date().toISOString().replace(/[-:TZ.]/g, '') : '';
const portableRoot = path.join(releases, baseName + '-win-x64' + buildSuffix);
-const sourceRoot = path.join(releases, baseName + '-source' + buildSuffix);
-const evidenceRoot = path.join(releases, baseName + '-evidence' + buildSuffix);
-for (const target of [portableRoot, sourceRoot]) {
+const sourceRoot = applicationOnly ? null : path.join(releases, baseName + '-source' + buildSuffix);
+const evidenceRoot = applicationOnly ? null : path.join(releases, baseName + '-evidence' + buildSuffix);
+for (const target of [portableRoot, sourceRoot].filter(Boolean)) {
if (!path.resolve(target).startsWith(releases + path.sep) || fs.existsSync(target)) throw new Error('Release output must be a new folder under releases.');
fs.mkdirSync(target, { recursive: true });
}
@@ -38,9 +40,9 @@ const copyTree = copyReleaseTree;
for (const name of portableFiles) copyTree(path.join(root, name), path.join(portableRoot, name));
fs.mkdirSync(path.join(portableRoot, 'scripts'), { recursive: true });
for (const name of ['Start-Workbench.ps1', 'Stop-Workbench.ps1', 'Start-Desktop.ps1', 'upgrade-running.mjs', 'python-check-runner.py']) fs.copyFileSync(path.join(root, 'scripts', name), path.join(portableRoot, 'scripts', name));
-for (const name of sourceFiles) copyTree(path.join(root, name), path.join(sourceRoot, name));
+if (sourceRoot) for (const name of sourceFiles) copyTree(path.join(root, name), path.join(sourceRoot, name));
const sourceCommit = execFileSync('git', ['rev-parse', 'HEAD'], { cwd: root, encoding: 'utf8', windowsHide: true }).trim();
-const documentation = createDocumentationBundle({ root, portableRoot, evidenceRoot, archiveName: path.basename(evidenceRoot) + '.zip', sourceCommit });
+const documentation = applicationOnly ? createProgramGuides({ root, portableRoot, sourceCommit }) : createDocumentationBundle({ root, portableRoot, evidenceRoot, archiveName: path.basename(evidenceRoot) + '.zip', sourceCommit });
const preferredNode = path.resolve(root, '..', 'tools', 'node-v24.22.1-win-x64', 'node.exe');
const nodeBinary = process.env.AGENT_WORKBENCH_NODE_PATH || (fs.existsSync(preferredNode) ? preferredNode : process.execPath);
@@ -56,18 +58,20 @@ const npmRoot = path.join(path.dirname(nodeBinary), 'node_modules', 'npm');
if (!fs.existsSync(path.join(npmRoot, 'bin', 'npm-cli.js'))) throw new Error('The portable engineering runner requires the npm shipped with this Node distribution.');
copyTree(npmRoot, path.join(portableRoot, 'runtime', 'node_modules', 'npm'));
fs.copyFileSync(nodeLicense, path.join(portableRoot, 'runtime', 'LICENSE'));
-fs.mkdirSync(path.join(sourceRoot, 'runtime'), { recursive: true });
-fs.copyFileSync(nodeBinary, path.join(sourceRoot, 'runtime', 'node.exe'));
-fs.copyFileSync(nodeLicense, path.join(sourceRoot, 'runtime', 'LICENSE'));
-copyTree(npmRoot, path.join(sourceRoot, 'runtime', 'node_modules', 'npm'));
+if (sourceRoot) {
+ fs.mkdirSync(path.join(sourceRoot, 'runtime'), { recursive: true });
+ fs.copyFileSync(nodeBinary, path.join(sourceRoot, 'runtime', 'node.exe'));
+ fs.copyFileSync(nodeLicense, path.join(sourceRoot, 'runtime', 'LICENSE'));
+ copyTree(npmRoot, path.join(sourceRoot, 'runtime', 'node_modules', 'npm'));
+}
const launcherPath = path.join(root, '.qa', 'native-launcher', 'AgentWorkbench.exe');
const nativeLauncher = buildNativeLauncher(root, launcherPath);
const desktopRuntime = copyDesktopBundle(root, portableRoot, desktopPlan, { launcher: launcherPath });
-copyDesktopBundle(root, sourceRoot, desktopPlan, { source: true });
+if (sourceRoot) copyDesktopBundle(root, sourceRoot, desktopPlan, { source: true });
const reaRuntime = copyReaBundle(path.join(portableRoot, 'runtime'), reaPlan);
-copyReaBundle(path.join(sourceRoot, 'runtime'), reaPlan);
+if (sourceRoot) copyReaBundle(path.join(sourceRoot, 'runtime'), reaPlan);
const browserRuntime = copyBrowserBundle(path.join(portableRoot, 'runtime'), browserPlan);
-copyBrowserBundle(path.join(sourceRoot, 'runtime'), browserPlan);
+if (sourceRoot) copyBrowserBundle(path.join(sourceRoot, 'runtime'), browserPlan);
const notices = ['Agent Workbench third-party notices', '',
'Original product code is supplied for the project owner. Its redistribution terms are determined by the project owner.',
@@ -102,7 +106,7 @@ fs.writeFileSync(path.join(licenseRoot, 'Node-' + nodeVersion + '-LICENSE.txt'),
notices.push('='.repeat(72), 'Node.js ' + nodeVersion, '', nodeLicenseText);
notices.push('='.repeat(72), 'npm bundled with Node.js', 'Complete package and dependency licenses are retained under runtime/node_modules/npm/.', '', fs.readFileSync(path.join(npmRoot, 'LICENSE'), 'utf8'));
fs.writeFileSync(path.join(root, 'THIRD_PARTY_NOTICES.txt'), notices.join('\n'));
-for (const output of [portableRoot, sourceRoot]) {
+for (const output of [portableRoot, sourceRoot].filter(Boolean)) {
fs.cpSync(licenseRoot, path.join(output, 'licenses'), { recursive: true });
fs.copyFileSync(path.join(root, 'THIRD_PARTY_NOTICES.txt'), path.join(output, 'THIRD_PARTY_NOTICES.txt'));
}
@@ -124,7 +128,7 @@ function manifest(directory, kind) {
return result;
}
const portableManifest = manifest(portableRoot, 'portable');
-manifest(sourceRoot, 'source');
+if (sourceRoot) manifest(sourceRoot, 'source');
const installer = buildWindowsInstaller({ root, portableRoot, outputRoot: releases });
function archive(directory) {
const destination = directory + '.zip';
@@ -132,7 +136,7 @@ function archive(directory) {
archiveWindowsDirectory(directory, destination);
return { path: destination, bytes: fs.statSync(destination).size, sha256: createHash('sha256').update(fs.readFileSync(destination)).digest('hex') };
}
-const result = { portableRoot, sourceRoot, evidenceRoot, portable: archive(portableRoot), source: archive(sourceRoot), evidence: archive(evidenceRoot), documentation: { sourceCommit, originalFiles: documentation.originalFiles, originalBytes: documentation.originalBytes, shippedFiles: documentation.shipped.length, shippedBytes: documentation.shipped.reduce((sum, row) => sum + row.bytes, 0), evidenceManifestSha256: documentation.evidenceManifestSha256 }, installer, desktopRuntime, nativeLauncher, nodeVersion, reaRuntime, portableFiles: portableManifest.files.length, licenseTexts: licenseCount + 2 };
+const result = { portableRoot, ...(sourceRoot ? { sourceRoot, source: archive(sourceRoot) } : {}), ...(evidenceRoot ? { evidenceRoot, evidence: archive(evidenceRoot) } : {}), portable: archive(portableRoot), documentation: { sourceCommit, scope: documentation.scope, originalFiles: documentation.originalFiles, originalBytes: documentation.originalBytes, shippedFiles: documentation.shipped.length, shippedBytes: documentation.shipped.reduce((sum, row) => sum + row.bytes, 0), evidenceManifestSha256: documentation.evidenceManifestSha256 }, installer, desktopRuntime, nativeLauncher, nodeVersion, reaRuntime, portableFiles: portableManifest.files.length, licenseTexts: licenseCount + 2 };
result.browserRuntime = { playwrightVersion: browserRuntime.playwrightVersion, packages: browserRuntime.packages.map(pkg => ({ name: pkg.name, version: pkg.version, files: pkg.files.length })) };
fs.writeFileSync(path.join(releases, 'latest.json'), JSON.stringify(result, null, 2));
console.log(JSON.stringify(result, null, 2));
diff --git a/scripts/verify-packaged-build.mjs b/scripts/verify-packaged-build.mjs
index ad1287f3..b9765aad 100644
--- a/scripts/verify-packaged-build.mjs
+++ b/scripts/verify-packaged-build.mjs
@@ -6,12 +6,16 @@ import { spawn, execFileSync } from 'node:child_process';
import { projectEnvironment } from '../src/core/process-environment.mjs';
if (process.argv.includes('--help')) {
- console.log('node scripts/verify-packaged-build.mjs — extract compile inputs from the latest source ZIP, install offline, rebuild and compare every compiled file to its portable ZIP identity. Set AGENT_WORKBENCH_TEST_PYTHON to an absolute Python path. No model calls or formal-host changes.');
+ console.log('node scripts/verify-packaged-build.mjs — independently rebuild a source ZIP and compare all compiled files with the latest program. AGENT_WORKBENCH_SOURCE_RELEASE selects a standalone source-code JSON receipt; otherwise use the legacy source bundle. Set AGENT_WORKBENCH_TEST_PYTHON. No model calls or formal-host changes.');
process.exit(0);
}
assert.equal(process.argv.length, 2);
assert.match(process.version, /^v24\./);
const release = JSON.parse(fs.readFileSync('releases/latest.json'));
+const sourceReceipt = process.env.AGENT_WORKBENCH_SOURCE_RELEASE;
+const standaloneSource = sourceReceipt ? JSON.parse(fs.readFileSync(sourceReceipt)) : null;
+if (standaloneSource) assert.equal(standaloneSource.kind, 'source-code');
+const sourceZip = standaloneSource ?? release.source;
const manifest = JSON.parse(fs.readFileSync(path.join(release.portableRoot, 'MANIFEST.json')));
const root = path.resolve('.qa', 'packaged-build-' + randomUUID()), destination = path.join(root, 'source');
fs.mkdirSync(destination, { recursive: true });
@@ -28,19 +32,24 @@ async function digestFile(file) {
}
const startedAt = new Date().toISOString();
const extract = `import sys,zipfile,pathlib,json,hashlib
-archive,destination,top=sys.argv[1:]
+archive,destination,top,receipt=sys.argv[1:]
folders={'src','public','scripts','tests','examples','benchmarks','research'}
names={'package.json','package-lock.json','vite.config.ts','tsconfig.json','index.html','mobile.html'}
output=pathlib.Path(destination).resolve()
with zipfile.ZipFile(archive) as bundle:
- manifest=json.loads(bundle.read(top+'/MANIFEST.json'))
+ manifest=json.loads(pathlib.Path(receipt).read_text(encoding='utf-8')) if receipt else json.loads(bundle.read(top+'/MANIFEST.json'))
selected=[item for item in manifest['files'] if item['path'].split('/')[0] in folders or item['path'] in names]
- assert manifest['kind']=='source' and selected
+ assert manifest['kind'] in {'source','source-code'} and selected
for item in selected:
relative=pathlib.PurePosixPath(item['path'])
assert not relative.is_absolute() and '..' not in relative.parts
contents=bundle.read(top+'/'+item['path'])
- assert len(contents)==item['bytes'] and hashlib.sha256(contents).hexdigest()==item['sha256']
+ assert len(contents)==item['bytes']
+ if manifest['kind']=='source-code':
+ assert hashlib.sha1(b'blob '+str(len(contents)).encode()+b'\\0'+contents).hexdigest()==item['gitBlob']
+ item['sha256']=hashlib.sha256(contents).hexdigest()
+ else:
+ assert hashlib.sha256(contents).hexdigest()==item['sha256']
target=(output/str(relative)).resolve()
assert target.is_relative_to(output)
target.parent.mkdir(parents=True,exist_ok=True)
@@ -62,9 +71,9 @@ async function run(args, name) {
}
let result, stage = 'source archive identity', inputs = [], compiled = [], mismatches = [];
try {
- assert.equal(await digestFile(release.source.path), release.source.sha256);
+ assert.equal(await digestFile(sourceZip.path), sourceZip.sha256);
stage = 'extract fixed compile inputs';
- const extraction = JSON.parse(execFileSync(python, ['-I', '-c', extract, release.source.path, destination, path.basename(release.sourceRoot)],
+ const extraction = JSON.parse(execFileSync(python, ['-I', '-c', extract, sourceZip.path, destination, standaloneSource ? 'Agent-Workbench-' + standaloneSource.version + '-source' : path.basename(release.sourceRoot), sourceReceipt || ''],
{ env, encoding: 'utf8', windowsHide: true, maxBuffer: 8 * 1024 * 1024 }));
assert.equal(extraction.version, manifest.version); inputs = extraction.inputs;
stage = 'offline install'; await run(['ci', '--offline', '--ignore-scripts', '--no-audit', '--no-fund'], 'offline-install');
@@ -85,8 +94,8 @@ try {
assert.deepEqual(mismatches, [], 'Source ZIP rebuild differs from portable compilation.');
result = { success: true };
} catch (error) { result = { success: false, stage, error: error.stack }; process.exitCode = 1; }
-result = { ...result, startedAt, finishedAt: new Date().toISOString(), version: manifest.version, sourceCommit: release.documentation.sourceCommit,
- root, destination, sourceZip: release.source, portableManifestSha256: await digestFile(path.join(release.portableRoot, 'MANIFEST.json')),
+result = { ...result, startedAt, finishedAt: new Date().toISOString(), version: manifest.version, sourceCommit: standaloneSource?.sourceCommit ?? release.documentation.sourceCommit,
+ root, destination, sourceZip, portableManifestSha256: await digestFile(path.join(release.portableRoot, 'MANIFEST.json')),
node: { version: process.version, sha256: await digestFile(process.execPath) }, inputCount: inputs.length, inputs, compiled, mismatches, logs, realModelRequests: 0,
scope: 'Independent compile-input extraction from the exact source ZIP, offline dependency installation and actual TypeScript/Vite/mobile/server/desktop rebuild. Every source input retained and every compiled file compared. Historical source tests and full archive checks keep their separate receipts.' };
const output = path.join(root, 'result.json');
diff --git a/scripts/verify-unrestricted-ui.mjs b/scripts/verify-unrestricted-ui.mjs
index 9afb23e4..18e0f47e 100644
--- a/scripts/verify-unrestricted-ui.mjs
+++ b/scripts/verify-unrestricted-ui.mjs
@@ -112,6 +112,24 @@ try {
await expect(budgets().getByLabel('额度策略', { exact: true })).toHaveValue('unrestricted');
for (const width of [1440,390]) { await resize(width); assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1)); await shot('open-settings-' + width); }
mark('open defaults save as real zeros, survive reload, hide local quotas and retain model selection at 1440 and 390 pixels');
+ await resize(1440); await dialog().getByRole('button', { name: '模型连接', exact: true }).click();
+ const connectedCard = () => dialog().locator('.mc-connection').filter({ has: page.getByRole('heading', { name: connection.name, exact: true }) });
+ await expect(connectedCard()).toContainText('默认透传 · 由上游决定');
+ await connectedCard().getByRole('button', { name: '编辑', exact: true }).click();
+ const connectionEditor = () => dialog().getByRole('form', { name: '编辑模型连接', exact: true });
+ await expect(connectionEditor().getByLabel('上下文上限', { exact: true })).toHaveCount(0);
+ await expect(connectionEditor().getByLabel('输出上限', { exact: true })).toHaveCount(0);
+ await expect(connectionEditor().getByLabel('连接容量策略', { exact: true })).toContainText('默认透传 · 不设本地上限');
+ await expect(connectionEditor().getByRole('button', { name: '填入开发初始值', exact: true })).toHaveCount(0);
+ for (const width of [1440, 390]) { await resize(width); await connectionEditor().getByLabel('连接容量策略', { exact: true }).scrollIntoViewIfNeeded(); await shot('connection-passthrough-' + width); }
+ await connectionEditor().getByRole('button', { name: '取消', exact: true }).click();
+ await resize(1440); await dialog().locator('.mc-connection').filter({ has: page.getByRole('heading', { name: '原模型连接', exact: true }) }).getByRole('button', { name: '编辑', exact: true }).click();
+ const legacy = page.getByRole('dialog', { name: '原连接与演示设置', exact: true });
+ await expect(legacy.getByLabel('原连接容量说明', { exact: true })).toContainText('默认透传');
+ await expect(legacy.getByLabel('上下文预算', { exact: true })).toHaveCount(0);
+ await expect(legacy.getByLabel('输出上限', { exact: true })).toHaveCount(0);
+ await legacy.getByRole('button', { name: '取消', exact: true }).click(); await open();
+ mark('connection list, editor and legacy settings display active passthrough without inactive 16000/2048 ceilings');
await resize(1440); await dialog().getByRole('button', { name: '等待时限', exact: true }).click();
const waits = () => dialog().getByRole('form', { name: '模型等待时限', exact: true });
await expect(waits().getByLabel('单次模型响应上限(秒)', { exact: true })).toHaveValue('0');
@@ -197,6 +215,9 @@ try {
await page.getByRole('button', { name: /AUTO-WRITE-FLOW/ }).first().click();
await page.locator('.inspector-tabs').getByRole('button', { name: '改动', exact: true }).click();
await expect(page.getByRole('button', { name: '回滚这项改动', exact: true })).toBeVisible(); await shot('automatically-applied-file');
+ await expect(page.getByRole('button', { name: '应用这项改动', exact: true })).toHaveCount(0);
+ await expect(page.getByRole('button', { name: '继续原任务', exact: true })).toHaveCount(0);
+ await expect(page.getByText(/项改动等待审查/)).toHaveCount(0);
await page.getByRole('button', { name: '回滚这项改动', exact: true }).click();
await until(async () => (await host.api('/sessions/' + writeSession.id)).changes[0].status === 'rolled_back');
assert.equal(fs.existsSync(path.join(f.projectRoot, 'ui-auto.txt')), false); await shot('rolled-back-file');
diff --git a/src/client/App.tsx b/src/client/App.tsx
index d8d6b40f..6ea5a72c 100644
--- a/src/client/App.tsx
+++ b/src/client/App.tsx
@@ -659,7 +659,7 @@ export default function App() {
{desktopOpen && desktop &&
默认透传 · 上下文与输出由上游决定,不设本地上限。需要主动设置额度时,可在模型中心的运行预算中切换。
:默认透传不附加输出额度、不按本地上下文预算裁剪或拒发;上游限制与错误如实保留。累计 tokens 填 0 表示不限。手动开启限制仅影响后续运行。
有任务在执行,请先停止任务再改变连接。
}} {diagnosticsOpen &&连接、模型池和实际请求使用同一个入口。