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,121 @@
1
+ import { constants } from 'node:fs';
2
+ import { createHash } from 'node:crypto';
3
+ import { CODEX_RECORD_CHUNK_BYTES, CODEX_RECORD_LINE_BYTES, } from '@agent-stack/runtime-contracts';
4
+ import { open, readlink } from 'node:fs/promises';
5
+ import { isAbsolute, join, relative, resolve, sep } from 'node:path';
6
+ const directoryFlags = constants.O_RDONLY | constants.O_DIRECTORY | constants.O_NOFOLLOW;
7
+ const recordFlags = constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK;
8
+ /** 专用账号可改写 Native 路径,控制端只沿固定的目录描述符读取原记录。 */
9
+ export async function openCodexTargetRecord(home, record, taskUid) {
10
+ const pathError = 'BOT_CODEX_TARGET_RECORD_PATH';
11
+ const rel = relative(home, record);
12
+ const sessionRel = relative(join(home, 'sessions'), record);
13
+ const homeParts = home.split(sep).slice(1);
14
+ const recordParts = rel.split(sep);
15
+ if (process.platform !== 'linux' ||
16
+ !Number.isSafeInteger(taskUid) ||
17
+ taskUid <= 0 ||
18
+ !isAbsolute(home) ||
19
+ !isAbsolute(record) ||
20
+ resolve(home) !== home ||
21
+ resolve(record) !== record ||
22
+ home === sep ||
23
+ record.length > 4096 ||
24
+ !record.endsWith('.jsonl') ||
25
+ isAbsolute(sessionRel) ||
26
+ sessionRel.startsWith('..') ||
27
+ !sessionRel ||
28
+ home.includes('\0') ||
29
+ record.includes('\0') ||
30
+ isAbsolute(rel) ||
31
+ rel === '..' ||
32
+ rel.startsWith('..' + sep) ||
33
+ homeParts.length + recordParts.length > 64)
34
+ throw new Error(pathError);
35
+ const dirs = [];
36
+ let file;
37
+ try {
38
+ let parent = await open(sep, directoryFlags);
39
+ dirs.push(parent);
40
+ const components = [...homeParts, ...recordParts.slice(0, -1)];
41
+ for (const [index, name] of components.entries()) {
42
+ // 从根逐级固定目录,包括配置根的祖先,拒绝任何中间符号链接。
43
+ parent = await open(`/proc/self/fd/${parent.fd}/${name}`, directoryFlags);
44
+ dirs.push(parent);
45
+ if (index >= homeParts.length - 1 && (await parent.stat()).uid !== taskUid)
46
+ throw new Error(pathError);
47
+ }
48
+ file = await open(`/proc/self/fd/${parent.fd}/${recordParts.at(-1)}`, recordFlags);
49
+ const stat = await file.stat();
50
+ if (!stat.isFile() ||
51
+ stat.uid !== taskUid ||
52
+ stat.nlink !== 1 ||
53
+ (await readlink(`/proc/self/fd/${file.fd}`)) !== record)
54
+ throw new Error(pathError);
55
+ return { path: record, file };
56
+ }
57
+ catch (cause) {
58
+ await file?.close().catch(() => undefined);
59
+ throw new Error(pathError, { cause });
60
+ }
61
+ finally {
62
+ await Promise.allSettled(dirs.map((dir) => dir.close()));
63
+ }
64
+ }
65
+ /** 同一固定描述符快照逐块发送,原文件只读,末帧证明完整长度与字节摘要。 */
66
+ export async function* streamCodexTargetRecord(home, path, uid, scope, headerOnly = false) {
67
+ const { file } = await openCodexTargetRecord(home, path, uid);
68
+ try {
69
+ const stat = await file.stat({ bigint: true });
70
+ let size = Number(stat.size);
71
+ // Skill 原头可含完整目录,沿既有单行预算、同一快照及末帧证明收尾。
72
+ if (headerOnly) {
73
+ const header = Buffer.alloc(CODEX_RECORD_LINE_BYTES), { bytesRead } = await file.read(header, 0, header.length, 0);
74
+ const end = header.subarray(0, bytesRead).indexOf(10);
75
+ if (end < 0)
76
+ throw new Error('BOT_CODEX_TARGET_RECORD_CAPACITY');
77
+ size = end + 1;
78
+ }
79
+ if (!Number.isSafeInteger(size) || size < 1)
80
+ throw new Error('BOT_CODEX_TARGET_RECORD_INVALID');
81
+ const identity = `${stat.dev}:${stat.ino}`, deadline = performance.now() + 30000;
82
+ const buffer = Buffer.alloc(CODEX_RECORD_CHUNK_BYTES), first = createHash('sha256');
83
+ yield { kind: 'record-start', ...scope, path, size, identity };
84
+ let offset = 0;
85
+ while (offset < size) {
86
+ if (performance.now() > deadline)
87
+ throw new Error('BOT_CODEX_TARGET_RECORD_TIMEOUT');
88
+ const { bytesRead } = await file.read(buffer, 0, Math.min(buffer.length, size - offset), offset);
89
+ if (!bytesRead)
90
+ throw new Error('BOT_CODEX_TARGET_RECORD_CHANGED');
91
+ const bytes = buffer.subarray(0, bytesRead);
92
+ first.update(bytes);
93
+ yield { kind: 'record-chunk', offset, data: bytes.toString('base64') };
94
+ offset += bytesRead;
95
+ }
96
+ // 再读固定长度前缀,只允许 Native 追加;中途改写不能生成混合记录证明。
97
+ const second = createHash('sha256');
98
+ offset = 0;
99
+ while (offset < size) {
100
+ if (performance.now() > deadline)
101
+ throw new Error('BOT_CODEX_TARGET_RECORD_TIMEOUT');
102
+ const { bytesRead } = await file.read(buffer, 0, Math.min(buffer.length, size - offset), offset);
103
+ if (!bytesRead)
104
+ throw new Error('BOT_CODEX_TARGET_RECORD_CHANGED');
105
+ second.update(buffer.subarray(0, bytesRead));
106
+ offset += bytesRead;
107
+ }
108
+ const current = await file.stat({ bigint: true }), sha256 = first.digest('hex');
109
+ if (current.size < stat.size ||
110
+ current.dev !== stat.dev ||
111
+ current.ino !== stat.ino ||
112
+ current.nlink !== 1n ||
113
+ second.digest('hex') !== sha256 ||
114
+ (await readlink(`/proc/self/fd/${file.fd}`)) !== path)
115
+ throw new Error('BOT_CODEX_TARGET_RECORD_CHANGED');
116
+ yield { kind: 'record-end', size, sha256 };
117
+ }
118
+ finally {
119
+ await file.close();
120
+ }
121
+ }
@@ -0,0 +1,2 @@
1
+ /** 历史 Codex 路径保留公开别名;真正的 UID/能力与 ELF 校验只保留一份。 */
2
+ export { prepareNativeTaskLaunch as prepareCodexTaskLaunch, verifyNativeTaskCredentials as verifyCodexTaskCredentials, } from '../role.js';
@@ -0,0 +1,2 @@
1
+ /** 历史命令接入复用同一原生 stdio/放行/整组回收实现。 */
2
+ export { serveNativeTargetStream as serveCodexTargetStream } from '../stream.js';
@@ -0,0 +1,73 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { canonicalBotJson, } from '@agent-stack/contracts';
3
+ /** 目标把原动作与 scope 先落盘,丢回执时只重读或重送相同终态。 */
4
+ export class CodexWindowReceipts {
5
+ journal;
6
+ call;
7
+ scopeRef;
8
+ constructor(scope, journal, call) {
9
+ this.journal = journal;
10
+ this.call = call;
11
+ this.scopeRef = createHash('sha256').update(scope).digest('hex');
12
+ }
13
+ begin(window) {
14
+ this.journal.saveNativeWindow({
15
+ scopeRef: this.scopeRef,
16
+ identity: window.identity,
17
+ process: window.process,
18
+ at: window.at,
19
+ receipt: null,
20
+ });
21
+ }
22
+ /** 只有监督者已确认只读且无后代,或原 scope 已空,才能结束窗口。 */
23
+ async settle(cancelled) {
24
+ const local = this.journal.nativeWindow();
25
+ if (!local)
26
+ return;
27
+ if (local.scopeRef !== this.scopeRef)
28
+ throw new Error('BOT_CODEX_WINDOW_SCOPE_MISMATCH');
29
+ const { identity, process, at } = local;
30
+ const status = () => this.call(identity.executionId, {
31
+ operation: 'target-status',
32
+ identity,
33
+ });
34
+ let receipt = local.receipt;
35
+ if (!receipt) {
36
+ receipt = {
37
+ identity,
38
+ process,
39
+ runnerId: process.startRef,
40
+ state: cancelled ? 'CANCELLED' : 'SUCCEEDED',
41
+ cancelRequested: cancelled,
42
+ createdAtMs: at,
43
+ updatedAtMs: Math.max(Date.now(), at),
44
+ outcome: cancelled
45
+ ? {
46
+ state: 'CANCELLED',
47
+ reason: 'CODEX_FULL_TARGET_STOPPED',
48
+ resultRef: identity.actionId,
49
+ }
50
+ : {
51
+ state: 'SUCCEEDED',
52
+ reason: 'CODEX_FULL_READ_ONLY_CONFIRMED',
53
+ resultRef: identity.actionId,
54
+ exitCode: 0,
55
+ },
56
+ };
57
+ this.journal.saveNativeWindow({ ...local, receipt });
58
+ }
59
+ if (this.journal.local?.fields(identity.actionId)) {
60
+ // 本地已完成物理排空即可结算;中心 ACK 由持久 outbox 独立接续。
61
+ this.journal.local.record(receipt);
62
+ this.journal.acknowledgeNativeWindow(receipt);
63
+ return;
64
+ }
65
+ const recorded = await this.call(identity.executionId, {
66
+ operation: 'record',
67
+ receipt,
68
+ }).catch(status);
69
+ if (canonicalBotJson(recorded.receipt) !== canonicalBotJson(receipt))
70
+ throw new Error('BOT_CODEX_FULL_RECEIPT_UNCONFIRMED');
71
+ this.journal.acknowledgeNativeWindow(receipt);
72
+ }
73
+ }
@@ -0,0 +1,56 @@
1
+ import { botObject, matchesBotCodexApprovalPolicy } from '@agent-stack/contracts';
2
+ // 固定 Native Bot 流仅开放已接线的协议,内部模型工具循环仍由 app-server 自己执行。
3
+ const methods = new Set([
4
+ 'initialize',
5
+ 'initialized',
6
+ 'account/read',
7
+ 'account/login/start',
8
+ 'account/login/cancel',
9
+ 'config/read',
10
+ 'model/list',
11
+ 'mcpServerStatus/list',
12
+ 'mcpServer/oauth/login',
13
+ 'skills/list',
14
+ 'skills/extraRoots/set',
15
+ 'skills/config/write',
16
+ 'thread/read',
17
+ 'thread/start',
18
+ 'thread/resume',
19
+ 'thread/fork',
20
+ 'thread/delete',
21
+ 'thread/settings/update',
22
+ 'thread/unsubscribe',
23
+ 'thread/turns/list',
24
+ 'thread/items/list',
25
+ 'thread/queue/list',
26
+ 'thread/queue/delete',
27
+ 'thread/goal/get',
28
+ 'thread/goal/set',
29
+ 'thread/goal/clear',
30
+ 'turn/start',
31
+ 'turn/steer',
32
+ 'turn/interrupt',
33
+ ]);
34
+ /** 独立进程和排队入口不借 Full 轮隐式获得权限。只有两种明确原生档可通过。 */
35
+ export function codexTargetPermission(raw) {
36
+ if (raw.method === undefined)
37
+ return { params: {}, full: false };
38
+ const method = raw.method;
39
+ if (typeof method !== 'string' || !methods.has(method))
40
+ throw new Error('BOT_CODEX_TARGET_METHOD_UNAVAILABLE');
41
+ const params = raw.params === undefined ? {} : botObject(raw.params);
42
+ const policy = params.sandboxPolicy === undefined ? undefined : botObject(params.sandboxPolicy);
43
+ const full = policy?.type === 'dangerFullAccess' && Object.keys(policy).length === 1;
44
+ const readOnly = policy?.type === 'readOnly' &&
45
+ policy.networkAccess === false &&
46
+ Object.keys(policy).every((key) => key === 'type' || key === 'networkAccess');
47
+ if (params.permissions != null ||
48
+ params.permissionProfile != null ||
49
+ (params.sandbox != null && params.sandbox !== 'read-only') ||
50
+ (policy && ((!full && !readOnly) || !matchesBotCodexApprovalPolicy(params.approvalPolicy))) ||
51
+ (['thread/start', 'thread/resume', 'thread/fork'].includes(method) &&
52
+ (params.sandbox !== 'read-only' || !matchesBotCodexApprovalPolicy(params.approvalPolicy))) ||
53
+ (method === 'turn/start' && !policy))
54
+ throw new Error('BOT_CODEX_FULL_TARGET_MISMATCH');
55
+ return { params, full };
56
+ }
@@ -0,0 +1,143 @@
1
+ import { rmdirSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { Readable } from 'node:stream';
4
+ import { BotTargetActionJournal } from '@agent-stack/bot-host-journal';
5
+ import { deploymentSystem, trustedAncestors } from '../../deployment/system.js';
6
+ import { assertTargetSupervisorLock } from '../main.js';
7
+ import { assertRecoveredTargetScopes, prepareTargetScope } from '../scope.js';
8
+ import { codexTargetConfig } from './config.js';
9
+ import { assertCodexTaskDirectories } from './directories.js';
10
+ import { prepareCodexTaskLaunch } from './role.js';
11
+ import { serveCodexTargetStream } from './stream.js';
12
+ import { codexTargetFailure } from './main.js';
13
+ import { CodexTargetAuthority } from './authority.js';
14
+ import { readCodexTargetCatalog } from './catalog.js';
15
+ import { NativeComputerGate } from '../../computer/native.js';
16
+ /** 监督端只管理本目标专用原生进程,启动前核对旧 cgroup 已停止。 */
17
+ async function run(path) {
18
+ const config = codexTargetConfig(path);
19
+ const nativeCatalogDigest = config.nativeCatalog
20
+ ? readCodexTargetCatalog(config.nativeCatalog)
21
+ : undefined;
22
+ assertTargetSupervisorLock(config.lockPath);
23
+ await new NativeComputerGate(config).available();
24
+ trustedAncestors(config.scopeRoot, deploymentSystem, 0);
25
+ await assertCodexTaskDirectories(config, config.role);
26
+ const launch = prepareCodexTaskLaunch(config.role, config.binary, config.workspaceRoot);
27
+ const id = 'codex-native';
28
+ assertRecoveredTargetScopes(config.cgroupRoot, [id], true);
29
+ try {
30
+ rmdirSync(join(config.cgroupRoot, 'action-' + id));
31
+ }
32
+ catch (error) {
33
+ if (!(error instanceof Error && 'code' in error && error.code === 'ENOENT'))
34
+ throw error;
35
+ }
36
+ const stop = new AbortController();
37
+ const journal = new BotTargetActionJournal(config.windowJournalPath, config.targetId);
38
+ const abort = () => stop.abort();
39
+ process.once('SIGTERM', abort);
40
+ process.once('SIGINT', abort);
41
+ let authority;
42
+ let scope, stopped = false;
43
+ try {
44
+ let processIdentity;
45
+ const frame = (value) => new Promise((resolve, reject) => {
46
+ process.stdout.write(JSON.stringify(value) + '\n', (error) => error ? reject(error) : resolve());
47
+ });
48
+ authority = new CodexTargetAuthority(config, () => processIdentity, stop, frame, async (expected) => {
49
+ if (!scope?.assertOnlyProcess)
50
+ throw new Error('BOT_CODEX_FULL_SCOPE_UNAVAILABLE');
51
+ await scope.assertOnlyProcess(expected.pid);
52
+ if (launch.verify(expected.pid).startRef !== expected.startRef)
53
+ throw new Error('BOT_CODEX_FULL_TARGET_MISMATCH');
54
+ }, journal, (remainingMs) => {
55
+ if (!scope?.watchLease)
56
+ throw new Error('BOT_CODEX_FULL_SCOPE_UNAVAILABLE');
57
+ return scope.watchLease(remainingMs);
58
+ });
59
+ // 原 scope 已确认无进程,必须结算上次窗口再允许创建新的 app-server。
60
+ await authority.closed();
61
+ scope = await prepareTargetScope(config.cgroupRoot, id, config.limits);
62
+ const stopReceipt = await serveCodexTargetStream({
63
+ scope,
64
+ launch,
65
+ cwd: config.workspaceRoot,
66
+ env: config.env,
67
+ args: [
68
+ ...config.args,
69
+ ...(config.nativeCatalog
70
+ ? [
71
+ '-c',
72
+ `model_catalog_json=${JSON.stringify(config.nativeCatalog)}`,
73
+ '-c',
74
+ 'agents.enabled=true',
75
+ '-c',
76
+ 'features.multi_agent=false',
77
+ '-c',
78
+ 'features.multi_agent_v2=false',
79
+ '--enable',
80
+ 'shell_tool',
81
+ ]
82
+ : []),
83
+ '--enable',
84
+ 'goals',
85
+ 'app-server',
86
+ '--stdio',
87
+ ],
88
+ lifetimeMs: config.lifetimeMs,
89
+ signal: stop.signal,
90
+ input: Readable.from(authority.input(process.stdin)),
91
+ output: process.stdout,
92
+ diagnostics: process.stderr,
93
+ observe: (bytes) => authority.observe(bytes),
94
+ onStopped: () => {
95
+ stopped = true;
96
+ },
97
+ ready: (identity) => {
98
+ processIdentity = identity;
99
+ return frame({
100
+ kind: 'codex-target-ready',
101
+ targetId: config.targetId,
102
+ workspaceRef: config.workspaceRef,
103
+ cwd: config.workspaceRoot,
104
+ stateHome: config.codexHome,
105
+ ...(nativeCatalogDigest ? { nativeCatalogDigest } : {}),
106
+ ...(config.localAuthority ? { localAuthority: config.localAuthority } : {}),
107
+ ...identity,
108
+ });
109
+ },
110
+ });
111
+ if (stopped)
112
+ await authority.closed();
113
+ // 仅在原 cgroup 和 app-server 管道均收尾后才发布停止回证。
114
+ if (processIdentity)
115
+ await frame({
116
+ kind: 'codex-target-stopped',
117
+ startRef: processIdentity.startRef,
118
+ ...stopReceipt,
119
+ });
120
+ }
121
+ finally {
122
+ try {
123
+ if (stopped)
124
+ await authority?.closed();
125
+ }
126
+ finally {
127
+ authority?.dispose();
128
+ await authority?.drainReports();
129
+ journal.close();
130
+ process.off('SIGTERM', abort);
131
+ process.off('SIGINT', abort);
132
+ process.stdin.destroy();
133
+ }
134
+ }
135
+ }
136
+ try {
137
+ if (!process.argv[2])
138
+ throw new Error('BOT_CODEX_TARGET_CONFIG_REQUIRED');
139
+ await run(process.argv[2]);
140
+ }
141
+ catch (error) {
142
+ codexTargetFailure(error);
143
+ }
@@ -0,0 +1,215 @@
1
+ import { lstatSync, realpathSync } from 'node:fs';
2
+ import { basename, dirname, isAbsolute, join, relative, sep } from 'node:path';
3
+ import { botId, botInteger, botObject, botText, botTargetLocalProfile, } from '@agent-stack/contracts';
4
+ import { prepareCodexTaskLaunch } from './codex/role.js';
5
+ import { targetSessionEnvironment, assertComputerIsolation } from './environment.js';
6
+ import { deploymentSystem, privateDeploymentFile, privateDirectory, trustedAncestors, } from '../deployment/system.js';
7
+ const absolute = (raw) => {
8
+ const path = botText(raw, 4096);
9
+ if (!isAbsolute(path) || path.includes('\0'))
10
+ throw new Error('BOT_TARGET_CONFIG_PATH_INVALID');
11
+ return path;
12
+ };
13
+ const directory = (raw) => {
14
+ const path = absolute(raw);
15
+ const stat = lstatSync(path);
16
+ if (!stat.isDirectory() || realpathSync(path) !== path)
17
+ throw new Error('BOT_TARGET_CONFIG_DIRECTORY_INVALID');
18
+ return path;
19
+ };
20
+ /** 执行账号需要穿过目标临时根的父目录,同时没有改写这些目录的权限。 */
21
+ function traversable(path, uid, gid) {
22
+ for (let current = path;; current = dirname(current)) {
23
+ const { mode, uid: owner, gid: group } = lstatSync(current);
24
+ if ((mode & (owner === uid ? 0o100 : group === gid ? 0o010 : 0o001)) === 0)
25
+ throw new Error('BOT_TARGET_CONFIG_SCRATCH_ACCESS_REQUIRED');
26
+ if (current === '/')
27
+ return;
28
+ }
29
+ }
30
+ /** 私有 FD4 入口仅加载三个叶子和零依赖公共环境模块,所有解析路径都由 Root 固定。 */
31
+ export function verifyNativeShellModules(entrypoint, system = deploymentSystem) {
32
+ const bot = dirname(entrypoint), dist = dirname(bot), root = dirname(dist);
33
+ if (basename(entrypoint) !== 'command-job-main.js' ||
34
+ basename(bot) !== 'bot' ||
35
+ basename(dist) !== 'dist')
36
+ throw new Error('BOT_CODEX_JOB_ENTRYPOINT_UNTRUSTED');
37
+ trustedAncestors(entrypoint, system, 0);
38
+ const verify = (path, optional = false) => {
39
+ try {
40
+ const info = system.metadata(path);
41
+ if (!info.file ||
42
+ info.uid !== 0 ||
43
+ (info.mode & 0o022) !== 0 ||
44
+ (info.mode & 0o004) === 0 ||
45
+ system.realpath(path) !== path)
46
+ throw new Error('BOT_CODEX_JOB_ENTRYPOINT_UNTRUSTED');
47
+ }
48
+ catch (error) {
49
+ if (!optional || error.code !== 'ENOENT')
50
+ throw error;
51
+ }
52
+ };
53
+ for (const path of [
54
+ entrypoint,
55
+ join(bot, 'command-job.js'),
56
+ join(bot, 'native-version.js'),
57
+ join(root, 'package.json'),
58
+ ])
59
+ verify(path);
60
+ for (const dir of [bot, dist])
61
+ verify(join(dir, 'package.json'), true);
62
+ // 禁止近层 node_modules 截获公开子路径,解析只能落在独立 bundle 的精确包内。
63
+ for (const dir of [bot, dist]) {
64
+ try {
65
+ system.metadata(join(dir, 'node_modules'));
66
+ throw new Error('BOT_CODEX_JOB_ENTRYPOINT_UNTRUSTED');
67
+ }
68
+ catch (error) {
69
+ if (error.code !== 'ENOENT')
70
+ throw error;
71
+ }
72
+ }
73
+ const shared = join(root, 'node_modules', '@agent-stack', 'runtime-contracts');
74
+ for (const path of [join(shared, 'package.json'), join(shared, 'target-environment.js')]) {
75
+ trustedAncestors(path, system, 0);
76
+ verify(path);
77
+ }
78
+ try {
79
+ const manifest = JSON.parse(system.read(join(shared, 'package.json')));
80
+ if (manifest.name !== '@agent-stack/runtime-contracts' ||
81
+ manifest.type !== 'module' ||
82
+ manifest.exports?.['./target-environment'] !== './target-environment.js')
83
+ throw new Error();
84
+ }
85
+ catch {
86
+ throw new Error('BOT_CODEX_JOB_ENTRYPOINT_UNTRUSTED');
87
+ }
88
+ }
89
+ /** 机器密钥只通过 TLS 或字面回环地址发送,配置不接受代理路径和 URL 内凭据。 */
90
+ function bridgeConfig(raw) {
91
+ if (raw === undefined)
92
+ throw new Error('BOT_TARGET_CONFIG_BRIDGE_REQUIRED');
93
+ const v = botObject(raw, ['url', 'project', 'runtimeToken', 'credential']);
94
+ const url = botText(v.url, 2048);
95
+ const parsed = /^https?:\/\/[^/?#@\\]+\/?$/i.test(url) && /^[!-~]+$/.test(url) ? URL.parse(url) : null;
96
+ if (!parsed || (parsed.protocol === 'http:' && !['127.0.0.1', '[::1]'].includes(parsed.hostname)))
97
+ throw new Error('BOT_TARGET_CONFIG_BRIDGE_URL_INVALID');
98
+ const { runtimeToken, credential } = v;
99
+ if (typeof runtimeToken !== 'string' ||
100
+ !/^[!-~]{32,512}$/.test(runtimeToken) ||
101
+ typeof credential !== 'string' ||
102
+ !/^agxk_[A-Za-z0-9_-]{43}$/.test(credential) ||
103
+ runtimeToken === credential)
104
+ throw new Error('BOT_TARGET_CONFIG_BRIDGE_CREDENTIAL_INVALID');
105
+ const project = botObject(v.project, ['tenantKey', 'workspaceKey', 'projectKey']);
106
+ return {
107
+ url,
108
+ project: {
109
+ tenantKey: botId(project.tenantKey),
110
+ workspaceKey: botId(project.workspaceKey),
111
+ projectKey: botId(project.projectKey),
112
+ },
113
+ runtimeToken,
114
+ credential,
115
+ };
116
+ }
117
+ /** 普通动作与原生监督入口读取同一份目标部署声明。 */
118
+ export function readTargetConfig(path) {
119
+ // 私有声明由多个角色共用;只在消费字段时解释身份、工作区与物理资源。
120
+ return botObject(privateDeploymentFile(absolute(path)));
121
+ }
122
+ /** 私有目标配置固定系统身份和机器资源;运行参数不能扩写这些部署值。 */
123
+ export function targetConfig(rawPath, v = readTargetConfig(rawPath)) {
124
+ const bridge = bridgeConfig(v.bridge);
125
+ const limits = botObject(v.limits, ['memoryBytes', 'cpuQuotaMicros', 'processCount']);
126
+ const journalPath = absolute(v.journalPath);
127
+ const journalRoot = dirname(journalPath);
128
+ privateDirectory(journalRoot, deploymentSystem);
129
+ const resultRoot = absolute(v.resultRoot), scratchRoot = directory(v.scratchRoot);
130
+ privateDirectory(resultRoot, deploymentSystem);
131
+ trustedAncestors(scratchRoot, deploymentSystem, deploymentSystem.uid);
132
+ const scratch = lstatSync(scratchRoot);
133
+ if (scratch.uid !== process.getuid?.() || (scratch.mode & 0o022) !== 0)
134
+ throw new Error('BOT_TARGET_CONFIG_SCRATCH_INVALID');
135
+ const workspaces = new Map(Object.entries(botObject(v.workspaces)).map(([key, value]) => [botId(key), directory(value)]));
136
+ const home = directory(v.home);
137
+ // 状态、输出和持久工作区不能位于任何可回收的暂存子路径。
138
+ const insideScratch = (root) => {
139
+ const within = relative(scratchRoot, root);
140
+ return within !== '..' && !within.startsWith('..' + sep) && !isAbsolute(within);
141
+ };
142
+ if ([home, journalRoot, resultRoot, ...workspaces.values()].some(insideScratch))
143
+ throw new Error('BOT_TARGET_CONFIG_SCRATCH_OVERLAP');
144
+ const maxConcurrent = botInteger(v.maxConcurrent, 1), maxRuntimeMs = botInteger(v.maxRuntimeMs, 1);
145
+ const outputLimit = botInteger(v.outputLimit, 1);
146
+ const localAuthority = v.localAuthority === undefined ? undefined : botTargetLocalProfile(v.localAuthority);
147
+ if (localAuthority &&
148
+ (localAuthority.targetId !== v.targetId ||
149
+ !workspaces.has(localAuthority.workspaceRef) ||
150
+ localAuthority.maxTimeoutMs > maxRuntimeMs))
151
+ throw new Error('BOT_TARGET_LOCAL_PROFILE_INVALID');
152
+ // 失败和取消默认留一天供复核,成功动作在已确认空闲后回收。
153
+ const scratchFailureRetentionMs = botInteger(v.scratchFailureRetentionMs ?? 86_400_000, 60_000);
154
+ const uid = botInteger(v.uid, 1), gid = botInteger(v.gid, 1);
155
+ const sessionEnvironment = targetSessionEnvironment(v.sessionEnvironment);
156
+ assertComputerIsolation(uid, sessionEnvironment);
157
+ traversable(scratchRoot, uid, gid);
158
+ const path = botText(v.path, 4096);
159
+ if (uid > 0x7fffffff ||
160
+ gid > 0x7fffffff ||
161
+ maxConcurrent > 64 ||
162
+ maxRuntimeMs > 2147483647 ||
163
+ outputLimit > 1048576 ||
164
+ scratchFailureRetentionMs > 30 * 86_400_000 ||
165
+ !workspaces.size ||
166
+ workspaces.size > 64 ||
167
+ path.split(':').some((item) => !isAbsolute(item)) ||
168
+ resultRoot === journalRoot ||
169
+ [...workspaces.values()].some((root) => root === journalRoot || root === resultRoot))
170
+ throw new Error('BOT_TARGET_CONFIG_LIMIT_INVALID');
171
+ let nativeShell;
172
+ if (v.nativeShell !== undefined) {
173
+ const job = botObject(v.nativeShell, ['entrypoint', 'binary']);
174
+ const entrypoint = absolute(job.entrypoint), binary = absolute(job.binary);
175
+ verifyNativeShellModules(entrypoint);
176
+ traversable(dirname(entrypoint), uid, gid);
177
+ const cwd = workspaces.values().next().value;
178
+ const node = realpathSync(process.execPath);
179
+ prepareCodexTaskLaunch({ uid, gid }, binary, cwd);
180
+ const launcher = prepareCodexTaskLaunch({ uid, gid }, node, cwd);
181
+ // setpriv 在可信闸门之前降到任务身份,之后启动的 Node、Native 和命令全部继承。
182
+ nativeShell = {
183
+ entrypoint,
184
+ binary,
185
+ node,
186
+ rolePrefix: [launcher.program, ...launcher.args.slice(0, -1)],
187
+ };
188
+ }
189
+ return {
190
+ targetId: botId(v.targetId),
191
+ journalPath,
192
+ resultRoot,
193
+ scratchRoot,
194
+ scratchFailureRetentionMs,
195
+ cgroupRoot: absolute(v.cgroupRoot),
196
+ lockPath: join(journalRoot, 'target-supervisor.lock'),
197
+ home,
198
+ path,
199
+ sessionEnvironment,
200
+ workspaces,
201
+ uid,
202
+ gid,
203
+ limits: {
204
+ memoryBytes: botInteger(limits.memoryBytes, 1),
205
+ cpuQuotaMicros: botInteger(limits.cpuQuotaMicros, 1),
206
+ processCount: botInteger(limits.processCount, 1),
207
+ },
208
+ maxConcurrent,
209
+ maxRuntimeMs,
210
+ outputLimit,
211
+ bridge,
212
+ ...(localAuthority ? { localAuthority } : {}),
213
+ ...(nativeShell ? { nativeShell } : {}),
214
+ };
215
+ }
@@ -0,0 +1,61 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ // 原 Host 入口保持兼容;公共校验只由零依赖公开子路径持有。
3
+ export { targetSessionEnvironment } from '@agent-stack/runtime-contracts/target-environment';
4
+ /** 本机 CDP 按内核 socket UID 隔离,加载目标前必须确认两种地址族的精确规则。 */
5
+ export function assertComputerIsolation(uid, environment, check = (program, args) => {
6
+ return execFileSync(program, args, {
7
+ env: { PATH: '/usr/sbin:/usr/bin:/bin' },
8
+ timeout: 3000,
9
+ encoding: 'utf8',
10
+ maxBuffer: 65536,
11
+ stdio: ['ignore', 'pipe', 'ignore'],
12
+ });
13
+ }) {
14
+ const raw = environment.AGENTXGO_CHROME_PORT;
15
+ if (raw === undefined)
16
+ return;
17
+ const port = Number(raw);
18
+ if (!/^[0-9]+$/.test(raw) ||
19
+ !Number.isSafeInteger(port) ||
20
+ port < 1024 ||
21
+ port > 65535 ||
22
+ environment.AGENT_BROWSER_CDP !== raw)
23
+ throw new Error('BOT_COMPUTER_CDP_CONFIG_INVALID');
24
+ try {
25
+ for (const [program, address] of [
26
+ ['/usr/sbin/iptables', '127.0.0.1/32'],
27
+ ['/usr/sbin/ip6tables', '::1/128'],
28
+ ]) {
29
+ // 专属链必须是首条无条件跳转,前置 ACCEPT 无法绕过本目标的拒绝规则。
30
+ const output = check(program, ['-S', 'OUTPUT'])
31
+ .split('\n')
32
+ .filter((line) => line.startsWith('-A OUTPUT '));
33
+ const chain = check(program, ['-S', 'AGENTXGO_COMPUTER'])
34
+ .split('\n')
35
+ .filter((line) => line.startsWith('-A '));
36
+ if (output[0] !== '-A OUTPUT -j AGENTXGO_COMPUTER' ||
37
+ chain.some((line) => !/ -j REJECT(?: --reject-with (?:icmp-port-unreachable|icmp6-port-unreachable|tcp-reset))?$/.test(line) || / (?:--goto|-g) /.test(line)))
38
+ throw new Error('BOT_COMPUTER_CDP_CHAIN_INVALID');
39
+ check(program, [
40
+ '-C',
41
+ 'AGENTXGO_COMPUTER',
42
+ '-p',
43
+ 'tcp',
44
+ '-d',
45
+ address,
46
+ '--dport',
47
+ raw,
48
+ '-m',
49
+ 'owner',
50
+ '!',
51
+ '--uid-owner',
52
+ String(uid),
53
+ '-j',
54
+ 'REJECT',
55
+ ]);
56
+ }
57
+ }
58
+ catch {
59
+ throw new Error('BOT_COMPUTER_CDP_ISOLATION_REQUIRED');
60
+ }
61
+ }