@agent-native/core 0.168.1 → 0.168.3

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 (62) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/netlify.toml +4 -4
  3. package/corpus/templates/analytics/server/lib/dashboards-store.ts +32 -5
  4. package/corpus/templates/analytics/server/lib/scoped-settings.ts +2 -3
  5. package/corpus/templates/assets/netlify.toml +4 -1
  6. package/corpus/templates/brain/netlify.toml +4 -1
  7. package/corpus/templates/calendar/app/root.tsx +2 -0
  8. package/corpus/templates/calendar/netlify.toml +4 -1
  9. package/corpus/templates/chat/netlify.toml +4 -1
  10. package/corpus/templates/clips/desktop/src/app.tsx +4 -8
  11. package/corpus/templates/clips/netlify.toml +4 -1
  12. package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.get.ts +17 -11
  13. package/corpus/templates/clips/server/routes/_agent-native/google/callback.get.ts +6 -5
  14. package/corpus/templates/content/netlify.toml +4 -1
  15. package/corpus/templates/crm/netlify.toml +6 -1
  16. package/corpus/templates/design/app/root.tsx +5 -1
  17. package/corpus/templates/design/netlify.toml +4 -1
  18. package/corpus/templates/dispatch/netlify.toml +4 -1
  19. package/corpus/templates/factory/netlify.toml +4 -1
  20. package/corpus/templates/forms/netlify.toml +4 -1
  21. package/corpus/templates/macros/netlify.toml +3 -3
  22. package/corpus/templates/mail/actions/view-screen.ts +80 -8
  23. package/corpus/templates/mail/app/components/email/EmailList.tsx +3 -1
  24. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +1 -35
  25. package/corpus/templates/mail/app/components/email/EmailThread.tsx +16 -8
  26. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +146 -87
  27. package/corpus/templates/mail/app/global.css +21 -0
  28. package/corpus/templates/mail/app/hooks/use-emails.ts +6 -0
  29. package/corpus/templates/mail/app/hooks/use-navigation-state.ts +2 -0
  30. package/corpus/templates/mail/app/lib/inbox-tabs.ts +5 -0
  31. package/corpus/templates/mail/app/lib/label-colors.ts +47 -0
  32. package/corpus/templates/mail/app/pages/InboxPage.tsx +25 -8
  33. package/corpus/templates/mail/netlify.toml +4 -1
  34. package/corpus/templates/mail/server/handlers/emails.ts +27 -2
  35. package/corpus/templates/plan/netlify.toml +4 -1
  36. package/corpus/templates/slides/netlify.toml +4 -1
  37. package/corpus/templates/tasks/netlify.toml +6 -1
  38. package/dist/app-config/migration.d.ts +5 -0
  39. package/dist/app-config/migration.js +11 -0
  40. package/dist/app-config/schema.d.ts +4 -0
  41. package/dist/app-config/schema.js +2 -0
  42. package/dist/app-config/store.d.ts +8 -0
  43. package/dist/app-config/store.js +19 -1
  44. package/dist/collab/awareness.d.ts +2 -2
  45. package/dist/collab/routes.d.ts +1 -1
  46. package/dist/collab/struct-routes.d.ts +1 -1
  47. package/dist/db/migrations.js +10 -2
  48. package/dist/deploy/build.js +6 -0
  49. package/dist/deploy/netlify-static-headers.d.ts +3 -0
  50. package/dist/deploy/netlify-static-headers.js +60 -0
  51. package/dist/notifications/routes.d.ts +3 -3
  52. package/dist/observability/routes.d.ts +3 -3
  53. package/dist/provider-api/actions/custom-provider-registration.d.ts +16 -16
  54. package/dist/provider-api/actions/provider-api.d.ts +17 -17
  55. package/dist/server/transcribe-voice.d.ts +1 -1
  56. package/dist/settings/index.d.ts +1 -1
  57. package/dist/settings/index.js +1 -1
  58. package/dist/settings/org-settings.js +7 -3
  59. package/dist/templates/chat/netlify.toml +4 -1
  60. package/dist/vite/client.js +2 -0
  61. package/package.json +2 -1
  62. package/src/templates/chat/netlify.toml +4 -1
@@ -75,9 +75,10 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
75
75
  user: "user";
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
- id?: undefined;
79
- provider?: undefined;
78
+ message?: undefined;
80
79
  deleted?: undefined;
80
+ found?: undefined;
81
+ id?: undefined;
81
82
  providers: {
82
83
  id: string;
83
84
  label: string;
@@ -88,46 +89,45 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
88
89
  updatedAt: number;
89
90
  }[];
90
91
  count: number;
91
- found?: undefined;
92
+ provider?: undefined;
92
93
  registered?: undefined;
93
94
  label?: undefined;
