cdk-local 0.70.0 → 0.71.1

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.
@@ -19182,6 +19182,143 @@ function addInvokeAgentCoreSpecificOptions(cmd) {
19182
19182
  return cmd.addOption(new Option("-e, --event <file>", "JSON event payload file (default: {})")).addOption(new Option("--event-stdin", "Read event JSON from stdin").default(false)).addOption(new Option("--env-vars <file>", "JSON env-var overrides (SAM-compatible: {\"LogicalId\":{\"KEY\":\"VALUE\"}})")).addOption(new Option("--session-id <id>", "AgentCore runtime session id header value (default: a random UUID)")).addOption(new Option("--ws", "Stream over the HTTP-protocol agent's bidirectional /ws WebSocket endpoint (on 8080) instead of POST /invocations: send --event as the first frame and print every received frame to stdout until the agent closes. Ignored for an MCP runtime.").default(false)).addOption(new Option("--ws-interactive", "REPL mode for --ws: after the initial --event frame, read additional frames from stdin (one frame per line, trailing newline stripped) and send each as a text frame until stdin EOFs (Ctrl-D) or the agent closes. Only meaningful with --ws.").default(false)).addOption(new Option("--bearer-token <jwt>", "Bearer JWT to present when the runtime declares a customJwtAuthorizer. Verified against the runtime OIDC discovery URL (signature / issuer / expiry / audience) before the container starts, then forwarded to /invocations as Authorization: Bearer <jwt>.")).addOption(new Option("--no-verify-auth", "Skip inbound JWT verification even when the runtime declares a customJwtAuthorizer (local-dev escape hatch). A --bearer-token, if given, is still forwarded.")).addOption(new Option("--sigv4", "Sign the /invocations POST with AWS SigV4 (service bedrock-agentcore) using the resolved credentials, matching the cloud default when the runtime declares no customJwtAuthorizer. Opt-in: default unsigned. Mutually exclusive with --bearer-token; ignored on a JWT-protected runtime.").default(false)).addOption(new Option("--platform <platform>", "docker --platform for the agent container (linux/amd64 or linux/arm64)").choices(["linux/amd64", "linux/arm64"]).default("linux/arm64")).addOption(new Option("--no-pull", "Skip docker pull (use cached image) — no-op for the local-build path")).addOption(new Option("--no-build", "Skip docker build on the local-asset path (use the previously-built tag). No-op for the ECR / registry pull paths.")).addOption(new Option("--container-host <host>", "Host to bind the agent port to").default("127.0.0.1")).addOption(new Option("--timeout <ms>", "Per-request timeout in milliseconds. Applied to POST /invocations, POST /mcp, and the /ws open-to-close window. Raise this for long-running agent calls that exceed the default.").default(12e4).argParser(parseTimeoutMs)).addOption(new Option("--assume-role [arn]", "Assume the runtime's execution role and forward STS-issued temp credentials to the container so the agent runs with the deployed role. Three forms: (1) `--assume-role <arn>` assumes the explicit ARN; (2) `--assume-role` (bare) uses the runtime's RoleArn when it is a literal ARN; (3) `--no-assume-role` opts out. Off by default — the developer's shell credentials are forwarded unchanged.")).addOption(new Option("--ecr-role-arn <arn>", "Role ARN to assume before authenticating against ECR for cross-account / centralized registries. Same-account / same-region pulls do not need this flag.")).addOption(new Option("--from-cfn-stack [cfn-stack-name]", "Read a deployed CloudFormation stack via ListStackResources and substitute Ref / Fn::ImportValue in env vars with the deployed physical IDs / exports. Bare form uses the resolved stack name; pass an explicit value when the CFn stack name differs.")).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region."));
19183
19183
  }
19184
19184
 
