@tangle-network/sandbox-ui 0.15.1 → 0.15.2
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/chunk-ENMWGVDL.js +858 -0
- package/dist/{chunk-AHBZCBDO.js → chunk-HLZTKSGT.js} +397 -705
- package/dist/dashboard.d.ts +2 -90
- package/dist/dashboard.js +7 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -7
- package/dist/pages.d.ts +13 -11
- package/dist/pages.js +24 -50
- package/dist/template-card-DStb8boW.d.ts +183 -0
- package/package.json +1 -1
- package/dist/chunk-DNZ4DTNA.js +0 -547
- package/dist/template-card-UhV3pmRC.d.ts +0 -88
package/dist/dashboard.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export { B as BillingBalance, a as BillingDashboard, b as BillingDashboardProps, c as BillingSubscription, d as BillingUsage, P as PricingPage,
|
|
3
|
+
export { B as BillingBalance, a as BillingDashboard, b as BillingDashboardProps, c as BillingSubscription, d as BillingUsage, M as ModelInfo, e as ModelPicker, f as ModelPickerProps, g as ModelPickerVariant, h as ModelPreset, P as PricingPage, i as PricingPageProps, j as PricingTier, T as TemplateCard, k as TemplateCardData, l as TemplateCardProps, U as UsageChart, m as UsageChartProps, n as UsageDataPoint, o as canonicalModelId, p as formatContext, q as formatPrice, r as formatPricing } from './template-card-DStb8boW.js';
|
|
4
4
|
|
|
5
5
|
interface SidebarUser {
|
|
6
6
|
email: string;
|
|
@@ -320,94 +320,6 @@ interface HarnessPickerProps extends Omit<BackendSelectorProps, "backends" | "se
|
|
|
320
320
|
*/
|
|
321
321
|
declare function HarnessPicker({ value, onChange, available, optionsOverride, label, ...rest }: HarnessPickerProps): react_jsx_runtime.JSX.Element;
|
|
322
322
|
|
|
323
|
-
/**
|
|
324
|
-
* Wire-format model entry as returned by `/v1/models` on the Tangle Router
|
|
325
|
-
* (and most OpenAI-compatible gateways). Field names match the upstream
|
|
326
|
-
* response so consumers can pass `data.data` straight through.
|
|
327
|
-
*/
|
|
328
|
-
interface ModelInfo {
|
|
329
|
-
/** Provider-local id, e.g. "gpt-5.4" or "anthropic/claude-sonnet-4-6". */
|
|
330
|
-
id: string;
|
|
331
|
-
/** Human label (defaults to id if absent). */
|
|
332
|
-
name?: string;
|
|
333
|
-
/** Provider key, e.g. "openai", "anthropic". Underscored for compat with router. */
|
|
334
|
-
_provider?: string;
|
|
335
|
-
/** Alternative provider field on some gateways. */
|
|
336
|
-
provider?: string;
|
|
337
|
-
/**
|
|
338
|
-
* Per-token prices in USD as decimal strings. Multiply by 1_000_000 for
|
|
339
|
-
* the conventional $/M tokens display.
|
|
340
|
-
*/
|
|
341
|
-
pricing?: {
|
|
342
|
-
prompt?: string | null;
|
|
343
|
-
completion?: string | null;
|
|
344
|
-
};
|
|
345
|
-
context_length?: number;
|
|
346
|
-
description?: string | null;
|
|
347
|
-
architecture?: {
|
|
348
|
-
modality?: string;
|
|
349
|
-
input_modalities?: string[];
|
|
350
|
-
output_modalities?: string[];
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Curated preset bucket. Three are surfaced by default — they map to typical
|
|
355
|
-
* cost/quality tradeoffs without forcing the consumer to pick a specific
|
|
356
|
-
* model. `match` resolves the preset against the loaded model list.
|
|
357
|
-
*/
|
|
358
|
-
interface ModelPreset {
|
|
359
|
-
id: "fast" | "balanced" | "best" | string;
|
|
360
|
-
label: string;
|
|
361
|
-
hint: string;
|
|
362
|
-
icon?: React.ComponentType<{
|
|
363
|
-
className?: string;
|
|
364
|
-
}>;
|
|
365
|
-
/**
|
|
366
|
-
* Pick the canonical model id for this preset given the loaded list.
|
|
367
|
-
* Should return undefined if no acceptable model is loaded yet.
|
|
368
|
-
*/
|
|
369
|
-
match: (models: ModelInfo[]) => string | undefined;
|
|
370
|
-
}
|
|
371
|
-
type ModelPickerVariant = "field" | "pill";
|
|
372
|
-
interface ModelPickerProps {
|
|
373
|
-
/** Canonical model id (provider-prefixed, e.g. "openai/gpt-5.4"). */
|
|
374
|
-
value: string;
|
|
375
|
-
onChange: (modelId: string) => void;
|
|
376
|
-
/** Models to choose from. Pass `[]` while loading. */
|
|
377
|
-
models: ModelInfo[];
|
|
378
|
-
/** Show the loading state (overrides empty-list copy). */
|
|
379
|
-
loading?: boolean;
|
|
380
|
-
/** Recently-used canonical ids to surface at the top. */
|
|
381
|
-
recents?: ReadonlyArray<string>;
|
|
382
|
-
/**
|
|
383
|
-
* Curated presets shown above the full list. Defaults to Fast/Balanced/Best
|
|
384
|
-
* resolved against common gpt-5/Claude families.
|
|
385
|
-
*/
|
|
386
|
-
presets?: ReadonlyArray<ModelPreset>;
|
|
387
|
-
/** Drop providers from the picker entirely (e.g. "audio", "embedding"). */
|
|
388
|
-
excludeProviders?: ReadonlyArray<string>;
|
|
389
|
-
/** Restrict to these architectures (e.g. ["text"]). Default: all. */
|
|
390
|
-
modalities?: ReadonlyArray<string>;
|
|
391
|
-
/** Trigger appearance. "field" = full-width form field; "pill" = inline chat input pill. */
|
|
392
|
-
variant?: ModelPickerVariant;
|
|
393
|
-
label?: string;
|
|
394
|
-
placeholder?: string;
|
|
395
|
-
className?: string;
|
|
396
|
-
disabled?: boolean;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* Resolve the canonical id for a model. Some upstreams already prefix the
|
|
400
|
-
* provider in the id (e.g. "anthropic/claude-haiku-4.5"); others put it in
|
|
401
|
-
* `_provider` and leave the id bare. Always returns "<provider>/<model>"
|
|
402
|
-
* unless the id is already prefixed.
|
|
403
|
-
*/
|
|
404
|
-
declare function canonicalModelId(model: ModelInfo): string;
|
|
405
|
-
/** Format $/M tokens. Returns null if pricing is missing or zero. */
|
|
406
|
-
declare function formatPricing(pricing: ModelInfo["pricing"]): string | null;
|
|
407
|
-
/** Format context length compactly (e.g. 200_000 → "200k"). */
|
|
408
|
-
declare function formatContext(ctx: number | undefined): string | null;
|
|
409
|
-
declare function ModelPicker({ value, onChange, models, loading, recents, presets, excludeProviders, modalities, variant, label, placeholder, className, disabled, }: ModelPickerProps): react_jsx_runtime.JSX.Element;
|
|
410
|
-
|
|
411
323
|
type ProductVariant = "sandbox";
|
|
412
324
|
interface NavItem {
|
|
413
325
|
id: string;
|
|
@@ -688,4 +600,4 @@ interface InfoPanelProps {
|
|
|
688
600
|
}
|
|
689
601
|
declare function InfoPanel({ label, title, description, className }: InfoPanelProps): react_jsx_runtime.JSX.Element;
|
|
690
602
|
|
|
691
|
-
export { type Backend, BackendConfig, type BackendConfigProps, BackendSelector, type BackendSelectorProps, type BackendStatusData, ClusterStatusBar, type ClusterStatusBarProps, type ClusterStatusItem, CreditBalance, type CreditBalanceProps, DashboardLayout, type DashboardLayoutProps, type Profile as DashboardProfile, type SnapshotInfo as DashboardSnapshotInfo, type DashboardUser, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, HARNESS_OPTIONS, HarnessPicker, type HarnessPickerProps, type HarnessType, InfoPanel, type InfoPanelProps, type Invoice, InvoiceTable, type InvoiceTableProps, type McpServer, type
|
|
603
|
+
export { type Backend, BackendConfig, type BackendConfigProps, BackendSelector, type BackendSelectorProps, type BackendStatusData, ClusterStatusBar, type ClusterStatusBarProps, type ClusterStatusItem, CreditBalance, type CreditBalanceProps, DashboardLayout, type DashboardLayoutProps, type Profile as DashboardProfile, type SnapshotInfo as DashboardSnapshotInfo, type DashboardUser, type ExposedPort, type GitCommitData, GitPanel, type GitPanelProps, type GitStatusData, HARNESS_OPTIONS, HarnessPicker, type HarnessPickerProps, type HarnessType, InfoPanel, type InfoPanelProps, type Invoice, InvoiceTable, type InvoiceTableProps, type McpServer, type NavItem, NetworkConfig, type NetworkConfigData, type NetworkConfigProps, NewSandboxCard, type NewSandboxCardProps, type PlanCardData, PlanCards, type PlanCardsProps, type PlanFeature, PortsList, type PortsListProps, type ProcessInfo, ProcessList, type ProcessListProps, type ProductVariant, ProfileAvatar, type ProfileAvatarProps, ProfileComparison, type ProfileComparisonProps, ProfileSelector, type ProfileSelectorProps, PromoBanner, type PromoBannerProps, RailButton, type RailButtonProps, RailModeButton, type RailModeButtonProps, RailSeparator, type RailSeparatorProps, ResourceMeter, type ResourceMeterProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, type SandboxCardData, type SandboxCardProps, type SandboxStatus, SandboxTable, type SandboxTableProps, Sidebar, SidebarContent, type SidebarContentProps, SidebarPanel, SidebarPanelContent, type SidebarPanelContentProps, SidebarPanelHeader, type SidebarPanelHeaderProps, type SidebarPanelProps, type SidebarProps, SidebarProvider, type SidebarProviderProps, SidebarRail, SidebarRailFooter, type SidebarRailFooterProps, SidebarRailHeader, type SidebarRailHeaderProps, SidebarRailNav, type SidebarRailNavProps, type SidebarRailProps, type SidebarUser, SnapshotList, type SnapshotListProps, SystemLogsViewer, type SystemLogsViewerProps, type TeamRole, UsageSummary, type UsageSummaryData, type UsageSummaryProps, type Variant, VariantList, type VariantListProps, type VariantOutcome, type VariantStatus, canAdminSandbox, useSidebar };
|
package/dist/dashboard.js
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
HARNESS_OPTIONS,
|
|
9
9
|
HarnessPicker,
|
|
10
10
|
InvoiceTable,
|
|
11
|
-
ModelPicker,
|
|
12
11
|
NetworkConfig,
|
|
13
12
|
NewSandboxCard,
|
|
14
13
|
PlanCards,
|
|
@@ -43,19 +42,20 @@ import {
|
|
|
43
42
|
UsageSummary,
|
|
44
43
|
VariantList,
|
|
45
44
|
canAdminSandbox,
|
|
46
|
-
canonicalModelId,
|
|
47
|
-
formatContext,
|
|
48
|
-
formatPricing,
|
|
49
45
|
useSidebar
|
|
50
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-HLZTKSGT.js";
|
|
51
47
|
import {
|
|
52
48
|
BillingDashboard,
|
|
53
49
|
InfoPanel,
|
|
50
|
+
ModelPicker,
|
|
54
51
|
PricingPage,
|
|
55
52
|
TemplateCard,
|
|
56
53
|
UsageChart,
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
canonicalModelId,
|
|
55
|
+
formatContext,
|
|
56
|
+
formatPrice,
|
|
57
|
+
formatPricing
|
|
58
|
+
} from "./chunk-ENMWGVDL.js";
|
|
59
59
|
import "./chunk-7ZA5SEK3.js";
|
|
60
60
|
import "./chunk-EI44GEQ5.js";
|
|
61
61
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export { Collaborator, CollaboratorsList, ConnectionState, DocumentEditorBackend
|
|
|
8
8
|
export { ExpandedToolDetail, ExpandedToolDetailProps, InlineThinkingItem, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps } from '@tangle-network/ui/run';
|
|
9
9
|
export { CommandPreview, DiffPreview, GlobResultsPreview, GrepResultsPreview, QuestionPreview, WebSearchPreview, WriteFilePreview } from '@tangle-network/ui/tool-previews';
|
|
10
10
|
export { FileArtifactPane, FileArtifactPaneProps, FileNode, FilePreview, FilePreviewProps, FileTabData, FileTabs, FileTabsProps, FileTree, FileTreeProps, FileTreeVisibilityOptions, RichFileTree, RichFileTreeGitEntry, RichFileTreeGitStatus, RichFileTreeProps, RichFileTreeThemeVars, filterFileTree } from '@tangle-network/ui/files';
|
|
11
|
-
export { Backend, BackendConfig, BackendConfigProps, BackendSelector, BackendSelectorProps, BackendStatusData, ClusterStatusBar, ClusterStatusBarProps, ClusterStatusItem, CreditBalance, CreditBalanceProps, DashboardLayout, DashboardLayoutProps, DashboardProfile, DashboardSnapshotInfo, DashboardUser, ExposedPort, GitCommitData, GitPanel, GitPanelProps, GitStatusData, HARNESS_OPTIONS, HarnessPicker, HarnessPickerProps, HarnessType, InfoPanel, InfoPanelProps, Invoice, InvoiceTable, InvoiceTableProps, McpServer,
|
|
12
|
-
export { B as BillingBalance, a as BillingDashboard, b as BillingDashboardProps, c as BillingSubscription, d as BillingUsage, P as PricingPage,
|
|
11
|
+
export { Backend, BackendConfig, BackendConfigProps, BackendSelector, BackendSelectorProps, BackendStatusData, ClusterStatusBar, ClusterStatusBarProps, ClusterStatusItem, CreditBalance, CreditBalanceProps, DashboardLayout, DashboardLayoutProps, DashboardProfile, DashboardSnapshotInfo, DashboardUser, ExposedPort, GitCommitData, GitPanel, GitPanelProps, GitStatusData, HARNESS_OPTIONS, HarnessPicker, HarnessPickerProps, HarnessType, InfoPanel, InfoPanelProps, Invoice, InvoiceTable, InvoiceTableProps, McpServer, NavItem, NetworkConfig, NetworkConfigData, NetworkConfigProps, NewSandboxCard, NewSandboxCardProps, PlanCardData, PlanCards, PlanCardsProps, PlanFeature, PortsList, PortsListProps, ProcessInfo, ProcessList, ProcessListProps, ProductVariant, ProfileAvatar, ProfileAvatarProps, ProfileComparison, ProfileComparisonProps, ProfileSelector, ProfileSelectorProps, PromoBanner, PromoBannerProps, RailButton, RailButtonProps, RailModeButton, RailModeButtonProps, RailSeparator, RailSeparatorProps, ResourceMeter, ResourceMeterProps, SIDEBAR_MOBILE_WIDTH, SIDEBAR_PANEL_WIDTH, SIDEBAR_RAIL_WIDTH, SIDEBAR_TOTAL_WIDTH, SandboxCard, SandboxCardData, SandboxCardProps, SandboxStatus, SandboxTable, SandboxTableProps, Sidebar, SidebarContent, SidebarContentProps, SidebarPanel, SidebarPanelContent, SidebarPanelContentProps, SidebarPanelHeader, SidebarPanelHeaderProps, SidebarPanelProps, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarRail, SidebarRailFooter, SidebarRailFooterProps, SidebarRailHeader, SidebarRailHeaderProps, SidebarRailNav, SidebarRailNavProps, SidebarRailProps, SidebarUser, SnapshotList, SnapshotListProps, SystemLogsViewer, SystemLogsViewerProps, TeamRole, UsageSummary, UsageSummaryData, UsageSummaryProps, Variant, VariantList, VariantListProps, VariantOutcome, VariantStatus, canAdminSandbox, useSidebar } from './dashboard.js';
|
|
12
|
+
export { B as BillingBalance, a as BillingDashboard, b as BillingDashboardProps, c as BillingSubscription, d as BillingUsage, M as ModelInfo, e as ModelPicker, f as ModelPickerProps, g as ModelPickerVariant, h as ModelPreset, P as PricingPage, i as PricingPageProps, j as PricingTier, T as TemplateCard, k as TemplateCardData, l as TemplateCardProps, U as UsageChart, m as UsageChartProps, n as UsageDataPoint, o as canonicalModelId, p as formatContext, q as formatPrice, r as formatPricing } from './template-card-DStb8boW.js';
|
|
13
13
|
export { AuthHeader, AuthHeaderProps, GitHubLoginButton, GitHubLoginButtonProps, LoginLayout, LoginLayoutProps, SessionUser, UserMenu, UserMenuProps } from '@tangle-network/ui/auth';
|
|
14
14
|
export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AuthUser, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useLiveTime, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useToolCallStream } from '@tangle-network/ui/hooks';
|
|
15
15
|
export { SandboxMetrics, SidecarMetricsPayload, UsePtySessionOptions, UsePtySessionReturn, UseSandboxMetricsOptions, UseSandboxMetricsResult, useCreateSession, useDeleteSession, usePtySession, useRenameSession, useSandboxMetrics, useSessions } from './hooks.js';
|
package/dist/index.js
CHANGED
|
@@ -153,7 +153,6 @@ import {
|
|
|
153
153
|
HARNESS_OPTIONS,
|
|
154
154
|
HarnessPicker,
|
|
155
155
|
InvoiceTable,
|
|
156
|
-
ModelPicker,
|
|
157
156
|
NetworkConfig,
|
|
158
157
|
NewSandboxCard,
|
|
159
158
|
PlanCards,
|
|
@@ -188,19 +187,20 @@ import {
|
|
|
188
187
|
UsageSummary,
|
|
189
188
|
VariantList,
|
|
190
189
|
canAdminSandbox,
|
|
191
|
-
canonicalModelId,
|
|
192
|
-
formatContext,
|
|
193
|
-
formatPricing,
|
|
194
190
|
useSidebar
|
|
195
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-HLZTKSGT.js";
|
|
196
192
|
import {
|
|
197
193
|
BillingDashboard,
|
|
198
194
|
InfoPanel,
|
|
195
|
+
ModelPicker,
|
|
199
196
|
PricingPage,
|
|
200
197
|
TemplateCard,
|
|
201
198
|
UsageChart,
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
canonicalModelId,
|
|
200
|
+
formatContext,
|
|
201
|
+
formatPrice,
|
|
202
|
+
formatPricing
|
|
203
|
+
} from "./chunk-ENMWGVDL.js";
|
|
204
204
|
import {
|
|
205
205
|
Avatar,
|
|
206
206
|
AvatarFallback,
|
package/dist/pages.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { c as BillingSubscription, B as BillingBalance, d as BillingUsage,
|
|
2
|
+
import { c as BillingSubscription, B as BillingBalance, d as BillingUsage, n as UsageDataPoint, j as PricingTier, M as ModelInfo, k as TemplateCardData } from './template-card-DStb8boW.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
type ProductVariant$1 = "sandbox";
|
|
@@ -38,11 +38,6 @@ interface ResourceLimits {
|
|
|
38
38
|
ramMaxGB?: number;
|
|
39
39
|
storageMaxGB?: number;
|
|
40
40
|
}
|
|
41
|
-
interface ModelOption {
|
|
42
|
-
value: string;
|
|
43
|
-
label: string;
|
|
44
|
-
disabled?: boolean;
|
|
45
|
-
}
|
|
46
41
|
interface PricingRates {
|
|
47
42
|
cpuPerHr: number;
|
|
48
43
|
ramPerGbHr: number;
|
|
@@ -81,8 +76,15 @@ interface ProvisioningWizardProps {
|
|
|
81
76
|
onLoadStartupScripts?: () => Promise<StartupScriptEntry[]>;
|
|
82
77
|
/** Plan-based resource limits — caps the slider maximums */
|
|
83
78
|
resourceLimits?: ResourceLimits;
|
|
84
|
-
/**
|
|
85
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Models to surface in step 3, typically the wire-format payload from
|
|
81
|
+
* Tangle Router's `/v1/models`. The wizard stores the canonical id
|
|
82
|
+
* (`<provider>/<model>`) on `ProvisioningConfig.modelTier`, which is
|
|
83
|
+
* the same shape the API expects for `backend.model.model`. While the
|
|
84
|
+
* list is empty (e.g. router fetch in flight) the picker renders a
|
|
85
|
+
* disabled trigger with "no models available" copy.
|
|
86
|
+
*/
|
|
87
|
+
models?: ModelInfo[];
|
|
86
88
|
/** Real pricing rates from the API for accurate cost calculation */
|
|
87
89
|
pricingRates?: PricingRates;
|
|
88
90
|
/**
|
|
@@ -117,7 +119,7 @@ interface ProvisioningConfig {
|
|
|
117
119
|
startupScriptIds?: string[];
|
|
118
120
|
}
|
|
119
121
|
declare function resolveEnvironment(env: EnvironmentEntry): EnvironmentOption;
|
|
120
|
-
declare function ProvisioningWizard({ environments: environmentsProp, onLoadEnvironments, onSubmit, onBack, className, variant, defaultEnvironment, defaultConfig, skipToReview, onLoadStartupScripts, resourceLimits,
|
|
122
|
+
declare function ProvisioningWizard({ environments: environmentsProp, onLoadEnvironments, onSubmit, onBack, className, variant, defaultEnvironment, defaultConfig, skipToReview, onLoadStartupScripts, resourceLimits, models, pricingRates, planTiers, }: ProvisioningWizardProps): react_jsx_runtime.JSX.Element;
|
|
121
123
|
|
|
122
124
|
type ProductVariant = "sandbox";
|
|
123
125
|
interface StandalonePricingPageProps {
|
|
@@ -280,7 +282,7 @@ interface StartupScriptsPageProps {
|
|
|
280
282
|
declare function StartupScriptsPage({ apiClient, className }: StartupScriptsPageProps): react_jsx_runtime.JSX.Element;
|
|
281
283
|
|
|
282
284
|
type TemplateCategory = "blockchain" | "ai-ml" | "frontend" | "infrastructure" | "general";
|
|
283
|
-
type TemplatePreset = Omit<ProvisioningConfig, "name" | "gitUrl" | "envVars" | "driver" | "startupScriptIds">;
|
|
285
|
+
type TemplatePreset = Omit<ProvisioningConfig, "name" | "gitUrl" | "envVars" | "driver" | "startupScriptIds" | "modelTier">;
|
|
284
286
|
declare function getPresetForTemplate(id: string): TemplatePreset;
|
|
285
287
|
|
|
286
|
-
export { BillingPage, type BillingPageData, type BillingPageProps, type EnvironmentEntry, type EnvironmentOption,
|
|
288
|
+
export { BillingPage, type BillingPageData, type BillingPageProps, type EnvironmentEntry, type EnvironmentOption, ModelInfo, type PlanTierInfo, type PricingRates, PricingTier, type ProductVariant$1 as ProductVariant, type Profile, type ProfileFormData, type ProfileMetrics, ProfilesPage, type ProfilesPageProps, type ProvisioningConfig, ProvisioningWizard, type ProvisioningWizardProps, type ResourceLimits, type ScriptType, type Secret, type SecretsApiClient, SecretsPage, type SecretsPageProps, StandalonePricingPage, type StandalonePricingPageProps, type StartupScript, type StartupScriptEntry, type StartupScriptFormData, type StartupScriptsApiClient, StartupScriptsPage, type StartupScriptsPageProps, type TemplateCategory, type TemplatePreset, TemplatesPage, type TemplatesPageProps, getPresetForTemplate, resolveEnvironment };
|
package/dist/pages.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BillingDashboard,
|
|
3
3
|
InfoPanel,
|
|
4
|
+
ModelPicker,
|
|
4
5
|
PricingPage,
|
|
5
6
|
TemplateCard,
|
|
6
|
-
UsageChart
|
|
7
|
-
|
|
7
|
+
UsageChart,
|
|
8
|
+
canonicalModelId
|
|
9
|
+
} from "./chunk-ENMWGVDL.js";
|
|
8
10
|
import {
|
|
9
11
|
cn
|
|
10
12
|
} from "./chunk-EI44GEQ5.js";
|
|
@@ -287,10 +289,6 @@ var VALID_DRIVERS = /* @__PURE__ */ new Set([
|
|
|
287
289
|
"firecracker",
|
|
288
290
|
"tangle"
|
|
289
291
|
]);
|
|
290
|
-
var DEFAULT_MODEL_OPTIONS = [
|
|
291
|
-
{ value: "claude-sonnet", label: "Claude Sonnet 4.6 (Highly Capable)" }
|
|
292
|
-
];
|
|
293
|
-
var DEFAULT_MODEL_TIER = DEFAULT_MODEL_OPTIONS[0]?.value ?? "claude-sonnet";
|
|
294
292
|
var STACK_DISPLAY = {
|
|
295
293
|
universal: {
|
|
296
294
|
name: "Default",
|
|
@@ -453,7 +451,7 @@ function ProvisioningWizard({
|
|
|
453
451
|
skipToReview,
|
|
454
452
|
onLoadStartupScripts,
|
|
455
453
|
resourceLimits,
|
|
456
|
-
|
|
454
|
+
models,
|
|
457
455
|
pricingRates,
|
|
458
456
|
planTiers
|
|
459
457
|
}) {
|
|
@@ -539,23 +537,17 @@ function ProvisioningWizard({
|
|
|
539
537
|
(prev) => snapSliderValue(prev, STORAGE_MIN, storageMax, storageStep)
|
|
540
538
|
);
|
|
541
539
|
}, [cpuMax, ramMax, storageMax, cpuStep, ramStep, storageStep]);
|
|
542
|
-
const [modelTier, setModelTier] = React2.useState(
|
|
543
|
-
dc?.modelTier ?? DEFAULT_MODEL_TIER
|
|
544
|
-
);
|
|
540
|
+
const [modelTier, setModelTier] = React2.useState(dc?.modelTier ?? "");
|
|
545
541
|
const [systemPrompt, setSystemPrompt] = React2.useState(
|
|
546
542
|
dc?.systemPrompt ?? ""
|
|
547
543
|
);
|
|
548
544
|
React2.useEffect(() => {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
setModelTier(firstAvailable.value);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}, [modelOptions, modelTier]);
|
|
545
|
+
if (!models || models.length === 0) return;
|
|
546
|
+
const ids = models.map(canonicalModelId);
|
|
547
|
+
if (ids.includes(modelTier)) return;
|
|
548
|
+
const next = ids[0];
|
|
549
|
+
if (next && next !== modelTier) setModelTier(next);
|
|
550
|
+
}, [models, modelTier]);
|
|
559
551
|
const [name, setName] = React2.useState(dc?.name ?? "");
|
|
560
552
|
const [gitUrl, setGitUrl] = React2.useState(dc?.gitUrl ?? "");
|
|
561
553
|
const [envVars, setEnvVars] = React2.useState(dc?.envVars ?? [{ key: "", value: "" }]);
|
|
@@ -755,11 +747,8 @@ function ProvisioningWizard({
|
|
|
755
747
|
setStorageGB(
|
|
756
748
|
snapSliderValue(128, STORAGE_MIN, storageMax, storageStep)
|
|
757
749
|
);
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
(o) => !o.disabled
|
|
761
|
-
);
|
|
762
|
-
setModelTier(firstAvailable?.value ?? DEFAULT_MODEL_TIER);
|
|
750
|
+
const first = models?.[0];
|
|
751
|
+
setModelTier(first ? canonicalModelId(first) : "");
|
|
763
752
|
setSystemPrompt("");
|
|
764
753
|
setName("");
|
|
765
754
|
setGitUrl("");
|
|
@@ -954,27 +943,17 @@ function ProvisioningWizard({
|
|
|
954
943
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
955
944
|
/* @__PURE__ */ jsx2("label", { className: "block font-label text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2", children: "Model Engine" }),
|
|
956
945
|
/* @__PURE__ */ jsx2(
|
|
957
|
-
|
|
946
|
+
ModelPicker,
|
|
958
947
|
{
|
|
948
|
+
label: "",
|
|
959
949
|
value: modelTier,
|
|
960
|
-
onChange:
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
"option",
|
|
966
|
-
{
|
|
967
|
-
value: option.value,
|
|
968
|
-
disabled: option.disabled,
|
|
969
|
-
className: "bg-gray-900",
|
|
970
|
-
children: option.label
|
|
971
|
-
},
|
|
972
|
-
option.value
|
|
973
|
-
)
|
|
974
|
-
)
|
|
950
|
+
onChange: setModelTier,
|
|
951
|
+
models: models ?? [],
|
|
952
|
+
loading: !models,
|
|
953
|
+
disabled: !models || models.length === 0,
|
|
954
|
+
triggerClassName: "rounded-xl h-12 px-4 font-bold"
|
|
975
955
|
}
|
|
976
|
-
)
|
|
977
|
-
modelOptions && modelOptions.length > 0 && modelOptions.every((o) => o.disabled) && /* @__PURE__ */ jsx2("p", { className: "text-xs text-muted-foreground mt-2", children: "All model options are currently disabled. Please upgrade your plan or contact support." })
|
|
956
|
+
)
|
|
978
957
|
] }),
|
|
979
958
|
/* @__PURE__ */ jsxs2("div", { children: [
|
|
980
959
|
/* @__PURE__ */ jsx2("label", { className: "block font-label text-xs font-bold uppercase tracking-widest text-muted-foreground mb-2", children: "Core Directives (System Prompt)" }),
|
|
@@ -1334,7 +1313,7 @@ function ProvisioningWizard({
|
|
|
1334
1313
|
{
|
|
1335
1314
|
type: "button",
|
|
1336
1315
|
onClick: handleDeploy,
|
|
1337
|
-
disabled: isDeploying || !selectedEnv,
|
|
1316
|
+
disabled: isDeploying || !selectedEnv || !modelTier && !bare,
|
|
1338
1317
|
className: "w-full h-12 bg-primary text-primary-foreground font-extrabold text-sm rounded-2xl tracking-wide shadow-md disabled:opacity-50 hover:brightness-110 active:scale-[0.98] transition-all",
|
|
1339
1318
|
children: isDeploying ? /* @__PURE__ */ jsxs2("span", { className: "flex items-center justify-center gap-2", children: [
|
|
1340
1319
|
/* @__PURE__ */ jsx2(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -1356,7 +1335,7 @@ function ProvisioningWizard({
|
|
|
1356
1335
|
{
|
|
1357
1336
|
type: "button",
|
|
1358
1337
|
onClick: handleDeploy,
|
|
1359
|
-
disabled: isDeploying || !selectedEnv,
|
|
1338
|
+
disabled: isDeploying || !selectedEnv || !modelTier && !bare,
|
|
1360
1339
|
className: "w-full h-12 bg-primary text-primary-foreground font-extrabold text-sm rounded-2xl tracking-wide shadow-md disabled:opacity-50 hover:brightness-110 active:scale-[0.98] transition-all",
|
|
1361
1340
|
children: isDeploying ? /* @__PURE__ */ jsxs2("span", { className: "flex items-center justify-center gap-2", children: [
|
|
1362
1341
|
/* @__PURE__ */ jsx2(Loader2, { className: "h-4 w-4 animate-spin" }),
|
|
@@ -3576,7 +3555,6 @@ var CATEGORY_DEFAULTS = {
|
|
|
3576
3555
|
cpuCores: 4,
|
|
3577
3556
|
ramGB: 16,
|
|
3578
3557
|
storageGB: 128,
|
|
3579
|
-
modelTier: "claude-sonnet",
|
|
3580
3558
|
systemPrompt: "You are a blockchain development assistant. Help with smart contract development, testing, and deployment. Follow security best practices and suggest gas optimizations where relevant.",
|
|
3581
3559
|
bare: false
|
|
3582
3560
|
},
|
|
@@ -3585,7 +3563,6 @@ var CATEGORY_DEFAULTS = {
|
|
|
3585
3563
|
cpuCores: 8,
|
|
3586
3564
|
ramGB: 32,
|
|
3587
3565
|
storageGB: 256,
|
|
3588
|
-
modelTier: "claude-sonnet",
|
|
3589
3566
|
systemPrompt: "You are an AI/ML development assistant. Help with model training, data processing, and experiment management. Suggest efficient approaches for the available compute resources.",
|
|
3590
3567
|
bare: false
|
|
3591
3568
|
},
|
|
@@ -3594,7 +3571,6 @@ var CATEGORY_DEFAULTS = {
|
|
|
3594
3571
|
cpuCores: 2,
|
|
3595
3572
|
ramGB: 4,
|
|
3596
3573
|
storageGB: 50,
|
|
3597
|
-
modelTier: "claude-sonnet",
|
|
3598
3574
|
systemPrompt: "You are a frontend development assistant. Help build modern, accessible, and performant user interfaces.",
|
|
3599
3575
|
bare: false
|
|
3600
3576
|
},
|
|
@@ -3603,7 +3579,6 @@ var CATEGORY_DEFAULTS = {
|
|
|
3603
3579
|
cpuCores: 4,
|
|
3604
3580
|
ramGB: 16,
|
|
3605
3581
|
storageGB: 128,
|
|
3606
|
-
modelTier: "claude-sonnet",
|
|
3607
3582
|
systemPrompt: "You are an infrastructure and DevOps assistant. Help with service configuration, deployment, monitoring, and operational best practices.",
|
|
3608
3583
|
bare: false
|
|
3609
3584
|
},
|
|
@@ -3612,7 +3587,6 @@ var CATEGORY_DEFAULTS = {
|
|
|
3612
3587
|
cpuCores: 4,
|
|
3613
3588
|
ramGB: 16,
|
|
3614
3589
|
storageGB: 128,
|
|
3615
|
-
modelTier: "claude-sonnet",
|
|
3616
3590
|
systemPrompt: "",
|
|
3617
3591
|
bare: false
|
|
3618
3592
|
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
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
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Curated preset bucket. Three are surfaced by default — they map to typical
|
|
36
|
+
* cost/quality tradeoffs without forcing the consumer to pick a specific
|
|
37
|
+
* model. `match` resolves the preset against the loaded model list.
|
|
38
|
+
*/
|
|
39
|
+
interface ModelPreset {
|
|
40
|
+
id: "fast" | "balanced" | "best" | string;
|
|
41
|
+
label: string;
|
|
42
|
+
hint: string;
|
|
43
|
+
icon?: React.ComponentType<{
|
|
44
|
+
className?: string;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Pick the canonical model id for this preset given the loaded list.
|
|
48
|
+
* Should return undefined if no acceptable model is loaded yet.
|
|
49
|
+
*/
|
|
50
|
+
match: (models: ModelInfo[]) => string | undefined;
|
|
51
|
+
}
|
|
52
|
+
type ModelPickerVariant = "field" | "pill";
|
|
53
|
+
interface ModelPickerProps {
|
|
54
|
+
/** Canonical model id (provider-prefixed, e.g. "openai/gpt-5.4"). */
|
|
55
|
+
value: string;
|
|
56
|
+
onChange: (modelId: string) => void;
|
|
57
|
+
/** Models to choose from. Pass `[]` while loading. */
|
|
58
|
+
models: ModelInfo[];
|
|
59
|
+
/** Show the loading state (overrides empty-list copy). */
|
|
60
|
+
loading?: boolean;
|
|
61
|
+
/** Recently-used canonical ids to surface at the top. */
|
|
62
|
+
recents?: ReadonlyArray<string>;
|
|
63
|
+
/**
|
|
64
|
+
* Curated presets shown above the full list. Defaults to Fast/Balanced/Best
|
|
65
|
+
* resolved against common gpt-5/Claude families.
|
|
66
|
+
*/
|
|
67
|
+
presets?: ReadonlyArray<ModelPreset>;
|
|
68
|
+
/** Drop providers from the picker entirely (e.g. "audio", "embedding"). */
|
|
69
|
+
excludeProviders?: ReadonlyArray<string>;
|
|
70
|
+
/** Restrict to these architectures (e.g. ["text"]). Default: all. */
|
|
71
|
+
modalities?: ReadonlyArray<string>;
|
|
72
|
+
/** Trigger appearance. "field" = full-width form field; "pill" = inline chat input pill. */
|
|
73
|
+
variant?: ModelPickerVariant;
|
|
74
|
+
label?: string;
|
|
75
|
+
placeholder?: string;
|
|
76
|
+
className?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Extra classes merged onto the trigger button itself (after the
|
|
79
|
+
* built-in defaults, so callers can override sizing/radius/font to
|
|
80
|
+
* match a surrounding form). Distinct from `className`, which on the
|
|
81
|
+
* "field" variant styles the outer wrapper.
|
|
82
|
+
*/
|
|
83
|
+
triggerClassName?: string;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Resolve the canonical id for a model. Some upstreams already prefix the
|
|
88
|
+
* provider in the id (e.g. "anthropic/claude-haiku-4.5"); others put it in
|
|
89
|
+
* `_provider` and leave the id bare. Always returns "<provider>/<model>"
|
|
90
|
+
* unless the id is already prefixed.
|
|
91
|
+
*/
|
|
92
|
+
declare function canonicalModelId(model: ModelInfo): string;
|
|
93
|
+
/** Format $/M tokens. Returns null if pricing is missing or zero. */
|
|
94
|
+
declare function formatPricing(pricing: ModelInfo["pricing"]): string | null;
|
|
95
|
+
/** Format context length compactly (e.g. 200_000 → "200k"). */
|
|
96
|
+
declare function formatContext(ctx: number | undefined): string | null;
|
|
97
|
+
declare function ModelPicker({ value, onChange, models, loading, recents, presets, excludeProviders, modalities, variant, label, placeholder, className, triggerClassName, disabled, }: ModelPickerProps): react_jsx_runtime.JSX.Element;
|
|
98
|
+
|
|
99
|
+
interface BillingSubscription {
|
|
100
|
+
status: string;
|
|
101
|
+
tierName: string;
|
|
102
|
+
renewsAt: string;
|
|
103
|
+
}
|
|
104
|
+
interface BillingBalance {
|
|
105
|
+
available: number;
|
|
106
|
+
used: number;
|
|
107
|
+
}
|
|
108
|
+
interface BillingUsage {
|
|
109
|
+
period: string;
|
|
110
|
+
total: number;
|
|
111
|
+
byModel: Record<string, number>;
|
|
112
|
+
}
|
|
113
|
+
interface BillingDashboardProps {
|
|
114
|
+
subscription: BillingSubscription | null;
|
|
115
|
+
balance: BillingBalance;
|
|
116
|
+
usage: BillingUsage;
|
|
117
|
+
onManageSubscription: () => void;
|
|
118
|
+
onAddCredits: () => void;
|
|
119
|
+
variant?: "sandbox";
|
|
120
|
+
className?: string;
|
|
121
|
+
cardClassName?: string;
|
|
122
|
+
}
|
|
123
|
+
declare function BillingDashboard({ subscription, balance, usage, onManageSubscription, onAddCredits, variant, className, cardClassName, }: BillingDashboardProps): react_jsx_runtime.JSX.Element;
|
|
124
|
+
|
|
125
|
+
interface PricingTier {
|
|
126
|
+
id: string;
|
|
127
|
+
name: string;
|
|
128
|
+
description: string;
|
|
129
|
+
monthlyPriceCents: number;
|
|
130
|
+
yearlyPriceCents?: number;
|
|
131
|
+
features: string[];
|
|
132
|
+
recommended?: boolean;
|
|
133
|
+
creditsPerMonth?: number;
|
|
134
|
+
monthlyPriceId?: string;
|
|
135
|
+
yearlyPriceId?: string;
|
|
136
|
+
}
|
|
137
|
+
interface PricingPageProps {
|
|
138
|
+
tiers: PricingTier[];
|
|
139
|
+
currentTierId?: string;
|
|
140
|
+
billingPeriod: "monthly" | "yearly";
|
|
141
|
+
onBillingPeriodChange: (period: "monthly" | "yearly") => void;
|
|
142
|
+
onSelectTier: (tierId: string) => void;
|
|
143
|
+
variant?: "sandbox";
|
|
144
|
+
loading?: boolean;
|
|
145
|
+
className?: string;
|
|
146
|
+
cardClassName?: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Formats an integer cent amount as a human-readable USD price.
|
|
150
|
+
* Whole-dollar amounts omit decimals ($10), fractional amounts show two ($10.99).
|
|
151
|
+
* Returns "$0" for non-finite or negative inputs.
|
|
152
|
+
* @param cents - Amount in whole US cents (e.g. 1099 for $10.99).
|
|
153
|
+
*/
|
|
154
|
+
declare function formatPrice(cents: number): string;
|
|
155
|
+
declare function PricingPage({ tiers, currentTierId, billingPeriod, onBillingPeriodChange, onSelectTier, loading, className, }: PricingPageProps): react_jsx_runtime.JSX.Element;
|
|
156
|
+
|
|
157
|
+
interface UsageDataPoint {
|
|
158
|
+
date: string;
|
|
159
|
+
value: number;
|
|
160
|
+
}
|
|
161
|
+
interface UsageChartProps {
|
|
162
|
+
data: UsageDataPoint[];
|
|
163
|
+
title: string;
|
|
164
|
+
unit: string;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
declare function UsageChart({ data, title, unit, className }: UsageChartProps): react_jsx_runtime.JSX.Element;
|
|
168
|
+
|
|
169
|
+
interface TemplateCardData {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
description: string;
|
|
173
|
+
icon?: React.ReactNode;
|
|
174
|
+
tags?: string[];
|
|
175
|
+
}
|
|
176
|
+
interface TemplateCardProps {
|
|
177
|
+
template: TemplateCardData;
|
|
178
|
+
onUseTemplate: (templateId: string) => void;
|
|
179
|
+
className?: string;
|
|
180
|
+
}
|
|
181
|
+
declare function TemplateCard({ template, onUseTemplate, className }: TemplateCardProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
export { type BillingBalance as B, type ModelInfo as M, PricingPage as P, TemplateCard as T, UsageChart as U, BillingDashboard as a, type BillingDashboardProps as b, type BillingSubscription as c, type BillingUsage as d, ModelPicker as e, type ModelPickerProps as f, type ModelPickerVariant as g, type ModelPreset as h, type PricingPageProps as i, type PricingTier as j, type TemplateCardData as k, type TemplateCardProps as l, type UsageChartProps as m, type UsageDataPoint as n, canonicalModelId as o, formatContext as p, formatPrice as q, formatPricing as r };
|
package/package.json
CHANGED