@artenx/dshb 0.1.18 → 0.1.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/lib/client.js +2157 -567
- package/lib/client.js.map +1 -1
- package/lib/core/index.js +72 -4
- package/lib/core/index.js.map +1 -1
- package/lib/core/node-registry.d.ts +2 -108
- package/lib/core/node-registry.js +43 -2
- package/lib/core/node-registry.js.map +1 -1
- package/lib/core/routes.d.ts +4 -3
- package/lib/core/routes.js +67 -23
- package/lib/core/routes.js.map +1 -1
- package/lib/core/sync/coordinator.d.ts +48 -0
- package/lib/core/sync/coordinator.js +247 -0
- package/lib/core/sync/coordinator.js.map +1 -0
- package/lib/core/sync/host-key.d.ts +2 -0
- package/lib/core/sync/host-key.js +71 -0
- package/lib/core/sync/host-key.js.map +1 -0
- package/lib/core/sync/internal-routes.d.ts +9 -0
- package/lib/core/sync/internal-routes.js +236 -0
- package/lib/core/sync/internal-routes.js.map +1 -0
- package/lib/core/sync/model.d.ts +2 -0
- package/lib/core/sync/model.js +106 -0
- package/lib/core/sync/model.js.map +1 -0
- package/lib/core/sync/node-sync.d.ts +2 -0
- package/lib/core/sync/node-sync.js +660 -0
- package/lib/core/sync/node-sync.js.map +1 -0
- package/lib/core/sync/offline-archive.d.ts +55 -0
- package/lib/core/sync/offline-archive.js +673 -0
- package/lib/core/sync/offline-archive.js.map +1 -0
- package/lib/core/sync/offline-journal.d.ts +22 -0
- package/lib/core/sync/offline-journal.js +74 -0
- package/lib/core/sync/offline-journal.js.map +1 -0
- package/lib/core/sync/offline-routes.d.ts +7 -0
- package/lib/core/sync/offline-routes.js +192 -0
- package/lib/core/sync/offline-routes.js.map +1 -0
- package/lib/core/sync/peer-manager.d.ts +56 -0
- package/lib/core/sync/peer-manager.js +258 -0
- package/lib/core/sync/peer-manager.js.map +1 -0
- package/lib/core/sync/protocol.d.ts +2 -0
- package/lib/core/sync/protocol.js +124 -0
- package/lib/core/sync/protocol.js.map +1 -0
- package/lib/core/sync/remote-helper.d.ts +5 -0
- package/lib/core/sync/remote-helper.js +160 -0
- package/lib/core/sync/remote-helper.js.map +1 -0
- package/lib/core/sync/revision.d.ts +2 -0
- package/lib/core/sync/revision.js +77 -0
- package/lib/core/sync/revision.js.map +1 -0
- package/lib/core/sync/routes.d.ts +9 -0
- package/lib/core/sync/routes.js +339 -0
- package/lib/core/sync/routes.js.map +1 -0
- package/lib/core/sync/scheduler.d.ts +14 -0
- package/lib/core/sync/scheduler.js +81 -0
- package/lib/core/sync/scheduler.js.map +1 -0
- package/lib/core/sync/session-journal.d.ts +2 -0
- package/lib/core/sync/session-journal.js +191 -0
- package/lib/core/sync/session-journal.js.map +1 -0
- package/lib/core/sync/session-routes.d.ts +7 -0
- package/lib/core/sync/session-routes.js +67 -0
- package/lib/core/sync/session-routes.js.map +1 -0
- package/lib/core/sync/session-sync.d.ts +2 -0
- package/lib/core/sync/session-sync.js +2 -0
- package/lib/core/sync/ssh-transport.d.ts +2 -0
- package/lib/core/sync/ssh-transport.js +408 -0
- package/lib/core/sync/ssh-transport.js.map +1 -0
- package/lib/core/sync/stores.d.ts +3 -0
- package/lib/core/sync/stores.js +385 -0
- package/lib/core/sync/stores.js.map +1 -0
- package/lib/core/test.d.ts +1 -1
- package/lib/core/workspace-bindings.d.ts +2 -28
- package/lib/core/workspace-bindings.js +14 -14
- package/lib/core/workspace-bindings.js.map +1 -1
- package/lib/core/workspace-instruction-context.d.ts +3 -2260
- package/lib/core/workspace-instruction-context.js +104 -2
- package/lib/core/workspace-instruction-context.js.map +1 -0
- package/lib/core/workspace-instruction-routes.d.ts +1 -1
- package/lib/core/workspace-instructions.d.ts +2 -68
- package/lib/core/workspace-instructions.js +13 -0
- package/lib/core/workspace-instructions.js.map +1 -1
- package/lib/core/workspaces.d.ts +4 -3
- package/lib/core/workspaces.js +17 -1
- package/lib/core/workspaces.js.map +1 -1
- package/lib/host-key-C5afhAUd.d.ts +30 -0
- package/lib/index-VF8bcBeX.d.ts +2293 -0
- package/lib/{workspace-instruction-context-DytAmaPY.js → lib-gdtU_WKT.js} +159 -102
- package/lib/lib-gdtU_WKT.js.map +1 -0
- package/lib/model-BP7Gw1yk.d.ts +104 -0
- package/lib/node-registry-BTnnM5-k.d.ts +112 -0
- package/lib/node-sync-3Z9QLz2n.d.ts +89 -0
- package/lib/protocol-CV7LGE44.d.ts +35 -0
- package/lib/revision-C9sOlDZ6.d.ts +25 -0
- package/lib/router/router-fs.d.ts +12 -3
- package/lib/router/router-fs.js.map +1 -1
- package/lib/session-journal-pgPqcWn9.d.ts +40 -0
- package/lib/session-sync-EdfwUON5.js +2177 -0
- package/lib/session-sync-EdfwUON5.js.map +1 -0
- package/lib/session-sync-g6qKZzjV.d.ts +1252 -0
- package/lib/ssh-transport-BcIiLxsX.d.ts +55 -0
- package/lib/stores-CKyEt0yk.d.ts +31 -0
- package/lib/workspace-bindings-CsB0TIJB.d.ts +28 -0
- package/lib/workspace-instructions-DirYYiku.d.ts +69 -0
- package/package.json +20 -1
- package/lib/workspace-instruction-context-DytAmaPY.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { a as SyncPeer } from "./model-BP7Gw1yk.js";
|
|
2
|
+
import { i as SyncNodeManifest, t as SyncNodeApplyResult } from "./node-sync-3Z9QLz2n.js";
|
|
3
|
+
import { SyncPeerManager, SyncPeerSecrets } from "./core/sync/peer-manager.js";
|
|
4
|
+
import { r as SyncHostKeyChallenges, t as SyncHostKeyChallengeError } from "./host-key-C5afhAUd.js";
|
|
5
|
+
import { a as SyncFrame } from "./protocol-CV7LGE44.js";
|
|
6
|
+
import { n as SyncSessionApplyResult, r as SyncSessionBundle } from "./session-sync-g6qKZzjV.js";
|
|
7
|
+
import { Client, ClientChannel, ConnectConfig } from "ssh2";
|
|
8
|
+
//#region src/core/sync/ssh-transport.d.ts
|
|
9
|
+
type SyncSshErrorCategory = 'auth' | 'network' | 'hostkey' | 'timeout' | 'helper' | 'protocol';
|
|
10
|
+
declare class SyncSshProbeError extends Error {
|
|
11
|
+
readonly category: SyncSshErrorCategory;
|
|
12
|
+
constructor(category: SyncSshErrorCategory);
|
|
13
|
+
}
|
|
14
|
+
interface SyncRemoteHandshake {
|
|
15
|
+
protocolVersion: number;
|
|
16
|
+
instanceId: string;
|
|
17
|
+
capabilities: string[];
|
|
18
|
+
}
|
|
19
|
+
declare class SyncSshSession {
|
|
20
|
+
private readonly client;
|
|
21
|
+
private readonly channel;
|
|
22
|
+
private readonly decoder;
|
|
23
|
+
private reading;
|
|
24
|
+
private closed;
|
|
25
|
+
private inputEnded;
|
|
26
|
+
private nextDataSequence;
|
|
27
|
+
private pendingError;
|
|
28
|
+
constructor(client: Client, channel: ClientChannel);
|
|
29
|
+
sendControl(value: Record<string, unknown>): Promise<void>;
|
|
30
|
+
sendData(sequence: number, data: Buffer): Promise<void>;
|
|
31
|
+
endInput(): void;
|
|
32
|
+
readFrames(): AsyncGenerator<SyncFrame>;
|
|
33
|
+
close(): void;
|
|
34
|
+
private write;
|
|
35
|
+
}
|
|
36
|
+
declare function buildSyncSshConnectConfig(peer: SyncPeer, secrets: SyncPeerSecrets, challenges: SyncHostKeyChallenges, onChallenge: (error: SyncHostKeyChallengeError) => void): ConnectConfig;
|
|
37
|
+
declare class SyncSshTransport {
|
|
38
|
+
private readonly peerManager;
|
|
39
|
+
private readonly hostKeyChallenges;
|
|
40
|
+
constructor(peerManager: SyncPeerManager);
|
|
41
|
+
probe(peerId: string): Promise<SyncRemoteHandshake>;
|
|
42
|
+
openSession(peerId: string): Promise<{
|
|
43
|
+
peer: SyncPeer;
|
|
44
|
+
session: SyncSshSession;
|
|
45
|
+
}>;
|
|
46
|
+
fetchNodeManifest(peerId: string): Promise<SyncNodeManifest>;
|
|
47
|
+
applyNodeManifest(peerId: string, records: SyncNodeManifest['records'], sourceName: string): Promise<SyncNodeApplyResult>;
|
|
48
|
+
fetchSessionBundle(peerId: string): Promise<SyncSessionBundle>;
|
|
49
|
+
applySessionBundle(peerId: string, bundle: SyncSessionBundle, sourceName: string): Promise<SyncSessionApplyResult>;
|
|
50
|
+
trustObservedHostKey(peerId: string): Promise<void>;
|
|
51
|
+
private requestHandshake;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { SyncSshTransport as a, SyncSshSession as i, SyncSshErrorCategory as n, buildSyncSshConnectConfig as o, SyncSshProbeError as r, SyncRemoteHandshake as t };
|
|
55
|
+
//# sourceMappingURL=ssh-transport-BcIiLxsX.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { r as SyncRevision } from "./revision-C9sOlDZ6.js";
|
|
2
|
+
import { a as SyncPeer, f as SyncState, o as SyncPeerDraft } from "./model-BP7Gw1yk.js";
|
|
3
|
+
//#region src/core/sync/stores.d.ts
|
|
4
|
+
declare function getOrCreateSyncInstanceId(home?: string): string;
|
|
5
|
+
declare class SyncPeerStore {
|
|
6
|
+
private peers;
|
|
7
|
+
private readonly filePath;
|
|
8
|
+
constructor(home?: string);
|
|
9
|
+
list(): SyncPeer[];
|
|
10
|
+
get(id: string): SyncPeer | undefined;
|
|
11
|
+
create(draft: SyncPeerDraft): SyncPeer;
|
|
12
|
+
update(id: string, patch: Partial<Omit<SyncPeer, 'id'>>): SyncPeer;
|
|
13
|
+
remove(id: string): boolean;
|
|
14
|
+
private load;
|
|
15
|
+
private save;
|
|
16
|
+
}
|
|
17
|
+
declare class SyncStateStore {
|
|
18
|
+
private state;
|
|
19
|
+
private readonly home;
|
|
20
|
+
private readonly filePath;
|
|
21
|
+
constructor(home?: string);
|
|
22
|
+
instanceId(): string;
|
|
23
|
+
read(): SyncState;
|
|
24
|
+
update(mutate: (draft: SyncState) => void): SyncState;
|
|
25
|
+
nextRevision(now?: number): SyncRevision;
|
|
26
|
+
observeRevision(remote: SyncRevision, now?: number): SyncRevision;
|
|
27
|
+
private load;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SyncStateStore as n, getOrCreateSyncInstanceId as r, SyncPeerStore as t };
|
|
31
|
+
//# sourceMappingURL=stores-CKyEt0yk.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/core/workspace-bindings.d.ts
|
|
2
|
+
interface WorkspaceBinding {
|
|
3
|
+
mirrorPath: string;
|
|
4
|
+
nodeId: string;
|
|
5
|
+
remotePath: string;
|
|
6
|
+
workspaceId?: string;
|
|
7
|
+
}
|
|
8
|
+
interface BindingHit {
|
|
9
|
+
nodeId: string;
|
|
10
|
+
remotePath: string;
|
|
11
|
+
}
|
|
12
|
+
declare class WorkspaceBindingsStore {
|
|
13
|
+
private bindings;
|
|
14
|
+
private loaded;
|
|
15
|
+
private file;
|
|
16
|
+
private load;
|
|
17
|
+
private save;
|
|
18
|
+
add(binding: Omit<WorkspaceBinding, 'mirrorPath'> & {
|
|
19
|
+
mirrorPath: string;
|
|
20
|
+
}): void;
|
|
21
|
+
remove(mirrorPath: string): void;
|
|
22
|
+
list(): WorkspaceBinding[];
|
|
23
|
+
resolve(path: string): BindingHit | undefined;
|
|
24
|
+
mirrorRoot(nodeId: string, slug: string): string;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { WorkspaceBinding as n, WorkspaceBindingsStore as r, BindingHit as t };
|
|
28
|
+
//# sourceMappingURL=workspace-bindings-CsB0TIJB.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//#region src/core/workspace-instructions.d.ts
|
|
2
|
+
declare const INSTRUCTION_MAX_BYTES = 32768;
|
|
3
|
+
interface WorkspaceInstructionRecord {
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
text: string;
|
|
6
|
+
revision: number;
|
|
7
|
+
digest: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
}
|
|
11
|
+
interface SessionInstructionSnapshot {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
workspaceId?: string;
|
|
14
|
+
workspaceRevision?: number;
|
|
15
|
+
digest?: string;
|
|
16
|
+
text: string;
|
|
17
|
+
capturedAt: string;
|
|
18
|
+
inheritedFromSessionId?: string;
|
|
19
|
+
}
|
|
20
|
+
declare class InstructionConflictError extends Error {
|
|
21
|
+
readonly expected: number;
|
|
22
|
+
readonly actual: number;
|
|
23
|
+
constructor(expected: number, actual: number);
|
|
24
|
+
}
|
|
25
|
+
declare class InstructionSizeError extends Error {
|
|
26
|
+
readonly bytes: number;
|
|
27
|
+
constructor(bytes: number);
|
|
28
|
+
}
|
|
29
|
+
declare class WorkspaceInstructionStore {
|
|
30
|
+
private data;
|
|
31
|
+
private loaded;
|
|
32
|
+
private file;
|
|
33
|
+
private load;
|
|
34
|
+
private save;
|
|
35
|
+
get(workspaceId: string): WorkspaceInstructionRecord | undefined;
|
|
36
|
+
update(input: {
|
|
37
|
+
workspaceId: string;
|
|
38
|
+
text: string;
|
|
39
|
+
expectedRevision: number;
|
|
40
|
+
}): WorkspaceInstructionRecord;
|
|
41
|
+
clear(workspaceId: string, expectedRevision: number): void;
|
|
42
|
+
removeByWorkspace(workspaceId: string): void;
|
|
43
|
+
}
|
|
44
|
+
declare class SessionInstructionSnapshotStore {
|
|
45
|
+
private data;
|
|
46
|
+
private loaded;
|
|
47
|
+
private file;
|
|
48
|
+
private load;
|
|
49
|
+
private save;
|
|
50
|
+
get(sessionId: string): SessionInstructionSnapshot | undefined;
|
|
51
|
+
createIfAbsent(sessionId: string, source: {
|
|
52
|
+
kind: 'workspace';
|
|
53
|
+
record: WorkspaceInstructionRecord;
|
|
54
|
+
workspaceId: string;
|
|
55
|
+
} | {
|
|
56
|
+
kind: 'empty';
|
|
57
|
+
workspaceId?: string;
|
|
58
|
+
} | {
|
|
59
|
+
kind: 'inherit';
|
|
60
|
+
parentSnapshot: SessionInstructionSnapshot;
|
|
61
|
+
}): SessionInstructionSnapshot;
|
|
62
|
+
restore(snapshot: SessionInstructionSnapshot): SessionInstructionSnapshot;
|
|
63
|
+
remove(sessionId: string): void;
|
|
64
|
+
}
|
|
65
|
+
declare function sharedWorkspaceInstructionStore(): WorkspaceInstructionStore;
|
|
66
|
+
declare function sharedSessionInstructionSnapshotStore(): SessionInstructionSnapshotStore;
|
|
67
|
+
//#endregion
|
|
68
|
+
export { SessionInstructionSnapshotStore as a, sharedSessionInstructionSnapshotStore as c, SessionInstructionSnapshot as i, sharedWorkspaceInstructionStore as l, InstructionConflictError as n, WorkspaceInstructionRecord as o, InstructionSizeError as r, WorkspaceInstructionStore as s, INSTRUCTION_MAX_BYTES as t };
|
|
69
|
+
//# sourceMappingURL=workspace-instructions-DirYYiku.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.19",
|
|
4
4
|
"description": "Routes DSH filesystem, shell, subprocess, and PTY operations to local, SSH, and Docker execution nodes, with a node registry, an authentication gate, a mobile-aware management UI, and per-workspace custom project instructions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,6 +31,25 @@
|
|
|
31
31
|
"./core/workspace-instruction-context": "./lib/core/workspace-instruction-context.js",
|
|
32
32
|
"./core/workspaces": "./lib/core/workspaces.js",
|
|
33
33
|
"./core/audit": "./lib/core/audit.js",
|
|
34
|
+
"./core/sync/coordinator": "./lib/core/sync/coordinator.js",
|
|
35
|
+
"./core/sync/host-key": "./lib/core/sync/host-key.js",
|
|
36
|
+
"./core/sync/internal-routes": "./lib/core/sync/internal-routes.js",
|
|
37
|
+
"./core/sync/model": "./lib/core/sync/model.js",
|
|
38
|
+
"./core/sync/node-sync": "./lib/core/sync/node-sync.js",
|
|
39
|
+
"./core/sync/offline-archive": "./lib/core/sync/offline-archive.js",
|
|
40
|
+
"./core/sync/offline-journal": "./lib/core/sync/offline-journal.js",
|
|
41
|
+
"./core/sync/offline-routes": "./lib/core/sync/offline-routes.js",
|
|
42
|
+
"./core/sync/peer-manager": "./lib/core/sync/peer-manager.js",
|
|
43
|
+
"./core/sync/protocol": "./lib/core/sync/protocol.js",
|
|
44
|
+
"./core/sync/remote-helper": "./lib/core/sync/remote-helper.js",
|
|
45
|
+
"./core/sync/revision": "./lib/core/sync/revision.js",
|
|
46
|
+
"./core/sync/routes": "./lib/core/sync/routes.js",
|
|
47
|
+
"./core/sync/scheduler": "./lib/core/sync/scheduler.js",
|
|
48
|
+
"./core/sync/session-journal": "./lib/core/sync/session-journal.js",
|
|
49
|
+
"./core/sync/session-routes": "./lib/core/sync/session-routes.js",
|
|
50
|
+
"./core/sync/session-sync": "./lib/core/sync/session-sync.js",
|
|
51
|
+
"./core/sync/ssh-transport": "./lib/core/sync/ssh-transport.js",
|
|
52
|
+
"./core/sync/stores": "./lib/core/sync/stores.js",
|
|
34
53
|
"./router": "./lib/router/index.js",
|
|
35
54
|
"./router/resolve": "./lib/router/resolve.js",
|
|
36
55
|
"./router/types": "./lib/router/types.js",
|