@kortix/ui 0.14.6 → 0.14.8

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 (186) hide show
  1. package/dist/_vendor/kortix-shared.js +490 -382
  2. package/dist/_vendor/shared/runtime-versions.d.ts +4 -0
  3. package/dist/access/access/access-dialog-share.js +4 -7
  4. package/dist/access/access/access-dialog.js +2 -1
  5. package/dist/access/access/principal-picker.js +6 -5
  6. package/dist/customize/agents/agent-authority-card.js +1 -2
  7. package/dist/customize/agents/agent-cover-card.d.ts +17 -0
  8. package/dist/customize/agents/agent-cover-card.js +13 -0
  9. package/dist/customize/agents/agent-detail-aside.js +15 -14
  10. package/dist/customize/agents/agent-drives-section.js +5 -6
  11. package/dist/customize/agents/agent-grant-pages.js +68 -70
  12. package/dist/customize/agents/agent-page.js +27 -19
  13. package/dist/customize/agents/agent-people-section.js +18 -17
  14. package/dist/customize/agents/agent-triggers-section.js +6 -5
  15. package/dist/customize/agents/agents-page.js +43 -49
  16. package/dist/customize/connectors/catalog/catalog-entry.d.ts +14 -0
  17. package/dist/customize/connectors/catalog/catalog-entry.js +18 -1
  18. package/dist/customize/connectors/catalog/connector-browse.d.ts +28 -0
  19. package/dist/customize/connectors/catalog/connector-browse.js +18 -5
  20. package/dist/customize/connectors/detail/app-page.js +19 -5
  21. package/dist/customize/connectors/detail/connector-modal.d.ts +10 -13
  22. package/dist/customize/connectors/detail/connector-modal.js +18 -101
  23. package/dist/customize/connectors/detail/connector-notice.js +6 -2
  24. package/dist/customize/connectors/detail/connector-page.d.ts +30 -0
  25. package/dist/customize/connectors/detail/connector-page.js +26 -13
  26. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +1 -0
  27. package/dist/customize/migrate-to-v2/migration-prompt.js +1 -0
  28. package/dist/customize/sections/llm-provider/custom-provider-form.js +24 -7
  29. package/dist/customize/sections/llm-provider/custom-provider-panel.js +44 -8
  30. package/dist/customize/sections/llm-provider/types.d.ts +3 -0
  31. package/dist/customize/sections/llm-provider/utils.js +2 -2
  32. package/dist/customize/sections/view/agent-editor-access-fields.d.ts +9 -16
  33. package/dist/customize/sections/view/agent-editor-access-fields.js +30 -30
  34. package/dist/customize/sections/view/agent-editor-basics-fields.js +3 -10
  35. package/dist/customize/sections/view/agent-editor-primitives.d.ts +28 -10
  36. package/dist/customize/sections/view/agent-editor-primitives.js +32 -19
  37. package/dist/customize/sections/view/agent-editor.js +3 -3
  38. package/dist/customize/sections/view/channels-view.js +2 -6
  39. package/dist/customize/sections/view/gateway/gateway-routing.js +3 -3
  40. package/dist/customize/sections/view/grant-mode-field.d.ts +2 -5
  41. package/dist/customize/sections/view/grant-mode-field.js +10 -18
  42. package/dist/customize/sections/view/permission-editor.js +11 -8
  43. package/dist/customize/sections/view/secrets-view.js +2 -1
  44. package/dist/customize/settings/tabs/general-tab.d.ts +9 -2
  45. package/dist/customize/settings/tabs/general-tab.js +33 -11
  46. package/dist/customize/settings/tabs/transfer-workspace-dialog.d.ts +4 -0
  47. package/dist/customize/settings/tabs/transfer-workspace-dialog.js +82 -0
  48. package/dist/customize/shared/new-entity-menu.js +4 -1
  49. package/dist/customize/skills/skills-page.js +4 -5
  50. package/dist/customize/triggers/schedule/then-fields.js +1 -5
  51. package/dist/customize/triggers/schedule-view.js +4 -2
  52. package/dist/files/project/api/runtime-files.js +3 -2
  53. package/dist/files/project/file-source.js +18 -1
  54. package/dist/files/project/hooks/use-file-content.js +2 -0
  55. package/dist/files/viewer/file-header.js +1 -1
  56. package/dist/files/viewer/file-preview-modal.d.ts +1 -1
  57. package/dist/files/viewer/file-preview-modal.js +12 -2
  58. package/dist/files/viewer/file-source.d.ts +3 -1
  59. package/dist/files/viewer/use-file-content-state.js +26 -7
  60. package/dist/files/viewer/viewer-actions.js +2 -2
  61. package/dist/i18n/en.d.ts +393 -12
  62. package/dist/i18n/en.js +400 -19
  63. package/dist/internal/components/agent-mark.d.ts +38 -0
  64. package/dist/internal/components/agent-mark.js +38 -0
  65. package/dist/internal/files/types.d.ts +2 -0
  66. package/dist/internal/goals/goal-meta.d.ts +30 -0
  67. package/dist/internal/goals/goal-meta.js +55 -0
  68. package/dist/internal/lib/pixel-mark.d.ts +33 -0
  69. package/dist/internal/lib/pixel-mark.js +152 -0
  70. package/dist/internal/lib/query-client-singleton.d.ts +9 -3
  71. package/dist/internal/lib/query-client-singleton.js +18 -12
  72. package/dist/internal/lib/use-project-feature-flags.js +3 -3
  73. package/dist/internal/share/session-shares-modal.js +3 -7
  74. package/dist/internal/stores/kortix-computer-store.js +14 -2
  75. package/dist/internal/stores/session-hover-store.d.ts +32 -0
  76. package/dist/internal/stores/session-hover-store.js +38 -0
  77. package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
  78. package/dist/internal/stores/sidebar-nav-store.js +3 -1
  79. package/dist/lib/routes.d.ts +2 -0
  80. package/dist/lib/routes.js +1 -0
  81. package/dist/markdown/genui/components/inline.d.ts +1 -1
  82. package/dist/markdown/setup-links/app-credentials-form.d.ts +12 -0
  83. package/dist/markdown/setup-links/app-credentials-form.js +115 -0
  84. package/dist/markdown/setup-links/secret-intake-form.d.ts +10 -0
  85. package/dist/markdown/setup-links/secret-intake-form.js +1 -1
  86. package/dist/primitives/entity-avatar.d.ts +4 -1
  87. package/dist/primitives/entity-avatar.js +4 -2
  88. package/dist/primitives/settings-section-header.d.ts +1 -1
  89. package/dist/primitives/user-avatar.d.ts +3 -1
  90. package/dist/primitives/user-avatar.js +4 -2
  91. package/dist/providers/ui-provider.d.ts +1 -1
  92. package/dist/session/composer/agent-selector.d.ts +7 -1
  93. package/dist/session/composer/agent-selector.js +20 -10
  94. package/dist/session/composer/attachment-tile.d.ts +0 -2
  95. package/dist/session/composer/attachment-tile.js +0 -8
  96. package/dist/session/composer/clipboard-files.d.ts +2 -1
  97. package/dist/session/composer/composer-draft-recovery.d.ts +1 -2
  98. package/dist/session/composer/composer-draft-recovery.js +0 -13
  99. package/dist/session/composer/context-ring.d.ts +1 -1
  100. package/dist/session/composer/context-ring.js +2 -2
  101. package/dist/session/composer/context-usage.d.ts +8 -6
  102. package/dist/session/composer/context-usage.js +9 -7
  103. package/dist/session/composer/inbox-row-claims.d.ts +2 -2
  104. package/dist/session/composer/inbox-row-claims.js +1 -1
  105. package/dist/session/composer/queue-projection.d.ts +3 -2
  106. package/dist/session/composer/queued-prompt-edit.d.ts +1 -1
  107. package/dist/session/composer/reasoning-effort-selector.d.ts +2 -1
  108. package/dist/session/composer/session-composer-readiness.d.ts +7 -22
  109. package/dist/session/composer/session-composer-readiness.js +12 -40
  110. package/dist/session/composer/token-progress.d.ts +1 -1
  111. package/dist/session/composer/token-progress.js +6 -6
  112. package/dist/session/header/export-transcript-modal.d.ts +3 -2
  113. package/dist/session/header/export-transcript-modal.js +6 -3
  114. package/dist/session/header/session-goal-indicator.d.ts +1 -0
  115. package/dist/session/header/session-goal-indicator.js +41 -0
  116. package/dist/session/header/session-site-header.js +2 -1
  117. package/dist/session/models/model-selector.d.ts +3 -1
  118. package/dist/session/models/model-selector.js +3 -2
  119. package/dist/session/panel/easy/plan-card.d.ts +2 -0
  120. package/dist/session/panel/easy/plan-card.js +2 -0
  121. package/dist/session/panel/session-action-panel-column.js +11 -1
  122. package/dist/session/panel/session-audit-shared.d.ts +0 -4
  123. package/dist/session/panel/session-audit-shared.js +1 -1
  124. package/dist/session/panel/session-changes-shared.d.ts +2 -1
  125. package/dist/session/prompts/session-permission-prompt.js +6 -3
  126. package/dist/session/status/provisioning-failure.d.ts +2 -1
  127. package/dist/session/status/session-error-banner.js +8 -6
  128. package/dist/session/status/session-starting-loader.d.ts +24 -31
  129. package/dist/session/status/session-starting-loader.js +32 -81
  130. package/dist/session/thread/chat-minimap-items.d.ts +4 -4
  131. package/dist/session/thread/first-prompt-handover.d.ts +3 -2
  132. package/dist/session/thread/message-parsing.d.ts +3 -3
  133. package/dist/session/thread/plan-surface.d.ts +1 -0
  134. package/dist/session/thread/plan-surface.js +1 -0
  135. package/dist/session/thread/session-chat.js +5 -12
  136. package/dist/session/thread/session-context-metrics.d.ts +15 -0
  137. package/dist/session/thread/session-context-metrics.js +10 -1
  138. package/dist/session/thread/session-context-modal.d.ts +4 -2
  139. package/dist/session/thread/session-context-modal.js +16 -9
  140. package/dist/session/thread/session-history-scroll.d.ts +2 -1
  141. package/dist/session/thread/session-thread.js +1 -1
  142. package/dist/session/thread/transcript.d.ts +4 -0
  143. package/dist/session/thread/transcript.js +18 -5
  144. package/dist/session/thread/turn-share.d.ts +16 -0
  145. package/dist/session/thread/turn-share.js +162 -0
  146. package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -0
  147. package/dist/session/tool/tools/apply-patch-tool.js +1 -0
  148. package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -0
  149. package/dist/session/tool/tools/pty-kill-tool.js +1 -0
  150. package/dist/session/tool/tools/pty-read-tool.d.ts +2 -0
  151. package/dist/session/tool/tools/pty-read-tool.js +2 -0
  152. package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -0
  153. package/dist/session/tool/tools/pty-spawn-tool.js +1 -0
  154. package/dist/session/tool/tools/pty-write-tool.d.ts +1 -0
  155. package/dist/session/tool/tools/pty-write-tool.js +1 -0
  156. package/dist/session/tool/tools/todo-write-tool.d.ts +1 -0
  157. package/dist/session/tool/tools/todo-write-tool.js +1 -0
  158. package/dist/session/turn/message-author-label.js +6 -2
  159. package/dist/session/turn/plan-anchor.d.ts +3 -0
  160. package/dist/session/turn/plan-anchor.js +3 -0
  161. package/dist/session/turn/plan-card.d.ts +7 -0
  162. package/dist/session/turn/plan-card.js +7 -0
  163. package/dist/styles.css +1 -1
  164. package/dist/terminal/pty-connection.d.ts +5 -4
  165. package/dist/terminal/session-terminal-connect-bar.js +2 -1
  166. package/dist/workspace/index.d.ts +1 -0
  167. package/dist/workspace/index.js +1 -0
  168. package/dist/workspace/saved-session-skeleton-shape.d.ts +4 -3
  169. package/dist/workspace/saved-session-skeleton.d.ts +5 -1
  170. package/dist/workspace/saved-session-skeleton.js +5 -4
  171. package/dist/workspace/session-workspace.js +4 -5
  172. package/dist/workspace/sidebar/footer/project-goals-nav.d.ts +6 -0
  173. package/dist/workspace/sidebar/footer/project-goals-nav.js +26 -0
  174. package/dist/workspace/sidebar/modal/session-embed-section.d.ts +25 -0
  175. package/dist/workspace/sidebar/modal/session-embed-section.js +71 -0
  176. package/dist/workspace/sidebar/modal/share-session-modal.js +2 -2
  177. package/dist/workspace/sidebar/nav-row-meta.js +14 -2
  178. package/dist/workspace/sidebar/project-nav-items.js +3 -0
  179. package/dist/workspace/sidebar/project-session-list.js +12 -3
  180. package/dist/workspace/sidebar/session-brief-hover-card.js +33 -9
  181. package/package.json +12 -4
  182. package/skills/kortix-ui/references/modules.md +2 -0
  183. package/dist/session/status/use-readiness-settling.d.ts +0 -18
  184. package/dist/session/status/use-readiness-settling.js +0 -43
  185. package/dist/workspace/sidebar/modal/session-public-link-section.d.ts +0 -13
  186. package/dist/workspace/sidebar/modal/session-public-link-section.js +0 -66
