@agent-native/core 0.139.0 → 0.141.0

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 (94) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +1 -1
  3. package/corpus/templates/analytics/changelog/2026-08-05-historical-analytics-rollups-stay-complete-and-atomic.md +6 -0
  4. package/corpus/templates/analytics/server/lib/dashboard-report.ts +0 -2
  5. package/corpus/templates/analytics/server/lib/first-party-analytics-rollups.ts +11 -6
  6. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +8 -18
  7. package/corpus/templates/analytics/server/plugins/db.ts +174 -0
  8. package/corpus/templates/calendar/app/components/calendar/OutOfOfficeEvent.tsx +38 -38
  9. package/corpus/templates/calendar/changelog/2026-08-05-out-of-office-blocks-now-open-from-their-scheduled-time-rang.md +6 -0
  10. package/corpus/templates/calendar/server/lib/booking-emails.ts +70 -154
  11. package/corpus/templates/calendar/server/lib/event-guest-notifications.ts +28 -64
  12. package/corpus/templates/clips/actions/get-recording-player-data.ts +1 -0
  13. package/corpus/templates/clips/actions/invite-member.ts +16 -39
  14. package/corpus/templates/clips/app/components/player/comments-panel.tsx +2 -3
  15. package/corpus/templates/clips/app/components/player/reaction-emojis.ts +10 -0
  16. package/corpus/templates/clips/app/components/player/reactions-tray.tsx +2 -2
  17. package/corpus/templates/clips/app/components/player/video-player.tsx +20 -6
  18. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +33 -0
  19. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +5 -1
  20. package/corpus/templates/clips/app/routes/share.$shareId.tsx +27 -1
  21. package/corpus/templates/clips/changelog/2026-08-05-comment-and-video-reaction-pickers-now-include-eyes-and-mind.md +6 -0
  22. package/corpus/templates/clips/changelog/2026-08-05-fresh-recordings-now-open-with-the-complete-video.md +6 -0
  23. package/corpus/templates/clips/server/lib/transactional-email-templates.ts +0 -24
  24. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +1 -0
  25. package/corpus/templates/content/server/lib/comment-notifications.ts +26 -57
  26. package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +16 -3
  27. package/corpus/templates/forms/server/lib/response-email.ts +0 -2
  28. package/corpus/templates/plan/actions/request-plan-access.ts +12 -33
  29. package/corpus/templates/plan/server/lib/comment-notifications.ts +27 -53
  30. package/corpus/templates/slides/server/lib/comment-notifications.ts +21 -44
  31. package/dist/a2a/handlers.js +9 -10
  32. package/dist/collab/routes.d.ts +1 -1
  33. package/dist/db/client.js +8 -8
  34. package/dist/db/migrations.js +39 -19
  35. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  36. package/dist/localization/default-messages.d.ts +0 -45
  37. package/dist/localization/default-messages.js +0 -45
  38. package/dist/notifications/routes.d.ts +5 -5
  39. package/dist/observability/routes.d.ts +3 -3
  40. package/dist/org/handlers.js +1 -8
  41. package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
  42. package/dist/provider-api/actions/provider-api.d.ts +12 -12
  43. package/dist/secrets/routes.d.ts +9 -9
  44. package/dist/server/action-discovery.js +0 -22
  45. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  46. package/dist/server/auth.js +3 -1
  47. package/dist/server/better-auth-instance.js +2 -17
  48. package/dist/server/email.d.ts +0 -9
  49. package/dist/server/email.js +3 -44
  50. package/dist/server/index.d.ts +0 -1
  51. package/dist/server/index.js +0 -1
  52. package/dist/server/transcribe-voice.d.ts +1 -1
  53. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +3 -2
  54. package/docs/content/authentication.mdx +25 -19
  55. package/package.json +2 -1
  56. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +3 -2
  57. package/corpus/templates/analytics/server/lib/emails.ts +0 -51
  58. package/corpus/templates/analytics/server/plugins/transactional-emails.ts +0 -5
  59. package/corpus/templates/calendar/server/lib/emails.ts +0 -167
  60. package/corpus/templates/calendar/server/plugins/transactional-emails.ts +0 -5
  61. package/corpus/templates/clips/server/lib/emails.ts +0 -256
  62. package/corpus/templates/clips/server/plugins/transactional-email-catalog.ts +0 -5
  63. package/corpus/templates/content/server/lib/emails.ts +0 -70
  64. package/corpus/templates/content/server/plugins/transactional-emails.ts +0 -5
  65. package/corpus/templates/dispatch/app/routes/transactional-email.$appId.$id.tsx +0 -4
  66. package/corpus/templates/dispatch/app/routes/transactional-email.tsx +0 -4
  67. package/corpus/templates/forms/server/lib/emails.ts +0 -52
  68. package/corpus/templates/forms/server/plugins/transactional-emails.ts +0 -5
  69. package/corpus/templates/plan/server/lib/emails.ts +0 -67
  70. package/corpus/templates/plan/server/plugins/transactional-emails.ts +0 -5
  71. package/corpus/templates/slides/server/lib/emails.ts +0 -40
  72. package/corpus/templates/slides/server/plugins/transactional-emails.ts +0 -5
  73. package/dist/email-catalog/actions/list-email-activity.d.ts +0 -6
  74. package/dist/email-catalog/actions/list-email-activity.js +0 -15
  75. package/dist/email-catalog/actions/list-email-engagement.d.ts +0 -6
  76. package/dist/email-catalog/actions/list-email-engagement.js +0 -15
  77. package/dist/email-catalog/actions/list-email-log.d.ts +0 -8
  78. package/dist/email-catalog/actions/list-email-log.js +0 -22
  79. package/dist/email-catalog/actions/list-transactional-emails.d.ts +0 -23
  80. package/dist/email-catalog/actions/list-transactional-emails.js +0 -61
  81. package/dist/email-catalog/actions/render-transactional-email-preview.d.ts +0 -10
  82. package/dist/email-catalog/actions/render-transactional-email-preview.js +0 -24
  83. package/dist/email-catalog/authorize.d.ts +0 -2
  84. package/dist/email-catalog/authorize.js +0 -10
  85. package/dist/email-catalog/log.d.ts +0 -57
  86. package/dist/email-catalog/log.js +0 -117
  87. package/dist/email-catalog/provider-metrics.d.ts +0 -34
  88. package/dist/email-catalog/provider-metrics.js +0 -165
  89. package/dist/email-catalog/registry.d.ts +0 -79
  90. package/dist/email-catalog/registry.js +0 -71
  91. package/dist/email-catalog/schema.d.ts +0 -212
  92. package/dist/email-catalog/schema.js +0 -49
  93. package/dist/email-catalog/system-emails.d.ts +0 -14
  94. package/dist/email-catalog/system-emails.js +0 -68
