@molecule/app-ide-react 1.3.4 → 1.5.0
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 +57 -1
- package/dist/components/ChatPanel.d.ts +6 -1
- package/dist/components/ChatPanel.d.ts.map +1 -1
- package/dist/components/ChatPanel.js +48 -6
- package/dist/components/ChatPanel.js.map +1 -1
- package/dist/components/ShareLinkManager.d.ts +63 -0
- package/dist/components/ShareLinkManager.d.ts.map +1 -0
- package/dist/components/ShareLinkManager.js +162 -0
- package/dist/components/ShareLinkManager.js.map +1 -0
- package/dist/components/ShareModal.d.ts +7 -11
- package/dist/components/ShareModal.d.ts.map +1 -1
- package/dist/components/ShareModal.js +5 -99
- package/dist/components/ShareModal.js.map +1 -1
- package/dist/components/chat-share-utilities.d.ts +6 -0
- package/dist/components/chat-share-utilities.d.ts.map +1 -1
- package/dist/components/chat-share-utilities.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-08-
|
|
6
|
+
Generated: 2026-08-20T20:11:12.690Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ide-react
|
|
@@ -358,6 +358,12 @@ interface ChatPanelProps {
|
|
|
358
358
|
* surface). Omit to hide the row — the shared package stays host-agnostic.
|
|
359
359
|
*/
|
|
360
360
|
onManageCustomModels?: () => void
|
|
361
|
+
/**
|
|
362
|
+
* Bump to make the panel re-read its persisted model/settings state — e.g.
|
|
363
|
+
* after the host's custom-provider surface sets the chat model via "Use".
|
|
364
|
+
* The panel loads that state once on mount otherwise.
|
|
365
|
+
*/
|
|
366
|
+
modelSelectionSignal?: number
|
|
361
367
|
/** Spinner/busy indicator node to show for in-chat loading states (e.g. the "designing" indicator). Falls back to a built-in dots animation. */
|
|
362
368
|
spinner?: ReactNode
|
|
363
369
|
/** Path of the currently focused file in the editor (shown first in @ picker). */
|
|
@@ -461,6 +467,19 @@ interface ChatPanelProps {
|
|
|
461
467
|
* of its own, so when omitted it falls back to the package default constant.
|
|
462
468
|
*/
|
|
463
469
|
version?: string
|
|
470
|
+
/**
|
|
471
|
+
* Host-specific slash commands to MERGE into the command menu, `/help`, and the
|
|
472
|
+
* keyboard dispatcher, on top of the shared {@link COMMANDS} registry. For
|
|
473
|
+
* commands the host handles itself (server-side intercepts or the agent), so
|
|
474
|
+
* they show up in the menu instead of being invisible. Selecting one fills the
|
|
475
|
+
* input with `/<id> ` (so the user can add arguments) and sending it routes to
|
|
476
|
+
* the host's own handler — the shared package never dispatches these.
|
|
477
|
+
*
|
|
478
|
+
* The host owns keeping this list in sync with its handlers; molecule.dev, for
|
|
479
|
+
* example, fetches it from `GET /ai/commands`. Ids must not collide with a
|
|
480
|
+
* shared command id. Optional — omit for the plain shared command set.
|
|
481
|
+
*/
|
|
482
|
+
extraCommands?: readonly CommandDef[]
|
|
464
483
|
/**
|
|
465
484
|
* URL the command-menu "Report a problem" link points at (the host's own issue
|
|
466
485
|
* tracker / feedback page). The shared IDE owns no product URLs, so when this
|
|
@@ -1159,6 +1178,12 @@ interface ShareLinkResult {
|
|
|
1159
1178
|
* wins over the current page origin.
|
|
1160
1179
|
*/
|
|
1161
1180
|
url?: string
|
|
1181
|
+
/** When the link expires, if ever (ISO 8601); absent/`null` = no expiry. */
|
|
1182
|
+
expiresAt?: string | null
|
|
1183
|
+
/** When the link was revoked (ISO 8601); absent/`null` = still active. */
|
|
1184
|
+
revokedAt?: string | null
|
|
1185
|
+
/** When the link was created (ISO 8601). */
|
|
1186
|
+
createdAt?: string
|
|
1162
1187
|
}
|
|
1163
1188
|
```
|
|
1164
1189
|
|
|
@@ -1677,6 +1702,7 @@ function ChatPanel({
|
|
|
1677
1702
|
agentName,
|
|
1678
1703
|
productName,
|
|
1679
1704
|
version,
|
|
1705
|
+
extraCommands,
|
|
1680
1706
|
feedbackUrl,
|
|
1681
1707
|
className,
|
|
1682
1708
|
}: ChatPanelProps): JSX.Element
|
|
@@ -2329,6 +2355,36 @@ function serializeEvent(e: KeyboardEvent, isMac?: boolean): string
|
|
|
2329
2355
|
|
|
2330
2356
|
**Returns:** Serialized combo string.
|
|
2331
2357
|
|
|
2358
|
+
#### `ShareLinkManager(props)`
|
|
2359
|
+
|
|
2360
|
+
The reusable public-link manager. See the module doc for behavior.
|
|
2361
|
+
|
|
2362
|
+
```typescript
|
|
2363
|
+
function ShareLinkManager({
|
|
2364
|
+
projectId,
|
|
2365
|
+
canManage = true,
|
|
2366
|
+
canCreate = canManage,
|
|
2367
|
+
canRevoke = canManage,
|
|
2368
|
+
roles = [DEFAULT_SHARE_ROLE],
|
|
2369
|
+
initialRole = DEFAULT_SHARE_ROLE,
|
|
2370
|
+
onCreated,
|
|
2371
|
+
onRevoked,
|
|
2372
|
+
}: {
|
|
2373
|
+
projectId: string
|
|
2374
|
+
canManage?: boolean
|
|
2375
|
+
canCreate?: boolean
|
|
2376
|
+
canRevoke?: boolean
|
|
2377
|
+
roles?: readonly ShareRole[]
|
|
2378
|
+
initialRole?: ShareRole
|
|
2379
|
+
onCreated?: (result: ShareLinkResult) => void
|
|
2380
|
+
onRevoked?: (id: string) => void
|
|
2381
|
+
}): JSX.Element
|
|
2382
|
+
```
|
|
2383
|
+
|
|
2384
|
+
- `props` — Component props.
|
|
2385
|
+
|
|
2386
|
+
**Returns:** The rendered manager.
|
|
2387
|
+
|
|
2332
2388
|
#### `ShareModal(props)`
|
|
2333
2389
|
|
|
2334
2390
|
The share-link modal opened by `/share`, `/share <role>`, and the header
|
|
@@ -19,6 +19,7 @@ import type { JSX } from 'react';
|
|
|
19
19
|
import type { ChatMessage } from '@molecule/app-ai-chat';
|
|
20
20
|
import type { ChatPanelProps, IdeClientAction } from '../types.js';
|
|
21
21
|
import type { Activity } from './activity-utilities.js';
|
|
22
|
+
import { type CommandDef } from './chat-commands.js';
|
|
22
23
|
import type { ModelMode } from './chat-model-mode-utilities.js';
|
|
23
24
|
interface CommitCard {
|
|
24
25
|
id: string;
|
|
@@ -140,6 +141,8 @@ export interface ChatInnerProps {
|
|
|
140
141
|
openSettingsSignal?: number;
|
|
141
142
|
/** Shows a "manage your own models" row in the `/model` picker — see {@link ChatPanelProps.onManageCustomModels}. */
|
|
142
143
|
onManageCustomModels?: () => void;
|
|
144
|
+
/** Bump to re-read persisted model/settings — see {@link ChatPanelProps.modelSelectionSignal}. */
|
|
145
|
+
modelSelectionSignal?: number;
|
|
143
146
|
/** Changing this value opens the `/report` bug-report modal (used by the header bug button). */
|
|
144
147
|
openReportSignal?: number;
|
|
145
148
|
/** Changing this value opens the `/share` link modal (used by the header share button). */
|
|
@@ -166,6 +169,8 @@ export interface ChatInnerProps {
|
|
|
166
169
|
productName?: string;
|
|
167
170
|
/** Host app/build version for /version — see {@link ChatPanelProps.version}. */
|
|
168
171
|
version?: string;
|
|
172
|
+
/** Host-specific slash commands merged into the menu — see {@link ChatPanelProps.extraCommands}. */
|
|
173
|
+
extraCommands?: readonly CommandDef[];
|
|
169
174
|
/** Command-menu "Report a problem" URL — see {@link ChatPanelProps.feedbackUrl}. */
|
|
170
175
|
feedbackUrl?: string;
|
|
171
176
|
}
|
|
@@ -174,7 +179,7 @@ export interface ChatInnerProps {
|
|
|
174
179
|
* @param props - Component props (see {@link MessageItemProps}).
|
|
175
180
|
* @returns The rendered chat panel element.
|
|
176
181
|
*/
|
|
177
|
-
export declare function ChatPanel({ projectId, endpoint, initialMessage, onInitialMessageSent, activeFile, openTabs, onFileOpen, onFileDoubleClick, onFileDiff, onFileRevert, onFileChange, onFileDeleted, onCommit, onActivityClick, onRenderError, onProfileClick, onReadyToBuild, awaitingSandboxBoot, onClientAction, onTurnComplete, onLoadingChange, onNavigatePreview, onRegisterPushHandler, autoSubmitSignal, initialInputValue, hideConversationMenu, renderConversationHeader, conversationId: controlledConversationId, chatKey: controlledChatKey, onConversationId: controlledOnConversationId, openShareSignal: controlledShareSignal, openReportSignal: controlledReportSignal, openSettingsSignal: controlledSettingsSignal, onManageCustomModels, gitStatusTick, pendingMessage, pendingMessageKey, pendingMessageSuppressUser, pendingMessageUserInitiated, userEditedFile, userEditedFileKey, isPro, isAnonymous, buildUpgradeCta, buildHelpUpgradeSection, userAvatar, agentName, productName, version, feedbackUrl, className, }: ChatPanelProps): JSX.Element;
|
|
182
|
+
export declare function ChatPanel({ projectId, endpoint, initialMessage, onInitialMessageSent, activeFile, openTabs, onFileOpen, onFileDoubleClick, onFileDiff, onFileRevert, onFileChange, onFileDeleted, onCommit, onActivityClick, onRenderError, onProfileClick, onReadyToBuild, awaitingSandboxBoot, onClientAction, onTurnComplete, onLoadingChange, onNavigatePreview, onRegisterPushHandler, autoSubmitSignal, initialInputValue, hideConversationMenu, renderConversationHeader, conversationId: controlledConversationId, chatKey: controlledChatKey, onConversationId: controlledOnConversationId, openShareSignal: controlledShareSignal, openReportSignal: controlledReportSignal, openSettingsSignal: controlledSettingsSignal, onManageCustomModels, gitStatusTick, pendingMessage, pendingMessageKey, pendingMessageSuppressUser, pendingMessageUserInitiated, userEditedFile, userEditedFileKey, isPro, isAnonymous, buildUpgradeCta, buildHelpUpgradeSection, userAvatar, agentName, productName, version, extraCommands, feedbackUrl, className, }: ChatPanelProps): JSX.Element;
|
|
178
183
|
export declare namespace ChatPanel {
|
|
179
184
|
var displayName: string;
|
|
180
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAY3C,OAAO,KAAK,EAAa,WAAW,EAAmB,MAAM,uBAAuB,CAAA;AAuCpF,OAAO,KAAK,EAAE,cAAc,EAAoB,eAAe,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"ChatPanel.d.ts","sourceRoot":"","sources":["../../src/components/ChatPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,OAAO,CAAA;AAY3C,OAAO,KAAK,EAAa,WAAW,EAAmB,MAAM,uBAAuB,CAAA;AAuCpF,OAAO,KAAK,EAAE,cAAc,EAAoB,eAAe,EAAE,MAAM,aAAa,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAevD,OAAO,EAAsB,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAWlF,OAAO,KAAK,EAAsB,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAsLnF,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAA;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAuND,UAAU,WAAW;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAm9BD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD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OAAO,EAAE,iBAAiB,EAC1B,gBAAgB,EAAE,0BAA0B,EAC5C,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,sBAAsB,EACxC,kBAAkB,EAAE,wBAAwB,EAC5C,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,SAAS,EACT,WAAW,EACX,OAAO,EACP,aAAa,EACb,WAAW,EACX,SAAS,GACV,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA8b9B;yBAnfe,SAAS"}
|
|
@@ -1152,7 +1152,7 @@ const MessageItem = memo(function MessageItem(props) {
|
|
|
1152
1152
|
* @param props - Component props (see {@link MessageItemProps}).
|
|
1153
1153
|
* @returns The rendered chat inner component.
|
|
1154
1154
|
*/
|
|
1155
|
-
function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent, isPro, isAnonymous, buildUpgradeCta, buildHelpUpgradeSection, activeFile, openTabs, onFileOpen, onFileDoubleClick, onFileDiff, onFileRevert, onFileChange, onFileDeleted, onCommit, onConversationId, onActivityClick, onRenderError, onProfileClick, onReadyToBuild, awaitingSandboxBoot, onClientAction, onTurnComplete, onLoadingChange, onNavigatePreview, onRegisterPushHandler, autoSubmitSignal, openSettingsSignal, onManageCustomModels, openReportSignal, openShareSignal, initialInputValue, pendingMessage, pendingMessageKey, pendingMessageSuppressUser, pendingMessageUserInitiated, userEditedFile, userEditedFileKey, gitStatusTick: externalGitStatusTick, discovery, userAvatar, agentName = DEFAULT_AGENT_NAME, productName = DEFAULT_PRODUCT_NAME, version,
|
|
1155
|
+
function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent, isPro, isAnonymous, buildUpgradeCta, buildHelpUpgradeSection, activeFile, openTabs, onFileOpen, onFileDoubleClick, onFileDiff, onFileRevert, onFileChange, onFileDeleted, onCommit, onConversationId, onActivityClick, onRenderError, onProfileClick, onReadyToBuild, awaitingSandboxBoot, onClientAction, onTurnComplete, onLoadingChange, onNavigatePreview, onRegisterPushHandler, autoSubmitSignal, openSettingsSignal, onManageCustomModels, modelSelectionSignal, openReportSignal, openShareSignal, initialInputValue, pendingMessage, pendingMessageKey, pendingMessageSuppressUser, pendingMessageUserInitiated, userEditedFile, userEditedFileKey, gitStatusTick: externalGitStatusTick, discovery, userAvatar, agentName = DEFAULT_AGENT_NAME, productName = DEFAULT_PRODUCT_NAME, version, extraCommands,
|
|
1156
1156
|
// feedbackUrl: prop kept for back-compat (callers still pass it), but no longer
|
|
1157
1157
|
// consumed here — its only use was the command-menu footer link removed in P3-21.
|
|
1158
1158
|
}) {
|
|
@@ -2521,6 +2521,31 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
2521
2521
|
setAutoCommitLoaded(true);
|
|
2522
2522
|
});
|
|
2523
2523
|
}, [http, projectId]);
|
|
2524
|
+
// Re-read ONLY the persisted model fields when the host signals a model change
|
|
2525
|
+
// (the provider modal's "Use" button sets chatModel server-side). Targeted so
|
|
2526
|
+
// a model pick never re-hydrates the rest of the settings (auto-commit,
|
|
2527
|
+
// skills, effort). Skips the initial 0 value — mount already read them.
|
|
2528
|
+
useEffect(() => {
|
|
2529
|
+
if (!modelSelectionSignal)
|
|
2530
|
+
return;
|
|
2531
|
+
http
|
|
2532
|
+
.get(`/projects/${projectId}`)
|
|
2533
|
+
.then((res) => {
|
|
2534
|
+
const s = res.data.settings;
|
|
2535
|
+
if (typeof s?.chatModel === 'string') {
|
|
2536
|
+
setCurrentModel(s.chatModel);
|
|
2537
|
+
setSavedChatModel(s.chatModel);
|
|
2538
|
+
}
|
|
2539
|
+
if (typeof s?.planModel === 'string')
|
|
2540
|
+
setPlanModel(s.planModel);
|
|
2541
|
+
if (typeof s?.executeModel === 'string')
|
|
2542
|
+
setExecuteModel(s.executeModel);
|
|
2543
|
+
})
|
|
2544
|
+
.catch(() => {
|
|
2545
|
+
// Non-fatal: the model was persisted server-side; the picker indicator
|
|
2546
|
+
// just won't refresh until the next full settings read.
|
|
2547
|
+
});
|
|
2548
|
+
}, [modelSelectionSignal, http, projectId]);
|
|
2524
2549
|
// Persist the auto-commit cadence to project.settings (debounced) so it
|
|
2525
2550
|
// survives a reload/reconnect like every other setting. The reducer is the
|
|
2526
2551
|
// live source of truth; this mirrors intervalSeconds (0 = off) back to the
|
|
@@ -3411,6 +3436,12 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
3411
3436
|
logger.warn('Failed to update model processing region', { error });
|
|
3412
3437
|
}
|
|
3413
3438
|
}, [http, projectId, modelRegions]);
|
|
3439
|
+
// The shared command registry UNION any host-provided commands (e.g.
|
|
3440
|
+
// molecule.dev's /deploy, /push, /invite, /teamsay), so the menu, grouping,
|
|
3441
|
+
// and dispatch all see one list and host commands never go missing. Declared
|
|
3442
|
+
// before executeCommand since it lives in that callback's dependency list.
|
|
3443
|
+
const allCommands = useMemo(() => (extraCommands?.length ? [...COMMANDS, ...extraCommands] : COMMANDS), [extraCommands]);
|
|
3444
|
+
const extraCommandIds = useMemo(() => new Set((extraCommands ?? []).map((c) => c.id)), [extraCommands]);
|
|
3414
3445
|
const executeCommand = useCallback(async (id) => {
|
|
3415
3446
|
setCommandMenu(null);
|
|
3416
3447
|
// Any command closes every sibling popup (panel overlay, model/sounds/mic
|
|
@@ -3420,6 +3451,14 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
3420
3451
|
setModelPicker(null);
|
|
3421
3452
|
setSoundsPicker(null);
|
|
3422
3453
|
setMicPicker(null);
|
|
3454
|
+
// Host-provided commands (e.g. molecule.dev's /deploy, /push, /invite,
|
|
3455
|
+
// /teamsay) have no client-side branch here — fill the input with the
|
|
3456
|
+
// command so the user can add any arguments, then Enter sends it to the
|
|
3457
|
+
// host's own handler (a server intercept, or the agent for /push).
|
|
3458
|
+
if (extraCommandIds.has(id)) {
|
|
3459
|
+
setInputAndCursorEnd(`/${id} `);
|
|
3460
|
+
return;
|
|
3461
|
+
}
|
|
3423
3462
|
if (id === 'clear') {
|
|
3424
3463
|
setInputValue('');
|
|
3425
3464
|
await clearHistory();
|
|
@@ -3764,6 +3803,7 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
3764
3803
|
sendMessage,
|
|
3765
3804
|
refreshGitStatus,
|
|
3766
3805
|
openPanelOverlay,
|
|
3806
|
+
extraCommandIds,
|
|
3767
3807
|
]);
|
|
3768
3808
|
// When the auto-commit countdown reaches zero, fire the existing /commit path
|
|
3769
3809
|
// (no new backend) and pause until the next file change re-arms it. /commit
|
|
@@ -4204,7 +4244,7 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
4204
4244
|
}, [openShareSignal]);
|
|
4205
4245
|
// ── Keyboard ───────────────────────────────────────────────────────────────
|
|
4206
4246
|
const filteredCmds = commandMenu
|
|
4207
|
-
?
|
|
4247
|
+
? allCommands.filter((c) => c.label.startsWith(inputRef.current))
|
|
4208
4248
|
: [];
|
|
4209
4249
|
const filteredModels = useMemo(() => {
|
|
4210
4250
|
if (!modelPicker)
|
|
@@ -4582,9 +4622,11 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
4582
4622
|
case 'model': {
|
|
4583
4623
|
const label = cardEvent.label || cardEvent.model;
|
|
4584
4624
|
// Append the model's effective processing-region code — catalog
|
|
4585
|
-
// models only
|
|
4625
|
+
// models only. A custom/BYO endpoint has no meaningful region: its
|
|
4626
|
+
// catalog `regions` defaults to ['us'] as a placeholder, not a real
|
|
4627
|
+
// re-host choice, so never surface a region for it.
|
|
4586
4628
|
const def = AVAILABLE_MODELS.find((m) => m.id === cardEvent.model);
|
|
4587
|
-
const regionCode = def ? effectiveModelRegion(def).toUpperCase() : null;
|
|
4629
|
+
const regionCode = def && def.provider !== 'custom' ? effectiveModelRegion(def).toUpperCase() : null;
|
|
4588
4630
|
return {
|
|
4589
4631
|
id,
|
|
4590
4632
|
text: regionCode
|
|
@@ -6667,7 +6709,7 @@ function ChatInner({ projectId, endpoint, initialMessage, onInitialMessageSent,
|
|
|
6667
6709
|
* @param props - Component props (see {@link MessageItemProps}).
|
|
6668
6710
|
* @returns The rendered chat panel element.
|
|
6669
6711
|
*/
|
|
6670
|
-
export function ChatPanel({ projectId, endpoint, initialMessage, onInitialMessageSent, activeFile, openTabs, onFileOpen, onFileDoubleClick, onFileDiff, onFileRevert, onFileChange, onFileDeleted, onCommit, onActivityClick, onRenderError, onProfileClick, onReadyToBuild, awaitingSandboxBoot, onClientAction, onTurnComplete, onLoadingChange, onNavigatePreview, onRegisterPushHandler, autoSubmitSignal, initialInputValue, hideConversationMenu, renderConversationHeader = true, conversationId: controlledConversationId, chatKey: controlledChatKey, onConversationId: controlledOnConversationId, openShareSignal: controlledShareSignal, openReportSignal: controlledReportSignal, openSettingsSignal: controlledSettingsSignal, onManageCustomModels, gitStatusTick, pendingMessage, pendingMessageKey, pendingMessageSuppressUser, pendingMessageUserInitiated, userEditedFile, userEditedFileKey, isPro, isAnonymous, buildUpgradeCta, buildHelpUpgradeSection, userAvatar, agentName, productName, version, feedbackUrl, className, }) {
|
|
6712
|
+
export function ChatPanel({ projectId, endpoint, initialMessage, onInitialMessageSent, activeFile, openTabs, onFileOpen, onFileDoubleClick, onFileDiff, onFileRevert, onFileChange, onFileDeleted, onCommit, onActivityClick, onRenderError, onProfileClick, onReadyToBuild, awaitingSandboxBoot, onClientAction, onTurnComplete, onLoadingChange, onNavigatePreview, onRegisterPushHandler, autoSubmitSignal, initialInputValue, hideConversationMenu, renderConversationHeader = true, conversationId: controlledConversationId, chatKey: controlledChatKey, onConversationId: controlledOnConversationId, openShareSignal: controlledShareSignal, openReportSignal: controlledReportSignal, openSettingsSignal: controlledSettingsSignal, onManageCustomModels, gitStatusTick, pendingMessage, pendingMessageKey, pendingMessageSuppressUser, pendingMessageUserInitiated, userEditedFile, userEditedFileKey, isPro, isAnonymous, buildUpgradeCta, buildHelpUpgradeSection, userAvatar, agentName, productName, version, extraCommands, feedbackUrl, className, }) {
|
|
6671
6713
|
const cm = getClassMap();
|
|
6672
6714
|
const isNarrow = useNarrowViewport();
|
|
6673
6715
|
const isCoarse = useCoarsePointer();
|
|
@@ -6876,7 +6918,7 @@ export function ChatPanel({ projectId, endpoint, initialMessage, onInitialMessag
|
|
|
6876
6918
|
textOverflow: 'ellipsis',
|
|
6877
6919
|
whiteSpace: 'nowrap',
|
|
6878
6920
|
width: '100%',
|
|
6879
|
-
}, children: conv.preview ?? 'New conversation' }), _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { opacity: 0.55 }, children: relativeTime(conv.updatedAt) })] }, conv.id)))] }))] })), _jsx(ChatInner, { projectId: projectId, endpoint: chatEndpoint, initialMessage: initialMessage, onInitialMessageSent: onInitialMessageSent, isPro: isPro, isAnonymous: isAnonymous, buildUpgradeCta: buildUpgradeCta, buildHelpUpgradeSection: buildHelpUpgradeSection, activeFile: activeFile, openTabs: openTabs, onFileOpen: onFileOpen, onFileDoubleClick: onFileDoubleClick, onFileDiff: onFileDiff, onFileRevert: onFileRevert, onFileChange: onFileChange, onFileDeleted: onFileDeleted, onCommit: onCommit, onConversationId: reportConversationId, onActivityClick: onActivityClick, onRenderError: onRenderError, onProfileClick: onProfileClick, onReadyToBuild: onReadyToBuild, awaitingSandboxBoot: awaitingSandboxBoot, onClientAction: onClientAction, onTurnComplete: onTurnComplete, onLoadingChange: onLoadingChange, onNavigatePreview: onNavigatePreview, onRegisterPushHandler: onRegisterPushHandler, autoSubmitSignal: autoSubmitSignal, openSettingsSignal: effectiveSettingsSignal, onManageCustomModels: onManageCustomModels, openReportSignal: effectiveReportSignal, openShareSignal: effectiveShareSignal, initialInputValue: initialInputValue, pendingMessage: pendingMessage, pendingMessageKey: pendingMessageKey, pendingMessageSuppressUser: pendingMessageSuppressUser, pendingMessageUserInitiated: pendingMessageUserInitiated, userEditedFile: userEditedFile, userEditedFileKey: userEditedFileKey, gitStatusTick: gitStatusTick, discovery: hideConversationMenu, userAvatar: userAvatar, agentName: agentName, productName: productName, version: version, feedbackUrl: feedbackUrl }, chatKey)] }));
|
|
6921
|
+
}, children: conv.preview ?? 'New conversation' }), _jsx("span", { className: cm.cn(cm.textMuted, cm.textSize('xs')), style: { opacity: 0.55 }, children: relativeTime(conv.updatedAt) })] }, conv.id)))] }))] })), _jsx(ChatInner, { projectId: projectId, endpoint: chatEndpoint, initialMessage: initialMessage, onInitialMessageSent: onInitialMessageSent, isPro: isPro, isAnonymous: isAnonymous, buildUpgradeCta: buildUpgradeCta, buildHelpUpgradeSection: buildHelpUpgradeSection, activeFile: activeFile, openTabs: openTabs, onFileOpen: onFileOpen, onFileDoubleClick: onFileDoubleClick, onFileDiff: onFileDiff, onFileRevert: onFileRevert, onFileChange: onFileChange, onFileDeleted: onFileDeleted, onCommit: onCommit, onConversationId: reportConversationId, onActivityClick: onActivityClick, onRenderError: onRenderError, onProfileClick: onProfileClick, onReadyToBuild: onReadyToBuild, awaitingSandboxBoot: awaitingSandboxBoot, onClientAction: onClientAction, onTurnComplete: onTurnComplete, onLoadingChange: onLoadingChange, onNavigatePreview: onNavigatePreview, onRegisterPushHandler: onRegisterPushHandler, autoSubmitSignal: autoSubmitSignal, openSettingsSignal: effectiveSettingsSignal, onManageCustomModels: onManageCustomModels, openReportSignal: effectiveReportSignal, openShareSignal: effectiveShareSignal, initialInputValue: initialInputValue, pendingMessage: pendingMessage, pendingMessageKey: pendingMessageKey, pendingMessageSuppressUser: pendingMessageSuppressUser, pendingMessageUserInitiated: pendingMessageUserInitiated, userEditedFile: userEditedFile, userEditedFileKey: userEditedFileKey, gitStatusTick: gitStatusTick, discovery: hideConversationMenu, userAvatar: userAvatar, agentName: agentName, productName: productName, version: version, extraCommands: extraCommands, feedbackUrl: feedbackUrl }, chatKey)] }));
|
|
6880
6922
|
}
|
|
6881
6923
|
ChatPanel.displayName = 'ChatPanel';
|
|
6882
6924
|
//# sourceMappingURL=ChatPanel.js.map
|