cdk-local 0.113.0 → 0.115.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/dist/cli.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +2 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -2
- package/dist/{local-studio-BXe9E0Q0.d.ts → local-studio-A0ZCH8Nu.d.ts} +3 -2
- package/dist/{local-studio-BXe9E0Q0.d.ts.map → local-studio-A0ZCH8Nu.d.ts.map} +1 -1
- package/dist/{local-studio-DqmMvzg4.js → local-studio-D7WseIyh.js} +99 -14
- package/dist/{local-studio-DqmMvzg4.js.map → local-studio-D7WseIyh.js.map} +1 -1
- package/package.json +1 -1
|
@@ -30882,11 +30882,13 @@ const STUDIO_SCRIPT = `
|
|
|
30882
30882
|
ws.appendChild(head);
|
|
30883
30883
|
|
|
30884
30884
|
if (!running && !starting && !failed) {
|
|
30885
|
-
// A pinned ECS service (deployed-registry image) does
|
|
30886
|
-
// source edits — offer an image-override Dockerfile
|
|
30887
|
-
// rebuilt locally (issue #301
|
|
30888
|
-
//
|
|
30889
|
-
|
|
30885
|
+
// A pinned ECS service / task definition (deployed-registry image) does
|
|
30886
|
+
// not pick up local source edits — offer an image-override Dockerfile
|
|
30887
|
+
// picker so it can be rebuilt locally (issue #301 for ecs, #388 for
|
|
30888
|
+
// ecs-task). The ecs composer threads --image-override to start-service;
|
|
30889
|
+
// the ecs-task composer threads it to run-task. Local-asset targets
|
|
30890
|
+
// rebuild locally already and get no picker.
|
|
30891
|
+
if (meta && (meta.kind === 'ecs' || meta.kind === 'ecs-task') && meta.pinned) {
|
|
30890
30892
|
const io = buildImageOverridePicker();
|
|
30891
30893
|
ws.appendChild(io.node);
|
|
30892
30894
|
collectImageOverride = io.collect;
|
|
@@ -32103,6 +32105,33 @@ function annotatePinnedEcsTargets(groups, classify) {
|
|
|
32103
32105
|
return anyPinned;
|
|
32104
32106
|
}
|
|
32105
32107
|
/**
|
|
32108
|
+
* Annotate the `ecs-task` task-definition entries of `groups` with
|
|
32109
|
+
* `pinned: true` when `classify(targetId)` returns true (issue #388). The
|
|
32110
|
+
* counterpart of {@link annotatePinnedEcsTargets} for the `ecs-task` kind: a
|
|
32111
|
+
* task definition whose representative container image is a deployed-registry
|
|
32112
|
+
* pin gets the same image-override Dockerfile picker (the `ecs-task` composer
|
|
32113
|
+
* spawns `cdkl run-task`, which now accepts `--image-override`). `classify`
|
|
32114
|
+
* decides pinned vs local CDK asset for one task-def id (studio's boot resolves
|
|
32115
|
+
* the task via `resolveEcsTaskTarget` and checks the representative container's
|
|
32116
|
+
* image kind). Unlike the `ecs` group there is no `servable` gate — every
|
|
32117
|
+
* task-def entry is run via run-task. Mutates the entries in place and returns
|
|
32118
|
+
* whether ANY task definition was pinned, so the caller can include the
|
|
32119
|
+
* Dockerfile scan even when no standalone `ecs` service was pinned. Non-ecs-task
|
|
32120
|
+
* groups are left untouched. Exported so a host CLI can reuse it + so the boot
|
|
32121
|
+
* logic is unit-testable without a real synth.
|
|
32122
|
+
*/
|
|
32123
|
+
function annotateEcsTaskPinnedTargets(groups, classify) {
|
|
32124
|
+
let anyPinned = false;
|
|
32125
|
+
for (const group of groups) {
|
|
32126
|
+
if (group.kind !== "ecs-task") continue;
|
|
32127
|
+
for (const entry of group.entries) if (classify(entry.id)) {
|
|
32128
|
+
entry.pinned = true;
|
|
32129
|
+
anyPinned = true;
|
|
32130
|
+
}
|
|
32131
|
+
}
|
|
32132
|
+
return anyPinned;
|
|
32133
|
+
}
|
|
32134
|
+
/**
|
|
32106
32135
|
* Annotate each `alb` entry of `groups` with the deployed-registry-pinned ECS
|
|
32107
32136
|
* services that ALB fronts (issue #384), so the alb composer can offer a
|
|
32108
32137
|
* per-service image-override Dockerfile picker. `resolveBackingPinned` maps one
|
|
@@ -33156,6 +33185,21 @@ const SERVE_SPECS = {
|
|
|
33156
33185
|
}
|
|
33157
33186
|
};
|
|
33158
33187
|
/**
|
|
33188
|
+
* Parse an auto-published replica host endpoint from an `ecs` serve child's
|
|
33189
|
+
* stdout (issue #392). `start-service` publishes each replica's declared
|
|
33190
|
+
* container port on the host — auto-remapping a privileged port (< 1024) to a
|
|
33191
|
+
* free high port (issue #357) — and logs a line like
|
|
33192
|
+
* `... container port 80 published on 127.0.0.1:54321. Reach it at ...`. studio
|
|
33193
|
+
* surfaces the FIRST such endpoint as the serve's `hostUrl` so the in-workspace
|
|
33194
|
+
* request composer can target it even when the user passed no explicit
|
|
33195
|
+
* `--host-port`. Returns `http://<ip>:<port>` or `undefined` when the line does
|
|
33196
|
+
* not carry a published endpoint. Exported for unit testing.
|
|
33197
|
+
*/
|
|
33198
|
+
function parsePublishedHostEndpoint(line) {
|
|
33199
|
+
const m = /published on (\d{1,3}(?:\.\d{1,3}){3}:\d+)/.exec(line);
|
|
33200
|
+
return m ? `http://${m[1]}` : void 0;
|
|
33201
|
+
}
|
|
33202
|
+
/**
|
|
33159
33203
|
* Build the studio serve manager. Slice C1 drives a long-running
|
|
33160
33204
|
* `cdkl start-api <target>` child — studio is a control plane over the
|
|
33161
33205
|
* CLI (the same pattern as the single-shot invoke dispatcher), so it
|
|
@@ -33343,6 +33387,13 @@ function createStudioServeManager(config) {
|
|
|
33343
33387
|
streamLines(child.stdout, (line) => {
|
|
33344
33388
|
const m = spec.readyRe.exec(line);
|
|
33345
33389
|
if (m) onReady(m[1]);
|
|
33390
|
+
if (req.kind === "ecs" && entry.hostUrl === void 0) {
|
|
33391
|
+
const endpoint = parsePublishedHostEndpoint(line);
|
|
33392
|
+
if (endpoint) {
|
|
33393
|
+
entry.hostUrl = endpoint;
|
|
33394
|
+
if (entry.status === "running") emitServe(entry);
|
|
33395
|
+
}
|
|
33396
|
+
}
|
|
33346
33397
|
emitLog(config.bus, clock, req.targetId, line, "stdout");
|
|
33347
33398
|
});
|
|
33348
33399
|
streamLines(child.stderr, (line) => {
|
|
@@ -33811,6 +33862,33 @@ function makePinClassifier(args) {
|
|
|
33811
33862
|
};
|
|
33812
33863
|
}
|
|
33813
33864
|
/**
|
|
33865
|
+
* Build the boot-time pin classifier {@link annotateEcsTaskPinnedTargets} calls
|
|
33866
|
+
* per `ecs-task` task definition (issue #388) — the counterpart of
|
|
33867
|
+
* {@link makePinClassifier} for task defs. Resolves the task via
|
|
33868
|
+
* {@link resolveEcsTaskTarget} (threading the owning stack's
|
|
33869
|
+
* {@link EcsImageResolutionContext} so an INTRINSIC-ECR image resolves under
|
|
33870
|
+
* `--from-cfn-stack`, same as the service path) and classifies its
|
|
33871
|
+
* representative container (first essential, else first) as a deployed-registry
|
|
33872
|
+
* pin when the image kind is not `cdk-asset`. A task def that cannot be
|
|
33873
|
+
* classified is WARN-logged (not silently swallowed) and left unmarked.
|
|
33874
|
+
*
|
|
33875
|
+
* Returns a `(id) => boolean` callback (true = pinned). Exported for testing.
|
|
33876
|
+
*/
|
|
33877
|
+
function makeTaskPinClassifier(args) {
|
|
33878
|
+
const { stacks, contextByStack, logger } = args;
|
|
33879
|
+
return (id) => {
|
|
33880
|
+
try {
|
|
33881
|
+
const stack = resolveEcsServiceStack(id, stacks);
|
|
33882
|
+
const task = resolveEcsTaskTarget(id, stacks, stack ? contextByStack.get(stack.stackName) : void 0);
|
|
33883
|
+
const representative = task.containers.find((c) => c.essential) ?? task.containers[0];
|
|
33884
|
+
return representative !== void 0 && representative.image.kind !== "cdk-asset";
|
|
33885
|
+
} catch (err) {
|
|
33886
|
+
logger.warn(`studio: could not classify image-pin status for ECS task definition '${id}'; leaving it unmarked (the image-override picker will not be offered). ${err instanceof Error ? err.message : String(err)}`);
|
|
33887
|
+
return false;
|
|
33888
|
+
}
|
|
33889
|
+
};
|
|
33890
|
+
}
|
|
33891
|
+
/**
|
|
33814
33892
|
* Build the boot-time resolver `annotateAlbPinnedBackingServices` calls per
|
|
33815
33893
|
* `alb` entry (issue #384). It resolves the ALB to its backing ECS services
|
|
33816
33894
|
* (`resolveAlbFrontDoor`, template-only) and returns the subset that is in
|
|
@@ -33876,14 +33954,21 @@ async function classifyStudioTargets(args) {
|
|
|
33876
33954
|
...options,
|
|
33877
33955
|
fromCfnStack
|
|
33878
33956
|
};
|
|
33957
|
+
const taskDefIds = (baseGroups.find((g) => g.kind === "ecs-task")?.entries ?? []).map((e) => e.id);
|
|
33958
|
+
const contextByStack = await prepareEcsImageContexts({
|
|
33959
|
+
serviceIds: [...servableEcs, ...taskDefIds],
|
|
33960
|
+
stacks,
|
|
33961
|
+
options: classifyOptions,
|
|
33962
|
+
logger
|
|
33963
|
+
});
|
|
33879
33964
|
const anyPinned = annotatePinnedEcsTargets(groups, makePinClassifier({
|
|
33880
33965
|
stacks,
|
|
33881
|
-
contextByStack
|
|
33882
|
-
|
|
33883
|
-
|
|
33884
|
-
|
|
33885
|
-
|
|
33886
|
-
|
|
33966
|
+
contextByStack,
|
|
33967
|
+
logger
|
|
33968
|
+
}));
|
|
33969
|
+
const anyTaskPinned = annotateEcsTaskPinnedTargets(groups, makeTaskPinClassifier({
|
|
33970
|
+
stacks,
|
|
33971
|
+
contextByStack,
|
|
33887
33972
|
logger
|
|
33888
33973
|
}));
|
|
33889
33974
|
const pinnedEcsByQualifiedId = /* @__PURE__ */ new Map();
|
|
@@ -33898,7 +33983,7 @@ async function classifyStudioTargets(args) {
|
|
|
33898
33983
|
}));
|
|
33899
33984
|
return {
|
|
33900
33985
|
groups,
|
|
33901
|
-
dockerfiles: anyPinned || anyAlbBackingPinned ? discoverDockerfiles(process.cwd()) : []
|
|
33986
|
+
dockerfiles: anyPinned || anyTaskPinned || anyAlbBackingPinned ? discoverDockerfiles(process.cwd()) : []
|
|
33902
33987
|
};
|
|
33903
33988
|
}
|
|
33904
33989
|
/**
|
|
@@ -34171,5 +34256,5 @@ function addStudioSpecificOptions(cmd) {
|
|
|
34171
34256
|
}
|
|
34172
34257
|
|
|
34173
34258
|
//#endregion
|
|
34174
|
-
export {
|
|
34175
|
-
//# sourceMappingURL=local-studio-
|
|
34259
|
+
export { addRunTaskSpecificOptions as $, buildConnectEvent as $n, createLocalInvokeCommand as $t, resolveCloudFrontTarget as A, attachAuthorizers as An, parseSelectionExpressionPath as Ar, createLocalInvokeAgentCoreCommand as At, compileCloudFrontFunction as B, buildRestV1Event as Bn, AgentCoreResolutionError as Br, AGENTCORE_SIGV4_SERVICE as Bt, addListSpecificOptions as C, verifyJwtAuthorizer as Cn, resolveSingleTarget as Cr, CloudMapRegistry as Ct, addStartCloudFrontSpecificOptions as D, evaluateCachedLambdaPolicy as Dn, discoverWebSocketApis as Dr, getContainerNetworkIp as Dt, LocalStartCloudFrontError as E, computeRequestIdentityHash as En, availableWebSocketApiIdentifiers as Er, setShadowReadyTimeoutMs as Et, CLOUDFRONT_DISTRIBUTION_TYPE as F, matchPreflight as Fn, AGENTCORE_A2A_PROTOCOL as Fr, MCP_CONTAINER_PORT as Ft, createLocalStartAlbCommand as G, VtlEvaluationError as Gn, substituteImagePlaceholders as Gr, downloadAndExtractS3Bundle as Gt, runViewerResponse as H, pickResponseTemplate as Hn, resolveAgentCoreTarget as Hr, AGENTCORE_SESSION_ID_HEADER as Ht, isCloudFrontDistribution as I, matchRoute as In, AGENTCORE_AGUI_PROTOCOL as Ir, MCP_PATH as It, isApplicationLoadBalancer as J, bufferToBody as Jn, buildStsClientConfig as Jr, computeCodeImageTag as Jt, parseLbPortOverrides as K, HOST_GATEWAY_MIN_VERSION as Kn, tryResolveImageFnJoin as Kr, SUPPORTED_CODE_RUNTIMES as Kt, pickFunctionUrlLogicalIdFromOrigin as L, translateLambdaResponse as Ln, AGENTCORE_HTTP_PROTOCOL as Lr, MCP_PROTOCOL_VERSION as Lt, startCloudFrontServer as M, buildCorsConfigByApiId as Mn, discoverRoutes as Mr, A2A_CONTAINER_PORT as Mt, serveFromStaticOrigin as N, buildCorsConfigFromCloudFrontChain as Nn, pickRefLogicalId as Nr, A2A_PATH as Nt, createLocalStartCloudFrontCommand as O, invokeRequestAuthorizer as On, discoverWebSocketApisOrThrow as Or, attachContainerLogStreamer as Ot, serveLambdaUrlOrigin as P, isFunctionUrlOacFronted as Pn, resolveLambdaArnIntrinsic as Pr, a2aInvokeOnce as Pt, serviceStrategy as Q, parseConnectionsPath as Qn, addInvokeSpecificOptions as Qt, pickTargetFunctionLogicalId as R, applyAuthorizerOverlay as Rn, AGENTCORE_MCP_PROTOCOL as Rr, mcpInvokeOnce as Rt, StudioEventBus as S, verifyCognitoJwt as Sn, resolveWatchConfig as Sr, buildCloudMapIndex as St, formatTargetListing as T, buildMethodArn as Tn, listTargets as Tr, SOFT_RELOAD_COMPLETION_LOG_SUFFIX as Tt, addAlbSpecificOptions as U, selectIntegrationResponse as Un, derivePseudoParametersFromRegion as Ur, invokeAgentCore as Ut, runViewerRequest as V, evaluateResponseParameters as Vn, pickAgentCoreCandidateStack as Vr, signAgentCoreInvocation as Vt, albStrategy as W, tryParseStatus as Wn, formatStateRemedy as Wr, waitForAgentCorePing as Wt, addStartServiceSpecificOptions as X, buildMgmtEndpointEnvUrl as Xn, toCmdArgv as Xt, resolveAlbFrontDoor as Y, ConnectionRegistry as Yn, resolveProfileCredentials as Yr, renderCodeDockerfile as Yt, createLocalStartServiceCommand as Z, handleConnectionsRequest as Zn, classifySourceChange as Zt, filterStudioTargetGroups as _, resolveServiceIntegrationParameters as _n, resolveCfnRegion as _r, resolveImageOverrides as _t, createLocalStudioCommand as a, createFileWatcher as an, resolveRuntimeFileExtension as ar, buildEcsImageResolutionContext$1 as at, renderStudioHtml as b, buildJwksUrlFromIssuer as bn, collectSsmParameterRefs as br, isLocalCdkAssetImage as bt, startStudioProxy as c, materializeLayerFromArn as cn, substituteAgainstState as cr, parseRestartPolicy as ct, createStudioDispatcher as d, filterRoutesByApiIdentifier as dn, substituteEnvVarsFromStateAsync as dr, runEcsServiceEmulator as dt, addStartApiSpecificOptions as en, buildDisconnectEvent as er, createLocalRunTaskCommand as et, filterStudioCustomResources as f, filterRoutesByApiIdentifiers as fn, LocalStateSourceError as fr, ImageOverrideError as ft, annotatePinnedEcsTargets as g, resolveSelectionExpression as gn, resolveCfnFallbackRegion as gr, parseImageOverrideFlags as gt, annotateEcsTaskPinnedTargets as h, startApiServer as hn, rejectExplicitCfnStackWithMultipleStacks as hr, mergeForService as ht, coerceStopRequest as i, createAuthorizerCache as in, resolveRuntimeCodeMountPath as ir, addImageOverrideOptions as it, matchBehavior as j, applyCorsResponseHeaders as jn, webSocketApiMatchesIdentifier as jr, invokeAgentCoreWs as jt, parseOriginOverrides as k, invokeTokenAuthorizer as kn, filterWebSocketApisByIdentifiers as kr, addInvokeAgentCoreSpecificOptions as kt, relayServeRequest as l, resolveEnvVars$1 as ln, substituteAgainstStateAsync as lr, resolveEcsAssumeRoleOption as lt, annotateAlbPinnedBackingServices as m, readMtlsMaterialsFromDisk as mn, isCfnFlagPresent as mr, enforceImageOverrideOrphans as mt, coerceRunRequest as n, createWatchPredicates as nn, architectureToPlatform as nr, addCommonEcsServiceOptions as nt, resolveServeBaseUrl as o, attachStageContext as on, resolveRuntimeImage as or, ecsClusterOption as ot, isCustomResourceLambdaTarget as p, groupRoutesByServer as pn, createLocalStateProvider as pr, buildImageOverrideTag as pt, resolveAlbTarget as q, probeHostGatewaySupport as qn, LocalInvokeBuildError as qr, buildAgentCoreCodeImage as qt, coerceServeRequest as r, resolveApiTargetSubset as rn, buildContainerImage as rr, addEcsAssumeRoleOptions as rt, createStudioServeManager as s, buildStageMap as sn, EcsTaskResolutionError as sr, parseMaxTasks as st, addStudioSpecificOptions as t, createLocalStartApiCommand as tn, buildMessageEvent as tr, MAX_TASKS_SUBNET_RANGE_CAP as tt, reinvoke as u, availableApiIdentifiers as un, substituteEnvVarsFromState as ur, resolveSharedSidecarCredentials as ut, startStudioServer as v, defaultCredentialsLoader as vn, resolveCfnStackName as vr, runImageOverrideBuilds as vt, createLocalListCommand as w, verifyJwtViaDiscovery as wn, countTargets as wr, DEFAULT_SHADOW_READY_TIMEOUT_MS as wt, createStudioStore as x, createJwksCache as xn, resolveSsmParameters as xr, listPinnedTargets as xt, toStudioTargetGroups as y, buildCognitoJwksUrl as yn, CfnLocalStateProvider as yr, describePinnedImageUri as yt, resolveCloudFrontDistribution as z, buildHttpApiV2Event as zn, AGENTCORE_RUNTIME_TYPE as zr, parseSseForJsonRpc as zt };
|
|
34260
|
+
//# sourceMappingURL=local-studio-D7WseIyh.js.map
|