reflet-sdk 0.7.2 → 0.7.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 CHANGED
@@ -5,6 +5,13 @@ All notable changes to `reflet-sdk` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.3] - 2026-10-14
9
+
10
+ ### Added
11
+
12
+ - Sessions: the Intentions tab opens On screen. Each intention is pinned on the screenshot of the moment it's about: a frame around the element, a line, a number, and a short label the AI writes (at most 6 words, in your language), with Confirm and Dismiss right on the label. A choice already made stays focusable but inactive, like on the cards; Undo in the notice reverts it. Click the label to open the full intention under Details. Intentions with no screenshot are listed below with the same buttons. Your own wording replaces the AI label: once you, an accepted change or a removed contribution rewrites the need, the label shows the need itself. Requires the matching Reflet backend.
13
+ - Sessions: the frame goes around the element you talk about, not the one under your pointer. Each screenshot now records the names and positions of the buttons, links, headings and images it shows (masked elements and anything in or around typed text left out, at most 80), and the AI picks among them. When nothing matches, or for sessions analyzed before, the label sits on the screenshot without a frame. Removing a screenshot or correcting a passage's context moves the pin at once. The session disclosure lists this.
14
+
8
15
  ## [0.7.2] - 2026-10-13
9
16
 
10
17
  ### Fixed
@@ -1,6 +1,6 @@
1
- import { $ as shortenSourcePath, G as describeElement, Q as resolveComponentStack, R as DEFAULT_WIDGET_LABELS, U as buildElementSelection, V as collectPageContext, X as getFiberFromNode, a as uploadBlob, f as listenOnPageAndWidget, g as isSubmitEnter, it as releaseCapture, nt as capturedFromCanvas, o as ElementPicker, p as listenToKeydown, r as deriveTitle, rt as capturedViewportSize, s as isWidgetOwned, tt as captureViewport, z as SDK_VERSION } from "./submit-Dx892JVJ.js";
1
+ import { $ as shortenSourcePath, G as describeElement, Q as resolveComponentStack, R as DEFAULT_WIDGET_LABELS, U as buildElementSelection, V as collectPageContext, X as getFiberFromNode, a as uploadBlob, f as listenOnPageAndWidget, g as isSubmitEnter, it as releaseCapture, nt as capturedFromCanvas, o as ElementPicker, p as listenToKeydown, r as deriveTitle, rt as capturedViewportSize, s as isWidgetOwned, tt as captureViewport, z as SDK_VERSION } from "./submit-Dl0rm6TV.js";
2
2
  import { t as SelectionOutline } from "./selection-outline-NzAAAZXR.js";
3
- import { A as Notices, C as searchCode, D as openDatabase, E as describeStorageFailure, M as reportFailure, O as settle, S as probeDevRoute, T as committed, a as DevtoolsBar, b as fetchBoardFeedback, c as copyToClipboard, f as SessionWorkspaceProvider, g as devtoolsTransport, j as announce, l as SESSIONS_STYLES, m as useWorkspaceLoader, n as DEVTOOLS_STYLES, o as DevtoolsBarButtons, r as DevtoolsSheet, t as SessionsPanel, u as RecordingLayer, v as callReflet, w as startBoardConnect, x as fetchSourceFile, y as disconnectBoard } from "./sessions-panel-BycJng5z.js";
3
+ import { A as Notices, C as searchCode, D as openDatabase, E as describeStorageFailure, M as reportFailure, O as settle, S as probeDevRoute, T as committed, a as DevtoolsBar, b as fetchBoardFeedback, c as copyToClipboard, f as SessionWorkspaceProvider, g as devtoolsTransport, j as announce, l as SESSIONS_STYLES, m as useWorkspaceLoader, n as DEVTOOLS_STYLES, o as DevtoolsBarButtons, r as DevtoolsSheet, t as SessionsPanel, u as RecordingLayer, v as callReflet, w as startBoardConnect, x as fetchSourceFile, y as disconnectBoard } from "./sessions-panel-BYM0UUgT.js";
4
4
  import * as G$1 from "react";
5
5
  import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -371,40 +371,8 @@ function InboxPanel({ onOpenCode, onShowSelector }) {
371
371
  }, scope)] });
372
372
  }
373
373
  //#endregion
