cuelo 0.5.0 → 0.5.1

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 (324) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +11 -11
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +4 -4
  6. package/.next/required-server-files.json +4 -4
  7. package/.next/server/app/_global-error/page.js +3 -3
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/.next/server/app/_not-found/page.js +2 -2
  18. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/_not-found.html +1 -1
  20. package/.next/server/app/_not-found.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  22. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  24. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next/server/app/api/agent/[id]/account/route.js +1 -1
  28. package/.next/server/app/api/agent/[id]/account/route.js.nft.json +1 -1
  29. package/.next/server/app/api/agent/[id]/account/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/agent/[id]/bash-output/route.js +1 -1
  31. package/.next/server/app/api/agent/[id]/bash-output/route_client-reference-manifest.js +1 -1
  32. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  33. package/.next/server/app/api/agent/[id]/events/route.js.nft.json +1 -1
  34. package/.next/server/app/api/agent/[id]/events/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/agent/[id]/route.js +1 -1
  36. package/.next/server/app/api/agent/[id]/route.js.nft.json +1 -1
  37. package/.next/server/app/api/agent/[id]/route_client-reference-manifest.js +1 -1
  38. package/.next/server/app/api/agent/new/route.js +1 -1
  39. package/.next/server/app/api/agent/new/route.js.nft.json +1 -1
  40. package/.next/server/app/api/agent/new/route_client-reference-manifest.js +1 -1
  41. package/.next/server/app/api/agent/running/route.js +1 -1
  42. package/.next/server/app/api/agent/running/route.js.nft.json +1 -1
  43. package/.next/server/app/api/agent/running/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  45. package/.next/server/app/api/auth/all-providers/route_client-reference-manifest.js +1 -1
  46. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  47. package/.next/server/app/api/auth/api-key/[provider]/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  49. package/.next/server/app/api/auth/login/[provider]/route_client-reference-manifest.js +1 -1
  50. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  51. package/.next/server/app/api/auth/logout/[provider]/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/auth/providers/route.js +1 -1
  53. package/.next/server/app/api/auth/providers/route_client-reference-manifest.js +1 -1
  54. package/.next/server/app/api/cwd/browse/route.js +1 -1
  55. package/.next/server/app/api/cwd/browse/route.js.nft.json +1 -1
  56. package/.next/server/app/api/cwd/browse/route_client-reference-manifest.js +1 -1
  57. package/.next/server/app/api/cwd/validate/route.js +1 -1
  58. package/.next/server/app/api/cwd/validate/route.js.nft.json +1 -1
  59. package/.next/server/app/api/cwd/validate/route_client-reference-manifest.js +1 -1
  60. package/.next/server/app/api/default-cwd/route.js +1 -1
  61. package/.next/server/app/api/default-cwd/route.js.nft.json +1 -1
  62. package/.next/server/app/api/default-cwd/route_client-reference-manifest.js +1 -1
  63. package/.next/server/app/api/display-settings/route.js +1 -1
  64. package/.next/server/app/api/display-settings/route.js.nft.json +1 -1
  65. package/.next/server/app/api/display-settings/route_client-reference-manifest.js +1 -1
  66. package/.next/server/app/api/document-text/route.js +1 -1
  67. package/.next/server/app/api/document-text/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/experiments/route.js +1 -1
  69. package/.next/server/app/api/experiments/route_client-reference-manifest.js +1 -1
  70. package/.next/server/app/api/file-index/route.js +1 -1
  71. package/.next/server/app/api/file-index/route.js.nft.json +1 -1
  72. package/.next/server/app/api/file-index/route_client-reference-manifest.js +1 -1
  73. package/.next/server/app/api/files/[...path]/route.js +2 -2
  74. package/.next/server/app/api/files/[...path]/route.js.nft.json +1 -1
  75. package/.next/server/app/api/files/[...path]/route_client-reference-manifest.js +1 -1
  76. package/.next/server/app/api/git/diff/route.js +2 -2
  77. package/.next/server/app/api/git/diff/route.js.nft.json +1 -1
  78. package/.next/server/app/api/git/diff/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/git/status/route.js +1 -1
  80. package/.next/server/app/api/git/status/route.js.nft.json +1 -1
  81. package/.next/server/app/api/git/status/route_client-reference-manifest.js +1 -1
  82. package/.next/server/app/api/gpt6/handles/route.js +1 -1
  83. package/.next/server/app/api/gpt6/handles/route.js.nft.json +1 -1
  84. package/.next/server/app/api/gpt6/handles/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/gpt6/mcp/route.js +1 -1
  86. package/.next/server/app/api/gpt6/mcp/route.js.nft.json +1 -1
  87. package/.next/server/app/api/gpt6/mcp/route_client-reference-manifest.js +1 -1
  88. package/.next/server/app/api/gpt6/reply/route.js +1 -1
  89. package/.next/server/app/api/gpt6/reply/route.js.nft.json +1 -1
  90. package/.next/server/app/api/gpt6/reply/route_client-reference-manifest.js +1 -1
  91. package/.next/server/app/api/gpt6/token/route.js +1 -1
  92. package/.next/server/app/api/gpt6/token/route.js.nft.json +1 -1
  93. package/.next/server/app/api/gpt6/token/route_client-reference-manifest.js +1 -1
  94. package/.next/server/app/api/gpt6/web6-session/route.js +1 -1
  95. package/.next/server/app/api/gpt6/web6-session/route.js.nft.json +1 -1
  96. package/.next/server/app/api/gpt6/web6-session/route_client-reference-manifest.js +1 -1
  97. package/.next/server/app/api/home/route.js +1 -1
  98. package/.next/server/app/api/home/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/live/call/[callId]/route.js +1 -1
  100. package/.next/server/app/api/live/call/[callId]/route.js.nft.json +1 -1
  101. package/.next/server/app/api/live/call/[callId]/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/live/events/route.js +2 -2
  103. package/.next/server/app/api/live/events/route.js.nft.json +1 -1
  104. package/.next/server/app/api/live/events/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/live/offer/route.js +1 -1
  106. package/.next/server/app/api/live/offer/route.js.nft.json +1 -1
  107. package/.next/server/app/api/live/offer/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/live/voices/route.js +1 -1
  109. package/.next/server/app/api/live/voices/route.js.nft.json +1 -1
  110. package/.next/server/app/api/live/voices/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/mcp/route.js +2 -2
  112. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  113. package/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/model-roles/route.js +1 -1
  115. package/.next/server/app/api/model-roles/route.js.nft.json +1 -1
  116. package/.next/server/app/api/model-roles/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/models/route.js +1 -1
  118. package/.next/server/app/api/models/route.js.nft.json +1 -1
  119. package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/models-config/catalog/route.js +1 -1
  121. package/.next/server/app/api/models-config/catalog/route_client-reference-manifest.js +1 -1
  122. package/.next/server/app/api/models-config/discover/route.js +1 -1
  123. package/.next/server/app/api/models-config/discover/route_client-reference-manifest.js +1 -1
  124. package/.next/server/app/api/models-config/route.js +2 -2
  125. package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/models-config/test/route.js +1 -1
  127. package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
  128. package/.next/server/app/api/plugins/route.js +1 -1
  129. package/.next/server/app/api/plugins/route.js.nft.json +1 -1
  130. package/.next/server/app/api/plugins/route_client-reference-manifest.js +1 -1
  131. package/.next/server/app/api/project-trust/route.js +1 -1
  132. package/.next/server/app/api/project-trust/route.js.nft.json +1 -1
  133. package/.next/server/app/api/project-trust/route_client-reference-manifest.js +1 -1
  134. package/.next/server/app/api/projects/route.js +1 -1
  135. package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  136. package/.next/server/app/api/runs/[runId]/route.js +1 -1
  137. package/.next/server/app/api/runs/[runId]/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/runs/route.js +1 -1
  139. package/.next/server/app/api/runs/route_client-reference-manifest.js +1 -1
  140. package/.next/server/app/api/sessions/[id]/auto-name/route.js +1 -1
  141. package/.next/server/app/api/sessions/[id]/auto-name/route.js.nft.json +1 -1
  142. package/.next/server/app/api/sessions/[id]/auto-name/route_client-reference-manifest.js +1 -1
  143. package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
  144. package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -1
  145. package/.next/server/app/api/sessions/[id]/context/route_client-reference-manifest.js +1 -1
  146. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route.js +1 -1
  147. package/.next/server/app/api/sessions/[id]/entries/[entryId]/thinking/route_client-reference-manifest.js +1 -1
  148. package/.next/server/app/api/sessions/[id]/export/route.js +1 -1
  149. package/.next/server/app/api/sessions/[id]/export/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  151. package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  152. package/.next/server/app/api/sessions/[id]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/sessions/[id]/state/route.js +1 -1
  154. package/.next/server/app/api/sessions/[id]/state/route.js.nft.json +1 -1
  155. package/.next/server/app/api/sessions/[id]/state/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/sessions/route.js +1 -1
  157. package/.next/server/app/api/sessions/route.js.nft.json +1 -1
  158. package/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/settings/route.js +1 -1
  160. package/.next/server/app/api/settings/route.js.nft.json +1 -1
  161. package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/sidecars/[service]/[...path]/route.js +1 -1
  163. package/.next/server/app/api/sidecars/[service]/[...path]/route_client-reference-manifest.js +1 -1
  164. package/.next/server/app/api/skills/check/route.js +1 -1
  165. package/.next/server/app/api/skills/check/route.js.nft.json +1 -1
  166. package/.next/server/app/api/skills/check/route_client-reference-manifest.js +1 -1
  167. package/.next/server/app/api/skills/install/route.js +1 -1
  168. package/.next/server/app/api/skills/install/route.js.nft.json +1 -1
  169. package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
  170. package/.next/server/app/api/skills/route.js +2 -2
  171. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  172. package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
  173. package/.next/server/app/api/skills/search/route.js +1 -1
  174. package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
  175. package/.next/server/app/api/skills/update/route.js +1 -1
  176. package/.next/server/app/api/skills/update/route.js.nft.json +1 -1
  177. package/.next/server/app/api/skills/update/route_client-reference-manifest.js +1 -1
  178. package/.next/server/app/api/theme/route.js +1 -1
  179. package/.next/server/app/api/theme/route.js.nft.json +1 -1
  180. package/.next/server/app/api/theme/route_client-reference-manifest.js +1 -1
  181. package/.next/server/app/api/update-maintenance/route.js +2 -2
  182. package/.next/server/app/api/update-maintenance/route.js.nft.json +1 -1
  183. package/.next/server/app/api/update-maintenance/route_client-reference-manifest.js +1 -1
  184. package/.next/server/app/api/updates/route.js +1 -1
  185. package/.next/server/app/api/updates/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/web-access/recovery/route.js +1 -1
  187. package/.next/server/app/api/web-access/recovery/route.js.nft.json +1 -1
  188. package/.next/server/app/api/web-access/recovery/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/web-access/route.js +1 -1
  190. package/.next/server/app/api/web-access/route.js.nft.json +1 -1
  191. package/.next/server/app/api/web-access/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/web6/consults/route.js +1 -1
  193. package/.next/server/app/api/web6/consults/route_client-reference-manifest.js +1 -1
  194. package/.next/server/app/api/worktrees/route.js +1 -1
  195. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  196. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  197. package/.next/server/app/favicon.ico/route.js +1 -1
  198. package/.next/server/app/index.html +1 -1
  199. package/.next/server/app/index.rsc +5 -5
  200. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  201. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  202. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  203. package/.next/server/app/index.segments/_index.segment.rsc +3 -3
  204. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  205. package/.next/server/app/manifest.webmanifest/route.js +2 -2
  206. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/page.js +9 -9
  208. package/.next/server/app/page_client-reference-manifest.js +1 -1
  209. package/.next/server/app/recover/page.js +2 -2
  210. package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
  211. package/.next/server/app/recover.html +1 -1
  212. package/.next/server/app/recover.rsc +4 -4
  213. package/.next/server/app/recover.segments/_full.segment.rsc +4 -4
  214. package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
  215. package/.next/server/app/recover.segments/_index.segment.rsc +3 -3
  216. package/.next/server/app/recover.segments/_tree.segment.rsc +2 -2
  217. package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +2 -2
  218. package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
  219. package/.next/server/app-paths-manifest.json +11 -11
  220. package/.next/server/chunks/319.js +3 -3
  221. package/.next/server/chunks/3379.js +1 -1
  222. package/.next/server/chunks/7245.js +1 -1
  223. package/.next/server/chunks/9280.js +1 -1
  224. package/.next/server/middleware-build-manifest.js +1 -1
  225. package/.next/server/middleware.js +11 -11
  226. package/.next/server/pages/404.html +1 -1
  227. package/.next/server/pages/500.html +1 -1
  228. package/.next/server/server-reference-manifest.json +1 -1
  229. package/.next/static/chunks/app/_not-found/page-d47816c8266ad10a.js +1 -0
  230. package/.next/static/chunks/app/{layout-95725ad1abf3cb75.js → layout-85736d5559027813.js} +1 -1
  231. package/.next/static/chunks/app/{page-26a4df181c1d562c.js → page-5cde6189aa974555.js} +4 -4
  232. package/.next/static/chunks/app/recover/page-b21a217e972ce75f.js +1 -0
  233. package/.next/static/chunks/{main-app-0dc38ffe862cd588.js → main-app-0af2539744a1d9c8.js} +1 -1
  234. package/.next/static/chunks/next/dist/client/components/builtin/global-error-5bf20286772920a7.js +1 -0
  235. package/.next/static/css/e55ae9b4602a1ee6.css +1 -0
  236. package/.next/trace +7 -8
  237. package/.next/trace-build +1 -1
  238. package/.next/types/app/api/agent/[id]/account/route.ts +1 -1
  239. package/.next/types/app/api/agent/[id]/bash-output/route.ts +1 -1
  240. package/.next/types/app/api/agent/[id]/events/route.ts +1 -1
  241. package/.next/types/app/api/agent/[id]/route.ts +1 -1
  242. package/.next/types/app/api/agent/new/route.ts +1 -1
  243. package/.next/types/app/api/agent/running/route.ts +1 -1
  244. package/.next/types/app/api/auth/all-providers/route.ts +1 -1
  245. package/.next/types/app/api/auth/api-key/[provider]/route.ts +1 -1
  246. package/.next/types/app/api/auth/login/[provider]/route.ts +1 -1
  247. package/.next/types/app/api/auth/logout/[provider]/route.ts +1 -1
  248. package/.next/types/app/api/auth/providers/route.ts +1 -1
  249. package/.next/types/app/api/cwd/browse/route.ts +1 -1
  250. package/.next/types/app/api/cwd/validate/route.ts +1 -1
  251. package/.next/types/app/api/default-cwd/route.ts +1 -1
  252. package/.next/types/app/api/display-settings/route.ts +1 -1
  253. package/.next/types/app/api/document-text/route.ts +1 -1
  254. package/.next/types/app/api/experiments/route.ts +1 -1
  255. package/.next/types/app/api/file-index/route.ts +1 -1
  256. package/.next/types/app/api/files/[...path]/route.ts +1 -1
  257. package/.next/types/app/api/git/diff/route.ts +1 -1
  258. package/.next/types/app/api/git/status/route.ts +1 -1
  259. package/.next/types/app/api/gpt6/handles/route.ts +1 -1
  260. package/.next/types/app/api/gpt6/mcp/route.ts +1 -1
  261. package/.next/types/app/api/gpt6/reply/route.ts +1 -1
  262. package/.next/types/app/api/gpt6/token/route.ts +1 -1
  263. package/.next/types/app/api/gpt6/web6-session/route.ts +1 -1
  264. package/.next/types/app/api/home/route.ts +1 -1
  265. package/.next/types/app/api/live/call/[callId]/route.ts +1 -1
  266. package/.next/types/app/api/live/events/route.ts +1 -1
  267. package/.next/types/app/api/live/offer/route.ts +1 -1
  268. package/.next/types/app/api/live/voices/route.ts +1 -1
  269. package/.next/types/app/api/mcp/route.ts +1 -1
  270. package/.next/types/app/api/model-roles/route.ts +1 -1
  271. package/.next/types/app/api/models/route.ts +1 -1
  272. package/.next/types/app/api/models-config/catalog/route.ts +1 -1
  273. package/.next/types/app/api/models-config/discover/route.ts +1 -1
  274. package/.next/types/app/api/models-config/route.ts +1 -1
  275. package/.next/types/app/api/models-config/test/route.ts +1 -1
  276. package/.next/types/app/api/plugins/route.ts +1 -1
  277. package/.next/types/app/api/project-trust/route.ts +1 -1
  278. package/.next/types/app/api/projects/route.ts +1 -1
  279. package/.next/types/app/api/runs/[runId]/route.ts +1 -1
  280. package/.next/types/app/api/runs/route.ts +1 -1
  281. package/.next/types/app/api/sessions/[id]/auto-name/route.ts +1 -1
  282. package/.next/types/app/api/sessions/[id]/context/route.ts +1 -1
  283. package/.next/types/app/api/sessions/[id]/entries/[entryId]/thinking/route.ts +1 -1
  284. package/.next/types/app/api/sessions/[id]/export/route.ts +1 -1
  285. package/.next/types/app/api/sessions/[id]/route.ts +1 -1
  286. package/.next/types/app/api/sessions/[id]/state/route.ts +1 -1
  287. package/.next/types/app/api/sessions/route.ts +1 -1
  288. package/.next/types/app/api/settings/route.ts +1 -1
  289. package/.next/types/app/api/sidecars/[service]/[...path]/route.ts +1 -1
  290. package/.next/types/app/api/skills/check/route.ts +1 -1
  291. package/.next/types/app/api/skills/install/route.ts +1 -1
  292. package/.next/types/app/api/skills/route.ts +1 -1
  293. package/.next/types/app/api/skills/search/route.ts +1 -1
  294. package/.next/types/app/api/skills/update/route.ts +1 -1
  295. package/.next/types/app/api/theme/route.ts +1 -1
  296. package/.next/types/app/api/update-maintenance/route.ts +1 -1
  297. package/.next/types/app/api/updates/route.ts +1 -1
  298. package/.next/types/app/api/web-access/recovery/route.ts +1 -1
  299. package/.next/types/app/api/web-access/route.ts +1 -1
  300. package/.next/types/app/api/web6/consults/route.ts +1 -1
  301. package/.next/types/app/api/worktrees/route.ts +1 -1
  302. package/.next/types/app/layout.ts +1 -1
  303. package/.next/types/app/page.ts +1 -1
  304. package/.next/types/app/recover/page.ts +1 -1
  305. package/README.md +174 -174
  306. package/Tools/CUELO_Setup/files/native-runtime-patch.js +349 -349
  307. package/Tools/OMP_Global_Config/agent/AGENTS.md +3 -3
  308. package/Tools/OMP_Global_Config/agent/agents/maker.md +390 -390
  309. package/Tools/OMP_Global_Config/agent/extensions/command-guard/matcher.ts +3 -1
  310. package/Tools/OMP_Global_Config/agent/extensions/jev-runtime.ts +63 -28
  311. package/Tools/OMP_Global_Config/agent/extensions/todo-nudge.ts +56 -56
  312. package/Tools/OMP_Global_Config/agent/prompt-copies/AGENTS.en.md +4 -4
  313. package/Tools/OMP_Global_Config/patches/apply-core-patch.mjs +5005 -5005
  314. package/bin/prepare-runtime.js +81 -81
  315. package/install.mjs +393 -393
  316. package/package.json +1 -1
  317. package/public/audio/completion/voices.json +1195 -1195
  318. package/public/offline.html +145 -145
  319. package/.next/static/chunks/app/_not-found/page-d3f2ac234e6fd3b6.js +0 -1
  320. package/.next/static/chunks/app/recover/page-770a1de1ff4ded56.js +0 -1
  321. package/.next/static/chunks/next/dist/client/components/builtin/global-error-070571d2fa580e7d.js +0 -1
  322. package/.next/static/css/bc8f2da9192ea16d.css +0 -1
  323. /package/.next/static/{MvC-CM1U-UMEzpaGIsCuQ → RnMmpk_boPQwlwbelVcs-}/_buildManifest.js +0 -0
  324. /package/.next/static/{MvC-CM1U-UMEzpaGIsCuQ → RnMmpk_boPQwlwbelVcs-}/_ssgManifest.js +0 -0
