{"_id":"@buckeyestudio/toh-tool-bash-persistent","name":"@buckeyestudio/toh-tool-bash-persistent","dist-tags":{"next":"0.1.1-rc.2","latest":"0.1.1-rc.2"},"versions":{"0.1.1-rc.2":{"name":"@buckeyestudio/toh-tool-bash-persistent","description":"Model-facing owner-scoped persistent Bash tool backed by the Harness PTY service","version":"0.1.1-rc.2","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/shell/tool-bash-persistent"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"license":"MIT","author":{"name":"buckeyestudio"},"peerDependencies":{"@buckeyestudio/toh-agent":"^0.1.1-rc.2","@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/toh-timeout":"^0.1.1-rc.2","@buckeyestudio/toh-terminal":"^0.1.1-rc.2","@buckeyestudio/toh-tools":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"dependencies":{"@buckeyestudio/schemastery":"^3.18.1"},"devDependencies":{"@buckeyestudio/cordis-plugin-loader":"^1.0.2","@buckeyestudio/cordis-plugin-include":"^1.0.6","@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/toh-agent":"^0.1.1-rc.2","@buckeyestudio/toh-llm":"^0.1.1-rc.2","@buckeyestudio/toh-terminal":"^0.1.1-rc.2","@buckeyestudio/toh-terminal-bash":"^0.1.1-rc.2","@buckeyestudio/toh-subprocess-local":"^0.1.1-rc.2","@buckeyestudio/toh-sandbox":"^0.1.1-rc.2","@buckeyestudio/toh-session":"^0.1.1-rc.2","@buckeyestudio/toh-system-prompt":"^0.1.1-rc.2","@buckeyestudio/toh-timeout":"^0.1.1-rc.2","@buckeyestudio/toh-sandbox-policy":"^0.1.1-rc.2","@buckeyestudio/toh-tools":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"_id":"@buckeyestudio/toh-tool-bash-persistent@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-JAL57E+/uZ/JdcuwUtvixnZ8buIS16/LEu8CC6KOWCxWwv4+z1IsTxwEJ4nQTJNLzmIEvAK07dRO/Qgv1uHUpQ==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-tool-bash-persistent-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-tool-bash-persistent-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-JAL57E+/uZ/JdcuwUtvixnZ8buIS16/LEu8CC6KOWCxWwv4+z1IsTxwEJ4nQTJNLzmIEvAK07dRO/Qgv1uHUpQ==","shasum":"d960e9e28d686e80c89649b59572010bcf59b0bf","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-tool-bash-persistent/-/toh-tool-bash-persistent-0.1.1-rc.2.tgz","fileCount":9,"unpackedSize":28219,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGDFbDWWfnXxyHiddB2bau0pAxThn6i0EEjgoYmyzPYNAiEA/uhGhShzI0uxjiFwTG9FOrfTHKSu05u1eYPaXouDR7I="}]},"_npmUser":{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"},"directories":{},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toh-tool-bash-persistent_0.1.1-rc.2_1787489565678_0.9800404506546414"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:52:45.533Z","0.1.1-rc.2":"2026-08-23T12:52:45.819Z","modified":"2026-08-23T12:52:46.019Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"Model-facing owner-scoped persistent Bash tool backed by the Harness PTY service","homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/shell/tool-bash-persistent"},"author":{"name":"buckeyestudio"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# @buckeyestudio/toh-tool-bash-persistent\n\n[English](README.md) | 中文\n\n模型可见的 `bash(command)`，底层复用一个按所有者隔离的 `ctx.terminals` shell。该包拥有工具约定和 shell 复用；PTY 后端与沙箱策略由部署选择。\n\n## 配置\n\n| 键 | 默认值 | 含义 |\n|---|---:|---|\n| `backendType` | `shell` | 每个 Agent shell 使用的已注册 PTY 后端。 |\n| `timeoutMs` | `300000` | 单条命令的墙钟时间上限；超时会关闭 shell。 |\n| `maxOutputChars` | `16000` | 命令输出最多保留的字符数；固定诊断会在此后追加。 |\n| `description` | 持久 shell 描述 | 面向模型的环境约定。 |\n\n## 模型体验\n\n### 工具 schema\n\n#### 模型所见\n\n生成的 [`bash` schema](../../../docs/tool-catalog.zh.md#buckeyestudiotoh-tool-bash-persistent)，其中包含配置的 `description`。本插件不贡献独立系统提示词段；persona 与环境指导由部署负责。\n\n#### Token 影响\n\n`bash` 可见时产生固定的 schema 成本。\n\n#### KV Cache 影响\n\n配置的描述与 schema 不变时前缀稳定。\n\n### 工具结果\n\n#### 模型所见\n\n每个 Agent 的命令共享一个 shell，因此 cwd、导出的环境变量、已激活环境、函数和后台任务会跨调用保留。结果不包含私有完成标记。当 shell 在未打印完成标记的情况下再次读取 stdin 时——例如 `exec`、中断，或提供方能证明其 stdin 等待的交互式前台子进程——调用返回已捕获的部分输出，其末尾可能带有后端自己的提示符文本。经封装的命令以非零状态结束时，结果会追加 `[exit code: N]`；若 shell 在报告该状态前退出，则改为追加 `[shell exited: code N]`、`[shell killed by signal: SIG]`，或在后端既未提供退出码也未提供信号时追加 `[shell exited]`；随后重置 shell，并告知模型下次调用从新 shell 开始。长输出保留仍可读取的最早前缀并追加截断提示；若 PTY 已丢弃真正的开头，结果会明确说明，而不是把尾部伪装成完整输出。超时返回有界的部分输出、关闭状态不确定的 shell，并报告该重置。\n\n#### Token 影响\n\n随数据变化。`maxOutputChars` 限制保留的命令输出；固定的截断、前缀丢失、状态、超时与重置诊断可能使结果更长。\n\n#### KV Cache 影响\n\n工具结果以追加方式位于可复用请求前缀之后。\n\n## 已知限制与延后工作\n\n- 工具需要拥有它的 Agent 和真实 PTY 后端。\n- 交互式前台子进程（例如 REPL）只有在进程管理提供方能证明其 stdin 等待时才会提前返回部分输出；否则调用会一直运行到 `timeoutMs`。\n- 显式 `exit` 与超时会丢弃 shell 状态。取消同样会重置 shell 并丢弃结果，即使已经能观察到完整状态标记也是如此；下次调用创建新 shell。\n- 网络访问、软件包镜像等环境事实应写入配置的 `description`，而非包默认描述。\n","readmeFilename":"README.zh.md","_rev":"1-6728bf2fd22546676ad296ccca6cba05"}