@tangle-network/sandbox-ui 2.0.9 → 2.0.11
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/hooks.js +6 -6
- package/dist/index.js +3 -3
- package/dist/{record-CzsY5-Mv.js → record-D-evY-c_.js} +24 -5
- package/dist/run/record.js +1 -1
- package/dist/{run-BzfG6aO5.js → run-CJyFiBG9.js} +1 -1
- package/dist/run.js +2 -2
- package/dist/sdk-hooks.js +1 -1
- package/dist/{use-sidecar-auth-DpG0aWQ3.js → use-sidecar-auth-D9BrWCg1.js} +5 -5
- package/package.json +1 -1
package/dist/hooks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as usePtySession } from "./use-pty-session-BHVQlSs-.js";
|
|
2
|
-
import { i as useSessionStream, n as SESSION_STREAM_RECONNECT_DELAY_MS, r as SessionStreamError, t as useSidecarAuth } from "./use-sidecar-auth-
|
|
2
|
+
import { i as useSessionStream, n as SESSION_STREAM_RECONNECT_DELAY_MS, r as SessionStreamError, t as useSidecarAuth } from "./use-sidecar-auth-D9BrWCg1.js";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
4
|
import { RealtimeSessionRegistry, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useLiveTime, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream } from "@tangle-network/ui/hooks";
|
|
5
5
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
@@ -53,7 +53,7 @@ function useSandboxMetrics({ apiBaseUrl, sandboxId, token, enabled = true, inter
|
|
|
53
53
|
try {
|
|
54
54
|
const headers = {};
|
|
55
55
|
if (token) headers.Authorization = `Bearer ${token}`;
|
|
56
|
-
const res = await fetch(`${apiBaseUrl}/v1/
|
|
56
|
+
const res = await fetch(`${apiBaseUrl}/v1/sandboxes/${encodeURIComponent(sandboxId)}/runtime/metrics/json`, {
|
|
57
57
|
method: "GET",
|
|
58
58
|
credentials: "include",
|
|
59
59
|
headers,
|
|
@@ -168,7 +168,7 @@ function useSessions(apiUrl, token) {
|
|
|
168
168
|
apiUrl,
|
|
169
169
|
token
|
|
170
170
|
],
|
|
171
|
-
queryFn: () => sessionFetch(apiUrl, token, "/
|
|
171
|
+
queryFn: () => sessionFetch(apiUrl, token, "/agents/sessions"),
|
|
172
172
|
enabled: !!token,
|
|
173
173
|
staleTime: 3e4
|
|
174
174
|
});
|
|
@@ -178,7 +178,7 @@ function useCreateSession(apiUrl, token) {
|
|
|
178
178
|
const queryClient = useQueryClient();
|
|
179
179
|
return useMutation({
|
|
180
180
|
mutationFn: async (title) => {
|
|
181
|
-
return sessionFetch(apiUrl, token, "/
|
|
181
|
+
return sessionFetch(apiUrl, token, "/agents/sessions", {
|
|
182
182
|
method: "POST",
|
|
183
183
|
body: JSON.stringify({
|
|
184
184
|
title,
|
|
@@ -200,7 +200,7 @@ function useDeleteSession(apiUrl, token) {
|
|
|
200
200
|
const queryClient = useQueryClient();
|
|
201
201
|
return useMutation({
|
|
202
202
|
mutationFn: async (sessionId) => {
|
|
203
|
-
return sessionFetch(apiUrl, token, `/
|
|
203
|
+
return sessionFetch(apiUrl, token, `/agents/sessions/${encodeURIComponent(sessionId)}`, { method: "DELETE" });
|
|
204
204
|
},
|
|
205
205
|
onSuccess: () => {
|
|
206
206
|
queryClient.invalidateQueries({ queryKey: [
|
|
@@ -216,7 +216,7 @@ function useRenameSession(apiUrl, token) {
|
|
|
216
216
|
const queryClient = useQueryClient();
|
|
217
217
|
return useMutation({
|
|
218
218
|
mutationFn: async ({ sessionId, title }) => {
|
|
219
|
-
return sessionFetch(apiUrl, token, `/
|
|
219
|
+
return sessionFetch(apiUrl, token, `/agents/sessions/${encodeURIComponent(sessionId)}`, {
|
|
220
220
|
method: "PATCH",
|
|
221
221
|
body: JSON.stringify({ title })
|
|
222
222
|
});
|
package/dist/index.js
CHANGED
|
@@ -12,13 +12,13 @@ import { a as CodeSurface, i as CODE_THEME, n as buildUnifiedPatch, r as compute
|
|
|
12
12
|
import { n as PreviewView, t as EmbeddedAppView } from "./embedded-app-view-DXsoPale.js";
|
|
13
13
|
import { OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, findUnsupportedOpenUINode, validateOpenUIJsonArtifact, validateOpenUIJsonNode } from "./openui.js";
|
|
14
14
|
import { S as ReasoningLevelPicker, _ as modelProvider, a as ChatMessage, b as DEFAULT_REASONING_LEVEL_OPTIONS, c as SpeakerHeader, d as UserMessage, f as agentTimelineStepKind, g as ArtifactAgentDock, h as partitionBySpeaker, i as ChatContainer, l as TRANSCRIPT_TEXT, m as isViewerMessage, n as AgentTimelineColumn, o as MessageAuthor, p as foldSummary, r as AgentTimelineStep, s as MessageList, t as AgentTimeline, u as ThinkingIndicator, v as snapHarnessToModel, x as HARNESS_REASONING_OPTIONS, y as AgentProfilePicker } from "./chat-BU39pb2j.js";
|
|
15
|
-
import { C as TraceWaterfall, S as useAgentStream, _ as statusMeta, a as InlineToolItem, b as TraceWorkspace, c as RunPhaseList, d as RunStatusIcon, f as TaskList, g as showsTaskPriority, h as runStatus, i as InlineThinkingItem, l as RunRowShell, m as parseToolEvent, n as ApprovalDiffSummary, o as LiveDuration, p as ToolCallFeed, r as ExpandedToolDetail, s as RunGroup, t as ApprovalCard, u as RunRowStatusDot, v as taskProgress, w as traceSpanMark, x as foldAgentRows, y as taskStatus } from "./run-
|
|
15
|
+
import { C as TraceWaterfall, S as useAgentStream, _ as statusMeta, a as InlineToolItem, b as TraceWorkspace, c as RunPhaseList, d as RunStatusIcon, f as TaskList, g as showsTaskPriority, h as runStatus, i as InlineThinkingItem, l as RunRowShell, m as parseToolEvent, n as ApprovalDiffSummary, o as LiveDuration, p as ToolCallFeed, r as ExpandedToolDetail, s as RunGroup, t as ApprovalCard, u as RunRowStatusDot, v as taskProgress, w as traceSpanMark, x as foldAgentRows, y as taskStatus } from "./run-CJyFiBG9.js";
|
|
16
16
|
import { t as LatestEvents } from "./latest-events-v_vXRyd7.js";
|
|
17
|
-
import { a as VirtualList, i as model_exports, n as Conversation, r as indexRecord, t as withPrompts } from "./record-
|
|
17
|
+
import { a as VirtualList, i as model_exports, n as Conversation, r as indexRecord, t as withPrompts } from "./record-D-evY-c_.js";
|
|
18
18
|
import "./vault-tree.js";
|
|
19
19
|
import { a as TangleLoginButton, i as UserMenu, n as GitHubLoginButton, r as LoginLayout, t as AuthHeader } from "./auth-BDpoZ_2f.js";
|
|
20
20
|
import { t as AgentMessagingConnection } from "./connections-DymjzHe_.js";
|
|
21
|
-
import { i as useSessionStream, t as useSidecarAuth } from "./use-sidecar-auth-
|
|
21
|
+
import { i as useSessionStream, t as useSidecarAuth } from "./use-sidecar-auth-D9BrWCg1.js";
|
|
22
22
|
import { RealtimeSessionRegistry, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useCreateSession, useDeleteSession, useDropdownMenu, useLiveTime, useRealtimeSession, useRenameSession, useRunCollapseState, useRunGroups, useSSEStream, useSandboxMetrics, useSdkSession, useSessions, useToolCallStream } from "./hooks.js";
|
|
23
23
|
import { activeSessionsAtom, addMessage, addParts, bumpActiveSessionActivity, clearChat, connectSession, disconnectSession, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, isStreamingAtom, messagesAtom, partMapAtom, registerActiveSession, resetActiveSessions, sessionAtom, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions } from "./stores.js";
|
|
24
24
|
import "./types.js";
|
|
@@ -136,8 +136,16 @@ function VirtualList({ items, keyOf, render, scroller, estimate = 96, overscan =
|
|
|
136
136
|
useEffect(() => {
|
|
137
137
|
const element = scroller.current;
|
|
138
138
|
if (!element) return;
|
|
139
|
-
const release = () => {
|
|
140
|
-
|
|
139
|
+
const release = (event) => {
|
|
140
|
+
const key = event instanceof KeyboardEvent && event.target === element && !event.defaultPrevented ? event.key : "";
|
|
141
|
+
pending.current = items.length && (key === "Home" || key === "End") ? {
|
|
142
|
+
key: keyOf(items[key === "Home" ? 0 : items.length - 1]),
|
|
143
|
+
until: performance.now() + 2e3
|
|
144
|
+
} : null;
|
|
145
|
+
if (pending.current) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
settle();
|
|
148
|
+
}
|
|
141
149
|
};
|
|
142
150
|
element.addEventListener("wheel", release, { passive: true });
|
|
143
151
|
element.addEventListener("touchstart", release, { passive: true });
|
|
@@ -149,7 +157,12 @@ function VirtualList({ items, keyOf, render, scroller, estimate = 96, overscan =
|
|
|
149
157
|
element.removeEventListener("pointerdown", release);
|
|
150
158
|
element.removeEventListener("keydown", release);
|
|
151
159
|
};
|
|
152
|
-
}, [
|
|
160
|
+
}, [
|
|
161
|
+
scroller,
|
|
162
|
+
items,
|
|
163
|
+
keyOf,
|
|
164
|
+
offsets
|
|
165
|
+
]);
|
|
153
166
|
const bind = (key) => (element) => {
|
|
154
167
|
if (!element) {
|
|
155
168
|
rows.current.delete(key);
|
|
@@ -173,7 +186,10 @@ function VirtualList({ items, keyOf, render, scroller, estimate = 96, overscan =
|
|
|
173
186
|
});
|
|
174
187
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
175
188
|
/* @__PURE__ */ jsx("div", {
|
|
176
|
-
style: {
|
|
189
|
+
style: {
|
|
190
|
+
height: offsets[start],
|
|
191
|
+
transitionProperty: "none"
|
|
192
|
+
},
|
|
177
193
|
"aria-hidden": "true"
|
|
178
194
|
}),
|
|
179
195
|
items.slice(start, end).map((item, i) => {
|
|
@@ -186,7 +202,10 @@ function VirtualList({ items, keyOf, render, scroller, estimate = 96, overscan =
|
|
|
186
202
|
}, key);
|
|
187
203
|
}),
|
|
188
204
|
/* @__PURE__ */ jsx("div", {
|
|
189
|
-
style: {
|
|
205
|
+
style: {
|
|
206
|
+
height: offsets[items.length] - offsets[end],
|
|
207
|
+
transitionProperty: "none"
|
|
208
|
+
},
|
|
190
209
|
"aria-hidden": "true"
|
|
191
210
|
})
|
|
192
211
|
] });
|
package/dist/run/record.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as Conversation, a as VirtualList, r as indexRecord, i as recordModel, t as withPrompts } from "../record-
|
|
1
|
+
export { n as Conversation, a as VirtualList, r as indexRecord, i as recordModel, t as withPrompts } from "../record-D-evY-c_.js";
|
|
@@ -3,7 +3,7 @@ import { i as modelBrandFor, t as ModelBrandStack } from "./model-brand-bTcMjQtB
|
|
|
3
3
|
import { t as ProviderIcon } from "./provider-logo-CPKRPHcS.js";
|
|
4
4
|
import { f as syncAmbient, l as activityTiming, t as AgentGraph, u as ambientStyle } from "./AgentGraph-CFlI9qta.js";
|
|
5
5
|
import { t as LatestEvents } from "./latest-events-v_vXRyd7.js";
|
|
6
|
-
import "./record-
|
|
6
|
+
import "./record-D-evY-c_.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
9
9
|
import { X } from "lucide-react";
|
package/dist/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as TraceWaterfall, S as useAgentStream, _ as statusMeta, a as InlineToolItem, b as TraceWorkspace, c as RunPhaseList, d as RunStatusIcon, f as TaskList, g as showsTaskPriority, h as runStatus, i as InlineThinkingItem, l as RunRowShell, m as parseToolEvent, n as ApprovalDiffSummary, o as LiveDuration, p as ToolCallFeed, r as ExpandedToolDetail, s as RunGroup, t as ApprovalCard, u as RunRowStatusDot, v as taskProgress, w as traceSpanMark, x as foldAgentRows, y as taskStatus } from "./run-
|
|
1
|
+
import { C as TraceWaterfall, S as useAgentStream, _ as statusMeta, a as InlineToolItem, b as TraceWorkspace, c as RunPhaseList, d as RunStatusIcon, f as TaskList, g as showsTaskPriority, h as runStatus, i as InlineThinkingItem, l as RunRowShell, m as parseToolEvent, n as ApprovalDiffSummary, o as LiveDuration, p as ToolCallFeed, r as ExpandedToolDetail, s as RunGroup, t as ApprovalCard, u as RunRowStatusDot, v as taskProgress, w as traceSpanMark, x as foldAgentRows, y as taskStatus } from "./run-CJyFiBG9.js";
|
|
2
2
|
import { t as LatestEvents } from "./latest-events-v_vXRyd7.js";
|
|
3
|
-
import { a as VirtualList, i as model_exports, n as Conversation, r as indexRecord, t as withPrompts } from "./record-
|
|
3
|
+
import { a as VirtualList, i as model_exports, n as Conversation, r as indexRecord, t as withPrompts } from "./record-D-evY-c_.js";
|
|
4
4
|
export { ApprovalCard, ApprovalDiffSummary, Conversation, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LatestEvents, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, TraceWaterfall, TraceWorkspace, VirtualList, foldAgentRows, indexRecord, parseToolEvent, model_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, withPrompts };
|
package/dist/sdk-hooks.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as useSessionStream, t as useSidecarAuth } from "./use-sidecar-auth-
|
|
1
|
+
import { i as useSessionStream, t as useSidecarAuth } from "./use-sidecar-auth-D9BrWCg1.js";
|
|
2
2
|
import { RealtimeSessionRegistry, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream } from "@tangle-network/ui/sdk-hooks";
|
|
3
3
|
export { RealtimeSessionRegistry, useAutoScroll, useDropdownMenu, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionStream, useSidecarAuth, useToolCallStream };
|
|
@@ -188,7 +188,7 @@ function useSessionStream({ apiUrl, token, sessionId, enabled = true }) {
|
|
|
188
188
|
const refetch = useCallback(async () => {
|
|
189
189
|
if (!token || !sessionId || !apiUrl) return;
|
|
190
190
|
try {
|
|
191
|
-
const data = await fetchJson(`${apiUrl}/
|
|
191
|
+
const data = await fetchJson(`${apiUrl}/agents/sessions/${encodeURIComponent(sessionId)}/messages?limit=200`, token);
|
|
192
192
|
const apiMessages = Array.isArray(data) ? data : data.messages ?? [];
|
|
193
193
|
const newMessages = [];
|
|
194
194
|
const newPartMap = {};
|
|
@@ -237,7 +237,7 @@ function useSessionStream({ apiUrl, token, sessionId, enabled = true }) {
|
|
|
237
237
|
seedGenerationRef.current.set(sessionId, generation);
|
|
238
238
|
let seeded;
|
|
239
239
|
try {
|
|
240
|
-
const field = (await fetchJson(`${apiUrl}/
|
|
240
|
+
const field = (await fetchJson(`${apiUrl}/agents/sessions/${encodeURIComponent(sessionId)}`, token)).hubConnectionsDegraded;
|
|
241
241
|
if (field === void 0 || field === null) seeded = null;
|
|
242
242
|
else {
|
|
243
243
|
seeded = readDegradation(field);
|
|
@@ -270,7 +270,7 @@ function useSessionStream({ apiUrl, token, sessionId, enabled = true }) {
|
|
|
270
270
|
if (activeExecutionIds.length === 1) eventQuery.set("executionId", activeExecutionIds[0]);
|
|
271
271
|
else if (activeExecutionIds.length > 1) eventQuery.set("replayExecutionIds", activeExecutionIds.join(","));
|
|
272
272
|
if (lastEventIdRef.current) eventQuery.set("since", lastEventIdRef.current);
|
|
273
|
-
const url = `${apiUrl}/
|
|
273
|
+
const url = `${apiUrl}/agents/events?${eventQuery.toString()}`;
|
|
274
274
|
const res = await fetch(url, {
|
|
275
275
|
headers: { Authorization: `Bearer ${token}` },
|
|
276
276
|
signal: controller.signal,
|
|
@@ -522,7 +522,7 @@ function useSessionStream({ apiUrl, token, sessionId, enabled = true }) {
|
|
|
522
522
|
}));
|
|
523
523
|
setIsStreaming(true);
|
|
524
524
|
try {
|
|
525
|
-
const response = await fetchJson(`${apiUrl}/
|
|
525
|
+
const response = await fetchJson(`${apiUrl}/agents/sessions/${encodeURIComponent(sessionId)}/messages`, token, {
|
|
526
526
|
method: "POST",
|
|
527
527
|
body: JSON.stringify({
|
|
528
528
|
parts: [{
|
|
@@ -574,7 +574,7 @@ function useSessionStream({ apiUrl, token, sessionId, enabled = true }) {
|
|
|
574
574
|
const abort = useCallback(async () => {
|
|
575
575
|
if (!token || !sessionId || !apiUrl) return;
|
|
576
576
|
try {
|
|
577
|
-
await fetchJson(`${apiUrl}/
|
|
577
|
+
await fetchJson(`${apiUrl}/agents/sessions/${encodeURIComponent(sessionId)}/abort`, token, { method: "POST" });
|
|
578
578
|
} catch (err) {
|
|
579
579
|
const msg = err instanceof Error ? err.message : "Failed to abort";
|
|
580
580
|
setError(msg);
|
package/package.json
CHANGED