@nimbus-sh/worker 0.10.0 → 0.11.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.
Files changed (260) hide show
  1. package/NOTICE.md +5 -0
  2. package/README.md +10 -0
  3. package/dist/_shared/session-router.d.ts +7 -0
  4. package/dist/_shared/session-router.d.ts.map +1 -1
  5. package/dist/_shared/session-router.js +7 -0
  6. package/dist/bindings/body.d.ts +6 -0
  7. package/dist/bindings/body.d.ts.map +1 -0
  8. package/dist/bindings/body.js +37 -0
  9. package/dist/bindings/kv.d.ts +0 -2
  10. package/dist/bindings/kv.d.ts.map +1 -1
  11. package/dist/bindings/kv.js +3 -42
  12. package/dist/bindings/r2.d.ts +0 -2
  13. package/dist/bindings/r2.d.ts.map +1 -1
  14. package/dist/bindings/r2.js +4 -44
  15. package/dist/esbuild-cli-artifact.generated.d.ts +18 -0
  16. package/dist/esbuild-cli-artifact.generated.d.ts.map +1 -0
  17. package/dist/esbuild-cli-artifact.generated.js +17 -0
  18. package/dist/facets/cirrus-real.d.ts.map +1 -1
  19. package/dist/facets/cirrus-real.js +9 -4
  20. package/dist/facets/compose.d.ts +11 -7
  21. package/dist/facets/compose.d.ts.map +1 -1
  22. package/dist/facets/compose.js +8 -38
  23. package/dist/facets/data-plan.d.ts +79 -0
  24. package/dist/facets/data-plan.d.ts.map +1 -0
  25. package/dist/facets/data-plan.js +477 -0
  26. package/dist/facets/esbuild-transform.d.ts +36 -10
  27. package/dist/facets/esbuild-transform.d.ts.map +1 -1
  28. package/dist/facets/esbuild-transform.js +216 -20
  29. package/dist/facets/exec-telemetry.d.ts +7 -3
  30. package/dist/facets/exec-telemetry.d.ts.map +1 -1
  31. package/dist/facets/manager.d.ts +179 -78
  32. package/dist/facets/manager.d.ts.map +1 -1
  33. package/dist/facets/manager.js +1221 -649
  34. package/dist/facets/opencode-staging.d.ts +0 -2
  35. package/dist/facets/opencode-staging.d.ts.map +1 -1
  36. package/dist/facets/opencode-staging.js +5 -11
  37. package/dist/facets/process.d.ts +4 -0
  38. package/dist/facets/process.d.ts.map +1 -1
  39. package/dist/facets/process.js +3 -0
  40. package/dist/facets/read-profile.d.ts +149 -0
  41. package/dist/facets/read-profile.d.ts.map +1 -0
  42. package/dist/facets/read-profile.js +483 -0
  43. package/dist/facets/resident-identity.d.ts +0 -1
  44. package/dist/facets/resident-identity.d.ts.map +1 -1
  45. package/dist/facets/resident-identity.js +0 -3
  46. package/dist/facets/wasm-swap-registry.d.ts +34 -25
  47. package/dist/facets/wasm-swap-registry.d.ts.map +1 -1
  48. package/dist/facets/wasm-swap-registry.js +62 -56
  49. package/dist/facets/ws-terminal.d.ts +4 -4
  50. package/dist/facets/ws-terminal.d.ts.map +1 -1
  51. package/dist/facets/ws-terminal.js +4 -5
  52. package/dist/git/commands.d.ts +16 -9
  53. package/dist/git/commands.d.ts.map +1 -1
  54. package/dist/git/commands.js +1818 -188
  55. package/dist/git/network-facet.d.ts +10 -2
  56. package/dist/git/network-facet.d.ts.map +1 -1
  57. package/dist/git/network-facet.js +62 -16
  58. package/dist/git/unified-diff.d.ts +74 -0
  59. package/dist/git/unified-diff.d.ts.map +1 -0
  60. package/dist/git/unified-diff.js +676 -0
  61. package/dist/git-bundle.generated.d.ts +7 -11
  62. package/dist/git-bundle.generated.d.ts.map +1 -1
  63. package/dist/git-bundle.generated.js +7 -11
  64. package/dist/hosted/commands.d.ts.map +1 -1
  65. package/dist/hosted/commands.js +62 -243
  66. package/dist/hosted/runtime.d.ts +19 -13
  67. package/dist/hosted/runtime.d.ts.map +1 -1
  68. package/dist/hosted/runtime.js +71 -14
  69. package/dist/hosted/services.d.ts +6 -7
  70. package/dist/hosted/services.d.ts.map +1 -1
  71. package/dist/hosted/services.js +10 -14
  72. package/dist/hosted/session.d.ts +165 -0
  73. package/dist/hosted/session.d.ts.map +1 -0
  74. package/dist/hosted/session.js +132 -0
  75. package/dist/loaders/generated-workers.d.ts +5 -2
  76. package/dist/loaders/generated-workers.d.ts.map +1 -1
  77. package/dist/loaders/generated-workers.js +6 -3
  78. package/dist/loaders/npm-resolve-preamble.d.ts.map +1 -1
  79. package/dist/loaders/npm-resolve-preamble.js +0 -27
  80. package/dist/node-shims-artifact.generated.d.ts +13 -4
  81. package/dist/node-shims-artifact.generated.d.ts.map +1 -1
  82. package/dist/node-shims-artifact.generated.js +16 -7
  83. package/dist/npm/bin-links.d.ts +3 -1
  84. package/dist/npm/bin-links.d.ts.map +1 -1
  85. package/dist/npm/bin-links.js +32 -8
  86. package/dist/npm/cache.d.ts +5 -0
  87. package/dist/npm/cache.d.ts.map +1 -1
  88. package/dist/npm/cache.js +13 -1
  89. package/dist/npm/install-batch-facet.d.ts +2 -2
  90. package/dist/npm/install-batch-facet.js +3 -3
  91. package/dist/npm/installer.d.ts +17 -1
  92. package/dist/npm/installer.d.ts.map +1 -1
  93. package/dist/npm/installer.js +159 -20
  94. package/dist/npm/package-lock.d.ts +32 -0
  95. package/dist/npm/package-lock.d.ts.map +1 -0
  96. package/dist/npm/package-lock.js +65 -0
  97. package/dist/npm/pre-bundle-facet.d.ts +1 -30
  98. package/dist/npm/pre-bundle-facet.d.ts.map +1 -1
  99. package/dist/npm/pre-bundle-facet.js +3 -5
  100. package/dist/npm/r2-cache.d.ts +2 -0
  101. package/dist/npm/r2-cache.d.ts.map +1 -1
  102. package/dist/npm/r2-cache.js +2 -0
  103. package/dist/npm/resolve-one-facet.d.ts.map +1 -1
  104. package/dist/npm/resolve-one-facet.js +14 -3
  105. package/dist/npm/resolver.d.ts +0 -7
  106. package/dist/npm/resolver.d.ts.map +1 -1
  107. package/dist/npm/resolver.js +0 -22
  108. package/dist/opencode-artifact.generated.js +2 -2
  109. package/dist/replica/routing.d.ts +2 -38
  110. package/dist/replica/routing.d.ts.map +1 -1
  111. package/dist/replica/routing.js +3 -55
  112. package/dist/router/index.d.ts.map +1 -1
  113. package/dist/router/index.js +15 -2
  114. package/dist/router/public-directory.d.ts +18 -0
  115. package/dist/router/public-directory.d.ts.map +1 -1
  116. package/dist/router/public-directory.js +1 -1
  117. package/dist/router/remote-api.d.ts +3 -1
  118. package/dist/router/remote-api.d.ts.map +1 -1
  119. package/dist/router/remote-api.js +42 -79
  120. package/dist/runtime/bash-repl.js +2 -2
  121. package/dist/runtime/bun-repl.d.ts.map +1 -1
  122. package/dist/runtime/bun-repl.js +2 -13
  123. package/dist/runtime/esbuild-wasm-bytes.d.ts +17 -5
  124. package/dist/runtime/esbuild-wasm-bytes.d.ts.map +1 -1
  125. package/dist/runtime/esbuild-wasm-bytes.js +43 -94
  126. package/dist/runtime/git-bundle-artifact.d.ts +17 -0
  127. package/dist/runtime/git-bundle-artifact.d.ts.map +1 -0
  128. package/dist/runtime/git-bundle-artifact.js +25 -0
  129. package/dist/runtime/node-repl.d.ts.map +1 -1
  130. package/dist/runtime/node-repl.js +2 -13
  131. package/dist/runtime/node-shims-artifact.d.ts +22 -23
  132. package/dist/runtime/node-shims-artifact.d.ts.map +1 -1
  133. package/dist/runtime/node-shims-artifact.js +48 -78
  134. package/dist/runtime/node-shims.d.ts.map +1 -1
  135. package/dist/runtime/node-shims.js +1567 -864
  136. package/dist/runtime/opencode-artifact.d.ts.map +1 -1
  137. package/dist/runtime/opencode-artifact.js +17 -53
  138. package/dist/runtime/opencode-facet-runner.d.ts +3 -6
  139. package/dist/runtime/opencode-facet-runner.d.ts.map +1 -1
  140. package/dist/runtime/opencode-facet-runner.js +45 -10
  141. package/dist/runtime/opentui-wasm-bytes.d.ts.map +1 -1
  142. package/dist/runtime/opentui-wasm-bytes.js +16 -49
  143. package/dist/runtime/package-manager.d.ts +0 -2
  144. package/dist/runtime/package-manager.d.ts.map +1 -1
  145. package/dist/runtime/package-manager.js +0 -3
  146. package/dist/runtime/python-repl.d.ts.map +1 -1
  147. package/dist/runtime/python-repl.js +2 -2
  148. package/dist/runtime/repl-session.d.ts +10 -0
  149. package/dist/runtime/repl-session.d.ts.map +1 -1
  150. package/dist/runtime/repl-session.js +7 -0
  151. package/dist/runtime/ruby-repl.d.ts.map +1 -1
  152. package/dist/runtime/ruby-repl.js +2 -2
  153. package/dist/runtime/ruby-resident.d.ts.map +1 -1
  154. package/dist/runtime/ruby-resident.js +36 -35
  155. package/dist/runtime/runtime-catalog.d.ts +10 -3
  156. package/dist/runtime/runtime-catalog.d.ts.map +1 -1
  157. package/dist/runtime/runtime-catalog.js +125 -15
  158. package/dist/runtime/sqlite-wasm-bytes.d.ts +4 -4
  159. package/dist/runtime/sqlite-wasm-bytes.d.ts.map +1 -1
  160. package/dist/runtime/sqlite-wasm-bytes.js +21 -57
  161. package/dist/runtime/staged-source.d.ts +67 -0
  162. package/dist/runtime/staged-source.d.ts.map +1 -0
  163. package/dist/runtime/staged-source.js +113 -0
  164. package/dist/runtime/wasi/preamble.d.ts.map +1 -1
  165. package/dist/runtime/wasi/preamble.js +0 -24
  166. package/dist/runtime-catalog.generated.js +1 -1
  167. package/dist/session/agent.d.ts +14 -2
  168. package/dist/session/agent.d.ts.map +1 -1
  169. package/dist/session/agent.js +57 -19
  170. package/dist/session/ai.d.ts +0 -11
  171. package/dist/session/ai.d.ts.map +1 -1
  172. package/dist/session/ai.js +0 -4
  173. package/dist/session/fs-watch.d.ts +0 -11
  174. package/dist/session/fs-watch.d.ts.map +1 -1
  175. package/dist/session/fs-watch.js +0 -21
  176. package/dist/session/hibernation.d.ts +34 -11
  177. package/dist/session/hibernation.d.ts.map +1 -1
  178. package/dist/session/hibernation.js +46 -29
  179. package/dist/session/init-phases.d.ts +1 -2
  180. package/dist/session/init-phases.d.ts.map +1 -1
  181. package/dist/session/init-phases.js +1 -2
  182. package/dist/session/init.d.ts.map +1 -1
  183. package/dist/session/init.js +7 -20
  184. package/dist/session/keys.d.ts +0 -3
  185. package/dist/session/keys.d.ts.map +1 -1
  186. package/dist/session/keys.js +0 -3
  187. package/dist/session/legacy-reset.d.ts +11 -0
  188. package/dist/session/legacy-reset.d.ts.map +1 -0
  189. package/dist/session/legacy-reset.js +16 -0
  190. package/dist/session/nimbus-session.d.ts +41 -15
  191. package/dist/session/nimbus-session.d.ts.map +1 -1
  192. package/dist/session/nimbus-session.js +64 -70
  193. package/dist/session/npm-install-port.d.ts.map +1 -1
  194. package/dist/session/npm-install-port.js +1 -0
  195. package/dist/session/programmatic.d.ts +13 -18
  196. package/dist/session/programmatic.d.ts.map +1 -1
  197. package/dist/session/programmatic.js +53 -39
  198. package/dist/session/replica-routes.d.ts +2 -3
  199. package/dist/session/replica-routes.d.ts.map +1 -1
  200. package/dist/session/replica-routes.js +3 -10
  201. package/dist/session/routes.d.ts.map +1 -1
  202. package/dist/session/routes.js +7 -10
  203. package/dist/session/rpc.d.ts +104 -20
  204. package/dist/session/rpc.d.ts.map +1 -1
  205. package/dist/session/rpc.js +184 -37
  206. package/dist/session/start-real-vite.js +2 -2
  207. package/dist/session/state-store.d.ts +1 -17
  208. package/dist/session/state-store.d.ts.map +1 -1
  209. package/dist/session/state-store.js +3 -53
  210. package/dist/session/supervisor-op.d.ts +7 -0
  211. package/dist/session/supervisor-op.d.ts.map +1 -1
  212. package/dist/session/supervisor-op.js +6 -1
  213. package/dist/session/supervisor-rpc.d.ts +104 -15
  214. package/dist/session/supervisor-rpc.d.ts.map +1 -1
  215. package/dist/session/supervisor-rpc.js +188 -71
  216. package/dist/session/vite-command.d.ts.map +1 -1
  217. package/dist/session/vite-command.js +17 -14
  218. package/dist/session/ws.d.ts.map +1 -1
  219. package/dist/session/ws.js +20 -8
  220. package/dist/shell/npm-bin-entrypoints.d.ts.map +1 -1
  221. package/dist/shell/npm-bin-entrypoints.js +30 -5
  222. package/dist/vfs/facet-resident-limits.d.ts +33 -0
  223. package/dist/vfs/facet-resident-limits.d.ts.map +1 -0
  224. package/dist/vfs/facet-resident-limits.js +33 -0
  225. package/dist/vfs/facet-resident-store.d.ts +2 -10
  226. package/dist/vfs/facet-resident-store.d.ts.map +1 -1
  227. package/dist/vfs/facet-resident-store.js +1594 -219
  228. package/dist/workspace-host.d.ts +2 -0
  229. package/dist/workspace-host.d.ts.map +1 -1
  230. package/dist/workspace-host.js +2 -0
  231. package/dist/wrangler/nimbus-wrangler.d.ts +0 -2
  232. package/dist/wrangler/nimbus-wrangler.d.ts.map +1 -1
  233. package/dist/wrangler/nimbus-wrangler.js +5 -22
  234. package/package.json +8 -7
  235. package/public/_assets/opencode/1.16.2/index-attach.js +2 -2
  236. package/public/_assets/runtime/esbuild-cli-c4fda380d52befc1.js +6892 -0
  237. package/public/_assets/runtime/git-de3e60c9f3ff006a.js +103 -0
  238. package/public/_assets/runtime/{node-shims-7b4dd7a76d95d21e.js → node-shims-06565b121555c194.js} +2089 -861
  239. package/public/_assets/runtime/resident-store-6ffb1939c53d982f.js +2264 -0
  240. package/public/_assets/runtime/vfs-write-ledger-e501e8fc793bc2c1.js +889 -0
  241. package/scripts/build-opencode-attach-entry.mjs +51 -1
  242. package/scripts/bundle-facet-workers.mjs +114 -3
  243. package/scripts/bundle-git.mjs +88 -27
  244. package/scripts/bundle-node-shims.mjs +72 -46
  245. package/scripts/bundle-runtime.mjs +18 -421
  246. package/scripts/cf-git-patch.mjs +137 -0
  247. package/scripts/patch-install-deps.mjs +49 -96
  248. package/scripts/runtime-specs.mjs +435 -0
  249. package/vendor/git-http.generated.d.ts +82 -0
  250. package/vendor/git-upstream.generated.d.ts +4378 -0
  251. package/vendor/git.LICENSE +7 -0
  252. package/vendor/git.generated.d.mts +21 -0
  253. package/vendor/git.generated.mjs +103 -0
  254. package/dist/replica/suspension.d.ts +0 -36
  255. package/dist/replica/suspension.d.ts.map +0 -1
  256. package/dist/replica/suspension.js +0 -49
  257. package/dist/runtime/static-server.d.ts +0 -3
  258. package/dist/runtime/static-server.d.ts.map +0 -1
  259. package/dist/runtime/static-server.js +0 -133
  260. package/scripts/clean-dist.mjs +0 -7
