@aid-framework/cli 0.1.53 → 0.1.55

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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `aid infra` — derive the deployment wiring from the spec, and drive OpenTofu.
3
+ *
4
+ * The division of labour is the same one `aid gen` keeps, and for the same reason:
5
+ * *what* the infrastructure says is derived by `@aid-framework/ir` (`buildDeployPlan`) and
6
+ * spelled by `emitInfra`; *whether a file may be rewritten* is the generator SDK's drift
7
+ * rule, reused as-is. This file decides four things and nothing else: which action, which
8
+ * spec, which environment, and what an exit status means. In particular it does not
9
+ * re-hash files or re-implement drift — a second implementation of that rule would
10
+ * eventually disagree, and the one that disagreed would be holding someone's edits.
11
+ *
12
+ * `plan`, `apply` and `drift` shell out through `context.spawn`, so a missing `tofu` is a
13
+ * diagnostic and not a crash, and a test can observe the argv without OpenTofu installed.
14
+ */
15
+ import type { CliContext } from '../context.js';
16
+ import type { CommandOutcome } from '../output.js';
17
+ export interface InfraOptions {
18
+ readonly subcommand: string | undefined;
19
+ readonly spec: string | undefined;
20
+ /** `gen` only: compute the report without writing. */
21
+ readonly dryRun: boolean;
22
+ /** `gen` only: fail when the tree is not what the spec would produce. */
23
+ readonly check: boolean;
24
+ readonly force: boolean;
25
+ readonly env: string | undefined;
26
+ readonly confirmProd: boolean;
27
+ /** Whether stdout must stay a single JSON document, which decides how `tofu` streams. */
28
+ readonly json: boolean;
29
+ }
30
+ export declare function infra(context: CliContext, options: InfraOptions): CommandOutcome;
31
+ //# sourceMappingURL=infra.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infra.d.ts","sourceRoot":"","sources":["../../src/commands/infra.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAoBnD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,sDAAsD;IACtD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,GAAG,cAAc,CAgChF"}
@@ -0,0 +1,300 @@
1
+ /**
2
+ * `aid infra` — derive the deployment wiring from the spec, and drive OpenTofu.
3
+ *
4
+ * The division of labour is the same one `aid gen` keeps, and for the same reason:
5
+ * *what* the infrastructure says is derived by `@aid-framework/ir` (`buildDeployPlan`) and
6
+ * spelled by `emitInfra`; *whether a file may be rewritten* is the generator SDK's drift
7
+ * rule, reused as-is. This file decides four things and nothing else: which action, which
8
+ * spec, which environment, and what an exit status means. In particular it does not
9
+ * re-hash files or re-implement drift — a second implementation of that rule would
10
+ * eventually disagree, and the one that disagreed would be holding someone's edits.
11
+ *
12
+ * `plan`, `apply` and `drift` shell out through `context.spawn`, so a missing `tofu` is a
13
+ * diagnostic and not a crash, and a test can observe the argv without OpenTofu installed.
14
+ */
15
+ import { existsSync } from 'node:fs';
16
+ import { join } from 'node:path';
17
+ import { createNodeSink, formatRegenerationSummary, parseAidManifestJson, planRegeneration, regenerate, serializeAidManifest, } from '@aid-framework/generator-sdk';
18
+ import { buildDeployPlan, DEPLOY_PLAN_VERSION } from '@aid-framework/ir';
19
+ import { hasErrors, sortDiagnostics } from '@aid-framework/spec';
20
+ import { CLI_DIAGNOSTIC_CODES, cliError } from '../diagnostics.js';
21
+ import { EXIT_FAILURE, EXIT_OK, EXIT_USAGE } from '../exit.js';
22
+ import { emitInfra, INFRA_GENERATED_DIR, INFRA_MANIFEST_PATH } from '../infra/emit.js';
23
+ import { envRoot, runTofu, TFVARS_PATH } from '../infra/tofu.js';
24
+ import { outcome } from '../output.js';
25
+ import { lowerSpec, readSpec } from '../pipeline.js';
26
+ import { DEFAULT_SPEC_PATH } from '../targets.js';
27
+ const SUBCOMMANDS = ['gen', 'plan', 'apply', 'drift'];
28
+ /** The env root a bare action runs in. */
29
+ const DEFAULT_ENV = 'dev';
30
+ /**
31
+ * What this emitter records about itself.
32
+ *
33
+ * `generatorVersion` is the deploy-plan format version, not a package version: it is the
34
+ * shape of the emitted bytes, which is the only thing a later run has to agree with. The
35
+ * manifest exists to answer "did a person edit this file", and a format bump is exactly
36
+ * when that answer stops mattering.
37
+ */
38
+ const INFRA_GENERATOR = 'aid-infra-tofu';
39
+ export function infra(context, options) {
40
+ if (options.subcommand === undefined) {
41
+ return outcome({
42
+ command: 'infra',
43
+ exitCode: EXIT_USAGE,
44
+ diagnostics: [
45
+ cliError({
46
+ code: CLI_DIAGNOSTIC_CODES.infraSubcommandRequired,
47
+ message: '`aid infra` needs a subcommand.',
48
+ hint: `Use one of: ${SUBCOMMANDS.join(', ')}.`,
49
+ }),
50
+ ],
51
+ });
52
+ }
53
+ if (!SUBCOMMANDS.includes(options.subcommand)) {
54
+ return outcome({
55
+ command: 'infra',
56
+ exitCode: EXIT_USAGE,
57
+ diagnostics: [
58
+ cliError({
59
+ code: CLI_DIAGNOSTIC_CODES.infraUnknownSubcommand,
60
+ message: `Unknown subcommand "${options.subcommand}".`,
61
+ hint: `Use one of: ${SUBCOMMANDS.join(', ')}.`,
62
+ }),
63
+ ],
64
+ });
65
+ }
66
+ return options.subcommand === 'gen'
67
+ ? generate(context, options)
68
+ : action(context, options, options.subcommand);
69
+ }
70
+ function generate(context, options) {
71
+ const command = 'infra';
72
+ const specPath = options.spec ?? DEFAULT_SPEC_PATH;
73
+ const fields = { action: 'gen', spec: specPath };
74
+ const read = readSpec(context, specPath);
75
+ if (!read.ok) {
76
+ return outcome({ command, exitCode: EXIT_FAILURE, fields, diagnostics: read.diagnostics });
77
+ }
78
+ const lowered = lowerSpec(read.text, specPath);
79
+ if (!lowered.ok) {
80
+ return outcome({ command, exitCode: EXIT_FAILURE, fields, diagnostics: lowered.diagnostics });
81
+ }
82
+ const files = emitInfra(buildDeployPlan(lowered.ir));
83
+ const plan = {
84
+ files: files.map((file) => ({ path: file.path, content: file.contents, owner: 'generated' })),
85
+ };
86
+ const sink = createNodeSink(context.cwd);
87
+ const manifest = readInfraManifest(sink);
88
+ if (manifest.diagnostics.length > 0) {
89
+ return outcome({
90
+ command,
91
+ exitCode: EXIT_FAILURE,
92
+ fields,
93
+ diagnostics: manifest.diagnostics,
94
+ });
95
+ }
96
+ const reconciliation = { sink, manifest: manifest.manifest, force: options.force };
97
+ if (options.dryRun || options.check) {
98
+ // Both branches take the SDK's planner, which has no writer. `--check` and `--dry-run`
99
+ // therefore cannot write even by accident, and their difference is only what the exit
100
+ // code means: a dry run describes, a check judges.
101
+ const report = planRegeneration(plan, reconciliation);
102
+ const outstanding = report.created.length + report.updated.length > 0;
103
+ const failed = hasErrors(report.diagnostics) || (options.check && outstanding);
104
+ // Creation is not drift, so the SDK reports no diagnostic for a tree that simply has
105
+ // not been generated yet. A failing `--check` must still say why, or the exit code is
106
+ // the only clue.
107
+ const outdated = options.check && outstanding
108
+ ? [
109
+ cliError({
110
+ code: CLI_DIAGNOSTIC_CODES.infraGeneratedOutdated,
111
+ message: `"${INFRA_GENERATED_DIR}" does not match the spec.`,
112
+ hint: 'Run `aid infra gen` to rewrite it.',
113
+ }),
114
+ ]
115
+ : [];
116
+ return outcome({
117
+ command,
118
+ exitCode: failed ? EXIT_FAILURE : EXIT_OK,
119
+ diagnostics: [...lowered.diagnostics, ...report.diagnostics, ...outdated],
120
+ text: [
121
+ options.check
122
+ ? `${INFRA_GENERATED_DIR}: ${outstanding ? 'out of date' : 'up to date'} (${formatRegenerationSummary(report)})`
123
+ : `${INFRA_GENERATED_DIR}: ${formatRegenerationSummary(report)}`,
124
+ ...report.created.map((path) => ` would create ${path}`),
125
+ ...report.updated.map((path) => ` would update ${path}`),
126
+ ].join('\n'),
127
+ fields: {
128
+ ...fields,
129
+ dryRun: options.dryRun,
130
+ check: options.check,
131
+ manifest: { path: INFRA_MANIFEST_PATH, written: false },
132
+ changes: {
133
+ created: report.created,
134
+ updated: report.updated,
135
+ unchanged: report.unchanged,
136
+ conflicts: report.drifted.map((file) => file.path),
137
+ stale: report.stale,
138
+ },
139
+ },
140
+ });
141
+ }
142
+ const applied = regenerate(plan, {
143
+ ...reconciliation,
144
+ provenance: provenanceFor(lowered.ir),
145
+ });
146
+ sink.write(INFRA_MANIFEST_PATH, serializeAidManifest(applied.manifest));
147
+ const { report } = applied;
148
+ // Drift is an error the caller must answer, and `--force` is the answer. A run that did
149
+ // what it was told exits 0; only an unforced run leaves something outstanding.
150
+ const failed = hasErrors(report.diagnostics) || (!options.force && report.drifted.length > 0);
151
+ return outcome({
152
+ command,
153
+ exitCode: failed ? EXIT_FAILURE : EXIT_OK,
154
+ diagnostics: [...lowered.diagnostics, ...report.diagnostics],
155
+ text: [
156
+ `${INFRA_GENERATED_DIR}: ${formatRegenerationSummary(report)}`,
157
+ ...report.created.map((path) => ` created ${path}`),
158
+ ...report.updated.map((path) => ` updated ${path}`),
159
+ ...report.drifted.map((file) => ` refused ${file.path} (the new content is beside it)`),
160
+ ].join('\n'),
161
+ fields: {
162
+ ...fields,
163
+ dryRun: false,
164
+ check: false,
165
+ manifest: { path: INFRA_MANIFEST_PATH, written: true },
166
+ changes: {
167
+ created: report.created,
168
+ updated: report.updated,
169
+ unchanged: report.unchanged,
170
+ conflicts: report.drifted.map((file) => file.path),
171
+ stale: report.stale,
172
+ },
173
+ },
174
+ });
175
+ }
176
+ function action(context, options, action) {
177
+ const command = 'infra';
178
+ const env = options.env ?? DEFAULT_ENV;
179
+ const fields = { action, env, tool: 'tofu' };
180
+ if (action === 'apply' && env === 'prod' && !options.confirmProd) {
181
+ return outcome({
182
+ command,
183
+ exitCode: EXIT_USAGE,
184
+ fields,
185
+ diagnostics: [
186
+ cliError({
187
+ code: CLI_DIAGNOSTIC_CODES.infraConfirmProdRequired,
188
+ message: 'Applying to prod requires an explicit confirmation.',
189
+ hint: 'Re-run with --confirm-prod once the plan has been reviewed.',
190
+ }),
191
+ ],
192
+ });
193
+ }
194
+ if (!existsSync(join(context.cwd, ...TFVARS_PATH.split('/')))) {
195
+ return outcome({
196
+ command,
197
+ exitCode: EXIT_FAILURE,
198
+ fields,
199
+ diagnostics: [
200
+ cliError({
201
+ code: CLI_DIAGNOSTIC_CODES.infraNotGenerated,
202
+ message: `"${TFVARS_PATH}" is missing, so there is nothing to ${action}.`,
203
+ hint: 'Run `aid infra gen` first.',
204
+ }),
205
+ ],
206
+ });
207
+ }
208
+ const root = envRoot(env);
209
+ if (!existsSync(join(context.cwd, ...root.split('/')))) {
210
+ return outcome({
211
+ command,
212
+ exitCode: EXIT_FAILURE,
213
+ fields,
214
+ diagnostics: [
215
+ cliError({
216
+ code: CLI_DIAGNOSTIC_CODES.infraEnvRootMissing,
217
+ message: `The environment root "${root}" does not exist.`,
218
+ hint: `Create ${root} with your module wiring; the generated tfvars is consumed there, not written to.`,
219
+ }),
220
+ ],
221
+ });
222
+ }
223
+ const result = runTofu(context, action, env, options.json ? 'pipe' : 'inherit');
224
+ if (result.error !== undefined) {
225
+ return outcome({
226
+ command,
227
+ exitCode: EXIT_USAGE,
228
+ fields,
229
+ diagnostics: [
230
+ cliError({
231
+ code: CLI_DIAGNOSTIC_CODES.infraTofuMissing,
232
+ message: `Could not run "${result.error.message}".`,
233
+ hint: 'Install OpenTofu, or point AID_TOFU at a tofu binary.',
234
+ }),
235
+ ],
236
+ });
237
+ }
238
+ // OpenTofu reserves exit 2 for "the plan is non-empty" under `-detailed-exitcode`, so
239
+ // drift is a distinguishable status rather than a guess over human output. It is a
240
+ // failure: a drift check that exited 0 would be a gate that never closes.
241
+ const driftDetected = action === 'drift' && result.status === 2;
242
+ const succeeded = result.status === 0;
243
+ const diagnostics = driftDetected
244
+ ? [
245
+ cliError({
246
+ code: CLI_DIAGNOSTIC_CODES.infraDriftDetected,
247
+ message: `The "${env}" environment no longer matches the generated wiring.`,
248
+ hint: 'Review the plan output, then apply to converge or fix the spec.',
249
+ }),
250
+ ]
251
+ : succeeded
252
+ ? []
253
+ : [
254
+ cliError({
255
+ code: CLI_DIAGNOSTIC_CODES.infraTofuFailed,
256
+ message: `tofu ${action} exited ${result.status}.`,
257
+ ...(result.stderr.trim() === '' ? {} : { hint: result.stderr.trim() }),
258
+ }),
259
+ ];
260
+ const text = driftDetected
261
+ ? `${env}: drift detected`
262
+ : succeeded
263
+ ? `${env}: tofu ${action} succeeded`
264
+ : `${env}: tofu ${action} failed (exit ${result.status})`;
265
+ return outcome({
266
+ command,
267
+ exitCode: succeeded ? EXIT_OK : EXIT_FAILURE,
268
+ diagnostics,
269
+ text,
270
+ ...(succeeded ? {} : { stderr: result.stderr }),
271
+ fields: {
272
+ ...fields,
273
+ status: result.status,
274
+ ...(options.json ? { output: result.stdout } : {}),
275
+ },
276
+ });
277
+ }
278
+ function readInfraManifest(sink) {
279
+ const text = sink.read(INFRA_MANIFEST_PATH);
280
+ if (text === undefined)
281
+ return { diagnostics: [] };
282
+ const parsed = parseAidManifestJson(text, {
283
+ generatedDir: INFRA_GENERATED_DIR,
284
+ businessDir: 'infra/business',
285
+ });
286
+ if (hasErrors(parsed.diagnostics)) {
287
+ return { diagnostics: sortDiagnostics(parsed.diagnostics) };
288
+ }
289
+ return parsed.manifest === undefined
290
+ ? { diagnostics: [] }
291
+ : { manifest: parsed.manifest, diagnostics: [] };
292
+ }
293
+ function provenanceFor(ir) {
294
+ return {
295
+ generator: INFRA_GENERATOR,
296
+ generatorVersion: DEPLOY_PLAN_VERSION,
297
+ irVersion: ir.irVersion,
298
+ };
299
+ }
300
+ //# sourceMappingURL=infra.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"infra.js","sourceRoot":"","sources":["../../src/commands/infra.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EACL,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAEhB,UAAU,EACV,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAIjE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAE/D,0CAA0C;AAC1C,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAgBzC,MAAM,UAAU,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AO,MAAM,CAAC,QAAQ,KAAK,SAAS;QAClC,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;QACrB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,aAAa,CAAC,EAAM;IAC3B,OAAO;QACL,SAAS,EAAE,eAAe;QAC1B,gBAAgB,EAAE,mBAAmB;QACrC,SAAS,EAAE,EAAE,CAAC,SAAS;KACxB,CAAC;AACJ,CAAC"}
@@ -35,6 +35,15 @@ export declare const CLI_DIAGNOSTIC_CODES: {
35
35
  readonly filesMissing: 'cli/files-missing';
36
36
  readonly businessMissing: 'cli/business-missing';
37
37
  readonly filesOutdated: 'cli/files-outdated';
38
+ readonly infraSubcommandRequired: 'cli/infra-subcommand-required';
39
+ readonly infraUnknownSubcommand: 'cli/infra-unknown-subcommand';
40
+ readonly infraGeneratedOutdated: 'cli/infra-generated-outdated';
41
+ readonly infraNotGenerated: 'cli/infra-not-generated';
42
+ readonly infraEnvRootMissing: 'cli/infra-env-root-missing';
43
+ readonly infraTofuMissing: 'cli/infra-tofu-missing';
44
+ readonly infraTofuFailed: 'cli/infra-tofu-failed';
45
+ readonly infraDriftDetected: 'cli/infra-drift-detected';
46
+ readonly infraConfirmProdRequired: 'cli/infra-confirm-prod-required';
38
47
  };
