@noopolis/daimon 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (422) hide show
  1. package/README.md +275 -51
  2. package/dist/contracts/attentionContract.d.ts +142 -0
  3. package/dist/contracts/attentionContract.d.ts.map +1 -0
  4. package/dist/contracts/attentionContract.js +21 -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/grokBrokerTaskClock.d.ts +18 -0
  9. package/dist/contracts/grokBrokerTaskClock.d.ts.map +1 -0
  10. package/dist/contracts/grokBrokerTaskClock.js +16 -0
  11. package/dist/contracts/grokWorkerContract.d.ts +74 -0
  12. package/dist/contracts/grokWorkerContract.d.ts.map +1 -0
  13. package/dist/contracts/grokWorkerContract.js +88 -0
  14. package/dist/contracts/organizationRuntimeContract.d.ts +841 -0
  15. package/dist/contracts/organizationRuntimeContract.d.ts.map +1 -0
  16. package/dist/contracts/organizationRuntimeContract.js +123 -0
  17. package/dist/contracts/runtimeContractManifest.d.ts +1822 -0
  18. package/dist/contracts/runtimeContractManifest.d.ts.map +1 -0
  19. package/dist/contracts/runtimeContractManifest.js +206 -0
  20. package/dist/contracts/shellEnvironmentPolicy.d.ts +3 -0
  21. package/dist/contracts/shellEnvironmentPolicy.d.ts.map +1 -0
  22. package/dist/contracts/shellEnvironmentPolicy.js +5 -0
  23. package/dist/contracts/wakeMomentContract.d.ts +61 -0
  24. package/dist/contracts/wakeMomentContract.d.ts.map +1 -0
  25. package/dist/contracts/wakeMomentContract.js +27 -0
  26. package/dist/core/credentialRedaction.d.ts +4 -0
  27. package/dist/core/credentialRedaction.d.ts.map +1 -0
  28. package/dist/core/credentialRedaction.js +28 -0
  29. package/dist/core/types.d.ts +2 -0
  30. package/dist/core/types.d.ts.map +1 -1
  31. package/dist/examples/jungianPlayAgent.d.ts +1 -0
  32. package/dist/examples/jungianPlayAgent.d.ts.map +1 -1
  33. package/dist/examples/jungianPlayAgent.js +6 -2
  34. package/dist/mcp/toolServer.d.ts +19 -2
  35. package/dist/mcp/toolServer.d.ts.map +1 -1
  36. package/dist/mcp/toolServer.js +57 -17
  37. package/dist/observability/causalEvents.d.ts +6 -6
  38. package/dist/observability/causalEvents.d.ts.map +1 -1
  39. package/dist/observability/causalEvents.js +107 -19
  40. package/dist/observability/orgObserver.d.ts.map +1 -1
  41. package/dist/observability/orgObserver.js +3 -3
  42. package/dist/pi/agyHeadlessResult.d.ts +60 -0
  43. package/dist/pi/agyHeadlessResult.d.ts.map +1 -0
  44. package/dist/pi/agyHeadlessResult.js +95 -0
  45. package/dist/pi/cliChildOutput.d.ts +67 -0
  46. package/dist/pi/cliChildOutput.d.ts.map +1 -0
  47. package/dist/pi/cliChildOutput.js +269 -0
  48. package/dist/pi/cliEngineRun.d.ts +16 -0
  49. package/dist/pi/cliEngineRun.d.ts.map +1 -0
  50. package/dist/pi/cliEngineRun.js +27 -0
  51. package/dist/pi/cliEngineSpawn.d.ts +55 -0
  52. package/dist/pi/cliEngineSpawn.d.ts.map +1 -0
  53. package/dist/pi/cliEngineSpawn.js +169 -0
  54. package/dist/pi/cliEnvironment.d.ts +12 -0
  55. package/dist/pi/cliEnvironment.d.ts.map +1 -0
  56. package/dist/pi/cliEnvironment.js +34 -0
  57. package/dist/pi/cliMcpRegistration.d.ts +61 -0
  58. package/dist/pi/cliMcpRegistration.d.ts.map +1 -0
  59. package/dist/pi/cliMcpRegistration.js +75 -0
  60. package/dist/pi/cliProcess.d.ts +7 -0
  61. package/dist/pi/cliProcess.d.ts.map +1 -0
  62. package/dist/pi/cliProcess.js +132 -0
  63. package/dist/pi/cliSession.d.ts +86 -24
  64. package/dist/pi/cliSession.d.ts.map +1 -1
  65. package/dist/pi/cliSession.js +251 -173
  66. package/dist/pi/cliSessionMcp.d.ts +9 -0
  67. package/dist/pi/cliSessionMcp.d.ts.map +1 -0
  68. package/dist/pi/cliSessionMcp.js +80 -0
  69. package/dist/pi/cliTurnMetering.d.ts +60 -0
  70. package/dist/pi/cliTurnMetering.d.ts.map +1 -0
  71. package/dist/pi/cliTurnMetering.js +60 -0
  72. package/dist/pi/codexFilesystemRules.d.ts +3 -0
  73. package/dist/pi/codexFilesystemRules.d.ts.map +1 -0
  74. package/dist/pi/codexFilesystemRules.js +28 -0
  75. package/dist/pi/codexHeadlessResult.d.ts +68 -0
  76. package/dist/pi/codexHeadlessResult.d.ts.map +1 -0
  77. package/dist/pi/codexHeadlessResult.js +122 -0
  78. package/dist/pi/codexRolloutUsage.d.ts +95 -0
  79. package/dist/pi/codexRolloutUsage.d.ts.map +1 -0
  80. package/dist/pi/codexRolloutUsage.js +221 -0
  81. package/dist/pi/engineTaskClock.d.ts +9 -0
  82. package/dist/pi/engineTaskClock.d.ts.map +1 -0
  83. package/dist/pi/engineTaskClock.js +28 -0
  84. package/dist/pi/engineWakeLimits.d.ts +39 -0
  85. package/dist/pi/engineWakeLimits.d.ts.map +1 -0
  86. package/dist/pi/engineWakeLimits.js +55 -0
  87. package/dist/pi/grokHeadlessResult.d.ts +36 -0
  88. package/dist/pi/grokHeadlessResult.d.ts.map +1 -0
  89. package/dist/pi/grokHeadlessResult.js +118 -0
  90. package/dist/pi/grokHomeMcpRegistration.d.ts +21 -0
  91. package/dist/pi/grokHomeMcpRegistration.d.ts.map +1 -0
  92. package/dist/pi/grokHomeMcpRegistration.js +58 -0
  93. package/dist/pi/grokSandbox.d.ts +11 -0
  94. package/dist/pi/grokSandbox.d.ts.map +1 -0
  95. package/dist/pi/grokSandbox.js +216 -0
  96. package/dist/pi/grokStreamUsage.d.ts +31 -0
  97. package/dist/pi/grokStreamUsage.d.ts.map +1 -0
  98. package/dist/pi/grokStreamUsage.js +51 -0
  99. package/dist/pi/memoryClock.d.ts +25 -0
  100. package/dist/pi/memoryClock.d.ts.map +1 -0
  101. package/dist/pi/memoryClock.js +18 -0
  102. package/dist/pi/piAgentHandle.d.ts +6 -3
  103. package/dist/pi/piAgentHandle.d.ts.map +1 -1
  104. package/dist/pi/piAgentHandle.js +42 -12
  105. package/dist/pi/piAgentWakeSupport.d.ts +35 -0
  106. package/dist/pi/piAgentWakeSupport.d.ts.map +1 -1
  107. package/dist/pi/piAgentWakeSupport.js +4 -0
  108. package/dist/pi/piHarness.d.ts +18 -3
  109. package/dist/pi/piHarness.d.ts.map +1 -1
  110. package/dist/pi/piHarness.js +83 -14
  111. package/dist/pi/prompts.d.ts +1 -0
  112. package/dist/pi/prompts.d.ts.map +1 -1
  113. package/dist/pi/prompts.js +24 -0
  114. package/dist/pi/taskClockProcess.d.ts +6 -0
  115. package/dist/pi/taskClockProcess.d.ts.map +1 -0
  116. package/dist/pi/taskClockProcess.js +8 -0
  117. package/dist/pi/turnCausal.d.ts +4 -2
  118. package/dist/pi/turnCausal.d.ts.map +1 -1
  119. package/dist/pi/turnCausal.js +4 -4
  120. package/dist/pi/turnTrace.d.ts.map +1 -1
  121. package/dist/pi/turnTrace.js +5 -8
  122. package/dist/pi/wakeAcceptance.d.ts +1 -1
  123. package/dist/pi/wakeAcceptance.d.ts.map +1 -1
  124. package/dist/pi/wakeAcceptance.js +2 -2
  125. package/dist/pi/worldTrajectory.d.ts +1 -1
  126. package/dist/pi/worldTrajectory.d.ts.map +1 -1
  127. package/dist/pi/worldTrajectory.js +3 -3
  128. package/dist/runtime/agySubscriptionBootstrap.d.ts +16 -0
  129. package/dist/runtime/agySubscriptionBootstrap.d.ts.map +1 -0
  130. package/dist/runtime/agySubscriptionBootstrap.js +80 -0
  131. package/dist/runtime/agySubscriptionRealm.d.ts +38 -0
  132. package/dist/runtime/agySubscriptionRealm.d.ts.map +1 -0
  133. package/dist/runtime/agySubscriptionRealm.js +242 -0
  134. package/dist/runtime/attention.d.ts +26 -0
  135. package/dist/runtime/attention.d.ts.map +1 -0
  136. package/dist/runtime/attention.js +49 -0
  137. package/dist/runtime/attentionDispatcher.d.ts +78 -0
  138. package/dist/runtime/attentionDispatcher.d.ts.map +1 -0
  139. package/dist/runtime/attentionDispatcher.js +365 -0
  140. package/dist/runtime/cli.d.ts +7 -0
  141. package/dist/runtime/cli.d.ts.map +1 -0
  142. package/dist/runtime/cli.js +256 -0
  143. package/dist/runtime/codexSandboxProjection.d.ts +17 -0
  144. package/dist/runtime/codexSandboxProjection.d.ts.map +1 -0
  145. package/dist/runtime/codexSandboxProjection.js +40 -0
  146. package/dist/runtime/contract-manifest.json +1 -0
  147. package/dist/runtime/contract-manifest.sha256 +1 -0
  148. package/dist/runtime/contractManifest.d.ts +8 -0
  149. package/dist/runtime/contractManifest.d.ts.map +1 -0
  150. package/dist/runtime/contractManifest.js +4 -0
  151. package/dist/runtime/engineBrokerCapabilities.d.ts +40 -0
  152. package/dist/runtime/engineBrokerCapabilities.d.ts.map +1 -0
  153. package/dist/runtime/engineBrokerCapabilities.js +69 -0
  154. package/dist/runtime/engineBrokerControlClient.d.ts +55 -0
  155. package/dist/runtime/engineBrokerControlClient.d.ts.map +1 -0
  156. package/dist/runtime/engineBrokerControlClient.js +228 -0
  157. package/dist/runtime/engineBrokerCredentialJournal.d.ts +12 -0
  158. package/dist/runtime/engineBrokerCredentialJournal.d.ts.map +1 -0
  159. package/dist/runtime/engineBrokerCredentialJournal.js +26 -0
  160. package/dist/runtime/engineBrokerInferenceProtocol.d.ts +53 -0
  161. package/dist/runtime/engineBrokerInferenceProtocol.d.ts.map +1 -0
  162. package/dist/runtime/engineBrokerInferenceProtocol.js +65 -0
  163. package/dist/runtime/engineBrokerMcpCallLog.d.ts +171 -0
  164. package/dist/runtime/engineBrokerMcpCallLog.d.ts.map +1 -0
  165. package/dist/runtime/engineBrokerMcpCallLog.js +231 -0
  166. package/dist/runtime/engineBrokerMcpFacade.d.ts +59 -0
  167. package/dist/runtime/engineBrokerMcpFacade.d.ts.map +1 -0
  168. package/dist/runtime/engineBrokerMcpFacade.js +346 -0
  169. package/dist/runtime/engineBrokerNativeClient.d.ts +52 -0
  170. package/dist/runtime/engineBrokerNativeClient.d.ts.map +1 -0
  171. package/dist/runtime/engineBrokerNativeClient.js +151 -0
  172. package/dist/runtime/engineBrokerProtocol.d.ts +167 -0
  173. package/dist/runtime/engineBrokerProtocol.d.ts.map +1 -0
  174. package/dist/runtime/engineBrokerProtocol.js +357 -0
  175. package/dist/runtime/engineBrokerSealLedger.d.ts +70 -0
  176. package/dist/runtime/engineBrokerSealLedger.d.ts.map +1 -0
  177. package/dist/runtime/engineBrokerSealLedger.js +132 -0
  178. package/dist/runtime/engineBrokerService.d.ts +43 -0
  179. package/dist/runtime/engineBrokerService.d.ts.map +1 -0
  180. package/dist/runtime/engineBrokerService.js +196 -0
  181. package/dist/runtime/engineBrokerServiceCli.d.ts +5 -0
  182. package/dist/runtime/engineBrokerServiceCli.d.ts.map +1 -0
  183. package/dist/runtime/engineBrokerServiceCli.js +32 -0
  184. package/dist/runtime/engineBrokerServiceConfig.d.ts +55 -0
  185. package/dist/runtime/engineBrokerServiceConfig.d.ts.map +1 -0
  186. package/dist/runtime/engineBrokerServiceConfig.js +130 -0
  187. package/dist/runtime/engineBrokerSingleflight.d.ts +13 -0
  188. package/dist/runtime/engineBrokerSingleflight.d.ts.map +1 -0
  189. package/dist/runtime/engineBrokerSingleflight.js +24 -0
  190. package/dist/runtime/engineBrokerTurnAccounting.d.ts +76 -0
  191. package/dist/runtime/engineBrokerTurnAccounting.d.ts.map +1 -0
  192. package/dist/runtime/engineBrokerTurnAccounting.js +108 -0
  193. package/dist/runtime/engineBrokerTurnRegistry.d.ts +57 -0
  194. package/dist/runtime/engineBrokerTurnRegistry.d.ts.map +1 -0
  195. package/dist/runtime/engineBrokerTurnRegistry.js +159 -0
  196. package/dist/runtime/engineDispatcher.d.ts +38 -0
  197. package/dist/runtime/engineDispatcher.d.ts.map +1 -0
  198. package/dist/runtime/engineDispatcher.js +228 -0
  199. package/dist/runtime/engineReadiness.d.ts +23 -0
  200. package/dist/runtime/engineReadiness.d.ts.map +1 -0
  201. package/dist/runtime/engineReadiness.js +222 -0
  202. package/dist/runtime/grokAuthenticationError.d.ts +8 -0
  203. package/dist/runtime/grokAuthenticationError.d.ts.map +1 -0
  204. package/dist/runtime/grokAuthenticationError.js +20 -0
  205. package/dist/runtime/grokBrokerCredentialAuthority.d.ts +23 -0
  206. package/dist/runtime/grokBrokerCredentialAuthority.d.ts.map +1 -0
  207. package/dist/runtime/grokBrokerCredentialAuthority.js +150 -0
  208. package/dist/runtime/grokBrokerCredentialReader.d.ts +6 -0
  209. package/dist/runtime/grokBrokerCredentialReader.d.ts.map +1 -0
  210. package/dist/runtime/grokBrokerCredentialReader.js +38 -0
  211. package/dist/runtime/grokBrokerModelPolicy.d.ts +23 -0
  212. package/dist/runtime/grokBrokerModelPolicy.d.ts.map +1 -0
  213. package/dist/runtime/grokBrokerModelPolicy.js +28 -0
  214. package/dist/runtime/grokBrokerProjection.d.ts +114 -0
  215. package/dist/runtime/grokBrokerProjection.d.ts.map +1 -0
  216. package/dist/runtime/grokBrokerProjection.js +101 -0
  217. package/dist/runtime/grokBrokerProviderClock.d.ts +26 -0
  218. package/dist/runtime/grokBrokerProviderClock.d.ts.map +1 -0
  219. package/dist/runtime/grokBrokerProviderClock.js +133 -0
  220. package/dist/runtime/grokBrokerProxy.d.ts +69 -0
  221. package/dist/runtime/grokBrokerProxy.d.ts.map +1 -0
  222. package/dist/runtime/grokBrokerProxy.js +326 -0
  223. package/dist/runtime/grokBrokerProxyJson.d.ts +10 -0
  224. package/dist/runtime/grokBrokerProxyJson.d.ts.map +1 -0
  225. package/dist/runtime/grokBrokerProxyJson.js +31 -0
  226. package/dist/runtime/grokBrokerProxyRequest.d.ts +30 -0
  227. package/dist/runtime/grokBrokerProxyRequest.d.ts.map +1 -0
  228. package/dist/runtime/grokBrokerProxyRequest.js +85 -0
  229. package/dist/runtime/grokBrokerRealmLease.d.ts +4 -0
  230. package/dist/runtime/grokBrokerRealmLease.d.ts.map +1 -0
  231. package/dist/runtime/grokBrokerRealmLease.js +33 -0
  232. package/dist/runtime/grokBrokerRefresh.d.ts +2 -0
  233. package/dist/runtime/grokBrokerRefresh.d.ts.map +1 -0
  234. package/dist/runtime/grokBrokerRefresh.js +15 -0
  235. package/dist/runtime/grokBrokerRunBudget.d.ts +20 -0
  236. package/dist/runtime/grokBrokerRunBudget.d.ts.map +1 -0
  237. package/dist/runtime/grokBrokerRunBudget.js +85 -0
  238. package/dist/runtime/grokBrokerSlot.d.ts +6 -0
  239. package/dist/runtime/grokBrokerSlot.d.ts.map +1 -0
  240. package/dist/runtime/grokBrokerSlot.js +21 -0
  241. package/dist/runtime/grokBrokerTaskClock.d.ts +32 -0
  242. package/dist/runtime/grokBrokerTaskClock.d.ts.map +1 -0
  243. package/dist/runtime/grokBrokerTaskClock.js +120 -0
  244. package/dist/runtime/grokBrokerTurnMeter.d.ts +180 -0
  245. package/dist/runtime/grokBrokerTurnMeter.d.ts.map +1 -0
  246. package/dist/runtime/grokBrokerTurnMeter.js +337 -0
  247. package/dist/runtime/grokBrokerWorkerConfig.d.ts +89 -0
  248. package/dist/runtime/grokBrokerWorkerConfig.d.ts.map +1 -0
  249. package/dist/runtime/grokBrokerWorkerConfig.js +154 -0
  250. package/dist/runtime/grokEngineBroker.d.ts +88 -0
  251. package/dist/runtime/grokEngineBroker.d.ts.map +1 -0
  252. package/dist/runtime/grokEngineBroker.js +202 -0
  253. package/dist/runtime/grokEngineBrokerLedger.d.ts +52 -0
  254. package/dist/runtime/grokEngineBrokerLedger.d.ts.map +1 -0
  255. package/dist/runtime/grokEngineBrokerLedger.js +114 -0
  256. package/dist/runtime/grokEngineBrokerMetering.d.ts +51 -0
  257. package/dist/runtime/grokEngineBrokerMetering.d.ts.map +1 -0
  258. package/dist/runtime/grokEngineBrokerMetering.js +34 -0
  259. package/dist/runtime/grokEngineBrokerTurn.d.ts +82 -0
  260. package/dist/runtime/grokEngineBrokerTurn.d.ts.map +1 -0
  261. package/dist/runtime/grokEngineBrokerTurn.js +348 -0
  262. package/dist/runtime/grokEngineBrokerTurnEnd.d.ts +88 -0
  263. package/dist/runtime/grokEngineBrokerTurnEnd.d.ts.map +1 -0
  264. package/dist/runtime/grokEngineBrokerTurnEnd.js +148 -0
  265. package/dist/runtime/grokInferenceClientConfig.d.ts +41 -0
  266. package/dist/runtime/grokInferenceClientConfig.d.ts.map +1 -0
  267. package/dist/runtime/grokInferenceClientConfig.js +62 -0
  268. package/dist/runtime/grokInferenceGrants.d.ts +77 -0
  269. package/dist/runtime/grokInferenceGrants.d.ts.map +1 -0
  270. package/dist/runtime/grokInferenceGrants.js +116 -0
  271. package/dist/runtime/grokInferenceProxy.d.ts +29 -0
  272. package/dist/runtime/grokInferenceProxy.d.ts.map +1 -0
  273. package/dist/runtime/grokInferenceProxy.js +85 -0
  274. package/dist/runtime/grokInferenceProxyRequest.d.ts +23 -0
  275. package/dist/runtime/grokInferenceProxyRequest.d.ts.map +1 -0
  276. package/dist/runtime/grokInferenceProxyRequest.js +63 -0
  277. package/dist/runtime/grokSlotPreflightReceipt.d.ts +70 -0
  278. package/dist/runtime/grokSlotPreflightReceipt.d.ts.map +1 -0
  279. package/dist/runtime/grokSlotPreflightReceipt.js +101 -0
  280. package/dist/runtime/grokSubscriptionRealm.d.ts +4 -0
  281. package/dist/runtime/grokSubscriptionRealm.d.ts.map +1 -0
  282. package/dist/runtime/grokSubscriptionRealm.js +435 -0
  283. package/dist/runtime/grokSubscriptionRealmTypes.d.ts +26 -0
  284. package/dist/runtime/grokSubscriptionRealmTypes.d.ts.map +1 -0
  285. package/dist/runtime/grokSubscriptionRealmTypes.js +1 -0
  286. package/dist/runtime/grokWorkerAttestation.d.ts +175 -0
  287. package/dist/runtime/grokWorkerAttestation.d.ts.map +1 -0
  288. package/dist/runtime/grokWorkerAttestation.js +266 -0
  289. package/dist/runtime/grokWorkerDenyPlacement.d.ts +80 -0
  290. package/dist/runtime/grokWorkerDenyPlacement.d.ts.map +1 -0
  291. package/dist/runtime/grokWorkerDenyPlacement.js +128 -0
  292. package/dist/runtime/grokWorkerHomeAttestation.d.ts +32 -0
  293. package/dist/runtime/grokWorkerHomeAttestation.d.ts.map +1 -0
  294. package/dist/runtime/grokWorkerHomeAttestation.js +75 -0
  295. package/dist/runtime/grokWorkerSandboxProfile.d.ts +27 -0
  296. package/dist/runtime/grokWorkerSandboxProfile.d.ts.map +1 -0
  297. package/dist/runtime/grokWorkerSandboxProfile.js +44 -0
  298. package/dist/runtime/grokWorkerTmpAttestation.d.ts +55 -0
  299. package/dist/runtime/grokWorkerTmpAttestation.d.ts.map +1 -0
  300. package/dist/runtime/grokWorkerTmpAttestation.js +63 -0
  301. package/dist/runtime/index.d.ts +31 -0
  302. package/dist/runtime/index.d.ts.map +1 -0
  303. package/dist/runtime/index.js +27 -0
  304. package/dist/runtime/inferenceUsageLedger.d.ts +38 -0
  305. package/dist/runtime/inferenceUsageLedger.d.ts.map +1 -0
  306. package/dist/runtime/inferenceUsageLedger.js +53 -0
  307. package/dist/runtime/mcpToolResult.d.ts +127 -0
  308. package/dist/runtime/mcpToolResult.d.ts.map +1 -0
  309. package/dist/runtime/mcpToolResult.js +214 -0
  310. package/dist/runtime/moltnetMachineRead.d.ts +97 -0
  311. package/dist/runtime/moltnetMachineRead.d.ts.map +1 -0
  312. package/dist/runtime/moltnetMachineRead.js +183 -0
  313. package/dist/runtime/native/daimon-engine-broker +0 -0
  314. package/dist/runtime/organizationRuntime.d.ts +168 -0
  315. package/dist/runtime/organizationRuntime.d.ts.map +1 -0
  316. package/dist/runtime/organizationRuntime.js +3 -0
  317. package/dist/runtime/organizationRuntimeAdmission.d.ts +6 -0
  318. package/dist/runtime/organizationRuntimeAdmission.d.ts.map +1 -0
  319. package/dist/runtime/organizationRuntimeAdmission.js +22 -0
  320. package/dist/runtime/organizationRuntimeControl.d.ts +51 -0
  321. package/dist/runtime/organizationRuntimeControl.d.ts.map +1 -0
  322. package/dist/runtime/organizationRuntimeControl.js +283 -0
  323. package/dist/runtime/organizationRuntimeHost.d.ts +19 -0
  324. package/dist/runtime/organizationRuntimeHost.d.ts.map +1 -0
  325. package/dist/runtime/organizationRuntimeHost.js +368 -0
  326. package/dist/runtime/organizationRuntimeParsing.d.ts +6 -0
  327. package/dist/runtime/organizationRuntimeParsing.d.ts.map +1 -0
  328. package/dist/runtime/organizationRuntimeParsing.js +373 -0
  329. package/dist/runtime/organizationRuntimeReadiness.d.ts +12 -0
  330. package/dist/runtime/organizationRuntimeReadiness.d.ts.map +1 -0
  331. package/dist/runtime/organizationRuntimeReadiness.js +67 -0
  332. package/dist/runtime/organizationRuntimeRecording.d.ts +7 -0
  333. package/dist/runtime/organizationRuntimeRecording.d.ts.map +1 -0
  334. package/dist/runtime/organizationRuntimeRecording.js +58 -0
  335. package/dist/runtime/physicalReadiness.d.ts +59 -0
  336. package/dist/runtime/physicalReadiness.d.ts.map +1 -0
  337. package/dist/runtime/physicalReadiness.js +176 -0
  338. package/dist/runtime/portableCredentialAuth.d.ts +6 -0
  339. package/dist/runtime/portableCredentialAuth.d.ts.map +1 -0
  340. package/dist/runtime/portableCredentialAuth.js +70 -0
  341. package/dist/runtime/portableCredentialMaterial.d.ts +8 -0
  342. package/dist/runtime/portableCredentialMaterial.d.ts.map +1 -0
  343. package/dist/runtime/portableCredentialMaterial.js +169 -0
  344. package/dist/runtime/productionAgentTools.d.ts +5 -0
  345. package/dist/runtime/productionAgentTools.d.ts.map +1 -0
  346. package/dist/runtime/productionAgentTools.js +336 -0
  347. package/dist/runtime/relocateRuntimeConfig.d.ts +14 -0
  348. package/dist/runtime/relocateRuntimeConfig.d.ts.map +1 -0
  349. package/dist/runtime/relocateRuntimeConfig.js +38 -0
  350. package/dist/runtime/runtimeHomeLayout.d.ts +48 -0
  351. package/dist/runtime/runtimeHomeLayout.d.ts.map +1 -0
  352. package/dist/runtime/runtimeHomeLayout.js +84 -0
  353. package/dist/runtime/schedule.d.ts +40 -0
  354. package/dist/runtime/schedule.d.ts.map +1 -0
  355. package/dist/runtime/schedule.js +376 -0
  356. package/dist/runtime/storeCoordination.d.ts +33 -0
  357. package/dist/runtime/storeCoordination.d.ts.map +1 -0
  358. package/dist/runtime/storeCoordination.js +117 -0
  359. package/dist/runtime/taskClock.d.ts +42 -0
  360. package/dist/runtime/taskClock.d.ts.map +1 -0
  361. package/dist/runtime/taskClock.js +102 -0
  362. package/dist/runtime/taskClockProcess.d.ts +17 -0
  363. package/dist/runtime/taskClockProcess.d.ts.map +1 -0
  364. package/dist/runtime/taskClockProcess.js +58 -0
  365. package/dist/runtime/toolResultSpill.d.ts +152 -0
  366. package/dist/runtime/toolResultSpill.d.ts.map +1 -0
  367. package/dist/runtime/toolResultSpill.js +351 -0
  368. package/dist/runtime/turnRequestLedger.d.ts +155 -0
  369. package/dist/runtime/turnRequestLedger.d.ts.map +1 -0
  370. package/dist/runtime/turnRequestLedger.js +251 -0
  371. package/dist/runtime/turnUsageLedger.d.ts +143 -0
  372. package/dist/runtime/turnUsageLedger.d.ts.map +1 -0
  373. package/dist/runtime/turnUsageLedger.js +203 -0
  374. package/dist/runtime/wakeAcceptanceClaimDiagnostics.d.ts +34 -0
  375. package/dist/runtime/wakeAcceptanceClaimDiagnostics.d.ts.map +1 -0
  376. package/dist/runtime/wakeAcceptanceClaimDiagnostics.js +79 -0
  377. package/dist/runtime/wakeAcceptanceIndex.d.ts +55 -0
  378. package/dist/runtime/wakeAcceptanceIndex.d.ts.map +1 -0
  379. package/dist/runtime/wakeAcceptanceIndex.js +158 -0
  380. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts +25 -0
  381. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts.map +1 -0
  382. package/dist/runtime/wakeAcceptanceProcessIdentity.js +54 -0
  383. package/dist/runtime/wakeAcceptanceReconciliation.d.ts +211 -0
  384. package/dist/runtime/wakeAcceptanceReconciliation.d.ts.map +1 -0
  385. package/dist/runtime/wakeAcceptanceReconciliation.js +289 -0
  386. package/dist/runtime/wakeAcceptanceRecord.d.ts +25 -0
  387. package/dist/runtime/wakeAcceptanceRecord.d.ts.map +1 -0
  388. package/dist/runtime/wakeAcceptanceRecord.js +58 -0
  389. package/dist/runtime/wakeAcceptanceRetention.d.ts +36 -0
  390. package/dist/runtime/wakeAcceptanceRetention.d.ts.map +1 -0
  391. package/dist/runtime/wakeAcceptanceRetention.js +38 -0
  392. package/dist/runtime/wakeAcceptanceStore.d.ts +113 -0
  393. package/dist/runtime/wakeAcceptanceStore.d.ts.map +1 -0
  394. package/dist/runtime/wakeAcceptanceStore.js +561 -0
  395. package/dist/runtime/wakeAcceptanceTypes.d.ts +179 -0
  396. package/dist/runtime/wakeAcceptanceTypes.d.ts.map +1 -0
  397. package/dist/runtime/wakeAcceptanceTypes.js +95 -0
  398. package/dist/runtime/wakeFuse.d.ts +124 -0
  399. package/dist/runtime/wakeFuse.d.ts.map +1 -0
  400. package/dist/runtime/wakeFuse.js +466 -0
  401. package/dist/runtime/wakeMomentFs.d.ts +27 -0
  402. package/dist/runtime/wakeMomentFs.d.ts.map +1 -0
  403. package/dist/runtime/wakeMomentFs.js +223 -0
  404. package/dist/runtime/wakeMomentHistory.d.ts +26 -0
  405. package/dist/runtime/wakeMomentHistory.d.ts.map +1 -0
  406. package/dist/runtime/wakeMomentHistory.js +109 -0
  407. package/dist/runtime/wakeMomentIo.d.ts +22 -0
  408. package/dist/runtime/wakeMomentIo.d.ts.map +1 -0
  409. package/dist/runtime/wakeMomentIo.js +114 -0
  410. package/dist/runtime/wakeMomentRecorder.d.ts +33 -0
  411. package/dist/runtime/wakeMomentRecorder.d.ts.map +1 -0
  412. package/dist/runtime/wakeMomentRecorder.js +81 -0
  413. package/dist/runtime/wakeMomentRetention.d.ts +7 -0
  414. package/dist/runtime/wakeMomentRetention.d.ts.map +1 -0
  415. package/dist/runtime/wakeMomentRetention.js +143 -0
  416. package/dist/runtime/wakeMomentRows.d.ts +8 -0
  417. package/dist/runtime/wakeMomentRows.d.ts.map +1 -0
  418. package/dist/runtime/wakeMomentRows.js +66 -0
  419. package/dist/runtime/wakeMomentSnapshot.d.ts +56 -0
  420. package/dist/runtime/wakeMomentSnapshot.d.ts.map +1 -0
  421. package/dist/runtime/wakeMomentSnapshot.js +248 -0
  422. package/package.json +22 -11
