@tangle-network/sandbox-ui 0.21.0 → 0.21.1
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 +61 -1
- package/dist/chat.js +13 -3
- package/dist/{chunk-FLWMBK77.js → chunk-LA5GHELP.js} +399 -263
- package/dist/{chunk-76IQLPW2.js → chunk-SOKKTB7W.js} +29 -5
- package/dist/{chunk-666PYT5K.js → chunk-TAAYDQGM.js} +101 -11
- package/dist/dashboard.d.ts +34 -1
- package/dist/dashboard.js +3 -1
- package/dist/globals.css +33 -198
- package/dist/hooks.d.ts +63 -2
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -4
- package/dist/pages.js +132 -120
- package/dist/styles.css +33 -198
- package/package.json +1 -1
package/dist/chat.d.ts
CHANGED
|
@@ -28,6 +28,15 @@ interface AgentSessionHarnessControl {
|
|
|
28
28
|
/** Filter the selectable harnesses (e.g. by plan tier). Defaults to all. */
|
|
29
29
|
available?: ReadonlyArray<HarnessType>;
|
|
30
30
|
disabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A harness is bound to its chat session once the conversation has
|
|
33
|
+
* started. While locked the dropdown is inert and the model catalog
|
|
34
|
+
* is filtered to what this harness can run — fork the session to
|
|
35
|
+
* switch harness.
|
|
36
|
+
*/
|
|
37
|
+
locked?: boolean;
|
|
38
|
+
/** Tooltip shown on the locked trigger. */
|
|
39
|
+
lockReason?: string;
|
|
31
40
|
}
|
|
32
41
|
interface AgentSessionModelControl {
|
|
33
42
|
/** Canonical model id (provider-prefixed, e.g. "anthropic/claude-opus-4-8"). */
|
|
@@ -65,10 +74,61 @@ interface AgentSessionControlsProps {
|
|
|
65
74
|
* thinking-effort pickers in one row. Every section is optional and only
|
|
66
75
|
* renders when its control object is provided — never show a dead control.
|
|
67
76
|
*
|
|
77
|
+
* When BOTH harness and model controls are present the pair is kept
|
|
78
|
+
* coherent automatically (see harness-model-compat): picking a harness
|
|
79
|
+
* snaps an incompatible model to that harness's best catalog option;
|
|
80
|
+
* picking a model the current harness can't run switches to the model's
|
|
81
|
+
* native harness — unless the harness is `locked`, in which case the
|
|
82
|
+
* catalog itself is filtered to compatible models.
|
|
83
|
+
*
|
|
68
84
|
* Designed to slot into `SandboxWorkbench`'s `session.composerControls`.
|
|
69
85
|
*/
|
|
70
86
|
declare function AgentSessionControls({ harness, model, reasoning, trailing, className, }: AgentSessionControlsProps): react_jsx_runtime.JSX.Element | null;
|
|
71
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Harness ↔ model compatibility policy.
|
|
90
|
+
*
|
|
91
|
+
* Native CLI harnesses are vendor-locked: claude-code only drives
|
|
92
|
+
* Anthropic models, codex only OpenAI models. Router-backed harnesses
|
|
93
|
+
* (opencode) accept any catalog model. The pickers use this policy to
|
|
94
|
+
* keep the pair coherent: changing one side snaps the other to its
|
|
95
|
+
* nearest compatible choice instead of letting the user assemble a
|
|
96
|
+
* combination that fails at inference time.
|
|
97
|
+
*/
|
|
98
|
+
interface HarnessModelPolicy {
|
|
99
|
+
/** Canonical-id provider prefixes the harness can run; null = any. */
|
|
100
|
+
providers: ReadonlyArray<string> | null;
|
|
101
|
+
/**
|
|
102
|
+
* Patterns ranking snap targets, best first. Within one pattern's
|
|
103
|
+
* matches the highest version (numeric-aware descending sort) wins,
|
|
104
|
+
* so "latest standard frontier" stays correct as catalogs rotate.
|
|
105
|
+
*/
|
|
106
|
+
preferred: ReadonlyArray<RegExp>;
|
|
107
|
+
}
|
|
108
|
+
declare const HARNESS_MODEL_POLICIES: Record<HarnessType, HarnessModelPolicy>;
|
|
109
|
+
/** Provider prefix of a canonical id ("anthropic/claude-…" → "anthropic"). */
|
|
110
|
+
declare function modelProvider(modelId: string): string | null;
|
|
111
|
+
/**
|
|
112
|
+
* Ids without a provider prefix (consumer sentinels like "default",
|
|
113
|
+
* or an empty selection) are treated as compatible everywhere — they
|
|
114
|
+
* mean "the session's own configuration", which every harness honors.
|
|
115
|
+
*/
|
|
116
|
+
declare function isModelCompatibleWithHarness(harness: HarnessType, modelId: string): boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Keeps `modelId` when the harness can run it; otherwise returns the
|
|
119
|
+
* harness's best compatible catalog model (preferred patterns in order,
|
|
120
|
+
* highest version within a pattern). When the catalog holds nothing
|
|
121
|
+
* compatible the original id is returned unchanged — the caller sees
|
|
122
|
+
* the incompatibility instead of a silent wrong substitution.
|
|
123
|
+
*/
|
|
124
|
+
declare function snapModelToHarness(harness: HarnessType, modelId: string, models: ReadonlyArray<ModelInfo>): string;
|
|
125
|
+
/**
|
|
126
|
+
* Keeps the harness when it can run `modelId`; otherwise returns the
|
|
127
|
+
* model's native harness (anthropic → claude-code, openai → codex),
|
|
128
|
+
* falling back to the router-backed opencode for everything else.
|
|
129
|
+
*/
|
|
130
|
+
declare function snapHarnessToModel(harness: HarnessType, modelId: string): HarnessType;
|
|
131
|
+
|
|
72
132
|
type ArtifactKind = string;
|
|
73
133
|
interface ArtifactScope {
|
|
74
134
|
kind: ArtifactKind;
|
|
@@ -166,4 +226,4 @@ declare function createFetchTransport(opts: {
|
|
|
166
226
|
fetchImpl?: typeof fetch;
|
|
167
227
|
}): ArtifactAgentDockTransport;
|
|
168
228
|
|
|
169
|
-
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 };
|
|
229
|
+
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 };
|
package/dist/chat.js
CHANGED
|
@@ -6,12 +6,17 @@ import {
|
|
|
6
6
|
ChatInput,
|
|
7
7
|
ChatMessage,
|
|
8
8
|
DEFAULT_REASONING_LEVEL_OPTIONS,
|
|
9
|
+
HARNESS_MODEL_POLICIES,
|
|
9
10
|
MessageList,
|
|
10
11
|
ReasoningLevelPicker,
|
|
11
12
|
ThinkingIndicator,
|
|
12
13
|
UserMessage,
|
|
13
|
-
createFetchTransport
|
|
14
|
-
|
|
14
|
+
createFetchTransport,
|
|
15
|
+
isModelCompatibleWithHarness,
|
|
16
|
+
modelProvider,
|
|
17
|
+
snapHarnessToModel,
|
|
18
|
+
snapModelToHarness
|
|
19
|
+
} from "./chunk-TAAYDQGM.js";
|
|
15
20
|
import "./chunk-ESRYVGHF.js";
|
|
16
21
|
import "./chunk-4KAPMTPU.js";
|
|
17
22
|
import "./chunk-EI44GEQ5.js";
|
|
@@ -23,9 +28,14 @@ export {
|
|
|
23
28
|
ChatInput,
|
|
24
29
|
ChatMessage,
|
|
25
30
|
DEFAULT_REASONING_LEVEL_OPTIONS,
|
|
31
|
+
HARNESS_MODEL_POLICIES,
|
|
26
32
|
MessageList,
|
|
27
33
|
ReasoningLevelPicker,
|
|
28
34
|
ThinkingIndicator,
|
|
29
35
|
UserMessage,
|
|
30
|
-
createFetchTransport
|
|
36
|
+
createFetchTransport,
|
|
37
|
+
isModelCompatibleWithHarness,
|
|
38
|
+
modelProvider,
|
|
39
|
+
snapHarnessToModel,
|
|
40
|
+
snapModelToHarness
|
|
31
41
|
};
|