@0xmaxma/claude-gateway 2.0.9 → 2.0.11

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 (404) hide show
  1. package/README.md +16 -1
  2. package/config.template.json +6 -4
  3. package/dist/agent/runner.d.ts +126 -11
  4. package/dist/agent/runner.d.ts.map +1 -1
  5. package/dist/agent/runner.js +102 -10
  6. package/dist/agent/runner.js.map +1 -1
  7. package/dist/agent/skill-learning/reviewer.d.ts.map +1 -1
  8. package/dist/agent/skill-learning/reviewer.js +1 -2
  9. package/dist/agent/skill-learning/reviewer.js.map +1 -1
  10. package/dist/api/browser-bindings-router.d.ts +6 -0
  11. package/dist/api/browser-bindings-router.d.ts.map +1 -0
  12. package/dist/api/browser-bindings-router.js +150 -0
  13. package/dist/api/browser-bindings-router.js.map +1 -0
  14. package/dist/api/capabilities.d.ts +53 -0
  15. package/dist/api/capabilities.d.ts.map +1 -0
  16. package/dist/api/capabilities.js +66 -0
  17. package/dist/api/capabilities.js.map +1 -0
  18. package/dist/api/connectors-router.js +1 -1
  19. package/dist/api/connectors-router.js.map +1 -1
  20. package/dist/api/gateway-router.d.ts.map +1 -1
  21. package/dist/api/gateway-router.js +38 -14
  22. package/dist/api/gateway-router.js.map +1 -1
  23. package/dist/api/gateway-version.d.ts +9 -0
  24. package/dist/api/gateway-version.d.ts.map +1 -0
  25. package/dist/api/gateway-version.js +57 -0
  26. package/dist/api/gateway-version.js.map +1 -0
  27. package/dist/api/jev-router.d.ts +8 -0
  28. package/dist/api/jev-router.d.ts.map +1 -0
  29. package/dist/api/jev-router.js +128 -0
  30. package/dist/api/jev-router.js.map +1 -0
  31. package/dist/api/router.d.ts.map +1 -1
  32. package/dist/api/router.js +53 -6
  33. package/dist/api/router.js.map +1 -1
  34. package/dist/api/voice-router.d.ts.map +1 -1
  35. package/dist/api/voice-router.js +42 -3
  36. package/dist/api/voice-router.js.map +1 -1
  37. package/dist/automation/browser-command.d.ts +79 -0
  38. package/dist/automation/browser-command.d.ts.map +1 -0
  39. package/dist/automation/browser-command.js +118 -0
  40. package/dist/automation/browser-command.js.map +1 -0
  41. package/dist/automation/browser-outcome.d.ts +3 -0
  42. package/dist/automation/browser-outcome.d.ts.map +1 -0
  43. package/dist/automation/browser-outcome.js +78 -0
  44. package/dist/automation/browser-outcome.js.map +1 -0
  45. package/dist/automation/browser-steps.d.ts +33 -0
  46. package/dist/automation/browser-steps.d.ts.map +1 -0
  47. package/dist/automation/browser-steps.js +293 -0
  48. package/dist/automation/browser-steps.js.map +1 -0
  49. package/dist/automation/browser-trace.d.ts +60 -0
  50. package/dist/automation/browser-trace.d.ts.map +1 -0
  51. package/dist/automation/browser-trace.js +24 -0
  52. package/dist/automation/browser-trace.js.map +1 -0
  53. package/dist/automation/browser-use.d.ts +210 -0
  54. package/dist/automation/browser-use.d.ts.map +1 -0
  55. package/dist/automation/browser-use.js +1271 -0
  56. package/dist/automation/browser-use.js.map +1 -0
  57. package/dist/automation/command-speech.d.ts +33 -0
  58. package/dist/automation/command-speech.d.ts.map +1 -0
  59. package/dist/automation/command-speech.js +117 -0
  60. package/dist/automation/command-speech.js.map +1 -0
  61. package/dist/automation/command-steps.d.ts +35 -0
  62. package/dist/automation/command-steps.d.ts.map +1 -0
  63. package/dist/automation/command-steps.js +155 -0
  64. package/dist/automation/command-steps.js.map +1 -0
  65. package/dist/automation/computer-choice-ids.d.ts +7 -0
  66. package/dist/automation/computer-choice-ids.d.ts.map +1 -0
  67. package/dist/automation/computer-choice-ids.js +24 -0
  68. package/dist/automation/computer-choice-ids.js.map +1 -0
  69. package/dist/automation/computer-command.d.ts +126 -0
  70. package/dist/automation/computer-command.d.ts.map +1 -0
  71. package/dist/automation/computer-command.js +313 -0
  72. package/dist/automation/computer-command.js.map +1 -0
  73. package/dist/automation/computer-outcome.d.ts +8 -0
  74. package/dist/automation/computer-outcome.d.ts.map +1 -0
  75. package/dist/automation/computer-outcome.js +82 -0
  76. package/dist/automation/computer-outcome.js.map +1 -0
  77. package/dist/automation/computer-policy.d.ts +84 -0
  78. package/dist/automation/computer-policy.d.ts.map +1 -0
  79. package/dist/automation/computer-policy.js +56 -0
  80. package/dist/automation/computer-policy.js.map +1 -0
  81. package/dist/automation/computer-safety.d.ts +27 -0
  82. package/dist/automation/computer-safety.d.ts.map +1 -0
  83. package/dist/automation/computer-safety.js +47 -0
  84. package/dist/automation/computer-safety.js.map +1 -0
  85. package/dist/automation/computer-steps.d.ts +20 -0
  86. package/dist/automation/computer-steps.d.ts.map +1 -0
  87. package/dist/automation/computer-steps.js +251 -0
  88. package/dist/automation/computer-steps.js.map +1 -0
  89. package/dist/automation/computer-use.d.ts +315 -0
  90. package/dist/automation/computer-use.d.ts.map +1 -0
  91. package/dist/automation/computer-use.js +864 -0
  92. package/dist/automation/computer-use.js.map +1 -0
  93. package/dist/automation/direct-command.d.ts +51 -0
  94. package/dist/automation/direct-command.d.ts.map +1 -0
  95. package/dist/automation/direct-command.js +152 -0
  96. package/dist/automation/direct-command.js.map +1 -0
  97. package/dist/automation/interrupt.d.ts +4 -0
  98. package/dist/automation/interrupt.d.ts.map +1 -0
  99. package/dist/automation/interrupt.js +26 -0
  100. package/dist/automation/interrupt.js.map +1 -0
  101. package/dist/build-provenance.json +4 -4
  102. package/dist/child-env-exclusions.d.ts +4 -0
  103. package/dist/child-env-exclusions.d.ts.map +1 -0
  104. package/dist/child-env-exclusions.js +23 -0
  105. package/dist/child-env-exclusions.js.map +1 -0
  106. package/dist/cli/startup-diagnostics.d.ts.map +1 -1
  107. package/dist/cli/startup-diagnostics.js +19 -0
  108. package/dist/cli/startup-diagnostics.js.map +1 -1
  109. package/dist/config/loader.d.ts.map +1 -1
  110. package/dist/config/loader.js +4 -0
  111. package/dist/config/loader.js.map +1 -1
  112. package/dist/config/reload-policy.d.ts.map +1 -1
  113. package/dist/config/reload-policy.js +2 -1
  114. package/dist/config/reload-policy.js.map +1 -1
  115. package/dist/jev/automatic-browser-bindings.d.ts +15 -0
  116. package/dist/jev/automatic-browser-bindings.d.ts.map +1 -0
  117. package/dist/jev/automatic-browser-bindings.js +115 -0
  118. package/dist/jev/automatic-browser-bindings.js.map +1 -0
  119. package/dist/jev/browser-connector.d.ts +29 -0
  120. package/dist/jev/browser-connector.d.ts.map +1 -0
  121. package/dist/jev/browser-connector.js +347 -0
  122. package/dist/jev/browser-connector.js.map +1 -0
  123. package/dist/jev/browser-consent.d.ts +6 -0
  124. package/dist/jev/browser-consent.d.ts.map +1 -0
  125. package/dist/jev/browser-consent.js +50 -0
  126. package/dist/jev/browser-consent.js.map +1 -0
  127. package/dist/jev/browser-contract.d.ts +215 -0
  128. package/dist/jev/browser-contract.d.ts.map +1 -0
  129. package/dist/jev/browser-contract.js +10 -0
  130. package/dist/jev/browser-contract.js.map +1 -0
  131. package/dist/jev/browser-evidence-summary.d.ts +73 -0
  132. package/dist/jev/browser-evidence-summary.d.ts.map +1 -0
  133. package/dist/jev/browser-evidence-summary.js +22 -0
  134. package/dist/jev/browser-evidence-summary.js.map +1 -0
  135. package/dist/jev/browser-module-import.d.ts +3 -0
  136. package/dist/jev/browser-module-import.d.ts.map +1 -0
  137. package/dist/jev/browser-module-import.js +6 -0
  138. package/dist/jev/browser-module-import.js.map +1 -0
  139. package/dist/jev/child-env.d.ts +11 -0
  140. package/dist/jev/child-env.d.ts.map +1 -0
  141. package/dist/jev/child-env.js +60 -0
  142. package/dist/jev/child-env.js.map +1 -0
  143. package/dist/jev/computer-connector.d.ts +34 -0
  144. package/dist/jev/computer-connector.d.ts.map +1 -0
  145. package/dist/jev/computer-connector.js +82 -0
  146. package/dist/jev/computer-connector.js.map +1 -0
  147. package/dist/jev/computer-inputs.d.ts +41 -0
  148. package/dist/jev/computer-inputs.d.ts.map +1 -0
  149. package/dist/jev/computer-inputs.js +7 -0
  150. package/dist/jev/computer-inputs.js.map +1 -0
  151. package/dist/jev/index.d.ts +6 -0
  152. package/dist/jev/index.d.ts.map +1 -0
  153. package/dist/jev/index.js +25 -0
  154. package/dist/jev/index.js.map +1 -0
  155. package/dist/jev/relay-grants.d.ts +9 -0
  156. package/dist/jev/relay-grants.d.ts.map +1 -0
  157. package/dist/jev/relay-grants.js +49 -0
  158. package/dist/jev/relay-grants.js.map +1 -0
  159. package/dist/jev/service.d.ts +27 -0
  160. package/dist/jev/service.d.ts.map +1 -0
  161. package/dist/jev/service.js +264 -0
  162. package/dist/jev/service.js.map +1 -0
  163. package/dist/jev/thinking-provider.d.ts +7 -0
  164. package/dist/jev/thinking-provider.d.ts.map +1 -0
  165. package/dist/jev/thinking-provider.js +25 -0
  166. package/dist/jev/thinking-provider.js.map +1 -0
  167. package/dist/jev/types.d.ts +124 -0
  168. package/dist/jev/types.d.ts.map +1 -0
  169. package/dist/jev/types.js +13 -0
  170. package/dist/jev/types.js.map +1 -0
  171. package/dist/jev/validation.d.ts +45 -0
  172. package/dist/jev/validation.d.ts.map +1 -0
  173. package/dist/jev/validation.js +179 -0
  174. package/dist/jev/validation.js.map +1 -0
  175. package/dist/load-dotenv.d.ts.map +1 -1
  176. package/dist/load-dotenv.js +5 -1
  177. package/dist/load-dotenv.js.map +1 -1
  178. package/dist/orchestration/agent-tool-schemas.d.ts.map +1 -1
  179. package/dist/orchestration/agent-tool-schemas.js +12 -7
  180. package/dist/orchestration/agent-tool-schemas.js.map +1 -1
  181. package/dist/orchestration/background-work.d.ts +1 -0
  182. package/dist/orchestration/background-work.d.ts.map +1 -1
  183. package/dist/orchestration/background-work.js +1 -0
  184. package/dist/orchestration/background-work.js.map +1 -1
  185. package/dist/orchestration/bridge.d.ts +4 -0
  186. package/dist/orchestration/bridge.d.ts.map +1 -1
  187. package/dist/orchestration/bridge.js +227 -41
  188. package/dist/orchestration/bridge.js.map +1 -1
  189. package/dist/orchestration/browser-fields.d.ts +25 -0
  190. package/dist/orchestration/browser-fields.d.ts.map +1 -0
  191. package/dist/orchestration/browser-fields.js +23 -0
  192. package/dist/orchestration/browser-fields.js.map +1 -0
  193. package/dist/orchestration/browser-routing.d.ts +1 -1
  194. package/dist/orchestration/browser-routing.d.ts.map +1 -1
  195. package/dist/orchestration/browser-routing.js +7 -3
  196. package/dist/orchestration/browser-routing.js.map +1 -1
  197. package/dist/orchestration/capabilities.d.ts +5 -2
  198. package/dist/orchestration/capabilities.d.ts.map +1 -1
  199. package/dist/orchestration/capabilities.js +24 -24
  200. package/dist/orchestration/capabilities.js.map +1 -1
  201. package/dist/orchestration/channel-controls.js +1 -1
  202. package/dist/orchestration/channel-controls.js.map +1 -1
  203. package/dist/orchestration/cli-skills.d.ts +1 -1
  204. package/dist/orchestration/cli-skills.d.ts.map +1 -1
  205. package/dist/orchestration/cli-skills.js +16 -10
  206. package/dist/orchestration/cli-skills.js.map +1 -1
  207. package/dist/orchestration/computer-end-screenshot.d.ts +11 -0
  208. package/dist/orchestration/computer-end-screenshot.d.ts.map +1 -0
  209. package/dist/orchestration/computer-end-screenshot.js +37 -0
  210. package/dist/orchestration/computer-end-screenshot.js.map +1 -0
  211. package/dist/orchestration/computer-prompt.d.ts +6 -0
  212. package/dist/orchestration/computer-prompt.d.ts.map +1 -0
  213. package/dist/orchestration/computer-prompt.js +24 -0
  214. package/dist/orchestration/computer-prompt.js.map +1 -0
  215. package/dist/orchestration/config.d.ts +17 -0
  216. package/dist/orchestration/config.d.ts.map +1 -1
  217. package/dist/orchestration/config.js +10 -4
  218. package/dist/orchestration/config.js.map +1 -1
  219. package/dist/orchestration/container-tool-schemas.d.ts +47 -3
  220. package/dist/orchestration/container-tool-schemas.d.ts.map +1 -1
  221. package/dist/orchestration/container-tool-schemas.js +41 -6
  222. package/dist/orchestration/container-tool-schemas.js.map +1 -1
  223. package/dist/orchestration/container.d.ts +4 -1
  224. package/dist/orchestration/container.d.ts.map +1 -1
  225. package/dist/orchestration/container.js +48 -29
  226. package/dist/orchestration/container.js.map +1 -1
  227. package/dist/orchestration/context-footprint.d.ts +1 -1
  228. package/dist/orchestration/context-footprint.d.ts.map +1 -1
  229. package/dist/orchestration/context-footprint.js +5 -5
  230. package/dist/orchestration/context-footprint.js.map +1 -1
  231. package/dist/orchestration/control-notification.d.ts +6 -0
  232. package/dist/orchestration/control-notification.d.ts.map +1 -0
  233. package/dist/orchestration/control-notification.js +23 -0
  234. package/dist/orchestration/control-notification.js.map +1 -0
  235. package/dist/orchestration/dashboard-reader-worker.js +2 -2
  236. package/dist/orchestration/dashboard-reader-worker.js.map +1 -1
  237. package/dist/orchestration/execution-observation.d.ts +3 -0
  238. package/dist/orchestration/execution-observation.d.ts.map +1 -1
  239. package/dist/orchestration/execution-observation.js.map +1 -1
  240. package/dist/orchestration/gateway-tasks/browser.d.ts +59 -0
  241. package/dist/orchestration/gateway-tasks/browser.d.ts.map +1 -0
  242. package/dist/orchestration/gateway-tasks/browser.js +426 -0
  243. package/dist/orchestration/gateway-tasks/browser.js.map +1 -0
  244. package/dist/orchestration/gateway-tasks/computer-context.d.ts +6 -0
  245. package/dist/orchestration/gateway-tasks/computer-context.d.ts.map +1 -0
  246. package/dist/orchestration/gateway-tasks/computer-context.js +19 -0
  247. package/dist/orchestration/gateway-tasks/computer-context.js.map +1 -0
  248. package/dist/orchestration/gateway-tasks/computer.d.ts +123 -0
  249. package/dist/orchestration/gateway-tasks/computer.d.ts.map +1 -0
  250. package/dist/orchestration/gateway-tasks/computer.js +519 -0
  251. package/dist/orchestration/gateway-tasks/computer.js.map +1 -0
  252. package/dist/orchestration/gateway-tasks/controller.d.ts +40 -6
  253. package/dist/orchestration/gateway-tasks/controller.d.ts.map +1 -1
  254. package/dist/orchestration/gateway-tasks/controller.js +118 -12
  255. package/dist/orchestration/gateway-tasks/controller.js.map +1 -1
  256. package/dist/orchestration/gateway-tasks/safemode.d.ts.map +1 -1
  257. package/dist/orchestration/gateway-tasks/safemode.js +2 -1
  258. package/dist/orchestration/gateway-tasks/safemode.js.map +1 -1
  259. package/dist/orchestration/jev-gateway.d.ts +25 -0
  260. package/dist/orchestration/jev-gateway.d.ts.map +1 -0
  261. package/dist/orchestration/jev-gateway.js +103 -0
  262. package/dist/orchestration/jev-gateway.js.map +1 -0
  263. package/dist/orchestration/jev-tool.d.ts +45 -0
  264. package/dist/orchestration/jev-tool.d.ts.map +1 -0
  265. package/dist/orchestration/jev-tool.js +10 -0
  266. package/dist/orchestration/jev-tool.js.map +1 -0
  267. package/dist/orchestration/live-execution-input.d.ts +26 -0
  268. package/dist/orchestration/live-execution-input.d.ts.map +1 -0
  269. package/dist/orchestration/live-execution-input.js +70 -0
  270. package/dist/orchestration/live-execution-input.js.map +1 -0
  271. package/dist/orchestration/notification-mailbox.d.ts.map +1 -1
  272. package/dist/orchestration/notification-mailbox.js +5 -2
  273. package/dist/orchestration/notification-mailbox.js.map +1 -1
  274. package/dist/orchestration/process-activity.d.ts +4 -2
  275. package/dist/orchestration/process-activity.d.ts.map +1 -1
  276. package/dist/orchestration/process-activity.js +31 -42
  277. package/dist/orchestration/process-activity.js.map +1 -1
  278. package/dist/orchestration/process-platform.d.ts +72 -0
  279. package/dist/orchestration/process-platform.d.ts.map +1 -0
  280. package/dist/orchestration/process-platform.js +396 -0
  281. package/dist/orchestration/process-platform.js.map +1 -0
  282. package/dist/orchestration/process-supervisor.d.ts +31 -7
  283. package/dist/orchestration/process-supervisor.d.ts.map +1 -1
  284. package/dist/orchestration/process-supervisor.js +89 -61
  285. package/dist/orchestration/process-supervisor.js.map +1 -1
  286. package/dist/orchestration/process-turn.d.ts +8 -0
  287. package/dist/orchestration/process-turn.d.ts.map +1 -1
  288. package/dist/orchestration/process-turn.js +97 -13
  289. package/dist/orchestration/process-turn.js.map +1 -1
  290. package/dist/orchestration/progress-review.d.ts +1 -1
  291. package/dist/orchestration/progress-review.d.ts.map +1 -1
  292. package/dist/orchestration/progress-review.js +5 -1
  293. package/dist/orchestration/progress-review.js.map +1 -1
  294. package/dist/orchestration/report-fidelity.d.ts +31 -0
  295. package/dist/orchestration/report-fidelity.d.ts.map +1 -0
  296. package/dist/orchestration/report-fidelity.js +34 -0
  297. package/dist/orchestration/report-fidelity.js.map +1 -0
  298. package/dist/orchestration/response-errors.d.ts.map +1 -1
  299. package/dist/orchestration/response-errors.js +1 -0
  300. package/dist/orchestration/response-errors.js.map +1 -1
  301. package/dist/orchestration/runtime.d.ts +51 -1
  302. package/dist/orchestration/runtime.d.ts.map +1 -1
  303. package/dist/orchestration/runtime.js +404 -33
  304. package/dist/orchestration/runtime.js.map +1 -1
  305. package/dist/orchestration/skill-catalog-budget.d.ts +6 -0
  306. package/dist/orchestration/skill-catalog-budget.d.ts.map +1 -0
  307. package/dist/orchestration/skill-catalog-budget.js +9 -0
  308. package/dist/orchestration/skill-catalog-budget.js.map +1 -0
  309. package/dist/orchestration/skills.d.ts +4 -2
  310. package/dist/orchestration/skills.d.ts.map +1 -1
  311. package/dist/orchestration/skills.js +44 -3
  312. package/dist/orchestration/skills.js.map +1 -1
  313. package/dist/orchestration/speech.d.ts +1 -1
  314. package/dist/orchestration/speech.d.ts.map +1 -1
  315. package/dist/orchestration/speech.js +1 -1
  316. package/dist/orchestration/store.d.ts +1 -0
  317. package/dist/orchestration/store.d.ts.map +1 -1
  318. package/dist/orchestration/store.js +2 -0
  319. package/dist/orchestration/store.js.map +1 -1
  320. package/dist/orchestration/task-controls.d.ts +78 -8
  321. package/dist/orchestration/task-controls.d.ts.map +1 -1
  322. package/dist/orchestration/task-controls.js +6 -1
  323. package/dist/orchestration/task-controls.js.map +1 -1
  324. package/dist/orchestration/task-questions.js +2 -2
  325. package/dist/orchestration/task-questions.js.map +1 -1
  326. package/dist/orchestration/tasks/automation-session.d.ts +25 -0
  327. package/dist/orchestration/tasks/automation-session.d.ts.map +1 -0
  328. package/dist/orchestration/tasks/automation-session.js +68 -0
  329. package/dist/orchestration/tasks/automation-session.js.map +1 -0
  330. package/dist/orchestration/tasks/driver.d.ts.map +1 -1
  331. package/dist/orchestration/tasks/driver.js +7 -5
  332. package/dist/orchestration/tasks/driver.js.map +1 -1
  333. package/dist/orchestration/tasks/failure.d.ts +6 -0
  334. package/dist/orchestration/tasks/failure.d.ts.map +1 -1
  335. package/dist/orchestration/tasks/failure.js +26 -2
  336. package/dist/orchestration/tasks/failure.js.map +1 -1
  337. package/dist/orchestration/tasks/scheduler.d.ts +1 -1
  338. package/dist/orchestration/tasks/scheduler.d.ts.map +1 -1
  339. package/dist/orchestration/tasks/scheduler.js +3 -1
  340. package/dist/orchestration/tasks/scheduler.js.map +1 -1
  341. package/dist/orchestration/tasks/service.d.ts +68 -7
  342. package/dist/orchestration/tasks/service.d.ts.map +1 -1
  343. package/dist/orchestration/tasks/service.js +647 -45
  344. package/dist/orchestration/tasks/service.js.map +1 -1
  345. package/dist/orchestration/types.d.ts +90 -3
  346. package/dist/orchestration/types.d.ts.map +1 -1
  347. package/dist/orchestration/types.js.map +1 -1
  348. package/dist/safemode/native.d.ts.map +1 -1
  349. package/dist/safemode/native.js +8 -3
  350. package/dist/safemode/native.js.map +1 -1
  351. package/dist/session/claude-bin.d.ts +29 -0
  352. package/dist/session/claude-bin.d.ts.map +1 -1
  353. package/dist/session/claude-bin.js +63 -12
  354. package/dist/session/claude-bin.js.map +1 -1
  355. package/dist/session/codex-extension-discovery.d.ts.map +1 -1
  356. package/dist/session/codex-extension-discovery.js +4 -2
  357. package/dist/session/codex-extension-discovery.js.map +1 -1
  358. package/dist/session/codex-native-mcp-client.d.ts.map +1 -1
  359. package/dist/session/codex-native-mcp-client.js +2 -1
  360. package/dist/session/codex-native-mcp-client.js.map +1 -1
  361. package/dist/session/codex-process.d.ts +4 -0
  362. package/dist/session/codex-process.d.ts.map +1 -1
  363. package/dist/session/codex-process.js +16 -6
  364. package/dist/session/codex-process.js.map +1 -1
  365. package/dist/session/compactor.d.ts.map +1 -1
  366. package/dist/session/compactor.js +1 -2
  367. package/dist/session/compactor.js.map +1 -1
  368. package/dist/session/process.d.ts +18 -0
  369. package/dist/session/process.d.ts.map +1 -1
  370. package/dist/session/process.js +175 -67
  371. package/dist/session/process.js.map +1 -1
  372. package/dist/session/runtime-profile.d.ts +18 -0
  373. package/dist/session/runtime-profile.d.ts.map +1 -1
  374. package/dist/session/runtime-profile.js +23 -0
  375. package/dist/session/runtime-profile.js.map +1 -1
  376. package/dist/session/worker-extensions.d.ts.map +1 -1
  377. package/dist/session/worker-extensions.js +4 -3
  378. package/dist/session/worker-extensions.js.map +1 -1
  379. package/dist/shell/claude-pty-shell.js +5 -4
  380. package/dist/shell/claude-pty-shell.js.map +1 -1
  381. package/dist/types.d.ts +5 -0
  382. package/dist/types.d.ts.map +1 -1
  383. package/dist/ui/dashboard-client.d.ts.map +1 -1
  384. package/dist/ui/dashboard-client.js +33 -3
  385. package/dist/ui/dashboard-client.js.map +1 -1
  386. package/dist/ui/web-ui.js +1 -1
  387. package/dist/utils/paths.d.ts +8 -0
  388. package/dist/utils/paths.d.ts.map +1 -1
  389. package/dist/utils/paths.js +11 -0
  390. package/dist/utils/paths.js.map +1 -1
  391. package/lib/automation/browser-thinking.cjs +9 -0
  392. package/lib/automation/browser-thinking.d.cts +2 -0
  393. package/lib/automation/computer-thinking.cjs +10 -0
  394. package/lib/automation/computer-thinking.d.cts +2 -0
  395. package/lib/automation/index.cjs +47 -0
  396. package/lib/automation/index.d.cts +3 -0
  397. package/lib/automation/reasoning-instructions.cjs +5 -0
  398. package/lib/automation/thinking.cjs +35 -0
  399. package/lib/automation/thinking.d.cts +2 -0
  400. package/mcp/capability-catalog.ts +2 -2
  401. package/mcp/server.ts +1 -1
  402. package/mcp/tools/tasks/module.ts +9 -0
  403. package/mcp/tools/telegram/receiver-server.ts +4 -2
  404. package/package.json +6 -4
