Skip to content

feat(plugin): add the grok-bot Agent Bundle plugin (#25) - #27

Merged
ScriptedAlchemy merged 5 commits into
mainfrom
feat/agent-bundle-plugin
Sep 15, 2026
Merged

ScriptedAlchemy merged 5 commits into
mainfrom
feat/agent-bundle-plugin

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Why

Codex, Claude Code, and Cursor agents need a way to reach Grok Bot without a global gbot install. The plugin under plugin/ 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.tsx and gbot_thread.tsx: defineTool routes with inputJsonSchema, calling connectGateway, sendPrompt, and getTranscriptTail from src/gateway.js.
  • plugin/src/gbot.ts: target summary, transcript-entry normalization (shared with gbot thread through the new src/transcript.js), and withRedactedErrors, which passes tool errors through the CLI's redactSecrets before 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.name grok-bot, marketplace: true, targets claude, codex, cursor, portable, resolve.symlinks: false so the file:.. 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 through GROK_BOT_GATEWAY_URL + GROK_BOT_GATEWAY_TOKEN.
  • src/transcript.js: entryText and transcriptEntries extracted from src/cli.js so the CLI and the plugin parse one set of shapes; entryText now also reads a bot reply's message.content, which gbot thread rendered empty before. test/transcript.test.js pins the precedence.
  • Root package.json: npm test scoped to test/*.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.yml gains a plugin job: npm ci + npm run check in plugin/ on Node 24. Root .gitignore adds artifact/ and .agent-bundle/.
  • README: "Talking to Grok Bot from Codex" with install commands, sandbox/network note, and an AGENTS.md snippet.

No changeset: plugin/ is outside files and is not part of the published grok-bot-cli tarball (npm pack --dry-run lists no plugin/ path). The root package stays zero-dependency.

Blast Radius

For the CLI package, scripts.test, .gitignore, and the formatTranscript extraction into src/transcript.js change; gbot thread now 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 --json 0 diagnostics; agent-bundle build ok; agent-bundle validate --artifact artifact 0 errors (4 info); agent-bundle.manifest.json manifestVersion 6; compile evidence externals all kind: builtin; tsc --noEmit clean; rstest 6/6 passed, including a 401 body echoing the bearer token that reaches the host as <redacted>.
  • Root: npm test 74/74 on current main (71 existing + 3 new); npx publint@0.3.24 "All good!"; npm pack --dry-run packs 0 plugin/ files.
  • Installed on this machine: agent-bundle install codex|claude|cursor --from artifact --replace all state: installed; agent-bundle doctor --from artifact reports grok-bot@0.1.0 consistent on all three hosts (its one error, AB7304, is an unrelated pre-existing lcm-cursor plugin entry).
  • Live: stdio tools/call gbot_send to General from the installed Codex copy returned { accepted: true }; tools/call gbot_thread and gbot --json thread General --limit 3 both show the labelled smoke message.

Raw outputs: /fast/tmp/grokbot-run/plugin-evidence/ on ubuntu-main.

@changeset-bot

changeset-bot Bot commented Sep 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fbd3b09

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T00:52:17.479587Z 13b7f31 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread package.json Outdated
"gbot": "node src/cli.js",
"release": "changeset publish",
"test": "node --test"
"test": "node --test \"test/**/*.test.js\""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread package.json Outdated
"gbot": "node src/cli.js",
"release": "changeset publish",
"test": "node --test"
"test": "node --test \"test/**/*.test.js\""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/agent-bundle-plugin branch 2 times, most recently from 0a991e8 to 905f0b7 Compare September 15, 2026 01:06
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.
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.

Codex skill/MCP: message Grok Bot via gbot send

1 participant