@agent-native/core 0.157.3 → 0.157.5

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 (211) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  3. package/corpus/templates/analytics/.agents/skills/sharing/SKILL.md +21 -0
  4. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +40 -1
  5. package/corpus/templates/assets/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  6. package/corpus/templates/assets/.agents/skills/sharing/SKILL.md +21 -0
  7. package/corpus/templates/brain/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  8. package/corpus/templates/brain/.agents/skills/sharing/SKILL.md +21 -0
  9. package/corpus/templates/calendar/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  10. package/corpus/templates/calendar/.agents/skills/sharing/SKILL.md +21 -0
  11. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +3 -1
  12. package/corpus/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  13. package/corpus/templates/chat/.agents/skills/sharing/SKILL.md +21 -0
  14. package/corpus/templates/clips/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  15. package/corpus/templates/clips/.agents/skills/meetings/SKILL.md +7 -7
  16. package/corpus/templates/clips/actions/approve-recording-access-request.ts +147 -0
  17. package/corpus/templates/clips/actions/request-recording-access.ts +121 -23
  18. package/corpus/templates/clips/actions/view-screen.ts +1 -1
  19. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +34 -53
  20. package/corpus/templates/clips/app/components/player/request-access-dialog.tsx +104 -0
  21. package/corpus/templates/clips/app/components/player/share-dialog.tsx +36 -45
  22. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +3 -6
  23. package/corpus/templates/clips/app/i18n/en-US.ts +26 -1
  24. package/corpus/templates/clips/app/lib/public-meeting.ts +1 -1
  25. package/corpus/templates/clips/app/routes/access-request.approve.tsx +250 -0
  26. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +9 -32
  27. package/corpus/templates/clips/app/routes/share.$shareId.tsx +123 -37
  28. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +41 -1
  29. package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +1 -0
  30. package/corpus/templates/clips/server/lib/emails.ts +40 -11
  31. package/corpus/templates/clips/shared/recording-link.ts +32 -1
  32. package/corpus/templates/clips/shared/share-attribution.ts +13 -0
  33. package/corpus/templates/content/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  34. package/corpus/templates/content/.agents/skills/sharing/SKILL.md +21 -0
  35. package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +22 -10
  36. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +2 -1
  37. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +245 -9
  38. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +185 -134
  39. package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +61 -45
  40. package/corpus/templates/content/app/components/editor/extensions/ImageNode.ts +6 -0
  41. package/corpus/templates/content/app/components/editor/image-upload.ts +137 -5
  42. package/corpus/templates/content/app/global.css +8 -0
  43. package/corpus/templates/content/changelog/2026-08-12-image-uploads-now-confirm-the-image-can-be-displayed-before-.md +6 -0
  44. package/corpus/templates/content/changelog/2026-08-14-images-fill-the-page-width-by-default-and-remain-visible-whe.md +6 -0
  45. package/corpus/templates/content/changelog/2026-08-14-images-inserted-from-the-slash-command-stay-saved-after-uplo.md +6 -0
  46. package/corpus/templates/content/changelog/2026-08-14-svg-files-can-be-selected-reliably-from-the-image-picker.md +6 -0
  47. package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  48. package/corpus/templates/crm/.agents/skills/sharing/SKILL.md +21 -0
  49. package/corpus/templates/design/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  50. package/corpus/templates/design/.agents/skills/sharing/SKILL.md +21 -0
  51. package/corpus/templates/dispatch/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  52. package/corpus/templates/dispatch/.agents/skills/sharing/SKILL.md +21 -0
  53. package/corpus/templates/factory/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  54. package/corpus/templates/factory/.agents/skills/sharing/SKILL.md +21 -0
  55. package/corpus/templates/forms/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  56. package/corpus/templates/forms/.agents/skills/sharing/SKILL.md +21 -0
  57. package/corpus/templates/macros/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  58. package/corpus/templates/macros/.agents/skills/sharing/SKILL.md +21 -0
  59. package/corpus/templates/mail/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  60. package/corpus/templates/mail/.agents/skills/sharing/SKILL.md +21 -0
  61. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -1
  62. package/corpus/templates/plan/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  63. package/corpus/templates/plan/.agents/skills/sharing/SKILL.md +21 -0
  64. package/corpus/templates/plan/app/pages/PlansPage.tsx +25 -30
  65. package/corpus/templates/slides/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  66. package/corpus/templates/slides/.agents/skills/sharing/SKILL.md +21 -0
  67. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +2 -1
  68. package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +124 -180
  69. package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +1 -0
  70. package/corpus/templates/slides/app/global.css +99 -3
  71. package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
  72. package/corpus/templates/tasks/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  73. package/corpus/templates/tasks/.agents/skills/sharing/SKILL.md +21 -0
  74. package/dist/chat-threads/schema.d.ts +1 -1
  75. package/dist/cli/code-agent-executor.js +318 -0
  76. package/dist/client/AgentPanel.d.ts +13 -1
  77. package/dist/client/AgentPanel.js +41 -3
  78. package/dist/client/AssistantChat.d.ts +9 -1
  79. package/dist/client/AssistantChat.js +26 -13
  80. package/dist/client/MultiTabAssistantChat.js +18 -5
  81. package/dist/client/agent-chat.d.ts +8 -0
  82. package/dist/client/agent-chat.js +15 -0
  83. package/dist/client/app-chat-sidebar.d.ts +23 -0
  84. package/dist/client/app-chat-sidebar.js +53 -0
  85. package/dist/client/app-providers.js +31 -2
  86. package/dist/client/frame-protocol.d.ts +20 -2
  87. package/dist/client/hooks/index.d.ts +1 -0
  88. package/dist/client/hooks/index.js +1 -0
  89. package/dist/client/sharing/AgentShareSection.d.ts +8 -0
  90. package/dist/client/sharing/AgentShareSection.js +50 -0
  91. package/dist/client/sharing/ShareButton.js +2 -1
  92. package/dist/client/sharing/ShareDialog.d.ts +2 -2
  93. package/dist/client/sharing/ShareDialog.js +21 -29
  94. package/dist/client/sharing/index.d.ts +1 -0
  95. package/dist/client/sharing/index.js +1 -0
  96. package/dist/client/sharing/useShareButtonController.d.ts +1 -0
  97. package/dist/client/sharing/useShareDialogController.d.ts +3 -0
  98. package/dist/client/sharing/useShareDialogController.js +2 -1
  99. package/dist/client/theme.d.ts +21 -0
  100. package/dist/client/theme.js +60 -0
  101. package/dist/client/ui/index.d.ts +1 -1
  102. package/dist/client/ui/index.js +1 -1
  103. package/dist/client/use-session.js +23 -0
  104. package/dist/collab/awareness.d.ts +2 -2
  105. package/dist/collab/struct-routes.d.ts +1 -1
  106. package/dist/dashboard-storage/schema.d.ts +1 -1
  107. package/dist/data-programs/schema.d.ts +1 -1
  108. package/dist/extensions/schema.d.ts +1 -1
  109. package/dist/localization/core-messages/ar-SA.js +6 -0
  110. package/dist/localization/core-messages/de-DE.js +6 -0
  111. package/dist/localization/core-messages/en-US.d.ts +6 -0
  112. package/dist/localization/core-messages/en-US.js +6 -0
  113. package/dist/localization/core-messages/es-ES.js +6 -0
  114. package/dist/localization/core-messages/fr-FR.js +6 -0
  115. package/dist/localization/core-messages/hi-IN.js +6 -0
  116. package/dist/localization/core-messages/ja-JP.js +6 -0
  117. package/dist/localization/core-messages/ko-KR.js +6 -0
  118. package/dist/localization/core-messages/pt-BR.js +6 -0
  119. package/dist/localization/core-messages/zh-CN.js +6 -0
  120. package/dist/localization/core-messages/zh-TW.js +6 -0
  121. package/dist/localization/core-messages.d.ts +6 -0
  122. package/dist/localization/default-messages.d.ts +1 -0
  123. package/dist/localization/default-messages.js +1 -0
  124. package/dist/notifications/routes.d.ts +3 -3
  125. package/dist/progress/routes.d.ts +1 -1
  126. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  127. package/dist/provider-api/actions/provider-api.d.ts +14 -14
  128. package/dist/server/auth.js +8 -5
  129. package/dist/server/identity-sso-store.d.ts +6 -1
  130. package/dist/server/identity-sso-store.js +57 -14
  131. package/dist/server/identity-sso.d.ts +7 -8
  132. package/dist/server/identity-sso.js +15 -12
  133. package/dist/sharing/actions/list-resource-shares.d.ts +2 -0
  134. package/dist/sharing/actions/list-resource-shares.js +1 -0
  135. package/dist/sharing/schema.d.ts +1 -1
  136. package/dist/sharing/schema.js +4 -1
  137. package/dist/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  138. package/dist/templates/chat/.agents/skills/sharing/SKILL.md +21 -0
  139. package/dist/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  140. package/dist/templates/default/.agents/skills/sharing/SKILL.md +21 -0
  141. package/dist/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  142. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  143. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +21 -0
  144. package/docs/content/actions-access-control.mdx +226 -0
  145. package/docs/content/actions-advanced.mdx +152 -0
  146. package/docs/content/actions-defining.mdx +275 -0
  147. package/docs/content/actions-other-surfaces.mdx +167 -0
  148. package/docs/content/actions-overview.mdx +214 -0
  149. package/docs/content/actions-run-context.mdx +180 -0
  150. package/docs/content/agent-surfaces.mdx +1 -1
  151. package/docs/content/agent-teams.mdx +1 -1
  152. package/docs/content/agent-web-surfaces.mdx +1 -1
  153. package/docs/content/audit-log.mdx +1 -1
  154. package/docs/content/automation-connectors.mdx +1 -1
  155. package/docs/content/automations.mdx +1 -1
  156. package/docs/content/blueprint-installer.mdx +1 -1
  157. package/docs/content/cli-adapters.mdx +1 -1
  158. package/docs/content/client-agent-chat.mdx +1 -1
  159. package/docs/content/client-data.mdx +2 -2
  160. package/docs/content/client-overview.mdx +2 -2
  161. package/docs/content/components.mdx +1 -1
  162. package/docs/content/cross-app-sso.mdx +24 -17
  163. package/docs/content/data-programs.mdx +2 -2
  164. package/docs/content/database.mdx +1 -1
  165. package/docs/content/deployment.mdx +1 -1
  166. package/docs/content/docs-components.mdx +14 -3
  167. package/docs/content/drop-in-agent.mdx +2 -2
  168. package/docs/content/durable-resume.mdx +1 -1
  169. package/docs/content/evals.mdx +1 -1
  170. package/docs/content/extensions.mdx +1 -1
  171. package/docs/content/external-agents-catalog.mdx +2 -2
  172. package/docs/content/external-agents.mdx +1 -1
  173. package/docs/content/generative-ui.mdx +1 -1
  174. package/docs/content/getting-started.mdx +1 -1
  175. package/docs/content/http-api.mdx +4 -4
  176. package/docs/content/human-approval.mdx +1 -1
  177. package/docs/content/key-concepts.mdx +1 -1
  178. package/docs/content/mcp-apps.mdx +1 -1
  179. package/docs/content/mcp-clients.mdx +1 -1
  180. package/docs/content/mcp-protocol.mdx +1 -1
  181. package/docs/content/native-chat-ui.mdx +1 -1
  182. package/docs/content/observability.mdx +1 -1
  183. package/docs/content/organizations-teams-permissions.mdx +1 -1
  184. package/docs/content/processors.mdx +1 -1
  185. package/docs/content/pure-agent-apps.mdx +1 -1
  186. package/docs/content/recurring-jobs.mdx +1 -1
  187. package/docs/content/server-database.mdx +1 -1
  188. package/docs/content/server-overview.mdx +3 -3
  189. package/docs/content/server-routes.mdx +2 -2
  190. package/docs/content/template-analytics-developers.mdx +1 -1
  191. package/docs/content/template-assets-developers.mdx +1 -1
  192. package/docs/content/template-brain-developers.mdx +1 -1
  193. package/docs/content/template-calendar-developers.mdx +1 -1
  194. package/docs/content/template-chat-first-edits.mdx +1 -1
  195. package/docs/content/template-chat.mdx +1 -1
  196. package/docs/content/template-content-developers.mdx +1 -1
  197. package/docs/content/template-forms-developers.mdx +1 -1
  198. package/docs/content/template-forms.mdx +1 -1
  199. package/docs/content/template-mail-developers.mdx +2 -2
  200. package/docs/content/toolkit-org-team.mdx +1 -1
  201. package/docs/content/tracking.mdx +1 -1
  202. package/docs/content/what-is-agent-native.mdx +1 -1
  203. package/package.json +2 -2
  204. package/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  205. package/src/templates/chat/.agents/skills/sharing/SKILL.md +21 -0
  206. package/src/templates/default/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  207. package/src/templates/default/.agents/skills/sharing/SKILL.md +21 -0
  208. package/src/templates/headless/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  209. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +5 -0
  210. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +21 -0
  211. package/docs/content/actions.mdx +0 -750
