@tangle-network/sandbox-ui 3.0.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +0 -47
  2. package/dist/AgentTree-D4d06rfH.js +293 -0
  3. package/dist/{ResearchReport-vqefUbVp.js → ResearchReport-D1TFmldm.js} +2 -1
  4. package/dist/{VirtualList-CMynqkkh.js → VirtualList-DcSGbEtA.js} +28 -1
  5. package/dist/globals.css +12 -3
  6. package/dist/{index-gXcuwPOX.d.ts → index-Bv2iiZaN.d.ts} +135 -2
  7. package/dist/{index-YU_b9xCK.d.ts → index-CHA38az4.d.ts} +3 -61
  8. package/dist/{index-CQGMhSg0.d.ts → index-Z6RCpkmT.d.ts} +16 -1
  9. package/dist/index.d.ts +4 -5
  10. package/dist/index.js +10 -10
  11. package/dist/record/ResearchReport.js +1 -1
  12. package/dist/{record-B_4XWfUz.js → record-C-EUpK-n.js} +3 -2
  13. package/dist/record.js +1 -1
  14. package/dist/report-viewer.js +80 -80
  15. package/dist/run/live.js +2 -2
  16. package/dist/run/record.d.ts +2 -2
  17. package/dist/run/record.js +5 -4
  18. package/dist/run.d.ts +3 -3
  19. package/dist/run.js +6 -5
  20. package/dist/runtime-viewer/{AgentGraphCanvas-DGq7_u8--WPFPgd72.js → AgentGraphCanvas-DGq7_u8--C6yDfIUT.js} +67 -67
  21. package/dist/runtime-viewer/{latest-events-CRq9sGkK-YFXUh9qO.js → latest-events-CRq9sGkK-CfoBl1dP.js} +215 -209
  22. package/dist/styles.css +12 -3
  23. package/dist/{trace-workspace-BiJbv9WQ.js → trace-workspace-B634-EcA.js} +287 -201
  24. package/dist/{tree-data-9D309DqD.js → tree-data-rg5voiY8.js} +1 -1
  25. package/dist/{AgentTree-Cju8jn51.js → use-follow-tail-DZFn7QDO.js} +144 -385
  26. package/dist/vault-tree.js +1 -1
  27. package/dist/{workbench-Z9wbei53.js → workbench-DWQ0pm9w.js} +311 -2
  28. package/dist/workbench.d.ts +2 -2
  29. package/dist/workbench.js +2 -2
  30. package/dist/{workspace-BrS_rHWN.js → workspace-CJD7oOEa.js} +1 -1
  31. package/dist/{workspace-files-pane-Di_rn4FL.js → workspace-files-pane-D24G7H_Z.js} +1 -1
  32. package/dist/workspace-viewer.js +9970 -9624
  33. package/dist/workspace.js +2 -2
  34. package/package.json +5 -8
  35. package/dist/connections-DymjzHe_.js +0 -179
  36. package/dist/connections.d.ts +0 -2
  37. package/dist/connections.js +0 -1
  38. package/dist/index-DLX35YAa.d.ts +0 -59
  39. package/dist/use-follow-tail-Ht7fZGQQ.js +0 -1