94
- message?: undefined;
95
95
  } | {
96
- count?: undefined;
97
- id?: undefined;
96
+ message?: undefined;
98
97
  deleted?: undefined;
98
+ id?: undefined;
99
99
  providers?: undefined;
100
+ count?: undefined;
100
101
  found: boolean;
101
102
  provider: import("../custom-registry.js").CustomProviderConfig;
102
103
  registered?: undefined;
103
104
  label?: undefined;
104
- message?: undefined;
105
105
  } | {
106
- count?: undefined;
107
- provider?: undefined;
106
+ message?: undefined;
108
107
  deleted?: undefined;
109
108
  providers?: undefined;
109
+ count?: undefined;
110
+ provider?: undefined;
110
111
  found: boolean;
111
112
  id: string;
112
113
  registered?: undefined;
113
114
  label?: undefined;
114
- message?: undefined;
115
115
  } | {
116
+ message?: undefined;
117
+ found?: undefined;
118
+ providers?: undefined;
116
119
  count?: undefined;
117
120
  provider?: undefined;
118
- providers?: undefined;
119
- found?: undefined;
120
121
  deleted: boolean;
121
122
  id: string;
122
123
  registered?: undefined;
123
124
  label?: undefined;
124
- message?: undefined;
125
125
  } | {
126
- count?: undefined;
127
- provider?: undefined;
128
126
  deleted?: undefined;
129
- providers?: undefined;
130
127
  found?: undefined;
128
+ providers?: undefined;
129
+ count?: undefined;
130
+ provider?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
133
133
  label: string;
@@ -312,7 +312,9 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
314
  id?: undefined;
315
- provider?: undefined;
315
+ deleted?: undefined;
316
+ found?: undefined;
317
+ message?: undefined;
316
318
  providers: {
317
319
  id: string;
318
320
  label: string;
@@ -323,47 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
323
325
  updatedAt: number;
324
326
  }[];
325
327
  count: number;
326
- found?: undefined;
327
- deleted?: undefined;
328
+ provider?: undefined;
328
329
  registered?: undefined;
329
330
  label?: undefined;
330
- message?: undefined;
331
331
  } | {
332
332
  id?: undefined;
333
- providers?: undefined;
334
333
  count?: undefined;
334
+ deleted?: undefined;
335
+ message?: undefined;
336
+ providers?: undefined;
335
337
  found: boolean;
336
338
  provider: import("../custom-registry.js").CustomProviderConfig;
337
- deleted?: undefined;
338
339
  registered?: undefined;
339
340
  label?: undefined;
340
- message?: undefined;
341
341
  } | {
342
- provider?: undefined;
343
- providers?: undefined;
344
342
  count?: undefined;
343
+ deleted?: undefined;
344
+ message?: undefined;
345
+ providers?: undefined;
346
+ provider?: undefined;
345
347
  found: boolean;
346
348
  id: string;
347
- deleted?: undefined;
348
349
  registered?: undefined;
349
350
  label?: undefined;
350
- message?: undefined;
351
351
  } | {
352
- provider?: undefined;
353
- providers?: undefined;
354
352
  count?: undefined;
355
353
  found?: undefined;
354
+ message?: undefined;
355
+ providers?: undefined;
356
+ provider?: undefined;
356
357
  deleted: boolean;
357
358
  id: string;
358
359
  registered?: undefined;
359
360
  label?: undefined;
360
- message?: undefined;
361
361
  } | {
362
- provider?: undefined;
363
- providers?: undefined;
364
362
  count?: undefined;
365
- found?: undefined;
366
363
  deleted?: undefined;
364
+ found?: undefined;
365
+ providers?: undefined;
366
+ provider?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -20,6 +20,6 @@ export declare function createTranscribeVoiceHandler(): import("h3").EventHandle
20
20
  error: string;
21
21
  text?: undefined;
22
22
  } | {
23
- error?: undefined;
24
23
  text: string;
24
+ error?: undefined;
25
25
  }>>;
@@ -1,4 +1,4 @@
1
- export { getSetting, mutateSetting, putSetting, deleteSetting, deleteSettingIfValue, getAllSettings, getSettingsEmitter, type StoreWriteOptions, } from "./store.js";
1
+ export { getSetting, mutateSetting, putSetting, deleteSetting, deleteSettingIfValue, getAllSettings, listSettingsByPrefix, getSettingsEmitter, type StoreWriteOptions, } from "./store.js";
2
2
  export { getSettingHandler, putSettingHandler, deleteSettingHandler, } from "./handlers.js";
3
3
  export { readSetting, writeSetting, removeSetting } from "./script-helpers.js";
4
4
  export { getUserSetting, putUserSetting, deleteUserSetting, } from "./user-settings.js";
@@ -1,5 +1,5 @@
1
1
  // Store
2
- export { getSetting, mutateSetting, putSetting, deleteSetting, deleteSettingIfValue, getAllSettings, getSettingsEmitter, } from "./store.js";
2
+ export { getSetting, mutateSetting, putSetting, deleteSetting, deleteSettingIfValue, getAllSettings, listSettingsByPrefix, getSettingsEmitter, } from "./store.js";
3
3
  // H3 route handlers
4
4
  export { getSettingHandler, putSettingHandler, deleteSettingHandler, } from "./handlers.js";
5
5
  // Script helpers
@@ -7,7 +7,7 @@
7
7
  * No global fallback — each org starts with a clean slate. This
8
8
  * prevents one org's data from leaking to another.
9
9
  */
