@agent-native/core 0.205.0 → 0.205.1-nightly-20261008213122

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.
@@ -1,6 +1,7 @@
1
1
  import { getDbExec } from "../db/client.js";
2
2
  import { getAppPermissionOverrides, getRegisteredAppRoles, resolveAppRole, } from "../org/app-roles.js";
3
3
  import { isWorkspaceAppAccessAllowed, WORKSPACE_APP_ACCESS_UNAVAILABLE, WORKSPACE_APP_ACCESS_UNAVAILABLE_MESSAGE, } from "../org/workspace-app-access.js";
4
+ import { resolveWorkspaceAccessAppId } from "../org/workspace-app-identity.js";
4
5
  import { ForbiddenError, resolveAccess } from "../sharing/access.js";
5
6
  import { ROLE_RANK } from "../sharing/schema.js";
6
7
  import { registerActionAccessChecker } from "./action-access-runtime.js";
@@ -63,10 +64,13 @@ export async function checkAction(config, args, ctx, target) {
63
64
  permission,
64
65
  };
65
66
  }
66
- const appAllowed = await isWorkspaceAppAccessAllowed(appId, {
67
- email: identity.userEmail,
68
- orgId: identity.orgId,
69
- });
67
+ const workspaceAppId = resolveWorkspaceAccessAppId(appId);
68
+ const appAllowed = workspaceAppId
69
+ ? await isWorkspaceAppAccessAllowed(workspaceAppId, {
70
+ email: identity.userEmail,
71
+ orgId: identity.orgId,
72
+ })
73
+ : true;
70
74
  if (appAllowed === WORKSPACE_APP_ACCESS_UNAVAILABLE) {
71
75
  throw Object.assign(new Error(WORKSPACE_APP_ACCESS_UNAVAILABLE_MESSAGE), {
72
76
  statusCode: 503,
@@ -13,8 +13,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
13
13
  };
14
14
  }>>;
15
15
  export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
16
- ok?: undefined;
17
16
  error: string;
17
+ ok?: undefined;
18
18
  } | {
19
19
  error?: undefined;
20
20
  ok: boolean;
@@ -4029,6 +4029,12 @@ export async function runNitroBuildPipeline(opts) {
4029
4029
  patchReactRouterServerManifestInOutput(nitro.options.output.serverDir, trustedClientDirectory, resolvedClientDir);
4030
4030
  }
4031
4031
  }
