Skip to content

Commit cccbef6

Browse files
cameroncookeclaude
andcommitted
ref(visibility): Remove unused Xcode tools predicate context
Remove xcodeToolsActive/xcodeToolsAvailable from predicate context and remove the unused requiresXcodeTools/xcodeToolsAvailable predicates. This simplifies runtime visibility evaluation and avoids carrying bridge availability state in the core exposure path. Update tests and manifest docs to match the active predicate surface. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d3ae6dc commit cccbef6

10 files changed

Lines changed: 14 additions & 65 deletions

File tree

docs/dev/MANIFEST_FORMAT.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,17 @@ Predicates control visibility based on runtime context. All predicates in the ar
299299
|-----------|-------------|
300300
| `debugEnabled` | Show only when `config.debug` is `true` |
301301
| `experimentalWorkflowDiscoveryEnabled` | Show only when experimental workflow discovery is enabled |
302+
| `mcpRuntimeOnly` | Show only in MCP runtime (hide in CLI/daemon catalogs) |
302303
| `runningUnderXcodeAgent` | Show only when running under Xcode's coding agent |
303-
| `requiresXcodeTools` | Show only when Xcode Tools bridge is active |
304304
| `hideWhenXcodeAgentMode` | Hide when running inside Xcode's coding agent (tools conflict with Xcode's native equivalents) |
305+
| `xcodeAutoSyncDisabled` | Show only when running under Xcode and `config.disableXcodeAutoSync` is `true` |
305306
| `always` | Always visible (explicit documentation) |
306307
| `never` | Never visible (temporarily disable) |
307308

309+
Notes:
310+
- Bridge availability/connection is handled at tool call time, not as a visibility predicate.
311+
- Prefer runtime/config predicates for deterministic tool exposure.
312+
308313
### Predicate Context
309314

310315
Predicates receive a context object:
@@ -314,7 +319,6 @@ interface PredicateContext {
314319
runtime: 'cli' | 'mcp' | 'daemon';
315320
config: ResolvedRuntimeConfig;
316321
runningUnderXcode: boolean;
317-
xcodeToolsActive: boolean;
318322
}
319323
```
320324

@@ -354,12 +358,20 @@ selection:
354358
mcp:
355359
defaultEnabled: true
356360
361+
# MCP-only workflow/tool visibility
362+
predicates:
363+
- mcpRuntimeOnly
364+
357365
# Auto-included only when predicates pass (e.g., debug mode)
358366
selection:
359367
mcp:
360368
autoInclude: true
361369
predicates:
362370
- debugEnabled
371+
372+
# Show only when manual Xcode sync is needed
373+
predicates:
374+
- xcodeAutoSyncDisabled
363375
```
364376

365377
## Tool Re-export

src/cli/commands/tools.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { getEffectiveCliName } from '../../core/manifest/schema.ts';
99
import { isWorkflowEnabledForRuntime, isToolExposedForRuntime } from '../../visibility/exposure.ts';
1010
import type { PredicateContext } from '../../visibility/predicate-types.ts';
1111
import { getConfig } from '../../utils/config-store.ts';
12-
import { getMcpBridgeAvailability } from '../../integrations/xcode-tools-bridge/core.ts';
1312

1413
const CLI_EXCLUDED_WORKFLOWS = new Set(['session-management', 'workflow-discovery']);
1514

@@ -82,13 +81,10 @@ function toGroupedJsonTool(tool: ToolListItem): JsonTool {
8281
* CLI is never running under Xcode and never has Xcode tools active.
8382
*/
8483
async function buildCliPredicateContext(): Promise<PredicateContext> {
85-
const bridge = await getMcpBridgeAvailability();
8684
return {
8785
runtime: 'cli',
8886
config: getConfig(),
8987
runningUnderXcode: false,
90-
xcodeToolsActive: false,
91-
xcodeToolsAvailable: bridge.available,
9288
};
9389
}
9490

src/mcp/tools/workflow-discovery/__tests__/manage_workflows.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ vi.mock('../../../../utils/tool-registry.ts', () => ({
77
runtime: 'mcp',
88
config: { debug: false },
99
runningUnderXcode: false,
10-
xcodeToolsActive: false,
1110
}),
1211
}));
1312

