dsh-fast-mode 1.5.34 → 1.6.0

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/src/state.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * has an entry of its own. Only an edit in `cordis.patch.yml` changes them;
15
15
  * the chip and the panel never write them.
16
16
  * - The `sessions` field carries every per-session choice: `{ sessionId: {
17
- * enabled, gear, discipline, stepBudget, map, ts } }` as a compact JSON
17
+ * enabled, gear, discipline, stepBudget, map, batch, lazy, ts } }` as a compact JSON
18
18
  * string. It is volatile, so a write lands in the running plugin without a
19
19
  * remount.
20
20
  *
@@ -107,6 +107,7 @@ function sanitise(input) {
107
107
  if (Number.isFinite(entry.stepBudget) && entry.stepBudget >= 0) clean.stepBudget = Math.floor(Number(entry.stepBudget))
108
108
  if (typeof entry.map === 'boolean') clean.map = entry.map
109
109
  if (typeof entry.batch === 'boolean') clean.batch = entry.batch
110
+ if (typeof entry.lazy === 'boolean') clean.lazy = entry.lazy
110
111
  if (Number.isFinite(entry.ts)) clean.ts = Number(entry.ts)
111
112
  if (
112
113
  clean.enabled === undefined
@@ -115,6 +116,7 @@ function sanitise(input) {
115
116
  && clean.stepBudget === undefined
116
117
  && clean.map === undefined
117
118
  && clean.batch === undefined
119
+ && clean.lazy === undefined
118
120
  ) continue
119
121
  out[sessionId] = clean
120
122
  }
@@ -140,6 +142,7 @@ export function choiceFor(raw, sessionId) {
140
142
  if (entry.stepBudget !== undefined) choice.stepBudget = entry.stepBudget
141
143
  if (entry.map !== undefined) choice.map = entry.map
142
144
  if (entry.batch !== undefined) choice.batch = entry.batch
145
+ if (entry.lazy !== undefined) choice.lazy = entry.lazy
143
146
  return choice
144
147
  }
145
148
 
@@ -165,6 +168,7 @@ export function configOverridesFor(raw, sessionId) {
165
168
  if (choice.stepBudget !== undefined) overrides.stepBudget = choice.stepBudget
166
169
  if (choice.map !== undefined) overrides.workspaceMap = choice.map
167
170
  if (choice.batch !== undefined) overrides.openBatch = choice.batch
171
+ if (choice.lazy !== undefined) overrides.lazy = choice.lazy
168
172
  return Object.keys(overrides).length === 0 ? undefined : overrides
169
173
  }
170
174
 
@@ -215,11 +219,13 @@ export function writeChoice(raw, sessionId, choice, now) {
215
219
  if (typeof choice.discipline === 'boolean' || choice.discipline === 'late') next.discipline = choice.discipline
216
220
  if (Number.isFinite(choice.stepBudget) && choice.stepBudget >= 0) next.stepBudget = Math.floor(Number(choice.stepBudget))
217
221
  if (typeof choice.map === 'boolean') next.map = choice.map
222
+ if (typeof choice.batch === 'boolean') next.batch = choice.batch
223
+ if (typeof choice.lazy === 'boolean') next.lazy = choice.lazy
218
224
  map[sessionId] = next
219
225
  return { sessions: encodeChoices(map), map }
220
226
  }
221
227
 
222
- /** @typedef {{enabled?: boolean, gear?: string, discipline?: boolean|'late', stepBudget?: number, map?: boolean, batch?: boolean, ts?: number}} SessionEntry */
228
+ /** @typedef {{enabled?: boolean, gear?: string, discipline?: boolean|'late', stepBudget?: number, map?: boolean, batch?: boolean, lazy?: boolean, ts?: number}} SessionEntry */
223
229
 
224
230
  /**
225
231
  * Serialise the map, dropping the oldest entries beyond {@link SESSIONS_LIMIT}.