@jini-ai/ui 0.3.3 → 0.3.6

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 (167) hide show
  1. package/dist/features/appearance/react/components/AppearanceTab.d.ts +4 -1
  2. package/dist/features/appearance/react/components/AppearanceTab.d.ts.map +1 -1
  3. package/dist/features/appearance/react/components/AppearanceTab.js +7 -4
  4. package/dist/features/appearance/react/components/AppearanceTab.js.map +1 -1
  5. package/dist/features/connectors/ConnectorsBrowser.d.ts +8 -1
  6. package/dist/features/connectors/ConnectorsBrowser.d.ts.map +1 -1
  7. package/dist/features/connectors/ConnectorsBrowser.js +4 -3
  8. package/dist/features/connectors/ConnectorsBrowser.js.map +1 -1
  9. package/dist/features/connectors/components/ConnectorCard.d.ts +4 -1
  10. package/dist/features/connectors/components/ConnectorCard.d.ts.map +1 -1
  11. package/dist/features/connectors/components/ConnectorCard.js +5 -4
  12. package/dist/features/connectors/components/ConnectorCard.js.map +1 -1
  13. package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts +3 -1
  14. package/dist/features/connectors/components/ConnectorDetailDrawer.d.ts.map +1 -1
  15. package/dist/features/connectors/components/ConnectorDetailDrawer.js +3 -2
  16. package/dist/features/connectors/components/ConnectorDetailDrawer.js.map +1 -1
  17. package/dist/features/connectors/components/ConnectorGrid.d.ts +4 -1
  18. package/dist/features/connectors/components/ConnectorGrid.d.ts.map +1 -1
  19. package/dist/features/connectors/components/ConnectorGrid.js +4 -2
  20. package/dist/features/connectors/components/ConnectorGrid.js.map +1 -1
  21. package/dist/features/connectors/components/ConnectorSearchBar.d.ts +3 -1
  22. package/dist/features/connectors/components/ConnectorSearchBar.d.ts.map +1 -1
  23. package/dist/features/connectors/components/ConnectorSearchBar.js +4 -3
  24. package/dist/features/connectors/components/ConnectorSearchBar.js.map +1 -1
  25. package/dist/features/connectors/components/ProviderTabBar.d.ts +4 -1
  26. package/dist/features/connectors/components/ProviderTabBar.d.ts.map +1 -1
  27. package/dist/features/connectors/components/ProviderTabBar.js +5 -3
  28. package/dist/features/connectors/components/ProviderTabBar.js.map +1 -1
  29. package/dist/features/execution/constants.d.ts +30 -0
  30. package/dist/features/execution/constants.d.ts.map +1 -1
  31. package/dist/features/execution/constants.js +45 -0
  32. package/dist/features/execution/constants.js.map +1 -1
  33. package/dist/features/execution/index.d.ts +3 -3
  34. package/dist/features/execution/index.d.ts.map +1 -1
  35. package/dist/features/execution/index.js +2 -2
  36. package/dist/features/execution/index.js.map +1 -1
  37. package/dist/features/execution/react/components/AgentCliEnvFields.d.ts.map +1 -1
  38. package/dist/features/execution/react/components/AgentCliEnvFields.js +8 -1
  39. package/dist/features/execution/react/components/AgentCliEnvFields.js.map +1 -1
  40. package/dist/features/execution/react/components/ByokProviderForm.d.ts +30 -1
  41. package/dist/features/execution/react/components/ByokProviderForm.d.ts.map +1 -1
  42. package/dist/features/execution/react/components/ByokProviderForm.js +41 -21
  43. package/dist/features/execution/react/components/ByokProviderForm.js.map +1 -1
  44. package/dist/features/execution/react/components/ExecutionTab.d.ts +9 -1
  45. package/dist/features/execution/react/components/ExecutionTab.d.ts.map +1 -1
  46. package/dist/features/execution/react/components/ExecutionTab.js +9 -4
  47. package/dist/features/execution/react/components/ExecutionTab.js.map +1 -1
  48. package/dist/features/execution/react/components/LocalCliAgentCard.d.ts +4 -1
  49. package/dist/features/execution/react/components/LocalCliAgentCard.d.ts.map +1 -1
  50. package/dist/features/execution/react/components/LocalCliAgentCard.js +24 -28
  51. package/dist/features/execution/react/components/LocalCliAgentCard.js.map +1 -1
  52. package/dist/features/execution/react/components/LocalCliAgentList.d.ts +4 -1
  53. package/dist/features/execution/react/components/LocalCliAgentList.d.ts.map +1 -1
  54. package/dist/features/execution/react/components/LocalCliAgentList.js +4 -2
  55. package/dist/features/execution/react/components/LocalCliAgentList.js.map +1 -1
  56. package/dist/features/execution/react/components/ProviderChipGroup.d.ts +4 -1
  57. package/dist/features/execution/react/components/ProviderChipGroup.d.ts.map +1 -1
  58. package/dist/features/execution/react/components/ProviderChipGroup.js +7 -3
  59. package/dist/features/execution/react/components/ProviderChipGroup.js.map +1 -1
  60. package/dist/features/execution/react/components/SearchableModelSelect.d.ts +4 -1
  61. package/dist/features/execution/react/components/SearchableModelSelect.d.ts.map +1 -1
  62. package/dist/features/execution/react/components/SearchableModelSelect.js +3 -2
  63. package/dist/features/execution/react/components/SearchableModelSelect.js.map +1 -1
  64. package/dist/features/execution/react/hooks/useReasoningControl.d.ts +87 -0
  65. package/dist/features/execution/react/hooks/useReasoningControl.d.ts.map +1 -0
  66. package/dist/features/execution/react/hooks/useReasoningControl.js +149 -0
  67. package/dist/features/execution/react/hooks/useReasoningControl.js.map +1 -0
  68. package/dist/features/execution/rules.d.ts +87 -1
  69. package/dist/features/execution/rules.d.ts.map +1 -1
  70. package/dist/features/execution/rules.js +210 -1
  71. package/dist/features/execution/rules.js.map +1 -1
  72. package/dist/features/execution/types.d.ts +96 -0
  73. package/dist/features/execution/types.d.ts.map +1 -1
  74. package/dist/features/html-editor/react/components/InteractiveHtmlEditor.d.ts +1 -1
  75. package/dist/features/html-editor/react/hooks/useInteractiveHtmlEditor.js +1 -1
  76. package/dist/features/i18n/dictionaries/index.d.ts +1 -1
  77. package/dist/features/instructions/react/components/InstructionsTab.d.ts +3 -1
  78. package/dist/features/instructions/react/components/InstructionsTab.d.ts.map +1 -1
  79. package/dist/features/instructions/react/components/InstructionsTab.js +3 -2
  80. package/dist/features/instructions/react/components/InstructionsTab.js.map +1 -1
  81. package/dist/features/integrations/react/components/ClientPicker.d.ts +4 -1
  82. package/dist/features/integrations/react/components/ClientPicker.d.ts.map +1 -1
  83. package/dist/features/integrations/react/components/ClientPicker.js +7 -3
  84. package/dist/features/integrations/react/components/ClientPicker.js.map +1 -1
  85. package/dist/features/integrations/react/components/CodexInstallToggleButton.d.ts +3 -1
  86. package/dist/features/integrations/react/components/CodexInstallToggleButton.d.ts.map +1 -1
  87. package/dist/features/integrations/react/components/CodexInstallToggleButton.js +3 -2
  88. package/dist/features/integrations/react/components/CodexInstallToggleButton.js.map +1 -1
  89. package/dist/features/integrations/react/components/IntegrationsTab.d.ts +6 -1
  90. package/dist/features/integrations/react/components/IntegrationsTab.d.ts.map +1 -1
  91. package/dist/features/integrations/react/components/IntegrationsTab.js +4 -3
  92. package/dist/features/integrations/react/components/IntegrationsTab.js.map +1 -1
  93. package/dist/features/language/react/components/LanguageTab.d.ts +4 -1
  94. package/dist/features/language/react/components/LanguageTab.d.ts.map +1 -1
  95. package/dist/features/language/react/components/LanguageTab.js +5 -3
  96. package/dist/features/language/react/components/LanguageTab.js.map +1 -1
  97. package/dist/features/mcp-ui/sandbox-proxy.d.ts +42 -1
  98. package/dist/features/mcp-ui/sandbox-proxy.d.ts.map +1 -1
  99. package/dist/features/mcp-ui/sandbox-proxy.js +89 -1
  100. package/dist/features/mcp-ui/sandbox-proxy.js.map +1 -1
  101. package/dist/features/mcp-ui/surfaces/outcome.d.ts +1 -1
  102. package/dist/features/mcp-ui/surfaces/tokens.d.ts +6 -5
  103. package/dist/features/mcp-ui/surfaces/tokens.d.ts.map +1 -1
  104. package/dist/features/mcp-ui/surfaces/tokens.js +6 -5
  105. package/dist/features/mcp-ui/surfaces/tokens.js.map +1 -1
  106. package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts +4 -1
  107. package/dist/features/media-providers/react/components/MediaProvidersTab.d.ts.map +1 -1
  108. package/dist/features/media-providers/react/components/MediaProvidersTab.js +14 -4
  109. package/dist/features/media-providers/react/components/MediaProvidersTab.js.map +1 -1
  110. package/dist/features/memory/react/components/MemoryEntryCard.d.ts +3 -1
  111. package/dist/features/memory/react/components/MemoryEntryCard.d.ts.map +1 -1
  112. package/dist/features/memory/react/components/MemoryEntryCard.js +3 -2
  113. package/dist/features/memory/react/components/MemoryEntryCard.js.map +1 -1
  114. package/dist/features/memory/react/components/MemoryExtractionCard.d.ts +3 -1
  115. package/dist/features/memory/react/components/MemoryExtractionCard.d.ts.map +1 -1
  116. package/dist/features/memory/react/components/MemoryExtractionCard.js +3 -2
  117. package/dist/features/memory/react/components/MemoryExtractionCard.js.map +1 -1
  118. package/dist/features/memory/react/components/MemoryHooksPanel.d.ts +3 -1
  119. package/dist/features/memory/react/components/MemoryHooksPanel.d.ts.map +1 -1
  120. package/dist/features/memory/react/components/MemoryHooksPanel.js +7 -2
  121. package/dist/features/memory/react/components/MemoryHooksPanel.js.map +1 -1
  122. package/dist/features/memory/react/components/MemoryHowPanel.d.ts +3 -1
  123. package/dist/features/memory/react/components/MemoryHowPanel.d.ts.map +1 -1
  124. package/dist/features/memory/react/components/MemoryHowPanel.js +2 -2
  125. package/dist/features/memory/react/components/MemoryHowPanel.js.map +1 -1
  126. package/dist/features/memory/react/components/MemoryList.d.ts +3 -1
  127. package/dist/features/memory/react/components/MemoryList.d.ts.map +1 -1
  128. package/dist/features/memory/react/components/MemoryList.js +12 -5
  129. package/dist/features/memory/react/components/MemoryList.js.map +1 -1
  130. package/dist/features/memory/react/components/MemorySettingsPanel.d.ts +7 -1
  131. package/dist/features/memory/react/components/MemorySettingsPanel.d.ts.map +1 -1
  132. package/dist/features/memory/react/components/MemorySettingsPanel.js +3 -2
  133. package/dist/features/memory/react/components/MemorySettingsPanel.js.map +1 -1
  134. package/dist/features/notifications/react/components/NotificationsTab.d.ts +3 -1
  135. package/dist/features/notifications/react/components/NotificationsTab.d.ts.map +1 -1
  136. package/dist/features/notifications/react/components/NotificationsTab.js +13 -6
  137. package/dist/features/notifications/react/components/NotificationsTab.js.map +1 -1
  138. package/dist/features/privacy/react/components/PrivacyTab.d.ts +9 -1
  139. package/dist/features/privacy/react/components/PrivacyTab.d.ts.map +1 -1
  140. package/dist/features/privacy/react/components/PrivacyTab.js +5 -4
  141. package/dist/features/privacy/react/components/PrivacyTab.js.map +1 -1
  142. package/dist/features/settings/dialog/react/components/SettingsDialogShell.d.ts +1 -1
  143. package/dist/features/settings/dialog/styles/settings-dialog.css +54 -0
  144. package/dist/features/skills/react/components/SkillDraftForm.d.ts +3 -1
  145. package/dist/features/skills/react/components/SkillDraftForm.d.ts.map +1 -1
  146. package/dist/features/skills/react/components/SkillDraftForm.js +3 -2
  147. package/dist/features/skills/react/components/SkillDraftForm.js.map +1 -1
  148. package/dist/features/skills/react/components/SkillRow.d.ts +3 -1
  149. package/dist/features/skills/react/components/SkillRow.d.ts.map +1 -1
  150. package/dist/features/skills/react/components/SkillRow.js +3 -2
  151. package/dist/features/skills/react/components/SkillRow.js.map +1 -1
  152. package/dist/features/skills/react/components/SkillsTab.d.ts +8 -1
  153. package/dist/features/skills/react/components/SkillsTab.d.ts.map +1 -1
  154. package/dist/features/skills/react/components/SkillsTab.js +7 -3
  155. package/dist/features/skills/react/components/SkillsTab.js.map +1 -1
  156. package/dist/features/tabbed-dialog/react/components/TabbedDialog.d.ts +1 -1
  157. package/dist/features/tabbed-dialog/react/components/TabbedDialog.js +1 -1
  158. package/dist/features/tabbed-dialog/types.d.ts +2 -2
  159. package/dist/features/tabbed-dialog/types.js +2 -2
  160. package/dist/react/components/RemixIcon.d.ts +42 -1
  161. package/dist/react/components/RemixIcon.d.ts.map +1 -1
  162. package/dist/react/components/RemixIcon.js +152 -8
  163. package/dist/react/components/RemixIcon.js.map +1 -1
  164. package/dist/utils/file-transfer.d.ts.map +1 -1
  165. package/dist/utils/file-transfer.js +2 -0
  166. package/dist/utils/file-transfer.js.map +1 -1
  167. package/package.json +3 -3