@@ -36,6 +36,7 @@ import { Input } from '../../../primitives/input.js';
36
36
  import { InputGroup, InputGroupInput } from '../../../primitives/input-group.js';
37
37
  import Loading from '../../../primitives/loading.js';
38
38
  import { Skeleton } from '../../../primitives/skeleton.js';
39
+ import { Switch } from '../../../primitives/switch.js';
39
40
  import { SplitSheetBody, SplitSheetDescription, SplitSheetFooter, SplitSheetHeader, SplitSheetTitle, } from '../../../primitives/split-sheet.js';
40
41
  import { errorToast, successToast } from '../../../primitives/toast.js';
41
42
  import { ProviderLogoStatus } from '../../providers/provider-connect.js';
@@ -46,6 +47,7 @@ import { CaretRightIcon, XIcon } from '@phosphor-icons/react';
46
47
  import { useMutation, useQueryClient } from '@tanstack/react-query';
47
48
  import { useModelsPageSheet } from '../models-page-sheet.js';
48
49
  import { CustomProviderForm } from './custom-provider-form.js';
50
+ import { formatTokenCount } from './utils.js';
49
51
  /** One saved custom provider: a configured row opens the sheet, a legacy row
50
52
  * pre-fills the form. */
51
53
  export function CustomProviderRow({ provider, selected, onSelect, }) {
@@ -57,6 +59,22 @@ export function CustomProviderRow({ provider, selected, onSelect, }) {
57
59
  function DetailRow({ label, value, mono = true }) {
58
60
  return (_jsxs("div", { className: "flex min-h-10 items-center justify-between gap-4 py-2", children: [_jsx("span", { className: "text-muted-foreground shrink-0 text-sm", children: label }), _jsx("span", { className: cn('text-foreground min-w-0 truncate', mono ? 'font-mono text-xs' : 'text-sm'), children: value })] }));
59
61
  }
62
+ /**
63
+ * A model as the PUT takes it: the switches travel, the limits do not, so
64
+ * every save reads the window again from the endpoint's `GET /models`.
65
+ */
66
+ const modelInput = ({ id, name, attachment, reasoning }) => ({
67
+ id,
68
+ name,
69
+ ...(attachment !== undefined ? { attachment } : {}),
70
+ ...(reasoning !== undefined ? { reasoning } : {}),
71
+ });
72
+ /** One saved model: its window, and the image and reasoning switches (each saves at once). */
73
+ function ModelRow({ model, disabled, onToggle, }) {
74
+ const t = useTranslations('customProvider');
75
+ const context = formatTokenCount(model.context);
76
+ return (_jsxs("div", { className: "space-y-2 py-2", children: [_jsxs("div", { className: "flex min-h-6 items-center justify-between gap-4", children: [_jsx("span", { className: "text-muted-foreground shrink-0 text-sm", children: model.name }), _jsx("span", { className: "text-foreground min-w-0 truncate font-mono text-xs", children: model.id })] }), _jsxs("div", { className: "text-muted-foreground flex flex-wrap items-center gap-x-5 gap-y-2 text-xs", children: [_jsx("span", { className: "tabular-nums", children: context ? t('contextWindow', { tokens: context }) : t('contextDefault') }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx(Switch, { checked: model.attachment === true, disabled: disabled, onCheckedChange: (attachment) => onToggle({ attachment }) }), t('readsImages')] }), _jsxs("label", { className: "flex items-center gap-2", children: [_jsx(Switch, { checked: model.reasoning === true, disabled: disabled, onCheckedChange: (reasoning) => onToggle({ reasoning }) }), t('reasoning')] })] })] }));
77
+ }
60
78
  /**
61
79
  * The endpoint editor in the sheet. The PUT replaces the provider's whole
62
80
  * definition, so this edits the full model list in place.
@@ -72,7 +90,7 @@ function EndpointEditor({ projectId, provider, onClose, }) {
72
90
  const save = useMutation({
73
91
  mutationFn: () => {
74
92
  const trimmed = models
75
- .map((m) => ({ id: m.id.trim(), name: m.name.trim() }))
93
+ .map((m) => modelInput({ ...m, id: m.id.trim(), name: m.name.trim() }))
76
94
  .filter((m) => m.id || m.name);
77
95
  if (!name.trim() || !/^https?:\/\//.test(baseUrl.trim())) {
78
96
  throw new Error('Name and an http:// or https:// base URL are required');
@@ -108,12 +126,22 @@ function CustomProviderDetail({ projectId, provider, onDeleted, }) {
108
126
  const [confirmDelete, setConfirmDelete] = useState(false);
109
127
  const [value, setValue] = useState('');
110
128
  const replace = useMutation({
111
- mutationFn: () => upsertProjectSecret(projectId, {
112
- name: provider.secret_name,
113
- value: value.trim(),
114
- strategy: 'broker',
115
- consumer: 'llm_gateway',
116
- }),
129
+ mutationFn: async () => {
130
+ await upsertProjectSecret(projectId, {
131
+ name: provider.secret_name,
132
+ value: value.trim(),
133
+ strategy: 'broker',
134
+ consumer: 'llm_gateway',
135
+ });
136
+ // Re-save the endpoint: it reads the model limits from `GET /models` with the new key.
137
+ if (provider.configured && provider.base_url) {
138
+ await custom.save(provider.id, {
139
+ name: provider.name,
140
+ base_url: provider.base_url,
141
+ models: provider.models.map(modelInput),
142
+ });
143
+ }
144
+ },
117
145
  onSuccess: () => {
118
146
  successToast(t('keyReplaced'));
119
147
  setValue('');
@@ -124,6 +152,14 @@ function CustomProviderDetail({ projectId, provider, onDeleted, }) {
124
152
  },
125
153
  onError: (err) => errorToast(err instanceof Error ? err.message : tI18nComplete.raw('text2c07997249ab')),
126
154
  });
155
+ const toggle = useMutation({
156
+ mutationFn: ({ id, patch }) => custom.save(provider.id, {
157
+ name: provider.name,
158
+ base_url: provider.base_url ?? '',
159
+ models: provider.models.map((m) => modelInput(m.id === id ? { ...m, ...patch } : m)),
160
+ }),
161
+ onError: (err) => errorToast(err instanceof Error ? err.message : t('saveFailed')),
162
+ });
127
163
  const remove = useMutation({
128
164
  mutationFn: () => custom.remove(provider.id),
129
165
  onSuccess: () => {
@@ -139,7 +175,7 @@ function CustomProviderDetail({ projectId, provider, onDeleted, }) {
139
175
  if (value.trim() && !replace.isPending)
140
176
  replace.mutate();
141
177
  };
142
- return (_jsxs(_Fragment, { children: [_jsx(SplitSheetHeader, { closeLabel: tSheet('close'), className: "px-5 py-4", children: _jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx(ProviderLogoStatus, { providerId: provider.id, label: provider.name, status: "connected", size: "large" }), _jsxs("div", { className: "min-w-0 space-y-0.5", children: [_jsx(SplitSheetTitle, { className: "truncate text-base font-semibold", children: provider.name }), _jsx(SplitSheetDescription, { className: "font-mono", children: provider.id })] })] }) }), _jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsxs("section", { className: "space-y-1", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: t('endpoint') }), editing ? (_jsx(EndpointEditor, { projectId: projectId, provider: provider, onClose: () => setEditing(false) })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "divide-border divide-y", children: [_jsx(DetailRow, { label: tI18nComplete.raw('text70589413a3c9'), value: provider.base_url ?? '' }), _jsx(DetailRow, { label: tI18nComplete.raw('text16f0ee47f993'), value: provider.has_key ? provider.secret_name : t('noKey'), mono: provider.has_key })] }), _jsx("h3", { className: "text-foreground pt-4 text-sm font-medium", children: t('models') }), _jsx("div", { className: "divide-border divide-y", children: provider.models.map((model) => (_jsx(DetailRow, { label: model.name, value: model.id }, model.id))) }), _jsx(Button, { type: "button", size: "sm", variant: "secondary", className: "mt-3", onClick: () => setEditing(true), children: t('editEndpoint') })] }))] }), _jsx("section", { className: "space-y-1", children: replacing ? (_jsxs("form", { onSubmit: submit, className: "space-y-3", "data-custom-provider-replace": "", children: [_jsx("label", { htmlFor: `custom-replace-${provider.id}`, className: "sr-only", children: tI18nComplete.raw('text16f0ee47f993') }), _jsx(InputGroup, { children: _jsx(InputGroupInput, { id: `custom-replace-${provider.id}`, type: "password", autoComplete: "off", spellCheck: false, autoFocus: true, "data-1p-ignore": "", "data-lpignore": "true", "data-form-type": "other", value: value, onChange: (event) => setValue(event.target.value), placeholder: tI18nComplete.raw('textb009c6c5299f'), className: "font-mono" }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { type: "submit", size: "sm", disabled: !value.trim() || replace.isPending, className: "gap-1.5", children: [replace.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tSheet('saveKey')] }), _jsx(Button, { type: "button", size: "sm", variant: "ghost", disabled: replace.isPending, onClick: () => {
178
+ return (_jsxs(_Fragment, { children: [_jsx(SplitSheetHeader, { closeLabel: tSheet('close'), className: "px-5 py-4", children: _jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [_jsx(ProviderLogoStatus, { providerId: provider.id, label: provider.name, status: "connected", size: "large" }), _jsxs("div", { className: "min-w-0 space-y-0.5", children: [_jsx(SplitSheetTitle, { className: "truncate text-base font-semibold", children: provider.name }), _jsx(SplitSheetDescription, { className: "font-mono", children: provider.id })] })] }) }), _jsxs(SplitSheetBody, { className: "space-y-7", children: [_jsxs("section", { className: "space-y-1", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: t('endpoint') }), editing ? (_jsx(EndpointEditor, { projectId: projectId, provider: provider, onClose: () => setEditing(false) })) : (_jsxs(_Fragment, { children: [_jsxs("div", { className: "divide-border divide-y", children: [_jsx(DetailRow, { label: tI18nComplete.raw('text70589413a3c9'), value: provider.base_url ?? '' }), _jsx(DetailRow, { label: tI18nComplete.raw('text16f0ee47f993'), value: provider.has_key ? provider.secret_name : t('noKey'), mono: provider.has_key })] }), _jsx("h3", { className: "text-foreground pt-4 text-sm font-medium", children: t('models') }), _jsx("div", { className: "divide-border divide-y", children: provider.models.map((model) => (_jsx(ModelRow, { model: model, disabled: toggle.isPending || !provider.base_url, onToggle: (patch) => toggle.mutate({ id: model.id, patch }) }, model.id))) }), _jsx(Button, { type: "button", size: "sm", variant: "secondary", className: "mt-3", onClick: () => setEditing(true), children: t('editEndpoint') })] }))] }), _jsx("section", { className: "space-y-1", children: replacing ? (_jsxs("form", { onSubmit: submit, className: "space-y-3", "data-custom-provider-replace": "", children: [_jsx("label", { htmlFor: `custom-replace-${provider.id}`, className: "sr-only", children: tI18nComplete.raw('text16f0ee47f993') }), _jsx(InputGroup, { children: _jsx(InputGroupInput, { id: `custom-replace-${provider.id}`, type: "password", autoComplete: "off", spellCheck: false, autoFocus: true, "data-1p-ignore": "", "data-lpignore": "true", "data-form-type": "other", value: value, onChange: (event) => setValue(event.target.value), placeholder: tI18nComplete.raw('textb009c6c5299f'), className: "font-mono" }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs(Button, { type: "submit", size: "sm", disabled: !value.trim() || replace.isPending, className: "gap-1.5", children: [replace.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tSheet('saveKey')] }), _jsx(Button, { type: "button", size: "sm", variant: "ghost", disabled: replace.isPending, onClick: () => {
143
179
  setValue('');
144
180
  setReplacing(false);
145
181
  }, children: tSheet('cancel') })] })] })) : (_jsx(Button, { type: "button", size: "sm", variant: "secondary", onClick: () => setReplacing(true), children: provider.has_key ? t('replaceKey') : t('addKey') })) }), _jsx("p", { className: "text-muted-foreground text-xs text-pretty", children: t('gatewayNote') })] }), _jsxs(SplitSheetFooter, { className: "justify-between", children: [_jsx(Button, { type: "button", size: "sm", variant: "ghost", className: "text-destructive hover:text-destructive -ml-2", onClick: () => setConfirmDelete(true), children: t('deleteProvider') }), _jsx("span", { className: "text-muted-foreground text-xs", children: tSheet('storedEncrypted') })] }), _jsx(ConfirmDialog, { open: confirmDelete, onOpenChange: setConfirmDelete, title: t('deleteTitle'), description: t('deleteBody', { name: provider.name }), confirmLabel: t('deleteProvider'), confirmVariant: "destructive", isPending: remove.isPending, onConfirm: () => remove.mutate() })] }));
@@ -35,6 +35,9 @@ export interface CustomFormState {
35
35
  apiKey: string;
36
36
  modelId: string;
37
37
  modelName: string;
38
+ /** Unset until the user flips the switch: the endpoint's `GET /models` decides. */
39
+ attachment?: boolean;
40
+ reasoning?: boolean;
38
41
  }
