@tangle-network/sandbox-ui 0.113.7 → 0.115.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/README.md +40 -0
- package/dist/WorkflowGraph-B-NsdYz_.js +1961 -0
- package/dist/assets.d.ts +214 -206
- package/dist/assets.js +1057 -908
- package/dist/auth-CWe17Hly.js +37 -0
- package/dist/auth.d.ts +2 -30
- package/dist/auth.js +2 -15
- package/dist/chat-BOvFAe6p.js +903 -0
- package/dist/chat.d.ts +2 -230
- package/dist/chat.js +2 -34
- package/dist/connectors.d.ts +52 -49
- package/dist/connectors.js +595 -643
- package/dist/dashboard-CZ3VgNPR.js +4969 -0
- package/dist/dashboard.d.ts +4 -1297
- package/dist/dashboard.js +4 -152
- package/dist/editor.d.ts +2 -1
- package/dist/editor.js +2 -31
- package/dist/files.d.ts +2 -6
- package/dist/files.js +2 -33
- package/dist/globals.css +75 -3
- package/dist/hooks.d.ts +146 -148
- package/dist/hooks.js +222 -55
- package/dist/index-CKRaj1pM.d.ts +776 -0
- package/dist/index-CXX5IpH2.d.ts +2 -0
- package/dist/index-CesPlOyx.d.ts +367 -0
- package/dist/index-DPePq7c8.d.ts +1340 -0
- package/dist/index-DiyLLZuJ.d.ts +230 -0
- package/dist/index-DvmZLMT1.d.ts +30 -0
- package/dist/index-PRM636Ex.d.ts +86 -0
- package/dist/index.d.ts +21 -33
- package/dist/index.js +21 -701
- package/dist/info-panel-C9cqDzOL.js +594 -0
- package/dist/integrations.d.ts +133 -141
- package/dist/integrations.js +491 -673
- package/dist/markdown.d.ts +2 -1
- package/dist/markdown.js +2 -13
- package/dist/model-I-NIxeM-.js +1250 -0
- package/dist/model-brand-B9A4H9pJ.d.ts +98 -0
- package/dist/model-brand-hMyDTUqB.js +624 -0
- package/dist/motion-DkyBRJb9.js +37 -0
- package/dist/openui.d.ts +2 -1
- package/dist/openui.js +2 -7
- package/dist/pages.d.ts +307 -300
- package/dist/pages.js +4404 -4181
- package/dist/primitives-Dh1vG6J3.js +113 -0
- package/dist/primitives.d.ts +2 -74
- package/dist/primitives.js +2 -204
- package/dist/provider-logo-DjqmConF.js +311 -0
- package/dist/run.d.ts +2 -1
- package/dist/run.js +2 -23
- package/dist/sdk-hooks.d.ts +3 -4
- package/dist/sdk-hooks.js +3 -31
- package/dist/sidecar-DgH_vQ6m.d.ts +9 -0
- package/dist/stores.d.ts +14 -15
- package/dist/stores.js +13 -81
- package/dist/styles.css +75 -3
- package/dist/template-card-L-4gmjx2.d.ts +90 -0
- package/dist/terminal-CN9ZgHRt.js +197 -0
- package/dist/terminal.d.ts +60 -60
- package/dist/terminal.js +2 -10
- package/dist/tokens.css +51 -0
- package/dist/types.d.ts +4 -11
- package/dist/types.js +0 -1
- package/dist/use-pty-session-C8cE0adT.js +669 -0
- package/dist/use-sidecar-auth-CCTJcrq7.d.ts +145 -0
- package/dist/use-sidecar-auth-DkdcufOz.js +742 -0
- package/dist/utils-DzWbktWG.js +2 -0
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +2 -37
- package/dist/workbench-ztU44Jt2.js +8455 -0
- package/dist/workbench.d.ts +2 -310
- package/dist/workbench.js +2 -44
- package/dist/workflows.d.ts +341 -339
- package/dist/workflows.js +74 -109
- package/dist/workspace-B6AtI6ld.js +2510 -0
- package/dist/workspace.d.ts +2 -761
- package/dist/workspace.js +2 -51
- package/package.json +46 -40
- package/dist/WorkflowGraph-2QOORYIR.js +0 -1722
- package/dist/chunk-2BUPSB7O.js +0 -0
- package/dist/chunk-3KBNPQQF.js +0 -2697
- package/dist/chunk-3LIXVEEE.js +0 -279
- package/dist/chunk-72UF2H5H.js +0 -707
- package/dist/chunk-AI25G5MX.js +0 -944
- package/dist/chunk-ANSC5AFC.js +0 -314
- package/dist/chunk-AZ3AWMTM.js +0 -8
- package/dist/chunk-BGVEHENC.js +0 -10
- package/dist/chunk-CZ7CSFO4.js +0 -39
- package/dist/chunk-DYXXYGS4.js +0 -4700
- package/dist/chunk-EI44GEQ5.js +0 -6
- package/dist/chunk-IACRDXER.js +0 -219
- package/dist/chunk-IOB2PW5Z.js +0 -55
- package/dist/chunk-M4K7ZGR2.js +0 -24
- package/dist/chunk-MYZAW4RX.js +0 -665
- package/dist/chunk-OMUIPJQZ.js +0 -555
- package/dist/chunk-RQZRXKMR.js +0 -398
- package/dist/chunk-SOKKTB7W.js +0 -230
- package/dist/chunk-TADGS4Q7.js +0 -1010
- package/dist/chunk-UCQNOUN3.js +0 -7964
- package/dist/chunk-ULPLRBMF.js +0 -34
- package/dist/chunk-WID73FPH.js +0 -89
- package/dist/chunk-X3YXP7FG.js +0 -38
- package/dist/logo-DiAjq759.d.ts +0 -15
- package/dist/model-brand-BNnaUKKZ.d.ts +0 -99
- package/dist/ports-list-CDIvTNnX.d.ts +0 -17
- package/dist/sdk-hooks-Djkjq4cp.d.ts +0 -145
- package/dist/template-card-Bn-Bw5xC.d.ts +0 -87
package/dist/chunk-ULPLRBMF.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/files/index.ts
|
|
2
|
-
import {
|
|
3
|
-
CSV_PREVIEW_ROW_LIMIT,
|
|
4
|
-
FileArtifactPane,
|
|
5
|
-
FilePreview,
|
|
6
|
-
FileTabs,
|
|
7
|
-
FileTree,
|
|
8
|
-
RichFileTree,
|
|
9
|
-
detectFileFormat,
|
|
10
|
-
fileExtension,
|
|
11
|
-
filterFileTree,
|
|
12
|
-
getCodeLanguage,
|
|
13
|
-
getFormatLabel,
|
|
14
|
-
getSyntaxLanguage,
|
|
15
|
-
parseCsv,
|
|
16
|
-
resolveFilePreviewKind
|
|
17
|
-
} from "@tangle-network/ui/files";
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
CSV_PREVIEW_ROW_LIMIT,
|
|
21
|
-
FileArtifactPane,
|
|
22
|
-
FilePreview,
|
|
23
|
-
FileTabs,
|
|
24
|
-
FileTree,
|
|
25
|
-
RichFileTree,
|
|
26
|
-
detectFileFormat,
|
|
27
|
-
fileExtension,
|
|
28
|
-
filterFileTree,
|
|
29
|
-
getCodeLanguage,
|
|
30
|
-
getFormatLabel,
|
|
31
|
-
getSyntaxLanguage,
|
|
32
|
-
parseCsv,
|
|
33
|
-
resolveFilePreviewKind
|
|
34
|
-
};
|
package/dist/chunk-WID73FPH.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
// src/stores/index.ts
|
|
2
|
-
import {
|
|
3
|
-
activeSessionsAtom,
|
|
4
|
-
bumpActiveSessionActivity,
|
|
5
|
-
getActiveSession,
|
|
6
|
-
getAllActiveSessions,
|
|
7
|
-
getAllProjectActivity,
|
|
8
|
-
getSessionsByActivity,
|
|
9
|
-
getSessionsForNavbar,
|
|
10
|
-
getSessionsForProject,
|
|
11
|
-
getTotalRunningSessionCount,
|
|
12
|
-
hasBackgroundRunningSessions,
|
|
13
|
-
registerActiveSession,
|
|
14
|
-
resetActiveSessions,
|
|
15
|
-
setActiveSessionAttention,
|
|
16
|
-
setActiveSessionConnection,
|
|
17
|
-
setActiveSessionError,
|
|
18
|
-
setActiveSessionRunning,
|
|
19
|
-
setForegroundActiveSession,
|
|
20
|
-
unregisterActiveSession,
|
|
21
|
-
updateActiveSessionMeta,
|
|
22
|
-
useActiveSession,
|
|
23
|
-
useActiveSessions,
|
|
24
|
-
useActiveSessionsState,
|
|
25
|
-
useHasBackgroundRunningSessions,
|
|
26
|
-
useNavbarSessions,
|
|
27
|
-
useProjectActivity,
|
|
28
|
-
useProjectSessions,
|
|
29
|
-
useSessionsByActivity,
|
|
30
|
-
useTotalRunningSessions,
|
|
31
|
-
addMessage,
|
|
32
|
-
addParts,
|
|
33
|
-
clearChat,
|
|
34
|
-
isStreamingAtom,
|
|
35
|
-
messagesAtom,
|
|
36
|
-
partMapAtom,
|
|
37
|
-
updatePart
|
|
38
|
-
} from "@tangle-network/ui/stores";
|
|
39
|
-
|
|
40
|
-
// src/stores/session-store.ts
|
|
41
|
-
import { atom } from "nanostores";
|
|
42
|
-
var sessionAtom = atom(null);
|
|
43
|
-
function connectSession(session) {
|
|
44
|
-
sessionAtom.set(session);
|
|
45
|
-
}
|
|
46
|
-
function disconnectSession() {
|
|
47
|
-
sessionAtom.set(null);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export {
|
|
51
|
-
sessionAtom,
|
|
52
|
-
connectSession,
|
|
53
|
-
disconnectSession,
|
|
54
|
-
activeSessionsAtom,
|
|
55
|
-
bumpActiveSessionActivity,
|
|
56
|
-
getActiveSession,
|
|
57
|
-
getAllActiveSessions,
|
|
58
|
-
getAllProjectActivity,
|
|
59
|
-
getSessionsByActivity,
|
|
60
|
-
getSessionsForNavbar,
|
|
61
|
-
getSessionsForProject,
|
|
62
|
-
getTotalRunningSessionCount,
|
|
63
|
-
hasBackgroundRunningSessions,
|
|
64
|
-
registerActiveSession,
|
|
65
|
-
resetActiveSessions,
|
|
66
|
-
setActiveSessionAttention,
|
|
67
|
-
setActiveSessionConnection,
|
|
68
|
-
setActiveSessionError,
|
|
69
|
-
setActiveSessionRunning,
|
|
70
|
-
setForegroundActiveSession,
|
|
71
|
-
unregisterActiveSession,
|
|
72
|
-
updateActiveSessionMeta,
|
|
73
|
-
useActiveSession,
|
|
74
|
-
useActiveSessions,
|
|
75
|
-
useActiveSessionsState,
|
|
76
|
-
useHasBackgroundRunningSessions,
|
|
77
|
-
useNavbarSessions,
|
|
78
|
-
useProjectActivity,
|
|
79
|
-
useProjectSessions,
|
|
80
|
-
useSessionsByActivity,
|
|
81
|
-
useTotalRunningSessions,
|
|
82
|
-
addMessage,
|
|
83
|
-
addParts,
|
|
84
|
-
clearChat,
|
|
85
|
-
isStreamingAtom,
|
|
86
|
-
messagesAtom,
|
|
87
|
-
partMapAtom,
|
|
88
|
-
updatePart
|
|
89
|
-
};
|
package/dist/chunk-X3YXP7FG.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// src/utils/index.ts
|
|
2
|
-
import {
|
|
3
|
-
TOOL_CATEGORY_ICONS,
|
|
4
|
-
cn,
|
|
5
|
-
copyText,
|
|
6
|
-
focusField,
|
|
7
|
-
focusFieldInvalid,
|
|
8
|
-
focusFieldWithin,
|
|
9
|
-
focusRing,
|
|
10
|
-
focusRingInset,
|
|
11
|
-
formatBytes,
|
|
12
|
-
formatDuration,
|
|
13
|
-
formatUptime,
|
|
14
|
-
getToolCategory,
|
|
15
|
-
getToolDisplayMetadata,
|
|
16
|
-
getToolErrorText,
|
|
17
|
-
timeAgo,
|
|
18
|
-
truncateText
|
|
19
|
-
} from "@tangle-network/ui/utils";
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
TOOL_CATEGORY_ICONS,
|
|
23
|
-
cn,
|
|
24
|
-
copyText,
|
|
25
|
-
focusField,
|
|
26
|
-
focusFieldInvalid,
|
|
27
|
-
focusFieldWithin,
|
|
28
|
-
focusRing,
|
|
29
|
-
focusRingInset,
|
|
30
|
-
formatBytes,
|
|
31
|
-
formatDuration,
|
|
32
|
-
formatUptime,
|
|
33
|
-
getToolCategory,
|
|
34
|
-
getToolDisplayMetadata,
|
|
35
|
-
getToolErrorText,
|
|
36
|
-
timeAgo,
|
|
37
|
-
truncateText
|
|
38
|
-
};
|
package/dist/logo-DiAjq759.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface LogoProps {
|
|
4
|
-
variant?: "sandbox";
|
|
5
|
-
size?: "sm" | "md" | "lg" | "xl";
|
|
6
|
-
className?: string;
|
|
7
|
-
iconOnly?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/** Keep the Sandbox wordmark API while Brand owns the mark and layout. */
|
|
10
|
-
declare function Logo({ variant, size, className, iconOnly, }: LogoProps): React.JSX.Element;
|
|
11
|
-
declare namespace Logo {
|
|
12
|
-
var displayName: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { Logo as L, type LogoProps as a };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
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 a
|
|
46
|
-
* picker can surface those rows in a "Recommended" section at the top.
|
|
47
|
-
*/
|
|
48
|
-
featured?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Per-model reasoning capability, fed to the reasoning-effort picker's capability filter. Source it
|
|
51
|
-
* from your model catalog (e.g. the router's `supported_parameters` containing `reasoning`). When
|
|
52
|
-
* `false`, only `none` is offered for this model regardless of harness.
|
|
53
|
-
*/
|
|
54
|
-
supportsReasoning?: boolean;
|
|
55
|
-
/** The model's own reasoning ceiling, if narrower than its harness's (e.g. a model capped at `high`). */
|
|
56
|
-
maxReasoningEffort?: ReasoningEffort;
|
|
57
|
-
}
|
|
58
|
-
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";
|
|
59
|
-
interface ModelBrandIdentity {
|
|
60
|
-
host: ModelBrandInfo;
|
|
61
|
-
lab: ModelBrandInfo;
|
|
62
|
-
combined: boolean;
|
|
63
|
-
}
|
|
64
|
-
interface ModelBrandInfo {
|
|
65
|
-
key: ModelBrandKey;
|
|
66
|
-
label: string;
|
|
67
|
-
logoUrl?: string;
|
|
68
|
-
logo?: "tangle";
|
|
69
|
-
/**
|
|
70
|
-
* True for the bundled single-color brand glyphs, which are rendered as a
|
|
71
|
-
* CSS mask filled with the foreground token so they stay visible in both
|
|
72
|
-
* themes. Caller-supplied logo URLs (`ModelInfo.logos.*Url`) may be
|
|
73
|
-
* full-color artwork and are rendered as-is.
|
|
74
|
-
*/
|
|
75
|
-
monochrome?: boolean;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Resolve the canonical id for a model. Some upstreams already prefix the
|
|
79
|
-
* provider in the id (e.g. "anthropic/claude-haiku-4.5"); others put it in
|
|
80
|
-
* `_provider` and leave the id bare. Always returns "<provider>/<model>"
|
|
81
|
-
* unless the id is already prefixed.
|
|
82
|
-
*/
|
|
83
|
-
declare function canonicalModelId(model: ModelInfo): string;
|
|
84
|
-
/**
|
|
85
|
-
* The brand identity to show for a model id, or `null` when no published mark
|
|
86
|
-
* exists for it — a caller then falls back to its own generic glyph rather than
|
|
87
|
-
* rendering an empty chip or inventing a logo.
|
|
88
|
-
*
|
|
89
|
-
* Takes the bare id ("anthropic/claude-sonnet-4-5") so a surface that knows only
|
|
90
|
-
* the model string — a workflow node, a run header — can render the same mark the
|
|
91
|
-
* picker does.
|
|
92
|
-
*/
|
|
93
|
-
declare function modelBrandFor(model: string): ModelBrandIdentity | null;
|
|
94
|
-
declare function ModelBrandStack({ identity, size }: {
|
|
95
|
-
identity: ModelBrandIdentity;
|
|
96
|
-
size: "sm" | "md";
|
|
97
|
-
}): React.JSX.Element | null;
|
|
98
|
-
|
|
99
|
-
export { type ModelBrandIdentity as M, ModelBrandStack as a, type ModelInfo as b, canonicalModelId as c, modelBrandFor as m };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface ExposedPort {
|
|
4
|
-
port: number;
|
|
5
|
-
url: string;
|
|
6
|
-
status: "active" | "pending";
|
|
7
|
-
}
|
|
8
|
-
interface PortsListProps {
|
|
9
|
-
ports: ExposedPort[];
|
|
10
|
-
onExposePort: (port: number) => void;
|
|
11
|
-
onRemovePort?: (port: number) => void;
|
|
12
|
-
isExposing?: boolean;
|
|
13
|
-
className?: string;
|
|
14
|
-
}
|
|
15
|
-
declare function PortsList({ ports, onExposePort, onRemovePort, isExposing, className }: PortsListProps): React.JSX.Element;
|
|
16
|
-
|
|
17
|
-
export { type ExposedPort as E, PortsList as P, type PortsListProps as a };
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import '@tangle-network/ui/sdk-hooks';
|
|
2
|
-
import { ReasoningEffort } from '@tangle-network/agent-interface';
|
|
3
|
-
import { SessionMessage, SessionPart } from '@tangle-network/ui/types';
|
|
4
|
-
|
|
5
|
-
/** Minimal session info returned by the listing API. */
|
|
6
|
-
interface SessionInfo {
|
|
7
|
-
id: string;
|
|
8
|
-
title: string;
|
|
9
|
-
parentID?: string;
|
|
10
|
-
}
|
|
11
|
-
interface UseSessionStreamOptions {
|
|
12
|
-
/** Base URL of the session proxy (e.g. "http://localhost:9100"). */
|
|
13
|
-
apiUrl: string;
|
|
14
|
-
/** Bearer token for authentication. */
|
|
15
|
-
token: string | null;
|
|
16
|
-
/** Session ID to stream events for. */
|
|
17
|
-
sessionId: string;
|
|
18
|
-
/** Only connect when true. Defaults to true. */
|
|
19
|
-
enabled?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Per-message overrides forwarded to the sidecar's send-message endpoint.
|
|
23
|
-
* Every field is optional — omitted fields fall back to the session's
|
|
24
|
-
* backend configuration. Matches `SendMessageRequestSchema` on the sidecar.
|
|
25
|
-
*/
|
|
26
|
-
interface SendMessageOptions {
|
|
27
|
-
/** Backend agent identifier override (e.g. a named opencode agent). */
|
|
28
|
-
agent?: string;
|
|
29
|
-
/** Per-turn model override; session backend supplies apiKey/baseUrl. */
|
|
30
|
-
model?: {
|
|
31
|
-
providerID: string;
|
|
32
|
-
modelID: string;
|
|
33
|
-
};
|
|
34
|
-
/** Per-turn system prompt override. */
|
|
35
|
-
system?: string;
|
|
36
|
-
/** Thinking-effort hint; the sidecar maps it to a thinking-token budget. The full canonical
|
|
37
|
-
* `ReasoningEffort` (`@tangle-network/agent-interface`) — the UI shows only the levels the
|
|
38
|
-
* selected harness/model actually supports (a capability filter), never a hard-coded subset. */
|
|
39
|
-
reasoningEffort?: ReasoningEffort;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* A sandbox-level condition that degrades the session without ending it.
|
|
43
|
-
*
|
|
44
|
-
* Distinct from `error`, which reports a turn that failed: the session here is
|
|
45
|
-
* running and will answer, it is just missing something the caller asked for.
|
|
46
|
-
* Reported separately so it is not cleared by the next successful turn — the
|
|
47
|
-
* condition outlives the turn that revealed it.
|
|
48
|
-
*/
|
|
49
|
-
interface SessionDegradation {
|
|
50
|
-
/** Which capability is degraded. A union so this can grow without a break. */
|
|
51
|
-
readonly kind: 'hub-connections';
|
|
52
|
-
/** Machine-readable cause. */
|
|
53
|
-
readonly reason: string;
|
|
54
|
-
/** Operator/user-facing sentence, authored by the sidecar. */
|
|
55
|
-
readonly message: string;
|
|
56
|
-
/**
|
|
57
|
-
* What the session asked for, NOT how much it lost.
|
|
58
|
-
*
|
|
59
|
-
* There is deliberately no count of missing integrations: the sidecar reaches
|
|
60
|
-
* this state only for an attach-all request, and the call that would
|
|
61
|
-
* enumerate the tenant's connections is the one that failed authentication.
|
|
62
|
-
* Any number rendered here would be fabricated.
|
|
63
|
-
*/
|
|
64
|
-
readonly requestShape: string;
|
|
65
|
-
}
|
|
66
|
-
interface UseSessionStreamResult {
|
|
67
|
-
/** All messages in the session (fetched + streaming). */
|
|
68
|
-
messages: SessionMessage[];
|
|
69
|
-
/** Part map: messageId → SessionPart[]. */
|
|
70
|
-
partMap: Record<string, SessionPart[]>;
|
|
71
|
-
/** Whether the agent is currently streaming a response. */
|
|
72
|
-
isStreaming: boolean;
|
|
73
|
-
/** Send a text message to the agent, with optional per-turn overrides. */
|
|
74
|
-
send: (text: string, options?: SendMessageOptions) => Promise<void>;
|
|
75
|
-
/** Abort the current agent execution. */
|
|
76
|
-
abort: () => Promise<void>;
|
|
77
|
-
/** Refetch full message history from the API. */
|
|
78
|
-
refetch: () => Promise<void>;
|
|
79
|
-
/** Connection or stream error, if any. */
|
|
80
|
-
error: string | null;
|
|
81
|
-
/** Whether the SSE connection is active. */
|
|
82
|
-
connected: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* The degradation currently reported for THIS session, or `null`.
|
|
85
|
-
*
|
|
86
|
-
* Today the only one is a Hub credential the sandbox could not present, which
|
|
87
|
-
* leaves the agent with an EMPTY toolbelt while the session otherwise runs
|
|
88
|
-
* normally. Without surfacing it, that state is indistinguishable to the user
|
|
89
|
-
* from having connected no integrations at all — so a caller that renders a
|
|
90
|
-
* transcript should render this too.
|
|
91
|
-
*
|
|
92
|
-
* Seeded from session status rather than derived from the live stream alone:
|
|
93
|
-
* the sidecar's bus never replays, so a reload — or attaching a beat after
|
|
94
|
-
* spawn — would otherwise show a normal-looking session with no tools and no
|
|
95
|
-
* explanation. Live frames update it, and a recovered credential clears it.
|
|
96
|
-
*/
|
|
97
|
-
degradation: SessionDegradation | null;
|
|
98
|
-
}
|
|
99
|
-
declare class SessionStreamError extends Error {
|
|
100
|
-
readonly code: string;
|
|
101
|
-
readonly status?: number;
|
|
102
|
-
constructor(code: string, message: string, status?: number);
|
|
103
|
-
}
|
|
104
|
-
declare const SESSION_STREAM_RECONNECT_DELAY_MS = 1000;
|
|
105
|
-
/**
|
|
106
|
-
* Streams chat messages from a sidecar session gateway via SSE.
|
|
107
|
-
*
|
|
108
|
-
* Fetches existing message history on mount, then subscribes to SSE for
|
|
109
|
-
* real-time updates. Maps the sidecar's message format to agent-ui's
|
|
110
|
-
* SessionMessage + partMap format.
|
|
111
|
-
*/
|
|
112
|
-
declare function useSessionStream({ apiUrl, token, sessionId, enabled, }: UseSessionStreamOptions): UseSessionStreamResult;
|
|
113
|
-
|
|
114
|
-
interface UseSidecarAuthOptions {
|
|
115
|
-
/** Scoping key for token storage (e.g. botId, sandboxId). */
|
|
116
|
-
resourceId: string;
|
|
117
|
-
/** Base URL of the sidecar or operator API. */
|
|
118
|
-
apiUrl: string;
|
|
119
|
-
/**
|
|
120
|
-
* Sign a plaintext message and return the hex signature.
|
|
121
|
-
* Consuming apps wire this to their wallet library (e.g. wagmi's signMessageAsync).
|
|
122
|
-
*/
|
|
123
|
-
signMessage: (message: string) => Promise<string>;
|
|
124
|
-
}
|
|
125
|
-
interface SidecarAuth {
|
|
126
|
-
token: string | null;
|
|
127
|
-
isAuthenticated: boolean;
|
|
128
|
-
isAuthenticating: boolean;
|
|
129
|
-
authenticate: () => Promise<string | null>;
|
|
130
|
-
clearCachedToken: () => void;
|
|
131
|
-
error: string | null;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Generic sidecar PASETO challenge/response auth.
|
|
135
|
-
*
|
|
136
|
-
* Flow:
|
|
137
|
-
* 1. POST /api/auth/challenge → { nonce, message, expires_at }
|
|
138
|
-
* 2. signMessage(message) → signature (provided by consuming app)
|
|
139
|
-
* 3. POST /api/auth/session → { token, address, expires_at }
|
|
140
|
-
*
|
|
141
|
-
* Tokens are cached in localStorage and auto-refreshed 5 minutes before expiry.
|
|
142
|
-
*/
|
|
143
|
-
declare function useSidecarAuth({ resourceId, apiUrl, signMessage }: UseSidecarAuthOptions): SidecarAuth;
|
|
144
|
-
|
|
145
|
-
export { type SessionDegradation as S, type UseSessionStreamOptions as U, type SessionInfo as a, type SidecarAuth as b, type UseSessionStreamResult as c, type UseSidecarAuthOptions as d, useSidecarAuth as e, SESSION_STREAM_RECONNECT_DELAY_MS as f, type SendMessageOptions as g, SessionStreamError as h, useSessionStream as u };
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
interface BillingSubscription {
|
|
4
|
-
status: string;
|
|
5
|
-
tierName: string;
|
|
6
|
-
renewsAt: string;
|
|
7
|
-
}
|
|
8
|
-
interface BillingBalance {
|
|
9
|
-
available: number;
|
|
10
|
-
used: number;
|
|
11
|
-
}
|
|
12
|
-
interface BillingUsage {
|
|
13
|
-
period: string;
|
|
14
|
-
total: number;
|
|
15
|
-
byModel: Record<string, number>;
|
|
16
|
-
}
|
|
17
|
-
interface BillingDashboardProps {
|
|
18
|
-
subscription: BillingSubscription | null;
|
|
19
|
-
balance: BillingBalance;
|
|
20
|
-
usage: BillingUsage;
|
|
21
|
-
onManageSubscription: () => void;
|
|
22
|
-
onAddCredits: () => void;
|
|
23
|
-
variant?: "sandbox";
|
|
24
|
-
className?: string;
|
|
25
|
-
cardClassName?: string;
|
|
26
|
-
}
|
|
27
|
-
declare function BillingDashboard({ subscription, balance, usage, onManageSubscription, onAddCredits, variant, className, cardClassName, }: BillingDashboardProps): React.JSX.Element;
|
|
28
|
-
|
|
29
|
-
interface PricingTier {
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
description: string;
|
|
33
|
-
monthlyPriceCents: number;
|
|
34
|
-
yearlyPriceCents?: number;
|
|
35
|
-
features: string[];
|
|
36
|
-
recommended?: boolean;
|
|
37
|
-
creditsPerMonth?: number;
|
|
38
|
-
monthlyPriceId?: string;
|
|
39
|
-
yearlyPriceId?: string;
|
|
40
|
-
}
|
|
41
|
-
interface PricingPageProps {
|
|
42
|
-
tiers: PricingTier[];
|
|
43
|
-
currentTierId?: string;
|
|
44
|
-
billingPeriod: "monthly" | "yearly";
|
|
45
|
-
onBillingPeriodChange: (period: "monthly" | "yearly") => void;
|
|
46
|
-
onSelectTier: (tierId: string) => void;
|
|
47
|
-
variant?: "sandbox";
|
|
48
|
-
loading?: boolean;
|
|
49
|
-
className?: string;
|
|
50
|
-
cardClassName?: string;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Formats an integer cent amount as a human-readable USD price.
|
|
54
|
-
* Whole-dollar amounts omit decimals ($10), fractional amounts show two ($10.99).
|
|
55
|
-
* Returns "$0" for non-finite or negative inputs.
|
|
56
|
-
* @param cents - Amount in whole US cents (e.g. 1099 for $10.99).
|
|
57
|
-
*/
|
|
58
|
-
declare function formatPrice(cents: number): string;
|
|
59
|
-
declare function PricingPage({ tiers, currentTierId, billingPeriod, onBillingPeriodChange, onSelectTier, loading, className, }: PricingPageProps): React.JSX.Element;
|
|
60
|
-
|
|
61
|
-
interface UsageDataPoint {
|
|
62
|
-
date: string;
|
|
63
|
-
value: number;
|
|
64
|
-
}
|
|
65
|
-
interface UsageChartProps {
|
|
66
|
-
data: UsageDataPoint[];
|
|
67
|
-
title: string;
|
|
68
|
-
unit: string;
|
|
69
|
-
className?: string;
|
|
70
|
-
}
|
|
71
|
-
declare function UsageChart({ data, title, unit, className }: UsageChartProps): React.JSX.Element;
|
|
72
|
-
|
|
73
|
-
interface TemplateCardData {
|
|
74
|
-
id: string;
|
|
75
|
-
name: string;
|
|
76
|
-
description: string;
|
|
77
|
-
icon?: React.ReactNode;
|
|
78
|
-
tags?: string[];
|
|
79
|
-
}
|
|
80
|
-
interface TemplateCardProps {
|
|
81
|
-
template: TemplateCardData;
|
|
82
|
-
onUseTemplate: (templateId: string) => void;
|
|
83
|
-
className?: string;
|
|
84
|
-
}
|
|
85
|
-
declare function TemplateCard({ template, onUseTemplate, className }: TemplateCardProps): React.JSX.Element;
|
|
86
|
-
|
|
87
|
-
export { type BillingBalance as B, PricingPage as P, TemplateCard as T, UsageChart as U, BillingDashboard as a, type BillingDashboardProps as b, type BillingSubscription as c, type BillingUsage as d, type PricingPageProps as e, type PricingTier as f, type TemplateCardData as g, type TemplateCardProps as h, type UsageChartProps as i, type UsageDataPoint as j, formatPrice as k };
|