@go-to-k/cdkd 0.285.4 → 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.
- package/README.md +10 -0
- package/dist/{asg-provider-sRJzRAe_.js → asg-provider-DsyALMVT.js} +3 -3
- package/dist/{asg-provider-sRJzRAe_.js.map → asg-provider-DsyALMVT.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-3EmPzxSN.js → deploy-engine-BgpCWFvY.js} +240 -99
- package/dist/deploy-engine-BgpCWFvY.js.map +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{logger-Dz3Le2Pw.js → logger-DyTk5GeO.js} +81 -17
- package/dist/{logger-Dz3Le2Pw.js.map → logger-DyTk5GeO.js.map} +1 -1
- package/dist/{program-DoauTYs2.js → program-cjSJf49d.js} +59 -19
- package/dist/{program-DoauTYs2.js.map → program-cjSJf49d.js.map} +1 -1
- package/dist/{version-Dlq6xZAQ.js → version-De6foYg3.js} +2 -2
- package/dist/{version-Dlq6xZAQ.js.map → version-De6foYg3.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-3EmPzxSN.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as DEFAULT_STATE_PREFIX, $n as warnDeprecatedNoPrefixCliFlag, $t as maskSecretsInError, A as bold, An as buildDenyExternalAccessPolicy, Ar as NestedStackChildDirectDestroyError, At as requireConfigObject, B as secretBearingStateKeyWarning, Bn as getDockerImageBySourceHash, Bt as DiffCalculator, C as unsupportedFinalSnapshotError, Cn as ensureAssetStorage, Cr as DeployCancelledError, Ct as assertRegionMatch, D as isStatefulRecreateTargetSync, Dn as readBootstrapMarkerBody, Dr as LocalStartServiceError, Dt as readConfigString, E as MULTI_REGION_RECREATE_BLOCKED_TYPES, En as parseBootstrapMarker, Er as LocalMigrateError, Et as configStringRefusal, F as yellow, Fn as getDockerCmd, Fr as StackHasActiveImportsError, Ft as s3BucketDomainName, G as clearOnUpdateRemoval, Gn as resolveApp, Gr as isThrottlingError, Gt as TemplateParser, H as getCurrentResourceSecrets, Hn as synthesisStatusMessage, Hr as withErrorHandling, Ht as describeTypeWithThrottleRetry, I as collectDeclaredOutputNames, In as partitionSensitiveEnv, Ir as StackTerminationProtectionError, It as s3BucketDualStackDomainName, J as findSilentDropProperties, Jn as resolveSkipPrefix, Jr as markRedactedCause, Jt as TEMPLATE_SOURCED_RULES, K as ProviderRegistry, Kn as resolveAutoAssetStorage, Kr as isTransientServerError, Kt as STATE_SOURCED_CROSS_GENERATION_RULES, L as collectPublishedOutputNames, Ln as runDockerForeground, Lt as s3BucketRegionalDomainName, M as gray, Mn as buildDockerImage, Mr as ProvisioningError, Mt as classifyReplaySecretRegion, N as green, Nn as dockerSpawnEnvWithSensitive, Nr as ResourceTimeoutError, Nt as producerRegionsFromState, O as renderStatefulReason, On as validateAssetBucketName, Ot as replayWarn, P as red, Pn as formatDockerLoginError, Pr as ResourceUpdateNotSupportedError, Pt as s3BucketArn, Q as CUSTOM_RESOURCE_RESPONSE_PREFIX, Qn as stateBucketExistenceConfirmed, Qt as isSingleDynamicReferenceToken, R as exportAliasCollisionScrubWarning, Rn as runDockerStreaming, Rt as s3BucketWebsiteUrl, S as refusesFinalSnapshot, Sn as assertAssetBucketRegion, St as resolveExplicitPhysicalId, T as extractDeploymentEventError, Tn as isCrossRegionRedirect, Tr as LocalInvokeBuildError$1, Tt as configBooleanRefusal, U as IAMRoleProvider, Un as getDefaultStateBucketName, Ur as isMarkedNonRetryable, Ut as withRetry, V as stateKeySecretExposure, Vn as Synthesizer, Vr as normalizeAwsError, Vt as INTRINSIC_KEYS, W as collectInlinePolicyNamesManagedBySiblings, Wn as getLegacyStateBucketName, Wr as isRetryableTransientError, Wt as DagBuilder, X as maskDeep, Xn as resolveStateBucketWithDefaultAndSource, Xt as dynamicReferenceTokens, Y as createMaskedRetryLogger, Yn as resolveStateBucketWithDefault, Yr as retryClassificationText, Yt as createSecretMasker, Z as maskerOrIdentity, Zn as resolveUseCdkBootstrapAssets, Zt as errorCauseChain, _ as PRE_DELETE_SNAPSHOT_TYPES, _n as rewriteTemplateAssetReferences, _r as setAwsClients, _t as isUnboundTemplateParameter, a as DeploymentEventsStore, an as S3StateBackend, ar as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, at as CloudControlProvider, b as createPreDeleteFinalSnapshot, bn as AssetModeResolver, bt as WAFv2WebACLProvider, c as replayFailedOperations, cn as importableOutputKeys, cr as canonicalizeRegion, ct as deleteIndeterminateGuards, d as updatePartialReason, dn as AssetPublisher, dr as processStackMessages, dt as isTerminationProtectionPropagationError, en as maskSecretsInText, er as CFN_TEMPLATE_BODY_LIMIT, et as beginCommandInterruptScope, f as withResourceDeadline, fn as stringifyValue, ft as IntrinsicFunctionResolver, g as ATOMIC_FINAL_SNAPSHOT_TYPES, gn as loadPublishableAssetManifest, gr as resetAwsClients, gt as getAccountInfo, h as computeImplicitDeleteEdges, hn as createAssetRedirectResolver, hr as getAwsClients, ht as coerceParameterTypedValue, i as DeploymentEventsReader, in as displaySafe, ir as uploadCfnTemplate, it as startInterruptWatch, j as cyan, jn as describeAwsFailure, jr as PartialFailureError, jt as requireConfigString, k as formatResourceLine, kn as validateContainerRepoName, kr as MissingCdkCliError, kt as requireConfigArray, l as replayRollback, ln as importableOutputs, lr as derivePartitionAndUrlSuffix, lt as deleteSkipReason, m as IMPLICIT_DELETE_DEPENDENCIES, mn as buildAssetRedirectMap, mr as AwsClients, mt as cfnRefValueFromPhysicalId, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as scrubResourceRecord, nr as MIGRATE_TMP_PREFIX, nt as interruptWatchListenerCount, o as planFailedOps, on as rebuildClientForBucketRegion, or as expectedOwnerParam, ot as slowCcOperationTimeoutMs, p as maskingRetryLogger, pn as WorkGraph, pr as resolveBucketRegion, pt as carriesDynamicReference, q as findActionableSilentDrops, qn as resolveCaptureObservedState, qr as markNonRetryable, qt as STATE_SOURCED_READBACK_RULES, r as DeployEngine, rn as LockManager, rr as findLargeInlineResources, rt as isInterruptedWaitError, s as planRollback, sn as exportNamesCarriedFrom, sr as PARTITION_TABLE, st as UNSPECIFIED_SKIP_REASON, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as redactSecretsForState, tr as CFN_TEMPLATE_URL_LIMIT, tt as endCommandInterruptScope, u as updatePartialMessage, un as shouldRetainResource, ur as AssemblyReader, ut as disableInstanceApiTermination, v as buildFinalSnapshotIdentifier, vn as escapeRegExp, vt as parameterTypeMayLoseSecretIdentity, w as makeCanonicalizePropertiesFn, wn as getBootstrapMarkerKey, wr as DynamicReferenceRegionAmbiguousError, wt as coerceCfnBoolean, x as isFinalSnapshotError, xn as BOOTSTRAP_MARKER_PREFIX, xr as CrossAccountSecretRefusalError, xt as normalizeAwsTagsToCfn, y as ccRoutedFinalSnapshotError, yn as stripControlChars, yr as CdkdError, yt as refStateLookupFromResource, z as isExportAliasCollision, zn as AssetManifestLoader, zt as applyRoleArnIfSet } from "./deploy-engine-BgpCWFvY.js";
|
|
2
|
+
import { _ as withStackName, c as PATTERN_B_NAME_OPTIONS, f as generateResourceName, g as withSkipPrefix, i as reserveStdoutForPayload, l as PATTERN_B_NAME_PROPERTIES, m as getCurrentStackName, n as getLogger, o as runStackBuffered, p as generateResourceNameWithFallback, s as getLiveRenderer, u as PATTERN_B_RESOURCE_TYPES } from "./logger-DyTk5GeO.js";
|
|
3
3
|
import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
|
|
4
|
-
import { t as getCdkdVersion } from "./version-
|
|
5
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as getCdkdVersion } from "./version-De6foYg3.js";
|
|
5
|
+
import { t as ASGProvider } from "./asg-provider-DsyALMVT.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
8
8
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -1810,6 +1810,7 @@ function countDeployableResources(template) {
|
|
|
1810
1810
|
async function synthCommand(options) {
|
|
1811
1811
|
const logger = getLogger();
|
|
1812
1812
|
if (options.verbose) logger.setLevel("debug");
|
|
1813
|
+
reserveStdoutForPayload();
|
|
1813
1814
|
warnIfDeprecatedRegion(options);
|
|
1814
1815
|
foldRegionOption(options);
|
|
1815
1816
|
await applyRoleArnIfSet({
|
|
@@ -1948,7 +1949,7 @@ function toLongRecord(stack, includeDeps) {
|
|
|
1948
1949
|
async function listCommand(patterns, options) {
|
|
1949
1950
|
const logger = getLogger();
|
|
1950
1951
|
if (options.verbose) logger.setLevel("debug");
|
|
1951
|
-
|
|
1952
|
+
reserveStdoutForPayload();
|
|
1952
1953
|
warnIfDeprecatedRegion(options);
|
|
1953
1954
|
foldRegionOption(options);
|
|
1954
1955
|
await applyRoleArnIfSet({
|
|
@@ -59816,9 +59817,11 @@ async function runDestroyForStack(stackName, state, ctx) {
|
|
|
59816
59817
|
deletedCount: 0,
|
|
59817
59818
|
retainedCount: 0,
|
|
59818
59819
|
skippedCount: 0,
|
|
59820
|
+
guardIndeterminateCount: 0,
|
|
59819
59821
|
errorCount: 0,
|
|
59820
59822
|
interrupted: false
|
|
59821
59823
|
};
|
|
59824
|
+
const guardIndeterminateTargets = /* @__PURE__ */ new Set();
|
|
59822
59825
|
const resourceCount = Object.keys(state.resources).length;
|
|
59823
59826
|
const regionForState = state.region ?? ctx.baseRegion;
|
|
59824
59827
|
if (resourceCount === 0) {
|
|
@@ -60181,6 +60184,21 @@ async function runDestroyForStack(stackName, state, ctx) {
|
|
|
60181
60184
|
onTimeout: (elapsedMs) => new ResourceTimeoutError(logicalId, resource.resourceType, stackRegion, elapsedMs, "DELETE", timeoutMs)
|
|
60182
60185
|
});
|
|
60183
60186
|
renderer.removeTask(logicalId);
|
|
60187
|
+
for (const guard of deleteIndeterminateGuards(deleteResult)) {
|
|
60188
|
+
result.guardIndeterminateCount++;
|
|
60189
|
+
guardIndeterminateTargets.add(logicalId);
|
|
60190
|
+
ctx.eventRecorder?.record({
|
|
60191
|
+
eventType: "RESOURCE_GUARD_INDETERMINATE",
|
|
60192
|
+
stackName,
|
|
60193
|
+
operation: "DELETE",
|
|
60194
|
+
logicalId,
|
|
60195
|
+
resourceType: resource.resourceType,
|
|
60196
|
+
...resource.provisionedBy && { provisionedBy: resource.provisionedBy },
|
|
60197
|
+
...resource.physicalId && { physicalId: resource.physicalId },
|
|
60198
|
+
guard: guard.guard,
|
|
60199
|
+
reason: guard.reason
|
|
60200
|
+
});
|
|
60201
|
+
}
|
|
60184
60202
|
if (deleteResult?.outcome === "skipped") {
|
|
60185
60203
|
const skipReason = deleteSkipReason(deleteResult) ?? "no reason reported by the provider";
|
|
60186
60204
|
logger.info(` ${formatResourceLine("skipped", logicalId, resource.resourceType, `skipped (${skipReason})`)}`);
|
|
@@ -60287,18 +60305,23 @@ async function runDestroyForStack(stackName, state, ctx) {
|
|
|
60287
60305
|
}
|
|
60288
60306
|
const retainedSuffix = result.retainedCount > 0 ? `, ${result.retainedCount} retained` : "";
|
|
60289
60307
|
const skippedSuffix = result.skippedCount > 0 ? `, ${yellow(result.skippedCount)} skipped` : "";
|
|
60290
|
-
|
|
60291
|
-
|
|
60308
|
+
const guardSuffix = result.guardIndeterminateCount > 0 ? `, ${yellow(result.guardIndeterminateCount)} unverified` : "";
|
|
60309
|
+
if (result.guardIndeterminateCount > 0) {
|
|
60310
|
+
const durablePointer = ctx.eventRecorder === void 0 ? "This summary is the only record: this run wrote no deployment events, either because it is a 'cdkd state destroy' (go-to-k/cdkd#2423) or because it is a nested-stack child, neither of which threads an event recorder." : `Run 'cdkd events ${stackName}' for the RESOURCE_GUARD_INDETERMINATE entries, which name the check and the reason and survive the run.`;
|
|
60311
|
+
logger.warn(`\n${yellow("⚠")} ${result.guardIndeterminateCount} pre-flight safety check(s) could NOT be completed during this destroy and cdkd proceeded anyway: ${[...guardIndeterminateTargets].join(", ")}. A check can be suppressed by DENYING the permission it needs, so treat this as unconfirmed rather than benign. ${durablePointer}`);
|
|
60312
|
+
}
|
|
60313
|
+
if (!preserveState) logger.info(`\n${green("✓")} ${bold(`Stack ${stackName} destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${guardSuffix}, ${result.errorCount} errors)`);
|
|
60314
|
+
else if (result.interrupted && result.errorCount === 0) logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${stackName} destroy interrupted`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}${guardSuffix}, ${result.errorCount} errors). State preserved — re-run 'cdkd destroy' / 'cdkd state destroy' to finish.`);
|
|
60292
60315
|
else if (result.errorCount === 0) {
|
|
60293
60316
|
const targets = [...skippedStateTargets];
|
|
60294
60317
|
const showHint = hintFor("cdkd state show", targets);
|
|
60295
60318
|
const orphanHint = hintFor("cdkd state orphan", targets);
|
|
60296
|
-
logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${stackName} partially destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}, ${result.errorCount} errors). cdkd could not address the skipped resource(s), so they may still exist in AWS. Fix the physicalId in state.json (${showHint}) and re-run, or delete them by hand and drop the records with ${orphanHint}.`);
|
|
60319
|
+
logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${stackName} partially destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}${guardSuffix}, ${result.errorCount} errors). cdkd could not address the skipped resource(s), so they may still exist in AWS. Fix the physicalId in state.json (${showHint}) and re-run, or delete them by hand and drop the records with ${orphanHint}.`);
|
|
60297
60320
|
} else {
|
|
60298
60321
|
const orphanHint = hintFor("cdkd state orphan", failedStateTargets.size > 0 ? [...failedStateTargets] : [stackName]);
|
|
60299
60322
|
const skippedTargets = [...skippedStateTargets];
|
|
60300
60323
|
const skippedClause = skippedTargets.length > 0 ? ` Separately, ${result.skippedCount} resource(s) were SKIPPED — cdkd could not address them, so no delete was issued and they may still exist in AWS. Fix the physicalId in state.json (${hintFor("cdkd state show", skippedTargets)}) and re-run, or delete them by hand and drop the records with ${hintFor("cdkd state orphan", skippedTargets)}.` : "";
|
|
60301
|
-
logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${stackName} partially destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}, ${red(result.errorCount)} errors). State preserved — re-run 'cdkd destroy' / 'cdkd state destroy' to clean up. If the same resource keeps failing, ${orphanHint} is the last resort: it removes the state record without deleting AWS resources.` + skippedClause);
|
|
60324
|
+
logger.warn(`\n${yellow("⚠")} ${bold(`Stack ${stackName} partially destroyed`)} (${green(result.deletedCount)} deleted${retainedSuffix}${skippedSuffix}${guardSuffix}, ${red(result.errorCount)} errors). State preserved — re-run 'cdkd destroy' / 'cdkd state destroy' to clean up. If the same resource keeps failing, ${orphanHint} is the last resort: it removes the state record without deleting AWS resources.` + skippedClause);
|
|
60302
60325
|
}
|
|
60303
60326
|
} finally {
|
|
60304
60327
|
try {
|
|
@@ -75682,6 +75705,7 @@ function printRunEvents(stackName, region, runId, events) {
|
|
|
75682
75705
|
const parts = [gray(e.timestamp), colorizeEventType(e.eventType)];
|
|
75683
75706
|
if (e.logicalId) parts.push(`${e.logicalId}${e.resourceType ? ` (${e.resourceType})` : ""}`);
|
|
75684
75707
|
if (e.operation) parts.push(gray(e.operation));
|
|
75708
|
+
if (e.guard) parts.push(gray(`guard=${e.guard}`));
|
|
75685
75709
|
if (e.provisionedBy) parts.push(gray(`[${e.provisionedBy}]`));
|
|
75686
75710
|
if (e.command) parts.push(gray(e.command));
|
|
75687
75711
|
if (e.region) parts.push(gray(e.region));
|
|
@@ -75709,6 +75733,7 @@ function colorizeEventType(eventType) {
|
|
|
75709
75733
|
if (eventType.endsWith("FAILED")) return red(eventType);
|
|
75710
75734
|
if (eventType.endsWith("SUCCEEDED") || eventType === "RUN_FINISHED") return green(eventType);
|
|
75711
75735
|
if (eventType === "RESOURCE_SKIPPED") return yellow(eventType);
|
|
75736
|
+
if (eventType === "RESOURCE_GUARD_INDETERMINATE") return yellow(eventType);
|
|
75712
75737
|
if (eventType.startsWith("ROLLBACK")) return yellow(eventType);
|
|
75713
75738
|
return cyan(eventType);
|
|
75714
75739
|
}
|
|
@@ -81113,8 +81138,15 @@ var DockerRunnerError = class DockerRunnerError extends Error {
|
|
|
81113
81138
|
* Pull the image. No-op when `skipPull` is true.
|
|
81114
81139
|
*
|
|
81115
81140
|
* In verbose mode (`--verbose` / global log level `debug`), streams the
|
|
81116
|
-
* full `docker pull` progress
|
|
81117
|
-
*
|
|
81141
|
+
* full `docker pull` progress live so the user sees per-layer downloads.
|
|
81142
|
+
* NOT necessarily to stdout: on a command holding a payload reservation --
|
|
81143
|
+
* which `cdkd local invoke` and `cdkd local invoke-agentcore` both do, and
|
|
81144
|
+
* both reach this function -- the child's fd 1 is redirected to stderr by
|
|
81145
|
+
* `spawnForeground` (`src/utils/docker-cmd.ts`, issue
|
|
81146
|
+
* [#2410](https://github.com/go-to-k/cdkd/issues/2410)), so the progress
|
|
81147
|
+
* lands there instead. Do not build on the fd-1 assumption; that is the one
|
|
81148
|
+
* this file's own leak was made of. In the default compact mode the call is
|
|
81149
|
+
* silent (cached
|
|
81118
81150
|
* images are the common case; a fresh pull still shows progress only
|
|
81119
81151
|
* via `--verbose`). Errors are always surfaced: the captured stderr is
|
|
81120
81152
|
* folded into the thrown `DockerRunnerError` message.
|
|
@@ -85820,6 +85852,7 @@ function parseTimeoutMs(raw) {
|
|
|
85820
85852
|
async function localInvokeAgentCoreCommand(target, options) {
|
|
85821
85853
|
const logger = getLogger();
|
|
85822
85854
|
if (options.verbose) logger.setLevel("debug");
|
|
85855
|
+
reserveStdoutForPayload();
|
|
85823
85856
|
warnIfDeprecatedRegion(options);
|
|
85824
85857
|
if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
|
|
85825
85858
|
if (options.stackRegion !== void 0) {
|
|
@@ -85940,6 +85973,7 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
85940
85973
|
emitA2aResult(a2a);
|
|
85941
85974
|
} else if (options.ws) {
|
|
85942
85975
|
const interactive = process.stdin.isTTY === true;
|
|
85976
|
+
const promptOnStdout = interactive && process.stdout.isTTY === true;
|
|
85943
85977
|
if (watchActive) await runAgentCoreWatchLoop({
|
|
85944
85978
|
containerHost,
|
|
85945
85979
|
hostPort,
|
|
@@ -85955,7 +85989,7 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
85955
85989
|
const wsResult = await invokeAgentCoreWs(containerHost, port, event, {
|
|
85956
85990
|
sessionId,
|
|
85957
85991
|
timeoutMs: options.timeout,
|
|
85958
|
-
onMessage: wrapWsOnMessage((text) => process.stdout.write(text),
|
|
85992
|
+
onMessage: wrapWsOnMessage((text) => process.stdout.write(text), promptOnStdout),
|
|
85959
85993
|
abortSignal,
|
|
85960
85994
|
...authorization && { authorization },
|
|
85961
85995
|
...frameSource && { frameSource }
|
|
@@ -86010,7 +86044,7 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
86010
86044
|
const wsResult = await invokeAgentCoreWs(containerHost, hostPort, event, {
|
|
86011
86045
|
sessionId,
|
|
86012
86046
|
timeoutMs: options.timeout,
|
|
86013
|
-
onMessage: wrapWsOnMessage((text) => process.stdout.write(text),
|
|
86047
|
+
onMessage: wrapWsOnMessage((text) => process.stdout.write(text), promptOnStdout),
|
|
86014
86048
|
...authorization && { authorization },
|
|
86015
86049
|
...frameSource && { frameSource }
|
|
86016
86050
|
});
|
|
@@ -86833,17 +86867,22 @@ const WS_REPL_PROMPT = "> ";
|
|
|
86833
86867
|
* `/ws` endpoint behaves the same. That's correct on the wire but visually
|
|
86834
86868
|
* run-on in an interactive terminal — the user's next keystroke concatenates
|
|
86835
86869
|
* onto the last frame's tail char and they have no signal that the REPL is
|
|
86836
|
-
* waiting for input.
|
|
86870
|
+
* waiting for input. When the prompt is on, we append `\n` (unless already
|
|
86837
86871
|
* present) and then write a `> ` prompt, so each agent message is presented as
|
|
86838
86872
|
* its own line and the next input prompt is visible.
|
|
86839
86873
|
*
|
|
86840
|
-
*
|
|
86841
|
-
*
|
|
86874
|
+
* The gate is `promptOnStdout` — stdin a TTY AND stdout a TTY — not stdin
|
|
86875
|
+
* alone (issue [#2410](https://github.com/go-to-k/cdkd/issues/2410)). Reading
|
|
86876
|
+
* follow-up frames from stdin is a stdin question and keeps its own check at
|
|
86877
|
+
* the call site; writing a prompt is a STDOUT question, and stdout is this
|
|
86878
|
+
* command's payload stream. With a REDIRECTED stdout the raw
|
|
86879
|
+
* WS-protocol-faithful pass-through is what a consumer parses, so a terminal
|
|
86880
|
+
* stdin no longer drags a `> ` into it.
|
|
86842
86881
|
*
|
|
86843
86882
|
* Exported so a unit test can drive the wrapping without the full WS pipeline.
|
|
86844
86883
|
*/
|
|
86845
|
-
function wrapWsOnMessage(sink,
|
|
86846
|
-
if (!
|
|
86884
|
+
function wrapWsOnMessage(sink, promptOnStdout) {
|
|
86885
|
+
if (!promptOnStdout) return sink;
|
|
86847
86886
|
return (text) => {
|
|
86848
86887
|
sink(text.endsWith("\n") ? text : `${text}\n`);
|
|
86849
86888
|
sink("> ");
|
|
@@ -87047,6 +87086,7 @@ const CDKD_EMBED_CONFIG = {
|
|
|
87047
87086
|
async function localInvokeCommand(target, options) {
|
|
87048
87087
|
const logger = getLogger();
|
|
87049
87088
|
if (options.verbose) logger.setLevel("debug");
|
|
87089
|
+
reserveStdoutForPayload();
|
|
87050
87090
|
warnIfDeprecatedRegion(options);
|
|
87051
87091
|
if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
|
|
87052
87092
|
if (options.stackRegion !== void 0) {
|
|
@@ -88998,4 +89038,4 @@ function buildProgram() {
|
|
|
88998
89038
|
|
|
88999
89039
|
//#endregion
|
|
89000
89040
|
export { buildProgram };
|
|
89001
|
-
//# sourceMappingURL=program-
|
|
89041
|
+
//# sourceMappingURL=program-cjSJf49d.js.map
|