package/dist/workspace.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { i as WorkspacePaneHeader, n as SHELL_INSET_GUTTER, r as ShellHeader, t as SHELL_HEADER_HEIGHT } from "./shell-header-CwqDzC4I.js";
2
- import { S as WorkspaceSurfaceTitle, _ as StatusBanner, a as SandboxWorkbench, b as WorkspaceSurface, c as shellShouldRevalidate, d as dispatchSessionCreated, f as useOptimisticSessionItems, g as StatusBar, h as TerminalPanel, i as TaskBoard, l as SessionSidebar, m as RuntimePane, n as ApprovalQueue, o as WorkspaceArtifactView, p as formatRelativeAge, r as CalendarView, s as createShellShouldRevalidate, t as ArtifactPane, u as SESSION_CREATED_EVENT, v as DirectoryPane, x as WorkspaceSurfaceFrame, y as WorkspaceLayout } from "./workspace-BrS_rHWN.js";
3
- import { t as WorkspaceFilesPane } from "./workspace-files-pane-Di_rn4FL.js";
2
+ import { S as WorkspaceSurfaceTitle, _ as StatusBanner, a as SandboxWorkbench, b as WorkspaceSurface, c as shellShouldRevalidate, d as dispatchSessionCreated, f as useOptimisticSessionItems, g as StatusBar, h as TerminalPanel, i as TaskBoard, l as SessionSidebar, m as RuntimePane, n as ApprovalQueue, o as WorkspaceArtifactView, p as formatRelativeAge, r as CalendarView, s as createShellShouldRevalidate, t as ArtifactPane, u as SESSION_CREATED_EVENT, v as DirectoryPane, x as WorkspaceSurfaceFrame, y as WorkspaceLayout } from "./workspace-CJD7oOEa.js";
3
+ import { t as WorkspaceFilesPane } from "./workspace-files-pane-D24G7H_Z.js";
4
4
  export { ApprovalQueue, ArtifactPane, CalendarView, DirectoryPane, RuntimePane, SESSION_CREATED_EVENT, SHELL_HEADER_HEIGHT, SHELL_INSET_GUTTER, SandboxWorkbench, SessionSidebar, ShellHeader, StatusBanner, StatusBar, TaskBoard, TerminalPanel, WorkspaceArtifactView, WorkspaceFilesPane, WorkspaceLayout, WorkspacePaneHeader, WorkspaceSurface, WorkspaceSurfaceFrame, WorkspaceSurfaceTitle, createShellShouldRevalidate, dispatchSessionCreated, formatRelativeAge, shellShouldRevalidate, useOptimisticSessionItems };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "3.0.2",
3
+ "version": "4.0.0",
4
4
  "license": "MIT",
5
5
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
6
6
  "repository": {
@@ -87,10 +87,6 @@
87
87
  "import": "./dist/integrations.js",
88
88
  "types": "./dist/integrations.d.ts"
89
89
  },
90
- "./connections": {
91
- "import": "./dist/connections.js",
92
- "types": "./dist/connections.d.ts"
93
- },
94
90
  "./connectors": {
95
91
  "import": "./dist/connectors.js",
96
92
  "types": "./dist/connectors.d.ts"
@@ -161,7 +157,7 @@
161
157
  "@tangle-network/agent-interface": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^5.2.0",
162
158
  "@tangle-network/brand": "^1.31.3",
163
159
  "@tangle-network/charts": "^4.0.2",
164
- "@tangle-network/ui": "^11.51.11",
160
+ "@tangle-network/ui": "^11.51.12",
165
161
  "@tanstack/react-query": "^5.0.0",
166
162
  "@tiptap/core": ">=3.20.4 <4.0.0",
167
163
  "@tiptap/extension-collaboration": ">=3.20.4 <4.0.0",
@@ -242,7 +238,7 @@
242
238
  "@radix-ui/react-dialog": "^1.3.1",
243
239
  "@radix-ui/react-dropdown-menu": "^2.2.1",
244
240
  "@radix-ui/react-select": "^2.4.1",
245
- "@tangle-network/ui": "^11.51.11",
241
+ "@tangle-network/ui": "^11.51.12",
246
242
  "diff": "^9.0.0",
247
243
  "eventsource-parser": "4.1.2",
248
244
  "lucide-react": "^1.61.0",
@@ -302,7 +298,8 @@
302
298
  "vite": "^8.3.5",
303
299
  "vitest": "^5.0.5",
304
300
  "yjs": "^13.6.33",
305
- "@drewstone/agent-record": "https://github.com/drewstone/agent-record/releases/download/v3.0.3/drewstone-agent-record-3.0.3.tgz"
301
+ "@drewstone/agent-record": "https://github.com/drewstone/agent-record/releases/download/v3.0.3/drewstone-agent-record-3.0.3.tgz",
302
+ "@tangle-network/ui": "^11.51.12"
306
303
  },
