@agent-native/core 0.154.5 → 0.157.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 (263) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/account-health/SKILL.md +76 -0
  3. package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +3 -0
  4. package/corpus/templates/analytics/.agents/skills/cross-source-analysis/SKILL.md +2 -1
  5. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +6 -5
  6. package/corpus/templates/analytics/AGENTS.md +3 -0
  7. package/corpus/templates/analytics/actions/account-deep-dive.ts +3 -2
  8. package/corpus/templates/analytics/actions/bigquery.ts +1 -1
  9. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +4 -1
  10. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +1 -0
  11. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +12 -4
  12. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +5 -2
  13. package/corpus/templates/analytics/app/pages/adhoc/explorer/property-label.ts +32 -0
  14. package/corpus/templates/analytics/changelog/2026-08-13-account-health-readouts-verify-customer-scope-and-contract-metrics.md +7 -0
  15. package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +43 -17
  16. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +17 -0
  17. package/corpus/templates/analytics/server/plugins/agent-chat.ts +4 -0
  18. package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +3 -1
  19. package/corpus/templates/assets/app/i18n-data.ts +21 -1
  20. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +17 -13
  21. package/corpus/templates/calendar/AGENTS.md +2 -0
  22. package/corpus/templates/calendar/DEVELOPING.md +4 -4
  23. package/corpus/templates/calendar/actions/get-settings.ts +4 -11
  24. package/corpus/templates/calendar/actions/update-availability.ts +15 -4
  25. package/corpus/templates/calendar/actions/update-settings.ts +15 -4
  26. package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +9 -3
  27. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +21 -19
  28. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +9 -6
  29. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +25 -3
  30. package/corpus/templates/calendar/app/components/calendar/InlineEventPickers.tsx +10 -3
  31. package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +9 -9
  32. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +11 -3
  33. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +10 -4
  34. package/corpus/templates/calendar/app/i18n-data.ts +30 -0
  35. package/corpus/templates/calendar/app/lib/availability-schedule.ts +53 -0
  36. package/corpus/templates/calendar/app/lib/event-form-utils.ts +5 -0
  37. package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +90 -28
  38. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +135 -61
  39. package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -0
  40. package/corpus/templates/calendar/app/pages/CalendarView.tsx +30 -15
  41. package/corpus/templates/calendar/app/pages/Settings.tsx +60 -1
  42. package/corpus/templates/calendar/changelog/2026-08-13-find-a-time-now-closes-from-a-clear-header-action.md +6 -0
  43. package/corpus/templates/calendar/server/handlers/bookings.ts +2 -1
  44. package/corpus/templates/calendar/server/handlers/settings.ts +12 -16
  45. package/corpus/templates/calendar/shared/api.ts +1 -0
  46. package/corpus/templates/calendar/shared/availability-schedule.ts +64 -0
  47. package/corpus/templates/calendar/shared/calendar-week.ts +21 -0
  48. package/corpus/templates/calendar/shared/settings.ts +44 -0
  49. package/corpus/templates/clips/AGENTS.md +2 -0
  50. package/corpus/templates/clips/actions/add-comment.ts +5 -2
  51. package/corpus/templates/clips/actions/finalize-recording.ts +31 -1
  52. package/corpus/templates/clips/actions/get-recording-player-data.ts +9 -0
  53. package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +21 -1
  54. package/corpus/templates/clips/actions/reply-to-comment.ts +5 -2
  55. package/corpus/templates/clips/actions/update-comment.ts +9 -2
  56. package/corpus/templates/clips/app/components/library/search-bar.tsx +26 -13
  57. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +135 -3
  58. package/corpus/templates/clips/app/components/player/comments-panel.tsx +5 -99
  59. package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +7 -3
  60. package/corpus/templates/clips/app/components/player/share-dialog.tsx +102 -59
  61. package/corpus/templates/clips/app/components/player/video-player.tsx +84 -24
  62. package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +11 -3
  63. package/corpus/templates/clips/app/i18n/en-US.ts +12 -0
  64. package/corpus/templates/clips/app/lib/public-meeting.ts +11 -3
  65. package/corpus/templates/clips/app/lib/search-focus.ts +15 -0
  66. package/corpus/templates/clips/app/root.tsx +2 -1
  67. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +94 -26
  68. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +24 -7
  69. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +8 -4
  70. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +29 -8
  71. package/corpus/templates/clips/app/routes/share.$shareId.tsx +24 -6
  72. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +72 -26
  73. package/corpus/templates/clips/changelog/2026-08-13-inline-markdown-comments.md +6 -0
  74. package/corpus/templates/clips/changelog/2026-08-13-private-meeting-agent-links.md +6 -0
  75. package/corpus/templates/clips/desktop/src/app.tsx +116 -19
  76. package/corpus/templates/clips/desktop/src/lib/recorder.ts +13 -29
  77. package/corpus/templates/clips/desktop/src/lib/recording-request.ts +39 -0
  78. package/corpus/templates/clips/desktop/src/lib/settings-navigation.ts +11 -0
  79. package/corpus/templates/clips/desktop/src/lib/whisper-model-picker.ts +7 -0
  80. package/corpus/templates/clips/desktop/src/styles.css +117 -0
  81. package/corpus/templates/clips/server/db/index.ts +10 -0
  82. package/corpus/templates/clips/server/db/schema.ts +1 -0
  83. package/corpus/templates/clips/server/lib/recordings.ts +3 -1
  84. package/corpus/templates/clips/server/lib/seekable-media-state.ts +90 -0
  85. package/corpus/templates/clips/server/plugins/db.ts +5 -0
  86. package/corpus/templates/clips/server/routes/api/public-meeting.get.ts +37 -4
  87. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +16 -5
  88. package/corpus/templates/clips/shared/clips-ai-prefs.ts +3 -0
  89. package/corpus/templates/clips/shared/meeting-agent-access.ts +5 -0
  90. package/corpus/templates/content/actions/add-comment.ts +2 -1
  91. package/corpus/templates/content/actions/update-comment.ts +1 -1
  92. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +24 -15
  93. package/corpus/templates/design/actions/generate-design.ts +10 -7
  94. package/corpus/templates/design/actions/present-design-variants.ts +35 -6
  95. package/corpus/templates/design/actions/run-design-audit.ts +33 -0
  96. package/corpus/templates/design/changelog/2026-08-13-the-design-audit-now-catches-a-screen-that-renders-behind-an.md +6 -0
  97. package/corpus/templates/design/shared/design-review.ts +1 -0
  98. package/corpus/templates/design/shared/html-integrity.ts +66 -0
  99. package/corpus/templates/dispatch/.env.example +5 -0
  100. package/corpus/templates/dispatch/AGENTS.md +24 -19
  101. package/corpus/templates/dispatch/app/i18n-data.ts +20 -0
  102. package/corpus/templates/dispatch/server/lib/identity-sso.ts +21 -90
  103. package/corpus/templates/dispatch/server/plugins/identity-sso.ts +3 -12
  104. package/corpus/templates/dispatch/shared/feature-flags.ts +4 -0
  105. package/corpus/templates/factory/AGENTS.md +5 -1
  106. package/corpus/templates/factory/README.md +23 -0
  107. package/corpus/templates/factory/actions/view-screen.ts +17 -0
  108. package/corpus/templates/factory/app/components/factory/FactoryAgentsView.tsx +239 -0
  109. package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +2 -0
  110. package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +130 -7
  111. package/corpus/templates/factory/app/i18n/en-US.ts +20 -0
  112. package/corpus/templates/factory/app/routes/factory.tsx +41 -0
  113. package/corpus/templates/factory/package.json +1 -0
  114. package/corpus/templates/factory/server/factory-graph/contracts.ts +2 -0
  115. package/corpus/templates/factory/server/plugins/agent-chat.ts +9 -0
  116. package/corpus/templates/factory/server/plugins/dispatch-db.ts +1 -0
  117. package/corpus/templates/factory/server/plugins/setup-dispatch.ts +3 -0
  118. package/corpus/templates/mail/app/lib/native-mcp-exclusions.ts +3 -0
  119. package/corpus/templates/mail/vite.config.ts +7 -0
  120. package/corpus/templates/plan/actions/reply-to-plan-comment.ts +7 -2
  121. package/corpus/templates/plan/actions/resolve-plan-comment.ts +2 -2
  122. package/corpus/templates/plan/actions/update-visual-plan.ts +1 -1
  123. package/corpus/templates/plan/app/pages/PlansPage.tsx +29 -20
  124. package/corpus/templates/slides/actions/add-slide-comment.ts +1 -1
  125. package/corpus/templates/slides/actions/update-slide-comment.ts +1 -1
  126. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +9 -6
  127. package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +98 -29
  128. package/corpus/templates/slides/app/components/editor/EditorActionCluster.tsx +45 -91
  129. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +94 -2
  130. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +17 -29
  131. package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
  132. package/corpus/templates/slides/app/context/DeckContext.tsx +42 -2
  133. package/corpus/templates/slides/app/global.css +7 -40
  134. package/corpus/templates/slides/app/i18n/en-US.ts +4 -0
  135. package/corpus/templates/slides/app/pages/DeckEditor.tsx +130 -45
  136. package/dist/agent/index.d.ts +1 -1
  137. package/dist/agent/production-agent.d.ts +30 -0
  138. package/dist/agent/production-agent.js +105 -9
  139. package/dist/agent/thread-data-builder.js +17 -1
  140. package/dist/agent/types.d.ts +9 -0
  141. package/dist/cli/skills-content/help.js +6 -4
  142. package/dist/cli/skills.js +17 -2
  143. package/dist/cli/workspacify.d.ts +5 -0
  144. package/dist/cli/workspacify.js +65 -8
  145. package/dist/client/AgentPanel.d.ts +5 -0
  146. package/dist/client/AgentPanel.js +32 -13
  147. package/dist/client/AssistantChat.d.ts +36 -1
  148. package/dist/client/AssistantChat.js +175 -110
  149. package/dist/client/MultiTabAssistantChat.js +44 -27
  150. package/dist/client/active-run-state.d.ts +14 -1
  151. package/dist/client/active-run-state.js +0 -0
  152. package/dist/client/agent-chat-adapter.js +107 -5
  153. package/dist/client/analytics.js +9 -2
  154. package/dist/client/chat/markdown-renderer.js +4 -2
  155. package/dist/client/chat/message-components.d.ts +2 -2
  156. package/dist/client/chat/message-components.js +69 -35
  157. package/dist/client/chat/run-recovery.d.ts +4 -1
  158. package/dist/client/chat/run-recovery.js +62 -30
  159. package/dist/client/chat/tool-call-display.d.ts +12 -3
  160. package/dist/client/chat/tool-call-display.js +79 -40
  161. package/dist/client/chat/widgets/DataChartRenderer.js +3 -1
  162. package/dist/client/chat/widgets/DataChartWidget.js +8 -2
  163. package/dist/client/chat/widgets/DataInsightsWidget.js +3 -1
  164. package/dist/client/chat/widgets/DataTableWidget.js +23 -9
  165. package/dist/client/chat/widgets/builtin-tool-renderers.js +3 -1
  166. package/dist/client/chat-first/apps-rail.js +9 -4
  167. package/dist/client/chat-first/primary-nav.d.ts +2 -1
  168. package/dist/client/chat-first/primary-nav.js +3 -3
  169. package/dist/client/chat-first/types.d.ts +5 -1
  170. package/dist/client/components/ui/message-scroller.d.ts +1 -1
  171. package/dist/client/components/ui/message-scroller.js +7 -3
  172. package/dist/client/composer/runtime-adapters.js +3 -2
  173. package/dist/client/context-xray/ContextMeter.js +5 -1
  174. package/dist/client/context-xray/ContextXRayPanel.js +5 -5
  175. package/dist/client/error-format.d.ts +4 -0
  176. package/dist/client/error-format.js +93 -5
  177. package/dist/client/i18n.js +83 -17
  178. package/dist/client/markdown/InlineMarkdown.d.ts +23 -0
  179. package/dist/client/markdown/InlineMarkdown.js +65 -0
  180. package/dist/client/markdown/index.d.ts +1 -0
  181. package/dist/client/markdown/index.js +1 -0
  182. package/dist/client/observability/ThumbsFeedback.js +10 -8
  183. package/dist/client/review/ReviewThreadPanel.js +2 -1
  184. package/dist/client/run-stream-ownership.d.ts +39 -0
  185. package/dist/client/run-stream-ownership.js +65 -0
  186. package/dist/client/sharing/ShareButton.js +160 -54
  187. package/dist/coding-tools/run-code.js +2 -1
  188. package/dist/coding-tools/sandbox/background.d.ts +1 -0
  189. package/dist/coding-tools/sandbox/background.js +8 -1
  190. package/dist/coding-tools/sandbox/executions-store.d.ts +2 -0
  191. package/dist/coding-tools/sandbox/executions-store.js +41 -3
  192. package/dist/collab/awareness.d.ts +2 -2
  193. package/dist/collab/routes.d.ts +1 -1
  194. package/dist/collab/struct-routes.d.ts +1 -1
  195. package/dist/feature-flags/index.d.ts +1 -1
  196. package/dist/feature-flags/index.js +1 -1
  197. package/dist/feature-flags/store.d.ts +10 -0
  198. package/dist/feature-flags/store.js +112 -1
  199. package/dist/guards/no-env-credentials.js +4 -0
  200. package/dist/index.d.ts +2 -2
  201. package/dist/index.js +1 -1
  202. package/dist/integrations/adapters/slack.js +5 -1
  203. package/dist/localization/core-messages/ar-SA.d.ts +3 -0
  204. package/dist/localization/core-messages/ar-SA.js +541 -0
  205. package/dist/localization/core-messages/de-DE.d.ts +3 -0
  206. package/dist/localization/core-messages/de-DE.js +513 -0
  207. package/dist/localization/core-messages/en-US.d.ts +513 -0
  208. package/dist/localization/core-messages/en-US.js +513 -0
  209. package/dist/localization/core-messages/es-ES.d.ts +3 -0
  210. package/dist/localization/core-messages/es-ES.js +520 -0
  211. package/dist/localization/core-messages/fr-FR.d.ts +3 -0
  212. package/dist/localization/core-messages/fr-FR.js +520 -0
  213. package/dist/localization/core-messages/hi-IN.d.ts +3 -0
  214. package/dist/localization/core-messages/hi-IN.js +513 -0
  215. package/dist/localization/core-messages/ja-JP.d.ts +3 -0
  216. package/dist/localization/core-messages/ja-JP.js +506 -0
  217. package/dist/localization/core-messages/ko-KR.d.ts +3 -0
  218. package/dist/localization/core-messages/ko-KR.js +506 -0
  219. package/dist/localization/core-messages/pt-BR.d.ts +3 -0
  220. package/dist/localization/core-messages/pt-BR.js +520 -0
  221. package/dist/localization/core-messages/zh-CN.d.ts +3 -0
  222. package/dist/localization/core-messages/zh-CN.js +506 -0
  223. package/dist/localization/core-messages/zh-TW.d.ts +3 -0
  224. package/dist/localization/core-messages/zh-TW.js +506 -0
  225. package/dist/localization/core-messages.d.ts +524 -0
  226. package/dist/localization/core-messages.js +124 -0
  227. package/dist/localization/default-messages.d.ts +3 -0
  228. package/dist/localization/default-messages.js +3 -0
  229. package/dist/notifications/routes.d.ts +1 -1
  230. package/dist/observability/routes.d.ts +2 -2
  231. package/dist/progress/routes.d.ts +1 -1
  232. package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
  233. package/dist/provider-api/actions/provider-api.d.ts +15 -15
  234. package/dist/resources/agents.js +40 -5
  235. package/dist/resources/metadata.d.ts +10 -0
  236. package/dist/resources/metadata.js +7 -3
  237. package/dist/review/actions/create-review-comment.js +1 -1
  238. package/dist/review/actions/reply-review-comment.js +1 -1
  239. package/dist/review/actions/resolve-review-thread.js +1 -1
  240. package/dist/secrets/routes.d.ts +6 -6
  241. package/dist/server/action-routes.js +32 -6
  242. package/dist/server/agent-chat/plugin-options.d.ts +7 -2
  243. package/dist/server/agent-chat-plugin.d.ts +10 -0
  244. package/dist/server/agent-chat-plugin.js +144 -41
  245. package/dist/server/agent-discovery.js +14 -3
  246. package/dist/server/agent-run-context.d.ts +7 -1
  247. package/dist/server/agent-run-context.js +9 -2
  248. package/dist/server/agent-teams-run-queue.d.ts +3 -0
  249. package/dist/server/agent-teams.js +38 -9
  250. package/dist/server/core-routes-plugin.js +1 -1
  251. package/dist/server/identity-sso-migrations.d.ts +7 -0
  252. package/dist/server/identity-sso-migrations.js +36 -0
  253. package/dist/server/identity-sso-store.d.ts +3 -2
  254. package/dist/server/identity-sso-store.js +8 -3
  255. package/dist/server/index.d.ts +1 -1
  256. package/dist/server/realtime-token.d.ts +1 -1
  257. package/dist/server/release-migrations.js +4 -0
  258. package/dist/server/request-context.d.ts +7 -0
  259. package/dist/server/request-context.js +15 -0
  260. package/dist/tracking/providers.js +13 -3
  261. package/dist/workspace-files/tool.js +1 -1
  262. package/docs/content/agent-surfaces.mdx +30 -0
  263. package/package.json +3 -2
