@go-to-k/cdkd 0.285.5 → 0.285.6

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.
@@ -1,6 +1,6 @@
1
- import { d as generateResourceName, f as generateResourceNameWithFallback, g as withStackName, m as looksLikeCdkdGeneratedName, n as getLogger, o as getLiveRenderer, p as getCurrentStackName, u as applyDefaultNameForFallback } from "./logger-Dz3Le2Pw.js";
1
+ import { _ as withStackName, d as applyDefaultNameForFallback, f as generateResourceName, h as looksLikeCdkdGeneratedName, m as getCurrentStackName, n as getLogger, p as generateResourceNameWithFallback, r as isStdoutReservedForPayload, s as getLiveRenderer } from "./logger-DyTk5GeO.js";
2
2
  import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
3
- import { t as getCdkdVersion } from "./version-neBHYAq9.js";
3
+ import { t as getCdkdVersion } from "./version-De6foYg3.js";
4
4
  import { AsyncLocalStorage } from "node:async_hooks";
5
5
  import { randomUUID } from "node:crypto";
6
6
  import { CreateBucketCommand, DeleteObjectCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, HeadObjectCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchKey, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutObjectCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -5525,8 +5525,13 @@ var FileAssetPublisher = class {
5525
5525
  * Output handling: stdout/stderr are collected in memory unconditionally so
5526
5526
  * `runDockerStreaming` can return them to the caller for error wrapping.
5527
5527
  * When the logger is at debug level (i.e. the user passed `--verbose`),
5528
- * the chunks are ALSO mirrored to `process.stdout` / `process.stderr` so
5529
- * the user sees live build progress.
5528
+ * the chunks are ALSO mirrored live so the user sees build progress —
5529
+ * stderr always to `process.stderr`, and stdout to `process.stdout` EXCEPT
5530
+ * while a command holds a payload reservation
5531
+ * ({@link isStdoutReservedForPayload}), where it joins the logger on stderr
5532
+ * so a child's diagnostics cannot land in the payload
5533
+ * ([#2410](https://github.com/go-to-k/cdkd/issues/2410)). The same
5534
+ * reservation redirects `spawnForeground`'s inherited fd 1 to fd 2.
5530
5535
  */
5531
5536
  /**
5532
5537
  * Return the docker-compatible CLI binary to invoke. Matches CDK CLI:
@@ -5573,7 +5578,8 @@ async function spawnStreaming(cmd, args, options = {}) {
5573
5578
  const stderrChunks = [];
5574
5579
  child.stdout.on("data", (chunk) => {
5575
5580
  stdoutChunks.push(chunk);
5576
- if (streamLive) process.stdout.write(chunk);
5581
+ if (streamLive) if (isStdoutReservedForPayload()) process.stderr.write(chunk);
5582
+ else process.stdout.write(chunk);
5577
5583
  });
5578
5584
  child.stderr.on("data", (chunk) => {
5579
5585
  stderrChunks.push(chunk);
@@ -5617,25 +5623,42 @@ async function spawnStreaming(cmd, args, options = {}) {
5617
5623
  * exit, so the caller can wrap with its own error class.
5618
5624
  *
5619
5625
  * Differs from {@link runDockerStreaming} in two ways:
5620
- * 1. `stdio: 'inherit'` — output is NOT captured, so terminal control codes
5621
- * (color, progress bar overwrites) flow through unchanged. This is the
5622
- * load-bearing reason for the split: `docker pull`'s progress bars only
5623
- * animate properly when stdout is a real TTY connected to the parent.
5626
+ * 1. The child INHERITS descriptors — output is NOT captured, so terminal
5627
+ * control codes (color, progress bar overwrites) flow through
5628
+ * unchanged. That is the load-bearing reason for the split:
5629
+ * `docker pull`'s progress bars only animate when the child writes to a
5630
+ * real TTY rather than a pipe. Under a payload reservation the child's
5631
+ * fd 1 is redirected to the parent's fd 2 rather than piped, precisely
5632
+ * so it keeps a descriptor and not a pipe — though the animation then
5633
+ * depends on STDERR being a terminal, and degrades to plain lines under
5634
+ * `2> file` (issue
5635
+ * [#2410](https://github.com/go-to-k/cdkd/issues/2410)).
5624
5636
  * 2. No `input` / `streamLive` options — inherit-mode has nothing to
5625
5637
  * capture and nothing to mirror.
5626
5638
  *
5627
- * Used by the `--verbose`-mode `docker pull` plumbing in `docker-runner.ts`
5628
- * and `ecr-puller.ts` (visible layer progress). Non-verbose pulls go through
5629
- * {@link runDockerStreaming} so stderr can be folded into the error message.
5639
+ * Used by the `docker pull` plumbing in `docker-runner.ts` and
5640
+ * `ecr-puller.ts`. Those two callers differ, and the difference matters
5641
+ * enough to state: `docker-runner.ts` reaches this only under `--verbose`,
5642
+ * while `ecr-puller.ts` runs it UNCONDITIONALLY, which is what made the
5643
+ * pre-#2410 stdout leak reachable with no flag at all. Non-verbose pulls in
5644
+ * `docker-runner.ts` go through {@link runDockerStreaming} instead, so
5645
+ * stderr can be folded into the error message.
5630
5646
  */
5631
5647
  async function runDockerForeground(args, options = {}) {
5632
5648
  return spawnForeground(getDockerCmd(), args, options);
5633
5649
  }
5634
5650
  /**
5635
- * Foreground (stdio-inherit) spawn — the inherit-mode counterpart to
5651
+ * Foreground (descriptor-inheriting) spawn — the inherit-mode counterpart to
5636
5652
  * {@link spawnStreaming}. Used by {@link runDockerForeground} for docker-CLI
5637
5653
  * subprocesses.
5638
5654
  *
5655
+ * "inherit" is not unqualified, and THIS is the function that qualifies it:
5656
+ * while a command holds a payload reservation
5657
+ * ({@link isStdoutReservedForPayload}) the child's fd 1 is redirected to the
5658
+ * parent's fd 2, so its output cannot land in the payload
5659
+ * ([#2410](https://github.com/go-to-k/cdkd/issues/2410)). stdin and stderr
5660
+ * are inherited either way. See the inline note at the `spawn` call.
5661
+ *
5639
5662
  * The ENOENT branch crafts a docker-specific install hint ("Install Docker
5640
5663
  * (or set CDK_DOCKER ...)"), so non-docker callers reusing this helper
5641
5664
  * would see a misleading error on missing-binary failures. Keep the binary
@@ -5648,7 +5671,11 @@ async function spawnForeground(cmd, args, options = {}) {
5648
5671
  const child = spawn(cmd, args, {
5649
5672
  cwd: options.cwd,
5650
5673
  env,
5651
- stdio: "inherit"
5674
+ stdio: isStdoutReservedForPayload() ? [
5675
+ "inherit",
5676
+ 2,
5677
+ "inherit"
5678
+ ] : "inherit"
5652
5679
  });
5653
5680
  child.once("error", (err) => {
5654
5681
  if (err.code === "ENOENT") {
@@ -21313,7 +21340,7 @@ var CloudControlProvider = class {
21313
21340
  const indeterminateGuard = await this.confirmDeleteTargetIdentity(logicalId, resourceType, physicalId, context);
21314
21341
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
21315
21342
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
21316
- const { ASGProvider } = await import("./asg-provider-BBSPZtne.js").then((n) => n.n);
21343
+ const { ASGProvider } = await import("./asg-provider-DsyALMVT.js").then((n) => n.n);
21317
21344
  return withIndeterminateGuard(await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context), indeterminateGuard);
21318
21345
  }
21319
21346
  const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
@@ -33258,4 +33285,4 @@ var DeployEngine = class {
33258
33285
 
33259
33286
  //#endregion
33260
33287
  export { DEFAULT_STATE_PREFIX as $, warnDeprecatedNoPrefixCliFlag as $n, maskSecretsInError as $t, bold as A, buildDenyExternalAccessPolicy as An, NestedStackChildDirectDestroyError as Ar, requireConfigObject as At, secretBearingStateKeyWarning as B, getDockerImageBySourceHash as Bn, isCdkdError as Br, DiffCalculator as Bt, unsupportedFinalSnapshotError as C, ensureAssetStorage as Cn, DeployCancelledError as Cr, assertRegionMatch as Ct, isStatefulRecreateTargetSync as D, readBootstrapMarkerBody as Dn, LocalStartServiceError as Dr, readConfigString as Dt, MULTI_REGION_RECREATE_BLOCKED_TYPES as E, parseBootstrapMarker as En, LocalMigrateError as Er, configStringRefusal as Et, yellow as F, getDockerCmd as Fn, StackHasActiveImportsError as Fr, s3BucketDomainName as Ft, clearOnUpdateRemoval as G, resolveApp as Gn, isThrottlingError as Gr, TemplateParser as Gt, getCurrentResourceSecrets as H, synthesisStatusMessage as Hn, withErrorHandling as Hr, describeTypeWithThrottleRetry as Ht, collectDeclaredOutputNames as I, partitionSensitiveEnv as In, StackTerminationProtectionError as Ir, s3BucketDualStackDomainName as It, findSilentDropProperties as J, resolveSkipPrefix as Jn, markRedactedCause as Jr, TEMPLATE_SOURCED_RULES as Jt, ProviderRegistry as K, resolveAutoAssetStorage as Kn, isTransientServerError as Kr, STATE_SOURCED_CROSS_GENERATION_RULES as Kt, collectPublishedOutputNames as L, runDockerForeground as Ln, StateError as Lr, s3BucketRegionalDomainName as Lt, gray as M, buildDockerImage as Mn, ProvisioningError as Mr, classifyReplaySecretRegion as Mt, green as N, dockerSpawnEnvWithSensitive as Nn, ResourceTimeoutError as Nr, producerRegionsFromState as Nt, renderStatefulReason as O, validateAssetBucketName as On, LockError as Or, replayWarn as Ot, red as P, formatDockerLoginError as Pn, ResourceUpdateNotSupportedError as Pr, s3BucketArn as Pt, CUSTOM_RESOURCE_RESPONSE_PREFIX as Q, stateBucketExistenceConfirmed as Qn, isSingleDynamicReferenceToken as Qt, exportAliasCollisionScrubWarning as R, runDockerStreaming as Rn, SynthesisError as Rr, s3BucketWebsiteUrl as Rt, refusesFinalSnapshot as S, assertAssetBucketRegion as Sn, DependencyError as Sr, resolveExplicitPhysicalId as St, extractDeploymentEventError as T, isCrossRegionRedirect as Tn, LocalInvokeBuildError as Tr, configBooleanRefusal as Tt, IAMRoleProvider as U, getDefaultStateBucketName as Un, isMarkedNonRetryable as Ur, withRetry as Ut, stateKeySecretExposure as V, Synthesizer as Vn, normalizeAwsError as Vr, INTRINSIC_KEYS as Vt, collectInlinePolicyNamesManagedBySiblings as W, getLegacyStateBucketName as Wn, isRetryableTransientError as Wr, DagBuilder as Wt, maskDeep as X, resolveStateBucketWithDefaultAndSource as Xn, __exportAll as Xr, dynamicReferenceTokens as Xt, createMaskedRetryLogger as Y, resolveStateBucketWithDefault as Yn, retryClassificationText as Yr, createSecretMasker as Yt, maskerOrIdentity as Z, resolveUseCdkBootstrapAssets as Zn, errorCauseChain as Zt, PRE_DELETE_SNAPSHOT_TYPES as _, rewriteTemplateAssetReferences as _n, setAwsClients as _r, isUnboundTemplateParameter as _t, DeploymentEventsStore as a, S3StateBackend as an, CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION as ar, CloudControlProvider as at, createPreDeleteFinalSnapshot as b, AssetModeResolver as bn, ConfigError as br, WAFv2WebACLProvider as bt, replayFailedOperations as c, importableOutputKeys as cn, canonicalizeRegion as cr, deleteIndeterminateGuards as ct, updatePartialReason as d, AssetPublisher as dn, processStackMessages as dr, isTerminationProtectionPropagationError as dt, maskSecretsInText as en, CFN_TEMPLATE_BODY_LIMIT as er, beginCommandInterruptScope as et, withResourceDeadline as f, stringifyValue as fn, clearBucketRegionCache as fr, IntrinsicFunctionResolver as ft, ATOMIC_FINAL_SNAPSHOT_TYPES as g, loadPublishableAssetManifest as gn, resetAwsClients as gr, getAccountInfo as gt, computeImplicitDeleteEdges as h, createAssetRedirectResolver as hn, getAwsClients as hr, coerceParameterTypedValue as ht, DeploymentEventsReader as i, displaySafe as in, uploadCfnTemplate as ir, startInterruptWatch as it, cyan as j, describeAwsFailure as jn, PartialFailureError as jr, requireConfigString as jt, formatResourceLine as k, validateContainerRepoName as kn, MissingCdkCliError as kr, requireConfigArray as kt, replayRollback as l, importableOutputs as ln, derivePartitionAndUrlSuffix as lr, deleteSkipReason as lt, IMPLICIT_DELETE_DEPENDENCIES as m, buildAssetRedirectMap as mn, AwsClients as mr, cfnRefValueFromPhysicalId as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, scrubResourceRecord as nn, MIGRATE_TMP_PREFIX as nr, interruptWatchListenerCount as nt, planFailedOps as o, rebuildClientForBucketRegion as on, expectedOwnerParam as or, slowCcOperationTimeoutMs as ot, maskingRetryLogger as p, WorkGraph as pn, resolveBucketRegion as pr, carriesDynamicReference as pt, findActionableSilentDrops as q, resolveCaptureObservedState as qn, markNonRetryable as qr, STATE_SOURCED_READBACK_RULES as qt, DeployEngine as r, LockManager as rn, findLargeInlineResources as rr, isInterruptedWaitError as rt, planRollback as s, exportNamesCarriedFrom as sn, PARTITION_TABLE as sr, UNSPECIFIED_SKIP_REASON as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, redactSecretsForState as tn, CFN_TEMPLATE_URL_LIMIT as tr, endCommandInterruptScope as tt, updatePartialMessage as u, shouldRetainResource as un, AssemblyReader as ur, disableInstanceApiTermination as ut, buildFinalSnapshotIdentifier as v, escapeRegExp$1 as vn, AssetError as vr, parameterTypeMayLoseSecretIdentity as vt, makeCanonicalizePropertiesFn as w, getBootstrapMarkerKey as wn, DynamicReferenceRegionAmbiguousError as wr, coerceCfnBoolean as wt, isFinalSnapshotError as x, BOOTSTRAP_MARKER_PREFIX as xn, CrossAccountSecretRefusalError as xr, normalizeAwsTagsToCfn as xt, ccRoutedFinalSnapshotError as y, stripControlChars as yn, CdkdError as yr, refStateLookupFromResource as yt, isExportAliasCollision as z, AssetManifestLoader as zn, formatError as zr, applyRoleArnIfSet as zt };
33261
- //# sourceMappingURL=deploy-engine-CSBoL-Az.js.map
33288
+ //# sourceMappingURL=deploy-engine-BgpCWFvY.js.map