@opengeni/react 1.4.4 → 1.4.5-canary.37485542607001
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.
- package/README.md +17 -6
- package/dist/artifacts.d.ts +1 -0
- package/dist/artifacts.js +22 -15
- package/dist/artifacts.js.map +1 -1
- package/dist/{browser-viewer-5EEAS3IU.js → browser-viewer-CV23VIHB.js} +8 -6
- package/dist/{chunk-XS67YG5R.js → chunk-4O7OE7ON.js} +45 -4
- package/dist/chunk-4O7OE7ON.js.map +1 -0
- package/dist/{chunk-JHTIMBOL.js → chunk-5JSUNNQN.js} +26 -4
- package/dist/{chunk-JHTIMBOL.js.map → chunk-5JSUNNQN.js.map} +1 -1
- package/dist/{chunk-QMMCJGFI.js → chunk-6BAMPGBV.js} +6 -3
- package/dist/chunk-6BAMPGBV.js.map +1 -0
- package/dist/{chunk-I6OY3MWC.js → chunk-6FOTSVWU.js} +2 -2
- package/dist/{chunk-LVS3MH5T.js → chunk-ATIRUHBZ.js} +128 -10
- package/dist/chunk-ATIRUHBZ.js.map +1 -0
- package/dist/chunk-BOFEQC6K.js +162 -0
- package/dist/chunk-BOFEQC6K.js.map +1 -0
- package/dist/{chunk-2OQA3CPB.js → chunk-CESBPQP5.js} +19 -5
- package/dist/chunk-CESBPQP5.js.map +1 -0
- package/dist/{chunk-YVFRBXST.js → chunk-GMNGUPMX.js} +2 -2
- package/dist/{chunk-PHBFJCEU.js → chunk-I5EGRXXG.js} +110 -7
- package/dist/chunk-I5EGRXXG.js.map +1 -0
- package/dist/{chunk-PBCZL4JP.js → chunk-INIZSNXT.js} +2 -2
- package/dist/chunk-IZV5FTJC.js +55 -0
- package/dist/chunk-IZV5FTJC.js.map +1 -0
- package/dist/chunk-JDJJMBB3.js +1883 -0
- package/dist/chunk-JDJJMBB3.js.map +1 -0
- package/dist/chunk-LHF6BVM4.js +83 -0
- package/dist/chunk-LHF6BVM4.js.map +1 -0
- package/dist/{chunk-C5BF4L26.js → chunk-LSMWZSCJ.js} +7 -7
- package/dist/chunk-LTKGTXUQ.js +174 -0
- package/dist/chunk-LTKGTXUQ.js.map +1 -0
- package/dist/chunk-N7S72EXK.js +25 -0
- package/dist/chunk-N7S72EXK.js.map +1 -0
- package/dist/{chunk-CVYCLFMH.js → chunk-PEHTX3V7.js} +19 -1
- package/dist/chunk-PEHTX3V7.js.map +1 -0
- package/dist/chunk-R5R5RQQD.js +51 -0
- package/dist/chunk-R5R5RQQD.js.map +1 -0
- package/dist/{chunk-IYQCWGU5.js → chunk-RGTZ2VDR.js} +35 -62
- package/dist/chunk-RGTZ2VDR.js.map +1 -0
- package/dist/chunk-RI42H5IU.js +326 -0
- package/dist/chunk-RI42H5IU.js.map +1 -0
- package/dist/{chunk-EAOSEIXB.js → chunk-RRRS5D5T.js} +727 -1983
- package/dist/chunk-RRRS5D5T.js.map +1 -0
- package/dist/{chunk-JH7V627O.js → chunk-SHLZMAJN.js} +2 -11
- package/dist/chunk-SHLZMAJN.js.map +1 -0
- package/dist/{chunk-IUHHPMAX.js → chunk-SZOCY5VG.js} +18 -87
- package/dist/chunk-SZOCY5VG.js.map +1 -0
- package/dist/{chunk-L2J3PU7A.js → chunk-VYIPNDUZ.js} +29 -100
- package/dist/chunk-VYIPNDUZ.js.map +1 -0
- package/dist/{chunk-G6YRCIYJ.js → chunk-YK6QMGVL.js} +55 -60
- package/dist/chunk-YK6QMGVL.js.map +1 -0
- package/dist/chunk-ZIB4H5LN.js +101 -0
- package/dist/chunk-ZIB4H5LN.js.map +1 -0
- package/dist/client.d.ts +9 -3
- package/dist/clipboard.js +1 -1
- package/dist/components/browser-viewer.d.ts +6 -0
- package/dist/components/composer.d.ts +3 -69
- package/dist/components/human-input-form.d.ts +3 -32
- package/dist/components/markdown.d.ts +8 -0
- package/dist/components/model-policy-picker.d.ts +4 -37
- package/dist/components/opper-mark.d.ts +7 -0
- package/dist/components/provider-recovery-notice.d.ts +15 -0
- package/dist/components/remark-soft-line-breaks.d.ts +38 -0
- package/dist/components/sandbox-workspace.d.ts +13 -0
- package/dist/components/session-chrome.d.ts +5 -3
- package/dist/components/session-conversation.d.ts +15 -3
- package/dist/composer-messages.d.ts +74 -0
- package/dist/composer-messages.js +9 -0
- package/dist/composer.js +15 -10
- package/dist/{computer-viewer-ELNLZGHI.js → computer-viewer-K4CKYRX6.js} +4 -4
- package/dist/connect-setup.d.ts +2 -0
- package/dist/connect.d.ts +1 -1
- package/dist/connect.js +21 -6
- package/dist/connect.js.map +1 -1
- package/dist/{embedded-voice-NIL4RDX3.js → embedded-voice-K7SOZVVZ.js} +6 -4
- package/dist/{embedded-voice-NIL4RDX3.js.map → embedded-voice-K7SOZVVZ.js.map} +1 -1
- package/dist/hooks/shared-machines-list.d.ts +4 -0
- package/dist/hooks/use-client-config-flags.d.ts +6 -0
- package/dist/hooks/use-goal.d.ts +2 -1
- package/dist/hooks/use-new-session-draft.d.ts +74 -0
- package/dist/human-input-model.d.ts +40 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +116 -73
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +5 -5
- package/dist/{latest-question-2POFPYNB.js → latest-question-27HGRPVF.js} +3 -3
- package/dist/lib/clipboard.d.ts +7 -0
- package/dist/lib/provider-recovery.d.ts +49 -0
- package/dist/lib/transient-retry.d.ts +25 -0
- package/dist/machines.js +2 -2
- package/dist/model-mark-paths.d.ts +34 -0
- package/dist/model-mark-paths.js +16 -0
- package/dist/model-picker-model.d.ts +111 -0
- package/dist/model-picker-model.js +25 -0
- package/dist/model-picker-model.js.map +1 -0
- package/dist/{model-policy-picker-menu-WRNSRFQC.js → model-policy-picker-menu-I5KPC3D6.js} +6 -4
- package/dist/model-policy-picker-menu-I5KPC3D6.js.map +1 -0
- package/dist/model-policy.d.ts +10 -0
- package/dist/model-policy.js +5 -1
- package/dist/new-session-draft.d.ts +7 -0
- package/dist/new-session-draft.js +639 -0
- package/dist/new-session-draft.js.map +1 -0
- package/dist/organization-model.d.ts +32 -0
- package/dist/organization-model.js +65 -0
- package/dist/organization-model.js.map +1 -0
- package/dist/{platform-activity-row-PJJVATTZ.js → platform-activity-row-NJ47YBXW.js} +7 -84
- package/dist/platform-activity-row-NJ47YBXW.js.map +1 -0
- package/dist/queue-presentation-model.d.ts +72 -0
- package/dist/queue-presentation-model.js +38 -0
- package/dist/queue-presentation-model.js.map +1 -0
- package/dist/{queue-surface-implementation-67FS7FUI.js → queue-surface-implementation-YPJFQ3O6.js} +24 -252
- package/dist/queue-surface-implementation-YPJFQ3O6.js.map +1 -0
- package/dist/realtime.js +5 -3
- package/dist/{sandbox-files-34CJJNOY.js → sandbox-files-2DGDO6NI.js} +5 -5
- package/dist/sandbox-files-2DGDO6NI.js.map +1 -0
- package/dist/sandbox-label-model.d.ts +23 -0
- package/dist/sandbox-label-model.js +28 -0
- package/dist/sandbox-label-model.js.map +1 -0
- package/dist/session-agents-model.d.ts +10 -0
- package/dist/session-agents-model.js +25 -0
- package/dist/session-agents-model.js.map +1 -0
- package/dist/session-attention-model.d.ts +8 -0
- package/dist/session-attention-model.js +46 -0
- package/dist/session-attention-model.js.map +1 -0
- package/dist/session-feedback-model.d.ts +20 -0
- package/dist/session-feedback-model.js +56 -0
- package/dist/session-feedback-model.js.map +1 -0
- package/dist/session-list-model.d.ts +119 -0
- package/dist/session-list-model.js +244 -0
- package/dist/session-list-model.js.map +1 -0
- package/dist/session-status-model.d.ts +19 -0
- package/dist/session-ui.js +26 -17
- package/dist/session-ui.js.map +1 -1
- package/dist/session.js +8 -6
- package/dist/testing/session-scenarios.d.ts +10 -0
- package/dist/testing/session-scenarios.js +303 -0
- package/dist/testing/session-scenarios.js.map +1 -0
- package/dist/timeline/genie-copy.d.ts +3 -0
- package/dist/timeline/genie-loading.d.ts +11 -0
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/notice-presentation.d.ts +7 -0
- package/dist/timeline/patch-apply-command.d.ts +18 -0
- package/dist/timeline/platform-activity-presentation.d.ts +7 -0
- package/dist/timeline/presented-image.d.ts +6 -1
- package/dist/timeline/question-nav-model.d.ts +23 -0
- package/dist/timeline/registry.d.ts +10 -1
- package/dist/timeline/retained-loaders.d.ts +1 -1
- package/dist/timeline/tool-presentation.d.ts +172 -0
- package/dist/timeline/turn-summary-model.d.ts +90 -0
- package/dist/timeline/turn-summary.d.ts +4 -74
- package/dist/timeline/work-presentation.d.ts +42 -0
- package/dist/timeline-model.d.ts +24 -0
- package/dist/timeline-model.js +152 -0
- package/dist/timeline-model.js.map +1 -0
- package/package.json +55 -3
- package/src/artifacts.ts +1 -0
- package/src/client.ts +9 -3
- package/src/components/browser-viewer.tsx +23 -2
- package/src/components/claude-mark.tsx +2 -1
- package/src/components/composer.tsx +8 -146
- package/src/components/grok-mark.tsx +2 -1
- package/src/components/human-input-form.tsx +13 -124
- package/src/components/markdown.tsx +19 -1
- package/src/components/message-timeline.tsx +45 -99
- package/src/components/model-mark.tsx +2 -1
- package/src/components/model-policy-picker-menu.tsx +30 -85
- package/src/components/model-policy-picker.tsx +20 -150
- package/src/components/opper-mark.tsx +18 -0
- package/src/components/provider-recovery-notice.tsx +41 -0
- package/src/components/queue-surface-implementation.tsx +20 -349
- package/src/components/remark-soft-line-breaks.ts +166 -0
- package/src/components/sandbox-workspace.tsx +17 -1
- package/src/components/session-chrome.tsx +114 -99
- package/src/components/session-conversation.tsx +55 -6
- package/src/components/session-status.tsx +17 -16
- package/src/composer-messages.ts +150 -0
- package/src/connect-setup.tsx +45 -11
- package/src/connect.ts +1 -1
- package/src/hooks/shared-machines-list.ts +34 -1
- package/src/hooks/use-client-config-flags.ts +8 -0
- package/src/hooks/use-goal.ts +66 -10
- package/src/hooks/use-new-session-draft.ts +813 -0
- package/src/human-input-model.ts +147 -0
- package/src/index.ts +16 -0
- package/src/lib/clipboard.ts +29 -0
- package/src/lib/format.ts +7 -0
- package/src/lib/provider-recovery.ts +202 -0
- package/src/lib/transient-retry.ts +99 -0
- package/src/model-mark-paths.ts +53 -0
- package/src/model-picker-model.ts +330 -0
- package/src/model-policy.ts +75 -5
- package/src/new-session-draft.ts +22 -0
- package/src/organization-model.ts +118 -0
- package/src/queue-presentation-model.ts +464 -0
- package/src/sandbox-label-model.ts +41 -0
- package/src/session-agents-model.ts +33 -0
- package/src/session-attention-model.ts +59 -0
- package/src/session-feedback-model.ts +95 -0
- package/src/session-list-model.ts +377 -0
- package/src/session-status-model.ts +62 -0
- package/src/testing/session-scenarios.ts +326 -0
- package/src/timeline/activity-rail.tsx +54 -24
- package/src/timeline/genie-copy.ts +19 -0
- package/src/timeline/genie-loading.tsx +15 -19
- package/src/timeline/index.ts +1 -0
- package/src/timeline/notice-presentation.ts +22 -0
- package/src/timeline/patch-apply-command.tsx +135 -0
- package/src/timeline/platform-activity-presentation.ts +122 -0
- package/src/timeline/platform-activity-row.tsx +6 -96
- package/src/timeline/presented-image.ts +16 -2
- package/src/timeline/projection.ts +12 -1
- package/src/timeline/question-nav-model.ts +28 -0
- package/src/timeline/registry.ts +11 -1
- package/src/timeline/retained-loaders.ts +9 -4
- package/src/timeline/rolling-activity.tsx +7 -19
- package/src/timeline/tool-presentation.ts +1316 -0
- package/src/timeline/tool-renderers.tsx +254 -1024
- package/src/timeline/turn-summary-model.ts +338 -0
- package/src/timeline/turn-summary.tsx +21 -326
- package/src/timeline/work-presentation.ts +139 -0
- package/src/timeline-model.ts +108 -0
- package/styles/compiled.css +17 -4
- package/styles/connect.css +4 -0
- package/styles/responsive.css +11 -2
- package/dist/chunk-2OQA3CPB.js.map +0 -1
- package/dist/chunk-CVYCLFMH.js.map +0 -1
- package/dist/chunk-EAOSEIXB.js.map +0 -1
- package/dist/chunk-G6YRCIYJ.js.map +0 -1
- package/dist/chunk-HXYOSSQO.js +0 -117
- package/dist/chunk-HXYOSSQO.js.map +0 -1
- package/dist/chunk-IUHHPMAX.js.map +0 -1
- package/dist/chunk-IYQCWGU5.js.map +0 -1
- package/dist/chunk-JH7V627O.js.map +0 -1
- package/dist/chunk-L2J3PU7A.js.map +0 -1
- package/dist/chunk-LVS3MH5T.js.map +0 -1
- package/dist/chunk-PHBFJCEU.js.map +0 -1
- package/dist/chunk-QMMCJGFI.js.map +0 -1
- package/dist/chunk-XS67YG5R.js.map +0 -1
- package/dist/platform-activity-row-PJJVATTZ.js.map +0 -1
- package/dist/queue-surface-implementation-67FS7FUI.js.map +0 -1
- /package/dist/{browser-viewer-5EEAS3IU.js.map → browser-viewer-CV23VIHB.js.map} +0 -0
- /package/dist/{chunk-I6OY3MWC.js.map → chunk-6FOTSVWU.js.map} +0 -0
- /package/dist/{chunk-YVFRBXST.js.map → chunk-GMNGUPMX.js.map} +0 -0
- /package/dist/{chunk-PBCZL4JP.js.map → chunk-INIZSNXT.js.map} +0 -0
- /package/dist/{chunk-C5BF4L26.js.map → chunk-LSMWZSCJ.js.map} +0 -0
- /package/dist/{computer-viewer-ELNLZGHI.js.map → composer-messages.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-WRNSRFQC.js.map → computer-viewer-K4CKYRX6.js.map} +0 -0
- /package/dist/{latest-question-2POFPYNB.js.map → latest-question-27HGRPVF.js.map} +0 -0
- /package/dist/{sandbox-files-34CJJNOY.js.map → model-mark-paths.js.map} +0 -0
|
@@ -23,14 +23,21 @@ import {
|
|
|
23
23
|
type ReactNode,
|
|
24
24
|
} from "react";
|
|
25
25
|
import { cn } from "../lib/cn";
|
|
26
|
+
import {
|
|
27
|
+
billingClassForMissingSelection,
|
|
28
|
+
defaultModelPolicyPickerMessages,
|
|
29
|
+
effectiveRows as sharedEffectiveRows,
|
|
30
|
+
groupPresentationFor,
|
|
31
|
+
SCOPED_BILLING_HINTS,
|
|
32
|
+
type ModelPickerGroupPresentation,
|
|
33
|
+
type ModelPolicyPickerMessages,
|
|
34
|
+
} from "../model-picker-model";
|
|
26
35
|
import { MENU_CHEVRON_CLASS } from "../lib/menu-styles";
|
|
27
36
|
import { usePortalTokenSource, usePortalTokenStyle } from "../lib/use-portal-token-style";
|
|
28
37
|
import {
|
|
29
|
-
effortOptionsForModel,
|
|
30
38
|
findPickerRow,
|
|
31
39
|
labelReasoningEffort,
|
|
32
|
-
|
|
33
|
-
scopedBillingClassLabel,
|
|
40
|
+
modelOffersEffortChoice,
|
|
34
41
|
type PickerBillingClass,
|
|
35
42
|
type PickerModelRow,
|
|
36
43
|
} from "../model-policy";
|
|
@@ -44,72 +51,10 @@ const LazyModelPolicyPickerMenu = lazy(() =>
|
|
|
44
51
|
type ClientPickerModelRow = PickerModelRow<ClientModel>;
|
|
45
52
|
|
|
46
53
|
/** Presentation only; never changes model identity, billing or availability. */
|
|
47
|
-
export type ModelPolicyPickerGroupPresentation =
|
|
48
|
-
Record<
|
|
49
|
-
PickerBillingClass,
|
|
50
|
-
{
|
|
51
|
-
label?: string | undefined;
|
|
52
|
-
/** Omit to preserve the default; null hides the supporting text. */
|
|
53
|
-
description?: string | null | undefined;
|
|
54
|
-
/** Decorative, non-interactive content. Omit for the default; null hides it. */
|
|
55
|
-
icon?: ReactNode | undefined;
|
|
56
|
-
}
|
|
57
|
-
>
|
|
58
|
-
>;
|
|
59
|
-
|
|
60
|
-
export type ModelPolicyPickerMessages = {
|
|
61
|
-
label: string;
|
|
62
|
-
loading: string;
|
|
63
|
-
noModels: string;
|
|
64
|
-
connectTitle: string;
|
|
65
|
-
connectBody: string;
|
|
66
|
-
connectAction: string;
|
|
67
|
-
thinking: string;
|
|
68
|
-
fast: string;
|
|
69
|
-
fastRateHint: string;
|
|
70
|
-
codexOnly: string;
|
|
71
|
-
searchLabel?: string;
|
|
72
|
-
searchPlaceholder?: string;
|
|
73
|
-
currentModel?: string;
|
|
74
|
-
noMatches?: string;
|
|
75
|
-
unsupportedAttachments?: string;
|
|
76
|
-
thinkingEffort?: string;
|
|
77
|
-
selected?: string;
|
|
78
|
-
free?: string;
|
|
79
|
-
|
|
80
|
-
billingHints: Record<PickerBillingClass, string>;
|
|
81
|
-
};
|
|
54
|
+
export type ModelPolicyPickerGroupPresentation = ModelPickerGroupPresentation<ReactNode>;
|
|
82
55
|
|
|
83
|
-
export
|
|
84
|
-
|
|
85
|
-
loading: "Loading model catalog…",
|
|
86
|
-
noModels: "No models available.",
|
|
87
|
-
connectTitle: "Connect a model",
|
|
88
|
-
connectBody: "Use a subscription or a provider key you already have.",
|
|
89
|
-
connectAction: "Open Models",
|
|
90
|
-
thinking: "Thinking",
|
|
91
|
-
fast: "Fast",
|
|
92
|
-
fastRateHint: "2× rate",
|
|
93
|
-
codexOnly: "Codex-only session",
|
|
94
|
-
searchLabel: "Search models or providers",
|
|
95
|
-
searchPlaceholder: "Search models or providers…",
|
|
96
|
-
currentModel: "Current model",
|
|
97
|
-
noMatches: "No matching models. Try a model or provider name.",
|
|
98
|
-
unsupportedAttachments: "This model cannot view the attached images.",
|
|
99
|
-
thinkingEffort: "Thinking effort",
|
|
100
|
-
selected: "Selected",
|
|
101
|
-
free: "Free",
|
|
102
|
-
|
|
103
|
-
billingHints: {
|
|
104
|
-
opengeni_credits: "Provided by Opengeni",
|
|
105
|
-
external: "Provider terms and limits apply",
|
|
106
|
-
codex_subscription: "ChatGPT / Codex plan",
|
|
107
|
-
supergrok_subscription: "SuperGrok / xAI plan",
|
|
108
|
-
claude_subscription: "Claude plan",
|
|
109
|
-
byok: "Billed to the connected provider account",
|
|
110
|
-
organization_byok: "Billed to the connected provider account",
|
|
111
|
-
},
|
|
112
|
-
};
|
|
56
|
+
export { defaultModelPolicyPickerMessages, groupPresentationFor, SCOPED_BILLING_HINTS };
|
|
57
|
+
export type { ModelPolicyPickerMessages };
|
|
113
58
|
|
|
114
59
|
export type ModelPolicyPickerProps = {
|
|
115
60
|
/** Host branding for payment-source groups, shared by menu and trigger. */
|
|
@@ -221,43 +166,6 @@ export function BillingClassMark(props: {
|
|
|
221
166
|
);
|
|
222
167
|
}
|
|
223
168
|
|
|
224
|
-
function isCodexModel(model: ClientModel): boolean {
|
|
225
|
-
return model.id.startsWith("codex/") || model.source === "codex";
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function billingClassForMissingSelection(modelId: string): PickerBillingClass {
|
|
229
|
-
if (modelId.startsWith("workspace-claude-subscription/")) return "claude_subscription";
|
|
230
|
-
if (modelId.startsWith("workspace-anthropic/")) return "byok";
|
|
231
|
-
if (modelId.startsWith("organization-claude-subscription/")) return "claude_subscription";
|
|
232
|
-
if (modelId.startsWith("organization-anthropic/")) return "organization_byok";
|
|
233
|
-
if (modelId.startsWith("workspace-gateway/")) return "byok";
|
|
234
|
-
if (modelId.startsWith("workspace-openrouter/")) return "byok";
|
|
235
|
-
// A deployment OpenRouter ID does not encode its workspace-facing cost.
|
|
236
|
-
// Missing rows therefore use the credits-safe rail instead of falsely
|
|
237
|
-
// claiming that an unknown former selection was externally funded.
|
|
238
|
-
if (modelId.startsWith("openrouter/")) return "opengeni_credits";
|
|
239
|
-
if (modelId.startsWith("codex/")) return "codex_subscription";
|
|
240
|
-
if (modelId.startsWith("supergrok/")) return "supergrok_subscription";
|
|
241
|
-
return "opengeni_credits";
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function applyCodexOnly(
|
|
245
|
-
rows: ClientPickerModelRow[],
|
|
246
|
-
codexOnly: boolean,
|
|
247
|
-
unavailableReason: string,
|
|
248
|
-
): ClientPickerModelRow[] {
|
|
249
|
-
if (!codexOnly) return rows;
|
|
250
|
-
return rows.map((row) =>
|
|
251
|
-
isCodexModel(row.catalog)
|
|
252
|
-
? row
|
|
253
|
-
: {
|
|
254
|
-
...row,
|
|
255
|
-
selectable: false,
|
|
256
|
-
unavailableReason: row.unavailableReason ?? unavailableReason,
|
|
257
|
-
},
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
169
|
/**
|
|
262
170
|
* The trigger shows who makes the chosen model. Subscription rails already
|
|
263
171
|
* carry their maker's mark (ChatGPT, Claude, Grok). Configured catalog logos win
|
|
@@ -306,27 +214,6 @@ const SCOPED_MARK_LABELS: Partial<Record<PickerBillingClass, string>> = {
|
|
|
306
214
|
organization_byok: "Organization provider account",
|
|
307
215
|
};
|
|
308
216
|
|
|
309
|
-
/** Models settings keeps naming who is billed for a key. */
|
|
310
|
-
export const SCOPED_BILLING_HINTS: Partial<Record<PickerBillingClass, string>> = {
|
|
311
|
-
byok: "Billed to the workspace provider account",
|
|
312
|
-
organization_byok: "Billed to the organization provider account",
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Host branding for a payment group. While scopes are collapsed, API keys are
|
|
317
|
-
* one group, so either API-key presentation serves both.
|
|
318
|
-
*/
|
|
319
|
-
export function groupPresentationFor(
|
|
320
|
-
props: Pick<ModelPolicyPickerProps, "groupPresentation" | "collapseScopes">,
|
|
321
|
-
billingClass: PickerBillingClass,
|
|
322
|
-
): ModelPolicyPickerGroupPresentation[PickerBillingClass] {
|
|
323
|
-
const own = props.groupPresentation?.[billingClass];
|
|
324
|
-
if (own !== undefined || props.collapseScopes === false) return own;
|
|
325
|
-
if (billingClass === "byok") return props.groupPresentation?.organization_byok;
|
|
326
|
-
if (billingClass === "organization_byok") return props.groupPresentation?.byok;
|
|
327
|
-
return undefined;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
217
|
/** A selection the catalog no longer lists: its clean name (settings keep the id). */
|
|
331
218
|
function fallbackName(props: ModelPolicyPickerProps): string {
|
|
332
219
|
return props.collapseScopes === false ? props.model : modelDisplayName(props.model);
|
|
@@ -339,24 +226,7 @@ const BRANDED_BILLING_CLASSES: ReadonlySet<PickerBillingClass> = new Set([
|
|
|
339
226
|
]);
|
|
340
227
|
|
|
341
228
|
export function effectiveRows(props: ModelPolicyPickerProps): ClientPickerModelRow[] {
|
|
342
|
-
|
|
343
|
-
const messages = { ...defaultModelPolicyPickerMessages, ...props.messages };
|
|
344
|
-
return applyCodexOnly(rows, props.codexOnly === true, messages.codexOnly).map((row) => {
|
|
345
|
-
const scoped =
|
|
346
|
-
props.collapseScopes === false
|
|
347
|
-
? {
|
|
348
|
-
...row,
|
|
349
|
-
label: row.catalog.label,
|
|
350
|
-
billingClassLabel: scopedBillingClassLabel(row.billingClass),
|
|
351
|
-
}
|
|
352
|
-
: row;
|
|
353
|
-
if (props.collapseScopes === false) {
|
|
354
|
-
if (row.catalog.shortLabel) scoped.shortLabel = row.catalog.shortLabel;
|
|
355
|
-
else delete scoped.shortLabel;
|
|
356
|
-
}
|
|
357
|
-
const label = groupPresentationFor(props, row.billingClass)?.label;
|
|
358
|
-
return label === undefined ? scoped : { ...scoped, billingClassLabel: label };
|
|
359
|
-
});
|
|
229
|
+
return sharedEffectiveRows(props);
|
|
360
230
|
}
|
|
361
231
|
|
|
362
232
|
export function PickerNavRow(props: {
|
|
@@ -546,7 +416,10 @@ export function ModelPolicyPicker(props: ModelPolicyPickerProps) {
|
|
|
546
416
|
aria-label={messages.label}
|
|
547
417
|
aria-description={selectedDescription}
|
|
548
418
|
className={cn(
|
|
549
|
-
|
|
419
|
+
// Phone: the composer row also carries attach, dictate, voice, pause
|
|
420
|
+
// and send, so the pill drops its chevron and tightens its padding
|
|
421
|
+
// to keep the model's short name readable.
|
|
422
|
+
"og-root og-model-policy-trigger inline-flex h-[var(--og-model-picker-trigger-height)] min-w-0 max-w-64 items-center gap-1 rounded-full border px-2.5 text-og-control outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-og-accent/40 disabled:cursor-not-allowed disabled:opacity-50 max-sm:h-11 max-sm:max-w-[7.5rem] max-sm:gap-0.5 max-sm:px-1.5",
|
|
550
423
|
// With no usable model the pill is the one thing that unblocks the
|
|
551
424
|
// composer, so it takes the primary wash.
|
|
552
425
|
needsModel
|
|
@@ -568,10 +441,7 @@ export function ModelPolicyPicker(props: ModelPolicyPickerProps) {
|
|
|
568
441
|
? messages.connectTitle
|
|
569
442
|
: (selected?.shortLabel ?? selected?.label ?? fallbackName(props))}
|
|
570
443
|
</span>
|
|
571
|
-
{selected &&
|
|
572
|
-
!needsModel &&
|
|
573
|
-
effortOptionsForModel(selected.catalog).length > 1 &&
|
|
574
|
-
selected.catalog.capabilities?.reasoning.runnable !== false ? (
|
|
444
|
+
{selected && !needsModel && modelOffersEffortChoice(selected.catalog) ? (
|
|
575
445
|
<span
|
|
576
446
|
className="og-model-policy-effort min-w-0 shrink-[9999] truncate"
|
|
577
447
|
title={labelReasoningEffort(props.effort)}
|
|
@@ -586,7 +456,7 @@ export function ModelPolicyPicker(props: ModelPolicyPickerProps) {
|
|
|
586
456
|
data-testid="model-picker-fast-icon"
|
|
587
457
|
/>
|
|
588
458
|
) : null}
|
|
589
|
-
<ChevronDownIcon className="size-3 shrink-0" />
|
|
459
|
+
<ChevronDownIcon className="og-model-policy-chevron size-3 shrink-0 max-sm:hidden" />
|
|
590
460
|
</button>
|
|
591
461
|
|
|
592
462
|
{open ? (
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SVGProps } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Opper's mark (the leaf-and-star symbol of the opper.ai wordmark), redrawn
|
|
5
|
+
* as a single currentColor path on a square box.
|
|
6
|
+
* Source: https://opper.ai (header logo SVG).
|
|
7
|
+
*/
|
|
8
|
+
export function OpperMark(props: SVGProps<SVGSVGElement>) {
|
|
9
|
+
return (
|
|
10
|
+
<svg viewBox="-49.5 0 315 315" fill="currentColor" aria-hidden="true" {...props}>
|
|
11
|
+
<path
|
|
12
|
+
fillRule="evenodd"
|
|
13
|
+
clipRule="evenodd"
|
|
14
|
+
d="M159.78 315C71.53 315 0 244.49 0 157.5C0 -18.9499 159.78 0.650075 159.78 0.650075C159.78 87.2201 88.36 157.4 0.2 157.5C149.8 157.64 159.78 315 159.78 315ZM160.52 217.98C160.52 217.98 156.94 161.65 105.04 157.52C120.6 157.34 160.52 151.54 160.52 96.5601C160.52 151.54 200.44 157.34 216 157.52C164.1 161.63 160.52 217.98 160.52 217.98Z"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Clock3Icon } from "lucide-react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../lib/cn";
|
|
4
|
+
import { providerRecoveryRetryingText, type ProviderRecoveryFacts } from "../lib/provider-recovery";
|
|
5
|
+
|
|
6
|
+
export type ProviderRecoveryNoticeProps = {
|
|
7
|
+
/** From `currentProviderRecovery(session, events)`; renders nothing when null. */
|
|
8
|
+
recovery: ProviderRecoveryFacts | null | undefined;
|
|
9
|
+
/** Replaces the secondary line; `null` hides it. */
|
|
10
|
+
detail?: string | null | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const PROVIDER_RECOVERY_NOTICE_DETAIL =
|
|
15
|
+
"Your message is saved. Opengeni keeps retrying automatically for a few minutes.";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* One calm, live status line while the same turn waits for an automatic retry
|
|
19
|
+
* after a transient provider failure. It replaces itself on every attempt
|
|
20
|
+
* instead of adding timeline rows, and disappears once the turn runs again.
|
|
21
|
+
*/
|
|
22
|
+
export function ProviderRecoveryNotice({
|
|
23
|
+
recovery,
|
|
24
|
+
detail,
|
|
25
|
+
className,
|
|
26
|
+
}: ProviderRecoveryNoticeProps) {
|
|
27
|
+
if (!recovery) return null;
|
|
28
|
+
const secondary = detail === undefined ? PROVIDER_RECOVERY_NOTICE_DETAIL : detail;
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
className={cn("flex items-start gap-2 text-og-sm text-og-fg-muted", className)}
|
|
32
|
+
data-og-provider-recovery=""
|
|
33
|
+
>
|
|
34
|
+
<Clock3Icon aria-hidden="true" className="mt-0.5 size-4 shrink-0" />
|
|
35
|
+
<div className="min-w-0" role="status" aria-live="polite">
|
|
36
|
+
<p className="font-medium text-og-fg">{providerRecoveryRetryingText(recovery)}</p>
|
|
37
|
+
{secondary ? <p className="mt-0.5 text-og-xs">{secondary}</p> : null}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|