forgeos 0.1.0-alpha.45 → 0.1.0-alpha.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- // @forge-generated generator=0.1.0-alpha.45 input=bd2a19728a6c6eef99a21730384e4e1f16b60d6e561897a0b6f307c136f9555c content=721818a6f9a664aa898092d4aa5cd68cbbd8ad6e150c7d3ad3ef785a2e3fcf53
1
+ // @forge-generated generator=0.1.0-alpha.46 input=fa019b5420e754f08100c96852edfc9ea0b39a6b050cbd9bc99106b88775c207 content=721818a6f9a664aa898092d4aa5cd68cbbd8ad6e150c7d3ad3ef785a2e3fcf53
2
2
  # AGENTS.md
3
3
 
4
4
  <!-- forge-generated:start -->
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # forgeos
2
2
 
3
+ ## 0.1.0-alpha.46
4
+
5
+ ### Patch Changes
6
+
7
+ - Smooth the package upgrade apply path used by real ForgeOS apps.
8
+
9
+ - `forge deps upgrade-apply` and `forge deps upgrade-rollback` now accept the
10
+ `planDir` returned by `forge deps upgrade-plan`, automatically resolving it
11
+ to `plan.json`.
12
+ - Passing a directory without `plan.json` now returns a targeted
13
+ `FORGE_DEPS_TARGET_NOT_FOUND` diagnostic with the exact suggested command
14
+ instead of falling through to a generic JSON parse failure.
15
+ - Add regression coverage for applying upgrade plans through the returned
16
+ directory path and for invalid plan directories.
17
+
3
18
  ## 0.1.0-alpha.45
4
19
 
5
20
  ### Patch Changes
package/docs/changelog.md CHANGED
@@ -6,6 +6,17 @@ The canonical source file in the repository is `CHANGELOG.md`.
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.1.0-alpha.46
10
+
11
+ - `forge deps upgrade-apply` and `forge deps upgrade-rollback` now accept the
12
+ `planDir` returned by `forge deps upgrade-plan`, resolving it to the nested
13
+ `plan.json` automatically.
14
+ - Invalid upgrade plan directories now return a precise
15
+ `FORGE_DEPS_TARGET_NOT_FOUND` diagnostic with suggested commands instead of a
16
+ generic JSON parse failure.
17
+ - Added regression coverage for plan-directory apply behavior and missing
18
+ `plan.json` diagnostics.
19
+
9
20
  ## 0.1.0-alpha.45
10
21
 
11
22
  - `forge workos setup/prove --real` now passes the top-level unknown-option
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgeos",
3
- "version": "0.1.0-alpha.45",
3
+ "version": "0.1.0-alpha.46",
4
4
  "description": "Agent-native application framework and compiler for building Forge apps without a mandatory dashboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1 +1 @@
1
- {"defaultProvider":"local","diagnostics":[],"env":{"deployEnv":"FORGE_DEPLOY_ENV","deployId":"FORGE_DEPLOY_ID","publicReleaseId":"NEXT_PUBLIC_FORGE_RELEASE_ID","releaseId":"FORGE_RELEASE_ID"},"gitSha":"unknown","optionalProviders":["local","sentry-compatible","sentry","glitchtip","bugsink","otel","custom"],"packageName":"forgeos","packageVersion":"0.1.0-alpha.45","releaseId":"forgeos@0.1.0-alpha.45+unknown","schemaVersion":"0.1.0"}
1
+ {"defaultProvider":"local","diagnostics":[],"env":{"deployEnv":"FORGE_DEPLOY_ENV","deployId":"FORGE_DEPLOY_ID","publicReleaseId":"NEXT_PUBLIC_FORGE_RELEASE_ID","releaseId":"FORGE_RELEASE_ID"},"gitSha":"unknown","optionalProviders":["local","sentry-compatible","sentry","glitchtip","bugsink","otel","custom"],"packageName":"forgeos","packageVersion":"0.1.0-alpha.46","releaseId":"forgeos@0.1.0-alpha.46+unknown","schemaVersion":"0.1.0"}
@@ -1,4 +1,4 @@
1
- // @forge-generated generator=0.1.0-alpha.45 input=bd2a19728a6c6eef99a21730384e4e1f16b60d6e561897a0b6f307c136f9555c content=ddd1dcdfbef3bde6b2457bcfc5fd270a97d6d97ec6477305dc9c47c9f85f7c05
1
+ // @forge-generated generator=0.1.0-alpha.46 input=fa019b5420e754f08100c96852edfc9ea0b39a6b050cbd9bc99106b88775c207 content=715d49dd9abed8465a5cf5e82713973aab97cc178fda3b1e8b1647b93683ee58
2
2
  export const releaseManifest = {
3
3
  "defaultProvider": "local",
4
4
  "diagnostics": [],
@@ -19,7 +19,7 @@ export const releaseManifest = {
19
19
  "custom"
20
20
  ],
21
21
  "packageName": "forgeos",
22
- "packageVersion": "0.1.0-alpha.45",
23
- "releaseId": "forgeos@0.1.0-alpha.45+unknown",
22
+ "packageVersion": "0.1.0-alpha.46",
23
+ "releaseId": "forgeos@0.1.0-alpha.46+unknown",
24
24
  "schemaVersion": "0.1.0"
25
25
  } as const;
@@ -73,15 +73,55 @@ function readGeneratedJson<T>(workspaceRoot: string, relative: string): T | null
73
73
  return JSON.parse(raw) as T;
74
74
  }
75
75
 