@@ -1,3 +1,24 @@
1
1
  export type ThemePreference = "light" | "dark" | "system";
2
+ export type ResolvedTheme = "light" | "dark";
3
+ export declare const EMBEDDED_THEME_UPDATE_MESSAGE = "agent-native-theme-update";
4
+ export declare const EMBEDDED_THEME_CHANGE_EVENT = "agent-native:theme-change";
5
+ export interface EmbeddedThemeUpdate {
6
+ type: typeof EMBEDDED_THEME_UPDATE_MESSAGE;
7
+ theme?: ResolvedTheme;
8
+ isDark?: boolean;
9
+ vars?: Record<string, string>;
10
+ }
11
+ export interface NormalizedEmbeddedThemeUpdate {
12
+ theme: ResolvedTheme;
13
+ vars?: Record<string, string>;
14
+ }
15
+ /**
16
+ * Accepts both the current `theme` field and the legacy `isDark` field used by
17
+ * extension iframes. Unknown messages and untrusted CSS variable names fail
18
+ * closed so a cross-window event cannot become an arbitrary style sink.
19
+ */
20
+ export declare function parseEmbeddedThemeUpdate(value: unknown): NormalizedEmbeddedThemeUpdate | null;
21
+ export declare function buildEmbeddedThemeUpdate(theme: ResolvedTheme, vars?: Record<string, string>): EmbeddedThemeUpdate;
22
+ export declare function applyEmbeddedThemeUpdate(root: HTMLElement, update: NormalizedEmbeddedThemeUpdate): void;
2
23
  export declare function getThemeInitScript(defaultTheme?: ThemePreference, enableSystem?: boolean): string;
