@alpaca-editor/core 1.0.4049 → 1.0.4053

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.
Files changed (69) hide show
  1. package/dist/components/ui/textarea.js +1 -1
  2. package/dist/components/ui/textarea.js.map +1 -1
  3. package/dist/editor/Terminal.js +3 -3
  4. package/dist/editor/Terminal.js.map +1 -1
  5. package/dist/editor/ai/AgentCostDisplay.js +2 -2
  6. package/dist/editor/ai/AgentCostDisplay.js.map +1 -1
  7. package/dist/editor/ai/AgentHistory.d.ts +4 -4
  8. package/dist/editor/ai/AgentHistory.js +1 -1
  9. package/dist/editor/ai/AgentHistory.js.map +1 -1
  10. package/dist/editor/ai/AgentTerminal.d.ts +4 -0
  11. package/dist/editor/ai/AgentTerminal.js +753 -0
  12. package/dist/editor/ai/AgentTerminal.js.map +1 -0
  13. package/dist/editor/ai/Agents.d.ts +1 -3
  14. package/dist/editor/ai/Agents.js +213 -353
  15. package/dist/editor/ai/Agents.js.map +1 -1
  16. package/dist/editor/ai/AiPromptPopover.js +2 -2
  17. package/dist/editor/ai/AiPromptPopover.js.map +1 -1
  18. package/dist/editor/ai/AiResponseMessage.d.ts +0 -1
  19. package/dist/editor/ai/AiResponseMessage.js +23 -143
  20. package/dist/editor/ai/AiResponseMessage.js.map +1 -1
  21. package/dist/editor/ai/AiTerminal.d.ts +5 -23
  22. package/dist/editor/ai/AiTerminal.js +81 -824
  23. package/dist/editor/ai/AiTerminal.js.map +1 -1
  24. package/dist/editor/ai/DancingDots.d.ts +1 -0
  25. package/dist/editor/ai/DancingDots.js +6 -0
  26. package/dist/editor/ai/DancingDots.js.map +1 -0
  27. package/dist/editor/ai/ToolCallDisplay.d.ts +37 -0
  28. package/dist/editor/ai/ToolCallDisplay.js +154 -0
  29. package/dist/editor/ai/ToolCallDisplay.js.map +1 -0
  30. package/dist/editor/client/EditorClient.js +5 -1
  31. package/dist/editor/client/EditorClient.js.map +1 -1
  32. package/dist/editor/services/agentService.d.ts +23 -30
  33. package/dist/editor/services/agentService.js +62 -124
  34. package/dist/editor/services/agentService.js.map +1 -1
  35. package/dist/editor/sidebar/GraphQL.js +1 -0
  36. package/dist/editor/sidebar/GraphQL.js.map +1 -1
  37. package/dist/editor/sidebar/ViewSelector.js +8 -6
  38. package/dist/editor/sidebar/ViewSelector.js.map +1 -1
  39. package/dist/editor/ui/Section.js +4 -3
  40. package/dist/editor/ui/Section.js.map +1 -1
  41. package/dist/editor/utils.d.ts +4 -0
  42. package/dist/editor/utils.js +23 -0
  43. package/dist/editor/utils.js.map +1 -1
  44. package/dist/revision.d.ts +2 -2
  45. package/dist/revision.js +2 -2
  46. package/dist/styles.css +18 -33
  47. package/package.json +1 -1
  48. package/src/components/ui/textarea.tsx +1 -1
  49. package/src/editor/Terminal.tsx +4 -4
  50. package/src/editor/ai/AgentCostDisplay.tsx +7 -11
  51. package/src/editor/ai/AgentHistory.tsx +7 -9
  52. package/src/editor/ai/AgentTerminal.tsx +1094 -0
  53. package/src/editor/ai/Agents.tsx +340 -477
  54. package/src/editor/ai/AiPromptPopover.tsx +2 -2
  55. package/src/editor/ai/AiResponseMessage.tsx +85 -366
  56. package/src/editor/ai/AiTerminal.tsx +142 -1213
  57. package/src/editor/ai/DancingDots.tsx +14 -0
  58. package/src/editor/ai/ToolCallDisplay.tsx +363 -0
  59. package/src/editor/client/EditorClient.tsx +6 -1
  60. package/src/editor/services/agentService.ts +89 -162
  61. package/src/editor/sidebar/GraphQL.tsx +1 -0
  62. package/src/editor/sidebar/ViewSelector.tsx +82 -57
  63. package/src/editor/ui/Section.tsx +4 -3
  64. package/src/editor/utils.ts +29 -0
  65. package/src/revision.ts +2 -2
  66. package/dist/editor/ai/EditorAiTerminal.d.ts +0 -6
  67. package/dist/editor/ai/EditorAiTerminal.js +0 -7
  68. package/dist/editor/ai/EditorAiTerminal.js.map +0 -1
  69. package/src/editor/ai/EditorAiTerminal.tsx +0 -23
