fjall 0.96.0 → 0.99.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.
Files changed (228) hide show
  1. package/bin/.bundled +3 -3
  2. package/bin/.metafile.json +4742 -3402
  3. package/bin/assets/generators/application/generator.js +1 -1
  4. package/bin/assets/generators/compute/generator.js +1 -1
  5. package/bin/assets/generators/compute/service/generator.js +1 -1
  6. package/bin/assets/generators/database/generator.js +1 -1
  7. package/bin/assets/generators/domain/generator.js +2 -2
  8. package/bin/assets/generators/organisation/files/organisation/infrastructure.ts +8 -2
  9. package/bin/assets/generators/shared/files/cdk.json +1 -1
  10. package/bin/assets/generators/shared/files/package.json +8 -7
  11. package/bin/assets/generators/shared/files/tsconfig.json +5 -4
  12. package/bin/assets/generators/utils/integrationTestUtils.d.ts +9 -0
  13. package/bin/assets/generators/utils/integrationTestUtils.js +4 -2
  14. package/bin/assets/generators/utils/planning/generatorHelpers.js +2 -2
  15. package/bin/assets/src/util/__tests__/fjallApiClientTestHelpers.d.ts +9 -0
  16. package/bin/assets/src/util/__tests__/fjallApiClientTestHelpers.js +1 -0
  17. package/bin/assets/src/util/__tests__/outputTestHelpers.d.ts +9 -0
  18. package/bin/assets/src/util/__tests__/outputTestHelpers.js +1 -0
  19. package/bin/assets/src/util/agent/__tests__/toonTestHelpers.d.ts +91 -0
  20. package/bin/assets/src/util/agent/__tests__/toonTestHelpers.js +1 -0
  21. package/bin/assets/src/util/agent/actionRequired.d.ts +60 -0
  22. package/bin/assets/src/util/agent/actionRequired.js +1 -0
  23. package/bin/assets/src/util/agent/agentCallbacks.d.ts +21 -0
  24. package/bin/assets/src/util/agent/agentCallbacks.js +1 -0
  25. package/bin/assets/src/util/agent/agentInit.d.ts +17 -0
  26. package/bin/assets/src/util/agent/agentInit.js +288 -0
  27. package/bin/assets/src/util/agent/agentOutput.d.ts +61 -0
  28. package/bin/assets/src/util/agent/agentOutput.js +8 -0
  29. package/bin/assets/src/util/agent/budget.d.ts +19 -0
  30. package/bin/assets/src/util/agent/budget.js +4 -0
  31. package/bin/assets/src/util/agent/detectAgent.d.ts +51 -0
  32. package/bin/assets/src/util/agent/detectAgent.js +1 -0
  33. package/bin/assets/src/util/agent/errorCodeMap.d.ts +16 -0
  34. package/bin/assets/src/util/agent/errorCodeMap.js +1 -0
  35. package/bin/assets/src/util/agent/errorCodes.d.ts +48 -0
  36. package/bin/assets/src/util/agent/errorCodes.js +1 -0
  37. package/bin/assets/src/util/agent/fieldSelection.d.ts +22 -0
  38. package/bin/assets/src/util/agent/fieldSelection.js +1 -0
  39. package/bin/assets/src/util/agent/getSurface.d.ts +27 -0
  40. package/bin/assets/src/util/agent/getSurface.js +1 -0
  41. package/bin/assets/src/util/agent/index.d.ts +27 -0
  42. package/bin/assets/src/util/agent/index.js +1 -0
  43. package/bin/assets/src/util/agent/mcpProtocolEmit.d.ts +31 -0
  44. package/bin/assets/src/util/agent/mcpProtocolEmit.js +2 -0
  45. package/bin/assets/src/util/agent/schemas/appsSchemas.d.ts +18 -0
  46. package/bin/assets/src/util/agent/schemas/appsSchemas.js +1 -0
  47. package/bin/assets/src/util/agent/schemas/assetSchemas.d.ts +13 -0
  48. package/bin/assets/src/util/agent/schemas/assetSchemas.js +1 -0
  49. package/bin/assets/src/util/agent/schemas/awsSchemas.d.ts +5 -0
  50. package/bin/assets/src/util/agent/schemas/awsSchemas.js +1 -0
  51. package/bin/assets/src/util/agent/schemas/deploySchemas.d.ts +8 -0
  52. package/bin/assets/src/util/agent/schemas/deploySchemas.js +1 -0
  53. package/bin/assets/src/util/agent/schemas/index.d.ts +10 -0
  54. package/bin/assets/src/util/agent/schemas/index.js +1 -0
  55. package/bin/assets/src/util/agent/schemas/infraSchemas.d.ts +45 -0
  56. package/bin/assets/src/util/agent/schemas/infraSchemas.js +1 -0
  57. package/bin/assets/src/util/agent/schemas/secretsSchemas.d.ts +13 -0
  58. package/bin/assets/src/util/agent/schemas/secretsSchemas.js +1 -0
  59. package/bin/assets/src/util/agent/schemas/types.d.ts +98 -0
  60. package/bin/assets/src/util/agent/schemas/types.js +0 -0
  61. package/bin/assets/src/util/agent/schemas/userSchemas.d.ts +21 -0
  62. package/bin/assets/src/util/agent/schemas/userSchemas.js +1 -0
  63. package/bin/assets/src/util/agent/sessionHooks.d.ts +47 -0
  64. package/bin/assets/src/util/agent/sessionHooks.js +6 -0
  65. package/bin/assets/src/util/agent/streaming.d.ts +51 -0
  66. package/bin/assets/src/util/agent/streaming.js +1 -0
  67. package/bin/assets/src/util/agent/suggestionEntries/coreEntries.d.ts +2 -0
  68. package/bin/assets/src/util/agent/suggestionEntries/coreEntries.js +1 -0
  69. package/bin/assets/src/util/agent/suggestionEntries/identityEntries.d.ts +2 -0
  70. package/bin/assets/src/util/agent/suggestionEntries/identityEntries.js +1 -0
  71. package/bin/assets/src/util/agent/suggestionEntries/index.d.ts +3 -0
  72. package/bin/assets/src/util/agent/suggestionEntries/index.js +1 -0
  73. package/bin/assets/src/util/agent/suggestionEntries/infraEntries.d.ts +2 -0
  74. package/bin/assets/src/util/agent/suggestionEntries/infraEntries.js +1 -0
  75. package/bin/assets/src/util/agent/suggestionEntries/observabilityEntries.d.ts +2 -0
  76. package/bin/assets/src/util/agent/suggestionEntries/observabilityEntries.js +1 -0
  77. package/bin/assets/src/util/agent/suggestionEntries/secretsEntries.d.ts +2 -0
  78. package/bin/assets/src/util/agent/suggestionEntries/secretsEntries.js +1 -0
  79. package/bin/assets/src/util/agent/suggestionEntries/types.d.ts +17 -0
  80. package/bin/assets/src/util/agent/suggestionEntries/types.js +1 -0
  81. package/bin/assets/src/util/agent/suggestions.d.ts +30 -0
  82. package/bin/assets/src/util/agent/suggestions.js +1 -0
  83. package/bin/assets/src/util/agent/tokenScopes.d.ts +24 -0
  84. package/bin/assets/src/util/agent/tokenScopes.js +1 -0
  85. package/bin/assets/src/util/agent/toonFormatter.d.ts +55 -0
  86. package/bin/assets/src/util/agent/toonFormatter.js +14 -0
  87. package/bin/assets/src/util/api/Credentials.d.ts +13 -0
  88. package/bin/assets/src/util/api/Credentials.js +1 -0
  89. package/bin/assets/src/util/api/FjallApiClient.d.ts +33 -0
  90. package/bin/assets/src/util/api/FjallApiClient.js +1 -0
  91. package/bin/assets/src/util/api/FjallApiClient.types.d.ts +375 -0
  92. package/bin/assets/src/util/api/FjallApiClient.types.js +1 -0
  93. package/bin/assets/src/util/api/FjallApiClientBase.d.ts +13 -0
  94. package/bin/assets/src/util/api/FjallApiClientBase.js +1 -0
  95. package/bin/assets/src/util/api/FjallApiClientDeviceCode.d.ts +13 -0
  96. package/bin/assets/src/util/api/FjallApiClientDeviceCode.js +1 -0
  97. package/bin/assets/src/util/api/FjallApiClientErrors.d.ts +5 -0
  98. package/bin/assets/src/util/api/FjallApiClientErrors.js +1 -0
  99. package/bin/assets/src/util/api/FjallApiClientResources.d.ts +45 -0
  100. package/bin/assets/src/util/api/FjallApiClientResources.js +1 -0
  101. package/bin/assets/src/util/api/index.d.ts +7 -0
  102. package/bin/assets/src/util/api/index.js +1 -0
  103. package/bin/assets/src/util/api/resolveApiKey.d.ts +1 -0
  104. package/bin/assets/src/util/api/resolveApiKey.js +1 -0
  105. package/bin/assets/src/util/api/scaffoldNotification.d.ts +2 -0
  106. package/bin/assets/src/util/api/scaffoldNotification.js +1 -0
  107. package/bin/assets/src/util/awsCleanup.d.ts +9 -0
  108. package/bin/assets/src/util/awsCleanup.js +1 -0
  109. package/bin/assets/src/util/awsTags.d.ts +19 -0
  110. package/bin/assets/src/util/awsTags.js +1 -0
  111. package/bin/assets/src/util/buildxEventAdapter.d.ts +20 -0
  112. package/bin/assets/src/util/buildxEventAdapter.js +1 -0
  113. package/bin/assets/src/util/caseConversion.d.ts +1 -0
  114. package/bin/assets/src/util/caseConversion.js +1 -0
  115. package/bin/assets/src/util/codemod/emitCliTelemetry.d.ts +32 -0
  116. package/bin/assets/src/util/codemod/emitCliTelemetry.js +1 -0
  117. package/bin/assets/src/util/codemod/exitCodes.d.ts +11 -0
  118. package/bin/assets/src/util/codemod/exitCodes.js +1 -0
  119. package/bin/assets/src/util/codemod/index.d.ts +3 -0
  120. package/bin/assets/src/util/codemod/index.js +1 -0
  121. package/bin/assets/src/util/codemod/renderCodemod.d.ts +5 -0
  122. package/bin/assets/src/util/codemod/renderCodemod.js +1 -0
  123. package/bin/assets/src/util/codemod/stepLabels.d.ts +11 -0
  124. package/bin/assets/src/util/codemod/stepLabels.js +1 -0
  125. package/bin/assets/src/util/colourUtils.d.ts +21 -0
  126. package/bin/assets/src/util/colourUtils.js +1 -0
  127. package/bin/assets/src/util/commandErrorHandler.d.ts +16 -0
  128. package/bin/assets/src/util/commandErrorHandler.js +1 -0
  129. package/bin/assets/src/util/commandResult.d.ts +63 -0
  130. package/bin/assets/src/util/commandResult.js +1 -0
  131. package/bin/assets/src/util/concurrency.d.ts +35 -0
  132. package/bin/assets/src/util/concurrency.js +1 -0
  133. package/bin/assets/src/util/deploymentEvents.d.ts +155 -0
  134. package/bin/assets/src/util/deploymentEvents.js +1 -0
  135. package/bin/assets/src/util/errorDisplay.d.ts +4 -0
  136. package/bin/assets/src/util/errorDisplay.js +2 -0
  137. package/bin/assets/src/util/errorUtils.d.ts +1 -0
  138. package/bin/assets/src/util/errorUtils.js +1 -0
  139. package/bin/assets/src/util/executionMode.d.ts +18 -0
  140. package/bin/assets/src/util/executionMode.js +1 -0
  141. package/bin/assets/src/util/formatDeltaValue.d.ts +1 -0
  142. package/bin/assets/src/util/formatDeltaValue.js +1 -0
  143. package/bin/assets/src/util/formatDuration.d.ts +1 -0
  144. package/bin/assets/src/util/formatDuration.js +1 -0
  145. package/bin/assets/src/util/formatRelativeTime.d.ts +1 -0
  146. package/bin/assets/src/util/formatRelativeTime.js +1 -0
  147. package/bin/assets/src/util/fuzzyMatch.d.ts +38 -0
  148. package/bin/assets/src/util/fuzzyMatch.js +1 -0
  149. package/bin/assets/src/util/gitDetection.d.ts +8 -0
  150. package/bin/assets/src/util/gitDetection.js +1 -0
  151. package/bin/assets/src/util/index.d.ts +50 -0
  152. package/bin/assets/src/util/index.js +1 -0
  153. package/bin/assets/src/util/log.d.ts +29 -0
  154. package/bin/assets/src/util/log.js +4 -0
  155. package/bin/assets/src/util/logger/CorrelatedLogger.d.ts +15 -0
  156. package/bin/assets/src/util/logger/CorrelatedLogger.js +1 -0
  157. package/bin/assets/src/util/logger/DeploymentLogger.d.ts +33 -0
  158. package/bin/assets/src/util/logger/DeploymentLogger.js +2 -0
  159. package/bin/assets/src/util/logger/FileRotator.d.ts +17 -0
  160. package/bin/assets/src/util/logger/FileRotator.js +1 -0
  161. package/bin/assets/src/util/logger/LogFileWriter.d.ts +54 -0
  162. package/bin/assets/src/util/logger/LogFileWriter.js +4 -0
  163. package/bin/assets/src/util/logger/Logger.d.ts +43 -0
  164. package/bin/assets/src/util/logger/Logger.js +1 -0
  165. package/bin/assets/src/util/logger/index.d.ts +15 -0
  166. package/bin/assets/src/util/logger/index.js +2 -0
  167. package/bin/assets/src/util/logger/logDir.d.ts +5 -0
  168. package/bin/assets/src/util/logger/logDir.js +1 -0
  169. package/bin/assets/src/util/logger/types.d.ts +48 -0
  170. package/bin/assets/src/util/logger/types.js +1 -0
  171. package/bin/assets/src/util/nonInteractive/index.d.ts +3 -0
  172. package/bin/assets/src/util/nonInteractive/index.js +1 -0
  173. package/bin/assets/src/util/nonInteractive/nonInteractiveCallbacks.d.ts +18 -0
  174. package/bin/assets/src/util/nonInteractive/nonInteractiveCallbacks.js +1 -0
  175. package/bin/assets/src/util/nonInteractive/nonInteractiveCascadeOutput.d.ts +51 -0
  176. package/bin/assets/src/util/nonInteractive/nonInteractiveCascadeOutput.js +1 -0
  177. package/bin/assets/src/util/nonInteractive/nonInteractiveLabels.d.ts +23 -0
  178. package/bin/assets/src/util/nonInteractive/nonInteractiveLabels.js +1 -0
  179. package/bin/assets/src/util/nonInteractive/nonInteractiveOutput.d.ts +128 -0
  180. package/bin/assets/src/util/nonInteractive/nonInteractiveOutput.js +4 -0
  181. package/bin/assets/src/util/nonInteractive/nonInteractiveSummaryOutput.d.ts +29 -0
  182. package/bin/assets/src/util/nonInteractive/nonInteractiveSummaryOutput.js +3 -0
  183. package/bin/assets/src/util/organisationStructure.d.ts +9 -0
  184. package/bin/assets/src/util/organisationStructure.js +1 -0
  185. package/bin/assets/src/util/parseTakeOption.d.ts +1 -0
  186. package/bin/assets/src/util/parseTakeOption.js +1 -0
  187. package/bin/assets/src/util/passwordValidation.d.ts +22 -0
  188. package/bin/assets/src/util/passwordValidation.js +1 -0
  189. package/bin/assets/src/util/pathHelpers.d.ts +19 -0
  190. package/bin/assets/src/util/pathHelpers.js +1 -0
  191. package/bin/assets/src/util/patternDetection.d.ts +7 -0
  192. package/bin/assets/src/util/patternDetection.js +1 -0
  193. package/bin/assets/src/util/promptYesNo.d.ts +5 -0
  194. package/bin/assets/src/util/promptYesNo.js +1 -0
  195. package/bin/assets/src/util/readStdin.d.ts +9 -0
  196. package/bin/assets/src/util/readStdin.js +1 -0
  197. package/bin/assets/src/util/secretsUtils.d.ts +155 -0
  198. package/bin/assets/src/util/secretsUtils.js +3 -0
  199. package/bin/assets/src/util/signalCleanup.d.ts +13 -0
  200. package/bin/assets/src/util/signalCleanup.js +4 -0
  201. package/bin/assets/src/util/stripAnsi.d.ts +2 -0
  202. package/bin/assets/src/util/stripAnsi.js +1 -0
  203. package/bin/assets/src/util/synchronizedOutput.d.ts +26 -0
  204. package/bin/assets/src/util/synchronizedOutput.js +1 -0
  205. package/bin/assets/src/util/targetDetection.d.ts +27 -0
  206. package/bin/assets/src/util/targetDetection.js +1 -0
  207. package/bin/assets/src/util/targetHelpers.d.ts +20 -0
  208. package/bin/assets/src/util/targetHelpers.js +1 -0
  209. package/bin/assets/src/util/terminalCapabilities.d.ts +21 -0
  210. package/bin/assets/src/util/terminalCapabilities.js +1 -0
  211. package/bin/assets/src/util/terminalEscapes.d.ts +29 -0
  212. package/bin/assets/src/util/terminalEscapes.js +1 -0
  213. package/bin/assets/src/util/terminalFocus.d.ts +33 -0
  214. package/bin/assets/src/util/terminalFocus.js +1 -0
  215. package/bin/assets/src/util/theme.d.ts +80 -0
  216. package/bin/assets/src/util/theme.js +1 -0
  217. package/bin/assets/src/util/truncateMiddle.d.ts +9 -0
  218. package/bin/assets/src/util/truncateMiddle.js +1 -0
  219. package/bin/assets/src/util/typeGuards.d.ts +5 -0
  220. package/bin/assets/src/util/typeGuards.js +1 -0
  221. package/bin/assets/src/util/uiRouter.d.ts +13 -0
  222. package/bin/assets/src/util/uiRouter.js +1 -0
  223. package/bin/assets/src/util/urlHelpers.d.ts +4 -0
  224. package/bin/assets/src/util/urlHelpers.js +1 -0
  225. package/bin/assets/src/util/versionDisplay.d.ts +5 -0
  226. package/bin/assets/src/util/versionDisplay.js +1 -0
  227. package/bin/fjall.bundle.js +736 -564
  228. package/package.json +38 -35