19185
+ //#endregion
19186
+ //#region src/local/container-log-streamer.ts
19187
+ /**
19188
+ * Spawn `docker logs -f <containerId>` and pipe its stdout / stderr to
19189
+ * the host's `process.stdout` / `process.stderr`, prefixing every emitted
19190
+ * line with the caller-supplied `prefix`. Returns a stop function that
19191
+ * drains any unterminated tail line and SIGTERMs the streamer process —
19192
+ * idempotent + safe to call from a `finally` or shutdown handler.
19193
+ *
19194
+ * Used by `cdkl run-task` (per-container prefix `[<container-name>]`) and
19195
+ * by `cdkl start-service` / `cdkl start-alb` (per-replica prefix
19196
+ * `[svc=<service> r=<i> c=<container>]`) so application `console.log`
19197
+ * output inside a replica is visible in the foreground terminal without
19198
+ * having to attach `docker logs -f` in a separate shell. The prefix shape
19199
+ * is the caller's concern: this helper only cares about line-buffered
19200
+ * pass-through.
19201
+ *
19202
+ * **Auto re-attach on `docker restart`** (Issue #227 + #214 soft-reload):
19203
+ * the docker daemon terminates `docker logs -f` when the container's
19204
+ * PID 1 exits — so a `docker restart` (the soft-reload primitive) ends
19205
+ * the follow stream even though the container ID is preserved across the
19206
+ * restart. The streamer detects an unsolicited child-exit and re-spawns
19207
+ * `docker logs -f` with `--since 0s` so only NEW output (from the
19208
+ * post-restart PID-1) is forwarded; the v1 prelude is not re-emitted.
19209
+ * `stop()` flips an internal "stopping" flag so the re-attach loop sees
19210
+ * the intentional teardown and does not respawn.
19211
+ *
19212
+ * **Cap-reached warning** (Issue #227 review fix — Code #2): the
19213
+ * re-attach budget is bounded at 50 to defend against a permanently-
19214
+ * broken `docker logs -f` (the container was removed out from under
19215
+ * us). When the cap is hit, the streamer surfaces ONE warning line via
19216
+ * `process.stderr` naming the prefix + the manual recovery so a long-
19217
+ * running `--watch` session does not lose its foreground log surface
19218
+ * silently.
19219
+ *
19220
+ * **Dying-container respawn skip** (Issue #227 review fix — Code #4):
19221
+ * when the child exits unsolicited and the container's `State.Status`
19222
+ * is `exited` / `dead` / `removing`, the streamer does NOT respawn —
19223
+ * the natural-exit path is the service-runner's `cleanupEcsRun(...)`
19224
+ * call (~1s after the wait resolves), and a respawn against a
19225
+ * dying container is just a wasted `docker logs -f` process + a
19226
+ * spurious cap-reached tick. A `docker restart` (the soft-reload
19227
+ * primitive) leaves the container in `restarting` / `running`, so
19228
+ * the soft-reload re-attach path is preserved. Falls open: an
19229
+ * inspect error treats the container as still alive (best-effort —
19230
+ * the cap+stop() invariants stay correct either way).
19231
+ *
19232
+ * The streamer is best-effort. A spawn / pipe error is silently swallowed
19233
+ * (the parent's `docker wait` already surfaces the underlying container
19234
+ * failure with full context); the loud surface stays on the runner's exit
19235
+ * path.
19236
+ */
19237
+ function attachContainerLogStreamer(prefix, containerId) {
19238
+ let stopping = false;
19239
+ let current;
19240
+ let stdoutBuf = "";
19241
+ let stderrBuf = "";
19242
+ const maxReattaches = 50;
19243
+ let reattachCount = 0;
19244
+ let pendingRespawn;
19245
+ const spawnOnce = (sinceArg) => {
19246
+ const args = [
19247
+ "logs",
19248
+ "-f",
19249
+ ...sinceArg !== void 0 ? ["--since", sinceArg] : [],
19250
+ containerId
19251
+ ];
19252
+ const proc = spawn(getDockerCmd(), args, { stdio: [
19253
+ "ignore",
19254
+ "pipe",
19255
+ "pipe"
19256
+ ] });
19257
+ current = proc;
19258
+ proc.stdout?.on("data", (chunk) => {
19259
+ stdoutBuf = writePrefixedLines(prefix, stdoutBuf + chunk.toString("utf-8"), process.stdout);
19260
+ });
19261
+ proc.stderr?.on("data", (chunk) => {
19262
+ stderrBuf = writePrefixedLines(prefix, stderrBuf + chunk.toString("utf-8"), process.stderr);
19263
+ });
19264
+ proc.on("error", () => {});
19265
+ proc.on("exit", () => {
19266
+ if (stopping) return;
19267
+ if (reattachCount >= maxReattaches) {
19268
+ process.stderr.write(`${prefix}cdkl: docker logs -f re-attached ${maxReattaches} times; giving up. Run \`docker logs -f ${containerId}\` manually to keep watching.\n`);
19269
+ return;
19270
+ }
19271
+ reattachCount += 1;
19272
+ execFile(getDockerCmd(), [
19273
+ "inspect",
19274
+ "--format",
19275
+ "{{.State.Status}}",
19276
+ containerId
19277
+ ], (err, stdout) => {
19278
+ if (stopping) return;
19279
+ if (!err) {
19280
+ const status = stdout.trim().toLowerCase();
19281
+ if (status === "exited" || status === "dead" || status === "removing") return;
19282
+ }
19283
+ pendingRespawn = setTimeout(() => {
19284
+ pendingRespawn = void 0;
19285
+ if (stopping) return;
19286
+ spawnOnce("0s");
19287
+ }, 200);
19288
+ });
19289
+ });
19290
+ };
19291
+ spawnOnce(void 0);
19292
+ return () => {
19293
+ stopping = true;
19294
+ if (pendingRespawn !== void 0) {
19295
+ clearTimeout(pendingRespawn);
19296
+ pendingRespawn = void 0;
19297
+ }
19298
+ if (stdoutBuf) {
19299
+ process.stdout.write(prefix + stdoutBuf + "\n");
19300
+ stdoutBuf = "";
19301
+ }
19302
+ if (stderrBuf) {
19303
+ process.stderr.write(prefix + stderrBuf + "\n");
19304
+ stderrBuf = "";
19305
+ }
19306
+ if (current && !current.killed) current.kill("SIGTERM");
19307
+ };
19308
+ }
19309
+ /**
19310
+ * Write every complete line in `buffer` to `out`, prefixed with `prefix`.
19311
+ * Returns the trailing partial line (no `\n` yet) so the caller can
19312
+ * accumulate it with the next `data` chunk. Exported for unit tests; the
19313
+ * production callers should use {@link attachContainerLogStreamer}.
19314
+ */
19315
+ function writePrefixedLines(prefix, buffer, out) {
19316
+ const lines = buffer.split("\n");
19317
+ const remainder = lines.pop() ?? "";
19318
+ for (const line of lines) out.write(prefix + line + "\n");
19319
+ return remainder;
19320
+ }
19321
+
19185
19322
  //#endregion
