@flanksource/clicky-ui 0.3.23 → 0.3.25
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/data/ai/AdvancedChatConfig.cjs +3 -0
- package/dist/data/ai/AdvancedChatConfig.cjs.map +1 -1
- package/dist/data/ai/AdvancedChatConfig.d.ts +2 -1
- package/dist/data/ai/AdvancedChatConfig.d.ts.map +1 -1
- package/dist/data/ai/AdvancedChatConfig.js +3 -0
- package/dist/data/ai/AdvancedChatConfig.js.map +1 -1
- package/dist/data/ai/ChatWindow.cjs +77 -4
- package/dist/data/ai/ChatWindow.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.js +78 -5
- package/dist/data/ai/ChatWindow.js.map +1 -1
- package/dist/data/ai/ChatWindow.runtime.cjs +19 -4
- package/dist/data/ai/ChatWindow.runtime.cjs.map +1 -1
- package/dist/data/ai/ChatWindow.runtime.d.ts +2 -0
- package/dist/data/ai/ChatWindow.runtime.d.ts.map +1 -1
- package/dist/data/ai/ChatWindow.runtime.js +19 -4
- package/dist/data/ai/ChatWindow.runtime.js.map +1 -1
- package/dist/data/ai/ChatWindow.test-utils.d.ts +2 -1
- package/dist/data/ai/ChatWindow.test-utils.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferences.cjs +8 -1
- package/dist/data/ai/ToolPreferences.cjs.map +1 -1
- package/dist/data/ai/ToolPreferences.d.ts +2 -1
- package/dist/data/ai/ToolPreferences.d.ts.map +1 -1
- package/dist/data/ai/ToolPreferences.js +8 -1
- package/dist/data/ai/ToolPreferences.js.map +1 -1
- package/dist/data/chat/Chat.cjs +34 -7
- package/dist/data/chat/Chat.cjs.map +1 -1
- package/dist/data/chat/Chat.d.ts +9 -1
- package/dist/data/chat/Chat.d.ts.map +1 -1
- package/dist/data/chat/Chat.js +34 -7
- package/dist/data/chat/Chat.js.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.cjs +13 -7
- package/dist/data/chat/ChatRuntimeToolbar.cjs.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.d.ts +2 -1
- package/dist/data/chat/ChatRuntimeToolbar.d.ts.map +1 -1
- package/dist/data/chat/ChatRuntimeToolbar.js +13 -7
- package/dist/data/chat/ChatRuntimeToolbar.js.map +1 -1
- package/dist/data/chat/ContextMeter.cjs +64 -27
- package/dist/data/chat/ContextMeter.cjs.map +1 -1
- package/dist/data/chat/ContextMeter.d.ts +11 -4
- package/dist/data/chat/ContextMeter.d.ts.map +1 -1
- package/dist/data/chat/ContextMeter.js +64 -27
- package/dist/data/chat/ContextMeter.js.map +1 -1
- package/dist/data/chat/Message.cjs +36 -1
- package/dist/data/chat/Message.cjs.map +1 -1
- package/dist/data/chat/Message.d.ts +1 -1
- package/dist/data/chat/Message.d.ts.map +1 -1
- package/dist/data/chat/Message.js +37 -2
- package/dist/data/chat/Message.js.map +1 -1
- package/dist/data/chat/approval.cjs +17 -0
- package/dist/data/chat/approval.cjs.map +1 -1
- package/dist/data/chat/approval.d.ts +5 -0
- package/dist/data/chat/approval.d.ts.map +1 -1
- package/dist/data/chat/approval.js +17 -0
- package/dist/data/chat/approval.js.map +1 -1
- package/dist/data/chat/fork-seed.cjs +22 -0
- package/dist/data/chat/fork-seed.cjs.map +1 -0
- package/dist/data/chat/fork-seed.d.ts +8 -0
- package/dist/data/chat/fork-seed.d.ts.map +1 -0
- package/dist/data/chat/fork-seed.js +22 -0
- package/dist/data/chat/fork-seed.js.map +1 -0
- package/dist/data/chat/types.cjs.map +1 -1
- package/dist/data/chat/types.d.ts +19 -0
- package/dist/data/chat/types.d.ts.map +1 -1
- package/dist/data/chat/types.js.map +1 -1
- package/dist/data/chat/usage-snapshot.cjs +10 -1
- package/dist/data/chat/usage-snapshot.cjs.map +1 -1
- package/dist/data/chat/usage-snapshot.d.ts.map +1 -1
- package/dist/data/chat/usage-snapshot.js +10 -1
- package/dist/data/chat/usage-snapshot.js.map +1 -1
- package/dist/data/runtime/RuntimeBar.cjs +3 -0
- package/dist/data/runtime/RuntimeBar.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBar.d.ts +3 -1
- package/dist/data/runtime/RuntimeBar.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBar.js +3 -0
- package/dist/data/runtime/RuntimeBar.js.map +1 -1
- package/dist/data/runtime/RuntimeBarCombo.cjs +15 -1
- package/dist/data/runtime/RuntimeBarCombo.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarCombo.d.ts +2 -1
- package/dist/data/runtime/RuntimeBarCombo.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarCombo.js +15 -1
- package/dist/data/runtime/RuntimeBarCombo.js.map +1 -1
- package/dist/data/runtime/RuntimeBarSegments.cjs +7 -0
- package/dist/data/runtime/RuntimeBarSegments.cjs.map +1 -1
- package/dist/data/runtime/RuntimeBarSegments.d.ts +2 -1
- package/dist/data/runtime/RuntimeBarSegments.d.ts.map +1 -1
- package/dist/data/runtime/RuntimeBarSegments.js +7 -0
- package/dist/data/runtime/RuntimeBarSegments.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport type ToolMode = \"on\" | \"ask\" | \"off\" | \"auto\";\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolMode;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":";;AA4IO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAQO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,iCAA+D;AAAA,EAC1E;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAEN;AAgEO,SAAS,kBAAkB,MAEJ;AAC5B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n /** @deprecated Use `model`; retained for compatibility with existing consumers. */\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport type ToolMode = \"on\" | \"ask\" | \"off\" | \"auto\";\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolMode;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":";;AA+JO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAQO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,iCAA+D;AAAA,EAC1E;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAEN;AAgEO,SAAS,kBAAkB,MAEJ;AAC5B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;;;;;;;;;;"}
|
|
@@ -54,6 +54,15 @@ export interface ChatModel {
|
|
|
54
54
|
/** Per-message metadata the backend rides on the SSE `finish` part
|
|
55
55
|
* (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */
|
|
56
56
|
export interface ChatMessageMetadata {
|
|
57
|
+
backend?: string;
|
|
58
|
+
executionMode?: string;
|
|
59
|
+
model?: string;
|
|
60
|
+
captainSessionId?: string;
|
|
61
|
+
providerSessionId?: string;
|
|
62
|
+
threadId?: string;
|
|
63
|
+
turnId?: string;
|
|
64
|
+
success?: boolean;
|
|
65
|
+
interrupted?: boolean;
|
|
57
66
|
usage?: ChatUsageBreakdown;
|
|
58
67
|
costBreakdown?: ChatCostBreakdown;
|
|
59
68
|
/** This turn's cost in USD. */
|
|
@@ -72,6 +81,16 @@ export interface ChatUsageSummary {
|
|
|
72
81
|
usage?: ChatUsageBreakdown;
|
|
73
82
|
costBreakdown?: ChatCostBreakdown;
|
|
74
83
|
messageCount: number;
|
|
84
|
+
backend?: string;
|
|
85
|
+
executionMode?: string;
|
|
86
|
+
model?: string;
|
|
87
|
+
captainSessionId?: string;
|
|
88
|
+
providerSessionId?: string;
|
|
89
|
+
threadId?: string;
|
|
90
|
+
turnId?: string;
|
|
91
|
+
success?: boolean;
|
|
92
|
+
interrupted?: boolean;
|
|
93
|
+
/** @deprecated Use `model`; retained for compatibility with existing consumers. */
|
|
75
94
|
modelLabel?: string;
|
|
76
95
|
}
|
|
77
96
|
export interface ChatBudgetConfig {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,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,EAAE,oBAAoB,KAAK,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport type ToolMode = \"on\" | \"ask\" | \"off\" | \"auto\";\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolMode;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":"AA4IO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAQO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,iCAA+D;AAAA,EAC1E;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAEN;AAgEO,SAAS,kBAAkB,MAEJ;AAC5B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/data/chat/types.ts"],"sourcesContent":["import type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n} from \"ai\";\nimport type { ReactNode } from \"react\";\nimport type {\n JsonSchemaObject,\n JsonSchemaProperty as FormJsonSchemaProperty,\n} from \"../../components/json-schema-form-types\";\n\nexport type {\n UIMessage,\n ToolUIPart,\n DynamicToolUIPart,\n ChatStatus,\n ReasoningUIPart,\n FileUIPart,\n};\n\n/** A selectable chat model, as served by the backend's GET /api/chat/models.\n * `configured` is false for catalogued models whose provider has no API key. */\nexport interface ChatModelRuntime {\n model?: string;\n id?: string;\n backend?: string;\n mode?: string;\n temperature?: number;\n effort?: string;\n noCache?: boolean;\n fallbacks?: ChatModelRuntime[];\n}\n\nexport type RuntimeAvailabilityState =\n | \"available\"\n | \"disabled\"\n | \"missing_credentials\"\n | \"not_authenticated\"\n | \"missing_executable\"\n | \"missing_dependency\"\n | \"unsupported\"\n | \"unavailable\";\n\nexport interface RuntimeAvailability {\n state: RuntimeAvailabilityState;\n reason?: string;\n remediation?: string;\n}\n\nexport interface ChatModel {\n id: string;\n provider: string;\n label: string;\n /** Exact Captain Model wire value submitted when this display row is selected. */\n runtime?: ChatModelRuntime;\n reasoning: boolean;\n /** True when backend metadata is authoritative, including explicit unsupported values. */\n capabilitiesKnown?: boolean;\n /** Ordered reasoning-effort tiers accepted by this exact model. */\n supportedEfforts?: string[];\n /** Backend-recommended effort used when the current selection is invalid. */\n defaultEffort?: string;\n /** Whether the model honours the temperature sampling control. */\n temperature?: boolean;\n configured?: boolean;\n availability?: RuntimeAvailability;\n /**\n * The catalog's own declared default — the row a picker seeds with when the\n * caller names no model. At most one row carries it, and a catalog that\n * declares none (or whose default is unconfigured) falls back to the first\n * configured row.\n */\n default?: boolean;\n /** Concrete runtime backends that advertised this model. Empty/omitted means provider-wide. */\n backends?: string[];\n /** Max context tokens — the denominator for a usage gauge. */\n contextWindow?: number;\n /** MIME patterns accepted as model inputs, e.g. image/* or application/pdf. */\n inputMediaTypes?: string[];\n}\n\n/** Per-message metadata the backend rides on the SSE `finish` part\n * (`messageMetadata`), applied by the AI SDK to the assistant `UIMessage`. */\nexport interface ChatMessageMetadata {\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n /** This turn's cost in USD. */\n cost?: number;\n /** Cumulative thread cost in USD (when the turn is persisted to a thread). */\n threadCostUsd?: number;\n /** This turn's input-token count, ≈ current context-window occupancy. */\n contextTokens?: number;\n}\n\n/** A flattened usage snapshot a chat surfaces for a gauge: tokens used out of the\n * model's context window, plus cumulative cost. */\nexport interface ChatUsageSummary {\n usedTokens: number;\n maxTokens: number;\n cost?: number;\n usage?: ChatUsageBreakdown;\n costBreakdown?: ChatCostBreakdown;\n messageCount: number;\n backend?: string;\n executionMode?: string;\n model?: string;\n captainSessionId?: string;\n providerSessionId?: string;\n threadId?: string;\n turnId?: string;\n success?: boolean;\n interrupted?: boolean;\n /** @deprecated Use `model`; retained for compatibility with existing consumers. */\n modelLabel?: string;\n}\n\nexport interface ChatBudgetConfig {\n /** Per-thread/request cost cap in USD. */\n cost?: number;\n /** Max output tokens for one model call. */\n maxTokens?: number;\n}\n\nexport interface ChatUsageBreakdown {\n inputTokens?: number;\n outputTokens?: number;\n reasoningTokens?: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n totalTokens?: number;\n}\n\nexport interface ChatCostBreakdown {\n model?: string;\n inputUsd?: number;\n outputUsd?: number;\n reasoningUsd?: number;\n cacheReadUsd?: number;\n cacheWriteUsd?: number;\n totalUsd?: number;\n}\n\n/** A suggested prompt shown on the empty state. A bare string is both the label\n * and the submitted text; the object form separates them. */\nexport type Suggestion = string | { label: string; prompt: string };\n\n/** The label shown for a suggestion. */\nexport function suggestionLabel(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.label;\n}\n\n/** The text submitted when a suggestion is clicked. */\nexport function suggestionPrompt(s: Suggestion): string {\n return typeof s === \"string\" ? s : s.prompt;\n}\n\n/** Returns true for an assistant reasoning (\"thinking\") part. */\nexport function isReasoningPart(part: {\n type: string;\n}): part is ReasoningUIPart {\n return part.type === \"reasoning\";\n}\n\n/** Returns true for a file/attachment part. */\nexport function isFilePart(part: { type: string }): part is FileUIPart {\n return part.type === \"file\";\n}\n\n/** A tool part as it appears in an assistant UIMessage — either a typed\n * `tool-<name>` part or the generic `dynamic-tool` part. clicky operations\n * surface as dynamic tools, so the chat UI renders both shapes. */\nexport type AnyToolPart = ToolUIPart | DynamicToolUIPart;\n\n/** Claude Agent SDK permission modes accepted by `permissionMode`. */\nexport const CLAUDE_PERMISSION_MODES = [\n \"default\",\n \"acceptEdits\",\n \"bypassPermissions\",\n \"plan\",\n \"dontAsk\",\n \"auto\",\n] as const;\n\nexport type ClaudePermissionMode = (typeof CLAUDE_PERMISSION_MODES)[number];\n\nexport type ClaudePermissionModeOption = {\n value: ClaudePermissionMode;\n label: string;\n description: string;\n};\n\nexport const CLAUDE_PERMISSION_MODE_OPTIONS: ClaudePermissionModeOption[] = [\n {\n value: \"default\",\n label: \"Default\",\n description:\n \"Prompt for dangerous operations using standard Claude behavior.\",\n },\n {\n value: \"auto\",\n label: \"Auto\",\n description:\n \"Use Claude's classifier to approve or deny permission prompts.\",\n },\n {\n value: \"acceptEdits\",\n label: \"Accept edits\",\n description: \"Automatically accept file edit operations.\",\n },\n {\n value: \"dontAsk\",\n label: \"Don't ask\",\n description: \"Do not prompt; deny actions that are not pre-approved.\",\n },\n {\n value: \"plan\",\n label: \"Plan\",\n description: \"Planning mode with no tool execution.\",\n },\n {\n value: \"bypassPermissions\",\n label: \"Bypass\",\n description:\n \"Bypass permission checks when explicitly allowed by the host.\",\n },\n];\n\n/** Tool metadata shared by the chat shell. It both configures the\n * tool-preferences popover (`name`/`label`/`group`) and carries the schema\n * derived from a clicky RPC operation (`description`/`inputSchema`). The Go\n * backend owns execution; the client uses this only for display and to scope\n * which tools a request may call (passed in the transport `body`). */\nexport type ToolMode = \"on\" | \"ask\" | \"off\" | \"auto\";\n\nexport interface ToolAnnotations {\n title?: string;\n readOnlyHint?: boolean;\n destructiveHint?: boolean;\n idempotentHint?: boolean;\n openWorldHint?: boolean;\n [key: string]: unknown;\n}\n\nexport interface ToolMeta {\n /** Stable tool name sent to the model (the operation id). */\n name: string;\n /** Human-readable label shown in the tool-preferences popover. */\n label: string;\n /** Bucket heading in the popover — the clicky surface for RPC operations. */\n group?: string;\n /** Display title of the tool's parent surface/entity (e.g. \"Xero Accounts\").\n * Used to nest tools under their entity within a group, and as the\n * disambiguating prefix in flat lists so sibling verbs (\"List\", \"Get\") stay\n * distinguishable. Resolved from the operation's `x-clicky.surface`. */\n parent?: string;\n /** Raw entity name of the tool's surface (e.g. \"accounts\"), when known. */\n entity?: string;\n /** Preference key sent to the backend. Defaults to `name`; group-backed\n * clicky tools set this to the backend tool group. */\n preferenceKey?: string;\n /** Initial backend-owned permission when the chat window first sees this tool. */\n defaultPermission?: ToolMode;\n /** Opaque icon name emitted by the backend, resolved by the host UI. */\n icon?: string;\n /** Description shown in tool pickers / tool-call headers. */\n description?: string;\n /** Short usage hints shown in the tool browser. */\n hints?: string[];\n source?: \"clicky\" | \"custom\" | \"mcp\" | string;\n server?: string;\n method?: string;\n path?: string;\n operationName?: string;\n title?: string;\n /** Whether the runtime should treat the tool input schema as strict/closed. */\n strict?: boolean;\n /** Runtime tool annotations/hints, e.g. MCP/Genkit well-known hints. */\n annotations?: ToolAnnotations;\n /** JSON-Schema for the tool's input, assembled from an operation's\n * parameters + request body. Omitted for hand-authored tools. */\n inputSchema?: ChatToolInputSchema;\n outputSchema?: ChatToolInputSchema;\n}\n\nexport type ChatToolInputSchema = JsonSchemaObject;\nexport type JsonSchemaProperty = FormJsonSchemaProperty;\nexport type JSONSchemaProperty = FormJsonSchemaProperty;\n\n/** Returns true for a `dynamic-tool` part (clicky operations surface this way). */\nexport function isDynamicToolPart(part: {\n type: string;\n}): part is DynamicToolUIPart {\n return part.type === \"dynamic-tool\";\n}\n\n/** Returns true for a typed `tool-<name>` part. */\nexport function isTypedToolPart(part: { type: string }): part is ToolUIPart {\n return part.type.startsWith(\"tool-\");\n}\n\n/** The display name of a tool part: the explicit `toolName` for dynamic tools,\n * otherwise the suffix after `tool-`. */\nexport function toolPartName(part: AnyToolPart): string {\n if (isDynamicToolPart(part)) {\n return part.toolName;\n }\n return part.type.slice(\"tool-\".length);\n}\n\nexport interface ToolResultRenderArgs {\n part: AnyToolPart;\n toolName: string;\n output: unknown;\n}\n\nexport type ToolResultRenderer = (args: ToolResultRenderArgs) => ReactNode;\n"],"names":[],"mappings":"AA+JO,SAAS,gBAAgB,GAAuB;AACrD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,iBAAiB,GAAuB;AACtD,SAAO,OAAO,MAAM,WAAW,IAAI,EAAE;AACvC;AAGO,SAAS,gBAAgB,MAEJ;AAC1B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,WAAW,MAA4C;AACrE,SAAO,KAAK,SAAS;AACvB;AAQO,MAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAUO,MAAM,iCAA+D;AAAA,EAC1E;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAAA,EAEJ;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aAAa;AAAA,EAAA;AAAA,EAEf;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,IACP,aACE;AAAA,EAAA;AAEN;AAgEO,SAAS,kBAAkB,MAEJ;AAC5B,SAAO,KAAK,SAAS;AACvB;AAGO,SAAS,gBAAgB,MAA4C;AAC1E,SAAO,KAAK,KAAK,WAAW,OAAO;AACrC;AAIO,SAAS,aAAa,MAA2B;AACtD,MAAI,kBAAkB,IAAI,GAAG;AAC3B,WAAO,KAAK;AAAA,EACd;AACA,SAAO,KAAK,KAAK,MAAM,QAAQ,MAAM;AACvC;"}
|
|
@@ -10,7 +10,16 @@ function usageSnapshotFromMetadata(metadata, options) {
|
|
|
10
10
|
...cost != null ? { cost } : {},
|
|
11
11
|
...metadata.usage ? { usage: metadata.usage } : {},
|
|
12
12
|
...metadata.costBreakdown ? { costBreakdown: metadata.costBreakdown } : {},
|
|
13
|
-
...
|
|
13
|
+
...metadata.backend !== void 0 ? { backend: metadata.backend } : {},
|
|
14
|
+
...metadata.executionMode !== void 0 ? { executionMode: metadata.executionMode } : {},
|
|
15
|
+
...metadata.model !== void 0 ? { model: metadata.model } : {},
|
|
16
|
+
...metadata.model !== void 0 && options.modelLabel ? { modelLabel: options.modelLabel } : {},
|
|
17
|
+
...metadata.captainSessionId !== void 0 ? { captainSessionId: metadata.captainSessionId } : {},
|
|
18
|
+
...metadata.providerSessionId !== void 0 ? { providerSessionId: metadata.providerSessionId } : {},
|
|
19
|
+
...metadata.threadId !== void 0 ? { threadId: metadata.threadId } : {},
|
|
20
|
+
...metadata.turnId !== void 0 ? { turnId: metadata.turnId } : {},
|
|
21
|
+
...metadata.success !== void 0 ? { success: metadata.success } : {},
|
|
22
|
+
...metadata.interrupted !== void 0 ? { interrupted: metadata.interrupted } : {}
|
|
14
23
|
};
|
|
15
24
|
}
|
|
16
25
|
exports.usageSnapshotFromMetadata = usageSnapshotFromMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-snapshot.cjs","sources":["../../../src/data/chat/usage-snapshot.ts"],"sourcesContent":["import type { ChatMessageMetadata, ChatUsageSummary } from \"./types\";\n\n/**\n * Builds the usage snapshot a chat surfaces (gauge, hover card, config panel)\n * from the last settled assistant turn's metadata.\n *\n * The cost precedence matters: `threadCostUsd` is the conversation's running\n * total, while `cost` is only the turn that just finished. Preferring the\n * cumulative figure is what makes the meter report what the conversation has\n * actually spent — on a multi-turn thread the two differ by roughly the number\n * of turns taken. Backends that do not report a thread total still degrade to\n * the per-turn value rather than showing nothing.\n *\n * Token fields stay per-turn; the whole-conversation breakdown is served\n * separately by the thread costs endpoint.\n */\nexport function usageSnapshotFromMetadata(\n metadata: ChatMessageMetadata,\n options: {
|
|
1
|
+
{"version":3,"file":"usage-snapshot.cjs","sources":["../../../src/data/chat/usage-snapshot.ts"],"sourcesContent":["import type { ChatMessageMetadata, ChatUsageSummary } from \"./types\";\n\n/**\n * Builds the usage snapshot a chat surfaces (gauge, hover card, config panel)\n * from the last settled assistant turn's metadata.\n *\n * The cost precedence matters: `threadCostUsd` is the conversation's running\n * total, while `cost` is only the turn that just finished. Preferring the\n * cumulative figure is what makes the meter report what the conversation has\n * actually spent — on a multi-turn thread the two differ by roughly the number\n * of turns taken. Backends that do not report a thread total still degrade to\n * the per-turn value rather than showing nothing.\n *\n * Token fields stay per-turn; the whole-conversation breakdown is served\n * separately by the thread costs endpoint.\n */\nexport function usageSnapshotFromMetadata(\n metadata: ChatMessageMetadata,\n options: {\n contextWindow?: number | undefined;\n modelLabel?: string | undefined;\n messageCount: number;\n },\n): ChatUsageSummary {\n const cost =\n metadata.threadCostUsd ?? metadata.costBreakdown?.totalUsd ?? metadata.cost;\n return {\n usedTokens: metadata.contextTokens ?? metadata.usage?.totalTokens ?? 0,\n maxTokens: options.contextWindow ?? 0,\n messageCount: options.messageCount,\n ...(cost != null ? { cost } : {}),\n ...(metadata.usage ? { usage: metadata.usage } : {}),\n ...(metadata.costBreakdown ? { costBreakdown: metadata.costBreakdown } : {}),\n ...(metadata.backend !== undefined ? { backend: metadata.backend } : {}),\n ...(metadata.executionMode !== undefined\n ? { executionMode: metadata.executionMode }\n : {}),\n ...(metadata.model !== undefined ? { model: metadata.model } : {}),\n ...(metadata.model !== undefined && options.modelLabel\n ? { modelLabel: options.modelLabel }\n : {}),\n ...(metadata.captainSessionId !== undefined\n ? { captainSessionId: metadata.captainSessionId }\n : {}),\n ...(metadata.providerSessionId !== undefined\n ? { providerSessionId: metadata.providerSessionId }\n : {}),\n ...(metadata.threadId !== undefined ? { threadId: metadata.threadId } : {}),\n ...(metadata.turnId !== undefined ? { turnId: metadata.turnId } : {}),\n ...(metadata.success !== undefined ? { success: metadata.success } : {}),\n ...(metadata.interrupted !== undefined\n ? { interrupted: metadata.interrupted }\n : {}),\n };\n}\n"],"names":[],"mappings":";;AAgBO,SAAS,0BACd,UACA,SAKkB;;AAClB,QAAM,OACJ,SAAS,mBAAiB,cAAS,kBAAT,mBAAwB,aAAY,SAAS;AACzE,SAAO;AAAA,IACL,YAAY,SAAS,mBAAiB,cAAS,UAAT,mBAAgB,gBAAe;AAAA,IACrE,WAAW,QAAQ,iBAAiB;AAAA,IACpC,cAAc,QAAQ;AAAA,IACtB,GAAI,QAAQ,OAAO,EAAE,KAAA,IAAS,CAAA;AAAA,IAC9B,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAA,IAAU,CAAA;AAAA,IACjD,GAAI,SAAS,gBAAgB,EAAE,eAAe,SAAS,cAAA,IAAkB,CAAA;AAAA,IACzE,GAAI,SAAS,YAAY,SAAY,EAAE,SAAS,SAAS,QAAA,IAAY,CAAA;AAAA,IACrE,GAAI,SAAS,kBAAkB,SAC3B,EAAE,eAAe,SAAS,cAAA,IAC1B,CAAA;AAAA,IACJ,GAAI,SAAS,UAAU,SAAY,EAAE,OAAO,SAAS,MAAA,IAAU,CAAA;AAAA,IAC/D,GAAI,SAAS,UAAU,UAAa,QAAQ,aACxC,EAAE,YAAY,QAAQ,WAAA,IACtB,CAAA;AAAA,IACJ,GAAI,SAAS,qBAAqB,SAC9B,EAAE,kBAAkB,SAAS,iBAAA,IAC7B,CAAA;AAAA,IACJ,GAAI,SAAS,sBAAsB,SAC/B,EAAE,mBAAmB,SAAS,kBAAA,IAC9B,CAAA;AAAA,IACJ,GAAI,SAAS,aAAa,SAAY,EAAE,UAAU,SAAS,SAAA,IAAa,CAAA;AAAA,IACxE,GAAI,SAAS,WAAW,SAAY,EAAE,QAAQ,SAAS,OAAA,IAAW,CAAA;AAAA,IAClE,GAAI,SAAS,YAAY,SAAY,EAAE,SAAS,SAAS,QAAA,IAAY,CAAA;AAAA,IACrE,GAAI,SAAS,gBAAgB,SACzB,EAAE,aAAa,SAAS,gBACxB,CAAA;AAAA,EAAC;AAET;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-snapshot.d.ts","sourceRoot":"","sources":["../../../src/data/chat/usage-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"usage-snapshot.d.ts","sourceRoot":"","sources":["../../../src/data/chat/usage-snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,EAAE;IACP,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,gBAAgB,CA+BlB"}
|
|
@@ -8,7 +8,16 @@ function usageSnapshotFromMetadata(metadata, options) {
|
|
|
8
8
|
...cost != null ? { cost } : {},
|
|
9
9
|
...metadata.usage ? { usage: metadata.usage } : {},
|
|
10
10
|
...metadata.costBreakdown ? { costBreakdown: metadata.costBreakdown } : {},
|
|
11
|
-
...
|
|
11
|
+
...metadata.backend !== void 0 ? { backend: metadata.backend } : {},
|
|
12
|
+
...metadata.executionMode !== void 0 ? { executionMode: metadata.executionMode } : {},
|
|
13
|
+
...metadata.model !== void 0 ? { model: metadata.model } : {},
|
|
14
|
+
...metadata.model !== void 0 && options.modelLabel ? { modelLabel: options.modelLabel } : {},
|
|
15
|
+
...metadata.captainSessionId !== void 0 ? { captainSessionId: metadata.captainSessionId } : {},
|
|
16
|
+
...metadata.providerSessionId !== void 0 ? { providerSessionId: metadata.providerSessionId } : {},
|
|
17
|
+
...metadata.threadId !== void 0 ? { threadId: metadata.threadId } : {},
|
|
18
|
+
...metadata.turnId !== void 0 ? { turnId: metadata.turnId } : {},
|
|
19
|
+
...metadata.success !== void 0 ? { success: metadata.success } : {},
|
|
20
|
+
...metadata.interrupted !== void 0 ? { interrupted: metadata.interrupted } : {}
|
|
12
21
|
};
|
|
13
22
|
}
|
|
14
23
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-snapshot.js","sources":["../../../src/data/chat/usage-snapshot.ts"],"sourcesContent":["import type { ChatMessageMetadata, ChatUsageSummary } from \"./types\";\n\n/**\n * Builds the usage snapshot a chat surfaces (gauge, hover card, config panel)\n * from the last settled assistant turn's metadata.\n *\n * The cost precedence matters: `threadCostUsd` is the conversation's running\n * total, while `cost` is only the turn that just finished. Preferring the\n * cumulative figure is what makes the meter report what the conversation has\n * actually spent — on a multi-turn thread the two differ by roughly the number\n * of turns taken. Backends that do not report a thread total still degrade to\n * the per-turn value rather than showing nothing.\n *\n * Token fields stay per-turn; the whole-conversation breakdown is served\n * separately by the thread costs endpoint.\n */\nexport function usageSnapshotFromMetadata(\n metadata: ChatMessageMetadata,\n options: {
|
|
1
|
+
{"version":3,"file":"usage-snapshot.js","sources":["../../../src/data/chat/usage-snapshot.ts"],"sourcesContent":["import type { ChatMessageMetadata, ChatUsageSummary } from \"./types\";\n\n/**\n * Builds the usage snapshot a chat surfaces (gauge, hover card, config panel)\n * from the last settled assistant turn's metadata.\n *\n * The cost precedence matters: `threadCostUsd` is the conversation's running\n * total, while `cost` is only the turn that just finished. Preferring the\n * cumulative figure is what makes the meter report what the conversation has\n * actually spent — on a multi-turn thread the two differ by roughly the number\n * of turns taken. Backends that do not report a thread total still degrade to\n * the per-turn value rather than showing nothing.\n *\n * Token fields stay per-turn; the whole-conversation breakdown is served\n * separately by the thread costs endpoint.\n */\nexport function usageSnapshotFromMetadata(\n metadata: ChatMessageMetadata,\n options: {\n contextWindow?: number | undefined;\n modelLabel?: string | undefined;\n messageCount: number;\n },\n): ChatUsageSummary {\n const cost =\n metadata.threadCostUsd ?? metadata.costBreakdown?.totalUsd ?? metadata.cost;\n return {\n usedTokens: metadata.contextTokens ?? metadata.usage?.totalTokens ?? 0,\n maxTokens: options.contextWindow ?? 0,\n messageCount: options.messageCount,\n ...(cost != null ? { cost } : {}),\n ...(metadata.usage ? { usage: metadata.usage } : {}),\n ...(metadata.costBreakdown ? { costBreakdown: metadata.costBreakdown } : {}),\n ...(metadata.backend !== undefined ? { backend: metadata.backend } : {}),\n ...(metadata.executionMode !== undefined\n ? { executionMode: metadata.executionMode }\n : {}),\n ...(metadata.model !== undefined ? { model: metadata.model } : {}),\n ...(metadata.model !== undefined && options.modelLabel\n ? { modelLabel: options.modelLabel }\n : {}),\n ...(metadata.captainSessionId !== undefined\n ? { captainSessionId: metadata.captainSessionId }\n : {}),\n ...(metadata.providerSessionId !== undefined\n ? { providerSessionId: metadata.providerSessionId }\n : {}),\n ...(metadata.threadId !== undefined ? { threadId: metadata.threadId } : {}),\n ...(metadata.turnId !== undefined ? { turnId: metadata.turnId } : {}),\n ...(metadata.success !== undefined ? { success: metadata.success } : {}),\n ...(metadata.interrupted !== undefined\n ? { interrupted: metadata.interrupted }\n : {}),\n };\n}\n"],"names":[],"mappings":"AAgBO,SAAS,0BACd,UACA,SAKkB;AAPb;AAQL,QAAM,OACJ,SAAS,mBAAiB,cAAS,kBAAT,mBAAwB,aAAY,SAAS;AACzE,SAAO;AAAA,IACL,YAAY,SAAS,mBAAiB,cAAS,UAAT,mBAAgB,gBAAe;AAAA,IACrE,WAAW,QAAQ,iBAAiB;AAAA,IACpC,cAAc,QAAQ;AAAA,IACtB,GAAI,QAAQ,OAAO,EAAE,KAAA,IAAS,CAAA;AAAA,IAC9B,GAAI,SAAS,QAAQ,EAAE,OAAO,SAAS,MAAA,IAAU,CAAA;AAAA,IACjD,GAAI,SAAS,gBAAgB,EAAE,eAAe,SAAS,cAAA,IAAkB,CAAA;AAAA,IACzE,GAAI,SAAS,YAAY,SAAY,EAAE,SAAS,SAAS,QAAA,IAAY,CAAA;AAAA,IACrE,GAAI,SAAS,kBAAkB,SAC3B,EAAE,eAAe,SAAS,cAAA,IAC1B,CAAA;AAAA,IACJ,GAAI,SAAS,UAAU,SAAY,EAAE,OAAO,SAAS,MAAA,IAAU,CAAA;AAAA,IAC/D,GAAI,SAAS,UAAU,UAAa,QAAQ,aACxC,EAAE,YAAY,QAAQ,WAAA,IACtB,CAAA;AAAA,IACJ,GAAI,SAAS,qBAAqB,SAC9B,EAAE,kBAAkB,SAAS,iBAAA,IAC7B,CAAA;AAAA,IACJ,GAAI,SAAS,sBAAsB,SAC/B,EAAE,mBAAmB,SAAS,kBAAA,IAC9B,CAAA;AAAA,IACJ,GAAI,SAAS,aAAa,SAAY,EAAE,UAAU,SAAS,SAAA,IAAa,CAAA;AAAA,IACxE,GAAI,SAAS,WAAW,SAAY,EAAE,QAAQ,SAAS,OAAA,IAAW,CAAA;AAAA,IAClE,GAAI,SAAS,YAAY,SAAY,EAAE,SAAS,SAAS,QAAA,IAAY,CAAA;AAAA,IACrE,GAAI,SAAS,gBAAgB,SACzB,EAAE,aAAa,SAAS,gBACxB,CAAA;AAAA,EAAC;AAET;"}
|
|
@@ -15,6 +15,7 @@ function RuntimeBar({
|
|
|
15
15
|
models = [],
|
|
16
16
|
families = runtimeMode.SPEC_RUNTIME_FAMILIES,
|
|
17
17
|
reasoningEfforts = effortIcons.DEFAULT_REASONING_EFFORTS,
|
|
18
|
+
locked = false,
|
|
18
19
|
ariaLabel = "Runtime",
|
|
19
20
|
className
|
|
20
21
|
}) {
|
|
@@ -90,6 +91,7 @@ function RuntimeBar({
|
|
|
90
91
|
selectedModel: resolvedModel,
|
|
91
92
|
selectedModelUnavailable,
|
|
92
93
|
supportedEfforts,
|
|
94
|
+
locked,
|
|
93
95
|
ariaLabel,
|
|
94
96
|
className,
|
|
95
97
|
onFamilyChange: (familyId) => applyBackend(familyId, selection.mode),
|
|
@@ -114,6 +116,7 @@ function RuntimeBar({
|
|
|
114
116
|
selectedMode: selection.mode,
|
|
115
117
|
reasoningEfforts,
|
|
116
118
|
supportedEfforts,
|
|
119
|
+
locked,
|
|
117
120
|
ariaLabel,
|
|
118
121
|
className,
|
|
119
122
|
onBackendChange: applyBackend,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeBar.cjs","sources":["../../../src/data/runtime/RuntimeBar.tsx"],"sourcesContent":["import { DEFAULT_REASONING_EFFORTS } from \"../chat/effort-icons\";\nimport type { ChatModel, ChatModelRuntime } from \"../chat/types\";\nimport { runtimeModelMatches } from \"./RuntimeBar.model\";\nimport { RuntimeBarCombo } from \"./RuntimeBarCombo\";\nimport { RuntimeBarSegments } from \"./RuntimeBarSegments\";\nimport { isSelectableModel } from \"./availability\";\nimport {\n effortOptionsForModel,\n reconcileModelCapabilities,\n} from \"./model-capabilities\";\nimport {\n SPEC_RUNTIME_FAMILIES,\n backendForFamilyMode,\n familyById,\n firstMode,\n modelBelongsToFamily,\n modelsForFamily,\n selectionForBackend,\n type SpecRuntimeFamily,\n} from \"./runtime-mode\";\n\nexport type RuntimeBarValue = ChatModelRuntime & {\n cliArgs?: Record<string, unknown>;\n};\n\nexport type RuntimeBarProps<T extends RuntimeBarValue = RuntimeBarValue> = {\n value: T;\n onChange: (value: T) => void;\n /** `segmented` uses field triggers; `combo` uses one direct-edit menu. */\n variant?: \"combo\" | \"segmented\";\n /** Model catalog. Only the selected family's models are listed; a family the\n * catalog does not describe is served by the segment's free-text entry. */\n models?: ChatModel[] | undefined;\n families?: SpecRuntimeFamily[] | undefined;\n /** Effort tiers offered when the catalog does not describe the model. */\n reasoningEfforts?: string[] | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n};\n\n/** Self-describing runtime controls with segmented and combo presentations. */\nexport function RuntimeBar<T extends RuntimeBarValue>({\n value,\n onChange,\n variant = \"segmented\",\n models = [],\n families = SPEC_RUNTIME_FAMILIES,\n reasoningEfforts = DEFAULT_REASONING_EFFORTS,\n ariaLabel = \"Runtime\",\n className,\n}: RuntimeBarProps<T>) {\n const selection = selectionForBackend(families, value.backend);\n const family = familyById(families, selection.family);\n const mode =\n family.modes.find((entry) => entry.id === selection.mode) ??\n firstMode(family);\n const modelOptions = modelsForFamily(models, family, value.backend);\n const selectedModel = models.find(\n (entry) =>\n isSelectableModel(entry) &&\n entry.runtime?.backend === value.backend &&\n runtimeModelMatches(entry, value)
|
|
1
|
+
{"version":3,"file":"RuntimeBar.cjs","sources":["../../../src/data/runtime/RuntimeBar.tsx"],"sourcesContent":["import { DEFAULT_REASONING_EFFORTS } from \"../chat/effort-icons\";\nimport type { ChatModel, ChatModelRuntime } from \"../chat/types\";\nimport { runtimeModelMatches } from \"./RuntimeBar.model\";\nimport { RuntimeBarCombo } from \"./RuntimeBarCombo\";\nimport { RuntimeBarSegments } from \"./RuntimeBarSegments\";\nimport { isSelectableModel } from \"./availability\";\nimport {\n effortOptionsForModel,\n reconcileModelCapabilities,\n} from \"./model-capabilities\";\nimport {\n SPEC_RUNTIME_FAMILIES,\n backendForFamilyMode,\n familyById,\n firstMode,\n modelBelongsToFamily,\n modelsForFamily,\n selectionForBackend,\n type SpecRuntimeFamily,\n} from \"./runtime-mode\";\n\nexport type RuntimeBarValue = ChatModelRuntime & {\n cliArgs?: Record<string, unknown>;\n};\n\nexport type RuntimeBarProps<T extends RuntimeBarValue = RuntimeBarValue> = {\n value: T;\n onChange: (value: T) => void;\n /** `segmented` uses field triggers; `combo` uses one direct-edit menu. */\n variant?: \"combo\" | \"segmented\";\n /** Model catalog. Only the selected family's models are listed; a family the\n * catalog does not describe is served by the segment's free-text entry. */\n models?: ChatModel[] | undefined;\n families?: SpecRuntimeFamily[] | undefined;\n /** Effort tiers offered when the catalog does not describe the model. */\n reasoningEfforts?: string[] | undefined;\n /** Locks model identity (family, backend, and model) while leaving effort editable. */\n locked?: boolean | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n};\n\n/** Self-describing runtime controls with segmented and combo presentations. */\nexport function RuntimeBar<T extends RuntimeBarValue>({\n value,\n onChange,\n variant = \"segmented\",\n models = [],\n families = SPEC_RUNTIME_FAMILIES,\n reasoningEfforts = DEFAULT_REASONING_EFFORTS,\n locked = false,\n ariaLabel = \"Runtime\",\n className,\n}: RuntimeBarProps<T>) {\n const selection = selectionForBackend(families, value.backend);\n const family = familyById(families, selection.family);\n const mode =\n family.modes.find((entry) => entry.id === selection.mode) ??\n firstMode(family);\n const modelOptions = modelsForFamily(models, family, value.backend);\n const selectedModel = models.find(\n (entry) =>\n isSelectableModel(entry) &&\n entry.runtime?.backend === value.backend &&\n runtimeModelMatches(entry, value),\n );\n const resolvedModel =\n selectedModel ??\n models.find(\n (entry) => isSelectableModel(entry) && runtimeModelMatches(entry, value),\n );\n const selectedModelUnavailable = Boolean(\n value.model &&\n models.some(\n (entry) => !isSelectableModel(entry) && runtimeModelMatches(entry, value),\n ),\n );\n const supportedEfforts = effortOptionsForModel(\n resolvedModel,\n reasoningEfforts,\n );\n\n const applyBackend = (familyId: string, modeId: string) => {\n const backend = backendForFamilyMode(families, familyId, modeId);\n if (backend === (value.backend ?? \"\")) return;\n let next = withOptionalRuntimeValue(\n withRuntimeValue(value, { backend }),\n \"cliArgs\",\n undefined,\n );\n if (\n !modelBelongsToFamily(\n value.model,\n models,\n familyById(families, familyId),\n backend,\n )\n ) {\n next = withoutCatalogModel(next);\n }\n onChange(next);\n };\n\n const applyCustomModel = (model: string) =>\n onChange(\n withOptionalRuntimeValue(withoutCatalogModel(value), \"model\", model),\n );\n // A menu row carries the backend of the catalog it was listed under, and one\n // catalog serves several backends — claude-cli and claude-cmux models are\n // listed as claude-agent rows. Copying the row's runtime verbatim would let\n // picking a model silently move the user off the mode they chose, so a row\n // drawn from the selected mode's own catalog keeps that mode.\n const applyModel = (model: ChatModel) => {\n const next = reconcileModelCapabilities(value, model, reasoningEfforts);\n if (!mode.provider || model.provider !== mode.provider) {\n onChange(next);\n return;\n }\n onChange(\n withOptionalRuntimeValue(\n withOptionalRuntimeValue(next, \"backend\", mode.backend),\n \"mode\",\n mode.id,\n ),\n );\n };\n const clearModel = () => onChange(withoutCatalogModel(value));\n const applyEffort = (effort: string) =>\n onChange(withOptionalRuntimeValue(value, \"effort\", effort));\n\n if (variant === \"combo\") {\n return (\n <RuntimeBarCombo\n value={value}\n families={families}\n family={family}\n mode={mode}\n selectedMode={selection.mode}\n models={modelOptions}\n selectedModel={resolvedModel}\n selectedModelUnavailable={selectedModelUnavailable}\n supportedEfforts={supportedEfforts}\n locked={locked}\n ariaLabel={ariaLabel}\n className={className}\n onFamilyChange={(familyId) => applyBackend(familyId, selection.mode)}\n onModeChange={(modeId) => applyBackend(family.id, modeId)}\n onModelSelect={applyModel}\n onModelClear={clearModel}\n onEffortChange={applyEffort}\n />\n );\n }\n\n return (\n <RuntimeBarSegments\n value={value}\n models={models}\n modelOptions={modelOptions}\n resolvedModel={resolvedModel}\n selectedModelUnavailable={selectedModelUnavailable}\n families={families}\n family={family}\n mode={mode}\n selectedMode={selection.mode}\n reasoningEfforts={reasoningEfforts}\n supportedEfforts={supportedEfforts}\n locked={locked}\n ariaLabel={ariaLabel}\n className={className}\n onBackendChange={applyBackend}\n onCustomModel={applyCustomModel}\n onModelSelect={applyModel}\n onModelClear={clearModel}\n onEffortChange={applyEffort}\n />\n );\n}\n\nfunction withoutCatalogModel<T extends RuntimeBarValue>(value: T): T {\n return withOptionalRuntimeValue(\n withOptionalRuntimeValue(value, \"model\", undefined),\n \"id\",\n undefined,\n );\n}\n\nfunction withRuntimeValue<T extends RuntimeBarValue>(\n value: T,\n patch: Partial<RuntimeBarValue>,\n): T {\n return { ...value, ...patch };\n}\n\nfunction withOptionalRuntimeValue<T extends RuntimeBarValue>(\n value: T,\n key: keyof RuntimeBarValue,\n next: unknown,\n): T {\n const updated = { ...value } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete updated[key];\n } else {\n updated[key] = next;\n }\n return updated as T;\n}\n"],"names":["SPEC_RUNTIME_FAMILIES","DEFAULT_REASONING_EFFORTS","selectionForBackend","familyById","firstMode","modelsForFamily","isSelectableModel","runtimeModelMatches","effortOptionsForModel","backendForFamilyMode","modelBelongsToFamily","reconcileModelCapabilities","jsx","RuntimeBarCombo","RuntimeBarSegments"],"mappings":";;;;;;;;;;AA2CO,SAAS,WAAsC;AAAA,EACpD;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,SAAS,CAAA;AAAA,EACT,WAAWA,YAAAA;AAAAA,EACX,mBAAmBC,YAAAA;AAAAA,EACnB,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AACF,GAAuB;AACrB,QAAM,YAAYC,YAAAA,oBAAoB,UAAU,MAAM,OAAO;AAC7D,QAAM,SAASC,YAAAA,WA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BAAyB,OAAO,SAAS,MAAS;AAAA,IAClD;AAAA,IACA;AAAA,EAAA;AAEJ;AAEA,SAAS,iBACP,OACA,OACG;AACH,SAAO,EAAE,GAAG,OAAO,GAAG,MAAA;AACxB;AAEA,SAAS,yBACP,OACA,KACA,MACG;AACH,QAAM,UAAU,EAAE,GAAG,MAAA;AACrB,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,QAAQ,GAAG;AAAA,EACpB,OAAO;AACL,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;;"}
|
|
@@ -14,9 +14,11 @@ export type RuntimeBarProps<T extends RuntimeBarValue = RuntimeBarValue> = {
|
|
|
14
14
|
families?: SpecRuntimeFamily[] | undefined;
|
|
15
15
|
/** Effort tiers offered when the catalog does not describe the model. */
|
|
16
16
|
reasoningEfforts?: string[] | undefined;
|
|
17
|
+
/** Locks model identity (family, backend, and model) while leaving effort editable. */
|
|
18
|
+
locked?: boolean | undefined;
|
|
17
19
|
ariaLabel?: string | undefined;
|
|
18
20
|
className?: string | undefined;
|
|
19
21
|
};
|
|
20
22
|
/** Self-describing runtime controls with segmented and combo presentations. */
|
|
21
|
-
export declare function RuntimeBar<T extends RuntimeBarValue>({ value, onChange, variant, models, families, reasoningEfforts, ariaLabel, className, }: RuntimeBarProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function RuntimeBar<T extends RuntimeBarValue>({ value, onChange, variant, models, families, reasoningEfforts, locked, ariaLabel, className, }: RuntimeBarProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
22
24
|
//# sourceMappingURL=RuntimeBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeBar.d.ts","sourceRoot":"","sources":["../../../src/data/runtime/RuntimeBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AASjE,OAAO,EAQL,KAAK,iBAAiB,EAC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EF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,IAAI;IACzE,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAChC;gFAC4E;IAC5E,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAC3C,yEAAyE;IACzE,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,uFAAuF;IACvF,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,CAAC,SAAS,eAAe,EAAE,EACpD,KAAK,EACL,QAAQ,EACR,OAAqB,EACrB,MAAW,EACX,QAAgC,EAChC,gBAA4C,EAC5C,MAAc,EACd,SAAqB,EACrB,SAAS,GACV,EAAE,eAAe,CAAC,CAAC,CAAC,2CA4HpB"}
|
|
@@ -13,6 +13,7 @@ function RuntimeBar({
|
|
|
13
13
|
models = [],
|
|
14
14
|
families = SPEC_RUNTIME_FAMILIES,
|
|
15
15
|
reasoningEfforts = DEFAULT_REASONING_EFFORTS,
|
|
16
|
+
locked = false,
|
|
16
17
|
ariaLabel = "Runtime",
|
|
17
18
|
className
|
|
18
19
|
}) {
|
|
@@ -88,6 +89,7 @@ function RuntimeBar({
|
|
|
88
89
|
selectedModel: resolvedModel,
|
|
89
90
|
selectedModelUnavailable,
|
|
90
91
|
supportedEfforts,
|
|
92
|
+
locked,
|
|
91
93
|
ariaLabel,
|
|
92
94
|
className,
|
|
93
95
|
onFamilyChange: (familyId) => applyBackend(familyId, selection.mode),
|
|
@@ -112,6 +114,7 @@ function RuntimeBar({
|
|
|
112
114
|
selectedMode: selection.mode,
|
|
113
115
|
reasoningEfforts,
|
|
114
116
|
supportedEfforts,
|
|
117
|
+
locked,
|
|
115
118
|
ariaLabel,
|
|
116
119
|
className,
|
|
117
120
|
onBackendChange: applyBackend,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeBar.js","sources":["../../../src/data/runtime/RuntimeBar.tsx"],"sourcesContent":["import { DEFAULT_REASONING_EFFORTS } from \"../chat/effort-icons\";\nimport type { ChatModel, ChatModelRuntime } from \"../chat/types\";\nimport { runtimeModelMatches } from \"./RuntimeBar.model\";\nimport { RuntimeBarCombo } from \"./RuntimeBarCombo\";\nimport { RuntimeBarSegments } from \"./RuntimeBarSegments\";\nimport { isSelectableModel } from \"./availability\";\nimport {\n effortOptionsForModel,\n reconcileModelCapabilities,\n} from \"./model-capabilities\";\nimport {\n SPEC_RUNTIME_FAMILIES,\n backendForFamilyMode,\n familyById,\n firstMode,\n modelBelongsToFamily,\n modelsForFamily,\n selectionForBackend,\n type SpecRuntimeFamily,\n} from \"./runtime-mode\";\n\nexport type RuntimeBarValue = ChatModelRuntime & {\n cliArgs?: Record<string, unknown>;\n};\n\nexport type RuntimeBarProps<T extends RuntimeBarValue = RuntimeBarValue> = {\n value: T;\n onChange: (value: T) => void;\n /** `segmented` uses field triggers; `combo` uses one direct-edit menu. */\n variant?: \"combo\" | \"segmented\";\n /** Model catalog. Only the selected family's models are listed; a family the\n * catalog does not describe is served by the segment's free-text entry. */\n models?: ChatModel[] | undefined;\n families?: SpecRuntimeFamily[] | undefined;\n /** Effort tiers offered when the catalog does not describe the model. */\n reasoningEfforts?: string[] | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n};\n\n/** Self-describing runtime controls with segmented and combo presentations. */\nexport function RuntimeBar<T extends RuntimeBarValue>({\n value,\n onChange,\n variant = \"segmented\",\n models = [],\n families = SPEC_RUNTIME_FAMILIES,\n reasoningEfforts = DEFAULT_REASONING_EFFORTS,\n ariaLabel = \"Runtime\",\n className,\n}: RuntimeBarProps<T>) {\n const selection = selectionForBackend(families, value.backend);\n const family = familyById(families, selection.family);\n const mode =\n family.modes.find((entry) => entry.id === selection.mode) ??\n firstMode(family);\n const modelOptions = modelsForFamily(models, family, value.backend);\n const selectedModel = models.find(\n (entry) =>\n isSelectableModel(entry) &&\n entry.runtime?.backend === value.backend &&\n runtimeModelMatches(entry, value)
|
|
1
|
+
{"version":3,"file":"RuntimeBar.js","sources":["../../../src/data/runtime/RuntimeBar.tsx"],"sourcesContent":["import { DEFAULT_REASONING_EFFORTS } from \"../chat/effort-icons\";\nimport type { ChatModel, ChatModelRuntime } from \"../chat/types\";\nimport { runtimeModelMatches } from \"./RuntimeBar.model\";\nimport { RuntimeBarCombo } from \"./RuntimeBarCombo\";\nimport { RuntimeBarSegments } from \"./RuntimeBarSegments\";\nimport { isSelectableModel } from \"./availability\";\nimport {\n effortOptionsForModel,\n reconcileModelCapabilities,\n} from \"./model-capabilities\";\nimport {\n SPEC_RUNTIME_FAMILIES,\n backendForFamilyMode,\n familyById,\n firstMode,\n modelBelongsToFamily,\n modelsForFamily,\n selectionForBackend,\n type SpecRuntimeFamily,\n} from \"./runtime-mode\";\n\nexport type RuntimeBarValue = ChatModelRuntime & {\n cliArgs?: Record<string, unknown>;\n};\n\nexport type RuntimeBarProps<T extends RuntimeBarValue = RuntimeBarValue> = {\n value: T;\n onChange: (value: T) => void;\n /** `segmented` uses field triggers; `combo` uses one direct-edit menu. */\n variant?: \"combo\" | \"segmented\";\n /** Model catalog. Only the selected family's models are listed; a family the\n * catalog does not describe is served by the segment's free-text entry. */\n models?: ChatModel[] | undefined;\n families?: SpecRuntimeFamily[] | undefined;\n /** Effort tiers offered when the catalog does not describe the model. */\n reasoningEfforts?: string[] | undefined;\n /** Locks model identity (family, backend, and model) while leaving effort editable. */\n locked?: boolean | undefined;\n ariaLabel?: string | undefined;\n className?: string | undefined;\n};\n\n/** Self-describing runtime controls with segmented and combo presentations. */\nexport function RuntimeBar<T extends RuntimeBarValue>({\n value,\n onChange,\n variant = \"segmented\",\n models = [],\n families = SPEC_RUNTIME_FAMILIES,\n reasoningEfforts = DEFAULT_REASONING_EFFORTS,\n locked = false,\n ariaLabel = \"Runtime\",\n className,\n}: RuntimeBarProps<T>) {\n const selection = selectionForBackend(families, value.backend);\n const family = familyById(families, selection.family);\n const mode =\n family.modes.find((entry) => entry.id === selection.mode) ??\n firstMode(family);\n const modelOptions = modelsForFamily(models, family, value.backend);\n const selectedModel = models.find(\n (entry) =>\n isSelectableModel(entry) &&\n entry.runtime?.backend === value.backend &&\n runtimeModelMatches(entry, value),\n );\n const resolvedModel =\n selectedModel ??\n models.find(\n (entry) => isSelectableModel(entry) && runtimeModelMatches(entry, value),\n );\n const selectedModelUnavailable = Boolean(\n value.model &&\n models.some(\n (entry) => !isSelectableModel(entry) && runtimeModelMatches(entry, value),\n ),\n );\n const supportedEfforts = effortOptionsForModel(\n resolvedModel,\n reasoningEfforts,\n );\n\n const applyBackend = (familyId: string, modeId: string) => {\n const backend = backendForFamilyMode(families, familyId, modeId);\n if (backend === (value.backend ?? \"\")) return;\n let next = withOptionalRuntimeValue(\n withRuntimeValue(value, { backend }),\n \"cliArgs\",\n undefined,\n );\n if (\n !modelBelongsToFamily(\n value.model,\n models,\n familyById(families, familyId),\n backend,\n )\n ) {\n next = withoutCatalogModel(next);\n }\n onChange(next);\n };\n\n const applyCustomModel = (model: string) =>\n onChange(\n withOptionalRuntimeValue(withoutCatalogModel(value), \"model\", model),\n );\n // A menu row carries the backend of the catalog it was listed under, and one\n // catalog serves several backends — claude-cli and claude-cmux models are\n // listed as claude-agent rows. Copying the row's runtime verbatim would let\n // picking a model silently move the user off the mode they chose, so a row\n // drawn from the selected mode's own catalog keeps that mode.\n const applyModel = (model: ChatModel) => {\n const next = reconcileModelCapabilities(value, model, reasoningEfforts);\n if (!mode.provider || model.provider !== mode.provider) {\n onChange(next);\n return;\n }\n onChange(\n withOptionalRuntimeValue(\n withOptionalRuntimeValue(next, \"backend\", mode.backend),\n \"mode\",\n mode.id,\n ),\n );\n };\n const clearModel = () => onChange(withoutCatalogModel(value));\n const applyEffort = (effort: string) =>\n onChange(withOptionalRuntimeValue(value, \"effort\", effort));\n\n if (variant === \"combo\") {\n return (\n <RuntimeBarCombo\n value={value}\n families={families}\n family={family}\n mode={mode}\n selectedMode={selection.mode}\n models={modelOptions}\n selectedModel={resolvedModel}\n selectedModelUnavailable={selectedModelUnavailable}\n supportedEfforts={supportedEfforts}\n locked={locked}\n ariaLabel={ariaLabel}\n className={className}\n onFamilyChange={(familyId) => applyBackend(familyId, selection.mode)}\n onModeChange={(modeId) => applyBackend(family.id, modeId)}\n onModelSelect={applyModel}\n onModelClear={clearModel}\n onEffortChange={applyEffort}\n />\n );\n }\n\n return (\n <RuntimeBarSegments\n value={value}\n models={models}\n modelOptions={modelOptions}\n resolvedModel={resolvedModel}\n selectedModelUnavailable={selectedModelUnavailable}\n families={families}\n family={family}\n mode={mode}\n selectedMode={selection.mode}\n reasoningEfforts={reasoningEfforts}\n supportedEfforts={supportedEfforts}\n locked={locked}\n ariaLabel={ariaLabel}\n className={className}\n onBackendChange={applyBackend}\n onCustomModel={applyCustomModel}\n onModelSelect={applyModel}\n onModelClear={clearModel}\n onEffortChange={applyEffort}\n />\n );\n}\n\nfunction withoutCatalogModel<T extends RuntimeBarValue>(value: T): T {\n return withOptionalRuntimeValue(\n withOptionalRuntimeValue(value, \"model\", undefined),\n \"id\",\n undefined,\n );\n}\n\nfunction withRuntimeValue<T extends RuntimeBarValue>(\n value: T,\n patch: Partial<RuntimeBarValue>,\n): T {\n return { ...value, ...patch };\n}\n\nfunction withOptionalRuntimeValue<T extends RuntimeBarValue>(\n value: T,\n key: keyof RuntimeBarValue,\n next: unknown,\n): T {\n const updated = { ...value } as Record<string, unknown>;\n if (next === undefined || next === \"\") {\n delete updated[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AA,MACjB,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,MACd,gBAAgB;AAAA,IAAA;AAAA,EAAA;AAGtB;AAEA,SAAS,oBAA+C,OAAa;AACnE,SAAO;AAAA,IACL,yBAAyB,OAAO,SAAS,MAAS;AAAA,IAClD;AAAA,IACA;AAAA,EAAA;AAEJ;AAEA,SAAS,iBACP,OACA,OACG;AACH,SAAO,EAAE,GAAG,OAAO,GAAG,MAAA;AACxB;AAEA,SAAS,yBACP,OACA,KACA,MACG;AACH,QAAM,UAAU,EAAE,GAAG,MAAA;AACrB,MAAI,SAAS,UAAa,SAAS,IAAI;AACrC,WAAO,QAAQ,GAAG;AAAA,EACpB,OAAO;AACL,YAAQ,GAAG,IAAI;AAAA,EACjB;AACA,SAAO;AACT;"}
|
|
@@ -22,6 +22,7 @@ function RuntimeBarCombo({
|
|
|
22
22
|
selectedModel,
|
|
23
23
|
selectedModelUnavailable,
|
|
24
24
|
supportedEfforts,
|
|
25
|
+
locked,
|
|
25
26
|
ariaLabel,
|
|
26
27
|
className,
|
|
27
28
|
onFamilyChange,
|
|
@@ -34,7 +35,7 @@ function RuntimeBarCombo({
|
|
|
34
35
|
const modelLabel = selectedModelUnavailable ? "Unavailable selection" : (selectedModel == null ? void 0 : selectedModel.label) ?? value.model ?? "Prompt default";
|
|
35
36
|
const effortLabel = value.effort ? effortIcons.effortLevelLabel(value.effort) : "None";
|
|
36
37
|
const effortIcon = value.effort ? effortIcons.effortLevelIcon(value.effort) : void 0;
|
|
37
|
-
const summary = `${ariaLabel}: ${family.label}, ${mode.label}, ${modelLabel}, effort ${effortLabel}`;
|
|
38
|
+
const summary = `${ariaLabel}: ${family.label}, ${mode.label}, ${modelLabel}, effort ${effortLabel}${locked ? ". Model and backend are locked for this conversation; fork it to change them" : ""}`;
|
|
38
39
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
40
|
DropdownMenu.DropdownMenu,
|
|
40
41
|
{
|
|
@@ -89,11 +90,13 @@ function RuntimeBarCombo({
|
|
|
89
90
|
),
|
|
90
91
|
children: () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-1 text-xs", children: [
|
|
91
92
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 border-b border-border px-2 pb-3 pt-2", children: [
|
|
93
|
+
locked && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded bg-muted px-2 py-1.5 text-[11px] text-muted-foreground", children: "Model and backend are locked. Fork this conversation to change them." }),
|
|
92
94
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
93
95
|
FamilySegments,
|
|
94
96
|
{
|
|
95
97
|
families,
|
|
96
98
|
value: family.id,
|
|
99
|
+
locked,
|
|
97
100
|
onChange: onFamilyChange
|
|
98
101
|
}
|
|
99
102
|
),
|
|
@@ -102,6 +105,7 @@ function RuntimeBarCombo({
|
|
|
102
105
|
{
|
|
103
106
|
family,
|
|
104
107
|
value: selectedMode,
|
|
108
|
+
locked,
|
|
105
109
|
onChange: onModeChange
|
|
106
110
|
}
|
|
107
111
|
),
|
|
@@ -120,6 +124,7 @@ function RuntimeBarCombo({
|
|
|
120
124
|
models,
|
|
121
125
|
familyBrand: brand,
|
|
122
126
|
selectedId: (selectedModel == null ? void 0 : selectedModel.id) ?? value.model,
|
|
127
|
+
locked,
|
|
123
128
|
onSelect: onModelSelect,
|
|
124
129
|
onClear: onModelClear
|
|
125
130
|
}
|
|
@@ -131,6 +136,7 @@ function RuntimeBarCombo({
|
|
|
131
136
|
function FamilySegments({
|
|
132
137
|
families,
|
|
133
138
|
value,
|
|
139
|
+
locked,
|
|
134
140
|
onChange
|
|
135
141
|
}) {
|
|
136
142
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -149,6 +155,7 @@ function FamilySegments({
|
|
|
149
155
|
return {
|
|
150
156
|
id: family.id,
|
|
151
157
|
label: family.label,
|
|
158
|
+
disabled: locked,
|
|
152
159
|
...brand.icon ? { icon: brand.icon } : {}
|
|
153
160
|
};
|
|
154
161
|
})
|
|
@@ -158,6 +165,7 @@ function FamilySegments({
|
|
|
158
165
|
function ModeSegments({
|
|
159
166
|
family,
|
|
160
167
|
value,
|
|
168
|
+
locked,
|
|
161
169
|
onChange
|
|
162
170
|
}) {
|
|
163
171
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -171,6 +179,7 @@ function ModeSegments({
|
|
|
171
179
|
options: family.modes.filter((mode) => !availability.isUnavailable(mode.availability)).map((mode) => ({
|
|
172
180
|
id: mode.id,
|
|
173
181
|
label: mode.label,
|
|
182
|
+
disabled: locked,
|
|
174
183
|
...mode.title ? { title: mode.title } : {},
|
|
175
184
|
...mode.icon ? { icon: mode.icon } : {}
|
|
176
185
|
}))
|
|
@@ -181,6 +190,7 @@ function ModelChoices({
|
|
|
181
190
|
models,
|
|
182
191
|
familyBrand,
|
|
183
192
|
selectedId,
|
|
193
|
+
locked,
|
|
184
194
|
onSelect,
|
|
185
195
|
onClear
|
|
186
196
|
}) {
|
|
@@ -190,6 +200,7 @@ function ModelChoices({
|
|
|
190
200
|
{
|
|
191
201
|
label: "Prompt default",
|
|
192
202
|
selected: !selectedId,
|
|
203
|
+
disabled: locked,
|
|
193
204
|
onClick: onClear
|
|
194
205
|
}
|
|
195
206
|
),
|
|
@@ -201,6 +212,7 @@ function ModelChoices({
|
|
|
201
212
|
label: model.label,
|
|
202
213
|
title: model.id,
|
|
203
214
|
selected: model.id === selectedId,
|
|
215
|
+
disabled: locked,
|
|
204
216
|
...icon ? {
|
|
205
217
|
icon,
|
|
206
218
|
iconColor: providerIcons.providerIconColor(model.provider) ?? familyBrand.color
|
|
@@ -217,6 +229,7 @@ function ModelChoice({
|
|
|
217
229
|
title,
|
|
218
230
|
detail,
|
|
219
231
|
selected,
|
|
232
|
+
disabled,
|
|
220
233
|
icon,
|
|
221
234
|
iconColor,
|
|
222
235
|
onClick
|
|
@@ -226,6 +239,7 @@ function ModelChoice({
|
|
|
226
239
|
{
|
|
227
240
|
variant: "ghost",
|
|
228
241
|
type: "button",
|
|
242
|
+
disabled,
|
|
229
243
|
onClick,
|
|
230
244
|
"aria-label": detail ? `${label}. ${detail}` : label,
|
|
231
245
|
...title ? { title } : {},
|