@@ -354,11 +354,12 @@ export function runMigrations(migrations, options) {
354
354
  //
355
355
  // Now: use the pooled singleton (getDbExec) for the bookkeeping SELECT. If
356
356
  // the migrations table does not yet exist we treat it as "all migrations
357
- // pending" (current = -1). Only when there are pending migrations do we open
358
- // the direct-endpoint exec (DDL is the only thing Neon's PgBouncer blocks —
359
- // documented at getMigrationDatabaseUrl). The direct exec is shared across
360
- // concurrent runners via acquireMigrationExec() and closed after the last
361
- // caller via releaseMigrationExec().
357
+ // pending" (current = -1). Pending SQL/DDL opens the direct-endpoint exec
358
+ // (DDL is the only thing Neon's PgBouncer blocks — documented at
359
+ // getMigrationDatabaseUrl); run-only entries stay on the pooled client once
360
+ // both bookkeeping tables are known to exist. The direct exec is shared
361
+ // across concurrent runners via acquireMigrationExec() and closed after the
362
+ // last caller via releaseMigrationExec().
362
363
  // ---------------------------------------------------------------------------
363
364
  let current = -1; // sentinel: "table missing" → treat all as pending
364
365
  let namedRowsMissing = false; // sentinel: "named table missing" → no names applied yet
@@ -395,18 +396,34 @@ export function runMigrations(migrations, options) {
395
396
  if (pg && pendingFast !== null && pendingFast.length === 0) {
396
397
  return;
397
398
  }
399
+ // A run-only migration does not need the direct endpoint: the fast path
400
+ // already proved both bookkeeping tables exist, and its `run` callback is
401
+ // responsible for its own pooled database work. Keep the direct path for
402
+ // any pending SQL or for the first boot, where the tables still need DDL.
403
+ const runOnlyPending = pg &&
404
+ current >= 0 &&
405
+ !namedRowsMissing &&
406
+ pendingFast !== null &&
407
+ pendingFast.length > 0 &&
408
+ pendingFast.every((m) => resolveMigrationSql(m.sql, pg) === null);
398
409
  // Acquire the exec appropriate for the dialect.
399
410
  // For Postgres: the shared direct-endpoint exec (DDL-safe, closed on release).
400
411
  // For SQLite/libsql: the singleton pooled exec (no pooler concern).
401
- const exec = pg ? await acquireMigrationExec() : getDbExec();
412
+ const exec = pg
413
+ ? runOnlyPending
414
+ ? getDbExec()
415
+ : await acquireMigrationExec()
416
+ : getDbExec();
402
417
  try {
403
- // Retry initial table creation — SQLITE_BUSY_RECOVERY can occur on HMR
404
- // restarts when WAL files from the previous process haven't been released yet.
405
- await retrySqliteBusy(() => exec.execute(`CREATE TABLE IF NOT EXISTS ${table} (version INTEGER PRIMARY KEY)`), { maxAttempts: 6, baseDelayMs: 1000, rethrow: true });
406
- // Companion name-keyed bookkeeping table — never alters the existing
407
- // `${table}`'s PRIMARY KEY, so legacy version rows keep working exactly
408
- // as before. See the `runMigrations` doc comment for why this exists.
409
- await retrySqliteBusy(() => exec.execute(`CREATE TABLE IF NOT EXISTS ${namedTable} (name TEXT PRIMARY KEY, version INTEGER, applied_at ${pg ? "TIMESTAMP NOT NULL DEFAULT now()" : "TEXT NOT NULL DEFAULT (datetime('now'))"})`), { maxAttempts: 6, baseDelayMs: 1000, rethrow: true });
418
+ if (!runOnlyPending) {
419
+ // Retry initial table creation — SQLITE_BUSY_RECOVERY can occur on HMR
420
+ // restarts when WAL files from the previous process haven't been released yet.
421
+ await retrySqliteBusy(() => exec.execute(`CREATE TABLE IF NOT EXISTS ${table} (version INTEGER PRIMARY KEY)`), { maxAttempts: 6, baseDelayMs: 1000, rethrow: true });
422
+ // Companion name-keyed bookkeeping table — never alters the existing
423
+ // `${table}`'s PRIMARY KEY, so legacy version rows keep working exactly
424
+ // as before. See the `runMigrations` doc comment for why this exists.
425
+ await retrySqliteBusy(() => exec.execute(`CREATE TABLE IF NOT EXISTS ${namedTable} (name TEXT PRIMARY KEY, version INTEGER, applied_at ${pg ? "TIMESTAMP NOT NULL DEFAULT now()" : "TEXT NOT NULL DEFAULT (datetime('now'))"})`), { maxAttempts: 6, baseDelayMs: 1000, rethrow: true });
426
+ }
410
427
  // For Postgres, current was already set by the fast-path SELECT above.
411
428
  // For SQLite we run the SELECT now (via the same exec, which is the singleton).
412
429
  if (!pg) {
@@ -417,7 +434,8 @@ export function runMigrations(migrations, options) {
417
434
  appliedNames = new Set(nameRows.map((r) => String(r.name)));
418
435
  }
419
436
  }
420
- else if (current === -1 || (hasNamedMigrations && namedRowsMissing)) {
437
+ else if (!runOnlyPending &&
438
+ (current === -1 || (hasNamedMigrations && namedRowsMissing))) {
421
439
  // Fast-path read failed (table was absent on the pooler): re-read via the
422
440
  // direct exec now that CREATE TABLE IF NOT EXISTS has ensured it exists.
423
441
  if (current === -1) {
@@ -435,7 +453,9 @@ export function runMigrations(migrations, options) {
435
453
  const insertNamedSql = pg
436
454
  ? `INSERT INTO ${namedTable} (name, version) VALUES (?, ?) ON CONFLICT DO NOTHING`
437
455
  : `INSERT OR IGNORE INTO ${namedTable} (name, version) VALUES (?, ?)`;
438
- const pending = migrations.filter((m) => m.name ? !appliedNames.has(m.name) : m.version > current);
456
+ const pending = runOnlyPending
457
+ ? pendingFast
458
+ : migrations.filter((m) => m.name ? !appliedNames.has(m.name) : m.version > current);
439
459
  if (pending.length > 0) {
440
460
  console.log(`[db] Applying ${pending.length} migration(s) on ${pg ? "Postgres" : "SQLite/libsql"}…`);
441
461
  }
@@ -532,10 +552,10 @@ export function runMigrations(migrations, options) {
532
552
  }
533
553
  }
534
554
  finally {
535
- // Release the direct-endpoint exec (Postgres only). For SQLite getDbExec()
536
- // returns the process-lifetime singleton, so releaseMigrationExec is a no-op
537
- // (refCount never incremented for SQLite path, guard in releaseMigrationExec).
538
- if (pg)
555
+ // Release the direct-endpoint exec (Postgres only). Run-only migrations
556
+ // use the process-lifetime pooled singleton, so there is nothing to close
557
+ // in that branch.
558
+ if (pg && !runOnlyPending)
539
559
  await releaseMigrationExec();
540
560
  }
541
561
  }
@@ -17,12 +17,12 @@ declare const _default: import("../../action.js").ActionDefinition<{
17
17
  id?: undefined;
18
18
  provider?: undefined;
19
19
  } | {
20
+ error?: undefined;
20
21
  configured?: undefined;
21
22
  connectPath?: undefined;
22
23
  url: string;
23
24
  id: string;
24
25
  provider: string;
25
- error?: undefined;
26
26
  }>;
27
27
  export default _default;
28
28
  //# sourceMappingURL=upload-image.d.ts.map
@@ -175,7 +175,6 @@ declare const messages: {
175
175
  resources: string;
176
176
  messaging: string;
177
177
  destinations: string;
178
- transactionalEmail: string;
179
178
  identities: string;
180
179
  approvals: string;
181
180
  automations: string;
@@ -206,50 +205,6 @@ declare const messages: {
206
205
  suggestionRouteSlack: string;
207
206
  suggestionGrantKey: string;
208
207
  };
209
- transactionalEmail: {
210
- title: string;
211
- description: string;
212
- retentionTitle: string;
213
- retentionNote: string;
214
- openRatesUnavailable: string;
215
- sharedProviderMetricsUnavailable: string;
216
- catalogFanoutFailed: string;
217
- retry: string;
218
- noApps: string;
219
- catalogUnreadable: string;
220
- countsUnreadable: string;
221
- appSendsNoEmail: string;
222
- emailNotFound: string;
223
- emailNotFoundDescription: string;
224
- sharedTitle: string;
225
- sharedSubtitle: string;
226
- email: string;
227
- trigger: string;
228
- sends: string;
229
- openRate: string;
230
- lastSent: string;
231
- sendLogUnread: string;
232
- failedCount: string;
233
- failuresUnknown: string;
234
- noProviderRecord: string;
235
- noDeliveredMail: string;
236
- neverSent: string;
237
- lastSentUnknown: string;
238
- preview: string;
239
- previewDescription: string;
240
- previewFailed: string;
241
- previewFrameTitle: string;
242
- subject: string;
243
- activityLink: string;
244
- activityTitle: string;
245
- activityUnavailable: string;
246
- activityEmpty: string;
247
- recipient: string;
248
- sender: string;
249
- status: string;
250
- opens: string;
251
- lastEvent: string;
252
- };
253
208
  pages: {
254
209
  appsDescription: string;
255
210
  appsDescriptionWithWorkspace: string;
@@ -180,7 +180,6 @@ const messages = {
180
180
  resources: "Resources",
181
181
  messaging: "Messaging",
182
182
  destinations: "Destinations",
183
- transactionalEmail: "Transactional email",
184
183
  identities: "Identities",
185
184
  approvals: "Approvals",
186
185
  automations: "Automations",
@@ -211,50 +210,6 @@ const messages = {
211
210
  suggestionRouteSlack: "Route Slack mentions to my analytics app",
212
211
  suggestionGrantKey: "Grant my OpenAI key to this app",
213
212
  },
214
- transactionalEmail: {
215
- title: "Transactional email",
216
- description: "Every transactional email each app in this workspace can send, with its trigger, recipients, and delivery metrics.",
217
- retentionTitle: "Activity feed retention is short",
218
- retentionNote: "The email provider's activity feed only retains recent messages, so an empty activity list does not mean nothing was sent.",
219
- openRatesUnavailable: "Open rates unavailable",
220
- sharedProviderMetricsUnavailable: "Provider metrics vary by sending app. Expand an app to see its provider data.",
221
- catalogFanoutFailed: "Could not load app email catalogs",
222
- retry: "Retry",
223
- noApps: "No ready apps reported a transactional email catalog.",
224
- catalogUnreadable: "This app's email catalog could not be read",
225
- countsUnreadable: "Send counts could not be read",
226
- appSendsNoEmail: "This app sends no transactional email of its own.",
227
- emailNotFound: "Email not found",
228
- emailNotFoundDescription: "This email is not in the app's catalog.",
229
- sharedTitle: "Shared system email",
230
- sharedSubtitle: "sent by every app",
231
- email: "Email",
232
- trigger: "Trigger",
233
- sends: "Sends",
234
- openRate: "Open rate",
235
- lastSent: "Last sent",
236
- sendLogUnread: "The send log could not be read, so the number of sends is unknown.",
237
- failedCount: "{{count}} failed",
238
- failuresUnknown: "failures unknown",
239
- noProviderRecord: "The provider reported no record for this email in the window.",
240
- noDeliveredMail: "No delivered mail yet",
241
- neverSent: "Never sent",
242
- lastSentUnknown: "The send log could not be read, so the last send time is unknown.",
243
- preview: "Preview",
244
- previewDescription: "Rendered with dummy data. Scripts are disabled in this preview.",
245
- previewFailed: "Preview could not be rendered",
246
- previewFrameTitle: "Preview of {{name}}",
247
- subject: "Subject",
248
- activityLink: "Activity log",
249
- activityTitle: "Activity for {{name}}",
250
- activityUnavailable: "Activity feed unavailable",
251
- activityEmpty: "No recent activity in the provider's retention window.",
252
- recipient: "Recipient",
253
- sender: "Sender",
254
- status: "Status",
255
- opens: "Opens",
256
- lastEvent: "Last event",
257
- },
258
213
  pages: {
259
214
  appsDescription: "Open workspace apps and start new app creation from Dispatch.",
260
215
  appsDescriptionWithWorkspace: 'Apps in the "{{workspace}}" workspace. Each app gets its own route under this workspace and shares its database, auth, and agent chat.',
@@ -13,22 +13,22 @@
13
13
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
14
14
  count: number;
15
15
  updated?: undefined;
16
- error?: undefined;
17
16
  ok?: undefined;
17
+ error?: undefined;
18
18
  } | {
19
- count?: undefined;
20
19
  updated: number;
21
- error?: undefined;
22
20
  ok?: undefined;
23
- } | {
21
+ error?: undefined;
24
22
  count?: undefined;
23
+ } | {
25
24
  updated?: undefined;
26
25
  error: string;
27
26
  ok?: undefined;
28
- } | {
29
27
  count?: undefined;
28
+ } | {
30
29
  updated?: undefined;
31
30
  ok: boolean;
32
31
  error?: undefined;
32
+ count?: undefined;
33
33
  }>>;
34
34
  //# sourceMappingURL=routes.d.ts.map
@@ -41,16 +41,16 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
41
41
  thumbsUpRate: number;
42
42
  avgEvalScore: number;
43
43
  } | {
44
- error?: undefined;
45
44
  summary: import("./types.js").TraceSummary;
46
45
  spans: import("./types.js").TraceSpan[];
47
46
  id?: undefined;
47
+ error?: undefined;
48
48
  ok?: undefined;
49
49
  } | {
50
- error?: undefined;
51
50
  summary?: undefined;
52
51
  spans?: undefined;
53
52
  id: string;
53
+ error?: undefined;
54
54
  ok?: undefined;
55
55
  } | {
56
56
  summary?: undefined;
@@ -59,10 +59,10 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
59
59
  error: any;
60
60
  ok?: undefined;
61
61
  } | {
62
- error?: undefined;
63
62
  summary?: undefined;
64
63
  spans?: undefined;
65
64
  id?: undefined;
65
+ error?: undefined;
66
66
  ok: boolean;
67
67
  }>>;
68
68
  //# sourceMappingURL=routes.d.ts.map
@@ -28,7 +28,6 @@ function extractMemberEmail(event) {
28
28
  const nanoid = () => globalThis.crypto?.randomUUID?.().replace(/-/g, "") ??
29
29
  Math.random().toString(36).slice(2) + Date.now().toString(36);
30
30
  import { getDbExec, isPostgres } from "../db/client.js";
31
- import { CORE_INVITE_EMAIL_ID } from "../email-catalog/system-emails.js";
32
31
  import { ssrfSafeFetch } from "../extensions/url-safety.js";
33
32
  import { getAppProductionUrl } from "../server/app-url.js";
34
33
  import { getSession } from "../server/auth.js";
@@ -276,13 +275,7 @@ async function inviteOne(ctx, rawEmail, role, event) {
276
275
  acceptUrl: getInviteAppUrl(event),
277
276
  inviter: ctx.email,
278
277
  });
279
- await sendEmail({
280
- to: email,
281
- subject,
282
- html,
283
- text,
284
- templateId: CORE_INVITE_EMAIL_ID,
285
- });
278
+ await sendEmail({ to: email, subject, html, text });
286
279
  emailSent = true;
287
280
  }
288
281
  catch (err) {
@@ -75,9 +75,9 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
75
75
  user: "user";
76
76
  }>>;
77
77
  }, z.core.$strip>>, {
78
- deleted?: undefined;
79
78
  id?: undefined;
80
79
  provider?: undefined;
80
+ deleted?: undefined;
81
81
  found?: undefined;
82
82
  providers: {
83
83
  id: string;
@@ -93,41 +93,41 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
93
93
  label?: undefined;
94
94
  message?: undefined;
95
95
  } | {
96
- deleted?: undefined;
97
- count?: undefined;
98
96
  id?: undefined;
97
+ deleted?: undefined;
99
98
  providers?: undefined;
99
+ count?: undefined;
100
100
  found: boolean;
101
101
  provider: import("../custom-registry.js").CustomProviderConfig;
102
102
  registered?: undefined;
103
103
  label?: undefined;
104
104
  message?: undefined;
105
105
  } | {
106
- deleted?: undefined;
107
- count?: undefined;
108
106
  provider?: undefined;
107
+ deleted?: undefined;
109
108
  providers?: undefined;
109
+ count?: undefined;
110
110
  found: boolean;
111
111
  id: string;
112
112
  registered?: undefined;
113
113
  label?: undefined;
114
114
  message?: undefined;
115
115
  } | {
116
- count?: undefined;
117
116
  provider?: undefined;
118
117
  found?: undefined;
119
118
  providers?: undefined;
119
+ count?: undefined;
120
120
  deleted: boolean;
121
121
  id: string;
122
122
  registered?: undefined;
123
123
  label?: undefined;
124
124
  message?: undefined;
125
125
  } | {
126
- deleted?: undefined;
127
- count?: undefined;
128
126
  provider?: undefined;
127
+ deleted?: undefined;
129
128
  found?: undefined;
130
129
  providers?: undefined;
130
+ count?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
133
133
  label: string;
@@ -311,10 +311,11 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
311
311
  notes?: string | undefined;
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
- message?: undefined;
315
314
  id?: undefined;
315
+ provider?: undefined;
316
316
  deleted?: undefined;
317
317
  found?: undefined;
318
+ message?: undefined;
318
319
  providers: {
319
320
  id: string;
320
321
  label: string;
@@ -325,45 +326,44 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
325
326
  updatedAt: number;
326
327
  }[];
327
328
  count: number;
328
- provider?: undefined;
329
329
  registered?: undefined;
330
330
  label?: undefined;
331
331
  } | {
332
- message?: undefined;
333
332
  id?: undefined;
334
- deleted?: undefined;
335
333
  count?: undefined;
334
+ deleted?: undefined;
335
+ message?: undefined;
336
336
  providers?: undefined;
337
337
  found: boolean;
338
338
  provider: import("../custom-registry.js").CustomProviderConfig;
339
339
  registered?: undefined;
340
340
  label?: undefined;
341
341
  } | {
342
- message?: undefined;
343
- deleted?: undefined;
344
342
  count?: undefined;
345
- providers?: undefined;
346
343
  provider?: undefined;
344
+ deleted?: undefined;
345
+ message?: undefined;
346
+ providers?: undefined;
347
347
  found: boolean;
348
348
  id: string;
349
349
  registered?: undefined;
350
350
  label?: undefined;
351
351
  } | {
352
- message?: undefined;
353
- found?: undefined;
354
352
  count?: undefined;
355
- providers?: undefined;
356
353
  provider?: undefined;
354
+ found?: undefined;
355
+ message?: undefined;
356
+ providers?: undefined;
357
357
  deleted: boolean;
358
358
  id: string;
359
359
  registered?: undefined;
360
360
  label?: undefined;
361
361
  } | {
362
+ count?: undefined;
363
+ provider?: undefined;
362
364
  deleted?: undefined;
363
365
  found?: undefined;
364
- count?: undefined;
365
366
  providers?: undefined;
366
- provider?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
369
369
  label: string;
@@ -34,37 +34,37 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
34
34
  /** POST /_agent-native/secrets/:key — write a secret. */
35
35
  export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
36
36
  error: string;
37
- ok?: undefined;
38
37
  status?: undefined;
38
+ ok?: undefined;
39
39
  } | {
40
- error?: undefined;
41
40
  ok: boolean;
42
41
  status: string;
42
+ error?: undefined;
43
43
  } | {
44
- ok?: undefined;
45
44
  error: string;
46
45
  removed?: undefined;
46
+ ok?: undefined;
47
47
  } | {
48
- error?: undefined;
49
48
  ok: boolean;
50
49
  removed: boolean;
50
+ error?: undefined;
51
51
  }>>;
52
52
  /**
53
53
  * POST /_agent-native/secrets/:key/test — validate an optional candidate value
54
54
  * or the current stored value without changing anything.
55
55
  */
56
56
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
57
- ok?: undefined;
58
57
  error: string;
59
58
  note?: undefined;
59
+ ok?: undefined;
60
60
  } | {
61
- error?: undefined;
62
61
  ok: boolean;
63
62
  note?: undefined;
64
- } | {
65
63
  error?: undefined;
64
+ } | {
66
65
  ok: boolean;
67
66
  note: string;
67
+ error?: undefined;
68
68
  } | {
69
69
  note?: undefined;
70
70
  ok: boolean;
@@ -95,12 +95,12 @@ export interface AdHocSecretPayload {
95
95
  export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
96
96
  error: string;
97
97
  } | {
98
- error?: undefined;
99
98
  ok: boolean;
100
99
  key: string;
101
- } | {
102
100
  error?: undefined;
101
+ } | {
103
102
  ok: boolean;
104
103
  removed: boolean;
104
+ error?: undefined;
105
105
  }>>;
106
106
  //# sourceMappingURL=routes.d.ts.map
@@ -517,28 +517,6 @@ export async function mergeCoreSharingActions(registry) {
517
517
  () => import("../sharing/actions/create-agent-resource-link.js"),
518
518
  ],
519
519
  ["upload-image", () => import("../file-upload/actions/upload-image.js")],
520
- // Transactional email catalog — mounted everywhere so Dispatch can ask any
521
- // app what it sends without that app opting in.
522
- [
523
- "list-transactional-emails",
524
- () => import("../email-catalog/actions/list-transactional-emails.js"),
525
- ],
526
- [
527
- "render-transactional-email-preview",
528
- () => import("../email-catalog/actions/render-transactional-email-preview.js"),
529
- ],
530
- [
531
- "list-email-log",
532
- () => import("../email-catalog/actions/list-email-log.js"),
533
- ],
534
- [
535
- "list-email-activity",
536
- () => import("../email-catalog/actions/list-email-activity.js"),
537
- ],
538
- [
539
- "list-email-engagement",
540
- () => import("../email-catalog/actions/list-email-engagement.js"),
541
- ],
542
520
  [
543
521
  "get-feature-flags",
544
522
  () => import("../feature-flags/actions/get-feature-flags.js"),
@@ -27,11 +27,11 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
27
27
  export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
28
28
  error: any;
29
29
  } | {
30
+ error?: undefined;
30
31
  ok: boolean;
31
32
  key: string;
32
33
  baseUrlKey?: string;
33
34
  scope: AgentEngineApiKeyScope;
34
- error?: undefined;
35
35
  }>>;
36
36
  export {};
37
37
  //# sourceMappingURL=agent-engine-api-key-route.d.ts.map
@@ -2959,7 +2959,9 @@ async function mountBetterAuthRoutes(app, options) {
2959
2959
  const rawReturn = Array.isArray(query.return)
2960
2960
  ? query.return[0]
2961
2961
  : query.return;
2962
- setFirstRunOnboardingCookie(event);
2962
+ if (await getSession(event)) {
2963
+ setFirstRunOnboardingCookie(event);
2964
+ }
2963
2965
  return redirectWithStagedCookies(event, safeReturnPath(rawReturn), 302);
2964
2966
  }));
2965
2967
  // Auth guard — stored both in framework middleware registry AND in
@@ -18,7 +18,6 @@ import { TEMPLATES } from "../cli/templates-meta.js";
18
18
  import { getDbExec, isPostgres } from "../db/client.js";
19
19
  import { getDialect, getDatabaseUrl, getDatabaseAuthToken, closePgliteClients, getPgliteClient, isPgliteUrl, loadPgliteDrizzle, pgPoolOptions, neonPoolMax, attachNeonPoolErrorLogger, sharedDbPool, onSharedDbPoolsClosed, onSharedDbPoolReplaced, } from "../db/client.js";
20
20
  import { ensureTableExists } from "../db/ddl-guard.js";
21
- import { CORE_RESET_PASSWORD_EMAIL_ID, CORE_VERIFY_SIGNUP_EMAIL_ID, } from "../email-catalog/system-emails.js";
22
21
  import { saveOAuthTokens } from "../oauth-tokens/store.js";
23
22
  import { acceptPendingInvitationsForEmail } from "../org/accept-pending.js";
24
23
  import { getAuthEmailForUserId, getRequiredAuthProviderForEmail, } from "../org/auth-policy.js";
@@ -919,14 +918,7 @@ async function createBetterAuthInstance(config) {
919
918
  email: user.email,
920
919
  resetUrl,
921
920
  });
922
- await sendEmail({
923
- to: user.email,
924
- subject,
925
- html,
926
- text,
927
- appSender,
928
- templateId: CORE_RESET_PASSWORD_EMAIL_ID,
929
- });
921
+ await sendEmail({ to: user.email, subject, html, text, appSender });
930
922
  },
931
923
  },
932
924
  emailVerification: {
@@ -950,14 +942,7 @@ async function createBetterAuthInstance(config) {
950
942
  email: user.email,
951
943
  verifyUrl,
952
944
  });
953
- await sendEmail({
954
- to: user.email,
955
- subject,
956
- html,
957
- text,
958
- appSender,
959
- templateId: CORE_VERIFY_SIGNUP_EMAIL_ID,
960
- });
945
+ await sendEmail({ to: user.email, subject, html, text, appSender });
961
946
  },
962
947
  },
963
948
  socialProviders,
@@ -58,15 +58,6 @@ export interface SendEmailArgs {
58
58
  references?: string;
59
59
  attachments?: EmailAttachment[];
60
60
  timeoutMs?: number;
61
- /**
62
- * Registered transactional email id (see `defineTransactionalEmail`), e.g.
63
- * `calendar.booking-confirmed`. Tags the message at the provider so delivery
64
- * and open metrics attribute to one email instead of to the whole account,
65
- * and keys the row written to `email_log`. Omit for genuinely one-off sends.
66
- */
67
- templateId?: string;
68
- /** App slug that owns the send. Defaults to the running app. */
69
- app?: string;
70
61
  }
71
62
  export declare function isEmailConfigured(): Promise<boolean>;
72
63
  /**