@tangle-network/sandbox-ui 0.57.0 → 0.58.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
@@ -2,6 +2,7 @@ import { MessageRole } from '@tangle-network/ui/chat';
2
2
  export { AgentTimeline, AgentTimelineArtifactItem, AgentTimelineCustomItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatContainer, ChatContainerProps, ChatInput, ChatInputProps, ChatMessage, ChatMessageProps, MessageList, MessageListProps, MessageRole, PendingFile, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps } from '@tangle-network/ui/chat';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import { ReasoningEffort, HarnessType } from '@tangle-network/agent-interface';
5
+ export { modelProvider, snapHarnessToModel } from '@tangle-network/agent-interface';
5
6
  import * as Popover from '@radix-ui/react-dropdown-menu';
6
7
  import * as React from 'react';
7
8
  import { M as ModelInfo } from './model-picker-COjPVMzg.js';
@@ -141,48 +142,19 @@ interface AgentSessionControlsProps {
141
142
  declare function AgentSessionControls({ harness, model, reasoning, trailing, className, context, layout, menuPlacement, }: AgentSessionControlsProps): react_jsx_runtime.JSX.Element | null;
142
143
 
143
144
  /**
144
- * Harness ↔ model compatibility policy.
145
- *
146
- * Native CLI harnesses are vendor-locked: claude-code only drives
147
- * Anthropic models, codex only OpenAI models. Router-backed harnesses
148
- * (opencode) accept any catalog model. The pickers use this policy to
149
- * keep the pair coherent: changing one side snaps the other to its
150
- * nearest compatible choice instead of letting the user assemble a
151
- * combination that fails at inference time.
152
- */
153
- interface HarnessModelPolicy {
154
- /** Canonical-id provider prefixes the harness can run; null = any. */
155
- providers: ReadonlyArray<string> | null;
156
- /**
157
- * Patterns ranking snap targets, best first. Within one pattern's
158
- * matches the highest version (numeric-aware descending sort) wins,
159
- * so "latest standard frontier" stays correct as catalogs rotate.
160
- */
161
- preferred: ReadonlyArray<RegExp>;
162
- }
163
- declare const HARNESS_MODEL_POLICIES: Partial<Record<HarnessType, HarnessModelPolicy>>;
164
- /** Provider prefix of a canonical id ("anthropic/claude-…" → "anthropic"). */
165
- declare function modelProvider(modelId: string): string | null;
166
- /**
167
- * Ids without a provider prefix (consumer sentinels like "default",
168
- * or an empty selection) are treated as compatible everywhere — they
169
- * mean "the session's own configuration", which every harness honors.
145
+ * Whether `harness` can run `modelId`. Router-backed harnesses, and provider-less
146
+ * sentinel ids (like "default" or an empty selection — "the session's own
147
+ * configuration"), are compatible with everything.
170
148
  */
171
149
  declare function isModelCompatibleWithHarness(harness: HarnessType, modelId: string): boolean;
172
150
  /**
173
- * Keeps `modelId` when the harness can run it; otherwise returns the
174
- * harness's best compatible catalog model (preferred patterns in order,
175
- * highest version within a pattern). When the catalog holds nothing
176
- * compatible the original id is returned unchanged — the caller sees
177
- * the incompatibility instead of a silent wrong substitution.
151
+ * Keeps `modelId` when the harness can run it; otherwise returns the harness's
152
+ * best compatible model from the loaded catalog (preferred patterns in order,
153
+ * highest version within a pattern). Adapts the picker's `ModelInfo[]` to the
154
+ * canonical id list `agent-interface` ranks over; when the catalog holds nothing
155
+ * compatible the original id is returned unchanged.
178
156
  */
179
157
  declare function snapModelToHarness(harness: HarnessType, modelId: string, models: ReadonlyArray<ModelInfo>): string;
180
- /**
181
- * Keeps the harness when it can run `modelId`; otherwise returns the
182
- * model's native harness (anthropic → claude-code, openai → codex),
183
- * falling back to the router-backed opencode for everything else.
184
- */
185
- declare function snapHarnessToModel(harness: HarnessType, modelId: string): HarnessType;
186
158
 
187
159
  type ArtifactKind = string;
188
160
  interface ArtifactScope {
@@ -281,4 +253,4 @@ declare function createFetchTransport(opts: {
281
253
  fetchImpl?: typeof fetch;
282
254
  }): ArtifactAgentDockTransport;
283
255
 
284
- export { AgentSessionControls, type AgentSessionControlsProps, type AgentSessionHarnessControl, type AgentSessionModelControl, type AgentSessionReasoningControl, ArtifactAgentDock, type ArtifactAgentDockProps, type ArtifactAgentDockTransport, type ArtifactDockMessage, type ArtifactDockStreamEvent, type ArtifactKind, type ArtifactScope, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_MODEL_POLICIES, type ReasoningLevel, type ReasoningLevelOption, ReasoningLevelPicker, type ReasoningLevelPickerProps, createFetchTransport, isModelCompatibleWithHarness, modelProvider, snapHarnessToModel, snapModelToHarness };
256
+ export { AgentSessionControls, type AgentSessionControlsProps, type AgentSessionHarnessControl, type AgentSessionModelControl, type AgentSessionReasoningControl, ArtifactAgentDock, type ArtifactAgentDockProps, type ArtifactAgentDockTransport, type ArtifactDockMessage, type ArtifactDockStreamEvent, type ArtifactKind, type ArtifactScope, DEFAULT_REASONING_LEVEL_OPTIONS, type ReasoningLevel, type ReasoningLevelOption, ReasoningLevelPicker, type ReasoningLevelPickerProps, createFetchTransport, isModelCompatibleWithHarness, snapModelToHarness };
package/dist/chat.js CHANGED
@@ -6,7 +6,6 @@ import {
6
6
  ChatInput,
7
7
  ChatMessage,
8
8
  DEFAULT_REASONING_LEVEL_OPTIONS,
9
- HARNESS_MODEL_POLICIES,
10
9
  MessageList,
11
10
  ReasoningLevelPicker,
12
11
  ThinkingIndicator,
@@ -16,7 +15,7 @@ import {
16
15
  modelProvider,
17
16
  snapHarnessToModel,
18
17
  snapModelToHarness
19
- } from "./chunk-NHHYPID3.js";
18
+ } from "./chunk-WLMLD2CZ.js";
20
19
  import "./chunk-HU4B2M4K.js";
21
20
  import "./chunk-SF6LPMMN.js";
22
21
  import "./chunk-EI44GEQ5.js";
@@ -29,7 +28,6 @@ export {
29
28
  ChatInput,
30
29
  ChatMessage,
31
30
  DEFAULT_REASONING_LEVEL_OPTIONS,
32
- HARNESS_MODEL_POLICIES,
33
31
  MessageList,
34
32
  ReasoningLevelPicker,
35
33
  ThinkingIndicator,
@@ -2014,7 +2014,7 @@ function DashboardLayoutInner({
2014
2014
  /* @__PURE__ */ jsx14(
2015
2015
  RailHeader,
2016
2016
  {
2017
- brand: /* @__PURE__ */ jsx14(Logo, { variant, size: "sm", iconOnly: true }),
2017
+ brand: /* @__PURE__ */ jsx14(Logo, { variant, size: "sm", iconOnly: !showLabels }),
2018
2018
  brandHref: logoHref,
2019
2019
  collapsed: !showLabels,
2020
2020
  onToggle: toggleRail,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3J6FG3FJ.js";
4
4
  import {
5
5
  PortsList
6
- } from "./chunk-SVNWL3ZR.js";
6
+ } from "./chunk-D7JJLG4L.js";
7
7
  import {
8
8
  TerminalView
9
9
  } from "./chunk-VIREDUBF.js";
@@ -149,71 +149,16 @@ import * as DropdownMenu2 from "@radix-ui/react-dropdown-menu";
149
149
  import { ChevronDown as ChevronDown2, Lock, SlidersHorizontal } from "lucide-react";
150
150
 
151
151
  // src/chat/harness-model-compat.ts
152
- var HARNESS_MODEL_POLICIES = {
153
- opencode: { providers: null, preferred: [] },
154
- "claude-code": {
155
- providers: ["anthropic"],
156
- preferred: [
157
- /^anthropic\/claude-opus-[\d.-]+$/,
158
- /^anthropic\/claude-sonnet-[\d.-]+$/,
159
- /^anthropic\//
160
- ]
161
- },
162
- codex: {
163
- providers: ["openai"],
164
- // Standard frontier tier first (gpt-N / gpt-N.N), then any gpt
165
- // variant (mini/nano), then anything OpenAI.
166
- preferred: [/^openai\/gpt-\d+(\.\d+)?$/, /^openai\/gpt/, /^openai\//]
167
- },
168
- amp: { providers: null, preferred: [] },
169
- "factory-droids": { providers: null, preferred: [] },
170
- "cli-base": { providers: null, preferred: [] },
171
- "kimi-code": {
172
- providers: ["moonshot"],
173
- preferred: [/^moonshot\//]
174
- },
175
- openclaw: { providers: null, preferred: [] },
176
- nanoclaw: { providers: null, preferred: [] },
177
- hermes: { providers: null, preferred: [] }
178
- };
179
- var PROVIDER_PREFERRED_HARNESS = {
180
- anthropic: "claude-code",
181
- openai: "codex",
182
- moonshot: "kimi-code"
183
- };
184
- function modelProvider(modelId) {
185
- const slash = modelId.indexOf("/");
186
- return slash > 0 ? modelId.slice(0, slash) : null;
187
- }
152
+ import {
153
+ harnessSupportsModel,
154
+ snapModelToHarness as snapModelIdToHarness
155
+ } from "@tangle-network/agent-interface";
156
+ import { modelProvider, snapHarnessToModel } from "@tangle-network/agent-interface";
188
157
  function isModelCompatibleWithHarness(harness, modelId) {
189
- const policy = HARNESS_MODEL_POLICIES[harness];
190
- if (!policy || policy.providers === null) return true;
191
- const provider = modelProvider(modelId);
192
- if (!provider) return true;
193
- return policy.providers.includes(provider);
158
+ return harnessSupportsModel(harness, modelId);
194
159
  }
195
- var numericDesc = new Intl.Collator(void 0, {
196
- numeric: true,
197
- sensitivity: "base"
198
- });
199
160
  function snapModelToHarness(harness, modelId, models) {
200
- if (isModelCompatibleWithHarness(harness, modelId)) return modelId;
201
- const ids = models.map(canonicalModelId);
202
- const policy = HARNESS_MODEL_POLICIES[harness];
203
- if (!policy) return modelId;
204
- for (const pattern of policy.preferred) {
205
- const matches = ids.filter((id) => pattern.test(id)).sort((a, b) => numericDesc.compare(b, a));
206
- if (matches.length > 0) return matches[0];
207
- }
208
- const fallback = ids.find(
209
- (id) => isModelCompatibleWithHarness(harness, id)
210
- );
211
- return fallback ?? modelId;
212
- }
213
- function snapHarnessToModel(harness, modelId) {
214
- if (isModelCompatibleWithHarness(harness, modelId)) return harness;
215
- const provider = modelProvider(modelId);
216
- return provider && PROVIDER_PREFERRED_HARNESS[provider] || "opencode";
161
+ return snapModelIdToHarness(harness, modelId, models.map(canonicalModelId));
217
162
  }
218
163
 
219
164
  // src/chat/agent-session-controls.tsx
@@ -821,10 +766,9 @@ function createFetchTransport(opts) {
821
766
  export {
822
767
  DEFAULT_REASONING_LEVEL_OPTIONS,
823
768
  ReasoningLevelPicker,
824
- HARNESS_MODEL_POLICIES,
825
- modelProvider,
826
769
  isModelCompatibleWithHarness,
827
770
  snapModelToHarness,
771
+ modelProvider,
828
772
  snapHarnessToModel,
829
773
  AgentSessionControls,
830
774
  ArtifactAgentDock,
package/dist/dashboard.js CHANGED
@@ -54,7 +54,7 @@ import {
54
54
  canAdminSandbox,
55
55
  parseInsufficientBalance,
56
56
  useSidebar
57
- } from "./chunk-SVNWL3ZR.js";
57
+ } from "./chunk-D7JJLG4L.js";
58
58
  import {
59
59
  BillingDashboard,
60
60
  InfoPanel,
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, ChatInput, ChatInputProps, ChatMessage, ChatMessageProps, MessageList, MessageListProps, MessageRole, PendingFile, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps } from '@tangle-network/ui/chat';
8
- export { AgentSessionControls, AgentSessionControlsProps, AgentSessionHarnessControl, AgentSessionModelControl, AgentSessionReasoningControl, ArtifactAgentDock, ArtifactAgentDockProps, ArtifactAgentDockTransport, ArtifactDockMessage, ArtifactDockStreamEvent, ArtifactKind, ArtifactScope, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_MODEL_POLICIES, ReasoningLevel, ReasoningLevelOption, ReasoningLevelPicker, ReasoningLevelPickerProps, createFetchTransport, isModelCompatibleWithHarness, modelProvider, snapHarnessToModel, snapModelToHarness } from './chat.js';
8
+ export { AgentSessionControls, AgentSessionControlsProps, AgentSessionHarnessControl, AgentSessionModelControl, AgentSessionReasoningControl, ArtifactAgentDock, ArtifactAgentDockProps, ArtifactAgentDockTransport, ArtifactDockMessage, ArtifactDockStreamEvent, ArtifactKind, ArtifactScope, DEFAULT_REASONING_LEVEL_OPTIONS, ReasoningLevel, ReasoningLevelOption, ReasoningLevelPicker, ReasoningLevelPickerProps, createFetchTransport, isModelCompatibleWithHarness, snapModelToHarness } from './chat.js';
9
9
  export { ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from '@tangle-network/ui/run';
10
10
  export { CommandPreview, DiffPreview, GlobResultsPreview, GrepResultsPreview, QuestionPreview, WebSearchPreview, WriteFilePreview } from '@tangle-network/ui/tool-previews';
11
11
  export { FileArtifactPane, FileArtifactPaneProps, FileNode, FilePreview, FilePreviewProps, FileTabData, FileTabs, FileTabsProps, FileTree, FileTreeProps, FileTreeVisibilityOptions, RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars, filterFileTree } from '@tangle-network/ui/files';
@@ -23,7 +23,7 @@ export { ChatSession, connectSession, disconnectSession, sessionAtom } from './s
23
23
  export { AgentBranding, CustomToolRenderer, DisplayVariant, FinalTextPart, GroupedMessage, MessageRun, MessageUser, ReasoningPart, Run, RunStats, SessionMessage, SessionPart, TextPart, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime } from '@tangle-network/ui/types';
24
24
  export { Session } from './types.js';
25
25
  export { TOOL_CATEGORY_ICONS, cn, copyText, formatBytes, formatDuration, formatUptime, getToolCategory, getToolDisplayMetadata, getToolErrorText, timeAgo, truncateText } from '@tangle-network/ui/utils';
26
- export { HarnessType } from '@tangle-network/agent-interface';
26
+ export { HarnessType, modelProvider, snapHarnessToModel } from '@tangle-network/agent-interface';
27
27
  import 'react/jsx-runtime';
28
28
  import 'react';
29
29
  import '@radix-ui/react-dropdown-menu';
package/dist/index.js CHANGED
@@ -81,7 +81,6 @@ import {
81
81
  ChatInput,
82
82
  ChatMessage,
83
83
  DEFAULT_REASONING_LEVEL_OPTIONS,
84
- HARNESS_MODEL_POLICIES,
85
84
  MessageList,
86
85
  ReasoningLevelPicker,
87
86
  ThinkingIndicator,
@@ -91,7 +90,7 @@ import {
91
90
  modelProvider,
92
91
  snapHarnessToModel,
93
92
  snapModelToHarness
94
- } from "./chunk-NHHYPID3.js";
93
+ } from "./chunk-WLMLD2CZ.js";
95
94
  import {
96
95
  TOOL_CATEGORY_ICONS,
97
96
  cn,
@@ -148,7 +147,7 @@ import {
148
147
  buildUnifiedPatch,
149
148
  computeDiffStats,
150
149
  resolveLanguage
151
- } from "./chunk-DLKDWMFM.js";
150
+ } from "./chunk-MKX3F55O.js";
152
151
  import {
153
152
  FileArtifactPane,
154
153
  FilePreview,
@@ -213,7 +212,7 @@ import {
213
212
  canAdminSandbox,
214
213
  parseInsufficientBalance,
215
214
  useSidebar
216
- } from "./chunk-SVNWL3ZR.js";
215
+ } from "./chunk-D7JJLG4L.js";
217
216
  import {
218
217
  BillingDashboard,
219
218
  InfoPanel,
@@ -432,7 +431,6 @@ export {
432
431
  GlobResultsPreview,
433
432
  GrepResultsPreview,
434
433
  HARNESS_BRAND,
435
- HARNESS_MODEL_POLICIES,
436
434
  HARNESS_OPTIONS,
437
435
  HarnessLogo,
438
436
  HarnessPicker,
package/dist/workbench.js CHANGED
@@ -12,9 +12,9 @@ import {
12
12
  buildUnifiedPatch,
13
13
  computeDiffStats,
14
14
  resolveLanguage
15
- } from "./chunk-DLKDWMFM.js";
15
+ } from "./chunk-MKX3F55O.js";
16
16
  import "./chunk-3J6FG3FJ.js";
17
- import "./chunk-SVNWL3ZR.js";
17
+ import "./chunk-D7JJLG4L.js";
18
18
  import "./chunk-OMUIPJQZ.js";
19
19
  import "./chunk-VIREDUBF.js";
20
20
  import "./chunk-77WVVJA4.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.57.0",
3
+ "version": "0.58.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",
@@ -126,7 +126,7 @@
126
126
  "test:bridge": "pnpm build && vitest run src/__tests__/re-export-identity.test.ts"
127
127
  },
128
128
  "peerDependencies": {
129
- "@tangle-network/agent-interface": ">=0.10.0 <1.0.0",
129
+ "@tangle-network/agent-interface": ">=0.15.0 <1.0.0",
130
130
  "@tangle-network/brand": "^0.6.0",
131
131
  "@tangle-network/ui": "^4.0.0",
132
132
  "@xyflow/react": "^12.0.0",
@@ -181,7 +181,7 @@
181
181
  "@storybook/react-vite": "^8.6.18",
182
182
  "@tailwindcss/postcss": "^4.2.2",
183
183
  "@tailwindcss/vite": "^4.2.2",
184
- "@tangle-network/agent-interface": ">=0.10.0 <1.0.0",
184
+ "@tangle-network/agent-interface": ">=0.15.0 <1.0.0",
185
185
  "@tangle-network/brand": "^0.6.0",
186
186
  "@tangle-network/ui": "^4.1.0",
187
187
  "@tanstack/react-query": "^5.91.0",