@yourgpt/copilot-sdk 1.4.35 → 2.0.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/ui/index.cjs CHANGED
@@ -41,7 +41,10 @@ var HoverCardPrimitive__namespace = /*#__PURE__*/_interopNamespace(HoverCardPrim
41
41
  function cn(...inputs) {
42
42
  return tailwindMerge.twMerge(clsx.clsx(inputs));
43
43
  }
44
- function DotsLoader({ className, size = "md" }) {
44
+ function DotsLoader({
45
+ className,
46
+ size = "md"
47
+ }) {
45
48
  const dotSizes = {
46
49
  sm: "h-1 w-1",
47
50
  md: "h-1.5 w-1.5",
@@ -52,21 +55,37 @@ function DotsLoader({ className, size = "md" }) {
52
55
  md: "h-5",
53
56
  lg: "h-6"
54
57
  };
55
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center translate-y-[-2px] space-x-1", containerSizes[size], className), children: [
56
- [...Array(3)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
57
- "div",
58
- {
59
- className: cn("bg-primary csdk-loader-bounce-dots rounded-full", dotSizes[size]),
60
- style: {
61
- animationDelay: `${i * 160}ms`
62
- }
63
- },
64
- i
65
- )),
66
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
67
- ] });
58
+ return /* @__PURE__ */ jsxRuntime.jsxs(
59
+ "div",
60
+ {
61
+ className: cn(
62
+ "flex items-center translate-y-[-2px] space-x-1",
63
+ containerSizes[size],
64
+ className
65
+ ),
66
+ children: [
67
+ [...Array(3)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
68
+ "div",
69
+ {
70
+ className: cn(
71
+ "bg-primary csdk-loader-bounce-dots rounded-full",
72
+ dotSizes[size]
73
+ ),
74
+ style: {
75
+ animationDelay: `${i * 160}ms`
76
+ }
77
+ },
78
+ i
79
+ )),
80
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
81
+ ]
82
+ }
83
+ );
68
84
  }
69
- function TypingLoader({ className, size = "md" }) {
85
+ function TypingLoader({
86
+ className,
87
+ size = "md"
88
+ }) {
70
89
  const dotSizes = {
71
90
  sm: "h-1 w-1",
72
91
  md: "h-1.5 w-1.5",
@@ -77,21 +96,37 @@ function TypingLoader({ className, size = "md" }) {
77
96
  md: "h-5",
78
97
  lg: "h-6"
79
98
  };
80
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center space-x-1", containerSizes[size], className), children: [
81
- [...Array(3)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
82
- "div",
83
- {
84
- className: cn("bg-primary csdk-loader-typing rounded-full", dotSizes[size]),
85
- style: {
86
- animationDelay: `${i * 250}ms`
87
- }
88
- },
89
- i
90
- )),
91
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
92
- ] });
99
+ return /* @__PURE__ */ jsxRuntime.jsxs(
100
+ "div",
101
+ {
102
+ className: cn(
103
+ "flex items-center space-x-1",
104
+ containerSizes[size],
105
+ className
106
+ ),
107
+ children: [
108
+ [...Array(3)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
109
+ "div",
110
+ {
111
+ className: cn(
112
+ "bg-primary csdk-loader-typing rounded-full",
113
+ dotSizes[size]
114
+ ),
115
+ style: {
116
+ animationDelay: `${i * 250}ms`
117
+ }
118
+ },
119
+ i
120
+ )),
121
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
122
+ ]
123
+ }
124
+ );
93
125
  }
94
- function WaveLoader({ className, size = "md" }) {
126
+ function WaveLoader({
127
+ className,
128
+ size = "md"
129
+ }) {
95
130
  const barWidths = {
96
131
  sm: "w-0.5",
97
132
  md: "w-0.5",
@@ -107,22 +142,38 @@ function WaveLoader({ className, size = "md" }) {
107
142
  md: ["8px", "12px", "16px", "12px", "8px"],
108
143
  lg: ["10px", "15px", "20px", "15px", "10px"]
109
144
  };
110
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-0.5", containerSizes[size], className), children: [
111
- [...Array(5)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
112
- "div",
113
- {
114
- className: cn("bg-primary csdk-loader-wave rounded-full", barWidths[size]),
115
- style: {
116
- animationDelay: `${i * 100}ms`,
117
- height: heights[size][i]
118
- }
119
- },
120
- i
121
- )),
122
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
123
- ] });
145
+ return /* @__PURE__ */ jsxRuntime.jsxs(
146
+ "div",
147
+ {
148
+ className: cn(
149
+ "flex items-center gap-0.5",
150
+ containerSizes[size],
151
+ className
152
+ ),
153
+ children: [
154
+ [...Array(5)].map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
155
+ "div",
156
+ {
157
+ className: cn(
158
+ "bg-primary csdk-loader-wave rounded-full",
159
+ barWidths[size]
160
+ ),
161
+ style: {
162
+ animationDelay: `${i * 100}ms`,
163
+ height: heights[size][i]
164
+ }
165
+ },
166
+ i
167
+ )),
168
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
169
+ ]
170
+ }
171
+ );
124
172
  }
