agentxgo 0.0.0-stage → 0.1.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 (724) hide show
  1. package/README.md +9 -2
  2. package/dist/adapters/codex/client.js +6 -0
  3. package/dist/adapters/dsh/client.js +6 -0
  4. package/dist/adapters/runtime-http/client.js +101 -0
  5. package/dist/adapters/runtime-http/endpoint.js +15 -0
  6. package/dist/bootstrap.js +161 -0
  7. package/dist/cli.js +134 -0
  8. package/dist/communication/assembly.js +172 -0
  9. package/dist/communication/calls.js +107 -0
  10. package/dist/communication/config.js +33 -0
  11. package/dist/communication/pump.js +136 -0
  12. package/dist/computer/authority.js +67 -0
  13. package/dist/computer/automatic.js +163 -0
  14. package/dist/computer/automation-main.js +59 -0
  15. package/dist/computer/automation.js +229 -0
  16. package/dist/computer/backend.js +160 -0
  17. package/dist/computer/clipboard.js +72 -0
  18. package/dist/computer/config.js +66 -0
  19. package/dist/computer/controller.js +378 -0
  20. package/dist/computer/desktop.js +225 -0
  21. package/dist/computer/job-main.js +114 -0
  22. package/dist/computer/main.js +9 -0
  23. package/dist/computer/native.js +28 -0
  24. package/dist/computer/processes.js +165 -0
  25. package/dist/computer/release.js +40 -0
  26. package/dist/computer/scratch.js +171 -0
  27. package/dist/computer/service.js +46 -0
  28. package/dist/computer/worker.js +70 -0
  29. package/dist/config.js +156 -0
  30. package/dist/continuation/checkpoints.js +98 -0
  31. package/dist/continuation/commands.js +81 -0
  32. package/dist/continuation/coordinator.js +490 -0
  33. package/dist/continuation/corrections.js +154 -0
  34. package/dist/continuation/events.js +171 -0
  35. package/dist/continuation/failure.js +93 -0
  36. package/dist/continuation/listening.js +24 -0
  37. package/dist/continuation/local-wait.js +67 -0
  38. package/dist/continuation/observations.js +100 -0
  39. package/dist/continuation/parking.js +190 -0
  40. package/dist/continuation/reading.js +77 -0
  41. package/dist/conversations/pump.js +158 -0
  42. package/dist/conversations/runtime-http.js +88 -0
  43. package/dist/deployment/cold-qualification.js +119 -0
  44. package/dist/deployment/cold-release.js +56 -0
  45. package/dist/deployment/components/cli.js +45 -0
  46. package/dist/deployment/components/lock.js +38 -0
  47. package/dist/deployment/components/manager.js +281 -0
  48. package/dist/deployment/components/release.js +50 -0
  49. package/dist/deployment/components/runner.js +15 -0
  50. package/dist/deployment/components/supervisor.js +289 -0
  51. package/dist/deployment/components/verify.js +66 -0
  52. package/dist/deployment/components/windows.js +70 -0
  53. package/dist/deployment/config.js +89 -0
  54. package/dist/deployment/failure.js +24 -0
  55. package/dist/deployment/kernel.js +85 -0
  56. package/dist/deployment/macos/activate.js +140 -0
  57. package/dist/deployment/macos/attachment.js +42 -0
  58. package/dist/deployment/macos/handoff.js +140 -0
  59. package/dist/deployment/macos/install.js +223 -0
  60. package/dist/deployment/macos/plan.js +155 -0
  61. package/dist/deployment/macos/proof.js +24 -0
  62. package/dist/deployment/main.js +16 -0
  63. package/dist/deployment/members.js +58 -0
  64. package/dist/deployment/preflight.js +41 -0
  65. package/dist/deployment/recovery-route.js +18 -0
  66. package/dist/deployment/runtime.js +114 -0
  67. package/dist/deployment/system.js +112 -0
  68. package/dist/deployment/windows-state.js +32 -0
  69. package/dist/doctor/config.js +155 -0
  70. package/dist/doctor/probe.js +212 -0
  71. package/dist/doctor/process.js +31 -0
  72. package/dist/doctor/run.js +105 -0
  73. package/dist/enrollment/cli.js +57 -0
  74. package/dist/enrollment/defaults.js +54 -0
  75. package/dist/enrollment/device.js +314 -0
  76. package/dist/enrollment/login.js +107 -0
  77. package/dist/enrollment/setup.js +164 -0
  78. package/dist/enrollment/terminal.js +55 -0
  79. package/dist/execution/artifact.js +157 -0
  80. package/dist/execution/codex/authority.js +356 -0
  81. package/dist/execution/codex/catalog.js +24 -0
  82. package/dist/execution/codex/config.js +77 -0
  83. package/dist/execution/codex/directories.js +67 -0
  84. package/dist/execution/codex/main.js +17 -0
  85. package/dist/execution/codex/read.js +35 -0
  86. package/dist/execution/codex/record.js +121 -0
  87. package/dist/execution/codex/role.js +2 -0
  88. package/dist/execution/codex/stream.js +2 -0
  89. package/dist/execution/codex/window-receipts.js +73 -0
  90. package/dist/execution/codex/wire.js +56 -0
  91. package/dist/execution/codex/worker.js +143 -0
  92. package/dist/execution/config.js +215 -0
  93. package/dist/execution/environment.js +61 -0
  94. package/dist/execution/gateway.js +212 -0
  95. package/dist/execution/lease-watchdog.js +172 -0
  96. package/dist/execution/local.js +159 -0
  97. package/dist/execution/main.js +71 -0
  98. package/dist/execution/native/config.js +45 -0
  99. package/dist/execution/native/input.js +7 -0
  100. package/dist/execution/native/main.js +9 -0
  101. package/dist/execution/native/records.js +168 -0
  102. package/dist/execution/native/worker.js +128 -0
  103. package/dist/execution/native-job-gate.js +63 -0
  104. package/dist/execution/process-types.js +1 -0
  105. package/dist/execution/process.js +246 -0
  106. package/dist/execution/results.js +111 -0
  107. package/dist/execution/role.js +210 -0
  108. package/dist/execution/runner.js +338 -0
  109. package/dist/execution/scope.js +415 -0
  110. package/dist/execution/scratch-files.js +352 -0
  111. package/dist/execution/scratch-paths.js +56 -0
  112. package/dist/execution/scratch.js +126 -0
  113. package/dist/execution/stdio.js +83 -0
  114. package/dist/execution/stream.js +159 -0
  115. package/dist/execution/watchdog.js +181 -0
  116. package/dist/execution/work.js +76 -0
  117. package/dist/execution/worker.js +106 -0
  118. package/dist/help.js +21 -0
  119. package/dist/lifecycle/http.js +178 -0
  120. package/dist/lifecycle/runtime.js +263 -0
  121. package/dist/lifecycle/status-command.js +78 -0
  122. package/dist/lifecycle/status.js +37 -0
  123. package/dist/lifecycle/wake-hints.js +68 -0
  124. package/dist/main.js +59 -0
  125. package/dist/ports/reports.js +1 -0
  126. package/dist/ports/runtime.js +1 -0
  127. package/dist/preparation/backend.js +44 -0
  128. package/dist/preparation/binding.js +47 -0
  129. package/dist/preparation/bootstrap.js +165 -0
  130. package/dist/preparation/config.js +143 -0
  131. package/dist/preparation/coordinator.js +251 -0
  132. package/dist/preparation/main.js +58 -0
  133. package/dist/preparation/runtime.js +122 -0
  134. package/dist/receptions/pump.js +109 -0
  135. package/dist/receptions/runtime-http.js +115 -0
  136. package/dist/recovery/activation.js +178 -0
  137. package/dist/recovery/admission.js +95 -0
  138. package/dist/recovery/automatic-preparation.js +194 -0
  139. package/dist/recovery/automatic-recovery.js +210 -0
  140. package/dist/recovery/confirmed-binding.js +45 -0
  141. package/dist/recovery/coordinator.js +351 -0
  142. package/dist/recovery/execution-policy.js +26 -0
  143. package/dist/recovery/preparation-policy.js +30 -0
  144. package/dist/recovery/prestart.js +62 -0
  145. package/dist/recovery/quarantine.js +153 -0
  146. package/dist/recovery/service-restart-view.js +32 -0
  147. package/dist/recovery/service-restart.js +368 -0
  148. package/dist/reports/pump.js +98 -0
  149. package/dist/resources/admission.js +25 -0
  150. package/dist/resources/guard.js +14 -0
  151. package/node_modules/@agent-stack/adapter-agentim/dist/account.js +42 -0
  152. package/node_modules/@agent-stack/adapter-agentim/dist/connection-file.js +32 -0
  153. package/node_modules/@agent-stack/adapter-agentim/dist/direct.js +114 -0
  154. package/node_modules/@agent-stack/adapter-agentim/dist/local.js +238 -0
  155. package/node_modules/@agent-stack/adapter-agentim/dist/operations-arguments.js +20 -0
  156. package/node_modules/@agent-stack/adapter-agentim/dist/operations-communication.js +56 -0
  157. package/node_modules/@agent-stack/adapter-agentim/dist/operations-operator.js +40 -0
  158. package/node_modules/@agent-stack/adapter-agentim/package.json +15 -0
  159. package/node_modules/@agent-stack/bot-host-journal/dist/automatic-activation.js +94 -0
  160. package/node_modules/@agent-stack/bot-host-journal/dist/automatic-preparation.js +90 -0
  161. package/node_modules/@agent-stack/bot-host-journal/dist/checkpoint-seal.js +89 -0
  162. package/node_modules/@agent-stack/bot-host-journal/dist/communication.js +238 -0
  163. package/node_modules/@agent-stack/bot-host-journal/dist/computer-scratch.js +56 -0
  164. package/node_modules/@agent-stack/bot-host-journal/dist/computer.js +183 -0
  165. package/node_modules/@agent-stack/bot-host-journal/dist/database.js +174 -0
  166. package/node_modules/@agent-stack/bot-host-journal/dist/index.js +4 -0
  167. package/node_modules/@agent-stack/bot-host-journal/dist/input.js +55 -0
  168. package/node_modules/@agent-stack/bot-host-journal/dist/journal.js +396 -0
  169. package/node_modules/@agent-stack/bot-host-journal/dist/models.js +35 -0
  170. package/node_modules/@agent-stack/bot-host-journal/dist/native-calls.js +123 -0
  171. package/node_modules/@agent-stack/bot-host-journal/dist/native-window.js +12 -0
  172. package/node_modules/@agent-stack/bot-host-journal/dist/observations.js +237 -0
  173. package/node_modules/@agent-stack/bot-host-journal/dist/preparation.js +117 -0
  174. package/node_modules/@agent-stack/bot-host-journal/dist/recovery-history.js +30 -0
  175. package/node_modules/@agent-stack/bot-host-journal/dist/recovery-record.js +32 -0
  176. package/node_modules/@agent-stack/bot-host-journal/dist/recovery.js +256 -0
  177. package/node_modules/@agent-stack/bot-host-journal/dist/reports.js +105 -0
  178. package/node_modules/@agent-stack/bot-host-journal/dist/runtime-events.js +246 -0
  179. package/node_modules/@agent-stack/bot-host-journal/dist/runtime-settings.js +95 -0
  180. package/node_modules/@agent-stack/bot-host-journal/dist/target-actions.js +355 -0
  181. package/node_modules/@agent-stack/bot-host-journal/dist/target-local.js +210 -0
  182. package/node_modules/@agent-stack/bot-host-journal/dist/target-scratch.js +207 -0
  183. package/node_modules/@agent-stack/bot-host-journal/dist/terminal-checkpoints.js +286 -0
  184. package/node_modules/@agent-stack/bot-host-journal/dist/terminal-store.js +136 -0
  185. package/node_modules/@agent-stack/bot-host-journal/dist/trace-inputs.js +104 -0
  186. package/node_modules/@agent-stack/bot-host-journal/dist/upgrade.js +25 -0
  187. package/node_modules/@agent-stack/bot-host-journal/dist/waits.js +213 -0
  188. package/node_modules/@agent-stack/bot-host-journal/package.json +10 -0
  189. package/node_modules/@agent-stack/bridge-client/dist/bot-transport.js +339 -0
  190. package/node_modules/@agent-stack/bridge-client/dist/client/agents.js +22 -0
  191. package/node_modules/@agent-stack/bridge-client/dist/client/bots/assistant.js +26 -0
  192. package/node_modules/@agent-stack/bridge-client/dist/client/bots/auth.js +9 -0
  193. package/node_modules/@agent-stack/bridge-client/dist/client/bots/client.js +160 -0
  194. package/node_modules/@agent-stack/bridge-client/dist/client/bots/inventory.js +55 -0
  195. package/node_modules/@agent-stack/bridge-client/dist/client/bots/native-events.js +52 -0
  196. package/node_modules/@agent-stack/bridge-client/dist/client/bots/owner-route.js +21 -0
  197. package/node_modules/@agent-stack/bridge-client/dist/client/bots/reports.js +41 -0
  198. package/node_modules/@agent-stack/bridge-client/dist/client/bots/runtime.js +190 -0
  199. package/node_modules/@agent-stack/bridge-client/dist/client/bridge-client.js +37 -0
  200. package/node_modules/@agent-stack/bridge-client/dist/client/core.js +123 -0
  201. package/node_modules/@agent-stack/bridge-client/dist/client/deployments.js +57 -0
  202. package/node_modules/@agent-stack/bridge-client/dist/client/integrations.js +45 -0
  203. package/node_modules/@agent-stack/bridge-client/dist/client/knowledge.js +33 -0
  204. package/node_modules/@agent-stack/bridge-client/dist/client/management.js +112 -0
  205. package/node_modules/@agent-stack/bridge-client/dist/client/platform-events.js +59 -0
  206. package/node_modules/@agent-stack/bridge-client/dist/client/platform.js +82 -0
  207. package/node_modules/@agent-stack/bridge-client/dist/client/public-runtime.js +94 -0
  208. package/node_modules/@agent-stack/bridge-client/dist/client/run-work-acknowledgement.js +54 -0
  209. package/node_modules/@agent-stack/bridge-client/dist/client/run-work-errors.js +34 -0
  210. package/node_modules/@agent-stack/bridge-client/dist/client/runtime.js +46 -0
  211. package/node_modules/@agent-stack/bridge-client/dist/client/tenant/authorization.js +7 -0
  212. package/node_modules/@agent-stack/bridge-client/dist/client/tenant/management.js +59 -0
  213. package/node_modules/@agent-stack/bridge-client/dist/client/workspace.js +109 -0
  214. package/node_modules/@agent-stack/bridge-client/dist/index.js +9 -0
  215. package/node_modules/@agent-stack/bridge-client/package.json +11 -0
  216. package/node_modules/@agent-stack/contracts/dist/api-credentials.js +103 -0
  217. package/node_modules/@agent-stack/contracts/dist/bots/assistant-path.js +24 -0
  218. package/node_modules/@agent-stack/contracts/dist/bots/assistant.js +2 -0
  219. package/node_modules/@agent-stack/contracts/dist/bots/capabilities.js +66 -0
  220. package/node_modules/@agent-stack/contracts/dist/bots/capability-migration.js +1 -0
  221. package/node_modules/@agent-stack/contracts/dist/bots/capability-version.js +48 -0
  222. package/node_modules/@agent-stack/contracts/dist/bots/codex-policy.js +22 -0
  223. package/node_modules/@agent-stack/contracts/dist/bots/command-evidence.js +101 -0
  224. package/node_modules/@agent-stack/contracts/dist/bots/command-inventory.js +74 -0
  225. package/node_modules/@agent-stack/contracts/dist/bots/command-receipt.js +78 -0
  226. package/node_modules/@agent-stack/contracts/dist/bots/communication-native.js +33 -0
  227. package/node_modules/@agent-stack/contracts/dist/bots/communication-stream.js +13 -0
  228. package/node_modules/@agent-stack/contracts/dist/bots/communication.js +154 -0
  229. package/node_modules/@agent-stack/contracts/dist/bots/component-status.js +38 -0
  230. package/node_modules/@agent-stack/contracts/dist/bots/components.js +10 -0
  231. package/node_modules/@agent-stack/contracts/dist/bots/computer-validation.js +320 -0
  232. package/node_modules/@agent-stack/contracts/dist/bots/computer.js +10 -0
  233. package/node_modules/@agent-stack/contracts/dist/bots/conversations.js +31 -0
  234. package/node_modules/@agent-stack/contracts/dist/bots/corrections.js +1 -0
  235. package/node_modules/@agent-stack/contracts/dist/bots/delegation-renewal.js +17 -0
  236. package/node_modules/@agent-stack/contracts/dist/bots/delegation.js +35 -0
  237. package/node_modules/@agent-stack/contracts/dist/bots/delivery-history.js +115 -0
  238. package/node_modules/@agent-stack/contracts/dist/bots/delivery-read.js +121 -0
  239. package/node_modules/@agent-stack/contracts/dist/bots/elicitation.js +83 -0
  240. package/node_modules/@agent-stack/contracts/dist/bots/entries.js +65 -0
  241. package/node_modules/@agent-stack/contracts/dist/bots/event-exchanges.js +1 -0
  242. package/node_modules/@agent-stack/contracts/dist/bots/goal-window.js +84 -0
  243. package/node_modules/@agent-stack/contracts/dist/bots/host-actions.js +191 -0
  244. package/node_modules/@agent-stack/contracts/dist/bots/identities.js +1 -0
  245. package/node_modules/@agent-stack/contracts/dist/bots/index.js +72 -0
  246. package/node_modules/@agent-stack/contracts/dist/bots/installation.js +9 -0
  247. package/node_modules/@agent-stack/contracts/dist/bots/interaction-validation.js +227 -0
  248. package/node_modules/@agent-stack/contracts/dist/bots/interactions.js +1 -0
  249. package/node_modules/@agent-stack/contracts/dist/bots/lifecycle.js +13 -0
  250. package/node_modules/@agent-stack/contracts/dist/bots/local-execution.js +72 -0
  251. package/node_modules/@agent-stack/contracts/dist/bots/mcp-capabilities.js +53 -0
  252. package/node_modules/@agent-stack/contracts/dist/bots/mission.js +3 -0
  253. package/node_modules/@agent-stack/contracts/dist/bots/model-routing.js +43 -0
  254. package/node_modules/@agent-stack/contracts/dist/bots/native-events-validation.js +229 -0
  255. package/node_modules/@agent-stack/contracts/dist/bots/native-events.js +4 -0
  256. package/node_modules/@agent-stack/contracts/dist/bots/native-fact.js +32 -0
  257. package/node_modules/@agent-stack/contracts/dist/bots/native-host.js +10 -0
  258. package/node_modules/@agent-stack/contracts/dist/bots/observation.js +42 -0
  259. package/node_modules/@agent-stack/contracts/dist/bots/owner-progress.js +85 -0
  260. package/node_modules/@agent-stack/contracts/dist/bots/owner-transition.js +169 -0
  261. package/node_modules/@agent-stack/contracts/dist/bots/parking.js +75 -0
  262. package/node_modules/@agent-stack/contracts/dist/bots/preferences.js +39 -0
  263. package/node_modules/@agent-stack/contracts/dist/bots/preparations.js +2 -0
  264. package/node_modules/@agent-stack/contracts/dist/bots/project-oauth.js +1 -0
  265. package/node_modules/@agent-stack/contracts/dist/bots/quarantine-installation.js +117 -0
  266. package/node_modules/@agent-stack/contracts/dist/bots/quarantine.js +186 -0
  267. package/node_modules/@agent-stack/contracts/dist/bots/read-recovery.js +10 -0
  268. package/node_modules/@agent-stack/contracts/dist/bots/receptions.js +7 -0
  269. package/node_modules/@agent-stack/contracts/dist/bots/recovery-admission.js +163 -0
  270. package/node_modules/@agent-stack/contracts/dist/bots/recovery-errors.js +51 -0
  271. package/node_modules/@agent-stack/contracts/dist/bots/recovery-history.js +90 -0
  272. package/node_modules/@agent-stack/contracts/dist/bots/recovery-source.js +164 -0
  273. package/node_modules/@agent-stack/contracts/dist/bots/recovery-validation.js +160 -0
  274. package/node_modules/@agent-stack/contracts/dist/bots/recovery.js +13 -0
  275. package/node_modules/@agent-stack/contracts/dist/bots/relay.js +21 -0
  276. package/node_modules/@agent-stack/contracts/dist/bots/report-status.js +99 -0
  277. package/node_modules/@agent-stack/contracts/dist/bots/reports.js +8 -0
  278. package/node_modules/@agent-stack/contracts/dist/bots/restart-source.js +151 -0
  279. package/node_modules/@agent-stack/contracts/dist/bots/runtime-command.js +59 -0
  280. package/node_modules/@agent-stack/contracts/dist/bots/runtime-input.js +80 -0
  281. package/node_modules/@agent-stack/contracts/dist/bots/runtime-provider.js +12 -0
  282. package/node_modules/@agent-stack/contracts/dist/bots/runtime-settings.js +63 -0
  283. package/node_modules/@agent-stack/contracts/dist/bots/runtime-validation.js +35 -0
  284. package/node_modules/@agent-stack/contracts/dist/bots/runtime.js +1 -0
  285. package/node_modules/@agent-stack/contracts/dist/bots/same-native.js +44 -0
  286. package/node_modules/@agent-stack/contracts/dist/bots/service-restart.js +80 -0
  287. package/node_modules/@agent-stack/contracts/dist/bots/status.js +1 -0
  288. package/node_modules/@agent-stack/contracts/dist/bots/sync.js +1 -0
  289. package/node_modules/@agent-stack/contracts/dist/bots/targets.js +95 -0
  290. package/node_modules/@agent-stack/contracts/dist/bots/validation.js +82 -0
  291. package/node_modules/@agent-stack/contracts/dist/bots/versions.js +6 -0
  292. package/node_modules/@agent-stack/contracts/dist/bots/wake-hints.js +20 -0
  293. package/node_modules/@agent-stack/contracts/dist/bots/work-brief.js +120 -0
  294. package/node_modules/@agent-stack/contracts/dist/bots/work-control.js +47 -0
  295. package/node_modules/@agent-stack/contracts/dist/bots/work-events.js +38 -0
  296. package/node_modules/@agent-stack/contracts/dist/browser-chat-attachment.js +66 -0
  297. package/node_modules/@agent-stack/contracts/dist/business-outcomes.js +1 -0
  298. package/node_modules/@agent-stack/contracts/dist/chat-attachment.js +70 -0
  299. package/node_modules/@agent-stack/contracts/dist/chat-stream.js +105 -0
  300. package/node_modules/@agent-stack/contracts/dist/contracts/agent-ui.js +1 -0
  301. package/node_modules/@agent-stack/contracts/dist/contracts/base.js +6 -0
  302. package/node_modules/@agent-stack/contracts/dist/contracts/deployments.js +6 -0
  303. package/node_modules/@agent-stack/contracts/dist/contracts/index.js +8 -0
  304. package/node_modules/@agent-stack/contracts/dist/contracts/integrations.js +13 -0
  305. package/node_modules/@agent-stack/contracts/dist/contracts/knowledge.js +69 -0
  306. package/node_modules/@agent-stack/contracts/dist/contracts/live.js +56 -0
  307. package/node_modules/@agent-stack/contracts/dist/contracts/runtime.js +1 -0
  308. package/node_modules/@agent-stack/contracts/dist/contracts/workspace.js +9 -0
  309. package/node_modules/@agent-stack/contracts/dist/delivery-targets.js +139 -0
  310. package/node_modules/@agent-stack/contracts/dist/desktop-mcp.js +105 -0
  311. package/node_modules/@agent-stack/contracts/dist/employee-association.js +31 -0
  312. package/node_modules/@agent-stack/contracts/dist/event-links.js +1 -0
  313. package/node_modules/@agent-stack/contracts/dist/execution-oauth-callback.js +61 -0
  314. package/node_modules/@agent-stack/contracts/dist/host-page-context.js +156 -0
  315. package/node_modules/@agent-stack/contracts/dist/index.js +115 -0
  316. package/node_modules/@agent-stack/contracts/dist/installation-lifecycle.js +1 -0
  317. package/node_modules/@agent-stack/contracts/dist/installation-mcp.js +5 -0
  318. package/node_modules/@agent-stack/contracts/dist/installations.js +7 -0
  319. package/node_modules/@agent-stack/contracts/dist/integration-context.js +22 -0
  320. package/node_modules/@agent-stack/contracts/dist/integration-oauth.js +23 -0
  321. package/node_modules/@agent-stack/contracts/dist/integration-runtime.js +107 -0
  322. package/node_modules/@agent-stack/contracts/dist/interactive-run-wake.js +78 -0
  323. package/node_modules/@agent-stack/contracts/dist/interactive-work-acknowledgement.js +74 -0
  324. package/node_modules/@agent-stack/contracts/dist/interactive-work-events.js +131 -0
  325. package/node_modules/@agent-stack/contracts/dist/interactive-work-sources.js +142 -0
  326. package/node_modules/@agent-stack/contracts/dist/knowledge-attachment.js +50 -0
  327. package/node_modules/@agent-stack/contracts/dist/knowledge-catalog.js +94 -0
  328. package/node_modules/@agent-stack/contracts/dist/knowledge-organization.js +87 -0
  329. package/node_modules/@agent-stack/contracts/dist/live-audio.js +46 -0
  330. package/node_modules/@agent-stack/contracts/dist/live-business.js +1 -0
  331. package/node_modules/@agent-stack/contracts/dist/live-human.js +1 -0
  332. package/node_modules/@agent-stack/contracts/dist/live-transport.js +2 -0
  333. package/node_modules/@agent-stack/contracts/dist/mcp-directory.js +7 -0
  334. package/node_modules/@agent-stack/contracts/dist/mcp-refresh.js +1 -0
  335. package/node_modules/@agent-stack/contracts/dist/mcp-scopes.js +24 -0
  336. package/node_modules/@agent-stack/contracts/dist/native-studio-installation.js +1 -0
  337. package/node_modules/@agent-stack/contracts/dist/oauth-authorization.js +19 -0
  338. package/node_modules/@agent-stack/contracts/dist/platform-events.js +182 -0
  339. package/node_modules/@agent-stack/contracts/dist/reply-presentation.js +59 -0
  340. package/node_modules/@agent-stack/contracts/dist/reply.js +129 -0
  341. package/node_modules/@agent-stack/contracts/dist/request-body.js +38 -0
  342. package/node_modules/@agent-stack/contracts/dist/schedules.js +1 -0
  343. package/node_modules/@agent-stack/contracts/dist/task-work-events.js +107 -0
  344. package/node_modules/@agent-stack/contracts/dist/tasks.js +200 -0
  345. package/node_modules/@agent-stack/contracts/dist/templates.js +1 -0
  346. package/node_modules/@agent-stack/contracts/dist/tenant/access-schemas.js +149 -0
  347. package/node_modules/@agent-stack/contracts/dist/tenant/access-views.js +17 -0
  348. package/node_modules/@agent-stack/contracts/dist/tenant/access.js +132 -0
  349. package/node_modules/@agent-stack/contracts/dist/tenant/actions.js +173 -0
  350. package/node_modules/@agent-stack/contracts/dist/tenant/attachments.js +68 -0
  351. package/node_modules/@agent-stack/contracts/dist/tenant/authorization.js +160 -0
  352. package/node_modules/@agent-stack/contracts/dist/tenant/capabilities.js +98 -0
  353. package/node_modules/@agent-stack/contracts/dist/tenant/connections.js +31 -0
  354. package/node_modules/@agent-stack/contracts/dist/tenant/conversation-work-events.js +72 -0
  355. package/node_modules/@agent-stack/contracts/dist/tenant/conversation-work-schemas.js +136 -0
  356. package/node_modules/@agent-stack/contracts/dist/tenant/conversations.js +31 -0
  357. package/node_modules/@agent-stack/contracts/dist/tenant/deliveries.js +120 -0
  358. package/node_modules/@agent-stack/contracts/dist/tenant/delivery-views.js +38 -0
  359. package/node_modules/@agent-stack/contracts/dist/tenant/deployment-catalog.js +50 -0
  360. package/node_modules/@agent-stack/contracts/dist/tenant/descriptor.js +50 -0
  361. package/node_modules/@agent-stack/contracts/dist/tenant/events.js +39 -0
  362. package/node_modules/@agent-stack/contracts/dist/tenant/feedback.js +161 -0
  363. package/node_modules/@agent-stack/contracts/dist/tenant/guidance.js +284 -0
  364. package/node_modules/@agent-stack/contracts/dist/tenant/host-enrollment.js +51 -0
  365. package/node_modules/@agent-stack/contracts/dist/tenant/identity.js +31 -0
  366. package/node_modules/@agent-stack/contracts/dist/tenant/installation-schemas.js +350 -0
  367. package/node_modules/@agent-stack/contracts/dist/tenant/installation-views.js +69 -0
  368. package/node_modules/@agent-stack/contracts/dist/tenant/installations.js +217 -0
  369. package/node_modules/@agent-stack/contracts/dist/tenant/integration-configuration.js +96 -0
  370. package/node_modules/@agent-stack/contracts/dist/tenant/integration-oauth.js +85 -0
  371. package/node_modules/@agent-stack/contracts/dist/tenant/integrations.js +75 -0
  372. package/node_modules/@agent-stack/contracts/dist/tenant/json.js +96 -0
  373. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management-input.js +211 -0
  374. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management-results.js +145 -0
  375. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management-schemas.js +139 -0
  376. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-management.js +32 -0
  377. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-organization.js +96 -0
  378. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-program-input.js +111 -0
  379. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-program-results.js +234 -0
  380. package/node_modules/@agent-stack/contracts/dist/tenant/knowledge-programs.js +15 -0
  381. package/node_modules/@agent-stack/contracts/dist/tenant/live.js +63 -0
  382. package/node_modules/@agent-stack/contracts/dist/tenant/marketplace-schemas.js +110 -0
  383. package/node_modules/@agent-stack/contracts/dist/tenant/marketplaces.js +51 -0
  384. package/node_modules/@agent-stack/contracts/dist/tenant/mcp-directory.js +98 -0
  385. package/node_modules/@agent-stack/contracts/dist/tenant/native-operations.js +113 -0
  386. package/node_modules/@agent-stack/contracts/dist/tenant/operations.js +36 -0
  387. package/node_modules/@agent-stack/contracts/dist/tenant/outcome-schemas.js +121 -0
  388. package/node_modules/@agent-stack/contracts/dist/tenant/outcomes.js +87 -0
  389. package/node_modules/@agent-stack/contracts/dist/tenant/queries.js +24 -0
  390. package/node_modules/@agent-stack/contracts/dist/tenant/resource-views.js +463 -0
  391. package/node_modules/@agent-stack/contracts/dist/tenant/resources.js +1 -0
  392. package/node_modules/@agent-stack/contracts/dist/tenant/schedule-schemas.js +122 -0
  393. package/node_modules/@agent-stack/contracts/dist/tenant/schedule-views.js +22 -0
  394. package/node_modules/@agent-stack/contracts/dist/tenant/schedules.js +109 -0
  395. package/node_modules/@agent-stack/contracts/dist/tenant/schemas.js +117 -0
  396. package/node_modules/@agent-stack/contracts/dist/tenant/settings.js +34 -0
  397. package/node_modules/@agent-stack/contracts/dist/tenant/sse.js +58 -0
  398. package/node_modules/@agent-stack/contracts/dist/tenant/task-schemas.js +89 -0
  399. package/node_modules/@agent-stack/contracts/dist/tenant/task-views.js +34 -0
  400. package/node_modules/@agent-stack/contracts/dist/tenant/tasks.js +41 -0
  401. package/node_modules/@agent-stack/contracts/dist/tenant/tests.js +1 -0
  402. package/node_modules/@agent-stack/contracts/dist/tenant/transport.js +2 -0
  403. package/node_modules/@agent-stack/contracts/dist/tenant/usage.js +61 -0
  404. package/node_modules/@agent-stack/contracts/dist/tenant/views.js +52 -0
  405. package/node_modules/@agent-stack/contracts/dist/tenant/widgets.js +215 -0
  406. package/node_modules/@agent-stack/contracts/dist/tenant/work-changes.js +71 -0
  407. package/node_modules/@agent-stack/contracts/dist/tenant/work-materials.js +102 -0
  408. package/node_modules/@agent-stack/contracts/dist/tenant/workspace-resources.js +87 -0
  409. package/node_modules/@agent-stack/contracts/dist/widget-authorization.js +55 -0
  410. package/node_modules/@agent-stack/contracts/dist/widget-avatar.js +24 -0
  411. package/node_modules/@agent-stack/contracts/dist/widget-context.js +57 -0
  412. package/node_modules/@agent-stack/contracts/dist/widget-conversation.js +13 -0
  413. package/node_modules/@agent-stack/contracts/dist/widget-host-auth.js +142 -0
  414. package/node_modules/@agent-stack/contracts/dist/widget-origin.js +16 -0
  415. package/node_modules/@agent-stack/contracts/dist/widget-turn.js +84 -0
  416. package/node_modules/@agent-stack/contracts/package.json +8 -0
  417. package/node_modules/@agent-stack/runtime-contracts/dist/authority.js +64 -0
  418. package/node_modules/@agent-stack/runtime-contracts/dist/bot/bootstrap.js +81 -0
  419. package/node_modules/@agent-stack/runtime-contracts/dist/bot/codex-record.js +37 -0
  420. package/node_modules/@agent-stack/runtime-contracts/dist/bot/codex-target.js +56 -0
  421. package/node_modules/@agent-stack/runtime-contracts/dist/bot/conversation.js +1 -0
  422. package/node_modules/@agent-stack/runtime-contracts/dist/bot/index.js +7 -0
  423. package/node_modules/@agent-stack/runtime-contracts/dist/bot/process-identity.js +18 -0
  424. package/node_modules/@agent-stack/runtime-contracts/dist/bot/quarantine-material.js +9 -0
  425. package/node_modules/@agent-stack/runtime-contracts/dist/bot/recovery-inspection.js +103 -0
  426. package/node_modules/@agent-stack/runtime-contracts/dist/bot/service.js +3 -0
  427. package/node_modules/@agent-stack/runtime-contracts/dist/execution/index.js +7 -0
  428. package/node_modules/@agent-stack/runtime-contracts/dist/execution/json.js +169 -0
  429. package/node_modules/@agent-stack/runtime-contracts/dist/execution/observation.js +40 -0
  430. package/node_modules/@agent-stack/runtime-contracts/dist/execution/runtime.js +1 -0
  431. package/node_modules/@agent-stack/runtime-contracts/dist/execution/trace.js +1 -0
  432. package/node_modules/@agent-stack/runtime-contracts/dist/execution/types.js +32 -0
  433. package/node_modules/@agent-stack/runtime-contracts/dist/execution/wire.js +167 -0
  434. package/node_modules/@agent-stack/runtime-contracts/dist/execution/wire.schema.json +1 -0
  435. package/node_modules/@agent-stack/runtime-contracts/dist/index.js +31 -0
  436. package/node_modules/@agent-stack/runtime-contracts/dist/interactive-run-wake.js +190 -0
  437. package/node_modules/@agent-stack/runtime-contracts/dist/legacy.js +1 -0
  438. package/node_modules/@agent-stack/runtime-contracts/dist/mcp.js +53 -0
  439. package/node_modules/@agent-stack/runtime-contracts/dist/native-studio-connection.js +46 -0
  440. package/node_modules/@agent-stack/runtime-contracts/dist/native-studio-execution.js +100 -0
  441. package/node_modules/@agent-stack/runtime-contracts/dist/native-studio-registration.js +193 -0
  442. package/node_modules/@agent-stack/runtime-contracts/dist/oauth-context.js +38 -0
  443. package/node_modules/@agent-stack/runtime-contracts/dist/personal-mcp.js +1 -0
  444. package/node_modules/@agent-stack/runtime-contracts/dist/signing.js +1 -0
  445. package/node_modules/@agent-stack/runtime-contracts/dist/source-reply.js +153 -0
  446. package/node_modules/@agent-stack/runtime-contracts/dist/storage.js +1 -0
  447. package/node_modules/@agent-stack/runtime-contracts/dist/target-environment.js +45 -0
  448. package/node_modules/@agent-stack/runtime-contracts/dist/tenant-management.js +57 -0
  449. package/node_modules/@agent-stack/runtime-contracts/dist/tool-trace.js +1 -0
  450. package/node_modules/@agent-stack/runtime-contracts/package.json +13 -0
  451. package/node_modules/@agentims/adapter/dist/authority/binding.js +40 -0
  452. package/node_modules/@agentims/adapter/dist/delivery/coordinator.js +202 -0
  453. package/node_modules/@agentims/adapter/dist/delivery/decision.js +51 -0
  454. package/node_modules/@agentims/adapter/dist/delivery/record.js +24 -0
  455. package/node_modules/@agentims/adapter/dist/delivery/types.js +1 -0
  456. package/node_modules/@agentims/adapter/dist/errors.js +40 -0
  457. package/node_modules/@agentims/adapter/dist/index.js +5 -0
  458. package/node_modules/@agentims/adapter/dist/lifecycle/budget.js +30 -0
  459. package/node_modules/@agentims/adapter/dist/receipts/send.js +24 -0
  460. package/node_modules/@agentims/adapter/dist/source/event-source.js +153 -0
  461. package/node_modules/@agentims/adapter/dist/source/types.js +1 -0
  462. package/node_modules/@agentims/adapter/dist/status/adapter-status.js +46 -0
  463. package/node_modules/@agentims/adapter/package.json +10 -0
  464. package/node_modules/@agentims/runtime/dist/accounts/backup.js +39 -0
  465. package/node_modules/@agentims/runtime/dist/accounts/communication.js +14 -0
  466. package/node_modules/@agentims/runtime/dist/accounts/context.js +36 -0
  467. package/node_modules/@agentims/runtime/dist/accounts/credential-lifecycle.js +57 -0
  468. package/node_modules/@agentims/runtime/dist/accounts/errors.js +13 -0
  469. package/node_modules/@agentims/runtime/dist/accounts/login.js +32 -0
  470. package/node_modules/@agentims/runtime/dist/accounts/password.js +18 -0
  471. package/node_modules/@agentims/runtime/dist/accounts/register.js +30 -0
  472. package/node_modules/@agentims/runtime/dist/accounts/selection.js +93 -0
  473. package/node_modules/@agentims/runtime/dist/accounts/types.js +1 -0
  474. package/node_modules/@agentims/runtime/dist/authentication/intent.js +15 -0
  475. package/node_modules/@agentims/runtime/dist/authentication/journals.js +39 -0
  476. package/node_modules/@agentims/runtime/dist/authentication/methods.js +42 -0
  477. package/node_modules/@agentims/runtime/dist/authentication/selection.js +20 -0
  478. package/node_modules/@agentims/runtime/dist/authentication/status.js +42 -0
  479. package/node_modules/@agentims/runtime/dist/cli/account-commands.js +72 -0
  480. package/node_modules/@agentims/runtime/dist/cli/arguments.js +120 -0
  481. package/node_modules/@agentims/runtime/dist/cli/authentication.js +22 -0
  482. package/node_modules/@agentims/runtime/dist/cli/command-names.js +9 -0
  483. package/node_modules/@agentims/runtime/dist/cli/commands/account-authorization.js +12 -0
  484. package/node_modules/@agentims/runtime/dist/cli/commands/cache-inspection.js +8 -0
  485. package/node_modules/@agentims/runtime/dist/cli/commands/cache.js +14 -0
  486. package/node_modules/@agentims/runtime/dist/cli/commands/catalog.js +40 -0
  487. package/node_modules/@agentims/runtime/dist/cli/commands/contacts.js +5 -0
  488. package/node_modules/@agentims/runtime/dist/cli/commands/conversations.js +15 -0
  489. package/node_modules/@agentims/runtime/dist/cli/commands/definition.js +9 -0
  490. package/node_modules/@agentims/runtime/dist/cli/commands/deliveries-native.js +6 -0
  491. package/node_modules/@agentims/runtime/dist/cli/commands/deliveries.js +10 -0
  492. package/node_modules/@agentims/runtime/dist/cli/commands/devices-native.js +7 -0
  493. package/node_modules/@agentims/runtime/dist/cli/commands/discovery.js +4 -0
  494. package/node_modules/@agentims/runtime/dist/cli/commands/drafts.js +6 -0
  495. package/node_modules/@agentims/runtime/dist/cli/commands/encryption-dehydration.js +13 -0
  496. package/node_modules/@agentims/runtime/dist/cli/commands/encryption-native.js +9 -0
  497. package/node_modules/@agentims/runtime/dist/cli/commands/encryption-recovery.js +11 -0
  498. package/node_modules/@agentims/runtime/dist/cli/commands/encryption-reset.js +9 -0
  499. package/node_modules/@agentims/runtime/dist/cli/commands/encryption-secrets.js +9 -0
  500. package/node_modules/@agentims/runtime/dist/cli/commands/encryption.js +12 -0
  501. package/node_modules/@agentims/runtime/dist/cli/commands/identity.js +10 -0
  502. package/node_modules/@agentims/runtime/dist/cli/commands/location.js +7 -0
  503. package/node_modules/@agentims/runtime/dist/cli/commands/matrix-capabilities.js +38 -0
  504. package/node_modules/@agentims/runtime/dist/cli/commands/matrix-identity.js +12 -0
  505. package/node_modules/@agentims/runtime/dist/cli/commands/matrix-rooms.js +23 -0
  506. package/node_modules/@agentims/runtime/dist/cli/commands/media.js +12 -0
  507. package/node_modules/@agentims/runtime/dist/cli/commands/messages-native.js +8 -0
  508. package/node_modules/@agentims/runtime/dist/cli/commands/messages.js +10 -0
  509. package/node_modules/@agentims/runtime/dist/cli/commands/native-inspection.js +24 -0
  510. package/node_modules/@agentims/runtime/dist/cli/commands/native-preferences.js +11 -0
  511. package/node_modules/@agentims/runtime/dist/cli/commands/native-requests.js +6 -0
  512. package/node_modules/@agentims/runtime/dist/cli/commands/oauth.js +15 -0
  513. package/node_modules/@agentims/runtime/dist/cli/commands/outbox.js +10 -0
  514. package/node_modules/@agentims/runtime/dist/cli/commands/pairing.js +8 -0
  515. package/node_modules/@agentims/runtime/dist/cli/commands/profiles.js +6 -0
  516. package/node_modules/@agentims/runtime/dist/cli/commands/qr-authorization.js +6 -0
  517. package/node_modules/@agentims/runtime/dist/cli/commands/reliability.js +8 -0
  518. package/node_modules/@agentims/runtime/dist/cli/commands/room-management.js +17 -0
  519. package/node_modules/@agentims/runtime/dist/cli/commands/rtc.js +14 -0
  520. package/node_modules/@agentims/runtime/dist/cli/commands/search.js +11 -0
  521. package/node_modules/@agentims/runtime/dist/cli/commands/sync-qr.js +9 -0
  522. package/node_modules/@agentims/runtime/dist/cli/commands/timeline-native.js +10 -0
  523. package/node_modules/@agentims/runtime/dist/cli/commands/verification-native.js +7 -0
  524. package/node_modules/@agentims/runtime/dist/cli/errors.js +83 -0
  525. package/node_modules/@agentims/runtime/dist/cli/help.js +74 -0
  526. package/node_modules/@agentims/runtime/dist/cli/history-commands.js +13 -0
  527. package/node_modules/@agentims/runtime/dist/cli/input.js +82 -0
  528. package/node_modules/@agentims/runtime/dist/cli/main.js +19 -0
  529. package/node_modules/@agentims/runtime/dist/cli/output.js +71 -0
  530. package/node_modules/@agentims/runtime/dist/cli/password-input.js +36 -0
  531. package/node_modules/@agentims/runtime/dist/cli/run.js +90 -0
  532. package/node_modules/@agentims/runtime/dist/cli/update-commands.js +76 -0
  533. package/node_modules/@agentims/runtime/dist/configuration/account-credential.js +30 -0
  534. package/node_modules/@agentims/runtime/dist/configuration/connection-descriptor.js +18 -0
  535. package/node_modules/@agentims/runtime/dist/configuration/device-binding.js +41 -0
  536. package/node_modules/@agentims/runtime/dist/configuration/environment.js +43 -0
  537. package/node_modules/@agentims/runtime/dist/configuration/executable.js +49 -0
  538. package/node_modules/@agentims/runtime/dist/configuration/http.js +4 -0
  539. package/node_modules/@agentims/runtime/dist/configuration/native-settings.js +13 -0
  540. package/node_modules/@agentims/runtime/dist/configuration/node-version.js +8 -0
  541. package/node_modules/@agentims/runtime/dist/configuration/private-state.js +115 -0
  542. package/node_modules/@agentims/runtime/dist/configuration/service-origin.js +48 -0
  543. package/node_modules/@agentims/runtime/dist/configuration/windows-command.js +14 -0
  544. package/node_modules/@agentims/runtime/dist/configuration/windows-security.js +13 -0
  545. package/node_modules/@agentims/runtime/dist/history/backup.js +45 -0
  546. package/node_modules/@agentims/runtime/dist/history/online.js +48 -0
  547. package/node_modules/@agentims/runtime/dist/history/recovery-file.js +19 -0
  548. package/node_modules/@agentims/runtime/dist/history/restore.js +19 -0
  549. package/node_modules/@agentims/runtime/dist/index.js +31 -0
  550. package/node_modules/@agentims/runtime/dist/lifecycle/communication.js +66 -0
  551. package/node_modules/@agentims/runtime/dist/lifecycle/embedded.js +24 -0
  552. package/node_modules/@agentims/runtime/dist/lifecycle/foreground-connection.js +61 -0
  553. package/node_modules/@agentims/runtime/dist/lifecycle/foreground.js +47 -0
  554. package/node_modules/@agentims/runtime/dist/lifecycle/identity.js +46 -0
  555. package/node_modules/@agentims/runtime/dist/lifecycle/process-priority.js +22 -0
  556. package/node_modules/@agentims/runtime/dist/lifecycle/process.js +60 -0
  557. package/node_modules/@agentims/runtime/dist/lifecycle/shutdown-lease.js +90 -0
  558. package/node_modules/@agentims/runtime/dist/lifecycle/start.js +69 -0
  559. package/node_modules/@agentims/runtime/dist/managed/connection.js +29 -0
  560. package/node_modules/@agentims/runtime/dist/managed/control.js +134 -0
  561. package/node_modules/@agentims/runtime/dist/managed/directory.js +19 -0
  562. package/node_modules/@agentims/runtime/dist/managed/errors.js +9 -0
  563. package/node_modules/@agentims/runtime/dist/managed/lease.js +32 -0
  564. package/node_modules/@agentims/runtime/dist/managed/shutdown.js +63 -0
  565. package/node_modules/@agentims/runtime/dist/managed/state.js +82 -0
  566. package/node_modules/@agentims/runtime/dist/storage/archive.js +89 -0
  567. package/node_modules/@agentims/runtime/dist/supervision/command.js +13 -0
  568. package/node_modules/@agentims/runtime/dist/supervision/launchd.js +64 -0
  569. package/node_modules/@agentims/runtime/dist/supervision/select.js +13 -0
  570. package/node_modules/@agentims/runtime/dist/supervision/service.js +4 -0
  571. package/node_modules/@agentims/runtime/dist/supervision/systemd.js +34 -0
  572. package/node_modules/@agentims/runtime/dist/supervision/windows.js +20 -0
  573. package/node_modules/@agentims/runtime/dist/updates/activation.js +65 -0
  574. package/node_modules/@agentims/runtime/dist/updates/admission.js +15 -0
  575. package/node_modules/@agentims/runtime/dist/updates/archive.js +45 -0
  576. package/node_modules/@agentims/runtime/dist/updates/binding-preflight.js +25 -0
  577. package/node_modules/@agentims/runtime/dist/updates/continuity.js +45 -0
  578. package/node_modules/@agentims/runtime/dist/updates/device-archive.js +43 -0
  579. package/node_modules/@agentims/runtime/dist/updates/discovery.js +91 -0
  580. package/node_modules/@agentims/runtime/dist/updates/download.js +66 -0
  581. package/node_modules/@agentims/runtime/dist/updates/embedded.js +143 -0
  582. package/node_modules/@agentims/runtime/dist/updates/host-continuation.js +43 -0
  583. package/node_modules/@agentims/runtime/dist/updates/inspection-config.js +18 -0
  584. package/node_modules/@agentims/runtime/dist/updates/installation-integrity.js +35 -0
  585. package/node_modules/@agentims/runtime/dist/updates/installation.js +134 -0
  586. package/node_modules/@agentims/runtime/dist/updates/ledger.js +75 -0
  587. package/node_modules/@agentims/runtime/dist/updates/locking.js +17 -0
  588. package/node_modules/@agentims/runtime/dist/updates/managed.js +271 -0
  589. package/node_modules/@agentims/runtime/dist/updates/manifest.js +97 -0
  590. package/node_modules/@agentims/runtime/dist/updates/offline.js +56 -0
  591. package/node_modules/@agentims/runtime/dist/updates/owner.js +14 -0
  592. package/node_modules/@agentims/runtime/dist/updates/pending.js +20 -0
  593. package/node_modules/@agentims/runtime/dist/updates/policy.js +73 -0
  594. package/node_modules/@agentims/runtime/dist/updates/records.js +33 -0
  595. package/node_modules/@agentims/runtime/dist/updates/restart.js +80 -0
  596. package/node_modules/@agentims/runtime/dist/updates/shutdown-owner.js +74 -0
  597. package/node_modules/@agentims/runtime/dist/updates/shutdown-proof.js +35 -0
  598. package/node_modules/@agentims/runtime/dist/updates/types.js +16 -0
  599. package/node_modules/@agentims/runtime/dist/updates/version.js +40 -0
  600. package/node_modules/@agentims/runtime/dist/updates/watch.js +87 -0
  601. package/node_modules/@agentims/runtime/package.json +11 -0
  602. package/node_modules/@agentims/sdk/dist/api/client.js +15 -0
  603. package/node_modules/@agentims/sdk/dist/api/embedded-options.js +1 -0
  604. package/node_modules/@agentims/sdk/dist/api/embedded.js +28 -0
  605. package/node_modules/@agentims/sdk/dist/api/errors.js +43 -0
  606. package/node_modules/@agentims/sdk/dist/api/facade.js +92 -0
  607. package/node_modules/@agentims/sdk/dist/api/json-value.js +1 -0
  608. package/node_modules/@agentims/sdk/dist/api/options.js +1 -0
  609. package/node_modules/@agentims/sdk/dist/api/request-data.js +43 -0
  610. package/node_modules/@agentims/sdk/dist/api/sdk-info.js +9 -0
  611. package/node_modules/@agentims/sdk/dist/features/account/client.js +57 -0
  612. package/node_modules/@agentims/sdk/dist/features/account/index.js +1 -0
  613. package/node_modules/@agentims/sdk/dist/features/account/types.js +1 -0
  614. package/node_modules/@agentims/sdk/dist/features/cache/client.js +40 -0
  615. package/node_modules/@agentims/sdk/dist/features/cache/index.js +1 -0
  616. package/node_modules/@agentims/sdk/dist/features/cache/types.js +1 -0
  617. package/node_modules/@agentims/sdk/dist/features/configuration/index.js +1 -0
  618. package/node_modules/@agentims/sdk/dist/features/configuration/schema.js +8 -0
  619. package/node_modules/@agentims/sdk/dist/features/configuration/types.js +3 -0
  620. package/node_modules/@agentims/sdk/dist/features/contacts/client.js +12 -0
  621. package/node_modules/@agentims/sdk/dist/features/contacts/index.js +1 -0
  622. package/node_modules/@agentims/sdk/dist/features/contacts/types.js +3 -0
  623. package/node_modules/@agentims/sdk/dist/features/conversations/client.js +54 -0
  624. package/node_modules/@agentims/sdk/dist/features/conversations/index.js +1 -0
  625. package/node_modules/@agentims/sdk/dist/features/conversations/matrix.js +61 -0
  626. package/node_modules/@agentims/sdk/dist/features/conversations/types.js +1 -0
  627. package/node_modules/@agentims/sdk/dist/features/deliveries/client.js +41 -0
  628. package/node_modules/@agentims/sdk/dist/features/deliveries/index.js +1 -0
  629. package/node_modules/@agentims/sdk/dist/features/deliveries/types.js +1 -0
  630. package/node_modules/@agentims/sdk/dist/features/devices/client.js +36 -0
  631. package/node_modules/@agentims/sdk/dist/features/devices/index.js +1 -0
  632. package/node_modules/@agentims/sdk/dist/features/devices/types.js +1 -0
  633. package/node_modules/@agentims/sdk/dist/features/directory/client.js +36 -0
  634. package/node_modules/@agentims/sdk/dist/features/directory/index.js +1 -0
  635. package/node_modules/@agentims/sdk/dist/features/directory/types.js +3 -0
  636. package/node_modules/@agentims/sdk/dist/features/discovery/client.js +9 -0
  637. package/node_modules/@agentims/sdk/dist/features/discovery/index.js +1 -0
  638. package/node_modules/@agentims/sdk/dist/features/discovery/types.js +3 -0
  639. package/node_modules/@agentims/sdk/dist/features/drafts/client.js +16 -0
  640. package/node_modules/@agentims/sdk/dist/features/drafts/index.js +1 -0
  641. package/node_modules/@agentims/sdk/dist/features/drafts/types.js +3 -0
  642. package/node_modules/@agentims/sdk/dist/features/encryption/client.js +105 -0
  643. package/node_modules/@agentims/sdk/dist/features/encryption/dehydration.js +36 -0
  644. package/node_modules/@agentims/sdk/dist/features/encryption/index.js +1 -0
  645. package/node_modules/@agentims/sdk/dist/features/encryption/types.js +1 -0
  646. package/node_modules/@agentims/sdk/dist/features/events/client.js +45 -0
  647. package/node_modules/@agentims/sdk/dist/features/events/index.js +1 -0
  648. package/node_modules/@agentims/sdk/dist/features/events/types.js +1 -0
  649. package/node_modules/@agentims/sdk/dist/features/identity/client.js +77 -0
  650. package/node_modules/@agentims/sdk/dist/features/identity/index.js +1 -0
  651. package/node_modules/@agentims/sdk/dist/features/identity/types.js +1 -0
  652. package/node_modules/@agentims/sdk/dist/features/location/client.js +18 -0
  653. package/node_modules/@agentims/sdk/dist/features/location/index.js +1 -0
  654. package/node_modules/@agentims/sdk/dist/features/location/types.js +3 -0
  655. package/node_modules/@agentims/sdk/dist/features/media/client.js +34 -0
  656. package/node_modules/@agentims/sdk/dist/features/media/index.js +1 -0
  657. package/node_modules/@agentims/sdk/dist/features/media/types.js +1 -0
  658. package/node_modules/@agentims/sdk/dist/features/messages/client.js +43 -0
  659. package/node_modules/@agentims/sdk/dist/features/messages/index.js +1 -0
  660. package/node_modules/@agentims/sdk/dist/features/messages/types.js +3 -0
  661. package/node_modules/@agentims/sdk/dist/features/notifications/client.js +42 -0
  662. package/node_modules/@agentims/sdk/dist/features/notifications/index.js +1 -0
  663. package/node_modules/@agentims/sdk/dist/features/notifications/types.js +1 -0
  664. package/node_modules/@agentims/sdk/dist/features/oauth/client.js +52 -0
  665. package/node_modules/@agentims/sdk/dist/features/oauth/index.js +1 -0
  666. package/node_modules/@agentims/sdk/dist/features/oauth/types.js +1 -0
  667. package/node_modules/@agentims/sdk/dist/features/operations/client.js +16 -0
  668. package/node_modules/@agentims/sdk/dist/features/operations/index.js +1 -0
  669. package/node_modules/@agentims/sdk/dist/features/operations/types.js +1 -0
  670. package/node_modules/@agentims/sdk/dist/features/outbox/client.js +25 -0
  671. package/node_modules/@agentims/sdk/dist/features/outbox/index.js +1 -0
  672. package/node_modules/@agentims/sdk/dist/features/outbox/types.js +3 -0
  673. package/node_modules/@agentims/sdk/dist/features/pairing/client.js +48 -0
  674. package/node_modules/@agentims/sdk/dist/features/pairing/index.js +1 -0
  675. package/node_modules/@agentims/sdk/dist/features/pairing/types.js +3 -0
  676. package/node_modules/@agentims/sdk/dist/features/presence/client.js +15 -0
  677. package/node_modules/@agentims/sdk/dist/features/presence/index.js +1 -0
  678. package/node_modules/@agentims/sdk/dist/features/presence/types.js +3 -0
  679. package/node_modules/@agentims/sdk/dist/features/profiles/client.js +15 -0
  680. package/node_modules/@agentims/sdk/dist/features/profiles/index.js +1 -0
  681. package/node_modules/@agentims/sdk/dist/features/profiles/types.js +3 -0
  682. package/node_modules/@agentims/sdk/dist/features/reliability/client.js +32 -0
  683. package/node_modules/@agentims/sdk/dist/features/reliability/index.js +1 -0
  684. package/node_modules/@agentims/sdk/dist/features/reliability/observe.js +48 -0
  685. package/node_modules/@agentims/sdk/dist/features/reliability/types.js +3 -0
  686. package/node_modules/@agentims/sdk/dist/features/rooms/client.js +76 -0
  687. package/node_modules/@agentims/sdk/dist/features/rooms/index.js +1 -0
  688. package/node_modules/@agentims/sdk/dist/features/rooms/types.js +1 -0
  689. package/node_modules/@agentims/sdk/dist/features/rtc/client.js +39 -0
  690. package/node_modules/@agentims/sdk/dist/features/rtc/index.js +1 -0
  691. package/node_modules/@agentims/sdk/dist/features/rtc/types.js +1 -0
  692. package/node_modules/@agentims/sdk/dist/features/search/client.js +31 -0
  693. package/node_modules/@agentims/sdk/dist/features/search/index.js +1 -0
  694. package/node_modules/@agentims/sdk/dist/features/search/types.js +3 -0
  695. package/node_modules/@agentims/sdk/dist/features/sync/client.js +16 -0
  696. package/node_modules/@agentims/sdk/dist/features/sync/index.js +1 -0
  697. package/node_modules/@agentims/sdk/dist/features/sync/types.js +1 -0
  698. package/node_modules/@agentims/sdk/dist/features/timeline/client.js +27 -0
  699. package/node_modules/@agentims/sdk/dist/features/timeline/index.js +1 -0
  700. package/node_modules/@agentims/sdk/dist/features/timeline/types.js +3 -0
  701. package/node_modules/@agentims/sdk/dist/features/verification/client.js +33 -0
  702. package/node_modules/@agentims/sdk/dist/features/verification/index.js +1 -0
  703. package/node_modules/@agentims/sdk/dist/features/verification/types.js +3 -0
  704. package/node_modules/@agentims/sdk/dist/index.js +7 -0
  705. package/node_modules/@agentims/sdk/dist/internal/native/binding.js +85 -0
  706. package/node_modules/@agentims/sdk/dist/internal/native/platform-resource.js +15 -0
  707. package/node_modules/@agentims/sdk/dist/internal/native/secrets-export.js +27 -0
  708. package/node_modules/@agentims/sdk/dist/internal/native/transport.js +92 -0
  709. package/node_modules/@agentims/sdk/dist/internal/protocol/codec.js +69 -0
  710. package/node_modules/@agentims/sdk/dist/internal/protocol/input.js +38 -0
  711. package/node_modules/@agentims/sdk/dist/internal/protocol/native-settings.js +48 -0
  712. package/node_modules/@agentims/sdk/dist/internal/protocol/operations.json +1 -0
  713. package/node_modules/@agentims/sdk/dist/internal/protocol/registry.js +72 -0
  714. package/node_modules/@agentims/sdk/dist/internal/protocol/schema.js +133 -0
  715. package/node_modules/@agentims/sdk/dist/internal/transport/client.js +102 -0
  716. package/node_modules/@agentims/sdk/dist/internal/transport/error-diagnostics.js +50 -0
  717. package/node_modules/@agentims/sdk/dist/internal/transport/request.js +59 -0
  718. package/node_modules/@agentims/sdk/dist/internal/transport/response.js +94 -0
  719. package/node_modules/@agentims/sdk/dist/internal/transport/retry-after.js +21 -0
  720. package/node_modules/@agentims/sdk/dist/internal/transport/stream-diagnostics.js +19 -0
  721. package/node_modules/@agentims/sdk/dist/internal/transport/types.js +1 -0
  722. package/node_modules/@agentims/sdk/package.json +8 -0
  723. package/package.json +31 -4
  724. package/release.json +746 -0
