cdk-local 0.54.0 → 0.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -69,7 +69,7 @@ Full flags, precedence, and `--from-cfn-stack` resolution: [docs/cli-reference.m
69
69
 
70
70
  ### start-service vs start-alb — which one?
71
71
 
72
- `start-service` runs just the ECS service's replicas (workers, queue consumers, Service-Connect-only). `start-alb` boots the ECS service(s) behind an ALB **plus** a host-side front-door on each listener port, so external traffic reaches them the way it does in the cloud. Full resolution model: [docs/cli-reference.md](docs/cli-reference.md#cdkl-start-alb-run-an-alb-fronted-service-locally).
72
+ `start-service` runs just the ECS service's replicas (workers, queue consumers, Service-Connect-only). `start-alb` boots the ECS service(s) behind an ALB **plus** a host-side front-door on each listener port — HTTP and HTTPS (TLS terminated locally with `--tls-cert` / `--tls-key` or an auto-generated self-signed cert) — so external traffic reaches them the way it does in the cloud. Full resolution model: [docs/cli-reference.md](docs/cli-reference.md#cdkl-start-alb-run-an-alb-fronted-service-locally).
73
73
 
74
74
  ## Supported resources
75
75
 
@@ -80,7 +80,7 @@ Full flags, precedence, and `--from-cfn-stack` resolution: [docs/cli-reference.m
80
80
  | ECS task definitions | `run-task` |
81
81
  | ECS services | `start-service` |
82
82
  | Cloud Map / Service Connect registry | service discovery between local replicas |
83
- | ALB-fronted ECS / Lambda services | `start-alb` — all six listener-rule conditions, weighted forwards, redirect / fixed-response, mixed ECS + Lambda targets |
83
+ | ALB-fronted ECS / Lambda services | `start-alb` — HTTP / HTTPS listeners, all six listener-rule conditions, weighted forwards, redirect / fixed-response, mixed ECS + Lambda targets |
84
84
  | Bedrock AgentCore Runtime agents | `invoke-agentcore` — container + `fromCodeAsset` / `fromS3` artifacts, HTTP + MCP |
85
85
 
86
86
  Lambda runs on every current AWS Lambda runtime — Node.js (18/20/22/24), Python (3.11–3.14), Ruby (3.2/3.3), Java (8.al2/11/17/21), .NET (6/8), and the OS-only `provided.al2` / `provided.al2023`. The retired `go1.x` runtime is rejected with a pointer to migrate to `provided.al2023`.
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { a as createLocalStartApiCommand } from "./cloud-map-resolver-CbSdXQjx.js";
3
- import { a as createLocalRunTaskCommand, i as createLocalStartServiceCommand, o as createLocalInvokeAgentCoreCommand, r as createLocalStartAlbCommand, s as createLocalInvokeCommand, t as createLocalListCommand } from "./local-list-e7cz-0OZ.js";
2
+ import { a as createLocalStartApiCommand } from "./cloud-map-resolver-BGl1bgxF.js";
3
+ import { a as createLocalRunTaskCommand, i as createLocalStartServiceCommand, o as createLocalInvokeAgentCoreCommand, r as createLocalStartAlbCommand, s as createLocalInvokeCommand, t as createLocalListCommand } from "./local-list-6ZNQh_PK.js";
4
4
  import { Command } from "commander";
5
5
 
6
6
  //#region src/cli/index.ts
7
7
  const program = new Command();
8
- program.name("cdkl").description("Run AWS CDK stacks locally with Docker.").version("0.54.0");
8
+ program.name("cdkl").description("Run AWS CDK stacks locally with Docker.").version("0.56.0");
9
9
  program.addCommand(createLocalInvokeCommand());
10
10
  program.addCommand(createLocalInvokeAgentCoreCommand());
11
11
  program.addCommand(createLocalStartApiCommand());
@@ -8344,13 +8344,16 @@ function isTransientNetworkError(err) {
8344
8344
  * endpoint (bidirectional streaming, on the same 8080 container as
8345
8345
  * `POST /invocations` + `GET /ping`).
8346
8346
  *
8347
- * v1 is a one-shot send-and-stream transparent pipe: connect to
8348
- * `ws://host:8080/ws`, send the `--event` as the first frame, then stream every
8349
- * received frame to the sink until the server closes the connection. The wire
8350
- * framing over `/ws` is agent-defined (AWS pipes bytes transparently), so this
8351
- * mirrors that it does not interpret the frames. The AgentCore session id is
8352
- * sent on the upgrade as {@link AGENTCORE_SESSION_ID_HEADER}, the way the cloud
8353
- * front door does. An interactive stdin<->ws loop is a follow-up.
8347
+ * Connect to `ws://host:8080/ws`, send the `--event` as the first frame, and
8348
+ * stream every received frame to the sink. When a {@link
8349
+ * InvokeAgentCoreWsOptions.frameSource} is supplied (the `--ws-interactive`
8350
+ * REPL path), additional frames from that async iterable are sent after the
8351
+ * initial event, and the client closes the stream when the iterable is
8352
+ * exhausted (or when the server closes first whichever happens first). The
8353
+ * wire framing over `/ws` is agent-defined (AWS pipes bytes transparently),
8354
+ * so this mirrors that — it does not interpret the frames. The AgentCore
8355
+ * session id is sent on the upgrade as {@link AGENTCORE_SESSION_ID_HEADER},
8356
+ * the way the cloud front door does.
8354
8357
  */
8355
8358
  const WS_PATH = "/ws";
8356
8359
  /**
@@ -8377,14 +8380,43 @@ async function invokeAgentCoreWs(host, port, event, options) {
8377
8380
  };
8378
8381
  const timer = setTimeout(() => {
8379
8382
  finish(() => {
8383
+ stopIterator();
8380
8384
  try {
8381
8385
  ws.terminate();
8382
8386
  } catch {}
8383
8387
  reject(/* @__PURE__ */ new Error(`AgentCore /ws at ${url} timed out after ${options.timeoutMs}ms. The agent may be hung or may not close the stream; check container logs.`));
8384
8388
  });
