dshb-exec-ssh 0.0.1

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/index.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { n as SshSubprocessRuntime, t as SshShellExecutor } from "./process-provider-CUgC5gyu.js";
2
+ import { n as Context } from "./index-CDfaZYyK.js";
3
+ import { c as classifySshError, i as SshErrorCategory, l as toConnectionError, o as SshSecrets, r as SshConnectionError, s as SshTarget } from "./connection-w4OewdmD.js";
4
+ import { SshConnectionPool } from "./connection-pool.js";
5
+ import { scrubEnv, shouldScrubVar } from "./env-scrub.js";
6
+ import { SshExecutor } from "./executor.js";
7
+ import { SshFileSystem } from "./fs-provider.js";
8
+ import { SshExecutionWorld, SshNodeConfig, SshWorldRegistry } from "./world.js";
9
+ import { REMOTE_RUNNER_COMMAND, REMOTE_RUNNER_SCRIPT, encodeRunnerPayload } from "./runner.js";
10
+ //#region src/index.d.ts
11
+ declare const name = "dshb-exec-ssh";
12
+ declare const inject: string[];
13
+ declare function apply(ctx: Context): void;
14
+ //#endregion
15
+ export { REMOTE_RUNNER_COMMAND, REMOTE_RUNNER_SCRIPT, type SshConnectionError, SshConnectionPool, type SshErrorCategory, SshExecutionWorld, SshExecutor, SshFileSystem, type SshNodeConfig, type SshSecrets, SshShellExecutor, SshSubprocessRuntime, type SshTarget, SshWorldRegistry, apply, classifySshError, encodeRunnerPayload, inject, name, scrubEnv, shouldScrubVar, toConnectionError };
16
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import { classifySshError, toConnectionError } from "./connection.js";
2
+ import { SshConnectionPool } from "./connection-pool.js";
3
+ import { REMOTE_RUNNER_COMMAND, REMOTE_RUNNER_SCRIPT, encodeRunnerPayload } from "./runner.js";
4
+ import { SshExecutor } from "./executor.js";
5
+ import { SshFileSystem } from "./fs-provider.js";
6
+ import { SshShellExecutor, SshSubprocessRuntime } from "./process-provider.js";
7
+ import { SshExecutionWorld, SshWorldRegistry } from "./world.js";
8
+ import { scrubEnv, shouldScrubVar } from "./env-scrub.js";
9
+ import { sharedWorldResolver } from "dshb-router/resolve";
10
+ //#region src/index.ts
11
+ const name = "dshb-exec-ssh";
12
+ const inject = ["nodeRegistry"];
13
+ function apply(ctx) {
14
+ const pool = new SshConnectionPool(ctx);
15
+ const nodeRegistry = ctx.get("nodeRegistry");
16
+ const audit = ctx.get("dshbAudit");
17
+ const worlds = new SshWorldRegistry(pool, nodeRegistry, audit ? (id, op, t, r) => audit.log(id, op, t, r) : void 0);
18
+ ctx.provide("dshbSshPool", pool);
19
+ ctx.provide("dshbSshWorlds", worlds);
20
+ ctx.provide("dshbWorlds", { ensure: (nodeId) => worlds.ensure(nodeId) });
21
+ sharedWorldResolver().setRegistry({ get: (nodeId) => {
22
+ const node = nodeRegistry?.get(nodeId);
23
+ if (node && (node.type === "remote-docker" || node.type === "local-docker")) return void 0;
24
+ return worlds.get(nodeId);
25
+ } });
26
+ }
27
+ //#endregion
28
+ export { REMOTE_RUNNER_COMMAND, REMOTE_RUNNER_SCRIPT, SshConnectionPool, SshExecutionWorld, SshExecutor, SshFileSystem, SshShellExecutor, SshSubprocessRuntime, SshWorldRegistry, apply, classifySshError, encodeRunnerPayload, inject, name, scrubEnv, shouldScrubVar, toConnectionError };
29
+
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis'\nimport { sharedWorldResolver } from 'dshb-router/resolve'\nimport { SshConnectionPool } from './connection-pool.js'\nimport { SshWorldRegistry } from './world.js'\n\nexport const name = 'dshb-exec-ssh'\n\nexport const inject = ['nodeRegistry']\n\nexport function apply(ctx: Context): void {\n const pool = new SshConnectionPool(ctx)\n const nodeRegistry = ctx.get('nodeRegistry') as ConstructorParameters<typeof SshWorldRegistry>[1]\n const audit = ctx.get('dshbAudit') as { log(nodeId: string, op: string, target: string, result: string): void } | undefined\n const worlds = new SshWorldRegistry(pool, nodeRegistry, audit ? (id, op, t, r) => audit.log(id, op, t, r) : undefined)\n ctx.provide('dshbSshPool', pool)\n ctx.provide('dshbSshWorlds', worlds)\n ctx.provide('dshbWorlds', {\n ensure: (nodeId: string) => worlds.ensure(nodeId),\n })\n sharedWorldResolver().setRegistry({\n get: (nodeId: string) => {\n const node = nodeRegistry?.get(nodeId)\n if (node && (node.type === 'remote-docker' || node.type === 'local-docker')) return undefined\n return worlds.get(nodeId)\n },\n })\n}\n\nexport { SshConnectionPool } from './connection-pool.js'\nexport { classifySshError, toConnectionError } from './connection.js'\nexport type { SshConnectionError, SshErrorCategory, SshTarget, SshSecrets } from './connection.js'\nexport { shouldScrubVar, scrubEnv } from './env-scrub.js'\nexport { SshExecutor } from './executor.js'\nexport { SshFileSystem } from './fs-provider.js'\nexport { SshShellExecutor, SshSubprocessRuntime } from './process-provider.js'\nexport { SshExecutionWorld, SshWorldRegistry } from './world.js'\nexport type { SshNodeConfig } from './world.js'\nexport { encodeRunnerPayload, REMOTE_RUNNER_COMMAND, REMOTE_RUNNER_SCRIPT } from './runner.js'\n"],"mappings":";;;;;;;;;;AAKA,MAAa,OAAO;AAEpB,MAAa,SAAS,CAAC,cAAc;AAErC,SAAgB,MAAM,KAAoB;CACxC,MAAM,OAAO,IAAI,kBAAkB,GAAG;CACtC,MAAM,eAAe,IAAI,IAAI,cAAc;CAC3C,MAAM,QAAQ,IAAI,IAAI,WAAW;CACjC,MAAM,SAAS,IAAI,iBAAiB,MAAM,cAAc,SAAS,IAAI,IAAI,GAAG,MAAM,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,IAAI,KAAA,CAAS;CACrH,IAAI,QAAQ,eAAe,IAAI;CAC/B,IAAI,QAAQ,iBAAiB,MAAM;CACnC,IAAI,QAAQ,cAAc,EACxB,SAAS,WAAmB,OAAO,OAAO,MAAM,EAClD,CAAC;CACD,oBAAoB,CAAC,CAAC,YAAY,EAChC,MAAM,WAAmB;EACvB,MAAM,OAAO,cAAc,IAAI,MAAM;EACrC,IAAI,SAAS,KAAK,SAAS,mBAAmB,KAAK,SAAS,iBAAiB,OAAO,KAAA;EACpF,OAAO,OAAO,IAAI,MAAM;CAC1B,EACF,CAAC;AACH"}