package/dist/styles.css CHANGED
@@ -85,7 +85,6 @@
85
85
  --color-white: #fff;
86
86
  --spacing: 0.25rem;
87
87
  --breakpoint-xl: 80rem;
88
- --container-md: 28rem;
89
88
  --container-lg: 32rem;
90
89
  --text-xs: 0.75rem;
91
90
  --text-xs--line-height: calc(1 / 0.75);
@@ -293,6 +292,9 @@
293
292
  .bottom-2 {
294
293
  bottom: calc(var(--spacing) * 2);
295
294
  }
295
+ .bottom-8 {
296
+ bottom: calc(var(--spacing) * 8);
297
+ }
296
298
  .-left-1\.5 {
297
299
  left: calc(var(--spacing) * -1.5);
298
300
  }
@@ -380,9 +382,6 @@
380
382
  .mx-3 {
381
383
  margin-inline: calc(var(--spacing) * 3);
382
384
  }
383
- .mx-4 {
384
- margin-inline: calc(var(--spacing) * 4);
385
- }
386
385
  .mx-6 {
387
386
  margin-inline: calc(var(--spacing) * 6);
388
387
  }
@@ -931,9 +930,6 @@
931
930
  .max-w-lg {
932
931
  max-width: var(--container-lg);
933
932
  }
934
- .max-w-md {
935
- max-width: var(--container-md);
936
- }
937
933
  .max-w-none {
938
934
  max-width: none;
939
935
  }
@@ -967,9 +963,6 @@
967
963
  .min-w-\[120px\] {
968
964
  min-width: 120px;
969
965
  }
970
- .min-w-\[200px\] {
971
- min-width: 200px;
972
- }
973
966
  .min-w-full {
974
967
  min-width: 100%;
975
968
  }
@@ -1241,6 +1234,13 @@
1241
1234
  .gap-7 {
1242
1235
  gap: calc(var(--spacing) * 7);
1243
1236
  }
1237
+ .space-y-0 {
1238
+ :where(& > :not(:last-child)) {
1239
+ --tw-space-y-reverse: 0;
1240
+ margin-block-start: calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));
1241
+ margin-block-end: calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)));
1242
+ }
1243
+ }
1244
1244
  .space-y-0\.5 {
1245
1245
  :where(& > :not(:last-child)) {
1246
1246
  --tw-space-y-reverse: 0;
@@ -1326,11 +1326,19 @@
1326
1326
  border-bottom-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
1327
1327
  }
1328
1328
  }
1329
+ .divide-gray-100 {
1330
+ :where(& > :not(:last-child)) {
1331
+ border-color: var(--color-gray-100);
1332
+ }
1333
+ }
1329
1334
  .divide-gray-200 {
1330
1335
  :where(& > :not(:last-child)) {
1331
1336
  border-color: var(--color-gray-200);
1332
1337
  }
1333
1338
  }
1339
+ .self-end {
1340
+ align-self: flex-end;
1341
+ }
1334
1342
  .self-stretch {
1335
1343
  align-self: stretch;
1336
1344
  }
@@ -2534,18 +2542,12 @@
2534
2542
  .\!\[--width\:340px\] {
2535
2543
  --width: 340px !important;
2536
2544
  }
2537
- .\[-ms-overflow-style\:none\] {
2538
- -ms-overflow-style: none;
2539
- }
2540
2545
  .\[animation-delay\:-0\.3s\] {
2541
2546
  animation-delay: -0.3s;
2542
2547
  }
2543
2548
  .\[animation-delay\:-0\.15s\] {
2544
2549
  animation-delay: -0.15s;
2545
2550
  }
2546
- .\[scrollbar-width\:none\] {
2547
- scrollbar-width: none;
2548
- }
2549
2551
  .fade-in {
2550
2552
  --tw-enter-opacity: 0;
2551
2553
  }
@@ -2895,13 +2897,6 @@
2895
2897
  }
2896
2898
  }
2897
2899
  }
