@kortix/ui 0.15.8 → 0.15.9

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 (90) hide show
  1. package/dist/_vendor/kortix-shared.js +4 -1
  2. package/dist/access/access/access-dialog-share.js +12 -6
  3. package/dist/access/access/share-selection.d.ts +9 -0
  4. package/dist/access/access/share-selection.js +64 -0
  5. package/dist/customize/connectors/connector-identity.js +3 -3
  6. package/dist/customize/connectors/detail/app-page.js +2 -2
  7. package/dist/customize/connectors/detail/connector-accounts.d.ts +3 -1
  8. package/dist/customize/connectors/detail/connector-accounts.js +2 -2
  9. package/dist/customize/connectors/detail/connector-notice-view.d.ts +4 -0
  10. package/dist/customize/connectors/detail/connector-notice-view.js +4 -0
  11. package/dist/customize/connectors/detail/connector-notice.d.ts +31 -4
  12. package/dist/customize/connectors/detail/connector-notice.js +23 -4
  13. package/dist/customize/connectors/detail/connector-page.js +27 -7
  14. package/dist/customize/connectors/detail/connector-status.d.ts +12 -1
  15. package/dist/customize/connectors/detail/connector-status.js +11 -0
  16. package/dist/customize/connectors/detail/status-badge.d.ts +3 -3
  17. package/dist/customize/connectors/detail/status-badge.js +2 -1
  18. package/dist/customize/connectors/detail/use-connector-detail.js +10 -2
  19. package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.d.ts +13 -0
  20. package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.js +29 -0
  21. package/dist/customize/providers/provider-accordion.js +5 -4
  22. package/dist/customize/providers/provider-connect.js +3 -1
  23. package/dist/customize/providers/provider-sheet.js +9 -4
  24. package/dist/customize/sections/component/email-connect-form.js +4 -2
  25. package/dist/customize/sections/connectors-view.d.ts +4 -1
  26. package/dist/customize/sections/connectors-view.js +42 -7
  27. package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
  28. package/dist/customize/sections/view/account-secret-resources-panel.js +44 -5
  29. package/dist/customize/sections/view/secret-delivery.d.ts +9 -2
  30. package/dist/customize/sections/view/secret-delivery.js +14 -4
  31. package/dist/customize/sections/view/secrets-view.js +21 -5
  32. package/dist/customize/triggers/schedule/schedule-builder.js +1 -1
  33. package/dist/customize/triggers/schedule/schedule-copy.js +4 -0
  34. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +14 -3
  35. package/dist/customize/triggers/schedule/then-fields.d.ts +3 -1
  36. package/dist/customize/triggers/schedule/then-fields.js +8 -4
  37. package/dist/customize/triggers/schedule/trigger-composer.js +1 -1
  38. package/dist/customize/triggers/schedule/trigger-list.d.ts +3 -1
  39. package/dist/customize/triggers/schedule/trigger-list.js +18 -2
  40. package/dist/customize/triggers/schedule/trigger-runs-logic.js +4 -2
  41. package/dist/customize/triggers/schedule/trigger-runs-panel.js +4 -1
  42. package/dist/files/renderers/pptx-renderer.js +5 -20
  43. package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +3 -2
  44. package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +23 -304
  45. package/dist/files/renderers/presentation/presentation-export-menu.d.ts +14 -0
  46. package/dist/files/renderers/presentation/presentation-export-menu.js +44 -0
  47. package/dist/files/renderers/presentation/presentation-utils.d.ts +1 -0
  48. package/dist/files/renderers/presentation/presentation-utils.js +4 -0
  49. package/dist/files/renderers/presentation/slide-iframe.d.ts +23 -0
  50. package/dist/files/renderers/presentation/slide-iframe.js +61 -0
  51. package/dist/files/renderers/presentation/use-presentation-metadata.d.ts +39 -0
  52. package/dist/files/renderers/presentation/use-presentation-metadata.js +137 -0
  53. package/dist/files/renderers/presentation/use-slide-navigation.d.ts +17 -0
  54. package/dist/files/renderers/presentation/use-slide-navigation.js +82 -0
  55. package/dist/files/renderers/shared/use-stage-fit-scale.d.ts +19 -0
  56. package/dist/files/renderers/shared/use-stage-fit-scale.js +41 -0
  57. package/dist/files/renderers/show-content-renderer.js +16 -11
  58. package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +4 -13
  59. package/dist/files/renderers/xlsx/xlsx-renderer.js +6 -63
  60. package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +4 -2
  61. package/dist/files/renderers/xlsx/xlsx-viewer.js +28 -34
  62. package/dist/files/viewer/file-content-renderer.js +1 -4
  63. package/dist/files/viewer/use-file-content-state.js +10 -9
  64. package/dist/i18n/en.d.ts +48 -0
  65. package/dist/i18n/en.js +51 -3
  66. package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
  67. package/dist/internal/chrome/use-chrome-offered.js +4 -2
  68. package/dist/internal/hooks/connectors/use-finish-sign-in.d.ts +13 -0
  69. package/dist/internal/hooks/connectors/use-finish-sign-in.js +33 -0
  70. package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +6 -1
  71. package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +6 -1
  72. package/dist/internal/lib/error-handler.js +33 -0
  73. package/dist/internal/lib/trigger-clock.d.ts +7 -2
  74. package/dist/internal/lib/trigger-clock.js +17 -3
  75. package/dist/lib/z-stack.d.ts +5 -1
  76. package/dist/lib/z-stack.js +12 -2
  77. package/dist/session/models/model-connection-gate.js +16 -3
  78. package/dist/session/models/model-picker-panel.js +6 -2
  79. package/dist/session/models/provider-key-action.d.ts +10 -0
  80. package/dist/session/models/provider-key-action.js +35 -0
  81. package/dist/session/models/provider-key-slot.d.ts +9 -0
  82. package/dist/session/models/provider-key-slot.js +19 -0
  83. package/dist/session/prompts/session-connect-prompt.d.ts +40 -0
  84. package/dist/session/prompts/session-connect-prompt.js +126 -0
  85. package/dist/session/status/session-error-banner.d.ts +1 -1
  86. package/dist/session/status/session-error-banner.js +12 -4
  87. package/dist/session/thread/session-chat.js +7 -2
  88. package/dist/session/thread/transcript.js +31 -7
  89. package/dist/test-utils/intl.d.ts +48 -0
  90. package/package.json +3 -3