19186
19323
  //#region src/local/ecs-network.ts
19187
19324
  const execFileAsync$3 = promisify(execFile);
@@ -19770,7 +19907,7 @@ async function runEcsTask(task, options, state) {
19770
19907
  id,
19771
19908
  container
19772
19909
  });
19773
- if (!options.detach) state.logStoppers.push(streamContainerLogs(container.name, id));
19910
+ if (!options.detach) state.logStoppers.push(attachContainerLogStreamer(`[${container.name}] `, id));
19774
19911
  }
19775
19912
  if (options.detach) return {
19776
19913
  exitCode: 0,
@@ -19910,42 +20047,6 @@ function sleep$1(ms) {
19910
20047
  return new Promise((res) => setTimeout(res, ms));
19911
20048
  }
19912
20049
  /**
19913
- * Stream `docker logs -f <id>` with `[<container-name>]` prefixes on
19914
- * every line. Returns a stop function for the caller's `finally`.
19915
- */
19916
- function streamContainerLogs(containerName, containerId) {
19917
- const proc = spawn(getDockerCmd(), [
19918
- "logs",
19919
- "-f",
19920
- containerId
19921
- ], { stdio: [
19922
- "ignore",
19923
- "pipe",
19924
- "pipe"
19925
- ] });
19926
- const prefix = `[${containerName}] `;
19927
- let stdoutBuf = "";
19928
- let stderrBuf = "";
19929
- proc.stdout?.on("data", (chunk) => {
19930
- stdoutBuf = writePrefixed(prefix, stdoutBuf + chunk.toString("utf-8"), process.stdout);
19931
- });
19932
- proc.stderr?.on("data", (chunk) => {
19933
- stderrBuf = writePrefixed(prefix, stderrBuf + chunk.toString("utf-8"), process.stderr);
19934
- });
19935
- proc.on("error", () => {});
19936
- return () => {
19937
- if (stdoutBuf) process.stdout.write(prefix + stdoutBuf + "\n");
19938
- if (stderrBuf) process.stderr.write(prefix + stderrBuf + "\n");
19939
- if (!proc.killed) proc.kill("SIGTERM");
19940
- };
19941
- }
19942
- function writePrefixed(prefix, buffer, out) {
19943
- const lines = buffer.split("\n");
19944
- const remainder = lines.pop() ?? "";
19945
- for (const line of lines) out.write(prefix + line + "\n");
19946
- return remainder;
19947
- }
19948
- /**
19949
20050
  * Resolve every container's `Image` to a tag the runner can pass to
19950
20051
  * `docker run`. The map is keyed by container name; entries are
19951
20052
  * populated in parallel up to the asset-manifest bound (single
@@ -20577,6 +20678,7 @@ function extractServiceProperties(stack, serviceLogicalId, resource, stacks, con
20577
20678
  const desiredCount = parseDesiredCount(props["DesiredCount"], serviceLogicalId);
20578
20679
  const healthCheckGracePeriodSeconds = parseHealthCheckGrace(props["HealthCheckGracePeriodSeconds"], serviceLogicalId);
20579
20680
  const serviceName = parseServiceName(props["ServiceName"], serviceLogicalId);
20681
+ const serviceDisplayName = deriveServiceDisplayName(props["ServiceName"], serviceLogicalId, resource.Metadata);
20580
20682
  if (!options?.suppressLoadBalancerWarning && Array.isArray(props["LoadBalancers"]) && props["LoadBalancers"].length > 0) {
20581
20683
  const { cliName } = getEmbedConfig();
20582
20684
  warnings.push(`ECS Service '${serviceLogicalId}' declares LoadBalancers, but \`${cliName} start-service\` runs the replicas only; no local listener fronts them. Reach the containers via their published ports, or run \`${cliName} start-alb <Stack>/<Alb>\` to boot the same replicas behind a local front-door that round-robins the listener rules.`);
@@ -20587,6 +20689,7 @@ function extractServiceProperties(stack, serviceLogicalId, resource, stacks, con
20587
20689
  serviceLogicalId,
20588
20690
  resource,
20589
20691
  serviceName,
20692
+ serviceDisplayName,
20590
20693
  desiredCount,
20591
20694
  healthCheckGracePeriodSeconds,
20592
20695
  task,
@@ -20741,6 +20844,50 @@ function parseServiceName(raw, serviceLogicalId) {
20741
20844
  return serviceLogicalId;
20742
20845
  }
20743
20846
  /**
20847
+ * Issue #227 review fix — derive a CLEAN display name for the per-replica
20848
+ * `[svc=<name> r=<i> c=<container>] ` log prefix. L2 constructs
20849
+ * (`FargateService`, `ApplicationLoadBalancedFargateService`) do NOT set
20850
+ * `ServiceName` explicitly, so the synthesized template's `ServiceName`
20851
+ * is absent and {@link parseServiceName} falls back to the
20852
+ * hash-suffixed logical id (e.g. `BackendApi5F9D8C32`). That ends up in
20853
+ * the foreground prefix as `[svc=BackendApi5F9D8C32 ...]` — noisy +
20854
+ * not what Issue #227's spec example showed.
20855
+ *
20856
+ * Resolution order (display ONLY — does NOT change `service.serviceName`):
20857
+ * 1. The explicit CFn `ServiceName` property, if the user set one.
20858
+ * 2. The last meaningful segment of the resource's `aws:cdk:path`
20859
+ * Metadata. For a typical L2, this is the construct id the user
20860
+ * wrote in CDK source (e.g. `AppStack/BackendApi/Service` →
20861
+ * `BackendApi`). Trailing CDK-internal segments (`/Service`,
20862
+ * `/Resource`, `/Default`) are stripped so the result matches the
20863
+ * construct id the user typed, not the per-resource CFn segment.
20864
+ * 3. The `serviceLogicalId` as today's fallback when neither is
20865
+ * available (synthetic / hand-rolled CFn).
20866
+ *
20867
+ * Pure helper — keep narrowly scoped to the log-prefix use case so
20868
+ * other call sites that rely on `service.serviceName` for awsvpc /
20869
+ * Cloud Map / discovery semantics keep their existing fallback
20870
+ * behavior.
20871
+ */
20872
+ function deriveServiceDisplayName(rawServiceName, serviceLogicalId, metadata) {
20873
+ if (typeof rawServiceName === "string" && rawServiceName.length > 0) return rawServiceName;
20874
+ const cdkPath = typeof metadata?.["aws:cdk:path"] === "string" ? metadata["aws:cdk:path"] : "";
20875
+ if (cdkPath.length > 0) {
20876
+ const segments = cdkPath.split("/");
20877
+ while (segments.length > 1) {
20878
+ const tail = segments[segments.length - 1];
20879
+ if (tail === "Service" || tail === "Resource" || tail === "Default") {
20880
+ segments.pop();
20881
+ continue;
20882
+ }
20883
+ break;
20884
+ }
20885
+ const tail = segments[segments.length - 1];
20886
+ if (typeof tail === "string" && tail.length > 0) return tail;
20887
+ }
20888
+ return serviceLogicalId;
20889
+ }
20890
+ /**
20744
20891
  * Local copy of the same `pickStack` helper used by the task resolver.
20745
20892
  * Kept in-file rather than exported from `ecs-task-resolver.ts` so future
20746
20893
  * service-specific extensions (e.g. cross-stack service-to-task refs)
@@ -21155,6 +21302,10 @@ async function bootReplica(service, options, instance) {
21155
21302
  };
21156
21303
  logger.info(`Booting replica ${instance.index} (${perReplicaCluster})`);
21157
21304
  await runEcsTask(service.task, perReplicaTaskOptions, instance.state);
21305
+ if (options.streamLogs !== false) for (const started of instance.state.startedContainers) {
21306
+ const prefix = `[svc=${service.serviceDisplayName} r=${instance.index} c=${started.name}] `;
21307
+ instance.state.logStoppers.push(attachContainerLogStreamer(prefix, started.id));
21308
+ }
21158
21309
  if (options.discovery) await publishReplicaToCloudMap(service, instance, options.discovery, ownerKeyPrefix);
21159
21310
  if (options.frontDoor) await publishReplicaToFrontDoor(service, instance, options.frontDoor, options.taskOptions.containerHost, ownerKeyPrefix);
21160
21311
  instance.lastDeployedAssetHash = pickEssentialAssetHash(service);
@@ -21955,11 +22106,22 @@ const REBUILD_TRIGGER_BASENAMES = new Set([
21955
22106
  * `mvn package` etc.). A copy of the source alone would leave the
21956
22107
  * running binary stale, so the user's intent must be a rebuild.
21957
22108
  *
21958
- * Interpreted-language runtimes (Node `.js` / `.mjs` / `.cjs` /
21959
- * `.ts` when transpiled at runtime, Python `.py`, Ruby — `.rb`,
21960
- * shell `.sh`) read source at process start, so a `docker cp` +
21961
- * `docker restart` cycle picks them up. Those extensions are
21962
- * NOT in this set.
22109
+ * TypeScript source (`.ts` / `.tsx` / `.mts` / `.cts`) is treated as
22110
+ * compiled because the dominant production-container pattern is to
22111
+ * pre-compile the source via a Dockerfile `RUN tsc` / `RUN yarn build`
22112
+ * step, with the runtime executing the emitted `dist/*.js`. Soft-reload
22113
+ * would `docker cp` the new `.ts` into the container's WORKDIR while
22114
+ * the running process keeps reading the OLD `dist/` — a silent
22115
+ * stale-code failure that violates the file's "slow-but-correct beats
22116
+ * fast-but-stale" default policy (lines 14-22). Setups that transpile
22117
+ * at runtime lose the soft-reload fast path under this default; an
22118
+ * opt-in flag to restore it is a possible follow-up but is not in
22119
+ * scope here.
22120
+ *
22121
+ * Interpreted-language runtimes (Node — `.js` / `.mjs` / `.cjs`,
22122
+ * Python — `.py`, Ruby — `.rb`, shell — `.sh`) read source at process
22123
+ * start, so a `docker cp` + `docker restart` cycle picks them up.
22124
+ * Those extensions are NOT in this set.
21963
22125
  */
21964
22126
  const COMPILED_LANGUAGE_EXTENSIONS = new Set([
21965
22127
  ".go",
@@ -21983,7 +22145,11 @@ const COMPILED_LANGUAGE_EXTENSIONS = new Set([
21983
22145
  ".mli",
21984
22146
  ".elm",
21985
22147
  ".hs",
21986
- ".dart"
22148
+ ".dart",
22149
+ ".ts",
22150
+ ".tsx",
22151
+ ".mts",
22152
+ ".cts"
21987
22153
  ]);
21988
22154
  /**
21989
22155
  * Classify a single watcher firing into rebuild vs soft-reload. Pure
@@ -24524,7 +24690,8 @@ async function resolveServiceAndRunnerOpts(boot, stacks, options, discovery, ski
24524
24690
  restartPolicy: options.restartPolicy,
24525
24691
  taskOptions: taskOpts,
24526
24692
  discovery,
24527
- ...frontDoorPools && frontDoorPools.length > 0 ? { frontDoor: { pools: frontDoorPools } } : {}
24693
+ ...frontDoorPools && frontDoorPools.length > 0 ? { frontDoor: { pools: frontDoorPools } } : {},
24694
+ streamLogs: options.logs !== false
24528
24695
  }
24529
24696
  };
24530
24697
  }
@@ -24977,7 +25144,7 @@ async function resolveSharedSidecarCredentials(options) {
24977
25144
  * factory.
24978
25145
  */
24979
25146
  function addCommonEcsServiceOptions(cmd) {
24980
- cmd.addOption(new Option("--cluster <name>", "Cluster name surfaced to ECS_CONTAINER_METADATA_URI_V4 and used as the docker network prefix").default(getEmbedConfig().resourceNamePrefix)).addOption(new Option("--env-vars <file>", "JSON env-var overrides (SAM-compatible: {\"ContainerName\":{\"KEY\":\"VALUE\"}, \"Parameters\":{}})")).addOption(new Option("--container-host <ip>", "Host IP to bind published container ports to. Must be a numeric IP (Docker rejects hostnames here)").default("127.0.0.1")).addOption(new Option("--assume-task-role [arn]", "Assume the task definition's TaskRoleArn (or the supplied ARN) and forward STS-issued temp credentials via the metadata sidecar so containers run with the deployed task role. Bare flag uses the template's TaskRoleArn; pass an explicit ARN to override.")).addOption(new Option("--no-pull", "Skip docker pull for every container image and the metadata sidecar")).addOption(new Option("--ecr-role-arn <arn>", "Role ARN to assume before authenticating against ECR for cross-account / centralized registries.")).addOption(new Option("--platform <platform>", "Force docker --platform (linux/amd64 or linux/arm64). Default: inferred from task RuntimePlatform.CpuArchitecture")).addOption(new Option("--max-tasks <n>", `Hard cap on local replica count. Caps the template DesiredCount so local dev machines don't run an unbounded number of containers. Cannot exceed ${83} due to the per-replica link-local /24 subnet allocator's range.`).default(3).argParser(parseMaxTasks)).addOption(new Option("--restart-policy <policy>", "How to react when an essential container exits. 'on-failure' (default) restarts only on non-zero exit; 'always' restarts on every exit; 'none' shuts the replica down and runs the service degraded.").default("on-failure").argParser(parseRestartPolicy)).addOption(new Option("--from-cfn-stack [cfn-stack-name]", `Read a deployed CloudFormation stack via ListStackResources and substitute Ref / Fn::ImportValue in container env vars / secrets / image URIs with the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (\`cdk deploy\`). Bare form uses the ${getEmbedConfig().binaryName} stack name; pass an explicit value when the CFn stack name differs. Fn::GetAtt is warn-and-dropped in v1 (CFn ListStackResources does not return per-attribute values).`)).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region."));
25147
+ cmd.addOption(new Option("--cluster <name>", "Cluster name surfaced to ECS_CONTAINER_METADATA_URI_V4 and used as the docker network prefix").default(getEmbedConfig().resourceNamePrefix)).addOption(new Option("--env-vars <file>", "JSON env-var overrides (SAM-compatible: {\"ContainerName\":{\"KEY\":\"VALUE\"}, \"Parameters\":{}})")).addOption(new Option("--container-host <ip>", "Host IP to bind published container ports to. Must be a numeric IP (Docker rejects hostnames here)").default("127.0.0.1")).addOption(new Option("--assume-task-role [arn]", "Assume the task definition's TaskRoleArn (or the supplied ARN) and forward STS-issued temp credentials via the metadata sidecar so containers run with the deployed task role. Bare flag uses the template's TaskRoleArn; pass an explicit ARN to override.")).addOption(new Option("--no-pull", "Skip docker pull for every container image and the metadata sidecar")).addOption(new Option("--ecr-role-arn <arn>", "Role ARN to assume before authenticating against ECR for cross-account / centralized registries.")).addOption(new Option("--platform <platform>", "Force docker --platform (linux/amd64 or linux/arm64). Default: inferred from task RuntimePlatform.CpuArchitecture")).addOption(new Option("--max-tasks <n>", `Hard cap on local replica count. Caps the template DesiredCount so local dev machines don't run an unbounded number of containers. Cannot exceed ${83} due to the per-replica link-local /24 subnet allocator's range.`).default(3).argParser(parseMaxTasks)).addOption(new Option("--restart-policy <policy>", "How to react when an essential container exits. 'on-failure' (default) restarts only on non-zero exit; 'always' restarts on every exit; 'none' shuts the replica down and runs the service degraded.").default("on-failure").argParser(parseRestartPolicy)).addOption(new Option("--from-cfn-stack [cfn-stack-name]", `Read a deployed CloudFormation stack via ListStackResources and substitute Ref / Fn::ImportValue in container env vars / secrets / image URIs with the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (\`cdk deploy\`). Bare form uses the ${getEmbedConfig().binaryName} stack name; pass an explicit value when the CFn stack name differs. Fn::GetAtt is warn-and-dropped in v1 (CFn ListStackResources does not return per-attribute values).`)).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-cfn-stack as the CFn client region.")).addOption(new Option("--no-logs", "Disable foreground streaming of each replica container stdout/stderr. By default every booted replica streams its docker logs to the host terminal with a [svc=<service> r=<replica-index> c=<container>] prefix (parity with `run-task`). Pass --no-logs for multi-replica / multi-service runs whose interleaved log volume is unreadable; `docker logs -f <id>` in a separate terminal stays available."));
24981
25148
  [
24982
25149
  ...commonOptions(),
24983
25150
  ...appOptions(),
@@ -26005,5 +26172,5 @@ function addListSpecificOptions(cmd) {
26005
26172
  }
26006
26173
 
26007
26174
  //#endregion
26008
- export { translateLambdaResponse as $, buildContainerImage as $t, addStartApiSpecificOptions as A, AGENTCORE_A2A_PROTOCOL as An, invokeAgentCoreWs as At, filterRoutesByApiIdentifiers as B, substituteImagePlaceholders as Bn, signAgentCoreInvocation as Bt, classifySourceChange as C, listTargets as Cn, verifyJwtViaDiscovery as Ct, createLocalRunTaskCommand as D, discoverRoutes as Dn, buildCorsConfigFromCloudFrontChain as Dt, addRunTaskSpecificOptions as E, parseSelectionExpressionPath as En, buildCorsConfigByApiId as Et, createFileWatcher as F, AgentCoreResolutionError as Fn, MCP_PATH as Ft, resolveServiceIntegrationParameters as G, SUPPORTED_CODE_RUNTIMES as Gt, readMtlsMaterialsFromDisk as H, LocalInvokeBuildError as Hn, invokeAgentCore as Ht, attachStageContext as I, pickAgentCoreCandidateStack as In, MCP_PROTOCOL_VERSION as It, computeRequestIdentityHash as J, renderCodeDockerfile as Jt, defaultCredentialsLoader as K, buildAgentCoreCodeImage as Kt, buildStageMap as L, resolveAgentCoreTarget as Ln, mcpInvokeOnce as Lt, createWatchPredicates as M, AGENTCORE_HTTP_PROTOCOL as Mn, A2A_PATH as Mt, resolveApiTargetSubset as N, AGENTCORE_MCP_PROTOCOL as Nn, a2aInvokeOnce as Nt, addInvokeAgentCoreSpecificOptions as O, pickRefLogicalId as On, isFunctionUrlOacFronted as Ot, createAuthorizerCache as P, AGENTCORE_RUNTIME_TYPE as Pn, MCP_CONTAINER_PORT as Pt, matchRoute as Q, architectureToPlatform as Qt, availableApiIdentifiers as R, derivePseudoParametersFromRegion as Rn, parseSseForJsonRpc as Rt, CloudMapRegistry as S, countTargets as Sn, verifyJwtAuthorizer as St, getContainerNetworkIp as T, discoverWebSocketApisOrThrow as Tn, applyCorsResponseHeaders as Tt, startApiServer as U, waitForAgentCorePing as Ut, groupRoutesByServer as V, tryResolveImageFnJoin as Vn, AGENTCORE_SESSION_ID_HEADER as Vt, resolveSelectionExpression as W, downloadAndExtractS3Bundle as Wt, invokeRequestAuthorizer as X, addInvokeSpecificOptions as Xt, evaluateCachedLambdaPolicy as Y, toCmdArgv as Yt, invokeTokenAuthorizer as Z, createLocalInvokeCommand as Zt, parseMaxTasks as _, CfnLocalStateProvider as _n, buildMessageEvent as _t, albStrategy as a, substituteAgainstStateAsync as an, selectIntegrationResponse as at, runEcsServiceEmulator as b, resolveWatchConfig as bn, createJwksCache as bt, resolveAlbTarget as c, resolveEnvVars as cn, HOST_GATEWAY_MIN_VERSION as ct, addStartServiceSpecificOptions as d, createLocalStateProvider as dn, ConnectionRegistry as dt, resolveRuntimeCodeMountPath as en, applyAuthorizerOverlay as et, createLocalStartServiceCommand as f, isCfnFlagPresent as fn, buildMgmtEndpointEnvUrl as ft, buildEcsImageResolutionContext as g, resolveCfnStackName as gn, buildDisconnectEvent as gt, addCommonEcsServiceOptions as h, resolveCfnRegion as hn, buildConnectEvent as ht, addAlbSpecificOptions as i, substituteAgainstState as in, pickResponseTemplate as it, createLocalStartApiCommand as j, AGENTCORE_AGUI_PROTOCOL as jn, A2A_CONTAINER_PORT as jt, createLocalInvokeAgentCoreCommand as k, resolveLambdaArnIntrinsic as kn, matchPreflight as kt, isApplicationLoadBalancer as l, materializeLayerFromArn as ln, probeHostGatewaySupport as lt, MAX_TASKS_SUBNET_RANGE_CAP as m, resolveCfnFallbackRegion as mn, parseConnectionsPath as mt, createLocalListCommand as n, resolveRuntimeImage as nn, buildRestV1Event as nt, createLocalStartAlbCommand as o, substituteEnvVarsFromState as on, tryParseStatus as ot, serviceStrategy as p, rejectExplicitCfnStackWithMultipleStacks as pn, handleConnectionsRequest as pt, buildMethodArn as q, computeCodeImageTag as qt, formatTargetListing as r, EcsTaskResolutionError as rn, evaluateResponseParameters as rt, parseLbPortOverrides as s, substituteEnvVarsFromStateAsync as sn, VtlEvaluationError as st, addListSpecificOptions as t, resolveRuntimeFileExtension as tn, buildHttpApiV2Event as tt, resolveAlbFrontDoor as u, LocalStateSourceError as un, bufferToBody as ut, parseRestartPolicy as v, collectSsmParameterRefs as vn, buildCognitoJwksUrl as vt, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as w, discoverWebSocketApis as wn, attachAuthorizers as wt, buildCloudMapIndex as x, resolveSingleTarget as xn, verifyCognitoJwt as xt, resolveSharedSidecarCredentials as y, resolveSsmParameters as yn, buildJwksUrlFromIssuer as yt, filterRoutesByApiIdentifier as z, formatStateRemedy as zn, AGENTCORE_SIGV4_SERVICE as zt };
26009
- //# sourceMappingURL=local-list-C-wXKogn.js.map
26175
+ export { matchRoute as $, architectureToPlatform as $t, createLocalInvokeAgentCoreCommand as A, resolveLambdaArnIntrinsic as An, matchPreflight as At, filterRoutesByApiIdentifier as B, formatStateRemedy as Bn, AGENTCORE_SIGV4_SERVICE as Bt, classifySourceChange as C, countTargets as Cn, verifyJwtAuthorizer as Ct, createLocalRunTaskCommand as D, parseSelectionExpressionPath as Dn, buildCorsConfigByApiId as Dt, addRunTaskSpecificOptions as E, discoverWebSocketApisOrThrow as En, applyCorsResponseHeaders as Et, createAuthorizerCache as F, AGENTCORE_RUNTIME_TYPE as Fn, MCP_CONTAINER_PORT as Ft, resolveSelectionExpression as G, downloadAndExtractS3Bundle as Gt, groupRoutesByServer as H, tryResolveImageFnJoin as Hn, AGENTCORE_SESSION_ID_HEADER as Ht, createFileWatcher as I, AgentCoreResolutionError as In, MCP_PATH as It, buildMethodArn as J, computeCodeImageTag as Jt, resolveServiceIntegrationParameters as K, SUPPORTED_CODE_RUNTIMES as Kt, attachStageContext as L, pickAgentCoreCandidateStack as Ln, MCP_PROTOCOL_VERSION as Lt, createLocalStartApiCommand as M, AGENTCORE_AGUI_PROTOCOL as Mn, A2A_CONTAINER_PORT as Mt, createWatchPredicates as N, AGENTCORE_HTTP_PROTOCOL as Nn, A2A_PATH as Nt, attachContainerLogStreamer as O, discoverRoutes as On, buildCorsConfigFromCloudFrontChain as Ot, resolveApiTargetSubset as P, AGENTCORE_MCP_PROTOCOL as Pn, a2aInvokeOnce as Pt, invokeTokenAuthorizer as Q, createLocalInvokeCommand as Qt, buildStageMap as R, resolveAgentCoreTarget as Rn, mcpInvokeOnce as Rt, CloudMapRegistry as S, resolveSingleTarget as Sn, verifyCognitoJwt as St, getContainerNetworkIp as T, discoverWebSocketApis as Tn, attachAuthorizers as Tt, readMtlsMaterialsFromDisk as U, LocalInvokeBuildError as Un, invokeAgentCore as Ut, filterRoutesByApiIdentifiers as V, substituteImagePlaceholders as Vn, signAgentCoreInvocation as Vt, startApiServer as W, waitForAgentCorePing as Wt, evaluateCachedLambdaPolicy as X, toCmdArgv as Xt, computeRequestIdentityHash as Y, renderCodeDockerfile as Yt, invokeRequestAuthorizer as Z, addInvokeSpecificOptions as Zt, parseMaxTasks as _, resolveCfnStackName as _n, buildDisconnectEvent as _t, albStrategy as a, substituteAgainstState as an, pickResponseTemplate as at, runEcsServiceEmulator as b, resolveSsmParameters as bn, buildJwksUrlFromIssuer as bt, resolveAlbTarget as c, substituteEnvVarsFromStateAsync as cn, VtlEvaluationError as ct, addStartServiceSpecificOptions as d, LocalStateSourceError as dn, bufferToBody as dt, buildContainerImage as en, translateLambdaResponse as et, createLocalStartServiceCommand as f, createLocalStateProvider as fn, ConnectionRegistry as ft, buildEcsImageResolutionContext as g, resolveCfnRegion as gn, buildConnectEvent as gt, addCommonEcsServiceOptions as h, resolveCfnFallbackRegion as hn, parseConnectionsPath as ht, addAlbSpecificOptions as i, EcsTaskResolutionError as in, evaluateResponseParameters as it, addStartApiSpecificOptions as j, AGENTCORE_A2A_PROTOCOL as jn, invokeAgentCoreWs as jt, addInvokeAgentCoreSpecificOptions as k, pickRefLogicalId as kn, isFunctionUrlOacFronted as kt, isApplicationLoadBalancer as l, resolveEnvVars as ln, HOST_GATEWAY_MIN_VERSION as lt, MAX_TASKS_SUBNET_RANGE_CAP as m, rejectExplicitCfnStackWithMultipleStacks as mn, handleConnectionsRequest as mt, createLocalListCommand as n, resolveRuntimeFileExtension as nn, buildHttpApiV2Event as nt, createLocalStartAlbCommand as o, substituteAgainstStateAsync as on, selectIntegrationResponse as ot, serviceStrategy as p, isCfnFlagPresent as pn, buildMgmtEndpointEnvUrl as pt, defaultCredentialsLoader as q, buildAgentCoreCodeImage as qt, formatTargetListing as r, resolveRuntimeImage as rn, buildRestV1Event as rt, parseLbPortOverrides as s, substituteEnvVarsFromState as sn, tryParseStatus as st, addListSpecificOptions as t, resolveRuntimeCodeMountPath as tn, applyAuthorizerOverlay as tt, resolveAlbFrontDoor as u, materializeLayerFromArn as un, probeHostGatewaySupport as ut, parseRestartPolicy as v, CfnLocalStateProvider as vn, buildMessageEvent as vt, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as w, listTargets as wn, verifyJwtViaDiscovery as wt, buildCloudMapIndex as x, resolveWatchConfig as xn, createJwksCache as xt, resolveSharedSidecarCredentials as y, collectSsmParameterRefs as yn, buildCognitoJwksUrl as yt, availableApiIdentifiers as z, derivePseudoParametersFromRegion as zn, parseSseForJsonRpc as zt };
26176
+ //# sourceMappingURL=local-list-EOmrWeTr.js.map