forgeos 0.1.0-alpha.29 → 0.1.0-alpha.30

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.29 input=25d84ce77a02f5c4ce49fa082fa968608c9859594d5876886344276ca0c27523 content=0d493cf0e41b71cb652d5e0e1b0c1f83d2a1281b748321f0b00f0773ba93074e
1
+ // @forge-generated generator=0.1.0-alpha.30 input=5d12d4ad2a959d692b306eb18ba706c52f22f2d148c6e4ed541bd67fd8222c84 content=0d493cf0e41b71cb652d5e0e1b0c1f83d2a1281b748321f0b00f0773ba93074e
2
2
  # AGENTS.md
3
3
 
4
4
  <!-- forge-generated:start -->
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # forgeos
2
2
 
3
+ ## 0.1.0-alpha.30
4
+
5
+ ### Patch Changes
6
+
7
+ - Harden the WorkOS/AuthKit adapter and dev telemetry after the alpha.29 field app test.
8
+
9
+ - Normalize WorkOS AuthKit `User` objects before generated auth routes pass them to Forge session and organization-resolution helpers, so apps typecheck against the WorkOS SDK without unsafe direct `Record<string, unknown>` casts.
10
+ - Keep telemetry best-effort when a database adapter applies `INSERT ... RETURNING` but omits returned rows, preventing telemetry from surfacing as `FORGE_DEV_SERVER_ERROR`.
11
+ - Add regression coverage for generated WorkOS adapter typechecking and telemetry inserts that return no rows.
12
+
3
13
  ## 0.1.0-alpha.29
4
14
 
5
15
  ### Patch Changes
package/docs/changelog.md CHANGED
@@ -6,6 +6,20 @@ The canonical source file in the repository is `CHANGELOG.md`.
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.1.0-alpha.30
10
+
11
+ - Hardened the WorkOS/AuthKit adapter and dev telemetry after the alpha.29
12
+ field app test.
13
+ - Generated WorkOS AuthKit routes now normalize SDK `User` objects before
14
+ passing them into Forge session and organization-resolution helpers, so apps
15
+ typecheck cleanly against the WorkOS SDK without unsafe direct
16
+ `Record<string, unknown>` casts.
17
+ - Telemetry is now best-effort when a database adapter applies
18
+ `INSERT ... RETURNING` but omits returned rows, preventing telemetry from
19
+ surfacing as `FORGE_DEV_SERVER_ERROR`.
20
+ - Added regression coverage for generated WorkOS adapter typechecking and
21
+ telemetry inserts that return no rows.
22
+
9
23
  ## 0.1.0-alpha.29
10
24
 
11
25
  - Added the first WorkOS/AuthKit adapter surface: `forge add auth workos`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgeos",
3
- "version": "0.1.0-alpha.29",
3
+ "version": "0.1.0-alpha.30",
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.29","releaseId":"forgeos@0.1.0-alpha.29+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.30","releaseId":"forgeos@0.1.0-alpha.30+unknown","schemaVersion":"0.1.0"}
@@ -1,4 +1,4 @@
1
- // @forge-generated generator=0.1.0-alpha.29 input=25d84ce77a02f5c4ce49fa082fa968608c9859594d5876886344276ca0c27523 content=ace6a64b0efd317e17fff6fb883bd20137bde066cbee7c2a304be18b90a20fd0
1
+ // @forge-generated generator=0.1.0-alpha.30 input=5d12d4ad2a959d692b306eb18ba706c52f22f2d148c6e4ed541bd67fd8222c84 content=065153708d210de0b5893a6e8c8ecbfc8bab3b011c8f1e576ae54d9c59bff838
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.29",
23
- "releaseId": "forgeos@0.1.0-alpha.29+unknown",
22
+ "packageVersion": "0.1.0-alpha.30",
23
+ "releaseId": "forgeos@0.1.0-alpha.30+unknown",
24
24
  "schemaVersion": "0.1.0"
25
25
  } as const;
@@ -597,6 +597,22 @@ export function renderWorkosAuthRoutes(_input: IntegrationTemplateInput): string
597
597
  " return value;",
598
598
  "}",
599
599
  "",
600
+ "function workOSUserRecord(user: unknown): Record<string, unknown> {",
601
+ " if (!user || typeof user !== \"object\") return {};",
602
+ " return { ...(user as object) } as Record<string, unknown>;",
603
+ "}",
604
+ "",
605
+ "function workOSSessionUser(user: Record<string, unknown>): ForgeWorkOSSession[\"user\"] {",
606
+ " const rawId = user.id ?? user.objectId ?? user.userId;",
607
+ " return {",
608
+ " ...user,",
609
+ " id: typeof rawId === \"string\" && rawId.length > 0 ? rawId : String(rawId ?? \"workos-user\"),",
610
+ " ...(typeof user.email === \"string\" ? { email: user.email } : {}),",
611
+ " ...(typeof user.firstName === \"string\" ? { firstName: user.firstName } : {}),",
612
+ " ...(typeof user.lastName === \"string\" ? { lastName: user.lastName } : {}),",
613
+ " };",
614
+ "}",
615
+ "",
600
616
  "export function getWorkOSAuthorizationUrl(input: { workos: WorkOS; config: ForgeWorkOSAuthKitConfig; state?: string }): string {",
601
617
  " if (!input.config.redirectUri) throw new Error(\"WORKOS_REDIRECT_URI is required\");",
602
618
  " return input.workos.userManagement.getAuthorizationUrl({",
@@ -612,12 +628,13 @@ export function renderWorkosAuthRoutes(_input: IntegrationTemplateInput): string
612
628
  " code: input.code,",
613
629
  " clientId: input.config.clientId,",
614
630
  " });",
631
+ " const user = workOSUserRecord(result.user);",
615
632
  " const resolved = await input.resolveOrganization?.({",
616
- " user: result.user as Record<string, unknown>,",
633
+ " user,",
617
634
  " accessToken: result.accessToken,",
618
635
  " });",
619
636
  " return {",
620
- " user: result.user as ForgeWorkOSSession[\"user\"],",
637
+ " user: workOSSessionUser(user),",
621
638
  " accessToken: result.accessToken,",
622
639
  " ...(result.refreshToken ? { refreshToken: result.refreshToken } : {}),",
623
640
  " ...(resolved?.organizationId ? { organizationId: resolved.organizationId } : {}),",
@@ -34,7 +34,10 @@ export async function insertTelemetryEvent(
34
34
 
35
35
  const id = Number(result.rows[0]?.id);
36
36
  if (!Number.isFinite(id)) {
37
- throw new Error("telemetry insert did not return id");
37
+ // Some adapters can successfully apply INSERT ... RETURNING while omitting
38
+ // returned rows. Telemetry must not turn a successful runtime request into
39
+ // FORGE_DEV_SERVER_ERROR; SQL execution failures still throw from runQuery.
40
+ return 0;
38
41
  }
39
42
  return id;
40
43
  }
@@ -1,3 +1,3 @@
1
- export const FORGEOS_VERSION = "0.1.0-alpha.29";
1
+ export const FORGEOS_VERSION = "0.1.0-alpha.30";
2
2
  export const GENERATOR_VERSION = FORGEOS_VERSION;
3
3
  export const CLI_VERSION = FORGEOS_VERSION;