@artenx/dshb 0.1.8 → 0.1.10
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 +8 -8
- package/lib/client.js.map +1 -1
- package/lib/core/index.js +5 -1
- package/lib/core/index.js.map +1 -1
- package/lib/core/routes.d.ts +8 -1
- package/lib/core/routes.js +65 -3
- package/lib/core/routes.js.map +1 -1
- package/lib/core/workspace-bindings.js +6 -4
- package/lib/core/workspace-bindings.js.map +1 -1
- package/lib/exec-docker/daemon-runner.js +2 -2
- package/lib/exec-docker/docker-backend.d.ts +8 -0
- package/lib/exec-docker/docker-client.d.ts +9 -0
- package/lib/exec-docker/docker-client.js +10 -2
- package/lib/exec-docker/docker-client.js.map +1 -1
- package/lib/exec-docker/docker-routes.js +1 -1
- package/lib/exec-docker/fs-provider.d.ts +3 -12
- package/lib/exec-docker/fs-provider.js +19 -2
- package/lib/exec-docker/fs-provider.js.map +1 -1
- package/lib/exec-docker/index.js +1 -1
- package/lib/exec-docker/process-provider.d.ts +3 -1
- package/lib/exec-docker/process-provider.js +29 -0
- package/lib/exec-docker/process-provider.js.map +1 -1
- package/lib/exec-docker/remote-docker-cli.d.ts +8 -0
- package/lib/exec-docker/remote-docker-cli.js +27 -1
- package/lib/exec-docker/remote-docker-cli.js.map +1 -1
- package/lib/exec-docker/world.d.ts +1 -1
- package/lib/exec-ssh/executor.d.ts +7 -0
- package/lib/exec-ssh/executor.js +18 -0
- package/lib/exec-ssh/executor.js.map +1 -1
- package/lib/exec-ssh/fs-provider.d.ts +3 -12
- package/lib/exec-ssh/fs-provider.js +20 -3
- package/lib/exec-ssh/fs-provider.js.map +1 -1
- package/lib/exec-ssh/process-provider.d.ts +3 -1
- package/lib/exec-ssh/process-provider.js +29 -0
- package/lib/exec-ssh/process-provider.js.map +1 -1
- package/lib/exec-ssh/world.d.ts +1 -1
- package/lib/router/decorate-fs.js +16 -2
- package/lib/router/decorate-fs.js.map +1 -1
- package/lib/router/decorate-shell.d.ts +1 -1
- package/lib/router/index.d.ts +1 -1
- package/lib/router/index.js +20 -0
- package/lib/router/index.js.map +1 -1
- package/lib/router/resolve.d.ts +1 -1
- package/lib/router/router-fs.d.ts +1 -1
- package/lib/router/types.d.ts +1 -1
- package/lib/{types-C0TtEO7z.d.ts → types-DPP05ZsA.d.ts} +4 -2
- package/package.json +1 -1
package/lib/router/index.js
CHANGED
|
@@ -14,6 +14,26 @@ function apply(ctx) {
|
|
|
14
14
|
decorateFileSystem(ctx.fs);
|
|
15
15
|
decorateSubprocess(ctx.subprocess);
|
|
16
16
|
decorateShell(ctx.shell);
|
|
17
|
+
decorateTerminalController(ctx);
|
|
18
|
+
}
|
|
19
|
+
function decorateTerminalController(ctx) {
|
|
20
|
+
ctx.inject(["terminalController"], (terminalCtx) => {
|
|
21
|
+
const controller = terminalCtx.terminalController;
|
|
22
|
+
const originalExecution = controller.execution.bind(controller);
|
|
23
|
+
controller.execution = (agent) => {
|
|
24
|
+
const execution = originalExecution(agent);
|
|
25
|
+
const ref = sharedWorldResolver().resolve(agent.session.header.cwd);
|
|
26
|
+
if (ref.kind === "local") return execution;
|
|
27
|
+
if (ref.kind === "unrouted") throw new Error(`node ${ref.nodeId} world not available`);
|
|
28
|
+
const subprocess = Object.create(execution.subprocess);
|
|
29
|
+
subprocess.terminalEnvironment = ref.provider.subprocess.terminalEnvironment.bind(ref.provider.subprocess);
|
|
30
|
+
subprocess.resolveExecutable = ref.provider.subprocess.resolveExecutable.bind(ref.provider.subprocess);
|
|
31
|
+
return {
|
|
32
|
+
...execution,
|
|
33
|
+
subprocess
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
});
|
|
17
37
|
}
|
|
18
38
|
//#endregion
|
|
19
39
|
export { apply, inject, name, sharedWorldResolver };
|
package/lib/router/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/router/index.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis'\nimport { decorateFileSystem } from './decorate-fs.js'\nimport { decorateSubprocess } from './decorate-subprocess.js'\nimport { decorateShell } from './decorate-shell.js'\nimport { sharedWorldResolver } from './resolve.js'\n\nexport const name = 'dshb-router'\n\nexport const inject = ['fs', 'subprocess', 'shell']\n\nexport function apply(ctx: Context): void {\n ctx.provide('dshbRouter', sharedWorldResolver())\n decorateFileSystem(ctx.fs)\n decorateSubprocess(ctx.subprocess)\n decorateShell(ctx.shell)\n}\n\nexport { sharedWorldResolver } from './resolve.js'\nexport type { ExecutionWorldProvider, WorkspaceBindings, WorldRegistry, WorldRef, NodeTestReport } from './types.js'\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/router/index.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis'\nimport type { SubprocessRuntime } from '@deepseek-ai/dsh-subprocess'\nimport { decorateFileSystem } from './decorate-fs.js'\nimport { decorateSubprocess } from './decorate-subprocess.js'\nimport { decorateShell } from './decorate-shell.js'\nimport { sharedWorldResolver } from './resolve.js'\n\nexport const name = 'dshb-router'\n\nexport const inject = ['fs', 'subprocess', 'shell']\n\nexport function apply(ctx: Context): void {\n ctx.provide('dshbRouter', sharedWorldResolver())\n decorateFileSystem(ctx.fs)\n decorateSubprocess(ctx.subprocess)\n decorateShell(ctx.shell)\n decorateTerminalController(ctx)\n}\n\ninterface TerminalAgentLike {\n session: { header: { cwd: string } }\n}\n\ninterface TerminalControllerLike {\n execution(agent: TerminalAgentLike): { subprocess: SubprocessRuntime; sandboxPolicy: unknown }\n}\n\nfunction decorateTerminalController(ctx: Context): void {\n ctx.inject(['terminalController'], (terminalCtx: Context) => {\n const controller = (terminalCtx as unknown as { terminalController: TerminalControllerLike }).terminalController\n const originalExecution = controller.execution.bind(controller)\n\n controller.execution = (agent) => {\n const execution = originalExecution(agent)\n const ref = sharedWorldResolver().resolve(agent.session.header.cwd)\n if (ref.kind === 'local') return execution\n if (ref.kind === 'unrouted') throw new Error(`node ${ref.nodeId} world not available`)\n\n const subprocess = Object.create(execution.subprocess) as SubprocessRuntime\n subprocess.terminalEnvironment = ref.provider.subprocess.terminalEnvironment.bind(ref.provider.subprocess)\n subprocess.resolveExecutable = ref.provider.subprocess.resolveExecutable.bind(ref.provider.subprocess)\n return { ...execution, subprocess }\n }\n })\n}\n\nexport { sharedWorldResolver } from './resolve.js'\nexport type { ExecutionWorldProvider, WorkspaceBindings, WorldRegistry, WorldRef, NodeTestReport } from './types.js'\n"],"mappings":";;;;;AAOA,MAAa,OAAO;AAEpB,MAAa,SAAS;CAAC;CAAM;CAAc;AAAO;AAElD,SAAgB,MAAM,KAAoB;CACxC,IAAI,QAAQ,cAAc,oBAAoB,CAAC;CAC/C,mBAAmB,IAAI,EAAE;CACzB,mBAAmB,IAAI,UAAU;CACjC,cAAc,IAAI,KAAK;CACvB,2BAA2B,GAAG;AAChC;AAUA,SAAS,2BAA2B,KAAoB;CACtD,IAAI,OAAO,CAAC,oBAAoB,IAAI,gBAAyB;EAC3D,MAAM,aAAc,YAA0E;EAC9F,MAAM,oBAAoB,WAAW,UAAU,KAAK,UAAU;EAE9D,WAAW,aAAa,UAAU;GAChC,MAAM,YAAY,kBAAkB,KAAK;GACzC,MAAM,MAAM,oBAAoB,CAAC,CAAC,QAAQ,MAAM,QAAQ,OAAO,GAAG;GAClE,IAAI,IAAI,SAAS,SAAS,OAAO;GACjC,IAAI,IAAI,SAAS,YAAY,MAAM,IAAI,MAAM,QAAQ,IAAI,OAAO,qBAAqB;GAErF,MAAM,aAAa,OAAO,OAAO,UAAU,UAAU;GACrD,WAAW,sBAAsB,IAAI,SAAS,WAAW,oBAAoB,KAAK,IAAI,SAAS,UAAU;GACzG,WAAW,oBAAoB,IAAI,SAAS,WAAW,kBAAkB,KAAK,IAAI,SAAS,UAAU;GACrG,OAAO;IAAE,GAAG;IAAW;GAAW;EACpC;CACF,CAAC;AACH"}
|
package/lib/router/resolve.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as WorkspaceBindings, v as WorldRef, y as WorldRegistry } from "../types-
|
|
1
|
+
import { _ as WorkspaceBindings, v as WorldRef, y as WorldRegistry } from "../types-DPP05ZsA.js";
|
|
2
2
|
//#region src/router/resolve.d.ts
|
|
3
3
|
interface BindingHit {
|
|
4
4
|
nodeId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
-
import SandboxedFileSystem from "@deepseek-ai/dsh-fs-sandbox";
|
|
3
2
|
import { FsDirEntry, FsEditOutcome, FsEditRequest, FsInfo, FsPathInfo, FsTarget, FsVersion, FsWriteIntent, FsWriteOutcome } from "@deepseek-ai/dsh-fs";
|
|
3
|
+
import SandboxedFileSystem from "@deepseek-ai/dsh-fs-sandbox";
|
|
4
4
|
import { SandboxExecutionPolicy } from "@deepseek-ai/dsh-sandbox";
|
|
5
5
|
//#region src/router/router-fs.d.ts
|
|
6
6
|
declare class RouterFileSystem extends SandboxedFileSystem {
|
package/lib/router/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as WorkspaceBindings, a as NodeTestReport, c as ShellExecSpec, d as SubprocessDelegate, f as SubprocessHandle, g as SubprocessTerminalSpawnSpec, h as SubprocessTerminalHandle, i as FsTargetLike, l as ShellProcess, m as SubprocessSpawnSpec, n as FileSystem, o as ShellDelegate, p as SubprocessRuntime, r as FsDelegate, s as ShellExecRequest, t as ExecutionWorldProvider, u as ShellRunResult, v as WorldRef, y as WorldRegistry } from "../types-
|
|
1
|
+
import { _ as WorkspaceBindings, a as NodeTestReport, c as ShellExecSpec, d as SubprocessDelegate, f as SubprocessHandle, g as SubprocessTerminalSpawnSpec, h as SubprocessTerminalHandle, i as FsTargetLike, l as ShellProcess, m as SubprocessSpawnSpec, n as FileSystem, o as ShellDelegate, p as SubprocessRuntime, r as FsDelegate, s as ShellExecRequest, t as ExecutionWorldProvider, u as ShellRunResult, v as WorldRef, y as WorldRegistry } from "../types-DPP05ZsA.js";
|
|
2
2
|
export { ExecutionWorldProvider, type FileSystem, FsDelegate, FsTargetLike, NodeTestReport, ShellDelegate, type ShellExecRequest, type ShellExecSpec, type ShellProcess, type ShellRunResult, SubprocessDelegate, type SubprocessHandle, type SubprocessRuntime, type SubprocessSpawnSpec, type SubprocessTerminalHandle, type SubprocessTerminalSpawnSpec, WorkspaceBindings, WorldRef, WorldRegistry };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileSystem as FileSystem$1 } from "@deepseek-ai/dsh-fs";
|
|
2
|
-
import { SubprocessHandle as SubprocessHandle$1, SubprocessRuntime as SubprocessRuntime$1, SubprocessSpawnSpec as SubprocessSpawnSpec$1, SubprocessTerminalHandle as SubprocessTerminalHandle$1, SubprocessTerminalSpawnSpec as SubprocessTerminalSpawnSpec$1 } from "@deepseek-ai/dsh-subprocess";
|
|
2
|
+
import { SubprocessHandle as SubprocessHandle$1, SubprocessRuntime as SubprocessRuntime$1, SubprocessSpawnSpec as SubprocessSpawnSpec$1, SubprocessTerminalEnvironment, SubprocessTerminalHandle as SubprocessTerminalHandle$1, SubprocessTerminalSpawnSpec as SubprocessTerminalSpawnSpec$1 } from "@deepseek-ai/dsh-subprocess";
|
|
3
3
|
import { ShellExecRequest as ShellExecRequest$1, ShellExecSpec as ShellExecSpec$1, ShellProcess as ShellProcess$1, ShellRunResult as ShellRunResult$1 } from "@deepseek-ai/dsh-shell";
|
|
4
4
|
//#region src/router/types.d.ts
|
|
5
5
|
interface NodeTestReport {
|
|
@@ -27,6 +27,8 @@ interface FsDelegate {
|
|
|
27
27
|
}
|
|
28
28
|
type FsTargetLike = string;
|
|
29
29
|
interface SubprocessDelegate {
|
|
30
|
+
terminalEnvironment(signal?: AbortSignal): Promise<SubprocessTerminalEnvironment>;
|
|
31
|
+
resolveExecutable(command: string, env?: Readonly<Record<string, string>>, signal?: AbortSignal): Promise<string>;
|
|
30
32
|
spawn(spec: SubprocessSpawnSpec$1): SubprocessHandle$1;
|
|
31
33
|
spawnTerminal(spec: SubprocessTerminalSpawnSpec$1): Promise<SubprocessTerminalHandle$1>;
|
|
32
34
|
}
|
|
@@ -64,4 +66,4 @@ type WorldRef = {
|
|
|
64
66
|
};
|
|
65
67
|
//#endregion
|
|
66
68
|
export { WorkspaceBindings as _, NodeTestReport as a, ShellExecSpec$1 as c, SubprocessDelegate as d, SubprocessHandle$1 as f, SubprocessTerminalSpawnSpec$1 as g, SubprocessTerminalHandle$1 as h, FsTargetLike as i, ShellProcess$1 as l, SubprocessSpawnSpec$1 as m, FileSystem$1 as n, ShellDelegate as o, SubprocessRuntime$1 as p, FsDelegate as r, ShellExecRequest$1 as s, ExecutionWorldProvider as t, ShellRunResult$1 as u, WorldRef as v, WorldRegistry as y };
|
|
67
|
-
//# sourceMappingURL=types-
|
|
69
|
+
//# sourceMappingURL=types-DPP05ZsA.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.10",
|
|
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",
|