@@ -0,0 +1,149 @@
1
+ import { useCallback, useEffect } from 'react';
2
+ import { CUSTOM_MODEL_SENTINEL } from '../../constants.js';
3
+ import { modelIdForReasoningLevel, reasoningModelGroupFor, reasoningModelGroups, selectedAgentModel, selectedAgentReasoning, shouldShowCustomModelInput, splitReasoningModelId, } from '../../rules.js';
4
+ export function useReasoningControl(optionsOrAgent, maybeConfig, maybeExplicitCustomMode) {
5
+ const { agent, config, explicitCustomMode = false, onReasoningChange } = 'agent' in optionsOrAgent && 'config' in optionsOrAgent
6
+ ? optionsOrAgent
7
+ : {
8
+ agent: optionsOrAgent,
9
+ config: maybeConfig,
10
+ explicitCustomMode: maybeExplicitCustomMode ?? false,
11
+ };
12
+ const models = agent.models ?? [];
13
+ const hasModels = models.length > 0;
14
+ const resolvedModel = selectedAgentModel(config, agent);
15
+ const rawModel = config.modelByAgentId?.[agent.id] ?? '';
16
+ // Two ways an agent can expose a reasoning-effort axis, and the card branches on the DECLARATION
17
+ // rather than on the agent's id — adding a third runtime with either shape is a def change, not
18
+ // an edit here.
19
+ //
20
+ // `reasoningOptions` — one flat vocabulary that travels to the CLI as its own flag
21
+ // (`claude --effort high`, codex's `-c model_reasoning_effort=...`).
22
+ // The choice is its own persisted value; `onReasoningChange` owns it.
23
+ // `reasoningInModelId` — no effort flag exists; the level is a suffix on the model id itself
24
+ // (antigravity's `gemini-3.1-pro-high`). The choice IS the model, so
25
+ // it goes through `onModelChange`, and the available levels are
26
+ // derived PER BASE MODEL from the agent's own catalog — they are not
27
+ // uniform (`gemini-3.1-pro` has no `-medium`, and `agy --model`
28
+ // rejects one), so a fixed dropdown would offer ids the CLI refuses.
29
+ const suffixLevels = agent.reasoningInModelId?.levels ?? [];
30
+ const suffixLevelIds = suffixLevels.map((level) => level.id);
31
+ const modelGroups = suffixLevels.length > 0 ? reasoningModelGroups(models, suffixLevels) : null;
32
+ const activeGroup = modelGroups ? reasoningModelGroupFor(modelGroups, resolvedModel, suffixLevelIds) : null;
33
+ const activeLevel = modelGroups ? splitReasoningModelId(resolvedModel, suffixLevelIds).level : null;
34
+ const flatReasoningOptions = agent.reasoningOptions ?? [];
35
+ // Per-model narrowing: a runtime whose catalog reports reasoning levels PER MODEL rather than
36
+ // uniformly across the agent (Codex — see `AgentModelOption.reasoning`'s doc) declares them on the
37
+ // resolved model's own catalog row. `undefined` there means "this model's entry has nothing
38
+ // model-specific to say", so it falls back to the agent-wide union below — the same list every
39
+ // model rendered before this field existed. An explicit `[]` is honored AS-IS, even though a model
40
+ // with genuinely zero levels then hides the control: falling back to the union for `[]` too would
41
+ // just move today's "every model sees every level" bug one layer down instead of fixing it.
42
+ const selectedModelReasoning = models.find((model) => model.id === resolvedModel)?.reasoning;
43
+ // Exactly one effort control, whichever shape declared it. `reasoningOptions` wins if a def ever
44
+ // declares both, rather than rendering two controls that disagree about where the choice lands.
45
+ const reasoningOptions = flatReasoningOptions.length === 0
46
+ ? (activeGroup?.levels ?? [])
47
+ : selectedModelReasoning === undefined
48
+ ? flatReasoningOptions
49
+ : selectedModelReasoning;
50
+ const hasReasoning = reasoningOptions.length > 0;
51
+ const rawReasoningValue = flatReasoningOptions.length > 0
52
+ ? selectedAgentReasoning(config, agent)
53
+ : (activeLevel ?? reasoningOptions[0]?.id ?? '');
54
+ // The persisted (or agent-wide-default) pick can name a level the narrowed list above does not
55
+ // actually offer for the CURRENT model — that is the whole point of narrowing. Rendering it anyway
56
+ // would just relocate today's bug: the `<select>` below has no matching `<option>`, so it would
57
+ // silently show whatever the browser highlights first while the underlying value stays wrong. This
58
+ // guards what actually renders; the effect further down clears the persisted copy so every other
59
+ // reader of `config.reasoningByAgentId` (not just this hook) sees the correction too.
60
+ const reasoningSupported = reasoningOptions.some((option) => option.id === rawReasoningValue);
61
+ const reasoningValue = reasoningSupported ? rawReasoningValue : (reasoningOptions[0]?.id ?? '');
62
+ // A base model with exactly one variant has a real, fixed level worth showing — but nothing to
63
+ // choose between, so the control is shown disabled rather than offering an illusion of choice.
64
+ const reasoningDisabled = flatReasoningOptions.length === 0 && reasoningOptions.length < 2;
65
+ const reasoningOptionIdsKey = reasoningOptions.map((option) => option.id).join('|');
66
+ useEffect(() => {
67
+ // The reasoningInModelId path has no reasoning value of its own to clear — the level lives
68
+ // inside the model id itself, and picking a new base model already replaces it.
69
+ if (flatReasoningOptions.length === 0)
70
+ return;
71
+ if (!onReasoningChange)
72
+ return;
73
+ const persisted = config.reasoningByAgentId?.[agent.id]?.trim();
74
+ if (!persisted)
75
+ return;
76
+ if (reasoningOptions.some((option) => option.id === persisted))
77
+ return;
78
+ onReasoningChange('');
79
+ // `reasoningOptionIdsKey` stands in for `reasoningOptions` (a fresh array every render) so this
80
+ // only re-runs when the narrowed vocabulary actually changes, not on every unrelated re-render.
81
+ // eslint-disable-next-line react-hooks/exhaustive-deps
82
+ }, [flatReasoningOptions.length, onReasoningChange, config.reasoningByAgentId, agent.id, reasoningOptionIdsKey]);
83
+ // Adapters opt out via `supportsCustomModel: false` when their CLI has no
84
+ // free-text model flag, or validates the id against a live catalog and
85
+ // rejects unknown ones. `undefined` allows it, matching every adapter's
86
+ // default before this field existed.
87
+ const allowCustomModel = agent.supportsCustomModel !== false && modelGroups === null;
88
+ const knownModelIds = models.map((model) => model.id);
89
+ const customActive = allowCustomModel && hasModels && shouldShowCustomModelInput(resolvedModel, knownModelIds, explicitCustomMode);
90
+ // A model-suffix agent picks a BASE model here; the effort control below supplies the rest of the
91
+ // id. Everything else about the field — search, labels, provenance badge — is unchanged.
92
+ const modelChoices = modelGroups
93
+ ? modelGroups.map((group) => ({ id: group.baseId, label: group.label }))
94
+ : models;
95
+ const selectValue = customActive
96
+ ? CUSTOM_MODEL_SENTINEL
97
+ : modelGroups
98
+ ? (activeGroup?.baseId ?? '')
99
+ : resolvedModel;
100
+ // While the custom box is open, the text field must show the operator's raw
101
+ // typed text (which may not resolve to anything yet) rather than the
102
+ // resolved-with-fallback value — otherwise every keystroke would show a
103
+ // stale fallback model instead of what was actually typed.
104
+ const customModelInputValue = explicitCustomMode ? rawModel : resolvedModel;
105
+ const resolveNextModelId = useCallback((nextValue) => {
106
+ if (!modelGroups) {
107
+ return nextValue;
108
+ }
109
+ // Switching base carries the current effort level over when the new base
110
+ // really has it, and lands on one it does have otherwise — never composes a
111
+ // slug (see `modelIdForReasoningLevel`), so `gemini-3.1-pro-medium` cannot be
112
+ // produced from a `medium` carried off `gemini-3.8-flash`.
113
+ const nextGroup = modelGroups.find((group) => group.baseId === nextValue);
114
+ return nextGroup ? modelIdForReasoningLevel(nextGroup, activeLevel) : nextValue;
115
+ }, [modelGroups, activeLevel]);
116
+ const resolveReasoningModelId = useCallback((level) => {
117
+ // A model-suffix agent has no reasoning value of its own to record: the choice
118
+ // is which model id runs, so it goes back out through `onModelChange`.
119
+ if (activeGroup) {
120
+ return modelIdForReasoningLevel(activeGroup, level);
121
+ }
122
+ return null;
123
+ }, [activeGroup]);
124
+ return {
125
+ models,
126
+ hasModels,
127
+ resolvedModel,
128
+ rawModel,
129
+ suffixLevels,
130
+ suffixLevelIds,
131
+ modelGroups,
132
+ activeGroup,
133
+ activeLevel,
134
+ flatReasoningOptions,
135
+ reasoningOptions,
136
+ hasReasoning,
137
+ reasoningValue,
138
+ reasoningDisabled,
139
+ allowCustomModel,
140
+ knownModelIds,
141
+ customActive,
142
+ modelChoices,
143
+ selectValue,
144
+ customModelInputValue,
145
+ resolveNextModelId,
146
+ resolveReasoningModelId,
147
+ };
148
+ }
149
+ //# sourceMappingURL=useReasoningControl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReasoningControl.js","sourceRoot":"","sources":["../../../../../src/features/execution/react/hooks/useReasoningControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAmGxB,MAAM,UAAU,mBAAmB,CACjC,cAA0D,EAC1D,WAA4B,EAC5B,uBAAiC;IAEjC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,GAAG,KAAK,EAAE,iBAAiB,EAAE,GACpE,OAAO,IAAI,cAAc,IAAI,QAAQ,IAAI,cAAc;QACrD,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC;YACE,KAAK,EAAE,cAA+B;YACtC,MAAM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AAC;IAEF,OAAO;QACL,MAAM;QACN,SAAS;QACT,aAAa;QACb,QAAQ;QACR,YAAY;QACZ,cAAc;QACd,WAAW;QACX,WAAW;QACX,WAAW;QACX,oBAAoB;QACpB,gBAAgB;QAChB,YAAY;QACZ,cAAc;QACd,iBAAiB;QACjB,gBAAgB;QAChB,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,WAAW;QACX,qBAAqB;QACrB,kBAAkB;QAClB,uBAAuB;KACxB,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { AgentCliEnvFieldSpec, AgentDiagnostic, AgentExecutableRepair, AgentExecutableSource, AgentModelOption, ByokConfig, ByokProviderCredentials, ByokRequiredField, DetectedAgent, ExecutionConfig, ExecutionMode, LocalCliConfig, ProviderPreset } from './types.js';
1
+ import type { AgentCliEnvFieldSpec, AgentDiagnostic, AgentExecutableRepair, AgentExecutableSource, AgentModelOption, ApiKeyWarning, ByokConfig, ByokProviderCredentials, ByokRequiredField, DetectedAgent, ExecutionConfig, ExecutionMode, LocalCliConfig, ProviderPreset, ReasoningModelGroup } from './types.js';
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
@@ -47,6 +47,36 @@ export declare function showsBaseUrlField(preset: ProviderPreset | null): boolea
47
47
  * so a caller can surface the first offender without re-sorting.
