@tangle-network/sandbox-ui 0.80.0 → 0.81.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/index.js CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  snapHarnessToModel,
92
92
  snapModelToHarness,
93
93
  validateComposerFiles
94
- } from "./chunk-UFVXAJSA.js";
94
+ } from "./chunk-YBFGWPUF.js";
95
95
  import {
96
96
  TOOL_CATEGORY_ICONS,
97
97
  cn,
@@ -320,16 +320,20 @@ import {
320
320
  HarnessLogo,
321
321
  HarnessPicker,
322
322
  chatCapableHarnesses
323
- } from "./chunk-IWIZ7RZE.js";
323
+ } from "./chunk-2T6KBMLN.js";
324
324
  import {
325
325
  DEFAULT_FEATURED_MODEL_IDS,
326
326
  ModelPicker,
327
- canonicalModelId,
328
327
  dedupeModels,
329
328
  formatContext,
330
329
  formatPricing,
331
330
  modelDedupKey
332
- } from "./chunk-L62ZT6RS.js";
331
+ } from "./chunk-R4AR3TKR.js";
332
+ import {
333
+ ModelBrandStack,
334
+ canonicalModelId,
335
+ modelBrandFor
336
+ } from "./chunk-I3G23XHN.js";
333
337
  import "./chunk-EI44GEQ5.js";
