@bastani/atomic 0.10.6 → 0.10.7

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.
Files changed (207) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/_shared/dist-KOELCESV.js +2 -2
  3. package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
  4. package/dist/_shared/lib-4PES5P4V.js +2 -2
  5. package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +2 -2
  6. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +26 -4
  7. package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
  8. package/dist/_shared/mode-shared-2QJSCUM6.js +3 -2
  9. package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
  10. package/dist/_shared/p1a-prewarm-UQY3X2UK.js +3 -3
  11. package/dist/_shared/sdk-WQIOHVKO.js +2 -2
  12. package/dist/_shared/session-data-AHTU7IS6.js +2 -2
  13. package/dist/_shared/sql-session-store-5FD3WBMZ.js +2 -2
  14. package/dist/_shared/startup-0-0-TYUFUOJZ.js +2 -2
  15. package/dist/_shared/startup-0-1-W2G2UY7R.js +2 -2
  16. package/dist/_shared/startup-0-2-SZGQIWHI.js +2 -2
  17. package/dist/_shared/startup-0-3-T4DVFYWX.js +2 -2
  18. package/dist/_shared/startup-0-4-HN5EB4K7.js +72 -11
  19. package/dist/_shared/startup-0-4-HN5EB4K7.js.map +1 -1
  20. package/dist/_shared/startup-0-5-OHJNE6JH.js +2 -2
  21. package/dist/_shared/startup-10-0-TDQNBDDL.js +2 -2
  22. package/dist/_shared/startup-15-1-4S7FLMNG.js +34 -28
  23. package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
  24. package/dist/_shared/startup-8-0-34CBHPZH.js +2 -2
  25. package/dist/_shared/startup-8-1-SJW2GMAM.js +2 -2
  26. package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
  27. package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
  28. package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
  29. package/dist/builtin/intercom/index.bundle.mjs +1 -1
  30. package/dist/builtin/intercom/package.json +1 -1
  31. package/dist/builtin/mcp/index.bundle.mjs +1 -1
  32. package/dist/builtin/mcp/package.json +1 -1
  33. package/dist/builtin/subagents/CHANGELOG.md +22 -0
  34. package/dist/builtin/subagents/package.json +1 -1
  35. package/dist/builtin/subagents/skills/agent-browser/SKILL.md +3 -3
  36. package/dist/builtin/subagents/src/extension/index.bundle.mjs +316 -33
  37. package/dist/builtin/web-access/index.bundle.mjs +1 -1
  38. package/dist/builtin/web-access/package.json +1 -1
  39. package/dist/cli/auth-cli.impl.js +3 -3
  40. package/dist/cli/auth-cli.js +3 -3
  41. package/dist/cli/blueprint-command.impl.js +3 -3
  42. package/dist/cli/blueprint-command.js +3 -3
  43. package/dist/cli/intercom-command.code.js +2 -2
  44. package/dist/cli/intercom-command.impl.js +3 -3
  45. package/dist/cli/intercom-command.js +3 -3
  46. package/dist/cli/list-models.impl.js +3 -3
  47. package/dist/cli/list-models.js +3 -3
  48. package/dist/cli/session-picker.impl.js +3 -3
  49. package/dist/cli/session-picker.js +3 -3
  50. package/dist/cli/startup-ui.impl.js +3 -3
  51. package/dist/cli/startup-ui.js +3 -3
  52. package/dist/cli/storage-command.impl.js +3 -3
  53. package/dist/cli/storage-command.js +3 -3
  54. package/dist/cli/storage-search-session.impl.js +3 -3
  55. package/dist/cli/storage-search-session.js +3 -3
  56. package/dist/cli/team-command.impl.js +3 -3
  57. package/dist/cli/team-command.js +3 -3
  58. package/dist/cli.js +2 -2
  59. package/dist/core/debug.impl.js +3 -3
  60. package/dist/core/debug.js +3 -3
  61. package/dist/core/export-html/card-projection.impl.js +3 -3
  62. package/dist/core/export-html/card-projection.js +3 -3
  63. package/dist/core/export-html/index.code.js +2 -2
  64. package/dist/core/export-html/index.impl.js +3 -3
  65. package/dist/core/export-html/index.js +3 -3
  66. package/dist/core/export-html/json-spans.impl.js +3 -3
  67. package/dist/core/export-html/json-spans.js +3 -3
  68. package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
  69. package/dist/core/export-html/oversized-render-inputs.js +3 -3
  70. package/dist/core/export-html/tool-renderer.impl.js +3 -3
  71. package/dist/core/export-html/tool-renderer.js +3 -3
  72. package/dist/core/extensions/jiti-loader.impl.js +3 -3
  73. package/dist/core/extensions/jiti-loader.js +3 -3
  74. package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
  75. package/dist/core/extensions/jiti-static-loader.js +3 -3
  76. package/dist/core/extensions/loader-host-modules.impl.js +3 -3
  77. package/dist/core/extensions/loader-host-modules.js +3 -3
  78. package/dist/core/intercom-broker-control-host.impl.js +3 -3
  79. package/dist/core/intercom-broker-control-host.js +3 -3
  80. package/dist/core/intercom-broker-control.code.js +2 -2
  81. package/dist/core/intercom-broker-control.impl.js +3 -3
  82. package/dist/core/intercom-broker-control.js +3 -3
  83. package/dist/core/package-manager-storage-adapters.impl.js +3 -3
  84. package/dist/core/package-manager-storage-adapters.js +3 -3
  85. package/dist/core/sdk.impl.js +3 -3
  86. package/dist/core/sdk.js +3 -3
  87. package/dist/core/session-manager-core.js +2 -2
  88. package/dist/core/session-manager-list.impl.js +3 -3
  89. package/dist/core/session-manager-list.js +3 -3
  90. package/dist/core/session-manager.impl.js +3 -3
  91. package/dist/core/session-manager.js +3 -3
  92. package/dist/core/session-storage.impl.js +3 -3
  93. package/dist/core/session-storage.js +3 -3
  94. package/dist/core/storage/index.js +2 -2
  95. package/dist/core/storage/node-sqlite-thread.js +2 -2
  96. package/dist/core/storage/node-sqlite.js +2 -2
  97. package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
  98. package/dist/core/storage/offline-snapshot-file.js +3 -3
  99. package/dist/core/storage/provider.js +2 -2
  100. package/dist/core/storage/selection.js +2 -2
  101. package/dist/core/storage/session/branch-fork-source.code.js +2 -2
  102. package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
  103. package/dist/core/storage/session/branch-fork-source.js +3 -3
  104. package/dist/core/storage/session/card-view.impl.js +3 -3
  105. package/dist/core/storage/session/card-view.js +3 -3
  106. package/dist/core/storage/session/child-reader.code.js +2 -2
  107. package/dist/core/storage/session/child-reader.impl.js +3 -3
  108. package/dist/core/storage/session/child-reader.js +3 -3
  109. package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
  110. package/dist/core/storage/session/chunked-resume-projection.js +3 -3
  111. package/dist/core/storage/session/expanded-child-details.code.js +2 -2
  112. package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
  113. package/dist/core/storage/session/expanded-child-details.js +3 -3
  114. package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
  115. package/dist/core/storage/session/fork-row-bytes.js +3 -3
  116. package/dist/core/storage/session/fork-row-index.impl.js +3 -3
  117. package/dist/core/storage/session/fork-row-index.js +3 -3
  118. package/dist/core/storage/session/fork-staging.impl.js +3 -3
  119. package/dist/core/storage/session/fork-staging.js +3 -3
  120. package/dist/core/storage/session/fork-window.code.js +2 -2
  121. package/dist/core/storage/session/fork-window.impl.js +3 -3
  122. package/dist/core/storage/session/fork-window.js +3 -3
  123. package/dist/core/storage/session/history-pages.impl.js +3 -3
  124. package/dist/core/storage/session/history-pages.js +3 -3
  125. package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
  126. package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
  127. package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
  128. package/dist/core/storage/session/jsonl-session-store.js +3 -3
  129. package/dist/core/storage/session/memory-session-store.impl.js +3 -3
  130. package/dist/core/storage/session/memory-session-store.js +3 -3
  131. package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
  132. package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
  133. package/dist/core/storage/session/pinned-branch-resume.js +3 -3
  134. package/dist/core/storage/session/released-history-files.impl.js +3 -3
  135. package/dist/core/storage/session/released-history-files.js +3 -3
  136. package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
  137. package/dist/core/storage/session/resident-fork-rows.js +3 -3
  138. package/dist/core/storage/session/session-resume.impl.js +3 -3
  139. package/dist/core/storage/session/session-resume.js +3 -3
  140. package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
  141. package/dist/core/storage/session/snapshot-cut.js +3 -3
  142. package/dist/core/storage/session/snapshot-history.code.js +2 -2
  143. package/dist/core/storage/session/snapshot-history.impl.js +3 -3
  144. package/dist/core/storage/session/snapshot-history.js +3 -3
  145. package/dist/core/storage/session/sql-session-store.impl.js +3 -3
  146. package/dist/core/storage/session/sql-session-store.js +3 -3
  147. package/dist/core/storage/session/tree-outline.impl.js +3 -3
  148. package/dist/core/storage/session/tree-outline.js +3 -3
  149. package/dist/core/storage/session/tree-presentation.impl.js +3 -3
  150. package/dist/core/storage/session/tree-presentation.js +3 -3
  151. package/dist/core/storage/storage-status.impl.js +3 -3
  152. package/dist/core/storage/storage-status.js +3 -3
  153. package/dist/core/storage/team.impl.js +3 -3
  154. package/dist/core/storage/team.js +3 -3
  155. package/dist/core/structured-output/index.impl.js +3 -3
  156. package/dist/core/structured-output/index.js +3 -3
  157. package/dist/core/tasks/task-completion-entry.impl.js +3 -3
  158. package/dist/core/tasks/task-completion-entry.js +3 -3
  159. package/dist/core/tasks/task-file-history.code.js +2 -2
  160. package/dist/core/tasks/task-file-history.impl.js +3 -3
  161. package/dist/core/tasks/task-file-history.js +3 -3
  162. package/dist/core/tasks/task-reference-archive.code.js +2 -2
  163. package/dist/core/tasks/task-reference-archive.js +3 -3
  164. package/dist/core/tasks/task-reference-identity.js +3 -3
  165. package/dist/core/tasks/task-reference-stream.impl.js +3 -3
  166. package/dist/core/tasks/task-reference-stream.js +3 -3
  167. package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
  168. package/dist/core/tasks/task-unsaved-answer.js +3 -3
  169. package/dist/core/tasks/task-view-source.impl.js +3 -3
  170. package/dist/core/tasks/task-view-source.js +3 -3
  171. package/dist/core/tools/read-url.impl.js +3 -3
  172. package/dist/core/tools/read-url.js +3 -3
  173. package/dist/core/worktree-snapshot/blob-store.js +2 -2
  174. package/dist/core/worktree-snapshot/errors.impl.js +3 -3
  175. package/dist/core/worktree-snapshot/errors.js +3 -3
  176. package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
  177. package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
  178. package/dist/extensions/codemode/execute.impl.js +3 -3
  179. package/dist/extensions/codemode/execute.js +3 -3
  180. package/dist/extensions/codemode/renderer.impl.js +3 -3
  181. package/dist/extensions/codemode/renderer.js +3 -3
  182. package/dist/extensions/mcp/cli.impl.js +3 -3
  183. package/dist/extensions/mcp/cli.js +3 -3
  184. package/dist/extensions/mcp/cli.lazy.code.js +2 -2
  185. package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
  186. package/dist/extensions/mcp/cli.lazy.js +3 -3
  187. package/dist/extensions/mcp/runtime.impl.js +3 -3
  188. package/dist/extensions/mcp/runtime.js +3 -3
  189. package/dist/main-first-time-setup.impl.js +3 -3
  190. package/dist/main-first-time-setup.js +3 -3
  191. package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
  192. package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
  193. package/dist/modes/interactive/components/stored-tree-view.js +3 -3
  194. package/dist/modes/interactive/components/tool-block.d.ts +2 -0
  195. package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
  196. package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
  197. package/dist/package-manager-cli.code.js +2 -2
  198. package/dist/package-manager-cli.impl.js +3 -3
  199. package/dist/package-manager-cli.js +3 -3
  200. package/dist/startup-files.json +1 -1
  201. package/dist/utils/startup-database-spare.impl.js +3 -3
  202. package/dist/utils/startup-database-spare.js +3 -3
  203. package/dist/utils/tools-manager.impl.js +3 -3
  204. package/dist/utils/tools-manager.js +3 -3
  205. package/docs/subagents/reference.md +1 -0
  206. package/docs/subagents.md +1 -0
  207. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.10.7] - 2026-11-24