39
48
  export type CliDiagnosticCode = (typeof CLI_DIAGNOSTIC_CODES)[keyof typeof CLI_DIAGNOSTIC_CODES];
40
49
  export interface CliDiagnosticInit {
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAE/C,eAAO,MAAM,o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AG,aAAa,CAO/D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,iBAAiB,GAAG,aAAa,CAOjE"}
@@ -35,6 +35,17 @@ export const CLI_DIAGNOSTIC_CODES = {
35
35
  filesMissing: 'cli/files-missing',
36
36
  businessMissing: 'cli/business-missing',
37
37
  filesOutdated: 'cli/files-outdated',
38
+ // `aid infra` originates these. A missing binary and a failed plan are separate codes
39
+ // because they need different fixes; reporting both as "infra failed" would hide which.
40
+ infraSubcommandRequired: 'cli/infra-subcommand-required',
41
+ infraUnknownSubcommand: 'cli/infra-unknown-subcommand',
42
+ infraGeneratedOutdated: 'cli/infra-generated-outdated',
43
+ infraNotGenerated: 'cli/infra-not-generated',
44
+ infraEnvRootMissing: 'cli/infra-env-root-missing',
45
+ infraTofuMissing: 'cli/infra-tofu-missing',
46
+ infraTofuFailed: 'cli/infra-tofu-failed',
47
+ infraDriftDetected: 'cli/infra-drift-detected',
48
+ infraConfirmProdRequired: 'cli/infra-confirm-prod-required',
38
49
  };
39
50
  export function cliError(init) {
40
51
  return errorDiagnostic({
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKzE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc,EAAE,qBAAqB;IACrC,aAAa,EAAE,oBAAoB;IACnC,mBAAmB,EAAE,2BAA2B;IAChD,aAAa,EAAE,oBAAoB;IACnC,aAAa,EAAE,qBAAqB;IACpC,kBAAkB,EAAE,0BAA0B;IAC9C,iBAAiB,EAAE,wBAAwB;IAC3C,iBAAiB,EAAE,wBAAwB;IAC3C,iBAAiB,EAAE,yBAAyB;IAC5C,oBAAoB,EAAE,4BAA4B;IAClD,iBAAiB,EAAE,wBAAwB;IAC3C,YAAY,EAAE,mBAAmB;IACjC,YAAY,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AAO;QACrB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;QACrB,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;KACxD,CAAC,CAAC;AACL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -18,6 +18,8 @@ export type { EvalOptions } from './commands/eval.js';
18
18
  export { evaluate } from './commands/eval.js';
19
19
  export type { GenerateOptions, GenerateSuccess } from './commands/gen.js';
20
20
  export { generate } from './commands/gen.js';
21
+ export type { InfraOptions } from './commands/infra.js';
22
+ export { infra } from './commands/infra.js';
21
23
  export type { IngestOptions } from './commands/ingest.js';
22
24
  export { ingest } from './commands/ingest.js';
23
25
  export type { InitOptions } from './commands/init.js';
@@ -30,6 +32,10 @@ export type { CliDiagnostic, CliDiagnosticCode, CliDiagnosticInit } from './diag
30
32
  export { CLI_DIAGNOSTIC_CODES, cliError, cliWarning } from './diagnostics.js';
31
33
  export type { ExitCode } from './exit.js';
32
34
  export { EXIT_FAILURE, EXIT_OK, EXIT_USAGE } from './exit.js';
35
+ export type { InfraFile } from './infra/emit.js';
36
+ export { emitInfra, INFRA_GENERATED_DIR, INFRA_MANIFEST_PATH, tfvars } from './infra/emit.js';
37
+ export type { InfraAction } from './infra/tofu.js';
38
+ export { envRoot, TFVARS_PATH, tofuArgs } from './infra/tofu.js';
33
39
  export { COMMANDS, run } from './main.js';
34
40
  export type { CommandOutcome, OutcomeInit } from './output.js';
35
41
  export { emit, outcome } from './output.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS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;AAC1C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EACV,QAAQ,EACR,cAAc,EACd,MAAM,EACN,OAAO,EACP,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC5F,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -14,12 +14,15 @@ export { booleanFlag, JSON_FLAG, parseArguments, valueFlag } from './args.js';
14
14
  export { doctor } from './commands/doctor.js';
15
15
  export { evaluate } from './commands/eval.js';
16
16
  export { generate } from './commands/gen.js';
17
+ export { infra } from './commands/infra.js';
17
18
  export { ingest } from './commands/ingest.js';
18
19
  export { init, projectNameFor, starterSpec } from './commands/init.js';
19
20
  export { validate } from './commands/validate.js';
20
21
  export { createContext } from './context.js';
21
22
  export { CLI_DIAGNOSTIC_CODES, cliError, cliWarning } from './diagnostics.js';
22
23
  export { EXIT_FAILURE, EXIT_OK, EXIT_USAGE } from './exit.js';
24
+ export { emitInfra, INFRA_GENERATED_DIR, INFRA_MANIFEST_PATH, tfvars } from './infra/emit.js';
25
+ export { envRoot, TFVARS_PATH, tofuArgs } from './infra/tofu.js';
23
26
  export { COMMANDS, run } from './main.js';
24
27
  export { emit, outcome } from './output.js';
25
28
  export { absolutePath, parentPath } from './paths.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAWtD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE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AAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAWtD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5F,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * The OpenTofu wiring, derived from the deployment plan.
3
+ *
4
+ * This emits the *derived* layer only: the plan itself, the tfvars an env root consumes,
5
+ * and a README that says who owns what. Provider HCL (the `modules/` and `envs/` trees)
6
+ * is not emitted here, because it carries no information the IR has -- and because an
7
+ * emitter that wrote AWS resources it could not `tofu validate` would be guessing.
8
+ *
9
+ * The load-bearing rule is enforced by construction: nothing in this file accepts an
10
+ * account id, a region, a CIDR, a domain, or a sizing number, so none can appear in the
11
+ * output (design §12.2). An env root is the same for dev and prod; only its inputs differ.
12
+ */
13
+ import type { DeployPlan } from '@aid-framework/ir';
14
+ /** Where every derived infrastructure file lives, relative to the project root. */
15
+ export declare const INFRA_GENERATED_DIR = "infra/generated";
16
+ /** The manifest recording what this emitter wrote, so a hand edit is never overwritten. */
17
+ export declare const INFRA_MANIFEST_PATH = "infra/aid.infra.manifest.json";
18
+ export interface InfraFile {
19
+ /** Repository-relative, POSIX-separated. */
20
+ readonly path: string;
21
+ readonly contents: string;
22
+ }
23
+ /**
24
+ * A tfvars document: the plan in the spelling an env root reads. Keys are snake_case
25
+ * because that is what a Terraform variable is called; values are the plan's, unchanged.
26
+ *
27
+ * Deliberately absent: any value a person must choose. `instance_class`, `min_size`,
28
+ * `region`, `domain` and `account_id` are business inputs, and an env root supplies them
29
+ * from its own `business/` file.
30
+ */
31
+ export interface DeployTfvars {
32
+ readonly project: {
33
+ readonly name: string;
34
+ readonly namespace: string;
35
+ };
36
+ readonly services: Readonly<Record<string, {
37
+ readonly target: string;
38
+ readonly streaming: boolean;
39
+ readonly routes: readonly {
40
+ pipeline: string;
41
+ method: string;
42
+ path: string;
43
+ }[];
44
+ readonly env: readonly {
45
+ name: string;
46
+ secret: boolean;
47
+ from: string;
48
+ value?: string;
49
+ }[];
50
+ readonly secret_names: readonly string[];
51
+ readonly providers: readonly string[];
52
+ readonly ingest: readonly string[];
53
+ }>>;
54
+ readonly data_stores: Readonly<Record<string, {
55
+ readonly kind: string;
56
+ readonly secret_ref?: string;
57
+ readonly requires_extension?: string;
58
+ readonly retrievers: readonly string[];
59
+ }>>;
60
+ readonly tasks: readonly {
61
+ id: string;
62
+ kind: string;
63
+ source: string;
64
+ schedule?: string;
65
+ }[];
66
+ readonly alarms: readonly {
67
+ id: string;
68
+ metric: string;
69
+ source: string;
70
+ }[];
71
+ }
72
+ /**
73
+ * Every derived file, in a stable order. Pure: the same plan always yields the same bytes,
74
+ * so `aid infra gen --check` can compare content instead of trusting a timestamp.
75
+ */
76
+ export declare function emitInfra(plan: DeployPlan): InfraFile[];
77
+ export declare function tfvars(plan: DeployPlan): DeployTfvars;
78
+ //# sourceMappingURL=emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/infra/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,kCAAkC,CAAC;AAEnE,MAAM,WAAW,SAAS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