agent-relay-server 0.12.0 → 0.12.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/index.html +181 -29
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay-server",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "description": "Lightweight HTTP message relay for inter-agent communication across machines",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/public/index.html CHANGED
@@ -123798,6 +123798,68 @@ function Input({ className, type, ...props }) {
123798
123798
  });
123799
123799
  }
123800
123800
  //#endregion
123801
+ //#region src/components/shared/zoomable-image.tsx
123802
+ function ImageLightbox({ src, alt, onClose }) {
123803
+ const [zoomed, setZoomed] = (0, import_react.useState)(false);
123804
+ (0, import_react.useEffect)(() => {
123805
+ const prev = document.body.style.overflow;
123806
+ document.body.style.overflow = "hidden";
123807
+ function onKey(e) {
123808
+ if (e.key === "Escape") onClose();
123809
+ }
123810
+ document.addEventListener("keydown", onKey);
123811
+ return () => {
123812
+ document.body.style.overflow = prev;
123813
+ document.removeEventListener("keydown", onKey);
123814
+ };
123815
+ }, [onClose]);
123816
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
123817
+ className: "fixed inset-0 z-[100] flex flex-col bg-black/95",
123818
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
123819
+ className: "flex shrink-0 items-center justify-end gap-2 p-2",
123820
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
123821
+ type: "button",
123822
+ className: "rounded-full bg-white/10 p-2 text-white/70 hover:bg-white/20 hover:text-white",
123823
+ onClick: () => setZoomed(!zoomed),
123824
+ title: zoomed ? "Fit to screen" : "Actual size",
123825
+ children: zoomed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ZoomOut, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ZoomIn, { className: "h-4 w-4" })
123826
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
123827
+ type: "button",
123828
+ className: "rounded-full bg-white/10 p-2 text-white/70 hover:bg-white/20 hover:text-white",
123829
+ onClick: onClose,
123830
+ title: "Close",
123831
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(X$3, { className: "h-4 w-4" })
123832
+ })]
123833
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
123834
+ className: `min-h-0 flex-1 ${zoomed ? "overflow-auto" : "flex items-center justify-center overflow-hidden p-4"}`,
123835
+ onClick: zoomed ? void 0 : onClose,
123836
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
123837
+ src,
123838
+ alt,
123839
+ className: zoomed ? "max-w-none" : "max-h-full max-w-full cursor-zoom-in object-contain",
123840
+ onClick: (e) => {
123841
+ e.stopPropagation();
123842
+ setZoomed(!zoomed);
123843
+ }
123844
+ })
123845
+ })]
123846
+ });
123847
+ }
123848
+ function ZoomableImage({ src, alt = "", className, style }) {
123849
+ const [open, setOpen] = (0, import_react.useState)(false);
123850
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
123851
+ src,
123852
+ alt,
123853
+ className: `${className || ""} cursor-zoom-in`,
123854
+ style,
123855
+ onClick: () => setOpen(true)
123856
+ }), open && (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageLightbox, {
123857
+ src,
123858
+ alt,
123859
+ onClose: () => setOpen(false)
123860
+ }), document.body)] });
123861
+ }
123862
+ //#endregion
123801
123863
  //#region src/components/shared/markdown-preview.tsx
123802
123864
  var markdownSchema = {
123803
123865
  ...defaultSchema,
@@ -123815,7 +123877,7 @@ function externalLinkProps(href) {
123815
123877
  }
123816
123878
  function MarkdownPreview({ content, path }) {
123817
123879
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
123818
- className: "markdown-preview max-w-none p-4 text-sm leading-6",
123880
+ className: "markdown-preview max-w-none overflow-hidden p-4 text-sm leading-6",
123819
123881
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
123820
123882
  remarkPlugins: [remarkGfm],
123821
123883
  rehypePlugins: [[rehypeSanitize, markdownSchema]],
@@ -123827,6 +123889,14 @@ function MarkdownPreview({ content, path }) {
123827
123889
  children
123828
123890
  });
123829
123891
  },
123892
+ img({ src, alt }) {
123893
+ if (!src) return null;
123894
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ZoomableImage, {
123895
+ src,
123896
+ alt,
123897
+ className: "max-w-full"
123898
+ });
123899
+ },
123830
123900
  code({ className, children, ...props }) {
123831
123901
  const match = /language-([\w-]+)/.exec(className || "");
123832
123902
  const code = String(children).replace(/\n$/, "");
@@ -124030,18 +124100,18 @@ function useFileListing(orchestratorId, selectedPath, git = false) {
124030
124100
  }
124031
124101
  function RawTextContent({ content, line, lineRef }) {
124032
124102
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
124033
- className: "min-w-full py-2 font-mono text-xs leading-5",
124103
+ className: "w-full py-2 font-mono text-xs leading-5",
124034
124104
  children: content.split("\n").map((text, index) => {
124035
124105
  const lineNumber = index + 1;
124036
124106
  const active = lineNumber === line;
124037
124107
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124038
124108
  ref: active ? lineRef : void 0,
124039
- className: `grid grid-cols-[4rem_minmax(0,1fr)] px-2 ${active ? "bg-primary/15" : ""}`,
124109
+ className: `grid grid-cols-[2.5rem_minmax(0,1fr)] px-1 sm:grid-cols-[4rem_minmax(0,1fr)] sm:px-2 ${active ? "bg-primary/15" : ""}`,
124040
124110
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
124041
- className: "select-none pr-3 text-right text-muted-foreground",
124111
+ className: "select-none pr-2 text-right text-muted-foreground sm:pr-3",
124042
124112
  children: lineNumber
124043
124113
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
124044
- className: "overflow-visible whitespace-pre-wrap break-words",
124114
+ className: "overflow-hidden whitespace-pre-wrap break-words",
124045
124115
  children: text || " "
124046
124116
  })]
124047
124117
  }, lineNumber);
@@ -124183,7 +124253,7 @@ function FileContent({ orchestratorId, selectedPath, line, onReadError }) {
124183
124253
  ]
124184
124254
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
124185
124255
  className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4",
124186
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
124256
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ZoomableImage, {
124187
124257
  src: `data:${file.mediaType};base64,${file.content ?? ""}`,
124188
124258
  alt: file.name,
124189
124259
  className: "max-h-full max-w-full object-contain",
@@ -124375,7 +124445,7 @@ function FileBrowser({ overlay = false }) {
124375
124445
  className: overlay ? "flex h-full flex-col" : "flex h-[calc(100dvh-5rem)] flex-col gap-3 md:gap-4",
124376
124446
  children: [
124377
124447
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124378
- className: "flex flex-wrap items-center gap-2",
124448
+ className: `flex flex-wrap items-center gap-2 ${selectedPath ? "hidden md:flex" : ""}`,
124379
124449
  children: [
124380
124450
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124381
124451
  className: "flex items-center gap-2 text-lg font-semibold",
@@ -124404,7 +124474,7 @@ function FileBrowser({ overlay = false }) {
124404
124474
  ]
124405
124475
  }),
124406
124476
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124407
- className: "flex flex-wrap items-center gap-2",
124477
+ className: `flex flex-wrap items-center gap-2 ${selectedPath ? "hidden md:flex" : ""}`,
124408
124478
  children: [
124409
124479
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
124410
124480
  value: pathDraft,
@@ -124462,7 +124532,7 @@ function FileBrowser({ overlay = false }) {
124462
124532
  ]
124463
124533
  }),
124464
124534
  segments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
124465
- className: "flex flex-wrap items-center gap-1 text-xs text-muted-foreground",
124535
+ className: `flex flex-wrap items-center gap-1 text-xs text-muted-foreground ${selectedPath ? "hidden md:flex" : ""}`,
124466
124536
  children: segments.map((segment, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
124467
124537
  type: "button",
124468
124538
  className: "rounded px-1.5 py-0.5 font-mono hover:bg-accent hover:text-foreground",
@@ -124479,7 +124549,7 @@ function FileBrowser({ overlay = false }) {
124479
124549
  children: visibleError
124480
124550
  }),
124481
124551
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124482
- className: "grid min-h-0 flex-1 overflow-hidden rounded-md border border-border md:grid-cols-[22rem_minmax(0,1fr)]",
124552
+ className: `grid min-h-0 flex-1 overflow-hidden md:rounded-md md:border md:border-border md:grid-cols-[22rem_minmax(0,1fr)] ${selectedPath ? "" : "rounded-md border border-border"}`,
124483
124553
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124484
124554
  className: `min-h-0 overflow-auto border-b border-border bg-card md:border-b-0 md:border-r ${selectedPath ? "hidden md:block" : ""}`,
124485
124555
  children: [
@@ -124522,7 +124592,7 @@ function FileBrowser({ overlay = false }) {
124522
124592
  })
124523
124593
  ]
124524
124594
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
124525
- className: `flex min-h-0 flex-col ${selectedPath ? "" : "hidden md:flex"}`,
124595
+ className: `flex min-h-0 flex-col overflow-hidden ${selectedPath ? "" : "hidden md:flex"}`,
124526
124596
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
124527
124597
  type: "button",
124528
124598
  className: "flex items-center gap-1.5 border-b border-border px-3 py-2 text-xs text-muted-foreground hover:text-foreground md:hidden",
@@ -127481,11 +127551,12 @@ function LogViewer({ orchestratorId, session, lines = 200 }) {
127481
127551
  const [logLines, setLogLines] = (0, import_react.useState)([]);
127482
127552
  const [query, setQuery] = (0, import_react.useState)("");
127483
127553
  const [paused, setPaused] = (0, import_react.useState)(false);
127554
+ const [stream, setStream] = (0, import_react.useState)("provider");
127484
127555
  const [error, setError] = (0, import_react.useState)(null);
127485
127556
  async function load() {
127486
127557
  if (paused) return;
127487
127558
  try {
127488
- setLogLines((await apiCall("GET", `/orchestrators/${encodeURIComponent(orchestratorId)}/logs/${encodeURIComponent(session)}?lines=${lines}`)).lines || []);
127559
+ setLogLines((await apiCall("GET", `/orchestrators/${encodeURIComponent(orchestratorId)}/logs/${encodeURIComponent(session)}?lines=${lines}${stream === "mirror" ? "&stream=mirror" : ""}`)).lines || []);
127489
127560
  setError(null);
127490
127561
  } catch (e) {
127491
127562
  setError(e instanceof Error ? e.message : String(e));
@@ -127498,7 +127569,8 @@ function LogViewer({ orchestratorId, session, lines = 200 }) {
127498
127569
  }, [
127499
127570
  orchestratorId,
127500
127571
  session,
127501
- paused
127572
+ paused,
127573
+ stream
127502
127574
  ]);
127503
127575
  const visible = query ? logLines.filter((line) => line.toLowerCase().includes(query.toLowerCase())) : logLines;
127504
127576
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
@@ -127516,6 +127588,22 @@ function LogViewer({ orchestratorId, session, lines = 200 }) {
127516
127588
  placeholder: "Search logs"
127517
127589
  })]
127518
127590
  }),
