{"_id":"@elinpf/dsh-ops-kubectl","_rev":"2-b2ac3974d75db6079c6b8142ad5e7296","name":"@elinpf/dsh-ops-kubectl","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@elinpf/dsh-ops-kubectl","version":"0.1.0","license":"MIT","_id":"@elinpf/dsh-ops-kubectl@0.1.0","maintainers":[{"name":"elinpf","email":"365433079@qq.com"}],"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"dist":{"shasum":"25aa525ecef70e79d4e703a33c2d6ce795e38008","tarball":"https://registry.npmjs.org/@elinpf/dsh-ops-kubectl/-/dsh-ops-kubectl-0.1.0.tgz","fileCount":11,"integrity":"sha512-dvNkX7oObstQ8Zrfb46TwK7Hm0of7oX0d3W4Fp2sat4KBu2oG0+ZFKSXFWVRxKogfhH1/hM6SwRRqmBXrbvbjQ==","signatures":[{"sig":"MEQCIFvi7LS2pZ01FVO1mnOK0sUTD0NXfBfpVGIT5WbHZlH6AiAQdtiDy6DX7nQySfyzqlNXM6mmXYkxKIEkip6ESuKWag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20442},"main":"lib/index.js","type":"module","_from":"file:elinpf-dsh-ops-kubectl-0.1.0.tgz","types":"lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"./types":{"types":"./lib/types.d.ts","default":"./lib/types.js"},"./invariant":{"types":"./lib/invariant.d.ts","default":"./lib/invariant.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"elinpf","email":"365433079@qq.com"},"_resolved":"/tmp/cd60e7c63a479fc3ce02b347a227ebcc/elinpf-dsh-ops-kubectl-0.1.0.tgz","_integrity":"sha512-dvNkX7oObstQ8Zrfb46TwK7Hm0of7oX0d3W4Fp2sat4KBu2oG0+ZFKSXFWVRxKogfhH1/hM6SwRRqmBXrbvbjQ==","_npmVersion":"10.9.8","description":"kubectl tool consumer of the ops-access seam — resolves k8s profiles into kubeconfig paths and runs kubectl via ctx.shell; list_access surfaces registered profiles without secret fields.","directories":{},"_nodeVersion":"22.23.2","dependencies":{"@deepseek-ai/schemastery":"^3.18.1","@elinpf/dsh-ops-shell-tool":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.11","typescript":"^5.4.0","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-shell":"0.0.1-rc.5","@deepseek-ai/dsh-tools":"0.0.1-rc.1","@elinpf/dsh-ops-access":"0.1.0"},"peerDependencies":{"@deepseek-ai/cordis":"^4.0.1","@deepseek-ai/dsh-tools":"^0.0.1-rc.1","@elinpf/dsh-ops-access":"^0.1.0","@deepseek-ai/dsh-invariants":"^0.0.1-rc.1"},"_npmOperationalInternal":{"tmp":"tmp/dsh-ops-kubectl_0.1.0_1788320342705_0.18910415975519768","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @elinpf/dsh-ops-tool-kubectl — this name is no longer maintained."}},"time":{"created":"2026-09-02T03:39:02.446Z","modified":"2026-09-02T03:58:49.999Z","0.1.0":"2026-09-02T03:39:02.838Z"},"license":"MIT","description":"kubectl tool consumer of the ops-access seam — resolves k8s profiles into kubeconfig paths and runs kubectl via ctx.shell; list_access surfaces registered profiles without secret fields.","maintainers":[{"name":"elinpf","email":"365433079@qq.com"}],"readme":"# @elinpf/dsh-ops-kubectl\n\nops-access 能力缝的 kubectl 消费工具 — 把 `k8s` profile 解析成 kubeconfig 路径并通过 `ctx.shell` 执行 kubectl；另有 `list_access` 工具列出已注册 profile(不含任何凭据字段)。\n\n## 功能\n\n注册两个面向模型的工具:\n\n- **`kubectl`** — 每次调用按名字解析一个 `k8s` access profile,把 profile 的 `--kubeconfig` 路径注入后经本地 shell 执行子命令。实际执行的命令带真实路径;模型可见的结果里显示 `<id@tier:field>` 凭据引用,秘密不会进入日志或模型上下文。\n- **`list_access`** — 把 `ctx.opsAccess.listAll()` 按 kind 分组,只显示信封字段(name、displayName、description、environment)加各 tier 就绪状态(`ro`/`rw`)和能力核验标注。profile 的 `fields`(路径、连接参数)永不进入工具输出。`help: true` 返回注册表管理文档。\n\n## 设计要点\n\n- **瘦消费者,共享机制。** 本包只提供四个身份要素 — 工具名、解析 kind(`k8s`)、profile 参数名(`cluster`)、`buildCommand`。标准结果形状(`{ exitCode, stdout, stderr, command, error? }`)、输出 schema、render 和逐次解析的执行模板(默认 30s 超时、信号死亡归一为 exitCode -1)都在 `@elinpf/dsh-ops-shell-tool`,保证 kubectl/ceph/ssh 三个工具行为一致。\n- **逐次解析,绝不缓存。** ops-access 缝在 `execute` 内通过 `ctx.get('opsAccess')` 获取 — 不做静态 inject、不缓存 — 注册表改完即生效,也不会在加载器里和兄弟服务死锁。\n- **无会话状态。** 工具不追加会话事件、不拥有 projection,每次调用互相独立。`./invariant` 子路径只带一个\"无运行时 invariant\"的伴生插件,用于在 invariants 服务上登记包归属。\n\n## 配置\n\n```yaml\n- id: tool-ops-kubectl\n  name: '@elinpf/dsh-ops-kubectl'\n  config:\n    timeoutMs: 30000   # kubectl 单次调用的 shell 超时(毫秒);集群慢可调大\n```\n\n## 子路径导出\n\n- `@elinpf/dsh-ops-kubectl/types` — 纯类型(`ListedProfile`、`ListAccessResult`),零运行时代码。\n- `@elinpf/dsh-ops-kubectl/invariant` — invariant 伴生插件。\n\n## 测试\n\n```sh\nnpm run build     # tsc → lib/\nnpx vitest run    # 单测用 mock context 驱动真实插件:\n                  # kubectl 正常路径 + 失败回退、render 纯函数性、\n                  # list_access 分组与 no-fields 保证、\n                  # 导出形态、HMR 卸载(disposer 清空注册表)\n```\n","readmeFilename":"README.zh.md"}