@jini-ai/ui 0.7.3-next.2 → 0.7.3-next.3

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 (281) hide show
  1. package/README.md +3 -3
  2. package/dist/browser/index.d.ts +2 -0
  3. package/dist/browser/index.js +2 -0
  4. package/dist/browser/mount-renderer.d.ts +33 -0
  5. package/dist/browser/mount-renderer.js +14 -0
  6. package/dist/browser/useDismissibleDropdown.d.ts +50 -0
  7. package/dist/browser/useDismissibleDropdown.js +49 -0
  8. package/dist/core.d.ts +4 -4
  9. package/dist/core.js +4 -1
  10. package/dist/features/admin-widgets/components/InfoTip.js +5 -5
  11. package/dist/features/admin-widgets/components/InfoTip.rules.d.ts +1 -1
  12. package/dist/features/admin-widgets/components/InfoTip.rules.js +1 -1
  13. package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -3
  14. package/dist/features/admin-widgets/components/Select/Select.js +7 -7
  15. package/dist/features/app-shell/SiteToast.d.ts +24 -0
  16. package/dist/features/app-shell/SiteToast.js +9 -0
  17. package/dist/features/app-shell/copyable-details.d.ts +12 -0
  18. package/dist/features/app-shell/copyable-details.js +17 -0
  19. package/dist/features/app-shell/expanded-mode.d.ts +76 -0
  20. package/dist/features/app-shell/expanded-mode.js +70 -0
  21. package/dist/features/app-shell/index.d.ts +8 -0
  22. package/dist/features/app-shell/index.js +8 -0
  23. package/dist/features/app-shell/use-delete-confirmation.hooks.d.ts +48 -0
  24. package/dist/features/app-shell/use-delete-confirmation.hooks.js +57 -0
  25. package/dist/features/app-shell/use-expanded-mode.hooks.d.ts +19 -0
  26. package/dist/features/app-shell/use-expanded-mode.hooks.js +39 -0
  27. package/dist/features/app-shell/use-site-toast.hooks.d.ts +56 -0
  28. package/dist/features/app-shell/use-site-toast.hooks.js +44 -0
  29. package/dist/features/app-shell/use-theme-preference.hooks.d.ts +30 -0
  30. package/dist/features/app-shell/use-theme-preference.hooks.js +42 -0
  31. package/dist/features/app-version/use-app-version.d.ts +53 -0
  32. package/dist/features/app-version/use-app-version.js +42 -0
  33. package/dist/features/asset-grid/react/components/AssetGrid.d.ts +1 -1
  34. package/dist/features/asset-grid/react/components/AssetGrid.js +1 -1
  35. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.d.ts +1 -1
  36. package/dist/features/asset-grid/react/components/DeleteConfirmDialog.js +1 -1
  37. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.d.ts +2 -2
  38. package/dist/features/asset-tree-browser/react/components/AssetTreeBrowser.js +1 -1
  39. package/dist/features/asset-tree-browser/react/components/FilePreviewPane.d.ts +1 -1
  40. package/dist/features/browser-chrome/react/components/BrowserViewportControls.d.ts +1 -1
  41. package/dist/features/browser-chrome/react/components/BrowserViewportControls.js +1 -1
  42. package/dist/features/charts/table.js +4 -4
  43. package/dist/features/command-palette/index.d.ts +1 -0
  44. package/dist/features/command-palette/index.js +1 -0
  45. package/dist/features/command-palette/react/components/CommandPalette.d.ts +9 -9
  46. package/dist/features/command-palette/react/components/CommandPalette.hooks.js +28 -1
  47. package/dist/features/command-palette/react/components/CommandPalette.js +3 -5
  48. package/dist/features/connectors/ConnectorsBrowser.d.ts +1 -1
  49. package/dist/features/connectors/ConnectorsBrowser.js +2 -2
  50. package/dist/features/connectors/components/ConnectorCard.hooks.js +2 -2
  51. package/dist/features/connectors/components/ConnectorCard.js +4 -4
  52. package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +1 -1
  53. package/dist/features/connectors/components/ConnectorDetailDrawer.js +7 -7
  54. package/dist/features/connectors/components/ConnectorGrid.js +1 -1
  55. package/dist/features/connectors/components/ConnectorLogo.js +1 -1
  56. package/dist/features/connectors/components/ConnectorSearchBar.js +1 -1
  57. package/dist/features/connectors/components/ProviderTabBar.js +1 -1
  58. package/dist/features/execution/claude/env-fields.d.ts +1 -1
  59. package/dist/features/execution/codex/env-fields.d.ts +1 -1
  60. package/dist/features/execution/constants.d.ts +2 -2
  61. package/dist/features/execution/constants.js +1 -1
  62. package/dist/features/execution/dependencies.d.ts +2 -3
  63. package/dist/features/execution/http-adapter.d.ts +2 -3
  64. package/dist/features/execution/index.d.ts +0 -2
  65. package/dist/features/execution/react/components/AgentCliEnvFields.d.ts +1 -1
  66. package/dist/features/execution/react/components/AgentDiagnosticRow.d.ts +1 -1
  67. package/dist/features/execution/react/components/AgentDiagnosticRow.js +3 -1
  68. package/dist/features/execution/react/components/ByokProviderForm.d.ts +10 -2
  69. package/dist/features/execution/react/components/ByokProviderForm.hooks.d.ts +2 -2
  70. package/dist/features/execution/react/components/ByokProviderForm.js +15 -4
  71. package/dist/features/execution/react/components/ExecutionTab.d.ts +2 -3
  72. package/dist/features/execution/react/components/ExecutionTab.hooks.d.ts +14 -4
  73. package/dist/features/execution/react/components/ExecutionTab.hooks.js +66 -9
  74. package/dist/features/execution/react/components/ExecutionTab.js +27 -10
  75. package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -4
  76. package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -4
  77. package/dist/features/execution/react/components/LocalCliAgentList.hooks.d.ts +3 -3
  78. package/dist/features/execution/react/components/LocalCliAgentSettings.d.ts +2 -2
  79. package/dist/features/execution/react/components/ProviderChipGroup.d.ts +1 -1
  80. package/dist/features/execution/react/components/SearchableModelSelect.d.ts +1 -1
  81. package/dist/features/execution/react/hooks/use-byok-field-validation.hooks.d.ts +2 -2
  82. package/dist/features/execution/react/hooks/use-execution-credential.hooks.d.ts +1 -1
  83. package/dist/features/execution/react/hooks/useExecutionTab.d.ts +2 -3
  84. package/dist/features/execution/react/hooks/useLocalCliAgentCard.d.ts +4 -4
  85. package/dist/features/execution/react/hooks/useLocalCliAgentList.d.ts +4 -4
  86. package/dist/features/execution/react/hooks/useReasoningControl.d.ts +3 -3
  87. package/dist/features/execution/rules.d.ts +6 -6
  88. package/dist/features/execution/rules.js +1 -1
  89. package/dist/features/external-mcp/react/components/ExternalMcpTab.js +4 -4
  90. package/dist/features/file-dropzone/react/components/FileDropzone.d.ts +1 -1
  91. package/dist/features/file-dropzone/react/components/FileDropzone.js +1 -1
  92. package/dist/features/find/find-bar-state.d.ts +58 -0
  93. package/dist/features/find/find-bar-state.js +45 -0
  94. package/dist/features/find/find-focus-clock.d.ts +19 -0
  95. package/dist/features/find/find-focus-clock.js +9 -0
  96. package/dist/features/find/find-input-focus.d.ts +88 -0
  97. package/dist/features/find/find-input-focus.js +88 -0
  98. package/dist/features/find/find-target.d.ts +141 -0
  99. package/dist/features/find/find-target.js +160 -0
  100. package/dist/features/find/index.d.ts +10 -0
  101. package/dist/features/find/index.js +10 -0
  102. package/dist/features/find/use-find-bar-effects.hooks.d.ts +14 -0
  103. package/dist/features/find/use-find-bar-effects.hooks.js +92 -0
  104. package/dist/features/find/use-find-bar-state.hooks.d.ts +43 -0
  105. package/dist/features/find/use-find-bar-state.hooks.js +49 -0
  106. package/dist/features/find/use-find-focus-reclaim.hooks.d.ts +21 -0
  107. package/dist/features/find/use-find-focus-reclaim.hooks.js +64 -0
  108. package/dist/features/find/use-find-input-binding.hooks.d.ts +18 -0
  109. package/dist/features/find/use-find-input-binding.hooks.js +76 -0
  110. package/dist/features/find-bar/FindBar.d.ts +41 -0
  111. package/dist/features/find-bar/FindBar.js +31 -0
  112. package/dist/features/find-bar/index.d.ts +2 -0
  113. package/dist/features/find-bar/index.js +2 -0
  114. package/dist/features/folder-path-drop/index.d.ts +3 -1
  115. package/dist/features/folder-path-drop/index.js +1 -0
  116. package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.d.ts +50 -0
  117. package/dist/features/folder-path-drop/react/hooks/useClassifiedPathDrop.js +50 -0
  118. package/dist/features/folder-path-drop/types.d.ts +14 -0
  119. package/dist/features/i18n/context.d.ts +1 -1
  120. package/dist/features/i18n/context.js +1 -1
  121. package/dist/features/iframe-pool/react/dom-sync.d.ts +13 -3
  122. package/dist/features/iframe-pool/react/dom-sync.js +7 -7
  123. package/dist/features/import-handoff/use-import-handoff.d.ts +38 -0
  124. package/dist/features/import-handoff/use-import-handoff.js +40 -0
  125. package/dist/features/integrations/rules.js +39 -41
  126. package/dist/features/interactive-ui/interactive-ui.css +1 -1
  127. package/dist/features/interactive-ui/providers/native/data-table.js +1 -1
  128. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +1 -1
  129. package/dist/features/interactive-ui/providers/shadcn/data-table.js +3 -3
  130. package/dist/features/interactive-ui/providers/shadcn/radio-group-field.js +1 -1
  131. package/dist/features/live-views/index.d.ts +6 -0
  132. package/dist/features/live-views/index.js +6 -0
  133. package/dist/features/live-views/use-live-views.d.ts +31 -0
  134. package/dist/features/live-views/use-live-views.js +88 -0
  135. package/dist/features/live-views/use-site-view-preference.d.ts +33 -0
  136. package/dist/features/live-views/use-site-view-preference.js +32 -0
  137. package/dist/features/live-views/use-webview-load-failure.d.ts +90 -0
  138. package/dist/features/live-views/use-webview-load-failure.js +122 -0
  139. package/dist/features/mcp-ui/credential-card.d.ts +1 -0
  140. package/dist/features/mcp-ui/credential-card.js +1 -1
  141. package/dist/features/mcp-ui/surfaces/tool-approval.d.ts +10 -0
  142. package/dist/features/mcp-ui/surfaces/tool-approval.js +15 -0
  143. package/dist/features/media-providers/dependencies.d.ts +7 -1
  144. package/dist/features/media-providers/dependencies.js +43 -0
  145. package/dist/features/media-providers/index.d.ts +2 -2
  146. package/dist/features/media-providers/index.js +1 -1
  147. package/dist/features/media-providers/ports.d.ts +39 -5
  148. package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -3
  149. package/dist/features/media-providers/react/components/MediaProvidersTab.js +1 -1
  150. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.d.ts +3 -2
  151. package/dist/features/media-providers/react/hooks/useMediaProvidersTab.js +41 -3
  152. package/dist/features/memory/react/components/MemoryConnectedPanel.js +2 -2
  153. package/dist/features/memory/react/components/MemoryEntryCard.js +1 -1
  154. package/dist/features/memory/react/components/MemoryHooksPanel.js +2 -2
  155. package/dist/features/memory/react/components/MemoryList.js +2 -2
  156. package/dist/features/memory/react/components/MemorySettingsPanel.js +2 -2
  157. package/dist/features/memory/react/components/MemorySuggestionPanel.js +1 -1
  158. package/dist/features/memory/react/hooks/useMemoryConnectors.hooks.js +3 -3
  159. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.d.ts +4 -1
  160. package/dist/features/memory/react/hooks/useMemoryConnectors.rules.js +1 -1
  161. package/dist/features/memory/react/render-markdown.js +1 -1
  162. package/dist/features/nav-availability/nav-availability.d.ts +18 -0
  163. package/dist/features/nav-availability/nav-availability.js +12 -0
  164. package/dist/features/number-stepper/NumberStepper.d.ts +39 -0
  165. package/dist/features/number-stepper/NumberStepper.js +16 -0
  166. package/dist/features/number-stepper/index.d.ts +5 -0
  167. package/dist/features/number-stepper/index.js +5 -0
  168. package/dist/features/number-stepper/number-stepper.d.ts +34 -0
  169. package/dist/features/number-stepper/number-stepper.js +32 -0
  170. package/dist/features/number-stepper/use-number-stepper.hooks.d.ts +20 -0
  171. package/dist/features/number-stepper/use-number-stepper.hooks.js +29 -0
  172. package/dist/features/number-stepper/use-optimistic-number-setting.hooks.d.ts +36 -0
  173. package/dist/features/number-stepper/use-optimistic-number-setting.hooks.js +25 -0
  174. package/dist/features/panel-kit/ErrorNotice.js +8 -1
  175. package/dist/features/panel-kit/helpers/standing-draft-local-backup.d.ts +1 -1
  176. package/dist/features/panel-kit/helpers/standing-draft-recovery-message.d.ts +1 -1
  177. package/dist/features/panel-kit/hooks/use-standing-draft-autosave.hooks.d.ts +1 -37
  178. package/dist/features/panel-kit/hooks/use-standing-draft-recovery.hooks.d.ts +2 -1
  179. package/dist/features/panel-kit/hooks/use-standing-draft-state.hooks.d.ts +2 -1
  180. package/dist/features/panel-kit/hooks/use-standing-draft-writes.hooks.d.ts +2 -1
  181. package/dist/features/panel-kit/index.d.ts +2 -1
  182. package/dist/features/privacy/react/components/PrivacyTab.d.ts +1 -1
  183. package/dist/features/privacy/react/components/PrivacyTab.js +1 -1
  184. package/dist/features/progress-card/components/ProgressCard.d.ts +1 -1
  185. package/dist/features/progress-card/components/ProgressCard.js +1 -1
  186. package/dist/features/resource-dashboard/react/components/ResourceBoard.d.ts +1 -1
  187. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.d.ts +1 -1
  188. package/dist/features/resource-dashboard/react/components/ResourceBoardToolbar.js +1 -1
  189. package/dist/features/resource-dashboard/react/components/ResourceCardParts.d.ts +1 -1
  190. package/dist/features/resource-dashboard/react/components/ResourceCardParts.js +7 -2
  191. package/dist/features/resource-dashboard/react/components/ResourceRowListView.d.ts +1 -1
  192. package/dist/features/resource-dashboard/react/components/ResourceRowListView.js +1 -1
  193. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.d.ts +1 -1
  194. package/dist/features/resource-dashboard/react/components/ResourceRunHistoryList.js +1 -1
  195. package/dist/features/resource-dashboard/react/components/StatusPill.d.ts +1 -1
  196. package/dist/features/resource-dashboard/react/components/StatusPill.js +1 -1
  197. package/dist/features/resource-dashboard/react/hooks/useResourceBoard.js +6 -1
  198. package/dist/features/resource-monitor/ResourceTable.d.ts +67 -0
  199. package/dist/features/resource-monitor/ResourceTable.js +25 -0
  200. package/dist/features/resource-monitor/index.d.ts +4 -0
  201. package/dist/features/resource-monitor/index.js +4 -0
  202. package/dist/features/resource-monitor/resource-stop.d.ts +16 -0
  203. package/dist/features/resource-monitor/resource-stop.js +11 -0
  204. package/dist/features/resource-monitor/use-resource-readings.hooks.d.ts +44 -0
  205. package/dist/features/resource-monitor/use-resource-readings.hooks.js +91 -0
  206. package/dist/features/settings/dialog/styles/settings-dialog.css +251 -251
  207. package/dist/features/site-card/index.d.ts +4 -1
  208. package/dist/features/site-card/index.js +3 -0
  209. package/dist/features/site-card/use-created-site-return.hooks.d.ts +36 -0
  210. package/dist/features/site-card/use-created-site-return.hooks.js +43 -0
  211. package/dist/features/site-card/use-site-card-preview.hooks.d.ts +39 -0
  212. package/dist/features/site-card/use-site-card-preview.hooks.js +31 -0
  213. package/dist/features/site-card/use-site-list-prefs.hooks.d.ts +29 -8
  214. package/dist/features/site-card/use-site-list-prefs.hooks.js +56 -9
  215. package/dist/features/site-card/use-site-preview.hooks.d.ts +67 -0
  216. package/dist/features/site-card/use-site-preview.hooks.js +94 -0
  217. package/dist/features/sketch-editor/react/components/SketchEditor.d.ts +2 -2
  218. package/dist/features/sketch-editor/react/components/SketchEditor.js +1 -1
  219. package/dist/features/skills/react/components/SkillRow.js +1 -1
  220. package/dist/features/source-config-list/react/components/SourceConfigAddForm.js +2 -2
  221. package/dist/features/source-config-list/react/components/SourceConfigField.js +1 -1
  222. package/dist/features/source-config-list/react/components/SourceConfigItemCard.js +5 -5
  223. package/dist/features/source-config-list/react/components/SourceConfigList.d.ts +1 -1
  224. package/dist/features/source-config-list/react/components/SourceConfigList.js +1 -1
  225. package/dist/features/source-config-list/react/components/SourceConfigListView.js +3 -3
  226. package/dist/features/source-config-list/react/components/SourceConfigTestControl.d.ts +1 -1
  227. package/dist/features/source-config-list/react/components/SourceConfigTestControl.js +1 -1
  228. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.d.ts +1 -1
  229. package/dist/features/tab-launcher-menu/react/components/TabLauncherMenu.js +1 -1
  230. package/dist/features/tab-strip/react/components/TabBar.js +2 -2
  231. package/dist/features/tab-strip/react/components/TabStrip.d.ts +1 -1
  232. package/dist/features/tab-strip/react/components/TabStrip.js +1 -1
  233. package/dist/features/tab-strip/scrollable.js +0 -2
  234. package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
  235. package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
  236. package/dist/features/version-manager/react/components/VersionManagerModal.d.ts +1 -1
  237. package/dist/features/version-manager/react/components/VersionManagerModal.js +1 -1
  238. package/dist/features/viewer-shell/react/components/CommentSidePanel.d.ts +2 -2
  239. package/dist/features/viewer-shell/react/components/CommentSidePanel.js +1 -1
  240. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.d.ts +1 -1
  241. package/dist/features/viewer-shell/react/components/MarkdownSplitPane.js +1 -1
  242. package/dist/features/viewer-shell/react/components/SegmentedToggle.d.ts +1 -1
  243. package/dist/features/viewer-shell/react/components/SegmentedToggle.js +1 -1
  244. package/dist/features/viewer-shell/react/components/ViewportSwitcher.d.ts +1 -1
  245. package/dist/features/viewer-shell/react/components/ViewportSwitcher.js +1 -1
  246. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.d.ts +1 -1
  247. package/dist/features/viewer-shell/react/components/ViewportToggleGroup.js +1 -1
  248. package/dist/features/zoom/use-zoom.d.ts +141 -0
  249. package/dist/features/zoom/use-zoom.js +204 -0
  250. package/dist/index.d.ts +1 -0
  251. package/dist/index.js +1 -0
  252. package/dist/react/components/ComponentKitPreview.d.ts +1 -1
  253. package/dist/react/components/ComponentKitPreview.js +1 -1
  254. package/dist/react/components/CustomSelect.js +1 -1
  255. package/dist/react/components/ExportDiagnosticsButton.d.ts +6 -2
  256. package/dist/react/components/ExportDiagnosticsButton.js +3 -3
  257. package/dist/react/components/FileImportPanel.js +1 -1
  258. package/dist/react/components/IconFrame.d.ts +15 -0
  259. package/dist/react/components/IconFrame.js +11 -0
  260. package/dist/react/components/ImportChoice.js +1 -1
  261. package/dist/react/components/Notice.js +1 -1
  262. package/dist/react/components/OnboardingDropdown.js +1 -1
  263. package/dist/react/components/PaletteTweaks.js +1 -1
  264. package/dist/react/components/TooltipLayer.d.ts +13 -3
  265. package/dist/react/components/TooltipLayer.js +12 -12
  266. package/dist/react/mcp-ui/host-message-source.d.ts +3 -1
  267. package/dist/react/mcp-ui/host-message-source.js +1 -1
  268. package/dist/react/testing.js +3 -1
  269. package/dist/renderers/annotation-canvas/rules.js +30 -27
  270. package/dist/renderers/react/components/ArtifactView.js +1 -1
  271. package/dist/renderers/renderers/markdown.d.ts +3 -1
  272. package/dist/renderers/renderers/markdown.js +2 -2
  273. package/dist/styles/admin.css +54 -54
  274. package/dist/utils/zip.js +43 -36
  275. package/package.json +66 -9
  276. package/dist/features/execution/ports.d.ts +0 -71
  277. package/dist/features/execution/ports.js +0 -2
  278. package/dist/features/execution/types.d.ts +0 -472
  279. package/dist/features/execution/types.js +0 -2
  280. package/dist/react/components/CustomSelectMarkup.d.ts +0 -27
  281. package/dist/react/components/CustomSelectMarkup.js +0 -35
