@tangle-network/sandbox-ui 0.113.7 → 0.114.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 (106) hide show
  1. package/dist/WorkflowGraph-B-NsdYz_.js +1961 -0
  2. package/dist/assets.d.ts +214 -206
  3. package/dist/assets.js +1057 -908
  4. package/dist/auth-CWe17Hly.js +37 -0
  5. package/dist/auth.d.ts +2 -30
  6. package/dist/auth.js +2 -15
  7. package/dist/chat-BOvFAe6p.js +903 -0
  8. package/dist/chat.d.ts +2 -230
  9. package/dist/chat.js +2 -34
  10. package/dist/connectors.d.ts +52 -49
  11. package/dist/connectors.js +595 -643
  12. package/dist/dashboard-CZ3VgNPR.js +4969 -0
  13. package/dist/dashboard.d.ts +4 -1297
  14. package/dist/dashboard.js +4 -152
  15. package/dist/editor.d.ts +2 -1
  16. package/dist/editor.js +2 -31
  17. package/dist/files.d.ts +2 -6
  18. package/dist/files.js +2 -33
  19. package/dist/globals.css +63 -3
  20. package/dist/hooks.d.ts +146 -148
  21. package/dist/hooks.js +222 -55
  22. package/dist/index-CKRaj1pM.d.ts +776 -0
  23. package/dist/index-CXX5IpH2.d.ts +2 -0
  24. package/dist/index-DPePq7c8.d.ts +1340 -0
  25. package/dist/index-DiyLLZuJ.d.ts +230 -0
  26. package/dist/index-DvmZLMT1.d.ts +30 -0
  27. package/dist/index-I8ZLVtHd.d.ts +330 -0
  28. package/dist/index-PRM636Ex.d.ts +86 -0
  29. package/dist/index.d.ts +21 -33
  30. package/dist/index.js +21 -701
  31. package/dist/info-panel-C9cqDzOL.js +594 -0
  32. package/dist/integrations.d.ts +133 -141
  33. package/dist/integrations.js +491 -673
  34. package/dist/markdown.d.ts +2 -1
  35. package/dist/markdown.js +2 -13
  36. package/dist/model-I-NIxeM-.js +1250 -0
  37. package/dist/model-brand-B9A4H9pJ.d.ts +98 -0
  38. package/dist/model-brand-hMyDTUqB.js +624 -0
  39. package/dist/motion-DkyBRJb9.js +37 -0
  40. package/dist/openui.d.ts +2 -1
  41. package/dist/openui.js +2 -7
  42. package/dist/pages.d.ts +307 -300
  43. package/dist/pages.js +4404 -4181
  44. package/dist/primitives-Dh1vG6J3.js +113 -0
  45. package/dist/primitives.d.ts +2 -74
  46. package/dist/primitives.js +2 -204
  47. package/dist/provider-logo-DjqmConF.js +311 -0
  48. package/dist/run.d.ts +2 -1
  49. package/dist/run.js +2 -23
  50. package/dist/sdk-hooks.d.ts +3 -4
  51. package/dist/sdk-hooks.js +3 -31
  52. package/dist/sidecar-DgH_vQ6m.d.ts +9 -0
  53. package/dist/stores.d.ts +14 -15
  54. package/dist/stores.js +13 -81
  55. package/dist/styles.css +63 -3
  56. package/dist/template-card-L-4gmjx2.d.ts +90 -0
  57. package/dist/terminal-CN9ZgHRt.js +197 -0
  58. package/dist/terminal.d.ts +60 -60
  59. package/dist/terminal.js +2 -10
  60. package/dist/tokens.css +51 -0
  61. package/dist/types.d.ts +4 -11
  62. package/dist/types.js +0 -1
  63. package/dist/use-pty-session-C8cE0adT.js +669 -0
  64. package/dist/use-sidecar-auth-CCTJcrq7.d.ts +145 -0
  65. package/dist/use-sidecar-auth-DkdcufOz.js +742 -0
  66. package/dist/utils-DzWbktWG.js +2 -0
  67. package/dist/utils.d.ts +2 -1
  68. package/dist/utils.js +2 -37
  69. package/dist/workbench-BCaCKl-J.js +8347 -0
  70. package/dist/workbench.d.ts +2 -310
  71. package/dist/workbench.js +2 -44
  72. package/dist/workflows.d.ts +341 -339
  73. package/dist/workflows.js +74 -109
  74. package/dist/workspace-B6AtI6ld.js +2510 -0
  75. package/dist/workspace.d.ts +2 -761
  76. package/dist/workspace.js +2 -51
  77. package/package.json +46 -40
  78. package/dist/WorkflowGraph-2QOORYIR.js +0 -1722
  79. package/dist/chunk-2BUPSB7O.js +0 -0
  80. package/dist/chunk-3KBNPQQF.js +0 -2697
  81. package/dist/chunk-3LIXVEEE.js +0 -279
  82. package/dist/chunk-72UF2H5H.js +0 -707
  83. package/dist/chunk-AI25G5MX.js +0 -944
  84. package/dist/chunk-ANSC5AFC.js +0 -314
  85. package/dist/chunk-AZ3AWMTM.js +0 -8
  86. package/dist/chunk-BGVEHENC.js +0 -10
  87. package/dist/chunk-CZ7CSFO4.js +0 -39
  88. package/dist/chunk-DYXXYGS4.js +0 -4700
  89. package/dist/chunk-EI44GEQ5.js +0 -6
  90. package/dist/chunk-IACRDXER.js +0 -219
  91. package/dist/chunk-IOB2PW5Z.js +0 -55
  92. package/dist/chunk-M4K7ZGR2.js +0 -24
  93. package/dist/chunk-MYZAW4RX.js +0 -665
  94. package/dist/chunk-OMUIPJQZ.js +0 -555
  95. package/dist/chunk-RQZRXKMR.js +0 -398
  96. package/dist/chunk-SOKKTB7W.js +0 -230
  97. package/dist/chunk-TADGS4Q7.js +0 -1010
  98. package/dist/chunk-UCQNOUN3.js +0 -7964
  99. package/dist/chunk-ULPLRBMF.js +0 -34
  100. package/dist/chunk-WID73FPH.js +0 -89
  101. package/dist/chunk-X3YXP7FG.js +0 -38
  102. package/dist/logo-DiAjq759.d.ts +0 -15
  103. package/dist/model-brand-BNnaUKKZ.d.ts +0 -99
  104. package/dist/ports-list-CDIvTNnX.d.ts +0 -17
  105. package/dist/sdk-hooks-Djkjq4cp.d.ts +0 -145
  106. package/dist/template-card-Bn-Bw5xC.d.ts +0 -87
