reflet-sdk 0.6.6 → 0.6.8

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.
@@ -1,5 +1,5 @@
1
- import { a as EDITORS, c as handoffFileSchema, d as sessionEvidenceSchema, f as sessionHandoffSchema, g as sessionSummarySchema, h as sessionSegmentSchema, l as sessionApiErrorSchema, m as sessionProposalSchema, n as DEVTOOLS_REQUEST_HEADER, p as sessionIdentitySchema, r as DEVTOOLS_ROUTE_BASE, s as analysisStatusSchema, t as DEVTOOLS_ENDPOINTS, u as sessionDetailSchema } from "./protocol-vJhQHTcB.js";
2
- import { B as clip, D as MoreIcon, G as describeElement, K as getElementRect, M as TargetIcon, R as DEFAULT_WIDGET_LABELS, T as GripIcon, W as buildSelector, Y as redactUrl, Z as inspectReactElement, _ as matchesHotkey, a as uploadBlob, c as useFloatingPosition, g as isSubmitEnter, it as releaseCapture, j as Svg, l as onViewportChange, m as startsInWidget, o as ElementPicker, p as listenToKeydown, q as REDACT_ATTRIBUTE, tt as captureViewport, u as visibleViewport, w as CloseIcon } from "./submit-DYGZQVdG.js";
1
+ import { a as EDITORS, c as handoffFileSchema, d as sessionEvidenceSchema, f as sessionHandoffSchema, g as sessionSummarySchema, h as sessionSegmentSchema, l as sessionApiErrorSchema, m as sessionProposalSchema, n as DEVTOOLS_REQUEST_HEADER, p as sessionIdentitySchema, r as DEVTOOLS_ROUTE_BASE, s as analysisStatusSchema, t as DEVTOOLS_ENDPOINTS, u as sessionDetailSchema } from "./protocol-Cg_cI4xS.js";
2
+ import { B as clip, D as MoreIcon, G as describeElement, K as getElementRect, M as TargetIcon, R as DEFAULT_WIDGET_LABELS, T as GripIcon, W as buildSelector, Y as redactUrl, Z as inspectReactElement, _ as matchesHotkey, a as uploadBlob, c as useFloatingPosition, g as isSubmitEnter, it as releaseCapture, j as Svg, l as onViewportChange, m as startsInWidget, o as ElementPicker, p as listenToKeydown, q as REDACT_ATTRIBUTE, tt as captureViewport, u as visibleViewport, w as CloseIcon } from "./submit-CafYVnCb.js";
3
3
  import { t as REFLET_Z_INDEX } from "./z-index-CwokqVq_.js";
4
4
  import { z } from "zod";
5
5
  import { createContext, useContext, useEffect, useId, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
@@ -136,6 +136,7 @@ function createReviewEndpoints({ get, post }) {
136
136
  detail: (sessionId) => get("/api/v1/sessions/detail", sessionDetailSchema, { sessionId }),
137
137
  identity: () => get("/api/v1/sessions/identity", sessionIdentitySchema),
138
138
  list: async () => (await get("/api/v1/sessions/list", z.object({ sessions: z.array(sessionSummarySchema) }))).sessions,
139
+ removeEvidence: async (evidenceId) => (await post("/api/v1/sessions/evidence/remove", { evidenceId }, z.object({ evidence: sessionEvidenceSchema }))).evidence,
139
140
  retrySegment: async (segmentId) => (await post("/api/v1/sessions/segments/retry", { segmentId }, segmentResponse)).segment,
140
141
  update: async (body) => (await post("/api/v1/sessions/update", body, summaryResponse)).session
141
142
  };
@@ -2070,7 +2071,6 @@ var LiveSession = class {
2070
2071
  }
2071
2072
  stop() {
2072
2073
  this.stopCollecting();
2073
- this.evidence.cancelPending();
2074
2074
  this.events.stop();
2075
2075
  }
2076
2076
  stopCollecting() {
@@ -2078,6 +2078,7 @@ var LiveSession = class {
2078
2078
  this.run = null;
2079
2079
  this.stopListening?.abort();
2080
2080
  this.stopListening = null;
2081
+ this.evidence.cancelPending();
2081
2082
  window.clearInterval(this.tick);
2082
2083
  this.events.flushAll();
2083
2084
  }
@@ -4138,6 +4139,12 @@ function withSegment(detail, segment) {
4138
4139
  segments: [...others, segment].sort((a, b) => a.startMs - b.startMs)
4139
4140
  };
4140
4141
  }
4142
+ function withEvidence(detail, evidence) {
4143
+ return {
4144
+ ...detail,
4145
+ evidence: detail.evidence.map((item) => item.id === evidence.id ? evidence : item)
4146
+ };
4147
+ }
4141
4148
  function isHidden() {
4142
4149
  return typeof document !== "undefined" && document.visibilityState === "hidden";
4143
4150
  }
@@ -5077,7 +5084,60 @@ function AttachLink({ detail, onDone, review }) {
5077
5084
  });
5078
5085
  }
5079
5086
  //#endregion
