@hasna-internal/kai-shell 0.1.1-rc.2 → 0.1.1-rc.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.
- package/README.md +1 -51
- package/index.js +2 -0
- package/package.json +10 -42
- package/LICENSE +0 -21
- package/README.i18n.yaml +0 -6
- package/README.zh.md +0 -53
- package/lib/index.js +0 -96
- package/lib/invariant.js +0 -17
- package/lib/types/index.d.ts +0 -78
- package/lib/types/invariant.d.ts +0 -13
- package/lib/types/render.d.ts +0 -39
- package/lib/types/types.d.ts +0 -175
package/README.md
CHANGED
|
@@ -1,53 +1,3 @@
|
|
|
1
1
|
# @hasna-internal/kai-shell
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
The **`ShellExecutor`** (`ctx.shell`) defines WHAT a bash backend does — run foreground commands and start background processes — without saying HOW. Job ids, ownership, collection, cancellation, and notices belong to the generic `ctx.jobs` runtime.
|
|
6
|
-
|
|
7
|
-
This package owns the Service Definition role of the bash capability, split so each role can evolve (and be swapped) independently:
|
|
8
|
-
|
|
9
|
-
| Package | Role |
|
|
10
|
-
|---|---|
|
|
11
|
-
| `@hasna-internal/kai-shell` (this) | Service Definition: abstract service + vocabulary types |
|
|
12
|
-
| `@hasna-internal/kai-bash-local` | Service Provider: local subprocesses |
|
|
13
|
-
| `@hasna-internal/kai-bash-sandbox` | Service Provider: `dsh-bash-local`'s mechanics with every spawn confined via [`ctx.sandbox`](../../sandbox/sandbox/), denials reported as result facts |
|
|
14
|
-
| `@hasna-internal/kai-tool-bash` | the model-facing tool schemas over `ctx.shell` |
|
|
15
|
-
|
|
16
|
-
The split is a standard capability seam ([capability-seams Agent Note](../../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.md)): `dsh-bash-sandbox` is a sandboxing executor behind the same Service Definition — the Consumer detects its `sandboxMode` capability and adds escalation fields without importing the provider — and a containerized or remote executor slots in the same way.
|
|
17
|
-
|
|
18
|
-
## Service API (`ctx.shell`)
|
|
19
|
-
|
|
20
|
-
| Member | Semantics |
|
|
21
|
-
|---|---|
|
|
22
|
-
| `run(spec)` | Foreground execution. Resolves when the command finishes. **Rejects only for infrastructure failures** (unusable workdir, missing shell, pre-aborted signal); nonzero exits, timeout kills, and abort kills resolve with a descriptive `ShellRunResult`. |
|
|
23
|
-
| `start(spec)` | Background execution. Returns a task-free `ShellProcess` handle immediately; **no timeout applies**. The caller may adapt it into `ctx.jobs`. |
|
|
24
|
-
| `sandboxMode` | The capability fact for the tool layer: the default mode a SANDBOXING executor confines under (`undefined` in the base class — "this executor does not sandbox"). `dsh-tool-bash` reads it at registration to advertise the escalation fields only when the composition honors them. |
|
|
25
|
-
| `ShellProcess.readOutput()` | **Incremental** output read — consecutive reads never re-deliver. Reads that lost data to buffer bounds flag `lossy` and point at full-stream spill files. |
|
|
26
|
-
| `ShellProcess.kill()` | Kill the process group. Returns `false` when it already finished. |
|
|
27
|
-
|
|
28
|
-
Implementations subclass `ShellExecutor` and implement the abstract methods. Disposal must kill every running process and await its exit.
|
|
29
|
-
|
|
30
|
-
`SHELL_SETTINGS_NAMESPACE` (`bash`) is exported here rather than by a provider because it names the capability, not an implementation. A host composes exactly one provider of `ctx.shell` — the win32 layer swaps the POSIX rows for the pwsh ones, and mounting both fails loud on a duplicate service registration — so every provider can register this one namespace with its own schema and composition entry without two of them ever colliding, and a `settings.yaml` carried between platforms keeps resolving on both.
|
|
31
|
-
|
|
32
|
-
## Vocabulary
|
|
33
|
-
|
|
34
|
-
`ShellExecRequest` (command, workdir?, timeoutMs?, stdoutMaxBytes?, signal?, stdin?, env?, dshEnv?, sandboxPolicy?) resolves to `ShellExecSpec` (command, workdir, timeoutMs, stdoutMaxBytes, signal?, stdin?, env?, dshEnv?, sandboxPolicy) before execution. `stdoutMaxBytes` is a trusted foreground-run capture budget for consumers that must parse complete bounded stdout; the model-facing bash tool does not expose it. `sandboxPolicy` is optional on the request and required-but-nullable on the resolved spec: it carries the complete per-call mode and workspace root. The sandbox tool path resolves it from the calling session through `ctx.sandboxPolicy`; a direct sandbox-executor caller falls back to deployment policy, while a non-sandboxing executor carries the field and confines nothing.
|
|
35
|
-
|
|
36
|
-
The per-session sandbox-mode override vocabulary (the `'sandbox/mode'` event, the `effectiveSandboxMode(events)` fold, and the `setSandboxMode(session, mode)` write path) is NOT here — it is policy state shared by every enforcing family, owned by [`@hasna-internal/kai-sandbox-policy`](../../sandbox/sandbox-policy/). `run()` returns `ShellRunResult`; `start()` returns `ShellProcess`, whose incremental read and kill methods are adapted by `dsh-tool-bash` into a generic task registration. A sandboxing executor stamps `ShellSandboxInfo` on foreground results and settled process handles. See `src/types.ts` and [subsystems/shell.md](../../../docs/subsystems/shell.md).
|
|
37
|
-
|
|
38
|
-
`stdin` and ordinary `env` are set by in-process plugins (the hooks bridges, native plugins) to feed a hook command its JSON payload and `CLAUDE_PROJECT_DIR`/`CLAUDE_PLUGIN_ROOT` values. `dshEnv` is a separate trusted overlay restricted by type to managed keys; the exported `DSH_ENV_PREFIX` is the single source for that namespace, its `DshEnvironmentKey` template type, executor scrubbing, registry validation, derived built-in names, and model guidance. Model bash uses the current snapshot collected by `ctx.shellEnv`. Implementations remove inherited managed keys, then merge `dshEnv` after ordinary `env`, so an omitted current fact cannot fall back to stale ambient state and an `env` entry cannot displace a managed value. The model-facing tool exposes none of these as parameters. All three remain optional on the resolved spec; absent means no input/overlay. See [the bash-stdin-env Agent Note](../../../.agents/notes/implemented/architecture/2026-06-30-bash-stdin-env-trusted-plugin-api.md) and [the session environment Agent Note](../../../.agents/notes/implemented/feature/2026-07-10-agent-session-identity-and-log-location.md).
|
|
39
|
-
|
|
40
|
-
The exported `parseExitStatus` (with `ParsedExitStatus`) is the shared rendering contract half of the shell tools: the inverse of the `[exit code: N]` / `[killed by signal: X]` markers `dsh-tool-bash`'s `renderResult` and `dsh-tool-pwsh`'s `renderPwshResult` append. Both tools' `presentResult` use it to split the rendered text into the terminal card's output body and its exit-status pill; it lives with the Service Definition so the two tools never drift on the marker contract.
|
|
41
|
-
|
|
42
|
-
## Model Experience
|
|
43
|
-
|
|
44
|
-
Indirectly, through `dsh-tool-bash`, which turns executor output and sandbox facts into guidance and retained tool-result tokens.
|
|
45
|
-
|
|
46
|
-
#### KV Cache effect
|
|
47
|
-
|
|
48
|
-
No direct invalidation; the named consumer owns any request-prefix changes.
|
|
49
|
-
|
|
50
|
-
## Known Limitations and Deferred Work
|
|
51
|
-
|
|
52
|
-
- **No interactive-input vocabulary** — `stdin` is written once at spawn and closed; the seam has no channel to feed a running task and no PTY session concept.
|
|
53
|
-
- **Foreground timeouts are always executor-owned** — a caller-owned-deadline mode on the seam is explicitly deferred by [the tool-call timeout-policy Agent Note](../../../.agents/notes/implemented/architecture/2026-07-07-tool-call-timeout-policy.md).
|
|
3
|
+
This package has been retired by its owner. This release is an empty placeholder with no dependencies or supported functionality. Do not use it.
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,48 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna-internal/kai-shell",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
-
"directory": "packages/shell/shell"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"main": "lib/index.js",
|
|
15
|
-
"types": "lib/types/index.d.ts",
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"types": "./lib/types/index.d.ts",
|
|
19
|
-
"default": "./lib/index.js"
|
|
20
|
-
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
|
-
"./src/*": "./src/*",
|
|
26
|
-
"./package.json": "./package.json"
|
|
27
|
-
},
|
|
3
|
+
"version": "0.1.1-rc.3",
|
|
4
|
+
"description": "Retired package. Empty placeholder with no dependencies.",
|
|
5
|
+
"main": "index.js",
|
|
28
6
|
"files": [
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"lib/types/**/*.d.ts"
|
|
7
|
+
"index.js",
|
|
8
|
+
"README.md"
|
|
32
9
|
],
|
|
33
10
|
"license": "MIT",
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"@hasna-internal/kai-sandbox": "^0.1.1-rc.2",
|
|
39
|
-
"@deepseek-ai/cordis": "^4.0.1"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@hasna-internal/kai-sandbox": "^0.1.1-rc.2",
|
|
43
|
-
"@hasna-internal/kai-subprocess": "^0.1.1-rc.2",
|
|
44
|
-
"@hasna-internal/kai-invariants": "^0.1.1-rc.2",
|
|
45
|
-
"@deepseek-ai/cordis": "^4.0.1",
|
|
46
|
-
"@hasna-internal/kai-settings": "^0.1.1-rc.2"
|
|
11
|
+
"deprecated": "Retired by the package owner. Empty placeholder; do not use.",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"registry": "https://registry.npmjs.org/",
|
|
14
|
+
"access": "public"
|
|
47
15
|
}
|
|
48
|
-
}
|
|
16
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 DeepSeek
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.i18n.yaml
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
-
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
-
# after editing either side, bring the other along and re-record with:
|
|
4
|
-
# pnpm run verify-translation-pairing --write packages/shell/shell/README.md
|
|
5
|
-
README.md: a15980ead797a73c18dd6d8825a4b38cf845df60
|
|
6
|
-
README.zh.md: 008b19835697d5d9514cf5472696852cfc684acd
|
package/README.zh.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# @hasna-internal/kai-shell
|
|
2
|
-
|
|
3
|
-
[English](README.md) | 中文
|
|
4
|
-
|
|
5
|
-
**`ShellExecutor`**(`ctx.shell`)定义 bash 后端做什么,即运行前台命令与启动后台进程,但不规定如何实现。job id、所有权、收集、取消与通知属于通用 `ctx.jobs` 运行时。
|
|
6
|
-
|
|
7
|
-
本包承担 bash 能力的 Service Definition 角色,各角色因此可以独立演进(和替换):
|
|
8
|
-
|
|
9
|
-
| 包 | 职责 |
|
|
10
|
-
|---|---|
|
|
11
|
-
| `@hasna-internal/kai-shell`(本包) | Service Definition:抽象服务 + 词汇类型 |
|
|
12
|
-
| `@hasna-internal/kai-bash-local` | Service Provider:本地子进程 |
|
|
13
|
-
| `@hasna-internal/kai-bash-sandbox` | Service Provider:沿用 `dsh-bash-local` 的机制,但通过 [`ctx.sandbox`](../../sandbox/sandbox/) 限制每次 spawn,并将拒绝报告为结果事实 |
|
|
14
|
-
| `@hasna-internal/kai-tool-bash` | 基于 `ctx.shell`、面向模型的工具 schema |
|
|
15
|
-
|
|
16
|
-
该拆分是一个标准的能力 seam([capability-seams Agent Note](../../../.agents/notes/implemented/architecture/2026-06-13-capability-seams.zh.md)):`dsh-bash-sandbox` 是位于同一 Service Definition 之后的沙箱执行器——Consumer 检测其 `sandboxMode` 能力并添加升权字段,无需导入提供方——容器化或远程执行器也可以同样接入。
|
|
17
|
-
|
|
18
|
-
## 服务 API(`ctx.shell`)
|
|
19
|
-
|
|
20
|
-
| 成员 | 语义 |
|
|
21
|
-
|---|---|
|
|
22
|
-
| `run(spec)` | 前台执行。命令完成时 resolve。**只会因基础设施失败而 reject**(工作目录不可用、shell 缺失、信号已在调用前中止);非零退出、超时终止和中止导致的终止都会 resolve 为描述性 `ShellRunResult`。 |
|
|
23
|
-
| `start(spec)` | 后台执行。立即返回不含任务语义的 `ShellProcess` 句柄;**不应用超时**。调用方可以将其适配到 `ctx.jobs`。 |
|
|
24
|
-
| `sandboxMode` | 工具层的能力事实:沙箱执行器用于限制执行的默认模式(基类中为 `undefined`,即「此执行器不使用沙箱」)。`dsh-tool-bash` 会在注册时读取它,仅当组合确实支持升权字段时才公布这些字段。 |
|
|
25
|
-
| `ShellProcess.readOutput()` | **增量** 读取输出:连续读取绝不会重复交付。因缓冲区容量限制而丢失数据的读取会标记 `lossy`,并指向完整流 spill 文件。 |
|
|
26
|
-
| `ShellProcess.kill()` | 终止进程组。如果进程已结束,返回 `false`。 |
|
|
27
|
-
|
|
28
|
-
实现会继承 `ShellExecutor` 并实现抽象方法。dispose(资源释放)必须终止每个运行中的进程并等待其退出。
|
|
29
|
-
|
|
30
|
-
`SHELL_SETTINGS_NAMESPACE`(`bash`)由此处导出而非由某个提供方导出,因为它命名的是能力而不是实现。一个宿主只组装一个 `ctx.shell` 提供方——win32 层会把 POSIX 行换成 pwsh 行,同时挂载两者会因服务重复注册而在加载期失败——所以每个提供方都能用自己的 schema 与组装条目注册这同一个命名空间,两者永不相撞;在平台间携带的 `settings.yaml` 也能在两边继续解析。
|
|
31
|
-
|
|
32
|
-
## 词汇
|
|
33
|
-
|
|
34
|
-
`ShellExecRequest`(command、workdir?、timeoutMs?、stdoutMaxBytes?、signal?、stdin?、env?、dshEnv?、sandboxPolicy?)在执行前解析为 `ShellExecSpec`(command、workdir、timeoutMs、stdoutMaxBytes、signal?、stdin?、env?、dshEnv?、sandboxPolicy)。`stdoutMaxBytes` 是受信任前台运行的捕获预算,用于必须解析完整有界 stdout 的消费方;面向模型的 bash 工具不公开该字段。`sandboxPolicy` 在请求上可选,在已解析 spec 上必填但可为 null:它携带完整的每次调用模式与工作区根目录。沙箱工具路径通过 `ctx.sandboxPolicy` 从调用会话解析它;沙箱执行器的直接调用方回退到部署策略,非沙箱执行器则携带该字段但不作限制。
|
|
35
|
-
|
|
36
|
-
每会话沙箱模式覆盖词汇(`'sandbox/mode'` 事件、`effectiveSandboxMode(events)` fold 以及 `setSandboxMode(session, mode)` 写入路径)不位于此处。它是所有强制执行家族共享的策略状态,属于 [`@hasna-internal/kai-sandbox-policy`](../../sandbox/sandbox-policy/)。`run()` 返回 `ShellRunResult`;`start()` 返回 `ShellProcess`,其增量读取与终止方法由 `dsh-tool-bash` 适配为通用任务注册。沙箱执行器会在前台结果与已结算进程句柄上标记 `ShellSandboxInfo`。详见 `src/types.ts` 与 [subsystems/shell.md](../../../docs/subsystems/shell.zh.md)。
|
|
37
|
-
|
|
38
|
-
`stdin` 与普通 `env` 由同进程插件(hooks 桥接、原生插件)设置,用于向 hook 命令提供其 JSON payload 和 `CLAUDE_PROJECT_DIR`/`CLAUDE_PLUGIN_ROOT` 值。`dshEnv` 是受类型限制、仅允许受管 key 的独立受信任 overlay;导出的 `DSH_ENV_PREFIX` 是该 namespace、其 `DshEnvironmentKey` 模板类型、执行器清理、注册表验证、派生内置名称与模型指引的统一来源。模型 bash 使用 `ctx.shellEnv` 收集的当前快照。实现会移除继承的受管 key,再在普通 `env` 之后合并 `dshEnv`,因此省略的当前事实不会回退到陈旧环境状态,`env` 条目也无法顶掉受管值。面向模型的工具不将这三者中的任何一个公开为参数。这三者在已解析 spec 上仍然可选;缺失表示没有输入/overlay。详见 [bash-stdin-env Agent Note](../../../.agents/notes/implemented/architecture/2026-06-30-bash-stdin-env-trusted-plugin-api.zh.md) 与 [会话环境 Agent Note](../../../.agents/notes/implemented/feature/2026-07-10-agent-session-identity-and-log-location.zh.md)。
|
|
39
|
-
|
|
40
|
-
导出的 `parseExitStatus`(连同 `ParsedExitStatus`)是 shell 工具共享渲染约定的另一半:`dsh-tool-bash` 的 `renderResult` 与 `dsh-tool-pwsh` 的 `renderPwshResult` 追加的 `[exit code: N]`/`[killed by signal: X]` marker 的逆解析。两个工具的 `presentResult` 都用它把渲染文本拆成 terminal 卡的输出正文与其退出状态 pill;它放在 Service Definition 中,两个工具便永远不会在 marker 约定上漂移。
|
|
41
|
-
|
|
42
|
-
## 模型体验
|
|
43
|
-
|
|
44
|
-
通过 `dsh-tool-bash` 间接影响;该工具会将执行器输出与沙箱事实转为指引和保留的工具结果 token。
|
|
45
|
-
|
|
46
|
-
#### KV Cache 影响
|
|
47
|
-
|
|
48
|
-
不会直接导致 KV Cache 失效;请求前缀变更由具名消费方负责。
|
|
49
|
-
|
|
50
|
-
## 已知限制与暂缓事项
|
|
51
|
-
|
|
52
|
-
- **没有交互式输入词汇**:`stdin` 只会在 spawn 时写入一次并关闭;seam 不提供向运行中任务继续输入的通道,也没有 PTY 会话概念。
|
|
53
|
-
- **前台超时始终由执行器负责**:seam 上由调用方负责 deadline 的模式已由 [工具调用超时策略 Agent Note](../../../.agents/notes/implemented/architecture/2026-07-07-tool-call-timeout-policy.zh.md) 明确暂缓。
|
package/lib/index.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Service } from "@deepseek-ai/cordis";
|
|
2
|
-
import { settingsNamespace } from "@hasna-internal/kai-settings";
|
|
3
|
-
import { DSH_ENV_PREFIX } from "@hasna-internal/kai-subprocess";
|
|
4
|
-
//#region lib/types/render.js
|
|
5
|
-
/**
|
|
6
|
-
* Shared rendering helpers for the shell tools (`dsh-tool-bash`,
|
|
7
|
-
* `dsh-tool-pwsh`): the exit-status marker contract the tools' renderers
|
|
8
|
-
* emit and the presentation layer parses back.
|
|
9
|
-
* @module @hasna-internal/kai-shell/render
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Split a rendered shell-tool result string into its output body and the
|
|
13
|
-
* structured exit status — the inverse of the `[exit code: N]` /
|
|
14
|
-
* `[killed by signal: X]` markers the shell tools' renderers append. A killed
|
|
15
|
-
* marker yields `signal`; otherwise a non-zero marker yields `exitCode`;
|
|
16
|
-
* absent both means a clean exit 0.
|
|
17
|
-
*
|
|
18
|
-
* The consumed marker is removed from `body` because a terminal presentation
|
|
19
|
-
* shows the exit status as its own pill: leaving the marker in the output
|
|
20
|
-
* would render the exit twice. Other markers (timeout, sandbox denial) carry
|
|
21
|
-
* facts no pill shows, so they stay in the body.
|
|
22
|
-
*
|
|
23
|
-
* Replay only retains the rendered content text, not the original
|
|
24
|
-
* `ShellRunResult`, so terminal presentation must recover the exit pill here.
|
|
25
|
-
* Requiring a leading newline and the end of the string keeps ordinary output
|
|
26
|
-
* that merely ends with marker-like text from matching unless the final line
|
|
27
|
-
* is indistinguishable from a real marker.
|
|
28
|
-
* @param text - rendered model-facing shell-tool result.
|
|
29
|
-
* @returns the marker-free body plus the recovered terminal exit code or signal.
|
|
30
|
-
*/
|
|
31
|
-
function parseExitStatus(text) {
|
|
32
|
-
const signal = /\n\[killed by signal: ([^\]\n]+)\]$/.exec(text);
|
|
33
|
-
if (signal?.[1] !== void 0) return {
|
|
34
|
-
body: text.slice(0, signal.index),
|
|
35
|
-
signal: signal[1]
|
|
36
|
-
};
|
|
37
|
-
const exit = /\n\[exit code: (\d+)\]$/.exec(text);
|
|
38
|
-
if (exit?.[1] !== void 0) return {
|
|
39
|
-
body: text.slice(0, exit.index),
|
|
40
|
-
exitCode: Number(exit[1])
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
body: text,
|
|
44
|
-
exitCode: 0
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region lib/types/index.js
|
|
49
|
-
/**
|
|
50
|
-
* Service Definition for the `ctx.shell` capability seam, covering foreground commands and background process
|
|
51
|
-
* handles. Job ids, ownership, polling, and notices belong to
|
|
52
|
-
* `@hasna-internal/kai-jobs`, keeping executors independent of sessions.
|
|
53
|
-
* @module @hasna-internal/kai-shell
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* Settings namespace of this capability, owned here rather than by either
|
|
57
|
-
* executor family because it names the capability, not an implementation: a
|
|
58
|
-
* host composes exactly one provider of `ctx.shell` (the win32 layer swaps the
|
|
59
|
-
* POSIX rows for the pwsh ones, and mounting both fails loud on a duplicate
|
|
60
|
-
* service registration), so the providers share one namespace without ever
|
|
61
|
-
* registering it twice, and a settings document carried between platforms
|
|
62
|
-
* keeps resolving on both.
|
|
63
|
-
*/
|
|
64
|
-
const SHELL_SETTINGS_NAMESPACE = settingsNamespace("shell");
|
|
65
|
-
/**
|
|
66
|
-
* Abstract bash execution service. Subclass, implement the abstract methods,
|
|
67
|
-
* and load the subclass as a plugin — it registers as `ctx.shell` (one
|
|
68
|
-
* implementation per context; loading a second throws, which is cordis'
|
|
69
|
-
* standard duplicate-service behavior).
|
|
70
|
-
*
|
|
71
|
-
* Implementations must honor these semantics:
|
|
72
|
-
* - {@link run} rejects only for infrastructure failures. Nonzero exits,
|
|
73
|
-
* timeout kills, and abort kills resolve with a {@link ShellRunResult}.
|
|
74
|
-
* - {@link start} returns immediately; no timeout applies to background
|
|
75
|
-
* processes. `done` settles at process close and never rejects; spawn
|
|
76
|
-
* failures settle as `killed` with the error on stderr.
|
|
77
|
-
* - {@link ShellProcess.readOutput} is incremental: consecutive reads never
|
|
78
|
-
* repeat output. Lossy reads report truncation and available spill files.
|
|
79
|
-
* - A still-running background process is stopped and awaited when its
|
|
80
|
-
* owning composition tears down. With the subprocess seam that
|
|
81
|
-
* boundary is `ctx.subprocess` disposal, so a background process survives
|
|
82
|
-
* an executor-only reload.
|
|
83
|
-
*/
|
|
84
|
-
var ShellExecutor = class extends Service {
|
|
85
|
-
constructor(ctx) {
|
|
86
|
-
super(ctx, "shell");
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* The sandbox mode this executor applies by default, or `undefined` when it
|
|
90
|
-
* does not sandbox commands.
|
|
91
|
-
* @returns the configured default sandbox mode, when supported.
|
|
92
|
-
*/
|
|
93
|
-
get sandboxMode() {}
|
|
94
|
-
};
|
|
95
|
-
//#endregion
|
|
96
|
-
export { DSH_ENV_PREFIX, SHELL_SETTINGS_NAMESPACE, ShellExecutor, ShellExecutor as default, parseExitStatus };
|
package/lib/invariant.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/** Package-owned invariant companion for the bash seam. @module @hasna-internal/kai-shell/invariant */
|
|
3
|
-
const PACKAGE_NAME = "@hasna-internal/kai-shell";
|
|
4
|
-
/** Cordis companion plugin name. */
|
|
5
|
-
const name = "shell-invariant";
|
|
6
|
-
/** Service required before the companion can reserve package ownership. */
|
|
7
|
-
const inject = ["invariants"];
|
|
8
|
-
/** No runtime invariant: this stateless Service Definition owns request/result types, while executors and policy own observations. */
|
|
9
|
-
const install = () => {};
|
|
10
|
-
/**
|
|
11
|
-
* Register the bash invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
16
|
-
//#endregion
|
|
17
|
-
export { apply, inject, name };
|
package/lib/types/index.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Service Definition for the `ctx.shell` capability seam, covering foreground commands and background process
|
|
3
|
-
* handles. Job ids, ownership, polling, and notices belong to
|
|
4
|
-
* `@hasna-internal/kai-jobs`, keeping executors independent of sessions.
|
|
5
|
-
* @module @hasna-internal/kai-shell
|
|
6
|
-
*/
|
|
7
|
-
import { Context, Service } from '@deepseek-ai/cordis';
|
|
8
|
-
import type { SandboxMode } from '@hasna-internal/kai-sandbox';
|
|
9
|
-
import type { ShellExecRequest, ShellExecSpec, ShellProcess, ShellRunResult } from './types.ts';
|
|
10
|
-
/**
|
|
11
|
-
* Settings namespace of this capability, owned here rather than by either
|
|
12
|
-
* executor family because it names the capability, not an implementation: a
|
|
13
|
-
* host composes exactly one provider of `ctx.shell` (the win32 layer swaps the
|
|
14
|
-
* POSIX rows for the pwsh ones, and mounting both fails loud on a duplicate
|
|
15
|
-
* service registration), so the providers share one namespace without ever
|
|
16
|
-
* registering it twice, and a settings document carried between platforms
|
|
17
|
-
* keeps resolving on both.
|
|
18
|
-
*/
|
|
19
|
-
export declare const SHELL_SETTINGS_NAMESPACE: import("@hasna-internal/kai-settings").SettingsNamespace;
|
|
20
|
-
export { DSH_ENV_PREFIX } from './types.ts';
|
|
21
|
-
export type { ShellExecRequest, ShellExecSpec, ShellProcess, ShellProcessRead, ShellProcessStatus, ShellRunResult, ShellSandboxInfo, CollectedOutput, DshEnvironment, DshEnvironmentKey, } from './types.ts';
|
|
22
|
-
export { parseExitStatus } from './render.ts';
|
|
23
|
-
export type { ParsedExitStatus } from './render.ts';
|
|
24
|
-
declare module '@deepseek-ai/cordis' {
|
|
25
|
-
interface Context {
|
|
26
|
-
shell: ShellExecutor;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Abstract bash execution service. Subclass, implement the abstract methods,
|
|
31
|
-
* and load the subclass as a plugin — it registers as `ctx.shell` (one
|
|
32
|
-
* implementation per context; loading a second throws, which is cordis'
|
|
33
|
-
* standard duplicate-service behavior).
|
|
34
|
-
*
|
|
35
|
-
* Implementations must honor these semantics:
|
|
36
|
-
* - {@link run} rejects only for infrastructure failures. Nonzero exits,
|
|
37
|
-
* timeout kills, and abort kills resolve with a {@link ShellRunResult}.
|
|
38
|
-
* - {@link start} returns immediately; no timeout applies to background
|
|
39
|
-
* processes. `done` settles at process close and never rejects; spawn
|
|
40
|
-
* failures settle as `killed` with the error on stderr.
|
|
41
|
-
* - {@link ShellProcess.readOutput} is incremental: consecutive reads never
|
|
42
|
-
* repeat output. Lossy reads report truncation and available spill files.
|
|
43
|
-
* - A still-running background process is stopped and awaited when its
|
|
44
|
-
* owning composition tears down. With the subprocess seam that
|
|
45
|
-
* boundary is `ctx.subprocess` disposal, so a background process survives
|
|
46
|
-
* an executor-only reload.
|
|
47
|
-
*/
|
|
48
|
-
export declare abstract class ShellExecutor extends Service {
|
|
49
|
-
constructor(ctx: Context);
|
|
50
|
-
/**
|
|
51
|
-
* The sandbox mode this executor applies by default, or `undefined` when it
|
|
52
|
-
* does not sandbox commands.
|
|
53
|
-
* @returns the configured default sandbox mode, when supported.
|
|
54
|
-
*/
|
|
55
|
-
get sandboxMode(): SandboxMode | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Apply implementation-owned defaults and caps to a request before execution.
|
|
58
|
-
* @param request - the caller's request; omitted fields get this
|
|
59
|
-
* implementation's defaults, capped fields are clamped.
|
|
60
|
-
* @returns the fully-specified spec to hand to {@link run}/{@link start}.
|
|
61
|
-
*/
|
|
62
|
-
abstract resolve(request: ShellExecRequest): ShellExecSpec;
|
|
63
|
-
/**
|
|
64
|
-
* Run a command in the foreground; resolves when it finishes.
|
|
65
|
-
* @param spec - a resolved spec from {@link resolve}, never a raw request.
|
|
66
|
-
* @returns the outcome; nonzero exits, timeout kills, and abort kills
|
|
67
|
-
* resolve with a descriptive result rather than reject.
|
|
68
|
-
*/
|
|
69
|
-
abstract run(spec: ShellExecSpec): Promise<ShellRunResult>;
|
|
70
|
-
/**
|
|
71
|
-
* Start a background process and return its handle immediately.
|
|
72
|
-
* @param spec - a resolved spec from {@link resolve}, never a raw request.
|
|
73
|
-
* @returns the live process handle (reads, kill, quiescence promise).
|
|
74
|
-
*/
|
|
75
|
-
abstract start(spec: ShellExecSpec): ShellProcess;
|
|
76
|
-
}
|
|
77
|
-
export default ShellExecutor;
|
|
78
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** Package-owned invariant companion for the bash seam. @module @hasna-internal/kai-shell/invariant */
|
|
2
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
-
/** Cordis companion plugin name. */
|
|
4
|
-
export declare const name = "shell-invariant";
|
|
5
|
-
/** Service required before the companion can reserve package ownership. */
|
|
6
|
-
export declare const inject: string[];
|
|
7
|
-
/**
|
|
8
|
-
* Register the bash invariant companion.
|
|
9
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
10
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
11
|
-
*/
|
|
12
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
13
|
-
//# sourceMappingURL=invariant.d.ts.map
|
package/lib/types/render.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared rendering helpers for the shell tools (`dsh-tool-bash`,
|
|
3
|
-
* `dsh-tool-pwsh`): the exit-status marker contract the tools' renderers
|
|
4
|
-
* emit and the presentation layer parses back.
|
|
5
|
-
* @module @hasna-internal/kai-shell/render
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* The exit status recovered from a rendered result, with the output body that
|
|
9
|
-
* status was split off from.
|
|
10
|
-
*/
|
|
11
|
-
export type ParsedExitStatus = {
|
|
12
|
-
body: string;
|
|
13
|
-
} & ({
|
|
14
|
-
exitCode: number;
|
|
15
|
-
} | {
|
|
16
|
-
signal: string;
|
|
17
|
-
});
|
|
18
|
-
/**
|
|
19
|
-
* Split a rendered shell-tool result string into its output body and the
|
|
20
|
-
* structured exit status — the inverse of the `[exit code: N]` /
|
|
21
|
-
* `[killed by signal: X]` markers the shell tools' renderers append. A killed
|
|
22
|
-
* marker yields `signal`; otherwise a non-zero marker yields `exitCode`;
|
|
23
|
-
* absent both means a clean exit 0.
|
|
24
|
-
*
|
|
25
|
-
* The consumed marker is removed from `body` because a terminal presentation
|
|
26
|
-
* shows the exit status as its own pill: leaving the marker in the output
|
|
27
|
-
* would render the exit twice. Other markers (timeout, sandbox denial) carry
|
|
28
|
-
* facts no pill shows, so they stay in the body.
|
|
29
|
-
*
|
|
30
|
-
* Replay only retains the rendered content text, not the original
|
|
31
|
-
* `ShellRunResult`, so terminal presentation must recover the exit pill here.
|
|
32
|
-
* Requiring a leading newline and the end of the string keeps ordinary output
|
|
33
|
-
* that merely ends with marker-like text from matching unless the final line
|
|
34
|
-
* is indistinguishable from a real marker.
|
|
35
|
-
* @param text - rendered model-facing shell-tool result.
|
|
36
|
-
* @returns the marker-free body plus the recovered terminal exit code or signal.
|
|
37
|
-
*/
|
|
38
|
-
export declare function parseExitStatus(text: string): ParsedExitStatus;
|
|
39
|
-
//# sourceMappingURL=render.d.ts.map
|
package/lib/types/types.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execution types for the bash executor seam. Background job semantics belong
|
|
3
|
-
* to `@hasna-internal/kai-jobs`; this seam exposes only process handles. The
|
|
4
|
-
* managed-environment and captured-output vocabulary is owned by the
|
|
5
|
-
* subprocess seam and re-exported here so bash consumers keep one import
|
|
6
|
-
* root.
|
|
7
|
-
* @module dsh-shell/types
|
|
8
|
-
*/
|
|
9
|
-
import type { SandboxEnforcement, SandboxExecutionPolicy, SandboxMode } from '@hasna-internal/kai-sandbox';
|
|
10
|
-
import type { CollectedOutput, DshEnvironment } from '@hasna-internal/kai-subprocess';
|
|
11
|
-
export { DSH_ENV_PREFIX } from '@hasna-internal/kai-subprocess';
|
|
12
|
-
export type { CollectedOutput, DshEnvironment, DshEnvironmentKey } from '@hasna-internal/kai-subprocess';
|
|
13
|
-
/**
|
|
14
|
-
* Sandbox facts for one run, present iff a sandboxing executor handled it.
|
|
15
|
-
* Facts are reported independently of process exit status so callers can
|
|
16
|
-
* distinguish command failures from policy denials and runner failures.
|
|
17
|
-
*/
|
|
18
|
-
export interface ShellSandboxInfo {
|
|
19
|
-
/** The mode the command actually ran under. */
|
|
20
|
-
mode: SandboxMode;
|
|
21
|
-
/** Whether the sandbox denied a file operation. */
|
|
22
|
-
denied: boolean;
|
|
23
|
-
/** How completely the selected runner enforced the requested mode. */
|
|
24
|
-
enforcement?: SandboxEnforcement;
|
|
25
|
-
/** Whether the sandbox runner failed before the command could run. */
|
|
26
|
-
runnerFailed?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* A caller's execution REQUEST: `workdir` and `timeoutMs` are optional and
|
|
30
|
-
* filled by {@link ShellExecutor.resolve} from the implementation's config.
|
|
31
|
-
* This is the model-/plugin-facing shape; pass it to `resolve()` to obtain a
|
|
32
|
-
* fully-resolved {@link ShellExecSpec}.
|
|
33
|
-
*/
|
|
34
|
-
export interface ShellExecRequest {
|
|
35
|
-
command: string;
|
|
36
|
-
/** Working directory override (default: implementation-configured). */
|
|
37
|
-
workdir?: string | undefined;
|
|
38
|
-
/** Timeout override in milliseconds (implementations cap it). */
|
|
39
|
-
timeoutMs?: number | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Foreground stdout capture budget in bytes. Absent uses the executor's
|
|
42
|
-
* default output cap. Trusted in-process consumers use this when they must
|
|
43
|
-
* parse complete stdout up to their own bounded limit; the model-facing bash
|
|
44
|
-
* tool does not expose it as a parameter.
|
|
45
|
-
*/
|
|
46
|
-
stdoutMaxBytes?: number | undefined;
|
|
47
|
-
/** Abort signal — implementations kill the command when it fires. */
|
|
48
|
-
signal?: AbortSignal | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Bytes to write to the command's stdin, then close it. Absent leaves stdin
|
|
51
|
-
* closed/empty (the default for model-driven tool calls). Set by in-process
|
|
52
|
-
* plugins (e.g. the hooks bridges, which write a hook command's JSON payload
|
|
53
|
-
* to its stdin); the model-facing bash tool does not expose it as a parameter
|
|
54
|
-
* (a model that needs stdin uses shell syntax like a heredoc or a pipe).
|
|
55
|
-
*/
|
|
56
|
-
stdin?: string | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Ordinary environment entries for the command, merged after the credential
|
|
59
|
-
* scrub. Managed facts belong in {@link dshEnv}, which merges after this
|
|
60
|
-
* map, so an entry here can never displace one. Set by in-process plugins
|
|
61
|
-
* (the hooks bridges set `CLAUDE_PROJECT_DIR`, `CLAUDE_PLUGIN_ROOT`, …); the
|
|
62
|
-
* model-facing bash tool does not expose it as a parameter.
|
|
63
|
-
*/
|
|
64
|
-
env?: Record<string, string> | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Harness-owned `DSH_*` variables for this execution (typed to managed
|
|
67
|
-
* keys). Executors discard ambient `DSH_*` entries before merging this
|
|
68
|
-
* snapshot last, so an unavailable current fact cannot inherit a stale
|
|
69
|
-
* value from the harness process and a caller {@link env} entry cannot
|
|
70
|
-
* displace a managed one.
|
|
71
|
-
*/
|
|
72
|
-
dshEnv?: DshEnvironment | undefined;
|
|
73
|
-
/** Fully resolved per-call sandbox policy; sandboxing executors default it. */
|
|
74
|
-
sandboxPolicy?: SandboxExecutionPolicy | undefined;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A resolved execution spec. {@link ShellExecutor.resolve} fills and caps the
|
|
78
|
-
* required fields; {@link ShellExecutor.start} ignores `timeoutMs` because
|
|
79
|
-
* background processes have no executor timeout.
|
|
80
|
-
*/
|
|
81
|
-
export interface ShellExecSpec {
|
|
82
|
-
command: string;
|
|
83
|
-
workdir: string;
|
|
84
|
-
timeoutMs: number;
|
|
85
|
-
/**
|
|
86
|
-
* Resolved foreground stdout capture budget in bytes. `run()` uses it for
|
|
87
|
-
* stdout; background jobs and stderr keep the executor's own output cap.
|
|
88
|
-
*/
|
|
89
|
-
stdoutMaxBytes: number;
|
|
90
|
-
/** Abort signal — implementations kill the command when it fires. */
|
|
91
|
-
signal?: AbortSignal | undefined;
|
|
92
|
-
/** Bytes to write to stdin before closing it; absent means no stdin. */
|
|
93
|
-
stdin?: string | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Ordinary environment entries carried through from
|
|
96
|
-
* {@link ShellExecRequest.env}; {@link dshEnv} still merges after them.
|
|
97
|
-
* OPTIONAL on the spec for the same reason as `stdin`: absent means no
|
|
98
|
-
* ordinary extra environment.
|
|
99
|
-
*/
|
|
100
|
-
env?: Record<string, string> | undefined;
|
|
101
|
-
/** Managed `DSH_*` snapshot (typed to managed keys); merges after {@link env}. */
|
|
102
|
-
dshEnv?: DshEnvironment | undefined;
|
|
103
|
-
/** Resolved sandbox policy; ignored by executors that do not confine. */
|
|
104
|
-
sandboxPolicy: SandboxExecutionPolicy | undefined;
|
|
105
|
-
}
|
|
106
|
-
/** The outcome of one completed (or killed) foreground run. */
|
|
107
|
-
export interface ShellRunResult {
|
|
108
|
-
/** Exit code; null when the process died from a signal. */
|
|
109
|
-
exitCode: number | null;
|
|
110
|
-
/** Terminating signal (e.g. 'SIGTERM'); null on normal exit. */
|
|
111
|
-
signal: NodeJS.Signals | null;
|
|
112
|
-
/**
|
|
113
|
-
* True when the executor's own timeout was the FIRST cause to cut the command
|
|
114
|
-
* short. Mutually exclusive with {@link aborted}: one fused deadline drives
|
|
115
|
-
* both the timeout and the caller's cancellation, so a timeout and an abort
|
|
116
|
-
* racing before process close report the single first-abort cause, not both
|
|
117
|
-
* (see the [timeout-library Agent Note](../../../../.agents/notes/implemented/architecture/2026-07-06-timeout-deadline-library.md)).
|
|
118
|
-
*/
|
|
119
|
-
timedOut: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* True when the caller's `AbortSignal` was the FIRST cause to kill the command
|
|
122
|
-
* (and it was not the executor's own timeout). Mutually exclusive with
|
|
123
|
-
* {@link timedOut} — see there for the first-cause classification.
|
|
124
|
-
*/
|
|
125
|
-
aborted: boolean;
|
|
126
|
-
/** The effective timeout applied to this run (after defaulting/capping). */
|
|
127
|
-
timeoutMs: number;
|
|
128
|
-
stdout: CollectedOutput;
|
|
129
|
-
stderr: CollectedOutput;
|
|
130
|
-
/** Sandbox execution facts, absent for an unsandboxed executor. */
|
|
131
|
-
sandbox?: ShellSandboxInfo;
|
|
132
|
-
}
|
|
133
|
-
/** Lifecycle of a background process. */
|
|
134
|
-
export type ShellProcessStatus = 'running' | 'completed' | 'killed';
|
|
135
|
-
/** One incremental {@link ShellProcess.readOutput} read. */
|
|
136
|
-
export interface ShellProcessRead {
|
|
137
|
-
/** Output produced since the previous read (stderr in a marked section). */
|
|
138
|
-
delta: string;
|
|
139
|
-
/** True when truncation dropped unread bytes the delta cannot include. */
|
|
140
|
-
lossy: boolean;
|
|
141
|
-
/** Full stdout spill file, when stdout truncation occurred and a safe path is available. */
|
|
142
|
-
stdoutSpillPath?: string;
|
|
143
|
-
/** Full stderr spill file, when stderr truncation occurred and a safe path is available. */
|
|
144
|
-
stderrSpillPath?: string;
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* A background process handle returned by {@link ShellExecutor.start}. It is the
|
|
148
|
-
* only access path; buffered output remains readable after exit. Composition
|
|
149
|
-
* teardown (the subprocess service's disposal) kills running processes and
|
|
150
|
-
* awaits {@link done}; an executor-only reload leaves them running.
|
|
151
|
-
*/
|
|
152
|
-
export interface ShellProcess {
|
|
153
|
-
/** Process lifecycle state (settled exactly once). */
|
|
154
|
-
status: ShellProcessStatus;
|
|
155
|
-
/** Exit code once finished (null = killed by signal / still running). */
|
|
156
|
-
exitCode: number | null;
|
|
157
|
-
/** Terminating signal name, when signal-killed. */
|
|
158
|
-
signal: NodeJS.Signals | null;
|
|
159
|
-
/** Resolves when the underlying process closes (never rejects — a spawn failure settles as `killed` with the error on stderr). */
|
|
160
|
-
readonly done: Promise<void>;
|
|
161
|
-
/** Sandbox facts, stamped once a confined process settles. */
|
|
162
|
-
sandbox?: ShellSandboxInfo;
|
|
163
|
-
/**
|
|
164
|
-
* Read output produced since the previous read (consuming — consecutive
|
|
165
|
-
* reads never re-deliver). Reads that lost data flag `lossy` and point at
|
|
166
|
-
* full-stream spill files when available.
|
|
167
|
-
*/
|
|
168
|
-
readOutput(): ShellProcessRead;
|
|
169
|
-
/**
|
|
170
|
-
* Kill the process group. Returns false when it had already finished
|
|
171
|
-
* (no-op); idempotent.
|
|
172
|
-
*/
|
|
173
|
-
kill(): boolean;
|
|
174
|
-
}
|
|
175
|
-
//# sourceMappingURL=types.d.ts.map
|