4032
+ function removeServerSourceMaps(serverDir) {
4033
+ const sourceMaps = fs.globSync("**/*.map", { cwd: serverDir });
4034
+ for (const sourceMap of sourceMaps) {
4035
+ fs.rmSync(path.join(serverDir, sourceMap), { force: true });
4036
+ }
4037
+ }
4032
4038
  function resolveNitroClientDirectory(cwd, defaultClientDirectory) {
4033
4039
  const configured = process.env[PREBUILT_CLIENT_DIRECTORY_ENV]?.trim();
4034
4040
  const clientDirectory = configured
@@ -4357,6 +4363,10 @@ export default bundle;
4357
4363
  if (isCloudflareModulePreset(preset)) {
4358
4364
  bundleYjsRuntimeForServerlessOutput(nitro.options.output.serverDir, cwd);
4359
4365
  }
4366
+ if (sentryServerSourceMapPlugins.length > 0) {
4367
+ removeServerSourceMaps(nitro.options.output.serverDir);
4368
+ console.log("[deploy] Ensured Nitro server output is free of source maps before function packaging.");
4369
+ }
4360
4370
  if (preset === "netlify") {
4361
4371
  if (isDurableBackgroundEmitRequired()) {
4362
4372
  emitSingleTemplateNetlifyBackgroundFunction(cwd);
@@ -1,13 +1,13 @@
1
1
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
2
2
  count: number;
3
3
  updated?: undefined;
4
- ok?: undefined;
5
4
  error?: undefined;
5
+ ok?: undefined;
6
6
  } | {
7
7
  count?: undefined;
8
8
  updated: number;
9
- ok?: undefined;
10
9
  error?: undefined;
10
+ ok?: undefined;
11
11
  } | {
12
12
  count?: undefined;
13
13
  updated?: undefined;
@@ -16,6 +16,6 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
16
16
  } | {
17
17
  count?: undefined;
18
18
  updated?: undefined;
19
- ok: boolean;
20
19
  error?: undefined;
20
+ ok: boolean;
21
21
  }>>;
@@ -33,27 +33,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
33
33
  summary?: undefined;
34
34
  spans?: undefined;
35
35
  } | {
36
+ error?: undefined;
36
37
  ok?: undefined;
37
38
  message?: undefined;
38
39
  summary: import("./types.js").TraceSummary;
39
40
  spans: import("./types.js").TraceSpan[];
40
- error?: undefined;
41
41
  } | {
42
+ error?: undefined;
42
43
  ok?: undefined;
43
44
  message?: undefined;
44
45
  summary?: undefined;
45
46
  spans?: undefined;
46
47
  traceMissing: true;
47
48
  id: string;
48
- error?: undefined;
49
49
  } | {
50
+ error?: undefined;
50
51
  ok?: undefined;
51
52
  message?: undefined;
52
53
  summary?: undefined;
53
54
  spans?: undefined;
54
55
  traceMissing?: undefined;
55
56
  id: string;
56
- error?: undefined;
57
57
  } | {
58
58
  ok?: undefined;
59
59
  message?: undefined;
@@ -61,9 +61,9 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
61
61
  spans?: undefined;
62
62
  error: any;
63
63
  } | {
64
+ error?: undefined;
64
65
  message?: undefined;
65
66
  summary?: undefined;
66
67
  spans?: undefined;
67
68
  ok: boolean;
68
- error?: undefined;
69
69
  }>>;
@@ -177,10 +177,10 @@ export declare const getMyOrgHandler: import("h3").EventHandlerWithFetch<import(
177
177
  soloDeploymentAdmin: boolean | undefined;
178
178
  }>>;
179
179
  export declare const createOrgHandler: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
180
+ role?: undefined;
180
181
  name?: undefined;
181
182
  success: boolean;
182
183
  id?: undefined;
183
- role?: undefined;
184
184
  } | {
185
185
  success?: undefined;
186
186
  id: string;
@@ -0,0 +1 @@
1
+ export declare function resolveWorkspaceAccessAppId(targetAppId?: string): string;
@@ -0,0 +1,25 @@
1
+ import { getAppConfig } from "../app-config/index.js";
2
+ export function resolveWorkspaceAccessAppId(targetAppId) {
3
+ const app = getAppConfig().app;
4
+ const identities = [
5
+ app.id,
6
+ app.legacyId,
7
+ app.template,
8
+ app.slug,
9
+ app.packageName,
10
+ app.workspaceId,
11
+ ]
12
+ .map((value) => value?.trim())
13
+ .filter(Boolean);
14
+ // Other apps still require their own workspace grant; only this deployment's
15
+ // aliases resolve to the identity used by its HTTP access gate.
16
+ const target = targetAppId?.trim();
17
+ if (target && !identities.includes(target))
18
+ return target;
19
+ const workspaceId = app.workspaceId?.trim();
20
+ if (workspaceId)
21
+ return workspaceId;
22
+ return identities.some((value) => value?.toLowerCase() === "dispatch")
23
+ ? "dispatch"
24
+ : "";
25
+ }
@@ -75,8 +75,8 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
75
75
  user: "user";
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
- message?: undefined;
79
78
  id?: undefined;
79
+ message?: undefined;
80
80
  found?: undefined;
81
81
  providers: {
82
82
  id: string;
@@ -93,9 +93,9 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
93
93
  registered?: undefined;
94
94
  label?: undefined;
95
95
  } | {
96
- message?: undefined;
97
96
  id?: undefined;
98
97
  count?: undefined;
98
+ message?: undefined;
99
99
  providers?: undefined;
100
100
  found: boolean;
101
101
  provider: import("../custom-registry.js").CustomProviderConfig;
@@ -103,8 +103,8 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
103
103
  registered?: undefined;
104
104
  label?: undefined;
105
105
  } | {
106
- message?: undefined;
107
106
  count?: undefined;
107
+ message?: undefined;
108
108
  providers?: undefined;
109
109
  provider?: undefined;
110
110
  found: boolean;
@@ -113,8 +113,8 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
113
113
  registered?: undefined;
114
114
  label?: undefined;
115
115
  } | {
116
- message?: undefined;
117
116
  count?: undefined;
117
+ message?: undefined;
118
118
  found?: undefined;
119
119
  providers?: undefined;
120
120
  provider?: undefined;
@@ -9,16 +9,16 @@ export declare const AGENT_ENGINE_API_KEY_ACTION_NAME = "agent-engine-api-key";
9
9
  */
10
10
  export declare function createAgentEngineDisconnectHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
11
11
  error: string;
12
- ok?: undefined;
13
12
  scope?: undefined;
13
+ ok?: undefined;
14
14
  } | {
15
15
  ok: boolean;
16
16
  error: any;
17
17
  scope?: undefined;
18
18
  } | {
19
- error?: undefined;
20
19
  ok: boolean;
21
20
  scope: "org" | "user";
21
+ error?: undefined;
22
22
  }>>;
23
23
  export interface DefaultModelSelectionRequest {
24
24
  engine: string;
@@ -4,6 +4,7 @@ import { getAppConfig, resolveAppHomePath } from "../app-config/index.js";
4
4
  import { acceptPendingInvitationsForEmail } from "../org/accept-pending.js";
5
5
  import { newOrgSelection, ORG_SELECTION_COOKIE, } from "../org/request-org-cache.js";
6
6
  import { isWorkspaceAppAccessAllowed, WORKSPACE_APP_ACCESS_UNAVAILABLE, WORKSPACE_APP_ACCESS_UNAVAILABLE_MESSAGE, } from "../org/workspace-app-access.js";
7
+ import { resolveWorkspaceAccessAppId } from "../org/workspace-app-identity.js";
7
8
  import { EMBED_SESSION_COOKIE, EMBED_START_PATH, EMBED_TARGET_HEADER, isMcpDirectoryWidgetReadCapabilityScope, } from "../shared/embed-auth.js";
8
9
  import { FIRST_RUN_ONBOARDING_COOKIE, FIRST_RUN_ONBOARDING_MAX_AGE, } from "../shared/first-run-onboarding.js";
9
10
  import { isGoogleProfileImageUrl } from "../shared/google-profile-image.js";
@@ -2682,20 +2683,6 @@ function loginHtmlResponse(config, event, requestPath, options = {}) {
2682
2683
  },
2683
2684
  });
