@tangle-network/ui 11.44.0 → 11.44.1
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/CHANGELOG.md +6 -0
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/auth/auth.d.ts +1 -3
- package/dist/auth/auth.js +1 -2
- package/dist/auth/login-layout.d.ts +1 -3
- package/dist/auth/login-layout.js +1 -2
- package/dist/chat/agent-timeline.d.ts +1 -3
- package/dist/chat/agent-timeline.js +1 -2
- package/dist/chat/chat-container.d.ts +1 -3
- package/dist/chat/chat-container.js +3 -4
- package/dist/chat/chat-message.d.ts +1 -3
- package/dist/chat/chat-message.js +1 -2
- package/dist/chat/message-author.d.ts +1 -3
- package/dist/chat/message-author.js +1 -2
- package/dist/chat/message-list.d.ts +1 -3
- package/dist/chat/message-list.js +1 -2
- package/dist/chat/synthetic-text.js +1 -2
- package/dist/chat/thinking-indicator.d.ts +1 -3
- package/dist/chat/thinking-indicator.js +1 -2
- package/dist/chat/transcript-text.d.ts +1 -3
- package/dist/chat/transcript-text.js +1 -2
- package/dist/chat/user-message.d.ts +1 -3
- package/dist/chat/user-message.js +1 -2
- package/dist/code-presentation.js +1 -2
- package/dist/editor/document-editor-pane.d.ts +1 -3
- package/dist/editor/document-editor-pane.js +3 -4
- package/dist/editor/editor-lazy.js +1 -2
- package/dist/editor/editor-loading.js +1 -2
- package/dist/editor/editor-peers.js +1 -2
- package/dist/editor/editor-provider.d.ts +1 -3
- package/dist/editor/editor-provider.js +1 -2
- package/dist/editor/editor-toolbar.d.ts +1 -3
- package/dist/editor/editor-toolbar.js +1 -2
- package/dist/editor/markdown-conversion.js +1 -2
- package/dist/editor/markdown-document-editor.js +1 -2
- package/dist/editor/source-markdown-editor.js +1 -2
- package/dist/editor/source-markdown.js +1 -2
- package/dist/editor/tiptap-editor.d.ts +0 -2
- package/dist/editor/tiptap-editor.js +1 -2
- package/dist/editor/use-editor.d.ts +1 -3
- package/dist/editor/use-editor.js +1 -2
- package/dist/files/file-artifact-pane.d.ts +1 -3
- package/dist/files/file-artifact-pane.js +4 -5
- package/dist/files/file-card.d.ts +1 -3
- package/dist/files/file-card.js +1 -2
- package/dist/files/file-format.d.ts +1 -3
- package/dist/files/file-format.js +1 -2
- package/dist/files/file-list.d.ts +1 -3
- package/dist/files/file-list.js +1 -2
- package/dist/files/file-preview.d.ts +1 -3
- package/dist/files/file-preview.js +1 -2
- package/dist/files/file-tabs.d.ts +1 -3
- package/dist/files/file-tabs.js +1 -2
- package/dist/files/file-tree.d.ts +1 -3
- package/dist/files/file-tree.js +1 -2
- package/dist/files/pdf-loader.d.ts +1 -3
- package/dist/files/pdf-loader.js +1 -2
- package/dist/files/pdf-viewer.d.ts +1 -3
- package/dist/files/pdf-viewer.js +1 -2
- package/dist/files/rich-file-tree.d.ts +1 -3
- package/dist/files/rich-file-tree.js +1 -2
- package/dist/hooks/use-auth.d.ts +1 -3
- package/dist/hooks/use-auth.js +1 -2
- package/dist/hooks/use-auto-scroll.d.ts +1 -3
- package/dist/hooks/use-auto-scroll.js +1 -2
- package/dist/hooks/use-dropdown-menu.d.ts +1 -2
- package/dist/hooks/use-dropdown-menu.js +1 -2
- package/dist/hooks/use-live-time.d.ts +1 -3
- package/dist/hooks/use-live-time.js +1 -2
- package/dist/hooks/use-realtime-session.d.ts +1 -3
- package/dist/hooks/use-realtime-session.js +1 -2
- package/dist/hooks/use-run-collapse-state.d.ts +1 -3
- package/dist/hooks/use-run-collapse-state.js +1 -2
- package/dist/hooks/use-run-groups.d.ts +1 -3
- package/dist/hooks/use-run-groups.js +1 -2
- package/dist/hooks/use-sdk-session.d.ts +1 -3
- package/dist/hooks/use-sdk-session.js +1 -2
- package/dist/hooks/use-sse-stream.d.ts +1 -3
- package/dist/hooks/use-sse-stream.js +1 -2
- package/dist/hooks/use-tool-call-stream.d.ts +1 -3
- package/dist/hooks/use-tool-call-stream.js +1 -2
- package/dist/lib/code-presentation.d.ts +1 -3
- package/dist/lib/code-presentation.js +1 -2
- package/dist/lib/control-presentation.d.ts +0 -2
- package/dist/lib/control-presentation.js +1 -2
- package/dist/lib/focus.d.ts +1 -3
- package/dist/lib/focus.js +1 -2
- package/dist/lib/interaction.d.ts +1 -3
- package/dist/lib/interaction.js +1 -2
- package/dist/lib/motion.d.ts +1 -3
- package/dist/lib/motion.js +1 -2
- package/dist/lib/optional-peer.js +1 -2
- package/dist/lib/series.d.ts +1 -3
- package/dist/lib/series.js +1 -2
- package/dist/lib/surface-motion.js +1 -2
- package/dist/lib/utils.d.ts +1 -3
- package/dist/lib/utils.js +1 -2
- package/dist/markdown/api-schema.d.ts +1 -3
- package/dist/markdown/api-schema.js +1 -2
- package/dist/markdown/code-block.d.ts +0 -2
- package/dist/markdown/code-block.js +1 -2
- package/dist/markdown/code-meta.d.ts +1 -3
- package/dist/markdown/code-meta.js +1 -2
- package/dist/markdown/markdown-table.d.ts +1 -3
- package/dist/markdown/markdown-table.js +1 -2
- package/dist/markdown/markdown.d.ts +1 -3
- package/dist/markdown/markdown.js +1 -2
- package/dist/nav.d.ts +0 -2
- package/dist/nav.js +1 -2
- package/dist/openui/openui-artifact-renderer.d.ts +1 -2
- package/dist/openui/openui-artifact-renderer.js +1 -2
- package/dist/openui/schema-compiled.js +1 -2
- package/dist/openui/schema-data.d.ts +1 -3
- package/dist/openui/schema-data.js +1 -2
- package/dist/openui-schema.d.ts +0 -2
- package/dist/openui-schema.js +1 -2
- package/dist/presentation.d.ts +0 -2
- package/dist/presentation.js +1 -2
- package/dist/primitives/alert-dialog.d.ts +0 -2
- package/dist/primitives/alert-dialog.js +1 -2
- package/dist/primitives/alert.d.ts +1 -3
- package/dist/primitives/alert.js +1 -2
- package/dist/primitives/artifact-pane.d.ts +1 -3
- package/dist/primitives/artifact-pane.js +1 -2
- package/dist/primitives/avatar.d.ts +0 -2
- package/dist/primitives/avatar.js +1 -2
- package/dist/primitives/badge.d.ts +0 -2
- package/dist/primitives/badge.js +1 -2
- package/dist/primitives/breadcrumb.d.ts +0 -2
- package/dist/primitives/breadcrumb.js +1 -2
- package/dist/primitives/button.d.ts +0 -2
- package/dist/primitives/button.js +1 -2
- package/dist/primitives/calendar.d.ts +0 -2
- package/dist/primitives/calendar.js +1 -2
- package/dist/primitives/card.d.ts +0 -2
- package/dist/primitives/card.js +1 -2
- package/dist/primitives/checkbox.d.ts +0 -2
- package/dist/primitives/checkbox.js +1 -2
- package/dist/primitives/chip.d.ts +0 -2
- package/dist/primitives/chip.js +1 -2
- package/dist/primitives/code-block.d.ts +0 -2
- package/dist/primitives/code-block.js +1 -2
- package/dist/primitives/collapsible.d.ts +0 -2
- package/dist/primitives/collapsible.js +1 -2
- package/dist/primitives/compliance-badge.d.ts +0 -2
- package/dist/primitives/compliance-badge.js +3 -4
- package/dist/primitives/context-menu.d.ts +0 -2
- package/dist/primitives/context-menu.js +1 -2
- package/dist/primitives/date-picker.d.ts +0 -2
- package/dist/primitives/date-picker.js +1 -2
- package/dist/primitives/dialog.d.ts +0 -2
- package/dist/primitives/dialog.js +3 -4
- package/dist/primitives/drop-zone.d.ts +1 -3
- package/dist/primitives/drop-zone.js +1 -2
- package/dist/primitives/dropdown-menu.d.ts +0 -2
- package/dist/primitives/dropdown-menu.js +1 -2
- package/dist/primitives/empty-state.d.ts +0 -2
- package/dist/primitives/empty-state.js +1 -2
- package/dist/primitives/field.d.ts +1 -3
- package/dist/primitives/field.js +1 -2
- package/dist/primitives/heading.d.ts +0 -2
- package/dist/primitives/heading.js +1 -2
- package/dist/primitives/help-text.d.ts +0 -2
- package/dist/primitives/help-text.js +1 -2
- package/dist/primitives/hover-card.d.ts +0 -2
- package/dist/primitives/hover-card.js +1 -2
- package/dist/primitives/icon-tile.d.ts +0 -2
- package/dist/primitives/icon-tile.js +1 -2
- package/dist/primitives/info-tip.js +1 -2
- package/dist/primitives/input.d.ts +0 -2
- package/dist/primitives/input.js +1 -2
- package/dist/primitives/label.d.ts +0 -2
- package/dist/primitives/label.js +1 -2
- package/dist/primitives/metric-chart.d.ts +0 -2
- package/dist/primitives/metric-chart.js +1 -2
- package/dist/primitives/metric-strip.d.ts +0 -2
- package/dist/primitives/metric-strip.js +1 -2
- package/dist/primitives/page-header.d.ts +0 -2
- package/dist/primitives/page-header.js +1 -2
- package/dist/primitives/page-shell.d.ts +1 -3
- package/dist/primitives/page-shell.js +1 -2
- package/dist/primitives/pagination.d.ts +1 -2
- package/dist/primitives/pagination.js +1 -2
- package/dist/primitives/popover.d.ts +0 -2
- package/dist/primitives/popover.js +1 -2
- package/dist/primitives/progress.d.ts +0 -2
- package/dist/primitives/progress.js +1 -2
- package/dist/primitives/radio-group.d.ts +0 -2
- package/dist/primitives/radio-group.js +1 -2
- package/dist/primitives/segmented-control.d.ts +1 -3
- package/dist/primitives/segmented-control.js +4 -5
- package/dist/primitives/select.d.ts +0 -2
- package/dist/primitives/select.js +1 -2
- package/dist/primitives/separator.d.ts +0 -2
- package/dist/primitives/separator.js +1 -2
- package/dist/primitives/series-sparkline.d.ts +0 -2
- package/dist/primitives/series-sparkline.js +1 -2
- package/dist/primitives/settings.d.ts +1 -3
- package/dist/primitives/settings.js +1 -2
- package/dist/primitives/sheet.d.ts +0 -2
- package/dist/primitives/sheet.js +3 -4
- package/dist/primitives/sidebar-drop-zone.d.ts +1 -3
- package/dist/primitives/sidebar-drop-zone.js +1 -2
- package/dist/primitives/skeleton.d.ts +0 -2
- package/dist/primitives/skeleton.js +1 -2
- package/dist/primitives/slider.d.ts +0 -2
- package/dist/primitives/slider.js +1 -2
- package/dist/primitives/stat-card.d.ts +0 -2
- package/dist/primitives/stat-card.js +1 -2
- package/dist/primitives/status-pill.d.ts +0 -2
- package/dist/primitives/status-pill.js +1 -2
- package/dist/primitives/switch.d.ts +0 -2
- package/dist/primitives/switch.js +1 -2
- package/dist/primitives/table.d.ts +0 -2
- package/dist/primitives/table.js +1 -2
- package/dist/primitives/tabs.d.ts +0 -2
- package/dist/primitives/tabs.js +1 -2
- package/dist/primitives/tag.d.ts +0 -2
- package/dist/primitives/tag.js +1 -2
- package/dist/primitives/terminal-display.d.ts +0 -2
- package/dist/primitives/terminal-display.js +1 -2
- package/dist/primitives/text-shimmer.d.ts +1 -3
- package/dist/primitives/text-shimmer.js +1 -2
- package/dist/primitives/theme-toggle.d.ts +1 -2
- package/dist/primitives/theme-toggle.js +1 -2
- package/dist/primitives/time-select.d.ts +0 -2
- package/dist/primitives/time-select.js +1 -2
- package/dist/primitives/toast.d.ts +1 -2
- package/dist/primitives/toast.js +1 -2
- package/dist/primitives/tone.d.ts +1 -3
- package/dist/primitives/tone.js +1 -2
- package/dist/primitives/toolbar.d.ts +0 -2
- package/dist/primitives/toolbar.js +1 -2
- package/dist/primitives/tooltip.d.ts +0 -2
- package/dist/primitives/tooltip.js +1 -2
- package/dist/primitives/upload-progress.d.ts +1 -3
- package/dist/primitives/upload-progress.js +1 -2
- package/dist/primitives/wizard.d.ts +1 -3
- package/dist/primitives/wizard.js +1 -2
- package/dist/redaction/redacted-document.d.ts +1 -3
- package/dist/redaction/redacted-document.js +1 -2
- package/dist/redaction.js +1 -2
- package/dist/run/approval-card.d.ts +1 -3
- package/dist/run/approval-card.js +1 -2
- package/dist/run/expandable-content.js +1 -2
- package/dist/run/expanded-tool-detail.d.ts +1 -3
- package/dist/run/expanded-tool-detail.js +1 -2
- package/dist/run/inline-thinking-item.d.ts +1 -3
- package/dist/run/inline-thinking-item.js +1 -2
- package/dist/run/inline-tool-item.d.ts +1 -3
- package/dist/run/inline-tool-item.js +1 -2
- package/dist/run/run-group.d.ts +1 -3
- package/dist/run/run-group.js +1 -2
- package/dist/run/run-item-primitives.d.ts +1 -3
- package/dist/run/run-item-primitives.js +1 -2
- package/dist/run/run-phase-list.d.ts +1 -3
- package/dist/run/run-phase-list.js +1 -2
- package/dist/run/run-row-shell.d.ts +1 -3
- package/dist/run/run-row-shell.js +1 -2
- package/dist/run/task-list.d.ts +1 -3
- package/dist/run/task-list.js +1 -2
- package/dist/run/tool-call-feed.d.ts +1 -3
- package/dist/run/tool-call-feed.js +1 -2
- package/dist/run/tool-call-step.d.ts +1 -3
- package/dist/run/tool-call-step.js +1 -2
- package/dist/stores/active-sessions-store.d.ts +1 -3
- package/dist/stores/active-sessions-store.js +1 -2
- package/dist/stores/chat-store.d.ts +1 -3
- package/dist/stores/chat-store.js +1 -2
- package/dist/tool-previews/command-preview.d.ts +1 -3
- package/dist/tool-previews/command-preview.js +1 -2
- package/dist/tool-previews/diff-preview.d.ts +1 -3
- package/dist/tool-previews/diff-preview.js +1 -2
- package/dist/tool-previews/glob-results-preview.d.ts +1 -3
- package/dist/tool-previews/glob-results-preview.js +1 -2
- package/dist/tool-previews/grep-results-preview.d.ts +1 -3
- package/dist/tool-previews/grep-results-preview.js +1 -2
- package/dist/tool-previews/preview-primitives.js +1 -2
- package/dist/tool-previews/question-preview.d.ts +1 -3
- package/dist/tool-previews/question-preview.js +1 -2
- package/dist/tool-previews/web-search-preview.d.ts +1 -3
- package/dist/tool-previews/web-search-preview.js +1 -2
- package/dist/tool-previews/write-file-preview.d.ts +1 -3
- package/dist/tool-previews/write-file-preview.js +1 -2
- package/dist/types/branding.d.ts +1 -3
- package/dist/types/message.d.ts +1 -3
- package/dist/types/parts.d.ts +1 -3
- package/dist/types/run.d.ts +1 -3
- package/dist/types/tool-display.d.ts +1 -3
- package/dist/utils/copy-text.d.ts +1 -3
- package/dist/utils/copy-text.js +1 -2
- package/dist/utils/format.d.ts +1 -3
- package/dist/utils/format.js +1 -2
- package/dist/utils/time-ago.d.ts +1 -3
- package/dist/utils/time-ago.js +1 -2
- package/dist/utils/tool-display.d.ts +1 -3
- package/dist/utils/tool-display.js +1 -2
- package/package.json +38 -38
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatDuration } from "../utils/format.js";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/run/run-item-primitives.tsx
|
|
5
5
|
function LiveDuration({ startTime }) {
|
|
6
6
|
const [elapsed, setElapsed] = useState(Date.now() - startTime);
|
|
7
7
|
useEffect(() => {
|
|
@@ -13,5 +13,4 @@ function LiveDuration({ startTime }) {
|
|
|
13
13
|
children: formatDuration(elapsed)
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
//#endregion
|
|
17
16
|
export { LiveDuration };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/run/run-phase-list.d.ts
|
|
3
2
|
export interface RunPhase {
|
|
4
3
|
id: string;
|
|
5
4
|
/** The step or phase the work belongs to. */
|
|
@@ -14,5 +13,4 @@ export interface RunPhase {
|
|
|
14
13
|
export declare function RunPhaseList({ phases, className }: {
|
|
15
14
|
phases: readonly RunPhase[];
|
|
16
15
|
className?: string;
|
|
17
|
-
}): import("react").JSX.Element | null;
|
|
18
|
-
//#endregion
|
|
16
|
+
}): import("react").JSX.Element | null;
|
|
@@ -3,7 +3,7 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronRight, CircleAlert, Loader2 } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/run/run-phase-list.tsx
|
|
7
7
|
function PhaseRow({ phase }) {
|
|
8
8
|
const [open, setOpen] = useState(false);
|
|
9
9
|
const id = `run-phase-${phase.id}`;
|
|
@@ -52,5 +52,4 @@ function RunPhaseList({ phases, className }) {
|
|
|
52
52
|
children: phases.map((phase) => /* @__PURE__ */ jsx(PhaseRow, { phase }, phase.id))
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { RunPhaseList };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/run/run-row-shell.d.ts
|
|
3
2
|
export type RunRowStatus = "running" | "success" | "error" | "idle";
|
|
4
3
|
/**
|
|
5
4
|
* Trailing status indicator shared by every run row. Only `error` draws a
|
|
@@ -49,5 +48,4 @@ export interface RunRowShellProps {
|
|
|
49
48
|
* present (transparent at rest) so hover and expand never shift layout.
|
|
50
49
|
* Both row kinds render through it so they read as one family.
|
|
51
50
|
*/
|
|
52
|
-
export declare function RunRowShell({ icon, title, description, descriptionMono, status, durationMs, groupPosition, collapsedError, actions, open: openProp, onOpenChange, defaultOpen, className, contentClassName, children }: RunRowShellProps): import("react").JSX.Element;
|
|
53
|
-
//#endregion
|
|
51
|
+
export declare function RunRowShell({ icon, title, description, descriptionMono, status, durationMs, groupPosition, collapsedError, actions, open: openProp, onOpenChange, defaultOpen, className, contentClassName, children }: RunRowShellProps): import("react").JSX.Element;
|
|
@@ -4,7 +4,7 @@ import { useState } from "react";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronRight } from "lucide-react";
|
|
6
6
|
import * as Collapsible from "@radix-ui/react-collapsible";
|
|
7
|
-
|
|
7
|
+
// src/run/run-row-shell.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Trailing status indicator shared by every run row. Only `error` draws a
|
|
10
10
|
* mark (a red dot). Success is silence, and a running row carries its state in
|
|
@@ -110,5 +110,4 @@ function RunRowShell({ icon, title, description, descriptionMono = false, status
|
|
|
110
110
|
})
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
//#endregion
|
|
114
113
|
export { RunRowShell, RunRowStatusDot };
|
package/dist/run/task-list.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/run/task-list.d.ts
|
|
3
2
|
/** The states an agent's working checklist reports; unknown values read as to-do. */
|
|
4
3
|
export type TaskStatus = "pending" | "in_progress" | "completed" | "cancelled" | "blocked" | "failed";
|
|
5
4
|
export interface TaskListItem {
|
|
@@ -29,5 +28,4 @@ export declare function taskProgress(items: readonly TaskListItem[]): {
|
|
|
29
28
|
* An agent's working checklist: a header with progress, each task's state as
|
|
30
29
|
* a toned pill, and priority shown only when the tasks differ in it.
|
|
31
30
|
*/
|
|
32
|
-
export declare function TaskList({ items, title, meta, className }: TaskListProps): import("react").JSX.Element;
|
|
33
|
-
//#endregion
|
|
31
|
+
export declare function TaskList({ items, title, meta, className }: TaskListProps): import("react").JSX.Element;
|
package/dist/run/task-list.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { StatusPill } from "../primitives/status-pill.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/run/task-list.tsx
|
|
5
5
|
const STATUS = {
|
|
6
6
|
pending: {
|
|
7
7
|
tone: "neutral",
|
|
@@ -134,5 +134,4 @@ function TaskList({ items, title = "Tasks", meta, className }) {
|
|
|
134
134
|
]
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
//#endregion
|
|
138
137
|
export { TaskList, showsTaskPriority, taskProgress, taskStatus };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ToolCallStatus, ToolCallType } from "./tool-call-step.js";
|
|
2
|
-
//#region src/run/tool-call-feed.d.ts
|
|
3
2
|
export interface ToolCallData {
|
|
4
3
|
id: string;
|
|
5
4
|
type: ToolCallType;
|
|
@@ -38,5 +37,4 @@ export declare function ToolCallFeed({ segments, className }: ToolCallFeedProps)
|
|
|
38
37
|
export declare function parseToolEvent(event: {
|
|
39
38
|
type: string;
|
|
40
39
|
data: Record<string, unknown>;
|
|
41
|
-
}): ToolCallData | null;
|
|
42
|
-
//#endregion
|
|
40
|
+
}): ToolCallData | null;
|
|
@@ -2,7 +2,7 @@ import { cn } from "../lib/utils.js";
|
|
|
2
2
|
import { Markdown } from "../markdown/markdown.js";
|
|
3
3
|
import { ToolCallGroup, ToolCallStep } from "./tool-call-step.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/run/tool-call-feed.tsx
|
|
6
6
|
/**
|
|
7
7
|
* Renders a feed of interleaved text and tool calls.
|
|
8
8
|
*/
|
|
@@ -105,5 +105,4 @@ function formatToolInput(toolName, input) {
|
|
|
105
105
|
function truncate(text, max) {
|
|
106
106
|
return text.length > max ? text.slice(0, max - 3) + "..." : text;
|
|
107
107
|
}
|
|
108
|
-
//#endregion
|
|
109
108
|
export { ToolCallFeed, parseToolEvent };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
//#region src/run/tool-call-step.d.ts
|
|
3
2
|
export type ToolCallType = "bash" | "read" | "write" | "edit" | "glob" | "grep" | "list" | "download" | "inspect" | "audit" | "unknown";
|
|
4
|
-
export type ToolCallStatus = "running" | "success" | "error";
|
|
5
|
-
//#endregion
|
|
3
|
+
export type ToolCallStatus = "running" | "success" | "error";
|
|
@@ -2,7 +2,7 @@ import { cn } from "../lib/utils.js";
|
|
|
2
2
|
import { CodeBlock } from "../markdown/code-block.js";
|
|
3
3
|
import { InlineToolItem } from "./inline-tool-item.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/run/tool-call-step.tsx
|
|
6
6
|
const EXT_LANGUAGE = {
|
|
7
7
|
ts: "typescript",
|
|
8
8
|
tsx: "typescript",
|
|
@@ -78,5 +78,4 @@ function ToolCallGroup({ title, children, className }) {
|
|
|
78
78
|
children
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
//#endregion
|
|
82
81
|
export { ToolCallGroup, ToolCallStep };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/stores/active-sessions-store.d.ts
|
|
2
1
|
export type SessionProjectKey = string | number;
|
|
3
2
|
export type ActiveSessionStatus = "idle" | "running" | "attention-needed" | "error";
|
|
4
3
|
export type ActiveSessionReconnectState = "idle" | "reconnecting" | "failed";
|
|
@@ -79,5 +78,4 @@ export declare function useNavbarSessions(projectId?: SessionProjectKey | null):
|
|
|
79
78
|
export declare function useSessionsByActivity(): ActiveSessionRecord[];
|
|
80
79
|
export declare function useProjectActivity(): ActiveProjectActivity[];
|
|
81
80
|
export declare function useTotalRunningSessions(): number;
|
|
82
|
-
export declare function useHasBackgroundRunningSessions(): boolean;
|
|
83
|
-
//#endregion
|
|
81
|
+
export declare function useHasBackgroundRunningSessions(): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useStore } from "@nanostores/react";
|
|
3
3
|
import { atom } from "nanostores";
|
|
4
|
-
|
|
4
|
+
// src/stores/active-sessions-store.ts
|
|
5
5
|
const INITIAL_STATE = {
|
|
6
6
|
sessions: {},
|
|
7
7
|
lastUpdatedAt: 0
|
|
@@ -258,5 +258,4 @@ function useHasBackgroundRunningSessions() {
|
|
|
258
258
|
const state = useStore(activeSessionsAtom);
|
|
259
259
|
return useMemo(() => hasBackgroundRunningSessions(state), [state]);
|
|
260
260
|
}
|
|
261
|
-
//#endregion
|
|
262
261
|
export { activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SessionMessage } from "../types/message.js";
|
|
2
2
|
import { SessionPart } from "../types/parts.js";
|
|
3
|
-
//#region src/stores/chat-store.d.ts
|
|
4
3
|
/** Ordered list of messages in the current chat session. */
|
|
5
4
|
export declare const messagesAtom: import("nanostores").PreinitializedWritableAtom<SessionMessage[]> & object;
|
|
6
5
|
/** Map of message ID → parts for that message. */
|
|
@@ -10,5 +9,4 @@ export declare const isStreamingAtom: import("nanostores").PreinitializedWritabl
|
|
|
10
9
|
export declare function addMessage(msg: SessionMessage): void;
|
|
11
10
|
export declare function addParts(messageId: string, parts: SessionPart[]): void;
|
|
12
11
|
export declare function updatePart(messageId: string, partIndex: number, part: SessionPart): void;
|
|
13
|
-
export declare function clearChat(): void;
|
|
14
|
-
//#endregion
|
|
12
|
+
export declare function clearChat(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { atom, map } from "nanostores";
|
|
2
|
-
|
|
2
|
+
// src/stores/chat-store.ts
|
|
3
3
|
/** Ordered list of messages in the current chat session. */
|
|
4
4
|
const messagesAtom = atom([]);
|
|
5
5
|
/** Map of message ID → parts for that message. */
|
|
@@ -29,5 +29,4 @@ function clearChat() {
|
|
|
29
29
|
isStreamingAtom.set(false);
|
|
30
30
|
insertionCounter = 0;
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/command-preview.d.ts
|
|
3
2
|
export interface CommandPreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
/**
|
|
@@ -20,5 +19,4 @@ export interface CommandPreviewProps {
|
|
|
20
19
|
* `data-theme="dark"`, so stderr, the badges and the muted prompt keep the
|
|
21
20
|
* contrast they were designed with on a dark ground, in a light console too.
|
|
22
21
|
*/
|
|
23
|
-
export declare const CommandPreview: import("react").MemoExoticComponent<({ part, defaultExpanded, className }: CommandPreviewProps) => import("react").JSX.Element>;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare const CommandPreview: import("react").MemoExoticComponent<({ part, defaultExpanded, className }: CommandPreviewProps) => import("react").JSX.Element>;
|
|
@@ -3,7 +3,7 @@ import { cn } from "../lib/utils.js";
|
|
|
3
3
|
import { memo, useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { ChevronDown, ChevronRight, Loader2 } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/tool-previews/command-preview.tsx
|
|
7
7
|
/** The input keys a shell tool names its command under. */
|
|
8
8
|
const COMMAND_KEYS = [
|
|
9
9
|
"command",
|
|
@@ -271,5 +271,4 @@ const CommandPreview = memo(({ part, defaultExpanded = false, className }) => {
|
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
CommandPreview.displayName = "CommandPreview";
|
|
274
|
-
//#endregion
|
|
275
274
|
export { CommandPreview, commandOf, extractCommandOutput };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/diff-preview.d.ts
|
|
3
2
|
export interface DiffPreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
}
|
|
6
|
-
export declare const DiffPreview: import("react").MemoExoticComponent<({ part }: DiffPreviewProps) => import("react").JSX.Element>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare const DiffPreview: import("react").MemoExoticComponent<({ part }: DiffPreviewProps) => import("react").JSX.Element>;
|
|
@@ -3,7 +3,7 @@ import { PreviewCard, PreviewEmpty, PreviewError, PreviewLoading } from "./previ
|
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { GitCompareArrows } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/tool-previews/diff-preview.tsx
|
|
7
7
|
function extractString(record, ...keys) {
|
|
8
8
|
for (const key of keys) {
|
|
9
9
|
const value = record[key];
|
|
@@ -72,5 +72,4 @@ const DiffPreview = memo(({ part }) => {
|
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
DiffPreview.displayName = "DiffPreview";
|
|
75
|
-
//#endregion
|
|
76
75
|
export { DiffPreview };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/glob-results-preview.d.ts
|
|
3
2
|
export interface GlobResultsPreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
}
|
|
6
|
-
export declare const GlobResultsPreview: import("react").MemoExoticComponent<({ part }: GlobResultsPreviewProps) => import("react").JSX.Element>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare const GlobResultsPreview: import("react").MemoExoticComponent<({ part }: GlobResultsPreviewProps) => import("react").JSX.Element>;
|
|
@@ -2,7 +2,7 @@ import { PreviewCard, PreviewEmpty, PreviewError, PreviewLoading } from "./previ
|
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { FileText, FolderOpen } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/tool-previews/glob-results-preview.tsx
|
|
6
6
|
function coerceString(value) {
|
|
7
7
|
return typeof value === "string" && value.trim() ? value : void 0;
|
|
8
8
|
}
|
|
@@ -49,5 +49,4 @@ const GlobResultsPreview = memo(({ part }) => {
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
GlobResultsPreview.displayName = "GlobResultsPreview";
|
|
52
|
-
//#endregion
|
|
53
52
|
export { GlobResultsPreview };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/grep-results-preview.d.ts
|
|
3
2
|
export interface GrepResultsPreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
}
|
|
6
|
-
export declare const GrepResultsPreview: import("react").MemoExoticComponent<({ part }: GrepResultsPreviewProps) => import("react").JSX.Element>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare const GrepResultsPreview: import("react").MemoExoticComponent<({ part }: GrepResultsPreviewProps) => import("react").JSX.Element>;
|
|
@@ -2,7 +2,7 @@ import { PreviewCard, PreviewEmpty, PreviewError, PreviewLoading } from "./previ
|
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Search } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/tool-previews/grep-results-preview.tsx
|
|
6
6
|
function coerceString(value) {
|
|
7
7
|
return typeof value === "string" && value.trim() ? value : void 0;
|
|
8
8
|
}
|
|
@@ -95,5 +95,4 @@ const GrepResultsPreview = memo(({ part }) => {
|
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
GrepResultsPreview.displayName = "GrepResultsPreview";
|
|
98
|
-
//#endregion
|
|
99
98
|
export { GrepResultsPreview };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Loader2 } from "lucide-react";
|
|
4
|
-
|
|
4
|
+
// src/tool-previews/preview-primitives.tsx
|
|
5
5
|
function PreviewCard({ icon, title, description, meta, children, className }) {
|
|
6
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
7
7
|
className: cn("overflow-hidden rounded-[var(--radius-lg)] border border-border bg-card shadow-[var(--shadow-card)]", className),
|
|
@@ -54,5 +54,4 @@ function PreviewLoading({ label = "Running…" }) {
|
|
|
54
54
|
children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin text-primary" }), /* @__PURE__ */ jsx("span", { children: label })]
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
//#endregion
|
|
58
57
|
export { PreviewCard, PreviewEmpty, PreviewError, PreviewLoading };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/question-preview.d.ts
|
|
3
2
|
export interface QuestionPreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
}
|
|
6
|
-
export declare const QuestionPreview: import("react").MemoExoticComponent<({ part }: QuestionPreviewProps) => import("react").JSX.Element>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare const QuestionPreview: import("react").MemoExoticComponent<({ part }: QuestionPreviewProps) => import("react").JSX.Element>;
|
|
@@ -2,7 +2,7 @@ import { PreviewCard, PreviewEmpty, PreviewError, PreviewLoading } from "./previ
|
|
|
2
2
|
import { memo, useMemo } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { MessageSquareQuote } from "lucide-react";
|
|
5
|
-
|
|
5
|
+
// src/tool-previews/question-preview.tsx
|
|
6
6
|
function toQuestionList(input) {
|
|
7
7
|
if (!input) return [];
|
|
8
8
|
if (typeof input === "string") return [input];
|
|
@@ -59,5 +59,4 @@ const QuestionPreview = memo(({ part }) => {
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
QuestionPreview.displayName = "QuestionPreview";
|
|
62
|
-
//#endregion
|
|
63
62
|
export { QuestionPreview };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/web-search-preview.d.ts
|
|
3
2
|
export interface WebSearchPreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
}
|
|
6
|
-
export declare const WebSearchPreview: import("react").MemoExoticComponent<({ part }: WebSearchPreviewProps) => import("react").JSX.Element>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare const WebSearchPreview: import("react").MemoExoticComponent<({ part }: WebSearchPreviewProps) => import("react").JSX.Element>;
|
|
@@ -3,7 +3,7 @@ import { PreviewCard, PreviewEmpty, PreviewError, PreviewLoading } from "./previ
|
|
|
3
3
|
import { memo, useMemo } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Globe } from "lucide-react";
|
|
6
|
-
|
|
6
|
+
// src/tool-previews/web-search-preview.tsx
|
|
7
7
|
function coerceString(value) {
|
|
8
8
|
return typeof value === "string" && value.trim() ? value : void 0;
|
|
9
9
|
}
|
|
@@ -74,5 +74,4 @@ const WebSearchPreview = memo(({ part }) => {
|
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
WebSearchPreview.displayName = "WebSearchPreview";
|
|
77
|
-
//#endregion
|
|
78
77
|
export { WebSearchPreview };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
|
-
//#region src/tool-previews/write-file-preview.d.ts
|
|
3
2
|
export interface WriteFilePreviewProps {
|
|
4
3
|
part: ToolPart;
|
|
5
4
|
}
|
|
@@ -7,5 +6,4 @@ export interface WriteFilePreviewProps {
|
|
|
7
6
|
* Preview for file write/create operations.
|
|
8
7
|
* Shows file path, line count, and the written content.
|
|
9
8
|
*/
|
|
10
|
-
export declare const WriteFilePreview: import("react").MemoExoticComponent<({ part }: WriteFilePreviewProps) => import("react").JSX.Element | null>;
|
|
11
|
-
//#endregion
|
|
9
|
+
export declare const WriteFilePreview: import("react").MemoExoticComponent<({ part }: WriteFilePreviewProps) => import("react").JSX.Element | null>;
|
|
@@ -4,7 +4,7 @@ import { PreviewCard, PreviewError, PreviewLoading } from "./preview-primitives.
|
|
|
4
4
|
import { memo } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { FileEdit } from "lucide-react";
|
|
7
|
-
|
|
7
|
+
// src/tool-previews/write-file-preview.tsx
|
|
8
8
|
function extractWriteContent(input) {
|
|
9
9
|
if (!input || typeof input !== "object") return null;
|
|
10
10
|
const obj = input;
|
|
@@ -48,5 +48,4 @@ const WriteFilePreview = memo(({ part }) => {
|
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
50
|
WriteFilePreview.displayName = "WriteFilePreview";
|
|
51
|
-
//#endregion
|
|
52
51
|
export { WriteFilePreview };
|
package/dist/types/branding.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/branding.d.ts
|
|
2
1
|
/** Visual branding for a run group header — injected by consuming app. */
|
|
3
2
|
export interface AgentBranding {
|
|
4
3
|
label: string;
|
|
@@ -9,5 +8,4 @@ export interface AgentBranding {
|
|
|
9
8
|
/** CSS class for the agent icon (legacy). Ignored when using lucide-react icons. */
|
|
10
9
|
iconClass: string;
|
|
11
10
|
textClass: string;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
11
|
+
}
|
package/dist/types/message.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/message.d.ts
|
|
2
1
|
/** A single message in a chat session. */
|
|
3
2
|
export interface SessionMessage {
|
|
4
3
|
id: string;
|
|
@@ -30,5 +29,4 @@ export interface ChatAuthor {
|
|
|
30
29
|
role?: string;
|
|
31
30
|
/** Falls back to initials when absent or when the image fails to load. */
|
|
32
31
|
avatarUrl?: string;
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
32
|
+
}
|
package/dist/types/parts.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types/parts.d.ts
|
|
2
1
|
export interface TextPart {
|
|
3
2
|
type: 'text';
|
|
4
3
|
text: string;
|
|
@@ -32,5 +31,4 @@ export interface ReasoningPart {
|
|
|
32
31
|
text: string;
|
|
33
32
|
time?: ToolTime;
|
|
34
33
|
}
|
|
35
|
-
export type SessionPart = TextPart | ToolPart | ReasoningPart;
|
|
36
|
-
//#endregion
|
|
34
|
+
export type SessionPart = TextPart | ToolPart | ReasoningPart;
|
package/dist/types/run.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SessionMessage } from "./message.js";
|
|
2
|
-
//#region src/types/run.d.ts
|
|
3
2
|
/** Broad category of a tool invocation, used for display grouping. */
|
|
4
3
|
export type ToolCategory = "command" | "write" | "read" | "search" | "edit" | "task" | "web" | "todo" | "other";
|
|
5
4
|
export interface RunStats {
|
|
@@ -36,5 +35,4 @@ export interface MessageUser {
|
|
|
36
35
|
type: "user";
|
|
37
36
|
message: SessionMessage;
|
|
38
37
|
}
|
|
39
|
-
export type GroupedMessage = MessageRun | MessageUser;
|
|
40
|
-
//#endregion
|
|
38
|
+
export type GroupedMessage = MessageRun | MessageUser;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ToolPart } from "./parts.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
//#region src/types/tool-display.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Variant-specific rendering instructions for tool output.
|
|
6
5
|
* Maps directly to specialised preview components.
|
|
@@ -27,5 +26,4 @@ export interface ToolDisplayMetadata {
|
|
|
27
26
|
displayVariant?: DisplayVariant;
|
|
28
27
|
commandSnippet?: string;
|
|
29
28
|
targetPath?: string;
|
|
30
|
-
}
|
|
31
|
-
//#endregion
|
|
29
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
//#region src/utils/copy-text.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Copy text to clipboard with a non-secure-context fallback.
|
|
4
3
|
* Returns true if a copy strategy likely succeeded.
|
|
5
4
|
*/
|
|
6
|
-
export declare function copyText(text: string): Promise<boolean>;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function copyText(text: string): Promise<boolean>;
|
package/dist/utils/copy-text.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/copy-text.ts
|
|
2
2
|
/**
|
|
3
3
|
* Copy text to clipboard with a non-secure-context fallback.
|
|
4
4
|
* Returns true if a copy strategy likely succeeded.
|
|
@@ -23,5 +23,4 @@ async function copyText(text) {
|
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { copyText };
|
package/dist/utils/format.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/utils/format.d.ts
|
|
2
1
|
/** Format a duration in milliseconds to a human-readable string. */
|
|
3
2
|
export declare function formatDuration(ms: number): string;
|
|
4
3
|
/**
|
|
@@ -24,5 +23,4 @@ export declare function formatUptime(ms: number): string;
|
|
|
24
23
|
* round above; GB keeps two decimals below 10 so half-GB changes stay
|
|
25
24
|
* visible on memory dashboards, and drops to one decimal above.
|
|
26
25
|
*/
|
|
27
|
-
export declare function formatBytes(bytes: number): string;
|
|
28
|
-
//#endregion
|
|
26
|
+
export declare function formatBytes(bytes: number): string;
|
package/dist/utils/format.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/format.ts
|
|
2
2
|
/** Format a duration in milliseconds to a human-readable string. */
|
|
3
3
|
function formatDuration(ms) {
|
|
4
4
|
if (ms < 1e3) return "<1s";
|
|
@@ -58,5 +58,4 @@ function formatBytes(bytes) {
|
|
|
58
58
|
const gb = mb / 1024;
|
|
59
59
|
return `${gb < 10 ? gb.toFixed(2) : gb.toFixed(1)} GB`;
|
|
60
60
|
}
|
|
61
|
-
//#endregion
|
|
62
61
|
export { formatBytes, formatDuration, formatUptime, plainTextFromMarkdown, truncateText };
|
package/dist/utils/time-ago.d.ts
CHANGED
package/dist/utils/time-ago.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/time-ago.ts
|
|
2
2
|
function timeAgo(ts) {
|
|
3
3
|
const secs = Math.floor((Date.now() - ts) / 1e3);
|
|
4
4
|
if (secs < 5) return "just now";
|
|
@@ -7,5 +7,4 @@ function timeAgo(ts) {
|
|
|
7
7
|
if (mins < 60) return `${mins}m ago`;
|
|
8
8
|
return `${Math.floor(mins / 60)}h ago`;
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { timeAgo };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ToolPart } from "../types/parts.js";
|
|
2
2
|
import { ToolDisplayMetadata } from "../types/tool-display.js";
|
|
3
3
|
import { ToolCategory } from "../types/run.js";
|
|
4
|
-
//#region src/utils/tool-display.d.ts
|
|
5
4
|
export declare const TOOL_CATEGORY_ICONS: Record<ToolCategory, string>;
|
|
6
5
|
export declare function getToolCategory(toolName: string): ToolCategory;
|
|
7
6
|
/**
|
|
@@ -12,5 +11,4 @@ export declare function getToolCategory(toolName: string): ToolCategory;
|
|
|
12
11
|
*/
|
|
13
12
|
export declare function getToolDisplayMetadata(part: ToolPart): ToolDisplayMetadata;
|
|
14
13
|
/** Extract error text from a tool part, if any. */
|
|
15
|
-
export declare function getToolErrorText(part: ToolPart, fallback?: string): string | undefined;
|
|
16
|
-
//#endregion
|
|
14
|
+
export declare function getToolErrorText(part: ToolPart, fallback?: string): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/tool-display.ts
|
|
2
2
|
const TOOL_NAME_PREFIX = "tool:";
|
|
3
3
|
function normalizeToolName(tool) {
|
|
4
4
|
const n = tool?.toLowerCase() ?? "";
|
|
@@ -154,5 +154,4 @@ function getToolErrorText(part, fallback) {
|
|
|
154
154
|
if (part.state.status !== "error") return void 0;
|
|
155
155
|
return part.state.error || fallback;
|
|
156
156
|
}
|
|
157
|
-
//#endregion
|
|
158
157
|
export { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText };
|