@robota-sdk/agent-ui-web 3.0.7 → 3.1.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.
@@ -4290,6 +4290,16 @@ function otherClients(session, isCurrent) {
4290
4290
  return others >= 1 ? others : null;
4291
4291
  }
4292
4292
  /**
4293
+ * The line for sealed sessions the host cannot open: the listing leaves them out, so without it they
4294
+ * would read as gone. The host's keys may be locked or may not open them at all, and which does not
4295
+ * cross the wire, so it never says to unlock. Same wording as the terminal's for a host's listing,
4296
+ * which this package does not depend on.
4297
+ */
4298
+ function lockedSessionsLine(count) {
4299
+ if (count === void 0 || count <= 0) return null;
4300
+ return count === 1 ? "1 saved session is sealed and not listed here." : `${count} saved sessions are sealed and not listed here.`;
4301
+ }
4302
+ /**
4293
4303
  * #3189 — this workspace's sessions on the left of the conversation, as in Claude Code Desktop:
4294
4304
  * start a new one, or click another to make it current. Rows the host could not read are listed,
4295
4305
  * disabled, so a damaged session never looks deleted. A refused switch comes back as a notice.
@@ -4303,6 +4313,7 @@ function SessionSidebar({ state, brand, className }) {
4303
4313
  const listing = state.sessionListing ?? null;
4304
4314
  const current = listing?.currentSessionId ?? null;
4305
4315
  const unreadable = listing?.unreadableSessionIds ?? [];
4316
+ const lockedLine = lockedSessionsLine(listing?.lockedSessionCount);
4306
4317
  const failed = state.sessionsError?.code === "list_failed" ? state.sessionsError.message : null;
4307
4318
  const connected = state.status === "connected";
4308
4319
  const [menu, setMenu] = useState(null);
@@ -4403,121 +4414,128 @@ function SessionSidebar({ state, brand, className }) {
4403
4414
  }) : null,
4404
4415
  /* @__PURE__ */ jsxs("ul", {
4405
4416
  className: "space-y-px",
4406
- children: [rows.map((session) => {
4407
- const isCurrent = session.id === current;
4408
- const others = otherClients(session, isCurrent);
4409
- const isRenaming = renamingId === session.id;
4410
- const statusParts = [session.live === true ? "Live" : null, others !== null ? `${others} ${others === 1 ? "other" : "others"}` : null].filter((part) => part !== null);
4411
- const statusId = `session-status-${session.id}`;
4412
- const updatedId = `session-updated-${session.id}`;
4413
- const describedBy = statusParts.length > 0 ? `${updatedId} ${statusId}` : updatedId;
4414
- return /* @__PURE__ */ jsxs("li", {
4415
- className: "group relative",
4416
- children: [isRenaming ? /* @__PURE__ */ jsx("input", {
4417
- autoFocus: true,
4418
- "aria-label": `Rename ${sessionTitle(session)}`,
4419
- value: renameValue,
4420
- onChange: (event) => setRenameValue(event.target.value),
4421
- onBlur: () => saveRename(session),
4422
- onKeyDown: (event) => {
4423
- if (event.key === "Enter") {
4424
- event.preventDefault();
4425
- saveRename(session);
4426
- } else if (event.key === "Escape") {
4417
+ children: [
4418
+ rows.map((session) => {
4419
+ const isCurrent = session.id === current;
4420
+ const others = otherClients(session, isCurrent);
4421
+ const isRenaming = renamingId === session.id;
4422
+ const statusParts = [session.live === true ? "Live" : null, others !== null ? `${others} ${others === 1 ? "other" : "others"}` : null].filter((part) => part !== null);
4423
+ const statusId = `session-status-${session.id}`;
4424
+ const updatedId = `session-updated-${session.id}`;
4425
+ const describedBy = statusParts.length > 0 ? `${updatedId} ${statusId}` : updatedId;
4426
+ return /* @__PURE__ */ jsxs("li", {
4427
+ className: "group relative",
4428
+ children: [isRenaming ? /* @__PURE__ */ jsx("input", {
4429
+ autoFocus: true,
4430
+ "aria-label": `Rename ${sessionTitle(session)}`,
4431
+ value: renameValue,
4432
+ onChange: (event) => setRenameValue(event.target.value),
4433
+ onBlur: () => saveRename(session),
4434
+ onKeyDown: (event) => {
4435
+ if (event.key === "Enter") {
4436
+ event.preventDefault();
4437
+ saveRename(session);
4438
+ } else if (event.key === "Escape") {
4439
+ event.preventDefault();
4440
+ setRenamingId(null);
4441
+ }
4442
+ },
4443
+ className: "w-full rounded-lg border border-accent bg-raised px-2.5 py-2 text-[14px] text-foreground outline-none"
4444
+ }) : /* @__PURE__ */ jsxs("button", {
4445
+ type: "button",
4446
+ "aria-current": isCurrent ? "true" : void 0,
4447
+ "aria-label": sessionTitle(session),
4448
+ "aria-describedby": describedBy,
4449
+ title: connected ? session.preview || session.id : "Reconnecting…",
4450
+ disabled: !connected,
4451
+ onClick: () => {
4452
+ if (!isCurrent) state.switchSession?.(session.id);
4453
+ },
4454
+ onContextMenu: (event) => {
4427
4455
  event.preventDefault();
4428
- setRenamingId(null);
4429
- }
4430
- },
4431
- className: "w-full rounded-lg border border-accent bg-raised px-2.5 py-2 text-[14px] text-foreground outline-none"
4432
- }) : /* @__PURE__ */ jsxs("button", {
4433
- type: "button",
4434
- "aria-current": isCurrent ? "true" : void 0,
4435
- "aria-label": sessionTitle(session),
4436
- "aria-describedby": describedBy,
4437
- title: connected ? session.preview || session.id : "Reconnecting…",
4438
- disabled: !connected,
4439
- onClick: () => {
4440
- if (!isCurrent) state.switchSession?.(session.id);
4441
- },
4442
- onContextMenu: (event) => {
4443
- event.preventDefault();
4444
- openMenuAt(session.id, event.clientX, event.clientY);
4445
- },
4446
- className: `w-full rounded-lg py-2 pl-2.5 pr-8 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${isCurrent ? "bg-raised" : "hover:bg-hover"}`,
4447
- children: [/* @__PURE__ */ jsx("span", {
4448
- className: `block truncate text-[14px] leading-snug ${isCurrent ? "font-medium text-foreground" : "text-foreground/85"}`,
4449
- children: sessionTitle(session)
4450
- }), /* @__PURE__ */ jsxs("span", {
4451
- className: "mt-0.5 flex items-center gap-1.5 text-[12.5px] tabular-nums text-subtle",
4452
- children: [
4453
- session.live === true ? /* @__PURE__ */ jsx("span", {
4454
- title: "Live in the host",
4455
- className: "h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent",
4456
- children: /* @__PURE__ */ jsx("span", {
4456
+ openMenuAt(session.id, event.clientX, event.clientY);
4457
+ },
4458
+ className: `w-full rounded-lg py-2 pl-2.5 pr-8 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${isCurrent ? "bg-raised" : "hover:bg-hover"}`,
4459
+ children: [/* @__PURE__ */ jsx("span", {
4460
+ className: `block truncate text-[14px] leading-snug ${isCurrent ? "font-medium text-foreground" : "text-foreground/85"}`,
4461
+ children: sessionTitle(session)
4462
+ }), /* @__PURE__ */ jsxs("span", {
4463
+ className: "mt-0.5 flex items-center gap-1.5 text-[12.5px] tabular-nums text-subtle",
4464
+ children: [
4465
+ session.live === true ? /* @__PURE__ */ jsx("span", {
4466
+ title: "Live in the host",
4467
+ className: "h-1.5 w-1.5 flex-shrink-0 rounded-full bg-accent",
4468
+ children: /* @__PURE__ */ jsx("span", {
4469
+ className: "sr-only",
4470
+ children: "live"
4471
+ })
4472
+ }) : null,
4473
+ /* @__PURE__ */ jsx("span", {
4474
+ id: updatedId,
4475
+ children: formatUpdatedAt(session.updatedAt)
4476
+ }),
4477
+ others !== null ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
4478
+ "aria-hidden": "true",
4479
+ children: "·"
4480
+ }), /* @__PURE__ */ jsxs("span", {
4481
+ className: "text-muted-foreground",
4482
+ children: [
4483
+ others,
4484
+ " ",
4485
+ others === 1 ? "other" : "others"
4486
+ ]
4487
+ })] }) : null,
4488
+ statusParts.length > 0 ? /* @__PURE__ */ jsx("span", {
4489
+ id: statusId,
4457
4490
  className: "sr-only",
4458
- children: "live"
4459
- })
4460
- }) : null,
4461
- /* @__PURE__ */ jsx("span", {
4462
- id: updatedId,
4463
- children: formatUpdatedAt(session.updatedAt)
4464
- }),
4465
- others !== null ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
4466
- "aria-hidden": "true",
4467
- children: "·"
4468
- }), /* @__PURE__ */ jsxs("span", {
4469
- className: "text-muted-foreground",
4470
- children: [
4471
- others,
4472
- " ",
4473
- others === 1 ? "other" : "others"
4474
- ]
4475
- })] }) : null,
4476
- statusParts.length > 0 ? /* @__PURE__ */ jsx("span", {
4477
- id: statusId,
4478
- className: "sr-only",
4479
- children: statusParts.join(", ")
4480
- }) : null
4481
- ]
4482
- })]
4483
- }), !isRenaming ? /* @__PURE__ */ jsx("button", {
4484
- type: "button",
4485
- ref: (el) => {
4486
- if (el) moreButtonRefs.current.set(session.id, el);
4487
- else moreButtonRefs.current.delete(session.id);
4488
- },
4489
- "aria-label": `More for ${sessionTitle(session)}`,
4490
- "aria-haspopup": "menu",
4491
- "aria-expanded": menu?.sessionId === session.id,
4492
- onClick: (event) => {
4493
- const rect = event.currentTarget.getBoundingClientRect();
4494
- openMenuAt(session.id, rect.left, rect.bottom);
4495
- },
4496
- className: "absolute right-1 top-1/2 -translate-y-1/2 rounded-md p-1 text-muted-foreground opacity-0 hover:bg-hover hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100",
4497
- children: /* @__PURE__ */ jsx(MoreHorizontal, {
4498
- size: 15,
4499
- strokeWidth: 1.75
4500
- })
4501
- }) : null]
4502
- }, session.id);
4503
- }), unreadable.length > 0 && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("details", {
4504
- className: "px-2.5 py-2 text-[12.5px] text-subtle",
4505
- children: [/* @__PURE__ */ jsxs("summary", {
4506
- className: "cursor-pointer text-muted-foreground hover:text-foreground",
4507
- children: [
4508
- unreadable.length,
4509
- " older ",
4510
- unreadable.length === 1 ? "session" : "sessions",
4511
- " in this folder can't be opened"
4512
- ]
4513
- }), /* @__PURE__ */ jsx("ul", {
4514
- className: "mt-1.5 space-y-0.5 font-mono text-[11.5px]",
4515
- children: unreadable.map((id) => /* @__PURE__ */ jsx("li", {
4516
- className: "truncate",
4517
- children: id
4518
- }, id))
4519
- })]
4520
- }) })]
4491
+ children: statusParts.join(", ")
4492
+ }) : null
4493
+ ]
4494
+ })]
4495
+ }), !isRenaming ? /* @__PURE__ */ jsx("button", {
4496
+ type: "button",
4497
+ ref: (el) => {
4498
+ if (el) moreButtonRefs.current.set(session.id, el);
4499
+ else moreButtonRefs.current.delete(session.id);
4500
+ },
4501
+ "aria-label": `More for ${sessionTitle(session)}`,
4502
+ "aria-haspopup": "menu",
4503
+ "aria-expanded": menu?.sessionId === session.id,
4504
+ onClick: (event) => {
4505
+ const rect = event.currentTarget.getBoundingClientRect();
4506
+ openMenuAt(session.id, rect.left, rect.bottom);
4507
+ },
4508
+ className: "absolute right-1 top-1/2 -translate-y-1/2 rounded-md p-1 text-muted-foreground opacity-0 hover:bg-hover hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100",
4509
+ children: /* @__PURE__ */ jsx(MoreHorizontal, {
4510
+ size: 15,
4511
+ strokeWidth: 1.75
4512
+ })
4513
+ }) : null]
4514
+ }, session.id);
4515
+ }),
4516
+ unreadable.length > 0 && /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("details", {
4517
+ className: "px-2.5 py-2 text-[12.5px] text-subtle",
4518
+ children: [/* @__PURE__ */ jsxs("summary", {
4519
+ className: "cursor-pointer text-muted-foreground hover:text-foreground",
4520
+ children: [
4521
+ unreadable.length,
4522
+ " older ",
4523
+ unreadable.length === 1 ? "session" : "sessions",
4524
+ " in this folder can't be opened"
4525
+ ]
4526
+ }), /* @__PURE__ */ jsx("ul", {
4527
+ className: "mt-1.5 space-y-0.5 font-mono text-[11.5px]",
4528
+ children: unreadable.map((id) => /* @__PURE__ */ jsx("li", {
4529
+ className: "truncate",
4530
+ children: id
4531
+ }, id))
4532
+ })]
4533
+ }) }),
4534
+ lockedLine !== null && /* @__PURE__ */ jsx("li", {
4535
+ className: "px-2.5 py-2 text-[12.5px] text-subtle",
4536
+ children: lockedLine
4537
+ })
4538
+ ]
4521
4539
  })
4522
4540
  ]
4523
4541
  }),