@hachej/boring-agent 0.1.100 → 0.1.103
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/dist/{DebugDrawer-2TO5SE2D.js → DebugDrawer-JNA43SVR.js} +2 -1
- package/dist/chunk-2BGLZZ7T.js +10 -0
- package/dist/{chunk-46HJK2ES.js → chunk-4XOW57KJ.js} +3 -8
- package/dist/{chunk-ZOHN72OS.js → chunk-6WKQ4FC4.js} +127 -138
- package/dist/{chunk-LSO2AO6Q.js → chunk-7QM22DU7.js} +1 -3
- package/dist/{chunk-3OEDBRKY.js → chunk-JNEKOVMJ.js} +1 -1
- package/dist/{chunk-VXF5DWS6.js → chunk-K25PK5EC.js} +1 -0
- package/dist/chunk-N6THTH7P.js +110 -0
- package/dist/{chunk-GRMDMWBW.js → chunk-TW7G33QH.js} +23 -40
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +1 -1
- package/dist/{createHarness-5TEXLUYX.js → createHarness-4Q6DQBRT.js} +2 -2
- package/dist/{errors-cNC4HMpV.d.ts → errors-szpcDUFQ.d.ts} +3 -4
- package/dist/{file-search-QxnanNjO.d.ts → file-search-BXdSm-Yq.d.ts} +5 -5
- package/dist/front/artifacts.d.ts +34 -0
- package/dist/front/artifacts.js +21 -0
- package/dist/front/index.d.ts +6 -20
- package/dist/front/index.js +604 -710
- package/dist/{harness-DS8jLKIx.d.ts → harness-erpL2SER.d.ts} +2 -2
- package/dist/{lease-D8WC6pQl.d.ts → lease-K-EZhdL-.d.ts} +3 -3
- package/dist/{middleware-Cq_cYHjJ.d.ts → middleware-CaAEXpi5.d.ts} +11 -2
- package/dist/{piChatEvent-B3ehh9V0.d.ts → piChatEvent-g1nIBh44.d.ts} +14 -16
- package/dist/{piChatSessionService-xnv8rcdh.d.ts → piChatSessionService-DugeRHzb.d.ts} +1 -3
- package/dist/{sandbox-KQiEdz4W.d.ts → sandbox-BMhut3kh.d.ts} +6 -1
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +6 -6
- package/dist/server/agent-host/testing/gatewayConformance.js +3 -4
- package/dist/server/index.d.ts +24 -35
- package/dist/server/index.js +7 -5
- package/dist/server/worker/index.d.ts +3 -2
- package/dist/server/worker/index.js +25 -6
- package/dist/shared/index.d.ts +29 -29
- package/dist/shared/index.js +3 -3
- package/dist/{types-BPzq-RwN.d.ts → types-BnjMLAd5.d.ts} +14 -6
- package/docs/AGENT_GATEWAY_V0.md +3 -4
- package/docs/ERROR_CODES.md +1 -0
- package/package.json +16 -12
package/dist/front/index.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Artifact,
|
|
3
|
+
ArtifactAction,
|
|
4
|
+
ArtifactActions,
|
|
5
|
+
ArtifactDescription,
|
|
6
|
+
ArtifactHeader,
|
|
7
|
+
ArtifactOpenProvider,
|
|
8
|
+
ArtifactTitle,
|
|
9
|
+
useOpenArtifact
|
|
10
|
+
} from "../chunk-N6THTH7P.js";
|
|
1
11
|
import {
|
|
2
12
|
DebugDrawer,
|
|
3
13
|
agentResourceUrl,
|
|
4
|
-
cn,
|
|
5
14
|
copyTextToClipboard,
|
|
6
15
|
createRequestId,
|
|
7
16
|
withStorageScope
|
|
8
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-4XOW57KJ.js";
|
|
18
|
+
import {
|
|
19
|
+
cn
|
|
20
|
+
} from "../chunk-2BGLZZ7T.js";
|
|
9
21
|
import {
|
|
10
22
|
AGENT_GATEWAY_ERROR_CODES,
|
|
11
|
-
AgentGatewayErrorCode,
|
|
12
23
|
CommandReceiptSchema,
|
|
13
24
|
FollowUpReceiptSchema,
|
|
14
25
|
PiChatSnapshotSchema,
|
|
@@ -20,11 +31,11 @@ import {
|
|
|
20
31
|
WORKSPACE_COMMAND_NOTIFY_EVENT,
|
|
21
32
|
extractToolUiMetadata,
|
|
22
33
|
sanitizeToolUiMetadata
|
|
23
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-7QM22DU7.js";
|
|
24
35
|
import "../chunk-YGRQ4Q5P.js";
|
|
25
36
|
import {
|
|
26
37
|
ErrorCode
|
|
27
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-K25PK5EC.js";
|
|
28
39
|
|
|
29
40
|
// src/front/upload/uploadFile.ts
|
|
30
41
|
function readAsDataUrl(file) {
|
|
@@ -75,19 +86,6 @@ function rawWorkspaceFileUrl(path, opts) {
|
|
|
75
86
|
|
|
76
87
|
// src/front/chat/PiChatPanel.tsx
|
|
77
88
|
import { lazy, Suspense, useCallback as useCallback18, useEffect as useEffect21, useMemo as useMemo16, useRef as useRef18, useState as useState20 } from "react";
|
|
78
|
-
import { Button as Button12 } from "@hachej/boring-ui-kit";
|
|
79
|
-
|
|
80
|
-
// src/front/ArtifactOpenContext.tsx
|
|
81
|
-
import { createContext, useContext } from "react";
|
|
82
|
-
import { jsx } from "react/jsx-runtime";
|
|
83
|
-
var ArtifactOpenContext = createContext(null);
|
|
84
|
-
function ArtifactOpenProvider({ onOpenArtifact, children }) {
|
|
85
|
-
const inheritedOpenArtifact = useContext(ArtifactOpenContext);
|
|
86
|
-
return /* @__PURE__ */ jsx(ArtifactOpenContext.Provider, { value: onOpenArtifact ?? inheritedOpenArtifact, children });
|
|
87
|
-
}
|
|
88
|
-
function useOpenArtifact() {
|
|
89
|
-
return useContext(ArtifactOpenContext);
|
|
90
|
-
}
|
|
91
89
|
|
|
92
90
|
// src/front/chatPanelSettings.ts
|
|
93
91
|
var DEFAULT_THINKING = "medium";
|
|
@@ -120,7 +118,7 @@ function encodeModelKey(sel) {
|
|
|
120
118
|
// src/front/ChatEmptyState.tsx
|
|
121
119
|
import { ArrowUpRight, BookOpen, Code2, FileSearch, Wand2 } from "lucide-react";
|
|
122
120
|
import { Button } from "@hachej/boring-ui-kit";
|
|
123
|
-
import { jsx
|
|
121
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
124
122
|
var defaultChatSuggestions = [
|
|
125
123
|
{
|
|
126
124
|
label: "Summarize the README",
|
|
@@ -149,7 +147,7 @@ var defaultChatSuggestions = [
|
|
|
149
147
|
];
|
|
150
148
|
function ChatSuggestionGrid({ suggestions, onSelect, className }) {
|
|
151
149
|
if (suggestions.length === 0) return null;
|
|
152
|
-
return /* @__PURE__ */
|
|
150
|
+
return /* @__PURE__ */ jsx(
|
|
153
151
|
"div",
|
|
154
152
|
{
|
|
155
153
|
"data-boring-agent-part": "suggestion-grid",
|
|
@@ -178,7 +176,7 @@ function ChatSuggestionGrid({ suggestions, onSelect, className }) {
|
|
|
178
176
|
},
|
|
179
177
|
className: "group h-auto justify-start gap-3 rounded-none bg-background px-4 py-3.5 text-left hover:bg-[color:var(--chat-empty-card-hover)] focus-visible:bg-[color:var(--chat-empty-card-hover)]",
|
|
180
178
|
children: [
|
|
181
|
-
Icon && /* @__PURE__ */
|
|
179
|
+
Icon && /* @__PURE__ */ jsx(
|
|
182
180
|
Icon,
|
|
183
181
|
{
|
|
184
182
|
className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground transition-colors group-hover:text-[color:var(--chat-empty-accent)]",
|
|
@@ -186,10 +184,10 @@ function ChatSuggestionGrid({ suggestions, onSelect, className }) {
|
|
|
186
184
|
}
|
|
187
185
|
),
|
|
188
186
|
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
suggestion.hint && /* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-foreground", children: suggestion.label }),
|
|
188
|
+
suggestion.hint && /* @__PURE__ */ jsx("span", { className: "text-[12px] text-muted-foreground", children: suggestion.hint })
|
|
191
189
|
] }),
|
|
192
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ jsx(
|
|
193
191
|
ArrowUpRight,
|
|
194
192
|
{
|
|
195
193
|
className: cn(
|
|
@@ -237,15 +235,15 @@ function ChatEmptyState({
|
|
|
237
235
|
),
|
|
238
236
|
children: [
|
|
239
237
|
!hero && eyebrow && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-[10.5px] font-medium uppercase tracking-[0.16em] text-[color:var(--chat-empty-eyebrow-color)]", children: [
|
|
240
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ jsx("span", { className: "inline-block h-px w-4 bg-[color:var(--chat-empty-accent)]", "aria-hidden": "true" }),
|
|
241
239
|
eyebrow
|
|
242
240
|
] }),
|
|
243
|
-
title && /* @__PURE__ */
|
|
241
|
+
title && /* @__PURE__ */ jsx("h3", { className: cn(
|
|
244
242
|
"text-[24px] font-medium leading-[1.05] tracking-[-0.02em] text-[color:var(--chat-empty-title-color)] @[480px]:text-[34px]",
|
|
245
243
|
hero ? "m-0" : "mt-3"
|
|
246
244
|
), children: title }),
|
|
247
|
-
!hero && description && /* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
245
|
+
!hero && description && /* @__PURE__ */ jsx("p", { className: "mt-3 hidden max-w-[440px] text-[14px] leading-relaxed text-[color:var(--chat-empty-description-color)] @[420px]:block", children: description }),
|
|
246
|
+
/* @__PURE__ */ jsx(ChatSuggestionGrid, { suggestions, onSelect, className: hero ? "mt-4" : "mt-8" }),
|
|
249
247
|
footer
|
|
250
248
|
]
|
|
251
249
|
}
|
|
@@ -347,7 +345,7 @@ var builtinCommands = [
|
|
|
347
345
|
import { useState } from "react";
|
|
348
346
|
import { createPatch } from "diff";
|
|
349
347
|
import { Button as Button2 } from "@hachej/boring-ui-kit";
|
|
350
|
-
import { jsx as
|
|
348
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
351
349
|
var COLLAPSE_THRESHOLD = 30;
|
|
352
350
|
function parsePatch(patch) {
|
|
353
351
|
const lines = patch.split("\n");
|
|
@@ -372,7 +370,7 @@ var prefixMap = { "+": "+", "-": "-", " ": " " };
|
|
|
372
370
|
function DiffView({ oldString, newString, path, replaceAll, actions }) {
|
|
373
371
|
const [expanded, setExpanded] = useState(false);
|
|
374
372
|
if (oldString === newString) {
|
|
375
|
-
return /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ jsx2("div", { "data-testid": "diff-no-change", className: "py-2 italic opacity-60", children: "No changes" });
|
|
376
374
|
}
|
|
377
375
|
const patch = createPatch(path, oldString, newString, "", "", { context: 3 });
|
|
378
376
|
const lines = parsePatch(patch);
|
|
@@ -384,10 +382,10 @@ function DiffView({ oldString, newString, path, replaceAll, actions }) {
|
|
|
384
382
|
path,
|
|
385
383
|
replaceAll ? " (replace all)" : ""
|
|
386
384
|
] }),
|
|
387
|
-
actions ? /* @__PURE__ */
|
|
385
|
+
actions ? /* @__PURE__ */ jsx2("span", { className: "flex shrink-0 items-center gap-0.5", children: actions }) : null
|
|
388
386
|
] }),
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ jsx2("pre", { className: "m-0 overflow-auto py-2 font-[family-name:var(--boring-agent-font-mono,monospace)] text-[0.8125rem] leading-relaxed", children: visible.map((line, i) => /* @__PURE__ */ jsxs2("div", { className: cn("px-3", lineClass[line.type]), children: [
|
|
388
|
+
/* @__PURE__ */ jsx2("span", { className: "inline-block w-[1.5ch] select-none opacity-50", children: prefixMap[line.type] }),
|
|
391
389
|
line.text
|
|
392
390
|
] }, i)) }),
|
|
393
391
|
collapsed && /* @__PURE__ */ jsxs2(Button2, { type: "button", variant: "ghost", size: "sm", onClick: () => setExpanded(true), className: "w-full rounded-none text-xs opacity-60", children: [
|
|
@@ -401,7 +399,7 @@ function DiffView({ oldString, newString, path, replaceAll, actions }) {
|
|
|
401
399
|
// src/front/barePrimitives/Tool.tsx
|
|
402
400
|
import { useEffect, useRef, useState as useState2 } from "react";
|
|
403
401
|
import { Button as Button3 } from "@hachej/boring-ui-kit";
|
|
404
|
-
import { Fragment, jsx as
|
|
402
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
405
403
|
function stateLabel(state) {
|
|
406
404
|
switch (state) {
|
|
407
405
|
case "input-streaming":
|
|
@@ -422,7 +420,7 @@ function stateLabel(state) {
|
|
|
422
420
|
}
|
|
423
421
|
}
|
|
424
422
|
function ToolValue({ value }) {
|
|
425
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ jsx3("pre", { className: "m-0 whitespace-pre-wrap text-[0.8125rem]", children: typeof value === "string" ? value : JSON.stringify(value, null, 2) });
|
|
426
424
|
}
|
|
427
425
|
function Tool({
|
|
428
426
|
toolName,
|
|
@@ -470,17 +468,17 @@ function Tool({
|
|
|
470
468
|
className: "h-auto w-full justify-start gap-2 rounded-none bg-[var(--boring-agent-tool-header-bg,#f9fafb)] px-3 py-2 text-left font-[family-name:var(--boring-agent-font-mono,monospace)] text-[0.8125rem]",
|
|
471
469
|
"aria-expanded": expanded,
|
|
472
470
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
!isComplete && /* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsx3("span", { className: cn("transition-transform duration-150", expanded && "rotate-90"), children: "\u25B6" }),
|
|
472
|
+
/* @__PURE__ */ jsx3("span", { className: "font-medium", children: toolName }),
|
|
473
|
+
/* @__PURE__ */ jsx3("span", { className: "ml-auto text-xs opacity-60", children: isRunning && elapsedSec >= 1 ? `Running\u2026 (${elapsedSec}s)` : stateLabel(state) }),
|
|
474
|
+
!isComplete && /* @__PURE__ */ jsx3("span", { className: "size-2 rounded-full bg-[var(--boring-agent-tool-running,#3b82f6)]", "aria-label": "running" })
|
|
477
475
|
]
|
|
478
476
|
}
|
|
479
477
|
),
|
|
480
|
-
expanded && /* @__PURE__ */
|
|
481
|
-
input !== void 0 && /* @__PURE__ */
|
|
482
|
-
output !== void 0 && /* @__PURE__ */
|
|
483
|
-
errorText && /* @__PURE__ */
|
|
478
|
+
expanded && /* @__PURE__ */ jsx3("div", { className: "border-t border-[var(--boring-agent-tool-border,#e5e7eb)] px-3 py-2", children: children ?? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
479
|
+
input !== void 0 && /* @__PURE__ */ jsx3("div", { "data-testid": "tool-input", children: renderInput ? renderInput(input) : /* @__PURE__ */ jsx3(ToolValue, { value: input }) }),
|
|
480
|
+
output !== void 0 && /* @__PURE__ */ jsx3("div", { "data-testid": "tool-output", className: "mt-2", children: renderOutput ? renderOutput(output) : /* @__PURE__ */ jsx3(ToolValue, { value: output }) }),
|
|
481
|
+
errorText && /* @__PURE__ */ jsx3("div", { "data-testid": "tool-error", className: "mt-2 text-[var(--boring-agent-tool-error,#ef4444)]", children: errorText })
|
|
484
482
|
] }) })
|
|
485
483
|
]
|
|
486
484
|
}
|
|
@@ -488,7 +486,7 @@ function Tool({
|
|
|
488
486
|
}
|
|
489
487
|
|
|
490
488
|
// src/front/barePrimitives/Terminal.tsx
|
|
491
|
-
import { Fragment as Fragment2, jsx as
|
|
489
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
492
490
|
function Terminal({
|
|
493
491
|
children,
|
|
494
492
|
stdout,
|
|
@@ -505,10 +503,10 @@ function Terminal({
|
|
|
505
503
|
className
|
|
506
504
|
),
|
|
507
505
|
children: [
|
|
508
|
-
title && /* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
stdout && /* @__PURE__ */
|
|
511
|
-
stderr && /* @__PURE__ */
|
|
506
|
+
title && /* @__PURE__ */ jsx4("div", { className: "border-b border-[var(--boring-agent-terminal-border,#404040)] bg-[var(--boring-agent-terminal-header-bg,#2d2d2d)] px-3 py-1.5 text-xs opacity-80", children: title }),
|
|
507
|
+
/* @__PURE__ */ jsx4("div", { className: "p-3", children: children ?? /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
508
|
+
stdout && /* @__PURE__ */ jsx4("pre", { "data-stream": "stdout", className: "m-0 whitespace-pre-wrap", children: stdout }),
|
|
509
|
+
stderr && /* @__PURE__ */ jsx4(
|
|
512
510
|
"pre",
|
|
513
511
|
{
|
|
514
512
|
"data-stream": "stderr",
|
|
@@ -542,7 +540,7 @@ function Terminal({
|
|
|
542
540
|
// src/front/barePrimitives/CodeBlock.tsx
|
|
543
541
|
import { useCallback, useState as useState3 } from "react";
|
|
544
542
|
import { Button as Button4 } from "@hachej/boring-ui-kit";
|
|
545
|
-
import { jsx as
|
|
543
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
546
544
|
function CodeBlock({
|
|
547
545
|
code: code3,
|
|
548
546
|
language,
|
|
@@ -570,14 +568,14 @@ function CodeBlock({
|
|
|
570
568
|
),
|
|
571
569
|
children: [
|
|
572
570
|
(filename || language) && /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between border-b border-[var(--boring-agent-code-border,#404040)] bg-[var(--boring-agent-code-header-bg,#2d2d2d)] px-3 py-1.5 text-xs", children: [
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
copyable && /* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsx5("span", { className: "opacity-70", children: filename ?? language }),
|
|
572
|
+
copyable && /* @__PURE__ */ jsx5(Button4, { type: "button", variant: "ghost", size: "xs", onClick: handleCopy, "aria-label": "Copy code", className: "h-6 px-1.5 text-xs text-inherit opacity-60", children: copied ? "Copied" : "Copy" })
|
|
575
573
|
] }),
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ jsx5("pre", { className: "m-0 overflow-auto p-3", children: /* @__PURE__ */ jsx5("code", { "data-language": language, children: showLineNumbers ? lines.map((line, i) => /* @__PURE__ */ jsxs5("span", { className: "block", children: [
|
|
575
|
+
/* @__PURE__ */ jsx5("span", { className: "mr-4 inline-block select-none text-right opacity-40", style: { width: lineNumberWidth }, children: i + 1 }),
|
|
578
576
|
line
|
|
579
577
|
] }, i)) : code3 }) }),
|
|
580
|
-
copyable && !filename && !language && /* @__PURE__ */
|
|
578
|
+
copyable && !filename && !language && /* @__PURE__ */ jsx5(
|
|
581
579
|
Button4,
|
|
582
580
|
{
|
|
583
581
|
type: "button",
|
|
@@ -595,7 +593,7 @@ function CodeBlock({
|
|
|
595
593
|
}
|
|
596
594
|
|
|
597
595
|
// src/front/bareToolRenderers/renderers.tsx
|
|
598
|
-
import { jsx as
|
|
596
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
599
597
|
var FALLBACK_RENDERER_KEY = "__fallback";
|
|
600
598
|
function asRecord(v) {
|
|
601
599
|
return typeof v === "object" && v !== null ? v : {};
|
|
@@ -705,14 +703,14 @@ function renderBash(part) {
|
|
|
705
703
|
const stdout = typeof output.stdout === "string" ? output.stdout : output.content ? JSON.stringify(output.content) : void 0;
|
|
706
704
|
const stderr = typeof output.stderr === "string" ? output.stderr : void 0;
|
|
707
705
|
const exitCode = typeof output.exitCode === "number" ? output.exitCode : void 0;
|
|
708
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ jsx6(Tool, { toolName: "bash", toolCallId: part.toolCallId, state: part.state, errorText: part.errorText, defaultExpanded: true, children: /* @__PURE__ */ jsx6(Terminal, { title: `$ ${command}`, stdout, stderr, exitCode: exitCode ?? null }) });
|
|
709
707
|
}
|
|
710
708
|
function renderRead(part) {
|
|
711
709
|
const input = asRecord(part.input);
|
|
712
710
|
const output = asRecord(part.output);
|
|
713
711
|
const path = String(input.path ?? "");
|
|
714
712
|
const content = typeof output.text === "string" ? output.text : Array.isArray(output.content) ? output.content.map((c) => c.text ?? "").join("") : typeof output.content === "string" ? output.content : void 0;
|
|
715
|
-
return /* @__PURE__ */
|
|
713
|
+
return /* @__PURE__ */ jsx6(Tool, { toolName: "read", toolCallId: part.toolCallId, state: part.state, errorText: part.errorText, children: content != null ? /* @__PURE__ */ jsx6(CodeBlock, { code: content, language: langFromPath(path), filename: path }) : /* @__PURE__ */ jsxs6("span", { style: { opacity: 0.6 }, children: [
|
|
716
714
|
"Reading ",
|
|
717
715
|
path,
|
|
718
716
|
"\u2026"
|
|
@@ -722,11 +720,11 @@ function renderWrite(part) {
|
|
|
722
720
|
const input = asRecord(part.input);
|
|
723
721
|
const path = String(input.path ?? "");
|
|
724
722
|
const content = typeof input.content === "string" ? input.content : "";
|
|
725
|
-
return /* @__PURE__ */
|
|
723
|
+
return /* @__PURE__ */ jsx6(Tool, { toolName: "write", toolCallId: part.toolCallId, state: part.state, errorText: part.errorText, defaultExpanded: true, children: /* @__PURE__ */ jsxs6("span", { style: { fontFamily: "var(--boring-agent-font-mono, monospace)", fontSize: "0.8125rem" }, children: [
|
|
726
724
|
"Wrote ",
|
|
727
725
|
content.length,
|
|
728
726
|
" bytes to ",
|
|
729
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ jsx6("strong", { children: path })
|
|
730
728
|
] }) });
|
|
731
729
|
}
|
|
732
730
|
function renderEdit(part) {
|
|
@@ -735,7 +733,7 @@ function renderEdit(part) {
|
|
|
735
733
|
const oldString = typeof input.oldString === "string" ? input.oldString : "";
|
|
736
734
|
const newString = typeof input.newString === "string" ? input.newString : "";
|
|
737
735
|
const replaceAll = Boolean(input.replaceAll);
|
|
738
|
-
return /* @__PURE__ */
|
|
736
|
+
return /* @__PURE__ */ jsx6(Tool, { toolName: "edit", toolCallId: part.toolCallId, state: part.state, errorText: part.errorText, defaultExpanded: true, children: /* @__PURE__ */ jsx6(DiffView, { oldString, newString, path, replaceAll }) });
|
|
739
737
|
}
|
|
740
738
|
function renderSearchLike(toolName, part) {
|
|
741
739
|
const input = asRecord(part.input);
|
|
@@ -744,17 +742,17 @@ function renderSearchLike(toolName, part) {
|
|
|
744
742
|
const path = typeof input.path === "string" ? input.path : "";
|
|
745
743
|
const pattern = typeof input.pattern === "string" ? input.pattern : "";
|
|
746
744
|
const title = [toolName, pattern || path].filter(Boolean).join(" ");
|
|
747
|
-
return /* @__PURE__ */
|
|
745
|
+
return /* @__PURE__ */ jsx6(Tool, { toolName, toolCallId: part.toolCallId, state: part.state, errorText: part.errorText, children: content ? /* @__PURE__ */ jsx6(CodeBlock, { code: content, language: "text", filename: title }) : /* @__PURE__ */ jsx6("span", { style: { opacity: 0.6 }, children: toolName === "ls" ? `Listing ${path || "."}...` : `Searching ${pattern || path || "."}...` }) });
|
|
748
746
|
}
|
|
749
747
|
function renderGetUiState(part) {
|
|
750
|
-
return /* @__PURE__ */
|
|
748
|
+
return /* @__PURE__ */ jsx6(
|
|
751
749
|
Tool,
|
|
752
750
|
{
|
|
753
751
|
toolName: "get_ui_state",
|
|
754
752
|
toolCallId: part.toolCallId,
|
|
755
753
|
state: part.state,
|
|
756
754
|
errorText: part.errorText,
|
|
757
|
-
renderOutput: (output) => /* @__PURE__ */
|
|
755
|
+
renderOutput: (output) => /* @__PURE__ */ jsx6("pre", { style: { margin: 0, whiteSpace: "pre-wrap", fontSize: "0.8125rem", fontFamily: "var(--boring-agent-font-mono, monospace)" }, children: typeof output === "string" ? output : JSON.stringify(output, null, 2) }),
|
|
758
756
|
input: part.input,
|
|
759
757
|
output: part.output
|
|
760
758
|
}
|
|
@@ -766,7 +764,7 @@ function renderExecUi(part) {
|
|
|
766
764
|
const params = input.params;
|
|
767
765
|
const paramsText = params !== void 0 && params !== null ? typeof params === "string" ? params : JSON.stringify(params) : "";
|
|
768
766
|
const summary = kind ? `${kind}${paramsText ? `(${paramsText})` : ""}` : "(empty)";
|
|
769
|
-
return /* @__PURE__ */
|
|
767
|
+
return /* @__PURE__ */ jsx6(
|
|
770
768
|
Tool,
|
|
771
769
|
{
|
|
772
770
|
toolName: "exec_ui",
|
|
@@ -789,7 +787,7 @@ function renderExecUi(part) {
|
|
|
789
787
|
]
|
|
790
788
|
}
|
|
791
789
|
),
|
|
792
|
-
part.errorText && /* @__PURE__ */
|
|
790
|
+
part.errorText && /* @__PURE__ */ jsx6(
|
|
793
791
|
"span",
|
|
794
792
|
{
|
|
795
793
|
"data-testid": "tool-error",
|
|
@@ -811,7 +809,7 @@ function fallbackToolName(part) {
|
|
|
811
809
|
return part.toolName;
|
|
812
810
|
}
|
|
813
811
|
function renderFallback(part) {
|
|
814
|
-
const renderJson = (value) => /* @__PURE__ */
|
|
812
|
+
const renderJson = (value) => /* @__PURE__ */ jsx6(
|
|
815
813
|
"pre",
|
|
816
814
|
{
|
|
817
815
|
style: {
|
|
@@ -823,7 +821,7 @@ function renderFallback(part) {
|
|
|
823
821
|
children: typeof value === "string" ? value : JSON.stringify(value, null, 2)
|
|
824
822
|
}
|
|
825
823
|
);
|
|
826
|
-
return /* @__PURE__ */
|
|
824
|
+
return /* @__PURE__ */ jsx6(
|
|
827
825
|
Tool,
|
|
828
826
|
{
|
|
829
827
|
toolName: fallbackToolName(part),
|
|
@@ -914,17 +912,17 @@ import {
|
|
|
914
912
|
} from "@hachej/boring-ui-kit";
|
|
915
913
|
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
916
914
|
import {
|
|
917
|
-
createContext
|
|
915
|
+
createContext,
|
|
918
916
|
memo,
|
|
919
917
|
useCallback as useCallback2,
|
|
920
|
-
useContext
|
|
918
|
+
useContext,
|
|
921
919
|
useEffect as useEffect2,
|
|
922
920
|
useMemo,
|
|
923
921
|
useRef as useRef2,
|
|
924
922
|
useState as useState4
|
|
925
923
|
} from "react";
|
|
926
924
|
import { createHighlighter } from "shiki";
|
|
927
|
-
import { jsx as
|
|
925
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
928
926
|
var isItalic = (fontStyle) => fontStyle && fontStyle & 1;
|
|
929
927
|
var isBold = (fontStyle) => fontStyle && fontStyle & 2;
|
|
930
928
|
var isUnderline = (fontStyle) => (
|
|
@@ -938,7 +936,7 @@ var addKeysToTokens = (lines) => lines.map((line, lineIdx) => ({
|
|
|
938
936
|
token
|
|
939
937
|
}))
|
|
940
938
|
}));
|
|
941
|
-
var TokenSpan = ({ token }) => /* @__PURE__ */
|
|
939
|
+
var TokenSpan = ({ token }) => /* @__PURE__ */ jsx7(
|
|
942
940
|
"span",
|
|
943
941
|
{
|
|
944
942
|
className: "dark:!text-[var(--shiki-dark)]",
|
|
@@ -968,8 +966,8 @@ var LINE_NUMBER_CLASSES = cn(
|
|
|
968
966
|
var LineSpan = ({
|
|
969
967
|
keyedLine,
|
|
970
968
|
showLineNumbers
|
|
971
|
-
}) => /* @__PURE__ */
|
|
972
|
-
var CodeBlockContext =
|
|
969
|
+
}) => /* @__PURE__ */ jsx7("span", { className: showLineNumbers ? LINE_NUMBER_CLASSES : "block", children: keyedLine.tokens.length === 0 ? "\n" : keyedLine.tokens.map(({ token, key }) => /* @__PURE__ */ jsx7(TokenSpan, { token }, key)) });
|
|
970
|
+
var CodeBlockContext = createContext({
|
|
973
971
|
code: ""
|
|
974
972
|
});
|
|
975
973
|
var highlighterCache = /* @__PURE__ */ new Map();
|
|
@@ -1061,7 +1059,7 @@ var CodeBlockBody = memo(
|
|
|
1061
1059
|
() => addKeysToTokens(tokenized.tokens),
|
|
1062
1060
|
[tokenized.tokens]
|
|
1063
1061
|
);
|
|
1064
|
-
return /* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ jsx7(
|
|
1065
1063
|
"pre",
|
|
1066
1064
|
{
|
|
1067
1065
|
className: cn(
|
|
@@ -1069,14 +1067,14 @@ var CodeBlockBody = memo(
|
|
|
1069
1067
|
className
|
|
1070
1068
|
),
|
|
1071
1069
|
style: preStyle,
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1070
|
+
children: /* @__PURE__ */ jsx7(
|
|
1073
1071
|
"code",
|
|
1074
1072
|
{
|
|
1075
1073
|
className: cn(
|
|
1076
1074
|
"font-mono text-sm",
|
|
1077
1075
|
showLineNumbers && "[counter-increment:line_0] [counter-reset:line]"
|
|
1078
1076
|
),
|
|
1079
|
-
children: keyedLines.map((keyedLine) => /* @__PURE__ */
|
|
1077
|
+
children: keyedLines.map((keyedLine) => /* @__PURE__ */ jsx7(
|
|
1080
1078
|
LineSpan,
|
|
1081
1079
|
{
|
|
1082
1080
|
keyedLine,
|
|
@@ -1097,7 +1095,7 @@ var CodeBlockContainer = ({
|
|
|
1097
1095
|
language,
|
|
1098
1096
|
style,
|
|
1099
1097
|
...props
|
|
1100
|
-
}) => /* @__PURE__ */
|
|
1098
|
+
}) => /* @__PURE__ */ jsx7(
|
|
1101
1099
|
"div",
|
|
1102
1100
|
{
|
|
1103
1101
|
className: cn(
|
|
@@ -1117,7 +1115,7 @@ var CodeBlockHeader = ({
|
|
|
1117
1115
|
children,
|
|
1118
1116
|
className,
|
|
1119
1117
|
...props
|
|
1120
|
-
}) => /* @__PURE__ */
|
|
1118
|
+
}) => /* @__PURE__ */ jsx7(
|
|
1121
1119
|
"div",
|
|
1122
1120
|
{
|
|
1123
1121
|
className: cn(
|
|
@@ -1132,12 +1130,12 @@ var CodeBlockTitle = ({
|
|
|
1132
1130
|
children,
|
|
1133
1131
|
className,
|
|
1134
1132
|
...props
|
|
1135
|
-
}) => /* @__PURE__ */
|
|
1133
|
+
}) => /* @__PURE__ */ jsx7("div", { className: cn("flex items-center gap-2", className), ...props, children });
|
|
1136
1134
|
var CodeBlockFilename = ({
|
|
1137
1135
|
children,
|
|
1138
1136
|
className,
|
|
1139
1137
|
...props
|
|
1140
|
-
}) => /* @__PURE__ */
|
|
1138
|
+
}) => /* @__PURE__ */ jsx7(
|
|
1141
1139
|
"span",
|
|
1142
1140
|
{
|
|
1143
1141
|
className: cn(
|
|
@@ -1177,7 +1175,7 @@ var CodeBlockContent = ({
|
|
|
1177
1175
|
};
|
|
1178
1176
|
}, [code3, language]);
|
|
1179
1177
|
const tokenized = asyncTokens ?? syncTokens;
|
|
1180
|
-
return /* @__PURE__ */
|
|
1178
|
+
return /* @__PURE__ */ jsx7("div", { className: "relative overflow-auto", children: /* @__PURE__ */ jsx7(CodeBlockBody, { showLineNumbers, tokenized }) });
|
|
1181
1179
|
};
|
|
1182
1180
|
var CodeBlock2 = ({
|
|
1183
1181
|
code: code3,
|
|
@@ -1188,9 +1186,9 @@ var CodeBlock2 = ({
|
|
|
1188
1186
|
...props
|
|
1189
1187
|
}) => {
|
|
1190
1188
|
const contextValue = useMemo(() => ({ code: code3 }), [code3]);
|
|
1191
|
-
return /* @__PURE__ */
|
|
1189
|
+
return /* @__PURE__ */ jsx7(CodeBlockContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs7(CodeBlockContainer, { className, language, ...props, children: [
|
|
1192
1190
|
children,
|
|
1193
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ jsx7(
|
|
1194
1192
|
CodeBlockContent,
|
|
1195
1193
|
{
|
|
1196
1194
|
code: code3,
|
|
@@ -1210,7 +1208,7 @@ var CodeBlockCopyButton = ({
|
|
|
1210
1208
|
}) => {
|
|
1211
1209
|
const [isCopied, setIsCopied] = useState4(false);
|
|
1212
1210
|
const timeoutRef = useRef2(0);
|
|
1213
|
-
const { code: code3 } =
|
|
1211
|
+
const { code: code3 } = useContext(CodeBlockContext);
|
|
1214
1212
|
const copyToClipboard = useCallback2(async () => {
|
|
1215
1213
|
if (typeof window === "undefined") {
|
|
1216
1214
|
onError?.(new Error("Clipboard API not available"));
|
|
@@ -1238,7 +1236,7 @@ var CodeBlockCopyButton = ({
|
|
|
1238
1236
|
[]
|
|
1239
1237
|
);
|
|
1240
1238
|
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
1241
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ jsx7(
|
|
1242
1240
|
Button5,
|
|
1243
1241
|
{
|
|
1244
1242
|
className: cn("shrink-0", className),
|
|
@@ -1246,14 +1244,14 @@ var CodeBlockCopyButton = ({
|
|
|
1246
1244
|
size: "icon",
|
|
1247
1245
|
variant: "ghost",
|
|
1248
1246
|
...props,
|
|
1249
|
-
children: children ?? /* @__PURE__ */
|
|
1247
|
+
children: children ?? /* @__PURE__ */ jsx7(Icon, { size: 14 })
|
|
1250
1248
|
}
|
|
1251
1249
|
);
|
|
1252
1250
|
};
|
|
1253
1251
|
|
|
1254
1252
|
// src/front/primitives/tool.tsx
|
|
1255
|
-
import { jsx as
|
|
1256
|
-
var Tool2 = ({ className, ...props }) => /* @__PURE__ */
|
|
1253
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1254
|
+
var Tool2 = ({ className, ...props }) => /* @__PURE__ */ jsx8(
|
|
1257
1255
|
Collapsible,
|
|
1258
1256
|
{
|
|
1259
1257
|
"data-boring-agent-part": "tool-card",
|
|
@@ -1281,14 +1279,14 @@ var statusLabels = {
|
|
|
1281
1279
|
aborted: "Aborted"
|
|
1282
1280
|
};
|
|
1283
1281
|
var statusIcons = {
|
|
1284
|
-
"approval-requested": /* @__PURE__ */
|
|
1285
|
-
"approval-responded": /* @__PURE__ */
|
|
1286
|
-
"input-available": /* @__PURE__ */
|
|
1287
|
-
"input-streaming": /* @__PURE__ */
|
|
1288
|
-
"output-available": /* @__PURE__ */
|
|
1289
|
-
"output-denied": /* @__PURE__ */
|
|
1290
|
-
"output-error": /* @__PURE__ */
|
|
1291
|
-
aborted: /* @__PURE__ */
|
|
1282
|
+
"approval-requested": /* @__PURE__ */ jsx8(ClockIcon, { className: "size-4 text-accent" }),
|
|
1283
|
+
"approval-responded": /* @__PURE__ */ jsx8(CheckCircleIcon, { className: "size-4 text-accent" }),
|
|
1284
|
+
"input-available": /* @__PURE__ */ jsx8(ClockIcon, { className: "size-4 animate-pulse text-muted-foreground" }),
|
|
1285
|
+
"input-streaming": /* @__PURE__ */ jsx8(CircleIcon, { className: "size-4 text-muted-foreground" }),
|
|
1286
|
+
"output-available": /* @__PURE__ */ jsx8(CheckCircleIcon, { className: "size-4 text-accent" }),
|
|
1287
|
+
"output-denied": /* @__PURE__ */ jsx8(XCircleIcon, { className: "size-4 text-destructive" }),
|
|
1288
|
+
"output-error": /* @__PURE__ */ jsx8(XCircleIcon, { className: "size-4 text-destructive" }),
|
|
1289
|
+
aborted: /* @__PURE__ */ jsx8(XCircleIcon, { className: "size-4 text-muted-foreground" })
|
|
1292
1290
|
};
|
|
1293
1291
|
var getStatusBadge = (status, label = statusLabels[status]) => /* @__PURE__ */ jsxs8(Badge, { className: "shrink-0 gap-1.5 rounded-full text-xs", variant: "secondary", children: [
|
|
1294
1292
|
statusIcons[status],
|
|
@@ -1316,11 +1314,11 @@ var ToolHeader = ({
|
|
|
1316
1314
|
...props,
|
|
1317
1315
|
children: [
|
|
1318
1316
|
/* @__PURE__ */ jsxs8("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
1319
|
-
icon ?? /* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1317
|
+
icon ?? /* @__PURE__ */ jsx8(WrenchIcon, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
1318
|
+
/* @__PURE__ */ jsx8("span", { "data-boring-agent-part": "tool-title", className: "min-w-0 flex-1 truncate text-sm font-medium", children: title ?? derivedName }),
|
|
1321
1319
|
getStatusBadge(state, statusLabel)
|
|
1322
1320
|
] }),
|
|
1323
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ jsx8(
|
|
1324
1322
|
ChevronDownIcon,
|
|
1325
1323
|
{
|
|
1326
1324
|
"data-boring-agent-part": "tool-chevron",
|
|
@@ -1331,7 +1329,7 @@ var ToolHeader = ({
|
|
|
1331
1329
|
}
|
|
1332
1330
|
);
|
|
1333
1331
|
};
|
|
1334
|
-
var ToolContent = ({ className, ...props }) => /* @__PURE__ */
|
|
1332
|
+
var ToolContent = ({ className, ...props }) => /* @__PURE__ */ jsx8(
|
|
1335
1333
|
CollapsibleContent,
|
|
1336
1334
|
{
|
|
1337
1335
|
className: cn(
|
|
@@ -1342,8 +1340,8 @@ var ToolContent = ({ className, ...props }) => /* @__PURE__ */ jsx9(
|
|
|
1342
1340
|
}
|
|
1343
1341
|
);
|
|
1344
1342
|
var ToolInput = ({ className, input, ...props }) => /* @__PURE__ */ jsxs8("div", { className: cn("space-y-2 overflow-hidden", className), ...props, children: [
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1343
|
+
/* @__PURE__ */ jsx8("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: "Parameters" }),
|
|
1344
|
+
/* @__PURE__ */ jsx8("div", { className: "rounded-md bg-muted/50", children: /* @__PURE__ */ jsx8(CodeBlock2, { code: JSON.stringify(input, null, 2), language: "json" }) })
|
|
1347
1345
|
] });
|
|
1348
1346
|
var ToolOutput = ({
|
|
1349
1347
|
className,
|
|
@@ -1357,15 +1355,15 @@ var ToolOutput = ({
|
|
|
1357
1355
|
let Output = null;
|
|
1358
1356
|
if (!errorText) {
|
|
1359
1357
|
if (typeof output === "object" && !isValidElement(output)) {
|
|
1360
|
-
Output = /* @__PURE__ */
|
|
1358
|
+
Output = /* @__PURE__ */ jsx8(CodeBlock2, { code: JSON.stringify(output, null, 2), language: "json" });
|
|
1361
1359
|
} else if (typeof output === "string") {
|
|
1362
|
-
Output = /* @__PURE__ */
|
|
1360
|
+
Output = /* @__PURE__ */ jsx8(CodeBlock2, { code: output, language: "text" });
|
|
1363
1361
|
} else if (output) {
|
|
1364
|
-
Output = /* @__PURE__ */
|
|
1362
|
+
Output = /* @__PURE__ */ jsx8("div", { children: output });
|
|
1365
1363
|
}
|
|
1366
1364
|
}
|
|
1367
1365
|
return /* @__PURE__ */ jsxs8("div", { "data-boring-agent-part": "tool-result", className: cn("space-y-2", className), ...props, children: [
|
|
1368
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ jsx8("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: errorText ? "Error" : "Result" }),
|
|
1369
1367
|
/* @__PURE__ */ jsxs8(
|
|
1370
1368
|
"div",
|
|
1371
1369
|
{
|
|
@@ -1374,7 +1372,7 @@ var ToolOutput = ({
|
|
|
1374
1372
|
errorText ? "overflow-hidden border border-destructive/20 bg-destructive/10 text-destructive" : "overflow-x-auto bg-muted/30 text-foreground"
|
|
1375
1373
|
),
|
|
1376
1374
|
children: [
|
|
1377
|
-
errorText ? /* @__PURE__ */
|
|
1375
|
+
errorText ? /* @__PURE__ */ jsx8("pre", { className: "m-0 overflow-x-auto whitespace-pre-wrap break-words p-3 font-mono text-[12px] leading-5 [overflow-wrap:anywhere]", children: errorText }) : null,
|
|
1378
1376
|
Output
|
|
1379
1377
|
]
|
|
1380
1378
|
}
|
|
@@ -1386,52 +1384,6 @@ var ToolOutput = ({
|
|
|
1386
1384
|
import { CollapsibleTrigger as CollapsibleTrigger2 } from "@hachej/boring-ui-kit";
|
|
1387
1385
|
import { ChevronDownIcon as ChevronDownIcon2, CopyIcon as CopyIcon2, DownloadIcon, ExternalLinkIcon, FileDiffIcon, FilePlus2Icon, FileTextIcon, SearchIcon, SquareTerminalIcon, ZapIcon } from "lucide-react";
|
|
1388
1386
|
|
|
1389
|
-
// src/front/primitives/artifact.tsx
|
|
1390
|
-
import { Button as Button6 } from "@hachej/boring-ui-kit";
|
|
1391
|
-
import {
|
|
1392
|
-
Tooltip,
|
|
1393
|
-
TooltipContent,
|
|
1394
|
-
TooltipProvider,
|
|
1395
|
-
TooltipTrigger
|
|
1396
|
-
} from "@hachej/boring-ui-kit";
|
|
1397
|
-
import { XIcon } from "lucide-react";
|
|
1398
|
-
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1399
|
-
var ArtifactAction = ({
|
|
1400
|
-
tooltip,
|
|
1401
|
-
label,
|
|
1402
|
-
icon: Icon,
|
|
1403
|
-
children,
|
|
1404
|
-
className,
|
|
1405
|
-
size = "sm",
|
|
1406
|
-
variant = "ghost",
|
|
1407
|
-
...props
|
|
1408
|
-
}) => {
|
|
1409
|
-
const button = /* @__PURE__ */ jsxs9(
|
|
1410
|
-
Button6,
|
|
1411
|
-
{
|
|
1412
|
-
className: cn(
|
|
1413
|
-
"size-8 p-0 text-muted-foreground hover:text-foreground",
|
|
1414
|
-
className
|
|
1415
|
-
),
|
|
1416
|
-
size,
|
|
1417
|
-
type: "button",
|
|
1418
|
-
variant,
|
|
1419
|
-
...props,
|
|
1420
|
-
children: [
|
|
1421
|
-
Icon ? /* @__PURE__ */ jsx10(Icon, { className: "size-4" }) : children,
|
|
1422
|
-
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: label || tooltip })
|
|
1423
|
-
]
|
|
1424
|
-
}
|
|
1425
|
-
);
|
|
1426
|
-
if (tooltip) {
|
|
1427
|
-
return /* @__PURE__ */ jsx10(TooltipProvider, { children: /* @__PURE__ */ jsxs9(Tooltip, { children: [
|
|
1428
|
-
/* @__PURE__ */ jsx10(TooltipTrigger, { asChild: true, children: button }),
|
|
1429
|
-
/* @__PURE__ */ jsx10(TooltipContent, { children: /* @__PURE__ */ jsx10("p", { children: tooltip }) })
|
|
1430
|
-
] }) });
|
|
1431
|
-
}
|
|
1432
|
-
return button;
|
|
1433
|
-
};
|
|
1434
|
-
|
|
1435
1387
|
// src/front/runtimeReadinessStatus.ts
|
|
1436
1388
|
var COPY = {
|
|
1437
1389
|
"runtime-dependencies": "Runtime dependencies are still installing.",
|
|
@@ -1496,7 +1448,7 @@ function getWorkspaceNotReadyStatus(output) {
|
|
|
1496
1448
|
}
|
|
1497
1449
|
|
|
1498
1450
|
// src/front/toolRenderers.tsx
|
|
1499
|
-
import { Fragment as Fragment3, jsx as
|
|
1451
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1500
1452
|
function asRecord2(value) {
|
|
1501
1453
|
return typeof value === "object" && value !== null ? value : {};
|
|
1502
1454
|
}
|
|
@@ -1520,7 +1472,7 @@ function toHeaderProps(part) {
|
|
|
1520
1472
|
function PathLabel({ path, filesystem }) {
|
|
1521
1473
|
const onOpen = useOpenArtifact();
|
|
1522
1474
|
if (!onOpen) {
|
|
1523
|
-
return /* @__PURE__ */
|
|
1475
|
+
return /* @__PURE__ */ jsx9("span", { className: "font-mono text-[12.5px] text-foreground/85", children: path });
|
|
1524
1476
|
}
|
|
1525
1477
|
const open = (e) => {
|
|
1526
1478
|
e.preventDefault();
|
|
@@ -1531,7 +1483,7 @@ function PathLabel({ path, filesystem }) {
|
|
|
1531
1483
|
const handleKeyDown = (e) => {
|
|
1532
1484
|
if (e.key === "Enter" || e.key === " ") open(e);
|
|
1533
1485
|
};
|
|
1534
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ jsxs9(
|
|
1535
1487
|
"span",
|
|
1536
1488
|
{
|
|
1537
1489
|
role: "button",
|
|
@@ -1547,8 +1499,8 @@ function PathLabel({ path, filesystem }) {
|
|
|
1547
1499
|
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[color:var(--accent)]/40"
|
|
1548
1500
|
),
|
|
1549
1501
|
children: [
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ jsx9("span", { className: "truncate", children: path }),
|
|
1503
|
+
/* @__PURE__ */ jsx9(
|
|
1552
1504
|
ExternalLinkIcon,
|
|
1553
1505
|
{
|
|
1554
1506
|
className: "h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover/path:opacity-100",
|
|
@@ -1563,9 +1515,9 @@ function PathLabel({ path, filesystem }) {
|
|
|
1563
1515
|
function renderWorkspaceNotReady(part) {
|
|
1564
1516
|
const status = getWorkspaceNotReadyStatus(part.output);
|
|
1565
1517
|
if (!status) return null;
|
|
1566
|
-
return /* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
/* @__PURE__ */
|
|
1518
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1519
|
+
/* @__PURE__ */ jsx9(ToolHeader, { title: `${part.toolName} \xB7 ${status.message}`, ...toHeaderProps(part) }),
|
|
1520
|
+
/* @__PURE__ */ jsx9(ToolContent, { children: /* @__PURE__ */ jsxs9("div", { className: "rounded-md border border-border/60 bg-muted/30 px-3 py-2 text-sm text-muted-foreground", children: [
|
|
1569
1521
|
status.message,
|
|
1570
1522
|
" Try again in a moment."
|
|
1571
1523
|
] }) })
|
|
@@ -1575,9 +1527,9 @@ function renderRuntimeNotReady(part) {
|
|
|
1575
1527
|
const status = getRuntimeReadinessStatus(part.output);
|
|
1576
1528
|
if (!status) return null;
|
|
1577
1529
|
const suffix = status.code === ErrorCode.enum.RUNTIME_PROVISIONING_FAILED ? "Retry or reload the workspace." : "This is retryable; try again shortly.";
|
|
1578
|
-
return /* @__PURE__ */
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1530
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1531
|
+
/* @__PURE__ */ jsx9(ToolHeader, { title: `${part.toolName} \xB7 ${status.message} ${suffix}`, ...toHeaderProps(part) }),
|
|
1532
|
+
/* @__PURE__ */ jsx9(ToolContent, { children: /* @__PURE__ */ jsxs9("div", { className: "rounded-md border border-border/60 bg-muted/30 px-3 py-2 text-sm text-muted-foreground", children: [
|
|
1581
1533
|
status.message,
|
|
1582
1534
|
" ",
|
|
1583
1535
|
suffix
|
|
@@ -1588,10 +1540,10 @@ function renderReadinessBlock(part) {
|
|
|
1588
1540
|
return renderWorkspaceNotReady(part) ?? renderRuntimeNotReady(part);
|
|
1589
1541
|
}
|
|
1590
1542
|
function pathTitle(prefix, path, filesystem) {
|
|
1591
|
-
return /* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1543
|
+
return /* @__PURE__ */ jsxs9("span", { className: "flex min-w-0 items-center gap-1.5", children: [
|
|
1544
|
+
/* @__PURE__ */ jsx9("span", { className: "text-muted-foreground", children: prefix }),
|
|
1545
|
+
/* @__PURE__ */ jsx9("span", { className: "text-muted-foreground/40", "aria-hidden": "true", children: "\xB7" }),
|
|
1546
|
+
/* @__PURE__ */ jsx9(PathLabel, { path, filesystem })
|
|
1595
1547
|
] });
|
|
1596
1548
|
}
|
|
1597
1549
|
function renderBash2(part) {
|
|
@@ -1606,21 +1558,21 @@ function renderBash2(part) {
|
|
|
1606
1558
|
const exitCode = typeof output.exitCode === "number" ? output.exitCode : null;
|
|
1607
1559
|
const title = description || (command.length > 64 ? command.slice(0, 64) + "\u2026" : command) || "bash";
|
|
1608
1560
|
const errorText = part.errorText || (stderr && (exitCode ?? 0) !== 0 ? stderr : void 0);
|
|
1609
|
-
return /* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
command && /* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1562
|
+
/* @__PURE__ */ jsx9(ToolHeader, { icon: /* @__PURE__ */ jsx9(SquareTerminalIcon, { className: "size-4 text-muted-foreground" }), title: `bash \xB7 ${title}`, ...toHeaderProps(part) }),
|
|
1563
|
+
/* @__PURE__ */ jsxs9(ToolContent, { children: [
|
|
1564
|
+
command && /* @__PURE__ */ jsxs9("section", { className: "space-y-2", children: [
|
|
1565
|
+
/* @__PURE__ */ jsx9("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: "Command" }),
|
|
1566
|
+
/* @__PURE__ */ jsx9(CodeBlock2, { code: command, language: "bash" })
|
|
1615
1567
|
] }),
|
|
1616
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ jsx9(
|
|
1617
1569
|
ToolOutput,
|
|
1618
1570
|
{
|
|
1619
1571
|
output: stdout && !errorText ? stdout : void 0,
|
|
1620
1572
|
errorText
|
|
1621
1573
|
}
|
|
1622
1574
|
),
|
|
1623
|
-
exitCode !== null && exitCode !== 0 && !errorText && /* @__PURE__ */
|
|
1575
|
+
exitCode !== null && exitCode !== 0 && !errorText && /* @__PURE__ */ jsxs9("div", { className: "text-xs text-destructive", children: [
|
|
1624
1576
|
"exit ",
|
|
1625
1577
|
exitCode
|
|
1626
1578
|
] })
|
|
@@ -1636,13 +1588,13 @@ function renderRead2(part) {
|
|
|
1636
1588
|
const filesystem = typeof input.filesystem === "string" ? input.filesystem : void 0;
|
|
1637
1589
|
const content = extractTextContent(output);
|
|
1638
1590
|
const lang = langFromPath(path);
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
content && /* @__PURE__ */
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
-
/* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1592
|
+
/* @__PURE__ */ jsx9(ToolHeader, { icon: /* @__PURE__ */ jsx9(FileTextIcon, { className: "size-4 text-muted-foreground" }), title: pathTitle("read", path, filesystem), ...toHeaderProps(part) }),
|
|
1593
|
+
/* @__PURE__ */ jsxs9(ToolContent, { children: [
|
|
1594
|
+
/* @__PURE__ */ jsx9(ToolInput, { input }),
|
|
1595
|
+
content && /* @__PURE__ */ jsxs9("section", { className: "space-y-2", children: [
|
|
1596
|
+
/* @__PURE__ */ jsx9("h4", { className: "font-medium text-muted-foreground text-xs uppercase tracking-wide", children: "Content" }),
|
|
1597
|
+
/* @__PURE__ */ jsx9(CodeBlock2, { code: content, language: lang ?? "text" })
|
|
1646
1598
|
] })
|
|
1647
1599
|
] })
|
|
1648
1600
|
] });
|
|
@@ -1654,20 +1606,20 @@ function renderWrite2(part) {
|
|
|
1654
1606
|
const path = typeof input.path === "string" ? input.path : "";
|
|
1655
1607
|
const filesystem = typeof input.filesystem === "string" ? input.filesystem : void 0;
|
|
1656
1608
|
const content = typeof input.content === "string" ? input.content : "";
|
|
1657
|
-
return /* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
1660
|
-
/* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ jsxs9(Tool2, { defaultOpen: part.state === "output-available", children: [
|
|
1610
|
+
/* @__PURE__ */ jsx9(ToolHeader, { className: "p-2", icon: /* @__PURE__ */ jsx9(FilePlus2Icon, { className: "size-4 shrink-0 text-muted-foreground" }), title: pathTitle("write", path, filesystem), ...toHeaderProps(part) }),
|
|
1611
|
+
/* @__PURE__ */ jsxs9(ToolContent, { className: "p-1.5", children: [
|
|
1612
|
+
/* @__PURE__ */ jsx9("div", { className: "max-h-80 overflow-auto overscroll-contain rounded-sm", children: content ? /* @__PURE__ */ jsx9(
|
|
1661
1613
|
DiffView,
|
|
1662
1614
|
{
|
|
1663
1615
|
oldString: "",
|
|
1664
1616
|
newString: content,
|
|
1665
1617
|
path,
|
|
1666
|
-
actions: /* @__PURE__ */
|
|
1667
|
-
/* @__PURE__ */
|
|
1618
|
+
actions: /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
1619
|
+
/* @__PURE__ */ jsx9(ArtifactAction, { className: "size-6", icon: CopyIcon2, tooltip: "Copy contents", label: "Copy", onClick: () => {
|
|
1668
1620
|
void copyTextToClipboard(content);
|
|
1669
1621
|
} }),
|
|
1670
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ jsx9(
|
|
1671
1623
|
ArtifactAction,
|
|
1672
1624
|
{
|
|
1673
1625
|
className: "size-6",
|
|
@@ -1689,8 +1641,8 @@ function renderWrite2(part) {
|
|
|
1689
1641
|
)
|
|
1690
1642
|
] })
|
|
1691
1643
|
}
|
|
1692
|
-
) : /* @__PURE__ */
|
|
1693
|
-
part.errorText || part.state === "output-error" || part.state === "output-denied" ? /* @__PURE__ */
|
|
1644
|
+
) : /* @__PURE__ */ jsx9("p", { className: "px-2 py-1 text-[12px] text-muted-foreground", children: "No file content was included with this tool call." }) }),
|
|
1645
|
+
part.errorText || part.state === "output-error" || part.state === "output-denied" ? /* @__PURE__ */ jsx9(ToolOutput, { output: part.output, errorText: part.errorText }) : null
|
|
1694
1646
|
] })
|
|
1695
1647
|
] });
|
|
1696
1648
|
}
|
|
@@ -1709,17 +1661,17 @@ function renderEdit2(part) {
|
|
|
1709
1661
|
const legacyOldText = typeof input.oldString === "string" ? input.oldString : typeof input.oldText === "string" ? input.oldText : "";
|
|
1710
1662
|
const legacyNewText = typeof input.newString === "string" ? input.newString : typeof input.newText === "string" ? input.newText : "";
|
|
1711
1663
|
const visibleEdits = edits.length > 0 ? edits : legacyOldText || legacyNewText ? [{ oldText: legacyOldText, newText: legacyNewText }] : [];
|
|
1712
|
-
return /* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
visibleEdits.length > 1 ? /* @__PURE__ */
|
|
1664
|
+
return /* @__PURE__ */ jsxs9(Tool2, { defaultOpen: part.state === "output-available", children: [
|
|
1665
|
+
/* @__PURE__ */ jsx9(ToolHeader, { className: "p-2", icon: /* @__PURE__ */ jsx9(FileDiffIcon, { className: "size-4 shrink-0 text-muted-foreground" }), title: pathTitle("edit", path, filesystem), ...toHeaderProps(part) }),
|
|
1666
|
+
/* @__PURE__ */ jsxs9(ToolContent, { className: "space-y-2 p-2", children: [
|
|
1667
|
+
/* @__PURE__ */ jsx9("div", { className: "max-h-80 space-y-2 overflow-auto overscroll-contain rounded-sm", children: visibleEdits.length > 0 ? visibleEdits.map((edit, index) => /* @__PURE__ */ jsxs9("div", { children: [
|
|
1668
|
+
visibleEdits.length > 1 ? /* @__PURE__ */ jsxs9("div", { className: "mb-1 px-1 text-[11px] text-muted-foreground", children: [
|
|
1717
1669
|
"Change ",
|
|
1718
1670
|
index + 1
|
|
1719
1671
|
] }) : null,
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
] }, `${index}:${edit.oldText.length}:${edit.newText.length}`)) : /* @__PURE__ */
|
|
1722
|
-
part.errorText || part.state === "output-error" || part.state === "output-denied" ? /* @__PURE__ */
|
|
1672
|
+
/* @__PURE__ */ jsx9(DiffView, { oldString: edit.oldText, newString: edit.newText, path })
|
|
1673
|
+
] }, `${index}:${edit.oldText.length}:${edit.newText.length}`)) : /* @__PURE__ */ jsx9("p", { className: "px-2 py-1 text-[12px] text-muted-foreground", children: "Diff details were not included with this tool call." }) }),
|
|
1674
|
+
part.errorText || part.state === "output-error" || part.state === "output-denied" ? /* @__PURE__ */ jsx9(ToolOutput, { output: part.output, errorText: part.errorText }) : null
|
|
1723
1675
|
] })
|
|
1724
1676
|
] });
|
|
1725
1677
|
}
|
|
@@ -1732,18 +1684,18 @@ function renderSearchLike2(toolName, part) {
|
|
|
1732
1684
|
const path = typeof input.path === "string" ? input.path : "";
|
|
1733
1685
|
const glob = typeof input.glob === "string" ? input.glob : "";
|
|
1734
1686
|
const summary = [pattern, path, glob].filter(Boolean).join(" \xB7 ");
|
|
1735
|
-
return /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1687
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1688
|
+
/* @__PURE__ */ jsx9(
|
|
1737
1689
|
ToolHeader,
|
|
1738
1690
|
{
|
|
1739
|
-
icon: /* @__PURE__ */
|
|
1691
|
+
icon: /* @__PURE__ */ jsx9(SearchLikeIcon, { className: "size-4 text-muted-foreground" }),
|
|
1740
1692
|
title: summary ? `${toolName} \xB7 ${summary}` : toolName,
|
|
1741
1693
|
...toHeaderProps(part)
|
|
1742
1694
|
}
|
|
1743
1695
|
),
|
|
1744
|
-
/* @__PURE__ */
|
|
1745
|
-
/* @__PURE__ */
|
|
1746
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ jsxs9(ToolContent, { children: [
|
|
1697
|
+
/* @__PURE__ */ jsx9(ToolInput, { input }),
|
|
1698
|
+
/* @__PURE__ */ jsx9(ToolOutput, { output: part.output, errorText: part.errorText })
|
|
1747
1699
|
] })
|
|
1748
1700
|
] });
|
|
1749
1701
|
}
|
|
@@ -1768,8 +1720,8 @@ function renderExecUi2(part) {
|
|
|
1768
1720
|
const kind = typeof input.kind === "string" ? input.kind : "(empty)";
|
|
1769
1721
|
const tokens = extractParamTokens(input.params);
|
|
1770
1722
|
const headerProps = toHeaderProps(part);
|
|
1771
|
-
return /* @__PURE__ */
|
|
1772
|
-
/* @__PURE__ */
|
|
1723
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1724
|
+
/* @__PURE__ */ jsxs9(
|
|
1773
1725
|
CollapsibleTrigger2,
|
|
1774
1726
|
{
|
|
1775
1727
|
className: cn(
|
|
@@ -1777,17 +1729,17 @@ function renderExecUi2(part) {
|
|
|
1777
1729
|
"hover:bg-muted/40 transition-colors"
|
|
1778
1730
|
),
|
|
1779
1731
|
children: [
|
|
1780
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsx9(
|
|
1781
1733
|
ZapIcon,
|
|
1782
1734
|
{
|
|
1783
1735
|
className: "size-3.5 shrink-0 text-muted-foreground/70",
|
|
1784
1736
|
"aria-hidden": "true"
|
|
1785
1737
|
}
|
|
1786
1738
|
),
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
tokens.length > 0 && /* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
tokens.map((tok, i) => /* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ jsx9("span", { className: "font-medium text-sm", children: kind }),
|
|
1740
|
+
tokens.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "flex min-w-0 items-center gap-1.5 overflow-hidden", children: [
|
|
1741
|
+
/* @__PURE__ */ jsx9("span", { className: "text-muted-foreground/40", "aria-hidden": "true", children: "\xB7" }),
|
|
1742
|
+
tokens.map((tok, i) => /* @__PURE__ */ jsx9(
|
|
1791
1743
|
"span",
|
|
1792
1744
|
{
|
|
1793
1745
|
className: cn(
|
|
@@ -1800,9 +1752,9 @@ function renderExecUi2(part) {
|
|
|
1800
1752
|
i
|
|
1801
1753
|
))
|
|
1802
1754
|
] }),
|
|
1803
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ jsxs9("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
|
|
1804
1756
|
getStatusBadge(headerProps.state),
|
|
1805
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ jsx9(
|
|
1806
1758
|
ChevronDownIcon2,
|
|
1807
1759
|
{
|
|
1808
1760
|
className: "size-4 text-muted-foreground/60 transition-transform group-data-[state=open]/exec-ui:rotate-180",
|
|
@@ -1813,9 +1765,9 @@ function renderExecUi2(part) {
|
|
|
1813
1765
|
]
|
|
1814
1766
|
}
|
|
1815
1767
|
),
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
-
part.input !== void 0 && part.input !== null && /* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
1768
|
+
/* @__PURE__ */ jsxs9(ToolContent, { children: [
|
|
1769
|
+
part.input !== void 0 && part.input !== null && /* @__PURE__ */ jsx9(ToolInput, { input: part.input }),
|
|
1770
|
+
/* @__PURE__ */ jsx9(ToolOutput, { output: part.output, errorText: part.errorText })
|
|
1819
1771
|
] })
|
|
1820
1772
|
] });
|
|
1821
1773
|
}
|
|
@@ -1827,11 +1779,11 @@ function fallbackTitle(part) {
|
|
|
1827
1779
|
function renderFallback2(part) {
|
|
1828
1780
|
const readiness = renderReadinessBlock(part);
|
|
1829
1781
|
if (readiness) return readiness;
|
|
1830
|
-
return /* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
part.input !== void 0 && part.input !== null && /* @__PURE__ */
|
|
1834
|
-
/* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ jsxs9(Tool2, { children: [
|
|
1783
|
+
/* @__PURE__ */ jsx9(ToolHeader, { title: fallbackTitle(part), ...toHeaderProps(part) }),
|
|
1784
|
+
/* @__PURE__ */ jsxs9(ToolContent, { children: [
|
|
1785
|
+
part.input !== void 0 && part.input !== null && /* @__PURE__ */ jsx9(ToolInput, { input: part.input }),
|
|
1786
|
+
/* @__PURE__ */ jsx9(ToolOutput, { output: part.output, errorText: part.errorText })
|
|
1835
1787
|
] })
|
|
1836
1788
|
] });
|
|
1837
1789
|
}
|
|
@@ -1995,7 +1947,7 @@ function usePickerKeyboard({
|
|
|
1995
1947
|
}
|
|
1996
1948
|
|
|
1997
1949
|
// src/front/primitives/mention-picker.tsx
|
|
1998
|
-
import { Fragment as Fragment4, jsx as
|
|
1950
|
+
import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1999
1951
|
var mentionSearchGlob = toFileSearchGlob;
|
|
2000
1952
|
function highlight(text, query) {
|
|
2001
1953
|
if (!query) return null;
|
|
@@ -2042,10 +1994,10 @@ function MentionPicker({
|
|
|
2042
1994
|
}, [results, onSelect]);
|
|
2043
1995
|
usePickerKeyboard({ count: results.length, activeIdx, setActiveIdx, listRef, onSelect: handleSelect, onDismiss });
|
|
2044
1996
|
if (results.length === 0) return null;
|
|
2045
|
-
return /* @__PURE__ */
|
|
1997
|
+
return /* @__PURE__ */ jsx10("div", { className: "mb-1 w-full overflow-hidden rounded-lg border border-border/60 bg-popover shadow-lg", children: /* @__PURE__ */ jsx10("ul", { ref: listRef, className: "max-h-48 overflow-y-auto py-1", role: "listbox", "aria-label": "File suggestions", children: results.map((path, i) => {
|
|
2046
1998
|
const name = path.split("/").pop() ?? path;
|
|
2047
1999
|
const hl = highlight(name, mention.query);
|
|
2048
|
-
return /* @__PURE__ */
|
|
2000
|
+
return /* @__PURE__ */ jsxs10(
|
|
2049
2001
|
"li",
|
|
2050
2002
|
{
|
|
2051
2003
|
role: "option",
|
|
@@ -2060,12 +2012,12 @@ function MentionPicker({
|
|
|
2060
2012
|
onSelect(path);
|
|
2061
2013
|
},
|
|
2062
2014
|
children: [
|
|
2063
|
-
/* @__PURE__ */
|
|
2015
|
+
/* @__PURE__ */ jsx10("span", { className: "font-medium", children: hl ? /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
2064
2016
|
hl.before,
|
|
2065
|
-
/* @__PURE__ */
|
|
2017
|
+
/* @__PURE__ */ jsx10("mark", { className: "bg-transparent text-[color:var(--accent)]", children: hl.match }),
|
|
2066
2018
|
hl.after
|
|
2067
2019
|
] }) : name }),
|
|
2068
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ jsx10("span", { className: "truncate text-[11px] opacity-50", children: path })
|
|
2069
2021
|
]
|
|
2070
2022
|
},
|
|
2071
2023
|
path
|
|
@@ -2882,22 +2834,22 @@ function composerNoticeForRuntimeDependencies(status) {
|
|
|
2882
2834
|
}
|
|
2883
2835
|
|
|
2884
2836
|
// src/front/chat/composerContributions.tsx
|
|
2885
|
-
import { createContext as
|
|
2886
|
-
import { jsx as
|
|
2887
|
-
var ComposerContributionContext =
|
|
2837
|
+
import { createContext as createContext2, useContext as useContext2, useMemo as useMemo3 } from "react";
|
|
2838
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
2839
|
+
var ComposerContributionContext = createContext2([]);
|
|
2888
2840
|
function ComposerContributionProvider({
|
|
2889
2841
|
contribution,
|
|
2890
2842
|
children
|
|
2891
2843
|
}) {
|
|
2892
|
-
const parent =
|
|
2844
|
+
const parent = useContext2(ComposerContributionContext);
|
|
2893
2845
|
const contributions = useMemo3(
|
|
2894
2846
|
() => [contribution, ...parent.filter((entry) => entry.id !== contribution.id)],
|
|
2895
2847
|
[contribution, parent]
|
|
2896
2848
|
);
|
|
2897
|
-
return /* @__PURE__ */
|
|
2849
|
+
return /* @__PURE__ */ jsx11(ComposerContributionContext.Provider, { value: contributions, children });
|
|
2898
2850
|
}
|
|
2899
2851
|
function useComposerContributions() {
|
|
2900
|
-
return
|
|
2852
|
+
return useContext2(ComposerContributionContext);
|
|
2901
2853
|
}
|
|
2902
2854
|
|
|
2903
2855
|
// src/front/chat/pi/piChatMessageMetadata.ts
|
|
@@ -3414,7 +3366,6 @@ function messageCreatedAtMs(message) {
|
|
|
3414
3366
|
}
|
|
3415
3367
|
|
|
3416
3368
|
// src/front/chat/gatewayResponseError.ts
|
|
3417
|
-
var RUNTIME_SCOPE_MISMATCH_MESSAGE = "This chat belongs to a previous runtime configuration and can no longer be changed.";
|
|
3418
3369
|
var GatewayResponseError = class extends Error {
|
|
3419
3370
|
constructor(status, message, code3, details, body, operation) {
|
|
3420
3371
|
super(message);
|
|
@@ -3441,7 +3392,7 @@ function gatewayResponseErrorFromBody(status, body, fallbackMessage, operation)
|
|
|
3441
3392
|
const payload = errorPayload(body);
|
|
3442
3393
|
const code3 = gatewayResponseErrorCode(payload?.code);
|
|
3443
3394
|
const serverMessage = typeof payload?.message === "string" && payload.message.trim().length > 0 ? payload.message : fallbackMessage;
|
|
3444
|
-
const message =
|
|
3395
|
+
const message = serverMessage;
|
|
3445
3396
|
const details = isJsonValue(payload?.details) ? payload.details : void 0;
|
|
3446
3397
|
return new GatewayResponseError(status, message, code3, details, body, operation);
|
|
3447
3398
|
}
|
|
@@ -3455,9 +3406,6 @@ function errorResponseCode(error) {
|
|
|
3455
3406
|
const record = typeof error === "object" && error !== null ? error : void 0;
|
|
3456
3407
|
return gatewayResponseErrorCode(record?.code ?? record?.errorCode);
|
|
3457
3408
|
}
|
|
3458
|
-
function isRuntimeScopeMismatchError(error) {
|
|
3459
|
-
return errorResponseCode(error) === AgentGatewayErrorCode.AGENT_SESSION_RUNTIME_SCOPE_MISMATCH;
|
|
3460
|
-
}
|
|
3461
3409
|
async function safeReadJson(response) {
|
|
3462
3410
|
const text = await response.text();
|
|
3463
3411
|
if (!text) return void 0;
|
|
@@ -3859,20 +3807,6 @@ function piChatReducer(state, action) {
|
|
|
3859
3807
|
dismissible: true
|
|
3860
3808
|
})
|
|
3861
3809
|
};
|
|
3862
|
-
case "terminal-session-error":
|
|
3863
|
-
return {
|
|
3864
|
-
...state,
|
|
3865
|
-
status: "error",
|
|
3866
|
-
hydrated: true,
|
|
3867
|
-
connection: { ...state.connection, state: "suspended" },
|
|
3868
|
-
retryNotice: void 0,
|
|
3869
|
-
notices: upsertNotice(state.notices, {
|
|
3870
|
-
id: "terminal-session-error",
|
|
3871
|
-
level: "error",
|
|
3872
|
-
text: action.message,
|
|
3873
|
-
errorCode: action.errorCode
|
|
3874
|
-
})
|
|
3875
|
-
};
|
|
3876
3810
|
case "clear-notice":
|
|
3877
3811
|
return { ...state, notices: state.notices.filter((notice) => notice.id !== action.id) };
|
|
3878
3812
|
}
|
|
@@ -4798,10 +4732,6 @@ var RemotePiSession = class {
|
|
|
4798
4732
|
this.connectEvents(snapshot.seq, generation);
|
|
4799
4733
|
} catch (error) {
|
|
4800
4734
|
if (!this.isHydrationActive(generation, hydrationRunId) || isAbortError(error)) return;
|
|
4801
|
-
if (isRuntimeScopeMismatchError(error)) {
|
|
4802
|
-
this.dispatchTerminalSessionError(error);
|
|
4803
|
-
return;
|
|
4804
|
-
}
|
|
4805
4735
|
this.dispatchProtocolError(errorMessage(error, "Failed to hydrate Pi chat session state."));
|
|
4806
4736
|
this.scheduleReconnect(generation);
|
|
4807
4737
|
}
|
|
@@ -4874,12 +4804,8 @@ var RemotePiSession = class {
|
|
|
4874
4804
|
`Pi chat event stream failed with HTTP ${response.status}.`,
|
|
4875
4805
|
"events"
|
|
4876
4806
|
);
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
} else {
|
|
4880
|
-
this.dispatchProtocolError(responseError.message);
|
|
4881
|
-
this.scheduleReconnect(generation);
|
|
4882
|
-
}
|
|
4807
|
+
this.dispatchProtocolError(responseError.message);
|
|
4808
|
+
this.scheduleReconnect(generation);
|
|
4883
4809
|
markOpen();
|
|
4884
4810
|
return;
|
|
4885
4811
|
}
|
|
@@ -5066,20 +4992,6 @@ var RemotePiSession = class {
|
|
|
5066
4992
|
const error = { code: ErrorCode.enum.INTERNAL_ERROR, message, retryable: true };
|
|
5067
4993
|
this.store.dispatch({ type: "protocol-error", error }, { flush: true });
|
|
5068
4994
|
}
|
|
5069
|
-
dispatchTerminalSessionError(error) {
|
|
5070
|
-
if (this.disposed) return;
|
|
5071
|
-
const errorCode = errorResponseCode(error);
|
|
5072
|
-
if (!errorCode) {
|
|
5073
|
-
this.dispatchProtocolError(errorMessage(error, "Chat session is unavailable."));
|
|
5074
|
-
return;
|
|
5075
|
-
}
|
|
5076
|
-
this.suspendStream();
|
|
5077
|
-
this.store.dispatch({
|
|
5078
|
-
type: "terminal-session-error",
|
|
5079
|
-
message: errorMessage(error, "Chat session is unavailable."),
|
|
5080
|
-
errorCode
|
|
5081
|
-
}, { flush: true });
|
|
5082
|
-
}
|
|
5083
4995
|
recordEventType(type) {
|
|
5084
4996
|
this.recentEventTypes.push(type);
|
|
5085
4997
|
if (this.recentEventTypes.length > EVENT_TYPE_RING_LIMIT) this.recentEventTypes.shift();
|
|
@@ -5887,7 +5799,7 @@ function clearRetryTimer(ref) {
|
|
|
5887
5799
|
import { useMemo as useMemo5 } from "react";
|
|
5888
5800
|
import { ChevronLeftIcon, PlusIcon, Trash2Icon } from "lucide-react";
|
|
5889
5801
|
import { IconButton } from "@hachej/boring-ui-kit";
|
|
5890
|
-
import { Fragment as Fragment5, jsx as
|
|
5802
|
+
import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5891
5803
|
var DAY_MS = 24 * 60 * 60 * 1e3;
|
|
5892
5804
|
function SessionList({
|
|
5893
5805
|
sessions,
|
|
@@ -5903,7 +5815,7 @@ function SessionList({
|
|
|
5903
5815
|
className
|
|
5904
5816
|
}) {
|
|
5905
5817
|
const groups = useMemo5(() => groupSessions(sessions), [sessions]);
|
|
5906
|
-
return /* @__PURE__ */
|
|
5818
|
+
return /* @__PURE__ */ jsxs11(
|
|
5907
5819
|
"div",
|
|
5908
5820
|
{
|
|
5909
5821
|
"data-boring-agent-part": "session-list",
|
|
@@ -5912,27 +5824,27 @@ function SessionList({
|
|
|
5912
5824
|
"aria-label": "Session history",
|
|
5913
5825
|
"aria-busy": loading ? "true" : void 0,
|
|
5914
5826
|
children: [
|
|
5915
|
-
/* @__PURE__ */
|
|
5916
|
-
/* @__PURE__ */
|
|
5917
|
-
/* @__PURE__ */
|
|
5918
|
-
onCreate ? /* @__PURE__ */
|
|
5919
|
-
onClose ? /* @__PURE__ */
|
|
5827
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
|
|
5828
|
+
/* @__PURE__ */ jsx12("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
|
|
5829
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-0.5", children: [
|
|
5830
|
+
onCreate ? /* @__PURE__ */ jsx12(IconButton, { type: "button", variant: "ghost", size: "icon-xs", onClick: onCreate, "aria-label": "New session", title: "New chat", children: /* @__PURE__ */ jsx12(PlusIcon, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }) : null,
|
|
5831
|
+
onClose ? /* @__PURE__ */ jsx12(IconButton, { type: "button", variant: "ghost", size: "icon-xs", onClick: onClose, "aria-label": "Close sessions", title: "Close sessions", children: /* @__PURE__ */ jsx12(ChevronLeftIcon, { className: "h-4 w-4", strokeWidth: 1.75 }) }) : null
|
|
5920
5832
|
] })
|
|
5921
5833
|
] }),
|
|
5922
|
-
/* @__PURE__ */
|
|
5923
|
-
sessions.length === 0 ? /* @__PURE__ */
|
|
5834
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex-1 overflow-y-auto py-2.5", children: [
|
|
5835
|
+
sessions.length === 0 ? /* @__PURE__ */ jsxs11("div", { "data-boring-agent-part": "session-list-empty", className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
|
|
5924
5836
|
loading ? "Loading sessions\u2026" : "No sessions yet.",
|
|
5925
|
-
!loading ? /* @__PURE__ */
|
|
5926
|
-
/* @__PURE__ */
|
|
5837
|
+
!loading ? /* @__PURE__ */ jsxs11(Fragment5, { children: [
|
|
5838
|
+
/* @__PURE__ */ jsx12("br", {}),
|
|
5927
5839
|
"Start a new chat to begin."
|
|
5928
5840
|
] }) : null
|
|
5929
5841
|
] }) : null,
|
|
5930
|
-
groups.map((group, index) => /* @__PURE__ */
|
|
5931
|
-
/* @__PURE__ */
|
|
5932
|
-
/* @__PURE__ */
|
|
5933
|
-
/* @__PURE__ */
|
|
5842
|
+
groups.map((group, index) => /* @__PURE__ */ jsxs11("section", { className: cn(index > 0 && "mt-4"), children: [
|
|
5843
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
|
|
5844
|
+
/* @__PURE__ */ jsx12("span", { children: group.label }),
|
|
5845
|
+
/* @__PURE__ */ jsx12("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: group.items.length })
|
|
5934
5846
|
] }),
|
|
5935
|
-
/* @__PURE__ */
|
|
5847
|
+
/* @__PURE__ */ jsx12("ul", { role: "list", className: "flex flex-col", children: group.items.map((session) => /* @__PURE__ */ jsx12(
|
|
5936
5848
|
SessionRow,
|
|
5937
5849
|
{
|
|
5938
5850
|
session,
|
|
@@ -5943,7 +5855,7 @@ function SessionList({
|
|
|
5943
5855
|
session.id
|
|
5944
5856
|
)) })
|
|
5945
5857
|
] }, group.key)),
|
|
5946
|
-
hasMore && onLoadMore ? /* @__PURE__ */
|
|
5858
|
+
hasMore && onLoadMore ? /* @__PURE__ */ jsx12("div", { className: "px-3 py-3", children: /* @__PURE__ */ jsx12(
|
|
5947
5859
|
"button",
|
|
5948
5860
|
{
|
|
5949
5861
|
type: "button",
|
|
@@ -5961,7 +5873,7 @@ function SessionList({
|
|
|
5961
5873
|
var SessionBrowser = SessionList;
|
|
5962
5874
|
function SessionRow({ session, active, onSwitch, onDelete }) {
|
|
5963
5875
|
const time = relativeTime(session.updatedAt);
|
|
5964
|
-
return /* @__PURE__ */
|
|
5876
|
+
return /* @__PURE__ */ jsxs11(
|
|
5965
5877
|
"li",
|
|
5966
5878
|
{
|
|
5967
5879
|
role: "listitem",
|
|
@@ -5974,11 +5886,11 @@ function SessionRow({ session, active, onSwitch, onDelete }) {
|
|
|
5974
5886
|
),
|
|
5975
5887
|
onClick: () => onSwitch?.(session.id),
|
|
5976
5888
|
children: [
|
|
5977
|
-
/* @__PURE__ */
|
|
5978
|
-
/* @__PURE__ */
|
|
5979
|
-
time ? /* @__PURE__ */
|
|
5889
|
+
/* @__PURE__ */ jsxs11("span", { className: "min-w-0 flex-1 truncate leading-5", title: session.title, children: [
|
|
5890
|
+
/* @__PURE__ */ jsx12("span", { className: cn(active ? "font-medium text-foreground" : "text-foreground/90"), children: session.title || "Untitled" }),
|
|
5891
|
+
time ? /* @__PURE__ */ jsx12("span", { className: cn("ml-1.5 tabular-nums text-[11px]", active ? "text-[color:var(--accent)]" : "text-muted-foreground/60"), children: time }) : null
|
|
5980
5892
|
] }),
|
|
5981
|
-
onDelete ? /* @__PURE__ */
|
|
5893
|
+
onDelete ? /* @__PURE__ */ jsx12(
|
|
5982
5894
|
IconButton,
|
|
5983
5895
|
{
|
|
5984
5896
|
type: "button",
|
|
@@ -5990,7 +5902,7 @@ function SessionRow({ session, active, onSwitch, onDelete }) {
|
|
|
5990
5902
|
onDelete(session.id);
|
|
5991
5903
|
},
|
|
5992
5904
|
"aria-label": `Delete ${session.title || "session"}`,
|
|
5993
|
-
children: /* @__PURE__ */
|
|
5905
|
+
children: /* @__PURE__ */ jsx12(Trash2Icon, { className: "h-3 w-3" })
|
|
5994
5906
|
}
|
|
5995
5907
|
) : null
|
|
5996
5908
|
]
|
|
@@ -6241,11 +6153,11 @@ import { useCallback as useCallback14, useEffect as useEffect14, useLayoutEffect
|
|
|
6241
6153
|
import { useStickToBottomContext as useStickToBottomContext2 } from "use-stick-to-bottom";
|
|
6242
6154
|
|
|
6243
6155
|
// src/front/primitives/conversation.tsx
|
|
6244
|
-
import { Button as
|
|
6156
|
+
import { Button as Button6 } from "@hachej/boring-ui-kit";
|
|
6245
6157
|
import { ArrowDownIcon, DownloadIcon as DownloadIcon2 } from "lucide-react";
|
|
6246
6158
|
import { useCallback as useCallback8, useEffect as useEffect9 } from "react";
|
|
6247
6159
|
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
6248
|
-
import { Fragment as Fragment6, jsx as
|
|
6160
|
+
import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6249
6161
|
var ConversationScrollController = ({
|
|
6250
6162
|
onScrollToBottomReady
|
|
6251
6163
|
}) => {
|
|
@@ -6262,7 +6174,7 @@ var Conversation = ({
|
|
|
6262
6174
|
children,
|
|
6263
6175
|
onScrollToBottomReady,
|
|
6264
6176
|
...props
|
|
6265
|
-
}) => /* @__PURE__ */
|
|
6177
|
+
}) => /* @__PURE__ */ jsxs12(
|
|
6266
6178
|
StickToBottom,
|
|
6267
6179
|
{
|
|
6268
6180
|
className: cn("relative flex-1 overflow-y-hidden", className),
|
|
@@ -6271,7 +6183,7 @@ var Conversation = ({
|
|
|
6271
6183
|
role: "log",
|
|
6272
6184
|
...props,
|
|
6273
6185
|
children: [
|
|
6274
|
-
/* @__PURE__ */
|
|
6186
|
+
/* @__PURE__ */ jsx13(ConversationScrollController, { onScrollToBottomReady }),
|
|
6275
6187
|
children
|
|
6276
6188
|
]
|
|
6277
6189
|
}
|
|
@@ -6279,7 +6191,7 @@ var Conversation = ({
|
|
|
6279
6191
|
var ConversationContent = ({
|
|
6280
6192
|
className,
|
|
6281
6193
|
...props
|
|
6282
|
-
}) => /* @__PURE__ */
|
|
6194
|
+
}) => /* @__PURE__ */ jsx13(
|
|
6283
6195
|
StickToBottom.Content,
|
|
6284
6196
|
{
|
|
6285
6197
|
className: cn("flex flex-col gap-8 p-4", className),
|
|
@@ -6294,8 +6206,8 @@ var ConversationScrollButton = ({
|
|
|
6294
6206
|
const handleScrollToBottom = useCallback8(() => {
|
|
6295
6207
|
scrollToBottom();
|
|
6296
6208
|
}, [scrollToBottom]);
|
|
6297
|
-
return !isAtBottom && /* @__PURE__ */
|
|
6298
|
-
|
|
6209
|
+
return !isAtBottom && /* @__PURE__ */ jsx13(
|
|
6210
|
+
Button6,
|
|
6299
6211
|
{
|
|
6300
6212
|
className: cn(
|
|
6301
6213
|
"boring-agent-scroll-latest absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",
|
|
@@ -6307,13 +6219,13 @@ var ConversationScrollButton = ({
|
|
|
6307
6219
|
variant: "outline",
|
|
6308
6220
|
"aria-label": "Scroll to latest message",
|
|
6309
6221
|
...props,
|
|
6310
|
-
children: /* @__PURE__ */
|
|
6222
|
+
children: /* @__PURE__ */ jsx13(ArrowDownIcon, { className: "size-4" })
|
|
6311
6223
|
}
|
|
6312
6224
|
);
|
|
6313
6225
|
};
|
|
6314
6226
|
|
|
6315
6227
|
// src/front/chat/components/ChatNotices.tsx
|
|
6316
|
-
import { AlertCircleIcon, ExternalLinkIcon as ExternalLinkIcon2, ListRestartIcon, Loader2, XIcon as
|
|
6228
|
+
import { AlertCircleIcon, ExternalLinkIcon as ExternalLinkIcon2, ListRestartIcon, Loader2, XIcon as XIcon2 } from "lucide-react";
|
|
6317
6229
|
import { IconButton as IconButton2 } from "@hachej/boring-ui-kit";
|
|
6318
6230
|
|
|
6319
6231
|
// src/front/chat/components/noticeStyles.ts
|
|
@@ -6341,8 +6253,8 @@ function noticeTextClass(className) {
|
|
|
6341
6253
|
|
|
6342
6254
|
// src/front/chat/components/RuntimeNotices.tsx
|
|
6343
6255
|
import { memo as memo2 } from "react";
|
|
6344
|
-
import { AlertTriangleIcon, InfoIcon, Loader2Icon, PlugZapIcon, RefreshCwIcon, XIcon
|
|
6345
|
-
import { Button as
|
|
6256
|
+
import { AlertTriangleIcon, InfoIcon, Loader2Icon, PlugZapIcon, RefreshCwIcon, XIcon } from "lucide-react";
|
|
6257
|
+
import { Button as Button7 } from "@hachej/boring-ui-kit";
|
|
6346
6258
|
|
|
6347
6259
|
// src/front/chat/components/terminalChatErrors.ts
|
|
6348
6260
|
var TERMINAL_CHAT_ERROR_IDS = /* @__PURE__ */ new Set(["chat-error", "session-navigation-error"]);
|
|
@@ -6362,16 +6274,16 @@ function filterCompetingNoiseNotices(notices, historyEmpty) {
|
|
|
6362
6274
|
}
|
|
6363
6275
|
|
|
6364
6276
|
// src/front/chat/components/RuntimeNotices.tsx
|
|
6365
|
-
import { Fragment as Fragment7, jsx as
|
|
6277
|
+
import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6366
6278
|
var RuntimeNotices = memo2(({ notices, onDismiss, onAction, renderAction, historyEmpty, className, ...props }) => {
|
|
6367
6279
|
if (notices.length === 0) return null;
|
|
6368
|
-
return /* @__PURE__ */
|
|
6280
|
+
return /* @__PURE__ */ jsx14(
|
|
6369
6281
|
"div",
|
|
6370
6282
|
{
|
|
6371
6283
|
"data-boring-agent-part": "runtime-notices",
|
|
6372
6284
|
className: cn("flex flex-col gap-2 px-4 py-2", className),
|
|
6373
6285
|
...props,
|
|
6374
|
-
children: notices.map((notice) => /* @__PURE__ */
|
|
6286
|
+
children: notices.map((notice) => /* @__PURE__ */ jsx14(
|
|
6375
6287
|
RuntimeNoticeRow,
|
|
6376
6288
|
{
|
|
6377
6289
|
notice,
|
|
@@ -6392,9 +6304,9 @@ function RuntimeNoticeRow({ notice, onDismiss, onAction, renderAction, historyEm
|
|
|
6392
6304
|
const actionLabel = notice.actionLabel ?? defaultActionLabel(kind);
|
|
6393
6305
|
const hostAction = renderAction?.(notice);
|
|
6394
6306
|
const isTerminalError = isTerminalChatErrorNotice(notice.id, historyEmpty);
|
|
6395
|
-
const explicitAction = actionLabel && onAction ? /* @__PURE__ */
|
|
6396
|
-
const primaryAction = hostAction ?? explicitAction ?? (isTerminalError ? /* @__PURE__ */
|
|
6397
|
-
return /* @__PURE__ */
|
|
6307
|
+
const explicitAction = actionLabel && onAction ? /* @__PURE__ */ jsx14(Button7, { type: "button", variant: "ghost", size: "sm", onClick: () => onAction(notice.id), children: actionLabel }) : null;
|
|
6308
|
+
const primaryAction = hostAction ?? explicitAction ?? (isTerminalError ? /* @__PURE__ */ jsx14(Button7, { type: "button", variant: "outline", size: "sm", className: "shrink-0", onClick: () => window.location.reload(), children: "Reload workspace" }) : null);
|
|
6309
|
+
return /* @__PURE__ */ jsxs13(
|
|
6398
6310
|
"div",
|
|
6399
6311
|
{
|
|
6400
6312
|
role: notice.level === "error" ? "alert" : "status",
|
|
@@ -6408,18 +6320,18 @@ function RuntimeNoticeRow({ notice, onDismiss, onAction, renderAction, historyEm
|
|
|
6408
6320
|
"flex items-start gap-2.5 motion-reduce:transition-none"
|
|
6409
6321
|
),
|
|
6410
6322
|
children: [
|
|
6411
|
-
/* @__PURE__ */
|
|
6412
|
-
/* @__PURE__ */
|
|
6413
|
-
/* @__PURE__ */
|
|
6414
|
-
/* @__PURE__ */
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6417
|
-
/* @__PURE__ */
|
|
6323
|
+
/* @__PURE__ */ jsx14(Icon, { className: cn(noticeIconClass(notice.level), kind === "retry" && "animate-spin motion-reduce:animate-none"), "aria-hidden": "true" }),
|
|
6324
|
+
/* @__PURE__ */ jsx14("div", { className: "min-w-0 flex-1", children: isTerminalError ? /* @__PURE__ */ jsxs13(Fragment7, { children: [
|
|
6325
|
+
/* @__PURE__ */ jsx14("p", { className: "text-sm font-semibold text-foreground", children: "Chat history unavailable" }),
|
|
6326
|
+
/* @__PURE__ */ jsx14("p", { className: noticeTextClass("mt-0.5"), children: "The saved conversation could not be loaded. Reload the workspace to try again." }),
|
|
6327
|
+
/* @__PURE__ */ jsxs13("details", { className: "mt-2 text-xs text-muted-foreground", children: [
|
|
6328
|
+
/* @__PURE__ */ jsx14("summary", { className: "cursor-pointer select-none", children: "Error details" }),
|
|
6329
|
+
/* @__PURE__ */ jsx14("p", { className: "mt-1 break-words", children: notice.text })
|
|
6418
6330
|
] })
|
|
6419
|
-
] }) : /* @__PURE__ */
|
|
6331
|
+
] }) : /* @__PURE__ */ jsx14("p", { className: noticeTextClass(), children: notice.text }) }),
|
|
6420
6332
|
primaryAction,
|
|
6421
|
-
notice.dismissible && onDismiss ? /* @__PURE__ */
|
|
6422
|
-
|
|
6333
|
+
notice.dismissible && onDismiss ? /* @__PURE__ */ jsx14(
|
|
6334
|
+
Button7,
|
|
6423
6335
|
{
|
|
6424
6336
|
type: "button",
|
|
6425
6337
|
variant: "ghost",
|
|
@@ -6427,7 +6339,7 @@ function RuntimeNoticeRow({ notice, onDismiss, onAction, renderAction, historyEm
|
|
|
6427
6339
|
"aria-label": "Dismiss notice",
|
|
6428
6340
|
onClick: () => onDismiss(notice.id),
|
|
6429
6341
|
className: "-mr-1 -mt-1 shrink-0 text-muted-foreground/70 hover:bg-muted hover:text-foreground",
|
|
6430
|
-
children: /* @__PURE__ */
|
|
6342
|
+
children: /* @__PURE__ */ jsx14(XIcon, { className: "size-3" })
|
|
6431
6343
|
}
|
|
6432
6344
|
) : null
|
|
6433
6345
|
]
|
|
@@ -6456,7 +6368,7 @@ function defaultActionLabel(kind) {
|
|
|
6456
6368
|
}
|
|
6457
6369
|
|
|
6458
6370
|
// src/front/chat/components/ChatNotices.tsx
|
|
6459
|
-
import { jsx as
|
|
6371
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6460
6372
|
function RuntimeNoticeMessages({
|
|
6461
6373
|
notices,
|
|
6462
6374
|
onDismiss,
|
|
@@ -6467,7 +6379,7 @@ function RuntimeNoticeMessages({
|
|
|
6467
6379
|
(notice) => notice.level === "error" || notice.level === "warning" || notice.id === "connection-reconnecting" || notice.id === "auto-retry" || notice.id === "large-state-warning" || notice.id.startsWith("command:") || notice.id.startsWith("composer-warning:")
|
|
6468
6380
|
);
|
|
6469
6381
|
if (visible.length === 0) return null;
|
|
6470
|
-
return /* @__PURE__ */
|
|
6382
|
+
return /* @__PURE__ */ jsx15(
|
|
6471
6383
|
RuntimeNotices,
|
|
6472
6384
|
{
|
|
6473
6385
|
notices: visible,
|
|
@@ -6480,42 +6392,42 @@ function RuntimeNoticeMessages({
|
|
|
6480
6392
|
}
|
|
6481
6393
|
function ComposerRuntimeNotice({ notice }) {
|
|
6482
6394
|
const level = notice.code === ErrorCode.enum.AGENT_RUNTIME_NOT_READY ? "info" : "error";
|
|
6483
|
-
return /* @__PURE__ */
|
|
6395
|
+
return /* @__PURE__ */ jsx15(
|
|
6484
6396
|
"div",
|
|
6485
6397
|
{
|
|
6486
6398
|
"data-testid": "chat-composer-runtime-notice",
|
|
6487
6399
|
role: "status",
|
|
6488
6400
|
"aria-live": "polite",
|
|
6489
6401
|
className: noticeSurfaceClass(level, "mx-auto mb-2 w-full max-w-3xl text-xs"),
|
|
6490
|
-
children: /* @__PURE__ */
|
|
6491
|
-
notice.code === ErrorCode.enum.AGENT_RUNTIME_NOT_READY ? /* @__PURE__ */
|
|
6492
|
-
/* @__PURE__ */
|
|
6493
|
-
/* @__PURE__ */
|
|
6494
|
-
notice.detail ? /* @__PURE__ */
|
|
6402
|
+
children: /* @__PURE__ */ jsxs14("div", { className: "flex items-start gap-2", children: [
|
|
6403
|
+
notice.code === ErrorCode.enum.AGENT_RUNTIME_NOT_READY ? /* @__PURE__ */ jsx15(Loader2, { "aria-hidden": "true", className: "mt-0.5 size-3.5 shrink-0 animate-spin text-muted-foreground" }) : /* @__PURE__ */ jsx15(AlertCircleIcon, { "aria-hidden": "true", className: "mt-0.5 size-3.5 shrink-0 text-destructive" }),
|
|
6404
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0", children: [
|
|
6405
|
+
/* @__PURE__ */ jsx15("div", { className: "font-medium", children: notice.title }),
|
|
6406
|
+
notice.detail ? /* @__PURE__ */ jsx15(NoticeText, { className: "mt-0.5 text-muted-foreground", children: notice.detail }) : null
|
|
6495
6407
|
] })
|
|
6496
6408
|
] })
|
|
6497
6409
|
}
|
|
6498
6410
|
);
|
|
6499
6411
|
}
|
|
6500
6412
|
function NoticeText({ className, children }) {
|
|
6501
|
-
return /* @__PURE__ */
|
|
6413
|
+
return /* @__PURE__ */ jsx15("div", { className: noticeTextClass(className), children });
|
|
6502
6414
|
}
|
|
6503
6415
|
function ComposerBlockerNotice({
|
|
6504
6416
|
blocker,
|
|
6505
6417
|
label,
|
|
6506
6418
|
onAction
|
|
6507
6419
|
}) {
|
|
6508
|
-
return /* @__PURE__ */
|
|
6420
|
+
return /* @__PURE__ */ jsxs14(
|
|
6509
6421
|
"div",
|
|
6510
6422
|
{
|
|
6511
6423
|
role: "status",
|
|
6512
6424
|
"aria-live": "polite",
|
|
6513
6425
|
className: noticeSurfaceClass("info", "relative z-20 mx-auto mb-2 w-full max-w-3xl text-xs"),
|
|
6514
6426
|
children: [
|
|
6515
|
-
/* @__PURE__ */
|
|
6427
|
+
/* @__PURE__ */ jsx15("span", { children: label }),
|
|
6516
6428
|
blocker?.actions?.map((action) => {
|
|
6517
6429
|
const icon = composerBlockerActionIcon(action.id);
|
|
6518
|
-
return icon ? /* @__PURE__ */
|
|
6430
|
+
return icon ? /* @__PURE__ */ jsx15(
|
|
6519
6431
|
IconButton2,
|
|
6520
6432
|
{
|
|
6521
6433
|
type: "button",
|
|
@@ -6528,7 +6440,7 @@ function ComposerBlockerNotice({
|
|
|
6528
6440
|
children: icon
|
|
6529
6441
|
},
|
|
6530
6442
|
action.id
|
|
6531
|
-
) : /* @__PURE__ */
|
|
6443
|
+
) : /* @__PURE__ */ jsx15(
|
|
6532
6444
|
"button",
|
|
6533
6445
|
{
|
|
6534
6446
|
type: "button",
|
|
@@ -6544,12 +6456,12 @@ function ComposerBlockerNotice({
|
|
|
6544
6456
|
);
|
|
6545
6457
|
}
|
|
6546
6458
|
function composerBlockerActionIcon(actionId) {
|
|
6547
|
-
if (actionId === "open") return /* @__PURE__ */
|
|
6548
|
-
if (actionId === "cancel") return /* @__PURE__ */
|
|
6459
|
+
if (actionId === "open") return /* @__PURE__ */ jsx15(ExternalLinkIcon2, { className: "size-3.5", "aria-hidden": "true" });
|
|
6460
|
+
if (actionId === "cancel") return /* @__PURE__ */ jsx15(XIcon2, { className: "size-3.5", "aria-hidden": "true" });
|
|
6549
6461
|
return null;
|
|
6550
6462
|
}
|
|
6551
6463
|
function QueuedComposerNotice({ followUps, onEdit }) {
|
|
6552
|
-
return /* @__PURE__ */
|
|
6464
|
+
return /* @__PURE__ */ jsxs14(
|
|
6553
6465
|
"div",
|
|
6554
6466
|
{
|
|
6555
6467
|
"data-boring-agent-part": "composer-queue-preview",
|
|
@@ -6558,15 +6470,15 @@ function QueuedComposerNotice({ followUps, onEdit }) {
|
|
|
6558
6470
|
"border border-dashed border-[color:var(--border)] bg-[color:oklch(from_var(--muted)_l_c_h/0.45)] px-3 py-2 text-xs text-[color:var(--foreground)]"
|
|
6559
6471
|
),
|
|
6560
6472
|
children: [
|
|
6561
|
-
/* @__PURE__ */
|
|
6562
|
-
/* @__PURE__ */
|
|
6473
|
+
/* @__PURE__ */ jsxs14("div", { className: "min-w-0 text-[color:var(--muted-foreground)]", children: [
|
|
6474
|
+
/* @__PURE__ */ jsxs14("div", { className: "font-medium text-[color:var(--foreground)]", children: [
|
|
6563
6475
|
followUps.length,
|
|
6564
6476
|
" queued follow-up",
|
|
6565
6477
|
followUps.length === 1 ? "" : "s"
|
|
6566
6478
|
] }),
|
|
6567
|
-
/* @__PURE__ */
|
|
6479
|
+
/* @__PURE__ */ jsx15("div", { className: "truncate text-[color:var(--muted-foreground)]", "data-boring-agent-part": "composer-queue-preview-text", children: followUps.map((followUp) => followUp.displayText).join(" - ") })
|
|
6568
6480
|
] }),
|
|
6569
|
-
/* @__PURE__ */
|
|
6481
|
+
/* @__PURE__ */ jsx15(
|
|
6570
6482
|
IconButton2,
|
|
6571
6483
|
{
|
|
6572
6484
|
type: "button",
|
|
@@ -6576,7 +6488,7 @@ function QueuedComposerNotice({ followUps, onEdit }) {
|
|
|
6576
6488
|
className: "shrink-0 text-[color:var(--muted-foreground)] hover:bg-[color:var(--muted)] hover:text-[color:var(--foreground)]",
|
|
6577
6489
|
"aria-label": "Edit queued follow-ups",
|
|
6578
6490
|
title: "Edit queued follow-ups",
|
|
6579
|
-
children: /* @__PURE__ */
|
|
6491
|
+
children: /* @__PURE__ */ jsx15(ListRestartIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
6580
6492
|
}
|
|
6581
6493
|
)
|
|
6582
6494
|
]
|
|
@@ -6587,10 +6499,10 @@ function QueuedComposerNotice({ followUps, onEdit }) {
|
|
|
6587
6499
|
// src/front/chat/components/PiTimelineMessage.tsx
|
|
6588
6500
|
import { useCallback as useCallback13, useEffect as useEffect13, useMemo as useMemo12, useRef as useRef10, useState as useState14 } from "react";
|
|
6589
6501
|
import { CheckIcon as CheckIcon2, CopyIcon as CopyIcon3 } from "lucide-react";
|
|
6590
|
-
import { Button as
|
|
6502
|
+
import { Button as Button10 } from "@hachej/boring-ui-kit";
|
|
6591
6503
|
|
|
6592
6504
|
// src/front/primitives/attachments.tsx
|
|
6593
|
-
import { Button as
|
|
6505
|
+
import { Button as Button8, HoverCard, HoverCardContent, HoverCardTrigger } from "@hachej/boring-ui-kit";
|
|
6594
6506
|
import {
|
|
6595
6507
|
FileTextIcon as FileTextIcon2,
|
|
6596
6508
|
GlobeIcon,
|
|
@@ -6598,10 +6510,10 @@ import {
|
|
|
6598
6510
|
Music2Icon,
|
|
6599
6511
|
PaperclipIcon,
|
|
6600
6512
|
VideoIcon,
|
|
6601
|
-
XIcon as
|
|
6513
|
+
XIcon as XIcon3
|
|
6602
6514
|
} from "lucide-react";
|
|
6603
|
-
import { createContext as
|
|
6604
|
-
import { jsx as
|
|
6515
|
+
import { createContext as createContext3, useCallback as useCallback9, useContext as useContext3, useMemo as useMemo6 } from "react";
|
|
6516
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6605
6517
|
var mediaCategoryIcons = {
|
|
6606
6518
|
audio: Music2Icon,
|
|
6607
6519
|
document: FileTextIcon2,
|
|
@@ -6636,7 +6548,7 @@ var getAttachmentLabel = (data) => {
|
|
|
6636
6548
|
const category = getMediaCategory(data);
|
|
6637
6549
|
return data.filename || (category === "image" ? "Image" : "Attachment");
|
|
6638
6550
|
};
|
|
6639
|
-
var renderAttachmentImage = (url, filename, isGrid) => isGrid ? /* @__PURE__ */
|
|
6551
|
+
var renderAttachmentImage = (url, filename, isGrid) => isGrid ? /* @__PURE__ */ jsx16(
|
|
6640
6552
|
"img",
|
|
6641
6553
|
{
|
|
6642
6554
|
alt: filename || "Image",
|
|
@@ -6645,7 +6557,7 @@ var renderAttachmentImage = (url, filename, isGrid) => isGrid ? /* @__PURE__ */
|
|
|
6645
6557
|
src: url,
|
|
6646
6558
|
width: 96
|
|
6647
6559
|
}
|
|
6648
|
-
) : /* @__PURE__ */
|
|
6560
|
+
) : /* @__PURE__ */ jsx16(
|
|
6649
6561
|
"img",
|
|
6650
6562
|
{
|
|
6651
6563
|
alt: filename || "Image",
|
|
@@ -6655,11 +6567,11 @@ var renderAttachmentImage = (url, filename, isGrid) => isGrid ? /* @__PURE__ */
|
|
|
6655
6567
|
width: 20
|
|
6656
6568
|
}
|
|
6657
6569
|
);
|
|
6658
|
-
var AttachmentsContext =
|
|
6659
|
-
var AttachmentContext =
|
|
6660
|
-
var useAttachmentsContext = () =>
|
|
6570
|
+
var AttachmentsContext = createContext3(null);
|
|
6571
|
+
var AttachmentContext = createContext3(null);
|
|
6572
|
+
var useAttachmentsContext = () => useContext3(AttachmentsContext) ?? { variant: "grid" };
|
|
6661
6573
|
var useAttachmentContext = () => {
|
|
6662
|
-
const ctx =
|
|
6574
|
+
const ctx = useContext3(AttachmentContext);
|
|
6663
6575
|
if (!ctx) {
|
|
6664
6576
|
throw new Error("Attachment components must be used within <Attachment>");
|
|
6665
6577
|
}
|
|
@@ -6672,7 +6584,7 @@ var Attachments = ({
|
|
|
6672
6584
|
...props
|
|
6673
6585
|
}) => {
|
|
6674
6586
|
const contextValue = useMemo6(() => ({ variant }), [variant]);
|
|
6675
|
-
return /* @__PURE__ */
|
|
6587
|
+
return /* @__PURE__ */ jsx16(AttachmentsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx16(
|
|
6676
6588
|
"div",
|
|
6677
6589
|
{
|
|
6678
6590
|
className: cn(
|
|
@@ -6699,7 +6611,7 @@ var Attachment = ({
|
|
|
6699
6611
|
() => ({ data, mediaCategory, onRemove, variant }),
|
|
6700
6612
|
[data, mediaCategory, onRemove, variant]
|
|
6701
6613
|
);
|
|
6702
|
-
return /* @__PURE__ */
|
|
6614
|
+
return /* @__PURE__ */ jsx16(AttachmentContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx16(
|
|
6703
6615
|
"div",
|
|
6704
6616
|
{
|
|
6705
6617
|
className: cn(
|
|
@@ -6729,18 +6641,18 @@ var AttachmentPreview = ({
|
|
|
6729
6641
|
}) => {
|
|
6730
6642
|
const { data, mediaCategory, variant } = useAttachmentContext();
|
|
6731
6643
|
const iconSize = variant === "inline" ? "size-3" : "size-4";
|
|
6732
|
-
const renderIcon = (Icon) => /* @__PURE__ */
|
|
6644
|
+
const renderIcon = (Icon) => /* @__PURE__ */ jsx16(Icon, { className: cn(iconSize, "text-muted-foreground") });
|
|
6733
6645
|
const renderContent = () => {
|
|
6734
6646
|
if (mediaCategory === "image" && data.type === "file" && data.url) {
|
|
6735
6647
|
return renderAttachmentImage(data.url, data.filename, variant === "grid");
|
|
6736
6648
|
}
|
|
6737
6649
|
if (mediaCategory === "video" && data.type === "file" && data.url) {
|
|
6738
|
-
return /* @__PURE__ */
|
|
6650
|
+
return /* @__PURE__ */ jsx16("video", { className: "size-full object-cover", muted: true, src: data.url });
|
|
6739
6651
|
}
|
|
6740
6652
|
const Icon = mediaCategoryIcons[mediaCategory];
|
|
6741
6653
|
return fallbackIcon ?? renderIcon(Icon);
|
|
6742
6654
|
};
|
|
6743
|
-
return /* @__PURE__ */
|
|
6655
|
+
return /* @__PURE__ */ jsx16(
|
|
6744
6656
|
"div",
|
|
6745
6657
|
{
|
|
6746
6658
|
className: cn(
|
|
@@ -6765,9 +6677,9 @@ var AttachmentInfo = ({
|
|
|
6765
6677
|
if (variant === "grid") {
|
|
6766
6678
|
return null;
|
|
6767
6679
|
}
|
|
6768
|
-
return /* @__PURE__ */
|
|
6769
|
-
/* @__PURE__ */
|
|
6770
|
-
showMediaType && data.mediaType && /* @__PURE__ */
|
|
6680
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn("min-w-0 flex-1", className), ...props, children: [
|
|
6681
|
+
/* @__PURE__ */ jsx16("span", { className: "block truncate", children: label }),
|
|
6682
|
+
showMediaType && data.mediaType && /* @__PURE__ */ jsx16("span", { className: "block truncate text-muted-foreground text-xs", children: data.mediaType })
|
|
6771
6683
|
] });
|
|
6772
6684
|
};
|
|
6773
6685
|
var AttachmentRemove = ({
|
|
@@ -6787,8 +6699,8 @@ var AttachmentRemove = ({
|
|
|
6787
6699
|
if (!onRemove) {
|
|
6788
6700
|
return null;
|
|
6789
6701
|
}
|
|
6790
|
-
return /* @__PURE__ */
|
|
6791
|
-
|
|
6702
|
+
return /* @__PURE__ */ jsxs15(
|
|
6703
|
+
Button8,
|
|
6792
6704
|
{
|
|
6793
6705
|
"aria-label": label,
|
|
6794
6706
|
className: cn(
|
|
@@ -6812,20 +6724,20 @@ var AttachmentRemove = ({
|
|
|
6812
6724
|
variant: "ghost",
|
|
6813
6725
|
...props,
|
|
6814
6726
|
children: [
|
|
6815
|
-
children ?? /* @__PURE__ */
|
|
6816
|
-
/* @__PURE__ */
|
|
6727
|
+
children ?? /* @__PURE__ */ jsx16(XIcon3, {}),
|
|
6728
|
+
/* @__PURE__ */ jsx16("span", { className: "sr-only", children: label })
|
|
6817
6729
|
]
|
|
6818
6730
|
}
|
|
6819
6731
|
);
|
|
6820
6732
|
};
|
|
6821
6733
|
|
|
6822
6734
|
// src/front/primitives/message.tsx
|
|
6823
|
-
import { Button as
|
|
6735
|
+
import { Button as Button9, ButtonGroup, ButtonGroupText } from "@hachej/boring-ui-kit";
|
|
6824
6736
|
import {
|
|
6825
|
-
Tooltip
|
|
6826
|
-
TooltipContent
|
|
6827
|
-
TooltipProvider
|
|
6828
|
-
TooltipTrigger
|
|
6737
|
+
Tooltip,
|
|
6738
|
+
TooltipContent,
|
|
6739
|
+
TooltipProvider,
|
|
6740
|
+
TooltipTrigger
|
|
6829
6741
|
} from "@hachej/boring-ui-kit";
|
|
6830
6742
|
|
|
6831
6743
|
// src/front/primitives/markdownStyles.ts
|
|
@@ -6838,17 +6750,17 @@ import { math } from "@streamdown/math";
|
|
|
6838
6750
|
import { mermaid } from "@streamdown/mermaid";
|
|
6839
6751
|
import { ChevronLeftIcon as ChevronLeftIcon2, ChevronRightIcon } from "lucide-react";
|
|
6840
6752
|
import {
|
|
6841
|
-
createContext as
|
|
6753
|
+
createContext as createContext4,
|
|
6842
6754
|
memo as memo3,
|
|
6843
6755
|
useCallback as useCallback10,
|
|
6844
|
-
useContext as
|
|
6756
|
+
useContext as useContext4,
|
|
6845
6757
|
useEffect as useEffect10,
|
|
6846
6758
|
useMemo as useMemo7,
|
|
6847
6759
|
useState as useState11
|
|
6848
6760
|
} from "react";
|
|
6849
6761
|
import { Streamdown } from "streamdown";
|
|
6850
|
-
import { jsx as
|
|
6851
|
-
var Message = ({ className, from, ...props }) => /* @__PURE__ */
|
|
6762
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6763
|
+
var Message = ({ className, from, ...props }) => /* @__PURE__ */ jsx17(
|
|
6852
6764
|
"div",
|
|
6853
6765
|
{
|
|
6854
6766
|
"data-boring-agent-message-role": from,
|
|
@@ -6864,7 +6776,7 @@ var MessageContent = ({
|
|
|
6864
6776
|
children,
|
|
6865
6777
|
className,
|
|
6866
6778
|
...props
|
|
6867
|
-
}) => /* @__PURE__ */
|
|
6779
|
+
}) => /* @__PURE__ */ jsx17(
|
|
6868
6780
|
"div",
|
|
6869
6781
|
{
|
|
6870
6782
|
className: cn(
|
|
@@ -6881,7 +6793,7 @@ var MessageActions = ({
|
|
|
6881
6793
|
className,
|
|
6882
6794
|
children,
|
|
6883
6795
|
...props
|
|
6884
|
-
}) => /* @__PURE__ */
|
|
6796
|
+
}) => /* @__PURE__ */ jsx17("div", { className: cn("flex items-center gap-1", className), ...props, children });
|
|
6885
6797
|
var MessageAction = ({
|
|
6886
6798
|
tooltip,
|
|
6887
6799
|
children,
|
|
@@ -6890,19 +6802,19 @@ var MessageAction = ({
|
|
|
6890
6802
|
size = "icon-sm",
|
|
6891
6803
|
...props
|
|
6892
6804
|
}) => {
|
|
6893
|
-
const button = /* @__PURE__ */
|
|
6805
|
+
const button = /* @__PURE__ */ jsxs16(Button9, { size, type: "button", variant, ...props, children: [
|
|
6894
6806
|
children,
|
|
6895
|
-
/* @__PURE__ */
|
|
6807
|
+
/* @__PURE__ */ jsx17("span", { className: "sr-only", children: label || tooltip })
|
|
6896
6808
|
] });
|
|
6897
6809
|
if (tooltip) {
|
|
6898
|
-
return /* @__PURE__ */
|
|
6899
|
-
/* @__PURE__ */
|
|
6900
|
-
/* @__PURE__ */
|
|
6810
|
+
return /* @__PURE__ */ jsx17(TooltipProvider, { children: /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
6811
|
+
/* @__PURE__ */ jsx17(TooltipTrigger, { asChild: true, children: button }),
|
|
6812
|
+
/* @__PURE__ */ jsx17(TooltipContent, { children: /* @__PURE__ */ jsx17("p", { children: tooltip }) })
|
|
6901
6813
|
] }) });
|
|
6902
6814
|
}
|
|
6903
6815
|
return button;
|
|
6904
6816
|
};
|
|
6905
|
-
var MessageBranchContext =
|
|
6817
|
+
var MessageBranchContext = createContext4(
|
|
6906
6818
|
null
|
|
6907
6819
|
);
|
|
6908
6820
|
var streamdownPlugins = { cjk, code, math, mermaid };
|
|
@@ -6938,9 +6850,9 @@ function extractCodeBlockText(children) {
|
|
|
6938
6850
|
var MarkdownPre = ({ children, filename }) => {
|
|
6939
6851
|
const code3 = extractCodeBlockText(children).replace(/\n$/, "");
|
|
6940
6852
|
const language = extractCodeBlockLanguage(children);
|
|
6941
|
-
return /* @__PURE__ */
|
|
6942
|
-
/* @__PURE__ */
|
|
6943
|
-
/* @__PURE__ */
|
|
6853
|
+
return /* @__PURE__ */ jsx17(CodeBlock2, { code: code3, language: language ?? "text", className: "my-3", children: /* @__PURE__ */ jsxs16(CodeBlockHeader, { children: [
|
|
6854
|
+
/* @__PURE__ */ jsx17(CodeBlockTitle, { children: /* @__PURE__ */ jsx17(CodeBlockFilename, { children: filename ?? language ?? "text" }) }),
|
|
6855
|
+
/* @__PURE__ */ jsx17(CodeBlockCopyButton, {})
|
|
6944
6856
|
] }) });
|
|
6945
6857
|
};
|
|
6946
6858
|
var MarkdownCode = ({
|
|
@@ -6950,9 +6862,9 @@ var MarkdownCode = ({
|
|
|
6950
6862
|
...props
|
|
6951
6863
|
}) => {
|
|
6952
6864
|
if (inline === false) {
|
|
6953
|
-
return /* @__PURE__ */
|
|
6865
|
+
return /* @__PURE__ */ jsx17("code", { className, ...props, children });
|
|
6954
6866
|
}
|
|
6955
|
-
return /* @__PURE__ */
|
|
6867
|
+
return /* @__PURE__ */ jsx17(
|
|
6956
6868
|
"code",
|
|
6957
6869
|
{
|
|
6958
6870
|
className: cn(
|
|
@@ -6969,7 +6881,7 @@ var markdownComponents = {
|
|
|
6969
6881
|
code: MarkdownCode
|
|
6970
6882
|
};
|
|
6971
6883
|
var MessageResponse = memo3(
|
|
6972
|
-
({ className, shikiTheme, components, codeFilename, ...props }) => /* @__PURE__ */
|
|
6884
|
+
({ className, shikiTheme, components, codeFilename, ...props }) => /* @__PURE__ */ jsx17(
|
|
6973
6885
|
Streamdown,
|
|
6974
6886
|
{
|
|
6975
6887
|
className: cn(
|
|
@@ -6981,7 +6893,7 @@ var MessageResponse = memo3(
|
|
|
6981
6893
|
components: {
|
|
6982
6894
|
...markdownComponents,
|
|
6983
6895
|
...components ?? {},
|
|
6984
|
-
...codeFilename ? { pre: (props2) => /* @__PURE__ */
|
|
6896
|
+
...codeFilename ? { pre: (props2) => /* @__PURE__ */ jsx17(MarkdownPre, { ...props2, filename: codeFilename }) } : {}
|
|
6985
6897
|
},
|
|
6986
6898
|
...props
|
|
6987
6899
|
}
|
|
@@ -7003,10 +6915,10 @@ import { math as math2 } from "@streamdown/math";
|
|
|
7003
6915
|
import { mermaid as mermaid2 } from "@streamdown/mermaid";
|
|
7004
6916
|
import { BrainIcon, ChevronDownIcon as ChevronDownIcon3 } from "lucide-react";
|
|
7005
6917
|
import {
|
|
7006
|
-
createContext as
|
|
6918
|
+
createContext as createContext5,
|
|
7007
6919
|
memo as memo5,
|
|
7008
6920
|
useCallback as useCallback11,
|
|
7009
|
-
useContext as
|
|
6921
|
+
useContext as useContext5,
|
|
7010
6922
|
useEffect as useEffect11,
|
|
7011
6923
|
useMemo as useMemo9,
|
|
7012
6924
|
useRef as useRef9,
|
|
@@ -7017,7 +6929,7 @@ import { Streamdown as Streamdown2 } from "streamdown";
|
|
|
7017
6929
|
// src/front/primitives/shimmer.tsx
|
|
7018
6930
|
import { motion } from "motion/react";
|
|
7019
6931
|
import { memo as memo4, useMemo as useMemo8 } from "react";
|
|
7020
|
-
import { jsx as
|
|
6932
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
7021
6933
|
var motionComponentCache = /* @__PURE__ */ new Map();
|
|
7022
6934
|
var getMotionComponent = (element) => {
|
|
7023
6935
|
let component = motionComponentCache.get(element);
|
|
@@ -7041,7 +6953,7 @@ var ShimmerComponent = ({
|
|
|
7041
6953
|
() => (children?.length ?? 0) * spread,
|
|
7042
6954
|
[children, spread]
|
|
7043
6955
|
);
|
|
7044
|
-
return /* @__PURE__ */
|
|
6956
|
+
return /* @__PURE__ */ jsx18(
|
|
7045
6957
|
MotionComponent,
|
|
7046
6958
|
{
|
|
7047
6959
|
animate: { backgroundPosition: "0% center" },
|
|
@@ -7067,10 +6979,10 @@ var ShimmerComponent = ({
|
|
|
7067
6979
|
var Shimmer = memo4(ShimmerComponent);
|
|
7068
6980
|
|
|
7069
6981
|
// src/front/primitives/reasoning.tsx
|
|
7070
|
-
import { Fragment as Fragment8, jsx as
|
|
7071
|
-
var ReasoningContext =
|
|
6982
|
+
import { Fragment as Fragment8, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6983
|
+
var ReasoningContext = createContext5(null);
|
|
7072
6984
|
var useReasoning = () => {
|
|
7073
|
-
const context =
|
|
6985
|
+
const context = useContext5(ReasoningContext);
|
|
7074
6986
|
if (!context) {
|
|
7075
6987
|
throw new Error("Reasoning components must be used within Reasoning");
|
|
7076
6988
|
}
|
|
@@ -7139,7 +7051,7 @@ var Reasoning = memo5(
|
|
|
7139
7051
|
() => ({ duration, isOpen, isStreaming, setIsOpen }),
|
|
7140
7052
|
[duration, isOpen, isStreaming, setIsOpen]
|
|
7141
7053
|
);
|
|
7142
|
-
return /* @__PURE__ */
|
|
7054
|
+
return /* @__PURE__ */ jsx19(ReasoningContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx19(
|
|
7143
7055
|
Collapsible2,
|
|
7144
7056
|
{
|
|
7145
7057
|
className: cn("not-prose mb-2", className),
|
|
@@ -7153,12 +7065,12 @@ var Reasoning = memo5(
|
|
|
7153
7065
|
);
|
|
7154
7066
|
var defaultGetThinkingMessage = (isStreaming, duration) => {
|
|
7155
7067
|
if (isStreaming || duration === 0) {
|
|
7156
|
-
return /* @__PURE__ */
|
|
7068
|
+
return /* @__PURE__ */ jsx19(Shimmer, { duration: 1, children: "thinking" });
|
|
7157
7069
|
}
|
|
7158
7070
|
if (duration === void 0) {
|
|
7159
|
-
return /* @__PURE__ */
|
|
7071
|
+
return /* @__PURE__ */ jsx19("span", { children: "thoughts" });
|
|
7160
7072
|
}
|
|
7161
|
-
return /* @__PURE__ */
|
|
7073
|
+
return /* @__PURE__ */ jsxs17("span", { children: [
|
|
7162
7074
|
"thoughts \xB7 ",
|
|
7163
7075
|
duration,
|
|
7164
7076
|
"s"
|
|
@@ -7172,7 +7084,7 @@ var ReasoningTrigger = memo5(
|
|
|
7172
7084
|
...props
|
|
7173
7085
|
}) => {
|
|
7174
7086
|
const { isStreaming, isOpen, duration } = useReasoning();
|
|
7175
|
-
return /* @__PURE__ */
|
|
7087
|
+
return /* @__PURE__ */ jsx19(
|
|
7176
7088
|
CollapsibleTrigger3,
|
|
7177
7089
|
{
|
|
7178
7090
|
className: cn(
|
|
@@ -7180,10 +7092,10 @@ var ReasoningTrigger = memo5(
|
|
|
7180
7092
|
className
|
|
7181
7093
|
),
|
|
7182
7094
|
...props,
|
|
7183
|
-
children: children ?? /* @__PURE__ */
|
|
7184
|
-
/* @__PURE__ */
|
|
7095
|
+
children: children ?? /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
7096
|
+
/* @__PURE__ */ jsx19(BrainIcon, { className: "size-3" }),
|
|
7185
7097
|
getThinkingMessage(isStreaming, duration),
|
|
7186
|
-
/* @__PURE__ */
|
|
7098
|
+
/* @__PURE__ */ jsx19(
|
|
7187
7099
|
ChevronDownIcon3,
|
|
7188
7100
|
{
|
|
7189
7101
|
className: cn(
|
|
@@ -7199,7 +7111,7 @@ var ReasoningTrigger = memo5(
|
|
|
7199
7111
|
);
|
|
7200
7112
|
var streamdownPlugins2 = { cjk: cjk2, code: code2, math: math2, mermaid: mermaid2 };
|
|
7201
7113
|
var ReasoningContent = memo5(
|
|
7202
|
-
({ className, children, ...props }) => /* @__PURE__ */
|
|
7114
|
+
({ className, children, ...props }) => /* @__PURE__ */ jsx19(
|
|
7203
7115
|
CollapsibleContent2,
|
|
7204
7116
|
{
|
|
7205
7117
|
className: cn(
|
|
@@ -7208,7 +7120,7 @@ var ReasoningContent = memo5(
|
|
|
7208
7120
|
className
|
|
7209
7121
|
),
|
|
7210
7122
|
...props,
|
|
7211
|
-
children: /* @__PURE__ */
|
|
7123
|
+
children: /* @__PURE__ */ jsx19(Streamdown2, { plugins: streamdownPlugins2, children })
|
|
7212
7124
|
}
|
|
7213
7125
|
)
|
|
7214
7126
|
);
|
|
@@ -7257,7 +7169,7 @@ var TOOL_GROUP_VISUAL_PRESENTATION = {
|
|
|
7257
7169
|
};
|
|
7258
7170
|
|
|
7259
7171
|
// src/front/primitives/tool-call-group.tsx
|
|
7260
|
-
import { jsx as
|
|
7172
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7261
7173
|
function isInputRunningState(state) {
|
|
7262
7174
|
return state === "input-streaming" || state === "input-available";
|
|
7263
7175
|
}
|
|
@@ -7346,7 +7258,7 @@ var ToolCallGroup = memo6(({ tools, mergedToolRenderers }) => {
|
|
|
7346
7258
|
const { renderer } = resolveToolRendererForPart(part, mergedToolRenderers);
|
|
7347
7259
|
return renderer.presentation === "inline" ? [key] : [];
|
|
7348
7260
|
}));
|
|
7349
|
-
return /* @__PURE__ */
|
|
7261
|
+
return /* @__PURE__ */ jsxs18(
|
|
7350
7262
|
Collapsible3,
|
|
7351
7263
|
{
|
|
7352
7264
|
open: isOpen,
|
|
@@ -7357,9 +7269,9 @@ var ToolCallGroup = memo6(({ tools, mergedToolRenderers }) => {
|
|
|
7357
7269
|
toolParts.map(({ part, key }) => {
|
|
7358
7270
|
if (!inlineToolKeys.has(key)) return null;
|
|
7359
7271
|
const { renderer, part: resolvedPart, resolution } = resolveToolRendererForPart(part, mergedToolRenderers);
|
|
7360
|
-
return /* @__PURE__ */
|
|
7272
|
+
return /* @__PURE__ */ jsx20("div", { "data-boring-agent-part": "inline-tool-renderer", "data-tool-call-id": resolvedPart.toolCallId, "data-tool-renderer-key": resolution.key, children: renderer(resolvedPart) }, key);
|
|
7361
7273
|
}),
|
|
7362
|
-
/* @__PURE__ */
|
|
7274
|
+
/* @__PURE__ */ jsxs18(
|
|
7363
7275
|
CollapsibleTrigger4,
|
|
7364
7276
|
{
|
|
7365
7277
|
"aria-label": `Tool calls: ${title}`,
|
|
@@ -7371,7 +7283,7 @@ var ToolCallGroup = memo6(({ tools, mergedToolRenderers }) => {
|
|
|
7371
7283
|
TOOL_GROUP_VISUAL_PRESENTATION[visualState].triggerClassName
|
|
7372
7284
|
),
|
|
7373
7285
|
children: [
|
|
7374
|
-
/* @__PURE__ */
|
|
7286
|
+
/* @__PURE__ */ jsx20("span", { className: "flex size-4 shrink-0 items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsx20(
|
|
7375
7287
|
"span",
|
|
7376
7288
|
{
|
|
7377
7289
|
"data-boring-agent-part": "tool-group-state-dot",
|
|
@@ -7381,10 +7293,10 @@ var ToolCallGroup = memo6(({ tools, mergedToolRenderers }) => {
|
|
|
7381
7293
|
)
|
|
7382
7294
|
}
|
|
7383
7295
|
) }),
|
|
7384
|
-
/* @__PURE__ */
|
|
7385
|
-
elapsedLabel ? /* @__PURE__ */
|
|
7386
|
-
/* @__PURE__ */
|
|
7387
|
-
/* @__PURE__ */
|
|
7296
|
+
/* @__PURE__ */ jsx20("span", { "data-boring-agent-part": "tool-group-title", children: workspaceNotReady ? workspaceNotReady.message : title }),
|
|
7297
|
+
elapsedLabel ? /* @__PURE__ */ jsx20("span", { className: "ml-1 shrink-0 tabular-nums text-[12px] text-muted-foreground/70", children: elapsedLabel }) : null,
|
|
7298
|
+
/* @__PURE__ */ jsx20("span", { className: "ml-1 shrink-0 tabular-nums text-[12px] text-muted-foreground/70", children: toolParts.length }),
|
|
7299
|
+
/* @__PURE__ */ jsx20(
|
|
7388
7300
|
ChevronDownIcon4,
|
|
7389
7301
|
{
|
|
7390
7302
|
className: cn(
|
|
@@ -7396,19 +7308,19 @@ var ToolCallGroup = memo6(({ tools, mergedToolRenderers }) => {
|
|
|
7396
7308
|
]
|
|
7397
7309
|
}
|
|
7398
7310
|
),
|
|
7399
|
-
/* @__PURE__ */
|
|
7311
|
+
/* @__PURE__ */ jsx20(CollapsibleContent3, { className: "overflow-hidden data-[state=closed]:animate-[boring-collapse-close_200ms_ease] data-[state=open]:animate-[boring-collapse-open_200ms_ease]", children: /* @__PURE__ */ jsxs18(
|
|
7400
7312
|
"div",
|
|
7401
7313
|
{
|
|
7402
7314
|
"data-boring-agent-part": "tool-group-details",
|
|
7403
7315
|
className: "relative mt-1.5 w-full max-w-2xl pl-[18px]",
|
|
7404
7316
|
children: [
|
|
7405
|
-
/* @__PURE__ */
|
|
7406
|
-
/* @__PURE__ */
|
|
7317
|
+
/* @__PURE__ */ jsx20("div", { className: "absolute left-[5px] top-0 bottom-2 w-px bg-border/35" }),
|
|
7318
|
+
/* @__PURE__ */ jsx20("div", { className: "flex min-w-0 flex-col gap-1.5 [&_[data-boring-agent-part=tool-card]]:!my-0", children: toolParts.map(({ part, key }) => {
|
|
7407
7319
|
const { renderer, part: resolvedPart, resolution } = resolveToolRendererForPart(
|
|
7408
7320
|
part,
|
|
7409
7321
|
inlineToolKeys.has(key) ? {} : mergedToolRenderers
|
|
7410
7322
|
);
|
|
7411
|
-
return /* @__PURE__ */
|
|
7323
|
+
return /* @__PURE__ */ jsx20(
|
|
7412
7324
|
"div",
|
|
7413
7325
|
{
|
|
7414
7326
|
className: "min-w-0",
|
|
@@ -7430,22 +7342,22 @@ var ToolCallGroup = memo6(({ tools, mergedToolRenderers }) => {
|
|
|
7430
7342
|
ToolCallGroup.displayName = "ToolCallGroup";
|
|
7431
7343
|
|
|
7432
7344
|
// src/front/chat/messageContributions.tsx
|
|
7433
|
-
import { createContext as
|
|
7434
|
-
import { jsx as
|
|
7435
|
-
var ChatMessageContributionContext =
|
|
7345
|
+
import { createContext as createContext6, createElement, useContext as useContext6, useMemo as useMemo11 } from "react";
|
|
7346
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
7347
|
+
var ChatMessageContributionContext = createContext6([]);
|
|
7436
7348
|
function ChatMessageContributionProvider({
|
|
7437
7349
|
contribution,
|
|
7438
7350
|
children
|
|
7439
7351
|
}) {
|
|
7440
|
-
const parent =
|
|
7352
|
+
const parent = useContext6(ChatMessageContributionContext);
|
|
7441
7353
|
const contributions = useMemo11(
|
|
7442
7354
|
() => [contribution, ...parent.filter((entry) => entry.id !== contribution.id)],
|
|
7443
7355
|
[contribution, parent]
|
|
7444
7356
|
);
|
|
7445
|
-
return /* @__PURE__ */
|
|
7357
|
+
return /* @__PURE__ */ jsx21(ChatMessageContributionContext.Provider, { value: contributions, children });
|
|
7446
7358
|
}
|
|
7447
7359
|
function useCustomChatMessage(message) {
|
|
7448
|
-
const contributions =
|
|
7360
|
+
const contributions = useContext6(ChatMessageContributionContext);
|
|
7449
7361
|
const contribution = contributions.find((entry) => entry.matches(message));
|
|
7450
7362
|
return contribution ? createElement(contribution.Component, { message }) : void 0;
|
|
7451
7363
|
}
|
|
@@ -7459,7 +7371,7 @@ function ChatMessageContributionBoundary({
|
|
|
7459
7371
|
|
|
7460
7372
|
// src/front/chat/components/MessageMentions.tsx
|
|
7461
7373
|
import { Children, cloneElement, isValidElement as isValidElement2 } from "react";
|
|
7462
|
-
import { Fragment as Fragment9, jsx as
|
|
7374
|
+
import { Fragment as Fragment9, jsx as jsx22 } from "react/jsx-runtime";
|
|
7463
7375
|
var TERMINAL_BOUNDARY = String.raw`(?=$|\s|[.,;!?)}\]"'”’]+(?=$|\s))`;
|
|
7464
7376
|
var PREFIX_BOUNDARY = String.raw`(^|[\s(\[{"'“‘])`;
|
|
7465
7377
|
function escapeRegExp2(value) {
|
|
@@ -7568,7 +7480,7 @@ function MessageMentions({
|
|
|
7568
7480
|
}).map((segment, segmentIndex) => {
|
|
7569
7481
|
if (!segment.mention) return segment.text;
|
|
7570
7482
|
const actionLabel = mentionActionLabel(segment.mention);
|
|
7571
|
-
return /* @__PURE__ */
|
|
7483
|
+
return /* @__PURE__ */ jsx22(
|
|
7572
7484
|
"button",
|
|
7573
7485
|
{
|
|
7574
7486
|
type: "button",
|
|
@@ -7594,7 +7506,7 @@ function MessageMentions({
|
|
|
7594
7506
|
return cloneElement(
|
|
7595
7507
|
element,
|
|
7596
7508
|
void 0,
|
|
7597
|
-
/* @__PURE__ */
|
|
7509
|
+
/* @__PURE__ */ jsx22(
|
|
7598
7510
|
MessageMentions,
|
|
7599
7511
|
{
|
|
7600
7512
|
catalog,
|
|
@@ -7612,19 +7524,19 @@ function MessageMentions({
|
|
|
7612
7524
|
return nodes.map(decorate);
|
|
7613
7525
|
}
|
|
7614
7526
|
function createMessageMentionMarkdownComponents(catalog, onActivate) {
|
|
7615
|
-
const decorate = (children) => /* @__PURE__ */
|
|
7527
|
+
const decorate = (children) => /* @__PURE__ */ jsx22(MessageMentions, { catalog, onActivate, children });
|
|
7616
7528
|
const paragraph = ({ node: _node, children, ...props }) => {
|
|
7617
7529
|
const content = Children.toArray(children).filter((child) => child !== null && child !== "");
|
|
7618
7530
|
if (content.length === 1 && isValidElement2(content[0])) {
|
|
7619
7531
|
const child = content[0];
|
|
7620
|
-
if (child.props.node?.tagName === "img") return /* @__PURE__ */
|
|
7621
|
-
if (child.props.node?.tagName === "code" && "data-block" in child.props) return /* @__PURE__ */
|
|
7532
|
+
if (child.props.node?.tagName === "img") return /* @__PURE__ */ jsx22(Fragment9, { children });
|
|
7533
|
+
if (child.props.node?.tagName === "code" && "data-block" in child.props) return /* @__PURE__ */ jsx22(Fragment9, { children });
|
|
7622
7534
|
}
|
|
7623
|
-
return /* @__PURE__ */
|
|
7535
|
+
return /* @__PURE__ */ jsx22("p", { ...props, children: decorate(children) });
|
|
7624
7536
|
};
|
|
7625
|
-
const tableHeader = ({ node: _node, children, className, ...props }) => /* @__PURE__ */
|
|
7626
|
-
const tableCell = ({ node: _node, children, className, ...props }) => /* @__PURE__ */
|
|
7627
|
-
const listItem = ({ node: _node, children, className, ...props }) => /* @__PURE__ */
|
|
7537
|
+
const tableHeader = ({ node: _node, children, className, ...props }) => /* @__PURE__ */ jsx22("th", { ...props, "data-streamdown": "table-header-cell", className: cn("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm", className), children: decorate(children) });
|
|
7538
|
+
const tableCell = ({ node: _node, children, className, ...props }) => /* @__PURE__ */ jsx22("td", { ...props, "data-streamdown": "table-cell", className: cn("px-4 py-2 text-sm", className), children: decorate(children) });
|
|
7539
|
+
const listItem = ({ node: _node, children, className, ...props }) => /* @__PURE__ */ jsx22("li", { ...props, "data-streamdown": "list-item", className: cn("py-1 [&>p]:inline", className), children: decorate(children) });
|
|
7628
7540
|
const headingClasses = {
|
|
7629
7541
|
h1: "text-3xl",
|
|
7630
7542
|
h2: "text-2xl",
|
|
@@ -7633,8 +7545,8 @@ function createMessageMentionMarkdownComponents(catalog, onActivate) {
|
|
|
7633
7545
|
h5: "text-base",
|
|
7634
7546
|
h6: "text-sm"
|
|
7635
7547
|
};
|
|
7636
|
-
const heading = (Tag) => ({ node: _node, children, className, ...props }) => /* @__PURE__ */
|
|
7637
|
-
const inlineCode = ({ node: _node, children, className, ...props }) => /* @__PURE__ */
|
|
7548
|
+
const heading = (Tag) => ({ node: _node, children, className, ...props }) => /* @__PURE__ */ jsx22(Tag, { ...props, "data-streamdown": `heading-${Tag.slice(1)}`, className: cn("mt-6 mb-2 font-semibold", headingClasses[Tag], className), children: decorate(children) });
|
|
7549
|
+
const inlineCode = ({ node: _node, children, className, ...props }) => /* @__PURE__ */ jsx22(
|
|
7638
7550
|
"code",
|
|
7639
7551
|
{
|
|
7640
7552
|
...props,
|
|
@@ -7658,7 +7570,7 @@ function createMessageMentionMarkdownComponents(catalog, onActivate) {
|
|
|
7658
7570
|
}
|
|
7659
7571
|
|
|
7660
7572
|
// src/front/chat/components/PiTimelineMessage.tsx
|
|
7661
|
-
import { jsx as
|
|
7573
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7662
7574
|
var EMPTY_MENTION_CATALOG = { commands: [], skills: [], files: false };
|
|
7663
7575
|
var COLLAPSIBLE_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
7664
7576
|
"read",
|
|
@@ -7674,7 +7586,7 @@ function isCollapsibleTool(part) {
|
|
|
7674
7586
|
return part.type === "tool-call" && COLLAPSIBLE_TOOL_NAMES.has(part.toolName);
|
|
7675
7587
|
}
|
|
7676
7588
|
function PiTimelineMessage(props) {
|
|
7677
|
-
return /* @__PURE__ */
|
|
7589
|
+
return /* @__PURE__ */ jsx23(ChatMessageContributionBoundary, { message: props.message, children: /* @__PURE__ */ jsx23(DefaultPiTimelineMessage, { ...props }) });
|
|
7678
7590
|
}
|
|
7679
7591
|
function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts, toolRenderers, mentionCatalog = EMPTY_MENTION_CATALOG, onMentionActivate }) {
|
|
7680
7592
|
const role = message.role;
|
|
@@ -7711,7 +7623,7 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7711
7623
|
[activateCurrentMention, effectiveMentionCatalog, mentionSignature, mentionsEnabled]
|
|
7712
7624
|
);
|
|
7713
7625
|
const shouldReserveStreamingActions = messageIsStreaming;
|
|
7714
|
-
return /* @__PURE__ */
|
|
7626
|
+
return /* @__PURE__ */ jsxs19(
|
|
7715
7627
|
Message,
|
|
7716
7628
|
{
|
|
7717
7629
|
from: role,
|
|
@@ -7720,8 +7632,8 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7720
7632
|
"data-boring-agent-message-role": role,
|
|
7721
7633
|
"data-boring-agent-message-status": message.status,
|
|
7722
7634
|
children: [
|
|
7723
|
-
/* @__PURE__ */
|
|
7724
|
-
fileParts.length > 0 ? /* @__PURE__ */
|
|
7635
|
+
/* @__PURE__ */ jsxs19(MessageContent, { children: [
|
|
7636
|
+
fileParts.length > 0 ? /* @__PURE__ */ jsx23(
|
|
7725
7637
|
Attachments,
|
|
7726
7638
|
{
|
|
7727
7639
|
variant: role === "user" ? "inline" : "list",
|
|
@@ -7746,7 +7658,7 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7746
7658
|
event.preventDefault();
|
|
7747
7659
|
openAttachment();
|
|
7748
7660
|
};
|
|
7749
|
-
return /* @__PURE__ */
|
|
7661
|
+
return /* @__PURE__ */ jsxs19(
|
|
7750
7662
|
Attachment,
|
|
7751
7663
|
{
|
|
7752
7664
|
data: toAttachmentData(file, `file-${message.id}-${index}`),
|
|
@@ -7760,8 +7672,8 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7760
7672
|
onKeyDown: openAttachmentFromKeyboard
|
|
7761
7673
|
} : void 0,
|
|
7762
7674
|
children: [
|
|
7763
|
-
/* @__PURE__ */
|
|
7764
|
-
/* @__PURE__ */
|
|
7675
|
+
/* @__PURE__ */ jsx23(AttachmentPreview, { className: role === "user" ? "!size-5 shrink-0 rounded-[var(--radius-sm)]" : "size-10 shrink-0 rounded-[var(--radius-md)]" }),
|
|
7676
|
+
/* @__PURE__ */ jsx23(AttachmentInfo, { className: role === "user" ? "min-w-0 max-w-[220px] flex-1 text-[12px]" : "min-w-0 flex-1" })
|
|
7765
7677
|
]
|
|
7766
7678
|
},
|
|
7767
7679
|
`file-${message.id}-${index}`
|
|
@@ -7771,7 +7683,7 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7771
7683
|
) : null,
|
|
7772
7684
|
finalParts.map((item, index) => {
|
|
7773
7685
|
if (item.kind === "reasoning") {
|
|
7774
|
-
return /* @__PURE__ */
|
|
7686
|
+
return /* @__PURE__ */ jsx23(
|
|
7775
7687
|
TimelineReasoningPart,
|
|
7776
7688
|
{
|
|
7777
7689
|
item,
|
|
@@ -7781,15 +7693,15 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7781
7693
|
);
|
|
7782
7694
|
}
|
|
7783
7695
|
if (item.kind === "tool-group") {
|
|
7784
|
-
return /* @__PURE__ */
|
|
7696
|
+
return /* @__PURE__ */ jsx23("div", { "data-boring-agent-part": "message-tools", children: /* @__PURE__ */ jsx23(ToolCallGroup, { tools: item.tools, mergedToolRenderers: toolRenderers }) }, item.key);
|
|
7785
7697
|
}
|
|
7786
7698
|
if (item.kind === "tool-plain") {
|
|
7787
|
-
return /* @__PURE__ */
|
|
7699
|
+
return /* @__PURE__ */ jsx23("div", { "data-boring-agent-part": "message-tools", children: /* @__PURE__ */ jsx23(PlainToolCard, { part: item.part, renderers: toolRenderers }) }, item.key);
|
|
7788
7700
|
}
|
|
7789
7701
|
if (item.part.type === "text") {
|
|
7790
7702
|
const text = textForMessageDisplay(item.part.text, role);
|
|
7791
7703
|
if (!text) return null;
|
|
7792
|
-
return /* @__PURE__ */
|
|
7704
|
+
return /* @__PURE__ */ jsx23("div", { "data-boring-agent-part": "message-text", children: /* @__PURE__ */ jsx23(
|
|
7793
7705
|
MessageResponse,
|
|
7794
7706
|
{
|
|
7795
7707
|
components: mentionMarkdownComponents,
|
|
@@ -7801,12 +7713,12 @@ function DefaultPiTimelineMessage({ message, isLast, isStreaming, showThoughts,
|
|
|
7801
7713
|
) }, item.key);
|
|
7802
7714
|
}
|
|
7803
7715
|
if (item.part.type === "notice") {
|
|
7804
|
-
return /* @__PURE__ */
|
|
7716
|
+
return /* @__PURE__ */ jsx23(NoticeBubble, { level: item.part.level, text: item.part.text }, item.key);
|
|
7805
7717
|
}
|
|
7806
7718
|
return null;
|
|
7807
7719
|
})
|
|
7808
7720
|
] }),
|
|
7809
|
-
isAssistant && (textParts.length > 0 || shouldReserveStreamingActions) ? /* @__PURE__ */
|
|
7721
|
+
isAssistant && (textParts.length > 0 || shouldReserveStreamingActions) ? /* @__PURE__ */ jsx23(
|
|
7810
7722
|
MessageActionsBar,
|
|
7811
7723
|
{
|
|
7812
7724
|
text: textParts.map((part) => part.text).join("\n\n"),
|
|
@@ -7831,7 +7743,7 @@ function TimelineReasoningPart({ item, showThoughts }) {
|
|
|
7831
7743
|
event.preventDefault();
|
|
7832
7744
|
setManualOpen((open) => !(open ?? showThoughts));
|
|
7833
7745
|
}, [showThoughts]);
|
|
7834
|
-
return /* @__PURE__ */
|
|
7746
|
+
return /* @__PURE__ */ jsxs19(
|
|
7835
7747
|
Reasoning,
|
|
7836
7748
|
{
|
|
7837
7749
|
"data-boring-agent-part": "message-reasoning",
|
|
@@ -7841,15 +7753,15 @@ function TimelineReasoningPart({ item, showThoughts }) {
|
|
|
7841
7753
|
onOpenChange: handleOpenChange,
|
|
7842
7754
|
autoClose: false,
|
|
7843
7755
|
children: [
|
|
7844
|
-
/* @__PURE__ */
|
|
7756
|
+
/* @__PURE__ */ jsx23(
|
|
7845
7757
|
ReasoningTrigger,
|
|
7846
7758
|
{
|
|
7847
7759
|
className: "mb-1 w-fit rounded-[var(--radius-sm)] px-0 py-0 !text-xs !font-normal !text-muted-foreground/75 hover:bg-transparent hover:!text-muted-foreground/75 [&_svg]:!text-muted-foreground/75",
|
|
7848
|
-
getThinkingMessage: () => /* @__PURE__ */
|
|
7760
|
+
getThinkingMessage: () => /* @__PURE__ */ jsx23("span", { children: "Reasoning" }),
|
|
7849
7761
|
onClick: toggleManualOpen
|
|
7850
7762
|
}
|
|
7851
7763
|
),
|
|
7852
|
-
/* @__PURE__ */
|
|
7764
|
+
/* @__PURE__ */ jsx23(ReasoningContent, { children: item.text })
|
|
7853
7765
|
]
|
|
7854
7766
|
}
|
|
7855
7767
|
);
|
|
@@ -7858,7 +7770,7 @@ function PlainToolCard({ part, renderers }) {
|
|
|
7858
7770
|
const toolPart = toToolPart(part);
|
|
7859
7771
|
if (!toolPart) return null;
|
|
7860
7772
|
const { renderer, part: resolved, resolution } = resolveToolRendererForPart(toolPart, renderers);
|
|
7861
|
-
return /* @__PURE__ */
|
|
7773
|
+
return /* @__PURE__ */ jsx23(
|
|
7862
7774
|
"div",
|
|
7863
7775
|
{
|
|
7864
7776
|
"data-tool-call-id": resolved.toolCallId,
|
|
@@ -7916,13 +7828,13 @@ function codeFilenameForPart(parts, index) {
|
|
|
7916
7828
|
return typeof path === "string" && path.trim() ? path : void 0;
|
|
7917
7829
|
}
|
|
7918
7830
|
function NoticeBubble({ level, text }) {
|
|
7919
|
-
return /* @__PURE__ */
|
|
7831
|
+
return /* @__PURE__ */ jsx23(
|
|
7920
7832
|
"div",
|
|
7921
7833
|
{
|
|
7922
7834
|
"data-boring-agent-part": "message-notice",
|
|
7923
7835
|
"data-notice-level": level,
|
|
7924
7836
|
className: noticeSurfaceClass(level, "text-xs"),
|
|
7925
|
-
children: /* @__PURE__ */
|
|
7837
|
+
children: /* @__PURE__ */ jsx23("div", { className: noticeTextClass(), children: text })
|
|
7926
7838
|
}
|
|
7927
7839
|
);
|
|
7928
7840
|
}
|
|
@@ -8001,7 +7913,7 @@ function MessageActionsBar({
|
|
|
8001
7913
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--accent)]/40"
|
|
8002
7914
|
);
|
|
8003
7915
|
const hiddenActionProps = visible ? {} : { tabIndex: -1 };
|
|
8004
|
-
return /* @__PURE__ */
|
|
7916
|
+
return /* @__PURE__ */ jsx23(
|
|
8005
7917
|
"div",
|
|
8006
7918
|
{
|
|
8007
7919
|
"aria-hidden": !visible,
|
|
@@ -8009,8 +7921,8 @@ function MessageActionsBar({
|
|
|
8009
7921
|
"flex min-h-8 items-center gap-1 -mt-1 text-xs text-muted-foreground transition-opacity duration-200",
|
|
8010
7922
|
visible ? "opacity-100" : "pointer-events-none opacity-0"
|
|
8011
7923
|
),
|
|
8012
|
-
children: /* @__PURE__ */
|
|
8013
|
-
|
|
7924
|
+
children: /* @__PURE__ */ jsx23(
|
|
7925
|
+
Button10,
|
|
8014
7926
|
{
|
|
8015
7927
|
type: "button",
|
|
8016
7928
|
variant: "ghost",
|
|
@@ -8020,7 +7932,7 @@ function MessageActionsBar({
|
|
|
8020
7932
|
"aria-label": copied ? "Copied" : "Copy message",
|
|
8021
7933
|
title: copied ? "Copied" : "Copy",
|
|
8022
7934
|
...hiddenActionProps,
|
|
8023
|
-
children: copied ? /* @__PURE__ */
|
|
7935
|
+
children: copied ? /* @__PURE__ */ jsx23(CheckIcon2, { className: "h-3.5 w-3.5 text-[color:var(--accent)]" }) : /* @__PURE__ */ jsx23(CopyIcon3, { className: "h-3.5 w-3.5" })
|
|
8024
7936
|
}
|
|
8025
7937
|
)
|
|
8026
7938
|
}
|
|
@@ -8041,7 +7953,7 @@ function partKey(messageId, part, index) {
|
|
|
8041
7953
|
}
|
|
8042
7954
|
|
|
8043
7955
|
// src/front/chat/components/PiConversationSurface.tsx
|
|
8044
|
-
import { jsx as
|
|
7956
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8045
7957
|
var TRANSCRIPT_WINDOW = 60;
|
|
8046
7958
|
var TRANSCRIPT_WINDOW_STEP = 40;
|
|
8047
7959
|
var LOAD_OLDER_THRESHOLD_PX = 320;
|
|
@@ -8079,7 +7991,7 @@ function PiConversationSurface({
|
|
|
8079
7991
|
const loadOlder = useCallback14(() => {
|
|
8080
7992
|
setVisibleCount((count) => count + TRANSCRIPT_WINDOW_STEP);
|
|
8081
7993
|
}, []);
|
|
8082
|
-
return /* @__PURE__ */
|
|
7994
|
+
return /* @__PURE__ */ jsxs20(
|
|
8083
7995
|
Conversation,
|
|
8084
7996
|
{
|
|
8085
7997
|
className: emptyHero ? cn("flex-none", runtimeNotices.length > 0 ? "max-h-[45vh]" : "max-h-[20vh]") : "flex-1",
|
|
@@ -8087,13 +7999,13 @@ function PiConversationSurface({
|
|
|
8087
7999
|
"aria-live": "polite",
|
|
8088
8000
|
onScrollToBottomReady,
|
|
8089
8001
|
children: [
|
|
8090
|
-
/* @__PURE__ */
|
|
8002
|
+
/* @__PURE__ */ jsxs20(ConversationContent, { className: cn(
|
|
8091
8003
|
"mx-auto flex w-full flex-col gap-6",
|
|
8092
8004
|
chrome ? "max-w-3xl px-6 py-8" : "max-w-[680px] px-4 py-4",
|
|
8093
8005
|
emptyHero && "py-4 text-center"
|
|
8094
8006
|
), children: [
|
|
8095
|
-
messages.length === 0 && emptyStateHydrating && !terminalError ? /* @__PURE__ */
|
|
8096
|
-
messages.length === 0 && !emptyStateHydrating && !terminalError ? /* @__PURE__ */
|
|
8007
|
+
messages.length === 0 && emptyStateHydrating && !terminalError ? /* @__PURE__ */ jsx24(ConversationHistoryLoadingState, {}) : null,
|
|
8008
|
+
messages.length === 0 && !emptyStateHydrating && !terminalError ? /* @__PURE__ */ jsx24(
|
|
8097
8009
|
ChatEmptyState,
|
|
8098
8010
|
{
|
|
8099
8011
|
eyebrow: emptyState?.eyebrow,
|
|
@@ -8111,8 +8023,8 @@ function PiConversationSurface({
|
|
|
8111
8023
|
}
|
|
8112
8024
|
}
|
|
8113
8025
|
) : null,
|
|
8114
|
-
hasOlder ? /* @__PURE__ */
|
|
8115
|
-
visibleItems.map(({ message, key }, index) => /* @__PURE__ */
|
|
8026
|
+
hasOlder ? /* @__PURE__ */ jsx24(TranscriptHistoryLoader, { olderCount, onLoadOlder: loadOlder }) : null,
|
|
8027
|
+
visibleItems.map(({ message, key }, index) => /* @__PURE__ */ jsx24(
|
|
8116
8028
|
PiTimelineMessage,
|
|
8117
8029
|
{
|
|
8118
8030
|
message,
|
|
@@ -8125,16 +8037,16 @@ function PiConversationSurface({
|
|
|
8125
8037
|
},
|
|
8126
8038
|
key
|
|
8127
8039
|
)),
|
|
8128
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ jsx24(RuntimeNoticeMessages, { notices: runtimeNotices, onDismiss: onDismissNotice, renderAction: renderNoticeAction, historyEmpty })
|
|
8129
8041
|
] }),
|
|
8130
|
-
/* @__PURE__ */
|
|
8042
|
+
/* @__PURE__ */ jsx24(ConversationScrollButton, {})
|
|
8131
8043
|
]
|
|
8132
8044
|
}
|
|
8133
8045
|
);
|
|
8134
8046
|
}
|
|
8135
8047
|
function ConversationHistoryLoadingState() {
|
|
8136
8048
|
const skeletonClassName = "motion-reduce:animate-none";
|
|
8137
|
-
return /* @__PURE__ */
|
|
8049
|
+
return /* @__PURE__ */ jsxs20(
|
|
8138
8050
|
"div",
|
|
8139
8051
|
{
|
|
8140
8052
|
role: "status",
|
|
@@ -8143,21 +8055,21 @@ function ConversationHistoryLoadingState() {
|
|
|
8143
8055
|
"data-boring-agent-part": "chat-history-loading",
|
|
8144
8056
|
className: "flex flex-col gap-7 py-4",
|
|
8145
8057
|
children: [
|
|
8146
|
-
/* @__PURE__ */
|
|
8147
|
-
/* @__PURE__ */
|
|
8148
|
-
/* @__PURE__ */
|
|
8149
|
-
/* @__PURE__ */
|
|
8150
|
-
/* @__PURE__ */
|
|
8151
|
-
/* @__PURE__ */
|
|
8058
|
+
/* @__PURE__ */ jsxs20("div", { "aria-hidden": "true", className: "flex items-start gap-3", children: [
|
|
8059
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("mt-0.5 size-7 shrink-0 rounded-lg", skeletonClassName) }),
|
|
8060
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 flex-1 flex-col gap-2.5", children: [
|
|
8061
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("h-3 w-24 rounded-sm", skeletonClassName) }),
|
|
8062
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("h-3 w-full rounded-sm", skeletonClassName) }),
|
|
8063
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("h-3 w-4/5 rounded-sm", skeletonClassName) })
|
|
8152
8064
|
] })
|
|
8153
8065
|
] }),
|
|
8154
|
-
/* @__PURE__ */
|
|
8155
|
-
/* @__PURE__ */
|
|
8156
|
-
/* @__PURE__ */
|
|
8157
|
-
/* @__PURE__ */
|
|
8158
|
-
/* @__PURE__ */
|
|
8159
|
-
/* @__PURE__ */
|
|
8160
|
-
/* @__PURE__ */
|
|
8066
|
+
/* @__PURE__ */ jsx24("div", { "aria-hidden": "true", className: "flex justify-end", children: /* @__PURE__ */ jsx24(Skeleton, { className: cn("h-11 w-[min(72%,30rem)] rounded-xl", skeletonClassName) }) }),
|
|
8067
|
+
/* @__PURE__ */ jsxs20("div", { "aria-hidden": "true", className: "flex items-start gap-3", children: [
|
|
8068
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("mt-0.5 size-7 shrink-0 rounded-lg", skeletonClassName) }),
|
|
8069
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex min-w-0 flex-1 flex-col gap-3", children: [
|
|
8070
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("h-3 w-20 rounded-sm", skeletonClassName) }),
|
|
8071
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("h-20 w-full rounded-lg", skeletonClassName) }),
|
|
8072
|
+
/* @__PURE__ */ jsx24(Skeleton, { className: cn("h-3 w-3/5 rounded-sm", skeletonClassName) })
|
|
8161
8073
|
] })
|
|
8162
8074
|
] })
|
|
8163
8075
|
]
|
|
@@ -8191,7 +8103,7 @@ function TranscriptHistoryLoader({ olderCount, onLoadOlder }) {
|
|
|
8191
8103
|
}
|
|
8192
8104
|
if (el.scrollTop > LOAD_OLDER_THRESHOLD_PX) armed.current = true;
|
|
8193
8105
|
});
|
|
8194
|
-
return /* @__PURE__ */
|
|
8106
|
+
return /* @__PURE__ */ jsx24("div", { className: "flex justify-center", "data-boring-agent-part": "transcript-load-older", children: /* @__PURE__ */ jsxs20(
|
|
8195
8107
|
"button",
|
|
8196
8108
|
{
|
|
8197
8109
|
type: "button",
|
|
@@ -8235,7 +8147,7 @@ import { motion as motion2, useReducedMotion } from "motion/react";
|
|
|
8235
8147
|
import { useEffect as useEffect15, useRef as useRef12 } from "react";
|
|
8236
8148
|
|
|
8237
8149
|
// src/front/composer/ComposerStatusBanner.tsx
|
|
8238
|
-
import { jsx as
|
|
8150
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8239
8151
|
function ComposerStatusBanner({
|
|
8240
8152
|
tone,
|
|
8241
8153
|
dataAttribute,
|
|
@@ -8252,7 +8164,7 @@ function ComposerStatusBanner({
|
|
|
8252
8164
|
}) {
|
|
8253
8165
|
const toneAttr = { [dataAttribute]: tone };
|
|
8254
8166
|
if (tone === "running") {
|
|
8255
|
-
return /* @__PURE__ */
|
|
8167
|
+
return /* @__PURE__ */ jsxs21(
|
|
8256
8168
|
"div",
|
|
8257
8169
|
{
|
|
8258
8170
|
...toneAttr,
|
|
@@ -8264,14 +8176,14 @@ function ComposerStatusBanner({
|
|
|
8264
8176
|
maxWidthClassName
|
|
8265
8177
|
),
|
|
8266
8178
|
children: [
|
|
8267
|
-
/* @__PURE__ */
|
|
8268
|
-
/* @__PURE__ */
|
|
8179
|
+
/* @__PURE__ */ jsx25("span", { className: "inline-block h-2 w-2 animate-pulse rounded-full bg-accent", "aria-hidden": "true" }),
|
|
8180
|
+
/* @__PURE__ */ jsx25("span", { children: runningContent })
|
|
8269
8181
|
]
|
|
8270
8182
|
}
|
|
8271
8183
|
);
|
|
8272
8184
|
}
|
|
8273
8185
|
if (tone === "success") {
|
|
8274
|
-
return /* @__PURE__ */
|
|
8186
|
+
return /* @__PURE__ */ jsxs21(
|
|
8275
8187
|
"div",
|
|
8276
8188
|
{
|
|
8277
8189
|
...toneAttr,
|
|
@@ -8283,13 +8195,13 @@ function ComposerStatusBanner({
|
|
|
8283
8195
|
maxWidthClassName
|
|
8284
8196
|
),
|
|
8285
8197
|
children: [
|
|
8286
|
-
/* @__PURE__ */
|
|
8287
|
-
/* @__PURE__ */
|
|
8288
|
-
/* @__PURE__ */
|
|
8289
|
-
/* @__PURE__ */
|
|
8290
|
-
detail ? /* @__PURE__ */
|
|
8198
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-2", children: [
|
|
8199
|
+
/* @__PURE__ */ jsx25("span", { className: "mt-0.5 text-[oklch(0.45_0.13_148)]", "aria-hidden": "true", children: "\u2713" }),
|
|
8200
|
+
/* @__PURE__ */ jsxs21("span", { className: "min-w-0 flex-1", children: [
|
|
8201
|
+
/* @__PURE__ */ jsx25("span", { className: "block font-medium leading-5", children: title }),
|
|
8202
|
+
detail ? /* @__PURE__ */ jsx25("span", { className: "block leading-4 text-muted-foreground", children: detail }) : null
|
|
8291
8203
|
] }),
|
|
8292
|
-
onDismiss ? /* @__PURE__ */
|
|
8204
|
+
onDismiss ? /* @__PURE__ */ jsx25(
|
|
8293
8205
|
"button",
|
|
8294
8206
|
{
|
|
8295
8207
|
type: "button",
|
|
@@ -8305,7 +8217,7 @@ function ComposerStatusBanner({
|
|
|
8305
8217
|
}
|
|
8306
8218
|
);
|
|
8307
8219
|
}
|
|
8308
|
-
return /* @__PURE__ */
|
|
8220
|
+
return /* @__PURE__ */ jsxs21(
|
|
8309
8221
|
"div",
|
|
8310
8222
|
{
|
|
8311
8223
|
...toneAttr,
|
|
@@ -8317,10 +8229,10 @@ function ComposerStatusBanner({
|
|
|
8317
8229
|
maxWidthClassName
|
|
8318
8230
|
),
|
|
8319
8231
|
children: [
|
|
8320
|
-
/* @__PURE__ */
|
|
8321
|
-
/* @__PURE__ */
|
|
8322
|
-
/* @__PURE__ */
|
|
8323
|
-
onRetry ? /* @__PURE__ */
|
|
8232
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
|
|
8233
|
+
/* @__PURE__ */ jsx25("span", { className: "text-destructive", "aria-hidden": "true", children: "\u26A0" }),
|
|
8234
|
+
/* @__PURE__ */ jsx25("span", { className: "flex-1 font-medium", children: title }),
|
|
8235
|
+
onRetry ? /* @__PURE__ */ jsx25(
|
|
8324
8236
|
"button",
|
|
8325
8237
|
{
|
|
8326
8238
|
type: "button",
|
|
@@ -8329,7 +8241,7 @@ function ComposerStatusBanner({
|
|
|
8329
8241
|
children: retryLabel
|
|
8330
8242
|
}
|
|
8331
8243
|
) : null,
|
|
8332
|
-
onDismiss ? /* @__PURE__ */
|
|
8244
|
+
onDismiss ? /* @__PURE__ */ jsx25(
|
|
8333
8245
|
"button",
|
|
8334
8246
|
{
|
|
8335
8247
|
type: "button",
|
|
@@ -8340,14 +8252,14 @@ function ComposerStatusBanner({
|
|
|
8340
8252
|
}
|
|
8341
8253
|
) : null
|
|
8342
8254
|
] }),
|
|
8343
|
-
message ? /* @__PURE__ */
|
|
8255
|
+
message ? /* @__PURE__ */ jsx25("pre", { className: "mt-2 whitespace-pre-wrap break-words text-[11px] text-destructive/90", children: message }) : null
|
|
8344
8256
|
]
|
|
8345
8257
|
}
|
|
8346
8258
|
);
|
|
8347
8259
|
}
|
|
8348
8260
|
|
|
8349
8261
|
// src/front/composer/PluginUpdateStatus.tsx
|
|
8350
|
-
import { jsx as
|
|
8262
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8351
8263
|
function PluginUpdateStatus({
|
|
8352
8264
|
state,
|
|
8353
8265
|
onDismiss,
|
|
@@ -8369,7 +8281,7 @@ function PluginUpdateStatus({
|
|
|
8369
8281
|
}, [state?.kind, successDismissKey, successAutoDismissMs]);
|
|
8370
8282
|
if (!state) return null;
|
|
8371
8283
|
if (state.kind === "running") {
|
|
8372
|
-
return /* @__PURE__ */
|
|
8284
|
+
return /* @__PURE__ */ jsx26(
|
|
8373
8285
|
ComposerStatusBanner,
|
|
8374
8286
|
{
|
|
8375
8287
|
tone: "running",
|
|
@@ -8386,7 +8298,7 @@ function PluginUpdateStatus({
|
|
|
8386
8298
|
const hasWarningsOrDiagnostics = warnings.length > 0 || diagnostics.length > 0;
|
|
8387
8299
|
const title = state.reloaded ? hasWarningsOrDiagnostics ? "Reload finished with warnings" : "Reload complete" : "Reload queued";
|
|
8388
8300
|
const detail = state.reloaded ? hasWarningsOrDiagnostics ? "Some extension changes need attention." : frontEvents.length > 0 ? `${frontEvents.length} extension module${frontEvents.length === 1 ? "" : "s"} refreshed. Changes are live.` : "Changes are live." : void 0;
|
|
8389
|
-
return /* @__PURE__ */
|
|
8301
|
+
return /* @__PURE__ */ jsxs22(
|
|
8390
8302
|
ComposerStatusBanner,
|
|
8391
8303
|
{
|
|
8392
8304
|
tone: "success",
|
|
@@ -8397,7 +8309,7 @@ function PluginUpdateStatus({
|
|
|
8397
8309
|
onDismiss,
|
|
8398
8310
|
dismissAriaLabel: "Dismiss plugin update status",
|
|
8399
8311
|
children: [
|
|
8400
|
-
diagnostics.length > 0 ? /* @__PURE__ */
|
|
8312
|
+
diagnostics.length > 0 ? /* @__PURE__ */ jsxs22(
|
|
8401
8313
|
"div",
|
|
8402
8314
|
{
|
|
8403
8315
|
"data-boring-plugin-update-diagnostics": "",
|
|
@@ -8406,24 +8318,24 @@ function PluginUpdateStatus({
|
|
|
8406
8318
|
"px-2 py-1.5 text-[11px] text-foreground"
|
|
8407
8319
|
),
|
|
8408
8320
|
children: [
|
|
8409
|
-
/* @__PURE__ */
|
|
8410
|
-
/* @__PURE__ */
|
|
8411
|
-
/* @__PURE__ */
|
|
8321
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1.5 font-medium text-[oklch(0.48_0.15_60)]", children: [
|
|
8322
|
+
/* @__PURE__ */ jsx26("span", { "aria-hidden": "true", children: "\u26A0" }),
|
|
8323
|
+
/* @__PURE__ */ jsxs22("span", { children: [
|
|
8412
8324
|
"Reload diagnostics for ",
|
|
8413
8325
|
diagnostics.length,
|
|
8414
8326
|
" extension",
|
|
8415
8327
|
diagnostics.length === 1 ? "" : "s"
|
|
8416
8328
|
] })
|
|
8417
8329
|
] }),
|
|
8418
|
-
/* @__PURE__ */
|
|
8419
|
-
/* @__PURE__ */
|
|
8330
|
+
/* @__PURE__ */ jsx26("ul", { className: "mt-1 ml-4 list-disc text-foreground/85", children: diagnostics.map((diagnostic, index) => /* @__PURE__ */ jsxs22("li", { children: [
|
|
8331
|
+
/* @__PURE__ */ jsx26("code", { className: "font-mono text-[10.5px]", children: diagnostic.pluginId ?? diagnostic.source ?? "plugin" }),
|
|
8420
8332
|
" \u2014 ",
|
|
8421
8333
|
diagnostic.message ?? "reload diagnostic"
|
|
8422
8334
|
] }, `${diagnostic.pluginId ?? diagnostic.source ?? "plugin"}-${index}`)) })
|
|
8423
8335
|
]
|
|
8424
8336
|
}
|
|
8425
8337
|
) : null,
|
|
8426
|
-
warnings.length > 0 ? /* @__PURE__ */
|
|
8338
|
+
warnings.length > 0 ? /* @__PURE__ */ jsxs22(
|
|
8427
8339
|
"div",
|
|
8428
8340
|
{
|
|
8429
8341
|
"data-boring-plugin-update-restart-warning": "",
|
|
@@ -8432,21 +8344,21 @@ function PluginUpdateStatus({
|
|
|
8432
8344
|
"px-2 py-1.5 text-[11px] text-foreground"
|
|
8433
8345
|
),
|
|
8434
8346
|
children: [
|
|
8435
|
-
/* @__PURE__ */
|
|
8436
|
-
/* @__PURE__ */
|
|
8437
|
-
/* @__PURE__ */
|
|
8347
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-1.5 font-medium text-[oklch(0.48_0.15_60)]", children: [
|
|
8348
|
+
/* @__PURE__ */ jsx26("span", { "aria-hidden": "true", children: "\u26A0" }),
|
|
8349
|
+
/* @__PURE__ */ jsxs22("span", { children: [
|
|
8438
8350
|
"Restart needed for ",
|
|
8439
8351
|
warnings.length,
|
|
8440
8352
|
" extension",
|
|
8441
8353
|
warnings.length === 1 ? "" : "s"
|
|
8442
8354
|
] })
|
|
8443
8355
|
] }),
|
|
8444
|
-
/* @__PURE__ */
|
|
8445
|
-
/* @__PURE__ */
|
|
8356
|
+
/* @__PURE__ */ jsx26("ul", { className: "mt-1 ml-4 list-disc text-foreground/85", children: warnings.map((w) => /* @__PURE__ */ jsxs22("li", { children: [
|
|
8357
|
+
/* @__PURE__ */ jsx26("code", { className: "font-mono text-[10.5px]", children: w.id }),
|
|
8446
8358
|
" \u2014 ",
|
|
8447
8359
|
w.surfaces.join(" + ")
|
|
8448
8360
|
] }, w.id)) }),
|
|
8449
|
-
/* @__PURE__ */
|
|
8361
|
+
/* @__PURE__ */ jsx26("p", { className: "mt-1 text-foreground/70", children: "The interface reloaded successfully, but routes and tools were wired at boot. Restart the workspace process to pick up the new code." })
|
|
8450
8362
|
]
|
|
8451
8363
|
}
|
|
8452
8364
|
) : null
|
|
@@ -8454,7 +8366,7 @@ function PluginUpdateStatus({
|
|
|
8454
8366
|
}
|
|
8455
8367
|
);
|
|
8456
8368
|
}
|
|
8457
|
-
return /* @__PURE__ */
|
|
8369
|
+
return /* @__PURE__ */ jsx26(
|
|
8458
8370
|
ComposerStatusBanner,
|
|
8459
8371
|
{
|
|
8460
8372
|
tone: "error",
|
|
@@ -8472,7 +8384,7 @@ function PluginUpdateStatus({
|
|
|
8472
8384
|
|
|
8473
8385
|
// src/front/composer/CommandRunStatus.tsx
|
|
8474
8386
|
import { useEffect as useEffect16, useRef as useRef13 } from "react";
|
|
8475
|
-
import { Fragment as Fragment10, jsx as
|
|
8387
|
+
import { Fragment as Fragment10, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8476
8388
|
function CommandRunStatus({
|
|
8477
8389
|
state,
|
|
8478
8390
|
onDismiss,
|
|
@@ -8491,15 +8403,15 @@ function CommandRunStatus({
|
|
|
8491
8403
|
}, [state?.kind, successKey, successAutoDismissMs]);
|
|
8492
8404
|
if (!state) return null;
|
|
8493
8405
|
if (state.kind === "running") {
|
|
8494
|
-
return /* @__PURE__ */
|
|
8406
|
+
return /* @__PURE__ */ jsx27(
|
|
8495
8407
|
ComposerStatusBanner,
|
|
8496
8408
|
{
|
|
8497
8409
|
tone: "running",
|
|
8498
8410
|
dataAttribute: "data-boring-command-run",
|
|
8499
8411
|
maxWidthClassName,
|
|
8500
|
-
runningContent: state.command ? /* @__PURE__ */
|
|
8412
|
+
runningContent: state.command ? /* @__PURE__ */ jsxs23(Fragment10, { children: [
|
|
8501
8413
|
" Running ",
|
|
8502
|
-
/* @__PURE__ */
|
|
8414
|
+
/* @__PURE__ */ jsxs23("code", { className: "font-mono", children: [
|
|
8503
8415
|
"/",
|
|
8504
8416
|
state.command
|
|
8505
8417
|
] }),
|
|
@@ -8509,15 +8421,15 @@ function CommandRunStatus({
|
|
|
8509
8421
|
);
|
|
8510
8422
|
}
|
|
8511
8423
|
if (state.kind === "success") {
|
|
8512
|
-
return /* @__PURE__ */
|
|
8424
|
+
return /* @__PURE__ */ jsx27(
|
|
8513
8425
|
ComposerStatusBanner,
|
|
8514
8426
|
{
|
|
8515
8427
|
tone: "success",
|
|
8516
8428
|
dataAttribute: "data-boring-command-run",
|
|
8517
8429
|
maxWidthClassName,
|
|
8518
|
-
title: state.command ? /* @__PURE__ */
|
|
8430
|
+
title: state.command ? /* @__PURE__ */ jsxs23(Fragment10, { children: [
|
|
8519
8431
|
" Ran ",
|
|
8520
|
-
/* @__PURE__ */
|
|
8432
|
+
/* @__PURE__ */ jsxs23("code", { className: "font-mono", children: [
|
|
8521
8433
|
"/",
|
|
8522
8434
|
state.command
|
|
8523
8435
|
] }),
|
|
@@ -8529,15 +8441,15 @@ function CommandRunStatus({
|
|
|
8529
8441
|
}
|
|
8530
8442
|
);
|
|
8531
8443
|
}
|
|
8532
|
-
return /* @__PURE__ */
|
|
8444
|
+
return /* @__PURE__ */ jsx27(
|
|
8533
8445
|
ComposerStatusBanner,
|
|
8534
8446
|
{
|
|
8535
8447
|
tone: "error",
|
|
8536
8448
|
dataAttribute: "data-boring-command-run",
|
|
8537
8449
|
maxWidthClassName,
|
|
8538
|
-
title: state.command ? /* @__PURE__ */
|
|
8450
|
+
title: state.command ? /* @__PURE__ */ jsxs23(Fragment10, { children: [
|
|
8539
8451
|
" ",
|
|
8540
|
-
/* @__PURE__ */
|
|
8452
|
+
/* @__PURE__ */ jsxs23("code", { className: "font-mono", children: [
|
|
8541
8453
|
"/",
|
|
8542
8454
|
state.command
|
|
8543
8455
|
] }),
|
|
@@ -8585,7 +8497,7 @@ function displayProviderLabel(provider) {
|
|
|
8585
8497
|
}
|
|
8586
8498
|
|
|
8587
8499
|
// src/front/chatPanelComposerControls.tsx
|
|
8588
|
-
import { Fragment as Fragment11, jsx as
|
|
8500
|
+
import { Fragment as Fragment11, jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
8589
8501
|
var composerActionClass = cn(
|
|
8590
8502
|
"inline-flex h-8 items-center justify-center gap-1.5 rounded-[var(--radius-md)] border-0 bg-transparent",
|
|
8591
8503
|
"text-muted-foreground shadow-none transition-colors motion-reduce:transition-none",
|
|
@@ -8653,7 +8565,7 @@ function useDismissOnOutsidePointer(ref, onClose) {
|
|
|
8653
8565
|
}
|
|
8654
8566
|
function ThinkingLevelGlyph({ level }) {
|
|
8655
8567
|
const lit = level === "off" ? 0 : level === "low" ? 1 : level === "medium" ? 2 : 3;
|
|
8656
|
-
return /* @__PURE__ */
|
|
8568
|
+
return /* @__PURE__ */ jsx28(
|
|
8657
8569
|
"svg",
|
|
8658
8570
|
{
|
|
8659
8571
|
"aria-hidden": "true",
|
|
@@ -8662,7 +8574,7 @@ function ThinkingLevelGlyph({ level }) {
|
|
|
8662
8574
|
viewBox: "0 0 14 14",
|
|
8663
8575
|
fill: "none",
|
|
8664
8576
|
className: "shrink-0",
|
|
8665
|
-
children: [0, 1, 2].map((i) => /* @__PURE__ */
|
|
8577
|
+
children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx28(
|
|
8666
8578
|
"rect",
|
|
8667
8579
|
{
|
|
8668
8580
|
x: 2 + i * 4,
|
|
@@ -8709,7 +8621,7 @@ var ModelSelectTrigger = forwardRef(function ModelSelectTrigger2({
|
|
|
8709
8621
|
}, ref) {
|
|
8710
8622
|
const triggerLabel = modelTriggerLabel(value, options, emptyLabel);
|
|
8711
8623
|
const triggerDisplay = value ? `${triggerLabel} (${displayProviderLabel(value.provider)})` : triggerLabel;
|
|
8712
|
-
return /* @__PURE__ */
|
|
8624
|
+
return /* @__PURE__ */ jsx28(
|
|
8713
8625
|
"button",
|
|
8714
8626
|
{
|
|
8715
8627
|
ref,
|
|
@@ -8727,16 +8639,16 @@ var ModelSelectTrigger = forwardRef(function ModelSelectTrigger2({
|
|
|
8727
8639
|
className
|
|
8728
8640
|
),
|
|
8729
8641
|
...props,
|
|
8730
|
-
children: trigger === "slash" ? /* @__PURE__ */
|
|
8731
|
-
/* @__PURE__ */
|
|
8732
|
-
/* @__PURE__ */
|
|
8733
|
-
value ? /* @__PURE__ */
|
|
8642
|
+
children: trigger === "slash" ? /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
8643
|
+
/* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: "Model \xB7 " }),
|
|
8644
|
+
/* @__PURE__ */ jsx28("span", { className: "min-w-0 truncate text-foreground", children: triggerLabel }),
|
|
8645
|
+
value ? /* @__PURE__ */ jsxs24("span", { className: "shrink-0 text-muted-foreground", children: [
|
|
8734
8646
|
" \xB7 ",
|
|
8735
8647
|
displayProviderLabel(value.provider)
|
|
8736
8648
|
] }) : null
|
|
8737
|
-
] }) : /* @__PURE__ */
|
|
8738
|
-
/* @__PURE__ */
|
|
8739
|
-
/* @__PURE__ */
|
|
8649
|
+
] }) : /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
8650
|
+
/* @__PURE__ */ jsx28("span", { className: "min-w-0 truncate", children: triggerDisplay }),
|
|
8651
|
+
/* @__PURE__ */ jsx28(ChevronDownIcon5, { className: "h-3 w-3 shrink-0 text-muted-foreground/50", "aria-hidden": "true" })
|
|
8740
8652
|
] })
|
|
8741
8653
|
}
|
|
8742
8654
|
);
|
|
@@ -8793,8 +8705,8 @@ function ModelPickerMenu({
|
|
|
8793
8705
|
}, [activeIndex, disabled, keyboardOptions, onChange, onClose]);
|
|
8794
8706
|
const optionIndexOffset = hideDefaultOption ? 0 : 1;
|
|
8795
8707
|
const optionIndexes = new Map(groupedOptions.map((option, index) => [encodeModelKey(option), index + optionIndexOffset]));
|
|
8796
|
-
return /* @__PURE__ */
|
|
8797
|
-
menuOptions.length > 8 && /* @__PURE__ */
|
|
8708
|
+
return /* @__PURE__ */ jsx28("div", { ref: menuRef, "data-boring-agent": "", "data-boring-agent-part": "model-picker-menu", className: cn(composerPickerMenuClass, className), children: /* @__PURE__ */ jsxs24(Command, { className: "bg-transparent text-[color:var(--popover-foreground)]", children: [
|
|
8709
|
+
menuOptions.length > 8 && /* @__PURE__ */ jsx28("div", { className: "border-b border-border/60 px-2", children: /* @__PURE__ */ jsx28(
|
|
8798
8710
|
CommandInput,
|
|
8799
8711
|
{
|
|
8800
8712
|
placeholder: "Search models\u2026",
|
|
@@ -8802,9 +8714,9 @@ function ModelPickerMenu({
|
|
|
8802
8714
|
className: "h-8 w-full border-0 bg-transparent text-sm outline-none focus:ring-0"
|
|
8803
8715
|
}
|
|
8804
8716
|
) }),
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
/* @__PURE__ */
|
|
8807
|
-
!hideDefaultOption ? /* @__PURE__ */
|
|
8717
|
+
/* @__PURE__ */ jsxs24(CommandList, { className: "max-h-[300px] p-0.5", children: [
|
|
8718
|
+
/* @__PURE__ */ jsx28(CommandEmpty, { className: "py-4 text-center text-sm text-muted-foreground", children: "No models found" }),
|
|
8719
|
+
!hideDefaultOption ? /* @__PURE__ */ jsx28(CommandGroup, { children: /* @__PURE__ */ jsxs24(
|
|
8808
8720
|
CommandItem,
|
|
8809
8721
|
{
|
|
8810
8722
|
value: "Default model automatic auto",
|
|
@@ -8815,7 +8727,7 @@ function ModelPickerMenu({
|
|
|
8815
8727
|
},
|
|
8816
8728
|
className: selectorItemClass(!value || activeIndex === 0),
|
|
8817
8729
|
children: [
|
|
8818
|
-
/* @__PURE__ */
|
|
8730
|
+
/* @__PURE__ */ jsx28(
|
|
8819
8731
|
CheckIcon3,
|
|
8820
8732
|
{
|
|
8821
8733
|
className: cn(
|
|
@@ -8824,12 +8736,12 @@ function ModelPickerMenu({
|
|
|
8824
8736
|
)
|
|
8825
8737
|
}
|
|
8826
8738
|
),
|
|
8827
|
-
/* @__PURE__ */
|
|
8828
|
-
/* @__PURE__ */
|
|
8739
|
+
/* @__PURE__ */ jsx28("span", { className: "truncate", children: "Default model" }),
|
|
8740
|
+
/* @__PURE__ */ jsx28("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground", children: "Auto" })
|
|
8829
8741
|
]
|
|
8830
8742
|
}
|
|
8831
8743
|
) }) : null,
|
|
8832
|
-
[...groups.entries()].map(([provider, list]) => /* @__PURE__ */
|
|
8744
|
+
[...groups.entries()].map(([provider, list]) => /* @__PURE__ */ jsx28(
|
|
8833
8745
|
CommandGroup,
|
|
8834
8746
|
{
|
|
8835
8747
|
heading: displayProviderLabel(provider),
|
|
@@ -8838,7 +8750,7 @@ function ModelPickerMenu({
|
|
|
8838
8750
|
const key = encodeModelKey(m);
|
|
8839
8751
|
const label = m.label || displayModelLabel(m.id);
|
|
8840
8752
|
const itemIndex = optionIndexes.get(key) ?? 0;
|
|
8841
|
-
return /* @__PURE__ */
|
|
8753
|
+
return /* @__PURE__ */ jsxs24(
|
|
8842
8754
|
CommandItem,
|
|
8843
8755
|
{
|
|
8844
8756
|
value: `${label} ${m.id} ${displayProviderLabel(m.provider)}`,
|
|
@@ -8849,7 +8761,7 @@ function ModelPickerMenu({
|
|
|
8849
8761
|
},
|
|
8850
8762
|
className: cn(selectorItemClass(key === currentKey || activeIndex === itemIndex)),
|
|
8851
8763
|
children: [
|
|
8852
|
-
/* @__PURE__ */
|
|
8764
|
+
/* @__PURE__ */ jsx28(
|
|
8853
8765
|
CheckIcon3,
|
|
8854
8766
|
{
|
|
8855
8767
|
className: cn(
|
|
@@ -8858,8 +8770,8 @@ function ModelPickerMenu({
|
|
|
8858
8770
|
)
|
|
8859
8771
|
}
|
|
8860
8772
|
),
|
|
8861
|
-
/* @__PURE__ */
|
|
8862
|
-
/* @__PURE__ */
|
|
8773
|
+
/* @__PURE__ */ jsx28("span", { className: "min-w-0 flex-1 truncate whitespace-nowrap", children: label }),
|
|
8774
|
+
/* @__PURE__ */ jsx28("span", { className: "ml-auto max-w-[45%] shrink-0 truncate whitespace-nowrap text-right text-xs text-muted-foreground", children: m.id })
|
|
8863
8775
|
]
|
|
8864
8776
|
},
|
|
8865
8777
|
key
|
|
@@ -8897,8 +8809,8 @@ function ModelSelect({
|
|
|
8897
8809
|
if (previousOpenSignalRef.current !== openSignal) setOpen(true);
|
|
8898
8810
|
previousOpenSignalRef.current = openSignal;
|
|
8899
8811
|
}, [disabled, openSignal]);
|
|
8900
|
-
return /* @__PURE__ */
|
|
8901
|
-
/* @__PURE__ */
|
|
8812
|
+
return /* @__PURE__ */ jsxs24(Popover, { open, onOpenChange: disabled ? void 0 : setOpen, children: [
|
|
8813
|
+
/* @__PURE__ */ jsx28(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
8902
8814
|
ModelSelectTrigger,
|
|
8903
8815
|
{
|
|
8904
8816
|
value,
|
|
@@ -8912,7 +8824,7 @@ function ModelSelect({
|
|
|
8912
8824
|
"aria-describedby": ariaDescribedBy
|
|
8913
8825
|
}
|
|
8914
8826
|
) }),
|
|
8915
|
-
/* @__PURE__ */
|
|
8827
|
+
/* @__PURE__ */ jsx28(
|
|
8916
8828
|
PopoverContent,
|
|
8917
8829
|
{
|
|
8918
8830
|
align: trigger === "slash" ? "center" : "start",
|
|
@@ -8921,7 +8833,7 @@ function ModelSelect({
|
|
|
8921
8833
|
collisionPadding: 12,
|
|
8922
8834
|
"data-boring-agent": "",
|
|
8923
8835
|
className: cn("w-[min(92vw,340px)]", selectorContentClass),
|
|
8924
|
-
children: /* @__PURE__ */
|
|
8836
|
+
children: /* @__PURE__ */ jsx28(
|
|
8925
8837
|
ModelPickerMenu,
|
|
8926
8838
|
{
|
|
8927
8839
|
value,
|
|
@@ -8958,8 +8870,8 @@ function ThinkingSelect({
|
|
|
8958
8870
|
if (previousOpenSignalRef.current !== openSignal) setOpen(true);
|
|
8959
8871
|
previousOpenSignalRef.current = openSignal;
|
|
8960
8872
|
}, [disabled, openSignal]);
|
|
8961
|
-
return /* @__PURE__ */
|
|
8962
|
-
/* @__PURE__ */
|
|
8873
|
+
return /* @__PURE__ */ jsxs24(Popover, { open, onOpenChange: disabled ? void 0 : setOpen, children: [
|
|
8874
|
+
/* @__PURE__ */ jsx28(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx28(
|
|
8963
8875
|
ThinkingSelectTrigger,
|
|
8964
8876
|
{
|
|
8965
8877
|
value,
|
|
@@ -8969,7 +8881,7 @@ function ThinkingSelect({
|
|
|
8969
8881
|
className
|
|
8970
8882
|
}
|
|
8971
8883
|
) }),
|
|
8972
|
-
/* @__PURE__ */
|
|
8884
|
+
/* @__PURE__ */ jsx28(
|
|
8973
8885
|
PopoverContent,
|
|
8974
8886
|
{
|
|
8975
8887
|
align: trigger === "slash" ? "center" : "end",
|
|
@@ -8978,7 +8890,7 @@ function ThinkingSelect({
|
|
|
8978
8890
|
collisionPadding: 12,
|
|
8979
8891
|
"data-boring-agent": "",
|
|
8980
8892
|
className: cn("w-[min(92vw,240px)]", selectorContentClass),
|
|
8981
|
-
children: /* @__PURE__ */
|
|
8893
|
+
children: /* @__PURE__ */ jsx28(
|
|
8982
8894
|
ThinkingPickerMenu,
|
|
8983
8895
|
{
|
|
8984
8896
|
value,
|
|
@@ -9001,7 +8913,7 @@ var ThinkingSelectTrigger = forwardRef(function ThinkingSelectTrigger2({
|
|
|
9001
8913
|
className,
|
|
9002
8914
|
...props
|
|
9003
8915
|
}, ref) {
|
|
9004
|
-
return /* @__PURE__ */
|
|
8916
|
+
return /* @__PURE__ */ jsxs24(
|
|
9005
8917
|
"button",
|
|
9006
8918
|
{
|
|
9007
8919
|
ref,
|
|
@@ -9022,13 +8934,13 @@ var ThinkingSelectTrigger = forwardRef(function ThinkingSelectTrigger2({
|
|
|
9022
8934
|
onClick,
|
|
9023
8935
|
...props,
|
|
9024
8936
|
children: [
|
|
9025
|
-
trigger === "button" ? /* @__PURE__ */
|
|
9026
|
-
trigger === "slash" ? /* @__PURE__ */
|
|
9027
|
-
/* @__PURE__ */
|
|
9028
|
-
/* @__PURE__ */
|
|
9029
|
-
] }) : /* @__PURE__ */
|
|
9030
|
-
/* @__PURE__ */
|
|
9031
|
-
/* @__PURE__ */
|
|
8937
|
+
trigger === "button" ? /* @__PURE__ */ jsx28(ThinkingLevelGlyph, { level: value }) : null,
|
|
8938
|
+
trigger === "slash" ? /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
8939
|
+
/* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: "Thinking \xB7 " }),
|
|
8940
|
+
/* @__PURE__ */ jsx28("span", { className: "text-foreground", children: THINKING_LEVEL_STATUS_LABELS[value] })
|
|
8941
|
+
] }) : /* @__PURE__ */ jsxs24(Fragment11, { children: [
|
|
8942
|
+
/* @__PURE__ */ jsx28("span", { children: THINKING_LEVEL_LABELS[value] }),
|
|
8943
|
+
/* @__PURE__ */ jsx28(ChevronDownIcon5, { className: "h-3 w-3 shrink-0 text-muted-foreground/50", "aria-hidden": "true" })
|
|
9032
8944
|
] })
|
|
9033
8945
|
]
|
|
9034
8946
|
}
|
|
@@ -9077,7 +8989,7 @@ function ThinkingPickerMenu({
|
|
|
9077
8989
|
window.addEventListener("keydown", handler, { capture: true });
|
|
9078
8990
|
return () => window.removeEventListener("keydown", handler, { capture: true });
|
|
9079
8991
|
}, [activeIndex, disabled, onChange, onClose]);
|
|
9080
|
-
return /* @__PURE__ */
|
|
8992
|
+
return /* @__PURE__ */ jsx28("div", { ref: menuRef, "data-boring-agent": "", "data-boring-agent-part": "thinking-picker-menu", className: cn(composerPickerMenuClass, className), children: /* @__PURE__ */ jsx28(Command, { className: "bg-transparent text-[color:var(--popover-foreground)]", children: /* @__PURE__ */ jsx28(CommandList, { className: "max-h-[300px] p-0.5", children: THINKING_LEVELS.map((level, index) => /* @__PURE__ */ jsxs24(
|
|
9081
8993
|
CommandItem,
|
|
9082
8994
|
{
|
|
9083
8995
|
value: `Thinking ${THINKING_LEVEL_LABELS[level]} ${THINKING_LEVEL_DETAILS[level]}`,
|
|
@@ -9088,7 +9000,7 @@ function ThinkingPickerMenu({
|
|
|
9088
9000
|
},
|
|
9089
9001
|
className: selectorItemClass(level === value || index === activeIndex),
|
|
9090
9002
|
children: [
|
|
9091
|
-
/* @__PURE__ */
|
|
9003
|
+
/* @__PURE__ */ jsx28(
|
|
9092
9004
|
CheckIcon3,
|
|
9093
9005
|
{
|
|
9094
9006
|
className: cn(
|
|
@@ -9097,9 +9009,9 @@ function ThinkingPickerMenu({
|
|
|
9097
9009
|
)
|
|
9098
9010
|
}
|
|
9099
9011
|
),
|
|
9100
|
-
/* @__PURE__ */
|
|
9101
|
-
/* @__PURE__ */
|
|
9102
|
-
/* @__PURE__ */
|
|
9012
|
+
/* @__PURE__ */ jsx28(ThinkingLevelGlyph, { level }),
|
|
9013
|
+
/* @__PURE__ */ jsx28("span", { className: "font-medium", children: THINKING_LEVEL_LABELS[level] }),
|
|
9014
|
+
/* @__PURE__ */ jsx28("span", { className: "ml-auto text-xs text-muted-foreground", children: THINKING_LEVEL_DETAILS[level] })
|
|
9103
9015
|
]
|
|
9104
9016
|
},
|
|
9105
9017
|
level
|
|
@@ -9137,25 +9049,25 @@ import {
|
|
|
9137
9049
|
Monitor,
|
|
9138
9050
|
PlusIcon as PlusIcon2,
|
|
9139
9051
|
SquareIcon,
|
|
9140
|
-
XIcon as
|
|
9052
|
+
XIcon as XIcon4
|
|
9141
9053
|
} from "lucide-react";
|
|
9142
9054
|
import { nanoid } from "nanoid";
|
|
9143
9055
|
import { useCallback as useCallback15, useEffect as useEffect18, useMemo as useMemo13, useRef as useRef15, useState as useState17 } from "react";
|
|
9144
9056
|
|
|
9145
9057
|
// src/front/primitives/prompt-input-context.ts
|
|
9146
|
-
import { createContext as
|
|
9147
|
-
var PromptInputController =
|
|
9058
|
+
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
9059
|
+
var PromptInputController = createContext7(
|
|
9148
9060
|
null
|
|
9149
9061
|
);
|
|
9150
|
-
var ProviderAttachmentsContext =
|
|
9062
|
+
var ProviderAttachmentsContext = createContext7(
|
|
9151
9063
|
null
|
|
9152
9064
|
);
|
|
9153
|
-
var useOptionalPromptInputController = () =>
|
|
9154
|
-
var useOptionalProviderAttachments = () =>
|
|
9155
|
-
var LocalAttachmentsContext =
|
|
9065
|
+
var useOptionalPromptInputController = () => useContext7(PromptInputController);
|
|
9066
|
+
var useOptionalProviderAttachments = () => useContext7(ProviderAttachmentsContext);
|
|
9067
|
+
var LocalAttachmentsContext = createContext7(null);
|
|
9156
9068
|
var usePromptInputAttachments = () => {
|
|
9157
9069
|
const provider = useOptionalProviderAttachments();
|
|
9158
|
-
const local =
|
|
9070
|
+
const local = useContext7(LocalAttachmentsContext);
|
|
9159
9071
|
const context = local ?? provider;
|
|
9160
9072
|
if (!context) {
|
|
9161
9073
|
throw new Error(
|
|
@@ -9164,23 +9076,23 @@ var usePromptInputAttachments = () => {
|
|
|
9164
9076
|
}
|
|
9165
9077
|
return context;
|
|
9166
9078
|
};
|
|
9167
|
-
var LocalReferencedSourcesContext =
|
|
9079
|
+
var LocalReferencedSourcesContext = createContext7(null);
|
|
9168
9080
|
|
|
9169
9081
|
// src/front/primitives/prompt-input-wrappers.tsx
|
|
9170
9082
|
import {
|
|
9171
9083
|
InputGroupAddon,
|
|
9172
9084
|
InputGroupButton,
|
|
9173
|
-
Tooltip as
|
|
9174
|
-
TooltipContent as
|
|
9175
|
-
TooltipTrigger as
|
|
9085
|
+
Tooltip as Tooltip2,
|
|
9086
|
+
TooltipContent as TooltipContent2,
|
|
9087
|
+
TooltipTrigger as TooltipTrigger2
|
|
9176
9088
|
} from "@hachej/boring-ui-kit";
|
|
9177
9089
|
import { Children as Children2 } from "react";
|
|
9178
|
-
import { jsx as
|
|
9090
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9179
9091
|
var PromptInputFooter = ({
|
|
9180
9092
|
align = "block-end",
|
|
9181
9093
|
className,
|
|
9182
9094
|
...props
|
|
9183
|
-
}) => /* @__PURE__ */
|
|
9095
|
+
}) => /* @__PURE__ */ jsx29(
|
|
9184
9096
|
InputGroupAddon,
|
|
9185
9097
|
{
|
|
9186
9098
|
align,
|
|
@@ -9190,7 +9102,7 @@ var PromptInputFooter = ({
|
|
|
9190
9102
|
);
|
|
9191
9103
|
|
|
9192
9104
|
// src/front/primitives/prompt-input.tsx
|
|
9193
|
-
import { Fragment as Fragment12, jsx as
|
|
9105
|
+
import { Fragment as Fragment12, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9194
9106
|
var PromptInput = ({
|
|
9195
9107
|
className,
|
|
9196
9108
|
accept,
|
|
@@ -9533,8 +9445,8 @@ var PromptInput = ({
|
|
|
9533
9445
|
},
|
|
9534
9446
|
[usingProvider, controller, files, onSubmit, clear]
|
|
9535
9447
|
);
|
|
9536
|
-
const inner = /* @__PURE__ */
|
|
9537
|
-
/* @__PURE__ */
|
|
9448
|
+
const inner = /* @__PURE__ */ jsxs26(Fragment12, { children: [
|
|
9449
|
+
/* @__PURE__ */ jsx30(
|
|
9538
9450
|
Input,
|
|
9539
9451
|
{
|
|
9540
9452
|
accept,
|
|
@@ -9547,7 +9459,7 @@ var PromptInput = ({
|
|
|
9547
9459
|
type: "file"
|
|
9548
9460
|
}
|
|
9549
9461
|
),
|
|
9550
|
-
/* @__PURE__ */
|
|
9462
|
+
/* @__PURE__ */ jsx30(
|
|
9551
9463
|
"form",
|
|
9552
9464
|
{
|
|
9553
9465
|
"data-boring-agent-part": "composer",
|
|
@@ -9555,12 +9467,12 @@ var PromptInput = ({
|
|
|
9555
9467
|
onSubmit: handleSubmit,
|
|
9556
9468
|
ref: formRef,
|
|
9557
9469
|
...props,
|
|
9558
|
-
children: /* @__PURE__ */
|
|
9470
|
+
children: /* @__PURE__ */ jsx30(InputGroup, { className: "overflow-hidden", children })
|
|
9559
9471
|
}
|
|
9560
9472
|
)
|
|
9561
9473
|
] });
|
|
9562
|
-
const withReferencedSources = /* @__PURE__ */
|
|
9563
|
-
return /* @__PURE__ */
|
|
9474
|
+
const withReferencedSources = /* @__PURE__ */ jsx30(LocalReferencedSourcesContext.Provider, { value: refsCtx, children: inner });
|
|
9475
|
+
return /* @__PURE__ */ jsx30(LocalAttachmentsContext.Provider, { value: attachmentsCtx, children: withReferencedSources });
|
|
9564
9476
|
};
|
|
9565
9477
|
var PromptInputTextarea = ({
|
|
9566
9478
|
onChange,
|
|
@@ -9638,7 +9550,7 @@ var PromptInputTextarea = ({
|
|
|
9638
9550
|
} : {
|
|
9639
9551
|
onChange
|
|
9640
9552
|
};
|
|
9641
|
-
return /* @__PURE__ */
|
|
9553
|
+
return /* @__PURE__ */ jsx30(
|
|
9642
9554
|
InputGroupTextarea,
|
|
9643
9555
|
{
|
|
9644
9556
|
"data-boring-agent-part": "composer-input",
|
|
@@ -9665,13 +9577,13 @@ var PromptInputSubmit = ({
|
|
|
9665
9577
|
...props
|
|
9666
9578
|
}) => {
|
|
9667
9579
|
const isGenerating = status === "submitted" || status === "streaming";
|
|
9668
|
-
let Icon = /* @__PURE__ */
|
|
9580
|
+
let Icon = /* @__PURE__ */ jsx30(CornerDownLeftIcon, { className: "size-4" });
|
|
9669
9581
|
if (status === "submitted") {
|
|
9670
|
-
Icon = /* @__PURE__ */
|
|
9582
|
+
Icon = /* @__PURE__ */ jsx30(Spinner, {});
|
|
9671
9583
|
} else if (status === "streaming") {
|
|
9672
|
-
Icon = /* @__PURE__ */
|
|
9584
|
+
Icon = /* @__PURE__ */ jsx30(SquareIcon, { className: "size-4" });
|
|
9673
9585
|
} else if (status === "error") {
|
|
9674
|
-
Icon = /* @__PURE__ */
|
|
9586
|
+
Icon = /* @__PURE__ */ jsx30(XIcon4, { className: "size-4" });
|
|
9675
9587
|
}
|
|
9676
9588
|
const handleClick = useCallback15(
|
|
9677
9589
|
(e) => {
|
|
@@ -9684,7 +9596,7 @@ var PromptInputSubmit = ({
|
|
|
9684
9596
|
},
|
|
9685
9597
|
[isGenerating, onStop, onClick]
|
|
9686
9598
|
);
|
|
9687
|
-
return /* @__PURE__ */
|
|
9599
|
+
return /* @__PURE__ */ jsx30(
|
|
9688
9600
|
InputGroupButton2,
|
|
9689
9601
|
{
|
|
9690
9602
|
"aria-label": isGenerating ? "Stop" : "Submit",
|
|
@@ -9702,7 +9614,7 @@ var PromptInputSubmit = ({
|
|
|
9702
9614
|
|
|
9703
9615
|
// src/front/primitives/slash-command-picker.tsx
|
|
9704
9616
|
import { useEffect as useEffect19, useMemo as useMemo14, useRef as useRef16, useState as useState18 } from "react";
|
|
9705
|
-
import { Fragment as Fragment13, jsx as
|
|
9617
|
+
import { Fragment as Fragment13, jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
9706
9618
|
var ALL_PLUGINS = "__all__";
|
|
9707
9619
|
function commandGroup(cmd) {
|
|
9708
9620
|
if (cmd.source === "skill") return "skills";
|
|
@@ -9753,8 +9665,8 @@ function SlashCommandPicker({ query, commands, onSelect, onDismiss }) {
|
|
|
9753
9665
|
},
|
|
9754
9666
|
onDismiss
|
|
9755
9667
|
});
|
|
9756
|
-
return /* @__PURE__ */
|
|
9757
|
-
/* @__PURE__ */
|
|
9668
|
+
return /* @__PURE__ */ jsxs27("div", { ref: containerRef, className: "mb-1 w-full overflow-hidden rounded-lg border border-border/60 bg-popover shadow-lg", children: [
|
|
9669
|
+
/* @__PURE__ */ jsx31(
|
|
9758
9670
|
"input",
|
|
9759
9671
|
{
|
|
9760
9672
|
ref: inputRef,
|
|
@@ -9769,9 +9681,9 @@ function SlashCommandPicker({ query, commands, onSelect, onDismiss }) {
|
|
|
9769
9681
|
autoComplete: "off"
|
|
9770
9682
|
}
|
|
9771
9683
|
),
|
|
9772
|
-
/* @__PURE__ */
|
|
9684
|
+
/* @__PURE__ */ jsx31("div", { className: "flex flex-wrap gap-1 border-b border-border/50 px-2 py-1.5", role: "tablist", "aria-label": "Filter by plugin", children: [ALL_PLUGINS, ...groups].map((g) => {
|
|
9773
9685
|
const selected = plugin === g;
|
|
9774
|
-
return /* @__PURE__ */
|
|
9686
|
+
return /* @__PURE__ */ jsx31(
|
|
9775
9687
|
"button",
|
|
9776
9688
|
{
|
|
9777
9689
|
type: "button",
|
|
@@ -9791,7 +9703,7 @@ function SlashCommandPicker({ query, commands, onSelect, onDismiss }) {
|
|
|
9791
9703
|
g
|
|
9792
9704
|
);
|
|
9793
9705
|
}) }),
|
|
9794
|
-
filtered.length === 0 ? /* @__PURE__ */
|
|
9706
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx31("div", { className: "px-3 py-2 text-[11px] text-muted-foreground", children: "No matching commands." }) : /* @__PURE__ */ jsx31("ul", { ref: listRef, className: "max-h-80 overflow-y-auto py-1", role: "listbox", "aria-label": "Commands", children: filtered.map((cmd, i) => /* @__PURE__ */ jsxs27(
|
|
9795
9707
|
"li",
|
|
9796
9708
|
{
|
|
9797
9709
|
role: "option",
|
|
@@ -9809,20 +9721,20 @@ function SlashCommandPicker({ query, commands, onSelect, onDismiss }) {
|
|
|
9809
9721
|
onSelect(cmd.name);
|
|
9810
9722
|
},
|
|
9811
9723
|
children: [
|
|
9812
|
-
/* @__PURE__ */
|
|
9813
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ jsxs27("span", { className: "flex items-center gap-1.5", children: [
|
|
9725
|
+
/* @__PURE__ */ jsxs27("span", { className: "font-medium text-foreground/80", children: [
|
|
9814
9726
|
"/",
|
|
9815
9727
|
cmd.name
|
|
9816
9728
|
] }),
|
|
9817
|
-
cmd.source === "skill" ? /* @__PURE__ */
|
|
9818
|
-
/* @__PURE__ */
|
|
9819
|
-
cmd.sourcePlugin ? /* @__PURE__ */
|
|
9729
|
+
cmd.source === "skill" ? /* @__PURE__ */ jsxs27(Fragment13, { children: [
|
|
9730
|
+
/* @__PURE__ */ jsx31("span", { className: "rounded-sm bg-accent/15 px-1 py-px text-[9px] font-medium uppercase tracking-wide text-accent-foreground", children: "skill" }),
|
|
9731
|
+
cmd.sourcePlugin ? /* @__PURE__ */ jsx31("span", { className: "rounded-sm bg-muted px-1 py-px text-[9px] font-medium text-muted-foreground", children: cmd.sourcePlugin }) : null
|
|
9820
9732
|
] }) : cmd.sourcePlugin ? (
|
|
9821
9733
|
// Originating plugin/package for non-skill commands.
|
|
9822
|
-
/* @__PURE__ */
|
|
9734
|
+
/* @__PURE__ */ jsx31("span", { className: "rounded-sm bg-muted px-1 py-px text-[9px] font-medium text-muted-foreground", children: cmd.sourcePlugin })
|
|
9823
9735
|
) : null
|
|
9824
9736
|
] }),
|
|
9825
|
-
/* @__PURE__ */
|
|
9737
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate text-[11px] opacity-50", children: cmd.description })
|
|
9826
9738
|
]
|
|
9827
9739
|
},
|
|
9828
9740
|
cmd.name
|
|
@@ -9833,10 +9745,10 @@ function SlashCommandPicker({ query, commands, onSelect, onDismiss }) {
|
|
|
9833
9745
|
// src/front/chat/components/ComposerAttachments.tsx
|
|
9834
9746
|
import { AlertCircleIcon as AlertCircleIcon2, Loader2 as Loader22, PaperclipIcon as PaperclipIcon2 } from "lucide-react";
|
|
9835
9747
|
import { IconButton as IconButton3 } from "@hachej/boring-ui-kit";
|
|
9836
|
-
import { jsx as
|
|
9748
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
9837
9749
|
function AttachmentButton({ disabled, className }) {
|
|
9838
9750
|
const attachments = usePromptInputAttachments();
|
|
9839
|
-
return /* @__PURE__ */
|
|
9751
|
+
return /* @__PURE__ */ jsx32(
|
|
9840
9752
|
IconButton3,
|
|
9841
9753
|
{
|
|
9842
9754
|
type: "button",
|
|
@@ -9849,21 +9761,21 @@ function AttachmentButton({ disabled, className }) {
|
|
|
9849
9761
|
className: cn(composerActionClass, "composer-attachment-button !h-10 !w-10", className),
|
|
9850
9762
|
"aria-label": "Attach files",
|
|
9851
9763
|
title: disabled ? "Attachments are available when the composer is ready." : "Attach files",
|
|
9852
|
-
children: /* @__PURE__ */
|
|
9764
|
+
children: /* @__PURE__ */ jsx32(PaperclipIcon2, { className: "h-4 w-4", strokeWidth: 1.75 })
|
|
9853
9765
|
}
|
|
9854
9766
|
);
|
|
9855
9767
|
}
|
|
9856
9768
|
function AttachmentsList() {
|
|
9857
9769
|
const attachments = usePromptInputAttachments();
|
|
9858
9770
|
if (attachments.files.length === 0) return null;
|
|
9859
|
-
return /* @__PURE__ */
|
|
9771
|
+
return /* @__PURE__ */ jsx32(
|
|
9860
9772
|
Attachments,
|
|
9861
9773
|
{
|
|
9862
9774
|
"data-boring-agent-part": "composer-attachment-row",
|
|
9863
9775
|
"data-align": "block-start",
|
|
9864
9776
|
variant: "inline",
|
|
9865
9777
|
className: "w-full flex-wrap items-center justify-start gap-2 px-5 pb-0 pt-3",
|
|
9866
|
-
children: attachments.files.map((file) => /* @__PURE__ */
|
|
9778
|
+
children: attachments.files.map((file) => /* @__PURE__ */ jsxs28(
|
|
9867
9779
|
Attachment,
|
|
9868
9780
|
{
|
|
9869
9781
|
data: file,
|
|
@@ -9874,13 +9786,13 @@ function AttachmentsList() {
|
|
|
9874
9786
|
file.status === "error" && "!border-destructive/50 !bg-destructive/10"
|
|
9875
9787
|
),
|
|
9876
9788
|
children: [
|
|
9877
|
-
/* @__PURE__ */
|
|
9878
|
-
/* @__PURE__ */
|
|
9879
|
-
file.status === "uploading" ? /* @__PURE__ */
|
|
9880
|
-
file.status === "error" ? /* @__PURE__ */
|
|
9789
|
+
/* @__PURE__ */ jsxs28("div", { className: "relative shrink-0", children: [
|
|
9790
|
+
/* @__PURE__ */ jsx32(AttachmentPreview, { className: "!size-7 overflow-hidden !rounded-full bg-background/60" }),
|
|
9791
|
+
file.status === "uploading" ? /* @__PURE__ */ jsx32("div", { className: "absolute inset-0 flex items-center justify-center rounded-full bg-background/70", children: /* @__PURE__ */ jsx32(Loader22, { className: "size-3.5 animate-spin text-muted-foreground" }) }) : null,
|
|
9792
|
+
file.status === "error" ? /* @__PURE__ */ jsx32("div", { className: "absolute inset-0 flex items-center justify-center rounded-full bg-destructive/20", children: /* @__PURE__ */ jsx32(AlertCircleIcon2, { className: "size-3.5 text-destructive" }) }) : null
|
|
9881
9793
|
] }),
|
|
9882
|
-
/* @__PURE__ */
|
|
9883
|
-
/* @__PURE__ */
|
|
9794
|
+
/* @__PURE__ */ jsx32(AttachmentInfo, { className: "min-w-0 !max-w-[180px] truncate text-[13px] font-medium" }),
|
|
9795
|
+
/* @__PURE__ */ jsx32(AttachmentRemove, { className: "composer-attachment-remove !size-5 !rounded-full !opacity-100 text-muted-foreground/80 hover:text-foreground" })
|
|
9884
9796
|
]
|
|
9885
9797
|
},
|
|
9886
9798
|
file.id
|
|
@@ -9890,9 +9802,9 @@ function AttachmentsList() {
|
|
|
9890
9802
|
}
|
|
9891
9803
|
|
|
9892
9804
|
// src/front/chat/components/PiChatComposerSurface.tsx
|
|
9893
|
-
import { jsx as
|
|
9805
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
9894
9806
|
var MAX_PROMPT_ATTACHMENTS = 2;
|
|
9895
|
-
var MAX_PROMPT_ATTACHMENT_BYTES =
|
|
9807
|
+
var MAX_PROMPT_ATTACHMENT_BYTES = 10 * 1024 * 1024;
|
|
9896
9808
|
var COMPOSER_INPUT_GROUP_MIN_HEIGHT = 56;
|
|
9897
9809
|
var COMPOSER_TEXTAREA_MAX_HEIGHT = 160;
|
|
9898
9810
|
var COMPOSER_MULTILINE_EXTRA_HEIGHT = 8;
|
|
@@ -10005,11 +9917,11 @@ function PiChatComposerSurface({
|
|
|
10005
9917
|
useLayoutEffect3(() => {
|
|
10006
9918
|
resizeTextarea(textareaRef.current);
|
|
10007
9919
|
}, [draft, resizeTextarea, textareaRef]);
|
|
10008
|
-
return /* @__PURE__ */
|
|
9920
|
+
return /* @__PURE__ */ jsxs29("div", { className: cn(
|
|
10009
9921
|
"relative z-20",
|
|
10010
9922
|
chrome ? "pb-[calc(1rem+env(safe-area-inset-bottom))] pl-[calc(1rem+env(safe-area-inset-left))] pr-[calc(1rem+env(safe-area-inset-right))] pt-2 sm:pb-[calc(1.25rem+env(safe-area-inset-bottom))] sm:pl-[calc(1.5rem+env(safe-area-inset-left))] sm:pr-[calc(1.5rem+env(safe-area-inset-right))]" : "pb-[calc(0.5rem+env(safe-area-inset-bottom))] pl-[calc(0.75rem+env(safe-area-inset-left))] pr-[calc(0.75rem+env(safe-area-inset-right))] pt-1"
|
|
10011
9923
|
), children: [
|
|
10012
|
-
/* @__PURE__ */
|
|
9924
|
+
/* @__PURE__ */ jsx33(
|
|
10013
9925
|
"div",
|
|
10014
9926
|
{
|
|
10015
9927
|
"data-boring-agent-part": "chat-working-slot",
|
|
@@ -10019,7 +9931,7 @@ function PiChatComposerSurface({
|
|
|
10019
9931
|
isStreaming ? "mb-2 max-h-8 opacity-100" : "mb-0 max-h-0 opacity-0"
|
|
10020
9932
|
),
|
|
10021
9933
|
"aria-hidden": !isStreaming,
|
|
10022
|
-
children: /* @__PURE__ */
|
|
9934
|
+
children: /* @__PURE__ */ jsxs29(
|
|
10023
9935
|
"div",
|
|
10024
9936
|
{
|
|
10025
9937
|
"data-testid": isStreaming ? "chat-working" : void 0,
|
|
@@ -10027,7 +9939,7 @@ function PiChatComposerSurface({
|
|
|
10027
9939
|
"aria-live": isStreaming ? "polite" : void 0,
|
|
10028
9940
|
className: "inline-flex items-center gap-2 rounded-full border border-border/50 bg-background/85 px-2.5 py-1 text-[12px] text-foreground shadow-sm backdrop-blur",
|
|
10029
9941
|
children: [
|
|
10030
|
-
/* @__PURE__ */
|
|
9942
|
+
/* @__PURE__ */ jsx33(
|
|
10031
9943
|
motion2.span,
|
|
10032
9944
|
{
|
|
10033
9945
|
"aria-hidden": "true",
|
|
@@ -10036,14 +9948,14 @@ function PiChatComposerSurface({
|
|
|
10036
9948
|
transition: prefersReducedMotion ? { duration: 0 } : { duration: 1.2, repeat: Infinity, ease: "easeInOut" }
|
|
10037
9949
|
}
|
|
10038
9950
|
),
|
|
10039
|
-
/* @__PURE__ */
|
|
9951
|
+
/* @__PURE__ */ jsx33("span", { children: "Working\u2026" })
|
|
10040
9952
|
]
|
|
10041
9953
|
}
|
|
10042
9954
|
)
|
|
10043
9955
|
}
|
|
10044
9956
|
),
|
|
10045
|
-
composerStatusNotice ? /* @__PURE__ */
|
|
10046
|
-
composerBlocked && !workspaceWarmupBlocked ? /* @__PURE__ */
|
|
9957
|
+
composerStatusNotice ? /* @__PURE__ */ jsx33(ComposerRuntimeNotice, { notice: composerStatusNotice }) : null,
|
|
9958
|
+
composerBlocked && !workspaceWarmupBlocked ? /* @__PURE__ */ jsx33(
|
|
10047
9959
|
ComposerBlockerNotice,
|
|
10048
9960
|
{
|
|
10049
9961
|
blocker: primaryComposerBlocker,
|
|
@@ -10051,8 +9963,8 @@ function PiChatComposerSurface({
|
|
|
10051
9963
|
onAction: onComposerBlockerAction
|
|
10052
9964
|
}
|
|
10053
9965
|
) : null,
|
|
10054
|
-
queuePreview.length > 0 ? /* @__PURE__ */
|
|
10055
|
-
hotReloadEnabled ? /* @__PURE__ */
|
|
9966
|
+
queuePreview.length > 0 ? /* @__PURE__ */ jsx33(QueuedComposerNotice, { followUps: queuePreview, onEdit: onEditQueued }) : null,
|
|
9967
|
+
hotReloadEnabled ? /* @__PURE__ */ jsx33(
|
|
10056
9968
|
PluginUpdateStatus,
|
|
10057
9969
|
{
|
|
10058
9970
|
state: pluginUpdateState,
|
|
@@ -10060,14 +9972,14 @@ function PiChatComposerSurface({
|
|
|
10060
9972
|
onRetry: onRunPluginUpdate
|
|
10061
9973
|
}
|
|
10062
9974
|
) : null,
|
|
10063
|
-
/* @__PURE__ */
|
|
9975
|
+
/* @__PURE__ */ jsx33(
|
|
10064
9976
|
CommandRunStatus,
|
|
10065
9977
|
{
|
|
10066
9978
|
state: commandNotifyState,
|
|
10067
9979
|
onDismiss: onDismissCommandNotify
|
|
10068
9980
|
}
|
|
10069
9981
|
),
|
|
10070
|
-
attachmentNotice ? /* @__PURE__ */
|
|
9982
|
+
attachmentNotice ? /* @__PURE__ */ jsx33(
|
|
10071
9983
|
"div",
|
|
10072
9984
|
{
|
|
10073
9985
|
role: "status",
|
|
@@ -10076,12 +9988,12 @@ function PiChatComposerSurface({
|
|
|
10076
9988
|
children: attachmentNotice
|
|
10077
9989
|
}
|
|
10078
9990
|
) : null,
|
|
10079
|
-
/* @__PURE__ */
|
|
10080
|
-
/* @__PURE__ */
|
|
9991
|
+
/* @__PURE__ */ jsxs29("div", { className: cn("@container group/composer relative mx-auto w-full", chrome ? "max-w-3xl" : "max-w-[680px]"), children: [
|
|
9992
|
+
/* @__PURE__ */ jsxs29("div", { className: cn(
|
|
10081
9993
|
"absolute inset-x-0 z-30",
|
|
10082
9994
|
pickerPlacement === "above-compact" ? "bottom-[calc(100%+4px)] [&_[cmdk-list]]:!max-h-[200px]" : "bottom-[calc(100%+4px)]"
|
|
10083
9995
|
), children: [
|
|
10084
|
-
mentionState ? /* @__PURE__ */
|
|
9996
|
+
mentionState ? /* @__PURE__ */ jsx33("div", { className: "mr-px ml-[43px]", children: /* @__PURE__ */ jsx33(
|
|
10085
9997
|
MentionPicker,
|
|
10086
9998
|
{
|
|
10087
9999
|
mention: mentionState,
|
|
@@ -10093,7 +10005,7 @@ function PiChatComposerSurface({
|
|
|
10093
10005
|
onDismiss: onDismissMention
|
|
10094
10006
|
}
|
|
10095
10007
|
) }) : null,
|
|
10096
|
-
slashQuery !== null ? /* @__PURE__ */
|
|
10008
|
+
slashQuery !== null ? /* @__PURE__ */ jsx33("div", { className: "mr-px ml-[43px]", children: /* @__PURE__ */ jsx33(
|
|
10097
10009
|
SlashCommandPicker,
|
|
10098
10010
|
{
|
|
10099
10011
|
query: slashQuery,
|
|
@@ -10102,7 +10014,7 @@ function PiChatComposerSurface({
|
|
|
10102
10014
|
onDismiss: onDismissSlash
|
|
10103
10015
|
}
|
|
10104
10016
|
) }) : null,
|
|
10105
|
-
mentionState === null && slashQuery === null && modelPickerOpen ? /* @__PURE__ */
|
|
10017
|
+
mentionState === null && slashQuery === null && modelPickerOpen ? /* @__PURE__ */ jsx33("div", { className: "mr-px mb-1 ml-[43px]", children: /* @__PURE__ */ jsx33(
|
|
10106
10018
|
ModelPickerMenu,
|
|
10107
10019
|
{
|
|
10108
10020
|
value: selectedModel,
|
|
@@ -10113,7 +10025,7 @@ function PiChatComposerSurface({
|
|
|
10113
10025
|
onClose: () => onSetModelPickerOpen(false)
|
|
10114
10026
|
}
|
|
10115
10027
|
) }) : null,
|
|
10116
|
-
mentionState === null && slashQuery === null && thinkingPickerOpen ? /* @__PURE__ */
|
|
10028
|
+
mentionState === null && slashQuery === null && thinkingPickerOpen ? /* @__PURE__ */ jsx33("div", { className: "mr-px mb-1 ml-[43px]", children: /* @__PURE__ */ jsx33(
|
|
10117
10029
|
ThinkingPickerMenu,
|
|
10118
10030
|
{
|
|
10119
10031
|
value: selectedThinking,
|
|
@@ -10123,17 +10035,17 @@ function PiChatComposerSurface({
|
|
|
10123
10035
|
}
|
|
10124
10036
|
) }) : null
|
|
10125
10037
|
] }),
|
|
10126
|
-
composerContributions.map(({ id, Top }) => Top ? /* @__PURE__ */
|
|
10038
|
+
composerContributions.map(({ id, Top }) => Top ? /* @__PURE__ */ jsx33(
|
|
10127
10039
|
"div",
|
|
10128
10040
|
{
|
|
10129
10041
|
"data-boring-agent-part": "composer-contribution-top",
|
|
10130
10042
|
"data-boring-agent-contribution-id": id,
|
|
10131
10043
|
className: cn("mx-auto mb-2 w-full empty:hidden", chrome ? "max-w-3xl" : "max-w-[680px]"),
|
|
10132
|
-
children: /* @__PURE__ */
|
|
10044
|
+
children: /* @__PURE__ */ jsx33(Top, {})
|
|
10133
10045
|
},
|
|
10134
10046
|
id
|
|
10135
10047
|
) : null),
|
|
10136
|
-
/* @__PURE__ */
|
|
10048
|
+
/* @__PURE__ */ jsx33(
|
|
10137
10049
|
"div",
|
|
10138
10050
|
{
|
|
10139
10051
|
"data-boring-agent-part": "composer-rail",
|
|
@@ -10152,7 +10064,7 @@ function PiChatComposerSurface({
|
|
|
10152
10064
|
"[&[data-composer-multiline=true]_[data-boring-agent-part=composer-submit-addon]]:self-end",
|
|
10153
10065
|
"[&[data-composer-multiline=true]_[data-boring-agent-part=composer-submit-addon]]:mb-2"
|
|
10154
10066
|
),
|
|
10155
|
-
children: /* @__PURE__ */
|
|
10067
|
+
children: /* @__PURE__ */ jsxs29(
|
|
10156
10068
|
PromptInput,
|
|
10157
10069
|
{
|
|
10158
10070
|
"data-boring-state": status,
|
|
@@ -10163,20 +10075,20 @@ function PiChatComposerSurface({
|
|
|
10163
10075
|
maxFileSize: MAX_PROMPT_ATTACHMENT_BYTES,
|
|
10164
10076
|
onError: (err) => {
|
|
10165
10077
|
if (err.code === "max_files") onAttachmentNotice(`Up to ${MAX_PROMPT_ATTACHMENTS} attachments per message.`);
|
|
10166
|
-
else if (err.code === "max_file_size") onAttachmentNotice("Files must be
|
|
10078
|
+
else if (err.code === "max_file_size") onAttachmentNotice("Files must be 10 MB or smaller.");
|
|
10167
10079
|
else if (err.code === "accept") onAttachmentNotice("That file type isn't supported here.");
|
|
10168
10080
|
else onAttachmentNotice(err.message || "Attachment rejected.");
|
|
10169
10081
|
},
|
|
10170
10082
|
children: [
|
|
10171
|
-
/* @__PURE__ */
|
|
10172
|
-
/* @__PURE__ */
|
|
10083
|
+
/* @__PURE__ */ jsx33(AttachmentsList, {}),
|
|
10084
|
+
/* @__PURE__ */ jsxs29(
|
|
10173
10085
|
"div",
|
|
10174
10086
|
{
|
|
10175
10087
|
"data-boring-agent-part": "composer-input-row",
|
|
10176
10088
|
className: "flex min-h-[var(--composer-input-group-height)] w-full items-center",
|
|
10177
10089
|
children: [
|
|
10178
|
-
/* @__PURE__ */
|
|
10179
|
-
/* @__PURE__ */
|
|
10090
|
+
/* @__PURE__ */ jsx33("div", { className: "flex h-14 shrink-0 items-center pl-2", children: /* @__PURE__ */ jsx33(AttachmentButton, { disabled: disabled || isStreaming }) }),
|
|
10091
|
+
/* @__PURE__ */ jsx33(
|
|
10180
10092
|
PromptInputTextarea,
|
|
10181
10093
|
{
|
|
10182
10094
|
value: draft,
|
|
@@ -10200,24 +10112,24 @@ function PiChatComposerSurface({
|
|
|
10200
10112
|
)
|
|
10201
10113
|
}
|
|
10202
10114
|
),
|
|
10203
|
-
/* @__PURE__ */
|
|
10115
|
+
/* @__PURE__ */ jsx33(
|
|
10204
10116
|
PromptInputFooter,
|
|
10205
10117
|
{
|
|
10206
10118
|
align: "inline-end",
|
|
10207
10119
|
"data-boring-agent-part": "composer-submit-addon",
|
|
10208
10120
|
className: "!order-none !w-auto shrink-0 self-center justify-between border-0 bg-transparent !px-2 !py-0",
|
|
10209
|
-
children: /* @__PURE__ */
|
|
10210
|
-
composerContributions.map(({ id, Action }) => Action ? /* @__PURE__ */
|
|
10121
|
+
children: /* @__PURE__ */ jsxs29("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
10122
|
+
composerContributions.map(({ id, Action }) => Action ? /* @__PURE__ */ jsx33(
|
|
10211
10123
|
"span",
|
|
10212
10124
|
{
|
|
10213
10125
|
"data-boring-agent-part": "composer-contribution-action",
|
|
10214
10126
|
"data-boring-agent-contribution-id": id,
|
|
10215
10127
|
className: "contents",
|
|
10216
|
-
children: /* @__PURE__ */
|
|
10128
|
+
children: /* @__PURE__ */ jsx33(Action, { updateDraft })
|
|
10217
10129
|
},
|
|
10218
10130
|
id
|
|
10219
10131
|
) : null),
|
|
10220
|
-
/* @__PURE__ */
|
|
10132
|
+
/* @__PURE__ */ jsx33(
|
|
10221
10133
|
PromptInputSubmit,
|
|
10222
10134
|
{
|
|
10223
10135
|
"data-boring-agent-part": "composer-submit",
|
|
@@ -10247,7 +10159,7 @@ function PiChatComposerSurface({
|
|
|
10247
10159
|
)
|
|
10248
10160
|
}
|
|
10249
10161
|
),
|
|
10250
|
-
hideComposerSettings ? null : /* @__PURE__ */
|
|
10162
|
+
hideComposerSettings ? null : /* @__PURE__ */ jsx33(
|
|
10251
10163
|
"div",
|
|
10252
10164
|
{
|
|
10253
10165
|
"data-boring-agent-part": "composer-settings-row",
|
|
@@ -10255,8 +10167,8 @@ function PiChatComposerSurface({
|
|
|
10255
10167
|
"mx-auto mt-2 grid min-h-8 w-full grid-cols-[minmax(0,1fr)_auto] items-center text-xs text-muted-foreground",
|
|
10256
10168
|
chrome ? "max-w-3xl" : "max-w-[680px]"
|
|
10257
10169
|
),
|
|
10258
|
-
children: /* @__PURE__ */
|
|
10259
|
-
/* @__PURE__ */
|
|
10170
|
+
children: /* @__PURE__ */ jsxs29("div", { className: "flex min-w-0 items-center justify-center gap-1", children: [
|
|
10171
|
+
/* @__PURE__ */ jsx33(
|
|
10260
10172
|
ModelSelectTrigger,
|
|
10261
10173
|
{
|
|
10262
10174
|
value: selectedModel,
|
|
@@ -10274,7 +10186,7 @@ function PiChatComposerSurface({
|
|
|
10274
10186
|
}
|
|
10275
10187
|
}
|
|
10276
10188
|
),
|
|
10277
|
-
thinkingControl ? /* @__PURE__ */
|
|
10189
|
+
thinkingControl ? /* @__PURE__ */ jsx33(
|
|
10278
10190
|
ThinkingSelectTrigger,
|
|
10279
10191
|
{
|
|
10280
10192
|
value: selectedThinking,
|
|
@@ -10505,8 +10417,8 @@ function useRemotePiSessionState(session) {
|
|
|
10505
10417
|
}
|
|
10506
10418
|
|
|
10507
10419
|
// src/front/chat/PiChatPanel.tsx
|
|
10508
|
-
import { jsx as
|
|
10509
|
-
var DebugDrawer2 = lazy(() => import("../DebugDrawer-
|
|
10420
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10421
|
+
var DebugDrawer2 = lazy(() => import("../DebugDrawer-JNA43SVR.js").then((m) => ({ default: m.DebugDrawer })));
|
|
10510
10422
|
var EMPTY_COMMANDS = [];
|
|
10511
10423
|
var EMPTY_COMMAND_NAMES = [];
|
|
10512
10424
|
var EMPTY_BLOCKERS = [];
|
|
@@ -10561,7 +10473,6 @@ function PiChatPanel({
|
|
|
10561
10473
|
allowPromptDuringInitialHydration = false,
|
|
10562
10474
|
workspaceWarmupStatus,
|
|
10563
10475
|
onSessionReset,
|
|
10564
|
-
onCreateSession,
|
|
10565
10476
|
onBeforeSubmit,
|
|
10566
10477
|
onReloadAgentPlugins,
|
|
10567
10478
|
onCommandResult,
|
|
@@ -10816,33 +10727,12 @@ function PiChatPanel({
|
|
|
10816
10727
|
});
|
|
10817
10728
|
setLocalNotices((previous) => previous.filter((notice) => notice.id !== id));
|
|
10818
10729
|
}, []);
|
|
10819
|
-
const createSessionInFlightRef = useRef18(null);
|
|
10820
|
-
const [creatingSession, setCreatingSession] = useState20(false);
|
|
10821
10730
|
const createSession = useCallback18(() => {
|
|
10822
|
-
if (
|
|
10823
|
-
|
|
10824
|
-
setCreatingSession(true);
|
|
10825
|
-
const operation = (async () => {
|
|
10826
|
-
await Promise.resolve();
|
|
10827
|
-
if (externalSessionId) await onCreateSession?.();
|
|
10828
|
-
else await sessions.create();
|
|
10829
|
-
})().catch((error) => {
|
|
10731
|
+
if (externalSessionId) return;
|
|
10732
|
+
void sessions.create().catch((error) => {
|
|
10830
10733
|
addLocalNotice({ id: "session-create-error", level: "error", text: errorMessage2(error, "Could not create a chat session."), dismissible: true });
|
|
10831
|
-
}).finally(() => {
|
|
10832
|
-
if (createSessionInFlightRef.current === operation) createSessionInFlightRef.current = null;
|
|
10833
|
-
setCreatingSession(false);
|
|
10834
10734
|
});
|
|
10835
|
-
|
|
10836
|
-
return operation;
|
|
10837
|
-
}, [addLocalNotice, externalSessionId, onCreateSession, sessions.create]);
|
|
10838
|
-
const renderRuntimeNoticeAction = useCallback18((notice) => {
|
|
10839
|
-
const hostAction = renderNoticeAction?.(notice);
|
|
10840
|
-
if (hostAction != null) return hostAction;
|
|
10841
|
-
if (notice.errorCode === AgentGatewayErrorCode.AGENT_SESSION_RUNTIME_SCOPE_MISMATCH && (!externalSessionId || onCreateSession)) {
|
|
10842
|
-
return /* @__PURE__ */ jsx36(Button12, { type: "button", size: "sm", variant: "outline", disabled: creatingSession, onClick: createSession, children: creatingSession ? "Starting new chat\u2026" : "Start new chat" });
|
|
10843
|
-
}
|
|
10844
|
-
return null;
|
|
10845
|
-
}, [createSession, creatingSession, externalSessionId, onCreateSession, renderNoticeAction]);
|
|
10735
|
+
}, [addLocalNotice, externalSessionId, sessions.create]);
|
|
10846
10736
|
useEffect21(() => {
|
|
10847
10737
|
if (externalSessionId || sessionsLoading || sessionsError || activeSessionId || sessionList.length > 0) return;
|
|
10848
10738
|
if (resetInProgressRef.current) return;
|
|
@@ -11331,7 +11221,7 @@ function PiChatPanel({
|
|
|
11331
11221
|
if (result === false) setComposerDraft(text);
|
|
11332
11222
|
});
|
|
11333
11223
|
}, [sendComposerMessage, setComposerDraft]);
|
|
11334
|
-
const composerSurface = /* @__PURE__ */
|
|
11224
|
+
const composerSurface = /* @__PURE__ */ jsx34(
|
|
11335
11225
|
PiChatComposerSurface,
|
|
11336
11226
|
{
|
|
11337
11227
|
chrome,
|
|
@@ -11396,7 +11286,7 @@ function PiChatPanel({
|
|
|
11396
11286
|
onStop: stop
|
|
11397
11287
|
}
|
|
11398
11288
|
);
|
|
11399
|
-
return /* @__PURE__ */
|
|
11289
|
+
return /* @__PURE__ */ jsx34(ArtifactOpenProvider, { onOpenArtifact, children: /* @__PURE__ */ jsxs30(
|
|
11400
11290
|
"div",
|
|
11401
11291
|
{
|
|
11402
11292
|
"data-boring-agent": "",
|
|
@@ -11414,7 +11304,7 @@ function PiChatPanel({
|
|
|
11414
11304
|
role: "region",
|
|
11415
11305
|
"aria-label": "Agent assistant",
|
|
11416
11306
|
children: [
|
|
11417
|
-
showSessionSidebar ? /* @__PURE__ */
|
|
11307
|
+
showSessionSidebar ? /* @__PURE__ */ jsx34("aside", { "data-boring-agent-part": "pi-chat-session-sidebar", className: "min-h-0 w-64 shrink-0 border-r border-border/60", children: /* @__PURE__ */ jsx34(
|
|
11418
11308
|
SessionList,
|
|
11419
11309
|
{
|
|
11420
11310
|
sessions: sessionList,
|
|
@@ -11428,7 +11318,7 @@ function PiChatPanel({
|
|
|
11428
11318
|
loadingMore: sessions.loadingMore
|
|
11429
11319
|
}
|
|
11430
11320
|
) }) : null,
|
|
11431
|
-
/* @__PURE__ */
|
|
11321
|
+
/* @__PURE__ */ jsx34("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: /* @__PURE__ */ jsxs30(
|
|
11432
11322
|
"div",
|
|
11433
11323
|
{
|
|
11434
11324
|
className: cn(
|
|
@@ -11437,7 +11327,7 @@ function PiChatPanel({
|
|
|
11437
11327
|
chrome && "mx-3 my-3 rounded-xl bg-[color:var(--surface-chat)] shadow-[0_1px_0_oklch(0_0_0/0.02),0_1px_2px_-1px_oklch(0_0_0/0.04),inset_0_0_0_1px_oklch(from_var(--border)_l_c_h/0.6)]"
|
|
11438
11328
|
),
|
|
11439
11329
|
children: [
|
|
11440
|
-
/* @__PURE__ */
|
|
11330
|
+
/* @__PURE__ */ jsx34(
|
|
11441
11331
|
PiConversationSurface,
|
|
11442
11332
|
{
|
|
11443
11333
|
chrome,
|
|
@@ -11453,7 +11343,7 @@ function PiChatPanel({
|
|
|
11453
11343
|
onMentionActivate: activateAssistantMention,
|
|
11454
11344
|
runtimeNotices,
|
|
11455
11345
|
onDismissNotice: clearLocalNotice,
|
|
11456
|
-
renderNoticeAction
|
|
11346
|
+
renderNoticeAction,
|
|
11457
11347
|
onScrollToBottomReady: (scrollToBottom) => {
|
|
11458
11348
|
scrollToBottomRef.current = scrollToBottom;
|
|
11459
11349
|
},
|
|
@@ -11463,13 +11353,13 @@ function PiChatPanel({
|
|
|
11463
11353
|
}
|
|
11464
11354
|
),
|
|
11465
11355
|
composerSurface,
|
|
11466
|
-
emptyHero ? /* @__PURE__ */
|
|
11356
|
+
emptyHero ? /* @__PURE__ */ jsxs30(
|
|
11467
11357
|
"div",
|
|
11468
11358
|
{
|
|
11469
11359
|
"data-boring-agent-part": "empty-hero-suggestions",
|
|
11470
11360
|
className: "@container mx-auto w-full max-w-[640px] px-2 pb-4",
|
|
11471
11361
|
children: [
|
|
11472
|
-
/* @__PURE__ */
|
|
11362
|
+
/* @__PURE__ */ jsx34(ChatSuggestionGrid, { suggestions, onSelect: selectEmptySuggestion, className: "mt-4" }),
|
|
11473
11363
|
emptyState?.footer
|
|
11474
11364
|
]
|
|
11475
11365
|
}
|
|
@@ -11477,7 +11367,7 @@ function PiChatPanel({
|
|
|
11477
11367
|
]
|
|
11478
11368
|
}
|
|
11479
11369
|
) }),
|
|
11480
|
-
debug ? /* @__PURE__ */
|
|
11370
|
+
debug ? /* @__PURE__ */ jsx34(Suspense, { fallback: null, children: /* @__PURE__ */ jsx34("div", { "aria-label": "Chat debug metadata", className: "contents", role: "region", children: /* @__PURE__ */ jsx34(
|
|
11481
11371
|
DebugDrawer2,
|
|
11482
11372
|
{
|
|
11483
11373
|
agentTypeId,
|
|
@@ -11666,7 +11556,13 @@ function getAgentCommands(options = {}) {
|
|
|
11666
11556
|
return commands;
|
|
11667
11557
|
}
|
|
11668
11558
|
export {
|
|
11559
|
+
Artifact,
|
|
11560
|
+
ArtifactAction,
|
|
11561
|
+
ArtifactActions,
|
|
11562
|
+
ArtifactDescription,
|
|
11563
|
+
ArtifactHeader,
|
|
11669
11564
|
ArtifactOpenProvider,
|
|
11565
|
+
ArtifactTitle,
|
|
11670
11566
|
ChatEmptyState,
|
|
11671
11567
|
ChatMessageContributionProvider,
|
|
11672
11568
|
PiChatPanel as ChatPanel,
|
|
@@ -11692,7 +11588,6 @@ export {
|
|
|
11692
11588
|
PromptInputFooter,
|
|
11693
11589
|
PromptInputSubmit,
|
|
11694
11590
|
PromptInputTextarea,
|
|
11695
|
-
RUNTIME_SCOPE_MISMATCH_MESSAGE,
|
|
11696
11591
|
Reasoning,
|
|
11697
11592
|
ReasoningContent,
|
|
11698
11593
|
ReasoningTrigger,
|
|
@@ -11711,7 +11606,6 @@ export {
|
|
|
11711
11606
|
gatewayResponseError,
|
|
11712
11607
|
gatewayResponseErrorFromBody,
|
|
11713
11608
|
getAgentCommands,
|
|
11714
|
-
isRuntimeScopeMismatchError,
|
|
11715
11609
|
matchPiSessionSearch,
|
|
11716
11610
|
mergeShadcnToolRenderers,
|
|
11717
11611
|
mergeToolRenderers,
|