dsh-rewind-plugin 0.20.0-alpha.2 → 0.20.0-alpha.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/lib/client.js CHANGED
@@ -1590,7 +1590,7 @@ async function candidatesOverRpc(connection, sessionId) {
1590
1590
  }
1591
1591
 
1592
1592
  // src/client/build-info.ts
1593
- var PLUGIN_VERSION = true ? "0.20.0-alpha.2" : "dev";
1593
+ var PLUGIN_VERSION = true ? "0.20.0-alpha.3" : "dev";
1594
1594
  var PLUGIN_PACKAGE = "dsh-rewind-plugin";
1595
1595
  var BUILD_HASH = true ? "46008907" : "dev";
1596
1596
 
package/lib/index.js CHANGED
@@ -650,10 +650,13 @@ function refToSource(raw, sessionDir) {
650
650
  if (typeof ref.text === "string") return textSourceOf(ref.text);
651
651
  return void 0;
652
652
  }
653
+ function sessionRelativeRef(sessionDir, file) {
654
+ return relative(sessionDir, file).split(sep).join("/");
655
+ }
653
656
  function sourceToRef(source, sessionDir, entryPath) {
654
657
  if (source === null) return null;
655
658
  if (source.kind === "blob") {
656
- const blob = relative(sessionDir, source.path);
659
+ const blob = sessionRelativeRef(sessionDir, source.path);
657
660
  if (!isSafeBackupRef(blob)) throw new Error(`unsafe backup ref ${blob} for ${entryPath}`);
658
661
  return { blob };
659
662
  }
@@ -996,7 +999,7 @@ var SnapshotStore = class _SnapshotStore {
996
999
  * the call id would produce a dangling reference.
997
1000
  */
998
1001
  refOfRead(sessionId, entry) {
999
- if (entry.file !== void 0) return relative(this.sessionDir(sessionId), entry.file);
1002
+ if (entry.file !== void 0) return sessionRelativeRef(this.sessionDir(sessionId), entry.file);
1000
1003
  return this.entryRefOf(sessionId, entry.callId, entry.anchorSeq);
1001
1004
  }
1002
1005
  /** Drop every in-memory trace of one session (its directory is gone). */
@@ -2064,7 +2067,7 @@ var SnapshotStore = class _SnapshotStore {
2064
2067
  for (const action of journal.actions) {
2065
2068
  const source = action.before;
2066
2069
  if (source === null || source.kind !== "blob") continue;
2067
- const ref = relative(sessionDir, source.path);
2070
+ const ref = sessionRelativeRef(sessionDir, source.path);
2068
2071
  if (!isSafeBackupRef(ref)) continue;
2069
2072
  const anchor = refAnchorOf(ref);
2070
2073
  if (Number.isSafeInteger(anchor)) pinned.add(anchor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-rewind-plugin",
3
- "version": "0.20.0-alpha.2",
3
+ "version": "0.20.0-alpha.3",
4
4
  "description": "In-window conversation rewind with workspace file restore",
5
5
  "icon": "./assets/icon.svg",
6
6
  "keywords": [