8385
8389
  }, options.timeoutMs);
8390
+ let iterator;
8391
+ const stopIterator = () => {
8392
+ if (iterator?.return) try {
8393
+ iterator.return();
8394
+ } catch {}
8395
+ iterator = void 0;
8396
+ };
8386
8397
  ws.on("open", () => {
8387
8398
  ws.send(body);
8399
+ if (!options.frameSource) return;
8400
+ (async () => {
8401
+ try {
8402
+ iterator = options.frameSource[Symbol.asyncIterator]();
8403
+ while (!settled) {
8404
+ const next = await iterator.next();
8405
+ if (settled || next.done) break;
8406
+ await new Promise((res, rej) => {
8407
+ ws.send(next.value, (err) => err ? rej(err) : res());
8408
+ });
8409
+ }
8410
+ if (!settled) ws.close();
8411
+ } catch (err) {
8412
+ finish(() => {
8413
+ try {
8414
+ ws.terminate();
8415
+ } catch {}
8416
+ reject(err instanceof Error ? err : new Error(String(err)));
8417
+ });
8418
+ }
8419
+ })();
8388
8420
  });
8389
8421
  ws.on("message", (data) => {
8390
8422
  frames += 1;
@@ -8392,10 +8424,16 @@ async function invokeAgentCoreWs(host, port, event, options) {
8392
8424
  options.onMessage(buf.toString("utf-8"));
8393
8425
  });
8394
8426
  ws.on("close", () => {
8395
- finish(() => resolve({ frames }));
8427
+ finish(() => {
8428
+ stopIterator();
8429
+ resolve({ frames });
8430
+ });
8396
8431
  });
8397
8432
  ws.on("error", (err) => {
8398
- finish(() => reject(err));
8433
+ finish(() => {
8434
+ stopIterator();
8435
+ reject(err);
8436
+ });
8399
8437
  });
8400
8438
  });
8401
8439
  }
