@bamptee/aia-code 2.0.0 → 2.0.1
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/package.json
CHANGED
package/src/ui/api/constants.js
CHANGED
|
@@ -7,13 +7,19 @@ export function registerConstantsRoutes(router) {
|
|
|
7
7
|
json(res, { FEATURE_STEPS, STEP_STATUS, QUICK_STEPS });
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
// List
|
|
10
|
+
// List all unique models from config
|
|
11
11
|
router.get('/api/models', async (req, res, { root }) => {
|
|
12
12
|
try {
|
|
13
13
|
const config = await loadConfig(root);
|
|
14
|
-
|
|
14
|
+
const all = new Set();
|
|
15
|
+
for (const models of Object.values(config.models || {})) {
|
|
16
|
+
for (const entry of models) {
|
|
17
|
+
all.add(entry.model);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
json(res, [...all]);
|
|
15
21
|
} catch (err) {
|
|
16
|
-
json(res,
|
|
22
|
+
json(res, []);
|
|
17
23
|
}
|
|
18
24
|
});
|
|
19
25
|
}
|
|
@@ -138,17 +138,12 @@ function LogViewer({ logs }) {
|
|
|
138
138
|
}, logs.join(''));
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function ModelSelect({
|
|
141
|
+
function ModelSelect({ model, onChange, disabled }) {
|
|
142
142
|
const [models, setModels] = React.useState([]);
|
|
143
143
|
|
|
144
144
|
React.useEffect(() => {
|
|
145
|
-
api.get('/models').then(
|
|
146
|
-
|
|
147
|
-
setModels(stepModels.map(m => m.model));
|
|
148
|
-
}).catch(() => {});
|
|
149
|
-
}, [step]);
|
|
150
|
-
|
|
151
|
-
if (models.length <= 1) return null;
|
|
145
|
+
api.get('/models').then(setModels).catch(() => {});
|
|
146
|
+
}, []);
|
|
152
147
|
|
|
153
148
|
return React.createElement('select', {
|
|
154
149
|
value: model,
|
|
@@ -212,7 +207,7 @@ function RunPanel({ name, step, stepStatus, onDone }) {
|
|
|
212
207
|
className: 'w-full bg-aia-card border border-aia-border rounded px-3 py-1.5 text-sm text-slate-200 placeholder-slate-500 focus:border-emerald-400 focus:outline-none',
|
|
213
208
|
}),
|
|
214
209
|
React.createElement('div', { className: 'flex items-center gap-4 flex-wrap' },
|
|
215
|
-
React.createElement(ModelSelect, {
|
|
210
|
+
React.createElement(ModelSelect, { model, onChange: setModel, disabled: running }),
|
|
216
211
|
React.createElement('label', { className: 'flex items-center gap-2 text-xs text-slate-400 cursor-pointer' },
|
|
217
212
|
React.createElement('input', { type: 'checkbox', checked: apply, onChange: e => setApply(e.target.checked), disabled: running, className: 'rounded' }),
|
|
218
213
|
'Agent mode (--apply)'
|
|
@@ -241,7 +236,7 @@ function RunPanel({ name, step, stepStatus, onDone }) {
|
|
|
241
236
|
className: 'w-full bg-aia-card border border-aia-border rounded px-3 py-2 text-sm text-slate-200 placeholder-slate-500 focus:border-violet-400 focus:outline-none resize-y',
|
|
242
237
|
}),
|
|
243
238
|
React.createElement('div', { className: 'flex items-center gap-4 flex-wrap' },
|
|
244
|
-
React.createElement(ModelSelect, {
|
|
239
|
+
React.createElement(ModelSelect, { model, onChange: setModel, disabled: running }),
|
|
245
240
|
React.createElement('label', { className: 'flex items-center gap-2 text-xs text-slate-400 cursor-pointer' },
|
|
246
241
|
React.createElement('input', { type: 'checkbox', checked: apply, onChange: e => setApply(e.target.checked), disabled: running, className: 'rounded' }),
|
|
247
242
|
'Agent mode (--apply)'
|