import { Command, Option } from "commander"; import { Agent } from "node:http"; import { NodeHttpHandler } from "@smithy/node-http-handler"; import { Agent as Agent$1 } from "agent-base"; import { SSMClient } from "@aws-sdk/client-ssm"; import { spawn } from "node:child_process"; import { WebSocket } from "ws"; import graphlib from "graphlib"; import { AwsCredentialIdentityProvider } from "@smithy/types"; //#region src/types/resource.d.ts interface CloudFormationTemplate { AWSTemplateFormatVersion?: string; Description?: string; Parameters?: Record; Resources: Record; Outputs?: Record; Conditions?: Record; Mappings?: Record; Transform?: unknown; Rules?: Record; } interface TemplateParameter { Type: string; Default?: unknown; Description?: string; AllowedValues?: unknown[]; AllowedPattern?: string; ConstraintDescription?: string; } interface TemplateResource { Type: string; Properties?: Record; DependsOn?: string | readonly string[]; Condition?: string; Metadata?: Record; CreationPolicy?: Record; UpdatePolicy?: Record; DeletionPolicy?: 'Delete' | 'Retain' | 'Snapshot'; UpdateReplacePolicy?: 'Delete' | 'Retain' | 'Snapshot'; } interface TemplateOutput { Value: unknown; Description?: string; Export?: { Name: string; }; } //#endregion //#region src/types/state.d.ts interface ResourceState { physicalId: string; resourceType: string; properties: Record; observedProperties?: Record; attributes?: Record; dependencies?: string[]; metadata?: Record; deletionPolicy?: 'Delete' | 'Retain' | 'Snapshot' | 'RetainExceptOnCreate' | undefined; updateReplacePolicy?: 'Delete' | 'Retain' | 'Snapshot' | 'RetainExceptOnCreate' | undefined; provisionedBy?: 'sdk' | 'cc-api' | undefined; } //#endregion //#region src/local/state-resolver.d.ts type StateSubstitutionResult = { kind: 'literal'; value: string | number | boolean; } | { kind: 'unresolved'; reason: string; }; interface PseudoParameters { accountId?: string; region?: string; partition?: string; urlSuffix?: string; } interface CrossStackResolver { resolveImport(exportName: string): Promise; resolveGetStackOutput(producerStack: string, producerRegion: string, outputName: string): Promise; } interface SubstitutionContext { resources: Record; parameters?: Record; sensitiveParameters?: ReadonlySet; onSensitiveParameterConsumed?: (logicalId: string) => void; pseudoParameters?: PseudoParameters; crossStackResolver?: CrossStackResolver; consumerRegion?: string; } declare function substituteAgainstState(value: unknown, contextOrResources: SubstitutionContext | Record): StateSubstitutionResult; declare function substituteAgainstStateAsync(value: unknown, contextOrResources: SubstitutionContext | Record): Promise; interface StateEnvSubstitutionAudit { resolvedKeys: string[]; unresolved: Array<{ key: string; reason: string; }>; sensitiveKeys: string[]; } declare function substituteEnvVarsFromState(templateEnv: Record | undefined, contextOrResources: SubstitutionContext | Record): { env: Record; audit: StateEnvSubstitutionAudit; }; declare function substituteEnvVarsFromStateAsync(templateEnv: Record | undefined, contextOrResources: SubstitutionContext | Record): Promise<{ env: Record; audit: StateEnvSubstitutionAudit; }>; //#endregion //#region src/local/ssm-parameter-resolver.d.ts interface SsmParameterRef { logicalId: string; ssmName: string; isList: boolean; } interface ResolvedSsmParameters { values: Record; secureStringLogicalIds: string[]; } declare function collectSsmParameterRefs(template: Pick | undefined): SsmParameterRef[]; declare function resolveSsmParameters(client: SSMClient, refs: readonly SsmParameterRef[], label: string): Promise; //#endregion //#region src/local/local-state-provider.d.ts interface LocalStateRecord { resources: Record; outputs: Record; region: string; } interface LocalStateProvider { readonly label: string; load(stackName: string, synthRegion: string | undefined): Promise; buildCrossStackResolver(consumerRegion: string): Promise; resolveDeployedFunctionEnv?(functionPhysicalId: string): Promise | undefined>; resolveLambdaExecutionRoleArn?(functionPhysicalId: string): Promise; resolveAgentCoreRuntimeRoleArn?(runtimePhysicalId: string): Promise; resolveTemplateSsmParameters?(template: CloudFormationTemplate): Promise; getLastLoadError?(): string | undefined; dispose(): void; } //#endregion //#region src/cli/commands/local-state-source.d.ts interface LocalStateSourceOptions { fromCfnStack?: string | boolean; region?: string; profile?: string; stackRegion?: string; [key: string]: unknown; } type LocalStateProviderFactory = (options: LocalStateSourceOptions) => LocalStateProvider; type ExtraStateProviders = Record; declare function resolveCfnStackName(fromCfnStack: string | boolean, stackName: string): string; declare function isCfnFlagPresent(opts: Pick): boolean; declare function resolveCfnRegion(options: Pick, synthRegion: string | undefined): string; declare function resolveCfnFallbackRegion(options: Pick, synthRegion: string | undefined): Promise; declare class LocalStateSourceError extends Error { constructor(message: string); } declare function rejectExplicitCfnStackWithMultipleStacks(options: Pick, routedStackCount: number): void; declare function createLocalStateProvider(options: LocalStateSourceOptions, stackName: string, synthRegion: string | undefined, extraStateProviders?: ExtraStateProviders): LocalStateProvider | undefined; //#endregion //#region src/local/embed-config.d.ts interface CdkLocalEmbedConfig { cliName?: string; binaryName?: string; productName?: string; resourceNamePrefix?: string; awsBindMountPath?: string; envPrefix?: string; sigV4StrictByDefault?: boolean; sigV4OptFlag?: string; } interface ResolvedEmbedConfig { cliName: string; binaryName: string; productName: string; resourceNamePrefix: string; awsBindMountPath: string; envPrefix: string; sigV4StrictByDefault: boolean; sigV4OptFlag: string; } declare function setEmbedConfig(config?: CdkLocalEmbedConfig): void; declare function getEmbedConfig(): ResolvedEmbedConfig; declare function resetEmbedConfig(): void; //#endregion //#region src/synthesis/assembly-reader.d.ts interface StackInfo { stackName: string; displayName: string; artifactId: string; template: CloudFormationTemplate; assetManifestPath?: string | undefined; dependencyNames: string[]; region?: string | undefined; account?: string | undefined; terminationProtection?: boolean | undefined; nestedTemplates?: Record | undefined; } //#endregion //#region src/local/lambda-resolver.d.ts type ResolvedLambda = ResolvedZipLambda | ResolvedImageLambda; interface ResolvedLambdaBase { stack: StackInfo; logicalId: string; resource: TemplateResource; memoryMb: number; timeoutSec: number; layers: ResolvedLambdaLayer[]; ephemeralStorageMb?: number; } type ResolvedLambdaLayer = ResolvedAssetLambdaLayer | ResolvedArnLambdaLayer; interface ResolvedAssetLambdaLayer { kind: 'asset'; logicalId: string; assetPath: string; } interface ResolvedArnLambdaLayer { kind: 'arn'; logicalId: string; arn: string; region: string; accountId: string; name: string; version: string; } interface ResolvedZipLambda extends ResolvedLambdaBase { kind: 'zip'; runtime: string; handler: string; codePath: string | null; inlineCode?: string; architecture: 'x86_64' | 'arm64'; } interface ResolvedImageLambda extends ResolvedLambdaBase { kind: 'image'; imageUri: string; imageConfig: { command?: string[]; entryPoint?: string[]; workingDirectory?: string; }; architecture: 'x86_64' | 'arm64'; } //#endregion //#region src/cli/commands/local-invoke.d.ts interface CreateLocalInvokeCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } declare function createLocalInvokeCommand(opts?: CreateLocalInvokeCommandOptions): Command; declare function addInvokeSpecificOptions(cmd: Command): Command; //#endregion //#region src/local/intrinsic-image.d.ts interface ImageResolutionContext { pseudoParameters?: { accountId?: string; region?: string; partition?: string; urlSuffix?: string; }; stateResources?: Record; stateParameters?: Record; stateSensitiveParameters?: readonly string[]; stateLoadFailureMessage?: string; } declare function formatStateRemedy(context: ImageResolutionContext | undefined): string; declare function derivePseudoParametersFromRegion(region: string | undefined, accountId?: string): { accountId?: string; region: string; partition: string; urlSuffix: string; } | undefined; type FnJoinResolveOutcome = { kind: 'not-applicable'; } | { kind: 'resolved'; uri: string; } | { kind: 'needs-state'; repoLogicalId: string; } | { kind: 'unsupported-join'; reason: string; }; declare function tryResolveImageFnJoin(raw: unknown, resources: Record, context: ImageResolutionContext | undefined): FnJoinResolveOutcome; declare function substituteImagePlaceholders(flat: string, resources: Record, context: ImageResolutionContext | undefined): string; //#endregion //#region src/local/agentcore-ws-client.d.ts interface InvokeAgentCoreWsOptions { sessionId: string; onMessage: (text: string) => void; timeoutMs: number; authorization?: string; frameSource?: AsyncIterable; abortSignal?: AbortSignal; webSocketImpl?: typeof WebSocket; } interface AgentCoreWsResult { frames: number; } interface BridgeAgentCoreWsOptions { sessionId: string; authorization?: string; onMessage: (text: string) => void; onOpen?: () => void; onClose?: (code?: number) => void; onError?: (err: Error) => void; abortSignal?: AbortSignal; webSocketImpl?: typeof WebSocket; } interface AgentCoreWsBridgeHandle { send: (text: string) => void; close: () => void; } declare function bridgeAgentCoreWs(host: string, port: number, options: BridgeAgentCoreWsOptions): AgentCoreWsBridgeHandle; declare function invokeAgentCoreWs(host: string, port: number, event: unknown, options: InvokeAgentCoreWsOptions): Promise; //#endregion //#region src/cli/commands/local-invoke-agentcore.d.ts interface CreateLocalInvokeAgentCoreCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } declare function createLocalInvokeAgentCoreCommand(opts?: CreateLocalInvokeAgentCoreCommandOptions): Command; declare function addInvokeAgentCoreSpecificOptions(cmd: Command): Command; //#endregion //#region src/utils/aws-proxy.d.ts declare function isProxyEnvConfigured(): boolean; interface AwsProxyClientConfig { requestHandler?: NodeHttpHandler; credentials?: AwsCredentialIdentityProvider; } declare function buildProxyClientConfig(opts?: { profile?: string | undefined; }): AwsProxyClientConfig; //#endregion //#region src/utils/profile-resolver.d.ts declare function resolveProfileCredentials(profile: string): Promise<{ accessKeyId: string; secretAccessKey: string; sessionToken?: string; region?: string; }>; declare function buildStsClientConfig(args: { region?: string | undefined; profile?: string | undefined; }): { region?: string; profile?: string; } & AwsProxyClientConfig; //#endregion //#region src/cli/config-loader.d.ts interface CdkWatchConfig { include: string[]; exclude: string[]; } declare function resolveWatchConfig(): CdkWatchConfig; //#endregion //#region src/local/httpv2-service-integration.d.ts type SupportedSubtype = 'EventBridge-PutEvents' | 'SQS-SendMessage' | 'SQS-ReceiveMessage' | 'SQS-DeleteMessage' | 'SQS-PurgeQueue' | 'Kinesis-PutRecord' | 'StepFunctions-StartExecution' | 'StepFunctions-StartSyncExecution' | 'StepFunctions-StopExecution' | 'AppConfig-GetConfiguration'; //#endregion //#region src/local/integration-response-selector.d.ts interface IntegrationResponseEntry { StatusCode: string; SelectionPattern?: string; ResponseParameters?: Record; ResponseTemplates?: Record; ContentHandling?: string; } interface SelectedIntegrationResponse { entry: IntegrationResponseEntry | null; statusCode: number; } declare function selectIntegrationResponse(entries: IntegrationResponseEntry[] | undefined, matchTarget: string, fallbackStatusCode?: number): SelectedIntegrationResponse; declare function tryParseStatus(raw: unknown): number | undefined; declare function evaluateResponseParameters(responseParameters: Record | undefined, opts?: { onUnsupported?: (key: string, value: string, reason: string) => void; }): Record; declare function pickResponseTemplate(responseTemplates: Record | undefined, accept: string | undefined): { template: string; contentType: string; } | undefined; //#endregion //#region src/local/rest-v1-integrations.d.ts interface MockIntegrationConfig { kind: 'mock'; requestTemplate: string | undefined; responses: IntegrationResponseEntry[]; } interface HttpProxyIntegrationConfig { kind: 'http-proxy'; uri: string; integrationHttpMethod?: string; requestParameters?: Record; responses: IntegrationResponseEntry[]; } interface HttpIntegrationConfig { kind: 'http'; uri: string; integrationHttpMethod?: string; requestParameters?: Record; requestTemplates?: Record; responses: IntegrationResponseEntry[]; } interface AwsLambdaIntegrationConfig { kind: 'aws-lambda'; lambdaLogicalId: string; requestTemplates?: Record; responses: IntegrationResponseEntry[]; } //#endregion //#region src/local/route-discovery.d.ts type RestV1IntegrationConfig = MockIntegrationConfig | HttpProxyIntegrationConfig | HttpIntegrationConfig | AwsLambdaIntegrationConfig; interface DiscoveredRoute { method: string; pathPattern: string; lambdaLogicalId: string; source: 'http-api' | 'rest-v1' | 'function-url'; apiVersion: 'v1' | 'v2'; stage: string; apiLogicalId?: string; apiStackName?: string; apiCdkPath?: string; stageVariables?: Record | null; invokeMode?: 'BUFFERED' | 'RESPONSE_STREAM'; unsupported?: { reason: string; }; mockCors?: { statusCode: number; headers: Record; }; serviceIntegration?: { subtype: SupportedSubtype; requestParameters: Readonly>; responseParameters?: Readonly>>>; }; restV1Integration?: RestV1IntegrationConfig; declaredAt: string; } declare function discoverRoutes(stacks: readonly StackInfo[]): DiscoveredRoute[]; //#endregion //#region src/local/websocket-route-discovery.d.ts interface DiscoveredWebSocketApi { apiLogicalId: string; apiStackName: string; declaredAt: string; apiCdkPath?: string; routeSelectionExpression: string; stage: string; routes: WebSocketRouteEntry[]; unsupported?: { reason: string; }; } interface WebSocketRouteEntry { routeKey: string; targetLambdaLogicalId: string; lambdaStackName: string; declaredAt: string; } declare function discoverWebSocketApis(stacks: readonly StackInfo[]): { apis: DiscoveredWebSocketApi[]; errors: string[]; }; declare function discoverWebSocketApisOrThrow(stacks: readonly StackInfo[]): DiscoveredWebSocketApi[]; declare function parseSelectionExpressionPath(expr: string): string[]; declare function webSocketApiMatchesIdentifier(api: DiscoveredWebSocketApi, identifier: string): boolean; declare function filterWebSocketApisByIdentifiers(apis: readonly DiscoveredWebSocketApi[], identifiers: readonly string[]): DiscoveredWebSocketApi[]; declare function availableWebSocketApiIdentifiers(apis: readonly DiscoveredWebSocketApi[]): string[]; //#endregion //#region src/local/authorizer-resolver.d.ts interface LambdaTokenAuthorizer { kind: 'lambda-token'; logicalId: string; lambdaLogicalId: string; tokenHeader: string; resultTtlSeconds: number; declaredAt: string; } interface LambdaRequestAuthorizer { kind: 'lambda-request'; logicalId: string; lambdaLogicalId: string; identitySources: ReadonlyArray; resultTtlSeconds: number; apiVersion: 'v1' | 'v2'; declaredAt: string; } interface CognitoPoolRef { userPoolArn: string; region: string; userPoolId: string; } interface CognitoUserPoolAuthorizer { kind: 'cognito'; logicalId: string; pools: ReadonlyArray; userPoolArn: string; region: string; userPoolId: string; declaredAt: string; } interface JwtAuthorizer { kind: 'jwt'; logicalId: string; issuer: string; audience: ReadonlyArray; region?: string; userPoolId?: string; declaredAt: string; } interface IamAuthorizer { kind: 'iam'; logicalId: 'AWS_IAM'; declaredAt: string; oacFronted?: boolean; } type AuthorizerInfo = LambdaTokenAuthorizer | LambdaRequestAuthorizer | CognitoUserPoolAuthorizer | JwtAuthorizer | IamAuthorizer; type IdentitySourceSelector = { kind: 'header'; name: string; } | { kind: 'query'; name: string; } | { kind: 'context'; name: string; } | { kind: 'stage-variable'; name: string; }; interface RouteWithAuth { route: DiscoveredRoute; authorizer?: AuthorizerInfo; } declare function attachAuthorizers(stacks: readonly StackInfo[], routes: readonly DiscoveredRoute[]): RouteWithAuth[]; //#endregion //#region src/cli/commands/local-start-api.d.ts interface CreateLocalStartApiCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } interface WatchPredicates { ignored: (absPath: string) => boolean; shouldTrigger: (absPath: string) => boolean; excludePatterns: string[]; } declare function createWatchPredicates(args: { watchRoot: string; output: string; watchConfig: CdkWatchConfig; }): WatchPredicates; interface ApiTargetSubset { readonly filtered: RouteWithAuth[]; readonly filteredWebSocketApis: DiscoveredWebSocketApi[]; readonly unmatched: string[]; } declare function resolveApiTargetSubset(routes: readonly RouteWithAuth[], identifiers: readonly string[], stackNames: readonly string[], webSocketApis?: readonly DiscoveredWebSocketApi[]): ApiTargetSubset; declare function createLocalStartApiCommand(opts?: CreateLocalStartApiCommandOptions): Command; declare function addStartApiSpecificOptions(cmd: Command): Command; //#endregion //#region src/local/ecs-task-resolver.d.ts interface ResolvedEcsTask { stack: StackInfo; taskDefinitionLogicalId: string; resource: TemplateResource; family: string; networkMode: 'bridge' | 'awsvpc' | 'host' | 'none'; taskRoleArn?: string; executionRoleArn?: string; containers: ResolvedEcsContainer[]; volumes: ResolvedEcsVolume[]; runtimePlatform?: { cpuArchitecture: 'X86_64' | 'ARM64'; operatingSystemFamily: 'LINUX'; }; warnings: string[]; } interface ResolvedEcsContainer { name: string; image: ResolvedEcsImage; command?: string[]; entryPoint?: string[]; workingDirectory?: string; environment: Record; sensitiveEnvKeys: string[]; secrets: { name: string; valueFrom: string; }[]; portMappings: { name?: string; containerPort: number; hostPort?: number; protocol: 'tcp' | 'udp'; }[]; mountPoints: { sourceVolume: string; containerPath: string; readOnly: boolean; }[]; dependsOn: { containerName: string; condition: 'START' | 'COMPLETE' | 'SUCCESS' | 'HEALTHY'; }[]; links: string[]; essential: boolean; healthCheck?: { command: string[]; interval?: number; timeout?: number; retries?: number; startPeriod?: number; }; user?: string; privileged?: boolean; readonlyRootFilesystem?: boolean; ulimits: { name: string; softLimit: number; hardLimit: number; }[]; warnings: string[]; } type ResolvedEcsImage = { kind: 'cdk-asset'; assetHash?: string; } | { kind: 'ecr'; uri: string; account: string; region: string; } | { kind: 'public'; uri: string; }; interface ResolvedEcsVolume { name: string; kind: 'host' | 'docker'; hostPath?: string; dockerVolumeConfig?: { scope: 'task' | 'shared'; autoprovision?: boolean; driver?: string; driverOpts?: Record; labels?: Record; }; } declare class EcsTaskResolutionError extends Error { constructor(message: string); } type EcsImageResolutionContext = ImageResolutionContext; //#endregion //#region src/cli/commands/local-run-task.d.ts interface CreateLocalRunTaskCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } declare function createLocalRunTaskCommand(opts?: CreateLocalRunTaskCommandOptions): Command; declare function addRunTaskSpecificOptions(cmd: Command): Command; //#endregion //#region src/utils/error-handler.d.ts declare class CdkLocalError extends Error { readonly code: string; readonly cause: Error | undefined; constructor(message: string, code: string, cause?: Error); } declare class LocalInvokeBuildError extends CdkLocalError { constructor(message: string, cause?: Error); } //#endregion //#region src/local/target-lister.d.ts interface TargetEntry { logicalId: string; stackName: string; qualifiedId: string; displayPath?: string; kind?: string; agentCoreHasWs?: boolean; agentCoreContractPath?: string; } interface TargetListing { lambdas: TargetEntry[]; apis: TargetEntry[]; ecsServices: TargetEntry[]; ecsTaskDefinitions: TargetEntry[]; agentCoreRuntimes: TargetEntry[]; loadBalancers: TargetEntry[]; cloudFrontDistributions: TargetEntry[]; } declare function listTargets(stacks: readonly StackInfo[]): TargetListing; declare function countTargets(listing: TargetListing): number; //#endregion //#region src/local/ecs-service-runner.d.ts declare const SOFT_RELOAD_COMPLETION_LOG_SUFFIX = "restart + TCP-ready probe complete; Cloud Map + front-door re-published."; declare const DEFAULT_SHADOW_READY_TIMEOUT_MS = 60000; declare function setShadowReadyTimeoutMs(timeoutMs: number): void; //#endregion //#region src/local/alb-path-matcher.d.ts interface AlbHttpHeaderCondition { name: string; values: readonly string[]; } interface AlbQueryStringCondition { key?: string; value: string; } //#endregion //#region src/local/elb-front-door-resolver.d.ts type FrontDoorForwardTarget = FrontDoorEcsTarget | FrontDoorLambdaTarget; interface FrontDoorEcsTarget { kind: 'ecs'; serviceLogicalId: string; targetContainerName: string; targetContainerPort: number; targetGroupLogicalId: string; weight: number; } interface FrontDoorLambdaTarget { kind: 'lambda'; lambdaLogicalId: string; targetGroupLogicalId: string; multiValueHeaders: boolean; weight: number; } interface FrontDoorRedirectAction { kind: 'redirect'; statusCode: 301 | 302; protocol?: string; host?: string; port?: string; path?: string; query?: string; } interface FrontDoorFixedResponseAction { kind: 'fixed-response'; statusCode: number; contentType?: string; messageBody?: string; } interface FrontDoorForwardAction { kind: 'forward'; targets: FrontDoorForwardTarget[]; } interface FrontDoorAuthGuard { kind: 'authenticate-cognito' | 'authenticate-oidc'; issuer: string; audience: string; region?: string; userPoolId?: string; sessionCookieName: string; label: string; } type ResolvedListenerAction = FrontDoorForwardAction | FrontDoorRedirectAction | FrontDoorFixedResponseAction; interface ResolvedListenerRule { priority: number; pathPatterns: string[]; hostPatterns: string[]; httpHeaderConditions: AlbHttpHeaderCondition[]; httpRequestMethods: string[]; queryStringConditions: AlbQueryStringCondition[]; sourceIpCidrs: string[]; action: ResolvedListenerAction; authGuard?: FrontDoorAuthGuard; } interface ResolvedListenerFrontDoor { listenerPort: number; listenerProtocol: 'HTTP' | 'HTTPS'; listenerLogicalId: string; defaultAction?: ResolvedListenerAction; defaultAuthGuard?: FrontDoorAuthGuard; rules: ResolvedListenerRule[]; } interface AlbFrontDoorResolution { listeners: ResolvedListenerFrontDoor[]; warnings: string[]; } declare function resolveAlbFrontDoor(stack: StackInfo, albLogicalId: string): AlbFrontDoorResolution; declare function isApplicationLoadBalancer(resource: TemplateResource): boolean; //#endregion //#region src/cli/commands/ecs-service-emulator.d.ts interface EcsServiceEmulatorOptions { app?: string; output: string; verbose: boolean; region?: string; profile?: string; roleArn?: string; context?: string[]; cluster: string; envVars?: string; containerHost: string; assumeTaskRole?: string | boolean; assumeRole?: string | boolean; pull: boolean; build: boolean; ecrRoleArn?: string; hostPort?: string[]; lbPort?: string[]; tls?: boolean; tlsCert?: string; tlsKey?: string; verifyAuth?: boolean; bearerToken?: string; platform?: string; maxTasks: number; restartPolicy: 'on-failure' | 'always' | 'none'; fromCfnStack?: string | boolean; stackRegion?: string; watch?: boolean; logs?: boolean; imageOverride?: string[]; imageBuildArg?: string[]; imageBuildSecret?: string[]; imageTarget?: string[]; interactiveOverrides?: boolean; strictOverrides?: boolean; shadowReadyTimeout?: number; [key: string]: unknown; } interface ServiceBoot { target: string; } type PlannedForwardTarget = PlannedEcsForwardTarget | PlannedLambdaForwardTarget; interface PlannedEcsForwardTarget { kind: 'ecs'; serviceTarget: string; targetContainerName: string; targetContainerPort: number; weight: number; } interface PlannedLambdaForwardTarget { kind: 'lambda'; lambda: ResolvedLambda; targetGroupArn: string; multiValueHeaders: boolean; weight: number; } interface PlannedForwardAction { kind: 'forward'; targets: PlannedForwardTarget[]; } interface PlannedRedirectAction { kind: 'redirect'; statusCode: 301 | 302; protocol?: string; host?: string; port?: string; path?: string; query?: string; } interface PlannedFixedResponseAction { kind: 'fixed-response'; statusCode: number; contentType?: string; messageBody?: string; } type PlannedAction = PlannedForwardAction | PlannedRedirectAction | PlannedFixedResponseAction; interface PlannedFrontDoorListener { listenerPort: number; hostPort: number; protocol: 'HTTP' | 'HTTPS'; defaultAction?: PlannedAction; defaultAuthGuard?: FrontDoorAuthGuard; rules: Array<{ priority: number; pathPatterns: string[]; hostPatterns: string[]; httpHeaderConditions: AlbHttpHeaderCondition[]; httpRequestMethods: string[]; queryStringConditions: AlbQueryStringCondition[]; sourceIpCidrs: string[]; action: PlannedAction; authGuard?: FrontDoorAuthGuard; }>; } interface FrontDoorPlan { listeners: PlannedFrontDoorListener[]; } interface EmulatorStrategy { pickEntries(stacks: StackInfo[]): TargetEntry[]; pickerMessage: string; pickerNoun: string; onMissing(): CdkLocalError; resolveBoots(stacks: StackInfo[], chosenTargets: string[]): { boots: ServiceBoot[]; frontDoor?: FrontDoorPlan; warnings: string[]; }; lbPortOverrides: Record; suppressLoadBalancerWarning?: boolean; supportsWatch?: boolean; } declare function runEcsServiceEmulator(targets: string[], options: EcsServiceEmulatorOptions, strategy: EmulatorStrategy, extraStateProviders: ExtraStateProviders | undefined): Promise; declare function buildEcsImageResolutionContext(target: string, stacks: StackInfo[], options: EcsServiceEmulatorOptions, stateProvider: LocalStateProvider | undefined, opts?: { suppressStateWarning?: boolean; }): Promise; declare const MAX_TASKS_SUBNET_RANGE_CAP = 83; declare function parseMaxTasks(raw: string): number; declare function parseRestartPolicy(raw: string): 'on-failure' | 'always' | 'none'; declare function resolveSharedSidecarCredentials(options: { profile?: string; }): Promise<{ accessKeyId: string; secretAccessKey: string; sessionToken?: string; } | undefined>; declare function ecsClusterOption(): Option; declare function addEcsAssumeRoleOptions(cmd: Command): Command; declare function resolveEcsAssumeRoleOption(options: { assumeTaskRole?: string | boolean; assumeRole?: string | boolean; }): string | boolean | undefined; declare function addCommonEcsServiceOptions(cmd: Command): Command; declare function addImageOverrideOptions(cmd: Command): Command; //#endregion //#region src/cli/commands/local-start-service.d.ts interface CreateLocalStartServiceCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } declare function serviceStrategy(): EmulatorStrategy; declare function createLocalStartServiceCommand(opts?: CreateLocalStartServiceCommandOptions): Command; declare function addStartServiceSpecificOptions(cmd: Command): Command; //#endregion //#region src/cli/commands/local-start-alb.d.ts interface CreateLocalStartAlbCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } declare function parseLbPortOverrides(values: string[] | undefined): Record; declare function resolveAlbTarget(target: string, stacks: StackInfo[]): { stack: StackInfo; albLogicalId: string; }; declare function albStrategy(options: EcsServiceEmulatorOptions): EmulatorStrategy; declare function createLocalStartAlbCommand(opts?: CreateLocalStartAlbCommandOptions): Command; declare function addAlbSpecificOptions(cmd: Command): Command; //#endregion //#region src/cli/commands/local-start-cloudfront.d.ts declare class LocalStartCloudFrontError extends CdkLocalError { constructor(message: string, cause?: Error); } interface CreateLocalStartCloudFrontCommandOptions { embedConfig?: CdkLocalEmbedConfig; extraStateProviders?: ExtraStateProviders; } declare function parseOriginOverrides(values: string[] | undefined): Map; declare function parseKvsFileOverrides(values: string[] | undefined): Map; declare function normalizeKvsFileKeys(kvsFiles: Map, template: CloudFormationTemplate): Map; declare function resolveCloudFrontTarget(target: string, stacks: StackInfo[]): { stack: StackInfo; logicalId: string; }; declare function createLocalStartCloudFrontCommand(opts?: CreateLocalStartCloudFrontCommandOptions): Command; declare function addStartCloudFrontSpecificOptions(cmd: Command): Command; //#endregion //#region src/cli/commands/local-start-agentcore.d.ts interface CreateLocalStartAgentCoreCommandOptions { extraStateProviders?: ExtraStateProviders; embedConfig?: CdkLocalEmbedConfig; } declare function createLocalStartAgentCoreCommand(opts?: CreateLocalStartAgentCoreCommandOptions): Command; declare function addStartAgentCoreSpecificOptions(cmd: Command): Command; //#endregion //#region src/cli/commands/local-list.d.ts interface CreateLocalListCommandOptions { embedConfig?: CdkLocalEmbedConfig; } interface FormatTargetListingOptions { long?: boolean; } declare function formatTargetListing(listing: TargetListing, cliName: string, options?: FormatTargetListingOptions): string; declare function createLocalListCommand(opts?: CreateLocalListCommandOptions): Command; declare function addListSpecificOptions(cmd: Command): Command; //#endregion //#region src/local/studio-events.d.ts type StudioTargetKind = 'lambda' | 'api' | 'alb' | 'ecs' | 'ecs-task' | 'cloudfront' | 'agentcore' | 'agentcore-ws'; interface StudioInvocationEvent { id: string; ts: number; target: string; kind: StudioTargetKind; label: string; request?: unknown; response?: unknown; status?: number; durationMs?: number; reinvokeOf?: string; } interface StudioLogEvent { ts: number; containerId: string; target: string; line: string; stream?: 'stdout' | 'stderr'; } interface StudioServeEvent { ts: number; target: string; kind: StudioTargetKind; status: 'starting' | 'running' | 'stopped' | 'error'; endpoints?: string[]; hostUrl?: string; pid?: number; message?: string; } interface StudioEventMap { invocation: [StudioInvocationEvent]; log: [StudioLogEvent]; serve: [StudioServeEvent]; } declare class StudioEventBus { private readonly emitter; constructor(); emit(event: E, ...args: StudioEventMap[E]): void; on(event: E, listener: (...args: StudioEventMap[E]) => void): this; off(event: E, listener: (...args: StudioEventMap[E]) => void): this; listenerCount(event: E): number; } //#endregion //#region src/local/studio-child-args.d.ts interface SharedChildConfig { app?: string; assemblyDir?: string; profile?: string; region?: string; context?: Record; fromCfnStack?: string | boolean; assumeRole?: string; } //#endregion //#region src/local/studio-option-specs.d.ts interface PairValue { left: string; right: string; } type OptionValues = Record; //#endregion //#region src/local/studio-option-catalog.d.ts type CatalogValues = Record; //#endregion //#region src/local/studio-dispatch.d.ts interface StudioRunRequest { targetId: string; kind: StudioTargetKind; event: unknown; options?: OptionValues; catalogArgs?: CatalogValues; rawArgs?: string; imageOverride?: string; imageOverrides?: Record; reinvokeOf?: string; } interface StudioRunResult { invocationId: string; ok: boolean; status: number; response?: unknown; raw?: string; error?: string; durationMs: number; } interface StudioDispatchConfig extends SharedChildConfig { cliEntry: string; bus: StudioEventBus; cwd?: string; nodeBin?: string; spawnFn?: typeof spawn; clock?: () => number; idFactory?: () => string; } interface StudioDispatcher { run: (req: StudioRunRequest) => Promise; } declare function createStudioDispatcher(config: StudioDispatchConfig): StudioDispatcher; //#endregion //#region src/local/studio-proxy.d.ts interface StudioProxyConfig { bus: StudioEventBus; target: string; kind: StudioTargetKind; upstream: string; host?: string; clock?: () => number; idFactory?: () => string; maxCaptureBytes?: number; } interface RunningStudioProxy { url: string; port: number; close: () => Promise; } declare function startStudioProxy(config: StudioProxyConfig): Promise; //#endregion //#region src/local/studio-serve-manager.d.ts interface StudioServeRequest { targetId: string; kind: StudioTargetKind; options?: OptionValues; catalogArgs?: CatalogValues; rawArgs?: string; imageOverride?: string; imageOverrides?: Record; } interface StudioStopRequest { targetId: string; } interface StudioServeState { targetId: string; kind: StudioTargetKind; status: 'starting' | 'running' | 'stopped' | 'error'; endpoints: string[]; hostUrl?: string; pid?: number; startedAt: number; } interface StudioServeManagerConfig extends SharedChildConfig { cliEntry: string; bus: StudioEventBus; watch?: boolean; cwd?: string; nodeBin?: string; spawnFn?: typeof spawn; clock?: () => number; readyTimeoutMs?: number; stopGraceMs?: number; setTimeoutFn?: typeof setTimeout; clearTimeoutFn?: typeof clearTimeout; proxyFactory?: (config: StudioProxyConfig) => Promise; captureRequests?: boolean; } interface StudioServeManager { start: (req: StudioServeRequest) => Promise; stop: (req: StudioStopRequest) => Promise; list: () => StudioServeState[]; stopAll: () => Promise; } declare function createStudioServeManager(config: StudioServeManagerConfig): StudioServeManager; //#endregion //#region src/cli/commands/local-studio.d.ts declare function coerceRunRequest(body: unknown): StudioRunRequest; declare function coerceStopRequest(body: unknown): StudioStopRequest; interface StudioServeRequestPayload { targetId: string; method: string; path?: string; headers?: Record; body?: string; } declare function resolveServeBaseUrl(state: StudioServeState): string | undefined; declare function coerceServeRequest(body: unknown): StudioServeRequestPayload; interface CreateLocalStudioCommandOptions { embedConfig?: CdkLocalEmbedConfig; } declare function createLocalStudioCommand(opts?: CreateLocalStudioCommandOptions): Command; declare function addStudioSpecificOptions(cmd: Command): Command; //#endregion export { serviceStrategy as $, rejectExplicitCfnStackWithMultipleStacks as $n, RouteWithAuth as $t, addListSpecificOptions as A, InvokeAgentCoreWsOptions as An, TargetEntry as At, normalizeKvsFileKeys as B, createLocalInvokeCommand as Bn, ResolvedEcsTask as Bt, StudioEventBus as C, isProxyEnvConfigured as Cn, FrontDoorForwardTarget as Ct, StudioTargetKind as D, AgentCoreWsBridgeHandle as Dn, DEFAULT_SHADOW_READY_TIMEOUT_MS as Dt, StudioServeEvent as E, createLocalInvokeAgentCoreCommand as En, resolveAlbFrontDoor as Et, createLocalStartAgentCoreCommand as F, formatStateRemedy as Fn, LocalInvokeBuildError as Ft, addAlbSpecificOptions as G, resetEmbedConfig as Gn, createLocalStartApiCommand as Gt, parseOriginOverrides as H, StackInfo as Hn, CreateLocalStartApiCommandOptions as Ht, CreateLocalStartCloudFrontCommandOptions as I, substituteImagePlaceholders as In, CreateLocalRunTaskCommandOptions as It, parseLbPortOverrides as J, LocalStateProviderFactory as Jn, AuthorizerInfo as Jt, albStrategy as K, setEmbedConfig as Kn, createWatchPredicates as Kt, LocalStartCloudFrontError as L, tryResolveImageFnJoin as Ln, addRunTaskSpecificOptions as Lt, formatTargetListing as M, invokeAgentCoreWs as Mn, countTargets as Mt, CreateLocalStartAgentCoreCommandOptions as N, ImageResolutionContext as Nn, listTargets as Nt, CreateLocalListCommandOptions as O, AgentCoreWsResult as On, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Ot, addStartAgentCoreSpecificOptions as P, derivePseudoParametersFromRegion as Pn, CdkLocalError as Pt, createLocalStartServiceCommand as Q, isCfnFlagPresent as Qn, LambdaTokenAuthorizer as Qt, addStartCloudFrontSpecificOptions as R, CreateLocalInvokeCommandOptions as Rn, createLocalRunTaskCommand as Rt, createStudioDispatcher as S, buildProxyClientConfig as Sn, runEcsServiceEmulator as St, StudioLogEvent as T, addInvokeAgentCoreSpecificOptions as Tn, isApplicationLoadBalancer as Tt, resolveCloudFrontTarget as U, CdkLocalEmbedConfig as Un, WatchPredicates as Ut, parseKvsFileOverrides as V, ResolvedArnLambdaLayer as Vn, ApiTargetSubset as Vt, CreateLocalStartAlbCommandOptions as W, getEmbedConfig as Wn, addStartApiSpecificOptions as Wt, CreateLocalStartServiceCommandOptions as X, LocalStateSourceOptions as Xn, JwtAuthorizer as Xt, resolveAlbTarget as Y, LocalStateSourceError as Yn, CognitoUserPoolAuthorizer as Yt, addStartServiceSpecificOptions as Z, createLocalStateProvider as Zn, LambdaRequestAuthorizer as Zt, startStudioProxy as _, CdkWatchConfig as _n, CloudFormationTemplate as _r, ecsClusterOption as _t, coerceServeRequest as a, discoverWebSocketApisOrThrow as an, ResolvedSsmParameters as ar, PlannedEcsForwardTarget as at, StudioRunRequest as b, resolveProfileCredentials as bn, resolveEcsAssumeRoleOption as bt, resolveServeBaseUrl as c, webSocketApiMatchesIdentifier as cn, resolveSsmParameters as cr, PlannedForwardTarget as ct, StudioServeRequest as d, discoverRoutes as dn, StateEnvSubstitutionAudit as dr, PlannedRedirectAction as dt, attachAuthorizers as en, resolveCfnFallbackRegion as er, EcsServiceEmulatorOptions as et, StudioServeState as f, IntegrationResponseEntry as fn, SubstitutionContext as fr, ServiceBoot as ft, StudioProxyConfig as g, tryParseStatus as gn, substituteEnvVarsFromStateAsync as gr, buildEcsImageResolutionContext as gt, RunningStudioProxy as h, selectIntegrationResponse as hn, substituteEnvVarsFromState as hr, addImageOverrideOptions as ht, coerceRunRequest as i, discoverWebSocketApis as in, LocalStateRecord as ir, PlannedAction as it, createLocalListCommand as j, bridgeAgentCoreWs as jn, TargetListing as jt, FormatTargetListingOptions as k, BridgeAgentCoreWsOptions as kn, setShadowReadyTimeoutMs as kt, StudioServeManager as l, DiscoveredRoute as ln, CrossStackResolver as lr, PlannedFrontDoorListener as lt, createStudioServeManager as m, pickResponseTemplate as mn, substituteAgainstStateAsync as mr, addEcsAssumeRoleOptions as mt, StudioServeRequestPayload as n, WebSocketRouteEntry as nn, resolveCfnStackName as nr, FrontDoorPlan as nt, coerceStopRequest as o, filterWebSocketApisByIdentifiers as on, SsmParameterRef as or, PlannedFixedResponseAction as ot, StudioStopRequest as p, evaluateResponseParameters as pn, substituteAgainstState as pr, addCommonEcsServiceOptions as pt, createLocalStartAlbCommand as q, ExtraStateProviders as qn, resolveApiTargetSubset as qt, addStudioSpecificOptions as r, availableWebSocketApiIdentifiers as rn, LocalStateProvider as rr, MAX_TASKS_SUBNET_RANGE_CAP as rt, createLocalStudioCommand as s, parseSelectionExpressionPath as sn, collectSsmParameterRefs as sr, PlannedForwardAction as st, CreateLocalStudioCommandOptions as t, DiscoveredWebSocketApi as tn, resolveCfnRegion as tr, EmulatorStrategy as tt, StudioServeManagerConfig as u, RestV1IntegrationConfig as un, PseudoParameters as ur, PlannedLambdaForwardTarget as ut, StudioDispatchConfig as v, resolveWatchConfig as vn, TemplateResource as vr, parseMaxTasks as vt, StudioInvocationEvent as w, CreateLocalInvokeAgentCoreCommandOptions as wn, ResolvedListenerAction as wt, StudioRunResult as x, AwsProxyClientConfig as xn, resolveSharedSidecarCredentials as xt, StudioDispatcher as y, buildStsClientConfig as yn, parseRestartPolicy as yt, createLocalStartCloudFrontCommand as z, addInvokeSpecificOptions as zn, EcsTaskResolutionError as zt }; //# sourceMappingURL=local-studio-9bZLFQqv.d.ts.map