agent-relay-server 0.12.2 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/index.html +29 -44
- package/src/sse.ts +11 -0
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -125368,54 +125368,39 @@ function BusyIndicator({ blockedLabel, onInterrupt }) {
|
|
|
125368
125368
|
});
|
|
125369
125369
|
}
|
|
125370
125370
|
function ActivityTrace({ steps }) {
|
|
125371
|
-
const [
|
|
125372
|
-
|
|
125373
|
-
|
|
125374
|
-
const summary = (last.label || last.text || "").replace(/\s+/g, " ").trim();
|
|
125371
|
+
const [hideTools, setHideTools] = (0, import_react.useState)(false);
|
|
125372
|
+
if (!steps.length) return null;
|
|
125373
|
+
const toolCount = steps.filter((s) => s.kind === "tool").length;
|
|
125375
125374
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
125376
125375
|
className: "flex justify-start mb-2",
|
|
125377
125376
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
125378
|
-
className: "max-w-[85%] md:max-w-[75%] min-w-0",
|
|
125379
|
-
children: [
|
|
125380
|
-
|
|
125381
|
-
|
|
125382
|
-
|
|
125383
|
-
|
|
125384
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
125385
|
-
className: "truncate",
|
|
125386
|
-
children: expanded ? "Activity" : summary.length > 80 ? `${summary.slice(0, 79)}…` : summary || "thinking"
|
|
125387
|
-
}),
|
|
125388
|
-
steps.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
125389
|
-
className: "opacity-60 shrink-0",
|
|
125390
|
-
children: [
|
|
125391
|
-
"· ",
|
|
125392
|
-
steps.length,
|
|
125393
|
-
" steps"
|
|
125394
|
-
]
|
|
125395
|
-
}),
|
|
125396
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronRight, { className: cn$2("w-3 h-3 shrink-0 transition-transform", expanded && "rotate-90") })
|
|
125397
|
-
]
|
|
125398
|
-
}), expanded && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
125399
|
-
className: "mt-1.5 space-y-1.5 border-l border-foreground/10 pl-2.5",
|
|
125400
|
-
children: steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
125401
|
-
className: "text-xs leading-relaxed",
|
|
125402
|
-
children: step.kind === "reasoning" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
125403
|
-
className: "italic text-muted-foreground/80 whitespace-pre-wrap break-words",
|
|
125377
|
+
className: "max-w-[85%] md:max-w-[75%] min-w-0 space-y-1.5",
|
|
125378
|
+
children: [steps.map((step) => {
|
|
125379
|
+
if (step.kind === "reasoning") return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
125380
|
+
className: "flex items-start gap-1.5 text-xs leading-relaxed text-muted-foreground/80",
|
|
125381
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Brain, { className: "w-3.5 h-3.5 mt-0.5 shrink-0 opacity-70" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
125382
|
+
className: "italic whitespace-pre-wrap break-words min-w-0",
|
|
125404
125383
|
children: step.text
|
|
125405
|
-
})
|
|
125406
|
-
|
|
125407
|
-
|
|
125408
|
-
|
|
125409
|
-
|
|
125410
|
-
|
|
125411
|
-
|
|
125412
|
-
|
|
125413
|
-
|
|
125414
|
-
|
|
125415
|
-
|
|
125416
|
-
|
|
125417
|
-
|
|
125418
|
-
|
|
125384
|
+
})]
|
|
125385
|
+
}, step.id);
|
|
125386
|
+
if (hideTools) return null;
|
|
125387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
125388
|
+
className: "flex items-start gap-1.5 text-xs leading-relaxed text-muted-foreground",
|
|
125389
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Terminal, { className: "w-3 h-3 mt-0.5 shrink-0 opacity-70" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
125390
|
+
className: "min-w-0 break-words",
|
|
125391
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
125392
|
+
className: "font-medium",
|
|
125393
|
+
children: step.label || "tool"
|
|
125394
|
+
}), step.text ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
|
|
125395
|
+
className: "opacity-70",
|
|
125396
|
+
children: [" — ", step.text]
|
|
125397
|
+
}) : null]
|
|
125398
|
+
})]
|
|
125399
|
+
}, step.id);
|
|
125400
|
+
}), toolCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
125401
|
+
onClick: () => setHideTools((v) => !v),
|
|
125402
|
+
className: "flex items-center gap-1 text-[11px] text-muted-foreground/50 hover:text-muted-foreground transition-colors text-left",
|
|
125403
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronRight, { className: cn$2("w-3 h-3 shrink-0 transition-transform", !hideTools && "rotate-90") }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: hideTools ? `show ${toolCount} tool step${toolCount === 1 ? "" : "s"}` : "hide tool steps" })]
|
|
125419
125404
|
})]
|
|
125420
125405
|
})
|
|
125421
125406
|
});
|
package/src/sse.ts
CHANGED
|
@@ -252,8 +252,19 @@ function isInboundChannelMessage(msg: Message): boolean {
|
|
|
252
252
|
return msg.kind === "channel.event" && direction === "inbound" && event?.type === "message.created";
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
+
function sessionMirrorType(msg: Message): string | undefined {
|
|
256
|
+
const session = isRecord(msg.payload?.session) ? msg.payload.session : undefined;
|
|
257
|
+
return typeof session?.type === "string" ? session.type : undefined;
|
|
258
|
+
}
|
|
259
|
+
|
|
255
260
|
function notificationForMessage(msg: Message): RelayNotification | undefined {
|
|
256
261
|
if (msg.from === "user") return undefined;
|
|
262
|
+
// Session-mirror activity (reasoning/tool/notice) is high-frequency telemetry, not
|
|
263
|
+
// something to notify on. Only the response turn warrants a notification; interactive
|
|
264
|
+
// prompts (AskUserQuestion, permission, plan-mode) notify via providerState in
|
|
265
|
+
// notificationForAgentStatus, not here — so suppressing non-response session events
|
|
266
|
+
// doesn't silence anything the user must act on.
|
|
267
|
+
if (msg.kind === "session" && sessionMirrorType(msg) !== "response") return undefined;
|
|
257
268
|
const isDirectToUser = msg.to === "user";
|
|
258
269
|
const isChannelInbound = isInboundChannelMessage(msg);
|
|
259
270
|
if (!isDirectToUser && !isChannelInbound) return undefined;
|