@open-slide/core 2.3.2 → 2.4.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 (85) hide show
  1. package/dist/{build-8lRsgsO4.js → build-D7GwYl8d.js} +1 -1
  2. package/dist/cli/bin.js +4 -4
  3. package/dist/{config-DJ8ZOe7C.d.ts → config-CfhtJxQH.d.ts} +1 -1
  4. package/dist/{config-D2Mq1vSW.js → config-D4uPk_tM.js} +383 -138
  5. package/dist/{dev-BvefEp1Q.js → dev-DyCDMbHB.js} +10 -10
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +9 -1
  8. package/dist/locale/index.d.ts +1 -1
  9. package/dist/locale/index.js +1 -1
  10. package/dist/{preview-D8ognobz.js → preview-DjIFvt0K.js} +1 -1
  11. package/dist/{types-tdaXSyah.d.ts → types-ZfArJF0d.d.ts} +20 -13
  12. package/dist/{update-BivdNgL3.js → update-BKhRM7o4.js} +30 -3
  13. package/dist/vite/index.d.ts +1 -1
  14. package/dist/vite/index.js +1 -1
  15. package/dist/{zh-tw-DXcqQTrA.js → zh-tw-D7LfGVmA.js} +215 -65
  16. package/package.json +4 -5
  17. package/src/agent/provider.ts +8 -1
  18. package/src/agent/types.ts +17 -2
  19. package/src/app/app.tsx +2 -0
  20. package/src/app/components/agent/agent-markdown.tsx +3 -6
  21. package/src/app/components/agent/agent-panel.tsx +36 -258
  22. package/src/app/components/agent/agent-presence.tsx +1 -1
  23. package/src/app/components/agent/composer.tsx +52 -24
  24. package/src/app/components/agent/effort-slider.tsx +172 -0
  25. package/src/app/components/agent/model-menu.tsx +170 -0
  26. package/src/app/components/agent/permission-menu.tsx +88 -0
  27. package/src/app/components/agent/transcript.tsx +23 -31
  28. package/src/app/components/command/home-command-menu.tsx +4 -1
  29. package/src/app/components/command/slide-command-menu.tsx +4 -1
  30. package/src/app/components/export-progress-toast.tsx +3 -1
  31. package/src/app/components/inspector/asset-picker-dialog.tsx +1 -1
  32. package/src/app/components/inspector/comment-layer.tsx +3 -3
  33. package/src/app/components/inspector/inline-text-editor.tsx +1 -12
  34. package/src/app/components/inspector/inspect-overlay.tsx +9 -1
  35. package/src/app/components/inspector/inspector-panel.tsx +8 -35
  36. package/src/app/components/inspector/inspector-provider.tsx +177 -36
  37. package/src/app/components/inspector/page-panel.tsx +270 -0
  38. package/src/app/components/language-toggle.tsx +13 -11
  39. package/src/app/components/note-markdown.test.tsx +12 -6
  40. package/src/app/components/note-markdown.tsx +16 -21
  41. package/src/app/components/overview-grid.tsx +3 -3
  42. package/src/app/components/panel/editor-sidebar.tsx +43 -8
  43. package/src/app/components/panel/panel-shell.tsx +9 -5
  44. package/src/app/components/panel/save-card.tsx +1 -1
  45. package/src/app/components/sidebar/folder-item.tsx +4 -1
  46. package/src/app/components/sidebar/sidebar.tsx +11 -8
  47. package/src/app/components/style-panel/design-provider.tsx +48 -11
  48. package/src/app/components/style-panel/use-design.ts +6 -1
  49. package/src/app/components/theme-toggle.tsx +16 -22
  50. package/src/app/components/thumbnail-rail.tsx +68 -49
  51. package/src/app/components/ui/context-menu.tsx +9 -10
  52. package/src/app/components/ui/dialog.tsx +2 -4
  53. package/src/app/components/ui/dropdown-menu.tsx +9 -10
  54. package/src/app/components/ui/popover.tsx +1 -1
  55. package/src/app/components/ui/select.tsx +2 -2
  56. package/src/app/components/ui/sonner.tsx +2 -2
  57. package/src/app/index.html +7 -0
  58. package/src/app/lib/agent/use-agent.ts +131 -37
  59. package/src/app/lib/desktop-host.ts +31 -0
  60. package/src/app/lib/desktop-routes.test.ts +54 -0
  61. package/src/app/lib/desktop-routes.ts +22 -0
  62. package/src/app/lib/desktop.ts +106 -0
  63. package/src/app/lib/export-pdf.ts +15 -7
  64. package/src/app/lib/inspector/color.ts +51 -0
  65. package/src/app/lib/inspector/fiber.ts +6 -0
  66. package/src/app/lib/inspector/use-editor.ts +2 -1
  67. package/src/app/lib/inspector/use-notes.test.ts +209 -0
  68. package/src/app/lib/inspector/use-notes.ts +331 -57
  69. package/src/app/lib/inspector/use-visual-editor.ts +9 -1
  70. package/src/app/lib/locale-store.ts +14 -2
  71. package/src/app/lib/note-markdown.test.ts +69 -5
  72. package/src/app/lib/note-markdown.ts +97 -22
  73. package/src/app/lib/transition.test.ts +84 -1
  74. package/src/app/lib/transition.ts +43 -0
  75. package/src/app/lib/unsaved.test.ts +253 -0
  76. package/src/app/lib/unsaved.ts +155 -0
  77. package/src/app/routes/home.tsx +1 -1
  78. package/src/app/routes/slide.tsx +114 -117
  79. package/src/app/styles.css +421 -1
  80. package/src/locale/en.ts +40 -15
  81. package/src/locale/es.ts +40 -17
  82. package/src/locale/ja.ts +40 -15
  83. package/src/locale/types.ts +19 -14
  84. package/src/locale/zh-cn.ts +40 -14
  85. package/src/locale/zh-tw.ts +40 -14