package/README.md CHANGED
@@ -8,8 +8,11 @@ top of Pi. A Daimon runs one harnessed agent inside a caller-prepared workspace.
8
8
  Spawnfile compiles and deploys orgs, nested teams, member-owned schedules,
9
9
  Moltnet wiring, and workspace resources. Daimon executes one agent runtime: it
10
10
  accepts a wake selected by that runtime's organization policy and runs one
11
- turn. It does not know the org graph, schedule other agents, or let Simfile or
12
- a world service trigger cognition.
11
+ turn. Its strict organization-runtime v2 host owns each configured agent's
12
+ durable `cron`, `every`, or `disabled` schedule without learning the Spawnfile
13
+ org graph. Simfile and world services do not trigger cognition.
14
+
15
+ Spawnfile may also compile per-agent production MCP and Moltnet capabilities into this config. Daimon lists each MCP server at startup, mounts only its declared tool allowlist into Codex/Grok cognition turns, and bounds calls to 10 seconds and 64 KiB. Moltnet exposes one scoped natural-language send tool whose deterministic delivery id derives from the active wake, agent, target, and text. Accepted tool receipts are fsynced under the agent runtime home and replayed after restart; transport policy remains Spawnfile/Moltnet-owned.
13
16
 
14
17
  For a world-capable `kind: every` wake, the harness starts without a decision