10
- import { getSetting, mutateSetting, putSetting, deleteSetting, deleteSettingsByPrefix, getAllSettings, } from "./store.js";
10
+ import { getSetting, mutateSetting, putSetting, deleteSetting, deleteSettingsByPrefix, listSettingsByPrefix, } from "./store.js";
11
11
  function orgKey(orgId, key) {
12
12
  return `o:${orgId}:${key}`;
13
13
  }
@@ -37,9 +37,13 @@ export async function deleteAllOrgSettings(orgId, options) {
37
37
  * Returns a map of `<key>` (without the org prefix) to value.
38
38
  */
39
39
  export async function listOrgSettings(orgId, subPrefix) {
40
- const all = await getAllSettings();
40
+ // Narrow in SQL, then apply the same checks as before. Reading this with
41
+ // `getAllSettings()` pulled and JSON-parsed every org's rows into the caller
42
+ // to keep one org's, putting the whole deployment's settings table on the
43
+ // critical path of any org-scoped list read.
44
+ const scoped = await listSettingsByPrefix(`o:${orgId}:${subPrefix ?? ""}`);
41
45
  const out = {};
42
- for (const [fullKey, value] of Object.entries(all)) {
46
+ for (const { key: fullKey, value } of scoped) {
43
47
  const m = ORG_PREFIX_RE.exec(fullKey);
44
48
  if (!m || m[1] !== orgId)
45
49
  continue;
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  ignore = "node ./scripts/netlify-ignore-build.mjs chat"
3
- command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter chat migrate:production; fi"
3
+ command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter chat migrate:production; fi"
4
4
  publish = "templates/chat/dist"
5
5
  functions = "templates/chat/.netlify/functions-internal"
6
6
 
@@ -14,3 +14,6 @@ NPM_CONFIG_PRODUCTION = "false"
14
14
  AGENT_NATIVE_HOSTED_HARNESS = "true"
15
15
  AGENT_NATIVE_ENABLE_KEEP_WARM = "1"
16
16
  AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND = "1"
17
+ # Production release migrations own schema setup; request functions must skip
18
+ # migration probes on every serverless invocation.
19
+ AGENT_NATIVE_RELEASE_MIGRATIONS = "1"
@@ -2563,6 +2563,7 @@ function createNitroDevPlugin(options, appBasePath) {
2563
2563
  // injected into deployed Functions. Nitro is a separate server build,
2564
2564
  // so it needs the release ownership decision in its own replacement map.
2565
2565
  "process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(process.env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
2566
+ "process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER": JSON.stringify(process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER?.trim() || ""),
2566
2567
  // Same reason as the release owner above: the recurring-jobs decision
2567
2568
  // belongs to the build env, and Nitro is a separate server build with its
2568
2569
  // own replacement map.
@@ -2923,6 +2924,7 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode =
2923
2924
  // netlify.toml environment is available to the build but not injected
2924
2925
  // into deployed Functions, so embed the decision in the server bundle.
2925
2926
  "process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(process.env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
2927
+ "process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER": JSON.stringify(process.env.AGENT_NATIVE_BETA_SCHEMA_OWNER?.trim() || ""),
2926
2928
  // Recurring jobs are turned off (and their platform scheduled trigger
2927
2929
  // omitted) by the BUILD environment, which a deployed serverless runtime
2928
2930
  // never sees. Embed the decision so the Automations page reports what
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.168.1",
3
+ "version": "0.168.3",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -173,6 +173,7 @@
173
173
  "./voice": "./dist/voice/index.js",
174
174
  "./scripts": "./dist/scripts/index.js",
175
175
  "./deploy/function-bundle": "./dist/deploy/function-bundle.js",
176
+ "./deploy/netlify-static-headers": "./dist/deploy/netlify-static-headers.js",
176
177
  "./guards": {
177
178
  "types": "./dist/guards/index.d.ts",
178
179
  "default": "./dist/guards/index.js"
@@ -1,6 +1,6 @@
1
1
  [build]
2
2
  ignore = "node ./scripts/netlify-ignore-build.mjs chat"
3
- command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ]; then pnpm --filter chat migrate:production; fi"
3
+ command = "export DATABASE_URL=${NETLIFY_DATABASE_URL:-$DATABASE_URL} && pnpm install && NITRO_PRESET=netlify pnpm --filter chat build && if [ \"${CONTEXT:-}\" = \"production\" ] || [ \"${AGENT_NATIVE_RUN_RELEASE_MIGRATIONS:-}\" = \"1\" ]; then pnpm --filter chat migrate:production; fi"
4
4
  publish = "templates/chat/dist"
5
5
  functions = "templates/chat/.netlify/functions-internal"
6
6
 
@@ -14,3 +14,6 @@ NPM_CONFIG_PRODUCTION = "false"
14
14
  AGENT_NATIVE_HOSTED_HARNESS = "true"
15
15
  AGENT_NATIVE_ENABLE_KEEP_WARM = "1"
16
16
  AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND = "1"
17
+ # Production release migrations own schema setup; request functions must skip
18
+ # migration probes on every serverless invocation.
19
+ AGENT_NATIVE_RELEASE_MIGRATIONS = "1"