crewswarm 0.9.2 → 0.9.4
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/README.md +22 -9
- package/apps/dashboard/dist/assets/chat-core-uXb_C0GM.js +1 -0
- package/apps/dashboard/dist/assets/chat-core-uXb_C0GM.js.br +0 -0
- package/apps/dashboard/dist/assets/cli-process-CNZ_UBCt.js +1 -0
- package/apps/dashboard/dist/assets/cli-process-CNZ_UBCt.js.br +0 -0
- package/apps/dashboard/dist/assets/index-BeVllEj_.js +2 -0
- package/apps/dashboard/dist/assets/index-BeVllEj_.js.br +0 -0
- package/apps/dashboard/dist/assets/{index-CF0aJRtC.css → index-D-sRshvg.css} +1 -1
- package/apps/dashboard/dist/assets/index-D-sRshvg.css.br +0 -0
- package/apps/dashboard/dist/assets/tab-benchmarks-tab-BHjKCPm3.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-models-tab-dNRgsTOO.js +1 -0
- package/apps/dashboard/dist/assets/tab-models-tab-dNRgsTOO.js.br +0 -0
- package/apps/dashboard/dist/assets/{tab-pm-loop-tab-Bfd449B4.js → tab-pm-loop-tab-DiAPTJXu.js} +1 -1
- package/apps/dashboard/dist/assets/tab-pm-loop-tab-DiAPTJXu.js.br +0 -0
- package/apps/dashboard/dist/assets/{tab-projects-tab-DhNWnlzt.js → tab-projects-tab-SFH4E--a.js} +1 -1
- package/apps/dashboard/dist/assets/tab-projects-tab-SFH4E--a.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-settings-tab-CuvH_Fj_.js +1 -0
- package/apps/dashboard/dist/assets/tab-settings-tab-CuvH_Fj_.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-skills-tab-DR7PJ7NB.js +1 -0
- package/apps/dashboard/dist/assets/tab-skills-tab-DR7PJ7NB.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-testing-tab-CezZOZcJ.js +1 -0
- package/apps/dashboard/dist/assets/tab-testing-tab-CezZOZcJ.js.br +0 -0
- package/apps/dashboard/dist/index.html +135 -15
- package/apps/dashboard/dist/index.html.br +0 -0
- package/apps/dashboard/dist/index.html.gz +0 -0
- package/apps/vibe/README.md +2 -2
- package/apps/vibe/package.json +1 -1
- package/apps/vibe/server.mjs +101 -56
- package/crew-lead.mjs +34 -4
- package/lib/bridges/cli-executor.mjs +1 -1
- package/lib/bridges/gateway-ws.mjs +4 -0
- package/lib/browser/passthrough-stderr.js +1 -0
- package/lib/chat/project-messages.mjs +3 -5
- package/lib/cli-process-tracker.mjs +3 -2
- package/lib/contacts/identity-linker.mjs +1 -0
- package/lib/crew-judge/judge.mjs +19 -18
- package/lib/crew-lead/agent-manager.mjs +1 -1
- package/lib/crew-lead/background.mjs +14 -1
- package/lib/crew-lead/chat-handler.mjs +38 -1
- package/lib/crew-lead/http-server.mjs +106 -57
- package/lib/crew-lead/llm-caller.mjs +24 -8
- package/lib/crew-lead/prompts.mjs +14 -1
- package/lib/crew-lead/tools.mjs +3 -2
- package/lib/crew-lead/wave-dispatcher.mjs +19 -5
- package/lib/crew-lead/ws-router.mjs +219 -27
- package/lib/engines/crew-cli.mjs +1 -1
- package/lib/engines/engine-registry.mjs +14 -3
- package/lib/engines/rt-envelope.mjs +1 -0
- package/lib/engines/runners.mjs +28 -4
- package/lib/gemini-cli-passthrough-noise.mjs +1 -1
- package/lib/integrations/code-search.mjs +4 -3
- package/lib/memory/shared-adapter.mjs +23 -10
- package/lib/pipeline/manager.mjs +2 -1
- package/lib/runtime/config.mjs +1 -1
- package/lib/runtime/paths.mjs +12 -8
- package/lib/runtime/spending.mjs +2 -1
- package/package.json +42 -14
- package/scripts/capture-build-flow.mjs +118 -0
- package/scripts/coverage-report.mjs +209 -0
- package/scripts/coverage-summary.mjs +47 -0
- package/scripts/dashboard-validation.mjs +76 -0
- package/scripts/dashboard.mjs +1667 -551
- package/scripts/generate-openapi.mjs +683 -277
- package/scripts/live-bridge-matrix.mjs +79 -0
- package/scripts/live-cli-matrix.mjs +166 -0
- package/scripts/live-crewchat-check.mjs +42 -0
- package/scripts/live-engine-matrix.mjs +50 -0
- package/scripts/live-provider-failover-matrix.mjs +107 -0
- package/scripts/live-provider-matrix.mjs +228 -0
- package/scripts/restart-all-from-repo.sh +4 -4
- package/scripts/restart-service.sh +12 -9
- package/scripts/smoke-dispatch.mjs +4 -1
- package/scripts/test-blast-radius.mjs +204 -0
- package/scripts/test-report-summary.mjs +88 -0
- package/scripts/test-reporter.mjs +651 -0
- package/scripts/test-rerun.mjs +136 -0
- package/scripts/tmux-bridge +130 -0
- package/apps/dashboard/dist/assets/chat-core-Cx4sTxDd.js +0 -1
- package/apps/dashboard/dist/assets/chat-core-Cx4sTxDd.js.br +0 -0
- package/apps/dashboard/dist/assets/cli-process-COMRNPqr.js +0 -1
- package/apps/dashboard/dist/assets/cli-process-COMRNPqr.js.br +0 -0
- package/apps/dashboard/dist/assets/index-CF0aJRtC.css.br +0 -0
- package/apps/dashboard/dist/assets/index-DnClJ1ee.js +0 -2
- package/apps/dashboard/dist/assets/index-DnClJ1ee.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-models-tab-BLEjmd19.js +0 -1
- package/apps/dashboard/dist/assets/tab-models-tab-BLEjmd19.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-pm-loop-tab-Bfd449B4.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-projects-tab-DhNWnlzt.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-settings-tab-Bn4nXtDe.js +0 -1
- package/apps/dashboard/dist/assets/tab-settings-tab-Bn4nXtDe.js.br +0 -0
- package/apps/dashboard/dist/assets/tab-skills-tab-BpY0uZHW.js +0 -1
- package/apps/dashboard/dist/assets/tab-skills-tab-BpY0uZHW.js.br +0 -0
- package/apps/dashboard/index.html +0 -6529
- package/apps/dashboard/package.json +0 -15
- package/apps/dashboard/src/app.js +0 -2828
- package/apps/dashboard/src/app.js.br +0 -0
- package/apps/dashboard/src/app.js.gz +0 -0
- package/apps/dashboard/src/chat/chat-actions.js +0 -1847
- package/apps/dashboard/src/chat/chat-actions.js.br +0 -0
- package/apps/dashboard/src/chat/unified-messages.js +0 -327
- package/apps/dashboard/src/chat/unified-messages.js.br +0 -0
- package/apps/dashboard/src/cli-process.js +0 -208
- package/apps/dashboard/src/cli-process.js.br +0 -0
- package/apps/dashboard/src/cli-process.js.gz +0 -0
- package/apps/dashboard/src/components/active-tasks-panel.js +0 -175
- package/apps/dashboard/src/components/active-tasks-panel.js.br +0 -0
- package/apps/dashboard/src/core/api.js +0 -18
- package/apps/dashboard/src/core/api.js.br +0 -0
- package/apps/dashboard/src/core/dom.js +0 -228
- package/apps/dashboard/src/core/dom.js.br +0 -0
- package/apps/dashboard/src/core/state.js +0 -91
- package/apps/dashboard/src/core/state.js.br +0 -0
- package/apps/dashboard/src/core/task-manager.js +0 -134
- package/apps/dashboard/src/core/task-manager.js.br +0 -0
- package/apps/dashboard/src/orchestration-status.js +0 -127
- package/apps/dashboard/src/orchestration-status.js.br +0 -0
- package/apps/dashboard/src/setup-wizard.js +0 -562
- package/apps/dashboard/src/setup-wizard.js.br +0 -0
- package/apps/dashboard/src/styles.css +0 -2085
- package/apps/dashboard/src/styles.css.br +0 -0
- package/apps/dashboard/src/styles.css.gz +0 -0
- package/apps/dashboard/src/tabs/agents-tab.js +0 -2237
- package/apps/dashboard/src/tabs/agents-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/benchmarks-tab.js +0 -229
- package/apps/dashboard/src/tabs/benchmarks-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/comms-tab.js +0 -955
- package/apps/dashboard/src/tabs/comms-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/contacts-tab.js +0 -654
- package/apps/dashboard/src/tabs/contacts-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/engines-tab.js +0 -175
- package/apps/dashboard/src/tabs/engines-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/memory-tab.js +0 -182
- package/apps/dashboard/src/tabs/memory-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/models-tab.js +0 -450
- package/apps/dashboard/src/tabs/models-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/pm-loop-tab.js +0 -185
- package/apps/dashboard/src/tabs/pm-loop-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/projects-tab.js +0 -663
- package/apps/dashboard/src/tabs/projects-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/projects-tab.js.gz +0 -0
- package/apps/dashboard/src/tabs/prompts-tab.js +0 -160
- package/apps/dashboard/src/tabs/prompts-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/services-tab.js +0 -202
- package/apps/dashboard/src/tabs/services-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/settings-tab.js +0 -861
- package/apps/dashboard/src/tabs/settings-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/skills-tab.js +0 -284
- package/apps/dashboard/src/tabs/skills-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/spending-tab.js +0 -173
- package/apps/dashboard/src/tabs/spending-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/swarm-chat-tab.js +0 -660
- package/apps/dashboard/src/tabs/swarm-chat-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/swarm-tab.js +0 -538
- package/apps/dashboard/src/tabs/swarm-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/usage-tab.js +0 -390
- package/apps/dashboard/src/tabs/usage-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/waves-tab.js +0 -238
- package/apps/dashboard/src/tabs/waves-tab.js.br +0 -0
- package/apps/dashboard/src/tabs/workflows-tab.js +0 -747
- package/apps/dashboard/src/tabs/workflows-tab.js.br +0 -0
- package/apps/vibe/.crew/agent-memory/pipeline.json +0 -304
- package/apps/vibe/.crew/cost.json +0 -17
- package/apps/vibe/.crew/json-parse-metrics.jsonl +0 -27
- package/apps/vibe/.crew/pipeline-metrics.jsonl +0 -27
- package/apps/vibe/.crew/pipeline-runs/pipeline-0f90c392-2425-4ae5-850c-bd9d17b1d690.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-1c269dd9-a63f-4fba-af81-5cf08048ef06.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-288a7765-da24-4a22-89bc-1f3cc9b0562c.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-2c78fd22-a657-4bd1-bc49-0679fb384409.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-3da23550-22ed-4904-9a0a-8e79c1f3024c.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-3e6fe08d-3264-404a-8df3-aab7efef10e7.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-42eec610-57fe-4e09-9e7e-b315038495c2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-4438eb4c-ae13-42b1-90e2-b043d8983be8.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-4740a9f5-86e7-44b6-a394-de433e291727.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-49e1da6a-957e-48fd-9220-415019e4f8e2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-4c9251db-be68-427b-a3fc-a264f2b5778d.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-6413fa33-a802-4b57-a8c0-a9056ad67842.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-65e29a57-664d-4196-8109-017e364f182e.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-6aa04bc5-9593-4b1f-b58d-3bf2978cb602.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-6e1cba53-9b70-457e-99e0-59199149dd21.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-749f41cc-4dac-4204-be64-873a6080a0d2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-74d68121-e181-4864-bd9a-c3211341dfaf.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-8509bc24-142d-4e07-b44a-a50bf99d1103.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-960339c6-07ca-43ce-9900-f6e1702b39b9.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-9bef2dd2-6122-42e5-b3d9-19f4d80f9e40.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-9c6480a9-7031-4146-b241-825b9a2d1de1.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-9fd42426-8492-4157-9d5f-e1537c060489.jsonl +0 -2
- package/apps/vibe/.crew/pipeline-runs/pipeline-ad6d40a3-2f5e-46a9-a345-47caaccc51aa.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-bc606133-8d5b-4535-8d85-f1a29cdaa981.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-c1418f4e-b773-4ca1-84a3-216acf36e2f2.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-c1a13ccd-634a-4d01-a4a7-1177b8a752ff.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-c7d27b42-249e-4bd4-8f26-6aa998110b8a.jsonl +0 -5
- package/apps/vibe/.crew/pipeline-runs/pipeline-cca2e9b9-4a34-4d25-a311-5c793fa7e91e.jsonl +0 -5
- package/apps/vibe/.crew/sandbox.json +0 -7
- package/apps/vibe/.crew/session.json +0 -330
- package/apps/vibe/.crew/training-data.jsonl +0 -0
- package/apps/vibe/.github/workflows/studio-quality.yml +0 -37
- package/apps/vibe/.studio-data/project-messages/chuck-norris.jsonl +0 -18
- package/apps/vibe/.studio-data/project-messages/general.jsonl +0 -81
- package/apps/vibe/.studio-data/project-messages/studio-local.jsonl +0 -18
- package/apps/vibe/ARCHITECTURE.md +0 -3393
- package/apps/vibe/QUICK-REFERENCE.md +0 -211
- package/apps/vibe/ROADMAP.md +0 -41
- package/apps/vibe/STUDIO-SETUP-COMPLETE.md +0 -35
- package/apps/vibe/VISUAL-GUIDE.md +0 -378
- package/apps/vibe/capture-demo.mjs +0 -160
- package/apps/vibe/capture-full-demo.mjs +0 -255
- package/apps/vibe/capture-quickstart.mjs +0 -256
- package/apps/vibe/capture-vibe-assets.mjs +0 -71
- package/apps/vibe/capture-vibe-video.mjs +0 -260
- package/apps/vibe/check-buttons.js +0 -41
- package/apps/vibe/diagnose.html +0 -106
- package/apps/vibe/fix-buttons.js +0 -103
- package/apps/vibe/index.html +0 -3404
- package/apps/vibe/package-lock.json +0 -920
- package/apps/vibe/scripts/studio-pty-host.py +0 -117
- package/apps/vibe/src/main.js +0 -2940
- package/apps/vibe/src/register-all-languages.js +0 -98
- package/apps/vibe/start-studio.sh +0 -11
- package/apps/vibe/test/accessibility-tests.js +0 -77
- package/apps/vibe/test/browser-performance-audit.mjs +0 -205
- package/apps/vibe/test/performance-tests.js +0 -120
- package/apps/vibe/test/security-tests.js +0 -213
- package/apps/vibe/tests/e2e.local.mjs +0 -54
- package/apps/vibe/tests/server.smoke.mjs +0 -106
- package/apps/vibe/update_website.mjs +0 -74
- package/apps/vibe/vite.config.js +0 -19
- package/lib/crew-lead/chat-handler.mjs.bak +0 -1274
- package/lib/engines/rt-envelope.mjs.backup-current +0 -870
|
Binary file
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified Project Messages UI
|
|
3
|
-
* Adds unified view, search, and export functionality to chat tab
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { getJSON, postJSON } from '../core/api.js';
|
|
7
|
-
import { state } from '../core/state.js';
|
|
8
|
-
import { showNotification as notify } from '../core/dom.js';
|
|
9
|
-
|
|
10
|
-
let unifiedViewEnabled = false;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Toggle unified view (shows all sources with indicators)
|
|
14
|
-
*/
|
|
15
|
-
export async function toggleUnifiedView() {
|
|
16
|
-
unifiedViewEnabled = !unifiedViewEnabled;
|
|
17
|
-
|
|
18
|
-
const btn = document.getElementById('unifiedViewToggle');
|
|
19
|
-
if (unifiedViewEnabled) {
|
|
20
|
-
btn.style.background = 'var(--accent)';
|
|
21
|
-
btn.style.color = '#fff';
|
|
22
|
-
btn.textContent = '📊 Unified ✓';
|
|
23
|
-
notify('Unified view enabled — showing all sources');
|
|
24
|
-
} else {
|
|
25
|
-
btn.style.background = '';
|
|
26
|
-
btn.style.color = '';
|
|
27
|
-
btn.textContent = '📊 Unified View';
|
|
28
|
-
notify('Standard view restored');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Reload chat history with unified view
|
|
32
|
-
await loadChatHistoryWithUnified();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Load chat history with unified view (if enabled)
|
|
37
|
-
*/
|
|
38
|
-
async function loadChatHistoryWithUnified() {
|
|
39
|
-
const projectId = state.chatActiveProjectId;
|
|
40
|
-
if (!projectId || projectId === 'general') {
|
|
41
|
-
// Fall back to standard history for general chat
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!unifiedViewEnabled) {
|
|
46
|
-
// Standard view — just reload normally
|
|
47
|
-
if (window.loadChatHistory) {
|
|
48
|
-
await window.loadChatHistory();
|
|
49
|
-
}
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const data = await getJSON(`/api/crew-lead/project-messages?projectId=${encodeURIComponent(projectId)}&limit=100`);
|
|
55
|
-
|
|
56
|
-
if (!data.ok) {
|
|
57
|
-
console.error('Failed to load unified messages:', data.error);
|
|
58
|
-
notify('Failed to load unified view', true);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Clear and rebuild chat
|
|
63
|
-
const box = document.getElementById('chatMessages');
|
|
64
|
-
if (!box) return;
|
|
65
|
-
|
|
66
|
-
box.innerHTML = '';
|
|
67
|
-
|
|
68
|
-
// Source indicators
|
|
69
|
-
const sourceEmoji = {
|
|
70
|
-
dashboard: '💻',
|
|
71
|
-
cli: '⚡',
|
|
72
|
-
'sub-agent': '👷',
|
|
73
|
-
agent: '🤖'
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
// Render messages
|
|
77
|
-
for (const msg of data.messages) {
|
|
78
|
-
const bubble = document.createElement('div');
|
|
79
|
-
bubble.className = `chat-bubble ${msg.role}`;
|
|
80
|
-
|
|
81
|
-
const emoji = sourceEmoji[msg.source] || '📝';
|
|
82
|
-
const agentLabel = msg.agent ? ` [${msg.agent}]` : '';
|
|
83
|
-
const timestamp = new Date(msg.ts).toLocaleTimeString();
|
|
84
|
-
|
|
85
|
-
bubble.innerHTML = `
|
|
86
|
-
<div style="font-size:10px;color:var(--text-3);margin-bottom:4px;">
|
|
87
|
-
${emoji} <strong>${msg.source}</strong>${agentLabel} · ${timestamp}
|
|
88
|
-
</div>
|
|
89
|
-
<div style="white-space:pre-wrap;word-break:break-word;">${escapeHtml(msg.content)}</div>
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
|
-
box.appendChild(bubble);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Scroll to bottom
|
|
96
|
-
box.scrollTop = box.scrollHeight;
|
|
97
|
-
|
|
98
|
-
notify(`Loaded ${data.messages.length} messages from all sources`);
|
|
99
|
-
} catch (e) {
|
|
100
|
-
console.error('Failed to load unified messages:', e);
|
|
101
|
-
notify('Failed to load unified view', true);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Open search modal
|
|
107
|
-
*/
|
|
108
|
-
export function openSearchModal() {
|
|
109
|
-
const projectId = state.chatActiveProjectId;
|
|
110
|
-
if (!projectId || projectId === 'general') {
|
|
111
|
-
notify('Search requires an active project', true);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const modal = document.getElementById('searchModal');
|
|
116
|
-
if (modal) {
|
|
117
|
-
modal.style.display = 'flex';
|
|
118
|
-
document.getElementById('searchInput')?.focus();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Close search modal
|
|
124
|
-
*/
|
|
125
|
-
export function closeSearchModal() {
|
|
126
|
-
const modal = document.getElementById('searchModal');
|
|
127
|
-
if (modal) {
|
|
128
|
-
modal.style.display = 'none';
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Perform search
|
|
134
|
-
*/
|
|
135
|
-
export async function performSearch() {
|
|
136
|
-
const projectId = state.chatActiveProjectId;
|
|
137
|
-
if (!projectId || projectId === 'general') {
|
|
138
|
-
notify('Search requires an active project', true);
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
const query = document.getElementById('searchInput')?.value?.trim();
|
|
143
|
-
if (!query) {
|
|
144
|
-
notify('Enter a search query', true);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const caseSensitive = document.getElementById('searchCaseSensitive')?.checked || false;
|
|
149
|
-
const source = document.getElementById('searchSource')?.value || '';
|
|
150
|
-
|
|
151
|
-
const resultsDiv = document.getElementById('searchResults');
|
|
152
|
-
if (!resultsDiv) return;
|
|
153
|
-
|
|
154
|
-
resultsDiv.innerHTML = '<div style="text-align:center;padding:20px;">Searching...</div>';
|
|
155
|
-
|
|
156
|
-
try {
|
|
157
|
-
let url = `/api/crew-lead/search-project-messages?projectId=${encodeURIComponent(projectId)}&q=${encodeURIComponent(query)}`;
|
|
158
|
-
if (caseSensitive) url += '&caseSensitive=true';
|
|
159
|
-
if (source) url += `&source=${encodeURIComponent(source)}`;
|
|
160
|
-
|
|
161
|
-
const data = await getJSON(url);
|
|
162
|
-
|
|
163
|
-
if (!data.ok) {
|
|
164
|
-
resultsDiv.innerHTML = `<div style="color:var(--red);padding:20px;">Error: ${escapeHtml(data.error)}</div>`;
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (data.results.length === 0) {
|
|
169
|
-
resultsDiv.innerHTML = '<div style="text-align:center;color:var(--text-3);padding:20px;">No results found</div>';
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// Render results
|
|
174
|
-
const sourceEmoji = {
|
|
175
|
-
dashboard: '💻',
|
|
176
|
-
cli: '⚡',
|
|
177
|
-
'sub-agent': '👷',
|
|
178
|
-
agent: '🤖'
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
let html = `<div style="margin-bottom:12px;font-weight:600;color:var(--text-2);">${data.results.length} results</div>`;
|
|
182
|
-
|
|
183
|
-
for (const result of data.results) {
|
|
184
|
-
const emoji = sourceEmoji[result.source] || '📝';
|
|
185
|
-
const agentLabel = result.agent ? ` [${result.agent}]` : '';
|
|
186
|
-
const timestamp = new Date(result.ts).toLocaleString();
|
|
187
|
-
|
|
188
|
-
html += `
|
|
189
|
-
<div style="border:1px solid var(--border);border-radius:6px;padding:12px;margin-bottom:8px;background:var(--bg-card2);">
|
|
190
|
-
<div style="font-size:11px;color:var(--text-3);margin-bottom:6px;">
|
|
191
|
-
${emoji} <strong>${result.source}</strong>${agentLabel} · ${timestamp}
|
|
192
|
-
</div>
|
|
193
|
-
<div style="font-size:13px;color:var(--text-1);">
|
|
194
|
-
${escapeHtml(result.snippet)}
|
|
195
|
-
</div>
|
|
196
|
-
</div>
|
|
197
|
-
`;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
resultsDiv.innerHTML = html;
|
|
201
|
-
notify(`Found ${data.results.length} results`);
|
|
202
|
-
} catch (e) {
|
|
203
|
-
console.error('Search failed:', e);
|
|
204
|
-
resultsDiv.innerHTML = `<div style="color:var(--red);padding:20px;">Search failed: ${escapeHtml(e.message)}</div>`;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Export messages
|
|
210
|
-
*/
|
|
211
|
-
export async function exportMessages() {
|
|
212
|
-
const projectId = state.chatActiveProjectId;
|
|
213
|
-
if (!projectId || projectId === 'general') {
|
|
214
|
-
notify('Export requires an active project', true);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Ask user for format
|
|
219
|
-
const format = await new Promise(resolve => {
|
|
220
|
-
const modal = document.createElement('div');
|
|
221
|
-
modal.style.cssText = 'position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7);z-index:10001;display:flex;align-items:center;justify-content:center;';
|
|
222
|
-
|
|
223
|
-
modal.innerHTML = `
|
|
224
|
-
<div style="background:var(--bg-card);border-radius:12px;padding:24px;max-width:400px;">
|
|
225
|
-
<h3 style="margin:0 0 16px 0;">Export Format</h3>
|
|
226
|
-
<div style="display:flex;flex-direction:column;gap:8px;margin-bottom:16px;">
|
|
227
|
-
<button class="export-format-btn btn-ghost" data-format="markdown" style="text-align:left;padding:12px;">
|
|
228
|
-
📝 Markdown (.md) — Best for reading
|
|
229
|
-
</button>
|
|
230
|
-
<button class="export-format-btn btn-ghost" data-format="json" style="text-align:left;padding:12px;">
|
|
231
|
-
📋 JSON — Full data with metadata
|
|
232
|
-
</button>
|
|
233
|
-
<button class="export-format-btn btn-ghost" data-format="csv" style="text-align:left;padding:12px;">
|
|
234
|
-
📊 CSV — Spreadsheet compatible
|
|
235
|
-
</button>
|
|
236
|
-
<button class="export-format-btn btn-ghost" data-format="txt" style="text-align:left;padding:12px;">
|
|
237
|
-
📄 Plain Text (.txt)
|
|
238
|
-
</button>
|
|
239
|
-
</div>
|
|
240
|
-
<button onclick="this.closest('div').parentElement.remove()" class="btn-ghost" style="width:100%;">Cancel</button>
|
|
241
|
-
</div>
|
|
242
|
-
`;
|
|
243
|
-
|
|
244
|
-
document.body.appendChild(modal);
|
|
245
|
-
|
|
246
|
-
modal.querySelectorAll('.export-format-btn').forEach(btn => {
|
|
247
|
-
btn.onclick = () => {
|
|
248
|
-
resolve(btn.dataset.format);
|
|
249
|
-
modal.remove();
|
|
250
|
-
};
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
modal.onclick = (e) => {
|
|
254
|
-
if (e.target === modal) {
|
|
255
|
-
resolve(null);
|
|
256
|
-
modal.remove();
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
if (!format) return;
|
|
262
|
-
|
|
263
|
-
try {
|
|
264
|
-
notify('Exporting...');
|
|
265
|
-
|
|
266
|
-
const url = `/api/crew-lead/export-project-messages?projectId=${encodeURIComponent(projectId)}&format=${format}&includeMetadata=true`;
|
|
267
|
-
|
|
268
|
-
// Download file
|
|
269
|
-
const a = document.createElement('a');
|
|
270
|
-
a.href = url;
|
|
271
|
-
a.download = `project-${projectId}.${format === 'markdown' ? 'md' : format}`;
|
|
272
|
-
document.body.appendChild(a);
|
|
273
|
-
a.click();
|
|
274
|
-
document.body.removeChild(a);
|
|
275
|
-
|
|
276
|
-
notify(`Exported as ${format.toUpperCase()}`);
|
|
277
|
-
} catch (e) {
|
|
278
|
-
console.error('Export failed:', e);
|
|
279
|
-
notify('Export failed: ' + e.message, true);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Escape HTML
|
|
285
|
-
*/
|
|
286
|
-
function escapeHtml(text) {
|
|
287
|
-
const div = document.createElement('div');
|
|
288
|
-
div.textContent = text;
|
|
289
|
-
return div.innerHTML;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// Expose functions globally
|
|
293
|
-
if (typeof window !== 'undefined') {
|
|
294
|
-
window.toggleUnifiedView = toggleUnifiedView;
|
|
295
|
-
window.openSearchModal = openSearchModal;
|
|
296
|
-
window.closeSearchModal = closeSearchModal;
|
|
297
|
-
window.performSearch = performSearch;
|
|
298
|
-
window.exportMessages = exportMessages;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// Add keyboard shortcuts
|
|
302
|
-
if (typeof window !== 'undefined') {
|
|
303
|
-
document.addEventListener('keydown', (e) => {
|
|
304
|
-
// Cmd/Ctrl + K to open search
|
|
305
|
-
if ((e.metaKey || e.ctrlKey) && e.key === 'k') {
|
|
306
|
-
const projectId = state.chatActiveProjectId;
|
|
307
|
-
if (projectId && projectId !== 'general') {
|
|
308
|
-
e.preventDefault();
|
|
309
|
-
openSearchModal();
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// Escape to close search modal
|
|
314
|
-
if (e.key === 'Escape') {
|
|
315
|
-
const modal = document.getElementById('searchModal');
|
|
316
|
-
if (modal && modal.style.display !== 'none') {
|
|
317
|
-
closeSearchModal();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// Enter in search input to perform search
|
|
322
|
-
if (e.key === 'Enter' && e.target.id === 'searchInput') {
|
|
323
|
-
e.preventDefault();
|
|
324
|
-
performSearch();
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
}
|
|
Binary file
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI Process View - Orchestration status + model configuration
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { updateOrchestrationStatus, startOrchestrationStatusUpdates, stopOrchestrationStatusUpdates } from './orchestration-status.js';
|
|
6
|
-
|
|
7
|
-
let cliProcessMode = 'connected';
|
|
8
|
-
|
|
9
|
-
window.initCLIProcess = async function() {
|
|
10
|
-
await loadCLIProcessConfig();
|
|
11
|
-
startOrchestrationStatusUpdates();
|
|
12
|
-
setupCLIProcessListeners();
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function setupCLIProcessListeners() {
|
|
16
|
-
document.querySelector('[data-action="toggleCLIProcessMode"]')?.addEventListener('click', toggleCLIProcessMode);
|
|
17
|
-
document.querySelector('[data-action="saveCLIProcessConfig"]')?.addEventListener('click', saveCLIProcessConfig);
|
|
18
|
-
document.querySelector('[data-action="applyRecommendedCLIProcessConfig"]')?.addEventListener('click', applyRecommendedCLIProcessConfig);
|
|
19
|
-
document.querySelector('[data-action="resetCLIProcessConfig"]')?.addEventListener('click', resetCLIProcessConfig);
|
|
20
|
-
bindCustomModelSelectors();
|
|
21
|
-
document.querySelector('[data-action="refreshCLIProcess"]')?.addEventListener('click', async () => {
|
|
22
|
-
await updateOrchestrationStatus();
|
|
23
|
-
await loadCLIProcessConfig();
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function bindCustomModelSelectors() {
|
|
28
|
-
[
|
|
29
|
-
'configChatModel',
|
|
30
|
-
'configRouterModel',
|
|
31
|
-
'configReasoningModel',
|
|
32
|
-
'configL2AModel',
|
|
33
|
-
'configL2BModel',
|
|
34
|
-
'configExecutionModel',
|
|
35
|
-
'configQAModel'
|
|
36
|
-
].forEach((id) => {
|
|
37
|
-
const el = document.getElementById(id);
|
|
38
|
-
if (!el || el.dataset.customBound === '1') return;
|
|
39
|
-
el.dataset.customBound = '1';
|
|
40
|
-
el.addEventListener('change', () => handleCustomModelSelection(el));
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function handleCustomModelSelection(selectEl) {
|
|
45
|
-
if (!selectEl || selectEl.value !== '__custom__') return;
|
|
46
|
-
const previous = selectEl.dataset.previousValue || '';
|
|
47
|
-
const raw = window.prompt('Enter exact model ID for this slot:', previous);
|
|
48
|
-
const custom = String(raw || '').trim();
|
|
49
|
-
if (!custom) {
|
|
50
|
-
selectEl.value = previous;
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
let option = Array.from(selectEl.options).find((opt) => opt.value === custom);
|
|
54
|
-
if (!option) {
|
|
55
|
-
option = document.createElement('option');
|
|
56
|
-
option.value = custom;
|
|
57
|
-
option.textContent = `${custom} (custom)`;
|
|
58
|
-
const customMarker = Array.from(selectEl.options).find((opt) => opt.value === '__custom__');
|
|
59
|
-
if (customMarker) {
|
|
60
|
-
selectEl.insertBefore(option, customMarker);
|
|
61
|
-
} else {
|
|
62
|
-
selectEl.appendChild(option);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
selectEl.value = custom;
|
|
66
|
-
selectEl.dataset.previousValue = custom;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function toggleCLIProcessMode() {
|
|
70
|
-
cliProcessMode = cliProcessMode === 'connected' ? 'standalone' : 'connected';
|
|
71
|
-
const btn = document.getElementById('cliProcessMode');
|
|
72
|
-
if (btn) {
|
|
73
|
-
btn.textContent = cliProcessMode === 'connected' ? '🔌 Connected Mode' : '🔌 Standalone Mode';
|
|
74
|
-
btn.style.color = cliProcessMode === 'connected' ? '#10b981' : '#6b7280';
|
|
75
|
-
}
|
|
76
|
-
cliProcessMode === 'connected' ? startOrchestrationStatusUpdates() : stopOrchestrationStatusUpdates();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async function loadCLIProcessConfig() {
|
|
80
|
-
try {
|
|
81
|
-
const res = await fetch('/api/settings/cli-models');
|
|
82
|
-
if (res.ok) {
|
|
83
|
-
const config = await res.json();
|
|
84
|
-
const set = (id, v) => {
|
|
85
|
-
const el = document.getElementById(id);
|
|
86
|
-
if (!el) return;
|
|
87
|
-
const value = v || '';
|
|
88
|
-
if (value && !Array.from(el.options).some((opt) => opt.value === value)) {
|
|
89
|
-
const option = document.createElement('option');
|
|
90
|
-
option.value = value;
|
|
91
|
-
option.textContent = `${value} (saved custom)`;
|
|
92
|
-
const customMarker = Array.from(el.options).find((opt) => opt.value === '__custom__');
|
|
93
|
-
if (customMarker) {
|
|
94
|
-
el.insertBefore(option, customMarker);
|
|
95
|
-
} else {
|
|
96
|
-
el.appendChild(option);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
el.value = value;
|
|
100
|
-
el.dataset.previousValue = value;
|
|
101
|
-
};
|
|
102
|
-
set('configChatModel', config.CREW_CHAT_MODEL);
|
|
103
|
-
set('configRouterModel', config.CREW_ROUTER_MODEL);
|
|
104
|
-
set('configReasoningModel', config.CREW_REASONING_MODEL);
|
|
105
|
-
set('configL2AModel', config.CREW_L2A_MODEL);
|
|
106
|
-
set('configL2BModel', config.CREW_L2B_MODEL);
|
|
107
|
-
set('configExecutionModel', config.CREW_EXECUTION_MODEL);
|
|
108
|
-
set('configQAModel', config.CREW_QA_MODEL);
|
|
109
|
-
set('configMaxWorkers', config.CREW_MAX_PARALLEL_WORKERS || '6');
|
|
110
|
-
set('configExtraValidators', config.CREW_L2_EXTRA_VALIDATORS);
|
|
111
|
-
}
|
|
112
|
-
} catch (err) {
|
|
113
|
-
console.error('[CLI Process] Failed to load config:', err);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function getCLIProcessConfigFromForm() {
|
|
118
|
-
const get = (id) => document.getElementById(id)?.value || '';
|
|
119
|
-
return {
|
|
120
|
-
CREW_CHAT_MODEL: get('configChatModel'),
|
|
121
|
-
CREW_ROUTER_MODEL: get('configRouterModel'),
|
|
122
|
-
CREW_REASONING_MODEL: get('configReasoningModel'),
|
|
123
|
-
CREW_L2A_MODEL: get('configL2AModel'),
|
|
124
|
-
CREW_L2B_MODEL: get('configL2BModel'),
|
|
125
|
-
CREW_EXECUTION_MODEL: get('configExecutionModel'),
|
|
126
|
-
CREW_QA_MODEL: get('configQAModel'),
|
|
127
|
-
CREW_MAX_PARALLEL_WORKERS: get('configMaxWorkers') || '6',
|
|
128
|
-
CREW_L2_EXTRA_VALIDATORS: get('configExtraValidators')
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
async function saveCLIProcessConfig() {
|
|
133
|
-
const config = getCLIProcessConfigFromForm();
|
|
134
|
-
try {
|
|
135
|
-
const res = await fetch('/api/settings/cli-models', {
|
|
136
|
-
method: 'POST',
|
|
137
|
-
headers: { 'Content-Type': 'application/json' },
|
|
138
|
-
body: JSON.stringify(config)
|
|
139
|
-
});
|
|
140
|
-
if (!res.ok) {
|
|
141
|
-
const err = await res.json().catch(() => ({}));
|
|
142
|
-
throw new Error(err.error || res.statusText);
|
|
143
|
-
}
|
|
144
|
-
alert('✅ CLI configuration saved to crewswarm.json. Restart crew (Services → Start All) for changes to take effect.');
|
|
145
|
-
} catch (err) {
|
|
146
|
-
alert('❌ Save failed: ' + err.message);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
async function applyRecommendedCLIProcessConfig() {
|
|
151
|
-
const config = {
|
|
152
|
-
CREW_CHAT_MODEL: 'grok-4-1-fast-non-reasoning',
|
|
153
|
-
CREW_ROUTER_MODEL: 'gpt-5.4',
|
|
154
|
-
CREW_REASONING_MODEL: 'gpt-5.4',
|
|
155
|
-
CREW_L2A_MODEL: 'gpt-5.4',
|
|
156
|
-
CREW_L2B_MODEL: 'gpt-5.4',
|
|
157
|
-
CREW_EXECUTION_MODEL: 'gemini-2.5-flash',
|
|
158
|
-
CREW_QA_MODEL: 'gpt-5.4',
|
|
159
|
-
CREW_MAX_PARALLEL_WORKERS: '6',
|
|
160
|
-
CREW_L2_EXTRA_VALIDATORS: ''
|
|
161
|
-
};
|
|
162
|
-
document.getElementById('configChatModel').value = config.CREW_CHAT_MODEL;
|
|
163
|
-
document.getElementById('configRouterModel').value = config.CREW_ROUTER_MODEL;
|
|
164
|
-
document.getElementById('configReasoningModel').value = config.CREW_REASONING_MODEL;
|
|
165
|
-
document.getElementById('configL2AModel').value = config.CREW_L2A_MODEL;
|
|
166
|
-
document.getElementById('configL2BModel').value = config.CREW_L2B_MODEL;
|
|
167
|
-
document.getElementById('configExecutionModel').value = config.CREW_EXECUTION_MODEL;
|
|
168
|
-
document.getElementById('configQAModel').value = config.CREW_QA_MODEL;
|
|
169
|
-
document.getElementById('configMaxWorkers').value = config.CREW_MAX_PARALLEL_WORKERS;
|
|
170
|
-
document.getElementById('configExtraValidators').value = config.CREW_L2_EXTRA_VALIDATORS;
|
|
171
|
-
bindCustomModelSelectors();
|
|
172
|
-
try {
|
|
173
|
-
const res = await fetch('/api/settings/cli-models', {
|
|
174
|
-
method: 'POST',
|
|
175
|
-
headers: { 'Content-Type': 'application/json' },
|
|
176
|
-
body: JSON.stringify(config)
|
|
177
|
-
});
|
|
178
|
-
if (res.ok) {
|
|
179
|
-
alert('✅ Recommended stack applied. Restart crew for changes to take effect.');
|
|
180
|
-
}
|
|
181
|
-
} catch (err) {
|
|
182
|
-
console.error('[CLI Process] Apply recommended failed:', err);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
async function resetCLIProcessConfig() {
|
|
187
|
-
['configChatModel','configRouterModel','configReasoningModel','configL2AModel','configL2BModel','configExecutionModel','configQAModel','configExtraValidators'].forEach(id => {
|
|
188
|
-
const el = document.getElementById(id);
|
|
189
|
-
if (el) el.value = '';
|
|
190
|
-
});
|
|
191
|
-
document.getElementById('configMaxWorkers').value = '6';
|
|
192
|
-
try {
|
|
193
|
-
const config = {
|
|
194
|
-
CREW_CHAT_MODEL: '', CREW_ROUTER_MODEL: '', CREW_REASONING_MODEL: '', CREW_L2A_MODEL: '', CREW_L2B_MODEL: '',
|
|
195
|
-
CREW_EXECUTION_MODEL: '', CREW_QA_MODEL: '', CREW_MAX_PARALLEL_WORKERS: '6', CREW_L2_EXTRA_VALIDATORS: ''
|
|
196
|
-
};
|
|
197
|
-
await fetch('/api/settings/cli-models', {
|
|
198
|
-
method: 'POST',
|
|
199
|
-
headers: { 'Content-Type': 'application/json' },
|
|
200
|
-
body: JSON.stringify(config)
|
|
201
|
-
});
|
|
202
|
-
} catch (err) {
|
|
203
|
-
console.error('[CLI Process] Reset save failed:', err);
|
|
204
|
-
}
|
|
205
|
-
alert('↻ Configuration reset');
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export { cliProcessMode };
|
|
Binary file
|
|
Binary file
|