15
18
  token and privately calls `world_claim` before exposing any other world tool.
@@ -25,7 +28,7 @@ independent wake and claim—they are never Daimon wake inputs.
25
28
  npm install @noopolis/daimon
26
29
  ```
27
30
 
28
- The latest published version is 0.1.1; this README describes the source tree (0.1.2).
31
+ The latest published version may differ; this README describes the source tree (0.2.0).
29
32
 
30
33
  For Pi agents with memory enabled, install Mneme too:
31
34
 
@@ -49,6 +52,256 @@ Pi-specific exports live under the Pi subpath:
49
52
  import { PiHarnessAdapter } from "@noopolis/daimon/pi";
50
53
  ```
51
54
 
55
+ ## Organization-runtime contract
56
+
57
+ For a strict Codex agent in an already prepared runtime, the public
58
+ `resolveOrganizationCodexSandboxProjection(config, agentId, { acceptanceStorePath })`
59
+ API returns `noopolis.daimon.codex-sandbox-projection.v1`: canonical workspace/home
60
+ paths, the resolved executable, and `sandboxArgs` containing the exact permission
61
+ profile rendered for production. Append only `--` and a mechanical command when
62
+ checking whether that policy can execute in the caller's container.
63
+
64
+ The resolver opens and verifies caller-owned path identities and executes the
65
+ Codex version probe. It does not import/read authentication, create an agent,
66
+ accept a wake or invoke a model. The acceptance-store path must be the same one
67
+ given to the control host. This API projects command permissions, not the complete
68
+ cognition invocation: Codex's `sandbox` subcommand lacks the strict configuration
69
+ flags accepted by `exec`. A caller must therefore use a fresh empty `HOME` and
70
+ `CODEX_HOME` and a restricted environment for its mechanical probe. Do not infer
71
+ successful tool use or completed agent work from this projection alone.
72
+
73
+ `@noopolis/daimon/runtime` exports a standard JSON Schema for structural
74
+ validation plus the strict, side-effect-free semantic
75
+ `validateOrganizationRuntimeConfig` / `parseOrganizationRuntimeConfig` API and
76
+ a narrow multi-agent Daimon host:
77
+
78
+ ```ts
79
+ import { parseOrganizationRuntimeConfig } from "@noopolis/daimon/runtime";
80
+
81
+ const config = parseOrganizationRuntimeConfig({
82
+ version: "noopolis.daimon.organization-runtime.v1",
83
+ host: {
84
+ bindHost: "127.0.0.1",
85
+ port: 4318,
86
+ controlTokenEnv: "DAIMON_CONTROL_TOKEN"
87
+ },
88
+ agents: [{
89
+ id: "writer",
90
+ name: "Writer",
91
+ instructions: "Write the report.",
92
+ workspacePath: "/runtime/workspaces/writer",
93
+ runtimeHomePath: "/runtime/homes/writer",
94
+ engine: { kind: "codex" }
95
+ }]
96
+ });
97
+ ```
98
+
99
+ The package also includes the canonical runtime contract at
100
+ `dist/runtime/contract-manifest.json` and its exact-byte SHA-256 sidecar at
101
+ `dist/runtime/contract-manifest.sha256`. Every build regenerates both from the
102
+ same data-only constants exported as `RUNTIME_CONTRACT_MANIFEST`; the digest is
103
+ encoded as `sha256:<lowercase hex>`.
104
+
105
+ It intentionally contains no teams, roles, parent/member links, wake policies,
106
+ deployment settings, Moltnet data, commands, argument arrays, environment maps,
107
+ or credentials. V2 agents carry one normalized native schedule; durable state
108
+ and acceptance provide restart-safe occurrence execution. `controlTokenEnv` is only the safe name of a
109
+ variable; the token value is never serialized. The only organization-host
110
+ engine intents are `codex`, `grok`, and `agy`; Pi remains available through the
111
+ separate one-agent `@noopolis/daimon/pi` API.
112
+
113
+ `createOrganizationRuntimeHost(config)` creates an organization runtime host.
114
+ Call `await host.start()` to construct one isolated Daimon harness per agent,
115
+ after reading the non-blank control token named by `controlTokenEnv`.
116
+ It routes only authenticated, targeted wakes; each agent's wakes are serial,
117
+ while separate agents can run concurrently. It has no organization or
118
+ coordination API. Run the HTTP control process with:
119
+
120
+ ```bash
121
+ daimon-runtime run --config /runtime/daimon-runtime.json
122
+ ```
123
+
124
+ The process exposes authenticated `POST /v1/wake`, `GET /v1/health`, and
125
+ `GET /v1/activity` endpoints. Send the token only as `Authorization: Bearer
126
+ <token>`; it never appears in configuration or activity output.
127
+
128
+ For durable control-plane delivery, provide a caller-created, current-user
129
+ owned `0700` directory in `DAIMON_RUNTIME_ACCEPTANCE_STORE`. This enables the
130
+ additive authenticated v2 API: `POST /v2/wakes` persistently accepts one
131
+ bounded, addressed wake under its `(agent_id, delivery_id, request digest)`
132
+ identity before the turn starts, and `GET /v2/wake-receipts/<acceptance_id>`
133
+ returns only its strict redacted lifecycle status. The store is a private
134
+ runtime authority, not a credential directory; it must be mounted only into
135
+ the Daimon host. Equal retries return the original acceptance, while a changed
136
+ payload for that delivery id is rejected. `GET /v2/activity` exposes bounded
137
+ receipt history and active execution identities. Completed receipts can include
138
+ redacted terminal output; acceptance responses never contain model output. If the variable is not
139
+ provided, the v1 endpoints remain available and v2 is not exposed.
140
+
141
+ Per-agent `attention` opts into interruption-aware inbox processing:
142
+
143
+ ```json
144
+ "attention": { "maxBatchMessages": 8, "maxBatchBytes": 12000, "maxExecutions": 30, "maxTokens": 3000000 }
145
+ ```
146
+
147
+ An idle agent starts promptly. Messages arriving while it works accumulate into
148
+ one bounded next turn; manual and scheduled events remain distinct. The agent
149
+ uses `daimon_inbox` to read selected deliveries and `daimon_inbox_disposition`
150
+ with a `delivery_id` and `complete` or `defer` disposition. Reading a message or
151
+ ending a turn never completes it. Unmarked and deferred messages wait durably
152
+ for new input, including after restart. A single oversized delivery stays
153
+ intact in the inbox tool and is referenced instead of copied into the prompt.
154
+ Omitting `attention` retains single-delivery, automatic completion behavior.
155
+ Attention requires the durable control host and `POST /v2/wakes`; synchronous
156
+ `POST /v1/wake` rejects attention-enabled agents with `durable_inbox_required`
157
+ before starting cognition.
158
+
159
+ Delivery acceptance does not spend an execution allowance. The existing global
160
+ wake fuse counts execution-start reservations, including historical admissions;
161
+ optional per-agent execution/token ceilings apply within the same explicit
162
+ epoch. Retries reserve another execution while retaining the stable wake id
163
+ used by idempotent tools. Reported token usage is a lagging bound, not an
164
+ in-flight spending guarantee. Budget pauses preserve and continue accepting
165
+ pending deliveries. The inbox has a separate hard storage bound of 2,176
166
+ receipts; it never evicts pending work to accept another delivery.
167
+
168
+ Authenticated `GET /v2/availability` reports running work, pending/deferred
169
+ counts, limits, remaining allowances and the pause reason. Global operator-stop
170
+ and ledger-failure latches stay hard: HTTP 409 carries a versioned `blocked`
171
+ descriptor with a bounded retry delay. A budget pause never becomes a terminal
172
+ receipt. Existing fuse trip markers remain latched until explicit operator
173
+ recovery; changing attention settings does not erase historical spending.
174
+
175
+ `POST /v2/drain` and `POST /v2/resume` (same bearer token) are the reversible
176
+ counterpart: a drain answers new wakes with the same 409 `work-blocked`
177
+ descriptor, keeps queued deliveries, lets running turns finish and reports
178
+ `drain: {state: "draining" | "drained", since}` in availability; resume
179
+ dispatches the queue. Neither touches the latched `fuse.stop`.
180
+
181
+ A batch's atomic per-agent claim records its complete membership and stable
182
+ `execution_id` before cognition. Individual receipts retain their delivery ids
183
+ and explicit state. `GET /v2/activity.executions` identifies the live turn even
184
+ when all its message receipts have already completed; integrations should bind
185
+ turn authority to that execution id. The wake environment uses the same id.
186
+
187
+ Each accepted delivery also has a private, bounded execution claim with an
188
+ owner and generation fence. A second host sharing the authority may observe a
189
+ receipt but cannot dispatch while the live claimant owns it; only the matching,
190
+ unexpired fence can record its terminal state. Claim revalidation and receipt
191
+ replacement are covered by a separate exclusive, fsynced per-receipt transition
192
+ lock; a recovered generation fences an older paused writer before replacement.
193
+ After a host crash, a bounded stale claim can be recovered and replayed. This is durable at-least-once turn
194
+ delivery, not exactly-once cognition: if an engine has an external effect and
195
+ the host crashes before its terminal receipt is persisted, recovery can run the
196
+ turn again. Callers requiring exactly-once external effects must fence or
197
+ deduplicate those effects at their own destination.
198
+
199
+ The durable v2 store is a Linux-container contract. Its non-expiring commit
200
+ lock records the owner PID, Linux `/proc` process-start identity, boot id, and
201
+ PID-namespace device/inode identity; recovery is allowed only after that exact
202
+ owner is proven dead in the same namespace, so PID reuse cannot unlock a live
203
+ writer. A different or unobservable PID namespace raises the typed,
204
+ path-free `WakeTransitionLockBlockedError` with code
205
+ `offline_reconciliation_required`; it is never automatically cleared. For a
206
+ replacement container, deployment authority must first prove the prior
207
+ container absent or quiescent, then perform an explicit offline stale-lock
208
+ reconciliation. On a platform where this identity cannot be proven, v2 fails
209
+ closed rather than using a clock-based lock; v1 remains available without the
210
+ v2 store.
211
+
212
+ ### Offline transition reconciliation
213
+
214
+ `reconcileOfflineWakeTransition` is a deployment-admin library operation, not
215
+ an HTTP endpoint and never a normal host action. It accepts only the versioned
216
+ `noopolis.daimon.offline-transition-reconciliation.v1` request, including the
217
+ exact store and lock device/inode identities, owner/generation/PID-namespace
218
+ identity, and an opaque absent-or-quiescent deployment attestation. The caller
219
+ must mount the store exclusively offline and supply the deployment authority's
220
+ attestation verifier. Daimon gives that verifier a canonical immutable
221
+ authorization context (deployment identity, nonce, request digest, every
222
+ store/delivery/lock identity, and every stale host registration's exact file
223
+ device/inode, owner, process, boot, and PID-namespace identity); its returned
224
+ proof receipt must echo that exact digest and nonce and certify
225
+ `exclusive_store: true`. A same-namespace registration is cleared only when
226
+ its owner is proven dead. A cross-namespace registration is cleared only when
227
+ the proof authorizes that exact canonical registration digest after deployment
228
+ has proven the old container absent or quiescent. Unknown, live, unlisted, or
229
+ changed registrations block. Daimon validates the physical store, delivery
230
+ record, and lock again immediately before its fsynced removal. The proof
231
+ itself is never persisted or returned; the durable redacted receipt records
232
+ only cleared registration digests.
233
+
234
+ The operation writes a durable redacted receipt and returns it on an identical
235
+ replay. An identity mismatch, invalid proof, concurrent administrative lease,
236
+ or changed replay returns the stable blocked result
237
+ `{ state: "blocked", code: "offline_reconciliation_required" }`. It performs
238
+ no runtime auto-clear and has no CLI or public-server admin route in C0. The
239
+ admin lease itself carries PID/start/boot/PID-namespace identity: a retry may
240
+ recover it only after proving the prior owner dead in the same namespace. Lease
241
+ unlink and directory fsync failures prevent a successful result; the durable
242
+ prepared receipt lets an authorized offline retry finish after a crash.
243
+
244
+ Every running wake-acceptance store also holds its own fsynced host-lifetime
245
+ registration with the same process identity. A host writes that registration
246
+ before becoming usable and rechecks the offline lease; the offline operation
247
+ takes its lease first, then rejects live or unprovable host registrations.
248
+ This permits normal concurrent hosts, but prevents either startup/admin race
249
+ from overlapping an administrative reconciliation.
250
+
251
+ The runtime may bind `0.0.0.0` when its caller places it on a dedicated private
252
+ container network. Daimon neither publishes ports nor selects networks; the
253
+ deployer must keep the control endpoint un-published and allow only its
254
+ authorized control-plane client to reach it.
255
+
256
+ The JSON Schema is deliberately standard and structural. The pure parser and
257
+ validator are normative for semantic checks that standard JSON Schema cannot
258
+ express, including unique ids, own-property records, and pairwise
259
+ non-overlapping canonical POSIX workspace/runtime-home paths; call the parser
260
+ before runtime side effects. The parser canonicalizes absolute path spellings
261
+ before retaining or comparing them. Before creating agents, the host verifies
262
+ that caller-created roots are real, current-user-owned directories without
263
+ symlink components; runtime homes must be exactly `0700`, and workspaces must
264
+ not be group/other writable. Daimon never creates or removes these roots.
265
+
266
+ For a production CLI engine, Daimon resolves the engine from `PATH` once,
267
+ pins its canonical executable identity, probes only `--version`, and rechecks
268
+ that identity before every child process. Codex uses a caller-provisioned
269
+ private `.codex/auth.json` refresh credential beneath each agent's
270
+ `runtimeHomePath`. Grok instead uses one host-wide durable subscription realm:
271
+ a read-only operator bootstrap seeds the authority, and Daimon serializes
272
+ turns while staging and reconciling the rotating credential into each private
273
+ agent home. Sessions and non-auth state remain isolated per agent. Engine
274
+ children receive only the matching engine home, runtime/XDG paths,
275
+ locale/timezone, and a PATH sufficient for the already pinned executable.
276
+ Before every Grok process, Daimon rewrites its exact custom sandbox profile and
277
+ requires a fresh kernel-enforcement receipt covering the durable realm,
278
+ read-only bootstrap, and every peer workspace/runtime home. A fail-open
279
+ Landlock/Seatbelt warning, missing deny path, or profile mutation fails the
280
+ wake before cognition.
281
+ They never inherit arbitrary host variables. Missing, replaced, malformed,
282
+ stale, or unsafe engine authority prevents startup or fails the affected wake
283
+ without publishing credential contents or file paths.
284
+
285
+ AGY subscription authentication is different: it uses OS-native secure
286
+ storage. Daimon supervises one private D-Bus plus Secret Service realm for all
287
+ AGY agents on the host, holds an exclusive lease on its durable encrypted
288
+ keyring volume, and unlocks it from an independent caller-owned `0600`
289
+ read-only mount through bounded stdin. Only AGY children receive that realm's
290
+ exact bus address. Normal startup proves enrollment with `agy models` before
291
+ any agent starts.
292
+
293
+ Enroll an empty realm once from an interactive terminal:
294
+
295
+ ```bash
296
+ daimon-runtime auth agy login --config /runtime/daimon-runtime.json
297
+ ```
298
+
299
+ The command starts the same realm and launches the pinned `agy` as a Daimon
300
+ child with no AGY arguments, allowing its remote URL-and-code sign-in flow.
301
+ After the operator exits AGY, Daimon runs the noninteractive enrollment proof
302
+ and preserves the durable keyring state. It never accepts a portable AGY token
303
+ file, API key, ADC credential, token export, or ambient D-Bus session.
304
+
52
305
  By default, the in-process Mneme runtime uses the same path as each agent's