5087
+ //#region src/sessions/ui/review/transcript/remove-evidence.tsx
5088
+ const REMOVE_COPY = "Remove this screenshot? The image is deleted for good. Briefs you already copied or exported can't be recalled.";
5089
+ function RemoveConfirmation({ evidence, onCancel, review }) {
5090
+ const { api } = useSessionWorkspace();
5091
+ const run = useSessionAction();
5092
+ const cancelRef = useRef(null);
5093
+ useEffect(() => {
5094
+ cancelRef.current?.focus();
5095
+ }, []);
5096
+ const remove = async () => {
5097
+ const removed = await run("The screenshot was not removed", () => api.removeEvidence(evidence.id));
5098
+ if (removed !== null) {
5099
+ review.patch((detail) => withEvidence(detail, removed));
5100
+ announce("Screenshot removed");
5101
+ }
5102
+ };
5103
+ return /* @__PURE__ */ jsxs("div", {
5104
+ className: "dt-ses-banner",
5105
+ children: [/* @__PURE__ */ jsx("p", { children: REMOVE_COPY }), /* @__PURE__ */ jsxs("div", {
5106
+ className: "dt-actions",
5107
+ children: [/* @__PURE__ */ jsx("button", {
5108
+ className: "dt-btn",
5109
+ "data-variant": "danger",
5110
+ onClick: remove,
5111
+ type: "button",
5112
+ children: "Remove"
5113
+ }), /* @__PURE__ */ jsx("button", {
5114
+ className: "dt-btn",
5115
+ onClick: onCancel,
5116
+ ref: cancelRef,
5117
+ type: "button",
5118
+ children: "Cancel"
5119
+ })]
5120
+ })]
5121
+ });
5122
+ }
5123
+ function RemoveEvidence({ evidence, review }) {
5124
+ const [isConfirming, setIsConfirming] = useState(false);
5125
+ if (isConfirming) return /* @__PURE__ */ jsx(RemoveConfirmation, {
5126
+ evidence,
5127
+ onCancel: () => setIsConfirming(false),
5128
+ review
5129
+ });
5130
+ return /* @__PURE__ */ jsx("button", {
5131
+ "aria-label": `Remove screenshot at ${formatClock(evidence.atMs)}`,
5132
+ className: "dt-ses-link",
5133
+ onClick: () => setIsConfirming(true),
5134
+ type: "button",
5135
+ children: "Remove"
5136
+ });
5137
+ }
5138
+ //#endregion
5080
5139
  //#region src/sessions/ui/review/transcript/evidence-tab.tsx
5140
+ const isViewable = (evidence) => evidence.status === "available" && Boolean(evidence.image?.url);
5081
5141
  function LinkEvidenceItem({ link }) {
5082
5142
  return /* @__PURE__ */ jsxs("li", {
5083
5143
  className: "dt-card",
@@ -5100,10 +5160,10 @@ function LinkEvidenceItem({ link }) {
5100
5160
  ]
5101
5161
  });
5102
5162
  }
