exponential-cli 1.7.0 → 1.8.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/dist/index.js +92 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/commands/auth.ts","../src/config/index.ts","../src/client/index.ts","../src/utils/errors.ts","../src/commands/actions.ts","../src/utils/output.ts","../src/commands/contacts.ts","../src/commands/deals.ts","../src/commands/epics.ts","../src/utils/resolve.ts","../src/commands/features.ts","../src/commands/stories.ts","../src/commands/scopes.ts","../src/commands/requirements.ts","../src/commands/areas.ts","../src/commands/labels.ts","../src/commands/organizations.ts","../src/commands/pages.ts","../src/commands/products.ts","../src/commands/projects.ts","../src/commands/tickets.ts","../src/commands/workspaces.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport { createAuthCommand } from './commands/auth.js';\nimport { createActionsCommand } from './commands/actions.js';\nimport { createContactsCommand } from './commands/contacts.js';\nimport { createDealsCommand } from './commands/deals.js';\nimport { createEpicsCommand } from './commands/epics.js';\nimport { createFeaturesCommand } from './commands/features.js';\nimport { createLabelsCommand } from './commands/labels.js';\nimport { createOrganizationsCommand } from './commands/organizations.js';\nimport { createPagesCommand } from './commands/pages.js';\nimport { createProductsCommand } from './commands/products.js';\nimport { createProjectsCommand } from './commands/projects.js';\nimport { createTicketsCommand } from './commands/tickets.js';\nimport { createWorkspacesCommand } from './commands/workspaces.js';\n\nconst program = new Command();\n\nprogram\n .name('exponential')\n .description(\n [\n 'CLI to interact with Exponential productivity app.',\n '',\n 'Work-tracking hierarchy:',\n ' workspace -> product -> feature -> ticket -> action',\n ' epics are workspace-scoped and can group tickets and actions across products.',\n ].join('\\n'),\n )\n .version('1.0.0')\n .option('--json', 'Output as JSON (default when piped)')\n .option('--pretty', 'Force pretty-printed output');\n\n// Add subcommands\nprogram.addCommand(createAuthCommand());\nprogram.addCommand(createActionsCommand());\nprogram.addCommand(createContactsCommand());\nprogram.addCommand(createDealsCommand());\nprogram.addCommand(createEpicsCommand());\nprogram.addCommand(createFeaturesCommand());\nprogram.addCommand(createLabelsCommand());\nprogram.addCommand(createOrganizationsCommand());\nprogram.addCommand(createPagesCommand());\nprogram.addCommand(createProductsCommand());\nprogram.addCommand(createProjectsCommand());\nprogram.addCommand(createTicketsCommand());\nprogram.addCommand(createWorkspacesCommand());\n\nprogram.parse();\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { getConfig, setConfig, clearConfig, isAuthenticated, getConfigPath } from '../config/index.js';\nimport { getClient, resetClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\n\nexport function createAuthCommand(): Command {\n const auth = new Command('auth')\n .description('Authentication commands');\n\n auth\n .command('login')\n .description('Configure CLI with your API token')\n .requiredOption('--token <token>', 'JWT token from /tokens page')\n .requiredOption('--api-url <url>', 'API URL (e.g., https://app.exponential.so)')\n .action(async (options: { token: string; apiUrl: string }) => {\n try {\n // Normalize API URL (remove trailing slash)\n let apiUrl = options.apiUrl.replace(/\\/+$/, '');\n\n // Ensure HTTPS for non-localhost\n if (!apiUrl.startsWith('http://localhost') && !apiUrl.startsWith('https://')) {\n apiUrl = `https://${apiUrl}`;\n }\n\n // Store the config\n setConfig({\n token: options.token,\n apiUrl: apiUrl,\n });\n\n // Reset client to use new config\n resetClient();\n\n // Validate by trying to list workspaces\n console.log(chalk.gray('Validating token...'));\n const client = getClient();\n await client.workspaces.list();\n\n console.log(chalk.green('Successfully authenticated!'));\n console.log(chalk.gray(`Config saved to: ${getConfigPath()}`));\n } catch (error) {\n // Clear invalid config\n clearConfig();\n handleError(error);\n }\n });\n\n auth\n .command('logout')\n .description('Remove stored credentials')\n .action(() => {\n clearConfig();\n resetClient();\n console.log(chalk.green('Successfully logged out.'));\n console.log(chalk.gray(`Config cleared from: ${getConfigPath()}`));\n });\n\n auth\n .command('whoami')\n .description('Show current authentication status')\n .action(async () => {\n if (!isAuthenticated()) {\n console.log(chalk.yellow('Not authenticated.'));\n console.log(chalk.gray('Run: exponential auth login --token <jwt> --api-url <url>'));\n process.exit(1);\n }\n\n try {\n const config = getConfig();\n const client = getClient();\n\n // Validate token by listing workspaces\n const workspaces = await client.workspaces.list();\n\n console.log(chalk.green('Authenticated'));\n console.log(chalk.gray(`API URL: ${config.apiUrl}`));\n console.log(chalk.gray(`Workspaces: ${(workspaces as unknown[]).length}`));\n console.log(chalk.gray(`Config: ${getConfigPath()}`));\n } catch (error) {\n handleError(error);\n }\n });\n\n auth\n .command('show')\n .description(\n 'Print parts of the current credentials. Use --token to print the raw JWT (for piping into other tools, e.g. `gh secret set EXPONENTIAL_TOKEN < <(exponential auth show --token)`).',\n )\n .option('--token', 'Print the raw JWT to stdout with no trailing newline')\n .action((options: { token?: boolean }) => {\n const config = getConfig();\n if (options.token) {\n if (!config.token) {\n console.error('Not authenticated. Run `exponential auth login` first.');\n process.exit(1);\n }\n process.stdout.write(config.token);\n return;\n }\n console.log(chalk.bold('\\nCredentials'));\n console.log(chalk.gray('─'.repeat(40)));\n console.log(`API URL: ${config.apiUrl || chalk.gray('(not set)')}`);\n console.log(\n `Token: ${config.token ? chalk.gray(`${config.token.substring(0, 20)}...`) : chalk.gray('(not set)')}`,\n );\n console.log(\n chalk.gray('Use `exponential auth show --token` to print the raw JWT.'),\n );\n console.log();\n });\n\n auth\n .command('status')\n .description('Show detailed authentication status')\n .action(() => {\n const config = getConfig();\n\n console.log(chalk.bold('\\nAuthentication Status'));\n console.log(chalk.gray('─'.repeat(40)));\n console.log(`Authenticated: ${isAuthenticated() ? chalk.green('Yes') : chalk.red('No')}`);\n console.log(`API URL: ${config.apiUrl || chalk.gray('(not set)')}`);\n console.log(`Token: ${config.token ? chalk.gray(`${config.token.substring(0, 20)}...`) : chalk.gray('(not set)')}`);\n console.log(`Config Path: ${getConfigPath()}`);\n console.log();\n });\n\n return auth;\n}\n","import { createConfigStore } from 'exponential-sdk';\nimport type { ExponentialConfig } from 'exponential-sdk';\n\nconst configStore = createConfigStore({ projectName: 'exponential-cli' });\n\nexport type { ExponentialConfig };\n\nexport function getConfig(): ExponentialConfig {\n return configStore.loadConfig();\n}\n\nexport function setConfig(values: Partial<ExponentialConfig>): void {\n configStore.saveConfig(values);\n}\n\nexport function clearConfig(): void {\n configStore.clearConfig();\n}\n\nexport function isAuthenticated(): boolean {\n return configStore.isAuthenticated();\n}\n\nexport function getConfigPath(): string {\n return configStore.getConfigPath();\n}\n","import { ExponentialClient } from 'exponential-sdk';\nimport { getConfig, isAuthenticated } from '../config/index.js';\n\nlet clientInstance: ExponentialClient | null = null;\n\nexport function getClient() {\n if (!isAuthenticated()) {\n throw new Error('Not authenticated. Run: exponential auth login --token <your-jwt> --api-url <url>');\n }\n\n if (clientInstance) {\n return clientInstance;\n }\n\n const config = getConfig();\n clientInstance = new ExponentialClient({\n token: config.token,\n apiUrl: config.apiUrl,\n });\n\n return clientInstance;\n}\n\nexport function resetClient() {\n clientInstance = null;\n}\n\nexport { isTRPCError, TRPCClientError } from 'exponential-sdk';\n","import chalk from 'chalk';\nimport { isTRPCError } from '../client/index.js';\n\nexport class ExponentialError extends Error {\n constructor(\n message: string,\n public code: string,\n public suggestion?: string,\n public details?: unknown\n ) {\n super(message);\n this.name = 'ExponentialError';\n }\n}\n\nexport function handleError(error: unknown, json: boolean = false): never {\n if (error instanceof ExponentialError) {\n if (json) {\n console.log(JSON.stringify({\n error: {\n code: error.code,\n message: error.message,\n suggestion: error.suggestion,\n },\n }, null, 2));\n } else {\n console.error(chalk.red(`Error: ${error.message}`));\n if (error.suggestion) {\n console.error(chalk.yellow(`Suggestion: ${error.suggestion}`));\n }\n }\n process.exit(1);\n }\n\n if (isTRPCError(error)) {\n const code = error.data?.code ?? 'UNKNOWN';\n let message = error.message;\n let suggestion: string | undefined;\n\n switch (code) {\n case 'UNAUTHORIZED':\n message = 'Authentication failed. Your token may have expired.';\n suggestion = 'Run: exponential auth login --token <new-token> --api-url <url>';\n break;\n case 'NOT_FOUND':\n message = 'Resource not found';\n break;\n case 'FORBIDDEN':\n message = 'Access denied';\n break;\n }\n\n if (json) {\n console.log(JSON.stringify({\n error: {\n code,\n message,\n suggestion,\n },\n }, null, 2));\n } else {\n console.error(chalk.red(`Error [${code}]: ${message}`));\n if (suggestion) {\n console.error(chalk.yellow(`Suggestion: ${suggestion}`));\n }\n }\n process.exit(1);\n }\n\n // Generic error handling\n if (json) {\n console.log(JSON.stringify({\n error: {\n code: 'UNKNOWN',\n message: error instanceof Error ? error.message : String(error),\n },\n }, null, 2));\n } else {\n console.error(chalk.red(`Error: ${error instanceof Error ? error.message : String(error)}`));\n }\n process.exit(1);\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputActionsJson,\n outputActionsPretty,\n outputActionJson,\n outputActionPretty,\n outputCommentJson,\n outputCommentPretty,\n outputCommentsJson,\n outputCommentsPretty,\n} from '../utils/output.js';\nimport type { Action, KanbanStatus, Priority } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nconst VALID_PRIORITIES: Priority[] = [\n 'Quick',\n 'Scheduled',\n '1st Priority',\n '2nd Priority',\n '3rd Priority',\n '4th Priority',\n '5th Priority',\n 'Errand',\n 'Remember',\n 'Watch',\n 'Someday Maybe',\n];\n\nexport function createActionsCommand(): Command {\n const actions = new Command('actions')\n .description('Manage actions/tasks');\n\n actions\n .command('list')\n .description('List all actions')\n .option('--project <id>', 'Filter by project ID')\n .option('--status <status>', 'Filter by kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)')\n .option('--assignee <id>', 'Filter by assignee ID')\n .action(async (options: { project?: string; status?: string; assignee?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const kanbanStatus = options.status as KanbanStatus | undefined;\n\n const actions = await client.actions.list({\n projectId: options.project,\n status: kanbanStatus,\n assigneeId: options.assignee,\n });\n\n if (useJson) {\n outputActionsJson(actions, {\n projectId: options.project,\n kanbanStatus: options.status,\n });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('today')\n .description('Get actions due today')\n .option('--workspace <id>', 'Filter by workspace ID')\n .action(async (options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const actions = await client.actions.getToday(options.workspace);\n\n if (useJson) {\n outputActionsJson(actions, { workspaceId: options.workspace });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('range')\n .description('Get actions by date range')\n .requiredOption('--start <date>', 'Start date (YYYY-MM-DD)')\n .requiredOption('--end <date>', 'End date (YYYY-MM-DD)')\n .option('--workspace <id>', 'Filter by workspace ID')\n .action(async (options: { start: string; end: string; workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const startDate = new Date(options.start);\n const endDate = new Date(options.end);\n\n if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {\n throw new Error('Invalid date format. Use YYYY-MM-DD');\n }\n\n const client = getClient();\n const actions = await client.actions.getByDateRange(startDate, endDate, options.workspace);\n\n if (useJson) {\n outputActionsJson(actions, { workspaceId: options.workspace });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('kanban')\n .description('Get kanban board actions')\n .option('--project <id>', 'Filter by project ID')\n .option('--status <status>', 'Filter by kanban status')\n .option('--assignee <id>', 'Filter by assignee ID')\n .action(async (options: { project?: string; status?: string; assignee?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const kanbanStatus = options.status as KanbanStatus | undefined;\n\n const actions = await client.actions.getKanban({\n projectId: options.project,\n status: kanbanStatus,\n assigneeId: options.assignee,\n });\n\n if (useJson) {\n outputActionsJson(actions, {\n projectId: options.project,\n kanbanStatus: options.status,\n });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('update')\n .description('Update an existing action')\n .requiredOption('--id <id>', 'Action ID to update')\n .option('-n, --name <name>', 'New action name')\n .option('-d, --description <text>', 'New description')\n .option('-p, --project <id>', 'Move to project ID')\n .option('--priority <priority>', 'Priority (Quick, Scheduled, 1st Priority, etc.)')\n .option('--status <status>', 'Status (ACTIVE, COMPLETED, CANCELLED)')\n .option('--kanban <status>', 'Kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)')\n .option('--due <date>', 'Due date (YYYY-MM-DD or \"null\" to clear)')\n .action(async (options: {\n id: string;\n name?: string;\n description?: string;\n project?: string;\n priority?: string;\n status?: string;\n kanban?: string;\n due?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n // Validate priority if provided\n if (options.priority && !VALID_PRIORITIES.includes(options.priority as Priority)) {\n throw new Error(`Invalid priority \"${options.priority}\". Valid values: ${VALID_PRIORITIES.join(', ')}`);\n }\n\n // Parse due date if provided\n let dueDate: Date | null | undefined;\n if (options.due === 'null') {\n dueDate = null;\n } else if (options.due) {\n dueDate = new Date(options.due);\n if (isNaN(dueDate.getTime())) {\n throw new Error('Invalid due date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n const action = await client.actions.update({\n id: options.id,\n name: options.name,\n description: options.description,\n projectId: options.project,\n priority: options.priority as Priority | undefined,\n status: options.status as 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | undefined,\n kanbanStatus: options.kanban as 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED' | undefined,\n dueDate,\n });\n\n if (useJson) {\n outputActionJson(action);\n } else {\n console.log('\\n✓ Action updated successfully');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('create')\n .description('Create a new action')\n .requiredOption('-n, --name <name>', 'Action name/title')\n .option('-d, --description <text>', 'Action description')\n .option('-p, --project <id>', 'Project ID to assign the action to')\n .option('--priority <priority>', 'Priority (Quick, Scheduled, 1st Priority, etc.)')\n .option('--due <date>', 'Due date (YYYY-MM-DD)')\n .option('--effort <minutes>', 'Effort estimate in minutes', parseInt)\n .option('--ticket <id>', 'Link action to a product ticket (CUID) after creation')\n .option('--epic <id>', 'Epic CUID to attach the action to')\n .action(async (options: {\n name: string;\n description?: string;\n project?: string;\n priority?: string;\n due?: string;\n effort?: number;\n ticket?: string;\n epic?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n // Validate priority if provided\n if (options.priority && !VALID_PRIORITIES.includes(options.priority as Priority)) {\n throw new Error(`Invalid priority \"${options.priority}\". Valid values: ${VALID_PRIORITIES.join(', ')}`);\n }\n\n // Parse due date if provided\n let dueDate: Date | undefined;\n if (options.due) {\n dueDate = new Date(options.due);\n if (isNaN(dueDate.getTime())) {\n throw new Error('Invalid due date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n let action = await client.actions.create({\n name: options.name,\n description: options.description,\n projectId: options.project,\n priority: options.priority as Priority | undefined,\n dueDate,\n effortEstimate: options.effort,\n epicId: options.epic,\n });\n\n // The server's action.create router doesn't accept ticketId, so when\n // --ticket is requested we link via the product.ticket.linkAction RPC\n // and re-use its updated return value.\n if (options.ticket) {\n action = await client.tickets.linkAction(options.ticket, action.id);\n }\n\n if (useJson) {\n outputActionJson(action);\n } else {\n console.log('\\n✓ Action created successfully');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n const comment = new Command('comment')\n .description('Manage comments on an action');\n\n comment\n .command('list')\n .description('List comments on an action')\n .requiredOption('--id <id>', 'Action ID')\n .action(async (options: { id: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const comments = await client.actionComments.list(options.id);\n if (useJson) outputCommentsJson(comments);\n else outputCommentsPretty(comments);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('add')\n .description('Add a comment to an action')\n .requiredOption('--id <id>', 'Action ID')\n .requiredOption('-m, --message <text>', 'Comment content (markdown supported)')\n .action(async (options: { id: string; message: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const created = await client.actionComments.add({\n actionId: options.id,\n content: options.message,\n });\n if (useJson) {\n outputCommentJson(created);\n } else {\n console.log('\\n✓ Comment added');\n outputCommentPretty(created);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('update')\n .description(\"Update one of your own comments\")\n .requiredOption('--comment-id <id>', 'Comment ID')\n .requiredOption('-m, --message <text>', 'New comment content')\n .action(async (options: { commentId: string; message: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const updated = await client.actionComments.update({\n commentId: options.commentId,\n content: options.message,\n });\n if (useJson) {\n outputCommentJson(updated);\n } else {\n console.log('\\n✓ Comment updated');\n outputCommentPretty(updated);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('delete')\n .description(\"Delete one of your own comments\")\n .requiredOption('--comment-id <id>', 'Comment ID')\n .action(async (options: { commentId: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.actionComments.delete(options.commentId);\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id: options.commentId }, null, 2));\n } else {\n console.log('\\n✓ Comment deleted');\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions.addCommand(comment);\n\n return actions;\n}\n","import chalk from 'chalk';\nimport type {\n Action,\n ActionComment,\n ActionOutput,\n ActionsListOutput,\n Contact,\n ContactInteraction,\n Deal,\n Epic,\n Feature,\n FeatureScope,\n KnowledgePage,\n Organization,\n Pipeline,\n PipelineStage,\n Product,\n Project,\n ProjectOutput,\n ProjectsListOutput,\n Requirement,\n Ticket,\n TicketComment,\n TicketDetail,\n UserStory,\n Workspace,\n WorkspaceOutput,\n WorkspacesListOutput,\n} from 'exponential-sdk';\n\n// Detect if output is being piped\nexport function shouldUseJson(forceJson?: boolean, forcePretty?: boolean): boolean {\n if (forceJson) return true;\n if (forcePretty) return false;\n return !process.stdout.isTTY;\n}\n\n// Transform Action to ActionOutput (serialize dates)\nexport function transformAction(action: Action): ActionOutput {\n return {\n id: action.id,\n name: action.name,\n description: action.description,\n status: action.status,\n priority: action.priority,\n kanbanStatus: action.kanbanStatus,\n dueDate: action.dueDate?.toISOString() ?? null,\n scheduledStart: action.scheduledStart?.toISOString() ?? null,\n scheduledEnd: action.scheduledEnd?.toISOString() ?? null,\n project: action.project ? {\n id: action.project.id,\n name: action.project.name,\n } : null,\n workspace: action.workspace ? {\n id: action.workspace.id,\n slug: action.workspace.slug,\n name: action.workspace.name,\n } : null,\n assignees: action.assignees?.map(a => ({\n id: a.user.id,\n name: a.user.name,\n email: a.user.email,\n })) ?? [],\n createdAt: action.createdAt?.toISOString() ?? new Date().toISOString(),\n completedAt: action.completedAt?.toISOString() ?? null,\n };\n}\n\n// Transform Project to ProjectOutput\nexport function transformProject(project: Project): ProjectOutput {\n return {\n id: project.id,\n name: project.name,\n description: project.description,\n status: project.status,\n priority: project.priority,\n workspace: project.workspace ? {\n id: project.workspace.id,\n slug: project.workspace.slug,\n name: project.workspace.name,\n } : null,\n };\n}\n\n// Transform Workspace to WorkspaceOutput\nexport function transformWorkspace(workspace: Workspace): WorkspaceOutput {\n return {\n id: workspace.id,\n name: workspace.name,\n slug: workspace.slug,\n type: workspace.type,\n };\n}\n\n// Output single action as JSON\nexport function outputActionJson(action: Action): void {\n const output = transformAction(action);\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output single action in pretty format\nexport function outputActionPretty(action: Action): void {\n const statusColor = getKanbanStatusColor(action.kanbanStatus);\n const statusBadge = action.kanbanStatus\n ? chalk[statusColor](`[${action.kanbanStatus}]`)\n : chalk.gray('[NO STATUS]');\n\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${statusBadge} ${chalk.bold(action.name)}`);\n console.log(chalk.gray(` ID: ${action.id}`));\n\n if (action.project) {\n console.log(` ${chalk.cyan('Project:')} ${action.project.name}`);\n }\n\n console.log(` ${chalk.magenta('Priority:')} ${action.priority}`);\n\n if (action.dueDate) {\n const dueDate = new Date(action.dueDate);\n console.log(` ${chalk.yellow('Due:')} ${formatDate(dueDate)}`);\n }\n\n if (action.description) {\n console.log(` ${chalk.gray('Description:')} ${action.description.substring(0, 100)}${action.description.length > 100 ? '...' : ''}`);\n }\n console.log();\n}\n\n// Output actions as JSON\nexport function outputActionsJson(actions: Action[], filters: ActionsListOutput['filters'] = {}): void {\n const output: ActionsListOutput = {\n actions: actions.map(transformAction),\n total: actions.length,\n filters,\n };\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output actions in pretty format\nexport function outputActionsPretty(actions: Action[]): void {\n if (actions.length === 0) {\n console.log(chalk.gray('No actions found.'));\n return;\n }\n\n console.log(chalk.bold(`\\nActions (${actions.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n\n for (const action of actions) {\n const statusColor = getKanbanStatusColor(action.kanbanStatus);\n const statusBadge = action.kanbanStatus\n ? chalk[statusColor](`[${action.kanbanStatus}]`)\n : chalk.gray('[NO STATUS]');\n\n console.log(`\\n${statusBadge} ${chalk.bold(action.name)}`);\n console.log(chalk.gray(` ID: ${action.id}`));\n\n if (action.project) {\n console.log(` ${chalk.cyan('Project:')} ${action.project.name}`);\n }\n\n console.log(` ${chalk.magenta('Priority:')} ${action.priority}`);\n\n if (action.dueDate) {\n const dueDate = new Date(action.dueDate);\n const isOverdue = dueDate < new Date();\n const dateStr = formatDate(dueDate);\n console.log(` ${chalk.yellow('Due:')} ${isOverdue ? chalk.red(dateStr) : dateStr}`);\n }\n\n if (action.description) {\n console.log(` ${chalk.gray('Description:')} ${action.description.substring(0, 100)}${action.description.length > 100 ? '...' : ''}`);\n }\n }\n console.log();\n}\n\n// Output projects as JSON\nexport function outputProjectsJson(projects: Project[]): void {\n const output: ProjectsListOutput = {\n projects: projects.map(transformProject),\n total: projects.length,\n };\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output projects in pretty format\nexport function outputProjectsPretty(projects: Project[]): void {\n if (projects.length === 0) {\n console.log(chalk.gray('No projects found.'));\n return;\n }\n\n console.log(chalk.bold(`\\nProjects (${projects.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n\n for (const project of projects) {\n console.log(`\\n${chalk.bold(project.name)}`);\n console.log(chalk.gray(` ID: ${project.id}`));\n\n if (project.status) {\n console.log(` ${chalk.cyan('Status:')} ${project.status}`);\n }\n\n if (project.priority) {\n console.log(` ${chalk.magenta('Priority:')} ${project.priority}`);\n }\n\n if (project.workspace) {\n console.log(` ${chalk.yellow('Workspace:')} ${project.workspace.name} (${project.workspace.slug})`);\n }\n\n if (project.description) {\n console.log(` ${chalk.gray('Description:')} ${project.description.substring(0, 100)}${project.description.length > 100 ? '...' : ''}`);\n }\n }\n console.log();\n}\n\n// Output workspaces as JSON\nexport function outputWorkspacesJson(workspaces: Workspace[]): void {\n const output: WorkspacesListOutput = {\n workspaces: workspaces.map(transformWorkspace),\n total: workspaces.length,\n };\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output workspaces in pretty format\nexport function outputWorkspacesPretty(workspaces: Workspace[]): void {\n if (workspaces.length === 0) {\n console.log(chalk.gray('No workspaces found.'));\n return;\n }\n\n console.log(chalk.bold(`\\nWorkspaces (${workspaces.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n\n for (const workspace of workspaces) {\n console.log(`\\n${chalk.bold(workspace.name)}`);\n console.log(chalk.gray(` ID: ${workspace.id}`));\n console.log(` ${chalk.cyan('Slug:')} ${workspace.slug}`);\n console.log(` ${chalk.magenta('Type:')} ${workspace.type}`);\n }\n console.log();\n}\n\n// Helper functions\nfunction getKanbanStatusColor(status: string | null): 'gray' | 'blue' | 'yellow' | 'cyan' | 'green' | 'red' {\n switch (status) {\n case 'BACKLOG': return 'gray';\n case 'TODO': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'IN_REVIEW': return 'cyan';\n case 'DONE': return 'green';\n case 'CANCELLED': return 'red';\n default: return 'gray';\n }\n}\n\nfunction formatDate(date: Date): string {\n return date.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\n// ─── Contact output ────────────────────────────────────────\n\nexport function outputContactJson(contact: Contact): void {\n console.log(JSON.stringify(transformContact(contact), null, 2));\n}\n\nexport function outputContactPretty(contact: Contact): void {\n const name = [contact.firstName, contact.lastName].filter(Boolean).join(' ') || chalk.gray('(no name)');\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(name)}`);\n console.log(chalk.gray(` ID: ${contact.id}`));\n if (contact.email) console.log(` ${chalk.cyan('Email:')} ${contact.email}`);\n if (contact.phone) console.log(` ${chalk.cyan('Phone:')} ${contact.phone}`);\n if (contact.telegram) console.log(` ${chalk.cyan('Telegram:')} ${contact.telegram}`);\n if (contact.linkedIn) console.log(` ${chalk.cyan('LinkedIn:')} ${contact.linkedIn}`);\n if (contact.twitter) console.log(` ${chalk.cyan('Twitter:')} ${contact.twitter}`);\n if (contact.github) console.log(` ${chalk.cyan('GitHub:')} ${contact.github}`);\n if (contact.bluesky) console.log(` ${chalk.cyan('Bluesky:')} ${contact.bluesky}`);\n if (contact.about) console.log(` ${chalk.gray('About:')} ${contact.about.substring(0, 120)}${contact.about.length > 120 ? '...' : ''}`);\n if (contact.profileType) console.log(` ${chalk.magenta('Type:')} ${contact.profileType}`);\n if (contact.skills?.length) console.log(` ${chalk.yellow('Skills:')} ${contact.skills.join(', ')}`);\n if (contact.tags?.length) console.log(` ${chalk.yellow('Tags:')} ${contact.tags.join(', ')}`);\n if (contact.organization) console.log(` ${chalk.green('Org:')} ${contact.organization.name}`);\n if (contact.connectionScore != null) console.log(` ${chalk.blue('Connection Score:')} ${contact.connectionScore}`);\n if (contact.lastInteractionAt) console.log(` ${chalk.gray('Last Interaction:')} ${formatDate(new Date(contact.lastInteractionAt))} (${contact.lastInteractionType ?? ''})`);\n console.log();\n}\n\nexport function outputContactsJson(contacts: Contact[], nextCursor?: string): void {\n console.log(JSON.stringify({\n contacts: contacts.map(transformContact),\n total: contacts.length,\n nextCursor: nextCursor ?? null,\n }, null, 2));\n}\n\nexport function outputContactsPretty(contacts: Contact[]): void {\n if (contacts.length === 0) {\n console.log(chalk.gray('No contacts found.'));\n return;\n }\n console.log(chalk.bold(`\\nContacts (${contacts.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const contact of contacts) {\n const name = [contact.firstName, contact.lastName].filter(Boolean).join(' ') || chalk.gray('(no name)');\n console.log(`\\n${chalk.bold(name)}`);\n console.log(chalk.gray(` ID: ${contact.id}`));\n if (contact.email) console.log(` ${chalk.cyan('Email:')} ${contact.email}`);\n if (contact.organization) console.log(` ${chalk.green('Org:')} ${contact.organization.name}`);\n if (contact.tags?.length) console.log(` ${chalk.yellow('Tags:')} ${contact.tags.join(', ')}`);\n }\n console.log();\n}\n\nfunction transformContact(contact: Contact): Record<string, unknown> {\n return {\n id: contact.id,\n workspaceId: contact.workspaceId,\n firstName: contact.firstName,\n lastName: contact.lastName,\n email: contact.email,\n phone: contact.phone,\n linkedIn: contact.linkedIn,\n telegram: contact.telegram,\n twitter: contact.twitter,\n github: contact.github,\n bluesky: contact.bluesky,\n about: contact.about,\n profileType: contact.profileType,\n skills: contact.skills,\n tags: contact.tags,\n organizationId: contact.organizationId,\n organization: contact.organization ?? null,\n connectionScore: contact.connectionScore,\n lastInteractionAt: contact.lastInteractionAt ? new Date(contact.lastInteractionAt).toISOString() : null,\n lastInteractionType: contact.lastInteractionType,\n createdAt: new Date(contact.createdAt).toISOString(),\n updatedAt: new Date(contact.updatedAt).toISOString(),\n };\n}\n\n// ─── Interaction output ────────────────────────────────────\n\nexport function outputInteractionJson(interaction: ContactInteraction): void {\n console.log(JSON.stringify(interaction, null, 2));\n}\n\nexport function outputInteractionPretty(interaction: ContactInteraction): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(` ${chalk.cyan('Type:')} ${interaction.type} (${interaction.direction})`);\n if (interaction.subject) console.log(` ${chalk.bold('Subject:')} ${interaction.subject}`);\n if (interaction.notes) console.log(` ${chalk.gray('Notes:')} ${interaction.notes}`);\n console.log();\n}\n\n// ─── Organization output ───────────────────────────────────\n\nfunction transformOrganization(org: Organization): Record<string, unknown> {\n return {\n id: org.id,\n workspaceId: org.workspaceId,\n name: org.name,\n websiteUrl: org.websiteUrl,\n logoUrl: org.logoUrl,\n description: org.description,\n industry: org.industry,\n size: org.size,\n contactCount: org._count?.contacts ?? null,\n createdAt: new Date(org.createdAt).toISOString(),\n updatedAt: new Date(org.updatedAt).toISOString(),\n };\n}\n\nexport function outputOrganizationJson(org: Organization): void {\n console.log(JSON.stringify(transformOrganization(org), null, 2));\n}\n\nexport function outputOrganizationPretty(org: Organization): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(org.name)}`);\n console.log(chalk.gray(` ID: ${org.id}`));\n if (org.industry) console.log(` ${chalk.magenta('Industry:')} ${org.industry}`);\n if (org.size) console.log(` ${chalk.cyan('Size:')} ${org.size}`);\n if (org.websiteUrl) console.log(` ${chalk.cyan('Website:')} ${org.websiteUrl}`);\n if (org.description) console.log(` ${chalk.gray('About:')} ${org.description.substring(0, 120)}${org.description.length > 120 ? '...' : ''}`);\n if (org._count?.contacts != null) console.log(` ${chalk.green('Contacts:')} ${org._count.contacts}`);\n console.log();\n}\n\nexport function outputOrganizationsJson(organizations: Organization[], nextCursor?: string): void {\n console.log(JSON.stringify({\n organizations: organizations.map(transformOrganization),\n total: organizations.length,\n nextCursor: nextCursor ?? null,\n }, null, 2));\n}\n\nexport function outputOrganizationsPretty(organizations: Organization[]): void {\n if (organizations.length === 0) {\n console.log(chalk.gray('No organizations found.'));\n return;\n }\n console.log(chalk.bold(`\\nOrganizations (${organizations.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const org of organizations) {\n console.log(`\\n${chalk.bold(org.name)}`);\n console.log(chalk.gray(` ID: ${org.id}`));\n if (org.industry) console.log(` ${chalk.magenta('Industry:')} ${org.industry}`);\n if (org._count?.contacts != null) console.log(` ${chalk.green('Contacts:')} ${org._count.contacts}`);\n }\n console.log();\n}\n\n// ─── Deal output ───────────────────────────────────────────\n\nexport function outputDealJson(deal: Deal): void {\n console.log(JSON.stringify(transformDeal(deal), null, 2));\n}\n\nexport function outputDealPretty(deal: Deal): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(deal.title)}`);\n console.log(chalk.gray(` ID: ${deal.id}`));\n if (deal.stage) console.log(` ${chalk.blue('Stage:')} ${deal.stage.name}`);\n if (deal.value != null) console.log(` ${chalk.green('Value:')} ${deal.currency} ${deal.value.toLocaleString()}`);\n if (deal.probability != null) console.log(` ${chalk.yellow('Probability:')} ${deal.probability}%`);\n if (deal.expectedCloseDate) console.log(` ${chalk.cyan('Expected Close:')} ${formatDate(new Date(deal.expectedCloseDate))}`);\n if (deal.contact) {\n const name = [deal.contact.firstName, deal.contact.lastName].filter(Boolean).join(' ');\n if (name) console.log(` ${chalk.magenta('Contact:')} ${name}`);\n }\n if (deal.organization) console.log(` ${chalk.magenta('Org:')} ${deal.organization.name}`);\n if (deal.assignedTo) console.log(` ${chalk.gray('Assigned:')} ${deal.assignedTo.name ?? deal.assignedTo.email ?? deal.assignedTo.id}`);\n if (deal.description) console.log(` ${chalk.gray('Description:')} ${deal.description.substring(0, 120)}${deal.description.length > 120 ? '...' : ''}`);\n console.log();\n}\n\nexport function outputDealsJson(deals: Deal[]): void {\n console.log(JSON.stringify({\n deals: deals.map(transformDeal),\n total: deals.length,\n }, null, 2));\n}\n\nexport function outputDealsPretty(deals: Deal[]): void {\n if (deals.length === 0) {\n console.log(chalk.gray('No deals found.'));\n return;\n }\n console.log(chalk.bold(`\\nDeals (${deals.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const deal of deals) {\n const stageLabel = deal.stage ? chalk.blue(`[${deal.stage.name}]`) : '';\n const valueLabel = deal.value != null ? chalk.green(` ${deal.currency} ${deal.value.toLocaleString()}`) : '';\n console.log(`\\n${stageLabel} ${chalk.bold(deal.title)}${valueLabel}`);\n console.log(chalk.gray(` ID: ${deal.id}`));\n if (deal.contact) {\n const name = [deal.contact.firstName, deal.contact.lastName].filter(Boolean).join(' ');\n if (name) console.log(` ${chalk.magenta('Contact:')} ${name}`);\n }\n if (deal.probability != null) console.log(` ${chalk.yellow('Probability:')} ${deal.probability}%`);\n if (deal.expectedCloseDate) console.log(` ${chalk.cyan('Close:')} ${formatDate(new Date(deal.expectedCloseDate))}`);\n }\n console.log();\n}\n\nfunction transformDeal(deal: Deal): Record<string, unknown> {\n return {\n id: deal.id,\n projectId: deal.projectId,\n stageId: deal.stageId,\n title: deal.title,\n description: deal.description,\n value: deal.value,\n currency: deal.currency,\n probability: deal.probability,\n expectedCloseDate: deal.expectedCloseDate ? new Date(deal.expectedCloseDate).toISOString() : null,\n closedAt: deal.closedAt ? new Date(deal.closedAt).toISOString() : null,\n contactId: deal.contactId,\n organizationId: deal.organizationId,\n workspaceId: deal.workspaceId,\n assignedToId: deal.assignedToId,\n stage: deal.stage ? { id: deal.stage.id, name: deal.stage.name, color: deal.stage.color } : null,\n contact: deal.contact ?? null,\n organization: deal.organization ?? null,\n assignedTo: deal.assignedTo ?? null,\n createdAt: new Date(deal.createdAt).toISOString(),\n updatedAt: new Date(deal.updatedAt).toISOString(),\n };\n}\n\n// ─── Pipeline output ───────────────────────────────────────\n\nexport function outputPipelineJson(pipeline: Pipeline): void {\n console.log(JSON.stringify({\n id: pipeline.id,\n name: pipeline.name,\n workspaceId: pipeline.workspaceId,\n status: pipeline.status,\n stages: pipeline.pipelineStages.map(s => ({\n id: s.id,\n name: s.name,\n color: s.color,\n order: s.order,\n type: s.type,\n dealCount: s._count?.deals ?? null,\n })),\n }, null, 2));\n}\n\nexport function outputPipelinePretty(pipeline: Pipeline): void {\n console.log(chalk.bold(`\\nPipeline: ${pipeline.name}`));\n console.log(chalk.gray(` ID: ${pipeline.id}`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const stage of pipeline.pipelineStages) {\n const count = stage._count?.deals != null ? chalk.gray(` (${stage._count.deals} deals)`) : '';\n console.log(` ${chalk.bold(stage.name)}${count} — ${chalk.gray(stage.type)}`);\n }\n console.log();\n}\n\nexport function outputStagesJson(stages: PipelineStage[]): void {\n console.log(JSON.stringify({\n stages: stages.map(s => ({\n id: s.id,\n name: s.name,\n color: s.color,\n order: s.order,\n type: s.type,\n dealCount: s._count?.deals ?? null,\n })),\n total: stages.length,\n }, null, 2));\n}\n\n// ─── Comment output ────────────────────────────────────────\n\ntype AnyComment = ActionComment | TicketComment;\n\nfunction transformComment(comment: AnyComment): Record<string, unknown> {\n const parentKey = 'actionId' in comment ? 'actionId' : 'ticketId';\n const parentId = (comment as unknown as Record<string, unknown>)[parentKey];\n return {\n id: comment.id,\n [parentKey]: parentId,\n authorId: comment.authorId,\n content: comment.content,\n author: comment.author,\n createdAt: new Date(comment.createdAt).toISOString(),\n updatedAt: new Date(comment.updatedAt).toISOString(),\n };\n}\n\nexport function outputCommentJson(comment: AnyComment): void {\n console.log(JSON.stringify(transformComment(comment), null, 2));\n}\n\nexport function outputCommentPretty(comment: AnyComment): void {\n const author = comment.author?.name ?? comment.authorId;\n const when = formatDate(new Date(comment.createdAt));\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`${chalk.bold(author)} ${chalk.gray(`— ${when}`)}`);\n console.log(chalk.gray(` ID: ${comment.id}`));\n console.log();\n console.log(comment.content);\n console.log();\n}\n\nexport function outputCommentsJson(comments: AnyComment[]): void {\n console.log(JSON.stringify({\n comments: comments.map(transformComment),\n total: comments.length,\n }, null, 2));\n}\n\nexport function outputCommentsPretty(comments: AnyComment[]): void {\n if (comments.length === 0) {\n console.log(chalk.gray('No comments.'));\n return;\n }\n console.log(chalk.bold(`\\nComments (${comments.length})`));\n for (const c of comments) {\n outputCommentPretty(c);\n }\n}\n\n// ─── Product output ────────────────────────────────────────\n\nexport function outputProductJson(product: Product): void {\n console.log(JSON.stringify(transformProduct(product), null, 2));\n}\n\nexport function outputProductPretty(product: Product): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(product.name)} ${chalk.gray(`(${product.slug})`)}`);\n console.log(chalk.gray(` ID: ${product.id}`));\n if (product.description) {\n console.log(` ${chalk.gray('Description:')} ${product.description}`);\n }\n if (product._count) {\n const c = product._count;\n const parts = [\n c.features != null ? `features: ${c.features}` : null,\n c.tickets != null ? `tickets: ${c.tickets}` : null,\n ].filter(Boolean);\n if (parts.length) console.log(` ${chalk.cyan('Counts:')} ${parts.join(' ')}`);\n }\n console.log();\n}\n\nexport function outputProductsJson(products: Product[]): void {\n console.log(JSON.stringify({\n products: products.map(transformProduct),\n total: products.length,\n }, null, 2));\n}\n\nexport function outputProductsPretty(products: Product[]): void {\n if (products.length === 0) {\n console.log(chalk.gray('No products found.'));\n return;\n }\n console.log(chalk.bold(`\\nProducts (${products.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const p of products) {\n const ticketCount = p._count?.tickets != null ? chalk.gray(` — ${p._count.tickets} tickets`) : '';\n console.log(` ${chalk.bold(p.name)} ${chalk.gray(`(${p.slug})`)}${ticketCount}`);\n console.log(chalk.gray(` ID: ${p.id}`));\n }\n console.log();\n}\n\nfunction transformProduct(product: Product): Record<string, unknown> {\n return {\n id: product.id,\n workspaceId: product.workspaceId,\n name: product.name,\n slug: product.slug,\n description: product.description,\n icon: product.icon,\n color: product.color,\n funTicketIds: product.funTicketIds,\n ticketCounter: product.ticketCounter,\n counts: product._count ?? null,\n createdAt: new Date(product.createdAt).toISOString(),\n updatedAt: new Date(product.updatedAt).toISOString(),\n };\n}\n\n// ─── Feature output ────────────────────────────────────────\n\nexport function outputFeatureJson(feature: Feature): void {\n console.log(JSON.stringify(transformFeature(feature), null, 2));\n}\n\nexport function outputFeaturePretty(feature: Feature): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk[getFeatureStatusColor(feature.status)](`[${feature.status}]`)} ${chalk.bold(feature.name)}`);\n console.log(chalk.gray(` ID: ${feature.id}`));\n if (feature.description) {\n console.log(` ${chalk.gray('Description:')} ${feature.description.substring(0, 120)}${feature.description.length > 120 ? '...' : ''}`);\n }\n if (feature.vision) {\n console.log(` ${chalk.gray('Vision:')} ${feature.vision.substring(0, 120)}${feature.vision.length > 120 ? '...' : ''}`);\n }\n if (feature.priority != null) {\n console.log(` ${chalk.magenta('Priority:')} ${feature.priority}`);\n }\n if (feature._count?.tickets != null) {\n console.log(` ${chalk.cyan('Tickets:')} ${feature._count.tickets}`);\n }\n console.log();\n}\n\nexport function outputFeaturesJson(features: Feature[]): void {\n console.log(JSON.stringify({\n features: features.map(transformFeature),\n total: features.length,\n }, null, 2));\n}\n\nexport function outputFeaturesPretty(features: Feature[]): void {\n if (features.length === 0) {\n console.log(chalk.gray('No features found.'));\n return;\n }\n console.log(chalk.bold(`\\nFeatures (${features.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const f of features) {\n const statusBadge = chalk[getFeatureStatusColor(f.status)](`[${f.status}]`);\n const ticketCount = f._count?.tickets != null ? chalk.gray(` — ${f._count.tickets} tickets`) : '';\n console.log(` ${statusBadge} ${chalk.bold(f.name)}${ticketCount}`);\n console.log(chalk.gray(` ID: ${f.id}`));\n }\n console.log();\n}\n\nfunction transformFeature(feature: Feature): Record<string, unknown> {\n return {\n id: feature.id,\n productId: feature.productId,\n name: feature.name,\n description: feature.description,\n vision: feature.vision,\n status: feature.status,\n effort: feature.effort,\n priority: feature.priority,\n goalId: feature.goalId,\n goal: feature.goal ?? null,\n counts: feature._count ?? null,\n createdAt: new Date(feature.createdAt).toISOString(),\n updatedAt: new Date(feature.updatedAt).toISOString(),\n };\n}\n\nfunction getFeatureStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'green' | 'red' {\n switch (status) {\n case 'IDEA': return 'gray';\n case 'DEFINED': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'SHIPPED': return 'green';\n case 'ARCHIVED': return 'red';\n default: return 'gray';\n }\n}\n\n// ─── User story output ─────────────────────────────────────\n\nfunction transformUserStory(story: UserStory): Record<string, unknown> {\n return {\n id: story.id,\n featureId: story.featureId,\n scopeId: story.scopeId,\n asA: story.asA,\n iWant: story.iWant,\n soThat: story.soThat,\n acceptanceCriteria: story.acceptanceCriteria,\n displayOrder: story.displayOrder,\n createdAt: new Date(story.createdAt).toISOString(),\n updatedAt: new Date(story.updatedAt).toISOString(),\n };\n}\n\nexport function outputUserStoryJson(story: UserStory): void {\n console.log(JSON.stringify(transformUserStory(story), null, 2));\n}\n\nexport function outputUserStoryPretty(story: UserStory): void {\n console.log(chalk.gray('─'.repeat(50)));\n const order = chalk.gray(`#${story.displayOrder}`);\n console.log(`\\n${order} ${chalk.bold(story.iWant ?? '(no \"I want\")')}`);\n console.log(chalk.gray(` ID: ${story.id}`));\n if (story.asA) console.log(` ${chalk.cyan('As a:')} ${story.asA}`);\n if (story.iWant) console.log(` ${chalk.cyan('I want:')} ${story.iWant}`);\n if (story.soThat) console.log(` ${chalk.cyan('So that:')} ${story.soThat}`);\n if (story.acceptanceCriteria) {\n console.log(` ${chalk.yellow('Acceptance:')} ${story.acceptanceCriteria}`);\n }\n if (story.scopeId) console.log(` ${chalk.magenta('Scope:')} ${story.scopeId}`);\n console.log();\n}\n\nexport function outputUserStoriesJson(stories: UserStory[]): void {\n console.log(JSON.stringify({\n userStories: stories.map(transformUserStory),\n total: stories.length,\n }, null, 2));\n}\n\nexport function outputUserStoriesPretty(stories: UserStory[]): void {\n if (stories.length === 0) {\n console.log(chalk.gray('No user stories found.'));\n return;\n }\n console.log(chalk.bold(`\\nUser stories (${stories.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const story of stories) {\n const order = chalk.gray(`#${story.displayOrder}`);\n const parts = [\n story.asA ? `As a ${story.asA},` : null,\n story.iWant ? `I want ${story.iWant},` : null,\n story.soThat ? `so that ${story.soThat}.` : null,\n ].filter(Boolean).join(' ');\n console.log(` ${order} ${parts || chalk.gray('(empty)')}`);\n console.log(chalk.gray(` ID: ${story.id}`));\n }\n console.log();\n}\n\n// Output a batch add summary (per-item success/failure).\nexport interface BatchStoryResult {\n index: number;\n ok: boolean;\n id?: string;\n error?: string;\n}\n\nexport function outputBatchResultsJson(results: BatchStoryResult[]): void {\n const succeeded = results.filter((r) => r.ok).length;\n console.log(JSON.stringify({\n results,\n total: results.length,\n succeeded,\n failed: results.length - succeeded,\n }, null, 2));\n}\n\nexport function outputBatchResultsPretty(results: BatchStoryResult[]): void {\n const succeeded = results.filter((r) => r.ok).length;\n console.log(chalk.bold(`\\nAdded ${succeeded}/${results.length} user stories`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const r of results) {\n if (r.ok) {\n console.log(` ${chalk.green('✓')} [${r.index}] ${chalk.gray(r.id ?? '')}`);\n } else {\n console.log(` ${chalk.red('✗')} [${r.index}] ${r.error ?? 'failed'}`);\n }\n }\n console.log();\n}\n\n// ─── Ticket output ─────────────────────────────────────────\n\nexport function outputTicketJson(ticket: Ticket | TicketDetail): void {\n console.log(JSON.stringify(transformTicket(ticket), null, 2));\n}\n\nexport function outputTicketPretty(ticket: Ticket | TicketDetail): void {\n const id = ticket.shortId ?? (ticket.number != null ? `#${ticket.number}` : '?');\n console.log(chalk.gray('─'.repeat(50)));\n console.log(\n `\\n${chalk[getTicketStatusColor(ticket.status)](`[${ticket.status}]`)} ${chalk.gray(`[${ticket.type}]`)} ${chalk.bold(`${id} ${ticket.title}`)}`,\n );\n console.log(chalk.gray(` ID: ${ticket.id}`));\n if (ticket.isBlocked) {\n console.log(` ${chalk.red('BLOCKED')} by ${ticket.openBlockerCount ?? 0} open ticket(s)`);\n } else if (ticket.openBlockerCount && ticket.openBlockerCount > 0) {\n console.log(` ${chalk.yellow('Blockers:')} ${ticket.openBlockerCount} open (not currently in flight)`);\n }\n if (ticket.feature) {\n console.log(` ${chalk.cyan('Feature:')} ${ticket.feature.name}`);\n }\n if (ticket.epic) {\n console.log(` ${chalk.cyan('Epic:')} ${ticket.epic.name}`);\n }\n if (ticket.assignee) {\n console.log(` ${chalk.magenta('Assignee:')} ${ticket.assignee.name ?? ticket.assignee.id}`);\n }\n if (ticket.priority != null) {\n console.log(` ${chalk.magenta('Priority:')} ${ticket.priority}`);\n }\n if (ticket.points != null) {\n console.log(` ${chalk.yellow('Points:')} ${ticket.points}`);\n }\n if (ticket.body) {\n console.log(` ${chalk.gray('Body:')} ${ticket.body.substring(0, 200)}${ticket.body.length > 200 ? '...' : ''}`);\n }\n\n const detail = ticket as TicketDetail;\n if (detail.dependsOn && detail.dependsOn.length > 0) {\n console.log(` ${chalk.cyan('Depends on:')}`);\n for (const dep of detail.dependsOn) {\n const depId = dep.shortId ?? (dep.number != null ? `#${dep.number}` : '?');\n console.log(` - ${chalk.gray(`[${dep.status}]`)} ${depId} ${dep.title}`);\n }\n }\n if (detail.requiredFor && detail.requiredFor.length > 0) {\n console.log(` ${chalk.cyan('Required for:')}`);\n for (const dep of detail.requiredFor) {\n const depId = dep.shortId ?? (dep.number != null ? `#${dep.number}` : '?');\n console.log(` - ${chalk.gray(`[${dep.status}]`)} ${depId} ${dep.title}`);\n }\n }\n if (detail.actions && detail.actions.length > 0) {\n console.log(` ${chalk.cyan('Actions:')} ${detail.actions.length}`);\n for (const a of detail.actions) {\n console.log(` - ${chalk.gray(`[${a.kanbanStatus ?? a.status}]`)} ${a.name} ${chalk.gray(`(${a.id})`)}`);\n }\n }\n console.log();\n}\n\nexport function outputTicketsJson(tickets: Ticket[]): void {\n console.log(JSON.stringify({\n tickets: tickets.map(transformTicket),\n total: tickets.length,\n }, null, 2));\n}\n\nexport function outputTicketsPretty(tickets: Ticket[]): void {\n if (tickets.length === 0) {\n console.log(chalk.gray('No tickets found.'));\n return;\n }\n console.log(chalk.bold(`\\nTickets (${tickets.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const t of tickets) {\n const id = t.shortId ?? (t.number != null ? `#${t.number}` : '?');\n const statusBadge = chalk[getTicketStatusColor(t.status)](`[${t.status}]`);\n const typeBadge = chalk.gray(`[${t.type}]`);\n const blocked = t.isBlocked ? chalk.red(' BLOCKED') : '';\n console.log(` ${statusBadge} ${typeBadge} ${chalk.bold(id)} ${t.title}${blocked}`);\n console.log(chalk.gray(` ID: ${t.id}`));\n }\n console.log();\n}\n\nfunction transformTicket(ticket: Ticket | TicketDetail): Record<string, unknown> {\n const detail = ticket as TicketDetail;\n return {\n id: ticket.id,\n productId: ticket.productId,\n number: ticket.number,\n shortId: ticket.shortId,\n title: ticket.title,\n body: ticket.body,\n type: ticket.type,\n status: ticket.status,\n priority: ticket.priority,\n points: ticket.points,\n branchName: ticket.branchName,\n prUrl: ticket.prUrl,\n designUrl: ticket.designUrl,\n specUrl: ticket.specUrl,\n links: ticket.links,\n epicId: ticket.epicId,\n featureId: ticket.featureId,\n cycleId: ticket.cycleId,\n scopeId: ticket.scopeId,\n assigneeId: ticket.assigneeId,\n assignee: ticket.assignee ?? null,\n feature: ticket.feature ?? null,\n epic: ticket.epic ?? null,\n openBlockerCount: ticket.openBlockerCount ?? 0,\n isBlocked: ticket.isBlocked ?? false,\n counts: ticket._count ?? null,\n dependsOn: detail.dependsOn ?? undefined,\n requiredFor: detail.requiredFor ?? undefined,\n actions: detail.actions?.map((a) => ({\n id: a.id,\n name: a.name,\n status: a.status,\n kanbanStatus: a.kanbanStatus,\n completedAt: a.completedAt ? new Date(a.completedAt).toISOString() : null,\n })),\n completedAt: ticket.completedAt ? new Date(ticket.completedAt).toISOString() : null,\n createdAt: new Date(ticket.createdAt).toISOString(),\n updatedAt: new Date(ticket.updatedAt).toISOString(),\n };\n}\n\nfunction getTicketStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'cyan' | 'green' | 'red' | 'magenta' {\n switch (status) {\n case 'BACKLOG': return 'gray';\n case 'NEEDS_REFINEMENT': return 'gray';\n case 'READY_TO_PLAN': return 'blue';\n case 'COMMITTED': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'BLOCKED': return 'red';\n case 'QA': return 'cyan';\n case 'DONE': return 'green';\n case 'DEPLOYED': return 'green';\n case 'ARCHIVED': return 'gray';\n default: return 'gray';\n }\n}\n\n// ─── Epic output ───────────────────────────────────────────\n\nexport function outputEpicJson(epic: Epic): void {\n console.log(JSON.stringify(transformEpic(epic), null, 2));\n}\n\nexport function outputEpicPretty(epic: Epic): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk[getEpicStatusColor(epic.status)](`[${epic.status}]`)} ${chalk.bold(epic.name)}`);\n console.log(chalk.gray(` ID: ${epic.id}`));\n if (epic.description) {\n console.log(` ${chalk.gray('Description:')} ${epic.description.substring(0, 200)}${epic.description.length > 200 ? '...' : ''}`);\n }\n console.log(` ${chalk.magenta('Priority:')} ${epic.priority}`);\n if (epic.startDate) {\n console.log(` ${chalk.cyan('Start:')} ${formatDate(new Date(epic.startDate))}`);\n }\n if (epic.targetDate) {\n console.log(` ${chalk.cyan('Target:')} ${formatDate(new Date(epic.targetDate))}`);\n }\n if (epic.owner) {\n console.log(` ${chalk.gray('Owner:')} ${epic.owner.name ?? epic.owner.email ?? epic.owner.id}`);\n }\n if (epic._count) {\n const c = epic._count;\n const parts = [\n c.actions != null ? `actions: ${c.actions}` : null,\n c.tickets != null ? `tickets: ${c.tickets}` : null,\n ].filter(Boolean);\n if (parts.length) console.log(` ${chalk.cyan('Counts:')} ${parts.join(' ')}`);\n }\n console.log();\n}\n\nexport function outputEpicsJson(epics: Epic[]): void {\n console.log(JSON.stringify({\n epics: epics.map(transformEpic),\n total: epics.length,\n }, null, 2));\n}\n\nexport function outputEpicsPretty(epics: Epic[]): void {\n if (epics.length === 0) {\n console.log(chalk.gray('No epics found.'));\n return;\n }\n console.log(chalk.bold(`\\nEpics (${epics.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const e of epics) {\n const statusBadge = chalk[getEpicStatusColor(e.status)](`[${e.status}]`);\n const counts = e._count\n ? chalk.gray(\n ` — ${e._count.tickets ?? 0} tickets, ${e._count.actions ?? 0} actions`,\n )\n : '';\n console.log(` ${statusBadge} ${chalk.bold(e.name)}${counts}`);\n console.log(chalk.gray(` ID: ${e.id}`));\n }\n console.log();\n}\n\nfunction transformEpic(epic: Epic): Record<string, unknown> {\n return {\n id: epic.id,\n workspaceId: epic.workspaceId,\n name: epic.name,\n description: epic.description,\n status: epic.status,\n priority: epic.priority,\n startDate: epic.startDate ? new Date(epic.startDate).toISOString() : null,\n targetDate: epic.targetDate ? new Date(epic.targetDate).toISOString() : null,\n ownerId: epic.ownerId,\n owner: epic.owner ?? null,\n counts: epic._count ?? null,\n createdAt: new Date(epic.createdAt).toISOString(),\n updatedAt: new Date(epic.updatedAt).toISOString(),\n };\n}\n\nfunction getEpicStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'green' | 'red' {\n switch (status) {\n case 'OPEN': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'DONE': return 'green';\n case 'CANCELLED': return 'red';\n default: return 'gray';\n }\n}\n\nexport function outputStagesPretty(stages: PipelineStage[]): void {\n if (stages.length === 0) {\n console.log(chalk.gray('No stages found.'));\n return;\n }\n console.log(chalk.bold(`\\nPipeline Stages (${stages.length})`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const stage of stages) {\n const count = stage._count?.deals != null ? chalk.gray(` (${stage._count.deals} deals)`) : '';\n console.log(` ${chalk.bold(stage.name)}${count} — ${chalk.gray(stage.type)}`);\n }\n console.log();\n}\n\n// ---------------------------------------------------------------------------\n// Knowledge pages\n// ---------------------------------------------------------------------------\n\nexport function outputPageJson(page: KnowledgePage): void {\n console.log(JSON.stringify(page, null, 2));\n}\n\nexport function outputPagePretty(page: KnowledgePage): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(page.title)}`);\n console.log(chalk.gray(` ID: ${page.id}`));\n if (page.project) {\n console.log(` ${chalk.gray('Project:')} ${page.project.name}`);\n }\n if (page.body) {\n console.log(`\\n${page.body}\\n`);\n }\n}\n\nexport function outputPagesJson(pages: KnowledgePage[]): void {\n console.log(JSON.stringify({ pages, total: pages.length }, null, 2));\n}\n\nexport function outputPagesPretty(pages: KnowledgePage[]): void {\n if (pages.length === 0) {\n console.log(chalk.gray('No pages found.'));\n return;\n }\n console.log(chalk.bold(`\\nPages (${pages.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const p of pages) {\n console.log(` ${chalk.bold(p.title)}`);\n console.log(chalk.gray(` ID: ${p.id}`));\n }\n console.log();\n}\n\n// ---------------------------------------------------------------------------\n// Requirements (EARS)\n// ---------------------------------------------------------------------------\n\nexport function outputRequirementJson(requirement: Requirement): void {\n console.log(JSON.stringify(requirement, null, 2));\n}\n\nexport function outputRequirementPretty(requirement: Requirement): void {\n const met = requirement.checkedAt\n ? chalk.green('[met]')\n : chalk.gray('[unmet]');\n const kind = requirement.kind ? chalk.gray(` (${requirement.kind})`) : '';\n console.log(` ${met} ${requirement.statement}${kind}`);\n console.log(chalk.gray(` ID: ${requirement.id}`));\n}\n\nexport function outputRequirementsJson(requirements: Requirement[]): void {\n console.log(JSON.stringify({ requirements, total: requirements.length }, null, 2));\n}\n\nexport function outputRequirementsPretty(requirements: Requirement[]): void {\n if (requirements.length === 0) {\n console.log(chalk.gray('No requirements found.'));\n return;\n }\n const metCount = requirements.filter((r) => r.checkedAt).length;\n console.log(chalk.bold(`\\nRequirements (${metCount}/${requirements.length} met)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const r of requirements) {\n outputRequirementPretty(r);\n }\n console.log();\n}\n\nexport interface BatchRequirementResult {\n index: number;\n success: boolean;\n requirement?: Requirement;\n error?: string;\n}\n\nexport function outputRequirementBatchJson(results: BatchRequirementResult[]): void {\n console.log(JSON.stringify({\n results,\n total: results.length,\n succeeded: results.filter((r) => r.success).length,\n failed: results.filter((r) => !r.success).length,\n }, null, 2));\n}\n\nexport function outputRequirementBatchPretty(results: BatchRequirementResult[]): void {\n for (const r of results) {\n if (r.success) {\n console.log(` ${chalk.green('✓')} #${r.index}: ${r.requirement?.statement ?? ''}`);\n } else {\n console.log(` ${chalk.red('✗')} #${r.index}: ${r.error ?? 'failed'}`);\n }\n }\n const ok = results.filter((r) => r.success).length;\n console.log(chalk.bold(`\\n${ok}/${results.length} requirements added`));\n}\n\n// ---------------------------------------------------------------------------\n// Feature scopes\n// ---------------------------------------------------------------------------\n\nfunction getScopeStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'green' | 'red' {\n switch (status) {\n case 'PLANNED': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'SHIPPED': return 'green';\n case 'DEPRECATED': return 'red';\n default: return 'gray';\n }\n}\n\nexport function outputScopeJson(scope: FeatureScope): void {\n console.log(JSON.stringify(scope, null, 2));\n}\n\nexport function outputScopePretty(scope: FeatureScope): void {\n const badge = chalk[getScopeStatusColor(scope.status)](`[${scope.status}]`);\n console.log(` ${badge} ${chalk.bold(scope.version)}`);\n console.log(chalk.gray(` ID: ${scope.id}`));\n if (scope.description) {\n console.log(` ${scope.description.substring(0, 120)}${scope.description.length > 120 ? '...' : ''}`);\n }\n}\n\nexport function outputScopesJson(scopes: FeatureScope[]): void {\n console.log(JSON.stringify({ scopes, total: scopes.length }, null, 2));\n}\n\nexport function outputScopesPretty(scopes: FeatureScope[]): void {\n if (scopes.length === 0) {\n console.log(chalk.gray('No scopes found.'));\n return;\n }\n console.log(chalk.bold(`\\nScopes (${scopes.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const s of scopes) {\n outputScopePretty(s);\n }\n console.log();\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputContactJson,\n outputContactPretty,\n outputContactsJson,\n outputContactsPretty,\n outputInteractionJson,\n outputInteractionPretty,\n} from '../utils/output.js';\nimport type { InteractionType, InteractionDirection } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nconst VALID_INTERACTION_TYPES: InteractionType[] = [\n 'EMAIL', 'TELEGRAM', 'PHONE_CALL', 'MEETING', 'NOTE', 'LINKEDIN', 'OTHER',\n];\n\nconst VALID_INTERACTION_DIRECTIONS: InteractionDirection[] = ['INBOUND', 'OUTBOUND'];\n\nexport function createContactsCommand(): Command {\n const contacts = new Command('contacts')\n .description('Manage CRM contacts');\n\n contacts\n .command('list')\n .description('List contacts')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .option('--search <query>', 'Search by name or email')\n .option('--tags <tags>', 'Filter by tags (comma-separated)')\n .option('--organization <id>', 'Filter by organization ID')\n .option('--limit <n>', 'Max results to return', parseInt)\n .option('--cursor <cursor>', 'Pagination cursor')\n .action(async (options: {\n workspace: string;\n search?: string;\n tags?: string;\n organization?: string;\n limit?: number;\n cursor?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const result = await client.contacts.list({\n workspaceId: options.workspace,\n search: options.search,\n tags: options.tags?.split(',').map(t => t.trim()),\n organizationId: options.organization,\n limit: options.limit,\n cursor: options.cursor,\n });\n\n if (useJson) {\n outputContactsJson(result.contacts, result.nextCursor);\n } else {\n outputContactsPretty(result.contacts);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('get')\n .description('Get a contact by ID')\n .argument('<id>', 'Contact ID')\n .option('--interactions', 'Include interaction history')\n .action(async (id: string, options: { interactions?: boolean }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const contact = await client.contacts.get(id, {\n includeInteractions: options.interactions,\n });\n\n if (useJson) {\n outputContactJson(contact);\n } else {\n outputContactPretty(contact);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('create')\n .description('Create a new contact')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .option('--first-name <name>', 'First name')\n .option('--last-name <name>', 'Last name')\n .option('--email <email>', 'Email address')\n .option('--phone <phone>', 'Phone number')\n .option('--linkedin <url>', 'LinkedIn URL')\n .option('--telegram <handle>', 'Telegram handle')\n .option('--twitter <handle>', 'Twitter/X handle')\n .option('--github <handle>', 'GitHub username')\n .option('--bluesky <handle>', 'Bluesky handle')\n .option('--about <text>', 'About / bio')\n .option('--profile-type <type>', 'Profile type')\n .option('--skills <skills>', 'Skills (comma-separated)')\n .option('--tags <tags>', 'Tags (comma-separated)')\n .option('--organization <id>', 'Organization ID')\n .option('--organization-name <name>', 'Organization name (find-or-create; ignored if --organization is set)')\n .action(async (options: {\n workspace: string;\n firstName?: string;\n lastName?: string;\n email?: string;\n phone?: string;\n linkedin?: string;\n telegram?: string;\n twitter?: string;\n github?: string;\n bluesky?: string;\n about?: string;\n profileType?: string;\n skills?: string;\n tags?: string;\n organization?: string;\n organizationName?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const contact = await client.contacts.create({\n workspaceId: options.workspace,\n firstName: options.firstName,\n lastName: options.lastName,\n email: options.email,\n phone: options.phone,\n linkedIn: options.linkedin,\n telegram: options.telegram,\n twitter: options.twitter,\n github: options.github,\n bluesky: options.bluesky,\n about: options.about,\n profileType: options.profileType,\n skills: options.skills?.split(',').map(s => s.trim()),\n tags: options.tags?.split(',').map(t => t.trim()),\n organizationId: options.organization,\n organizationName: options.organizationName,\n });\n\n if (useJson) {\n outputContactJson(contact);\n } else {\n console.log('\\n✓ Contact created successfully');\n outputContactPretty(contact);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('update')\n .description('Update an existing contact')\n .requiredOption('--id <id>', 'Contact ID')\n .option('--first-name <name>', 'First name')\n .option('--last-name <name>', 'Last name')\n .option('--email <email>', 'Email (use \"null\" to clear)')\n .option('--phone <phone>', 'Phone (use \"null\" to clear)')\n .option('--linkedin <url>', 'LinkedIn URL (use \"null\" to clear)')\n .option('--telegram <handle>', 'Telegram handle (use \"null\" to clear)')\n .option('--twitter <handle>', 'Twitter/X handle (use \"null\" to clear)')\n .option('--github <handle>', 'GitHub username (use \"null\" to clear)')\n .option('--bluesky <handle>', 'Bluesky handle (use \"null\" to clear)')\n .option('--about <text>', 'About / bio')\n .option('--profile-type <type>', 'Profile type')\n .option('--skills <skills>', 'Skills (comma-separated)')\n .option('--tags <tags>', 'Tags (comma-separated)')\n .option('--organization <id>', 'Organization ID (use \"null\" to clear)')\n .option('--organization-name <name>', 'Organization name (find-or-create; ignored if --organization is set)')\n .action(async (options: {\n id: string;\n firstName?: string;\n lastName?: string;\n email?: string;\n phone?: string;\n linkedin?: string;\n telegram?: string;\n twitter?: string;\n github?: string;\n bluesky?: string;\n about?: string;\n profileType?: string;\n skills?: string;\n tags?: string;\n organization?: string;\n organizationName?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n const nullable = (v?: string) => v === 'null' ? null : v;\n\n try {\n const client = getClient();\n const contact = await client.contacts.update({\n id: options.id,\n firstName: options.firstName,\n lastName: options.lastName,\n email: nullable(options.email),\n phone: nullable(options.phone),\n linkedIn: nullable(options.linkedin),\n telegram: nullable(options.telegram),\n twitter: nullable(options.twitter),\n github: nullable(options.github),\n bluesky: nullable(options.bluesky),\n about: options.about,\n profileType: options.profileType,\n skills: options.skills?.split(',').map(s => s.trim()),\n tags: options.tags?.split(',').map(t => t.trim()),\n organizationId: nullable(options.organization),\n organizationName: options.organizationName,\n });\n\n if (useJson) {\n outputContactJson(contact);\n } else {\n console.log('\\n✓ Contact updated successfully');\n outputContactPretty(contact);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('delete')\n .description('Delete a contact')\n .argument('<id>', 'Contact ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n await client.contacts.delete(id);\n\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id }, null, 2));\n } else {\n console.log(`\\n✓ Contact ${id} deleted`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('add-interaction')\n .description('Add an interaction to a contact')\n .requiredOption('--contact <id>', 'Contact ID')\n .requiredOption('--type <type>', `Interaction type (${VALID_INTERACTION_TYPES.join(', ')})`)\n .requiredOption('--direction <dir>', `Direction (${VALID_INTERACTION_DIRECTIONS.join(', ')})`)\n .option('--subject <text>', 'Subject line')\n .option('--notes <text>', 'Notes')\n .action(async (options: {\n contact: string;\n type: string;\n direction: string;\n subject?: string;\n notes?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n if (!VALID_INTERACTION_TYPES.includes(options.type as InteractionType)) {\n throw new Error(`Invalid interaction type \"${options.type}\". Valid: ${VALID_INTERACTION_TYPES.join(', ')}`);\n }\n if (!VALID_INTERACTION_DIRECTIONS.includes(options.direction as InteractionDirection)) {\n throw new Error(`Invalid direction \"${options.direction}\". Valid: ${VALID_INTERACTION_DIRECTIONS.join(', ')}`);\n }\n\n const client = getClient();\n const interaction = await client.contacts.addInteraction({\n contactId: options.contact,\n type: options.type as InteractionType,\n direction: options.direction as InteractionDirection,\n subject: options.subject,\n notes: options.notes,\n });\n\n if (useJson) {\n outputInteractionJson(interaction);\n } else {\n console.log('\\n✓ Interaction added');\n outputInteractionPretty(interaction);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('enrich')\n .description('Queue a web-search enrichment job for an existing contact (runs regardless of the workspace auto-enrich setting)')\n .argument('<id>', 'Contact ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const result = await client.contacts.enrich(id);\n\n if (useJson) {\n console.log(JSON.stringify(result, null, 2));\n } else if (result.enqueued) {\n console.log(`\\n✓ Enrichment queued for contact ${id} (job ${result.enrichmentId})`);\n } else if (result.reason === 'already-in-flight') {\n console.log(`\\n• Enrichment already in progress for contact ${id} (job ${result.enrichmentId})`);\n } else {\n console.log(`\\n• Not queued for contact ${id}${result.reason ? ` (${result.reason})` : ''}`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return contacts;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputDealJson,\n outputDealPretty,\n outputDealsJson,\n outputDealsPretty,\n outputPipelineJson,\n outputPipelinePretty,\n outputStagesJson,\n outputStagesPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nexport function createDealsCommand(): Command {\n const deals = new Command('deals')\n .description('Manage pipeline deals');\n\n deals\n .command('pipeline')\n .description('Get pipeline overview with stages')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .action(async (options: { workspace: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const pipeline = await client.pipelines.get(options.workspace);\n\n if (!pipeline) {\n if (useJson) {\n console.log(JSON.stringify({ pipeline: null }, null, 2));\n } else {\n console.log('No pipeline found for this workspace. One will be created when you add your first deal.');\n }\n return;\n }\n\n if (useJson) {\n outputPipelineJson(pipeline);\n } else {\n outputPipelinePretty(pipeline);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('stages')\n .description('List pipeline stages')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .action(async (options: { workspace: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const stages = await client.pipelines.getStages(options.workspace);\n\n if (useJson) {\n outputStagesJson(stages);\n } else {\n outputStagesPretty(stages);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('list')\n .description('List all deals')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .action(async (options: { workspace: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const dealsList = await client.pipelines.listDeals(options.workspace);\n\n if (useJson) {\n outputDealsJson(dealsList);\n } else {\n outputDealsPretty(dealsList);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('get')\n .description('Get a deal by ID')\n .argument('<id>', 'Deal ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const deal = await client.pipelines.getDeal(id);\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('create')\n .description('Create a new deal')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .requiredOption('--stage <id>', 'Pipeline stage ID')\n .requiredOption('--title <title>', 'Deal title')\n .option('--description <text>', 'Deal description')\n .option('--value <amount>', 'Deal value', parseFloat)\n .option('--currency <code>', 'Currency code (default: USD)')\n .option('--probability <pct>', 'Win probability (0-100)', parseInt)\n .option('--close-date <date>', 'Expected close date (YYYY-MM-DD)')\n .option('--contact <id>', 'Contact ID')\n .option('--organization <id>', 'Organization ID')\n .option('--assigned-to <id>', 'Assigned user ID')\n .action(async (options: {\n workspace: string;\n stage: string;\n title: string;\n description?: string;\n value?: number;\n currency?: string;\n probability?: number;\n closeDate?: string;\n contact?: string;\n organization?: string;\n assignedTo?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n let expectedCloseDate: Date | undefined;\n if (options.closeDate) {\n expectedCloseDate = new Date(options.closeDate);\n if (isNaN(expectedCloseDate.getTime())) {\n throw new Error('Invalid close date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n const deal = await client.pipelines.createDeal({\n workspaceId: options.workspace,\n stageId: options.stage,\n title: options.title,\n description: options.description,\n value: options.value,\n currency: options.currency,\n probability: options.probability,\n expectedCloseDate,\n contactId: options.contact,\n organizationId: options.organization,\n assignedToId: options.assignedTo,\n });\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n console.log('\\n✓ Deal created successfully');\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('update')\n .description('Update an existing deal')\n .requiredOption('--id <id>', 'Deal ID')\n .option('--title <title>', 'Deal title')\n .option('--description <text>', 'Description (use \"null\" to clear)')\n .option('--value <amount>', 'Deal value (use \"null\" to clear)')\n .option('--currency <code>', 'Currency code')\n .option('--probability <pct>', 'Win probability (use \"null\" to clear)')\n .option('--close-date <date>', 'Expected close date (YYYY-MM-DD or \"null\" to clear)')\n .option('--contact <id>', 'Contact ID (use \"null\" to clear)')\n .option('--organization <id>', 'Organization ID (use \"null\" to clear)')\n .option('--assigned-to <id>', 'Assigned user ID (use \"null\" to clear)')\n .action(async (options: {\n id: string;\n title?: string;\n description?: string;\n value?: string;\n currency?: string;\n probability?: string;\n closeDate?: string;\n contact?: string;\n organization?: string;\n assignedTo?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n const nullable = <T>(v: string | undefined, parse?: (s: string) => T): T | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n return parse ? parse(v) : v as unknown as T;\n };\n\n try {\n let expectedCloseDate: Date | null | undefined;\n if (options.closeDate === 'null') {\n expectedCloseDate = null;\n } else if (options.closeDate) {\n expectedCloseDate = new Date(options.closeDate);\n if (isNaN(expectedCloseDate.getTime())) {\n throw new Error('Invalid close date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n const deal = await client.pipelines.updateDeal({\n id: options.id,\n title: options.title,\n description: nullable(options.description),\n value: nullable(options.value, parseFloat),\n currency: options.currency,\n probability: nullable(options.probability, parseInt),\n expectedCloseDate,\n contactId: nullable(options.contact),\n organizationId: nullable(options.organization),\n assignedToId: nullable(options.assignedTo),\n });\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n console.log('\\n✓ Deal updated successfully');\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('move')\n .description('Move a deal to a different stage')\n .requiredOption('--id <id>', 'Deal ID')\n .requiredOption('--stage <id>', 'Target stage ID')\n .option('--order <n>', 'Position within stage', parseInt, 0)\n .action(async (options: { id: string; stage: string; order: number }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const deal = await client.pipelines.moveDeal({\n id: options.id,\n stageId: options.stage,\n stageOrder: options.order,\n });\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n console.log('\\n✓ Deal moved successfully');\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('delete')\n .description('Delete a deal')\n .argument('<id>', 'Deal ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n await client.pipelines.deleteDeal(id);\n\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id }, null, 2));\n } else {\n console.log(`\\n✓ Deal ${id} deleted`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return deals;\n}\n","import { Command } from 'commander';\nimport type { EpicPriority, EpicStatus } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport {\n shouldUseJson,\n outputEpicJson,\n outputEpicPretty,\n outputEpicsJson,\n outputEpicsPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst EPIC_STATUSES: EpicStatus[] = ['OPEN', 'IN_PROGRESS', 'DONE', 'CANCELLED'];\nconst EPIC_PRIORITIES: EpicPriority[] = ['HIGH', 'MEDIUM', 'LOW', 'NONE'];\n\nfunction validateEpicStatus(value: string | undefined): EpicStatus | undefined {\n if (!value) return undefined;\n if (!(EPIC_STATUSES as string[]).includes(value)) {\n throw new Error(`Invalid epic status \"${value}\". Valid: ${EPIC_STATUSES.join(', ')}`);\n }\n return value as EpicStatus;\n}\n\nfunction validateEpicPriority(value: string | undefined): EpicPriority | undefined {\n if (!value) return undefined;\n if (!(EPIC_PRIORITIES as string[]).includes(value)) {\n throw new Error(\n `Invalid epic priority \"${value}\". Valid: ${EPIC_PRIORITIES.join(', ')}`,\n );\n }\n return value as EpicPriority;\n}\n\nfunction parseDate(value: string | undefined): Date | undefined {\n if (!value) return undefined;\n const d = new Date(value);\n if (isNaN(d.getTime())) {\n throw new Error(`Invalid date \"${value}\". Use YYYY-MM-DD`);\n }\n return d;\n}\n\nexport function createEpicsCommand(): Command {\n const epics = new Command('epics').description(\n 'Manage epics. Epics are workspace-scoped and group actions and tickets across products.',\n );\n\n epics\n .command('list')\n .description('List epics in a workspace')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .option('--status <status>', `Filter by status: ${EPIC_STATUSES.join(', ')}`)\n .action(\n async (options: { workspace?: string; status?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateEpicStatus(options.status);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const list = await client.epics.list({ workspaceId, status });\n if (useJson) outputEpicsJson(list);\n else outputEpicsPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n epics\n .command('get <id>')\n .description('Get an epic by CUID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const epic = await client.epics.get(id);\n if (useJson) outputEpicJson(epic);\n else outputEpicPretty(epic);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n epics\n .command('create')\n .description('Create a new epic in a workspace')\n .requiredOption('-n, --name <name>', 'Epic name')\n .option('-d, --description <text>', 'Description')\n .option('--priority <priority>', `Priority: ${EPIC_PRIORITIES.join(', ')}`)\n .option('--start <date>', 'Start date (YYYY-MM-DD)')\n .option('--target <date>', 'Target date (YYYY-MM-DD)')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (\n options: {\n name: string;\n description?: string;\n priority?: string;\n start?: string;\n target?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const priority = validateEpicPriority(options.priority);\n const startDate = parseDate(options.start);\n const targetDate = parseDate(options.target);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const epic = await client.epics.create({\n workspaceId,\n name: options.name,\n description: options.description,\n priority,\n startDate,\n targetDate,\n });\n if (useJson) outputEpicJson(epic);\n else {\n console.log('\\n✓ Epic created');\n outputEpicPretty(epic);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n epics\n .command('update')\n .description('Update an existing epic')\n .requiredOption('--id <id>', 'Epic CUID')\n .option('-n, --name <name>', 'New name')\n .option('-d, --description <text>', 'New description (or \"null\" to clear)')\n .option('--status <status>', `Status: ${EPIC_STATUSES.join(', ')}`)\n .option('--priority <priority>', `Priority: ${EPIC_PRIORITIES.join(', ')}`)\n .option('--start <date>', 'Start date (YYYY-MM-DD or \"null\")')\n .option('--target <date>', 'Target date (YYYY-MM-DD or \"null\")')\n .action(\n async (\n options: {\n id: string;\n name?: string;\n description?: string;\n status?: string;\n priority?: string;\n start?: string;\n target?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const parseNullableDate = (v: string | undefined): Date | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n const d = new Date(v);\n if (isNaN(d.getTime())) {\n throw new Error(`Invalid date \"${v}\". Use YYYY-MM-DD`);\n }\n return d;\n };\n const description = options.description === 'null' ? null : options.description;\n const status = validateEpicStatus(options.status);\n const priority = validateEpicPriority(options.priority);\n const client = getClient();\n const epic = await client.epics.update({\n id: options.id,\n name: options.name,\n description,\n status,\n priority,\n startDate: parseNullableDate(options.start),\n targetDate: parseNullableDate(options.target),\n });\n if (useJson) outputEpicJson(epic);\n else {\n console.log('\\n✓ Epic updated');\n outputEpicPretty(epic);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return epics;\n}\n","import type { ExponentialClient } from 'exponential-sdk';\nimport { getConfig } from '../config/index.js';\n\n/**\n * Resolve a workspace identifier the user typed at the CLI to a workspace ID.\n *\n * Accepts:\n * - a bare workspace CUID (returned as-is after a list lookup for safety)\n * - a workspace slug\n * - undefined → falls back to the configured default workspace\n *\n * Throws if nothing resolves so callers don't accidentally send a \"\" id.\n */\nexport async function resolveWorkspaceId(\n client: ExponentialClient,\n slugOrId: string | undefined,\n): Promise<string> {\n const config = getConfig();\n const candidate = slugOrId ?? config.defaultWorkspaceSlug ?? config.defaultWorkspaceId;\n\n if (!candidate) {\n throw new Error(\n 'No workspace specified and no default workspace set. Pass --workspace <slug> or run `exponential workspaces set-default <slug>`.',\n );\n }\n\n const workspaces = await client.workspaces.list();\n const byId = workspaces.find((w) => w.id === candidate);\n if (byId) return byId.id;\n const bySlug = workspaces.find((w) => w.slug === candidate);\n if (bySlug) return bySlug.id;\n\n const known = workspaces.map((w) => w.slug).join(', ');\n throw new Error(\n `Workspace \"${candidate}\" not found. Available: ${known || '(none)'}`,\n );\n}\n\n/**\n * Resolve a product identifier (slug or CUID) to a product ID.\n * `slugOrId` may also be a CUID — we try id lookup first when it looks\n * like one, then fall back to slug.\n */\nexport async function resolveProductId(\n client: ExponentialClient,\n workspaceId: string,\n slugOrId: string,\n): Promise<string> {\n const product = await client.products.resolve(workspaceId, slugOrId);\n return product.id;\n}\n\n","import { Command } from 'commander';\nimport type { FeatureStatus } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveProductId, resolveWorkspaceId } from '../utils/resolve.js';\nimport { createStoriesCommand } from './stories.js';\nimport { createScopesCommand } from './scopes.js';\nimport { createRequirementsCommand } from './requirements.js';\nimport { createAreasCommand } from './areas.js';\nimport {\n shouldUseJson,\n outputFeaturesJson,\n outputFeaturesPretty,\n outputFeatureJson,\n outputFeaturePretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst FEATURE_STATUSES: FeatureStatus[] = [\n 'IDEA',\n 'DEFINED',\n 'IN_PROGRESS',\n 'SHIPPED',\n 'DEPRECATED',\n 'ARCHIVED',\n];\n\nfunction validateFeatureStatus(value: string | undefined): FeatureStatus | undefined {\n if (!value) return undefined;\n if (!(FEATURE_STATUSES as string[]).includes(value)) {\n throw new Error(\n `Invalid status \"${value}\". Valid: ${FEATURE_STATUSES.join(', ')}`,\n );\n }\n return value as FeatureStatus;\n}\n\nexport function createFeaturesCommand(): Command {\n const features = new Command('features').description(\n 'Manage features. A feature lives under a product and groups user stories, scopes, and tickets.',\n );\n\n features\n .command('list')\n .description('List features in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .option('--status <status>', `Filter by status: ${FEATURE_STATUSES.join(', ')}`)\n .action(\n async (\n options: { product: string; workspace?: string; status?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateFeatureStatus(options.status);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n const list = await client.features.list({ productId, status });\n if (useJson) outputFeaturesJson(list);\n else outputFeaturesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('get <id>')\n .description('Get a feature by CUID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const feature = await client.features.get(id);\n if (useJson) outputFeatureJson(feature);\n else outputFeaturePretty(feature);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n features\n .command('create')\n .description('Create a new feature in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .requiredOption('-n, --name <name>', 'Feature name')\n .option('-d, --description <text>', 'Description (markdown supported)')\n .option('--vision <text>', 'Vision / target outcome')\n .option('--status <status>', `Status: ${FEATURE_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4 (lower = higher)', parseInt)\n .option('--effort <n>', 'Effort estimate', parseFloat)\n .option('--area <id>', 'Area CUID (per-product bucket) to file the feature under')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .action(\n async (\n options: {\n product: string;\n name: string;\n description?: string;\n vision?: string;\n status?: string;\n priority?: number;\n effort?: number;\n area?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateFeatureStatus(options.status);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n const feature = await client.features.create({\n productId,\n name: options.name,\n description: options.description,\n vision: options.vision,\n status,\n priority: options.priority,\n effort: options.effort,\n areaId: options.area,\n });\n if (useJson) outputFeatureJson(feature);\n else {\n console.log('\\n✓ Feature created');\n outputFeaturePretty(feature);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('update')\n .description('Update an existing feature')\n .requiredOption('--id <id>', 'Feature CUID')\n .option('-n, --name <name>', 'New name')\n .option('-d, --description <text>', 'New description')\n .option('--vision <text>', 'New vision text')\n .option('--status <status>', `Status: ${FEATURE_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4', parseInt)\n .option('--effort <n>', 'Effort estimate', parseFloat)\n .option('--area <id>', 'Area CUID (\"none\" to clear)')\n .action(\n async (\n options: {\n id: string;\n name?: string;\n description?: string;\n vision?: string;\n status?: string;\n priority?: number;\n effort?: number;\n area?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateFeatureStatus(options.status);\n const client = getClient();\n const feature = await client.features.update({\n id: options.id,\n name: options.name,\n description: options.description,\n vision: options.vision,\n status,\n priority: options.priority,\n effort: options.effort,\n areaId: options.area === 'none' ? null : options.area,\n });\n if (useJson) outputFeatureJson(feature);\n else {\n console.log('\\n✓ Feature updated');\n outputFeaturePretty(feature);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('link-page')\n .description('Link a Knowledge page (PRD, spec, research) to a feature')\n .requiredOption('--feature <id>', 'Feature CUID')\n .requiredOption('--page <id>', 'Page CUID')\n .option('--scope <id>', 'Feature scope CUID to pin the page to')\n .action(\n async (\n options: { feature: string; page: string; scope?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const link = await client.features.linkPage({\n featureId: options.feature,\n pageId: options.page,\n scopeId: options.scope,\n });\n if (useJson) console.log(JSON.stringify(link, null, 2));\n else console.log('\\n✓ Page linked');\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('unlink-page')\n .description('Unlink a Knowledge page from a feature')\n .requiredOption('--feature <id>', 'Feature CUID')\n .requiredOption('--page <id>', 'Page CUID')\n .action(\n async (options: { feature: string; page: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const result = await client.features.unlinkPage(\n options.feature,\n options.page,\n );\n if (useJson) console.log(JSON.stringify(result, null, 2));\n else console.log('\\n✓ Page unlinked');\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features.addCommand(createStoriesCommand());\n features.addCommand(createScopesCommand());\n features.addCommand(createRequirementsCommand());\n features.addCommand(createAreasCommand());\n\n return features;\n}\n","import { Command } from 'commander';\nimport type { UserStoryCreateInput } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputUserStoryJson,\n outputUserStoryPretty,\n outputUserStoriesJson,\n outputUserStoriesPretty,\n outputBatchResultsJson,\n outputBatchResultsPretty,\n type BatchStoryResult,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\n// Shape of a single story object in the stdin batch array.\ninterface BatchStoryInput {\n asA?: string;\n iWant?: string;\n soThat?: string;\n acceptanceCriteria?: string;\n scopeId?: string;\n}\n\nasync function readStdin(): Promise<string> {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk as Buffer);\n }\n return Buffer.concat(chunks).toString('utf-8');\n}\n\nexport function createStoriesCommand(): Command {\n const stories = new Command('stories').description(\n 'Manage a feature\\'s native, structured user stories (As a / I want / So that).',\n );\n\n stories\n .command('add')\n .description(\n [\n 'Add user stories to a feature.',\n '',\n 'Flag mode: pass --as-a/--i-want/--so-that (plus optional --acceptance/--scope) to add one story.',\n 'Batch mode: pipe a JSON array of { asA?, iWant?, soThat?, acceptanceCriteria?, scopeId? } on stdin',\n ' to add many at once (per-item success/failure is reported).',\n ].join('\\n'),\n )\n .requiredOption('--feature <id>', 'Feature CUID')\n .option('--as-a <text>', '\"As a ...\" actor')\n .option('--i-want <text>', '\"I want ...\" capability')\n .option('--so-that <text>', '\"So that ...\" outcome')\n .option('--acceptance <text>', 'Acceptance criteria')\n .option('--scope <id>', 'Feature scope CUID to group the story under')\n .action(\n async (\n options: {\n feature: string;\n asA?: string;\n iWant?: string;\n soThat?: string;\n acceptance?: string;\n scope?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n const hasFlags =\n options.asA != null ||\n options.iWant != null ||\n options.soThat != null ||\n options.acceptance != null;\n // Batch mode when stdin is piped and no story flags were given.\n const isBatch = !hasFlags && !process.stdin.isTTY;\n\n try {\n const client = getClient();\n\n if (isBatch) {\n const raw = await readStdin();\n let items: BatchStoryInput[];\n try {\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) {\n throw new Error('Expected a JSON array of story objects on stdin');\n }\n items = parsed as BatchStoryInput[];\n } catch (parseError) {\n throw new Error(\n `Could not parse stdin as a JSON array: ${\n parseError instanceof Error ? parseError.message : String(parseError)\n }`,\n );\n }\n\n const results: BatchStoryResult[] = [];\n // Sequential so server-side displayOrder follows array order.\n for (let index = 0; index < items.length; index++) {\n const item = items[index]!;\n try {\n const story = await client.userStories.create({\n featureId: options.feature,\n asA: item.asA,\n iWant: item.iWant,\n soThat: item.soThat,\n acceptanceCriteria: item.acceptanceCriteria,\n scopeId: item.scopeId,\n });\n results.push({ index, ok: true, id: story.id });\n } catch (itemError) {\n results.push({\n index,\n ok: false,\n error: itemError instanceof Error ? itemError.message : String(itemError),\n });\n }\n }\n\n if (useJson) outputBatchResultsJson(results);\n else outputBatchResultsPretty(results);\n\n // Non-zero exit if every item failed, so scripts can detect total failure.\n if (results.length > 0 && results.every((r) => !r.ok)) {\n process.exit(1);\n }\n return;\n }\n\n // Flag mode: a single story.\n const input: UserStoryCreateInput = {\n featureId: options.feature,\n asA: options.asA,\n iWant: options.iWant,\n soThat: options.soThat,\n acceptanceCriteria: options.acceptance,\n scopeId: options.scope,\n };\n const story = await client.userStories.create(input);\n if (useJson) outputUserStoryJson(story);\n else {\n console.log('\\n✓ User story added');\n outputUserStoryPretty(story);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n stories\n .command('list')\n .description('List a feature\\'s user stories in display order')\n .requiredOption('--feature <id>', 'Feature CUID')\n .action(\n async (options: { feature: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const list = await client.userStories.list({ featureId: options.feature });\n if (useJson) outputUserStoriesJson(list);\n else outputUserStoriesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return stories;\n}\n","import { Command } from 'commander';\nimport type { FeatureScopeStatus } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputScopeJson,\n outputScopePretty,\n outputScopesJson,\n outputScopesPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst SCOPE_STATUSES: FeatureScopeStatus[] = [\n 'PLANNED',\n 'IN_PROGRESS',\n 'SHIPPED',\n 'DEPRECATED',\n];\n\nfunction validateScopeStatus(value: string | undefined): FeatureScopeStatus | undefined {\n if (!value) return undefined;\n if (!(SCOPE_STATUSES as string[]).includes(value)) {\n throw new Error(\n `Invalid status \"${value}\". Valid: ${SCOPE_STATUSES.join(', ')}`,\n );\n }\n return value as FeatureScopeStatus;\n}\n\nexport function createScopesCommand(): Command {\n const scopes = new Command('scopes').description(\n 'Manage a feature\\'s scopes: shippable increments (\"V1\", \"V2\"), each with its own lifecycle.',\n );\n\n scopes\n .command('list')\n .description('List a feature\\'s scopes')\n .requiredOption('--feature <id>', 'Feature CUID')\n .action(\n async (options: { feature: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const list = await client.scopes.list({ featureId: options.feature });\n if (useJson) outputScopesJson(list);\n else outputScopesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n scopes\n .command('add')\n .description('Add a scope to a feature')\n .requiredOption('--feature <id>', 'Feature CUID')\n .requiredOption('--version <label>', 'Short label for the increment, e.g. \"V1\"')\n .requiredOption('-d, --description <text>', 'What this scope delivers (markdown supported)')\n .option('--status <status>', `Status: ${SCOPE_STATUSES.join(', ')} (default PLANNED)`)\n .action(\n async (\n options: { feature: string; version: string; description: string; status?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateScopeStatus(options.status);\n const client = getClient();\n const scope = await client.scopes.create({\n featureId: options.feature,\n version: options.version,\n description: options.description,\n status,\n });\n if (useJson) outputScopeJson(scope);\n else {\n console.log('\\n✓ Scope added');\n outputScopePretty(scope);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n scopes\n .command('update')\n .description('Update a scope (setting SHIPPED stamps shippedAt and rolls the feature status up)')\n .requiredOption('--id <id>', 'Scope CUID')\n .option('--version <label>', 'New version label')\n .option('-d, --description <text>', 'New description')\n .option('--status <status>', `Status: ${SCOPE_STATUSES.join(', ')}`)\n .action(\n async (\n options: { id: string; version?: string; description?: string; status?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateScopeStatus(options.status);\n const client = getClient();\n const scope = await client.scopes.update({\n id: options.id,\n version: options.version,\n description: options.description,\n status,\n });\n if (useJson) outputScopeJson(scope);\n else {\n console.log('\\n✓ Scope updated');\n outputScopePretty(scope);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n scopes\n .command('rm')\n .description('Delete a scope')\n .requiredOption('--id <id>', 'Scope CUID')\n .action(async (options: { id: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const result = await client.scopes.delete(options.id);\n if (useJson) console.log(JSON.stringify(result, null, 2));\n else console.log('\\n✓ Scope deleted');\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return scopes;\n}\n","import { Command } from 'commander';\nimport type { RequirementCreateInput, RequirementKind } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputRequirementJson,\n outputRequirementPretty,\n outputRequirementsJson,\n outputRequirementsPretty,\n outputRequirementBatchJson,\n outputRequirementBatchPretty,\n type BatchRequirementResult,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst REQUIREMENT_KINDS: RequirementKind[] = [\n 'FUNCTIONAL',\n 'NON_FUNCTIONAL',\n 'CONSTRAINT',\n];\n\nfunction validateKind(value: string | undefined): RequirementKind | undefined {\n if (!value) return undefined;\n if (!(REQUIREMENT_KINDS as string[]).includes(value)) {\n throw new Error(\n `Invalid kind \"${value}\". Valid: ${REQUIREMENT_KINDS.join(', ')}`,\n );\n }\n return value as RequirementKind;\n}\n\n// Shape of a single requirement object in the stdin batch array.\ninterface BatchRequirementInput {\n statement: string;\n kind?: RequirementKind;\n scopeId?: string;\n}\n\nasync function readStdin(): Promise<string> {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk as Buffer);\n }\n return Buffer.concat(chunks).toString('utf-8');\n}\n\nexport function createRequirementsCommand(): Command {\n const requirements = new Command('requirements').description(\n 'Manage a feature\\'s requirements: atomic, testable EARS-style \"shall\" statements, checkable met/unmet.',\n );\n\n requirements\n .command('add')\n .description(\n [\n 'Add requirements to a feature.',\n '',\n 'Flag mode: pass -s/--statement (plus optional --kind/--scope) to add one requirement.',\n 'Batch mode: pipe a JSON array of { statement, kind?, scopeId? } on stdin',\n ' to add many at once (per-item success/failure is reported).',\n ].join('\\n'),\n )\n .requiredOption('--feature <id>', 'Feature CUID')\n .option('-s, --statement <text>', 'One EARS-style \"shall\" statement')\n .option('--kind <kind>', `Kind: ${REQUIREMENT_KINDS.join(', ')}`)\n .option('--scope <id>', 'Feature scope CUID to pin the requirement to')\n .action(\n async (\n options: { feature: string; statement?: string; kind?: string; scope?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n\n if (options.statement) {\n const requirement = await client.requirements.create({\n featureId: options.feature,\n statement: options.statement,\n kind: validateKind(options.kind),\n scopeId: options.scope,\n });\n if (useJson) outputRequirementJson(requirement);\n else {\n console.log('\\n✓ Requirement added');\n outputRequirementPretty(requirement);\n }\n return;\n }\n\n // Batch mode: JSON array on stdin.\n if (process.stdin.isTTY) {\n throw new Error(\n 'Pass -s/--statement, or pipe a JSON array of requirements on stdin.',\n );\n }\n const raw = await readStdin();\n let batch: BatchRequirementInput[];\n try {\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) throw new Error('not an array');\n batch = parsed as BatchRequirementInput[];\n } catch {\n throw new Error(\n 'stdin must be a JSON array of { statement, kind?, scopeId? } objects.',\n );\n }\n\n const results: BatchRequirementResult[] = [];\n for (const [index, item] of batch.entries()) {\n try {\n if (!item.statement || typeof item.statement !== 'string') {\n throw new Error('missing \"statement\"');\n }\n const input: RequirementCreateInput = {\n featureId: options.feature,\n statement: item.statement,\n kind: validateKind(item.kind),\n scopeId: item.scopeId,\n };\n const requirement = await client.requirements.create(input);\n results.push({ index, success: true, requirement });\n } catch (error) {\n results.push({\n index,\n success: false,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n if (useJson) outputRequirementBatchJson(results);\n else outputRequirementBatchPretty(results);\n if (results.some((r) => !r.success)) process.exitCode = 1;\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n requirements\n .command('list')\n .description('List a feature\\'s requirements')\n .requiredOption('--feature <id>', 'Feature CUID')\n .option('--scope <id>', 'Only requirements pinned to this scope')\n .action(\n async (options: { feature: string; scope?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const list = await client.requirements.list({\n featureId: options.feature,\n scopeId: options.scope,\n });\n if (useJson) outputRequirementsJson(list);\n else outputRequirementsPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n requirements\n .command('check')\n .description('Mark a requirement met (or unmet with --unmet)')\n .requiredOption('--id <id>', 'Requirement CUID')\n .option('--unmet', 'Mark unmet instead of met')\n .action(\n async (options: { id: string; unmet?: boolean }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const requirement = await client.requirements.setChecked(\n options.id,\n !options.unmet,\n );\n if (useJson) outputRequirementJson(requirement);\n else {\n console.log(`\\n✓ Requirement marked ${options.unmet ? 'unmet' : 'met'}`);\n outputRequirementPretty(requirement);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n requirements\n .command('rm')\n .description('Delete a requirement')\n .requiredOption('--id <id>', 'Requirement CUID')\n .action(async (options: { id: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const result = await client.requirements.delete(options.id);\n if (useJson) console.log(JSON.stringify(result, null, 2));\n else console.log('\\n✓ Requirement deleted');\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return requirements;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveProductId, resolveWorkspaceId } from '../utils/resolve.js';\nimport { shouldUseJson } from '../utils/output.js';\nimport chalk from 'chalk';\nimport type { Area } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nfunction outputAreasPretty(areas: Area[]): void {\n if (areas.length === 0) {\n console.log(chalk.gray('No areas found.'));\n return;\n }\n console.log(chalk.bold(`\\nAreas (${areas.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const a of areas) {\n const count = a._count?.features != null ? chalk.gray(` (${a._count.features} features)`) : '';\n console.log(` ${chalk.bold(a.name)}${count}`);\n console.log(chalk.gray(` ID: ${a.id}`));\n }\n console.log();\n}\n\nexport function createAreasCommand(): Command {\n const areas = new Command('areas').description(\n 'Manage a product\\'s areas: the buckets features are filed under (a feature has exactly one or none).',\n );\n\n areas\n .command('list')\n .description('List a product\\'s areas')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .action(\n async (options: { product: string; workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(client, workspaceId, options.product);\n const list = await client.areas.list({ productId });\n if (useJson) console.log(JSON.stringify({ areas: list, total: list.length }, null, 2));\n else outputAreasPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n areas\n .command('create')\n .description('Create an area in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .requiredOption('-n, --name <name>', 'Area name (unique per product)')\n .option('-d, --description <text>', 'What belongs in this area')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .action(\n async (\n options: { product: string; name: string; description?: string; workspace?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(client, workspaceId, options.product);\n const area = await client.areas.create({\n productId,\n name: options.name,\n description: options.description,\n });\n if (useJson) console.log(JSON.stringify(area, null, 2));\n else console.log(`\\n✓ Area created: ${area.name} (${area.id})`);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return areas;\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport type { Tag } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport { shouldUseJson } from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\ninterface SeedLabel {\n name: string;\n slug: string;\n color: string;\n}\n\n/**\n * Canonical triage labels referenced by the `/triage` agent skill. Slugs are\n * deterministic, so re-running `seed-triage` after a partial creation only\n * creates the missing ones.\n */\nconst TRIAGE_LABELS: SeedLabel[] = [\n { slug: 'needs-triage', name: 'needs-triage', color: 'avatar-orange' },\n { slug: 'needs-info', name: 'needs-info', color: 'avatar-yellow' },\n { slug: 'ready-for-agent', name: 'ready-for-agent', color: 'avatar-green' },\n { slug: 'ready-for-human', name: 'ready-for-human', color: 'avatar-lightBlue' },\n { slug: 'wontfix', name: 'wontfix', color: 'avatar-lightGray' },\n];\n\nconst CUID_PATTERN = /^c[a-z0-9]{20,}$/i;\n\nfunction looksLikeCuid(value: string): boolean {\n return CUID_PATTERN.test(value);\n}\n\nfunction outputTagsPretty(tags: Tag[]): void {\n if (tags.length === 0) {\n console.log(chalk.dim('No labels found.'));\n return;\n }\n console.log();\n for (const tag of tags) {\n const scope = tag.workspaceId === null ? chalk.cyan('global') : chalk.magenta('workspace');\n const category = tag.category === null ? chalk.dim('(label)') : chalk.dim(`(${tag.category})`);\n console.log(\n ` ${chalk.bold(tag.slug)} ${tag.name} ${chalk.gray(tag.color)} ${scope} ${category}`,\n );\n }\n console.log();\n}\n\nfunction outputTagPretty(tag: Tag, prefix?: string): void {\n if (prefix) console.log(prefix);\n console.log(` ${chalk.bold(tag.slug)} ${tag.name} ${chalk.gray(tag.color)}`);\n}\n\nexport async function resolveLabelIds(\n client: ReturnType<typeof getClient>,\n workspaceId: string | undefined,\n values: string[],\n): Promise<string[]> {\n if (values.length === 0) return [];\n\n const bySlug = values.filter((v) => !looksLikeCuid(v));\n const byId = values.filter((v) => looksLikeCuid(v));\n\n if (bySlug.length === 0) return byId;\n\n const list = await client.labels.list({ workspaceId });\n const slugMap = new Map(list.allTags.map((t) => [t.slug, t.id]));\n\n const resolvedFromSlugs: string[] = [];\n const missing: string[] = [];\n for (const slug of bySlug) {\n const id = slugMap.get(slug);\n if (id === undefined) missing.push(slug);\n else resolvedFromSlugs.push(id);\n }\n if (missing.length > 0) {\n throw new Error(\n `Unknown label slug(s): ${missing.join(', ')}. Run \\`exponential labels list --workspace <slug>\\` to see available labels.`,\n );\n }\n return [...byId, ...resolvedFromSlugs];\n}\n\nexport function createLabelsCommand(): Command {\n const labels = new Command('labels').description(\n 'Manage labels (orthogonal tags applied to actions, tickets, features, and epics).',\n );\n\n labels\n .command('list')\n .description('List labels visible in a workspace')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .option(\n '--category <category>',\n 'Filter by category. Use \"label\" for general labels, \"null\" for category-less labels, or omit to list all.',\n )\n .action(\n async (\n options: { workspace?: string; category?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const category =\n options.category === undefined\n ? undefined\n : options.category === 'null'\n ? null\n : options.category;\n const result = await client.labels.list({ workspaceId, category });\n if (useJson) {\n console.log(JSON.stringify(result.allTags, null, 2));\n } else {\n outputTagsPretty(result.allTags);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n labels\n .command('create')\n .description('Create a workspace-scoped label')\n .requiredOption('-n, --name <name>', 'Label name')\n .requiredOption('--color <token>', 'Color token (e.g. avatar-green, brand-primary)')\n .option('-d, --description <text>', 'Description')\n .option('--category <category>', 'Category. Omit (or pass \"null\") to create a general label.')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (\n options: {\n name: string;\n color: string;\n description?: string;\n category?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n if (workspaceId === undefined) {\n throw new Error(\n 'Workspace is required. Pass --workspace <slug|id> or set a default with `exponential workspaces set-default`.',\n );\n }\n const category =\n options.category === undefined\n ? undefined\n : options.category === 'null'\n ? null\n : options.category;\n const tag = await client.labels.create({\n workspaceId,\n name: options.name,\n color: options.color,\n description: options.description,\n category,\n });\n if (useJson) {\n console.log(JSON.stringify(tag, null, 2));\n } else {\n outputTagPretty(tag, chalk.green('\\n✓ Label created'));\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n labels\n .command('seed-triage')\n .description('Idempotently seed the five canonical triage labels into a workspace.')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n if (workspaceId === undefined) {\n throw new Error(\n 'Workspace is required. Pass --workspace <slug|id> or set a default with `exponential workspaces set-default`.',\n );\n }\n const existing = await client.labels.list({ workspaceId });\n const existingSlugs = new Set(existing.allTags.map((t) => t.slug));\n\n const results: Array<{\n slug: string;\n status: 'created' | 'existed';\n tag?: Tag;\n }> = [];\n for (const def of TRIAGE_LABELS) {\n if (existingSlugs.has(def.slug)) {\n results.push({ slug: def.slug, status: 'existed' });\n continue;\n }\n const tag = await client.labels.create({\n workspaceId,\n name: def.name,\n color: def.color,\n });\n results.push({ slug: def.slug, status: 'created', tag });\n }\n\n if (useJson) {\n console.log(JSON.stringify(results, null, 2));\n } else {\n console.log();\n console.log(chalk.bold('Triage labels:'));\n for (const r of results) {\n const tag = chalk.bold(r.slug);\n const status =\n r.status === 'created'\n ? chalk.green('created')\n : chalk.dim('existed');\n console.log(` ${tag} ${status}`);\n }\n console.log();\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return labels;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputOrganizationJson,\n outputOrganizationPretty,\n outputOrganizationsJson,\n outputOrganizationsPretty,\n} from '../utils/output.js';\nimport type { OrganizationSize } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nconst VALID_SIZES: OrganizationSize[] = [\n '1-10', '11-50', '51-200', '201-500', '501-1000', '1000+',\n];\n\nexport function createOrganizationsCommand(): Command {\n const organizations = new Command('organizations')\n .alias('orgs')\n .description('Manage CRM organizations');\n\n organizations\n .command('list')\n .description('List organizations')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .option('--search <query>', 'Search by name or description')\n .option('--industry <industry>', 'Filter by industry')\n .option('--limit <n>', 'Max results to return', parseInt)\n .option('--cursor <cursor>', 'Pagination cursor')\n .action(async (options: {\n workspace: string;\n search?: string;\n industry?: string;\n limit?: number;\n cursor?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const result = await client.organizations.list({\n workspaceId: options.workspace,\n search: options.search,\n industry: options.industry,\n limit: options.limit,\n cursor: options.cursor,\n });\n\n if (useJson) {\n outputOrganizationsJson(result.organizations, result.nextCursor);\n } else {\n outputOrganizationsPretty(result.organizations);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n organizations\n .command('get')\n .description('Get an organization by ID')\n .argument('<id>', 'Organization ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const org = await client.organizations.get(id);\n\n if (useJson) {\n outputOrganizationJson(org);\n } else {\n outputOrganizationPretty(org);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n organizations\n .command('create')\n .description('Create a new organization')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .requiredOption('--name <name>', 'Organization name')\n .option('--website-url <url>', 'Website URL')\n .option('--logo-url <url>', 'Logo URL')\n .option('--description <text>', 'Description')\n .option('--industry <industry>', 'Industry')\n .option('--size <size>', `Company size (${VALID_SIZES.join(', ')})`)\n .action(async (options: {\n workspace: string;\n name: string;\n websiteUrl?: string;\n logoUrl?: string;\n description?: string;\n industry?: string;\n size?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n if (options.size && !VALID_SIZES.includes(options.size as OrganizationSize)) {\n throw new Error(`Invalid size \"${options.size}\". Valid: ${VALID_SIZES.join(', ')}`);\n }\n\n const client = getClient();\n const org = await client.organizations.create({\n workspaceId: options.workspace,\n name: options.name,\n websiteUrl: options.websiteUrl,\n logoUrl: options.logoUrl,\n description: options.description,\n industry: options.industry,\n size: options.size as OrganizationSize | undefined,\n });\n\n if (useJson) {\n outputOrganizationJson(org);\n } else {\n console.log('\\n✓ Organization created successfully');\n outputOrganizationPretty(org);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return organizations;\n}\n","import { readFileSync } from 'node:fs';\nimport { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport {\n shouldUseJson,\n outputPageJson,\n outputPagePretty,\n outputPagesJson,\n outputPagesPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\n/** Body from -b text, --body-file path, or \"-\" for stdin. */\nfunction readBody(body?: string, bodyFile?: string): string | undefined {\n if (body !== undefined) return body;\n if (bodyFile === undefined) return undefined;\n if (bodyFile === '-') return readFileSync(0, 'utf-8');\n return readFileSync(bodyFile, 'utf-8');\n}\n\nexport function createPagesCommand(): Command {\n const pages = new Command('pages').description(\n 'Manage Knowledge pages (PRDs, research, technical specs). Link one to a feature with \"features link-page\".',\n );\n\n pages\n .command('list')\n .description('List pages in a workspace')\n .option('--workspace <slug|id>', 'Workspace (defaults to the configured default)')\n .option('--search <text>', 'Filter by title/content')\n .action(\n async (options: { workspace?: string; search?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const list = await client.pages.list({\n workspaceId,\n search: options.search,\n });\n if (useJson) outputPagesJson(list);\n else outputPagesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n pages\n .command('get <id>')\n .description('Get a page by CUID (body is Markdown)')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const page = await client.pages.get(id);\n if (useJson) outputPageJson(page);\n else outputPagePretty(page);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n pages\n .command('create')\n .description('Create a page. Body: -b text, --body-file <path>, or --body-file - for stdin.')\n .option('--workspace <slug|id>', 'Workspace (defaults to the configured default)')\n .requiredOption('-t, --title <title>', 'Page title')\n .option('-b, --body <markdown>', 'Markdown body')\n .option('--body-file <path>', 'Read the Markdown body from a file (\"-\" = stdin)')\n .action(\n async (\n options: { workspace?: string; title: string; body?: string; bodyFile?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const page = await client.pages.create({\n workspaceId,\n title: options.title,\n body: readBody(options.body, options.bodyFile),\n });\n if (useJson) outputPageJson(page);\n else {\n console.log('\\n✓ Page created');\n outputPagePretty(page);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n pages\n .command('update')\n .description(\n 'Update a page. Sending a body is a Markdown-source write: the Markdown becomes canonical.',\n )\n .requiredOption('--id <id>', 'Page CUID')\n .option('-t, --title <title>', 'New title')\n .option('-b, --body <markdown>', 'New Markdown body (replaces the whole body)')\n .option('--body-file <path>', 'Read the new Markdown body from a file (\"-\" = stdin)')\n .action(\n async (\n options: { id: string; title?: string; body?: string; bodyFile?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const page = await client.pages.update({\n id: options.id,\n title: options.title,\n body: readBody(options.body, options.bodyFile),\n });\n if (useJson) outputPageJson(page);\n else {\n console.log('\\n✓ Page updated');\n outputPagePretty(page);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return pages;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport {\n shouldUseJson,\n outputProductsJson,\n outputProductsPretty,\n outputProductJson,\n outputProductPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nexport function createProductsCommand(): Command {\n const products = new Command('products').description(\n 'Manage products. A workspace contains products; a product holds features and tickets.',\n );\n\n products\n .command('list')\n .description('List products in a workspace')\n .option('--workspace <slug|id>', 'Workspace slug or CUID (defaults to configured workspace)')\n .action(async (options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const list = await client.products.list(workspaceId);\n if (useJson) outputProductsJson(list);\n else outputProductsPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n products\n .command('get <slugOrId>')\n .description('Get a product by slug or CUID')\n .option('--workspace <slug|id>', 'Workspace (required when using a slug)')\n .action(async (slugOrId: string, options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const product = await client.products.resolve(workspaceId, slugOrId);\n if (useJson) outputProductJson(product);\n else outputProductPretty(product);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n products\n .command('create')\n .description('Create a new product')\n .requiredOption('-n, --name <name>', 'Product name')\n .requiredOption('--slug <slug>', 'Kebab-case slug (matches /^[a-z0-9-]+$/)')\n .option('-d, --description <text>', 'Description')\n .option('--icon <icon>', 'Icon shortcode')\n .option('--color <color>', 'Color')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (\n options: {\n name: string;\n slug: string;\n description?: string;\n icon?: string;\n color?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n if (!/^[a-z0-9-]+$/.test(options.slug)) {\n throw new Error(\n `Invalid slug \"${options.slug}\". Slug must be kebab-case (a-z, 0-9, -).`,\n );\n }\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const product = await client.products.create({\n workspaceId,\n name: options.name,\n slug: options.slug,\n description: options.description,\n icon: options.icon,\n color: options.color,\n });\n if (useJson) outputProductJson(product);\n else {\n console.log('\\n✓ Product created');\n outputProductPretty(product);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return products;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputProjectsJson,\n outputProjectsPretty,\n} from '../utils/output.js';\nimport type { Project } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nexport function createProjectsCommand(): Command {\n const projects = new Command('projects')\n .description('Manage projects');\n\n projects\n .command('list')\n .description('List all projects')\n .option('--workspace <id>', 'Filter by workspace ID')\n .option('--include-actions', 'Include actions in output')\n .action(async (options: { workspace?: string; includeActions?: boolean }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const projects = await client.projects.list({\n workspaceId: options.workspace,\n includeActions: options.includeActions,\n });\n\n if (useJson) {\n outputProjectsJson(projects);\n } else {\n outputProjectsPretty(projects);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return projects;\n}\n","import { Command } from 'commander';\nimport type { TicketStatus, TicketType } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveProductId, resolveWorkspaceId } from '../utils/resolve.js';\nimport { resolveLabelIds } from './labels.js';\n\nfunction collectRepeatable(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\nimport {\n shouldUseJson,\n outputCommentJson,\n outputCommentPretty,\n outputTicketJson,\n outputTicketPretty,\n outputTicketsJson,\n outputTicketsPretty,\n outputActionJson,\n outputActionPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst TICKET_STATUSES: TicketStatus[] = [\n 'BACKLOG',\n 'NEEDS_REFINEMENT',\n 'READY_TO_PLAN',\n 'COMMITTED',\n 'IN_PROGRESS',\n 'BLOCKED',\n 'QA',\n 'DONE',\n 'DEPLOYED',\n 'ARCHIVED',\n];\n\nconst TICKET_TYPES: TicketType[] = [\n 'BUG',\n 'FEATURE',\n 'CHORE',\n 'IMPROVEMENT',\n 'SPIKE',\n 'RESEARCH',\n];\n\nfunction validateTicketStatus(value: string | undefined): TicketStatus | undefined {\n if (!value) return undefined;\n if (!(TICKET_STATUSES as string[]).includes(value)) {\n throw new Error(\n `Invalid ticket status \"${value}\". Valid: ${TICKET_STATUSES.join(', ')}`,\n );\n }\n return value as TicketStatus;\n}\n\nfunction validateTicketType(value: string | undefined): TicketType | undefined {\n if (!value) return undefined;\n if (!(TICKET_TYPES as string[]).includes(value)) {\n throw new Error(\n `Invalid ticket type \"${value}\". Valid: ${TICKET_TYPES.join(', ')}`,\n );\n }\n return value as TicketType;\n}\n\nexport function createTicketsCommand(): Command {\n const tickets = new Command('tickets').description(\n 'Manage product backlog tickets. Tickets live under a product, link to features/epics, depend on each other, and can be implemented via actions.',\n );\n\n tickets\n .command('list')\n .description(\n 'List tickets in a product, or workspace-wide when --pr or --branch is supplied',\n )\n .option(\n '--product <slug|id>',\n 'Product slug or CUID (required unless --pr or --branch is supplied)',\n )\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .option('--status <status>', `Filter by status: ${TICKET_STATUSES.join(', ')}`)\n .option('--type <type>', `Filter by type: ${TICKET_TYPES.join(', ')}`)\n .option('--feature <id>', 'Filter by feature CUID')\n .option('--epic <id>', 'Filter by epic CUID')\n .option('--assignee <id>', 'Filter by assignee user ID')\n .option(\n '--pr <url>',\n 'Workspace-wide lookup by Ticket.prUrl (exact match). Makes --product optional.',\n )\n .option(\n '--branch <name>',\n 'Workspace-wide lookup by Ticket.branchName (exact match). Makes --product optional.',\n )\n .option(\n '--label <slug-or-id>',\n 'Filter to tickets carrying this label (repeatable; AND semantics)',\n collectRepeatable,\n [] as string[],\n )\n .action(\n async (\n options: {\n product?: string;\n workspace?: string;\n status?: string;\n type?: string;\n feature?: string;\n epic?: string;\n assignee?: string;\n pr?: string;\n branch?: string;\n label: string[];\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateTicketStatus(options.status);\n const type = validateTicketType(options.type);\n const hasWorkspaceFilter = Boolean(options.pr || options.branch);\n if (!hasWorkspaceFilter && !options.product) {\n throw new Error(\n '--product is required unless --pr or --branch is supplied',\n );\n }\n const client = getClient();\n let workspaceId: string | undefined;\n let productId: string | undefined;\n if (options.product) {\n workspaceId = await resolveWorkspaceId(client, options.workspace);\n productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n }\n const list = await client.tickets.list({\n productId,\n status,\n type,\n featureId: options.feature,\n epicId: options.epic,\n assigneeId: options.assignee,\n prUrl: options.pr,\n branchName: options.branch,\n });\n let filtered = list;\n if (options.label.length > 0) {\n const labelIds = new Set(\n await resolveLabelIds(client, workspaceId, options.label),\n );\n const ticketLabelSets = await Promise.all(\n list.map((t) =>\n client.labels\n .listForEntity({ entityType: 'ticket', entityId: t.id })\n .then((tags) => new Set(tags.map((tag) => tag.id))),\n ),\n );\n filtered = list.filter((_t, idx) => {\n const tagSet = ticketLabelSets[idx];\n if (tagSet === undefined) return false;\n for (const id of labelIds) {\n if (!tagSet.has(id)) return false;\n }\n return true;\n });\n }\n if (useJson) outputTicketsJson(filtered);\n else outputTicketsPretty(filtered);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('get <id>')\n .description('Show a ticket with dependencies, actions, and comments')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const ticket = await client.tickets.get(id);\n if (useJson) outputTicketJson(ticket);\n else outputTicketPretty(ticket);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('show <id>')\n .description('Alias for `tickets get`')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const ticket = await client.tickets.get(id);\n if (useJson) outputTicketJson(ticket);\n else outputTicketPretty(ticket);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('create')\n .description('Create a new ticket in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .requiredOption('-t, --title <title>', 'Ticket title')\n .option('-b, --body <text>', 'Body (markdown supported)')\n .option('--type <type>', `Ticket type: ${TICKET_TYPES.join(', ')}`)\n .option('--status <status>', `Initial status: ${TICKET_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4 (lower = higher)', parseInt)\n .option('--points <n>', 'Story points', parseFloat)\n .option('--feature <id>', 'Feature CUID to attach to')\n .option('--scope <id>', 'Feature scope CUID to attach to (requires --feature)')\n .option('--epic <id>', 'Epic CUID to attach to')\n .option('--assignee <id>', 'Assignee user ID')\n .option('--branch <name>', 'Branch name')\n .option('--pr <url>', 'Pull request URL')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .option(\n '--label <slug-or-id>',\n 'Label to attach (repeatable)',\n collectRepeatable,\n [] as string[],\n )\n .action(\n async (\n options: {\n product: string;\n title: string;\n body?: string;\n type?: string;\n status?: string;\n priority?: number;\n points?: number;\n feature?: string;\n scope?: string;\n epic?: string;\n assignee?: string;\n branch?: string;\n pr?: string;\n workspace?: string;\n label: string[];\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateTicketStatus(options.status);\n const type = validateTicketType(options.type);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n const ticket = await client.tickets.create({\n productId,\n title: options.title,\n body: options.body,\n type,\n status,\n priority: options.priority,\n points: options.points,\n featureId: options.feature,\n scopeId: options.scope,\n epicId: options.epic,\n assigneeId: options.assignee,\n branchName: options.branch,\n prUrl: options.pr,\n });\n if (options.label.length > 0) {\n const tagIds = await resolveLabelIds(client, workspaceId, options.label);\n await client.labels.setEntityTags({\n entityType: 'ticket',\n entityId: ticket.id,\n tagIds,\n });\n }\n if (useJson) outputTicketJson(ticket);\n else {\n console.log('\\n✓ Ticket created');\n outputTicketPretty(ticket);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('update')\n .description('Update an existing ticket')\n .requiredOption('--id <id>', 'Ticket CUID')\n .option('-t, --title <title>', 'New title')\n .option('-b, --body <text>', 'New body')\n .option('--type <type>', `Type: ${TICKET_TYPES.join(', ')}`)\n .option('--status <status>', `Status: ${TICKET_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4 (or \"null\" to clear)')\n .option('--points <n>', 'Story points (or \"null\" to clear)')\n .option('--feature <id>', 'Feature CUID (or \"null\" to detach)')\n .option('--epic <id>', 'Epic CUID (or \"null\" to detach)')\n .option('--assignee <id>', 'Assignee user ID (or \"null\" to unassign)')\n .option('--branch <name>', 'Branch name (or \"null\")')\n .option('--pr <url>', 'PR URL (or \"null\")')\n .option(\n '--add-label <slug-or-id>',\n 'Label to attach to this ticket (repeatable)',\n collectRepeatable,\n [] as string[],\n )\n .option(\n '--remove-label <slug-or-id>',\n 'Label to detach from this ticket (repeatable)',\n collectRepeatable,\n [] as string[],\n )\n .action(\n async (\n options: {\n id: string;\n title?: string;\n body?: string;\n type?: string;\n status?: string;\n priority?: string;\n points?: string;\n feature?: string;\n epic?: string;\n assignee?: string;\n branch?: string;\n pr?: string;\n addLabel: string[];\n removeLabel: string[];\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const parseNullableInt = (v: string | undefined): number | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n const n = parseInt(v, 10);\n if (isNaN(n)) throw new Error(`Invalid number: ${v}`);\n return n;\n };\n const parseNullableFloat = (v: string | undefined): number | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n const n = parseFloat(v);\n if (isNaN(n)) throw new Error(`Invalid number: ${v}`);\n return n;\n };\n const parseNullableString = (v: string | undefined): string | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n return v;\n };\n\n const status = validateTicketStatus(options.status);\n const type = validateTicketType(options.type);\n const client = getClient();\n const ticket = await client.tickets.update({\n id: options.id,\n title: options.title,\n body: options.body,\n type,\n status,\n priority: parseNullableInt(options.priority),\n points: parseNullableFloat(options.points),\n featureId: parseNullableString(options.feature),\n epicId: parseNullableString(options.epic),\n assigneeId: parseNullableString(options.assignee),\n branchName: parseNullableString(options.branch),\n prUrl: parseNullableString(options.pr),\n });\n if (options.addLabel.length > 0 || options.removeLabel.length > 0) {\n const current = await client.labels.listForEntity({\n entityType: 'ticket',\n entityId: options.id,\n });\n const currentIds = new Set(current.map((t) => t.id));\n const addIds = await resolveLabelIds(client, undefined, options.addLabel);\n const removeIds = await resolveLabelIds(client, undefined, options.removeLabel);\n for (const id of addIds) currentIds.add(id);\n for (const id of removeIds) currentIds.delete(id);\n await client.labels.setEntityTags({\n entityType: 'ticket',\n entityId: options.id,\n tagIds: [...currentIds],\n });\n }\n if (useJson) outputTicketJson(ticket);\n else {\n console.log('\\n✓ Ticket updated');\n outputTicketPretty(ticket);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('delete <id>')\n .description('Delete a ticket')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.tickets.delete(id);\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id }, null, 2));\n } else {\n console.log('\\n✓ Ticket deleted');\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('block <ticket>')\n .description('Mark <ticket> as blocked by another ticket')\n .requiredOption('--by <id>', 'Ticket CUID that must complete first')\n .action(\n async (ticket: string, options: { by: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const dep = await client.tickets.addDependency(ticket, options.by);\n if (useJson) {\n console.log(JSON.stringify(dep, null, 2));\n } else {\n const depId = dep.dependsOn.shortId ?? (dep.dependsOn.number != null ? `#${dep.dependsOn.number}` : dep.dependsOn.id);\n console.log(`\\n✓ Ticket ${ticket} now depends on ${depId} ${dep.dependsOn.title}`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('unblock <ticket>')\n .description('Remove a blocking dependency from <ticket>')\n .requiredOption('--by <id>', 'The ticket CUID that was blocking')\n .action(\n async (ticket: string, options: { by: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.tickets.removeDependency(ticket, options.by);\n if (useJson) {\n console.log(JSON.stringify({ ticketId: ticket, removedBlocker: options.by }, null, 2));\n } else {\n console.log(`\\n✓ Dependency removed: ${ticket} no longer blocked by ${options.by}`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('link-action')\n .description('Attach an existing action to a ticket')\n .requiredOption('--id <id>', 'Ticket CUID')\n .requiredOption('--action <id>', 'Action CUID')\n .action(async (options: { id: string; action: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const action = await client.tickets.linkAction(options.id, options.action);\n if (useJson) outputActionJson(action);\n else {\n console.log('\\n✓ Action linked to ticket');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('unlink-action')\n .description('Detach an action from whatever ticket it is on')\n .requiredOption('--action <id>', 'Action CUID')\n .action(async (options: { action: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const action = await client.tickets.unlinkAction(options.action);\n if (useJson) outputActionJson(action);\n else {\n console.log('\\n✓ Action unlinked');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n const comment = new Command('comment').description('Manage comments on a ticket');\n\n comment\n .command('add')\n .description('Add a comment to a ticket')\n .requiredOption('--id <id>', 'Ticket CUID')\n .requiredOption('-m, --message <text>', 'Comment content (markdown supported)')\n .action(async (options: { id: string; message: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const created = await client.tickets.addComment({\n ticketId: options.id,\n content: options.message,\n });\n if (useJson) outputCommentJson(created);\n else {\n console.log('\\n✓ Comment added');\n outputCommentPretty(created);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('delete')\n .description('Delete one of your own ticket comments')\n .requiredOption('--comment-id <id>', 'Comment ID')\n .action(async (options: { commentId: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.tickets.deleteComment(options.commentId);\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id: options.commentId }, null, 2));\n } else {\n console.log('\\n✓ Comment deleted');\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets.addCommand(comment);\n\n return tickets;\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { getClient } from '../client/index.js';\nimport { getConfig, setConfig } from '../config/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputWorkspacesJson,\n outputWorkspacesPretty,\n} from '../utils/output.js';\nimport type { Workspace } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nexport function createWorkspacesCommand(): Command {\n const workspaces = new Command('workspaces')\n .description('Manage workspaces');\n\n workspaces\n .command('list')\n .description('List all workspaces')\n .action(async (_options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const workspaces = await client.workspaces.list();\n\n if (useJson) {\n outputWorkspacesJson(workspaces);\n } else {\n const config = getConfig();\n outputWorkspacesPretty(workspaces);\n\n if (config.defaultWorkspaceSlug) {\n console.log(chalk.gray(`Default workspace: ${config.defaultWorkspaceSlug}`));\n }\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n workspaces\n .command('set-default <slug>')\n .description('Set the default workspace')\n .action(async (slug: string) => {\n try {\n const client = getClient();\n const workspaces = await client.workspaces.list();\n\n const workspace = workspaces.find((w: Workspace) => w.slug === slug);\n\n if (!workspace) {\n console.error(chalk.red(`Workspace with slug \"${slug}\" not found.`));\n console.log(chalk.gray('Available workspaces:'));\n workspaces.forEach((w: Workspace) => {\n console.log(chalk.gray(` - ${w.slug} (${w.name})`));\n });\n process.exit(1);\n }\n\n setConfig({\n defaultWorkspaceId: workspace.id,\n defaultWorkspaceSlug: workspace.slug,\n });\n\n console.log(chalk.green(`Default workspace set to: ${workspace.name} (${workspace.slug})`));\n } catch (error) {\n handleError(error);\n }\n });\n\n return workspaces;\n}\n"],"mappings":";;;AACA,SAAS,WAAAA,iBAAe;;;ACDxB,SAAS,eAAe;AACxB,OAAOC,YAAW;;;ACDlB,SAAS,yBAAyB;AAGlC,IAAM,cAAc,kBAAkB,EAAE,aAAa,kBAAkB,CAAC;AAIjE,SAAS,YAA+B;AAC7C,SAAO,YAAY,WAAW;AAChC;AAEO,SAAS,UAAU,QAA0C;AAClE,cAAY,WAAW,MAAM;AAC/B;AAEO,SAAS,cAAoB;AAClC,cAAY,YAAY;AAC1B;AAEO,SAAS,kBAA2B;AACzC,SAAO,YAAY,gBAAgB;AACrC;AAEO,SAAS,gBAAwB;AACtC,SAAO,YAAY,cAAc;AACnC;;;ACzBA,SAAS,yBAAyB;AA2BlC,SAAS,aAAa,uBAAuB;AAxB7C,IAAI,iBAA2C;AAExC,SAAS,YAAY;AAC1B,MAAI,CAAC,gBAAgB,GAAG;AACtB,UAAM,IAAI,MAAM,mFAAmF;AAAA,EACrG;AAEA,MAAI,gBAAgB;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,UAAU;AACzB,mBAAiB,IAAI,kBAAkB;AAAA,IACrC,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,EACjB,CAAC;AAED,SAAO;AACT;AAEO,SAAS,cAAc;AAC5B,mBAAiB;AACnB;;;ACzBA,OAAO,WAAW;AAGX,IAAM,mBAAN,cAA+B,MAAM;AAAA,EAC1C,YACE,SACO,MACA,YACA,SACP;AACA,UAAM,OAAO;AAJN;AACA;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AACF;AAEO,SAAS,YAAY,OAAgB,OAAgB,OAAc;AACxE,MAAI,iBAAiB,kBAAkB;AACrC,QAAI,MAAM;AACR,cAAQ,IAAI,KAAK,UAAU;AAAA,QACzB,OAAO;AAAA,UACL,MAAM,MAAM;AAAA,UACZ,SAAS,MAAM;AAAA,UACf,YAAY,MAAM;AAAA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C,UAAQ;AAE5B,QACG,KAAK,aAAa,EAClB;AAAA,EACC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,IAAI;AACb,EACC,QAAQ,OAAO,EACf,OAAO,UAAU,qCAAqC,EACtD,OAAO,YAAY,6BAA6B;AAGnD,QAAQ,WAAW,kBAAkB,CAAC;AACtC,QAAQ,WAAW,qBAAqB,CAAC;AACzC,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,oBAAoB,CAAC;AACxC,QAAQ,WAAW,2BAA2B,CAAC;AAC/C,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,qBAAqB,CAAC;AACzC,QAAQ,WAAW,wBAAwB,CAAC;AAE5C,QAAQ,MAAM;","names":["Command","chalk","chalk","Command","chalk","Command","actions","Command","Command","Command","Command","Command","Command","Command","Command","Command","story","Command","Command","Command","readStdin","Command","Command","chalk","Command","Command","Command","chalk","chalk","Command","Command","Command","Command","Command","Command","Command","Command","Command","projects","Command","Command","Command","chalk","Command","workspaces","chalk","Command"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/commands/auth.ts","../src/config/index.ts","../src/client/index.ts","../src/utils/errors.ts","../src/commands/actions.ts","../src/utils/output.ts","../src/commands/contacts.ts","../src/commands/deals.ts","../src/commands/epics.ts","../src/utils/resolve.ts","../src/commands/features.ts","../src/commands/stories.ts","../src/commands/scopes.ts","../src/commands/requirements.ts","../src/commands/areas.ts","../src/commands/labels.ts","../src/commands/organizations.ts","../src/commands/pages.ts","../src/commands/products.ts","../src/commands/projects.ts","../src/commands/search.ts","../src/commands/tickets.ts","../src/commands/workspaces.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport { createAuthCommand } from './commands/auth.js';\nimport { createActionsCommand } from './commands/actions.js';\nimport { createContactsCommand } from './commands/contacts.js';\nimport { createDealsCommand } from './commands/deals.js';\nimport { createEpicsCommand } from './commands/epics.js';\nimport { createFeaturesCommand } from './commands/features.js';\nimport { createLabelsCommand } from './commands/labels.js';\nimport { createOrganizationsCommand } from './commands/organizations.js';\nimport { createPagesCommand } from './commands/pages.js';\nimport { createProductsCommand } from './commands/products.js';\nimport { createProjectsCommand } from './commands/projects.js';\nimport { createSearchCommand } from './commands/search.js';\nimport { createTicketsCommand } from './commands/tickets.js';\nimport { createWorkspacesCommand } from './commands/workspaces.js';\n\nconst program = new Command();\n\nprogram\n .name('exponential')\n .description(\n [\n 'CLI to interact with Exponential productivity app.',\n '',\n 'Work-tracking hierarchy:',\n ' workspace -> product -> feature -> ticket -> action',\n ' epics are workspace-scoped and can group tickets and actions across products.',\n ].join('\\n'),\n )\n .version('1.0.0')\n .option('--json', 'Output as JSON (default when piped)')\n .option('--pretty', 'Force pretty-printed output');\n\n// Add subcommands\nprogram.addCommand(createAuthCommand());\nprogram.addCommand(createActionsCommand());\nprogram.addCommand(createContactsCommand());\nprogram.addCommand(createDealsCommand());\nprogram.addCommand(createEpicsCommand());\nprogram.addCommand(createFeaturesCommand());\nprogram.addCommand(createLabelsCommand());\nprogram.addCommand(createOrganizationsCommand());\nprogram.addCommand(createPagesCommand());\nprogram.addCommand(createProductsCommand());\nprogram.addCommand(createProjectsCommand());\nprogram.addCommand(createSearchCommand());\nprogram.addCommand(createTicketsCommand());\nprogram.addCommand(createWorkspacesCommand());\n\nprogram.parse();\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { getConfig, setConfig, clearConfig, isAuthenticated, getConfigPath } from '../config/index.js';\nimport { getClient, resetClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\n\nexport function createAuthCommand(): Command {\n const auth = new Command('auth')\n .description('Authentication commands');\n\n auth\n .command('login')\n .description('Configure CLI with your API token')\n .requiredOption('--token <token>', 'JWT token from /tokens page')\n .requiredOption('--api-url <url>', 'API URL (e.g., https://app.exponential.so)')\n .action(async (options: { token: string; apiUrl: string }) => {\n try {\n // Normalize API URL (remove trailing slash)\n let apiUrl = options.apiUrl.replace(/\\/+$/, '');\n\n // Ensure HTTPS for non-localhost\n if (!apiUrl.startsWith('http://localhost') && !apiUrl.startsWith('https://')) {\n apiUrl = `https://${apiUrl}`;\n }\n\n // Store the config\n setConfig({\n token: options.token,\n apiUrl: apiUrl,\n });\n\n // Reset client to use new config\n resetClient();\n\n // Validate by trying to list workspaces\n console.log(chalk.gray('Validating token...'));\n const client = getClient();\n await client.workspaces.list();\n\n console.log(chalk.green('Successfully authenticated!'));\n console.log(chalk.gray(`Config saved to: ${getConfigPath()}`));\n } catch (error) {\n // Clear invalid config\n clearConfig();\n handleError(error);\n }\n });\n\n auth\n .command('logout')\n .description('Remove stored credentials')\n .action(() => {\n clearConfig();\n resetClient();\n console.log(chalk.green('Successfully logged out.'));\n console.log(chalk.gray(`Config cleared from: ${getConfigPath()}`));\n });\n\n auth\n .command('whoami')\n .description('Show current authentication status')\n .action(async () => {\n if (!isAuthenticated()) {\n console.log(chalk.yellow('Not authenticated.'));\n console.log(chalk.gray('Run: exponential auth login --token <jwt> --api-url <url>'));\n process.exit(1);\n }\n\n try {\n const config = getConfig();\n const client = getClient();\n\n // Validate token by listing workspaces\n const workspaces = await client.workspaces.list();\n\n console.log(chalk.green('Authenticated'));\n console.log(chalk.gray(`API URL: ${config.apiUrl}`));\n console.log(chalk.gray(`Workspaces: ${(workspaces as unknown[]).length}`));\n console.log(chalk.gray(`Config: ${getConfigPath()}`));\n } catch (error) {\n handleError(error);\n }\n });\n\n auth\n .command('show')\n .description(\n 'Print parts of the current credentials. Use --token to print the raw JWT (for piping into other tools, e.g. `gh secret set EXPONENTIAL_TOKEN < <(exponential auth show --token)`).',\n )\n .option('--token', 'Print the raw JWT to stdout with no trailing newline')\n .action((options: { token?: boolean }) => {\n const config = getConfig();\n if (options.token) {\n if (!config.token) {\n console.error('Not authenticated. Run `exponential auth login` first.');\n process.exit(1);\n }\n process.stdout.write(config.token);\n return;\n }\n console.log(chalk.bold('\\nCredentials'));\n console.log(chalk.gray('─'.repeat(40)));\n console.log(`API URL: ${config.apiUrl || chalk.gray('(not set)')}`);\n console.log(\n `Token: ${config.token ? chalk.gray(`${config.token.substring(0, 20)}...`) : chalk.gray('(not set)')}`,\n );\n console.log(\n chalk.gray('Use `exponential auth show --token` to print the raw JWT.'),\n );\n console.log();\n });\n\n auth\n .command('status')\n .description('Show detailed authentication status')\n .action(() => {\n const config = getConfig();\n\n console.log(chalk.bold('\\nAuthentication Status'));\n console.log(chalk.gray('─'.repeat(40)));\n console.log(`Authenticated: ${isAuthenticated() ? chalk.green('Yes') : chalk.red('No')}`);\n console.log(`API URL: ${config.apiUrl || chalk.gray('(not set)')}`);\n console.log(`Token: ${config.token ? chalk.gray(`${config.token.substring(0, 20)}...`) : chalk.gray('(not set)')}`);\n console.log(`Config Path: ${getConfigPath()}`);\n console.log();\n });\n\n return auth;\n}\n","import { createConfigStore } from 'exponential-sdk';\nimport type { ExponentialConfig } from 'exponential-sdk';\n\nconst configStore = createConfigStore({ projectName: 'exponential-cli' });\n\nexport type { ExponentialConfig };\n\nexport function getConfig(): ExponentialConfig {\n return configStore.loadConfig();\n}\n\nexport function setConfig(values: Partial<ExponentialConfig>): void {\n configStore.saveConfig(values);\n}\n\nexport function clearConfig(): void {\n configStore.clearConfig();\n}\n\nexport function isAuthenticated(): boolean {\n return configStore.isAuthenticated();\n}\n\nexport function getConfigPath(): string {\n return configStore.getConfigPath();\n}\n","import { ExponentialClient } from 'exponential-sdk';\nimport { getConfig, isAuthenticated } from '../config/index.js';\n\nlet clientInstance: ExponentialClient | null = null;\n\nexport function getClient() {\n if (!isAuthenticated()) {\n throw new Error('Not authenticated. Run: exponential auth login --token <your-jwt> --api-url <url>');\n }\n\n if (clientInstance) {\n return clientInstance;\n }\n\n const config = getConfig();\n clientInstance = new ExponentialClient({\n token: config.token,\n apiUrl: config.apiUrl,\n });\n\n return clientInstance;\n}\n\nexport function resetClient() {\n clientInstance = null;\n}\n\nexport { isTRPCError, TRPCClientError } from 'exponential-sdk';\n","import chalk from 'chalk';\nimport { isTRPCError } from '../client/index.js';\n\nexport class ExponentialError extends Error {\n constructor(\n message: string,\n public code: string,\n public suggestion?: string,\n public details?: unknown\n ) {\n super(message);\n this.name = 'ExponentialError';\n }\n}\n\nexport function handleError(error: unknown, json: boolean = false): never {\n if (error instanceof ExponentialError) {\n if (json) {\n console.log(JSON.stringify({\n error: {\n code: error.code,\n message: error.message,\n suggestion: error.suggestion,\n },\n }, null, 2));\n } else {\n console.error(chalk.red(`Error: ${error.message}`));\n if (error.suggestion) {\n console.error(chalk.yellow(`Suggestion: ${error.suggestion}`));\n }\n }\n process.exit(1);\n }\n\n if (isTRPCError(error)) {\n const code = error.data?.code ?? 'UNKNOWN';\n let message = error.message;\n let suggestion: string | undefined;\n\n switch (code) {\n case 'UNAUTHORIZED':\n message = 'Authentication failed. Your token may have expired.';\n suggestion = 'Run: exponential auth login --token <new-token> --api-url <url>';\n break;\n case 'NOT_FOUND':\n message = 'Resource not found';\n break;\n case 'FORBIDDEN':\n message = 'Access denied';\n break;\n }\n\n if (json) {\n console.log(JSON.stringify({\n error: {\n code,\n message,\n suggestion,\n },\n }, null, 2));\n } else {\n console.error(chalk.red(`Error [${code}]: ${message}`));\n if (suggestion) {\n console.error(chalk.yellow(`Suggestion: ${suggestion}`));\n }\n }\n process.exit(1);\n }\n\n // Generic error handling\n if (json) {\n console.log(JSON.stringify({\n error: {\n code: 'UNKNOWN',\n message: error instanceof Error ? error.message : String(error),\n },\n }, null, 2));\n } else {\n console.error(chalk.red(`Error: ${error instanceof Error ? error.message : String(error)}`));\n }\n process.exit(1);\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputActionsJson,\n outputActionsPretty,\n outputActionJson,\n outputActionPretty,\n outputCommentJson,\n outputCommentPretty,\n outputCommentsJson,\n outputCommentsPretty,\n} from '../utils/output.js';\nimport type { Action, KanbanStatus, Priority } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nconst VALID_PRIORITIES: Priority[] = [\n 'Quick',\n 'Scheduled',\n '1st Priority',\n '2nd Priority',\n '3rd Priority',\n '4th Priority',\n '5th Priority',\n 'Errand',\n 'Remember',\n 'Watch',\n 'Someday Maybe',\n];\n\nexport function createActionsCommand(): Command {\n const actions = new Command('actions')\n .description('Manage actions/tasks');\n\n actions\n .command('list')\n .description('List all actions')\n .option('--project <id>', 'Filter by project ID')\n .option('--status <status>', 'Filter by kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)')\n .option('--assignee <id>', 'Filter by assignee ID')\n .action(async (options: { project?: string; status?: string; assignee?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const kanbanStatus = options.status as KanbanStatus | undefined;\n\n const actions = await client.actions.list({\n projectId: options.project,\n status: kanbanStatus,\n assigneeId: options.assignee,\n });\n\n if (useJson) {\n outputActionsJson(actions, {\n projectId: options.project,\n kanbanStatus: options.status,\n });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('today')\n .description('Get actions due today')\n .option('--workspace <id>', 'Filter by workspace ID')\n .action(async (options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const actions = await client.actions.getToday(options.workspace);\n\n if (useJson) {\n outputActionsJson(actions, { workspaceId: options.workspace });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('range')\n .description('Get actions by date range')\n .requiredOption('--start <date>', 'Start date (YYYY-MM-DD)')\n .requiredOption('--end <date>', 'End date (YYYY-MM-DD)')\n .option('--workspace <id>', 'Filter by workspace ID')\n .action(async (options: { start: string; end: string; workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const startDate = new Date(options.start);\n const endDate = new Date(options.end);\n\n if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) {\n throw new Error('Invalid date format. Use YYYY-MM-DD');\n }\n\n const client = getClient();\n const actions = await client.actions.getByDateRange(startDate, endDate, options.workspace);\n\n if (useJson) {\n outputActionsJson(actions, { workspaceId: options.workspace });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('kanban')\n .description('Get kanban board actions')\n .option('--project <id>', 'Filter by project ID')\n .option('--status <status>', 'Filter by kanban status')\n .option('--assignee <id>', 'Filter by assignee ID')\n .action(async (options: { project?: string; status?: string; assignee?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const kanbanStatus = options.status as KanbanStatus | undefined;\n\n const actions = await client.actions.getKanban({\n projectId: options.project,\n status: kanbanStatus,\n assigneeId: options.assignee,\n });\n\n if (useJson) {\n outputActionsJson(actions, {\n projectId: options.project,\n kanbanStatus: options.status,\n });\n } else {\n outputActionsPretty(actions);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('update')\n .description('Update an existing action')\n .requiredOption('--id <id>', 'Action ID to update')\n .option('-n, --name <name>', 'New action name')\n .option('-d, --description <text>', 'New description')\n .option('-p, --project <id>', 'Move to project ID')\n .option('--priority <priority>', 'Priority (Quick, Scheduled, 1st Priority, etc.)')\n .option('--status <status>', 'Status (ACTIVE, COMPLETED, CANCELLED)')\n .option('--kanban <status>', 'Kanban status (BACKLOG, TODO, IN_PROGRESS, IN_REVIEW, DONE)')\n .option('--due <date>', 'Due date (YYYY-MM-DD or \"null\" to clear)')\n .action(async (options: {\n id: string;\n name?: string;\n description?: string;\n project?: string;\n priority?: string;\n status?: string;\n kanban?: string;\n due?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n // Validate priority if provided\n if (options.priority && !VALID_PRIORITIES.includes(options.priority as Priority)) {\n throw new Error(`Invalid priority \"${options.priority}\". Valid values: ${VALID_PRIORITIES.join(', ')}`);\n }\n\n // Parse due date if provided\n let dueDate: Date | null | undefined;\n if (options.due === 'null') {\n dueDate = null;\n } else if (options.due) {\n dueDate = new Date(options.due);\n if (isNaN(dueDate.getTime())) {\n throw new Error('Invalid due date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n const action = await client.actions.update({\n id: options.id,\n name: options.name,\n description: options.description,\n projectId: options.project,\n priority: options.priority as Priority | undefined,\n status: options.status as 'ACTIVE' | 'COMPLETED' | 'CANCELLED' | undefined,\n kanbanStatus: options.kanban as 'BACKLOG' | 'TODO' | 'IN_PROGRESS' | 'IN_REVIEW' | 'DONE' | 'CANCELLED' | undefined,\n dueDate,\n });\n\n if (useJson) {\n outputActionJson(action);\n } else {\n console.log('\\n✓ Action updated successfully');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions\n .command('create')\n .description('Create a new action')\n .requiredOption('-n, --name <name>', 'Action name/title')\n .option('-d, --description <text>', 'Action description')\n .option('-p, --project <id>', 'Project ID to assign the action to')\n .option('--priority <priority>', 'Priority (Quick, Scheduled, 1st Priority, etc.)')\n .option('--due <date>', 'Due date (YYYY-MM-DD)')\n .option('--effort <minutes>', 'Effort estimate in minutes', parseInt)\n .option('--ticket <id>', 'Link action to a product ticket (CUID) after creation')\n .option('--epic <id>', 'Epic CUID to attach the action to')\n .action(async (options: {\n name: string;\n description?: string;\n project?: string;\n priority?: string;\n due?: string;\n effort?: number;\n ticket?: string;\n epic?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n // Validate priority if provided\n if (options.priority && !VALID_PRIORITIES.includes(options.priority as Priority)) {\n throw new Error(`Invalid priority \"${options.priority}\". Valid values: ${VALID_PRIORITIES.join(', ')}`);\n }\n\n // Parse due date if provided\n let dueDate: Date | undefined;\n if (options.due) {\n dueDate = new Date(options.due);\n if (isNaN(dueDate.getTime())) {\n throw new Error('Invalid due date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n let action = await client.actions.create({\n name: options.name,\n description: options.description,\n projectId: options.project,\n priority: options.priority as Priority | undefined,\n dueDate,\n effortEstimate: options.effort,\n epicId: options.epic,\n });\n\n // The server's action.create router doesn't accept ticketId, so when\n // --ticket is requested we link via the product.ticket.linkAction RPC\n // and re-use its updated return value.\n if (options.ticket) {\n action = await client.tickets.linkAction(options.ticket, action.id);\n }\n\n if (useJson) {\n outputActionJson(action);\n } else {\n console.log('\\n✓ Action created successfully');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n const comment = new Command('comment')\n .description('Manage comments on an action');\n\n comment\n .command('list')\n .description('List comments on an action')\n .requiredOption('--id <id>', 'Action ID')\n .action(async (options: { id: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const comments = await client.actionComments.list(options.id);\n if (useJson) outputCommentsJson(comments);\n else outputCommentsPretty(comments);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('add')\n .description('Add a comment to an action')\n .requiredOption('--id <id>', 'Action ID')\n .requiredOption('-m, --message <text>', 'Comment content (markdown supported)')\n .action(async (options: { id: string; message: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const created = await client.actionComments.add({\n actionId: options.id,\n content: options.message,\n });\n if (useJson) {\n outputCommentJson(created);\n } else {\n console.log('\\n✓ Comment added');\n outputCommentPretty(created);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('update')\n .description(\"Update one of your own comments\")\n .requiredOption('--comment-id <id>', 'Comment ID')\n .requiredOption('-m, --message <text>', 'New comment content')\n .action(async (options: { commentId: string; message: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const updated = await client.actionComments.update({\n commentId: options.commentId,\n content: options.message,\n });\n if (useJson) {\n outputCommentJson(updated);\n } else {\n console.log('\\n✓ Comment updated');\n outputCommentPretty(updated);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('delete')\n .description(\"Delete one of your own comments\")\n .requiredOption('--comment-id <id>', 'Comment ID')\n .action(async (options: { commentId: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.actionComments.delete(options.commentId);\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id: options.commentId }, null, 2));\n } else {\n console.log('\\n✓ Comment deleted');\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n actions.addCommand(comment);\n\n return actions;\n}\n","import chalk from 'chalk';\nimport type {\n Action,\n ActionComment,\n ActionOutput,\n ActionsListOutput,\n Contact,\n ContactInteraction,\n Deal,\n Epic,\n Feature,\n FeatureScope,\n KnowledgePage,\n Organization,\n Pipeline,\n PipelineStage,\n Product,\n Project,\n ProjectOutput,\n ProjectsListOutput,\n Requirement,\n Ticket,\n TicketComment,\n TicketDetail,\n UserStory,\n Workspace,\n WorkspaceOutput,\n WorkspacesListOutput,\n} from 'exponential-sdk';\n\n// Detect if output is being piped\nexport function shouldUseJson(forceJson?: boolean, forcePretty?: boolean): boolean {\n if (forceJson) return true;\n if (forcePretty) return false;\n return !process.stdout.isTTY;\n}\n\n// Transform Action to ActionOutput (serialize dates)\nexport function transformAction(action: Action): ActionOutput {\n return {\n id: action.id,\n name: action.name,\n description: action.description,\n status: action.status,\n priority: action.priority,\n kanbanStatus: action.kanbanStatus,\n dueDate: action.dueDate?.toISOString() ?? null,\n scheduledStart: action.scheduledStart?.toISOString() ?? null,\n scheduledEnd: action.scheduledEnd?.toISOString() ?? null,\n project: action.project ? {\n id: action.project.id,\n name: action.project.name,\n } : null,\n workspace: action.workspace ? {\n id: action.workspace.id,\n slug: action.workspace.slug,\n name: action.workspace.name,\n } : null,\n assignees: action.assignees?.map(a => ({\n id: a.user.id,\n name: a.user.name,\n email: a.user.email,\n })) ?? [],\n createdAt: action.createdAt?.toISOString() ?? new Date().toISOString(),\n completedAt: action.completedAt?.toISOString() ?? null,\n };\n}\n\n// Transform Project to ProjectOutput\nexport function transformProject(project: Project): ProjectOutput {\n return {\n id: project.id,\n name: project.name,\n description: project.description,\n status: project.status,\n priority: project.priority,\n workspace: project.workspace ? {\n id: project.workspace.id,\n slug: project.workspace.slug,\n name: project.workspace.name,\n } : null,\n };\n}\n\n// Transform Workspace to WorkspaceOutput\nexport function transformWorkspace(workspace: Workspace): WorkspaceOutput {\n return {\n id: workspace.id,\n name: workspace.name,\n slug: workspace.slug,\n type: workspace.type,\n };\n}\n\n// Output single action as JSON\nexport function outputActionJson(action: Action): void {\n const output = transformAction(action);\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output single action in pretty format\nexport function outputActionPretty(action: Action): void {\n const statusColor = getKanbanStatusColor(action.kanbanStatus);\n const statusBadge = action.kanbanStatus\n ? chalk[statusColor](`[${action.kanbanStatus}]`)\n : chalk.gray('[NO STATUS]');\n\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${statusBadge} ${chalk.bold(action.name)}`);\n console.log(chalk.gray(` ID: ${action.id}`));\n\n if (action.project) {\n console.log(` ${chalk.cyan('Project:')} ${action.project.name}`);\n }\n\n console.log(` ${chalk.magenta('Priority:')} ${action.priority}`);\n\n if (action.dueDate) {\n const dueDate = new Date(action.dueDate);\n console.log(` ${chalk.yellow('Due:')} ${formatDate(dueDate)}`);\n }\n\n if (action.description) {\n console.log(` ${chalk.gray('Description:')} ${action.description.substring(0, 100)}${action.description.length > 100 ? '...' : ''}`);\n }\n console.log();\n}\n\n// Output actions as JSON\nexport function outputActionsJson(actions: Action[], filters: ActionsListOutput['filters'] = {}): void {\n const output: ActionsListOutput = {\n actions: actions.map(transformAction),\n total: actions.length,\n filters,\n };\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output actions in pretty format\nexport function outputActionsPretty(actions: Action[]): void {\n if (actions.length === 0) {\n console.log(chalk.gray('No actions found.'));\n return;\n }\n\n console.log(chalk.bold(`\\nActions (${actions.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n\n for (const action of actions) {\n const statusColor = getKanbanStatusColor(action.kanbanStatus);\n const statusBadge = action.kanbanStatus\n ? chalk[statusColor](`[${action.kanbanStatus}]`)\n : chalk.gray('[NO STATUS]');\n\n console.log(`\\n${statusBadge} ${chalk.bold(action.name)}`);\n console.log(chalk.gray(` ID: ${action.id}`));\n\n if (action.project) {\n console.log(` ${chalk.cyan('Project:')} ${action.project.name}`);\n }\n\n console.log(` ${chalk.magenta('Priority:')} ${action.priority}`);\n\n if (action.dueDate) {\n const dueDate = new Date(action.dueDate);\n const isOverdue = dueDate < new Date();\n const dateStr = formatDate(dueDate);\n console.log(` ${chalk.yellow('Due:')} ${isOverdue ? chalk.red(dateStr) : dateStr}`);\n }\n\n if (action.description) {\n console.log(` ${chalk.gray('Description:')} ${action.description.substring(0, 100)}${action.description.length > 100 ? '...' : ''}`);\n }\n }\n console.log();\n}\n\n// Output projects as JSON\nexport function outputProjectsJson(projects: Project[]): void {\n const output: ProjectsListOutput = {\n projects: projects.map(transformProject),\n total: projects.length,\n };\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output projects in pretty format\nexport function outputProjectsPretty(projects: Project[]): void {\n if (projects.length === 0) {\n console.log(chalk.gray('No projects found.'));\n return;\n }\n\n console.log(chalk.bold(`\\nProjects (${projects.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n\n for (const project of projects) {\n console.log(`\\n${chalk.bold(project.name)}`);\n console.log(chalk.gray(` ID: ${project.id}`));\n\n if (project.status) {\n console.log(` ${chalk.cyan('Status:')} ${project.status}`);\n }\n\n if (project.priority) {\n console.log(` ${chalk.magenta('Priority:')} ${project.priority}`);\n }\n\n if (project.workspace) {\n console.log(` ${chalk.yellow('Workspace:')} ${project.workspace.name} (${project.workspace.slug})`);\n }\n\n if (project.description) {\n console.log(` ${chalk.gray('Description:')} ${project.description.substring(0, 100)}${project.description.length > 100 ? '...' : ''}`);\n }\n }\n console.log();\n}\n\n// Output workspaces as JSON\nexport function outputWorkspacesJson(workspaces: Workspace[]): void {\n const output: WorkspacesListOutput = {\n workspaces: workspaces.map(transformWorkspace),\n total: workspaces.length,\n };\n console.log(JSON.stringify(output, null, 2));\n}\n\n// Output workspaces in pretty format\nexport function outputWorkspacesPretty(workspaces: Workspace[]): void {\n if (workspaces.length === 0) {\n console.log(chalk.gray('No workspaces found.'));\n return;\n }\n\n console.log(chalk.bold(`\\nWorkspaces (${workspaces.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n\n for (const workspace of workspaces) {\n console.log(`\\n${chalk.bold(workspace.name)}`);\n console.log(chalk.gray(` ID: ${workspace.id}`));\n console.log(` ${chalk.cyan('Slug:')} ${workspace.slug}`);\n console.log(` ${chalk.magenta('Type:')} ${workspace.type}`);\n }\n console.log();\n}\n\n// Helper functions\nfunction getKanbanStatusColor(status: string | null): 'gray' | 'blue' | 'yellow' | 'cyan' | 'green' | 'red' {\n switch (status) {\n case 'BACKLOG': return 'gray';\n case 'TODO': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'IN_REVIEW': return 'cyan';\n case 'DONE': return 'green';\n case 'CANCELLED': return 'red';\n default: return 'gray';\n }\n}\n\nfunction formatDate(date: Date): string {\n return date.toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n}\n\n// ─── Contact output ────────────────────────────────────────\n\nexport function outputContactJson(contact: Contact): void {\n console.log(JSON.stringify(transformContact(contact), null, 2));\n}\n\nexport function outputContactPretty(contact: Contact): void {\n const name = [contact.firstName, contact.lastName].filter(Boolean).join(' ') || chalk.gray('(no name)');\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(name)}`);\n console.log(chalk.gray(` ID: ${contact.id}`));\n if (contact.email) console.log(` ${chalk.cyan('Email:')} ${contact.email}`);\n if (contact.phone) console.log(` ${chalk.cyan('Phone:')} ${contact.phone}`);\n if (contact.telegram) console.log(` ${chalk.cyan('Telegram:')} ${contact.telegram}`);\n if (contact.linkedIn) console.log(` ${chalk.cyan('LinkedIn:')} ${contact.linkedIn}`);\n if (contact.twitter) console.log(` ${chalk.cyan('Twitter:')} ${contact.twitter}`);\n if (contact.github) console.log(` ${chalk.cyan('GitHub:')} ${contact.github}`);\n if (contact.bluesky) console.log(` ${chalk.cyan('Bluesky:')} ${contact.bluesky}`);\n if (contact.about) console.log(` ${chalk.gray('About:')} ${contact.about.substring(0, 120)}${contact.about.length > 120 ? '...' : ''}`);\n if (contact.profileType) console.log(` ${chalk.magenta('Type:')} ${contact.profileType}`);\n if (contact.skills?.length) console.log(` ${chalk.yellow('Skills:')} ${contact.skills.join(', ')}`);\n if (contact.tags?.length) console.log(` ${chalk.yellow('Tags:')} ${contact.tags.join(', ')}`);\n if (contact.organization) console.log(` ${chalk.green('Org:')} ${contact.organization.name}`);\n if (contact.connectionScore != null) console.log(` ${chalk.blue('Connection Score:')} ${contact.connectionScore}`);\n if (contact.lastInteractionAt) console.log(` ${chalk.gray('Last Interaction:')} ${formatDate(new Date(contact.lastInteractionAt))} (${contact.lastInteractionType ?? ''})`);\n console.log();\n}\n\nexport function outputContactsJson(contacts: Contact[], nextCursor?: string): void {\n console.log(JSON.stringify({\n contacts: contacts.map(transformContact),\n total: contacts.length,\n nextCursor: nextCursor ?? null,\n }, null, 2));\n}\n\nexport function outputContactsPretty(contacts: Contact[]): void {\n if (contacts.length === 0) {\n console.log(chalk.gray('No contacts found.'));\n return;\n }\n console.log(chalk.bold(`\\nContacts (${contacts.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const contact of contacts) {\n const name = [contact.firstName, contact.lastName].filter(Boolean).join(' ') || chalk.gray('(no name)');\n console.log(`\\n${chalk.bold(name)}`);\n console.log(chalk.gray(` ID: ${contact.id}`));\n if (contact.email) console.log(` ${chalk.cyan('Email:')} ${contact.email}`);\n if (contact.organization) console.log(` ${chalk.green('Org:')} ${contact.organization.name}`);\n if (contact.tags?.length) console.log(` ${chalk.yellow('Tags:')} ${contact.tags.join(', ')}`);\n }\n console.log();\n}\n\nfunction transformContact(contact: Contact): Record<string, unknown> {\n return {\n id: contact.id,\n workspaceId: contact.workspaceId,\n firstName: contact.firstName,\n lastName: contact.lastName,\n email: contact.email,\n phone: contact.phone,\n linkedIn: contact.linkedIn,\n telegram: contact.telegram,\n twitter: contact.twitter,\n github: contact.github,\n bluesky: contact.bluesky,\n about: contact.about,\n profileType: contact.profileType,\n skills: contact.skills,\n tags: contact.tags,\n organizationId: contact.organizationId,\n organization: contact.organization ?? null,\n connectionScore: contact.connectionScore,\n lastInteractionAt: contact.lastInteractionAt ? new Date(contact.lastInteractionAt).toISOString() : null,\n lastInteractionType: contact.lastInteractionType,\n createdAt: new Date(contact.createdAt).toISOString(),\n updatedAt: new Date(contact.updatedAt).toISOString(),\n };\n}\n\n// ─── Interaction output ────────────────────────────────────\n\nexport function outputInteractionJson(interaction: ContactInteraction): void {\n console.log(JSON.stringify(interaction, null, 2));\n}\n\nexport function outputInteractionPretty(interaction: ContactInteraction): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(` ${chalk.cyan('Type:')} ${interaction.type} (${interaction.direction})`);\n if (interaction.subject) console.log(` ${chalk.bold('Subject:')} ${interaction.subject}`);\n if (interaction.notes) console.log(` ${chalk.gray('Notes:')} ${interaction.notes}`);\n console.log();\n}\n\n// ─── Organization output ───────────────────────────────────\n\nfunction transformOrganization(org: Organization): Record<string, unknown> {\n return {\n id: org.id,\n workspaceId: org.workspaceId,\n name: org.name,\n websiteUrl: org.websiteUrl,\n logoUrl: org.logoUrl,\n description: org.description,\n industry: org.industry,\n size: org.size,\n contactCount: org._count?.contacts ?? null,\n createdAt: new Date(org.createdAt).toISOString(),\n updatedAt: new Date(org.updatedAt).toISOString(),\n };\n}\n\nexport function outputOrganizationJson(org: Organization): void {\n console.log(JSON.stringify(transformOrganization(org), null, 2));\n}\n\nexport function outputOrganizationPretty(org: Organization): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(org.name)}`);\n console.log(chalk.gray(` ID: ${org.id}`));\n if (org.industry) console.log(` ${chalk.magenta('Industry:')} ${org.industry}`);\n if (org.size) console.log(` ${chalk.cyan('Size:')} ${org.size}`);\n if (org.websiteUrl) console.log(` ${chalk.cyan('Website:')} ${org.websiteUrl}`);\n if (org.description) console.log(` ${chalk.gray('About:')} ${org.description.substring(0, 120)}${org.description.length > 120 ? '...' : ''}`);\n if (org._count?.contacts != null) console.log(` ${chalk.green('Contacts:')} ${org._count.contacts}`);\n console.log();\n}\n\nexport function outputOrganizationsJson(organizations: Organization[], nextCursor?: string): void {\n console.log(JSON.stringify({\n organizations: organizations.map(transformOrganization),\n total: organizations.length,\n nextCursor: nextCursor ?? null,\n }, null, 2));\n}\n\nexport function outputOrganizationsPretty(organizations: Organization[]): void {\n if (organizations.length === 0) {\n console.log(chalk.gray('No organizations found.'));\n return;\n }\n console.log(chalk.bold(`\\nOrganizations (${organizations.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const org of organizations) {\n console.log(`\\n${chalk.bold(org.name)}`);\n console.log(chalk.gray(` ID: ${org.id}`));\n if (org.industry) console.log(` ${chalk.magenta('Industry:')} ${org.industry}`);\n if (org._count?.contacts != null) console.log(` ${chalk.green('Contacts:')} ${org._count.contacts}`);\n }\n console.log();\n}\n\n// ─── Deal output ───────────────────────────────────────────\n\nexport function outputDealJson(deal: Deal): void {\n console.log(JSON.stringify(transformDeal(deal), null, 2));\n}\n\nexport function outputDealPretty(deal: Deal): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(deal.title)}`);\n console.log(chalk.gray(` ID: ${deal.id}`));\n if (deal.stage) console.log(` ${chalk.blue('Stage:')} ${deal.stage.name}`);\n if (deal.value != null) console.log(` ${chalk.green('Value:')} ${deal.currency} ${deal.value.toLocaleString()}`);\n if (deal.probability != null) console.log(` ${chalk.yellow('Probability:')} ${deal.probability}%`);\n if (deal.expectedCloseDate) console.log(` ${chalk.cyan('Expected Close:')} ${formatDate(new Date(deal.expectedCloseDate))}`);\n if (deal.contact) {\n const name = [deal.contact.firstName, deal.contact.lastName].filter(Boolean).join(' ');\n if (name) console.log(` ${chalk.magenta('Contact:')} ${name}`);\n }\n if (deal.organization) console.log(` ${chalk.magenta('Org:')} ${deal.organization.name}`);\n if (deal.assignedTo) console.log(` ${chalk.gray('Assigned:')} ${deal.assignedTo.name ?? deal.assignedTo.email ?? deal.assignedTo.id}`);\n if (deal.description) console.log(` ${chalk.gray('Description:')} ${deal.description.substring(0, 120)}${deal.description.length > 120 ? '...' : ''}`);\n console.log();\n}\n\nexport function outputDealsJson(deals: Deal[]): void {\n console.log(JSON.stringify({\n deals: deals.map(transformDeal),\n total: deals.length,\n }, null, 2));\n}\n\nexport function outputDealsPretty(deals: Deal[]): void {\n if (deals.length === 0) {\n console.log(chalk.gray('No deals found.'));\n return;\n }\n console.log(chalk.bold(`\\nDeals (${deals.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const deal of deals) {\n const stageLabel = deal.stage ? chalk.blue(`[${deal.stage.name}]`) : '';\n const valueLabel = deal.value != null ? chalk.green(` ${deal.currency} ${deal.value.toLocaleString()}`) : '';\n console.log(`\\n${stageLabel} ${chalk.bold(deal.title)}${valueLabel}`);\n console.log(chalk.gray(` ID: ${deal.id}`));\n if (deal.contact) {\n const name = [deal.contact.firstName, deal.contact.lastName].filter(Boolean).join(' ');\n if (name) console.log(` ${chalk.magenta('Contact:')} ${name}`);\n }\n if (deal.probability != null) console.log(` ${chalk.yellow('Probability:')} ${deal.probability}%`);\n if (deal.expectedCloseDate) console.log(` ${chalk.cyan('Close:')} ${formatDate(new Date(deal.expectedCloseDate))}`);\n }\n console.log();\n}\n\nfunction transformDeal(deal: Deal): Record<string, unknown> {\n return {\n id: deal.id,\n projectId: deal.projectId,\n stageId: deal.stageId,\n title: deal.title,\n description: deal.description,\n value: deal.value,\n currency: deal.currency,\n probability: deal.probability,\n expectedCloseDate: deal.expectedCloseDate ? new Date(deal.expectedCloseDate).toISOString() : null,\n closedAt: deal.closedAt ? new Date(deal.closedAt).toISOString() : null,\n contactId: deal.contactId,\n organizationId: deal.organizationId,\n workspaceId: deal.workspaceId,\n assignedToId: deal.assignedToId,\n stage: deal.stage ? { id: deal.stage.id, name: deal.stage.name, color: deal.stage.color } : null,\n contact: deal.contact ?? null,\n organization: deal.organization ?? null,\n assignedTo: deal.assignedTo ?? null,\n createdAt: new Date(deal.createdAt).toISOString(),\n updatedAt: new Date(deal.updatedAt).toISOString(),\n };\n}\n\n// ─── Pipeline output ───────────────────────────────────────\n\nexport function outputPipelineJson(pipeline: Pipeline): void {\n console.log(JSON.stringify({\n id: pipeline.id,\n name: pipeline.name,\n workspaceId: pipeline.workspaceId,\n status: pipeline.status,\n stages: pipeline.pipelineStages.map(s => ({\n id: s.id,\n name: s.name,\n color: s.color,\n order: s.order,\n type: s.type,\n dealCount: s._count?.deals ?? null,\n })),\n }, null, 2));\n}\n\nexport function outputPipelinePretty(pipeline: Pipeline): void {\n console.log(chalk.bold(`\\nPipeline: ${pipeline.name}`));\n console.log(chalk.gray(` ID: ${pipeline.id}`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const stage of pipeline.pipelineStages) {\n const count = stage._count?.deals != null ? chalk.gray(` (${stage._count.deals} deals)`) : '';\n console.log(` ${chalk.bold(stage.name)}${count} — ${chalk.gray(stage.type)}`);\n }\n console.log();\n}\n\nexport function outputStagesJson(stages: PipelineStage[]): void {\n console.log(JSON.stringify({\n stages: stages.map(s => ({\n id: s.id,\n name: s.name,\n color: s.color,\n order: s.order,\n type: s.type,\n dealCount: s._count?.deals ?? null,\n })),\n total: stages.length,\n }, null, 2));\n}\n\n// ─── Comment output ────────────────────────────────────────\n\ntype AnyComment = ActionComment | TicketComment;\n\nfunction transformComment(comment: AnyComment): Record<string, unknown> {\n const parentKey = 'actionId' in comment ? 'actionId' : 'ticketId';\n const parentId = (comment as unknown as Record<string, unknown>)[parentKey];\n return {\n id: comment.id,\n [parentKey]: parentId,\n authorId: comment.authorId,\n content: comment.content,\n author: comment.author,\n createdAt: new Date(comment.createdAt).toISOString(),\n updatedAt: new Date(comment.updatedAt).toISOString(),\n };\n}\n\nexport function outputCommentJson(comment: AnyComment): void {\n console.log(JSON.stringify(transformComment(comment), null, 2));\n}\n\nexport function outputCommentPretty(comment: AnyComment): void {\n const author = comment.author?.name ?? comment.authorId;\n const when = formatDate(new Date(comment.createdAt));\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`${chalk.bold(author)} ${chalk.gray(`— ${when}`)}`);\n console.log(chalk.gray(` ID: ${comment.id}`));\n console.log();\n console.log(comment.content);\n console.log();\n}\n\nexport function outputCommentsJson(comments: AnyComment[]): void {\n console.log(JSON.stringify({\n comments: comments.map(transformComment),\n total: comments.length,\n }, null, 2));\n}\n\nexport function outputCommentsPretty(comments: AnyComment[]): void {\n if (comments.length === 0) {\n console.log(chalk.gray('No comments.'));\n return;\n }\n console.log(chalk.bold(`\\nComments (${comments.length})`));\n for (const c of comments) {\n outputCommentPretty(c);\n }\n}\n\n// ─── Product output ────────────────────────────────────────\n\nexport function outputProductJson(product: Product): void {\n console.log(JSON.stringify(transformProduct(product), null, 2));\n}\n\nexport function outputProductPretty(product: Product): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(product.name)} ${chalk.gray(`(${product.slug})`)}`);\n console.log(chalk.gray(` ID: ${product.id}`));\n if (product.description) {\n console.log(` ${chalk.gray('Description:')} ${product.description}`);\n }\n if (product._count) {\n const c = product._count;\n const parts = [\n c.features != null ? `features: ${c.features}` : null,\n c.tickets != null ? `tickets: ${c.tickets}` : null,\n ].filter(Boolean);\n if (parts.length) console.log(` ${chalk.cyan('Counts:')} ${parts.join(' ')}`);\n }\n console.log();\n}\n\nexport function outputProductsJson(products: Product[]): void {\n console.log(JSON.stringify({\n products: products.map(transformProduct),\n total: products.length,\n }, null, 2));\n}\n\nexport function outputProductsPretty(products: Product[]): void {\n if (products.length === 0) {\n console.log(chalk.gray('No products found.'));\n return;\n }\n console.log(chalk.bold(`\\nProducts (${products.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const p of products) {\n const ticketCount = p._count?.tickets != null ? chalk.gray(` — ${p._count.tickets} tickets`) : '';\n console.log(` ${chalk.bold(p.name)} ${chalk.gray(`(${p.slug})`)}${ticketCount}`);\n console.log(chalk.gray(` ID: ${p.id}`));\n }\n console.log();\n}\n\nfunction transformProduct(product: Product): Record<string, unknown> {\n return {\n id: product.id,\n workspaceId: product.workspaceId,\n name: product.name,\n slug: product.slug,\n description: product.description,\n icon: product.icon,\n color: product.color,\n funTicketIds: product.funTicketIds,\n ticketCounter: product.ticketCounter,\n counts: product._count ?? null,\n createdAt: new Date(product.createdAt).toISOString(),\n updatedAt: new Date(product.updatedAt).toISOString(),\n };\n}\n\n// ─── Feature output ────────────────────────────────────────\n\nexport function outputFeatureJson(feature: Feature): void {\n console.log(JSON.stringify(transformFeature(feature), null, 2));\n}\n\nexport function outputFeaturePretty(feature: Feature): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk[getFeatureStatusColor(feature.status)](`[${feature.status}]`)} ${chalk.bold(feature.name)}`);\n console.log(chalk.gray(` ID: ${feature.id}`));\n if (feature.description) {\n console.log(` ${chalk.gray('Description:')} ${feature.description.substring(0, 120)}${feature.description.length > 120 ? '...' : ''}`);\n }\n if (feature.vision) {\n console.log(` ${chalk.gray('Vision:')} ${feature.vision.substring(0, 120)}${feature.vision.length > 120 ? '...' : ''}`);\n }\n if (feature.priority != null) {\n console.log(` ${chalk.magenta('Priority:')} ${feature.priority}`);\n }\n if (feature._count?.tickets != null) {\n console.log(` ${chalk.cyan('Tickets:')} ${feature._count.tickets}`);\n }\n console.log();\n}\n\nexport function outputFeaturesJson(features: Feature[]): void {\n console.log(JSON.stringify({\n features: features.map(transformFeature),\n total: features.length,\n }, null, 2));\n}\n\nexport function outputFeaturesPretty(features: Feature[]): void {\n if (features.length === 0) {\n console.log(chalk.gray('No features found.'));\n return;\n }\n console.log(chalk.bold(`\\nFeatures (${features.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const f of features) {\n const statusBadge = chalk[getFeatureStatusColor(f.status)](`[${f.status}]`);\n const ticketCount = f._count?.tickets != null ? chalk.gray(` — ${f._count.tickets} tickets`) : '';\n console.log(` ${statusBadge} ${chalk.bold(f.name)}${ticketCount}`);\n console.log(chalk.gray(` ID: ${f.id}`));\n }\n console.log();\n}\n\nfunction transformFeature(feature: Feature): Record<string, unknown> {\n return {\n id: feature.id,\n productId: feature.productId,\n name: feature.name,\n description: feature.description,\n vision: feature.vision,\n status: feature.status,\n effort: feature.effort,\n priority: feature.priority,\n goalId: feature.goalId,\n goal: feature.goal ?? null,\n counts: feature._count ?? null,\n createdAt: new Date(feature.createdAt).toISOString(),\n updatedAt: new Date(feature.updatedAt).toISOString(),\n };\n}\n\nfunction getFeatureStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'green' | 'red' {\n switch (status) {\n case 'IDEA': return 'gray';\n case 'DEFINED': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'SHIPPED': return 'green';\n case 'ARCHIVED': return 'red';\n default: return 'gray';\n }\n}\n\n// ─── User story output ─────────────────────────────────────\n\nfunction transformUserStory(story: UserStory): Record<string, unknown> {\n return {\n id: story.id,\n featureId: story.featureId,\n scopeId: story.scopeId,\n asA: story.asA,\n iWant: story.iWant,\n soThat: story.soThat,\n acceptanceCriteria: story.acceptanceCriteria,\n displayOrder: story.displayOrder,\n createdAt: new Date(story.createdAt).toISOString(),\n updatedAt: new Date(story.updatedAt).toISOString(),\n };\n}\n\nexport function outputUserStoryJson(story: UserStory): void {\n console.log(JSON.stringify(transformUserStory(story), null, 2));\n}\n\nexport function outputUserStoryPretty(story: UserStory): void {\n console.log(chalk.gray('─'.repeat(50)));\n const order = chalk.gray(`#${story.displayOrder}`);\n console.log(`\\n${order} ${chalk.bold(story.iWant ?? '(no \"I want\")')}`);\n console.log(chalk.gray(` ID: ${story.id}`));\n if (story.asA) console.log(` ${chalk.cyan('As a:')} ${story.asA}`);\n if (story.iWant) console.log(` ${chalk.cyan('I want:')} ${story.iWant}`);\n if (story.soThat) console.log(` ${chalk.cyan('So that:')} ${story.soThat}`);\n if (story.acceptanceCriteria) {\n console.log(` ${chalk.yellow('Acceptance:')} ${story.acceptanceCriteria}`);\n }\n if (story.scopeId) console.log(` ${chalk.magenta('Scope:')} ${story.scopeId}`);\n console.log();\n}\n\nexport function outputUserStoriesJson(stories: UserStory[]): void {\n console.log(JSON.stringify({\n userStories: stories.map(transformUserStory),\n total: stories.length,\n }, null, 2));\n}\n\nexport function outputUserStoriesPretty(stories: UserStory[]): void {\n if (stories.length === 0) {\n console.log(chalk.gray('No user stories found.'));\n return;\n }\n console.log(chalk.bold(`\\nUser stories (${stories.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const story of stories) {\n const order = chalk.gray(`#${story.displayOrder}`);\n const parts = [\n story.asA ? `As a ${story.asA},` : null,\n story.iWant ? `I want ${story.iWant},` : null,\n story.soThat ? `so that ${story.soThat}.` : null,\n ].filter(Boolean).join(' ');\n console.log(` ${order} ${parts || chalk.gray('(empty)')}`);\n console.log(chalk.gray(` ID: ${story.id}`));\n }\n console.log();\n}\n\n// Output a batch add summary (per-item success/failure).\nexport interface BatchStoryResult {\n index: number;\n ok: boolean;\n id?: string;\n error?: string;\n}\n\nexport function outputBatchResultsJson(results: BatchStoryResult[]): void {\n const succeeded = results.filter((r) => r.ok).length;\n console.log(JSON.stringify({\n results,\n total: results.length,\n succeeded,\n failed: results.length - succeeded,\n }, null, 2));\n}\n\nexport function outputBatchResultsPretty(results: BatchStoryResult[]): void {\n const succeeded = results.filter((r) => r.ok).length;\n console.log(chalk.bold(`\\nAdded ${succeeded}/${results.length} user stories`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const r of results) {\n if (r.ok) {\n console.log(` ${chalk.green('✓')} [${r.index}] ${chalk.gray(r.id ?? '')}`);\n } else {\n console.log(` ${chalk.red('✗')} [${r.index}] ${r.error ?? 'failed'}`);\n }\n }\n console.log();\n}\n\n// ─── Ticket output ─────────────────────────────────────────\n\nexport function outputTicketJson(ticket: Ticket | TicketDetail): void {\n console.log(JSON.stringify(transformTicket(ticket), null, 2));\n}\n\nexport function outputTicketPretty(ticket: Ticket | TicketDetail): void {\n const id = ticket.shortId ?? (ticket.number != null ? `#${ticket.number}` : '?');\n console.log(chalk.gray('─'.repeat(50)));\n console.log(\n `\\n${chalk[getTicketStatusColor(ticket.status)](`[${ticket.status}]`)} ${chalk.gray(`[${ticket.type}]`)} ${chalk.bold(`${id} ${ticket.title}`)}`,\n );\n console.log(chalk.gray(` ID: ${ticket.id}`));\n if (ticket.isBlocked) {\n console.log(` ${chalk.red('BLOCKED')} by ${ticket.openBlockerCount ?? 0} open ticket(s)`);\n } else if (ticket.openBlockerCount && ticket.openBlockerCount > 0) {\n console.log(` ${chalk.yellow('Blockers:')} ${ticket.openBlockerCount} open (not currently in flight)`);\n }\n if (ticket.feature) {\n console.log(` ${chalk.cyan('Feature:')} ${ticket.feature.name}`);\n }\n if (ticket.epic) {\n console.log(` ${chalk.cyan('Epic:')} ${ticket.epic.name}`);\n }\n if (ticket.assignee) {\n console.log(` ${chalk.magenta('Assignee:')} ${ticket.assignee.name ?? ticket.assignee.id}`);\n }\n if (ticket.priority != null) {\n console.log(` ${chalk.magenta('Priority:')} ${ticket.priority}`);\n }\n if (ticket.points != null) {\n console.log(` ${chalk.yellow('Points:')} ${ticket.points}`);\n }\n if (ticket.body) {\n console.log(` ${chalk.gray('Body:')} ${ticket.body.substring(0, 200)}${ticket.body.length > 200 ? '...' : ''}`);\n }\n\n const detail = ticket as TicketDetail;\n if (detail.dependsOn && detail.dependsOn.length > 0) {\n console.log(` ${chalk.cyan('Depends on:')}`);\n for (const dep of detail.dependsOn) {\n const depId = dep.shortId ?? (dep.number != null ? `#${dep.number}` : '?');\n console.log(` - ${chalk.gray(`[${dep.status}]`)} ${depId} ${dep.title}`);\n }\n }\n if (detail.requiredFor && detail.requiredFor.length > 0) {\n console.log(` ${chalk.cyan('Required for:')}`);\n for (const dep of detail.requiredFor) {\n const depId = dep.shortId ?? (dep.number != null ? `#${dep.number}` : '?');\n console.log(` - ${chalk.gray(`[${dep.status}]`)} ${depId} ${dep.title}`);\n }\n }\n if (detail.actions && detail.actions.length > 0) {\n console.log(` ${chalk.cyan('Actions:')} ${detail.actions.length}`);\n for (const a of detail.actions) {\n console.log(` - ${chalk.gray(`[${a.kanbanStatus ?? a.status}]`)} ${a.name} ${chalk.gray(`(${a.id})`)}`);\n }\n }\n console.log();\n}\n\nexport function outputTicketsJson(tickets: Ticket[]): void {\n console.log(JSON.stringify({\n tickets: tickets.map(transformTicket),\n total: tickets.length,\n }, null, 2));\n}\n\nexport function outputTicketsPretty(tickets: Ticket[]): void {\n if (tickets.length === 0) {\n console.log(chalk.gray('No tickets found.'));\n return;\n }\n console.log(chalk.bold(`\\nTickets (${tickets.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const t of tickets) {\n const id = t.shortId ?? (t.number != null ? `#${t.number}` : '?');\n const statusBadge = chalk[getTicketStatusColor(t.status)](`[${t.status}]`);\n const typeBadge = chalk.gray(`[${t.type}]`);\n const blocked = t.isBlocked ? chalk.red(' BLOCKED') : '';\n console.log(` ${statusBadge} ${typeBadge} ${chalk.bold(id)} ${t.title}${blocked}`);\n console.log(chalk.gray(` ID: ${t.id}`));\n }\n console.log();\n}\n\nfunction transformTicket(ticket: Ticket | TicketDetail): Record<string, unknown> {\n const detail = ticket as TicketDetail;\n return {\n id: ticket.id,\n productId: ticket.productId,\n number: ticket.number,\n shortId: ticket.shortId,\n title: ticket.title,\n body: ticket.body,\n type: ticket.type,\n status: ticket.status,\n priority: ticket.priority,\n points: ticket.points,\n branchName: ticket.branchName,\n prUrl: ticket.prUrl,\n designUrl: ticket.designUrl,\n specUrl: ticket.specUrl,\n links: ticket.links,\n epicId: ticket.epicId,\n featureId: ticket.featureId,\n cycleId: ticket.cycleId,\n scopeId: ticket.scopeId,\n assigneeId: ticket.assigneeId,\n assignee: ticket.assignee ?? null,\n feature: ticket.feature ?? null,\n epic: ticket.epic ?? null,\n openBlockerCount: ticket.openBlockerCount ?? 0,\n isBlocked: ticket.isBlocked ?? false,\n counts: ticket._count ?? null,\n dependsOn: detail.dependsOn ?? undefined,\n requiredFor: detail.requiredFor ?? undefined,\n actions: detail.actions?.map((a) => ({\n id: a.id,\n name: a.name,\n status: a.status,\n kanbanStatus: a.kanbanStatus,\n completedAt: a.completedAt ? new Date(a.completedAt).toISOString() : null,\n })),\n completedAt: ticket.completedAt ? new Date(ticket.completedAt).toISOString() : null,\n createdAt: new Date(ticket.createdAt).toISOString(),\n updatedAt: new Date(ticket.updatedAt).toISOString(),\n };\n}\n\nfunction getTicketStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'cyan' | 'green' | 'red' | 'magenta' {\n switch (status) {\n case 'BACKLOG': return 'gray';\n case 'NEEDS_REFINEMENT': return 'gray';\n case 'READY_TO_PLAN': return 'blue';\n case 'COMMITTED': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'BLOCKED': return 'red';\n case 'QA': return 'cyan';\n case 'DONE': return 'green';\n case 'DEPLOYED': return 'green';\n case 'ARCHIVED': return 'gray';\n default: return 'gray';\n }\n}\n\n// ─── Epic output ───────────────────────────────────────────\n\nexport function outputEpicJson(epic: Epic): void {\n console.log(JSON.stringify(transformEpic(epic), null, 2));\n}\n\nexport function outputEpicPretty(epic: Epic): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk[getEpicStatusColor(epic.status)](`[${epic.status}]`)} ${chalk.bold(epic.name)}`);\n console.log(chalk.gray(` ID: ${epic.id}`));\n if (epic.description) {\n console.log(` ${chalk.gray('Description:')} ${epic.description.substring(0, 200)}${epic.description.length > 200 ? '...' : ''}`);\n }\n console.log(` ${chalk.magenta('Priority:')} ${epic.priority}`);\n if (epic.startDate) {\n console.log(` ${chalk.cyan('Start:')} ${formatDate(new Date(epic.startDate))}`);\n }\n if (epic.targetDate) {\n console.log(` ${chalk.cyan('Target:')} ${formatDate(new Date(epic.targetDate))}`);\n }\n if (epic.owner) {\n console.log(` ${chalk.gray('Owner:')} ${epic.owner.name ?? epic.owner.email ?? epic.owner.id}`);\n }\n if (epic._count) {\n const c = epic._count;\n const parts = [\n c.actions != null ? `actions: ${c.actions}` : null,\n c.tickets != null ? `tickets: ${c.tickets}` : null,\n ].filter(Boolean);\n if (parts.length) console.log(` ${chalk.cyan('Counts:')} ${parts.join(' ')}`);\n }\n console.log();\n}\n\nexport function outputEpicsJson(epics: Epic[]): void {\n console.log(JSON.stringify({\n epics: epics.map(transformEpic),\n total: epics.length,\n }, null, 2));\n}\n\nexport function outputEpicsPretty(epics: Epic[]): void {\n if (epics.length === 0) {\n console.log(chalk.gray('No epics found.'));\n return;\n }\n console.log(chalk.bold(`\\nEpics (${epics.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const e of epics) {\n const statusBadge = chalk[getEpicStatusColor(e.status)](`[${e.status}]`);\n const counts = e._count\n ? chalk.gray(\n ` — ${e._count.tickets ?? 0} tickets, ${e._count.actions ?? 0} actions`,\n )\n : '';\n console.log(` ${statusBadge} ${chalk.bold(e.name)}${counts}`);\n console.log(chalk.gray(` ID: ${e.id}`));\n }\n console.log();\n}\n\nfunction transformEpic(epic: Epic): Record<string, unknown> {\n return {\n id: epic.id,\n workspaceId: epic.workspaceId,\n name: epic.name,\n description: epic.description,\n status: epic.status,\n priority: epic.priority,\n startDate: epic.startDate ? new Date(epic.startDate).toISOString() : null,\n targetDate: epic.targetDate ? new Date(epic.targetDate).toISOString() : null,\n ownerId: epic.ownerId,\n owner: epic.owner ?? null,\n counts: epic._count ?? null,\n createdAt: new Date(epic.createdAt).toISOString(),\n updatedAt: new Date(epic.updatedAt).toISOString(),\n };\n}\n\nfunction getEpicStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'green' | 'red' {\n switch (status) {\n case 'OPEN': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'DONE': return 'green';\n case 'CANCELLED': return 'red';\n default: return 'gray';\n }\n}\n\nexport function outputStagesPretty(stages: PipelineStage[]): void {\n if (stages.length === 0) {\n console.log(chalk.gray('No stages found.'));\n return;\n }\n console.log(chalk.bold(`\\nPipeline Stages (${stages.length})`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const stage of stages) {\n const count = stage._count?.deals != null ? chalk.gray(` (${stage._count.deals} deals)`) : '';\n console.log(` ${chalk.bold(stage.name)}${count} — ${chalk.gray(stage.type)}`);\n }\n console.log();\n}\n\n// ---------------------------------------------------------------------------\n// Knowledge pages\n// ---------------------------------------------------------------------------\n\nexport function outputPageJson(page: KnowledgePage): void {\n console.log(JSON.stringify(page, null, 2));\n}\n\nexport function outputPagePretty(page: KnowledgePage): void {\n console.log(chalk.gray('─'.repeat(50)));\n console.log(`\\n${chalk.bold(page.title)}`);\n console.log(chalk.gray(` ID: ${page.id}`));\n if (page.project) {\n console.log(` ${chalk.gray('Project:')} ${page.project.name}`);\n }\n if (page.body) {\n console.log(`\\n${page.body}\\n`);\n }\n}\n\nexport function outputPagesJson(pages: KnowledgePage[]): void {\n console.log(JSON.stringify({ pages, total: pages.length }, null, 2));\n}\n\nexport function outputPagesPretty(pages: KnowledgePage[]): void {\n if (pages.length === 0) {\n console.log(chalk.gray('No pages found.'));\n return;\n }\n console.log(chalk.bold(`\\nPages (${pages.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const p of pages) {\n console.log(` ${chalk.bold(p.title)}`);\n console.log(chalk.gray(` ID: ${p.id}`));\n }\n console.log();\n}\n\n// ---------------------------------------------------------------------------\n// Requirements (EARS)\n// ---------------------------------------------------------------------------\n\nexport function outputRequirementJson(requirement: Requirement): void {\n console.log(JSON.stringify(requirement, null, 2));\n}\n\nexport function outputRequirementPretty(requirement: Requirement): void {\n const met = requirement.checkedAt\n ? chalk.green('[met]')\n : chalk.gray('[unmet]');\n const kind = requirement.kind ? chalk.gray(` (${requirement.kind})`) : '';\n console.log(` ${met} ${requirement.statement}${kind}`);\n console.log(chalk.gray(` ID: ${requirement.id}`));\n}\n\nexport function outputRequirementsJson(requirements: Requirement[]): void {\n console.log(JSON.stringify({ requirements, total: requirements.length }, null, 2));\n}\n\nexport function outputRequirementsPretty(requirements: Requirement[]): void {\n if (requirements.length === 0) {\n console.log(chalk.gray('No requirements found.'));\n return;\n }\n const metCount = requirements.filter((r) => r.checkedAt).length;\n console.log(chalk.bold(`\\nRequirements (${metCount}/${requirements.length} met)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const r of requirements) {\n outputRequirementPretty(r);\n }\n console.log();\n}\n\nexport interface BatchRequirementResult {\n index: number;\n success: boolean;\n requirement?: Requirement;\n error?: string;\n}\n\nexport function outputRequirementBatchJson(results: BatchRequirementResult[]): void {\n console.log(JSON.stringify({\n results,\n total: results.length,\n succeeded: results.filter((r) => r.success).length,\n failed: results.filter((r) => !r.success).length,\n }, null, 2));\n}\n\nexport function outputRequirementBatchPretty(results: BatchRequirementResult[]): void {\n for (const r of results) {\n if (r.success) {\n console.log(` ${chalk.green('✓')} #${r.index}: ${r.requirement?.statement ?? ''}`);\n } else {\n console.log(` ${chalk.red('✗')} #${r.index}: ${r.error ?? 'failed'}`);\n }\n }\n const ok = results.filter((r) => r.success).length;\n console.log(chalk.bold(`\\n${ok}/${results.length} requirements added`));\n}\n\n// ---------------------------------------------------------------------------\n// Feature scopes\n// ---------------------------------------------------------------------------\n\nfunction getScopeStatusColor(status: string): 'gray' | 'blue' | 'yellow' | 'green' | 'red' {\n switch (status) {\n case 'PLANNED': return 'blue';\n case 'IN_PROGRESS': return 'yellow';\n case 'SHIPPED': return 'green';\n case 'DEPRECATED': return 'red';\n default: return 'gray';\n }\n}\n\nexport function outputScopeJson(scope: FeatureScope): void {\n console.log(JSON.stringify(scope, null, 2));\n}\n\nexport function outputScopePretty(scope: FeatureScope): void {\n const badge = chalk[getScopeStatusColor(scope.status)](`[${scope.status}]`);\n console.log(` ${badge} ${chalk.bold(scope.version)}`);\n console.log(chalk.gray(` ID: ${scope.id}`));\n if (scope.description) {\n console.log(` ${scope.description.substring(0, 120)}${scope.description.length > 120 ? '...' : ''}`);\n }\n}\n\nexport function outputScopesJson(scopes: FeatureScope[]): void {\n console.log(JSON.stringify({ scopes, total: scopes.length }, null, 2));\n}\n\nexport function outputScopesPretty(scopes: FeatureScope[]): void {\n if (scopes.length === 0) {\n console.log(chalk.gray('No scopes found.'));\n return;\n }\n console.log(chalk.bold(`\\nScopes (${scopes.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const s of scopes) {\n outputScopePretty(s);\n }\n console.log();\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputContactJson,\n outputContactPretty,\n outputContactsJson,\n outputContactsPretty,\n outputInteractionJson,\n outputInteractionPretty,\n} from '../utils/output.js';\nimport type { InteractionType, InteractionDirection } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nconst VALID_INTERACTION_TYPES: InteractionType[] = [\n 'EMAIL', 'TELEGRAM', 'PHONE_CALL', 'MEETING', 'NOTE', 'LINKEDIN', 'OTHER',\n];\n\nconst VALID_INTERACTION_DIRECTIONS: InteractionDirection[] = ['INBOUND', 'OUTBOUND'];\n\nexport function createContactsCommand(): Command {\n const contacts = new Command('contacts')\n .description('Manage CRM contacts');\n\n contacts\n .command('list')\n .description('List contacts')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .option('--search <query>', 'Search by name or email')\n .option('--tags <tags>', 'Filter by tags (comma-separated)')\n .option('--organization <id>', 'Filter by organization ID')\n .option('--limit <n>', 'Max results to return', parseInt)\n .option('--cursor <cursor>', 'Pagination cursor')\n .action(async (options: {\n workspace: string;\n search?: string;\n tags?: string;\n organization?: string;\n limit?: number;\n cursor?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const result = await client.contacts.list({\n workspaceId: options.workspace,\n search: options.search,\n tags: options.tags?.split(',').map(t => t.trim()),\n organizationId: options.organization,\n limit: options.limit,\n cursor: options.cursor,\n });\n\n if (useJson) {\n outputContactsJson(result.contacts, result.nextCursor);\n } else {\n outputContactsPretty(result.contacts);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('get')\n .description('Get a contact by ID')\n .argument('<id>', 'Contact ID')\n .option('--interactions', 'Include interaction history')\n .action(async (id: string, options: { interactions?: boolean }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const contact = await client.contacts.get(id, {\n includeInteractions: options.interactions,\n });\n\n if (useJson) {\n outputContactJson(contact);\n } else {\n outputContactPretty(contact);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('create')\n .description('Create a new contact')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .option('--first-name <name>', 'First name')\n .option('--last-name <name>', 'Last name')\n .option('--email <email>', 'Email address')\n .option('--phone <phone>', 'Phone number')\n .option('--linkedin <url>', 'LinkedIn URL')\n .option('--telegram <handle>', 'Telegram handle')\n .option('--twitter <handle>', 'Twitter/X handle')\n .option('--github <handle>', 'GitHub username')\n .option('--bluesky <handle>', 'Bluesky handle')\n .option('--about <text>', 'About / bio')\n .option('--profile-type <type>', 'Profile type')\n .option('--skills <skills>', 'Skills (comma-separated)')\n .option('--tags <tags>', 'Tags (comma-separated)')\n .option('--organization <id>', 'Organization ID')\n .option('--organization-name <name>', 'Organization name (find-or-create; ignored if --organization is set)')\n .action(async (options: {\n workspace: string;\n firstName?: string;\n lastName?: string;\n email?: string;\n phone?: string;\n linkedin?: string;\n telegram?: string;\n twitter?: string;\n github?: string;\n bluesky?: string;\n about?: string;\n profileType?: string;\n skills?: string;\n tags?: string;\n organization?: string;\n organizationName?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const contact = await client.contacts.create({\n workspaceId: options.workspace,\n firstName: options.firstName,\n lastName: options.lastName,\n email: options.email,\n phone: options.phone,\n linkedIn: options.linkedin,\n telegram: options.telegram,\n twitter: options.twitter,\n github: options.github,\n bluesky: options.bluesky,\n about: options.about,\n profileType: options.profileType,\n skills: options.skills?.split(',').map(s => s.trim()),\n tags: options.tags?.split(',').map(t => t.trim()),\n organizationId: options.organization,\n organizationName: options.organizationName,\n });\n\n if (useJson) {\n outputContactJson(contact);\n } else {\n console.log('\\n✓ Contact created successfully');\n outputContactPretty(contact);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('update')\n .description('Update an existing contact')\n .requiredOption('--id <id>', 'Contact ID')\n .option('--first-name <name>', 'First name')\n .option('--last-name <name>', 'Last name')\n .option('--email <email>', 'Email (use \"null\" to clear)')\n .option('--phone <phone>', 'Phone (use \"null\" to clear)')\n .option('--linkedin <url>', 'LinkedIn URL (use \"null\" to clear)')\n .option('--telegram <handle>', 'Telegram handle (use \"null\" to clear)')\n .option('--twitter <handle>', 'Twitter/X handle (use \"null\" to clear)')\n .option('--github <handle>', 'GitHub username (use \"null\" to clear)')\n .option('--bluesky <handle>', 'Bluesky handle (use \"null\" to clear)')\n .option('--about <text>', 'About / bio')\n .option('--profile-type <type>', 'Profile type')\n .option('--skills <skills>', 'Skills (comma-separated)')\n .option('--tags <tags>', 'Tags (comma-separated)')\n .option('--organization <id>', 'Organization ID (use \"null\" to clear)')\n .option('--organization-name <name>', 'Organization name (find-or-create; ignored if --organization is set)')\n .action(async (options: {\n id: string;\n firstName?: string;\n lastName?: string;\n email?: string;\n phone?: string;\n linkedin?: string;\n telegram?: string;\n twitter?: string;\n github?: string;\n bluesky?: string;\n about?: string;\n profileType?: string;\n skills?: string;\n tags?: string;\n organization?: string;\n organizationName?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n const nullable = (v?: string) => v === 'null' ? null : v;\n\n try {\n const client = getClient();\n const contact = await client.contacts.update({\n id: options.id,\n firstName: options.firstName,\n lastName: options.lastName,\n email: nullable(options.email),\n phone: nullable(options.phone),\n linkedIn: nullable(options.linkedin),\n telegram: nullable(options.telegram),\n twitter: nullable(options.twitter),\n github: nullable(options.github),\n bluesky: nullable(options.bluesky),\n about: options.about,\n profileType: options.profileType,\n skills: options.skills?.split(',').map(s => s.trim()),\n tags: options.tags?.split(',').map(t => t.trim()),\n organizationId: nullable(options.organization),\n organizationName: options.organizationName,\n });\n\n if (useJson) {\n outputContactJson(contact);\n } else {\n console.log('\\n✓ Contact updated successfully');\n outputContactPretty(contact);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('delete')\n .description('Delete a contact')\n .argument('<id>', 'Contact ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n await client.contacts.delete(id);\n\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id }, null, 2));\n } else {\n console.log(`\\n✓ Contact ${id} deleted`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('add-interaction')\n .description('Add an interaction to a contact')\n .requiredOption('--contact <id>', 'Contact ID')\n .requiredOption('--type <type>', `Interaction type (${VALID_INTERACTION_TYPES.join(', ')})`)\n .requiredOption('--direction <dir>', `Direction (${VALID_INTERACTION_DIRECTIONS.join(', ')})`)\n .option('--subject <text>', 'Subject line')\n .option('--notes <text>', 'Notes')\n .action(async (options: {\n contact: string;\n type: string;\n direction: string;\n subject?: string;\n notes?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n if (!VALID_INTERACTION_TYPES.includes(options.type as InteractionType)) {\n throw new Error(`Invalid interaction type \"${options.type}\". Valid: ${VALID_INTERACTION_TYPES.join(', ')}`);\n }\n if (!VALID_INTERACTION_DIRECTIONS.includes(options.direction as InteractionDirection)) {\n throw new Error(`Invalid direction \"${options.direction}\". Valid: ${VALID_INTERACTION_DIRECTIONS.join(', ')}`);\n }\n\n const client = getClient();\n const interaction = await client.contacts.addInteraction({\n contactId: options.contact,\n type: options.type as InteractionType,\n direction: options.direction as InteractionDirection,\n subject: options.subject,\n notes: options.notes,\n });\n\n if (useJson) {\n outputInteractionJson(interaction);\n } else {\n console.log('\\n✓ Interaction added');\n outputInteractionPretty(interaction);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n contacts\n .command('enrich')\n .description('Queue a web-search enrichment job for an existing contact (runs regardless of the workspace auto-enrich setting)')\n .argument('<id>', 'Contact ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const result = await client.contacts.enrich(id);\n\n if (useJson) {\n console.log(JSON.stringify(result, null, 2));\n } else if (result.enqueued) {\n console.log(`\\n✓ Enrichment queued for contact ${id} (job ${result.enrichmentId})`);\n } else if (result.reason === 'already-in-flight') {\n console.log(`\\n• Enrichment already in progress for contact ${id} (job ${result.enrichmentId})`);\n } else {\n console.log(`\\n• Not queued for contact ${id}${result.reason ? ` (${result.reason})` : ''}`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return contacts;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputDealJson,\n outputDealPretty,\n outputDealsJson,\n outputDealsPretty,\n outputPipelineJson,\n outputPipelinePretty,\n outputStagesJson,\n outputStagesPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nexport function createDealsCommand(): Command {\n const deals = new Command('deals')\n .description('Manage pipeline deals');\n\n deals\n .command('pipeline')\n .description('Get pipeline overview with stages')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .action(async (options: { workspace: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const pipeline = await client.pipelines.get(options.workspace);\n\n if (!pipeline) {\n if (useJson) {\n console.log(JSON.stringify({ pipeline: null }, null, 2));\n } else {\n console.log('No pipeline found for this workspace. One will be created when you add your first deal.');\n }\n return;\n }\n\n if (useJson) {\n outputPipelineJson(pipeline);\n } else {\n outputPipelinePretty(pipeline);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('stages')\n .description('List pipeline stages')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .action(async (options: { workspace: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const stages = await client.pipelines.getStages(options.workspace);\n\n if (useJson) {\n outputStagesJson(stages);\n } else {\n outputStagesPretty(stages);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('list')\n .description('List all deals')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .action(async (options: { workspace: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const dealsList = await client.pipelines.listDeals(options.workspace);\n\n if (useJson) {\n outputDealsJson(dealsList);\n } else {\n outputDealsPretty(dealsList);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('get')\n .description('Get a deal by ID')\n .argument('<id>', 'Deal ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const deal = await client.pipelines.getDeal(id);\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('create')\n .description('Create a new deal')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .requiredOption('--stage <id>', 'Pipeline stage ID')\n .requiredOption('--title <title>', 'Deal title')\n .option('--description <text>', 'Deal description')\n .option('--value <amount>', 'Deal value', parseFloat)\n .option('--currency <code>', 'Currency code (default: USD)')\n .option('--probability <pct>', 'Win probability (0-100)', parseInt)\n .option('--close-date <date>', 'Expected close date (YYYY-MM-DD)')\n .option('--contact <id>', 'Contact ID')\n .option('--organization <id>', 'Organization ID')\n .option('--assigned-to <id>', 'Assigned user ID')\n .action(async (options: {\n workspace: string;\n stage: string;\n title: string;\n description?: string;\n value?: number;\n currency?: string;\n probability?: number;\n closeDate?: string;\n contact?: string;\n organization?: string;\n assignedTo?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n let expectedCloseDate: Date | undefined;\n if (options.closeDate) {\n expectedCloseDate = new Date(options.closeDate);\n if (isNaN(expectedCloseDate.getTime())) {\n throw new Error('Invalid close date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n const deal = await client.pipelines.createDeal({\n workspaceId: options.workspace,\n stageId: options.stage,\n title: options.title,\n description: options.description,\n value: options.value,\n currency: options.currency,\n probability: options.probability,\n expectedCloseDate,\n contactId: options.contact,\n organizationId: options.organization,\n assignedToId: options.assignedTo,\n });\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n console.log('\\n✓ Deal created successfully');\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('update')\n .description('Update an existing deal')\n .requiredOption('--id <id>', 'Deal ID')\n .option('--title <title>', 'Deal title')\n .option('--description <text>', 'Description (use \"null\" to clear)')\n .option('--value <amount>', 'Deal value (use \"null\" to clear)')\n .option('--currency <code>', 'Currency code')\n .option('--probability <pct>', 'Win probability (use \"null\" to clear)')\n .option('--close-date <date>', 'Expected close date (YYYY-MM-DD or \"null\" to clear)')\n .option('--contact <id>', 'Contact ID (use \"null\" to clear)')\n .option('--organization <id>', 'Organization ID (use \"null\" to clear)')\n .option('--assigned-to <id>', 'Assigned user ID (use \"null\" to clear)')\n .action(async (options: {\n id: string;\n title?: string;\n description?: string;\n value?: string;\n currency?: string;\n probability?: string;\n closeDate?: string;\n contact?: string;\n organization?: string;\n assignedTo?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n const nullable = <T>(v: string | undefined, parse?: (s: string) => T): T | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n return parse ? parse(v) : v as unknown as T;\n };\n\n try {\n let expectedCloseDate: Date | null | undefined;\n if (options.closeDate === 'null') {\n expectedCloseDate = null;\n } else if (options.closeDate) {\n expectedCloseDate = new Date(options.closeDate);\n if (isNaN(expectedCloseDate.getTime())) {\n throw new Error('Invalid close date format. Use YYYY-MM-DD');\n }\n }\n\n const client = getClient();\n const deal = await client.pipelines.updateDeal({\n id: options.id,\n title: options.title,\n description: nullable(options.description),\n value: nullable(options.value, parseFloat),\n currency: options.currency,\n probability: nullable(options.probability, parseInt),\n expectedCloseDate,\n contactId: nullable(options.contact),\n organizationId: nullable(options.organization),\n assignedToId: nullable(options.assignedTo),\n });\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n console.log('\\n✓ Deal updated successfully');\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('move')\n .description('Move a deal to a different stage')\n .requiredOption('--id <id>', 'Deal ID')\n .requiredOption('--stage <id>', 'Target stage ID')\n .option('--order <n>', 'Position within stage', parseInt, 0)\n .action(async (options: { id: string; stage: string; order: number }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const deal = await client.pipelines.moveDeal({\n id: options.id,\n stageId: options.stage,\n stageOrder: options.order,\n });\n\n if (useJson) {\n outputDealJson(deal);\n } else {\n console.log('\\n✓ Deal moved successfully');\n outputDealPretty(deal);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n deals\n .command('delete')\n .description('Delete a deal')\n .argument('<id>', 'Deal ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n await client.pipelines.deleteDeal(id);\n\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id }, null, 2));\n } else {\n console.log(`\\n✓ Deal ${id} deleted`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return deals;\n}\n","import { Command } from 'commander';\nimport type { EpicPriority, EpicStatus } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport {\n shouldUseJson,\n outputEpicJson,\n outputEpicPretty,\n outputEpicsJson,\n outputEpicsPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst EPIC_STATUSES: EpicStatus[] = ['OPEN', 'IN_PROGRESS', 'DONE', 'CANCELLED'];\nconst EPIC_PRIORITIES: EpicPriority[] = ['HIGH', 'MEDIUM', 'LOW', 'NONE'];\n\nfunction validateEpicStatus(value: string | undefined): EpicStatus | undefined {\n if (!value) return undefined;\n if (!(EPIC_STATUSES as string[]).includes(value)) {\n throw new Error(`Invalid epic status \"${value}\". Valid: ${EPIC_STATUSES.join(', ')}`);\n }\n return value as EpicStatus;\n}\n\nfunction validateEpicPriority(value: string | undefined): EpicPriority | undefined {\n if (!value) return undefined;\n if (!(EPIC_PRIORITIES as string[]).includes(value)) {\n throw new Error(\n `Invalid epic priority \"${value}\". Valid: ${EPIC_PRIORITIES.join(', ')}`,\n );\n }\n return value as EpicPriority;\n}\n\nfunction parseDate(value: string | undefined): Date | undefined {\n if (!value) return undefined;\n const d = new Date(value);\n if (isNaN(d.getTime())) {\n throw new Error(`Invalid date \"${value}\". Use YYYY-MM-DD`);\n }\n return d;\n}\n\nexport function createEpicsCommand(): Command {\n const epics = new Command('epics').description(\n 'Manage epics. Epics are workspace-scoped and group actions and tickets across products.',\n );\n\n epics\n .command('list')\n .description('List epics in a workspace')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .option('--status <status>', `Filter by status: ${EPIC_STATUSES.join(', ')}`)\n .action(\n async (options: { workspace?: string; status?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateEpicStatus(options.status);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const list = await client.epics.list({ workspaceId, status });\n if (useJson) outputEpicsJson(list);\n else outputEpicsPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n epics\n .command('get <id>')\n .description('Get an epic by CUID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const epic = await client.epics.get(id);\n if (useJson) outputEpicJson(epic);\n else outputEpicPretty(epic);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n epics\n .command('create')\n .description('Create a new epic in a workspace')\n .requiredOption('-n, --name <name>', 'Epic name')\n .option('-d, --description <text>', 'Description')\n .option('--priority <priority>', `Priority: ${EPIC_PRIORITIES.join(', ')}`)\n .option('--start <date>', 'Start date (YYYY-MM-DD)')\n .option('--target <date>', 'Target date (YYYY-MM-DD)')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (\n options: {\n name: string;\n description?: string;\n priority?: string;\n start?: string;\n target?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const priority = validateEpicPriority(options.priority);\n const startDate = parseDate(options.start);\n const targetDate = parseDate(options.target);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const epic = await client.epics.create({\n workspaceId,\n name: options.name,\n description: options.description,\n priority,\n startDate,\n targetDate,\n });\n if (useJson) outputEpicJson(epic);\n else {\n console.log('\\n✓ Epic created');\n outputEpicPretty(epic);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n epics\n .command('update')\n .description('Update an existing epic')\n .requiredOption('--id <id>', 'Epic CUID')\n .option('-n, --name <name>', 'New name')\n .option('-d, --description <text>', 'New description (or \"null\" to clear)')\n .option('--status <status>', `Status: ${EPIC_STATUSES.join(', ')}`)\n .option('--priority <priority>', `Priority: ${EPIC_PRIORITIES.join(', ')}`)\n .option('--start <date>', 'Start date (YYYY-MM-DD or \"null\")')\n .option('--target <date>', 'Target date (YYYY-MM-DD or \"null\")')\n .action(\n async (\n options: {\n id: string;\n name?: string;\n description?: string;\n status?: string;\n priority?: string;\n start?: string;\n target?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const parseNullableDate = (v: string | undefined): Date | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n const d = new Date(v);\n if (isNaN(d.getTime())) {\n throw new Error(`Invalid date \"${v}\". Use YYYY-MM-DD`);\n }\n return d;\n };\n const description = options.description === 'null' ? null : options.description;\n const status = validateEpicStatus(options.status);\n const priority = validateEpicPriority(options.priority);\n const client = getClient();\n const epic = await client.epics.update({\n id: options.id,\n name: options.name,\n description,\n status,\n priority,\n startDate: parseNullableDate(options.start),\n targetDate: parseNullableDate(options.target),\n });\n if (useJson) outputEpicJson(epic);\n else {\n console.log('\\n✓ Epic updated');\n outputEpicPretty(epic);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return epics;\n}\n","import type { ExponentialClient } from 'exponential-sdk';\nimport { getConfig } from '../config/index.js';\n\n/**\n * Resolve a workspace identifier the user typed at the CLI to a workspace ID.\n *\n * Accepts:\n * - a bare workspace CUID (returned as-is after a list lookup for safety)\n * - a workspace slug\n * - undefined → falls back to the configured default workspace\n *\n * Throws if nothing resolves so callers don't accidentally send a \"\" id.\n */\nexport async function resolveWorkspaceId(\n client: ExponentialClient,\n slugOrId: string | undefined,\n): Promise<string> {\n const config = getConfig();\n const candidate = slugOrId ?? config.defaultWorkspaceSlug ?? config.defaultWorkspaceId;\n\n if (!candidate) {\n throw new Error(\n 'No workspace specified and no default workspace set. Pass --workspace <slug> or run `exponential workspaces set-default <slug>`.',\n );\n }\n\n const workspaces = await client.workspaces.list();\n const byId = workspaces.find((w) => w.id === candidate);\n if (byId) return byId.id;\n const bySlug = workspaces.find((w) => w.slug === candidate);\n if (bySlug) return bySlug.id;\n\n const known = workspaces.map((w) => w.slug).join(', ');\n throw new Error(\n `Workspace \"${candidate}\" not found. Available: ${known || '(none)'}`,\n );\n}\n\n/**\n * Resolve a product identifier (slug or CUID) to a product ID.\n * `slugOrId` may also be a CUID — we try id lookup first when it looks\n * like one, then fall back to slug.\n */\nexport async function resolveProductId(\n client: ExponentialClient,\n workspaceId: string,\n slugOrId: string,\n): Promise<string> {\n const product = await client.products.resolve(workspaceId, slugOrId);\n return product.id;\n}\n\n","import { Command } from 'commander';\nimport type { FeatureStatus } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveProductId, resolveWorkspaceId } from '../utils/resolve.js';\nimport { createStoriesCommand } from './stories.js';\nimport { createScopesCommand } from './scopes.js';\nimport { createRequirementsCommand } from './requirements.js';\nimport { createAreasCommand } from './areas.js';\nimport {\n shouldUseJson,\n outputFeaturesJson,\n outputFeaturesPretty,\n outputFeatureJson,\n outputFeaturePretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst FEATURE_STATUSES: FeatureStatus[] = [\n 'IDEA',\n 'DEFINED',\n 'IN_PROGRESS',\n 'SHIPPED',\n 'DEPRECATED',\n 'ARCHIVED',\n];\n\nfunction validateFeatureStatus(value: string | undefined): FeatureStatus | undefined {\n if (!value) return undefined;\n if (!(FEATURE_STATUSES as string[]).includes(value)) {\n throw new Error(\n `Invalid status \"${value}\". Valid: ${FEATURE_STATUSES.join(', ')}`,\n );\n }\n return value as FeatureStatus;\n}\n\nexport function createFeaturesCommand(): Command {\n const features = new Command('features').description(\n 'Manage features. A feature lives under a product and groups user stories, scopes, and tickets.',\n );\n\n features\n .command('list')\n .description('List features in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .option('--status <status>', `Filter by status: ${FEATURE_STATUSES.join(', ')}`)\n .action(\n async (\n options: { product: string; workspace?: string; status?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateFeatureStatus(options.status);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n const list = await client.features.list({ productId, status });\n if (useJson) outputFeaturesJson(list);\n else outputFeaturesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('get <id>')\n .description('Get a feature by CUID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const feature = await client.features.get(id);\n if (useJson) outputFeatureJson(feature);\n else outputFeaturePretty(feature);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n features\n .command('create')\n .description('Create a new feature in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .requiredOption('-n, --name <name>', 'Feature name')\n .option('-d, --description <text>', 'Description (markdown supported)')\n .option('--vision <text>', 'Vision / target outcome')\n .option('--status <status>', `Status: ${FEATURE_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4 (lower = higher)', parseInt)\n .option('--effort <n>', 'Effort estimate', parseFloat)\n .option('--area <id>', 'Area CUID (per-product bucket) to file the feature under')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .action(\n async (\n options: {\n product: string;\n name: string;\n description?: string;\n vision?: string;\n status?: string;\n priority?: number;\n effort?: number;\n area?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateFeatureStatus(options.status);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n const feature = await client.features.create({\n productId,\n name: options.name,\n description: options.description,\n vision: options.vision,\n status,\n priority: options.priority,\n effort: options.effort,\n areaId: options.area,\n });\n if (useJson) outputFeatureJson(feature);\n else {\n console.log('\\n✓ Feature created');\n outputFeaturePretty(feature);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('update')\n .description('Update an existing feature')\n .requiredOption('--id <id>', 'Feature CUID')\n .option('-n, --name <name>', 'New name')\n .option('-d, --description <text>', 'New description')\n .option('--vision <text>', 'New vision text')\n .option('--status <status>', `Status: ${FEATURE_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4', parseInt)\n .option('--effort <n>', 'Effort estimate', parseFloat)\n .option('--area <id>', 'Area CUID (\"none\" to clear)')\n .action(\n async (\n options: {\n id: string;\n name?: string;\n description?: string;\n vision?: string;\n status?: string;\n priority?: number;\n effort?: number;\n area?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateFeatureStatus(options.status);\n const client = getClient();\n const feature = await client.features.update({\n id: options.id,\n name: options.name,\n description: options.description,\n vision: options.vision,\n status,\n priority: options.priority,\n effort: options.effort,\n areaId: options.area === 'none' ? null : options.area,\n });\n if (useJson) outputFeatureJson(feature);\n else {\n console.log('\\n✓ Feature updated');\n outputFeaturePretty(feature);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('link-page')\n .description('Link a Knowledge page (PRD, spec, research) to a feature')\n .requiredOption('--feature <id>', 'Feature CUID')\n .requiredOption('--page <id>', 'Page CUID')\n .option('--scope <id>', 'Feature scope CUID to pin the page to')\n .action(\n async (\n options: { feature: string; page: string; scope?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const link = await client.features.linkPage({\n featureId: options.feature,\n pageId: options.page,\n scopeId: options.scope,\n });\n if (useJson) console.log(JSON.stringify(link, null, 2));\n else console.log('\\n✓ Page linked');\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features\n .command('unlink-page')\n .description('Unlink a Knowledge page from a feature')\n .requiredOption('--feature <id>', 'Feature CUID')\n .requiredOption('--page <id>', 'Page CUID')\n .action(\n async (options: { feature: string; page: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const result = await client.features.unlinkPage(\n options.feature,\n options.page,\n );\n if (useJson) console.log(JSON.stringify(result, null, 2));\n else console.log('\\n✓ Page unlinked');\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n features.addCommand(createStoriesCommand());\n features.addCommand(createScopesCommand());\n features.addCommand(createRequirementsCommand());\n features.addCommand(createAreasCommand());\n\n return features;\n}\n","import { Command } from 'commander';\nimport type { UserStoryCreateInput } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputUserStoryJson,\n outputUserStoryPretty,\n outputUserStoriesJson,\n outputUserStoriesPretty,\n outputBatchResultsJson,\n outputBatchResultsPretty,\n type BatchStoryResult,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\n// Shape of a single story object in the stdin batch array.\ninterface BatchStoryInput {\n asA?: string;\n iWant?: string;\n soThat?: string;\n acceptanceCriteria?: string;\n scopeId?: string;\n}\n\nasync function readStdin(): Promise<string> {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk as Buffer);\n }\n return Buffer.concat(chunks).toString('utf-8');\n}\n\nexport function createStoriesCommand(): Command {\n const stories = new Command('stories').description(\n 'Manage a feature\\'s native, structured user stories (As a / I want / So that).',\n );\n\n stories\n .command('add')\n .description(\n [\n 'Add user stories to a feature.',\n '',\n 'Flag mode: pass --as-a/--i-want/--so-that (plus optional --acceptance/--scope) to add one story.',\n 'Batch mode: pipe a JSON array of { asA?, iWant?, soThat?, acceptanceCriteria?, scopeId? } on stdin',\n ' to add many at once (per-item success/failure is reported).',\n ].join('\\n'),\n )\n .requiredOption('--feature <id>', 'Feature CUID')\n .option('--as-a <text>', '\"As a ...\" actor')\n .option('--i-want <text>', '\"I want ...\" capability')\n .option('--so-that <text>', '\"So that ...\" outcome')\n .option('--acceptance <text>', 'Acceptance criteria')\n .option('--scope <id>', 'Feature scope CUID to group the story under')\n .action(\n async (\n options: {\n feature: string;\n asA?: string;\n iWant?: string;\n soThat?: string;\n acceptance?: string;\n scope?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n const hasFlags =\n options.asA != null ||\n options.iWant != null ||\n options.soThat != null ||\n options.acceptance != null;\n // Batch mode when stdin is piped and no story flags were given.\n const isBatch = !hasFlags && !process.stdin.isTTY;\n\n try {\n const client = getClient();\n\n if (isBatch) {\n const raw = await readStdin();\n let items: BatchStoryInput[];\n try {\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) {\n throw new Error('Expected a JSON array of story objects on stdin');\n }\n items = parsed as BatchStoryInput[];\n } catch (parseError) {\n throw new Error(\n `Could not parse stdin as a JSON array: ${\n parseError instanceof Error ? parseError.message : String(parseError)\n }`,\n );\n }\n\n const results: BatchStoryResult[] = [];\n // Sequential so server-side displayOrder follows array order.\n for (let index = 0; index < items.length; index++) {\n const item = items[index]!;\n try {\n const story = await client.userStories.create({\n featureId: options.feature,\n asA: item.asA,\n iWant: item.iWant,\n soThat: item.soThat,\n acceptanceCriteria: item.acceptanceCriteria,\n scopeId: item.scopeId,\n });\n results.push({ index, ok: true, id: story.id });\n } catch (itemError) {\n results.push({\n index,\n ok: false,\n error: itemError instanceof Error ? itemError.message : String(itemError),\n });\n }\n }\n\n if (useJson) outputBatchResultsJson(results);\n else outputBatchResultsPretty(results);\n\n // Non-zero exit if every item failed, so scripts can detect total failure.\n if (results.length > 0 && results.every((r) => !r.ok)) {\n process.exit(1);\n }\n return;\n }\n\n // Flag mode: a single story.\n const input: UserStoryCreateInput = {\n featureId: options.feature,\n asA: options.asA,\n iWant: options.iWant,\n soThat: options.soThat,\n acceptanceCriteria: options.acceptance,\n scopeId: options.scope,\n };\n const story = await client.userStories.create(input);\n if (useJson) outputUserStoryJson(story);\n else {\n console.log('\\n✓ User story added');\n outputUserStoryPretty(story);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n stories\n .command('list')\n .description('List a feature\\'s user stories in display order')\n .requiredOption('--feature <id>', 'Feature CUID')\n .action(\n async (options: { feature: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const list = await client.userStories.list({ featureId: options.feature });\n if (useJson) outputUserStoriesJson(list);\n else outputUserStoriesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return stories;\n}\n","import { Command } from 'commander';\nimport type { FeatureScopeStatus } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputScopeJson,\n outputScopePretty,\n outputScopesJson,\n outputScopesPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst SCOPE_STATUSES: FeatureScopeStatus[] = [\n 'PLANNED',\n 'IN_PROGRESS',\n 'SHIPPED',\n 'DEPRECATED',\n];\n\nfunction validateScopeStatus(value: string | undefined): FeatureScopeStatus | undefined {\n if (!value) return undefined;\n if (!(SCOPE_STATUSES as string[]).includes(value)) {\n throw new Error(\n `Invalid status \"${value}\". Valid: ${SCOPE_STATUSES.join(', ')}`,\n );\n }\n return value as FeatureScopeStatus;\n}\n\nexport function createScopesCommand(): Command {\n const scopes = new Command('scopes').description(\n 'Manage a feature\\'s scopes: shippable increments (\"V1\", \"V2\"), each with its own lifecycle.',\n );\n\n scopes\n .command('list')\n .description('List a feature\\'s scopes')\n .requiredOption('--feature <id>', 'Feature CUID')\n .action(\n async (options: { feature: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const list = await client.scopes.list({ featureId: options.feature });\n if (useJson) outputScopesJson(list);\n else outputScopesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n scopes\n .command('add')\n .description('Add a scope to a feature')\n .requiredOption('--feature <id>', 'Feature CUID')\n .requiredOption('--version <label>', 'Short label for the increment, e.g. \"V1\"')\n .requiredOption('-d, --description <text>', 'What this scope delivers (markdown supported)')\n .option('--status <status>', `Status: ${SCOPE_STATUSES.join(', ')} (default PLANNED)`)\n .action(\n async (\n options: { feature: string; version: string; description: string; status?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateScopeStatus(options.status);\n const client = getClient();\n const scope = await client.scopes.create({\n featureId: options.feature,\n version: options.version,\n description: options.description,\n status,\n });\n if (useJson) outputScopeJson(scope);\n else {\n console.log('\\n✓ Scope added');\n outputScopePretty(scope);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n scopes\n .command('update')\n .description('Update a scope (setting SHIPPED stamps shippedAt and rolls the feature status up)')\n .requiredOption('--id <id>', 'Scope CUID')\n .option('--version <label>', 'New version label')\n .option('-d, --description <text>', 'New description')\n .option('--status <status>', `Status: ${SCOPE_STATUSES.join(', ')}`)\n .action(\n async (\n options: { id: string; version?: string; description?: string; status?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateScopeStatus(options.status);\n const client = getClient();\n const scope = await client.scopes.update({\n id: options.id,\n version: options.version,\n description: options.description,\n status,\n });\n if (useJson) outputScopeJson(scope);\n else {\n console.log('\\n✓ Scope updated');\n outputScopePretty(scope);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n scopes\n .command('rm')\n .description('Delete a scope')\n .requiredOption('--id <id>', 'Scope CUID')\n .action(async (options: { id: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const result = await client.scopes.delete(options.id);\n if (useJson) console.log(JSON.stringify(result, null, 2));\n else console.log('\\n✓ Scope deleted');\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return scopes;\n}\n","import { Command } from 'commander';\nimport type { RequirementCreateInput, RequirementKind } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputRequirementJson,\n outputRequirementPretty,\n outputRequirementsJson,\n outputRequirementsPretty,\n outputRequirementBatchJson,\n outputRequirementBatchPretty,\n type BatchRequirementResult,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst REQUIREMENT_KINDS: RequirementKind[] = [\n 'FUNCTIONAL',\n 'NON_FUNCTIONAL',\n 'CONSTRAINT',\n];\n\nfunction validateKind(value: string | undefined): RequirementKind | undefined {\n if (!value) return undefined;\n if (!(REQUIREMENT_KINDS as string[]).includes(value)) {\n throw new Error(\n `Invalid kind \"${value}\". Valid: ${REQUIREMENT_KINDS.join(', ')}`,\n );\n }\n return value as RequirementKind;\n}\n\n// Shape of a single requirement object in the stdin batch array.\ninterface BatchRequirementInput {\n statement: string;\n kind?: RequirementKind;\n scopeId?: string;\n}\n\nasync function readStdin(): Promise<string> {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(chunk as Buffer);\n }\n return Buffer.concat(chunks).toString('utf-8');\n}\n\nexport function createRequirementsCommand(): Command {\n const requirements = new Command('requirements').description(\n 'Manage a feature\\'s requirements: atomic, testable EARS-style \"shall\" statements, checkable met/unmet.',\n );\n\n requirements\n .command('add')\n .description(\n [\n 'Add requirements to a feature.',\n '',\n 'Flag mode: pass -s/--statement (plus optional --kind/--scope) to add one requirement.',\n 'Batch mode: pipe a JSON array of { statement, kind?, scopeId? } on stdin',\n ' to add many at once (per-item success/failure is reported).',\n ].join('\\n'),\n )\n .requiredOption('--feature <id>', 'Feature CUID')\n .option('-s, --statement <text>', 'One EARS-style \"shall\" statement')\n .option('--kind <kind>', `Kind: ${REQUIREMENT_KINDS.join(', ')}`)\n .option('--scope <id>', 'Feature scope CUID to pin the requirement to')\n .action(\n async (\n options: { feature: string; statement?: string; kind?: string; scope?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n\n if (options.statement) {\n const requirement = await client.requirements.create({\n featureId: options.feature,\n statement: options.statement,\n kind: validateKind(options.kind),\n scopeId: options.scope,\n });\n if (useJson) outputRequirementJson(requirement);\n else {\n console.log('\\n✓ Requirement added');\n outputRequirementPretty(requirement);\n }\n return;\n }\n\n // Batch mode: JSON array on stdin.\n if (process.stdin.isTTY) {\n throw new Error(\n 'Pass -s/--statement, or pipe a JSON array of requirements on stdin.',\n );\n }\n const raw = await readStdin();\n let batch: BatchRequirementInput[];\n try {\n const parsed: unknown = JSON.parse(raw);\n if (!Array.isArray(parsed)) throw new Error('not an array');\n batch = parsed as BatchRequirementInput[];\n } catch {\n throw new Error(\n 'stdin must be a JSON array of { statement, kind?, scopeId? } objects.',\n );\n }\n\n const results: BatchRequirementResult[] = [];\n for (const [index, item] of batch.entries()) {\n try {\n if (!item.statement || typeof item.statement !== 'string') {\n throw new Error('missing \"statement\"');\n }\n const input: RequirementCreateInput = {\n featureId: options.feature,\n statement: item.statement,\n kind: validateKind(item.kind),\n scopeId: item.scopeId,\n };\n const requirement = await client.requirements.create(input);\n results.push({ index, success: true, requirement });\n } catch (error) {\n results.push({\n index,\n success: false,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n if (useJson) outputRequirementBatchJson(results);\n else outputRequirementBatchPretty(results);\n if (results.some((r) => !r.success)) process.exitCode = 1;\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n requirements\n .command('list')\n .description('List a feature\\'s requirements')\n .requiredOption('--feature <id>', 'Feature CUID')\n .option('--scope <id>', 'Only requirements pinned to this scope')\n .action(\n async (options: { feature: string; scope?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const list = await client.requirements.list({\n featureId: options.feature,\n scopeId: options.scope,\n });\n if (useJson) outputRequirementsJson(list);\n else outputRequirementsPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n requirements\n .command('check')\n .description('Mark a requirement met (or unmet with --unmet)')\n .requiredOption('--id <id>', 'Requirement CUID')\n .option('--unmet', 'Mark unmet instead of met')\n .action(\n async (options: { id: string; unmet?: boolean }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const requirement = await client.requirements.setChecked(\n options.id,\n !options.unmet,\n );\n if (useJson) outputRequirementJson(requirement);\n else {\n console.log(`\\n✓ Requirement marked ${options.unmet ? 'unmet' : 'met'}`);\n outputRequirementPretty(requirement);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n requirements\n .command('rm')\n .description('Delete a requirement')\n .requiredOption('--id <id>', 'Requirement CUID')\n .action(async (options: { id: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const result = await client.requirements.delete(options.id);\n if (useJson) console.log(JSON.stringify(result, null, 2));\n else console.log('\\n✓ Requirement deleted');\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return requirements;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveProductId, resolveWorkspaceId } from '../utils/resolve.js';\nimport { shouldUseJson } from '../utils/output.js';\nimport chalk from 'chalk';\nimport type { Area } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nfunction outputAreasPretty(areas: Area[]): void {\n if (areas.length === 0) {\n console.log(chalk.gray('No areas found.'));\n return;\n }\n console.log(chalk.bold(`\\nAreas (${areas.length} total)`));\n console.log(chalk.gray('─'.repeat(50)));\n for (const a of areas) {\n const count = a._count?.features != null ? chalk.gray(` (${a._count.features} features)`) : '';\n console.log(` ${chalk.bold(a.name)}${count}`);\n console.log(chalk.gray(` ID: ${a.id}`));\n }\n console.log();\n}\n\nexport function createAreasCommand(): Command {\n const areas = new Command('areas').description(\n 'Manage a product\\'s areas: the buckets features are filed under (a feature has exactly one or none).',\n );\n\n areas\n .command('list')\n .description('List a product\\'s areas')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .action(\n async (options: { product: string; workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(client, workspaceId, options.product);\n const list = await client.areas.list({ productId });\n if (useJson) console.log(JSON.stringify({ areas: list, total: list.length }, null, 2));\n else outputAreasPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n areas\n .command('create')\n .description('Create an area in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .requiredOption('-n, --name <name>', 'Area name (unique per product)')\n .option('-d, --description <text>', 'What belongs in this area')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .action(\n async (\n options: { product: string; name: string; description?: string; workspace?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(client, workspaceId, options.product);\n const area = await client.areas.create({\n productId,\n name: options.name,\n description: options.description,\n });\n if (useJson) console.log(JSON.stringify(area, null, 2));\n else console.log(`\\n✓ Area created: ${area.name} (${area.id})`);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return areas;\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport type { Tag } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport { shouldUseJson } from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\ninterface SeedLabel {\n name: string;\n slug: string;\n color: string;\n}\n\n/**\n * Canonical triage labels referenced by the `/triage` agent skill. Slugs are\n * deterministic, so re-running `seed-triage` after a partial creation only\n * creates the missing ones.\n */\nconst TRIAGE_LABELS: SeedLabel[] = [\n { slug: 'needs-triage', name: 'needs-triage', color: 'avatar-orange' },\n { slug: 'needs-info', name: 'needs-info', color: 'avatar-yellow' },\n { slug: 'ready-for-agent', name: 'ready-for-agent', color: 'avatar-green' },\n { slug: 'ready-for-human', name: 'ready-for-human', color: 'avatar-lightBlue' },\n { slug: 'wontfix', name: 'wontfix', color: 'avatar-lightGray' },\n];\n\nconst CUID_PATTERN = /^c[a-z0-9]{20,}$/i;\n\nfunction looksLikeCuid(value: string): boolean {\n return CUID_PATTERN.test(value);\n}\n\nfunction outputTagsPretty(tags: Tag[]): void {\n if (tags.length === 0) {\n console.log(chalk.dim('No labels found.'));\n return;\n }\n console.log();\n for (const tag of tags) {\n const scope = tag.workspaceId === null ? chalk.cyan('global') : chalk.magenta('workspace');\n const category = tag.category === null ? chalk.dim('(label)') : chalk.dim(`(${tag.category})`);\n console.log(\n ` ${chalk.bold(tag.slug)} ${tag.name} ${chalk.gray(tag.color)} ${scope} ${category}`,\n );\n }\n console.log();\n}\n\nfunction outputTagPretty(tag: Tag, prefix?: string): void {\n if (prefix) console.log(prefix);\n console.log(` ${chalk.bold(tag.slug)} ${tag.name} ${chalk.gray(tag.color)}`);\n}\n\nexport async function resolveLabelIds(\n client: ReturnType<typeof getClient>,\n workspaceId: string | undefined,\n values: string[],\n): Promise<string[]> {\n if (values.length === 0) return [];\n\n const bySlug = values.filter((v) => !looksLikeCuid(v));\n const byId = values.filter((v) => looksLikeCuid(v));\n\n if (bySlug.length === 0) return byId;\n\n const list = await client.labels.list({ workspaceId });\n const slugMap = new Map(list.allTags.map((t) => [t.slug, t.id]));\n\n const resolvedFromSlugs: string[] = [];\n const missing: string[] = [];\n for (const slug of bySlug) {\n const id = slugMap.get(slug);\n if (id === undefined) missing.push(slug);\n else resolvedFromSlugs.push(id);\n }\n if (missing.length > 0) {\n throw new Error(\n `Unknown label slug(s): ${missing.join(', ')}. Run \\`exponential labels list --workspace <slug>\\` to see available labels.`,\n );\n }\n return [...byId, ...resolvedFromSlugs];\n}\n\nexport function createLabelsCommand(): Command {\n const labels = new Command('labels').description(\n 'Manage labels (orthogonal tags applied to actions, tickets, features, and epics).',\n );\n\n labels\n .command('list')\n .description('List labels visible in a workspace')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .option(\n '--category <category>',\n 'Filter by category. Use \"label\" for general labels, \"null\" for category-less labels, or omit to list all.',\n )\n .action(\n async (\n options: { workspace?: string; category?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const category =\n options.category === undefined\n ? undefined\n : options.category === 'null'\n ? null\n : options.category;\n const result = await client.labels.list({ workspaceId, category });\n if (useJson) {\n console.log(JSON.stringify(result.allTags, null, 2));\n } else {\n outputTagsPretty(result.allTags);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n labels\n .command('create')\n .description('Create a workspace-scoped label')\n .requiredOption('-n, --name <name>', 'Label name')\n .requiredOption('--color <token>', 'Color token (e.g. avatar-green, brand-primary)')\n .option('-d, --description <text>', 'Description')\n .option('--category <category>', 'Category. Omit (or pass \"null\") to create a general label.')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (\n options: {\n name: string;\n color: string;\n description?: string;\n category?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n if (workspaceId === undefined) {\n throw new Error(\n 'Workspace is required. Pass --workspace <slug|id> or set a default with `exponential workspaces set-default`.',\n );\n }\n const category =\n options.category === undefined\n ? undefined\n : options.category === 'null'\n ? null\n : options.category;\n const tag = await client.labels.create({\n workspaceId,\n name: options.name,\n color: options.color,\n description: options.description,\n category,\n });\n if (useJson) {\n console.log(JSON.stringify(tag, null, 2));\n } else {\n outputTagPretty(tag, chalk.green('\\n✓ Label created'));\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n labels\n .command('seed-triage')\n .description('Idempotently seed the five canonical triage labels into a workspace.')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n if (workspaceId === undefined) {\n throw new Error(\n 'Workspace is required. Pass --workspace <slug|id> or set a default with `exponential workspaces set-default`.',\n );\n }\n const existing = await client.labels.list({ workspaceId });\n const existingSlugs = new Set(existing.allTags.map((t) => t.slug));\n\n const results: Array<{\n slug: string;\n status: 'created' | 'existed';\n tag?: Tag;\n }> = [];\n for (const def of TRIAGE_LABELS) {\n if (existingSlugs.has(def.slug)) {\n results.push({ slug: def.slug, status: 'existed' });\n continue;\n }\n const tag = await client.labels.create({\n workspaceId,\n name: def.name,\n color: def.color,\n });\n results.push({ slug: def.slug, status: 'created', tag });\n }\n\n if (useJson) {\n console.log(JSON.stringify(results, null, 2));\n } else {\n console.log();\n console.log(chalk.bold('Triage labels:'));\n for (const r of results) {\n const tag = chalk.bold(r.slug);\n const status =\n r.status === 'created'\n ? chalk.green('created')\n : chalk.dim('existed');\n console.log(` ${tag} ${status}`);\n }\n console.log();\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return labels;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputOrganizationJson,\n outputOrganizationPretty,\n outputOrganizationsJson,\n outputOrganizationsPretty,\n} from '../utils/output.js';\nimport type { OrganizationSize } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nconst VALID_SIZES: OrganizationSize[] = [\n '1-10', '11-50', '51-200', '201-500', '501-1000', '1000+',\n];\n\nexport function createOrganizationsCommand(): Command {\n const organizations = new Command('organizations')\n .alias('orgs')\n .description('Manage CRM organizations');\n\n organizations\n .command('list')\n .description('List organizations')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .option('--search <query>', 'Search by name or description')\n .option('--industry <industry>', 'Filter by industry')\n .option('--limit <n>', 'Max results to return', parseInt)\n .option('--cursor <cursor>', 'Pagination cursor')\n .action(async (options: {\n workspace: string;\n search?: string;\n industry?: string;\n limit?: number;\n cursor?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const result = await client.organizations.list({\n workspaceId: options.workspace,\n search: options.search,\n industry: options.industry,\n limit: options.limit,\n cursor: options.cursor,\n });\n\n if (useJson) {\n outputOrganizationsJson(result.organizations, result.nextCursor);\n } else {\n outputOrganizationsPretty(result.organizations);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n organizations\n .command('get')\n .description('Get an organization by ID')\n .argument('<id>', 'Organization ID')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const org = await client.organizations.get(id);\n\n if (useJson) {\n outputOrganizationJson(org);\n } else {\n outputOrganizationPretty(org);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n organizations\n .command('create')\n .description('Create a new organization')\n .requiredOption('--workspace <id>', 'Workspace ID')\n .requiredOption('--name <name>', 'Organization name')\n .option('--website-url <url>', 'Website URL')\n .option('--logo-url <url>', 'Logo URL')\n .option('--description <text>', 'Description')\n .option('--industry <industry>', 'Industry')\n .option('--size <size>', `Company size (${VALID_SIZES.join(', ')})`)\n .action(async (options: {\n workspace: string;\n name: string;\n websiteUrl?: string;\n logoUrl?: string;\n description?: string;\n industry?: string;\n size?: string;\n }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n if (options.size && !VALID_SIZES.includes(options.size as OrganizationSize)) {\n throw new Error(`Invalid size \"${options.size}\". Valid: ${VALID_SIZES.join(', ')}`);\n }\n\n const client = getClient();\n const org = await client.organizations.create({\n workspaceId: options.workspace,\n name: options.name,\n websiteUrl: options.websiteUrl,\n logoUrl: options.logoUrl,\n description: options.description,\n industry: options.industry,\n size: options.size as OrganizationSize | undefined,\n });\n\n if (useJson) {\n outputOrganizationJson(org);\n } else {\n console.log('\\n✓ Organization created successfully');\n outputOrganizationPretty(org);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return organizations;\n}\n","import { readFileSync } from 'node:fs';\nimport { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport {\n shouldUseJson,\n outputPageJson,\n outputPagePretty,\n outputPagesJson,\n outputPagesPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\n/** Body from -b text, --body-file path, or \"-\" for stdin. */\nfunction readBody(body?: string, bodyFile?: string): string | undefined {\n if (body !== undefined) return body;\n if (bodyFile === undefined) return undefined;\n if (bodyFile === '-') return readFileSync(0, 'utf-8');\n return readFileSync(bodyFile, 'utf-8');\n}\n\nexport function createPagesCommand(): Command {\n const pages = new Command('pages').description(\n 'Manage Knowledge pages (PRDs, research, technical specs). Link one to a feature with \"features link-page\".',\n );\n\n pages\n .command('list')\n .description('List pages in a workspace')\n .option('--workspace <slug|id>', 'Workspace (defaults to the configured default)')\n .option('--search <text>', 'Filter by title/content')\n .action(\n async (options: { workspace?: string; search?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const list = await client.pages.list({\n workspaceId,\n search: options.search,\n });\n if (useJson) outputPagesJson(list);\n else outputPagesPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n pages\n .command('get <id>')\n .description('Get a page by CUID (body is Markdown)')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const page = await client.pages.get(id);\n if (useJson) outputPageJson(page);\n else outputPagePretty(page);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n pages\n .command('create')\n .description('Create a page. Body: -b text, --body-file <path>, or --body-file - for stdin.')\n .option('--workspace <slug|id>', 'Workspace (defaults to the configured default)')\n .requiredOption('-t, --title <title>', 'Page title')\n .option('-b, --body <markdown>', 'Markdown body')\n .option('--body-file <path>', 'Read the Markdown body from a file (\"-\" = stdin)')\n .action(\n async (\n options: { workspace?: string; title: string; body?: string; bodyFile?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const page = await client.pages.create({\n workspaceId,\n title: options.title,\n body: readBody(options.body, options.bodyFile),\n });\n if (useJson) outputPageJson(page);\n else {\n console.log('\\n✓ Page created');\n outputPagePretty(page);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n pages\n .command('update')\n .description(\n 'Update a page. Sending a body is a Markdown-source write: the Markdown becomes canonical.',\n )\n .requiredOption('--id <id>', 'Page CUID')\n .option('-t, --title <title>', 'New title')\n .option('-b, --body <markdown>', 'New Markdown body (replaces the whole body)')\n .option('--body-file <path>', 'Read the new Markdown body from a file (\"-\" = stdin)')\n .action(\n async (\n options: { id: string; title?: string; body?: string; bodyFile?: string },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const page = await client.pages.update({\n id: options.id,\n title: options.title,\n body: readBody(options.body, options.bodyFile),\n });\n if (useJson) outputPageJson(page);\n else {\n console.log('\\n✓ Page updated');\n outputPagePretty(page);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return pages;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveWorkspaceId } from '../utils/resolve.js';\nimport {\n shouldUseJson,\n outputProductsJson,\n outputProductsPretty,\n outputProductJson,\n outputProductPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nexport function createProductsCommand(): Command {\n const products = new Command('products').description(\n 'Manage products. A workspace contains products; a product holds features and tickets.',\n );\n\n products\n .command('list')\n .description('List products in a workspace')\n .option('--workspace <slug|id>', 'Workspace slug or CUID (defaults to configured workspace)')\n .action(async (options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const list = await client.products.list(workspaceId);\n if (useJson) outputProductsJson(list);\n else outputProductsPretty(list);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n products\n .command('get <slugOrId>')\n .description('Get a product by slug or CUID')\n .option('--workspace <slug|id>', 'Workspace (required when using a slug)')\n .action(async (slugOrId: string, options: { workspace?: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const product = await client.products.resolve(workspaceId, slugOrId);\n if (useJson) outputProductJson(product);\n else outputProductPretty(product);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n products\n .command('create')\n .description('Create a new product')\n .requiredOption('-n, --name <name>', 'Product name')\n .requiredOption('--slug <slug>', 'Kebab-case slug (matches /^[a-z0-9-]+$/)')\n .option('-d, --description <text>', 'Description')\n .option('--icon <icon>', 'Icon shortcode')\n .option('--color <color>', 'Color')\n .option('--workspace <slug|id>', 'Workspace slug or CUID')\n .action(\n async (\n options: {\n name: string;\n slug: string;\n description?: string;\n icon?: string;\n color?: string;\n workspace?: string;\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n if (!/^[a-z0-9-]+$/.test(options.slug)) {\n throw new Error(\n `Invalid slug \"${options.slug}\". Slug must be kebab-case (a-z, 0-9, -).`,\n );\n }\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const product = await client.products.create({\n workspaceId,\n name: options.name,\n slug: options.slug,\n description: options.description,\n icon: options.icon,\n color: options.color,\n });\n if (useJson) outputProductJson(product);\n else {\n console.log('\\n✓ Product created');\n outputProductPretty(product);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n return products;\n}\n","import { Command } from 'commander';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputProjectsJson,\n outputProjectsPretty,\n} from '../utils/output.js';\nimport type { Project } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n workspace?: string;\n}\n\nexport function createProjectsCommand(): Command {\n const projects = new Command('projects')\n .description('Manage projects');\n\n projects\n .command('list')\n .description('List all projects')\n .option('--workspace <id>', 'Filter by workspace ID')\n .option('--include-actions', 'Include actions in output')\n .action(async (options: { workspace?: string; includeActions?: boolean }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const projects = await client.projects.list({\n workspaceId: options.workspace,\n includeActions: options.includeActions,\n });\n\n if (useJson) {\n outputProjectsJson(projects);\n } else {\n outputProjectsPretty(projects);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return projects;\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { shouldUseJson } from '../utils/output.js';\nimport type { SearchResult, Workspace } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\ninterface SearchOptions {\n workspace?: string;\n limit?: string;\n}\n\nconst TYPE_LABELS: Record<string, string> = {\n workspace: 'Workspaces',\n project: 'Projects',\n action: 'Actions',\n goal: 'Goals',\n keyResult: 'Key Results',\n outcome: 'Outcomes',\n ticket: 'Tickets',\n feature: 'Features',\n epic: 'Epics',\n page: 'Pages',\n meeting: 'Meetings',\n contact: 'Contacts',\n organization: 'Organizations',\n product: 'Products',\n};\n\nexport function createSearchCommand(): Command {\n const search = new Command('search')\n .description(\n \"Global search across projects, actions, goals, workspaces and more — same coverage as the app's Cmd+K palette\",\n )\n .argument('<query>', 'Text to search for')\n .option('-w, --workspace <slug>', 'Restrict results to one workspace (slug or ID)')\n .option('-l, --limit <n>', 'Max results per entity type (1-25, default 10)')\n .action(async (query: string, options: SearchOptions, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n\n let workspaceId: string | undefined;\n if (options.workspace) {\n const workspaces = await client.workspaces.list();\n const match = workspaces.find(\n (w: Workspace) => w.slug === options.workspace || w.id === options.workspace,\n );\n if (!match) {\n console.error(chalk.red(`Workspace \"${options.workspace}\" not found.`));\n console.log(chalk.gray('Available workspaces:'));\n workspaces.forEach((w: Workspace) => {\n console.log(chalk.gray(` - ${w.slug} (${w.name})`));\n });\n process.exit(1);\n }\n workspaceId = match.id;\n }\n\n const limit = options.limit ? Number(options.limit) : undefined;\n const result = await client.search.global({ query, workspaceId, limit });\n\n if (useJson) {\n console.log(JSON.stringify(result, null, 2));\n return;\n }\n\n if (result.results.length === 0) {\n console.log(chalk.gray(`No matches for \"${result.query}\".`));\n return;\n }\n\n const byType = new Map<string, SearchResult[]>();\n for (const r of result.results) {\n const bucket = byType.get(r.type) ?? [];\n bucket.push(r);\n byType.set(r.type, bucket);\n }\n\n for (const [type, rows] of byType) {\n console.log(chalk.bold(`\\n${TYPE_LABELS[type] ?? type}`));\n for (const row of rows) {\n const parts = [chalk.white(row.title)];\n if (row.subtitle) parts.push(chalk.gray(row.subtitle));\n if (row.workspace) parts.push(chalk.cyan(`@${row.workspace.slug}`));\n console.log(` ${parts.join(chalk.gray(' · '))}`);\n console.log(chalk.gray(` ${row.id}${row.url ? ` ${row.url}` : ''}`));\n }\n }\n console.log();\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n return search;\n}\n","import { Command } from 'commander';\nimport type { TicketStatus, TicketType } from 'exponential-sdk';\nimport { getClient } from '../client/index.js';\nimport { handleError } from '../utils/errors.js';\nimport { resolveProductId, resolveWorkspaceId } from '../utils/resolve.js';\nimport { resolveLabelIds } from './labels.js';\n\nfunction collectRepeatable(value: string, previous: string[]): string[] {\n return [...previous, value];\n}\nimport {\n shouldUseJson,\n outputCommentJson,\n outputCommentPretty,\n outputTicketJson,\n outputTicketPretty,\n outputTicketsJson,\n outputTicketsPretty,\n outputActionJson,\n outputActionPretty,\n} from '../utils/output.js';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nconst TICKET_STATUSES: TicketStatus[] = [\n 'BACKLOG',\n 'NEEDS_REFINEMENT',\n 'READY_TO_PLAN',\n 'COMMITTED',\n 'IN_PROGRESS',\n 'BLOCKED',\n 'QA',\n 'DONE',\n 'DEPLOYED',\n 'ARCHIVED',\n];\n\nconst TICKET_TYPES: TicketType[] = [\n 'BUG',\n 'FEATURE',\n 'CHORE',\n 'IMPROVEMENT',\n 'SPIKE',\n 'RESEARCH',\n];\n\nfunction validateTicketStatus(value: string | undefined): TicketStatus | undefined {\n if (!value) return undefined;\n if (!(TICKET_STATUSES as string[]).includes(value)) {\n throw new Error(\n `Invalid ticket status \"${value}\". Valid: ${TICKET_STATUSES.join(', ')}`,\n );\n }\n return value as TicketStatus;\n}\n\nfunction validateTicketType(value: string | undefined): TicketType | undefined {\n if (!value) return undefined;\n if (!(TICKET_TYPES as string[]).includes(value)) {\n throw new Error(\n `Invalid ticket type \"${value}\". Valid: ${TICKET_TYPES.join(', ')}`,\n );\n }\n return value as TicketType;\n}\n\nexport function createTicketsCommand(): Command {\n const tickets = new Command('tickets').description(\n 'Manage product backlog tickets. Tickets live under a product, link to features/epics, depend on each other, and can be implemented via actions.',\n );\n\n tickets\n .command('list')\n .description(\n 'List tickets in a product, or workspace-wide when --pr or --branch is supplied',\n )\n .option(\n '--product <slug|id>',\n 'Product slug or CUID (required unless --pr or --branch is supplied)',\n )\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .option('--status <status>', `Filter by status: ${TICKET_STATUSES.join(', ')}`)\n .option('--type <type>', `Filter by type: ${TICKET_TYPES.join(', ')}`)\n .option('--feature <id>', 'Filter by feature CUID')\n .option('--epic <id>', 'Filter by epic CUID')\n .option('--assignee <id>', 'Filter by assignee user ID')\n .option(\n '--pr <url>',\n 'Workspace-wide lookup by Ticket.prUrl (exact match). Makes --product optional.',\n )\n .option(\n '--branch <name>',\n 'Workspace-wide lookup by Ticket.branchName (exact match). Makes --product optional.',\n )\n .option(\n '--label <slug-or-id>',\n 'Filter to tickets carrying this label (repeatable; AND semantics)',\n collectRepeatable,\n [] as string[],\n )\n .action(\n async (\n options: {\n product?: string;\n workspace?: string;\n status?: string;\n type?: string;\n feature?: string;\n epic?: string;\n assignee?: string;\n pr?: string;\n branch?: string;\n label: string[];\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateTicketStatus(options.status);\n const type = validateTicketType(options.type);\n const hasWorkspaceFilter = Boolean(options.pr || options.branch);\n if (!hasWorkspaceFilter && !options.product) {\n throw new Error(\n '--product is required unless --pr or --branch is supplied',\n );\n }\n const client = getClient();\n let workspaceId: string | undefined;\n let productId: string | undefined;\n if (options.product) {\n workspaceId = await resolveWorkspaceId(client, options.workspace);\n productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n }\n const list = await client.tickets.list({\n productId,\n status,\n type,\n featureId: options.feature,\n epicId: options.epic,\n assigneeId: options.assignee,\n prUrl: options.pr,\n branchName: options.branch,\n });\n let filtered = list;\n if (options.label.length > 0) {\n const labelIds = new Set(\n await resolveLabelIds(client, workspaceId, options.label),\n );\n const ticketLabelSets = await Promise.all(\n list.map((t) =>\n client.labels\n .listForEntity({ entityType: 'ticket', entityId: t.id })\n .then((tags) => new Set(tags.map((tag) => tag.id))),\n ),\n );\n filtered = list.filter((_t, idx) => {\n const tagSet = ticketLabelSets[idx];\n if (tagSet === undefined) return false;\n for (const id of labelIds) {\n if (!tagSet.has(id)) return false;\n }\n return true;\n });\n }\n if (useJson) outputTicketsJson(filtered);\n else outputTicketsPretty(filtered);\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('get <id>')\n .description('Show a ticket with dependencies, actions, and comments')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const ticket = await client.tickets.get(id);\n if (useJson) outputTicketJson(ticket);\n else outputTicketPretty(ticket);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('show <id>')\n .description('Alias for `tickets get`')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const ticket = await client.tickets.get(id);\n if (useJson) outputTicketJson(ticket);\n else outputTicketPretty(ticket);\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('create')\n .description('Create a new ticket in a product')\n .requiredOption('--product <slug|id>', 'Product slug or CUID')\n .requiredOption('-t, --title <title>', 'Ticket title')\n .option('-b, --body <text>', 'Body (markdown supported)')\n .option('--type <type>', `Ticket type: ${TICKET_TYPES.join(', ')}`)\n .option('--status <status>', `Initial status: ${TICKET_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4 (lower = higher)', parseInt)\n .option('--points <n>', 'Story points', parseFloat)\n .option('--feature <id>', 'Feature CUID to attach to')\n .option('--scope <id>', 'Feature scope CUID to attach to (requires --feature)')\n .option('--epic <id>', 'Epic CUID to attach to')\n .option('--assignee <id>', 'Assignee user ID')\n .option('--branch <name>', 'Branch name')\n .option('--pr <url>', 'Pull request URL')\n .option('--workspace <slug|id>', 'Workspace (required when --product is a slug)')\n .option(\n '--label <slug-or-id>',\n 'Label to attach (repeatable)',\n collectRepeatable,\n [] as string[],\n )\n .action(\n async (\n options: {\n product: string;\n title: string;\n body?: string;\n type?: string;\n status?: string;\n priority?: number;\n points?: number;\n feature?: string;\n scope?: string;\n epic?: string;\n assignee?: string;\n branch?: string;\n pr?: string;\n workspace?: string;\n label: string[];\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const status = validateTicketStatus(options.status);\n const type = validateTicketType(options.type);\n const client = getClient();\n const workspaceId = await resolveWorkspaceId(client, options.workspace);\n const productId = await resolveProductId(\n client,\n workspaceId,\n options.product,\n );\n const ticket = await client.tickets.create({\n productId,\n title: options.title,\n body: options.body,\n type,\n status,\n priority: options.priority,\n points: options.points,\n featureId: options.feature,\n scopeId: options.scope,\n epicId: options.epic,\n assigneeId: options.assignee,\n branchName: options.branch,\n prUrl: options.pr,\n });\n if (options.label.length > 0) {\n const tagIds = await resolveLabelIds(client, workspaceId, options.label);\n await client.labels.setEntityTags({\n entityType: 'ticket',\n entityId: ticket.id,\n tagIds,\n });\n }\n if (useJson) outputTicketJson(ticket);\n else {\n console.log('\\n✓ Ticket created');\n outputTicketPretty(ticket);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('update')\n .description('Update an existing ticket')\n .requiredOption('--id <id>', 'Ticket CUID')\n .option('-t, --title <title>', 'New title')\n .option('-b, --body <text>', 'New body')\n .option('--type <type>', `Type: ${TICKET_TYPES.join(', ')}`)\n .option('--status <status>', `Status: ${TICKET_STATUSES.join(', ')}`)\n .option('--priority <n>', 'Priority 0-4 (or \"null\" to clear)')\n .option('--points <n>', 'Story points (or \"null\" to clear)')\n .option('--feature <id>', 'Feature CUID (or \"null\" to detach)')\n .option('--epic <id>', 'Epic CUID (or \"null\" to detach)')\n .option('--assignee <id>', 'Assignee user ID (or \"null\" to unassign)')\n .option('--branch <name>', 'Branch name (or \"null\")')\n .option('--pr <url>', 'PR URL (or \"null\")')\n .option(\n '--add-label <slug-or-id>',\n 'Label to attach to this ticket (repeatable)',\n collectRepeatable,\n [] as string[],\n )\n .option(\n '--remove-label <slug-or-id>',\n 'Label to detach from this ticket (repeatable)',\n collectRepeatable,\n [] as string[],\n )\n .action(\n async (\n options: {\n id: string;\n title?: string;\n body?: string;\n type?: string;\n status?: string;\n priority?: string;\n points?: string;\n feature?: string;\n epic?: string;\n assignee?: string;\n branch?: string;\n pr?: string;\n addLabel: string[];\n removeLabel: string[];\n },\n cmd: Command,\n ) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const parseNullableInt = (v: string | undefined): number | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n const n = parseInt(v, 10);\n if (isNaN(n)) throw new Error(`Invalid number: ${v}`);\n return n;\n };\n const parseNullableFloat = (v: string | undefined): number | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n const n = parseFloat(v);\n if (isNaN(n)) throw new Error(`Invalid number: ${v}`);\n return n;\n };\n const parseNullableString = (v: string | undefined): string | null | undefined => {\n if (v === undefined) return undefined;\n if (v === 'null') return null;\n return v;\n };\n\n const status = validateTicketStatus(options.status);\n const type = validateTicketType(options.type);\n const client = getClient();\n const ticket = await client.tickets.update({\n id: options.id,\n title: options.title,\n body: options.body,\n type,\n status,\n priority: parseNullableInt(options.priority),\n points: parseNullableFloat(options.points),\n featureId: parseNullableString(options.feature),\n epicId: parseNullableString(options.epic),\n assigneeId: parseNullableString(options.assignee),\n branchName: parseNullableString(options.branch),\n prUrl: parseNullableString(options.pr),\n });\n if (options.addLabel.length > 0 || options.removeLabel.length > 0) {\n const current = await client.labels.listForEntity({\n entityType: 'ticket',\n entityId: options.id,\n });\n const currentIds = new Set(current.map((t) => t.id));\n const addIds = await resolveLabelIds(client, undefined, options.addLabel);\n const removeIds = await resolveLabelIds(client, undefined, options.removeLabel);\n for (const id of addIds) currentIds.add(id);\n for (const id of removeIds) currentIds.delete(id);\n await client.labels.setEntityTags({\n entityType: 'ticket',\n entityId: options.id,\n tagIds: [...currentIds],\n });\n }\n if (useJson) outputTicketJson(ticket);\n else {\n console.log('\\n✓ Ticket updated');\n outputTicketPretty(ticket);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('delete <id>')\n .description('Delete a ticket')\n .action(async (id: string, _options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.tickets.delete(id);\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id }, null, 2));\n } else {\n console.log('\\n✓ Ticket deleted');\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('block <ticket>')\n .description('Mark <ticket> as blocked by another ticket')\n .requiredOption('--by <id>', 'Ticket CUID that must complete first')\n .action(\n async (ticket: string, options: { by: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const dep = await client.tickets.addDependency(ticket, options.by);\n if (useJson) {\n console.log(JSON.stringify(dep, null, 2));\n } else {\n const depId = dep.dependsOn.shortId ?? (dep.dependsOn.number != null ? `#${dep.dependsOn.number}` : dep.dependsOn.id);\n console.log(`\\n✓ Ticket ${ticket} now depends on ${depId} ${dep.dependsOn.title}`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('unblock <ticket>')\n .description('Remove a blocking dependency from <ticket>')\n .requiredOption('--by <id>', 'The ticket CUID that was blocking')\n .action(\n async (ticket: string, options: { by: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.tickets.removeDependency(ticket, options.by);\n if (useJson) {\n console.log(JSON.stringify({ ticketId: ticket, removedBlocker: options.by }, null, 2));\n } else {\n console.log(`\\n✓ Dependency removed: ${ticket} no longer blocked by ${options.by}`);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n },\n );\n\n tickets\n .command('link-action')\n .description('Attach an existing action to a ticket')\n .requiredOption('--id <id>', 'Ticket CUID')\n .requiredOption('--action <id>', 'Action CUID')\n .action(async (options: { id: string; action: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const action = await client.tickets.linkAction(options.id, options.action);\n if (useJson) outputActionJson(action);\n else {\n console.log('\\n✓ Action linked to ticket');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets\n .command('unlink-action')\n .description('Detach an action from whatever ticket it is on')\n .requiredOption('--action <id>', 'Action CUID')\n .action(async (options: { action: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const action = await client.tickets.unlinkAction(options.action);\n if (useJson) outputActionJson(action);\n else {\n console.log('\\n✓ Action unlinked');\n outputActionPretty(action);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n const comment = new Command('comment').description('Manage comments on a ticket');\n\n comment\n .command('add')\n .description('Add a comment to a ticket')\n .requiredOption('--id <id>', 'Ticket CUID')\n .requiredOption('-m, --message <text>', 'Comment content (markdown supported)')\n .action(async (options: { id: string; message: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n const created = await client.tickets.addComment({\n ticketId: options.id,\n content: options.message,\n });\n if (useJson) outputCommentJson(created);\n else {\n console.log('\\n✓ Comment added');\n outputCommentPretty(created);\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n comment\n .command('delete')\n .description('Delete one of your own ticket comments')\n .requiredOption('--comment-id <id>', 'Comment ID')\n .action(async (options: { commentId: string }, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n try {\n const client = getClient();\n await client.tickets.deleteComment(options.commentId);\n if (useJson) {\n console.log(JSON.stringify({ deleted: true, id: options.commentId }, null, 2));\n } else {\n console.log('\\n✓ Comment deleted');\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n tickets.addCommand(comment);\n\n return tickets;\n}\n","import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { getClient } from '../client/index.js';\nimport { getConfig, setConfig } from '../config/index.js';\nimport { handleError } from '../utils/errors.js';\nimport {\n shouldUseJson,\n outputWorkspacesJson,\n outputWorkspacesPretty,\n} from '../utils/output.js';\nimport type { Workspace } from 'exponential-sdk';\n\ninterface GlobalOptions {\n json?: boolean;\n pretty?: boolean;\n}\n\nexport function createWorkspacesCommand(): Command {\n const workspaces = new Command('workspaces')\n .description('Manage workspaces');\n\n workspaces\n .command('list')\n .description('List all workspaces')\n .action(async (_options: Record<string, never>, cmd: Command) => {\n const globalOpts = cmd.optsWithGlobals() as GlobalOptions;\n const useJson = shouldUseJson(globalOpts.json, globalOpts.pretty);\n\n try {\n const client = getClient();\n const workspaces = await client.workspaces.list();\n\n if (useJson) {\n outputWorkspacesJson(workspaces);\n } else {\n const config = getConfig();\n outputWorkspacesPretty(workspaces);\n\n if (config.defaultWorkspaceSlug) {\n console.log(chalk.gray(`Default workspace: ${config.defaultWorkspaceSlug}`));\n }\n }\n } catch (error) {\n handleError(error, useJson);\n }\n });\n\n workspaces\n .command('set-default <slug>')\n .description('Set the default workspace')\n .action(async (slug: string) => {\n try {\n const client = getClient();\n const workspaces = await client.workspaces.list();\n\n const workspace = workspaces.find((w: Workspace) => w.slug === slug);\n\n if (!workspace) {\n console.error(chalk.red(`Workspace with slug \"${slug}\" not found.`));\n console.log(chalk.gray('Available workspaces:'));\n workspaces.forEach((w: Workspace) => {\n console.log(chalk.gray(` - ${w.slug} (${w.name})`));\n });\n process.exit(1);\n }\n\n setConfig({\n defaultWorkspaceId: workspace.id,\n defaultWorkspaceSlug: workspace.slug,\n });\n\n console.log(chalk.green(`Default workspace set to: ${workspace.name} (${workspace.slug})`));\n } catch (error) {\n handleError(error);\n }\n });\n\n return workspaces;\n}\n"],"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,EACC,QAAQ,OAAO,EACf,OAAO,UAAU,qCAAqC,EACtD,OAAO,YAAY,6BAA6B;AAGnD,QAAQ,WAAW,kBAAkB,CAAC;AACtC,QAAQ,WAAW,qBAAqB,CAAC;AACzC,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,oBAAoB,CAAC;AACxC,QAAQ,WAAW,2BAA2B,CAAC;AAC/C,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,oBAAoB,CAAC;AACxC,QAAQ,WAAW,qBAAqB,CAAC;AACzC,QAAQ,WAAW,wBAAwB,CAAC;AAE5C,QAAQ,MAAM;","names":["Command","chalk","chalk","Command","chalk","Command","actions","Command","Command","Command","Command","Command","Command","Command","Command","Command","story","Command","Command","Command","readStdin","Command","Command","chalk","Command","Command","Command","chalk","chalk","Command","Command","Command","Command","Command","Command","Command","Command","Command","projects","Command","chalk","Command","chalk","Command","Command","Command","chalk","Command","workspaces","chalk","Command"]}
|