agents-inc 0.173.0 → 0.174.0
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.
- package/CHANGELOG.md +54 -0
- package/dist/{chunk-Q4UNHVPX.js → chunk-3PJZ4QNJ.js} +7 -7
- package/dist/{chunk-3N4FSTVX.js → chunk-6PGXTLA4.js} +2 -2
- package/dist/{chunk-ITQF35UQ.js → chunk-7BHDKEGK.js} +3 -3
- package/dist/{chunk-7OG635DK.js → chunk-AIBVAYHS.js} +6 -2
- package/dist/{chunk-7OG635DK.js.map → chunk-AIBVAYHS.js.map} +1 -1
- package/dist/{chunk-AARQBW5L.js → chunk-APWMMZOK.js} +30 -23
- package/dist/chunk-APWMMZOK.js.map +1 -0
- package/dist/{chunk-WVFBBZEP.js → chunk-E45IT3HC.js} +117 -22
- package/dist/chunk-E45IT3HC.js.map +1 -0
- package/dist/{chunk-F437ICEG.js → chunk-ECPFYHDX.js} +2 -2
- package/dist/{chunk-EHJIQDXR.js → chunk-EFXVYQGT.js} +4 -4
- package/dist/{chunk-G7NUK3BF.js → chunk-FQF6VHO3.js} +29 -19
- package/dist/chunk-FQF6VHO3.js.map +1 -0
- package/dist/chunk-H5E6IO2L.js +116 -0
- package/dist/chunk-H5E6IO2L.js.map +1 -0
- package/dist/{chunk-3R3LHA4Q.js → chunk-I3WF6L43.js} +2 -2
- package/dist/{chunk-LJQXQTFC.js → chunk-IAQFZFWD.js} +4 -4
- package/dist/{chunk-BRZA7ZCX.js → chunk-IXVGBUWI.js} +5 -5
- package/dist/{chunk-2RTBSLSR.js → chunk-ORO2T4K2.js} +19 -5
- package/dist/chunk-ORO2T4K2.js.map +1 -0
- package/dist/{chunk-A3ZAXL5T.js → chunk-QCX66KBM.js} +3 -3
- package/dist/{chunk-VSPC74SS.js → chunk-R7GKQBZJ.js} +10 -9
- package/dist/chunk-R7GKQBZJ.js.map +1 -0
- package/dist/{chunk-VR6QTK5Z.js → chunk-REHVGFJE.js} +5 -5
- package/dist/{chunk-SPQSNZMM.js → chunk-TVEDNGVP.js} +2 -2
- package/dist/{chunk-MHAQWMNJ.js → chunk-WUSEZFER.js} +1 -5
- package/dist/{chunk-MHAQWMNJ.js.map → chunk-WUSEZFER.js.map} +1 -1
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +6 -6
- package/dist/commands/compile.js +12 -12
- package/dist/commands/doctor.js +7 -7
- package/dist/commands/edit.js +56 -59
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +10 -10
- package/dist/commands/init.js +17 -18
- package/dist/commands/list.js +41 -16
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +4 -4
- package/dist/commands/search.js +9 -9
- package/dist/commands/share.js +9 -9
- package/dist/commands/uninstall.js +25 -24
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +6 -6
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +3 -3
- package/dist/components/common/summary-panel.js +4 -7
- package/dist/hooks/init.js +40 -25
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-5U5KAURA.js +14 -0
- package/dist/{recompile-project-agents-6G6M2RS6.js → recompile-project-agents-KYK44C24.js} +8 -8
- package/dist/{source-loader-W7XCNKNA.js → source-loader-G5I4RNUP.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-2RTBSLSR.js.map +0 -1
- package/dist/chunk-AARQBW5L.js.map +0 -1
- package/dist/chunk-G7NUK3BF.js.map +0 -1
- package/dist/chunk-N33AKFLR.js +0 -24
- package/dist/chunk-N33AKFLR.js.map +0 -1
- package/dist/chunk-Q6WRR4BN.js +0 -195
- package/dist/chunk-Q6WRR4BN.js.map +0 -1
- package/dist/chunk-VSPC74SS.js.map +0 -1
- package/dist/chunk-WVFBBZEP.js.map +0 -1
- package/dist/components/common/scroll-affordance.js +0 -9
- package/dist/load-agent-defs-E67DSYTN.js +0 -14
- package/dist/source-loader-W7XCNKNA.js.map +0 -1
- /package/dist/{chunk-Q4UNHVPX.js.map → chunk-3PJZ4QNJ.js.map} +0 -0
- /package/dist/{chunk-3N4FSTVX.js.map → chunk-6PGXTLA4.js.map} +0 -0
- /package/dist/{chunk-ITQF35UQ.js.map → chunk-7BHDKEGK.js.map} +0 -0
- /package/dist/{chunk-F437ICEG.js.map → chunk-ECPFYHDX.js.map} +0 -0
- /package/dist/{chunk-EHJIQDXR.js.map → chunk-EFXVYQGT.js.map} +0 -0
- /package/dist/{chunk-3R3LHA4Q.js.map → chunk-I3WF6L43.js.map} +0 -0
- /package/dist/{chunk-LJQXQTFC.js.map → chunk-IAQFZFWD.js.map} +0 -0
- /package/dist/{chunk-BRZA7ZCX.js.map → chunk-IXVGBUWI.js.map} +0 -0
- /package/dist/{chunk-A3ZAXL5T.js.map → chunk-QCX66KBM.js.map} +0 -0
- /package/dist/{chunk-VR6QTK5Z.js.map → chunk-REHVGFJE.js.map} +0 -0
- /package/dist/{chunk-SPQSNZMM.js.map → chunk-TVEDNGVP.js.map} +0 -0
- /package/dist/{components/common/scroll-affordance.js.map → load-agent-defs-5U5KAURA.js.map} +0 -0
- /package/dist/{recompile-project-agents-6G6M2RS6.js.map → recompile-project-agents-KYK44C24.js.map} +0 -0
- /package/dist/{load-agent-defs-E67DSYTN.js.map → source-loader-G5I4RNUP.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/uninstall.tsx"],"sourcesContent":["import React from \"react\";\nimport { unique, uniqueBy } from \"remeda\";\nimport path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\n\nimport { BaseCommand } from \"../base-command\";\nimport { Confirm } from \"../components/common/confirm.js\";\nimport { promptConfirm } from \"../components/common/prompt-confirm.js\";\nimport { summaryPanelBlock, type SummaryPanelProps } from \"../components/common/summary-panel.js\";\nimport { getErrorMessage } from \"../utils/errors\";\nimport {\n directoryExists,\n fileExists,\n listDirectories,\n remove,\n removeDirIfEmpty,\n} from \"../utils/fs\";\nimport { plural } from \"../utils/string\";\nimport { listAgentFilesOf, splitAgentsByProvenance } from \"../lib/agents\";\nimport { hostAt } from \"../lib/hosts/host-for.js\";\nimport type { PluginHost, PluginRemovalOutcome } from \"../lib/hosts/plugin-host.js\";\nimport {\n listPluginNames,\n getProjectPluginsDir,\n buildMarketplacePluginRef,\n parseMarketplacePluginRef,\n} from \"../lib/plugins/index\";\nimport { type LocalSkillMetadata, readLocalSkillMetadata } from \"../lib/skills/skill-metadata\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../lib/installation/index\";\nimport {\n lazyGateDeps,\n mutateGlobal,\n propagateGlobalRemoval,\n type GateReport,\n} from \"../lib/config-gate/index.js\";\nimport { loadSkillsMatrixFromSource } from \"../lib/loading\";\nimport { loadAgentDefs } from \"../lib/operations\";\nimport { ConfigLoadError, loadProjectConfigAt } from \"../lib/configuration/project-config\";\nimport type { Provider } from \"../consts\";\nimport { CLAUDE_DIR, DEFAULT_BRANDING, EJECT_SOURCE, STANDARD_FILES } from \"../consts\";\nimport {\n providerInUse,\n agentCodec,\n type AgentCodec,\n sourceFolderInUse,\n sourceRootOf,\n type SourceRoot,\n} from \"../lib/installation/install-layout.js\";\nimport {\n providerFlag,\n providerNamedBy,\n refuseAnAmbiguousInstallation,\n} from \"../lib/installation/provider-flag.js\";\nimport { isActiveAt } from \"../lib/configuration/scope-predicates.js\";\nimport { isAgentName } from \"../utils/type-guards.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes\";\nimport {\n SUCCESS_MESSAGES,\n INFO_MESSAGES,\n configFileRemoved,\n notInstalledHere,\n pluginLeftRegistered,\n unmarkedAgentsKept,\n registeredProjectsUpdated,\n registeredProjectUpdateSkipped,\n registeredProjectsUpdateFailed,\n uninstallConfigUnreadable,\n uninstallNeedsTerminal,\n uninstallSkillMetadataUnreadable,\n} from \"../utils/messages\";\nimport type {\n AgentDefinition,\n AgentName,\n MergedSkillsMatrix,\n ProjectConfig,\n SkillId,\n} from \"../types/index\";\nimport type { AgentScopeConfig, SkillConfig, SkillScope } from \"../types/config\";\n\n/** Paths and names, never display strings, so the preview and the removal read one value. */\ntype RemovalEntry =\n | { kind: \"plugins\"; pluginsDir: string; names: string[] }\n | { kind: \"skills\"; skillsDir: string; skillNames: string[] }\n | { kind: \"agents\"; agentsDir: string; agentNames: string[]; codec: AgentCodec }\n | { kind: \"config\"; sourceDir: string; fileNames: string[] };\n\ntype PluginRemoval = Extract<RemovalEntry, { kind: \"plugins\" }>;\ntype SkillsRemoval = Extract<RemovalEntry, { kind: \"skills\" }>;\ntype AgentsRemoval = Extract<RemovalEntry, { kind: \"agents\" }>;\ntype ConfigManifestRemoval = Extract<RemovalEntry, { kind: \"config\" }>;\n\ntype RemovalPlan = {\n entries: RemovalEntry[];\n kept: string[];\n};\n\nfunction buildRemovalPlan(target: UninstallTarget): RemovalPlan {\n const agents = compiledAgentsEntry(target);\n\n return {\n entries: [\n ...pluginsEntry(target),\n ...localSkillsEntry(target),\n ...agents,\n ...configManifestEntries(target),\n ],\n kept: keptStatements(target, agents),\n };\n}\n\n/**\n * Its rows are the plan's, never the config's, so the panel names no removal the run will not\n * make. In a project the global entries its config copies stay, so they show as kept.\n */\nfunction removalPanel(plan: RemovalPlan, target: UninstallTarget): SummaryPanelProps {\n const kept = target.scope === \"project\" ? globalEntriesOf(target.config) : NOTHING_KEPT;\n return {\n skillConfigs: kept.skills,\n agentConfigs: kept.agents,\n installedSkillConfigs: [...removedSkills(plan, target), ...kept.skills],\n installedAgentConfigs: [...namedAgentRemovals(plan, target.scope).named, ...kept.agents],\n isInitMode: false,\n skillNames: namesTheCopiesRecord(target.cliSkills),\n stackName: undefined,\n };\n}\n\n/** Uninstall loads no marketplace, so a skill the built-in catalogue lacks is named by its copy. */\nfunction namesTheCopiesRecord(cliSkills: CliSkill[]): ReadonlyMap<SkillId, string> {\n return new Map(\n cliSkills.flatMap(({ skillId, displayName }): [SkillId, string][] =>\n displayName === undefined ? [] : [[skillId, displayName]],\n ),\n );\n}\n\ntype PanelEntries = { skills: SkillConfig[]; agents: AgentScopeConfig[] };\n\nconst NOTHING_KEPT: PanelEntries = { skills: [], agents: [] };\n\nfunction globalEntriesOf(config: ProjectConfig | null): PanelEntries {\n if (config === null) return NOTHING_KEPT;\n return {\n skills: config.skills.filter((skill) => isActiveAt(skill, \"global\")),\n agents: config.agents.filter((agent) => isActiveAt(agent, \"global\")),\n };\n}\n\n/**\n * A copy by the skill its provenance records; a plugin by the config skill it was matched against.\n * One row a skill: a skill registered under two marketplaces' names is still one skill.\n */\nfunction removedSkills(plan: RemovalPlan, target: UninstallTarget): SkillConfig[] {\n const copied = new Set(planEntries(plan, \"skills\").flatMap((entry) => entry.skillNames));\n const plugins = new Set(planEntries(plan, \"plugins\").flatMap((entry) => entry.names));\n const marketplaceName = target.config?.marketplaceName;\n const copies = target.cliSkills\n .filter(({ dirName }) => copied.has(dirName))\n .map(({ skillId }) => ({ id: skillId, scope: target.scope, origin: EJECT_SOURCE }));\n const pluginSkills = (target.config?.skills ?? [])\n .filter((skill) => !skill.excluded)\n .filter((skill) => pluginRefsOf(skill, marketplaceName).some((ref) => plugins.has(ref)))\n .map((skill) => ({ ...skill, scope: target.scope }));\n\n return uniqueBy([...copies, ...pluginSkills], (skill) => skill.id);\n}\n\n/** A compiled file whose name no sub-agent carries is named by its path instead. */\nfunction namedAgentRemovals(\n plan: RemovalPlan,\n scope: SkillScope,\n): { named: AgentScopeConfig[]; files: string[] } {\n const entries = planEntries(plan, \"agents\");\n const names = entries.flatMap((entry) => entry.agentNames);\n return {\n named: names.filter(isAgentName).map((name) => ({ name, scope })),\n files: entries.flatMap((entry) =>\n entry.agentNames\n .filter((name) => !isAgentName(name))\n .map((name) => path.join(entry.agentsDir, `${name}${entry.codec.extension}`)),\n ),\n };\n}\n\nfunction hasAnythingToRemove(plan: RemovalPlan): boolean {\n return plan.entries.length > 0;\n}\n\n/** The files the plan deletes that the panel has no row for, marked as it marks a removal. */\nfunction removedFileLines(plan: RemovalPlan, scope: SkillScope): string[] {\n const configFiles = planEntries(plan, \"config\").flatMap((entry) =>\n entry.fileNames.map((fileName) => `${entry.sourceDir}/${fileName}`),\n );\n return [...namedAgentRemovals(plan, scope).files, ...configFiles].map(configFileRemoved);\n}\n\nfunction pluginsEntry(target: UninstallTarget): PluginRemoval[] {\n if (!target.hasPlugins) return [];\n return [{ kind: \"plugins\", pluginsDir: target.pluginsDir, names: [...target.cliPluginNames] }];\n}\n\nfunction localSkillsEntry(target: UninstallTarget): SkillsRemoval[] {\n if (target.cliSkills.length === 0) return [];\n return [\n {\n kind: \"skills\",\n skillsDir: target.skillsDir,\n skillNames: target.cliSkills.map(({ dirName }) => dirName),\n },\n ];\n}\n\nfunction compiledAgentsEntry(target: UninstallTarget): AgentsRemoval[] {\n const agentNames = identifiableAgents(target);\n if (agentNames.length === 0) return [];\n\n return [{ kind: \"agents\", agentsDir: target.agentsDir, agentNames, codec: target.agentCodec }];\n}\n\n/**\n * Only those with a file here, so the plan names no removal the run will not make: the config's\n * roster (pre-marker installs carry no marker) and every provenance-marked file, each once.\n */\nfunction identifiableAgents(target: UninstallTarget): string[] {\n const agentFiles = new Set([...target.markedAgents, ...target.unmarkedAgents]);\n const configuredWithAFile = target.configuredAgents.filter((name) => agentFiles.has(name));\n return unique([...configuredWithAFile, ...target.markedAgents]);\n}\n\nfunction configManifestEntries(target: UninstallTarget): ConfigManifestRemoval[] {\n const { dir, manifestFiles } = target.sourceFolder;\n if (manifestFiles.length === 0) return [];\n return [{ kind: \"config\", sourceDir: dir, fileNames: manifestFiles }];\n}\n\n/** Derived from the removal, so no agent can be both removed and kept. */\nfunction keptStatements(target: UninstallTarget, agentRemovals: AgentsRemoval[]): string[] {\n const removing = new Set(agentRemovals.flatMap((entry) => entry.agentNames));\n const kept = target.unmarkedAgents.filter((name) => !removing.has(name));\n if (kept.length === 0) return [];\n return [unmarkedAgentsKept(target.agentsDir, kept.length)];\n}\n\nfunction planEntries<K extends RemovalEntry[\"kind\"]>(\n plan: RemovalPlan,\n kind: K,\n): Extract<RemovalEntry, { kind: K }>[] {\n return plan.entries.filter(\n (entry): entry is Extract<RemovalEntry, { kind: K }> => entry.kind === kind,\n );\n}\n\nfunction planEntry<K extends RemovalEntry[\"kind\"]>(\n plan: RemovalPlan,\n kind: K,\n): Extract<RemovalEntry, { kind: K }> | undefined {\n return plan.entries.find(\n (entry): entry is Extract<RemovalEntry, { kind: K }> => entry.kind === kind,\n );\n}\n\nconst UNINSTALL_CONFIRM_MESSAGE = \"Are you sure you want to uninstall?\";\n\nexport default class Uninstall extends BaseCommand {\n /** Replaced in `run` before anything prints. */\n private brandingName: string = DEFAULT_BRANDING.NAME;\n\n static summary = `Remove ${DEFAULT_BRANDING.NAME} from this project`;\n\n static description = `Uninstall ${DEFAULT_BRANDING.NAME} from this project. Removes CLI-managed skills (matched by marketplace), compiled agents, plugins, and the config manifest (config.ts + config-types.ts) this project keeps. User-created content is preserved.`;\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --yes\",\n ];\n\n static flags = {\n yes: Flags.boolean({\n char: \"y\",\n description: \"Skip confirmation prompt\",\n default: false,\n }),\n provider: providerFlag(),\n };\n\n protected async ensureTerminalSize(): Promise<void> {\n // Any size: uninstall is the way out of every state.\n }\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Uninstall);\n const projectDir = process.cwd();\n const namedProvider = providerNamedBy(flags.provider);\n\n // Before anything is detected: removing the wrong one of two installations is destructive.\n await refuseAnAmbiguousInstallation(projectDir, \"uninstall\", namedProvider, (message) =>\n this.error(message, { exit: EXIT_CODES.INVALID_ARGS }),\n );\n\n this.brandingName = await this.resolveBrandingName(projectDir);\n\n this.printHeader();\n\n const target = await detectUninstallTarget(projectDir, {\n onConfigLoadFailed: (failure) => this.warn(uninstallConfigUnreadable(failure)),\n // Aborts: guessing would either remove the user's skill or keep this CLI's.\n onSkillMetadataUnreadable: (metadataPath) =>\n this.error(uninstallSkillMetadataUnreadable(metadataPath), { exit: EXIT_CODES.ERROR }),\n });\n const plan = buildRemovalPlan(target);\n if (!hasAnythingToRemove(plan)) {\n this.reportNothingToUninstall();\n return;\n }\n\n const approved = await this.removalApproved(plan, target, flags.yes, namedProvider);\n if (!approved) this.cancelUninstall();\n\n await this.executeUninstall(plan, target, projectDir);\n this.reportSuccess();\n }\n\n private printHeader(): void {\n this.log(\"\");\n this.log(`${this.brandingName} Uninstall`);\n this.log(\"\");\n }\n\n private reportNothingToUninstall(): void {\n this.warn(\"Nothing to uninstall.\");\n this.log(\"\");\n this.log(notInstalledHere(this.brandingName));\n this.log(\"\");\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n }\n\n /** With `--yes` nothing is asked, so the plan prints where the question would be. */\n private async removalApproved(\n plan: RemovalPlan,\n target: UninstallTarget,\n skipConfirmation: boolean,\n namedProvider: Provider | undefined,\n ): Promise<boolean> {\n if (!skipConfirmation) return this.confirmRemoval(plan, target, namedProvider);\n\n this.showRemovalPlan(plan, target);\n return true;\n }\n\n private cancelUninstall(): never {\n this.log(\"\");\n this.log(\"Uninstall cancelled\");\n this.exit(EXIT_CODES.CANCELLED);\n }\n\n private showRemovalPlan(plan: RemovalPlan, target: UninstallTarget): void {\n const lines = summaryPanelBlock(\n removalPanel(plan, target),\n removedFileLines(plan, target.scope),\n plan.kept,\n );\n for (const line of lines) {\n this.log(line);\n }\n }\n\n private async confirmRemoval(\n plan: RemovalPlan,\n target: UninstallTarget,\n namedProvider: Provider | undefined,\n ): Promise<boolean> {\n // A confirm nobody can answer must never become a yes.\n if (!process.stdin.isTTY) {\n this.error(uninstallNeedsTerminal(namedProvider), { exit: EXIT_CODES.ERROR });\n }\n\n this.showRemovalPlan(plan, target);\n const outcome = await promptConfirm(({ onConfirm, onCancel }) => (\n <Confirm message={UNINSTALL_CONFIRM_MESSAGE} onConfirm={onConfirm} onCancel={onCancel} />\n ));\n return outcome === \"confirmed\";\n }\n\n private async executeUninstall(\n plan: RemovalPlan,\n target: UninstallTarget,\n projectDir: string,\n ): Promise<void> {\n const isGlobalUninstall = isHomeDirectory(projectDir);\n // Before any removal: the registry and source live in the global config about to be deleted.\n const propagation = isGlobalUninstall\n ? await this.prepareGlobalPropagation(target, projectDir)\n : null;\n\n await this.removePlannedPlugins(planEntry(plan, \"plugins\"), target.config, projectDir);\n await this.removeLocalFilesOrFail(plan, target);\n\n if (!isGlobalUninstall) {\n await this.deregisterProject(projectDir, target.provider);\n return;\n }\n if (propagation) await this.updateRegisteredProjects(propagation);\n }\n\n /** Degrades: a missing or corrupt global config must never fail the uninstall. */\n private async deregisterProject(projectDir: string, provider: Provider): Promise<void> {\n try {\n // Lazy deps: deregistering inlines nothing, so the uninstall stays offline.\n await mutateGlobal(\n { kind: \"deregister-project\", projectDir, provider },\n lazyGateDeps(projectDir),\n );\n } catch (error) {\n this.warn(`Could not update the global project registry: ${getErrorMessage(error)}`);\n }\n }\n\n /**\n * A load failure warns and never aborts. `skipExtraSources` cannot change the output (extra\n * sources only annotate skills) and keeps the uninstall off the network.\n */\n private async prepareGlobalPropagation(\n target: UninstallTarget,\n projectDir: string,\n ): Promise<GlobalPropagationData | null> {\n if (target.config === null || target.registeredProjects.length === 0) return null;\n const globalConfig = target.config;\n\n try {\n const [sourceResult, agentDefs] = await Promise.all([\n loadSkillsMatrixFromSource({\n projectDir,\n purpose: \"upkeep\",\n skipExtraSources: true,\n matrixOnly: true,\n }),\n loadAgentDefs(),\n ]);\n return {\n globalConfig,\n matrix: sourceResult.matrix,\n agents: agentDefs.agents,\n provider: providerInUse(projectDir),\n };\n } catch (error) {\n this.warn(registeredProjectsUpdateFailed(getErrorMessage(error)));\n return null;\n }\n }\n\n /** Runs after the global manifest is gone, so regenerated types use the standalone form. */\n private async updateRegisteredProjects(propagation: GlobalPropagationData): Promise<void> {\n try {\n const report = await propagateGlobalRemoval(\n propagation.globalConfig,\n { matrix: propagation.matrix, agents: propagation.agents },\n propagation.provider,\n );\n this.reportRegisteredProjectsUpdate(report);\n } catch (error) {\n this.warn(registeredProjectsUpdateFailed(getErrorMessage(error)));\n }\n }\n\n private reportRegisteredProjectsUpdate(report: GateReport): void {\n const { updated, unreadable, failed } = report.propagated;\n this.reportProjectsOutOfReach(report.propagated);\n for (const skippedPath of [...unreadable, ...failed]) {\n this.warn(registeredProjectUpdateSkipped(skippedPath));\n }\n if (updated.length === 0) return;\n\n this.logSuccess(registeredProjectsUpdated(updated.length));\n this.reportPropagatedRecompile(report);\n }\n\n private reportSuccess(): void {\n this.log(\"\");\n this.log(`${this.brandingName} has been uninstalled.`);\n this.log(\"\");\n this.logSuccess(SUCCESS_MESSAGES.UNINSTALL_COMPLETE);\n this.log(\"\");\n }\n\n private async removeLocalFilesOrFail(plan: RemovalPlan, target: UninstallTarget): Promise<void> {\n try {\n await this.removeLocalFiles(plan, target);\n } catch (error) {\n this.log(\"Failed to remove local files\");\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async removeLocalFiles(plan: RemovalPlan, target: UninstallTarget): Promise<void> {\n await this.removePlannedSkills(planEntry(plan, \"skills\"));\n await this.removePlannedAgents(planEntry(plan, \"agents\"));\n\n for (const statement of plan.kept) {\n this.log(statement);\n }\n\n const cleanup = await cleanupEmptyDirs(target, planEntries(plan, \"config\"));\n\n this.reportSourceFolderCleanup(cleanup.sourceFolder);\n this.reportDirCleanup(target.sourceRoot.relName, cleanup.sourceRoot);\n this.reportDirCleanup(CLAUDE_DIR, cleanup.claudeDir);\n }\n\n private reportSourceFolderCleanup({ relName, outcome }: SourceFolderCleanup): void {\n if (outcome === \"config-removed\") {\n this.logSuccess(`Removed CLI config from ${relName}/`);\n return;\n }\n this.reportDirCleanup(relName, outcome);\n }\n\n private reportDirCleanup(relName: string, cleanup: DirCleanup): void {\n switch (cleanup) {\n case \"removed\":\n this.logSuccess(`Removed ${relName}/`);\n return;\n case \"kept\":\n this.log(`Kept ${relName}/ (contains user content)`);\n return;\n case \"untouched\":\n return;\n default: {\n const _exhaustive: never = cleanup;\n return _exhaustive;\n }\n }\n }\n\n private async removePlannedPlugins(\n entry: PluginRemoval | undefined,\n config: ProjectConfig | null,\n projectDir: string,\n ): Promise<void> {\n if (!entry) return;\n\n this.log(\"Uninstalling plugins...\");\n\n try {\n const pluginResult = await uninstallPlugins(entry, config, projectDir, {\n onUninstalled: (name) => this.log(` Uninstalled plugin '${name}'`),\n onLeftRegistered: (name, provider) => this.warn(pluginLeftRegistered(name, provider)),\n });\n\n // Silent on zero: \"0\" beside a plan that named one reads as a failure, and is not one.\n if (pluginResult.totalUninstalled > 0) {\n this.logSuccess(`Uninstalled ${plural(pluginResult.totalUninstalled, \"plugin\")}`);\n }\n } catch (error) {\n this.log(\"Plugin uninstall failed\");\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async removePlannedSkills(entry: SkillsRemoval | undefined): Promise<void> {\n if (!entry) return;\n\n const removedNames = await removeMatchingSkills(entry, (dirName) =>\n this.log(` Uninstalled skill '${dirName}'`),\n );\n if (removedNames.length === 0) return;\n\n this.logSuccess(`Removed ${plural(removedNames.length, \"CLI-installed skill\")}`);\n }\n\n private async removePlannedAgents(entry: AgentsRemoval | undefined): Promise<void> {\n if (!entry) return;\n\n const removedNames = await removeMatchingAgents(entry, (agentName) =>\n this.log(` Uninstalled agent '${agentName}'`),\n );\n if (removedNames.length === 0) return;\n\n this.logSuccess(`Removed ${plural(removedNames.length, \"compiled agent\")}`);\n }\n}\n\n/** A skill folder this CLI installed: removed by its folder, shown by the skill and name it records. */\ntype CliSkill = { dirName: string; skillId: SkillId; displayName: string | undefined };\n\ntype UninstallTarget = {\n /** Home is the global scope, so a run there removes global entries. */\n scope: SkillScope;\n /** Read before removal, which deletes the folder that says which. */\n provider: Provider;\n hasPlugins: boolean;\n /** Only those this CLI installed, matched against config skills. */\n cliPluginNames: string[];\n /** Carrying `forkedFrom`: this CLI installed them. The rest are the user's, never removed. */\n cliSkills: CliSkill[];\n hasClaudeDir: boolean;\n pluginsDir: string;\n skillsDir: string;\n agentsDir: string;\n agentCodec: AgentCodec;\n claudeDir: string;\n sourceFolder: ScopeSourceFolder;\n sourceRoot: SourceRoot;\n config: ProjectConfig | null;\n registeredProjects: string[];\n configuredAgents: AgentName[];\n markedAgents: string[];\n /** The user's, unless the config claims them. */\n unmarkedAgents: string[];\n};\n\ntype ScopeSourceFolder = {\n dir: string;\n relName: string;\n manifestFiles: string[];\n /** `null` when absent or unreadable. */\n config: ProjectConfig | null;\n};\n\n/** Captured before removal: all of it comes from the config and folder being deleted. */\ntype GlobalPropagationData = {\n globalConfig: ProjectConfig;\n matrix: MergedSkillsMatrix;\n agents: Partial<Record<AgentName, AgentDefinition>>;\n provider: Provider;\n};\n\ntype UninstallPluginsResult = {\n totalUninstalled: number;\n};\n\ntype PluginRemovalReporter = {\n onUninstalled?: (pluginName: string) => void;\n /** No host CLI to ask, so the plugin's registration outlives its folder. */\n onLeftRegistered?: (pluginName: string, provider: Provider) => void;\n};\n\n/** `kept`: still there because of content this CLI never wrote. */\ntype DirCleanup = \"removed\" | \"kept\" | \"untouched\";\n\n/** `config-removed`: the manifest went, and the folder stayed for what else it holds. */\ntype SourceFolderCleanup = { relName: string; outcome: DirCleanup | \"config-removed\" };\n\ntype CleanupResult = {\n sourceFolder: SourceFolderCleanup;\n sourceRoot: DirCleanup;\n claudeDir: DirCleanup;\n};\n\nfunction collectConfiguredAgents(config: Partial<ProjectConfig> | null): AgentName[] {\n if (!config?.agents) return [];\n return config.agents.map((a) => a.name);\n}\n\nfunction getCliInstalledPluginKeys(config: Partial<ProjectConfig> | null): Set<string> {\n if (!config?.skills) return new Set();\n const { marketplaceName } = config;\n return new Set(config.skills.flatMap((skill) => pluginRefsOf(skill, marketplaceName)));\n}\n\nfunction pluginRefsOf(skill: SkillConfig, marketplaceName: string | undefined): string[] {\n const ownRef = buildMarketplacePluginRef(skill.id, skill.origin);\n if (!marketplaceName || skill.origin === marketplaceName || skill.origin === EJECT_SOURCE) {\n return [ownRef];\n }\n // Installed via the marketplace while `origin` names something else.\n return [ownRef, buildMarketplacePluginRef(skill.id, marketplaceName)];\n}\n\n/**\n * Degrades: a `ConfigLoadError` is reported and treated as a missing config, since that is when a\n * user needs to uninstall. Any other failure propagates.\n */\nasync function loadUninstallConfig(\n configPath: string,\n projectDir: string,\n provider: Provider,\n onLoadFailed: (failure: ConfigLoadError) => void,\n): Promise<ProjectConfig | null> {\n try {\n const result = await loadProjectConfigAt(configPath, projectDir, provider);\n return result?.config ?? null;\n } catch (error) {\n if (!(error instanceof ConfigLoadError)) throw error;\n onLoadFailed(error);\n return null;\n }\n}\n\n/** Its config is read under {@link loadUninstallConfig}'s degrade posture. */\nasync function readSourceFolder(\n folder: Pick<ScopeSourceFolder, \"dir\" | \"relName\">,\n projectDir: string,\n provider: Provider,\n onConfigLoadFailed: (failure: ConfigLoadError) => void,\n): Promise<ScopeSourceFolder> {\n const [manifestFiles, config] = await Promise.all([\n manifestFilesIn(folder.dir),\n loadUninstallConfig(\n path.join(folder.dir, STANDARD_FILES.CONFIG_TS),\n projectDir,\n provider,\n onConfigLoadFailed,\n ),\n ]);\n return { ...folder, manifestFiles, config };\n}\n\nasync function manifestFilesIn(dir: string): Promise<string[]> {\n const manifest = [STANDARD_FILES.CONFIG_TS, STANDARD_FILES.CONFIG_TYPES_TS];\n const present = await Promise.all(\n manifest.map((fileName) => fileExists(path.join(dir, fileName))),\n );\n return manifest.filter((_, index) => present[index]);\n}\n\nfunction activeConfigOf(config: ProjectConfig): ProjectConfig {\n return {\n ...config,\n skills: config.skills.filter((s) => !s.excluded),\n agents: config.agents.filter((a) => !a.excluded),\n };\n}\n\ntype DetectionFailureHandlers = {\n /** Degrades: see {@link loadUninstallConfig}. */\n onConfigLoadFailed: (failure: ConfigLoadError) => void;\n onSkillMetadataUnreadable: (metadataPath: string) => never;\n};\n\nasync function detectUninstallTarget(\n projectDir: string,\n handlers: DetectionFailureHandlers,\n): Promise<UninstallTarget> {\n const pluginsDir = getProjectPluginsDir(projectDir);\n const { skillsDir, agentsDir } = resolveInstallPaths(projectDir);\n const claudeDir = path.join(projectDir, CLAUDE_DIR);\n const provider = providerInUse(projectDir);\n const codec = agentCodec(provider);\n\n const [cliSkills, hasClaudeDir, sourceFolder, agentProvenance] = await Promise.all([\n skillsThisCliInstalled(skillsDir, handlers.onSkillMetadataUnreadable),\n directoryExists(claudeDir),\n readSourceFolder(\n sourceFolderInUse(projectDir, provider),\n projectDir,\n provider,\n handlers.onConfigLoadFailed,\n ),\n splitAgentsByProvenance(agentsDir, codec),\n ]);\n\n const { config } = sourceFolder;\n const activeConfig = config === null ? null : activeConfigOf(config);\n const cliPluginNames = await pluginsThisRunRemoves(projectDir, activeConfig);\n\n return {\n scope: isHomeDirectory(projectDir) ? \"global\" : \"project\",\n provider,\n hasPlugins: cliPluginNames.length > 0,\n cliPluginNames,\n cliSkills,\n hasClaudeDir,\n pluginsDir,\n skillsDir,\n agentsDir,\n claudeDir,\n sourceFolder,\n sourceRoot: sourceRootOf(projectDir),\n config,\n registeredProjects: config?.projects ?? [],\n configuredAgents: collectConfiguredAgents(activeConfig),\n agentCodec: codec,\n markedAgents: agentProvenance.marked,\n unmarkedAgents: agentProvenance.unmarked,\n };\n}\n\nasync function pluginsThisRunRemoves(\n projectDir: string,\n activeConfig: ProjectConfig | null,\n): Promise<string[]> {\n const installed = await listPluginNames(projectDir);\n if (!thisRunOwnsAnyPlugin(projectDir)) return [];\n\n const cliInstalledKeys = getCliInstalledPluginKeys(activeConfig);\n return installed.filter((name) => cliInstalledKeys.has(name));\n}\n\n/**\n * A host without project-scoped plugins (Codex) shares them machine-wide, so a project uninstall\n * there must not sweep them. A global uninstall owns them on any host.\n */\nfunction thisRunOwnsAnyPlugin(projectDir: string): boolean {\n if (isHomeDirectory(projectDir)) return true;\n return hostAt(projectDir).installsProjectScopedPlugins;\n}\n\n/** Read before the plan is built, so the plan and the removal read one classification. */\nasync function skillsThisCliInstalled(\n skillsDir: string,\n onMetadataUnreadable: (metadataPath: string) => never,\n): Promise<CliSkill[]> {\n const dirNames = await listDirectories(skillsDir);\n const skills = await Promise.all(\n dirNames.map(async (dirName) => ({\n dirName,\n metadata: await readCopyMetadata(skillsDir, dirName, onMetadataUnreadable),\n })),\n );\n return skills.flatMap(({ dirName, metadata }) =>\n metadata?.forkedFrom === undefined\n ? []\n : [{ dirName, skillId: metadata.forkedFrom.skillId, displayName: recordedName(metadata) }],\n );\n}\n\n/** Only for the panel: a copy naming itself no way is drawn by the catalogue's name, or its id. */\nfunction recordedName(metadata: LocalSkillMetadata): string | undefined {\n return typeof metadata.displayName === \"string\" ? metadata.displayName : undefined;\n}\n\n/**\n * A metadata.yaml that reads but does not parse is the user's (warned); one found but unreadable\n * aborts. A skill folder that cannot be opened hides its metadata.yaml (`fileExists` answers\n * false on EACCES), so that skill reads as the user's and is kept, even when this CLI made it.\n */\nasync function readCopyMetadata(\n skillsDir: string,\n dirName: string,\n onUnreadable: (metadataPath: string) => never,\n): Promise<LocalSkillMetadata | null> {\n const skillDir = path.join(skillsDir, dirName);\n try {\n return await readLocalSkillMetadata(skillDir);\n } catch {\n // Cause dropped on purpose: the stop names the file and the fix only, and uninstall has no\n // --verbose to carry it.\n return onUnreadable(path.join(skillDir, STANDARD_FILES.METADATA_YAML));\n }\n}\n\n/** The planned skills still there: the count is what the run removed, not what it planned. */\nasync function removeMatchingSkills(\n entry: SkillsRemoval,\n onRemoved: (dirName: string) => void,\n): Promise<string[]> {\n const present = await listDirectories(entry.skillsDir);\n const removedNames = present.filter((name) => entry.skillNames.includes(name));\n\n for (const name of removedNames) {\n await remove(path.join(entry.skillsDir, name));\n onRemoved(name);\n }\n return removedNames;\n}\n\nasync function removeMatchingAgents(\n entry: AgentsRemoval,\n onRemoved: (agentName: string) => void,\n): Promise<string[]> {\n const agentFiles = await listAgentFiles(entry.agentsDir, entry.codec);\n const removedNames = agentFiles\n .map((agentFile) => path.basename(agentFile, entry.codec.extension))\n .filter((agentName) => entry.agentNames.includes(agentName));\n\n for (const agentName of removedNames) {\n await remove(path.join(entry.agentsDir, `${agentName}${entry.codec.extension}`));\n onRemoved(agentName);\n }\n return removedNames;\n}\n\nconst SCOPE_OF_AN_UNRECORDED_SKILL: SkillScope = \"project\";\n\n/** Every offered plugin scope, the config's first: a re-scoped skill stays where installed. */\nfunction pluginScopesToSweep(host: PluginHost, primary: SkillScope): SkillScope[] {\n const offered = host.offeredPlacements\n .filter((placement) => placement.mode === \"plugin\")\n .map((placement) => placement.scope);\n\n if (!offered.includes(primary)) return offered;\n return [primary, ...offered.filter((scope) => scope !== primary)];\n}\n\n/** Failures are swallowed: the directory is deleted either way and files are already gone. */\nasync function removePluginWhereverItIsFiled(\n host: PluginHost,\n pluginRef: string,\n primaryScope: SkillScope,\n projectDir: string,\n): Promise<PluginRemovalOutcome> {\n let outcome: PluginRemovalOutcome = \"absent\";\n\n for (const scope of pluginScopesToSweep(host, primaryScope)) {\n try {\n const swept = await host.uninstallPlugin(pluginRef, scope, projectDir);\n if (swept === \"removed\") outcome = \"removed\";\n } catch {\n // A throw is neither outcome, so `outcome` stays as the other scopes left it.\n }\n }\n\n return outcome;\n}\n\n/** `config` only supplies the scope each plugin is filed under; the entry decides which go. */\nasync function uninstallPlugins(\n entry: PluginRemoval,\n config: ProjectConfig | null,\n projectDir: string,\n { onUninstalled, onLeftRegistered }: PluginRemovalReporter = {},\n): Promise<UninstallPluginsResult> {\n const host = hostAt(projectDir);\n const hostAvailable = await host.isAvailable();\n const observed: string[] = [];\n\n if (!hostAvailable) {\n for (const pluginName of entry.names) onLeftRegistered?.(pluginName, host.provider);\n }\n\n for (const pluginName of entry.names) {\n const removal = hostAvailable\n ? await removePluginWhereverItIsFiled(\n host,\n pluginName,\n scopeThePluginIsFiledUnder(config, pluginName),\n projectDir,\n )\n : nothingWasObserved();\n\n await remove(path.join(entry.pluginsDir, pluginName));\n\n if (removal === \"removed\") {\n observed.push(pluginName);\n onUninstalled?.(pluginName);\n }\n }\n\n // Observed, not intended: Codex `plugin remove` exits 0 whether or not the plugin existed.\n return { totalUninstalled: observed.length };\n}\n\nfunction scopeThePluginIsFiledUnder(config: ProjectConfig | null, pluginName: string): SkillScope {\n const skillId = parseMarketplacePluginRef(pluginName);\n return (\n config?.skills.find((skill) => skill.id === skillId)?.scope ?? SCOPE_OF_AN_UNRECORDED_SKILL\n );\n}\n\nfunction nothingWasObserved(): PluginRemovalOutcome {\n return \"absent\";\n}\n\n/** Whether there was a manifest to remove. */\nasync function removeConfigManifest(entry: ConfigManifestRemoval | undefined): Promise<boolean> {\n if (!entry) return false;\n\n await Promise.all(\n entry.fileNames.map((fileName) => remove(path.join(entry.sourceDir, fileName))),\n );\n return true;\n}\n\n/** Directories are not plan entries: each goes only once nothing of the user's is left in it. */\nasync function cleanupEmptyDirs(\n target: Pick<\n UninstallTarget,\n \"skillsDir\" | \"agentsDir\" | \"hasClaudeDir\" | \"claudeDir\" | \"sourceRoot\" | \"sourceFolder\"\n >,\n manifestEntries: readonly ConfigManifestRemoval[],\n): Promise<CleanupResult> {\n // Whether or not the plan named a removal there: a folder holding nothing is no one's.\n await removeDirIfEmpty(target.skillsDir);\n await removeDirIfEmpty(target.agentsDir);\n\n const sourceFolder = await cleanupSourceFolder(\n target.sourceFolder,\n manifestEntries.find((entry) => entry.sourceDir === target.sourceFolder.dir),\n );\n const sourceRoot = await cleanupSourceRoot(target.sourceRoot, sourceFolder.outcome === \"removed\");\n const claudeDir = await cleanupClaudeDir(target);\n\n return { sourceFolder, sourceRoot, claudeDir };\n}\n\n/** `entry` names this folder: the plan's manifest removal for it, if it holds one. */\nasync function cleanupSourceFolder(\n folder: ScopeSourceFolder,\n entry: ConfigManifestRemoval | undefined,\n): Promise<SourceFolderCleanup> {\n const manifestRemoved = await removeConfigManifest(entry);\n const dir = await removeDirUnlessUserContent(folder.dir);\n const outcome = manifestRemoved && dir !== \"removed\" ? \"config-removed\" : dir;\n return { relName: folder.relName, outcome };\n}\n\n/**\n * Only once the provider folder went, and only when empty: consuming repositories keep their own\n * state under `.agents-inc/`.\n */\nasync function cleanupSourceRoot(\n sourceRoot: SourceRoot,\n providerDirRemoved: boolean,\n): Promise<DirCleanup> {\n if (!providerDirRemoved) return \"untouched\";\n return removeDirUnlessUserContent(sourceRoot.dir);\n}\n\nasync function cleanupClaudeDir(\n target: Pick<UninstallTarget, \"hasClaudeDir\" | \"claudeDir\">,\n): Promise<DirCleanup> {\n if (!target.hasClaudeDir) return \"untouched\";\n return removeDirUnlessUserContent(target.claudeDir);\n}\n\n/** `kept` when it is still there: something of the user's is in it. */\nasync function removeDirUnlessUserContent(dir: string): Promise<DirCleanup> {\n if (await removeDirIfEmpty(dir)) return \"removed\";\n return (await directoryExists(dir)) ? \"kept\" : \"untouched\";\n}\n\nasync function listAgentFiles(agentsDir: string, codec: AgentCodec): Promise<string[]> {\n try {\n return await listAgentFilesOf(agentsDir, codec);\n } catch {\n return [];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAkB;AAClB,SAAS,QAAQ,gBAAgB;AACjC,OAAO,UAAU;AAEjB,SAAS,aAAa;AAuXhB;AA1RN,SAAS,iBAAiB,QAAsC;AAC9D,QAAM,SAAS,oBAAoB,MAAM;AAEzC,SAAO;AAAA,IACL,SAAS;AAAA,MACP,GAAG,aAAa,MAAM;AAAA,MACtB,GAAG,iBAAiB,MAAM;AAAA,MAC1B,GAAG;AAAA,MACH,GAAG,sBAAsB,MAAM;AAAA,IACjC;AAAA,IACA,MAAM,eAAe,QAAQ,MAAM;AAAA,EACrC;AACF;AAMA,SAAS,aAAa,MAAmB,QAA4C;AACnF,QAAM,OAAO,OAAO,UAAU,YAAY,gBAAgB,OAAO,MAAM,IAAI;AAC3E,SAAO;AAAA,IACL,cAAc,KAAK;AAAA,IACnB,cAAc,KAAK;AAAA,IACnB,uBA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A2B,KAAkC;AAC1E,MAAI,MAAM,iBAAiB,GAAG,EAAG,QAAO;AACxC,SAAQ,MAAM,gBAAgB,GAAG,IAAK,SAAS;AACjD;AAEA,eAAe,eAAe,WAAmB,OAAsC;AACrF,MAAI;AACF,WAAO,MAAM,iBAAiB,WAAW,KAAK;AAAA,EAChD,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/uninstall.tsx"],"sourcesContent":["import React from \"react\";\nimport { unique, uniqueBy } from \"remeda\";\nimport path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\n\nimport { BaseCommand } from \"../base-command\";\nimport { Confirm } from \"../components/common/confirm.js\";\nimport { promptConfirm } from \"../components/common/prompt-confirm.js\";\nimport { summaryPanelBlock, type SummaryPanelProps } from \"../components/common/summary-panel.js\";\nimport { getErrorMessage } from \"../utils/errors\";\nimport {\n directoryExists,\n fileExists,\n listDirectories,\n remove,\n removeDirIfEmpty,\n} from \"../utils/fs\";\nimport { plural } from \"../utils/string\";\nimport { listAgentFilesOf, splitAgentsByProvenance } from \"../lib/agents\";\nimport { hostAt } from \"../lib/hosts/host-for.js\";\nimport type { PluginHost, PluginRemovalOutcome } from \"../lib/hosts/plugin-host.js\";\nimport {\n listPluginNames,\n getProjectPluginsDir,\n buildMarketplacePluginRef,\n parseMarketplacePluginRef,\n} from \"../lib/plugins/index\";\nimport { type LocalSkillMetadata, readLocalSkillMetadata } from \"../lib/skills/skill-metadata\";\nimport { isHomeDirectory, resolveInstallPaths } from \"../lib/installation/index\";\nimport {\n lazyGateDeps,\n mutateGlobal,\n propagateGlobalRemoval,\n type GateReport,\n} from \"../lib/config-gate/index.js\";\nimport { loadSkillsMatrixFromSource } from \"../lib/loading\";\nimport { loadAgentDefs } from \"../lib/operations\";\nimport { ConfigLoadError, loadProjectConfigAt } from \"../lib/configuration/project-config\";\nimport type { Provider } from \"../consts\";\nimport { CLAUDE_DIR, DEFAULT_BRANDING, EJECT_SOURCE, STANDARD_FILES } from \"../consts\";\nimport {\n providerInUse,\n agentCodec,\n type AgentCodec,\n sourceFolderInUse,\n sourceRootOf,\n type SourceRoot,\n} from \"../lib/installation/install-layout.js\";\nimport {\n providerFlag,\n providerNamedBy,\n refuseAnAmbiguousInstallation,\n} from \"../lib/installation/provider-flag.js\";\nimport { isActiveAt } from \"../lib/configuration/scope-predicates.js\";\nimport { isAgentName } from \"../utils/type-guards.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes\";\nimport {\n SUCCESS_MESSAGES,\n INFO_MESSAGES,\n configFileRemoved,\n notInstalledHere,\n pluginLeftRegistered,\n unmarkedAgentsKept,\n registeredProjectsUpdated,\n registeredProjectUpdateSkipped,\n registeredProjectsUpdateFailed,\n uninstallConfigUnreadable,\n uninstallNeedsTerminal,\n uninstallSkillMetadataUnreadable,\n} from \"../utils/messages\";\nimport type {\n AgentDefinition,\n AgentName,\n MergedSkillsMatrix,\n ProjectConfig,\n SkillId,\n} from \"../types/index\";\nimport type { AgentScopeConfig, SkillConfig, SkillScope } from \"../types/config\";\n\n/** Paths and names, never display strings, so the preview and the removal read one value. */\ntype RemovalEntry =\n | { kind: \"plugins\"; pluginsDir: string; names: string[] }\n | { kind: \"skills\"; skillsDir: string; skillNames: string[] }\n | { kind: \"agents\"; agentsDir: string; agentNames: string[]; codec: AgentCodec }\n | { kind: \"config\"; sourceDir: string; fileNames: string[] };\n\ntype PluginRemoval = Extract<RemovalEntry, { kind: \"plugins\" }>;\ntype SkillsRemoval = Extract<RemovalEntry, { kind: \"skills\" }>;\ntype AgentsRemoval = Extract<RemovalEntry, { kind: \"agents\" }>;\ntype ConfigManifestRemoval = Extract<RemovalEntry, { kind: \"config\" }>;\n\ntype RemovalPlan = {\n entries: RemovalEntry[];\n kept: string[];\n};\n\nfunction buildRemovalPlan(target: UninstallTarget): RemovalPlan {\n const agents = compiledAgentsEntry(target);\n\n return {\n entries: [\n ...pluginsEntry(target),\n ...localSkillsEntry(target),\n ...agents,\n ...configManifestEntries(target),\n ],\n kept: keptStatements(target, agents),\n };\n}\n\n/**\n * Its rows are the plan's, never the config's, so the panel names no removal the run will not\n * make. In a project the global entries its config copies stay, so they show as kept. The header\n * names the marketplace of what the run removes, or, removing no skill, of what it keeps.\n */\nfunction removalPanel(plan: RemovalPlan, target: UninstallTarget): SummaryPanelProps {\n const kept = target.scope === \"project\" ? globalEntriesOf(target.config) : NOTHING_KEPT;\n const removed = removedSkills(plan, target);\n return {\n skillConfigs: kept.skills,\n agentConfigs: kept.agents,\n installedSkillConfigs: [...removed, ...kept.skills],\n installedAgentConfigs: [...namedAgentRemovals(plan, target.scope).named, ...kept.agents],\n isInitMode: false,\n stackName: undefined,\n headerSkillConfigs: removed.length > 0 ? removed : kept.skills,\n };\n}\n\ntype PanelEntries = { skills: SkillConfig[]; agents: AgentScopeConfig[] };\n\nconst NOTHING_KEPT: PanelEntries = { skills: [], agents: [] };\n\nfunction globalEntriesOf(config: ProjectConfig | null): PanelEntries {\n if (config === null) return NOTHING_KEPT;\n return {\n skills: config.skills.filter((skill) => isActiveAt(skill, \"global\")),\n agents: config.agents.filter((agent) => isActiveAt(agent, \"global\")),\n };\n}\n\n/**\n * A copy by the skill its provenance records; a plugin by the config skill it was matched against.\n * One row a skill: a skill registered under two marketplaces' names is still one skill.\n */\nfunction removedSkills(plan: RemovalPlan, target: UninstallTarget): SkillConfig[] {\n const copied = new Set(planEntries(plan, \"skills\").flatMap((entry) => entry.skillNames));\n const plugins = new Set(planEntries(plan, \"plugins\").flatMap((entry) => entry.names));\n const marketplaceName = target.config?.marketplaceName;\n const copies = target.cliSkills\n .filter(({ dirName }) => copied.has(dirName))\n .map((copy) => copyEntryOf(copy, target.scope));\n const pluginSkills = (target.config?.skills ?? [])\n .filter((skill) => !skill.excluded)\n .filter((skill) => pluginRefsOf(skill, marketplaceName).some((ref) => plugins.has(ref)))\n .map((skill) => ({ ...skill, scope: target.scope }));\n\n return uniqueBy([...copies, ...pluginSkills], (skill) => skill.id);\n}\n\n/** Drawn from disk, not config, so its row is named by the copy's own metadata.yaml. */\nfunction copyEntryOf({ skillId, displayName }: CliSkill, scope: SkillScope): SkillConfig {\n return {\n id: skillId,\n scope,\n origin: EJECT_SOURCE,\n ...(displayName !== undefined && { displayName }),\n };\n}\n\n/** A compiled file whose name no sub-agent carries is named by its path instead. */\nfunction namedAgentRemovals(\n plan: RemovalPlan,\n scope: SkillScope,\n): { named: AgentScopeConfig[]; files: string[] } {\n const entries = planEntries(plan, \"agents\");\n const names = entries.flatMap((entry) => entry.agentNames);\n return {\n named: names.filter(isAgentName).map((name) => ({ name, scope })),\n files: entries.flatMap((entry) =>\n entry.agentNames\n .filter((name) => !isAgentName(name))\n .map((name) => path.join(entry.agentsDir, `${name}${entry.codec.extension}`)),\n ),\n };\n}\n\nfunction hasAnythingToRemove(plan: RemovalPlan): boolean {\n return plan.entries.length > 0;\n}\n\n/** The files the plan deletes that the panel has no row for, marked as it marks a removal. */\nfunction removedFileLines(plan: RemovalPlan, scope: SkillScope): string[] {\n const configFiles = planEntries(plan, \"config\").flatMap((entry) =>\n entry.fileNames.map((fileName) => `${entry.sourceDir}/${fileName}`),\n );\n return [...namedAgentRemovals(plan, scope).files, ...configFiles].map(configFileRemoved);\n}\n\nfunction pluginsEntry(target: UninstallTarget): PluginRemoval[] {\n if (!target.hasPlugins) return [];\n return [{ kind: \"plugins\", pluginsDir: target.pluginsDir, names: [...target.cliPluginNames] }];\n}\n\nfunction localSkillsEntry(target: UninstallTarget): SkillsRemoval[] {\n if (target.cliSkills.length === 0) return [];\n return [\n {\n kind: \"skills\",\n skillsDir: target.skillsDir,\n skillNames: target.cliSkills.map(({ dirName }) => dirName),\n },\n ];\n}\n\nfunction compiledAgentsEntry(target: UninstallTarget): AgentsRemoval[] {\n const agentNames = identifiableAgents(target);\n if (agentNames.length === 0) return [];\n\n return [{ kind: \"agents\", agentsDir: target.agentsDir, agentNames, codec: target.agentCodec }];\n}\n\n/**\n * Only those with a file here, so the plan names no removal the run will not make: the config's\n * roster (pre-marker installs carry no marker) and every provenance-marked file, each once.\n */\nfunction identifiableAgents(target: UninstallTarget): string[] {\n const agentFiles = new Set([...target.markedAgents, ...target.unmarkedAgents]);\n const configuredWithAFile = target.configuredAgents.filter((name) => agentFiles.has(name));\n return unique([...configuredWithAFile, ...target.markedAgents]);\n}\n\nfunction configManifestEntries(target: UninstallTarget): ConfigManifestRemoval[] {\n const { dir, manifestFiles } = target.sourceFolder;\n if (manifestFiles.length === 0) return [];\n return [{ kind: \"config\", sourceDir: dir, fileNames: manifestFiles }];\n}\n\n/** Derived from the removal, so no agent can be both removed and kept. */\nfunction keptStatements(target: UninstallTarget, agentRemovals: AgentsRemoval[]): string[] {\n const removing = new Set(agentRemovals.flatMap((entry) => entry.agentNames));\n const kept = target.unmarkedAgents.filter((name) => !removing.has(name));\n if (kept.length === 0) return [];\n return [unmarkedAgentsKept(target.agentsDir, kept.length)];\n}\n\nfunction planEntries<K extends RemovalEntry[\"kind\"]>(\n plan: RemovalPlan,\n kind: K,\n): Extract<RemovalEntry, { kind: K }>[] {\n return plan.entries.filter(\n (entry): entry is Extract<RemovalEntry, { kind: K }> => entry.kind === kind,\n );\n}\n\nfunction planEntry<K extends RemovalEntry[\"kind\"]>(\n plan: RemovalPlan,\n kind: K,\n): Extract<RemovalEntry, { kind: K }> | undefined {\n return plan.entries.find(\n (entry): entry is Extract<RemovalEntry, { kind: K }> => entry.kind === kind,\n );\n}\n\nconst UNINSTALL_CONFIRM_MESSAGE = \"Are you sure you want to uninstall?\";\n\nexport default class Uninstall extends BaseCommand {\n /** Replaced in `run` before anything prints. */\n private brandingName: string = DEFAULT_BRANDING.NAME;\n\n static summary = `Remove ${DEFAULT_BRANDING.NAME} from this project`;\n\n static description = `Uninstall ${DEFAULT_BRANDING.NAME} from this project. Removes CLI-managed skills (matched by marketplace), compiled agents, plugins, and the config manifest (config.ts + config-types.ts) this project keeps. User-created content is preserved.`;\n\n static examples = [\n \"<%= config.bin %> <%= command.id %>\",\n \"<%= config.bin %> <%= command.id %> --yes\",\n ];\n\n static flags = {\n yes: Flags.boolean({\n char: \"y\",\n description: \"Skip confirmation prompt\",\n default: false,\n }),\n provider: providerFlag(),\n };\n\n protected async ensureTerminalSize(): Promise<void> {\n // Any size: uninstall is the way out of every state.\n }\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Uninstall);\n const projectDir = process.cwd();\n const namedProvider = providerNamedBy(flags.provider);\n\n // Before anything is detected: removing the wrong one of two installations is destructive.\n await refuseAnAmbiguousInstallation(projectDir, \"uninstall\", namedProvider, (message) =>\n this.error(message, { exit: EXIT_CODES.INVALID_ARGS }),\n );\n\n this.brandingName = await this.resolveBrandingName(projectDir);\n\n this.printHeader();\n\n const target = await detectUninstallTarget(projectDir, {\n onConfigLoadFailed: (failure) => this.warn(uninstallConfigUnreadable(failure)),\n // Aborts: guessing would either remove the user's skill or keep this CLI's.\n onSkillMetadataUnreadable: (metadataPath) =>\n this.error(uninstallSkillMetadataUnreadable(metadataPath), { exit: EXIT_CODES.ERROR }),\n });\n const plan = buildRemovalPlan(target);\n if (!hasAnythingToRemove(plan)) {\n this.reportNothingToUninstall();\n return;\n }\n\n const approved = await this.removalApproved(plan, target, flags.yes, namedProvider);\n if (!approved) this.cancelUninstall();\n\n await this.executeUninstall(plan, target, projectDir);\n this.reportSuccess();\n }\n\n private printHeader(): void {\n this.log(\"\");\n this.log(`${this.brandingName} Uninstall`);\n this.log(\"\");\n }\n\n private reportNothingToUninstall(): void {\n this.warn(\"Nothing to uninstall.\");\n this.log(\"\");\n this.log(notInstalledHere(this.brandingName));\n this.log(\"\");\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n }\n\n /** With `--yes` nothing is asked, so the plan prints where the question would be. */\n private async removalApproved(\n plan: RemovalPlan,\n target: UninstallTarget,\n skipConfirmation: boolean,\n namedProvider: Provider | undefined,\n ): Promise<boolean> {\n if (!skipConfirmation) return this.confirmRemoval(plan, target, namedProvider);\n\n this.showRemovalPlan(plan, target);\n return true;\n }\n\n private cancelUninstall(): never {\n this.log(\"\");\n this.log(\"Uninstall cancelled\");\n this.exit(EXIT_CODES.CANCELLED);\n }\n\n private showRemovalPlan(plan: RemovalPlan, target: UninstallTarget): void {\n const lines = summaryPanelBlock(\n removalPanel(plan, target),\n removedFileLines(plan, target.scope),\n plan.kept,\n );\n for (const line of lines) {\n this.log(line);\n }\n }\n\n private async confirmRemoval(\n plan: RemovalPlan,\n target: UninstallTarget,\n namedProvider: Provider | undefined,\n ): Promise<boolean> {\n // A confirm nobody can answer must never become a yes.\n if (!process.stdin.isTTY) {\n this.error(uninstallNeedsTerminal(namedProvider), { exit: EXIT_CODES.ERROR });\n }\n\n this.showRemovalPlan(plan, target);\n const outcome = await promptConfirm(({ onConfirm, onCancel }) => (\n <Confirm message={UNINSTALL_CONFIRM_MESSAGE} onConfirm={onConfirm} onCancel={onCancel} />\n ));\n return outcome === \"confirmed\";\n }\n\n private async executeUninstall(\n plan: RemovalPlan,\n target: UninstallTarget,\n projectDir: string,\n ): Promise<void> {\n const isGlobalUninstall = isHomeDirectory(projectDir);\n // Before any removal: the registry and source live in the global config about to be deleted.\n const propagation = isGlobalUninstall\n ? await this.prepareGlobalPropagation(target, projectDir)\n : null;\n\n await this.removePlannedPlugins(planEntry(plan, \"plugins\"), target.config, projectDir);\n await this.removeLocalFilesOrFail(plan, target);\n\n if (!isGlobalUninstall) {\n await this.deregisterProject(projectDir, target.provider);\n return;\n }\n if (propagation) await this.updateRegisteredProjects(propagation);\n }\n\n /** Degrades: a missing or corrupt global config must never fail the uninstall. */\n private async deregisterProject(projectDir: string, provider: Provider): Promise<void> {\n try {\n // Lazy deps: deregistering inlines nothing, so the uninstall stays offline.\n await mutateGlobal(\n { kind: \"deregister-project\", projectDir, provider },\n lazyGateDeps(projectDir),\n );\n } catch (error) {\n this.warn(`Could not update the global project registry: ${getErrorMessage(error)}`);\n }\n }\n\n /**\n * A load failure warns and never aborts. `skipExtraSources` cannot change the output (extra\n * sources only annotate skills) and keeps the uninstall off the network.\n */\n private async prepareGlobalPropagation(\n target: UninstallTarget,\n projectDir: string,\n ): Promise<GlobalPropagationData | null> {\n if (target.config === null || target.registeredProjects.length === 0) return null;\n const globalConfig = target.config;\n\n try {\n const [sourceResult, agentDefs] = await Promise.all([\n loadSkillsMatrixFromSource({\n projectDir,\n purpose: \"upkeep\",\n skipExtraSources: true,\n matrixOnly: true,\n }),\n loadAgentDefs(),\n ]);\n return {\n globalConfig,\n matrix: sourceResult.matrix,\n agents: agentDefs.agents,\n provider: providerInUse(projectDir),\n };\n } catch (error) {\n this.warn(registeredProjectsUpdateFailed(getErrorMessage(error)));\n return null;\n }\n }\n\n /** Runs after the global manifest is gone, so regenerated types use the standalone form. */\n private async updateRegisteredProjects(propagation: GlobalPropagationData): Promise<void> {\n try {\n const report = await propagateGlobalRemoval(\n propagation.globalConfig,\n { matrix: propagation.matrix, agents: propagation.agents },\n propagation.provider,\n );\n this.reportRegisteredProjectsUpdate(report);\n } catch (error) {\n this.warn(registeredProjectsUpdateFailed(getErrorMessage(error)));\n }\n }\n\n private reportRegisteredProjectsUpdate(report: GateReport): void {\n const { updated, unreadable, failed } = report.propagated;\n this.reportProjectsOutOfReach(report.propagated);\n for (const skippedPath of [...unreadable, ...failed]) {\n this.warn(registeredProjectUpdateSkipped(skippedPath));\n }\n if (updated.length === 0) return;\n\n this.logSuccess(registeredProjectsUpdated(updated.length));\n this.reportPropagatedRecompile(report);\n }\n\n private reportSuccess(): void {\n this.log(\"\");\n this.log(`${this.brandingName} has been uninstalled.`);\n this.log(\"\");\n this.logSuccess(SUCCESS_MESSAGES.UNINSTALL_COMPLETE);\n this.log(\"\");\n }\n\n private async removeLocalFilesOrFail(plan: RemovalPlan, target: UninstallTarget): Promise<void> {\n try {\n await this.removeLocalFiles(plan, target);\n } catch (error) {\n this.log(\"Failed to remove local files\");\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async removeLocalFiles(plan: RemovalPlan, target: UninstallTarget): Promise<void> {\n await this.removePlannedSkills(planEntry(plan, \"skills\"));\n await this.removePlannedAgents(planEntry(plan, \"agents\"));\n\n for (const statement of plan.kept) {\n this.log(statement);\n }\n\n const cleanup = await cleanupEmptyDirs(target, planEntries(plan, \"config\"));\n\n this.reportSourceFolderCleanup(cleanup.sourceFolder);\n this.reportDirCleanup(target.sourceRoot.relName, cleanup.sourceRoot);\n this.reportDirCleanup(CLAUDE_DIR, cleanup.claudeDir);\n }\n\n private reportSourceFolderCleanup({ relName, outcome }: SourceFolderCleanup): void {\n if (outcome === \"config-removed\") {\n this.logSuccess(`Removed CLI config from ${relName}/`);\n return;\n }\n this.reportDirCleanup(relName, outcome);\n }\n\n private reportDirCleanup(relName: string, cleanup: DirCleanup): void {\n switch (cleanup) {\n case \"removed\":\n this.logSuccess(`Removed ${relName}/`);\n return;\n case \"kept\":\n this.log(`Kept ${relName}/ (contains user content)`);\n return;\n case \"untouched\":\n return;\n default: {\n const _exhaustive: never = cleanup;\n return _exhaustive;\n }\n }\n }\n\n private async removePlannedPlugins(\n entry: PluginRemoval | undefined,\n config: ProjectConfig | null,\n projectDir: string,\n ): Promise<void> {\n if (!entry) return;\n\n this.log(\"Uninstalling plugins...\");\n\n try {\n const pluginResult = await uninstallPlugins(entry, config, projectDir, {\n onUninstalled: (name) => this.log(` Uninstalled plugin '${name}'`),\n onLeftRegistered: (name, provider) => this.warn(pluginLeftRegistered(name, provider)),\n });\n\n // Silent on zero: \"0\" beside a plan that named one reads as a failure, and is not one.\n if (pluginResult.totalUninstalled > 0) {\n this.logSuccess(`Uninstalled ${plural(pluginResult.totalUninstalled, \"plugin\")}`);\n }\n } catch (error) {\n this.log(\"Plugin uninstall failed\");\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async removePlannedSkills(entry: SkillsRemoval | undefined): Promise<void> {\n if (!entry) return;\n\n const removedNames = await removeMatchingSkills(entry, (dirName) =>\n this.log(` Uninstalled skill '${dirName}'`),\n );\n if (removedNames.length === 0) return;\n\n this.logSuccess(`Removed ${plural(removedNames.length, \"CLI-installed skill\")}`);\n }\n\n private async removePlannedAgents(entry: AgentsRemoval | undefined): Promise<void> {\n if (!entry) return;\n\n const removedNames = await removeMatchingAgents(entry, (agentName) =>\n this.log(` Uninstalled agent '${agentName}'`),\n );\n if (removedNames.length === 0) return;\n\n this.logSuccess(`Removed ${plural(removedNames.length, \"compiled agent\")}`);\n }\n}\n\n/** A skill folder this CLI installed: removed by its folder, shown by the skill and name it records. */\ntype CliSkill = { dirName: string; skillId: SkillId; displayName: string | undefined };\n\ntype UninstallTarget = {\n /** Home is the global scope, so a run there removes global entries. */\n scope: SkillScope;\n /** Read before removal, which deletes the folder that says which. */\n provider: Provider;\n hasPlugins: boolean;\n /** Only those this CLI installed, matched against config skills. */\n cliPluginNames: string[];\n /** Carrying `forkedFrom`: this CLI installed them. The rest are the user's, never removed. */\n cliSkills: CliSkill[];\n hasClaudeDir: boolean;\n pluginsDir: string;\n skillsDir: string;\n agentsDir: string;\n agentCodec: AgentCodec;\n claudeDir: string;\n sourceFolder: ScopeSourceFolder;\n sourceRoot: SourceRoot;\n config: ProjectConfig | null;\n registeredProjects: string[];\n configuredAgents: AgentName[];\n markedAgents: string[];\n /** The user's, unless the config claims them. */\n unmarkedAgents: string[];\n};\n\ntype ScopeSourceFolder = {\n dir: string;\n relName: string;\n manifestFiles: string[];\n /** `null` when absent or unreadable. */\n config: ProjectConfig | null;\n};\n\n/** Captured before removal: all of it comes from the config and folder being deleted. */\ntype GlobalPropagationData = {\n globalConfig: ProjectConfig;\n matrix: MergedSkillsMatrix;\n agents: Partial<Record<AgentName, AgentDefinition>>;\n provider: Provider;\n};\n\ntype UninstallPluginsResult = {\n totalUninstalled: number;\n};\n\ntype PluginRemovalReporter = {\n onUninstalled?: (pluginName: string) => void;\n /** No host CLI to ask, so the plugin's registration outlives its folder. */\n onLeftRegistered?: (pluginName: string, provider: Provider) => void;\n};\n\n/** `kept`: still there because of content this CLI never wrote. */\ntype DirCleanup = \"removed\" | \"kept\" | \"untouched\";\n\n/** `config-removed`: the manifest went, and the folder stayed for what else it holds. */\ntype SourceFolderCleanup = { relName: string; outcome: DirCleanup | \"config-removed\" };\n\ntype CleanupResult = {\n sourceFolder: SourceFolderCleanup;\n sourceRoot: DirCleanup;\n claudeDir: DirCleanup;\n};\n\nfunction collectConfiguredAgents(config: Partial<ProjectConfig> | null): AgentName[] {\n if (!config?.agents) return [];\n return config.agents.map((a) => a.name);\n}\n\nfunction getCliInstalledPluginKeys(config: Partial<ProjectConfig> | null): Set<string> {\n if (!config?.skills) return new Set();\n const { marketplaceName } = config;\n return new Set(config.skills.flatMap((skill) => pluginRefsOf(skill, marketplaceName)));\n}\n\nfunction pluginRefsOf(skill: SkillConfig, marketplaceName: string | undefined): string[] {\n const ownRef = buildMarketplacePluginRef(skill.id, skill.origin);\n if (!marketplaceName || skill.origin === marketplaceName || skill.origin === EJECT_SOURCE) {\n return [ownRef];\n }\n // Installed via the marketplace while `origin` names something else.\n return [ownRef, buildMarketplacePluginRef(skill.id, marketplaceName)];\n}\n\n/**\n * Degrades: a `ConfigLoadError` is reported and treated as a missing config, since that is when a\n * user needs to uninstall. Any other failure propagates.\n */\nasync function loadUninstallConfig(\n configPath: string,\n projectDir: string,\n provider: Provider,\n onLoadFailed: (failure: ConfigLoadError) => void,\n): Promise<ProjectConfig | null> {\n try {\n const result = await loadProjectConfigAt(configPath, projectDir, provider);\n return result?.config ?? null;\n } catch (error) {\n if (!(error instanceof ConfigLoadError)) throw error;\n onLoadFailed(error);\n return null;\n }\n}\n\n/** Its config is read under {@link loadUninstallConfig}'s degrade posture. */\nasync function readSourceFolder(\n folder: Pick<ScopeSourceFolder, \"dir\" | \"relName\">,\n projectDir: string,\n provider: Provider,\n onConfigLoadFailed: (failure: ConfigLoadError) => void,\n): Promise<ScopeSourceFolder> {\n const [manifestFiles, config] = await Promise.all([\n manifestFilesIn(folder.dir),\n loadUninstallConfig(\n path.join(folder.dir, STANDARD_FILES.CONFIG_TS),\n projectDir,\n provider,\n onConfigLoadFailed,\n ),\n ]);\n return { ...folder, manifestFiles, config };\n}\n\nasync function manifestFilesIn(dir: string): Promise<string[]> {\n const manifest = [STANDARD_FILES.CONFIG_TS, STANDARD_FILES.CONFIG_TYPES_TS];\n const present = await Promise.all(\n manifest.map((fileName) => fileExists(path.join(dir, fileName))),\n );\n return manifest.filter((_, index) => present[index]);\n}\n\nfunction activeConfigOf(config: ProjectConfig): ProjectConfig {\n return {\n ...config,\n skills: config.skills.filter((s) => !s.excluded),\n agents: config.agents.filter((a) => !a.excluded),\n };\n}\n\ntype DetectionFailureHandlers = {\n /** Degrades: see {@link loadUninstallConfig}. */\n onConfigLoadFailed: (failure: ConfigLoadError) => void;\n onSkillMetadataUnreadable: (metadataPath: string) => never;\n};\n\nasync function detectUninstallTarget(\n projectDir: string,\n handlers: DetectionFailureHandlers,\n): Promise<UninstallTarget> {\n const pluginsDir = getProjectPluginsDir(projectDir);\n const { skillsDir, agentsDir } = resolveInstallPaths(projectDir);\n const claudeDir = path.join(projectDir, CLAUDE_DIR);\n const provider = providerInUse(projectDir);\n const codec = agentCodec(provider);\n\n const [cliSkills, hasClaudeDir, sourceFolder, agentProvenance] = await Promise.all([\n skillsThisCliInstalled(skillsDir, handlers.onSkillMetadataUnreadable),\n directoryExists(claudeDir),\n readSourceFolder(\n sourceFolderInUse(projectDir, provider),\n projectDir,\n provider,\n handlers.onConfigLoadFailed,\n ),\n splitAgentsByProvenance(agentsDir, codec),\n ]);\n\n const { config } = sourceFolder;\n const activeConfig = config === null ? null : activeConfigOf(config);\n const cliPluginNames = await pluginsThisRunRemoves(projectDir, activeConfig);\n\n return {\n scope: isHomeDirectory(projectDir) ? \"global\" : \"project\",\n provider,\n hasPlugins: cliPluginNames.length > 0,\n cliPluginNames,\n cliSkills,\n hasClaudeDir,\n pluginsDir,\n skillsDir,\n agentsDir,\n claudeDir,\n sourceFolder,\n sourceRoot: sourceRootOf(projectDir),\n config,\n registeredProjects: config?.projects ?? [],\n configuredAgents: collectConfiguredAgents(activeConfig),\n agentCodec: codec,\n markedAgents: agentProvenance.marked,\n unmarkedAgents: agentProvenance.unmarked,\n };\n}\n\nasync function pluginsThisRunRemoves(\n projectDir: string,\n activeConfig: ProjectConfig | null,\n): Promise<string[]> {\n const installed = await listPluginNames(projectDir);\n if (!thisRunOwnsAnyPlugin(projectDir)) return [];\n\n const cliInstalledKeys = getCliInstalledPluginKeys(activeConfig);\n return installed.filter((name) => cliInstalledKeys.has(name));\n}\n\n/**\n * A host without project-scoped plugins (Codex) shares them machine-wide, so a project uninstall\n * there must not sweep them. A global uninstall owns them on any host.\n */\nfunction thisRunOwnsAnyPlugin(projectDir: string): boolean {\n if (isHomeDirectory(projectDir)) return true;\n return hostAt(projectDir).installsProjectScopedPlugins;\n}\n\n/** Read before the plan is built, so the plan and the removal read one classification. */\nasync function skillsThisCliInstalled(\n skillsDir: string,\n onMetadataUnreadable: (metadataPath: string) => never,\n): Promise<CliSkill[]> {\n const dirNames = await listDirectories(skillsDir);\n const skills = await Promise.all(\n dirNames.map(async (dirName) => ({\n dirName,\n metadata: await readCopyMetadata(skillsDir, dirName, onMetadataUnreadable),\n })),\n );\n return skills.flatMap(({ dirName, metadata }) =>\n metadata?.forkedFrom === undefined\n ? []\n : [{ dirName, skillId: metadata.forkedFrom.skillId, displayName: recordedName(metadata) }],\n );\n}\n\n/** Only for the panel: a copy naming itself no way is drawn by the catalogue's name, or its id. */\nfunction recordedName(metadata: LocalSkillMetadata): string | undefined {\n return typeof metadata.displayName === \"string\" ? metadata.displayName : undefined;\n}\n\n/**\n * A metadata.yaml that reads but does not parse is the user's (warned); one found but unreadable\n * aborts. A skill folder that cannot be opened hides its metadata.yaml (`fileExists` answers\n * false on EACCES), so that skill reads as the user's and is kept, even when this CLI made it.\n */\nasync function readCopyMetadata(\n skillsDir: string,\n dirName: string,\n onUnreadable: (metadataPath: string) => never,\n): Promise<LocalSkillMetadata | null> {\n const skillDir = path.join(skillsDir, dirName);\n try {\n return await readLocalSkillMetadata(skillDir);\n } catch {\n // Cause dropped on purpose: the stop names the file and the fix only, and uninstall has no\n // --verbose to carry it.\n return onUnreadable(path.join(skillDir, STANDARD_FILES.METADATA_YAML));\n }\n}\n\n/** The planned skills still there: the count is what the run removed, not what it planned. */\nasync function removeMatchingSkills(\n entry: SkillsRemoval,\n onRemoved: (dirName: string) => void,\n): Promise<string[]> {\n const present = await listDirectories(entry.skillsDir);\n const removedNames = present.filter((name) => entry.skillNames.includes(name));\n\n for (const name of removedNames) {\n await remove(path.join(entry.skillsDir, name));\n onRemoved(name);\n }\n return removedNames;\n}\n\nasync function removeMatchingAgents(\n entry: AgentsRemoval,\n onRemoved: (agentName: string) => void,\n): Promise<string[]> {\n const agentFiles = await listAgentFiles(entry.agentsDir, entry.codec);\n const removedNames = agentFiles\n .map((agentFile) => path.basename(agentFile, entry.codec.extension))\n .filter((agentName) => entry.agentNames.includes(agentName));\n\n for (const agentName of removedNames) {\n await remove(path.join(entry.agentsDir, `${agentName}${entry.codec.extension}`));\n onRemoved(agentName);\n }\n return removedNames;\n}\n\nconst SCOPE_OF_AN_UNRECORDED_SKILL: SkillScope = \"project\";\n\n/** Every offered plugin scope, the config's first: a re-scoped skill stays where installed. */\nfunction pluginScopesToSweep(host: PluginHost, primary: SkillScope): SkillScope[] {\n const offered = host.offeredPlacements\n .filter((placement) => placement.mode === \"plugin\")\n .map((placement) => placement.scope);\n\n if (!offered.includes(primary)) return offered;\n return [primary, ...offered.filter((scope) => scope !== primary)];\n}\n\n/** Failures are swallowed: the directory is deleted either way and files are already gone. */\nasync function removePluginWhereverItIsFiled(\n host: PluginHost,\n pluginRef: string,\n primaryScope: SkillScope,\n projectDir: string,\n): Promise<PluginRemovalOutcome> {\n let outcome: PluginRemovalOutcome = \"absent\";\n\n for (const scope of pluginScopesToSweep(host, primaryScope)) {\n try {\n const swept = await host.uninstallPlugin(pluginRef, scope, projectDir);\n if (swept === \"removed\") outcome = \"removed\";\n } catch {\n // A throw is neither outcome, so `outcome` stays as the other scopes left it.\n }\n }\n\n return outcome;\n}\n\n/** `config` only supplies the scope each plugin is filed under; the entry decides which go. */\nasync function uninstallPlugins(\n entry: PluginRemoval,\n config: ProjectConfig | null,\n projectDir: string,\n { onUninstalled, onLeftRegistered }: PluginRemovalReporter = {},\n): Promise<UninstallPluginsResult> {\n const host = hostAt(projectDir);\n const hostAvailable = await host.isAvailable();\n const observed: string[] = [];\n\n if (!hostAvailable) {\n for (const pluginName of entry.names) onLeftRegistered?.(pluginName, host.provider);\n }\n\n for (const pluginName of entry.names) {\n const removal = hostAvailable\n ? await removePluginWhereverItIsFiled(\n host,\n pluginName,\n scopeThePluginIsFiledUnder(config, pluginName),\n projectDir,\n )\n : nothingWasObserved();\n\n await remove(path.join(entry.pluginsDir, pluginName));\n\n if (removal === \"removed\") {\n observed.push(pluginName);\n onUninstalled?.(pluginName);\n }\n }\n\n // Observed, not intended: Codex `plugin remove` exits 0 whether or not the plugin existed.\n return { totalUninstalled: observed.length };\n}\n\nfunction scopeThePluginIsFiledUnder(config: ProjectConfig | null, pluginName: string): SkillScope {\n const skillId = parseMarketplacePluginRef(pluginName);\n return (\n config?.skills.find((skill) => skill.id === skillId)?.scope ?? SCOPE_OF_AN_UNRECORDED_SKILL\n );\n}\n\nfunction nothingWasObserved(): PluginRemovalOutcome {\n return \"absent\";\n}\n\n/** Whether there was a manifest to remove. */\nasync function removeConfigManifest(entry: ConfigManifestRemoval | undefined): Promise<boolean> {\n if (!entry) return false;\n\n await Promise.all(\n entry.fileNames.map((fileName) => remove(path.join(entry.sourceDir, fileName))),\n );\n return true;\n}\n\n/** Directories are not plan entries: each goes only once nothing of the user's is left in it. */\nasync function cleanupEmptyDirs(\n target: Pick<\n UninstallTarget,\n \"skillsDir\" | \"agentsDir\" | \"hasClaudeDir\" | \"claudeDir\" | \"sourceRoot\" | \"sourceFolder\"\n >,\n manifestEntries: readonly ConfigManifestRemoval[],\n): Promise<CleanupResult> {\n // Whether or not the plan named a removal there: a folder holding nothing is no one's.\n await removeDirIfEmpty(target.skillsDir);\n await removeDirIfEmpty(target.agentsDir);\n\n const sourceFolder = await cleanupSourceFolder(\n target.sourceFolder,\n manifestEntries.find((entry) => entry.sourceDir === target.sourceFolder.dir),\n );\n const sourceRoot = await cleanupSourceRoot(target.sourceRoot, sourceFolder.outcome === \"removed\");\n const claudeDir = await cleanupClaudeDir(target);\n\n return { sourceFolder, sourceRoot, claudeDir };\n}\n\n/** `entry` names this folder: the plan's manifest removal for it, if it holds one. */\nasync function cleanupSourceFolder(\n folder: ScopeSourceFolder,\n entry: ConfigManifestRemoval | undefined,\n): Promise<SourceFolderCleanup> {\n const manifestRemoved = await removeConfigManifest(entry);\n const dir = await removeDirUnlessUserContent(folder.dir);\n const outcome = manifestRemoved && dir !== \"removed\" ? \"config-removed\" : dir;\n return { relName: folder.relName, outcome };\n}\n\n/**\n * Only once the provider folder went, and only when empty: consuming repositories keep their own\n * state under `.agents-inc/`.\n */\nasync function cleanupSourceRoot(\n sourceRoot: SourceRoot,\n providerDirRemoved: boolean,\n): Promise<DirCleanup> {\n if (!providerDirRemoved) return \"untouched\";\n return removeDirUnlessUserContent(sourceRoot.dir);\n}\n\nasync function cleanupClaudeDir(\n target: Pick<UninstallTarget, \"hasClaudeDir\" | \"claudeDir\">,\n): Promise<DirCleanup> {\n if (!target.hasClaudeDir) return \"untouched\";\n return removeDirUnlessUserContent(target.claudeDir);\n}\n\n/** `kept` when it is still there: something of the user's is in it. */\nasync function removeDirUnlessUserContent(dir: string): Promise<DirCleanup> {\n if (await removeDirIfEmpty(dir)) return \"removed\";\n return (await directoryExists(dir)) ? \"kept\" : \"untouched\";\n}\n\nasync function listAgentFiles(agentsDir: string, codec: AgentCodec): Promise<string[]> {\n try {\n return await listAgentFilesOf(agentsDir, codec);\n } catch {\n return [];\n }\n}\n"],"mappings":";;;;;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AAG;AAAA,EAC7E;AACA,QAAM,aAAa,MAAM,kBAAkB,OAAO,YAAY,aAAa,YAAY,SAAS;AAChG,QAAM,YAAY,MAAM,iBAAiB,MAAM;AAE/C,SAAO,EAAE,cAAc,YAAY,UAAU;AAC/C;AAGA,eAAe,oBACb,QACA,OAC8B;AAC9B,QAAM,kBAAkB,MAAM,qBAAqB,KAAK;AACxD,QAAM,MAAM,MAAM,2BAA2B,OAAO,GAAG;AACvD,QAAM,UAAU,mBAAmB,QAAQ,YAAY,mBAAmB;AAC1E,SAAO,EAAE,SAAS,OAAO,SAAS,QAAQ;AAC5C;AAMA,eAAe,kBACb,YACA,oBACqB;AACrB,MAAI,CAAC,mBAAoB,QAAO;AAChC,SAAO,2BAA2B,WAAW,GAAG;AAClD;AAEA,eAAe,iBACb,QACqB;AACrB,MAAI,CAAC,OAAO,aAAc,QAAO;AACjC,SAAO,2BAA2B,OAAO,SAAS;AACpD;AAGA,eAAe,2BAA2B,KAAkC;AAC1E,MAAI,MAAM,iBAAiB,GAAG,EAAG,QAAO;AACxC,SAAQ,MAAM,gBAAgB,GAAG,IAAK,SAAS;AACjD;AAEA,eAAe,eAAe,WAAmB,OAAsC;AACrF,MAAI;AACF,WAAO,MAAM,iBAAiB,WAAW,KAAK;AAAA,EAChD,QAAQ;AACN,WAAO,CAAC;AAAA,EACV;AACF;","names":[]}
|
package/dist/commands/update.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
unofferablePlacementsFound
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ECPFYHDX.js";
|
|
5
5
|
import {
|
|
6
6
|
providerFlag,
|
|
7
7
|
providerNamedBy,
|
|
8
8
|
refuseAnAmbiguousInstallation
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-ORO2T4K2.js";
|
|
10
10
|
import {
|
|
11
11
|
BaseCommand,
|
|
12
12
|
EXIT_CODES
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-IAQFZFWD.js";
|
|
14
14
|
import {
|
|
15
15
|
ERROR_MESSAGES,
|
|
16
16
|
INFO_MESSAGES,
|
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
marketplaceRefreshFailed,
|
|
22
22
|
marketplacesRefreshFailed,
|
|
23
23
|
marketplacesRefreshed
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
} from "../chunk-E45IT3HC.js";
|
|
25
|
+
import "../chunk-AIBVAYHS.js";
|
|
26
26
|
import {
|
|
27
27
|
EJECT_SOURCE
|
|
28
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-WUSEZFER.js";
|
|
29
29
|
import "../chunk-GHHJYNAN.js";
|
|
30
30
|
|
|
31
31
|
// src/cli/commands/update.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SkillAgentSummary
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-FQF6VHO3.js";
|
|
5
|
+
import "../../chunk-AIBVAYHS.js";
|
|
6
|
+
import "../../chunk-WUSEZFER.js";
|
|
7
7
|
export {
|
|
8
8
|
SkillAgentSummary
|
|
9
9
|
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
SummaryPanel,
|
|
4
3
|
summaryPanelBlock,
|
|
5
4
|
summaryPanelText
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-MHAQWMNJ.js";
|
|
5
|
+
} from "../../chunk-H5E6IO2L.js";
|
|
6
|
+
import "../../chunk-FQF6VHO3.js";
|
|
7
|
+
import "../../chunk-AIBVAYHS.js";
|
|
8
|
+
import "../../chunk-WUSEZFER.js";
|
|
11
9
|
export {
|
|
12
|
-
SummaryPanel,
|
|
13
10
|
summaryPanelBlock,
|
|
14
11
|
summaryPanelText
|
|
15
12
|
};
|
package/dist/hooks/init.js
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runDashboardFlow
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-APWMMZOK.js";
|
|
5
|
+
import "../chunk-I3WF6L43.js";
|
|
6
|
+
import "../chunk-TVEDNGVP.js";
|
|
7
|
+
import "../chunk-QCX66KBM.js";
|
|
8
8
|
import "../chunk-OZXAJNLA.js";
|
|
9
9
|
import "../chunk-P6CYS4JK.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-EHJIQDXR.js";
|
|
10
|
+
import "../chunk-H5E6IO2L.js";
|
|
11
|
+
import "../chunk-6PGXTLA4.js";
|
|
12
|
+
import "../chunk-R7GKQBZJ.js";
|
|
13
|
+
import "../chunk-REHVGFJE.js";
|
|
14
|
+
import "../chunk-7BHDKEGK.js";
|
|
15
|
+
import "../chunk-IXVGBUWI.js";
|
|
16
|
+
import "../chunk-EFXVYQGT.js";
|
|
18
17
|
import "../chunk-KIK5EZYD.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import
|
|
18
|
+
import "../chunk-FQF6VHO3.js";
|
|
19
|
+
import {
|
|
20
|
+
providerNamedIn
|
|
21
|
+
} from "../chunk-ORO2T4K2.js";
|
|
21
22
|
import {
|
|
22
23
|
EXIT_CODES
|
|
23
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-IAQFZFWD.js";
|
|
24
25
|
import {
|
|
26
|
+
detectInstallations,
|
|
25
27
|
findConfigLoadFailures,
|
|
28
|
+
forgetTheProviderChosenForThisRun,
|
|
26
29
|
installationConfigsUnreadable,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
isHomeDirectory,
|
|
31
|
+
providerInUse,
|
|
32
|
+
retiredSourceFolderIgnored,
|
|
33
|
+
rootsHoldingTheRetiredSourceFolder
|
|
34
|
+
} from "../chunk-E45IT3HC.js";
|
|
35
|
+
import "../chunk-AIBVAYHS.js";
|
|
36
|
+
import "../chunk-WUSEZFER.js";
|
|
32
37
|
import "../chunk-GHHJYNAN.js";
|
|
33
38
|
|
|
34
39
|
// src/cli/hooks/init.ts
|
|
35
|
-
import os from "os";
|
|
36
40
|
import { flush } from "@oclif/core";
|
|
37
41
|
var hook = async function(options) {
|
|
38
|
-
|
|
42
|
+
forgetTheProviderChosenForThisRun();
|
|
43
|
+
await sayTheRetiredSourceFolderIsIgnored(process.cwd(), providerNamedIn(options.argv));
|
|
39
44
|
if (options.id !== void 0) return;
|
|
40
45
|
const projectDir = process.cwd();
|
|
41
46
|
const unreadable = await findConfigLoadFailures(projectDir);
|
|
@@ -56,12 +61,22 @@ var hook = async function(options) {
|
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
};
|
|
59
|
-
function
|
|
60
|
-
for (const root of
|
|
61
|
-
|
|
64
|
+
async function sayTheRetiredSourceFolderIsIgnored(cwd, named) {
|
|
65
|
+
for (const root of rootsHoldingTheRetiredSourceFolder(cwd)) {
|
|
66
|
+
const provider = named ?? await providerReadIn(root, cwd);
|
|
67
|
+
process.stderr.write(`${retiredSourceFolderIgnored(root, provider)}
|
|
62
68
|
`);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
71
|
+
async function providerReadIn(root, cwd) {
|
|
72
|
+
if (!isHomeDirectory(root)) return providerInUse(root);
|
|
73
|
+
if (!await projectHoldsAnInstallation(cwd)) return providerInUse(root);
|
|
74
|
+
return providerInUse(cwd);
|
|
75
|
+
}
|
|
76
|
+
async function projectHoldsAnInstallation(cwd) {
|
|
77
|
+
const found = await detectInstallations(cwd);
|
|
78
|
+
return found.some((installation) => installation.scope === "project");
|
|
79
|
+
}
|
|
65
80
|
async function endRun(code) {
|
|
66
81
|
await flush();
|
|
67
82
|
process.exit(code);
|
package/dist/hooks/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/hooks/init.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/cli/hooks/init.ts"],"sourcesContent":["import { flush, type Hook } from \"@oclif/core\";\nimport { runDashboardFlow } from \"../commands/init.js\";\nimport type { Provider } from \"../consts.js\";\nimport { findConfigLoadFailures } from \"../lib/configuration/project-config.js\";\nimport { detectInstallations } from \"../lib/installation/detect-installations.js\";\nimport {\n forgetTheProviderChosenForThisRun,\n providerInUse,\n rootsHoldingTheRetiredSourceFolder,\n} from \"../lib/installation/install-layout.js\";\nimport { isHomeDirectory } from \"../lib/installation/is-home-directory.js\";\nimport { providerNamedIn } from \"../lib/installation/provider-flag.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { installationConfigsUnreadable, retiredSourceFolderIgnored } from \"../utils/messages.js\";\n\nconst hook: Hook<\"init\"> = async function (options) {\n forgetTheProviderChosenForThisRun();\n await sayTheRetiredSourceFolderIsIgnored(process.cwd(), providerNamedIn(options.argv));\n\n // A named command runs as named; no command is the dashboard.\n if (options.id !== undefined) return;\n\n const projectDir = process.cwd();\n // Checked here: oclif's hook runner swallows a load error thrown inside the dashboard.\n const unreadable = await findConfigLoadFailures(projectDir);\n if (unreadable.length > 0) {\n this.error(installationConfigsUnreadable(unreadable), { exit: EXIT_CODES.ERROR });\n }\n\n const dashboard = await runDashboardFlow(projectDir, options.config);\n switch (dashboard) {\n case \"cancelled\":\n return this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n case \"shown\":\n return endRun(EXIT_CODES.SUCCESS);\n case \"not-installed\":\n // oclif goes on to print the root help.\n return;\n default: {\n const _exhaustive: never = dashboard;\n return _exhaustive;\n }\n }\n};\n\n/**\n * Before any command's output, on stderr so piped output is unchanged; nothing reads the folder.\n * Flags are not parsed yet, so the provider a run names is read off its arguments: that run reads\n * the named provider's folder in every root.\n */\nasync function sayTheRetiredSourceFolderIsIgnored(\n cwd: string,\n named: Provider | undefined,\n): Promise<void> {\n for (const root of rootsHoldingTheRetiredSourceFolder(cwd)) {\n const provider = named ?? (await providerReadIn(root, cwd));\n process.stderr.write(`${retiredSourceFolderIgnored(root, provider)}\\n`);\n }\n}\n\n/**\n * A run naming no provider reads a project with its own tool, and HOME with the project's, as it\n * reads HOME's config; a project holding no installation leaves the run on HOME's own.\n */\nasync function providerReadIn(root: string, cwd: string): Promise<Provider> {\n if (!isHomeDirectory(root)) return providerInUse(root);\n if (!(await projectHoldsAnInstallation(cwd))) return providerInUse(root);\n return providerInUse(cwd);\n}\n\nasync function projectHoldsAnInstallation(cwd: string): Promise<boolean> {\n const found = await detectInstallations(cwd);\n return found.some((installation) => installation.scope === \"project\");\n}\n\n/** Not `this.exit(0)`: oclif swallows an exit 0 from a hook and goes on to print the root help. */\nasync function endRun(code: number): Promise<never> {\n await flush();\n process.exit(code);\n}\n\nexport default hook;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,aAAwB;AAejC,IAAM,OAAqB,eAAgB,SAAS;AAClD,oCAAkC;AAClC,QAAM,mCAAmC,QAAQ,IAAI,GAAG,gBAAgB,QAAQ,IAAI,CAAC;AAGrF,MAAI,QAAQ,OAAO,OAAW;AAE9B,QAAM,aAAa,QAAQ,IAAI;AAE/B,QAAM,aAAa,MAAM,uBAAuB,UAAU;AAC1D,MAAI,WAAW,SAAS,GAAG;AACzB,SAAK,MAAM,8BAA8B,UAAU,GAAG,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,EAClF;AAEA,QAAM,YAAY,MAAM,iBAAiB,YAAY,QAAQ,MAAM;AACnE,UAAQ,WAAW;AAAA,IACjB,KAAK;AACH,aAAO,KAAK,MAAM,aAAa,EAAE,MAAM,WAAW,UAAU,CAAC;AAAA,IAC/D,KAAK;AACH,aAAO,OAAO,WAAW,OAAO;AAAA,IAClC,KAAK;AAEH;AAAA,IACF,SAAS;AACP,YAAM,cAAqB;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACF;AAOA,eAAe,mCACb,KACA,OACe;AACf,aAAW,QAAQ,mCAAmC,GAAG,GAAG;AAC1D,UAAM,WAAW,SAAU,MAAM,eAAe,MAAM,GAAG;AACzD,YAAQ,OAAO,MAAM,GAAG,2BAA2B,MAAM,QAAQ,CAAC;AAAA,CAAI;AAAA,EACxE;AACF;AAMA,eAAe,eAAe,MAAc,KAAgC;AAC1E,MAAI,CAAC,gBAAgB,IAAI,EAAG,QAAO,cAAc,IAAI;AACrD,MAAI,CAAE,MAAM,2BAA2B,GAAG,EAAI,QAAO,cAAc,IAAI;AACvE,SAAO,cAAc,GAAG;AAC1B;AAEA,eAAe,2BAA2B,KAA+B;AACvE,QAAM,QAAQ,MAAM,oBAAoB,GAAG;AAC3C,SAAO,MAAM,KAAK,CAAC,iBAAiB,aAAa,UAAU,SAAS;AACtE;AAGA,eAAe,OAAO,MAA8B;AAClD,QAAM,MAAM;AACZ,UAAQ,KAAK,IAAI;AACnB;AAEA,IAAO,eAAQ;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadAgentDefs
|
|
4
|
+
} from "./chunk-7BHDKEGK.js";
|
|
5
|
+
import "./chunk-IXVGBUWI.js";
|
|
6
|
+
import "./chunk-EFXVYQGT.js";
|
|
7
|
+
import "./chunk-E45IT3HC.js";
|
|
8
|
+
import "./chunk-AIBVAYHS.js";
|
|
9
|
+
import "./chunk-WUSEZFER.js";
|
|
10
|
+
import "./chunk-GHHJYNAN.js";
|
|
11
|
+
export {
|
|
12
|
+
loadAgentDefs
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=load-agent-defs-5U5KAURA.js.map
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
compileAgents,
|
|
4
4
|
discoverInstalledSkills,
|
|
5
5
|
withCatalogueSeatedFor
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-REHVGFJE.js";
|
|
7
7
|
import {
|
|
8
8
|
loadAgentDefs
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-7BHDKEGK.js";
|
|
10
|
+
import "./chunk-IXVGBUWI.js";
|
|
11
|
+
import "./chunk-EFXVYQGT.js";
|
|
12
12
|
import {
|
|
13
13
|
getErrorMessage,
|
|
14
14
|
resolveInstallPaths
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-E45IT3HC.js";
|
|
16
|
+
import "./chunk-AIBVAYHS.js";
|
|
17
|
+
import "./chunk-WUSEZFER.js";
|
|
18
18
|
import "./chunk-GHHJYNAN.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/lib/operations/project/recompile-project-agents.ts
|
|
@@ -62,4 +62,4 @@ function summarizeRecompiles(outcomes) {
|
|
|
62
62
|
export {
|
|
63
63
|
recompilePropagatedProjectAgents
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=recompile-project-agents-
|
|
65
|
+
//# sourceMappingURL=recompile-project-agents-KYK44C24.js.map
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
loadMarketplaceMatrix,
|
|
6
6
|
loadSkillsMatrixFromSource,
|
|
7
7
|
mergeLocalSkillsIntoMatrix
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-E45IT3HC.js";
|
|
9
|
+
import "./chunk-AIBVAYHS.js";
|
|
10
|
+
import "./chunk-WUSEZFER.js";
|
|
11
11
|
import "./chunk-GHHJYNAN.js";
|
|
12
12
|
export {
|
|
13
13
|
MarketplaceManifestRequiredError,
|
|
@@ -16,4 +16,4 @@ export {
|
|
|
16
16
|
loadSkillsMatrixFromSource,
|
|
17
17
|
mergeLocalSkillsIntoMatrix
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=source-loader-
|
|
19
|
+
//# sourceMappingURL=source-loader-G5I4RNUP.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-inc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.174.0",
|
|
4
4
|
"description": "CLI for managing Agents Inc. skills, stacks, and agents for Claude Code",
|
|
5
5
|
"//generate": "Runs all four generators in dependency order; the :check variants stay separate because CI runs different subsets.",
|
|
6
6
|
"//no-shared-vitest-config": "A three-project suite with globals on and its own setup and timeouts; the shared single-project, globals-off config would contradict it.",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/installation/provider-flag.ts"],"sourcesContent":["/**\n * `--provider`: names the installation where the folder cannot — a greenfield `init --from`, or a\n * scope holding both providers, where acting commands refuse until it is given.\n */\n\nimport os from \"os\";\n\nimport { Flags } from \"@oclif/core\";\n\nimport { PROVIDERS, EDITOR_URL, CLI_INVOKE_COMMAND, type Provider } from \"../../consts.js\";\nimport { detectInstallations, type DetectedInstallation } from \"./detect-installations.js\";\nimport { chooseProviderForThisRun } from \"./install-layout.js\";\n\n/** A factory because oclif mutates flag definitions, so commands must not share one. */\nexport function providerFlag() {\n return Flags.string({\n description: \"Which provider's installation this run is about\",\n helpValue: `<${PROVIDERS.join(\"|\")}>`,\n options: [...PROVIDERS],\n });\n}\n\n/** oclif has already rejected unlisted values; this only narrows. */\nexport function providerNamedBy(flagValue: string | undefined): Provider | undefined {\n if (flagValue === undefined) return undefined;\n return PROVIDERS.find((provider) => provider === flagValue);\n}\n\nexport function providerNeedsAConfigurationToInstall(): string {\n return (\n `--provider names which installation to create and needs the configuration to create it ` +\n `from, so it is only meaningful beside --from. Build one at ${EDITOR_URL}, then run ` +\n `'${CLI_INVOKE_COMMAND} init --from <id> --provider <provider>'.`\n );\n}\n\nfunction ambiguousInstallation(\n subject: string,\n providers: readonly Provider[],\n scopeRoot: string,\n): string {\n return (\n `${scopeRoot} holds ${providers.length} installations — ${providers.join(\" and \")} — so ` +\n `${subject} cannot tell which one you mean. Name it with --provider <${providers.join(\"|\")}>. ` +\n `Nothing has been changed.`\n );\n}\n\ntype InstallationsInPlay = {\n scopeRoot: string;\n providers: Provider[];\n};\n\n/** The project's installations, or the global ones only when the project has none. */\nasync function installationsInPlay(cwd: string): Promise<InstallationsInPlay> {\n const found = await detectInstallations(cwd);\n const inTheProject = atScope(found, \"project\");\n\n if (inTheProject.length > 0) return { scopeRoot: cwd, providers: providersOf(inTheProject) };\n return { scopeRoot: os.homedir(), providers: providersOf(atScope(found, \"global\")) };\n}\n\nfunction atScope(\n found: readonly DetectedInstallation[],\n scope: DetectedInstallation[\"scope\"],\n): DetectedInstallation[] {\n return found.filter((installation) => installation.scope === scope);\n}\n\nfunction providersOf(installations: readonly DetectedInstallation[]): Provider[] {\n return installations.map((installation) => installation.provider);\n}\n\n/**\n * A named provider is committed for the run; two installations and no flag call `onAmbiguous`\n * (the command's `this.error`); otherwise nothing happens.\n */\nexport async function refuseAnAmbiguousInstallation(\n cwd: string,\n subject: string,\n named: Provider | undefined,\n onAmbiguous: (message: string) => never,\n): Promise<void> {\n if (named !== undefined) {\n chooseProviderForThisRun(named);\n return;\n }\n\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n if (providers.length <= 1) return;\n\n onAmbiguous(ambiguousInstallation(subject, providers, scopeRoot));\n}\n\n/** The non-refusing read the remedies hand a command out from, so they and the refusal agree. */\nexport async function providersInPlay(cwd: string): Promise<Provider[]> {\n return (await installationsInPlay(cwd)).providers;\n}\n\n/**\n * Which installation a handed-out acting command must name: the one the run named, else the choice\n * where two are in play, since a bare one refuses there.\n */\nexport async function installationToName(\n cwd: string,\n named: Provider | undefined,\n): Promise<Provider | Provider[] | undefined> {\n if (named !== undefined) return named;\n\n const providers = await providersInPlay(cwd);\n return providers.length > 1 ? providers : undefined;\n}\n\n/** The non-refusing form, for `doctor`. */\nexport async function ambiguityFinding(cwd: string): Promise<string | null> {\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n if (providers.length <= 1) return null;\n\n return ambiguousInstallation(\"every command that acts on one\", providers, scopeRoot);\n}\n\n/** For `list`: names the other installation in the scope, or `null` when there is none. */\nexport async function otherInstallationsInThisScope(\n cwd: string,\n showing: Provider,\n): Promise<string | null> {\n const { scopeRoot, providers } = await installationsInPlay(cwd);\n const others = providers.filter((provider) => provider !== showing);\n if (others.length === 0) return null;\n\n return (\n `${scopeRoot} holds ${providers.length} installations — ${providers.join(\" and \")} — and this ` +\n `is the ${showing} one. Show another with --provider <${providers.join(\"|\")}>.`\n );\n}\n"],"mappings":";;;;;;;;;;;;AAKA,OAAO,QAAQ;AAEf,SAAS,aAAa;AAOf,SAAS,eAAe;AAC7B,SAAO,MAAM,OAAO;AAAA,IAClB,aAAa;AAAA,IACb,WAAW,IAAI,UAAU,KAAK,GAAG,CAAC;AAAA,IAClC,SAAS,CAAC,GAAG,SAAS;AAAA,EACxB,CAAC;AACH;AAGO,SAAS,gBAAgB,WAAqD;AACnF,MAAI,cAAc,OAAW,QAAO;AACpC,SAAO,UAAU,KAAK,CAAC,aAAa,aAAa,SAAS;AAC5D;AAEO,SAAS,uCAA+C;AAC7D,SACE,qJAC8D,UAAU,eACpE,kBAAkB;AAE1B;AAEA,SAAS,sBACP,SACA,WACA,WACQ;AACR,SACE,GAAG,SAAS,UAAU,UAAU,MAAM,yBAAoB,UAAU,KAAK,OAAO,CAAC,cAC9E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