@llmnative/agentico 0.10.1 → 0.10.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/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +353 -348
- package/dist/index.mjs.map +1 -1
- package/dist/types/domain/entityChatStore.d.ts +4 -0
- package/dist/types/presentation/useAgent.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -279,146 +279,8 @@ function be() {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region src/
|
|
283
|
-
var xe =
|
|
284
|
-
function Se(e) {
|
|
285
|
-
xe = e.storageKey;
|
|
286
|
-
}
|
|
287
|
-
function Ce(e) {
|
|
288
|
-
if (!e || typeof e != "object") return null;
|
|
289
|
-
let t = e;
|
|
290
|
-
if (typeof t.entityId != "string") return null;
|
|
291
|
-
let n = t.scopeId ?? t.tenantId;
|
|
292
|
-
if (typeof n != "string") return null;
|
|
293
|
-
let { tenantId: r, ...i } = t;
|
|
294
|
-
return {
|
|
295
|
-
...i,
|
|
296
|
-
scopeId: n
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
function we() {
|
|
300
|
-
try {
|
|
301
|
-
let e = localStorage.getItem(xe);
|
|
302
|
-
if (!e) return [];
|
|
303
|
-
let t = JSON.parse(e);
|
|
304
|
-
return Array.isArray(t) ? t.map(Ce).filter((e) => e !== null) : [];
|
|
305
|
-
} catch {
|
|
306
|
-
return [];
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
var Te = /* @__PURE__ */ new Set();
|
|
310
|
-
function Ee(e) {
|
|
311
|
-
return Te.add(e), () => {
|
|
312
|
-
Te.delete(e);
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
function De(e) {
|
|
316
|
-
try {
|
|
317
|
-
localStorage.setItem(xe, JSON.stringify(e));
|
|
318
|
-
} catch {}
|
|
319
|
-
for (let e of [...Te]) e();
|
|
320
|
-
}
|
|
321
|
-
var Oe = (e, t, n) => `${e}:${t}:${n}`;
|
|
322
|
-
function ke(e, t, n) {
|
|
323
|
-
let r = Oe(e, t, n);
|
|
324
|
-
return we().find((e) => Oe(e.scopeId, e.subagentId, e.entityId) === r) ?? null;
|
|
325
|
-
}
|
|
326
|
-
function Ae(e) {
|
|
327
|
-
let t = Oe(e.scopeId, e.subagentId, e.entityId), n = we(), r = n.find((e) => Oe(e.scopeId, e.subagentId, e.entityId) === t), i = Date.now(), a = n.filter((e) => e !== r);
|
|
328
|
-
a.push({
|
|
329
|
-
...e,
|
|
330
|
-
savedAt: i,
|
|
331
|
-
startedAt: r ? Fe(r) : i,
|
|
332
|
-
...r?.name ? {
|
|
333
|
-
name: r.name,
|
|
334
|
-
namedBy: r.namedBy
|
|
335
|
-
} : {}
|
|
336
|
-
}), De(a);
|
|
337
|
-
}
|
|
338
|
-
var je = (e) => {
|
|
339
|
-
let t = (e.activity.find((e) => e.kind === "user" && e.detail?.trim())?.detail ?? "").trim().split("\n")[0].trim();
|
|
340
|
-
return t.length > 80 ? `${t.slice(0, 80).trimEnd()}…` : t;
|
|
341
|
-
}, Me = (e) => e.name || je(e) || e.title || e.entityId, Ne = (e) => e.activity.some((e) => e.kind === "user" && !!e.detail?.trim());
|
|
342
|
-
function Pe(e, t, n, r, i = "person") {
|
|
343
|
-
let a = Oe(e, t, n), o = we(), s = o.find((e) => Oe(e.scopeId, e.subagentId, e.entityId) === a);
|
|
344
|
-
if (!s || i === "model" && s.namedBy === "person") return !1;
|
|
345
|
-
let c = r.trim().replace(/\s+/g, " ").slice(0, 120), { name: l, namedBy: u, ...d } = s, f = c ? {
|
|
346
|
-
...d,
|
|
347
|
-
name: c,
|
|
348
|
-
namedBy: i
|
|
349
|
-
} : d;
|
|
350
|
-
return De(o.map((e) => e === s ? f : e)), !0;
|
|
351
|
-
}
|
|
352
|
-
var Fe = (e) => e.startedAt ?? e.savedAt;
|
|
353
|
-
function Ie(e, t, n) {
|
|
354
|
-
let r = Oe(e, t, n);
|
|
355
|
-
De(we().filter((e) => Oe(e.scopeId, e.subagentId, e.entityId) !== r));
|
|
356
|
-
}
|
|
357
|
-
function Le(e) {
|
|
358
|
-
return we().filter((t) => t.scopeId === e).sort((e, t) => Fe(t) - Fe(e));
|
|
359
|
-
}
|
|
360
|
-
var Re = (e, t) => `entitychat-${e}-${t}`, ze = {
|
|
361
|
-
modelLabel: "Modell",
|
|
362
|
-
modelsLoading: "Wird geladen…",
|
|
363
|
-
noModelsAvailable: "Keine Modelle verfügbar",
|
|
364
|
-
noProviderConnected: "Kein AI-Provider verbunden",
|
|
365
|
-
selectModelPlaceholder: "Modell wählen…",
|
|
366
|
-
orchestratorStarterHint: "Sag Agentico, was du erreichen willst — es wählt das passende Werkzeug und fragt nach den nötigen Angaben.",
|
|
367
|
-
orchestratorStarterPlaceholder: "Beschreibe, was du tun möchtest…",
|
|
368
|
-
destinationPickerTitle: "Ergebnis speichern in…",
|
|
369
|
-
destinationApplying: "Wird gespeichert…",
|
|
370
|
-
destinationNoScope: "Kein Ziel ausgewählt — vor dem Speichern eines auswählen.",
|
|
371
|
-
unknownDestination: "Unbekanntes Ziel: {id}",
|
|
372
|
-
exportJson: "Als JSON exportieren",
|
|
373
|
-
orchestratorUnavailable: "AI nicht verfügbar — öffne das benötigte Werkzeug direkt auf seiner Seite.",
|
|
374
|
-
orchestratorContinueWithoutAi: "Weiter ohne AI.",
|
|
375
|
-
orchestratorPreparing: "{label} wird vorbereitet…",
|
|
376
|
-
orchestratorCollecting: "Parameter für {label} werden gesammelt…",
|
|
377
|
-
thinking: "Denke nach…",
|
|
378
|
-
stopped: "Vom Benutzer abgebrochen.",
|
|
379
|
-
toolRequest: "Werkzeugausführung angefordert",
|
|
380
|
-
modelRequestError: "Fehler bei der Anfrage an das Modell",
|
|
381
|
-
noProviderResponse: "Keine Antwort vom AI-Provider.",
|
|
382
|
-
noActiveSession: "Keine aktive Sitzung — zuerst run() aufrufen.",
|
|
383
|
-
approvalHeader: "Freigabe",
|
|
384
|
-
approve: "Freigeben",
|
|
385
|
-
reject: "Ablehnen",
|
|
386
|
-
approveQuestion: "Freigeben? {action}",
|
|
387
|
-
requestInProgress: "Eine andere Anfrage läuft bereits.",
|
|
388
|
-
invalidResponse: "Ungültige AI-Antwort.",
|
|
389
|
-
responseReceived: "Antwort erhalten",
|
|
390
|
-
noProviderAvailable: "Kein AI-Provider verfügbar.",
|
|
391
|
-
tooManyToolTurns: "Zu viele aufeinanderfolgende Werkzeugaufrufe — das bisher gesammelte deterministische Ergebnis wird verwendet.",
|
|
392
|
-
aiDisabledFallback: "AI deaktiviert — das deterministische Ergebnis wird verwendet.",
|
|
393
|
-
continueWithoutAiFallback: "Weiter ohne AI — das deterministische Ergebnis wird verwendet.",
|
|
394
|
-
oneStep: "1 Schritt",
|
|
395
|
-
steps: "{count} Schritte",
|
|
396
|
-
stepsLabel: "Schritte des Agenten",
|
|
397
|
-
newInstance: "Neue Instanz von \"{label}\"",
|
|
398
|
-
chatHistory: "Chatverlauf",
|
|
399
|
-
renameChat: "Umbenennen",
|
|
400
|
-
chatTitleLabel: "Titel",
|
|
401
|
-
chatTitleHint: "Leer: der aus dem Chat geschriebene Titel.",
|
|
402
|
-
chatStarted: "Begonnen am {at}",
|
|
403
|
-
chatLastMessage: "letzte Nachricht am {at}",
|
|
404
|
-
newChat: "Neuer Chat",
|
|
405
|
-
searchChats: "Chats durchsuchen…",
|
|
406
|
-
messagePlaceholder: "Nachricht schreiben…",
|
|
407
|
-
unsavedConversationConfirm: "Diese Unterhaltung wurde nicht gespeichert und geht verloren. Fortfahren?",
|
|
408
|
-
noSavedChats: "Noch keine gespeicherten Chats.",
|
|
409
|
-
archiveChat: "Archivieren",
|
|
410
|
-
noResults: "Keine Ergebnisse.",
|
|
411
|
-
retry: "Erneut versuchen",
|
|
412
|
-
retryMessage: "Erneut versuchen.",
|
|
413
|
-
continueWithoutAi: "Ohne AI fortfahren",
|
|
414
|
-
resumeWithAi: "Mit AI fortsetzen",
|
|
415
|
-
openPanel: "Agentenbereich öffnen",
|
|
416
|
-
closePanel: "Agentenbereich schließen",
|
|
417
|
-
resizePanel: "Agent-Bereich in der Größe ändern",
|
|
418
|
-
resizePanelHint: "Ziehen zum Ändern der Größe, Doppelklick zum Zurücksetzen",
|
|
419
|
-
pendingQuestions: "Fragen des Agenten",
|
|
420
|
-
stop: "Stoppen"
|
|
421
|
-
}, Be = {
|
|
282
|
+
//#region src/i18n/en.ts
|
|
283
|
+
var xe = {
|
|
422
284
|
modelLabel: "Model",
|
|
423
285
|
modelsLoading: "Loading…",
|
|
424
286
|
noModelsAvailable: "No models available",
|
|
@@ -479,7 +341,7 @@ var Re = (e, t) => `entitychat-${e}-${t}`, ze = {
|
|
|
479
341
|
resizePanelHint: "Drag to resize, double-click to reset",
|
|
480
342
|
pendingQuestions: "Questions of the agent",
|
|
481
343
|
stop: "Stop"
|
|
482
|
-
},
|
|
344
|
+
}, Se = {
|
|
483
345
|
modelLabel: "Modello",
|
|
484
346
|
modelsLoading: "Caricamento…",
|
|
485
347
|
noModelsAvailable: "Nessun modello disponibile",
|
|
@@ -540,22 +402,164 @@ var Re = (e, t) => `entitychat-${e}-${t}`, ze = {
|
|
|
540
402
|
resizePanelHint: "Trascina per ridimensionare, doppio clic per ripristinare",
|
|
541
403
|
pendingQuestions: "Domande dell'agente",
|
|
542
404
|
stop: "Ferma"
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
405
|
+
}, Ce = {
|
|
406
|
+
modelLabel: "Modell",
|
|
407
|
+
modelsLoading: "Wird geladen…",
|
|
408
|
+
noModelsAvailable: "Keine Modelle verfügbar",
|
|
409
|
+
noProviderConnected: "Kein AI-Provider verbunden",
|
|
410
|
+
selectModelPlaceholder: "Modell wählen…",
|
|
411
|
+
orchestratorStarterHint: "Sag Agentico, was du erreichen willst — es wählt das passende Werkzeug und fragt nach den nötigen Angaben.",
|
|
412
|
+
orchestratorStarterPlaceholder: "Beschreibe, was du tun möchtest…",
|
|
413
|
+
destinationPickerTitle: "Ergebnis speichern in…",
|
|
414
|
+
destinationApplying: "Wird gespeichert…",
|
|
415
|
+
destinationNoScope: "Kein Ziel ausgewählt — vor dem Speichern eines auswählen.",
|
|
416
|
+
unknownDestination: "Unbekanntes Ziel: {id}",
|
|
417
|
+
exportJson: "Als JSON exportieren",
|
|
418
|
+
orchestratorUnavailable: "AI nicht verfügbar — öffne das benötigte Werkzeug direkt auf seiner Seite.",
|
|
419
|
+
orchestratorContinueWithoutAi: "Weiter ohne AI.",
|
|
420
|
+
orchestratorPreparing: "{label} wird vorbereitet…",
|
|
421
|
+
orchestratorCollecting: "Parameter für {label} werden gesammelt…",
|
|
422
|
+
thinking: "Denke nach…",
|
|
423
|
+
stopped: "Vom Benutzer abgebrochen.",
|
|
424
|
+
toolRequest: "Werkzeugausführung angefordert",
|
|
425
|
+
modelRequestError: "Fehler bei der Anfrage an das Modell",
|
|
426
|
+
noProviderResponse: "Keine Antwort vom AI-Provider.",
|
|
427
|
+
noActiveSession: "Keine aktive Sitzung — zuerst run() aufrufen.",
|
|
428
|
+
approvalHeader: "Freigabe",
|
|
429
|
+
approve: "Freigeben",
|
|
430
|
+
reject: "Ablehnen",
|
|
431
|
+
approveQuestion: "Freigeben? {action}",
|
|
432
|
+
requestInProgress: "Eine andere Anfrage läuft bereits.",
|
|
433
|
+
invalidResponse: "Ungültige AI-Antwort.",
|
|
434
|
+
responseReceived: "Antwort erhalten",
|
|
435
|
+
noProviderAvailable: "Kein AI-Provider verfügbar.",
|
|
436
|
+
tooManyToolTurns: "Zu viele aufeinanderfolgende Werkzeugaufrufe — das bisher gesammelte deterministische Ergebnis wird verwendet.",
|
|
437
|
+
aiDisabledFallback: "AI deaktiviert — das deterministische Ergebnis wird verwendet.",
|
|
438
|
+
continueWithoutAiFallback: "Weiter ohne AI — das deterministische Ergebnis wird verwendet.",
|
|
439
|
+
oneStep: "1 Schritt",
|
|
440
|
+
steps: "{count} Schritte",
|
|
441
|
+
stepsLabel: "Schritte des Agenten",
|
|
442
|
+
newInstance: "Neue Instanz von \"{label}\"",
|
|
443
|
+
chatHistory: "Chatverlauf",
|
|
444
|
+
renameChat: "Umbenennen",
|
|
445
|
+
chatTitleLabel: "Titel",
|
|
446
|
+
chatTitleHint: "Leer: der aus dem Chat geschriebene Titel.",
|
|
447
|
+
chatStarted: "Begonnen am {at}",
|
|
448
|
+
chatLastMessage: "letzte Nachricht am {at}",
|
|
449
|
+
newChat: "Neuer Chat",
|
|
450
|
+
searchChats: "Chats durchsuchen…",
|
|
451
|
+
messagePlaceholder: "Nachricht schreiben…",
|
|
452
|
+
unsavedConversationConfirm: "Diese Unterhaltung wurde nicht gespeichert und geht verloren. Fortfahren?",
|
|
453
|
+
noSavedChats: "Noch keine gespeicherten Chats.",
|
|
454
|
+
archiveChat: "Archivieren",
|
|
455
|
+
noResults: "Keine Ergebnisse.",
|
|
456
|
+
retry: "Erneut versuchen",
|
|
457
|
+
retryMessage: "Erneut versuchen.",
|
|
458
|
+
continueWithoutAi: "Ohne AI fortfahren",
|
|
459
|
+
resumeWithAi: "Mit AI fortsetzen",
|
|
460
|
+
openPanel: "Agentenbereich öffnen",
|
|
461
|
+
closePanel: "Agentenbereich schließen",
|
|
462
|
+
resizePanel: "Agent-Bereich in der Größe ändern",
|
|
463
|
+
resizePanelHint: "Ziehen zum Ändern der Größe, Doppelklick zum Zurücksetzen",
|
|
464
|
+
pendingQuestions: "Fragen des Agenten",
|
|
465
|
+
stop: "Stoppen"
|
|
466
|
+
}, we = "llmnative.agentico.entityChat";
|
|
467
|
+
function Te(e) {
|
|
468
|
+
we = e.storageKey;
|
|
469
|
+
}
|
|
470
|
+
function Ee(e) {
|
|
471
|
+
if (!e || typeof e != "object") return null;
|
|
472
|
+
let t = e;
|
|
473
|
+
if (typeof t.entityId != "string") return null;
|
|
474
|
+
let n = t.scopeId ?? t.tenantId;
|
|
475
|
+
if (typeof n != "string") return null;
|
|
476
|
+
let { tenantId: r, ...i } = t;
|
|
477
|
+
return {
|
|
478
|
+
...i,
|
|
479
|
+
scopeId: n
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function De() {
|
|
483
|
+
try {
|
|
484
|
+
let e = localStorage.getItem(we);
|
|
485
|
+
if (!e) return [];
|
|
486
|
+
let t = JSON.parse(e);
|
|
487
|
+
return Array.isArray(t) ? t.map(Ee).filter((e) => e !== null) : [];
|
|
488
|
+
} catch {
|
|
489
|
+
return [];
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
var Oe = /* @__PURE__ */ new Set();
|
|
493
|
+
function ke(e) {
|
|
494
|
+
return Oe.add(e), () => {
|
|
495
|
+
Oe.delete(e);
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
function Ae(e) {
|
|
499
|
+
try {
|
|
500
|
+
localStorage.setItem(we, JSON.stringify(e));
|
|
501
|
+
} catch {}
|
|
502
|
+
for (let e of [...Oe]) e();
|
|
503
|
+
}
|
|
504
|
+
var je = (e, t, n) => `${e}:${t}:${n}`;
|
|
505
|
+
function Me(e, t, n) {
|
|
506
|
+
let r = je(e, t, n);
|
|
507
|
+
return De().find((e) => je(e.scopeId, e.subagentId, e.entityId) === r) ?? null;
|
|
508
|
+
}
|
|
509
|
+
function Ne(e) {
|
|
510
|
+
let t = je(e.scopeId, e.subagentId, e.entityId), n = De(), r = n.find((e) => je(e.scopeId, e.subagentId, e.entityId) === t), i = Date.now(), a = n.filter((e) => e !== r);
|
|
511
|
+
a.push({
|
|
512
|
+
...e,
|
|
513
|
+
savedAt: i,
|
|
514
|
+
startedAt: r ? Ve(r) : i,
|
|
515
|
+
...r?.name ? {
|
|
516
|
+
name: r.name,
|
|
517
|
+
namedBy: r.namedBy
|
|
518
|
+
} : {}
|
|
519
|
+
}), Ae(a);
|
|
520
|
+
}
|
|
521
|
+
var Pe = new Set([
|
|
522
|
+
xe,
|
|
523
|
+
Se,
|
|
524
|
+
Ce
|
|
525
|
+
].map((e) => e.retryMessage.trim().toLowerCase())), Fe = (e) => e.kind === "user" && !!e.detail?.trim() && !e.retry && !Pe.has(e.detail.trim().toLowerCase()), Ie = (e) => {
|
|
526
|
+
let t = (e.activity.find(Fe)?.detail ?? "").trim().split("\n")[0].trim();
|
|
527
|
+
return t.length > 80 ? `${t.slice(0, 80).trimEnd()}…` : t;
|
|
528
|
+
}, Le = (e) => e.name || Ie(e) || e.title || e.entityId, Re = (e) => e.activity.some(Fe), ze = (e) => e.kind === "user" && !Fe(e) && !!e.detail?.trim();
|
|
529
|
+
function Be(e, t, n, r, i = "person") {
|
|
530
|
+
let a = je(e, t, n), o = De(), s = o.find((e) => je(e.scopeId, e.subagentId, e.entityId) === a);
|
|
531
|
+
if (!s || i === "model" && s.namedBy === "person") return !1;
|
|
532
|
+
let c = r.trim().replace(/\s+/g, " ").slice(0, 120), { name: l, namedBy: u, ...d } = s, f = c ? {
|
|
533
|
+
...d,
|
|
534
|
+
name: c,
|
|
535
|
+
namedBy: i
|
|
536
|
+
} : d;
|
|
537
|
+
return Ae(o.map((e) => e === s ? f : e)), !0;
|
|
538
|
+
}
|
|
539
|
+
var Ve = (e) => e.startedAt ?? e.savedAt;
|
|
540
|
+
function He(e, t, n) {
|
|
541
|
+
let r = je(e, t, n);
|
|
542
|
+
Ae(De().filter((e) => je(e.scopeId, e.subagentId, e.entityId) !== r));
|
|
543
|
+
}
|
|
544
|
+
function Ue(e) {
|
|
545
|
+
return De().filter((t) => t.scopeId === e).sort((e, t) => Ve(t) - Ve(e));
|
|
546
|
+
}
|
|
547
|
+
var We = (e, t) => `entitychat-${e}-${t}`, Ge = {
|
|
548
|
+
en: { agentico: xe },
|
|
549
|
+
it: { agentico: Se },
|
|
550
|
+
de: { agentico: Ce }
|
|
547
551
|
};
|
|
548
552
|
function Q() {
|
|
549
553
|
let { dict: e } = S(), t = e.agentico;
|
|
550
554
|
return t ? {
|
|
551
|
-
...
|
|
555
|
+
...xe,
|
|
552
556
|
...t
|
|
553
|
-
} :
|
|
557
|
+
} : xe;
|
|
554
558
|
}
|
|
555
559
|
//#endregion
|
|
556
560
|
//#region src/presentation/AgenticoContext.tsx
|
|
557
|
-
var
|
|
558
|
-
function
|
|
561
|
+
var Ke = "agentico-orchestrator", qe = w(null);
|
|
562
|
+
function Je({ children: e, scope: t = null }) {
|
|
559
563
|
let [n, r] = j(null), i = A(null);
|
|
560
564
|
D(() => {
|
|
561
565
|
i.current = n;
|
|
@@ -629,7 +633,7 @@ function Ge({ children: e, scope: t = null }) {
|
|
|
629
633
|
let c = i.current;
|
|
630
634
|
if (!c || c.id !== n) return;
|
|
631
635
|
let l = c.agent.snapshot();
|
|
632
|
-
l && (
|
|
636
|
+
l && (Ne({
|
|
633
637
|
scopeId: a,
|
|
634
638
|
subagentId: e,
|
|
635
639
|
entityId: t,
|
|
@@ -648,7 +652,7 @@ function Ge({ children: e, scope: t = null }) {
|
|
|
648
652
|
snapshot: n
|
|
649
653
|
}), Y(crypto.randomUUID());
|
|
650
654
|
}, [u]), [ie, ae] = j(null), [oe, se] = j(null), Z = T((e, t) => {
|
|
651
|
-
u(), c(
|
|
655
|
+
u(), c(Ke), ae({
|
|
652
656
|
subagentId: e,
|
|
653
657
|
extraDestinations: t
|
|
654
658
|
}), se(crypto.randomUUID());
|
|
@@ -742,19 +746,19 @@ function Ge({ children: e, scope: t = null }) {
|
|
|
742
746
|
pe,
|
|
743
747
|
he
|
|
744
748
|
]);
|
|
745
|
-
return /* @__PURE__ */ N(
|
|
749
|
+
return /* @__PURE__ */ N(qe.Provider, {
|
|
746
750
|
value: ye,
|
|
747
751
|
children: e
|
|
748
752
|
});
|
|
749
753
|
}
|
|
750
754
|
function $() {
|
|
751
|
-
let e = E(
|
|
755
|
+
let e = E(qe);
|
|
752
756
|
if (!e) throw Error("useAgentico must be used inside AgenticoProvider");
|
|
753
757
|
return e;
|
|
754
758
|
}
|
|
755
759
|
//#endregion
|
|
756
760
|
//#region src/presentation/AgentActivityLog.tsx
|
|
757
|
-
function
|
|
761
|
+
function Ye(e) {
|
|
758
762
|
let t = e.search(/[{[]/);
|
|
759
763
|
if (t === -1) return [{
|
|
760
764
|
type: "text",
|
|
@@ -800,18 +804,18 @@ function Ke(e) {
|
|
|
800
804
|
language: "json"
|
|
801
805
|
});
|
|
802
806
|
let u = e.slice(s + 1);
|
|
803
|
-
return u.trim() && l.push(...
|
|
807
|
+
return u.trim() && l.push(...Ye(u)), l;
|
|
804
808
|
}
|
|
805
|
-
function
|
|
809
|
+
function Xe(e) {
|
|
806
810
|
let t = [], n = /```(\w+)?\n?([\s\S]*?)```/g, r = 0, i;
|
|
807
|
-
for (; i = n.exec(e);) i.index > r && t.push(...
|
|
811
|
+
for (; i = n.exec(e);) i.index > r && t.push(...Ye(e.slice(r, i.index))), t.push({
|
|
808
812
|
type: "code",
|
|
809
813
|
content: i[2].replace(/\n$/, ""),
|
|
810
814
|
language: i[1]
|
|
811
815
|
}), r = n.lastIndex;
|
|
812
|
-
return r < e.length && t.push(...
|
|
816
|
+
return r < e.length && t.push(...Ye(e.slice(r))), t;
|
|
813
817
|
}
|
|
814
|
-
function
|
|
818
|
+
function Ze({ content: e, language: t }) {
|
|
815
819
|
let [n, r] = j(!1);
|
|
816
820
|
return /* @__PURE__ */ P("div", {
|
|
817
821
|
className: `relative cursor-pointer rounded-md ${n ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
|
|
@@ -826,9 +830,9 @@ function Je({ content: e, language: t }) {
|
|
|
826
830
|
}), !n && /* @__PURE__ */ N("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-6 bg-gradient-to-t from-muted/30 to-transparent" })]
|
|
827
831
|
});
|
|
828
832
|
}
|
|
829
|
-
function
|
|
830
|
-
let n =
|
|
831
|
-
return /* @__PURE__ */ N(M, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ N(
|
|
833
|
+
function Qe({ text: e, tone: t }) {
|
|
834
|
+
let n = Xe(e);
|
|
835
|
+
return /* @__PURE__ */ N(M, { children: n.map((e, n) => e.type === "code" ? /* @__PURE__ */ N(Ze, {
|
|
832
836
|
content: e.content,
|
|
833
837
|
language: e.language
|
|
834
838
|
}, n) : e.content.trim() && /* @__PURE__ */ N(r, {
|
|
@@ -837,7 +841,7 @@ function Ye({ text: e, tone: t }) {
|
|
|
837
841
|
className: "break-words text-xs leading-relaxed"
|
|
838
842
|
}, n)) });
|
|
839
843
|
}
|
|
840
|
-
function
|
|
844
|
+
function $e({ status: e }) {
|
|
841
845
|
return e === "running" ? /* @__PURE__ */ N("span", { className: "inline-block h-3 w-3 shrink-0 animate-spin rounded-full border-2 border-current border-t-transparent" }) : e === "done" ? /* @__PURE__ */ N(d, {
|
|
842
846
|
name: "check",
|
|
843
847
|
size: 12,
|
|
@@ -852,11 +856,11 @@ function Xe({ status: e }) {
|
|
|
852
856
|
className: "shrink-0 text-destructive"
|
|
853
857
|
});
|
|
854
858
|
}
|
|
855
|
-
function
|
|
859
|
+
function et(e, t) {
|
|
856
860
|
return e.status === "running" ? t.thinking : e.status === "error" ? t.modelRequestError : e.status === "stopped" ? t.stopped : e.detail ? t.responseReceived : e.toolNames && e.toolNames.length > 0 ? e.toolNames.join(" · ") : t.toolRequest;
|
|
857
861
|
}
|
|
858
|
-
var
|
|
859
|
-
function
|
|
862
|
+
var tt = 96;
|
|
863
|
+
function nt({ entry: e, pinned: t = !0 }) {
|
|
860
864
|
let n = A(null), [r, i] = j(!1), [a, o] = j(!1);
|
|
861
865
|
O(() => {
|
|
862
866
|
let e = n.current;
|
|
@@ -870,7 +874,7 @@ function $e({ entry: e, pinned: t = !0 }) {
|
|
|
870
874
|
children: [/* @__PURE__ */ P("div", {
|
|
871
875
|
ref: n,
|
|
872
876
|
className: `space-y-1 px-2.5 pt-1.5 ${s ? "overflow-hidden" : ""}`,
|
|
873
|
-
style: s ? { maxHeight:
|
|
877
|
+
style: s ? { maxHeight: tt } : void 0,
|
|
874
878
|
children: [e.attachmentNames && e.attachmentNames.length > 0 && /* @__PURE__ */ N("div", {
|
|
875
879
|
className: "flex flex-wrap gap-1",
|
|
876
880
|
children: e.attachmentNames.map((e, t) => /* @__PURE__ */ P("span", {
|
|
@@ -884,7 +888,7 @@ function $e({ entry: e, pinned: t = !0 }) {
|
|
|
884
888
|
children: e
|
|
885
889
|
})]
|
|
886
890
|
}, t))
|
|
887
|
-
}), /* @__PURE__ */ N(
|
|
891
|
+
}), /* @__PURE__ */ N(Qe, { text: e.detail ?? "" })]
|
|
888
892
|
}), a && /* @__PURE__ */ P("button", {
|
|
889
893
|
type: "button",
|
|
890
894
|
onClick: () => i((e) => !e),
|
|
@@ -898,13 +902,13 @@ function $e({ entry: e, pinned: t = !0 }) {
|
|
|
898
902
|
})
|
|
899
903
|
});
|
|
900
904
|
}
|
|
901
|
-
var
|
|
905
|
+
var rt = {
|
|
902
906
|
running: "loader-circle",
|
|
903
907
|
done: "check",
|
|
904
908
|
error: "x",
|
|
905
909
|
stopped: "circle-slash"
|
|
906
910
|
};
|
|
907
|
-
function
|
|
911
|
+
function it({ steps: e }) {
|
|
908
912
|
let t = Q(), n = e.filter((e) => e.status === "running").at(-1), r = e.some((e) => e.status === "error"), i = n?.label ?? (e.length === 1 ? t.oneStep : _(t.steps, { count: e.length }));
|
|
909
913
|
return /* @__PURE__ */ N(h, {
|
|
910
914
|
ariaLabel: t.stepsLabel,
|
|
@@ -920,12 +924,12 @@ function tt({ steps: e }) {
|
|
|
920
924
|
className: e.status === "error" ? "text-destructive" : void 0,
|
|
921
925
|
children: e.label
|
|
922
926
|
}),
|
|
923
|
-
icon:
|
|
927
|
+
icon: rt[e.status]
|
|
924
928
|
}))
|
|
925
929
|
}]
|
|
926
930
|
});
|
|
927
931
|
}
|
|
928
|
-
function
|
|
932
|
+
function at(e, t) {
|
|
929
933
|
let n = e.at(-1);
|
|
930
934
|
if (!n || n.kind !== "thinking" || !n.parts || n.status === "stopped" || n.status === "error") return null;
|
|
931
935
|
let r = [...n.parts].reverse().find((e) => e.type === "questions");
|
|
@@ -934,7 +938,7 @@ function nt(e, t) {
|
|
|
934
938
|
part: r
|
|
935
939
|
};
|
|
936
940
|
}
|
|
937
|
-
function
|
|
941
|
+
function ot({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
|
|
938
942
|
let o = !!n?.canAnswer(e.id);
|
|
939
943
|
return /* @__PURE__ */ N(i, {
|
|
940
944
|
questions: t.questions,
|
|
@@ -945,7 +949,7 @@ function rt({ entry: e, part: t, questions: n, autoFocus: r, className: a }) {
|
|
|
945
949
|
className: a ?? "text-xs"
|
|
946
950
|
});
|
|
947
951
|
}
|
|
948
|
-
function
|
|
952
|
+
function st({ entry: e, questions: t, hiddenPartId: n }) {
|
|
949
953
|
let i = (e.parts ?? []).filter((e) => e.type !== "questions" || e.id !== n), o = [];
|
|
950
954
|
for (let e of i) {
|
|
951
955
|
let t = o.at(-1);
|
|
@@ -960,7 +964,7 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
960
964
|
return /* @__PURE__ */ N("div", {
|
|
961
965
|
className: "space-y-2",
|
|
962
966
|
children: o.map((n) => {
|
|
963
|
-
if ("steps" in n) return /* @__PURE__ */ N(
|
|
967
|
+
if ("steps" in n) return /* @__PURE__ */ N(it, { steps: n.steps }, n.key);
|
|
964
968
|
let { part: i } = n;
|
|
965
969
|
return i.type === "text" ? i.text.trim() ? /* @__PURE__ */ N(r, {
|
|
966
970
|
content: i.text,
|
|
@@ -971,7 +975,7 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
971
975
|
streaming: i.streaming,
|
|
972
976
|
duration: i.duration,
|
|
973
977
|
className: "my-0"
|
|
974
|
-
}, n.key) : /* @__PURE__ */ N(
|
|
978
|
+
}, n.key) : /* @__PURE__ */ N(ot, {
|
|
975
979
|
entry: e,
|
|
976
980
|
part: i,
|
|
977
981
|
questions: t
|
|
@@ -979,13 +983,13 @@ function it({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
979
983
|
})
|
|
980
984
|
});
|
|
981
985
|
}
|
|
982
|
-
function
|
|
986
|
+
function ct({ entry: e, questions: t, hiddenPartId: n }) {
|
|
983
987
|
let i = Q();
|
|
984
988
|
if (e.kind === "thinking" && e.parts) {
|
|
985
989
|
let r = e.status === "error" || e.status === "stopped" || e.status === "running" && e.parts.length === 0;
|
|
986
990
|
return /* @__PURE__ */ P("li", {
|
|
987
991
|
className: "text-xs text-muted-foreground",
|
|
988
|
-
children: [e.parts.length > 0 && /* @__PURE__ */ N(
|
|
992
|
+
children: [e.parts.length > 0 && /* @__PURE__ */ N(st, {
|
|
989
993
|
entry: e,
|
|
990
994
|
questions: t,
|
|
991
995
|
hiddenPartId: n
|
|
@@ -993,15 +997,15 @@ function at({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
993
997
|
className: `flex items-start gap-1.5 ${e.parts.length > 0 ? "mt-1" : ""}`,
|
|
994
998
|
children: [/* @__PURE__ */ N("span", {
|
|
995
999
|
className: "pt-px",
|
|
996
|
-
children: /* @__PURE__ */ N(
|
|
1000
|
+
children: /* @__PURE__ */ N($e, { status: e.status })
|
|
997
1001
|
}), /* @__PURE__ */ N("span", {
|
|
998
1002
|
className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
|
|
999
|
-
children:
|
|
1003
|
+
children: et(e, i)
|
|
1000
1004
|
})]
|
|
1001
1005
|
})]
|
|
1002
1006
|
});
|
|
1003
1007
|
}
|
|
1004
|
-
let a = e.kind === "thinking" && e.detail ?
|
|
1008
|
+
let a = e.kind === "thinking" && e.detail ? Xe(e.detail) : [], o = a.filter((e) => e.type === "code"), s = a.filter((e) => e.type === "text" && e.content.trim()), c = e.kind === "thinking" ? et(e, i) : e.label;
|
|
1005
1009
|
return /* @__PURE__ */ P("li", {
|
|
1006
1010
|
className: "text-xs text-muted-foreground",
|
|
1007
1011
|
children: [
|
|
@@ -1009,7 +1013,7 @@ function at({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
1009
1013
|
className: "flex items-start gap-1.5",
|
|
1010
1014
|
children: [/* @__PURE__ */ N("span", {
|
|
1011
1015
|
className: "pt-px",
|
|
1012
|
-
children: /* @__PURE__ */ N(
|
|
1016
|
+
children: /* @__PURE__ */ N($e, { status: e.status })
|
|
1013
1017
|
}), /* @__PURE__ */ N("span", {
|
|
1014
1018
|
className: "min-w-0 flex-1 whitespace-pre-wrap break-words",
|
|
1015
1019
|
children: c
|
|
@@ -1017,7 +1021,7 @@ function at({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
1017
1021
|
}),
|
|
1018
1022
|
o.length > 0 && /* @__PURE__ */ N("div", {
|
|
1019
1023
|
className: "mt-1 ml-[18px] space-y-1",
|
|
1020
|
-
children: o.map((e, t) => /* @__PURE__ */ N(
|
|
1024
|
+
children: o.map((e, t) => /* @__PURE__ */ N(Ze, {
|
|
1021
1025
|
content: e.content,
|
|
1022
1026
|
language: e.language
|
|
1023
1027
|
}, t))
|
|
@@ -1033,7 +1037,7 @@ function at({ entry: e, questions: t, hiddenPartId: n }) {
|
|
|
1033
1037
|
]
|
|
1034
1038
|
});
|
|
1035
1039
|
}
|
|
1036
|
-
function
|
|
1040
|
+
function lt({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
|
|
1037
1041
|
if (e.length === 0) return null;
|
|
1038
1042
|
let i = [];
|
|
1039
1043
|
for (let t of e) t.kind === "user" || i.length === 0 ? i.push(t.kind === "user" ? {
|
|
@@ -1042,12 +1046,12 @@ function ot({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
|
|
|
1042
1046
|
} : { entries: [t] }) : i[i.length - 1].entries.push(t);
|
|
1043
1047
|
return /* @__PURE__ */ N("ul", {
|
|
1044
1048
|
className: "space-y-0.5",
|
|
1045
|
-
children: i.map((e) => /* @__PURE__ */ P("li", { children: [e.user && /* @__PURE__ */ N(
|
|
1049
|
+
children: i.map((e) => /* @__PURE__ */ P("li", { children: [e.user && /* @__PURE__ */ N(nt, {
|
|
1046
1050
|
entry: e.user,
|
|
1047
1051
|
pinned: r
|
|
1048
1052
|
}), e.entries.length > 0 && /* @__PURE__ */ N("ul", {
|
|
1049
1053
|
className: "space-y-0.5",
|
|
1050
|
-
children: e.entries.map((e) => /* @__PURE__ */ N(
|
|
1054
|
+
children: e.entries.map((e) => /* @__PURE__ */ N(ct, {
|
|
1051
1055
|
entry: e,
|
|
1052
1056
|
questions: t,
|
|
1053
1057
|
hiddenPartId: n?.entry.id === e.id ? n.part.id : void 0
|
|
@@ -1057,55 +1061,55 @@ function ot({ activity: e, questions: t, docked: n, pinUserMessages: r = !0 }) {
|
|
|
1057
1061
|
}
|
|
1058
1062
|
//#endregion
|
|
1059
1063
|
//#region src/presentation/panelWidth.ts
|
|
1060
|
-
var
|
|
1061
|
-
function
|
|
1064
|
+
var ut = 420, dt = 320, ft = "60vw", pt = "agentico:panel-width";
|
|
1065
|
+
function mt(e, t) {
|
|
1062
1066
|
if (typeof e == "number") return e;
|
|
1063
1067
|
let n = Number.parseFloat(e);
|
|
1064
1068
|
return Number.isFinite(n) ? Math.round(n / 100 * t) : Infinity;
|
|
1065
1069
|
}
|
|
1066
|
-
function
|
|
1070
|
+
function ht(e, t, n) {
|
|
1067
1071
|
return Math.round(Math.min(Math.max(e, t), Math.max(t, n)));
|
|
1068
1072
|
}
|
|
1069
|
-
function
|
|
1073
|
+
function gt() {
|
|
1070
1074
|
try {
|
|
1071
|
-
let e = window.localStorage.getItem(
|
|
1075
|
+
let e = window.localStorage.getItem(pt), t = e === null ? NaN : Number(e);
|
|
1072
1076
|
return Number.isFinite(t) && t > 0 ? t : null;
|
|
1073
1077
|
} catch {
|
|
1074
1078
|
return null;
|
|
1075
1079
|
}
|
|
1076
1080
|
}
|
|
1077
|
-
function
|
|
1081
|
+
function _t(e) {
|
|
1078
1082
|
try {
|
|
1079
|
-
e === null ? window.localStorage.removeItem(
|
|
1083
|
+
e === null ? window.localStorage.removeItem(pt) : window.localStorage.setItem(pt, String(e));
|
|
1080
1084
|
} catch {}
|
|
1081
1085
|
}
|
|
1082
|
-
function
|
|
1086
|
+
function vt() {
|
|
1083
1087
|
return typeof window > "u" ? Infinity : window.innerWidth;
|
|
1084
1088
|
}
|
|
1085
|
-
function
|
|
1086
|
-
let [i, a] = j(
|
|
1089
|
+
function yt({ defaultWidth: e = 420, minWidth: t = 320, maxWidth: n = ft, onWidthChange: r }) {
|
|
1090
|
+
let [i, a] = j(vt), [o, s] = j(() => gt() ?? e);
|
|
1087
1091
|
D(() => {
|
|
1088
1092
|
if (typeof window > "u") return;
|
|
1089
1093
|
let e = () => a(window.innerWidth);
|
|
1090
1094
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
1091
1095
|
}, []);
|
|
1092
|
-
let c = t, l = Math.max(c,
|
|
1096
|
+
let c = t, l = Math.max(c, mt(n, i)), u = ht(o, c, l);
|
|
1093
1097
|
return D(() => {
|
|
1094
1098
|
r?.(u);
|
|
1095
1099
|
}, [u]), {
|
|
1096
1100
|
width: u,
|
|
1097
1101
|
min: c,
|
|
1098
1102
|
max: l,
|
|
1099
|
-
set: T((e) => s(
|
|
1100
|
-
commit: T((e) =>
|
|
1103
|
+
set: T((e) => s(ht(e, c, l)), [c, l]),
|
|
1104
|
+
commit: T((e) => _t(ht(e, c, l)), [c, l]),
|
|
1101
1105
|
reset: T(() => {
|
|
1102
|
-
s(e),
|
|
1106
|
+
s(e), _t(null);
|
|
1103
1107
|
}, [e])
|
|
1104
1108
|
};
|
|
1105
1109
|
}
|
|
1106
1110
|
//#endregion
|
|
1107
1111
|
//#region src/presentation/AgenticoResizeHandle.tsx
|
|
1108
|
-
function
|
|
1112
|
+
function bt({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a }) {
|
|
1109
1113
|
let o = Q(), s = A(null), [c, l] = j(!1), u = (e) => Math.round(Math.min(Math.max(e, t), Math.max(t, n))), d = (e) => {
|
|
1110
1114
|
let t = s.current;
|
|
1111
1115
|
if (t && t.pointerId === e.pointerId) {
|
|
@@ -1163,7 +1167,7 @@ function _t({ width: e, min: t, max: n, onResize: r, onCommit: i, onReset: a })
|
|
|
1163
1167
|
}
|
|
1164
1168
|
//#endregion
|
|
1165
1169
|
//#region src/presentation/AgenticoToggle.tsx
|
|
1166
|
-
function
|
|
1170
|
+
function xt({ className: e = "" }) {
|
|
1167
1171
|
let { isOpen: n, toggleOpen: r, task: i } = $(), a = Q(), o = i?.agent.running ?? !1;
|
|
1168
1172
|
return /* @__PURE__ */ N(t, {
|
|
1169
1173
|
icon: "bot",
|
|
@@ -1176,21 +1180,21 @@ function vt({ className: e = "" }) {
|
|
|
1176
1180
|
}
|
|
1177
1181
|
//#endregion
|
|
1178
1182
|
//#region src/presentation/useAIModelCatalog.ts
|
|
1179
|
-
var
|
|
1180
|
-
function
|
|
1183
|
+
var St = "llmnative-cms.selectedAIModel";
|
|
1184
|
+
function Ct() {
|
|
1181
1185
|
try {
|
|
1182
|
-
return localStorage.getItem(
|
|
1186
|
+
return localStorage.getItem(St) ?? "";
|
|
1183
1187
|
} catch {
|
|
1184
1188
|
return "";
|
|
1185
1189
|
}
|
|
1186
1190
|
}
|
|
1187
|
-
function
|
|
1191
|
+
function wt(e) {
|
|
1188
1192
|
try {
|
|
1189
|
-
e ? localStorage.setItem(
|
|
1193
|
+
e ? localStorage.setItem(St, e) : localStorage.removeItem(St);
|
|
1190
1194
|
} catch {}
|
|
1191
1195
|
}
|
|
1192
|
-
function
|
|
1193
|
-
let e = b()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = j({}), [i, a] = j(!1), [o, s] = j(
|
|
1196
|
+
function Tt() {
|
|
1197
|
+
let e = b()?.registry ?? {}, t = Object.keys(e).length > 0, [n, r] = j({}), [i, a] = j(!1), [o, s] = j(Ct);
|
|
1194
1198
|
return D(() => {
|
|
1195
1199
|
if (!t) {
|
|
1196
1200
|
r({});
|
|
@@ -1201,7 +1205,7 @@ function St() {
|
|
|
1201
1205
|
if (n) return;
|
|
1202
1206
|
r(e.modelsByProvider);
|
|
1203
1207
|
let t = Object.values(e.modelsByProvider).flat();
|
|
1204
|
-
s((e) => t.some((t) => t.id === e) ? e : (
|
|
1208
|
+
s((e) => t.some((t) => t.id === e) ? e : (wt(""), ""));
|
|
1205
1209
|
}).catch((e) => {
|
|
1206
1210
|
console.error("useAIModelCatalog: getAIModelCatalog failed", e), n || r({});
|
|
1207
1211
|
}).finally(() => {
|
|
@@ -1215,17 +1219,17 @@ function St() {
|
|
|
1215
1219
|
modelsLoading: i,
|
|
1216
1220
|
selectedModel: o,
|
|
1217
1221
|
setSelectedModel: (e) => {
|
|
1218
|
-
|
|
1222
|
+
wt(e), s(e);
|
|
1219
1223
|
}
|
|
1220
1224
|
};
|
|
1221
1225
|
}
|
|
1222
1226
|
//#endregion
|
|
1223
1227
|
//#region src/domain/approval.ts
|
|
1224
|
-
var
|
|
1225
|
-
function
|
|
1228
|
+
var Et = "approval";
|
|
1229
|
+
function Dt(e, t) {
|
|
1226
1230
|
return typeof e.needsApproval == "function" ? e.needsApproval(t) : e.needsApproval === !0;
|
|
1227
1231
|
}
|
|
1228
|
-
function
|
|
1232
|
+
function Ot(e, t, n) {
|
|
1229
1233
|
let r = e[0]?.values ?? [], i = r.filter((e) => e !== t && e !== n).join(" ").trim();
|
|
1230
1234
|
return {
|
|
1231
1235
|
approved: r.includes(t) && !r.includes(n),
|
|
@@ -1234,12 +1238,12 @@ function Tt(e, t, n) {
|
|
|
1234
1238
|
}
|
|
1235
1239
|
//#endregion
|
|
1236
1240
|
//#region src/presentation/useAgent.ts
|
|
1237
|
-
var
|
|
1238
|
-
function
|
|
1239
|
-
return e.filter((e) => !m.isTextAttachment(e.mimeType) || e.base64.length <=
|
|
1241
|
+
var kt = 20, At = 26e4;
|
|
1242
|
+
function jt(e) {
|
|
1243
|
+
return e.filter((e) => !m.isTextAttachment(e.mimeType) || e.base64.length <= At);
|
|
1240
1244
|
}
|
|
1241
|
-
function
|
|
1242
|
-
let { defaultEnabled: n = !1 } = t, [r, i] = j(n), { hasProviders: a, modelsByProvider: o, modelsLoading: s, selectedModel: c, setSelectedModel: l } =
|
|
1245
|
+
function Mt(e, t = {}) {
|
|
1246
|
+
let { defaultEnabled: n = !1 } = t, [r, i] = j(n), { hasProviders: a, modelsByProvider: o, modelsLoading: s, selectedModel: c, setSelectedModel: l } = Tt(), [u, d] = j(!1), [f, p] = j(null), [h, g] = j(!1), [_, y] = j([]), x = A([]), S = (e) => {
|
|
1243
1247
|
y((t) => {
|
|
1244
1248
|
let n = typeof e == "function" ? e(t) : e;
|
|
1245
1249
|
return x.current = n, n;
|
|
@@ -1413,7 +1417,7 @@ function kt(e, t = {}) {
|
|
|
1413
1417
|
let l = s ? v(s) : H, u = l ? N[l.provider] : null;
|
|
1414
1418
|
if (!u || !l) return p(T.current.noProviderAvailable), null;
|
|
1415
1419
|
n?.length && (c.attachmentsRef.current = [...c.attachmentsRef.current ?? [], ...n]);
|
|
1416
|
-
let d = (n ?? []).filter((e) => m.isTextAttachment(e.mimeType)).map((e) => e.base64.length <=
|
|
1420
|
+
let d = (n ?? []).filter((e) => m.isTextAttachment(e.mimeType)).map((e) => e.base64.length <= At ? `\n\n[File allegato: ${e.name}]\n${m.decodeBase64Text(e.base64)}` : `\n\n[File allegato: ${e.name} — troppo grande per essere incollato qui. Usa uno dei tool di lettura file disponibili (es. list_csv_columns/extract_csv_column) per leggerne il contenuto prima di chiedere altro all'utente.]`).join(""), f = jt(n ?? []), h = c.tools.map((e) => ({
|
|
1417
1421
|
name: e.name,
|
|
1418
1422
|
description: e.description,
|
|
1419
1423
|
inputSchema: K(e.inputSchema)
|
|
@@ -1426,7 +1430,7 @@ function kt(e, t = {}) {
|
|
|
1426
1430
|
status: "running",
|
|
1427
1431
|
parts: [{
|
|
1428
1432
|
type: "questions",
|
|
1429
|
-
id:
|
|
1433
|
+
id: Et,
|
|
1430
1434
|
questions: [{
|
|
1431
1435
|
header: i.approvalHeader,
|
|
1432
1436
|
question: i.approveQuestion.replace("{action}", o),
|
|
@@ -1435,7 +1439,7 @@ function kt(e, t = {}) {
|
|
|
1435
1439
|
}]
|
|
1436
1440
|
}]
|
|
1437
1441
|
}]);
|
|
1438
|
-
let s = `${a}:${
|
|
1442
|
+
let s = `${a}:${Et}`;
|
|
1439
1443
|
return new Promise((e, t) => {
|
|
1440
1444
|
let n = () => {
|
|
1441
1445
|
C.current.delete(s), b(a, "stopped"), t(new DOMException("The turn was stopped.", "AbortError"));
|
|
@@ -1446,7 +1450,7 @@ function kt(e, t = {}) {
|
|
|
1446
1450
|
}
|
|
1447
1451
|
r.addEventListener("abort", n, { once: !0 }), C.current.set(s, {
|
|
1448
1452
|
resolve: (t) => {
|
|
1449
|
-
r.removeEventListener("abort", n), b(a, "done"), e(
|
|
1453
|
+
r.removeEventListener("abort", n), b(a, "done"), e(Ot(t, i.approve, i.reject));
|
|
1450
1454
|
},
|
|
1451
1455
|
reject: t
|
|
1452
1456
|
});
|
|
@@ -1461,7 +1465,7 @@ function kt(e, t = {}) {
|
|
|
1461
1465
|
} : i));
|
|
1462
1466
|
try {
|
|
1463
1467
|
let n = c.history, r = t;
|
|
1464
|
-
for (let t = 0; t <
|
|
1468
|
+
for (let t = 0; t < kt; t++) {
|
|
1465
1469
|
let i = crypto.randomUUID();
|
|
1466
1470
|
S((e) => [...e, {
|
|
1467
1471
|
id: i,
|
|
@@ -1520,7 +1524,7 @@ function kt(e, t = {}) {
|
|
|
1520
1524
|
let s = /* @__PURE__ */ new Map();
|
|
1521
1525
|
for (let t of a.toolCalls) {
|
|
1522
1526
|
let n = _.get(t.name);
|
|
1523
|
-
if (n &&
|
|
1527
|
+
if (n && Dt(n, t.input)) try {
|
|
1524
1528
|
s.set(t.id, await g(t.id, n, t.input, y.signal));
|
|
1525
1529
|
} catch {
|
|
1526
1530
|
return e.fallback(c.params, c.context);
|
|
@@ -1694,7 +1698,8 @@ function kt(e, t = {}) {
|
|
|
1694
1698
|
label: "Tu",
|
|
1695
1699
|
status: "done",
|
|
1696
1700
|
detail: t,
|
|
1697
|
-
...n?.attachments?.length ? { attachmentNames: n.attachments.map((e) => e.name) } : {}
|
|
1701
|
+
...n?.attachments?.length ? { attachmentNames: n.attachments.map((e) => e.name) } : {},
|
|
1702
|
+
...n?.retry ? { retry: !0 } : {}
|
|
1698
1703
|
}]);
|
|
1699
1704
|
try {
|
|
1700
1705
|
if (q) return await le(t, !1, n?.model || void 0);
|
|
@@ -1754,23 +1759,23 @@ function kt(e, t = {}) {
|
|
|
1754
1759
|
}
|
|
1755
1760
|
//#endregion
|
|
1756
1761
|
//#region src/domain/orchestrator/prompt.ts
|
|
1757
|
-
function
|
|
1762
|
+
function Nt() {
|
|
1758
1763
|
let e = X();
|
|
1759
1764
|
return [e.responseRulesHeading, ...e.responseRules.map((e) => `- ${e}`)].join("\n");
|
|
1760
1765
|
}
|
|
1761
|
-
function
|
|
1766
|
+
function Pt(e, t, n) {
|
|
1762
1767
|
let r = X(), i = n ? `\n${r.pageContextHeading}\n${r.pageContextIntro}\n${n}\n` : "";
|
|
1763
1768
|
return `${r.orchestratorIntro}
|
|
1764
1769
|
|
|
1765
1770
|
${r.toolsHeading}
|
|
1766
1771
|
${t}
|
|
1767
1772
|
${i}
|
|
1768
|
-
${
|
|
1773
|
+
${Nt()}
|
|
1769
1774
|
|
|
1770
1775
|
${r.userRequestHeading}
|
|
1771
1776
|
${e}`;
|
|
1772
1777
|
}
|
|
1773
|
-
function
|
|
1778
|
+
function Ft(e, t) {
|
|
1774
1779
|
return t ? {
|
|
1775
1780
|
kind: "handoff",
|
|
1776
1781
|
...t
|
|
@@ -1781,27 +1786,27 @@ function Mt(e, t) {
|
|
|
1781
1786
|
}
|
|
1782
1787
|
//#endregion
|
|
1783
1788
|
//#region src/domain/orchestrator/agenticoOrchestratorAgent.ts
|
|
1784
|
-
function
|
|
1789
|
+
function It(e) {
|
|
1785
1790
|
return V().filter((t) => !t.onlyWhenAnchored || e === t.id);
|
|
1786
1791
|
}
|
|
1787
|
-
function
|
|
1792
|
+
function Lt(e) {
|
|
1788
1793
|
return {
|
|
1789
1794
|
buildContext(e) {
|
|
1790
1795
|
return {
|
|
1791
|
-
cliCatalog: le(
|
|
1796
|
+
cliCatalog: le(It(e.scopedSubagentId)),
|
|
1792
1797
|
handoff: { current: null },
|
|
1793
1798
|
collected: {}
|
|
1794
1799
|
};
|
|
1795
1800
|
},
|
|
1796
1801
|
buildPrompt({ userGoal: e, pageContext: t }, { cliCatalog: n }) {
|
|
1797
|
-
return
|
|
1802
|
+
return Pt(e, n, t);
|
|
1798
1803
|
},
|
|
1799
1804
|
buildFollowUpPrompt(e, t, { cliCatalog: n }) {
|
|
1800
|
-
return `${e}\n\n${
|
|
1805
|
+
return `${e}\n\n${Nt()}\n\n${X().toolsHeading}\n${n}`;
|
|
1801
1806
|
},
|
|
1802
1807
|
parseResponse(e, t, n) {
|
|
1803
1808
|
let r = n.handoff.current;
|
|
1804
|
-
return n.handoff.current = null,
|
|
1809
|
+
return n.handoff.current = null, Ft(e, r);
|
|
1805
1810
|
},
|
|
1806
1811
|
fallback() {
|
|
1807
1812
|
return {
|
|
@@ -1817,7 +1822,7 @@ function Pt(e) {
|
|
|
1817
1822
|
attachmentsRef: r,
|
|
1818
1823
|
collected: n.collected,
|
|
1819
1824
|
proxyFetch: y
|
|
1820
|
-
}), a = t.scopedSubagentId ? H(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s =
|
|
1825
|
+
}), a = t.scopedSubagentId ? H(t.scopedSubagentId) : null, o = a ? i.filter((e) => (a.crossAgentToolIds ?? []).includes(e.name)) : i, s = It(t.scopedSubagentId).flatMap((t) => t.commands.map((r) => ({
|
|
1821
1826
|
name: `${t.id}_${r.name}`,
|
|
1822
1827
|
description: `${t.label}: ${r.summary}`,
|
|
1823
1828
|
inputSchema: r.inputSchema,
|
|
@@ -1841,12 +1846,12 @@ function Pt(e) {
|
|
|
1841
1846
|
}
|
|
1842
1847
|
//#endregion
|
|
1843
1848
|
//#region src/presentation/deriveHistoryTitle.ts
|
|
1844
|
-
function
|
|
1849
|
+
function Rt(e, t) {
|
|
1845
1850
|
return e.deriveHistoryTitle?.(t) ?? e.label;
|
|
1846
1851
|
}
|
|
1847
1852
|
//#endregion
|
|
1848
1853
|
//#region src/presentation/ResultDestinationPicker.tsx
|
|
1849
|
-
function
|
|
1854
|
+
function zt({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, onApplied: a, extraDestinations: o }) {
|
|
1850
1855
|
let s = Q(), c = $(), l = c.scope, u = C(), [d, f] = j(null), [p, m] = j(new Set(i ?? [])), [h, g] = j(null), v = be(), y = /* @__PURE__ */ new Map();
|
|
1851
1856
|
e.destinationIds.forEach((e) => {
|
|
1852
1857
|
let t = v[e];
|
|
@@ -1864,7 +1869,7 @@ function It({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
|
|
|
1864
1869
|
storageProvider: l?.storageProvider ?? null,
|
|
1865
1870
|
proxyFetch: u
|
|
1866
1871
|
}, n);
|
|
1867
|
-
m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n,
|
|
1872
|
+
m((e) => new Set(e).add(i)), a?.(i), d?.id && c.commitEntityChat(e.id, d.id, r, l?.id, n, Rt(e, n));
|
|
1868
1873
|
} catch (e) {
|
|
1869
1874
|
g(e instanceof Error ? e.message : String(e));
|
|
1870
1875
|
} finally {
|
|
@@ -1897,16 +1902,16 @@ function It({ manifest: e, result: t, meta: n, taskId: r, initiallyApplied: i, o
|
|
|
1897
1902
|
}
|
|
1898
1903
|
//#endregion
|
|
1899
1904
|
//#region src/presentation/reports/subagentReportRegistry.tsx
|
|
1900
|
-
var
|
|
1901
|
-
function
|
|
1902
|
-
Object.assign(
|
|
1905
|
+
var Bt = {};
|
|
1906
|
+
function Vt(e) {
|
|
1907
|
+
Object.assign(Bt, e);
|
|
1903
1908
|
}
|
|
1904
|
-
function
|
|
1905
|
-
return
|
|
1909
|
+
function Ht(e) {
|
|
1910
|
+
return Bt[e];
|
|
1906
1911
|
}
|
|
1907
1912
|
//#endregion
|
|
1908
1913
|
//#region src/presentation/reports/GenericResultPreview.tsx
|
|
1909
|
-
function
|
|
1914
|
+
function Ut({ result: e }) {
|
|
1910
1915
|
let [t, n] = j(!1);
|
|
1911
1916
|
return /* @__PURE__ */ P("div", {
|
|
1912
1917
|
className: `relative cursor-pointer rounded-md border border-border/60 ${t ? "max-h-80 overflow-y-auto" : "max-h-28 overflow-hidden"}`,
|
|
@@ -1923,7 +1928,7 @@ function Bt({ result: e }) {
|
|
|
1923
1928
|
}
|
|
1924
1929
|
//#endregion
|
|
1925
1930
|
//#region src/presentation/liveAnchorDestination.ts
|
|
1926
|
-
function
|
|
1931
|
+
function Wt(e, t, n) {
|
|
1927
1932
|
return e.length === 0 ? null : {
|
|
1928
1933
|
id: "live-component",
|
|
1929
1934
|
label: "Applica al componente aperto",
|
|
@@ -1934,38 +1939,38 @@ function Vt(e, t, n) {
|
|
|
1934
1939
|
}
|
|
1935
1940
|
//#endregion
|
|
1936
1941
|
//#region src/presentation/subagentControls.ts
|
|
1937
|
-
var
|
|
1938
|
-
function
|
|
1939
|
-
Object.assign(
|
|
1942
|
+
var Gt = {};
|
|
1943
|
+
function Kt(e) {
|
|
1944
|
+
Object.assign(Gt, e);
|
|
1940
1945
|
}
|
|
1941
|
-
function
|
|
1942
|
-
return
|
|
1946
|
+
function qt(e) {
|
|
1947
|
+
return Gt[e];
|
|
1943
1948
|
}
|
|
1944
1949
|
//#endregion
|
|
1945
1950
|
//#region src/presentation/chatTitles.ts
|
|
1946
|
-
function
|
|
1947
|
-
let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim()).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
|
|
1951
|
+
function Jt(e, t = 6e3) {
|
|
1952
|
+
let n = e.filter((e) => (e.kind === "user" || e.kind === "thinking") && e.detail?.trim() && !ze(e)).map((e) => `${e.kind === "user" ? "Person" : "Agent"}: ${e.detail.trim()}`).join("\n\n");
|
|
1948
1953
|
return n.length > t ? `${n.slice(0, t * .7)}\n\n[…]\n\n${n.slice(-t * .3)}` : n;
|
|
1949
1954
|
}
|
|
1950
|
-
function
|
|
1955
|
+
function Yt(e) {
|
|
1951
1956
|
return (e.trim().split("\n").map((e) => e.trim()).find(Boolean) ?? "").replace(/^(title|titolo)\s*:\s*/i, "").replace(/^#+\s*/, "").replace(/^["'«“]+|["'»”]+$/g, "").replace(/[.。]+$/, "").trim().slice(0, 80);
|
|
1952
1957
|
}
|
|
1953
|
-
function
|
|
1958
|
+
function Xt(e, t) {
|
|
1954
1959
|
try {
|
|
1955
1960
|
return e.definition.executor?.catalogProviders?.(e.toParams(t));
|
|
1956
1961
|
} catch {
|
|
1957
1962
|
return;
|
|
1958
1963
|
}
|
|
1959
1964
|
}
|
|
1960
|
-
function
|
|
1961
|
-
let a =
|
|
1965
|
+
function Zt(e, t, n, r, i) {
|
|
1966
|
+
let a = Xt(e, t), o = (e) => {
|
|
1962
1967
|
let t = e ? v(e) : null;
|
|
1963
1968
|
return !(!t || !i[t.provider] || a && !a.includes(t.provider));
|
|
1964
1969
|
};
|
|
1965
1970
|
return o(n) ? n : Object.values(r).flat().map((e) => e.id).find(o);
|
|
1966
1971
|
}
|
|
1967
|
-
function
|
|
1968
|
-
let t = b()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } =
|
|
1972
|
+
function Qt(e) {
|
|
1973
|
+
let t = b()?.registry ?? {}, { modelsByProvider: n, selectedModel: r } = Tt(), i = A({
|
|
1969
1974
|
registry: t,
|
|
1970
1975
|
modelsByProvider: n,
|
|
1971
1976
|
selectedModel: r
|
|
@@ -1977,18 +1982,18 @@ function Yt(e) {
|
|
|
1977
1982
|
};
|
|
1978
1983
|
let a = A(/* @__PURE__ */ new Set()), o = T(async (t, n, r) => {
|
|
1979
1984
|
if (!e) return !1;
|
|
1980
|
-
let o =
|
|
1981
|
-
if (!o || !s?.autoTitle || o.name || !
|
|
1982
|
-
let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f =
|
|
1985
|
+
let o = Me(e, t, n), s = H(t), c = `${e}:${t}:${n}`;
|
|
1986
|
+
if (!o || !s?.autoTitle || o.name || !Re(o) || a.current.has(c)) return !1;
|
|
1987
|
+
let { registry: l, modelsByProvider: u, selectedModel: d } = i.current, f = Zt(s, o.params, r ?? d, u, l), p = f ? v(f) : null;
|
|
1983
1988
|
if (!p) return !1;
|
|
1984
1989
|
a.current.add(c);
|
|
1985
1990
|
try {
|
|
1986
1991
|
let r = await l[p.provider].complete({
|
|
1987
|
-
prompt: X().chatTitle.replace("{chat}",
|
|
1992
|
+
prompt: X().chatTitle.replace("{chat}", Jt(o.activity)),
|
|
1988
1993
|
model: p.model,
|
|
1989
1994
|
history: []
|
|
1990
|
-
}), i = r && r.type === "text" ?
|
|
1991
|
-
return i ?
|
|
1995
|
+
}), i = r && r.type === "text" ? Yt(r.text) : "";
|
|
1996
|
+
return i ? Be(e, t, n, i, "model") : !1;
|
|
1992
1997
|
} catch {
|
|
1993
1998
|
return !1;
|
|
1994
1999
|
} finally {
|
|
@@ -1996,12 +2001,12 @@ function Yt(e) {
|
|
|
1996
2001
|
}
|
|
1997
2002
|
}, [e]), s = Object.keys(n).length > 0;
|
|
1998
2003
|
return D(() => {
|
|
1999
|
-
e && s &&
|
|
2000
|
-
for (let t of
|
|
2004
|
+
e && s && !$t.has(e) && ($t.add(e), (async () => {
|
|
2005
|
+
for (let t of Ue(e)) {
|
|
2001
2006
|
let n = H(t.subagentId);
|
|
2002
2007
|
if (n?.autoTitle) {
|
|
2003
|
-
if (n.definition.conversational && !
|
|
2004
|
-
|
|
2008
|
+
if (n.definition.conversational && !Re(t)) {
|
|
2009
|
+
He(e, t.subagentId, t.entityId);
|
|
2005
2010
|
continue;
|
|
2006
2011
|
}
|
|
2007
2012
|
t.name || await o(t.subagentId, t.entityId);
|
|
@@ -2014,11 +2019,11 @@ function Yt(e) {
|
|
|
2014
2019
|
o
|
|
2015
2020
|
]), o;
|
|
2016
2021
|
}
|
|
2017
|
-
var
|
|
2018
|
-
function
|
|
2019
|
-
let c =
|
|
2022
|
+
var $t = /* @__PURE__ */ new Set(), en = () => ({});
|
|
2023
|
+
function tn({ manifest: e, params: t, extraDestinations: n, precedingActivity: r, taskId: i, resumeSeed: a, model: o, openingMessage: s }) {
|
|
2024
|
+
let c = Mt(e.definition, { defaultEnabled: !0 }), l = $(), u = l.scope, d = C(), f = A(i ?? `subagent-${e.id}-${crypto.randomUUID()}`).current, [p, m] = j(null), h = (t) => {
|
|
2020
2025
|
e.definition.conversational || m(t);
|
|
2021
|
-
}, [g, _] = j([]), [v, y] = j(null), b =
|
|
2026
|
+
}, [g, _] = j([]), [v, y] = j(null), b = Ht(e.id), x = b?.kind === "selection" ? b : null, [S, w] = j(null), T = A(!1), E = A(0), O = A(null);
|
|
2022
2027
|
p && p !== O.current && (O.current = p, E.current = (r?.length ?? 0) + c.activity.length);
|
|
2023
2028
|
let F = A(!1), ee = c.remote || !c.hasProviders || c.selectedModel !== "";
|
|
2024
2029
|
D(() => {
|
|
@@ -2042,7 +2047,7 @@ function Qt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2042
2047
|
...t,
|
|
2043
2048
|
pinnedEntityId: r
|
|
2044
2049
|
}).then((n) => {
|
|
2045
|
-
n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t,
|
|
2050
|
+
n?.id && l.commitEntityChat(e.id, n.id, f, u.id, t, Rt(e, t));
|
|
2046
2051
|
}).catch((e) => y(e instanceof Error ? e.message : String(e))));
|
|
2047
2052
|
});
|
|
2048
2053
|
}, [
|
|
@@ -2061,34 +2066,34 @@ function Qt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2061
2066
|
p,
|
|
2062
2067
|
x,
|
|
2063
2068
|
S
|
|
2064
|
-
]), z = k(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = k(() =>
|
|
2069
|
+
]), z = k(() => l.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [l.componentAnchors, e.id]), B = k(() => Wt(z, t, f), [
|
|
2065
2070
|
z,
|
|
2066
2071
|
t,
|
|
2067
2072
|
f
|
|
2068
|
-
]), te = k(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H =
|
|
2073
|
+
]), te = k(() => B ? [B, ...n ?? []] : n, [B, n]), V = e.chatEntityId?.(t), H = Qt(u?.id), U = A(!1), W = A(!1);
|
|
2069
2074
|
D(() => {
|
|
2070
|
-
let n = U.current && !c.running;
|
|
2071
|
-
if (U.current = c.running, !n || !V || !u) return;
|
|
2075
|
+
let n = !U.current && c.running, i = U.current && !c.running;
|
|
2076
|
+
if (U.current = c.running, !n && !i || !V || !u) return;
|
|
2072
2077
|
if (W.current) {
|
|
2073
|
-
W.current = !1;
|
|
2078
|
+
i && (W.current = !1);
|
|
2074
2079
|
return;
|
|
2075
2080
|
}
|
|
2076
|
-
let
|
|
2077
|
-
if (!
|
|
2078
|
-
let
|
|
2079
|
-
e.autoTitle && e.definition.conversational && !
|
|
2081
|
+
let a = c.snapshot();
|
|
2082
|
+
if (!a) return;
|
|
2083
|
+
let o = [...r ?? [], ...a.activity];
|
|
2084
|
+
e.autoTitle && e.definition.conversational && !Re({ activity: o }) || (Ne({
|
|
2080
2085
|
scopeId: u.id,
|
|
2081
2086
|
subagentId: e.id,
|
|
2082
2087
|
entityId: V,
|
|
2083
2088
|
params: t,
|
|
2084
|
-
title:
|
|
2085
|
-
history:
|
|
2086
|
-
activity:
|
|
2087
|
-
}), e.autoTitle && H(e.id, V, c.selectedModel));
|
|
2089
|
+
title: Rt(e, t),
|
|
2090
|
+
history: a.history,
|
|
2091
|
+
activity: o
|
|
2092
|
+
}), i && e.autoTitle && H(e.id, V, c.selectedModel));
|
|
2088
2093
|
}, [c.running]);
|
|
2089
2094
|
let G = () => {
|
|
2090
2095
|
F.current = !0, c.running && c.stop(), l.closeTask(f);
|
|
2091
|
-
}, K = A(
|
|
2096
|
+
}, K = A(qt(e.id) ?? en).current, q = K({
|
|
2092
2097
|
params: t,
|
|
2093
2098
|
taskId: f,
|
|
2094
2099
|
running: c.running,
|
|
@@ -2099,7 +2104,7 @@ function Qt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2099
2104
|
return D(() => {
|
|
2100
2105
|
F.current || l.openTask({
|
|
2101
2106
|
id: f,
|
|
2102
|
-
title:
|
|
2107
|
+
title: Rt(e, t),
|
|
2103
2108
|
icon: e.icon,
|
|
2104
2109
|
agent: c,
|
|
2105
2110
|
onApplied: (e) => h(e),
|
|
@@ -2118,12 +2123,12 @@ function Qt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2118
2123
|
}) : b?.kind === "editable" ? /* @__PURE__ */ N(b.Report, {
|
|
2119
2124
|
result: p,
|
|
2120
2125
|
onResultChange: L
|
|
2121
|
-
}) : /* @__PURE__ */ N(
|
|
2126
|
+
}) : /* @__PURE__ */ N(Ut, { result: R }),
|
|
2122
2127
|
v && /* @__PURE__ */ P("p", {
|
|
2123
2128
|
className: "text-xs text-destructive",
|
|
2124
2129
|
children: ["Salvataggio automatico non riuscito: ", v]
|
|
2125
2130
|
}),
|
|
2126
|
-
/* @__PURE__ */ N(
|
|
2131
|
+
/* @__PURE__ */ N(zt, {
|
|
2127
2132
|
manifest: e,
|
|
2128
2133
|
result: R,
|
|
2129
2134
|
meta: t,
|
|
@@ -2164,14 +2169,14 @@ function Qt({ manifest: e, params: t, extraDestinations: n, precedingActivity: r
|
|
|
2164
2169
|
}
|
|
2165
2170
|
//#endregion
|
|
2166
2171
|
//#region src/presentation/OrchestratorRunner.tsx
|
|
2167
|
-
function
|
|
2168
|
-
let t = Q(), n =
|
|
2172
|
+
function nn({ userGoal: e }) {
|
|
2173
|
+
let t = Q(), n = Mt(k(() => Lt({
|
|
2169
2174
|
unavailable: t.orchestratorUnavailable,
|
|
2170
2175
|
continueWithoutAi: t.orchestratorContinueWithoutAi,
|
|
2171
2176
|
preparing: t.orchestratorPreparing,
|
|
2172
2177
|
collecting: t.orchestratorCollecting
|
|
2173
2178
|
}), []), { defaultEnabled: !0 }), r = $(), [i, a] = j(null), o = A(!1), s = !n.hasProviders || n.selectedModel !== "", c = A(r.pendingExtraDestinations), l = A(r.pendingAttachments), u = A(r.pendingModel), d = A(r.pendingScopedSubagentId ?? r.scopedSubagentId ?? void 0), f = A(r.pendingCarryOver), p = A(!1), m = (e) => {
|
|
2174
|
-
e && typeof e == "object" && e.kind === "handoff" && (a(e), r.closeTask(
|
|
2179
|
+
e && typeof e == "object" && e.kind === "handoff" && (a(e), r.closeTask(Ke));
|
|
2175
2180
|
};
|
|
2176
2181
|
D(() => {
|
|
2177
2182
|
!o.current && s && (o.current = !0, u.current && n.setSelectedModel(u.current), n.run({
|
|
@@ -2187,7 +2192,7 @@ function $t({ userGoal: e }) {
|
|
|
2187
2192
|
}));
|
|
2188
2193
|
}, [s]), D(() => {
|
|
2189
2194
|
p.current || r.openTask({
|
|
2190
|
-
id:
|
|
2195
|
+
id: Ke,
|
|
2191
2196
|
title: "Agentico",
|
|
2192
2197
|
icon: "bot",
|
|
2193
2198
|
agent: n,
|
|
@@ -2195,7 +2200,7 @@ function $t({ userGoal: e }) {
|
|
|
2195
2200
|
scopedSubagentId: d.current,
|
|
2196
2201
|
precedingActivity: f.current?.activity,
|
|
2197
2202
|
onDismiss: () => {
|
|
2198
|
-
p.current = !0, n.running && n.stop(), r.closeTask(
|
|
2203
|
+
p.current = !0, n.running && n.stop(), r.closeTask(Ke);
|
|
2199
2204
|
}
|
|
2200
2205
|
});
|
|
2201
2206
|
}, [
|
|
@@ -2208,12 +2213,12 @@ function $t({ userGoal: e }) {
|
|
|
2208
2213
|
n.hasProviders,
|
|
2209
2214
|
r.openTask
|
|
2210
2215
|
]), D(() => () => {
|
|
2211
|
-
r.closeTask(
|
|
2216
|
+
r.closeTask(Ke);
|
|
2212
2217
|
}, [r.closeTask]);
|
|
2213
2218
|
let h = k(() => [...f.current?.activity ?? [], ...n.activity], [n.activity]);
|
|
2214
2219
|
if (!i) return null;
|
|
2215
2220
|
let g = H(i.subagentId);
|
|
2216
|
-
return g ? /* @__PURE__ */ N(
|
|
2221
|
+
return g ? /* @__PURE__ */ N(tn, {
|
|
2217
2222
|
manifest: g,
|
|
2218
2223
|
params: i.params,
|
|
2219
2224
|
extraDestinations: c.current,
|
|
@@ -2224,8 +2229,8 @@ function $t({ userGoal: e }) {
|
|
|
2224
2229
|
}
|
|
2225
2230
|
//#endregion
|
|
2226
2231
|
//#region src/presentation/ManualEntryRunner.tsx
|
|
2227
|
-
function
|
|
2228
|
-
let r =
|
|
2232
|
+
function rn({ manifest: e, extraDestinations: n }) {
|
|
2233
|
+
let r = Mt(e.definition, { defaultEnabled: !1 }), i = Q(), a = $(), o = A(`manual-${e.id}-${crypto.randomUUID()}`).current, [s, c] = j(null), [l, u] = j([]), d = Ht(e.id), f = d?.kind === "selection" ? d : null, [p, m] = j(null), [h, g] = j(null), _ = A(!1), v = (t) => {
|
|
2229
2234
|
if (!e.manualEntry) return;
|
|
2230
2235
|
let n;
|
|
2231
2236
|
try {
|
|
@@ -2252,7 +2257,7 @@ function en({ manifest: e, extraDestinations: n }) {
|
|
|
2252
2257
|
p
|
|
2253
2258
|
]), S = (e) => {
|
|
2254
2259
|
u((t) => t.includes(e) ? t : [...t, e]);
|
|
2255
|
-
}, C = k(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = k(() => h ?
|
|
2260
|
+
}, C = k(() => a.componentAnchors.filter((t) => t.subagentId === e.id && t.onResult), [a.componentAnchors, e.id]), w = k(() => h ? Wt(C, h, o) : null, [
|
|
2256
2261
|
C,
|
|
2257
2262
|
h,
|
|
2258
2263
|
o
|
|
@@ -2281,8 +2286,8 @@ function en({ manifest: e, extraDestinations: n }) {
|
|
|
2281
2286
|
}) : d?.kind === "editable" ? /* @__PURE__ */ N(d.Report, {
|
|
2282
2287
|
result: s,
|
|
2283
2288
|
onResultChange: b
|
|
2284
|
-
}) : /* @__PURE__ */ N(
|
|
2285
|
-
/* @__PURE__ */ N(
|
|
2289
|
+
}) : /* @__PURE__ */ N(Ut, { result: x }),
|
|
2290
|
+
/* @__PURE__ */ N(zt, {
|
|
2286
2291
|
manifest: e,
|
|
2287
2292
|
result: x,
|
|
2288
2293
|
meta: h ?? {},
|
|
@@ -2319,7 +2324,7 @@ function en({ manifest: e, extraDestinations: n }) {
|
|
|
2319
2324
|
}
|
|
2320
2325
|
//#endregion
|
|
2321
2326
|
//#region src/presentation/Agentico.tsx
|
|
2322
|
-
function
|
|
2327
|
+
function an(e, t) {
|
|
2323
2328
|
return Object.values(e).flat().map((e) => {
|
|
2324
2329
|
let n = t?.(e.provider, e.providerLabel ?? e.provider);
|
|
2325
2330
|
return {
|
|
@@ -2331,7 +2336,7 @@ function tn(e, t) {
|
|
|
2331
2336
|
};
|
|
2332
2337
|
});
|
|
2333
2338
|
}
|
|
2334
|
-
function
|
|
2339
|
+
function on({ task: e }) {
|
|
2335
2340
|
let t = Q(), [n, r] = j(""), { agent: i, onApplied: a, manualEntry: s } = e, c = i.running, l = (e) => {
|
|
2336
2341
|
if (r(""), s) {
|
|
2337
2342
|
s.onSubmit(e.text);
|
|
@@ -2343,7 +2348,7 @@ function nn({ task: e }) {
|
|
|
2343
2348
|
}).then((e) => {
|
|
2344
2349
|
e && a(e);
|
|
2345
2350
|
});
|
|
2346
|
-
}, u = !!s || i.remote && i.remoteModels.length === 0, d = i.alongside && i.remoteModels.some((e) => e.value === i.selectedModel), f = !u && !i.remote && !d && i.hasProviders && !i.selectedModel, p = u ? [] : i.remote ? i.remoteModels : i.alongside ? [...i.remoteModels, ...
|
|
2351
|
+
}, u = !!s || i.remote && i.remoteModels.length === 0, d = i.alongside && i.remoteModels.some((e) => e.value === i.selectedModel), f = !u && !i.remote && !d && i.hasProviders && !i.selectedModel, p = u ? [] : i.remote ? i.remoteModels : i.alongside ? [...i.remoteModels, ...an(i.modelsByProvider, i.catalogGroup)] : an(i.modelsByProvider);
|
|
2347
2352
|
return /* @__PURE__ */ N(o, {
|
|
2348
2353
|
value: n,
|
|
2349
2354
|
onChange: r,
|
|
@@ -2363,8 +2368,8 @@ function nn({ task: e }) {
|
|
|
2363
2368
|
maxHeight: 220
|
|
2364
2369
|
});
|
|
2365
2370
|
}
|
|
2366
|
-
function
|
|
2367
|
-
let { startOrchestrator: e } = $(), t = Q(), [n, r] = j(""), { hasProviders: i, modelsByProvider: a, selectedModel: s, setSelectedModel: c } =
|
|
2371
|
+
function sn() {
|
|
2372
|
+
let { startOrchestrator: e } = $(), t = Q(), [n, r] = j(""), { hasProviders: i, modelsByProvider: a, selectedModel: s, setSelectedModel: c } = Tt(), l = (t) => {
|
|
2368
2373
|
t.text.trim() && (e(t.text.trim(), {
|
|
2369
2374
|
attachments: t.files.length > 0 ? t.files : void 0,
|
|
2370
2375
|
model: t.model || void 0
|
|
@@ -2377,7 +2382,7 @@ function rn() {
|
|
|
2377
2382
|
disabled: !n.trim() || u,
|
|
2378
2383
|
onSubmit: l,
|
|
2379
2384
|
attachments: !0,
|
|
2380
|
-
models:
|
|
2385
|
+
models: an(a),
|
|
2381
2386
|
selectedModel: s,
|
|
2382
2387
|
onModelChange: c,
|
|
2383
2388
|
modelPlaceholder: t.selectModelPlaceholder,
|
|
@@ -2385,17 +2390,17 @@ function rn() {
|
|
|
2385
2390
|
maxHeight: 220
|
|
2386
2391
|
});
|
|
2387
2392
|
}
|
|
2388
|
-
function
|
|
2393
|
+
function cn({ chat: e, onClose: t }) {
|
|
2389
2394
|
let n = Q(), r = x();
|
|
2390
2395
|
return /* @__PURE__ */ N(p, {
|
|
2391
2396
|
title: n.renameChat,
|
|
2392
2397
|
size: "sm",
|
|
2393
2398
|
onClose: t,
|
|
2394
|
-
onSave: () => (
|
|
2399
|
+
onSave: () => (Be(e.scopeId, e.subagentId, e.entityId, String(r.record?.title ?? Le(e)), "person"), t(), Promise.resolve(!0)),
|
|
2395
2400
|
children: /* @__PURE__ */ P(u, {
|
|
2396
2401
|
appearance: "empty",
|
|
2397
2402
|
controller: r,
|
|
2398
|
-
defaultValues: { title:
|
|
2403
|
+
defaultValues: { title: Le(e) },
|
|
2399
2404
|
footer: !1,
|
|
2400
2405
|
children: [/* @__PURE__ */ N(f, {
|
|
2401
2406
|
name: "title",
|
|
@@ -2408,7 +2413,7 @@ function an({ chat: e, onClose: t }) {
|
|
|
2408
2413
|
})
|
|
2409
2414
|
});
|
|
2410
2415
|
}
|
|
2411
|
-
function
|
|
2416
|
+
function ln(e, t, n = Date.now()) {
|
|
2412
2417
|
let r = Math.round((e - n) / 1e3), i = new Intl.RelativeTimeFormat(t, {
|
|
2413
2418
|
numeric: "auto",
|
|
2414
2419
|
style: "short"
|
|
@@ -2420,7 +2425,7 @@ function on(e, t, n = Date.now()) {
|
|
|
2420
2425
|
]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
|
|
2421
2426
|
return i.format(0, "minute");
|
|
2422
2427
|
}
|
|
2423
|
-
function
|
|
2428
|
+
function un({ card: e }) {
|
|
2424
2429
|
let t = Q();
|
|
2425
2430
|
return e.humanSummaryOnly ? /* @__PURE__ */ P("div", {
|
|
2426
2431
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
@@ -2476,7 +2481,7 @@ function sn({ card: e }) {
|
|
|
2476
2481
|
]
|
|
2477
2482
|
});
|
|
2478
2483
|
}
|
|
2479
|
-
function
|
|
2484
|
+
function dn({ messages: e }) {
|
|
2480
2485
|
return /* @__PURE__ */ N("div", {
|
|
2481
2486
|
className: "space-y-2 rounded-lg border border-border/60 p-3",
|
|
2482
2487
|
children: e.map((e, t) => /* @__PURE__ */ N("p", {
|
|
@@ -2485,10 +2490,10 @@ function cn({ messages: e }) {
|
|
|
2485
2490
|
}, t))
|
|
2486
2491
|
});
|
|
2487
2492
|
}
|
|
2488
|
-
function
|
|
2493
|
+
function fn({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect: a, onNewChat: o, onArchivedCurrent: s }) {
|
|
2489
2494
|
let u = Q(), { locale: f } = S(), [p, m] = j(""), [h, g] = j(0);
|
|
2490
|
-
D(() =>
|
|
2491
|
-
let _ = k(() => r ?
|
|
2495
|
+
D(() => ke(() => g((e) => e + 1)), []);
|
|
2496
|
+
let _ = k(() => r ? Ue(e) : [], [
|
|
2492
2497
|
e,
|
|
2493
2498
|
r,
|
|
2494
2499
|
h
|
|
@@ -2500,13 +2505,13 @@ function ln({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
2500
2505
|
} catch {
|
|
2501
2506
|
return;
|
|
2502
2507
|
}
|
|
2503
|
-
|
|
2508
|
+
He(e, t.subagentId, t.entityId), n === We(t.subagentId, t.entityId) && s(), g((e) => e + 1);
|
|
2504
2509
|
}
|
|
2505
2510
|
}, x = k(() => {
|
|
2506
2511
|
let e = p.trim().toLowerCase();
|
|
2507
2512
|
return e ? _.filter((t) => {
|
|
2508
2513
|
let n = H(t.subagentId)?.label ?? t.subagentId;
|
|
2509
|
-
return
|
|
2514
|
+
return Le(t).toLowerCase().includes(e) || n.toLowerCase().includes(e);
|
|
2510
2515
|
}) : _;
|
|
2511
2516
|
}, [_, p]);
|
|
2512
2517
|
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(c, {
|
|
@@ -2549,7 +2554,7 @@ function ln({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
2549
2554
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
2550
2555
|
children: _.length === 0 ? u.noSavedChats : u.noResults
|
|
2551
2556
|
}) : x.map((e) => {
|
|
2552
|
-
let t = H(e.subagentId), r = n ===
|
|
2557
|
+
let t = H(e.subagentId), r = n === We(e.subagentId, e.entityId);
|
|
2553
2558
|
return /* @__PURE__ */ N(l, {
|
|
2554
2559
|
icon: r ? "check" : t?.icon ?? "bot",
|
|
2555
2560
|
className: r ? "bg-accent font-semibold text-primary" : void 0,
|
|
@@ -2569,25 +2574,25 @@ function ln({ scopeId: e, currentTaskId: n, open: r, onOpenChange: i, onSelect:
|
|
|
2569
2574
|
className: "flex min-w-0 flex-1 items-center justify-between gap-2",
|
|
2570
2575
|
children: [/* @__PURE__ */ N("span", {
|
|
2571
2576
|
className: "min-w-0 truncate",
|
|
2572
|
-
title: `${t?.label ?? e.subagentId} · ${
|
|
2573
|
-
children:
|
|
2577
|
+
title: `${t?.label ?? e.subagentId} · ${Le(e)}`,
|
|
2578
|
+
children: Le(e)
|
|
2574
2579
|
}), /* @__PURE__ */ N("span", {
|
|
2575
2580
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
2576
|
-
title: `${u.chatStarted.replace("{at}", new Date(
|
|
2577
|
-
children:
|
|
2581
|
+
title: `${u.chatStarted.replace("{at}", new Date(Ve(e)).toLocaleString(f))} · ${u.chatLastMessage.replace("{at}", new Date(e.savedAt).toLocaleString(f))}`,
|
|
2582
|
+
children: ln(Ve(e), f)
|
|
2578
2583
|
})]
|
|
2579
2584
|
})
|
|
2580
2585
|
}, `${e.subagentId}:${e.entityId}`);
|
|
2581
2586
|
})
|
|
2582
|
-
}), v && /* @__PURE__ */ N(
|
|
2587
|
+
}), v && /* @__PURE__ */ N(cn, {
|
|
2583
2588
|
chat: v,
|
|
2584
2589
|
onClose: () => y(null)
|
|
2585
2590
|
})] });
|
|
2586
2591
|
}
|
|
2587
|
-
function
|
|
2592
|
+
function pn({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}) {
|
|
2588
2593
|
let { task: a, isOpen: o, pendingGoal: s, orchestratorRunId: c, pageContext: l, pageContextCard: u, anchoredUserMessages: d, pendingResume: f, resumeRunId: p, dismissForeignTask: m, resumeEntityChat: h, pendingManualEntry: g, manualEntryRunId: _, startManualEntry: v, pendingExtraDestinations: y, pendingResumeWithAI: b, resumeWithAIRunId: x, pendingStart: S, startRunId: C, scope: w } = $(), T = Q(), E = A(null), [O, k] = j(!1);
|
|
2589
|
-
|
|
2590
|
-
let F =
|
|
2594
|
+
Qt(w?.id);
|
|
2595
|
+
let F = yt({
|
|
2591
2596
|
defaultWidth: e,
|
|
2592
2597
|
minWidth: n,
|
|
2593
2598
|
maxWidth: r,
|
|
@@ -2599,7 +2604,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2599
2604
|
onAnswer: (e, t, n) => a.agent.answerQuestions(e, t, n).then((e) => {
|
|
2600
2605
|
e && a.onApplied(e);
|
|
2601
2606
|
})
|
|
2602
|
-
} : void 0, W = U ?
|
|
2607
|
+
} : void 0, W = U ? at(I, U.canAnswer) : null, G = a?.id === "agentico-orchestrator" && a.scopedSubagentId ? H(a.scopedSubagentId) : void 0, K = G?.manualEntry ? G : null, q = A(!0);
|
|
2603
2608
|
D(() => {
|
|
2604
2609
|
let e = E.current;
|
|
2605
2610
|
if (!e) return;
|
|
@@ -2629,22 +2634,22 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2629
2634
|
});
|
|
2630
2635
|
return n.observe(t), () => n.disconnect();
|
|
2631
2636
|
}, [a?.id, o]);
|
|
2632
|
-
let Y = s ? /* @__PURE__ */ N(
|
|
2637
|
+
let Y = s ? /* @__PURE__ */ N(nn, { userGoal: s }, c) : null, re = f ? H(f.subagentId) : void 0, ie = f && re ? /* @__PURE__ */ N(tn, {
|
|
2633
2638
|
manifest: re,
|
|
2634
2639
|
params: f.snapshot.params,
|
|
2635
|
-
taskId:
|
|
2640
|
+
taskId: We(f.subagentId, f.entityId),
|
|
2636
2641
|
resumeSeed: {
|
|
2637
2642
|
history: f.snapshot.history,
|
|
2638
2643
|
activity: f.snapshot.activity
|
|
2639
2644
|
}
|
|
2640
|
-
}, p) : null, X = g ? H(g.subagentId) : void 0, ae = g && X ? /* @__PURE__ */ N(
|
|
2645
|
+
}, p) : null, X = g ? H(g.subagentId) : void 0, ae = g && X ? /* @__PURE__ */ N(rn, {
|
|
2641
2646
|
manifest: X,
|
|
2642
2647
|
extraDestinations: g.extraDestinations
|
|
2643
|
-
}, _) : null, oe = b ? H(b.subagentId) : void 0, se = b && oe ? /* @__PURE__ */ N(
|
|
2648
|
+
}, _) : null, oe = b ? H(b.subagentId) : void 0, se = b && oe ? /* @__PURE__ */ N(tn, {
|
|
2644
2649
|
manifest: oe,
|
|
2645
2650
|
params: b.params,
|
|
2646
2651
|
extraDestinations: b.extraDestinations
|
|
2647
|
-
}, x) : null, Z = S ? H(S.subagentId) : void 0, ce = S && Z ? /* @__PURE__ */ N(
|
|
2652
|
+
}, x) : null, Z = S ? H(S.subagentId) : void 0, ce = S && Z ? /* @__PURE__ */ N(tn, {
|
|
2648
2653
|
manifest: Z,
|
|
2649
2654
|
params: S.params,
|
|
2650
2655
|
taskId: S.taskId,
|
|
@@ -2660,7 +2665,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2660
2665
|
style: { width: F.width },
|
|
2661
2666
|
className: "relative flex h-full shrink-0 flex-col border-l border-border bg-background",
|
|
2662
2667
|
children: [
|
|
2663
|
-
/* @__PURE__ */ N(
|
|
2668
|
+
/* @__PURE__ */ N(bt, {
|
|
2664
2669
|
width: F.width,
|
|
2665
2670
|
min: F.min,
|
|
2666
2671
|
max: F.max,
|
|
@@ -2675,7 +2680,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2675
2680
|
className: "min-w-0 flex-1 truncate text-lg font-semibold leading-tight",
|
|
2676
2681
|
children: a ? a.title : "Agentico"
|
|
2677
2682
|
}),
|
|
2678
|
-
w && /* @__PURE__ */ N(
|
|
2683
|
+
w && /* @__PURE__ */ N(fn, {
|
|
2679
2684
|
scopeId: w.id,
|
|
2680
2685
|
currentTaskId: a?.id ?? null,
|
|
2681
2686
|
open: O,
|
|
@@ -2684,7 +2689,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2684
2689
|
onSelect: (e, t, n) => h(e, t, n),
|
|
2685
2690
|
onArchivedCurrent: m
|
|
2686
2691
|
}),
|
|
2687
|
-
/* @__PURE__ */ N(
|
|
2692
|
+
/* @__PURE__ */ N(xt, {})
|
|
2688
2693
|
]
|
|
2689
2694
|
}),
|
|
2690
2695
|
/* @__PURE__ */ N("div", {
|
|
@@ -2698,7 +2703,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2698
2703
|
className: "text-xs text-muted-foreground",
|
|
2699
2704
|
children: a.manualEntry.prompt
|
|
2700
2705
|
}),
|
|
2701
|
-
/* @__PURE__ */ N(
|
|
2706
|
+
/* @__PURE__ */ N(lt, {
|
|
2702
2707
|
activity: z,
|
|
2703
2708
|
questions: U,
|
|
2704
2709
|
docked: W,
|
|
@@ -2708,7 +2713,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2708
2713
|
className: "mt-3",
|
|
2709
2714
|
children: a.panelExtra
|
|
2710
2715
|
}),
|
|
2711
|
-
B.length > 0 && /* @__PURE__ */ N(
|
|
2716
|
+
B.length > 0 && /* @__PURE__ */ N(lt, {
|
|
2712
2717
|
activity: B,
|
|
2713
2718
|
questions: U,
|
|
2714
2719
|
docked: W,
|
|
@@ -2726,7 +2731,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2726
2731
|
variant: "secondary",
|
|
2727
2732
|
className: "shrink-0",
|
|
2728
2733
|
onClick: () => {
|
|
2729
|
-
a.agent.sendMessage(T.retryMessage).then((e) => {
|
|
2734
|
+
a.agent.sendMessage(T.retryMessage, { retry: !0 }).then((e) => {
|
|
2730
2735
|
e && a.onApplied(e);
|
|
2731
2736
|
});
|
|
2732
2737
|
}
|
|
@@ -2746,7 +2751,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2746
2751
|
})
|
|
2747
2752
|
]
|
|
2748
2753
|
})
|
|
2749
|
-
] }) : d.length > 0 ? /* @__PURE__ */ N(
|
|
2754
|
+
] }) : d.length > 0 ? /* @__PURE__ */ N(dn, { messages: d }) : u ? /* @__PURE__ */ N(un, { card: u }) : /* @__PURE__ */ N("p", {
|
|
2750
2755
|
className: "text-xs text-muted-foreground",
|
|
2751
2756
|
children: l ?? T.orchestratorStarterHint
|
|
2752
2757
|
})
|
|
@@ -2762,7 +2767,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2762
2767
|
}),
|
|
2763
2768
|
/* @__PURE__ */ N("div", {
|
|
2764
2769
|
className: "min-h-0 overflow-y-auto px-4 py-3",
|
|
2765
|
-
children: /* @__PURE__ */ N(
|
|
2770
|
+
children: /* @__PURE__ */ N(ot, {
|
|
2766
2771
|
entry: W.entry,
|
|
2767
2772
|
part: W.part,
|
|
2768
2773
|
questions: U,
|
|
@@ -2784,7 +2789,7 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2784
2789
|
children: [a?.panelActions && /* @__PURE__ */ N("div", {
|
|
2785
2790
|
className: "mb-2",
|
|
2786
2791
|
children: a.panelActions
|
|
2787
|
-
}), a ? /* @__PURE__ */ N(
|
|
2792
|
+
}), a ? /* @__PURE__ */ N(on, { task: a }, a.id) : /* @__PURE__ */ N(sn, {})]
|
|
2788
2793
|
})
|
|
2789
2794
|
]
|
|
2790
2795
|
})
|
|
@@ -2798,13 +2803,13 @@ function un({ defaultWidth: e, minWidth: n, maxWidth: r, onWidthChange: i } = {}
|
|
|
2798
2803
|
}
|
|
2799
2804
|
//#endregion
|
|
2800
2805
|
//#region src/presentation/useAgenticoPageContext.ts
|
|
2801
|
-
function
|
|
2806
|
+
function mn(e, t) {
|
|
2802
2807
|
let { setPageContext: n } = $(), r = A(crypto.randomUUID()).current;
|
|
2803
2808
|
D(() => (n(r, e, t ?? null), () => n(r, null)), [e, t]);
|
|
2804
2809
|
}
|
|
2805
2810
|
//#endregion
|
|
2806
2811
|
//#region src/presentation/useSubagentComponentContext.ts
|
|
2807
|
-
function
|
|
2812
|
+
function hn(e, t, n, r, i = !0, a) {
|
|
2808
2813
|
let { registerComponentAnchor: o } = $(), s = A(crypto.randomUUID()).current, c = A(n);
|
|
2809
2814
|
c.current = n, D(() => {
|
|
2810
2815
|
if (i) return o(s, {
|
|
@@ -2823,6 +2828,6 @@ function fn(e, t, n, r, i = !0, a) {
|
|
|
2823
2828
|
]);
|
|
2824
2829
|
}
|
|
2825
2830
|
//#endregion
|
|
2826
|
-
export {
|
|
2831
|
+
export { ft as AGENTICO_MAX_WIDTH, dt as AGENTICO_MIN_WIDTH, ut as AGENTICO_WIDTH, pt as AGENTICO_WIDTH_STORAGE_KEY, pn as Agentico, Je as AgenticoProvider, xt as AgenticoToggle, ee as DEFAULT_REASONING_PART_ID, F as DEFAULT_TEXT_PART_ID, ge as JSON_EXPORT_DESTINATION_ID, de as MICRO_PROMPT_REGISTRY, Ke as ORCHESTRATOR_TASK_ID, ue as SUMMARY_MICRO_PROMPT, Ce as agenticoDe, xe as agenticoEn, Se as agenticoIt, J as agenticoPromptsEn, Y as agenticoPromptsIt, Ge as agenticoTranslations, fe as applyMicroPrompts, Re as chatHasPersonMessage, Ve as chatStartedAt, Le as chatTitle, ie as configureAgenticoPrompts, Te as configureEntityChatStore, G as createCrossAgentTools, z as defineSubagent, We as entityChatTaskId, pe as extractErrorMessage, me as extractJsonBlock, H as findSubagentManifest, R as formatQuestionAnswers, X as getAgenticoPrompts, be as getDestinationRegistry, Me as getEntityChat, qt as getSubagentControls, V as getSubagentRegistry, Ht as getSubagentReport, _e as jsonExportDestination, Ue as listEntityChats, L as messagePartsText, ke as onEntityChatsChange, W as registerCrossAgentTools, ye as registerDestinations, Kt as registerSubagentControls, Vt as registerSubagentReports, te as registerSubagents, He as removeEntityChat, Be as renameEntityChat, le as renderRegistryCli, ce as renderSubagentCli, ae as resetAgenticoPrompts, Ne as saveEntityChat, K as toJsonSchema, q as toMcpTool, I as upsertMessagePart, Mt as useAgent, $ as useAgentico, Q as useAgenticoI18n, mn as useAgenticoPageContext, hn as useSubagentComponentContext };
|
|
2827
2832
|
|
|
2828
2833
|
//# sourceMappingURL=index.mjs.map
|