@ankhorage/deploy 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/cli/DeployCliEnvironment.d.ts +16 -2
  4. package/dist/cli/DeployCliEnvironment.d.ts.map +1 -1
  5. package/dist/cli/DeployCliEnvironment.js +16 -2
  6. package/dist/cli/DeployCliEnvironment.js.map +1 -1
  7. package/dist/cli/DeployCliExecutionOutcome.d.ts +7 -0
  8. package/dist/cli/DeployCliExecutionOutcome.d.ts.map +1 -0
  9. package/dist/cli/DeployCliExecutionOutcome.js +2 -0
  10. package/dist/cli/DeployCliExecutionOutcome.js.map +1 -0
  11. package/dist/cli/DeployCliExitCode.d.ts +4 -0
  12. package/dist/cli/DeployCliExitCode.d.ts.map +1 -0
  13. package/dist/cli/DeployCliExitCode.js +2 -0
  14. package/dist/cli/DeployCliExitCode.js.map +1 -0
  15. package/dist/cli/DeployCliExitCodes.d.ts +19 -0
  16. package/dist/cli/DeployCliExitCodes.d.ts.map +1 -0
  17. package/dist/cli/DeployCliExitCodes.js +19 -0
  18. package/dist/cli/DeployCliExitCodes.js.map +1 -0
  19. package/dist/cli/DeployCliInspectionResult.d.ts +12 -0
  20. package/dist/cli/DeployCliInspectionResult.d.ts.map +1 -0
  21. package/dist/cli/DeployCliInspectionResult.js +2 -0
  22. package/dist/cli/DeployCliInspectionResult.js.map +1 -0
  23. package/dist/cli/DeployCliJsonEnvelope.d.ts +34 -0
  24. package/dist/cli/DeployCliJsonEnvelope.d.ts.map +1 -0
  25. package/dist/cli/DeployCliJsonEnvelope.js +2 -0
  26. package/dist/cli/DeployCliJsonEnvelope.js.map +1 -0
  27. package/dist/cli/DeployCliPlanOutcome.d.ts +6 -0
  28. package/dist/cli/DeployCliPlanOutcome.d.ts.map +1 -0
  29. package/dist/cli/DeployCliPlanOutcome.js +2 -0
  30. package/dist/cli/DeployCliPlanOutcome.js.map +1 -0
  31. package/dist/cli/createDeployCliConfirmationEnvelope.d.ts +5 -0
  32. package/dist/cli/createDeployCliConfirmationEnvelope.d.ts.map +1 -0
  33. package/dist/cli/createDeployCliConfirmationEnvelope.js +21 -0
  34. package/dist/cli/createDeployCliConfirmationEnvelope.js.map +1 -0
  35. package/dist/cli/createDeployCliExecutionEnvelope.d.ts +5 -0
  36. package/dist/cli/createDeployCliExecutionEnvelope.d.ts.map +1 -0
  37. package/dist/cli/createDeployCliExecutionEnvelope.js +35 -0
  38. package/dist/cli/createDeployCliExecutionEnvelope.js.map +1 -0
  39. package/dist/cli/createDeployCliFailureEnvelope.d.ts +4 -0
  40. package/dist/cli/createDeployCliFailureEnvelope.d.ts.map +1 -0
  41. package/dist/cli/createDeployCliFailureEnvelope.js +13 -0
  42. package/dist/cli/createDeployCliFailureEnvelope.js.map +1 -0
  43. package/dist/cli/createDeployCliPlanEnvelope.d.ts +6 -0
  44. package/dist/cli/createDeployCliPlanEnvelope.d.ts.map +1 -0
  45. package/dist/cli/createDeployCliPlanEnvelope.js +20 -0
  46. package/dist/cli/createDeployCliPlanEnvelope.js.map +1 -0
  47. package/dist/cli/getDeployCliExecutionOutcome.d.ts +4 -0
  48. package/dist/cli/getDeployCliExecutionOutcome.d.ts.map +1 -0
  49. package/dist/cli/getDeployCliExecutionOutcome.js +19 -0
  50. package/dist/cli/getDeployCliExecutionOutcome.js.map +1 -0
  51. package/dist/cli/getDeployCliPlanOutcome.d.ts +5 -0
  52. package/dist/cli/getDeployCliPlanOutcome.d.ts.map +1 -0
  53. package/dist/cli/getDeployCliPlanOutcome.js +17 -0
  54. package/dist/cli/getDeployCliPlanOutcome.js.map +1 -0
  55. package/dist/cli/handleDeployCliCommand.d.ts.map +1 -1
  56. package/dist/cli/handleDeployCliCommand.js +68 -29
  57. package/dist/cli/handleDeployCliCommand.js.map +1 -1
  58. package/dist/cli/handleDeployCliPlan.d.ts.map +1 -1
  59. package/dist/cli/handleDeployCliPlan.js +8 -6
  60. package/dist/cli/handleDeployCliPlan.js.map +1 -1
  61. package/dist/cli/index.d.ts +3 -0
  62. package/dist/cli/index.d.ts.map +1 -1
  63. package/dist/cli/index.js +2 -0
  64. package/dist/cli/index.js.map +1 -1
  65. package/dist/cli/inspectDeployCliRelease.d.ts +2 -13
  66. package/dist/cli/inspectDeployCliRelease.d.ts.map +1 -1
  67. package/dist/cli/inspectDeployCliRelease.js.map +1 -1
  68. package/dist/cli/mapDeployCliPlan.d.ts +1 -1
  69. package/dist/cli/mapDeployCliPlan.d.ts.map +1 -1
  70. package/dist/cli/mapDeployCliPlan.js +5 -4
  71. package/dist/cli/mapDeployCliPlan.js.map +1 -1
  72. package/dist/cli/redactDeployCliActions.d.ts +3 -0
  73. package/dist/cli/redactDeployCliActions.d.ts.map +1 -0
  74. package/dist/cli/redactDeployCliActions.js +9 -0
  75. package/dist/cli/redactDeployCliActions.js.map +1 -0
  76. package/dist/cli/redactDeployCliFailure.d.ts +3 -0
  77. package/dist/cli/redactDeployCliFailure.d.ts.map +1 -0
  78. package/dist/cli/redactDeployCliFailure.js +5 -0
  79. package/dist/cli/redactDeployCliFailure.js.map +1 -0
  80. package/dist/cli/redactDeployCliPlan.d.ts +3 -0
  81. package/dist/cli/redactDeployCliPlan.d.ts.map +1 -0
  82. package/dist/cli/redactDeployCliPlan.js +11 -0
  83. package/dist/cli/redactDeployCliPlan.js.map +1 -0
  84. package/dist/cli/redactDeployCliText.d.ts +2 -0
  85. package/dist/cli/redactDeployCliText.d.ts.map +1 -0
  86. package/dist/cli/redactDeployCliText.js +61 -0
  87. package/dist/cli/redactDeployCliText.js.map +1 -0
  88. package/dist/cli/renderDeployCliExecution.d.ts +1 -1
  89. package/dist/cli/renderDeployCliExecution.d.ts.map +1 -1
  90. package/dist/cli/renderDeployCliExecution.js +1 -4
  91. package/dist/cli/renderDeployCliExecution.js.map +1 -1
  92. package/dist/cli/renderDeployCliPlan.d.ts +1 -1
  93. package/dist/cli/renderDeployCliPlan.d.ts.map +1 -1
  94. package/dist/cli/renderDeployCliPlan.js +1 -12
  95. package/dist/cli/renderDeployCliPlan.js.map +1 -1
  96. package/dist/cli/writeDeployCliHuman.d.ts +3 -0
  97. package/dist/cli/writeDeployCliHuman.d.ts.map +1 -0
  98. package/dist/cli/writeDeployCliHuman.js +9 -0
  99. package/dist/cli/writeDeployCliHuman.js.map +1 -0
  100. package/dist/cli/writeDeployCliJson.d.ts +4 -0
  101. package/dist/cli/writeDeployCliJson.d.ts.map +1 -0
  102. package/dist/cli/writeDeployCliJson.js +4 -0
  103. package/dist/cli/writeDeployCliJson.js.map +1 -0
  104. package/package.json +1 -1
