@agent-native/core 0.161.12 → 0.161.16

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 (47) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/actions/clear-selected-dashboard-object.ts +71 -0
  3. package/corpus/templates/analytics/actions/view-screen.ts +68 -4
  4. package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +41 -66
  5. package/corpus/templates/analytics/app/lib/selected-object.ts +53 -0
  6. package/corpus/templates/analytics/app/pages/Ask.tsx +21 -0
  7. package/corpus/templates/analytics/changelog/2026-08-18-ask-no-stale-dashboard-context.md +6 -0
  8. package/corpus/templates/calendar/app/root.tsx +12 -4
  9. package/corpus/templates/calendar/changelog/2026-08-18-calendar-stays-responsive-in-the-desktop-app-without-focus-t.md +6 -0
  10. package/corpus/templates/clips/app/components/library/recording-card.tsx +19 -3
  11. package/corpus/templates/clips/app/hooks/use-recording-leave-guard.ts +70 -0
  12. package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
  13. package/corpus/templates/clips/app/routes/record.tsx +42 -0
  14. package/corpus/templates/clips/changelog/2026-08-18-deleting-a-recording-no-longer-freezes-clips.md +6 -0
  15. package/corpus/templates/clips/desktop/src/app.tsx +9 -10
  16. package/corpus/templates/clips/desktop/src/lib/recorder.ts +4 -3
  17. package/corpus/templates/clips/desktop/src/lib/recording-start-guard.ts +26 -0
  18. package/corpus/templates/dispatch/app/chat-first-pages.ts +40 -40
  19. package/corpus/templates/dispatch/app/i18n-data.ts +5 -5
  20. package/corpus/templates/factory/AGENTS.md +30 -29
  21. package/corpus/templates/slides/app/root.tsx +21 -0
  22. package/corpus/templates/slides/server/handlers/decks.ts +7 -3
  23. package/corpus/templates/slides/server/handlers/request-auth-context.ts +58 -1
  24. package/corpus/templates/slides/server/handlers/share.ts +7 -2
  25. package/corpus/templates/slides/server/handlers/uploads.ts +7 -2
  26. package/dist/action.js +49 -0
  27. package/dist/agent/engine/translate-anthropic.js +19 -1
  28. package/dist/agent/engine/types.d.ts +7 -0
  29. package/dist/agent/production-agent.js +32 -0
  30. package/dist/agent/thread-data-builder.d.ts +16 -4
  31. package/dist/agent/thread-data-builder.js +159 -5
  32. package/dist/client/AssistantChat.js +1 -0
  33. package/dist/client/agent-chat-adapter.js +13 -1
  34. package/dist/client/chat-first/app-open-actions.js +1 -1
  35. package/dist/client/chat-first/copy.js +2 -2
  36. package/dist/client/mcp-apps/McpAppRenderer.js +7 -2
  37. package/dist/collab/struct-routes.d.ts +1 -1
  38. package/dist/mcp/embed-app.js +71 -2
  39. package/dist/notifications/routes.d.ts +1 -1
  40. package/dist/observability/routes.d.ts +2 -2
  41. package/dist/secrets/routes.d.ts +6 -6
  42. package/dist/server/agent-teams.js +3 -1
  43. package/dist/server/cors-origins.js +24 -1
  44. package/dist/server/realtime-token.d.ts +1 -1
  45. package/dist/styles/agent-conversation.css +25 -4
  46. package/dist/transcription/builder-transcription.js +12 -1
  47. package/package.json +1 -1
@@ -112,6 +112,7 @@ import {
112
112
  copyRecordingShareLink,
113
113
  recordingShareUrl,
114
114
  } from "./lib/recording-link";
115
+ import { boundedCleanup } from "./lib/recording-start-guard";
115
116
  import { REWIND_AGENT_PROMPT } from "./lib/rewind-agent-prompt";
116
117
  import { getRewindStatusPresentation } from "./lib/rewind-status";
117
118
  import {
@@ -3218,16 +3219,14 @@ export function App() {
3218
3219
  bubbleStreamTransferredToRecorder.current = false;
3219
3220
  recordingFlowGateRef.current = false;
3220
3221
  setRecordingFlowActive(false);
3221
- try {
3222
- await invoke("set_recording_state", { active: false });
3223
- } catch {
3224
- // ignore — best-effort
3225
- }
3226
- try {
3227
- await invoke("show_popover");
3228
- } catch {
3229
- // ignore — best-effort
3230
- }
3222
+ // Bounded, not just best-effort: a plain unbounded await here would
3223
+ // let a stuck native command (e.g. a ScreenCaptureKit handshake that
3224
+ // never returns) turn this "always recovers" block into another
3225
+ // permanent hang on top of the one that just failed — exactly the
3226
+ // "stuck on Preparing…, have to restart" symptom this exists to
3227
+ // prevent.
3228
+ await boundedCleanup(invoke("set_recording_state", { active: false }));
3229
+ await boundedCleanup(invoke("show_popover"));
3231
3230
  }
3232
3231
  }
3233
3232
 
@@ -84,6 +84,7 @@ import {
84
84
  type NativeRecordingRequestOptions,
85
85
  } from "./recording-request";