5103
- function EvidenceItem({ evidence, onEnlarge }) {
5163
+ function EvidenceItem({ evidence, onEnlarge, removal }) {
5104
5164
  const caption = `${formatClock(evidence.atMs)} · ${evidenceCaption(evidence)}`;
5105
5165
  if (evidence.link) return /* @__PURE__ */ jsx(LinkEvidenceItem, { link: evidence.link });
5106
- if (evidence.status === "missing" || !evidence.image?.url) return /* @__PURE__ */ jsxs("li", {
5166
+ if (!isViewable(evidence)) return /* @__PURE__ */ jsxs("li", {
5107
5167
  className: "dt-card",
5108
5168
  children: [/* @__PURE__ */ jsx("p", {
5109
5169
  className: "dt-meta",
@@ -5130,11 +5190,15 @@ function EvidenceItem({ evidence, onEnlarge }) {
5130
5190
  evidence.note && /* @__PURE__ */ jsx("p", {
5131
5191
  className: "dt-note-text",
5132
5192
  children: evidence.note
5193
+ }),
5194
+ removal.canRemove && /* @__PURE__ */ jsx(RemoveEvidence, {
5195
+ evidence,
5196
+ review: removal.review
5133
5197
  })
5134
5198
  ]
5135
5199
  });
5136
5200
  }
5137
- function EnlargedEvidence({ evidence, onBack }) {
5201
+ function EnlargedEvidence({ evidence, onBack, removal }) {
5138
5202
  return /* @__PURE__ */ jsxs(Fragment, { children: [
5139
5203
  /* @__PURE__ */ jsx("button", {
5140
5204
  className: "dt-ses-link",
@@ -5153,10 +5217,14 @@ function EnlargedEvidence({ evidence, onBack }) {
5153
5217
  " · ",
5154
5218
  evidenceCaption(evidence)
5155
5219
  ]
5220
+ }),
5221
+ removal.canRemove && /* @__PURE__ */ jsx(RemoveEvidence, {
5222
+ evidence,
5223
+ review: removal.review
5156
5224
  })
5157
5225
  ] });
5158
5226
  }
5159
- function EvidenceList({ evidence, onEnlarge }) {
5227
+ function EvidenceList({ evidence, onEnlarge, removal }) {
5160
5228
  return /* @__PURE__ */ jsxs(Fragment, { children: [evidence.length === 0 && /* @__PURE__ */ jsx("p", {
5161
5229
  className: "dt-empty",
5162
5230
  children: "No screenshots or links in this session."
@@ -5164,21 +5232,28 @@ function EvidenceList({ evidence, onEnlarge }) {
5164
5232
  className: "dt-ses-rows",
5165
5233
  children: evidence.map((item) => /* @__PURE__ */ jsx(EvidenceItem, {
5166
5234
  evidence: item,
5167
- onEnlarge: () => onEnlarge(item.id)
5235
+ onEnlarge: () => onEnlarge(item.id),
5236
+ removal
5168
5237
  }, item.id))
5169
5238
  })] });
5170
5239
  }
5171
5240
  function EvidenceTab({ detail, review }) {
5172
5241
  const [enlargedId, setEnlargedId] = useState(null);
5173
5242
  const [isAttaching, setIsAttaching] = useState(false);
5174
- const enlarged = detail.evidence.find((item) => item.id === enlargedId);
5243
+ const enlarged = detail.evidence.find((item) => item.id === enlargedId && isViewable(item));
5244
+ const removal = {
5245
+ canRemove: detail.session.canEdit,
5246
+ review
5247
+ };
5175
5248
  if (enlarged) return /* @__PURE__ */ jsx(EnlargedEvidence, {
5176
5249
  evidence: enlarged,
5177
- onBack: () => setEnlargedId(null)
5250
+ onBack: () => setEnlargedId(null),
5251
+ removal
5178
5252
  });
5179
5253
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(EvidenceList, {
5180
5254
  evidence: detail.evidence,
5181
- onEnlarge: setEnlargedId
5255
+ onEnlarge: setEnlargedId,
5256
+ removal
5182
5257
  }), detail.session.canEdit && (isAttaching ? /* @__PURE__ */ jsx(AttachLink, {
5183
5258
  detail,
5184
5259
  onDone: () => setIsAttaching(false),
@@ -5786,14 +5861,13 @@ function DisclosureList() {
5786
5861
  children: [
5787
5862
  /* @__PURE__ */ jsx("li", { children: "Your voice while recording. It is sent to Reflet and transcribed by Whisper through OpenRouter with zero data retention. The audio is deleted as soon as its transcript is saved, within 24 hours at most." }),
5788
5863
  /* @__PURE__ */ jsx("li", { children: "The page: its address without sensitive parameters, its title, the scroll position and the window size." }),
5789
- /* @__PURE__ */ jsx("li", { children: "What you click, point at and mark: element names and positions, never what you type." }),
5864
+ /* @__PURE__ */ jsx("li", { children: "What you click, point at and mark: element names and positions, never your keystrokes." }),
5790
5865
  /* @__PURE__ */ jsxs("li", { children: [
5791
- "Screenshots of this tab at the start, when you mark a moment and when the page changes. Password fields and elements marked",
5792
- " ",
5866
+ "Screenshots of this tab at the start, when you mark a moment and when the page changes. Form fields appear empty; password fields and elements marked ",
5793
5867
  /* @__PURE__ */ jsx("code", { children: "data-reflet-redact" }),
5794
- " are hidden."
5868
+ " are hidden. Other text on screen, rich-text editors included, stays visible."
5795
5869
  ] }),
5796
- /* @__PURE__ */ jsx("li", { children: "Not recorded: keystrokes, field values, other tabs or apps, network calls." }),
5870
+ /* @__PURE__ */ jsx("li", { children: "Not recorded: keystrokes, other tabs or apps, network calls." }),
5797
5871
  /* @__PURE__ */ jsx("li", { children: "Pausing stops everything." }),
5798
5872
  /* @__PURE__ */ jsx("li", { children: "A session stays private to you until you share it." })
5799
5873
  ]
@@ -6008,4 +6082,4 @@ function SessionsPanel({ navigation, onStarted, onWriteNote }) {
6008
6082
  //#endregion
6009
6083
  export { announce as A, searchCode as C, openDatabase as D, describeStorageFailure as E, settle as O, probeDevRoute as S, committed as T, teamTransport as _, DevtoolsBar as a, fetchBoardFeedback as b, copyToClipboard as c, PersonIcon as d, SessionWorkspaceProvider as f, devtoolsTransport as g, purgeAccount as h, BarButton as i, reportFailure as j, Notices as k, SESSIONS_STYLES as l, useWorkspaceLoader as m, DEVTOOLS_STYLES as n, DevtoolsBarButtons as o, failureMessage as p, DevtoolsSheet as r, SessionsBarButton as s, SessionsPanel as t, RecordingLayer as u, callReflet as v, startBoardConnect as w, fetchSourceFile as x, disconnectBoard as y };
6010
6084
 
6011
- //# sourceMappingURL=sessions-panel-DVyWzZ3C.js.map
6085
+ //# sourceMappingURL=sessions-panel-Dq5j1qcu.js.map