@@ -0,0 +1,50 @@
1
+ export { buildCoreFjallTags } from "./awsTags.js";
2
+ export type { FjallTag } from "./awsTags.js";
3
+ export { toPascalCase, toKebab, capitalise } from "./caseConversion.js";
4
+ export { parseColour, toHex, interpolateColour } from "./colourUtils.js";
5
+ export type { RGB } from "./colourUtils.js";
6
+ export { registerUnknownCommandHandler } from "./commandErrorHandler.js";
7
+ export type { CommandInfo } from "./commandErrorHandler.js";
8
+ export { SilentExitError, handleUIResult, handleServiceResult, throwOnFailure, handleCommandError, throwIfInvalidOptions, requireOption, requireArg, throwUnknownSubcommand, createCLIProgressCallback, createProgressHandler, validateRequiredArgs, throwIfMissingFields } from "./commandResult.js";
9
+ export type { CommandResult } from "./commandResult.js";
10
+ export { DeploymentProgressEventSchema, categoriseResource, getExpectedDuration, logEvent, toDeploymentEvent } from "./deploymentEvents.js";
11
+ export type { DeploymentProgressEvent, ResourceCategory, CascadePhase, CascadeAccountStatus } from "./deploymentEvents.js";
12
+ export { displayValidationError } from "./errorDisplay.js";
13
+ export { normaliseError, getErrorMessage, hasErrorCode, getErrorCode, getErrorStack, formatErrorString } from "./errorUtils.js";
14
+ export { isNonInteractiveMode } from "./executionMode.js";
15
+ export type { NonInteractiveOptions } from "./executionMode.js";
16
+ export { fuzzyMatch, fuzzyFilter } from "./fuzzyMatch.js";
17
+ export type { FuzzyPickerOption, FuzzyMatchResult, FuzzyFilterResult } from "./fuzzyMatch.js";
18
+ export { detectGitInfo } from "./gitDetection.js";
19
+ export type { GitInfo } from "./gitDetection.js";
20
+ export { LoggingControl, getLoggingControl, info, message, success, warning, error, handleError, tip, step, startSpinner, updateSpinner, stopSpinner } from "./log.js";
21
+ export { ORGANISATION_DIRS, ORGANISATION_TARGETS } from "./organisationStructure.js";
22
+ export type { OrganisationDir, OrganisationTarget } from "./organisationStructure.js";
23
+ export { validateRdsPassword, validatePasswordConfirmation, validateAllPasswords, allPasswordsValid } from "./passwordValidation.js";
24
+ export type { ValidationResult } from "./passwordValidation.js";
25
+ export { getFjallPath, getProjectRoot, getAppNameFromInfrastructure, getAppName, getInfrastructurePath, getAppPath, getOrganisationComponentPath, getDeploymentLogsPath, getCloudFormationLogsPath, getDomainsDir, getDomainComponentPath, getDomainInfrastructurePath, getDomainZoneFilePath, INFRASTRUCTURE_FILENAME, ZONE_BIND_FILENAME, CDK_OUT_DIR, getCdkOutPath } from "./pathHelpers.js";
26
+ export { OPENNEXT_PATTERNS, isOpenNextPattern, deriveResourcesFromManifestStacks, detectPattern, detectPayload, detectDatabase } from "./patternDetection.js";
27
+ export type { OpenNextPattern, AppResourceFlags } from "./patternDetection.js";
28
+ export { promptYesNo } from "./promptYesNo.js";
29
+ export { readStdinWithTimeout } from "./readStdin.js";
30
+ export { APP_NAME_PATTERN, SECRET_NAME_PATTERN, APP_NAME_ERROR, SECRET_NAME_ERROR, formatNamespace, buildParameterPath, parseNamespaceFromPath, isValidAppName, isValidNamespace, isValidSecretName, parseDotEnv, parseKeyValue, readSecretValueFromFile, readDotEnvFile, formatSecretsTable } from "./secretsUtils.js";
31
+ export { withSignalCleanup } from "./signalCleanup.js";
32
+ export { stripAnsi } from "./stripAnsi.js";
33
+ export { truncateMiddle } from "./truncateMiddle.js";
34
+ export { SYNC_OUTPUT_SUPPORTED, wrapSynchronizedOutput, synchronize, BSU, ESU } from "./synchronizedOutput.js";
35
+ export { getAvailableTargets, getOrganisationTargets, getApplicationTargets, isOrganisationTarget, validateTarget } from "./targetDetection.js";
36
+ export type { TargetType, Target, TargetValidationResult } from "./targetDetection.js";
37
+ export { TARGET_MESSAGES, filterNonRootAccounts, loadActiveTarget, saveActiveTarget } from "./targetHelpers.js";
38
+ export { initTerminalCapabilities, isTmux, isTmuxClamped, isXtermJsBoosted, isFullColor, is256Color, _resetTerminalCapabilities } from "./terminalCapabilities.js";
39
+ export { CURSOR_HOME, SHOW_CURSOR, HIDE_CURSOR, CLEAR_SCREEN, CLEAR_SCROLLBACK, ENTER_ALT_BUFFER, EXIT_ALT_BUFFER, DISABLE_MOUSE_TRACKING, DISABLE_FOCUS_REPORTING, DISABLE_BRACKETED_PASTE, writeToClipboard } from "./terminalEscapes.js";
40
+ export { enableFocusReporting, disableFocusReporting, onFocusChange, isTerminalFocused, _resetFocusReporting } from "./terminalFocus.js";
41
+ export { theme, getActivePalette, setActivePalette, _resetPalette } from "./theme.js";
42
+ export type { Colour, PaletteName, Theme } from "./theme.js";
43
+ export { isStringRecord } from "./typeGuards.js";
44
+ export { routeToUIIfInteractive, routeToUIIfInteractiveExtended } from "./uiRouter.js";
45
+ export type { UIRouteResult } from "./uiRouter.js";
46
+ export { removeProtocol } from "./urlHelpers.js";
47
+ export { upgradeHint } from "./versionDisplay.js";
48
+ export * from "./api/index.js";
49
+ export * from "./logger/index.js";
50
+ export * from "./nonInteractive/index.js";
@@ -0,0 +1 @@
1
+ import{buildCoreFjallTags as t}from"./awsTags.js";import{toPascalCase as a,toKebab as i,capitalise as n}from"./caseConversion.js";import{parseColour as p,toHex as m,interpolateColour as l}from"./colourUtils.js";import{registerUnknownCommandHandler as g}from"./commandErrorHandler.js";import{SilentExitError as f,handleUIResult as c,handleServiceResult as R,throwOnFailure as T,handleCommandError as u,throwIfInvalidOptions as A,requireOption as S,requireArg as x,throwUnknownSubcommand as P,createCLIProgressCallback as C,createProgressHandler as _,validateRequiredArgs as N,throwIfMissingFields as I}from"./commandResult.js";import{DeploymentProgressEventSchema as O,categoriseResource as F,getExpectedDuration as v,logEvent as D,toDeploymentEvent as U}from"./deploymentEvents.js";import{displayValidationError as M}from"./errorDisplay.js";import{normaliseError as w,getErrorMessage as y,hasErrorCode as B,getErrorCode as G,getErrorStack as H,formatErrorString as V}from"./errorUtils.js";import{isNonInteractiveMode as z}from"./executionMode.js";import{fuzzyMatch as j,fuzzyFilter as q}from"./fuzzyMatch.js";import{detectGitInfo as W}from"./gitDetection.js";import{LoggingControl as Z,getLoggingControl as J,info as Q,message as $,success as ee,warning as re,error as te,handleError as oe,tip as ae,step as ie,startSpinner as ne,updateSpinner as se,stopSpinner as pe}from"./log.js";import{ORGANISATION_DIRS as le,ORGANISATION_TARGETS as Ee}from"./organisationStructure.js";import{validateRdsPassword as de,validatePasswordConfirmation as fe,validateAllPasswords as ce,allPasswordsValid as Re}from"./passwordValidation.js";import{getFjallPath as ue,getProjectRoot as Ae,getAppNameFromInfrastructure as Se,getAppName as xe,getInfrastructurePath as Pe,getAppPath as Ce,getOrganisationComponentPath as _e,getDeploymentLogsPath as Ne,getCloudFormationLogsPath as Ie,getDomainsDir as he,getDomainComponentPath as Oe,getDomainInfrastructurePath as Fe,getDomainZoneFilePath as ve,INFRASTRUCTURE_FILENAME as De,ZONE_BIND_FILENAME as Ue,CDK_OUT_DIR as Le,getCdkOutPath as Me}from"./pathHelpers.js";import{OPENNEXT_PATTERNS as we,isOpenNextPattern as ye,deriveResourcesFromManifestStacks as Be,detectPattern as Ge,detectPayload as He,detectDatabase as Ve}from"./patternDetection.js";import{promptYesNo as ze}from"./promptYesNo.js";import{readStdinWithTimeout as je}from"./readStdin.js";import{APP_NAME_PATTERN as Xe,SECRET_NAME_PATTERN as We,APP_NAME_ERROR as Ye,SECRET_NAME_ERROR as Ze,formatNamespace as Je,buildParameterPath as Qe,parseNamespaceFromPath as $e,isValidAppName as er,isValidNamespace as rr,isValidSecretName as tr,parseDotEnv as or,parseKeyValue as ar,readSecretValueFromFile as ir,readDotEnvFile as nr,formatSecretsTable as sr}from"./secretsUtils.js";import{withSignalCleanup as mr}from"./signalCleanup.js";import{stripAnsi as Er}from"./stripAnsi.js";import{truncateMiddle as dr}from"./truncateMiddle.js";import{SYNC_OUTPUT_SUPPORTED as cr,wrapSynchronizedOutput as Rr,synchronize as Tr,BSU as ur,ESU as Ar}from"./synchronizedOutput.js";import{getAvailableTargets as xr,getOrganisationTargets as Pr,getApplicationTargets as Cr,isOrganisationTarget as _r,validateTarget as Nr}from"./targetDetection.js";import{TARGET_MESSAGES as hr,filterNonRootAccounts as Or,loadActiveTarget as Fr,saveActiveTarget as vr}from"./targetHelpers.js";import{initTerminalCapabilities as Ur,isTmux as Lr,isTmuxClamped as Mr,isXtermJsBoosted as br,isFullColor as wr,is256Color as yr,_resetTerminalCapabilities as Br}from"./terminalCapabilities.js";import{CURSOR_HOME as Hr,SHOW_CURSOR as Vr,HIDE_CURSOR as kr,CLEAR_SCREEN as zr,CLEAR_SCROLLBACK as Kr,ENTER_ALT_BUFFER as jr,EXIT_ALT_BUFFER as qr,DISABLE_MOUSE_TRACKING as Xr,DISABLE_FOCUS_REPORTING as Wr,DISABLE_BRACKETED_PASTE as Yr,writeToClipboard as Zr}from"./terminalEscapes.js";import{enableFocusReporting as Qr,disableFocusReporting as $r,onFocusChange as et,isTerminalFocused as rt,_resetFocusReporting as tt}from"./terminalFocus.js";import{theme as at,getActivePalette as it,setActivePalette as nt,_resetPalette as st}from"./theme.js";import{isStringRecord as mt}from"./typeGuards.js";import{routeToUIIfInteractive as Et,routeToUIIfInteractiveExtended as gt}from"./uiRouter.js";import{removeProtocol as ft}from"./urlHelpers.js";import{upgradeHint as Rt}from"./versionDisplay.js";export*from"./api/index.js";export*from"./logger/index.js";export*from"./nonInteractive/index.js";export{Ye as APP_NAME_ERROR,Xe as APP_NAME_PATTERN,ur as BSU,Le as CDK_OUT_DIR,zr as CLEAR_SCREEN,Kr as CLEAR_SCROLLBACK,Hr as CURSOR_HOME,Yr as DISABLE_BRACKETED_PASTE,Wr as DISABLE_FOCUS_REPORTING,Xr as DISABLE_MOUSE_TRACKING,O as DeploymentProgressEventSchema,jr as ENTER_ALT_BUFFER,Ar as ESU,qr as EXIT_ALT_BUFFER,kr as HIDE_CURSOR,De as INFRASTRUCTURE_FILENAME,Z as LoggingControl,we as OPENNEXT_PATTERNS,le as ORGANISATION_DIRS,Ee as ORGANISATION_TARGETS,Ze as SECRET_NAME_ERROR,We as SECRET_NAME_PATTERN,Vr as SHOW_CURSOR,cr as SYNC_OUTPUT_SUPPORTED,f as SilentExitError,hr as TARGET_MESSAGES,Ue as ZONE_BIND_FILENAME,tt as _resetFocusReporting,st as _resetPalette,Br as _resetTerminalCapabilities,Re as allPasswordsValid,t as buildCoreFjallTags,Qe as buildParameterPath,n as capitalise,F as categoriseResource,C as createCLIProgressCallback,_ as createProgressHandler,Be as deriveResourcesFromManifestStacks,Ve as detectDatabase,W as detectGitInfo,Ge as detectPattern,He as detectPayload,$r as disableFocusReporting,M as displayValidationError,Qr as enableFocusReporting,te as error,Or as filterNonRootAccounts,V as formatErrorString,Je as formatNamespace,sr as formatSecretsTable,q as fuzzyFilter,j as fuzzyMatch,it as getActivePalette,xe as getAppName,Se as getAppNameFromInfrastructure,Ce as getAppPath,Cr as getApplicationTargets,xr as getAvailableTargets,Me as getCdkOutPath,Ie as getCloudFormationLogsPath,Ne as getDeploymentLogsPath,Oe as getDomainComponentPath,Fe as getDomainInfrastructurePath,ve as getDomainZoneFilePath,he as getDomainsDir,G as getErrorCode,y as getErrorMessage,H as getErrorStack,v as getExpectedDuration,ue as getFjallPath,Pe as getInfrastructurePath,J as getLoggingControl,_e as getOrganisationComponentPath,Pr as getOrganisationTargets,Ae as getProjectRoot,u as handleCommandError,oe as handleError,R as handleServiceResult,c as handleUIResult,B as hasErrorCode,Q as info,Ur as initTerminalCapabilities,l as interpolateColour,yr as is256Color,wr as isFullColor,z as isNonInteractiveMode,ye as isOpenNextPattern,_r as isOrganisationTarget,mt as isStringRecord,rt as isTerminalFocused,Lr as isTmux,Mr as isTmuxClamped,er as isValidAppName,rr as isValidNamespace,tr as isValidSecretName,br as isXtermJsBoosted,Fr as loadActiveTarget,D as logEvent,$ as message,w as normaliseError,et as onFocusChange,p as parseColour,or as parseDotEnv,ar as parseKeyValue,$e as parseNamespaceFromPath,ze as promptYesNo,nr as readDotEnvFile,ir as readSecretValueFromFile,je as readStdinWithTimeout,g as registerUnknownCommandHandler,ft as removeProtocol,x as requireArg,S as requireOption,Et as routeToUIIfInteractive,gt as routeToUIIfInteractiveExtended,vr as saveActiveTarget,nt as setActivePalette,ne as startSpinner,ie as step,pe as stopSpinner,Er as stripAnsi,ee as success,Tr as synchronize,at as theme,A as throwIfInvalidOptions,I as throwIfMissingFields,T as throwOnFailure,P as throwUnknownSubcommand,ae as tip,U as toDeploymentEvent,m as toHex,i as toKebab,a as toPascalCase,dr as truncateMiddle,se as updateSpinner,Rt as upgradeHint,ce as validateAllPasswords,fe as validatePasswordConfirmation,de as validateRdsPassword,N as validateRequiredArgs,Nr as validateTarget,re as warning,mr as withSignalCleanup,Rr as wrapSynchronizedOutput,Zr as writeToClipboard};
@@ -0,0 +1,29 @@
1
+ import { type Ora } from "ora";
2
+ export declare class LoggingControl {
3
+ private static instance;
4
+ private _verbose;
5
+ private constructor();
6
+ static getInstance(): LoggingControl;
7
+ get verbose(): boolean;
8
+ set verbose(value: boolean);
9
+ }
10
+ export declare function getLoggingControl(): LoggingControl;
11
+ export declare function info(message?: unknown, ...optionalParams: unknown[]): void;
12
+ export declare function message(message?: unknown, ...optionalParams: unknown[]): void;
13
+ export declare function success(message?: unknown, ...optionalParams: unknown[]): void;
14
+ export declare function warning(message?: unknown, ...optionalParams: unknown[]): void;
15
+ export declare function error(message?: unknown, ...optionalParams: unknown[]): void;
16
+ /**
17
+ * Handles errors with consistent formatting and support information
18
+ */
19
+ export declare function handleError(err: unknown, errorMessage: string, options?: {
20
+ tipMessage?: string;
21
+ supportEmail?: string;
22
+ learnMoreUrl?: string;
23
+ throwError?: boolean;
24
+ }): unknown;
25
+ export declare function tip(message?: unknown, ...optionalParams: unknown[]): void;
26
+ export declare function step(message?: unknown): void;
27
+ export declare function startSpinner(text: string): Ora | null;
28
+ export declare function updateSpinner(text: string): Ora | null;
29
+ export declare function stopSpinner(): void;
@@ -0,0 +1,4 @@
1
+ import o from"chalk";import i from"ora";import{ContextManager as n}from"../contexts/index.js";const p={interval:150,frames:["\u2726","\u2727","\u2736","\u2737","\u2738","\u2739","\u273A","\u273B"]};let e=null;class u{static instance;_verbose=!0;constructor(){}static getInstance(){return u.instance||(u.instance=new u),u.instance}get verbose(){return this._verbose}set verbose(t){this._verbose=t}}function S(){return u.getInstance()}function c(r,...t){n.shouldSuppressOutput||(e&&e.stop(),console.log(r,...t),e&&e.start())}function b(r,...t){c(r,...t)}function F(r,...t){n.shouldSuppressOutput||(e?(e.succeed(o.hex("#A4C2A5")(`\u2705 ${r}`)),e=null):console.log(o.hex("#A4C2A5")(`\u2705 ${r}`),...t))}function $(r,...t){n.shouldSuppressOutput||(e?(e.warn(`\u26A0\uFE0F ${r}`),e=null):console.log(o.yellow(`\u26A0\uFE0F ${r}`),...t))}function f(r,...t){n.shouldSuppressOutput||(e?(e.fail(o.red.bold(`\u274C Error: ${r}`)),e=null):console.error(o.red.bold(`\u274C Error: ${r}`),...t))}function g(r,t,s){if(f(t),n.shouldSuppressOutput||console.error(r),s?.tipMessage&&a(s.tipMessage),s?.supportEmail&&!n.shouldSuppressOutput&&(console.log(o.yellow(`
2
+ Please contact ${o.bold(s.supportEmail)} for assistance with this issue.`)),console.log(o.yellow("Include the error details above in your support request."))),s?.learnMoreUrl&&!n.shouldSuppressOutput&&console.log(o.blue(`
3
+ \u{1F4D8} Learn more: ${s.learnMoreUrl}`)),s?.throwError!==!1)throw r;return r}function a(r,...t){n.shouldSuppressOutput||(e&&e.stop(),console.log(o.blue(`\u{1F4A1} Tip: ${r}`),...t),e&&e.start())}function m(r){n.shouldSuppressOutput||(e&&e.stop(),console.log(`
4
+ ${o.hex("#D9622E").bold(`--- ${r} ---`)}`),e&&e.start())}function l(){return n.shouldSuppressOutput||n.isNonInteractive}function O(r){if(l())return null;if(e)return e.text=r,e;const t=o.hex("#FF7BFF")(r);return e=i({text:t,spinner:p,color:"magenta"}).start(),e}function v(r){if(l())return null;if(e)e.text=o.hex("#FF7BFF")(r);else{const t=o.hex("#FF7BFF")(r);e=i({text:t,spinner:p,color:"magenta"}).start()}return e}function w(){l()||e&&(e.stop(),e=null)}export{u as LoggingControl,f as error,S as getLoggingControl,g as handleError,c as info,b as message,O as startSpinner,m as step,w as stopSpinner,F as success,a as tip,v as updateSpinner,$ as warning};
@@ -0,0 +1,15 @@
1
+ import type { Logger } from "./Logger.js";
2
+ /**
3
+ * Logger with correlation ID bound
4
+ */
5
+ export declare class CorrelatedLogger {
6
+ private logger;
7
+ private correlationId;
8
+ constructor(logger: Logger, correlationId: string);
9
+ private log;
10
+ error(component: string, message: string, data?: Record<string, unknown>): void;
11
+ warn(component: string, message: string, data?: Record<string, unknown>): void;
12
+ info(component: string, message: string, data?: Record<string, unknown>): void;
13
+ debug(component: string, message: string, data?: Record<string, unknown>): void;
14
+ trace(component: string, message: string, data?: Record<string, unknown>): void;
15
+ }
@@ -0,0 +1 @@
1
+ class i{logger;correlationId;constructor(o,r){this.logger=o,this.correlationId=r}log(o,r,t,e){this.logger.logWithCorrelation(o,r,t,this.correlationId,e)}error(o,r,t){this.log("error",o,r,t)}warn(o,r,t){this.log("warn",o,r,t)}info(o,r,t){this.log("info",o,r,t)}debug(o,r,t){this.log("debug",o,r,t)}trace(o,r,t){this.log("trace",o,r,t)}}export{i as CorrelatedLogger};
@@ -0,0 +1,33 @@
1
+ import type { DeploymentLogger, LogLevel } from "./types.js";
2
+ export interface LoggerInterface {
3
+ logWithCorrelation(level: LogLevel, component: string, message: string, correlationId: string, data?: Record<string, unknown>, stackName?: string, phase?: string): void;
4
+ }
5
+ export declare class DeploymentLoggerImpl implements DeploymentLogger {
6
+ private mainLogger;
7
+ private appName;
8
+ private operationType;
9
+ private logStream;
10
+ private logPath;
11
+ private deploymentId;
12
+ private buffer;
13
+ private flushInterval;
14
+ private isClosing;
15
+ private readonly maxBufferSize;
16
+ constructor(mainLogger: LoggerInterface, appName: string, operationType: string);
17
+ private log;
18
+ private flush;
19
+ info(component: string, message: string, data?: Record<string, unknown>): void;
20
+ warn(component: string, message: string, data?: Record<string, unknown>): void;
21
+ error(component: string, message: string, data?: Record<string, unknown>): void;
22
+ debug(component: string, message: string, data?: Record<string, unknown>): void;
23
+ stackEvent(stackName: string, phase: string, message: string, data?: Record<string, unknown>): void;
24
+ dockerEvent(message: string, percentage?: number): void;
25
+ ecsEvent(message: string, percentage?: number, taskCount?: {
26
+ running: number;
27
+ desired: number;
28
+ pending?: number;
29
+ }): void;
30
+ close(): void;
31
+ getLogPath(): string;
32
+ getDeploymentId(): string;
33
+ }
@@ -0,0 +1,2 @@
1
+ import{createWriteStream as g,existsSync as f,mkdirSync as m}from"fs";import{join as n}from"path";import{LOGGER_DEFAULTS as h}from"./types.js";import{getDefaultLogDir as a}from"./logDir.js";class p{mainLogger;appName;operationType;logStream=null;logPath;deploymentId;buffer=[];flushInterval=null;isClosing=!1;maxBufferSize=h.MAX_BUFFER_SIZE;constructor(t,e,i){this.mainLogger=t,this.appName=e,this.operationType=i,this.deploymentId=`${i}-${Date.now()}`;const o=a(),l=n(o,"deployments",e);f(l)||m(l,{recursive:!0});const s=new Date().toISOString().replace(/[:.]/g,"-"),r=`${i}-${s}.jsonl`;this.logPath=n(l,r);try{this.logStream=g(this.logPath,{flags:"a"}),this.flushInterval=setInterval(()=>this.flush(),h.FLUSH_INTERVAL_MS),this.info("DeploymentLogger","Deployment logging initialised",{appName:e,operationType:i,deploymentId:this.deploymentId,logPath:this.logPath})}catch{}}log(t,e,i,o,l,s){if(this.isClosing)return;const r={timestamp:new Date().toISOString(),level:t,component:e,message:i,correlationId:this.deploymentId,...o&&Object.keys(o).length>0&&{data:o},...l&&{stackName:l},...s&&{phase:s}};this.buffer.push(r),this.mainLogger.logWithCorrelation(t,e,i,this.deploymentId,o,l,s),this.buffer.length>=this.maxBufferSize&&this.flush()}flush(){if(!(this.buffer.length===0||!this.logStream)){for(const t of this.buffer)this.logStream.write(JSON.stringify(t)+`
2
+ `);this.buffer=[]}}info(t,e,i){this.log("info",t,e,i)}warn(t,e,i){this.log("warn",t,e,i)}error(t,e,i){this.log("error",t,e,i)}debug(t,e,i){this.log("debug",t,e,i)}stackEvent(t,e,i,o){this.log("info","StackDeployment",i,o,t,e)}dockerEvent(t,e){this.log("info","DockerOperation",t,{percentage:e})}ecsEvent(t,e,i){this.log("info","ECSDeployment",t,{percentage:e,taskCount:i})}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.logStream&&(this.logStream.end(),this.logStream=null),this.buffer=[],this.isClosing=!1}getLogPath(){return this.logPath}getDeploymentId(){return this.deploymentId}}export{p as DeploymentLoggerImpl};
@@ -0,0 +1,17 @@
1
+ import type { FileRotatorOptions } from "./types.js";
2
+ export declare class FileRotator {
3
+ private maxFiles;
4
+ constructor(options: FileRotatorOptions);
5
+ /**
6
+ * Check if a file needs rotation based on size
7
+ */
8
+ needsRotation(filePath: string, maxFileSize: number): boolean;
9
+ /** Rotate log files: current -> .1 -> .2 -> delete oldest */
10
+ rotate(filePath: string): void;
11
+ /** Check if rotation is needed and perform it if so */
12
+ rotateIfNeeded(filePath: string, maxFileSize: number): boolean;
13
+ /** Get all rotated file paths for a given log file */
14
+ getRotatedFiles(filePath: string): string[];
15
+ /** Clean up all log files (main and rotated) */
16
+ cleanAll(filePath: string): void;
17
+ }
@@ -0,0 +1 @@
1
+ import{existsSync as o,renameSync as m,unlinkSync as l,statSync as F,mkdirSync as y}from"fs";import{dirname as $,basename as d,extname as f,join as c}from"path";class S{maxFiles;constructor(t){this.maxFiles=t.maxFiles}needsRotation(t,s){try{return o(t)?F(t).size>s:!1}catch{return!1}}rotate(t){try{const s=$(t);if(!o(s)){y(s,{recursive:!0});return}if(!o(t))return;const e=f(t),r=d(t,e),a=c(s,`${r}.${this.maxFiles-1}${e}`);o(a)&&l(a);for(let n=this.maxFiles-2;n>=1;n--){const u=c(s,`${r}.${n}${e}`),x=c(s,`${r}.${n+1}${e}`);o(u)&&m(u,x)}const i=c(s,`${r}.1${e}`);m(t,i)}catch{}}rotateIfNeeded(t,s){return this.needsRotation(t,s)?(this.rotate(t),!0):!1}getRotatedFiles(t){const s=[],e=$(t),r=f(t),a=d(t,r);o(t)&&s.push(t);for(let i=1;i<this.maxFiles;i++){const n=c(e,`${a}.${i}${r}`);if(o(n))s.push(n);else break}return s}cleanAll(t){const s=this.getRotatedFiles(t);for(const e of s)try{l(e)}catch{}}}export{S as FileRotator};
@@ -0,0 +1,54 @@
1
+ import type { LogEntry, LoggerConfig } from "./types.js";
2
+ /**
3
+ * Manages file stream lifecycle: initialisation, buffered writing, rotation, and cleanup.
4
+ */
5
+ export declare class LogFileWriter {
6
+ private readonly config;
7
+ private readonly mainLogPath;
8
+ private readonly debugLogPath;
9
+ private debugEnabled;
10
+ private mainLogStream;
11
+ private debugLogStream;
12
+ private buffer;
13
+ private debugBuffer;
14
+ private flushInterval;
15
+ private isClosing;
16
+ private initialised;
17
+ private exitHandlerRegistered;
18
+ private fileRotator;
19
+ constructor(config: LoggerConfig, mainLogPath: string, debugLogPath: string, debugEnabled: boolean);
20
+ /**
21
+ * Whether the writer has been initialised
22
+ */
23
+ get isInitialised(): boolean;
24
+ /**
25
+ * Initialise file streams for logging.
26
+ * Called lazily on first log.
27
+ */
28
+ initialise(): void;
29
+ /**
30
+ * Create the debug log stream (used during init and when debug is enabled at runtime)
31
+ */
32
+ initialiseDebugStream(): void;
33
+ /**
34
+ * Update the debug-enabled flag (called when debug mode is toggled at runtime)
35
+ */
36
+ setDebugEnabled(enabled: boolean): void;
37
+ /**
38
+ * Buffer a log entry for writing
39
+ */
40
+ write(entry: LogEntry, isDebugLevel: boolean): void;
41
+ /**
42
+ * Flush a single buffer to its log file with rotation support.
43
+ * Returns the updated stream (may be new if rotation occurred).
44
+ */
45
+ private flushBuffer;
46
+ /**
47
+ * Flush buffered entries to files
48
+ */
49
+ flush(): void;
50
+ /**
51
+ * Close all log streams and flush buffers
52
+ */
53
+ close(): void;
54
+ }
@@ -0,0 +1,4 @@
1
+ import{createWriteStream as r,existsSync as a,mkdirSync as h}from"fs";import{FileRotator as n}from"./FileRotator.js";class u{config;mainLogPath;debugLogPath;debugEnabled;mainLogStream=null;debugLogStream=null;buffer=[];debugBuffer=[];flushInterval=null;isClosing=!1;initialised=!1;exitHandlerRegistered=!1;fileRotator;constructor(i,t,s,e){this.config=i,this.mainLogPath=t,this.debugLogPath=s,this.debugEnabled=e,this.fileRotator=new n({maxFiles:i.maxFiles})}get isInitialised(){return this.initialised}initialise(){if(!(this.initialised||this.isClosing))try{a(this.config.logDir)||h(this.config.logDir,{recursive:!0}),this.fileRotator.rotateIfNeeded(this.mainLogPath,this.config.maxFileSize),this.mainLogStream=r(this.mainLogPath,{flags:"a"}),this.debugEnabled&&this.initialiseDebugStream(),this.flushInterval=setInterval(()=>this.flush(),this.config.flushIntervalMs),this.exitHandlerRegistered||(process.on("exit",()=>{this.flush()}),this.exitHandlerRegistered=!0),this.initialised=!0}catch(i){process.stderr.write(`[fjall] Logger init failed: ${i instanceof Error?i.message:String(i)}
2
+ `)}}initialiseDebugStream(){if(!this.debugLogStream)try{a(this.config.debugLogDir)||h(this.config.debugLogDir,{recursive:!0}),this.fileRotator.rotateIfNeeded(this.debugLogPath,this.config.maxFileSize),this.debugLogStream=r(this.debugLogPath,{flags:"a"})}catch(i){process.stderr.write(`[fjall] Debug log init failed: ${i instanceof Error?i.message:String(i)}
3
+ `)}}setDebugEnabled(i){this.debugEnabled=i}write(i,t){this.isClosing||(this.initialised||this.initialise(),this.buffer.push(i),this.debugEnabled&&t&&this.debugBuffer.push(i),this.buffer.length>=this.config.maxBufferSize&&this.flush())}flushBuffer(i,t,s){if(i.length===0||!t)return{buffer:i,stream:t};let e=t;this.fileRotator.needsRotation(s,this.config.maxFileSize)&&(e.end(),this.fileRotator.rotate(s),e=r(s,{flags:"a"}));for(const f of i)e.write(JSON.stringify(f)+`
4
+ `);return{buffer:[],stream:e}}flush(){const i=this.flushBuffer(this.buffer,this.mainLogStream,this.mainLogPath);this.buffer=i.buffer,this.mainLogStream=i.stream;const t=this.flushBuffer(this.debugBuffer,this.debugLogStream,this.debugLogPath);this.debugBuffer=t.buffer,this.debugLogStream=t.stream}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.mainLogStream&&(this.mainLogStream.end(),this.mainLogStream=null),this.debugLogStream&&(this.debugLogStream.end(),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,this.isClosing=!1}}export{u as LogFileWriter};
@@ -0,0 +1,43 @@
1
+ import { CorrelatedLogger } from "./CorrelatedLogger.js";
2
+ import { type LoggerInterface } from "./DeploymentLogger.js";
3
+ import type { LogLevel, DeploymentLogger } from "./types.js";
4
+ /**
5
+ * Core Logger class - Singleton pattern
6
+ */
7
+ export declare class Logger implements LoggerInterface {
8
+ private static instance;
9
+ private config;
10
+ private debugEnabled;
11
+ private traceEnabled;
12
+ private minLevel;
13
+ private fileWriter;
14
+ private readonly mainLogPath;
15
+ private readonly debugLogPath;
16
+ private constructor();
17
+ private parseEnvInt;
18
+ static getInstance(): Logger;
19
+ private shouldLog;
20
+ private createEntry;
21
+ private log;
22
+ private writeConsole;
23
+ private getConsolePrefix;
24
+ error(component: string, message: string, data?: Record<string, unknown>): void;
25
+ warn(component: string, message: string, data?: Record<string, unknown>): void;
26
+ info(component: string, message: string, data?: Record<string, unknown>): void;
27
+ debug(component: string, message: string, data?: Record<string, unknown>): void;
28
+ trace(component: string, message: string, data?: Record<string, unknown>): void;
29
+ isDebugEnabled(): boolean;
30
+ isTraceEnabled(): boolean;
31
+ enableDebug(): void;
32
+ withCorrelation(correlationId: string): CorrelatedLogger;
33
+ forDeployment(appName: string, operationType?: string): DeploymentLogger;
34
+ close(): void;
35
+ getLogPath(): string;
36
+ getDebugLogPath(): string;
37
+ getLogDir(): string;
38
+ logWithCorrelation(level: LogLevel, component: string, message: string, correlationId: string, data?: Record<string, unknown>, stackName?: string, phase?: string): void;
39
+ /** Reset the singleton — primarily for tests. Callers that captured a
40
+ * reference via `Logger.getInstance()` before reset must re-acquire it. */
41
+ static reset(): void;
42
+ }
43
+ export { CorrelatedLogger } from "./CorrelatedLogger.js";
@@ -0,0 +1 @@
1
+ import{join as u}from"path";import{ContextManager as h}from"../../contexts/index.js";import{CorrelatedLogger as f}from"./CorrelatedLogger.js";import{LogFileWriter as E}from"./LogFileWriter.js";import{DeploymentLoggerImpl as b}from"./DeploymentLogger.js";import{LOG_LEVEL_PRIORITY as c,LOGGER_DEFAULTS as l}from"./types.js";import{getDefaultLogDir as d}from"./logDir.js";class s{static instance=null;config;debugEnabled;traceEnabled;minLevel;fileWriter;mainLogPath;debugLogPath;constructor(){const e=d(),t=u(e,"debug"),r=this.parseEnvInt("FJALL_LOG_MAX_SIZE",l.MAX_FILE_SIZE),i=this.parseEnvInt("FJALL_LOG_MAX_FILES",l.MAX_FILES);this.config={logDir:e,debugLogDir:t,maxFileSize:r,maxFiles:i,maxBufferSize:l.MAX_BUFFER_SIZE,flushIntervalMs:l.FLUSH_INTERVAL_MS},this.mainLogPath=u(e,l.LOG_FILENAME),this.debugLogPath=u(t,l.DEBUG_LOG_FILENAME),this.debugEnabled=process.env.FJALL_DEBUG==="true"||process.env.FJALL_TRACE==="true"||process.argv.includes("--verbose")||process.argv.includes("-v"),this.traceEnabled=process.env.FJALL_TRACE==="true";const n=process.env.FJALL_LOG_LEVEL?.toLowerCase();n&&n in c?this.minLevel=n:this.traceEnabled?this.minLevel="trace":this.debugEnabled?this.minLevel="debug":this.minLevel="info",this.fileWriter=new E(this.config,this.mainLogPath,this.debugLogPath,this.debugEnabled)}parseEnvInt(e,t){const r=process.env[e];if(r){const i=parseInt(r,10);if(!isNaN(i)&&i>0)return i}return t}static getInstance(){return s.instance||(s.instance=new s),s.instance}shouldLog(e){return c[e]>=c[this.minLevel]}createEntry(e,t,r,i,n,o,a){return{timestamp:new Date().toISOString(),level:e,component:t,message:r,...n&&{correlationId:n},...i&&Object.keys(i).length>0&&{data:i},...o&&{stackName:o},...a&&{phase:a}}}log(e,t,r,i,n,o,a){if(!this.shouldLog(e))return;const g=this.createEntry(e,t,r,i,n,o,a),L=e==="debug"||e==="trace";this.fileWriter.write(g,L),this.writeConsole(g)}writeConsole(e){if(h.shouldSuppressOutput||h.isNonInteractive)return;const t=this.getConsolePrefix(e.level),r=`[${e.component}]`,i=`${t} ${r} ${e.message}`;e.level==="error"?console.error(i):e.level==="warn"?console.warn(i):console.log(i)}getConsolePrefix(e){switch(e){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(e,t,r){this.log("error",e,t,r)}warn(e,t,r){this.log("warn",e,t,r)}info(e,t,r){this.log("info",e,t,r)}debug(e,t,r){this.log("debug",e,t,r)}trace(e,t,r){this.log("trace",e,t,r)}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,c[this.minLevel]>c.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(e){return new f(this,e)}forDeployment(e,t="deploy"){return new b(this,e,t)}close(){this.fileWriter.close()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(e,t,r,i,n,o,a){this.log(e,t,r,n,i,o,a)}static reset(){s.instance&&(s.instance.close(),s.instance=null)}}import{CorrelatedLogger as S}from"./CorrelatedLogger.js";export{S as CorrelatedLogger,s as Logger};
@@ -0,0 +1,15 @@
1
+ import { Logger, CorrelatedLogger } from "./Logger.js";
2
+ import { FileRotator } from "./FileRotator.js";
3
+ import type { LogEntry, LogLevel, DeploymentLogger, LoggerConfig } from "./types.js";
4
+ export { getDefaultLogDir } from "./logDir.js";
5
+ export declare const logger: Logger;
6
+ export { Logger, CorrelatedLogger };
7
+ export { FileRotator };
8
+ export { DeploymentLoggerImpl } from "./DeploymentLogger.js";
9
+ export type { LogLevel, LogEntry, DeploymentLogger, LoggerConfig };
10
+ export { LOG_LEVEL_PRIORITY } from "./types.js";
11
+ /**
12
+ * Write to debug file synchronously (for crash handlers)
13
+ * This is a fallback for emergency situations only
14
+ */
15
+ export declare function writeDebugSync(message: string): void;
@@ -0,0 +1,2 @@
1
+ import{existsSync as e,mkdirSync as p,statSync as a,appendFileSync as f}from"fs";import{join as n}from"path";import{Logger as i,CorrelatedLogger as L}from"./Logger.js";import{FileRotator as m}from"./FileRotator.js";import{LOGGER_DEFAULTS as r}from"./types.js";import{getDefaultLogDir as l}from"./logDir.js";import{getDefaultLogDir as G}from"./logDir.js";const d=i.getInstance();import{DeploymentLoggerImpl as R}from"./DeploymentLogger.js";import{LOG_LEVEL_PRIORITY as M}from"./types.js";function F(g){const s=l(),o=n(s,"debug"),t=n(o,r.DEBUG_LOG_FILENAME);try{e(o)||p(o,{recursive:!0}),e(t)&&a(t).size>r.MAX_FILE_SIZE&&new m({maxFiles:r.MAX_FILES}).rotate(t);const c={timestamp:new Date().toISOString(),level:"debug",component:"Emergency",message:g};f(t,JSON.stringify(c)+`
2
+ `)}catch{}}export{L as CorrelatedLogger,R as DeploymentLoggerImpl,m as FileRotator,M as LOG_LEVEL_PRIORITY,i as Logger,G as getDefaultLogDir,d as logger,F as writeDebugSync};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Get the default log directory path.
3
+ * Checks FJALL_LOG_DIR environment variable, falling back to ~/.fjall/logs.
4
+ */
5
+ export declare function getDefaultLogDir(): string;
@@ -0,0 +1 @@
1
+ import{join as r}from"path";import{homedir as e}from"os";function t(){const o=process.env.FJALL_LOG_DIR;return o!==void 0&&o!==""?o:r(e(),".fjall","logs")}export{t as getDefaultLogDir};
@@ -0,0 +1,48 @@
1
+ export type LogLevel = "trace" | "debug" | "info" | "warn" | "error";
2
+ export declare const LOG_LEVEL_PRIORITY: Record<LogLevel, number>;
3
+ export interface LogEntry {
4
+ timestamp: string;
5
+ level: LogLevel;
6
+ component: string;
7
+ message: string;
8
+ correlationId?: string;
9
+ data?: Record<string, unknown>;
10
+ stackName?: string;
11
+ phase?: string;
12
+ source?: string;
13
+ }
14
+ export interface LoggerConfig {
15
+ logDir: string;
16
+ debugLogDir: string;
17
+ maxFileSize: number;
18
+ maxFiles: number;
19
+ maxBufferSize: number;
20
+ flushIntervalMs: number;
21
+ }
22
+ export interface DeploymentLogger {
23
+ info(component: string, message: string, data?: Record<string, unknown>): void;
24
+ warn(component: string, message: string, data?: Record<string, unknown>): void;
25
+ error(component: string, message: string, data?: Record<string, unknown>): void;
26
+ debug(component: string, message: string, data?: Record<string, unknown>): void;
27
+ stackEvent(stackName: string, phase: string, message: string, data?: Record<string, unknown>): void;
28
+ dockerEvent(message: string, percentage?: number): void;
29
+ ecsEvent(message: string, percentage?: number, taskCount?: {
30
+ running: number;
31
+ desired: number;
32
+ pending?: number;
33
+ }): void;
34
+ close(): void;
35
+ getLogPath(): string;
36
+ getDeploymentId(): string;
37
+ }
38
+ export interface FileRotatorOptions {
39
+ maxFiles: number;
40
+ }
41
+ export declare const LOGGER_DEFAULTS: {
42
+ readonly MAX_FILE_SIZE: number;
43
+ readonly MAX_FILES: 5;
44
+ readonly MAX_BUFFER_SIZE: 100;
45
+ readonly FLUSH_INTERVAL_MS: 500;
46
+ readonly LOG_FILENAME: "fjall.jsonl";
47
+ readonly DEBUG_LOG_FILENAME: "fjall-debug.jsonl";
48
+ };
@@ -0,0 +1 @@
1
+ const E={trace:0,debug:1,info:2,warn:3,error:4},L={MAX_FILE_SIZE:10*1024*1024,MAX_FILES:5,MAX_BUFFER_SIZE:100,FLUSH_INTERVAL_MS:500,LOG_FILENAME:"fjall.jsonl",DEBUG_LOG_FILENAME:"fjall-debug.jsonl"};export{L as LOGGER_DEFAULTS,E as LOG_LEVEL_PRIORITY};
@@ -0,0 +1,3 @@
1
+ export { OutputWriter, NoopOutputWriter, STEP_STATUS, ORG_SETUP_LABELS, PREPARE_LABELS, PRE_DEPLOY_LABELS, type SummaryOptions } from "./nonInteractiveOutput.js";
2
+ export { type NonInteractiveOutput, createNonInteractiveOutput } from "./nonInteractiveCallbacks.js";
3
+ export { CASCADE_COLUMN_WIDTH, PARALLEL_PREFIX } from "./nonInteractiveLabels.js";
@@ -0,0 +1 @@
1
+ import{OutputWriter as E,NoopOutputWriter as L,STEP_STATUS as e,ORG_SETUP_LABELS as o,PREPARE_LABELS as A,PRE_DEPLOY_LABELS as _}from"./nonInteractiveOutput.js";import{createNonInteractiveOutput as S}from"./nonInteractiveCallbacks.js";import{CASCADE_COLUMN_WIDTH as u,PARALLEL_PREFIX as O}from"./nonInteractiveLabels.js";export{u as CASCADE_COLUMN_WIDTH,L as NoopOutputWriter,o as ORG_SETUP_LABELS,E as OutputWriter,O as PARALLEL_PREFIX,A as PREPARE_LABELS,_ as PRE_DEPLOY_LABELS,e as STEP_STATUS,S as createNonInteractiveOutput};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Callback wiring for non-interactive output.
3
+ *
4
+ * Bridges the OutputWriter (presentation) with the CLI callback interfaces.
5
+ * Deployment events are streamed to the webapp via DeploymentTracker, not here.
6
+ */
7
+ import type { ApplicationCallbacks, OrganisationCallbacks } from "../../types/callbacks.js";
8
+ import { OutputWriter } from "./nonInteractiveOutput.js";
9
+ /**
10
+ * Factory: returns both callbacks and writer for summary rendering.
11
+ */
12
+ export interface NonInteractiveOutput {
13
+ callbacks: ApplicationCallbacks & OrganisationCallbacks;
14
+ writer: OutputWriter;
15
+ }
16
+ export declare function createNonInteractiveOutput(options: {
17
+ verbose?: boolean;
18
+ }): NonInteractiveOutput;
@@ -0,0 +1 @@
1
+ import{getReportVersionService as u}from"../../services/index.js";import{logger as p}from"../logger/index.js";import{maskSensitiveOutput as s}from"@fjall/util";import{OutputWriter as r}from"./nonInteractiveOutput.js";function P(o){p.debug("NonInteractiveOutput","createNonInteractiveOutput called",{verbose:o.verbose});const n=new r({...o,versionUpdate:u().getUpdate()});return{callbacks:d(n,o),writer:n}}function d(o,n){return{verbose:n.verbose,onProgress:e=>{const t=s(e.message);e.type==="error"||e.type==="warning"?o.log(t,"warn"):e.type!=="debug"&&o.log(t,"info")},onSSOUrl:e=>o.ssoUrl(e),onAuthComplete:()=>o.authComplete(),onStepStart:(e,t,a,c)=>{o.stepStart(e,t,a,c)},onStepComplete:(e,t,a,c,l)=>{o.stepComplete(e,t,a,c,l)},onResourceProgress:e=>{const t=e.statusReason?{...e,statusReason:s(e.statusReason)}:e;o.resourceProgress(t)},onCDKBootstrap:()=>{},onCdkOutput:e=>o.cdkOutput(s(e)),onOutput:e=>o.cdkOutput(s(e)),onLog:(e,t)=>{o.log(s(e),t)},onConfirmRequired:async()=>!0,onSecretsConfirmRequired:async e=>(o.secretsWarning(e),!0),onAccountDetected:e=>o.accountDetected(e),onConfigurationDetected:e=>o.configurationDetected(e),onPreDeploymentProgress:e=>{o.preDeploymentProgress(e)},onDockerProgress:(e,t)=>{o.dockerProgress(s(e),t)},onECSUpdate:e=>{o.ecsUpdate(s(e))},onECSProgress:(e,t)=>{o.ecsProgress(s(e),t)},onOpenNextBuildStart:()=>{o.indent("[opennext] Build starting...")},onOpenNextProgress:(e,t,a)=>{o.openNextProgress(s(e),t,a)},onOpenNextBuildComplete:()=>{o.indent("[opennext] Build completed")},onOpenNextBuildError:e=>{o.indent(`[opennext] Build failed: ${s(e)}`)},onStackCleanupProgress:(e,t)=>{o.indent(`[cleanup] ${s(e)}: ${s(t)}`)},onParallelDeployStart:e=>{o.parallelDeployStart(e)},onParallelStackStart:e=>{o.parallelStackStart(e)},onParallelStackComplete:(e,t,a)=>{o.parallelStackComplete(e,t,a)},onParallelStackProgress:(e,t)=>{const a=t.statusReason?{...t,statusReason:s(t.statusReason)}:t;o.resourceProgress(a)},onParallelDeployComplete:(e,t)=>{o.parallelDeployComplete(t)},onOrgSetupProgress:e=>{o.orgSetupProgress(e)},onChangeDetectionComplete:e=>o.changeDetectionComplete(e),onCascadeStart:()=>{},onCascadePhaseStart:e=>{o.cascadePhaseStart(e)},onCascadeAccountStart:(e,t,a)=>{o.cascadeAccountStart(e,t,a)},onCascadeAccountPhaseChange:(e,t,a)=>{o.cascadeAccountPhaseChange(e,t,a)},onCascadeAccountResourceProgress:(e,t,a)=>{o.cascadeAccountResourceProgress(e,t,a)},onCascadeAccountComplete:(e,t,a)=>{o.cascadeAccountComplete(e,t,a&&s(a))},onCascadeComplete:e=>{o.cascadeComplete(e)}}}export{P as createNonInteractiveOutput};
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Deployment progress, cascade, and parallel rendering for non-interactive output.
3
+ *
4
+ * Extracted from nonInteractiveOutput.ts for file-size compliance.
5
+ */
6
+ import type { OrgSetupEventType, PreDeploymentEventType } from "../../types/callbacks.js";
7
+ /** Minimal interface for output primitives that the rendering functions need. */
8
+ export interface OutputPrimitives {
9
+ line(text: string): void;
10
+ indent(text: string, level?: number): void;
11
+ formatDuration(ms: number): string;
12
+ }
13
+ export declare function renderParallelDeployStart(out: OutputPrimitives, stacks: readonly string[]): void;
14
+ export declare function renderParallelStackStart(out: OutputPrimitives, timers: Map<string, number>, stack: string): void;
15
+ export declare function renderParallelStackComplete(out: OutputPrimitives, timers: Map<string, number>, stack: string, status: string, error?: string): void;
16
+ export declare function renderParallelDeployComplete(out: OutputPrimitives, allSuccessful: boolean): void;
17
+ export declare function renderCascadeAccountStart(out: OutputPrimitives, timers: Map<string, number>, operationKey: string, verbose: boolean): void;
18
+ export declare function renderCascadeAccountPhaseChange(out: OutputPrimitives, operationKey: string, phase: "bootstrap" | "synth" | "deploy" | "destroy", verbose: boolean): void;
19
+ export declare function renderCascadeAccountResourceProgress(out: OutputPrimitives, operationKey: string, event: {
20
+ logicalId?: string;
21
+ resourceType?: string;
22
+ status?: string;
23
+ statusReason?: string;
24
+ }, verbose: boolean): void;
25
+ export declare function renderCascadeAccountComplete(out: OutputPrimitives, timers: Map<string, number>, operationKey: string, success: boolean, verbose: boolean, error?: string): void;
26
+ export declare function renderOrgSetupProgress(out: OutputPrimitives, event: {
27
+ type: OrgSetupEventType;
28
+ phase: string;
29
+ message?: string;
30
+ detail?: string;
31
+ }, verbose: boolean): void;
32
+ export declare function renderChangeDetectionComplete(out: OutputPrimitives, changes: {
33
+ hasOrgChanges: boolean;
34
+ hasPlatformChanges: boolean;
35
+ hasAccountChanges: boolean;
36
+ hasMemberAccounts: boolean;
37
+ hasPlatformAccount: boolean;
38
+ hasDomainChanges: boolean;
39
+ hasDomainConfiguration: boolean;
40
+ }): void;
41
+ export declare function renderPreDeploymentProgress(out: OutputPrimitives, event: {
42
+ type: PreDeploymentEventType;
43
+ phase: string;
44
+ message?: string;
45
+ }, verbose: boolean): void;
46
+ export declare function renderResourceProgress(out: OutputPrimitives, event: {
47
+ logicalId?: string;
48
+ resourceType?: string;
49
+ status?: string;
50
+ statusReason?: string;
51
+ }, verbose: boolean): void;
@@ -0,0 +1 @@
1
+ import o from"chalk";import{theme as $}from"../theme.js";import{formatResourceStatus as h,getFriendlyResourceType as u}from"../../aws/utils/cloudformationEvents.js";import{logger as p}from"../logger/index.js";import{CASCADE_COLUMN_WIDTH as m,PARALLEL_PREFIX as l,ORG_SETUP_LABELS as f,PREPARE_LABELS as g,PRE_DEPLOY_LABELS as C}from"./nonInteractiveLabels.js";const t=$.colours;function y(s,e){const r=e.join(", ");s.indent(`${l} Deploying: ${r}`)}function L(s,e,r){e.set(r,Date.now()),s.indent(`${l} ${r.padEnd(22)} starting`)}function S(s,e,r,n,i){const d=n==="complete"?o.hex(t.completed)("\u2713"):n==="failed"?o.hex(t.error)("\u2717"):o.hex(t.dim)("\u25CB"),a=e.get(r),c=a?s.formatDuration(Date.now()-a):"",x=c?` ${o.hex(t.dim)(`(${c})`)}`:"";s.indent(`${l} ${r.padEnd(22)} ${d} ${n}${x}`),i&&s.indent(o.hex(t.error)(i),2)}function T(s,e){s.indent(`${l} Phase ${e?"completed":"completed with errors"}`)}function I(s,e,r,n){e.set(r,Date.now()),p.debug("OutputWriter","cascadeAccountStart called",{operationKey:r,verbose:n}),n&&s.indent(`${r.padEnd(m)} starting`)}function O(s,e,r,n){p.debug("OutputWriter","cascadeAccountPhaseChange called",{operationKey:e,phase:r,verbose:n}),n&&s.indent(`${e.padEnd(m)} ${r}`)}function _(s,e,r,n){if(n&&r.logicalId&&r.status){const{symbol:i,colour:d}=h(r.status),a=r.resourceType?u(r.resourceType):"",c=r.statusReason&&r.status.includes("FAILED")?o.hex(t.error)(` - ${r.statusReason}`):"";s.indent(`${e.padEnd(m)} ${o.hex(d)(i)} ${a}${o.hex(t.dim)(` \xB7 ${r.logicalId}`)}${c}`)}}function b(s,e,r,n,i,d){p.debug("OutputWriter","cascadeAccountComplete called",{operationKey:r,success:n,verbose:i});const a=e.get(r),c=a?s.formatDuration(Date.now()-a):"";n?s.indent(o.hex(t.completed)("\u2713")+` ${r}`+(c?` ${o.hex(t.dim)(c)}`:"")):(s.indent(o.hex(t.error)("\u2717")+` ${r}`+(c?` ${o.hex(t.dim)(c)}`:"")),d&&s.indent(o.hex(t.error)(d),2))}function w(s,e,r){const n=f[e.type]??g[e.type]??e.type;e.phase==="complete"?s.indent(o.hex(t.completed)("\u2713")+` ${n}`):e.phase==="skipped"?s.indent(o.hex(t.dim)("\u2212")+` ${o.hex(t.dim)(n)}`+o.hex(t.dim)(" skipped")):e.phase==="error"?s.indent(o.hex(t.error)("\u2717")+` ${o.hex(t.error)(n)}`+(e.message?` ${o.hex(t.error)(e.message)}`:"")):e.phase==="started"&&r&&s.indent(o.hex(t.dim)("\u25CB")+` ${n}`)}function k(s,e){const r=e.hasOrgChanges?o.hex(t.completed)("\u2713"):o.hex(t.dim)("\u2212"),n=e.hasPlatformChanges?o.hex(t.completed)("\u2713"):o.hex(t.dim)("\u2212"),i=e.hasDomainChanges?o.hex(t.completed)("\u2713"):o.hex(t.dim)("\u2212"),d=e.hasAccountChanges?o.hex(t.completed)("\u2713"):o.hex(t.dim)("\u2212"),a=[`organisation ${r}`,`platform ${n}`];e.hasDomainConfiguration&&a.push(`domains ${i}`),a.push(`accounts ${d}`),s.indent(`Changes: ${a.join(" ")}`)}function F(s,e,r){const n=C[e.type]??e.type;e.phase==="started"?r&&s.indent(o.hex(t.dim)("\u25CB")+` ${n}`):e.phase==="complete"?s.indent(o.hex(t.completed)("\u2713")+` ${n}`):e.phase==="error"?s.indent(o.hex(t.error)("\u2717")+` ${n}`+(e.message?`: ${e.message}`:"")):e.phase==="skipped"&&s.indent(o.hex(t.dim)("\u2212")+` ${o.hex(t.dim)(n)}`)}function W(s,e,r){if(r&&e.status&&e.logicalId){const{symbol:n,colour:i}=h(e.status),d=e.resourceType?u(e.resourceType):"",a=e.statusReason&&e.status.includes("FAILED")?o.hex(t.error)(` - ${e.statusReason}`):"";s.indent(`${o.hex(i)(n)} ${d}${o.hex(t.dim)(` \xB7 ${e.logicalId}`)}${a}`)}}export{b as renderCascadeAccountComplete,O as renderCascadeAccountPhaseChange,_ as renderCascadeAccountResourceProgress,I as renderCascadeAccountStart,k as renderChangeDetectionComplete,w as renderOrgSetupProgress,T as renderParallelDeployComplete,y as renderParallelDeployStart,S as renderParallelStackComplete,L as renderParallelStackStart,F as renderPreDeploymentProgress,W as renderResourceProgress};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Label constants and shared types for non-interactive output.
3
+ *
4
+ * Extracted from nonInteractiveOutput.ts to keep file sizes manageable.
5
+ */
6
+ import type { CascadeDeploymentResult } from "../../services/deployment/CascadeUtils.js";
7
+ import type { OrgSetupEventType, PreDeploymentEventType } from "../../types/callbacks.js";
8
+ export declare const CASCADE_COLUMN_WIDTH = 35;
9
+ export declare const PARALLEL_PREFIX = "[parallel]";
10
+ export declare const ORG_SETUP_LABELS: Readonly<Partial<Record<OrgSetupEventType, string>>>;
11
+ export declare const PREPARE_LABELS: Readonly<Partial<Record<OrgSetupEventType, string>>>;
12
+ export declare const PRE_DEPLOY_LABELS: Readonly<Record<PreDeploymentEventType, string>>;
13
+ export interface SummaryOptions {
14
+ operation: string;
15
+ target: string;
16
+ success: boolean;
17
+ duration: number;
18
+ url?: string;
19
+ cascadeResult?: CascadeDeploymentResult | null;
20
+ details?: Record<string, string>;
21
+ /** Custom past tense verb (e.g. "configured", "restored"). Falls back to built-in map then "<operation> completed". */
22
+ verb?: string;
23
+ }
@@ -0,0 +1 @@
1
+ const e=35,t="[parallel]",a=Object.freeze({"org-ensure":"Organisation exists","policy-types":"Policy types enabled","service-access":"Service access enabled","ram-sharing":"RAM sharing enabled","trusted-access":"CloudFormation trusted access","ipam-delegate":"IPAM delegated admin","backup-settings":"Backup global settings","create-accounts":"Creating accounts","ensure-ous":"Organisational units",accounts:"Retrieving accounts","place-accounts":"Placing accounts in OUs","cost-tags":"Cost allocation tags","identity-centre":"Identity Centre","security-delegates":"Delegating security services","domain-setup":"Configuring domains","synth-domains":"Synthesising domains"}),n=Object.freeze({"cfn-check":"Checking infrastructure state",synth:"Synthesising organisation","synth-platform":"Synthesising platform","synth-accounts":"Synthesising accounts","hash-compare":"Comparing template hashes"}),s=Object.freeze({detect:"Detecting application pattern",config:"Configuring Payload for AWS",migrate:"Creating database migrations",importmap:"Generating Payload import map",build:"Building Next.js application",synth:"Synthesising infrastructure",hash:"Comparing template hashes",docker:"Validating Docker configuration",validate:"Validating SSM secrets"});export{e as CASCADE_COLUMN_WIDTH,a as ORG_SETUP_LABELS,t as PARALLEL_PREFIX,n as PREPARE_LABELS,s as PRE_DEPLOY_LABELS};