feat(install): add a grokbot host that stages a Grok Bot marketplace - #864
Conversation
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 detectedLatest commit: 4382169 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
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. |
commit: |
There was a problem hiding this comment.
💡 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".
| export const grokBotRoot = (options: { readonly environment?: Readonly<NodeJS.ProcessEnv>; readonly home?: string }): string => | ||
| options.environment?.['GROK_BOT_HOME'] ?? join(options.home ?? homedir(), '.grokbot'); |
There was a problem hiding this comment.
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 👍 / 👎.
| '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. |
There was a problem hiding this comment.
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 }); |
There was a problem hiding this comment.
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 👍 / 👎.
… diagnostics for grokbot
Adds
grokbotnext toamp,claude,codex, andcursorforinstall,uninstall, anddoctor --host, so package-bound bins likegbot-installgetinstall grokbot/uninstall grokbot/doctor --host grokbot.How Grok Bot actually installs plugins
Observed on the Grok Bot computer (read-only):
.cursor-plugin/plugin.jsonwith skills/rules/agents/commands/mcpServers) that are installed into the user's account from a hosted Git marketplace (.cursor-plugin/marketplace.json), e.g.pstackfromgithub.com/scriptedalchemy/plugins.<agent-data>/plugins/cache/<marketplace-slug>/<plugin>/<commit>/with a.cache-completemarker, and records the server-assigned plugin id per skill in<agent-data>/plugin-skills/cache.json(pluginId,pluginVersion= commit).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 listcursorintargets), stages it as a committed marketplace repo at~/.grokbot/agent-bundle/marketplaces/<name>(reusing the Cursor marketplace stager;$GROK_BOT_HOMEoverrides~/.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;--modeis 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 smallMarketplaceStagingHostparameter), and when Grok Bot has the plugin installed, reports amanualregistration naming the plugin id to uninstall in Grok Bot.docs/diagnostics.mdAB7334), 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.mjsare unchanged.Known gaps
Local: typecheck clean;
grokbot-install, install, uninstall, doctor, install-cli, cli tests pass; lint passes. Unit pool: 2 unrelated failures that also fail onmainlocally (amp relocated event route path, mcp-entry heartbeat timing).