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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/assets/cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ async function main() {
const stackName = toStackName(spec.name, target.name);

// Extract credentials from deployed state for this target
const targetState = (deployedState as Record<string, unknown>)?.targets as Record<string, Record<string, unknown>> | undefined;
const targetState = (deployedState as Record<string, unknown>)?.targets as
| Record<string, Record<string, unknown>>
| undefined;
const targetResources = targetState?.[target.name]?.resources as Record<string, unknown> | undefined;
const credentials = targetResources?.credentials as Record<string, { credentialProviderArn: string; clientSecretArn?: string }> | undefined;
const credentials = targetResources?.credentials as
| Record<string, { credentialProviderArn: string; clientSecretArn?: string }>
| undefined;

new AgentCoreStack(app, stackName, {
spec,
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/deploy/actions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ConfigIO, SecureCredentials } from '../../../lib';
import type { DeployedState } from '../../../schema';
import { validateAwsCredentials } from '../../aws/account';
import { createSwitchableIoHost } from '../../cdk/toolkit-lib';
import { buildDeployedState, getStackOutputs, parseAgentOutputs, parseGatewayOutputs } from '../../cloudformation';
Expand All @@ -20,7 +21,6 @@ import {
} from '../../operations/deploy';
import { formatTargetStatus, getGatewayTargetStatuses } from '../../operations/deploy/gateway-status';
import type { DeployResult } from './types';
import type { DeployedState } from '../../../schema';

export interface ValidatedDeployOptions {
target: string;
Expand Down Expand Up @@ -190,7 +190,7 @@ export async function handleDeploy(options: ValidatedDeployOptions): Promise<Dep

// Write credential ARNs to deployed state before CDK synth so the template can read them
if (Object.keys(deployedCredentials).length > 0) {
const existingPreSynthState = await configIO.readDeployedState().catch(() => ({targets: {}} as DeployedState));
const existingPreSynthState = await configIO.readDeployedState().catch(() => ({ targets: {} }) as DeployedState);
const targetState = existingPreSynthState.targets?.[target.name] ?? { resources: {} };
targetState.resources ??= {};
targetState.resources.credentials = deployedCredentials;
Expand Down
7 changes: 5 additions & 2 deletions src/cli/tui/hooks/useCdkPreflight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@

// Check if API key providers need setup before CDK synth (CDK needs credential ARNs)
// Skip this check if skipIdentityCheck is true (e.g., plan command only synthesizes)
const needsCredentialSetup = !skipIdentityCheck && (hasIdentityApiProviders(preflightContext.projectSpec) || hasIdentityOAuthProviders(preflightContext.projectSpec));
const needsCredentialSetup =
!skipIdentityCheck &&
(hasIdentityApiProviders(preflightContext.projectSpec) ||
hasIdentityOAuthProviders(preflightContext.projectSpec));
if (needsCredentialSetup) {
// Get all credentials for the prompt (not just missing ones)
const allCredentials = getAllCredentials(preflightContext.projectSpec);
Expand Down Expand Up @@ -641,7 +644,7 @@
if (Object.keys(deployedCredentials).length > 0) {
const configIO = new ConfigIO();
const target = context.awsTargets[0];
const existingState = await configIO.readDeployedState().catch(() => ({ targets: {} } as DeployedState));
const existingState = await configIO.readDeployedState().catch(() => ({ targets: {} }) as DeployedState);
const targetState = existingState.targets?.[target!.name] ?? { resources: {} };
targetState.resources ??= {};
targetState.resources.credentials = deployedCredentials;
Expand Down Expand Up @@ -709,7 +712,7 @@
};

void runIdentitySetup();
}, [phase, context, skipIdentitySetup, runtimeCredentials, logger]);

Check warning on line 715 in src/cli/tui/hooks/useCdkPreflight.ts

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'switchableIoHost.ioHost'. Either include it or remove the dependency array

// Handle bootstrapping phase
useEffect(() => {
Expand Down
8 changes: 1 addition & 7 deletions src/cli/tui/screens/mcp/AddGatewayFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ interface AddGatewayFlowProps {
onDeploy?: () => void;
}

export function AddGatewayFlow({
isInteractive = true,
onExit,
onBack,
onDev,
onDeploy,
}: AddGatewayFlowProps) {
export function AddGatewayFlow({ isInteractive = true, onExit, onBack, onDev, onDeploy }: AddGatewayFlowProps) {
const { createGateway, reset: resetCreate } = useCreateGateway();
const { gateways: existingGateways, refresh: refreshGateways } = useExistingGateways();
const { targets: unassignedTargets } = useUnassignedTargets();
Expand Down
7 changes: 1 addition & 6 deletions src/cli/tui/screens/mcp/AddGatewayScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ interface AddGatewayScreenProps {
unassignedTargets: string[];
}

export function AddGatewayScreen({
onComplete,
onExit,
existingGateways,
unassignedTargets,
}: AddGatewayScreenProps) {
export function AddGatewayScreen({ onComplete, onExit, existingGateways, unassignedTargets }: AddGatewayScreenProps) {
const wizard = useAddGatewayWizard(unassignedTargets.length);

// JWT config sub-step tracking (0 = discoveryUrl, 1 = audience, 2 = clients)
Expand Down
Loading