grok-bot-cli 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26695,7 +26695,7 @@ var __webpack_modules__ = {
26695
26695
  const lines = [
26696
26696
  `${installVerb(result.state, result.mode)} ${result.plugin}@${result.version} for ${result.host}${mode} at ${destination}${content}`
26697
26697
  ];
26698
- if (void 0 !== result.marketplace && 'cursor' === result.host) lines.push(`Marketplace: ${result.marketplace}${void 0 === result.commit ? '' : ` @ ${result.commit}`}`);
26698
+ if (void 0 !== result.marketplace && ('cursor' === result.host || 'grokbot' === result.host)) lines.push(`Marketplace: ${result.marketplace}${void 0 === result.commit ? '' : ` @ ${result.commit}`}`);
26699
26699
  if (void 0 !== result.nextSteps && result.nextSteps.length > 0) {
26700
26700
  lines.push('Next steps:');
26701
26701
  lines.push(...result.nextSteps.map((step, index)=>` ${index + 1}. ${step}`));
@@ -26790,10 +26790,12 @@ var __webpack_modules__ = {
26790
26790
  if (void 0 !== host.bundle) {
26791
26791
  const identity1 = void 0 === host.bundle.name ? '' : ` ${host.bundle.name}${void 0 === host.bundle.version ? '' : `@${host.bundle.version}`}`;
26792
26792
  out.push(` bundle:${identity1} ${host.bundle.state}\n`);
26793
+ if (void 0 !== host.bundle.pluginId) out.push(` plugin id: ${host.bundle.pluginId}\n`);
26793
26794
  if (void 0 !== host.bundle.comparison) out.push(` installed copy: ${describeInstallComparison(host.bundle.comparison)}\n`);
26794
26795
  for (const validation of host.bundle.hostValidation ?? [])out.push(` host validation (${validation.copy} ${validation.pluginDirectory}${void 0 === validation.scope ? '' : `, scope ${validation.scope}`}): ${validation.status}\n`);
26795
26796
  if (void 0 !== host.bundle.lifecycle) out.push(` lifecycle: ${describeLifecycle(host.bundle.lifecycle)}\n`);
26796
26797
  }
26798
+ for (const finding of 'grokbot' === host.host ? host.inventory.findings : [])out.push(` installed: ${finding.name ?? 'unknown'}@${finding.version ?? 'unknown'} (plugin id ${finding.pluginId ?? 'not assigned yet'}, commit ${finding.commit ?? 'unknown'}, marketplace ${finding.marketplace ?? 'unknown'}) at ${finding.path ?? 'unknown path'}\n`);
26797
26799
  if (host.receipts.length > 0) {
26798
26800
  out.push(` receipts: ${host.receipts.length} store receipt(s)\n`);
26799
26801
  for (const receipt of host.receipts)out.push(` ${receipt.plugin}@${receipt.version} (${receipt.mode}, ${receipt.scope}): ${receipt.state}\n`);
@@ -26832,8 +26834,8 @@ var __webpack_modules__ = {
26832
26834
  return out.join('');
26833
26835
  };
26834
26836
  const installHost = (value)=>{
26835
- if ('amp' === value || 'claude' === value || 'codex' === value || 'cursor' === value) return value;
26836
- throw new commander__rspack_import_0.Di('Install host must be amp, claude, codex, or cursor.');
26837
+ if ('amp' === value || 'claude' === value || 'codex' === value || 'cursor' === value || 'grokbot' === value) return value;
26838
+ throw new commander__rspack_import_0.Di('Install host must be amp, claude, codex, cursor, or grokbot.');
26837
26839
  };
26838
26840
  const installMode = (value)=>{
26839
26841
  if ('local' === value || 'marketplace' === value) return value;
@@ -26844,8 +26846,8 @@ var __webpack_modules__ = {
26844
26846
  throw new commander__rspack_import_0.Di('Install scope must be user, project, or local.');
26845
26847
  };
26846
26848
  const doctorHost = (value)=>{
26847
- if ('claude' === value || 'codex' === value || 'cursor' === value) return value;
26848
- throw new commander__rspack_import_0.Di('Doctor host must be claude, codex, or cursor.');
26849
+ if ('claude' === value || 'codex' === value || 'cursor' === value || 'grokbot' === value) return value;
26850
+ throw new commander__rspack_import_0.Di('Doctor host must be claude, codex, cursor, or grokbot.');
26849
26851
  };
26850
26852
  const collectDoctorHost = (value, previous)=>[
26851
26853
  ...previous,
@@ -26854,7 +26856,7 @@ var __webpack_modules__ = {
26854
26856
  const registerLifecycleCommands = (program, options)=>{
26855
26857
  const { from: pinned, lifecycle, machine, setExitCode, show } = options;
26856
26858
  const fromOption = (command, help, defaultToCwd = false)=>void 0 === pinned ? command.option('--from <bundle-dir>', help, defaultToCwd ? process.cwd() : void 0) : command;
26857
- const installCommand = fromOption(program.command('install').description('Install a built bundle into a supported host').argument('<host>', 'Destination host: amp, claude, codex, or cursor', installHost), 'Target bundle directory or artifact root', true).option('--scope <scope>', 'Host install scope', installScope, 'user').option('--replace', "Replace an existing agent-bundle install of this plugin even when its version differs; same-version content drift is replaced automatically and foreign installs are always refused").option('--mode <mode>', 'Cursor delivery mode: local (default) or marketplace', installMode).option('--json', 'Write one machine-readable JSON document');
26859
+ const installCommand = fromOption(program.command('install').description('Install a built bundle into a supported host').argument('<host>', 'Destination host: amp, claude, codex, cursor, or grokbot', installHost), 'Target bundle directory or artifact root', true).option('--scope <scope>', 'Host install scope', installScope, 'user').option('--replace', "Replace an existing agent-bundle install of this plugin even when its version differs; same-version content drift is replaced automatically and foreign installs are always refused").option('--mode <mode>', 'Cursor delivery mode: local (default) or marketplace', installMode).option('--json', 'Write one machine-readable JSON document');
26858
26860
  installCommand.action(async (host, commandOptions)=>{
26859
26861
  const { installBundle: install } = await lifecycle();
26860
26862
  const result = await install({
@@ -26868,7 +26870,7 @@ var __webpack_modules__ = {
26868
26870
  });
26869
26871
  await (true === commandOptions.json ? machine(result) : show(formatInstallResult(result)));
26870
26872
  });
26871
- const uninstallCommand = fromOption(program.command('uninstall').description('Remove a receipt-owned host install of a built bundle, and nothing else').argument('<host>', 'Host to uninstall from: amp, claude, codex, or cursor', installHost), 'Target bundle directory or artifact root that identifies the plugin', true).option('--scope <scope>', 'Host install scope', installScope, 'user').option('--mode <mode>', 'Cursor delivery mode to uninstall: local (default) or marketplace', installMode).option('--keep-data', 'Keep the plugin\'s durable runtime state in place; this is the default').option('--purge-data', 'Also remove the receipt-owned durable runtime state; requires --confirm-purge').option('--confirm-purge', 'Confirm that --purge-data may delete durable state').option('--force', "Proceed when a host-only install has no store receipt or when owned content no longer matches the receipt; directories without a receipt naming this plugin are still refused").option('--plan', 'Print the exact paths and host registrations that would be removed without changing anything').option('--json', 'Write one machine-readable JSON document');
26873
+ const uninstallCommand = fromOption(program.command('uninstall').description('Remove a receipt-owned host install of a built bundle, and nothing else').argument('<host>', 'Host to uninstall from: amp, claude, codex, cursor, or grokbot', installHost), 'Target bundle directory or artifact root that identifies the plugin', true).option('--scope <scope>', 'Host install scope', installScope, 'user').option('--mode <mode>', 'Cursor delivery mode to uninstall: local (default) or marketplace', installMode).option('--keep-data', 'Keep the plugin\'s durable runtime state in place; this is the default').option('--purge-data', 'Also remove the receipt-owned durable runtime state; requires --confirm-purge').option('--confirm-purge', 'Confirm that --purge-data may delete durable state').option('--force', "Proceed when a host-only install has no store receipt or when owned content no longer matches the receipt; directories without a receipt naming this plugin are still refused").option('--plan', 'Print the exact paths and host registrations that would be removed without changing anything').option('--json', 'Write one machine-readable JSON document');
26872
26874
  uninstallCommand.action(async (host, commandOptions)=>{
26873
26875
  const { uninstallBundle: uninstall } = await lifecycle();
26874
26876
  const result = await uninstall({
@@ -26896,7 +26898,7 @@ var __webpack_modules__ = {
26896
26898
  });
26897
26899
  await (true === commandOptions.json ? machine(result) : show(formatUninstallResult(result)));
26898
26900
  });
26899
- const doctorCommand = fromOption(program.command('doctor').description('Inspect host installs and runtime endpoints without changing them').option('--host <host>', 'Host to inspect (repeatable)', collectDoctorHost, []), 'Target bundle directory or artifact root').option('--json', 'Write one machine-readable JSON document');
26901
+ const doctorCommand = fromOption(program.command('doctor').description('Inspect host installs and runtime endpoints without changing them').option('--host <host>', 'Host to inspect (repeatable; grokbot only when named)', collectDoctorHost, []), 'Target bundle directory or artifact root').option('--json', 'Write one machine-readable JSON document');
26900
26902
  doctorCommand.action(async (commandOptions)=>{
26901
26903
  const { runDoctor: doctor } = await lifecycle();
26902
26904
  const from = pinned ?? commandOptions.from;
@@ -34591,7 +34593,8 @@ var __webpack_modules__ = {
34591
34593
  'codex-marketplace',
34592
34594
  'codex-plugin',
34593
34595
  'cursor-local-plugin',
34594
- 'cursor-marketplace-staging'
34596
+ 'cursor-marketplace-staging',
34597
+ 'grokbot-marketplace-staging'
34595
34598
  ]);
34596
34599
  const unsupportedEntry = (relativePath)=>new Error(`Refusing unsupported filesystem entry ${JSON.stringify(relativePath || '.')}.`);
34597
34600
  const sortNames = (names)=>[
@@ -35596,6 +35599,284 @@ var __webpack_modules__ = {
35596
35599
  }
35597
35600
  }
35598
35601
  };
35602
+ const grokBotHost = 'grokbot';
35603
+ const grokBotRoot = (options)=>(options.environment ?? process.env)['GROK_BOT_HOME'] ?? (0, node_path__rspack_import_5.join)(options.home ?? (0, node_os__rspack_import_4.homedir)(), '.grokbot');
35604
+ const grokBotMarketplaceRoot = (root)=>cursorMarketplaceRoot(root);
35605
+ const grokBotReceiptPath = (root, plugin)=>installReceiptStorePath(root, plugin, 'marketplace');
35606
+ const grokBotNextSteps = (repoRoot, plugin, bin = 'agent-bundle')=>Object.freeze([
35607
+ `Push ${repoRoot} to a GitHub repository (or copy plugins/${plugin} and its .cursor-plugin/marketplace.json entry into a marketplace repository you already use): Grok Bot installs plugins only from hosted Git marketplaces, not local folders.`,
35608
+ 'Add that repository as a plugin marketplace on your Cursor account (Grok Bot reads the same account plugin catalog).',
35609
+ `In Grok Bot, open Marketplace -> Plugins and install "${plugin}" (or ask a Grok Bot agent to install it; grokbot://app/v1/plugin/add?id=<plugin id> opens the install card once the marketplace assigned the id).`,
35610
+ `Verify on the Grok Bot computer with \`${bin} doctor --host grokbot\`: it reports the plugin id and installed commit once Grok Bot has cloned the plugin.`
35611
+ ]);
35612
+ const grokBotStagingRewrites = [
35613
+ [
35614
+ '; install git or use `--mode local`.',
35615
+ '; install git.'
35616
+ ],
35617
+ [
35618
+ ', or use `--mode local`.',
35619
+ '.'
35620
+ ],
35621
+ [
35622
+ ' Agent Plugins (root `plugin.json`) packs install with `--mode local`.',
35623
+ ' List `cursor` in the bundle targets.'
35624
+ ],
35625
+ [
35626
+ 'git is required for `--mode marketplace` (Cursor imports marketplaces from Git repositories)',
35627
+ 'git is required for the grokbot host (Grok Bot installs plugins from Git marketplaces)'
35628
+ ],
35629
+ [
35630
+ '`--mode marketplace` requires',
35631
+ 'The grokbot host requires'
35632
+ ],
35633
+ [
35634
+ '`--mode marketplace` refuses',
35635
+ 'The grokbot host refuses'
35636
+ ],
35637
+ [
35638
+ 'Cursor marketplace staging',
35639
+ 'Grok Bot marketplace staging'
35640
+ ],
35641
+ [
35642
+ 'Cursor marketplaces resolve',
35643
+ 'Grok Bot marketplaces resolve'
35644
+ ],
35645
+ [
35646
+ 'Cursor would import',
35647
+ 'Grok Bot would import'
35648
+ ]
35649
+ ];
35650
+ const grokBotStagingMessage = (message)=>grokBotStagingRewrites.reduce((text, [from, to])=>text.split(from).join(to), message);
35651
+ const grokbot_failure = (code, message)=>new _event_ipc_js__rspack_import_17.uo([
35652
+ {
35653
+ code,
35654
+ message,
35655
+ severity: 'error',
35656
+ target: grokBotHost
35657
+ }
35658
+ ]);
35659
+ const gitOutput = async (runner, cwd, args)=>{
35660
+ const result = await runner.run('git', args, {
35661
+ cwd
35662
+ }).catch(()=>void 0);
35663
+ return void 0 === result || 0 !== result.code ? void 0 : result.stdout.trim();
35664
+ };
35665
+ const supersedeOwnedStaging = async (options)=>{
35666
+ const { identity: identity1, previousReceipt, repoRoot, runner } = options;
35667
+ if (void 0 === previousReceipt || !await (0, _738_1_js__rspack_import_15.t2)(repoRoot)) return;
35668
+ const sameVersion = previousReceipt.version === identity1.version;
35669
+ if (sameVersion && previousReceipt.contentHash === options.artifact.hash) return;
35670
+ const commit = previousReceipt.registrations[0]?.commit;
35671
+ const owned = previousReceipt.host === grokBotHost && previousReceipt.plugin === identity1.plugin && void 0 !== commit && await gitOutput(runner, repoRoot, [
35672
+ 'rev-parse',
35673
+ 'HEAD'
35674
+ ]) === commit && await gitOutput(runner, repoRoot, [
35675
+ 'status',
35676
+ '--porcelain',
35677
+ '--untracked-files=all',
35678
+ '--ignored=matching'
35679
+ ]) === '';
35680
+ if (!owned) return;
35681
+ if (!sameVersion && true !== options.options.replace) throw grokbot_failure('AB7005', `Refusing version collision at ${repoRoot}: found ${previousReceipt.version}, requested ${identity1.version}. Re-run with --replace to restage it.`);
35682
+ const aside = (0, node_path__rspack_import_5.join)(repoRoot, '..', `.${identity1.plugin}.superseded-${process.pid}-${Date.now()}`);
35683
+ await (0, node_fs_promises__rspack_import_2.rename)(repoRoot, aside);
35684
+ return aside;
35685
+ };
35686
+ const installGrokBot = async (options, runner, treeHash)=>{
35687
+ if ((options.scope ?? 'user') !== 'user') throw grokbot_failure('AB7003', `Grok Bot plugin installation supports only user scope, not ${options.scope ?? 'user'}.`);
35688
+ if (void 0 !== options.mode) throw grokbot_failure('AB7003', `Install mode ${JSON.stringify(options.mode)} applies to the cursor host only.`);
35689
+ const identity1 = await readBundleIdentity(options.from, 'cursor').catch((error)=>{
35690
+ if (error instanceof _event_ipc_js__rspack_import_17.uo) throw new _event_ipc_js__rspack_import_17.uo(error.diagnostics.map((entry)=>({
35691
+ ...entry,
35692
+ message: `${entry.message} The grokbot host installs the Cursor projection.`,
35693
+ target: grokBotHost
35694
+ })));
35695
+ throw error;
35696
+ });
35697
+ const root = grokBotRoot(options);
35698
+ try {
35699
+ const artifact = await bundleInventory(identity1, {
35700
+ restoreModes: true
35701
+ });
35702
+ const receiptPath = grokBotReceiptPath(root, identity1.plugin);
35703
+ const previousReceipt = await readInstallReceiptFile(receiptPath);
35704
+ const repoRoot = (0, node_path__rspack_import_5.join)(grokBotMarketplaceRoot(root), identity1.plugin);
35705
+ const superseded = await supersedeOwnedStaging({
35706
+ artifact,
35707
+ identity: identity1,
35708
+ options,
35709
+ previousReceipt,
35710
+ repoRoot,
35711
+ runner
35712
+ });
35713
+ let staged;
35714
+ try {
35715
+ staged = await stageCursorMarketplace({
35716
+ artifact,
35717
+ cursorRoot: root,
35718
+ identity: identity1,
35719
+ runner,
35720
+ treeHash
35721
+ });
35722
+ } catch (error) {
35723
+ if (void 0 !== superseded) await (0, node_fs_promises__rspack_import_2.rename)(superseded, repoRoot);
35724
+ throw error;
35725
+ }
35726
+ try {
35727
+ if ('staged' === staged.state || void 0 === previousReceipt || previousReceipt.contentHash !== artifact.hash || previousReceipt.registrations[0]?.commit !== staged.commit) await writeStoredInstallReceipt(receiptPath, createInstallReceipt({
35728
+ host: grokBotHost,
35729
+ ...void 0 === previousReceipt ? {} : {
35730
+ installedAt: previousReceipt.installedAt
35731
+ },
35732
+ inventory: {
35733
+ files: [],
35734
+ hash: artifact.hash
35735
+ },
35736
+ mode: 'marketplace',
35737
+ plugin: identity1.plugin,
35738
+ registrations: [
35739
+ {
35740
+ ...void 0 === staged.commit ? {} : {
35741
+ commit: staged.commit
35742
+ },
35743
+ kind: 'grokbot-marketplace-staging',
35744
+ name: staged.marketplace
35745
+ }
35746
+ ],
35747
+ scope: 'user',
35748
+ updatedAt: new Date().toISOString(),
35749
+ version: identity1.version
35750
+ }));
35751
+ } catch (error) {
35752
+ if (void 0 !== superseded) {
35753
+ await (0, node_fs_promises__rspack_import_2.rm)(staged.destination, {
35754
+ force: true,
35755
+ recursive: true
35756
+ });
35757
+ await (0, node_fs_promises__rspack_import_2.rename)(superseded, repoRoot);
35758
+ }
35759
+ throw error;
35760
+ }
35761
+ if (void 0 !== superseded) await (0, node_fs_promises__rspack_import_2.rm)(superseded, {
35762
+ force: true,
35763
+ recursive: true
35764
+ });
35765
+ return {
35766
+ bundleRoot: identity1.bundleRoot,
35767
+ ...void 0 === staged.commit ? {} : {
35768
+ commit: staged.commit
35769
+ },
35770
+ contentHash: artifact.hash,
35771
+ destination: staged.destination,
35772
+ host: grokBotHost,
35773
+ marketplace: staged.marketplace,
35774
+ mode: 'marketplace',
35775
+ nextSteps: grokBotNextSteps(staged.destination, identity1.plugin),
35776
+ plugin: identity1.plugin,
35777
+ ...void 0 === superseded || void 0 === previousReceipt ? {} : {
35778
+ previousContentHash: previousReceipt.contentHash
35779
+ },
35780
+ receipt: receiptPath,
35781
+ state: void 0 === superseded ? staged.state : 'replaced',
35782
+ version: identity1.version
35783
+ };
35784
+ } catch (error) {
35785
+ if (error instanceof _event_ipc_js__rspack_import_17.uo) throw new _event_ipc_js__rspack_import_17.uo(error.diagnostics.map((entry)=>({
35786
+ ...entry,
35787
+ message: grokBotStagingMessage(entry.message),
35788
+ target: grokBotHost
35789
+ })));
35790
+ throw grokbot_failure('AB7004', (0, _790_1_js__rspack_import_14.gJ)(error));
35791
+ }
35792
+ };
35793
+ const grokBotAgentDataCandidates = (environment, home)=>Object.freeze([
35794
+ ...void 0 === environment['GROK_BOT_AGENT_DATA_DIR'] ? [] : [
35795
+ environment['GROK_BOT_AGENT_DATA_DIR']
35796
+ ],
35797
+ '/home/box/agent-data',
35798
+ (0, node_path__rspack_import_5.join)(home, '.grokbot', 'agent-data'),
35799
+ (0, node_path__rspack_import_5.join)(home, 'Library', 'Application Support', 'Grok Bot', 'agent-data')
35800
+ ]);
35801
+ const directoryExists = async (path)=>{
35802
+ try {
35803
+ return (await (0, node_fs_promises__rspack_import_2.stat)(path)).isDirectory();
35804
+ } catch (error) {
35805
+ if ((0, _790_1_js__rspack_import_14.r)(error, 'ENOENT') || (0, _790_1_js__rspack_import_14.r)(error, 'ENOTDIR') || (0, _790_1_js__rspack_import_14.r)(error, 'EACCES')) return false;
35806
+ throw error;
35807
+ }
35808
+ };
35809
+ const readJsonFile = async (path)=>{
35810
+ try {
35811
+ return JSON.parse(await (0, node_fs_promises__rspack_import_2.readFile)(path, 'utf8'));
35812
+ } catch (error) {
35813
+ if ((0, _790_1_js__rspack_import_14.r)(error, 'ENOENT') || (0, _790_1_js__rspack_import_14.r)(error, 'EACCES') || error instanceof SyntaxError) return;
35814
+ throw error;
35815
+ }
35816
+ };
35817
+ const listDirectory = async (path)=>{
35818
+ try {
35819
+ return (await (0, node_fs_promises__rspack_import_2.readdir)(path)).sort();
35820
+ } catch (error) {
35821
+ if ((0, _790_1_js__rspack_import_14.r)(error, 'ENOENT') || (0, _790_1_js__rspack_import_14.r)(error, 'ENOTDIR') || (0, _790_1_js__rspack_import_14.r)(error, 'EACCES')) return [];
35822
+ throw error;
35823
+ }
35824
+ };
35825
+ const skillIndexIds = (document)=>{
35826
+ const ids = new Map();
35827
+ if (!effect__rspack_import_34.Gv(document) || !Array.isArray(document['skills'])) return ids;
35828
+ for (const skill of document['skills']){
35829
+ if (!effect__rspack_import_34.Gv(skill)) continue;
35830
+ const { installPath, pluginId } = skill;
35831
+ if ('string' != typeof installPath || 'string' != typeof pluginId) continue;
35832
+ const segments = installPath.split(/[\\/]/u).filter((segment)=>'' !== segment);
35833
+ const cache = segments.lastIndexOf('cache');
35834
+ if (!(cache < 1) && 'plugins' === segments[cache - 1] && segments.length === cache + 4) ids.set(segments.slice(cache + 1).join('/'), pluginId);
35835
+ }
35836
+ return ids;
35837
+ };
35838
+ const readGrokBotInventory = async (plugin, options = {})=>{
35839
+ const environment = options.environment ?? process.env;
35840
+ const home = options.home ?? (0, node_os__rspack_import_4.homedir)();
35841
+ let agentData;
35842
+ for (const candidate of grokBotAgentDataCandidates(environment, home))if (await directoryExists((0, node_path__rspack_import_5.join)(candidate, 'plugins'))) {
35843
+ agentData = candidate;
35844
+ break;
35845
+ }
35846
+ if (void 0 === agentData) return Object.freeze({
35847
+ reason: 'No Grok Bot plugin cache on this computer (set GROK_BOT_AGENT_DATA_DIR, or run doctor on the Grok Bot computer).',
35848
+ status: 'unavailable'
35849
+ });
35850
+ const ids = skillIndexIds(await readJsonFile((0, node_path__rspack_import_5.join)(agentData, 'plugin-skills', 'cache.json')));
35851
+ const cacheRoot = (0, node_path__rspack_import_5.join)(agentData, 'plugins', 'cache');
35852
+ const entries = [];
35853
+ for (const marketplace of (await listDirectory(cacheRoot))){
35854
+ const pluginRoot = (0, node_path__rspack_import_5.join)(cacheRoot, marketplace, plugin);
35855
+ for (const version of (await listDirectory(pluginRoot))){
35856
+ const installPath = (0, node_path__rspack_import_5.join)(pluginRoot, version);
35857
+ if (!await (0, _738_1_js__rspack_import_15.t2)((0, node_path__rspack_import_5.join)(installPath, '.cache-complete'))) continue;
35858
+ const manifest = await readJsonFile((0, node_path__rspack_import_5.join)(installPath, '.cursor-plugin', 'plugin.json'));
35859
+ if (!effect__rspack_import_34.Gv(manifest) || manifest['name'] !== plugin) continue;
35860
+ const pluginId = ids.get(`${marketplace}/${plugin}/${version}`);
35861
+ entries.push(Object.freeze({
35862
+ installPath,
35863
+ marketplace,
35864
+ ...'string' == typeof manifest['version'] ? {
35865
+ manifestVersion: manifest['version']
35866
+ } : {},
35867
+ ...void 0 === pluginId ? {} : {
35868
+ pluginId
35869
+ },
35870
+ pluginVersion: version
35871
+ }));
35872
+ }
35873
+ }
35874
+ return Object.freeze({
35875
+ agentData,
35876
+ entries: Object.freeze(entries),
35877
+ status: 'available'
35878
+ });
35879
+ };
35599
35880
  const safePluginSegment = /^[a-zA-Z0-9](?:[a-zA-Z0-9._-]*[a-zA-Z0-9])?$/u;
35600
35881
  const installedUserDataStateRoot = (canonicalRoot, environment, home)=>{
35601
35882
  const xdgStateHome = environment.XDG_STATE_HOME ?? '';
@@ -36405,7 +36686,7 @@ var __webpack_modules__ = {
36405
36686
  state: replaced ? 'replaced' : 'installed'
36406
36687
  };
36407
36688
  };
36408
- const treeHash = async (root)=>(await treeInventory(root)).hash;
36689
+ const install_treeHash = async (root)=>(await treeInventory(root)).hash;
36409
36690
  const cursorManifestCandidates = Object.freeze([
36410
36691
  '.cursor-plugin/plugin.json',
36411
36692
  'plugin.json'
@@ -36463,7 +36744,7 @@ var __webpack_modules__ = {
36463
36744
  cursorRoot,
36464
36745
  identity: identity1,
36465
36746
  runner: options.commandRunner ?? defaultCommandRunner,
36466
- treeHash: treeHash
36747
+ treeHash: install_treeHash
36467
36748
  });
36468
36749
  const receiptPath = cursorMarketplaceReceiptPath(cursorRoot, identity1.plugin);
36469
36750
  const previousReceipt = await readInstallReceiptFile(receiptPath);
@@ -36796,8 +37077,10 @@ var __webpack_modules__ = {
36796
37077
  };
36797
37078
  const installProgram = effect__rspack_import_29.D9k(function*(options) {
36798
37079
  const scope = options.scope ?? 'user';
37080
+ if ('grokbot' === options.host) return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>installGrokBot(options, options.commandRunner ?? defaultCommandRunner, install_treeHash));
36799
37081
  if (void 0 !== options.mode && 'cursor' !== options.host) return yield* effect__rspack_import_29.fJG(identity_failure('AB7003', `Install mode ${JSON.stringify(options.mode)} applies to the cursor host only.`, options.host));
36800
- const identity1 = yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>readBundleIdentity(options.from, options.host));
37082
+ const host = options.host;
37083
+ const identity1 = yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>readBundleIdentity(options.from, host));
36801
37084
  switch(options.host){
36802
37085
  case 'amp':
36803
37086
  return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>installAmp(options, identity1, scope));
@@ -38467,7 +38750,7 @@ var __webpack_modules__ = {
38467
38750
  }
38468
38751
  const state = await stateOf(receipt);
38469
38752
  receipts.push(receiptFinding(path, receipt, state));
38470
- if ('orphaned' === state) diagnostics.push(doctor_diagnostic('AB7328', `Agent Bundle receipt ${JSON.stringify(path)} records ${receipt.plugin}@${receipt.version} (${receipt.mode}, scope ${receipt.scope}) but ${host} no longer holds the registration it describes.`, `Run \`agent-bundle uninstall ${host} --from <bundle-dir>${'marketplace' === receipt.mode ? ' --mode marketplace' : ''}\` to consume the orphaned receipt, or reinstall the plugin.`, 'warning', host));
38753
+ if ('orphaned' === state) diagnostics.push(doctor_diagnostic('AB7328', `Agent Bundle receipt ${JSON.stringify(path)} records ${receipt.plugin}@${receipt.version} (${receipt.mode}, scope ${receipt.scope}) but ${host} no longer holds the registration it describes.`, `Run \`agent-bundle uninstall ${host} --from <bundle-dir>${'marketplace' === receipt.mode && 'cursor' === host ? ' --mode marketplace' : ''}\` to consume the orphaned receipt, or reinstall the plugin.`, 'warning', host));
38471
38754
  }
38472
38755
  return {
38473
38756
  diagnostics: (0, _event_ipc_js__rspack_import_17.cY)(diagnostics),
@@ -38609,7 +38892,7 @@ var __webpack_modules__ = {
38609
38892
  }
38610
38893
  const [source, stagedHash] = await Promise.all([
38611
38894
  bundleInventory(identity1),
38612
- treeHash(pluginDirectory)
38895
+ install_treeHash(pluginDirectory)
38613
38896
  ]);
38614
38897
  const staging = await inspectCursorMarketplaceStaging(home, git);
38615
38898
  const entry = staging.findings.find((candidate)=>candidate.name === identity1.plugin);
@@ -39325,6 +39608,99 @@ var __webpack_modules__ = {
39325
39608
  }
39326
39609
  });
39327
39610
  };
39611
+ const doctorGrokBot = async (options, home)=>{
39612
+ const environment = options.environment ?? process.env;
39613
+ const root = grokBotRoot({
39614
+ environment,
39615
+ home
39616
+ });
39617
+ const diagnostics = [];
39618
+ const receipts = await inspectStoreReceipts('grokbot', root, async (receipt)=>'marketplace' === receipt.mode && await (0, _738_1_js__rspack_import_15.t2)((0, node_path__rspack_import_5.join)(grokBotMarketplaceRoot(root), receipt.plugin)) ? 'consistent' : 'orphaned');
39619
+ diagnostics.push(...receipts.diagnostics);
39620
+ let identity1;
39621
+ let bundleError;
39622
+ if (void 0 !== options.from) try {
39623
+ identity1 = await readBundleIdentity(options.from, 'cursor');
39624
+ } catch (error) {
39625
+ bundleError = error;
39626
+ }
39627
+ const plugins = [
39628
+ ...new Set([
39629
+ ...void 0 === identity1 ? [] : [
39630
+ identity1.plugin
39631
+ ],
39632
+ ...receipts.receipts.map((receipt)=>receipt.plugin)
39633
+ ])
39634
+ ].sort();
39635
+ const inventories = new Map();
39636
+ for (const plugin of plugins)inventories.set(plugin, await readGrokBotInventory(plugin, {
39637
+ environment,
39638
+ home
39639
+ }));
39640
+ const firstInventory = [
39641
+ ...inventories.values()
39642
+ ][0] ?? await readGrokBotInventory('', {
39643
+ environment,
39644
+ home
39645
+ });
39646
+ const available = 'available' === firstInventory.status;
39647
+ const findings = [
39648
+ ...inventories.values()
39649
+ ].flatMap((inventory, index)=>'available' !== inventory.status ? [] : inventory.entries.map((entry)=>Object.freeze({
39650
+ commit: entry.pluginVersion,
39651
+ marketplace: entry.marketplace,
39652
+ name: plugins[index] ?? '',
39653
+ path: entry.installPath,
39654
+ ...void 0 === entry.pluginId ? {} : {
39655
+ pluginId: entry.pluginId
39656
+ },
39657
+ state: void 0 === entry.pluginId ? 'installed' : 'registered',
39658
+ ...void 0 === entry.manifestVersion ? {} : {
39659
+ version: entry.manifestVersion
39660
+ }
39661
+ })));
39662
+ let bundle;
39663
+ if (void 0 !== identity1) {
39664
+ const copies = findings.filter((finding)=>finding.name === identity1.plugin);
39665
+ const staged = await (0, _738_1_js__rspack_import_15.t2)((0, node_path__rspack_import_5.join)(grokBotMarketplaceRoot(root), identity1.plugin));
39666
+ const registered = copies.find((finding)=>void 0 !== finding.pluginId);
39667
+ const current = copies.find((finding)=>finding.version === identity1.version);
39668
+ bundle = Object.freeze({
39669
+ bundleRoot: identity1.bundleRoot,
39670
+ marketplace: cursorMarketplaceName(identity1.plugin),
39671
+ name: identity1.plugin,
39672
+ ...registered?.pluginId === void 0 ? {} : {
39673
+ pluginId: registered.pluginId
39674
+ },
39675
+ state: void 0 !== registered ? 'registered' : copies.length > 0 ? 'installed' : staged ? 'unregistered' : 'missing',
39676
+ version: identity1.version
39677
+ });
39678
+ const described = copies.map((finding)=>`${void 0 === finding.pluginId ? 'no plugin id yet' : `plugin id ${finding.pluginId}`}, version ${finding.version ?? 'unknown'}, commit ${finding.commit ?? 'unknown'} from ${finding.marketplace ?? 'unknown marketplace'}`);
39679
+ diagnostics.push(doctor_diagnostic('AB7334', available ? 0 === copies.length ? `${identity1.plugin}@${identity1.version} is not installed in Grok Bot${staged ? ` (staged at ${(0, node_path__rspack_import_5.join)(grokBotMarketplaceRoot(root), identity1.plugin)}, not yet imported)` : ''}.` : `${identity1.plugin}@${identity1.version} on grokbot: installed (${described.join('; ')}).` : `${identity1.plugin}@${identity1.version} on grokbot: ${'unavailable' === firstInventory.status ? firstInventory.reason : ''}${staged ? ` Staged marketplace: ${(0, node_path__rspack_import_5.join)(grokBotMarketplaceRoot(root), identity1.plugin)}.` : ''}`, copies.length > 0 && void 0 === current ? 'Grok Bot installed a different version: push the rebuilt marketplace and update the plugin in Grok Bot, then rerun Doctor.' : copies.length > 0 ? 'No action needed.' : 'Run `agent-bundle install grokbot`, host the staged marketplace, and install the plugin from Grok Bot\'s Marketplace.', copies.length > 0 && void 0 === current ? 'warning' : 'info', 'grokbot'));
39680
+ } else if (void 0 !== bundleError) {
39681
+ const malformed = malformedBundle('cursor', bundleError);
39682
+ diagnostics.push(...malformed.diagnostics.map((entry)=>Object.freeze({
39683
+ ...entry,
39684
+ target: 'grokbot'
39685
+ })));
39686
+ bundle = malformed.finding;
39687
+ }
39688
+ return Object.freeze({
39689
+ diagnostics: (0, _event_ipc_js__rspack_import_17.cY)(diagnostics),
39690
+ host: 'grokbot',
39691
+ inventory: freezeInventory(available ? 'known' : 'unknown', findings),
39692
+ probe: Object.freeze(available ? {
39693
+ evidence: 'directory',
39694
+ status: 'available'
39695
+ } : {
39696
+ status: 'unavailable'
39697
+ }),
39698
+ receipts: receipts.receipts,
39699
+ ...void 0 === bundle ? {} : {
39700
+ bundle
39701
+ }
39702
+ });
39703
+ };
39328
39704
  const runDoctor = async (options = {})=>{
39329
39705
  const home = options.home ?? (0, node_os__rspack_import_4.homedir)();
39330
39706
  const run = options.commandRunner ?? doctor_defaultCommandRunner;
@@ -39337,7 +39713,7 @@ var __webpack_modules__ = {
39337
39713
  ...new Set(hosts)
39338
39714
  ];
39339
39715
  const hostReports = [];
39340
- for (const host of uniqueHosts)hostReports.push(await doctor_doctorHost(host, options, home, run));
39716
+ for (const host of uniqueHosts)hostReports.push('grokbot' === host ? await doctorGrokBot(options, home) : await doctor_doctorHost(host, options, home, run));
39341
39717
  const endpoints = await scanEndpoints(options.endpointDirectory ?? doctorEndpointDirectory(), options.platform ?? process.platform);
39342
39718
  const diagnostics = (0, _event_ipc_js__rspack_import_17.cY)([
39343
39719
  ...hostReports.flatMap((report)=>report.diagnostics),
@@ -39783,32 +40159,62 @@ var __webpack_modules__ = {
39783
40159
  const shown = entries.slice(0, 5).map((line)=>JSON.stringify(line.slice(3))).join(', ');
39784
40160
  return `its working tree differs from the receipted commit (${entries.length} uncommitted, untracked, or ignored ${1 === entries.length ? 'entry' : 'entries'}: ${shown}${entries.length > 5 ? ', …' : ''}) that the receipt does not own.`;
39785
40161
  };
39786
- const uninstallCursorMarketplace = async (options, identity1, policy)=>{
40162
+ const cursorStagingHost = (options, identity1)=>({
40163
+ host: 'cursor',
40164
+ imported: async (marketplace, receipt, commit)=>void 0 !== commit && await cacheHasPlugin(options.home ?? (0, node_os__rspack_import_4.homedir)(), marketplace, identity1.plugin, receipt?.version ?? identity1.version, commit) ? {
40165
+ detail: `Cursor imported this marketplace (a completed copy exists under ~/.cursor/plugins/cache/${marketplace}); its installed-plugin registry is server-assigned and exposes no non-interactive removal verb.`,
40166
+ nextStep: `Open Cursor, then Customize -> Plugins, and uninstall "${identity1.plugin}" (marketplace ${marketplace}) there.`
40167
+ } : void 0,
40168
+ installCommand: '`agent-bundle install cursor --mode marketplace`',
40169
+ kind: 'cursor-marketplace-staging',
40170
+ label: 'Cursor',
40171
+ root: (0, node_path__rspack_import_5.join)(options.home ?? (0, node_os__rspack_import_4.homedir)(), '.cursor')
40172
+ });
40173
+ const grokBotStagingHost = (options, identity1)=>({
40174
+ host: 'grokbot',
40175
+ imported: async ()=>{
40176
+ const inventory = await readGrokBotInventory(identity1.plugin, options);
40177
+ if ('available' !== inventory.status || 0 === inventory.entries.length) return;
40178
+ const ids = [
40179
+ ...new Set(inventory.entries.map((entry)=>entry.pluginId).filter((id)=>void 0 !== id))
40180
+ ];
40181
+ const copies = inventory.entries.map((entry)=>`${entry.marketplace}@${entry.pluginVersion}${void 0 === entry.pluginId ? '' : ` (plugin id ${entry.pluginId})`}`);
40182
+ return {
40183
+ detail: `Grok Bot has ${identity1.plugin} installed on this account (${copies.join(', ')}); the account install is server-side and exposes no non-interactive removal verb.`,
40184
+ nextStep: `In Grok Bot, open Settings -> Plugins and uninstall "${identity1.plugin}"${0 === ids.length ? '' : ` (plugin id ${ids.join(', ')})`}, or ask a Grok Bot agent to uninstall that plugin id.`
40185
+ };
40186
+ },
40187
+ installCommand: '`agent-bundle install grokbot`',
40188
+ kind: 'grokbot-marketplace-staging',
40189
+ label: 'Grok Bot',
40190
+ root: grokBotRoot(options)
40191
+ });
40192
+ const uninstallStagedMarketplace = async (options, identity1, policy, target)=>{
39787
40193
  const force = true === options.force;
39788
40194
  const marketplace = cursorMarketplaceName(identity1.plugin);
39789
40195
  const base = {
39790
40196
  bundleRoot: identity1.bundleRoot,
39791
40197
  forced: force,
39792
- host: 'cursor',
40198
+ host: target.host,
39793
40199
  marketplace,
39794
40200
  mode: 'marketplace',
39795
40201
  plugin: identity1.plugin,
39796
40202
  scope: 'user',
39797
40203
  version: identity1.version
39798
40204
  };
39799
- const cursorRoot = (0, node_path__rspack_import_5.join)(options.home ?? (0, node_os__rspack_import_4.homedir)(), '.cursor');
39800
- const marketplacesRoot = cursorMarketplaceRoot(cursorRoot);
40205
+ const hostRoot = target.root;
40206
+ const marketplacesRoot = cursorMarketplaceRoot(hostRoot);
39801
40207
  const repoRoot = (0, node_path__rspack_import_5.join)(marketplacesRoot, identity1.plugin);
39802
- const receiptPath = cursorMarketplaceReceiptPath(cursorRoot, identity1.plugin);
40208
+ const receiptPath = cursorMarketplaceReceiptPath(hostRoot, identity1.plugin);
39803
40209
  const data = Object.freeze({
39804
- detail: 'A staged marketplace repository holds no runtime state; a copy Cursor imported from it is Cursor-owned and is not touched.',
40210
+ detail: `A staged marketplace repository holds no runtime state; a copy ${target.label} imported from it is ${target.label}-owned and is not touched.`,
39805
40211
  outcome: 'unavailable',
39806
40212
  paths: Object.freeze([]),
39807
40213
  policy
39808
40214
  });
39809
- const cursorHome = await realDirectory(cursorRoot, 'cursor');
39810
- const repo = void 0 === cursorHome ? void 0 : await realDirectory(repoRoot, 'cursor');
39811
- const receipt = void 0 === cursorHome ? void 0 : await readInstallReceiptFile(receiptPath);
40215
+ const home = await realDirectory(hostRoot, target.host);
40216
+ const repo = void 0 === home ? void 0 : await realDirectory(repoRoot, target.host);
40217
+ const receipt = void 0 === home ? void 0 : await readInstallReceiptFile(receiptPath);
39812
40218
  if (void 0 === repo && void 0 === receipt) return Object.freeze({
39813
40219
  ...base,
39814
40220
  data,
@@ -39817,7 +40223,7 @@ var __webpack_modules__ = {
39817
40223
  registrations: Object.freeze([
39818
40224
  Object.freeze({
39819
40225
  action: 'already-absent',
39820
- kind: 'cursor-marketplace-staging',
40226
+ kind: target.kind,
39821
40227
  name: marketplace
39822
40228
  })
39823
40229
  ]),
@@ -39829,25 +40235,25 @@ var __webpack_modules__ = {
39829
40235
  state: 'not-installed'
39830
40236
  });
39831
40237
  let status = void 0 === receipt ? 'forced-missing' : 'consumed';
39832
- const recorded = receipt?.registrations.find((registration)=>'cursor-marketplace-staging' === registration.kind);
40238
+ const recorded = receipt?.registrations.find((registration)=>registration.kind === target.kind);
39833
40239
  if (void 0 !== repo) if (void 0 === receipt) {
39834
- if (!force) throw uninstall_failure('AB7009', `Refusing to remove staged Cursor marketplace ${repoRoot} without an install receipt at ${receiptPath}. Re-run with --force to remove it after verifying it is this plugin\'s staging, or rerun \`agent-bundle install cursor --mode marketplace\` to record a receipt first.`, 'cursor');
39835
- if (!await readMarketplaceStagingIdentity(repoRoot, identity1.plugin)) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: it is not a staged Agent Bundle marketplace for ${identity1.plugin} (expected .cursor-plugin/marketplace.json naming ${marketplace} and plugins/${identity1.plugin}). --force does not apply.`, 'cursor');
39836
- } else if (receipt.plugin !== identity1.plugin) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: the receipt at ${receiptPath} names plugin ${JSON.stringify(receipt.plugin)}.`, 'cursor');
40240
+ if (!force) throw uninstall_failure('AB7009', `Refusing to remove staged ${target.label} marketplace ${repoRoot} without an install receipt at ${receiptPath}. Re-run with --force to remove it after verifying it is this plugin\'s staging, or rerun ${target.installCommand} to record a receipt first.`, target.host);
40241
+ if (!await readMarketplaceStagingIdentity(repoRoot, identity1.plugin)) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: it is not a staged Agent Bundle marketplace for ${identity1.plugin} (expected .cursor-plugin/marketplace.json naming ${marketplace} and plugins/${identity1.plugin}). --force does not apply.`, target.host);
40242
+ } else if (receipt.plugin !== identity1.plugin) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: the receipt at ${receiptPath} names plugin ${JSON.stringify(receipt.plugin)}.`, target.host);
39837
40243
  else {
39838
40244
  const head = await readHeadCommit(repoRoot);
39839
40245
  if (recorded?.commit !== void 0 && head !== recorded.commit) {
39840
- if (!force) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: its HEAD is ${head ?? 'unresolvable'} but the receipt recorded commit ${recorded.commit}, so the staged repository changed after staging. Re-run with --force to remove it anyway.`, 'cursor');
40246
+ if (!force) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: its HEAD is ${head ?? 'unresolvable'} but the receipt recorded commit ${recorded.commit}, so the staged repository changed after staging. Re-run with --force to remove it anyway.`, target.host);
39841
40247
  status = 'forced-mismatch';
39842
40248
  } else if (recorded?.commit !== void 0) {
39843
40249
  const dirty = await stagedWorkingTreeDirt(options.commandRunner ?? defaultCommandRunner, repoRoot);
39844
40250
  if (void 0 !== dirty) {
39845
- if (!force) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: ${dirty} Move those entries out (or commit them and rerun \`agent-bundle install cursor --mode marketplace\`), or re-run with --force to remove them anyway.`, 'cursor');
40251
+ if (!force) throw uninstall_failure('AB7007', `Refusing to remove ${repoRoot}: ${dirty} Move those entries out (or commit them and rerun ${target.installCommand}), or re-run with --force to remove them anyway.`, target.host);
39846
40252
  status = 'forced-mismatch';
39847
40253
  }
39848
40254
  }
39849
40255
  }
39850
- const imported = recorded?.commit !== void 0 ? await cacheHasPlugin(options.home ?? (0, node_os__rspack_import_4.homedir)(), marketplace, identity1.plugin, receipt?.version ?? identity1.version, recorded.commit) : false;
40256
+ const imported = await target.imported(marketplace, receipt, recorded?.commit);
39851
40257
  const planned = true === options.plan;
39852
40258
  const registrations = [
39853
40259
  Object.freeze({
@@ -39855,19 +40261,19 @@ var __webpack_modules__ = {
39855
40261
  ...recorded?.commit === void 0 ? {} : {
39856
40262
  commit: recorded.commit
39857
40263
  },
39858
- kind: 'cursor-marketplace-staging',
40264
+ kind: target.kind,
39859
40265
  name: marketplace
39860
40266
  })
39861
40267
  ];
39862
40268
  const nextSteps = [];
39863
- if (imported) {
40269
+ if (void 0 !== imported) {
39864
40270
  registrations.push(Object.freeze({
39865
40271
  action: 'manual',
39866
- detail: `Cursor imported this marketplace (a completed copy exists under ~/.cursor/plugins/cache/${marketplace}); its installed-plugin registry is server-assigned and exposes no non-interactive removal verb.`,
39867
- kind: 'cursor-marketplace-staging',
40272
+ detail: imported.detail,
40273
+ kind: target.kind,
39868
40274
  name: marketplace
39869
40275
  }));
39870
- nextSteps.push(`Open Cursor, then Customize -> Plugins, and uninstall "${identity1.plugin}" (marketplace ${marketplace}) there.`);
40276
+ nextSteps.push(imported.nextStep);
39871
40277
  }
39872
40278
  const files = void 0 !== receipt || await (0, _738_1_js__rspack_import_15.t2)(receiptPath) ? [
39873
40279
  receiptPath
@@ -39880,9 +40286,9 @@ var __webpack_modules__ = {
39880
40286
  ...files,
39881
40287
  ...directories
39882
40288
  ]);
39883
- const namespace = (0, node_path__rspack_import_5.join)(cursorRoot, 'agent-bundle');
39884
- const wouldPruneStore = await wouldPrune(installReceiptStoreDirectory(cursorRoot), gone) ? [
39885
- installReceiptStoreDirectory(cursorRoot)
40289
+ const namespace = (0, node_path__rspack_import_5.join)(hostRoot, 'agent-bundle');
40290
+ const wouldPruneStore = await wouldPrune(installReceiptStoreDirectory(hostRoot), gone) ? [
40291
+ installReceiptStoreDirectory(hostRoot)
39886
40292
  ] : [];
39887
40293
  const wouldPruneMarketplaces = await wouldPrune(marketplacesRoot, gone) ? [
39888
40294
  marketplacesRoot
@@ -39916,12 +40322,12 @@ var __webpack_modules__ = {
39916
40322
  force: true,
39917
40323
  recursive: true
39918
40324
  });
39919
- const removedReceipt = await removeStoredInstallReceipt(receiptPath, cursorRoot);
40325
+ const removedReceipt = await removeStoredInstallReceipt(receiptPath, hostRoot);
39920
40326
  const prunedMarketplaces = await pruneEmptyDirectory(marketplacesRoot) ? [
39921
40327
  marketplacesRoot
39922
40328
  ] : [];
39923
- const prunedNamespace = await pruneEmptyDirectory((0, node_path__rspack_import_5.join)(cursorRoot, 'agent-bundle')) ? [
39924
- (0, node_path__rspack_import_5.join)(cursorRoot, 'agent-bundle')
40329
+ const prunedNamespace = await pruneEmptyDirectory((0, node_path__rspack_import_5.join)(hostRoot, 'agent-bundle')) ? [
40330
+ (0, node_path__rspack_import_5.join)(hostRoot, 'agent-bundle')
39925
40331
  ] : [];
39926
40332
  return Object.freeze({
39927
40333
  ...base,
@@ -40422,7 +40828,13 @@ var __webpack_modules__ = {
40422
40828
  const scope = options.scope ?? 'user';
40423
40829
  if (void 0 !== options.mode && 'cursor' !== options.host) return yield* effect__rspack_import_29.fJG(uninstall_failure('AB7003', `Uninstall mode ${JSON.stringify(options.mode)} applies to the cursor host only.`, options.host));
40424
40830
  const policy = resolveDataPolicy(options);
40425
- const identity1 = yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>readBundleIdentity(options.from, options.host));
40831
+ if ('grokbot' === options.host) {
40832
+ if ('user' !== scope) return yield* effect__rspack_import_29.fJG(uninstall_failure('AB7003', `Grok Bot plugin uninstallation supports only user scope, not ${scope}.`, 'grokbot'));
40833
+ const cursorIdentity = yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>readBundleIdentity(options.from, 'cursor'));
40834
+ return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>uninstallStagedMarketplace(options, cursorIdentity, policy, grokBotStagingHost(options, cursorIdentity)));
40835
+ }
40836
+ const host = options.host;
40837
+ const identity1 = yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>readBundleIdentity(options.from, host));
40426
40838
  switch(options.host){
40427
40839
  case 'amp':
40428
40840
  return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>uninstallAmp(options, identity1, scope, policy));
@@ -40432,7 +40844,7 @@ var __webpack_modules__ = {
40432
40844
  return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>uninstallPublicCli(options, identity1, 'codex', scope, policy));
40433
40845
  case 'cursor':
40434
40846
  if ('user' !== scope) return yield* effect__rspack_import_29.fJG(uninstall_failure('AB7003', `Cursor plugin uninstallation supports only user scope, not ${scope}.`, 'cursor'));
40435
- return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>'marketplace' === options.mode ? uninstallCursorMarketplace(options, identity1, policy) : uninstallCursorLocal(options, identity1, policy));
40847
+ return yield* (0, _event_ipc_js__rspack_import_17.Z6)(()=>'marketplace' === options.mode ? uninstallStagedMarketplace(options, identity1, policy, cursorStagingHost(options, identity1)) : uninstallCursorLocal(options, identity1, policy));
40436
40848
  default:
40437
40849
  {
40438
40850
  const exhaustive = options.host;