@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
package/README.md CHANGED
@@ -5,9 +5,22 @@ Daimon is the Noopolis-native per-agent runtime harness.
5
5
  It defines a small per-agent contract and currently implements that contract on
6
6
  top of Pi. A Daimon runs one harnessed agent inside a caller-prepared workspace.
7
7
 
8
- Spawnfile should own orgs, nested teams, schedules, Moltnet wiring, workspace
9
- resource compilation, and the app that starts many harnessed agents. This package
10
- should not know what an org is.
8
+ Spawnfile compiles and deploys orgs, nested teams, member-owned schedules,
9
+ Moltnet wiring, and workspace resources. Daimon executes one agent runtime: it
10
+ accepts a wake selected by that runtime's organization policy and runs one
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.
16
+
17
+ For a world-capable `kind: every` wake, the harness starts without a decision
18
+ token and privately calls `world_claim` before exposing any other world tool.
19
+ The claim binds authority to the schedule wake's run/request/wake identity; the
20
+ opaque token stays inside the harness. Subsequent observe/affordance/action
21
+ calls carry it without placing it in the model prompt or tool schema. Optional
22
+ world recommendations are ordinary observation fields discovered after the
23
+ independent wake and claim—they are never Daimon wake inputs.
11
24
 
12
25
  ## Install
13
26
 
@@ -15,6 +28,8 @@ should not know what an org is.
15
28
  npm install @noopolis/daimon
16
29
  ```
17
30
 
31
+ The latest published version may differ; this README describes the source tree (0.2.0).
32
+
18
33
  For Pi agents with memory enabled, install Mneme too:
19
34
 
20
35
  ```bash
@@ -37,10 +52,275 @@ Pi-specific exports live under the Pi subpath:
37
52
  import { PiHarnessAdapter } from "@noopolis/daimon/pi";
