Skip to content

[Grok/dsh 34] 插件内容启停与扩展视图 #166

Description

@Blackman99

Parent

#132

Ticket: 34

Status: ready-for-agent

User Stories: 37, 38, 41(见父规格)

What to build

用户启用已安装插件后能实际使用它提供的规则、命令、Skills 和 Hooks,停用后相应能力撤回。

Acceptance criteria

  • 插件贡献经现有统一发现与执行入口生效,不创建另一套权限或命令处理系统。
  • 重复命名、部分失败、版本更新、停用与移除在目录和实际执行中一致。
  • 执行仍依照项目信任和明确权限;安装授权不等于运行任意工具的授权。
  • 通过包含多种贡献的临时插件验证用户操作到 dsh 行为;后续 MCP/工作流贡献由对应任务补验。

Blocked by

Delivery contract

用户于2026-09-20批准当前测试与任务拆分。按父规格的已安装产物/真实终端和公开协议测试验收;实际实现须带适用的文档、Changeset及必要检查。ready-for-agent表示任务已定义,不表示前置任务已完成,也不授权自动开始本轮实施、购买付费资源或发布软件版本。

Activity

  1. Blackman99 commented on Sep 25, 2026

    @Blackman99
    OwnerAuthor

    已集成到 rewrite/grok-dsh-20260920:5866e2a

    功能

    • plugin enable|disable(及 /plugins 中的 Space)让已安装且受信任的插件真正生效或撤回:rules、skills、commands 通过现有资产发现合并(/plugin:name,无原生/内置/其他插件冲突时保留裸名),agents 以 plugin:agent 类型加入子代理策略,command hooks 交给 dsh 的 hook runner(设置 GROK_PLUGIN_ROOT / GROK_PLUGIN_DATA 及 CLAUDE_* 别名,数据目录 $GROK_HOME/plugin-data/<name>)。
    • 项目插件还需要 workspace trust;未受信任的安装或项目保持 blocked。启用不授予任何工具权限。
    • 运行中的会话在下一次提示时生效:插件 hooks 或 agent 策略变化时替换 dsh 子进程并在同一会话上恢复;update / disable / uninstall 会撤回旧内容。
    • manifest 的 rules/skills/commands/agents/hooks 路径限制在插件根目录内;内联 hooks、非 command handler、重名、保留命名空间冲突、缺失根目录都作为逐插件问题报告,一个坏插件不会隐藏其他插件。
    • plugin list --json / inspect / 展开的 /plugins 行显示状态(active/disabled/blocked/missing/shadowed)、贡献摘要和问题;list --json 保留 status: "installed",新增 state、stateDetail、contributions。
    • 文档:README.md、README.zh.md、CONTEXT.md、CONTRIBUTING.md、packages/cli/README.md;changeset .changeset/rust-plugin-content.md(codsh-cli / codsh-bundle patch)。
    • 新测试:Rust 单元测试(assets 2 个、plugin 5 个、config 1 个),scripts/rust-plugin-content.spec.mjs(2 个单元 + 2 个真实 dsh e2e,keyless mock + 临时 home),scripts/rust-plugin-content-pty-test.py(Linux/macOS,已加入 test:rust:pty)。

    检查(Linux,干净 env,真实计数)

    • pnpm typecheck:通过。
    • pnpm test:89 个文件,2368 通过 / 1 失败(已知的 reference-evidence.spec.mjs "drives interactive help" 在负载下 5s 超时;单独以 --testTimeout=60000 运行 11/11 通过)。新 spec 4/4,rust-hooks.spec.mjs 5/5。
    • cargo test --locked --workspace --no-fail-fast:530+498+42+61+2+379 通过,4 个失败均为已知:filesystem_sandbox 的 strict_requests_network_isolation...、trusted_project_custom_applies...,以及不稳定的 privacy::drafts_stay_local...、voice::substitute_route...(单独重跑均通过)。
    • cargo fmt --check:通过。
    • cargo clippy ... --all-targets -- -D warnings:仅有既有的 filesystem_sandbox.rs 未使用 tail_marker 与 needless return;加 -A dead_code -A clippy::needless_return 后通过。
    • pnpm run build:rust 后的 PTY:rust-plugin-content-pty-test.py、rust-subagent-pty-test.py、rust-plan-pty-test.py、rust-queue-pty-test.py 均通过。

    未验证

    • 仅 macOS 的 scripts/rust-*-pty-test.py(如 plugin、hook、permission、assets、turn、resume)以及安装产物脚本未在 Linux 上运行。
    • 插件 MCP 服务器与 workflow 贡献留给各自的 ticket(MCP 仅检测并展示,不启动)。

    main、npm、默认版本和 PR #213 均未改动;未发布、未 release。解锁后续:#195(Ship)、#204、#205。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions