@xenosystem/agent-interface-host 0.1.25 → 0.1.27

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 (381) hide show
  1. package/dist/account/AccountIntegrationOperations.d.ts +11 -0
  2. package/dist/account/AccountIntegrationOperations.d.ts.map +1 -0
  3. package/dist/account/AccountIntegrationOperations.js +78 -0
  4. package/dist/account/AccountIntegrationOperations.js.map +1 -0
  5. package/dist/account/AccountOperations.d.ts +15 -0
  6. package/dist/account/AccountOperations.d.ts.map +1 -0
  7. package/dist/account/AccountOperations.js +129 -0
  8. package/dist/account/AccountOperations.js.map +1 -0
  9. package/dist/account/AccountWorkforceService.d.ts +44 -0
  10. package/dist/account/AccountWorkforceService.d.ts.map +1 -0
  11. package/dist/account/AccountWorkforceService.js +175 -0
  12. package/dist/account/AccountWorkforceService.js.map +1 -0
  13. package/dist/account/AccountWorkspaceService.d.ts +56 -0
  14. package/dist/account/AccountWorkspaceService.d.ts.map +1 -0
  15. package/dist/account/AccountWorkspaceService.js +424 -0
  16. package/dist/account/AccountWorkspaceService.js.map +1 -0
  17. package/dist/account/ConversationCollaborationClient.d.ts +71 -0
  18. package/dist/account/ConversationCollaborationClient.d.ts.map +1 -0
  19. package/dist/account/ConversationCollaborationClient.js +271 -0
  20. package/dist/account/ConversationCollaborationClient.js.map +1 -0
  21. package/dist/account/WorkforceResourceOperations.d.ts +42 -0
  22. package/dist/account/WorkforceResourceOperations.d.ts.map +1 -0
  23. package/dist/account/WorkforceResourceOperations.js +225 -0
  24. package/dist/account/WorkforceResourceOperations.js.map +1 -0
  25. package/dist/account/WorkspaceKeyOperations.d.ts +54 -0
  26. package/dist/account/WorkspaceKeyOperations.d.ts.map +1 -0
  27. package/dist/account/WorkspaceKeyOperations.js +284 -0
  28. package/dist/account/WorkspaceKeyOperations.js.map +1 -0
  29. package/dist/account/WorkspaceMembershipOperations.d.ts +28 -0
  30. package/dist/account/WorkspaceMembershipOperations.d.ts.map +1 -0
  31. package/dist/account/WorkspaceMembershipOperations.js +188 -0
  32. package/dist/account/WorkspaceMembershipOperations.js.map +1 -0
  33. package/dist/account/accountIntegrationState.d.ts +22 -0
  34. package/dist/account/accountIntegrationState.d.ts.map +1 -0
  35. package/dist/account/accountIntegrationState.js +26 -0
  36. package/dist/account/accountIntegrationState.js.map +1 -0
  37. package/dist/account/accountKeyOperationState.d.ts +31 -0
  38. package/dist/account/accountKeyOperationState.d.ts.map +1 -0
  39. package/dist/account/accountKeyOperationState.js +33 -0
  40. package/dist/account/accountKeyOperationState.js.map +1 -0
  41. package/dist/account/accountMembershipOperationState.d.ts +32 -0
  42. package/dist/account/accountMembershipOperationState.d.ts.map +1 -0
  43. package/dist/account/accountMembershipOperationState.js +67 -0
  44. package/dist/account/accountMembershipOperationState.js.map +1 -0
  45. package/dist/account/accountOperationState.d.ts +22 -0
  46. package/dist/account/accountOperationState.d.ts.map +1 -0
  47. package/dist/account/accountOperationState.js +25 -0
  48. package/dist/account/accountOperationState.js.map +1 -0
  49. package/dist/account/accountWorkerClient.d.ts +15 -0
  50. package/dist/account/accountWorkerClient.d.ts.map +1 -0
  51. package/dist/account/accountWorkerClient.js +251 -0
  52. package/dist/account/accountWorkerClient.js.map +1 -0
  53. package/dist/account/accountWorkerEntry.d.ts +2 -0
  54. package/dist/account/accountWorkerEntry.d.ts.map +1 -0
  55. package/dist/account/accountWorkerEntry.js +50 -0
  56. package/dist/account/accountWorkerEntry.js.map +1 -0
  57. package/dist/account/accountWorkerProtocol.d.ts +76 -0
  58. package/dist/account/accountWorkerProtocol.d.ts.map +1 -0
  59. package/dist/account/accountWorkerProtocol.js +44 -0
  60. package/dist/account/accountWorkerProtocol.js.map +1 -0
  61. package/dist/account/accountWorkerRuntime.d.ts +81 -0
  62. package/dist/account/accountWorkerRuntime.d.ts.map +1 -0
  63. package/dist/account/accountWorkerRuntime.js +172 -0
  64. package/dist/account/accountWorkerRuntime.js.map +1 -0
  65. package/dist/account/accountWorkforceOperationState.d.ts +141 -0
  66. package/dist/account/accountWorkforceOperationState.d.ts.map +1 -0
  67. package/dist/account/accountWorkforceOperationState.js +149 -0
  68. package/dist/account/accountWorkforceOperationState.js.map +1 -0
  69. package/dist/account/canonicalAccountPort.d.ts +473 -0
  70. package/dist/account/canonicalAccountPort.d.ts.map +1 -0
  71. package/dist/account/canonicalAccountPort.js +44 -0
  72. package/dist/account/canonicalAccountPort.js.map +1 -0
  73. package/dist/acp/AcpAgentRegistryService.d.ts.map +1 -1
  74. package/dist/acp/AcpAgentRegistryService.js +11 -1
  75. package/dist/acp/AcpAgentRegistryService.js.map +1 -1
  76. package/dist/acp/AcpAgentTurnExecutionAdapter.d.ts +27 -0
  77. package/dist/acp/AcpAgentTurnExecutionAdapter.d.ts.map +1 -1
  78. package/dist/acp/AcpAgentTurnExecutionAdapter.js +18 -0
  79. package/dist/acp/AcpAgentTurnExecutionAdapter.js.map +1 -1
  80. package/dist/acp/AcpProcessSupervisor.d.ts +10 -0
  81. package/dist/acp/AcpProcessSupervisor.d.ts.map +1 -1
  82. package/dist/acp/AcpProcessSupervisor.js +156 -1
  83. package/dist/acp/AcpProcessSupervisor.js.map +1 -1
  84. package/dist/acp/AcpProviderModelService.d.ts.map +1 -1
  85. package/dist/acp/AcpProviderModelService.js +2 -0
  86. package/dist/acp/AcpProviderModelService.js.map +1 -1
  87. package/dist/acp/AcpRuntimeEventMapper.d.ts +1 -1
  88. package/dist/acp/AcpRuntimeEventMapper.d.ts.map +1 -1
  89. package/dist/acp/AcpRuntimeEventMapper.js +64 -2
  90. package/dist/acp/AcpRuntimeEventMapper.js.map +1 -1
  91. package/dist/acp/AcpSessionService.d.ts +24 -0
  92. package/dist/acp/AcpSessionService.d.ts.map +1 -1
  93. package/dist/acp/AcpSessionService.js +150 -14
  94. package/dist/acp/AcpSessionService.js.map +1 -1
  95. package/dist/acp/acpMeasuredUsage.d.ts +15 -0
  96. package/dist/acp/acpMeasuredUsage.d.ts.map +1 -0
  97. package/dist/acp/acpMeasuredUsage.js +41 -0
  98. package/dist/acp/acpMeasuredUsage.js.map +1 -0
  99. package/dist/acp/acpTypes.d.ts +28 -2
  100. package/dist/acp/acpTypes.d.ts.map +1 -1
  101. package/dist/acp/acpTypes.js.map +1 -1
  102. package/dist/agent/permissionProfiles.d.ts +3 -0
  103. package/dist/agent/permissionProfiles.d.ts.map +1 -1
  104. package/dist/agent/permissionProfiles.js.map +1 -1
  105. package/dist/browser/BrowserAdmissionLedger.d.ts +37 -0
  106. package/dist/browser/BrowserAdmissionLedger.d.ts.map +1 -0
  107. package/dist/browser/BrowserAdmissionLedger.js +51 -0
  108. package/dist/browser/BrowserAdmissionLedger.js.map +1 -0
  109. package/dist/browser/BrowserAutomationHttpTransport.d.ts +81 -0
  110. package/dist/browser/BrowserAutomationHttpTransport.d.ts.map +1 -0
  111. package/dist/browser/BrowserAutomationHttpTransport.js +160 -0
  112. package/dist/browser/BrowserAutomationHttpTransport.js.map +1 -0
  113. package/dist/browser/BrowserScopeResolver.d.ts +31 -0
  114. package/dist/browser/BrowserScopeResolver.d.ts.map +1 -0
  115. package/dist/browser/BrowserScopeResolver.js +31 -0
  116. package/dist/browser/BrowserScopeResolver.js.map +1 -0
  117. package/dist/browser/OwnedBrowserCommandService.d.ts +43 -0
  118. package/dist/browser/OwnedBrowserCommandService.d.ts.map +1 -0
  119. package/dist/browser/OwnedBrowserCommandService.js +99 -0
  120. package/dist/browser/OwnedBrowserCommandService.js.map +1 -0
  121. package/dist/browser/OwnedBrowserSessionRegistry.d.ts +83 -0
  122. package/dist/browser/OwnedBrowserSessionRegistry.d.ts.map +1 -0
  123. package/dist/browser/OwnedBrowserSessionRegistry.js +268 -0
  124. package/dist/browser/OwnedBrowserSessionRegistry.js.map +1 -0
  125. package/dist/browser/OwnedBrowserSessionService.d.ts +10 -0
  126. package/dist/browser/OwnedBrowserSessionService.d.ts.map +1 -0
  127. package/dist/browser/OwnedBrowserSessionService.js +37 -0
  128. package/dist/browser/OwnedBrowserSessionService.js.map +1 -0
  129. package/dist/browser/browserFrame.d.ts +12 -0
  130. package/dist/browser/browserFrame.d.ts.map +1 -0
  131. package/dist/browser/browserFrame.js +21 -0
  132. package/dist/browser/browserFrame.js.map +1 -0
  133. package/dist/cli/CliControlPlaneService.d.ts +12 -1
  134. package/dist/cli/CliControlPlaneService.d.ts.map +1 -1
  135. package/dist/cli/CliControlPlaneService.js +164 -15
  136. package/dist/cli/CliControlPlaneService.js.map +1 -1
  137. package/dist/cli/CliRemoteAdmissionStore.d.ts +43 -0
  138. package/dist/cli/CliRemoteAdmissionStore.d.ts.map +1 -0
  139. package/dist/cli/CliRemoteAdmissionStore.js +56 -0
  140. package/dist/cli/CliRemoteAdmissionStore.js.map +1 -0
  141. package/dist/cli/CliSchedulingService.d.ts +19 -0
  142. package/dist/cli/CliSchedulingService.d.ts.map +1 -0
  143. package/dist/cli/CliSchedulingService.js +182 -0
  144. package/dist/cli/CliSchedulingService.js.map +1 -0
  145. package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.d.ts +3 -0
  146. package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.d.ts.map +1 -1
  147. package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.js +9 -3
  148. package/dist/cloud/XenoCloudAgentTurnExecutionAdapter.js.map +1 -1
  149. package/dist/codebase/CodebaseIntelligenceService.d.ts.map +1 -1
  150. package/dist/codebase/CodebaseIntelligenceService.js +9 -173
  151. package/dist/codebase/CodebaseIntelligenceService.js.map +1 -1
  152. package/dist/codebase/LanguageServerProcessManager.d.ts +2 -0
  153. package/dist/codebase/LanguageServerProcessManager.d.ts.map +1 -1
  154. package/dist/codebase/LanguageServerProcessManager.js +4 -0
  155. package/dist/codebase/LanguageServerProcessManager.js.map +1 -1
  156. package/dist/codebase/workspaceEdits.d.ts +7 -0
  157. package/dist/codebase/workspaceEdits.d.ts.map +1 -0
  158. package/dist/codebase/workspaceEdits.js +205 -0
  159. package/dist/codebase/workspaceEdits.js.map +1 -0
  160. package/dist/coordination/messages.d.ts +1 -1
  161. package/dist/coordination/messages.d.ts.map +1 -1
  162. package/dist/coordination/messages.js +3 -0
  163. package/dist/coordination/messages.js.map +1 -1
  164. package/dist/engineering/EngineeringWorkbenchService.d.ts +2 -2
  165. package/dist/engineering/EngineeringWorkbenchService.d.ts.map +1 -1
  166. package/dist/engineering/EngineeringWorkbenchService.js +40 -14
  167. package/dist/engineering/EngineeringWorkbenchService.js.map +1 -1
  168. package/dist/engineering/GitLandingArtifactSource.d.ts +55 -0
  169. package/dist/engineering/GitLandingArtifactSource.d.ts.map +1 -0
  170. package/dist/engineering/GitLandingArtifactSource.js +261 -0
  171. package/dist/engineering/GitLandingArtifactSource.js.map +1 -0
  172. package/dist/engineering/GitLandingAuthority.d.ts +148 -0
  173. package/dist/engineering/GitLandingAuthority.d.ts.map +1 -0
  174. package/dist/engineering/GitLandingAuthority.js +516 -0
  175. package/dist/engineering/GitLandingAuthority.js.map +1 -0
  176. package/dist/engineering/LandingService.d.ts +27 -75
  177. package/dist/engineering/LandingService.d.ts.map +1 -1
  178. package/dist/engineering/LandingService.js +169 -225
  179. package/dist/engineering/LandingService.js.map +1 -1
  180. package/dist/engineering/LandingServicePersistence.d.ts +20 -0
  181. package/dist/engineering/LandingServicePersistence.d.ts.map +1 -0
  182. package/dist/engineering/LandingServicePersistence.js +148 -0
  183. package/dist/engineering/LandingServicePersistence.js.map +1 -0
  184. package/dist/index.d.ts +198 -2
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +677 -35
  187. package/dist/index.js.map +1 -1
  188. package/dist/inference/AuxiliaryInferenceService.d.ts +23 -0
  189. package/dist/inference/AuxiliaryInferenceService.d.ts.map +1 -0
  190. package/dist/inference/AuxiliaryInferenceService.js +103 -0
  191. package/dist/inference/AuxiliaryInferenceService.js.map +1 -0
  192. package/dist/isolation/CommandExecution.d.ts +26 -3
  193. package/dist/isolation/CommandExecution.d.ts.map +1 -1
  194. package/dist/isolation/CommandExecution.js.map +1 -1
  195. package/dist/isolation/LocalCommandExecutor.d.ts +8 -1
  196. package/dist/isolation/LocalCommandExecutor.d.ts.map +1 -1
  197. package/dist/isolation/LocalCommandExecutor.js +92 -6
  198. package/dist/isolation/LocalCommandExecutor.js.map +1 -1
  199. package/dist/isolation/SandboxCommandExecutor.d.ts.map +1 -1
  200. package/dist/isolation/SandboxCommandExecutor.js +2 -0
  201. package/dist/isolation/SandboxCommandExecutor.js.map +1 -1
  202. package/dist/knowledge/WorkspaceKnowledgeService.d.ts +7 -2
  203. package/dist/knowledge/WorkspaceKnowledgeService.d.ts.map +1 -1
  204. package/dist/knowledge/WorkspaceKnowledgeService.js +91 -40
  205. package/dist/knowledge/WorkspaceKnowledgeService.js.map +1 -1
  206. package/dist/lease/ProcessLivenessProber.d.ts +10 -8
  207. package/dist/lease/ProcessLivenessProber.d.ts.map +1 -1
  208. package/dist/lease/ProcessLivenessProber.js +36 -51
  209. package/dist/lease/ProcessLivenessProber.js.map +1 -1
  210. package/dist/lease/ProviderWriterLeaseService.d.ts +1 -1
  211. package/dist/lease/ProviderWriterLeaseService.d.ts.map +1 -1
  212. package/dist/lease/ProviderWriterLeaseService.js +2 -2
  213. package/dist/lease/ProviderWriterLeaseService.js.map +1 -1
  214. package/dist/lease/localLeaseMutex.d.ts +5 -0
  215. package/dist/lease/localLeaseMutex.d.ts.map +1 -0
  216. package/dist/lease/localLeaseMutex.js +64 -0
  217. package/dist/lease/localLeaseMutex.js.map +1 -0
  218. package/dist/localHostLease.d.ts +5 -19
  219. package/dist/localHostLease.d.ts.map +1 -1
  220. package/dist/localHostLease.js +126 -125
  221. package/dist/localHostLease.js.map +1 -1
  222. package/dist/localRpcTransport.d.ts +1 -0
  223. package/dist/localRpcTransport.d.ts.map +1 -1
  224. package/dist/localRpcTransport.js +52 -11
  225. package/dist/localRpcTransport.js.map +1 -1
  226. package/dist/node.d.ts +28 -0
  227. package/dist/node.d.ts.map +1 -1
  228. package/dist/node.js +26 -0
  229. package/dist/node.js.map +1 -1
  230. package/dist/notifications/WorkspaceNotificationService.d.ts +74 -0
  231. package/dist/notifications/WorkspaceNotificationService.d.ts.map +1 -0
  232. package/dist/notifications/WorkspaceNotificationService.js +480 -0
  233. package/dist/notifications/WorkspaceNotificationService.js.map +1 -0
  234. package/dist/notifications/notificationDestinationOperationState.d.ts +19 -0
  235. package/dist/notifications/notificationDestinationOperationState.d.ts.map +1 -0
  236. package/dist/notifications/notificationDestinationOperationState.js +58 -0
  237. package/dist/notifications/notificationDestinationOperationState.js.map +1 -0
  238. package/dist/provider/ProviderLaneService.d.ts +2 -0
  239. package/dist/provider/ProviderLaneService.d.ts.map +1 -1
  240. package/dist/provider/ProviderLaneService.js +19 -4
  241. package/dist/provider/ProviderLaneService.js.map +1 -1
  242. package/dist/sdk/SdkExecutionSettlementRegistry.d.ts +43 -0
  243. package/dist/sdk/SdkExecutionSettlementRegistry.d.ts.map +1 -0
  244. package/dist/sdk/SdkExecutionSettlementRegistry.js +88 -0
  245. package/dist/sdk/SdkExecutionSettlementRegistry.js.map +1 -0
  246. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.d.ts +21 -1
  247. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.d.ts.map +1 -1
  248. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.js +18 -4
  249. package/dist/sdk/SdkNativeAgentTurnExecutionAdapter.js.map +1 -1
  250. package/dist/state/JsonAgentStateRepository.d.ts.map +1 -1
  251. package/dist/state/JsonAgentStateRepository.js +24 -1
  252. package/dist/state/JsonAgentStateRepository.js.map +1 -1
  253. package/dist/state/ScopedAuditService.d.ts +9 -0
  254. package/dist/state/ScopedAuditService.d.ts.map +1 -0
  255. package/dist/state/ScopedAuditService.js +137 -0
  256. package/dist/state/ScopedAuditService.js.map +1 -0
  257. package/dist/state/ScopedBackupService.d.ts +26 -0
  258. package/dist/state/ScopedBackupService.d.ts.map +1 -0
  259. package/dist/state/ScopedBackupService.js +203 -0
  260. package/dist/state/ScopedBackupService.js.map +1 -0
  261. package/dist/state/ScopedUsageService.d.ts +9 -0
  262. package/dist/state/ScopedUsageService.d.ts.map +1 -0
  263. package/dist/state/ScopedUsageService.js +171 -0
  264. package/dist/state/ScopedUsageService.js.map +1 -0
  265. package/dist/state/SqliteAgentStateRepository.d.ts +132 -0
  266. package/dist/state/SqliteAgentStateRepository.d.ts.map +1 -1
  267. package/dist/state/SqliteAgentStateRepository.js +976 -19
  268. package/dist/state/SqliteAgentStateRepository.js.map +1 -1
  269. package/dist/state/SqliteWorkspaceKnowledgeStore.d.ts +19 -0
  270. package/dist/state/SqliteWorkspaceKnowledgeStore.d.ts.map +1 -0
  271. package/dist/state/SqliteWorkspaceKnowledgeStore.js +29 -0
  272. package/dist/state/SqliteWorkspaceKnowledgeStore.js.map +1 -0
  273. package/dist/state/WorkspaceEnvironmentService.d.ts +24 -0
  274. package/dist/state/WorkspaceEnvironmentService.d.ts.map +1 -0
  275. package/dist/state/WorkspaceEnvironmentService.js +150 -0
  276. package/dist/state/WorkspaceEnvironmentService.js.map +1 -0
  277. package/dist/state/WorkspaceLifecycleService.d.ts +10 -0
  278. package/dist/state/WorkspaceLifecycleService.d.ts.map +1 -0
  279. package/dist/state/WorkspaceLifecycleService.js +28 -0
  280. package/dist/state/WorkspaceLifecycleService.js.map +1 -0
  281. package/dist/state/WorkspaceRulesService.d.ts +36 -0
  282. package/dist/state/WorkspaceRulesService.d.ts.map +1 -0
  283. package/dist/state/WorkspaceRulesService.js +135 -0
  284. package/dist/state/WorkspaceRulesService.js.map +1 -0
  285. package/dist/state/scopedBackupProjection.d.ts +21 -0
  286. package/dist/state/scopedBackupProjection.d.ts.map +1 -0
  287. package/dist/state/scopedBackupProjection.js +102 -0
  288. package/dist/state/scopedBackupProjection.js.map +1 -0
  289. package/dist/state/sdkProtectedStateCipher.d.ts +1 -0
  290. package/dist/state/sdkProtectedStateCipher.d.ts.map +1 -1
  291. package/dist/state/sdkProtectedStateCipher.js +9 -3
  292. package/dist/state/sdkProtectedStateCipher.js.map +1 -1
  293. package/dist/state/sqliteContention.d.ts +5 -0
  294. package/dist/state/sqliteContention.d.ts.map +1 -0
  295. package/dist/state/sqliteContention.js +21 -0
  296. package/dist/state/sqliteContention.js.map +1 -0
  297. package/dist/state/stateSanitizers.d.ts.map +1 -1
  298. package/dist/state/stateSanitizers.js +22 -20
  299. package/dist/state/stateSanitizers.js.map +1 -1
  300. package/dist/state/workspaceAdmission.d.ts +31 -0
  301. package/dist/state/workspaceAdmission.d.ts.map +1 -0
  302. package/dist/state/workspaceAdmission.js +27 -0
  303. package/dist/state/workspaceAdmission.js.map +1 -0
  304. package/dist/state/workspaceCoordinationFence.d.ts +26 -0
  305. package/dist/state/workspaceCoordinationFence.d.ts.map +1 -0
  306. package/dist/state/workspaceCoordinationFence.js +56 -0
  307. package/dist/state/workspaceCoordinationFence.js.map +1 -0
  308. package/dist/state/workspaceEnvironmentProjection.d.ts +3 -0
  309. package/dist/state/workspaceEnvironmentProjection.d.ts.map +1 -0
  310. package/dist/state/workspaceEnvironmentProjection.js +27 -0
  311. package/dist/state/workspaceEnvironmentProjection.js.map +1 -0
  312. package/dist/state/workspaceLifecycle.d.ts +29 -0
  313. package/dist/state/workspaceLifecycle.d.ts.map +1 -0
  314. package/dist/state/workspaceLifecycle.js +129 -0
  315. package/dist/state/workspaceLifecycle.js.map +1 -0
  316. package/dist/subagents/CliSubagentExecutionAdapter.d.ts +1 -0
  317. package/dist/subagents/CliSubagentExecutionAdapter.d.ts.map +1 -1
  318. package/dist/subagents/CliSubagentExecutionAdapter.js +74 -19
  319. package/dist/subagents/CliSubagentExecutionAdapter.js.map +1 -1
  320. package/dist/subagents/CliSubagentRecoveryAdapter.d.ts +9 -0
  321. package/dist/subagents/CliSubagentRecoveryAdapter.d.ts.map +1 -0
  322. package/dist/subagents/CliSubagentRecoveryAdapter.js +31 -0
  323. package/dist/subagents/CliSubagentRecoveryAdapter.js.map +1 -0
  324. package/dist/subagents/HostTurnSubagentExecutionAdapter.d.ts +8 -0
  325. package/dist/subagents/HostTurnSubagentExecutionAdapter.d.ts.map +1 -1
  326. package/dist/subagents/HostTurnSubagentExecutionAdapter.js +67 -1
  327. package/dist/subagents/HostTurnSubagentExecutionAdapter.js.map +1 -1
  328. package/dist/subagents/SubagentRunService.d.ts +23 -0
  329. package/dist/subagents/SubagentRunService.d.ts.map +1 -1
  330. package/dist/subagents/SubagentRunService.js +102 -8
  331. package/dist/subagents/SubagentRunService.js.map +1 -1
  332. package/dist/subagents/SubagentScheduler.d.ts +28 -0
  333. package/dist/subagents/SubagentScheduler.d.ts.map +1 -1
  334. package/dist/subagents/SubagentScheduler.js +106 -2
  335. package/dist/subagents/SubagentScheduler.js.map +1 -1
  336. package/dist/subagents/subagentExecutionOwnership.d.ts +21 -0
  337. package/dist/subagents/subagentExecutionOwnership.d.ts.map +1 -0
  338. package/dist/subagents/subagentExecutionOwnership.js +26 -0
  339. package/dist/subagents/subagentExecutionOwnership.js.map +1 -0
  340. package/dist/subagents/subagentRunPort.d.ts +17 -0
  341. package/dist/subagents/subagentRunPort.d.ts.map +1 -1
  342. package/dist/subagents/subagentRunPort.js +4 -2
  343. package/dist/subagents/subagentRunPort.js.map +1 -1
  344. package/dist/subagents/subagentTypes.d.ts +7 -0
  345. package/dist/subagents/subagentTypes.d.ts.map +1 -1
  346. package/dist/turns/DurableInterruptedTurnStore.d.ts.map +1 -1
  347. package/dist/turns/DurableInterruptedTurnStore.js +48 -35
  348. package/dist/turns/DurableInterruptedTurnStore.js.map +1 -1
  349. package/dist/turns/persistedToolPolicy.d.ts +7 -0
  350. package/dist/turns/persistedToolPolicy.d.ts.map +1 -0
  351. package/dist/turns/persistedToolPolicy.js +25 -0
  352. package/dist/turns/persistedToolPolicy.js.map +1 -0
  353. package/dist/turns/reasoningSelection.d.ts +4 -0
  354. package/dist/turns/reasoningSelection.d.ts.map +1 -0
  355. package/dist/turns/reasoningSelection.js +20 -0
  356. package/dist/turns/reasoningSelection.js.map +1 -0
  357. package/dist/turns/toolCategoryAdmission.d.ts +5 -0
  358. package/dist/turns/toolCategoryAdmission.d.ts.map +1 -0
  359. package/dist/turns/toolCategoryAdmission.js +24 -0
  360. package/dist/turns/toolCategoryAdmission.js.map +1 -0
  361. package/dist/turns/workspaceExecutionScope.d.ts +10 -0
  362. package/dist/turns/workspaceExecutionScope.d.ts.map +1 -0
  363. package/dist/turns/workspaceExecutionScope.js +47 -0
  364. package/dist/turns/workspaceExecutionScope.js.map +1 -0
  365. package/dist/workspace/WorkspaceHostService.d.ts +12 -2
  366. package/dist/workspace/WorkspaceHostService.d.ts.map +1 -1
  367. package/dist/workspace/WorkspaceHostService.js +81 -19
  368. package/dist/workspace/WorkspaceHostService.js.map +1 -1
  369. package/dist/workspace/readWorkspaceText.d.ts +8 -0
  370. package/dist/workspace/readWorkspaceText.d.ts.map +1 -0
  371. package/dist/workspace/readWorkspaceText.js +46 -0
  372. package/dist/workspace/readWorkspaceText.js.map +1 -0
  373. package/dist/workspace/windowsWorkspaceText.d.ts +18 -0
  374. package/dist/workspace/windowsWorkspaceText.d.ts.map +1 -0
  375. package/dist/workspace/windowsWorkspaceText.js +188 -0
  376. package/dist/workspace/windowsWorkspaceText.js.map +1 -0
  377. package/dist/workspace/writeWorkspaceText.d.ts +20 -0
  378. package/dist/workspace/writeWorkspaceText.d.ts.map +1 -0
  379. package/dist/workspace/writeWorkspaceText.js +185 -0
  380. package/dist/workspace/writeWorkspaceText.js.map +1 -0
  381. package/package.json +16 -7