38
53
  ```
39
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
+ A batch's atomic per-agent claim records its complete membership and stable
176
+ `execution_id` before cognition. Individual receipts retain their delivery ids
177
+ and explicit state. `GET /v2/activity.executions` identifies the live turn even
178
+ when all its message receipts have already completed; integrations should bind
179
+ turn authority to that execution id. The wake environment uses the same id.
180
+
181
+ Each accepted delivery also has a private, bounded execution claim with an
182
+ owner and generation fence. A second host sharing the authority may observe a
183
+ receipt but cannot dispatch while the live claimant owns it; only the matching,
184
+ unexpired fence can record its terminal state. Claim revalidation and receipt
185
+ replacement are covered by a separate exclusive, fsynced per-receipt transition
186
+ lock; a recovered generation fences an older paused writer before replacement.
187
+ After a host crash, a bounded stale claim can be recovered and replayed. This is durable at-least-once turn
188
+ delivery, not exactly-once cognition: if an engine has an external effect and
189
+ the host crashes before its terminal receipt is persisted, recovery can run the
190
+ turn again. Callers requiring exactly-once external effects must fence or
191
+ deduplicate those effects at their own destination.
192
+
193
+ The durable v2 store is a Linux-container contract. Its non-expiring commit
194
+ lock records the owner PID, Linux `/proc` process-start identity, boot id, and
195
+ PID-namespace device/inode identity; recovery is allowed only after that exact
196
+ owner is proven dead in the same namespace, so PID reuse cannot unlock a live
197
+ writer. A different or unobservable PID namespace raises the typed,
198
+ path-free `WakeTransitionLockBlockedError` with code
199
+ `offline_reconciliation_required`; it is never automatically cleared. For a
200
+ replacement container, deployment authority must first prove the prior
201
+ container absent or quiescent, then perform an explicit offline stale-lock
202
+ reconciliation. On a platform where this identity cannot be proven, v2 fails
203
+ closed rather than using a clock-based lock; v1 remains available without the
204
+ v2 store.
205
+
206
+ ### Offline transition reconciliation
207
+
208
+ `reconcileOfflineWakeTransition` is a deployment-admin library operation, not
209
+ an HTTP endpoint and never a normal host action. It accepts only the versioned
210
+ `noopolis.daimon.offline-transition-reconciliation.v1` request, including the
211
+ exact store and lock device/inode identities, owner/generation/PID-namespace
212
+ identity, and an opaque absent-or-quiescent deployment attestation. The caller
213
+ must mount the store exclusively offline and supply the deployment authority's
214
+ attestation verifier. Daimon gives that verifier a canonical immutable
215
+ authorization context (deployment identity, nonce, request digest, every
216
+ store/delivery/lock identity, and every stale host registration's exact file
217
+ device/inode, owner, process, boot, and PID-namespace identity); its returned
218
+ proof receipt must echo that exact digest and nonce and certify
219
+ `exclusive_store: true`. A same-namespace registration is cleared only when
220
+ its owner is proven dead. A cross-namespace registration is cleared only when
221
+ the proof authorizes that exact canonical registration digest after deployment
222
+ has proven the old container absent or quiescent. Unknown, live, unlisted, or
223
+ changed registrations block. Daimon validates the physical store, delivery
224
+ record, and lock again immediately before its fsynced removal. The proof
225
+ itself is never persisted or returned; the durable redacted receipt records
226
+ only cleared registration digests.
227
+
228
+ The operation writes a durable redacted receipt and returns it on an identical
229
+ replay. An identity mismatch, invalid proof, concurrent administrative lease,
230
+ or changed replay returns the stable blocked result
231
+ `{ state: "blocked", code: "offline_reconciliation_required" }`. It performs
232
+ no runtime auto-clear and has no CLI or public-server admin route in C0. The
233
+ admin lease itself carries PID/start/boot/PID-namespace identity: a retry may
234
+ recover it only after proving the prior owner dead in the same namespace. Lease
235
+ unlink and directory fsync failures prevent a successful result; the durable
236
+ prepared receipt lets an authorized offline retry finish after a crash.
237
+
238
+ Every running wake-acceptance store also holds its own fsynced host-lifetime
239
+ registration with the same process identity. A host writes that registration
240
+ before becoming usable and rechecks the offline lease; the offline operation
241
+ takes its lease first, then rejects live or unprovable host registrations.
242
+ This permits normal concurrent hosts, but prevents either startup/admin race
243
+ from overlapping an administrative reconciliation.
244
+
245
+ The runtime may bind `0.0.0.0` when its caller places it on a dedicated private
246
+ container network. Daimon neither publishes ports nor selects networks; the
247
+ deployer must keep the control endpoint un-published and allow only its
248
+ authorized control-plane client to reach it.
249
+
250
+ The JSON Schema is deliberately standard and structural. The pure parser and
251
+ validator are normative for semantic checks that standard JSON Schema cannot
252
+ express, including unique ids, own-property records, and pairwise
253
+ non-overlapping canonical POSIX workspace/runtime-home paths; call the parser
254
+ before runtime side effects. The parser canonicalizes absolute path spellings
255
+ before retaining or comparing them. Before creating agents, the host verifies
256
+ that caller-created roots are real, current-user-owned directories without
257
+ symlink components; runtime homes must be exactly `0700`, and workspaces must
258
+ not be group/other writable. Daimon never creates or removes these roots.
259
+
260
+ For a production CLI engine, Daimon resolves the engine from `PATH` once,
261
+ pins its canonical executable identity, probes only `--version`, and rechecks
262
+ that identity before every child process. Codex uses a caller-provisioned
263
+ private `.codex/auth.json` refresh credential beneath each agent's
264
+ `runtimeHomePath`. Grok instead uses one host-wide durable subscription realm:
265
+ a read-only operator bootstrap seeds the authority, and Daimon serializes
266
+ turns while staging and reconciling the rotating credential into each private
267
+ agent home. Sessions and non-auth state remain isolated per agent. Engine
268
+ children receive only the matching engine home, runtime/XDG paths,
269
+ locale/timezone, and a PATH sufficient for the already pinned executable.
270
+ Before every Grok process, Daimon rewrites its exact custom sandbox profile and
271
+ requires a fresh kernel-enforcement receipt covering the durable realm,
272
+ read-only bootstrap, and every peer workspace/runtime home. A fail-open
273
+ Landlock/Seatbelt warning, missing deny path, or profile mutation fails the
274
+ wake before cognition.
275
+ They never inherit arbitrary host variables. Missing, replaced, malformed,
276
+ stale, or unsafe engine authority prevents startup or fails the affected wake
277
+ without publishing credential contents or file paths.
278
+
279
+ AGY subscription authentication is different: it uses OS-native secure
280
+ storage. Daimon supervises one private D-Bus plus Secret Service realm for all
281
+ AGY agents on the host, holds an exclusive lease on its durable encrypted
282
+ keyring volume, and unlocks it from an independent caller-owned `0600`
283
+ read-only mount through bounded stdin. Only AGY children receive that realm's
284
+ exact bus address. Normal startup proves enrollment with `agy models` before
285
+ any agent starts.
286
+
287
+ Enroll an empty realm once from an interactive terminal:
288
+
289
+ ```bash
290
+ daimon-runtime auth agy login --config /runtime/daimon-runtime.json
291
+ ```
292
+
293
+ The command starts the same realm and launches the pinned `agy` as a Daimon
294
+ child with no AGY arguments, allowing its remote URL-and-code sign-in flow.
295
+ After the operator exits AGY, Daimon runs the noninteractive enrollment proof
296
+ and preserves the durable keyring state. It never accepts a portable AGY token
297
+ file, API key, ADC credential, token export, or ambient D-Bus session.
298
+
299
+ By default, the in-process Mneme runtime uses the same path as each agent's
300
+ `runtimeHomePath`. If you need agents to keep separate Pi/runtime directories but
301
+ share one memory bank, pass an explicit `memory.runtimeHomePath` in
302
+ `PiHarnessOptions`.
303
+
304
+ ```ts
305
+ const adapter = new PiHarnessAdapter({
306
+ authPath: "/tmp/daimon-auth.json",
307
+ memory: {
308
+ runtimeHomePath: "/shared/memory/bank"
309
+ }
310
+ });
311
+ ```
312
+
313
+ Pi agents receive Mneme tools in awake mode for normal work. Dream wakes use a
314
+ fresh one-off Pi session under `sessions/dream/<wake-id>-<random>` and inject
315
+ the Mneme dream guidance instead. Daimon does not automatically record every
316
+ turn as memory; agents write memories only by calling Mneme tools such as
317
+ `memory_register`, `memory_summarize`, and `memory_forget`.
318
+
40
319
  ## Tests
41
320
 
42
- The package has a non-live test suite for auth seeding and Pi model config
43
- generation:
321
+ The package has a non-live test suite covering auth seeding, Pi model config
322
+ generation, the harness contract, memory tool wiring, wake and turn traces, and
323
+ the org observer:
44
324
 
45
325
  ```bash