@@ -0,0 +1,223 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import { chmodSync, closeSync, constants, existsSync, fstatSync, lstatSync, mkdtempSync, openSync, readFileSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync, } from 'node:fs';
3
+ import { join, resolve } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { deploymentSystem, privateDeploymentFile, privateDirectory, trustedAncestors, } from '../system.js';
6
+ import { macInstance, macJob, macLabel, macPlan, macPlanPath, macRoles, } from './plan.js';
7
+ const launchdir = '/Library/LaunchDaemons';
8
+ const launchctl = '/bin/launchctl';
9
+ const environment = { PATH: '/usr/bin:/bin:/usr/sbin:/sbin', UV_THREADPOOL_SIZE: '2' };
10
+ // Darwin 的 <sys/fcntl.h> 定义 O_EXLOCK,Node 未导出该平台标志。
11
+ const darwinExclusiveLock = 0x20;
12
+ function run(file, args) {
13
+ return execFileSync(file, args, {
14
+ encoding: 'utf8',
15
+ timeout: 10000,
16
+ stdio: ['ignore', 'pipe', 'ignore'],
17
+ });
18
+ }
19
+ /** 切换文件拥有者后运行固定交接入口,角色配置和回执仅走子进程私有流。 */
20
+ export function macRoleCommand(resources, uid, args, input) {
21
+ const gid = Number(run('/usr/bin/id', ['-g', String(uid)]).trim());
22
+ if (!uid || !Number.isSafeInteger(gid) || gid <= 0)
23
+ throw new Error('BOT_MACOS_HANDOFF_IDENTITY_INVALID');
24
+ const output = execFileSync(join(resources, 'bin/node'), ['--max-old-space-size=64', join(resources, 'host/dist/deployment/macos/handoff.js'), ...args], {
25
+ cwd: '/',
26
+ env: environment,
27
+ encoding: 'utf8',
28
+ timeout: 5000,
29
+ uid,
30
+ gid,
31
+ killSignal: 'SIGKILL',
32
+ maxBuffer: 128 * 1024,
33
+ stdio: [input === undefined ? 'ignore' : 'pipe', 'pipe', 'ignore'],
34
+ ...(input === undefined ? {} : { input: JSON.stringify(input) }),
35
+ });
36
+ return JSON.parse(output);
37
+ }
38
+ function loaded(label) {
39
+ try {
40
+ run(launchctl, ['print', 'system/' + label]);
41
+ return true;
42
+ }
43
+ catch {
44
+ return false;
45
+ }
46
+ }
47
+ /** 管理入口与计划内的可执行制品必须来自系统管理员持有的真实路径。 */
48
+ export function verifyManagedFile(path) {
49
+ const s = lstatSync(path);
50
+ if (!s.isFile() || s.uid !== 0 || s.mode & 0o022 || realpathSync(path) !== path)
51
+ throw new Error('BOT_MACOS_UNTRUSTED_FILE');
52
+ trustedAncestors(path, {
53
+ ...deploymentSystem,
54
+ metadata(name) {
55
+ const meta = deploymentSystem.metadata(name);
56
+ // macOS 的 /Applications 默认可由 admin 组维护,运行角色另外核对不属于 admin。
57
+ return name === '/Applications' && lstatSync(name).gid === 80
58
+ ? { ...meta, mode: meta.mode & ~0o020 }
59
+ : meta;
60
+ },
61
+ }, 0);
62
+ }
63
+ function fileFor(instance, role) {
64
+ return join(launchdir, macLabel(instance, role) + '.plist');
65
+ }
66
+ /** 管理员安装已经配置的本机角色,覆盖制品时保持原身份、底层数据和权限。 */
67
+ export function installMacServices(args) {
68
+ if (process.platform !== 'darwin' || process.getuid?.() !== 0 || args.length !== 2)
69
+ throw new Error('BOT_MACOS_SERVICE_ADMIN_REQUIRED');
70
+ const [action, value] = args;
71
+ const instance = macInstance(value);
72
+ if (action !== 'install' && action !== 'remove')
73
+ throw new Error('BOT_MACOS_SERVICE_REQUEST_INVALID');
74
+ return withMacPlanLock(instance, () => {
75
+ const plan = loadMacServicePlan(instance);
76
+ if (action === 'install')
77
+ installMacPlan(plan);
78
+ else
79
+ for (const role of [...macRoles].reverse())
80
+ remove(instance, role);
81
+ });
82
+ }
83
+ /** 只从系统配置目录读取实例,实例名必须与管理员的计划相同。 */
84
+ export function loadMacServicePlan(instance) {
85
+ const planFile = macPlanPath(instance);
86
+ trustedAncestors(planFile, deploymentSystem, 0);
87
+ const plan = macPlan(privateDeploymentFile(planFile));
88
+ if (plan.instance !== instance)
89
+ throw new Error('BOT_MACOS_SERVICE_REQUEST_INVALID');
90
+ return plan;
91
+ }
92
+ /** 安装和首次登录交接持同一把实例锁,使并发重试沿同一套 job。 */
93
+ export async function withMacPlanLock(instance, work) {
94
+ const lockPath = macPlanPath(instance) + '.lock';
95
+ trustedAncestors(lockPath, deploymentSystem, 0);
96
+ const lock = openSync(lockPath, constants.O_CREAT |
97
+ constants.O_RDWR |
98
+ constants.O_NOFOLLOW |
99
+ constants.O_NONBLOCK |
100
+ darwinExclusiveLock, 0o600);
101
+ try {
102
+ const info = fstatSync(lock);
103
+ if (!info.isFile() || info.uid !== deploymentSystem.uid || info.mode & 0o077)
104
+ throw new Error('BOT_MACOS_SERVICE_LOCK_INVALID');
105
+ return await work();
106
+ }
107
+ finally {
108
+ // 始终保留同一锁文件。进程退出时内核释放锁,重试不会被遗留文件挡住。
109
+ closeSync(lock);
110
+ }
111
+ }
112
+ function remove(instance, role) {
113
+ const file = fileFor(instance, role), label = macLabel(instance, role);
114
+ if (!existsSync(file))
115
+ return;
116
+ verifyManagedFile(file);
117
+ if (loaded(label))
118
+ run(launchctl, ['bootout', 'system/' + label]);
119
+ unlinkSync(file);
120
+ }
121
+ /** 只检查进程身份和私有路径元数据,管理员进程无需读取各角色配置内容。 */
122
+ export function verifyMacRole(profile) {
123
+ if (Number(run('/usr/bin/id', ['-u', profile.user]).trim()) !== profile.uid)
124
+ throw new Error('BOT_MACOS_ROLE_UID_MISMATCH');
125
+ if (run('/usr/bin/id', ['-G', profile.user]).trim().split(/\s+/).includes('80'))
126
+ throw new Error('BOT_MACOS_ROLE_ADMIN_FORBIDDEN');
127
+ privateDirectory(profile.root, deploymentSystem, profile.uid);
128
+ const config = lstatSync(profile.config);
129
+ if (!config.isFile() ||
130
+ config.uid !== profile.uid ||
131
+ config.mode & 0o077 ||
132
+ config.size > 65536 ||
133
+ realpathSync(profile.config) !== profile.config)
134
+ throw new Error('BOT_MACOS_ROLE_CONFIG_INVALID');
135
+ trustedAncestors(profile.config, deploymentSystem, profile.uid);
136
+ if (profile.entry)
137
+ verifyManagedFile(profile.entry);
138
+ }
139
+ /** 用同一套 LaunchDaemon 装配同步系统 jobs,保留已经运行且配置相同的原进程。 */
140
+ export function installMacPlan({ instance, profiles }) {
141
+ const resources = resolve(fileURLToPath(new URL('../../../../', import.meta.url)));
142
+ for (const name of [
143
+ 'bin/node',
144
+ 'bin/agentxgo-guard',
145
+ 'host/dist/main.js',
146
+ 'host/dist/deployment/macos/handoff.js',
147
+ ])
148
+ verifyManagedFile(join(resources, name));
149
+ const staging = mkdtempSync(join(launchdir, '.agentxgo-' + instance + '-'));
150
+ const touched = [];
151
+ try {
152
+ // 先校验每个角色和完整 plist,再切换指定实例。其它服务没有写入路径。
153
+ for (const role of macRoles) {
154
+ const profile = profiles[role];
155
+ if (!profile)
156
+ continue;
157
+ verifyMacRole(profile);
158
+ macRoleCommand(resources, profile.uid, ['read', profile.config]);
159
+ const label = macLabel(instance, role), staged = join(staging, label + '.plist');
160
+ const source = staged + '.json';
161
+ writeFileSync(source, JSON.stringify(macJob(resources, instance, role, profile)), {
162
+ mode: 0o600,
163
+ });
164
+ run('/usr/bin/plutil', ['-convert', 'xml1', '-o', staged, source]);
165
+ chmodSync(staged, 0o644);
166
+ run('/usr/bin/plutil', ['-lint', staged]);
167
+ }
168
+ for (const role of macRoles) {
169
+ if (!profiles[role])
170
+ continue;
171
+ const label = macLabel(instance, role), file = fileFor(instance, role);
172
+ const staged = join(staging, label + '.plist');
173
+ const wasRunning = loaded(label);
174
+ let previous;
175
+ if (existsSync(file)) {
176
+ verifyManagedFile(file);
177
+ previous = readFileSync(file);
178
+ if (previous.equals(readFileSync(staged))) {
179
+ if (!wasRunning) {
180
+ touched.push({ label, file, previous, wasRunning });
181
+ run(launchctl, ['bootstrap', 'system', file]);
182
+ }
183
+ continue;
184
+ }
185
+ }
186
+ else if (wasRunning)
187
+ throw new Error('BOT_MACOS_SERVICE_LABEL_IN_USE');
188
+ touched.push({ label, file, ...(previous ? { previous } : {}), wasRunning });
189
+ if (wasRunning)
190
+ run(launchctl, ['bootout', 'system/' + label]);
191
+ renameSync(staged, file);
192
+ run(launchctl, ['bootstrap', 'system', file]);
193
+ }
194
+ }
195
+ catch (error) {
196
+ // 某个 job 回退失败时仍要恢复本次触及的其他角色。保留原装配错误及回退错误。
197
+ const rollbackErrors = [];
198
+ for (const item of touched.reverse()) {
199
+ try {
200
+ if (loaded(item.label))
201
+ run(launchctl, ['bootout', 'system/' + item.label]);
202
+ if (item.previous) {
203
+ const backup = join(staging, item.label + '.previous');
204
+ writeFileSync(backup, item.previous, { mode: 0o644 });
205
+ renameSync(backup, item.file);
206
+ if (item.wasRunning)
207
+ run(launchctl, ['bootstrap', 'system', item.file]);
208
+ }
209
+ else if (existsSync(item.file))
210
+ unlinkSync(item.file);
211
+ }
212
+ catch (rollbackError) {
213
+ rollbackErrors.push(rollbackError);
214
+ }
215
+ }
216
+ if (rollbackErrors.length)
217
+ throw new AggregateError([error, ...rollbackErrors], 'BOT_MACOS_SERVICE_ROLLBACK_INCOMPLETE');
218
+ throw error;
219
+ }
220
+ finally {
221
+ rmSync(staging, { recursive: true });
222
+ }
223
+ }
@@ -0,0 +1,155 @@
1
+ import { isAbsolute, resolve, join } from 'node:path';
2
+ import { botInteger, botObject, botText } from '@agent-stack/contracts';
3
+ import { beneath, deploymentEndpoint } from '../config.js';
4
+ export const macosInstallRoot = '/Library/Application Support/AgentXGo/Bot Host';
5
+ export const macosConfigRoot = '/private/var/db/agentxgo-bot-host';
6
+ export const macRoles = ['background', 'interaction', 'reception', 'host'];
7
+ export function macInstance(value) {
8
+ const name = botText(value, 40);
9
+ if (!/^[a-z][a-z0-9-]{0,39}$/.test(name))
10
+ throw new Error('BOT_MACOS_INSTANCE_INVALID');
11
+ return name;
12
+ }
13
+ export function macPlanPath(instance) {
14
+ return join(macosConfigRoot, macInstance(instance) + '.json');
15
+ }
16
+ function absolute(value) {
17
+ const path = botText(value, 4096);
18
+ if (!isAbsolute(path) || resolve(path) !== path || path === '/' || /[\r\n\x00]/.test(path))
19
+ throw new Error('BOT_MACOS_PATH_INVALID');
20
+ return path;
21
+ }
22
+ /** 部署计划绑定专用 UID、私有数据与本机 Runtime 端点,文件不收录凭据。 */
23
+ export function macPlan(raw) {
24
+ const v = botObject(raw, ['instance', 'profiles']);
25
+ const roles = botObject(v.profiles, macRoles);
26
+ const profiles = {};
27
+ for (const role of macRoles) {
28
+ if (roles[role] === undefined)
29
+ continue;
30
+ const field = botObject(roles[role], [
31
+ 'user',
32
+ 'uid',
33
+ 'root',
34
+ 'config',
35
+ 'limits',
36
+ ...(role === 'host' ? [] : ['entry', 'url']),
37
+ ]);
38
+ const user = botText(field.user, 31);
39
+ const uid = botInteger(field.uid, 200);
40
+ const root = absolute(field.root);
41
+ const config = absolute(field.config);
42
+ if (!/^_agx[a-z0-9_]+$/.test(user) || root === config || !beneath(root, config))
43
+ throw new Error('BOT_MACOS_ROLE_INVALID');
44
+ profiles[role] = {
45
+ user,
46
+ uid,
47
+ root,
48
+ config,
49
+ ...(field.limits === undefined ? {} : { limits: macLimits(role, field.limits) }),
50
+ ...(role === 'host'
51
+ ? {}
52
+ : { entry: absolute(field.entry), url: deploymentEndpoint(field.url) }),
53
+ };
54
+ }
55
+ if (!profiles.host || !profiles.background || (profiles.interaction && profiles.reception))
56
+ throw new Error('BOT_MACOS_ROLE_REQUIRED');
57
+ const all = Object.values(profiles);
58
+ for (const profile of all) {
59
+ if (all.some((other) => (other !== profile &&
60
+ (other.uid === profile.uid ||
61
+ other.user === profile.user ||
62
+ beneath(other.root, profile.root) ||
63
+ (profile.url !== undefined && profile.url === other.url))) ||
64
+ (profile.entry !== undefined && beneath(other.root, profile.entry))))
65
+ throw new Error('BOT_MACOS_ROLE_OVERLAP');
66
+ }
67
+ return { instance: macInstance(v.instance), profiles };
68
+ }
69
+ /** macOS 部署可显式给角色更大的内存,进程、CPU 与时限仍沿原角色规则。 */
70
+ function macLimits(role, raw) {
71
+ const v = botObject(raw, ['rssMiB', 'processes', 'cpuSeconds', 'wallSeconds']);
72
+ const limits = {
73
+ rssMiB: botInteger(v.rssMiB, 64),
74
+ processes: botInteger(v.processes, 2),
75
+ cpuSeconds: botInteger(v.cpuSeconds, 1),
76
+ wallSeconds: botInteger(v.wallSeconds, 1),
77
+ };
78
+ const isHost = role === 'host';
79
+ if (limits.rssMiB > 2048 ||
80
+ limits.processes > (isHost ? 32 : 64) ||
81
+ limits.cpuSeconds > (isHost ? 43200 : 86400) ||
82
+ limits.wallSeconds > 86400)
83
+ throw new Error('BOT_MACOS_LIMIT_INVALID');
84
+ return limits;
85
+ }
86
+ export function macLabel(instance, role) {
87
+ return 'com.agentxgo.bot.' + macInstance(instance) + '.' + role;
88
+ }
89
+ /** 独立 Host 与自有用户域 Host 共享原已确认的 macOS 资源上限。 */
90
+ export const MAC_HOST_DEFAULT_LIMITS = Object.freeze({
91
+ rssMiB: 384,
92
+ processes: 32,
93
+ cpuSeconds: 43200,
94
+ wallSeconds: 86400,
95
+ });
96
+ /** 系统 LaunchDaemon 使用固定进程入口和数值限额,保留角色原数据根。 */
97
+ export function macJob(release, instance, role, profile) {
98
+ const isHost = role === 'host';
99
+ const limits = profile.limits ??
100
+ (isHost
101
+ ? MAC_HOST_DEFAULT_LIMITS
102
+ : { rssMiB: 1024, processes: 64, cpuSeconds: 86400, wallSeconds: 86400 });
103
+ const label = macLabel(instance, role);
104
+ const guard = join(release, 'bin/agentxgo-guard');
105
+ // 显式提高角色 RSS 后,V8 保留四分之一给原生库、缓冲区和年轻代。
106
+ const oldSpaceMiB = limits.rssMiB > (isHost ? MAC_HOST_DEFAULT_LIMITS.rssMiB : 1024)
107
+ ? Math.floor(limits.rssMiB * 0.75)
108
+ : isHost
109
+ ? 192
110
+ : 384;
111
+ // launchd 在角色身份下打开日志,使用同一专用私有数据根。
112
+ const stdout = join(profile.root, 'service');
113
+ return {
114
+ Label: label,
115
+ UserName: profile.user,
116
+ RunAtLoad: true,
117
+ KeepAlive: true,
118
+ AbandonProcessGroup: false,
119
+ ThrottleInterval: 15,
120
+ ExitTimeOut: 50,
121
+ ProcessType: 'Background',
122
+ LowPriorityIO: true,
123
+ Nice: 10,
124
+ Umask: 0o077,
125
+ WorkingDirectory: profile.root,
126
+ StandardOutPath: stdout + '.out.log',
127
+ StandardErrorPath: stdout + '.err.log',
128
+ EnvironmentVariables: {
129
+ HOME: profile.root,
130
+ PATH: '/usr/bin:/bin:/usr/sbin:/sbin',
131
+ UV_THREADPOOL_SIZE: '2',
132
+ AGENTXGO_MACOS_GUARD: guard,
133
+ ...(isHost
134
+ ? { BOT_HOST_CONFIG: profile.config, BOT_HOST_MACOS_INSTANCE: instance }
135
+ : { DSH_HEADLESS_CONFIG: profile.config, BOT_CONVERSATION_CONFIG: profile.config }),
136
+ },
137
+ ProgramArguments: [
138
+ guard,
139
+ 'run',
140
+ String(limits.rssMiB),
141
+ String(limits.processes),
142
+ String(limits.cpuSeconds),
143
+ String(limits.wallSeconds),
144
+ join(release, 'bin/node'),
145
+ '--max-old-space-size=' + oldSpaceMiB,
146
+ ...(isHost
147
+ ? [join(release, 'host/dist/main.js')]
148
+ : [
149
+ '--expose-internals',
150
+ '--env-file-if-exists=' + profile.config + '.env',
151
+ profile.entry,
152
+ ]),
153
+ ],
154
+ };
155
+ }
@@ -0,0 +1,24 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ /** macOS 用内核微秒级启动时刻区分 PID 的前后两次占用。 */
3
+ export function macProcessProof(raw, expectedUid, expectedStart) {
4
+ const fields = /^([1-9]\d*) ([1-9]\d*) ([1-9]\d*)\n$/.exec(raw);
5
+ const uid = Number(fields?.[1]);
6
+ const parent = Number(fields?.[2]);
7
+ const start = fields?.[3];
8
+ if (!start || uid !== expectedUid || parent <= 1 || (expectedStart && start !== expectedStart))
9
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_PROCESS_CHANGED');
10
+ return { uid, parent, start };
11
+ }
12
+ export function inspectMacProcess(guard, pid, uid, start) {
13
+ try {
14
+ return macProcessProof(execFileSync(guard, ['inspect', String(pid)], {
15
+ encoding: 'utf8',
16
+ timeout: 1500,
17
+ maxBuffer: 1024,
18
+ stdio: ['ignore', 'pipe', 'ignore'],
19
+ }), uid, start);
20
+ }
21
+ catch {
22
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_PROCESS_CHANGED');
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ import { loadHostConfig } from '../config.js';
2
+ import { loadProjectHostConfig } from '../preparation/config.js';
3
+ import { preflightHostDeployment } from './preflight.js';
4
+ import { privateDeploymentFile } from './system.js';
5
+ try {
6
+ const args = process.argv.slice(2);
7
+ if (args.length !== 4 || args[0] !== '--config' || args[2] !== '--manifest')
8
+ throw new Error('BOT_DEPLOYMENT_USAGE');
9
+ privateDeploymentFile(args[1]);
10
+ const config = loadProjectHostConfig(args[1]) ?? loadHostConfig(args[1]);
11
+ process.stdout.write(JSON.stringify(await preflightHostDeployment(args[3], config)) + '\n');
12
+ }
13
+ catch {
14
+ process.stderr.write('Bot deployment preflight failed; verify the private manifest, dedicated account and kernel limits.\n');
15
+ process.exitCode = 1;
16
+ }
@@ -0,0 +1,58 @@
1
+ // Kept local to avoid a dependency cycle with kernel resource checks.
2
+ function reject(reason) {
3
+ throw new Error('BOT_DEPLOYMENT_' + reason);
4
+ }
5
+ /** cgroup.procs contains direct members only; inspect the bounded inclusive subtree. */
6
+ export function checkProfileMembers(profile, system) {
7
+ const queue = [{ group: profile.cgroup, depth: 0 }], seen = new Set();
8
+ let groups = 0, live = 0, ownsHost = false;
9
+ for (let item = queue.shift(); item; item = queue.shift()) {
10
+ if (++groups > 128 || item.depth > 32)
11
+ reject('CGROUP_SCAN_LIMIT');
12
+ const path = '/sys/fs/cgroup' + item.group;
13
+ const control = system.metadata(path + '/cgroup.procs');
14
+ if (control.uid !== 0 || (control.mode & 0o022) !== 0 || control.symlink || !control.file)
15
+ reject('IMMUTABLE_KERNEL_LIMITS_REQUIRED');
16
+ const members = system
17
+ .read(path + '/cgroup.procs')
18
+ .trim()
19
+ .split(/\s+/)
20
+ .filter(Boolean);
21
+ for (const pid of new Set(members)) {
22
+ if (!/^[1-9]\d*$/.test(pid))
23
+ reject('LIVE_PROFILE_REQUIRED');
24
+ seen.add(pid);
25
+ if (seen.size > 128)
26
+ reject('LIVE_PROFILE_REQUIRED');
27
+ try {
28
+ const status = system.read('/proc/' + pid + '/status');
29
+ const ids = /^Uid:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s*$/m.exec(status);
30
+ if (!ids || ids.slice(1).some((id) => Number(id) !== profile.uid))
31
+ reject('PROCESS_UID_MISMATCH');
32
+ if (system.read('/proc/' + pid + '/cgroup').trim() !== '0::' + item.group)
33
+ reject('PROCESS_CGROUP_CHANGED');
34
+ live++;
35
+ if (Number(pid) === system.pid)
36
+ ownsHost = true;
37
+ }
38
+ catch (error) {
39
+ if (!(error instanceof Error && 'code' in error && error.code === 'ENOENT'))
40
+ throw error;
41
+ }
42
+ }
43
+ for (const name of system.entries(path)) {
44
+ if (!/^[A-Za-z0-9_.@:-]+$/.test(name) || name === '.' || name === '..')
45
+ reject('CGROUP_PATH_INVALID');
46
+ const meta = system.metadata(path + '/' + name);
47
+ if (meta.symlink)
48
+ reject('CGROUP_PATH_INVALID');
49
+ if (meta.directory) {
50
+ if (queue.length + groups >= 128)
51
+ reject('CGROUP_SCAN_LIMIT');
52
+ queue.push({ group: item.group + '/' + name, depth: item.depth + 1 });
53
+ }
54
+ }
55
+ }
56
+ if (!live || (profile.role === 'host' && !ownsHost))
57
+ reject('LIVE_PROFILE_REQUIRED');
58
+ }
@@ -0,0 +1,41 @@
1
+ import { dirname, isAbsolute } from 'node:path';
2
+ import { deploymentConfig, projectMode } from './config.js';
3
+ import { deploymentSystem, privateDeploymentFile, privateDirectory, } from './system.js';
4
+ import { kernelProfiles } from './kernel.js';
5
+ import { checkRuntimeEndpoints } from './runtime.js';
6
+ export function checkHostDeployment(raw, config, system = deploymentSystem) {
7
+ const manifest = deploymentConfig(raw, config);
8
+ for (const p of manifest.profiles)
9
+ privateDirectory(p.root, system, p.uid);
10
+ if (!projectMode(config))
11
+ privateDirectory(dirname(config.journalPath), system);
12
+ const limits = kernelProfiles(manifest.profiles, system);
13
+ return {
14
+ schemaVersion: 1,
15
+ status: 'PASS',
16
+ kind: 'LOCAL_DEPLOYMENT_PREFLIGHT',
17
+ provider: manifest.provider,
18
+ checkedAtMs: Date.now(),
19
+ kernel: 'cgroup-v2',
20
+ limits,
21
+ authorizesNativeResume: false,
22
+ businessAccepted: false,
23
+ };
24
+ }
25
+ /** 静态部署边界同步拒绝;动态身份检查只读,成功前不允许任何Native或业务派发。 */
26
+ export function hostDeploymentCheck(path, config) {
27
+ if (!isAbsolute(path))
28
+ throw new Error('BOT_DEPLOYMENT_ABSOLUTE_MANIFEST_REQUIRED');
29
+ const raw = privateDeploymentFile(path);
30
+ checkHostDeployment(raw, config);
31
+ // 静态权限/资源先严格验证;动态身份门可交给原Project周期等待,成功前不允许Native派发。
32
+ const manifest = deploymentConfig(raw, config);
33
+ return async () => {
34
+ await checkRuntimeEndpoints(manifest, config, deploymentSystem);
35
+ return { ...checkHostDeployment(raw, config), runtimeIdentity: 'VERIFIED' };
36
+ };
37
+ }
38
+ /** 手动预检仍返回完整一次性结果;只有Project长期服务选择沿原tick等待依赖。 */
39
+ export async function preflightHostDeployment(path, config) {
40
+ return hostDeploymentCheck(path, config)();
41
+ }
@@ -0,0 +1,18 @@
1
+ import { botOwnerProgress } from '@agent-stack/contracts';
2
+ /** Probe the formally published service after a crash; never change the pinned execution route. */
3
+ export async function recoveryDeploymentConfig(config, bridge) {
4
+ const preparation = config.automaticPreparation, policy = config.automaticRecovery;
5
+ if (!policy || !preparation)
6
+ return config;
7
+ const raw = await bridge.ownerProgress(config.project, preparation.executionId, config.bridgeCredential, policy.requestId);
8
+ if (!raw)
9
+ return config;
10
+ const p = botOwnerProgress(raw), c = p.owner.commit;
11
+ if (!p.owner.current ||
12
+ c.sourceExecutionId !== preparation.executionId ||
13
+ c.hostId !== config.hostId ||
14
+ c.admission.ticket.requestId !== policy.requestId ||
15
+ c.admission.ticket.source.manifest.installation.executionId !== preparation.executionId)
16
+ throw new Error('BOT_COLD_DEPLOYMENT_OWNER_MISMATCH');
17
+ return p.owner.publication ? { ...config, executionId: c.executionId } : config;
18
+ }
@@ -0,0 +1,114 @@
1
+ import { botObject, botInteger, isBotNativeVersion } from '@agent-stack/contracts';
2
+ import { botProcessStartTicks } from '@agent-stack/runtime-contracts';
3
+ import { beneath, projectMode } from './config.js';
4
+ import { processGroup, processUid } from './kernel.js';
5
+ async function boundedJson(response) {
6
+ const reader = response.body?.getReader();
7
+ let bytes = 0;
8
+ const parts = [];
9
+ try {
10
+ // 明确鉴权/重定向拒绝不能与依赖尚未就绪混为一类,更不能进入自动等待后越过身份门。
11
+ if (!response.ok)
12
+ throw new Error(`BOT_SERVICE_HTTP_${response.status}`);
13
+ if (!reader)
14
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_RESPONSE_INVALID');
15
+ for (let part = await reader.read(); !part.done; part = await reader.read()) {
16
+ bytes += part.value.byteLength;
17
+ if (bytes > 8192)
18
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_RESPONSE_LIMIT');
19
+ parts.push(part.value);
20
+ }
21
+ return JSON.parse(Buffer.concat(parts).toString('utf8'));
22
+ }
23
+ finally {
24
+ await reader?.cancel().catch(() => { });
25
+ }
26
+ }
27
+ /** Authenticated trusted-service report correlated against the local kernel, not socket attestation. */
28
+ export async function checkRuntimeEndpoints(manifest, config, system, request = fetch) {
29
+ const checks = [];
30
+ for (const profile of manifest.profiles.filter((p) => p.role !== 'host')) {
31
+ const background = profile.role === 'background';
32
+ const connection = projectMode(config)
33
+ ? background
34
+ ? config.backend
35
+ : config.reception
36
+ : background
37
+ ? { runtimeToken: config.runtimeToken }
38
+ : config.interaction;
39
+ const provider = !projectMode(config) && !background ? config.interaction.provider : manifest.provider;
40
+ const prefix = background
41
+ ? '/bot-runtime/v1'
42
+ : profile.role === 'reception'
43
+ ? '/bot-receptions'
44
+ : '/bot-conversations';
45
+ let raw;
46
+ try {
47
+ raw = await boundedJson(await request(new URL(prefix + '/identity', profile.url), {
48
+ method: 'GET',
49
+ redirect: 'error',
50
+ signal: AbortSignal.timeout(3000),
51
+ headers: {
52
+ [background ? 'x-agentsim-service-token' : 'x-bot-interaction-token']: connection.runtimeToken,
53
+ },
54
+ }));
55
+ }
56
+ catch (error) {
57
+ // 这里只有固定GET身份读取;运输暂断沿原控制面类别等待,不复用到任何未知写入。
58
+ if (error instanceof TypeError ||
59
+ (error instanceof DOMException && ['AbortError', 'TimeoutError'].includes(error.name)))
60
+ throw new Error('BOT_SERVICE_NETWORK_UNAVAILABLE');
61
+ throw error;
62
+ }
63
+ const identity = botObject(raw, [
64
+ 'schemaVersion',
65
+ 'provider',
66
+ 'nativeVersion',
67
+ 'role',
68
+ 'executionId',
69
+ 'runtimeOrigin',
70
+ 'pid',
71
+ 'uid',
72
+ 'startTicks',
73
+ ]);
74
+ if (identity.schemaVersion !== 1 ||
75
+ identity.provider !== provider ||
76
+ identity.role !== profile.role ||
77
+ // PID / uid / 起始时刻与角色继续核验;发行号不等于执行协议资格。
78
+ !isBotNativeVersion(identity.nativeVersion) ||
79
+ identity.uid !== profile.uid ||
80
+ typeof identity.startTicks !== 'string' ||
81
+ !/^[1-9]\d*$/.test(identity.startTicks))
82
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_IDENTITY_MISMATCH');
83
+ if (background) {
84
+ if (typeof identity.executionId !== 'string' ||
85
+ !identity.executionId ||
86
+ identity.runtimeOrigin !== undefined ||
87
+ (!projectMode(config) && identity.executionId !== config.executionId))
88
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_EXECUTION_MISMATCH');
89
+ }
90
+ else {
91
+ const expected = projectMode(config)
92
+ ? config.reception.runtimeOrigin
93
+ : config.interaction.runtimeOrigin;
94
+ if (identity.runtimeOrigin !== expected || identity.executionId !== undefined)
95
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_ORIGIN_MISMATCH');
96
+ }
97
+ const pid = botInteger(identity.pid, 1), ticks = identity.startTicks;
98
+ const check = () => checkRuntimeProcess(profile, pid, ticks, system);
99
+ check();
100
+ checks.push(check);
101
+ }
102
+ // Another endpoint's slow response cannot hide an earlier service restart or movement.
103
+ for (const check of checks)
104
+ check();
105
+ }
106
+ function checkRuntimeProcess(profile, pid, ticks, system) {
107
+ const path = '/proc/' + pid;
108
+ const start = botProcessStartTicks(system.read(path + '/stat'), pid);
109
+ processUid(system.read(path + '/status'), profile.uid);
110
+ if (!beneath(profile.cgroup, processGroup(system.read(path + '/cgroup'))) ||
111
+ start !== ticks ||
112
+ botProcessStartTicks(system.read(path + '/stat'), pid) !== ticks)
113
+ throw new Error('BOT_DEPLOYMENT_RUNTIME_PROCESS_CHANGED');
114
+ }