307
304
  "scripts": {
308
305
  "build": "tsdown",
@@ -1,179 +0,0 @@
1
- import { Button } from "@tangle-network/ui/primitives";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import * as React$1 from "react";
4
- import { AlertCircle, CheckCircle2, Loader2, MessageSquare, ShieldCheck } from "lucide-react";
5
- import { cn } from "@tangle-network/ui/utils";
6
- // src/connections/agent-messaging-connection.tsx
7
- function AgentStatus({ enrollment }) {
8
- switch (enrollment.status) {
9
- case "checking": return /* @__PURE__ */ jsx("span", { children: "Checking access…" });
10
- case "eligible": return /* @__PURE__ */ jsx("span", { children: "Not connected" });
11
- case "enrolling": return /* @__PURE__ */ jsx("span", { children: "Connecting your agent…" });
12
- case "enrolled": return /* @__PURE__ */ jsxs("span", { children: [
13
- "Connected to ",
14
- /* @__PURE__ */ jsx("strong", {
15
- className: "font-medium text-foreground",
16
- children: enrollment.target.agentLabel
17
- }),
18
- enrollment.target.workspaceLabel && /* @__PURE__ */ jsxs(Fragment, { children: [" in ", enrollment.target.workspaceLabel] })
19
- ] });
20
- case "forbidden": return /* @__PURE__ */ jsx("span", { children: enrollment.message ?? "You cannot connect this agent." });
21
- case "error": return /* @__PURE__ */ jsx("span", { children: enrollment.message ?? "Could not check agent access." });
22
- }
23
- }
24
- function RouteStatus({ enrollment, route }) {
25
- switch (route.status) {
26
- case "checking": return /* @__PURE__ */ jsx("span", { children: "Checking messaging…" });
27
- case "pending": return /* @__PURE__ */ jsx("span", { children: route.message ?? "Setting up messaging…" });
28
- case "ready": return enrollment.status === "enrolled" ? /* @__PURE__ */ jsxs("span", { children: [
29
- "Ready on ",
30
- /* @__PURE__ */ jsx("strong", {
31
- className: "font-medium text-foreground",
32
- children: route.channelLabel
33
- }),
34
- /* @__PURE__ */ jsx("span", {
35
- className: "block break-words",
36
- children: route.destinationLabel
37
- })
38
- ] }) : enrollment.status === "eligible" ? /* @__PURE__ */ jsx("span", { children: "Connect your agent to use messaging." }) : /* @__PURE__ */ jsx("span", { children: "Agent connection is unconfirmed." });
39
- case "unavailable": return /* @__PURE__ */ jsx("span", { children: route.message ?? "Messaging is unavailable right now." });
40
- case "forbidden": return /* @__PURE__ */ jsx("span", { children: route.message ?? "You cannot use messaging in this app." });
41
- case "error": return /* @__PURE__ */ jsx("span", { children: route.message ?? "Could not check messaging." });
42
- }
43
- }
44
- function AgentMessagingConnection({ enrollment, route, onEnroll, onOpenMessages, onRetry, className }) {
45
- const [submitting, setSubmitting] = React$1.useState(false);
46
- const [actionError, setActionError] = React$1.useState(null);
47
- const submittingRef = React$1.useRef(false);
48
- const canMessage = enrollment.status === "enrolled" && route.status === "ready";
49
- const canRetry = enrollment.status === "error" || route.status === "error";
50
- React$1.useEffect(() => {
51
- setActionError(null);
52
- }, [enrollment.status, route.status]);
53
- async function enroll() {
54
- if (enrollment.status !== "eligible" || submittingRef.current) return;
55
- submittingRef.current = true;
56
- setSubmitting(true);
57
- setActionError(null);
58
- try {
59
- await onEnroll();
60
- } catch {
61
- setActionError("Could not connect the agent. Try again.");
62
- } finally {
63
- submittingRef.current = false;
64
- setSubmitting(false);
65
- }
66
- }
67
- async function retry() {
68
- if (!onRetry || submittingRef.current) return;
69
- submittingRef.current = true;
70
- setSubmitting(true);
71
- setActionError(null);
72
- try {
73
- await onRetry();
74
- } catch {
75
- setActionError("Could not check messaging. Try again.");
76
- } finally {
77
- submittingRef.current = false;
78
- setSubmitting(false);
79
- }
80
- }
81
- return /* @__PURE__ */ jsxs("section", {
82
- "aria-label": "Agent messaging connection",
83
- className: cn("rounded-xl border border-border bg-card p-4 text-sm text-foreground sm:p-5", className),
84
- children: [
85
- /* @__PURE__ */ jsx("h2", {
86
- className: "mb-4 text-base font-semibold",
87
- children: "Agent messaging"
88
- }),
89
- /* @__PURE__ */ jsxs("div", {
90
- className: "divide-y divide-border rounded-lg border border-border",
91
- children: [/* @__PURE__ */ jsxs("div", {
92
- className: "flex gap-3 p-3 sm:p-4",
93
- children: [
94
- /* @__PURE__ */ jsx(ShieldCheck, {
95
- "aria-hidden": "true",
96
- className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"
97
- }),
98
- /* @__PURE__ */ jsxs("div", {
99
- className: "min-w-0",
100
- children: [/* @__PURE__ */ jsx("p", {
101
- className: "font-medium",
102
- children: "Private agent"
103
- }), /* @__PURE__ */ jsx("p", {
104
- "aria-live": "polite",
105
- className: "mt-0.5 break-words text-muted-foreground",
106
- children: /* @__PURE__ */ jsx(AgentStatus, { enrollment })
107
- })]
108
- }),
109
- enrollment.status === "enrolled" && /* @__PURE__ */ jsx(CheckCircle2, {
110
- "aria-label": "Connected",
111
- className: "ml-auto h-4 w-4 shrink-0 text-[var(--code-success)]"
112
- })
113
- ]
114
- }), /* @__PURE__ */ jsxs("div", {
115
- className: "flex gap-3 p-3 sm:p-4",
116
- children: [
117
- /* @__PURE__ */ jsx(MessageSquare, {
118
- "aria-hidden": "true",
119
- className: "mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"
120
- }),
121
- /* @__PURE__ */ jsxs("div", {
122
- className: "min-w-0",
123
- children: [/* @__PURE__ */ jsx("p", {
124
- className: "font-medium",
125
- children: "Messaging"
126
- }), /* @__PURE__ */ jsx("p", {
127
- "aria-live": "polite",
128
- className: "mt-0.5 break-words text-muted-foreground",
129
- children: /* @__PURE__ */ jsx(RouteStatus, {
130
- enrollment,
131
- route
132
- })
133
- })]
134
- }),
135
- canMessage && /* @__PURE__ */ jsx(CheckCircle2, {
136
- "aria-label": "Ready",
137
- className: "ml-auto h-4 w-4 shrink-0 text-[var(--code-success)]"
138
- })
139
- ]
140
- })]
141
- }),
142
- (enrollment.status === "eligible" || canMessage || canRetry && onRetry) && /* @__PURE__ */ jsxs("div", {
143
- className: "mt-4 flex flex-wrap items-center gap-3",
144
- children: [
145
- enrollment.status === "eligible" && /* @__PURE__ */ jsxs(Button, {
146
- type: "button",
147
- onClick: enroll,
148
- disabled: submitting,
149
- children: [submitting ? /* @__PURE__ */ jsx(Loader2, {
150
- "aria-hidden": "true",
151
- className: "mr-2 h-4 w-4 animate-spin"
152
- }) : null, submitting ? "Connecting agent…" : "Connect agent"]
153
- }),
154
- canMessage && onOpenMessages && /* @__PURE__ */ jsx(Button, {
155
- type: "button",
156
- onClick: onOpenMessages,
157
- children: "Open messages"
158
- }),
159
- canRetry && onRetry && /* @__PURE__ */ jsx(Button, {
160
- type: "button",
161
- variant: "outline",
162
- onClick: retry,
163
- disabled: submitting,
164
- children: submitting ? "Checking…" : "Check again"
165
- })
166
- ]
167
- }),
168
- actionError && /* @__PURE__ */ jsxs("p", {
169
- role: "alert",
170
- className: "mt-3 flex items-center gap-2 text-[var(--code-error)]",
171
- children: [/* @__PURE__ */ jsx(AlertCircle, {
172
- "aria-hidden": "true",
173
- className: "h-4 w-4 shrink-0"
174
- }), actionError]
175
- })
176
- ]
177
- });
178
- }
179
- export { AgentMessagingConnection as t };
@@ -1,2 +0,0 @@
1
- import { a as SharedMessagingRouteViewState, i as AgentTargetSummary, n as AgentMessagingConnection, r as AgentMessagingConnectionProps, t as AgentEnrollmentViewState } from "./index-DLX35YAa.js";
2
- export { type AgentEnrollmentViewState, AgentMessagingConnection, type AgentMessagingConnectionProps, type AgentTargetSummary, type SharedMessagingRouteViewState };
@@ -1 +0,0 @@
1
- export { t as AgentMessagingConnection } from "./connections-DymjzHe_.js";
@@ -1,59 +0,0 @@
1
- import * as React$1 from "react";
2
- /** Safe display fields for a host-resolved, authorized private agent target. */
3
- interface AgentTargetSummary {
4
- agentLabel: string;
5
- workspaceLabel?: string;
6
- }
7
- /** The host must recheck the member grant before reporting `eligible` or `enrolled`. */
8
- type AgentEnrollmentViewState = {
9
- status: "checking";
10
- } | {
11
- status: "eligible";
12
- } | {
13
- status: "enrolling";
14
- } | {
15
- status: "enrolled";
16
- target: AgentTargetSummary;
17
- } | {
18
- status: "forbidden";
19
- message?: string;
20
- } | {
21
- status: "error";
22
- message?: string;
23
- };
24
- /**
25
- * `ready` means the host verified this application's route for this member.
26
- * A globally attached provider line alone is not enough to report readiness.
27
- */
28
- type SharedMessagingRouteViewState = {
29
- status: "checking";
30
- } | {
31
- status: "pending";
32
- message?: string;
33
- } | {
34
- status: "ready";
35
- channelLabel: string;
36
- destinationLabel: string;
37
- } | {
38
- status: "forbidden";
39
- message?: string;
40
- } | {
41
- status: "unavailable";
42
- message?: string;
43
- } | {
44
- status: "error";
45
- message?: string;
46
- };
47
- interface AgentMessagingConnectionProps {
48
- enrollment: AgentEnrollmentViewState;
49
- route: SharedMessagingRouteViewState;
50
- /** The host performs authenticated, idempotent enrollment and reloads the result. */
51
- onEnroll: () => void | Promise<void>;
52
- /** Open the host's authorized conversation. Shown only when both states are ready. */
53
- onOpenMessages?: () => void;
54
- /** Recheck a failed host read. This does not enroll or mutate a provider route. */
55
- onRetry?: () => void | Promise<void>;
56
- className?: string;
57
- }
58
- declare function AgentMessagingConnection({ enrollment, route, onEnroll, onOpenMessages, onRetry, className }: AgentMessagingConnectionProps): React$1.JSX.Element;
59
- export { SharedMessagingRouteViewState as a, AgentTargetSummary as i, AgentMessagingConnection as n, AgentMessagingConnectionProps as r, AgentEnrollmentViewState as t };
@@ -1 +0,0 @@
1
- export { useFollowTail as t } from "@tangle-network/ui/hooks/use-follow-tail";