feat(plugin): add the grok-bot Agent Bundle plugin (#25) - #27
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 13b7f315c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "gbot": "node src/cli.js", | ||
| "release": "changeset publish", | ||
| "test": "node --test" | ||
| "test": "node --test \"test/**/*.test.js\"" |
There was a problem hiding this comment.
Keep the test command compatible with Node 18
When contributors use Node 18, which remains supported by the package's engines field, the quoted ** is passed directly to Node and older test-runner versions treat it as a path rather than expanding it, causing npm test to fail without running tests. The Node 18 test-runner documentation describes positional arguments as test-file paths; CI currently uses Node 24, so it does not expose this incompatibility. Use a Node-18-compatible file expansion or raise the minimum Node version.
Useful? React with 👍 / 👎.
| "gbot": "node src/cli.js", | ||
| "release": "changeset publish", | ||
| "test": "node --test" | ||
| "test": "node --test \"test/**/*.test.js\"" |
There was a problem hiding this comment.
Run the new plugin checks in CI
Add a CI step that installs the plugin/ dependencies and runs its check script. The Test step in .github/workflows/ci.yml only runs this root npm test, and this new glob explicitly excludes plugin/tests, so none of the added route tests, validation, build, or typecheck gates execute on pull requests; a broken plugin can therefore merge while Package CI remains green.
Useful? React with 👍 / 👎.
0a991e8 to
905f0b7
Compare
The plugin under plugin/ carries rstest .test.ts files that Node's default test discovery would otherwise pick up and fail on.
Two MCP tools on a grok-bot server, gbot_send and gbot_thread, wrap the gateway client in src/gateway.js through a file:.. dependency so the built artifact bundles it and needs no gbot on PATH. A talk-to-grok-bot skill tells agents when to ping a bot and how to word the message.
…e plugin in CI Review follow-ups: tool errors pass through the CLI's Bearer redaction before MCP prints them; the thread normalizer accepts the same containers and text keys as formatTranscript and defaults to 40 entries like the CLI; npm test uses a shell glob so Node 18 and 20 still find test/; CI installs and checks plugin/ on Node 24.
src/transcript.js owns entryText and transcriptEntries so gbot_thread and formatTranscript read the same shapes. entryText now also reads a bot reply's message.content, which gbot thread previously rendered empty.
905f0b7 to
fbd3b09
Compare
Why
Codex, Claude Code, and Cursor agents need a way to reach Grok Bot without a global
gbotinstall. The plugin underplugin/is an Agent Bundle plugin that exposes the existing gateway client as two MCP tools and a skill, built from this repository so a gateway fix ships to the plugin on the next build.Closes #25.
Scope
plugin/src/mcp/grok-bot/tools/gbot_send.tsxandgbot_thread.tsx:defineToolroutes withinputJsonSchema, callingconnectGateway,sendPrompt, andgetTranscriptTailfromsrc/gateway.js.plugin/src/gbot.ts: target summary, transcript-entry normalization (shared withgbot threadthrough the newsrc/transcript.js), andwithRedactedErrors, which passes tool errors through the CLI'sredactSecretsbefore MCP prints them.plugin/src/skills/talk-to-grok-bot/SKILL.md: when to ping a bot, naming, message format, auth order.plugin/agent-bundle.config.ts:plugin.namegrok-bot,marketplace: true, targets claude, codex, cursor, portable,resolve.symlinks: falseso thefile:..link to this repository bundles as a dependency instead of an out-of-root source.plugin/tests/route-unit/tools.test.ts: both tools against a loopback fake gateway selected throughGROK_BOT_GATEWAY_URL+GROK_BOT_GATEWAY_TOKEN.src/transcript.js:entryTextandtranscriptEntriesextracted fromsrc/cli.jsso the CLI and the plugin parse one set of shapes;entryTextnow also reads a bot reply'smessage.content, whichgbot threadrendered empty before.test/transcript.test.jspins the precedence.package.json:npm testscoped totest/*.test.js(shell glob, so Node 18 and 20 still work) because Node 24's default discovery ran the plugin's rstest files..github/workflows/ci.ymlgains apluginjob:npm ci+npm run checkinplugin/on Node 24. Root.gitignoreaddsartifact/and.agent-bundle/.No changeset:
plugin/is outsidefilesand is not part of the publishedgrok-bot-clitarball (npm pack --dry-runlists noplugin/path). The root package stays zero-dependency.Blast Radius
For the CLI package,
scripts.test,.gitignore, and theformatTranscriptextraction intosrc/transcript.jschange;gbot threadnow shows bot replies instead of empty lines;npm test, publint, and the pack smoke are unaffected. Consumers of the npm package see a README addition only.Verification
plugin:agent-bundle validate --json0 diagnostics;agent-bundle buildok;agent-bundle validate --artifact artifact0 errors (4 info);agent-bundle.manifest.jsonmanifestVersion6; compile evidence externals allkind: builtin;tsc --noEmitclean;rstest6/6 passed, including a 401 body echoing the bearer token that reaches the host as<redacted>.npm test74/74 on currentmain(71 existing + 3 new);npx publint@0.3.24"All good!";npm pack --dry-runpacks 0plugin/files.agent-bundle install codex|claude|cursor --from artifact --replaceallstate: installed;agent-bundle doctor --from artifactreports grok-bot@0.1.0 consistent on all three hosts (its one error, AB7304, is an unrelated pre-existinglcm-cursorplugin entry).tools/call gbot_sendtoGeneralfrom the installed Codex copy returned{ accepted: true };tools/call gbot_threadandgbot --json thread General --limit 3both show the labelled smoke message.Raw outputs:
/fast/tmp/grokbot-run/plugin-evidence/on ubuntu-main.