Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/.claude/skills/framework/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ disk is exactly the job that needs all three.

| Concept | Location |
|---|---|
| The manifest aggregate and its members | `domain/manifest.ts`, `domain/manifest/` (tool-entry, tracked-files, merge-files, mcp-exclusions, native-registrations) |
| The manifest aggregate and its members | `domain/manifest.ts`, `domain/manifest/` (tool-entry, tracked-files, merge-files, native-registrations) |
| A plugin's declared state | `domain/plugins/` (installed-plugin, source-resolver, requested-version-policy) |
| The diagnosis shape | `domain/doctor.ts` |
| Setup orchestration state | `domain/setup-flow.ts` |
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ import type { ToolId } from "../../../../kernel/tool.js";
import { VALID_TOOL_IDS } from "../../../../kernel/tool.js";
import type { Manifest } from "../../domain/manifest.js";
import type { ManifestRepository } from "../../domain/ports/manifest-repository.js";
import { UninstallMcpExclusionUseCase } from "./uninstall-mcp-exclusion-use-case.js";
import { UninstallPluginUseCase } from "./uninstall-plugin-use-case.js";
import { UninstallToolsUseCase } from "./uninstall-tools-use-case.js";

interface UninstallOptions {
toolIds: ToolId[];
projectRoot: string;
mcpFilter: string[];
pluginName?: string;
}

