cdk-local 0.65.2 → 0.66.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.
@@ -417,6 +417,24 @@ function stackMatchesPattern(stack, pattern) {
417
417
  //#endregion
418
418
  //#region src/local/intrinsic-image.ts
419
419
  /**
420
+ * Render the resolver-error remedy string for a "needs deployed state"
421
+ * failure. When the context records that a state-source provider's
422
+ * `load()` was attempted but failed ({@link ImageResolutionContext.stateLoadFailureMessage}),
423
+ * the hint surfaces the underlying failure and points at the
424
+ * stack-name / region / profile knobs instead of repeating "pass
425
+ * --from-cfn-stack" — the user already passed it and seeing the same
426
+ * flag suggested back is misleading. Otherwise the original hint is
427
+ * emitted verbatim.
428
+ *
429
+ * Returned as a clause without a trailing punctuation so callers can
430
+ * concatenate it with their alternatives (e.g. "..., build via
431
+ * ContainerImage.fromAsset, or pin a public image.").
432
+ */
433
+ function formatStateRemedy(context) {
434
+ if (context?.stateLoadFailureMessage) return `the state-source attempt failed: ${context.stateLoadFailureMessage}; verify the stack name (try --from-cfn-stack <deployed-name> if it differs from the synthesized name) and that --region / --profile target the right account`;
435
+ return "pass --from-cfn-stack to load the deployed stack state";
436
+ }
437
+ /**
420
438
  * Derive the AWS pseudo parameters that are trivially knowable from the
421
439
  * deploy region alone, without any STS call or state load.
422
440
  * `urlSuffix` and `partition` follow the canonical AWS partition rules:
@@ -823,7 +841,7 @@ function resolveLambdaTarget(target, stacks) {
823
841
  const { logicalId, resource } = match;
824
842
  if (resource.Type !== "AWS::Lambda::Function") {
825
843
  if (resource.Type.startsWith("Custom::")) throw new LocalInvokeResolutionError(`Resource '${logicalId}' in ${stack.stackName} is a Custom Resource (${resource.Type}), not a Lambda function. Custom Resources are invoked by the deploy framework, not by users. If you want to test the underlying handler, target the ServiceToken Lambda directly.`);
826
- throw new LocalInvokeResolutionError(`Resource '${logicalId}' in ${stack.stackName} is ${resource.Type}, not a Lambda function. ${getEmbedConfig().cliName} invoke only works on AWS::Lambda::Function resources in v1.`);
844
+ throw new LocalInvokeResolutionError(`Resource '${logicalId}' in ${stack.stackName} is ${resource.Type}, not a Lambda function. ${getEmbedConfig().cliName} only invokes AWS::Lambda::Function resources.`);
827
845
  }
828
846
  return extractLambdaProperties(stack, logicalId, resource, resources);
829
847
  }
@@ -967,10 +985,10 @@ function extractImageUri$1(value, logicalId, stackName, resources, region) {
967
985
  const pseudoParameters = derivePseudoParametersFromRegion(region);
968
986
  const joinResolved = tryResolveImageFnJoin(value, resources, pseudoParameters ? { pseudoParameters } : void 0);
969
987
  if (joinResolved.kind === "resolved") return joinResolved.uri;
970
- if (joinResolved.kind === "needs-state") throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} invoke cannot resolve the repository URI without state — deploy the stack first (so ${getEmbedConfig().productName} records the repository physical id), rebuild via lambda.DockerImageCode.fromImageAsset, or pin a public image.`);
971
- if (joinResolved.kind === "unsupported-join") throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} has an unsupported Fn::Join Code.ImageUri shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} invoke recognizes the canonical CDK 2.x lambda.DockerImageCode.fromEcr Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
988
+ if (joinResolved.kind === "needs-state") throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} cannot resolve the repository URI without state — deploy the stack first (so ${getEmbedConfig().productName} records the repository physical id), rebuild via lambda.DockerImageCode.fromImageAsset, or pin a public image.`);
989
+ if (joinResolved.kind === "unsupported-join") throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} has an unsupported Fn::Join Code.ImageUri shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} recognizes the canonical CDK 2.x lambda.DockerImageCode.fromEcr Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
972
990
  const accountIdHint = pseudoParameters ? ` (likely \${AWS::AccountId}, which ${getEmbedConfig().productName} cannot derive without --from-state or STS)` : ` (${getEmbedConfig().productName} could not derive AWS pseudo parameters because stack.region was undefined)`;
973
- throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} has an Fn::Join Code.ImageUri that ${getEmbedConfig().cliName} invoke cannot resolve${accountIdHint}. Workarounds: deploy first and run with --from-state, or pin a fully-literal public image URI.`);
991
+ throw new LocalInvokeResolutionError(`Lambda '${logicalId}' in ${stackName} has an Fn::Join Code.ImageUri that ${getEmbedConfig().cliName} cannot resolve${accountIdHint}. Workarounds: deploy first and run with --from-state, or pin a fully-literal public image URI.`);
974
992
  }
975
993
  }
976
994
  }
@@ -992,7 +1010,7 @@ function extractImageLambdaProperties(args) {
992
1010
  const first = arches[0];
993
1011
  if (first === "arm64") architecture = "arm64";
994
1012
  else if (first === "x86_64") architecture = "x86_64";
995
- else throw new LocalInvokeResolutionError(`Lambda '${logicalId}' has unsupported Architectures value '${String(first)}'. ${getEmbedConfig().cliName} invoke supports x86_64 and arm64.`);
1013
+ else throw new LocalInvokeResolutionError(`Lambda '${logicalId}' has unsupported Architectures value '${String(first)}'. ${getEmbedConfig().cliName} supports x86_64 and arm64.`);
996
1014
  }
997
1015
  return {
998
1016
  kind: "image",
@@ -1534,12 +1552,13 @@ function resolveImageUri(value, logicalId, stackName, resources, region, imageCo
1534
1552
  if (typeof sub === "string" && sub.length > 0) return imageContext ? substituteImagePlaceholders(sub, resources, imageContext) : sub;
1535
1553
  if (Array.isArray(sub) && typeof sub[0] === "string") return imageContext ? substituteImagePlaceholders(sub[0], resources, imageContext) : sub[0];
1536
1554
  if ("Fn::Join" in obj) {
1537
- const joinResolved = tryResolveImageFnJoin(value, resources, imageContext ?? (() => {
1555
+ const context = imageContext ?? (() => {
1538
1556
  const pseudoParameters = derivePseudoParametersFromRegion(region);
1539
1557
  return pseudoParameters ? { pseudoParameters } : void 0;
1540
- })());
1558
+ })();
1559
+ const joinResolved = tryResolveImageFnJoin(value, resources, context);
1541
1560
  if (joinResolved.kind === "resolved") return joinResolved.uri;
1542
- if (joinResolved.kind === "needs-state") throw new AgentCoreResolutionError(`AgentCore Runtime '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} invoke-agentcore cannot resolve the repository URI without state — pass --from-cfn-stack to load the deployed stack state, build via Runtime.fromAsset, or pin a literal / imported ECR image URI.`);
1561
+ if (joinResolved.kind === "needs-state") throw new AgentCoreResolutionError(`AgentCore Runtime '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} cannot resolve the repository URI without state — ` + formatStateRemedy(context) + ", build via Runtime.fromAsset, or pin a literal / imported ECR image URI.");
1543
1562
  }
1544
1563
  }
1545
1564
 
@@ -3471,10 +3490,27 @@ var AssemblyReader = class {
3471
3490
  }
3472
3491
  /**
3473
3492
  * Read a pre-synthesized Cloud Assembly directory (no subprocess).
3493
+ *
3494
+ * `failOnMissingContext: false` matches CDK CLI's own behavior for
3495
+ * `cdk deploy --app cdk.out`. CDK CLI's `cxapp/exec.js` bypasses
3496
+ * `Toolkit.fromAssemblyDirectory()` entirely on this path and builds
3497
+ * the assembly via `@aws-cdk/cloud-assembly-api`'s `CloudAssembly`
3498
+ * directly, which does NOT enforce a missing-context check; then
3499
+ * `cxapp/cloud-executable.js` attempts a single context-provider
3500
+ * resolve, and if no progress is made it returns the assembly as-is
3501
+ * with `manifest.missing` still populated. The strict default that
3502
+ * `fromAssemblyDirectory()` carries is a toolkit-lib decision aimed
3503
+ * at programmatic deploy callers, not parity with CDK CLI semantics.
3504
+ *
3505
+ * cdk-local's needs are looser still: we only read the synthesized
3506
+ * template, and under `--from-cfn-stack` runtime values come from
3507
+ * the deployed CFN stack anyway. Refusing here just makes the
3508
+ * pre-synth flow unusable for any app that relies on context
3509
+ * lookups (SSM / VPC / AMI / etc.), without any safety benefit.
3474
3510
  */
3475
3511
  async readFromDirectory(assemblyDir) {
3476
3512
  const toolkit = new Toolkit({ ioHost: new CdklIoHost() });
3477
- const source = await toolkit.fromAssemblyDirectory(assemblyDir);
3513
+ const source = await toolkit.fromAssemblyDirectory(assemblyDir, { failOnMissingContext: false });
3478
3514
  const cached = await toolkit.synth(source);
3479
3515
  try {
3480
3516
  return cached.cloudAssembly.stacks.map((stack) => mapStackArtifact(stack));
@@ -3823,6 +3859,7 @@ var CfnLocalStateProvider = class {
3823
3859
  agentCoreControlClient;
3824
3860
  clientOptions;
3825
3861
  disposed = false;
3862
+ lastLoadError;
3826
3863
  constructor(opts) {
3827
3864
  this.cfnStackName = opts.cfnStackName;
3828
3865
  this.region = opts.region;
@@ -3966,10 +4003,12 @@ var CfnLocalStateProvider = class {
3966
4003
  if (this.disposed) throw new Error("CfnLocalStateProvider used after dispose()");
3967
4004
  const logger = getLogger();
3968
4005
  const client = this.getClient();
4006
+ this.lastLoadError = void 0;
3969
4007
  let resourceMap;
3970
4008
  try {
3971
4009
  resourceMap = buildResourceStateMap(await fetchAllStackResources(client, this.cfnStackName));
3972
4010
  } catch (err) {
4011
+ this.lastLoadError = `ListStackResources(${this.cfnStackName}) failed: ${formatAwsErrorForWarn(err)} (region='${this.region}')`;
3973
4012
  logger.warn(`${this.label}: ListStackResources(${this.cfnStackName}) failed: ${formatAwsErrorForWarn(err)}. Was the stack deployed in region '${this.region}'? Falling back.`);
3974
4013
  return;
3975
4014
  }
@@ -3991,6 +4030,24 @@ var CfnLocalStateProvider = class {
3991
4030
  };
3992
4031
  }
3993
4032
  /**
4033
+ * Return the failure detail captured by the most recent failed
4034
+ * `load()` call, or `undefined` when the latest call succeeded /
4035
+ * was never made. Surfaces the same `ListStackResources(<name>) failed: ...`
4036
+ * text the warn-logger emits so downstream resolvers can embed it
4037
+ * verbatim in their error and avoid the misleading "pass
4038
+ * --from-cfn-stack" hint when the user already passed it.
4039
+ *
4040
+ * Throws after `dispose()` to keep parity with the other operational
4041
+ * entry points on this class — a post-dispose caller is a programming
4042
+ * bug, and surfacing it loudly is cheaper than silently returning a
4043
+ * stale captured message after the provider's state is conceptually
4044
+ * gone.
4045
+ */
4046
+ getLastLoadError() {
4047
+ if (this.disposed) throw new Error("CfnLocalStateProvider used after dispose()");
4048
+ return this.lastLoadError;
4049
+ }
4050
+ /**
3994
4051
  * Build a `CrossStackResolver` that resolves `Fn::ImportValue` via
3995
4052
  * `cloudformation:ListExports`. `Fn::GetStackOutput` is rejected here
3996
4053
  * — it has no CFn-side equivalent, and the user-visible error message
@@ -5923,10 +5980,10 @@ function parseContainerImage(raw, containerName, taskLogicalId, resources, _stac
5923
5980
  if (getAttImage) return classifyResolvedImage(getAttImage);
5924
5981
  const joinResolved = tryResolveImageFnJoin(raw, resources, context);
5925
5982
  if (joinResolved.kind === "resolved") return classifyResolvedImage(joinResolved.uri);
5926
- if (joinResolved.kind === "needs-state") throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} run-task cannot resolve the repository URI without state — pass --from-cfn-stack to load the deployed stack state, build via ContainerImage.fromAsset, or pin a public image.`);
5927
- if (joinResolved.kind === "unsupported-join") throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an unsupported Fn::Join Image shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} run-task recognizes the canonical CDK 2.x ContainerImage.fromEcrRepository Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
5983
+ if (joinResolved.kind === "needs-state") throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} cannot resolve the repository URI without state — ` + formatStateRemedy(context) + ", build via ContainerImage.fromAsset, or pin a public image.");
5984
+ if (joinResolved.kind === "unsupported-join") throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an unsupported Fn::Join Image shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} recognizes the canonical CDK 2.x ContainerImage.fromEcrRepository Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
5928
5985
  const flat = extractImageString(raw);
5929
- if (!flat) throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an unparseable Image property. ${getEmbedConfig().cliName} run-task v1 supports flat string images, single-key Fn::Sub bodies, and CDK-asset Image references.`);
5986
+ if (!flat) throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an unparseable Image property. ${getEmbedConfig().cliName} supports flat string images, single-key Fn::Sub bodies, and CDK-asset Image references.`);
5930
5987
  if (flat.includes("cdk-hnb659fds-container-assets-")) {
5931
5988
  const hashMatch = /:([a-f0-9]{8,})$/.exec(flat);
5932
5989
  const out = { kind: "cdk-asset" };
@@ -5936,9 +5993,9 @@ function parseContainerImage(raw, containerName, taskLogicalId, resources, _stac
5936
5993
  const substituted = substituteImagePlaceholders(flat, resources, context);
5937
5994
  if (substituted.includes("${")) {
5938
5995
  const unresolvedRepoRef = findUnresolvedEcrRepositoryRef(substituted, resources);
5939
- if (unresolvedRepoRef) throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' references same-stack ECR repository '${unresolvedRepoRef}'. ${getEmbedConfig().cliName} run-task v1 cannot resolve the repository URI without state — pass --from-cfn-stack to load the deployed stack state, build via ContainerImage.fromAsset, or pin a public image.`);
5996
+ if (unresolvedRepoRef) throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' references same-stack ECR repository '${unresolvedRepoRef}'. ${getEmbedConfig().cliName} cannot resolve the repository URI without state — ` + formatStateRemedy(context) + ", build via ContainerImage.fromAsset, or pin a public image.");
5940
5997
  if (substituted.includes("AWS::")) throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an Image that references AWS pseudo parameters (${substituted}). ${getEmbedConfig().productName} could not resolve them: confirm AWS credentials are configured so STS GetCallerIdentity succeeds, and that --region / AWS_REGION names the target region. Workaround: build the image locally (ContainerImage.fromAsset) or pin a public image.`);
5941
- throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an Image with unresolved \${...} placeholders (${substituted}). ${getEmbedConfig().cliName} run-task v1 only resolves AWS pseudo parameters and same-stack AWS::ECR::Repository refs.`);
5998
+ throw new EcsTaskResolutionError(`Container '${containerName}' in task '${taskLogicalId}' has an Image with unresolved \${...} placeholders (${substituted}). ${getEmbedConfig().cliName} only resolves AWS pseudo parameters and same-stack AWS::ECR::Repository refs.`);
5942
5999
  }
5943
6000
  const ecrMatch = /^(\d{12})\.dkr\.ecr\.([^.]+)\.amazonaws\.com(?:\.cn)?\//.exec(substituted);
5944
6001
  if (ecrMatch) return {
@@ -6043,8 +6100,8 @@ function parseVolume(raw, idx, taskLogicalId, subContext) {
6043
6100
  const v = raw;
6044
6101
  const name = pickString(v["Name"]);
6045
6102
  if (!name) throw new EcsTaskResolutionError(`Task '${taskLogicalId}' Volumes[${idx}] has no Name.`);
6046
- if (v["EFSVolumeConfiguration"]) throw new EcsTaskResolutionError(`Task '${taskLogicalId}' Volumes[${idx}] '${name}' uses EFSVolumeConfiguration, which ${getEmbedConfig().cliName} run-task cannot proxy locally. Workaround: bind-mount a local directory at the same containerPath via Host: { SourcePath: '<local-path>' }, or override at runtime via --env-vars semantics for a Phase 2 follow-up.`);
6047
- if (v["FSxWindowsFileServerVolumeConfiguration"]) throw new EcsTaskResolutionError(`Task '${taskLogicalId}' Volumes[${idx}] '${name}' uses FSxWindowsFileServerVolumeConfiguration, which ${getEmbedConfig().cliName} run-task cannot proxy locally.`);
6103
+ if (v["EFSVolumeConfiguration"]) throw new EcsTaskResolutionError(`Task '${taskLogicalId}' Volumes[${idx}] '${name}' uses EFSVolumeConfiguration, which ${getEmbedConfig().cliName} cannot proxy locally. Workaround: bind-mount a local directory at the same containerPath via Host: { SourcePath: '<local-path>' }, or override at runtime via --env-vars semantics for a Phase 2 follow-up.`);
6104
+ if (v["FSxWindowsFileServerVolumeConfiguration"]) throw new EcsTaskResolutionError(`Task '${taskLogicalId}' Volumes[${idx}] '${name}' uses FSxWindowsFileServerVolumeConfiguration, which ${getEmbedConfig().cliName} cannot proxy locally.`);
6048
6105
  const dockerCfg = v["DockerVolumeConfiguration"];
6049
6106
  if (dockerCfg && typeof dockerCfg === "object") {
6050
6107
  const d = dockerCfg;
@@ -17634,10 +17691,10 @@ function extractImageUri(value, logicalId, stackName, resources, region) {
17634
17691
  const pseudoParameters = derivePseudoParametersFromRegion(region);
17635
17692
  const joinResolved = tryResolveImageFnJoin(value, resources, pseudoParameters ? { pseudoParameters } : void 0);
17636
17693
  if (joinResolved.kind === "resolved") return joinResolved.uri;
17637
- if (joinResolved.kind === "needs-state") throw new Error(`Lambda '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} start-api cannot resolve the repository URI without state — deploy the stack first, rebuild via lambda.DockerImageCode.fromImageAsset, or pin a public image.`);
17638
- if (joinResolved.kind === "unsupported-join") throw new Error(`Lambda '${logicalId}' in ${stackName} has an unsupported Fn::Join Code.ImageUri shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} start-api recognizes the canonical CDK 2.x lambda.DockerImageCode.fromEcr Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
17694
+ if (joinResolved.kind === "needs-state") throw new Error(`Lambda '${logicalId}' in ${stackName} references same-stack ECR repository '${joinResolved.repoLogicalId}' via Fn::Join. ${getEmbedConfig().cliName} cannot resolve the repository URI without state — deploy the stack first, rebuild via lambda.DockerImageCode.fromImageAsset, or pin a public image.`);
17695
+ if (joinResolved.kind === "unsupported-join") throw new Error(`Lambda '${logicalId}' in ${stackName} has an unsupported Fn::Join Code.ImageUri shape: ${joinResolved.reason}. ${getEmbedConfig().cliName} recognizes the canonical CDK 2.x lambda.DockerImageCode.fromEcr Fn::Join shape (delimiter "" with nested Fn::Select/Fn::Split over an ECR Repository Arn GetAtt + Ref to the repo).`);
17639
17696
  const accountIdHint = pseudoParameters ? ` (likely \${AWS::AccountId}, which ${getEmbedConfig().binaryName} cannot derive without a state source or STS)` : ` (${getEmbedConfig().binaryName} could not derive AWS pseudo parameters because stack.region was undefined)`;
17640
- throw new Error(`Lambda '${logicalId}' in ${stackName} has an Fn::Join Code.ImageUri that ${getEmbedConfig().cliName} start-api cannot resolve${accountIdHint}. Workarounds: deploy first and run with a state-source flag (e.g. --from-cfn-stack or a host-provided extension), or pin a fully-literal public image URI.`);
17697
+ throw new Error(`Lambda '${logicalId}' in ${stackName} has an Fn::Join Code.ImageUri that ${getEmbedConfig().cliName} cannot resolve${accountIdHint}. Workarounds: deploy first and run with a state-source flag (e.g. --from-cfn-stack or a host-provided extension), or pin a fully-literal public image URI.`);
17641
17698
  }
17642
17699
  }
17643
17700
  }
@@ -18811,6 +18868,9 @@ async function buildAgentCoreImageContext(candidate, stateProvider, options) {
18811
18868
  if (Object.keys(ssm.values).length > 0) context.stateParameters = ssm.values;
18812
18869
  if (ssm.secureStringLogicalIds.length > 0) context.stateSensitiveParameters = ssm.secureStringLogicalIds;
18813
18870
  }
18871
+ } else {
18872
+ const loadError = stateProvider.getLastLoadError?.();
18873
+ if (loadError) context.stateLoadFailureMessage = loadError;
18814
18874
  }
18815
18875
  return {
18816
18876
  context,
@@ -20355,6 +20415,10 @@ async function buildEcsImageResolutionContext$1(candidate, stateProvider, option
20355
20415
  if (stateProvider && wantsState) {
20356
20416
  const loaded = await stateProvider.load(candidate.stackName, candidate.region);
20357
20417
  if (loaded) ctx.stateResources = loaded.resources;
20418
+ else {
20419
+ const loadError = stateProvider.getLastLoadError?.();
20420
+ if (loadError) ctx.stateLoadFailureMessage = loadError;
20421
+ }
20358
20422
  if (needs.needsEnvOrSecretSubstitution && stateProvider.resolveTemplateSsmParameters) {
20359
20423
  const ssmParameters = await stateProvider.resolveTemplateSsmParameters(candidate.template);
20360
20424
  if (Object.keys(ssmParameters.values).length > 0) ctx.stateParameters = ssmParameters.values;
@@ -23258,7 +23322,18 @@ async function runEcsServiceEmulator(targets, options, strategy, extraStateProvi
23258
23322
  let frontDoorServers = [];
23259
23323
  let frontDoorByService = /* @__PURE__ */ new Map();
23260
23324
  let frontDoorLambdaRunners = [];
23325
+ let watcher;
23326
+ let reloadChain = Promise.resolve();
23261
23327
  const cleanup = singleFlight(async () => {
23328
+ if (watcher) {
23329
+ try {
23330
+ await watcher.close();
23331
+ } catch (err) {
23332
+ getLogger().warn(`watcher.close() failed: ${err instanceof Error ? err.message : String(err)}`);
23333
+ }
23334
+ watcher = void 0;
23335
+ }
23336
+ await reloadChain.catch(() => void 0);
23262
23337
  await Promise.allSettled(perTarget.map(async (pt) => {
23263
23338
  if (pt.controller) await pt.controller.shutdown();
23264
23339
  else {
@@ -23369,8 +23444,41 @@ async function runEcsServiceEmulator(targets, options, strategy, extraStateProvi
23369
23444
  } else logger.info(`Service(s) running: ${frontDoorLambdaRunners.length} Lambda target(s) behind the ALB front-door.`);
23370
23445
  logEndpointsBanner(perTarget, frontDoorServers, logger);
23371
23446
  logger.info("Press ^C to shut down.");
23372
- if (perTarget.length > 0) await Promise.all(perTarget.map((pt) => pt.controller.waitForShutdown()));
23373
- else await new Promise(() => {});
23447
+ if (options.watch === true && strategy.supportsWatch === true) {
23448
+ const watchRoot = process.cwd();
23449
+ const { ignored, shouldTrigger, excludePatterns } = createWatchPredicates({
23450
+ watchRoot,
23451
+ output: options.output,
23452
+ watchConfig: resolveWatchConfig()
23453
+ });
23454
+ watcher = createFileWatcher({
23455
+ paths: [watchRoot],
23456
+ ignored,
23457
+ shouldTrigger,
23458
+ onChange: () => {
23459
+ logger.info("Detected source change; reloading service(s)...");
23460
+ reloadChain = reloadChain.then(() => reloadAllServices({
23461
+ perTarget,
23462
+ synthesizer,
23463
+ synthOpts,
23464
+ strategy,
23465
+ resolvedTargets,
23466
+ cloudMapIndexByStack,
23467
+ options,
23468
+ discovery,
23469
+ skipPull,
23470
+ extraStateProviders,
23471
+ profileCredsFile,
23472
+ frontDoorByService,
23473
+ logger
23474
+ })).catch((err) => {
23475
+ logger.error(`reloadAllServices threw: ${err instanceof Error ? err.message : String(err)}`);
23476
+ });
23477
+ }
23478
+ });
23479
+ logger.info(`Watching ${watchRoot} for source changes (excluding ${excludePatterns.join(", ")}).`);
23480
+ }
23481
+ await new Promise(() => {});
23374
23482
  } finally {
23375
23483
  if (sigintHandler) {
23376
23484
  process.off("SIGINT", sigintHandler);
@@ -23379,6 +23487,87 @@ async function runEcsServiceEmulator(targets, options, strategy, extraStateProvi
23379
23487
  await cleanup();
23380
23488
  }
23381
23489
  }
23490
+ /**
23491
+ * Phase 1 of issue #214 — refuse a `--watch` run when the resolved service's
23492
+ * effective replica count (`min(template DesiredCount, --max-tasks)`) is > 1.
23493
+ * The Phase 1 reload pathway tears the single replica down before booting the
23494
+ * new one; multi-replica services would therefore drop multiple connections at
23495
+ * once and lose any in-memory state. Multi-replica rolling reload is Phase 2
23496
+ * of issue #214. Exposed for the unit test that locks the gating logic
23497
+ * (the integ test only covers the single-replica happy path).
23498
+ *
23499
+ * @internal
23500
+ */
23501
+ function assertSingleReplicaForWatch(service, options) {
23502
+ if (options.watch !== true) return;
23503
+ const effective = computeReplicaCount(service.desiredCount, options.maxTasks);
23504
+ if (effective > 1) throw new LocalStartServiceError(`--watch is single-replica only in v1; service '${service.serviceName}' resolves to ${effective} replica(s) (template DesiredCount=${service.desiredCount}, --max-tasks=${options.maxTasks}). Lower --max-tasks to 1, drop the DesiredCount in your CDK code, or drop --watch. Multi-replica rolling reload is Phase 2 of issue #214.`);
23505
+ }
23506
+ /**
23507
+ * Phase 1 of issue #214 — single-replica rebuild-on-change reload cycle.
23508
+ * Mirrors start-api's `reloadAllServers` shape but per-ECS-service:
23509
+ *
23510
+ * 1. Re-runs `synthesizer.synthesize(synthOpts)` once (failure → warn +
23511
+ * keep every replica serving).
23512
+ * 2. Re-runs `strategy.resolveBoots(stacks, resolvedTargets)` so a
23513
+ * target that disappears from the CDK code is detected (warn + keep
23514
+ * previous).
23515
+ * 3. Refreshes `cloudMapIndexByStack` from the new stacks so a peer
23516
+ * service's namespace / discovery-name rename is picked up by the
23517
+ * next replica's Cloud Map publish.
23518
+ * 4. Per-target: tear the existing controller down, boot a fresh one
23519
+ * against the new stacks. A per-target boot failure logs warn and
23520
+ * leaves that target dark until the next save with a clean boot.
23521
+ *
23522
+ * Phase 1 trade-off: each target's replica briefly stops (between old
23523
+ * `controller.shutdown()` and new `bootOneTarget()` finishing). Phase 2 of
23524
+ * #214 swaps that for a rolling deploy across multiple replicas.
23525
+ */
23526
+ async function reloadAllServices(args) {
23527
+ const { perTarget, synthesizer, synthOpts, strategy, resolvedTargets, cloudMapIndexByStack, options, discovery, skipPull, extraStateProviders, profileCredsFile, frontDoorByService, logger } = args;
23528
+ let stacks;
23529
+ try {
23530
+ ({stacks} = await synthesizer.synthesize(synthOpts));
23531
+ } catch (err) {
23532
+ logger.warn(`cdk synth failed during reload; keeping previous version. (${err instanceof Error ? err.message : String(err)})`);
23533
+ return;
23534
+ }
23535
+ const { boots: newBoots, warnings } = strategy.resolveBoots(stacks, resolvedTargets);
23536
+ for (const w of warnings) logger.warn(w);
23537
+ const newBootByTarget = new Map(newBoots.map((b) => [b.target, b]));
23538
+ cloudMapIndexByStack.clear();
23539
+ for (const stack of stacks) {
23540
+ const index = buildCloudMapIndex(stack);
23541
+ cloudMapIndexByStack.set(stack.stackName, index);
23542
+ for (const w of index.warnings) logger.warn(w);
23543
+ }
23544
+ for (const pt of perTarget) {
23545
+ const newBoot = newBootByTarget.get(pt.boot.target);
23546
+ if (!newBoot) {
23547
+ logger.warn(`Reload: target '${pt.boot.target}' no longer resolves to a service in the synthesized app; keeping the previous replica serving.`);
23548
+ continue;
23549
+ }
23550
+ const oldController = pt.controller;
23551
+ try {
23552
+ if (oldController) await oldController.shutdown();
23553
+ } catch (err) {
23554
+ logger.warn(`Reload: shutdown of previous '${pt.boot.target}' controller failed (${err instanceof Error ? err.message : String(err)}); attempting re-boot anyway.`);
23555
+ }
23556
+ const newRunState = createServiceRunState();
23557
+ let newController;
23558
+ try {
23559
+ newController = await bootOneTarget(newBoot, newRunState, stacks, options, discovery, skipPull, extraStateProviders, profileCredsFile, frontDoorByService.get(newBoot.target), strategy.suppressLoadBalancerWarning === true);
23560
+ } catch (err) {
23561
+ if (err instanceof LocalStartServiceError) logger.error(`Reload of '${pt.boot.target}' was rejected: ${err.message}`);
23562
+ else logger.error(`Reload: re-boot of '${pt.boot.target}' failed (${err instanceof Error ? err.message : String(err)}). The previous replica was torn down; save again with a clean boot to re-start it, or ^C and re-run start-service.`);
23563
+ await Promise.allSettled(newRunState.replicas.map((r) => cleanupEcsRun(r.state, { keepRunning: false }).catch(() => void 0)));
23564
+ continue;
23565
+ }
23566
+ pt.runState = newRunState;
23567
+ pt.controller = newController;
23568
+ }
23569
+ logger.info("Reload complete.");
23570
+ }
23382
23571
  async function bootOneTarget(boot, runState, stacks, options, discovery, skipPull, extraStateProviders, profileCredsFile, frontDoorPools, suppressLoadBalancerWarning) {
23383
23572
  const candidate = pickCandidateStack(parseEcsTarget(boot.target).stackPattern, stacks);
23384
23573
  const stateProvider = createLocalStateProvider(options, candidate?.stackName ?? "", await resolveCfnFallbackRegion(options, candidate?.region), extraStateProviders);
@@ -23394,6 +23583,7 @@ async function runOneTarget(boot, runState, stacks, options, discovery, skipPull
23394
23583
  const imageContext = await buildEcsImageResolutionContext(target, stacks, options, stateProvider);
23395
23584
  const service = resolveEcsServiceTarget(target, stacks, imageContext, { suppressLoadBalancerWarning });
23396
23585
  logger.info(`Target: ${service.stack.stackName}/${service.serviceLogicalId} (service=${service.serviceName}, desiredCount=${service.desiredCount}, task=${service.task.taskDefinitionLogicalId})`);
23586
+ assertSingleReplicaForWatch(service, options);
23397
23587
  if (service.serviceConnect) logger.info(`Service Connect: namespace='${service.serviceConnect.namespaceName}', ${service.serviceConnect.services.length} service(s) registered for peer discovery.`);
23398
23588
  if (service.serviceRegistries.length > 0) logger.info(`Cloud Map: ${service.serviceRegistries.length} ServiceRegistry binding(s).`);
23399
23589
  const taskNeeds = detectEcsImageResolutionNeeds(stacks.find((s) => s.stackName === service.stack.stackName) ?? service.stack);
@@ -23714,6 +23904,10 @@ async function buildEcsImageResolutionContext(target, stacks, options, stateProv
23714
23904
  if (stateProvider && wantsState) {
23715
23905
  const loaded = await stateProvider.load(candidate.stackName, candidate.region);
23716
23906
  if (loaded) ctx.stateResources = loaded.resources;
23907
+ else {
23908
+ const loadError = stateProvider.getLastLoadError?.();
23909
+ if (loadError) ctx.stateLoadFailureMessage = loadError;
23910
+ }
23717
23911
  if (needs.needsEnvOrSecretSubstitution && stateProvider.resolveTemplateSsmParameters) {
23718
23912
  const ssmParameters = await stateProvider.resolveTemplateSsmParameters(candidate.template);
23719
23913
  if (Object.keys(ssmParameters.values).length > 0) ctx.stateParameters = ssmParameters.values;
@@ -23845,6 +24039,73 @@ function addCommonEcsServiceOptions(cmd) {
23845
24039
  return cmd;
23846
24040
  }
23847
24041
 
24042
+ //#endregion
24043
+ //#region src/cli/commands/local-start-service.ts
24044
+ /**
24045
+ * `cdkl start-service` strategy — a pure ECS replica runner. It picks
24046
+ * `AWS::ECS::Service` targets and boots each with NO front-door (the ALB
24047
+ * front-door is its own command, `cdkl start-alb`). This keeps `start-service`
24048
+ * a leaf compute runner, symmetric with `invoke` / `run-task`.
24049
+ *
24050
+ * `supportsWatch: true` opts this strategy into the emulator's `--watch`
24051
+ * reload pathway (Phase 1 of issue #214 — single-replica rebuild-on-change).
24052
+ * `start-alb`'s strategy intentionally does NOT set this so a `--watch` flag
24053
+ * never leaks into the ALB-front-door path (Phase 3).
24054
+ */
24055
+ function serviceStrategy() {
24056
+ return {
24057
+ pickEntries: (stacks) => listTargets(stacks).ecsServices,
24058
+ pickerMessage: "Select one or more ECS services to run",
24059
+ pickerNoun: "ECS services",
24060
+ onMissing: () => new LocalStartServiceError(`${getEmbedConfig().cliName} start-service requires at least one <target>. Pass one or more service paths like 'Stack/Orders' 'Stack/Frontend', or run it in a TTY to pick interactively.`),
24061
+ resolveBoots: (_stacks, chosenTargets) => ({
24062
+ boots: chosenTargets.map((target) => ({ target })),
24063
+ warnings: []
24064
+ }),
24065
+ lbPortOverrides: {},
24066
+ supportsWatch: true
24067
+ };
24068
+ }
24069
+ /**
24070
+ * `cdkl start-service <Stack/Service>` — Phase 2 of #262. Spins up
24071
+ * `DesiredCount` task replicas locally (clamped by `--max-tasks`) using the
24072
+ * existing `ecs-task-runner` per replica. Long-running; ^C cleans every replica
24073
+ * + sidecar + shared network. Pure compute: to put a local ALB front-door in
24074
+ * front of an ALB-fronted service, use `cdkl start-alb`.
24075
+ */
24076
+ function createLocalStartServiceCommand(opts = {}) {
24077
+ setEmbedConfig(opts.embedConfig);
24078
+ const cmd = new Command("start-service").description(`Run one or more AWS::ECS::Service resources locally as a long-running emulator. Spins up DesiredCount task replicas per service (clamped by --max-tasks) using the same per-task docker network + metadata sidecar pattern as \`${getEmbedConfig().cliName} run-task\`, then keeps each replica running and restarts it on exit per --restart-policy. ^C tears every replica + sidecar + network down. Each <target> accepts a CDK display path (MyStack/MyService) or stack-qualified logical ID (MyStack:MyServiceXYZ); single-stack apps may omit the stack prefix. When two or more <target>s are supplied, every service is booted into a shared Cloud Map / Service Connect registry so peer services discover each other via docker --add-host overlay. Omit <targets> in an interactive terminal to multi-select the services from a list. To put a local ALB front-door in front of an ALB-fronted service, use \`${getEmbedConfig().cliName} start-alb\` instead.`).argument("[targets...]", "One or more CDK display paths or stack-qualified logical IDs of the AWS::ECS::Service resources to run (omit to multi-select interactively in a TTY)").action(withErrorHandling(async (targets, options) => {
24079
+ await runEcsServiceEmulator(targets, options, serviceStrategy(), opts.extraStateProviders);
24080
+ }));
24081
+ addStartServiceSpecificOptions(cmd);
24082
+ return addCommonEcsServiceOptions(cmd);
24083
+ }
24084
+ /**
24085
+ * Register the option block that `cdkl start-service` adds on top of the
24086
+ * shared {@link addCommonEcsServiceOptions} ECS-service common block — the
24087
+ * flags that only make sense for a pure-compute service emulator (no front
24088
+ * door). Shared between `cdkl start-service` and any host CLI (e.g. cdkd's
24089
+ * `local start-service`) that wraps {@link runEcsServiceEmulator} with the
24090
+ * {@link serviceStrategy}, so adding or renaming a `start-service`-only flag
24091
+ * here propagates to every embedder without duplicate `.addOption(...)`
24092
+ * blocks.
24093
+ *
24094
+ * Calling order only affects `--help` presentation (Commander parses
24095
+ * insertion-order-independent). The host-CLI convention is host-specific
24096
+ * options first, then this helper, then {@link addCommonEcsServiceOptions}
24097
+ * — host flags / start-service flags / common flags grouped in three
24098
+ * `--help` clusters. Chainable: returns `cmd`.
24099
+ *
24100
+ * `--watch` is intentionally NOT in the shared
24101
+ * {@link addCommonEcsServiceOptions} block: `start-alb --watch` is not yet
24102
+ * implemented (Phase 3 of issue #214), and the shared block must not
24103
+ * advertise a flag one of its consumers does not honor.
24104
+ */
24105
+ function addStartServiceSpecificOptions(cmd) {
24106
+ return cmd.addOption(new Option("--host-port <containerPort=hostPort...>", "Publish a container port on a specific host port (e.g. 80=8080); repeatable. Default: host port == container port. Use this on macOS to map a privileged container port (< 1024) to a non-privileged host port and avoid the Docker Desktop admin-password prompt. (Single-replica services only — multi-replica services do not publish host ports.)")).addOption(new Option("--watch", "Hot-reload: re-synth + re-resolve every booted service and replace its single replica when the CDK app's source changes (honors cdk.json watch.include/exclude; cdk.out, node_modules, .git are always excluded). Single-replica services only in v1 — a service with effective replica count > 1 errors out (multi-replica rolling deploy is Phase 2 of issue #214). Off by default; the previous replica keeps serving when synth fails mid-reload.").default(false));
24107
+ }
24108
+
23848
24109
  //#endregion
23849
24110
  //#region src/local/elb-front-door-resolver.ts
23850
24111
  /**
@@ -24790,5 +25051,5 @@ function addListSpecificOptions(cmd) {
24790
25051
  }
24791
25052
 
24792
25053
  //#endregion
24793
- export { pickResponseTemplate as $, substituteAgainstState as $t, createFileWatcher as A, AgentCoreResolutionError as An, MCP_PATH as At, resolveServiceIntegrationParameters as B, SUPPORTED_CODE_RUNTIMES as Bt, addInvokeAgentCoreSpecificOptions as C, pickRefLogicalId as Cn, isFunctionUrlOacFronted as Ct, createWatchPredicates as D, AGENTCORE_HTTP_PROTOCOL as Dn, A2A_PATH as Dt, createLocalStartApiCommand as E, AGENTCORE_AGUI_PROTOCOL as En, A2A_CONTAINER_PORT as Et, filterRoutesByApiIdentifiers as F, tryResolveImageFnJoin as Fn, signAgentCoreInvocation as Ft, invokeRequestAuthorizer as G, addInvokeSpecificOptions as Gt, buildMethodArn as H, computeCodeImageTag as Ht, groupRoutesByServer as I, LocalInvokeBuildError as In, AGENTCORE_SESSION_ID_HEADER as It, translateLambdaResponse as J, buildContainerImage as Jt, invokeTokenAuthorizer as K, createLocalInvokeCommand as Kt, readMtlsMaterialsFromDisk as L, LocalStartServiceError as Ln, invokeAgentCore as Lt, buildStageMap as M, resolveAgentCoreTarget as Mn, mcpInvokeOnce as Mt, availableApiIdentifiers as N, derivePseudoParametersFromRegion as Nn, parseSseForJsonRpc as Nt, resolveApiTargetSubset as O, AGENTCORE_MCP_PROTOCOL as On, a2aInvokeOnce as Ot, filterRoutesByApiIdentifier as P, substituteImagePlaceholders as Pn, AGENTCORE_SIGV4_SERVICE as Pt, evaluateResponseParameters as Q, EcsTaskResolutionError as Qt, startApiServer as R, withErrorHandling as Rn, waitForAgentCorePing as Rt, createLocalRunTaskCommand as S, discoverRoutes as Sn, buildCorsConfigFromCloudFrontChain as St, addStartApiSpecificOptions as T, AGENTCORE_A2A_PROTOCOL as Tn, invokeAgentCoreWs as Tt, computeRequestIdentityHash as U, renderCodeDockerfile as Ut, defaultCredentialsLoader as V, buildAgentCoreCodeImage as Vt, evaluateCachedLambdaPolicy as W, toCmdArgv as Wt, buildHttpApiV2Event as X, resolveRuntimeFileExtension as Xt, applyAuthorizerOverlay as Y, resolveRuntimeCodeMountPath as Yt, buildRestV1Event as Z, resolveRuntimeImage as Zt, runEcsServiceEmulator as _, countTargets as _n, verifyJwtAuthorizer as _t, albStrategy as a, LocalStateSourceError as an, bufferToBody as at, getContainerNetworkIp as b, discoverWebSocketApisOrThrow as bn, applyCorsResponseHeaders as bt, resolveAlbTarget as c, rejectExplicitCfnStackWithMultipleStacks as cn, handleConnectionsRequest as ct, MAX_TASKS_SUBNET_RANGE_CAP as d, resolveCfnStackName as dn, buildDisconnectEvent as dt, substituteAgainstStateAsync as en, selectIntegrationResponse as et, addCommonEcsServiceOptions as f, CfnLocalStateProvider as fn, buildMessageEvent as ft, resolveSharedSidecarCredentials as g, resolveSingleTarget as gn, verifyCognitoJwt as gt, parseRestartPolicy as h, resolveWatchConfig as hn, createJwksCache as ht, addAlbSpecificOptions as i, materializeLayerFromArn as in, probeHostGatewaySupport as it, attachStageContext as j, pickAgentCoreCandidateStack as jn, MCP_PROTOCOL_VERSION as jt, createAuthorizerCache as k, AGENTCORE_RUNTIME_TYPE as kn, MCP_CONTAINER_PORT as kt, isApplicationLoadBalancer as l, resolveCfnFallbackRegion as ln, parseConnectionsPath as lt, parseMaxTasks as m, resolveSsmParameters as mn, buildJwksUrlFromIssuer as mt, createLocalListCommand as n, substituteEnvVarsFromStateAsync as nn, VtlEvaluationError as nt, createLocalStartAlbCommand as o, createLocalStateProvider as on, ConnectionRegistry as ot, buildEcsImageResolutionContext as p, collectSsmParameterRefs as pn, buildCognitoJwksUrl as pt, matchRoute as q, architectureToPlatform as qt, formatTargetListing as r, resolveEnvVars as rn, HOST_GATEWAY_MIN_VERSION as rt, parseLbPortOverrides as s, isCfnFlagPresent as sn, buildMgmtEndpointEnvUrl as st, addListSpecificOptions as t, substituteEnvVarsFromState as tn, tryParseStatus as tt, resolveAlbFrontDoor as u, resolveCfnRegion as un, buildConnectEvent as ut, buildCloudMapIndex as v, listTargets as vn, verifyJwtViaDiscovery as vt, createLocalInvokeAgentCoreCommand as w, resolveLambdaArnIntrinsic as wn, matchPreflight as wt, addRunTaskSpecificOptions as x, parseSelectionExpressionPath as xn, buildCorsConfigByApiId as xt, CloudMapRegistry as y, discoverWebSocketApis as yn, attachAuthorizers as yt, resolveSelectionExpression as z, downloadAndExtractS3Bundle as zt };
24794
- //# sourceMappingURL=local-list-JDGfdnip.js.map
25054
+ export { buildHttpApiV2Event as $, resolveRuntimeFileExtension as $t, createWatchPredicates as A, AGENTCORE_HTTP_PROTOCOL as An, A2A_PATH as At, readMtlsMaterialsFromDisk as B, LocalInvokeBuildError as Bn, invokeAgentCore as Bt, getContainerNetworkIp as C, discoverWebSocketApisOrThrow as Cn, applyCorsResponseHeaders as Ct, createLocalInvokeAgentCoreCommand as D, resolveLambdaArnIntrinsic as Dn, matchPreflight as Dt, addInvokeAgentCoreSpecificOptions as E, pickRefLogicalId as En, isFunctionUrlOacFronted as Et, buildStageMap as F, resolveAgentCoreTarget as Fn, mcpInvokeOnce as Ft, buildMethodArn as G, computeCodeImageTag as Gt, resolveSelectionExpression as H, downloadAndExtractS3Bundle as Ht, availableApiIdentifiers as I, derivePseudoParametersFromRegion as In, parseSseForJsonRpc as It, invokeRequestAuthorizer as J, addInvokeSpecificOptions as Jt, computeRequestIdentityHash as K, renderCodeDockerfile as Kt, filterRoutesByApiIdentifier as L, formatStateRemedy as Ln, AGENTCORE_SIGV4_SERVICE as Lt, createAuthorizerCache as M, AGENTCORE_RUNTIME_TYPE as Mn, MCP_CONTAINER_PORT as Mt, createFileWatcher as N, AgentCoreResolutionError as Nn, MCP_PATH as Nt, addStartApiSpecificOptions as O, AGENTCORE_A2A_PROTOCOL as On, invokeAgentCoreWs as Ot, attachStageContext as P, pickAgentCoreCandidateStack as Pn, MCP_PROTOCOL_VERSION as Pt, applyAuthorizerOverlay as Q, resolveRuntimeCodeMountPath as Qt, filterRoutesByApiIdentifiers as R, substituteImagePlaceholders as Rn, signAgentCoreInvocation as Rt, CloudMapRegistry as S, discoverWebSocketApis as Sn, attachAuthorizers as St, createLocalRunTaskCommand as T, discoverRoutes as Tn, buildCorsConfigFromCloudFrontChain as Tt, resolveServiceIntegrationParameters as U, SUPPORTED_CODE_RUNTIMES as Ut, startApiServer as V, waitForAgentCorePing as Vt, defaultCredentialsLoader as W, buildAgentCoreCodeImage as Wt, matchRoute as X, architectureToPlatform as Xt, invokeTokenAuthorizer as Y, createLocalInvokeCommand as Yt, translateLambdaResponse as Z, buildContainerImage as Zt, parseMaxTasks as _, resolveSsmParameters as _n, buildJwksUrlFromIssuer as _t, albStrategy as a, substituteEnvVarsFromStateAsync as an, VtlEvaluationError as at, runEcsServiceEmulator as b, countTargets as bn, verifyJwtAuthorizer as bt, resolveAlbTarget as c, LocalStateSourceError as cn, bufferToBody as ct, addStartServiceSpecificOptions as d, rejectExplicitCfnStackWithMultipleStacks as dn, handleConnectionsRequest as dt, resolveRuntimeImage as en, buildRestV1Event as et, createLocalStartServiceCommand as f, resolveCfnFallbackRegion as fn, parseConnectionsPath as ft, buildEcsImageResolutionContext as g, collectSsmParameterRefs as gn, buildCognitoJwksUrl as gt, addCommonEcsServiceOptions as h, CfnLocalStateProvider as hn, buildMessageEvent as ht, addAlbSpecificOptions as i, substituteEnvVarsFromState as in, tryParseStatus as it, resolveApiTargetSubset as j, AGENTCORE_MCP_PROTOCOL as jn, a2aInvokeOnce as jt, createLocalStartApiCommand as k, AGENTCORE_AGUI_PROTOCOL as kn, A2A_CONTAINER_PORT as kt, isApplicationLoadBalancer as l, createLocalStateProvider as ln, ConnectionRegistry as lt, MAX_TASKS_SUBNET_RANGE_CAP as m, resolveCfnStackName as mn, buildDisconnectEvent as mt, createLocalListCommand as n, substituteAgainstState as nn, pickResponseTemplate as nt, createLocalStartAlbCommand as o, resolveEnvVars as on, HOST_GATEWAY_MIN_VERSION as ot, serviceStrategy as p, resolveCfnRegion as pn, buildConnectEvent as pt, evaluateCachedLambdaPolicy as q, toCmdArgv as qt, formatTargetListing as r, substituteAgainstStateAsync as rn, selectIntegrationResponse as rt, parseLbPortOverrides as s, materializeLayerFromArn as sn, probeHostGatewaySupport as st, addListSpecificOptions as t, EcsTaskResolutionError as tn, evaluateResponseParameters as tt, resolveAlbFrontDoor as u, isCfnFlagPresent as un, buildMgmtEndpointEnvUrl as ut, parseRestartPolicy as v, resolveWatchConfig as vn, createJwksCache as vt, addRunTaskSpecificOptions as w, parseSelectionExpressionPath as wn, buildCorsConfigByApiId as wt, buildCloudMapIndex as x, listTargets as xn, verifyJwtViaDiscovery as xt, resolveSharedSidecarCredentials as y, resolveSingleTarget as yn, verifyCognitoJwt as yt, groupRoutesByServer as z, tryResolveImageFnJoin as zn, AGENTCORE_SESSION_ID_HEADER as zt };
25055
+ //# sourceMappingURL=local-list-CyW86HDN.js.map