@elinpf/dsh-ops-tool-ceph 0.1.7 → 0.2.0

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 CHANGED
@@ -10,6 +10,7 @@ The model calls `ceph` with a `cluster` (profile name) and a `command`. The tool
10
10
 
11
11
  - **Thin consumer, shared machinery.** This package supplies only four identity pieces — tool name, resolved kind (`ceph`), profile-arg name (`cluster`), and `buildCommand`. Everything else (result shape, output schema, render, resolve-per-call execute template, timeout and signal-death normalization) lives in `@elinpf/dsh-ops-shell-tool`, so the three consumer tools (`kubectl` / `ceph` / `ssh`) cannot drift apart.
12
12
  - **First word picks the binary.** `rbd` and `rados` are SEPARATE binaries, not ceph subcommands — `ceph rbd ls` is a mon-side "no valid command found". The command's first word selects from the allowlist `[ceph, rbd, rados]`; a bare word is treated as a ceph subcommand.
13
+ - **One call = one command.** Shell composition (`;`, `&&`, `||`, backticks, `$()`, newlines) is rejected with a teaching error before execution — everything after such an operator would run as a NEW local command without the ceph prefix and credentials, failing as a misleading `xxx: command not found` (a real session hit this 8+ times, 2026-09-10). A single `|` pipe stays allowed: it filters the output locally. A known-slow command (e.g. `rados ls` on a large pool) can raise the per-call ceiling with `timeoutSec` (1–600 s).
13
14
  - **Boundary errors over misleading ones.** Host-local ceph-ecosystem binaries (`mount.ceph`, `ceph-fuse`, `ceph-volume`, `rbd-nbd`, …) are explicitly NOT wrapped; such a call fails with a clear message pointing at the `ssh` tool instead of the mon's confusing error.
14
15
  - **stderr noise filtering.** The two known "no keyring under /etc/ceph" warnings (pure noise when credentials arrive via injected `--keyring`) are matched exactly and dropped; every other stderr line passes through verbatim.
15
16
  - **No secret material in band.** Profiles carry only paths and connection parameters; file paths become `<id@tier:field>` tokens in the assembled command, and the cephx entity name (not secret) stays inline. Read-only enforcement happens at the mon/osd via the credential's caps, never in this tool.
package/README.zh.md CHANGED
@@ -10,6 +10,7 @@ DeepSeek Harness 运维模式下的 `ceph` 工具 — 通过 ops-access 接缝
10
10
 
11
11
  - **薄消费者,共享机制。** 本包只提供四件身份要素:工具名、解析类型(`ceph`)、档案参数名(`cluster`)、`buildCommand`。其余全部(结果形态、输出 schema、渲染、逐次解析的执行模板、超时与信号死亡归一化)都在 `@elinpf/dsh-ops-shell-tool`,保证三个消费工具(`kubectl` / `ceph` / `ssh`)不会各自漂移。
12
12
  - **首词选二进制。** `rbd` 和 `rados` 是独立二进制,不是 ceph 子命令 — `ceph rbd ls` 只会在 mon 侧报 "no valid command found"。按命令首词在白名单 `[ceph, rbd, rados]` 中选择;裸词视为 ceph 子命令。
13
+ - **一次调用一条命令。** shell 组合符(`;`、`&&`、`||`、反引号、`$()`、换行)在执行前被拒并给出教学式报错——组合符之后的内容会作为不带 ceph 前缀和凭据的新本地命令裸奔,报出误导性的 `xxx: command not found`(真实会话中重复踩了 8+ 次,2026-09-10)。单个 `|` 管道仍然允许(本地过滤输出)。已知慢的命令(如大池 `rados ls`)可用 `timeoutSec`(1–600 秒)放宽单次超时。
13
14
  - **边界错误优于误导错误。** 跑在宿主机本地的 ceph 生态二进制(`mount.ceph`、`ceph-fuse`、`ceph-volume`、`rbd-nbd` 等)明确不包装;这类调用直接报清晰错误并指向 `ssh` 工具,而不是让 mon 的误导性报错带偏排查。
14
15
  - **stderr 噪音过滤。** 两条已知的" /etc/ceph 下找不到 keyring "警告(凭证都经注入的 `--keyring` 到达,纯属噪音)按精确模式剔除;其余 stderr 行原样透传。
15
16
  - **秘密不经过工具。** 档案只携带路径和连接参数;文件路径在拼装命令中变成 `<id@tier:field>` 令牌,cephx 实体名(非秘密)保持内联。只读强制由凭证 caps 在 mon/osd 侧执行,工具本身不做。
package/lib/index.js CHANGED
@@ -44,6 +44,8 @@ const NOT_WRAPPED = ['mount', 'umount', 'mount.ceph', 'ceph-fuse', 'ceph-volume'
44
44
  export function apply(ctx, config) {
45
45
  registerProfiledShellTool(ctx, {
46
46
  timeoutMs: config.timeoutMs,
47
+ perCallTimeout: true,
48
+ rejectShellComposition: true,
47
49
  name: 'ceph',
48
50
  kind: 'ceph',
49
51
  targetParam: 'cluster',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elinpf/dsh-ops-tool-ceph",
3
- "version": "0.1.7",
3
+ "version": "0.2.0",
4
4
  "description": "ceph tool consumer of the ops-access seam — resolves ceph profiles and runs commands via ctx.shell, injecting credential paths automatically.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@deepseek-ai/schemastery": "^3.18.1",
37
- "@elinpf/dsh-ops-shell-tool": "^0.1.7"
37
+ "@elinpf/dsh-ops-shell-tool": "^0.2.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@deepseek-ai/cordis": "^4.0.1"
@@ -45,7 +45,7 @@
45
45
  "@deepseek-ai/dsh-tools": "0.0.1-rc.1",
46
46
  "typescript": "^5.4.0",
47
47
  "vitest": "^4.1.11",
48
- "@elinpf/dsh-ops-access": "0.1.7"
48
+ "@elinpf/dsh-ops-access": "0.2.0"
49
49
  },
50
50
  "license": "MIT",
51
51
  "publishConfig": {