@@ -1,8 +1,48 @@
1
- import { useEffect } from 'react';
2
- import { groupPresets, isProviderConfigured, nextConfigForModeChange, nextConfigForPresetSelect, resolveSelectedPreset } from '../../rules.js';
1
+ import { useCallback, useEffect, useState } from 'react';
2
+ import { groupPresets, isProviderConfigured, isValidApiBaseUrl, nextConfigForModeChange, nextConfigForPresetSelect, resolveSelectedPreset } from '../../rules.js';
3
3
  import { useExecutionTab } from '../hooks/useExecutionTab.js';
4
+ /** One approval slot per provider/protocol pair; JSON keeps `null` (Custom) distinct from any id. */
5
+ function endpointPairKey({ providerId, protocol }, _optional = {}) {
6
+ return JSON.stringify([providerId, protocol]);
7
+ }
8
+ /** The trimmed URL discovery may be approved for, or `null` when it is not a complete, allowed URL. */
9
+ function approvableBaseUrl({ baseUrl }, _optional = {}) {
10
+ const trimmed = baseUrl.trim();
11
+ return trimmed && isValidApiBaseUrl({ raw: trimmed }) ? trimmed : null;
12
+ }
13
+ /**
14
+ * B216: model discovery sends the provider key to the Base URL, so it may only go to a URL the
15
+ * operator explicitly committed (blur, Enter, a preset's own default, Test connection). A parseable
16
+ * URL and a pause do not establish intent: `https://api.ex` parses, and people pause mid-word. And
17
+ * preset selection can carry a draft across identities, so approval belongs to the exact provider,
18
+ * protocol and URL — never to "the identity changed". Holds URLs only; a key never enters this state.
19
+ */
20
+ function useEndpointApproval({ initial }, _optional = {}) {
21
+ // Seeding exception: the host's initial endpoint is the one the server already uses for runs, so
22
+ // approving it adds no new egress — even when an autosaving host persisted a half-typed value
23
+ // before a reload. Read once on mount only: never from `savedByProviderId`, never from a later
24
+ // prop rerender, either of which would turn an unreviewed URL into an approved one.
25
+ const [approved, setApproved] = useState(() => {
26
+ const seed = approvableBaseUrl(initial);
27
+ return new Map(seed === null ? [] : [[endpointPairKey(initial), seed]]);
28
+ });
29
+ const isBaseUrlApproved = useCallback(({ endpoint }) => {
30
+ const trimmed = endpoint.baseUrl.trim();
31
+ // Blank is the host's own default endpoint for every pair, not an operator-supplied destination.
32
+ return !trimmed || approved.get(endpointPairKey(endpoint)) === trimmed;
33
+ }, [approved]);
34
+ const commitBaseUrl = useCallback(({ endpoint }) => {
35
+ const url = approvableBaseUrl(endpoint);
36
+ if (url === null)
37
+ return;
38
+ const key = endpointPairKey(endpoint);
39
+ // Same pair and URL keeps the same Map, so React bails out and no discovery is re-scheduled.
40
+ setApproved((current) => (current.get(key) === url ? current : new Map(current).set(key, url)));
41
+ }, []);
42
+ return { isBaseUrlApproved, commitBaseUrl };
43
+ }
4
44
  /** Wire execution state and preserve the existing model-discovery triggers. */