@@ -0,0 +1,396 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.darwinPlatform = exports.linuxPlatform = void 0;
4
+ exports.windowsPowerShell = windowsPowerShell;
5
+ exports.parsePsCpuTicks = parsePsCpuTicks;
6
+ exports.parseDarwinPs = parseDarwinPs;
7
+ exports.parseWindowsSnapshot = parseWindowsSnapshot;
8
+ exports.windowsTree = windowsTree;
9
+ exports.windowsPlatform = windowsPlatform;
10
+ exports.processPlatform = processPlatform;
11
+ exports.setProcessPlatform = setProcessPlatform;
12
+ const child_process_1 = require("child_process");
13
+ const fs_1 = require("fs");
14
+ const promises_1 = require("fs/promises");
15
+ const gone = (error) => ['ENOENT', 'ESRCH'].includes(error.code ?? '');
16
+ function signalPosixGroup(group, signal) {
17
+ try {
18
+ process.kill(-group, signal);
19
+ }
20
+ catch (error) {
21
+ if (error.code !== 'ESRCH')
22
+ return false;
23
+ }
24
+ return true;
25
+ }
26
+ // Absolute paths, so a PATH entry cannot substitute the tool whose output decides what gets killed.
27
+ const PS_BIN = '/bin/ps', SYSCTL_BIN = '/usr/sbin/sysctl';
28
+ /** `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe` from the first of SystemRoot
29
+ * and windir that is a plain absolute drive path; otherwise the bare name, resolved through PATH. */
30
+ function windowsPowerShell(systemRoot = process.env.SystemRoot, windir = process.env.windir) {
31
+ const root = [systemRoot, windir].find(value => value && /^[A-Za-z]:\\[^"*?<>|]*$/.test(value));
32
+ return root ? `${root.replace(/\\+$/, '')}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe` : 'powershell.exe';
33
+ }
34
+ function run(file, args, timeout = 10000) {
35
+ return new Promise(resolve => {
36
+ (0, child_process_1.execFile)(file, args, { encoding: 'utf8', timeout, windowsHide: true, maxBuffer: 32 * 1024 * 1024, env: { ...process.env, LC_ALL: 'C' } }, (error, stdout) => resolve(error ? undefined : stdout));
37
+ });
38
+ }
39
+ exports.linuxPlatform = {
40
+ detachWorkers: true, termGraceMs: 2000, pollMs: 25, killSettleMs: 50,
41
+ async groupMembers(group) {
42
+ const members = [];
43
+ try {
44
+ for (const entry of (0, fs_1.readdirSync)('/proc')) {
45
+ if (!/^\d+$/.test(entry))
46
+ continue;
47
+ try {
48
+ const stat = (0, fs_1.readFileSync)(`/proc/${entry}/stat`, 'utf8');
49
+ const fields = stat.slice(stat.lastIndexOf(')') + 2).split(' ');
50
+ if (Number(fields[2]) === group && fields[0] !== 'Z' && fields[0] !== 'X')
51
+ members.push(Number(entry));
52
+ }
53
+ catch (error) {
54
+ if (!gone(error))
55
+ return undefined;
56
+ }
57
+ }
58
+ return members;
59
+ }
60
+ catch {
61
+ return undefined;
62
+ }
63
+ },
64
+ async signalGroup(group, signal) { return signalPosixGroup(group, signal); },
65
+ async fingerprint(pid) {
66
+ try {
67
+ const stat = (0, fs_1.readFileSync)(`/proc/${pid}/stat`, 'utf8');
68
+ const fields = stat.slice(stat.lastIndexOf(')') + 2).split(' ');
69
+ if (Number(fields[2]) !== pid)
70
+ return undefined;
71
+ return { bootId: (0, fs_1.readFileSync)('/proc/sys/kernel/random/boot_id', 'utf8').trim(), startTicks: fields[19] };
72
+ }
73
+ catch {
74
+ return undefined;
75
+ }
76
+ },
77
+ async bootId() {
78
+ try {
79
+ return (0, fs_1.readFileSync)('/proc/sys/kernel/random/boot_id', 'utf8').trim() || undefined;
80
+ }
81
+ catch {
82
+ return undefined;
83
+ }
84
+ },
85
+ async snapshot() {
86
+ const members = new Map();
87
+ const entries = await (0, promises_1.readdir)('/proc');
88
+ // Sequential stat reads bound open files and memory on busy shared hosts.
89
+ for (const entry of entries) {
90
+ if (!/^\d+$/.test(entry))
91
+ continue;
92
+ try {
93
+ const stat = await (0, promises_1.readFile)(`/proc/${entry}/stat`, 'utf8');
94
+ const f = stat.slice(stat.lastIndexOf(')') + 2).trim().split(/\s+/);
95
+ members.set(Number(entry), { pid: Number(entry), parent: Number(f[1]), group: Number(f[2]), state: f[0], start: f[19], cpu: Number(f[11]) + Number(f[12]) });
96
+ }
97
+ catch { /* Processes may exit while being sampled. */ }
98
+ }
99
+ return members;
100
+ },
101
+ async refine(m) {
102
+ try {
103
+ const io = await (0, promises_1.readFile)(`/proc/${m.pid}/io`, 'utf8');
104
+ // Logical I/O includes pipes/cache, so piped test output is visible.
105
+ m.read = Number(/^rchar:\s+(\d+)/m.exec(io)?.[1]);
106
+ m.write = Number(/^wchar:\s+(\d+)/m.exec(io)?.[1]);
107
+ }
108
+ catch { /* CPU/membership remain usable without I/O permission. */ }
109
+ try {
110
+ const stat = await (0, promises_1.readFile)(`/proc/${m.pid}/stat`, 'utf8');
111
+ return stat.slice(stat.lastIndexOf(')') + 2).trim().split(/\s+/)[19] === m.start;
112
+ }
113
+ catch {
114
+ return false;
115
+ }
116
+ },
117
+ };
118
+ /** BSD ps `time` is [[dd-]hh:]mm:ss.cc of user+system CPU. */
119
+ function parsePsCpuTicks(value) {
120
+ const [days, clock] = value.includes('-') ? value.split('-') : ['0', value];
121
+ const seconds = clock.split(':').reduce((total, part) => total * 60 + Number(part), 0) + Number(days) * 86400;
122
+ return Number.isFinite(seconds) ? Math.round(seconds * 100) : 0;
123
+ }
124
+ /** `ps -o pid=,ppid=,pgid=,stat=,time=,lstart=[,comm=]`. lstart is always five
125
+ * fields ("Mon Sep 28 10:00:01 2026"); an optional comm (may hold spaces) follows. */
126
+ function parseDarwinPs(output) {
127
+ const members = new Map();
128
+ for (const line of output.split('\n')) {
129
+ const match = /^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\S+)\s+(\S+)\s+(\S+\s+\S+\s+\d+\s+[\d:]+\s+\d+)(?:\s+(.*?))?\s*$/.exec(line);
130
+ if (!match)
131
+ continue;
132
+ const pid = Number(match[1]);
133
+ members.set(pid, { pid, parent: Number(match[2]), group: Number(match[3]), state: match[4], start: match[6].replace(/\s+/g, ' '), cpu: parsePsCpuTicks(match[5]),
134
+ ...(match[7] ? { command: match[7] } : {}) });
135
+ }
136
+ return members;
137
+ }
138
+ const PS_COLUMNS = 'pid=,ppid=,pgid=,stat=,time=,lstart=';
139
+ exports.darwinPlatform = {
140
+ detachWorkers: true, termGraceMs: 2000, pollMs: 50, killSettleMs: 50,
141
+ async groupMembers(group) {
142
+ const output = await run(PS_BIN, ['-A', '-o', 'pid=,pgid=,stat=']);
143
+ if (output === undefined)
144
+ return undefined;
145
+ const members = [];
146
+ for (const line of output.split('\n')) {
147
+ const [pid, pgid, state] = line.trim().split(/\s+/);
148
+ if (Number(pgid) === group && state && state[0] !== 'Z')
149
+ members.push(Number(pid));
150
+ }
151
+ return members;
152
+ },
153
+ async signalGroup(group, signal) { return signalPosixGroup(group, signal); },
154
+ async fingerprint(pid) {
155
+ // ps exits 1 for an unknown pid; that is "no identity", not an error.
156
+ const [output, bootId] = await Promise.all([run(PS_BIN, ['-p', String(pid), '-o', `${PS_COLUMNS},comm=`]), exports.darwinPlatform.bootId()]);
157
+ const record = output === undefined ? undefined : parseDarwinPs(output).get(pid);
158
+ if (!record?.command || record.group !== pid || record.state[0] === 'Z' || !bootId)
159
+ return undefined;
160
+ // ps offers no start time finer than lstart's 1s, so a PID reused within the
161
+ // same second would match on start alone; the executable (and the group-leader
162
+ // check above) must match too. Only this per-attempt call pays for comm.
163
+ return { bootId, startTicks: `${record.start}|${record.command}` };
164
+ },
165
+ async bootId() { return (await run(SYSCTL_BIN, ['-n', 'kern.bootsessionuuid']))?.trim() || undefined; },
166
+ async snapshot() {
167
+ const output = await run(PS_BIN, ['-A', '-o', PS_COLUMNS]);
168
+ return output === undefined ? undefined : parseDarwinPs(output);
169
+ },
170
+ };
171
+ /** Windows has no process groups and no reparenting: a child keeps the PID of
172
+ * its dead parent. A tree edge is trusted only when the child was created no
173
+ * earlier than that parent, which rejects edges to a reused parent PID. */
174
+ // Plain .NET WMI (System.Management), never a cmdlet: resolving a cmdlet such as
175
+ // Get-CimInstance makes PowerShell run module discovery, which without a warm
176
+ // module-analysis cache (e.g. under the minimal env a desktop app gives its
177
+ // sidecar) takes 20-70s and outlives the timeout, so no stop could be proven.
178
+ const WIN_WMI = "$ErrorActionPreference='Stop';$null=[Reflection.Assembly]::Load('System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a');";
179
+ const winQuery = (wql, row) => `${WIN_WMI}foreach($p in [Management.ManagementObjectSearcher]::new('${wql}').Get()){${row}}`;
180
+ const winTime = (field) => `[Management.ManagementDateTimeConverter]::ToDateTime($p['${field}']).ToFileTimeUtc()`;
181
+ const WIN_SNAPSHOT = winQuery('SELECT ProcessId,ParentProcessId,CreationDate,KernelModeTime,UserModeTime,ReadTransferCount,WriteTransferCount FROM Win32_Process', `if($p['CreationDate']){'{0} {1} {2} {3} {4} {5}' -f $p['ProcessId'],$p['ParentProcessId'],${winTime('CreationDate')},([uint64]$p['KernelModeTime']+[uint64]$p['UserModeTime']),$p['ReadTransferCount'],$p['WriteTransferCount']}`);
182
+ // LastBootUpTime is the boot identity. It does not follow wall-clock changes
183
+ // (checked on a Windows runner: a +/-3h Set-Date left it identical to the 100ns),
184
+ // so it is compared exactly.
185
+ const WIN_BOOT = winQuery('SELECT LastBootUpTime FROM Win32_OperatingSystem', winTime('LastBootUpTime'));
186
+ function parseWindowsSnapshot(output) {
187
+ const members = new Map();
188
+ for (const line of output.split(/\r?\n/)) {
189
+ const match = /^(\d+) (\d+) (\d+) (\d+) (\d*) (\d*)$/.exec(line.trim());
190
+ if (!match)
191
+ continue;
192
+ const pid = Number(match[1]);
193
+ // 100ns units -> 10ms ticks, matching Linux USER_HZ accounting.
194
+ members.set(pid, { pid, parent: Number(match[2]), group: 0, state: 'R', start: match[3], cpu: Math.floor(Number(match[4]) / 100000),
195
+ ...(match[5] ? { read: Number(match[5]) } : {}), ...(match[6] ? { write: Number(match[6]) } : {}) });
196
+ }
197
+ return members;
198
+ }
199
+ const filetime = (value) => /^\d+$/.test(value) ? BigInt(value) : undefined;
200
+ const notBefore = (child, parent) => filetime(parent) !== undefined && filetime(child) >= filetime(parent);
201
+ /** Members of the tree rooted at `root`. `known` holds pid->start of members owned
202
+ * at the previous snapshot, so a grandchild orphaned by an exited intermediate is
203
+ * still owned. Undefined when nothing is proven: the root PID now belongs to a
204
+ * different process (its original tree may still have orphans that cannot be told
205
+ * apart), or the root is gone and no start identity anchors its orphans. */
206
+ function windowsTree(snapshot, root, known = new Map(), rootStart) {
207
+ const expected = known.get(root) ?? rootStart;
208
+ const lineage = new Map(known);
209
+ if (expected !== undefined)
210
+ lineage.set(root, expected);
211
+ const owned = new Map();
212
+ const current = snapshot.get(root);
213
+ if (current && expected !== undefined && current.start !== expected)
214
+ return undefined;
215
+ if (!current && expected === undefined)
216
+ return undefined;
217
+ if (current) {
218
+ owned.set(root, current.start);
219
+ lineage.set(root, current.start);
220
+ }
221
+ let changed = true;
222
+ while (changed) {
223
+ changed = false;
224
+ for (const m of snapshot.values()) {
225
+ if (owned.has(m.pid) || m.pid === m.parent)
226
+ continue;
227
+ // A live parent must itself be owned; a dead one is trusted from lineage.
228
+ // Residual gap: if a member dies, an unrelated process reuses its PID, starts
229
+ // a child and dies too, all between two snapshots, that child passes the
230
+ // creation-time check against the member's recorded start. Closing it needs
231
+ // each member's exit time, which WMI does not report; the lineage is kept
232
+ // for one snapshot only, so the window is one poll interval.
233
+ const parentStart = snapshot.has(m.parent) ? owned.get(m.parent) : lineage.get(m.parent);
234
+ if (known.get(m.pid) === m.start || (parentStart !== undefined && notBefore(m.start, parentStart))) {
235
+ owned.set(m.pid, m.start);
236
+ changed = true;
237
+ }
238
+ }
239
+ }
240
+ return owned;
241
+ }
242
+ const bounded = (map, key, value) => {
243
+ map.delete(key);
244
+ map.set(key, value);
245
+ for (const oldest of map.keys()) {
246
+ if (map.size <= 256)
247
+ break;
248
+ map.delete(oldest);
249
+ }
250
+ };
251
+ function windowsPlatform(powershell = windowsPowerShell()) {
252
+ // Latest root identity per PID: its start (`spawned` when recorded while the
253
+ // child handle was held), or null when the root exited before it could be
254
+ // recorded (a live process at that PID is then someone else).
255
+ // Use refreshes an entry's place in the 256-entry budget, so a long-running
256
+ // worker is not evicted by later spawns.
257
+ const roots = new Map();
258
+ // Roots whose tree was proven empty move here, on their own budget: they no
259
+ // longer displace live roots, yet a stop retried after the PID is reused is
260
+ // still refused rather than adopting the new process.
261
+ const retired = new Map();
262
+ const recordedRoot = (pid) => {
263
+ const live = roots.get(pid);
264
+ if (live)
265
+ bounded(roots, pid, live);
266
+ return live ?? retired.get(pid);
267
+ };
268
+ // Lineage per root identity (pid:start), replaced by every snapshot: a dead
269
+ // member is trusted as a parent only in the first snapshot that misses it, so
270
+ // an entry never outlives its PID into a later reuse. Dropped once the tree is
271
+ // proven empty; the root entry is retired, never dropped, so the PID is never
272
+ // re-adopted blindly.
273
+ const lineages = new Map();
274
+ const ps = (script) => run(powershell, ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', script], 30000);
275
+ const snapshot = async () => { const output = await ps(WIN_SNAPSHOT); return output === undefined ? undefined : parseWindowsSnapshot(output); };
276
+ // The boot time cannot change while this process runs, so one query serves
277
+ // every fingerprint; a failed query is retried on the next call.
278
+ let bootQuery;
279
+ const bootTime = () => {
280
+ const pending = bootQuery ?? (bootQuery = ps(WIN_BOOT).then(output => output?.trim() || undefined));
281
+ void pending.then(value => { if (value === undefined && bootQuery === pending)
282
+ bootQuery = undefined; });
283
+ return pending;
284
+ };
285
+ const tree = async (group, rootStart) => {
286
+ const entry = recordedRoot(group);
287
+ const recorded = await entry;
288
+ const processes = await snapshot();
289
+ if (!processes || (rootStart === undefined && recorded === null))
290
+ return undefined;
291
+ // An unrecorded root is adopted only while it is alive; a dead one proves nothing.
292
+ const start = rootStart ?? recorded?.start ?? processes.get(group)?.start;
293
+ if (start === undefined)
294
+ return undefined;
295
+ const key = `${group}:${start}`;
296
+ const owned = windowsTree(processes, group, lineages.get(key), start);
297
+ if (!owned)
298
+ return undefined;
299
+ if (owned.size)
300
+ bounded(lineages, key, owned);
301
+ else
302
+ lineages.delete(key);
303
+ // Only for the recorded identity, and unless a new root was recorded at this PID meanwhile.
304
+ if (roots.get(group) === entry && (recorded === undefined || recorded?.start === start)) {
305
+ const root = recorded === undefined ? Promise.resolve({ start, spawned: false }) : entry;
306
+ if (owned.size)
307
+ bounded(roots, group, root);
308
+ else {
309
+ roots.delete(group);
310
+ bounded(retired, group, root);
311
+ }
312
+ }
313
+ return owned;
314
+ };
315
+ return {
316
+ // Each poll is a PowerShell WMI snapshot (0.4-4s), so poll far less often than POSIX.
317
+ detachWorkers: false, termGraceMs: 2000, pollMs: 500, killSettleMs: 500,
318
+ async groupMembers(group, rootStart) { const owned = await tree(group, rootStart); return owned && [...owned.keys()]; },
319
+ // Console processes cannot be asked to exit politely, so both signals terminate
320
+ // every creation-time-verified member individually. Never taskkill /T: it
321
+ // follows bare parent PIDs, which Windows keeps after the parent dies.
322
+ // Termination is by PID, right after the snapshot that verified each creation
323
+ // time; a PID that exits and is reused in that gap (milliseconds) cannot be
324
+ // re-checked without another snapshot. Only a job object, assigned at spawn,
325
+ // would close that window.
326
+ async signalGroup(group, _signal, rootStart) {
327
+ const owned = await tree(group, rootStart);
328
+ if (!owned)
329
+ return false;
330
+ for (const pid of owned.keys()) {
331
+ try {
332
+ process.kill(pid, 'SIGKILL');
333
+ }
334
+ catch (error) {
335
+ if (!gone(error))
336
+ return false;
337
+ }
338
+ }
339
+ return true;
340
+ },
341
+ async fingerprint(pid) {
342
+ const recorded = await recordedRoot(pid);
343
+ if (recorded === null)
344
+ return undefined;
345
+ // Recorded at spawn while the handle was held: that start is our worker's,
346
+ // even if the PID has been reused since, and needs no fresh snapshot.
347
+ if (recorded?.spawned) {
348
+ const boot = await bootTime();
349
+ return boot ? { bootId: boot, startTicks: recorded.start } : undefined;
350
+ }
351
+ const [processes, boot] = await Promise.all([snapshot(), bootTime()]);
352
+ const record = processes?.get(pid);
353
+ if (!record || !boot || (recorded && record.start !== recorded.start))
354
+ return undefined;
355
+ return { bootId: boot, startTicks: record.start };
356
+ },
357
+ bootId: bootTime,
358
+ snapshot,
359
+ tree(processes, root, known) {
360
+ const owned = windowsTree(processes, root, known);
361
+ // The activity sampler's fresher view also serves a later stop of an
362
+ // adopted root, without another snapshot.
363
+ const key = `${root}:${owned?.get(root)}`;
364
+ if (owned && lineages.has(key)) {
365
+ bounded(lineages, key, owned);
366
+ recordedRoot(root);
367
+ }
368
+ return owned;
369
+ },
370
+ adopt(pid, alive) {
371
+ const root = snapshot().then((processes) => {
372
+ if (!processes)
373
+ return undefined;
374
+ const start = processes.get(pid)?.start;
375
+ if (start === undefined || !alive())
376
+ return null;
377
+ // A new root at a reused PID starts a fresh lineage.
378
+ bounded(lineages, `${pid}:${start}`, new Map([[pid, start]]));
379
+ return { start, spawned: true };
380
+ });
381
+ bounded(roots, pid, root);
382
+ retired.delete(pid);
383
+ return root.then(recorded => recorded?.start);
384
+ },
385
+ };
386
+ }
387
+ let selected;
388
+ /** The supervisor for this host, or undefined where orchestration cannot prove process lifetime. */
389
+ function processPlatform() {
390
+ if (selected === undefined)
391
+ selected = process.platform === 'linux' ? exports.linuxPlatform : process.platform === 'darwin' ? exports.darwinPlatform : process.platform === 'win32' ? windowsPlatform() : null;
392
+ return selected ?? undefined;
393
+ }
394
+ /** Test hook: substitute a platform (e.g. a mocked Windows supervisor on Linux CI). */
395
+ function setProcessPlatform(platform) { selected = platform; }
396
+ //# sourceMappingURL=process-platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-platform.js","sourceRoot":"","sources":["../../src/orchestration/process-platform.ts"],"names":[],"mappings":";;;AAmDA,8CAGC;AAiED,0CAIC;AAGD,sCAUC;AAgDD,oDAWC;AAQD,kCAyBC;AAMD,0CAuGC;AAID,0CAGC;AAED,gDAA+G;AA1V/G,iDAAyC;AACzC,2BAA+C;AAC/C,0CAAgD;AAwChD,MAAM,IAAI,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAE,KAA+B,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AAC3G,SAAS,gBAAgB,CAAC,KAAa,EAAE,MAA6B;IACpE,IAAI,CAAC;QAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAAC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAAC,IAAK,KAA+B,CAAC,IAAI,KAAK,OAAO;YAAE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OAAO,IAAI,CAAC;gBACjD,qDAAqD;gBACrD,OAAO,CAAC,QAAQ,EAAE,GAAG,GAAG,IAAI,KAAK,EAAE,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC9D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;YAC1B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,IAAI,QAA4C,CAAC;AACjD,oGAAoG;AACpG,SAAgB,eAAe;IAC7B,IAAI,QAAQ,KAAK,SAAS;QAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,qBAAa,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,sBAAc,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/L,OAAO,QAAQ,IAAI,SAAS,CAAC;AAC/B,CAAC;AACD,uFAAuF;AACvF,SAAgB,kBAAkB,CAAC,QAA4C,IAAU,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC"}
@@ -1,15 +1,39 @@
1
- /** Linux process-group evidence ignores exited zombies. Escaped/detached
2
- * process groups are outside this proof and must be reconciled separately. */
3
- export declare function liveGroupMembers(group: number): number[] | undefined;
1
+ import type { ChildProcess } from 'child_process';
2
+ import { type Fingerprint } from './process-platform';
3
+ /** Hosts where orchestration can prove a worker's processes stopped. */
4
+ export declare function processSupervisorSupported(): boolean;
5
+ /** `detached` for a worker spawn: POSIX workers lead their own process group
6
+ * (also on hosts without a supervisor); Windows workers stay attached and are
7
+ * supervised as a tree. */
8
+ export declare function workerSpawnDetached(): boolean;
9
+ type RootChild = Pick<ChildProcess, 'pid' | 'exitCode' | 'signalCode'>;
10
+ /** Call right after spawning a supervised worker or probe root. Windows records
11
+ * the root's start identity while the child handle still pins its PID, so a stop
12
+ * can anchor orphans after the root exits and a reused PID is never adopted. */
13
+ export declare function recordProcessRoot(child: RootChild): void;
14
+ /** Process-group evidence ignores exited zombies. On POSIX, escaped/detached
15
+ * process groups are outside this proof and must be reconciled separately; on
16
+ * Windows the group is the tree rooted at `group` (see windowsTree). */
17
+ export declare function liveGroupMembers(group: number, rootStart?: string): Promise<number[] | undefined>;
4
18
  export declare function stopProcessGroup(group: number): Promise<boolean>;
5
19
  /** Kernel identity prevents signalling an unrelated process after PID reuse. */
6
- export declare function processFingerprint(pid: number): {
7
- bootId: string;
8
- startTicks: string;
9
- } | undefined;
20
+ export declare function processFingerprint(pid: number): Promise<Fingerprint | undefined>;
10
21
  export declare function cleanupPersistedProcess(identity?: {
11
22
  pid: number;
12
23
  bootId?: string;
13
24
  startTicks?: string;
14
25
  }): Promise<boolean>;
26
+ type ProbeChild = RootChild & Pick<ChildProcess, 'kill'>;
27
+ /** Stop a short-lived probe (spawned with `detached: workerSpawnDetached()` and
28
+ * passed to `recordProcessRoot`) and every process it started. Synchronous
29
+ * callers may ignore the promise.
30
+ *
31
+ * POSIX signals the probe's process group. Windows has no polite console
32
+ * signal, so SIGTERM only leaves the probe its grace period to exit on stdin
33
+ * EOF; SIGKILL then terminates the whole tree once, only the creation-time-
34
+ * verified members of the root identity recorded at spawn, so a reused PID is
35
+ * refused. A probe whose identity could not be recorded (it exited first) is
36
+ * not signalled beyond its own handle. */
37
+ export declare function terminateProbeTree(child: ProbeChild, signal: 'SIGTERM' | 'SIGKILL'): Promise<void>;
38
+ export {};
15
39
  //# sourceMappingURL=process-supervisor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"process-supervisor.d.ts","sourceRoot":"","sources":["../../src/orchestration/process-supervisor.ts"],"names":[],"mappings":"AAEA;8EAC8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAcpE;AACD,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAatE;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAQlG;AACD,wBAAsB,uBAAuB,CAAC,QAAQ,CAAC,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAQhI"}
1
+ {"version":3,"file":"process-supervisor.d.ts","sourceRoot":"","sources":["../../src/orchestration/process-supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGvE,wEAAwE;AACxE,wBAAgB,0BAA0B,IAAI,OAAO,CAAuC;AAC5F;;2BAE2B;AAC3B,wBAAgB,mBAAmB,IAAI,OAAO,CAA6E;AAE3H,KAAK,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,UAAU,GAAG,YAAY,CAAC,CAAC;AAIvE;;gFAEgF;AAChF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAKxD;AAED;;wEAEwE;AACxE,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAA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