48
48
  */
49
49
  export declare function missingRequiredFields(config: ByokConfig, preset: ProviderPreset | null): readonly ByokRequiredField[];
50
+ /**
51
+ * The advisory "that key looks wrong" remark for the current draft, or `null` for silence.
52
+ *
53
+ * Warns ONLY on what it can positively recognise as wrong, and there are exactly two such things:
54
+ * a key wearing another catalogued vendor's prefix (pasted into the wrong provider's field), and a
55
+ * key shorter than {@link MIN_PLAUSIBLE_API_KEY_LENGTH} (the reported Chrome-autofilled PASSWORD).
56
+ * Everything else — including every shape this package has never seen — is silence.
57
+ *
58
+ * That direction is the whole design, and it is the fix for a real reported defect. This function
59
+ * used to ask "does the key match the selected preset's pattern?" and warn when it did not: a
60
+ * positive allowlist, which false-positives the instant a vendor issues a shape the catalog has not
61
+ * been taught. That happened within hours of shipping — an operator pasted a working Google Gemini
62
+ * key and was told it did not look like a Google API key. A catalog can prove a string belongs to
63
+ * vendor X; it can never prove a string belongs to nobody. Do not re-derive an allowlist here, and
64
+ * do not add a per-provider branch: the conditions above are the only two that hold without one.
65
+ *
66
+ * ADVISORY ONLY, also by construction: this returns a message, not a validity verdict. No caller may
67
+ * use it to disable a control or gate a submit — a client-side guess must never be able to block a
68
+ * working credential. It is deliberately absent from {@link missingRequiredFields}, which IS a gate.
69
+ *
70
+ * @param config - The active BYOK draft; only `apiKey` is read.
71
+ * @param preset - The resolved preset, or `null` on custom/manual, which is exempt from the
72
+ * cross-vendor arm (see {@link foreignKeyOwner}) but not from the length floor.
73
+ * @param presets - The catalog to recognise foreign keys against. Defaults to empty, which is why
74
+ * omitting it costs the cross-vendor arm and gains nothing else: an under-informed rule must
75
+ * degrade toward silence, never toward guessing.
76
+ * @returns A translatable {@link ApiKeyWarning}, or `null` when there is nothing to say.
77
+ * @complexity O(n·m) via {@link foreignKeyOwner}; the length check is O(1).
78
+ */
79
+ export declare function apiKeyFormatWarning(config: ByokConfig, preset: ProviderPreset | null, presets?: readonly ProviderPreset[]): ApiKeyWarning | null;
50
80
  /**
51
81
  * The credentials a given preset would use — the active selection's live
52
82
  * top-level fields when `preset` IS the current selection, otherwise that
@@ -215,4 +245,60 @@ export declare function filterAgentModelOptions(options: readonly AgentModelOpti
215
245
  * nothing beyond the always-visible one-line `message`. Origin: the
216
246
  * `tooltip` computation inside `AgentDiagnosticRow`. */
