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
33 changes: 0 additions & 33 deletions src/agents/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ export const MCP_SERVER_NAME = 'polylane';
export const MCP_SERVER_URL = process.env.POLYLANE_MCP_URL || 'https://mcp.polylane.com/mcp';
export const SKILL_DIRECTORY_NAME = 'polylane-cli';

/** The prompt handed to a coding agent to map the current repository. */
export const MAPPING_PROMPT = 'Map this repository with Polylane';

export type WriteAction = 'created' | 'updated' | 'unchanged' | 'skipped';

export interface WriteOutcome {
Expand Down Expand Up @@ -279,28 +276,12 @@ export function upsertGooseExtension(path: string, dryRun = false): WriteOutcome
return { label, path, action: 'updated' };
}

/**
* How to launch an agent headlessly for a one-shot, auto-approved run of a
* prompt. Absent for agents with no scriptable headless entry (IDE/extension
* surfaces like Windsurf, Zed, Roo, VS Code).
*/
export interface HeadlessRun {
/** The executable to invoke; must resolve on PATH for the recipe to run. */
bin: string;
/** Build the full argv (excluding `bin`) for a one-shot run of `prompt`. */
args(prompt: string): string[];
/** Extra environment needed to run non-interactively (merged over process.env). */
env?: Record<string, string>;
}

export interface AgentSetup {
id: string;
name: string;
detect(home: string): boolean;
user(home: string, dryRun: boolean): WriteOutcome[];
project?(projectDir: string, dryRun: boolean): WriteOutcome[];
/** How to run this agent headlessly, when it has a scriptable one-shot mode. */
headlessRun?: HeadlessRun;
}

function skillFile(baseDir: string): string {
Expand All @@ -311,7 +292,6 @@ export const AGENTS: AgentSetup[] = [
{
id: 'claude',
name: 'Claude Code',
headlessRun: { bin: 'claude', args: (prompt) => ['-p', prompt, '--permission-mode', 'bypassPermissions'] },
detect: (home) => hasAgentFootprint(join(home, '.claude')) || existsSync(join(home, '.claude.json')),
user: (home, dryRun) => [
writeSkillFile(skillFile(join(home, '.claude')), dryRun),
Expand All @@ -325,7 +305,6 @@ export const AGENTS: AgentSetup[] = [
{
id: 'cursor',
name: 'Cursor',
headlessRun: { bin: 'cursor-agent', args: (prompt) => ['-p', prompt, '--force'] },
detect: (home) => hasAgentFootprint(join(home, '.cursor')),
user: (home, dryRun) => [
writeSkillFile(skillFile(join(home, '.cursor')), dryRun),
Expand All @@ -339,7 +318,6 @@ export const AGENTS: AgentSetup[] = [
{
id: 'opencode',
name: 'OpenCode',
headlessRun: { bin: 'opencode', args: (prompt) => ['run', prompt] },
detect: (home) => hasAgentFootprint(join(home, '.config', 'opencode')),
user: (home, dryRun) => [
writeSkillFile(skillFile(join(home, '.config', 'opencode')), dryRun),
Expand All @@ -363,7 +341,6 @@ export const AGENTS: AgentSetup[] = [
{
id: 'codex',
name: 'Codex CLI',
headlessRun: { bin: 'codex', args: (prompt) => ['exec', '--full-auto', prompt] },
detect: (home) => hasAgentFootprint(join(home, '.codex')),
user: (home, dryRun) => [
writeSkillFile(skillFile(join(home, '.codex')), dryRun),
Expand All @@ -382,7 +359,6 @@ export const AGENTS: AgentSetup[] = [
{
id: 'pi',
name: 'Pi',
headlessRun: { bin: 'pi', args: (prompt) => ['-p', prompt] },
detect: (home) => hasAgentFootprint(join(home, '.pi')),
user: (home, dryRun) => [
writeSkillFile(skillFile(join(home, '.pi', 'agent')), dryRun),
Expand All @@ -409,7 +385,6 @@ export const AGENTS: AgentSetup[] = [
{
id: 'cline',
name: 'Cline',
headlessRun: { bin: 'cline', args: (prompt) => ['--yolo', prompt] },
// Two Cline surfaces share one config format: the VS Code extension
// (globalStorage) and the Cline CLI (~/.cline). Write to whichever exists
// so we never create VS Code's storage tree for an uninstalled extension.
Expand Down Expand Up @@ -450,14 +425,12 @@ export const AGENTS: AgentSetup[] = [
{
id: 'goose',
name: 'Goose',
headlessRun: { bin: 'goose', args: (prompt) => ['run', '--no-session', '-t', prompt], env: { GOOSE_MODE: 'auto' } },
detect: (home) => hasAgentFootprint(join(home, '.config', 'goose')),
user: (home, dryRun) => [upsertGooseExtension(join(home, '.config', 'goose', 'config.yaml'), dryRun)],
},
{
id: 'gemini',
name: 'Gemini CLI',
headlessRun: { bin: 'gemini', args: (prompt) => ['-p', prompt, '--yolo'] },
detect: (home) => hasAgentFootprint(join(home, '.gemini')),
user: (home, dryRun) => [
upsertJsonEntry(join(home, '.gemini', 'settings.json'), ['mcpServers', MCP_SERVER_NAME], GEMINI_SERVER_ENTRY, dryRun),
Expand Down Expand Up @@ -512,8 +485,6 @@ export const AGENTS: AgentSetup[] = [
},
];

export const AGENT_IDS = AGENTS.map((a) => a.id);

/** The agents installed for `home`, in registry order. The one detection the installer and setup share. */
export function detectedAgents(home: string): AgentSetup[] {
return AGENTS.filter((a) => a.detect(home));
Expand Down Expand Up @@ -556,7 +527,3 @@ export function detectedAgentIds(home: string, namespace: AgentIdNamespace): str
return ids;
}

export function agentById(id: string): AgentSetup | undefined {
return AGENTS.find((a) => a.id === id);
}

2 changes: 0 additions & 2 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { authCommands } from './auth';
import { configCommands } from './config';
import { helpCommand } from './help';
import { setupCommand } from './setup';
import { mapCommand } from './map';
import { updateCommand } from './update';
import { feedCommands } from './feed';
import { issueCommands } from './issue';
Expand Down Expand Up @@ -49,7 +48,6 @@ export function registerAllCommands(): void {
...telemetryCommands,
helpCommand,
setupCommand,
mapCommand,
updateCommand,
];

Expand Down
231 changes: 0 additions & 231 deletions src/commands/map.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const NO_AUTH_COMMANDS = new Set([
'subscription plans',
'help',
'setup',
'map',
'update',
'version',
'api list',
Expand Down
1 change: 0 additions & 1 deletion src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const RESOURCE_ORDER: Record<string, ResourceGroup> = {
subscription: { name: 'subscription', description: 'Plan and billing (plans, show, upgrade, manage)', order: 71 },
auth: { name: 'auth', description: 'Authentication (login, status, logout)', order: 80 },
setup: { name: 'setup', description: 'Wire the CLI into coding agents (agent skill + MCP server)', order: 85 },
map: { name: 'map', description: 'Map this repository into your workspace using your coding agent', order: 86 },
config: { name: 'config', description: 'CLI configuration', order: 90 },
telemetry: { name: 'telemetry', description: 'Anonymous usage telemetry (status/enable/disable)', order: 95 },
api: { name: 'api', description: 'Raw API access (advanced)', order: 100 },
Expand Down
Loading
Loading