@agent-native/core 0.229.0 → 0.230.0-nightly-20261117004313

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.
Files changed (73) hide show
  1. package/dist/action.d.ts +23 -0
  2. package/dist/action.js +21 -0
  3. package/dist/agent/production-agent.d.ts +1 -0
  4. package/dist/agent/production-agent.js +28 -21
  5. package/dist/agent/types.d.ts +2 -0
  6. package/dist/app-config/deploy-cache.d.ts +2 -0
  7. package/dist/app-config/deploy-cache.js +8 -0
  8. package/dist/app-config/observability.d.ts +1 -0
  9. package/dist/app-config/observability.js +10 -0
  10. package/dist/app-config/schema.d.ts +3 -0
  11. package/dist/app-config/store.js +1 -0
  12. package/dist/cli/skills-content/design-remix-skill.d.ts +1 -1
  13. package/dist/cli/skills-content/design-remix-skill.js +193 -32
  14. package/dist/client/action-query-foreground.d.ts +4 -2
  15. package/dist/client/action-query-foreground.js +53 -6
  16. package/dist/client/hooks/index.d.ts +1 -0
  17. package/dist/client/hooks/index.js +1 -0
  18. package/dist/client/onboarding/first-run-status.js +4 -0
  19. package/dist/client/org/hooks.d.ts +12 -1
  20. package/dist/client/org/hooks.js +24 -2
  21. package/dist/client/sharing/useShareButtonController.d.ts +8 -1
  22. package/dist/client/sharing/useShareButtonController.js +20 -13
  23. package/dist/client/theme.d.ts +9 -1
  24. package/dist/client/theme.js +15 -2
  25. package/dist/client/ui/index.d.ts +1 -1
  26. package/dist/client/ui/index.js +1 -1
  27. package/dist/client/use-action.d.ts +8 -0
  28. package/dist/client/use-action.js +20 -3
  29. package/dist/collab/routes.d.ts +1 -1
  30. package/dist/db/create-get-db.d.ts +2 -1
  31. package/dist/db/create-get-db.js +99 -14
  32. package/dist/deploy/build-cache.js +10 -0
  33. package/dist/deploy/build.js +44 -5
  34. package/dist/deploy/workspace-deploy.js +46 -1
  35. package/dist/extensions/url-safety.d.ts +2 -0
  36. package/dist/extensions/url-safety.js +1 -0
  37. package/dist/framework-package-versions.json +7 -7
  38. package/dist/identity/offboard.d.ts +2 -0
  39. package/dist/identity/offboard.js +32 -0
  40. package/dist/org/auto-join-domain.js +11 -3
  41. package/dist/org/handlers.d.ts +16 -1
  42. package/dist/org/handlers.js +162 -42
  43. package/dist/org/index.d.ts +2 -1
  44. package/dist/org/index.js +1 -0
  45. package/dist/org/plugin.d.ts +2 -0
  46. package/dist/org/plugin.js +17 -1
  47. package/dist/org/types.d.ts +6 -0
  48. package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
  49. package/dist/provider-api/actions/provider-api.d.ts +10 -10
  50. package/dist/resources/store.d.ts +5 -0
  51. package/dist/resources/store.js +54 -0
  52. package/dist/server/auth.js +3 -1
  53. package/dist/server/builder-browser.js +10 -1
  54. package/dist/server/document-build-id.d.ts +18 -0
  55. package/dist/server/document-build-id.js +43 -0
  56. package/dist/server/entry-server.js +3 -5
  57. package/dist/server/first-touch-route.d.ts +1 -1
  58. package/dist/server/onboarding-html.js +4 -3
  59. package/dist/server/workspace-provider-oauth.js +26 -6
  60. package/dist/sharing/actions/set-resource-visibility.js +36 -4
  61. package/dist/sharing/grant.js +10 -2
  62. package/dist/sharing/registry.d.ts +2 -0
  63. package/dist/templates/default/app/root.tsx +8 -2
  64. package/dist/triggers/dispatcher.d.ts +7 -0
  65. package/dist/triggers/dispatcher.js +13 -0
  66. package/dist/triggers/index.d.ts +1 -1
  67. package/dist/triggers/index.js +1 -1
  68. package/dist/user-profile/actions/update-user-profile.js +1 -1
  69. package/dist/vite/client.d.ts +2 -1
  70. package/dist/vite/client.js +5 -2
  71. package/dist/vitest-config.js +6 -0
  72. package/package.json +4 -4
  73. package/src/templates/default/app/root.tsx +8 -2
@@ -1,9 +1,13 @@
1
1
  import { configureTracking } from "@agent-native/core/client/analytics";
2
2
  import { appPath } from "@agent-native/core/client/api-path";
3
+ import { injectedAgentNativeAppId } from "@agent-native/core/client/app-config";
3
4
  import { useDbSync } from "@agent-native/core/client/hooks";