3
24
  export declare const themeInitScript: string;
@@ -1,4 +1,64 @@
1
+ import { THEME_VAR_NAMES } from "../extensions/theme.js";
1
2
  import { getViteDevRecoveryScript, shouldInlineViteDevRecoveryScript, } from "./vite-dev-recovery-script.js";
3
+ export const EMBEDDED_THEME_UPDATE_MESSAGE = "agent-native-theme-update";
4
+ export const EMBEDDED_THEME_CHANGE_EVENT = "agent-native:theme-change";
5
+ function isRecord(value) {
6
+ return typeof value === "object" && value !== null;
7
+ }
8
+ function readThemeVars(value) {
9
+ if (!isRecord(value))
10
+ return undefined;
11
+ const vars = {};
12
+ for (const [name, rawValue] of Object.entries(value)) {
13
+ if (!THEME_VAR_NAMES.some((candidate) => candidate === name))
14
+ continue;
15
+ if (typeof rawValue === "string")
16
+ vars[name] = rawValue;
17
+ }
18
+ return Object.keys(vars).length > 0 ? vars : undefined;
19
+ }
20
+ /**
21
+ * Accepts both the current `theme` field and the legacy `isDark` field used by
22
+ * extension iframes. Unknown messages and untrusted CSS variable names fail
23
+ * closed so a cross-window event cannot become an arbitrary style sink.
24
+ */
25
+ export function parseEmbeddedThemeUpdate(value) {
26
+ if (!isRecord(value))
27
+ return null;
28
+ if (value.type !== EMBEDDED_THEME_UPDATE_MESSAGE &&
29
+ value.type !== EMBEDDED_THEME_CHANGE_EVENT) {
30
+ return null;
31
+ }
32
+ const theme = value.theme === "light" || value.theme === "dark"
33
+ ? value.theme
34
+ : typeof value.isDark === "boolean"
35
+ ? value.isDark
36
+ ? "dark"
37
+ : "light"
38
+ : null;
39
+ if (!theme)
40
+ return null;
41
+ const vars = readThemeVars(value.vars);
42
+ return vars ? { theme, vars } : { theme };
43
+ }
44
+ export function buildEmbeddedThemeUpdate(theme, vars) {
45
+ return {
46
+ type: EMBEDDED_THEME_UPDATE_MESSAGE,
47
+ theme,
48
+ isDark: theme === "dark",
49
+ ...(vars ? { vars } : {}),
50
+ };
51
+ }
52
+ export function applyEmbeddedThemeUpdate(root, update) {
53
+ const isDark = update.theme === "dark";
54
+ root.classList.toggle("dark", isDark);
55
+ root.classList.toggle("light", !isDark);
56
+ root.setAttribute("data-theme", update.theme);
57
+ root.style.colorScheme = update.theme;
58
+ for (const [name, value] of Object.entries(update.vars ?? {})) {
59
+ root.style.setProperty(name, value);
60
+ }
61
+ }
2
62
  function normalizeDefaultTheme(theme) {
3
63
  if (theme === "light" || theme === "dark" || theme === "system") {
4
64
  return theme;
@@ -13,7 +13,7 @@ export { ClientOnly } from "../ClientOnly.js";
13
13
  export { DefaultSpinner } from "../DefaultSpinner.js";
14
14
  export { RuntimeConfigNotice } from "../RuntimeConfigNotice.js";
15
15
  export { RouteTransitionIndicator, ROUTE_TRANSITION_INDICATOR_DELAY_MS, } from "../RouteTransitionIndicator.js";
16
- export { getThemeInitScript, themeInitScript, type ThemePreference, } from "../theme.js";
16
+ export { applyEmbeddedThemeUpdate, buildEmbeddedThemeUpdate, EMBEDDED_THEME_CHANGE_EVENT, EMBEDDED_THEME_UPDATE_MESSAGE, getThemeInitScript, parseEmbeddedThemeUpdate, themeInitScript, type EmbeddedThemeUpdate, type NormalizedEmbeddedThemeUpdate, type ResolvedTheme, type ThemePreference, } from "../theme.js";
17
17
  export { APPEARANCE_PRESETS, applyAppearance, getStoredAppearance, useAppearance, useAppearanceSync, type AppearancePresetId, } from "../appearance.js";
18
18
  export { AppearancePicker, type AppearancePickerProps, } from "../AppearancePicker.js";
19
19
  export { AgentNativeIcon } from "../components/icons/AgentNativeIcon.js";
@@ -13,7 +13,7 @@ export { ClientOnly } from "../ClientOnly.js";
13
13
  export { DefaultSpinner } from "../DefaultSpinner.js";
14
14
  export { RuntimeConfigNotice } from "../RuntimeConfigNotice.js";
15
15
  export { RouteTransitionIndicator, ROUTE_TRANSITION_INDICATOR_DELAY_MS, } from "../RouteTransitionIndicator.js";
16
- export { getThemeInitScript, themeInitScript, } from "../theme.js";
16
+ export { applyEmbeddedThemeUpdate, buildEmbeddedThemeUpdate, EMBEDDED_THEME_CHANGE_EVENT, EMBEDDED_THEME_UPDATE_MESSAGE, getThemeInitScript, parseEmbeddedThemeUpdate, themeInitScript, } from "../theme.js";
17
17
  export { APPEARANCE_PRESETS, applyAppearance, getStoredAppearance, useAppearance, useAppearanceSync, } from "../appearance.js";
18
18
  export { AppearancePicker, } from "../AppearancePicker.js";
19
19
  export { AgentNativeIcon } from "../components/icons/AgentNativeIcon.js";
@@ -1,6 +1,7 @@
1
1
  import { useCallback, useEffect, useState } from "react";
2
2
  import { setSentryUser, trackSessionStatus } from "./analytics.js";
3
3
  import { fetchAuthSessionStatus, invalidateClientStatusRequest, } from "./client-status-requests.js";
4
+ import { getFrameOrigin, getFramePostMessageTargetOrigin } from "./frame.js";
4
5
  const SESSION_CACHE_TTL_MS = 30_000;
5
6
  const SESSION_RETRY_DELAY_MS = 1_000;
6
7
  const SESSION_MAX_ATTEMPTS = 4;
@@ -34,6 +35,27 @@ function publishSessionIdentity(session) {
34
35
  }
35
36
  trackSessionStatus(Boolean(session));
36
37
  }
38
+ function notifyParentAuthState(status) {
39
+ if (typeof window === "undefined" || window.parent === window)
40
+ return;
41
+ // The frame-origin handshake validates the direct parent before this state
42
+ // crosses the frame boundary. Opaque sandbox frames still require "*".
43
+ if (!getFrameOrigin())
44
+ return;
45
+ const targetOrigin = getFramePostMessageTargetOrigin();
46
+ if (!targetOrigin)
47
+ return;
48
+ try {
49
+ window.parent.postMessage({
50
+ type: "agentNative.authState",
51
+ data: { status },
52
+ }, targetOrigin);
53
+ // coercion-ok: Posting auth state is best-effort when an embedded host is being detached.
54
+ }
55
+ catch {
56
+ // A host may revoke the frame while the session request is settling.
57
+ }
58
+ }
37
59
  function invalidateSessionCache() {
38
60
  sessionGeneration += 1;
39
61
  cachedSession = undefined;
@@ -165,6 +187,7 @@ export function useSession() {
165
187
  setSession(resolved);
166
188
  setError(null);
167
189
  setStatus(resolved ? "authenticated" : "unauthenticated");
190
+ notifyParentAuthState(resolved ? "authenticated" : "unauthenticated");
168
191
  };
169
192
  void resolveSession();
170
193
  return () => {
@@ -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
  }>>;
@@ -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;
@@ -524,7 +524,7 @@ export declare function createDashboardStorageSchema(options?: DashboardStorageS
524
524
  data: string;
525
525
  driverParam: string;
526
526
  notNull: true;
527
- hasDefault: false;
527
+ hasDefault: true;
528
528
  isPrimaryKey: false;
529
529
  isAutoincrement: false;
530
530
  hasRuntimeDefault: false;
@@ -471,7 +471,7 @@ export declare const dataProgramShares: import("drizzle-orm/sqlite-core").SQLite
471
471
  data: string;
472
472
  driverParam: string;
473
473
  notNull: true;
474
- hasDefault: false;
474
+ hasDefault: true;
475
475
  isPrimaryKey: false;
476
476
  isAutoincrement: false;
477
477
  hasRuntimeDefault: false;
@@ -376,7 +376,7 @@ export declare const extensionShares: import("drizzle-orm/sqlite-core").SQLiteTa
376
376
  data: string;
377
377
  driverParam: string;
378
378
  notNull: true;
379
- hasDefault: false;
379
+ hasDefault: true;
380
380
  isPrimaryKey: false;
381
381
  isAutoincrement: false;
382
382
  hasRuntimeDefault: false;
@@ -438,6 +438,12 @@ const messages = {
438
438
  "share.advancedDescription": "تحكّم في كيفية ظهور وصول المؤسسة في نتائج البحث.",
439
439
  "share.copied": "تم النسخ",
440
440
  "share.copy": "نسخ",
441
+ "share.shareWithAgents": "مشاركة مع الوكلاء",
442
+ "share.agentContext": "رابط سياق الوكيل",
443
+ "share.agentContextDescription": "سياق للقراءة فقط لوكيل خارجي.",
444
+ "share.preparingAgentLink": "جارٍ إعداد رابط الوكيل...",
445
+ "share.agentLinkUnavailable": "تعذر إنشاء رابط الوكيل.",
446
+ "share.retryAgentLink": "إعادة المحاولة",
441
447
  "share.editor": "محرر",
442
448
  "share.editorDescription": "يمكنه التعديل",
443
449
  "share.generalAccess": "الوصول العام",
@@ -473,6 +473,12 @@ const messages = {
473
473
  "share.advancedDescription": "Lege fest, wie der Organisationszugriff in der Suche angezeigt wird.",
474
474
  "share.copied": "Kopiert",
475
475
  "share.copy": "Kopieren",
476
+ "share.shareWithAgents": "Mit Agenten teilen",
477
+ "share.agentContext": "Agenten-Kontextlink",
478
+ "share.agentContextDescription": "Schreibgeschützter Kontext für einen externen Agenten.",
479
+ "share.preparingAgentLink": "Agentenlink wird vorbereitet...",
480
+ "share.agentLinkUnavailable": "Der Agentenlink konnte nicht erstellt werden.",
481
+ "share.retryAgentLink": "Erneut versuchen",
476
482
  "share.editor": "Editor",
477
483
  "share.editorDescription": "Kann bearbeiten",
478
484
  "share.generalAccess": "Allgemeiner Zugriff",
@@ -422,6 +422,12 @@ declare const messages: {
422
422
  readonly "share.advancedDescription": "Control how organization access appears in search.";
423
423
  readonly "share.copied": "Copied";
424
424
  readonly "share.copy": "Copy";
425
+ readonly "share.shareWithAgents": "Share with agents";
426
+ readonly "share.agentContext": "Agent context link";
427
+ readonly "share.agentContextDescription": "Read-only context for an external agent.";
428
+ readonly "share.preparingAgentLink": "Preparing agent link...";
429
+ readonly "share.agentLinkUnavailable": "Couldn't create the agent link.";
430
+ readonly "share.retryAgentLink": "Retry";
425
431
  readonly "share.editor": "Editor";
426
432
  readonly "share.editorDescription": "Can edit";
427
433
  readonly "share.generalAccess": "General access";
@@ -422,6 +422,12 @@ const messages = {
422
422
  "share.advancedDescription": "Control how organization access appears in search.",
423
423
  "share.copied": "Copied",
424
424
  "share.copy": "Copy",
425
+ "share.shareWithAgents": "Share with agents",
426
+ "share.agentContext": "Agent context link",
427
+ "share.agentContextDescription": "Read-only context for an external agent.",
428
+ "share.preparingAgentLink": "Preparing agent link...",
429
+ "share.agentLinkUnavailable": "Couldn't create the agent link.",
430
+ "share.retryAgentLink": "Retry",
425
431
  "share.editor": "Editor",
426
432
  "share.editorDescription": "Can edit",
427
433
  "share.generalAccess": "General access",
@@ -480,6 +480,12 @@ const messages = {
480
480
  "share.advancedDescription": "Controla cómo aparece el acceso de la organización en la búsqueda.",
481
481
  "share.copied": "Copiado",
482
482
  "share.copy": "Copiar",
483
+ "share.shareWithAgents": "Compartir con agentes",
484
+ "share.agentContext": "Enlace de contexto del agente",
485
+ "share.agentContextDescription": "Contexto de solo lectura para un agente externo.",
486
+ "share.preparingAgentLink": "Preparando el enlace del agente...",
487
+ "share.agentLinkUnavailable": "No se pudo crear el enlace del agente.",
488
+ "share.retryAgentLink": "Reintentar",
483
489
  "share.editor": "Editor",
484
490
  "share.editorDescription": "Puede editar",
485
491
  "share.generalAccess": "Acceso general",
@@ -480,6 +480,12 @@ const messages = {
480
480
  "share.advancedDescription": "Contrôlez la façon dont l’accès à l’organisation apparaît dans la recherche.",
481
481
  "share.copied": "Copié",
482
482
  "share.copy": "Copier",
483
+ "share.shareWithAgents": "Partager avec des agents",
484
+ "share.agentContext": "Lien de contexte de l'agent",
485
+ "share.agentContextDescription": "Contexte en lecture seule pour un agent externe.",
486
+ "share.preparingAgentLink": "Préparation du lien de l'agent...",
487
+ "share.agentLinkUnavailable": "Impossible de créer le lien de l'agent.",
488
+ "share.retryAgentLink": "Réessayer",
483
489
  "share.editor": "Éditeur",
484
490
  "share.editorDescription": "Peut modifier",
485
491
  "share.generalAccess": "Accès général",
@@ -422,6 +422,12 @@ const messages = {
422
422
  "share.advancedDescription": "नियंत्रित करें कि संगठन का एक्सेस खोज में कैसे दिखाई दे।",
423
423
  "share.copied": "कॉपी किया गया",
424
424
  "share.copy": "कॉपी करें",
425
+ "share.shareWithAgents": "एजेंट्स के साथ साझा करें",
426
+ "share.agentContext": "एजेंट संदर्भ लिंक",
427
+ "share.agentContextDescription": "बाहरी एजेंट के लिए केवल-पठन संदर्भ।",
428
+ "share.preparingAgentLink": "एजेंट लिंक तैयार हो रहा है...",
429
+ "share.agentLinkUnavailable": "एजेंट लिंक नहीं बनाया जा सका।",
430
+ "share.retryAgentLink": "पुनः प्रयास करें",
425
431
  "share.editor": "संपादक",
426
432
  "share.editorDescription": "संपादित कर सकता है",
427
433
  "share.generalAccess": "सामान्य एक्सेस",
@@ -418,6 +418,12 @@ const messages = {
418
418
  "share.advancedDescription": "組織のアクセス権を検索結果に表示する方法を設定します。",
419
419
  "share.copied": "コピーしました",
420
420
  "share.copy": "コピー",
421
+ "share.shareWithAgents": "エージェントと共有",
422
+ "share.agentContext": "エージェントコンテキストリンク",
423
+ "share.agentContextDescription": "外部エージェント用の読み取り専用コンテキスト。",
424
+ "share.preparingAgentLink": "エージェントリンクを準備中...",
425
+ "share.agentLinkUnavailable": "エージェントリンクを作成できませんでした。",
426
+ "share.retryAgentLink": "再試行",
421
427
  "share.editor": "編集者",
422
428
  "share.editorDescription": "編集可能",
423
429
  "share.generalAccess": "一般的なアクセス",
@@ -418,6 +418,12 @@ const messages = {
418
418
  "share.advancedDescription": "조직 접근 권한이 검색 결과에 표시되는 방식을 제어합니다.",
419
419
  "share.copied": "복사됨",
420
420
  "share.copy": "복사",
421
+ "share.shareWithAgents": "에이전트와 공유",
422
+ "share.agentContext": "에이전트 컨텍스트 링크",
423
+ "share.agentContextDescription": "외부 에이전트를 위한 읽기 전용 컨텍스트입니다.",
424
+ "share.preparingAgentLink": "에이전트 링크 준비 중...",
425
+ "share.agentLinkUnavailable": "에이전트 링크를 만들 수 없습니다.",
426
+ "share.retryAgentLink": "다시 시도",
421
427
  "share.editor": "편집자",
422
428
  "share.editorDescription": "편집 가능",
423
429
  "share.generalAccess": "일반 접근 권한",
@@ -480,6 +480,12 @@ const messages = {
480
480
  "share.advancedDescription": "Controle como o acesso à organização aparece na pesquisa.",
481
481
  "share.copied": "Copiado",
482
482
  "share.copy": "Copiar",
483
+ "share.shareWithAgents": "Compartilhar com agentes",
484
+ "share.agentContext": "Link de contexto do agente",
485
+ "share.agentContextDescription": "Contexto somente leitura para um agente externo.",
486
+ "share.preparingAgentLink": "Preparando link do agente...",
487
+ "share.agentLinkUnavailable": "Não foi possível criar o link do agente.",
488
+ "share.retryAgentLink": "Tentar novamente",
483
489
  "share.editor": "Editor",
484
490
  "share.editorDescription": "Pode editar",
485
491
  "share.generalAccess": "Acesso geral",
@@ -418,6 +418,12 @@ const messages = {
418
418
  "share.advancedDescription": "控制组织访问权限在搜索结果中的显示方式。",
419
419
  "share.copied": "已复制",
420
420
  "share.copy": "复制",
421
+ "share.shareWithAgents": "与代理共享",
422
+ "share.agentContext": "代理上下文链接",
423
+ "share.agentContextDescription": "供外部代理使用的只读上下文。",
424
+ "share.preparingAgentLink": "正在准备代理链接...",
425
+ "share.agentLinkUnavailable": "无法创建代理链接。",
426
+ "share.retryAgentLink": "重试",
421
427
  "share.editor": "编辑者",
422
428
  "share.editorDescription": "可以编辑",
423
429
  "share.generalAccess": "常规访问权限",
@@ -418,6 +418,12 @@ const messages = {
418
418
  "share.advancedDescription": "控制組織存取權在搜尋結果中的顯示方式。",
419
419
  "share.copied": "已複製",
420
420
  "share.copy": "複製",
421
+ "share.shareWithAgents": "與代理分享",
422
+ "share.agentContext": "代理上下文連結",
423
+ "share.agentContextDescription": "供外部代理使用的唯讀上下文。",
424
+ "share.preparingAgentLink": "正在準備代理連結...",
425
+ "share.agentLinkUnavailable": "無法建立代理連結。",
426
+ "share.retryAgentLink": "重試",
421
427
  "share.editor": "編輯者",
422
428
  "share.editorDescription": "可以編輯",
423
429
  "share.generalAccess": "一般存取權",
@@ -424,6 +424,12 @@ export declare const englishAgentChatMessages: {
424
424
  readonly "share.advancedDescription": "Control how organization access appears in search.";
425
425
  readonly "share.copied": "Copied";
426
426
  readonly "share.copy": "Copy";
427
+ readonly "share.shareWithAgents": "Share with agents";
428
+ readonly "share.agentContext": "Agent context link";
429
+ readonly "share.agentContextDescription": "Read-only context for an external agent.";
430
+ readonly "share.preparingAgentLink": "Preparing agent link...";
431
+ readonly "share.agentLinkUnavailable": "Couldn't create the agent link.";
432
+ readonly "share.retryAgentLink": "Retry";
427
433
  readonly "share.editor": "Editor";
428
434
  readonly "share.editorDescription": "Can edit";
429
435
  readonly "share.generalAccess": "General access";
@@ -693,6 +693,7 @@ declare const messages: {
693
693
  embedUrl: string;
694
694
  embedCode: string;
695
695
  copy: string;
696
+ copied: string;
696
697
  role: string;
697
698
  private: string;
698
699
  privateDescription: string;
@@ -699,6 +699,7 @@ const messages = {
699
699
  embedUrl: "Embed URL",
700
700
  embedCode: "Embed code",
701
701
  copy: "Copy",
702
+ copied: "Copied",
702
703
  role: "Role",
703
704
  private: "Private",
704
705
  privateDescription: "Only people with access can view",
@@ -11,14 +11,14 @@
11
11
  * DELETE /_agent-native/notifications/:id — delete
12
12
  */
13
13
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
14
- error?: undefined;
15
14
  count: number;
16
15
  updated?: undefined;
16
+ error?: undefined;
17
17
  ok?: undefined;
18
18
  } | {
19
- error?: undefined;
20
19
  count?: undefined;
21
20
  updated: number;
21
+ error?: undefined;
22
22
  ok?: undefined;
23
23
  } | {
24
24
  count?: undefined;
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
26
26
  error: string;
27
27
  ok?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  count?: undefined;
31
30
  updated?: undefined;
31
+ error?: undefined;
32
32
  ok: boolean;
33
33
  }>>;
@@ -15,6 +15,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
15
15
  error: string;
16
16
  ok?: undefined;
17
17
  } | {
18
- error?: undefined;
19
18
  ok: boolean;
19
+ error?: undefined;
20
20
  }>>;
@@ -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
- provider?: undefined;
79
+ message?: undefined;
80
+ deleted?: undefined;
81
81
  providers: {
82
82
  id: string;
83
83
  label: string;
@@ -88,45 +88,45 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
88
88
  updatedAt: number;
89
89
  }[];
90
90
  count: number;
91
+ provider?: undefined;
91
92
  found?: undefined;
92
93
  registered?: undefined;
93
94
  label?: undefined;
94
- message?: undefined;
95
95
  } | {
96
- deleted?: undefined;
97
96
  id?: undefined;
98
- providers?: undefined;
97
+ message?: undefined;
99
98
  count?: undefined;
99
+ deleted?: undefined;
100
+ providers?: 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
+ message?: undefined;
107
+ count?: undefined;
106
108
  deleted?: undefined;
107
- provider?: undefined;
108
109
  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
- provider?: undefined;
117
- providers?: undefined;
116
+ message?: undefined;
118
117
  count?: undefined;
118
+ providers?: undefined;
119
+ provider?: undefined;
119
120
  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;
126
127
  deleted?: undefined;
127
- provider?: undefined;
128
128
  providers?: undefined;
129
- count?: undefined;
129
+ provider?: undefined;
130
130
  found?: undefined;
131
131
  registered: boolean;
132
132
  id: string;
@@ -311,9 +311,9 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
311
311
  notes?: string | undefined;
312
312
  scope?: "org" | "user" | undefined;
313
313
  }, {
314
- id?: undefined;
315
- message?: undefined;
316
314
  deleted?: undefined;
315
+ id?: undefined;
316
+ provider?: undefined;
317
317
  providers: {
318
318
  id: string;
319
319
  label: string;
@@ -324,45 +324,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
324
324
  updatedAt: number;
325
325
  }[];
326
326
  count: number;
327
- provider?: undefined;
328
327
  found?: undefined;
329
328
  registered?: undefined;
330
329
  label?: undefined;
331
- } | {
332
- id?: undefined;
333
330
  message?: undefined;
334
- count?: undefined;
331
+ } | {
335
332
  deleted?: undefined;
333
+ id?: undefined;
336
334
  providers?: undefined;
335
+ count?: undefined;
337
336
  found: boolean;
338
337
  provider: import("../custom-registry.js").CustomProviderConfig;
339
338
  registered?: undefined;
340
339
  label?: undefined;
341
- } | {
342
340
  message?: undefined;
343
- count?: undefined;
341
+ } | {
344
342
  deleted?: undefined;
345
- providers?: undefined;
346
343
  provider?: undefined;
344
+ providers?: undefined;
345
+ count?: undefined;
347
346
  found: boolean;
348
347
  id: string;
349
348
  registered?: undefined;
350
349
  label?: undefined;
351
- } | {
352
350
  message?: undefined;
353
- count?: undefined;
354
- providers?: undefined;
351
+ } | {
355
352
  provider?: undefined;
353
+ providers?: undefined;
354
+ count?: undefined;
356
355
  found?: undefined;
357
356
  deleted: boolean;
358
357
  id: string;
359
358
  registered?: undefined;
360
359
  label?: undefined;
360
+ message?: undefined;
361
361
  } | {
362
- count?: undefined;
363
362
  deleted?: undefined;
364
- providers?: undefined;
365
363
  provider?: undefined;
364
+ providers?: undefined;
365
+ count?: undefined;
366
366
  found?: undefined;
367
367
  registered: boolean;
368
368
  id: string;
@@ -65,7 +65,7 @@ import { getAllowedCorsOrigin, readCorsAllowedOrigins, } from "./cors-origins.js
65
65
  import { readDesktopSso, writeDesktopSso, clearDesktopSso, } from "./desktop-sso.js";
66
66
  import { resolveGoogleSignInCredentials } from "./google-oauth-credentials.js";
67
67
  import { isElectron as isElectronRequest, getAppBasePath, getAppUrl, getOrigin, encodeOAuthState, decodeOAuthState, createOAuthSession, oauthCallbackResponse, oauthDesktopExchangePage, oauthErrorPage, resolveOAuthRedirectUri, isAllowedOAuthRedirectUri, } from "./google-oauth.js";
68
- import { isCanonicalAgentNativeAppRequest, isDesktopSsoCanaryUserAgent, isIdentitySsoEnabled, } from "./identity-sso-store.js";
68
+ import { isCanonicalAgentNativeAppRequest, isCanonicalIdentitySsoClientRequest, isDesktopSsoCanaryUserAgent, isIdentitySsoExplicitlyEnabled, } from "./identity-sso-store.js";
69
69
  import { ensureCanonicalUserForLegacySession } from "./legacy-auth-migration.js";
70
70
  import { encodeMagicLinkSignupAttribution, MAGIC_LINK_ATTRIBUTION_PARAM, } from "./magic-link-attribution.js";
71
71
  import { safeOAuthReturnUrl } from "./oauth-return-url.js";
@@ -1709,15 +1709,18 @@ function createAuthGuardFn() {
1709
1709
  // 401-for-/_agent-native/*: they resolve / mint the browser session
1710
1710
  // themselves and verify a signature-bound, single-use, CSRF-stated
1711
1711
  // hub token — not a cookie. The handler fails closed with 404 unless
1712
- // direct web SSO is configured or this is the packaged SSO Canary on a
1713
- // canonical app origin. Keeping the bypass exact lets that request-scoped
1714
- // decision happen without exposing any other identity subpath.
1712
+ // direct web SSO is configured or the request is from an exact canonical
1713
+ // hosted app origin. Keeping the bypass exact avoids exposing any other
1714
+ // identity subpath.
1715
1715
  const isIdentitySsoEntryPath = p === "/_agent-native/identity/login" ||
1716
1716
  p === "/_agent-native/identity/callback";
1717
1717
  const isDesktopCanaryIdentityRequest = isDesktopSsoCanaryUserAgent(getHeader(event, "user-agent")) &&
1718
1718
  isCanonicalAgentNativeAppRequest(getHeader(event, "host"), getHeader(event, "x-forwarded-proto"));
1719
+ const isCanonicalHostedIdentityRequest = isCanonicalIdentitySsoClientRequest(getHeader(event, "host"), getHeader(event, "x-forwarded-proto"));
1719
1720
  if (isIdentitySsoEntryPath &&
1720
- (isIdentitySsoEnabled() || isDesktopCanaryIdentityRequest)) {
1721
+ (isIdentitySsoExplicitlyEnabled() ||
1722
+ isDesktopCanaryIdentityRequest ||
1723
+ isCanonicalHostedIdentityRequest)) {
1721
1724
  return;
1722
1725
  }
1723
1726
  // Internal processor endpoint for the A2A async-mode fanout. Mirrors the