@@ -17790,4 +17828,4 @@ function extractDnsRecords(serviceProps) {
17790
17828
 
17791
17829
  //#endregion
17792
17830
  export { attachAuthorizers as $, parseContextOptions as $n, resolveEcsTaskTarget as $t, buildHttpApiV2Event as A, AGENTCORE_HTTP_PROTOCOL as An, parseEcrUri as At, ConnectionRegistry as B, matchStacks as Bn, removeContainer as Bt, computeRequestIdentityHash as C, listTargets as Cn, singleFlight as Ct, matchRoute as D, discoverRoutes as Dn, waitForRieReady as Dt, invokeTokenAuthorizer as E, parseSelectionExpressionPath as En, invokeRie as Et, tryParseStatus as F, resolveAgentCoreTarget as Fn, appendEnvFlags as Ft, buildDisconnectEvent as G, LocalInvokeBuildError as Gn, resolveRuntimeImage as Gt, handleConnectionsRequest as H, readCdkPathOrUndefined as Hn, streamLogs as Ht, VtlEvaluationError as I, resolveLambdaTarget as In, ensureDockerAvailable as It, buildJwksUrlFromIssuer as J, applyRoleArnIfSet as Jn, applyCrossStackResolverToTask as Jt, buildMessageEvent as K, LocalStartServiceError as Kn, EcsTaskResolutionError as Kt, HOST_GATEWAY_MIN_VERSION as L, derivePseudoParametersFromRegion as Ln, execEnvForSecrets as Lt, evaluateResponseParameters as M, AGENTCORE_RUNTIME_TYPE as Mn, buildDockerImage as Mt, pickResponseTemplate as N, AgentCoreResolutionError as Nn, DockerRunnerError as Nt, translateLambdaResponse as O, pickRefLogicalId as On, architectureToPlatform as Ot, selectIntegrationResponse as P, pickAgentCoreCandidateStack as Pn, SENSITIVE_ENV_KEYS as Pt, verifyJwtViaDiscovery as Q, deprecatedRegionOption as Qn, parseEcsTarget as Qt, probeHostGatewaySupport as R, substituteImagePlaceholders as Rn, pickFreePort as Rt, buildMethodArn as S, countTargets as Sn, writeProfileCredentialsFile as St, invokeRequestAuthorizer as T, discoverWebSocketApisOrThrow as Tn, getDockerImageBySourceHash as Tt, parseConnectionsPath as U, resolveCdkPathToLogicalIds as Un, resolveRuntimeCodeMountPath as Ut, buildMgmtEndpointEnvUrl as V, buildCdkPathIndex as Vn, runDetached as Vt, buildConnectEvent as W, CdkLocalError as Wn, resolveRuntimeFileExtension as Wt, verifyCognitoJwt as X, commonOptions as Xn, derivePartitionAndUrlSuffix as Xt, createJwksCache as Y, appOptions as Yn, checkVolumeHostPath as Yt, verifyJwtAuthorizer as Z, contextOptions as Zn, detectEcsImageResolutionNeeds as Zt, readMtlsMaterialsFromDisk as _, resolveApp as _n, SUPPORTED_CODE_RUNTIMES as _t, createLocalStartApiCommand as a, resolveEnvVars as an, invokeAgentCoreWs as at, resolveServiceIntegrationParameters as b, resolveMultiTarget as bn, renderCodeDockerfile as bt, resolveProfileCredentials as c, createLocalStateProvider as cn, MCP_PROTOCOL_VERSION as ct, attachStageContext as d, resolveCfnFallbackRegion as dn, AGENTCORE_SIGV4_SERVICE as dt, applyDeployedEnvFallback as en, warnIfDeprecatedRegion as er, applyCorsResponseHeaders as et, buildStageMap as f, resolveCfnRegion as fn, signAgentCoreInvocation as ft, groupRoutesByServer as g, resolveSsmParameters as gn, downloadAndExtractS3Bundle as gt, filterRoutesByApiIdentifiers as h, collectSsmParameterRefs as hn, waitForAgentCorePing as ht, getPublishedHostPort as i, substituteEnvVarsFromStateAsync as in, matchPreflight as it, buildRestV1Event as j, AGENTCORE_MCP_PROTOCOL as jn, pullEcrImage as jt, applyAuthorizerOverlay as k, resolveLambdaArnIntrinsic as kn, buildContainerImage as kt, createAuthorizerCache as l, isCfnFlagPresent as ln, mcpInvokeOnce as lt, filterRoutesByApiIdentifier as m, CfnLocalStateProvider as mn, invokeAgentCore as mt, CloudMapRegistry as n, substituteAgainstStateAsync as nn, buildCorsConfigFromCloudFrontChain as nt, createWatchPredicates as o, materializeLayerFromArn as on, MCP_CONTAINER_PORT as ot, availableApiIdentifiers as p, resolveCfnStackName as pn, AGENTCORE_SESSION_ID_HEADER as pt, buildCognitoJwksUrl as q, withErrorHandling as qn, TASK_ROLE_ACCOUNT_PLACEHOLDER as qt, getContainerNetworkIp as r, substituteEnvVarsFromState as rn, isFunctionUrlOacFronted as rt, resolveApiTargetSubset as s, LocalStateSourceError as sn, MCP_PATH as st, buildCloudMapIndex as t, substituteAgainstState as tn, buildCorsConfigByApiId as tt, createFileWatcher as u, rejectExplicitCfnStackWithMultipleStacks as un, parseSseForJsonRpc as ut, startApiServer as v, resolveWatchConfig as vn, buildAgentCoreCodeImage as vt, evaluateCachedLambdaPolicy as w, discoverWebSocketApis as wn, AssetManifestLoader as wt, defaultCredentialsLoader as x, resolveSingleTarget as xn, toCmdArgv as xt, resolveSelectionExpression as y, Synthesizer as yn, computeCodeImageTag as yt, bufferToBody as z, tryResolveImageFnJoin as zn, pullImage as zt };
17793
- //# sourceMappingURL=cloud-map-resolver-CbSdXQjx.js.map
17831
+ //# sourceMappingURL=cloud-map-resolver-BGl1bgxF.js.map