46
326
  npm test
@@ -65,14 +345,26 @@ upstream-documented dummy `ollama` value.
65
345
 
66
346
  ## Pi E2E
67
347
 
348
+ `npm run live:grok-broker` checks an existing Grok subscription login through
349
+ the real CLI and Daimon provider proxy, then repeats after restarting the proxy.
350
+ It spends two short model turns, requires their exact terminal reply and real
351
+ usage, and gives each CLI a temporary home containing only a scoped capability.
352
+ The operator credential is read in the parent process and is never copied or
353
+ refreshed. This is a local authentication/transport check; it does not exercise
354
+ the Linux native launcher, worker attestation, MCP tools, or OAuth renewal.
355
+ Success ends with `GROK_BROKER_AUTH_RESTART_OK`.
356
+
68
357
  The Pi E2E uses the local Codex CLI subscription auth file to seed an ignored Pi
69
358
  `auth.json` under `.runtime/`.
70
359
 
360
+ These are live runs: they spend real tokens and require local engine auth
361
+ (`~/.codex/auth.json` for Pi/Codex; triad additionally needs
362
+ authenticated `grok` and `agy` CLIs on PATH). They are not part of `npm test`.
363
+
71
364
  ```bash
72
365
  npm install
73
366
  npm run e2e:pi-agent
74
367
  npm run e2e:pi-memory-org
75
- npm run e2e:mixed-engine-org
76
368
  npm run e2e:jungian-play-org
77
369
  npm run e2e:jungian-triad-org
78
370
  ```