Expand All @@ -30,7 +28,6 @@ interface UninstallToolResult {
export class UninstallUseCase {
private readonly pluginUninstall: UninstallPluginUseCase;
private readonly toolsUninstall: UninstallToolsUseCase;
private readonly mcpExclusion: UninstallMcpExclusionUseCase;

constructor(
fs: FileReader & FileWriter,
Expand All @@ -39,11 +36,10 @@ export class UninstallUseCase {
) {
this.pluginUninstall = new UninstallPluginUseCase(fs, manifestRepo);
this.toolsUninstall = new UninstallToolsUseCase(fs, logger);
this.mcpExclusion = new UninstallMcpExclusionUseCase(fs, logger);
}

async execute(options: UninstallOptions): Promise<UninstallToolResult[]> {
const { toolIds, projectRoot, mcpFilter, pluginName } = options;
const { toolIds, projectRoot, pluginName } = options;

if (pluginName !== undefined) {
return this.pluginUninstall.execute({ pluginName, toolIds, projectRoot });
Expand All @@ -57,10 +53,7 @@ export class UninstallUseCase {

const manifest = await this.loadAndValidate(toolIds);

const results =
mcpFilter.length > 0
? await this.runMcpExclusions(toolIds, manifest, projectRoot, mcpFilter)
: await this.toolsUninstall.execute({ toolIds, manifest, projectRoot });
const results = await this.toolsUninstall.execute({ toolIds, manifest, projectRoot });

await this.manifestRepo.save(manifest);
return results;
Expand All @@ -74,17 +67,4 @@ export class UninstallUseCase {
}
return manifest;
}

private async runMcpExclusions(
toolIds: ToolId[],
manifest: Manifest,
projectRoot: string,
mcpFilter: string[]
): Promise<UninstallToolResult[]> {
const results: UninstallToolResult[] = [];
for (const toolId of toolIds) {
results.push(await this.mcpExclusion.execute({ toolId, manifest, projectRoot, mcpFilter }));
}
return results;
}
}
46 changes: 3 additions & 43 deletions cli/src/contexts/framework/domain/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import type { FileHash, InstallationFile } from "../../../kernel/file.js";
import type { MergeFileEntry } from "../../../kernel/merge.js";
import { AIDD_DIR, MANIFEST_FILENAME } from "../../../kernel/paths.js";
import type { ToolId } from "../../../kernel/tool.js";
import type { McpExclusion } from "../../tools/domain/mcp-exclusion.js";
import { addExclusions, removeExclusions } from "./manifest/mcp-exclusions.js";
import type { NativeRegistrations } from "./manifest/native-registrations.js";
import {
addPluginToEntry,
Expand Down Expand Up @@ -59,8 +57,7 @@ export class Manifest {
toolId: ToolId,
version: string,
files: InstallationFile[],
mergeFiles: MergeFileEntry[] = [],
excludedMcp: McpExclusion[] = []
mergeFiles: MergeFileEntry[] = []
): void {
const existing = this._tools.get(toolId);
this._tools.set(
Expand All @@ -70,7 +67,6 @@ export class Manifest {
version,
files,
mergeFiles,
excludedMcp,
existingPlugins: existing?.plugins ?? [],
})
);
Expand Down Expand Up @@ -109,34 +105,6 @@ export class Manifest {
return tracked;
}

getExcludedMcp(toolId: ToolId): readonly McpExclusion[] {
return this._tools.get(toolId)?.excludedMcp ?? [];
}

addExcludedMcp(toolId: ToolId, exclusions: McpExclusion[]): void {
const entry = this._tools.get(toolId);
if (!entry) throw new ToolNotInManifestError(toolId);
this._tools.set(toolId, {
...entry,
excludedMcp: addExclusions(entry.excludedMcp, exclusions),
});
}

removeExcludedMcp(toolId: ToolId, exclusions: McpExclusion[]): void {
const entry = this._tools.get(toolId);
if (!entry) throw new ToolNotInManifestError(toolId);
this._tools.set(toolId, {
...entry,
excludedMcp: removeExclusions(entry.excludedMcp, exclusions),
});
}

clearExcludedMcp(toolId: ToolId): void {
const entry = this._tools.get(toolId);
if (!entry) throw new ToolNotInManifestError(toolId);
this._tools.set(toolId, { ...entry, excludedMcp: [] });
}

updateTrackedFileHash(toolId: ToolId, relativePath: string, hash: FileHash): void {
const entry = this._tools.get(toolId);
if (!entry) return;
Expand All @@ -146,18 +114,10 @@ export class Manifest {
});
}

updateToolMergeFiles(
toolId: ToolId,
mergeFiles: MergeFileEntry[],
excludedMcp?: McpExclusion[]
): void {
updateToolMergeFiles(toolId: ToolId, mergeFiles: MergeFileEntry[]): void {
const entry = this._tools.get(toolId);
if (!entry) throw new ToolNotInManifestError(toolId);
this._tools.set(toolId, {
...entry,
mergeFiles,
...(excludedMcp !== undefined && { excludedMcp }),
});
this._tools.set(toolId, { ...entry, mergeFiles });
}

removeTool(toolId: ToolId): void {
Expand Down
34 changes: 0 additions & 34 deletions cli/src/contexts/framework/domain/manifest/mcp-exclusions.ts

This file was deleted.

12 changes: 0 additions & 12 deletions cli/src/contexts/framework/domain/manifest/tool-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ import { DuplicatePluginError, PluginNotFoundError } from "../../../../kernel/er
import type { InstallationFile } from "../../../../kernel/file.js";
import type { MergeFileEntry } from "../../../../kernel/merge.js";
import type { ToolId } from "../../../../kernel/tool.js";
import type { McpExclusion } from "../../../tools/domain/mcp-exclusion.js";
import { InstalledPlugin, type PluginEntryData } from "../plugins/installed-plugin.js";
import {
type McpExclusionData,
parseMcpExclusionData,
toMcpExclusionData,
} from "./mcp-exclusions.js";
import {
type MergeFileEntryData,
parseMergeFileEntries,
Expand All @@ -33,7 +27,6 @@ export interface ToolEntry {
readonly version: string;
readonly files: readonly TrackedFile[];
readonly mergeFiles: readonly MergeFileEntry[];
readonly excludedMcp: readonly McpExclusion[];
readonly plugins: readonly InstalledPlugin[];
/** What this tool's own CLI was asked to register, or `undefined` for a tool with
* no `nativeActivation` — see {@link NativeRegistrations}. */
Expand All @@ -45,7 +38,6 @@ export interface ToolEntryData {
version: string;
files: TrackedFileData[];
mergeFiles?: MergeFileEntryData[];
excludedMcp?: McpExclusionData[];
plugins?: PluginEntryData[];
nativeRegistrations?: NativeRegistrationsData;
}
Expand All @@ -55,15 +47,13 @@ export function createToolEntry(params: {
version: string;
files: InstallationFile[];
mergeFiles: readonly MergeFileEntry[];
excludedMcp: readonly McpExclusion[];
existingPlugins: readonly InstalledPlugin[];
}): ToolEntry {
return {
toolId: params.toolId,
version: params.version,
files: toTrackedFiles(params.files),
mergeFiles: params.mergeFiles,
excludedMcp: params.excludedMcp,
plugins: params.existingPlugins,
};
}
Expand Down Expand Up @@ -104,7 +94,6 @@ export function serializeToolEntry(entry: ToolEntry): ToolEntryData {
version: entry.version,
files: toTrackedFileData(entry.files),
mergeFiles: toMergeFileEntryData(entry.mergeFiles),
...(entry.excludedMcp.length > 0 && { excludedMcp: toMcpExclusionData(entry.excludedMcp) }),
...(entry.plugins.length > 0 && { plugins: entry.plugins.map((p) => p.toJSON()) }),
...(entry.nativeRegistrations !== undefined && {
nativeRegistrations: toNativeRegistrationsData(entry.nativeRegistrations),
Expand All @@ -118,7 +107,6 @@ export function parseToolEntry(toolId: ToolId, data: ToolEntryData): ToolEntry {
version: data.version,
files: parseTrackedFiles(data.files),
mergeFiles: parseMergeFileEntries(data.mergeFiles ?? []),
excludedMcp: parseMcpExclusionData(data.excludedMcp ?? []),
plugins: (data.plugins ?? []).map((p) => InstalledPlugin.fromJSON(p)),
nativeRegistrations: parseNativeRegistrations(data.nativeRegistrations),
};
Expand Down
9 changes: 0 additions & 9 deletions cli/src/contexts/tools/domain/mcp-exclusion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,3 @@ function transformMcpForWin32(content: string): string {
export function transformFor(platform: string): ((content: string) => string) | undefined {
return platform === "win32" ? transformMcpForWin32 : undefined;
}

export interface McpExclusion {
readonly configPath: string;
readonly entryKey: string;
}

export function mcpExclusionEquals(a: McpExclusion, b: McpExclusion): boolean {
return a.configPath === b.configPath && a.entryKey === b.entryKey;
}
1 change: 0 additions & 1 deletion cli/src/presentation/commands/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ async function runFrameworkRemove(
const results = await deps.uninstallUseCase.execute({
toolIds: [toolId],
projectRoot,
mcpFilter: [],
});
const totalFileCount = results.reduce((sum, r) => sum + r.fileCount, 0);
printToolRemoved(output, results[0].toolId, totalFileCount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ describe("UninstallUseCase — plugin scope", () => {
await new UninstallUseCase(deps.fs, deps.manifestRepo, deps.logger).execute({
toolIds: [],
projectRoot: PROJECT_ROOT,
mcpFilter: [],
pluginName: "sample-plugin",
});

Expand All @@ -65,7 +64,6 @@ describe("UninstallUseCase — plugin scope", () => {
new UninstallUseCase(deps.fs, deps.manifestRepo, deps.logger).execute({
toolIds: [],
projectRoot: PROJECT_ROOT,
mcpFilter: [],
pluginName: "nonexistent",
})
).rejects.toThrow(PluginNotFoundError);
Expand Down
Loading