@openclaw/openshell-sandbox 2026.7.2-beta.7 → 2026.8.1-beta.3

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -57
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
2
- import { buildRemoteWorkdirValidationCommand, buildValidatedExecRemoteCommand, createRemoteShellSandboxFsBridge, createSshSandboxSessionFromConfigText, createWritableRenameTargetResolver, disposeSshSandboxSession, registerSandboxBackend, resolvePreferredOpenClawTmpDir, runPluginCommandWithTimeout, runSshSandboxCommand, sanitizeEnvVars, shellEscape, withTempWorkspace } from "openclaw/plugin-sdk/sandbox";
2
+ import { buildRemoteCommand, buildRemoteWorkdirValidationCommand, buildValidatedExecRemoteCommand, createRemoteShellSandboxFsBridge, createSshSandboxSessionFromConfigText, createWritableRenameTargetResolver, disposeSshSandboxSession, registerSandboxBackend, resolvePreferredOpenClawTmpDir, runPluginCommandWithTimeout, runSshSandboxCommand, sanitizeEnvVars, shellEscape, withTempWorkspace } from "openclaw/plugin-sdk/sandbox";
3
3
  import { createHash } from "node:crypto";
4
4
  import fsPromises from "node:fs/promises";
5
5
  import path from "node:path";
@@ -8,8 +8,8 @@ import { buildPluginConfigSchema } from "openclaw/plugin-sdk/core";
8
8
  import { formatPluginConfigIssue, mapPluginConfigIssues } from "openclaw/plugin-sdk/extension-shared";
9
9
  import { MAX_TIMER_TIMEOUT_SECONDS } from "openclaw/plugin-sdk/number-runtime";
10
10
  import { z } from "zod";
11
- import { root } from "openclaw/plugin-sdk/file-access-runtime";
12
- import { FsSafeError, isPathInside, movePathWithCopyFallback } from "openclaw/plugin-sdk/security-runtime";
11
+ import { isPathInside, root } from "openclaw/plugin-sdk/file-access-runtime";
12
+ import { FsSafeError, movePathWithCopyFallback } from "openclaw/plugin-sdk/security-runtime";
13
13
  import pLimit from "p-limit";
14
14
  //#region extensions/openshell/src/cli.ts