53
306
  `runtimeHomePath`. If you need agents to keep separate Pi/runtime directories but
54
307
  share one memory bank, pass an explicit `memory.runtimeHomePath` in
@@ -98,18 +351,26 @@ upstream-documented dummy `ollama` value.
98
351
 
99
352
  ## Pi E2E
100
353
 
354
+ `npm run live:grok-broker` checks an existing Grok subscription login through
355
+ the real CLI and Daimon provider proxy, then repeats after restarting the proxy.
356
+ It spends two short model turns, requires their exact terminal reply and real
357
+ usage, and gives each CLI a temporary home containing only a scoped capability.
358
+ The operator credential is read in the parent process and is never copied or
359
+ refreshed. This is a local authentication/transport check; it does not exercise
360
+ the Linux native launcher, worker attestation, MCP tools, or OAuth renewal.
361
+ Success ends with `GROK_BROKER_AUTH_RESTART_OK`.
362
+
101
363
  The Pi E2E uses the local Codex CLI subscription auth file to seed an ignored Pi
102
364
  `auth.json` under `.runtime/`.
103
365
 
104
366
  These are live runs: they spend real tokens and require local engine auth
105
- (`~/.codex/auth.json` for Pi/Codex; mixed-engine and triad additionally need
367
+ (`~/.codex/auth.json` for Pi/Codex; triad additionally needs
106
368
  authenticated `grok` and `agy` CLIs on PATH). They are not part of `npm test`.
107
369
 
108
370
  ```bash
109
371
  npm install
110
372
  npm run e2e:pi-agent
111
373
  npm run e2e:pi-memory-org
112
- npm run e2e:mixed-engine-org
113
374
  npm run e2e:jungian-play-org
114
375
  npm run e2e:jungian-triad-org
115
376
  ```
@@ -141,52 +402,15 @@ speaks through a Pi agent seeded from local Codex subscription auth. All three
141
402
  selves carry the same full archetype set, rotated through the run so every
142
403
  archetype gets consulted.
143
404
 
144
- ## Design Notes
145
-
146
- - `MEMORY-SYSTEM.md` describes the implemented scoped memory runtime.
147
- - `ENGINE-SYSTEM.md` describes the engine abstraction plan: Pi, local/API
148
- model providers, and CLI-backed engines such as `codex`, `claude`, `grok`,
149
- and `agy`.
150
- - Mneme is a sibling package, `@noopolis/mneme`, published separately and used
151
- by Daimon in-process for Pi agents. Other runtimes can use Mneme through its
152
- MCP server. The agent-facing tools stay named `memory_search`,
153
- `memory_register`, and `memory.*` at the protocol boundary because those names
154
- are clearer to agents.
155
-
156
- ## Runtime Artifact Image
157
-
158
- Daimon defines a local copy-only runtime artifact image build for Spawnfile:
159
-
160
- ```bash
161
- npm run image:runtime:local
162
- ```
163
-
164
- Status: this build currently fails against the public npm registry. The
165
- Dockerfile pins `@noopolis/daimon@0.1.2` and `@noopolis/mneme@0.1.1`, and
166
- neither is published yet (registry has daimon 0.1.1 and mneme 0.1.0). Works
167
- only after those versions publish or against a registry that has them. Treat
168
- as pending publish.
405
+ ## Docs
169
406
 
170
- This creates:
407
+ Start with `docs/README.md` for the current documentation map:
171
408
 
172
- ```text
173
- noopolis/spawnfile-runtime-daimon:0.1.2-local
174
- ```
175
-
176
- The image is not a full organization image and is not intended to be run
177
- directly. It contains only:
178
-
179
- ```text
180
- /opt/spawnfile/runtime-installs/daimon
181
- ```
182
-
183
- Spawnfile can copy that path into generated organization images:
184
-
185
- ```bash
186
- SPAWNFILE_DAIMON_RUNTIME_IMAGE=noopolis/spawnfile-runtime-daimon:0.1.2-local \
187
- spawnfile build ./agentic-org
188
- ```
409
+ - `docs/runtime.md` explains the organization-runtime config, control API,
410
+ schedules, durable wake acceptance, and attention.
411
+ - `docs/engines.md` explains Pi and CLI engine boundaries.
412
+ - `docs/memory.md` explains Daimon's Mneme adapter.
413
+ - `docs/observability.md` explains causal events, raw capture, and world
414
+ trajectories.
189
415
 
190
- This keeps mixed-runtime organizations composable: a generated image can copy
191
- Daimon, OpenClaw, PicoClaw, or any future runtime artifact independently instead
192
- of depending on one prebuilt image for every runtime combination.
416
+ Historical migration plans and audits live under `archive/`.
@@ -0,0 +1,142 @@
1
+ export type AttentionConfig = Readonly<{
2
+ maxBatchMessages?: number;
3
+ maxBatchBytes?: number;
4
+ maxExecutions?: number;
5
+ maxTokens?: number;
6
+ }>;
7
+ export declare const WORK_AVAILABILITY_SCHEMA: {
8
+ readonly type: "object";
9
+ readonly additionalProperties: false;
10
+ readonly required: readonly ["version", "state", "agents"];
11
+ readonly properties: {
12
+ readonly version: {
13
+ readonly const: "noopolis.daimon.work-availability.v1";
14
+ };
15
+ readonly state: {
16
+ readonly enum: readonly ["running", "paused", "stopped"];
17
+ };
18
+ readonly agents: {
19
+ readonly type: "array";
20
+ readonly maxItems: 32;
21
+ readonly items: {
22
+ readonly type: "object";
23
+ readonly additionalProperties: false;
24
+ readonly required: readonly ["agent_id", "pending", "running", "deferred", "budget"];
25
+ readonly properties: {
26
+ readonly agent_id: {
27
+ readonly type: "string";
28
+ };
29
+ readonly pending: {
30
+ readonly type: "integer";
31
+ readonly minimum: 0;
32
+ };
33
+ readonly running: {
34
+ readonly type: "boolean";
35
+ };
36
+ readonly deferred: {
37
+ readonly type: "integer";
38
+ readonly minimum: 0;
39
+ };
40
+ readonly budget: {
41
+ readonly type: "object";
42
+ readonly additionalProperties: false;
43
+ readonly required: readonly ["armed", "epoch", "state", "executions_used", "executions_remaining", "tokens_used", "tokens_remaining", "agent_executions_used", "agent_tokens_used"];
44
+ readonly properties: {
45
+ readonly armed: {
46
+ readonly type: "boolean";
47
+ };
48
+ readonly epoch: {
49
+ readonly type: "string";
50
+ };
51
+ readonly state: {
52
+ readonly enum: readonly ["available", "paused", "stopped"];
53
+ };
54
+ readonly reason: {
55
+ readonly type: "string";
56
+ };
57
+ readonly executions_used: {
58
+ readonly type: "integer";
59
+ readonly minimum: 0;
60
+ };
61
+ readonly executions_remaining: {
62
+ readonly type: "integer";
63
+ readonly minimum: 0;
64
+ };
65
+ readonly tokens_used: {
66
+ readonly type: "integer";
67
+ readonly minimum: 0;
68
+ };
69
+ readonly tokens_remaining: {
70
+ readonly type: "integer";
71
+ readonly minimum: 0;
72
+ };
73
+ readonly agent_executions_used: {
74
+ readonly type: "integer";
75
+ readonly minimum: 0;
76
+ };
77
+ readonly agent_executions_remaining: {
78
+ readonly type: "integer";
79
+ readonly minimum: 0;
80
+ };
81
+ readonly agent_tokens_used: {
82
+ readonly type: "integer";
83
+ readonly minimum: 0;
84
+ };
85
+ readonly agent_tokens_remaining: {
86
+ readonly type: "integer";
87
+ readonly minimum: 0;
88
+ };
89
+ };
90
+ };
91
+ readonly error: {
92
+ readonly type: "string";
93
+ };
94
+ };
95
+ };
96
+ };
97
+ readonly drain: {
98
+ readonly type: "object";
99
+ readonly additionalProperties: false;
100
+ readonly required: readonly ["state", "since"];
101
+ readonly properties: {
102
+ readonly state: {
103
+ readonly enum: readonly ["draining", "drained"];
104
+ };
105
+ readonly since: {
106
+ readonly type: "string";
107
+ };
108
+ };
109
+ };
110
+ };
111
+ };
112
+ /** Reversible operator drain; the latched `fuse.stop` is a separate, unchanged safety stop. */
113
+ export declare const OPERATOR_DRAIN: {
114
+ readonly drainRoute: "POST /v2/drain";
115
+ readonly resumeRoute: "POST /v2/resume";
116
+ readonly authorization: "control-bearer";
117
+ readonly response: "workAvailabilityResponseSchema";
118
+ readonly blockedReason: "operator_stop";
119
+ readonly queuedWakes: "retained";
120
+ readonly runningTurns: "finish";
121
+ readonly scope: "process";
122
+ readonly resumeClearsOperatorStop: false;
123
+ };
124
+ export declare const WORK_BLOCKED_SCHEMA: {
125
+ readonly type: "object";
126
+ readonly additionalProperties: false;
127
+ readonly required: readonly ["version", "reason", "retry_after_ms"];
128
+ readonly properties: {
129
+ readonly version: {
130
+ readonly const: "noopolis.daimon.work-blocked.v1";
131
+ };
132
+ readonly reason: {
133
+ readonly enum: readonly ["operator_stop", "ledger_unavailable", "host_stopping", "host_stopped", "queue_full"];
134
+ };
135
+ readonly retry_after_ms: {
136
+ readonly type: "integer";
137
+ readonly minimum: 1000;
138
+ readonly maximum: 300000;
139
+ };
140
+ };
141
+ };
142
+ //# sourceMappingURL=attentionContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentionContract.d.ts","sourceRoot":"","sources":["../../src/contracts/attentionContract.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAQ1I,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIzB,CAAC;AACb,+FAA+F;AAC/F,eAAO,MAAM,cAAc;;;;;;;;;;CAIjB,CAAC;AACX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAEpB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /** Additive control surfaces; delivery receipts remain the v2 wire contract. */
2
+ const count = { type: "integer", minimum: 0 };
3
+ const budget = { type: "object", additionalProperties: false, required: ["armed", "epoch", "state", "executions_used", "executions_remaining", "tokens_used", "tokens_remaining", "agent_executions_used", "agent_tokens_used"], properties: {
4
+ armed: { type: "boolean" }, epoch: { type: "string" }, state: { enum: ["available", "paused", "stopped"] }, reason: { type: "string" },
5
+ executions_used: count, executions_remaining: count, tokens_used: count, tokens_remaining: count,
6
+ agent_executions_used: count, agent_executions_remaining: count, agent_tokens_used: count, agent_tokens_remaining: count
7
+ } };
8
+ export const WORK_AVAILABILITY_SCHEMA = { type: "object", additionalProperties: false, required: ["version", "state", "agents"], properties: {
9
+ version: { const: "noopolis.daimon.work-availability.v1" }, state: { enum: ["running", "paused", "stopped"] },
10
+ agents: { type: "array", maxItems: 32, items: { type: "object", additionalProperties: false, required: ["agent_id", "pending", "running", "deferred", "budget"], properties: { agent_id: { type: "string" }, pending: count, running: { type: "boolean" }, deferred: count, budget, error: { type: "string" } } } },
11
+ drain: { type: "object", additionalProperties: false, required: ["state", "since"], properties: { state: { enum: ["draining", "drained"] }, since: { type: "string" } } }
12
+ } };
13
+ /** Reversible operator drain; the latched `fuse.stop` is a separate, unchanged safety stop. */
14
+ export const OPERATOR_DRAIN = {
15
+ drainRoute: "POST /v2/drain", resumeRoute: "POST /v2/resume", authorization: "control-bearer",
16
+ response: "workAvailabilityResponseSchema", blockedReason: "operator_stop", queuedWakes: "retained", runningTurns: "finish",
17
+ scope: "process", resumeClearsOperatorStop: false
18
+ };
19
+ export const WORK_BLOCKED_SCHEMA = { type: "object", additionalProperties: false, required: ["version", "reason", "retry_after_ms"], properties: {
20
+ version: { const: "noopolis.daimon.work-blocked.v1" }, reason: { enum: ["operator_stop", "ledger_unavailable", "host_stopping", "host_stopped", "queue_full"] }, retry_after_ms: { type: "integer", minimum: 1000, maximum: 300000 }
21
+ } };
@@ -0,0 +1,3 @@
1
+ /** Deterministically serializes JSON data and rejects non-JSON or ambiguous values. */
2
+ export declare const canonicalJson: (value: unknown) => string;
3
+ //# sourceMappingURL=canonicalJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonicalJson.d.ts","sourceRoot":"","sources":["../../src/contracts/canonicalJson.ts"],"names":[],"mappings":"AAiBA,uFAAuF;AACvF,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,MA4B9C,CAAC"}
@@ -0,0 +1,54 @@
1
+ const invalid = (detail) => {
2
+ throw new TypeError(`value is not canonical JSON data: ${detail}`);
3
+ };
4
+ const assertUnicodeScalarString = (value) => {
5
+ for (let index = 0; index < value.length; index += 1) {
6
+ const code = value.charCodeAt(index);
7
+ if (code >= 0xd800 && code <= 0xdbff) {
8
+ const next = value.charCodeAt(index + 1);
9
+ if (!(next >= 0xdc00 && next <= 0xdfff))
10
+ invalid("unpaired surrogate");
11
+ index += 1;
12
+ }
13
+ else if (code >= 0xdc00 && code <= 0xdfff) {
14
+ invalid("unpaired surrogate");
15
+ }
16
+ }
17
+ };
18
+ /** Deterministically serializes JSON data and rejects non-JSON or ambiguous values. */
19
+ export const canonicalJson = (value) => {
20
+ if (value === null || typeof value === "boolean")
21
+ return JSON.stringify(value);
22
+ if (typeof value === "number") {
23
+ if (!Number.isFinite(value) || Object.is(value, -0))
24
+ invalid("non-finite or negative-zero number");
25
+ return JSON.stringify(value);
26
+ }
27
+ if (typeof value === "string") {
28
+ assertUnicodeScalarString(value);
29
+ return JSON.stringify(value);
30
+ }
31
+ if (Array.isArray(value)) {
32
+ for (let index = 0; index < value.length; index += 1) {
33
+ if (!Object.hasOwn(value, index))
34
+ invalid("sparse array");
35
+ }
36
+ return `[${value.map(canonicalJson).join(",")}]`;
37
+ }
38
+ if (typeof value !== "object")
39
+ return invalid(typeof value);
40
+ const prototype = Object.getPrototypeOf(value);
41
+ if (prototype !== Object.prototype && prototype !== null)
42
+ invalid("non-plain object");
43
+ const ownKeys = Reflect.ownKeys(value);
44
+ if (ownKeys.some((key) => typeof key !== "string"))
45
+ invalid("symbol key");
46
+ const keys = ownKeys.sort();
47
+ return `{${keys.map((key) => {
48
+ assertUnicodeScalarString(key);
49
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
50
+ if (descriptor === undefined || !descriptor.enumerable || !("value" in descriptor))
51
+ return invalid("non-data property");
52
+ return `${JSON.stringify(key)}:${canonicalJson(descriptor.value)}`;
53
+ }).join(",")}}`;
54
+ };
@@ -0,0 +1,18 @@
1
+ /** Slot zero pins the clocked template; every other slot replaces only its canonical directory. */
2
+ export declare const GROK_BROKER_TASK_CLOCK_PRELOAD_PATH = "/usr/local/lib/daimon/libfaketime.so.1";
3
+ export declare const GROK_BROKER_TASK_CLOCK_FILE_PATH = "/run/daimon-engine-broker/task-clock/slot-0/faketime";
4
+ export declare const GROK_BROKER_TASK_CLOCK: {
5
+ readonly preloadPath: "/usr/local/lib/daimon/libfaketime.so.1";
6
+ readonly timestampFilePath: "/run/daimon-engine-broker/task-clock/slot-0/faketime";
7
+ readonly directoryPath: "/run/daimon-engine-broker/task-clock/slot-0";
8
+ readonly rootDirectoryPath: "/run/daimon-engine-broker/task-clock";
9
+ readonly directoryMode: 493;
10
+ readonly fileMode: 420;
11
+ readonly ownerUid: 2100;
12
+ readonly version: "noopolis.daimon.grok-broker-task-clock.v2";
13
+ readonly slotDirectoryPattern: "/run/daimon-engine-broker/task-clock/slot-{slot}";
14
+ readonly slotFilePattern: "/run/daimon-engine-broker/task-clock/slot-{slot}/faketime";
15
+ readonly workerView: "own-directory-visible-sibling-directories-denied";
16
+ };
17
+ export type GrokWorkerConfigVariant = "unclocked" | "clocked";
18
+ //# sourceMappingURL=grokBrokerTaskClock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grokBrokerTaskClock.d.ts","sourceRoot":"","sources":["../../src/contracts/grokBrokerTaskClock.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,eAAO,MAAM,mCAAmC,2CAA2C,CAAC;AAC5F,eAAO,MAAM,gCAAgC,yDAAyD,CAAC;AACvG,eAAO,MAAM,sBAAsB;;;;;;;;;;;;CAYzB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ /** Slot zero pins the clocked template; every other slot replaces only its canonical directory. */
2
+ export const GROK_BROKER_TASK_CLOCK_PRELOAD_PATH = "/usr/local/lib/daimon/libfaketime.so.1";
3
+ export const GROK_BROKER_TASK_CLOCK_FILE_PATH = "/run/daimon-engine-broker/task-clock/slot-0/faketime";
4
+ export const GROK_BROKER_TASK_CLOCK = {
5
+ preloadPath: GROK_BROKER_TASK_CLOCK_PRELOAD_PATH,
6
+ timestampFilePath: GROK_BROKER_TASK_CLOCK_FILE_PATH,
7
+ directoryPath: "/run/daimon-engine-broker/task-clock/slot-0",
8
+ rootDirectoryPath: "/run/daimon-engine-broker/task-clock",
9
+ directoryMode: 0o755,
10
+ fileMode: 0o644,
11
+ ownerUid: 2100,
12
+ version: "noopolis.daimon.grok-broker-task-clock.v2",
13
+ slotDirectoryPattern: "/run/daimon-engine-broker/task-clock/slot-{slot}",
14
+ slotFilePattern: "/run/daimon-engine-broker/task-clock/slot-{slot}/faketime",
15
+ workerView: "own-directory-visible-sibling-directories-denied"
16
+ };