@@ -1,28 +1,58 @@
1
+ import { createDeployCliConfirmationEnvelope } from './createDeployCliConfirmationEnvelope.js';
2
+ import { createDeployCliExecutionEnvelope } from './createDeployCliExecutionEnvelope.js';
3
+ import { createDeployCliFailureEnvelope } from './createDeployCliFailureEnvelope.js';
4
+ import { createDeployCliPlanEnvelope } from './createDeployCliPlanEnvelope.js';
5
+ import { DEPLOY_CLI_EXIT_CODES } from './DeployCliExitCodes.js';
6
+ import { getDeployCliExecutionOutcome } from './getDeployCliExecutionOutcome.js';
7
+ import { getDeployCliPlanOutcome } from './getDeployCliPlanOutcome.js';
1
8
  import { inspectDeployCliRelease } from './inspectDeployCliRelease.js';
2
9
  import { parseDeployCliOptions } from './parseDeployCliOptions.js';
3
10
  import { renderDeployCliExecution } from './renderDeployCliExecution.js';
4
11
  import { renderDeployCliFailure } from './renderDeployCliFailure.js';
5
12
  import { renderDeployCliPlan } from './renderDeployCliPlan.js';
13
+ import { writeDeployCliHuman } from './writeDeployCliHuman.js';
14
+ import { writeDeployCliJson } from './writeDeployCliJson.js';
6
15
  export async function handleDeployCliCommand(input, runtime) {
7
16
  const parsed = parseDeployCliOptions(input.argv, input.context.cwd);
8
- if (!parsed.ok)
9
- return fail(input, `Deploy CLI: ${parsed.message}\n`);
17
+ if (!parsed.ok) {
18
+ return reportFailure(input, requestedFormat(input.argv), 'input', {
19
+ code: 'DEPLOY_CLI_INVALID_ARGUMENT',
20
+ message: parsed.message,
21
+ });
22
+ }
10
23
  const inspected = await inspectDeployCliRelease(parsed.options, input.context.env, runtime);
11
24
  if (!inspected.ok)
12
- return fail(input, renderDeployCliFailure(inspected.failure));
13
- input.context.writeStdout(renderDeployCliPlan(inspected.inspection, inspected.plan, parsed.options.format));
14
- const early = earlyResult(parsed.options, inspected.plan);
15
- if (early !== null)
16
- return early;
17
- const confirmation = await confirmMutation(input, parsed.options, inspected.plan);
25
+ return reportFailure(input, parsed.options.format, 'inspect', inspected.failure);
26
+ return handleInspectedDeploy(input, parsed.options, inspected, runtime);
27
+ }
28
+ async function handleInspectedDeploy(input, options, inspected, runtime) {
29
+ if (options.format === 'human') {
30
+ writeDeployCliHuman(input, 'stdout', renderDeployCliPlan(inspected.inspection, inspected.plan));
31
+ }
32
+ const outcome = getDeployCliPlanOutcome(inspected.inspection, inspected.plan);
33
+ if (options.dryRun || outcome.status !== 'planned') {
34
+ return reportPlanOutcome(input, options, inspected, outcome);
35
+ }
36
+ if (options.format === 'json' && !options.yes) {
37
+ writeDeployCliJson(input, createDeployCliConfirmationEnvelope(inspected.inspection, inspected.plan, input.context.env));
38
+ return { exitCode: DEPLOY_CLI_EXIT_CODES.confirmationRequired };
39
+ }
40
+ return confirmAndExecute(input, options, inspected, runtime);
41
+ }
42
+ async function confirmAndExecute(input, options, inspected, runtime) {
43
+ const confirmation = await confirmMutation(input, options, inspected.plan);
18
44
  if (confirmation === 'declined') {
19
- input.context.writeStderr('Deployment cancelled; no mutation was performed.\n');
20
- return { exitCode: 0 };
45
+ writeDeployCliHuman(input, 'stderr', 'Deployment cancelled; no mutation was performed.\n');
46
+ return { exitCode: DEPLOY_CLI_EXIT_CODES.declined };
21
47
  }
22
48
  if (confirmation !== 'confirmed') {
23
- return fail(input, 'Deployment requires confirmation. Use --yes for explicit non-interactive approval or --dry-run to inspect only.\n');
49
+ writeDeployCliHuman(input, 'stderr', 'Deployment requires confirmation. Use --yes for explicit non-interactive approval or --dry-run to inspect only.\n');
50
+ return { exitCode: DEPLOY_CLI_EXIT_CODES.confirmationRequired };
24
51
  }
25
- const executionId = parsed.options.executionId ?? runtime.createExecutionId();
52
+ return executeDeploy(input, options, inspected, runtime);
53
+ }
54
+ async function executeDeploy(input, options, inspected, runtime) {
55
+ const executionId = options.executionId ?? runtime.createExecutionId();
26
56
  const executed = await runtime.executeProjectRelease({
27
57
  ...inspected.access,
28
58
  inspection: inspected.inspection,
@@ -30,20 +60,30 @@ export async function handleDeployCliCommand(input, runtime) {
30
60
  executionId,
31
61
  });
32
62
  if (!executed.ok)
33
- return fail(input, renderDeployCliFailure(executed.failure));
34
- input.context.writeStdout(renderDeployCliExecution(executed.execution, executionId, parsed.options.format));
35
- return { exitCode: executed.execution.result.status === 'completed' ? 0 : 1 };
36
- }
37
- function earlyResult(options, plan) {
38
- if (options.dryRun)
39
- return { exitCode: plan.status === 'blocked' ? 1 : 0 };
40
- if (plan.status === 'no-change')
41
- return { exitCode: 0 };
42
- if (plan.status === 'blocked')
43
- return { exitCode: 1 };
44
- if (plan.steps.length === 0)
45
- return { exitCode: plan.status === 'waiting' ? 1 : 0 };
46
- return null;
63
+ return reportFailure(input, options.format, 'execute', executed.failure);
64
+ const outcome = getDeployCliExecutionOutcome(executed.execution);
65
+ if (options.format === 'json') {
66
+ writeDeployCliJson(input, createDeployCliExecutionEnvelope(inspected.inspection, executed.execution, executionId, outcome, input.context.env));
67
+ }
68
+ else {
69
+ writeDeployCliHuman(input, 'stdout', renderDeployCliExecution(executed.execution, executionId));
70
+ }
71
+ return { exitCode: outcome.exitCode };
72
+ }
73
+ function reportPlanOutcome(input, options, inspected, outcome) {
74
+ if (options.format === 'json') {
75
+ writeDeployCliJson(input, createDeployCliPlanEnvelope(inspected.inspection, inspected.plan, outcome, input.context.env));
76
+ }
77
+ return { exitCode: outcome.exitCode };
78
+ }
79
+ function reportFailure(input, format, phase, failure) {
80
+ if (format === 'json') {
81
+ writeDeployCliJson(input, createDeployCliFailureEnvelope(phase, failure, input.context.env));
82
+ }
83
+ else {
84
+ writeDeployCliHuman(input, 'stderr', renderDeployCliFailure(failure));
85
+ }
86
+ return { exitCode: DEPLOY_CLI_EXIT_CODES.failure };
47
87
  }
48
88
  async function confirmMutation(input, options, plan) {
49
89
  if (options.yes)
@@ -55,8 +95,7 @@ async function confirmMutation(input, options, plan) {
55
95
  const detail = irreversible === 0 ? '' : ` (${irreversible} irreversible)`;
56
96
  return interaction.confirm(`Execute ${plan.steps.length} release step(s)${detail}?`);
57
97
  }
58
- function fail(input, message) {
59
- input.context.writeStderr(message);
60
- return { exitCode: 1 };
98
+ function requestedFormat(argv) {
99
+ return argv.includes('--json') ? 'json' : 'human';
61
100
  }
62
101
  //# sourceMappingURL=handleDeployCliCommand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleDeployCliCommand.js","sourceRoot":"","sources":["../../src/cli/handleDeployCliCommand.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,KAAqB,EACrB,OAAyB;IAEzB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC,KAAK,EAAE,eAAe,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,MAAM,uBAAuB,CA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C,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC;IAC3E,MAAM,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,YAAY,gBAAgB,CAAC;IAC3E,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,MAAM,mBAAmB,MAAM,GAAG,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,IAAI,CAAC,KAAqB,EAAE,OAAe;IAClD,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AACzB,CAAC","sourcesContent":["import type { AnkhCliRunResult, AnkhConfirmationResult } from '@ankhorage/ankh';\n\nimport type { ReleasePlan } from '../index.js';\nimport type { DeployCliInput } from './DeployCliInput.js';\nimport type { DeployCliOptions } from './DeployCliOptions.js';\nimport type { DeployCliRuntime } from './DeployCliRuntime.js';\nimport { inspectDeployCliRelease } from './inspectDeployCliRelease.js';\nimport { parseDeployCliOptions } from './parseDeployCliOptions.js';\nimport { renderDeployCliExecution } from './renderDeployCliExecution.js';\nimport { renderDeployCliFailure } from './renderDeployCliFailure.js';\nimport { renderDeployCliPlan } from './renderDeployCliPlan.js';\n\nexport async function handleDeployCliCommand(\n input: DeployCliInput,\n runtime: DeployCliRuntime,\n): Promise<AnkhCliRunResult> {\n const parsed = parseDeployCliOptions(input.argv, input.context.cwd);\n if (!parsed.ok) return fail(input, `Deploy CLI: ${parsed.message}\\n`);\n const inspected = await inspectDeployCliRelease(parsed.options, input.context.env, runtime);\n if (!inspected.ok) return fail(input, renderDeployCliFailure(inspected.failure));\n\n input.context.writeStdout(\n renderDeployCliPlan(inspected.inspection, inspected.plan, parsed.options.format),\n );\n const early = earlyResult(parsed.options, inspected.plan);\n if (early !== null) return early;\n\n const confirmation = await confirmMutation(input, parsed.options, inspected.plan);\n if (confirmation === 'declined') {\n input.context.writeStderr('Deployment cancelled; no mutation was performed.\\n');\n return { exitCode: 0 };\n }\n if (confirmation !== 'confirmed') {\n return fail(\n input,\n 'Deployment requires confirmation. Use --yes for explicit non-interactive approval or --dry-run to inspect only.\\n',\n );\n }\n\n const executionId = parsed.options.executionId ?? runtime.createExecutionId();\n const executed = await runtime.executeProjectRelease({\n ...inspected.access,\n inspection: inspected.inspection,\n plan: inspected.plan,\n executionId,\n });\n if (!executed.ok) return fail(input, renderDeployCliFailure(executed.failure));\n input.context.writeStdout(\n renderDeployCliExecution(executed.execution, executionId, parsed.options.format),\n );\n return { exitCode: executed.execution.result.status === 'completed' ? 0 : 1 };\n}\n\nfunction earlyResult(options: DeployCliOptions, plan: ReleasePlan): AnkhCliRunResult | null {\n if (options.dryRun) return { exitCode: plan.status === 'blocked' ? 1 : 0 };\n if (plan.status === 'no-change') return { exitCode: 0 };\n if (plan.status === 'blocked') return { exitCode: 1 };\n if (plan.steps.length === 0) return { exitCode: plan.status === 'waiting' ? 1 : 0 };\n return null;\n}\n\nasync function confirmMutation(\n input: DeployCliInput,\n options: DeployCliOptions,\n plan: ReleasePlan,\n): Promise<AnkhConfirmationResult> {\n if (options.yes) return 'confirmed';\n const { interaction } = input.context;\n if (interaction === undefined) return 'unavailable';\n const irreversible = plan.steps.filter((step) => step.irreversible).length;\n const detail = irreversible === 0 ? '' : ` (${irreversible} irreversible)`;\n return interaction.confirm(`Execute ${plan.steps.length} release step(s)${detail}?`);\n}\n\nfunction fail(input: DeployCliInput, message: string): AnkhCliRunResult {\n input.context.writeStderr(message);\n return { exitCode: 1 };\n}\n"]}
1
+ {"version":3,"file":"handleDeployCliCommand.js","sourceRoot":"","sources":["../../src/cli/handleDeployCliCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC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EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;IACtC,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IACpD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC;IAC3E,MAAM,MAAM,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,YAAY,gBAAgB,CAAC;IAC3E,OAAO,WAAW,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,MAAM,mBAAmB,MAAM,GAAG,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,eAAe,CAAC,IAAuB;IAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AACpD,CAAC","sourcesContent":["import type { AnkhCliRunResult, AnkhConfirmationResult } from '@ankhorage/ankh';\n\nimport type { DeploymentFailure, ReleasePlan } from '../index.js';\nimport { createDeployCliConfirmationEnvelope } from './createDeployCliConfirmationEnvelope.js';\nimport { createDeployCliExecutionEnvelope } from './createDeployCliExecutionEnvelope.js';\nimport { createDeployCliFailureEnvelope } from './createDeployCliFailureEnvelope.js';\nimport { createDeployCliPlanEnvelope } from './createDeployCliPlanEnvelope.js';\nimport { DEPLOY_CLI_EXIT_CODES } from './DeployCliExitCodes.js';\nimport type { DeployCliInput } from './DeployCliInput.js';\nimport type { DeployCliInspectionResult } from './DeployCliInspectionResult.js';\nimport type { DeployCliOptions } from './DeployCliOptions.js';\nimport type { DeployCliRuntime } from './DeployCliRuntime.js';\nimport { getDeployCliExecutionOutcome } from './getDeployCliExecutionOutcome.js';\nimport { getDeployCliPlanOutcome } from './getDeployCliPlanOutcome.js';\nimport { inspectDeployCliRelease } from './inspectDeployCliRelease.js';\nimport { parseDeployCliOptions } from './parseDeployCliOptions.js';\nimport { renderDeployCliExecution } from './renderDeployCliExecution.js';\nimport { renderDeployCliFailure } from './renderDeployCliFailure.js';\nimport { renderDeployCliPlan } from './renderDeployCliPlan.js';\nimport { writeDeployCliHuman } from './writeDeployCliHuman.js';\nimport { writeDeployCliJson } from './writeDeployCliJson.js';\n\ntype SuccessfulInspection = Extract<DeployCliInspectionResult, { readonly ok: true }>;\n\nexport async function handleDeployCliCommand(\n input: DeployCliInput,\n runtime: DeployCliRuntime,\n): Promise<AnkhCliRunResult> {\n const parsed = parseDeployCliOptions(input.argv, input.context.cwd);\n if (!parsed.ok) {\n return reportFailure(input, requestedFormat(input.argv), 'input', {\n code: 'DEPLOY_CLI_INVALID_ARGUMENT',\n message: parsed.message,\n });\n }\n const inspected = await inspectDeployCliRelease(parsed.options, input.context.env, runtime);\n if (!inspected.ok)\n return reportFailure(input, parsed.options.format, 'inspect', inspected.failure);\n return handleInspectedDeploy(input, parsed.options, inspected, runtime);\n}\n\nasync function handleInspectedDeploy(\n input: DeployCliInput,\n options: DeployCliOptions,\n inspected: SuccessfulInspection,\n runtime: DeployCliRuntime,\n): Promise<AnkhCliRunResult> {\n if (options.format === 'human') {\n writeDeployCliHuman(input, 'stdout', renderDeployCliPlan(inspected.inspection, inspected.plan));\n }\n const outcome = getDeployCliPlanOutcome(inspected.inspection, inspected.plan);\n if (options.dryRun || outcome.status !== 'planned') {\n return reportPlanOutcome(input, options, inspected, outcome);\n }\n if (options.format === 'json' && !options.yes) {\n writeDeployCliJson(\n input,\n createDeployCliConfirmationEnvelope(inspected.inspection, inspected.plan, input.context.env),\n );\n return { exitCode: DEPLOY_CLI_EXIT_CODES.confirmationRequired };\n }\n return confirmAndExecute(input, options, inspected, runtime);\n}\n\nasync function confirmAndExecute(\n input: DeployCliInput,\n options: DeployCliOptions,\n inspected: SuccessfulInspection,\n runtime: DeployCliRuntime,\n): Promise<AnkhCliRunResult> {\n const confirmation = await confirmMutation(input, options, inspected.plan);\n if (confirmation === 'declined') {\n writeDeployCliHuman(input, 'stderr', 'Deployment cancelled; no mutation was performed.\\n');\n return { exitCode: DEPLOY_CLI_EXIT_CODES.declined };\n }\n if (confirmation !== 'confirmed') {\n writeDeployCliHuman(\n input,\n 'stderr',\n 'Deployment requires confirmation. Use --yes for explicit non-interactive approval or --dry-run to inspect only.\\n',\n );\n return { exitCode: DEPLOY_CLI_EXIT_CODES.confirmationRequired };\n }\n return executeDeploy(input, options, inspected, runtime);\n}\n\nasync function executeDeploy(\n input: DeployCliInput,\n options: DeployCliOptions,\n inspected: SuccessfulInspection,\n runtime: DeployCliRuntime,\n): Promise<AnkhCliRunResult> {\n const executionId = options.executionId ?? runtime.createExecutionId();\n const executed = await runtime.executeProjectRelease({\n ...inspected.access,\n inspection: inspected.inspection,\n plan: inspected.plan,\n executionId,\n });\n if (!executed.ok) return reportFailure(input, options.format, 'execute', executed.failure);\n const outcome = getDeployCliExecutionOutcome(executed.execution);\n if (options.format === 'json') {\n writeDeployCliJson(\n input,\n createDeployCliExecutionEnvelope(\n inspected.inspection,\n executed.execution,\n executionId,\n outcome,\n input.context.env,\n ),\n );\n } else {\n writeDeployCliHuman(input, 'stdout', renderDeployCliExecution(executed.execution, executionId));\n }\n return { exitCode: outcome.exitCode };\n}\n\nfunction reportPlanOutcome(\n input: DeployCliInput,\n options: DeployCliOptions,\n inspected: SuccessfulInspection,\n outcome: ReturnType<typeof getDeployCliPlanOutcome>,\n): AnkhCliRunResult {\n if (options.format === 'json') {\n writeDeployCliJson(\n input,\n createDeployCliPlanEnvelope(inspected.inspection, inspected.plan, outcome, input.context.env),\n );\n }\n return { exitCode: outcome.exitCode };\n}\n\nfunction reportFailure(\n input: DeployCliInput,\n format: 'human' | 'json',\n phase: 'input' | 'inspect' | 'execute',\n failure: DeploymentFailure,\n): AnkhCliRunResult {\n if (format === 'json') {\n writeDeployCliJson(input, createDeployCliFailureEnvelope(phase, failure, input.context.env));\n } else {\n writeDeployCliHuman(input, 'stderr', renderDeployCliFailure(failure));\n }\n return { exitCode: DEPLOY_CLI_EXIT_CODES.failure };\n}\n\nasync function confirmMutation(\n input: DeployCliInput,\n options: DeployCliOptions,\n plan: ReleasePlan,\n): Promise<AnkhConfirmationResult> {\n if (options.yes) return 'confirmed';\n const { interaction } = input.context;\n if (interaction === undefined) return 'unavailable';\n const irreversible = plan.steps.filter((step) => step.irreversible).length;\n const detail = irreversible === 0 ? '' : ` (${irreversible} irreversible)`;\n return interaction.confirm(`Execute ${plan.steps.length} release step(s)${detail}?`);\n}\n\nfunction requestedFormat(argv: readonly string[]): 'human' | 'json' {\n return argv.includes('--json') ? 'json' : 'human';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"handleDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/handleDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAM1B"}
1
+ {"version":3,"file":"handleDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/handleDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAM9D,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAQ1B"}
@@ -1,22 +1,24 @@
1
1
  import { inspectDeployCliRelease } from './inspectDeployCliRelease.js';
2
2
  import { mapDeployCliPlan } from './mapDeployCliPlan.js';
3
3
  import { parseDeployCliOptions } from './parseDeployCliOptions.js';
4
+ import { redactDeployCliText } from './redactDeployCliText.js';
4
5
  export async function handleDeployCliPlan(input, runtime) {
5
6
  const parsed = parseDeployCliOptions(input.argv, input.context.cwd);
6
- if (!parsed.ok)
7
- return failedPlan('DEPLOY_CLI_INVALID_ARGUMENT', parsed.message);
7
+ if (!parsed.ok) {
8
+ return failedPlan('DEPLOY_CLI_INVALID_ARGUMENT', parsed.message, input.context.env);
9
+ }
8
10
  const result = await inspectDeployCliRelease(parsed.options, input.context.env, runtime);
9
11
  if (!result.ok)
10
- return failedPlan(result.failure.code, result.failure.message);
11
- return mapDeployCliPlan(result.inspection, result.plan);
12
+ return failedPlan(result.failure.code, result.failure.message, input.context.env);
13
+ return mapDeployCliPlan(result.inspection, result.plan, input.context.env);
12
14
  }
13
- function failedPlan(code, message) {
15
+ function failedPlan(code, message, env) {
14
16
  return {
15
17
  kind: 'ankh-command-plan',
16
18
  version: 1,
17
19
  title: 'Deploy release',
18
20
  steps: [],
19
- diagnostics: [{ code, message, severity: 'error' }],
21
+ diagnostics: [{ code, message: redactDeployCliText(message, env), severity: 'error' }],
20
22
  };
21
23
  }
22
24
  //# sourceMappingURL=handleDeployCliPlan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleDeployCliPlan.js","sourceRoot":"","sources":["../../src/cli/handleDeployCliPlan.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAqB,EACrB,OAAyB;IAEzB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,UAAU,CAAC,6BAA6B,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzF,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/E,OAAO,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,OAAe;IAC/C,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC","sourcesContent":["import type { AnkhCommandPlan } from '@ankhorage/ankh';\n\nimport type { DeployCliInput } from './DeployCliInput.js';\nimport type { DeployCliRuntime } from './DeployCliRuntime.js';\nimport { inspectDeployCliRelease } from './inspectDeployCliRelease.js';\nimport { mapDeployCliPlan } from './mapDeployCliPlan.js';\nimport { parseDeployCliOptions } from './parseDeployCliOptions.js';\n\nexport async function handleDeployCliPlan(\n input: DeployCliInput,\n runtime: DeployCliRuntime,\n): Promise<AnkhCommandPlan> {\n const parsed = parseDeployCliOptions(input.argv, input.context.cwd);\n if (!parsed.ok) return failedPlan('DEPLOY_CLI_INVALID_ARGUMENT', parsed.message);\n const result = await inspectDeployCliRelease(parsed.options, input.context.env, runtime);\n if (!result.ok) return failedPlan(result.failure.code, result.failure.message);\n return mapDeployCliPlan(result.inspection, result.plan);\n}\n\nfunction failedPlan(code: string, message: string): AnkhCommandPlan {\n return {\n kind: 'ankh-command-plan',\n version: 1,\n title: 'Deploy release',\n steps: [],\n diagnostics: [{ code, message, severity: 'error' }],\n };\n}\n"]}
1
+ {"version":3,"file":"handleDeployCliPlan.js","sourceRoot":"","sources":["../../src/cli/handleDeployCliPlan.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,KAAqB,EACrB,OAAyB;IAEzB,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,UAAU,CAAC,6BAA6B,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtF,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzF,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClG,OAAO,gBAAgB,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,UAAU,CACjB,IAAY,EACZ,OAAe,EACf,GAAiD;IAEjD,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;KACvF,CAAC;AACJ,CAAC","sourcesContent":["import type { AnkhCommandPlan } from '@ankhorage/ankh';\n\nimport type { DeployCliInput } from './DeployCliInput.js';\nimport type { DeployCliRuntime } from './DeployCliRuntime.js';\nimport { inspectDeployCliRelease } from './inspectDeployCliRelease.js';\nimport { mapDeployCliPlan } from './mapDeployCliPlan.js';\nimport { parseDeployCliOptions } from './parseDeployCliOptions.js';\nimport { redactDeployCliText } from './redactDeployCliText.js';\n\nexport async function handleDeployCliPlan(\n input: DeployCliInput,\n runtime: DeployCliRuntime,\n): Promise<AnkhCommandPlan> {\n const parsed = parseDeployCliOptions(input.argv, input.context.cwd);\n if (!parsed.ok) {\n return failedPlan('DEPLOY_CLI_INVALID_ARGUMENT', parsed.message, input.context.env);\n }\n const result = await inspectDeployCliRelease(parsed.options, input.context.env, runtime);\n if (!result.ok) return failedPlan(result.failure.code, result.failure.message, input.context.env);\n return mapDeployCliPlan(result.inspection, result.plan, input.context.env);\n}\n\nfunction failedPlan(\n code: string,\n message: string,\n env: Readonly<Record<string, string | undefined>>,\n): AnkhCommandPlan {\n return {\n kind: 'ankh-command-plan',\n version: 1,\n title: 'Deploy release',\n steps: [],\n diagnostics: [{ code, message: redactDeployCliText(message, env), severity: 'error' }],\n };\n}\n"]}
@@ -1,4 +1,7 @@
1
1
  export { DEPLOY_CLI_ENVIRONMENT } from './DeployCliEnvironment.js';
2
+ export type { DeployCliExitCode } from './DeployCliExitCode.js';
3
+ export { DEPLOY_CLI_EXIT_CODES } from './DeployCliExitCodes.js';
4
+ export type { DeployCliJsonEnvelope } from './DeployCliJsonEnvelope.js';
2
5
  declare const provider: import("@ankhorage/ankh").AnkhRuntimeCommandProvider;
3
6
  export default provider;
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,QAAA,MAAM,QAAQ,sDAAmD,CAAC;AAElE,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,QAAA,MAAM,QAAQ,sDAAmD,CAAC;AAElE,eAAe,QAAQ,CAAC"}
package/dist/cli/index.js CHANGED
@@ -1,6 +1,8 @@
1
+ /** First-class `ankh deploy` provider and stable CI automation contract. */
1
2
  import { createDeployCliProvider } from './createDeployCliProvider.js';
2
3
  import { defaultDeployCliRuntime } from './defaultDeployCliRuntime.js';
3
4
  export { DEPLOY_CLI_ENVIRONMENT } from './DeployCliEnvironment.js';
5
+ export { DEPLOY_CLI_EXIT_CODES } from './DeployCliExitCodes.js';
4
6
  const provider = createDeployCliProvider(defaultDeployCliRuntime);
5
7
  export default provider;
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;AAElE,eAAe,QAAQ,CAAC","sourcesContent":["import { createDeployCliProvider } from './createDeployCliProvider.js';\nimport { defaultDeployCliRuntime } from './defaultDeployCliRuntime.js';\n\nexport { DEPLOY_CLI_ENVIRONMENT } from './DeployCliEnvironment.js';\n\nconst provider = createDeployCliProvider(defaultDeployCliRuntime);\n\nexport default provider;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,MAAM,QAAQ,GAAG,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;AAElE,eAAe,QAAQ,CAAC","sourcesContent":["/** First-class `ankh deploy` provider and stable CI automation contract. */\nimport { createDeployCliProvider } from './createDeployCliProvider.js';\nimport { defaultDeployCliRuntime } from './defaultDeployCliRuntime.js';\n\nexport { DEPLOY_CLI_ENVIRONMENT } from './DeployCliEnvironment.js';\nexport type { DeployCliExitCode } from './DeployCliExitCode.js';\nexport { DEPLOY_CLI_EXIT_CODES } from './DeployCliExitCodes.js';\nexport type { DeployCliJsonEnvelope } from './DeployCliJsonEnvelope.js';\n\nconst provider = createDeployCliProvider(defaultDeployCliRuntime);\n\nexport default provider;\n"]}
@@ -1,16 +1,5 @@
1
- import type { DeploymentFailure, ReleasePlan } from '../index.js';
2
- import type { ProjectReleaseAccess, ProjectReleaseInspection } from '../project/index.js';
1
+ import type { DeployCliInspectionResult } from './DeployCliInspectionResult.js';
3
2
  import type { DeployCliOptions } from './DeployCliOptions.js';
4
3
  import type { DeployCliRuntime } from './DeployCliRuntime.js';
5
- type InspectionResult = {
6
- readonly ok: true;
7
- readonly access: ProjectReleaseAccess;
8
- readonly inspection: ProjectReleaseInspection;
9
- readonly plan: ReleasePlan;
10
- } | {
11
- readonly ok: false;
12
- readonly failure: DeploymentFailure;
13
- };
14
- export declare function inspectDeployCliRelease(options: DeployCliOptions, env: Readonly<Record<string, string | undefined>>, runtime: DeployCliRuntime): Promise<InspectionResult>;
15
- export {};
4
+ export declare function inspectDeployCliRelease(options: DeployCliOptions, env: Readonly<Record<string, string | undefined>>, runtime: DeployCliRuntime): Promise<DeployCliInspectionResult>;
16
5
  //# sourceMappingURL=inspectDeployCliRelease.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inspectDeployCliRelease.d.ts","sourceRoot":"","sources":["../../src/cli/inspectDeployCliRelease.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,KAAK,gBAAgB,GACjB;IACE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC5B,GACD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAEhE,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACjD,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAa3B"}
1
+ {"version":3,"file":"inspectDeployCliRelease.d.ts","sourceRoot":"","sources":["../../src/cli/inspectDeployCliRelease.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACjD,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,yBAAyB,CAAC,CAapC"}
@@ -1 +1 @@
1
- {"version":3,"file":"inspectDeployCliRelease.js","sourceRoot":"","sources":["../../src/cli/inspectDeployCliRelease.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAanE,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAyB,EACzB,GAAiD,EACjD,OAAyB;IAEzB,MAAM,MAAM,GAAG,qBAAqB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC;QACjD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,GAAG,MAAM;KACV,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC;IAC9B,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM;QACN,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,IAAI,EAAE,OAAO,CAAC,wBAAwB,CAAC,MAAM,CAAC,UAAU,CAAC;KAC1D,CAAC;AACJ,CAAC","sourcesContent":["import type { DeploymentFailure, ReleasePlan } from '../index.js';\nimport type { ProjectReleaseAccess, ProjectReleaseInspection } from '../project/index.js';\nimport { createDeployCliAccess } from './createDeployCliAccess.js';\nimport type { DeployCliOptions } from './DeployCliOptions.js';\nimport type { DeployCliRuntime } from './DeployCliRuntime.js';\n\ntype InspectionResult =\n | {\n readonly ok: true;\n readonly access: ProjectReleaseAccess;\n readonly inspection: ProjectReleaseInspection;\n readonly plan: ReleasePlan;\n }\n | { readonly ok: false; readonly failure: DeploymentFailure };\n\nexport async function inspectDeployCliRelease(\n options: DeployCliOptions,\n env: Readonly<Record<string, string | undefined>>,\n runtime: DeployCliRuntime,\n): Promise<InspectionResult> {\n const access = createDeployCliAccess(options, env);\n const result = await runtime.inspectProjectRelease({\n projectRoot: options.projectRoot,\n ...access,\n });\n if (!result.ok) return result;\n return {\n ok: true,\n access,\n inspection: result.inspection,\n plan: runtime.createProjectReleasePlan(result.inspection),\n };\n}\n"]}
1
+ {"version":3,"file":"inspectDeployCliRelease.js","sourceRoot":"","sources":["../../src/cli/inspectDeployCliRelease.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,OAAyB,EACzB,GAAiD,EACjD,OAAyB;IAEzB,MAAM,MAAM,GAAG,qBAAqB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC;QACjD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,GAAG,MAAM;KACV,CAAC,CAAC;IACH,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC;IAC9B,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM;QACN,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,IAAI,EAAE,OAAO,CAAC,wBAAwB,CAAC,MAAM,CAAC,UAAU,CAAC;KAC1D,CAAC;AACJ,CAAC","sourcesContent":["import { createDeployCliAccess } from './createDeployCliAccess.js';\nimport type { DeployCliInspectionResult } from './DeployCliInspectionResult.js';\nimport type { DeployCliOptions } from './DeployCliOptions.js';\nimport type { DeployCliRuntime } from './DeployCliRuntime.js';\n\nexport async function inspectDeployCliRelease(\n options: DeployCliOptions,\n env: Readonly<Record<string, string | undefined>>,\n runtime: DeployCliRuntime,\n): Promise<DeployCliInspectionResult> {\n const access = createDeployCliAccess(options, env);\n const result = await runtime.inspectProjectRelease({\n projectRoot: options.projectRoot,\n ...access,\n });\n if (!result.ok) return result;\n return {\n ok: true,\n access,\n inspection: result.inspection,\n plan: runtime.createProjectReleasePlan(result.inspection),\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { AnkhCommandPlan } from '@ankhorage/ankh';
2
2
  import type { ReleasePlan } from '../index.js';
3
3
  import type { ProjectReleaseInspection } from '../project/index.js';
4
- export declare function mapDeployCliPlan(inspection: ProjectReleaseInspection, plan: ReleasePlan): AnkhCommandPlan;
4
+ export declare function mapDeployCliPlan(inspection: ProjectReleaseInspection, plan: ReleasePlan, env: Readonly<Record<string, string | undefined>>): AnkhCommandPlan;
5
5
  //# sourceMappingURL=mapDeployCliPlan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/mapDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,wBAAwB,EACpC,IAAI,EAAE,WAAW,GAChB,eAAe,CA2BjB"}
1
+ {"version":3,"file":"mapDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/mapDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGpE,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,wBAAwB,EACpC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,eAAe,CA2BjB"}
@@ -1,8 +1,9 @@
1
- export function mapDeployCliPlan(inspection, plan) {
1
+ import { redactDeployCliText } from './redactDeployCliText.js';
2
+ export function mapDeployCliPlan(inspection, plan, env) {
2
3
  return {
3
4
  kind: 'ankh-command-plan',
4
5
  version: 1,
5
- title: `Deploy release ${inspection.desired.version}`,
6
+ title: `Deploy release ${redactDeployCliText(inspection.desired.version, env)}`,
6
7
  steps: plan.steps.map((step) => ({
7
8
  capability: 'deploy.execute',
8
9
  dependsOn: step.dependsOn,
@@ -15,12 +16,12 @@ export function mapDeployCliPlan(inspection, plan) {
15
16
  diagnostics: [
16
17
  ...plan.diagnostics.map((diagnostic) => ({
17
18
  code: diagnostic.code,
18
- message: diagnostic.message,
19
+ message: redactDeployCliText(diagnostic.message, env),
19
20
  severity: diagnostic.severity,
20
21
  })),
21
22
  ...inspection.actions.map((action) => ({
22
23
  code: action.code,
23
- message: action.message,
24
+ message: redactDeployCliText(action.message, env),
24
25
  severity: 'warning',
25
26
  })),
26
27
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"mapDeployCliPlan.js","sourceRoot":"","sources":["../../src/cli/mapDeployCliPlan.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,gBAAgB,CAC9B,UAAoC,EACpC,IAAiB;IAEjB,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,kBAAkB,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE;QACrD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC/B,UAAU,EAAE,gBAAgB;YAC5B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,SAAS,EAAE;YAC3C,UAAU,EAAE,mBAAmB;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC,CAAC;QACH,WAAW,EAAE;YACX,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBACvC,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ;aAC9B,CAAC,CAAC;YACH,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACrC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,QAAQ,EAAE,SAAkB;aAC7B,CAAC,CAAC;SACJ;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AnkhCommandPlan } from '@ankhorage/ankh';\n\nimport type { ReleasePlan } from '../index.js';\nimport type { ProjectReleaseInspection } from '../project/index.js';\n\nexport function mapDeployCliPlan(\n inspection: ProjectReleaseInspection,\n plan: ReleasePlan,\n): AnkhCommandPlan {\n return {\n kind: 'ankh-command-plan',\n version: 1,\n title: `Deploy release ${inspection.desired.version}`,\n steps: plan.steps.map((step) => ({\n capability: 'deploy.execute',\n dependsOn: step.dependsOn,\n destructive: step.irreversible,\n id: step.id,\n label: `[${step.target}] ${step.operation}`,\n providerId: '@ankhorage/deploy',\n status: plan.status === 'blocked' ? 'blocked' : 'planned',\n })),\n diagnostics: [\n ...plan.diagnostics.map((diagnostic) => ({\n code: diagnostic.code,\n message: diagnostic.message,\n severity: diagnostic.severity,\n })),\n ...inspection.actions.map((action) => ({\n code: action.code,\n message: action.message,\n severity: 'warning' as const,\n })),\n ],\n };\n}\n"]}
1
+ {"version":3,"file":"mapDeployCliPlan.js","sourceRoot":"","sources":["../../src/cli/mapDeployCliPlan.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,gBAAgB,CAC9B,UAAoC,EACpC,IAAiB,EACjB,GAAiD;IAEjD,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,kBAAkB,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;QAC/E,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC/B,UAAU,EAAE,gBAAgB;YAC5B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,YAAY;YAC9B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,KAAK,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,SAAS,EAAE;YAC3C,UAAU,EAAE,mBAAmB;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC,CAAC;QACH,WAAW,EAAE;YACX,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBACvC,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC;gBACrD,QAAQ,EAAE,UAAU,CAAC,QAAQ;aAC9B,CAAC,CAAC;YACH,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACrC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC;gBACjD,QAAQ,EAAE,SAAkB;aAC7B,CAAC,CAAC;SACJ;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AnkhCommandPlan } from '@ankhorage/ankh';\n\nimport type { ReleasePlan } from '../index.js';\nimport type { ProjectReleaseInspection } from '../project/index.js';\nimport { redactDeployCliText } from './redactDeployCliText.js';\n\nexport function mapDeployCliPlan(\n inspection: ProjectReleaseInspection,\n plan: ReleasePlan,\n env: Readonly<Record<string, string | undefined>>,\n): AnkhCommandPlan {\n return {\n kind: 'ankh-command-plan',\n version: 1,\n title: `Deploy release ${redactDeployCliText(inspection.desired.version, env)}`,\n steps: plan.steps.map((step) => ({\n capability: 'deploy.execute',\n dependsOn: step.dependsOn,\n destructive: step.irreversible,\n id: step.id,\n label: `[${step.target}] ${step.operation}`,\n providerId: '@ankhorage/deploy',\n status: plan.status === 'blocked' ? 'blocked' : 'planned',\n })),\n diagnostics: [\n ...plan.diagnostics.map((diagnostic) => ({\n code: diagnostic.code,\n message: redactDeployCliText(diagnostic.message, env),\n severity: diagnostic.severity,\n })),\n ...inspection.actions.map((action) => ({\n code: action.code,\n message: redactDeployCliText(action.message, env),\n severity: 'warning' as const,\n })),\n ],\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { DeploymentRequiredAction } from '../index.js';
2
+ export declare function redactDeployCliActions(actions: readonly DeploymentRequiredAction[], env: Readonly<Record<string, string | undefined>>): readonly DeploymentRequiredAction[];
3
+ //# sourceMappingURL=redactDeployCliActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliActions.d.ts","sourceRoot":"","sources":["../../src/cli/redactDeployCliActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAG5D,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,wBAAwB,EAAE,EAC5C,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,SAAS,wBAAwB,EAAE,CAMrC"}
@@ -0,0 +1,9 @@
1
+ import { redactDeployCliText } from './redactDeployCliText.js';
2
+ export function redactDeployCliActions(actions, env) {
3
+ return actions.map((action) => ({
4
+ ...action,
5
+ message: redactDeployCliText(action.message, env),
6
+ ...('url' in action ? { url: redactDeployCliText(action.url, env) } : {}),
7
+ }));
8
+ }
9
+ //# sourceMappingURL=redactDeployCliActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliActions.js","sourceRoot":"","sources":["../../src/cli/redactDeployCliActions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,sBAAsB,CACpC,OAA4C,EAC5C,GAAiD;IAEjD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9B,GAAG,MAAM;QACT,OAAO,EAAE,mBAAmB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC;QACjD,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,mBAAmB,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1E,CAAC,CAAC,CAAC;AACN,CAAC","sourcesContent":["import type { DeploymentRequiredAction } from '../index.js';\nimport { redactDeployCliText } from './redactDeployCliText.js';\n\nexport function redactDeployCliActions(\n actions: readonly DeploymentRequiredAction[],\n env: Readonly<Record<string, string | undefined>>,\n): readonly DeploymentRequiredAction[] {\n return actions.map((action) => ({\n ...action,\n message: redactDeployCliText(action.message, env),\n ...('url' in action ? { url: redactDeployCliText(action.url, env) } : {}),\n }));\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { DeploymentFailure } from '../index.js';
2
+ export declare function redactDeployCliFailure(failure: DeploymentFailure, env: Readonly<Record<string, string | undefined>>): DeploymentFailure;
3
+ //# sourceMappingURL=redactDeployCliFailure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliFailure.d.ts","sourceRoot":"","sources":["../../src/cli/redactDeployCliFailure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,iBAAiB,CAEnB"}
@@ -0,0 +1,5 @@
1
+ import { redactDeployCliText } from './redactDeployCliText.js';
2
+ export function redactDeployCliFailure(failure, env) {
3
+ return { ...failure, message: redactDeployCliText(failure.message, env) };
4
+ }
5
+ //# sourceMappingURL=redactDeployCliFailure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliFailure.js","sourceRoot":"","sources":["../../src/cli/redactDeployCliFailure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,sBAAsB,CACpC,OAA0B,EAC1B,GAAiD;IAEjD,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;AAC5E,CAAC","sourcesContent":["import type { DeploymentFailure } from '../index.js';\nimport { redactDeployCliText } from './redactDeployCliText.js';\n\nexport function redactDeployCliFailure(\n failure: DeploymentFailure,\n env: Readonly<Record<string, string | undefined>>,\n): DeploymentFailure {\n return { ...failure, message: redactDeployCliText(failure.message, env) };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { ReleasePlan } from '../index.js';
2
+ export declare function redactDeployCliPlan(plan: ReleasePlan, env: Readonly<Record<string, string | undefined>>): ReleasePlan;
3
+ //# sourceMappingURL=redactDeployCliPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/redactDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,WAAW,CAQb"}
@@ -0,0 +1,11 @@
1
+ import { redactDeployCliText } from './redactDeployCliText.js';
2
+ export function redactDeployCliPlan(plan, env) {
3
+ return {
4
+ ...plan,
5
+ diagnostics: plan.diagnostics.map((diagnostic) => ({
6
+ ...diagnostic,
7
+ message: redactDeployCliText(diagnostic.message, env),
8
+ })),
9
+ };
10
+ }
11
+ //# sourceMappingURL=redactDeployCliPlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliPlan.js","sourceRoot":"","sources":["../../src/cli/redactDeployCliPlan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,UAAU,mBAAmB,CACjC,IAAiB,EACjB,GAAiD;IAEjD,OAAO;QACL,GAAG,IAAI;QACP,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACjD,GAAG,UAAU;YACb,OAAO,EAAE,mBAAmB,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC;SACtD,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC","sourcesContent":["import type { ReleasePlan } from '../index.js';\nimport { redactDeployCliText } from './redactDeployCliText.js';\n\nexport function redactDeployCliPlan(\n plan: ReleasePlan,\n env: Readonly<Record<string, string | undefined>>,\n): ReleasePlan {\n return {\n ...plan,\n diagnostics: plan.diagnostics.map((diagnostic) => ({\n ...diagnostic,\n message: redactDeployCliText(diagnostic.message, env),\n })),\n };\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function redactDeployCliText(text: string, env: Readonly<Record<string, string | undefined>>): string;
2
+ //# sourceMappingURL=redactDeployCliText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliText.d.ts","sourceRoot":"","sources":["../../src/cli/redactDeployCliText.ts"],"names":[],"mappings":"AAaA,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,MAAM,CAGR"}
@@ -0,0 +1,61 @@
1
+ const SENSITIVE_KEYS = new Set([
2
+ 'privateKey',
3
+ 'private_key',
4
+ 'clientSecret',
5
+ 'client_secret',
6
+ 'secret',
7
+ 'token',
8
+ 'access_token',
9
+ 'refresh_token',
10
+ 'password',
11
+ 'passphrase',
12
+ ]);
13
+ export function redactDeployCliText(text, env) {
14
+ const secrets = collectSecrets(env).sort((left, right) => right.length - left.length);
15
+ return secrets.reduce((result, secret) => replaceSecret(result, secret), text);
16
+ }
17
+ function collectSecrets(env) {
18
+ const secrets = new Set();
19
+ addSecret(env.ANKH_DEPLOY_GOOGLE_PLAY_SERVICE_ACCOUNT_JSON, secrets);
20
+ addSecret(env.ANKH_DEPLOY_APP_STORE_CONNECT_API_KEY_JSON, secrets);
21
+ addSecret(env.ANKH_DEPLOY_EAS_TOKEN, secrets);
22
+ return [...secrets];
23
+ }
24
+ function addSecret(rawValue, secrets) {
25
+ const raw = rawValue?.trim();
26
+ if (raw === undefined || raw.length === 0)
27
+ return;
28
+ secrets.add(raw);
29
+ collectJsonSecrets(raw, secrets);
30
+ }
31
+ function collectJsonSecrets(raw, secrets) {
32
+ try {
33
+ const parsed = JSON.parse(raw);
34
+ visitJson(parsed, secrets);
35
+ }
36
+ catch {
37
+ return;
38
+ }
39
+ }
40
+ function visitJson(value, secrets) {
41
+ if (Array.isArray(value)) {
42
+ value.forEach((item) => visitJson(item, secrets));
43
+ return;
44
+ }
45
+ if (!isRecord(value))
46
+ return;
47
+ for (const [key, child] of Object.entries(value)) {
48
+ if (SENSITIVE_KEYS.has(key) && typeof child === 'string' && child.length > 0) {
49
+ secrets.add(child);
50
+ }
51
+ visitJson(child, secrets);
52
+ }
53
+ }
54
+ function replaceSecret(text, secret) {
55
+ const escaped = JSON.stringify(secret).slice(1, -1);
56
+ return text.split(secret).join('[REDACTED]').split(escaped).join('[REDACTED]');
57
+ }
58
+ function isRecord(value) {
59
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
60
+ }
61
+ //# sourceMappingURL=redactDeployCliText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redactDeployCliText.js","sourceRoot":"","sources":["../../src/cli/redactDeployCliText.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,YAAY;IACZ,aAAa;IACb,cAAc;IACd,eAAe;IACf,QAAQ;IACR,OAAO;IACP,cAAc;IACd,eAAe;IACf,UAAU;IACV,YAAY;CACb,CAAC,CAAC;AAEH,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,GAAiD;IAEjD,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAA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CAAC,CAAC,CAAC;QAClD,OAAO;IACT,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO;IAC7B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;QACD,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,MAAc;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACpD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["const SENSITIVE_KEYS = new Set([\n 'privateKey',\n 'private_key',\n 'clientSecret',\n 'client_secret',\n 'secret',\n 'token',\n 'access_token',\n 'refresh_token',\n 'password',\n 'passphrase',\n]);\n\nexport function redactDeployCliText(\n text: string,\n env: Readonly<Record<string, string | undefined>>,\n): string {\n const secrets = collectSecrets(env).sort((left, right) => right.length - left.length);\n return secrets.reduce((result, secret) => replaceSecret(result, secret), text);\n}\n\nfunction collectSecrets(env: Readonly<Record<string, string | undefined>>): string[] {\n const secrets = new Set<string>();\n addSecret(env.ANKH_DEPLOY_GOOGLE_PLAY_SERVICE_ACCOUNT_JSON, secrets);\n addSecret(env.ANKH_DEPLOY_APP_STORE_CONNECT_API_KEY_JSON, secrets);\n addSecret(env.ANKH_DEPLOY_EAS_TOKEN, secrets);\n return [...secrets];\n}\n\nfunction addSecret(rawValue: string | undefined, secrets: Set<string>): void {\n const raw = rawValue?.trim();\n if (raw === undefined || raw.length === 0) return;\n secrets.add(raw);\n collectJsonSecrets(raw, secrets);\n}\n\nfunction collectJsonSecrets(raw: string, secrets: Set<string>): void {\n try {\n const parsed: unknown = JSON.parse(raw);\n visitJson(parsed, secrets);\n } catch {\n return;\n }\n}\n\nfunction visitJson(value: unknown, secrets: Set<string>): void {\n if (Array.isArray(value)) {\n value.forEach((item) => visitJson(item, secrets));\n return;\n }\n if (!isRecord(value)) return;\n for (const [key, child] of Object.entries(value)) {\n if (SENSITIVE_KEYS.has(key) && typeof child === 'string' && child.length > 0) {\n secrets.add(child);\n }\n visitJson(child, secrets);\n }\n}\n\nfunction replaceSecret(text: string, secret: string): string {\n const escaped = JSON.stringify(secret).slice(1, -1);\n return text.split(secret).join('[REDACTED]').split(escaped).join('[REDACTED]');\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  import type { ProjectReleaseExecution } from '../project/index.js';
2
- export declare function renderDeployCliExecution(execution: ProjectReleaseExecution, executionId: string, format: 'human' | 'json'): string;
2
+ export declare function renderDeployCliExecution(execution: ProjectReleaseExecution, executionId: string): string;
3
3
  //# sourceMappingURL=renderDeployCliExecution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderDeployCliExecution.d.ts","sourceRoot":"","sources":["../../src/cli/renderDeployCliExecution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,uBAAuB,EAClC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,OAAO,GAAG,MAAM,GACvB,MAAM,CAqBR"}
1
+ {"version":3,"file":"renderDeployCliExecution.d.ts","sourceRoot":"","sources":["../../src/cli/renderDeployCliExecution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,uBAAuB,EAClC,WAAW,EAAE,MAAM,GAClB,MAAM,CAkBR"}
@@ -1,7 +1,4 @@
1
- export function renderDeployCliExecution(execution, executionId, format) {
2
- if (format === 'json') {
3
- return `${JSON.stringify({ kind: 'deploy-release-execution', executionId, execution })}\n`;
4
- }
1
+ export function renderDeployCliExecution(execution, executionId) {
5
2
  const lines = [
6
3
  `Execution: ${executionId}`,
7
4
  `Result: ${execution.result.status}`,
@@ -1 +1 @@
1
- {"version":3,"file":"renderDeployCliExecution.js","sourceRoot":"","sources":["../../src/cli/renderDeployCliExecution.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,wBAAwB,CACtC,SAAkC,EAClC,WAAmB,EACnB,MAAwB;IAExB,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC;IAC7F,CAAC;IACD,MAAM,KAAK,GAAG;QACZ,cAAc,WAAW,EAAE;QAC3B,WAAW,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE;QACpC,qBAAqB,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE;QACvD,qBAAqB,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;KAChE,CAAC;IACF,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACtF,IAAI,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,mBAAmB,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI,SAAS,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QAC3C,KAAK,CAAC,IAAI,CACR,oBAAoB,SAAS,CAAC,cAAc,CAAC,IAAI,KAAK,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,CACzF,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import type { ProjectReleaseExecution } from '../project/index.js';\n\nexport function renderDeployCliExecution(\n execution: ProjectReleaseExecution,\n executionId: string,\n format: 'human' | 'json',\n): string {\n if (format === 'json') {\n return `${JSON.stringify({ kind: 'deploy-release-execution', executionId, execution })}\\n`;\n }\n const lines = [\n `Execution: ${executionId}`,\n `Result: ${execution.result.status}`,\n `Current revision: ${execution.result.currentRevision}`,\n `History recorded: ${execution.historyRecorded ? 'yes' : 'no'}`,\n ];\n if (execution.result.code !== undefined) lines.push(`Code: ${execution.result.code}`);\n if (execution.result.executedStepIds.length > 0) {\n lines.push(`Executed steps: ${execution.result.executedStepIds.join(', ')}`);\n }\n if (execution.historyFailure !== undefined) {\n lines.push(\n `History failure: ${execution.historyFailure.code}: ${execution.historyFailure.message}`,\n );\n }\n lines.push('');\n return lines.join('\\n');\n}\n"]}
1
+ {"version":3,"file":"renderDeployCliExecution.js","sourceRoot":"","sources":["../../src/cli/renderDeployCliExecution.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,wBAAwB,CACtC,SAAkC,EAClC,WAAmB;IAEnB,MAAM,KAAK,GAAG;QACZ,cAAc,WAAW,EAAE;QAC3B,WAAW,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE;QACpC,qBAAqB,SAAS,CAAC,MAAM,CAAC,eAAe,EAAE;QACvD,qBAAqB,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;KAChE,CAAC;IACF,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACtF,IAAI,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,mBAAmB,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,IAAI,SAAS,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QAC3C,KAAK,CAAC,IAAI,CACR,oBAAoB,SAAS,CAAC,cAAc,CAAC,IAAI,KAAK,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,CACzF,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["import type { ProjectReleaseExecution } from '../project/index.js';\n\nexport function renderDeployCliExecution(\n execution: ProjectReleaseExecution,\n executionId: string,\n): string {\n const lines = [\n `Execution: ${executionId}`,\n `Result: ${execution.result.status}`,\n `Current revision: ${execution.result.currentRevision}`,\n `History recorded: ${execution.historyRecorded ? 'yes' : 'no'}`,\n ];\n if (execution.result.code !== undefined) lines.push(`Code: ${execution.result.code}`);\n if (execution.result.executedStepIds.length > 0) {\n lines.push(`Executed steps: ${execution.result.executedStepIds.join(', ')}`);\n }\n if (execution.historyFailure !== undefined) {\n lines.push(\n `History failure: ${execution.historyFailure.code}: ${execution.historyFailure.message}`,\n );\n }\n lines.push('');\n return lines.join('\\n');\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import type { ReleasePlan } from '../index.js';
2
2
  import type { ProjectReleaseInspection } from '../project/index.js';
3
- export declare function renderDeployCliPlan(inspection: ProjectReleaseInspection, plan: ReleasePlan, format: 'human' | 'json'): string;
3
+ export declare function renderDeployCliPlan(inspection: ProjectReleaseInspection, plan: ReleasePlan): string;
4
4
  //# sourceMappingURL=renderDeployCliPlan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/renderDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,wBAAwB,EACpC,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,OAAO,GAAG,MAAM,GACvB,MAAM,CAUR"}
1
+ {"version":3,"file":"renderDeployCliPlan.d.ts","sourceRoot":"","sources":["../../src/cli/renderDeployCliPlan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAChE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,wBAAwB,EACpC,IAAI,EAAE,WAAW,GAChB,MAAM,CAyBR"}
@@ -1,15 +1,4 @@
1
- export function renderDeployCliPlan(inspection, plan, format) {
2
- if (format === 'json') {
3
- return `${JSON.stringify({
4
- kind: 'deploy-release-plan',
5
- desired: inspection.desired,
6
- plan,
7
- actions: inspection.actions,
8
- })}\n`;
9
- }
10
- return renderHuman(inspection, plan);
11
- }
12
- function renderHuman(inspection, plan) {
1
+ export function renderDeployCliPlan(inspection, plan) {
13
2
  const lines = [
14
3
  `Release: ${inspection.desired.version}`,
15
4
  `Targets: ${inspection.desired.targets.join(', ')}`,