@@ -1,349 +1,349 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- const DISPLAY_RE = /function (\w+)\((\w+)\)\{let (\w+)=\2\.default;if\(!\3\)return null;/;
7
- const DISPLAY_DONE = /function \w+\((\w+)\)\{let \w+=\1\.fallback\?\?\1\.default;if\(!\w+\)return null;/;
8
- const MEMORY_RE = /(const phase1Model = await resolveMemoryModel\(\{[^}]*?fallbackRole: ")default(")/;
9
- const MEMORY_DONE = /const phase1Model = await resolveMemoryModel\(\{[^}]*?fallbackRole: "smol"/;
10
- const EXPECTED = {
11
- name: 'cuelo',
12
- version: '0.5.0',
13
- distribution: 'cuelo',
14
- coreVersion: '18.3.2',
15
- };
16
-
17
- // OMP core 18.3.2 `src/sdk.ts`: session-scoped AsyncJobManager for a process
18
- // that hosts several top-level sessions (CUELO opens one per browser session).
19
- // Upstream lets only the first top-level session construct a manager; every
20
- // later one got `asyncJobManager: undefined`, so its `task` calls logged
21
- // "no AsyncJobManager registered; falling back to sync execution" and blocked
22
- // the prompt until the subagent finished. Sharing the first manager is not a
23
- // fix: it is disposed with its owning session (CUELO idle-shuts sessions
24
- // after 10 minutes) and would cancel every other session's jobs, and a
25
- // disposed manager throws on the next register(). Each edit is an exact text
26
- // anchor of the pristine 18.3.2 source (also present after core patch #191) and fails closed when it drifts.
27
- // `insertBefore` edits keep their anchor (the helper is inserted in front of
28
- // it), so their anchor count stays 1 after patching.
29
- const SDK_FILE = path.join('node_modules', '@oh-my-pi', 'pi-coding-agent', 'src', 'sdk.ts');
30
- const SDK_HELPER = [
31
- '/**',
32
- ' * CUELO: session-scoped async job managers for a host that keeps several',
33
- ' * top-level sessions in one process (CUELO opens one per browser session).',
34
- ' *',
35
- ' * Upstream lets only the first top-level session construct a manager and',
36
- ' * leaves every later top-level session without one, so their `task` calls fell',
37
- ' * back to blocking execution ("no AsyncJobManager registered"). Sharing the',
38
- ' * first manager is not an option either: it is disposed with its owning session',
39
- ' * and would cancel every other session\'s jobs. Instead every top-level session',
40
- ' * owns a manager that its own dispose tears down; the first one is adopted as',
41
- ' * the process singleton atomically here and never re-installed by a later',
42
- ' * session, so the fallback below stays stable. Subagents inherit the manager of',
43
- ' * the parent that spawned them, resolved through the agent registry by',
44
- ' * `parentAgentId`, so a child\'s jobs live and die with its own root session;',
45
- ' * orphaned or revived children without a live parent keep the singleton',
46
- ' * fallback.',
47
- ' */',
48
- 'export function resolveSessionAsyncJobManager(',
49
- '\toptions: Pick<CreateAgentSessionOptions, "parentTaskPrefix" | "parentAgentId">,',
50
- '\tagentRegistry: AgentRegistry,',
51
- '\tmaxRunningJobs: number | (() => number),',
52
- '): { owned: AsyncJobManager | undefined; scoped: AsyncJobManager | undefined } {',
53
- '\tif (options.parentTaskPrefix) {',
54
- '\t\tconst parentManager = options.parentAgentId',
55
- '\t\t\t? agentRegistry.get(options.parentAgentId)?.session?.asyncJobManager',
56
- '\t\t\t: undefined;',
57
- '\t\treturn { owned: undefined, scoped: parentManager ?? AsyncJobManager.instance() };',
58
- '\t}',
59
- '\tconst owned = new AsyncJobManager({ maxRunningJobs });',
60
- '\tif (!AsyncJobManager.instance()) AsyncJobManager.setInstance(owned);',
61
- '\treturn { owned, scoped: owned };',
62
- '}',
63
- '',
64
- ].join('\n');
65
- const SDK_EDITS = [
66
- {
67
- key: 'sessionAsyncHelper',
68
- label: 'sdk.ts resolveSessionAsyncJobManager helper',
69
- insertBefore: true,
70
- anchor: '/**\n * Create an AgentSession with the specified options.\n',
71
- marker: 'export function resolveSessionAsyncJobManager(',
72
- patched: SDK_HELPER + '/**\n * Create an AgentSession with the specified options.\n',
73
- },
74
- {
75
- key: 'sessionAsyncOwnership',
76
- label: 'sdk.ts per-session AsyncJobManager ownership',
77
- anchor: [
78
- '\t// Only the first top-level session in a process owns an AsyncJobManager.',
79
- '\t// Subagents inherit the parent\'s manager via `AsyncJobManager.instance()`',
80
- '\t// (set below), and any additional top-level session spun up in-process',
81
- '\t// (e.g. the agent-creation architect in `agents-hub-deps.ts`) must share',
82
- '\t// the live singleton \u2014 otherwise its dispose path would clobber the',
83
- '\t// owning session\'s manager and break the `task`/`bash` async paths',
84
- '\t// (issue #1923). The `instance()` guard means later sessions also skip',
85
- '\t// constructing an orphaned manager that nothing would ever route to.',
86
- '\t// Delivery is owner-routed: every AgentSession registers its own sink',
87
- '\t// (see session/async-job-delivery.ts), so the manager takes no default',
88
- '\t// onJobComplete here.',
89
- '\tconst asyncJobManager =',
90
- '\t\t!options.parentTaskPrefix && !AsyncJobManager.instance()',
91
- '\t\t\t? new AsyncJobManager({',
92
- '\t\t\t\t\t// Re-read per capacity check so `async.maxJobs` resizes the cap live.',
93
- '\t\t\t\t\tmaxRunningJobs: () => Math.min(100, cfgAsyncMaxJobs.get(settings)),',
94
- '\t\t\t\t})',
95
- '\t\t\t: undefined;',
96
- '',
97
- '\tconst scopedAsyncJobManager = asyncJobManager ?? (options.parentTaskPrefix ? AsyncJobManager.instance() : undefined);',
98
- '',
99
- '\tconst agentRegistry = options.agentRegistry ?? AgentRegistry.global();',
100
- '',
101
- ].join('\n'),
102
- marker: '} = resolveSessionAsyncJobManager(',
103
- patched: [
104
- '\t// Delivery is owner-routed: every AgentSession registers its own sink',
105
- '\t// (see session/async-job-delivery.ts), so the manager takes no default',
106
- '\t// onJobComplete here. Ownership and inheritance: resolveSessionAsyncJobManager.',
107
- '\tconst agentRegistry = options.agentRegistry ?? AgentRegistry.global();',
108
- '\tconst { owned: asyncJobManager, scoped: scopedAsyncJobManager } = resolveSessionAsyncJobManager(',
109
- '\t\toptions,',
110
- '\t\tagentRegistry,',
111
- '\t\t// Re-read per capacity check so `async.maxJobs` resizes the cap live.',
112
- '\t\t() => Math.min(100, cfgAsyncMaxJobs.get(settings)),',
113
- '\t);',
114
- '',
115
- ].join('\n'),
116
- },
117
- {
118
- key: 'sessionAsyncToolSession',
119
- label: 'sdk.ts ToolSession asyncJobManager comment',
120
- anchor: [
121
- '\t\t\t// Subagents inherit the singleton (the parent\'s manager) so their bash/task',
122
- '\t\t\t// completions still flow into the spawning conversation\'s yieldQueue.',
123
- '\t\t\t// Secondary in-process top-level sessions (no parentTaskPrefix, no',
124
- '\t\t\t// constructed manager because the singleton was already installed) leave',
125
- '\t\t\t// this undefined so tools and session job snapshots refuse async work',
126
- '\t\t\t// instead of silently routing into the owning session (issue #1923).',
127
- '\t\t\tasyncJobManager: scopedAsyncJobManager,',
128
- '',
129
- ].join('\n'),
130
- marker: '// Session-scoped: a top-level session\'s own manager',
131
- patched: [
132
- '\t\t\t// Session-scoped: a top-level session\'s own manager, or for subagents the',
133
- '\t\t\t// manager of the root session that spawned them (see',
134
- '\t\t\t// resolveSessionAsyncJobManager), so bash/task completions flow into their',
135
- '\t\t\t// own conversation and never into another session\'s.',
136
- '\t\t\tasyncJobManager: scopedAsyncJobManager,',
137
- '',
138
- ].join('\n'),
139
- },
140
- {
141
- key: 'sessionAsyncSingleton',
142
- label: 'sdk.ts first-top-level-only singleton adoption',
143
- anchor: '\t\t\tif (asyncJobManager) AsyncJobManager.setInstance(asyncJobManager);\n',
144
- marker: '// Process singleton adoption happened in resolveSessionAsyncJobManager',
145
- patched: '\t\t\t// Process singleton adoption happened in resolveSessionAsyncJobManager (first top-level only).\n',
146
- },
147
- ];
148
-
149
- function parseArgs(argv) {
150
- let target = null;
151
- let output = null;
152
- let check = false;
153
- for (let i = 0; i < argv.length; i++) {
154
- const arg = argv[i];
155
- if (arg === '--check') check = true;
156
- else if (arg === '--target' && i + 1 < argv.length) target = argv[++i];
157
- else if (arg.startsWith('--target=')) target = arg.slice('--target='.length);
158
- else if (arg === '--output' && i + 1 < argv.length) output = argv[++i];
159
- else if (arg.startsWith('--output=')) output = arg.slice('--output='.length);
160
- else throw new Error('unknown or incomplete argument: ' + arg);
161
- }
162
- if (!target) throw new Error('--target requires a native CUELO package directory');
163
- return { target: path.resolve(target), output: output && path.resolve(output), check };
164
- }
165
-
166
- function count(text, re) {
167
- const flags = re.flags.includes('g') ? re.flags : re.flags + 'g';
168
- return (text.match(new RegExp(re.source, flags)) || []).length;
169
- }
170
-
171
- function readNativePackage(target) {
172
- const packageFile = path.join(target, 'package.json');
173
- if (!fs.existsSync(packageFile)) throw new Error('native CUELO package not found: ' + target);
174
- const packageJson = JSON.parse(fs.readFileSync(packageFile, 'utf8').replace(/^\uFEFF/, ''));
175
- const build = packageJson.cueloBuild;
176
- if (packageJson.name !== EXPECTED.name || packageJson.version !== EXPECTED.version) {
177
- throw new Error(`unexpected native package ${packageJson.name}@${packageJson.version}`);
178
- }
179
- if (!build || build.distribution !== EXPECTED.distribution || build.coreVersion !== EXPECTED.coreVersion) {
180
- throw new Error('native cueloBuild metadata does not match cuelo / core 18.3.2');
181
- }
182
- return packageJson;
183
- }
184
-
185
- function inspect(target, expectPatched) {
186
- const errors = [];
187
- const writes = [];
188
- const chunkDirectory = path.join(target, '.next', 'server', 'chunks');
189
- const displayHits = [];
190
- if (!fs.existsSync(chunkDirectory)) {
191
- errors.push('MISSING native server chunks: ' + chunkDirectory);
192
- } else {
193
- for (const name of fs.readdirSync(chunkDirectory).sort()) {
194
- if (!name.endsWith('.js')) continue;
195
- const file = path.join(chunkDirectory, name);
196
- const text = fs.readFileSync(file, 'utf8');
197
- const patched = count(text, DISPLAY_DONE);
198
- const raw = count(text, DISPLAY_RE);
199
- if (patched || raw) displayHits.push({ file, name, text, patched, raw });
200
- }
201
- }
202
- const displayPatched = displayHits.reduce((total, hit) => total + hit.patched, 0);
203
- const displayRaw = displayHits.reduce((total, hit) => total + hit.raw, 0);
204
- if (expectPatched) {
205
- if (displayPatched !== 1 || displayRaw !== 0) {
206
- errors.push(`FALLBACK DISPLAY patched/raw count ${displayPatched}/${displayRaw}, expected 1/0`);
207
- }
208
- } else if (displayPatched + displayRaw !== 1) {
209
- errors.push(`FALLBACK DISPLAY anchor count ${displayPatched + displayRaw}, expected exactly 1`);
210
- } else if (displayRaw === 1) {
211
- const hit = displayHits.find(candidate => candidate.raw === 1);
212
- writes.push({
213
- file: hit.file,
214
- text: hit.text.replace(DISPLAY_RE, 'function $1($2){let $3=$2.fallback??$2.default;if(!$3)return null;'),
215
- label: 'fallback model display (' + hit.name + ')',
216
- });
217
- }
218
-
219
- const memoryFile = path.join(target, 'node_modules', '@oh-my-pi', 'pi-coding-agent', 'src', 'memories', 'index.ts');
220
- let memoryPatched = 0;
221
- let memoryRaw = 0;
222
- if (!fs.existsSync(memoryFile)) {
223
- errors.push('MISSING memory phase1 source: ' + memoryFile);
224
- } else {
225
- const text = fs.readFileSync(memoryFile, 'utf8');
226
- memoryPatched = count(text, MEMORY_DONE);
227
- memoryRaw = count(text, MEMORY_RE);
228
- if (expectPatched) {
229
- if (memoryPatched !== 1 || memoryRaw !== 0) {
230
- errors.push(`MEMORY PHASE1 patched/raw count ${memoryPatched}/${memoryRaw}, expected 1/0`);
231
- }
232
- } else if (memoryPatched + memoryRaw !== 1) {
233
- errors.push(`MEMORY PHASE1 anchor count ${memoryPatched + memoryRaw}, expected exactly 1`);
234
- } else if (memoryRaw === 1) {
235
- writes.push({
236
- file: memoryFile,
237
- text: text.replace(MEMORY_RE, '$1smol$2'),
238
- label: 'memory phase1 fallbackRole=smol',
239
- });
240
- }
241
- }
242
-
243
- const sdkChecks = inspectSdk(target, expectPatched, errors, writes);
244
-
245
- return {
246
- errors,
247
- writes,
248
- checks: {
249
- fallbackModelDisplay: { patched: displayPatched, raw: displayRaw, expectedPatched: 1, expectedRaw: 0 },
250
- memoryPhase1Smol: { patched: memoryPatched, raw: memoryRaw, expectedPatched: 1, expectedRaw: 0 },
251
- ...sdkChecks,
252
- },
253
- };
254
- }
255
-
256
- function occurrences(text, needle) {
257
- return text.split(needle).length - 1;
258
- }
259
-
260
- // All sdk.ts edits are applied to one text in sequence and written once. Each edit
261
- // must find its anchor exactly once (pristine) or its marker exactly once
262
- // (patched); any other count is a drift of the pinned core and fails closed.
263
- function inspectSdk(target, expectPatched, errors, writes) {
264
- const sdkFile = path.join(target, SDK_FILE);
265
- const checks = {};
266
- if (!fs.existsSync(sdkFile)) {
267
- errors.push('MISSING core sdk source: ' + sdkFile);
268
- for (const edit of SDK_EDITS) {
269
- checks[edit.key] = { patched: 0, raw: 0, expectedPatched: 1, expectedRaw: edit.insertBefore ? 1 : 0 };
270
- }
271
- return checks;
272
- }
273
- const original = fs.readFileSync(sdkFile, 'utf8');
274
- let text = original;
275
- for (const edit of SDK_EDITS) {
276
- const patched = occurrences(text, edit.marker);
277
- const raw = occurrences(text, edit.anchor);
278
- const expectedRaw = edit.insertBefore ? 1 : 0;
279
- checks[edit.key] = { patched, raw, expectedPatched: 1, expectedRaw };
280
- if (expectPatched) {
281
- if (patched !== 1 || raw !== expectedRaw) {
282
- errors.push(`SDK ${edit.key} patched/raw count ${patched}/${raw}, expected 1/${expectedRaw}`);
283
- }
284
- continue;
285
- }
286
- if (patched === 1 && raw === expectedRaw) continue;
287
- if (patched !== 0 || raw !== 1) {
288
- errors.push(`SDK ${edit.key} anchor/marker count ${raw}/${patched}, expected exactly 1/0`);
289
- continue;
290
- }
291
- text = text.replace(edit.anchor, () => edit.patched);
292
- }
293
- if (!expectPatched && text !== original) {
294
- writes.push({ file: sdkFile, text, label: 'sdk.ts session-scoped AsyncJobManager' });
295
- }
296
- return checks;
297
- }
298
-
299
- function reportErrors(errors) {
300
- for (const error of errors) console.error(error);
301
- }
302
-
303
- function evidence(target, checks, ok) {
304
- return {
305
- schemaVersion: 1,
306
- checkedAt: new Date().toISOString(),
307
- target,
308
- mode: 'native-runtime',
309
- checks,
310
- ok,
311
- };
312
- }
313
-
314
- function writeEvidence(file, value) {
315
- if (file) fs.writeFileSync(file, JSON.stringify(value, null, 2) + '\n');
316
- }
317
-
318
- function run(argv) {
319
- const options = parseArgs(argv);
320
- readNativePackage(options.target);
321
- if (options.check) {
322
- const result = inspect(options.target, true);
323
- writeEvidence(options.output, evidence(options.target, result.checks, result.errors.length === 0));
324
- reportErrors(result.errors);
325
- if (result.errors.length) throw new Error('native runtime compatibility check failed');
326
- console.log('CHECK OK: native fallback display, memory phase1 smol and sdk session async scope counts are exact at ' + options.target);
327
- return;
328
- }
329
-
330
- const plan = inspect(options.target, false);
331
- reportErrors(plan.errors);
332
- if (plan.errors.length) throw new Error('native runtime compatibility anchors are not exact');
333
- for (const write of plan.writes) {
334
- fs.writeFileSync(write.file, write.text);
335
- console.log('patched: ' + write.label);
336
- }
337
- const checked = inspect(options.target, true);
338
- writeEvidence(options.output, evidence(options.target, checked.checks, checked.errors.length === 0));
339
- reportErrors(checked.errors);
340
- if (checked.errors.length) throw new Error('native runtime compatibility verification failed after apply');
341
- console.log('done: native runtime compatibility transformations verified at ' + options.target);
342
- }
343
-
344
- try {
345
- run(process.argv.slice(2));
346
- } catch (error) {
347
- console.error(error && error.message ? error.message : String(error));
348
- process.exitCode = 1;
349
- }
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const DISPLAY_RE = /function (\w+)\((\w+)\)\{let (\w+)=\2\.default;if\(!\3\)return null;/;
7
+ const DISPLAY_DONE = /function \w+\((\w+)\)\{let \w+=\1\.fallback\?\?\1\.default;if\(!\w+\)return null;/;
8
+ const MEMORY_RE = /(const phase1Model = await resolveMemoryModel\(\{[^}]*?fallbackRole: ")default(")/;
9
+ const MEMORY_DONE = /const phase1Model = await resolveMemoryModel\(\{[^}]*?fallbackRole: "smol"/;
10
+ const EXPECTED = {
11
+ name: 'cuelo',
12
+ version: '0.5.1',
13
+ distribution: 'cuelo',
14
+ coreVersion: '18.3.2',
15
+ };
16
+
17
+ // OMP core 18.3.2 `src/sdk.ts`: session-scoped AsyncJobManager for a process
18
+ // that hosts several top-level sessions (CUELO opens one per browser session).
19
+ // Upstream lets only the first top-level session construct a manager; every
20
+ // later one got `asyncJobManager: undefined`, so its `task` calls logged
21
+ // "no AsyncJobManager registered; falling back to sync execution" and blocked
22
+ // the prompt until the subagent finished. Sharing the first manager is not a
23
+ // fix: it is disposed with its owning session (CUELO idle-shuts sessions
24
+ // after 10 minutes) and would cancel every other session's jobs, and a
25
+ // disposed manager throws on the next register(). Each edit is an exact text
26
+ // anchor of the pristine 18.3.2 source (also present after core patch #191) and fails closed when it drifts.
27
+ // `insertBefore` edits keep their anchor (the helper is inserted in front of
28
+ // it), so their anchor count stays 1 after patching.
29
+ const SDK_FILE = path.join('node_modules', '@oh-my-pi', 'pi-coding-agent', 'src', 'sdk.ts');
30
+ const SDK_HELPER = [
31
+ '/**',
32
+ ' * CUELO: session-scoped async job managers for a host that keeps several',
33
+ ' * top-level sessions in one process (CUELO opens one per browser session).',
34
+ ' *',
35
+ ' * Upstream lets only the first top-level session construct a manager and',
36
+ ' * leaves every later top-level session without one, so their `task` calls fell',
37
+ ' * back to blocking execution ("no AsyncJobManager registered"). Sharing the',
38
+ ' * first manager is not an option either: it is disposed with its owning session',
39
+ ' * and would cancel every other session\'s jobs. Instead every top-level session',
40
+ ' * owns a manager that its own dispose tears down; the first one is adopted as',
41
+ ' * the process singleton atomically here and never re-installed by a later',
42
+ ' * session, so the fallback below stays stable. Subagents inherit the manager of',
43
+ ' * the parent that spawned them, resolved through the agent registry by',
44
+ ' * `parentAgentId`, so a child\'s jobs live and die with its own root session;',
45
+ ' * orphaned or revived children without a live parent keep the singleton',
46
+ ' * fallback.',
47
+ ' */',
48
+ 'export function resolveSessionAsyncJobManager(',
49
+ '\toptions: Pick<CreateAgentSessionOptions, "parentTaskPrefix" | "parentAgentId">,',
50
+ '\tagentRegistry: AgentRegistry,',
51
+ '\tmaxRunningJobs: number | (() => number),',
52
+ '): { owned: AsyncJobManager | undefined; scoped: AsyncJobManager | undefined } {',
53
+ '\tif (options.parentTaskPrefix) {',
54
+ '\t\tconst parentManager = options.parentAgentId',
55
+ '\t\t\t? agentRegistry.get(options.parentAgentId)?.session?.asyncJobManager',
56
+ '\t\t\t: undefined;',
57
+ '\t\treturn { owned: undefined, scoped: parentManager ?? AsyncJobManager.instance() };',
58
+ '\t}',
59
+ '\tconst owned = new AsyncJobManager({ maxRunningJobs });',
60
+ '\tif (!AsyncJobManager.instance()) AsyncJobManager.setInstance(owned);',
61
+ '\treturn { owned, scoped: owned };',
62
+ '}',
63
+ '',
64
+ ].join('\n');
65
+ const SDK_EDITS = [
66
+ {
67
+ key: 'sessionAsyncHelper',
68
+ label: 'sdk.ts resolveSessionAsyncJobManager helper',
69
+ insertBefore: true,
70
+ anchor: '/**\n * Create an AgentSession with the specified options.\n',
71
+ marker: 'export function resolveSessionAsyncJobManager(',
72
+ patched: SDK_HELPER + '/**\n * Create an AgentSession with the specified options.\n',
73
+ },
74
+ {
75
+ key: 'sessionAsyncOwnership',
76
+ label: 'sdk.ts per-session AsyncJobManager ownership',
77
+ anchor: [
78
+ '\t// Only the first top-level session in a process owns an AsyncJobManager.',
79
+ '\t// Subagents inherit the parent\'s manager via `AsyncJobManager.instance()`',
80
+ '\t// (set below), and any additional top-level session spun up in-process',
81
+ '\t// (e.g. the agent-creation architect in `agents-hub-deps.ts`) must share',
82
+ '\t// the live singleton \u2014 otherwise its dispose path would clobber the',
83
+ '\t// owning session\'s manager and break the `task`/`bash` async paths',
84
+ '\t// (issue #1923). The `instance()` guard means later sessions also skip',
85
+ '\t// constructing an orphaned manager that nothing would ever route to.',
86
+ '\t// Delivery is owner-routed: every AgentSession registers its own sink',
87
+ '\t// (see session/async-job-delivery.ts), so the manager takes no default',
88
+ '\t// onJobComplete here.',
89
+ '\tconst asyncJobManager =',
90
+ '\t\t!options.parentTaskPrefix && !AsyncJobManager.instance()',
91
+ '\t\t\t? new AsyncJobManager({',
92
+ '\t\t\t\t\t// Re-read per capacity check so `async.maxJobs` resizes the cap live.',
93
+ '\t\t\t\t\tmaxRunningJobs: () => Math.min(100, cfgAsyncMaxJobs.get(settings)),',
94
+ '\t\t\t\t})',
95
+ '\t\t\t: undefined;',
96
+ '',
97
+ '\tconst scopedAsyncJobManager = asyncJobManager ?? (options.parentTaskPrefix ? AsyncJobManager.instance() : undefined);',
98
+ '',
99
+ '\tconst agentRegistry = options.agentRegistry ?? AgentRegistry.global();',
100
+ '',
101
+ ].join('\n'),
102
+ marker: '} = resolveSessionAsyncJobManager(',
103
+ patched: [
104
+ '\t// Delivery is owner-routed: every AgentSession registers its own sink',
105
+ '\t// (see session/async-job-delivery.ts), so the manager takes no default',
106
+ '\t// onJobComplete here. Ownership and inheritance: resolveSessionAsyncJobManager.',
107
+ '\tconst agentRegistry = options.agentRegistry ?? AgentRegistry.global();',
108
+ '\tconst { owned: asyncJobManager, scoped: scopedAsyncJobManager } = resolveSessionAsyncJobManager(',
109
+ '\t\toptions,',
110
+ '\t\tagentRegistry,',
111
+ '\t\t// Re-read per capacity check so `async.maxJobs` resizes the cap live.',
112
+ '\t\t() => Math.min(100, cfgAsyncMaxJobs.get(settings)),',
113
+ '\t);',
114
+ '',
115
+ ].join('\n'),
116
+ },
117
+ {
118
+ key: 'sessionAsyncToolSession',
119
+ label: 'sdk.ts ToolSession asyncJobManager comment',
120
+ anchor: [
121
+ '\t\t\t// Subagents inherit the singleton (the parent\'s manager) so their bash/task',
122
+ '\t\t\t// completions still flow into the spawning conversation\'s yieldQueue.',
123
+ '\t\t\t// Secondary in-process top-level sessions (no parentTaskPrefix, no',
124
+ '\t\t\t// constructed manager because the singleton was already installed) leave',
125
+ '\t\t\t// this undefined so tools and session job snapshots refuse async work',
126
+ '\t\t\t// instead of silently routing into the owning session (issue #1923).',
127
+ '\t\t\tasyncJobManager: scopedAsyncJobManager,',
128
+ '',
129
+ ].join('\n'),
130
+ marker: '// Session-scoped: a top-level session\'s own manager',
131
+ patched: [
132
+ '\t\t\t// Session-scoped: a top-level session\'s own manager, or for subagents the',
133
+ '\t\t\t// manager of the root session that spawned them (see',
134
+ '\t\t\t// resolveSessionAsyncJobManager), so bash/task completions flow into their',
135
+ '\t\t\t// own conversation and never into another session\'s.',
136
+ '\t\t\tasyncJobManager: scopedAsyncJobManager,',
137
+ '',
138
+ ].join('\n'),
139
+ },
140
+ {
141
+ key: 'sessionAsyncSingleton',
142
+ label: 'sdk.ts first-top-level-only singleton adoption',
143
+ anchor: '\t\t\tif (asyncJobManager) AsyncJobManager.setInstance(asyncJobManager);\n',
144
+ marker: '// Process singleton adoption happened in resolveSessionAsyncJobManager',
145
+ patched: '\t\t\t// Process singleton adoption happened in resolveSessionAsyncJobManager (first top-level only).\n',
146
+ },
147
+ ];
148
+
149
+ function parseArgs(argv) {
150
+ let target = null;
151
+ let output = null;
152
+ let check = false;
153
+ for (let i = 0; i < argv.length; i++) {
154
+ const arg = argv[i];
155
+ if (arg === '--check') check = true;
156
+ else if (arg === '--target' && i + 1 < argv.length) target = argv[++i];
157
+ else if (arg.startsWith('--target=')) target = arg.slice('--target='.length);
158
+ else if (arg === '--output' && i + 1 < argv.length) output = argv[++i];
159
+ else if (arg.startsWith('--output=')) output = arg.slice('--output='.length);
160
+ else throw new Error('unknown or incomplete argument: ' + arg);
161
+ }
162
+ if (!target) throw new Error('--target requires a native CUELO package directory');
163
+ return { target: path.resolve(target), output: output && path.resolve(output), check };
164
+ }
165
+
166
+ function count(text, re) {
167
+ const flags = re.flags.includes('g') ? re.flags : re.flags + 'g';
168
+ return (text.match(new RegExp(re.source, flags)) || []).length;
169
+ }
170
+
171
+ function readNativePackage(target) {
172
+ const packageFile = path.join(target, 'package.json');
173
+ if (!fs.existsSync(packageFile)) throw new Error('native CUELO package not found: ' + target);
174
+ const packageJson = JSON.parse(fs.readFileSync(packageFile, 'utf8').replace(/^\uFEFF/, ''));
175
+ const build = packageJson.cueloBuild;
176
+ if (packageJson.name !== EXPECTED.name || packageJson.version !== EXPECTED.version) {
177
+ throw new Error(`unexpected native package ${packageJson.name}@${packageJson.version}`);
178
+ }
179
+ if (!build || build.distribution !== EXPECTED.distribution || build.coreVersion !== EXPECTED.coreVersion) {
180
+ throw new Error('native cueloBuild metadata does not match cuelo / core 18.3.2');
181
+ }
182
+ return packageJson;
183
+ }
184
+
185
+ function inspect(target, expectPatched) {
186
+ const errors = [];
187
+ const writes = [];
188
+ const chunkDirectory = path.join(target, '.next', 'server', 'chunks');
189
+ const displayHits = [];
190
+ if (!fs.existsSync(chunkDirectory)) {
191
+ errors.push('MISSING native server chunks: ' + chunkDirectory);
192
+ } else {
193
+ for (const name of fs.readdirSync(chunkDirectory).sort()) {
194
+ if (!name.endsWith('.js')) continue;
195
+ const file = path.join(chunkDirectory, name);
196
+ const text = fs.readFileSync(file, 'utf8');
197
+ const patched = count(text, DISPLAY_DONE);
198
+ const raw = count(text, DISPLAY_RE);
199
+ if (patched || raw) displayHits.push({ file, name, text, patched, raw });
200
+ }
201
+ }
202
+ const displayPatched = displayHits.reduce((total, hit) => total + hit.patched, 0);
203
+ const displayRaw = displayHits.reduce((total, hit) => total + hit.raw, 0);
204
+ if (expectPatched) {
205
+ if (displayPatched !== 1 || displayRaw !== 0) {
206
+ errors.push(`FALLBACK DISPLAY patched/raw count ${displayPatched}/${displayRaw}, expected 1/0`);
207
+ }
208
+ } else if (displayPatched + displayRaw !== 1) {
209
+ errors.push(`FALLBACK DISPLAY anchor count ${displayPatched + displayRaw}, expected exactly 1`);
210
+ } else if (displayRaw === 1) {
211
+ const hit = displayHits.find(candidate => candidate.raw === 1);
212
+ writes.push({
213
+ file: hit.file,
214
+ text: hit.text.replace(DISPLAY_RE, 'function $1($2){let $3=$2.fallback??$2.default;if(!$3)return null;'),
215
+ label: 'fallback model display (' + hit.name + ')',
216
+ });
217
+ }
218
+
219
+ const memoryFile = path.join(target, 'node_modules', '@oh-my-pi', 'pi-coding-agent', 'src', 'memories', 'index.ts');
220
+ let memoryPatched = 0;
221
+ let memoryRaw = 0;
222
+ if (!fs.existsSync(memoryFile)) {
223
+ errors.push('MISSING memory phase1 source: ' + memoryFile);
224
+ } else {
225
+ const text = fs.readFileSync(memoryFile, 'utf8');
226
+ memoryPatched = count(text, MEMORY_DONE);
227
+ memoryRaw = count(text, MEMORY_RE);
228
+ if (expectPatched) {
229
+ if (memoryPatched !== 1 || memoryRaw !== 0) {
230
+ errors.push(`MEMORY PHASE1 patched/raw count ${memoryPatched}/${memoryRaw}, expected 1/0`);
231
+ }
232
+ } else if (memoryPatched + memoryRaw !== 1) {
233
+ errors.push(`MEMORY PHASE1 anchor count ${memoryPatched + memoryRaw}, expected exactly 1`);
234
+ } else if (memoryRaw === 1) {
235
+ writes.push({
236
+ file: memoryFile,
237
+ text: text.replace(MEMORY_RE, '$1smol$2'),
238
+ label: 'memory phase1 fallbackRole=smol',
239
+ });
240
+ }
241
+ }
242
+
243
+ const sdkChecks = inspectSdk(target, expectPatched, errors, writes);
244
+
245
+ return {
246
+ errors,
247
+ writes,
248
+ checks: {
249
+ fallbackModelDisplay: { patched: displayPatched, raw: displayRaw, expectedPatched: 1, expectedRaw: 0 },
250
+ memoryPhase1Smol: { patched: memoryPatched, raw: memoryRaw, expectedPatched: 1, expectedRaw: 0 },
251
+ ...sdkChecks,
252
+ },
253
+ };
254
+ }
255
+
256
+ function occurrences(text, needle) {
257
+ return text.split(needle).length - 1;
258
+ }
259
+
260
+ // All sdk.ts edits are applied to one text in sequence and written once. Each edit
261
+ // must find its anchor exactly once (pristine) or its marker exactly once
262
+ // (patched); any other count is a drift of the pinned core and fails closed.
263
+ function inspectSdk(target, expectPatched, errors, writes) {
264
+ const sdkFile = path.join(target, SDK_FILE);
265
+ const checks = {};
266
+ if (!fs.existsSync(sdkFile)) {
267
+ errors.push('MISSING core sdk source: ' + sdkFile);
268
+ for (const edit of SDK_EDITS) {
269
+ checks[edit.key] = { patched: 0, raw: 0, expectedPatched: 1, expectedRaw: edit.insertBefore ? 1 : 0 };
270
+ }
271
+ return checks;
272
+ }
273
+ const original = fs.readFileSync(sdkFile, 'utf8');
274
+ let text = original;
275
+ for (const edit of SDK_EDITS) {
276
+ const patched = occurrences(text, edit.marker);
277
+ const raw = occurrences(text, edit.anchor);
278
+ const expectedRaw = edit.insertBefore ? 1 : 0;
279
+ checks[edit.key] = { patched, raw, expectedPatched: 1, expectedRaw };
280
+ if (expectPatched) {
281
+ if (patched !== 1 || raw !== expectedRaw) {
282
+ errors.push(`SDK ${edit.key} patched/raw count ${patched}/${raw}, expected 1/${expectedRaw}`);
283
+ }
284
+ continue;
285
+ }
286
+ if (patched === 1 && raw === expectedRaw) continue;
287
+ if (patched !== 0 || raw !== 1) {
288
+ errors.push(`SDK ${edit.key} anchor/marker count ${raw}/${patched}, expected exactly 1/0`);
289
+ continue;
290
+ }
291
+ text = text.replace(edit.anchor, () => edit.patched);
292
+ }
293
+ if (!expectPatched && text !== original) {
294
+ writes.push({ file: sdkFile, text, label: 'sdk.ts session-scoped AsyncJobManager' });
295
+ }
296
+ return checks;
297
+ }
298
+
299
+ function reportErrors(errors) {
300
+ for (const error of errors) console.error(error);
301
+ }
302
+
303
+ function evidence(target, checks, ok) {
304
+ return {
305
+ schemaVersion: 1,
306
+ checkedAt: new Date().toISOString(),
307
+ target,
308
+ mode: 'native-runtime',
309
+ checks,
310
+ ok,
311
+ };
312
+ }
313
+
314
+ function writeEvidence(file, value) {
315
+ if (file) fs.writeFileSync(file, JSON.stringify(value, null, 2) + '\n');
316
+ }
317
+
318
+ function run(argv) {
319
+ const options = parseArgs(argv);
320
+ readNativePackage(options.target);
321
+ if (options.check) {
322
+ const result = inspect(options.target, true);
323
+ writeEvidence(options.output, evidence(options.target, result.checks, result.errors.length === 0));
324
+ reportErrors(result.errors);
325
+ if (result.errors.length) throw new Error('native runtime compatibility check failed');
326
+ console.log('CHECK OK: native fallback display, memory phase1 smol and sdk session async scope counts are exact at ' + options.target);
327
+ return;
328
+ }
329
+
330
+ const plan = inspect(options.target, false);
331
+ reportErrors(plan.errors);
332
+ if (plan.errors.length) throw new Error('native runtime compatibility anchors are not exact');
333
+ for (const write of plan.writes) {
334
+ fs.writeFileSync(write.file, write.text);
335
+ console.log('patched: ' + write.label);
336
+ }
337
+ const checked = inspect(options.target, true);
338
+ writeEvidence(options.output, evidence(options.target, checked.checks, checked.errors.length === 0));
339
+ reportErrors(checked.errors);
340
+ if (checked.errors.length) throw new Error('native runtime compatibility verification failed after apply');
341
+ console.log('done: native runtime compatibility transformations verified at ' + options.target);
342
+ }
343
+
344
+ try {
345
+ run(process.argv.slice(2));
346
+ } catch (error) {
347
+ console.error(error && error.message ? error.message : String(error));
348
+ process.exitCode = 1;
349
+ }