@ocai/app-sdk-ui 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat/message-trace.d.ts +3 -2
- package/dist/chat/shiki-theme.d.ts +6 -0
- package/dist/chat/sources.d.ts +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +594 -292
- package/dist/internal/collapsible.d.ts +2 -1
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -1,84 +1,338 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { createCodePlugin as e } from "@streamdown/code";
|
|
3
|
+
import { createMathPlugin as t } from "@streamdown/math";
|
|
4
|
+
import { Streamdown as n } from "streamdown";
|
|
5
|
+
import { clsx as r } from "clsx";
|
|
6
|
+
import { twMerge as i } from "tailwind-merge";
|
|
7
|
+
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon as c, ChevronDownIcon as l, CircleCheckIcon as u, ClockIcon as d, GlobeIcon as f, Loader2Icon as p, WrenchIcon as m, XIcon as h } from "lucide-react";
|
|
9
|
+
import { createContext as g, isValidElement as _, memo as v, useContext as ee, useEffect as y, useId as b, useRef as x, useState as S } from "react";
|
|
10
|
+
import { Collapsible as C, Slot as w, Tooltip as T } from "radix-ui";
|
|
11
|
+
import { cva as E } from "class-variance-authority";
|
|
11
12
|
//#region src/lib/cn.ts
|
|
12
|
-
function
|
|
13
|
-
return r(
|
|
13
|
+
function D(...e) {
|
|
14
|
+
return i(r(e));
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var O = [{
|
|
17
|
+
name: "codex-light",
|
|
18
|
+
type: "light",
|
|
19
|
+
fg: "#383a42",
|
|
20
|
+
bg: "transparent",
|
|
21
|
+
tokenColors: [
|
|
22
|
+
{
|
|
23
|
+
scope: /* @__PURE__ */ "customrule(keyword.control.as.js(keyword.control.as.jsx(keyword.control.as.ts(keyword.control.as.tsx(keyword.operator(markup.heading.setext(markup.raw.block.markdown(meta.array-binding-pattern-variable.js(meta.array-binding-pattern-variable.ts(meta.array-binding-pattern-variable.tsx(meta.brace.round.js(meta.brace.round.ts(meta.brace.round.tsx(meta.brace.square.js(meta.brace.square.ts(meta.brace.square.tsx(meta.class.body(meta.class.js,meta.class.ts,meta.class.jsx,meta.class.tsx(meta.class.php(meta.definition.property.js variable(meta.definition.property.jsx variable(meta.definition.property.ts variable(meta.definition.property.tsx variable(meta.method(meta.method-call(meta.property-list.scss punctuation.separator.key-value.scss(meta.separator(meta.tag(meta.tag.js punctuation.section.embedded(meta.tag.jsx punctuation.section.embedded(meta.tag.ts punctuation.section.embedded(meta.tag.tsx punctuation.section.embedded(meta.type.parameters.js support.type(meta.type.parameters.jsx support.type(meta.type.parameters.ts support.type(meta.type.parameters.tsx support.type(ng.attribute-with-value string.begin(ng.attribute-with-value string.end(ng.interpolation bracket(ng.operator(ng.pipe(none(punctuation.definition.array(punctuation.definition.function-parameters(punctuation.definition.metadata.markdown(punctuation.definition.method-parameters(punctuation.definition.parameters(punctuation.definition.separator(punctuation.definition.seperator(punctuation.definition.string.begin.markdown(punctuation.definition.string.end.markdown(punctuation.section.class(punctuation.section.inner-class(punctuation.section.method(punctuation.separator.annotation.python(punctuation.separator.parameter.js(punctuation.separator.parameter.ts(punctuation.separator.parameter.tsx (punctuation.separator.parameters.python(punctuation.terminator.statement.js(punctuation.terminator.statement.ts(punctuation.terminator.statement.tsx(source.cs keyword.operator(source.css property-name.support(source.css property-value.support(source.elixir source.embedded.source(source.java-properties meta.key-pair > punctuation(source.js meta.import-equals.external.js keyword.operator(source.js meta.tag.js keyword.operator(source.js punctuation.accessor(source.js punctuation.definition.block(source.js punctuation.definition.typeparameters(source.js punctuation.separator.comma(source.jsx meta.import-equals.external.jsx keyword.operator(source.jsx meta.tag.jsx keyword.operator(source.php class.bracket(source.python constant.other(source.ts meta.import-equals.external.ts keyword.operator(source.ts meta.tag.ts keyword.operator(source.ts punctuation.accessor(source.ts punctuation.definition.block(source.ts punctuation.definition.typeparameters(source.ts punctuation.separator.comma(source.tsx meta.import-equals.external.tsx keyword.operator(source.tsx meta.tag.tsx keyword.operator(source.tsx punctuation.accessor(source.tsx punctuation.definition.block(source.tsx punctuation.definition.typeparameters(source.tsx punctuation.separator.comma(storage.modifier.import(storage.modifier.lifetime.rust(storage.modifier.package(string > source(string embedded(support.constant.property-value.css(support.type.property-name(variable.other.object.cs(variable.other.object.js(variable.other.object.property.cs(variable.other.object.ts(variable.other.readwrite.cs(variable.other.readwrite.js(variable.other.readwrite.ts(variable.other.readwrite.tsx(variable.parameter".split("("),
|
|
24
|
+
settings: { foreground: "#383A42" }
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
scope: /* @__PURE__ */ "beginning.punctuation.definition.list.markdown,constant.language.import-export-all.js,constant.language.import-export-all.ts,entity.name.section.markdown,entity.name.tag,entity.name.variable.field.cs,keyword.control.default.js,keyword.control.default.ts,keyword.control.default.tsx,markup.deleted,markup.heading,meta.definition.variable,meta.export.default.js variable.other.readwrite.js,meta.export.default.ts variable.other.readwrite.ts,meta.object-literal.key.js,meta.object-literal.key.ts,ng.interpolation,ng.interpolation function,punctuation.definition.heading.markdown,punctuation.definition.variable.php,punctuation.definition.variable.shell,punctuation.separator.key-value.scss,punctuation.separator.variable.ruby,source.elixir embedded.section,source.elixir embedded.source.empty,source.elixir keyword.special-method,source.elixir readwrite.module punctuation,source.ini keyword.other.definition.ini,source.java-properties meta.key-pair,source.js support.variable,source.json meta.structure.dictionary.json > string.quoted.json,source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string,source.ts support.variable,source.tsx support.variable,string.other.link,support.type.object.module.js,support.type.object.module.jsx,support.type.object.module.ts,support.type.object.module.tsx,support.type.property-name.json,support.type.property-name.json punctuation,support.variable.dom.js,support.variable.dom.ts,support.variable.magic.python,support.variable.property.dom.js,support.variable.property.dom.ts,support.variable.property.js,support.variable.property.ts,support.variable.property.tsx,variable,variable.other.readwrite.alias.js,variable.other.readwrite.alias.jsx,variable.other.readwrite.alias.ts,variable.other.readwrite.alias.tsx".split(","),
|
|
28
|
+
settings: { foreground: "#E45649" }
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
scope: /* @__PURE__ */ "keyword,keyword.control,keyword.operator.expression.in.js,keyword.operator.expression.in.jsx,keyword.operator.expression.in.ts,keyword.operator.expression.in.tsx,keyword.operator.expression.instanceof.js,keyword.operator.expression.instanceof.ts,keyword.operator.expression.instanceof.tsx,keyword.operator.expression.of.js,keyword.operator.expression.of.ts,keyword.operator.expression.of.tsx,keyword.operator.new.j,keyword.operator.new.ts,keyword.operator.new.tsx,keyword.other.unsafe.rust,markup.changed,markup.underline.link.image.markdown,markup.underline.link.markdown,meta.selector,ng.attribute-with-value string,punctuation.definition.metadata.markdown,source.c keyword.operator,source.cpp keyword.operator,source.cs keyword.operator,source.elixir variable.anonymous,source.elixir variable.definition,source.go storage.type.string,source.java keyword.operator.instanceof,source.js keyword.operator.delete,source.js keyword.operator.in,source.js keyword.operator.instanceof,source.js keyword.operator.new,source.js keyword.operator.of,source.js keyword.operator.typeof,source.js keyword.operator.void,source.python keyword.operator.logical.python,storage,storage.type.annotation,storage.type.primitive".split(","),
|
|
32
|
+
settings: { foreground: "#A626A4" }
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
scope: /* @__PURE__ */ "constant,constant.character.format.placeholder.other.python storage,constant.numeric,constant.variable,entity.name.lifetime.rust,entity.other.attribute-name,keyword.other.unit,markup.quote,meta.array-binding-pattern-variable.js variable.other.readwrite.js,meta.array-binding-pattern-variable.ts variable.other.readwrite.ts,meta.array-binding-pattern-variable.tsx variable.other.readwrite.tsx,meta.attribute.rust,meta.function.parameters.python,meta.link,ng.interpolation bool,punctuation.definition.bold.markdown,punctuation.definition.constant.css,punctuation.definition.constant.scss,source.elixir keyword.operator,source.elixir separator,source.python constant,source.python variable.parameter,support.constant,variable.other.constant.js,variable.other.constant.jsx,variable.other.constant.object.js,variable.other.constant.object.jsx,variable.other.constant.object.ts,variable.other.constant.object.tsx,variable.other.constant.property.js,variable.other.constant.property.ts,variable.other.constant.property.tsx,variable.other.constant.ruby,variable.other.constant.ts,variable.other.constant.tsx".split(","),
|
|
36
|
+
settings: { foreground: "#986801" }
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
scope: /* @__PURE__ */ "constant.character.escape,constant.language.import-export-all.jsx,constant.language.import-export-all.tsx,constant.language.json,constant.other.color,constant.other.symbol,entity.name.type.rust,markup.link,ng.tag,punctuation.separator.key-value.js,punctuation.separator.key-value.ts,punctuation.separator.key-value.tsx,source.flow keyword.operator,source.js keyword.operator,source.js.embedded.html keyword.operator,source.json meta.structure.array.json > constant.language.json,source.json meta.structure.dictionary.json > constant.language.json,source.ts keyword.operator,source.ts.embedded.html keyword.operator,source.tsx keyword.operator,storage.class.std.rust,storage.type.core.rust,storage.type.property.js,storage.type.property.jsx,storage.type.property.ts,storage.type.property.tsx,string.regexp,support.function,support.type".split(","),
|
|
40
|
+
settings: { foreground: "#0184BC" }
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
scope: [
|
|
44
|
+
"entity.name.type.module.js,entity.name.type.module.ts,entity.name.type.module.jsx,entity.name.type.module.tsx",
|
|
45
|
+
"keyword.operator.other.ruby",
|
|
46
|
+
"markup.inline.raw.markdown",
|
|
47
|
+
"markup.inserted",
|
|
48
|
+
"markup.raw",
|
|
49
|
+
"meta.template.expression.js string.quoted punctuation.definition",
|
|
50
|
+
"meta.template.expression.js string.template punctuation.definition.string.template",
|
|
51
|
+
"meta.template.expression.jsx string.quoted punctuation.definition",
|
|
52
|
+
"meta.template.expression.jsx string.template punctuation.definition.string.template",
|
|
53
|
+
"meta.template.expression.ts string.quoted punctuation.definition",
|
|
54
|
+
"meta.template.expression.ts string.template punctuation.definition.string.template",
|
|
55
|
+
"meta.template.expression.tsx string.quoted punctuation.definition",
|
|
56
|
+
"meta.template.expression.tsx string.template punctuation.definition.string.template",
|
|
57
|
+
"source.elixir quoted",
|
|
58
|
+
"source.js meta.template.expression.js punctuation.accessor",
|
|
59
|
+
"source.json meta.structure.array.json > value.json > string.quoted.json",
|
|
60
|
+
"source.json meta.structure.array.json > value.json > string.quoted.json > punctuation",
|
|
61
|
+
"source.json meta.structure.dictionary.json > value.json > string.quoted.json",
|
|
62
|
+
"source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation",
|
|
63
|
+
"source.ts meta.template.expression.ts punctuation.accessor",
|
|
64
|
+
"source.tsx meta.template.expression.tsx punctuation.accessor",
|
|
65
|
+
"string",
|
|
66
|
+
"string.quoted.double punctuation"
|
|
67
|
+
],
|
|
68
|
+
settings: { foreground: "#50A14F" }
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
scope: [
|
|
72
|
+
"entity.name.function",
|
|
73
|
+
"entity.name.section",
|
|
74
|
+
"entity.name.variable.property.cs",
|
|
75
|
+
"entity.other.attribute-name.id",
|
|
76
|
+
"keyword.other.special-method",
|
|
77
|
+
"markup.heading punctuation.definition.heading",
|
|
78
|
+
"meta.require",
|
|
79
|
+
"ng.interpolation function.begin",
|
|
80
|
+
"ng.interpolation function.end",
|
|
81
|
+
"ng.interpolation.begin",
|
|
82
|
+
"ng.interpolation.end",
|
|
83
|
+
"punctuation.definition.heading",
|
|
84
|
+
"punctuation.definition.identity",
|
|
85
|
+
"source.elixir constant.definition",
|
|
86
|
+
"source.elixir constant.language",
|
|
87
|
+
"source.elixir constant.numeric",
|
|
88
|
+
"source.gfm link entity",
|
|
89
|
+
"string.other.link.description.markdown",
|
|
90
|
+
"string.other.link.title.markdown",
|
|
91
|
+
"support.function.any-method"
|
|
92
|
+
],
|
|
93
|
+
settings: { foreground: "#4078F2" }
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
scope: [
|
|
97
|
+
"entity.name.class",
|
|
98
|
+
"entity.name.type",
|
|
99
|
+
"entity.name.type.class",
|
|
100
|
+
"entity.other.inherited-class",
|
|
101
|
+
"meta.array.literal.js variable",
|
|
102
|
+
"meta.array.literal.jsx variable",
|
|
103
|
+
"meta.array.literal.ts variable",
|
|
104
|
+
"meta.array.literal.tsx variable",
|
|
105
|
+
"meta.class",
|
|
106
|
+
"ng.attribute-with-value attribute-name",
|
|
107
|
+
"source.elixir variable.constant",
|
|
108
|
+
"source.java storage.modifier.import",
|
|
109
|
+
"source.java storage.type",
|
|
110
|
+
"storage.type.cs",
|
|
111
|
+
"storage.type.primitive.array.java",
|
|
112
|
+
"string.regexp source.ruby.embedded",
|
|
113
|
+
"support.class"
|
|
114
|
+
],
|
|
115
|
+
settings: { foreground: "#C18401" }
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
scope: [
|
|
119
|
+
"meta.template.expression.js punctuation.definition",
|
|
120
|
+
"meta.template.expression.ts punctuation.definition",
|
|
121
|
+
"punctuation.section.embedded",
|
|
122
|
+
"source.elixir regexp.section",
|
|
123
|
+
"source.elixir regexp.string",
|
|
124
|
+
"variable.interpolation"
|
|
125
|
+
],
|
|
126
|
+
settings: { foreground: "#CA1243" }
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
scope: [
|
|
130
|
+
"source.css property-name",
|
|
131
|
+
"source.css property-value",
|
|
132
|
+
"source.elixir array",
|
|
133
|
+
"source.elixir scope",
|
|
134
|
+
"source.elixir section"
|
|
135
|
+
],
|
|
136
|
+
settings: { foreground: "#696C77" }
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
scope: ["comment", "markup.quote.markdown"],
|
|
140
|
+
settings: {
|
|
141
|
+
foreground: "#A0A1A7",
|
|
142
|
+
fontStyle: "italic"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
scope: ["comment markup.link", "punctuation.definition.comment"],
|
|
147
|
+
settings: { foreground: "#A0A1A7" }
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
scope: ["markup.italic", "punctuation.definition.italic"],
|
|
151
|
+
settings: {
|
|
152
|
+
foreground: "#A626A4",
|
|
153
|
+
fontStyle: "italic"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
scope: ["punctuation.definition.bold"],
|
|
158
|
+
settings: {
|
|
159
|
+
foreground: "#C18401",
|
|
160
|
+
fontStyle: "bold"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
scope: ["invalid.deprecated"],
|
|
165
|
+
settings: {
|
|
166
|
+
foreground: "#000000",
|
|
167
|
+
background: "#F2A60D"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
scope: ["invalid.illegal"],
|
|
172
|
+
settings: {
|
|
173
|
+
foreground: "#50A14F",
|
|
174
|
+
background: "#FF1414"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
scope: ["markup.bold"],
|
|
179
|
+
settings: {
|
|
180
|
+
foreground: "#986801",
|
|
181
|
+
fontStyle: "bold"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
scope: ["source.elixir parameter.variable.function"],
|
|
186
|
+
settings: {
|
|
187
|
+
foreground: "#986801",
|
|
188
|
+
fontStyle: "italic"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
scope: ["source.ruby constant.other.symbol > punctuation"],
|
|
193
|
+
settings: { foreground: "inherit" }
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}, {
|
|
197
|
+
name: "codex-dark",
|
|
198
|
+
type: "dark",
|
|
199
|
+
fg: "#ffffff",
|
|
200
|
+
bg: "transparent",
|
|
201
|
+
tokenColors: [
|
|
202
|
+
{
|
|
203
|
+
scope: /* @__PURE__ */ "beginning.punctuation.definition.list.markdown(constant(constant.character.character-class.regexp.xi(constant.character.entity(constant.character.format.placeholder.other.python(constant.numeric(constant.other.character-class.regexp(control.elements, keyword.operator.less(entity.global.clojure(entity.name.class(entity.name.class.identifier.namespace.type(entity.name.function.xi(entity.name.label(entity.name.label.cs(entity.name.lifetime.rust(entity.name.namespace(entity.name.package.go(entity.name.scope-resolution.function.call(entity.name.scope-resolution.function.definition(entity.name.section.markdown(entity.name.tag(entity.name.type(entity.name.type.module(entity.name.type.namespace(entity.name.variable.field.cs(entity.name.variable.local.cs(entity.name.variable.parameter.cs(entity.other.attribute-name(entity.other.attribute-name.class.css(entity.other.inherited-class(import.storage.java(inline-color-decoration rgb-value(invalid.deprecated.entity.other.attribute-name.html(invalid.illegal.unrecognized-tag.html(keyword.operator.assignment.go(keyword.operator.quantifier.regexp(keyword.other.unit(less rgb-value(log.error(log.warning(markup.bold,todo.bold(markup.changed.diff(markup.deleted(markup.deleted.diff(markup.heading(markup.heading.setext.1.markdown(markup.heading.setext.2.markdown(markup.list.asciidoc(meta.arguments.coffee(meta.definition.variable.name.groovy(meta.definition.variable.name.java(meta.function.c,meta.function.cpp(meta.property.object(meta.scope.prerequisites.makefile(meta.symbol.clojure(punctuation.definition.asciidoc(punctuation.definition.bold(punctuation.definition.bold.markdown(punctuation.definition.constant(punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison(punctuation.definition.heading.markdown(punctuation.definition.list.begin.markdown(punctuation.definition.list.markdown(punctuation.definition.metadata.markdown(punctuation.definition.raw.markdown(punctuation.definition.string.begin.markdown(punctuation.definition.string.end.markdown(punctuation.section.embedded, variable.interpolation(selector.sass(source.java(source.json meta.structure.dictionary.json > string.quoted.json(source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string(source.makefile(storage.modifier.import.groovy(storage.modifier.import.java,storage.type.java,storage.type.generic.java(storage.type.annotation.java(storage.type.cs(storage.type.haskell(storage.type.object.array.java(storage.type.php,meta.other.type.phpdoc.php,keyword.other.type.php,keyword.other.array.phpdoc.php(string.regexp(support.class, entity.name.type.class(support.constant.color.w3c-standard-color-name.css(support.constant.color.w3c-standard-color-name.css,support.constant.color.w3c-standard-color-name.scss(support.constant.core.rust(support.constant.elm(support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php(support.constant.font-name(support.constant.json(support.constant.math(support.constant.property-value.scss,support.constant.property-value.css(support.constant.property.math(support.module.node,support.type.object.module,support.module.node(support.other.namespace.use.php,support.other.namespace.use-as.php,entity.other.alias.php,meta.interface.php(support.other.parenthesis.regexp(support.type.object.console(support.type.primitive(support.type.primitive.ts,support.type.builtin.ts,support.type.primitive.tsx,support.type.builtin.tsx(support.type.property-name.json(support.type.property-name.json punctuation(support.type.property-name.toml, support.type.property-name.table.toml, support.type.property-name.array.toml(support.type.swift(support.type.vb.asp(support.variable.dom,support.variable.property.dom(support.variable.magic.python(support.variable.property.process(support.variable.semantic.hlsl(text.bracketed(text.variable(token.storage.type.java(token.warn-token(variable(variable.language(variable.language.rust(variable.other.class.js(variable.other.class.php(variable.other.class.ts(variable.other.constant(variable.other.constant.property(variable.other.object(variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node(variable.other.readwrite.c(variable.parameter.function.coffee(variable.parameter.function.js(variable.parameter.function.language.python(variable.parameter.function.language.special.cls.python(variable.parameter.function.language.special.self.python(variable.parameter.function.latex(variable.parameter.function.python(wikiword.xi".split("("),
|
|
204
|
+
settings: { foreground: "#df3079" }
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
scope: /* @__PURE__ */ "constant.character.escape(constant.keyword.clojure(constant.language.symbol.double-quoted.elixir(constant.language.symbol.elixir(constant.language.symbol.hashkey.ruby(constant.language.symbol.ruby(constant.numeric.decimal.asm.x86_64(constant.other.symbol(constant.regexp.xi(emphasis md(entity.name.class.xi(entity.other.attribute-name.pseudo-class(entity.other.attribute-name.pseudo-element(keyword(keyword.control(keyword.control.xi(keyword.operator.address.go(keyword.operator.arithmetic,keyword.operator.comparison,keyword.operator.decrement,keyword.operator.increment,keyword.operator.relational(keyword.operator.arithmetic.c(keyword.operator.arithmetic.cpp(keyword.operator.arithmetic.go(keyword.operator.assignment(keyword.operator.assignment.c,keyword.operator.comparison.c,keyword.operator.c,keyword.operator.increment.c,keyword.operator.decrement.c,keyword.operator.bitwise.shift.c,keyword.operator.assignment.cpp,keyword.operator.comparison.cpp,keyword.operator.cpp,keyword.operator.increment.cpp,keyword.operator.decrement.cpp,keyword.operator.bitwise.shift.cpp(keyword.operator.assignment.compound(keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts(keyword.operator.bitwise(keyword.operator.channel(keyword.operator.comparison.php(keyword.operator.css,keyword.operator.scss,keyword.operator.less(keyword.operator.delete(keyword.operator.error-control.php(keyword.operator.expression.delete,keyword.operator.expression.in,keyword.operator.expression.of,keyword.operator.expression.instanceof,keyword.operator.new,keyword.operator.expression.typeof,keyword.operator.expression.void(keyword.operator.expression.instanceof(keyword.operator.expression.is(keyword.operator.expression.keyof(keyword.operator.heredoc.php,keyword.operator.nowdoc.php(keyword.operator.instanceof.java(keyword.operator.logical(keyword.operator.logical.php,keyword.operator.bitwise.php,keyword.operator.arithmetic.php(keyword.operator.logical.python(keyword.operator.module(keyword.operator.new(keyword.operator.optional(keyword.operator.regexp.php(keyword.operator.sigil.rust(keyword.operator.sizeof.c,keyword.operator.sizeof.cpp(keyword.operator.ternary(keyword.operator.type.php(keyword.operator.word(markup.italic, punctuation.definition.italic,todo.emphasis(markup.link.asciidoc,markup.other.url.asciidoc(markup.underline.link.markdown,markup.underline.link.image.markdown(meta.selector(punctuation.definition.template-expression.begin(punctuation.definition.template-expression.end(punctuation.quasi.element(punctuation.section.embedded(punctuation.section.embedded.begin,punctuation.section.embedded.end(punctuation.separator.c,punctuation.separator.cpp(rgb-value(source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json(storage(string.regexp(support.constant.edge(support.function(support.token.decorator.python,meta.function.decorator.identifier.python(support.type.fx.hlsl(support.type.object.dom(support.type.object.hlsl(support.type.object.rw.hlsl(support.type.posix-reserved.c,support.type.posix-reserved.cpp(support.type.prelude.elm(support.type.python(support.type.sampler.hlsl(support.type.texture.hlsl(support.type.vendored.property-name.css(text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade(text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade(token.debug-token(token.package.keyword(token.storage(variable.other.generic-type.haskell".split("("),
|
|
208
|
+
settings: { foreground: "#2e95d3" }
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
scope: /* @__PURE__ */ " meta.brace.square(block.scope.end,block.scope.begin(entity.name.variable.parameter.php,punctuation.separator.colon.php,constant.other.php(function.brace(function.parameter(function.parameter.ruby, function.parameter.cs(invalid.illegal.bad-ampersand.html(invalid.xi(keyword.operator(keyword.operator.misc.rust(markup.heading.setext(meta.embedded(meta.tag(meta.template.expression(punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python(punctuation.definition.block.sequence.item.yaml(punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.terminator.expression.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php(punctuation.section.array.begin.php(punctuation.section.array.end.php(punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.terminator.statement.c,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c(punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.terminator.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java(punctuation.section.embedded.begin.php(punctuation.section.embedded.end.php(punctuation.separator.delimiter(punctuation.separator.key-value(punctuation.separator.list.comma.css(punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python(storage.modifier.lifetime.rust(support.constant.property-value(support.other.namespace.php(support.type.property-name(token.package(token.variable.parameter.java(variable.c(variable.parameter.function".split("("),
|
|
212
|
+
settings: { foreground: "#ffffff" }
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
scope: /* @__PURE__ */ "accent.xi(constant.character.xi(constant.other.color.rgb-value.xi(constant.other.general.math.tex(entity.name.function(entity.name.function,support.function.console(entity.name.goto-label.php,support.other.php(entity.other.attribute-name.id(invalid.broken(invalid.deprecated(invalid.illegal(invalid.illegal.non-null-typehinted.php(invalid.unimplemented(keyword.operator.expression.import(keyword.other.special-method(markup.heading punctuation.definition.heading, entity.name.section(meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff(meta.function-call.generic.python(meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php(meta.function.decorator.python(meta.method.groovy(meta.method.java(meta.require(string.other.link.title.markdown,string.other.link.description.markdown(string.unquoted.asciidoc,markup.other.url.asciidoc(support.class.math.block.environment.latex(support.function.any-method(support.function.std.rust(support.type.type.flowtype(token.error-token(token.info-token(variable.function".split("("),
|
|
216
|
+
settings: { foreground: "#f22c3d" }
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
scope: [
|
|
220
|
+
"beginning.punctuation.definition.quote.markdown.xi",
|
|
221
|
+
"constant.character.math.tex",
|
|
222
|
+
"keyword.other.substitution.begin",
|
|
223
|
+
"keyword.other.substitution.end",
|
|
224
|
+
"keyword.other.template.begin",
|
|
225
|
+
"keyword.other.template.end",
|
|
226
|
+
"log.info",
|
|
227
|
+
"markup.inline.raw.markdown",
|
|
228
|
+
"markup.inline.raw.string.markdown",
|
|
229
|
+
"markup.inserted",
|
|
230
|
+
"markup.inserted.diff",
|
|
231
|
+
"markup.raw.monospace.asciidoc",
|
|
232
|
+
"meta.definition.class.inherited.classes.groovy",
|
|
233
|
+
"source.ini",
|
|
234
|
+
"source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation",
|
|
235
|
+
"string"
|
|
236
|
+
],
|
|
237
|
+
settings: { foreground: "#00a67d" }
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
scope: [
|
|
241
|
+
"beginning.punctuation.definition.list.markdown.xi",
|
|
242
|
+
"comment markup.link",
|
|
243
|
+
"markup.quote.markdown",
|
|
244
|
+
"punctuation.definition.tag.xi"
|
|
245
|
+
],
|
|
246
|
+
settings: { foreground: "#ffffff80" }
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
scope: ["comment, punctuation.definition.comment"],
|
|
250
|
+
settings: {
|
|
251
|
+
foreground: "#ffffff80",
|
|
252
|
+
fontStyle: "italic"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
scope: [
|
|
257
|
+
"meta.tag",
|
|
258
|
+
"punctuation.definition.tag",
|
|
259
|
+
"punctuation.definition.tag.begin",
|
|
260
|
+
"punctuation.definition.tag.end",
|
|
261
|
+
"keyword.other.shebang",
|
|
262
|
+
"meta.preprocessor"
|
|
263
|
+
],
|
|
264
|
+
settings: { foreground: "#ffffff99" }
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}], k = t({ singleDollarTextMath: !0 }), A = e({ themes: O });
|
|
268
|
+
function j({ className: e, ...t }) {
|
|
269
|
+
return /* @__PURE__ */ o(n, {
|
|
270
|
+
className: D("ocui-md size-full text-base font-normal leading-6 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_code]:whitespace-pre-wrap [&_code]:wrap-break-word [&_pre]:max-w-full [&_pre]:overflow-x-auto", e),
|
|
271
|
+
plugins: {
|
|
272
|
+
math: k,
|
|
273
|
+
code: A
|
|
274
|
+
},
|
|
22
275
|
controls: {
|
|
23
276
|
table: !1,
|
|
24
277
|
code: { download: !1 }
|
|
25
278
|
},
|
|
26
|
-
...
|
|
279
|
+
...t
|
|
27
280
|
});
|
|
28
281
|
}
|
|
29
282
|
//#endregion
|
|
30
283
|
//#region src/chat/message.tsx
|
|
31
|
-
var
|
|
284
|
+
var te = {
|
|
32
285
|
user: "w-fit wrap-break-word rounded-md bg-card px-3 py-1.5 text-primary",
|
|
33
286
|
assistant: "bg-transparent px-0 py-0 text-left text-foreground"
|
|
34
|
-
},
|
|
35
|
-
className:
|
|
287
|
+
}, ne = ({ children: e, className: t, variant: n = "user", ...r }) => /* @__PURE__ */ o("div", {
|
|
288
|
+
className: D("flex flex-col gap-2 overflow-hidden text-base font-normal leading-6", te[n], t),
|
|
36
289
|
...r,
|
|
37
290
|
children: e
|
|
38
291
|
});
|
|
39
292
|
//#endregion
|
|
40
293
|
//#region src/internal/collapsible.tsx
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */
|
|
294
|
+
function M({ ...e }) {
|
|
295
|
+
return /* @__PURE__ */ o(C.Root, {
|
|
43
296
|
"data-slot": "collapsible",
|
|
44
297
|
...e
|
|
45
298
|
});
|
|
46
299
|
}
|
|
47
|
-
function
|
|
48
|
-
return /* @__PURE__ */
|
|
300
|
+
function N({ ...e }) {
|
|
301
|
+
return /* @__PURE__ */ o(C.CollapsibleTrigger, {
|
|
49
302
|
"data-slot": "collapsible-trigger",
|
|
50
303
|
...e
|
|
51
304
|
});
|
|
52
305
|
}
|
|
53
|
-
function
|
|
54
|
-
return /* @__PURE__ */
|
|
306
|
+
function P({ ...e }) {
|
|
307
|
+
return /* @__PURE__ */ o(C.CollapsibleContent, {
|
|
55
308
|
"data-slot": "collapsible-content",
|
|
56
309
|
...e
|
|
57
310
|
});
|
|
58
311
|
}
|
|
312
|
+
var re = "overflow-hidden outline-hidden transition-opacity data-[state=closed]:opacity-0 data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up";
|
|
59
313
|
//#endregion
|
|
60
314
|
//#region src/chat/reasoning.tsx
|
|
61
|
-
function
|
|
62
|
-
let [r, i] =
|
|
315
|
+
function ie({ prop: e, defaultProp: t, onChange: n }) {
|
|
316
|
+
let [r, i] = S(t), a = e !== void 0;
|
|
63
317
|
return [a ? e : r, (e) => {
|
|
64
318
|
a || i(e), n?.(e);
|
|
65
319
|
}];
|
|
66
320
|
}
|
|
67
|
-
var
|
|
68
|
-
let e =
|
|
321
|
+
var F = g(null), ae = () => {
|
|
322
|
+
let e = ee(F);
|
|
69
323
|
if (!e) throw Error("Reasoning components must be used within Reasoning");
|
|
70
324
|
return e;
|
|
71
|
-
},
|
|
72
|
-
let [l, u] =
|
|
325
|
+
}, oe = 500, I = v(({ className: e, isStreaming: t = !1, duration: n = 0, open: r, defaultOpen: i = !0, onOpenChange: a, children: s, ...c }) => {
|
|
326
|
+
let [l, u] = ie({
|
|
73
327
|
prop: r,
|
|
74
328
|
defaultProp: i,
|
|
75
|
-
onChange:
|
|
76
|
-
}), [d, f] =
|
|
329
|
+
onChange: a
|
|
330
|
+
}), [d, f] = S(!1), p = x(u);
|
|
77
331
|
return p.current = u, y(() => {
|
|
78
332
|
if (i && !t && l && !d) {
|
|
79
333
|
let e = setTimeout(() => {
|
|
80
334
|
p.current(!1), f(!0);
|
|
81
|
-
},
|
|
335
|
+
}, oe);
|
|
82
336
|
return () => clearTimeout(e);
|
|
83
337
|
}
|
|
84
338
|
}, [
|
|
@@ -86,15 +340,15 @@ var M = h(null), ie = () => {
|
|
|
86
340
|
l,
|
|
87
341
|
i,
|
|
88
342
|
d
|
|
89
|
-
]), /* @__PURE__ */
|
|
343
|
+
]), /* @__PURE__ */ o(F.Provider, {
|
|
90
344
|
value: {
|
|
91
345
|
isStreaming: t,
|
|
92
346
|
isOpen: l,
|
|
93
347
|
setIsOpen: u,
|
|
94
348
|
duration: n
|
|
95
349
|
},
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
-
className:
|
|
350
|
+
children: /* @__PURE__ */ o(M, {
|
|
351
|
+
className: D("not-prose", e),
|
|
98
352
|
onOpenChange: u,
|
|
99
353
|
open: l,
|
|
100
354
|
...c,
|
|
@@ -102,106 +356,106 @@ var M = h(null), ie = () => {
|
|
|
102
356
|
})
|
|
103
357
|
});
|
|
104
358
|
});
|
|
105
|
-
function
|
|
359
|
+
function se({ variant: e, isStreaming: t, duration: n }) {
|
|
106
360
|
let r = e === "tools";
|
|
107
361
|
return t ? r ? "Working…" : "Thinking…" : n > 0 ? r ? `Worked for ${n}s` : `Thought for ${n}s` : r ? "Worked" : "Thought";
|
|
108
362
|
}
|
|
109
|
-
var
|
|
110
|
-
let { isStreaming:
|
|
363
|
+
var L = v(({ className: e, children: t, variant: n = "reasoning", label: r, ...i }) => {
|
|
364
|
+
let { isStreaming: c, isOpen: u, duration: d } = ae(), f = r ?? se({
|
|
111
365
|
variant: n,
|
|
112
|
-
isStreaming:
|
|
366
|
+
isStreaming: c,
|
|
113
367
|
duration: d
|
|
114
368
|
});
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
className:
|
|
117
|
-
...
|
|
118
|
-
children: t ?? /* @__PURE__ */
|
|
119
|
-
n === "tools" && /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
className:
|
|
369
|
+
return /* @__PURE__ */ o(N, {
|
|
370
|
+
className: D("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
|
|
371
|
+
...i,
|
|
372
|
+
children: t ?? /* @__PURE__ */ s(a, { children: [
|
|
373
|
+
n === "tools" && /* @__PURE__ */ o(m, { className: "size-3" }),
|
|
374
|
+
/* @__PURE__ */ o("span", {
|
|
375
|
+
className: D(c && "ocui-shimmer"),
|
|
122
376
|
children: f
|
|
123
377
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ o(l, { className: D("size-2.5 transition-transform", u ? "rotate-180" : "rotate-0") })
|
|
125
379
|
] })
|
|
126
380
|
});
|
|
127
|
-
}),
|
|
128
|
-
className:
|
|
381
|
+
}), R = "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1", z = v(({ className: e, ...t }) => /* @__PURE__ */ o(P, {
|
|
382
|
+
className: D(R, "mt-1.5", e),
|
|
129
383
|
...t
|
|
130
384
|
}));
|
|
131
|
-
|
|
385
|
+
I.displayName = "Reasoning", L.displayName = "ReasoningTrigger", z.displayName = "ReasoningContent";
|
|
132
386
|
//#endregion
|
|
133
387
|
//#region src/chat/tool-value.tsx
|
|
134
|
-
var
|
|
388
|
+
var ce = 8, B = 240, le = 2e4, V = (e) => e === null || typeof e != "object" && typeof e != "function", H = (e) => {
|
|
135
389
|
if (typeof e != "object" || !e) return !1;
|
|
136
390
|
let t = Object.getPrototypeOf(e);
|
|
137
391
|
return t === Object.prototype || t === null;
|
|
138
|
-
},
|
|
139
|
-
if (!
|
|
392
|
+
}, U = (e) => Array.isArray(e) && e.every(V), ue = (e) => {
|
|
393
|
+
if (!H(e)) return !1;
|
|
140
394
|
let t = Object.keys(e);
|
|
141
|
-
return t.length === 0 || t.length >
|
|
142
|
-
},
|
|
395
|
+
return t.length === 0 || t.length > ce ? !1 : t.every((t) => V(e[t]) || U(e[t]));
|
|
396
|
+
}, W = (e) => _(e) ? !0 : e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : V(e) ? !0 : Array.isArray(e) ? e.length > 0 : H(e) ? Object.keys(e).length > 0 : !0, G = (e, t = le) => e.length > t ? `${e.slice(0, t)}\n… (truncated)` : e, de = (e) => {
|
|
143
397
|
try {
|
|
144
398
|
let t = JSON.stringify(e, null, 2);
|
|
145
|
-
return t === void 0 ? String(e) :
|
|
399
|
+
return t === void 0 ? String(e) : G(t);
|
|
146
400
|
} catch {
|
|
147
401
|
return String(e);
|
|
148
402
|
}
|
|
149
|
-
},
|
|
150
|
-
if (e == null) return /* @__PURE__ */
|
|
403
|
+
}, K = ({ value: e }) => {
|
|
404
|
+
if (e == null) return /* @__PURE__ */ o("span", {
|
|
151
405
|
className: "font-mono text-muted-foreground",
|
|
152
406
|
children: "null"
|
|
153
407
|
});
|
|
154
|
-
if (typeof e != "string") return /* @__PURE__ */
|
|
408
|
+
if (typeof e != "string") return /* @__PURE__ */ o("span", {
|
|
155
409
|
className: "font-mono text-foreground",
|
|
156
410
|
children: String(e)
|
|
157
411
|
});
|
|
158
|
-
if (e === "") return /* @__PURE__ */
|
|
412
|
+
if (e === "") return /* @__PURE__ */ o("span", {
|
|
159
413
|
className: "text-muted-foreground italic",
|
|
160
414
|
children: "empty"
|
|
161
415
|
});
|
|
162
|
-
let t = e.length >
|
|
163
|
-
return /* @__PURE__ */
|
|
416
|
+
let t = e.length > B;
|
|
417
|
+
return /* @__PURE__ */ o("span", {
|
|
164
418
|
className: "text-foreground",
|
|
165
419
|
title: t ? e : void 0,
|
|
166
|
-
children: t ? `${e.slice(0,
|
|
420
|
+
children: t ? `${e.slice(0, B)}…` : e
|
|
167
421
|
});
|
|
168
|
-
},
|
|
422
|
+
}, q = ({ value: e }) => e.length === 0 ? /* @__PURE__ */ o("span", {
|
|
169
423
|
className: "text-muted-foreground italic",
|
|
170
424
|
children: "none"
|
|
171
|
-
}) : /* @__PURE__ */
|
|
425
|
+
}) : /* @__PURE__ */ o("span", {
|
|
172
426
|
className: "text-foreground",
|
|
173
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
427
|
+
children: e.map((e, t) => /* @__PURE__ */ s("span", { children: [t > 0 && /* @__PURE__ */ o("span", {
|
|
174
428
|
className: "px-1 text-muted-foreground/70",
|
|
175
429
|
children: "·"
|
|
176
|
-
}), /* @__PURE__ */
|
|
177
|
-
}),
|
|
430
|
+
}), /* @__PURE__ */ o(K, { value: e })] }, t))
|
|
431
|
+
}), fe = ({ data: e }) => /* @__PURE__ */ o("ul", {
|
|
178
432
|
className: "ocui-tool-kv grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",
|
|
179
|
-
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */
|
|
433
|
+
children: Object.entries(e).map(([e, t]) => /* @__PURE__ */ s("li", {
|
|
180
434
|
className: "contents",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ o("span", {
|
|
182
436
|
className: "break-words text-muted-foreground",
|
|
183
437
|
children: e
|
|
184
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ o("span", {
|
|
185
439
|
className: "min-w-0 break-words whitespace-pre-wrap",
|
|
186
|
-
children:
|
|
440
|
+
children: U(t) ? /* @__PURE__ */ o(q, { value: t }) : /* @__PURE__ */ o(K, { value: t })
|
|
187
441
|
})]
|
|
188
442
|
}, e))
|
|
189
|
-
}),
|
|
443
|
+
}), pe = ({ value: e }) => /* @__PURE__ */ o("pre", {
|
|
190
444
|
className: "ocui-tool-json overflow-x-auto rounded-md bg-muted/40 px-2.5 py-2 font-mono text-xs text-muted-foreground",
|
|
191
|
-
children:
|
|
192
|
-
}),
|
|
445
|
+
children: de(e)
|
|
446
|
+
}), J = ({ value: e }) => _(e) ? /* @__PURE__ */ o(a, { children: e }) : e == null ? null : typeof e == "string" ? e.trim() === "" ? null : /* @__PURE__ */ o("div", {
|
|
193
447
|
className: "whitespace-pre-wrap break-words font-mono text-xs leading-relaxed text-muted-foreground",
|
|
194
|
-
children:
|
|
195
|
-
}) :
|
|
448
|
+
children: G(e)
|
|
449
|
+
}) : V(e) ? /* @__PURE__ */ o("div", {
|
|
196
450
|
className: "font-mono text-xs text-foreground",
|
|
197
451
|
children: String(e)
|
|
198
|
-
}) :
|
|
452
|
+
}) : ue(e) ? /* @__PURE__ */ o(fe, { data: e }) : U(e) ? /* @__PURE__ */ o("div", {
|
|
199
453
|
className: "text-xs",
|
|
200
|
-
children: /* @__PURE__ */
|
|
201
|
-
}) : /* @__PURE__ */
|
|
202
|
-
className:
|
|
454
|
+
children: /* @__PURE__ */ o(q, { value: e })
|
|
455
|
+
}) : /* @__PURE__ */ o(pe, { value: e }), me = ({ className: e, ...t }) => /* @__PURE__ */ o(M, {
|
|
456
|
+
className: D("not-prose w-full rounded-md border border-border", e),
|
|
203
457
|
...t
|
|
204
|
-
}),
|
|
458
|
+
}), he = {
|
|
205
459
|
"input-streaming": "Pending",
|
|
206
460
|
"input-available": "Running",
|
|
207
461
|
"approval-requested": "Pending",
|
|
@@ -209,54 +463,54 @@ var se = 8, L = 240, ce = 2e4, R = (e) => e === null || typeof e != "object" &&
|
|
|
209
463
|
"output-available": "Completed",
|
|
210
464
|
"output-error": "Error",
|
|
211
465
|
"output-denied": "Denied"
|
|
212
|
-
},
|
|
213
|
-
"input-streaming": /* @__PURE__ */
|
|
214
|
-
"input-available": /* @__PURE__ */
|
|
215
|
-
"approval-requested": /* @__PURE__ */
|
|
216
|
-
"approval-responded": /* @__PURE__ */
|
|
217
|
-
"output-available": /* @__PURE__ */
|
|
218
|
-
"output-error": /* @__PURE__ */
|
|
219
|
-
"output-denied": /* @__PURE__ */
|
|
220
|
-
},
|
|
466
|
+
}, ge = {
|
|
467
|
+
"input-streaming": /* @__PURE__ */ o(p, { className: "size-3.5 animate-spin motion-reduce:animate-none" }),
|
|
468
|
+
"input-available": /* @__PURE__ */ o(p, { className: "size-3.5 animate-spin motion-reduce:animate-none" }),
|
|
469
|
+
"approval-requested": /* @__PURE__ */ o(d, { className: "size-3.5" }),
|
|
470
|
+
"approval-responded": /* @__PURE__ */ o(c, { className: "size-3.5" }),
|
|
471
|
+
"output-available": /* @__PURE__ */ o(c, { className: "size-3.5" }),
|
|
472
|
+
"output-error": /* @__PURE__ */ o(h, { className: "size-3.5 text-destructive" }),
|
|
473
|
+
"output-denied": /* @__PURE__ */ o(h, { className: "size-3.5 text-destructive" })
|
|
474
|
+
}, _e = ({ state: e }) => /* @__PURE__ */ s("span", {
|
|
221
475
|
className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground",
|
|
222
|
-
children: [
|
|
223
|
-
}),
|
|
224
|
-
className:
|
|
476
|
+
children: [ge[e], he[e]]
|
|
477
|
+
}), ve = ({ className: e, type: t, state: n, title: r, ...i }) => /* @__PURE__ */ s(N, {
|
|
478
|
+
className: D("group flex w-full min-w-0 items-center justify-between gap-2 rounded-md p-2.5 transition-colors hover:bg-muted/50", e),
|
|
225
479
|
...i,
|
|
226
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ s("div", {
|
|
227
481
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [/* @__PURE__ */ o(m, { className: "size-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ o("span", {
|
|
229
483
|
className: "truncate text-sm font-medium",
|
|
230
484
|
children: r ?? t
|
|
231
485
|
})]
|
|
232
|
-
}), /* @__PURE__ */
|
|
486
|
+
}), /* @__PURE__ */ s("div", {
|
|
233
487
|
className: "flex shrink-0 items-center gap-2",
|
|
234
|
-
children: [/* @__PURE__ */
|
|
488
|
+
children: [/* @__PURE__ */ o(_e, { state: n }), /* @__PURE__ */ o(l, { className: "size-3.5 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" })]
|
|
235
489
|
})]
|
|
236
|
-
}),
|
|
237
|
-
className:
|
|
490
|
+
}), ye = ({ className: e, ...t }) => /* @__PURE__ */ o(P, {
|
|
491
|
+
className: D("data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
238
492
|
...t
|
|
239
|
-
}),
|
|
240
|
-
className:
|
|
493
|
+
}), be = ({ className: e, input: t, ...n }) => W(t) ? /* @__PURE__ */ s("div", {
|
|
494
|
+
className: D("space-y-1.5 overflow-hidden px-2.5 pb-2.5", e),
|
|
241
495
|
...n,
|
|
242
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ o("h4", {
|
|
243
497
|
className: "text-xs font-medium tracking-wide text-muted-foreground uppercase",
|
|
244
498
|
children: "Parameters"
|
|
245
|
-
}), /* @__PURE__ */
|
|
246
|
-
}) : null,
|
|
247
|
-
className:
|
|
499
|
+
}), /* @__PURE__ */ o(J, { value: t })]
|
|
500
|
+
}) : null, xe = ({ className: e, output: t, errorText: n, ...r }) => W(t) || n ? /* @__PURE__ */ s("div", {
|
|
501
|
+
className: D("space-y-1.5 px-2.5 pb-2.5", e),
|
|
248
502
|
...r,
|
|
249
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ o("h4", {
|
|
250
504
|
className: "text-xs font-medium tracking-wide text-muted-foreground uppercase",
|
|
251
505
|
children: n ? "Error" : "Result"
|
|
252
|
-
}), n ? /* @__PURE__ */
|
|
506
|
+
}), n ? /* @__PURE__ */ o("div", {
|
|
253
507
|
className: "whitespace-pre-wrap break-words rounded-md bg-destructive/10 px-2.5 py-2 text-xs text-destructive",
|
|
254
508
|
children: n
|
|
255
|
-
}) : /* @__PURE__ */
|
|
509
|
+
}) : /* @__PURE__ */ o("div", {
|
|
256
510
|
className: "text-xs [&_table]:w-full",
|
|
257
|
-
children: /* @__PURE__ */
|
|
511
|
+
children: /* @__PURE__ */ o(J, { value: t })
|
|
258
512
|
})]
|
|
259
|
-
}) : null,
|
|
513
|
+
}) : null, Se = E("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
260
514
|
variants: {
|
|
261
515
|
variant: {
|
|
262
516
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
@@ -282,12 +536,12 @@ var se = 8, L = 240, ce = 2e4, R = (e) => e === null || typeof e != "object" &&
|
|
|
282
536
|
size: "default"
|
|
283
537
|
}
|
|
284
538
|
});
|
|
285
|
-
function
|
|
286
|
-
return /* @__PURE__ */
|
|
539
|
+
function Ce({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
|
|
540
|
+
return /* @__PURE__ */ o(r ? w.Root : "button", {
|
|
287
541
|
"data-slot": "button",
|
|
288
542
|
"data-variant": t,
|
|
289
543
|
"data-size": n,
|
|
290
|
-
className:
|
|
544
|
+
className: D(Se({
|
|
291
545
|
variant: t,
|
|
292
546
|
size: n,
|
|
293
547
|
className: e
|
|
@@ -297,69 +551,69 @@ function K({ className: e, variant: t = "default", size: n = "default", asChild:
|
|
|
297
551
|
}
|
|
298
552
|
//#endregion
|
|
299
553
|
//#region src/internal/tooltip.tsx
|
|
300
|
-
function
|
|
301
|
-
return /* @__PURE__ */
|
|
554
|
+
function Y({ delayDuration: e = 0, ...t }) {
|
|
555
|
+
return /* @__PURE__ */ o(T.Provider, {
|
|
302
556
|
"data-slot": "tooltip-provider",
|
|
303
557
|
delayDuration: e,
|
|
304
558
|
...t
|
|
305
559
|
});
|
|
306
560
|
}
|
|
307
|
-
function
|
|
308
|
-
return /* @__PURE__ */
|
|
561
|
+
function X({ ...e }) {
|
|
562
|
+
return /* @__PURE__ */ o(T.Root, {
|
|
309
563
|
"data-slot": "tooltip",
|
|
310
564
|
...e
|
|
311
565
|
});
|
|
312
566
|
}
|
|
313
|
-
function
|
|
314
|
-
return /* @__PURE__ */
|
|
567
|
+
function Z({ ...e }) {
|
|
568
|
+
return /* @__PURE__ */ o(T.Trigger, {
|
|
315
569
|
"data-slot": "tooltip-trigger",
|
|
316
570
|
...e
|
|
317
571
|
});
|
|
318
572
|
}
|
|
319
|
-
function
|
|
320
|
-
return /* @__PURE__ */
|
|
573
|
+
function we({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
574
|
+
return /* @__PURE__ */ o(T.Portal, { children: /* @__PURE__ */ s(T.Content, {
|
|
321
575
|
"data-slot": "tooltip-content",
|
|
322
576
|
sideOffset: t,
|
|
323
|
-
className:
|
|
577
|
+
className: D("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:animate-in data-[state=instant-open]:fade-in-0 data-[state=instant-open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", e),
|
|
324
578
|
...r,
|
|
325
|
-
children: [n, /* @__PURE__ */
|
|
579
|
+
children: [n, /* @__PURE__ */ o(T.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] border-r border-b border-border bg-popover fill-popover" })]
|
|
326
580
|
}) });
|
|
327
581
|
}
|
|
328
582
|
//#endregion
|
|
329
583
|
//#region src/chat/actions.tsx
|
|
330
|
-
var
|
|
331
|
-
className:
|
|
584
|
+
var Te = ({ className: e, children: t, ...n }) => /* @__PURE__ */ o("div", {
|
|
585
|
+
className: D("-ml-1.5 flex items-center", e),
|
|
332
586
|
...n,
|
|
333
587
|
children: t
|
|
334
|
-
}),
|
|
335
|
-
let l = /* @__PURE__ */
|
|
336
|
-
className:
|
|
337
|
-
size:
|
|
588
|
+
}), Ee = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "icon", ...c }) => {
|
|
589
|
+
let l = /* @__PURE__ */ s(Ce, {
|
|
590
|
+
className: D("relative", r),
|
|
591
|
+
size: a,
|
|
338
592
|
type: "button",
|
|
339
593
|
variant: i,
|
|
340
594
|
...c,
|
|
341
|
-
children: [t, /* @__PURE__ */
|
|
595
|
+
children: [t, /* @__PURE__ */ o("span", {
|
|
342
596
|
className: "sr-only",
|
|
343
597
|
children: n || e
|
|
344
598
|
})]
|
|
345
599
|
});
|
|
346
|
-
return e ? /* @__PURE__ */
|
|
600
|
+
return e ? /* @__PURE__ */ o(Y, {
|
|
347
601
|
delayDuration: 500,
|
|
348
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ s(X, { children: [/* @__PURE__ */ o(Z, {
|
|
349
603
|
asChild: !0,
|
|
350
604
|
children: l
|
|
351
|
-
}), /* @__PURE__ */
|
|
605
|
+
}), /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o("p", { children: e }) })] })
|
|
352
606
|
}) : l;
|
|
353
607
|
};
|
|
354
608
|
//#endregion
|
|
355
609
|
//#region src/chat/segments.ts
|
|
356
|
-
function
|
|
610
|
+
function De(e, t) {
|
|
357
611
|
return e.startsWith("tool-") && !t(e);
|
|
358
612
|
}
|
|
359
|
-
function
|
|
613
|
+
function Oe(e, t) {
|
|
360
614
|
let n = t?.isPresentationalTool ?? (() => !1), r = -1;
|
|
361
615
|
e.forEach((e, t) => {
|
|
362
|
-
(e.type === "reasoning" ||
|
|
616
|
+
(e.type === "reasoning" || De(e.type, n)) && (r = t);
|
|
363
617
|
});
|
|
364
618
|
let i = [], a = null, o = null, s = (e) => {
|
|
365
619
|
o = null, a || (a = {
|
|
@@ -372,7 +626,7 @@ function Te(e, t) {
|
|
|
372
626
|
let t = String(e.text ?? ""), n = e.state === "streaming";
|
|
373
627
|
if (!(t.trim() || n)) return;
|
|
374
628
|
s(e);
|
|
375
|
-
} else
|
|
629
|
+
} else De(e.type, n) ? s(e) : e.type === "text" && t <= r ? String(e.text ?? "").trim() && s(e) : e.type === "file" ? (a = null, o || (o = {
|
|
376
630
|
kind: "images",
|
|
377
631
|
parts: [],
|
|
378
632
|
index: t
|
|
@@ -383,7 +637,7 @@ function Te(e, t) {
|
|
|
383
637
|
}));
|
|
384
638
|
}), i;
|
|
385
639
|
}
|
|
386
|
-
function
|
|
640
|
+
function ke(e, t) {
|
|
387
641
|
return e.some((e) => {
|
|
388
642
|
let n = e.state;
|
|
389
643
|
return typeof n == "string" ? e.type === "reasoning" || e.type === "text" ? n === "streaming" : n === "input-streaming" || n === "input-available" : t;
|
|
@@ -391,15 +645,15 @@ function Ee(e, t) {
|
|
|
391
645
|
}
|
|
392
646
|
//#endregion
|
|
393
647
|
//#region src/chat/web-search.ts
|
|
394
|
-
function
|
|
648
|
+
function Ae(e) {
|
|
395
649
|
return typeof e == "object" && !!e && "error" in e && typeof e.error == "string";
|
|
396
650
|
}
|
|
397
|
-
var
|
|
398
|
-
function
|
|
399
|
-
return e.replace(
|
|
651
|
+
var je = /\(\s*(\[[^\]\n]*\]\((?:[^()\n]|\([^()\n]*\))*\))\s*\)/g;
|
|
652
|
+
function Me(e) {
|
|
653
|
+
return e.replace(je, "$1");
|
|
400
654
|
}
|
|
401
|
-
var
|
|
402
|
-
function
|
|
655
|
+
var Ne = "tool-webSearch";
|
|
656
|
+
function Pe(e) {
|
|
403
657
|
try {
|
|
404
658
|
let t = new URL(e);
|
|
405
659
|
return `${t.hostname.toLowerCase()}${t.pathname.replace(/\/$/, "")}${t.search}`;
|
|
@@ -407,14 +661,14 @@ function je(e) {
|
|
|
407
661
|
return e.replace(/#.*$/, "").replace(/\/$/, "");
|
|
408
662
|
}
|
|
409
663
|
}
|
|
410
|
-
function
|
|
411
|
-
let n = t?.toolType ??
|
|
664
|
+
function Fe(e, t) {
|
|
665
|
+
let n = t?.toolType ?? Ne, r = /* @__PURE__ */ new Set(), i = [];
|
|
412
666
|
for (let t of e) {
|
|
413
|
-
if (t.type !== n || t.state !== "output-available" ||
|
|
667
|
+
if (t.type !== n || t.state !== "output-available" || Ae(t.output)) continue;
|
|
414
668
|
let e = t.output?.results;
|
|
415
669
|
if (Array.isArray(e)) for (let t of e) {
|
|
416
670
|
if (typeof t?.url != "string") continue;
|
|
417
|
-
let e =
|
|
671
|
+
let e = Pe(t.url);
|
|
418
672
|
r.has(e) || (r.add(e), i.push({
|
|
419
673
|
url: t.url,
|
|
420
674
|
title: typeof t.title == "string" ? t.title : void 0
|
|
@@ -425,14 +679,14 @@ function Me(e, t) {
|
|
|
425
679
|
}
|
|
426
680
|
//#endregion
|
|
427
681
|
//#region src/chat/turn-view.ts
|
|
428
|
-
function
|
|
429
|
-
let n = t?.isSearchTool ?? (() => !1), r = t?.messageLoading, i =
|
|
682
|
+
function Ie(e, t) {
|
|
683
|
+
let n = t?.isSearchTool ?? (() => !1), r = t?.messageLoading, i = Oe(e, { isPresentationalTool: t?.isPresentationalTool }), a = i.flatMap((e) => e.kind === "trace" ? e.parts : []), o = i.filter((e) => e.kind === "part" && e.part.type === "text"), s = o.some((e) => String(e.part.text ?? "").trim() !== ""), c = s && o.some((e) => e.part.state === "streaming"), l = a.some((e) => e.type === "reasoning" && String(e.text ?? "").trim() !== ""), u = a.some((e) => e.type.startsWith("tool-")), d = i.length > 0, f = a.some((e) => e.type === "reasoning" && e.state === "streaming"), p;
|
|
430
684
|
for (let e of a) {
|
|
431
685
|
if (!e.type.startsWith("tool-")) continue;
|
|
432
686
|
let t = String(e.state ?? "");
|
|
433
687
|
t === "output-available" || t === "output-error" || t === "output-denied" || (p = e.type);
|
|
434
688
|
}
|
|
435
|
-
let m = a.length > 0 &&
|
|
689
|
+
let m = a.length > 0 && ke(a, r ?? !1), h = (r ?? !0) && !s, g = a.length > 0 ? {
|
|
436
690
|
parts: a,
|
|
437
691
|
isLoading: h
|
|
438
692
|
} : null, _;
|
|
@@ -442,14 +696,14 @@ function Ne(e, t) {
|
|
|
442
696
|
phase: _,
|
|
443
697
|
segments: i,
|
|
444
698
|
trace: g,
|
|
445
|
-
sources:
|
|
699
|
+
sources: Fe(e),
|
|
446
700
|
activityKind: v,
|
|
447
701
|
hasFinalAnswer: s
|
|
448
702
|
};
|
|
449
703
|
}
|
|
450
704
|
//#endregion
|
|
451
705
|
//#region src/chat/activity-labels.ts
|
|
452
|
-
var
|
|
706
|
+
var Le = [
|
|
453
707
|
{
|
|
454
708
|
active: "Thinking",
|
|
455
709
|
done: "Thought"
|
|
@@ -487,22 +741,30 @@ var Pe = [
|
|
|
487
741
|
done: "Refined"
|
|
488
742
|
},
|
|
489
743
|
{
|
|
490
|
-
active: "
|
|
491
|
-
done: "
|
|
744
|
+
active: "Musing",
|
|
745
|
+
done: "Mused"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
active: "Scurrying",
|
|
749
|
+
done: "Scurried"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
active: "Crunching",
|
|
753
|
+
done: "Crunched"
|
|
492
754
|
}
|
|
493
|
-
],
|
|
494
|
-
waiting:
|
|
495
|
-
reasoning:
|
|
755
|
+
], Re = {
|
|
756
|
+
waiting: Le,
|
|
757
|
+
reasoning: Le,
|
|
496
758
|
tools: [{
|
|
497
759
|
active: "Working",
|
|
498
760
|
done: "Worked"
|
|
499
761
|
}]
|
|
500
762
|
};
|
|
501
|
-
function
|
|
763
|
+
function Q({ kind: e, active: t, seed: n, elapsedSeconds: r, verb: i }) {
|
|
502
764
|
let a;
|
|
503
765
|
if (i !== void 0) a = i;
|
|
504
766
|
else {
|
|
505
|
-
let r =
|
|
767
|
+
let r = Re[e], i = r[Math.abs(n) % r.length];
|
|
506
768
|
a = t ? i.active : i.done;
|
|
507
769
|
}
|
|
508
770
|
return {
|
|
@@ -510,134 +772,167 @@ function Z({ kind: e, active: t, seed: n, elapsedSeconds: r, verb: i }) {
|
|
|
510
772
|
elapsedSeconds: r > 0 ? r : 0
|
|
511
773
|
};
|
|
512
774
|
}
|
|
513
|
-
function
|
|
514
|
-
let { verb: t, elapsedSeconds: n } =
|
|
775
|
+
function ze(e) {
|
|
776
|
+
let { verb: t, elapsedSeconds: n } = Q(e);
|
|
515
777
|
return n <= 0 ? t : `${t} for ${n}s`;
|
|
516
778
|
}
|
|
517
|
-
function
|
|
779
|
+
function Be(e, t) {
|
|
518
780
|
let n = Infinity, r = -Infinity, i = !1;
|
|
519
781
|
for (let t of e) Number.isFinite(t.startedAtMs) && (n = Math.min(n, t.startedAtMs), Number.isFinite(t.completedAtMs) ? r = Math.max(r, t.completedAtMs) : i = !0);
|
|
520
782
|
if (n === Infinity) return 0;
|
|
521
783
|
let a = i && Number.isFinite(t) ? t : r;
|
|
522
784
|
return a === -Infinity ? 0 : Math.max(0, Math.floor((a - n) / 1e3));
|
|
523
785
|
}
|
|
524
|
-
function
|
|
786
|
+
function Ve(e) {
|
|
525
787
|
let t = 0;
|
|
526
788
|
for (let n = 0; n < e.length; n += 1) t = t * 31 + e.charCodeAt(n) | 0;
|
|
527
789
|
return t;
|
|
528
790
|
}
|
|
529
791
|
//#endregion
|
|
530
792
|
//#region src/chat/message-trace.tsx
|
|
531
|
-
function
|
|
793
|
+
function $(e) {
|
|
532
794
|
let t = e.replace(/^tool-/, "").replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
|
|
533
795
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
534
796
|
}
|
|
535
|
-
var
|
|
536
|
-
let
|
|
797
|
+
var He = v(({ parts: e, isLoading: t, messageId: n, activity: r, getToolLabel: i, getToolIcon: a, getActivityOverride: c, renderStepDetail: l, defaultOpen: u = !1, className: d }) => {
|
|
798
|
+
let f = e.filter((e) => e.type === "reasoning").map((e) => String(e.text ?? "")).filter((e) => e.trim()).join("\n\n"), p = f.trim().length > 0, m = [], h = !1, g;
|
|
537
799
|
for (let t of e) if (t.type.startsWith("tool-")) {
|
|
538
|
-
|
|
800
|
+
h = !0;
|
|
539
801
|
let e = String(t.state ?? "");
|
|
540
|
-
e === "output-available" || e === "output-error" || e === "output-denied" || (
|
|
802
|
+
e === "output-available" || e === "output-error" || e === "output-denied" || (g = t.type), m.push({
|
|
541
803
|
kind: "tool",
|
|
542
|
-
label: i?.(t.type) ??
|
|
804
|
+
label: i?.(t.type) ?? $(t.type),
|
|
543
805
|
state: e,
|
|
544
|
-
toolType: t.type
|
|
806
|
+
toolType: t.type,
|
|
807
|
+
part: t
|
|
545
808
|
});
|
|
546
|
-
} else t.type === "text" && String(t.text ?? "").trim() &&
|
|
809
|
+
} else t.type === "text" && String(t.text ?? "").trim() && m.push({
|
|
547
810
|
kind: "note",
|
|
548
811
|
text: String(t.text)
|
|
549
812
|
});
|
|
550
|
-
|
|
551
|
-
let
|
|
552
|
-
kind:
|
|
813
|
+
h && !t && m.push({ kind: "done" });
|
|
814
|
+
let _ = e.some((e) => Number.isFinite(e.startedAtMs)) ? Be(e, r?.nowMs) : r?.elapsedSeconds ?? 0, v = r?.seed ?? Ve(n), ee = t ? _ : 0, y = t ? c?.(g) : void 0, x = {
|
|
815
|
+
kind: p ? "reasoning" : "tools",
|
|
553
816
|
active: t,
|
|
554
|
-
seed:
|
|
555
|
-
elapsedSeconds:
|
|
817
|
+
seed: v,
|
|
818
|
+
elapsedSeconds: ee,
|
|
556
819
|
verb: y
|
|
557
|
-
},
|
|
558
|
-
return /* @__PURE__ */
|
|
559
|
-
|
|
560
|
-
|
|
820
|
+
}, C = ze(x), { elapsedSeconds: w } = Q(x), T = p || m.length > 0, E = T && t && w === 0, [O, k] = S(u), A = b();
|
|
821
|
+
return /* @__PURE__ */ s(M, {
|
|
822
|
+
open: O,
|
|
823
|
+
onOpenChange: k,
|
|
824
|
+
className: D("not-prose flex flex-col", d),
|
|
825
|
+
children: [/* @__PURE__ */ o("button", {
|
|
561
826
|
type: "button",
|
|
562
827
|
"data-testid": "message-reasoning",
|
|
563
|
-
onClick: () =>
|
|
564
|
-
"aria-expanded":
|
|
565
|
-
"aria-controls":
|
|
566
|
-
className: "flex items-center gap-1 self-start text-
|
|
567
|
-
children: /* @__PURE__ */
|
|
568
|
-
className:
|
|
569
|
-
children: [
|
|
828
|
+
onClick: () => k((e) => !e),
|
|
829
|
+
"aria-expanded": O,
|
|
830
|
+
"aria-controls": T ? A : void 0,
|
|
831
|
+
className: "flex items-center gap-1 self-start text-[13px] leading-5 text-muted-foreground transition-colors hover:text-foreground",
|
|
832
|
+
children: /* @__PURE__ */ s("span", {
|
|
833
|
+
className: D(t && "ocui-shimmer"),
|
|
834
|
+
children: [C, E ? "..." : ""]
|
|
835
|
+
})
|
|
836
|
+
}), T && /* @__PURE__ */ o(P, {
|
|
837
|
+
id: A,
|
|
838
|
+
className: "overflow-hidden outline-hidden transition-opacity data-[state=closed]:opacity-0 data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",
|
|
839
|
+
children: /* @__PURE__ */ s("div", {
|
|
840
|
+
className: "flex flex-col gap-2 pt-2",
|
|
841
|
+
children: [p && /* @__PURE__ */ o(j, {
|
|
842
|
+
className: "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1",
|
|
843
|
+
children: f
|
|
844
|
+
}), m.length > 0 && /* @__PURE__ */ o("div", {
|
|
845
|
+
className: "flex flex-col",
|
|
846
|
+
children: m.map((e, t) => /* @__PURE__ */ o(Ue, {
|
|
847
|
+
node: e,
|
|
848
|
+
isFirst: t === 0,
|
|
849
|
+
isLast: t === m.length - 1,
|
|
850
|
+
getToolIcon: a,
|
|
851
|
+
renderStepDetail: l
|
|
852
|
+
}, `step-${t}`))
|
|
853
|
+
})]
|
|
570
854
|
})
|
|
571
|
-
}), E && C && /* @__PURE__ */ o("div", {
|
|
572
|
-
id: O,
|
|
573
|
-
className: "mt-2 flex flex-col gap-2",
|
|
574
|
-
children: [f && /* @__PURE__ */ a(ne, {
|
|
575
|
-
className: "grid gap-1 text-sm text-muted-foreground/80 **:text-sm [&_code]:bg-transparent [&_code]:p-0 [&_code]:font-semibold [&_code]:text-foreground [&_li]:my-0 [&_ol]:my-1 [&_p]:my-0 [&_ul]:my-1",
|
|
576
|
-
children: d
|
|
577
|
-
}), p.length > 0 && /* @__PURE__ */ a("div", {
|
|
578
|
-
className: "flex flex-col",
|
|
579
|
-
children: p.map((e, t) => /* @__PURE__ */ a(Be, {
|
|
580
|
-
node: e,
|
|
581
|
-
isFirst: t === 0,
|
|
582
|
-
isLast: t === p.length - 1,
|
|
583
|
-
getToolIcon: s
|
|
584
|
-
}, `step-${t}`))
|
|
585
|
-
})]
|
|
586
855
|
})]
|
|
587
856
|
});
|
|
588
857
|
});
|
|
589
|
-
|
|
590
|
-
function
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
})
|
|
609
|
-
className: "text-
|
|
610
|
-
children: e.
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
858
|
+
He.displayName = "MessageTrace";
|
|
859
|
+
function Ue({ node: e, isFirst: t, isLast: n, getToolIcon: r, renderStepDetail: i }) {
|
|
860
|
+
let a = e.kind === "tool" && i ? i(e.part) : null, c = a != null, [u, d] = S(!1), f = b();
|
|
861
|
+
return /* @__PURE__ */ s(M, {
|
|
862
|
+
open: u,
|
|
863
|
+
onOpenChange: d,
|
|
864
|
+
className: "flex flex-col",
|
|
865
|
+
children: [/* @__PURE__ */ s("div", {
|
|
866
|
+
className: "flex items-stretch gap-2.5",
|
|
867
|
+
children: [/* @__PURE__ */ s("div", {
|
|
868
|
+
className: "flex w-4 flex-col items-center",
|
|
869
|
+
children: [
|
|
870
|
+
/* @__PURE__ */ o("div", { className: D("w-px flex-1", t ? "bg-transparent" : "bg-border") }),
|
|
871
|
+
/* @__PURE__ */ o(We, {
|
|
872
|
+
node: e,
|
|
873
|
+
getToolIcon: r
|
|
874
|
+
}),
|
|
875
|
+
/* @__PURE__ */ o("div", { className: D("w-px flex-1", n ? "bg-transparent" : "bg-border") })
|
|
876
|
+
]
|
|
877
|
+
}), /* @__PURE__ */ o("div", {
|
|
878
|
+
className: "min-w-0 py-1 text-sm leading-5",
|
|
879
|
+
children: e.kind === "tool" ? c ? /* @__PURE__ */ s("button", {
|
|
880
|
+
type: "button",
|
|
881
|
+
onClick: () => d((e) => !e),
|
|
882
|
+
"aria-expanded": u,
|
|
883
|
+
"aria-controls": f,
|
|
884
|
+
className: "group inline-flex items-center gap-1 text-sm text-muted-foreground transition-colors hover:text-foreground",
|
|
885
|
+
children: [/* @__PURE__ */ o("span", { children: e.label }), /* @__PURE__ */ o(l, { className: D("size-2.5 transition-[transform,opacity]", u ? "rotate-180 opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100") })]
|
|
886
|
+
}) : /* @__PURE__ */ o("span", {
|
|
887
|
+
className: "text-muted-foreground",
|
|
888
|
+
children: e.label
|
|
889
|
+
}) : e.kind === "note" ? /* @__PURE__ */ o("span", {
|
|
890
|
+
className: "text-muted-foreground/80",
|
|
891
|
+
children: e.text
|
|
892
|
+
}) : /* @__PURE__ */ o("span", {
|
|
893
|
+
className: "text-muted-foreground",
|
|
894
|
+
children: "Done"
|
|
895
|
+
})
|
|
896
|
+
})]
|
|
897
|
+
}), c && /* @__PURE__ */ o(P, {
|
|
898
|
+
id: f,
|
|
899
|
+
className: "overflow-hidden outline-hidden transition-opacity data-[state=closed]:opacity-0 data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up",
|
|
900
|
+
children: /* @__PURE__ */ s("div", {
|
|
901
|
+
className: "flex items-stretch gap-2.5",
|
|
902
|
+
children: [/* @__PURE__ */ o("div", {
|
|
903
|
+
className: "flex w-4 flex-col items-center",
|
|
904
|
+
children: /* @__PURE__ */ o("div", { className: D("w-px flex-1", n ? "bg-transparent" : "bg-border") })
|
|
905
|
+
}), /* @__PURE__ */ o("div", {
|
|
906
|
+
className: "min-w-0 flex-1 pb-1",
|
|
907
|
+
children: a
|
|
908
|
+
})]
|
|
614
909
|
})
|
|
615
910
|
})]
|
|
616
911
|
});
|
|
617
912
|
}
|
|
618
|
-
function
|
|
913
|
+
function We({ node: e, getToolIcon: t }) {
|
|
619
914
|
let n = "flex items-center justify-center bg-background py-0.5";
|
|
620
|
-
return e.kind === "note" ? /* @__PURE__ */
|
|
915
|
+
return e.kind === "note" ? /* @__PURE__ */ o("div", {
|
|
621
916
|
className: n,
|
|
622
|
-
children: /* @__PURE__ */
|
|
623
|
-
}) : e.kind === "tool" ? e.state === "output-error" || e.state === "output-denied" ? /* @__PURE__ */
|
|
917
|
+
children: /* @__PURE__ */ o("div", { className: "size-1 rounded-full bg-muted-foreground/60" })
|
|
918
|
+
}) : e.kind === "tool" ? e.state === "output-error" || e.state === "output-denied" ? /* @__PURE__ */ o("div", {
|
|
624
919
|
className: n,
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
}) : e.state === "output-available" ? /* @__PURE__ */
|
|
920
|
+
children: /* @__PURE__ */ o(h, { className: "size-3.5 text-destructive" })
|
|
921
|
+
}) : e.state === "output-available" ? /* @__PURE__ */ o("div", {
|
|
627
922
|
className: n,
|
|
628
|
-
children: /* @__PURE__ */
|
|
629
|
-
}) : /* @__PURE__ */
|
|
923
|
+
children: /* @__PURE__ */ o(t?.(e.toolType) ?? c, { className: "size-3.5 text-muted-foreground" })
|
|
924
|
+
}) : /* @__PURE__ */ o("div", {
|
|
630
925
|
className: n,
|
|
631
|
-
children: /* @__PURE__ */
|
|
632
|
-
}) : /* @__PURE__ */
|
|
926
|
+
children: /* @__PURE__ */ o(p, { className: "size-3.5 animate-spin text-muted-foreground motion-reduce:animate-none" })
|
|
927
|
+
}) : /* @__PURE__ */ o("div", {
|
|
633
928
|
className: n,
|
|
634
|
-
children: /* @__PURE__ */
|
|
929
|
+
children: /* @__PURE__ */ o(u, { className: "size-4 text-muted-foreground" })
|
|
635
930
|
});
|
|
636
931
|
}
|
|
637
932
|
//#endregion
|
|
638
933
|
//#region src/chat/use-activity-clock.ts
|
|
639
|
-
function
|
|
640
|
-
let n =
|
|
934
|
+
function Ge(e, t) {
|
|
935
|
+
let n = x(null), [r, i] = S(() => ({
|
|
641
936
|
seed: t,
|
|
642
937
|
elapsedSeconds: 0,
|
|
643
938
|
nowMs: Date.now()
|
|
@@ -678,81 +973,88 @@ function He(e, t) {
|
|
|
678
973
|
}
|
|
679
974
|
//#endregion
|
|
680
975
|
//#region src/chat/sources.tsx
|
|
681
|
-
function
|
|
976
|
+
function Ke(e) {
|
|
682
977
|
return `Searched ${e} source${e === 1 ? "" : "s"}`;
|
|
683
978
|
}
|
|
684
|
-
function
|
|
979
|
+
function qe(e) {
|
|
685
980
|
try {
|
|
686
981
|
return new URL(e).hostname;
|
|
687
982
|
} catch {
|
|
688
983
|
return e;
|
|
689
984
|
}
|
|
690
985
|
}
|
|
691
|
-
function
|
|
692
|
-
return `https://www.google.com/s2/favicons?domain=${
|
|
986
|
+
function Je(e) {
|
|
987
|
+
return `https://www.google.com/s2/favicons?domain=${qe(e)}&sz=32`;
|
|
693
988
|
}
|
|
694
|
-
function
|
|
695
|
-
let n = t(e), [r, i] =
|
|
696
|
-
return !n || r ? /* @__PURE__ */
|
|
989
|
+
function Ye({ url: e, getFaviconUrl: t }) {
|
|
990
|
+
let n = t(e), [r, i] = S(!1);
|
|
991
|
+
return !n || r ? /* @__PURE__ */ o(f, { className: "size-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ o("img", {
|
|
697
992
|
src: n,
|
|
698
993
|
alt: "",
|
|
699
994
|
className: "size-3.5 shrink-0 rounded-xs",
|
|
700
995
|
onError: () => i(!0)
|
|
701
996
|
});
|
|
702
997
|
}
|
|
703
|
-
var
|
|
704
|
-
className:
|
|
998
|
+
var Xe = ({ sources: e, getFaviconUrl: t = Je, className: n }) => e.length === 0 ? null : /* @__PURE__ */ o("div", {
|
|
999
|
+
className: D("flex flex-col gap-0.5", n),
|
|
1000
|
+
children: e.map((e, n) => {
|
|
1001
|
+
let r = qe(e.url), i = e.title || r;
|
|
1002
|
+
return /* @__PURE__ */ s("a", {
|
|
1003
|
+
href: e.url,
|
|
1004
|
+
target: "_blank",
|
|
1005
|
+
rel: "noreferrer",
|
|
1006
|
+
className: "flex min-w-0 items-center gap-1.5 rounded-md px-1.5 py-1 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
1007
|
+
children: [
|
|
1008
|
+
/* @__PURE__ */ o(Ye, {
|
|
1009
|
+
getFaviconUrl: t,
|
|
1010
|
+
url: e.url
|
|
1011
|
+
}),
|
|
1012
|
+
/* @__PURE__ */ o("span", {
|
|
1013
|
+
className: "truncate",
|
|
1014
|
+
children: i
|
|
1015
|
+
}),
|
|
1016
|
+
i !== r && /* @__PURE__ */ o("span", {
|
|
1017
|
+
className: "shrink-0 truncate text-xs text-muted-foreground/70",
|
|
1018
|
+
children: r
|
|
1019
|
+
})
|
|
1020
|
+
]
|
|
1021
|
+
}, `${e.url}-${n}`);
|
|
1022
|
+
})
|
|
1023
|
+
}), Ze = ({ sources: e, getLabel: t = Ke, getFaviconUrl: n = Je, className: r, ...i }) => e.length === 0 ? null : /* @__PURE__ */ s(M, {
|
|
1024
|
+
className: D("not-prose", r),
|
|
705
1025
|
...i,
|
|
706
|
-
children: [/* @__PURE__ */
|
|
707
|
-
className: "group flex items-center gap-1 self-start text-
|
|
708
|
-
children: [/* @__PURE__ */
|
|
709
|
-
}), /* @__PURE__ */
|
|
710
|
-
className:
|
|
711
|
-
children:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
target: "_blank",
|
|
716
|
-
rel: "noreferrer",
|
|
717
|
-
className: "flex min-w-0 items-center gap-1.5 rounded-md px-1.5 py-1 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
718
|
-
children: [
|
|
719
|
-
/* @__PURE__ */ a(Ge, {
|
|
720
|
-
getFaviconUrl: n,
|
|
721
|
-
url: e.url
|
|
722
|
-
}),
|
|
723
|
-
/* @__PURE__ */ a("span", {
|
|
724
|
-
className: "truncate",
|
|
725
|
-
children: i
|
|
726
|
-
}),
|
|
727
|
-
i !== r && /* @__PURE__ */ a("span", {
|
|
728
|
-
className: "shrink-0 truncate text-xs text-muted-foreground/70",
|
|
729
|
-
children: r
|
|
730
|
-
})
|
|
731
|
-
]
|
|
732
|
-
}, `${e.url}-${t}`);
|
|
1026
|
+
children: [/* @__PURE__ */ s(N, {
|
|
1027
|
+
className: "group flex items-center gap-1 self-start text-[13px] leading-5 text-muted-foreground transition-colors hover:text-foreground",
|
|
1028
|
+
children: [/* @__PURE__ */ o("span", { children: t(e.length) }), /* @__PURE__ */ o(l, { className: "size-2.5 transition-transform group-data-[state=open]:rotate-180" })]
|
|
1029
|
+
}), /* @__PURE__ */ o(P, {
|
|
1030
|
+
className: re,
|
|
1031
|
+
children: /* @__PURE__ */ o(Xe, {
|
|
1032
|
+
sources: e,
|
|
1033
|
+
getFaviconUrl: n,
|
|
1034
|
+
className: "pt-1"
|
|
733
1035
|
})
|
|
734
1036
|
})]
|
|
735
|
-
}),
|
|
736
|
-
let
|
|
1037
|
+
}), Qe = "ocui-cite", $e = ({ pressed: e, onPressedChange: t, label: n = "Search the web", tooltip: r, className: i, variant: a, size: c = "icon", onClick: l, ...u }) => {
|
|
1038
|
+
let d = a ?? (e ? "default" : "ghost"), p = /* @__PURE__ */ o(Ce, {
|
|
737
1039
|
...u,
|
|
738
1040
|
"aria-label": n,
|
|
739
1041
|
"aria-pressed": e,
|
|
740
|
-
className:
|
|
1042
|
+
className: D(i),
|
|
741
1043
|
size: c,
|
|
742
1044
|
type: "button",
|
|
743
|
-
variant:
|
|
1045
|
+
variant: d,
|
|
744
1046
|
onClick: (n) => {
|
|
745
1047
|
l?.(n), t(!e);
|
|
746
1048
|
},
|
|
747
|
-
children: /* @__PURE__ */
|
|
1049
|
+
children: /* @__PURE__ */ o(f, {})
|
|
748
1050
|
});
|
|
749
|
-
return r ? /* @__PURE__ */
|
|
1051
|
+
return r ? /* @__PURE__ */ o(Y, {
|
|
750
1052
|
delayDuration: 300,
|
|
751
|
-
children: /* @__PURE__ */
|
|
1053
|
+
children: /* @__PURE__ */ s(X, { children: [/* @__PURE__ */ o(Z, {
|
|
752
1054
|
asChild: !0,
|
|
753
1055
|
children: p
|
|
754
|
-
}), /* @__PURE__ */
|
|
1056
|
+
}), /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o("p", { children: r }) })] })
|
|
755
1057
|
}) : p;
|
|
756
1058
|
};
|
|
757
1059
|
//#endregion
|
|
758
|
-
export {
|
|
1060
|
+
export { Ee as Action, Te as Actions, ne as MessageContent, He as MessageTrace, I as Reasoning, z as ReasoningContent, L as ReasoningTrigger, j as Response, Xe as SourceList, Ze as Sources, me as Tool, ye as ToolContent, ve as ToolHeader, be as ToolInput, xe as ToolOutput, $e as WebSearchToggle, Oe as buildSegments, Qe as citationClassName, Ie as deriveTurnView, Fe as extractWebSearchSources, ze as getAiActivityLabel, Q as getAiActivityLabelParts, $ as humanizeToolName, Ae as isWebSearchError, Ve as labelSeedFromString, R as reasoningTextClassName, Me as stripCitationParens, Be as traceElapsedSeconds, ke as traceIsLoading, Ge as useActivityClock };
|