@@ -0,0 +1,230 @@
1
+ import * as React$1 from "react";
2
+ import { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatContainer as ChatContainer$1, ChatContainerProps as ChatContainerProps$1, ChatMessage as ChatMessage$1, ChatMessageProps, MessageList, MessageListProps, MessageRole, MessageRole as MessageRole$1, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps } from "@tangle-network/ui/chat";
3
+ import { HarnessType, ReasoningEffort, modelProvider, snapHarnessToModel } from "@tangle-network/agent-interface";
4
+ import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
5
+ //#region src/chat/reasoning-level-picker.d.ts
6
+ /**
7
+ * A reasoning selection: `auto` is a UI-only sentinel ("let the harness/model default decide",
8
+ * sends no explicit override); every other value is the canonical `ReasoningEffort` from
9
+ * `@tangle-network/agent-interface` (the single source of truth — `none` … `ultracode`). The picker
10
+ * shows only the levels the chosen harness/model supports — see `reasoningEffortsFor` + the
11
+ * `available` prop — so unsupported levels (such as Kimi's mid-range) never appear rather than being
12
+ * silently degraded.
13
+ */
14
+ type ReasoningLevel = "auto" | ReasoningEffort;
15
+ interface ReasoningLevelOption {
16
+ value: ReasoningLevel;
17
+ label: string;
18
+ description: string;
19
+ }
20
+ interface ReasoningLevelPickerProps {
21
+ value: ReasoningLevel;
22
+ onChange: (value: ReasoningLevel) => void;
23
+ disabled?: boolean;
24
+ className?: string;
25
+ triggerClassName?: string;
26
+ options?: ReadonlyArray<ReasoningLevelOption>;
27
+ /**
28
+ * Capability filter — the reasoning efforts the currently-selected harness/model supports, from
29
+ * `reasoningEffortsFor(harness, model)`. When provided, the picker shows ONLY these (plus the
30
+ * `auto` sentinel), so a harness never offers a level it cannot express.
31
+ * Omit to show every option.
32
+ */
33
+ available?: ReadonlyArray<ReasoningEffort>;
34
+ /** Side the menu opens toward. Defaults to Radix's "bottom". */
35
+ side?: DropdownMenu.DropdownMenuContentProps["side"];
36
+ /**
37
+ * Let Radix flip the menu to the opposite side when it would overflow the
38
+ * viewport. Defaults to `true` (Radix default). Pass `false` to pin the menu
39
+ * to `side` — e.g. a composer floating in open space that should always open
40
+ * downward rather than flipping up over the heading.
41
+ */
42
+ avoidCollisions?: boolean;
43
+ }
44
+ declare const DEFAULT_REASONING_LEVEL_OPTIONS: ReadonlyArray<ReasoningLevelOption>;
45
+ /**
46
+ * Per-harness option overrides for harnesses whose real control isn't a depth scale, so the generic
47
+ * ladder's labels would mislead. A harness with no entry uses {@link DEFAULT_REASONING_LEVEL_OPTIONS};
48
+ * either way the picker still intersects the chosen options with the harness/model `available` set, so
49
+ * only supported values render.
50
+ *
51
+ * `kimi-code` is a BINARY thinking toggle, not a gradient: its `--thinking` flag is simply off or on.
52
+ * `none` emits `--no-thinking` (off) and `high` maps to thinking-on, so the
53
+ * menu reads Auto / No thinking / Thinking rather than a misleading five-step scale.
54
+ */
55
+ declare const HARNESS_REASONING_OPTIONS: Partial<Record<HarnessType, ReadonlyArray<ReasoningLevelOption>>>;
56
+ declare function ReasoningLevelPicker({ value, onChange, disabled, className, triggerClassName, options, available, side, avoidCollisions }: ReasoningLevelPickerProps): React$1.JSX.Element;
57
+ //#endregion
58
+ //#region src/chat/agent-profile-picker.d.ts
59
+ /**
60
+ * An agent profile: a named bundle of toolset + persona layered over the same
61
+ * model and session. `builtin` profiles are the product's shipped modes (e.g.
62
+ * Studio / Assistant); the rest are user-saved custom agents. The concept is
63
+ * backend-agnostic — it applies to a router-backed agent and a sandbox-backed
64
+ * one alike, which is why it lives beside the model control rather than under
65
+ * the harness.
66
+ */
67
+ interface AgentProfileOption {
68
+ id: string;
69
+ name: string;
70
+ /** Builtin: a one-line description. Custom: derived "N tools" if omitted. */
71
+ description?: string;
72
+ /** Capability/tool-group ids this profile enables. */
73
+ capabilities?: ReadonlyArray<string>;
74
+ /** Persona / extra system instructions. */
75
+ instructions?: string;
76
+ /** A shipped mode vs a user-saved custom agent. */
77
+ builtin?: boolean;
78
+ }
79
+ /** A selectable tool group offered by the create/edit form. */
80
+ interface AgentProfileCapability {
81
+ id: string;
82
+ label: string;
83
+ description?: string;
84
+ }
85
+ /** The editable shape the create/edit form emits. */
86
+ interface AgentProfileDraft {
87
+ id?: string;
88
+ name: string;
89
+ capabilities: string[];
90
+ instructions: string;
91
+ }
92
+ interface AgentProfilePickerProps {
93
+ /** Selected profile id. */
94
+ value: string;
95
+ onChange: (id: string) => void;
96
+ profiles: ReadonlyArray<AgentProfileOption>;
97
+ /**
98
+ * Tool catalog for the create/edit form. Provide together with at least one
99
+ * write callback to enable authoring custom agents; omit for a
100
+ * selection-only picker (the New / edit / delete affordances stay hidden).
101
+ */
102
+ capabilities?: ReadonlyArray<AgentProfileCapability>;
103
+ onCreate?: (draft: AgentProfileDraft) => void | Promise<void>;
104
+ onUpdate?: (id: string, draft: AgentProfileDraft) => void | Promise<void>;
105
+ onDelete?: (id: string) => void | Promise<void>;
106
+ disabled?: boolean;
107
+ /** Keep the pinned profile visible while preventing profile selection. */
108
+ locked?: boolean;
109
+ /** Tooltip shown on the locked trigger when no `onNewChat` is provided. */
110
+ lockReason?: string;
111
+ /** Offer a fresh chat from the informative lock popover. */
112
+ onNewChat?: () => void;
113
+ className?: string;
114
+ /** Additional classes for the picker trigger. */
115
+ triggerClassName?: string;
116
+ /** Additional classes for the profile popover. */
117
+ popoverClassName?: string;
118
+ /** Side the menu opens toward. Defaults to up (composer-anchored). */
119
+ side?: "top" | "bottom";
120
+ }
121
+ /**
122
+ * Agent / mode switcher styled to match the chat control strip's pills
123
+ * (harness, model, effort). The pill shows the active profile; the menu lists
124
+ * builtin modes and saved custom agents. When a capability catalog and a write
125
+ * callback are supplied it also authors agents inline (name + tool toggles +
126
+ * persona) — a self-contained click-outside popover rather than a Radix menu,
127
+ * because the inline form needs its own focus and typing without the menu
128
+ * stealing keystrokes.
129
+ */
130
+ declare function AgentProfilePicker({ value, onChange, profiles, capabilities, onCreate, onUpdate, onDelete, disabled, locked, lockReason, onNewChat, className, triggerClassName, popoverClassName, side }: AgentProfilePickerProps): React$1.JSX.Element;
131
+ //#endregion
132
+ //#region src/chat/artifact-agent-dock.d.ts
133
+ type ArtifactKind = string;
134
+ interface ArtifactScope {
135
+ kind: ArtifactKind;
136
+ key: string;
137
+ /** Short label shown in the dock header. Defaults to a generated one from kind/key. */
138
+ label?: string;
139
+ }
140
+ interface ArtifactDockMessage {
141
+ id: string;
142
+ role: MessageRole;
143
+ content: string;
144
+ createdAt?: Date;
145
+ }
146
+ type ArtifactDockStreamEvent = {
147
+ type: "delta";
148
+ text: string;
149
+ } | {
150
+ type: "error";
151
+ message: string;
152
+ };
153
+ /**
154
+ * Consumer-supplied adapter. Keeps the dock decoupled from any specific app's
155
+ * API surface — every consumer wires its own thread-ensure, message-load, and
156
+ * NDJSON stream-send.
157
+ */
158
+ interface ArtifactAgentDockTransport {
159
+ /** Get-or-create the canonical thread for this scope. */
160
+ ensureThread(scope: ArtifactScope): Promise<{
161
+ id: string;
162
+ }>;
163
+ /** Load prior messages, in chronological order. Optional — returns []. */
164
+ loadMessages?(threadId: string): Promise<ArtifactDockMessage[]>;
165
+ /** Stream a user turn. Yield delta events; the dock concatenates them. */
166
+ sendStream(args: {
167
+ threadId: string;
168
+ content: string;
169
+ signal: AbortSignal;
170
+ }): AsyncIterable<ArtifactDockStreamEvent>;
171
+ /** Stop the server-side run for a thread. Optional — when present, the dock
172
+ * calls it on cancel/scope-switch BEFORE aborting the local fetch, so the
173
+ * agent run is actually stopped (not orphaned, still billing) rather than
174
+ * the client merely closing its reader. */
175
+ cancel?(args: {
176
+ threadId: string;
177
+ }): Promise<void> | void;
178
+ }
179
+ interface ArtifactAgentDockProps {
180
+ scope: ArtifactScope;
181
+ open: boolean;
182
+ onOpenChange: (open: boolean) => void;
183
+ transport: ArtifactAgentDockTransport;
184
+ defaultPrompt?: string;
185
+ /** Toast handler for non-fatal errors. Falls back to console.error. */
186
+ onError?: (message: string) => void;
187
+ className?: string;
188
+ }
189
+ /**
190
+ * ArtifactAgentDock — slide-in right-rail chat scoped to a single artifact.
191
+ *
192
+ * Renders a persistent, per-artifact conversation surface that streams via a
193
+ * consumer-supplied transport. Mount alongside any artifact view (file editor,
194
+ * sequence editor, asset preview) to give every artifact its own dedicated
195
+ * agent conversation without forking the chat UI per app.
196
+ *
197
+ * Behavior:
198
+ * - On open, calls `transport.ensureThread(scope)` to get the canonical thread
199
+ * id and `transport.loadMessages(threadId)` to populate prior turns.
200
+ * - On submit, calls `transport.sendStream(...)` and concatenates delta events
201
+ * into a single streaming assistant message; renders inline.
202
+ * - Composer: Enter sends, Shift+Enter newline, Cancel during stream supported.
203
+ * - Accessibility: scope `aria-label` on the panel, `aria-pressed` is the
204
+ * consumer's job on whatever button toggles `open`.
205
+ */
206
+ declare function ArtifactAgentDock({ scope, open, onOpenChange, transport, defaultPrompt, onError, className }: ArtifactAgentDockProps): React$1.JSX.Element | null;
207
+ /**
208
+ * Build a transport that hits the Tangle product convention: POST
209
+ * /api/threads with body.scope = ArtifactScope to ensure the canonical
210
+ * thread; GET /api/threads/:id/messages to load history; POST /api/chat
211
+ * with body = {workspaceId, threadId, content} and an NDJSON event stream
212
+ * to send. Most consumers can use this as-is; advanced ones can supply
213
+ * their own transport object.
214
+ *
215
+ * The expected NDJSON event shape:
216
+ * { type: "message.part.updated", data: { delta: string, part?: {type} } } // assistant chunk
217
+ * { type: "error", data: { message: string, ... } } // surface error
218
+ *
219
+ * Other event types are ignored — consumers that need tool-call rendering
220
+ * or other event semantics should ship a richer transport.
221
+ */
222
+ declare function createFetchTransport(opts: {
223
+ workspaceId: string;
224
+ threadsUrl?: string;
225
+ chatUrl?: string;
226
+ /** Optional fetch override (auth headers, baseURL, etc.). */
227
+ fetchImpl?: typeof fetch;
228
+ }): ArtifactAgentDockTransport;
229
+ //#endregion
230
+ export { modelProvider as A, ReasoningLevelOption as B, ArtifactAgentDockProps as C, ArtifactKind as D, ArtifactDockStreamEvent as E, AgentProfilePicker as F, ReasoningLevelPickerProps as H, AgentProfilePickerProps as I, DEFAULT_REASONING_LEVEL_OPTIONS as L, AgentProfileCapability as M, AgentProfileDraft as N, ArtifactScope as O, AgentProfileOption as P, HARNESS_REASONING_OPTIONS as R, ArtifactAgentDock as S, ArtifactDockMessage as T, ReasoningLevelPicker as V, MessageRole$1 as _, AgentTimelineMessageItem as a, UserMessage as b, AgentTimelineTone as c, ChatContainer$1 as d, ChatContainerProps$1 as f, MessageListProps as g, MessageList as h, AgentTimelineItem as i, snapHarnessToModel as j, createFetchTransport as k, AgentTimelineToolGroupItem as l, ChatMessageProps as m, AgentTimelineArtifactItem as n, AgentTimelineProps as o, ChatMessage$1 as p, AgentTimelineCustomItem as r, AgentTimelineStatusItem as s, AgentTimeline as t, AgentTimelineToolItem as u, ThinkingIndicator as v, ArtifactAgentDockTransport as w, UserMessageProps as x, ThinkingIndicatorProps as y, ReasoningLevel as z };
@@ -0,0 +1,30 @@
1
+ import { ButtonProps } from "@tangle-network/ui/primitives";
2
+ import * as React$1 from "react";
3
+ import { AuthHeader, AuthHeaderProps, GitHubLoginButton, GitHubLoginButtonProps, LoginLayout, LoginLayoutProps, SessionUser, UserMenu, UserMenuProps } from "@tangle-network/ui/auth";
4
+ //#region src/auth/tangle-login-button.d.ts
5
+ interface TangleLoginButtonProps extends Omit<ButtonProps, "onClick"> {
6
+ /**
7
+ * Consumer-app endpoint that starts the cross-site SSO flow. The
8
+ * consumer's server is expected to redirect this request to the
9
+ * platform's `/cross-site/authorize` URL (built via
10
+ * `PlatformAuthClient.authorizeUrl` from
11
+ * `@tangle-network/agent-runtime/platform`). Defaults to
12
+ * `/auth/tangle`.
13
+ */
14
+ authUrl?: string;
15
+ /** Product variant for styling. */
16
+ variant?: "sandbox" | "default" | "outline";
17
+ }
18
+ /**
19
+ * "Login with Tangle" button — kicks off the cross-site SSO bridge.
20
+ * Server-side, the consumer app should:
21
+ * 1. Generate a `state` for CSRF.
22
+ * 2. Persist `state` in a session cookie or signed JWT.
23
+ * 3. 302-redirect to `PlatformAuthClient.authorizeUrl({ state, redirectUri })`.
24
+ *
25
+ * This component itself only triggers the redirect to `authUrl`; the
26
+ * server owns the platform URL construction.
27
+ */
28
+ declare function TangleLoginButton({ authUrl, variant, className, children, ...props }: TangleLoginButtonProps): React$1.JSX.Element;
29
+ //#endregion
30
+ export { LoginLayout as a, UserMenu as c, TangleLoginButtonProps as d, GitHubLoginButtonProps as i, UserMenuProps as l, AuthHeaderProps as n, LoginLayoutProps as o, GitHubLoginButton as r, SessionUser as s, AuthHeader as t, TangleLoginButton as u };
@@ -0,0 +1,330 @@
1
+ import { v as ExposedPort } from "./index-DPePq7c8.js";
2
+ import { _ as RichFileTreeGitStatus, g as RichFileTreeGitEntry } from "./index-CXX5IpH2.js";
3
+ import * as React$1 from "react";
4
+ import { CSSProperties } from "react";
5
+ //#region src/workbench/types.d.ts
6
+ /** Which surface the artifact pane is currently showing. */
7
+ type ArtifactView = "code" | "diff" | "preview" | "ports" | "terminal";
8
+ /**
9
+ * A single artifact rendered by the pane. `content` is the working copy;
10
+ * when `baselineContent` differs from it, the Diff view becomes available
11
+ * and renders a word-level unified diff of baseline → content.
12
+ */
13
+ interface SandboxArtifact {
14
+ id: string;
15
+ /** Canonical path inside the sandbox, e.g. `src/lib/retry.ts`. */
16
+ path: string;
17
+ /** Display name for the active file (usually the last path segment). */
18
+ filename: string;
19
+ /** Working-copy contents of the file. */
20
+ content: string;
21
+ /** Prior contents the working copy is diffed against. */
22
+ baselineContent?: string;
23
+ /** Explicit syntax language id (overrides extension inference). */
24
+ language?: string;
25
+ mimeType?: string;
26
+ }
27
+ /**
28
+ * Live PTY terminal binding. Maps straight onto `TerminalView` — both
29
+ * `apiUrl` and `token` are required to open a session against the sidecar.
30
+ */
31
+ interface SandboxArtifactTerminal {
32
+ apiUrl: string;
33
+ token: string;
34
+ /** Stable id so the same PTY is restored across remounts. */
35
+ connectionId?: string;
36
+ title?: string;
37
+ subtitle?: string;
38
+ }
39
+ interface SandboxArtifactPaneProps {
40
+ /** The active artifact shown in the Code / Diff surfaces. */
41
+ artifact: SandboxArtifact;
42
+ /**
43
+ * Flat list of canonical paths for the file-tree rail in the Code view.
44
+ * Defaults to `[artifact.path]` when omitted (single-file tree).
45
+ */
46
+ paths?: ReadonlyArray<string>;
47
+ /** Per-path git-status decorations for the file tree. */
48
+ gitStatus?: ReadonlyArray<RichFileTreeGitEntry>;
49
+ /** Show the Code view's file-tree rail. Off for single-file embeds where the host owns navigation/tabs. */
50
+ showTree?: boolean;
51
+ /** Exposed ports; presence enables the Ports tab. */
52
+ ports?: ExposedPort[];
53
+ /** Live preview origin; presence enables the Preview tab. */
54
+ previewUrl?: string;
55
+ /** Live terminal binding; presence enables the Terminal tab. */
56
+ terminal?: SandboxArtifactTerminal;
57
+ /** Controlled active view. Pair with `onViewChange`. */
58
+ activeView?: ArtifactView;
59
+ /** Initial view when uncontrolled. Defaults to the first available view. */
60
+ defaultView?: ArtifactView;
61
+ onViewChange?: (view: ArtifactView) => void;
62
+ /** Fired when a different file is chosen in the tree (host swaps artifact). */
63
+ onFileSelect?: (path: string) => void;
64
+ /** Forwarded to the Ports view. */
65
+ onExposePort?: (port: number) => void;
66
+ onRemovePort?: (port: number) => void;
67
+ className?: string;
68
+ style?: CSSProperties;
69
+ }
70
+ /**
71
+ * One entry of the sandbox's git working tree, as the Changes pane lists it.
72
+ * `additions` / `deletions` are the numstat counts the sidecar's
73
+ * `GET /git/diff` reports per file.
74
+ *
75
+ * `baseline` / `current` are the file contents the diff is drawn from and are
76
+ * absent until the consumer resolves them for the selected file. Which of the
77
+ * two counts as "resolved" follows the status: an added or untracked file has
78
+ * no baseline and diffs against the empty string once `current` is present; a
79
+ * deleted file has no working copy and diffs against the empty string once
80
+ * `baseline` is present; every other status waits for both.
81
+ */
82
+ interface ChangedFile {
83
+ path: string;
84
+ status: RichFileTreeGitStatus;
85
+ additions: number;
86
+ deletions: number;
87
+ /** Present once the consumer has resolved contents for the selected file. */
88
+ baseline?: string;
89
+ current?: string;
90
+ /**
91
+ * Why the sides could not be resolved. Shown under the file's header in
92
+ * place of the loading line, so a failed read never looks like a slow one.
93
+ */
94
+ loadError?: string;
95
+ }
96
+ interface ChangesPaneProps {
97
+ /** Current branch; `null` when the tree has no commits yet or is not a repository. */
98
+ branch: string | null;
99
+ ahead?: number;
100
+ behind?: number;
101
+ files: ChangedFile[];
102
+ selectedPath?: string;
103
+ onSelectFile?: (path: string) => void;
104
+ loading?: boolean;
105
+ error?: string | null;
106
+ onRefresh?: () => void;
107
+ /** Stage everything and commit. Resolve on success; reject with an Error the pane shows inline. */
108
+ onCommit?: (message: string) => Promise<void>;
109
+ onPush?: () => Promise<void>;
110
+ /** Which action is in flight; the pane disables the other and shows a spinner on this one. */
111
+ busy?: "commit" | "push" | null;
112
+ /** Open the file as a workbench artifact (the product wires this to its artifact opener). */
113
+ onOpenFile?: (path: string) => void;
114
+ className?: string;
115
+ }
116
+ //#endregion
117
+ //#region src/workbench/sandbox-artifact-pane.d.ts
118
+ /**
119
+ * Blueprint-grade artifact workbench. Composes the sandbox-ui substrate
120
+ * (`RichFileTree`, `PortsList`, `TerminalView`, `@pierre/diffs`) behind a
121
+ * single pill-tab view switcher: Code · Diff · Preview · Ports · Terminal.
122
+ * Tabs appear only when their data is present (Diff requires a differing
123
+ * baseline; Preview a url; Ports a port list; Terminal a live binding), so the
124
+ * chrome never shows a dead surface.
125
+ */
126
+ declare function SandboxArtifactPane({ artifact, paths, gitStatus, showTree, ports, previewUrl, terminal, activeView, defaultView, onViewChange, onFileSelect, onExposePort, onRemovePort, className, style }: SandboxArtifactPaneProps): React$1.JSX.Element;
127
+ //#endregion
128
+ //#region src/workbench/changes-pane.d.ts
129
+ /**
130
+ * The sandbox's git working tree as a review surface: every changed file with
131
+ * its line counts, the selected file's word-level diff beneath, and a commit
132
+ * box in the footer. Data in, callbacks out — the pane never fetches; the
133
+ * consumer feeds it the sidecar's `/git/status` + `/git/diff` and resolves
134
+ * `baseline` / `current` for the file it is told was selected.
135
+ *
136
+ * The list is capped at 40% of the pane and scrolls, so the diff keeps its
137
+ * room however many files changed. The row's own chrome is compact: the
138
+ * workspace shell already gives its right pane the 56px `WorkspacePaneHeader`,
139
+ * so this header nests beneath it at `PanelHeader` rhythm rather than adding a
140
+ * second tall bar.
141
+ */
142
+ declare function ChangesPane({ branch, ahead, behind, files, selectedPath, onSelectFile, loading, error, onRefresh, onCommit, onPush, busy, onOpenFile, className }: ChangesPaneProps): React$1.JSX.Element;
143
+ //#endregion
144
+ //#region src/workbench/pill-tabs.d.ts
145
+ interface PillTabItem<T extends string> {
146
+ value: T;
147
+ label: string;
148
+ icon?: React$1.ReactNode;
149
+ }
150
+ interface PillTabsProps<T extends string> {
151
+ items: ReadonlyArray<PillTabItem<T>>;
152
+ value: T;
153
+ onChange: (value: T) => void;
154
+ className?: string;
155
+ "aria-label"?: string;
156
+ /** Stable IDs supplied by the parent when it renders the associated panel. */
157
+ idPrefix?: string;
158
+ panelId?: string;
159
+ }
160
+ /**
161
+ * Sliding-pill segmented control. Reimplemented from blueprint-agent's
162
+ * framer-motion `PillTabs` with a measured CSS transform instead — no motion
163
+ * dependency. A `ResizeObserver` re-measures on container resize and font
164
+ * load so the indicator tracks the active tab exactly. Token-swapped onto the
165
+ * sandbox-ui surface ladder.
166
+ */
167
+ declare function PillTabs<T extends string>({ items, value, onChange, className, "aria-label": ariaLabel, idPrefix, panelId }: PillTabsProps<T>): React$1.JSX.Element;
168
+ //#endregion
169
+ //#region src/workbench/diff-utils.d.ts
170
+ interface DiffStats {
171
+ added: number;
172
+ removed: number;
173
+ }
174
+ /**
175
+ * Count added / removed lines between two file revisions.
176
+ *
177
+ * Ported from blueprint-agent's `computeDiffStats`: normalize CRLF, short-
178
+ * circuit on equality, then `diffLines` with `ignoreWhitespace` so pure
179
+ * reindentation does not inflate the counts. `newlineIsToken:false` keeps a
180
+ * line (not its trailing newline) as the unit, matching the +/- a reader
181
+ * counts by eye.
182
+ */
183
+ declare function computeDiffStats(original: string, current: string): DiffStats;
184
+ /**
185
+ * Build a single-file unified patch (baseline → current) for `@pierre/diffs`'
186
+ * `PatchDiff`. `context: Infinity` would print the whole file; the default
187
+ * 4-line context keeps hunks compact while preserving locality. Equal inputs
188
+ * yield an empty string so callers can treat "" as "no diff".
189
+ */
190
+ declare function buildUnifiedPatch(filename: string, baseline: string, current: string): string;
191
+ //#endregion
192
+ //#region src/workbench/panel-header.d.ts
193
+ declare function GitStatusBadge({ status }: {
194
+ status: RichFileTreeGitStatus;
195
+ }): React$1.JSX.Element;
196
+ /** `+added −removed` line counts in mono; the same pair the Changes list prints per file. */
197
+ declare function DiffStatsBadge({ stats, className }: {
198
+ stats: DiffStats;
199
+ className?: string;
200
+ }): React$1.JSX.Element;
201
+ interface PanelHeaderProps {
202
+ filename: string;
203
+ gitStatus?: RichFileTreeGitStatus;
204
+ /** Added/removed line counts; rendered only when provided (Diff view). */
205
+ stats?: DiffStats;
206
+ /** Enables the copy-to-clipboard action when set. */
207
+ copyText?: string;
208
+ /** Extra content rendered at the right edge, before the copy button. */
209
+ children?: React$1.ReactNode;
210
+ className?: string;
211
+ }
212
+ /**
213
+ * Thin bordered chrome bar above the artifact body — filename, git-status
214
+ * badge, optional diff counts, and a copy action. Ported in spirit from
215
+ * blueprint-agent's `PanelHeader` (min-h, hairline bottom border, dense
216
+ * horizontal rhythm), retoned to the sandbox-ui surface ladder.
217
+ */
218
+ declare function PanelHeader({ filename, gitStatus, stats, copyText, children, className }: PanelHeaderProps): React$1.JSX.Element;
219
+ //#endregion
220
+ //#region src/workbench/file-breadcrumb.d.ts
221
+ interface FileBreadcrumbProps {
222
+ /** Canonical path, e.g. `src/lib/retry.ts`. */
223
+ path: string;
224
+ className?: string;
225
+ }
226
+ /**
227
+ * Slim path breadcrumb for the code panel. Reimplemented (not ported) from
228
+ * blueprint-agent's `FileBreadcrumb` — that one nests a `FileTree` dropdown per
229
+ * segment and couples to the workbench store + framer-motion. Here the rail
230
+ * already owns navigation, so this is a read-only trail: caret-separated parent
231
+ * segments with a file-icon leaf.
232
+ */
233
+ declare function FileBreadcrumb({ path, className }: FileBreadcrumbProps): React$1.JSX.Element;
234
+ //#endregion
235
+ //#region src/workbench/code-view.d.ts
236
+ interface CodeViewProps {
237
+ path: string;
238
+ filename: string;
239
+ content: string;
240
+ language?: string;
241
+ /** Flat list of paths for the rail; defaults to `[path]`. */
242
+ paths?: ReadonlyArray<string>;
243
+ gitStatus?: ReadonlyArray<RichFileTreeGitEntry>;
244
+ onFileSelect?: (path: string) => void;
245
+ /** Show the file-tree rail. Off for single-file embeds where the host owns navigation. */
246
+ showTree?: boolean;
247
+ className?: string;
248
+ }
249
+ /**
250
+ * Code surface: a fixed-width `RichFileTree` rail (with git-status
251
+ * decorations) beside a breadcrumb-topped, syntax-highlighted read-only file
252
+ * view. The rail owns navigation; selecting a path fans out to `onFileSelect`
253
+ * so the host can swap the active artifact.
254
+ */
255
+ declare function CodeView({ path, filename, content, language, paths, gitStatus, onFileSelect, showTree, className }: CodeViewProps): React$1.JSX.Element;
256
+ //#endregion
257
+ //#region src/workbench/diff-view.d.ts
258
+ interface DiffViewProps {
259
+ filename: string;
260
+ baseline: string;
261
+ current: string;
262
+ /** Hide when the surrounding PanelHeader already identifies the file. */
263
+ showFileHeader?: boolean;
264
+ /** Start wrapped so narrow review panes never conceal the end of a line. */
265
+ defaultWrap?: boolean;
266
+ className?: string;
267
+ }
268
+ /**
269
+ * Keep the maintained renderer for hunking, word diffs and highlighting. A new
270
+ * custom element per effect survives StrictMode remounts without hydrating stale
271
+ * shadow content. Wrapping is a renderer option, not a CSS patch into its shadow
272
+ * root; the plain patch disclosure is the accessible, engine-independent view.
273
+ */
274
+ declare function DiffView({ filename, baseline, current, showFileHeader, defaultWrap, className }: DiffViewProps): React$1.JSX.Element;
275
+ //#endregion
276
+ //#region src/workbench/preview-policy.d.ts
277
+ type PreviewReadiness = {
278
+ state: "unknown";
279
+ } | {
280
+ state: "checking";
281
+ } | {
282
+ state: "ready";
283
+ checkedAt: string;
284
+ statusCode: number;
285
+ } | {
286
+ state: "failed";
287
+ checkedAt: string;
288
+ message: string;
289
+ };
290
+ type PreviewAccess = {
291
+ state: "unknown";
292
+ } | {
293
+ state: "public" | "authenticated";
294
+ source: "enforced-policy";
295
+ expiresAt?: string;
296
+ };
297
+ //#endregion
298
+ //#region src/workbench/preview-view.d.ts
299
+ interface PreviewViewProps {
300
+ /** A product-authorized preview URL. Relative navigation stays on its origin. */
301
+ url: string;
302
+ allowedOrigins?: readonly string[];
303
+ /** Supply only metadata obtained from the enforcing service, never a UI guess. */
304
+ access?: PreviewAccess;
305
+ readiness?: PreviewReadiness;
306
+ onCheckReadiness?: () => void;
307
+ onNavigate?: (url: string) => void;
308
+ className?: string;
309
+ }
310
+ declare function PreviewView({ url, allowedOrigins, access, readiness, onCheckReadiness, onNavigate, className }: PreviewViewProps): React$1.JSX.Element;
311
+ //#endregion
312
+ //#region src/workbench/syntax.d.ts
313
+ /** Resolve a Prism language id from an explicit hint or the filename. */
314
+ declare function resolveLanguage(filename: string, explicit?: string): string;
315
+ declare const BRAND_PRISM_THEME: Record<string, CSSProperties>;
316
+ interface CodeSurfaceProps {
317
+ code: string;
318
+ filename: string;
319
+ language?: string;
320
+ showLineNumbers?: boolean;
321
+ className?: string;
322
+ }
323
+ /**
324
+ * Read-only, brand-themed code renderer. Wrapped in a scroll container so the
325
+ * highlighter itself never grows the layout; line numbers sit in a muted,
326
+ * tabular column.
327
+ */
328
+ declare function CodeSurface({ code, filename, language, showLineNumbers, className }: CodeSurfaceProps): React$1.JSX.Element;
329
+ //#endregion
330
+ export { SandboxArtifactTerminal as A, ChangesPane as C, ChangesPaneProps as D, ChangedFile as E, SandboxArtifact as O, PillTabsProps as S, ArtifactView as T, DiffStats as _, PreviewView as a, PillTabItem as b, DiffViewProps as c, FileBreadcrumb as d, FileBreadcrumbProps as f, PanelHeaderProps as g, PanelHeader as h, resolveLanguage as i, SandboxArtifactPaneProps as k, CodeView as l, GitStatusBadge as m, CodeSurface as n, PreviewViewProps as o, DiffStatsBadge as p, CodeSurfaceProps as r, DiffView as s, BRAND_PRISM_THEME as t, CodeViewProps as u, buildUnifiedPatch as v, SandboxArtifactPane as w, PillTabs as x, computeDiffStats as y };