6
+
7
+ Atomic fixes render-engine CPU starvation on expanded running subagent cards, scopes subagents to the session's `enabledModels` allowlist, and updates the bundled `agent-browser` skill.
8
+
9
+ **Subagents and rendering**
10
+
11
+ - **No more CPU starvation on expanded running subagent cards.** Static Prompt, Result, and completed nested tool-call sections are now memoized and `ToolBlockRecords` caches unchanged prefixed rows, while `BackgroundRenderLane` yields a bounded cooldown after slow renders so working-clock animation ticks never starve subsequent model turns ([#6528](https://github.com/bastani-inc/atomic/issues/6528), [#6529](https://github.com/bastani-inc/atomic/pull/6529))
12
+ - **Subagents respect `enabledModels` / `--models`.** `subagent({ action: "models" })`, `model: "auto"`, explicit launches, and child mid-run fallbacks now follow the parent session's active `scopedModels` allowlist ([#6532](https://github.com/bastani-inc/atomic/pull/6532))
13
+
14
+ **Bundled skills**
15
+
16
+ - **Synced `agent-browser` to v0.44.0.** Updates the bundled `agent-browser` skill to replace `protected-vercel-deployments` with `vercel` ([#6530](https://github.com/bastani-inc/atomic/pull/6530))
17
+
18
+ ### Changed
19
+
20
+ - Child sessions created from a parent session now inherit the parent's active `scopedModels` (`enabledModels` / `--models` / `/scoped-models`) and enforce that allowlist during child mid-run model fallback ([#6532](https://github.com/bastani-inc/atomic/pull/6532)).
21
+
22
+ ### Fixed
23
+
24
+ - Expanded running subagent cards no longer saturate the engine CPU or block subsequent model turns: `ToolBlockRecords` caches prefixed rows for unchanged static sections and reuses per-line formatting for unchanged lines, `BackgroundRenderLane` yields a bounded cooldown after slow renders, and `ToolExecutionComponent.setOutputPad()` is now idempotent ([#6528](https://github.com/bastani-inc/atomic/issues/6528), [#6529](https://github.com/bastani-inc/atomic/pull/6529)).
25
+
26
+ ## [0.10.7-alpha.1] - 2026-11-24
27
+
28
+ Atomic fixes render-engine CPU starvation on expanded running subagent cards, scopes subagents to the session's `enabledModels` allowlist, and updates the bundled `agent-browser` skill.
29
+
30
+ **Subagents and rendering**
31
+
32
+ - **No more CPU starvation on expanded running subagent cards.** Static Prompt, Result, and completed nested tool-call sections are now memoized and `ToolBlockRecords` caches unchanged prefixed rows, while `BackgroundRenderLane` yields a bounded cooldown after slow renders so working-clock animation ticks never starve subsequent model turns ([#6528](https://github.com/bastani-inc/atomic/issues/6528), [#6529](https://github.com/bastani-inc/atomic/pull/6529))
33
+ - **Subagents respect `enabledModels` / `--models`.** `subagent({ action: "models" })`, `model: "auto"`, explicit launches, and child mid-run fallbacks now follow the parent session's active `scopedModels` allowlist ([#6532](https://github.com/bastani-inc/atomic/pull/6532))
34
+
35
+ **Bundled skills**
36
+
37
+ - **Synced `agent-browser` to v0.44.0.** Updates the bundled `agent-browser` skill to replace `protected-vercel-deployments` with `vercel` ([#6530](https://github.com/bastani-inc/atomic/pull/6530))
38
+
39
+ ### Changed
40
+
41
+ - Child sessions created from a parent session now inherit the parent's active `scopedModels` (`enabledModels` / `--models` / `/scoped-models`) and enforce that allowlist during child mid-run model fallback ([#6532](https://github.com/bastani-inc/atomic/pull/6532)).
42
+
43
+ ### Fixed
44
+
45
+ - Expanded running subagent cards no longer saturate the engine CPU or block subsequent model turns: `ToolBlockRecords` caches prefixed rows for unchanged static sections and reuses per-line formatting for unchanged lines, `BackgroundRenderLane` yields a bounded cooldown after slow renders, and `ToolExecutionComponent.setOutputPad()` is now idempotent ([#6528](https://github.com/bastani-inc/atomic/issues/6528), [#6529](https://github.com/bastani-inc/atomic/pull/6529)).
46
+
5
47
  ## [0.10.6] - 2026-11-23
6
48
 
7
49
  Atomic unifies picker selection cursors around `∀`, makes `/tasks` rows clickable across every host, hardens recovery from transient mid-stream socket drops, and updates the default Mistral model.
@@ -31842,7 +31842,7 @@ function __atomicOnDemandFailed(error, feature) {
31842
31842
  return (async () => {
31843
31843
  const root = new URL("../", import.meta.url);
31844
31844
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
31845
- const key = `${root.href}#0.10.6`;
31845
+ const key = `${root.href}#0.10.7`;
31846
31846
  let release = releases.get(key);
31847
31847
  if (release === undefined) {
31848
31848
  const current = (async () => {
@@ -31870,7 +31870,7 @@ function __atomicOnDemandFailed(error, feature) {
31870
31870
  } catch {
31871
31871
  // No installation to read, as in a bundle of the package: the release the process runs decides.
31872
31872
  }
31873
- const updatedTo = typeof installed === "string" && installed !== "0.10.6" ? installed : running !== undefined && running.version !== "0.10.6" ? "0.10.6" : undefined;
31873
+ const updatedTo = typeof installed === "string" && installed !== "0.10.7" ? installed : running !== undefined && running.version !== "0.10.7" ? "0.10.7" : undefined;
31874
31874
  if (updatedTo === undefined) throw error;
31875
31875
  const application = typeof running?.name === "string" ? running.name : "atomic";
31876
31876
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -40,7 +40,7 @@ function __atomicOnDemandFailed(error, feature) {
40
40
  return (async () => {
41
41
  const root = new URL("../", import.meta.url);
42
42
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
43
- const key = `${root.href}#0.10.6`;
43
+ const key = `${root.href}#0.10.7`;
44
44
  let release = releases.get(key);
45
45
  if (release === undefined) {
46
46
  const current = (async () => {
@@ -68,7 +68,7 @@ function __atomicOnDemandFailed(error, feature) {
68
68
  } catch {
69
69
  // No installation to read, as in a bundle of the package: the release the process runs decides.
70
70
  }
71
- const updatedTo = typeof installed === "string" && installed !== "0.10.6" ? installed : running !== undefined && running.version !== "0.10.6" ? "0.10.6" : undefined;
71
+ const updatedTo = typeof installed === "string" && installed !== "0.10.7" ? installed : running !== undefined && running.version !== "0.10.7" ? "0.10.7" : undefined;
72
72
  if (updatedTo === undefined) throw error;
73
73
  const application = typeof running?.name === "string" ? running.name : "atomic";
74
74
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -5131,7 +5131,7 @@ function __atomicOnDemandFailed(error, feature) {
5131
5131
  return (async () => {
5132
5132
  const root = new URL("../", import.meta.url);
5133
5133
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
5134
- const key = `${root.href}#0.10.6`;
5134
+ const key = `${root.href}#0.10.7`;
5135
5135
  let release = releases.get(key);
5136
5136
  if (release === undefined) {
5137
5137
  const current = (async () => {
@@ -5159,7 +5159,7 @@ function __atomicOnDemandFailed(error, feature) {
5159
5159
  } catch {
5160
5160
  // No installation to read, as in a bundle of the package: the release the process runs decides.
5161
5161
  }
5162
- const updatedTo = typeof installed === "string" && installed !== "0.10.6" ? installed : running !== undefined && running.version !== "0.10.6" ? "0.10.6" : undefined;
5162
+ const updatedTo = typeof installed === "string" && installed !== "0.10.7" ? installed : running !== undefined && running.version !== "0.10.7" ? "0.10.7" : undefined;
5163
5163
  if (updatedTo === undefined) throw error;
5164
5164
  const application = typeof running?.name === "string" ? running.name : "atomic";
5165
5165
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -28157,7 +28157,7 @@ function __atomicOnDemandFailed(error, feature) {
28157
28157
  return (async () => {
28158
28158
  const root = new URL("../", import.meta.url);
28159
28159
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
28160
- const key = `${root.href}#0.10.6`;
28160
+ const key = `${root.href}#0.10.7`;
28161
28161
  let release = releases.get(key);
28162
28162
  if (release === undefined) {
28163
28163
  const current = (async () => {
@@ -28185,7 +28185,7 @@ function __atomicOnDemandFailed(error, feature) {
28185
28185
  } catch {
28186
28186
  // No installation to read, as in a bundle of the package: the release the process runs decides.
28187
28187
  }
28188
- const updatedTo = typeof installed === "string" && installed !== "0.10.6" ? installed : running !== undefined && running.version !== "0.10.6" ? "0.10.6" : undefined;
28188
+ const updatedTo = typeof installed === "string" && installed !== "0.10.7" ? installed : running !== undefined && running.version !== "0.10.7" ? "0.10.7" : undefined;
28189
28189
  if (updatedTo === undefined) throw error;
28190
28190
  const application = typeof running?.name === "string" ? running.name : "atomic";
28191
28191
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
@@ -70,12 +70,28 @@ function withEndTurn(update, endTurn) {
70
70
  * Jobs run one per event-loop turn. Terminal input that arrives behind a burst of background renders therefore
71
71
  * waits for at most one of them, however many are queued.
72
72
  */
73
+ const SLOW_RENDER_THRESHOLD_MS = 16;
74
+ const MAX_SLOW_RENDER_COOLDOWN_MS = 100;
75
+ function waitTimerCooldown(ms) {
76
+ return new Promise((resolve) => {
77
+ setTimeout(resolve, ms).unref?.();
78
+ });
79
+ }
73
80
  var BackgroundRenderLane = class {
74
81
  pending = /* @__PURE__ */ new Map();
75
82
  draining = false;
83
+ cooldownUntil = 0;
76
84
  yieldTurn;
77
- constructor(yieldTurn = yieldToEventLoop) {
85
+ slowThresholdMs;
86
+ maxCooldownMs;
87
+ waitCooldown;
88
+ now;
89
+ constructor(yieldTurn = yieldToEventLoop, options = {}) {
78
90
  this.yieldTurn = yieldTurn;
91
+ this.slowThresholdMs = options.slowThresholdMs ?? SLOW_RENDER_THRESHOLD_MS;
92
+ this.maxCooldownMs = options.maxCooldownMs ?? MAX_SLOW_RENDER_COOLDOWN_MS;
93
+ this.waitCooldown = options.waitCooldown ?? (yieldTurn === yieldToEventLoop ? waitTimerCooldown : () => yieldTurn());
94
+ this.now = options.now ?? (() => performance.now());
79
95
  }
80
96
  /**
81
97
  * Queue `job` as the render for `key`, replacing a queued render of the same key.
@@ -98,14 +114,20 @@ var BackgroundRenderLane = class {
98
114
  async drain() {
99
115
  try {
100
116
  while (this.pending.size > 0) {
101
- await this.yieldTurn();
117
+ const remainingCooldown = this.cooldownUntil - this.now();
118
+ if (remainingCooldown > 0) await this.waitCooldown(Math.ceil(remainingCooldown));
119
+ else await this.yieldTurn();
102
120
  const next = this.pending.entries().next();
103
121
  if (next.done === true) return;
104
122
  const [key, job] = next.value;
105
123
  this.pending.delete(key);
124
+ const startedAt = this.now();
106
125
  try {
107
126
  job();
108
127
  } catch {}
128
+ const finishedAt = this.now();
129
+ const elapsedMs = finishedAt - startedAt;
130
+ if (elapsedMs >= this.slowThresholdMs) this.cooldownUntil = finishedAt + Math.min(this.maxCooldownMs, Math.ceil(elapsedMs));
109
131
  }
110
132
  } finally {
111
133
  this.draining = false;
@@ -4113,7 +4135,7 @@ function __atomicOnDemandFailed(error, feature) {
4113
4135
  return (async () => {
4114
4136
  const root = new URL("../", import.meta.url);
4115
4137
  const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
4116
- const key = `${root.href}#0.10.6`;
4138
+ const key = `${root.href}#0.10.7`;
4117
4139
  let release = releases.get(key);
4118
4140
  if (release === undefined) {
4119
4141
  const current = (async () => {
@@ -4141,7 +4163,7 @@ function __atomicOnDemandFailed(error, feature) {
4141
4163
  } catch {
4142
4164
  // No installation to read, as in a bundle of the package: the release the process runs decides.
4143
4165
  }
4144
- const updatedTo = typeof installed === "string" && installed !== "0.10.6" ? installed : running !== undefined && running.version !== "0.10.6" ? "0.10.6" : undefined;
4166
+ const updatedTo = typeof installed === "string" && installed !== "0.10.7" ? installed : running !== undefined && running.version !== "0.10.7" ? "0.10.7" : undefined;
4145
4167
  if (updatedTo === undefined) throw error;
4146
4168
  const application = typeof running?.name === "string" ? running.name : "atomic";
4147
4169
  const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {