@noopolis/daimon 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/README.md +307 -45
  2. package/dist/contracts/attentionContract.d.ts +117 -0
  3. package/dist/contracts/attentionContract.d.ts.map +1 -0
  4. package/dist/contracts/attentionContract.js +14 -0
  5. package/dist/contracts/canonicalJson.d.ts +3 -0
  6. package/dist/contracts/canonicalJson.d.ts.map +1 -0
  7. package/dist/contracts/canonicalJson.js +54 -0
  8. package/dist/contracts/grokWorkerContract.d.ts +74 -0
  9. package/dist/contracts/grokWorkerContract.d.ts.map +1 -0
  10. package/dist/contracts/grokWorkerContract.js +88 -0
  11. package/dist/contracts/organizationRuntimeContract.d.ts +765 -0
  12. package/dist/contracts/organizationRuntimeContract.d.ts.map +1 -0
  13. package/dist/contracts/organizationRuntimeContract.js +121 -0
  14. package/dist/contracts/runtimeContractManifest.d.ts +1615 -0
  15. package/dist/contracts/runtimeContractManifest.d.ts.map +1 -0
  16. package/dist/contracts/runtimeContractManifest.js +181 -0
  17. package/dist/core/credentialRedaction.d.ts +4 -0
  18. package/dist/core/credentialRedaction.d.ts.map +1 -0
  19. package/dist/core/credentialRedaction.js +28 -0
  20. package/dist/core/siblingBuildFreshness.d.ts +21 -0
  21. package/dist/core/siblingBuildFreshness.d.ts.map +1 -0
  22. package/dist/core/siblingBuildFreshness.js +25 -0
  23. package/dist/core/types.d.ts +10 -1
  24. package/dist/core/types.d.ts.map +1 -1
  25. package/dist/examples/exampleCausalId.d.ts +3 -0
  26. package/dist/examples/exampleCausalId.d.ts.map +1 -0
  27. package/dist/examples/exampleCausalId.js +8 -0
  28. package/dist/examples/jungian-play-org.js +3 -2
  29. package/dist/examples/jungian-triad-org.js +3 -2
  30. package/dist/examples/jungianPlayAgent.d.ts +1 -1
  31. package/dist/examples/jungianPlayAgent.d.ts.map +1 -1
  32. package/dist/examples/jungianPlayAgent.js +1 -1
  33. package/dist/examples/jungianProfiles.d.ts +1 -1
  34. package/dist/examples/jungianProfiles.d.ts.map +1 -1
  35. package/dist/examples/jungianTriadProfiles.d.ts +1 -1
  36. package/dist/examples/jungianTriadProfiles.d.ts.map +1 -1
  37. package/dist/examples/pi-agent.js +3 -2
  38. package/dist/examples/pi-memory-org.js +6 -5
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -0
  42. package/dist/mcp/toolServer.d.ts +31 -0
  43. package/dist/mcp/toolServer.d.ts.map +1 -0
  44. package/dist/mcp/toolServer.js +145 -0
  45. package/dist/observability/causalEvents.d.ts +118 -0
  46. package/dist/observability/causalEvents.d.ts.map +1 -0
  47. package/dist/observability/causalEvents.js +223 -0
  48. package/dist/observability/controlCausal.d.ts +117 -0
  49. package/dist/observability/controlCausal.d.ts.map +1 -0
  50. package/dist/observability/controlCausal.js +107 -0
  51. package/dist/observability/emitCausalFixture.d.ts +25 -0
  52. package/dist/observability/emitCausalFixture.d.ts.map +1 -0
  53. package/dist/observability/emitCausalFixture.js +98 -0
  54. package/dist/observability/index.d.ts +2 -0
  55. package/dist/observability/index.d.ts.map +1 -1
  56. package/dist/observability/index.js +2 -0
  57. package/dist/observability/orgObserver.d.ts.map +1 -1
  58. package/dist/observability/orgObserver.js +3 -3
  59. package/dist/pi/agyHeadlessResult.d.ts +60 -0
  60. package/dist/pi/agyHeadlessResult.d.ts.map +1 -0
  61. package/dist/pi/agyHeadlessResult.js +95 -0
  62. package/dist/pi/cliChildOutput.d.ts +67 -0
  63. package/dist/pi/cliChildOutput.d.ts.map +1 -0
  64. package/dist/pi/cliChildOutput.js +269 -0
  65. package/dist/pi/cliEngineRun.d.ts +16 -0
  66. package/dist/pi/cliEngineRun.d.ts.map +1 -0
  67. package/dist/pi/cliEngineRun.js +27 -0
  68. package/dist/pi/cliEngineSpawn.d.ts +55 -0
  69. package/dist/pi/cliEngineSpawn.d.ts.map +1 -0
  70. package/dist/pi/cliEngineSpawn.js +164 -0
  71. package/dist/pi/cliEnvironment.d.ts +12 -0
  72. package/dist/pi/cliEnvironment.d.ts.map +1 -0
  73. package/dist/pi/cliEnvironment.js +32 -0
  74. package/dist/pi/cliMcpRegistration.d.ts +61 -0
  75. package/dist/pi/cliMcpRegistration.d.ts.map +1 -0
  76. package/dist/pi/cliMcpRegistration.js +75 -0
  77. package/dist/pi/cliProcess.d.ts +7 -0
  78. package/dist/pi/cliProcess.d.ts.map +1 -0
  79. package/dist/pi/cliProcess.js +132 -0
  80. package/dist/pi/cliSession.d.ts +106 -0
  81. package/dist/pi/cliSession.d.ts.map +1 -0
  82. package/dist/pi/cliSession.js +379 -0
  83. package/dist/pi/cliTurnMetering.d.ts +60 -0
  84. package/dist/pi/cliTurnMetering.d.ts.map +1 -0
  85. package/dist/pi/cliTurnMetering.js +60 -0
  86. package/dist/pi/codexFilesystemRules.d.ts +3 -0
  87. package/dist/pi/codexFilesystemRules.d.ts.map +1 -0
  88. package/dist/pi/codexFilesystemRules.js +28 -0
  89. package/dist/pi/codexHeadlessResult.d.ts +68 -0
  90. package/dist/pi/codexHeadlessResult.d.ts.map +1 -0
  91. package/dist/pi/codexHeadlessResult.js +122 -0
  92. package/dist/pi/codexRolloutUsage.d.ts +95 -0
  93. package/dist/pi/codexRolloutUsage.d.ts.map +1 -0
  94. package/dist/pi/codexRolloutUsage.js +221 -0
  95. package/dist/pi/engineWakeLimits.d.ts +39 -0
  96. package/dist/pi/engineWakeLimits.d.ts.map +1 -0
  97. package/dist/pi/engineWakeLimits.js +55 -0
  98. package/dist/pi/grokHeadlessResult.d.ts +36 -0
  99. package/dist/pi/grokHeadlessResult.d.ts.map +1 -0
  100. package/dist/pi/grokHeadlessResult.js +118 -0
  101. package/dist/pi/grokHomeMcpRegistration.d.ts +21 -0
  102. package/dist/pi/grokHomeMcpRegistration.d.ts.map +1 -0
  103. package/dist/pi/grokHomeMcpRegistration.js +57 -0
  104. package/dist/pi/grokSandbox.d.ts +11 -0
  105. package/dist/pi/grokSandbox.d.ts.map +1 -0
  106. package/dist/pi/grokSandbox.js +216 -0
  107. package/dist/pi/grokStreamUsage.d.ts +31 -0
  108. package/dist/pi/grokStreamUsage.d.ts.map +1 -0
  109. package/dist/pi/grokStreamUsage.js +51 -0
  110. package/dist/pi/index.d.ts +5 -0
  111. package/dist/pi/index.d.ts.map +1 -1
  112. package/dist/pi/index.js +5 -0
  113. package/dist/pi/memoryTools.d.ts +55 -1
  114. package/dist/pi/memoryTools.d.ts.map +1 -1
  115. package/dist/pi/memoryTools.js +144 -24
  116. package/dist/pi/modelRegistry.d.ts +13 -0
  117. package/dist/pi/modelRegistry.d.ts.map +1 -0
  118. package/dist/pi/modelRegistry.js +19 -0
  119. package/dist/pi/piAgentHandle.d.ts +46 -0
  120. package/dist/pi/piAgentHandle.d.ts.map +1 -0
  121. package/dist/pi/piAgentHandle.js +351 -0
  122. package/dist/pi/piAgentWakeSupport.d.ts +103 -0
  123. package/dist/pi/piAgentWakeSupport.d.ts.map +1 -0
  124. package/dist/pi/piAgentWakeSupport.js +151 -0
  125. package/dist/pi/piHarness.d.ts +40 -5
  126. package/dist/pi/piHarness.d.ts.map +1 -1
  127. package/dist/pi/piHarness.js +151 -256
  128. package/dist/pi/prompts.d.ts +10 -0
  129. package/dist/pi/prompts.d.ts.map +1 -0
  130. package/dist/pi/prompts.js +63 -0
  131. package/dist/pi/rawTrainingCapture.d.ts +59 -0
  132. package/dist/pi/rawTrainingCapture.d.ts.map +1 -0
  133. package/dist/pi/rawTrainingCapture.js +175 -0
  134. package/dist/pi/turnCausal.d.ts +73 -0
  135. package/dist/pi/turnCausal.d.ts.map +1 -0
  136. package/dist/pi/turnCausal.js +75 -0
  137. package/dist/pi/turnTrace.d.ts +128 -0
  138. package/dist/pi/turnTrace.d.ts.map +1 -0
  139. package/dist/pi/turnTrace.js +138 -0
  140. package/dist/pi/wakeAcceptance.d.ts +49 -0
  141. package/dist/pi/wakeAcceptance.d.ts.map +1 -0
  142. package/dist/pi/wakeAcceptance.js +281 -0
  143. package/dist/pi/wakeAcceptanceFs.d.ts +44 -0
  144. package/dist/pi/wakeAcceptanceFs.d.ts.map +1 -0
  145. package/dist/pi/wakeAcceptanceFs.js +318 -0
  146. package/dist/pi/wakeAcceptanceSchema.d.ts +75 -0
  147. package/dist/pi/wakeAcceptanceSchema.d.ts.map +1 -0
  148. package/dist/pi/wakeAcceptanceSchema.js +265 -0
  149. package/dist/pi/wakeModes.d.ts +9 -0
  150. package/dist/pi/wakeModes.d.ts.map +1 -0
  151. package/dist/pi/wakeModes.js +19 -0
  152. package/dist/pi/worldNudge.d.ts +22 -0
  153. package/dist/pi/worldNudge.d.ts.map +1 -0
  154. package/dist/pi/worldNudge.js +62 -0
  155. package/dist/pi/worldToolProtocol.d.ts +13 -0
  156. package/dist/pi/worldToolProtocol.d.ts.map +1 -0
  157. package/dist/pi/worldToolProtocol.js +49 -0
  158. package/dist/pi/worldTools.d.ts +32 -0
  159. package/dist/pi/worldTools.d.ts.map +1 -0
  160. package/dist/pi/worldTools.js +373 -0
  161. package/dist/pi/worldTrajectory.d.ts +52 -0
  162. package/dist/pi/worldTrajectory.d.ts.map +1 -0
  163. package/dist/pi/worldTrajectory.js +131 -0
  164. package/dist/runtime/agySubscriptionBootstrap.d.ts +16 -0
  165. package/dist/runtime/agySubscriptionBootstrap.d.ts.map +1 -0
  166. package/dist/runtime/agySubscriptionBootstrap.js +80 -0
  167. package/dist/runtime/agySubscriptionRealm.d.ts +38 -0
  168. package/dist/runtime/agySubscriptionRealm.d.ts.map +1 -0
  169. package/dist/runtime/agySubscriptionRealm.js +242 -0
  170. package/dist/runtime/attention.d.ts +21 -0
  171. package/dist/runtime/attention.d.ts.map +1 -0
  172. package/dist/runtime/attention.js +36 -0
  173. package/dist/runtime/attentionDispatcher.d.ts +66 -0
  174. package/dist/runtime/attentionDispatcher.d.ts.map +1 -0
  175. package/dist/runtime/attentionDispatcher.js +271 -0
  176. package/dist/runtime/cli.d.ts +7 -0
  177. package/dist/runtime/cli.d.ts.map +1 -0
  178. package/dist/runtime/cli.js +251 -0
  179. package/dist/runtime/codexSandboxProjection.d.ts +17 -0
  180. package/dist/runtime/codexSandboxProjection.d.ts.map +1 -0
  181. package/dist/runtime/codexSandboxProjection.js +40 -0
  182. package/dist/runtime/contract-manifest.json +1 -0
  183. package/dist/runtime/contract-manifest.sha256 +1 -0
  184. package/dist/runtime/contractManifest.d.ts +8 -0
  185. package/dist/runtime/contractManifest.d.ts.map +1 -0
  186. package/dist/runtime/contractManifest.js +4 -0
  187. package/dist/runtime/engineBrokerCapabilities.d.ts +30 -0
  188. package/dist/runtime/engineBrokerCapabilities.d.ts.map +1 -0
  189. package/dist/runtime/engineBrokerCapabilities.js +59 -0
  190. package/dist/runtime/engineBrokerControlClient.d.ts +44 -0
  191. package/dist/runtime/engineBrokerControlClient.d.ts.map +1 -0
  192. package/dist/runtime/engineBrokerControlClient.js +132 -0
  193. package/dist/runtime/engineBrokerCredentialJournal.d.ts +10 -0
  194. package/dist/runtime/engineBrokerCredentialJournal.d.ts.map +1 -0
  195. package/dist/runtime/engineBrokerCredentialJournal.js +17 -0
  196. package/dist/runtime/engineBrokerInferenceProtocol.d.ts +52 -0
  197. package/dist/runtime/engineBrokerInferenceProtocol.d.ts.map +1 -0
  198. package/dist/runtime/engineBrokerInferenceProtocol.js +65 -0
  199. package/dist/runtime/engineBrokerMcpCallLog.d.ts +160 -0
  200. package/dist/runtime/engineBrokerMcpCallLog.d.ts.map +1 -0
  201. package/dist/runtime/engineBrokerMcpCallLog.js +219 -0
  202. package/dist/runtime/engineBrokerMcpFacade.d.ts +56 -0
  203. package/dist/runtime/engineBrokerMcpFacade.d.ts.map +1 -0
  204. package/dist/runtime/engineBrokerMcpFacade.js +343 -0
  205. package/dist/runtime/engineBrokerNativeClient.d.ts +52 -0
  206. package/dist/runtime/engineBrokerNativeClient.d.ts.map +1 -0
  207. package/dist/runtime/engineBrokerNativeClient.js +151 -0
  208. package/dist/runtime/engineBrokerProtocol.d.ts +135 -0
  209. package/dist/runtime/engineBrokerProtocol.d.ts.map +1 -0
  210. package/dist/runtime/engineBrokerProtocol.js +274 -0
  211. package/dist/runtime/engineBrokerSealLedger.d.ts +70 -0
  212. package/dist/runtime/engineBrokerSealLedger.d.ts.map +1 -0
  213. package/dist/runtime/engineBrokerSealLedger.js +123 -0
  214. package/dist/runtime/engineBrokerService.d.ts +37 -0
  215. package/dist/runtime/engineBrokerService.d.ts.map +1 -0
  216. package/dist/runtime/engineBrokerService.js +138 -0
  217. package/dist/runtime/engineBrokerServiceCli.d.ts +5 -0
  218. package/dist/runtime/engineBrokerServiceCli.d.ts.map +1 -0
  219. package/dist/runtime/engineBrokerServiceCli.js +32 -0
  220. package/dist/runtime/engineBrokerServiceConfig.d.ts +50 -0
  221. package/dist/runtime/engineBrokerServiceConfig.d.ts.map +1 -0
  222. package/dist/runtime/engineBrokerServiceConfig.js +92 -0
  223. package/dist/runtime/engineBrokerSingleflight.d.ts +13 -0
  224. package/dist/runtime/engineBrokerSingleflight.d.ts.map +1 -0
  225. package/dist/runtime/engineBrokerSingleflight.js +24 -0
  226. package/dist/runtime/engineBrokerTurnAccounting.d.ts +76 -0
  227. package/dist/runtime/engineBrokerTurnAccounting.d.ts.map +1 -0
  228. package/dist/runtime/engineBrokerTurnAccounting.js +108 -0
  229. package/dist/runtime/engineBrokerTurnRegistry.d.ts +57 -0
  230. package/dist/runtime/engineBrokerTurnRegistry.d.ts.map +1 -0
  231. package/dist/runtime/engineBrokerTurnRegistry.js +158 -0
  232. package/dist/runtime/engineDispatcher.d.ts +36 -0
  233. package/dist/runtime/engineDispatcher.d.ts.map +1 -0
  234. package/dist/runtime/engineDispatcher.js +216 -0
  235. package/dist/runtime/engineReadiness.d.ts +23 -0
  236. package/dist/runtime/engineReadiness.d.ts.map +1 -0
  237. package/dist/runtime/engineReadiness.js +222 -0
  238. package/dist/runtime/grokAuthenticationError.d.ts +8 -0
  239. package/dist/runtime/grokAuthenticationError.d.ts.map +1 -0
  240. package/dist/runtime/grokAuthenticationError.js +20 -0
  241. package/dist/runtime/grokBrokerCredentialAuthority.d.ts +22 -0
  242. package/dist/runtime/grokBrokerCredentialAuthority.d.ts.map +1 -0
  243. package/dist/runtime/grokBrokerCredentialAuthority.js +124 -0
  244. package/dist/runtime/grokBrokerCredentialReader.d.ts +5 -0
  245. package/dist/runtime/grokBrokerCredentialReader.d.ts.map +1 -0
  246. package/dist/runtime/grokBrokerCredentialReader.js +37 -0
  247. package/dist/runtime/grokBrokerModelPolicy.d.ts +23 -0
  248. package/dist/runtime/grokBrokerModelPolicy.d.ts.map +1 -0
  249. package/dist/runtime/grokBrokerModelPolicy.js +28 -0
  250. package/dist/runtime/grokBrokerProjection.d.ts +106 -0
  251. package/dist/runtime/grokBrokerProjection.d.ts.map +1 -0
  252. package/dist/runtime/grokBrokerProjection.js +94 -0
  253. package/dist/runtime/grokBrokerProxy.d.ts +55 -0
  254. package/dist/runtime/grokBrokerProxy.d.ts.map +1 -0
  255. package/dist/runtime/grokBrokerProxy.js +262 -0
  256. package/dist/runtime/grokBrokerProxyRequest.d.ts +30 -0
  257. package/dist/runtime/grokBrokerProxyRequest.d.ts.map +1 -0
  258. package/dist/runtime/grokBrokerProxyRequest.js +74 -0
  259. package/dist/runtime/grokBrokerRealmLease.d.ts +4 -0
  260. package/dist/runtime/grokBrokerRealmLease.d.ts.map +1 -0
  261. package/dist/runtime/grokBrokerRealmLease.js +33 -0
  262. package/dist/runtime/grokBrokerRefresh.d.ts +2 -0
  263. package/dist/runtime/grokBrokerRefresh.d.ts.map +1 -0
  264. package/dist/runtime/grokBrokerRefresh.js +15 -0
  265. package/dist/runtime/grokBrokerTurnMeter.d.ts +128 -0
  266. package/dist/runtime/grokBrokerTurnMeter.d.ts.map +1 -0
  267. package/dist/runtime/grokBrokerTurnMeter.js +251 -0
  268. package/dist/runtime/grokBrokerWorkerConfig.d.ts +86 -0
  269. package/dist/runtime/grokBrokerWorkerConfig.d.ts.map +1 -0
  270. package/dist/runtime/grokBrokerWorkerConfig.js +135 -0
  271. package/dist/runtime/grokEngineBroker.d.ts +48 -0
  272. package/dist/runtime/grokEngineBroker.d.ts.map +1 -0
  273. package/dist/runtime/grokEngineBroker.js +114 -0
  274. package/dist/runtime/grokEngineBrokerLedger.d.ts +52 -0
  275. package/dist/runtime/grokEngineBrokerLedger.d.ts.map +1 -0
  276. package/dist/runtime/grokEngineBrokerLedger.js +114 -0
  277. package/dist/runtime/grokEngineBrokerMetering.d.ts +51 -0
  278. package/dist/runtime/grokEngineBrokerMetering.d.ts.map +1 -0
  279. package/dist/runtime/grokEngineBrokerMetering.js +34 -0
  280. package/dist/runtime/grokEngineBrokerTurn.d.ts +58 -0
  281. package/dist/runtime/grokEngineBrokerTurn.d.ts.map +1 -0
  282. package/dist/runtime/grokEngineBrokerTurn.js +165 -0
  283. package/dist/runtime/grokInferenceClientConfig.d.ts +41 -0
  284. package/dist/runtime/grokInferenceClientConfig.d.ts.map +1 -0
  285. package/dist/runtime/grokInferenceClientConfig.js +62 -0
  286. package/dist/runtime/grokInferenceGrants.d.ts +77 -0
  287. package/dist/runtime/grokInferenceGrants.d.ts.map +1 -0
  288. package/dist/runtime/grokInferenceGrants.js +116 -0
  289. package/dist/runtime/grokInferenceProxy.d.ts +29 -0
  290. package/dist/runtime/grokInferenceProxy.d.ts.map +1 -0
  291. package/dist/runtime/grokInferenceProxy.js +82 -0
  292. package/dist/runtime/grokInferenceProxyRequest.d.ts +23 -0
  293. package/dist/runtime/grokInferenceProxyRequest.d.ts.map +1 -0
  294. package/dist/runtime/grokInferenceProxyRequest.js +63 -0
  295. package/dist/runtime/grokSlotPreflightReceipt.d.ts +70 -0
  296. package/dist/runtime/grokSlotPreflightReceipt.d.ts.map +1 -0
  297. package/dist/runtime/grokSlotPreflightReceipt.js +101 -0
  298. package/dist/runtime/grokSubscriptionRealm.d.ts +4 -0
  299. package/dist/runtime/grokSubscriptionRealm.d.ts.map +1 -0
  300. package/dist/runtime/grokSubscriptionRealm.js +435 -0
  301. package/dist/runtime/grokSubscriptionRealmTypes.d.ts +26 -0
  302. package/dist/runtime/grokSubscriptionRealmTypes.d.ts.map +1 -0
  303. package/dist/runtime/grokSubscriptionRealmTypes.js +1 -0
  304. package/dist/runtime/grokWorkerAttestation.d.ts +170 -0
  305. package/dist/runtime/grokWorkerAttestation.d.ts.map +1 -0
  306. package/dist/runtime/grokWorkerAttestation.js +266 -0
  307. package/dist/runtime/grokWorkerDenyPlacement.d.ts +80 -0
  308. package/dist/runtime/grokWorkerDenyPlacement.d.ts.map +1 -0
  309. package/dist/runtime/grokWorkerDenyPlacement.js +128 -0
  310. package/dist/runtime/grokWorkerHomeAttestation.d.ts +30 -0
  311. package/dist/runtime/grokWorkerHomeAttestation.d.ts.map +1 -0
  312. package/dist/runtime/grokWorkerHomeAttestation.js +69 -0
  313. package/dist/runtime/grokWorkerSandboxProfile.d.ts +27 -0
  314. package/dist/runtime/grokWorkerSandboxProfile.d.ts.map +1 -0
  315. package/dist/runtime/grokWorkerSandboxProfile.js +44 -0
  316. package/dist/runtime/grokWorkerTmpAttestation.d.ts +55 -0
  317. package/dist/runtime/grokWorkerTmpAttestation.d.ts.map +1 -0
  318. package/dist/runtime/grokWorkerTmpAttestation.js +63 -0
  319. package/dist/runtime/index.d.ts +26 -0
  320. package/dist/runtime/index.d.ts.map +1 -0
  321. package/dist/runtime/index.js +23 -0
  322. package/dist/runtime/inferenceUsageLedger.d.ts +38 -0
  323. package/dist/runtime/inferenceUsageLedger.d.ts.map +1 -0
  324. package/dist/runtime/inferenceUsageLedger.js +53 -0
  325. package/dist/runtime/mcpToolResult.d.ts +127 -0
  326. package/dist/runtime/mcpToolResult.d.ts.map +1 -0
  327. package/dist/runtime/mcpToolResult.js +214 -0
  328. package/dist/runtime/moltnetMachineRead.d.ts +97 -0
  329. package/dist/runtime/moltnetMachineRead.d.ts.map +1 -0
  330. package/dist/runtime/moltnetMachineRead.js +183 -0
  331. package/dist/runtime/native/daimon-engine-broker +0 -0
  332. package/dist/runtime/organizationRuntime.d.ts +165 -0
  333. package/dist/runtime/organizationRuntime.d.ts.map +1 -0
  334. package/dist/runtime/organizationRuntime.js +3 -0
  335. package/dist/runtime/organizationRuntimeControl.d.ts +42 -0
  336. package/dist/runtime/organizationRuntimeControl.d.ts.map +1 -0
  337. package/dist/runtime/organizationRuntimeControl.js +235 -0
  338. package/dist/runtime/organizationRuntimeHost.d.ts +19 -0
  339. package/dist/runtime/organizationRuntimeHost.d.ts.map +1 -0
  340. package/dist/runtime/organizationRuntimeHost.js +359 -0
  341. package/dist/runtime/organizationRuntimeParsing.d.ts +6 -0
  342. package/dist/runtime/organizationRuntimeParsing.d.ts.map +1 -0
  343. package/dist/runtime/organizationRuntimeParsing.js +370 -0
  344. package/dist/runtime/organizationRuntimeReadiness.d.ts +12 -0
  345. package/dist/runtime/organizationRuntimeReadiness.d.ts.map +1 -0
  346. package/dist/runtime/organizationRuntimeReadiness.js +59 -0
  347. package/dist/runtime/physicalReadiness.d.ts +47 -0
  348. package/dist/runtime/physicalReadiness.d.ts.map +1 -0
  349. package/dist/runtime/physicalReadiness.js +142 -0
  350. package/dist/runtime/portableCredentialAuth.d.ts +6 -0
  351. package/dist/runtime/portableCredentialAuth.d.ts.map +1 -0
  352. package/dist/runtime/portableCredentialAuth.js +70 -0
  353. package/dist/runtime/portableCredentialMaterial.d.ts +8 -0
  354. package/dist/runtime/portableCredentialMaterial.d.ts.map +1 -0
  355. package/dist/runtime/portableCredentialMaterial.js +169 -0
  356. package/dist/runtime/productionAgentTools.d.ts +5 -0
  357. package/dist/runtime/productionAgentTools.d.ts.map +1 -0
  358. package/dist/runtime/productionAgentTools.js +328 -0
  359. package/dist/runtime/runtimeHomeLayout.d.ts +48 -0
  360. package/dist/runtime/runtimeHomeLayout.d.ts.map +1 -0
  361. package/dist/runtime/runtimeHomeLayout.js +84 -0
  362. package/dist/runtime/schedule.d.ts +40 -0
  363. package/dist/runtime/schedule.d.ts.map +1 -0
  364. package/dist/runtime/schedule.js +371 -0
  365. package/dist/runtime/storeCoordination.d.ts +23 -0
  366. package/dist/runtime/storeCoordination.d.ts.map +1 -0
  367. package/dist/runtime/storeCoordination.js +94 -0
  368. package/dist/runtime/toolResultSpill.d.ts +152 -0
  369. package/dist/runtime/toolResultSpill.d.ts.map +1 -0
  370. package/dist/runtime/toolResultSpill.js +351 -0
  371. package/dist/runtime/turnRequestLedger.d.ts +160 -0
  372. package/dist/runtime/turnRequestLedger.d.ts.map +1 -0
  373. package/dist/runtime/turnRequestLedger.js +249 -0
  374. package/dist/runtime/turnUsageLedger.d.ts +143 -0
  375. package/dist/runtime/turnUsageLedger.d.ts.map +1 -0
  376. package/dist/runtime/turnUsageLedger.js +203 -0
  377. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts +17 -0
  378. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts.map +1 -0
  379. package/dist/runtime/wakeAcceptanceProcessIdentity.js +50 -0
  380. package/dist/runtime/wakeAcceptanceReconciliation.d.ts +211 -0
  381. package/dist/runtime/wakeAcceptanceReconciliation.d.ts.map +1 -0
  382. package/dist/runtime/wakeAcceptanceReconciliation.js +289 -0
  383. package/dist/runtime/wakeAcceptanceRecord.d.ts +23 -0
  384. package/dist/runtime/wakeAcceptanceRecord.d.ts.map +1 -0
  385. package/dist/runtime/wakeAcceptanceRecord.js +56 -0
  386. package/dist/runtime/wakeAcceptanceRetention.d.ts +12 -0
  387. package/dist/runtime/wakeAcceptanceRetention.d.ts.map +1 -0
  388. package/dist/runtime/wakeAcceptanceRetention.js +12 -0
  389. package/dist/runtime/wakeAcceptanceStore.d.ts +113 -0
  390. package/dist/runtime/wakeAcceptanceStore.d.ts.map +1 -0
  391. package/dist/runtime/wakeAcceptanceStore.js +558 -0
  392. package/dist/runtime/wakeAcceptanceTypes.d.ts +179 -0
  393. package/dist/runtime/wakeAcceptanceTypes.d.ts.map +1 -0
  394. package/dist/runtime/wakeAcceptanceTypes.js +95 -0
  395. package/dist/runtime/wakeFuse.d.ts +69 -0
  396. package/dist/runtime/wakeFuse.d.ts.map +1 -0
  397. package/dist/runtime/wakeFuse.js +367 -0
  398. package/package.json +25 -17
  399. package/dist/examples/mixed-engine-org.d.ts +0 -2
  400. package/dist/examples/mixed-engine-org.d.ts.map +0 -1
  401. package/dist/examples/mixed-engine-org.js +0 -351
  402. package/dist/examples/mixedEngineCli.d.ts +0 -15
  403. package/dist/examples/mixedEngineCli.d.ts.map +0 -1
  404. package/dist/examples/mixedEngineCli.js +0 -174