39
42
  export type ChatGptPhase = 'idle' | 'waiting' | 'done';
40
43
  export type ChatGptChallenge = {
@@ -170,8 +170,8 @@ export function formatTokenCount(tokens) {
170
170
  if (!tokens || tokens <= 0)
171
171
  return '';
172
172
  if (tokens >= 1_000_000) {
173
- const millions = tokens / 1_000_000;
174
- return `${Number.isInteger(millions) ? millions : millions.toFixed(1)}M`;
173
+ // 1,048,576 reads "1M", not "1.0M".
174
+ return `${Number(Math.round((tokens / 1_000_000) * 10) / 10)}M`;
175
175
  }
176
176
  if (tokens >= 1_000)
177
177
  return `${Math.round(tokens / 1000)}K`;
@@ -1,4 +1,4 @@
1
- import type { AgentConfigBlock, AgentGrantSetV2, SandboxTemplate } from '@kortix/sdk';
1
+ import type { AgentConfigBlock, SandboxTemplate } from '@kortix/sdk';
2
2
  import { type GrantOption } from './grant-mode-field.js';
3
3
  type SetKortix = <K extends keyof AgentConfigBlock>(key: K, value: AgentConfigBlock[K]) => void;
4
4
  /**
@@ -12,25 +12,18 @@ export declare function RequiredConnectorToggle({ active, onToggle, }: {
12
12
  active: boolean;
13
13
  onToggle: () => void;
14
14
  }): import("react").JSX.Element;
15
- /** The summary chip at a grant card's right edge — "All", "3 picked", "None". */
16
- export declare function GrantChip({ value }: {
17
- value: AgentGrantSetV2 | undefined;
18
- }): import("react").JSX.Element;
19
15
  /**
20
- * Chip plus a link to the project-wide page for the same thing. A grant page
21
- * picks from what the project has; adding, editing or removing one of them
22
- * happens on its own Customize tab (Marko, 2026-09-03: "for now … point to
23
- * the general page … to see & browse em all"). Full CRUD in place is the
24
- * follow-up.
16
+ * The section action of a grant page: one `secondary` button to the
17
+ * project-wide page for the same thing. A grant page picks from what the
18
+ * project has; adding, editing or removing one happens on its own Customize
19
+ * tab. The grant mode row already states All / Pick / None, so the header
20
+ * carries no summary chip.
25
21
  */
26
- export declare function GrantHeaderTrailing({ value, tab, href, label, }: {
27
- value: AgentGrantSetV2 | undefined;
22
+ export declare function ManageButton({ tab, href, }: {
28
23
  tab?: 'skills' | 'connectors' | 'secrets';
29
- /** A page `tab` cannot name — Apps is a Customize tab, reached
30
- * through `capabilityTabHref(projectId, 'apps')`. */
24
+ /** A page `tab` cannot name, such as Apps. */
31
25
  href?: (projectId: string) => string | null;
32
- label: string;
33
- }): import("react").JSX.Element;
26
+ }): import("react").JSX.Element | null;
34
27
  interface GrantSectionProps {
35
28
  draft: AgentConfigBlock;
36
29
  set: SetKortix;
@@ -9,7 +9,6 @@ import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
9
9
  * (`kortix.yaml`) rather than the question they answer. Same writes, same
10
10
  * platform enforcement; the heading now says what it governs.
11
11
  */
12
- import { Badge } from '../../../primitives/badge.js';
13
12
  import { Button } from '../../../primitives/button.js';
14
13
  import Hint from '../../../primitives/hint.js';
15
14
  import { Switch } from '../../../primitives/switch.js';
@@ -17,11 +16,11 @@ import { capabilityTabHref } from '../../../internal/lib/capability-tab-routes.j
17
16
  import { SandboxTemplateMenu, describeSandboxTemplate, } from '../../../access/sandbox-template-menu.js';
18
17
  import { cn } from '../../../internal/lib/utils.js';
19
18
  import { useKortixRouteProjectId } from '@kortix/sdk/react';
20
- import { ArrowRightIcon, CaretDownIcon, CubeIcon } from '@phosphor-icons/react';
19
+ import { CaretDownIcon, CubeIcon } from '@phosphor-icons/react';
21
20
  import { UiLink as Link } from '../../../providers/ui-provider.js';
22
21
  import { EditorSection, SettingRow } from './agent-editor-primitives.js';
23
22
  import { pruneRequiredConnectors } from './connectors-personal.js';
24
- import { GrantSetField, KortixPermissionsField, grantSummary } from './grant-mode-field.js';
23
+ import { GrantSetField, KortixPermissionsField } from './grant-mode-field.js';
25
24
  /**
26
25
  * Marks one granted connector as required before session start.
27
26
  *
@@ -31,27 +30,28 @@ import { GrantSetField, KortixPermissionsField, grantSummary } from './grant-mod
31
30
  */
32
31
  export function RequiredConnectorToggle({ active, onToggle, }) {
33
32
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
34
- return (_jsx(Hint, { label: active ? tI18nComplete.raw('text49c8975f345b') : tI18nComplete.raw('texta54220c82b33'), children: _jsx("button", { type: "button", "aria-pressed": active, "aria-label": active ? tI18nComplete.raw('textd16c94c19673') : tI18nComplete.raw('text63336c8a8e83'), onClick: onToggle, className: cn('shrink-0 rounded px-1.5 py-1 text-xs transition-[color,background-color,transform] active:scale-[0.96]', active
35
- ? 'bg-kortix-purple/15 text-kortix-purple font-medium'
36
- : 'text-muted-foreground/50 hover:text-muted-foreground hover:bg-muted/50'), children: tI18nComplete.raw('text4850b174b713') }) }));
37
- }
38
- /** The summary chip at a grant card's right edge — "All", "3 picked", "None". */
39
- export function GrantChip({ value }) {
40
- const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
41
- const summary = grantSummary(value, tI18nComplete);
42
- return (_jsx(Badge, { variant: summary.tone === 'muted' ? 'muted' : 'outline', size: "sm", className: "tabular-nums", children: summary.label }));
33
+ return (_jsx(Hint, { label: active ? tI18nComplete.raw('text49c8975f345b') : tI18nComplete.raw('texta54220c82b33'), children: _jsx(Button, { type: "button", variant: active ? 'secondary' : 'ghost', size: "sm", "aria-pressed": active, "aria-label": active ? tI18nComplete.raw('textd16c94c19673') : tI18nComplete.raw('text63336c8a8e83'), onClick: onToggle, className: cn('shrink-0', !active && 'text-muted-foreground'), children: tI18nComplete.raw('text4850b174b713') }) }));
43
34
  }
44
35
  /**
45
- * Chip plus a link to the project-wide page for the same thing. A grant page
46
- * picks from what the project has; adding, editing or removing one of them
47
- * happens on its own Customize tab (Marko, 2026-09-03: "for now … point to
48
- * the general page … to see & browse em all"). Full CRUD in place is the
49
- * follow-up.
36
+ * The section action of a grant page: one `secondary` button to the
37
+ * project-wide page for the same thing. A grant page picks from what the
38
+ * project has; adding, editing or removing one happens on its own Customize
39
+ * tab. The grant mode row already states All / Pick / None, so the header
40
+ * carries no summary chip.
50
41
  */
51
- export function GrantHeaderTrailing({ value, tab, href, label, }) {
42
+ export function ManageButton({ tab, href, }) {
43
+ const tEditor = useI18nTranslations('agentEditor');
52
44
  const projectId = useKortixRouteProjectId();
53
- const target = projectId ? (href ? href(projectId) : tab ? capabilityTabHref(projectId, tab) : null) : null;
54
- return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(GrantChip, { value: value }), target ? (_jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "gap-1 px-2", children: _jsxs(Link, { href: target, prefetch: true, children: [label, _jsx(ArrowRightIcon, { className: "size-3.5 shrink-0" })] }) })) : null] }));
45
+ const target = projectId
46
+ ? href
47
+ ? href(projectId)
48
+ : tab
49
+ ? capabilityTabHref(projectId, tab)
50
+ : null
51
+ : null;
52
+ if (!target)
53
+ return null;
54
+ return (_jsx(Button, { asChild: true, variant: "secondary", size: "sm", children: _jsx(Link, { href: target, prefetch: true, children: tEditor('manage') }) }));
55
55
  }