217
247
  export declare function agentDiagnosticTooltip(diagnostic: AgentDiagnostic): string;
248
+ /**
249
+ * Splits a model id into its base and its reasoning-effort suffix, for a runtime that encodes
250
+ * effort inside the id (`DetectedAgent.reasoningInModelId`).
251
+ *
252
+ * Only a trailing `-<token>` whose token appears in `levelIds` is a level. Everything else stays
253
+ * part of the base id — which is the whole point: `claude-opus-4-6-thinking` ends in `-thinking`,
254
+ * which LOOKS like a modifier and is not an effort level, and reading it as one would invent a
255
+ * `claude-opus-4-6` base that has no variants and a `thinking` level no control can render.
256
+ *
257
+ * @param modelId - A full model id from the agent's own catalog.
258
+ * @param levelIds - The declared effort vocabulary (`reasoningInModelId.levels`, ids only).
259
+ * @returns The base id and the level, or `level: null` when the id carries no recognized suffix.
260
+ * @complexity O(k) in `levelIds.length`.
261
+ */
262
+ export declare function splitReasoningModelId(modelId: string, levelIds: readonly string[]): {
263
+ baseId: string;
264
+ level: string | null;
265
+ };
266
+ /**
267
+ * Groups an agent's model list by base model, recording for each base the effort levels it
268
+ * ACTUALLY has.
269
+ *
270
+ * Derived, never declared — that is the correctness property this function exists for. Verified
271
+ * against `agy models`' real output: `gemini-3.8-flash` has high/medium/low, `gemini-3.1-pro` has
272
+ * ONLY high and low, `gpt-oss-120b` only medium, and `claude-sonnet-4-6` none. A fixed
273
+ * high/medium/low control would offer `gemini-3.1-pro-medium`, which does not exist and which
274
+ * `agy --model` rejects outright. Running the same derivation over whichever list the host
275
+ * supplied — live from the CLI or the def's `fallbackModels` — is also what makes an offline
276
+ * degrade behave consistently rather than differently.
277
+ *
278
+ * @param models - The agent's model catalog, in the order it should be offered.
279
+ * @param levels - The declared effort vocabulary, in display order.
280
+ * @returns One group per base id, in first-appearance order. With an empty vocabulary every id is
281
+ * its own bare group, so a caller needs no special case for "this agent declares nothing".
282
+ * @complexity O(n * k) in the catalog size and the vocabulary size.
283
+ */
284
+ export declare function reasoningModelGroups(models: readonly AgentModelOption[], levels: readonly AgentModelOption[]): ReasoningModelGroup[];
285
+ /** The group a full model id belongs to, or `null` when the id is not in this catalog at all — a
286
+ * saved pick from an older/different catalog must not be silently attached to some other base. */
287
+ export declare function reasoningModelGroupFor(groups: readonly ReasoningModelGroup[], modelId: string, levelIds: readonly string[]): ReasoningModelGroup | null;
288
+ /**
289
+ * Recombines a base model and an effort level back into one model id — the value `--model`
290
+ * actually receives.
291
+ *
292
+ * Never composes a string: every id it can return came out of the agent's own catalog. That is
293
+ * what makes "switch base while a level is selected" safe — carrying `medium` from
294
+ * `gemini-3.8-flash` over to `gemini-3.1-pro` cannot produce `gemini-3.1-pro-medium`, because
295
+ * that base's table has no `medium` entry and the fallback below lands on a level it does have.
296
+ *
297
+ * @param group - The target base's derived group.
298
+ * @param level - The level to prefer, or `null` for "no preference".
299
+ * @returns An id from the catalog: the requested level's, else the base's bare id, else its first
300
+ * available level's, else the bare base id (only reachable for a group built from nothing).
301
+ * @complexity O(1).
302
+ */
303
+ export declare function modelIdForReasoningLevel(group: ReasoningModelGroup, level: string | null): string;
218
304
  //# sourceMappingURL=rules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/features/execution/rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;oDACoD;AACpD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,KAAK,SAAW,GAAG,cAAc,CAS/F;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,GAC/B,SAAS,cAAc,EAAE,CAE3B;AAED;;+DAE+D;AAC/D,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG;IAChE,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,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CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAI1E"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../src/features/execution/rules.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;oDACoD;AACpD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,EAAE,KAAK,SAAW,GAAG,cAAc,CAS/F;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,GAC/B,SAAS,cAAc,EAAE,CAE3B;AAED;;+DAE+D;AAC/D,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG;IAChE,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;CACrC,CASA;AAED;;;sBAGsB;AACtB,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,MAAM,EAAE,UAAU,GACjB,cAAc,GAAG,IAAI,CAUvB;AAED;wCACwC;AACxC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAE3E;AAED;wEACwE;AACxE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAExE;AAED;;;GAGG;AACH,wBAAgB,qB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IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAW1C;AAqBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,MAAM,EAAE,SAAS,gBAAgB,EAAE,GAClC,mBAAmB,EAAE,CAyBvB;AAED;mGACmG;AACnG,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,mBAAmB,EAAE,EACtC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,mBAAmB,GAAG,IAAI,CAI5B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAQjG"}
