Skip to content

feat(install): add a grokbot host that stages a Grok Bot marketplace - #864

Merged
ScriptedAlchemy merged 6 commits into
mainfrom
feat/grokbot-install-host
Sep 29, 2026
Merged

ScriptedAlchemy merged 6 commits into
mainfrom
feat/grokbot-install-host

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Adds grokbot next to amp, claude, codex, and cursor for install, uninstall, and doctor --host, so package-bound bins like gbot-install get install grokbot / uninstall grokbot / doctor --host grokbot.

How Grok Bot actually installs plugins

Observed on the Grok Bot computer (read-only):

  • Grok Bot loads Cursor-format plugins (.cursor-plugin/plugin.json with skills/rules/agents/commands/mcpServers) that are installed into the user's account from a hosted Git marketplace (.cursor-plugin/marketplace.json), e.g. pstack from github.com/scriptedalchemy/plugins.
  • The box clones each installed plugin into <agent-data>/plugins/cache/<marketplace-slug>/<plugin>/<commit>/ with a .cache-complete marker, and records the server-assigned plugin id per skill in <agent-data>/plugin-skills/cache.json (pluginId, pluginVersion = commit).
  • Registration goes through Grok Bot's Marketplace UI, its in-chat InstallPlugin tool, or grokbot://app/v1/plugin/add?id=<plugin id>, all keyed by that server id. There is no local-folder import and no CLI verb, and writing into the cache registers nothing.

What this PR does

  • install grokbot: reads the bundle's Cursor projection (bundles must list cursor in targets), stages it as a committed marketplace repo at ~/.grokbot/agent-bundle/marketplaces/<name> (reusing the Cursor marketplace stager; $GROK_BOT_HOME overrides ~/.grokbot), writes a store receipt (grokbot-marketplace-staging, with the staged commit), and prints the remaining honest steps: host the repo, add it as a marketplace, install from Grok Bot. User scope only; --mode is refused.
  • doctor --host grokbot (opt-in, not in the default host set): receipts plus every completed cache copy of the plugin, with plugin id, manifest version, installed commit, and marketplace (AB7334, info, or warning on a version mismatch). Agent-data root: GROK_BOT_AGENT_DATA_DIR, /home/box/agent-data, ~/.grokbot/agent-data, the macOS app-support root.
  • uninstall grokbot: removes the receipted staging repo + receipt (same HEAD/dirty-tree guards as Cursor marketplace mode, now shared through a small MarketplaceStagingHost parameter), and when Grok Bot has the plugin installed, reports a manual registration naming the plugin id to uninstall in Grok Bot.
  • Docs (installation guide en/zh, README, docs/diagnostics.md AB7334), tests (tests/grokbot-install.test.ts), and a minor changeset.

No new build target: the Grok Bot projection is the Cursor projection, so the registry, manifest schema, and emitted install.mjs are unchanged.

Known gaps

  • Registration is server-side; the installer cannot register or install, only stage and instruct.
  • A plugin that contributes no skill has no skill-index row, so doctor shows its id as not assigned even when the cache copy exists.
  • Whether Grok Bot applies plugin rules/commands/stdio MCP servers the way Cursor does is not verified here; skills are.

Local: typecheck clean; grokbot-install, install, uninstall, doctor, install-cli, cli tests pass; lint passes. Unit pool: 2 unrelated failures that also fail on main locally (amp relocated event route path, mcp-entry heartbeat timing).

install grokbot stages the Cursor projection as a committed marketplace
repository under ~/.grokbot/agent-bundle/marketplaces/<name> with a store
receipt and prints the remaining Grok Bot steps (host the repository, add
it as a marketplace, install from Grok Bot, which assigns the plugin id).
doctor --host grokbot reports the plugin id and installed commit from the
Grok Bot plugin cache and skill index (AB7334); uninstall grokbot removes
the staging and receipt and names the plugin id to remove in Grok Bot.
@changeset-bot

changeset-bot Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4382169

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Patch
create-agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-29T03:12:22.853115Z 6b7aacc 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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@864
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@864
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/rsc-markdown-stream@864
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@864

commit: 4382169

@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: 6b7aaccc07

ℹ️ 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 on lines +43 to +44
export const grokBotRoot = (options: { readonly environment?: Readonly<NodeJS.ProcessEnv>; readonly home?: string }): string =>
options.environment?.['GROK_BOT_HOME'] ?? join(options.home ?? homedir(), '.grokbot');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Honor GROK_BOT_HOME from the process environment

When the public CLI or a package-bound installer is run with GROK_BOT_HOME set, neither caller supplies options.environment, so this optional chain skips process.env and stages under ~/.grokbot instead. Doctor does default to process.env, while uninstall also uses the wrong default root, leaving the commands inspecting and removing a different installation than the one created. Fall back to process.env before reading the variable, as the new English and Chinese documentation promises.

AGENTS.md reference: AGENTS.md:L96-L99

Useful? React with 👍 / 👎.

Comment thread .changeset/grokbot-install-host.md Outdated
'agent-bundle': minor
---

Add a `grokbot` install host. `agent-bundle install grokbot` (and `<bundle>-install install grokbot` from package-bound installer bins) stages the bundle's Cursor projection as a committed marketplace repository under `~/.grokbot/agent-bundle/marketplaces/<name>` with a store receipt, and prints the remaining Grok Bot steps: host the repository, add it as a plugin marketplace, and install the plugin from Grok Bot's Marketplace, which assigns the plugin id server-side. `agent-bundle doctor --host grokbot` reports the plugin id and installed commit from the Grok Bot computer's plugin cache (`AB7334`), and `agent-bundle uninstall grokbot` removes the staging and receipt and names the plugin id to uninstall in Grok Bot.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Append the pull request reference to the changeset

This publishable-package changeset ends without the required (#PR) reference, so the generated changelog will lose its PR attribution and violate the repository's release-metadata convention. Append the actual pull request number in parentheses.

AGENTS.md reference: AGENTS.md:L124-L125

Useful? React with 👍 / 👎.

const root = grokBotRoot(options);
try {
const artifact = await bundleInventory(identity, { restoreModes: true });
const staged = await stageCursorMarketplace({ artifact, cursorRoot: root, identity, runner, treeHash });

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 Translate Cursor-only staging failures for Grok Bot

When git is unavailable, this shared staging call raises AB7002 saying Cursor requires git and recommends --mode local; other staging failures similarly name Cursor. The catch below only changes the diagnostic target, but Grok Bot rejects every explicit --mode, so users receive an invalid recovery action. Parameterize or remap these messages for the Grok Bot path and keep the diagnostics reference consistent with the executable behavior.

AGENTS.md reference: AGENTS.md:L96-L99

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit 854e79f into main Sep 29, 2026
20 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 29, 2026
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.

1 participant