86
86
  import {
87
+ boundedCleanup,
87
88
  guardRecordingStart,
88
89
  RECORDING_START_TIMEOUT_MS,
89
90
  RecordingStartCancelledError,
@@ -2748,7 +2749,7 @@ async function tryStartRewindFullscreenRecording(
2748
2749
  },
2749
2750
  async countdown() {
2750
2751
  console.log("[rewind-latency] countdown shown after preparation");
2751
- await invoke("hide_preparing").catch(() => {});
2752
+ await boundedCleanup(invoke("hide_preparing"));
2752
2753
  // Overlap whisper startup with the countdown so the capture boundary
2753
2754
  // never waits on it, but have both settled before activation.
2754
2755
  await Promise.all([
@@ -2792,7 +2793,7 @@ async function tryStartRewindFullscreenRecording(
2792
2793
  });
2793
2794
  }
2794
2795
  } catch (err) {
2795
- await invoke("hide_preparing").catch(() => {});
2796
+ await boundedCleanup(invoke("hide_preparing"));
2796
2797
  transcriptionAborted = true;
2797
2798
  // Cast: `transcriptionCapture` is only assigned inside the
2798
2799
  // `startRewindTranscription` closure, which TS's control-flow analysis
@@ -4090,7 +4091,7 @@ export async function startRecording(
4090
4091
  },
4091
4092
  });