@@ -1,5 +1,5 @@
1
1
  import { isAllowedEndpointUrl } from '../../utils/endpoint-policy.js';
2
- import { CUSTOM_PRESET_ID, DEFAULT_BASE_URL_BY_PROTOCOL } from './constants.js';
2
+ import { API_KEY_CROSS_VENDOR_WARNING, API_KEY_TOO_SHORT_WARNING, CUSTOM_PRESET_ID, DEFAULT_BASE_URL_BY_PROTOCOL, MIN_PLAUSIBLE_API_KEY_LENGTH, } from './constants.js';
3
3
  /**
4
4
  * Pure decision logic for the execution tab. Everything here is total and
5
5
  * side-effect free so the React layer stays a thin renderer — same split the
@@ -90,6 +90,88 @@ export function missingRequiredFields(config, preset) {
90
90
  missing.push('model');
91
91
  return missing;
92
92
  }
93
+ /**
94
+ * The catalog entry that claims this key MORE specifically than the selected preset does — i.e. the
95
+ * vendor the operator most likely meant to paste it into. `null` when no other row recognises the
96
+ * string, or when the selection's own claim is at least as specific as any rival's.
97
+ *
98
+ * "More specific" is prefix LENGTH, not catalog order. `sk-or-v1-…` starts with both OpenRouter's
99
+ * `sk-or-` and OpenAI's `sk-`; the longer prefix is the truer claim, and deciding it by row position
100
+ * would make the message move when someone reorders the catalog. The same comparison gives the
101
+ * selected preset a tie: a host row that legitimately takes `sk-ant-` keys (an Anthropic-compatible
102
+ * proxy) claims them exactly as strongly as Anthropic does and so keeps them, silently.
103
+ *
104
+ * @param key - The trimmed key text as typed.
105
+ * @param preset - The selected preset. Required: with no selection there is no "wrong field" to be
106
+ * in, and on custom/manual any vendor's key may be exactly right.
107
+ * @param presets - The catalog to recognise foreign keys against.
108
+ * @returns The foreign owner, or `null` for silence.
109
+ * @complexity O(n·m) — n presets, m the length of the longest prefix. Catalogs are single-digit
110
+ * rows of authored data, and `startsWith` short-circuits on the first differing character.
111
+ */
112
+ function foreignKeyOwner(key, preset, presets) {
113
+ // -1, not 0, so a preset with no prefix of its own still loses every comparison rather than tying
114
+ // with one. Azure ships no prefix and must still be told when it is holding an Anthropic key.
115
+ let bestClaim = preset.apiKeyPrefix && key.startsWith(preset.apiKeyPrefix) ? preset.apiKeyPrefix.length : -1;
116
+ let owner = null;
117
+ for (const candidate of presets) {
118
+ const prefix = candidate.apiKeyPrefix;
119
+ if (!prefix || candidate.custom || candidate.id === preset.id)
120
+ continue;
121
+ if (prefix.length <= bestClaim || !key.startsWith(prefix))
122
+ continue;
123
+ owner = candidate;
124
+ bestClaim = prefix.length;
125
+ }
126
+ return owner;
127
+ }
128
+ /**
129
+ * The advisory "that key looks wrong" remark for the current draft, or `null` for silence.
130
+ *
131
+ * Warns ONLY on what it can positively recognise as wrong, and there are exactly two such things:
132
+ * a key wearing another catalogued vendor's prefix (pasted into the wrong provider's field), and a
133
+ * key shorter than {@link MIN_PLAUSIBLE_API_KEY_LENGTH} (the reported Chrome-autofilled PASSWORD).
134
+ * Everything else — including every shape this package has never seen — is silence.
135
+ *
136
+ * That direction is the whole design, and it is the fix for a real reported defect. This function
137
+ * used to ask "does the key match the selected preset's pattern?" and warn when it did not: a
138
+ * positive allowlist, which false-positives the instant a vendor issues a shape the catalog has not
139
+ * been taught. That happened within hours of shipping — an operator pasted a working Google Gemini
140
+ * key and was told it did not look like a Google API key. A catalog can prove a string belongs to
141
+ * vendor X; it can never prove a string belongs to nobody. Do not re-derive an allowlist here, and
142
+ * do not add a per-provider branch: the conditions above are the only two that hold without one.
143
+ *
144
+ * ADVISORY ONLY, also by construction: this returns a message, not a validity verdict. No caller may
145
+ * use it to disable a control or gate a submit — a client-side guess must never be able to block a
146
+ * working credential. It is deliberately absent from {@link missingRequiredFields}, which IS a gate.
147
+ *
148
+ * @param config - The active BYOK draft; only `apiKey` is read.
149
+ * @param preset - The resolved preset, or `null` on custom/manual, which is exempt from the
150
+ * cross-vendor arm (see {@link foreignKeyOwner}) but not from the length floor.
151
+ * @param presets - The catalog to recognise foreign keys against. Defaults to empty, which is why
152
+ * omitting it costs the cross-vendor arm and gains nothing else: an under-informed rule must
153
+ * degrade toward silence, never toward guessing.
154
+ * @returns A translatable {@link ApiKeyWarning}, or `null` when there is nothing to say.
155
+ * @complexity O(n·m) via {@link foreignKeyOwner}; the length check is O(1).
156
+ */
157
+ export function apiKeyFormatWarning(config, preset, presets = []) {
158
+ const key = config.apiKey.trim();
159
+ if (!key)
160
+ return null;
161
+ if (preset) {
162
+ const owner = foreignKeyOwner(key, preset, presets);
163
+ if (owner) {
164
+ return {
165
+ message: API_KEY_CROSS_VENDOR_WARNING,
166
+ vars: { vendor: owner.title, provider: preset.title },
167
+ };
168
+ }
169
+ }
170
+ if (key.length < MIN_PLAUSIBLE_API_KEY_LENGTH) {
171
+ return { message: API_KEY_TOO_SHORT_WARNING, vars: {} };
172
+ }
173
+ return null;
174
+ }
93
175
  /**
94
176
  * The credentials a given preset would use — the active selection's live
95
177
  * top-level fields when `preset` IS the current selection, otherwise that
@@ -411,4 +493,131 @@ export function agentDiagnosticTooltip(diagnostic) {
411
493
  .filter((line) => typeof line === 'string' && line.length > 0)
412
494
  .join('\n');
413
495
  }
496
+ /**
497
+ * Splits a model id into its base and its reasoning-effort suffix, for a runtime that encodes
498
+ * effort inside the id (`DetectedAgent.reasoningInModelId`).
499
+ *
500
+ * Only a trailing `-<token>` whose token appears in `levelIds` is a level. Everything else stays
501
+ * part of the base id — which is the whole point: `claude-opus-4-6-thinking` ends in `-thinking`,
502
+ * which LOOKS like a modifier and is not an effort level, and reading it as one would invent a
503
+ * `claude-opus-4-6` base that has no variants and a `thinking` level no control can render.
504
+ *
505
+ * @param modelId - A full model id from the agent's own catalog.
506
+ * @param levelIds - The declared effort vocabulary (`reasoningInModelId.levels`, ids only).
507
+ * @returns The base id and the level, or `level: null` when the id carries no recognized suffix.
508
+ * @complexity O(k) in `levelIds.length`.
509
+ */
510
+ export function splitReasoningModelId(modelId, levelIds) {
511
+ for (const level of levelIds) {
512
+ const suffix = `-${level}`;
513
+ // `length > suffix.length` rather than `endsWith` alone: an id that is nothing BUT the suffix
514
+ // has no base to split off, and splitting it would merge every such entry into one empty-id
515
+ // group.
516
+ if (modelId.length > suffix.length && modelId.endsWith(suffix)) {
517
+ return { baseId: modelId.slice(0, -suffix.length), level };
518
+ }
519
+ }
520
+ return { baseId: modelId, level: null };
521
+ }
522
+ /**
523
+ * Strips a trailing effort qualifier from a model label — `Gemini 3.1 Pro (High)` -> `Gemini 3.1
524
+ * Pro` — and only when the label really ends in the qualifier for the level its id carried.
525
+ *
526
+ * Deliberately narrow: it removes a parenthetical only when that parenthetical's contents match
527
+ * THIS entry's own level (by id or by label, case-insensitively). `Claude Sonnet 4.6 (Thinking)`
528
+ * has no level, so nothing is stripped, and a vendor label that happens to end in an unrelated
529
+ * parenthetical keeps it.
530
+ */
531
+ function baseLabelForLevel(label, level) {
532
+ if (!level)
533
+ return label;
534
+ const match = /^(.*?)\s*\(([^()]*)\)\s*$/.exec(label);
535
+ if (!match)
536
+ return label;
537
+ const inner = (match[2] ?? '').trim().toLowerCase();
538
+ if (inner !== level.id.toLowerCase() && inner !== level.label.toLowerCase())
539
+ return label;
540
+ const stripped = (match[1] ?? '').trim();
541
+ return stripped || label;
542
+ }
543
+ /**
544
+ * Groups an agent's model list by base model, recording for each base the effort levels it
545
+ * ACTUALLY has.
546
+ *
547
+ * Derived, never declared — that is the correctness property this function exists for. Verified
548
+ * against `agy models`' real output: `gemini-3.8-flash` has high/medium/low, `gemini-3.1-pro` has
549
+ * ONLY high and low, `gpt-oss-120b` only medium, and `claude-sonnet-4-6` none. A fixed
550
+ * high/medium/low control would offer `gemini-3.1-pro-medium`, which does not exist and which
551
+ * `agy --model` rejects outright. Running the same derivation over whichever list the host
552
+ * supplied — live from the CLI or the def's `fallbackModels` — is also what makes an offline
553
+ * degrade behave consistently rather than differently.
554
+ *
555
+ * @param models - The agent's model catalog, in the order it should be offered.
556
+ * @param levels - The declared effort vocabulary, in display order.
557
+ * @returns One group per base id, in first-appearance order. With an empty vocabulary every id is
558
+ * its own bare group, so a caller needs no special case for "this agent declares nothing".
559
+ * @complexity O(n * k) in the catalog size and the vocabulary size.
560
+ */
561
+ export function reasoningModelGroups(models, levels) {
562
+ const levelIds = levels.map((level) => level.id);
563
+ const byBase = new Map();
564
+ for (const model of models) {
565
+ const { baseId, level } = splitReasoningModelId(model.id, levelIds);
566
+ const existing = byBase.get(baseId);
567
+ const entry = existing ?? { label: baseLabelForLevel(model.label, levels.find((l) => l.id === level)), ids: new Map() };
568
+ if (level === null) {
569
+ // A base listed on its own AND with variants keeps both: the bare id is the "no effort
570
+ // stated" choice, the variants are the stated ones.
571
+ entry.bare = model.id;
572
+ }
573
+ else {
574
+ entry.ids.set(level, model.id);
575
+ }
576
+ if (!existing)
577
+ byBase.set(baseId, entry);
578
+ }
579
+ return [...byBase.entries()].map(([baseId, entry]) => ({
580
+ baseId,
581
+ label: entry.label,
582
+ // Ordered by the DECLARED vocabulary, not by catalog order, so the control's option order is
583
+ // stable across bases even if a CLI ever lists one base's variants in a different order.
584
+ levels: levels.filter((level) => entry.ids.has(level.id)),
585
+ modelIdByLevel: Object.fromEntries(entry.ids),
586
+ ...(entry.bare !== undefined ? { bareModelId: entry.bare } : {}),
587
+ }));
588
+ }
589
+ /** The group a full model id belongs to, or `null` when the id is not in this catalog at all — a
590
+ * saved pick from an older/different catalog must not be silently attached to some other base. */
591
+ export function reasoningModelGroupFor(groups, modelId, levelIds) {
592
+ if (!modelId)
593
+ return null;
594
+ const { baseId } = splitReasoningModelId(modelId, levelIds);
595
+ return groups.find((group) => group.baseId === baseId) ?? null;
596
+ }
597
+ /**
598
+ * Recombines a base model and an effort level back into one model id — the value `--model`
599
+ * actually receives.
600
+ *
601
+ * Never composes a string: every id it can return came out of the agent's own catalog. That is
602
+ * what makes "switch base while a level is selected" safe — carrying `medium` from
603
+ * `gemini-3.8-flash` over to `gemini-3.1-pro` cannot produce `gemini-3.1-pro-medium`, because
604
+ * that base's table has no `medium` entry and the fallback below lands on a level it does have.
605
+ *
606
+ * @param group - The target base's derived group.
607
+ * @param level - The level to prefer, or `null` for "no preference".
608
+ * @returns An id from the catalog: the requested level's, else the base's bare id, else its first
609
+ * available level's, else the bare base id (only reachable for a group built from nothing).
610
+ * @complexity O(1).
611
+ */
612
+ export function modelIdForReasoningLevel(group, level) {
613
+ if (level) {
614
+ const exact = group.modelIdByLevel[level];
615
+ if (exact)
616
+ return exact;
617
+ }
618
+ if (group.bareModelId !== undefined)
619
+ return group.bareModelId;
620
+ const first = group.levels[0];
621
+ return first ? (group.modelIdByLevel[first.id] ?? group.baseId) : group.baseId;
622
+ }
414
623
  //# sourceMappingURL=rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/features/execution/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAiBhF;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AAED;oDACoD;AACpD,MAAM,UAAU,YAAY,CAAC,QAAgC,EAAE,KA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