bazilion 0.54.0 → 0.56.0
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/cli.js +201 -41
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +1561 -522
- package/dist/daemon.js.map +1 -1
- package/dist/web/client/assets/AddProviderDialog-DZ9mXFdq.js +1 -0
- package/dist/web/client/assets/AgentTemplateParts-BfG3a-ri.js +1 -0
- package/dist/web/client/assets/{Button-UiegBKOK.js → Button-CoKQRO-s.js} +1 -1
- package/dist/web/client/assets/ConfigPage-Ch-DSJUO.js +1 -0
- package/dist/web/client/assets/ConfirmDialog-B_jXAPmh.js +1 -0
- package/dist/web/client/assets/ConnectionsView-D1Liebtf.js +1 -0
- package/dist/web/client/assets/ManagePage-kd7iWYEL.js +1 -0
- package/dist/web/client/assets/SectionTabs-Dc0bNn-J.js +1 -0
- package/dist/web/client/assets/{Segmented-MYKKTuZO.js → Segmented-iylzLwE6.js} +1 -1
- package/dist/web/client/assets/SkillsParts-C5T7sYDA.js +1 -0
- package/dist/web/client/assets/{SpawnTeamModal-DG5UbJNK.js → SpawnTeamModal-DatFF4f_.js} +1 -1
- package/dist/web/client/assets/{TeamForm-DGlxWv4e.js → TeamForm-l-N_PYeE.js} +1 -1
- package/dist/web/client/assets/TeamThread-BWmIQiAh.js +1 -0
- package/dist/web/client/assets/{UnsavedChangesGuard-BmdwLH99.js → UnsavedChangesGuard-vQBdMl8h.js} +1 -1
- package/dist/web/client/assets/_id-C6SADaiD.js +1 -0
- package/dist/web/client/assets/_id-CC9r0qsr.js +1 -0
- package/dist/web/client/assets/{access-C8d8vaQ6.js → access-BbQFbTPh.js} +1 -1
- package/dist/web/client/assets/{agent-actions-BgE9fKHH.js → agent-actions-B-9KIwn6.js} +1 -1
- package/dist/web/client/assets/agents-BXwzmHu8.js +1 -0
- package/dist/web/client/assets/agents-BtETzVIY.js +1 -0
- package/dist/web/client/assets/arrow-right-BqqfPqVi.js +1 -0
- package/dist/web/client/assets/attention-BMrZJ9ui.js +1 -0
- package/dist/web/client/assets/{bot-Bb--PFVU.js → bot-BHky7KAX.js} +1 -1
- package/dist/web/client/assets/chart-column-DTsDbzL0.js +1 -0
- package/dist/web/client/assets/chevron-right-D1shxvdo.js +1 -0
- package/dist/web/client/assets/config-B2ZDYo52.js +1 -0
- package/dist/web/client/assets/createLucideIcon-CZHSSDYA.js +1 -0
- package/dist/web/client/assets/{download-C4t9l5wR.js → download-Dr0PgyMr.js} +1 -1
- package/dist/web/client/assets/es2015-D1pnOGPG.js +41 -0
- package/dist/web/client/assets/{file-text-DzbjpYrV.js → file-text-D6OTHixJ.js} +1 -1
- package/dist/web/client/assets/{images-DSYgPKM7.js → images-BULrW-FC.js} +1 -1
- package/dist/web/client/assets/index-B-N6NIX4.js +14 -0
- package/dist/web/client/assets/{key-round-BpK4-E3T.js → key-round-DmSZN0Kq.js} +1 -1
- package/dist/web/client/assets/{list-checks-JNXcmws9.js → list-checks-DdTdAQXS.js} +1 -1
- package/dist/web/client/assets/login-DM3q-V4R.js +1 -0
- package/dist/web/client/assets/{manage-SRGSx8n2.js → manage-R57MUzsY.js} +1 -1
- package/dist/web/client/assets/{mcp-BUWu4TvS.js → mcp-CSHrVH1t.js} +1 -1
- package/dist/web/client/assets/{message-square-DM2MP9vF.js → message-square-B_pULba_.js} +1 -1
- package/dist/web/client/assets/{network-BJ4iPjQO.js → network-BqmVqC4_.js} +1 -1
- package/dist/web/client/assets/parts-68zf8Fgw.js +1 -0
- package/dist/web/client/assets/plus-CEKaHPBw.js +1 -0
- package/dist/web/client/assets/preload-helper-CZOd_z6l.js +1 -0
- package/dist/web/client/assets/routes-DOoeKVwr.js +85 -0
- package/dist/web/client/assets/skills-CPZftp9O.js +1 -0
- package/dist/web/client/assets/{square-terminal-Dmm6cV-G.js → square-terminal-CYfGBHPC.js} +1 -1
- package/dist/web/client/assets/{style-CA2GAk9b.js → style-Bm9QsFpy.js} +1 -1
- package/dist/web/client/assets/styles-B-kTTvCo.css +2 -0
- package/dist/web/client/assets/{system-zQ0NnQML.js → system-Dd2P9eqE.js} +1 -1
- package/dist/web/client/assets/teams-7FEpSZg1.js +1 -0
- package/dist/web/client/assets/teams-ClirFbDV.js +1 -0
- package/dist/web/client/assets/telegram-BJnT5THs.js +1 -0
- package/dist/web/client/assets/tools-DqNXLMpc.js +1 -0
- package/dist/web/client/assets/usage-BC_TStVj.js +1 -0
- package/dist/web/client/assets/{use-resource-CQaIZbpy.js → use-resource-Bn0Sx7r6.js} +1 -1
- package/dist/web/client/assets/{users-round-BJrym3FG.js → users-round-cxQ5HF-C.js} +1 -1
- package/dist/web/client/assets/welcome-g8wtn_or.js +1 -0
- package/dist/web/client/assets/{wrench-GbE1M1RJ.js → wrench-BLEJjETg.js} +1 -1
- package/dist/web/server/assets/{AddProviderDialog-Nc5mc_P6.js → AddProviderDialog-DtkjBMv4.js} +5 -2
- package/dist/web/server/assets/AgentAvatar-8gTAy_tP.js +37 -0
- package/dist/web/server/assets/{AgentTemplateParts-DZK_r3nQ.js → AgentTemplateParts-CxWyovvM.js} +6 -2
- package/dist/web/server/assets/Button-Dsnw22OF.js +17 -0
- package/dist/web/server/assets/{ConfigPage-CxzL-gTm.js → ConfigPage-usZi48Zr.js} +2 -2
- package/dist/web/server/assets/{ConfirmDialog-4xeCXKHe.js → ConfirmDialog-DAcSBHkT.js} +3 -1
- package/dist/web/server/assets/{ConnectionsView-B02FjNsM.js → ConnectionsView-Dy6uYSRI.js} +9 -7
- package/dist/web/server/assets/Dialog-DTeF-nOZ.js +85 -0
- package/dist/web/server/assets/{ManagePage-BfCWE8Lj.js → ManagePage-Dy1EdovO.js} +2 -2
- package/dist/web/server/assets/{SectionTabs-CWQ5orUW.js → SectionTabs-BVrMn76H.js} +2 -1
- package/dist/web/server/assets/{SkillsParts-D58l8voo.js → SkillsParts-Cw05b3al.js} +6 -2
- package/dist/web/server/assets/SpawnDialog-BAE8W91z.js +125 -0
- package/dist/web/server/assets/{SpawnTeamModal-RjzAeX_Q.js → SpawnTeamModal-CgBY0HuN.js} +6 -2
- package/dist/web/server/assets/{TeamForm-DdOgIMiV.js → TeamForm-JyO5xJXX.js} +6 -2
- package/dist/web/server/assets/{TeamThread-D-PvO3fu.js → TeamThread-5o48EbXL.js} +52 -4
- package/dist/web/server/assets/{UnsavedChangesGuard-Bb5frygQ.js → UnsavedChangesGuard-CJQGu45L.js} +1 -1
- package/dist/web/server/assets/{_id-C1_l6oSR.js → _id-BE_RSvuN.js} +14 -9
- package/dist/web/server/assets/{_id-CHvYQhWt.js → _id-BNvm89oJ.js} +2 -2
- package/dist/web/server/assets/{_id-De3Bm0SG.js → _id-BW6sVrvw.js} +1 -1
- package/dist/web/server/assets/{_id-BPjVkcNb.js → _id-BfjTS4JO.js} +15 -9
- package/dist/web/server/assets/{_id-BKzOw78O.js → _id-BpumuCYL.js} +1 -1
- package/dist/web/server/assets/{_id-BUfy-GwH.js → _id-C54t_nX6.js} +2 -2
- package/dist/web/server/assets/_tanstack-start-manifest_v-BPwQX_5b.js +275 -0
- package/dist/web/server/assets/{access-CNfvQ3NB.js → access-6FWih7nC.js} +7 -4
- package/dist/web/server/assets/{access-WWspT0v4.js → access-BhAMfi7U.js} +1 -1
- package/dist/web/server/assets/{access-Cm_izIIC.js → access-DEyq3uP_.js} +2 -2
- package/dist/web/server/assets/activity-Czfq-5_F.js +471 -0
- package/dist/web/server/assets/{agent-actions-COnfW5AU.js → agent-actions-ChH7Mne4.js} +1 -1
- package/dist/web/server/assets/{agents-CRtMfKqX.js → agents-3hBjrd8B.js} +1 -1
- package/dist/web/server/assets/{agents-NOkh61dV.js → agents-BXuglv4G.js} +12 -6
- package/dist/web/server/assets/{agents-C7UmTjfO.js → agents-DhenbitX.js} +2 -2
- package/dist/web/server/assets/{agents-D0hfGIMK.js → agents-KJcDMj0Y.js} +9 -6
- package/dist/web/server/assets/{agents-DzpqlIuJ.js → agents-ncyhVx-T.js} +2 -2
- package/dist/web/server/assets/{agents-DQowl6Ly.js → agents-rTDlRZa5.js} +1 -1
- package/dist/web/server/assets/{attention-Cx9ZWPOO.js → attention-CDdOCOio.js} +3 -2
- package/dist/web/server/assets/{attention-CRvxt22X.js → attention-DM__BzWY.js} +24 -9
- package/dist/web/server/assets/{attention-CgWhXjX7.js → attention-X0U6ZmiA.js} +2 -1
- package/dist/web/server/assets/{auth-dJnrFW6y.js → auth-BexhV8Yq.js} +1 -1
- package/dist/web/server/assets/{config-B5CS8juO.js → config-Cld8Q8N7.js} +2 -2
- package/dist/web/server/assets/{config-X7qWbbpH.js → config-Cx5ri2DL2.js} +1 -1
- package/dist/web/server/assets/{config-D117117T.js → config-DpgYAXQ3.js} +9 -6
- package/dist/web/server/assets/createSsrRpc-6LHNEsSK.js +16 -0
- package/dist/web/server/assets/{daemon-client-B_ZRIIrT.js → daemon-client-RxAllljf.js} +1 -1
- package/dist/web/server/assets/form-BEjeiSy3.js +416 -0
- package/dist/web/server/assets/live-DbJeq6KP.js +263 -0
- package/dist/web/server/assets/{login-va4EtvA8.js → login-BJdJ219n.js} +1 -1
- package/dist/web/server/assets/{login-IF0Gbsuq.js → login-C4lL4AxI.js} +2 -2
- package/dist/web/server/assets/{manage-Ce6cI4eW.js → manage-C6ucNYZW.js} +2 -1
- package/dist/web/server/assets/{mcp-C96PBxpb.js → mcp-BXnWQOwM.js} +7 -4
- package/dist/web/server/assets/{mcp-C97uAZe1.js → mcp-C8VLspco.js} +1 -1
- package/dist/web/server/assets/{mcp-Bm9U6x7N.js → mcp-DwCzj7eO.js} +2 -2
- package/dist/web/server/assets/open-groups-BMGYUTtY.js +12 -0
- package/dist/web/server/assets/{page-title-CwcbXMhx.js → page-title-PTpFHXWo.js} +6 -3
- package/dist/web/server/assets/parts-k9M-atPa.js +436 -0
- package/dist/web/server/assets/{router-8Iq19GOz.js → router-BttfLktO.js} +354 -114
- package/dist/web/server/assets/{routes-Kwam6JmS.js → routes-A7UcreVX.js} +9 -6
- package/dist/web/server/assets/{routes-BLo-fWbQ.js → routes-B9jw-MJ8.js} +1286 -331
- package/dist/web/server/assets/{routes-BXvYYFrN.js → routes-BX2FV8rS.js} +3 -3
- package/dist/web/server/assets/{skills-DSezIdDc.js → skills-BVAH93cd.js} +8 -6
- package/dist/web/server/assets/{skills-DWzlT_hC.js → skills-Cd5Cfdaz.js} +1 -1
- package/dist/web/server/assets/{skills-BqCnA-74.js → skills-y3GsyKce.js} +2 -2
- package/dist/web/server/assets/src-vrZVrV9u.js +103 -0
- package/dist/web/server/assets/{start-DhW7sy23.js → start-Dl8gQ-95.js} +1 -1
- package/dist/web/server/assets/{style-C2hIPY_Y.js → style-BQ3H9I7Y.js} +1 -1
- package/dist/web/server/assets/{system-CcLCmkIC.js → system-BJPKqM6b.js} +2 -2
- package/dist/web/server/assets/{system-E0VePdzO.js → system-C7mejQSc.js} +3 -3
- package/dist/web/server/assets/{system-D3th6n2E.js → system-LsLcuVzY.js} +1 -1
- package/dist/web/server/assets/{teams-CdCmBJIj.js → teams-B6gbflsZ.js} +10 -6
- package/dist/web/server/assets/{teams-CQVV18D3.js → teams-C7kXMNgc.js} +10 -6
- package/dist/web/server/assets/{teams-BopOP4x7.js → teams-CPXoTggb.js} +1 -1
- package/dist/web/server/assets/{teams-70u1XQTr.js → teams-CeLLd2Mf.js} +1 -1
- package/dist/web/server/assets/{teams-DScFp8mK.js → teams-CiX8LUQo.js} +2 -2
- package/dist/web/server/assets/{teams-DxA-vnzY.js → teams-D-XdIkCr.js} +2 -2
- package/dist/web/server/assets/{telegram-CGol0CKX2.js → telegram-D7TW3LNZ.js} +1 -1
- package/dist/web/server/assets/{telegram-DJ8s_91Y.js → telegram-D8_V7_sW.js} +286 -272
- package/dist/web/server/assets/{telegram-DR7xijeS.js → telegram-DA2dwLID.js} +2 -2
- package/dist/web/server/assets/{tools-V6kezUpL.js → tools-CckcG9Jl.js} +5 -3
- package/dist/web/server/assets/{tools-CsH9DI-4.js → tools-CluiJywK.js} +2 -2
- package/dist/web/server/assets/{tools-C-wwWjLI.js → tools-D1BBVkRh.js} +1 -1
- package/dist/web/server/assets/usage-CrYyvPgf.js +46 -0
- package/dist/web/server/assets/usage-PNNb3pPj.js +465 -0
- package/dist/web/server/assets/{use-resource-CjcJwn7F.js → use-resource-BUA9qGGY.js} +1 -1
- package/dist/web/server/assets/{welcome-CxXMI4HI.js → welcome-CUTYf8UG.js} +1 -1
- package/dist/web/server/assets/{welcome-Ya8TkL4v.js → welcome-CYhh3iUU.js} +8 -6
- package/dist/web/server/assets/{welcome-BpmcD-ia.js → welcome-CwzLt6Rp.js} +2 -2
- package/dist/web/server/assets/workspace-0XPILV1W.js +82 -0
- package/dist/web/server/server.js +20 -20
- package/dist/web-server.js +4 -0
- package/dist/web-server.js.map +1 -1
- package/dist/worker.js +40 -15
- package/dist/worker.js.map +1 -1
- package/package.json +4 -4
- package/dist/web/client/assets/AddProviderDialog-CkwSq3C7.js +0 -1
- package/dist/web/client/assets/AgentTemplateParts-CEn_4qVs.js +0 -1
- package/dist/web/client/assets/ConfigPage-CUbHBhzx.js +0 -1
- package/dist/web/client/assets/ConfirmDialog-VqBOFZEp.js +0 -1
- package/dist/web/client/assets/ConnectionsView-ByARMcWP.js +0 -1
- package/dist/web/client/assets/ManagePage-BJWZd1ts.js +0 -1
- package/dist/web/client/assets/SectionTabs-ViZKm3-B.js +0 -1
- package/dist/web/client/assets/SkillsParts-UvNK5SYP.js +0 -1
- package/dist/web/client/assets/TeamThread-mkwODO0S.js +0 -1
- package/dist/web/client/assets/_id-CvcxNmBH.js +0 -1
- package/dist/web/client/assets/_id-UyBk7gRl.js +0 -1
- package/dist/web/client/assets/agents-CgtzqBpD.js +0 -1
- package/dist/web/client/assets/agents-D7W4BT8r.js +0 -1
- package/dist/web/client/assets/arrow-right-D0HKRb7U.js +0 -1
- package/dist/web/client/assets/attention-D9mQWoKt.js +0 -1
- package/dist/web/client/assets/chevron-right-bs0TUSl2.js +0 -1
- package/dist/web/client/assets/config-Dw6GWf38.js +0 -1
- package/dist/web/client/assets/createLucideIcon-DkniuEtD.js +0 -1
- package/dist/web/client/assets/index-YW0gXPfk.js +0 -14
- package/dist/web/client/assets/login-DcQJk5-U.js +0 -1
- package/dist/web/client/assets/parts-LZxl9Gvc.js +0 -41
- package/dist/web/client/assets/plus-CLGNN5QX.js +0 -1
- package/dist/web/client/assets/routes-BxIIyGho.js +0 -85
- package/dist/web/client/assets/skills-C7DzIwFJ.js +0 -1
- package/dist/web/client/assets/styles-C3CDSGAr.css +0 -2
- package/dist/web/client/assets/teams-BEIJHObN.js +0 -1
- package/dist/web/client/assets/teams-DlOc7Ods.js +0 -1
- package/dist/web/client/assets/telegram-DKHq5DpE.js +0 -1
- package/dist/web/client/assets/tools-BKIpLaiC.js +0 -1
- package/dist/web/client/assets/welcome-CyS4Hrd-.js +0 -1
- package/dist/web/server/assets/Rail-3gbidhyv.js +0 -605
- package/dist/web/server/assets/SpawnDialog-MJWwppgC.js +0 -1648
- package/dist/web/server/assets/_tanstack-start-manifest_v-CR3jm1nY.js +0 -256
- package/dist/web/server/assets/createSsrRpc-CwTd0zrB.js +0 -72
- package/dist/web/server/assets/public-origin-BpDkdS5Q.js +0 -34
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
import { i as api, n as useLive } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/tool-steps.ts
|
|
5
|
+
var TARGET_CHARS = 96;
|
|
6
|
+
function clip(value, limit = TARGET_CHARS) {
|
|
7
|
+
const line = value.trim().split("\n")[0] ?? "";
|
|
8
|
+
return line.length > limit ? `${line.slice(0, limit - 1)}…` : line;
|
|
9
|
+
}
|
|
10
|
+
/** The last segment of a path: what a person would call the file. */
|
|
11
|
+
function baseName(path) {
|
|
12
|
+
const parts = path.replace(/[\\/]+$/, "").split(/[\\/]/);
|
|
13
|
+
return parts[parts.length - 1] || path;
|
|
14
|
+
}
|
|
15
|
+
function hostOf(url) {
|
|
16
|
+
try {
|
|
17
|
+
return new URL(url).host || clip(url, 40);
|
|
18
|
+
} catch {
|
|
19
|
+
return clip(url, 40);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** A tool call's arguments as an object; null when they are not one. */
|
|
23
|
+
function parseArgs(raw) {
|
|
24
|
+
try {
|
|
25
|
+
const parsed = JSON.parse(raw);
|
|
26
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
var str = (value) => typeof value === "string" && value.trim() ? value : null;
|
|
32
|
+
/** Describe one tool call. `args` may be partial: a running turn only reports its main target. */
|
|
33
|
+
function describeStep(tool, args) {
|
|
34
|
+
const path = str(args?.path);
|
|
35
|
+
const file = path ? baseName(path) : "a file";
|
|
36
|
+
switch (tool) {
|
|
37
|
+
case "bash": return {
|
|
38
|
+
doing: "running a command",
|
|
39
|
+
verb: "Ran",
|
|
40
|
+
target: str(args?.command) ? clip(String(args?.command)) : null,
|
|
41
|
+
icon: "terminal",
|
|
42
|
+
kind: "command"
|
|
43
|
+
};
|
|
44
|
+
case "read": return {
|
|
45
|
+
doing: `reading ${file}`,
|
|
46
|
+
verb: "Read",
|
|
47
|
+
target: path,
|
|
48
|
+
icon: "read",
|
|
49
|
+
kind: "read"
|
|
50
|
+
};
|
|
51
|
+
case "write": return {
|
|
52
|
+
doing: `writing ${file}`,
|
|
53
|
+
verb: "Wrote",
|
|
54
|
+
target: path,
|
|
55
|
+
icon: "write",
|
|
56
|
+
kind: "write"
|
|
57
|
+
};
|
|
58
|
+
case "edit": return {
|
|
59
|
+
doing: `editing ${file}`,
|
|
60
|
+
verb: "Edited",
|
|
61
|
+
target: path,
|
|
62
|
+
icon: "write",
|
|
63
|
+
kind: "write"
|
|
64
|
+
};
|
|
65
|
+
case "grep":
|
|
66
|
+
case "find": return {
|
|
67
|
+
doing: "searching the files",
|
|
68
|
+
verb: "Searched for",
|
|
69
|
+
target: str(args?.pattern) ? clip(String(args?.pattern)) : null,
|
|
70
|
+
icon: "search",
|
|
71
|
+
kind: "read"
|
|
72
|
+
};
|
|
73
|
+
case "ls": return {
|
|
74
|
+
doing: "listing files",
|
|
75
|
+
verb: "Listed",
|
|
76
|
+
target: path ?? ".",
|
|
77
|
+
icon: "search",
|
|
78
|
+
kind: "read"
|
|
79
|
+
};
|
|
80
|
+
case "web_search": return {
|
|
81
|
+
doing: "searching the web",
|
|
82
|
+
verb: "Searched the web for",
|
|
83
|
+
target: str(args?.query) ? clip(String(args?.query)) : null,
|
|
84
|
+
icon: "web",
|
|
85
|
+
kind: "web"
|
|
86
|
+
};
|
|
87
|
+
case "web_fetch":
|
|
88
|
+
case "browser_navigate": {
|
|
89
|
+
const url = str(args?.url);
|
|
90
|
+
return {
|
|
91
|
+
doing: url ? `reading ${hostOf(url)}` : "reading a web page",
|
|
92
|
+
verb: "Opened",
|
|
93
|
+
target: url ? clip(url) : null,
|
|
94
|
+
icon: "web",
|
|
95
|
+
kind: "web"
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
case "browser_take_screenshot": return {
|
|
99
|
+
doing: "taking a screenshot",
|
|
100
|
+
verb: "Took a screenshot",
|
|
101
|
+
target: null,
|
|
102
|
+
icon: "image",
|
|
103
|
+
kind: "web"
|
|
104
|
+
};
|
|
105
|
+
case "send_message": return {
|
|
106
|
+
doing: "messaging a teammate",
|
|
107
|
+
verb: "Messaged",
|
|
108
|
+
target: str(args?.to),
|
|
109
|
+
icon: "message",
|
|
110
|
+
kind: "message"
|
|
111
|
+
};
|
|
112
|
+
case "read_inbox": return {
|
|
113
|
+
doing: "reading its inbox",
|
|
114
|
+
verb: "Read its inbox",
|
|
115
|
+
target: null,
|
|
116
|
+
icon: "message",
|
|
117
|
+
kind: "other"
|
|
118
|
+
};
|
|
119
|
+
case "wait_for_reply": return {
|
|
120
|
+
doing: "waiting for a reply",
|
|
121
|
+
verb: "Waited for a reply",
|
|
122
|
+
target: null,
|
|
123
|
+
icon: "message",
|
|
124
|
+
kind: "other"
|
|
125
|
+
};
|
|
126
|
+
case "deliver_file": return {
|
|
127
|
+
doing: `delivering ${file}`,
|
|
128
|
+
verb: "Delivered",
|
|
129
|
+
target: path,
|
|
130
|
+
icon: "file",
|
|
131
|
+
kind: "deliver"
|
|
132
|
+
};
|
|
133
|
+
case "image_generate": return {
|
|
134
|
+
doing: "drawing an image",
|
|
135
|
+
verb: "Generated an image",
|
|
136
|
+
target: null,
|
|
137
|
+
icon: "image",
|
|
138
|
+
kind: "deliver"
|
|
139
|
+
};
|
|
140
|
+
case "memory_write": return {
|
|
141
|
+
doing: "saving a note",
|
|
142
|
+
verb: "Saved the note",
|
|
143
|
+
target: str(args?.key),
|
|
144
|
+
icon: "note",
|
|
145
|
+
kind: "other"
|
|
146
|
+
};
|
|
147
|
+
case "memory_read": return {
|
|
148
|
+
doing: "reading a note",
|
|
149
|
+
verb: "Read the note",
|
|
150
|
+
target: str(args?.key),
|
|
151
|
+
icon: "note",
|
|
152
|
+
kind: "other"
|
|
153
|
+
};
|
|
154
|
+
case "memory_search": return {
|
|
155
|
+
doing: "searching the notes",
|
|
156
|
+
verb: "Searched the notes for",
|
|
157
|
+
target: str(args?.query) ? clip(String(args?.query)) : null,
|
|
158
|
+
icon: "note",
|
|
159
|
+
kind: "other"
|
|
160
|
+
};
|
|
161
|
+
case "memory_list": return {
|
|
162
|
+
doing: "listing the notes",
|
|
163
|
+
verb: "Listed the notes",
|
|
164
|
+
target: null,
|
|
165
|
+
icon: "note",
|
|
166
|
+
kind: "other"
|
|
167
|
+
};
|
|
168
|
+
case "user_md_get": return {
|
|
169
|
+
doing: "reading USER.md",
|
|
170
|
+
verb: "Read USER.md",
|
|
171
|
+
target: null,
|
|
172
|
+
icon: "read",
|
|
173
|
+
kind: "other"
|
|
174
|
+
};
|
|
175
|
+
case "user_md_write": return {
|
|
176
|
+
doing: "updating USER.md",
|
|
177
|
+
verb: "Updated USER.md",
|
|
178
|
+
target: null,
|
|
179
|
+
icon: "write",
|
|
180
|
+
kind: "other"
|
|
181
|
+
};
|
|
182
|
+
case "ask_user": return {
|
|
183
|
+
doing: "asking you a question",
|
|
184
|
+
verb: "Asked you a question",
|
|
185
|
+
target: null,
|
|
186
|
+
icon: "question",
|
|
187
|
+
kind: "other"
|
|
188
|
+
};
|
|
189
|
+
case "propose_lesson": return {
|
|
190
|
+
doing: "proposing a lesson",
|
|
191
|
+
verb: "Proposed a lesson",
|
|
192
|
+
target: null,
|
|
193
|
+
icon: "note",
|
|
194
|
+
kind: "other"
|
|
195
|
+
};
|
|
196
|
+
default: break;
|
|
197
|
+
}
|
|
198
|
+
if (tool.startsWith("home_")) {
|
|
199
|
+
const own = str(args?.file);
|
|
200
|
+
return tool === "home_write" ? {
|
|
201
|
+
doing: "updating its own files",
|
|
202
|
+
verb: "Updated its file",
|
|
203
|
+
target: own,
|
|
204
|
+
icon: "write",
|
|
205
|
+
kind: "other"
|
|
206
|
+
} : {
|
|
207
|
+
doing: "reading its own files",
|
|
208
|
+
verb: "Read its file",
|
|
209
|
+
target: own,
|
|
210
|
+
icon: "read",
|
|
211
|
+
kind: "other"
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
if (tool.startsWith("browser_")) return {
|
|
215
|
+
doing: "using the browser",
|
|
216
|
+
verb: "In the browser:",
|
|
217
|
+
target: tool.slice(8).replaceAll("_", " "),
|
|
218
|
+
icon: "web",
|
|
219
|
+
kind: "web"
|
|
220
|
+
};
|
|
221
|
+
return {
|
|
222
|
+
doing: `using ${tool}`,
|
|
223
|
+
verb: "Used",
|
|
224
|
+
target: tool,
|
|
225
|
+
icon: "tool",
|
|
226
|
+
kind: "other"
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
var KIND_LABEL = {
|
|
230
|
+
command: ["command", "commands"],
|
|
231
|
+
read: ["lookup", "lookups"],
|
|
232
|
+
write: ["file written", "files written"],
|
|
233
|
+
web: ["web step", "web steps"],
|
|
234
|
+
message: ["message", "messages"],
|
|
235
|
+
deliver: ["file delivered", "files delivered"],
|
|
236
|
+
other: ["more", "more"]
|
|
237
|
+
};
|
|
238
|
+
/** "2 commands, 1 lookup, 3 files written" for a group of steps. */
|
|
239
|
+
function summarizeSteps(kinds) {
|
|
240
|
+
return [
|
|
241
|
+
"command",
|
|
242
|
+
"read",
|
|
243
|
+
"write",
|
|
244
|
+
"web",
|
|
245
|
+
"message",
|
|
246
|
+
"deliver",
|
|
247
|
+
"other"
|
|
248
|
+
].map((kind) => {
|
|
249
|
+
const count = kinds.filter((entry) => entry === kind).length;
|
|
250
|
+
if (count === 0) return null;
|
|
251
|
+
const [one, many] = KIND_LABEL[kind];
|
|
252
|
+
return `${count} ${count === 1 ? one : many}`;
|
|
253
|
+
}).filter(Boolean).join(", ");
|
|
254
|
+
}
|
|
255
|
+
/** Lines a write or an edit added and removed, from its arguments; null for other tools. */
|
|
256
|
+
function lineChange(tool, args) {
|
|
257
|
+
const lines = (value) => typeof value === "string" && value.length > 0 ? value.replace(/\n$/, "").split("\n").length : 0;
|
|
258
|
+
if (tool === "write") return {
|
|
259
|
+
added: lines(args?.content),
|
|
260
|
+
removed: 0
|
|
261
|
+
};
|
|
262
|
+
if (tool !== "edit" || !Array.isArray(args?.edits)) return null;
|
|
263
|
+
let added = 0;
|
|
264
|
+
let removed = 0;
|
|
265
|
+
for (const edit of args.edits) {
|
|
266
|
+
added += lines(edit?.newText);
|
|
267
|
+
removed += lines(edit?.oldText);
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
added,
|
|
271
|
+
removed
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/lib/activity.tsx
|
|
276
|
+
var POLL_MS = 3e3;
|
|
277
|
+
var SEEN_KEY = "bz_seen";
|
|
278
|
+
var plural = (count, one, many = `${one}s`) => `${count} ${count === 1 ? one : many}`;
|
|
279
|
+
/**
|
|
280
|
+
* One line for an Agent. What needs the operator comes first, then work in progress, then what
|
|
281
|
+
* is new since they last looked.
|
|
282
|
+
*/
|
|
283
|
+
function agentState(activity, seen, nameOf = () => void 0) {
|
|
284
|
+
if (!activity) return {
|
|
285
|
+
kind: "idle",
|
|
286
|
+
text: "Idle"
|
|
287
|
+
};
|
|
288
|
+
if (activity.questions > 0) return {
|
|
289
|
+
kind: "needs",
|
|
290
|
+
text: `Waiting for you: ${activity.questions === 1 ? "a question" : plural(activity.questions, "question")}`
|
|
291
|
+
};
|
|
292
|
+
if (activity.approvals > 0) return {
|
|
293
|
+
kind: "needs",
|
|
294
|
+
text: `Waiting for you: ${activity.approvals === 1 ? "a command" : plural(activity.approvals, "command")} to approve`
|
|
295
|
+
};
|
|
296
|
+
if (activity.working) {
|
|
297
|
+
const step = activity.step;
|
|
298
|
+
if (!step) return {
|
|
299
|
+
kind: "working",
|
|
300
|
+
text: "Working"
|
|
301
|
+
};
|
|
302
|
+
if (step.tool === "send_message") return {
|
|
303
|
+
kind: "working",
|
|
304
|
+
text: `Working: messaging ${(step.target ? nameOf(step.target) : void 0) ?? "a teammate"}`
|
|
305
|
+
};
|
|
306
|
+
const target = step.target;
|
|
307
|
+
const args = target ? {
|
|
308
|
+
path: target,
|
|
309
|
+
command: target,
|
|
310
|
+
url: target,
|
|
311
|
+
query: target,
|
|
312
|
+
key: target,
|
|
313
|
+
file: target
|
|
314
|
+
} : null;
|
|
315
|
+
return {
|
|
316
|
+
kind: "working",
|
|
317
|
+
text: `Working: ${describeStep(step.tool, args).doing}`
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
if (activity.queuePaused) return {
|
|
321
|
+
kind: "paused",
|
|
322
|
+
text: "Follow-ups paused"
|
|
323
|
+
};
|
|
324
|
+
if (seen) {
|
|
325
|
+
const files = activity.results - seen.results;
|
|
326
|
+
if (files > 0) return {
|
|
327
|
+
kind: "fresh",
|
|
328
|
+
text: plural(files, "new file")
|
|
329
|
+
};
|
|
330
|
+
if (activity.lastActivityAt !== null && activity.lastActivityAt > seen.at) return {
|
|
331
|
+
kind: "fresh",
|
|
332
|
+
text: "New activity"
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
return {
|
|
336
|
+
kind: "idle",
|
|
337
|
+
text: activity.lastActivityAt === null ? "No conversation yet" : "Idle"
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
/** "1 waiting · 2 working" for a Team's header; empty when everyone is idle. */
|
|
341
|
+
function teamSummary(states) {
|
|
342
|
+
const count = (kind) => states.filter((state) => state.kind === kind).length;
|
|
343
|
+
return [
|
|
344
|
+
count("needs") ? `${count("needs")} waiting` : null,
|
|
345
|
+
count("working") ? `${count("working")} working` : null,
|
|
346
|
+
count("fresh") ? `${count("fresh")} new` : null
|
|
347
|
+
].filter(Boolean).join(" · ");
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Whether a turn ended between two readings of the feed: an Agent stopped working, or an idle
|
|
351
|
+
* Agent's conversation or saved files moved on (a turn shorter than the time between readings).
|
|
352
|
+
*/
|
|
353
|
+
function turnEnded(before, after) {
|
|
354
|
+
const known = new Map(before.map((activity) => [activity.agentId, activity]));
|
|
355
|
+
return after.some((now) => {
|
|
356
|
+
const was = known.get(now.agentId);
|
|
357
|
+
if (!was || now.working) return false;
|
|
358
|
+
return was.working || was.lastActivityAt !== now.lastActivityAt || was.results !== now.results;
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
var ActivityContext = createContext(null);
|
|
362
|
+
function readSeen() {
|
|
363
|
+
try {
|
|
364
|
+
const parsed = JSON.parse(window.localStorage.getItem(SEEN_KEY) ?? "{}");
|
|
365
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
366
|
+
} catch {
|
|
367
|
+
return {};
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
function ActivityProvider({ initial, openAgentId, names, children }) {
|
|
371
|
+
const [agents, setAgents] = useState(initial);
|
|
372
|
+
const [seen, setSeen] = useState(null);
|
|
373
|
+
const [turnsEnded, setTurnsEnded] = useState(0);
|
|
374
|
+
const lastRef = useRef(initial);
|
|
375
|
+
const live = useLive();
|
|
376
|
+
const apply = useCallback((next) => {
|
|
377
|
+
const ended = turnEnded(lastRef.current, next);
|
|
378
|
+
lastRef.current = next;
|
|
379
|
+
setAgents(next);
|
|
380
|
+
if (ended) setTurnsEnded((count) => count + 1);
|
|
381
|
+
}, []);
|
|
382
|
+
const refresh = useCallback(() => {
|
|
383
|
+
api("/api/activity").then((body) => apply(body.agents)).catch(() => {});
|
|
384
|
+
}, [apply]);
|
|
385
|
+
useEffect(() => live.subscribe("activity", (event) => apply(event.agents)), [live.subscribe, apply]);
|
|
386
|
+
useEffect(() => {
|
|
387
|
+
if (live.connected) return;
|
|
388
|
+
const timer = setInterval(() => {
|
|
389
|
+
if (!document.hidden) refresh();
|
|
390
|
+
}, POLL_MS);
|
|
391
|
+
const onVisible = () => {
|
|
392
|
+
if (!document.hidden) refresh();
|
|
393
|
+
};
|
|
394
|
+
document.addEventListener("visibilitychange", onVisible);
|
|
395
|
+
return () => {
|
|
396
|
+
clearInterval(timer);
|
|
397
|
+
document.removeEventListener("visibilitychange", onVisible);
|
|
398
|
+
};
|
|
399
|
+
}, [refresh, live.connected]);
|
|
400
|
+
useEffect(() => setSeen(readSeen()), []);
|
|
401
|
+
useEffect(() => {
|
|
402
|
+
if (!seen) return;
|
|
403
|
+
let next = null;
|
|
404
|
+
for (const activity of agents) {
|
|
405
|
+
const current = seen[activity.agentId];
|
|
406
|
+
const now = {
|
|
407
|
+
at: activity.lastActivityAt ?? 0,
|
|
408
|
+
results: activity.results
|
|
409
|
+
};
|
|
410
|
+
const open = activity.agentId === openAgentId && !document.hidden;
|
|
411
|
+
if (!current || open && (current.at !== now.at || current.results !== now.results)) next = {
|
|
412
|
+
...next ?? seen,
|
|
413
|
+
[activity.agentId]: now
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
if (!next) return;
|
|
417
|
+
setSeen(next);
|
|
418
|
+
try {
|
|
419
|
+
window.localStorage.setItem(SEEN_KEY, JSON.stringify(next));
|
|
420
|
+
} catch {}
|
|
421
|
+
}, [
|
|
422
|
+
agents,
|
|
423
|
+
seen,
|
|
424
|
+
openAgentId
|
|
425
|
+
]);
|
|
426
|
+
const value = useMemo(() => {
|
|
427
|
+
const byAgent = new Map(agents.map((activity) => [activity.agentId, activity]));
|
|
428
|
+
return {
|
|
429
|
+
byAgent,
|
|
430
|
+
stateOf: (agentId) => agentState(byAgent.get(agentId), agentId === openAgentId ? void 0 : seen?.[agentId], (id) => names.get(id)),
|
|
431
|
+
turnsEnded,
|
|
432
|
+
refresh
|
|
433
|
+
};
|
|
434
|
+
}, [
|
|
435
|
+
agents,
|
|
436
|
+
seen,
|
|
437
|
+
openAgentId,
|
|
438
|
+
names,
|
|
439
|
+
turnsEnded,
|
|
440
|
+
refresh
|
|
441
|
+
]);
|
|
442
|
+
return /* @__PURE__ */ jsx(ActivityContext.Provider, {
|
|
443
|
+
value,
|
|
444
|
+
children
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
function useActivity() {
|
|
448
|
+
const value = useContext(ActivityContext);
|
|
449
|
+
if (!value) throw new Error("useActivity needs an ActivityProvider");
|
|
450
|
+
return value;
|
|
451
|
+
}
|
|
452
|
+
/** The feed when there is one: a conversation can also render on its own. */
|
|
453
|
+
function useActivityOptional() {
|
|
454
|
+
return useContext(ActivityContext);
|
|
455
|
+
}
|
|
456
|
+
/** A short clock or date for "last active": 12:04 today, Tue this week, 12 Nov otherwise. */
|
|
457
|
+
function shortTime(at, now = Date.now()) {
|
|
458
|
+
const date = new Date(at);
|
|
459
|
+
const today = new Date(now);
|
|
460
|
+
if (date.toDateString() === today.toDateString()) return date.toLocaleTimeString([], {
|
|
461
|
+
hour: "2-digit",
|
|
462
|
+
minute: "2-digit"
|
|
463
|
+
});
|
|
464
|
+
if (now - at < 144 * 36e5) return date.toLocaleDateString([], { weekday: "short" });
|
|
465
|
+
return date.toLocaleDateString([], {
|
|
466
|
+
day: "numeric",
|
|
467
|
+
month: "short"
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
471
|
+
export { useActivity as a, lineChange as c, teamSummary as i, parseArgs as l, agentState as n, useActivityOptional as o, shortTime as r, describeStep as s, ActivityProvider as t, summarizeSteps as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
2
|
import { t as MODELS_PATH } from "./ModelMenu-D-hTgYOO.js";
|
|
3
3
|
import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
|
|
4
|
-
import { n as daemonClient } from "./daemon-client-
|
|
4
|
+
import { n as daemonClient } from "./daemon-client-RxAllljf.js";
|
|
5
5
|
//#region src/routes/agents/index.tsx?tss-serverfn-split
|
|
6
6
|
var fetchAgents_createServerFn_handler = createServerRpc({
|
|
7
7
|
id: "f715bab0037380aa3db7e237e7cf1e74168c363f48a960bb1ddfa5560de3a74e",
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { i as api, o as errorMessage } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { t as AgentAvatar } from "./AgentAvatar-8gTAy_tP.js";
|
|
3
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
4
|
+
import { n as DialogActions, t as Dialog } from "./Dialog-DTeF-nOZ.js";
|
|
5
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-DAcSBHkT.js";
|
|
3
6
|
import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
|
|
4
|
-
import { i as
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
7
|
+
import { _ as RowMenu, c as CardToolbar, d as Chip, g as Notice, h as ListRow, i as CardEmpty, m as GroupHeader, o as CardList, r as CardBody, v as SearchField, y as SetupCard } from "./parts-k9M-atPa.js";
|
|
8
|
+
import { s as SelectField } from "./form-BEjeiSy3.js";
|
|
9
|
+
import { t as SpawnDialog } from "./SpawnDialog-BAE8W91z.js";
|
|
10
|
+
import { t as Route } from "./agents-ncyhVx-T.js";
|
|
11
|
+
import { t as ManagePage } from "./ManagePage-Dy1EdovO.js";
|
|
12
|
+
import { i as unarchiveAgent, n as deleteAgent, t as archiveAgent } from "./agent-actions-ChH7Mne4.js";
|
|
13
|
+
import { T as templateName, c as groupAgents, n as agentCounts, r as agentModel, s as count } from "./manage-C6ucNYZW.js";
|
|
8
14
|
import { useEffect, useRef, useState } from "react";
|
|
9
15
|
import { Link, useRouter } from "@tanstack/react-router";
|
|
10
16
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
|
-
import { t as createSsrRpc } from "./createSsrRpc-
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
4
|
//#region src/routes/templates/agents/index.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./agents-
|
|
5
|
+
var $$splitComponentImporter = () => import("./agents-KJcDMj0Y.js");
|
|
6
6
|
var fetchTemplates = createServerFn({ method: "GET" }).handler(createSsrRpc("7bc7f3b145d10e7a733fbe068ce367dda04ec2f1cdb53f0d6dcba3838eb2deeb"));
|
|
7
7
|
var Route = createFileRoute("/templates/agents/")({
|
|
8
8
|
validateSearch: (search) => ({ new: search.new === 1 || search.new === "1" ? 1 : void 0 }),
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
1
|
+
import { i as api } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
3
|
+
import { t as ConfirmDialog } from "./ConfirmDialog-DAcSBHkT.js";
|
|
4
|
+
import { _ as RowMenu, d as Chip, h as ListRow, i as CardEmpty, o as CardList, y as SetupCard } from "./parts-k9M-atPa.js";
|
|
5
|
+
import { t as SpawnDialog } from "./SpawnDialog-BAE8W91z.js";
|
|
6
|
+
import { t as Route } from "./agents-DhenbitX.js";
|
|
7
|
+
import { t as ManagePage } from "./ManagePage-Dy1EdovO.js";
|
|
8
|
+
import { E as templateUseLine, T as templateName, d as modelLine, s as count, w as templateDeleteBlocker, y as skillsLine } from "./manage-C6ucNYZW.js";
|
|
9
|
+
import { t as CreateAgentTemplateDialog } from "./AgentTemplateParts-CxWyovvM.js";
|
|
7
10
|
import { useState } from "react";
|
|
8
11
|
import { useNavigate, useRouter } from "@tanstack/react-router";
|
|
9
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
|
-
import { t as createSsrRpc } from "./createSsrRpc-
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
4
|
//#region src/routes/agents/index.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./agents-
|
|
5
|
+
var $$splitComponentImporter = () => import("./agents-BXuglv4G.js");
|
|
6
6
|
var fetchAgents = createServerFn({ method: "GET" }).handler(createSsrRpc("f715bab0037380aa3db7e237e7cf1e74168c363f48a960bb1ddfa5560de3a74e"));
|
|
7
7
|
var Route = createFileRoute("/agents/")({
|
|
8
8
|
loader: () => fetchAgents(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
2
|
import { t as MODELS_PATH } from "./ModelMenu-D-hTgYOO.js";
|
|
3
3
|
import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
|
|
4
|
-
import { n as daemonClient } from "./daemon-client-
|
|
4
|
+
import { n as daemonClient } from "./daemon-client-RxAllljf.js";
|
|
5
5
|
//#region src/routes/templates/agents/index.tsx?tss-serverfn-split
|
|
6
6
|
var fetchTemplates_createServerFn_handler = createServerRpc({
|
|
7
7
|
id: "7bc7f3b145d10e7a733fbe068ce367dda04ec2f1cdb53f0d6dcba3838eb2deeb",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
|
-
import { t as createSsrRpc } from "./createSsrRpc-
|
|
2
|
+
import { t as createSsrRpc } from "./createSsrRpc-6LHNEsSK.js";
|
|
3
3
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
4
|
//#region src/routes/attention/index.tsx
|
|
5
|
-
var $$splitComponentImporter = () => import("./attention-
|
|
5
|
+
var $$splitComponentImporter = () => import("./attention-DM__BzWY.js");
|
|
6
6
|
/** Questions expire in minutes and commands in two: the page keeps itself current. */
|
|
7
|
+
/** "2 minutes ago" moves on even when nothing in the list changes. */
|
|
7
8
|
/** What the item's button says: where it takes you and what you do there. */
|
|
8
9
|
var loadAttention = createServerFn({ method: "GET" }).handler(createSsrRpc("883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a"));
|
|
9
10
|
var Route = createFileRoute("/attention/")({
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as useHydrated } from "./use-resource-
|
|
1
|
+
import { i as api, n as useLive, o as errorMessage } from "./live-DbJeq6KP.js";
|
|
2
|
+
import { t as useHydrated } from "./use-resource-BUA9qGGY.js";
|
|
3
|
+
import { t as Button } from "./Button-Dsnw22OF.js";
|
|
3
4
|
import { r as ago } from "./ModelMenu-D-hTgYOO.js";
|
|
4
5
|
import { t as Segmented } from "./Segmented-3ZLdqa5U.js";
|
|
5
|
-
import {
|
|
6
|
-
import { i as
|
|
7
|
-
import {
|
|
8
|
-
import { t as Route } from "./attention-
|
|
9
|
-
import {
|
|
6
|
+
import { i as useAttentionCount } from "./page-title-PTpFHXWo.js";
|
|
7
|
+
import { C as PageShell, S as PageHeader, c as CardToolbar, d as Chip, g as Notice, h as ListRow, i as CardEmpty, o as CardList, r as CardBody, t as Banner, y as SetupCard } from "./parts-k9M-atPa.js";
|
|
8
|
+
import { r as FilterSelect } from "./form-BEjeiSy3.js";
|
|
9
|
+
import { t as Route } from "./attention-CDdOCOio.js";
|
|
10
|
+
import { a as attentionSource, m as severityLabel, o as attentionSummary, t as ATTENTION_KINDS } from "./manage-C6ucNYZW.js";
|
|
11
|
+
import { useEffect, useRef, useState } from "react";
|
|
10
12
|
import { Link } from "@tanstack/react-router";
|
|
11
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
14
|
import { BellRing } from "lucide-react";
|
|
@@ -15,6 +17,8 @@ var LIST_PATH = "/api/attention?state=all&limit=200";
|
|
|
15
17
|
var SUMMARY_PATH = "/api/attention/summary";
|
|
16
18
|
/** Questions expire in minutes and commands in two: the page keeps itself current. */
|
|
17
19
|
var POLL_MS = 5e3;
|
|
20
|
+
/** "2 minutes ago" moves on even when nothing in the list changes. */
|
|
21
|
+
var CLOCK_MS = 3e4;
|
|
18
22
|
/** What the item's button says: where it takes you and what you do there. */
|
|
19
23
|
function actionLabel(item) {
|
|
20
24
|
switch (item.kind) {
|
|
@@ -39,6 +43,8 @@ function AttentionCenter() {
|
|
|
39
43
|
const [busy, setBusy] = useState(null);
|
|
40
44
|
const [notice, setNotice] = useState(null);
|
|
41
45
|
const counts = useAttentionCount();
|
|
46
|
+
const live = useLive();
|
|
47
|
+
const revision = useRef(null);
|
|
42
48
|
const hydrated = useHydrated();
|
|
43
49
|
const visible = list.items.filter((item) => (state === "all" || (state === "open" ? item.acknowledgedAt === null : item.acknowledgedAt !== null)) && (kind === "all" || item.kind === kind) && (severity === "all" || item.severity === severity));
|
|
44
50
|
const openCount = list.items.filter((item) => item.acknowledgedAt === null).length;
|
|
@@ -51,13 +57,22 @@ function AttentionCenter() {
|
|
|
51
57
|
setSummary(nextSummary);
|
|
52
58
|
setNow(Date.now());
|
|
53
59
|
}
|
|
60
|
+
useEffect(() => live.subscribe("attention", (event) => {
|
|
61
|
+
const changed = revision.current !== event.revision;
|
|
62
|
+
revision.current = event.revision;
|
|
63
|
+
if (changed) refresh().catch(() => {});
|
|
64
|
+
}), [live.subscribe]);
|
|
54
65
|
useEffect(() => {
|
|
55
|
-
|
|
66
|
+
const timer = setInterval(() => setNow(Date.now()), CLOCK_MS);
|
|
67
|
+
return () => clearInterval(timer);
|
|
68
|
+
}, []);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (busy !== null || live.connected) return;
|
|
56
71
|
const timer = setInterval(() => {
|
|
57
72
|
if (document.visibilityState === "visible") refresh().catch(() => {});
|
|
58
73
|
}, POLL_MS);
|
|
59
74
|
return () => clearInterval(timer);
|
|
60
|
-
}, [busy]);
|
|
75
|
+
}, [busy, live.connected]);
|
|
61
76
|
async function run(key, request) {
|
|
62
77
|
setBusy(key);
|
|
63
78
|
setNotice(null);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
2
|
import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
|
|
3
|
-
import { n as daemonClient } from "./daemon-client-
|
|
3
|
+
import { n as daemonClient } from "./daemon-client-RxAllljf.js";
|
|
4
4
|
//#region src/routes/attention/index.tsx?tss-serverfn-split
|
|
5
5
|
var LIST_PATH = "/api/attention?state=all&limit=200";
|
|
6
6
|
var SUMMARY_PATH = "/api/attention/summary";
|
|
7
7
|
/** Questions expire in minutes and commands in two: the page keeps itself current. */
|
|
8
|
+
/** "2 minutes ago" moves on even when nothing in the list changes. */
|
|
8
9
|
/** What the item's button says: where it takes you and what you do there. */
|
|
9
10
|
var loadAttention_createServerFn_handler = createServerRpc({
|
|
10
11
|
id: "883b401299422096ee31ee824f9a24b49d06bdcedce398789778c4c549a92f3a",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as createServerFn } from "../server.js";
|
|
2
2
|
import { t as createServerRpc } from "./createServerRpc-B7Yr1K8i.js";
|
|
3
|
-
import { n as daemonClient, r as ApiClientError } from "./daemon-client-
|
|
3
|
+
import { n as daemonClient, r as ApiClientError } from "./daemon-client-RxAllljf.js";
|
|
4
4
|
//#region src/lib/auth.ts?tss-serverfn-split
|
|
5
5
|
var fetchAuthState_createServerFn_handler = createServerRpc({
|
|
6
6
|
id: "a5d3825fc69573bb55bab6df578c750ebb0240dd394c3acee3adea02918a5dc2",
|