@@ -79,6 +79,7 @@ async function _doEnsureTable() {
79
79
  timed_out ${intType()} NOT NULL DEFAULT 0,
80
80
  error TEXT,
81
81
  bridge_tools_used TEXT,
82
+ allowed_action_names TEXT,
82
83
  created_at ${intType()} NOT NULL,
83
84
  started_at ${intType()},
84
85
  finished_at ${intType()},
@@ -94,7 +95,10 @@ async function _doEnsureTable() {
94
95
  await ensureTableExists(TABLE, createSql);
95
96
  // Additive-column guard: keeps older deployments (created before a column
96
97
  // was added) self-healing without destructive migrations.
97
- const pgColumns = [["bridge_tools_used", "TEXT"]];
98
+ const pgColumns = [
99
+ ["bridge_tools_used", "TEXT"],
100
+ ["allowed_action_names", "TEXT"],
101
+ ];
98
102
  for (const [col, def] of pgColumns) {
99
103
  await ensureColumnExists(TABLE, col, `ALTER TABLE ${TABLE} ADD COLUMN IF NOT EXISTS ${col} ${def}`);
100
104
  }
@@ -103,6 +107,15 @@ async function _doEnsureTable() {
103
107
  }
104
108
  else {
105
109
  await retryOnDdlRace(() => client.execute(createSql));
110
+ try {
111
+ await retryOnDdlRace(() => client.execute(`ALTER TABLE ${TABLE} ADD COLUMN allowed_action_names TEXT`));
112
+ }
113
+ catch (error) {
114
+ const message = String(error?.message ?? error);
115
+ if (!/duplicate column name|column .* already exists/i.test(message)) {
116
+ throw error;
117
+ }
118
+ }
106
119
  await retryOnDdlRace(() => client.execute(ownerIdxSql));
107
120
  await retryOnDdlRace(() => client.execute(dueIdxSql));
108
121
  }
@@ -136,6 +149,27 @@ function rowFromDb(raw) {
136
149
  bridgeToolsUsed = [];
137
150
  }
138
151
  }
152
+ let allowedActionNames;
153
+ if (raw.allowed_action_names !== null &&
154
+ raw.allowed_action_names !== undefined) {
155
+ if (typeof raw.allowed_action_names !== "string") {
156
+ allowedActionNames = [];
157
+ }
158
+ else {
159
+ try {
160
+ const parsed = JSON.parse(raw.allowed_action_names);
161
+ allowedActionNames =
162
+ Array.isArray(parsed) &&
163
+ parsed.every((item) => typeof item === "string")
164
+ ? [...new Set(parsed)]
165
+ : [];
166
+ }
167
+ catch {
168
+ // A malformed persisted surface must never restore the full registry.
169
+ allowedActionNames = [];
170
+ }
171
+ }
172
+ }
139
173
  return {
140
174
  id: String(raw.id),
141
175
  owner: String(raw.owner),
@@ -165,6 +199,7 @@ function rowFromDb(raw) {
165
199
  timedOut: toBool(raw.timed_out),
166
200
  error: raw.error === null || raw.error === undefined ? null : String(raw.error),
167
201
  bridgeToolsUsed,
202
+ allowedActionNames,
168
203
  createdAt: toNumberOrNull(raw.created_at) ?? 0,
169
204
  startedAt: toNumberOrNull(raw.started_at),
170
205
  finishedAt: toNumberOrNull(raw.finished_at),
@@ -180,8 +215,8 @@ export async function createSandboxExecution(input) {
180
215
  const maxAttempts = Math.max(1, Math.min(input.maxAttempts ?? SANDBOX_EXECUTION_DEFAULT_MAX_ATTEMPTS, 5));
181
216
  await client.execute({
182
217
  sql: `INSERT INTO ${TABLE}
183
- (id, owner, org_id, thread_id, runtime, code, status, timeout_ms, max_output_chars, attempt_count, max_attempts, created_at, updated_at)
184
- VALUES (?, ?, ?, ?, ?, ?, 'queued', ?, ?, 0, ?, ?, ?)`,
218
+ (id, owner, org_id, thread_id, runtime, code, status, timeout_ms, max_output_chars, attempt_count, max_attempts, allowed_action_names, created_at, updated_at)
219
+ VALUES (?, ?, ?, ?, ?, ?, 'queued', ?, ?, 0, ?, ?, ?, ?)`,
185
220
  args: [
186
221
  id,
187
222
  input.owner,
@@ -192,6 +227,9 @@ export async function createSandboxExecution(input) {
192
227
  input.timeoutMs,
193
228
  input.maxOutputChars,
194
229
  maxAttempts,
230
+ input.allowedActionNames === undefined
231
+ ? null
232
+ : JSON.stringify([...new Set(input.allowedActionNames)]),
195
233
  now,
196
234
  now,
197
235
  ],
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
62
62
  error: string;
63
63
  states?: undefined;
64
64
  } | {
65
- error?: undefined;
66
65
  states: {
67
66
  clientId: number;
68
67
  state: string;
69
68
  }[];
69
+ error?: undefined;
70
70
  }>>;
71
71
  /**
72
72
  * GET /_agent-native/collab/:docId/users
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
77
77
  error: string;
78
78
  users?: undefined;
79
79
  } | {
80
- error?: undefined;
81
80
  users: {
82
81
  clientId: number;
83
82
  lastSeen: number;
84
83
  }[];
84
+ error?: undefined;
85
85
  }>>;
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
26
26
  * Body: { update: string (base64), requestSource?: string }
27
27
  */
28
28
  export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
29
- error: string;
30
29
  ok?: undefined;
30
+ error: string;
31
31
  } | {
32
32
  error?: undefined;
33
33
  ok: boolean;
@@ -13,8 +13,8 @@
13
13
  * Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
14
14
  */
15
15
  export declare const postCollabJson: 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;
@@ -1,4 +1,4 @@
1
1
  export { defineFeatureFlag, defineFeatureFlags, getFeatureFlagDefinition, listFeatureFlags, registerFeatureFlags, type FeatureFlagDefinition, } from "./registry.js";
2
- export { defaultFeatureFlagRules, evaluateFeatureFlag, evaluateFeatureFlagRules, isFeatureFlagEnabled, getFeatureFlagRules, normalizeFeatureFlagRules, type FeatureFlagMode, type FeatureFlagRules, type FeatureFlagScope, } from "./store.js";
2
+ export { defaultFeatureFlagRules, evaluateFeatureFlag, evaluateFeatureFlagRules, hasActiveFeatureFlagRollout, isFeatureFlagEnabled, getFeatureFlagRules, normalizeFeatureFlagRules, type FeatureFlagMode, type FeatureFlagRules, type FeatureFlagScope, } from "./store.js";
3
3
  export { createFeatureFlagsPlugin } from "./plugin.js";
4
4
  export { createFeatureFlagA2AActionRouteAuth } from "./a2a-action-route.js";
@@ -1,4 +1,4 @@
1
1
  export { defineFeatureFlag, defineFeatureFlags, getFeatureFlagDefinition, listFeatureFlags, registerFeatureFlags, } from "./registry.js";
2
- export { defaultFeatureFlagRules, evaluateFeatureFlag, evaluateFeatureFlagRules, isFeatureFlagEnabled, getFeatureFlagRules, normalizeFeatureFlagRules, } from "./store.js";
2
+ export { defaultFeatureFlagRules, evaluateFeatureFlag, evaluateFeatureFlagRules, hasActiveFeatureFlagRollout, isFeatureFlagEnabled, getFeatureFlagRules, normalizeFeatureFlagRules, } from "./store.js";
3
3
  export { createFeatureFlagsPlugin } from "./plugin.js";
4
4
  export { createFeatureFlagA2AActionRouteAuth } from "./a2a-action-route.js";
@@ -19,6 +19,16 @@ export declare const FEATURE_FLAG_SETTINGS_PREFIX = "feature-flag:";
19
19
  export declare function defaultFeatureFlagRules(): FeatureFlagRules;
20
20
  export declare function normalizeFeatureFlagRules(value: unknown): FeatureFlagRules;
21
21
  export declare function getFeatureFlagRules(key: string, scope: Pick<FeatureFlagScope, "orgId">): Promise<FeatureFlagRules>;
22
+ /**
23
+ * Anonymous discovery hint for a rollout that may be scoped to an org.
24
+ *
25
+ * This deliberately answers only whether some active rollout exists. It does
26
+ * not reveal the target email or organization, and callers must still run
27
+ * `evaluateFeatureFlag` with the authenticated scope before granting access.
28
+ * Without this separate hint, an org-only rollout is invisible to Desktop
29
+ * before the user has authenticated and the org can be resolved.
30
+ */
31
+ export declare function hasActiveFeatureFlagRollout(key: string): Promise<boolean>;
22
32
  /**
23
33
  * Atomically derive one flag's scoped rules. An org's first override starts
24
34
  * from the global fallback, then becomes independently CAS-protected.
@@ -1,10 +1,73 @@
1
+ import { getDbExec, isPostgres } from "../db/client.js";
1
2
  import { getOrgSetting, mutateOrgSetting } from "../settings/org-settings.js";
2
3
  import { getSetting, mutateSetting } from "../settings/store.js";
3
4
  import { getFeatureFlagDefinition, } from "./registry.js";
4
5
  export const FEATURE_FLAG_SETTINGS_PREFIX = "feature-flag:";
6
+ const FEATURE_FLAG_ROLLOUT_INDEX_PREFIX = "feature-flag-rollout-index:";
5
7
  function settingKey(key) {
6
8
  return `${FEATURE_FLAG_SETTINGS_PREFIX}${key}`;
7
9
  }
10
+ function rolloutIndexKey(key) {
11
+ return `${FEATURE_FLAG_ROLLOUT_INDEX_PREFIX}${key}`;
12
+ }
13
+ function parseStoredRules(value) {
14
+ if (typeof value === "string")
15
+ return normalizeFeatureFlagRules(JSON.parse(value));
16
+ return normalizeFeatureFlagRules(value);
17
+ }
18
+ function hasActiveRollout(rules) {
19
+ return (rules.mode === "on" ||
20
+ (rules.mode === "rules" &&
21
+ (rules.emails.length > 0 ||
22
+ rules.orgIds.length > 0 ||
23
+ rules.percentage > 0)));
24
+ }
25
+ function normalizeFeatureFlagRolloutIndex(value) {
26
+ if (!value || typeof value !== "object")
27
+ return null;
28
+ const raw = value;
29
+ const orgIds = Array.isArray(raw.orgIds)
30
+ ? [
31
+ ...new Set(raw.orgIds.filter((item) => typeof item === "string")),
32
+ ]
33
+ .map((orgId) => orgId.trim())
34
+ .filter(Boolean)
35
+ .sort()
36
+ : [];
37
+ return {
38
+ version: 1,
39
+ global: raw.global === true,
40
+ orgIds,
41
+ };
42
+ }
43
+ function activeFeatureFlagRolloutIndex(index) {
44
+ return index.global || index.orgIds.length > 0;
45
+ }
46
+ async function syncFeatureFlagRolloutIndex(key, scope, rules) {
47
+ const indexKey = rolloutIndexKey(key);
48
+ await mutateSetting(indexKey, async (current) => {
49
+ const next = normalizeFeatureFlagRolloutIndex(current) ?? {
50
+ version: 1,
51
+ global: false,
52
+ orgIds: [],
53
+ };
54
+ if (scope.orgId?.trim()) {
55
+ const orgId = scope.orgId.trim();
56
+ const active = hasActiveRollout(rules);
57
+ const orgIds = active
58
+ ? [...new Set([...next.orgIds, orgId])].sort()
59
+ : next.orgIds.filter((value) => value !== orgId);
60
+ return {
61
+ ...next,
62
+ orgIds,
63
+ };
64
+ }
65
+ return {
66
+ ...next,
67
+ global: hasActiveRollout(rules),
68
+ };
69
+ });
70
+ }
8
71
  export function defaultFeatureFlagRules() {
9
72
  return {
10
73
  version: 1,
@@ -66,6 +129,52 @@ export async function getFeatureFlagRules(key, scope) {
66
129
  ]);
67
130
  return normalizeFeatureFlagRules(orgStored ?? globalStored);
68
131
  }
132
+ /**
133
+ * Anonymous discovery hint for a rollout that may be scoped to an org.
134
+ *
135
+ * This deliberately answers only whether some active rollout exists. It does
136
+ * not reveal the target email or organization, and callers must still run
137
+ * `evaluateFeatureFlag` with the authenticated scope before granting access.
138
+ * Without this separate hint, an org-only rollout is invisible to Desktop
139
+ * before the user has authenticated and the org can be resolved.
140
+ */
141
+ export async function hasActiveFeatureFlagRollout(key) {
142
+ if (!getFeatureFlagDefinition(key))
143
+ return false;
144
+ const indexKey = rolloutIndexKey(key);
145
+ const storedIndex = normalizeFeatureFlagRolloutIndex(await getSetting(indexKey));
146
+ if (storedIndex)
147
+ return activeFeatureFlagRolloutIndex(storedIndex);
148
+ const globalStored = await getSetting(settingKey(key));
149
+ const globalActive = hasActiveRollout(parseStoredRules(globalStored));
150
+ if (globalActive) {
151
+ await mutateSetting(indexKey, async () => ({
152
+ version: 1,
153
+ global: true,
154
+ orgIds: [],
155
+ }));
156
+ return true;
157
+ }
158
+ const table = isPostgres() ? "public.settings" : "settings";
159
+ const { rows } = await getDbExec().execute({
160
+ sql: `SELECT key, value FROM ${table} WHERE key LIKE ?`,
161
+ args: [`o:%:${settingKey(key)}`],
162
+ });
163
+ const orgIds = rows
164
+ .filter((row) => hasActiveRollout(parseStoredRules(row.value)))
165
+ .map((row) => {
166
+ const match = /^o:([^:]+):/.exec(row.key ?? "");
167
+ return match?.[1] ?? null;
168
+ })
169
+ .filter((orgId) => Boolean(orgId))
170
+ .sort();
171
+ await mutateSetting(indexKey, async () => ({
172
+ version: 1,
173
+ global: false,
174
+ orgIds,
175
+ }));
176
+ return orgIds.length > 0;
177
+ }
69
178
  /**
70
179
  * Atomically derive one flag's scoped rules. An org's first override starts
71
180
  * from the global fallback, then becomes independently CAS-protected.
@@ -85,7 +194,9 @@ export async function mutateFeatureFlagRules(key, scope, updater) {
85
194
  const persisted = scope.orgId?.trim()
86
195
  ? await mutateOrgSetting(scope.orgId, settingKey(key), mutate)
87
196
  : await mutateSetting(settingKey(key), mutate);
88
- return normalizeFeatureFlagRules(persisted);
197
+ const normalized = normalizeFeatureFlagRules(persisted);
198
+ await syncFeatureFlagRolloutIndex(key, scope, normalized);
199
+ return normalized;
89
200
  }
90
201
  function rolloutBucket(input) {
91
202
  // FNV-1a is deliberately tiny, deterministic, and independent of runtime.
@@ -55,6 +55,10 @@ const ALLOWLIST_EXACT = new Set([
55
55
  "AWS_LAMBDA_FUNCTION_NAME",
56
56
  "BETTER_AUTH_SECRET",
57
57
  "BETTER_AUTH_URL",
58
+ // Public deployment identity/configuration. These select the app origin and
59
+ // explicitly registered SSO clients; they are not user credentials.
60
+ "APP_URL",
61
+ "IDENTITY_SSO_APP_REGISTRY_JSON",
58
62
  "NOTION_CLIENT_ID",
59
63
  "NOTION_CLIENT_SECRET",
60
64
  "NOTION_STATE_SECRET",
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./config.js";
2
- export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, DEFAULT_MODEL, TripWire, type Processor, type ProcessorState, type ProcessorAbort, } from "./agent/index.js";
2
+ export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type AgentActionSurfaceDetails, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, DEFAULT_MODEL, TripWire, type Processor, type ProcessorState, type ProcessorAbort, } from "./agent/index.js";
3
3
  export { defineAction, ActionContractError, isActionContractError, type ActionContractErrorOptions, AgentActionStopError, isAgentActionStopError, type ActionDefinition, type ActionHttpConfig, type AgentActionStopOptions, type PublicAgentActionConfig, type ActionDeepLink, type ActionLinkBuilder, MCP_APP_EXTENSION_ID, MCP_APP_MIME_TYPE, MCP_APP_RESOURCE_URI_META_KEY, type ActionMcpAppConfig, type ActionMcpAppCsp, type ActionMcpAppCspBuilder, type ActionMcpAppHtmlBuilder, type ActionMcpAppPermissions, type ActionMcpAppResourceConfig, type ActionMcpAppResourceMeta, } from "./action.js";
4
4
  export * from "./user-profile/index.js";
5
5
  export { embedApp, MCP_APP_REQUEST_ORIGIN_CSP_SOURCE, type EmbedAppOptions, } from "./mcp/embed-app.js";
@@ -11,7 +11,7 @@ export { createAgentChatPlugin, defaultAgentChatPlugin, type AgentChatPluginOpti
11
11
  export { createAgentNativeEmbeddedPlugin, mountAgentNativeEmbedded, type AgentNativeEmbeddedPluginOptions, } from "./server/embedded.js";
12
12
  export { BUILT_IN_INTEGRATION_CATALOG, INTEGRATION_CATEGORIES, getIntegrationCatalogEntry, listBuiltInChannelIntegrations, listIntegrationCatalog, type AutomationCapabilities, type BuiltInChannelId, type ChannelCapabilities, type IntegrationAvailability, type IntegrationCatalogEntry, type IntegrationCategory, type IntegrationCredentialRequirement, type IntegrationIconKey, type IntegrationSupportMaturity, } from "./integrations/catalog.js";
13
13
  export { AutomationConnectorError, createAutomationCallbackHandler, createAutomationRuntime, createInvokeAutomationWorkflowAction, type AutomationCallbackAuthentication, type AutomationCallbackInput, type AutomationCallbackResult, type AutomationInboundDefinition, type AutomationInvocation, type AutomationInvocationResult, type AutomationInvocationStatus, type AutomationOutboundDefinition, type AutomationResponseMode, type AutomationRetryPolicy, type AutomationRuntime, type AutomationRuntimeOptions, type AutomationWorkflowCapabilities, type AutomationWorkflowDefinition, type JsonSchema, } from "./automation/index.js";
14
- export { createFeatureFlagsPlugin, defineFeatureFlag, defineFeatureFlags, evaluateFeatureFlag, getFeatureFlagDefinition, getFeatureFlagRules, isFeatureFlagEnabled, listFeatureFlags, registerFeatureFlags, type FeatureFlagDefinition, type FeatureFlagMode, type FeatureFlagRules, type FeatureFlagScope, } from "./feature-flags/index.js";
14
+ export { createFeatureFlagsPlugin, defineFeatureFlag, defineFeatureFlags, evaluateFeatureFlag, getFeatureFlagDefinition, getFeatureFlagRules, hasActiveFeatureFlagRollout, isFeatureFlagEnabled, listFeatureFlags, registerFeatureFlags, type FeatureFlagDefinition, type FeatureFlagMode, type FeatureFlagRules, type FeatureFlagScope, } from "./feature-flags/index.js";
15
15
  export { createServer, createSSEHandler, defineNitroPlugin, autoMountAuth, getSession, type CreateServerOptions, type SSEHandlerOptions, type AuthSession, type AuthOptions, } from "./server/index.js";
16
16
  export { agentChat, type AgentChatCallOptions, type AgentChatResponse, } from "./shared/index.js";
17
17
  export { EMBED_MODE_QUERY_PARAM, EMBED_SESSION_COOKIE, EMBED_START_PATH, EMBED_TOKEN_QUERY_PARAM, } from "./shared/embed-auth.js";
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ export { createAgentChatPlugin, defaultAgentChatPlugin, } from "./server/agent-c
16
16
  export { createAgentNativeEmbeddedPlugin, mountAgentNativeEmbedded, } from "./server/embedded.js";
17
17
  export { BUILT_IN_INTEGRATION_CATALOG, INTEGRATION_CATEGORIES, getIntegrationCatalogEntry, listBuiltInChannelIntegrations, listIntegrationCatalog, } from "./integrations/catalog.js";
18
18
  export { AutomationConnectorError, createAutomationCallbackHandler, createAutomationRuntime, createInvokeAutomationWorkflowAction, } from "./automation/index.js";
19
- export { createFeatureFlagsPlugin, defineFeatureFlag, defineFeatureFlags, evaluateFeatureFlag, getFeatureFlagDefinition, getFeatureFlagRules, isFeatureFlagEnabled, listFeatureFlags, registerFeatureFlags, } from "./feature-flags/index.js";
19
+ export { createFeatureFlagsPlugin, defineFeatureFlag, defineFeatureFlags, evaluateFeatureFlag, getFeatureFlagDefinition, getFeatureFlagRules, hasActiveFeatureFlagRollout, isFeatureFlagEnabled, listFeatureFlags, registerFeatureFlags, } from "./feature-flags/index.js";
20
20
  // Server
21
21
  export { createServer, createSSEHandler, defineNitroPlugin, autoMountAuth, getSession, } from "./server/index.js";
22
22
  // Client
@@ -858,7 +858,11 @@ function markdownToSlackMrkdwn(text) {
858
858
  // pathological "**" sequence that exhibits super-linear backtracking.
859
859
  // Newlines are allowed because `[^*]` excludes only the asterisk
860
860
  // itself, so multi-line bold spans still match.
861
- .replace(/\*\*([^*]{1,5000})\*\*/g, "*$1*"));
861
+ .replace(/\*\*([^*]{1,5000})\*\*/g, "*$1*")
862
+ // Agent output sometimes uses Markdown-style bare Slack user IDs.
863
+ // Leave native `<@...>` mentions untouched while converting the bare
864
+ // user/member forms Slack expects in mrkdwn.
865
+ .replace(/(?<![<\w])@([UW][A-Z0-9]+)(?![A-Z0-9])/g, "<@$1>"));
862
866
  }
863
867
  /**
864
868
  * Optionally set Slack's native Agent status indicator (the small "is
@@ -0,0 +1,3 @@
1
+ import type { AgentChatTranslation } from "../core-messages.js";
2
+ declare const messages: AgentChatTranslation;
3
+ export default messages;