groove-dev 0.27.144 → 0.27.145
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/node_modules/@groove-dev/cli/package.json +1 -1
- package/node_modules/@groove-dev/daemon/package.json +1 -1
- package/node_modules/@groove-dev/daemon/src/conversations.js +18 -48
- package/node_modules/@groove-dev/daemon/src/routes/agents.js +6 -83
- package/node_modules/@groove-dev/gui/dist/assets/{index-BcoF6_eF.js → index-Bxc0gU06.js} +232 -238
- package/node_modules/@groove-dev/gui/dist/assets/index-C0pztKBn.css +1 -0
- package/node_modules/@groove-dev/gui/dist/index.html +2 -2
- package/node_modules/@groove-dev/gui/package.json +1 -1
- package/node_modules/@groove-dev/gui/src/components/agents/agent-feed.jsx +80 -95
- package/node_modules/@groove-dev/gui/src/components/agents/agent-panel.jsx +2 -70
- package/node_modules/@groove-dev/gui/src/components/chat/chat-header.jsx +2 -0
- package/node_modules/@groove-dev/gui/src/components/chat/chat-input.jsx +68 -66
- package/node_modules/@groove-dev/gui/src/components/chat/chat-view.jsx +4 -8
- package/node_modules/@groove-dev/gui/src/components/lab/chat-playground.jsx +39 -31
- package/node_modules/@groove-dev/gui/src/components/lab/parameter-panel.jsx +66 -65
- package/node_modules/@groove-dev/gui/src/components/lab/preset-manager.jsx +17 -14
- package/node_modules/@groove-dev/gui/src/components/lab/runtime-config.jsx +126 -127
- package/node_modules/@groove-dev/gui/src/components/lab/system-prompt-editor.jsx +10 -8
- package/node_modules/@groove-dev/gui/src/components/ui/slider.jsx +8 -8
- package/node_modules/@groove-dev/gui/src/lib/status.js +1 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +17 -0
- package/node_modules/@groove-dev/gui/src/stores/slices/agents-slice.js +8 -1
- package/node_modules/@groove-dev/gui/src/stores/slices/chat-slice.js +13 -14
- package/node_modules/@groove-dev/gui/src/views/model-lab.jsx +41 -10
- package/node_modules/@groove-dev/gui/src/views/models.jsx +57 -36
- package/node_modules/axios/CHANGELOG.md +260 -0
- package/node_modules/axios/README.md +595 -223
- package/node_modules/axios/dist/axios.js +1460 -1090
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +1560 -1132
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +1557 -1128
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +1594 -1057
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +40 -41
- package/node_modules/axios/index.d.ts +151 -227
- package/node_modules/axios/index.js +2 -0
- package/node_modules/axios/lib/adapters/adapters.js +4 -2
- package/node_modules/axios/lib/adapters/fetch.js +147 -16
- package/node_modules/axios/lib/adapters/http.js +306 -58
- package/node_modules/axios/lib/adapters/xhr.js +6 -2
- package/node_modules/axios/lib/core/Axios.js +7 -3
- package/node_modules/axios/lib/core/AxiosError.js +120 -34
- package/node_modules/axios/lib/core/AxiosHeaders.js +27 -25
- package/node_modules/axios/lib/core/buildFullPath.js +1 -1
- package/node_modules/axios/lib/core/dispatchRequest.js +19 -7
- package/node_modules/axios/lib/core/mergeConfig.js +21 -4
- package/node_modules/axios/lib/core/settle.js +7 -11
- package/node_modules/axios/lib/defaults/index.js +14 -9
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -2
- package/node_modules/axios/lib/helpers/buildURL.js +1 -1
- package/node_modules/axios/lib/helpers/cookies.js +14 -2
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +28 -1
- package/node_modules/axios/lib/helpers/formDataToJSON.js +3 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +3 -2
- package/node_modules/axios/lib/helpers/parseProtocol.js +1 -1
- package/node_modules/axios/lib/helpers/progressEventReducer.js +5 -5
- package/node_modules/axios/lib/helpers/resolveConfig.js +54 -18
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +74 -2
- package/node_modules/axios/lib/helpers/toFormData.js +10 -2
- package/node_modules/axios/lib/helpers/validator.js +3 -1
- package/node_modules/axios/lib/utils.js +33 -21
- package/node_modules/axios/package.json +17 -24
- package/node_modules/follow-redirects/README.md +7 -5
- package/node_modules/follow-redirects/index.js +24 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/daemon/package.json +1 -1
- package/packages/daemon/src/conversations.js +18 -48
- package/packages/daemon/src/routes/agents.js +6 -83
- package/packages/gui/dist/assets/{index-BcoF6_eF.js → index-Bxc0gU06.js} +232 -238
- package/packages/gui/dist/assets/index-C0pztKBn.css +1 -0
- package/packages/gui/dist/index.html +2 -2
- package/packages/gui/package.json +1 -1
- package/packages/gui/src/components/agents/agent-feed.jsx +80 -95
- package/packages/gui/src/components/agents/agent-panel.jsx +2 -70
- package/packages/gui/src/components/chat/chat-header.jsx +2 -0
- package/packages/gui/src/components/chat/chat-input.jsx +68 -66
- package/packages/gui/src/components/chat/chat-view.jsx +4 -8
- package/packages/gui/src/components/lab/chat-playground.jsx +39 -31
- package/packages/gui/src/components/lab/parameter-panel.jsx +66 -65
- package/packages/gui/src/components/lab/preset-manager.jsx +17 -14
- package/packages/gui/src/components/lab/runtime-config.jsx +126 -127
- package/packages/gui/src/components/lab/system-prompt-editor.jsx +10 -8
- package/packages/gui/src/components/ui/slider.jsx +8 -8
- package/packages/gui/src/lib/status.js +1 -0
- package/packages/gui/src/stores/groove.js +17 -0
- package/packages/gui/src/stores/slices/agents-slice.js +8 -1
- package/packages/gui/src/stores/slices/chat-slice.js +13 -14
- package/packages/gui/src/views/model-lab.jsx +41 -10
- package/packages/gui/src/views/models.jsx +57 -36
- package/node_modules/@groove-dev/gui/dist/assets/index-Dd7qhiEd.css +0 -1
- package/packages/gui/dist/assets/index-Dd7qhiEd.css +0 -1
|
@@ -89,27 +89,10 @@ export class ConversationManager {
|
|
|
89
89
|
const id = randomUUID().slice(0, 12);
|
|
90
90
|
const now = new Date().toISOString();
|
|
91
91
|
|
|
92
|
-
let agentId = null;
|
|
93
|
-
|
|
94
|
-
if (mode === 'agent') {
|
|
95
|
-
const defaultTeam = this.daemon.teams.getDefault();
|
|
96
|
-
const workingDir = defaultTeam?.workingDir || this.daemon.projectDir;
|
|
97
|
-
|
|
98
|
-
const agent = await this.daemon.processes.spawn({
|
|
99
|
-
role: 'chat',
|
|
100
|
-
provider,
|
|
101
|
-
model: model || null,
|
|
102
|
-
workingDir,
|
|
103
|
-
teamId: defaultTeam?.id || null,
|
|
104
|
-
permission: 'full',
|
|
105
|
-
});
|
|
106
|
-
agentId = agent.id;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
92
|
const conversation = {
|
|
110
93
|
id,
|
|
111
94
|
title: title || 'New Chat',
|
|
112
|
-
agentId,
|
|
95
|
+
agentId: null,
|
|
113
96
|
provider,
|
|
114
97
|
model: model || null,
|
|
115
98
|
mode: mode === 'agent' ? 'agent' : 'api',
|
|
@@ -265,35 +248,7 @@ export class ConversationManager {
|
|
|
265
248
|
this._modeChanging.add(id);
|
|
266
249
|
|
|
267
250
|
try {
|
|
268
|
-
|
|
269
|
-
const existingAgent = conv.agentId ? this.daemon.registry.get(conv.agentId) : null;
|
|
270
|
-
const alive = existingAgent && (existingAgent.status === 'running' || existingAgent.status === 'starting');
|
|
271
|
-
|
|
272
|
-
if (!alive) {
|
|
273
|
-
const defaultTeam = this.daemon.teams.getDefault();
|
|
274
|
-
const workingDir = defaultTeam?.workingDir || this.daemon.projectDir;
|
|
275
|
-
const agent = await this.daemon.processes.spawn({
|
|
276
|
-
role: 'chat',
|
|
277
|
-
provider: conv.provider,
|
|
278
|
-
model: conv.model || null,
|
|
279
|
-
workingDir,
|
|
280
|
-
teamId: defaultTeam?.id || null,
|
|
281
|
-
permission: 'full',
|
|
282
|
-
});
|
|
283
|
-
conv.agentId = agent.id;
|
|
284
|
-
}
|
|
285
|
-
} else {
|
|
286
|
-
// Switching to API mode — kill the agent if running
|
|
287
|
-
this._killStreamingProcess(id);
|
|
288
|
-
if (conv.agentId) {
|
|
289
|
-
const agent = this.daemon.registry.get(conv.agentId);
|
|
290
|
-
if (agent && (agent.status === 'running' || agent.status === 'starting')) {
|
|
291
|
-
try { await this.daemon.processes.kill(conv.agentId); } catch { /* ignore */ }
|
|
292
|
-
}
|
|
293
|
-
if (agent) this.daemon.registry.remove(conv.agentId);
|
|
294
|
-
conv.agentId = null;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
251
|
+
this._killStreamingProcess(id);
|
|
297
252
|
|
|
298
253
|
conv.mode = mode;
|
|
299
254
|
conv.updatedAt = new Date().toISOString();
|
|
@@ -354,7 +309,6 @@ export class ConversationManager {
|
|
|
354
309
|
async sendMessage(id, message, history, { reasoningEffort, verbosity } = {}) {
|
|
355
310
|
const conv = this.conversations.get(id);
|
|
356
311
|
if (!conv) throw new Error('Conversation not found');
|
|
357
|
-
if (conv.mode !== 'api') throw new Error('sendMessage only works in API mode');
|
|
358
312
|
|
|
359
313
|
this._killStreamingProcess(id);
|
|
360
314
|
|
|
@@ -395,6 +349,17 @@ export class ConversationManager {
|
|
|
395
349
|
try { tcAgentId = tc.onChatTurnStart(id, providerName, modelId, message); } catch { /* never block chat */ }
|
|
396
350
|
}
|
|
397
351
|
|
|
352
|
+
// Agent mode prefers headless CLI (has tools + web search), falls back to API
|
|
353
|
+
if (conv.mode === 'agent') {
|
|
354
|
+
const headlessCmd = provider.buildHeadlessCommand(
|
|
355
|
+
this._buildHistoryPrompt(history, message), modelId,
|
|
356
|
+
);
|
|
357
|
+
if (headlessCmd) {
|
|
358
|
+
return this._sendViaHeadlessCLI(id, conv, provider, providerName, modelId, message, history, tcAgentId, tc);
|
|
359
|
+
}
|
|
360
|
+
// Provider has no CLI — fall through to API streaming
|
|
361
|
+
}
|
|
362
|
+
|
|
398
363
|
// Try direct API streaming first (sub-second latency)
|
|
399
364
|
const controller = provider.streamChat(
|
|
400
365
|
messages, modelId, apiKey,
|
|
@@ -448,6 +413,11 @@ export class ConversationManager {
|
|
|
448
413
|
}
|
|
449
414
|
|
|
450
415
|
// Fallback: headless CLI spawn (for providers without streamChat or missing API key)
|
|
416
|
+
return this._sendViaHeadlessCLI(id, conv, provider, providerName, modelId, message, history, tcAgentId, tc);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
_sendViaHeadlessCLI(id, conv, provider, providerName, modelId, message, history, tcAgentId, tc) {
|
|
420
|
+
let tcResponseText = '';
|
|
451
421
|
const prompt = this._buildHistoryPrompt(history, message);
|
|
452
422
|
const headlessCmd = provider.buildHeadlessCommand(prompt, modelId);
|
|
453
423
|
if (!headlessCmd) {
|
|
@@ -285,89 +285,12 @@ export function registerAgentRoutes(app, daemon) {
|
|
|
285
285
|
daemon.conversations.autoTitle(req.params.id, message.trim());
|
|
286
286
|
daemon.conversations.touchUpdatedAt(req.params.id);
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
daemon.audit.log('conversation.message', { id: req.params.id, mode: 'api' });
|
|
295
|
-
return res.json({ status: 'streaming', mode: 'api' });
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Agent mode — existing behavior
|
|
299
|
-
const agent = daemon.registry.get(conv.agentId);
|
|
300
|
-
if (!agent) return res.status(400).json({ error: 'Agent no longer exists' });
|
|
301
|
-
|
|
302
|
-
// Record user feedback for journalist context
|
|
303
|
-
if (daemon.journalist) daemon.journalist.recordUserFeedback(agent, message.trim());
|
|
304
|
-
|
|
305
|
-
// Agent loop path — send message directly to the running loop
|
|
306
|
-
if (daemon.processes.hasAgentLoop(conv.agentId)) {
|
|
307
|
-
const sent = await daemon.processes.sendMessage(conv.agentId, message.trim());
|
|
308
|
-
if (sent) {
|
|
309
|
-
daemon.audit.log('conversation.message', { id: req.params.id, agentId: conv.agentId });
|
|
310
|
-
return res.json({ id: conv.agentId, status: 'message_sent' });
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// One-shot providers: kill and respawn with the message as prompt
|
|
315
|
-
const provider = getProvider(agent.provider);
|
|
316
|
-
if (provider?.constructor?.isOneShot) {
|
|
317
|
-
const oldConfig = { ...agent };
|
|
318
|
-
if (daemon.processes.isRunning(conv.agentId)) {
|
|
319
|
-
await daemon.processes.kill(conv.agentId);
|
|
320
|
-
}
|
|
321
|
-
daemon.registry.remove(conv.agentId);
|
|
322
|
-
daemon.locks.release(conv.agentId);
|
|
323
|
-
|
|
324
|
-
const newAgent = await daemon.processes.spawn({
|
|
325
|
-
role: 'chat',
|
|
326
|
-
scope: oldConfig.scope,
|
|
327
|
-
provider: oldConfig.provider,
|
|
328
|
-
model: oldConfig.model,
|
|
329
|
-
prompt: message.trim(),
|
|
330
|
-
permission: oldConfig.permission || 'full',
|
|
331
|
-
workingDir: oldConfig.workingDir,
|
|
332
|
-
name: oldConfig.name,
|
|
333
|
-
teamId: oldConfig.teamId,
|
|
334
|
-
});
|
|
335
|
-
|
|
336
|
-
// Update conversation to point to new agent
|
|
337
|
-
const convObj = daemon.conversations.conversations.get(req.params.id);
|
|
338
|
-
if (convObj) {
|
|
339
|
-
convObj.agentId = newAgent.id;
|
|
340
|
-
daemon.conversations._save();
|
|
341
|
-
}
|
|
342
|
-
daemon.audit.log('conversation.message', { id: req.params.id, agentId: newAgent.id, oneShot: true });
|
|
343
|
-
return res.json({ id: newAgent.id, status: 'respawned' });
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
// Running CLI agent — queue the message
|
|
347
|
-
if (daemon.processes.isRunning(conv.agentId)) {
|
|
348
|
-
daemon.processes.queueMessage(conv.agentId, message.trim());
|
|
349
|
-
daemon.audit.log('conversation.message', { id: req.params.id, agentId: conv.agentId, queued: true });
|
|
350
|
-
return res.json({ id: conv.agentId, status: 'message_queued' });
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
// CLI agent — session resume or rotation
|
|
354
|
-
const SESSION_RESUME_CEILING = 5_000_000;
|
|
355
|
-
const resumed = !!agent.sessionId && (agent.tokensUsed || 0) < SESSION_RESUME_CEILING;
|
|
356
|
-
const newAgent = resumed
|
|
357
|
-
? await daemon.processes.resume(conv.agentId, message.trim())
|
|
358
|
-
: await daemon.rotator.rotate(conv.agentId, { additionalPrompt: message.trim() });
|
|
359
|
-
|
|
360
|
-
// Update conversation to point to new agent if rotated
|
|
361
|
-
if (newAgent.id !== conv.agentId) {
|
|
362
|
-
const convObj = daemon.conversations.conversations.get(req.params.id);
|
|
363
|
-
if (convObj) {
|
|
364
|
-
convObj.agentId = newAgent.id;
|
|
365
|
-
daemon.conversations._save();
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
daemon.audit.log('conversation.message', { id: req.params.id, agentId: newAgent.id, resumed });
|
|
370
|
-
res.json({ id: newAgent.id, status: resumed ? 'resumed' : 'rotated' });
|
|
288
|
+
await daemon.conversations.sendMessage(req.params.id, message.trim(), history || [], {
|
|
289
|
+
reasoningEffort: validatedEffort,
|
|
290
|
+
verbosity: validatedVerbosity,
|
|
291
|
+
});
|
|
292
|
+
daemon.audit.log('conversation.message', { id: req.params.id, mode: conv.mode || 'api' });
|
|
293
|
+
res.json({ status: 'streaming', mode: conv.mode || 'api' });
|
|
371
294
|
} catch (err) {
|
|
372
295
|
res.status(400).json({ error: err.message });
|
|
373
296
|
}
|