@ai-workbench/connect 0.7.18 → 0.7.19
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/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
安装:在官方 DSH「插件 → 添加插件」中选择编排已核验的 tgz 绝对路径。已由编排发布的版本也可按其提供的精确包版本安装;本轮0.7.
|
|
1
|
+
安装:在官方 DSH「插件 → 添加插件」中选择编排已核验的 tgz 绝对路径。已由编排发布的版本也可按其提供的精确包版本安装;本轮0.7.19只提供固定tgz,本项目不自行 publish。
|
|
2
2
|
|
|
3
3
|
# 远程主机连接插件(L)
|
|
4
4
|
|
|
@@ -43,7 +43,7 @@ openssl s_client -connect registry.npmjs.org:443 -servername registry.npmjs.org
|
|
|
43
43
|
|
|
44
44
|
D13已通过[PR15](https://github.com/yzsnstotz/ai-workbench-connect/pull/15)合推main7915df5,移除前为909eabb;五项被拒产物及清单引用已撤除。不再生成新的聚合整包或验收ZIP,交付物为插件本身。
|
|
45
45
|
|
|
46
|
-
**插件版本0.7.
|
|
46
|
+
**插件版本0.7.19,API保持0.7.0/native-local-v1。** 本轮沿用现有N/X公开API,真实组合由编排验证。L导入动作固定使用官方系统目录窗口:自动能力为native时直接消费其pick;SSH等启动上下文提供browse时,明确调用同一官方原生包的公开pickNativeDirectory,不修改全局选择器。失败原因与临时登录路径只在本节技术详情准确投影。js-yaml/yauzl及其传递运行依赖随tgz打包,官方宿主peer由已安装官方程序提供,员工不另装npm依赖。真实中文GUI/授权及leo E门分别留证。旧140测试/46图只属于前任draft.3;本轮证据独立记录于[第2轮证据](docs/evidence/2026-10-21-L-round2-draft4/)。不得拿旧0.6.3 tgz当native-local-v1的输入。
|
|
47
47
|
|
|
48
48
|
开发使用Node24.13.1,依赖/缓存/构建和临时HOME放自有外接APFS。工程检查为`npm test`、`npm run check`、`npm run build`;它们不替代真实产品路径。安装走官方插件管理,本包自身只声明一个官方bundle条目,不使用wrapper或员工启动器。工人GUI按[SELFTEST](docs/SELFTEST.md)的PID和三项获准偏离执行,不操作owner实例。
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ L0.7.4按owner最新纠正分开供给和授权:Electron组件从自身官方
|
|
|
53
53
|
|
|
54
54
|
官方Electron内置Node会把.asar视作虚拟目录;组件缓存/解压专用physical-fs在Electron中使用original-fs核验物理归档,不修改全局process.noAsar。真实官方运行时新建及跨Node复用缓存均有回归。
|
|
55
55
|
|
|
56
|
-
0.7.5仅调整公开 npm 发布元数据和包内容:运行依赖继续随包,合同、源码、测试与证据不进包;无安装脚本。源码与合同见[项目仓库](https://github.com/yzsnstotz/ai-workbench-connect)。发布前可用官方插件页安装已核验的tgz绝对路径。0.7.
|
|
56
|
+
0.7.5仅调整公开 npm 发布元数据和包内容:运行依赖继续随包,合同、源码、测试与证据不进包;无安装脚本。源码与合同见[项目仓库](https://github.com/yzsnstotz/ai-workbench-connect)。发布前可用官方插件页安装已核验的tgz绝对路径。0.7.19本轮提供固定tgz,由编排决定发布;L不执行publish。
|
|
57
57
|
|
|
58
58
|
0.7.6:L设置节可显式选择 GitHub 官方源或 npmmirror(Electron 官方文档列出的中国镜像),显示所选来源与理由。未保存选择/未显式配置时默认 npmmirror,依据为编排在leo的可达性实测,不代表自动测速。优先级:本profile设置节已保存选择 → helper.componentDownloadSource初值 → 旧helper.source显式URL → 默认npmmirror;坏设置/保存失败明确报错,不静默切源。预设仍校验原Electron44.0.0固定SHA256。helper.componentObservationIntervalMs默认1000毫秒,只刷新“已N秒无进展”,不触发超时/重试/换源。Claude网页登录的当前流向见下节;Codex本版保留原有N主机代理方式。
|
|
59
59
|
|
|
@@ -121,3 +121,7 @@ RFC8628的 `verification_uri_complete` 是可选字段;固定0.163.0 CLI只提
|
|
|
121
121
|
payload 仅有七个必填字段:phase 固定 `workspace-source-admission`;stage 为 source-context/source-confirmation/input-acceptance/login-readiness/local-admission/input-prepare/model-catalog/runtime-resolve;workspaceId/bindingId 为已观测 ID 或 null;source 为 local/host/legacy-host 或 null;status 沿工作区来源的 unselected/selected/legacy-confirmation-required/invalid 或 null;outcome 为 confirmation-required/confirmed/declined/cancelled/failed。未知来源事实显式 null,不推测或补建关系,不接收额外字段/正文/凭据/环境。
|
|
122
122
|
|
|
123
123
|
设置 → 远程主机连接 → **连接前技术详情(含登录与工作区确认)** 可按原生会话/品牌逐项展开完整记录并继续加载。写入只记诊断,不产生来源确认、品牌接纳或执行权限;同 eventId 同内容只核持久 ACK,异内容冲突,不重放选择或执行。新增 Config/默认/阈值为 0,沿既有 conversationDetails 字节预算/分页。真实 X2 消费、GUI/leo/owner 门另验;不 publish。
|
|
124
|
+
|
|
125
|
+
## 0.7.19 本地首轮会话核验修复
|
|
126
|
+
|
|
127
|
+
官方 rc.2 JSONL 会将新会话省略的 delegationDepth 写为 0。接纳与本地技术详情历史核验现在只将这两种官方表示视为同一身份,避免新建 Claude/Codex 会话误报 REMOTE_DETAIL_SCOPE_INVALID;其他完整 header 身份、实际员工输入、品牌、目录与连接代次检查保持严格。不会重写原始 header/旧关系摘要或恢复旧轮写权限,无新增 Config、权限或自动重试。X 的输入核验和错误文案须随统一 0.8.13 修复;leo 真实组合复验另行进行,本包不安装现场、不 publish。
|
|
@@ -10,6 +10,7 @@ export interface AcceptanceRecord {
|
|
|
10
10
|
key: string;
|
|
11
11
|
}
|
|
12
12
|
export declare function validHeader(h: any): boolean;
|
|
13
|
+
export declare function sameSessionHeader(a: any, b: any): boolean;
|
|
13
14
|
export declare function acceptanceStore(profile: string, maxBytes: number): {
|
|
14
15
|
read: () => AcceptanceRecord[];
|
|
15
16
|
save: (items: AcceptanceRecord[], guard: () => void) => void;
|
|
@@ -6,7 +6,11 @@ export const hash = (v) => createHash('sha256').update(canonical(v)).digest('hex
|
|
|
6
6
|
const exact = (v, fields) => v && typeof v === 'object' && !Array.isArray(v) && Object.keys(v).sort().join(',') === fields;
|
|
7
7
|
const text = (v) => typeof v === 'string' && v.length > 0 && !/[\x00-\x1f\x7f]/.test(v);
|
|
8
8
|
const int = (v) => Number.isSafeInteger(v) && v >= 0;
|
|
9
|
-
export function validHeader(h) { return !!h && typeof h === 'object' && !Array.isArray(h) && h.version === 4 && text(h.id) && int(h.createdAt) && typeof h.isSeeded === 'boolean' && typeof h.cwd === 'string' && isAbsolute(h.cwd) && Object.keys(h).every(k => ['version', 'id', 'createdAt', 'cwd', 'parentSession', 'isSeeded', 'origin', 'delegationDepth', 'agentPreset'].includes(k)); }
|
|
9
|
+
export function validHeader(h) { return !!h && typeof h === 'object' && !Array.isArray(h) && h.version === 4 && text(h.id) && int(h.createdAt) && typeof h.isSeeded === 'boolean' && typeof h.cwd === 'string' && isAbsolute(h.cwd) && (!Object.hasOwn(h, 'delegationDepth') || int(h.delegationDepth) && !Object.is(h.delegationDepth, -0)) && Object.keys(h).every(k => ['version', 'id', 'createdAt', 'cwd', 'parentSession', 'isSeeded', 'origin', 'delegationDepth', 'agentPreset'].includes(k)); }
|
|
10
|
+
// Official rc.2 JSONL encodes an omitted delegationDepth as 0. Compare only
|
|
11
|
+
// those two native representations as equivalent; retain every other field.
|
|
12
|
+
// Stored headers and integrity hashes stay byte-for-byte in their original form.
|
|
13
|
+
export function sameSessionHeader(a, b) { return validHeader(a) && validHeader(b) && canonical({ ...a, delegationDepth: a.delegationDepth ?? 0 }) === canonical({ ...b, delegationDepth: b.delegationDepth ?? 0 }); }
|
|
10
14
|
function validAcceptance(a) { return exact(a, 'acceptanceId,bindingId,directory,epoch,instanceId,provider,sessionId,source,userTurn,version,workspaceId') && a.version === 1 && ['acceptanceId', 'bindingId', 'instanceId', 'sessionId', 'workspaceId'].every(k => text(a[k])) && int(a.epoch) && ['claude', 'codex'].includes(a.provider) && a.source === 'local' && exact(a.directory, 'device,inode,path') && isAbsolute(a.directory.path) && int(a.directory.device) && int(a.directory.inode) && exact(a.userTurn, 'startSequence,turn,userMessageId,userMessageSequence') && int(a.userTurn.turn) && int(a.userTurn.startSequence) && int(a.userTurn.userMessageSequence) && a.userTurn.userMessageSequence > a.userTurn.startSequence && text(a.userTurn.userMessageId); }
|
|
11
15
|
export function acceptanceStore(profile, maxBytes) {
|
|
12
16
|
const root = join(profile, 'ai-workbench-connect'), file = join(root, 'local-user-turn-acceptances.json');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { acceptanceStore, canonical, validHeader } from "./local-acceptance-store.js";
|
|
2
|
+
import { acceptanceStore, canonical, validHeader, sameSessionHeader } from "./local-acceptance-store.js";
|
|
3
3
|
import { fail, ok, need, NeedError } from "./needs.js";
|
|
4
4
|
const text = (v) => typeof v === 'string' && v.length > 0 && !/[\x00-\x1f\x7f]/.test(v);
|
|
5
5
|
const int = (v) => Number.isSafeInteger(v) && v >= 0;
|
|
@@ -92,7 +92,7 @@ export function createLocalUserTurnAcceptance(o) {
|
|
|
92
92
|
let inherited = 0;
|
|
93
93
|
try {
|
|
94
94
|
guard();
|
|
95
|
-
if (handle.id !== r.sessionId || handle.access !== 'read' ||
|
|
95
|
+
if (handle.id !== r.sessionId || handle.access !== 'read' || !sameSessionHeader(handle.header, c.header) || !int(handle.inheritedEventCount))
|
|
96
96
|
reject('REMOTE_DETAIL_SCOPE_INVALID');
|
|
97
97
|
inherited = handle.inheritedEventCount;
|
|
98
98
|
events = (await handle.read()).events;
|
|
@@ -133,12 +133,14 @@ export function createLocalUserTurnAcceptance(o) {
|
|
|
133
133
|
const a = { version: 1, acceptanceId: randomUUID(), instanceId: r.instanceId, epoch: r.epoch, sessionId: r.sessionId, provider: r.provider, workspaceId: r.workspaceId, bindingId: r.expectedBindingId, source: 'local', directory, userTurn: { turn: start.data.turn, startSequence: start.seq, userMessageId: input.data.id, userMessageSequence: input.seq } };
|
|
134
134
|
// Re-read inside the location queue; another acceptance may have committed while awaiting it.
|
|
135
135
|
items = store.read();
|
|
136
|
-
const same = items.find(v => v.identity === identity &&
|
|
137
|
-
const oldInput = items.find(v => v.acceptance.sessionId === r.sessionId &&
|
|
136
|
+
const same = items.find(v => v.identity === identity && sameSessionHeader(v.header, c.header) && sameProof(v.acceptance, a));
|
|
137
|
+
const oldInput = items.find(v => v.acceptance.sessionId === r.sessionId && sameSessionHeader(v.header, c.header) && v.acceptance.provider === r.provider && canonical(v.acceptance.userTurn) === canonical(a.userTurn) && !sameProof(v.acceptance, a));
|
|
138
138
|
if (oldInput || same && (same.retired || same.runtimeId !== runtimeId || blocked.has(same.acceptance.acceptanceId)))
|
|
139
139
|
reject('REMOTE_DETAIL_SCOPE_INVALID');
|
|
140
140
|
guard();
|
|
141
141
|
if (same) {
|
|
142
|
+
if (canonical(same.header) !== canonical(c.header))
|
|
143
|
+
reject('REMOTE_DETAIL_SCOPE_INVALID');
|
|
142
144
|
store.verify(same, guard);
|
|
143
145
|
return ok(structuredClone(same.acceptance));
|
|
144
146
|
}
|
|
@@ -176,9 +178,9 @@ export function createLocalUserTurnAcceptance(o) {
|
|
|
176
178
|
if (record && detail && (record.acceptance.sessionId !== detail.sessionId || record.acceptance.provider !== detail.provider || record.acceptance.instanceId !== detail.instanceId || record.acceptance.epoch !== detail.epoch || expectedIdentity !== undefined && record.identity !== expectedIdentity))
|
|
177
179
|
reject('REMOTE_DETAIL_STORAGE_FAILED');
|
|
178
180
|
const matches = acceptanceId ? [record] : items;
|
|
179
|
-
if (!header || !matches.some(r => r.identity === context.value.identity && r.acceptance.sessionId === sessionId && r.acceptance.provider === provider &&
|
|
181
|
+
if (!header || !matches.some(r => r.identity === context.value.identity && r.acceptance.sessionId === sessionId && r.acceptance.provider === provider && sameSessionHeader(r.header, header) && (!detail || (r.acceptance.instanceId === detail.instanceId && r.acceptance.epoch === detail.epoch))))
|
|
180
182
|
reject('REMOTE_DETAIL_SCOPE_INVALID');
|
|
181
|
-
const admitted = matches.filter(r => r.identity === context.value.identity && r.acceptance.sessionId === sessionId && r.acceptance.provider === provider &&
|
|
183
|
+
const admitted = matches.filter(r => r.identity === context.value.identity && r.acceptance.sessionId === sessionId && r.acceptance.provider === provider && sameSessionHeader(r.header, header));
|
|
182
184
|
const guard = () => {
|
|
183
185
|
life(before);
|
|
184
186
|
context.value.guard?.();
|
|
@@ -262,7 +264,7 @@ export function createLocalUserTurnAcceptance(o) {
|
|
|
262
264
|
return;
|
|
263
265
|
observed.delete(session);
|
|
264
266
|
sessionRevisions.set(session.header.id, (sessionRevisions.get(session.header.id) ?? 0) + 1);
|
|
265
|
-
retire(store.read(), r => r.acceptance.sessionId === session.header.id &&
|
|
267
|
+
retire(store.read(), r => r.acceptance.sessionId === session.header.id && sameSessionHeader(r.header, session.header));
|
|
266
268
|
}
|
|
267
269
|
return { active, observe, observeLocations, observeSessionDisposed, readScope, withWrite, acceptLocalWorkspaceUserTurn(request) {
|
|
268
270
|
try {
|