@ai-workbench/connect 0.7.22 → 0.7.23
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.23只提供固定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.23,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.23本轮提供固定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
|
|
|
@@ -143,3 +143,9 @@ payload 仅有七个必填字段:phase 固定 `workspace-source-admission`;s
|
|
|
143
143
|
连接恢复后自动只读复核原主机目录,未变则恢复原选择。只有实际核实的目录身份或权限变化才撤销绑定,并在工作区来源栏显示具体原因;SSH传输失败及未观测的权限仅失败本次。已撤销目录可按正常浏览与选择重新确认并生成新绑定;原会话须新建会话继续,原详情历史保持只读。
|
|
144
144
|
|
|
145
145
|
每次真实主机解析核目录一次,技术详情写入不逐条发SSH,仍保留当前连接、来源绑定及持久提交守卫。正确性复核不可关闭,无新增Config/权限层/超时/重试。0.7.22候选工程与独审证据见本轮交付目录;真实leo门单独留证,未跑不标通过。
|
|
146
|
+
|
|
147
|
+
## 0.7.23 技术详情事务隔离
|
|
148
|
+
|
|
149
|
+
已接纳的主机和本机技术详情使用独立事务队列,慢主机解析不再占用详情写入队列。来源选择、刷新、真实用户轮接纳与主机解析仍按原来源队列串行;详情全域eventId幂等与sequence事务不变。每次守卫重读并完整校验位置记录,再核对本工作区原绑定;切源、撤销、断连或身份变化均拒绝最终成功,其他工作区的合法选择不使本工作区失效。文件原子写、文件与目录fsync保持,落盘但未确认的事件只读核实,不自动重发。
|
|
150
|
+
|
|
151
|
+
本轮无新增设置、权限、默认值、超时或重试。复核属于不可关闭的正确性不变量,设置页继续显示原说明。本地夹具剖析用于区分读、校验与fsync成本,不代表leo真实延迟或员工路径验收。
|
|
@@ -491,6 +491,10 @@ export function createConversationDetails(options) {
|
|
|
491
491
|
if (!options.localAcceptance)
|
|
492
492
|
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
493
493
|
const result = await options.localAcceptance.withWrite(localId, detail, write);
|
|
494
|
+
if (result.ok) {
|
|
495
|
+
admissionGuard?.();
|
|
496
|
+
check(before);
|
|
497
|
+
}
|
|
494
498
|
return !result.ok && result.error.code === 'REMOTE_DETAIL_STORAGE_FAILED' ? error(new NeedError(result.error)) : result;
|
|
495
499
|
}
|
|
496
500
|
return write();
|
|
@@ -52,7 +52,7 @@ interface Options {
|
|
|
52
52
|
path: string;
|
|
53
53
|
device: number;
|
|
54
54
|
inode: number;
|
|
55
|
-
}, guard: () => void) => Promise<Result<T
|
|
55
|
+
}, guard: () => void) => Promise<Result<T>>, queue?: 'detail-write') => Promise<Result<T>>;
|
|
56
56
|
}
|
|
57
57
|
export declare function createLocalUserTurnAcceptance(o: Options): {
|
|
58
58
|
active: () => boolean;
|
|
@@ -47,7 +47,7 @@ export declare function createWorkspaceLocations(o: Options): {
|
|
|
47
47
|
path: string;
|
|
48
48
|
device: number;
|
|
49
49
|
inode: number;
|
|
50
|
-
}, guard: () => void) => Promise<Result<T
|
|
50
|
+
}, guard: () => void) => Promise<Result<T>>, queue?: "detail-write") => Promise<Result<T>>;
|
|
51
51
|
getLocalWorkspaceContext: (request: LocalWorkspaceContextRequest) => Promise<Result<LocalWorkspaceContext>>;
|
|
52
52
|
getWorkspaceLocationState: () => {
|
|
53
53
|
host: {
|
|
@@ -70,6 +70,6 @@ export declare function createWorkspaceLocations(o: Options): {
|
|
|
70
70
|
guardLegacySession: (id: string) => Promise<Result<void>>;
|
|
71
71
|
resolveLegacySession: <T>(id: string, resolve: () => Promise<Result<T>>) => Promise<Result<T>>;
|
|
72
72
|
observeConnection(): Promise<Result<WorkspaceLocationState>> | undefined;
|
|
73
|
-
dispose(): Promise<
|
|
73
|
+
dispose(): Promise<void>;
|
|
74
74
|
};
|
|
75
75
|
export {};
|
|
@@ -5,7 +5,9 @@ import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from
|
|
|
5
5
|
import { privateDirectory, readPrivate, readPrivateSync } from "./private-files.js";
|
|
6
6
|
import { fail, ok, need, NeedError } from "./needs.js";
|
|
7
7
|
import { readLocalWorkspaceProcess } from "./local-workspace-context.js";
|
|
8
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
8
9
|
const queues = new Map();
|
|
10
|
+
const detailQueues = new Map();
|
|
9
11
|
const hash = (v) => createHash('sha256').update(JSON.stringify(v)).digest('hex');
|
|
10
12
|
const token = (v) => typeof v === 'string' && v.length > 0 && !/[\x00-\x1f\x7f]/.test(v);
|
|
11
13
|
const obj = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
|
|
@@ -15,7 +17,7 @@ const sameDirectory = (a, b) => a.path === b.path && a.requestedPath === b.reque
|
|
|
15
17
|
export function createWorkspaceLocations(o) {
|
|
16
18
|
const controllers = new Set(), revokedBindings = new Map();
|
|
17
19
|
const root = join(o.profileDir, 'ai-workbench-connect'), file = join(root, 'locations.json'), secret = randomBytes(32), listeners = new Set();
|
|
18
|
-
let disposed = false, revision = 0, tail = Promise.resolve();
|
|
20
|
+
let disposed = false, revision = 0, tail = Promise.resolve(), detailTail = Promise.resolve();
|
|
19
21
|
let snapshot = { ...connection(), host: currentHost(), revision: 0, phase: 'loading', pageSize: o.pageSize, items: [] };
|
|
20
22
|
function connection() { const c = o.api.getConnectionState(); return { instanceId: c.instanceId, epoch: c.epoch }; }
|
|
21
23
|
function currentHost() { const c = o.api.getConnectionState(); if (c.phase !== 'connected')
|
|
@@ -47,8 +49,8 @@ export function createWorkspaceLocations(o) {
|
|
|
47
49
|
if (failed)
|
|
48
50
|
throw firstError;
|
|
49
51
|
}
|
|
50
|
-
function serial(fn) {
|
|
51
|
-
const before =
|
|
52
|
+
function serial(fn, detailWrite = false) {
|
|
53
|
+
const queue = detailWrite ? detailQueues : queues, before = queue.get(file) ?? Promise.resolve();
|
|
52
54
|
const task = before.then(async () => {
|
|
53
55
|
if (disposed)
|
|
54
56
|
return fail('DISPOSED');
|
|
@@ -59,12 +61,15 @@ export function createWorkspaceLocations(o) {
|
|
|
59
61
|
return e instanceof NeedError ? { ok: false, error: e.need } : fail('WORKSPACE_LOCATION_STORAGE_FAILED');
|
|
60
62
|
}
|
|
61
63
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
const settled = task.then(() => { }, () => { });
|
|
65
|
+
if (detailWrite)
|
|
66
|
+
detailTail = settled;
|
|
67
|
+
else
|
|
68
|
+
tail = settled;
|
|
69
|
+
queue.set(file, settled);
|
|
65
70
|
void settled.then(() => {
|
|
66
|
-
if (
|
|
67
|
-
|
|
71
|
+
if (queue.get(file) === settled)
|
|
72
|
+
queue.delete(file);
|
|
68
73
|
});
|
|
69
74
|
return task;
|
|
70
75
|
}
|
|
@@ -87,6 +92,9 @@ export function createWorkspaceLocations(o) {
|
|
|
87
92
|
return [];
|
|
88
93
|
throw e;
|
|
89
94
|
}
|
|
95
|
+
return parseRecords(raw);
|
|
96
|
+
}
|
|
97
|
+
function parseRecords(raw) {
|
|
90
98
|
const data = JSON.parse(raw);
|
|
91
99
|
if (!obj(data) || data.schemaVersion !== 1 || !Array.isArray(data.items))
|
|
92
100
|
reject('WORKSPACE_LOCATION_STORAGE_FAILED');
|
|
@@ -100,6 +108,19 @@ export function createWorkspaceLocations(o) {
|
|
|
100
108
|
}
|
|
101
109
|
return data.items;
|
|
102
110
|
}
|
|
111
|
+
// Detail writes may overlap selection/resolve. Revalidate all storage, then
|
|
112
|
+
// bind the guard to this exact active record, not a later read of new bytes.
|
|
113
|
+
// An unrelated workspace's valid selection does not change this authority.
|
|
114
|
+
function guardStoredBinding(expected) {
|
|
115
|
+
const current = parseRecords(readPrivateSync(file, o.metadataMaxBytes)).find(r => r.active && r.workspaceId === expected.workspaceId);
|
|
116
|
+
if (!current)
|
|
117
|
+
reject('WORKSPACE_LOCATION_CONFLICT');
|
|
118
|
+
const invalid = bindingNeed(current);
|
|
119
|
+
if (invalid)
|
|
120
|
+
reject(invalid);
|
|
121
|
+
if (!isDeepStrictEqual(current, expected))
|
|
122
|
+
reject('WORKSPACE_LOCATION_CONFLICT');
|
|
123
|
+
}
|
|
103
124
|
async function save(items, beforeCommit, context) {
|
|
104
125
|
for (const r of items)
|
|
105
126
|
r.key = checksum(r);
|
|
@@ -468,7 +489,8 @@ export function createWorkspaceLocations(o) {
|
|
|
468
489
|
return fail('WORKSPACE_LOCATION_INVALID');
|
|
469
490
|
return ok(undefined);
|
|
470
491
|
}
|
|
471
|
-
//
|
|
492
|
+
// Resolves remain serialized with selection. Already-admitted detail writes
|
|
493
|
+
// use their own queue and revalidate the original binding at every guard.
|
|
472
494
|
function withHostBinding(input, run, finalize = () => { }, inspectRemote = true) {
|
|
473
495
|
const c = structuredClone(input);
|
|
474
496
|
return serial(async () => {
|
|
@@ -485,7 +507,7 @@ export function createWorkspaceLocations(o) {
|
|
|
485
507
|
check(c);
|
|
486
508
|
if (t.identity !== r.identity)
|
|
487
509
|
reject('WORKSPACE_LOCATION_INVALID');
|
|
488
|
-
const bytes = await readPrivate(file, o.metadataMaxBytes), registeredPath = registeredLocalPath(c.workspaceId);
|
|
510
|
+
const bytes = inspectRemote ? await readPrivate(file, o.metadataMaxBytes) : undefined, registeredPath = registeredLocalPath(c.workspaceId);
|
|
489
511
|
const guard = () => {
|
|
490
512
|
check(c);
|
|
491
513
|
const invalid = bindingNeed(r);
|
|
@@ -500,8 +522,12 @@ export function createWorkspaceLocations(o) {
|
|
|
500
522
|
const v = latest.value.target;
|
|
501
523
|
if (hash([v.host, v.username, v.port, v.projectRoot, v.session, readPrivateSync(v.knownHostsFile, o.metadataMaxBytes)]) !== t.identity)
|
|
502
524
|
reject('WORKSPACE_LOCATION_INVALID');
|
|
503
|
-
if (
|
|
504
|
-
|
|
525
|
+
if (inspectRemote) {
|
|
526
|
+
if (readPrivateSync(file, o.metadataMaxBytes) !== bytes)
|
|
527
|
+
reject('WORKSPACE_LOCATION_CONFLICT');
|
|
528
|
+
}
|
|
529
|
+
else
|
|
530
|
+
guardStoredBinding(r);
|
|
505
531
|
if (registeredLocalPath(c.workspaceId) !== registeredPath)
|
|
506
532
|
reject('WORKSPACE_LOCATION_INVALID');
|
|
507
533
|
try {
|
|
@@ -546,10 +572,11 @@ export function createWorkspaceLocations(o) {
|
|
|
546
572
|
finalize();
|
|
547
573
|
guard();
|
|
548
574
|
return result;
|
|
549
|
-
});
|
|
575
|
+
}, !inspectRemote);
|
|
550
576
|
}
|
|
551
|
-
//
|
|
552
|
-
|
|
577
|
+
// Admission remains with source selection; only existing detail authority
|
|
578
|
+
// uses the independent queue. Neither path is a public execution API.
|
|
579
|
+
function withLocalBinding(c, run, queue) {
|
|
553
580
|
return serial(async () => {
|
|
554
581
|
const x = await context(c);
|
|
555
582
|
checkLocalContext(c);
|
|
@@ -558,6 +585,8 @@ export function createWorkspaceLocations(o) {
|
|
|
558
585
|
const registeredPath = registeredLocalPath(c.workspaceId);
|
|
559
586
|
const guard = () => {
|
|
560
587
|
checkLocalContext(c);
|
|
588
|
+
if (queue === 'detail-write')
|
|
589
|
+
guardStoredBinding(x.current);
|
|
561
590
|
if (registeredLocalPath(c.workspaceId) !== registeredPath)
|
|
562
591
|
reject('WORKSPACE_LOCATION_INVALID');
|
|
563
592
|
try {
|
|
@@ -574,7 +603,7 @@ export function createWorkspaceLocations(o) {
|
|
|
574
603
|
};
|
|
575
604
|
guard();
|
|
576
605
|
return run({ path: x.n.localPath, device: x.n.localDev, inode: x.n.localIno }, guard);
|
|
577
|
-
});
|
|
606
|
+
}, queue === 'detail-write');
|
|
578
607
|
}
|
|
579
608
|
return { withHostBinding, isHostBindingRevoked: (id) => revokedBindings.has(id) || !!o.isHostBindingRevoked?.(id), withLocalBinding, getLocalWorkspaceContext, getWorkspaceLocationState: () => ({ ...structuredClone(snapshot), host: currentHost() }), onWorkspaceLocationState(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; }, refreshWorkspaceLocations: () => serial(refresh), browseWorkspaceHostDirectories: (c) => serial(() => browse(c)), selectWorkspaceLocation: (c) => serial(() => select(c)), guardLegacySession: (id) => serial(() => guard(id)), resolveLegacySession: (id, resolve) => serial(async () => {
|
|
580
609
|
const c = connection(), before = await guard(id);
|
|
@@ -601,6 +630,6 @@ export function createWorkspaceLocations(o) {
|
|
|
601
630
|
for (const controller of controllers)
|
|
602
631
|
controller.abort();
|
|
603
632
|
listeners.clear();
|
|
604
|
-
return tail;
|
|
633
|
+
return Promise.all([tail, detailTail]).then(() => { });
|
|
605
634
|
} };
|
|
606
635
|
}
|