@shepai/cli 1.5.0 → 1.6.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/README.md +1 -1
- package/dist/src/application/ports/output/agent-validator.interface.d.ts +37 -0
- package/dist/src/application/ports/output/agent-validator.interface.d.ts.map +1 -0
- package/dist/src/application/ports/output/agent-validator.interface.js +11 -0
- package/dist/src/application/ports/output/index.d.ts +1 -0
- package/dist/src/application/ports/output/index.d.ts.map +1 -1
- package/dist/src/application/use-cases/agents/configure-agent.use-case.d.ts +47 -0
- package/dist/src/application/use-cases/agents/configure-agent.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/configure-agent.use-case.js +82 -0
- package/dist/src/application/use-cases/agents/validate-agent-auth.use-case.d.ts +31 -0
- package/dist/src/application/use-cases/agents/validate-agent-auth.use-case.d.ts.map +1 -0
- package/dist/src/application/use-cases/agents/validate-agent-auth.use-case.js +51 -0
- package/dist/src/domain/factories/settings-defaults.factory.d.ts +1 -0
- package/dist/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
- package/dist/src/domain/factories/settings-defaults.factory.js +17 -0
- package/dist/src/domain/generated/output.d.ts +32 -0
- package/dist/src/domain/generated/output.d.ts.map +1 -1
- package/dist/src/domain/generated/output.js +13 -0
- package/dist/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/src/infrastructure/di/container.js +12 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +3 -0
- package/dist/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
- package/dist/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +10 -0
- package/dist/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
- package/dist/src/infrastructure/persistence/sqlite/migrations.js +4 -1
- package/dist/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/src/infrastructure/repositories/sqlite-settings.repository.js +11 -6
- package/dist/src/infrastructure/services/agents/agent-validator.service.d.ts +43 -0
- package/dist/src/infrastructure/services/agents/agent-validator.service.d.ts.map +1 -0
- package/dist/src/infrastructure/services/agents/agent-validator.service.js +62 -0
- package/dist/src/presentation/cli/commands/settings/agent.command.d.ts +16 -0
- package/dist/src/presentation/cli/commands/settings/agent.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/settings/agent.command.js +75 -0
- package/dist/src/presentation/cli/commands/settings/index.d.ts +1 -0
- package/dist/src/presentation/cli/commands/settings/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/index.js +4 -1
- package/dist/src/presentation/tui/index.d.ts +3 -0
- package/dist/src/presentation/tui/index.d.ts.map +1 -0
- package/dist/src/presentation/tui/index.js +2 -0
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts +48 -0
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -0
- package/dist/src/presentation/tui/prompts/agent-select.prompt.js +47 -0
- package/dist/src/presentation/tui/prompts/auth-method.prompt.d.ts +36 -0
- package/dist/src/presentation/tui/prompts/auth-method.prompt.d.ts.map +1 -0
- package/dist/src/presentation/tui/prompts/auth-method.prompt.js +32 -0
- package/dist/src/presentation/tui/themes/shep.theme.d.ts +23 -0
- package/dist/src/presentation/tui/themes/shep.theme.d.ts.map +1 -0
- package/dist/src/presentation/tui/themes/shep.theme.js +23 -0
- package/dist/src/presentation/tui/wizards/agent-config.wizard.d.ts +27 -0
- package/dist/src/presentation/tui/wizards/agent-config.wizard.d.ts.map +1 -0
- package/dist/src/presentation/tui/wizards/agent-config.wizard.js +38 -0
- package/dist/src/presentation/web/components/ui/button.d.ts +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/cache/.previewinfo +1 -1
- package/web/.next/cache/.rscinfo +1 -1
- package/web/.next/cache/config.json +3 -3
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.html +2 -2
- package/web/.next/server/app/_not-found.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/index.html +2 -2
- package/web/.next/server/app/index.rsc +1 -1
- package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.html +2 -2
- package/web/.next/server/app/version.rsc +1 -1
- package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
- package/web/.next/server/pages/404.html +2 -2
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/trace +1 -1
- package/web/.next/trace-build +1 -1
- /package/web/.next/static/{Z9XCmAv7-DjAFCpNEPaUt → KEXMk8lvSdd16ntuo5U2V}/_buildManifest.js +0 -0
- /package/web/.next/static/{Z9XCmAv7-DjAFCpNEPaUt → KEXMk8lvSdd16ntuo5U2V}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{Z9XCmAv7-DjAFCpNEPaUt → KEXMk8lvSdd16ntuo5U2V}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Validator Service
|
|
3
|
+
*
|
|
4
|
+
* Infrastructure implementation of the IAgentValidator port.
|
|
5
|
+
* Checks if AI agent binaries are available on the system by
|
|
6
|
+
* executing `<binary> --version` via subprocess.
|
|
7
|
+
*
|
|
8
|
+
* Uses constructor dependency injection for the command executor
|
|
9
|
+
* to enable testability without mocking node:child_process directly.
|
|
10
|
+
*/
|
|
11
|
+
import type { AgentType } from '../../../domain/generated/output.js';
|
|
12
|
+
import type { IAgentValidator, AgentValidationResult } from '../../../application/ports/output/agent-validator.interface.js';
|
|
13
|
+
/**
|
|
14
|
+
* Type for the command executor dependency.
|
|
15
|
+
* Matches the promisified signature of child_process.execFile.
|
|
16
|
+
* Injected via constructor to avoid direct node module mocking in tests.
|
|
17
|
+
*/
|
|
18
|
+
export type ExecFunction = (file: string, args: string[]) => Promise<{
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Service that validates agent tool availability on the system.
|
|
24
|
+
*
|
|
25
|
+
* Checks if the agent binary exists and is executable by running
|
|
26
|
+
* `<binary> --version` and parsing the output.
|
|
27
|
+
*/
|
|
28
|
+
export declare class AgentValidatorService implements IAgentValidator {
|
|
29
|
+
private readonly execFn;
|
|
30
|
+
/**
|
|
31
|
+
* @param execFn - Command executor function (injectable for testing).
|
|
32
|
+
* Uses execFile semantics (no shell) to prevent command injection.
|
|
33
|
+
*/
|
|
34
|
+
constructor(execFn: ExecFunction);
|
|
35
|
+
/**
|
|
36
|
+
* Check if the specified agent tool is available on the system.
|
|
37
|
+
*
|
|
38
|
+
* @param agentType - The agent type to check
|
|
39
|
+
* @returns Validation result with availability status and version
|
|
40
|
+
*/
|
|
41
|
+
isAvailable(agentType: AgentType): Promise<AgentValidationResult>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=agent-validator.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-validator.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/agents/agent-validator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,gEAAgE,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,KACX,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AASjD;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC;;;OAGG;gBACS,MAAM,EAAE,YAAY;IAIhC;;;;;OAKG;IACG,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA2BxE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Validator Service
|
|
3
|
+
*
|
|
4
|
+
* Infrastructure implementation of the IAgentValidator port.
|
|
5
|
+
* Checks if AI agent binaries are available on the system by
|
|
6
|
+
* executing `<binary> --version` via subprocess.
|
|
7
|
+
*
|
|
8
|
+
* Uses constructor dependency injection for the command executor
|
|
9
|
+
* to enable testability without mocking node:child_process directly.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Map of supported agent types to their binary command names.
|
|
13
|
+
*/
|
|
14
|
+
const AGENT_BINARY_MAP = {
|
|
15
|
+
'claude-code': 'claude',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Service that validates agent tool availability on the system.
|
|
19
|
+
*
|
|
20
|
+
* Checks if the agent binary exists and is executable by running
|
|
21
|
+
* `<binary> --version` and parsing the output.
|
|
22
|
+
*/
|
|
23
|
+
export class AgentValidatorService {
|
|
24
|
+
execFn;
|
|
25
|
+
/**
|
|
26
|
+
* @param execFn - Command executor function (injectable for testing).
|
|
27
|
+
* Uses execFile semantics (no shell) to prevent command injection.
|
|
28
|
+
*/
|
|
29
|
+
constructor(execFn) {
|
|
30
|
+
this.execFn = execFn;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if the specified agent tool is available on the system.
|
|
34
|
+
*
|
|
35
|
+
* @param agentType - The agent type to check
|
|
36
|
+
* @returns Validation result with availability status and version
|
|
37
|
+
*/
|
|
38
|
+
async isAvailable(agentType) {
|
|
39
|
+
const binary = AGENT_BINARY_MAP[agentType];
|
|
40
|
+
if (!binary) {
|
|
41
|
+
return {
|
|
42
|
+
available: false,
|
|
43
|
+
error: `Agent type "${agentType}" is not supported yet`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const { stdout } = await this.execFn(binary, ['--version']);
|
|
48
|
+
const version = stdout.trim();
|
|
49
|
+
return {
|
|
50
|
+
available: true,
|
|
51
|
+
version,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
56
|
+
return {
|
|
57
|
+
available: false,
|
|
58
|
+
error: `Binary "${binary}" not found or not executable: ${message}`,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Configuration Command
|
|
3
|
+
*
|
|
4
|
+
* Configures the AI coding agent used by Shep for all LLM-powered operations.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep settings agent # Interactive wizard
|
|
8
|
+
* shep settings agent --agent claude-code --auth session # Non-interactive
|
|
9
|
+
* shep settings agent --agent claude-code --auth token --token sk-xxx # Token auth
|
|
10
|
+
*/
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
/**
|
|
13
|
+
* Create the agent configuration command
|
|
14
|
+
*/
|
|
15
|
+
export declare function createAgentCommand(): Command;
|
|
16
|
+
//# sourceMappingURL=agent.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.command.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/agent.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAgE5C"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Configuration Command
|
|
3
|
+
*
|
|
4
|
+
* Configures the AI coding agent used by Shep for all LLM-powered operations.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* shep settings agent # Interactive wizard
|
|
8
|
+
* shep settings agent --agent claude-code --auth session # Non-interactive
|
|
9
|
+
* shep settings agent --agent claude-code --auth token --token sk-xxx # Token auth
|
|
10
|
+
*/
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
import { container } from '../../../../infrastructure/di/container.js';
|
|
13
|
+
import { ConfigureAgentUseCase, } from '../../../../application/use-cases/agents/configure-agent.use-case.js';
|
|
14
|
+
import { agentConfigWizard } from '../../../tui/wizards/agent-config.wizard.js';
|
|
15
|
+
import { resetSettings, initializeSettings, } from '../../../../infrastructure/services/settings.service.js';
|
|
16
|
+
import { messages } from '../../ui/index.js';
|
|
17
|
+
/**
|
|
18
|
+
* Create the agent configuration command
|
|
19
|
+
*/
|
|
20
|
+
export function createAgentCommand() {
|
|
21
|
+
return new Command('agent')
|
|
22
|
+
.description('Configure AI coding agent')
|
|
23
|
+
.option('--agent <type>', 'Agent type (e.g., claude-code)')
|
|
24
|
+
.option('--auth <method>', 'Auth method (session or token)')
|
|
25
|
+
.option('--token <key>', 'API token for token-based auth')
|
|
26
|
+
.addHelpText('after', `
|
|
27
|
+
Examples:
|
|
28
|
+
$ shep settings agent Interactive wizard
|
|
29
|
+
$ shep settings agent --agent claude-code --auth session Non-interactive
|
|
30
|
+
$ shep settings agent --agent claude-code --auth token --token sk-xxx Token auth`)
|
|
31
|
+
.action(async (options) => {
|
|
32
|
+
try {
|
|
33
|
+
const isNonInteractive = options.agent !== undefined;
|
|
34
|
+
let input;
|
|
35
|
+
if (isNonInteractive) {
|
|
36
|
+
// Non-interactive: require --auth when --agent is provided
|
|
37
|
+
if (!options.auth) {
|
|
38
|
+
messages.error('--auth is required when using --agent flag');
|
|
39
|
+
process.exitCode = 1;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
input = {
|
|
43
|
+
type: options.agent,
|
|
44
|
+
authMethod: options.auth,
|
|
45
|
+
...(options.token !== undefined && { token: options.token }),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// Interactive: launch wizard
|
|
50
|
+
const wizardResult = await agentConfigWizard();
|
|
51
|
+
input = {
|
|
52
|
+
type: wizardResult.type,
|
|
53
|
+
authMethod: wizardResult.authMethod,
|
|
54
|
+
...(wizardResult.token !== undefined && { token: wizardResult.token }),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const useCase = container.resolve(ConfigureAgentUseCase);
|
|
58
|
+
const updatedSettings = await useCase.execute(input);
|
|
59
|
+
// Update the in-memory settings singleton
|
|
60
|
+
resetSettings();
|
|
61
|
+
initializeSettings(updatedSettings);
|
|
62
|
+
messages.success(`Agent configured: ${input.type} (${input.authMethod})`);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
66
|
+
// Handle user cancellation (Ctrl+C) gracefully
|
|
67
|
+
if (err.message.includes('force closed') || err.message.includes('User force closed')) {
|
|
68
|
+
messages.info('Configuration cancelled.');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
messages.error('Failed to configure agent', err);
|
|
72
|
+
process.exitCode = 1;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/cli/commands/settings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAM/C"}
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* Usage:
|
|
7
7
|
* shep settings show # Display current settings
|
|
8
8
|
* shep settings init # Initialize settings to defaults
|
|
9
|
+
* shep settings agent # Configure AI coding agent
|
|
9
10
|
*/
|
|
10
11
|
import { Command } from 'commander';
|
|
11
12
|
import { createShowCommand } from './show.command.js';
|
|
12
13
|
import { createInitCommand } from './init.command.js';
|
|
14
|
+
import { createAgentCommand } from './agent.command.js';
|
|
13
15
|
/**
|
|
14
16
|
* Create the settings command group
|
|
15
17
|
*/
|
|
@@ -17,5 +19,6 @@ export function createSettingsCommand() {
|
|
|
17
19
|
return new Command('settings')
|
|
18
20
|
.description('Manage Shep global settings')
|
|
19
21
|
.addCommand(createShowCommand())
|
|
20
|
-
.addCommand(createInitCommand())
|
|
22
|
+
.addCommand(createInitCommand())
|
|
23
|
+
.addCommand(createAgentCommand());
|
|
21
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/presentation/tui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Select Prompt Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for the @inquirer/select prompt that lets users
|
|
5
|
+
* choose their AI coding agent.
|
|
6
|
+
*/
|
|
7
|
+
import { AgentType } from '@/domain/generated/output.js';
|
|
8
|
+
/**
|
|
9
|
+
* Creates the @inquirer/select configuration for selecting an AI coding agent.
|
|
10
|
+
*
|
|
11
|
+
* Only Claude Code is currently available. Other agents are shown as
|
|
12
|
+
* disabled with a "Coming Soon" badge.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createAgentSelectConfig(): {
|
|
15
|
+
readonly message: "Select your AI coding agent";
|
|
16
|
+
readonly choices: readonly [{
|
|
17
|
+
readonly name: "Claude Code";
|
|
18
|
+
readonly value: AgentType.ClaudeCode;
|
|
19
|
+
readonly description: "Anthropic Claude Code CLI";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "Gemini CLI";
|
|
22
|
+
readonly value: AgentType.GeminiCli;
|
|
23
|
+
readonly disabled: "(Coming Soon)";
|
|
24
|
+
}, {
|
|
25
|
+
readonly name: "Aider";
|
|
26
|
+
readonly value: AgentType.Aider;
|
|
27
|
+
readonly disabled: "(Coming Soon)";
|
|
28
|
+
}, {
|
|
29
|
+
readonly name: "Continue";
|
|
30
|
+
readonly value: AgentType.Continue;
|
|
31
|
+
readonly disabled: "(Coming Soon)";
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "Cursor";
|
|
34
|
+
readonly value: AgentType.Cursor;
|
|
35
|
+
readonly disabled: "(Coming Soon)";
|
|
36
|
+
}];
|
|
37
|
+
readonly theme: {
|
|
38
|
+
readonly prefix: {
|
|
39
|
+
readonly idle: string;
|
|
40
|
+
readonly done: string;
|
|
41
|
+
};
|
|
42
|
+
readonly style: {
|
|
43
|
+
readonly highlight: import("picocolors/types.js").Formatter;
|
|
44
|
+
readonly answer: import("picocolors/types.js").Formatter;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=agent-select.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-select.prompt.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/prompts/agent-select.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCtC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Select Prompt Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for the @inquirer/select prompt that lets users
|
|
5
|
+
* choose their AI coding agent.
|
|
6
|
+
*/
|
|
7
|
+
import { AgentType } from '@/domain/generated/output.js';
|
|
8
|
+
import { shepTheme } from '../themes/shep.theme.js';
|
|
9
|
+
/**
|
|
10
|
+
* Creates the @inquirer/select configuration for selecting an AI coding agent.
|
|
11
|
+
*
|
|
12
|
+
* Only Claude Code is currently available. Other agents are shown as
|
|
13
|
+
* disabled with a "Coming Soon" badge.
|
|
14
|
+
*/
|
|
15
|
+
export function createAgentSelectConfig() {
|
|
16
|
+
return {
|
|
17
|
+
message: 'Select your AI coding agent',
|
|
18
|
+
choices: [
|
|
19
|
+
{
|
|
20
|
+
name: 'Claude Code',
|
|
21
|
+
value: AgentType.ClaudeCode,
|
|
22
|
+
description: 'Anthropic Claude Code CLI',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Gemini CLI',
|
|
26
|
+
value: AgentType.GeminiCli,
|
|
27
|
+
disabled: '(Coming Soon)',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Aider',
|
|
31
|
+
value: AgentType.Aider,
|
|
32
|
+
disabled: '(Coming Soon)',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Continue',
|
|
36
|
+
value: AgentType.Continue,
|
|
37
|
+
disabled: '(Coming Soon)',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Cursor',
|
|
41
|
+
value: AgentType.Cursor,
|
|
42
|
+
disabled: '(Coming Soon)',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
theme: shepTheme,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Method Prompt Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for the @inquirer/select prompt that lets users
|
|
5
|
+
* choose their authentication method for the selected agent.
|
|
6
|
+
*/
|
|
7
|
+
import { AgentAuthMethod } from '@/domain/generated/output.js';
|
|
8
|
+
/**
|
|
9
|
+
* Creates the @inquirer/select configuration for selecting an authentication method.
|
|
10
|
+
*
|
|
11
|
+
* Users can choose between session-based auth (built into the agent CLI)
|
|
12
|
+
* or token-based auth (providing an API key).
|
|
13
|
+
*/
|
|
14
|
+
export declare function createAuthMethodConfig(): {
|
|
15
|
+
readonly message: "Select authentication method";
|
|
16
|
+
readonly choices: readonly [{
|
|
17
|
+
readonly name: "Use existing session";
|
|
18
|
+
readonly value: AgentAuthMethod.Session;
|
|
19
|
+
readonly description: "Use Claude Code built-in authentication";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "Use API token";
|
|
22
|
+
readonly value: AgentAuthMethod.Token;
|
|
23
|
+
readonly description: "Provide an Anthropic API key";
|
|
24
|
+
}];
|
|
25
|
+
readonly theme: {
|
|
26
|
+
readonly prefix: {
|
|
27
|
+
readonly idle: string;
|
|
28
|
+
readonly done: string;
|
|
29
|
+
};
|
|
30
|
+
readonly style: {
|
|
31
|
+
readonly highlight: import("picocolors/types.js").Formatter;
|
|
32
|
+
readonly answer: import("picocolors/types.js").Formatter;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=auth-method.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-method.prompt.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/prompts/auth-method.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D;;;;;GAKG;AACH,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;EAiBrC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Method Prompt Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration for the @inquirer/select prompt that lets users
|
|
5
|
+
* choose their authentication method for the selected agent.
|
|
6
|
+
*/
|
|
7
|
+
import { AgentAuthMethod } from '@/domain/generated/output.js';
|
|
8
|
+
import { shepTheme } from '../themes/shep.theme.js';
|
|
9
|
+
/**
|
|
10
|
+
* Creates the @inquirer/select configuration for selecting an authentication method.
|
|
11
|
+
*
|
|
12
|
+
* Users can choose between session-based auth (built into the agent CLI)
|
|
13
|
+
* or token-based auth (providing an API key).
|
|
14
|
+
*/
|
|
15
|
+
export function createAuthMethodConfig() {
|
|
16
|
+
return {
|
|
17
|
+
message: 'Select authentication method',
|
|
18
|
+
choices: [
|
|
19
|
+
{
|
|
20
|
+
name: 'Use existing session',
|
|
21
|
+
value: AgentAuthMethod.Session,
|
|
22
|
+
description: 'Use Claude Code built-in authentication',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Use API token',
|
|
26
|
+
value: AgentAuthMethod.Token,
|
|
27
|
+
description: 'Provide an Anthropic API key',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
theme: shepTheme,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shep TUI Theme
|
|
3
|
+
*
|
|
4
|
+
* Custom theme for @inquirer/prompts that matches the Shep CLI design system.
|
|
5
|
+
* Uses picocolors for consistent styling with the rest of the CLI.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Shep-branded theme for @inquirer/prompts.
|
|
9
|
+
*
|
|
10
|
+
* Customizes the prefix icon to use the Shep brand color (cyan)
|
|
11
|
+
* and provides consistent styling across all TUI prompts.
|
|
12
|
+
*/
|
|
13
|
+
export declare const shepTheme: {
|
|
14
|
+
readonly prefix: {
|
|
15
|
+
readonly idle: string;
|
|
16
|
+
readonly done: string;
|
|
17
|
+
};
|
|
18
|
+
readonly style: {
|
|
19
|
+
readonly highlight: import("picocolors/types").Formatter;
|
|
20
|
+
readonly answer: import("picocolors/types").Formatter;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=shep.theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shep.theme.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/themes/shep.theme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,SAAS;;;;;;;;;CASZ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shep TUI Theme
|
|
3
|
+
*
|
|
4
|
+
* Custom theme for @inquirer/prompts that matches the Shep CLI design system.
|
|
5
|
+
* Uses picocolors for consistent styling with the rest of the CLI.
|
|
6
|
+
*/
|
|
7
|
+
import pc from 'picocolors';
|
|
8
|
+
/**
|
|
9
|
+
* Shep-branded theme for @inquirer/prompts.
|
|
10
|
+
*
|
|
11
|
+
* Customizes the prefix icon to use the Shep brand color (cyan)
|
|
12
|
+
* and provides consistent styling across all TUI prompts.
|
|
13
|
+
*/
|
|
14
|
+
export const shepTheme = {
|
|
15
|
+
prefix: {
|
|
16
|
+
idle: pc.cyan('?'),
|
|
17
|
+
done: pc.green('\u2714'),
|
|
18
|
+
},
|
|
19
|
+
style: {
|
|
20
|
+
highlight: pc.cyan,
|
|
21
|
+
answer: pc.cyan,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Configuration Wizard
|
|
3
|
+
*
|
|
4
|
+
* Interactive TUI wizard that guides users through selecting
|
|
5
|
+
* an AI coding agent and configuring authentication.
|
|
6
|
+
*/
|
|
7
|
+
import { AgentAuthMethod, type AgentType } from '@/domain/generated/output.js';
|
|
8
|
+
/**
|
|
9
|
+
* Result returned by the agent configuration wizard.
|
|
10
|
+
*/
|
|
11
|
+
export interface AgentConfigResult {
|
|
12
|
+
type: AgentType;
|
|
13
|
+
authMethod: AgentAuthMethod;
|
|
14
|
+
token?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Runs the interactive agent configuration wizard.
|
|
18
|
+
*
|
|
19
|
+
* Steps:
|
|
20
|
+
* 1. Select an AI coding agent (only Claude Code is currently enabled)
|
|
21
|
+
* 2. Select an authentication method (session or token)
|
|
22
|
+
* 3. If token auth is selected, prompt for the API key
|
|
23
|
+
*
|
|
24
|
+
* @returns The selected agent configuration
|
|
25
|
+
*/
|
|
26
|
+
export declare function agentConfigWizard(): Promise<AgentConfigResult>;
|
|
27
|
+
//# sourceMappingURL=agent-config.wizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-config.wizard.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/wizards/agent-config.wizard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAK/E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAoBpE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Configuration Wizard
|
|
3
|
+
*
|
|
4
|
+
* Interactive TUI wizard that guides users through selecting
|
|
5
|
+
* an AI coding agent and configuring authentication.
|
|
6
|
+
*/
|
|
7
|
+
import { select, password } from '@inquirer/prompts';
|
|
8
|
+
import { AgentAuthMethod } from '@/domain/generated/output.js';
|
|
9
|
+
import { createAgentSelectConfig } from '../prompts/agent-select.prompt.js';
|
|
10
|
+
import { createAuthMethodConfig } from '../prompts/auth-method.prompt.js';
|
|
11
|
+
import { shepTheme } from '../themes/shep.theme.js';
|
|
12
|
+
/**
|
|
13
|
+
* Runs the interactive agent configuration wizard.
|
|
14
|
+
*
|
|
15
|
+
* Steps:
|
|
16
|
+
* 1. Select an AI coding agent (only Claude Code is currently enabled)
|
|
17
|
+
* 2. Select an authentication method (session or token)
|
|
18
|
+
* 3. If token auth is selected, prompt for the API key
|
|
19
|
+
*
|
|
20
|
+
* @returns The selected agent configuration
|
|
21
|
+
*/
|
|
22
|
+
export async function agentConfigWizard() {
|
|
23
|
+
const agentType = await select(createAgentSelectConfig());
|
|
24
|
+
const authMethod = await select(createAuthMethodConfig());
|
|
25
|
+
const result = {
|
|
26
|
+
type: agentType,
|
|
27
|
+
authMethod,
|
|
28
|
+
};
|
|
29
|
+
if (authMethod === AgentAuthMethod.Token) {
|
|
30
|
+
const token = await password({
|
|
31
|
+
message: 'Enter your Anthropic API key',
|
|
32
|
+
mask: '*',
|
|
33
|
+
theme: shepTheme,
|
|
34
|
+
});
|
|
35
|
+
result.token = token;
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
8
|
asChild?: boolean;
|