Skip to content

feat: Grok Build (grok) agent support — detection, extensions, config scan - #125

Open
linhai0872 wants to merge 4 commits into
RealZST:mainfrom
linhai0872:feat/grok-build-agent-support
Open

feat: Grok Build (grok) agent support — detection, extensions, config scan#125
linhai0872 wants to merge 4 commits into
RealZST:mainfrom
linhai0872:feat/grok-build-agent-support

Conversation

@linhai0872

@linhai0872 linhai0872 commented Aug 25, 2026

Copy link
Copy Markdown

Adds Grok Build (grok) as the 13th supported agent. Closes #124.

Source-backed against xai-org/grok-build @ c2ad97f. Home is $GROK_HOME verbatim when non-empty, otherwise ~/.grok. Detection never creates the directory.

What's included

Detection & layout

  • User home: $GROK_HOME / ~/.grok
  • Project marker: .grok
  • Writes stay on native Grok paths (.grok/skills, .grok/config.toml, .grok/hooks/, .grok/plugins/)
  • .agents/skills is a shared read-only alias only — Codex/Gemini keep ownership
  • .claude / .cursor contents are not attributed to Grok
  • auth.json and mcp_credentials.json are never scanned

Skills / MCP / Hooks / Plugins

  • Skills: $GROK_HOME/skills and project .grok/skills
  • MCP: TOML [mcp_servers.<name>] with headers (not Codex http_headers); type = "sse" is SSE, otherwise URL is HTTP
  • Native MCP toggle: personal disable writes user disabled_mcp_servers (+ user entry enabled when present) and does not rewrite the shared project file. Enable clears the user list and unsticks a winning project enabled = false
  • Hooks: Claude-like JSON; only command handlers are scanned/managed. HTTP handlers still occupy Grok's hook index so spec names stay aligned with upstream (global/session-start:pre_tool_use[0].hooks[1])
  • Hook toggle: $GROK_HOME/disabled-hooks using the real spec.name
  • Hook prefix: only $GROK_HOME/hooks is global/; a project under a custom $GROK_HOME stays project/
  • SubagentEnd uses upstream's subagent_stop display token and shares one group-index sequence
  • Plugins: $GROK_HOME/plugins, installed-plugins, and project .grok/plugins; stable id {scope}/{hex8}/{name}; toggle via [plugins].enabled / [plugins].disabled (user + project lists merged, disabled wins); default disabled; delete removes the directory and both lists. Project plugin toggle writes the user lists only

Project scope & configs

  • Project MCP/hooks/skills/plugins/rules/settings/subagents/memory/commands
  • Settings: config.toml, pager.toml only
  • Memory: one layer under $GROK_HOME/memory plus project .grok/memory/*.md; nested memory/index/ is not claimed

Frontend & docs

  • AGENT_ORDER / display name Grok Build, filter color, onboarding scatter, reduced-motion mascot
  • Mascot is the LobeHub Icons grok.svg mark (currentColor + --mascot-icon-color)
  • README / README.zh-CN: 12 → 13, capability matrix, CLI example

Known limitation

HTTP hooks are outside HarnessKit's current HookEntry command model. This PR only scans and toggles command hooks. HTTP handlers are skipped as entries but still counted in Grok's hook index so disable names stay correct.

Verification

  • npm test: 307 passed
  • npm run build: tsc + vite succeeded
  • cargo test --workspace: passed (after frontend dist/ build, matching CI)
  • cargo test -p hk-core --lib grok (25) and cargo test -p hk-core --test toggle_integration grok (5) passed
  • Isolated $GROK_HOME smoke (grok 1.0.5 + hk):
    • hk status1 detected (grok)
    • hk list --agent grok → skill / stdio+HTTP MCP / plugin / command hook
    • hk disable / hk enable echo → user disabled_mcp_servers round-trip; theme and unrelated MCP headers kept
    • plugin toggle writes stable id user/<hex8>/demo-plugin
    • grok mcp list and grok inspect read the same home (stdio echo, HTTP linear, command hook, demo skill). Auth files were not copied or printed.

Screenshots

Overview

Agent detail

Extensions filter

Native Skills, MCP, command hooks, plugins, and project scope, with
personal MCP disable that never rewrites shared project files.

Closes RealZST#124
Replace the homemade spark with the official grok.svg path, scan project
.grok/plugins, keep SubagentEnd spec names unique, and only treat
$GROK_HOME/hooks as global.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(agents): add Grok Build (grok) agent support

2 participants