76
- function planPathFor(workspaceRoot: string, planIdOrPath: string): string {
77
- if (nodeFileSystem.exists(planIdOrPath)) {
78
- return planIdOrPath;
79
- }
80
- const direct = join(workspaceRoot, planIdOrPath);
81
- if (nodeFileSystem.exists(direct)) {
82
- return direct;
76
+ function resolvePlanPathFor(
77
+ workspaceRoot: string,
78
+ planIdOrPath: string,
79
+ ): { ok: true; path: string } | { ok: false; diagnostics: Diagnostic[] } {
80
+ const candidates = [
81
+ planIdOrPath,
82
+ join(workspaceRoot, planIdOrPath),
83
+ join(workspaceRoot, ".forge", "upgrades", planIdOrPath, "plan.json"),
84
+ ];
85
+
86
+ for (const candidate of candidates) {
87
+ if (!nodeFileSystem.exists(candidate)) {
88
+ continue;
89
+ }
90
+ if (!nodeFileSystem.isDirectory(candidate)) {
91
+ return { ok: true, path: candidate };
92
+ }
93
+ const nestedPlan = join(candidate, "plan.json");
94
+ if (nodeFileSystem.exists(nestedPlan) && !nodeFileSystem.isDirectory(nestedPlan)) {
95
+ return { ok: true, path: nestedPlan };
96
+ }
97
+ return {
98
+ ok: false,
99
+ diagnostics: [{
100
+ severity: "error",
101
+ code: "FORGE_DEPS_TARGET_NOT_FOUND",
102
+ message: `upgrade plan directory '${planIdOrPath}' does not contain plan.json`,
103
+ fixHint: "Pass the plan.json file returned by forge deps upgrade-plan, or rerun upgrade-plan.",
104
+ suggestedCommands: [
105
+ `forge deps upgrade-apply ${nestedPlan} --json`,
106
+ "forge deps upgrade-plan <package> --to latest --json",
107
+ ],
108
+ }],
109
+ };
83
110
  }
84
- return join(workspaceRoot, ".forge", "upgrades", planIdOrPath, "plan.json");
111
+
112
+ return {
113
+ ok: false,
114
+ diagnostics: [{
115
+ severity: "error",
116
+ code: "FORGE_DEPS_TARGET_NOT_FOUND",
117
+ message: `upgrade plan '${planIdOrPath}' was not found`,
118
+ fixHint: "Use the planDir or plan.json path returned by forge deps upgrade-plan.",
119
+ suggestedCommands: [
120
+ `forge deps upgrade-apply .forge/upgrades/${planIdOrPath}/plan.json --json`,
121
+ "forge deps upgrade-plan <package> --to latest --json",
122
+ ],
123
+ }],
124
+ };
85
125
  }
86
126
 
87
127
  function findPackage(workspaceRoot: string, packageName: string): {
@@ -395,9 +435,17 @@ export async function runDepsCommand(options: DepsCommandOptions): Promise<DepsC
395
435
  if (!options.planPath) {
396
436
  return missingPlan();
397
437
  }
438
+ const resolvedPlan = resolvePlanPathFor(options.workspaceRoot, options.planPath);
439
+ if (!resolvedPlan.ok) {
440
+ return {
441
+ ok: false,
442
+ diagnostics: resolvedPlan.diagnostics,
443
+ exitCode: 1,
444
+ };
445
+ }
398
446
  const applied = await applyUpgradePlan({
399
447
  workspaceRoot: options.workspaceRoot,
400
- planPath: planPathFor(options.workspaceRoot, options.planPath),
448
+ planPath: resolvedPlan.path,
401
449
  yes: options.yes,
402
450
  allowScripts: options.allowScripts,
403
451
  skipTests: options.skipTests,
@@ -409,6 +457,7 @@ export async function runDepsCommand(options: DepsCommandOptions): Promise<DepsC
409
457
  applied: applied.applied,
410
458
  rolledBack: applied.rolledBack,
411
459
  reinstallCommand: applied.plan?.rollback.reinstallCommand,
460
+ planPath: resolvedPlan.path,
412
461
  },
413
462
  diagnostics: applied.diagnostics,
414
463
  exitCode: applied.exitCode,
@@ -419,15 +468,24 @@ export async function runDepsCommand(options: DepsCommandOptions): Promise<DepsC
419
468
  if (!options.planPath) {
420
469
  return missingPlan();
421
470
  }
471
+ const resolvedPlan = resolvePlanPathFor(options.workspaceRoot, options.planPath);
472
+ if (!resolvedPlan.ok) {
473
+ return {
474
+ ok: false,
475
+ diagnostics: resolvedPlan.diagnostics,
476
+ exitCode: 1,
477
+ };
478
+ }
422
479
  const rolledBack = rollbackUpgradePlan({
423
480
  workspaceRoot: options.workspaceRoot,
424
- planPath: planPathFor(options.workspaceRoot, options.planPath),
481
+ planPath: resolvedPlan.path,
425
482
  });
426
483
  return {
427
484
  ok: rolledBack.ok,
428
485
  data: {
429
486
  rolledBack: rolledBack.rolledBack,
430
487
  reinstallCommand: rolledBack.plan?.rollback.reinstallCommand,
488
+ planPath: resolvedPlan.path,
431
489
  },
432
490
  diagnostics: rolledBack.diagnostics,
433
491
  exitCode: rolledBack.exitCode,
@@ -1,3 +1,3 @@
1
- export const FORGEOS_VERSION = "0.1.0-alpha.45";
1
+ export const FORGEOS_VERSION = "0.1.0-alpha.46";
2
2
  export const GENERATOR_VERSION = FORGEOS_VERSION;
3
3
  export const CLI_VERSION = FORGEOS_VERSION;