@@ -1,6 +1,8 @@
1
1
  export { composeFacetManager, type FacetManagerDeps, type FacetManagerHostHooks, type ComposedFacetManager } from './facets/compose.js';
2
2
  export type { WorkerRecipe, ResolvedWorkerLaunch, LongRunningWorkerSpawnOptions } from './facets/manager.js';
3
3
  export { composeHostedRuntime, type HostedRuntime, type HostedRuntimeOptions, type HostedRuntimeLifecycle, type HostedRuntimeTask, type RuntimeFiles } from './hosted/runtime.js';
4
+ export { HostedSession, type HostedSessionScope } from './hosted/session.js';
5
+ export { collectExecStream, decodeExecStream, encodeExecStream, type ExecChunk, type ExecExit, type ExecOutput, type ExecStream, type ExecStreamName } from '@nimbus-sh/core/runtime/exec-stream.js';
4
6
  export { runtimeCatalogSource } from './runtime/runtime-catalog.js';
5
7
  export { SupervisorRPC } from './session/supervisor-rpc.js';
6
8
  export { NimbusAssetsRPC, NimbusLoaderRPC, NimbusLoadedWorker, NimbusLoadedEntrypoint, NimbusDurableObjectNamespace, NimbusDOStub } from '@nimbus-sh/fabric/bindings.js';
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-host.d.ts","sourceRoot":"","sources":["../src/workspace-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACxI,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClL,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"workspace-host.d.ts","sourceRoot":"","sources":["../src/workspace-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACxI,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAE,oBAAoB,EAAE,KAAK,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClL,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACrM,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export { composeFacetManager } from './facets/compose.js';
2
2
  export { composeHostedRuntime } from './hosted/runtime.js';
3
+ export { HostedSession } from './hosted/session.js';
4
+ export { collectExecStream, decodeExecStream, encodeExecStream } from '@nimbus-sh/core/runtime/exec-stream.js';
3
5
  export { runtimeCatalogSource } from './runtime/runtime-catalog.js';
4
6
  export { SupervisorRPC } from './session/supervisor-rpc.js';
5
7
  export { NimbusAssetsRPC, NimbusLoaderRPC, NimbusLoadedWorker, NimbusLoadedEntrypoint, NimbusDurableObjectNamespace, NimbusDOStub } from '@nimbus-sh/fabric/bindings.js';
@@ -69,8 +69,6 @@ export declare class NimbusWrangler {
69
69
  private rebuildTimer;
70
70
  /** DO class map: binding name → DurableObjectClass from the inner worker. */
71
71
  private doClassMap;
72
- /** Facet names we've created via ctx.facets.get — aborted on rebuild / stop. */
73
- private doFacetNames;
74
72
  constructor(opts: NimbusWranglerOptions);
75
73
  /** Start the wrangler dev server. */
76
74
  start(): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"nimbus-wrangler.d.ts","sourceRoot":"","sources":["../../src/wrangler/nimbus-wrangler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAqD/E,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,eAAe,CAAC;IACrB,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,cAAc,CAAC;IACxB,GAAG,EAAE,GAAG,CAAC;IACT;;;;OAIG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC;AAID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,GACxB,MAAM,CA+BR;AAyDD,qBAAa,cAAc;IACzB,OAAO,CAAC,GAAG,CAAkB;IAC7B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,YAAY,CAAqB;IAEzC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,YAAY,CAAa;IACjC,6EAA6E;IAC7E,OAAO,CAAC,UAAU,CAA+B;IACjD,gFAAgF;IAChF,OAAO,CAAC,YAAY,CAA0B;gBAElC,IAAI,EAAE,qBAAqB;IAWvC,qCAAqC;IAC/B,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAqB/B,oCAAoC;IACpC,IAAI,IAAI,IAAI;IAgBZ,IAAI,SAAS,YAA2B;IAIxC,OAAO,CAAC,UAAU;IAiDlB,oFAAoF;IACpF,OAAO,CAAC,gBAAgB;IAqBxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,gBAAgB;YAIV,YAAY;IA6L1B,OAAO,CAAC,aAAa;IAwOrB,OAAO,CAAC,eAAe;IAkCvB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,aAAa,CACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,QAAQ,CAAC;IAsFpB,IAAI,KAAK;;;;;;MAQR;IAYD,8FAA8F;IAC9F,kBAAkB,IAAI,OAAO;IAK7B,+EAA+E;IAC/E,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI5C;;;;;gCAK4B;IAC5B,uBAAuB,IAAI,IAAI;CA4BhC"}
1
+ {"version":3,"file":"nimbus-wrangler.d.ts","sourceRoot":"","sources":["../../src/wrangler/nimbus-wrangler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAqD/E,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,eAAe,CAAC;IACrB,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE,cAAc,CAAC;IACxB,GAAG,EAAE,GAAG,CAAC;IACT;;;;OAIG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CAClC;AAID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,iBAAiB,EAAE,MAAM,GACxB,MAAM,CA+BR;AAyDD,qBAAa,cAAc;IACzB,OAAO,CAAC,GAAG,CAAkB;IAC7B,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,KAAK,CAAwB;IACrC,OAAO,CAAC,YAAY,CAAqB;IAEzC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,YAAY,CAAa;IACjC,6EAA6E;IAC7E,OAAO,CAAC,UAAU,CAA+B;gBAErC,IAAI,EAAE,qBAAqB;IAWvC,qCAAqC;IAC/B,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAqB/B,oCAAoC;IACpC,IAAI,IAAI,IAAI;IAaZ,IAAI,SAAS,YAA2B;IAIxC,OAAO,CAAC,UAAU;IAiDlB,oFAAoF;IACpF,OAAO,CAAC,gBAAgB;IAqBxB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,gBAAgB;YAIV,YAAY;IA2L1B,OAAO,CAAC,aAAa;IAoOrB,OAAO,CAAC,eAAe;IAkCvB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,aAAa,CACjB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,QAAQ,CAAC;IAsFpB,IAAI,KAAK;;;;;;MAQR;IAYD,8FAA8F;IAC9F,kBAAkB,IAAI,OAAO;IAK7B,+EAA+E;IAC/E,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI5C;;;;;gCAK4B;IAC5B,uBAAuB,IAAI,IAAI;CA4BhC"}
@@ -14,7 +14,7 @@
14
14
  * Cloudflare Workers runtime, not a simulation.
15
15
  */
16
16
  import { normalizeVfsPath } from '@nimbus-sh/core/vfs/path.js';
17
- import { registerInnerDoClass, clearInnerDoClasses } from '@nimbus-sh/fabric/inner-do-registry.js';
17
+ import { registerInnerDoClass, clearInnerDoClasses, abortInnerDoFacets } from '@nimbus-sh/fabric/inner-do-registry.js';
18
18
  import { KvEmulator } from '../bindings/kv.js';
19
19
  import { D1Emulator } from '../bindings/d1.js';
20
20
  import { R2Emulator } from '../bindings/r2.js';
@@ -144,8 +144,6 @@ export class NimbusWrangler {
144
144
  rebuildTimer = null;
145
145
  /** DO class map: binding name → DurableObjectClass from the inner worker. */
146
146
  doClassMap = new Map();
147
- /** Facet names we've created via ctx.facets.get — aborted on rebuild / stop. */
148
- doFacetNames = new Set();
149
147
  constructor(opts) {
150
148
  this.vfs = opts.vfs;
151
149
  this.vfsEvents = opts.vfsEvents;
@@ -188,15 +186,9 @@ export class NimbusWrangler {
188
186
  }
189
187
  // Abort live inner-DO facets so their stubs drop. Storage persists per
190
188
  // docs — next start() or `nimbus-wrangler reset` controls deletion.
191
- if (this.doFacetNames.size > 0 && this.supervisorCtx?.facets?.abort) {
192
- for (const name of this.doFacetNames) {
193
- try {
194
- this.supervisorCtx.facets.abort(name, new Error('nimbus-wrangler stopped'));
195
- }
196
- catch { }
197
- }
189
+ if (this.supervisorCtx) {
190
+ abortInnerDoFacets(this.supervisorCtx, this.doClassMap.keys(), new Error('nimbus-wrangler stopped'));
198
191
  }
199
- this.doFacetNames.clear();
200
192
  this.doClassMap.clear();
201
193
  this.workerStub = null;
202
194
  }
@@ -395,13 +387,8 @@ export class NimbusWrangler {
395
387
  // startup callback with the fresh class. Docs: abort invalidates
396
388
  // all existing stubs but preserves storage; the next get() is the
397
389
  // code-update pattern.
398
- if (this.doFacetNames.size > 0 && this.supervisorCtx?.facets?.abort) {
399
- for (const name of this.doFacetNames) {
400
- try {
401
- this.supervisorCtx.facets.abort(name, new Error('nimbus-wrangler rebuilding'));
402
- }
403
- catch { }
404
- }
390
+ if (this.supervisorCtx) {
391
+ abortInnerDoFacets(this.supervisorCtx, this.doClassMap.keys(), new Error('nimbus-wrangler rebuilding'));
405
392
  }
406
393
  // Two-pass load to break the chicken-and-egg:
407
394
  // Pass 1: load with NO env to extract any durable_objects classes.
@@ -629,10 +616,6 @@ export class NimbusWrangler {
629
616
  route: hostRoute() ?? undefined,
630
617
  },
631
618
  });
632
- // Track facet names we might create later so stop() can abort
633
- // them cleanly. Exact ids aren't known until inner calls
634
- // .get(id), so we just track the base name.
635
- this.doFacetNames.add('innerDO-' + bindingName + '-*');
636
619
  }
637
620
  }
638
621
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimbus-sh/worker",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Nimbus runtime package for Cloudflare Workers, re-exported publicly through @nimbus-sh/sdk/worker.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -109,6 +109,7 @@
109
109
  },
110
110
  "files": [
111
111
  "dist",
112
+ "vendor",
112
113
  "public",
113
114
  "scripts",
114
115
  "runtime-contracts",
@@ -127,16 +128,16 @@
127
128
  "bundle:opencode": "node scripts/bundle-opencode.mjs",
128
129
  "bundle:agent-chat": "node scripts/bundle-agent-chat.mjs",
129
130
  "bundle": "bun run bundle:git && bun run bundle:facets && bun run bundle:esbuild && bun run bundle:sqlite && bun run bundle:shims && bun run bundle:tailwind && bun run bundle:opencode && bun run bundle:agent-chat",
130
- "clean:dist": "node scripts/clean-dist.mjs",
131
+ "clean:dist": "node ../../scripts/clean-dist.mjs",
131
132
  "build": "bun run clean:dist && tsc -p tsconfig.json --noCheck --noEmit false --declaration true --declarationMap true --outDir dist --rootDir src",
132
- "prepack": "bun run build",
133
+ "prepublishOnly": "bun ../../scripts/dist-integrity.mjs --publish",
133
134
  "typecheck": "tsc --noEmit && tsc -p frontend --noEmit"
134
135
  },
135
136
  "dependencies": {
136
137
  "@ai-sdk/openai-compatible": "^2.0.41",
137
- "@nimbus-sh/core": "^0.12.0",
138
- "@nimbus-sh/fabric": "^0.7.1",
139
- "@nimbus-sh/platform": "^0.5.1",
138
+ "@nimbus-sh/core": "^0.13.0",
139
+ "@nimbus-sh/fabric": "^0.8.0",
140
+ "@nimbus-sh/platform": "^0.6.0",
140
141
  "@renovatebot/pep440": "^5.0.0",
141
142
  "ai": "^6.0.182",
142
143
  "clean-git-ref": "^2.0.1",
@@ -146,7 +147,6 @@
146
147
  "esbuild-wasm": "0.24.2",
147
148
  "ignore": "^5.1.4",
148
149
  "is-git-ref-name-valid": "^1.0.0",
149
- "isomorphic-git": "npm:@ashishkumar472/cf-git@1.0.5",
150
150
  "minimisted": "^2.0.1",
151
151
  "pako": "1.0.11",
152
152
  "pify": "^4.0.1",
@@ -163,6 +163,7 @@
163
163
  "acorn": "^8.15.0",
164
164
  "dompurify": "3.4.12",
165
165
  "highlight.js": "11.11.1",
166
+ "isomorphic-git": "npm:@ashishkumar472/cf-git@1.0.5",
166
167
  "marked": "18.0.6",
167
168
  "preact": "10.29.7",
168
169
  "typescript": "^5.7.0"
@@ -2688,7 +2688,7 @@ Command timed out before completion.`:`${e.output}${t}
2688
2688
 
2689
2689
  Command exited with code ${e.exitCode}.`},Uws=e=>e.cause instanceof Error&&e.cause.message==="Timed out",Kws=_y.make({description:`Execute one shell command string with the host user's filesystem, process, and network authority. The active Location is the default working directory. Relative workdir values resolve from that Location. External workdir values require external_directory approval; best-effort command-argument path warnings are advisory only. Timeout values are milliseconds (default: ${VCe}; maximum: ${$Ce}). Uses the configured shell when set; otherwise uses /bin/sh on POSIX and COMSPEC or cmd.exe on Windows.`,parameters:nPr,success:Gws,toModelOutput:({output:e})=>[f0({type:"text",text:Wws(e)})]}),Qws=e=>e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g)??[],Yws=e=>e.replace(/^(['"])(.*)\1$/,"$2"),Jws=(e,t)=>{let r=new Set;for(let n of Qws(e)){let s=Yws(n).replace(/[;,|&]+$/,"");if(!rut.isAbsolute(s))continue;let a=Wr.resolve(s);Wr.contains(t,a)||r.add(Wr.resolve(rut.dirname(a)))}return[...r]},Xws=Tt.effectDiscard(M.gen(function*(){let e=yield*k0.Service,t=yield*fx.Service,r=yield*hc.Service,n=yield*Hv.Service,s=yield*Zh.Service;yield*e.contribute(a=>a.set(uut,{tool:Kws,execute:({parameters:o,sessionID:l,call:c,assertPermission:u})=>M.gen(function*(){let d=yield*t.resolve({path:o.workdir??".",kind:"directory"}),f=d.target.externalDirectory;f&&(yield*u(fx.externalDirectoryPermission(f)));let p=Jws(o.command,d.target.canonical).map(E=>`Command argument references external directory ${rut.join(E,"*").replaceAll("\\","/")}. Bash runs with host-user filesystem, process, and network authority; this scan is advisory only.`);yield*u({action:uut,resources:[o.command],save:[o.command]});let m=yield*t.revalidate(d);if(!m.exists||m.type!=="Directory")throw Error(`Working directory is not a directory: ${m.canonical}`);let g=yield*s.entries(),y=Object.assign({},...g.flatMap(E=>E.type==="document"?[E.info]:[])).shell??Hws(),v=bl.make(o.command,[],{cwd:m.canonical,shell:y,stdin:"ignore",detached:process.platform!=="win32",forceKillAfter:Fo.seconds(3)}),b=o.timeout??VCe,_=yield*r.run(v,{timeout:Fo.millis(b),maxOutputBytes:cut,maxErrorBytes:cut}).pipe(M.catchTag("AppProcessError",E=>Uws(E)?M.succeed(void 0):M.fail(E)));if(!_)return{command:o.command,cwd:m.canonical,output:`Command exceeded timeout of ${b} ms. Retry with a larger timeout if the command is expected to take longer.`,truncated:!1,timedOut:!0,...p.length?{warnings:p}:{}};let A=Vws(_.stdout.toString("utf8"),_.stderr.toString("utf8")),w=zws(_.stdoutTruncated,_.stderrTruncated),S=yield*n.truncate({sessionID:l,toolCallID:c.id,content:w?`${A}
2690
2690
 
2691
- ${w}`:A});return{command:o.command,cwd:m.canonical,exitCode:_.exitCode,output:S.content,truncated:S.truncated||_.stdoutTruncated||_.stderrTruncated,...p.length?{warnings:p}:{},..._.stdoutTruncated?{stdoutTruncated:!0}:{},..._.stderrTruncated?{stderrTruncated:!0}:{},...S.truncated&&!_.stdoutTruncated&&!_.stderrTruncated?{resource:S.resource}:{}}}).pipe(M.catchCause(d=>M.fail(new Gu({message:`Unable to execute command: ${o.command}`,error:Dn.squash(d)}))))}))})),dut={};Ft(dut,{toModelOutput:()=>uPr,name:()=>sPr,layer:()=>dEs,Success:()=>lPr,Parameters:()=>aPr,ApplyPatchTool:()=>dut,Applied:()=>oPr});qoe={};Ft(qoe,{parse:()=>Zws,joinBom:()=>tEs,derive:()=>eEs,Patch:()=>qoe});sEs=(e,t)=>e===t,aEs=(e,t)=>e.trimEnd()===t.trimEnd(),oEs=(e,t)=>e.trim()===t.trim(),lEs=(e,t)=>RRr(e.trim())===RRr(t.trim()),RRr=e=>e.replace(/[‘’‚‛]/g,"'").replace(/[“”„‟]/g,'"').replace(/[‐‑‒–—―]/g,"-").replace(/…/g,"...").replace(/ /g," "),put=e=>e.startsWith("\uFEFF")?{bom:!0,text:e.slice(1)}:{bom:!1,text:e},uEs=e=>e.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/)?.[2]??e,sPr="apply_patch",aPr=T.Struct({patchText:T.String.annotate({description:"The full patch text describing add, update, and delete operations"})}),oPr=T.Struct({type:T.Literals(["add","update","delete"]),resource:T.String,target:T.String}),lPr=T.Struct({applied:T.Array(oPr)}),uPr=e=>["Applied patch sequentially:",...e.applied.map(t=>`${t.type==="add"?"A":t.type==="delete"?"D":"M"} ${t.resource}`)].join(`
2691
+ ${w}`:A});return{command:o.command,cwd:m.canonical,exitCode:_.exitCode,output:S.content,truncated:S.truncated||_.stdoutTruncated||_.stderrTruncated,...p.length?{warnings:p}:{},..._.stdoutTruncated?{stdoutTruncated:!0}:{},..._.stderrTruncated?{stderrTruncated:!0}:{},...S.truncated&&!_.stdoutTruncated&&!_.stderrTruncated?{resource:S.resource}:{}}}).pipe(M.catchCause(d=>M.fail(new Gu({message:`Unable to execute command: ${o.command}`,error:Dn.squash(d)}))))}))})),dut={};Ft(dut,{toModelOutput:()=>uPr,name:()=>sPr,layer:()=>dEs,Success:()=>lPr,Parameters:()=>aPr,ApplyPatchTool:()=>dut,Applied:()=>oPr});qoe={};Ft(qoe,{parse:()=>Zws,joinBom:()=>tEs,derive:()=>eEs,Patch:()=>qoe});sEs=(e,t)=>e===t,aEs=(e,t)=>e.trimEnd()===t.trimEnd(),oEs=(e,t)=>e.trim()===t.trim(),lEs=(e,t)=>RRr(e.trim())===RRr(t.trim()),RRr=e=>e.replace(/[\u2018\u2019\u201a\u201b]/g,"'").replace(/[\u201c\u201d\u201e\u201f]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015]/g,"-").replace(/\u2026/g,"...").replace(/\u00a0/g," "),put=e=>e.startsWith("\uFEFF")?{bom:!0,text:e.slice(1)}:{bom:!1,text:e},uEs=e=>e.match(/^(?:cat\s+)?<<['"]?(\w+)['"]?\s*\n([\s\S]*?)\n\1\s*$/)?.[2]??e,sPr="apply_patch",aPr=T.Struct({patchText:T.String.annotate({description:"The full patch text describing add, update, and delete operations"})}),oPr=T.Struct({type:T.Literals(["add","update","delete"]),resource:T.String,target:T.String}),lPr=T.Struct({applied:T.Array(oPr)}),uPr=e=>["Applied patch sequentially:",...e.applied.map(t=>`${t.type==="add"?"A":t.type==="delete"?"D":"M"} ${t.resource}`)].join(`
2692
2692
  `),cEs=_y.make({description:"Apply one patch containing add, update, and delete file operations. All targets are resolved and approved before target contents are read. Operations apply sequentially; if a later operation fails, earlier operations remain applied and the failure reports them explicitly. Moves and atomic rollback are not supported yet.",parameters:aPr,success:lPr,toModelOutput:({output:e})=>[f0({type:"text",text:uPr(e)})]}),dEs=Tt.effectDiscard(M.gen(function*(){let e=yield*k0.Service,t=yield*fx.Service,r=yield*G6.Service,n=yield*Wr.Service;yield*e.contribute(s=>s.set(sPr,{tool:cEs,execute:({parameters:a,assertPermission:o})=>{let l=[],c=(u,d)=>{let f=l.length===0?`Unable to apply patch at ${u}`:`Patch partially applied before failing at ${u}. Applied: ${l.map(p=>p.resource).join(", ")}`;return new Gu({message:f,error:d})};return M.gen(function*(){if(!a.patchText.trim())return yield*new Gu({message:"patchText is required"});let u=yield*M.try({try:()=>qoe.parse(a.patchText),catch:m=>new Gu({message:`apply_patch verification failed: ${String(m)}`})});if(u.length===0)return yield*new Gu({message:"patch rejected: empty patch"});if(u.find(m=>m.type==="update"&&m.movePath!==void 0))return yield*new Gu({message:"apply_patch moves are not supported yet"});let d=[];for(let m of u)d.push({hunk:m,plan:yield*t.resolve({path:m.path,kind:"file"})});let f=new Map;for(let{plan:m}of d){let g=m.target.externalDirectory;g&&f.set(g.resource,g)}for(let m of f.values())yield*o(fx.externalDirectoryPermission(m));yield*o({action:"edit",resources:[...new Set(d.map(({plan:m})=>m.target.resource))],save:["*"]});let p=[];for(let{hunk:m,plan:g}of d){if(m.type==="add"){if((yield*t.revalidate(g)).exists)return yield*c(m.path,Error("Target file already exists"));p.push({type:m.type,hunk:m,plan:g});continue}let y=yield*t.revalidate(g);if(!y.exists||y.type!=="File")return yield*c(m.path,Error("Target file does not exist"));if(m.type==="delete"){p.push({type:m.type,hunk:m,plan:g});continue}let v=yield*n.readFile(y.canonical),b=qoe.derive(m.path,m.chunks,new TextDecoder("utf-8",{ignoreBOM:!0}).decode(v));p.push({type:m.type,hunk:m,plan:g,source:v,content:qoe.joinBom(b.content,b.bom)})}return yield*M.uninterruptible(M.forEach(p,m=>M.gen(function*(){if(m.type==="add"){let y=yield*r.create({plan:m.plan,content:m.hunk.contents.endsWith(`
2693
2693
  `)||m.hunk.contents===""?m.hunk.contents:`${m.hunk.contents}
2694
2694
  `});l.push({type:m.type,resource:y.resource,target:y.target});return}if(m.type==="delete"){let y=yield*r.remove({plan:m.plan});l.push({type:m.type,resource:y.resource,target:y.target});return}let g=yield*r.writeIfUnchanged({plan:m.plan,expected:m.source,content:m.content});l.push({type:m.type,resource:g.resource,target:g.target})}).pipe(M.catchCause(g=>M.fail(c(m.hunk.path,Dn.squash(g))))),{discard:!0})),{applied:l}}).pipe(M.catchCause(u=>{let d=Dn.squash(u);return M.fail(d instanceof Gu?d:c("patch",d))}))}}))})),fut={};Ft(fut,{toModelOutput:()=>fPr,name:()=>cPr,layer:()=>vEs,Success:()=>pPr,Parameters:()=>dPr,EditTool:()=>fut});cPr="edit",dPr=T.Struct({path:T.String.annotate({description:"File path to edit. Relative paths resolve within the active Location. Absolute paths inside that Location are accepted; external absolute paths require external_directory approval. Named project references are read-oriented and are not accepted."}),oldString:T.String.annotate({description:"Exact text to replace"}),newString:T.String.annotate({description:"Replacement text, which must differ from oldString"}),replaceAll:T.Boolean.pipe(T.optional).annotate({description:"Replace all exact occurrences of oldString (default false)"})}),pPr=T.Struct({operation:T.Literal("write"),target:T.String,resource:T.String,existed:T.Boolean,replacements:T.Number}),hut=e=>e.replaceAll(`\r
@@ -3775,7 +3775,7 @@ gh pr create --title "the pr title" --body-file pr-body.txt`,parameterDescriptio
3775
3775
  `);s.length>0&&s[s.length-1]===""&&s.pop();let a=D6s(s,e,t),o=O6s(s,a);(o.length===0||o[o.length-1]!=="")&&o.push("");let l=xj(o.join(`
3776
3776
  `)),c=l.text;return{unified_diff:R6s(n.text,c),content:c,bom:n.bom||l.bom}}function D6s(e,t,r){let n=[],s=0;for(let a of r){if(a.change_context){let u=Spt(e,[a.change_context],s);if(u===-1)throw Error(`Failed to find context '${a.change_context}' in ${t}`);s=u+1}if(a.old_lines.length===0){let u=e.length>0&&e[e.length-1]===""?e.length-1:e.length;n.push([u,0,a.new_lines]);continue}let{old_lines:o,new_lines:l}=a,c=Spt(e,o,s,a.is_end_of_file);if(c===-1&&o.length>0&&o[o.length-1]===""&&(o=o.slice(0,-1),l.length>0&&l[l.length-1]===""&&(l=l.slice(0,-1)),c=Spt(e,o,s,a.is_end_of_file)),c!==-1)n.push([c,o.length,l]),s=c+o.length;else throw Error(`Failed to find expected lines in ${t}:
3777
3777
  ${a.old_lines.join(`
3778
- `)}`)}return n.sort((a,o)=>a[0]-o[0]),n}function O6s(e,t){let r=[...e];for(let n=t.length-1;n>=0;n--){let[s,a,o]=t[n];r.splice(s,a);for(let l=0;l<o.length;l++)r.splice(s+l,0,o[l])}return r}function YFr(e){return e.replace(/[‘’‚‛]/g,"'").replace(/[“”„‟]/g,'"').replace(/[‐‑‒–—―]/g,"-").replace(/…/g,"...").replace(/ /g," ")}function nDe(e,t,r,n,s){if(s){let a=e.length-t.length;if(a>=r){let o=!0;for(let l=0;l<t.length;l++)if(!n(e[a+l],t[l])){o=!1;break}if(o)return a}}for(let a=r;a<=e.length-t.length;a++){let o=!0;for(let l=0;l<t.length;l++)if(!n(e[a+l],t[l])){o=!1;break}if(o)return a}return-1}function Spt(e,t,r,n=!1){if(t.length===0)return-1;let s=nDe(e,t,r,(l,c)=>l===c,n);if(s!==-1)return s;let a=nDe(e,t,r,(l,c)=>l.trimEnd()===c.trimEnd(),n);if(a!==-1)return a;let o=nDe(e,t,r,(l,c)=>l.trim()===c.trim(),n);return o!==-1?o:nDe(e,t,r,(l,c)=>YFr(l.trim())===YFr(c.trim()),n)}function R6s(e,t){let r=e.split(`
3778
+ `)}`)}return n.sort((a,o)=>a[0]-o[0]),n}function O6s(e,t){let r=[...e];for(let n=t.length-1;n>=0;n--){let[s,a,o]=t[n];r.splice(s,a);for(let l=0;l<o.length;l++)r.splice(s+l,0,o[l])}return r}function YFr(e){return e.replace(/[\u2018\u2019\u201a\u201b]/g,"'").replace(/[\u201c\u201d\u201e\u201f]/g,'"').replace(/[\u2010\u2011\u2012\u2013\u2014\u2015]/g,"-").replace(/\u2026/g,"...").replace(/\u00a0/g," ")}function nDe(e,t,r,n,s){if(s){let a=e.length-t.length;if(a>=r){let o=!0;for(let l=0;l<t.length;l++)if(!n(e[a+l],t[l])){o=!1;break}if(o)return a}}for(let a=r;a<=e.length-t.length;a++){let o=!0;for(let l=0;l<t.length;l++)if(!n(e[a+l],t[l])){o=!1;break}if(o)return a}return-1}function Spt(e,t,r,n=!1){if(t.length===0)return-1;let s=nDe(e,t,r,(l,c)=>l===c,n);if(s!==-1)return s;let a=nDe(e,t,r,(l,c)=>l.trimEnd()===c.trimEnd(),n);if(a!==-1)return a;let o=nDe(e,t,r,(l,c)=>l.trim()===c.trim(),n);return o!==-1?o:nDe(e,t,r,(l,c)=>YFr(l.trim())===YFr(c.trim()),n)}function R6s(e,t){let r=e.split(`
3779
3779
  `),n=t.split(`
3780
3780
  `),s=`@@ -1 +1 @@
3781
3781
  `,a=Math.max(r.length,n.length),o=!1;for(let l=0;l<a;l++){let c=r[l]||"",u=n[l]||"";c!==u?(c&&(s+=`-${c}