aiframe-agent-cli 1.0.1 → 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/public/index.html +42 -1
- package/package.json +1 -1
package/dist/public/index.html
CHANGED
|
@@ -616,6 +616,17 @@
|
|
|
616
616
|
<label class="form-label">Role Description</label>
|
|
617
617
|
<textarea class="form-input" id="agent-role" style="height: 80px; resize: vertical;" required></textarea>
|
|
618
618
|
</div>
|
|
619
|
+
<div class="form-group">
|
|
620
|
+
<label class="form-label">Provider</label>
|
|
621
|
+
<select class="form-input" id="agent-provider" onchange="toggleAgentProviderFields()">
|
|
622
|
+
<option value="ai-sdk">AI SDK (Cloud LLM)</option>
|
|
623
|
+
<option value="cli">CLI (Local Script / Antigravity)</option>
|
|
624
|
+
</select>
|
|
625
|
+
</div>
|
|
626
|
+
<div class="form-group" id="agent-cli-command-group" style="display: none;">
|
|
627
|
+
<label class="form-label">CLI Command (JSON Array format)</label>
|
|
628
|
+
<input class="form-input" type="text" id="agent-cli-command" placeholder='["antigravity", "chat", "-m", "agent", "{{prompt}}"]'>
|
|
629
|
+
</div>
|
|
619
630
|
<div class="form-group">
|
|
620
631
|
<label class="form-label">Allowed Skills</label>
|
|
621
632
|
<div class="checkbox-grid" id="agent-skills-checkboxes"></div>
|
|
@@ -1184,6 +1195,9 @@
|
|
|
1184
1195
|
document.getElementById('agent-filename').disabled = true;
|
|
1185
1196
|
document.getElementById('agent-name').value = agent.data?.name || '';
|
|
1186
1197
|
document.getElementById('agent-role').value = agent.data?.role || '';
|
|
1198
|
+
document.getElementById('agent-provider').value = agent.data?.provider || 'ai-sdk';
|
|
1199
|
+
document.getElementById('agent-cli-command').value = agent.data?.cli_command ? JSON.stringify(agent.data.cli_command) : '';
|
|
1200
|
+
toggleAgentProviderFields();
|
|
1187
1201
|
document.getElementById('delete-agent-btn').style.display = 'block';
|
|
1188
1202
|
|
|
1189
1203
|
// Uncheck all
|
|
@@ -1215,6 +1229,9 @@
|
|
|
1215
1229
|
document.getElementById('agent-filename').disabled = false;
|
|
1216
1230
|
document.getElementById('agent-name').value = '';
|
|
1217
1231
|
document.getElementById('agent-role').value = '';
|
|
1232
|
+
document.getElementById('agent-provider').value = 'ai-sdk';
|
|
1233
|
+
document.getElementById('agent-cli-command').value = '';
|
|
1234
|
+
toggleAgentProviderFields();
|
|
1218
1235
|
document.querySelectorAll('input[name="agent-skills"]').forEach(cb => cb.checked = false);
|
|
1219
1236
|
document.querySelectorAll('input[name="agent-subagents"]').forEach(cb => cb.checked = false);
|
|
1220
1237
|
document.getElementById('delete-agent-btn').style.display = 'none';
|
|
@@ -1234,9 +1251,22 @@
|
|
|
1234
1251
|
const allowed_sub_agents = [];
|
|
1235
1252
|
document.querySelectorAll('input[name="agent-subagents"]:checked').forEach(cb => allowed_sub_agents.push(cb.value));
|
|
1236
1253
|
|
|
1254
|
+
const provider = document.getElementById('agent-provider').value;
|
|
1255
|
+
let cli_command = undefined;
|
|
1256
|
+
if (provider === 'cli') {
|
|
1257
|
+
try {
|
|
1258
|
+
cli_command = JSON.parse(document.getElementById('agent-cli-command').value || '[]');
|
|
1259
|
+
} catch(e) {
|
|
1260
|
+
alert('CLI command must be a valid JSON array');
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1237
1265
|
const agent = {
|
|
1238
1266
|
name: document.getElementById('agent-name').value,
|
|
1239
1267
|
role: document.getElementById('agent-role').value,
|
|
1268
|
+
provider,
|
|
1269
|
+
cli_command,
|
|
1240
1270
|
tools,
|
|
1241
1271
|
allowed_sub_agents
|
|
1242
1272
|
};
|
|
@@ -1250,6 +1280,16 @@
|
|
|
1250
1280
|
activeAgentFilename = filename;
|
|
1251
1281
|
await loadAgentsTab();
|
|
1252
1282
|
await loadWorkflowsTabAssets();
|
|
1283
|
+
alert('Agent Saved!');
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
function toggleAgentProviderFields() {
|
|
1287
|
+
const provider = document.getElementById('agent-provider').value;
|
|
1288
|
+
if (provider === 'cli') {
|
|
1289
|
+
document.getElementById('agent-cli-command-group').style.display = 'block';
|
|
1290
|
+
} else {
|
|
1291
|
+
document.getElementById('agent-cli-command-group').style.display = 'none';
|
|
1292
|
+
}
|
|
1253
1293
|
}
|
|
1254
1294
|
|
|
1255
1295
|
async function deleteActiveAgent() {
|
|
@@ -1553,8 +1593,9 @@
|
|
|
1553
1593
|
agentsList.innerHTML = '';
|
|
1554
1594
|
agentsData.forEach(agent => {
|
|
1555
1595
|
const name = agent.data?.name || agent.filename.replace('.yaml', '');
|
|
1596
|
+
const fileKey = agent.filename.replace('.yaml', '').replace('.yml', '');
|
|
1556
1597
|
agentsList.innerHTML += `
|
|
1557
|
-
<div class="draggable-item" draggable="true" data-type="sidebar-agent" data-payload="agent/${
|
|
1598
|
+
<div class="draggable-item" draggable="true" data-type="sidebar-agent" data-payload="agent/${fileKey}">
|
|
1558
1599
|
<span>${name}</span>
|
|
1559
1600
|
<span class="badge badge-purple">Agent</span>
|
|
1560
1601
|
</div>
|