374
- //#region src/devtools/client/route/route-hint.tsx
375
- function MissingRouteHint({ purpose }) {
376
- return /* @__PURE__ */ jsxs("div", {
377
- className: "dt-empty",
378
- children: [
379
- /* @__PURE__ */ jsxs("p", { children: [
380
- "Add the Reflet dev route to ",
381
- purpose,
382
- "."
383
- ] }),
384
- /* @__PURE__ */ jsxs("p", { children: [
385
- "Next.js: ",
386
- /* @__PURE__ */ jsx("code", { children: "app/api/reflet-devtools/[...path]/route.ts" }),
387
- /* @__PURE__ */ jsx("br", {}),
388
- /* @__PURE__ */ jsxs("code", { children: [
389
- "export ",
390
- "{ GET, POST }",
391
- " from \"reflet-sdk/devtools/next\";"
392
- ] })
393
- ] }),
394
- /* @__PURE__ */ jsxs("p", { children: [
395
- "Vite: ",
396
- /* @__PURE__ */ jsx("code", { children: "plugins: [refletDevtools()]" }),
397
- " from",
398
- " ",
399
- /* @__PURE__ */ jsx("code", { children: "reflet-sdk/devtools/vite" })
400
- ] })
401
- ]
402
- });
403
- }
404
- const MISSING_SECRET_KEY_HINT = "Set REFLET_SECRET_KEY (your fb_sec_ key) in the dev server environment to reach your board.";
405
- //#endregion
406
- //#region src/devtools/client/board/board-tab.tsx
407
- function ConnectPrompt({ publicKey }) {
374
+ //#region src/devtools/client/route/connect-prompt.tsx
375
+ function ConnectPrompt({ publicKey, purpose }) {
408
376
  const [prompt, setPrompt] = useState({ kind: "idle" });
409
377
  const connect = async () => {
410
378
  const tab = window.open("", "_blank");
@@ -445,7 +413,7 @@ function ConnectPrompt({ publicKey }) {
445
413
  });
446
414
  return /* @__PURE__ */ jsxs("div", {
447
415
  className: "dt-empty",
448
- children: [/* @__PURE__ */ jsx("p", { children: "See this page's feedback and send notes to your board." }), /* @__PURE__ */ jsx("button", {
416
+ children: [/* @__PURE__ */ jsx("p", { children: purpose }), /* @__PURE__ */ jsx("button", {
449
417
  className: "dt-btn",
450
418
  "data-variant": "primary",
451
419
  disabled: prompt.kind === "starting",
@@ -455,6 +423,40 @@ function ConnectPrompt({ publicKey }) {
455
423
  })]
456
424
  });
457
425
  }
426
+ //#endregion
427
+ //#region src/devtools/client/route/route-hint.tsx
428
+ function MissingRouteHint({ purpose }) {
429
+ return /* @__PURE__ */ jsxs("div", {
430
+ className: "dt-empty",
431
+ children: [
432
+ /* @__PURE__ */ jsxs("p", { children: [
433
+ "Add the Reflet dev route to ",
434
+ purpose,
435
+ "."
436
+ ] }),
437
+ /* @__PURE__ */ jsxs("p", { children: [
438
+ "Next.js: ",
439
+ /* @__PURE__ */ jsx("code", { children: "app/api/reflet-devtools/[...path]/route.ts" }),
440
+ /* @__PURE__ */ jsx("br", {}),
441
+ /* @__PURE__ */ jsxs("code", { children: [
442
+ "export ",
443
+ "{ GET, POST }",
444
+ " from \"reflet-sdk/devtools/next\";"
445
+ ] })
446
+ ] }),
447
+ /* @__PURE__ */ jsxs("p", { children: [
448
+ "Vite: ",
449
+ /* @__PURE__ */ jsx("code", { children: "plugins: [refletDevtools()]" }),
450
+ " from",
451
+ " ",
452
+ /* @__PURE__ */ jsx("code", { children: "reflet-sdk/devtools/vite" })
453
+ ] })
454
+ ]
455
+ });
456
+ }
457
+ const MISSING_SECRET_KEY_HINT = "Set REFLET_SECRET_KEY (your fb_sec_ key) in the dev server environment to reach your board.";
458
+ //#endregion
459
+ //#region src/devtools/client/board/board-tab.tsx
458
460
  function ConnectionBar({ organizationName, refresh }) {
459
461
  const [isDisconnecting, setIsDisconnecting] = useState(false);
460
462
  const disconnect = async () => {
@@ -487,7 +489,10 @@ function BoardTab({ canConnect, onOpenCode, onShowSelector, publicKey, refresh,
487
489
  if (route.kind === "missing") return /* @__PURE__ */ jsx(MissingRouteHint, { purpose: "see your board's feedback for this page" });
488
490
  if (route.kind === "checking") return null;
489
491
  const { board } = route.status;
490
- if (board.kind === "disconnected") return canConnect && publicKey !== null ? /* @__PURE__ */ jsx(ConnectPrompt, { publicKey }) : /* @__PURE__ */ jsx("p", {
492
+ if (board.kind === "disconnected") return canConnect && publicKey !== null ? /* @__PURE__ */ jsx(ConnectPrompt, {
493
+ publicKey,
494
+ purpose: "See this page's feedback and send notes to your board."
495
+ }) : /* @__PURE__ */ jsx("p", {
491
496
  className: "dt-hint",
492
497
  children: MISSING_SECRET_KEY_HINT
493
498
  });
@@ -3452,15 +3457,14 @@ function SessionsScope({ children, sessions }) {
3452
3457
  children
3453
3458
  });
3454
3459
  }
3455
- function ConnectHint({ onConnect }) {
3456
- return /* @__PURE__ */ jsxs("div", {
3460
+ function SessionsConnect({ connectKey }) {
3461
+ if (connectKey === null) return /* @__PURE__ */ jsx("p", {
3457
3462
  className: "dt-empty",
3458
- children: [/* @__PURE__ */ jsx("p", { children: "Sessions are saved under your Reflet account. Connect in the Board tab." }), /* @__PURE__ */ jsx("button", {
3459
- className: "dt-btn",
3460
- onClick: onConnect,
3461
- type: "button",
3462
- children: "Open the Board tab"
3463
- })]
3463
+ children: "Sessions are recorded under your Reflet account. Connecting needs this app on localhost with a Reflet public key."
3464
+ });
3465
+ return /* @__PURE__ */ jsx(ConnectPrompt, {
3466
+ publicKey: connectKey,
3467
+ purpose: "Sessions are recorded under your Reflet account."
3464
3468
  });
3465
3469
  }
3466
3470
  function WorkspaceGate({ actions, sessions }) {
@@ -3485,14 +3489,14 @@ function WorkspaceGate({ actions, sessions }) {
3485
3489
  children: "Opening your sessions…"
3486
3490
  });
3487
3491
  }
3488
- function SessionsTab({ actions, route, sessions }) {
3492
+ function SessionsTab({ actions, connectKey, route, sessions }) {
3489
3493
  if (route.kind === "checking") return /* @__PURE__ */ jsx("p", {
3490
3494
  className: "dt-status",
3491
3495
  children: "Connecting to the Reflet dev route…"
3492
3496
  });
3493
3497
  if (route.kind === "missing") return /* @__PURE__ */ jsx(MissingRouteHint, { purpose: "record sessions under your Reflet account" });
3494
3498
  const { board } = route.status;
3495
- if (board.kind === "disconnected") return /* @__PURE__ */ jsx(ConnectHint, { onConnect: actions.onConnect });
3499
+ if (board.kind === "disconnected") return /* @__PURE__ */ jsx(SessionsConnect, { connectKey });
3496
3500
  if (board.kind === "secretKey") return /* @__PURE__ */ jsx("p", {
3497
3501
  className: "dt-empty",
3498
3502
  children: "Sessions are recorded under your own name, so they need Connect in the Board tab rather than REFLET_SECRET_KEY."
@@ -3649,10 +3653,10 @@ function DevtoolsLayer({ isWidgetOpen, position, publicKey }) {
3649
3653
  }),
3650
3654
  openTab === "sessions" && /* @__PURE__ */ jsx(SessionsTab, {
3651
3655
  actions: {
3652
- onConnect: () => setOpenTab("inbox"),
3653
3656
  onStarted: closeSheet,
3654
3657
  onWriteNote: writeNoteInstead
3655
3658
  },
3659
+ connectKey: canConnect ? publicKey : null,
3656
3660
  route,
3657
3661
  sessions
3658
3662
  }),
@@ -3692,4 +3696,4 @@ function DevtoolsLayer({ isWidgetOpen, position, publicKey }) {
3692
3696
  //#endregion
3693
3697
  export { DevtoolsLayer };
3694
3698
 
3695
- //# sourceMappingURL=devtools-layer-DhQE3leI.js.map
3699
+ //# sourceMappingURL=devtools-layer-CsIcpepI.js.map