4092
4093
  } catch (err) {
4093
- await invoke("hide_recording_chrome").catch(() => {});
4094
+ await boundedCleanup(invoke("hide_recording_chrome"));
4094
4095
  const e = err as { name?: string; message?: string } | null;
4095
4096
  console.error(
4096
4097
  "[clips-recorder] startRecording threw:",
@@ -1,5 +1,12 @@
1
1
  export const RECORDING_START_TIMEOUT_MS = 90_000;
2
2
 
3
+ // Cleanup invokes (closing overlay windows, clearing recording state) are
4
+ // normally instant. This bounds them well above any real duration but far
5
+ // below forever, so a stuck native call (e.g. a ScreenCaptureKit handshake
6
+ // that never returns its completion) can't turn "recovery" into another
7
+ // permanent hang on top of the one the start guard already gave up on.
8
+ export const RECOVERY_INVOKE_TIMEOUT_MS = 5_000;
9
+
3
10
  export class RecordingStartTimeoutError extends Error {
4
11
  constructor(timeoutMs: number) {
5
12
  super(
@@ -82,3 +89,22 @@ export function guardRecordingStart<T>(
82
89
  }, timeoutMs);
83
90
  });
84
91
  }
92
+
93
+ /**
94
+ * Best-effort recovery step that must never block the caller. Recording-start
95
+ * failure paths (and their "always restore the UI" `finally` blocks) await
96
+ * cleanup invokes like `hide_recording_chrome` — if the underlying native
97
+ * command hangs, an unbounded `await ...catch(() => {})` hangs the whole
98
+ * recovery with it, leaving the toolbar/"Preparing…" state stuck until the
99
+ * user restarts the app. Swallows both success and failure; only existence
100
+ * to cap how long a single cleanup step can stall recovery.
101
+ */
102
+ export function boundedCleanup(
103
+ operation: Promise<unknown>,
104
+ timeoutMs = RECOVERY_INVOKE_TIMEOUT_MS,
105
+ ): Promise<void> {
106
+ return guardRecordingStart(operation, { timeoutMs }).then(
107
+ () => undefined,
108
+ () => undefined,
109
+ );
110
+ }
@@ -8,8 +8,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
8
8
  searchAppsPlaceholder: "依名稱或描述搜尋",
9
9
  clearAppSearch: "清除搜尋",
10
10
  noAppsMatch: "沒有符合搜尋條件的應用程式",
11
- pinApp: "釘選 {{name}}",
12
- unpinApp: "取消釘選 {{name}}",
11
+ pinApp: "釘選此應用程式",
12
+ unpinApp: "取消釘選此應用程式",
13
13
  appPinSaveFailed: "無法儲存應用程式釘選。",
14
14
  appPinSavedLocally: "應用程式釘選只儲存在此裝置上。",
15
15
  chatFirstCreateWorkspaceApp: "建立工作區應用程式",
@@ -18,8 +18,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
18
18
  chatFirstNoWorkspaceApps: "尚無工作區應用程式。",
19
19
  chatFirstCreateApp: "建立應用程式",
20
20
  chatFirstRetry: "重試",
21
- chatFirstUnpinApp: "取消釘選 {{name}}",
22
- chatFirstPinApp: "釘選 {{name}}",
21
+ chatFirstUnpinApp: "取消釘選此應用程式",
22
+ chatFirstPinApp: "釘選此應用程式",
23
23
  chatFirstRemovePinned: "從釘選應用程式移除",
24
24
  chatFirstPinTop: "將應用程式釘選至頂端",
25
25
  chatFirstOpenSideSurfaces: "開啟側邊面板",
@@ -85,8 +85,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
85
85
  searchAppsPlaceholder: "按名称或描述搜索",
86
86
  clearAppSearch: "清除搜索",
87
87
  noAppsMatch: "没有匹配搜索的应用",
88
- pinApp: "固定 {{name}}",
89
- unpinApp: "取消固定 {{name}}",
88
+ pinApp: "固定此应用",
89
+ unpinApp: "取消固定此应用",
90
90
  appPinSaveFailed: "无法保存应用固定设置。",
91
91
  appPinSavedLocally: "应用固定设置仅保存在此设备上。",
92
92
  chatFirstCreateWorkspaceApp: "创建工作区应用",
@@ -95,8 +95,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
95
95
  chatFirstNoWorkspaceApps: "尚无工作区应用。",
96
96
  chatFirstCreateApp: "创建应用",
97
97
  chatFirstRetry: "重试",
98
- chatFirstUnpinApp: "取消固定 {{name}}",
99
- chatFirstPinApp: "固定 {{name}}",
98
+ chatFirstUnpinApp: "取消固定此应用",
99
+ chatFirstPinApp: "固定此应用",
100
100
  chatFirstRemovePinned: "从固定应用中移除",
101
101
  chatFirstPinTop: "固定应用到顶部",
102
102
  chatFirstOpenSideSurfaces: "打开侧边面板",
@@ -162,8 +162,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
162
162
  searchAppsPlaceholder: "Buscar por nombre o descripción",
163
163
  clearAppSearch: "Borrar búsqueda",
164
164
  noAppsMatch: "Ninguna app coincide con tu búsqueda",
165
- pinApp: "Fijar {{name}}",
166
- unpinApp: "Desfijar {{name}}",
165
+ pinApp: "Fijar esta app",
166
+ unpinApp: "Desfijar esta app",
167
167
  appPinSaveFailed: "No se pudieron guardar las apps fijadas.",
168
168
  appPinSavedLocally:
169
169
  "Las apps fijadas solo se guardan en este dispositivo.",
@@ -174,8 +174,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
174
174
  chatFirstNoWorkspaceApps: "Aún no hay apps del espacio de trabajo.",
175
175
  chatFirstCreateApp: "Crear app",
176
176
  chatFirstRetry: "Reintentar",
177
- chatFirstUnpinApp: "Quitar fijación a {{name}}",
178
- chatFirstPinApp: "Fijar {{name}}",
177
+ chatFirstUnpinApp: "Quitar fijación a esta app",
178
+ chatFirstPinApp: "Fijar esta app",
179
179
  chatFirstRemovePinned: "Quitar de las apps fijadas",
180
180
  chatFirstPinTop: "Fijar app arriba",
181
181
  chatFirstOpenSideSurfaces: "Abrir paneles laterales",
@@ -248,8 +248,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
248
248
  searchAppsPlaceholder: "Rechercher par nom ou description",
249
249
  clearAppSearch: "Effacer la recherche",
250
250
  noAppsMatch: "Aucune application ne correspond à votre recherche",
251
- pinApp: "Épingler {{name}}",
252
- unpinApp: "Désépingler {{name}}",
251
+ pinApp: "Épingler cette application",
252
+ unpinApp: "Désépingler cette application",
253
253
  appPinSaveFailed: "Impossible d’enregistrer les applications épinglées.",
254
254
  appPinSavedLocally:
255
255
  "Les applications épinglées sont enregistrées uniquement sur cet appareil.",
@@ -261,8 +261,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
261
261
  "Aucune application d’espace de travail pour le moment.",
262
262
  chatFirstCreateApp: "Créer une application",
263
263
  chatFirstRetry: "Réessayer",
264
- chatFirstUnpinApp: "Désépingler {{name}}",
265
- chatFirstPinApp: "Épingler {{name}}",
264
+ chatFirstUnpinApp: "Désépingler cette application",
265
+ chatFirstPinApp: "Épingler cette application",
266
266
  chatFirstRemovePinned: "Retirer des applications épinglées",
267
267
  chatFirstPinTop: "Épingler l’application en haut",
268
268
  chatFirstOpenSideSurfaces: "Ouvrir les panneaux latéraux",
@@ -336,8 +336,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
336
336
  searchAppsPlaceholder: "Nach Name oder Beschreibung suchen",
337
337
  clearAppSearch: "Suche löschen",
338
338
  noAppsMatch: "Keine Apps entsprechen deiner Suche",
339
- pinApp: "{{name}} anheften",
340
- unpinApp: "{{name}} loslösen",
339
+ pinApp: "Diese App anheften",
340
+ unpinApp: "Diese App loslösen",
341
341
  appPinSaveFailed: "App-Anheftungen konnten nicht gespeichert werden.",
342
342
  appPinSavedLocally:
343
343
  "App-Anheftungen werden nur auf diesem Gerät gespeichert.",
@@ -348,8 +348,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
348
348
  chatFirstNoWorkspaceApps: "Noch keine Arbeitsbereich-Apps.",
349
349
  chatFirstCreateApp: "App erstellen",
350
350
  chatFirstRetry: "Erneut versuchen",
351
- chatFirstUnpinApp: "{{name}} loslösen",
352
- chatFirstPinApp: "{{name}} anheften",
351
+ chatFirstUnpinApp: "Diese App loslösen",
352
+ chatFirstPinApp: "Diese App anheften",
353
353
  chatFirstRemovePinned: "Aus angehefteten Apps entfernen",
354
354
  chatFirstPinTop: "App oben anheften",
355
355
  chatFirstOpenSideSurfaces: "Seitenflächen öffnen",
@@ -423,8 +423,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
423
423
  searchAppsPlaceholder: "名前または説明で検索",
424
424
  clearAppSearch: "検索をクリア",
425
425
  noAppsMatch: "検索に一致するアプリはありません",
426
- pinApp: "{{name}}を固定",
427
- unpinApp: "{{name}}の固定を解除",
426
+ pinApp: "このアプリを固定",
427
+ unpinApp: "このアプリの固定を解除",
428
428
  appPinSaveFailed: "アプリの固定を保存できませんでした。",
429
429
  appPinSavedLocally: "アプリの固定はこのデバイスにのみ保存されます。",
430
430
  chatFirstCreateWorkspaceApp: "ワークスペースアプリを作成",
@@ -433,8 +433,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
433
433
  chatFirstNoWorkspaceApps: "ワークスペースアプリはまだありません。",
434
434
  chatFirstCreateApp: "アプリを作成",
435
435
  chatFirstRetry: "再試行",
436
- chatFirstUnpinApp: "{{name}}の固定を解除",
437
- chatFirstPinApp: "{{name}}を固定",
436
+ chatFirstUnpinApp: "このアプリの固定を解除",
437
+ chatFirstPinApp: "このアプリを固定",
438
438
  chatFirstRemovePinned: "固定アプリから削除",
439
439
  chatFirstPinTop: "アプリを上部に固定",
440
440
  chatFirstOpenSideSurfaces: "サイドサーフェスを開く",
@@ -508,8 +508,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
508
508
  searchAppsPlaceholder: "이름 또는 설명으로 검색",
509
509
  clearAppSearch: "검색 지우기",
510
510
  noAppsMatch: "검색 결과가 없습니다",
511
- pinApp: "{{name}} 고정",
512
- unpinApp: "{{name}} 고정 해제",
511
+ pinApp: "이 앱 고정",
512
+ unpinApp: "이 앱 고정 해제",
513
513
  appPinSaveFailed: "앱 고정을 저장하지 못했습니다.",
514
514
  appPinSavedLocally: "앱 고정은 이 기기에만 저장됩니다.",
515
515
  chatFirstCreateWorkspaceApp: "워크스페이스 앱 만들기",
@@ -518,8 +518,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
518
518
  chatFirstNoWorkspaceApps: "아직 워크스페이스 앱이 없습니다.",
519
519
  chatFirstCreateApp: "앱 만들기",
520
520
  chatFirstRetry: "다시 시도",
521
- chatFirstUnpinApp: "{{name}} 고정 해제",
522
- chatFirstPinApp: "{{name}} 고정",
521
+ chatFirstUnpinApp: "이 앱 고정 해제",
522
+ chatFirstPinApp: "이 앱 고정",
523
523
  chatFirstRemovePinned: "고정된 앱에서 제거",
524
524
  chatFirstPinTop: "앱을 맨 위에 고정",
525
525
  chatFirstOpenSideSurfaces: "사이드 표면 열기",
@@ -589,8 +589,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
589
589
  searchAppsPlaceholder: "Pesquisar por nome ou descrição",
590
590
  clearAppSearch: "Limpar pesquisa",
591
591
  noAppsMatch: "Nenhum app corresponde à sua pesquisa",
592
- pinApp: "Fixar {{name}}",
593
- unpinApp: "Desafixar {{name}}",
592
+ pinApp: "Fixar este app",
593
+ unpinApp: "Desafixar este app",
594
594
  appPinSaveFailed: "Não foi possível salvar os apps fixados.",
595
595
  appPinSavedLocally:
596
596
  "Os apps fixados são salvos somente neste dispositivo.",
@@ -601,8 +601,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
601
601
  chatFirstNoWorkspaceApps: "Ainda não há apps do espaço de trabalho.",
602
602
  chatFirstCreateApp: "Criar app",
603
603
  chatFirstRetry: "Tentar novamente",
604
- chatFirstUnpinApp: "Desafixar {{name}}",
605
- chatFirstPinApp: "Fixar {{name}}",
604
+ chatFirstUnpinApp: "Desafixar este app",
605
+ chatFirstPinApp: "Fixar este app",
606
606
  chatFirstRemovePinned: "Remover dos apps fixados",
607
607
  chatFirstPinTop: "Fixar app no topo",
608
608
  chatFirstOpenSideSurfaces: "Abrir superfícies laterais",
@@ -675,8 +675,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
675
675
  searchAppsPlaceholder: "नाम या विवरण से खोजें",
676
676
  clearAppSearch: "खोज साफ़ करें",
677
677
  noAppsMatch: "आपकी खोज से कोई ऐप मेल नहीं खाता",
678
- pinApp: "{{name}} पिन करें",
679
- unpinApp: "{{name}} अनपिन करें",
678
+ pinApp: "इस ऐप को पिन करें",
679
+ unpinApp: "इस ऐप से पिन हटाएं",
680
680
  appPinSaveFailed: "ऐप पिन सहेजे नहीं जा सके।",
681
681
  appPinSavedLocally: "ऐप पिन केवल इस डिवाइस पर सहेजे गए हैं।",
682
682
  chatFirstCreateWorkspaceApp: "वर्कस्पेस ऐप बनाएँ",
@@ -685,8 +685,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
685
685
  chatFirstNoWorkspaceApps: "अभी कोई वर्कस्पेस ऐप नहीं है।",
686
686
  chatFirstCreateApp: "ऐप बनाएँ",
687
687
  chatFirstRetry: "पुनः प्रयास करें",
688
- chatFirstUnpinApp: "{{name}} को अनपिन करें",
689
- chatFirstPinApp: "{{name}} को पिन करें",
688
+ chatFirstUnpinApp: "इस ऐप से पिन हटाएं",
689
+ chatFirstPinApp: "इस ऐप को पिन करें",
690
690
  chatFirstRemovePinned: "पिन किए गए ऐप्स से हटाएँ",
691
691
  chatFirstPinTop: "ऐप को सबसे ऊपर पिन करें",
692
692
  chatFirstOpenSideSurfaces: "साइड पैनल खोलें",
@@ -754,8 +754,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
754
754
  searchAppsPlaceholder: "البحث بالاسم أو الوصف",
755
755
  clearAppSearch: "مسح البحث",
756
756
  noAppsMatch: "لا توجد تطبيقات تطابق بحثك",
757
- pinApp: "تثبيت {{name}}",
758
- unpinApp: "إلغاء تثبيت {{name}}",
757
+ pinApp: "تثبيت هذا التطبيق",
758
+ unpinApp: "إلغاء تثبيت هذا التطبيق",
759
759
  appPinSaveFailed: "تعذر حفظ تثبيتات التطبيقات.",
760
760
  appPinSavedLocally: "تُحفظ تثبيتات التطبيقات على هذا الجهاز فقط.",
761
761
  chatFirstCreateWorkspaceApp: "إنشاء تطبيق مساحة عمل",
@@ -764,8 +764,8 @@ export const chatFirstPageTranslations: Record<string, ChatFirstPageMessages> =
764
764
  chatFirstNoWorkspaceApps: "لا توجد تطبيقات لمساحة العمل بعد.",
765
765
  chatFirstCreateApp: "إنشاء تطبيق",
766
766
  chatFirstRetry: "إعادة المحاولة",
767
- chatFirstUnpinApp: "إلغاء تثبيت {{name}}",
768
- chatFirstPinApp: "تثبيت {{name}}",
767
+ chatFirstUnpinApp: "إلغاء تثبيت هذا التطبيق",
768
+ chatFirstPinApp: "تثبيت هذا التطبيق",
769
769
  chatFirstRemovePinned: "إزالة من التطبيقات المثبتة",
770
770
  chatFirstPinTop: "تثبيت التطبيق في الأعلى",
771
771
  chatFirstOpenSideSurfaces: "فتح الأسطح الجانبية",
@@ -432,11 +432,11 @@ const enUS = {
432
432
  threadDebugSelectPrompt: "Select a failed run or thread to inspect.",
433
433
  chatFirstWorkspaceApps: "Workspace apps",
434
434
  searchApps: "Search apps",
435
- searchAppsPlaceholder: "Search by name or description",
435
+ searchAppsPlaceholder: "Search apps",
436
436
  clearAppSearch: "Clear search",
437
437
  noAppsMatch: "No apps match your search",
438
- pinApp: "Pin {{name}}",
439
- unpinApp: "Unpin {{name}}",
438
+ pinApp: "Pin this app",
439
+ unpinApp: "Unpin this app",
440
440
  appPinSaveFailed: "App pins could not be saved.",
441
441
  appPinSavedLocally: "App pins are saved on this device only.",
442
442
  chatFirstCreateWorkspaceApp: "Create workspace app",
@@ -445,8 +445,8 @@ const enUS = {
445
445
  chatFirstNoWorkspaceApps: "No workspace apps yet.",
446
446
  chatFirstCreateApp: "Create app",
447
447
  chatFirstRetry: "Retry",
448
- chatFirstUnpinApp: "Unpin {{name}}",
449
- chatFirstPinApp: "Pin {{name}}",
448
+ chatFirstUnpinApp: "Unpin this app",
449
+ chatFirstPinApp: "Pin this app",
450
450
  chatFirstRemovePinned: "Remove from pinned apps",
451
451
  chatFirstPinTop: "Pin app to the top",
452
452
  chatFirstOpenSideSurfaces: "Open side surfaces",
@@ -22,11 +22,20 @@ decisions, feedback, agent runs, and provider audit records.
22
22
  `reconciliation_required` state.
23
23
  - Deduplicate by Factory item and rule/run identity, not provider comment ID.
24
24
  - Use the generic Slack adapter: clear-bug automations add 👀 and tag
25
- `@builderio`; GitHub/Sentry clear bugs use the Builder run API. Clips, Design,
26
- and Content stay owner-managed outside autonomous dispatch and PR governance.
27
- - PR governance requires verified BuilderIO membership, a clear bug, passing CI,
28
- and handled review feedback; product/UX implications stay manual. Auto-merge
29
- also requires a verified Factory Builder run.
25
+ `@builder.io`, ask Builder to run `/address-feedback`, and group repeated
26
+ reports into one Builder thread; GitHub/Sentry clear bugs use the Builder run
27
+ API. Clips, Design, and Content stay owner-managed outside autonomous
28
+ dispatch and PR governance.
29
+ - PR governance follows `review-prs`: verify current BuilderIO membership and
30
+ the complete diff/review/check evidence, never approve external or
31
+ unverified authors, and keep ultra-scary security, auth, tenant-isolation,
32
+ secrets, data-loss, execution, payment, and deployment risks manual. The
33
+ verified internal-author evidence does not waive ordinary failed or
34
+ unresolved checks or feedback; those gates remain required and their exact
35
+ states must stay visible. It never waives membership or the ultra-scary
36
+ gate.
37
+ Product/UX ownership still needs the verified owner, with the documented Sid
38
+ exception. Auto-merge also requires a verified Factory Builder run.
30
39
  - Graph edits create immutable blueprint versions. AI proposes with `source=ai`;
31
40
  a person reviews and publishes through the same action surface.
32
41
  - Provider credentials belong to Dispatch/shared workspace integrations, never
@@ -35,47 +44,39 @@ decisions, feedback, agent runs, and provider audit records.
35
44
 
36
45
  ## Application state
37
46
 
38
- - `navigation.view`: `factory` for the Factory workspace or `agents` for the
39
- shared Agents sidebar surface.
40
- - `navigation.factoryId`: selected Factory id when present.
41
- - `navigation.factoryTab`: `map` | `inbox` | `rules` | `automations` | `agents` | `audit` | `settings`.
42
- - `navigation.factoryAuditRunId`: selected automation run in the audit view when present.
43
- - `navigation.factoryNodeId` / `navigation.factoryEdgeId`: selected graph item.
44
- - A selected graph node or edge is part of `navigation` context. Read
45
- `view-screen` before answering why a route exists or changing the selected
46
- Factory.
47
- - The `/agents` surface shows mounted agentic apps and reusable agent packs from
48
- the same Dispatch SQL/action registry. Use `view-screen` there before
49
- answering questions about the visible agent inventory.
47
+ - `navigation.view` is `factory` or `agents`; `factoryId`, `factoryTab`,
48
+ `factoryAuditRunId`, `factoryNodeId`, and `factoryEdgeId` hold the selected
49
+ Factory context. Read `view-screen` before explaining a route, changing the
50
+ selected Factory, or answering about the `/agents` inventory.
50
51
 
51
52
  ## Action contract
52
53
 
53
54
  | Action | Purpose |
54
55
  | --- | --- |
55
- | `list-triage-items` / `get-triage-item` | Inspect queue and evidence; scheduled reviewers must pass `needsReview: true` with a bounded `source` and `limit`. |
56
+ | `list-triage-items` / `get-triage-item` | Inspect bounded queue evidence; scheduled reviewers pass `needsReview: true`, `source`, and `limit`. |
56
57
  | `poll-slack-channel` | Observe Slack history; never writes to Slack. |
57
58
  | `get-slack-feedback-context` | Read the bounded full Slack thread before classification. |
58
- | `poll-github-sources` / `poll-sentry-errors` | Observe bounded GitHub and Sentry source queues. |
59
+ | `poll-github-sources` / `poll-sentry-errors` | Observe bounded source queues. |
59
60
  | `ingest-github-observation` | Store read-only PR evidence. |
60
- | `list-triage-rules` / `save-triage-rule` | Tune prompt rules and guards. |
61
+ | `list-triage-rules` / `save-triage-rule` | Tune rules and guards. |
61
62
  | `evaluate-triage-item` | Append a decision. |
62
63
  | `record-triage-feedback` | Capture human correction for learning. |
63
64
  | `approve-factory-item` | Explicitly authorize one bounded run. |
64
65
  | `start-builder-for-item` | Govern clear-bug dispatch through Slack or Builder API. |
65
- | `govern-agent-native-pull-request` | Apply CI, review, author, product, and owner gates. |
66
- | `list-factory-automations` / `save-factory-automation` / `run-factory-automation` | Inspect or edit org-owned prompts, schedules, and runs. |
66
+ | `govern-agent-native-pull-request` | Apply PR evidence and ownership gates. |
67
+ | `list-factory-automations` / `save-factory-automation` / `run-factory-automation` | Inspect or edit org-owned automations. |
67
68
  | `list-factory-audit` | Inspect automation runs, evidence, decisions, and provider actions. |
68
69
  | `get-factory-automation-health` | Inspect scheduler heartbeat and last error. |
69
- | `suggest-factory-rules` | Mine feedback and fast approvals into proposals. |
70
+ | `suggest-factory-rules` | Mine feedback into proposals. |
70
71
  | `reconcile-triage-run` | Persist callback/provider reconciliation. |
71
- | `list-factories` / `get-factory-graph` | Inspect Factory definitions, graph versions, and live evidence metrics. |
72
+ | `list-factories` / `get-factory-graph` | Inspect definitions, versions, and metrics. |
72
73
  | `save-factory-graph` | Create or version a complete visual graph; never starts provider work. |
73
74
  | `list-factory-comments` / `add-factory-comment` | Read or attach comments to a canvas, node, or edge. |
74
- | `provider-api-catalog` / `provider-api-docs` / `provider-api-request` | Discover and use connected provider APIs with shared workspace credentials; never request raw keys. |
75
- | `list-workspace-apps` / `update-workspace-app-metadata` | Inventory and edit mounted agentic apps in the shared workspace. |
76
- | `list-workspace-resources` / `create-workspace-resource` / `update-workspace-resource` | Manage shared resource records used by agents and apps. |
77
- | `import-agent` / `import-agent-pack` / `list-agent-pack` | Import a simple profile or a Claude/Cowork-style folder-backed agent pack. |
78
- | `start-workspace-app-creation` | Promote an agent and all of its pack resource ids into an app-creation handoff. |
75
+ | `provider-api-catalog` / `provider-api-docs` / `provider-api-request` | Use connected provider APIs with shared credentials; never request raw keys. |
76
+ | `list-workspace-apps` / `update-workspace-app-metadata` | Inventory and edit mounted apps. |
77
+ | `list-workspace-resources` / `create-workspace-resource` / `update-workspace-resource` | Manage shared agent resources. |
78
+ | `import-agent` / `import-agent-pack` / `list-agent-pack` | Import profiles or agent packs. |
79
+ | `start-workspace-app-creation` | Promote an agent and its pack into an app handoff. |
79
80
 
80
81
  Rules start in shadow mode; hard guards always apply. Organization automations
81
82
  execute stored prompts, and every external mutation needs a durable run,
@@ -66,6 +66,26 @@ const BARE_ROUTES = new Set(["/slide"]);
66
66
  /** Route prefixes that render without the app shell */
67
67
  const BARE_PREFIXES = ["/share/", "/p/"];
68
68
 
69
+ /**
70
+ * Routes that serve deck content to any visitor — owner, teammate, or an
71
+ * anonymous recipient of a shared link — rather than an app-management
72
+ * surface. `/deck/:id` renders the full editor shell (so it's not "bare"
73
+ * above: viewers still get chrome, just read-only), but it must never force
74
+ * sign-in or gate on first-run onboarding, or a shared link flashes the deck
75
+ * and then buries it under "create your first deck" (the onboarding gate has
76
+ * no route awareness of its own — see `sessionBypass` below). `/present` is
77
+ * the full-screen presentation view and `/slide` is the agent-embed preview;
78
+ * both are shown to viewers the same way.
79
+ */
80
+ export function isShareableContentPath(pathname: string): boolean {
81
+ return (
82
+ BARE_ROUTES.has(pathname) ||
83
+ BARE_PREFIXES.some((p) => pathname.startsWith(p)) ||
84
+ pathname.startsWith("/deck/") ||
85
+ pathname.endsWith("/present")
86
+ );
87
+ }
88
+
69
89
  export const links: LinksFunction = () => [
70
90
  { rel: "stylesheet", href: stylesheet },
71
91
  ];
@@ -311,6 +331,7 @@ export default function Root() {
311
331
  queryClient={queryClient}
312
332
  defaultTheme="dark"
313
333
  i18n={{ catalog: i18nCatalog }}
334
+ sessionBypass={isShareableContentPath(location.pathname)}
314
335
  >
315
336
  <AppContent />
316
337
  </AppProviders>
@@ -1,7 +1,7 @@
1
1
  import { recordChange } from "@agent-native/core/server/poll";
2
2
  import { defineEventHandler, setResponseStatus, createEventStream } from "h3";
3
3
 
4
- import { resolveSlidesRequestAuthContext } from "./request-auth-context.js";
4
+ import { resolveSlidesRequestAuth } from "./request-auth-context.js";
5
5
 
6
6
  // --- SSE for change notifications ---
7
7
  type SSEPush = (data: string) => void;
@@ -91,8 +91,12 @@ export function notifyClients(
91
91
  // callers can't tail the stream. (The agent path runs server-side and is
92
92
  // not affected.)
93
93
  export const deckEvents = defineEventHandler(async (event) => {
94
- const session = await resolveSlidesRequestAuthContext(event);
95
- if (!session.email) {
94
+ const auth = await resolveSlidesRequestAuth(event);
95
+ if (!auth.ok) {
96
+ setResponseStatus(event, auth.statusCode);
97
+ return { error: auth.error };
98
+ }
99
+ if (!auth.context.email) {
96
100
  setResponseStatus(event, 401);
97
101
  return { error: "Unauthorized" };
98
102
  }
@@ -7,10 +7,36 @@ export interface SlidesRequestAuthContext {
7
7
  orgId?: string;
8
8
  }
9
9
 
10
+ /**
11
+ * A session lookup that failed outright (DB blip, cookie race) — distinct
12
+ * from `getSession` resolving to `null`, which means "no session" and is a
13
+ * legitimate outcome for anonymous callers (public share/deck viewers).
14
+ * `getSession` only throws on a real backend failure, never merely because a
15
+ * request carries no session cookie, so this never fires for genuine
16
+ * anonymous access. Previously this was swallowed into the same
17
+ * `email: undefined` an anonymous visitor gets, so a transient failure
18
+ * presented as "unauthorized" on the upload path and as an untraceable error
19
+ * on deck creation — see `resolveSlidesRequestAuth` for the caller-facing
20
+ * shape.
21
+ */
22
+ export class SlidesSessionLookupError extends Error {
23
+ readonly statusCode = 503;
24
+ constructor(cause: unknown) {
25
+ super("Could not verify your session. Please try again.");
26
+ this.name = "SlidesSessionLookupError";
27
+ this.cause = cause;
28
+ }
29
+ }
30
+
10
31
  export async function resolveSlidesRequestAuthContext(
11
32
  event: H3Event,
12
33
  ): Promise<SlidesRequestAuthContext> {
13
- const session = await getSession(event).catch(() => null);
34
+ let session: Awaited<ReturnType<typeof getSession>>;
35
+ try {
36
+ session = await getSession(event);
37
+ } catch (err) {
38
+ throw new SlidesSessionLookupError(err);
39
+ }
14
40
 
15
41
  // Prefer the live active org context over `session.orgId`. Better Auth's
16
42
  // session.orgId is set at sign-in and not refreshed when the user switches
@@ -39,6 +65,37 @@ export async function resolveSlidesRequestAuthContext(
39
65
  };
40
66
  }
41
67
 
68
+ /** Discriminated result for route handlers that must fail closed on a
69
+ * session-lookup error rather than treat it as "logged out". */
70
+ export type SlidesRequestAuthResolution =
71
+ | { ok: true; context: SlidesRequestAuthContext }
72
+ | { ok: false; statusCode: number; error: string };
73
+
74
+ /**
75
+ * Like `resolveSlidesRequestAuthContext`, but turns a `SlidesSessionLookupError`
76
+ * into a response the caller can return directly instead of a 401 — so a
77
+ * route handler that gates on `!context.email` never mistakes "the session
78
+ * lookup failed" for "this visitor is signed out". A route with legitimate
79
+ * anonymous access (e.g. a public deck view) still gets `email: undefined`
80
+ * for real anonymous callers via `ok: true`; only a genuine lookup failure
81
+ * takes the `ok: false` branch.
82
+ */
83
+ export async function resolveSlidesRequestAuth(
84
+ event: H3Event,
85
+ ): Promise<SlidesRequestAuthResolution> {
86
+ try {
87
+ return { ok: true, context: await resolveSlidesRequestAuthContext(event) };
88
+ } catch (err) {
89
+ return {
90
+ ok: false,
91
+ statusCode:
92
+ err instanceof SlidesSessionLookupError ? err.statusCode : 500,
93
+ error:
94
+ err instanceof Error ? err.message : "Failed to verify your session.",
95
+ };
96
+ }
97
+ }
98
+
42
99
  export async function withSlidesRequestContext<T>(
43
100
  event: H3Event,
44
101
  fn: (session: SlidesRequestAuthContext) => Promise<T>,
@@ -18,7 +18,7 @@ import { defineEventHandler, getRouterParam, setResponseStatus } from "h3";
18
18
 
19
19
  import { getDb, schema } from "../db";
20
20
  import {
21
- resolveSlidesRequestAuthContext,
21
+ resolveSlidesRequestAuth,
22
22
  withSlidesRequestContext,
23
23
  } from "./request-auth-context.js";
24
24
 
@@ -47,7 +47,12 @@ export const shareDeck = defineEventHandler(async (event) => {
47
47
  // and pass the resolved context into `withSlidesRequestContext` so it
48
48
  // doesn't re-resolve session + org on the same request (which would
49
49
  // double the session/getOrgContext I/O per share).
50
- const session = await resolveSlidesRequestAuthContext(event);
50
+ const auth = await resolveSlidesRequestAuth(event);
51
+ if (!auth.ok) {
52
+ setResponseStatus(event, auth.statusCode);
53
+ return { error: auth.error };
54
+ }
55
+ const session = auth.context;
51
56
  if (!session.email) {
52
57
  setResponseStatus(event, 401);
53
58
  return { error: "Unauthorized" };
@@ -21,7 +21,7 @@ import {
21
21
  } from "../lib/uploaded-reference-storage.js";
22
22
  import { canSaveAsUploadedAsset, uploadImageAsset } from "./assets.js";
23
23
  import {
24
- resolveSlidesRequestAuthContext,
24
+ resolveSlidesRequestAuth,
25
25
  withSlidesRequestContext,
26
26
  } from "./request-auth-context.js";
27
27
 
@@ -211,7 +211,12 @@ export async function saveUploadedReferenceFile(args: {
211
211
 
212
212
  // Upload one or more files
213
213
  export const uploadFiles = defineEventHandler(async (event) => {
214
- const authContext = await resolveSlidesRequestAuthContext(event);
214
+ const auth = await resolveSlidesRequestAuth(event);
215
+ if (!auth.ok) {
216
+ setResponseStatus(event, auth.statusCode);
217
+ return { error: auth.error };
218
+ }
219
+ const authContext = auth.context;
215
220
  const email = authContext.email;
216
221
  if (!email) {
217
222
  setResponseStatus(event, 401);