forgeos 0.1.0-alpha.53 → 0.1.0-alpha.54

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.53 input=3ed440f80e50b242cb2753283b0f3bb633fa0fc4ab79d0242f469d3a6bd258ba content=721818a6f9a664aa898092d4aa5cd68cbbd8ad6e150c7d3ad3ef785a2e3fcf53
1
+ // @forge-generated generator=0.1.0-alpha.54 input=7577a1a1a717ae3776c6725b005a98a36c149041f62ef4e28e098baad0bd1fcc content=721818a6f9a664aa898092d4aa5cd68cbbd8ad6e150c7d3ad3ef785a2e3fcf53
2
2
  # AGENTS.md
3
3
 
4
4
  <!-- forge-generated:start -->
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # forgeos
2
2
 
3
+ ## 0.1.0-alpha.54
4
+
5
+ ### Patch Changes
6
+
7
+ - Add a machine-readable WorkOS FGA hosted setup artifact.
8
+
9
+ - `forge workos fga plan --write --json` and real sync failures that write
10
+ `.forge/workos-fga-setup.md` now also write
11
+ `.forge/workos-fga-setup.json`.
12
+ - The JSON artifact includes the derived resource types, hosted setup
13
+ boundary, rerun commands, docs, unsupported automation notes, and paired
14
+ Markdown/JSON paths so agents and CI can consume the FGA handoff without
15
+ parsing Markdown.
16
+ - Human output now prints both the Markdown guide and JSON setup artifact
17
+ paths when they are written.
18
+
3
19
  ## 0.1.0-alpha.53
4
20
 
5
21
  ### Patch Changes
package/docs/changelog.md CHANGED
@@ -6,6 +6,14 @@ The canonical source file in the repository is `CHANGELOG.md`.
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.1.0-alpha.54
10
+
11
+ - WorkOS FGA setup writes now produce a paired machine-readable
12
+ `.forge/workos-fga-setup.json` artifact alongside the Markdown guide.
13
+ - The JSON artifact includes derived resource types, hosted setup boundary,
14
+ rerun commands, docs, unsupported automation notes, and paired artifact paths
15
+ for agents and CI.
16
+
9
17
  ## 0.1.0-alpha.53
10
18
 
11
19
  - `forge workos fga doctor --json` now distinguishes local FGA proof timestamps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgeos",
3
- "version": "0.1.0-alpha.53",
3
+ "version": "0.1.0-alpha.54",
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.53","releaseId":"forgeos@0.1.0-alpha.53+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.54","releaseId":"forgeos@0.1.0-alpha.54+unknown","schemaVersion":"0.1.0"}
@@ -1,4 +1,4 @@
1
- // @forge-generated generator=0.1.0-alpha.53 input=3ed440f80e50b242cb2753283b0f3bb633fa0fc4ab79d0242f469d3a6bd258ba content=a648def26a36193279d13f385b2c17a555fadf46893ffee57e87f439642c958e
1
+ // @forge-generated generator=0.1.0-alpha.54 input=7577a1a1a717ae3776c6725b005a98a36c149041f62ef4e28e098baad0bd1fcc content=7078de03fb1c3ae829b803fdfd1e9320fa10b8c128e51d374d8afab09cdc3df5
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.53",
23
- "releaseId": "forgeos@0.1.0-alpha.53+unknown",
22
+ "packageVersion": "0.1.0-alpha.54",
23
+ "releaseId": "forgeos@0.1.0-alpha.54+unknown",
24
24
  "schemaVersion": "0.1.0"
25
25
  } as const;
