@nac3/forge-cli 0.2.0-alpha.23 → 0.2.0-alpha.24

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.
@@ -23,6 +23,6 @@ export declare class AwsEcsAdapter implements DeployAdapter {
23
23
  reason?: string;
24
24
  }>;
25
25
  plan(input: DeployInput): Promise<DeployPlan>;
26
- apply(_input: DeployInput): Promise<DeployResult>;
26
+ apply(input: DeployInput): Promise<DeployResult>;
27
27
  }
28
28
  //# sourceMappingURL=aws_adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aws_adapter.d.ts","sourceRoot":"","sources":["../../src/deploy/aws_adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EACV,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAC3D,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,YAAW,aAAa;IACjD,QAAQ,CAAC,EAAE,EAAG,KAAK,CAAU;IAC7B,QAAQ,CAAC,WAAW,SAEqC;IAEzD,OAAO,IAAI,IAAI,EAAE;IAEX,UAAU,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAgBvD,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAuB7C,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAiBxD"}
1
+ {"version":3,"file":"aws_adapter.d.ts","sourceRoot":"","sources":["../../src/deploy/aws_adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EACV,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAC3D,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,YAAW,aAAa;IACjD,QAAQ,CAAC,EAAE,EAAG,KAAK,CAAU;IAC7B,QAAQ,CAAC,WAAW,SAEqC;IAEzD,OAAO,IAAI,IAAI,EAAE;IAEX,UAAU,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAgBvD,IAAI,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAuB7C,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAqDvD"}
@@ -46,20 +46,53 @@ export class AwsEcsAdapter {
46
46
  ],
47
47
  };
48
48
  }
49
- async apply(_input) {
50
- /* For alpha.19 we deliberately do NOT call the imperative
51
- * applyDeploy() from src/deploy/aws.ts -- that function has
52
- * a different input shape + uses prompts for missing config.
53
- * The proper migration is a follow-up: refactor aws.ts to
54
- * accept DeployInput + return DeployResult, then route the
55
- * `yf deploy aws` command through this adapter.
49
+ async apply(input) {
50
+ /* alpha.23+: AwsEcsAdapter.apply() wires through to the
51
+ * existing aws.ts imperative path. Returns the unified
52
+ * DeployResult shape the DeployAdapter contract expects.
56
53
  *
57
- * Today, calling AwsEcsAdapter.apply throws so callers see
58
- * the unfinished migration. The plan() path above is fully
59
- * functional + used by the tier-aware selector. */
60
- throw new Error('AwsEcsAdapter.apply is not wired yet in alpha.19. '
61
- + 'Use `yf deploy aws` (imperative path) for now. '
62
- + 'The DeployAdapter migration completes in a follow-up.');
54
+ * The user MUST have `yujin.forge.json::deploys.aws`
55
+ * populated (region + cluster + service + image) -- we
56
+ * read it via readDeployConfig() + use input.projectSlug
57
+ * as the override for the service name if the config
58
+ * doesn't set one. */
59
+ const { resolveAwsCredentials, readDeployConfig, planDeploy, applyDeploy } = await import('./aws.js');
60
+ const creds = await resolveAwsCredentials();
61
+ if (!creds) {
62
+ throw new Error('AwsEcsAdapter.apply: aws_access_key_id / aws_secret_access_key '
63
+ + 'missing from vault. Run `yf vault set aws_access_key_id` and '
64
+ + '`yf vault set aws_secret_access_key`.');
65
+ }
66
+ /* Look up the canonical config from yujin.forge.json. The
67
+ * adapter contract does not carry region / cluster / image
68
+ * because those are AWS-specific. The project config is the
69
+ * source of truth. */
70
+ const cwd = process.cwd();
71
+ const config = await readDeployConfig(cwd);
72
+ if (!config) {
73
+ throw new Error('AwsEcsAdapter.apply: yujin.forge.json::deploys.aws missing. '
74
+ + 'Add: { "deploys": { "aws": { "region": "...", "cluster": "...", '
75
+ + '"service": "' + input.projectSlug + '", "image": "..." } } }');
76
+ }
77
+ const plan = planDeploy(config);
78
+ const t0 = Date.now();
79
+ const r = await applyDeploy(plan, creds);
80
+ const seconds = Math.round((Date.now() - t0) / 1000);
81
+ if (!r.ok) {
82
+ throw new Error('AwsEcsAdapter.apply failed: ' + r.message
83
+ + (r.detail ? ' -- ' + r.detail : ''));
84
+ }
85
+ /* AWS ECS does not expose a service URL directly. The
86
+ * canonical "where is my app" is the ALB DNS name -- not
87
+ * known here without a separate ELB lookup. Return a
88
+ * descriptive identifier so callers can show something
89
+ * useful + look up the real URL in the dashboard. */
90
+ return {
91
+ url: 'arn://' + (r.task_definition_arn ?? plan.config.service),
92
+ deployed_at: new Date().toISOString(),
93
+ build_seconds: seconds,
94
+ logs_tail: [r.message],
95
+ };
63
96
  }
64
97
  }
65
98
  //# sourceMappingURL=aws_adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aws_adapter.js","sourceRoot":"","sources":["../../src/deploy/aws_adapter.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,aAAa;IACf,EAAE,GAAG,KAAc,CAAC;IACpB,WAAW,GAClB,+EAA+E;UAC7E,oDAAoD,CAAC;IAEzD,OAAO,KAAa,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAEhD,KAAK,CAAC,UAAU;QACd;;;qDAG6C;QAC7C,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,iBAA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AAM,IAAI,KAAK,CACb,8DAA8D;kBAC5D,kEAAkE;kBAClE,cAAc,GAAG,KAAK,CAAC,WAAW,GAAG,yBAAyB,CACjE,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAChC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,CAAC,CAAC,OAAO;kBACtD,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3C,CAAC;QACD;;;;6DAIqD;QACrD,OAAO;YACL,GAAG,EAAY,QAAQ,GAAG,CAAC,CAAC,CAAC,mBAAmB,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YACxE,WAAW,EAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACvC,aAAa,EAAE,OAAO;YACtB,SAAS,EAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SAC3B,CAAC;IACJ,CAAC;CACF"}
package/dist/version.d.ts CHANGED
@@ -4,5 +4,5 @@
4
4
  * into the npm metadata) so we don't end up with two versions
5
5
  * drifting.
6
6
  */
7
- export declare const VERSION = "0.2.0-alpha.23";
7
+ export declare const VERSION = "0.2.0-alpha.24";
8
8
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -4,5 +4,5 @@
4
4
  * into the npm metadata) so we don't end up with two versions
5
5
  * drifting.
6
6
  */
7
- export const VERSION = '0.2.0-alpha.23';
7
+ export const VERSION = '0.2.0-alpha.24';
8
8
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nac3/forge-cli",
3
- "version": "0.2.0-alpha.23",
3
+ "version": "0.2.0-alpha.24",
4
4
  "description": "Yujin Forge -- voice-first NAC-3 React development framework. CLI + chat panel + spec ingest + 10-format document reader + voice loop.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Pablo Kuschnirof <pablo@rpaforce.com>",