@@ -0,0 +1,46 @@
1
+ import { closeSync, fstatSync, openSync, readSync, statSync } from 'node:fs';
2
+ /** Read the opened regular file within a hard allocation bound. A permissive
3
+ * Buffer.toString would replace malformed UTF-8 and a subsequent Save would
4
+ * irreversibly write replacement characters over the original bytes. */
5
+ export function readWorkspaceText(path, maxBytes) {
6
+ const fd = openSync(path, 'r');
7
+ try {
8
+ const before = fstatSync(fd, { bigint: true });
9
+ if (!before.isFile())
10
+ throw new Error('Target path is not a file.');
11
+ if (before.size > BigInt(maxBytes))
12
+ throw new Error('File exceeds 1MB limit.');
13
+ const buffer = Buffer.alloc(maxBytes + 1);
14
+ let bytes = 0;
15
+ while (bytes < buffer.length) {
16
+ const count = readSync(fd, buffer, bytes, buffer.length - bytes, bytes);
17
+ if (!count)
18
+ break;
19
+ bytes += count;
20
+ }
21
+ const after = fstatSync(fd, { bigint: true });
22
+ const current = statSync(path, { bigint: true });
23
+ if (bytes > maxBytes || before.size !== BigInt(bytes))
24
+ throw new Error('File changed or exceeds the editor limit. Reopen it.');
25
+ if (before.ino !== after.ino || before.dev !== after.dev || before.size !== after.size
26
+ || before.mtimeNs !== after.mtimeNs || before.ctimeNs !== after.ctimeNs
27
+ || current.ino !== after.ino || current.dev !== after.dev || current.size !== after.size
28
+ || current.mtimeNs !== after.mtimeNs || current.ctimeNs !== after.ctimeNs) {
29
+ throw new Error('File changed while reading. Reopen it.');
30
+ }
31
+ const body = buffer.subarray(0, bytes);
32
+ if (body.includes(0))
33
+ throw new Error('Binary files are not supported yet.');
34
+ try {
35
+ // Preserve a BOM as a real character so an unchanged save round-trips bytes.
36
+ return { content: new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(body), bytes };
37
+ }
38
+ catch {
39
+ throw new Error('File is not valid UTF-8. Convert its encoding before editing.');
40
+ }
41
+ }
42
+ finally {
43
+ closeSync(fd);
44
+ }
45
+ }
46
+ //# sourceMappingURL=readWorkspaceText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readWorkspaceText.js","sourceRoot":"","sources":["../../src/workspace/readWorkspaceText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE5E;;wEAEwE;AACxE,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,QAAgB;IAC9D,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IA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AAK,KAAK,CAAC,OAAO;eACpE,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI;eACrF,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;YAC5E,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;QAC3D,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;QACtC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QAC5E,IAAI,CAAC;YACH,6EAA6E;YAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAA;QACpG,CAAC;QAAC,MAAM,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;QAAC,CAAC;IAC9F,CAAC;YAAS,CAAC;QAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,18 @@
1
+ export interface WindowsWorkspaceWriteInput {
2
+ path: string;
3
+ temporary: string;
4
+ backup: string;
5
+ content: string;
6
+ maxBytes: number;
7
+ desiredHash: string;
8
+ expectedHash?: string | null;
9
+ }
10
+ export interface WindowsWorkspaceWriteReceipt {
11
+ outcome: 'committed' | 'not-committed' | 'uncertain';
12
+ code: number;
13
+ phase: string;
14
+ }
15
+ /** Fixed native metadata-preserving operation. Data and paths never enter argv.
16
+ * A missing/invalid reply after launch is uncertain, not evidence of no write. */
17
+ export declare function publishWindowsWorkspaceText(input: WindowsWorkspaceWriteInput): Promise<WindowsWorkspaceWriteReceipt>;
18
+ //# sourceMappingURL=windowsWorkspaceText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windowsWorkspaceText.d.ts","sourceRoot":"","sources":["../../src/workspace/windowsWorkspaceText.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AACD,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,WAAW,GAAG,eAAe,GAAG,WAAW,CAAA;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED;kFACkF;AAClF,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CA8C1H"}
@@ -0,0 +1,188 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { isAbsolute, join } from 'node:path';
3
+ import { tmpdir } from 'node:os';
4
+ import { probeProcessBirth } from '@xenosystem/agent-interface-client/local';
5
+ /** Fixed native metadata-preserving operation. Data and paths never enter argv.
6
+ * A missing/invalid reply after launch is uncertain, not evidence of no write. */
7
+ export async function publishWindowsWorkspaceText(input) {
8
+ // Capture primitives before the birth probe yields; queued callers cannot
9
+ // change either the checked payload or its destination afterwards.
10
+ input = { ...input };
11
+ if (![input.path, input.temporary, input.backup].every(path => typeof path === 'string' && isAbsolute(path) && path.length <= 32767 && !path.includes('\0'))
12
+ || !Number.isSafeInteger(input.maxBytes) || input.maxBytes < 1 || input.maxBytes > 1_048_576
13
+ || typeof input.content !== 'string' || Buffer.byteLength(input.content, 'utf8') > input.maxBytes
14
+ || !/^[a-f0-9]{64}$/.test(input.desiredHash)
15
+ || (input.expectedHash !== undefined && input.expectedHash !== null && !/^[a-f0-9]{64}$/.test(input.expectedHash)))
16
+ return { outcome: 'not-committed', code: 0, phase: 'validate' };
17
+ const systemRoot = process.env.SystemRoot ?? process.env.WINDIR;
18
+ if (!systemRoot || !isAbsolute(systemRoot))
19
+ return { outcome: 'not-committed', code: 0, phase: 'platform' };
20
+ const executable = join(systemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
21
+ const birth = await probeProcessBirth(process.pid);
22
+ if (birth?.kind !== 'windows-start-ticks-v1')
23
+ return { outcome: 'not-committed', code: 0, phase: 'parent' };
24
+ const { content, ...operation } = input;
25
+ const request = JSON.stringify({ ...operation, payload: Buffer.from(content, 'utf8').toString('base64'), hasExpected: input.expectedHash !== undefined, expectedAbsent: input.expectedHash === null, parentPid: process.pid, parentBirth: birth.value });
26
+ if (Buffer.byteLength(request, 'utf8') > 2_000_000)
27
+ return { outcome: 'not-committed', code: 0, phase: 'validate' };
28
+ return new Promise(resolve => {
29
+ const child = spawn(executable, ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', WINDOWS_WORKSPACE_WRITE], {
30
+ windowsHide: true, stdio: ['pipe', 'pipe', 'pipe'],
31
+ env: { SystemRoot: systemRoot, WINDIR: systemRoot, TEMP: tmpdir(), TMP: tmpdir() },
32
+ });
33
+ let stdout = '', failed = false, completed = false;
34
+ const stop = () => { failed = true; try {
35
+ child.kill('SIGKILL');
36
+ }
37
+ catch { /* retain pending until actual close */ } };
38
+ const timer = setTimeout(stop, 15_000);
39
+ const finish = (receipt) => { if (!completed) {
40
+ completed = true;
41
+ clearTimeout(timer);
42
+ resolve(receipt);
43
+ } };
44
+ child.stdout.on('data', (chunk) => { if (stdout.length + chunk.length > 4096)
45
+ stop();
46
+ else
47
+ stdout += chunk.toString('utf8'); });
48
+ child.stderr.on('data', () => { });
49
+ child.on('error', () => {
50
+ failed = true;
51
+ if (!child.pid)
52
+ finish({ outcome: 'not-committed', code: 0, phase: 'launch' });
53
+ // A spawned process error is not exit. Keep the Promise owned until close.
54
+ });
55
+ child.on('close', code => {
56
+ if (failed || code !== 0) {
57
+ finish({ outcome: 'uncertain', code: 0, phase: 'helper' });
58
+ return;
59
+ }
60
+ try {
61
+ const value = JSON.parse(stdout);
62
+ if (!['committed', 'not-committed', 'uncertain'].includes(value.outcome)
63
+ || !Number.isSafeInteger(value.code) || Math.abs(value.code) > 2147483648 || typeof value.phase !== 'string' || !/^[a-z-]{1,40}$/.test(value.phase))
64
+ throw new Error('Invalid receipt');
65
+ finish(value);
66
+ }
67
+ catch {
68
+ finish({ outcome: 'uncertain', code: 0, phase: 'receipt' });
69
+ }
70
+ });
71
+ // A stdin pipe failure is reflected by the process result; never log payload.
72
+ child.stdin?.on('error', () => { });
73
+ child.stdin?.end(request);
74
+ });
75
+ }
76
+ // File.Replace delegates to Windows ReplaceFile with metadata merge errors NOT
77
+ // ignored. Backup is mandatory: documented partial replacement failures may
78
+ // move the original. Keep all candidates on uncertainty instead of unlinking.
79
+ const WINDOWS_WORKSPACE_WRITE = String.raw `
80
+ $ErrorActionPreference = 'Stop'
81
+ Add-Type -TypeDefinition @'
82
+ using System;
83
+ using System.IO;
84
+ using System.Security.Cryptography;
85
+ using System.Security.AccessControl;
86
+ using System.Security.Principal;
87
+ using System.Runtime.InteropServices;
88
+ public static class XenoWorkspaceWrite {
89
+ [DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
90
+ static extern bool MoveFileExW(string existing, string name, uint flags);
91
+ static void AssertPlainPath(string path) {
92
+ for (string current = path; !String.IsNullOrEmpty(current); current = Path.GetDirectoryName(current)) {
93
+ if ((File.Exists(current) || Directory.Exists(current)) && (File.GetAttributes(current) & FileAttributes.ReparsePoint) != 0)
94
+ throw new IOException("reparse path");
95
+ }
96
+ }
97
+ static string Hash(string path, int maxBytes) {
98
+ using (var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read)) {
99
+ if (file.Length > maxBytes) throw new IOException("file bound");
100
+ using (var sha = SHA256.Create()) return BitConverter.ToString(sha.ComputeHash(file)).Replace("-", "").ToLowerInvariant();
101
+ }
102
+ }
103
+ static void Flush(string path) {
104
+ using (var file = new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite | FileShare.Delete)) file.Flush(true);
105
+ }
106
+ static void AssertParent(int pid, long birth) {
107
+ using (var process = System.Diagnostics.Process.GetProcessById(pid)) {
108
+ if (process.HasExited || process.StartTime.ToUniversalTime().Ticks != birth) throw new IOException("parent identity expired");
109
+ }
110
+ }
111
+ static FileSecurity PrivateSecurity() {
112
+ var security = new FileSecurity(); security.SetAccessRuleProtection(true, false);
113
+ var owner = WindowsIdentity.GetCurrent().User; security.SetOwner(owner);
114
+ security.AddAccessRule(new FileSystemAccessRule(owner, FileSystemRights.FullControl, AccessControlType.Allow));
115
+ security.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier(WellKnownSidType.LocalSystemSid, null), FileSystemRights.FullControl, AccessControlType.Allow));
116
+ return security;
117
+ }
118
+ public static object Run(string path, string temp, string backup, byte[] payload, int maxBytes, string desiredHash, bool hasExpected, bool expectedAbsent, string expectedHash, int parentPid, long parentBirth) {
119
+ string phase = "validate", outcome = "not-committed"; int code = 0; bool attempted = false;
120
+ System.Threading.Mutex gate = null; bool owned = false;
121
+ try {
122
+ path = Path.GetFullPath(path); temp = Path.GetFullPath(temp); backup = Path.GetFullPath(backup);
123
+ string parent = Path.GetDirectoryName(path);
124
+ if (maxBytes < 1 || maxBytes > 1048576 || payload.Length > maxBytes || !Directory.Exists(parent)
125
+ || !String.Equals(parent, Path.GetDirectoryName(temp), StringComparison.OrdinalIgnoreCase)
126
+ || !String.Equals(parent, Path.GetDirectoryName(backup), StringComparison.OrdinalIgnoreCase)
127
+ || path == temp || path == backup || temp == backup || File.Exists(backup) || File.Exists(temp)) throw new IOException("invalid operation");
128
+ AssertPlainPath(path); AssertPlainPath(temp); AssertPlainPath(backup);
129
+ string key;
130
+ using (var sha = SHA256.Create()) key = BitConverter.ToString(sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(parent.ToLowerInvariant()))).Replace("-", "");
131
+ gate = new System.Threading.Mutex(false, @"Local\XenoWorkspaceWrite-" + key);
132
+ phase = "gate";
133
+ try { owned = gate.WaitOne(5000); } catch (System.Threading.AbandonedMutexException) { owned = true; }
134
+ if (!owned) throw new IOException("writer busy");
135
+ AssertParent(parentPid, parentBirth);
136
+ bool exists = File.Exists(path);
137
+ phase = "precondition";
138
+ if (hasExpected && (expectedAbsent ? exists : !exists || Hash(path, maxBytes) != expectedHash))
139
+ return new { outcome = "not-committed", code = 0, phase = "conflict" };
140
+ phase = "temp-write";
141
+ // Apply original security atomically at CreateNew, BEFORE any plaintext.
142
+ // New files are private to the current owner and SYSTEM, never broadened
143
+ // by a permissive parent directory's inheritable ACL.
144
+ var security = exists ? File.GetAccessControl(path) : PrivateSecurity();
145
+ // Freeze the effective original ACL while staging; do not merge newly
146
+ // inheritable parent ACEs into a previously narrower file's plaintext.
147
+ security.SetAccessRuleProtection(true, true);
148
+ using (var staged = new FileStream(temp, FileMode.CreateNew, FileSystemRights.FullControl, FileShare.Read, 4096, FileOptions.WriteThrough, security)) {
149
+ staged.Write(payload, 0, payload.Length); staged.Flush(true);
150
+ }
151
+ if (Hash(temp, maxBytes) != desiredHash) throw new IOException("staged content changed");
152
+ phase = "precondition";
153
+ if (hasExpected && (expectedAbsent ? File.Exists(path) : !File.Exists(path) || Hash(path, maxBytes) != expectedHash))
154
+ return new { outcome = "not-committed", code = 0, phase = "conflict" };
155
+ // This is optimistic content comparison, not an external-process CAS.
156
+ // Check links again as close as possible to publication.
157
+ AssertPlainPath(path); AssertPlainPath(temp); AssertPlainPath(backup);
158
+ AssertParent(parentPid, parentBirth);
159
+ phase = exists ? "replace" : "create"; attempted = true;
160
+ if (exists) File.Replace(temp, path, backup, false);
161
+ // MOVEFILE_WRITE_THROUGH only: never replace a concurrently created file.
162
+ else if (!MoveFileExW(temp, path, 8)) {
163
+ int native = Marshal.GetLastWin32Error();
164
+ if (native == 80 || native == 183) return new { outcome = "not-committed", code = native, phase = "conflict" };
165
+ throw new System.ComponentModel.Win32Exception(native);
166
+ }
167
+ phase = "flush"; Flush(path);
168
+ phase = "readback";
169
+ if (Hash(path, maxBytes) != desiredHash) throw new IOException("published content changed");
170
+ outcome = "committed"; phase = "complete";
171
+ } catch (Exception error) {
172
+ code = error is System.ComponentModel.Win32Exception ? ((System.ComponentModel.Win32Exception)error).NativeErrorCode : error.HResult & 65535;
173
+ // Replacement failure can retain the old file under the backup name.
174
+ // Preserve candidates rather than inferring no write from an exception.
175
+ outcome = attempted ? "uncertain" : "not-committed";
176
+ } finally {
177
+ if (owned) gate.ReleaseMutex();
178
+ if (gate != null) gate.Dispose();
179
+ }
180
+ return new { outcome, code, phase };
181
+ }
182
+ }
183
+ '@
184
+ $request = [Console]::In.ReadToEnd() | ConvertFrom-Json
185
+ $expected = if ($null -eq $request.expectedHash) { $null } else { [string]$request.expectedHash }
186
+ [XenoWorkspaceWrite]::Run([string]$request.path,[string]$request.temporary,[string]$request.backup,[Convert]::FromBase64String([string]$request.payload),[int]$request.maxBytes,[string]$request.desiredHash,[bool]$request.hasExpected,[bool]$request.expectedAbsent,$expected,[int]$request.parentPid,[long]$request.parentBirth) | ConvertTo-Json -Compress
187
+ `;
188
+ //# sourceMappingURL=windowsWorkspaceText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"windowsWorkspaceText.js","sourceRoot":"","sources":["../../src/workspace/windowsWorkspaceText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAA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CAAC,CAAA;AACJ,CAAC;AAED,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E;AAC9E,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GzC,CAAA"}
@@ -0,0 +1,20 @@
1
+ export interface WorkspaceTextWriteReceipt {
2
+ outcome: 'committed' | 'not-committed' | 'uncertain';
3
+ bytes: number;
4
+ sha256?: string;
5
+ error?: string;
6
+ recoveryPaths: string[];
7
+ }
8
+ export interface WorkspaceTextWriteInput {
9
+ path: string;
10
+ content: string;
11
+ maxBytes: number;
12
+ /** Undefined: compatibility overwrite; null: require absent; string: exact prior UTF-8 bytes. */
13
+ expectedContent?: string | null;
14
+ /** Current grant/lifecycle check; called before staging and immediately before publication. */
15
+ assertAuthority: () => void;
16
+ }
17
+ /** Same-host serialization and optimistic precondition, not a filesystem CAS
18
+ * against arbitrary external writers. No target is ever opened for truncation. */
19
+ export declare function writeWorkspaceText(input: WorkspaceTextWriteInput): Promise<WorkspaceTextWriteReceipt>;
20
+ //# sourceMappingURL=writeWorkspaceText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeWorkspaceText.d.ts","sourceRoot":"","sources":["../../src/workspace/writeWorkspaceText.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,WAAW,GAAG,eAAe,GAAG,WAAW,CAAA;IACpD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB;AACD,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,iGAAiG;IACjG,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,+FAA+F;IAC/F,eAAe,EAAE,MAAM,IAAI,CAAA;CAC5B;AAMD;kFACkF;AAClF,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAQ3G"}
@@ -0,0 +1,185 @@
1
+ import { createHash, randomUUID } from 'node:crypto';
2
+ import { lstat, open, realpath, rename, link, unlink } from 'node:fs/promises';
3
+ import { dirname, join, resolve } from 'node:path';
4
+ import { readWorkspaceText } from './readWorkspaceText.js';
5
+ import { publishWindowsWorkspaceText } from './windowsWorkspaceText.js';
6
+ const pending = new Map();
7
+ const digest = (data) => createHash('sha256').update(data, 'utf8').digest('hex');
8
+ const absent = (error) => error.code === 'ENOENT';
9
+ /** Same-host serialization and optimistic precondition, not a filesystem CAS
10
+ * against arbitrary external writers. No target is ever opened for truncation. */
11
+ export async function writeWorkspaceText(input) {
12
+ const path = resolve(input.path);
13
+ const snapshot = { ...input, path };
14
+ const key = process.platform === 'win32' ? path.toLowerCase() : path;
15
+ const prior = pending.get(key) ?? Promise.resolve();
16
+ const work = prior.catch(() => { }).then(() => writeOne(snapshot));
17
+ pending.set(key, work);
18
+ try {
19
+ return await work;
20
+ }
21
+ finally {
22
+ if (pending.get(key) === work)
23
+ pending.delete(key);
24
+ }
25
+ }
26
+ async function plainPath(path) {
27
+ let current = path;
28
+ for (;;) {
29
+ try {
30
+ if ((await lstat(current)).isSymbolicLink())
31
+ throw new Error('Linked file paths require reopening their canonical target.');
32
+ }
33
+ catch (error) {
34
+ if (!absent(error))
35
+ throw error;
36
+ }
37
+ const parent = dirname(current);
38
+ if (parent === current)
39
+ return;
40
+ current = parent;
41
+ }
42
+ }
43
+ async function existing(path, max) {
44
+ try {
45
+ const stat = await lstat(path);
46
+ if (!stat.isFile() || stat.isSymbolicLink())
47
+ throw new Error('Target must be a regular file.');
48
+ return { ...readWorkspaceText(path, max), mode: stat.mode };
49
+ }
50
+ catch (error) {
51
+ if (absent(error))
52
+ return undefined;
53
+ throw error;
54
+ }
55
+ }
56
+ async function writeOne(input) {
57
+ let temporary, backup, publicationAttempted = false;
58
+ const recoveryPaths = [];
59
+ const fail = (outcome, error) => ({ outcome, bytes: 0, error, recoveryPaths });
60
+ let outcome;
61
+ try {
62
+ if (typeof input.content !== 'string' || !Number.isSafeInteger(input.maxBytes) || input.maxBytes < 1 || input.maxBytes > 1_048_576
63
+ || Buffer.byteLength(input.content, 'utf8') > input.maxBytes || input.content.includes('\0') || Buffer.from(input.content, 'utf8').toString('utf8') !== input.content
64
+ || (input.expectedContent !== undefined && input.expectedContent !== null && (typeof input.expectedContent !== 'string' || Buffer.byteLength(input.expectedContent, 'utf8') > input.maxBytes))) {
65
+ return fail('not-committed', 'File content or precondition exceeds the editor bounds.');
66
+ }
67
+ input.assertAuthority();
68
+ await plainPath(input.path);
69
+ const parent = await realpath(dirname(input.path));
70
+ const before = await existing(input.path, input.maxBytes);
71
+ const matches = (prior) => input.expectedContent === undefined
72
+ ? prior?.content === before?.content
73
+ : input.expectedContent === null ? !prior : prior?.content === input.expectedContent;
74
+ if (!matches(before))
75
+ return fail('not-committed', 'File changed outside this editor. Reopen it before saving.');
76
+ const operation = randomUUID();
77
+ temporary = join(parent, `.xeno-editor-${operation}.tmp`);
78
+ backup = join(parent, `.xeno-editor-${operation}.backup`);
79
+ if (process.platform !== 'win32') {
80
+ const file = await open(temporary, 'wx', before ? before.mode & 0o777 : 0o600);
81
+ try {
82
+ await file.writeFile(input.content, 'utf8');
83
+ await file.sync();
84
+ }
85
+ finally {
86
+ await file.close();
87
+ }
88
+ }
89
+ input.assertAuthority();
90
+ await plainPath(input.path);
91
+ if (await realpath(dirname(input.path)) !== parent)
92
+ throw new Error('Target directory changed during save.');
93
+ if (!matches(await existing(input.path, input.maxBytes)))
94
+ return fail('not-committed', 'File changed outside this editor. Reopen it before saving.');
95
+ const desiredHash = digest(input.content);
96
+ input.assertAuthority();
97
+ if (process.platform === 'win32') {
98
+ publicationAttempted = true;
99
+ const receipt = await publishWindowsWorkspaceText({ path: input.path, temporary, backup, content: input.content, maxBytes: input.maxBytes, desiredHash,
100
+ ...(input.expectedContent !== undefined ? { expectedHash: input.expectedContent === null ? null : digest(input.expectedContent) }
101
+ : { expectedHash: before ? digest(before.content) : null }) });
102
+ if (receipt.outcome !== 'committed') {
103
+ publicationAttempted = receipt.outcome === 'uncertain';
104
+ return fail(receipt.outcome, receipt.phase === 'conflict' ? 'File changed outside this editor. Reopen it before saving.'
105
+ : receipt.outcome === 'uncertain' ? 'Save outcome is uncertain. Reopen the file and inspect retained recovery files before retrying.' : 'Save failed before publication; original file was not replaced.');
106
+ }
107
+ }
108
+ else {
109
+ // POSIX preserves basic mode. Arbitrary ACL/xattr preservation requires a
110
+ // platform-specific capability and is not claimed by this implementation.
111
+ // Copy verified original bytes to an exclusive, private inode. A hard link
112
+ // would let an external in-place writer corrupt the recovery copy too.
113
+ if (before) {
114
+ const original = await open(backup, 'wx', 0o600);
115
+ try {
116
+ await original.writeFile(before.content, 'utf8');
117
+ await original.sync();
118
+ }
119
+ finally {
120
+ await original.close();
121
+ }
122
+ const dir = await open(parent, 'r');
123
+ try {
124
+ await dir.sync();
125
+ }
126
+ finally {
127
+ await dir.close();
128
+ }
129
+ }
130
+ input.assertAuthority();
131
+ await plainPath(input.path);
132
+ if (await realpath(dirname(input.path)) !== parent || !matches(await existing(input.path, input.maxBytes))) {
133
+ return fail('not-committed', 'File changed outside this editor. Reopen it before saving.');
134
+ }
135
+ publicationAttempted = true;
136
+ if (before)
137
+ await rename(temporary, input.path);
138
+ else
139
+ await link(temporary, input.path); // exclusive publication: never overwrite racing creation
140
+ const dir = await open(parent, 'r');
141
+ try {
142
+ await dir.sync();
143
+ }
144
+ finally {
145
+ await dir.close();
146
+ }
147
+ }
148
+ const readback = readWorkspaceText(input.path, input.maxBytes);
149
+ if (digest(readback.content) !== desiredHash)
150
+ throw new Error('Published file changed before acknowledgement.');
151
+ outcome = { outcome: 'committed', bytes: readback.bytes, sha256: desiredHash, recoveryPaths };
152
+ publicationAttempted = false;
153
+ return outcome;
154
+ }
155
+ catch (error) {
156
+ return fail(publicationAttempted ? 'uncertain' : 'not-committed', publicationAttempted
157
+ ? 'Save outcome is uncertain. Reopen the file and inspect retained recovery files before retrying.'
158
+ : error instanceof Error && /File changed|Target|Linked/.test(error.message) ? error.message : 'Save failed before publication; original file was not replaced.');
159
+ }
160
+ finally {
161
+ for (const path of [temporary, backup]) {
162
+ if (!path)
163
+ continue;
164
+ if (publicationAttempted) {
165
+ try {
166
+ await lstat(path);
167
+ recoveryPaths.push(path);
168
+ }
169
+ catch (error) {
170
+ if (!absent(error))
171
+ recoveryPaths.push(path);
172
+ }
173
+ continue;
174
+ }
175
+ try {
176
+ await unlink(path);
177
+ }
178
+ catch (error) {
179
+ if (!absent(error))
180
+ recoveryPaths.push(path);
181
+ }
182
+ }
183
+ }
184
+ }
185
+ //# sourceMappingURL=writeWorkspaceText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeWorkspaceText.js","sourceRoot":"","sources":["../../src/workspace/writeWorkspaceText.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAmBvE,MAAM,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAA;AACnD,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,UAAU,C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C;YAAC,OAAO,KAAK,EAAE,CAAC;gBAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;oBAAE,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAAC,CAAC;QAC3F,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/agent-interface-host",
3
- "version": "0.1.25",
3
+ "version": "0.1.27",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,19 +27,28 @@
27
27
  "directory": "packages/host"