56
56
  /*
57
57
  * Each grant set is its own page on the agent editor's rail (Marko,
@@ -60,17 +60,17 @@ export function GrantHeaderTrailing({ value, tab, href, label, }) {
60
60
  */
61
61
  export function SkillsSection({ draft, set, options }) {
62
62
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
63
- return (_jsx(EditorSection, { title: tI18nComplete.raw('text66d0f523a379'), description: tI18nComplete.raw('textb27e54100c96'), trailing: _jsx(GrantHeaderTrailing, { value: draft.skills, tab: "skills", label: tI18nComplete.raw('text78abcbbfb830') }), children: _jsx("div", { className: "py-4", children: _jsx(GrantSetField, { value: draft.skills, onChange: (v) => set('skills', v), options: options, allLabel: tI18nComplete.raw('textf059c2dbe260'), emptyLabel: tI18nComplete.raw('text66e36043ff7c') }) }) }));
63
+ return (_jsx(EditorSection, { title: tI18nComplete.raw('text66d0f523a379'), description: tI18nComplete.raw('textb27e54100c96'), trailing: _jsx(ManageButton, { tab: "skills" }), lead: true, bare: true, children: _jsx(GrantSetField, { value: draft.skills, onChange: (v) => set('skills', v), options: options, emptyLabel: tI18nComplete.raw('text66e36043ff7c') }) }));
64
64
  }