@@ -57,6 +57,7 @@ const GENERATED_SEED_FILE = `${GENERATED_DIR}/integrations/workos/workos-seed.ym
57
57
  const WORKOS_SEED_STATE_FILE = ".workos-seed-state.json";
58
58
  const WORKOS_FGA_STATE_FILE = ".workos-fga-state.json";
59
59
  const WORKOS_FGA_SETUP_GUIDE_FILE = ".forge/workos-fga-setup.md";
60
+ const WORKOS_FGA_SETUP_PLAN_FILE = ".forge/workos-fga-setup.json";
60
61
 
61
62
  function runExternalCommand(
62
63
  command: string[],
@@ -714,7 +715,16 @@ export interface WorkOSFgaResourceTypeSetup {
714
715
  }
715
716
 
716
717
  export interface WorkOSFgaSetupGuide {
718
+ schemaVersion: "0.1.0";
719
+ kind: "workos-fga-setup";
717
720
  resourceTypes: WorkOSFgaResourceTypeSetup[];
721
+ hostedSetup: WorkOSFgaHostedSetup;
722
+ commands: {
723
+ plan: string;
724
+ syncReal: string;
725
+ proveReal: string;
726
+ deployCheck: string;
727
+ };
718
728
  markdown: string;
719
729
  docs: string[];
720
730
  unsupportedAutomation: string[];
@@ -1196,7 +1206,16 @@ function workOSFgaSetupGuide(manifest: WorkOSFgaManifest, hostedSetup: WorkOSFga
1196
1206
  "",
1197
1207
  ].join("\n");
1198
1208
  return {
1209
+ schemaVersion: "0.1.0",
1210
+ kind: "workos-fga-setup",
1199
1211
  resourceTypes,
1212
+ hostedSetup,
1213
+ commands: {
1214
+ plan: "forge workos fga plan --file workos-seed.yml --write --json",
1215
+ syncReal: "forge workos fga sync --real --file workos-seed.yml --json",
1216
+ proveReal: "forge workos fga prove --real --file workos-seed.yml --json",
1217
+ deployCheck: "forge deploy check --production --json",
1218
+ },
1200
1219
  markdown,
1201
1220
  docs: hostedSetup.docs,
1202
1221
  unsupportedAutomation: [
@@ -1214,16 +1233,34 @@ function resolveWorkOSFgaSetupGuidePath(options: WorkOSCommandOptions): string |
1214
1233
  return candidate && candidate !== "true" && !candidate.startsWith("--") ? candidate : WORKOS_FGA_SETUP_GUIDE_FILE;
1215
1234
  }
1216
1235
 
1236
+ function workOSFgaSetupPlanPath(markdownPath: string): string {
1237
+ if (markdownPath === WORKOS_FGA_SETUP_GUIDE_FILE) {
1238
+ return WORKOS_FGA_SETUP_PLAN_FILE;
1239
+ }
1240
+ return markdownPath.endsWith(".md")
1241
+ ? `${markdownPath.slice(0, -3)}.json`
1242
+ : `${markdownPath}.json`;
1243
+ }
1244
+
1217
1245
  function writeWorkOSFgaSetupGuide(
1218
1246
  workspaceRoot: string,
1219
1247
  guide: WorkOSFgaSetupGuide,
1220
1248
  preferredPath = WORKOS_FGA_SETUP_GUIDE_FILE,
1221
- ): string {
1249
+ ): { markdownPath: string; jsonPath: string } {
1222
1250
  const relativePath = preferredPath.startsWith("/") ? preferredPath.slice(1) : preferredPath;
1223
1251
  const absolutePath = join(workspaceRoot, relativePath);
1224
1252
  mkdirSync(dirname(absolutePath), { recursive: true });
1225
1253
  writeFileSync(absolutePath, guide.markdown, "utf8");
1226
- return relativePath;
1254
+ const jsonPath = workOSFgaSetupPlanPath(relativePath);
1255
+ const absoluteJsonPath = join(workspaceRoot, jsonPath);
1256
+ mkdirSync(dirname(absoluteJsonPath), { recursive: true });
1257
+ const { markdown: _markdown, ...jsonGuide } = guide;
1258
+ writeFileSync(absoluteJsonPath, `${JSON.stringify({
1259
+ ...jsonGuide,
1260
+ markdownPath: relativePath,
1261
+ jsonPath,
1262
+ }, null, 2)}\n`, "utf8");
1263
+ return { markdownPath: relativePath, jsonPath };
1227
1264
  }
1228
1265
 
1229
1266
  function fgaData(input: {
@@ -1240,6 +1277,7 @@ function fgaData(input: {
1240
1277
  nextCommand?: string;
1241
1278
  nextActions?: string[];
1242
1279
  setupGuidePath?: string;
1280
+ setupGuideJsonPath?: string;
1243
1281
  }): Record<string, unknown> {
1244
1282
  const hostedSetup = workOSFgaHostedSetup(input.manifest, input.workosSdk);
1245
1283
  const setupGuide = workOSFgaSetupGuide(input.manifest, hostedSetup);
@@ -1259,6 +1297,7 @@ function fgaData(input: {
1259
1297
  ...(input.workosSdk ? { workosSdk: input.workosSdk } : {}),
1260
1298
  ...(input.stateFile ? { stateFile: input.stateFile } : {}),
1261
1299
  ...(input.setupGuidePath ? { setupGuidePath: input.setupGuidePath } : {}),
1300
+ ...(input.setupGuideJsonPath ? { setupGuideJsonPath: input.setupGuideJsonPath } : {}),
1262
1301
  nextCommand: input.nextCommand,
1263
1302
  nextActions: input.nextActions ?? hostedSetup.nextActions,
1264
1303
  notes: [
@@ -2764,9 +2803,12 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2764
2803
  const manifest = collectWorkOSFgaManifest(options.workspaceRoot, file);
2765
2804
  const initialHostedSetup = workOSFgaHostedSetup(manifest);
2766
2805
  const setupGuidePath = resolveWorkOSFgaSetupGuidePath(options);
2767
- const writtenSetupGuidePath = setupGuidePath
2806
+ const writtenSetupGuide = setupGuidePath
2768
2807
  ? writeWorkOSFgaSetupGuide(options.workspaceRoot, workOSFgaSetupGuide(manifest, initialHostedSetup), setupGuidePath)
2769
2808
  : undefined;
2809
+ const writtenSetupGuideData = writtenSetupGuide
2810
+ ? { setupGuidePath: writtenSetupGuide.markdownPath, setupGuideJsonPath: writtenSetupGuide.jsonPath }
2811
+ : {};
2770
2812
  let state = readWorkOSFgaState(options.workspaceRoot, manifest);
2771
2813
  const command = ["forge", "workos", "fga", action, "--file", file];
2772
2814
  const real = options.real ?? false;
@@ -2798,7 +2840,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2798
2840
  state,
2799
2841
  seedState,
2800
2842
  real,
2801
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
2843
+ ...writtenSetupGuideData,
2802
2844
  nextCommand: `forge workos fga sync --file ${file} --json`,
2803
2845
  }),
2804
2846
  exitCode: ok ? 0 : 1,
@@ -2835,7 +2877,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2835
2877
  seedState,
2836
2878
  real,
2837
2879
  ...(cliAuth ? { cliAuth } : {}),
2838
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
2880
+ ...writtenSetupGuideData,
2839
2881
  nextCommand: real ? `forge workos fga sync --real --file ${file} --json` : `forge workos fga plan --file ${file} --json`,
2840
2882
  }),
2841
2883
  exitCode: 1,
@@ -2856,7 +2898,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2856
2898
  seedState,
2857
2899
  real,
2858
2900
  ...(cliAuth ? { cliAuth } : {}),
2859
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
2901
+ ...writtenSetupGuideData,
2860
2902
  nextCommand: real ? `forge workos fga sync --real --file ${file} --json` : `forge workos fga sync --file ${file} --json`,
2861
2903
  }),
2862
2904
  exitCode: 0,
@@ -2886,7 +2928,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2886
2928
  real,
2887
2929
  ...(cliAuth ? { cliAuth } : {}),
2888
2930
  workosSdk: sdk.data,
2889
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
2931
+ ...writtenSetupGuideData,
2890
2932
  nextCommand: `forge workos fga sync --real --file ${file} --json`,
2891
2933
  nextActions: workOSFgaHostedSetup(manifest, sdk.data).nextActions,
2892
2934
  }),
@@ -2919,7 +2961,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2919
2961
  ...(cliAuth ? { cliAuth } : {}),
2920
2962
  ...(sdk ? { workosSdk: sdk.data } : {}),
2921
2963
  stateFile,
2922
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
2964
+ ...writtenSetupGuideData,
2923
2965
  nextCommand: real ? `forge workos fga prove --real --file ${file} --json` : `forge workos fga prove --file ${file} --json`,
2924
2966
  }),
2925
2967
  exitCode: 0,
@@ -2992,7 +3034,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
2992
3034
  ...(cliAuth ? { cliAuth } : {}),
2993
3035
  ...(sdk ? { workosSdk: sdk.data } : {}),
2994
3036
  ...(stateFile ? { stateFile } : {}),
2995
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
3037
+ ...writtenSetupGuideData,
2996
3038
  nextCommand: ok ? "forge deploy check --production --json" : `forge workos fga sync${real ? " --real" : ""} --file ${file} --json`,
2997
3039
  }),
2998
3040
  stdout: sdk?.stdout,
@@ -3032,7 +3074,7 @@ export function runWorkOSFgaCommand(options: WorkOSCommandOptions): WorkOSComman
3032
3074
  seedState,
3033
3075
  readiness,
3034
3076
  real,
3035
- ...(writtenSetupGuidePath ? { setupGuidePath: writtenSetupGuidePath } : {}),
3077
+ ...writtenSetupGuideData,
3036
3078
  nextCommand: readiness.nextCommand,
3037
3079
  nextActions: readiness.nextActions,
3038
3080
  }),
@@ -3159,11 +3201,14 @@ export function formatWorkOSHuman(result: WorkOSCommandResult): string {
3159
3201
  }
3160
3202
  if (result.kind === "workos-fga") {
3161
3203
  const data = result.data && typeof result.data === "object"
3162
- ? result.data as { action?: string; real?: boolean; nextCommand?: string; stateFile?: string; setupGuidePath?: string; nextActions?: string[] }
3204
+ ? result.data as { action?: string; real?: boolean; nextCommand?: string; stateFile?: string; setupGuidePath?: string; setupGuideJsonPath?: string; nextActions?: string[] }
3163
3205
  : {};
3164
3206
  if (data.setupGuidePath) {
3165
3207
  lines.push(`FGA setup guide: ${data.setupGuidePath}`);
3166
3208
  }
3209
+ if (data.setupGuideJsonPath) {
3210
+ lines.push(`FGA setup JSON: ${data.setupGuideJsonPath}`);
3211
+ }
3167
3212
  if (result.ok && data.action === "plan") {
3168
3213
  lines.push(`WorkOS FGA plan passed; run ${data.nextCommand ?? "forge workos fga sync --json"}.`);
3169
3214
  } else if (result.ok && data.action === "sync") {
@@ -1,3 +1,3 @@
1
- export const FORGEOS_VERSION = "0.1.0-alpha.53";
1
+ export const FORGEOS_VERSION = "0.1.0-alpha.54";
2
2
  export const GENERATOR_VERSION = FORGEOS_VERSION;
3
3
  export const CLI_VERSION = FORGEOS_VERSION;