@@ -94,10 +94,6 @@ const en = {
94
94
  resizeSidePanel: "Resize side panel",
95
95
  home: "Home",
96
96
  backToHome: "Back to home",
97
- agentConnected: "Agent connected",
98
- agentConnectedTooltip: "The current slide and inspector selection are synced to your agent in real time.",
99
- agentDisconnected: "Agent disconnected",
100
- agentDisconnectedTooltip: "Lost connection to the dev server, so your agent can no longer see the current slide or inspector selection. Restart the dev server to restore the connection.",
101
97
  download: "Download",
102
98
  copyLink: "Copy link",
103
99
  moreActions: "More actions",
@@ -193,7 +189,6 @@ const en = {
193
189
  previewMode: "Preview",
194
190
  closeFormatPanel: "Close Format panel",
195
191
  editText: "Edit on slide",
196
- emptySelectionTitle: "Select an object",
197
192
  emptySelectionHint: "Click an object to format it. Double-click text to edit.",
198
193
  textSelectionHint: "Formatting applies to the selected text.",
199
194
  elementText: "Text",
@@ -203,6 +198,27 @@ const en = {
203
198
  rotateHandle: "Rotate element",
204
199
  resizeHandle: "Resize {handle}",
205
200
  arrangeSection: "Arrange",
201
+ pageLabel: "Page {page} of {total}",
202
+ pageBackground: "Background",
203
+ pageBackgroundTheme: "From theme",
204
+ pageBackgroundShared: "Shared across pages",
205
+ pageBackgroundComplex: "Gradient or image",
206
+ pageTransition: "Transition",
207
+ pageTransitionInherited: "Deck default",
208
+ pageSteps: "Steps",
209
+ pageStepsCount: {
210
+ one: "1 step",
211
+ other: "{count} steps"
212
+ },
213
+ pageNone: "None",
214
+ transitionKinds: {
215
+ fade: "Fade",
216
+ slide: "Slide",
217
+ zoom: "Zoom",
218
+ wipe: "Wipe",
219
+ morph: "Morph",
220
+ custom: "Custom"
221
+ },
206
222
  selectionCount: "{count} elements selected",
207
223
  positionLabel: "Position",
208
224
  positionX: "Horizontal position",
@@ -443,6 +459,7 @@ const en = {
443
459
  title: "Exporting PDF",
444
460
  processing: "Processing page {current} of {total}",
445
461
  printing: "Opening print dialog…",
462
+ saving: "Saving PDF…",
446
463
  done: "Done"
447
464
  },
448
465
  pptxToast: {
@@ -521,9 +538,6 @@ const en = {
521
538
  },
522
539
  agent: {
523
540
  title: "Agent",
524
- beta: "Beta",
525
- betaTitle: "Early preview",
526
- betaHint: "Replies, edits and tool calls can occasionally fail or do something unexpected.",
527
541
  open: "Agent",
528
542
  openTitle: "Open the agent panel",
529
543
  close: "Close agent panel",
@@ -568,11 +582,25 @@ const en = {
568
582
  deny: "Deny",
569
583
  allowed: "Allowed",
570
584
  denied: "Denied",
571
- autoApprove: "Auto-approve",
572
- autoApproveHint: "Run commands without asking. Edits inside the workspace are always allowed.",
573
- resultDone: "Done",
574
- resultStopped: "Stopped",
575
- resultSeconds: "{seconds}s",
585
+ permissionMode: "Permissions",
586
+ permissionModes: {
587
+ supervised: "Supervised",
588
+ acceptEdits: "Auto-accept edits",
589
+ auto: "Auto",
590
+ fullAccess: "Full access"
591
+ },
592
+ permissionHints: {
593
+ supervised: "Asks before commands and file changes.",
594
+ acceptEdits: "Edits files freely; asks before other actions.",
595
+ auto: "Approves routine actions; asks about the rest.",
596
+ fullAccess: "Runs commands and edits without asking."
597
+ },
598
+ permissionHintsCodex: {
599
+ supervised: "Codex can't ask mid-turn, so it only reads and suggests changes.",
600
+ acceptEdits: "Edits and runs commands inside the workspace sandbox.",
601
+ auto: "Edits and runs commands inside the workspace sandbox.",
602
+ fullAccess: "Runs commands and edits with no sandbox."
603
+ },
576
604
  errorEyebrow: "Error",
577
605
  statusLoading: "Checking agents",
578
606
  disabled: "The agent panel is disabled in open-slide.config.ts.",
@@ -613,6 +641,8 @@ const en = {
613
641
  modelDefault: "Default",
614
642
  reasoning: "Reasoning",
615
643
  effortAuto: "Auto",
644
+ effortFaster: "Faster",
645
+ effortSmarter: "Smarter",
616
646
  efforts: {
617
647
  minimal: "Minimal",
618
648
  low: "Low",
@@ -723,10 +753,6 @@ const es = {
723
753
  resizeSidePanel: "Redimensionar panel lateral",
724
754
  home: "Inicio",
725
755
  backToHome: "Volver al inicio",
726
- agentConnected: "Agente conectado",
727
- agentConnectedTooltip: "La diapositiva actual y la selección del inspector se sincronizan con tu agente en tiempo real.",
728
- agentDisconnected: "Agente desconectado",
729
- agentDisconnectedTooltip: "Se perdió la conexión con el servidor de desarrollo, así que tu agente ya no ve la diapositiva actual ni la selección del inspector. Reinicia el servidor de desarrollo para restablecerla.",
730
756
  download: "Descargar",
731
757
  copyLink: "Copiar enlace",
732
758
  moreActions: "Más acciones",
@@ -822,7 +848,6 @@ const es = {
822
848
  previewMode: "Vista previa",
823
849
  closeFormatPanel: "Cerrar panel de formato",
824
850
  editText: "Editar en la diapositiva",
825
- emptySelectionTitle: "Selecciona un objeto",
826
851
  emptySelectionHint: "Haz clic en un objeto para darle formato. Doble clic en un texto para editarlo.",
827
852
  textSelectionHint: "El formato se aplica al texto seleccionado.",
828
853
  elementText: "Texto",
@@ -832,6 +857,27 @@ const es = {
832
857
  rotateHandle: "Rotar elemento",
833
858
  resizeHandle: "Redimensionar {handle}",
834
859
  arrangeSection: "Organizar",
860
+ pageLabel: "Página {page} de {total}",
861
+ pageBackground: "Fondo",
862
+ pageBackgroundTheme: "Del tema",
863
+ pageBackgroundShared: "Compartido entre páginas",
864
+ pageBackgroundComplex: "Degradado o imagen",
865
+ pageTransition: "Transición",
866
+ pageTransitionInherited: "Predeterminada de la presentación",
867
+ pageSteps: "Pasos",
868
+ pageStepsCount: {
869
+ one: "1 paso",
870
+ other: "{count} pasos"
871
+ },
872
+ pageNone: "Ninguna",
873
+ transitionKinds: {
874
+ fade: "Fundido",
875
+ slide: "Desplazar",
876
+ zoom: "Zoom",
877
+ wipe: "Barrido",
878
+ morph: "Morph",
879
+ custom: "Personalizada"
880
+ },
835
881
  selectionCount: "{count} elementos seleccionados",
836
882
  positionLabel: "Posición",
837
883
  positionX: "Posición horizontal",
@@ -1072,6 +1118,7 @@ const es = {
1072
1118
  title: "Exportando PDF",
1073
1119
  processing: "Procesando página {current} de {total}",
1074
1120
  printing: "Abriendo diálogo de impresión…",
1121
+ saving: "Guardando PDF…",
1075
1122
  done: "Hecho"
1076
1123
  },
1077
1124
  pptxToast: {
@@ -1150,9 +1197,6 @@ const es = {
1150
1197
  },
1151
1198
  agent: {
1152
1199
  title: "Agente",
1153
- beta: "Beta",
1154
- betaTitle: "Versión preliminar",
1155
- betaHint: "Las respuestas, ediciones y acciones pueden fallar o hacer algo inesperado de vez en cuando.",
1156
1200
  open: "Agente",
1157
1201
  openTitle: "Abrir el panel del agente",
1158
1202
  close: "Cerrar el panel del agente",
@@ -1197,11 +1241,25 @@ const es = {
1197
1241
  deny: "Denegar",
1198
1242
  allowed: "Permitido",
1199
1243
  denied: "Denegado",
1200
- autoApprove: "Aprobar automáticamente",
1201
- autoApproveHint: "Ejecuta comandos sin preguntar. Las ediciones dentro del workspace siempre se permiten.",
1202
- resultDone: "Listo",
1203
- resultStopped: "Detenido",
1204
- resultSeconds: "{seconds}s",
1244
+ permissionMode: "Permisos",
1245
+ permissionModes: {
1246
+ supervised: "Supervisado",
1247
+ acceptEdits: "Aceptar ediciones",
1248
+ auto: "Automático",
1249
+ fullAccess: "Acceso total"
1250
+ },
1251
+ permissionHints: {
1252
+ supervised: "Pregunta antes de ejecutar comandos y cambiar archivos.",
1253
+ acceptEdits: "Aprueba las ediciones automáticamente; otras acciones pueden preguntar.",
1254
+ auto: "Una revisión automática aprueba las acciones habituales y pregunta por el resto.",
1255
+ fullAccess: "Ejecuta comandos y ediciones sin preguntar."
1256
+ },
1257
+ permissionHintsCodex: {
1258
+ supervised: "Codex no puede preguntar durante un turno, así que solo lee y sugiere cambios.",
1259
+ acceptEdits: "Edita y ejecuta comandos dentro del sandbox del espacio de trabajo.",
1260
+ auto: "Edita y ejecuta comandos dentro del sandbox del espacio de trabajo.",
1261
+ fullAccess: "Ejecuta comandos y ediciones sin sandbox."
1262
+ },
1205
1263
  errorEyebrow: "Error",
1206
1264
  statusLoading: "Comprobando agentes",
1207
1265
  disabled: "El panel del agente está desactivado en open-slide.config.ts.",
@@ -1242,6 +1300,8 @@ const es = {
1242
1300
  modelDefault: "Predeterminado",
1243
1301
  reasoning: "Razonamiento",
1244
1302
  effortAuto: "Auto",
1303
+ effortFaster: "Más rápido",
1304
+ effortSmarter: "Más listo",
1245
1305
  efforts: {
1246
1306
  minimal: "Mínimo",
1247
1307
  low: "Bajo",
@@ -1350,10 +1410,6 @@ const ja = {
1350
1410
  },
1351
1411
  slide: {
1352
1412
  resizeSidePanel: "サイドパネルの幅を調整",
1353
- agentConnected: "エージェント接続中",
1354
- agentConnectedTooltip: "現在のスライドと Inspector の選択はエージェントにリアルタイムで同期されています。",
1355
- agentDisconnected: "エージェント切断",
1356
- agentDisconnectedTooltip: "dev server との接続が切れたため、現在のスライドや Inspector の選択がエージェントに届かなくなっています。dev server を再起動して接続を復旧してください。",
1357
1413
  home: "ホーム",
1358
1414
  backToHome: "ホームへ戻る",
1359
1415
  download: "ダウンロード",
@@ -1451,7 +1507,6 @@ const ja = {
1451
1507
  previewMode: "プレビュー",
1452
1508
  closeFormatPanel: "フォーマットパネルを閉じる",
1453
1509
  editText: "スライドで編集",
1454
- emptySelectionTitle: "オブジェクトを選択",
1455
1510
  emptySelectionHint: "オブジェクトをクリックして書式を設定します。テキストをダブルクリックして編集します。",
1456
1511
  textSelectionHint: "選択したテキストに書式を適用します。",
1457
1512
  elementText: "テキスト",
@@ -1461,6 +1516,27 @@ const ja = {
1461
1516
  rotateHandle: "要素を回転",
1462
1517
  resizeHandle: "サイズ変更({handle})",
1463
1518
  arrangeSection: "配置",
1519
+ pageLabel: "{page} / {total} ページ",
1520
+ pageBackground: "背景",
1521
+ pageBackgroundTheme: "テーマに従う",
1522
+ pageBackgroundShared: "複数ページで共有",
1523
+ pageBackgroundComplex: "グラデーションまたは画像",
1524
+ pageTransition: "トランジション",
1525
+ pageTransitionInherited: "デッキの既定",
1526
+ pageSteps: "ステップ",
1527
+ pageStepsCount: {
1528
+ one: "1 ステップ",
1529
+ other: "{count} ステップ"
1530
+ },
1531
+ pageNone: "なし",
1532
+ transitionKinds: {
1533
+ fade: "フェード",
1534
+ slide: "スライド",
1535
+ zoom: "ズーム",
1536
+ wipe: "ワイプ",
1537
+ morph: "モーフ",
1538
+ custom: "カスタム"
1539
+ },
1464
1540
  selectionCount: "{count} 個の要素を選択中",
1465
1541
  positionLabel: "位置",
1466
1542
  positionX: "水平位置",
@@ -1701,6 +1777,7 @@ const ja = {
1701
1777
  title: "PDF を書き出し中",
1702
1778
  processing: "ページ {current} / {total} を処理中",
1703
1779
  printing: "印刷ダイアログを開いています…",
1780
+ saving: "PDF を保存しています…",
1704
1781
  done: "完了"
1705
1782
  },
1706
1783
  pptxToast: {
@@ -1779,9 +1856,6 @@ const ja = {
1779
1856
  },
1780
1857
  agent: {
1781
1858
  title: "エージェント",
1782
- beta: "Beta",
1783
- betaTitle: "プレビュー版",
1784
- betaHint: "返答・編集・ツール実行が失敗したり、思わぬ動作をしたりすることがあります。",
1785
1859
  open: "エージェント",
1786
1860
  openTitle: "エージェントパネルを開く",
1787
1861
  close: "エージェントパネルを閉じる",
@@ -1826,11 +1900,25 @@ const ja = {
1826
1900
  deny: "拒否",
1827
1901
  allowed: "許可済み",
1828
1902
  denied: "拒否済み",
1829
- autoApprove: "自動承認",
1830
- autoApproveHint: "確認なしでコマンドを実行します。ワークスペース内の編集は常に許可されます。",
1831
- resultDone: "完了",
1832
- resultStopped: "停止",
1833
- resultSeconds: "{seconds} 秒",
1903
+ permissionMode: "権限",
1904
+ permissionModes: {
1905
+ supervised: "監督",
1906
+ acceptEdits: "編集を自動承認",
1907
+ auto: "自動",
1908
+ fullAccess: "フルアクセス"
1909
+ },
1910
+ permissionHints: {
1911
+ supervised: "コマンドの実行やファイルの変更の前に確認します。",
1912
+ acceptEdits: "ファイル編集は自動で承認し、その他の操作は確認することがあります。",
1913
+ auto: "自動レビューが通常の操作を承認し、それ以外は確認します。",
1914
+ fullAccess: "確認なしでコマンドと編集を実行します。"
1915
+ },
1916
+ permissionHintsCodex: {
1917
+ supervised: "Codex は実行中に確認できないため、読み取りと変更の提案のみ行います。",
1918
+ acceptEdits: "ワークスペースのサンドボックス内で編集とコマンドを実行します。",
1919
+ auto: "ワークスペースのサンドボックス内で編集とコマンドを実行します。",
1920
+ fullAccess: "サンドボックスなしでコマンドと編集を実行します。"
1921
+ },
1834
1922
  errorEyebrow: "エラー",
1835
1923
  statusLoading: "エージェントを確認中",
1836
1924
  disabled: "エージェントパネルは open-slide.config.ts で無効化されています。",
@@ -1871,6 +1959,8 @@ const ja = {
1871
1959
  modelDefault: "デフォルト",
1872
1960
  reasoning: "推論",
1873
1961
  effortAuto: "自動",
1962
+ effortFaster: "速さ重視",
1963
+ effortSmarter: "賢さ重視",
1874
1964
  efforts: {
1875
1965
  minimal: "最小",
1876
1966
  low: "低",
@@ -1979,10 +2069,6 @@ const zhCN = {
1979
2069
  },
1980
2070
  slide: {
1981
2071
  resizeSidePanel: "调整侧栏宽度",
1982
- agentConnected: "Agent 已连接",
1983
- agentConnectedTooltip: "目前的 slide 与 Inspector 选择会即时同步给 agent。",
1984
- agentDisconnected: "Agent 已断开",
1985
- agentDisconnectedTooltip: "已和 dev server 断开连接,agent 没办法再看到你目前的 slide 或 Inspector 选择。请重新启动 dev server 来恢复连接。",
1986
2072
  home: "首页",
1987
2073
  backToHome: "返回首页",
1988
2074
  download: "下载",
@@ -2080,7 +2166,6 @@ const zhCN = {
2080
2166
  previewMode: "预览",
2081
2167
  closeFormatPanel: "关闭格式面板",
2082
2168
  editText: "在幻灯片上编辑",
2083
- emptySelectionTitle: "选择一个对象",
2084
2169
  emptySelectionHint: "单击对象即可调整格式。双击文字即可编辑。",
2085
2170
  textSelectionHint: "格式将应用于选中的文字。",
2086
2171
  elementText: "文字",
@@ -2090,6 +2175,27 @@ const zhCN = {
2090
2175
  rotateHandle: "旋转元素",
2091
2176
  resizeHandle: "调整尺寸({handle})",
2092
2177
  arrangeSection: "排列",
2178
+ pageLabel: "第 {page} 页,共 {total} 页",
2179
+ pageBackground: "背景",
2180
+ pageBackgroundTheme: "跟随主题",
2181
+ pageBackgroundShared: "多页共用",
2182
+ pageBackgroundComplex: "渐变或图片",
2183
+ pageTransition: "转场",
2184
+ pageTransitionInherited: "沿用演示默认",
2185
+ pageSteps: "逐步动画",
2186
+ pageStepsCount: {
2187
+ one: "1 步",
2188
+ other: "{count} 步"
2189
+ },
2190
+ pageNone: "无",
2191
+ transitionKinds: {
2192
+ fade: "淡入淡出",
2193
+ slide: "推移",
2194
+ zoom: "缩放",
2195
+ wipe: "擦除",
2196
+ morph: "Morph",
2197
+ custom: "自定义"
2198
+ },
2093
2199
  selectionCount: "已选择 {count} 个元素",
2094
2200
  positionLabel: "位置",
2095
2201
  positionX: "水平位置",
@@ -2330,6 +2436,7 @@ const zhCN = {
2330
2436
  title: "导出 PDF",
2331
2437
  processing: "正在处理第 {current} / {total} 页",
2332
2438
  printing: "正在打开打印对话框…",
2439
+ saving: "正在保存 PDF…",
2333
2440
  done: "完成"
2334
2441
  },
2335
2442
  pptxToast: {
@@ -2408,9 +2515,6 @@ const zhCN = {
2408
2515
  },
2409
2516
  agent: {
2410
2517
  title: "Agent",
2411
- beta: "Beta",
2412
- betaTitle: "抢先体验版",
2413
- betaHint: "回复、编辑或工具调用偶尔可能失败,或出现预期之外的结果。",
2414
2518
  open: "Agent",
2415
2519
  openTitle: "打开 agent 面板",
2416
2520
  close: "关闭 agent 面板",
@@ -2455,11 +2559,25 @@ const zhCN = {
2455
2559
  deny: "拒绝",
2456
2560
  allowed: "已允许",
2457
2561
  denied: "已拒绝",
2458
- autoApprove: "自动批准",
2459
- autoApproveHint: "不询问直接执行命令。工作区内的文件编辑始终允许。",
2460
- resultDone: "完成",
2461
- resultStopped: "已停止",
2462
- resultSeconds: "{seconds} 秒",
2562
+ permissionMode: "权限",
2563
+ permissionModes: {
2564
+ supervised: "监督",
2565
+ acceptEdits: "自动接受编辑",
2566
+ auto: "自动",
2567
+ fullAccess: "完全访问"
2568
+ },
2569
+ permissionHints: {
2570
+ supervised: "执行命令和修改文件前都会询问。",
2571
+ acceptEdits: "自动批准文件编辑,其他操作仍可能询问。",
2572
+ auto: "自动审查会批准例行操作,其余的再询问你。",
2573
+ fullAccess: "不经询问直接执行命令和编辑。"
2574
+ },
2575
+ permissionHintsCodex: {
2576
+ supervised: "Codex 无法在运行中询问,因此只会读取并提出修改建议。",
2577
+ acceptEdits: "在工作区沙箱内编辑和执行命令。",
2578
+ auto: "在工作区沙箱内编辑和执行命令。",
2579
+ fullAccess: "不受沙箱限制地执行命令和编辑。"
2580
+ },
2463
2581
  errorEyebrow: "错误",
2464
2582
  statusLoading: "正在检查 agent",
2465
2583
  disabled: "agent 面板已在 open-slide.config.ts 中禁用。",
@@ -2500,6 +2618,8 @@ const zhCN = {
2500
2618
  modelDefault: "默认",
2501
2619
  reasoning: "推理强度",
2502
2620
  effortAuto: "自动",
2621
+ effortFaster: "更快",
2622
+ effortSmarter: "更聪明",
2503
2623
  efforts: {
2504
2624
  minimal: "最低",
2505
2625
  low: "低",
@@ -2608,10 +2728,6 @@ const zhTW = {
2608
2728
  },
2609
2729
  slide: {
2610
2730
  resizeSidePanel: "調整側欄寬度",
2611
- agentConnected: "Agent 已連線",
2612
- agentConnectedTooltip: "目前的 slide 與 Inspector 選擇會即時同步給 agent。",
2613
- agentDisconnected: "Agent 已斷線",
2614
- agentDisconnectedTooltip: "已和 dev server 斷線,agent 沒辦法再看到你目前的 slide 或 Inspector 選擇。請重新啟動 dev server 來恢復連線。",
2615
2731
  home: "首頁",
2616
2732
  backToHome: "返回首頁",
2617
2733
  download: "下載",
@@ -2709,7 +2825,6 @@ const zhTW = {
2709
2825
  previewMode: "預覽",
2710
2826
  closeFormatPanel: "關閉格式面板",
2711
2827
  editText: "在投影片上編輯",
2712
- emptySelectionTitle: "選取一個物件",
2713
2828
  emptySelectionHint: "按一下物件即可調整格式。按兩下文字即可編輯。",
2714
2829
  textSelectionHint: "格式將套用至選取的文字。",
2715
2830
  elementText: "文字",
@@ -2719,6 +2834,27 @@ const zhTW = {
2719
2834
  rotateHandle: "旋轉元素",
2720
2835
  resizeHandle: "調整尺寸({handle})",
2721
2836
  arrangeSection: "排列",
2837
+ pageLabel: "第 {page} 頁,共 {total} 頁",
2838
+ pageBackground: "背景",
2839
+ pageBackgroundTheme: "跟隨主題",
2840
+ pageBackgroundShared: "多頁共用",
2841
+ pageBackgroundComplex: "漸層或圖片",
2842
+ pageTransition: "轉場",
2843
+ pageTransitionInherited: "沿用簡報預設",
2844
+ pageSteps: "逐步動畫",
2845
+ pageStepsCount: {
2846
+ one: "1 步",
2847
+ other: "{count} 步"
2848
+ },
2849
+ pageNone: "無",
2850
+ transitionKinds: {
2851
+ fade: "淡入淡出",
2852
+ slide: "推移",
2853
+ zoom: "縮放",
2854
+ wipe: "擦除",
2855
+ morph: "Morph",
2856
+ custom: "自訂"
2857
+ },
2722
2858
  selectionCount: "已選取 {count} 個元素",
2723
2859
  positionLabel: "位置",
2724
2860
  positionX: "水平位置",
@@ -2959,6 +3095,7 @@ const zhTW = {
2959
3095
  title: "匯出 PDF",
2960
3096
  processing: "處理第 {current} / {total} 頁",
2961
3097
  printing: "正在開啟列印對話框…",
3098
+ saving: "正在儲存 PDF…",
2962
3099
  done: "完成"
2963
3100
  },
2964
3101
  pptxToast: {
@@ -3037,9 +3174,6 @@ const zhTW = {
3037
3174
  },
3038
3175
  agent: {
3039
3176
  title: "Agent",
3040
- beta: "Beta",
3041
- betaTitle: "搶先體驗版",
3042
- betaHint: "回覆、編輯或工具呼叫偶爾可能失敗,或出現預期之外的結果。",
3043
3177
  open: "Agent",
3044
3178
  openTitle: "開啟 agent 面板",
3045
3179
  close: "關閉 agent 面板",
@@ -3084,11 +3218,25 @@ const zhTW = {
3084
3218
  deny: "拒絕",
3085
3219
  allowed: "已允許",
3086
3220
  denied: "已拒絕",
3087
- autoApprove: "自動核准",
3088
- autoApproveHint: "不詢問就執行指令。工作區內的檔案編輯一律允許。",
3089
- resultDone: "完成",
3090
- resultStopped: "已停止",
3091
- resultSeconds: "{seconds} 秒",
3221
+ permissionMode: "權限",
3222
+ permissionModes: {
3223
+ supervised: "監督",
3224
+ acceptEdits: "自動接受編輯",
3225
+ auto: "自動",
3226
+ fullAccess: "完整存取"
3227
+ },
3228
+ permissionHints: {
3229
+ supervised: "執行指令和修改檔案前都會詢問。",
3230
+ acceptEdits: "自動核准檔案編輯,其他動作仍可能詢問。",
3231
+ auto: "自動審查會核准例行動作,其餘的再詢問你。",
3232
+ fullAccess: "不經詢問直接執行指令和編輯。"
3233
+ },
3234
+ permissionHintsCodex: {
3235
+ supervised: "Codex 無法在執行中詢問,因此只會讀取並提出修改建議。",
3236
+ acceptEdits: "在工作區沙盒內編輯和執行指令。",
3237
+ auto: "在工作區沙盒內編輯和執行指令。",
3238
+ fullAccess: "不受沙盒限制地執行指令和編輯。"
3239
+ },
3092
3240
  errorEyebrow: "錯誤",
3093
3241
  statusLoading: "正在檢查 agent",
3094
3242
  disabled: "agent 面板已在 open-slide.config.ts 中停用。",
@@ -3129,6 +3277,8 @@ const zhTW = {
3129
3277
  modelDefault: "預設",
3130
3278
  reasoning: "推理強度",
3131
3279
  effortAuto: "自動",
3280
+ effortFaster: "更快",
3281
+ effortSmarter: "更聰明",
3132
3282
  efforts: {
3133
3283
  minimal: "最低",
3134
3284
  low: "低",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-slide/core",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "Runtime and CLI for open-slide — write slides in slides/, we handle the rest.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -67,7 +67,7 @@
67
67
  "dependencies": {
68
68
  "@babel/parser": "^7.29.2",
69
69
  "@babel/types": "^7.29.0",
70
- "@base-ui/react": "1.6.0",
70
+ "@base-ui/react": "1.9.0",
71
71
  "@dnd-kit/core": "^6.3.1",
72
72
  "@dnd-kit/sortable": "^10.0.0",
73
73
  "@dnd-kit/utilities": "^3.2.2",
@@ -79,7 +79,7 @@
79
79
  "clsx": "^2.1.1",
80
80
  "cmdk": "^1.1.1",
81
81
  "commander": "^15.0.0",
82
- "emoji-picker-react": "^4.19.1",
82
+ "emoji-picker-react": "^5.1.4",
83
83
  "fast-glob": "^3.3.2",
84
84
  "fflate": "^0.8.3",
85
85
  "html-to-image": "^1.11.13",
@@ -89,13 +89,12 @@
89
89
  "react-dom": "^19.2.8",
90
90
  "react-image-crop": "^11.0.10",
91
91
  "react-router-dom": "^7.18.4",
92
- "shadcn": "^4.21.4",
93
92
  "sonner": "^2.0.7",
94
93
  "tailwind-merge": "^3.5.0",
95
94
  "tailwindcss": "^4.3.3",
96
95
  "tw-animate-css": "^1.4.0",
97
96
  "use-sync-external-store": "^1.7.0",
98
- "vite": "^8.3.3"
97
+ "vite": "^8.3.7"
99
98
  },
100
99
  "devDependencies": {
101
100
  "@playwright/test": "~1.63.0",
@@ -1,5 +1,11 @@
1
1
  import path from 'node:path';
2
- import type { AgentEffort, AgentModelOption, AgentProviderId, AgentQuestion } from './types.ts';
2
+ import type {
3
+ AgentEffort,
4
+ AgentModelOption,
5
+ AgentPermissionMode,
6
+ AgentProviderId,
7
+ AgentQuestion,
8
+ } from './types.ts';
3
9
 
4
10
  export type ProviderEvent =
5
11
  | { type: 'session-id'; id: string }
@@ -29,6 +35,7 @@ export type ProviderRunOptions = {
29
35
  resumeAt: string | null;
30
36
  model: string | null;
31
37
  effort: AgentEffort | null;
38
+ permissionMode: AgentPermissionMode;
32
39
  signal: AbortSignal;
33
40
  emit: (event: ProviderEvent) => void;
34
41
  askUser: (questions: AgentQuestion[]) => Promise<Record<string, string> | null>;
@@ -6,6 +6,14 @@ export const AGENT_EFFORTS = ['minimal', 'low', 'medium', 'high', 'xhigh', 'max'
6
6
 
7
7
  export type AgentEffort = (typeof AGENT_EFFORTS)[number];
8
8
 
9
+ export const AGENT_PERMISSION_MODES = ['supervised', 'acceptEdits', 'auto', 'fullAccess'] as const;
10
+
11
+ export type AgentPermissionMode = (typeof AGENT_PERMISSION_MODES)[number];
12
+
13
+ export function isAgentPermissionMode(value: unknown): value is AgentPermissionMode {
14
+ return typeof value === 'string' && (AGENT_PERMISSION_MODES as readonly string[]).includes(value);
15
+ }
16
+
9
17
  export function isAgentProviderId(value: unknown): value is AgentProviderId {
10
18
  return typeof value === 'string' && (AGENT_PROVIDER_IDS as readonly string[]).includes(value);
11
19
  }
@@ -131,13 +139,20 @@ export type RespondPayload =
131
139
  | { allow: boolean }
132
140
  | { cancel: true };
133
141
 
134
- export type AgentStreamEvent =
142
+ export const AGENT_EVENT = 'open-slide:agent';
143
+
144
+ // `rev` numbers store events; a snapshot carries the rev it was taken at, so a
145
+ // client can tell which events it already includes.
146
+ export type AgentStreamEvent = (
135
147
  | { type: 'session'; session: AgentSessionSummary }
136
148
  | { type: 'session-removed'; sessionId: string }
137
149
  | { type: 'item'; sessionId: string; item: AgentItem }
138
150
  | { type: 'delta'; sessionId: string; itemId: string; text: string }
139
151
  | { type: 'truncate'; sessionId: string; itemId: string }
140
- | { type: 'slide-renamed'; from: string; to: string };
152
+ | { type: 'slide-renamed'; from: string; to: string }
153
+ ) & { rev?: number };
154
+
155
+ export type AgentSnapshot<T> = T & { rev: number };
141
156
 
142
157
  export function sessionSummary(session: AgentSession): AgentSessionSummary {
143
158
  const {
package/src/app/app.tsx CHANGED
@@ -2,6 +2,7 @@ import config from 'virtual:open-slide/config';
2
2
  import { BrowserRouter, Route, Routes } from 'react-router-dom';
3
3
  import { Toaster } from './components/ui/sonner';
4
4
  import { TooltipProvider } from './components/ui/tooltip';
5
+ import { DesktopBridge } from './lib/desktop';
5
6
  import { useLocale } from './lib/use-locale';
6
7
  import { AssetsPage } from './routes/assets';
7
8
  import { Home } from './routes/home';
@@ -33,6 +34,7 @@ export function App() {
33
34
  </Routes>
34
35
  </TooltipProvider>
35
36
  <Toaster />
37
+ <DesktopBridge />
36
38
  </BrowserRouter>
37
39
  );
38
40
  }
@@ -25,14 +25,11 @@ function splitFences(text: string): Segment[] {
25
25
  export function AgentMarkdown({ text }: { text: string }) {
26
26
  const segments = useMemo(() => splitFences(text), [text]);
27
27
  return (
28
- <div className="space-y-2 text-[12.5px] leading-[1.55] [&_ol]:my-1 [&_ul]:my-1">
28
+ <div className="agent-prose">
29
29
  {segments.map((segment, i) =>
30
30
  segment.type === 'code' ? (
31
- <pre
32
- // biome-ignore lint/suspicious/noArrayIndexKey: static parse output, never reordered
33
- key={i}
34
- className="overflow-x-auto rounded-[6px] border border-hairline bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-relaxed"
35
- >
31
+ // biome-ignore lint/suspicious/noArrayIndexKey: static parse output, never reordered
32
+ <pre key={i}>
36
33
  <code>{segment.code}</code>
37
34
  </pre>
38
35
  ) : (