125
- function TerminalLoader({ className, size = "md" }) {
173
+ function TerminalLoader({
174
+ className,
175
+ size = "md"
176
+ }) {
126
177
  const cursorSizes = {
127
178
  sm: "h-3 w-1.5",
128
179
  md: "h-4 w-2",
@@ -138,21 +189,49 @@ function TerminalLoader({ className, size = "md" }) {
138
189
  md: "h-5",
139
190
  lg: "h-6"
140
191
  };
141
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center space-x-1", containerSizes[size], className), children: [
142
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-primary font-mono", textSizes[size]), children: ">" }),
143
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("bg-primary csdk-loader-blink", cursorSizes[size]) }),
144
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
145
- ] });
192
+ return /* @__PURE__ */ jsxRuntime.jsxs(
193
+ "div",
194
+ {
195
+ className: cn(
196
+ "flex items-center space-x-1",
197
+ containerSizes[size],
198
+ className
199
+ ),
200
+ children: [
201
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-primary font-mono", textSizes[size]), children: ">" }),
202
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("bg-primary csdk-loader-blink", cursorSizes[size]) }),
203
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Loading" })
204
+ ]
205
+ }
206
+ );
146
207
  }
147
- function TextBlinkLoader({ text = "Thinking", className, size = "md" }) {
208
+ function TextBlinkLoader({
209
+ text = "Thinking",
210
+ className,
211
+ size = "md"
212
+ }) {
148
213
  const textSizes = {
149
214
  sm: "text-xs",
150
215
  md: "text-sm",
151
216
  lg: "text-base"
152
217
  };
153
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("csdk-loader-text-blink font-medium", textSizes[size], className), children: text });
218
+ return /* @__PURE__ */ jsxRuntime.jsx(
219
+ "div",
220
+ {
221
+ className: cn(
222
+ "csdk-loader-text-blink font-medium",
223
+ textSizes[size],
224
+ className
225
+ ),
226
+ children: text
227
+ }
228
+ );
154
229
  }
155
- function TextShimmerLoader({ text = "Thinking", className, size = "md" }) {
230
+ function TextShimmerLoader({
231
+ text = "Thinking",
232
+ className,
233
+ size = "md"
234
+ }) {
156
235
  const textSizes = {
157
236
  sm: "text-xs",
158
237
  md: "text-sm",
@@ -172,7 +251,11 @@ function TextShimmerLoader({ text = "Thinking", className, size = "md" }) {
172
251
  }
173
252
  );
174
253
  }
175
- function TextDotsLoader({ className, text = "Thinking", size = "md" }) {
254
+ function TextDotsLoader({
255
+ className,
256
+ text = "Thinking",
257
+ size = "md"
258
+ }) {
176
259
  const textSizes = {
177
260
  sm: "text-xs",
178
261
  md: "text-sm",
@@ -181,13 +264,39 @@ function TextDotsLoader({ className, text = "Thinking", size = "md" }) {
181
264
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("inline-flex items-center", className), children: [
182
265
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-primary font-medium", textSizes[size]), children: text }),
183
266
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex", children: [
184
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary csdk-loader-loading-dots", style: { animationDelay: "0.2s" }, children: "." }),
185
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary csdk-loader-loading-dots", style: { animationDelay: "0.4s" }, children: "." }),
186
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary csdk-loader-loading-dots", style: { animationDelay: "0.6s" }, children: "." })
267
+ /* @__PURE__ */ jsxRuntime.jsx(
268
+ "span",
269
+ {
270
+ className: "text-primary csdk-loader-loading-dots",
271
+ style: { animationDelay: "0.2s" },
272
+ children: "."
273
+ }
274
+ ),
275
+ /* @__PURE__ */ jsxRuntime.jsx(
276
+ "span",
277
+ {
278
+ className: "text-primary csdk-loader-loading-dots",
279
+ style: { animationDelay: "0.4s" },
280
+ children: "."
281
+ }
282
+ ),
283
+ /* @__PURE__ */ jsxRuntime.jsx(
284
+ "span",
285
+ {
286
+ className: "text-primary csdk-loader-loading-dots",
287
+ style: { animationDelay: "0.6s" },
288
+ children: "."
289
+ }
290
+ )
187
291
  ] })
188
292
  ] });
189
293
  }
190
- function Loader({ variant = "typing", size = "md", text, className }) {
294
+ function Loader({
295
+ variant = "typing",
296
+ size = "md",
297
+ text,
298
+ className
299
+ }) {
191
300
  switch (variant) {
192
301
  case "dots":
193
302
  return /* @__PURE__ */ jsxRuntime.jsx(DotsLoader, { size, className });
@@ -3503,7 +3612,9 @@ function DefaultMessage({
3503
3612
  toolCallId: exec.id,
3504
3613
  toolName: exec.name
3505
3614
  };
3506
- const output = toolDef.render(renderProps);
3615
+ const output = toolDef.render(
3616
+ renderProps
3617
+ );
3507
3618
  return /* @__PURE__ */ jsxRuntime.jsx(React18__namespace.Fragment, { children: output }, exec.id);
3508
3619
  }
3509
3620
  return null;
@@ -3539,7 +3650,9 @@ function DefaultMessage({
3539
3650
  toolName: tool.name,
3540
3651
  approval: approvalCallbacks
3541
3652
  };
3542
- const output = toolDef.render(renderProps);
3653
+ const output = toolDef.render(
3654
+ renderProps
3655
+ );
3543
3656
  return /* @__PURE__ */ jsxRuntime.jsx(React18__namespace.Fragment, { children: output }, tool.id);
3544
3657
  }
3545
3658
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -3553,7 +3666,11 @@ function DefaultMessage({
3553
3666
  void 0,
3554
3667
  permissionLevel
3555
3668
  ),
3556
- onReject: (permissionLevel) => onRejectToolExecution?.(tool.id, void 0, permissionLevel)
3669
+ onReject: (permissionLevel) => onRejectToolExecution?.(
3670
+ tool.id,
3671
+ void 0,
3672
+ permissionLevel
3673
+ )
3557
3674
  },
3558
3675
  tool.id
3559
3676
  );