zames_pro 2.82.35 → 2.82.36

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
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.82.36] - 2026-10-22
11
+
12
+ ### Fixed
13
+
14
+ - **handoff:** keep a pending handoff of another workdir
15
+
10
16
  ## [2.82.35] - 2026-10-22
11
17
 
12
18
  ### Fixed
@@ -46,10 +46,31 @@ export function buildHandoffText(h) {
46
46
  export function saveProviderHandoff(h) {
47
47
  try {
48
48
  fs.mkdirSync(ZAMES_HOME, { recursive: true });
49
+ // There is ONE handoff file for all projects, and save used to overwrite
50
+ // it unconditionally: switching providers in project B silently dropped
51
+ // the UNCONSUMED handoff of project A. A pending handoff for another
52
+ // workdir is kept in a per-workdir side file so both survive.
53
+ let pending = null;
54
+ try {
55
+ pending = JSON.parse(fs.readFileSync(HANDOFF_FILE, 'utf-8'));
56
+ }
57
+ catch { }
58
+ if (pending && typeof pending.summary === 'string') {
59
+ if (sameDir(pending.workdir, h.workdir)) {
60
+ writeJsonAtomic(HANDOFF_FILE, h);
61
+ return;
62
+ }
63
+ writeJsonAtomic(sideHandoffFile(pending.workdir), pending);
64
+ }
49
65
  writeJsonAtomic(HANDOFF_FILE, h);
50
66
  }
51
67
  catch { }
52
68
  }
69
+ /** A per-workdir copy of a handoff displaced from the global file. */
70
+ function sideHandoffFile(workdir) {
71
+ const key = Buffer.from(String(workdir || '')).toString('base64url');
72
+ return path.join(ZAMES_HOME, 'provider-handoff-' + key + '.json');
73
+ }
53
74
  /**
54
75
  * Read the pending handoff, but ONLY when it targets `provider` and `workdir`:
55
76
  * a handoff for a different provider or project must not be posted into the
@@ -63,14 +84,31 @@ export function readProviderHandoff(provider, workdir) {
63
84
  }
64
85
  if (raw.provider !== provider)
65
86
  return null;
66
- if (!sameDir(raw.workdir, workdir))
67
- return null;
87
+ if (!sameDir(raw.workdir, workdir)) {
88
+ // The global file may hold another project's handoff; this project's
89
+ // own one (displaced by a later switch) lives in its side file.
90
+ return readSideHandoff(provider, workdir);
91
+ }
68
92
  return raw;
69
93
  }
70
94
  catch {
71
95
  return null;
72
96
  }
73
97
  }
98
+ function readSideHandoff(provider, workdir) {
99
+ try {
100
+ const raw = JSON.parse(fs.readFileSync(sideHandoffFile(workdir), 'utf-8'));
101
+ if (!raw || typeof raw.summary !== 'string' || !raw.summary.trim()) {
102
+ return null;
103
+ }
104
+ if (raw.provider !== provider)
105
+ return null;
106
+ return sameDir(raw.workdir, workdir) ? raw : null;
107
+ }
108
+ catch {
109
+ return null;
110
+ }
111
+ }
74
112
  // Two paths that denote the SAME directory must match: the handoff is consumed
75
113
  // by the NEXT launch in that directory, and the path there is not guaranteed to
76
114
  // be byte-identical — a trailing separator (a `/cd sub/` leaves one) or a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zames_pro",
3
- "version": "2.82.35",
3
+ "version": "2.82.36",
4
4
  "description": "Terminal coding agent that drives a real browser to chat with DeepSeek, Qwen and other web LLMs — no API key required. Reads and edits files, runs commands, commits to git, like Claude Code / Codex CLI.",
5
5
  "type": "module",
6
6
  "bin": {