@artenx/dshb 0.1.39 → 0.1.41
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/lib/auth/gate.d.ts +9 -1
- package/lib/auth/gate.js +12 -5
- package/lib/auth/gate.js.map +1 -1
- package/lib/auth/index.js +42 -9
- package/lib/auth/index.js.map +1 -1
- package/lib/catalog-BPkswHoz.js +121 -0
- package/lib/catalog-BPkswHoz.js.map +1 -0
- package/lib/client.js +482 -45
- package/lib/client.js.map +1 -1
- package/lib/{connection-sIX25pkS.d.ts → connection-CDJM9aUw.d.ts} +10 -3
- package/lib/core/index.js +480 -4
- package/lib/core/index.js.map +1 -1
- package/lib/core/routes.d.ts +1 -1
- package/lib/core/sync/coordinator.d.ts +5 -5
- package/lib/core/sync/coordinator.js +39 -6
- package/lib/core/sync/coordinator.js.map +1 -1
- package/lib/core/sync/host-key.d.ts +1 -1
- package/lib/core/sync/internal-routes.d.ts +3 -3
- package/lib/core/sync/internal-routes.js +36 -3
- package/lib/core/sync/internal-routes.js.map +1 -1
- package/lib/core/sync/model.d.ts +2 -2
- package/lib/core/sync/model.js +62 -1
- package/lib/core/sync/model.js.map +1 -1
- package/lib/core/sync/node-sync.d.ts +1 -1
- package/lib/core/sync/offline-archive.d.ts +6 -4
- package/lib/core/sync/offline-archive.js +31 -8
- package/lib/core/sync/offline-archive.js.map +1 -1
- package/lib/core/sync/offline-routes.js +29 -3
- package/lib/core/sync/offline-routes.js.map +1 -1
- package/lib/core/sync/peer-manager.d.ts +2 -2
- package/lib/core/sync/peer-manager.js +2 -0
- package/lib/core/sync/peer-manager.js.map +1 -1
- package/lib/core/sync/protocol.d.ts +2 -2
- package/lib/core/sync/protocol.js +2 -1
- package/lib/core/sync/protocol.js.map +1 -1
- package/lib/core/sync/remote-helper.js +4 -2
- package/lib/core/sync/remote-helper.js.map +1 -1
- package/lib/core/sync/routes.d.ts +1 -1
- package/lib/core/sync/routes.js +26 -1
- package/lib/core/sync/routes.js.map +1 -1
- package/lib/core/sync/session-journal.d.ts +1 -1
- package/lib/core/sync/session-routes.d.ts +1 -1
- package/lib/core/sync/session-routes.js +1 -1
- package/lib/core/sync/session-routes.js.map +1 -1
- package/lib/core/sync/session-sync.d.ts +1 -1
- package/lib/core/sync/session-sync.js +1 -1
- package/lib/core/sync/ssh-transport.d.ts +1 -1
- package/lib/core/sync/ssh-transport.js +73 -3
- package/lib/core/sync/ssh-transport.js.map +1 -1
- package/lib/core/sync/stores.d.ts +1 -1
- package/lib/core/sync/stores.js +8 -2
- package/lib/core/sync/stores.js.map +1 -1
- package/lib/core/workspaces.d.ts +1 -1
- package/lib/exec-ssh/connection-pool.d.ts +1 -1
- package/lib/exec-ssh/connection.d.ts +2 -2
- package/lib/exec-ssh/connection.js +29 -12
- package/lib/exec-ssh/connection.js.map +1 -1
- package/lib/exec-ssh/executor.d.ts +10 -1
- package/lib/exec-ssh/executor.js +91 -42
- package/lib/exec-ssh/executor.js.map +1 -1
- package/lib/exec-ssh/index.d.ts +1 -1
- package/lib/{host-key-CSnpIrjq.d.ts → host-key-CjO13Ds4.d.ts} +2 -2
- package/lib/{model-CKTBf-Pl.d.ts → model-CX2TlH2E.d.ts} +70 -6
- package/lib/{node-sync-C3Ym-HDu.d.ts → node-sync-qnJ7u0TU.d.ts} +3 -3
- package/lib/{protocol-DJ0zyVlB.d.ts → protocol-DyPDIJWa.d.ts} +3 -2
- package/lib/selection-BABQH1Rt.js +48 -0
- package/lib/selection-BABQH1Rt.js.map +1 -0
- package/lib/{session-journal-VE_1tA2-.d.ts → session-journal-lum5L2ip.d.ts} +2 -2
- package/lib/{session-sync-BBCm_ou2.js → session-sync-BV1CSYic.js} +85 -2
- package/lib/session-sync-BV1CSYic.js.map +1 -0
- package/lib/{session-sync-Bw0cZ4oa.d.ts → session-sync-Be5wuYHJ.d.ts} +12 -6
- package/lib/{ssh-transport-COZe0BDr.d.ts → ssh-transport-Cevwfre9.d.ts} +25 -6
- package/lib/{stores-puyTC075.d.ts → stores-BwQLabuJ.d.ts} +2 -2
- package/package.json +3 -1
- package/lib/session-sync-BBCm_ou2.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { o as NodeRegistry } from "./node-registry-BTnnM5-k.js";
|
|
2
2
|
import { r as WorkspaceBindingsStore } from "./workspace-bindings-CsB0TIJB.js";
|
|
3
3
|
import { r as SyncRevision } from "./revision-C9sOlDZ6.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as SyncStateStore } from "./stores-
|
|
6
|
-
import { s as SyncNodeService } from "./node-sync-
|
|
4
|
+
import { _ as SyncSessionArchive, i as SyncCatalogWorkspace, l as SyncOrigin, m as SyncRecordMetadata, r as SyncCatalogSession, s as SyncImportMethod } from "./model-CX2TlH2E.js";
|
|
5
|
+
import { n as SyncStateStore } from "./stores-BwQLabuJ.js";
|
|
6
|
+
import { s as SyncNodeService } from "./node-sync-qnJ7u0TU.js";
|
|
7
7
|
import { S as BrandedNumber, _ as FileAttachmentRef, a as SystemPromptUpdate, b as TypertResource, c as ToolSchema, d as Message, f as SystemMessage, g as ToolCallId, i as LlmFailure, l as AssistantMessage, m as UserMessage, n as LlmCallConfig, o as TokenUsage, p as ToolResultMessage, r as LlmCallConfigAdapterDefaults, s as ToolHistory, t as AssistantStreamRecord, u as DeveloperMessage, v as ImageAttachmentRef, x as Branded, y as TypertLookup } from "./index-VF8bcBeX.js";
|
|
8
8
|
import { a as SessionInstructionSnapshotStore, s as WorkspaceInstructionStore } from "./workspace-instructions-C_ViytzA.js";
|
|
9
|
-
import { t as SyncSessionJournalStore } from "./session-journal-
|
|
9
|
+
import { t as SyncSessionJournalStore } from "./session-journal-lum5L2ip.js";
|
|
10
10
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
11
11
|
//#region ../../node_modules/@deepseek-ai/dsh-scope/lib/types/index.d.ts
|
|
12
12
|
declare const ScopedBrand: unique symbol;
|
|
@@ -1190,6 +1190,7 @@ interface SessionSnapshotLike {
|
|
|
1190
1190
|
formatStatus?: 'current' | 'migration-required';
|
|
1191
1191
|
revision: unknown;
|
|
1192
1192
|
eventCount?: number;
|
|
1193
|
+
sizeBytes?: number;
|
|
1193
1194
|
}
|
|
1194
1195
|
interface SessionHandleLike {
|
|
1195
1196
|
readonly id: SessionId;
|
|
@@ -1296,6 +1297,7 @@ declare class SyncSessionService {
|
|
|
1296
1297
|
private readonly instructions;
|
|
1297
1298
|
private readonly journal;
|
|
1298
1299
|
private readonly now;
|
|
1300
|
+
private readonly getSessionTitle?;
|
|
1299
1301
|
private operationTail;
|
|
1300
1302
|
private readonly exportCache;
|
|
1301
1303
|
private readonly exportCacheStore;
|
|
@@ -1305,7 +1307,7 @@ declare class SyncSessionService {
|
|
|
1305
1307
|
readonly objectInbox: SyncSessionObjectInbox;
|
|
1306
1308
|
/** 工作区级指令存储:导入采纳写入,驱动该工作区新会话的指令注入。 */
|
|
1307
1309
|
readonly workspaceInstructions: WorkspaceInstructionStore;
|
|
1308
|
-
constructor(state: SyncStateStore, nodes: SyncNodeService, registry: NodeRegistry, bindings: WorkspaceBindingsStore, getWorkspaces: () => WorkspaceRegistryLike | undefined, getPersistence: () => SessionPersistenceLike | undefined, getAttachments: () => AttachmentStoreLike | undefined, getSpills: () => SpillStoreLike | undefined, instructions: SessionInstructionSnapshotStore, journal?: SyncSessionJournalStore, now?: () => number, home?: string, workspaceInstructions?: WorkspaceInstructionStore);
|
|
1310
|
+
constructor(state: SyncStateStore, nodes: SyncNodeService, registry: NodeRegistry, bindings: WorkspaceBindingsStore, getWorkspaces: () => WorkspaceRegistryLike | undefined, getPersistence: () => SessionPersistenceLike | undefined, getAttachments: () => AttachmentStoreLike | undefined, getSpills: () => SpillStoreLike | undefined, instructions: SessionInstructionSnapshotStore, journal?: SyncSessionJournalStore, now?: () => number, home?: string, workspaceInstructions?: WorkspaceInstructionStore, getSessionTitle?: ((header: SessionHeader) => string | undefined) | undefined);
|
|
1309
1311
|
exportBundle(): Promise<SyncSessionBundle>;
|
|
1310
1312
|
exportManifest(): Promise<SyncSessionManifest>;
|
|
1311
1313
|
exportEntries(keys: readonly string[], manifestDigest?: string, prefixes?: readonly SyncSessionEventPrefix[], options?: {
|
|
@@ -1325,6 +1327,10 @@ declare class SyncSessionService {
|
|
|
1325
1327
|
recoverPending(): Promise<void>;
|
|
1326
1328
|
cleanupOrphanedStaging(): void;
|
|
1327
1329
|
listArchives(): SyncSessionArchive[];
|
|
1330
|
+
exportCatalog(): Promise<{
|
|
1331
|
+
workspaces: SyncCatalogWorkspace[];
|
|
1332
|
+
sessions: SyncCatalogSession[];
|
|
1333
|
+
}>;
|
|
1328
1334
|
restoreArchive(branchId: string): Promise<SessionId>;
|
|
1329
1335
|
private reuseCachedManifestEntry;
|
|
1330
1336
|
private exportBundleNow;
|
|
@@ -1371,4 +1377,4 @@ declare class SyncSessionService {
|
|
|
1371
1377
|
}
|
|
1372
1378
|
//#endregion
|
|
1373
1379
|
export { sessionEventListDigest as C, validateSyncSessionManifest as D, validateSyncSessionBundle as E, planSessionTransfers as S, validateObjectPayload as T, SyncSessionWorkspace as _, SyncSessionBundle as a, makeSyncSessionBundle as b, SyncSessionEventDelta as c, SyncSessionManifest as d, SyncSessionManifestEntry as f, SyncSessionTransferPlan as g, SyncSessionService as h, SyncSessionApplyResult as i, SyncSessionEventPrefix as l, SyncSessionObjectInbox as m, SyncObjectInboxWriter as n, SyncSessionEntry as o, SyncSessionObject as p, SyncSessionApplyOptions as r, SyncSessionError as s, ExportObjectCache as t, SyncSessionInstructionSnapshot as u, WorkspaceRegistryLike as v, syncSessionEntryKey as w, makeSyncSessionManifest as x, estimateJsonBytes as y };
|
|
1374
|
-
//# sourceMappingURL=session-sync-
|
|
1380
|
+
//# sourceMappingURL=session-sync-Be5wuYHJ.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as SyncNodeManifest, t as SyncNodeApplyResult } from "./node-sync-
|
|
1
|
+
import { t as SyncCatalog, u as SyncPeer } from "./model-CX2TlH2E.js";
|
|
2
|
+
import { i as SyncNodeManifest, t as SyncNodeApplyResult } from "./node-sync-qnJ7u0TU.js";
|
|
3
3
|
import { SyncPeerManager, SyncPeerSecrets } from "./core/sync/peer-manager.js";
|
|
4
|
-
import { r as SyncHostKeyChallenges, t as SyncHostKeyChallengeError } from "./host-key-
|
|
5
|
-
import {
|
|
6
|
-
import { a as SyncSessionBundle, d as SyncSessionManifest, i as SyncSessionApplyResult, l as SyncSessionEventPrefix, p as SyncSessionObject } from "./session-sync-
|
|
4
|
+
import { r as SyncHostKeyChallenges, t as SyncHostKeyChallengeError } from "./host-key-CjO13Ds4.js";
|
|
5
|
+
import { f as SyncFrame } from "./protocol-DyPDIJWa.js";
|
|
6
|
+
import { a as SyncSessionBundle, d as SyncSessionManifest, i as SyncSessionApplyResult, l as SyncSessionEventPrefix, p as SyncSessionObject } from "./session-sync-Be5wuYHJ.js";
|
|
7
7
|
import { Client, ClientChannel, ConnectConfig } from "ssh2";
|
|
8
8
|
//#region src/core/sync/ssh-transport.d.ts
|
|
9
9
|
type SyncSshErrorCategory = 'auth' | 'network' | 'hostkey' | 'timeout' | 'helper' | 'protocol';
|
|
@@ -53,6 +53,18 @@ declare class SyncSshTransport {
|
|
|
53
53
|
/** 立即关闭该对端的全部活跃 SSH 会话(幂等;用于手动停止同步)。 */
|
|
54
54
|
stopActiveSessions(peerId: string): number;
|
|
55
55
|
probe(peerId: string): Promise<SyncRemoteHandshake>;
|
|
56
|
+
/** 建立 peer 的 SSH 连接(含 host-key 校验与凭据);调用方负责 client.end()。 */
|
|
57
|
+
private connectClient;
|
|
58
|
+
/**
|
|
59
|
+
* 打开到远端回环 TCP 目标的 direct-tcpip 通道(元数据同步的远端会话
|
|
60
|
+
* wss 通道用)。通道复用 peer 的 host-key 校验与凭据;调用方负责
|
|
61
|
+
* client.end() 与流销毁。
|
|
62
|
+
*/
|
|
63
|
+
openDirectChannel(peerId: string, targetHost: string, targetPort: number): Promise<{
|
|
64
|
+
peer: SyncPeer;
|
|
65
|
+
client: Client;
|
|
66
|
+
stream: ClientChannel;
|
|
67
|
+
}>;
|
|
56
68
|
openSession(peerId: string): Promise<{
|
|
57
69
|
peer: SyncPeer;
|
|
58
70
|
session: SyncSshSession;
|
|
@@ -61,6 +73,13 @@ declare class SyncSshTransport {
|
|
|
61
73
|
applyNodeManifest(peerId: string, records: SyncNodeManifest['records'], sourceName: string): Promise<SyncNodeApplyResult>;
|
|
62
74
|
fetchSessionBundle(peerId: string): Promise<SyncSessionBundle>;
|
|
63
75
|
fetchSessionManifest(peerId: string): Promise<SyncSessionManifest>;
|
|
76
|
+
fetchCatalog(peerId: string): Promise<SyncCatalog>;
|
|
77
|
+
/** 取得远端铸造的中继凭据(≤10 分钟签名 cookie),供元数据同步的 wss 通道使用。 */
|
|
78
|
+
fetchRelayTicket(peerId: string, authority: string): Promise<{
|
|
79
|
+
name: string;
|
|
80
|
+
value: string;
|
|
81
|
+
maxAgeSeconds: number;
|
|
82
|
+
}>;
|
|
64
83
|
fetchSessionEntries(peerId: string, keys: readonly string[], manifestDigest: string, prefixes?: readonly SyncSessionEventPrefix[], deferredObjects?: boolean): Promise<SyncSessionBundle>;
|
|
65
84
|
applySessionBundle(peerId: string, bundle: SyncSessionBundle, sourceName: string): Promise<SyncSessionApplyResult>;
|
|
66
85
|
trustObservedHostKey(peerId: string): Promise<void>;
|
|
@@ -119,4 +138,4 @@ declare class SyncRemoteProbe {
|
|
|
119
138
|
}
|
|
120
139
|
//#endregion
|
|
121
140
|
export { parseRemoteProbeOutput as _, SyncRemoteProbe as a, SyncRemoteProbeProfile as c, SyncSshErrorCategory as d, SyncSshProbeError as f, buildSyncSshConnectConfig as g, buildRemoteProbeScript as h, SyncRemoteNodeManifest as i, SyncRemoteProbeResult as l, SyncSshTransport as m, REMOTE_PROBE_END_MARKER as n, SyncRemoteProbeDraft as o, SyncSshSession as p, SyncRemoteHandshake as r, SyncRemoteProbeHandshake as s, REMOTE_PROBE_BEGIN_MARKER as t, SyncSessionDeltaPrefixError as u };
|
|
122
|
-
//# sourceMappingURL=ssh-transport-
|
|
141
|
+
//# sourceMappingURL=ssh-transport-Cevwfre9.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as SyncRevision } from "./revision-C9sOlDZ6.js";
|
|
2
|
-
import {
|
|
2
|
+
import { d as SyncPeerDraft, u as SyncPeer, v as SyncState } from "./model-CX2TlH2E.js";
|
|
3
3
|
//#region src/core/sync/stores.d.ts
|
|
4
4
|
declare function getOrCreateSyncInstanceId(home?: string): string;
|
|
5
5
|
declare class SyncPeerStore {
|
|
@@ -28,4 +28,4 @@ declare class SyncStateStore {
|
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
export { SyncStateStore as n, getOrCreateSyncInstanceId as r, SyncPeerStore as t };
|
|
31
|
-
//# sourceMappingURL=stores-
|
|
31
|
+
//# sourceMappingURL=stores-BwQLabuJ.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artenx/dshb",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"description": "让 DSH 变成随时可用的多设备 Agent 工作台,支持将远程节点添加到本地 DSH,并像操作本地内容一样访问远程节点,包括会话环境、文件目录、终端等。支持在安装了本插件的多个 DSH 实例间同步数据。若部署在云服务器,Web 端访问支持登录认证。真正实现远程节点本地化操作。最新版本已支持 DSH 桌面端。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -47,6 +47,8 @@
|
|
|
47
47
|
"./core/sync/session-journal": "./lib/core/sync/session-journal.js",
|
|
48
48
|
"./core/sync/session-routes": "./lib/core/sync/session-routes.js",
|
|
49
49
|
"./core/sync/session-sync": "./lib/core/sync/session-sync.js",
|
|
50
|
+
"./core/sync/remote-relay": "./lib/core/sync/remote-relay.js",
|
|
51
|
+
"./core/sync/relay-auth": "./lib/core/sync/relay-auth.js",
|
|
50
52
|
"./core/sync/ssh-transport": "./lib/core/sync/ssh-transport.js",
|
|
51
53
|
"./core/sync/stores": "./lib/core/sync/stores.js",
|
|
52
54
|
"./router": "./lib/router/index.js",
|