codex-linux 1.0.2 → 1.0.3
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/renderer/assets/main-CU1lrRNa.css +1 -0
- package/dist/renderer/assets/main-DQIKNXUA.js +304 -0
- package/dist/renderer/index.html +2 -2
- package/package.json +1 -1
- package/src/renderer/components/AgentPanel.tsx +53 -6
- package/dist/renderer/assets/main-AJwWHWV7.js +0 -304
- package/dist/renderer/assets/main-ua9RiJ9-.css +0 -1
package/dist/renderer/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<meta name="apple-mobile-web-app-title" content="Codex" />
|
|
13
13
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://api.openai.com https://api.anthropic.com ws://localhost:*;">
|
|
14
14
|
<title>Codex Linux</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/main-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="./assets/main-
|
|
15
|
+
<script type="module" crossorigin src="./assets/main-DQIKNXUA.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="./assets/main-CU1lrRNa.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -37,10 +37,12 @@ export const AgentPanel: React.FC<AgentPanelProps> = ({
|
|
|
37
37
|
const [newAgentConfig, setNewAgentConfig] = useState({
|
|
38
38
|
name: '',
|
|
39
39
|
projectPath: '',
|
|
40
|
-
providerId:
|
|
40
|
+
providerId: '',
|
|
41
41
|
model: '',
|
|
42
42
|
skills: [] as string[]
|
|
43
43
|
});
|
|
44
|
+
const [createError, setCreateError] = useState<string | null>(null);
|
|
45
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
44
46
|
|
|
45
47
|
const selectedAgentChanges = useMemo(() => {
|
|
46
48
|
if (!selectedAgent) return [];
|
|
@@ -84,6 +86,16 @@ export const AgentPanel: React.FC<AgentPanelProps> = ({
|
|
|
84
86
|
void refreshQueueHistory(selectedAgent.id);
|
|
85
87
|
}, [selectedAgent?.id]);
|
|
86
88
|
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (providers.length > 0 && !newAgentConfig.providerId) {
|
|
91
|
+
setNewAgentConfig(prev => ({
|
|
92
|
+
...prev,
|
|
93
|
+
providerId: providers[0].id,
|
|
94
|
+
model: providers[0].models[0]?.id || ''
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
}, [providers]);
|
|
98
|
+
|
|
87
99
|
useEffect(() => {
|
|
88
100
|
const onTaskStarted = (event: any, payload: { agentId: string }) => {
|
|
89
101
|
setInFlightByAgent(prev => ({ ...prev, [payload.agentId]: true }));
|
|
@@ -195,6 +207,22 @@ export const AgentPanel: React.FC<AgentPanelProps> = ({
|
|
|
195
207
|
}, [selectedAgent?.id]);
|
|
196
208
|
|
|
197
209
|
const handleCreateAgent = async () => {
|
|
210
|
+
if (!newAgentConfig.name.trim()) {
|
|
211
|
+
setCreateError('Agent name is required');
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (!newAgentConfig.projectPath.trim()) {
|
|
215
|
+
setCreateError('Project path is required');
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (!newAgentConfig.model) {
|
|
219
|
+
setCreateError('Please select a model');
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
setCreateError(null);
|
|
224
|
+
setIsCreating(true);
|
|
225
|
+
|
|
198
226
|
try {
|
|
199
227
|
await onCreateAgent(newAgentConfig);
|
|
200
228
|
setShowCreateModal(false);
|
|
@@ -202,11 +230,14 @@ export const AgentPanel: React.FC<AgentPanelProps> = ({
|
|
|
202
230
|
name: '',
|
|
203
231
|
projectPath: '',
|
|
204
232
|
providerId: providers[0]?.id || '',
|
|
205
|
-
model: '',
|
|
233
|
+
model: providers[0]?.models[0]?.id || '',
|
|
206
234
|
skills: []
|
|
207
235
|
});
|
|
208
236
|
} catch (error) {
|
|
209
237
|
console.error('Failed to create agent:', error);
|
|
238
|
+
setCreateError(error instanceof Error ? error.message : 'Failed to create agent');
|
|
239
|
+
} finally {
|
|
240
|
+
setIsCreating(false);
|
|
210
241
|
}
|
|
211
242
|
};
|
|
212
243
|
|
|
@@ -706,19 +737,35 @@ export const AgentPanel: React.FC<AgentPanelProps> = ({
|
|
|
706
737
|
</div>
|
|
707
738
|
</div>
|
|
708
739
|
|
|
740
|
+
{createError && (
|
|
741
|
+
<div className="mt-4 p-3 bg-[rgba(232,90,106,0.1)] border border-[rgba(232,90,106,0.3)] rounded-[var(--radius-md)]">
|
|
742
|
+
<p className="text-[12px] text-[var(--error)]">{createError}</p>
|
|
743
|
+
</div>
|
|
744
|
+
)}
|
|
745
|
+
|
|
709
746
|
<div className="flex justify-end gap-2 mt-6">
|
|
710
747
|
<button
|
|
711
|
-
onClick={() =>
|
|
748
|
+
onClick={() => {
|
|
749
|
+
setShowCreateModal(false);
|
|
750
|
+
setCreateError(null);
|
|
751
|
+
}}
|
|
712
752
|
className="px-4 py-2 text-[var(--text-muted)] hover:text-[var(--text-primary)] text-[13px] transition-colors"
|
|
713
753
|
>
|
|
714
754
|
Cancel
|
|
715
755
|
</button>
|
|
716
756
|
<button
|
|
717
757
|
onClick={handleCreateAgent}
|
|
718
|
-
disabled={!newAgentConfig.name || !newAgentConfig.projectPath}
|
|
719
|
-
className="px-4 py-2 bg-[var(--teal-500)] text-[var(--bg-void)] rounded-[var(--radius-sm)] hover:bg-[var(--teal-400)] disabled:opacity-50 text-[13px] font-medium transition-colors"
|
|
758
|
+
disabled={isCreating || !newAgentConfig.name || !newAgentConfig.projectPath}
|
|
759
|
+
className="px-4 py-2 bg-[var(--teal-500)] text-[var(--bg-void)] rounded-[var(--radius-sm)] hover:bg-[var(--teal-400)] disabled:opacity-50 text-[13px] font-medium transition-colors flex items-center gap-2"
|
|
720
760
|
>
|
|
721
|
-
|
|
761
|
+
{isCreating ? (
|
|
762
|
+
<>
|
|
763
|
+
<div className="w-4 h-4 border-2 border-[var(--bg-void)] border-t-transparent rounded-full animate-spin" />
|
|
764
|
+
Creating...
|
|
765
|
+
</>
|
|
766
|
+
) : (
|
|
767
|
+
'Create Agent'
|
|
768
|
+
)}
|
|
722
769
|
</button>
|
|
723
770
|
</div>
|
|
724
771
|
</div>
|