65
65
  export function ConnectorsSection({ draft, set, options }) {
66
66
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
67
- return (_jsx(EditorSection, { title: tI18nComplete.raw('textc3d2e79ebdd0'), description: tI18nComplete.raw('text00f5aae9f9d3'), trailing: _jsx(GrantHeaderTrailing, { value: draft.connectors, tab: "connectors", label: tI18nComplete.raw('textd83250185d41') }), children: _jsxs("div", { className: "space-y-2 py-4", children: [_jsx(GrantSetField, { value: draft.connectors, onChange: (v) => {
67
+ return (_jsx(EditorSection, { title: tI18nComplete.raw('textc3d2e79ebdd0'), description: tI18nComplete.raw('text00f5aae9f9d3'), trailing: _jsx(ManageButton, { tab: "connectors" }), lead: true, bare: true, children: _jsxs("div", { className: "space-y-3", children: [_jsx(GrantSetField, { value: draft.connectors, onChange: (v) => {
68
68
  set('connectors', v);
69
69
  const pruned = pruneRequiredConnectors(draft.connectors_required, v);
70
70
  if (pruned?.length !== draft.connectors_required?.length) {
71
71
  set('connectors_required', pruned);
72
72
  }
73
- }, options: options, allLabel: tI18nComplete.raw('text35e54cea7f41'), emptyLabel: tI18nComplete.raw('text389fb5217392'), rowAccessory: (id, isSelected) => isSelected ? (_jsx(RequiredConnectorToggle, { active: draft.connectors_required?.includes(id) === true, onToggle: () => {
73
+ }, options: options, emptyLabel: tI18nComplete.raw('text389fb5217392'), rowAccessory: (id, isSelected) => isSelected ? (_jsx(RequiredConnectorToggle, { active: draft.connectors_required?.includes(id) === true, onToggle: () => {
74
74
  const current = draft.connectors_required ?? [];
75
75
  const next = current.includes(id)
76
76
  ? current.filter((a) => a !== id)
@@ -80,7 +80,7 @@ export function ConnectorsSection({ draft, set, options }) {
80
80
  }
81
81
  export function SecretsSection({ draft, set, options }) {
82
82
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
83
- return (_jsx(EditorSection, { title: tI18nComplete.raw('textd8707d411d99'), description: tI18nComplete.raw('text7f619d9e30a8'), trailing: _jsx(GrantHeaderTrailing, { value: draft.secrets, tab: "secrets", label: tI18nComplete.raw('text0b38e3daeb93') }), children: _jsx("div", { className: "py-4", children: _jsx(GrantSetField, { value: draft.secrets, onChange: (v) => set('secrets', v), options: options, allLabel: tI18nComplete.raw('text86fdc0c950d5'), emptyLabel: tI18nComplete.raw('text82a37b8c2266') }) }) }));
83
+ return (_jsx(EditorSection, { title: tI18nComplete.raw('textd8707d411d99'), description: tI18nComplete.raw('text7f619d9e30a8'), trailing: _jsx(ManageButton, { tab: "secrets" }), lead: true, bare: true, children: _jsx(GrantSetField, { value: draft.secrets, onChange: (v) => set('secrets', v), options: options, emptyLabel: tI18nComplete.raw('text82a37b8c2266') }) }));
84
84
  }
85
85
  /**
86
86
  * A kortix_version 3 grant over a project registry: the declared subagents
@@ -90,7 +90,7 @@ export function SecretsSection({ draft, set, options }) {
90
90
  */
91
91
  export function RegistryGrantSection({ grant, draft, set, options, }) {
92
92
  const t = useI18nTranslations('agents.grants');
93
- return (_jsx(EditorSection, { title: t(`${grant}.title`), description: t(`${grant}.description`), trailing: _jsx(GrantChip, { value: draft[grant] }), children: _jsx("div", { className: "py-4", children: _jsx(GrantSetField, { value: draft[grant], onChange: (v) => set(grant, v), options: options, allLabel: t(`${grant}.all`), emptyLabel: t(`${grant}.empty`) }) }) }));
93
+ return (_jsx(EditorSection, { title: t(`${grant}.title`), description: t(`${grant}.description`), lead: true, bare: true, children: _jsx(GrantSetField, { value: draft[grant], onChange: (v) => set(grant, v), options: options, emptyLabel: t(`${grant}.empty`) }) }));
94
94
  }
95
95
  /** Kortix permissions (`kortix_permissions` in kortix.yaml): which project
96
96
  * operations the agent may perform, through any surface. A block read from a
@@ -99,10 +99,10 @@ export function RegistryGrantSection({ grant, draft, set, options, }) {
99
99
  export function ProjectActionsSection({ draft, set }) {
100
100
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
101
101
  const permissions = draft.kortix_permissions ?? draft.kortix_cli;
102
- return (_jsx(EditorSection, { title: tI18nComplete.raw('text8f12a6e05e6d'), description: tI18nComplete.raw('text15365eb45e29'), trailing: _jsx(GrantChip, { value: permissions }), children: _jsx("div", { className: "py-4", children: _jsx(KortixPermissionsField, { value: permissions, onChange: (v) => {
103
- set('kortix_cli', undefined);
104
- set('kortix_permissions', v);
105
- } }) }) }));
102
+ return (_jsx(EditorSection, { title: tI18nComplete.raw('text8f12a6e05e6d'), description: tI18nComplete.raw('text15365eb45e29'), lead: true, bare: true, children: _jsx(KortixPermissionsField, { value: permissions, onChange: (v) => {
103
+ set('kortix_cli', undefined);
104
+ set('kortix_permissions', v);
105
+ } }) }));
106
106
  }
107
107
  export function WorkspaceSection({ draft, set, sandboxTemplates, defaultSandboxSlug, }) {
108
108
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
@@ -116,7 +116,7 @@ export function WorkspaceSection({ draft, set, sandboxTemplates, defaultSandboxS
116
116
  // manifest on the next save.
117
117
  const stalePin = draft.sandbox && !pinned ? draft.sandbox : null;
118
118
  const PinnedIcon = pinned ? describeSandboxTemplate(pinned).Icon : CubeIcon;
119
- return (_jsxs(EditorSection, { title: tI18nComplete.raw('text87bb59ba2f92'), description: tI18nComplete.raw('text76a5e5a39b4a'), children: [_jsx(SettingRow, { label: tI18nComplete.raw('text9e471951a1b4'), help: draft.sandbox
119
+ return (_jsxs(EditorSection, { title: tI18nComplete.raw('text87bb59ba2f92'), description: tI18nComplete.raw('text76a5e5a39b4a'), lead: true, children: [_jsx(SettingRow, { label: tI18nComplete.raw('text9e471951a1b4'), help: draft.sandbox
120
120
  ? stalePin
121
121
  ? tI18nComplete.raw('textb1a5c13d215e')
122
122
  : tI18nComplete.raw('text0703d9121fd7')
@@ -16,7 +16,6 @@ import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
16
16
  * section to match would strand one switch in a section of its own for a
17
17
  * reason no reader could see.
18
18
  */
19
- import { Badge } from '../../../primitives/badge.js';
20
19
  import { Button } from '../../../primitives/button.js';
21
20
  import { Disclosure, DisclosureContent, DisclosureTrigger } from '../../../primitives/disclosure.js';
22
21
  import { Input } from '../../../primitives/input.js';
@@ -34,7 +33,7 @@ import { EditorSection, InlineAction, SettingBlock, SettingRow } from './agent-e
34
33
  const INHERIT = '__inherit__';
35
34
  export function BasicsSection({ draft, set, oc, setOc, showDescription = true, }) {
36
35
  const tI18nComplete = useI18nTranslations('hardcodedUi.i18nComplete');
37
- return (_jsxs(EditorSection, { title: tI18nComplete.raw('text8fdd2ee8475e'), description: tI18nComplete.raw('text4e420a5186f0'), children: [_jsx(SettingRow, { label: tI18nComplete.raw('text92c1cdfdf4cb'), help: tI18nComplete.raw('textbe90a56d29da'), children: _jsx("div", { className: "flex sm:justify-end", children: _jsx(Switch, { "aria-label": tI18nComplete.raw('text92c1cdfdf4cb'), checked: draft.enabled !== false, onCheckedChange: (v) => set('enabled', v ? undefined : false) }) }) }), showDescription ? (_jsx(SettingBlock, { label: tI18nComplete.raw('text526e0087cc3f'), help: oc.mode === 'subagent'
36
+ return (_jsxs(EditorSection, { title: tI18nComplete.raw('text8fdd2ee8475e'), description: tI18nComplete.raw('text4e420a5186f0'), lead: true, children: [_jsx(SettingRow, { label: tI18nComplete.raw('text92c1cdfdf4cb'), help: tI18nComplete.raw('textbe90a56d29da'), children: _jsx("div", { className: "flex sm:justify-end", children: _jsx(Switch, { "aria-label": tI18nComplete.raw('text92c1cdfdf4cb'), checked: draft.enabled !== false, onCheckedChange: (v) => set('enabled', v ? undefined : false) }) }) }), showDescription ? (_jsx(SettingBlock, { label: tI18nComplete.raw('text526e0087cc3f'), help: oc.mode === 'subagent'
38
37
  ? tI18nComplete.raw('text77e2bc11f6ab')
39
38
  : tI18nComplete.raw('text9965df7c3221'), children: _jsx(Textarea, { "aria-label": tI18nComplete.raw('text526e0087cc3f'), value: oc.description ?? '', placeholder: tI18nComplete.raw('text446f4eabf99f'), minHeight: 44, className: "text-sm", onChange: (e) => setOc('description', e.target.value) }) })) : null, _jsx(SettingRow, { label: tI18nComplete.raw('text12f67f8539c4'), help: oc.mode ? AGENT_MODE_HELP[oc.mode] : tI18nComplete.raw('text64f405e80a8d'), children: _jsxs(Select, { value: oc.mode ?? INHERIT, onValueChange: (value) => setOc('mode', value === INHERIT ? undefined : value), children: [_jsx(SelectTrigger, { "aria-label": tI18nComplete.raw('text12f67f8539c4'), className: "h-9 w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: INHERIT, children: tI18nComplete.raw('texte8cb80e5c5cb') }), AGENT_MODES.map((mode) => (_jsx(SelectItem, { value: mode, children: AGENT_MODE_LABEL[mode] }, mode)))] })] }) }), _jsx(SettingRow, { label: tI18nComplete.raw('textc7bcb471c03d'), help: tI18nComplete.raw('textdd4971af3f91'), children: _jsx("div", { className: "flex sm:justify-end", children: _jsx(Switch, { "aria-label": tI18nComplete.raw('textc7bcb471c03d'), checked: !oc.hidden, onCheckedChange: (v) => setOc('hidden', v ? undefined : true) }) }) })] }));
40
39
  }
@@ -51,17 +50,11 @@ export function ModelSection({ oc, setOc, showPrompt = true, }) {
51
50
  ? models.find((m) => m.providerID === selectedModelKey.providerID && m.modelID === selectedModelKey.modelID)
52
51
  : undefined;
53
52
  const variantChoices = selectedModel?.variants ? Object.keys(selectedModel.variants) : [];
54
- // The sampling knobs and the step cap are set on a handful of agents and
55
- // read by fewer. They open only when one of them carries a value, so an
56
- // agent that tunes nothing shows one row — the model — and nothing else.
57
- const advancedSet = !isSliderAtDefault(oc.temperature, 0) ||
58
- !isSliderAtDefault(oc.top_p, 1) ||
59
- oc.steps !== undefined;
60
- return (_jsxs(_Fragment, { children: [_jsxs(EditorSection, { title: tI18nComplete.raw('text5e2c614c23f0'), description: tI18nComplete.raw('text32398dbb68e2'), children: [_jsx(SettingRow, { label: tI18nComplete.raw('text34455bf1d857'), help: oc.model ? (_jsx(InlineAction, { onClick: () => setOc('model', undefined), children: tI18nComplete.raw('text9db60344e984') })) : (tI18nComplete.raw('text64f405e80a8d')), children: _jsx("div", { className: "flex sm:justify-end", children: _jsx(ModelSelector, { models: models, providers: providers, selectedModel: selectedModelKey, unsetLabel: tI18nComplete.raw('texte8cb80e5c5cb'), onSelect: (m) => setOc('model', m ? modelKeyToWire(m) : undefined) }) }) }), variantChoices.length > 0 ? (_jsx(SettingRow, { label: tI18nComplete.raw('text264c28cbf01c'), help: oc.variant
53
+ return (_jsxs(_Fragment, { children: [_jsxs(EditorSection, { title: tI18nComplete.raw('text5e2c614c23f0'), description: tI18nComplete.raw('text32398dbb68e2'), lead: true, children: [_jsx(SettingRow, { label: tI18nComplete.raw('text34455bf1d857'), help: oc.model ? (_jsx(InlineAction, { onClick: () => setOc('model', undefined), children: tI18nComplete.raw('text9db60344e984') })) : (tI18nComplete.raw('text64f405e80a8d')), children: _jsx("div", { className: "flex sm:justify-end", children: _jsx(ModelSelector, { models: models, providers: providers, selectedModel: selectedModelKey, unsetLabel: tI18nComplete.raw('texte8cb80e5c5cb'), onSelect: (m) => setOc('model', m ? modelKeyToWire(m) : undefined) }) }) }), variantChoices.length > 0 ? (_jsx(SettingRow, { label: tI18nComplete.raw('text264c28cbf01c'), help: oc.variant
61
54
  ? tI18nComplete.raw('text4dd21464c579')
62
55
  : tI18nComplete.raw('textf39c806f5724'), children: _jsx("div", { className: "flex sm:justify-end", children: _jsx(ReasoningEffortSelector, { variants: variantChoices, selectedVariant: oc.variant ?? null, onVariantChange: (v) => setOc('variant', v ?? undefined) }) }) })) : (_jsx(SettingRow, { label: tI18nComplete.raw('text3f19fe84a2de'), help: selectedModelKey
63
56
  ? tI18nComplete.raw('text0443f619cb33')
64
- : tI18nComplete.raw('text6376d74077c0'), children: _jsx(Input, { "aria-label": tI18nComplete.raw('text3f19fe84a2de'), value: oc.variant ?? '', placeholder: tI18nComplete.raw('text352a25678fb9'), variant: "popover", className: "h-9 w-full text-sm", onChange: (e) => setOc('variant', e.target.value) }) })), showPrompt ? (_jsx(SettingBlock, { label: tI18nComplete.raw('text561257c019e5'), help: tI18nComplete.raw('textad63817393a7'), children: _jsxs(Disclosure, { variant: "outline", className: "overflow-hidden rounded-md", children: [_jsx(DisclosureTrigger, { variant: "outline", children: _jsxs(Button, { variant: "popover", className: "flex w-full items-center justify-between gap-3 rounded-none text-sm font-normal", children: [_jsx("span", { className: "min-w-0 truncate", children: oc.prompt ? firstLine(oc.prompt) : tI18nComplete.raw('textdaaf5ab03267') }), _jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: oc.prompt ? 'Edit' : tI18nComplete.raw('text47f3fe537320') })] }) }), _jsx(DisclosureContent, { variant: "outline", contentClassName: "border-border border-t", children: _jsx(Textarea, { "aria-label": tI18nComplete.raw('text561257c019e5'), value: oc.prompt ?? '', placeholder: tI18nComplete.raw('text94a18ea1d428'), minHeight: 160, className: "rounded-none border-0 font-mono text-xs focus-visible:border-0 focus-visible:ring-0", onChange: (e) => setOc('prompt', e.target.value) }) })] }) })) : null] }), _jsxs(EditorSection, { title: tI18nComplete.raw('text6d06116595a9'), description: tI18nComplete.raw('text33439eb47c9a'), trailing: _jsx(Badge, { variant: advancedSet ? 'outline' : 'muted', size: "sm", children: advancedSet ? 'Customized' : 'Defaults' }), children: [_jsx(SliderRow, { label: tI18nComplete.raw('textb958ce8b871a'), help: tI18nComplete.raw('textd380d30f3d60'), value: oc.temperature, fallback: 0, min: 0, max: 2, step: 0.05, onChange: (v) => setOc('temperature', v) }), _jsx(SliderRow, { label: tI18nComplete.raw('text714db3dbb0b7'), help: tI18nComplete.raw('text4f370db531ba'), value: oc.top_p, fallback: 1, min: 0, max: 1, step: 0.01, onChange: (v) => setOc('top_p', v) }), _jsx(SettingRow, { label: tI18nComplete.raw('textfdc639c47624'), help: tI18nComplete.raw('textbf7ff92baea3'), children: _jsx(Input, { "aria-label": tI18nComplete.raw('textfdc639c47624'), type: "number", min: 1, value: oc.steps ?? '', placeholder: tI18nComplete.raw('textf7fcff0d8fea'), variant: "popover", className: "h-9 w-full text-sm tabular-nums", onChange: (e) => setOc('steps', e.target.value ? Math.max(1, Number(e.target.value)) : undefined) }) })] })] }));
57
+ : tI18nComplete.raw('text6376d74077c0'), children: _jsx(Input, { "aria-label": tI18nComplete.raw('text3f19fe84a2de'), value: oc.variant ?? '', placeholder: tI18nComplete.raw('text352a25678fb9'), variant: "popover", className: "h-9 w-full text-sm", onChange: (e) => setOc('variant', e.target.value) }) })), showPrompt ? (_jsx(SettingBlock, { label: tI18nComplete.raw('text561257c019e5'), help: tI18nComplete.raw('textad63817393a7'), children: _jsxs(Disclosure, { variant: "outline", className: "overflow-hidden rounded-md", children: [_jsx(DisclosureTrigger, { variant: "outline", children: _jsxs(Button, { variant: "popover", className: "flex w-full items-center justify-between gap-3 rounded-none text-sm font-normal", children: [_jsx("span", { className: "min-w-0 truncate", children: oc.prompt ? firstLine(oc.prompt) : tI18nComplete.raw('textdaaf5ab03267') }), _jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: oc.prompt ? 'Edit' : tI18nComplete.raw('text47f3fe537320') })] }) }), _jsx(DisclosureContent, { variant: "outline", contentClassName: "border-border border-t", children: _jsx(Textarea, { "aria-label": tI18nComplete.raw('text561257c019e5'), value: oc.prompt ?? '', placeholder: tI18nComplete.raw('text94a18ea1d428'), minHeight: 160, className: "rounded-none border-0 font-mono text-xs focus-visible:border-0 focus-visible:ring-0", onChange: (e) => setOc('prompt', e.target.value) }) })] }) })) : null] }), _jsxs(EditorSection, { title: tI18nComplete.raw('text6d06116595a9'), description: tI18nComplete.raw('text33439eb47c9a'), children: [_jsx(SliderRow, { label: tI18nComplete.raw('textb958ce8b871a'), help: tI18nComplete.raw('textd380d30f3d60'), value: oc.temperature, fallback: 0, min: 0, max: 2, step: 0.05, onChange: (v) => setOc('temperature', v) }), _jsx(SliderRow, { label: tI18nComplete.raw('text714db3dbb0b7'), help: tI18nComplete.raw('text4f370db531ba'), value: oc.top_p, fallback: 1, min: 0, max: 1, step: 0.01, onChange: (v) => setOc('top_p', v) }), _jsx(SettingRow, { label: tI18nComplete.raw('textfdc639c47624'), help: tI18nComplete.raw('textbf7ff92baea3'), children: _jsx(Input, { "aria-label": tI18nComplete.raw('textfdc639c47624'), type: "number", min: 1, value: oc.steps ?? '', placeholder: tI18nComplete.raw('textf7fcff0d8fea'), variant: "popover", className: "h-9 w-full text-sm tabular-nums", onChange: (e) => setOc('steps', e.target.value ? Math.max(1, Number(e.target.value)) : undefined) }) })] })] }));
65
58
  }
66
59
  /**
67
60
  * Whether a slider row is showing its default.
@@ -9,6 +9,7 @@
9
9
  * titles at `text-sm font-medium`, help at `text-xs text-muted-foreground`.
10
10
  * Those two sizes are the whole scale; nothing in the editor is smaller.
11
11
  */
12
+ import type * as React from 'react';
12
13
  import { type ReactNode } from 'react';
13
14
  /**
14
15
  * How a section draws itself. `flat` is the original: a heading over
@@ -27,19 +28,36 @@ export type EditorSectionStyle = 'flat' | 'panel';
27
28
  export declare function EditorSectionStyleProvider({ value, children, }: {
28
29
  value: EditorSectionStyle;
29
30
  children: ReactNode;
30
- }): import("react").JSX.Element;
31
+ }): React.JSX.Element;
31
32
  /**
32
- * One titled group of settings. Rows inside are separated by hairlines rather
33
- * than boxed individually. See `EditorSectionStyle` for the two dialects.
33
+ * One titled group of settings, in the Settings page's dialect
34
+ * (`settings/tabs/general-tab.tsx`): the heading sits on the page, never
35
+ * inside a box, and only the rows below it share one bordered group.
36
+ *
37
+ * `lead` marks the first section of a pane. It takes the pane title
38
+ * (`SettingsSectionHeader`, `text-base lg:text-xl`). Every later section
39
+ * takes the quieter `SettingsSubsectionHeader`. Neither shows `description`
40
+ * on the agent page; it renders only in the legacy `flat` style.
41
+ *
42
+ * `bare` hands the body to the caller unwrapped: a list (`GrantList`), a
43
+ * markdown preview, or a textarea draws its own surface.
34
44
  */
35
- export declare function EditorSection({ title, description, trailing, children, }: {
45
+ export declare function EditorSection({ title, description, trailing, lead, bare, children, }: {
36
46
  title: string;
37
47
  description?: ReactNode;
38
- /** A summary at the header's right edge — a `Badge` saying "All" or
39
- * "3 picked" — so a card answers its question before it is opened. */
48
+ /** The section's action at the header's right edge: one `secondary`
49
+ * button (New, Manage) or a small control such as the Edit / Preview tabs. */
40
50
  trailing?: ReactNode;
51
+ lead?: boolean;
52
+ bare?: boolean;
41
53
  children: ReactNode;
42
- }): import("react").JSX.Element;
54
+ }): React.JSX.Element;
55
+ /**
56
+ * The bordered list a section hands its rows to: one `bg-popover` group,
57
+ * hairlines between rows, no per-row box. A stack of individually bordered
58
+ * cards read as ten announcements; one group reads as one list.
59
+ */
60
+ export declare function EditorList({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
43
61
  /**
44
62
  * Label and help on the left, control on the right — for anything that fits a
45
63
  * switch, a select, a slider, or a short input. Stacks under `sm` so a narrow
@@ -52,7 +70,7 @@ export declare function SettingRow({ label, help, children, }: {
52
70
  label: string;
53
71
  help?: ReactNode;
54
72
  children: ReactNode;
55
- }): import("react").JSX.Element;
73
+ }): React.JSX.Element;
56
74
  /**
57
75
  * Label and help above a full-width control — for anything a row cannot hold:
58
76
  * a textarea, a grant checklist, the permission tree.
@@ -61,7 +79,7 @@ export declare function SettingBlock({ label, help, children, }: {
61
79
  label: string;
62
80
  help?: ReactNode;
63
81
  children: ReactNode;
64
- }): import("react").JSX.Element;
82
+ }): React.JSX.Element;
65
83
  /**
66
84
  * A text button that lives inside a help line — "Reset", "Clear". Text, not an
67
85
  * icon: at this size an icon is a guess, and the word is three characters
@@ -70,4 +88,4 @@ export declare function SettingBlock({ label, help, children, }: {
70
88
  export declare function InlineAction({ onClick, children }: {
71
89
  onClick: () => void;
72
90
  children: ReactNode;
73
- }): import("react").JSX.Element;
91
+ }): React.JSX.Element;
@@ -1,33 +1,44 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- /**
4
- * Layout primitives for the agent editor. Three shapes and nothing else: a
5
- * titled section, a row (label left, control right), and a block (label above
6
- * a full-width control).
7
- *
8
- * There is deliberately NO icon slot. Every group used to open with a glyph —
9
- * a stack, a chip, a gauge, a shield — and not one of them named anything the
10
- * words beside it did not already say. Type carries the hierarchy: section
11
- * titles at `text-sm font-medium`, help at `text-xs text-muted-foreground`.
12
- * Those two sizes are the whole scale; nothing in the editor is smaller.
13
- */
14
3
  import { createContext, useContext } from 'react';
4
+ import { SettingsRowGroup } from '../../../primitives/settings-row.js';
5
+ import { SettingsSectionHeader } from '../../../primitives/settings-section-header.js';
6
+ import { SettingsSubsectionHeader } from '../../../primitives/settings-subsection-header.js';
15
7
  import { cn } from '../../../internal/lib/utils.js';
16
8
  const EditorSectionStyleContext = createContext('flat');
17
9
  export function EditorSectionStyleProvider({ value, children, }) {
18
10
  return (_jsx(EditorSectionStyleContext.Provider, { value: value, children: children }));
19
11
  }
20
12
  /**
21
- * One titled group of settings. Rows inside are separated by hairlines rather
22
- * than boxed individually. See `EditorSectionStyle` for the two dialects.
13
+ * One titled group of settings, in the Settings page's dialect
14
+ * (`settings/tabs/general-tab.tsx`): the heading sits on the page, never
15
+ * inside a box, and only the rows below it share one bordered group.
16
+ *
17
+ * `lead` marks the first section of a pane. It takes the pane title
18
+ * (`SettingsSectionHeader`, `text-base lg:text-xl`). Every later section
19
+ * takes the quieter `SettingsSubsectionHeader`. Neither shows `description`
20
+ * on the agent page; it renders only in the legacy `flat` style.
21
+ *
22
+ * `bare` hands the body to the caller unwrapped: a list (`GrantList`), a
23
+ * markdown preview, or a textarea draws its own surface.
23
24
  */
24
- export function EditorSection({ title, description, trailing, children, }) {
25
+ export function EditorSection({ title, description, trailing, lead = false, bare = false, children, }) {
25
26
  const style = useContext(EditorSectionStyleContext);
26
- const heading = (_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 space-y-1", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: title }), description ? (_jsx("p", { className: "text-muted-foreground text-xs leading-relaxed text-pretty", children: description })) : null] }), trailing ? _jsx("div", { className: "shrink-0", children: trailing }) : null] }));
27
27
  if (style === 'panel') {
28
- return (_jsxs("section", { className: "bg-popover rounded-md border", children: [_jsx("div", { className: "border-border/60 border-b px-4 pt-4 pb-3", children: heading }), _jsx("div", { className: cn('divide-border/60 divide-y px-4'), children: children })] }));
28
+ return (_jsxs("section", { className: lead ? 'space-y-6' : 'space-y-3', children: [lead ? (
29
+ // Headings stand alone (Jay, 2026-10-20): a sentence under every
30
+ // title made the page read as prose.
31
+ _jsx(SettingsSectionHeader, { title: title, action: trailing, className: "pb-1" })) : (_jsx(SettingsSubsectionHeader, { title: title, action: trailing })), bare ? children : _jsx(SettingsRowGroup, { children: children })] }));
29
32
  }
30
- return (_jsxs("section", { className: "space-y-2", children: [heading, _jsx("div", { className: "divide-border/60 divide-y", children: children })] }));
33
+ return (_jsxs("section", { className: "space-y-2", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "min-w-0 space-y-1", children: [_jsx("h3", { className: "text-foreground text-sm font-medium", children: title }), description ? (_jsx("p", { className: "text-muted-foreground text-xs leading-relaxed text-pretty", children: description })) : null] }), trailing ? _jsx("div", { className: "shrink-0", children: trailing }) : null] }), _jsx("div", { className: "divide-border/60 divide-y", children: children })] }));
34
+ }
35
+ /**
36
+ * The bordered list a section hands its rows to: one `bg-popover` group,
37
+ * hairlines between rows, no per-row box. A stack of individually bordered
38
+ * cards read as ten announcements; one group reads as one list.
39
+ */
40
+ export function EditorList({ className, ...props }) {
41
+ return (_jsx("ul", { className: cn('bg-popover divide-border divide-y overflow-hidden rounded-md border', className), ...props }));
31
42
  }
32
43
  /**
33
44
  * Label and help on the left, control on the right — for anything that fits a
@@ -38,14 +49,16 @@ export function EditorSection({ title, description, trailing, children, }) {
38
49
  * three deep.
39
50
  */
40
51
  export function SettingRow({ label, help, children, }) {
41
- return (_jsxs("div", { className: "flex flex-col gap-2 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:gap-6", children: [_jsx(SettingLabel, { label: label, help: help }), _jsx("div", { className: "w-full shrink-0 sm:w-52", children: children })] }));
52
+ const style = useContext(EditorSectionStyleContext);
53
+ return (_jsxs("div", { className: cn('flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6', style === 'panel' ? 'px-4 py-3' : 'py-3.5'), children: [_jsx(SettingLabel, { label: label, help: help }), _jsx("div", { className: "w-full shrink-0 sm:w-52", children: children })] }));
42
54
  }
43
55
  /**
44
56
  * Label and help above a full-width control — for anything a row cannot hold:
45
57
  * a textarea, a grant checklist, the permission tree.
46
58
  */
47
59
  export function SettingBlock({ label, help, children, }) {
48
- return (_jsxs("div", { className: "space-y-2.5 py-3.5", children: [_jsx(SettingLabel, { label: label, help: help }), children] }));
60
+ const style = useContext(EditorSectionStyleContext);
61
+ return (_jsxs("div", { className: cn('space-y-2.5', style === 'panel' ? 'px-4 py-3' : 'py-3.5'), children: [_jsx(SettingLabel, { label: label, help: help }), children] }));
49
62
  }
50
63
  /**
51
64
  * The label pair. A plain `<span>`, not `<Label>`: none of these controls take
@@ -317,8 +317,8 @@ export function isAgentConfigSectionKey(value) {
317
317
  */
318
318
  export function AgentConfigSections({ section, editor, options, skillsOptions, registryOptions, overview, triggers, people, skills, connectors, secrets, apps, drives, authority, }) {
319
319
  const { draft, oc, set, setOc } = editor;
320
- // Every section is a card (`EditorSectionStyle` 'panel'), so a tab holding
321
- // two of them — Access holds the people and the grants — shows two blocks.
320
+ // Every pane opens with a `lead` section (the pane title) and stacks its
321
+ // later sections under Settings subsection headings.
322
322
  const body = (() => {
323
323
  switch (section) {
324
324
  case 'overview':
@@ -353,6 +353,6 @@ export function AgentConfigSections({ section, editor, options, skillsOptions, r
353
353
  return (_jsx(BasicsSection, { draft: draft, set: set, oc: oc, setOc: setOc, showDescription: false }));
354
354
  }
355
355
  })();
356
- return (_jsx(EditorSectionStyleProvider, { value: "panel", children: _jsx("div", { className: "space-y-4", children: body }) }));
356
+ return (_jsx(EditorSectionStyleProvider, { value: "panel", children: _jsx("div", { className: "space-y-8", children: body }) }));
357
357
  }
358
358
  export { grantSummary } from './grant-mode-field.js';
@@ -280,7 +280,6 @@ function BindingOverrides({ binding, policies, }) {
280
280
  return (_jsxs("span", { title: describeEffectiveModel(binding), className: cn('inline-flex items-center gap-1', overrides && 'text-foreground'), children: [modelUnavailable ? (_jsx(WarningCircleIcon, { weight: "fill", className: "text-kortix-orange size-3.5 shrink-0" })) : null, overrides || tI18nComplete.raw('texte8cb80e5c5cb')] }));
281
281
  }
282
282
  /** The schedule modal's field frame, around each picker in the settings dialog. */
283
- const FIELD_FRAME = 'bg-popover flex w-full items-center rounded-md border px-2 py-1.5';
284
283
  /** Rows before the list grows a search field — the `AgentSelector` rule (7). */
285
284
  const BINDING_SEARCH_MIN = 7;
286
285
  const CONVERSATION_POLICIES = [
@@ -377,9 +376,6 @@ function ChannelSettingsModalContent({ projectId, binding, name, scope, projectD
377
376
  const policy = policyDraft ?? binding.conversationPolicy;
378
377
  const patch = channelSettingsPatch({ agentName: binding.agentName, model: boundModel, conversationPolicy: binding.conversationPolicy }, { agentName, model, conversationPolicy: policy });
379
378
  const dirty = Object.keys(patch).length > 0;
380
- // The pickers refuse to open when disabled but do not dim; dim them like the
381
- // disabled Select, which dims itself.
382
- const pickerFrame = cn(FIELD_FRAME, !canWrite && 'opacity-50');
383
379
  const update = useUpdateChannelBinding();
384
380
  const save = (e) => {
385
381
  e.preventDefault();
@@ -393,11 +389,11 @@ function ChannelSettingsModalContent({ projectId, binding, name, scope, projectD
393
389
  onError: (error) => errorToastFallback(error, tI18nComplete),
394
390
  });
395
391
  };
396
- return (_jsxs(ModalContent, { className: "lg:max-w-lg", children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: tI18nComplete.raw('textafc219f2a1e7') }), _jsx(ModalDescription, { children: tI18nComplete.raw('text95112f275fba') })] }), _jsxs("form", { onSubmit: save, children: [_jsxs(ModalBody, { className: "max-h-[calc(100dvh-15rem)] space-y-5 overflow-y-auto pt-4", children: [_jsxs("div", { className: "bg-popover flex min-w-0 items-center gap-3 rounded-md border px-3 py-2.5", children: [_jsx(BindingBrandMark, { platform: binding.platform }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "truncate text-sm font-medium", title: binding.channelId, children: name }), _jsx("p", { className: "text-muted-foreground truncate text-xs", children: scope })] })] }), _jsxs(FieldGroup, { className: "gap-5", children: [_jsxs(Field, { "data-disabled": !canWrite, children: [_jsx(FieldTitle, { children: tI18nComplete.raw('text11b39c93777e') }), _jsx("div", { className: pickerFrame, children: _jsx(AgentSelector, { agents: agents, selectedAgent: agentName ?? defaultAgentLabel, onSelect: (v) => setAgentDraft(!v || v === defaultAgentLabel ? null : v), disabled: !canWrite }) }), _jsx(FieldDescription, { className: "text-xs", children: tI18nComplete.raw('text12dc6dbd8fc8') })] }), _jsxs(Field, { "data-disabled": !canWrite, children: [_jsx(FieldTitle, { children: tI18nComplete.raw('text5e2c614c23f0') }), _jsx("div", { className: pickerFrame, children: _jsx(ModelSelector, { models: models, providers: providers, selectedModel: model, unsetLabel: tI18nComplete.raw('texte8cb80e5c5cb'), onSelect: setModelDraft, disabled: !canWrite }) }), _jsxs(FieldDescription, { className: "text-xs", children: [modelDraft === undefined &&
392
+ return (_jsxs(ModalContent, { className: "lg:max-w-lg", children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: tI18nComplete.raw('textafc219f2a1e7') }), _jsx(ModalDescription, { children: tI18nComplete.raw('text95112f275fba') })] }), _jsxs("form", { onSubmit: save, children: [_jsxs(ModalBody, { className: "max-h-[calc(100dvh-15rem)] space-y-5 overflow-y-auto pt-4", children: [_jsxs("div", { className: "bg-popover flex min-w-0 items-center gap-3 rounded-md border px-3 py-2.5", children: [_jsx(BindingBrandMark, { platform: binding.platform }), _jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "truncate text-sm font-medium", title: binding.channelId, children: name }), _jsx("p", { className: "text-muted-foreground truncate text-xs", children: scope })] })] }), _jsxs(FieldGroup, { className: "gap-5", children: [_jsxs(Field, { "data-disabled": !canWrite, children: [_jsx(FieldTitle, { children: tI18nComplete.raw('text11b39c93777e') }), _jsx(AgentSelector, { agents: agents, selectedAgent: agentName ?? defaultAgentLabel, onSelect: (v) => setAgentDraft(!v || v === defaultAgentLabel ? null : v), disabled: !canWrite, appearance: "field" }), _jsx(FieldDescription, { className: "text-xs", children: tI18nComplete.raw('text12dc6dbd8fc8') })] }), _jsxs(Field, { "data-disabled": !canWrite, children: [_jsx(FieldTitle, { children: tI18nComplete.raw('text5e2c614c23f0') }), _jsx(ModelSelector, { models: models, providers: providers, selectedModel: model, unsetLabel: tI18nComplete.raw('texte8cb80e5c5cb'), onSelect: setModelDraft, disabled: !canWrite, appearance: "field" }), _jsxs(FieldDescription, { className: "text-xs", children: [modelDraft === undefined &&
397
393
  binding.effectiveModel.source !== 'explicit' &&
398
394
  (binding.opencodeModel || binding.effectiveModel.model)
399
395
  ? `${describeEffectiveModel(binding)}. `
400
- : null, tI18nComplete.raw('text9116af1ce384')] })] }), _jsxs(Field, { "data-disabled": !canWrite, children: [_jsx(FieldTitle, { children: tI18nComplete.raw('textb1ca871c6696') }), _jsx("div", { className: FIELD_FRAME, children: _jsxs(Select, { value: policy, onValueChange: (v) => setPolicyDraft(v), disabled: !canWrite, children: [_jsx(SelectTrigger, { variant: "transparent", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: conversationPolicies.map((p) => (_jsx(SelectItem, { value: p.value, children: p.label }, p.value))) })] }) }), _jsx(FieldDescription, { className: "text-xs", children: policyDescription(policy, tI18nComplete) })] })] })] }), _jsxs(ModalFooter, { className: "pt-2 pb-5 sm:justify-between", children: [_jsxs(Button, { type: "button", variant: "outline-ghost", className: "gap-1", onClick: onBack, children: [_jsx(CaretLeftIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('text76900f1bfd16')] }), canWrite ? (_jsxs(Button, { type: "submit", disabled: !dirty || update.isPending, children: [update.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, tI18nComplete.raw('text1509f561f241')] })) : null] })] })] }));
396
+ : null, tI18nComplete.raw('text9116af1ce384')] })] }), _jsxs(Field, { "data-disabled": !canWrite, children: [_jsx(FieldTitle, { children: tI18nComplete.raw('textb1ca871c6696') }), _jsxs(Select, { value: policy, onValueChange: (v) => setPolicyDraft(v), disabled: !canWrite, children: [_jsx(SelectTrigger, { className: "h-9 w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: conversationPolicies.map((p) => (_jsx(SelectItem, { value: p.value, children: p.label }, p.value))) })] }), _jsx(FieldDescription, { className: "text-xs", children: policyDescription(policy, tI18nComplete) })] })] })] }), _jsxs(ModalFooter, { className: "pt-2 pb-5 sm:justify-between", children: [_jsxs(Button, { type: "button", variant: "outline-ghost", className: "gap-1", onClick: onBack, children: [_jsx(CaretLeftIcon, { className: "size-3.5 shrink-0" }), tI18nComplete.raw('text76900f1bfd16')] }), canWrite ? (_jsxs(Button, { type: "submit", disabled: !dirty || update.isPending, children: [update.isPending ? _jsx(Loading, { className: "size-4 shrink-0" }) : null, tI18nComplete.raw('text1509f561f241')] })) : null] })] })] }));
401
397
  }
402
398
  /** A conversation's display name: the Slack or Teams name, else its kind. */
403
399
  function bindingName(binding, tI18nComplete) {