@alpaca-editor/core 1.0.4185 → 1.0.4186
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/components/ui/popover.d.ts +3 -3
- package/dist/config/config.js +8 -1
- package/dist/config/config.js.map +1 -1
- package/dist/editor/ConfirmationDialog.js.map +1 -1
- package/dist/editor/ImageEditButton.js.map +1 -1
- package/dist/editor/ai/Agents.js +6 -2
- package/dist/editor/ai/Agents.js.map +1 -1
- package/dist/editor/client/EditorShell.js +17 -0
- package/dist/editor/client/EditorShell.js.map +1 -1
- package/dist/editor/client/ui/EditorChrome.js +1 -0
- package/dist/editor/client/ui/EditorChrome.js.map +1 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js +1 -1
- package/dist/editor/field-types/DateTimeFieldEditor.js.map +1 -1
- package/dist/editor/reviews/CommentDisplayPopover.js.map +1 -1
- package/dist/editor/reviews/CommentPopover.js +1 -1
- package/dist/editor/reviews/CommentPopover.js.map +1 -1
- package/dist/editor/reviews/SuggestionDisplayPopover.js.map +1 -1
- package/dist/editor/services/aiService.d.ts +2 -0
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/views/ParheliaView.d.ts +5 -0
- package/dist/editor/views/ParheliaView.js +136 -0
- package/dist/editor/views/ParheliaView.js.map +1 -0
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +4 -0
- package/package.json +12 -8
- package/src/config/config.tsx +10 -1
- package/src/editor/ConfirmationDialog.tsx +1 -1
- package/src/editor/ImageEditButton.tsx +4 -2
- package/src/editor/ai/Agents.tsx +7 -2
- package/src/editor/client/EditorShell.tsx +18 -0
- package/src/editor/client/ui/EditorChrome.tsx +1 -0
- package/src/editor/field-types/DateTimeFieldEditor.tsx +5 -4
- package/src/editor/reviews/CommentDisplayPopover.tsx +2 -2
- package/src/editor/reviews/CommentPopover.tsx +2 -2
- package/src/editor/reviews/SuggestionDisplayPopover.tsx +1 -1
- package/src/editor/services/aiService.ts +4 -0
- package/src/editor/views/ParheliaView.tsx +207 -0
- package/src/revision.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiService.js","sourceRoot":"","sources":["../../../src/editor/services/aiService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"aiService.js","sourceRoot":"","sources":["../../../src/editor/services/aiService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,EAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AA2B7D,wEAAwE;AACxE,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAgC,CAAC;AACnE,MAAM,eAAe,GAAG,IAAI,GAAG,EAG5B,CAAC;AACJ,MAAM,kBAAkB,GAAG,MAAM,CAAC,CAAC,WAAW;AAE9C,SAAS,oBAAoB,CAAC,IAAqB;IACjD,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAC;IAC3B,MAAM,EAAE,GAAI,IAAY,EAAE,EAAE,IAAI,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAI,IAAY,EAAE,QAAQ,IAAI,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAI,IAAY,EAAE,OAAO,IAAI,EAAE,CAAC;IAC7C,OAAO,GAAG,EAAE,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAqB;IAErB,MAAM,GAAG,GAAG,+BAA+B,CAAC;IAC5C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAE5C,4BAA4B;IAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,QA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ChC,MAAM,GAAG,CAAC,mCAAmC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { AgentTerminal } from "../ai/AgentTerminal";
|
|
4
|
+
import { useEditContext } from "../client/editContext";
|
|
5
|
+
import { loadAiProfiles } from "../services/aiService";
|
|
6
|
+
import { AgentProfilesOverview } from "../ai/AgentProfilesOverview";
|
|
7
|
+
/**
|
|
8
|
+
* ParheliaView - A minimalistic, focused view for a single agent terminal
|
|
9
|
+
* This view provides a distraction-free interface with just the agent terminal centered on screen
|
|
10
|
+
*/
|
|
11
|
+
export function ParheliaView() {
|
|
12
|
+
const editContext = useEditContext();
|
|
13
|
+
const [agent, setAgent] = useState(null);
|
|
14
|
+
const [initialMetadata, setInitialMetadata] = useState(undefined);
|
|
15
|
+
const [availableProfiles, setAvailableProfiles] = useState([]);
|
|
16
|
+
const [loadingProfiles, setLoadingProfiles] = useState(false);
|
|
17
|
+
// Load available profiles
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
let cancelled = false;
|
|
20
|
+
(async () => {
|
|
21
|
+
try {
|
|
22
|
+
setLoadingProfiles(true);
|
|
23
|
+
const profiles = await loadAiProfiles(editContext?.currentItemDescriptor);
|
|
24
|
+
if (cancelled)
|
|
25
|
+
return;
|
|
26
|
+
setAvailableProfiles(profiles || []);
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
console.error("Failed to load AI profiles", e);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
if (!cancelled)
|
|
33
|
+
setLoadingProfiles(false);
|
|
34
|
+
}
|
|
35
|
+
})();
|
|
36
|
+
return () => {
|
|
37
|
+
cancelled = true;
|
|
38
|
+
};
|
|
39
|
+
}, [editContext?.currentItemDescriptor?.id]);
|
|
40
|
+
// Listen for external requests to add a new agent
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const handleAddNewAgent = (ev) => {
|
|
43
|
+
let metadata = undefined;
|
|
44
|
+
try {
|
|
45
|
+
const ce = ev;
|
|
46
|
+
metadata = (ce.detail && ce.detail.metadata);
|
|
47
|
+
}
|
|
48
|
+
catch { }
|
|
49
|
+
// Create a new agent
|
|
50
|
+
const newAgent = {
|
|
51
|
+
status: "new",
|
|
52
|
+
id: crypto.randomUUID(),
|
|
53
|
+
name: `New Agent`,
|
|
54
|
+
updatedDate: new Date().toISOString(),
|
|
55
|
+
userId: "",
|
|
56
|
+
};
|
|
57
|
+
setAgent(newAgent);
|
|
58
|
+
setInitialMetadata(metadata);
|
|
59
|
+
// Focus the prompt after the agent mounts
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
try {
|
|
62
|
+
window.dispatchEvent(new CustomEvent("editor:focusAgentPrompt"));
|
|
63
|
+
}
|
|
64
|
+
catch { }
|
|
65
|
+
}, 60);
|
|
66
|
+
};
|
|
67
|
+
window.addEventListener("editor:addNewAgent", handleAddNewAgent);
|
|
68
|
+
return () => window.removeEventListener("editor:addNewAgent", handleAddNewAgent);
|
|
69
|
+
}, []);
|
|
70
|
+
// Listen for external requests to open an existing agent
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
const handleOpenAgent = (ev) => {
|
|
73
|
+
try {
|
|
74
|
+
const ce = ev;
|
|
75
|
+
const agentId = (ce.detail && ce.detail.agentId);
|
|
76
|
+
if (!agentId)
|
|
77
|
+
return;
|
|
78
|
+
// Load the agent
|
|
79
|
+
const loadedAgent = {
|
|
80
|
+
id: agentId,
|
|
81
|
+
name: "Loading...",
|
|
82
|
+
status: "running",
|
|
83
|
+
userId: "",
|
|
84
|
+
updatedDate: new Date().toISOString(),
|
|
85
|
+
};
|
|
86
|
+
setAgent(loadedAgent);
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error("Error opening agent:", error);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
window.addEventListener("editor:openAgent", handleOpenAgent);
|
|
93
|
+
return () => window.removeEventListener("editor:openAgent", handleOpenAgent);
|
|
94
|
+
}, []);
|
|
95
|
+
const handleSelectProfile = (profileId) => {
|
|
96
|
+
try {
|
|
97
|
+
const selected = availableProfiles.find((p) => p.id === profileId);
|
|
98
|
+
const metadata = selected
|
|
99
|
+
? {
|
|
100
|
+
profile: selected.name,
|
|
101
|
+
additionalData: {
|
|
102
|
+
profileId: selected.id,
|
|
103
|
+
profileName: selected.name,
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
: undefined;
|
|
107
|
+
// Create a new agent with the selected profile
|
|
108
|
+
const newAgent = {
|
|
109
|
+
status: "new",
|
|
110
|
+
id: crypto.randomUUID(),
|
|
111
|
+
name: `New Agent`,
|
|
112
|
+
updatedDate: new Date().toISOString(),
|
|
113
|
+
userId: "",
|
|
114
|
+
};
|
|
115
|
+
setAgent(newAgent);
|
|
116
|
+
setInitialMetadata(metadata);
|
|
117
|
+
// Focus the prompt after the agent mounts
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
try {
|
|
120
|
+
window.dispatchEvent(new CustomEvent("editor:focusAgentPrompt"));
|
|
121
|
+
}
|
|
122
|
+
catch { }
|
|
123
|
+
}, 60);
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
console.error("Error creating agent with profile:", error);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
// Empty state when no agent is active
|
|
130
|
+
if (!agent) {
|
|
131
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center bg-gray-50 p-8", children: _jsx("div", { className: "w-full max-w-4xl", children: loadingProfiles ? (_jsx("div", { className: "text-center text-sm text-gray-500", children: "Loading profiles..." })) : availableProfiles.length > 0 ? (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "text-center", children: [_jsx("h2", { className: "text-2xl font-light tracking-wide text-gray-900", children: "parhelia" }), _jsx("p", { className: "mt-2 text-sm text-gray-500", children: "Select an AI agent profile to begin" })] }), _jsx(AgentProfilesOverview, { profiles: availableProfiles, onSelectProfile: handleSelectProfile })] })) : (_jsxs("div", { className: "text-center", children: [_jsx("h2", { className: "text-2xl font-light tracking-wide text-gray-900", children: "parhelia" }), _jsx("p", { className: "mt-2 text-sm text-gray-500", children: "No agent profiles available" })] })) }) }));
|
|
132
|
+
}
|
|
133
|
+
// Active agent terminal view
|
|
134
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center bg-gray-50", children: _jsx("div", { className: "h-full w-full max-w-6xl", children: _jsx(AgentTerminal, { agentStub: agent, initialMetadata: initialMetadata, profiles: availableProfiles, isActive: true }) }) }));
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=ParheliaView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParheliaView.js","sourceRoot":"","sources":["../../../src/editor/views/ParheliaView.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAa,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAEpD,SAAS,CAAC,CAAC;IACb,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAc,EAAE,CAAC,CAAC;IAC5E,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC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ACH,CAAC,CAAC;IAEF,sCAAsC;IACtC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CACL,cAAK,SAAS,EAAC,wDAAwD,YACrE,cAAK,SAAS,EAAC,kBAAkB,YAC9B,eAAe,CAAC,CAAC,CAAC,CACjB,cAAK,SAAS,EAAC,mCAAmC,oCAE5C,CACP,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACjC,eAAK,SAAS,EAAC,qBAAqB,aAClC,eAAK,SAAS,EAAC,aAAa,aAC1B,aAAI,SAAS,EAAC,iDAAiD,yBAE1D,EACL,YAAG,SAAS,EAAC,4BAA4B,oDAErC,IACA,EACN,KAAC,qBAAqB,IACpB,QAAQ,EAAE,iBAAiB,EAC3B,eAAe,EAAE,mBAAmB,GACpC,IACE,CACP,CAAC,CAAC,CAAC,CACF,eAAK,SAAS,EAAC,aAAa,aAC1B,aAAI,SAAS,EAAC,iDAAiD,yBAE1D,EACL,YAAG,SAAS,EAAC,4BAA4B,4CAErC,IACA,CACP,GACG,GACF,CACP,CAAC;IACJ,CAAC;IAED,6BAA6B;IAC7B,OAAO,CACL,cAAK,SAAS,EAAC,oDAAoD,YACjE,cAAK,SAAS,EAAC,yBAAyB,YACtC,KAAC,aAAa,IACZ,SAAS,EAAE,KAAK,EAChB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,IAAI,GACd,GACE,GACF,CACP,CAAC;AACJ,CAAC"}
|
package/dist/revision.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
2
|
-
export declare const buildDate = "2025-10-
|
|
1
|
+
export declare const version = "1.0.4186";
|
|
2
|
+
export declare const buildDate = "2025-10-24 01:52:39";
|
package/dist/revision.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
2
|
-
export const buildDate = "2025-10-
|
|
1
|
+
export const version = "1.0.4186";
|
|
2
|
+
export const buildDate = "2025-10-24 01:52:39";
|
|
3
3
|
//# sourceMappingURL=revision.js.map
|
package/dist/styles.css
CHANGED
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
--container-lg: 32rem;
|
|
105
105
|
--container-xl: 36rem;
|
|
106
106
|
--container-4xl: 56rem;
|
|
107
|
+
--container-6xl: 72rem;
|
|
107
108
|
--text-xs: 0.75rem;
|
|
108
109
|
--text-xs--line-height: calc(1 / 0.75);
|
|
109
110
|
--text-sm: 0.875rem;
|
|
@@ -980,6 +981,9 @@
|
|
|
980
981
|
.max-w-4xl {
|
|
981
982
|
max-width: var(--container-4xl);
|
|
982
983
|
}
|
|
984
|
+
.max-w-6xl {
|
|
985
|
+
max-width: var(--container-6xl);
|
|
986
|
+
}
|
|
983
987
|
.max-w-48 {
|
|
984
988
|
max-width: calc(var(--spacing) * 48);
|
|
985
989
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpaca-editor/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4186",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@repo/typescript-config": "*",
|
|
21
21
|
"@tailwindcss/cli": "^4.1.10",
|
|
22
22
|
"@types/node": "^22.13.9",
|
|
23
|
-
"@types/react": "19.
|
|
24
|
-
"@types/react-dom": "19.
|
|
23
|
+
"@types/react": "19.2.2",
|
|
24
|
+
"@types/react-dom": "19.2.2",
|
|
25
25
|
"copyfiles": "^2.4.1",
|
|
26
26
|
"eslint": "^9.22.0",
|
|
27
27
|
"typescript": "5.8.2"
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"html-entities": "^2.6.0",
|
|
52
52
|
"lucide-react": "^0.486.0",
|
|
53
53
|
"morphdom": "^2.7.5",
|
|
54
|
-
"next": "
|
|
54
|
+
"next": "16.0.0",
|
|
55
55
|
"next-themes": "^0.4.6",
|
|
56
56
|
"postcss": "^8.5.3",
|
|
57
57
|
"quill": "^2.0.3",
|
|
58
|
-
"react": "
|
|
58
|
+
"react": "19.2.0",
|
|
59
59
|
"react-day-picker": "^9.8.0",
|
|
60
|
-
"react-dom": "
|
|
60
|
+
"react-dom": "19.2.0",
|
|
61
61
|
"react-inspector": "^6.0.2",
|
|
62
62
|
"react-json-view-lite": "^2.4.1",
|
|
63
63
|
"react-quill-new": "^3.4.1",
|
|
@@ -67,9 +67,13 @@
|
|
|
67
67
|
"slate-react": "^0.117.4",
|
|
68
68
|
"sonner": "^2.0.6",
|
|
69
69
|
"tailwind-merge": "^3.1.0",
|
|
70
|
-
"tailwindcss": "^4.1.
|
|
70
|
+
"tailwindcss": "^4.1.16",
|
|
71
71
|
"tw-animate-css": "^1.2.5",
|
|
72
72
|
"universal-cookie": "^8.0.0",
|
|
73
73
|
"use-debounce": "^10.0.4"
|
|
74
|
+
},
|
|
75
|
+
"overrides": {
|
|
76
|
+
"@types/react": "19.2.2",
|
|
77
|
+
"@types/react-dom": "19.2.2"
|
|
74
78
|
}
|
|
75
|
-
}
|
|
79
|
+
}
|
package/src/config/config.tsx
CHANGED
|
@@ -71,6 +71,8 @@ import { loadInsertOptions } from "../editor/services/editService";
|
|
|
71
71
|
import { getDefaultTourSteps } from "../tour/default-tour";
|
|
72
72
|
import { Translation } from "../editor/sidebar/Translations";
|
|
73
73
|
import { EditView } from "../editor/views/EditView";
|
|
74
|
+
import { ParheliaView } from "../editor/views/ParheliaView";
|
|
75
|
+
import { AnimatedSunIcon } from "../editor/ui/Icons";
|
|
74
76
|
import { InsertMenuTemplate } from "../editor/context-menu/InsertMenu";
|
|
75
77
|
|
|
76
78
|
import { Status } from "../editor/control-center/Status";
|
|
@@ -733,8 +735,15 @@ export const getConfiguration = (): EditorConfiguration => {
|
|
|
733
735
|
expandTreeNode: "bafb88a1-506a-4671-b47b-1947730d25f6",
|
|
734
736
|
},
|
|
735
737
|
},
|
|
736
|
-
defaultPinnedViews: ["ai", "content-editor"],
|
|
738
|
+
defaultPinnedViews: ["parhelia", "ai", "content-editor"],
|
|
737
739
|
views: [
|
|
740
|
+
// {
|
|
741
|
+
// name: "parhelia",
|
|
742
|
+
// title: "Parhelia",
|
|
743
|
+
// icon: <AnimatedSunIcon strokeWidth={1} />,
|
|
744
|
+
// defaultCenterPanelView: <ParheliaView />,
|
|
745
|
+
// hideViewSelector: false,
|
|
746
|
+
// },
|
|
738
747
|
{
|
|
739
748
|
name: "splash-screen",
|
|
740
749
|
title: "Splash Screen",
|
|
@@ -68,7 +68,7 @@ const ConfirmationDialog = forwardRef<
|
|
|
68
68
|
>
|
|
69
69
|
<DialogHeader className="space-y-0 px-6 pt-3 pb-2">
|
|
70
70
|
<DialogTitle className="text-lg font-semibold">
|
|
71
|
-
{props?.header || "Confirmation"}
|
|
71
|
+
{props?.header || ("Confirmation" as any)}
|
|
72
72
|
</DialogTitle>
|
|
73
73
|
</DialogHeader>
|
|
74
74
|
<div className="px-6 py-4">
|
|
@@ -85,7 +85,9 @@ export function ImageEditButton({
|
|
|
85
85
|
return (
|
|
86
86
|
<DropdownMenu open={showMenu} onOpenChange={setShowMenu}>
|
|
87
87
|
{triggerButton ? (
|
|
88
|
-
<DropdownMenuTrigger asChild>
|
|
88
|
+
<DropdownMenuTrigger asChild>
|
|
89
|
+
{triggerButton as any}
|
|
90
|
+
</DropdownMenuTrigger>
|
|
89
91
|
) : (
|
|
90
92
|
defaultTriggerButton
|
|
91
93
|
)}
|
|
@@ -99,7 +101,7 @@ export function ImageEditButton({
|
|
|
99
101
|
setShowMenu(false);
|
|
100
102
|
}}
|
|
101
103
|
>
|
|
102
|
-
{action.icon}
|
|
104
|
+
{action.icon as any}
|
|
103
105
|
{action.label}
|
|
104
106
|
</DropdownMenuItem>
|
|
105
107
|
))}
|
package/src/editor/ai/Agents.tsx
CHANGED
|
@@ -289,7 +289,7 @@ export const Agents = React.memo(function Agents({
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
if (message.type === "agent:run:start") {
|
|
292
|
-
const { agentId, agentName } = message.payload;
|
|
292
|
+
const { agentId, agentName, autoSelect } = message.payload;
|
|
293
293
|
|
|
294
294
|
if (!agentId || !agentName) {
|
|
295
295
|
console.warn(
|
|
@@ -320,7 +320,7 @@ export const Agents = React.memo(function Agents({
|
|
|
320
320
|
};
|
|
321
321
|
return updatedAgents;
|
|
322
322
|
} else {
|
|
323
|
-
// Add new agent to the array
|
|
323
|
+
// Add new agent to the array
|
|
324
324
|
const newAgent: Agent = {
|
|
325
325
|
id: agentId,
|
|
326
326
|
name: agentName,
|
|
@@ -332,6 +332,11 @@ export const Agents = React.memo(function Agents({
|
|
|
332
332
|
return [...prevAgents, newAgent];
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
|
+
|
|
336
|
+
// Auto-switch to the spawned agent if requested
|
|
337
|
+
if (autoSelect === true) {
|
|
338
|
+
setActiveAgentIdWithStorage(agentId);
|
|
339
|
+
}
|
|
335
340
|
} else if (message.type === "agent:info:updated") {
|
|
336
341
|
const { agentId, agentName, agentDescription } =
|
|
337
342
|
message.payload || {};
|
|
@@ -1518,6 +1518,24 @@ export function EditorShell({
|
|
|
1518
1518
|
switchView();
|
|
1519
1519
|
};
|
|
1520
1520
|
|
|
1521
|
+
// Listen for switch-view commands from agents via websocket
|
|
1522
|
+
useEffect(() => {
|
|
1523
|
+
const handleSwitchView = (message: { type: string; payload: any }) => {
|
|
1524
|
+
if (message.type === "switch-view" && message.payload?.viewName) {
|
|
1525
|
+
try {
|
|
1526
|
+
switchView(message.payload.viewName);
|
|
1527
|
+
} catch (error) {
|
|
1528
|
+
console.error("Error switching view:", error);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
const unsubscribe = addSocketMessageListener(handleSwitchView);
|
|
1534
|
+
return () => {
|
|
1535
|
+
unsubscribe();
|
|
1536
|
+
};
|
|
1537
|
+
}, [addSocketMessageListener, switchView]);
|
|
1538
|
+
|
|
1521
1539
|
const [dialog, setDialog] = useState<ReactNode>(null);
|
|
1522
1540
|
|
|
1523
1541
|
const openDialog: OpenDialog = useCallback(
|
|
@@ -177,9 +177,10 @@ export function DateTimeFieldEditor({
|
|
|
177
177
|
<PopoverTrigger asChild>
|
|
178
178
|
<Button
|
|
179
179
|
variant="outline"
|
|
180
|
+
size="sm"
|
|
180
181
|
data-empty={!date}
|
|
181
182
|
className={cn(
|
|
182
|
-
"bg-gray-5 justify-start
|
|
183
|
+
"bg-gray-5 justify-start px-2 text-left text-xs font-normal",
|
|
183
184
|
!date && "text-muted-foreground",
|
|
184
185
|
)}
|
|
185
186
|
disabled={readOnly}
|
|
@@ -205,7 +206,7 @@ export function DateTimeFieldEditor({
|
|
|
205
206
|
|
|
206
207
|
<div
|
|
207
208
|
className={cn(
|
|
208
|
-
"bg-gray-5 flex items-center justify-start gap-1 px-2 text-left text-xs font-normal",
|
|
209
|
+
"bg-gray-5 flex h-8 items-center justify-start gap-1 rounded-sm px-2 text-left text-xs font-normal",
|
|
209
210
|
!date && "text-muted-foreground",
|
|
210
211
|
)}
|
|
211
212
|
>
|
|
@@ -216,7 +217,7 @@ export function DateTimeFieldEditor({
|
|
|
216
217
|
<PopoverTrigger asChild>
|
|
217
218
|
<Button
|
|
218
219
|
variant="ghost"
|
|
219
|
-
className="bg-gray-5 h-8 w-12 p-
|
|
220
|
+
className="bg-gray-5 h-8 w-12 p-0 text-xs"
|
|
220
221
|
disabled={readOnly || !date}
|
|
221
222
|
>
|
|
222
223
|
{hours.toString().padStart(2, "0")}
|
|
@@ -249,7 +250,7 @@ export function DateTimeFieldEditor({
|
|
|
249
250
|
<PopoverTrigger asChild>
|
|
250
251
|
<Button
|
|
251
252
|
variant="ghost"
|
|
252
|
-
className="bg-gray-5 h-
|
|
253
|
+
className="bg-gray-5 h-8 w-12 p-0 text-xs"
|
|
253
254
|
disabled={readOnly || !date}
|
|
254
255
|
>
|
|
255
256
|
{minutes.toString().padStart(2, "0")}
|
|
@@ -109,9 +109,9 @@ export function CommentDisplayPopover({
|
|
|
109
109
|
}}
|
|
110
110
|
enableIframeClickDetection={true}
|
|
111
111
|
>
|
|
112
|
-
<PopoverTrigger asChild>{children}</PopoverTrigger>
|
|
112
|
+
<PopoverTrigger asChild>{children as any}</PopoverTrigger>
|
|
113
113
|
<PopoverContent
|
|
114
|
-
ref={contentRef}
|
|
114
|
+
ref={contentRef as any}
|
|
115
115
|
tabIndex={-1}
|
|
116
116
|
className="w-96 p-4"
|
|
117
117
|
side="bottom"
|
|
@@ -163,11 +163,11 @@ export function CommentPopover({
|
|
|
163
163
|
)}
|
|
164
164
|
{!position && (
|
|
165
165
|
<PopoverTrigger asChild>
|
|
166
|
-
{children ?? <MessageCirclePlus size={16} strokeWidth={1} />}
|
|
166
|
+
{(children ?? <MessageCirclePlus size={16} strokeWidth={1} />) as any}
|
|
167
167
|
</PopoverTrigger>
|
|
168
168
|
)}
|
|
169
169
|
<PopoverContent
|
|
170
|
-
ref={contentRef}
|
|
170
|
+
ref={contentRef as any}
|
|
171
171
|
tabIndex={-1}
|
|
172
172
|
className="w-96 p-4"
|
|
173
173
|
data-testid="add-comment-popover"
|
|
@@ -265,7 +265,7 @@ export function SuggestionDisplayPopover({
|
|
|
265
265
|
}}
|
|
266
266
|
enableIframeClickDetection={true}
|
|
267
267
|
>
|
|
268
|
-
<PopoverTrigger asChild>{children}</PopoverTrigger>
|
|
268
|
+
<PopoverTrigger asChild>{children as any}</PopoverTrigger>
|
|
269
269
|
<PopoverContent className="w-96 p-4" side="bottom" align="start">
|
|
270
270
|
<div className="space-y-3">
|
|
271
271
|
{/* Header */}
|
|
@@ -24,6 +24,10 @@ export type AiProfile = {
|
|
|
24
24
|
hiddenFromOverview?: boolean;
|
|
25
25
|
// Optional cost limit configured on the profile (USD)
|
|
26
26
|
costLimit?: number | null;
|
|
27
|
+
// Number of user browse history items to include (0 = disabled)
|
|
28
|
+
includeUserBrowseHistory?: number;
|
|
29
|
+
// Whether to include user favorites
|
|
30
|
+
includeUserFavorites?: boolean;
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
// In-flight de-duplication and short TTL cache for AI profiles to avoid
|