@@ -132,10 +132,7 @@ export function FileContentRenderer({ filePath, showHeader = true, headerSlot, h
132
132
  !isSandboxWaking &&
133
133
  (sharedImagePath && !isNotFound ? (
134
134
  // An image never shows the read's raw error text (R38).
135
- _jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx(ImageUnavailable, { onRetry: retrySharedImage }) })) : errorFallback ? (errorFallback(contentError, filePath)) : isNotFound ? (_jsx(FileNotFoundState, { filePath: filePath })) : (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center", children: [_jsx("div", { className: "bg-destructive/10 flex h-12 w-12 items-center justify-center rounded-sm", children: _jsx(FileWarning, { className: "text-destructive/50 h-6 w-6" }) }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line692JsxTextFailedToLoadFile') }), _jsx("p", { className: "text-muted-foreground/50 max-w-sm font-mono text-xs break-all", children: filePath }), _jsx("p", { className: "text-muted-foreground/60 max-w-sm text-xs", children: contentError })] }))), !isLoading && !error && imageDataUrl && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: imageDataUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isHeicImage && (blobLoading || heicConverting) && _jsx(RendererFallback, {}), isHeicImage && !blobLoading && !blobError && heicImageUrl && !heicConverting && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: heicImageUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isContentReady && fileCategory === 'pdf' && fileContent?.content && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PdfRenderer, { fileContent: fileContent.content, fileName: fileName, className: "h-full", fitOnOpen: fitOnOpen, findText: findText, showDownload: false }) })), isContentReady && fileCategory === 'docx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(DocxRenderer, { blob: rawBlob, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'zip' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ZipRenderer, { blob: rawBlob, fileName: fileName, className: "h-full" }, filePath) })), !isLoading && !error && !isNotFound && fileCategory === 'xlsx' && (!bytesOnly || blobUrl) && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(XlsxRenderer, {
136
- // A bytes-only source hands the workbook over as a blob URL;
137
- // the renderer reads a sandbox path only for a session.
138
- filePath: bytesOnly ? blobUrl : filePath, fileName: fileName, className: "h-full", showDownload: false }, `xlsx-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && !isNotFound && fileCategory === 'sqlite' && (!bytesOnly || rawBlob) && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(SqliteRenderer, { filePath: filePath, fileName: fileName, className: "h-full", readOnly: readOnly, ...(bytesOnly ? { bytes: rawBlob, onSave: saveThroughSource } : {}) }, `sqlite-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && csvAsTable && fileContent && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(CsvRenderer, { content: fileContent.content, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'video' && blobUrl && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(VideoRenderer, { url: blobUrl, className: "h-full" }) })), isContentReady && fileCategory === 'audio' && blobUrl && (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-5 p-8", children: [_jsx("div", { className: "bg-muted/50 flex h-14 w-14 items-center justify-center rounded-sm", children: _jsxs("svg", { className: "text-muted-foreground/40 h-6 w-6", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [_jsx("path", { d: "M9 18V5l12-2v13" }), _jsx("circle", { cx: "6", cy: "18", r: "3" }), _jsx("circle", { cx: "18", cy: "16", r: "3" })] }) }), _jsx("p", { className: "text-muted-foreground/60 text-sm", children: fileName }), _jsx("audio", { controls: true, src: blobUrl, className: "w-full max-w-sm" })] })), isContentReady && fileCategory === 'pptx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PptxRenderer, { blob: rawBlob, binaryUrl: blobUrl, filePath: filePath, fileName: fileName, className: "h-full", onDownload: handleDownload }) })), isHtmlFile && isHtmlPreview && (_jsx(HtmlPreview, { path: toSandboxAbsolutePath(filePath), reloadKey: `${fetchRevision}-${reloadKey}`, fileName: fileName, pendingLabel: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line805JsxTextStartingPreviewServer') }, `html-preview-${filePath}`)), isHtmlFile && !isHtmlPreview && !isLoading && !error && fileContent?.type === 'text' && (_jsx(CodeEditor, { editorClassName: codeEditorEditorClassName, ...codeEditorProps, className: readOnly ? 'min-h-full' : 'h-full' }, `html-source-${filePath}-${discardKey}`)), !isLoading &&
135
+ _jsx("div", { className: "flex h-full items-center justify-center p-8", children: _jsx(ImageUnavailable, { onRetry: retrySharedImage }) })) : errorFallback ? (errorFallback(contentError, filePath)) : isNotFound ? (_jsx(FileNotFoundState, { filePath: filePath })) : (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center", children: [_jsx("div", { className: "bg-destructive/10 flex h-12 w-12 items-center justify-center rounded-sm", children: _jsx(FileWarning, { className: "text-destructive/50 h-6 w-6" }) }), _jsx("p", { className: "text-muted-foreground text-sm font-medium", children: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line692JsxTextFailedToLoadFile') }), _jsx("p", { className: "text-muted-foreground/50 max-w-sm font-mono text-xs break-all", children: filePath }), _jsx("p", { className: "text-muted-foreground/60 max-w-sm text-xs", children: contentError })] }))), !isLoading && !error && imageDataUrl && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: imageDataUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isHeicImage && (blobLoading || heicConverting) && _jsx(RendererFallback, {}), isHeicImage && !blobLoading && !blobError && heicImageUrl && !heicConverting && (_jsx(CaptionedImage, { caption: caption, open: captionOpen, onOpenChange: onCaptionOpenChange, children: _jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ImageRenderer, { url: heicImageUrl, className: "h-full", fileName: fileName, controls: imageControls, info: imageInfo }) }) })), isContentReady && fileCategory === 'pdf' && fileContent?.content && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PdfRenderer, { fileContent: fileContent.content, fileName: fileName, className: "h-full", fitOnOpen: fitOnOpen, findText: findText, showDownload: false }) })), isContentReady && fileCategory === 'docx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(DocxRenderer, { blob: rawBlob, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'zip' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(ZipRenderer, { blob: rawBlob, fileName: fileName, className: "h-full" }, filePath) })), isContentReady && fileCategory === 'xlsx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(XlsxRenderer, { blob: rawBlob, fileName: fileName, className: "h-full", showDownload: false }, `xlsx-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && !isNotFound && fileCategory === 'sqlite' && (!bytesOnly || rawBlob) && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(SqliteRenderer, { filePath: filePath, fileName: fileName, className: "h-full", readOnly: readOnly, ...(bytesOnly ? { bytes: rawBlob, onSave: saveThroughSource } : {}) }, `sqlite-${filePath}-${contentRevision}-${reloadKey}`) })), !isLoading && !error && csvAsTable && fileContent && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(CsvRenderer, { content: fileContent.content, fileName: fileName, className: "h-full", showDownload: false }) })), isContentReady && fileCategory === 'video' && blobUrl && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(VideoRenderer, { url: blobUrl, className: "h-full" }) })), isContentReady && fileCategory === 'audio' && blobUrl && (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-5 p-8", children: [_jsx("div", { className: "bg-muted/50 flex h-14 w-14 items-center justify-center rounded-sm", children: _jsxs("svg", { className: "text-muted-foreground/40 h-6 w-6", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [_jsx("path", { d: "M9 18V5l12-2v13" }), _jsx("circle", { cx: "6", cy: "18", r: "3" }), _jsx("circle", { cx: "18", cy: "16", r: "3" })] }) }), _jsx("p", { className: "text-muted-foreground/60 text-sm", children: fileName }), _jsx("audio", { controls: true, src: blobUrl, className: "w-full max-w-sm" })] })), isContentReady && fileCategory === 'pptx' && rawBlob && (_jsx(Suspense, { fallback: _jsx(RendererFallback, {}), children: _jsx(PptxRenderer, { blob: rawBlob, binaryUrl: blobUrl, filePath: filePath, fileName: fileName, className: "h-full", onDownload: handleDownload }) })), isHtmlFile && isHtmlPreview && (_jsx(HtmlPreview, { path: toSandboxAbsolutePath(filePath), reloadKey: `${fetchRevision}-${reloadKey}`, fileName: fileName, pendingLabel: tHardcodedUi.raw('featuresFilesComponentsFileContentRenderer.line805JsxTextStartingPreviewServer') }, `html-preview-${filePath}`)), isHtmlFile && !isHtmlPreview && !isLoading && !error && fileContent?.type === 'text' && (_jsx(CodeEditor, { editorClassName: codeEditorEditorClassName, ...codeEditorProps, className: readOnly ? 'min-h-full' : 'h-full' }, `html-source-${filePath}-${discardKey}`)), !isLoading &&
139
136
  !error &&
