@tangle-network/sandbox-ui 0.100.1 → 0.101.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.
package/dist/chat.d.ts CHANGED
@@ -145,6 +145,14 @@ interface ComposerFile {
145
145
  /** Shown on the chip when `status === "error"`. */
146
146
  errorMessage?: string;
147
147
  }
148
+ /** Context the agent will see alongside the next message. */
149
+ interface ComposerContextItem {
150
+ id: string;
151
+ label: string;
152
+ icon?: React.ReactNode;
153
+ /** Omit to render a non-removable chip. */
154
+ onRemove?: () => void;
155
+ }
148
156
  interface AgentComposerProps {
149
157
  /** Composer text (controlled). */
150
158
  value: string;
@@ -171,6 +179,8 @@ interface AgentComposerProps {
171
179
  controls: React.ReactNode;
172
180
  /** Extra content left of the send button (token meter, cost, status). */
173
181
  trailing?: React.ReactNode;
182
+ /** Context the agent will see alongside the next message. */
183
+ contextItems?: ReadonlyArray<ComposerContextItem>;
174
184
  /**
175
185
  * Attachments are opt-in: pass `onAttach` to show the attach button, accept
176
186
  * drag-and-drop onto the composer, and render `attachments` as chips.
@@ -246,7 +256,7 @@ interface AgentComposerProps {
246
256
  * generic clipboard image blobs `pasted-image-<n>.<ext>`), a streaming Stop
247
257
  * button (`busy` + `onCancel`), and a Cmd/Ctrl+L focus shortcut.
248
258
  */
249
- declare function AgentComposer({ value, onChange, onSubmit, placeholder, disabled, busy, onCancel, controls, trailing, onAttach, onAttachFolder, attachments, onRemoveFile, onRetryFile, accept, onRejectFiles, dropTitle, dropDescription, canSubmitWhileBusy, canSubmitAttachmentsOnly, mention, focusShortcut, minRows, maxHeight, className, sendLabel, autoFocus, }: AgentComposerProps): React.JSX.Element;
259
+ declare function AgentComposer({ value, onChange, onSubmit, placeholder, disabled, busy, onCancel, controls, trailing, contextItems, onAttach, onAttachFolder, attachments, onRemoveFile, onRetryFile, accept, onRejectFiles, dropTitle, dropDescription, canSubmitWhileBusy, canSubmitAttachmentsOnly, mention, focusShortcut, minRows, maxHeight, className, sendLabel, autoFocus, }: AgentComposerProps): React.JSX.Element;
250
260
 
251
261
  /**
252
262
  * Visual contract for a rendered mention pill. The TipTap editor extension in
@@ -429,4 +439,4 @@ declare function createFetchTransport(opts: {
429
439
  fetchImpl?: typeof fetch;
430
440
  }): ArtifactAgentDockTransport;
431
441
 
432
- export { AgentComposer, type AgentComposerMention, type AgentComposerProps, type AgentProfileCapability, type AgentProfileDraft, type AgentProfileOption, AgentProfilePicker, type AgentProfilePickerProps, ArtifactAgentDock, type ArtifactAgentDockProps, type ArtifactAgentDockTransport, type ArtifactDockMessage, type ArtifactDockStreamEvent, type ArtifactKind, type ArtifactScope, type ComposerFile, type ComposerFileRejection, type ComposerFileValidationConfig, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MENTION_PILL_CLASS, type MentionItem, type ReasoningLevel, type ReasoningLevelOption, ReasoningLevelPicker, type ReasoningLevelPickerProps, createFetchTransport, isAcceptedType, validateComposerFiles };
442
+ export { AgentComposer, type AgentComposerMention, type AgentComposerProps, type AgentProfileCapability, type AgentProfileDraft, type AgentProfileOption, AgentProfilePicker, type AgentProfilePickerProps, ArtifactAgentDock, type ArtifactAgentDockProps, type ArtifactAgentDockTransport, type ArtifactDockMessage, type ArtifactDockStreamEvent, type ArtifactKind, type ArtifactScope, type ComposerContextItem, type ComposerFile, type ComposerFileRejection, type ComposerFileValidationConfig, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MENTION_PILL_CLASS, type MentionItem, type ReasoningLevel, type ReasoningLevelOption, ReasoningLevelPicker, type ReasoningLevelPickerProps, createFetchTransport, isAcceptedType, validateComposerFiles };
package/dist/chat.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  modelProvider,
17
17
  snapHarnessToModel,
18
18
  validateComposerFiles
19
- } from "./chunk-IWTLWBPZ.js";
19
+ } from "./chunk-XIXYQNXD.js";
20
20
  import "./chunk-TK46XFLM.js";
21
21
  import {
22
22
  MENTION_PILL_CLASS
@@ -240,6 +240,7 @@ function AgentComposer({
240
240
  onCancel,
241
241
  controls,
242
242
  trailing,
243
+ contextItems = [],
243
244
  onAttach,
244
245
  onAttachFolder,
245
246
  attachments = [],
@@ -388,6 +389,34 @@ function AgentComposer({
388
389
  disabled && "opacity-60"
389
390
  ),
390
391
  children: [
392
+ contextItems.length > 0 && /* @__PURE__ */ jsx2(
393
+ "div",
394
+ {
395
+ "aria-label": "Message context",
396
+ className: "flex min-w-0 flex-wrap gap-1.5",
397
+ children: contextItems.map((item) => /* @__PURE__ */ jsxs2(
398
+ "span",
399
+ {
400
+ className: "inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-md border border-primary/30 bg-primary/10 px-2.5 py-1 text-primary text-xs",
401
+ children: [
402
+ item.icon && /* @__PURE__ */ jsx2("span", { className: "shrink-0", "aria-hidden": "true", children: item.icon }),
403
+ /* @__PURE__ */ jsx2("span", { className: "min-w-0 truncate", children: item.label }),
404
+ item.onRemove && /* @__PURE__ */ jsx2(
405
+ "button",
406
+ {
407
+ type: "button",
408
+ "aria-label": `Remove context ${item.label}`,
409
+ onClick: item.onRemove,
410
+ className: "shrink-0 rounded p-0.5 text-primary/70 transition-colors hover:text-primary focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
411
+ children: /* @__PURE__ */ jsx2(X, { className: "size-3" })
412
+ }
413
+ )
414
+ ]
415
+ },
416
+ item.id
417
+ ))
418
+ }
419
+ ),
391
420
  attachments.length > 0 && /* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-1.5", children: [...folderChips, ...fileChips].map((file) => {
392
421
  const isError = file.status === "error";
393
422
  const isPending = file.status === "pending";
package/dist/globals.css CHANGED
@@ -4965,6 +4965,8 @@
4965
4965
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.45);
4966
4966
  --shadow-glow: none;
4967
4967
  --shadow-accent: 0 1px 2px rgba(0, 0, 0, 0.3);
4968
+ --shadow-overlay: 0 2px 6px hsl(var(--hsl-foreground) / 0.1),
4969
+ 0 16px 40px hsl(var(--hsl-foreground) / 0.16);
4968
4970
  --shadow-status-running: none;
4969
4971
  --shadow-status-creating: none;
4970
4972
  --shadow-status-error: none;
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { AgentWorkbench, ApprovalConfidenceStat, ApprovalItem, ApprovalQueue, Ap
5
5
  export { ArtifactView, BRAND_PRISM_THEME, CodeSurface, CodeSurfaceProps, CodeView, CodeViewProps, DiffStats, DiffView, DiffViewProps, FileBreadcrumb, FileBreadcrumbProps, GitStatusBadge, PanelHeader, PanelHeaderProps, PillTabItem, PillTabs, PillTabsProps, PreviewView, PreviewViewProps, SandboxArtifact, SandboxArtifactPane, SandboxArtifactPaneProps, SandboxArtifactTerminal, buildUnifiedPatch, computeDiffStats, resolveLanguage } from './workbench.js';
6
6
  export { OpenUIAction, OpenUIActionsNode, OpenUIArtifactRenderer, OpenUIArtifactRendererProps, OpenUIBadgeNode, OpenUICardNode, OpenUICodeNode, OpenUIComponentNode, OpenUIGridNode, OpenUIHeadingNode, OpenUIKeyValueNode, OpenUIMarkdownNode, OpenUIPrimitive, OpenUISeparatorNode, OpenUIStackNode, OpenUIStatNode, OpenUITableNode, OpenUITextNode } from '@tangle-network/ui/openui';
7
7
  export { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatContainer, ChatContainerProps, ChatMessage, ChatMessageProps, MessageList, MessageListProps, MessageRole, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps } from '@tangle-network/ui/chat';
8
- export { AgentComposer, AgentComposerMention, AgentComposerProps, AgentProfileCapability, AgentProfileDraft, AgentProfileOption, AgentProfilePicker, AgentProfilePickerProps, ArtifactAgentDock, ArtifactAgentDockProps, ArtifactAgentDockTransport, ArtifactDockMessage, ArtifactDockStreamEvent, ArtifactKind, ArtifactScope, ComposerFile, ComposerFileRejection, ComposerFileValidationConfig, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MENTION_PILL_CLASS, MentionItem, ReasoningLevel, ReasoningLevelOption, ReasoningLevelPicker, ReasoningLevelPickerProps, createFetchTransport, isAcceptedType, validateComposerFiles } from './chat.js';
8
+ export { AgentComposer, AgentComposerMention, AgentComposerProps, AgentProfileCapability, AgentProfileDraft, AgentProfileOption, AgentProfilePicker, AgentProfilePickerProps, ArtifactAgentDock, ArtifactAgentDockProps, ArtifactAgentDockTransport, ArtifactDockMessage, ArtifactDockStreamEvent, ArtifactKind, ArtifactScope, ComposerContextItem, ComposerFile, ComposerFileRejection, ComposerFileValidationConfig, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MENTION_PILL_CLASS, MentionItem, ReasoningLevel, ReasoningLevelOption, ReasoningLevelPicker, ReasoningLevelPickerProps, createFetchTransport, isAcceptedType, validateComposerFiles } from './chat.js';
9
9
  export { HarnessType, modelProvider, snapHarnessToModel } from '@tangle-network/agent-interface';
10
10
  export { ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from '@tangle-network/ui/run';
11
11
  export { CommandPreview, DiffPreview, GlobResultsPreview, GrepResultsPreview, QuestionPreview, WebSearchPreview, WriteFilePreview } from '@tangle-network/ui/tool-previews';
package/dist/index.js CHANGED
@@ -88,7 +88,7 @@ import {
88
88
  modelProvider,
89
89
  snapHarnessToModel,
90
90
  validateComposerFiles
91
- } from "./chunk-IWTLWBPZ.js";
91
+ } from "./chunk-XIXYQNXD.js";
92
92
  import {
93
93
  TOOL_CATEGORY_ICONS,
94
94
  cn,
package/dist/styles.css CHANGED
@@ -4965,6 +4965,8 @@
4965
4965
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.45);
4966
4966
  --shadow-glow: none;
4967
4967
  --shadow-accent: 0 1px 2px rgba(0, 0, 0, 0.3);
4968
+ --shadow-overlay: 0 2px 6px hsl(var(--hsl-foreground) / 0.1),
4969
+ 0 16px 40px hsl(var(--hsl-foreground) / 0.16);
4968
4970
  --shadow-status-running: none;
4969
4971
  --shadow-status-creating: none;
4970
4972
  --shadow-status-error: none;
package/dist/tokens.css CHANGED
@@ -319,6 +319,18 @@
319
319
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.45);
320
320
  --shadow-glow: none;
321
321
  --shadow-accent: 0 1px 2px rgba(0, 0, 0, 0.3);
322
+ /* The lift above --shadow-dropdown, for a surface that covers the page
323
+ rather than sitting beside it: a drawer, a modal, a floating dock.
324
+ Two layers — a tight contact shadow plus a wide ambient one.
325
+ Alone among the shadows this is derived from --hsl-foreground instead of
326
+ a fixed rgba, so it INVERTS with the theme. That is what makes it work in
327
+ dark: a black shadow on a dark canvas renders as nothing (see the ladder
328
+ note at the top of this file), while the foreground is near-white there,
329
+ so the same declaration reads as a soft halo. One definition therefore
330
+ serves both themes and the light block does not restate it. */
331
+ --shadow-overlay:
332
+ 0 2px 6px hsl(var(--hsl-foreground) / 0.1),
333
+ 0 16px 40px hsl(var(--hsl-foreground) / 0.16);
322
334
  --shadow-status-running: none;
323
335
  --shadow-status-creating: none;
324
336
  --shadow-status-error: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.100.1",
3
+ "version": "0.101.0",
4
4
  "description": "Unified UI component library for Tangle Sandbox — primitives, chat, dashboard, terminal, editor, and workspace components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -119,7 +119,7 @@
119
119
  "@hocuspocus/provider": ">=2.15.0 <5.0.0",
120
120
  "@nanostores/react": ">=0.8.4 <2.0.0",
121
121
  "@tangle-network/agent-interface": ">=0.36.0 <0.48.0",
122
- "@tangle-network/brand": "^1.4.0",
122
+ "@tangle-network/brand": "^1.5.0",
123
123
  "@tangle-network/ui": "^11.0.0",
124
124
  "@tanstack/react-query": "^5.0.0",
125
125
  "@tiptap/extension-collaboration": ">=3.20.4 <4.0.0",
@@ -191,7 +191,7 @@
191
191
  "@storybook/react-vite": "^10.5.4",
192
192
  "@tailwindcss/postcss": "^4.3.3",
193
193
  "@tangle-network/agent-interface": "0.47.0",
194
- "@tangle-network/brand": "^1.4.0",
194
+ "@tangle-network/brand": "^1.5.0",
195
195
  "@tangle-network/ui": "^11.2.0",
196
196
  "@tanstack/react-query": "^5.101.4",
197
197
  "@testing-library/dom": "^10.4.1",