@artenx/dshb 0.1.43 → 0.1.44

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.
@@ -1,7 +1,7 @@
1
1
  import { KnownHostsStore } from "./known-hosts.js";
2
2
  import { o as NodeRegistry } from "../node-registry-BTnnM5-k.js";
3
3
  import { r as WorkspaceBindingsStore } from "../workspace-bindings-CsB0TIJB.js";
4
- import { s as SyncNodeService } from "../node-sync-CJZl2FCE.js";
4
+ import { s as SyncNodeService } from "../node-sync-DwB1OJyx.js";
5
5
  import { Context } from "@deepseek-ai/cordis";
6
6
  //#region src/core/routes.d.ts
7
7
  interface WorkspaceRegistryLike {
@@ -1,9 +1,9 @@
1
- import { u as SyncPeer } from "../../model-qtM3rcyA.js";
2
- import { n as SyncStateStore } from "../../stores-NzEbaGQ3.js";
3
- import { n as SyncNodeEntry, s as SyncNodeService } from "../../node-sync-CJZl2FCE.js";
1
+ import { u as SyncPeer } from "../../model-CYwA2ha_.js";
2
+ import { n as SyncStateStore } from "../../stores-Cxjt9l2a.js";
3
+ import { n as SyncNodeEntry, s as SyncNodeService } from "../../node-sync-DwB1OJyx.js";
4
4
  import { SyncPeerManager } from "./peer-manager.js";
5
- import { h as SyncSessionService } from "../../session-sync-Celc4x_B.js";
6
- import { m as SyncSshTransport } from "../../ssh-transport-DLXkPpxT.js";
5
+ import { h as SyncSessionService } from "../../session-sync-DL25qi0e.js";
6
+ import { m as SyncSshTransport } from "../../ssh-transport-D5X4YKg7.js";
7
7
  //#region src/core/sync/coordinator.d.ts
8
8
  interface NodeTransferPlan {
9
9
  toLocal: SyncNodeEntry[];
@@ -1,2 +1,2 @@
1
- import { a as inspectSyncHostKey, i as SyncHostKeyDecision, n as SyncHostKeyChallengeExpiredError, o as isOpenSshFingerprint, r as SyncHostKeyChallenges, s as opensshFingerprintFromSha256Hex, t as SyncHostKeyChallengeError } from "../../host-key-DeHqgO7s.js";
1
+ import { a as inspectSyncHostKey, i as SyncHostKeyDecision, n as SyncHostKeyChallengeExpiredError, o as isOpenSshFingerprint, r as SyncHostKeyChallenges, s as opensshFingerprintFromSha256Hex, t as SyncHostKeyChallengeError } from "../../host-key-ahUa0x1Z.js";
2
2
  export { SyncHostKeyChallengeError, SyncHostKeyChallengeExpiredError, SyncHostKeyChallenges, SyncHostKeyDecision, inspectSyncHostKey, isOpenSshFingerprint, opensshFingerprintFromSha256Hex };
@@ -1,6 +1,6 @@
1
- import { n as SyncStateStore } from "../../stores-NzEbaGQ3.js";
2
- import { s as SyncNodeService } from "../../node-sync-CJZl2FCE.js";
3
- import { h as SyncSessionService } from "../../session-sync-Celc4x_B.js";
1
+ import { n as SyncStateStore } from "../../stores-Cxjt9l2a.js";
2
+ import { s as SyncNodeService } from "../../node-sync-DwB1OJyx.js";
3
+ import { h as SyncSessionService } from "../../session-sync-DL25qi0e.js";
4
4
  import { Context } from "@deepseek-ai/cordis";
5
5
  //#region src/core/sync/internal-routes.d.ts
6
6
  declare function registerSyncInternalRoutes(ctx: Context, state: SyncStateStore, nodeSync?: SyncNodeService, sessionSync?: SyncSessionService): void;
@@ -1,2 +1,2 @@
1
- import { C as parseSyncPeer, D as syncWorkspaceKey, E as syncRecordKey, S as isRecord, T as parseSyncSelection, _ as SyncSessionArchive, a as SyncDirection, b as SyncWorkspaceOrigin, c as SyncMode, d as SyncPeerDraft, f as SyncPeerProgress, g as SyncSelection, h as SyncSchedule, i as SyncCatalogWorkspace, l as SyncOrigin, m as SyncRecordMetadata, n as SyncCatalogNode, o as SyncEntityKind, p as SyncProvenance, r as SyncCatalogSession, s as SyncImportMethod, t as SyncCatalog, u as SyncPeer, v as SyncState, w as parseSyncPeerDraft, x as isNonNegativeSafeInteger, y as SyncWorkspaceMapping } from "../../model-qtM3rcyA.js";
1
+ import { C as parseSyncPeer, D as syncWorkspaceKey, E as syncRecordKey, S as isRecord, T as parseSyncSelection, _ as SyncSessionArchive, a as SyncDirection, b as SyncWorkspaceOrigin, c as SyncMode, d as SyncPeerDraft, f as SyncPeerProgress, g as SyncSelection, h as SyncSchedule, i as SyncCatalogWorkspace, l as SyncOrigin, m as SyncRecordMetadata, n as SyncCatalogNode, o as SyncEntityKind, p as SyncProvenance, r as SyncCatalogSession, s as SyncImportMethod, t as SyncCatalog, u as SyncPeer, v as SyncState, w as parseSyncPeerDraft, x as isNonNegativeSafeInteger, y as SyncWorkspaceMapping } from "../../model-CYwA2ha_.js";
2
2
  export { SyncCatalog, SyncCatalogNode, SyncCatalogSession, SyncCatalogWorkspace, SyncDirection, SyncEntityKind, SyncImportMethod, SyncMode, SyncOrigin, SyncPeer, SyncPeerDraft, SyncPeerProgress, SyncProvenance, SyncRecordMetadata, SyncSchedule, SyncSelection, SyncSessionArchive, SyncState, SyncWorkspaceMapping, SyncWorkspaceOrigin, isNonNegativeSafeInteger, isRecord, parseSyncPeer, parseSyncPeerDraft, parseSyncSelection, syncRecordKey, syncWorkspaceKey };
@@ -104,8 +104,8 @@ function parseSyncPeer(value) {
104
104
  const username = text(input.username, "username", 128);
105
105
  if (/\s/.test(username)) throw new Error("username is invalid");
106
106
  if (input.authKind !== "password" && input.authKind !== "key") throw new Error("authKind must be password or key");
107
- if (input.direction !== "pull" && input.direction !== "bidirectional") throw new Error("direction must be pull or bidirectional");
108
- if (input.schedule !== "manual" && input.schedule !== "every-5m") throw new Error("schedule must be manual or every-5m");
107
+ if (input.direction !== void 0 && input.direction !== "pull" && input.direction !== "bidirectional") throw new Error("direction must be pull or bidirectional");
108
+ if (input.schedule !== void 0 && input.schedule !== "manual" && input.schedule !== "every-5m") throw new Error("schedule must be manual or every-5m");
109
109
  if (input.mode !== void 0 && input.mode !== "full" && input.mode !== "metadata") throw new Error("mode must be full or metadata");
110
110
  if (input.syncNodes !== void 0 && typeof input.syncNodes !== "boolean") throw new Error("syncNodes must be a boolean");
111
111
  if (typeof input.syncSessions !== "boolean" || typeof input.enabled !== "boolean") throw new Error("syncSessions and enabled must be booleans");
@@ -125,10 +125,9 @@ function parseSyncPeer(value) {
125
125
  ...remoteDshHome === void 0 ? {} : { remoteDshHome: posix.normalize(remoteDshHome) },
126
126
  ...remoteProfile === void 0 ? {} : { remoteProfile },
127
127
  ...input.remoteWebPort === void 0 ? {} : { remoteWebPort: port(input.remoteWebPort, "remoteWebPort") },
128
- direction: input.direction,
129
- schedule: input.schedule,
128
+ direction: "bidirectional",
129
+ schedule: "manual",
130
130
  mode: input.mode === void 0 ? "full" : input.mode,
131
- ...input.syncNodes === void 0 ? {} : { syncNodes: input.syncNodes },
132
131
  syncSessions: input.syncSessions,
133
132
  ...input.selection === void 0 ? {} : { selection: parseSyncSelection(input.selection) },
134
133
  enabled: input.enabled,
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","names":[],"sources":["../../../src/core/sync/model.ts"],"sourcesContent":["import { posix } from 'node:path'\nimport type { SyncRevision } from './revision.js'\n\nexport type SyncDirection = 'pull' | 'bidirectional'\nexport type SyncSchedule = 'manual' | 'every-5m'\nexport type SyncEntityKind = 'node' | 'session'\nexport type SyncImportMethod = 'peer' | 'offline'\n/** 全量同步传输会话内容;元数据同步只同步目录,点击会话时经 wss 实时操作远端。 */\nexport type SyncMode = 'full' | 'metadata'\n\nexport interface SyncOrigin {\n originInstanceId: string\n originEntityId: string\n}\n\nexport interface SyncPeer {\n id: string\n name: string\n host: string\n port: number\n username: string\n authKind: 'password' | 'key'\n remoteDshHome?: string\n remoteProfile?: string\n remoteWebPort?: number\n direction: SyncDirection\n schedule: SyncSchedule\n mode: SyncMode\n /** 同步工作节点配置;仅元数据同步可关闭(全量会话同步依赖节点配置)。缺省 true。 */\n syncNodes?: boolean\n syncSessions: boolean\n selection?: SyncSelection\n enabled: boolean\n hostKeyFingerprint?: string\n}\n\nexport interface SyncWorkspaceOrigin extends SyncOrigin {\n remotePath: string\n}\n\nexport interface SyncSelection {\n mode: 'all' | 'selected'\n nodes: SyncOrigin[]\n workspaces: SyncWorkspaceOrigin[]\n sessions: SyncOrigin[]\n}\n\nexport interface SyncCatalogNode {\n origin: SyncOrigin\n name: string\n type: 'remote-ssh' | 'remote-docker'\n}\n\nexport interface SyncCatalogWorkspace {\n origin: SyncOrigin\n nodeOrigin: SyncOrigin\n remotePath: string\n title: string\n}\n\nexport interface SyncCatalogSession {\n origin: SyncOrigin\n workspaceOrigin?: SyncOrigin\n workspaceRemotePath?: string\n nodeOrigin?: SyncOrigin\n sessionId: string\n title?: string\n sizeBytes?: number\n branchId?: string\n deleted?: boolean\n}\n\nexport interface SyncCatalog {\n protocolVersion: 1\n instanceId: string\n nodes: SyncCatalogNode[]\n workspaces: SyncCatalogWorkspace[]\n sessions: SyncCatalogSession[]\n}\n\nexport interface SyncPeer {\n id: string\n name: string\n host: string\n port: number\n username: string\n authKind: 'password' | 'key'\n remoteDshHome?: string\n remoteProfile?: string\n remoteWebPort?: number\n direction: SyncDirection\n schedule: SyncSchedule\n syncSessions: boolean\n selection?: SyncSelection\n enabled: boolean\n hostKeyFingerprint?: string\n}\n\nexport type SyncPeerDraft = Omit<SyncPeer, 'id' | 'hostKeyFingerprint'>\n\nexport interface SyncProvenance extends SyncOrigin {\n localEntityId: string\n importedVia?: SyncImportMethod\n sourceName?: string\n}\n\nexport interface SyncRecordMetadata extends SyncProvenance {\n kind: SyncEntityKind\n revision: SyncRevision\n contentDigest: string\n stateDigest?: string\n workspaceOrigin?: SyncOrigin\n deleted?: boolean\n pendingRemoval?: boolean\n credentialsRequired?: boolean\n}\n\nexport interface SyncPeerProgress {\n lastRunAt?: string\n lastRunStatus?: 'running' | 'succeeded' | 'failed' | 'stopped'\n lastSuccessAt?: string\n lastManifestDigest?: string\n watermark?: string\n lastErrorCode?: string\n lastErrorMessage?: string\n lastResult?: {\n imported: number\n exported: number\n skipped: number\n pendingRemoval: number\n importedSessions: number\n exportedSessions: number\n skippedSessions: number\n /** 元数据同步最近一次目录计数(可选,旧状态缺省)。 */\n catalogNodes?: number\n catalogWorkspaces?: number\n catalogSessions?: number\n }\n}\n\nexport interface SyncWorkspaceMapping {\n originInstanceId: string\n originWorkspaceId: string\n localWorkspaceId: string\n localPath: string\n localNodeId: string\n remotePath: string\n title: string\n revision: SyncRevision\n contentDigest: string\n}\n\nexport interface SyncSessionArchive {\n branchId: string\n originInstanceId: string\n originSessionId: string\n localSessionId: string\n revision: SyncRevision\n contentDigest: string\n stateDigest: string\n workspacePosition: number\n workspaceId?: string\n workspaceOrigin?: SyncOrigin\n archivedAt: string\n}\n\nexport interface SyncState {\n version: 1\n clock: { physicalTimeMs: number; logicalCounter: number }\n peers: Record<string, SyncPeerProgress>\n records: Record<string, SyncRecordMetadata>\n workspaces: Record<string, SyncWorkspaceMapping>\n archives: Record<string, SyncSessionArchive>\n}\n\nconst PEER_FIELDS = new Set([\n 'id',\n 'name',\n 'host',\n 'port',\n 'username',\n 'authKind',\n 'remoteDshHome',\n 'remoteProfile',\n 'remoteWebPort',\n 'direction',\n 'schedule',\n 'mode',\n 'syncNodes',\n 'syncSessions',\n 'selection',\n 'enabled',\n 'hostKeyFingerprint',\n])\n\nconst PEER_DRAFT_FIELDS = new Set([...PEER_FIELDS].filter((field) => field !== 'id' && field !== 'hostKeyFingerprint'))\n\nfunction record(value: unknown, label: string): Record<string, unknown> {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error(`${label} must be an object`)\n }\n return value as Record<string, unknown>\n}\n\nfunction text(value: unknown, label: string, maxLength: number): string {\n if (typeof value !== 'string') throw new Error(`${label} must be a string`)\n const result = value.trim()\n if (!result || result.length > maxLength || /[\\u0000-\\u001f\\u007f]/.test(result)) {\n throw new Error(`${label} is invalid`)\n }\n return result\n}\n\nfunction optionalText(value: unknown, label: string, maxLength: number): string | undefined {\n return value === undefined ? undefined : text(value, label, maxLength)\n}\n\nfunction port(value: unknown, label: string): number {\n if (!Number.isSafeInteger(value) || (value as number) < 1 || (value as number) > 65535) {\n throw new Error(`${label} must be an integer between 1 and 65535`)\n }\n return value as number\n}\n\nfunction parseOrigin(value: unknown, label: string): SyncOrigin {\n const input = record(value, label)\n if (Object.keys(input).some((key) => key !== 'originInstanceId' && key !== 'originEntityId')) {\n throw new Error(`${label} contains unsupported fields`)\n }\n return {\n originInstanceId: text(input.originInstanceId, `${label}.originInstanceId`, 512),\n originEntityId: text(input.originEntityId, `${label}.originEntityId`, 512),\n }\n}\n\nexport function parseSyncSelection(value: unknown): SyncSelection {\n const input = record(value, 'selection')\n if (Object.keys(input).some((key) => !['mode', 'nodes', 'workspaces', 'sessions'].includes(key))) {\n throw new Error('selection contains unsupported fields')\n }\n if (input.mode !== 'all' && input.mode !== 'selected') throw new Error('selection mode is invalid')\n const parseOrigins = (value: unknown, label: string): SyncOrigin[] => {\n if (value === undefined) return []\n if (!Array.isArray(value) || value.length > 10_000) throw new Error(`${label} must be an array of at most 10000 items`)\n const origins = value.map((item, index) => parseOrigin(item, `${label}[${index}]`))\n const keys = origins.map((origin) => JSON.stringify([origin.originInstanceId, origin.originEntityId]))\n if (new Set(keys).size !== keys.length) throw new Error(`${label} contains duplicate origins`)\n return origins\n }\n const nodes = parseOrigins(input.nodes, 'selection.nodes')\n const rawWorkspaces = input.workspaces\n if (rawWorkspaces !== undefined && (!Array.isArray(rawWorkspaces) || rawWorkspaces.length > 10_000)) {\n throw new Error('selection.workspaces must be an array of at most 10000 items')\n }\n const workspaces = (rawWorkspaces ?? []).map((value, index) => {\n const workspace = record(value, `selection.workspaces[${index}]`)\n if (Object.keys(workspace).some((key) => !['originInstanceId', 'originEntityId', 'remotePath'].includes(key)) ||\n typeof workspace.remotePath !== 'string' || workspace.remotePath.length > 4096 || !posix.isAbsolute(workspace.remotePath) ||\n posix.normalize(workspace.remotePath) !== workspace.remotePath) {\n throw new Error(`selection.workspaces[${index}] is invalid`)\n }\n const { remotePath, ...origin } = workspace\n return { ...parseOrigin(origin, `selection.workspaces[${index}]`), remotePath: remotePath as string }\n })\n const workspaceKeys = workspaces.map((workspace) => JSON.stringify([\n workspace.originInstanceId, workspace.originEntityId, workspace.remotePath,\n ]))\n if (new Set(workspaceKeys).size !== workspaceKeys.length) throw new Error('selection.workspaces contains duplicate origins')\n const sessions = parseOrigins(input.sessions, 'selection.sessions')\n if (input.mode === 'all' && (nodes.length > 0 || workspaces.length > 0 || sessions.length > 0)) {\n throw new Error('all selection cannot contain explicit origins')\n }\n return { mode: input.mode, nodes, workspaces, sessions }\n}\n\nexport function parseSyncPeer(value: unknown): SyncPeer {\n const input = record(value, 'sync peer')\n for (const key of Object.keys(input)) {\n if (!PEER_FIELDS.has(key)) throw new Error(`sync peer contains unsupported field: ${key}`)\n }\n\n const id = text(input.id, 'id', 128)\n if (!/^[a-z][a-z0-9-]*$/.test(id)) throw new Error('id is invalid')\n\n const name = text(input.name, 'name', 128)\n const host = text(input.host, 'host', 255)\n if (/\\s/.test(host)) throw new Error('host is invalid')\n\n const username = text(input.username, 'username', 128)\n if (/\\s/.test(username)) throw new Error('username is invalid')\n\n if (input.authKind !== 'password' && input.authKind !== 'key') {\n throw new Error('authKind must be password or key')\n }\n if (input.direction !== 'pull' && input.direction !== 'bidirectional') {\n throw new Error('direction must be pull or bidirectional')\n }\n if (input.schedule !== 'manual' && input.schedule !== 'every-5m') {\n throw new Error('schedule must be manual or every-5m')\n }\n if (input.mode !== undefined && input.mode !== 'full' && input.mode !== 'metadata') {\n throw new Error('mode must be full or metadata')\n }\n if (input.syncNodes !== undefined && typeof input.syncNodes !== 'boolean') {\n throw new Error('syncNodes must be a boolean')\n }\n if (typeof input.syncSessions !== 'boolean' || typeof input.enabled !== 'boolean') {\n throw new Error('syncSessions and enabled must be booleans')\n }\n\n const remoteDshHome = optionalText(input.remoteDshHome, 'remoteDshHome', 4096)\n if (remoteDshHome !== undefined) {\n if (!posix.isAbsolute(remoteDshHome) || remoteDshHome.split('/').includes('..') || remoteDshHome.includes('\\\\')) {\n throw new Error('remoteDshHome must be a normalized absolute path')\n }\n }\n\n const remoteProfile = optionalText(input.remoteProfile, 'remoteProfile', 256)\n const hostKeyFingerprint = optionalText(input.hostKeyFingerprint, 'hostKeyFingerprint', 512)\n\n return {\n id,\n name,\n host,\n port: port(input.port, 'port'),\n username,\n authKind: input.authKind,\n ...(remoteDshHome === undefined ? {} : { remoteDshHome: posix.normalize(remoteDshHome) }),\n ...(remoteProfile === undefined ? {} : { remoteProfile }),\n ...(input.remoteWebPort === undefined ? {} : { remoteWebPort: port(input.remoteWebPort, 'remoteWebPort') }),\n direction: input.direction,\n schedule: input.schedule,\n // 旧 peer 数据没有 mode 字段:缺省按全量同步处理,保持既有行为不变。\n mode: input.mode === undefined ? 'full' : input.mode,\n // 旧 peer 数据没有 syncNodes 字段:缺省同步工作节点配置。\n ...(input.syncNodes === undefined ? {} : { syncNodes: input.syncNodes }),\n syncSessions: input.syncSessions,\n ...(input.selection === undefined ? {} : { selection: parseSyncSelection(input.selection) }),\n enabled: input.enabled,\n ...(hostKeyFingerprint === undefined ? {} : { hostKeyFingerprint }),\n }\n}\n\nexport function parseSyncPeerDraft(value: unknown): SyncPeerDraft {\n const input = record(value, 'sync peer draft')\n for (const key of Object.keys(input)) {\n if (!PEER_DRAFT_FIELDS.has(key)) throw new Error(`sync peer draft contains unsupported field: ${key}`)\n }\n const { id, ...draft } = parseSyncPeer({ ...input, id: `p-${'0'.repeat(24)}` })\n void id\n return draft\n}\n\nexport function syncRecordKey(kind: SyncEntityKind, origin: SyncOrigin): string {\n return JSON.stringify([kind, origin.originInstanceId, origin.originEntityId])\n}\n\nexport function syncWorkspaceKey(originInstanceId: string, originWorkspaceId: string, remotePath: string): string {\n return JSON.stringify([originInstanceId, originWorkspaceId, remotePath])\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nexport function isNonNegativeSafeInteger(value: unknown): value is number {\n return Number.isSafeInteger(value) && (value as number) >= 0\n}\n"],"mappings":";;AA+KA,MAAM,8BAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;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AA,IAAY,CAAC,IAAI,EAAE,WAAW,MAAM,UAAU;EACtE,cAAc,MAAM;EACpB,GAAI,MAAM,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,WAAW,mBAAmB,MAAM,SAAS,EAAE;EAC1F,SAAS,MAAM;EACf,GAAI,uBAAuB,KAAA,IAAY,CAAC,IAAI,EAAE,mBAAmB;CACnE;AACF;AAEA,SAAgB,mBAAmB,OAA+B;CAChE,MAAM,QAAQ,OAAO,OAAO,iBAAiB;CAC7C,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GACjC,IAAI,CAAC,kBAAkB,IAAI,GAAG,GAAG,MAAM,IAAI,MAAM,+CAA+C,KAAK;CAEvG,MAAM,EAAE,IAAI,GAAG,UAAU,cAAc;EAAE,GAAG;EAAO,IAAI,KAAK,IAAI,OAAO,EAAE;CAAI,CAAC;CAE9E,OAAO;AACT;AAEA,SAAgB,cAAc,MAAsB,QAA4B;CAC9E,OAAO,KAAK,UAAU;EAAC;EAAM,OAAO;EAAkB,OAAO;CAAc,CAAC;AAC9E;AAEA,SAAgB,iBAAiB,kBAA0B,mBAA2B,YAA4B;CAChH,OAAO,KAAK,UAAU;EAAC;EAAkB;EAAmB;CAAU,CAAC;AACzE;AAEA,SAAgB,SAAS,OAAkD;CACzE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAgB,yBAAyB,OAAiC;CACxE,OAAO,OAAO,cAAc,KAAK,KAAM,SAAoB;AAC7D"}
1
+ {"version":3,"file":"model.js","names":[],"sources":["../../../src/core/sync/model.ts"],"sourcesContent":["import { posix } from 'node:path'\nimport type { SyncRevision } from './revision.js'\n\nexport type SyncDirection = 'pull' | 'bidirectional'\nexport type SyncSchedule = 'manual' | 'every-5m'\nexport type SyncEntityKind = 'node' | 'session'\nexport type SyncImportMethod = 'peer' | 'offline'\n/** 全量同步传输会话内容;元数据同步只同步目录,点击会话时经 wss 实时操作远端。 */\nexport type SyncMode = 'full' | 'metadata'\n\nexport interface SyncOrigin {\n originInstanceId: string\n originEntityId: string\n}\n\nexport interface SyncPeer {\n id: string\n name: string\n host: string\n port: number\n username: string\n authKind: 'password' | 'key'\n remoteDshHome?: string\n remoteProfile?: string\n remoteWebPort?: number\n /** 已取消的方向逻辑;读取旧数据时恒为 'bidirectional'。 */\n direction: SyncDirection\n /** 已取消的时机逻辑;读取旧数据时恒为 'manual'(同步仅由「立即同步」触发)。 */\n schedule: SyncSchedule\n mode: SyncMode\n /** 已废弃:工作节点配置恒同步;字段仅为兼容旧持久化数据保留。 */\n syncNodes?: boolean\n syncSessions: boolean\n selection?: SyncSelection\n enabled: boolean\n hostKeyFingerprint?: string\n}\n\nexport interface SyncWorkspaceOrigin extends SyncOrigin {\n remotePath: string\n}\n\nexport interface SyncSelection {\n mode: 'all' | 'selected'\n nodes: SyncOrigin[]\n workspaces: SyncWorkspaceOrigin[]\n sessions: SyncOrigin[]\n}\n\nexport interface SyncCatalogNode {\n origin: SyncOrigin\n name: string\n type: 'remote-ssh' | 'remote-docker'\n}\n\nexport interface SyncCatalogWorkspace {\n origin: SyncOrigin\n nodeOrigin: SyncOrigin\n remotePath: string\n title: string\n}\n\nexport interface SyncCatalogSession {\n origin: SyncOrigin\n workspaceOrigin?: SyncOrigin\n workspaceRemotePath?: string\n nodeOrigin?: SyncOrigin\n sessionId: string\n title?: string\n sizeBytes?: number\n branchId?: string\n deleted?: boolean\n}\n\nexport interface SyncCatalog {\n protocolVersion: 1\n instanceId: string\n nodes: SyncCatalogNode[]\n workspaces: SyncCatalogWorkspace[]\n sessions: SyncCatalogSession[]\n}\n\nexport interface SyncPeer {\n id: string\n name: string\n host: string\n port: number\n username: string\n authKind: 'password' | 'key'\n remoteDshHome?: string\n remoteProfile?: string\n remoteWebPort?: number\n direction: SyncDirection\n schedule: SyncSchedule\n syncSessions: boolean\n selection?: SyncSelection\n enabled: boolean\n hostKeyFingerprint?: string\n}\n\nexport type SyncPeerDraft = Omit<SyncPeer, 'id' | 'hostKeyFingerprint'>\n\nexport interface SyncProvenance extends SyncOrigin {\n localEntityId: string\n importedVia?: SyncImportMethod\n sourceName?: string\n}\n\nexport interface SyncRecordMetadata extends SyncProvenance {\n kind: SyncEntityKind\n revision: SyncRevision\n contentDigest: string\n stateDigest?: string\n workspaceOrigin?: SyncOrigin\n deleted?: boolean\n pendingRemoval?: boolean\n credentialsRequired?: boolean\n}\n\nexport interface SyncPeerProgress {\n lastRunAt?: string\n lastRunStatus?: 'running' | 'succeeded' | 'failed' | 'stopped'\n lastSuccessAt?: string\n lastManifestDigest?: string\n watermark?: string\n lastErrorCode?: string\n lastErrorMessage?: string\n lastResult?: {\n imported: number\n exported: number\n skipped: number\n pendingRemoval: number\n importedSessions: number\n exportedSessions: number\n skippedSessions: number\n /** 元数据同步最近一次目录计数(可选,旧状态缺省)。 */\n catalogNodes?: number\n catalogWorkspaces?: number\n catalogSessions?: number\n }\n}\n\nexport interface SyncWorkspaceMapping {\n originInstanceId: string\n originWorkspaceId: string\n localWorkspaceId: string\n localPath: string\n localNodeId: string\n remotePath: string\n title: string\n revision: SyncRevision\n contentDigest: string\n}\n\nexport interface SyncSessionArchive {\n branchId: string\n originInstanceId: string\n originSessionId: string\n localSessionId: string\n revision: SyncRevision\n contentDigest: string\n stateDigest: string\n workspacePosition: number\n workspaceId?: string\n workspaceOrigin?: SyncOrigin\n archivedAt: string\n}\n\nexport interface SyncState {\n version: 1\n clock: { physicalTimeMs: number; logicalCounter: number }\n peers: Record<string, SyncPeerProgress>\n records: Record<string, SyncRecordMetadata>\n workspaces: Record<string, SyncWorkspaceMapping>\n archives: Record<string, SyncSessionArchive>\n}\n\nconst PEER_FIELDS = new Set([\n 'id',\n 'name',\n 'host',\n 'port',\n 'username',\n 'authKind',\n 'remoteDshHome',\n 'remoteProfile',\n 'remoteWebPort',\n 'direction',\n 'schedule',\n 'mode',\n 'syncNodes',\n 'syncSessions',\n 'selection',\n 'enabled',\n 'hostKeyFingerprint',\n])\n\nconst PEER_DRAFT_FIELDS = new Set([...PEER_FIELDS].filter((field) => field !== 'id' && field !== 'hostKeyFingerprint'))\n\nfunction record(value: unknown, label: string): Record<string, unknown> {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) {\n throw new Error(`${label} must be an object`)\n }\n return value as Record<string, unknown>\n}\n\nfunction text(value: unknown, label: string, maxLength: number): string {\n if (typeof value !== 'string') throw new Error(`${label} must be a string`)\n const result = value.trim()\n if (!result || result.length > maxLength || /[\\u0000-\\u001f\\u007f]/.test(result)) {\n throw new Error(`${label} is invalid`)\n }\n return result\n}\n\nfunction optionalText(value: unknown, label: string, maxLength: number): string | undefined {\n return value === undefined ? undefined : text(value, label, maxLength)\n}\n\nfunction port(value: unknown, label: string): number {\n if (!Number.isSafeInteger(value) || (value as number) < 1 || (value as number) > 65535) {\n throw new Error(`${label} must be an integer between 1 and 65535`)\n }\n return value as number\n}\n\nfunction parseOrigin(value: unknown, label: string): SyncOrigin {\n const input = record(value, label)\n if (Object.keys(input).some((key) => key !== 'originInstanceId' && key !== 'originEntityId')) {\n throw new Error(`${label} contains unsupported fields`)\n }\n return {\n originInstanceId: text(input.originInstanceId, `${label}.originInstanceId`, 512),\n originEntityId: text(input.originEntityId, `${label}.originEntityId`, 512),\n }\n}\n\nexport function parseSyncSelection(value: unknown): SyncSelection {\n const input = record(value, 'selection')\n if (Object.keys(input).some((key) => !['mode', 'nodes', 'workspaces', 'sessions'].includes(key))) {\n throw new Error('selection contains unsupported fields')\n }\n if (input.mode !== 'all' && input.mode !== 'selected') throw new Error('selection mode is invalid')\n const parseOrigins = (value: unknown, label: string): SyncOrigin[] => {\n if (value === undefined) return []\n if (!Array.isArray(value) || value.length > 10_000) throw new Error(`${label} must be an array of at most 10000 items`)\n const origins = value.map((item, index) => parseOrigin(item, `${label}[${index}]`))\n const keys = origins.map((origin) => JSON.stringify([origin.originInstanceId, origin.originEntityId]))\n if (new Set(keys).size !== keys.length) throw new Error(`${label} contains duplicate origins`)\n return origins\n }\n const nodes = parseOrigins(input.nodes, 'selection.nodes')\n const rawWorkspaces = input.workspaces\n if (rawWorkspaces !== undefined && (!Array.isArray(rawWorkspaces) || rawWorkspaces.length > 10_000)) {\n throw new Error('selection.workspaces must be an array of at most 10000 items')\n }\n const workspaces = (rawWorkspaces ?? []).map((value, index) => {\n const workspace = record(value, `selection.workspaces[${index}]`)\n if (Object.keys(workspace).some((key) => !['originInstanceId', 'originEntityId', 'remotePath'].includes(key)) ||\n typeof workspace.remotePath !== 'string' || workspace.remotePath.length > 4096 || !posix.isAbsolute(workspace.remotePath) ||\n posix.normalize(workspace.remotePath) !== workspace.remotePath) {\n throw new Error(`selection.workspaces[${index}] is invalid`)\n }\n const { remotePath, ...origin } = workspace\n return { ...parseOrigin(origin, `selection.workspaces[${index}]`), remotePath: remotePath as string }\n })\n const workspaceKeys = workspaces.map((workspace) => JSON.stringify([\n workspace.originInstanceId, workspace.originEntityId, workspace.remotePath,\n ]))\n if (new Set(workspaceKeys).size !== workspaceKeys.length) throw new Error('selection.workspaces contains duplicate origins')\n const sessions = parseOrigins(input.sessions, 'selection.sessions')\n if (input.mode === 'all' && (nodes.length > 0 || workspaces.length > 0 || sessions.length > 0)) {\n throw new Error('all selection cannot contain explicit origins')\n }\n return { mode: input.mode, nodes, workspaces, sessions }\n}\n\nexport function parseSyncPeer(value: unknown): SyncPeer {\n const input = record(value, 'sync peer')\n for (const key of Object.keys(input)) {\n if (!PEER_FIELDS.has(key)) throw new Error(`sync peer contains unsupported field: ${key}`)\n }\n\n const id = text(input.id, 'id', 128)\n if (!/^[a-z][a-z0-9-]*$/.test(id)) throw new Error('id is invalid')\n\n const name = text(input.name, 'name', 128)\n const host = text(input.host, 'host', 255)\n if (/\\s/.test(host)) throw new Error('host is invalid')\n\n const username = text(input.username, 'username', 128)\n if (/\\s/.test(username)) throw new Error('username is invalid')\n\n if (input.authKind !== 'password' && input.authKind !== 'key') {\n throw new Error('authKind must be password or key')\n }\n // direction/schedule/syncNodes 旧字段仅用于读取旧数据不报错;值一律忽略——\n // 方向与时机逻辑已取消(同步恒为手动触发 + 双向交换),工作节点配置恒同步。\n if (input.direction !== undefined && input.direction !== 'pull' && input.direction !== 'bidirectional') {\n throw new Error('direction must be pull or bidirectional')\n }\n if (input.schedule !== undefined && input.schedule !== 'manual' && input.schedule !== 'every-5m') {\n throw new Error('schedule must be manual or every-5m')\n }\n if (input.mode !== undefined && input.mode !== 'full' && input.mode !== 'metadata') {\n throw new Error('mode must be full or metadata')\n }\n if (input.syncNodes !== undefined && typeof input.syncNodes !== 'boolean') {\n throw new Error('syncNodes must be a boolean')\n }\n if (typeof input.syncSessions !== 'boolean' || typeof input.enabled !== 'boolean') {\n throw new Error('syncSessions and enabled must be booleans')\n }\n\n const remoteDshHome = optionalText(input.remoteDshHome, 'remoteDshHome', 4096)\n if (remoteDshHome !== undefined) {\n if (!posix.isAbsolute(remoteDshHome) || remoteDshHome.split('/').includes('..') || remoteDshHome.includes('\\\\')) {\n throw new Error('remoteDshHome must be a normalized absolute path')\n }\n }\n\n const remoteProfile = optionalText(input.remoteProfile, 'remoteProfile', 256)\n const hostKeyFingerprint = optionalText(input.hostKeyFingerprint, 'hostKeyFingerprint', 512)\n\n return {\n id,\n name,\n host,\n port: port(input.port, 'port'),\n username,\n authKind: input.authKind,\n ...(remoteDshHome === undefined ? {} : { remoteDshHome: posix.normalize(remoteDshHome) }),\n ...(remoteProfile === undefined ? {} : { remoteProfile }),\n ...(input.remoteWebPort === undefined ? {} : { remoteWebPort: port(input.remoteWebPort, 'remoteWebPort') }),\n // 方向与时机逻辑已取消:读取旧数据时一律归一为双向交换 + 手动触发。\n direction: 'bidirectional',\n schedule: 'manual',\n // 旧 peer 数据没有 mode 字段:缺省按全量同步处理,保持既有行为不变。\n mode: input.mode === undefined ? 'full' : input.mode,\n syncSessions: input.syncSessions,\n ...(input.selection === undefined ? {} : { selection: parseSyncSelection(input.selection) }),\n enabled: input.enabled,\n ...(hostKeyFingerprint === undefined ? {} : { hostKeyFingerprint }),\n }\n}\n\nexport function parseSyncPeerDraft(value: unknown): SyncPeerDraft {\n const input = record(value, 'sync peer draft')\n for (const key of Object.keys(input)) {\n if (!PEER_DRAFT_FIELDS.has(key)) throw new Error(`sync peer draft contains unsupported field: ${key}`)\n }\n const { id, ...draft } = parseSyncPeer({ ...input, id: `p-${'0'.repeat(24)}` })\n void id\n return draft\n}\n\nexport function syncRecordKey(kind: SyncEntityKind, origin: SyncOrigin): string {\n return JSON.stringify([kind, origin.originInstanceId, origin.originEntityId])\n}\n\nexport function syncWorkspaceKey(originInstanceId: string, originWorkspaceId: string, remotePath: string): string {\n return JSON.stringify([originInstanceId, originWorkspaceId, remotePath])\n}\n\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nexport function isNonNegativeSafeInteger(value: unknown): value is number {\n return Number.isSafeInteger(value) && (value as number) >= 0\n}\n"],"mappings":";;AAiLA,MAAM,8BAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,oBAAoB,IAAI,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,QAAQ,UAAU,UAAU,QAAQ,UAAU,oBAAoB,CAAC;AAEtH,SAAS,OAAO,OAAgB,OAAwC;CACtE,IAAI,UAAU,QAAQ,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GACpE,MAAM,IAAI,MAAM,GAAG,MAAM,mBAAmB;CAE9C,OAAO;AACT;AAEA,SAAS,KAAK,OAAgB,OAAe,WAA2B;CACtE,IAAI,OAAO,UAAU,UAAU,MAAM,IAAI,MAAM,GAAG,MAAM,kBAAkB;CAC1E,MAAM,SAAS,MAAM,KAAK;CAC1B,IAAI,CAAC,UAAU,OAAO,SAAS,aAAa,wBAAwB,KAAK,MAAM,GAC7E,MAAM,IAAI,MAAM,GAAG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MAAsB,QAA4B;CAC9E,OAAO,KAAK,UAAU;EAAC;EAAM,OAAO;EAAkB,OAAO;CAAc,CAAC;AAC9E;AAEA,SAAgB,iBAAiB,kBAA0B,mBAA2B,YAA4B;CAChH,OAAO,KAAK,UAAU;EAAC;EAAkB;EAAmB;CAAU,CAAC;AACzE;AAEA,SAAgB,SAAS,OAAkD;CACzE,OAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAgB,yBAAyB,OAAiC;CACxE,OAAO,OAAO,cAAc,KAAK,KAAM,SAAoB;AAC7D"}
@@ -1,2 +1,2 @@
1
- import { a as SyncNodeManifestError, c as SyncNodeView, i as SyncNodeManifest, n as SyncNodeEntry, o as SyncNodeProfile, r as SyncNodeInUseError, s as SyncNodeService, t as SyncNodeApplyResult } from "../../node-sync-CJZl2FCE.js";
1
+ import { a as SyncNodeManifestError, c as SyncNodeView, i as SyncNodeManifest, n as SyncNodeEntry, o as SyncNodeProfile, r as SyncNodeInUseError, s as SyncNodeService, t as SyncNodeApplyResult } from "../../node-sync-DwB1OJyx.js";
2
2
  export { SyncNodeApplyResult, SyncNodeEntry, SyncNodeInUseError, SyncNodeManifest, SyncNodeManifestError, SyncNodeProfile, SyncNodeService, SyncNodeView };
@@ -1,7 +1,7 @@
1
- import { g as SyncSelection, t as SyncCatalog } from "../../model-qtM3rcyA.js";
2
- import { n as SyncStateStore } from "../../stores-NzEbaGQ3.js";
3
- import { s as SyncNodeService } from "../../node-sync-CJZl2FCE.js";
4
- import { h as SyncSessionService } from "../../session-sync-Celc4x_B.js";
1
+ import { g as SyncSelection, t as SyncCatalog } from "../../model-CYwA2ha_.js";
2
+ import { n as SyncStateStore } from "../../stores-Cxjt9l2a.js";
3
+ import { s as SyncNodeService } from "../../node-sync-DwB1OJyx.js";
4
+ import { h as SyncSessionService } from "../../session-sync-DL25qi0e.js";
5
5
  //#region src/core/sync/offline-archive.d.ts
6
6
  declare const MAX_OFFLINE_ARCHIVE_BYTES: number;
7
7
  declare class SyncOfflineArchiveError extends Error {
@@ -1,5 +1,5 @@
1
- import { f as SyncPeerProgress, u as SyncPeer } from "../../model-qtM3rcyA.js";
2
- import { n as SyncStateStore, t as SyncPeerStore } from "../../stores-NzEbaGQ3.js";
1
+ import { f as SyncPeerProgress, u as SyncPeer } from "../../model-CYwA2ha_.js";
2
+ import { n as SyncStateStore, t as SyncPeerStore } from "../../stores-Cxjt9l2a.js";
3
3
  import { CredentialKey } from "@deepseek-ai/dsh-credentials";
4
4
  //#region src/core/sync/peer-manager.d.ts
5
5
  interface SyncPeerSecrets {
@@ -1,5 +1,5 @@
1
1
  import { SyncPeerManager } from "./peer-manager.js";
2
- import { m as SyncSshTransport } from "../../ssh-transport-DLXkPpxT.js";
2
+ import { m as SyncSshTransport } from "../../ssh-transport-D5X4YKg7.js";
3
3
  import { SyncCoordinator } from "./coordinator.js";
4
4
  import { Context } from "@deepseek-ai/cordis";
5
5
  //#region src/core/sync/routes.d.ts
@@ -1,2 +1,2 @@
1
- import { t as SyncSessionJournalStore } from "../../session-journal-BwrCnkk4.js";
1
+ import { t as SyncSessionJournalStore } from "../../session-journal-D5Z-Fpy0.js";
2
2
  export { SyncSessionJournalStore };
@@ -1,4 +1,4 @@
1
- import { h as SyncSessionService } from "../../session-sync-Celc4x_B.js";
1
+ import { h as SyncSessionService } from "../../session-sync-DL25qi0e.js";
2
2
  import { Context } from "@deepseek-ai/cordis";
3
3
  //#region src/core/sync/session-routes.d.ts
4
4
  declare function registerSyncSessionRoutes(ctx: Context, sessions: SyncSessionService): void;
@@ -1,2 +1,2 @@
1
- import { C as sessionEventListDigest, D as validateSyncSessionManifest, E as validateSyncSessionBundle, S as planSessionTransfers, T as validateObjectPayload, _ as SyncSessionWorkspace, a as SyncSessionBundle, b as makeSyncSessionBundle, c as SyncSessionEventDelta, d as SyncSessionManifest, f as SyncSessionManifestEntry, g as SyncSessionTransferPlan, h as SyncSessionService, i as SyncSessionApplyResult, l as SyncSessionEventPrefix, m as SyncSessionObjectInbox, n as SyncObjectInboxWriter, o as SyncSessionEntry, p as SyncSessionObject, r as SyncSessionApplyOptions, s as SyncSessionError, t as ExportObjectCache, u as SyncSessionInstructionSnapshot, v as WorkspaceRegistryLike, w as syncSessionEntryKey, x as makeSyncSessionManifest, y as estimateJsonBytes } from "../../session-sync-Celc4x_B.js";
1
+ import { C as sessionEventListDigest, D as validateSyncSessionManifest, E as validateSyncSessionBundle, S as planSessionTransfers, T as validateObjectPayload, _ as SyncSessionWorkspace, a as SyncSessionBundle, b as makeSyncSessionBundle, c as SyncSessionEventDelta, d as SyncSessionManifest, f as SyncSessionManifestEntry, g as SyncSessionTransferPlan, h as SyncSessionService, i as SyncSessionApplyResult, l as SyncSessionEventPrefix, m as SyncSessionObjectInbox, n as SyncObjectInboxWriter, o as SyncSessionEntry, p as SyncSessionObject, r as SyncSessionApplyOptions, s as SyncSessionError, t as ExportObjectCache, u as SyncSessionInstructionSnapshot, v as WorkspaceRegistryLike, w as syncSessionEntryKey, x as makeSyncSessionManifest, y as estimateJsonBytes } from "../../session-sync-DL25qi0e.js";
2
2
  export { ExportObjectCache, SyncObjectInboxWriter, SyncSessionApplyOptions, SyncSessionApplyResult, SyncSessionBundle, SyncSessionEntry, SyncSessionError, SyncSessionEventDelta, SyncSessionEventPrefix, SyncSessionInstructionSnapshot, SyncSessionManifest, SyncSessionManifestEntry, SyncSessionObject, SyncSessionObjectInbox, SyncSessionService, SyncSessionTransferPlan, SyncSessionWorkspace, WorkspaceRegistryLike, estimateJsonBytes, makeSyncSessionBundle, makeSyncSessionManifest, planSessionTransfers, sessionEventListDigest, syncSessionEntryKey, validateObjectPayload, validateSyncSessionBundle, validateSyncSessionManifest };
@@ -1,2 +1,2 @@
1
- import { _ as parseRemoteProbeOutput, a as SyncRemoteProbe, c as SyncRemoteProbeProfile, d as SyncSshErrorCategory, f as SyncSshProbeError, g as buildSyncSshConnectConfig, h as buildRemoteProbeScript, i as SyncRemoteNodeManifest, l as SyncRemoteProbeResult, m as SyncSshTransport, n as REMOTE_PROBE_END_MARKER, o as SyncRemoteProbeDraft, p as SyncSshSession, r as SyncRemoteHandshake, s as SyncRemoteProbeHandshake, t as REMOTE_PROBE_BEGIN_MARKER, u as SyncSessionDeltaPrefixError } from "../../ssh-transport-DLXkPpxT.js";
1
+ import { _ as parseRemoteProbeOutput, a as SyncRemoteProbe, c as SyncRemoteProbeProfile, d as SyncSshErrorCategory, f as SyncSshProbeError, g as buildSyncSshConnectConfig, h as buildRemoteProbeScript, i as SyncRemoteNodeManifest, l as SyncRemoteProbeResult, m as SyncSshTransport, n as REMOTE_PROBE_END_MARKER, o as SyncRemoteProbeDraft, p as SyncSshSession, r as SyncRemoteHandshake, s as SyncRemoteProbeHandshake, t as REMOTE_PROBE_BEGIN_MARKER, u as SyncSessionDeltaPrefixError } from "../../ssh-transport-D5X4YKg7.js";
2
2
  export { REMOTE_PROBE_BEGIN_MARKER, REMOTE_PROBE_END_MARKER, SyncRemoteHandshake, SyncRemoteNodeManifest, SyncRemoteProbe, SyncRemoteProbeDraft, SyncRemoteProbeHandshake, SyncRemoteProbeProfile, SyncRemoteProbeResult, SyncSessionDeltaPrefixError, SyncSshErrorCategory, SyncSshProbeError, SyncSshSession, SyncSshTransport, buildRemoteProbeScript, buildSyncSshConnectConfig, parseRemoteProbeOutput };
@@ -1,3 +1,3 @@
1
1
  import { t as HlcSnapshot } from "../../revision-C9sOlDZ6.js";
2
- import { n as SyncStateStore, r as getOrCreateSyncInstanceId, t as SyncPeerStore } from "../../stores-NzEbaGQ3.js";
2
+ import { n as SyncStateStore, r as getOrCreateSyncInstanceId, t as SyncPeerStore } from "../../stores-Cxjt9l2a.js";
3
3
  export { type HlcSnapshot, SyncPeerStore, SyncStateStore, getOrCreateSyncInstanceId };
@@ -1,6 +1,6 @@
1
1
  import { o as NodeRegistry } from "../node-registry-BTnnM5-k.js";
2
2
  import { r as WorkspaceBindingsStore } from "../workspace-bindings-CsB0TIJB.js";
3
- import { s as SyncNodeService } from "../node-sync-CJZl2FCE.js";
3
+ import { s as SyncNodeService } from "../node-sync-DwB1OJyx.js";
4
4
  import { Context } from "@deepseek-ai/cordis";
5
5
  //#region src/core/workspaces.d.ts
6
6
  declare function registerWorkspaceRoutes(ctx: Context, registry: NodeRegistry, bindings: WorkspaceBindingsStore, syncNodes?: SyncNodeService): void;
@@ -1,4 +1,4 @@
1
- import { u as SyncPeer } from "./model-qtM3rcyA.js";
1
+ import { u as SyncPeer } from "./model-CYwA2ha_.js";
2
2
  //#region src/core/sync/host-key.d.ts
3
3
  type SyncHostKeyDecision = 'trusted' | 'untrusted' | 'changed';
4
4
  declare class SyncHostKeyChallengeError extends Error {
@@ -27,4 +27,4 @@ declare class SyncHostKeyChallenges {
27
27
  }
28
28
  //#endregion
29
29
  export { inspectSyncHostKey as a, SyncHostKeyDecision as i, SyncHostKeyChallengeExpiredError as n, isOpenSshFingerprint as o, SyncHostKeyChallenges as r, opensshFingerprintFromSha256Hex as s, SyncHostKeyChallengeError as t };
30
- //# sourceMappingURL=host-key-DeHqgO7s.d.ts.map
30
+ //# sourceMappingURL=host-key-ahUa0x1Z.d.ts.map
@@ -20,10 +20,12 @@ interface SyncPeer {
20
20
  remoteDshHome?: string;
21
21
  remoteProfile?: string;
22
22
  remoteWebPort?: number;
23
+ /** 已取消的方向逻辑;读取旧数据时恒为 'bidirectional'。 */
23
24
  direction: SyncDirection;
25
+ /** 已取消的时机逻辑;读取旧数据时恒为 'manual'(同步仅由「立即同步」触发)。 */
24
26
  schedule: SyncSchedule;
25
27
  mode: SyncMode;
26
- /** 同步工作节点配置;仅元数据同步可关闭(全量会话同步依赖节点配置)。缺省 true。 */
28
+ /** 已废弃:工作节点配置恒同步;字段仅为兼容旧持久化数据保留。 */
27
29
  syncNodes?: boolean;
28
30
  syncSessions: boolean;
29
31
  selection?: SyncSelection;
@@ -167,4 +169,4 @@ declare function isRecord(value: unknown): value is Record<string, unknown>;
167
169
  declare function isNonNegativeSafeInteger(value: unknown): value is number;
168
170
  //#endregion
169
171
  export { parseSyncPeer as C, syncWorkspaceKey as D, syncRecordKey as E, isRecord as S, parseSyncSelection as T, SyncSessionArchive as _, SyncDirection as a, SyncWorkspaceOrigin as b, SyncMode as c, SyncPeerDraft as d, SyncPeerProgress as f, SyncSelection as g, SyncSchedule as h, SyncCatalogWorkspace as i, SyncOrigin as l, SyncRecordMetadata as m, SyncCatalogNode as n, SyncEntityKind as o, SyncProvenance as p, SyncCatalogSession as r, SyncImportMethod as s, SyncCatalog as t, SyncPeer as u, SyncState as v, parseSyncPeerDraft as w, isNonNegativeSafeInteger as x, SyncWorkspaceMapping as y };
170
- //# sourceMappingURL=model-qtM3rcyA.d.ts.map
172
+ //# sourceMappingURL=model-CYwA2ha_.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { c as NodeSsh, o as NodeRegistry, r as NodeDocker, s as NodeSecrets } from "./node-registry-BTnnM5-k.js";
2
2
  import { r as WorkspaceBindingsStore } from "./workspace-bindings-CsB0TIJB.js";
3
- import { m as SyncRecordMetadata, s as SyncImportMethod } from "./model-qtM3rcyA.js";
4
- import { n as SyncStateStore } from "./stores-NzEbaGQ3.js";
3
+ import { m as SyncRecordMetadata, s as SyncImportMethod } from "./model-CYwA2ha_.js";
4
+ import { n as SyncStateStore } from "./stores-Cxjt9l2a.js";
5
5
  //#region src/core/sync/node-sync.d.ts
6
6
  interface SyncNodeProfile {
7
7
  name: string;
@@ -86,4 +86,4 @@ declare class SyncNodeService {
86
86
  }
87
87
  //#endregion
88
88
  export { SyncNodeManifestError as a, SyncNodeView as c, SyncNodeManifest as i, SyncNodeEntry as n, SyncNodeProfile as o, SyncNodeInUseError as r, SyncNodeService as s, SyncNodeApplyResult as t };
89
- //# sourceMappingURL=node-sync-CJZl2FCE.d.ts.map
89
+ //# sourceMappingURL=node-sync-DwB1OJyx.d.ts.map
@@ -1,4 +1,4 @@
1
- import { s as SyncImportMethod } from "./model-qtM3rcyA.js";
1
+ import { s as SyncImportMethod } from "./model-CYwA2ha_.js";
2
2
  //#region src/core/sync/session-journal.d.ts
3
3
  declare class SyncSessionJournalStore {
4
4
  private readonly home;
@@ -45,4 +45,4 @@ declare class SyncSessionJournalStore {
45
45
  }
46
46
  //#endregion
47
47
  export { SyncSessionJournalStore as t };
48
- //# sourceMappingURL=session-journal-BwrCnkk4.d.ts.map
48
+ //# sourceMappingURL=session-journal-D5Z-Fpy0.d.ts.map
@@ -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 { _ as SyncSessionArchive, i as SyncCatalogWorkspace, l as SyncOrigin, m as SyncRecordMetadata, r as SyncCatalogSession, s as SyncImportMethod } from "./model-qtM3rcyA.js";
5
- import { n as SyncStateStore } from "./stores-NzEbaGQ3.js";
6
- import { s as SyncNodeService } from "./node-sync-CJZl2FCE.js";
4
+ import { _ as SyncSessionArchive, i as SyncCatalogWorkspace, l as SyncOrigin, m as SyncRecordMetadata, r as SyncCatalogSession, s as SyncImportMethod } from "./model-CYwA2ha_.js";
5
+ import { n as SyncStateStore } from "./stores-Cxjt9l2a.js";
6
+ import { s as SyncNodeService } from "./node-sync-DwB1OJyx.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-BwrCnkk4.js";
9
+ import { t as SyncSessionJournalStore } from "./session-journal-D5Z-Fpy0.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;
@@ -1377,4 +1377,4 @@ declare class SyncSessionService {
1377
1377
  }
1378
1378
  //#endregion
1379
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 };
1380
- //# sourceMappingURL=session-sync-Celc4x_B.d.ts.map
1380
+ //# sourceMappingURL=session-sync-DL25qi0e.d.ts.map
@@ -1,9 +1,9 @@
1
- import { t as SyncCatalog, u as SyncPeer } from "./model-qtM3rcyA.js";
2
- import { i as SyncNodeManifest, t as SyncNodeApplyResult } from "./node-sync-CJZl2FCE.js";
1
+ import { t as SyncCatalog, u as SyncPeer } from "./model-CYwA2ha_.js";
2
+ import { i as SyncNodeManifest, t as SyncNodeApplyResult } from "./node-sync-DwB1OJyx.js";
3
3
  import { SyncPeerManager, SyncPeerSecrets } from "./core/sync/peer-manager.js";
4
- import { r as SyncHostKeyChallenges, t as SyncHostKeyChallengeError } from "./host-key-DeHqgO7s.js";
4
+ import { r as SyncHostKeyChallenges, t as SyncHostKeyChallengeError } from "./host-key-ahUa0x1Z.js";
5
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-Celc4x_B.js";
6
+ import { a as SyncSessionBundle, d as SyncSessionManifest, i as SyncSessionApplyResult, l as SyncSessionEventPrefix, p as SyncSessionObject } from "./session-sync-DL25qi0e.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';
@@ -138,4 +138,4 @@ declare class SyncRemoteProbe {
138
138
  }
139
139
  //#endregion
140
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 };
141
- //# sourceMappingURL=ssh-transport-DLXkPpxT.d.ts.map
141
+ //# sourceMappingURL=ssh-transport-D5X4YKg7.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { r as SyncRevision } from "./revision-C9sOlDZ6.js";
2
- import { d as SyncPeerDraft, u as SyncPeer, v as SyncState } from "./model-qtM3rcyA.js";
2
+ import { d as SyncPeerDraft, u as SyncPeer, v as SyncState } from "./model-CYwA2ha_.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-NzEbaGQ3.d.ts.map
31
+ //# sourceMappingURL=stores-Cxjt9l2a.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artenx/dshb",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "description": "让 DSH 变成随时可用的多设备 Agent 工作台,支持将远程节点添加到本地 DSH,并像操作本地内容一样访问远程节点,包括会话环境、文件目录、终端等。支持在安装了本插件的多个 DSH 实例间同步数据。若部署在云服务器,Web 端访问支持登录认证。真正实现远程节点本地化操作。最新版本已支持 DSH 桌面端。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",