140
137
  fileContent &&
141
138
  fileContent.type === 'binary' &&
@@ -12,7 +12,7 @@ import { getFileCategory, getLanguageFromExt } from './preview-policy.js';
12
12
  import { usePreviewFit } from './preview-fit.js';
13
13
  import { useContentRevision } from './use-content-revision.js';
14
14
  /** Categories that need a blob fetched via readFileAsBlob */
15
- const BLOB_CATEGORIES = ['docx', 'video', 'audio', 'pptx', 'zip'];
15
+ const BLOB_CATEGORIES = ['docx', 'video', 'audio', 'pptx', 'zip', 'xlsx'];
16
16
  function isImageMime(mimeType) {
17
17
  return !!mimeType && mimeType.startsWith('image/');
18
18
  }
@@ -66,9 +66,10 @@ export function useFileContentState({ filePath, onUnsavedChange, onSaved, readOn
66
66
  const sharedImageSha = useFileCaption(filePath)?.sha256;
67
67
  const sharedImage = (source.useSharedImage ?? noSharedImage)(sharedImagePath, sharedImageSha);
68
68
  const { data: fileContent, isLoading, error, refetch, dataUpdatedAt, } = useFileContent(isHeicImage || isZipArchive || sharedImagePath ? null : filePath);
69
- // The agent's turn end refetches this file. The xlsx and sqlite renderers
70
- // read their own bytes, so they remount only when the content really
71
- // changed (structural sharing keeps the reference otherwise). The HTML frame
69
+ // The agent's turn end refetches this file. The sqlite renderer still
70
+ // reads its own bytes, and the xlsx renderer re-parses the blob its parent
71
+ // passes, so both remount only when the content really changed
72
+ // (structural sharing keeps the reference otherwise). The HTML frame
72
73
  // reloads on every refetch: its stylesheets can change while its markup
73
74
  // does not. Neither moves on the first load.
74
75
  const contentRevision = useContentRevision(fileContent);
@@ -129,12 +130,12 @@ export function useFileContentState({ filePath, onUnsavedChange, onSaved, readOn
129
130
  const fileDiagnostics = useMemo(() => findDiagnosticsForFile(diagByFile, filePath), [diagByFile, filePath]);
130
131
  const fileDiagErrorCount = useMemo(() => fileDiagnostics?.filter((d) => d.severity === 1).length ?? 0, [fileDiagnostics]);
131
132
  const fileDiagWarningCount = useMemo(() => fileDiagnostics?.filter((d) => d.severity === 2).length ?? 0, [fileDiagnostics]);
132
- // Binary blob for DOCX, video, audio, PPTX — AND HEIC images.
133
+ // Binary blob for DOCX, video, audio, PPTX, XLSX — AND HEIC images.
133
134
  // PDFs intentionally use /file/content base64 so PdfRenderer can create a Blob URL from the string.
134
- // A bytes-only source (the project's Files) also serves the spreadsheet and
135
- // SQLite bytes: those renderers would otherwise read a sandbox path, and
136
- // there is no sandbox behind Files.
137
- const readsOwnBytes = fileCategory === 'xlsx' || fileCategory === 'sqlite';
135
+ // A bytes-only source (the project's Files) also serves the SQLite bytes:
136
+ // that renderer would otherwise read a sandbox path, and there is no
137
+ // sandbox behind Files.
138
+ const readsOwnBytes = fileCategory === 'sqlite';
138
139
  const blobPath = isBlobCategory(fileCategory) || isHeicImage || (source.bytesOnly && readsOwnBytes) ? filePath : null;
139
140
  const { blobUrl, blob: rawBlob, isLoading: binaryLoading, error: binaryError, } = useBinaryBlob(blobPath);
140
141
  const blobLoading = sharedImagePath ? sharedImage.loading : binaryLoading;
package/dist/i18n/en.d.ts CHANGED
@@ -98,6 +98,14 @@ declare const catalog: {
98
98
  access: string;
99
99
  actions: string;
100
100
  coolingDown: string;
101
+ keyVerified: string;
102
+ keyInvalid: string;
103
+ keyUnchecked: string;
104
+ checkKey: string;
105
+ savedVerified: string;
106
+ savedInvalid: string;
107
+ checkError: string;
108
+ openProviderInModels: string;
101
109
  member: string;
102
110
  members: string;
103
111
  actionsFor: string;
@@ -170,6 +178,9 @@ declare const catalog: {
170
178
  claudeReconnectDescription: string;
171
179
  claudeAccountLabelPlaceholder: string;
172
180
  claudeDeleteAccountConfirmTitle: string;
181
+ sharedOnlyYouDescription: string;
182
+ oauthOnlyYouDescription: string;
183
+ claudeOauthOnlyYouDescription: string;
173
184
  };
174
185
  secrets: {
175
186
  undecryptable: {
@@ -1488,6 +1499,10 @@ declare const catalog: {
1488
1499
  connectModel: string;
1489
1500
  imagesUnsupported: string;
1490
1501
  imagesUnsupportedHint: string;
1502
+ noModelUpgradeReason: string;
1503
+ noModelKeyReason: string;
1504
+ noModelUpgradePlan: string;
1505
+ noModelAddProviderKey: string;
1491
1506
  };
1492
1507
  providerRecovery: {
1493
1508
  savedPrompt: string;
@@ -2693,6 +2708,8 @@ declare const catalog: {
2693
2708
  checkConnection: string;
2694
2709
  };
2695
2710
  i18nComplete: {
2711
+ noModelAddProviderKey: string;
2712
+ noModelUpgradePlan: string;
2696
2713
  text03217276a5f1: string;
2697
2714
  text0b6a47661327: string;
2698
2715
  text1a9030082a20: string;
@@ -6834,6 +6851,12 @@ declare const catalog: {
6834
6851
  noticeSignInTitle: string;
6835
6852
  noticeSignInBody: string;
6836
6853
  noticeSignInAction: string;
6854
+ noticeSignInAgainTitle: string;
6855
+ noticeSignInAgainBody: string;
6856
+ noticeNoToolsTitle: string;
6857
+ noticeNoToolsBody: string;
6858
+ noticeAddRoutesAction: string;
6859
+ statusNoTools: string;
6837
6860
  connectAccount: string;
6838
6861
  notSignedIn: string;
6839
6862
  credentialRejected: string;
@@ -7851,6 +7874,12 @@ declare const catalog: {
7851
7874
  triggerAutoPause: {
7852
7875
  title: string;
7853
7876
  description: string;
7877
+ billingTitle: string;
7878
+ billingDescription: string;
7879
+ modelTitle: string;
7880
+ modelDescription: string;
7881
+ listBilling: string;
7882
+ listModel: string;
7854
7883
  };
7855
7884
  featureGate: {
7856
7885
  enable: string;
@@ -10083,5 +10112,24 @@ declare const catalog: {
10083
10112
  capWorkspace: string;
10084
10113
  capMember: string;
10085
10114
  };
10115
+ connectSignIn: {
10116
+ openSignIn: string;
10117
+ checkingTitle: string;
10118
+ checkingDescription: string;
10119
+ signInUnfinished: string;
10120
+ finishSignIn: string;
10121
+ signInFinished: string;
10122
+ cardHeadline: string;
10123
+ cardTitle: string;
10124
+ cardShared: string;
10125
+ cardPrivate: string;
10126
+ signingIn: string;
10127
+ connectedAs: string;
10128
+ connected: string;
10129
+ connect: string;
10130
+ cardFailed: string;
10131
+ blockedTitle: string;
10132
+ blockedDescription: string;
10133
+ };
10086
10134
  };
10087
10135
  export default catalog;
package/dist/i18n/en.js CHANGED
@@ -99,6 +99,14 @@ const catalog = {
99
99
  "access": "Access",
100
100
  "actions": "Actions",
101
101
  "coolingDown": "Cooling down",
102
+ "keyVerified": "Verified: {provider} accepted this key",
103
+ "keyInvalid": "{provider} refused this key: {message}",
104
+ "keyUnchecked": "Not verified: {message}",
105
+ "checkKey": "Check again",
106
+ "savedVerified": "Key saved and verified",
107
+ "savedInvalid": "Key saved, but {provider} refused it: {message}",
108
+ "checkError": "The key could not be checked",
109
+ "openProviderInModels": "Open {provider} in Models",
102
110
  "member": "member",
103
111
  "members": "members",
104
112
  "actionsFor": "Actions for {label}",
@@ -170,7 +178,10 @@ const catalog = {
170
178
  "claudeConnectFailed": "The Claude sign-in did not finish. Try again.",
171
179
  "claudeReconnectDescription": "Sign in with Claude again. The account keeps its name, access, and session selections.",
172
180
  "claudeAccountLabelPlaceholder": "e.g. My Claude account",
173
- "claudeDeleteAccountConfirmTitle": "Delete this Claude account for everyone?"
181
+ "claudeDeleteAccountConfirmTitle": "Delete this Claude account for everyone?",
182
+ "sharedOnlyYouDescription": "Add API keys, ChatGPT accounts and Claude accounts. Only you can use the ones you add. A workspace manager can share one. Choose which ones each session uses.",
183
+ "oauthOnlyYouDescription": "Use your ChatGPT Plus or Pro plan in this workspace. Only you can use the accounts you add.",
184
+ "claudeOauthOnlyYouDescription": "Use your Claude Pro or Max plan for Claude models in this workspace. Only you can use the accounts you add."
174
185
  },
175
186
  "secrets": {
176
187
  "undecryptable": {
@@ -1488,7 +1499,11 @@ const catalog = {
1488
1499
  "claudePlan": "Pro or Max plan",
1489
1500
  "connectModel": "Connect model",
1490
1501
  "imagesUnsupported": "{model} can’t read images",
1491
- "imagesUnsupportedHint": "remove them or pick another model"
1502
+ "imagesUnsupportedHint": "remove them or pick another model",
1503
+ "noModelUpgradeReason": "No model: upgrade to the Credits plan or add your own provider key.",
1504
+ "noModelKeyReason": "No model: add your own provider key.",
1505
+ "noModelUpgradePlan": "Upgrade plan",
1506
+ "noModelAddProviderKey": "Add provider key"
1492
1507
  },
1493
1508
  "providerRecovery": {
1494
1509
  "savedPrompt": "Saved prompt",
@@ -2694,6 +2709,8 @@ const catalog = {
2694
2709
  "checkConnection": "Check your connection, then retry."
2695
2710
  },
2696
2711
  "i18nComplete": {
2712
+ "noModelAddProviderKey": "Add provider key",
2713
+ "noModelUpgradePlan": "Upgrade plan",
2697
2714
  "text03217276a5f1": "Balance {value0} credits",
2698
2715
  "text0b6a47661327": "Unknown owner",
2699
2716
  "text1a9030082a20": "Create skill",
@@ -6835,6 +6852,12 @@ const catalog = {
6835
6852
  "noticeSignInTitle": "Sign in to {name}",
6836
6853
  "noticeSignInBody": "Kortix added {name}. Finish signing in so agents can use its tools.",
6837
6854
  "noticeSignInAction": "Sign in",
6855
+ "noticeSignInAgainTitle": "Sign in to {name} again",
6856
+ "noticeSignInAgainBody": "Its sign-in expired or was revoked. Agents cannot use {name} until you sign in again.",
6857
+ "noticeNoToolsTitle": "{name} has no tools",
6858
+ "noticeNoToolsBody": "It has no routes, so agents have nothing to call. Add routes to its routes spec in Settings.",
6859
+ "noticeAddRoutesAction": "Add routes",
6860
+ "statusNoTools": "No tools",
6838
6861
  "connectAccount": "Connect",
6839
6862
  "notSignedIn": "Not signed in",
6840
6863
  "credentialRejected": "Credential rejected: replace it",
@@ -7851,7 +7874,13 @@ const catalog = {
7851
7874
  },
7852
7875
  "triggerAutoPause": {
7853
7876
  "title": "Paused automatically",
7854
- "description": "It stopped starting runs for the reason below. Fix the cause, then resume it."
7877
+ "description": "It stopped starting runs for the reason below. Fix the cause, then resume it.",
7878
+ "billingTitle": "Paused: out of credits",
7879
+ "billingDescription": "No run can be paid for, so it stopped starting runs. It resumes by itself a few minutes after the wallet is topped up.",
7880
+ "modelTitle": "Paused: no model to run on",
7881
+ "modelDescription": "Automations use only model keys and accounts shared with the whole workspace, and none is usable. It resumes by itself a few minutes after you add one in Models.",
7882
+ "listBilling": "No credits",
7883
+ "listModel": "No model"
7855
7884
  },
7856
7885
  "featureGate": {
7857
7886
  "enable": "Enable {name}",
@@ -10083,6 +10112,25 @@ const catalog = {
10083
10112
  "gatewayBudgets": {
10084
10113
  "capWorkspace": "Cap gateway spend for this workspace.",
10085
10114
  "capMember": "Cap gateway spend for {who}."
10115
+ },
10116
+ "connectSignIn": {
10117
+ "openSignIn": "Open {app} sign-in",
10118
+ "checkingTitle": "Finishing sign-in",
10119
+ "checkingDescription": "Kortix checks your {app} sign-in. This page updates by itself.",
10120
+ "signInUnfinished": "Sign-in not finished",
10121
+ "finishSignIn": "Finish sign-in",
10122
+ "signInFinished": "Sign-in finished",
10123
+ "cardHeadline": "Your agent needs you to sign in",
10124
+ "cardTitle": "Connect {app}",
10125
+ "cardShared": "Shared with the workspace",
10126
+ "cardPrivate": "Only you",
10127
+ "signingIn": "Finish signing in to {app} in the window that opened.",
10128
+ "connectedAs": "Connected as {account}",
10129
+ "connected": "Connected",
10130
+ "connect": "Connect",
10131
+ "cardFailed": "Could not connect {app}. Try again.",
10132
+ "blockedTitle": "Open {app} to sign in",
10133
+ "blockedDescription": "Your browser blocked the sign-in window. Open it with the button below. This page updates by itself."
10086
10134
  }
10087
10135
  };
10088
10136
  export default catalog;
@@ -5,7 +5,8 @@
5
5
  * no sidebar row and no card in Apps and extensions. Off on every deployment
6
6
  * until launch: the probe below logged a 404 in the console on staging and
7
7
  * prod, where the API's KORTIX_CHROME_ENABLED is off. Set true to bring the
8
- * surfaces back where the API serves the routes.
8
+ * surfaces back where the API serves the routes. The value is
9
+ * `CHROME_LAUNCHED`, which the API and the CLI read too.
9
10
  */
10
11
  export declare const CHROME_UI_ENABLED = false;
11
12
  /**
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { listChromeConnections } from '@kortix/sdk';
3
3
  import { chromeKeys } from '@kortix/sdk/react';
4
+ import { CHROME_LAUNCHED } from '../../_vendor/kortix-shared.js';
4
5
  import { useQuery } from '@tanstack/react-query';
5
6
  /**
6
7
  * The web app's master switch for Kortix in Chrome. Off, no surface renders
@@ -8,9 +9,10 @@ import { useQuery } from '@tanstack/react-query';
8
9
  * no sidebar row and no card in Apps and extensions. Off on every deployment
9
10
  * until launch: the probe below logged a 404 in the console on staging and
10
11
  * prod, where the API's KORTIX_CHROME_ENABLED is off. Set true to bring the
11
- * surfaces back where the API serves the routes.
12
+ * surfaces back where the API serves the routes. The value is
13
+ * `CHROME_LAUNCHED`, which the API and the CLI read too.
12
14
  */
13
- export const CHROME_UI_ENABLED = false;
15
+ export const CHROME_UI_ENABLED = CHROME_LAUNCHED;
14
16
  /**
15
17
  * Whether this platform offers Kortix in Chrome at all. The API answers 404
16
18
  * on /v1/chrome/* where KORTIX_CHROME_ENABLED is off (staging, prod), so the
@@ -0,0 +1,13 @@
1
+ /** @internal Kortix apps only. No semver: it may change in any release. */
2
+ import { type Connection } from '@kortix/sdk';
3
+ /**
4
+ * Finish the sign-in of one account whose sign-in started and never finished
5
+ * (an agent's link the person used outside Kortix, an abandoned window).
6
+ *
7
+ * The window opens inside the click. The first request asks the provider: a
8
+ * sign-in that already finished there is recorded and the window closes. Only
9
+ * an unfinished one goes on to a new sign-in page for the same account.
10
+ */
11
+ export declare function useFinishSignIn(projectId: string, slug: string, onConnected: () => void): import("@tanstack/react-query").UseMutationResult<{
12
+ connected: true;
13
+ }, Error, Pick<Connection, "owner_type" | "connection_id">, unknown>;
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+ import { connectionSignInSteps } from '@kortix/sdk';
3
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
4
+ import { invalidateConnections } from '../../../customize/connectors/invalidate-connections.js';
5
+ import { useTranslations } from '../../../i18n/index.js';
6
+ import { errorToast, successToast } from '../../../primitives/toast.js';
7
+ import { runConnectLinkFlow } from './use-connect-link.js';
8
+ /**
9
+ * Finish the sign-in of one account whose sign-in started and never finished
10
+ * (an agent's link the person used outside Kortix, an abandoned window).
11
+ *
12
+ * The window opens inside the click. The first request asks the provider: a
13
+ * sign-in that already finished there is recorded and the window closes. Only
14
+ * an unfinished one goes on to a new sign-in page for the same account.
15
+ */
16
+ export function useFinishSignIn(projectId, slug, onConnected) {
17
+ const t = useTranslations('connectSignIn');
18
+ const queryClient = useQueryClient();
19
+ return useMutation({
20
+ mutationFn: async (account) => {
21
+ const steps = connectionSignInSteps(projectId, slug, account);
22
+ return runConnectLinkFlow(steps.start, steps.finalize);
23
+ },
24
+ onSuccess: () => {
25
+ successToast(t('signInFinished'));
26
+ onConnected();
27
+ },
28
+ onError: (error) => errorToast(error.message),
29
+ // Settled either way: a window closed before the provider answered still
30
+ // left the account row, and every list must show it without a reload.
31
+ onSettled: () => invalidateConnections(queryClient, projectId),
32
+ });
33
+ }
@@ -1,5 +1,6 @@
1
1
  'use client';
2
- import { useMutation } from '@tanstack/react-query';
2
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
3
+ import { invalidateConnections } from '../../../customize/connectors/invalidate-connections.js';
3
4
  import { useTranslations } from '../../../i18n/index.js';
4
5
  import { errorToast, successToast } from '../../../primitives/toast.js';
5
6
  import { runConnectLinkFlow } from './use-connect-link.js';
@@ -9,6 +10,7 @@ import { pipedreamConnectConnection, pipedreamFinalizeConnection, reconcileMembe
9
10
  */
10
11
  export function usePipedreamConnectMember(projectId, slug, onConnected) {
11
12
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
13
+ const queryClient = useQueryClient();
12
14
  return useMutation({
13
15
  mutationFn: async (input) => {
14
16
  let connectionId = null;
@@ -34,5 +36,8 @@ export function usePipedreamConnectMember(projectId, slug, onConnected) {
34
36
  onConnected();
35
37
  },
36
38
  onError: (err) => errorToast(err.message),
39
+ // Settled either way: a window closed before the provider answered still
40
+ // left the account row, and every list must show it without a reload.
41
+ onSettled: () => invalidateConnections(queryClient, projectId),
37
42
  });
38
43
  }
@@ -1,5 +1,6 @@
1
1
  'use client';
2
- import { useMutation } from '@tanstack/react-query';
2
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
3
+ import { invalidateConnections } from '../../../customize/connectors/invalidate-connections.js';
3
4
  import { useTranslations } from '../../../i18n/index.js';
4
5
  import { errorToast, successToast } from '../../../primitives/toast.js';
5
6
  import { runConnectLinkFlow } from './use-connect-link.js';
@@ -11,6 +12,7 @@ export { DEFAULT_PROJECT_CONNECTION_LABEL, isSharedDefaultConnectConflict, proje
11
12
  */
12
13
  export function usePipedreamConnectProject(projectId, slug, onConnected) {
13
14
  const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
15
+ const queryClient = useQueryClient();
14
16
  return useMutation({
15
17
  mutationFn: async (input) => {
16
18
  const steps = projectConnectSteps(projectId, slug, input?.label, sdkProjectConnectDeps, input?.beforeAuthorize);
@@ -24,5 +26,8 @@ export function usePipedreamConnectProject(projectId, slug, onConnected) {
24
26
  onConnected();
25
27
  },
26
28
  onError: (error) => errorToast(error.message),
29
+ // Settled either way: a window closed before the provider answered still
30
+ // left the account row, and every list must show it without a reload.
31
+ onSettled: () => invalidateConnections(queryClient, projectId),
27
32
  });
28
33
  }
@@ -3,6 +3,8 @@ import { isGitMirrorUnavailableNoiseMessage, isServerDeadlineNoiseMessage, } fro
3
3
  import { isSilentTimeoutError } from './timeout-toast-policy.js';
4
4
  import { openAccountSettings } from '../stores/account-settings-modal-store.js';
5
5
  import { useUpgradeDialogStore } from '../stores/upgrade-dialog-store.js';
6
+ import { projectIdFromPathname } from '../stores/project-switch-store.js';
7
+ import { capabilityTabHref } from './capability-tab-routes.js';
6
8
  import { BillingError, formatBillingErrorForUI, isBillingError } from '@kortix/sdk/react';
7
9
  import { platformConfig } from '@kortix/sdk';
8
10
  import { captureException } from '../../lib/telemetry.js';
@@ -218,6 +220,37 @@ export const handleApiError = (error, context, tI18nComplete) => {
218
220
  // billing 402s. Scopes the upgrade dialog so a non-billing member sees the
219
221
  // team's gated CTA, not their own primary account. Absent → primary account.
220
222
  const v2AccountId = typeof v2Detail?.account_id === 'string' ? v2Detail.account_id : undefined;
223
+ // Session create refused because no model can run (409 `no_model_available`):
224
+ // a Free account sees no Kortix model (managed models are Credits-plan
225
+ // only) and has no provider key. Say so with both ways out, instead of a
226
+ // composer that reads "No model" with Send disabled and no reason.
227
+ if (v2Code === 'no_model_available') {
228
+ if (!context?.silent) {
229
+ const projectId = typeof window === 'undefined' ? null : projectIdFromPathname(window.location.pathname);
230
+ const actions = [
231
+ ...(platformConfig().billingEnabled
232
+ ? [{
233
+ label: tI18nComplete('noModelUpgradePlan'),
234
+ onClick: () => useUpgradeDialogStore.getState().openUpgradeDialog({
235
+ reason: 'subscription_required',
236
+ accountId: v2AccountId,
237
+ }),
238
+ }]
239
+ : []),
240
+ {
241
+ label: tI18nComplete('noModelAddProviderKey'),
242
+ onClick: () => {
243
+ if (!projectId || typeof window === 'undefined')
244
+ return;
245
+ // Next.js syncs its router with native pushState (see openAccountPanel).
246
+ window.history.pushState(null, '', capabilityTabHref(projectId, 'models'));
247
+ },
248
+ },
249
+ ];
250
+ errorToast(v2Message ?? errorMessage, { actions, duration: 10000 });
251
+ }
252
+ return;
253
+ }
221
254
  // Marketplace imports can use either a paid managed model or a provider
222
255
  // key. Preserve the server's remedy instead of swallowing this BillingError
223
256
  // or sending an already-paid customer to the plan picker.
@@ -38,8 +38,13 @@ export declare const CLOCK_TONE: {
38
38
  readonly dot: "bg-kortix-yellow";
39
39
  };
40
40
  };
41
- /** "2d ago", "9h ago", "3w ago" in the viewer's locale, or "Never run". */
42
- export declare function lastRunLabel(trigger: Pick<ProjectTrigger, 'last_fired_at' | 'event'>, t: UiTranslator, locale: string, now?: number): string;
41
+ /**
42
+ * "2d ago", "9h ago", "3w ago" in the viewer's locale, or "Never run". A failed
43
+ * attempt newer than the last fire reads "Failed · 5m ago": a failed fire does
44
+ * not advance `last_fired_at` (the scheduler retries it), so a trigger whose
45
+ * every attempt failed read "Never run".
46
+ */
47
+ export declare function lastRunLabel(trigger: Pick<ProjectTrigger, 'last_fired_at' | 'event'> & Partial<Pick<ProjectTrigger, 'last_status' | 'last_attempt_at'>>, t: UiTranslator, locale: string, now?: number): string;
43
48
  /**
44
49
  * A future run in whole minutes, hours or days, worded by `rtf`: "in 25m"
45
50
  * (narrow), "in 25 minutes" (long). A past time reads as now; "—" with no time.
@@ -14,12 +14,26 @@ export const CLOCK_TONE = {
14
14
  pending: YELLOW,
15
15
  paused: YELLOW,
16
16
  };
17
- /** "2d ago", "9h ago", "3w ago" in the viewer's locale, or "Never run". */
17
+ /**
18
+ * "2d ago", "9h ago", "3w ago" in the viewer's locale, or "Never run". A failed
19
+ * attempt newer than the last fire reads "Failed · 5m ago": a failed fire does
20
+ * not advance `last_fired_at` (the scheduler retries it), so a trigger whose
21
+ * every attempt failed read "Never run".
22
+ */
18
23
  export function lastRunLabel(trigger, t, locale, now = Date.now()) {
19
24
  const iso = trigger.last_fired_at ?? trigger.event?.last_event_at ?? null;
20
- const at = iso ? Date.parse(iso) : Number.NaN;
21
- if (!Number.isFinite(at))
25
+ const fired = iso ? Date.parse(iso) : Number.NaN;
26
+ const attempted = trigger.last_attempt_at ? Date.parse(trigger.last_attempt_at) : Number.NaN;
27
+ if (trigger.last_status === 'failed' &&
28
+ Number.isFinite(attempted) &&
29
+ !(Number.isFinite(fired) && fired >= attempted)) {
30
+ return `${t.raw('text031a8f0f659d')} · ${ago(attempted, locale, now)}`;
31
+ }
32
+ if (!Number.isFinite(fired))
22
33
  return t.raw('text3d40a69d3160');
34
+ return ago(fired, locale, now);
35
+ }
36
+ function ago(at, locale, now) {
23
37
  const rtf = new Intl.RelativeTimeFormat(locale, { style: 'narrow', numeric: 'auto' });
24
38
  const min = Math.floor(Math.max(0, now - at) / 60_000);
25
39
  if (min < 1)
@@ -58,5 +58,9 @@ export declare function hasOpenNestedDialog(): boolean;
58
58
  * `floatingZ(0)`, above every top-level dialog, so a popover still open when
59
59
  * one of those opens would float over it; popovers use this to step aside.
60
60
  */
61
- export declare function foreignDialogOpen(panel: HTMLElement | null): boolean;
61
+ export declare function foreignDialogOpen(panel: HTMLElement | null,
62
+ /** Dialogs open before the panel opened (its host modal): never foreign. */
63
+ except?: ReadonlySet<Element>): boolean;
64
+ /** Every open dialog and alert dialog in the document. */
65
+ export declare function openDialogs(): HTMLElement[];
62
66
  export {};
@@ -134,10 +134,20 @@ export function hasOpenNestedDialog() {
134
134
  * `floatingZ(0)`, above every top-level dialog, so a popover still open when
135
135
  * one of those opens would float over it; popovers use this to step aside.
136
136
  */
137
- export function foreignDialogOpen(panel) {
138
- for (const dialog of document.querySelectorAll('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]')) {
137
+ export function foreignDialogOpen(panel,
138
+ /** Dialogs open before the panel opened (its host modal): never foreign. */
139
+ except) {
140
+ for (const dialog of openDialogs()) {
141
+ if (except?.has(dialog))
142
+ continue;
139
143
  if (!panel || (dialog !== panel && !panel.contains(dialog) && !dialog.contains(panel)))
140
144
  return true;
141
145
  }
142
146
  return false;
143
147
  }
148
+ /** Every open dialog and alert dialog in the document. */
149
+ export function openDialogs() {
150
+ return [
151
+ ...document.querySelectorAll('[role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]'),
152
+ ];
153
+ }
@@ -1,10 +1,12 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { ImageBrokenIcon } from '@phosphor-icons/react';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { CreditCardIcon, ImageBrokenIcon, KeyIcon } from '@phosphor-icons/react';
4
4
  import { AnimatePresence, m, useReducedMotion } from 'motion/react';
5
5
  import { useState } from 'react';
6
6
  import { useTranslations } from '../../i18n/index.js';
7
+ import { Button } from '../../primitives/button.js';
7
8
  import { ConnectPlanRows } from './subscription-offer.js';
9
+ import { useModelConnectionGate } from './use-model-connection-gate.js';
8
10
  // Enter waits a beat (delay) so the composer paints first, then the bar slides
9
11
  // out from under it — height opens the space while the strip translates down,
10
12
  // same spring on both so they move as one surface. Exit runs faster than enter
@@ -24,7 +26,18 @@ const BAR_EXIT = { type: 'spring', duration: 0.35, bounce: 0 };
24
26
  * `show` must only flip on settled data (see `entitlementsPending`).
25
27
  */
26
28
  export function ModelConnectionBar({ show }) {
27
- return show ? _jsx(ConnectPlanRows, { dismissible: false, className: "mt-4" }) : null;
29
+ return show ? (_jsxs("div", { className: "mt-4 flex flex-col gap-1", children: [_jsx(NoModelReason, {}), _jsx(ConnectPlanRows, { dismissible: false })] })) : null;
30
+ }
31
+ /**
32
+ * Why Send is disabled, and the two ways out. A Free account sees no Kortix
33
+ * model (managed models are Credits-plan only) even with credits bought, so
34
+ * the composer said "No model" and gave no reason. The same sentence answers a
35
+ * session create refused with `no_model_available` (error-handler.tsx).
36
+ */
37
+ function NoModelReason() {
38
+ const t = useTranslations('sessionUi.modelGate');
39
+ const { canConnectProvider, openConnectProvider, openUpgrade, showUpgradeOption, modal } = useModelConnectionGate();
40
+ return (_jsxs(_Fragment, { children: [modal, _jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-2 py-1 pr-3.5 pl-2.5", "data-testid": "no-model-reason", children: [_jsx("span", { className: "text-muted-foreground min-w-0 flex-1 text-xs", children: showUpgradeOption ? t('noModelUpgradeReason') : t('noModelKeyReason') }), showUpgradeOption ? (_jsxs(Button, { type: "button", size: "xs", onClick: openUpgrade, children: [_jsx(CreditCardIcon, { className: "size-3.5" }), t('noModelUpgradePlan')] })) : null, canConnectProvider ? (_jsxs(Button, { type: "button", size: "xs", variant: showUpgradeOption ? 'outline' : 'default', onClick: () => openConnectProvider('providers'), children: [_jsx(KeyIcon, { className: "size-3.5" }), t('noModelAddProviderKey')] })) : null] })] }));
28
41
  }
29
42
  /**
30
43
  * One line under the card when the selected model cannot read an attached image
@@ -6,7 +6,7 @@ import { useTranslations } from '../../i18n/index.js';
6
6
  import { MODEL_SELECTOR_PROVIDER_IDS, ProviderLogo } from '../../internal/lib/provider-branding.js';
7
7
  import { cn } from '../../lib/utils.js';
8
8
  import { SolidCheckIcon } from '../../internal/icons/solid-check-icon.js';
9
- import { foreignDialogOpen } from '../../lib/z-stack.js';
9
+ import { foreignDialogOpen, openDialogs } from '../../lib/z-stack.js';
10
10
  import { Button } from '../../primitives/button.js';
11
11
  import { CommandGroup, CommandInput, CommandItem, CommandList } from '../../primitives/command.js';
12
12
  import Hint from '../../primitives/hint.js';
@@ -64,8 +64,12 @@ export function ModelPickerPanel({ browseModels, pickableModels, searchModels, s
64
64
  useEffect(() => {
65
65
  if (!onForeignDialog)
66
66
  return;
67
+ // A dialog already open when the picker opens is its host (the trigger
68
+ // composer, a settings modal), not one that opened over it. Counting it
69
+ // closed the picker ~60 ms after every open inside a modal.
70
+ const host = new Set(openDialogs());
67
71
  const check = () => {
68
- if (foreignDialogOpen(rootRef.current))
72
+ if (foreignDialogOpen(rootRef.current, host))
69
73
  onForeignDialog();
70
74
  };
71
75
  const observer = new MutationObserver(check);
@@ -0,0 +1,10 @@
1
+ import type { GatewayErrorDetails } from '@kortix/sdk';
2
+ /**
3
+ * The provider whose key a failed turn needs fixed in Models → Providers, or
4
+ * null. A resolution error names no provider (`provider: ''`), so the routed
5
+ * model names it. A Kortix-managed model (no provider prefix) never needs a key.
6
+ */
7
+ export declare function providerKeyFix(details: Pick<GatewayErrorDetails, 'code' | 'provider' | 'requestedModel' | 'resolvedModel' | 'upstreamStatus'> | null | undefined): {
8
+ providerId: string;
9
+ code: string;
10
+ } | null;