15
15
  function buildOpenShellBaseArgv(config) {
@@ -19,9 +19,6 @@ function buildOpenShellBaseArgv(config) {
19
19
  if (config.workspace) argv.push("--workspace", config.workspace);
20
20
  return argv;
21
21
  }
22
- function buildRemoteCommand(argv) {
23
- return argv.map((entry) => shellEscape(entry)).join(" ");
24
- }
25
22
  function applyGatewayEndpointToSshConfig(params) {
26
23
  const endpoint = params.gatewayEndpoint?.trim();
27
24
  if (!endpoint) return params.configText;
@@ -854,69 +851,25 @@ async function createOpenShellSandboxBackend(params) {
854
851
  config: params.pluginConfig,
855
852
  sandboxName
856
853
  };
857
- const impl = new OpenShellSandboxBackendImpl({
854
+ return new OpenShellSandboxBackendImpl({
858
855
  createParams: params.createParams,
859
856
  execContext,
860
857
  legacyRuntimeAdopted: resolvedSandboxName.legacyRuntimeAdopted,
861
858
  remoteWorkspaceDir: params.pluginConfig.remoteWorkspaceDir,
862
859
  remoteAgentWorkspaceDir: params.pluginConfig.remoteAgentWorkspaceDir
863
- });
864
- return {
865
- id: "openshell",
866
- runtimeId: sandboxName,
867
- runtimeLabel: sandboxName,
868
- workdir: params.pluginConfig.remoteWorkspaceDir,
869
- env: params.createParams.cfg.docker.env,
870
- mode: params.pluginConfig.mode,
871
- configLabel: params.pluginConfig.from,
872
- configLabelKind: "Source",
873
- workdirValidation: "backend",
874
- validateWorkdir: async (workdir) => await impl.validateWorkdir(workdir),
875
- discardPreparedWorkdir: (workdir) => impl.discardPreparedWorkdir(workdir),
876
- workdirRoots: [params.pluginConfig.remoteWorkspaceDir, params.pluginConfig.remoteAgentWorkspaceDir],
877
- buildExecSpec: async ({ command, workdir, env, usePty }) => {
878
- const pending = await impl.prepareExec({
879
- command,
880
- workdir,
881
- env,
882
- usePty
883
- });
884
- return {
885
- argv: pending.argv,
886
- env: buildOpenShellSshExecEnv(),
887
- stdinMode: "pipe-open",
888
- finalizeToken: pending.token
889
- };
890
- },
891
- finalizeExec: async ({ token }) => {
892
- await impl.finalizeExec(token);
893
- },
894
- runShellCommand: async (command) => await impl.runRemoteShellScript(command),
895
- createFsBridge: ({ sandbox }) => params.pluginConfig.mode === "remote" ? createRemoteShellSandboxFsBridge({
896
- sandbox,
897
- runtime: impl.asHandle()
898
- }) : createOpenShellFsBridge({
899
- sandbox,
900
- backend: impl.asHandle()
901
- }),
902
- remoteWorkspaceDir: params.pluginConfig.remoteWorkspaceDir,
903
- remoteAgentWorkspaceDir: params.pluginConfig.remoteAgentWorkspaceDir,
904
- runRemoteShellScript: async (command) => await impl.runRemoteShellScript(command),
905
- mkdirpRemotePath: async (remotePath, signal) => await impl.mkdirpRemotePath(remotePath, signal),
906
- removeRemotePath: async (remotePath, removeParams) => await impl.removeRemotePath(remotePath, removeParams),
907
- renameRemotePath: async (fromRemotePath, toRemotePath, signal) => await impl.renameRemotePath(fromRemotePath, toRemotePath, signal),
908
- syncLocalPathToRemote: async (localPath, remotePath) => await impl.syncLocalPathToRemote(localPath, remotePath)
909
- };
860
+ }).asHandle();
910
861
  }
911
862
  var OpenShellSandboxBackendImpl = class {
912
863
  constructor(params) {
913
864
  this.params = params;
865
+ this.handle = null;
914
866
  this.ensurePromise = null;
915
867
  this.preparedRemoteWorkspaceForNextExec = null;
916
868
  this.remoteSeedPending = false;
917
869
  }
918
870
  asHandle() {
919
- return {
871
+ if (this.handle) return this.handle;
872
+ const handle = {
920
873
  id: "openshell",
921
874
  runtimeId: this.params.execContext.sandboxName,
922
875
  runtimeLabel: this.params.execContext.sandboxName,
@@ -951,10 +904,10 @@ var OpenShellSandboxBackendImpl = class {
951
904
  runShellCommand: async (command) => await this.runRemoteShellScript(command),
952
905
  createFsBridge: ({ sandbox }) => this.params.execContext.config.mode === "remote" ? createRemoteShellSandboxFsBridge({
953
906
  sandbox,
954
- runtime: this.asHandle()
907
+ runtime: handle
955
908
  }) : createOpenShellFsBridge({
956
909
  sandbox,
957
- backend: this.asHandle()
910
+ backend: handle
958
911
  }),
959
912
  runRemoteShellScript: async (command) => await this.runRemoteShellScript(command),
960
913
  mkdirpRemotePath: async (remotePath, signal) => await this.mkdirpRemotePath(remotePath, signal),
@@ -962,6 +915,8 @@ var OpenShellSandboxBackendImpl = class {
962
915
  renameRemotePath: async (fromRemotePath, toRemotePath, signal) => await this.renameRemotePath(fromRemotePath, toRemotePath, signal),
963
916
  syncLocalPathToRemote: async (localPath, remotePath) => await this.syncLocalPathToRemote(localPath, remotePath)
964
917
  };
918
+ this.handle = handle;
919
+ return handle;
965
920
  }
966
921
  async prepareExec(params) {
967
922
  const remoteWorkdir = params.workdir ?? this.params.remoteWorkspaceDir;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/openshell-sandbox",
3
- "version": "2026.7.2-beta.7",
3
+ "version": "2026.8.1-beta.3",
4
4
  "description": "OpenClaw sandbox backend for the NVIDIA OpenShell CLI with mirrored local workspaces and SSH command execution.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,10 +21,10 @@
21
21
  "minHostVersion": ">=2026.5.12-beta.1"
22
22
  },
23
23
  "compat": {
24
- "pluginApi": ">=2026.7.2-beta.7"
24
+ "pluginApi": ">=2026.8.1-beta.3"
25
25
  },
26
26
  "build": {
27
- "openclawVersion": "2026.7.2-beta.7",
27
+ "openclawVersion": "2026.8.1-beta.3",
28
28
  "bundledDist": false
29
29
  },
30
30
  "release": {
@@ -41,7 +41,7 @@
41
41
  "README.md"
42
42
  ],
43
43
  "peerDependencies": {
44
- "openclaw": ">=2026.7.2-beta.7"
44
+ "openclaw": ">=2026.8.1-beta.3"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "openclaw": {