2898
- .hover\:bg-red-200 {
2899
- &:hover {
2900
- @media (hover: hover) {
2901
- background-color: var(--color-red-200);
2902
- }
2903
- }
2904
- }
2905
2900
  .hover\:bg-red-400 {
2906
2901
  &:hover {
2907
2902
  @media (hover: hover) {
@@ -3106,11 +3101,6 @@
3106
3101
  border-color: var(--color-blue-400);
3107
3102
  }
3108
3103
  }
3109
- .focus\:border-blue-500 {
3110
- &:focus {
3111
- border-color: var(--color-blue-500);
3112
- }
3113
- }
3114
3104
  .focus\:bg-accent {
3115
3105
  &:focus {
3116
3106
  background-color: var(--accent);
@@ -3943,11 +3933,6 @@
3943
3933
  padding-left: calc(var(--spacing) * 5);
3944
3934
  }
3945
3935
  }
3946
- .\[\&\:\:-webkit-scrollbar\]\:hidden {
3947
- &::-webkit-scrollbar {
3948
- display: none;
3949
- }
3950
- }
3951
3936
  .data-\[variant\=destructive\]\:\*\:\[svg\]\:\!text-destructive {
3952
3937
  &[data-variant="destructive"] {
3953
3938
  :is(& > *) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpaca-editor/core",
3
- "version": "1.0.4049",
3
+ "version": "1.0.4053",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,7 +11,7 @@ const Textarea = React.forwardRef<
11
11
  ref={ref}
12
12
  data-slot="textarea"
13
13
  className={cn(
14
- "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
14
+ "border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
15
15
  className,
16
16
  )}
17
17
  {...props}
@@ -129,10 +129,10 @@ export const Terminal = forwardRef<
129
129
  submit();
130
130
  }
131
131
  if (e.key === "ArrowUp") {
132
- // Only navigate history if we haven't started typing or if we're already navigating history
133
- const hasStartedTyping =
134
- prompt.trim().length > 0 && currentHistoryIndex === -1;
135
- if (!hasStartedTyping) {
132
+ // Only navigate history if prompt is empty or we're already navigating history
133
+ const canNavigateHistory =
134
+ prompt.trim().length === 0 || currentHistoryIndex !== -1;
135
+ if (canNavigateHistory) {
136
136
  e.preventDefault();
137
137
  if (promptHistory.length > 0) {
138
138
  const newIndex =
@@ -131,23 +131,19 @@ export function AgentCostDisplay({
131
131
  <PopoverContent className="w-80 p-4" align="end" side="bottom">
132
132
  <div className="space-y-4">
133
133
  <div className="border-b pb-2">
134
- <h4 className="text-sm font-semibold">Cost Breakdown</h4>
134
+ <h4 className="flex items-center justify-between text-sm font-semibold">
135
+ <div>Cost Breakdown</div>
136
+ <span className="text-sm font-semibold">
137
+ {displayTotalCost.toFixed(2)} {currency}
138
+ </span>
139
+ </h4>
135
140
  </div>
136
141
 
137
142
  <div className="space-y-3">
138
143
  {/* Session Cost Breakdown */}
139
144
  {(hasTotalData || hasTokenData) && (
140
145
  <>
141
- <div className="flex items-center justify-between">
142
- <span className="text-sm font-semibold text-gray-600">
143
- Session Cost:
144
- </span>
145
- <span className="text-sm font-semibold">
146
- {displayTotalCost.toFixed(2)} {currency}
147
- </span>
148
- </div>
149
-
150
- <div className="space-y-2 border-t pt-2">
146
+ <div className="space-y-2">
151
147
  {hasTotalData ? (
152
148
  <>
153
149
  <div className="flex items-center justify-between">
@@ -1,19 +1,20 @@
1
1
  import React from "react";
2
2
  import { History, Trash2 } from "lucide-react";
3
3
  import { SimpleIconButton } from "../ui/SimpleIconButton";
4
- import { AgentChat } from "../services/agentService";
4
+
5
5
  import {
6
6
  Popover,
7
7
  PopoverContent,
8
8
  PopoverTrigger,
9
9
  } from "../../components/ui/popover";
10
+ import { Agent } from "../services/agentService";
10
11
 
11
12
  interface AgentHistoryProps {
12
- closedAgents: AgentChat[];
13
+ closedAgents: Agent[];
13
14
  isOpen: boolean;
14
15
  onOpenChange: (open: boolean) => void;
15
- onOpenAgent: (agent: AgentChat) => void;
16
- onDeleteAgent: (agent: AgentChat) => void;
16
+ onOpenAgent: (agent: Agent) => void;
17
+ onDeleteAgent: (agent: Agent) => void;
17
18
  formatDateToLocalTime: (dateString: string) => string;
18
19
  }
19
20
 
@@ -25,7 +26,7 @@ export function AgentHistory({
25
26
  onDeleteAgent,
26
27
  formatDateToLocalTime,
27
28
  }: AgentHistoryProps) {
28
- const handleDeleteClick = (e: React.MouseEvent, agent: AgentChat) => {
29
+ const handleDeleteClick = (e: React.MouseEvent, agent: Agent) => {
29
30
  e.stopPropagation(); // Prevent opening the agent
30
31
  onDeleteAgent(agent);
31
32
  };
@@ -59,10 +60,7 @@ export function AgentHistory({
59
60
  <div className="min-w-0 flex-1">
60
61
  <div className="truncate font-medium text-gray-900">
61
62
  {agent.name}
62
- </div>
63
- <div className="truncate text-gray-500">
64
- {agent.profileName}
65
- </div>
63
+ </div>
66
64
  <div className="text-xs text-gray-400">
67
65
  {formatDateToLocalTime(agent.updatedDate)}
68
66
  </div>