127591
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
127592
+ className: "flex rounded-md border border-border overflow-hidden",
127593
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
127594
+ type: "button",
127595
+ onClick: () => setStream("provider"),
127596
+ title: "Provider output",
127597
+ className: cn$2("flex items-center gap-1 px-2 py-1.5 text-xs", stream === "provider" ? "bg-accent text-accent-foreground" : "text-muted-foreground hover:bg-accent/50"),
127598
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Terminal, { className: "h-3.5 w-3.5" }), " Output"]
127599
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
127600
+ type: "button",
127601
+ onClick: () => setStream("mirror"),
127602
+ title: "Session-mirror diagnostics (clean)",
127603
+ className: cn$2("flex items-center gap-1 px-2 py-1.5 text-xs border-l border-border", stream === "mirror" ? "bg-accent text-accent-foreground" : "text-muted-foreground hover:bg-accent/50"),
127604
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Brain, { className: "h-3.5 w-3.5" }), " Mirror"]
127605
+ })]
127606
+ }),
127519
127607
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button, {
127520
127608
  type: "button",
127521
127609
  variant: "outline",
@@ -157588,6 +157676,10 @@ if ("serviceWorker" in navigator) {
157588
157676
  z-index: 50;
157589
157677
  }
157590
157678
 
157679
+ .z-\[100\] {
157680
+ z-index: 100;
157681
+ }
157682
+
157591
157683
  .col-span-2 {
157592
157684
  grid-column: span 2 / span 2;
157593
157685
  }
@@ -158311,10 +158403,6 @@ if ("serviceWorker" in navigator) {
158311
158403
  min-width: 980px;
158312
158404
  }
158313
158405
 
158314
- .min-w-full {
158315
- min-width: 100%;
158316
- }
158317
-
158318
158406
  .flex-1 {
158319
158407
  flex: 1;
158320
158408
  }
@@ -158417,6 +158505,10 @@ if ("serviceWorker" in navigator) {
158417
158505
  cursor: pointer;
158418
158506
  }
158419
158507
 
158508
+ .cursor-zoom-in {
158509
+ cursor: zoom-in;
158510
+ }
158511
+
158420
158512
  .touch-none {
158421
158513
  touch-action: none;
158422
158514
  }
@@ -158457,12 +158549,12 @@ if ("serviceWorker" in navigator) {
158457
158549
  grid-template-columns: 1fr auto;
158458
158550
  }
158459
158551
 
158460
- .grid-cols-\[4\.5rem_minmax\(0\,1fr\)\] {
158461
- grid-template-columns: 4.5rem minmax(0, 1fr);
158552
+ .grid-cols-\[2\.5rem_minmax\(0\,1fr\)\] {
158553
+ grid-template-columns: 2.5rem minmax(0, 1fr);
158462
158554
  }
158463
158555
 
158464
- .grid-cols-\[4rem_minmax\(0\,1fr\)\] {
158465
- grid-template-columns: 4rem minmax(0, 1fr);
158556
+ .grid-cols-\[4\.5rem_minmax\(0\,1fr\)\] {
158557
+ grid-template-columns: 4.5rem minmax(0, 1fr);
158466
158558
  }
158467
158559
 
158468
158560
  .grid-cols-\[minmax\(10rem\,1fr\)_8rem_8rem_7rem_7rem_5rem\] {
@@ -158663,10 +158755,6 @@ if ("serviceWorker" in navigator) {
158663
158755
  overflow: hidden;
158664
158756
  }
158665
158757
 
158666
- .overflow-visible {
158667
- overflow: visible;
158668
- }
158669
-
158670
158758
  .overflow-x-auto {
158671
158759
  overflow-x: auto;
158672
158760
  }
@@ -159787,6 +159875,16 @@ if ("serviceWorker" in navigator) {
159787
159875
  }
159788
159876
  }
159789
159877
 
159878
+ .bg-white\/10 {
159879
+ background-color: #ffffff1a;
159880
+ }
159881
+
159882
+ @supports (color: color-mix(in lab, red, red)) {
159883
+ .bg-white\/10 {
159884
+ background-color: color-mix(in oklab, var(--color-white) 10%, transparent);
159885
+ }
159886
+ }
159887
+
159790
159888
  .bg-yellow-400 {
159791
159889
  background-color: var(--color-yellow-400);
159792
159890
  }
@@ -160061,10 +160159,6 @@ if ("serviceWorker" in navigator) {
160061
160159
  padding-right: calc(var(--spacing) * 2);
160062
160160
  }
160063
160161
 
160064
- .pr-3 {
160065
- padding-right: calc(var(--spacing) * 3);
160066
- }
160067
-
160068
160162
  .pr-4 {
160069
160163
  padding-right: calc(var(--spacing) * 4);
160070
160164
  }
@@ -160281,6 +160375,10 @@ if ("serviceWorker" in navigator) {
160281
160375
  white-space: pre-wrap;
160282
160376
  }
160283
160377
 
160378
+ .text-accent-foreground {
160379
+ color: var(--accent-foreground);
160380
+ }
160381
+
160284
160382
  .text-amber-50\/55 {
160285
160383
  color: #fffbeb8c;
160286
160384
  }
@@ -160563,6 +160661,16 @@ if ("serviceWorker" in navigator) {
160563
160661
  color: var(--color-white);
160564
160662
  }
160565
160663
 
160664
+ .text-white\/70 {
160665
+ color: #ffffffb3;
160666
+ }
160667
+
160668
+ @supports (color: color-mix(in lab, red, red)) {
160669
+ .text-white\/70 {
160670
+ color: color-mix(in oklab, var(--color-white) 70%, transparent);
160671
+ }
160672
+ }
160673
+
160566
160674
  .text-yellow-200\/80 {
160567
160675
  color: #fff085cc;
160568
160676
  }
@@ -161213,6 +161321,16 @@ if ("serviceWorker" in navigator) {
161213
161321
  }
161214
161322
  }
161215
161323
 
161324
+ .hover\:bg-white\/20:hover {
161325
+ background-color: #fff3;
161326
+ }
161327
+
161328
+ @supports (color: color-mix(in lab, red, red)) {
161329
+ .hover\:bg-white\/20:hover {
161330
+ background-color: color-mix(in oklab, var(--color-white) 20%, transparent);
161331
+ }
161332
+ }
161333
+
161216
161334
  .hover\:bg-zinc-800\/50:hover {
161217
161335
  background-color: #27272a80;
161218
161336
  }
@@ -161259,6 +161377,10 @@ if ("serviceWorker" in navigator) {
161259
161377
  color: var(--color-violet-300);
161260
161378
  }
161261
161379
 
161380
+ .hover\:text-white:hover {
161381
+ color: var(--color-white);
161382
+ }
161383
+
161262
161384
  .hover\:text-zinc-100:hover {
161263
161385
  color: var(--color-zinc-100);
161264
161386
  }
@@ -161793,6 +161915,10 @@ if ("serviceWorker" in navigator) {
161793
161915
  grid-template-columns: repeat(3, minmax(0, 1fr));
161794
161916
  }
161795
161917
 
161918
+ .sm\:grid-cols-\[4rem_minmax\(0\,1fr\)\] {
161919
+ grid-template-columns: 4rem minmax(0, 1fr);
161920
+ }
161921
+
161796
161922
  .sm\:flex-row {
161797
161923
  flex-direction: row;
161798
161924
  }
@@ -161801,6 +161927,14 @@ if ("serviceWorker" in navigator) {
161801
161927
  justify-content: flex-end;
161802
161928
  }
161803
161929
 
161930
+ .sm\:px-2 {
161931
+ padding-inline: calc(var(--spacing) * 2);
161932
+ }
161933
+
161934
+ .sm\:pr-3 {
161935
+ padding-right: calc(var(--spacing) * 3);
161936
+ }
161937
+
161804
161938
  .sm\:opacity-0 {
161805
161939
  opacity: 0;
161806
161940
  }
@@ -161885,6 +162019,15 @@ if ("serviceWorker" in navigator) {
161885
162019
  gap: calc(var(--spacing) * 4);
161886
162020
  }
161887
162021
 
162022
+ .md\:rounded-md {
162023
+ border-radius: calc(var(--radius) * .8);
162024
+ }
162025
+
162026
+ .md\:border {
162027
+ border-style: var(--tw-border-style);
162028
+ border-width: 1px;
162029
+ }
162030
+
161888
162031
  .md\:border-r {
161889
162032
  border-right-style: var(--tw-border-style);
161890
162033
  border-right-width: 1px;
@@ -161895,6 +162038,10 @@ if ("serviceWorker" in navigator) {
161895
162038
  border-bottom-width: 0;
161896
162039
  }
161897
162040
 
162041
+ .md\:border-border {
162042
+ border-color: var(--border);
162043
+ }
162044
+
161898
162045
  .md\:p-6 {
161899
162046
  padding: calc(var(--spacing) * 6);
161900
162047
  }
@@ -163201,6 +163348,11 @@ if ("serviceWorker" in navigator) {
163201
163348
  font-size: .85em;
163202
163349
  }
163203
163350
 
163351
+ .markdown-preview img {
163352
+ max-width: 100%;
163353
+ height: auto;
163354
+ }
163355
+
163204
163356
  .markdown-preview pre {
163205
163357
  border: 1px solid var(--border);
163206
163358
  background: var(--muted);