28
28
  },
29
29
  "dependencies": {
30
- "@xenosystem/acp-core": "0.2.14",
31
- "@xenosystem/acp-provider-manager": "0.2.14",
30
+ "@xenosystem/acp-core": "0.2.15",
31
+ "@xenosystem/acp-provider-manager": "0.2.15",
32
32
  "@xenosystem/agent-sdk": "0.9.25",
33
33
  "better-sqlite3": "13.0.3",
34
34
  "fflate": "^0.8.3",
35
35
  "node-pty": "^1.1.0",
36
36
  "tar": "^7.5.20",
37
- "@xenosystem/agent-interface-contract": "0.1.25",
38
- "@xenosystem/agent-interface-core": "0.1.25"
37
+ "zod": "4.4.3",
38
+ "@xenosystem/agent-interface-contract": "0.1.27",
39
+ "@xenosystem/agent-interface-core": "0.1.27"
39
40
  },
40
41
  "optionalDependencies": {
41
- "@xenosystem/acp-agent": "0.2.14",
42
- "@xenosystem/agent-interface-client": "0.1.25"
42
+ "@xenosystem/acp-agent": "0.2.15",
43
+ "@xenosystem/agent-interface-client": "0.1.27"
44
+ },
45
+ "peerDependencies": {
46
+ "@xeno-corporation/account": "0.2.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@xeno-corporation/account": {
50
+ "optional": true
51
+ }
43
52
  },
44
53
  "scripts": {}
45
54
  }