2684
2685
  }
2685
- function resolveWorkspaceAccessAppId() {
2686
- const app = getAppConfig().app;
2687
- const workspaceId = app.workspaceId?.trim();
2688
- if (workspaceId)
2689
- return workspaceId;
2690
- const isDispatch = [
2691
- app.id,
2692
- app.legacyId,
2693
- app.template,
2694
- app.slug,
2695
- app.packageName,
2696
- ].some((value) => value?.trim().toLowerCase() === "dispatch");
2697
- return isDispatch ? "dispatch" : "";
2698
- }
2699
2686
  function isHtmlDocumentRequest(event, pathname) {
2700
2687
  if (!isReadMethod(event))
2701
2688
  return false;
@@ -4,7 +4,7 @@ import { getAppConfig } from "../app-config/index.js";
4
4
  import { normalizeAnalyticsAnonymousId } from "../shared/analytics-anonymous-id.js";
5
5
  import { normalizeAppPath } from "../shared/sign-in-journey.js";
6
6
  import { getAppBasePathFromViteEnv } from "./app-base-path.js";
7
- import { readAnalyticsAnonymousId, signupAttributionFromCookieHeader, } from "./attribution.js";
7
+ import { readAnalyticsAnonymousId, readAnalyticsSessionId, signupAttributionFromCookieHeader, } from "./attribution.js";
8
8
  import { getBetterAuthUserIdForEmail, hasBetterAuthUserEmail, trackSignupEvent, } from "./better-auth-instance.js";
9
9
  import { getWorkspaceA2ADerivedSecret } from "./derived-secret.js";
10
10
  import { writeDesktopSso } from "./desktop-sso.js";
@@ -575,10 +575,12 @@ export async function createOAuthSession(event, email, opts) {
575
575
  setFirstRunOnboardingCookie(event);
576
576
  }
577
577
  if (shouldTrackSignup && opts.trackSignup) {
578
+ const signupCookieHeader = getHeader(event, "cookie") ?? null;
578
579
  const attribution = opts.trackSignup.attribution ??
579
- signupAttributionFromCookieHeader(getHeader(event, "cookie") ?? null);
580
+ signupAttributionFromCookieHeader(signupCookieHeader);
580
581
  const anonymousId = opts.trackSignup.signupAnonymousId ??
581
- readAnalyticsAnonymousId(getHeader(event, "cookie") ?? null);
582
+ readAnalyticsAnonymousId(signupCookieHeader);
583
+ const sessionId = readAnalyticsSessionId(signupCookieHeader);
582
584
  const authUserId = (await getBetterAuthUserIdForEmail(email)) ??
583
585
  opts.trackSignup.canonicalAuthUserId;
584
586
  await trackSignupEvent({
@@ -590,6 +592,7 @@ export async function createOAuthSession(event, email, opts) {
590
592
  name: opts.trackSignup.name,
591
593
  attribution,
592
594
  anonymousId,
595
+ sessionId,
593
596
  });
594
597
  }
595
598
  // Desktop SSO: record this session in the home-dir broker file so
@@ -29,10 +29,10 @@ declare const _default: import("../../action.js").ActionDefinition<{
29
29
  executionEngine?: undefined;
30
30
  executionCwd?: undefined;
31
31
  } | {
32
+ scope?: undefined;
32
33
  enabled?: undefined;
33
34
  nextRun?: undefined;
34
35
  created?: undefined;
35
- scope?: undefined;
36
36
  triggerType?: undefined;
37
37
  event?: undefined;
38
38
  deleted: boolean;
@@ -45,9 +45,9 @@ declare const _default: import("../../action.js").ActionDefinition<{
45
45
  executionCwd?: undefined;
46
46
  webhookPath?: undefined;
47
47
  } | {
48
+ scope?: undefined;
48
49
  deleted?: undefined;
49
50
  created?: undefined;
50
- scope?: undefined;
51
51
  triggerType?: undefined;
52
52
  event?: undefined;
53
53
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.205.0",
3
+ "version": "0.205.1-nightly-20261008213122",
4
4
  "description": "The agentic application framework for building autonomous agents with intuitive UIs",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -685,8 +685,8 @@
685
685
  "yaml": "^2.9.0",
686
686
  "yjs": "^13.6.33",
687
687
  "zod": "^4.3.6",
688
- "@agent-native/recap-cli": "^0.5.67",
689
- "@agent-native/agentkit": "^0.205.0"
688
+ "@agent-native/agentkit": "^0.205.1-nightly-20261008213122",
689
+ "@agent-native/recap-cli": "^0.5.67"
690
690
  },
691
691
  "devDependencies": {
692
692
  "@ai-sdk/anthropic": "^3.0.71",
@@ -756,7 +756,7 @@
756
756
  "xlsx": "^0.18.5"
757
757
  },
758
758
  "peerDependencies": {
759
- "@agent-native/core-corpus": ">=0.196.0",
759
+ "@agent-native/core-corpus": "0.205.1-nightly-20261008213122",
760
760
  "@ai-sdk/anthropic": ">=3",
761
761
  "@ai-sdk/cohere": ">=3",
762
762
  "@ai-sdk/google": ">=3",