@@ -104,45 +396,15 @@ speaks through a Pi agent seeded from local Codex subscription auth. All three
104
396
  selves carry the same full archetype set, rotated through the run so every
105
397
  archetype gets consulted.
106
398
 
107
- ## Design Notes
108
-
109
- - `MEMORY-SYSTEM.md` describes the implemented scoped memory runtime.
110
- - `ENGINE-SYSTEM.md` describes the next engine abstraction plan: Pi, Ollama,
111
- API providers, and CLI-backed engines such as `agy`, `grok`, and `gemini`.
112
- - Mneme is a sibling package, `@noopolis/mneme`, published separately and used
113
- by Daimon in-process for Pi agents. Other runtimes can use Mneme through its
114
- MCP server. The agent-facing tools stay named `memory_search`,
115
- `memory_register`, and `memory.*` at the protocol boundary because those names
116
- are clearer to agents.
117
-
118
- ## Runtime Artifact Image
119
-
120
- Daimon can build a local copy-only runtime artifact image for Spawnfile:
121
-
122
- ```bash
123
- npm run image:runtime:local
124
- ```
125
-
126
- This creates:
127
-
128
- ```text
129
- noopolis/spawnfile-runtime-daimon:0.1.1-local
130
- ```
399
+ ## Docs
131
400
 
132
- The image is not a full organization image and is not intended to be run
133
- directly. It contains only:
401
+ Start with `docs/README.md` for the current documentation map:
134
402
 
135
- ```text
136
- /opt/spawnfile/runtime-installs/daimon
137
- ```
138
-
139
- Spawnfile can copy that path into generated organization images:
140
-
141
- ```bash
142
- SPAWNFILE_DAIMON_RUNTIME_IMAGE=noopolis/spawnfile-runtime-daimon:0.1.1-local \
143
- spawnfile build ./agentic-org
144
- ```
403
+ - `docs/runtime.md` explains the organization-runtime config, control API,
404
+ schedules, durable wake acceptance, and attention.
405
+ - `docs/engines.md` explains Pi and CLI engine boundaries.
406
+ - `docs/memory.md` explains Daimon's Mneme adapter.
407
+ - `docs/observability.md` explains causal events, raw capture, and world
408
+ trajectories.
145
409
 
146
- This keeps mixed-runtime organizations composable: a generated image can copy
147
- Daimon, OpenClaw, PicoClaw, or any future runtime artifact independently instead
148
- of depending on one prebuilt image for every runtime combination.
410
+ Historical migration plans and audits live under `archive/`.
@@ -0,0 +1,117 @@
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
+ };
98
+ };
99
+ export declare const WORK_BLOCKED_SCHEMA: {
100
+ readonly type: "object";
101
+ readonly additionalProperties: false;
102
+ readonly required: readonly ["version", "reason", "retry_after_ms"];
103
+ readonly properties: {
104
+ readonly version: {
105
+ readonly const: "noopolis.daimon.work-blocked.v1";
106
+ };
107
+ readonly reason: {
108
+ readonly enum: readonly ["operator_stop", "ledger_unavailable", "host_stopping", "host_stopped", "queue_full"];
109
+ };
110
+ readonly retry_after_ms: {
111
+ readonly type: "integer";
112
+ readonly minimum: 1000;
113
+ readonly maximum: 300000;
114
+ };
115
+ };
116
+ };
117
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGzB,CAAC;AACb,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;CAEpB,CAAC"}
@@ -0,0 +1,14 @@
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
+ } };
12
+ export const WORK_BLOCKED_SCHEMA = { type: "object", additionalProperties: false, required: ["version", "reason", "retry_after_ms"], properties: {
13
+ 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 }
14
+ } };
@@ -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
+ };