@tangle-network/sandbox-ui 2.0.18 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/globals.css +19 -0
- package/dist/hooks/use-document.d.ts +2 -0
- package/dist/{use-document-D6Z9oFLm.js → hooks/use-document.js} +29 -7
- package/dist/hooks.d.ts +140 -2
- package/dist/hooks.js +1 -1
- package/dist/{index-DRLVHl-o.d.ts → index-BYkigpIM.d.ts} +8 -1
- package/dist/{index-BnaVprN6.d.ts → index-ByNsP4VC.d.ts} +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{record-Bqt1kE_Q.js → record-Cwyo2oHb.js} +80 -2
- package/dist/run/live.d.ts +1 -0
- package/dist/run/live.js +36 -13
- package/dist/run/record.d.ts +2 -2
- package/dist/run/record.js +1 -1
- package/dist/run.d.ts +3 -3
- package/dist/run.js +2 -2
- package/dist/styles.css +19 -0
- package/dist/use-document-DCXGpk0q.d.ts +16 -0
- package/dist/workspace-viewer.js +78 -35
- package/package.json +5 -1
- package/dist/index-D5Hig-j9.d.ts +0 -155
package/dist/index-D5Hig-j9.d.ts
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import "./use-pty-session-DSgtQyYX.js";
|
|
2
|
-
import { t as Session } from "./sidecar-CNP4zXop.js";
|
|
3
|
-
import "./use-sidecar-auth-CPevSSEj.js";
|
|
4
|
-
import { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AuthUser, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, ConnectionState, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useLiveTime, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream } from "@tangle-network/ui/hooks";
|
|
5
|
-
/**
|
|
6
|
-
* Sandbox-level telemetry collected by the sidecar from cgroup v2
|
|
7
|
-
* (Docker) or /proc (Firecracker guest). `cpuPercent` is computed
|
|
8
|
-
* server-side from consecutive samples; sections are null when the
|
|
9
|
-
* source cannot provide them.
|
|
10
|
-
*/
|
|
11
|
-
interface SystemMetricsSnapshot {
|
|
12
|
-
cpuPercent: number | null;
|
|
13
|
-
cpuCores: number;
|
|
14
|
-
memory: {
|
|
15
|
-
usedBytes: number;
|
|
16
|
-
totalBytes: number;
|
|
17
|
-
} | null;
|
|
18
|
-
disk: {
|
|
19
|
-
usedBytes: number;
|
|
20
|
-
totalBytes: number;
|
|
21
|
-
path: string;
|
|
22
|
-
} | null;
|
|
23
|
-
source: "cgroup-v2" | "proc";
|
|
24
|
-
}
|
|
25
|
-
interface LatencyPercentiles {
|
|
26
|
-
p50: number | null;
|
|
27
|
-
p95: number | null;
|
|
28
|
-
sampleCount: number;
|
|
29
|
-
}
|
|
30
|
-
interface SandboxLatencyMetrics {
|
|
31
|
-
ttftMs: LatencyPercentiles;
|
|
32
|
-
firstResponseMs: LatencyPercentiles;
|
|
33
|
-
runDurationMs: LatencyPercentiles;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Shape returned by the sidecar `/metrics/json` endpoint. Only the
|
|
37
|
-
* fields read by this hook are modeled; the sidecar may add more.
|
|
38
|
-
*/
|
|
39
|
-
interface SidecarMetricsPayload {
|
|
40
|
-
process?: {
|
|
41
|
-
memoryBytes?: {
|
|
42
|
-
rss?: number;
|
|
43
|
-
heapTotal?: number;
|
|
44
|
-
heapUsed?: number;
|
|
45
|
-
external?: number;
|
|
46
|
-
arrayBuffers?: number;
|
|
47
|
-
};
|
|
48
|
-
cpuSeconds?: {
|
|
49
|
-
user?: number;
|
|
50
|
-
system?: number;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
system?: SystemMetricsSnapshot | null;
|
|
54
|
-
latency?: SandboxLatencyMetrics;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* One polled time-series point, sourced from the sandbox-level
|
|
58
|
-
* `system` section. Null values mean the sidecar could not provide
|
|
59
|
-
* that reading — charts must render a gap, not a zero.
|
|
60
|
-
*/
|
|
61
|
-
interface SandboxMetricsSample {
|
|
62
|
-
/** Wall-clock ms when the sample was committed client-side. */
|
|
63
|
-
at: number;
|
|
64
|
-
cpuPercent: number | null;
|
|
65
|
-
memoryUsedBytes: number | null;
|
|
66
|
-
memoryTotalBytes: number | null;
|
|
67
|
-
diskUsedBytes: number | null;
|
|
68
|
-
diskTotalBytes: number | null;
|
|
69
|
-
}
|
|
70
|
-
interface SandboxMetrics {
|
|
71
|
-
/**
|
|
72
|
-
* CPU% derived from consecutive samples. `null` on the first sample
|
|
73
|
-
* because a delta is required. Can exceed 100 on multi-core hosts.
|
|
74
|
-
*/
|
|
75
|
-
cpuPercent: number | null;
|
|
76
|
-
rssBytes: number;
|
|
77
|
-
heapUsedBytes: number;
|
|
78
|
-
heapTotalBytes: number;
|
|
79
|
-
}
|
|
80
|
-
interface UseSandboxMetricsOptions {
|
|
81
|
-
/**
|
|
82
|
-
* Sandbox API base URL, e.g. `https://api.tangle.tools`.
|
|
83
|
-
* Use an empty string for same-origin requests.
|
|
84
|
-
*/
|
|
85
|
-
apiBaseUrl: string;
|
|
86
|
-
/** Sandbox id; when falsy the hook stays idle. */
|
|
87
|
-
sandboxId?: string | null;
|
|
88
|
-
/**
|
|
89
|
-
* Optional bearer token. When omitted the fetch still sends
|
|
90
|
-
* credentials so a cookie session can authenticate the proxy.
|
|
91
|
-
*/
|
|
92
|
-
token?: string | null;
|
|
93
|
-
/** Pause polling when false. Defaults to true. */
|
|
94
|
-
enabled?: boolean;
|
|
95
|
-
/** Poll cadence; clamped to a 500ms floor. Defaults to 3000. */
|
|
96
|
-
intervalMs?: number;
|
|
97
|
-
/** Max retained history samples for charting. Defaults to 120. */
|
|
98
|
-
historyLimit?: number;
|
|
99
|
-
}
|
|
100
|
-
interface UseSandboxMetricsResult {
|
|
101
|
-
metrics: SandboxMetrics | null;
|
|
102
|
-
/**
|
|
103
|
-
* Sandbox-level (container/VM) telemetry. Null until the sidecar
|
|
104
|
-
* reports a `system` section — older sidecars never will, and
|
|
105
|
-
* consumers must surface that as "unavailable", not zeros.
|
|
106
|
-
*/
|
|
107
|
-
system: SystemMetricsSnapshot | null;
|
|
108
|
-
/** Agent latency percentiles (TTFT, first response, run duration). */
|
|
109
|
-
latency: SandboxLatencyMetrics | null;
|
|
110
|
-
/**
|
|
111
|
-
* Rolling window of system samples (oldest first), capped at
|
|
112
|
-
* `historyLimit`. Cleared when the target sandbox changes.
|
|
113
|
-
*/
|
|
114
|
-
history: SandboxMetricsSample[];
|
|
115
|
-
/**
|
|
116
|
-
* True while waiting for the first successful metrics response for this
|
|
117
|
-
* sandbox. Errors clear it so consumers can show the failure state.
|
|
118
|
-
*/
|
|
119
|
-
loading: boolean;
|
|
120
|
-
error: Error | null;
|
|
121
|
-
/** Wall-clock ms of the last successful metrics response, or null. */
|
|
122
|
-
lastUpdatedAt: number | null;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Polls the sandbox's sidecar metrics through the API proxy and
|
|
126
|
-
* derives a CPU% value from consecutive cumulative-CPU samples. Used
|
|
127
|
-
* by the sandbox overview dashboard to drive live CPU/memory panels.
|
|
128
|
-
*/
|
|
129
|
-
declare function useSandboxMetrics({ apiBaseUrl, sandboxId, token, enabled, intervalMs, historyLimit }: UseSandboxMetricsOptions): UseSandboxMetricsResult;
|
|
130
|
-
/** List all sessions for a sidecar. */
|
|
131
|
-
declare function useSessions(apiUrl: string, token: string | null): import("@tanstack/react-query").UseQueryResult<Session[], Error>;
|
|
132
|
-
/** Create a new session. */
|
|
133
|
-
declare function useCreateSession(apiUrl: string, token: string | null): import("@tanstack/react-query").UseMutationResult<Session, Error, string, unknown>;
|
|
134
|
-
/** Delete a session by ID. */
|
|
135
|
-
declare function useDeleteSession(apiUrl: string, token: string | null): import("@tanstack/react-query").UseMutationResult<unknown, Error, string, unknown>;
|
|
136
|
-
/** Rename a session. */
|
|
137
|
-
declare function useRenameSession(apiUrl: string, token: string | null): import("@tanstack/react-query").UseMutationResult<Session, Error, {
|
|
138
|
-
sessionId: string;
|
|
139
|
-
title: string;
|
|
140
|
-
}, unknown>;
|
|
141
|
-
/**
|
|
142
|
-
* Same-origin JSON with ETag revalidation. `poll` refetches every `poll` ms while set; turning polling on or off keeps
|
|
143
|
-
* the document. With `keepPrevious`, a new URL (a record's next digest) keeps showing the previous document until the
|
|
144
|
-
* new one arrives, so a run being written never blanks between versions. A response marked stale is refetched until it is current.
|
|
145
|
-
*/
|
|
146
|
-
declare function useDocument<T>(url: string | null, poll?: number, keepPrevious?: boolean, fetcher?: typeof fetch): {
|
|
147
|
-
url: string | null;
|
|
148
|
-
data?: T;
|
|
149
|
-
error?: string;
|
|
150
|
-
status?: number;
|
|
151
|
-
loading: boolean;
|
|
152
|
-
stale?: boolean;
|
|
153
|
-
failing?: string;
|
|
154
|
-
};
|
|
155
|
-
export { UseSandboxMetricsResult as $, useApiKey as A, useToolCallStream as B, UseRunGroupsOptions as C, UseSdkSessionReturn as D, UseSdkSessionOptions as E, useRealtimeSession as F, useSessions as G, useCreateSession as H, useRunCollapseState as I, SandboxMetrics as J, LatencyPercentiles as K, useRunGroups as L, useAutoScroll as M, useDropdownMenu as N, UseToolCallStreamReturn as O, useLiveTime as P, UseSandboxMetricsOptions as Q, useSSEStream as R, UseAuthResult as S, UseSSEStreamResult as T, useDeleteSession as U, useDocument as V, useRenameSession as W, SidecarMetricsPayload as X, SandboxMetricsSample as Y, SystemMetricsSnapshot as Z, SdkSessionEvent as _, AutomationStreamEvent as a, TerminalStreamEvent as b, CompleteAssistantMessageOptions as c, RealtimeSessionRegistry as d, useSandboxMetrics as et, RealtimeSessionRegistryProps as f, SdkSessionAttachment as g, SSEEvent as h, AuthUser as i, useAuth as j, createAuthFetcher as k, ConnectionState as l, RealtimeSessionTarget as m, AppendUserMessageOptions as n, BeginAssistantMessageOptions as o, RealtimeSessionState as p, SandboxLatencyMetrics as q, ApplySdkEventOptions as r, BotStreamEvent as s, AgentStreamEvent as t, RealtimeSessionOptions as u, SdkSessionSeed as v, UseSSEStreamOptions as w, UseAuthOptions as x, TaskStreamEvent as y, useSdkSession as z };
|