scope-agent-workbench 0.2.0 → 0.2.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/CHANGELOG.md +41 -0
- package/bridge/agent-email-relay.mjs +160 -160
- package/bridge/app-server-websocket-transport.mjs +219 -219
- package/bridge/archive/service.mjs +130 -130
- package/bridge/auth-profile-failover.mjs +58 -58
- package/bridge/auth-profile-manager.mjs +215 -215
- package/bridge/capacity-recovery.mjs +90 -90
- package/bridge/gpu-usage-history.mjs +322 -322
- package/bridge/local/history.mjs +20 -5
- package/bridge/plugins/aliyun-dlc/monitor.mjs +236 -236
- package/bridge/plugins/aliyun-dlc/probe.mjs +701 -701
- package/bridge/private-gateway.mjs +371 -371
- package/bridge/private-start.mjs +22 -22
- package/bridge/probes/app-server-handoff-probe.mjs +87 -87
- package/bridge/probes/app-server-writer-probe.mjs +69 -69
- package/bridge/probes/assistant-search-probe.mjs +321 -321
- package/bridge/probes/dialogue-probe.mjs +462 -462
- package/bridge/probes/history-probe.mjs +430 -345
- package/bridge/probes/new-session-preflight.mjs +14 -14
- package/bridge/probes/profile-cancel-probe.mjs +17 -17
- package/bridge/probes/profile-delete-probe.mjs +26 -26
- package/bridge/probes/profile-list-probe.mjs +114 -114
- package/bridge/probes/profile-write-probe.mjs +109 -109
- package/bridge/probes/raw-context-probe.mjs +51 -51
- package/bridge/probes/remote-probe.mjs +627 -626
- package/bridge/probes/submission-probe.mjs +2 -2
- package/bridge/probes/takeover-probe.mjs +326 -326
- package/bridge/probes/vscode-open-preflight.mjs +21 -21
- package/bridge/providers/claude-interactive.py +463 -341
- package/bridge/providers/cli-command.mjs +103 -103
- package/bridge/providers/conversations.mjs +231 -231
- package/bridge/providers/native-commands.py +38 -38
- package/bridge/providers/native-session-state.mjs +14 -14
- package/bridge/providers/native-session-state.py +96 -96
- package/bridge/providers/remote-job.py +130 -130
- package/bridge/remote-app-server-command.mjs +121 -121
- package/bridge/remote-directory-listing.mjs +148 -148
- package/bridge/rollout-summary.mjs +20 -2
- package/bridge/routes/dialogue.mjs +48 -3
- package/bridge/routes/models.mjs +312 -312
- package/bridge/server.mjs +3357 -3332
- package/bridge/session-attachments.mjs +150 -150
- package/bridge/session-catalog/agy-history.py +141 -2
- package/bridge/session-catalog/catalog.mjs +17 -0
- package/bridge/session-catalog/probe.py +1207 -331
- package/bridge/session-catalog/routes.mjs +6 -0
- package/bridge/start.mjs +205 -205
- package/bridge/state-persistence.mjs +9 -1
- package/bridge/tmux-session-control.mjs +29 -29
- package/bridge/vscode-opener.mjs +157 -157
- package/bridge/web-terminal.mjs +52 -52
- package/bridge/workbench/manager-context.mjs +51 -51
- package/bridge/workbench/service.mjs +301 -301
- package/dist/client/.vite/manifest.json +4 -4
- package/dist/client/assets/{index-Enu1x0PS.js → index-BMior55c.js} +2 -2
- package/dist/client/assets/{layout-segment-context-CmJzExWq.js → layout-segment-context-DjGudgXn.js} +1 -1
- package/dist/client/assets/page-CJqXlhDs.js +551 -0
- package/dist/client/assets/page-LYzRz6_S.css +1 -0
- package/dist/client/favicon.svg +6 -6
- package/dist/server/__vite_rsc_assets_manifest.js +8 -8
- package/dist/server/index.js +7 -7
- package/dist/server/ssr/__vite_rsc_assets_manifest.js +8 -8
- package/dist/server/ssr/assets/{page-CYYyCnKD.js → page-BB9Dri2u.js} +2416 -271
- package/dist/server/ssr/assets/page-LYzRz6_S.css +1 -0
- package/dist/server/ssr/index.js +1 -1
- package/dist/server/ssr/vinext-server.json +1 -1
- package/dist/server/vinext-server.json +1 -1
- package/dist/server/wrangler.json +1 -1
- package/lib/browser-snapshot-cache.js +53 -53
- package/lib/formula-preview.js +1 -1
- package/lib/incremental-snapshot.js +300 -300
- package/lib/markdown-math.js +151 -151
- package/lib/remote-links.js +95 -95
- package/lib/runtime-config.js +70 -70
- package/lib/session-filters.js +38 -38
- package/lib/ssh-config.js +26 -26
- package/lib/stable-order.js +39 -39
- package/lib/subagent-display-prefs.ts +130 -0
- package/package.json +1 -1
- package/scripts/agent-email-relay.mjs +104 -104
- package/scripts/email-notification-cli.mjs +28 -28
- package/scripts/enable-private-access.ps1 +109 -109
- package/scripts/fixtures/native-conversations.mjs +164 -6
- package/scripts/fixtures/workbench-conversations.mjs +475 -352
- package/scripts/preview-workbench.mjs +669 -669
- package/dist/client/assets/page-COBv6VWj.css +0 -1
- package/dist/client/assets/page-DVjU6VG_.js +0 -550
- package/dist/server/ssr/assets/page-COBv6VWj.css +0 -1
|
@@ -9,6 +9,7 @@ export function dialogueRoutes(context) {
|
|
|
9
9
|
RAW_CONTEXT_PROBE,
|
|
10
10
|
cleanSshError,
|
|
11
11
|
findAgent,
|
|
12
|
+
getSnapshot,
|
|
12
13
|
historicalSessions,
|
|
13
14
|
jsonResponse,
|
|
14
15
|
readJsonBody,
|
|
@@ -19,9 +20,18 @@ export function dialogueRoutes(context) {
|
|
|
19
20
|
if (url.pathname === "/api/dialogue" && request.method === "POST") {
|
|
20
21
|
try {
|
|
21
22
|
const body = await readJsonBody(request);
|
|
23
|
+
const subagentId =
|
|
24
|
+
typeof body.subagentId === "string" ? body.subagentId.trim() : "";
|
|
22
25
|
if (body.host === LOCAL_HOST && localDialogue) {
|
|
23
26
|
const dialogue = await localDialogue(body);
|
|
24
|
-
jsonResponse(response, 200, {
|
|
27
|
+
jsonResponse(response, 200, {
|
|
28
|
+
ok: true,
|
|
29
|
+
host: body.host,
|
|
30
|
+
sessionId: body.sessionId,
|
|
31
|
+
...(subagentId ? { subagentId } : {}),
|
|
32
|
+
loadedAt: new Date().toISOString(),
|
|
33
|
+
...dialogue,
|
|
34
|
+
});
|
|
25
35
|
return true;
|
|
26
36
|
}
|
|
27
37
|
const agent =
|
|
@@ -31,13 +41,47 @@ export function dialogueRoutes(context) {
|
|
|
31
41
|
jsonResponse(response, 404, { error: "未找到对应的 rollout" });
|
|
32
42
|
return true;
|
|
33
43
|
}
|
|
34
|
-
|
|
44
|
+
let targetRollout = agent.rollout;
|
|
45
|
+
let subagentMeta = null;
|
|
46
|
+
if (subagentId) {
|
|
47
|
+
const hostEntry = getSnapshot?.()?.hosts?.find(
|
|
48
|
+
(item) => item.alias === agent.host,
|
|
49
|
+
);
|
|
50
|
+
const parentId = agent.rollout.id || body.sessionId;
|
|
51
|
+
const foundSub =
|
|
52
|
+
(agent.subagents || []).find((item) => item.id === subagentId) ||
|
|
53
|
+
(hostEntry?.sessions || []).find(
|
|
54
|
+
(item) =>
|
|
55
|
+
item.isSubagent &&
|
|
56
|
+
item.id === subagentId &&
|
|
57
|
+
item.parentThreadId === parentId,
|
|
58
|
+
);
|
|
59
|
+
if (!foundSub?.path) {
|
|
60
|
+
jsonResponse(response, 404, { error: "未找到对应的子代理 rollout" });
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
targetRollout = foundSub;
|
|
64
|
+
subagentMeta = {
|
|
65
|
+
id: foundSub.id,
|
|
66
|
+
agentNickname: foundSub.agentNickname || "",
|
|
67
|
+
agentPath: foundSub.agentPath || "",
|
|
68
|
+
agentRole: foundSub.agentRole || "",
|
|
69
|
+
model: foundSub.model || "",
|
|
70
|
+
turnState: foundSub.turnState || "idle",
|
|
71
|
+
lastAction: foundSub.lastAction || "",
|
|
72
|
+
lastEventAt: foundSub.lastEventAt || null,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const limit = Math.max(
|
|
76
|
+
1,
|
|
77
|
+
Math.min(100, Number(body.limit) || (subagentId ? 40 : 10)),
|
|
78
|
+
);
|
|
35
79
|
const before = Number.isFinite(Number(body.before))
|
|
36
80
|
? Math.max(0, Math.floor(Number(body.before)))
|
|
37
81
|
: "";
|
|
38
82
|
const command = [
|
|
39
83
|
"python3 -",
|
|
40
|
-
shellQuote(
|
|
84
|
+
shellQuote(targetRollout.path),
|
|
41
85
|
shellQuote(String(limit)),
|
|
42
86
|
shellQuote(String(before)),
|
|
43
87
|
shellQuote(body.dialogueOnly ? "dialogue-only" : "full"),
|
|
@@ -62,6 +106,7 @@ export function dialogueRoutes(context) {
|
|
|
62
106
|
ok: true,
|
|
63
107
|
host: agent.host,
|
|
64
108
|
sessionId: agent.rollout.id,
|
|
109
|
+
...(subagentMeta ? { subagentId: subagentMeta.id, subagent: subagentMeta } : {}),
|
|
65
110
|
loadedAt: new Date().toISOString(),
|
|
66
111
|
...dialogue,
|
|
67
112
|
});
|