src/runtime/tool-catalog.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ export async function buildDaemonToolCatalogFromManifest(opts?: {
219219
runtime: 'daemon',
220220
config: getConfig(),
221221
runningUnderXcode: false,
222-
xcodeToolsActive: false,
223-
xcodeToolsAvailable: false,
224222
};
225223

226224
return buildToolCatalogFromManifest({
@@ -238,7 +236,5 @@ async function buildCliPredicateContext(): Promise<PredicateContext> {
238236
runtime: 'cli',
239237
config: getConfig(),
240238
runningUnderXcode: false,
241-
xcodeToolsActive: false,
242-
xcodeToolsAvailable: false,
243239
};
244240
}

src/server/bootstrap.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ export async function bootstrapServer(
8585
runtime: 'mcp',
8686
config: result.runtime.config,
8787
runningUnderXcode: xcodeDetection.runningUnderXcode,
88-
xcodeToolsActive: false,
89-
xcodeToolsAvailable: true,
9088
};
9189

9290
stageStartMs = getStartupProfileNowMs();

src/utils/tool-registry.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ export function getMcpPredicateContext(): PredicateContext {
5353
runtime: 'mcp',
5454
config: getConfig(),
5555
runningUnderXcode: false,
56-
xcodeToolsActive: false,
57-
xcodeToolsAvailable: false,
5856
};
5957
}
6058

@@ -153,8 +151,6 @@ export async function registerWorkflowsFromManifest(
153151
runtime: 'mcp',
154152
config: getConfig(),
155153
runningUnderXcode: false,
156-
xcodeToolsActive: false,
157-
xcodeToolsAvailable: false,
158154
};
159155
await applyWorkflowSelectionFromManifest(workflowNames, effectiveCtx);
160156
}

src/visibility/__tests__/exposure.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ function createContext(overrides: Partial<PredicateContext> = {}): PredicateCont
3939
runtime: 'mcp',
4040
config: createDefaultConfig(),
4141
runningUnderXcode: false,
42-
xcodeToolsActive: false,
43-
xcodeToolsAvailable: false,
4442
...overrides,
4543
};
4644
}

src/visibility/__tests__/predicate-registry.test.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ function createContext(overrides: Partial<PredicateContext> = {}): PredicateCont
3232
runtime: 'mcp',
3333
config: createDefaultConfig(),
3434
runningUnderXcode: false,
35-
xcodeToolsActive: false,
36-
xcodeToolsAvailable: false,
3735
...overrides,
3836
};
3937
}
@@ -84,30 +82,6 @@ describe('predicate-registry', () => {
8482
});
8583
});
8684

87-
describe('requiresXcodeTools', () => {
88-
it('should return true when Xcode tools are active', () => {
89-
const ctx = createContext({ xcodeToolsActive: true });
90-
expect(PREDICATES.requiresXcodeTools(ctx)).toBe(true);
91-
});
92-
93-
it('should return false when Xcode tools are not active', () => {
94-
const ctx = createContext({ xcodeToolsActive: false });
95-
expect(PREDICATES.requiresXcodeTools(ctx)).toBe(false);
96-
});
97-
});
98-
99-
describe('xcodeToolsAvailable', () => {
100-
it('should return true when Xcode tools bridge is available', () => {
101-
const ctx = createContext({ xcodeToolsAvailable: true });
102-
expect(PREDICATES.xcodeToolsAvailable(ctx)).toBe(true);
103-
});
104-
105-
it('should return false when Xcode tools bridge is not available', () => {
106-
const ctx = createContext({ xcodeToolsAvailable: false });
107-
expect(PREDICATES.xcodeToolsAvailable(ctx)).toBe(false);
108-
});
109-
});
110-
11185
describe('mcpRuntimeOnly', () => {
11286
it('should return true for MCP runtime', () => {
11387
const ctx = createContext({ runtime: 'mcp' });
@@ -224,8 +198,6 @@ describe('predicate-registry', () => {
224198
expect(names).toContain('debugEnabled');
225199
expect(names).toContain('experimentalWorkflowDiscoveryEnabled');
226200
expect(names).toContain('runningUnderXcodeAgent');
227-
expect(names).toContain('requiresXcodeTools');
228-
expect(names).toContain('xcodeToolsAvailable');
229201
expect(names).toContain('mcpRuntimeOnly');
230202
expect(names).toContain('hideWhenXcodeAgentMode');
231203
expect(names).toContain('xcodeAutoSyncDisabled');

src/visibility/predicate-registry.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@ export const PREDICATES: Record<string, PredicateFn> = {
2727
*/
2828
runningUnderXcodeAgent: (ctx: PredicateContext): boolean => ctx.runningUnderXcode === true,
2929

30-
/**
31-
* Show only when Xcode Tools bridge is available and active.
32-
* Use for tools/workflows that require the Xcode Tools integration.
33-
*/
34-
requiresXcodeTools: (ctx: PredicateContext): boolean => ctx.xcodeToolsActive === true,
35-
36-
/**
37-
* Show only when xcrun mcpbridge is available on the host system.
38-
* Use for workflows/tools that depend on Xcode's MCP bridge binary.
39-
*/
40-
xcodeToolsAvailable: (ctx: PredicateContext): boolean => ctx.xcodeToolsAvailable === true,
41-
4230
/**
4331
* Show only for MCP runtime.
4432
* Use for MCP-only gateway tools that should not appear in CLI workflows.

src/visibility/predicate-types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ export interface PredicateContext {
2323

2424
/** Whether running under Xcode agent environment */
2525
runningUnderXcode: boolean;
26-
27-
/** Whether Xcode Tools bridge is active (MCP only; false otherwise) */
28-
xcodeToolsActive: boolean;
29-
30-
/** Whether the Xcode Tools bridge binary is available on this system */
31-
xcodeToolsAvailable?: boolean;
3226
}
3327

3428
/**

0 commit comments

Comments
 (0)