4
5
  import { createAgentNativeQueryClient } from "@agent-native/core/client/hooks";
5
6
  import { getLocaleInitScript } from "@agent-native/core/client/i18n";
6
- import { getThemeInitScript } from "@agent-native/core/client/ui";
7
+ import {
8
+ getThemeInitScript,
9
+ themeStorageKeyForApp,
10
+ } from "@agent-native/core/client/ui";
7
11
  import { ErrorReportActions } from "@agent-native/toolkit/app/feedback";
8
12
  import { AppProviders } from "@agent-native/toolkit/app/providers";
9
13
  import { useQueryClient } from "@tanstack/react-query";
@@ -270,7 +274,9 @@ function useApplyThemeClass() {
270
274
  if (root.classList.contains("dark") || root.classList.contains("light"))
271
275
  return;
272
276
  try {
273
- const stored = localStorage.getItem("theme");
277
+ const stored = localStorage.getItem(
278
+ themeStorageKeyForApp(injectedAgentNativeAppId()),
279
+ );
274
280
  if (stored === "dark") {
275
281
  root.classList.add("dark");
276
282
  } else if (stored === "light") {
@@ -9,6 +9,13 @@ export declare function buildTriggerContent(meta: TriggerFrontmatter, body: stri
9
9
  export interface TriggerDispatcherDeps extends BackgroundAutomationDeps {
10
10
  getInitialToolNames?: (automation?: BackgroundAutomationContext) => string[] | undefined;
11
11
  }
12
+ export type AutomationEventGate = (input: {
13
+ automationId: string;
14
+ orgId: string | undefined;
15
+ eventOwner: string;
16
+ }) => boolean | Promise<boolean>;
17
+ /** Lets an app veto an event automation's run for one event owner before its condition is evaluated. */
18
+ export declare function setAutomationEventGate(gate: AutomationEventGate | undefined): void;
12
19
  export type AutomationWebhookTaskResult = "completed" | "retry";
13
20
  export declare function buildAutomationTriggerPrompt(input: {
14
21
  triggerName: string;
@@ -26,6 +26,11 @@ export function parseTriggerFrontmatter(content) {
26
26
  export function buildTriggerContent(meta, body) {
27
27
  return buildJobResourceContent(meta, body);
28
28
  }
29
+ let _eventGate;
30
+ /** Lets an app veto an event automation's run for one event owner before its condition is evaluated. */
31
+ export function setAutomationEventGate(gate) {
32
+ _eventGate = gate;
33
+ }
29
34
  const _dispatchingTriggers = new Set();
30
35
  const _drainingTriggers = new Map();
31
36
  const MAX_TRIGGER_PAYLOAD_PROMPT_CHARS = 4_000;
@@ -968,6 +973,14 @@ async function dispatchQueuedAutomationEvent(queued, deps, hardDeadlineAt) {
968
973
  }
969
974
  identity = resolved.identity;
970
975
  }
976
+ if (_eventGate &&
977
+ !(await _eventGate({
978
+ automationId: resource.id,
979
+ orgId: identity.orgId,
980
+ eventOwner: identity.eventOwner,
981
+ }))) {
982
+ return "completed";
983
+ }
971
984
  // The condition check must see the same credential (owner key or Builder
972
985
  // Gateway) the run itself would use, with the same identity-aware check as
973
986
  // interactive chat — a raw provider API key is not how most owners are
@@ -1,5 +1,5 @@
1
1
  export type { TriggerFrontmatter, TriggerDispatchContext } from "./types.js";
2
- export { initTriggerDispatcher, hasEventAutomation, refreshEventSubscriptions, parseTriggerFrontmatter, buildTriggerContent, type TriggerDispatcherDeps, } from "./dispatcher.js";
2
+ export { initTriggerDispatcher, hasEventAutomation, refreshEventSubscriptions, parseTriggerFrontmatter, buildTriggerContent, setAutomationEventGate, type AutomationEventGate, type TriggerDispatcherDeps, } from "./dispatcher.js";
3
3
  export { evaluateCondition, __clearConditionCache, } from "./condition-evaluator.js";
4
4
  export { createAutomationToolEntries } from "./actions.js";
5
5
  export { isOutsideAutomationOrigin } from "../automations/outside-origin.js";
@@ -1,4 +1,4 @@
1
- export { initTriggerDispatcher, hasEventAutomation, refreshEventSubscriptions, parseTriggerFrontmatter, buildTriggerContent, } from "./dispatcher.js";
1
+ export { initTriggerDispatcher, hasEventAutomation, refreshEventSubscriptions, parseTriggerFrontmatter, buildTriggerContent, setAutomationEventGate, } from "./dispatcher.js";
2
2
  export { evaluateCondition, __clearConditionCache, } from "./condition-evaluator.js";
3
3
  export { createAutomationToolEntries } from "./actions.js";
4
4
  export { isOutsideAutomationOrigin } from "../automations/outside-origin.js";
@@ -10,7 +10,7 @@ export default defineAction({
10
10
  .string()
11
11
  .trim()
12
12
  .min(1)
13
- .max(120)
13
+ .max(256)
14
14
  .describe("The display name to use when referring to the signed-in user."),
15
15
  expectedUserEmail: z.string().email().optional(),
16
16
  expectedOrgId: z.string().min(1).optional(),
@@ -94,6 +94,7 @@ declare function persistent5xxRecovery(options?: {
94
94
  exit?: (code: number) => void;
95
95
  }): Plugin;
96
96
  declare function resolveNitroSsrServiceEntry(rootDir: string): string | undefined;
97
+ declare function nitroDevEnvironmentClosePlugin(): Plugin;
97
98
  export declare function defaultViteWatchIgnored(root: string): (file: string) => boolean;
98
99
  export declare function agentNative(options?: AgentNativeVitePluginOptions): Plugin[];
99
100
  /**
@@ -103,4 +104,4 @@ export declare function agentNative(options?: AgentNativeVitePluginOptions): Plu
103
104
  * preset. This compatibility wrapper remains for existing templates.
104
105
  */
105
106
  export declare function defineConfig(options?: ClientConfigOptions): UserConfig;
106
- export { clientOptionalPeerStubPlugin as _clientOptionalPeerStubPlugin, devActionBridgePlugin as _devActionBridgePlugin, devActionBridgeOrigin as _devActionBridgeOrigin, getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, nitroStartupGate as _nitroStartupGate, nitroStartupRecovery as _nitroStartupRecovery, persistent5xxRecovery as _persistent5xxRecovery, nitroModuleGraphSignature as _nitroModuleGraphSignature, resolveNitroSsrServiceEntry as _resolveNitroSsrServiceEntry, debounceNitroFullReloadHotUpdate as _debounceNitroFullReloadHotUpdate, installReactRouterVirtualInvalidationMirror as _installReactRouterVirtualInvalidationMirror, mirrorReactRouterVirtualInvalidation as _mirrorReactRouterVirtualInvalidation, };
107
+ export { clientOptionalPeerStubPlugin as _clientOptionalPeerStubPlugin, devActionBridgePlugin as _devActionBridgePlugin, devActionBridgeOrigin as _devActionBridgeOrigin, getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, nitroDevEnvironmentClosePlugin as _nitroDevEnvironmentClosePlugin, nitroStartupGate as _nitroStartupGate, nitroStartupRecovery as _nitroStartupRecovery, persistent5xxRecovery as _persistent5xxRecovery, nitroModuleGraphSignature as _nitroModuleGraphSignature, resolveNitroSsrServiceEntry as _resolveNitroSsrServiceEntry, debounceNitroFullReloadHotUpdate as _debounceNitroFullReloadHotUpdate, installReactRouterVirtualInvalidationMirror as _installReactRouterVirtualInvalidationMirror, mirrorReactRouterVirtualInvalidation as _mirrorReactRouterVirtualInvalidation, };
@@ -3343,7 +3343,10 @@ function nitroDevEnvironmentClosePlugin() {
3343
3343
  const current = state();
3344
3344
  if (current.restartPromise)
3345
3345
  return current.restartPromise;
3346
- current.shutdownRequested = false;
3346
+ // The watcher stays open while an explicit close cleans up, and a
3347
+ // restart that ran then would bring the closed server back.
3348
+ if (current.shutdownRequested)
3349
+ return Promise.resolve();
3347
3350
  current.viteInternalCloseExpected = false;
3348
3351
  clearRestartRetry();
3349
3352
  clearResumeRetry();
@@ -4319,4 +4322,4 @@ export function defineConfig(options = {}) {
4319
4322
  ],
4320
4323
  };
4321
4324
  }
4322
- export { clientOptionalPeerStubPlugin as _clientOptionalPeerStubPlugin, devActionBridgePlugin as _devActionBridgePlugin, devActionBridgeOrigin as _devActionBridgeOrigin, getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, nitroStartupGate as _nitroStartupGate, nitroStartupRecovery as _nitroStartupRecovery, persistent5xxRecovery as _persistent5xxRecovery, nitroModuleGraphSignature as _nitroModuleGraphSignature, resolveNitroSsrServiceEntry as _resolveNitroSsrServiceEntry, debounceNitroFullReloadHotUpdate as _debounceNitroFullReloadHotUpdate, installReactRouterVirtualInvalidationMirror as _installReactRouterVirtualInvalidationMirror, mirrorReactRouterVirtualInvalidation as _mirrorReactRouterVirtualInvalidation, };
4325
+ export { clientOptionalPeerStubPlugin as _clientOptionalPeerStubPlugin, devActionBridgePlugin as _devActionBridgePlugin, devActionBridgeOrigin as _devActionBridgeOrigin, getClientDedupe as _getClientDedupe, getDefaultOptimizeDeps as _getDefaultOptimizeDeps, findCorePackageRoot as _findCorePackageRoot, getReactRouterAliases as _getReactRouterAliases, nitroDevEnvironmentClosePlugin as _nitroDevEnvironmentClosePlugin, nitroStartupGate as _nitroStartupGate, nitroStartupRecovery as _nitroStartupRecovery, persistent5xxRecovery as _persistent5xxRecovery, nitroModuleGraphSignature as _nitroModuleGraphSignature, resolveNitroSsrServiceEntry as _resolveNitroSsrServiceEntry, debounceNitroFullReloadHotUpdate as _debounceNitroFullReloadHotUpdate, installReactRouterVirtualInvalidationMirror as _installReactRouterVirtualInvalidationMirror, mirrorReactRouterVirtualInvalidation as _mirrorReactRouterVirtualInvalidation, };
@@ -25,11 +25,17 @@ export function resolveMaxWorkers(env = process.env, fallback = DEFAULT_MAX_WORK
25
25
  }
26
26
  return count;
27
27
  }
28
+ // Node 25+ defines its own `localStorage` global, unusable without
29
+ // --localstorage-file, and it shadows jsdom's so specs lose storage.
30
+ const WEBSTORAGE_OFF = "--no-experimental-webstorage";
28
31
  const vitestBaseConfig = {
29
32
  // App tests import server modules that load `?bounded-task` sources.
30
33
  plugins: [boundedTaskSourcePlugin()],
31
34
  test: {
32
35
  maxWorkers: resolveMaxWorkers(),
36
+ execArgv: process.allowedNodeEnvironmentFlags.has(WEBSTORAGE_OFF)
37
+ ? [WEBSTORAGE_OFF]
38
+ : [],
33
39
  // Vitest's 5 s default only holds while a worker has a core to itself.
34
40
  // With every core busy, booting PGlite or importing a generated server
35
41
  // bundle inside a test takes several times longer, and which test crosses
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.229.0",
3
+ "version": "0.230.0-nightly-20261117004313",
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": {
@@ -805,8 +805,8 @@
805
805
  "yaml": "^2.9.0",
806
806
  "yjs": "^13.6.33",
807
807
  "zod": "^4.3.6",
808
- "@agent-native/recap-cli": "^0.5.104",
809
- "@agent-native/agentkit": "^0.229.0"
808
+ "@agent-native/agentkit": "^0.230.0-nightly-20261117004313",
809
+ "@agent-native/recap-cli": "^0.5.104"
810
810
  },
811
811
  "devDependencies": {
812
812
  "@ai-sdk/anthropic": "^3.0.71",
@@ -879,7 +879,7 @@
879
879
  "xlsx": "^0.18.5"
880
880
  },
881
881
  "peerDependencies": {
882
- "@agent-native/core-corpus": ">=0.196.0",
882
+ "@agent-native/core-corpus": "0.230.0-nightly-20261117004313",
883
883
  "@ai-sdk/anthropic": ">=3",
884
884
  "@ai-sdk/cohere": ">=3",
885
885
  "@ai-sdk/google": ">=3",
@@ -1,9 +1,13 @@
1
1
  import { configureTracking } from "@agent-native/core/client/analytics";
2
2
  import { appPath } from "@agent-native/core/client/api-path";
3
+ import { injectedAgentNativeAppId } from "@agent-native/core/client/app-config";
3
4
  import { useDbSync } from "@agent-native/core/client/hooks";
4
5
  import { createAgentNativeQueryClient } from "@agent-native/core/client/hooks";
5
6
  import { getLocaleInitScript } from "@agent-native/core/client/i18n";
6
- import { getThemeInitScript } from "@agent-native/core/client/ui";
7
+ import {
8
+ getThemeInitScript,
9
+ themeStorageKeyForApp,
10
+ } from "@agent-native/core/client/ui";
7
11
  import { ErrorReportActions } from "@agent-native/toolkit/app/feedback";
8
12
  import { AppProviders } from "@agent-native/toolkit/app/providers";
9
13
  import { useQueryClient } from "@tanstack/react-query";
@@ -270,7 +274,9 @@ function useApplyThemeClass() {
270
274
  if (root.classList.contains("dark") || root.classList.contains("light"))
271
275
  return;
272
276
  try {
273
- const stored = localStorage.getItem("theme");
277
+ const stored = localStorage.getItem(
278
+ themeStorageKeyForApp(injectedAgentNativeAppId()),
279
+ );
274
280
  if (stored === "dark") {
275
281
  root.classList.add("dark");
276
282
  } else if (stored === "light") {