5
- export function useExecutionTabView({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError }, _options = {}) {
45
+ export function useExecutionTabView({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError }, _optional = {}) {
6
46
  const tab = useExecutionTab({
7
47
  port,
8
48
  autoDetect: autoDetect && config.mode === 'local-cli',
@@ -18,7 +58,7 @@ export function useExecutionTabView({ config, onConfigChange, port, presets, aut
18
58
  */
19
59
  const hasApiKey = config.byok.apiKey.trim().length > 0;
20
60
  // Re-discover models whenever the selected endpoint changes (preset pick,
21
- // manual protocol switch, or a typed base URL settling on a new value), and
61
+ // manual protocol switch, or a Base URL the operator committed), and
22
62
  // once a key first becomes available (`hasApiKey`).
23
63
  //
24
64
  // Still deliberately NOT keyed on `apiKey`'s VALUE or on `model` — refetching
@@ -38,11 +78,19 @@ export function useExecutionTabView({ config, onConfigChange, port, presets, aut
38
78
  //
39
79
  // `canDiscoverModels` is read here but is deliberately not a dependency — see that prop's doc for why
40
80
  // its turning `true` on its own must never probe.
81
+ //
82
+ // Keyed on the APPROVED Base URL, never the typed one (B216): see `useEndpointApproval`. `null`
83
+ // while the current pair and URL are unapproved; the trimmed URL (blank for the host default)
84
+ // otherwise — and that trimmed value, not the raw input, is what the probe receives.
85
+ const { isBaseUrlApproved, commitBaseUrl } = useEndpointApproval({ initial: config.byok });
86
+ const approvedBaseUrl = isBaseUrlApproved({ endpoint: config.byok }) ? config.byok.baseUrl.trim() : null;
41
87
  useEffect(() => {
42
88
  if (config.mode !== 'byok' || typeof port.listModels !== 'function' || !canDiscoverModels)
43
89
  return;
44
- loadModels(config.byok);
45
- }, [config.mode, port, loadModels, config.byok.protocol, config.byok.baseUrl, config.byok.providerId, hasApiKey]);
90
+ if (approvedBaseUrl === null)
91
+ return;
92
+ loadModels({ ...config.byok, baseUrl: approvedBaseUrl });
93
+ }, [config.mode, port, loadModels, config.byok.protocol, approvedBaseUrl, config.byok.providerId, hasApiKey]);
46
94
  // All a turn to "cannot discover" does: drop the current result and any response still in flight —
47
95
  // e.g. one started before the host learned that its stored key belongs to another endpoint.
48
96
  useEffect(() => {
@@ -55,13 +103,22 @@ export function useExecutionTabView({ config, onConfigChange, port, presets, aut
55
103
  const setMode = (mode) => {
56
104
  onConfigChange(nextConfigForModeChange({ config, mode }));
57
105
  };
58
- return { tab, selectedPreset, setMode };
106
+ return { tab, selectedPreset, setMode, commitBaseUrl, isBaseUrlApproved };
59
107
  }
60
108
  /** Derive BYOK chip state and apply the selected preset through the existing rules. */
61
- export function useByokPane({ config, onConfigChange, presets, selectedPreset }, _options = {}) {
109
+ export function useByokPane({ config, onConfigChange, presets, selectedPreset, commitBaseUrl }, _options = {}) {
62
110
  const { protocols, gateways } = groupPresets({ presets });
63
111
  const configuredPresetIds = new Set(presets.filter((preset) => isProviderConfigured({ config: config.byok, preset })).map((preset) => preset.id));
64
- const selectPreset = (preset) => onConfigChange({ ...config, byok: nextConfigForPresetSelect({ config: config.byok, preset }) });
112
+ const selectPreset = (preset) => {
113
+ const next = nextConfigForPresetSelect({ config: config.byok, preset });
114
+ // A deliberate pick of a preset's OWN default endpoint is the operator choosing that endpoint.
115
+ // A carried Custom draft or a restored saved non-default URL is not; it stays unapproved unless
116
+ // that exact pair and URL were already approved.
117
+ if (!preset.custom && next.baseUrl.trim() === (preset.baseUrl ?? '').trim()) {
118
+ commitBaseUrl({ endpoint: { providerId: next.providerId, protocol: next.protocol, baseUrl: next.baseUrl } });
119
+ }
120
+ onConfigChange({ ...config, byok: next });
121
+ };
65
122
  const selectedPresetId = selectedPreset?.id ?? null;
66
123
  return { protocols, gateways, configuredPresetIds, selectPreset, selectedPresetId };
67
124
  }
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { agentHandleProps, agentSubHandle } from '@jini-ai/core/agent-handles';
3
3
  import { useT } from '../../../i18n/index.js';
4
4
  import { DEFAULT_AGENT_CLI_ENV_FIELDS } from '../../constants.js';
5
- import { nextConfigForAgentCliEnvChange, nextConfigForAgentModel, nextConfigForAgentReasoning, nextConfigForAgentSelect, selectedAgentModel, } from '../../rules.js';
5
+ import { isValidApiBaseUrl, nextConfigForAgentCliEnvChange, nextConfigForAgentModel, nextConfigForAgentReasoning, nextConfigForAgentSelect, selectedAgentModel, } from '../../rules.js';
6
6
  import { useByokPane, useExecutionTabView } from './ExecutionTab.hooks.js';
7
7
  import { ByokProviderForm } from './ByokProviderForm.js';
8
8
  import { LocalCliAgentList } from './LocalCliAgentList.js';
@@ -21,12 +21,12 @@ import { ProviderChipGroup } from './ProviderChipGroup.js';
21
21
  */
22
22
  export function ExecutionTab({ config, onConfigChange, port, presets = [], cliEnvFields = DEFAULT_AGENT_CLI_ENV_FIELDS, localCliUnavailableReason, renderAgentIcon, localCliScopeLabel, autoDetect = true, ariaLabel, apiKeyFooter, formFooter, apiKeyStoredExternally, apiKeyPlaceholder, canDiscoverModels = true, describeProbeError, agentHandle, useTHook = useT, useExecutionTabViewHook = useExecutionTabView, }) {
23
23
  const t = useTHook();
24
- const { tab, selectedPreset, setMode } = useExecutionTabViewHook({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError });
24
+ const { tab, selectedPreset, setMode, commitBaseUrl, isBaseUrlApproved } = useExecutionTabViewHook({ config, onConfigChange, port, presets, autoDetect, canDiscoverModels, describeProbeError });
25
25
  const modes = [
26
26
  { id: 'local-cli', title: t('Local CLI'), meta: t('Run an agent installed on this machine') },
27
27
  { id: 'byok', title: t('BYOK'), meta: t('Use your own API credentials') },
28
28
  ];
29
- return (_jsxs("div", { className: "jini-settings-execution", "aria-label": ariaLabel ?? t('Execution mode'), children: [_jsx(ExecutionModeSwitch, { modes: modes, activeMode: config.mode, localCliUnavailableReason: localCliUnavailableReason, onSelect: setMode, agentHandle: agentHandle }), config.mode === 'local-cli' ? (_jsx(LocalCliPane, { config: config, onConfigChange: onConfigChange, tab: tab, cliEnvFields: cliEnvFields, renderAgentIcon: renderAgentIcon, localCliScopeLabel: localCliScopeLabel, agentHandle: agentHandle })) : (_jsx(ByokPane, { config: config, onConfigChange: onConfigChange, presets: presets, selectedPreset: selectedPreset, tab: tab, canDiscoverModels: canDiscoverModels, canListModels: typeof port.listModels === 'function', formProps: { apiKeyFooter, formFooter, apiKeyStoredExternally, apiKeyPlaceholder }, agentHandle: agentHandle }))] }));
29
+ return (_jsxs("div", { className: "jini-settings-execution", "aria-label": ariaLabel ?? t('Execution mode'), children: [_jsx(ExecutionModeSwitch, { modes: modes, activeMode: config.mode, localCliUnavailableReason: localCliUnavailableReason, onSelect: setMode, agentHandle: agentHandle }), config.mode === 'local-cli' ? (_jsx(LocalCliPane, { config: config, onConfigChange: onConfigChange, tab: tab, cliEnvFields: cliEnvFields, renderAgentIcon: renderAgentIcon, localCliScopeLabel: localCliScopeLabel, agentHandle: agentHandle })) : (_jsx(ByokPane, { config: config, onConfigChange: onConfigChange, presets: presets, selectedPreset: selectedPreset, tab: tab, canDiscoverModels: canDiscoverModels, canListModels: typeof port.listModels === 'function', approval: { commitBaseUrl, isBaseUrlApproved }, formProps: { apiKeyFooter, formFooter, apiKeyStoredExternally, apiKeyPlaceholder }, agentHandle: agentHandle }))] }));
30
30
  }
31
31
  /** The Local CLI ↔ BYOK segmented control. Local CLI is disabled, with the host's reason as its
32
32
  * tooltip and caption, while the host says it is unavailable. */
@@ -39,9 +39,9 @@ function ExecutionModeSwitch({ modes, activeMode, localCliUnavailableReason, onS
39
39
  }) }));
40
40
  }
41
41
  /** The BYOK half of the tab: protocol and gateway chip rows over the credential card. */
42
- function ByokPane({ config, onConfigChange, presets, selectedPreset, tab, canDiscoverModels, canListModels, formProps, agentHandle, useTHook = useT, useByokPaneHook = useByokPane, }) {
42
+ function ByokPane({ config, onConfigChange, presets, selectedPreset, tab, canDiscoverModels, canListModels, approval, formProps, agentHandle, useTHook = useT, useByokPaneHook = useByokPane, }) {
43
43
  const t = useTHook();
44
- const { protocols, gateways, configuredPresetIds, selectPreset, selectedPresetId } = useByokPaneHook({ config, onConfigChange, presets, selectedPreset });
44
+ const { protocols, gateways, configuredPresetIds, selectPreset, selectedPresetId } = useByokPaneHook({ config, onConfigChange, presets, selectedPreset, commitBaseUrl: approval.commitBaseUrl });
45
45
  return (_jsxs("section", { className: "jini-settings-section jini-settings-byok", children: [_jsx(ProviderChipGroup, { label: t('Protocols'), presets: protocols, selectedPresetId: selectedPresetId, configuredPresetIds: configuredPresetIds, onSelect: selectPreset, configuredLabel: t('Configured'), unsetLabel: t('Not configured'), ...subHandleProps(agentHandle, 'protocol') }), _jsx(ProviderChipGroup, { label: t('Gateways'), presets: gateways, selectedPresetId: selectedPresetId, configuredPresetIds: configuredPresetIds, onSelect: selectPreset, configuredLabel: t('Configured'), unsetLabel: t('Not configured'), ...subHandleProps(agentHandle, 'gateway') }), _jsx(ByokProviderForm, { config: config.byok, onConfigChange: (byok) => onConfigChange({ ...config, byok }), preset: selectedPreset, ...subHandleProps(agentHandle, 'byok'),
46
46
  // The WHOLE catalog, not the `protocols`/`gateways` halves the chip rows take: the card
47
47
  // only reads it to recognise a pasted key as some other row's, and a key pasted from a
@@ -53,11 +53,28 @@ function ByokPane({ config, onConfigChange, presets, selectedPreset, tab, canDis
53
53
  // from before this key existed (or from any earlier transient
54
54
  // failure) would otherwise never clear, even once Test Connection
55
55
  // itself goes green with the same config.
56
- onTestConnection: () => {
57
- tab.testConnection(config.byok);
58
- if (canDiscoverModels && canListModels)
59
- tab.loadModels(config.byok);
60
- }, ...(formProps.apiKeyFooter !== undefined ? { apiKeyFooter: formProps.apiKeyFooter } : {}), ...(formProps.formFooter !== undefined ? { formFooter: formProps.formFooter } : {}), ...(formProps.apiKeyStoredExternally !== undefined ? { apiKeyStoredExternally: formProps.apiKeyStoredExternally } : {}), ...(formProps.apiKeyPlaceholder !== undefined ? { apiKeyPlaceholder: formProps.apiKeyPlaceholder } : {}) })] }));
56
+ onTestConnection: () => testEndpoint({ byok: config.byok, tab, approval, canDiscover: canDiscoverModels && canListModels }),
57
+ // Typing only patches the displayed config; blur or Enter is the operator committing the
58
+ // endpoint for the CURRENT provider/protocol pair.
59
+ onBaseUrlCommit: ({ baseUrl }) => approval.commitBaseUrl({ endpoint: { providerId: config.byok.providerId, protocol: config.byok.protocol, baseUrl } }), ...(formProps.apiKeyFooter !== undefined ? { apiKeyFooter: formProps.apiKeyFooter } : {}), ...(formProps.formFooter !== undefined ? { formFooter: formProps.formFooter } : {}), ...(formProps.apiKeyStoredExternally !== undefined ? { apiKeyStoredExternally: formProps.apiKeyStoredExternally } : {}), ...(formProps.apiKeyPlaceholder !== undefined ? { apiKeyPlaceholder: formProps.apiKeyPlaceholder } : {}) })] }));
60
+ }
61
+ /**
62
+ * Test connection is an explicit commit of the endpoint it tests. An incomplete or disallowed URL
63
+ * goes to neither probe (the key would travel with it). Approval is read BEFORE committing: a newly
64
+ * approved endpoint is discovered by the tab's automatic discovery effect, so calling `loadModels`
65
+ * here too would probe it twice; an already approved one gets this explicit discovery retry, which
66
+ * is what clears a stale "could not load live models" error once the connection itself goes green.
67
+ */
68
+ function testEndpoint({ byok, tab, approval, canDiscover }, _optional = {}) {
69
+ const trimmed = byok.baseUrl.trim();
70
+ if (trimmed && !isValidApiBaseUrl({ raw: trimmed }))
71
+ return;
72
+ const endpoint = { providerId: byok.providerId, protocol: byok.protocol, baseUrl: trimmed };
73
+ const wasApproved = approval.isBaseUrlApproved({ endpoint });
74
+ approval.commitBaseUrl({ endpoint });
75
+ tab.testConnection({ ...byok, baseUrl: trimmed });
76
+ if (wasApproved && canDiscover)
77
+ tab.loadModels({ ...byok, baseUrl: trimmed });
61
78
  }
62
79
  /** The Local CLI half of the tab: detected agents, wired to the config's next-state rules. */
63
80
  function LocalCliPane({ config, onConfigChange, tab, cliEnvFields, renderAgentIcon, localCliScopeLabel, agentHandle }) {
@@ -1,9 +1,9 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { useT } from '../../../i18n/index.js';
3
- import type { AgentCliEnvFieldSpec, AgentTestState, DetectedAgent, LocalCliConfig } from '../../types.js';
3
+ import type { AgentCliEnvFieldSpec, AgentTestState, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
4
4
  import { useLocalCliAgentCard } from '../hooks/useLocalCliAgentCard.js';
5
5
  export interface LocalCliAgentCardProps {
6
- agent: DetectedAgent;
6
+ agent: ExecutionCardAgent;
7
7
  config: LocalCliConfig;
8
8
  selected: boolean;
9
9
  onSelect: (agentId: string) => void;
@@ -15,8 +15,8 @@ export interface LocalCliAgentCardProps {
15
15
  cliEnvFields: readonly AgentCliEnvFieldSpec[];
16
16
  /** Rendered in the card's icon slot. A host passes its own vendor marks;
17
17
  * without one the card falls back to a monogram rather than a gap. */
18
- renderIcon?: ((agent: DetectedAgent) => ReactNode) | undefined;
19
- onTest?: ((agent: DetectedAgent) => void) | undefined;
18
+ renderIcon?: ((agent: ExecutionCardAgent) => ReactNode) | undefined;
19
+ onTest?: ((agent: ExecutionCardAgent) => void) | undefined;
20
20
  agentTest: AgentTestState;
21
21
  /** Wired straight into `AgentDiagnosticRow`'s `{kind:'rescan'}` fix action —
22
22
  * the same rescan the list's own header button triggers. Omitted hides
@@ -1,10 +1,10 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { useT } from '../../../i18n/index.js';
3
- import type { AgentCliEnvFieldSpec, AgentScanState, AgentTestState, DetectedAgent, LocalCliConfig } from '../../types.js';
3
+ import type { AgentCliEnvFieldSpec, AgentScanState, AgentTestState, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
4
4
  import { useLocalCliAgentCards } from './LocalCliAgentList.hooks.js';
5
5
  import { useLocalCliAgentList } from '../hooks/useLocalCliAgentList.js';
6
6
  export interface LocalCliAgentListProps {
7
- agents: readonly DetectedAgent[];
7
+ agents: readonly ExecutionCardAgent[];
8
8
  config: LocalCliConfig;
9
9
  scan: AgentScanState;
10
10
  onSelect: (agentId: string) => void;
@@ -13,9 +13,9 @@ export interface LocalCliAgentListProps {
13
13
  onEnvChange: (agentId: string, envKey: string, value: string) => void;
14
14
  cliEnvFields: readonly AgentCliEnvFieldSpec[];
15
15
  onRescan?: (() => void) | undefined;
16
- onTest?: ((agent: DetectedAgent) => void) | undefined;
16
+ onTest?: ((agent: ExecutionCardAgent) => void) | undefined;
17
17
  agentTest: AgentTestState;
18
- renderAgentIcon?: ((agent: DetectedAgent) => ReactNode) | undefined;
18
+ renderAgentIcon?: ((agent: ExecutionCardAgent) => ReactNode) | undefined;
19
19
  /**
20
20
  * Where detection ran, in the host's own words — "on this machine" for a
21
21
  * desktop app, "on the server" for a deployed one.
@@ -1,12 +1,12 @@
1
1
  import type { LocalCliAgentListProps } from './LocalCliAgentList.js';
2
- import type { DetectedAgent } from '../../types.js';
2
+ import type { ExecutionCardAgent } from '@jini-ai/core/contracts/execution';
3
3
  type CardInput = {
4
4
  [K in 'agents' | 'config' | 'onSelect' | 'onModelChange' | 'onReasoningChange' | 'onEnvChange' | 'cliEnvFields' | 'onRescan' | 'onTest' | 'agentTest' | 'renderAgentIcon' | 'agentHandle']: LocalCliAgentListProps[K];
5
5
  };
6
6
  /** Render each agent with its own stable handle and the host's shared actions. */
7
7
  export declare function useLocalCliAgentCards({ agents, config, onSelect, onModelChange, onReasoningChange, onEnvChange, cliEnvFields, onRescan, onTest, agentTest, renderAgentIcon, agentHandle }: CardInput, _options?: {}): {
8
- installed: DetectedAgent[];
9
- renderCard: (agent: DetectedAgent) => import("react").JSX.Element;
8
+ installed: ExecutionCardAgent[];
9
+ renderCard: (agent: ExecutionCardAgent) => import("react").JSX.Element;
10
10
  };
11
11
  export {};
12
12
  //# sourceMappingURL=LocalCliAgentList.hooks.d.ts.map
@@ -1,7 +1,7 @@
1
- import type { AgentCliEnvFieldSpec, DetectedAgent, LocalCliConfig } from '../../types.js';
1
+ import type { AgentCliEnvFieldSpec, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
2
2
  import type { UseLocalCliAgentCardResult } from '../hooks/useLocalCliAgentCard.js';
3
3
  export interface LocalCliAgentSettingsProps {
4
- agent: DetectedAgent;
4
+ agent: ExecutionCardAgent;
5
5
  config: LocalCliConfig;
6
6
  card: UseLocalCliAgentCardResult;
7
7
  cliEnvFields: readonly AgentCliEnvFieldSpec[];
@@ -1,4 +1,4 @@
1
- import type { ProviderPreset } from '../../types.js';
1
+ import type { ProviderPreset } from '@jini-ai/core/contracts/execution';
2
2
  export interface ProviderChipGroupProps {
3
3
  label: string;
4
4
  presets: readonly ProviderPreset[];
@@ -1,5 +1,5 @@
1
1
  import { useAgentHandle, type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
2
- import type { AgentModelOption } from '../../types.js';
2
+ import type { AgentModelOption } from '@jini-ai/core/contracts/execution';
3
3
  import { useSearchableModelSelect } from './SearchableModelSelect.hooks.js';
4
4
  export interface SearchableModelSelectAdditionalOption {
5
5
  value: string;
@@ -1,4 +1,4 @@
1
- import type { ByokConfig, ProviderPreset } from '../../types.js';
1
+ import type { ByokConfig, ProviderPreset } from '@jini-ai/core/contracts/execution';
2
2
  type Field = 'apiKey' | 'baseUrl' | 'model';
3
3
  /** Keeps required-field gates immediate while optionally waiting for blur to paint errors.
4
4
  * Stored keys satisfy only the key requirement; touching one provider never marks another.
@@ -11,7 +11,7 @@ export declare function useByokFieldValidation(required: {
11
11
  }, optional?: {
12
12
  deferMissingFeedback?: boolean;
13
13
  }): {
14
- missing: Set<import("../../types.js").ByokRequiredField>;
14
+ missing: Set<import("@jini-ai/core/contracts/execution").ByokRequiredField>;
15
15
  baseUrlInvalid: boolean;
16
16
  isMissing: ({ field }: {
17
17
  field: Field;
@@ -1,4 +1,4 @@
1
- import type { ByokConfig } from "../../types.js";
1
+ import type { ByokConfig } from "@jini-ai/core/contracts/execution";
2
2
  import type { SettingsSliceRefreshPort } from "../../../panel-kit/hooks/settings-slice.helpers.js";
3
3
  /** The metadata read by this controller. Hosts retain any additional write-only view fields. */
4
4
  export interface ExecutionCredentialView {
@@ -1,5 +1,4 @@
1
- import type { ExecutionPort } from '../../ports.js';
2
- import type { AgentScanState, AgentTestState, ByokConfig, ConnectionTestState, DetectedAgent, ModelDiscoveryState } from '../../types.js';
1
+ import type { AgentScanState, AgentTestState, ByokConfig, ConnectionTestState, ExecutionCardAgent, ExecutionPort, ModelDiscoveryState } from '@jini-ai/core/contracts/execution';
3
2
  export interface UseExecutionTabOptions {
4
3
  port: ExecutionPort;
5
4
  /** Skips the mount-time detection call — useful when the host already has
@@ -19,7 +18,7 @@ export interface UseExecutionTabOptions {
19
18
  describeProbeError?: (error: unknown) => string;
20
19
  }
21
20
  export interface UseExecutionTabResult {
22
- agents: readonly DetectedAgent[];
21
+ agents: readonly ExecutionCardAgent[];
23
22
  scan: AgentScanState;
24
23
  connectionTest: ConnectionTestState;
25
24
  /** Result of the most recent `loadModels` call. `{status:'idle'}` until one
@@ -1,9 +1,9 @@
1
1
  import { agentExecutableRepairState } from '../../rules.js';
2
- import type { AgentCliEnvFieldSpec, AgentTestState, DetectedAgent, LocalCliConfig } from '../../types.js';
2
+ import type { AgentCliEnvFieldSpec, AgentTestState, ExecutionCardAgent, LocalCliConfig } from '@jini-ai/core/contracts/execution';
3
3
  import { type UseReasoningControlResult } from './useReasoningControl.js';
4
4
  type Translate = (key: string) => string;
5
5
  export interface UseLocalCliAgentCardInput {
6
- agent: DetectedAgent;
6
+ agent: ExecutionCardAgent;
7
7
  config: LocalCliConfig;
8
8
  agentTest: AgentTestState;
9
9
  cliEnvFields: readonly AgentCliEnvFieldSpec[];
@@ -11,7 +11,7 @@ export interface UseLocalCliAgentCardInput {
11
11
  onReasoningChange: (agentId: string, reasoning: string) => void;
12
12
  onRescan?: (() => void) | undefined;
13
13
  /** Only its presence matters here: a Test button alone is enough to show the settings strip. */
14
- onTest?: ((agent: DetectedAgent) => void) | undefined;
14
+ onTest?: ((agent: ExecutionCardAgent) => void) | undefined;
15
15
  t: Translate;
16
16
  }
17
17
  export interface UseLocalCliAgentCardResult {
@@ -20,7 +20,7 @@ export interface UseLocalCliAgentCardResult {
20
20
  * as an empty bordered box for a CLI with no models, effort, Test or env fields. */
21
21
  hasSettings: boolean;
22
22
  /** `agent.modelsSource`, passed through for the badge's modifier class. */
23
- source: DetectedAgent['modelsSource'];
23
+ source: ExecutionCardAgent['modelsSource'];
24
24
  sourceLabel: string;
25
25
  sourceHint: string;
26
26
  testing: boolean;
@@ -1,9 +1,9 @@
1
- import type { DetectedAgent } from '../../types.js';
1
+ import type { ExecutionCardAgent } from '@jini-ai/core/contracts/execution';
2
2
  export interface UseLocalCliAgentListResult {
3
3
  /** Installed CLIs plus the current pick: always rendered. */
4
- visible: DetectedAgent[];
4
+ visible: ExecutionCardAgent[];
5
5
  /** Not-installed CLIs: rendered only while `showCollapsed`. */
6
- collapsed: DetectedAgent[];
6
+ collapsed: ExecutionCardAgent[];
7
7
  showCollapsed: boolean;
8
8
  toggleCollapsed: () => void;
9
9
  }
@@ -13,7 +13,7 @@ export interface UseLocalCliAgentListResult {
13
13
  * off-screen. See `partitionAgentsByInstalled` for what stays visible.
14
14
  */
15
15
  export declare function useLocalCliAgentList({ agents, selectedAgentId }: {
16
- agents: readonly DetectedAgent[];
16
+ agents: readonly ExecutionCardAgent[];
17
17
  selectedAgentId: string | null;
18
18
  }): UseLocalCliAgentListResult;
19
19
  //# sourceMappingURL=useLocalCliAgentList.d.ts.map
@@ -1,6 +1,6 @@
1
- import type { AgentModelOption, DetectedAgent, LocalCliConfig, ReasoningModelGroup } from '../../types.js';
1
+ import type { AgentModelOption, ExecutionCardAgent, LocalCliConfig, ReasoningModelGroup } from '@jini-ai/core/contracts/execution';
2
2
  export interface UseReasoningControlOptions {
3
- agent: DetectedAgent;
3
+ agent: ExecutionCardAgent;
4
4
  config: LocalCliConfig;
5
5
  explicitCustomMode?: boolean | undefined;
6
6
  /**
@@ -83,5 +83,5 @@ export interface UseReasoningControlResult {
83
83
  * and effort levels derived from the agent's model catalog via `reasoningModelGroups`.
84
84
  */
85
85
  export declare function useReasoningControl(options: UseReasoningControlOptions): UseReasoningControlResult;
86
- export declare function useReasoningControl(agent: DetectedAgent, config: LocalCliConfig, explicitCustomMode?: boolean): UseReasoningControlResult;
86
+ export declare function useReasoningControl(agent: ExecutionCardAgent, config: LocalCliConfig, explicitCustomMode?: boolean): UseReasoningControlResult;
87
87
  //# sourceMappingURL=useReasoningControl.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { AgentCliEnvFieldSpec, AgentDiagnostic, AgentExecutableRepair, AgentExecutableSource, AgentModelOption, ApiKeyWarning, ByokConfig, ByokProviderCredentials, ByokRequiredField, DetectedAgent, ExecutionConfig, ExecutionMode, LocalCliConfig, ProviderPreset, ReasoningModelGroup } from './types.js';
1
+ import type { AgentCliEnvFieldSpec, AgentDiagnostic, AgentExecutableRepair, AgentExecutableSource, AgentModelOption, ApiKeyWarning, ByokConfig, ByokProviderCredentials, ByokRequiredField, ExecutionCardAgent, ExecutionConfig, ExecutionMode, LocalCliConfig, ProviderPreset, ReasoningModelGroup } from '@jini-ai/core/contracts/execution';
2
2
  /**
3
3
  * Pure decision logic for the execution tab. Everything here is total and
4
4
  * side-effect free so the React layer stays a thin renderer — same split the
@@ -216,7 +216,7 @@ export interface AgentMetaLabels {
216
216
  * binary path, so the card stays one line without discarding either.
217
217
  */
218
218
  export declare function agentMetaLabel({ agent, labels }: {
219
- agent: DetectedAgent;
219
+ agent: ExecutionCardAgent;
220
220
  labels: AgentMetaLabels;
221
221
  }, _optional?: Record<string, never>): {
222
222
  text: string;
@@ -227,7 +227,7 @@ export declare function agentMetaLabel({ agent, labels }: {
227
227
  * reported, else nothing. */
228
228
  export declare function selectedAgentModel({ config, agent }: {
229
229
  config: LocalCliConfig;
230
- agent: DetectedAgent;
230
+ agent: ExecutionCardAgent;
231
231
  }, _optional?: Record<string, never>): string;
232
232
  /** Human label for the model an agent will run, for the collapsed summary line
233
233
  * on unselected cards. Falls back to the raw id when the host reported a
@@ -235,7 +235,7 @@ export declare function selectedAgentModel({ config, agent }: {
235
235
  * choice is still the choice, and hiding it would misreport what will run. */
236
236
  export declare function agentModelSummary({ config, agent }: {
237
237
  config: LocalCliConfig;
238
- agent: DetectedAgent;
238
+ agent: ExecutionCardAgent;
239
239
  }, _optional?: Record<string, never>): string;
240
240
  /** Picking an agent card. Re-picking the selected agent is a no-op rather than
241
241
  * a deselect — the origin had no "no agent" affordance once one was chosen,
@@ -259,7 +259,7 @@ export declare function nextConfigForAgentModel({ config, agentId, model }: {
259
259
  * pick from a second, independent list. */
260
260
  export declare function selectedAgentReasoning({ config, agent }: {
261
261
  config: LocalCliConfig;
262
- agent: DetectedAgent;
262
+ agent: ExecutionCardAgent;
263
263
  }, _optional?: Record<string, never>): string;
264
264
  /** Recording a per-agent reasoning-effort pick. Keyed by agent id for the
265
265
  * same cross-contamination reason as `nextConfigForAgentModel`. */
@@ -368,7 +368,7 @@ export declare function filterAgentModelOptions({ options, query, selectedValue
368
368
  export declare function agentDiagnosticTooltip(diagnostic: AgentDiagnostic): string;
369
369
  /**
370
370
  * Splits a model id into its base and its reasoning-effort suffix, for a runtime that encodes
371
- * effort inside the id (`DetectedAgent.reasoningInModelId`).
371
+ * effort inside the id (`ExecutionCardAgent.reasoningInModelId`).
372
372
  *
373
373
  * Only a trailing `-<token>` whose token appears in `levelIds` is a level. Everything else stays
374
374
  * part of the base id — which is the whole point: `claude-opus-4-6-thinking` ends in `-thinking`,
@@ -546,7 +546,7 @@ export function agentDiagnosticTooltip(diagnostic) {
546
546
  }
547
547
  /**
548
548
  * Splits a model id into its base and its reasoning-effort suffix, for a runtime that encodes
549
- * effort inside the id (`DetectedAgent.reasoningInModelId`).
549
+ * effort inside the id (`ExecutionCardAgent.reasoningInModelId`).
550
550
  *
551
551
  * Only a trailing `-<token>` whose token appears in `levelIds` is a level. Everything else stays
552
552
  * part of the base id — which is the whole point: `claude-opus-4-6-thinking` ends in `-thinking`,
@@ -50,21 +50,21 @@ export function ExternalMcpTab({ dependencies, fieldSpecs = MCP_SOURCE_FIELD_SPE
50
50
  // text — showing both would just be two banners saying overlapping things.
51
51
  const banner = list.error ?? connectionError;
52
52
  const draftTestResultProps = list.testResults[DRAFT_TEST_SCOPE] ? { testResult: list.testResults[DRAFT_TEST_SCOPE] } : {};
53
- return (_jsxs("section", { className: "external-mcp-tab", children: [_jsxs("div", { className: "external-mcp-head", children: [_jsxs("div", { children: [_jsx("h3", { children: t('External MCP servers') }), _jsx("p", { className: "external-mcp-subtitle", children: t('Third-party tools for your coding agent.') })] }), _jsxs("button", { type: "button", className: "external-mcp-add-button", onClick: () => setFormOpen((open) => !open), "aria-expanded": formOpen, children: [_jsx(Icon, { name: "plus", size: 14 }), _jsx("span", { children: t('Add server') })] })] }), banner ? (_jsx("div", { className: "external-mcp-banner", role: "alert", children: t(banner) })) : null, formOpen ? (_jsx(SourceConfigAddForm, { fieldSpecs: fieldSpecs, values: addForm.values, validation: addForm.validation, submitAttempted: addForm.submitAttempted, submitting: addForm.submitting, submitError: addForm.submitError, onFieldChange: addForm.setField, onTrustChange: addForm.setTrust, onSubmit: () => void addForm.submit(), canTest: list.capabilities.canTest, testing: list.isPending(DRAFT_TEST_SCOPE, 'test'), ...draftTestResultProps, onTest: () => void list.test(undefined, addForm.values), addLabel: "Add server" })) : null, list.loading ? (_jsx("div", { className: "source-config-list-loading", role: "status", children: t('Loading…') })) : (_jsx(ExternalMcpSources, { list: list, fieldSpecs: fieldSpecs, trustOptions: trustOptions })), _jsx(ExternalMcpFooter, { saveStatusLabel: saveStatusLabel, configPath: configPath })] }));
53
+ return (_jsxs("section", { className: "jini-ui-external-mcp-tab", children: [_jsxs("div", { className: "jini-ui-external-mcp-head", children: [_jsxs("div", { children: [_jsx("h3", { children: t('External MCP servers') }), _jsx("p", { className: "jini-ui-external-mcp-subtitle", children: t('Third-party tools for your coding agent.') })] }), _jsxs("button", { type: "button", className: "jini-ui-external-mcp-add-button", onClick: () => setFormOpen((open) => !open), "aria-expanded": formOpen, children: [_jsx(Icon, { name: "plus", size: 14 }), _jsx("span", { children: t('Add server') })] })] }), banner ? (_jsx("div", { className: "jini-ui-external-mcp-banner", role: "alert", children: t(banner) })) : null, formOpen ? (_jsx(SourceConfigAddForm, { fieldSpecs: fieldSpecs, values: addForm.values, validation: addForm.validation, submitAttempted: addForm.submitAttempted, submitting: addForm.submitting, submitError: addForm.submitError, onFieldChange: addForm.setField, onTrustChange: addForm.setTrust, onSubmit: () => void addForm.submit(), canTest: list.capabilities.canTest, testing: list.isPending(DRAFT_TEST_SCOPE, 'test'), ...draftTestResultProps, onTest: () => void list.test(undefined, addForm.values), addLabel: "Add server" })) : null, list.loading ? (_jsx("div", { className: "jini-ui-source-config-list-loading", role: "status", children: t('Loading…') })) : (_jsx(ExternalMcpSources, { list: list, fieldSpecs: fieldSpecs, trustOptions: trustOptions })), _jsx(ExternalMcpFooter, { saveStatusLabel: saveStatusLabel, configPath: configPath })] }));
54
54
  }
55
55
  /** The configured servers, or the empty-state hint when there are none yet. */
56
56
  function ExternalMcpSources({ list, fieldSpecs, trustOptions, useTHook = useT, }) {
57
57
  const t = useTHook();
58
58
  if (list.sources.length === 0) {
59
- return (_jsxs("div", { className: "external-mcp-empty", children: [_jsx("p", { className: "external-mcp-empty-title", children: t('No MCP servers configured.') }), _jsx("p", { className: "external-mcp-empty-hint", children: t('Click "Add server" to get started — pick a template or set up a custom stdio / HTTP server.') })] }));
59
+ return (_jsxs("div", { className: "jini-ui-external-mcp-empty", children: [_jsx("p", { className: "jini-ui-external-mcp-empty-title", children: t('No MCP servers configured.') }), _jsx("p", { className: "jini-ui-external-mcp-empty-hint", children: t('Click "Add server" to get started — pick a template or set up a custom stdio / HTTP server.') })] }));
60
60
  }
61
- return (_jsx("div", { className: "source-config-list-items", children: list.sources.map((source) => (_jsx(SourceConfigItemCard, { source: source, fieldSpecs: fieldSpecs, ...(trustOptions ? { trustOptions } : {}), capabilities: list.capabilities, removing: list.isPending(source.id, 'remove'), refreshing: list.isPending(source.id, 'refresh'), settingTrust: list.isPending(source.id, 'trust'), testing: list.isPending(source.id, 'test'), updating: list.isPending(source.id, 'update'), onRefresh: () => void list.refresh(source.id), onRemove: () => void list.remove(source.id), onTrustChange: (trust) => void list.setTrust(source.id, trust), onTest: () => void list.test(source.id), onUpdate: (patch) => void list.update(source.id, patch), ...(list.testResults[source.id] ? { testResult: list.testResults[source.id] } : {}) }, source.id))) }));
61
+ return (_jsx("div", { className: "jini-ui-source-config-list-items", children: list.sources.map((source) => (_jsx(SourceConfigItemCard, { source: source, fieldSpecs: fieldSpecs, ...(trustOptions ? { trustOptions } : {}), capabilities: list.capabilities, removing: list.isPending(source.id, 'remove'), refreshing: list.isPending(source.id, 'refresh'), settingTrust: list.isPending(source.id, 'trust'), testing: list.isPending(source.id, 'test'), updating: list.isPending(source.id, 'update'), onRefresh: () => void list.refresh(source.id), onRemove: () => void list.remove(source.id), onTrustChange: (trust) => void list.setTrust(source.id, trust), onTest: () => void list.test(source.id), onUpdate: (patch) => void list.update(source.id, patch), ...(list.testResults[source.id] ? { testResult: list.testResults[source.id] } : {}) }, source.id))) }));
62
62
  }
63
63
  /** Renders the save-status footer as one unit; a path alone does not show it. */
64
64
  function ExternalMcpFooter({ saveStatusLabel, configPath, useTHook = useT }) {
65
65
  const t = useTHook();
66
66
  if (!saveStatusLabel)
67
67
  return null;
68
- return (_jsxs("div", { className: "external-mcp-footer", children: [_jsx("span", { className: "external-mcp-save-pill", children: t(saveStatusLabel) }), configPath ? (_jsxs("span", { className: "external-mcp-stored-at", children: [t('Stored at'), " ", _jsx("code", { children: configPath })] })) : null] }));
68
+ return (_jsxs("div", { className: "jini-ui-external-mcp-footer", children: [_jsx("span", { className: "jini-ui-external-mcp-save-pill", children: t(saveStatusLabel) }), configPath ? (_jsxs("span", { className: "jini-ui-external-mcp-stored-at", children: [t('Stored at'), " ", _jsx("code", { children: configPath })] })) : null] }));
69
69
  }
70
70
  //# sourceMappingURL=ExternalMcpTab.js.map
@@ -58,7 +58,7 @@ export type FileDropzoneHooks = typeof defaultFileDropzoneHooks;
58
58
  * file-dialog cancel-vs-still-loading detection heuristic and a plain
59
59
  * staged-names list). Both are the same underlying interaction — native
60
60
  * drag/drop + click-to-browse resolving to a flat `File[]` — configured
61
- * differently; see `archived UI source map` for the full writeup.
61
+ * differently; see `070311a07^:packages/ui/source-map.md` (section "features/file-dropzone/") for the full writeup.
62
62
  */
63
63
  export declare function FileDropzone({ label, prompt, helper, accept, directory, enablePaste, files, onRemove, names, onRemoveName, onFiles, onZoneClick, onError, onProcessingStart, onBrowseFolder, secondaryAction, useFileDropzone: useFileDropzoneHook, useFileDropzonePreviews: useFileDropzonePreviewsHook, hooks, }: FileDropzoneProps): import("react").JSX.Element;
64
64
  //# sourceMappingURL=FileDropzone.d.ts.map
@@ -34,7 +34,7 @@ function FileDropzoneBrowseFolder({ onBrowseFolder, t }) {
34
34
  * file-dialog cancel-vs-still-loading detection heuristic and a plain
35
35
  * staged-names list). Both are the same underlying interaction — native
36
36
  * drag/drop + click-to-browse resolving to a flat `File[]` — configured
37
- * differently; see `archived UI source map` for the full writeup.
37
+ * differently; see `070311a07^:packages/ui/source-map.md` (section "features/file-dropzone/") for the full writeup.
38
38
  */
39
39
  export function FileDropzone({ label, prompt, helper, accept, directory, enablePaste = false, files, onRemove, names, onRemoveName, onFiles, onZoneClick, onError, onProcessingStart, onBrowseFolder, secondaryAction, useFileDropzone: useFileDropzoneHook = useFileDropzone, useFileDropzonePreviews: useFileDropzonePreviewsHook = useFileDropzonePreviews, hooks = defaultFileDropzoneHooks, }) {
40
40
  const t = hooks.useT();
@@ -0,0 +1,58 @@
1
+ import type { FindInPageResult } from '@jini-ai/core/contracts/find-in-page';
2
+ export interface FindBarState {
3
+ readonly open: boolean;
4
+ readonly query: string;
5
+ readonly result: FindInPageResult | null;
6
+ /** Bumped on every `toggle`, including a repeat Cmd+F while already open — see
7
+ * `useFindBarEffects`'s focus effect, which keys on this rather than on `open` so a second Cmd+F
8
+ * still refocuses. */
9
+ readonly focusNonce: number;
10
+ }
11
+ export declare const initialFindBarState: FindBarState;
12
+ export type FindBarAction = {
13
+ type: 'toggle';
14
+ } | {
15
+ type: 'set-query';
16
+ query: string;
17
+ } | {
18
+ type: 'result';
19
+ result: FindInPageResult;
20
+ } | {
21
+ type: 'close';
22
+ };
23
+ /**
24
+ * @complexity O(1).
25
+ */
26
+ export declare function findBarReducer(state: FindBarState, action: FindBarAction): FindBarState;
27
+ /**
28
+ * Whether a bar that is currently `open` should close because the visible surface just changed
29
+ * (a different tab, or the host's own screen <-> a tab) — never for a re-render that left
30
+ * `activeGuestId` the same, and never while already closed (nothing open to reset).
31
+ *
32
+ * Extracted as a plain decision, not inlined in the effect that calls it, for the same reason
33
+ * every other routing choice in this folder is a function: the DECISION has to be testable on its
34
+ * own, without rendering the hook that applies it.
35
+ *
36
+ * @complexity O(1).
37
+ */
38
+ export declare function shouldCloseOnGuestChange({ previousGuestId, activeGuestId, open }: {
39
+ previousGuestId: string | null;
40
+ activeGuestId: string | null;
41
+ open: boolean;
42
+ }, _options?: Record<string, never>): boolean;
43
+ /** The host's counter copy: the zero-match text and the `"<ordinal> of <total>"` phrasing. */
44
+ export interface FindMatchCountLabels {
45
+ readonly noResults: string;
46
+ readonly matchOf: (input: {
47
+ ordinal: number;
48
+ total: number;
49
+ }) => string;
50
+ }
51
+ /** The bar's own counter text: the host's `matchOf` phrasing, or its `noResults` text once a query has
52
+ * actually returned zero matches — never shown for an empty query, which has no `result` yet
53
+ * (see `findBarReducer`'s `set-query`). @complexity O(1). */
54
+ export declare function formatFindMatchCount({ result, labels }: {
55
+ result: FindInPageResult | null;
56
+ labels: FindMatchCountLabels;
57
+ }, _options?: Record<string, never>): string;
58
+ //# sourceMappingURL=find-bar-state.d.ts.map
@@ -0,0 +1,45 @@
1
+ export const initialFindBarState = { open: false, query: '', result: null, focusNonce: 0 };
2
+ /**
3
+ * @complexity O(1).
4
+ */
5
+ export function findBarReducer(state, action) {
6
+ switch (action.type) {
7
+ case 'toggle':
8
+ return { ...state, open: true, focusNonce: state.focusNonce + 1 };
9
+ case 'set-query':
10
+ // A cleared query drops the last result at once rather than leaving a stale "3 of 17" up
11
+ // while `runFind`'s own stop-instead-of-search takes effect.
12
+ return { ...state, query: action.query, result: action.query === '' ? null : state.result };
13
+ case 'result':
14
+ return { ...state, result: action.result };
15
+ case 'close':
16
+ return initialFindBarState;
17
+ }
18
+ // Typed cases are exhaustive; preserve undefined fallthrough for untyped callers.
19
+ return undefined;
20
+ }
21
+ /**
22
+ * Whether a bar that is currently `open` should close because the visible surface just changed
23
+ * (a different tab, or the host's own screen <-> a tab) — never for a re-render that left
24
+ * `activeGuestId` the same, and never while already closed (nothing open to reset).
25
+ *
26
+ * Extracted as a plain decision, not inlined in the effect that calls it, for the same reason
27
+ * every other routing choice in this folder is a function: the DECISION has to be testable on its
28
+ * own, without rendering the hook that applies it.
29
+ *
30
+ * @complexity O(1).
31
+ */
32
+ export function shouldCloseOnGuestChange({ previousGuestId, activeGuestId, open }, _options = {}) {
33
+ return open && previousGuestId !== activeGuestId;
34
+ }
35
+ /** The bar's own counter text: the host's `matchOf` phrasing, or its `noResults` text once a query has
36
+ * actually returned zero matches — never shown for an empty query, which has no `result` yet
37
+ * (see `findBarReducer`'s `set-query`). @complexity O(1). */
38
+ export function formatFindMatchCount({ result, labels }, _options = {}) {
39
+ if (result === null)
40
+ return '';
41
+ if (result.matches === 0)
42
+ return labels.noResults;
43
+ return labels.matchOf({ ordinal: result.activeMatchOrdinal, total: result.matches });
44
+ }
45
+ //# sourceMappingURL=find-bar-state.js.map