@@ -0,0 +1,50 @@
1
+ import { readFile, stat } from "node:fs/promises";
2
+ export class WakeTransitionLockBlockedError extends Error {
3
+ code = "offline_reconciliation_required";
4
+ constructor() { super("wake transition lock requires offline reconciliation"); }
5
+ }
6
+ export function sameNamespace(left, right) { return left.pid_namespace_dev === right.pid_namespace_dev && left.pid_namespace_ino === right.pid_namespace_ino; }
7
+ export async function currentProcessIdentity() {
8
+ if (process.platform !== "linux")
9
+ throw new Error("wake transition locks require Linux process identity");
10
+ const boot_id = (await readFile("/proc/sys/kernel/random/boot_id", "utf8")).trim();
11
+ if (!boot_id)
12
+ throw new Error("wake transition owner identity is invalid");
13
+ return { pid: process.pid, process_start: await linuxProcessStart(process.pid), boot_id, ...await linuxPidNamespace() };
14
+ }
15
+ export async function processIsAlive(lock) {
16
+ if (process.platform !== "linux")
17
+ throw new Error("wake transition lock liveness is unsupported");
18
+ if (!sameNamespace(lock, await linuxPidNamespace()))
19
+ throw new WakeTransitionLockBlockedError();
20
+ const boot = (await readFile("/proc/sys/kernel/random/boot_id", "utf8")).trim();
21
+ if (!boot)
22
+ throw new Error("wake transition owner liveness cannot be proven");
23
+ if (boot !== lock.boot_id)
24
+ return false;
25
+ try {
26
+ return await linuxProcessStart(lock.pid) === lock.process_start;
27
+ }
28
+ catch (error) {
29
+ if (error.code === "ENOENT")
30
+ return false;
31
+ throw new Error("wake transition owner liveness cannot be proven");
32
+ }
33
+ }
34
+ async function linuxProcessStart(pid) {
35
+ const stat = await readFile(`/proc/${pid}/stat`, "utf8");
36
+ const close = stat.lastIndexOf(")");
37
+ const fields = stat.slice(close + 2).trim().split(/\s+/u);
38
+ const start = fields[19];
39
+ if (close < 0 || start === undefined || !/^\d+$/u.test(start))
40
+ throw new Error("wake transition owner identity is invalid");
41
+ return start;
42
+ }
43
+ async function linuxPidNamespace() {
44
+ const identity = await stat("/proc/self/ns/pid");
45
+ const pid_namespace_dev = Number(identity.dev);
46
+ const pid_namespace_ino = Number(identity.ino);
47
+ if (!Number.isSafeInteger(pid_namespace_dev) || !Number.isSafeInteger(pid_namespace_ino) || pid_namespace_dev < 1 || pid_namespace_ino < 1)
48
+ throw new Error("wake transition owner identity is invalid");
49
+ return { pid_namespace_dev, pid_namespace_ino };
50
+ }
@@ -0,0 +1,211 @@
1
+ import { open } from "node:fs/promises";
2
+ import { type StoreHostRegistration, type StoreHostRegistrationIdentity } from "./storeCoordination.js";
3
+ export declare const OFFLINE_RECONCILIATION_VERSION: "noopolis.daimon.offline-transition-reconciliation.v1";
4
+ export declare const OFFLINE_RECONCILIATION_BLOCKED_CODE: "offline_reconciliation_required";
5
+ declare const RECEIPT_VERSION: "noopolis.daimon.offline-transition-reconciliation-receipt.v1";
6
+ export declare const OFFLINE_RECONCILIATION_REQUEST_SCHEMA: {
7
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
8
+ readonly $id: "noopolis.daimon.offline-transition-reconciliation.v1";
9
+ readonly type: "object";
10
+ readonly additionalProperties: false;
11
+ readonly required: readonly ["version", "agent_id", "delivery_id", "store", "lock", "attestation"];
12
+ readonly properties: {
13
+ readonly version: {
14
+ readonly const: "noopolis.daimon.offline-transition-reconciliation.v1";
15
+ };
16
+ readonly agent_id: {
17
+ readonly type: "string";
18
+ readonly minLength: 1;
19
+ readonly maxLength: 16384;
20
+ };
21
+ readonly delivery_id: {
22
+ readonly type: "string";
23
+ readonly minLength: 1;
24
+ readonly maxLength: 16384;
25
+ };
26
+ readonly store: {
27
+ readonly type: "object";
28
+ readonly additionalProperties: false;
29
+ readonly required: readonly ["dev", "ino"];
30
+ readonly properties: {
31
+ readonly dev: {
32
+ readonly type: "integer";
33
+ readonly minimum: 1;
34
+ };
35
+ readonly ino: {
36
+ readonly type: "integer";
37
+ readonly minimum: 1;
38
+ };
39
+ };
40
+ };
41
+ readonly lock: {
42
+ readonly type: "object";
43
+ readonly additionalProperties: false;
44
+ readonly required: readonly ["dev", "ino", "owner_id", "generation", "pid", "process_start", "boot_id", "pid_namespace_dev", "pid_namespace_ino"];
45
+ readonly properties: {
46
+ readonly dev: {
47
+ readonly type: "integer";
48
+ readonly minimum: 1;
49
+ };
50
+ readonly ino: {
51
+ readonly type: "integer";
52
+ readonly minimum: 1;
53
+ };
54
+ readonly owner_id: {
55
+ readonly type: "string";
56
+ };
57
+ readonly generation: {
58
+ readonly type: "string";
59
+ };
60
+ readonly pid: {
61
+ readonly type: "integer";
62
+ readonly minimum: 1;
63
+ };
64
+ readonly process_start: {
65
+ readonly type: "string";
66
+ };
67
+ readonly boot_id: {
68
+ readonly type: "string";
69
+ };
70
+ readonly pid_namespace_dev: {
71
+ readonly type: "integer";
72
+ readonly minimum: 1;
73
+ };
74
+ readonly pid_namespace_ino: {
75
+ readonly type: "integer";
76
+ readonly minimum: 1;
77
+ };
78
+ };
79
+ };
80
+ readonly attestation: {
81
+ readonly type: "object";
82
+ readonly additionalProperties: false;
83
+ readonly required: readonly ["version", "authority_id", "attestation_id", "state", "proof"];
84
+ readonly properties: {
85
+ readonly version: {
86
+ readonly const: "noopolis.deployment.container-quiescence.v1";
87
+ };
88
+ readonly authority_id: {
89
+ readonly type: "string";
90
+ readonly minLength: 1;
91
+ readonly maxLength: 16384;
92
+ };
93
+ readonly attestation_id: {
94
+ readonly type: "string";
95
+ readonly minLength: 1;
96
+ readonly maxLength: 16384;
97
+ };
98
+ readonly state: {
99
+ readonly enum: readonly ["absent", "quiescent"];
100
+ };
101
+ readonly proof: {
102
+ readonly type: "string";
103
+ readonly minLength: 1;
104
+ readonly maxLength: 16384;
105
+ };
106
+ };
107
+ };
108
+ };
109
+ };
110
+ type Identity = Readonly<{
111
+ dev: number;
112
+ ino: number;
113
+ }>;
114
+ type Lock = Readonly<{
115
+ dev: number;
116
+ ino: number;
117
+ owner_id: string;
118
+ generation: string;
119
+ pid: number;
120
+ process_start: string;
121
+ boot_id: string;
122
+ pid_namespace_dev: number;
123
+ pid_namespace_ino: number;
124
+ }>;
125
+ type Lease = Readonly<{
126
+ owner_id: string;
127
+ pid: number;
128
+ process_start: string;
129
+ boot_id: string;
130
+ pid_namespace_dev: number;
131
+ pid_namespace_ino: number;
132
+ }>;
133
+ export type OfflineDeploymentAttestation = Readonly<{
134
+ version: "noopolis.deployment.container-quiescence.v1";
135
+ authority_id: string;
136
+ attestation_id: string;
137
+ state: "absent" | "quiescent";
138
+ proof: string;
139
+ }>;
140
+ export type OfflineTransitionReconciliationRequest = Readonly<{
141
+ version: typeof OFFLINE_RECONCILIATION_VERSION;
142
+ agent_id: string;
143
+ delivery_id: string;
144
+ store: Identity;
145
+ lock: Lock;
146
+ attestation: OfflineDeploymentAttestation;
147
+ }>;
148
+ export type OfflineTransitionReconciliationAuthorizationContext = Readonly<{
149
+ version: "noopolis.daimon.offline-transition-authorization-context.v1";
150
+ deployment_identity: string;
151
+ deployment_state: "absent" | "quiescent";
152
+ nonce: string;
153
+ request_digest: string;
154
+ agent_id: string;
155
+ delivery_id: string;
156
+ store: Identity;
157
+ lock: Lock;
158
+ stale_host_registrations: readonly StoreHostRegistrationIdentity[];
159
+ }>;
160
+ export type OfflineTransitionReconciliationProofReceipt = Readonly<{
161
+ request_digest: string;
162
+ nonce: string;
163
+ exclusive_store: true;
164
+ authorized_registration_digests: readonly string[];
165
+ }>;
166
+ export type OfflineTransitionReconciliationReceipt = Readonly<{
167
+ version: typeof RECEIPT_VERSION;
168
+ reconciliation_id: string;
169
+ request_digest: string;
170
+ state: "reconciled";
171
+ reconciled_at: string;
172
+ cleared_registration_digests: readonly string[];
173
+ }>;
174
+ export type OfflineTransitionReconciliationResult = OfflineTransitionReconciliationReceipt | Readonly<{
175
+ version: typeof OFFLINE_RECONCILIATION_VERSION;
176
+ state: "blocked";
177
+ code: typeof OFFLINE_RECONCILIATION_BLOCKED_CODE;
178
+ }>;
179
+ export type OfflineTransitionReconciliationOptions = Readonly<{
180
+ storePath: string;
181
+ verifyDeploymentAttestation: (context: OfflineTransitionReconciliationAuthorizationContext, attestation: OfflineDeploymentAttestation) => Promise<OfflineTransitionReconciliationProofReceipt>;
182
+ leaseIdentity?: () => Promise<Lease>;
183
+ leaseLiveness?: (lease: Lease) => Promise<boolean>;
184
+ hostLiveness?: (host: StoreHostRegistration) => Promise<boolean>;
185
+ }>;
186
+ /** Deployment-only: caller must exclusively mount the private store offline. */
187
+ export declare function reconcileOfflineWakeTransition(value: unknown, options: OfflineTransitionReconciliationOptions): Promise<OfflineTransitionReconciliationResult>;
188
+ export declare function parseOfflineTransitionReconciliationRequest(value: unknown): OfflineTransitionReconciliationRequest;
189
+ export declare class OfflineTransitionReconciliationBlockedError extends Error {
190
+ readonly code: "offline_reconciliation_required";
191
+ constructor();
192
+ }
193
+ /** Normal hosts may start only after the durable offline lease is absent. */
194
+ export declare function assertOfflineReconciliationLeaseAvailable(root: string): Promise<void>;
195
+ /**
196
+ * Publishes `value` at `target` only if `target` does not already exist, and
197
+ * only ever under complete, fsynced content — the name never appears holding a
198
+ * partial or zero-byte document, which `readLease` would otherwise accept as a
199
+ * safe file and then fail to `JSON.parse`.
200
+ *
201
+ * `link(2)` is mandatory here and `rename(2)` is FORBIDDEN. rename overwrites
202
+ * its destination unconditionally, so two acquirers that both pass the
203
+ * (non-atomic) `readLeaseOptional` pre-check would both publish and both
204
+ * believe they hold the exclusive offline-reconciliation lease. link fails with
205
+ * EEXIST when the target exists, which is the mutual exclusion `acquireLease`
206
+ * converts into a blocked result. Exported solely so that contract can be
207
+ * asserted directly; it is not re-exported from `./index.ts`.
208
+ */
209
+ export declare function publishExclusive(target: string, value: unknown, directory: Awaited<ReturnType<typeof open>>): Promise<void>;
210
+ export {};
211
+ //# sourceMappingURL=wakeAcceptanceReconciliation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wakeAcceptanceReconciliation.d.ts","sourceRoot":"","sources":["../../src/runtime/wakeAcceptanceReconciliation.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,289 @@
1
+ import { createHash, randomUUID } from "node:crypto";
2
+ import { constants } from "node:fs";
3
+ import { link, lstat, open, readFile, realpath, rename, stat, unlink } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { clearDeadHostRegistrations, hostRegistrationDigest, listHostRegistrations } from "./storeCoordination.js";
6
+ export const OFFLINE_RECONCILIATION_VERSION = "noopolis.daimon.offline-transition-reconciliation.v1";
7
+ export const OFFLINE_RECONCILIATION_BLOCKED_CODE = "offline_reconciliation_required";
8
+ const MAX_BYTES = 16_384;
9
+ const RECEIPT_VERSION = "noopolis.daimon.offline-transition-reconciliation-receipt.v1";
10
+ export const OFFLINE_RECONCILIATION_REQUEST_SCHEMA = {
11
+ $schema: "https://json-schema.org/draft/2020-12/schema", $id: OFFLINE_RECONCILIATION_VERSION, type: "object", additionalProperties: false,
12
+ required: ["version", "agent_id", "delivery_id", "store", "lock", "attestation"], properties: {
13
+ version: { const: OFFLINE_RECONCILIATION_VERSION }, agent_id: { type: "string", minLength: 1, maxLength: MAX_BYTES }, delivery_id: { type: "string", minLength: 1, maxLength: MAX_BYTES },
14
+ store: { type: "object", additionalProperties: false, required: ["dev", "ino"], properties: { dev: { type: "integer", minimum: 1 }, ino: { type: "integer", minimum: 1 } } },
15
+ lock: { type: "object", additionalProperties: false, required: ["dev", "ino", "owner_id", "generation", "pid", "process_start", "boot_id", "pid_namespace_dev", "pid_namespace_ino"], properties: { dev: { type: "integer", minimum: 1 }, ino: { type: "integer", minimum: 1 }, owner_id: { type: "string" }, generation: { type: "string" }, pid: { type: "integer", minimum: 1 }, process_start: { type: "string" }, boot_id: { type: "string" }, pid_namespace_dev: { type: "integer", minimum: 1 }, pid_namespace_ino: { type: "integer", minimum: 1 } } },
16
+ attestation: { type: "object", additionalProperties: false, required: ["version", "authority_id", "attestation_id", "state", "proof"], properties: { version: { const: "noopolis.deployment.container-quiescence.v1" }, authority_id: { type: "string", minLength: 1, maxLength: MAX_BYTES }, attestation_id: { type: "string", minLength: 1, maxLength: MAX_BYTES }, state: { enum: ["absent", "quiescent"] }, proof: { type: "string", minLength: 1, maxLength: MAX_BYTES } } }
17
+ }
18
+ };
19
+ /** Deployment-only: caller must exclusively mount the private store offline. */
20
+ export async function reconcileOfflineWakeTransition(value, options) {
21
+ try {
22
+ const request = parseOfflineTransitionReconciliationRequest(value);
23
+ const root = await openStore(options.storePath, request.store);
24
+ try {
25
+ const lease = await acquireLease(root.path, root.directory, await (options.leaseIdentity ?? currentLeaseIdentity)(), options.leaseLiveness ?? leaseIsAlive);
26
+ if (lease === undefined)
27
+ return blocked();
28
+ try {
29
+ const target = lockPath(root.path, request.agent_id, request.delivery_id);
30
+ const receiptPath = receiptFile(root.path, request);
31
+ let receipt = await readReceiptOptional(receiptPath);
32
+ if (receipt !== undefined && receipt.request_digest !== digest(request))
33
+ return blocked();
34
+ if (receipt?.state === "reconciled")
35
+ return publicReceipt(receipt);
36
+ const context = authorizationContext(request, await listHostRegistrations(root.path));
37
+ const proof = await options.verifyDeploymentAttestation(context, request.attestation).catch(() => { throw new OfflineTransitionReconciliationBlockedError(); });
38
+ if (!sameProofReceipt(proof, context))
39
+ throw new OfflineTransitionReconciliationBlockedError();
40
+ const cleared = await clearDeadHostRegistrations(root.path, root.directory, lease, options.hostLiveness ?? leaseIsAlive, new Set(proof.authorized_registration_digests)).catch(() => undefined);
41
+ if (cleared === undefined)
42
+ return blocked();
43
+ await assertStore(root, request.store);
44
+ await assertRecord(recordPath(root.path, request.agent_id, request.delivery_id), request);
45
+ if (receipt === undefined)
46
+ receipt = await writeReceipt(receiptPath, { version: RECEIPT_VERSION, reconciliation_id: randomUUID(), request_digest: digest(request), state: "prepared", reconciled_at: "", cleared_registration_digests: [] }, root.directory);
47
+ const lock = await readLockOptional(target);
48
+ if (lock !== undefined) {
49
+ if (!same(lock, request.lock) || !same(await lstat(target), request.lock))
50
+ throw new OfflineTransitionReconciliationBlockedError();
51
+ await assertStore(root, request.store);
52
+ await assertRecord(recordPath(root.path, request.agent_id, request.delivery_id), request);
53
+ await unlink(target);
54
+ await root.directory.sync();
55
+ }
56
+ const reconciled = { ...receipt, state: "reconciled", reconciled_at: new Date().toISOString(), cleared_registration_digests: uniqueDigests([...receipt.cleared_registration_digests, ...cleared]) };
57
+ await replaceReceipt(receiptPath, reconciled, root.directory);
58
+ return publicReceipt(reconciled);
59
+ }
60
+ finally {
61
+ await releaseLease(lease, root.directory, root.path);
62
+ }
63
+ }
64
+ finally {
65
+ await root.directory.close();
66
+ }
67
+ }
68
+ catch (error) {
69
+ if (error instanceof OfflineTransitionReconciliationBlockedError)
70
+ return blocked();
71
+ throw error;
72
+ }
73
+ }
74
+ export function parseOfflineTransitionReconciliationRequest(value) {
75
+ const root = strictRecord(value, ["version", "agent_id", "delivery_id", "store", "lock", "attestation"]);
76
+ if (text(root.version) !== OFFLINE_RECONCILIATION_VERSION)
77
+ throw new TypeError("offline reconciliation version is unsupported");
78
+ const store = strictRecord(root.store, ["dev", "ino"]);
79
+ const lock = strictRecord(root.lock, ["dev", "ino", "owner_id", "generation", "pid", "process_start", "boot_id", "pid_namespace_dev", "pid_namespace_ino"]);
80
+ const attestation = strictRecord(root.attestation, ["version", "authority_id", "attestation_id", "state", "proof"]);
81
+ const state = text(attestation.state);
82
+ if (text(attestation.version) !== "noopolis.deployment.container-quiescence.v1" || (state !== "absent" && state !== "quiescent"))
83
+ throw new TypeError("offline reconciliation attestation is invalid");
84
+ const parsedLock = { dev: positive(lock.dev), ino: positive(lock.ino), owner_id: uuid(lock.owner_id), generation: uuid(lock.generation), pid: positive(lock.pid), process_start: nonBlank(lock.process_start), boot_id: nonBlank(lock.boot_id), pid_namespace_dev: positive(lock.pid_namespace_dev), pid_namespace_ino: positive(lock.pid_namespace_ino) };
85
+ return { version: OFFLINE_RECONCILIATION_VERSION, agent_id: nonBlank(root.agent_id), delivery_id: nonBlank(root.delivery_id), store: { dev: positive(store.dev), ino: positive(store.ino) }, lock: parsedLock, attestation: { version: "noopolis.deployment.container-quiescence.v1", authority_id: nonBlank(attestation.authority_id), attestation_id: nonBlank(attestation.attestation_id), state, proof: nonBlank(attestation.proof) } };
86
+ }
87
+ export class OfflineTransitionReconciliationBlockedError extends Error {
88
+ code = OFFLINE_RECONCILIATION_BLOCKED_CODE;
89
+ constructor() { super("offline transition reconciliation is blocked"); }
90
+ }
91
+ /** Normal hosts may start only after the durable offline lease is absent. */
92
+ export async function assertOfflineReconciliationLeaseAvailable(root) { if (await readLeaseOptional(path.join(root, ".offline-reconciliation.lock")) !== undefined)
93
+ throw new OfflineTransitionReconciliationBlockedError(); }
94
+ async function openStore(root, expected) {
95
+ if (!path.isAbsolute(root))
96
+ throw new OfflineTransitionReconciliationBlockedError();
97
+ await assertNoLinks(root);
98
+ const before = await lstat(root);
99
+ if (!before.isDirectory() || before.isSymbolicLink() || before.uid !== process.getuid?.() || (before.mode & 0o777) !== 0o700 || !same(before, expected))
100
+ throw new OfflineTransitionReconciliationBlockedError();
101
+ const directory = await open(root, constants.O_RDONLY | directoryFlag() | noFollow());
102
+ try {
103
+ const canonical = await realpath(root);
104
+ if (!same(await directory.stat(), expected))
105
+ throw new OfflineTransitionReconciliationBlockedError();
106
+ return { path: canonical, directory };
107
+ }
108
+ catch (error) {
109
+ await directory.close().catch(() => undefined);
110
+ throw error;
111
+ }
112
+ }
113
+ async function assertStore(root, expected) { await assertNoLinks(root.path); if (!same(await lstat(root.path), expected) || !same(await root.directory.stat(), expected) || await realpath(root.path) !== root.path)
114
+ throw new OfflineTransitionReconciliationBlockedError(); }
115
+ /**
116
+ * Publishes `value` at `target` only if `target` does not already exist, and
117
+ * only ever under complete, fsynced content — the name never appears holding a
118
+ * partial or zero-byte document, which `readLease` would otherwise accept as a
119
+ * safe file and then fail to `JSON.parse`.
120
+ *
121
+ * `link(2)` is mandatory here and `rename(2)` is FORBIDDEN. rename overwrites
122
+ * its destination unconditionally, so two acquirers that both pass the
123
+ * (non-atomic) `readLeaseOptional` pre-check would both publish and both
124
+ * believe they hold the exclusive offline-reconciliation lease. link fails with
125
+ * EEXIST when the target exists, which is the mutual exclusion `acquireLease`
126
+ * converts into a blocked result. Exported solely so that contract can be
127
+ * asserted directly; it is not re-exported from `./index.ts`.
128
+ */
129
+ export async function publishExclusive(target, value, directory) { const temp = `${target}.${randomUUID()}`; try {
130
+ await writeNew(temp, value);
131
+ await link(temp, target);
132
+ await directory.sync();
133
+ }
134
+ finally {
135
+ await unlink(temp).catch(() => undefined);
136
+ } }
137
+ async function acquireLease(root, directory, owner, liveness) { const target = path.join(root, ".offline-reconciliation.lock"); const current = await readLeaseOptional(target); if (current !== undefined) {
138
+ if (!sameNamespace(current, owner) || await liveness(current))
139
+ return undefined;
140
+ await unlink(target);
141
+ await directory.sync();
142
+ } try {
143
+ await publishExclusive(target, owner, directory);
144
+ return owner;
145
+ }
146
+ catch (error) {
147
+ if (error.code === "EEXIST")
148
+ return undefined;
149
+ throw error;
150
+ } }
151
+ async function releaseLease(lease, directory, root) { const target = path.join(root, ".offline-reconciliation.lock"); const current = await readLease(target); if (!sameLease(current, lease))
152
+ throw new OfflineTransitionReconciliationBlockedError(); await unlink(target); await directory.sync(); }
153
+ function lockPath(root, agent, delivery) { return path.join(root, `${createHash("sha256").update(`${agent}\u0000${delivery}`).digest("hex")}.transition-lock`); }
154
+ function recordPath(root, agent, delivery) { return path.join(root, `${createHash("sha256").update(`${agent}\u0000${delivery}`).digest("hex")}.json`); }
155
+ function receiptFile(root, request) { return path.join(root, `.reconcile-${createHash("sha256").update(JSON.stringify({ store: request.store, lock: request.lock })).digest("hex")}.json`); }
156
+ function digest(request) { return createHash("sha256").update(JSON.stringify(request)).digest("hex"); }
157
+ function authorizationContext(request, stale_host_registrations) { return { version: "noopolis.daimon.offline-transition-authorization-context.v1", deployment_identity: request.attestation.authority_id, deployment_state: request.attestation.state, nonce: request.attestation.attestation_id, request_digest: digest({ request, stale_host_registrations }), agent_id: request.agent_id, delivery_id: request.delivery_id, store: request.store, lock: request.lock, stale_host_registrations }; }
158
+ function sameProofReceipt(value, context) { try {
159
+ const proof = strictRecord(value, ["request_digest", "nonce", "exclusive_store", "authorized_registration_digests"]);
160
+ return text(proof.request_digest) === context.request_digest && text(proof.nonce) === context.nonce && proof.exclusive_store === true && Array.isArray(proof.authorized_registration_digests) && proof.authorized_registration_digests.every((item) => /^[a-f0-9]{64}$/u.test(text(item))) && proof.authorized_registration_digests.every((item) => context.stale_host_registrations.some((host) => hostRegistrationDigest(host) === item));
161
+ }
162
+ catch {
163
+ return false;
164
+ } }
165
+ async function readLock(file) { const entry = await lstat(file); if (!safeFile(entry))
166
+ throw new OfflineTransitionReconciliationBlockedError(); const value = strictRecord(JSON.parse((await readFile(file)).toString("utf8")), ["owner_id", "generation", "pid", "process_start", "boot_id", "pid_namespace_dev", "pid_namespace_ino"]); return { dev: Number(entry.dev), ino: Number(entry.ino), owner_id: uuid(value.owner_id), generation: uuid(value.generation), pid: positive(value.pid), process_start: nonBlank(value.process_start), boot_id: nonBlank(value.boot_id), pid_namespace_dev: positive(value.pid_namespace_dev), pid_namespace_ino: positive(value.pid_namespace_ino) }; }
167
+ async function readLease(file) { const entry = await lstat(file); if (!safeFile(entry))
168
+ throw new OfflineTransitionReconciliationBlockedError(); const value = strictRecord(JSON.parse((await readFile(file)).toString("utf8")), ["owner_id", "pid", "process_start", "boot_id", "pid_namespace_dev", "pid_namespace_ino"]); return { owner_id: uuid(value.owner_id), pid: positive(value.pid), process_start: nonBlank(value.process_start), boot_id: nonBlank(value.boot_id), pid_namespace_dev: positive(value.pid_namespace_dev), pid_namespace_ino: positive(value.pid_namespace_ino) }; }
169
+ async function readLeaseOptional(file) { try {
170
+ return await readLease(file);
171
+ }
172
+ catch (error) {
173
+ if (error.code === "ENOENT")
174
+ return undefined;
175
+ throw error;
176
+ } }
177
+ async function readLockOptional(file) { try {
178
+ return await readLock(file);
179
+ }
180
+ catch (error) {
181
+ if (error.code === "ENOENT")
182
+ return undefined;
183
+ throw error;
184
+ } }
185
+ async function assertRecord(file, request) { const entry = await lstat(file).catch(() => { throw new OfflineTransitionReconciliationBlockedError(); }); if (!safeFile(entry))
186
+ throw new OfflineTransitionReconciliationBlockedError(); const value = JSON.parse((await readFile(file)).toString("utf8")); if (value === null || typeof value !== "object" || Array.isArray(value))
187
+ throw new OfflineTransitionReconciliationBlockedError(); const record = value; if (record.agent_id !== request.agent_id || record.delivery_id !== request.delivery_id)
188
+ throw new OfflineTransitionReconciliationBlockedError(); }
189
+ async function readReceiptOptional(file) { try {
190
+ const entry = await lstat(file);
191
+ if (!safeFile(entry))
192
+ throw new OfflineTransitionReconciliationBlockedError();
193
+ const value = strictRecord(JSON.parse((await readFile(file)).toString("utf8")), ["version", "reconciliation_id", "request_digest", "state", "reconciled_at", "cleared_registration_digests"]);
194
+ const state = text(value.state);
195
+ const cleared_registration_digests = digests(value.cleared_registration_digests);
196
+ if (text(value.version) !== RECEIPT_VERSION || (state !== "prepared" && state !== "reconciled") || !/^[a-f0-9]{64}$/u.test(text(value.request_digest)))
197
+ throw new OfflineTransitionReconciliationBlockedError();
198
+ const receipt = { version: RECEIPT_VERSION, reconciliation_id: uuid(value.reconciliation_id), request_digest: text(value.request_digest), state, reconciled_at: text(value.reconciled_at), cleared_registration_digests };
199
+ if (state === "prepared" && receipt.reconciled_at)
200
+ throw new OfflineTransitionReconciliationBlockedError();
201
+ if (state === "reconciled" && !receipt.reconciled_at)
202
+ throw new OfflineTransitionReconciliationBlockedError();
203
+ return receipt;
204
+ }
205
+ catch (error) {
206
+ if (error.code === "ENOENT")
207
+ return undefined;
208
+ throw error;
209
+ } }
210
+ async function writeReceipt(target, receipt, directory) { const temp = `${target}.${randomUUID()}`; try {
211
+ await writeNew(temp, receipt);
212
+ await link(temp, target);
213
+ await directory.sync();
214
+ return receipt;
215
+ }
216
+ catch (error) {
217
+ if (error.code === "EEXIST")
218
+ throw new OfflineTransitionReconciliationBlockedError();
219
+ throw error;
220
+ }
221
+ finally {
222
+ await unlink(temp).catch(() => undefined);
223
+ } }
224
+ async function replaceReceipt(target, receipt, directory) { const temp = `${target}.${randomUUID()}`; try {
225
+ await writeNew(temp, receipt);
226
+ await rename(temp, target);
227
+ await directory.sync();
228
+ }
229
+ finally {
230
+ await unlink(temp).catch(() => undefined);
231
+ } }
232
+ async function writeNew(file, value) { const handle = await open(file, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | noFollow(), 0o600); try {
233
+ await handle.writeFile(JSON.stringify(value));
234
+ await handle.sync();
235
+ }
236
+ finally {
237
+ await handle.close();
238
+ } }
239
+ function publicReceipt(receipt) { return receipt; }
240
+ function blocked() { return { version: OFFLINE_RECONCILIATION_VERSION, state: "blocked", code: OFFLINE_RECONCILIATION_BLOCKED_CODE }; }
241
+ function strictRecord(value, keys) { if (value === null || typeof value !== "object" || Array.isArray(value) || (Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null))
242
+ throw new TypeError("offline reconciliation request is invalid"); const result = Object.create(null); for (const key of Reflect.ownKeys(value)) {
243
+ if (typeof key !== "string")
244
+ throw new TypeError("offline reconciliation request is invalid");
245
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
246
+ if (descriptor === undefined || !descriptor.enumerable || !("value" in descriptor))
247
+ throw new TypeError("offline reconciliation request is invalid");
248
+ result[key] = descriptor.value;
249
+ } if (Object.keys(result).length !== keys.length || keys.some((key) => !Object.hasOwn(result, key)))
250
+ throw new TypeError("offline reconciliation request is invalid"); return result; }
251
+ function text(value) { if (typeof value !== "string" || Buffer.byteLength(value, "utf8") > MAX_BYTES)
252
+ throw new TypeError("offline reconciliation request is invalid"); return value; }
253
+ function nonBlank(value) { const result = text(value); if (!result.trim())
254
+ throw new TypeError("offline reconciliation request is invalid"); return result; }
255
+ function uuid(value) { const result = nonBlank(value); if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu.test(result))
256
+ throw new TypeError("offline reconciliation request is invalid"); return result; }
257
+ function positive(value) { if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 1)
258
+ throw new TypeError("offline reconciliation request is invalid"); return value; }
259
+ function digests(value) { if (!Array.isArray(value) || value.length > 128 || value.some((item) => !/^[a-f0-9]{64}$/u.test(text(item))))
260
+ throw new OfflineTransitionReconciliationBlockedError(); return uniqueDigests(value); }
261
+ function uniqueDigests(values) { return [...new Set(values)].sort(); }
262
+ function same(left, right) { return Number(left.dev) === right.dev && Number(left.ino) === right.ino; }
263
+ function sameNamespace(left, right) { return left.pid_namespace_dev === right.pid_namespace_dev && left.pid_namespace_ino === right.pid_namespace_ino; }
264
+ function sameLease(left, right) { return left.owner_id === right.owner_id && left.pid === right.pid && left.process_start === right.process_start && left.boot_id === right.boot_id && sameNamespace(left, right); }
265
+ function safeFile(entry) { return entry.isFile() && !entry.isSymbolicLink() && Number(entry.uid) === process.getuid?.() && (Number(entry.mode) & 0o777) === 0o600 && Number(entry.size) <= MAX_BYTES; }
266
+ function noFollow() { return constants.O_NOFOLLOW ?? 0; }
267
+ function directoryFlag() { return constants.O_DIRECTORY ?? 0; }
268
+ async function assertNoLinks(target) { let current = path.parse(target).root; for (const part of path.relative(current, target).split(path.sep).filter(Boolean)) {
269
+ current = path.join(current, part);
270
+ if ((await lstat(current)).isSymbolicLink() && current !== "/var")
271
+ throw new OfflineTransitionReconciliationBlockedError();
272
+ } }
273
+ async function currentLeaseIdentity() { if (process.platform !== "linux")
274
+ throw new OfflineTransitionReconciliationBlockedError(); const boot_id = (await readFile("/proc/sys/kernel/random/boot_id", "utf8")).trim(); const namespace = await stat("/proc/self/ns/pid"); const process_start = await linuxProcessStart(process.pid); if (!boot_id || !Number.isSafeInteger(Number(namespace.dev)) || !Number.isSafeInteger(Number(namespace.ino)))
275
+ throw new OfflineTransitionReconciliationBlockedError(); return { owner_id: randomUUID(), pid: process.pid, process_start, boot_id, pid_namespace_dev: Number(namespace.dev), pid_namespace_ino: Number(namespace.ino) }; }
276
+ async function leaseIsAlive(lease) { if (process.platform !== "linux")
277
+ throw new OfflineTransitionReconciliationBlockedError(); const namespace = await stat("/proc/self/ns/pid"); if (!sameNamespace(lease, { pid_namespace_dev: Number(namespace.dev), pid_namespace_ino: Number(namespace.ino) }))
278
+ throw new OfflineTransitionReconciliationBlockedError(); const boot = (await readFile("/proc/sys/kernel/random/boot_id", "utf8")).trim(); if (!boot)
279
+ throw new OfflineTransitionReconciliationBlockedError(); if (boot !== lease.boot_id)
280
+ return false; try {
281
+ return await linuxProcessStart(lease.pid) === lease.process_start;
282
+ }
283
+ catch (error) {
284
+ if (error.code === "ENOENT")
285
+ return false;
286
+ throw new OfflineTransitionReconciliationBlockedError();
287
+ } }
288
+ async function linuxProcessStart(pid) { const statText = await readFile(`/proc/${pid}/stat`, "utf8"); const close = statText.lastIndexOf(")"); const start = statText.slice(close + 2).trim().split(/\s+/u)[19]; if (close < 0 || start === undefined || !/^\d+$/u.test(start))
289
+ throw new OfflineTransitionReconciliationBlockedError(); return start; }
@@ -0,0 +1,23 @@
1
+ import { type OrganizationRuntimeWakeAcceptance, type OrganizationRuntimeWakeAcceptanceRequest, type OrganizationRuntimeWakeReceiptStatus, type WakeReceiptCode, type WakeReceiptState } from "./wakeAcceptanceTypes.js";
2
+ export type StoredWakeAcceptanceRecord = Readonly<{
3
+ acceptance_id: string;
4
+ agent_id: string;
5
+ delivery_id: string;
6
+ request_digest: string;
7
+ event: OrganizationRuntimeWakeAcceptanceRequest["event"];
8
+ state: WakeReceiptState;
9
+ accepted_at: string;
10
+ updated_at: string;
11
+ claim_generation?: string;
12
+ execution_id?: string;
13
+ deferred?: boolean;
14
+ execution_error?: string;
15
+ code?: WakeReceiptCode;
16
+ text?: string;
17
+ }>;
18
+ export declare function publicAcceptance(record: StoredWakeAcceptanceRecord): OrganizationRuntimeWakeAcceptance;
19
+ export declare function publicStatus(record: StoredWakeAcceptanceRecord): OrganizationRuntimeWakeReceiptStatus;
20
+ export declare function parseStoredWakeAcceptance(value: unknown): StoredWakeAcceptanceRecord;
21
+ /** Private failure diagnostic, surfaced through the existing availability error. */
22
+ export declare function sanitizeExecutionError(value: string): string;
23
+ //# sourceMappingURL=wakeAcceptanceRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wakeAcceptanceRecord.d.ts","sourceRoot":"","sources":["../../src/runtime/wakeAcceptanceRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,iCAAiC,EACtC,KAAK,wCAAwC,EAC7C,KAAK,oCAAoC,EACzC,KAAK,eAAe,EACpB,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,aAAa,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IACrF,KAAK,EAAE,wCAAwC,CAAC,OAAO,CAAC,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAClF,WAAW,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,eAAe,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CAChL,CAAC,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,0BAA0B,GAAG,iCAAiC,CAEtG;AACD,wBAAgB,YAAY,CAAC,MAAM,EAAE,0BAA0B,GAAG,oCAAoC,CAErG;AACD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,0BAA0B,CA0BpF;AAMD,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D"}