334
338
  import {
335
339
  OpenUIArtifactRenderer
@@ -454,6 +458,7 @@ export {
454
458
  Markdown,
455
459
  MessageList,
456
460
  MetricAreaChart,
461
+ ModelBrandStack,
457
462
  ModelPicker,
458
463
  NetworkConfig,
459
464
  NewSandboxCard,
@@ -611,6 +616,7 @@ export {
611
616
  isModelCompatibleWithHarness,
612
617
  isStreamingAtom,
613
618
  messagesAtom,
619
+ modelBrandFor,
614
620
  modelDedupKey,
615
621
  modelProvider,
616
622
  parseInsufficientBalance,
@@ -0,0 +1,101 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReasoningEffort } from '@tangle-network/agent-interface';
3
+
4
+ /**
5
+ * Wire-format model entry as returned by `/v1/models` on the Tangle Router
6
+ * (and most OpenAI-compatible gateways). Field names match the upstream
7
+ * response so consumers can pass `data.data` straight through.
8
+ */
9
+ interface ModelInfo {
10
+ /** Provider-local id, e.g. "gpt-5.4" or "anthropic/claude-sonnet-4-6". */
11
+ id: string;
12
+ /** Human label (defaults to id if absent). */
13
+ name?: string;
14
+ /** Provider key, e.g. "openai", "anthropic". Underscored for compat with router. */
15
+ _provider?: string;
16
+ /** Alternative provider field on some gateways. */
17
+ provider?: string;
18
+ /**
19
+ * Per-token prices in USD as decimal strings. Multiply by 1_000_000 for
20
+ * the conventional $/M tokens display.
21
+ */
22
+ pricing?: {
23
+ prompt?: string | null;
24
+ completion?: string | null;
25
+ };
26
+ context_length?: number;
27
+ description?: string | null;
28
+ architecture?: {
29
+ modality?: string;
30
+ input_modalities?: string[];
31
+ output_modalities?: string[];
32
+ };
33
+ /** Hosting company or router that serves the request. Defaults to `_provider` / `provider`. */
34
+ hostProvider?: string;
35
+ /** Lab/company that authored the model. Inferred from model id/name when omitted. */
36
+ modelLab?: string;
37
+ /** Optional explicit logo keys when provider/lab ids are not stable. */
38
+ logos?: {
39
+ host?: ModelBrandKey;
40
+ lab?: ModelBrandKey;
41
+ hostUrl?: string;
42
+ labUrl?: string;
43
+ };
44
+ /**
45
+ * Marks a model as recommended. When any catalog row carries this flag the
46
+ * picker surfaces those rows in a "Recommended" section at the top. When no
47
+ * row is flagged the picker falls back to {@link DEFAULT_FEATURED_MODEL_IDS}
48
+ * (matched by dedup key) so the section is never empty for a router catalog.
49
+ */
50
+ featured?: boolean;
51
+ /**
52
+ * Per-model reasoning capability, fed to the reasoning-effort picker's capability filter. Source it
53
+ * from your model catalog (e.g. the router's `supported_parameters` containing `reasoning`). When
54
+ * `false`, only `none` is offered for this model regardless of harness.
55
+ */
56
+ supportsReasoning?: boolean;
57
+ /** The model's own reasoning ceiling, if narrower than its harness's (e.g. a model capped at `high`). */
58
+ maxReasoningEffort?: ReasoningEffort;
59
+ }
60
+ type ModelBrandKey = "ai21" | "alibaba" | "anthropic" | "azure" | "bedrock" | "cartesia" | "cerebras" | "cohere" | "deepseek" | "elevenlabs" | "fal" | "fireworks" | "google" | "groq" | "kuaishou" | "luma" | "meta" | "mistral" | "moonshot" | "openai" | "openrouter" | "perplexity" | "pika" | "replicate" | "runway" | "stability" | "tangle" | "tcloud" | "together" | "vertex" | "xai" | "zai" | "unknown";
61
+ interface ModelBrandIdentity {
62
+ host: ModelBrandInfo;
63
+ lab: ModelBrandInfo;
64
+ combined: boolean;
65
+ }
66
+ interface ModelBrandInfo {
67
+ key: ModelBrandKey;
68
+ label: string;
69
+ logoUrl?: string;
70
+ logo?: "tangle";
71
+ /**
72
+ * True for the bundled single-color brand glyphs, which are rendered as a
73
+ * CSS mask filled with the foreground token so they stay visible in both
74
+ * themes. Caller-supplied logo URLs (`ModelInfo.logos.*Url`) may be
75
+ * full-color artwork and are rendered as-is.
76
+ */
77
+ monochrome?: boolean;
78
+ }
79
+ /**
80
+ * Resolve the canonical id for a model. Some upstreams already prefix the
81
+ * provider in the id (e.g. "anthropic/claude-haiku-4.5"); others put it in
82
+ * `_provider` and leave the id bare. Always returns "<provider>/<model>"
83
+ * unless the id is already prefixed.
84
+ */
85
+ declare function canonicalModelId(model: ModelInfo): string;
86
+ /**
87
+ * The brand identity to show for a model id, or `null` when no published mark
88
+ * exists for it — a caller then falls back to its own generic glyph rather than
89
+ * rendering an empty chip or inventing a logo.
90
+ *
91
+ * Takes the bare id ("anthropic/claude-sonnet-4-5") so a surface that knows only
92
+ * the model string — a workflow node, a run header — can render the same mark the
93
+ * picker does.
94
+ */
95
+ declare function modelBrandFor(model: string): ModelBrandIdentity | null;
96
+ declare function ModelBrandStack({ identity, size }: {
97
+ identity: ModelBrandIdentity;
98
+ size: "sm" | "md";
99
+ }): react_jsx_runtime.JSX.Element | null;
100
+
101
+ export { type ModelBrandIdentity as M, ModelBrandStack as a, type ModelInfo as b, canonicalModelId as c, modelBrandFor as m };
package/dist/pages.d.ts CHANGED
@@ -2,9 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import { CSSProperties, ReactNode } from 'react';
4
4
  import { c as BillingSubscription, B as BillingBalance, d as BillingUsage, j as UsageDataPoint, f as PricingTier, g as TemplateCardData } from './template-card-UhV3pmRC.js';
5
- export { M as ModelInfo } from './model-picker-COjPVMzg.js';
5
+ export { b as ModelInfo } from './model-brand-CsFykzMA.js';
6
6
  import '@tangle-network/agent-interface';
7
- import '@radix-ui/react-dropdown-menu';
8
7
 
9
8
  /**
10
9
  * Shared, self-contained sign-in / sign-up page for every Tangle vertical app.
package/dist/pages.js CHANGED
@@ -24,7 +24,8 @@ import {
24
24
  Switch,
25
25
  Textarea
26
26
  } from "./chunk-4ZZUMXPX.js";
27
- import "./chunk-L62ZT6RS.js";
27
+ import "./chunk-R4AR3TKR.js";
28
+ import "./chunk-I3G23XHN.js";
28
29
  import {
29
30
  cn
30
31
  } from "./chunk-EI44GEQ5.js";
package/dist/styles.css CHANGED
@@ -444,6 +444,9 @@
444
444
  .left-full {
445
445
  left: 100%;
446
446
  }
447
+ .isolate {
448
+ isolation: isolate;
449
+ }
447
450
  .z-0 {
448
451
  z-index: 0;
449
452
  }
package/dist/workbench.js CHANGED
@@ -19,8 +19,9 @@ import "./chunk-VIREDUBF.js";
19
19
  import "./chunk-77WVVJA4.js";
20
20
  import "./chunk-OMUIPJQZ.js";
21
21
  import "./chunk-4ZZUMXPX.js";
22
- import "./chunk-IWIZ7RZE.js";
23
- import "./chunk-L62ZT6RS.js";
22
+ import "./chunk-2T6KBMLN.js";
23
+ import "./chunk-R4AR3TKR.js";
24
+ import "./chunk-I3G23XHN.js";
24
25
  import "./chunk-EI44GEQ5.js";
25
26
  import "./chunk-U67V476Y.js";
26
27
  export {
package/dist/workflows.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  buildWorkflowGraph
3
- } from "./chunk-UEMWLVVY.js";
3
+ } from "./chunk-2NS724P4.js";
4
4
  import "./chunk-U67V476Y.js";
5
5
 
6
6
  // src/workflows/WorkflowGraphLazy.tsx
@@ -26,7 +26,7 @@ function retryImport(factory, retries = 2, delayMs = 350) {
26
26
  function lazyWorkflowGraph() {
27
27
  return lazy(
28
28
  () => retryImport(
29
- () => import("./WorkflowGraph-SJ2SG5TP.js").then((m) => ({ default: m.WorkflowGraph }))
29
+ () => import("./WorkflowGraph-472MC3ML.js").then((m) => ({ default: m.WorkflowGraph }))
30
30
  )
31
31
  );
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox-ui",
3
- "version": "0.80.0",
3
+ "version": "0.81.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",
@@ -1,145 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReasoningEffort } from '@tangle-network/agent-interface';
3
- import * as Popover from '@radix-ui/react-dropdown-menu';
4
-
5
- /**
6
- * Wire-format model entry as returned by `/v1/models` on the Tangle Router
7
- * (and most OpenAI-compatible gateways). Field names match the upstream
8
- * response so consumers can pass `data.data` straight through.
9
- */
10
- interface ModelInfo {
11
- /** Provider-local id, e.g. "gpt-5.4" or "anthropic/claude-sonnet-4-6". */
12
- id: string;
13
- /** Human label (defaults to id if absent). */
14
- name?: string;
15
- /** Provider key, e.g. "openai", "anthropic". Underscored for compat with router. */
16
- _provider?: string;
17
- /** Alternative provider field on some gateways. */
18
- provider?: string;
19
- /**
20
- * Per-token prices in USD as decimal strings. Multiply by 1_000_000 for
21
- * the conventional $/M tokens display.
22
- */
23
- pricing?: {
24
- prompt?: string | null;
25
- completion?: string | null;
26
- };
27
- context_length?: number;
28
- description?: string | null;
29
- architecture?: {
30
- modality?: string;
31
- input_modalities?: string[];
32
- output_modalities?: string[];
33
- };
34
- /** Hosting company or router that serves the request. Defaults to `_provider` / `provider`. */
35
- hostProvider?: string;
36
- /** Lab/company that authored the model. Inferred from model id/name when omitted. */
37
- modelLab?: string;
38
- /** Optional explicit logo keys when provider/lab ids are not stable. */
39
- logos?: {
40
- host?: ModelBrandKey;
41
- lab?: ModelBrandKey;
42
- hostUrl?: string;
43
- labUrl?: string;
44
- };
45
- /**
46
- * Marks a model as recommended. When any catalog row carries this flag the
47
- * picker surfaces those rows in a "Recommended" section at the top. When no
48
- * row is flagged the picker falls back to {@link DEFAULT_FEATURED_MODEL_IDS}
49
- * (matched by dedup key) so the section is never empty for a router catalog.
50
- */
51
- featured?: boolean;
52
- /**
53
- * Per-model reasoning capability, fed to the reasoning-effort picker's capability filter. Source it
54
- * from your model catalog (e.g. the router's `supported_parameters` containing `reasoning`). When
55
- * `false`, only `none` is offered for this model regardless of harness.
56
- */
57
- supportsReasoning?: boolean;
58
- /** The model's own reasoning ceiling, if narrower than its harness's (e.g. a model capped at `high`). */
59
- maxReasoningEffort?: ReasoningEffort;
60
- }
61
- type ModelBrandKey = "ai21" | "alibaba" | "anthropic" | "azure" | "bedrock" | "cartesia" | "cerebras" | "cohere" | "deepseek" | "elevenlabs" | "fal" | "fireworks" | "google" | "groq" | "kuaishou" | "luma" | "meta" | "mistral" | "moonshot" | "openai" | "openrouter" | "perplexity" | "pika" | "replicate" | "runway" | "stability" | "tangle" | "tcloud" | "together" | "vertex" | "xai" | "zai" | "unknown";
62
- type ModelPickerVariant = "field" | "pill";
63
- interface ModelPickerProps {
64
- /** Canonical model id (provider-prefixed, e.g. "openai/gpt-5.4"). */
65
- value: string;
66
- onChange: (modelId: string) => void;
67
- /** Models to choose from. Pass `[]` while loading. */
68
- models: ModelInfo[];
69
- /** Show the loading state (overrides empty-list copy). */
70
- loading?: boolean;
71
- /** Recently-used canonical ids to surface at the top. */
72
- recents?: ReadonlyArray<string>;
73
- /**
74
- * Canonical model ids to surface in a "Popular" section above the full
75
- * list. Each id is resolved against `models`; ids not present in the
76
- * loaded catalog are silently skipped, so callers can pass a stable
77
- * curation list without worrying about provider availability.
78
- */
79
- popular?: ReadonlyArray<string>;
80
- /** Drop providers from the picker entirely (e.g. "audio", "embedding"). */
81
- excludeProviders?: ReadonlyArray<string>;
82
- /** Restrict to these architectures (e.g. ["text"]). Default: all. */
83
- modalities?: ReadonlyArray<string>;
84
- /** Trigger appearance. "field" = full-width form field; "pill" = inline chat input pill. */
85
- variant?: ModelPickerVariant;
86
- label?: string;
87
- placeholder?: string;
88
- className?: string;
89
- /**
90
- * Extra classes merged onto the trigger button itself (after the
91
- * built-in defaults, so callers can override sizing/radius/font to
92
- * match a surrounding form). Distinct from `className`, which on the
93
- * "field" variant styles the outer wrapper.
94
- */
95
- triggerClassName?: string;
96
- disabled?: boolean;
97
- /** Side the menu opens toward. Defaults to Radix's "bottom". */
98
- side?: Popover.DropdownMenuContentProps["side"];
99
- /**
100
- * Let Radix flip the menu to the opposite side when it would overflow the
101
- * viewport. Defaults to `true` (Radix default). Pass `false` to pin the menu
102
- * to `side` — e.g. a composer floating in open space that should always open
103
- * downward rather than flipping up over the heading.
104
- */
105
- avoidCollisions?: boolean;
106
- }
107
- /**
108
- * Resolve the canonical id for a model. Some upstreams already prefix the
109
- * provider in the id (e.g. "anthropic/claude-haiku-4.5"); others put it in
110
- * `_provider` and leave the id bare. Always returns "<provider>/<model>"
111
- * unless the id is already prefixed.
112
- */
113
- declare function canonicalModelId(model: ModelInfo): string;
114
- /**
115
- * Stable key used to collapse catalog duplicates. The Tangle Router lists the
116
- * same underlying model under several host prefixes (e.g. `openai/gpt-5.4`,
117
- * `tcloud/gpt-5.4`, `openrouter/openai/gpt-5.4`); they all name one model and
118
- * should occupy a single row. The key is `<lab>/<model-id>`: the authoring lab
119
- * (inferred via {@link resolveModelBrandIdentity}, which already maps
120
- * `gpt-5.4` → openai, `kimi-k2` → moonshot, etc.) plus the final id segment,
121
- * so a model collapses to one identity regardless of which host serves it.
122
- */
123
- declare function modelDedupKey(model: ModelInfo): string;
124
- /**
125
- * Collapse catalog duplicates to one row per {@link modelDedupKey}. When a
126
- * model is served under multiple hosts the preferred row wins: a `featured`
127
- * row beats a non-featured one, otherwise the first occurrence is kept (so
128
- * caller-controlled catalog order still decides ties). Input order is
129
- * preserved for the surviving rows.
130
- */
131
- declare function dedupeModels(models: ReadonlyArray<ModelInfo>): ModelInfo[];
132
- /**
133
- * Fallback "Recommended" seed — latest frontier models per major lab, matched
134
- * by {@link modelDedupKey} against the loaded catalog. Used only when no
135
- * catalog row carries an explicit `featured` flag, so a standard router
136
- * catalog still gets a curated top section without per-deployment config.
137
- */
138
- declare const DEFAULT_FEATURED_MODEL_IDS: ReadonlyArray<string>;
139
- /** Format $/M tokens. Returns null if pricing is missing or zero. */
140
- declare function formatPricing(pricing: ModelInfo["pricing"]): string | null;
141
- /** Format context length compactly (e.g. 200_000 → "200k"). */
142
- declare function formatContext(ctx: number | undefined): string | null;
143
- declare function ModelPicker({ value, onChange, models, loading, recents, popular, excludeProviders, modalities, variant, label, placeholder, className, triggerClassName, disabled, side, avoidCollisions, }: ModelPickerProps): react_jsx_runtime.JSX.Element;
144
-
145
- export { DEFAULT_FEATURED_MODEL_IDS as D, type ModelInfo as M, ModelPicker as a, type ModelPickerProps as b, type ModelPickerVariant as c, canonicalModelId as d, dedupeModels as e, formatContext as f, formatPricing as g, modelDedupKey as m };