@noopolis/daimon 0.1.2 → 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 (330) hide show
  1. package/README.md +269 -51
  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/mcp/toolServer.d.ts +19 -2
  21. package/dist/mcp/toolServer.d.ts.map +1 -1
  22. package/dist/mcp/toolServer.js +57 -17
  23. package/dist/observability/causalEvents.d.ts +3 -3
  24. package/dist/observability/causalEvents.d.ts.map +1 -1
  25. package/dist/observability/causalEvents.js +103 -15
  26. package/dist/observability/orgObserver.d.ts.map +1 -1
  27. package/dist/observability/orgObserver.js +3 -3
  28. package/dist/pi/agyHeadlessResult.d.ts +60 -0
  29. package/dist/pi/agyHeadlessResult.d.ts.map +1 -0
  30. package/dist/pi/agyHeadlessResult.js +95 -0
  31. package/dist/pi/cliChildOutput.d.ts +67 -0
  32. package/dist/pi/cliChildOutput.d.ts.map +1 -0
  33. package/dist/pi/cliChildOutput.js +269 -0
  34. package/dist/pi/cliEngineRun.d.ts +16 -0
  35. package/dist/pi/cliEngineRun.d.ts.map +1 -0
  36. package/dist/pi/cliEngineRun.js +27 -0
  37. package/dist/pi/cliEngineSpawn.d.ts +55 -0
  38. package/dist/pi/cliEngineSpawn.d.ts.map +1 -0
  39. package/dist/pi/cliEngineSpawn.js +164 -0
  40. package/dist/pi/cliEnvironment.d.ts +12 -0
  41. package/dist/pi/cliEnvironment.d.ts.map +1 -0
  42. package/dist/pi/cliEnvironment.js +32 -0
  43. package/dist/pi/cliMcpRegistration.d.ts +61 -0
  44. package/dist/pi/cliMcpRegistration.d.ts.map +1 -0
  45. package/dist/pi/cliMcpRegistration.js +75 -0
  46. package/dist/pi/cliProcess.d.ts +7 -0
  47. package/dist/pi/cliProcess.d.ts.map +1 -0
  48. package/dist/pi/cliProcess.js +132 -0
  49. package/dist/pi/cliSession.d.ts +84 -24
  50. package/dist/pi/cliSession.d.ts.map +1 -1
  51. package/dist/pi/cliSession.js +313 -158
  52. package/dist/pi/cliTurnMetering.d.ts +60 -0
  53. package/dist/pi/cliTurnMetering.d.ts.map +1 -0
  54. package/dist/pi/cliTurnMetering.js +60 -0
  55. package/dist/pi/codexFilesystemRules.d.ts +3 -0
  56. package/dist/pi/codexFilesystemRules.d.ts.map +1 -0
  57. package/dist/pi/codexFilesystemRules.js +28 -0
  58. package/dist/pi/codexHeadlessResult.d.ts +68 -0
  59. package/dist/pi/codexHeadlessResult.d.ts.map +1 -0
  60. package/dist/pi/codexHeadlessResult.js +122 -0
  61. package/dist/pi/codexRolloutUsage.d.ts +95 -0
  62. package/dist/pi/codexRolloutUsage.d.ts.map +1 -0
  63. package/dist/pi/codexRolloutUsage.js +221 -0
  64. package/dist/pi/engineWakeLimits.d.ts +39 -0
  65. package/dist/pi/engineWakeLimits.d.ts.map +1 -0
  66. package/dist/pi/engineWakeLimits.js +55 -0
  67. package/dist/pi/grokHeadlessResult.d.ts +36 -0
  68. package/dist/pi/grokHeadlessResult.d.ts.map +1 -0
  69. package/dist/pi/grokHeadlessResult.js +118 -0
  70. package/dist/pi/grokHomeMcpRegistration.d.ts +21 -0
  71. package/dist/pi/grokHomeMcpRegistration.d.ts.map +1 -0
  72. package/dist/pi/grokHomeMcpRegistration.js +57 -0
  73. package/dist/pi/grokSandbox.d.ts +11 -0
  74. package/dist/pi/grokSandbox.d.ts.map +1 -0
  75. package/dist/pi/grokSandbox.js +216 -0
  76. package/dist/pi/grokStreamUsage.d.ts +31 -0
  77. package/dist/pi/grokStreamUsage.d.ts.map +1 -0
  78. package/dist/pi/grokStreamUsage.js +51 -0
  79. package/dist/pi/piAgentHandle.d.ts +4 -3
  80. package/dist/pi/piAgentHandle.d.ts.map +1 -1
  81. package/dist/pi/piAgentHandle.js +37 -10
  82. package/dist/pi/piAgentWakeSupport.d.ts +35 -0
  83. package/dist/pi/piAgentWakeSupport.d.ts.map +1 -1
  84. package/dist/pi/piAgentWakeSupport.js +4 -0
  85. package/dist/pi/piHarness.d.ts +10 -1
  86. package/dist/pi/piHarness.d.ts.map +1 -1
  87. package/dist/pi/piHarness.js +61 -8
  88. package/dist/pi/prompts.d.ts +1 -0
  89. package/dist/pi/prompts.d.ts.map +1 -1
  90. package/dist/pi/prompts.js +24 -0
  91. package/dist/pi/turnTrace.d.ts.map +1 -1
  92. package/dist/pi/turnTrace.js +5 -8
  93. package/dist/pi/worldTrajectory.d.ts +1 -1
  94. package/dist/pi/worldTrajectory.d.ts.map +1 -1
  95. package/dist/pi/worldTrajectory.js +3 -3
  96. package/dist/runtime/agySubscriptionBootstrap.d.ts +16 -0
  97. package/dist/runtime/agySubscriptionBootstrap.d.ts.map +1 -0
  98. package/dist/runtime/agySubscriptionBootstrap.js +80 -0
  99. package/dist/runtime/agySubscriptionRealm.d.ts +38 -0
  100. package/dist/runtime/agySubscriptionRealm.d.ts.map +1 -0
  101. package/dist/runtime/agySubscriptionRealm.js +242 -0
  102. package/dist/runtime/attention.d.ts +21 -0
  103. package/dist/runtime/attention.d.ts.map +1 -0
  104. package/dist/runtime/attention.js +36 -0
  105. package/dist/runtime/attentionDispatcher.d.ts +66 -0
  106. package/dist/runtime/attentionDispatcher.d.ts.map +1 -0
  107. package/dist/runtime/attentionDispatcher.js +271 -0
  108. package/dist/runtime/cli.d.ts +7 -0
  109. package/dist/runtime/cli.d.ts.map +1 -0
  110. package/dist/runtime/cli.js +251 -0
  111. package/dist/runtime/codexSandboxProjection.d.ts +17 -0
  112. package/dist/runtime/codexSandboxProjection.d.ts.map +1 -0
  113. package/dist/runtime/codexSandboxProjection.js +40 -0
  114. package/dist/runtime/contract-manifest.json +1 -0
  115. package/dist/runtime/contract-manifest.sha256 +1 -0
  116. package/dist/runtime/contractManifest.d.ts +8 -0
  117. package/dist/runtime/contractManifest.d.ts.map +1 -0
  118. package/dist/runtime/contractManifest.js +4 -0
  119. package/dist/runtime/engineBrokerCapabilities.d.ts +30 -0
  120. package/dist/runtime/engineBrokerCapabilities.d.ts.map +1 -0
  121. package/dist/runtime/engineBrokerCapabilities.js +59 -0
  122. package/dist/runtime/engineBrokerControlClient.d.ts +44 -0
  123. package/dist/runtime/engineBrokerControlClient.d.ts.map +1 -0
  124. package/dist/runtime/engineBrokerControlClient.js +132 -0
  125. package/dist/runtime/engineBrokerCredentialJournal.d.ts +10 -0
  126. package/dist/runtime/engineBrokerCredentialJournal.d.ts.map +1 -0
  127. package/dist/runtime/engineBrokerCredentialJournal.js +17 -0
  128. package/dist/runtime/engineBrokerInferenceProtocol.d.ts +52 -0
  129. package/dist/runtime/engineBrokerInferenceProtocol.d.ts.map +1 -0
  130. package/dist/runtime/engineBrokerInferenceProtocol.js +65 -0
  131. package/dist/runtime/engineBrokerMcpCallLog.d.ts +160 -0
  132. package/dist/runtime/engineBrokerMcpCallLog.d.ts.map +1 -0
  133. package/dist/runtime/engineBrokerMcpCallLog.js +219 -0
  134. package/dist/runtime/engineBrokerMcpFacade.d.ts +56 -0
  135. package/dist/runtime/engineBrokerMcpFacade.d.ts.map +1 -0
  136. package/dist/runtime/engineBrokerMcpFacade.js +343 -0
  137. package/dist/runtime/engineBrokerNativeClient.d.ts +52 -0
  138. package/dist/runtime/engineBrokerNativeClient.d.ts.map +1 -0
  139. package/dist/runtime/engineBrokerNativeClient.js +151 -0
  140. package/dist/runtime/engineBrokerProtocol.d.ts +135 -0
  141. package/dist/runtime/engineBrokerProtocol.d.ts.map +1 -0
  142. package/dist/runtime/engineBrokerProtocol.js +274 -0
  143. package/dist/runtime/engineBrokerSealLedger.d.ts +70 -0
  144. package/dist/runtime/engineBrokerSealLedger.d.ts.map +1 -0
  145. package/dist/runtime/engineBrokerSealLedger.js +123 -0
  146. package/dist/runtime/engineBrokerService.d.ts +37 -0
  147. package/dist/runtime/engineBrokerService.d.ts.map +1 -0
  148. package/dist/runtime/engineBrokerService.js +138 -0
  149. package/dist/runtime/engineBrokerServiceCli.d.ts +5 -0
  150. package/dist/runtime/engineBrokerServiceCli.d.ts.map +1 -0
  151. package/dist/runtime/engineBrokerServiceCli.js +32 -0
  152. package/dist/runtime/engineBrokerServiceConfig.d.ts +50 -0
  153. package/dist/runtime/engineBrokerServiceConfig.d.ts.map +1 -0
  154. package/dist/runtime/engineBrokerServiceConfig.js +92 -0
  155. package/dist/runtime/engineBrokerSingleflight.d.ts +13 -0
  156. package/dist/runtime/engineBrokerSingleflight.d.ts.map +1 -0
  157. package/dist/runtime/engineBrokerSingleflight.js +24 -0
  158. package/dist/runtime/engineBrokerTurnAccounting.d.ts +76 -0
  159. package/dist/runtime/engineBrokerTurnAccounting.d.ts.map +1 -0
  160. package/dist/runtime/engineBrokerTurnAccounting.js +108 -0
  161. package/dist/runtime/engineBrokerTurnRegistry.d.ts +57 -0
  162. package/dist/runtime/engineBrokerTurnRegistry.d.ts.map +1 -0
  163. package/dist/runtime/engineBrokerTurnRegistry.js +158 -0
  164. package/dist/runtime/engineDispatcher.d.ts +36 -0
  165. package/dist/runtime/engineDispatcher.d.ts.map +1 -0
  166. package/dist/runtime/engineDispatcher.js +216 -0
  167. package/dist/runtime/engineReadiness.d.ts +23 -0
  168. package/dist/runtime/engineReadiness.d.ts.map +1 -0
  169. package/dist/runtime/engineReadiness.js +222 -0
  170. package/dist/runtime/grokAuthenticationError.d.ts +8 -0
  171. package/dist/runtime/grokAuthenticationError.d.ts.map +1 -0
  172. package/dist/runtime/grokAuthenticationError.js +20 -0
  173. package/dist/runtime/grokBrokerCredentialAuthority.d.ts +22 -0
  174. package/dist/runtime/grokBrokerCredentialAuthority.d.ts.map +1 -0
  175. package/dist/runtime/grokBrokerCredentialAuthority.js +124 -0
  176. package/dist/runtime/grokBrokerCredentialReader.d.ts +5 -0
  177. package/dist/runtime/grokBrokerCredentialReader.d.ts.map +1 -0
  178. package/dist/runtime/grokBrokerCredentialReader.js +37 -0
  179. package/dist/runtime/grokBrokerModelPolicy.d.ts +23 -0
  180. package/dist/runtime/grokBrokerModelPolicy.d.ts.map +1 -0
  181. package/dist/runtime/grokBrokerModelPolicy.js +28 -0
  182. package/dist/runtime/grokBrokerProjection.d.ts +106 -0
  183. package/dist/runtime/grokBrokerProjection.d.ts.map +1 -0
  184. package/dist/runtime/grokBrokerProjection.js +94 -0
  185. package/dist/runtime/grokBrokerProxy.d.ts +55 -0
  186. package/dist/runtime/grokBrokerProxy.d.ts.map +1 -0
  187. package/dist/runtime/grokBrokerProxy.js +262 -0
  188. package/dist/runtime/grokBrokerProxyRequest.d.ts +30 -0
  189. package/dist/runtime/grokBrokerProxyRequest.d.ts.map +1 -0
  190. package/dist/runtime/grokBrokerProxyRequest.js +74 -0
  191. package/dist/runtime/grokBrokerRealmLease.d.ts +4 -0
  192. package/dist/runtime/grokBrokerRealmLease.d.ts.map +1 -0
  193. package/dist/runtime/grokBrokerRealmLease.js +33 -0
  194. package/dist/runtime/grokBrokerRefresh.d.ts +2 -0
  195. package/dist/runtime/grokBrokerRefresh.d.ts.map +1 -0
  196. package/dist/runtime/grokBrokerRefresh.js +15 -0
  197. package/dist/runtime/grokBrokerTurnMeter.d.ts +128 -0
  198. package/dist/runtime/grokBrokerTurnMeter.d.ts.map +1 -0
  199. package/dist/runtime/grokBrokerTurnMeter.js +251 -0
  200. package/dist/runtime/grokBrokerWorkerConfig.d.ts +86 -0
  201. package/dist/runtime/grokBrokerWorkerConfig.d.ts.map +1 -0
  202. package/dist/runtime/grokBrokerWorkerConfig.js +135 -0
  203. package/dist/runtime/grokEngineBroker.d.ts +48 -0
  204. package/dist/runtime/grokEngineBroker.d.ts.map +1 -0
  205. package/dist/runtime/grokEngineBroker.js +114 -0
  206. package/dist/runtime/grokEngineBrokerLedger.d.ts +52 -0
  207. package/dist/runtime/grokEngineBrokerLedger.d.ts.map +1 -0
  208. package/dist/runtime/grokEngineBrokerLedger.js +114 -0
  209. package/dist/runtime/grokEngineBrokerMetering.d.ts +51 -0
  210. package/dist/runtime/grokEngineBrokerMetering.d.ts.map +1 -0
  211. package/dist/runtime/grokEngineBrokerMetering.js +34 -0
  212. package/dist/runtime/grokEngineBrokerTurn.d.ts +58 -0
  213. package/dist/runtime/grokEngineBrokerTurn.d.ts.map +1 -0
  214. package/dist/runtime/grokEngineBrokerTurn.js +165 -0
  215. package/dist/runtime/grokInferenceClientConfig.d.ts +41 -0
  216. package/dist/runtime/grokInferenceClientConfig.d.ts.map +1 -0
  217. package/dist/runtime/grokInferenceClientConfig.js +62 -0
  218. package/dist/runtime/grokInferenceGrants.d.ts +77 -0
  219. package/dist/runtime/grokInferenceGrants.d.ts.map +1 -0
  220. package/dist/runtime/grokInferenceGrants.js +116 -0
  221. package/dist/runtime/grokInferenceProxy.d.ts +29 -0
  222. package/dist/runtime/grokInferenceProxy.d.ts.map +1 -0
  223. package/dist/runtime/grokInferenceProxy.js +82 -0
  224. package/dist/runtime/grokInferenceProxyRequest.d.ts +23 -0
  225. package/dist/runtime/grokInferenceProxyRequest.d.ts.map +1 -0
  226. package/dist/runtime/grokInferenceProxyRequest.js +63 -0
  227. package/dist/runtime/grokSlotPreflightReceipt.d.ts +70 -0
  228. package/dist/runtime/grokSlotPreflightReceipt.d.ts.map +1 -0
  229. package/dist/runtime/grokSlotPreflightReceipt.js +101 -0
  230. package/dist/runtime/grokSubscriptionRealm.d.ts +4 -0
  231. package/dist/runtime/grokSubscriptionRealm.d.ts.map +1 -0
  232. package/dist/runtime/grokSubscriptionRealm.js +435 -0
  233. package/dist/runtime/grokSubscriptionRealmTypes.d.ts +26 -0
  234. package/dist/runtime/grokSubscriptionRealmTypes.d.ts.map +1 -0
  235. package/dist/runtime/grokSubscriptionRealmTypes.js +1 -0
  236. package/dist/runtime/grokWorkerAttestation.d.ts +170 -0
  237. package/dist/runtime/grokWorkerAttestation.d.ts.map +1 -0
  238. package/dist/runtime/grokWorkerAttestation.js +266 -0
  239. package/dist/runtime/grokWorkerDenyPlacement.d.ts +80 -0
  240. package/dist/runtime/grokWorkerDenyPlacement.d.ts.map +1 -0
  241. package/dist/runtime/grokWorkerDenyPlacement.js +128 -0
  242. package/dist/runtime/grokWorkerHomeAttestation.d.ts +30 -0
  243. package/dist/runtime/grokWorkerHomeAttestation.d.ts.map +1 -0
  244. package/dist/runtime/grokWorkerHomeAttestation.js +69 -0
  245. package/dist/runtime/grokWorkerSandboxProfile.d.ts +27 -0
  246. package/dist/runtime/grokWorkerSandboxProfile.d.ts.map +1 -0
  247. package/dist/runtime/grokWorkerSandboxProfile.js +44 -0
  248. package/dist/runtime/grokWorkerTmpAttestation.d.ts +55 -0
  249. package/dist/runtime/grokWorkerTmpAttestation.d.ts.map +1 -0
  250. package/dist/runtime/grokWorkerTmpAttestation.js +63 -0
  251. package/dist/runtime/index.d.ts +26 -0
  252. package/dist/runtime/index.d.ts.map +1 -0
  253. package/dist/runtime/index.js +23 -0
  254. package/dist/runtime/inferenceUsageLedger.d.ts +38 -0
  255. package/dist/runtime/inferenceUsageLedger.d.ts.map +1 -0
  256. package/dist/runtime/inferenceUsageLedger.js +53 -0
  257. package/dist/runtime/mcpToolResult.d.ts +127 -0
  258. package/dist/runtime/mcpToolResult.d.ts.map +1 -0
  259. package/dist/runtime/mcpToolResult.js +214 -0
  260. package/dist/runtime/moltnetMachineRead.d.ts +97 -0
  261. package/dist/runtime/moltnetMachineRead.d.ts.map +1 -0
  262. package/dist/runtime/moltnetMachineRead.js +183 -0
  263. package/dist/runtime/native/daimon-engine-broker +0 -0
  264. package/dist/runtime/organizationRuntime.d.ts +165 -0
  265. package/dist/runtime/organizationRuntime.d.ts.map +1 -0
  266. package/dist/runtime/organizationRuntime.js +3 -0
  267. package/dist/runtime/organizationRuntimeControl.d.ts +42 -0
  268. package/dist/runtime/organizationRuntimeControl.d.ts.map +1 -0
  269. package/dist/runtime/organizationRuntimeControl.js +235 -0
  270. package/dist/runtime/organizationRuntimeHost.d.ts +19 -0
  271. package/dist/runtime/organizationRuntimeHost.d.ts.map +1 -0
  272. package/dist/runtime/organizationRuntimeHost.js +359 -0
  273. package/dist/runtime/organizationRuntimeParsing.d.ts +6 -0
  274. package/dist/runtime/organizationRuntimeParsing.d.ts.map +1 -0
  275. package/dist/runtime/organizationRuntimeParsing.js +370 -0
  276. package/dist/runtime/organizationRuntimeReadiness.d.ts +12 -0
  277. package/dist/runtime/organizationRuntimeReadiness.d.ts.map +1 -0
  278. package/dist/runtime/organizationRuntimeReadiness.js +59 -0
  279. package/dist/runtime/physicalReadiness.d.ts +47 -0
  280. package/dist/runtime/physicalReadiness.d.ts.map +1 -0
  281. package/dist/runtime/physicalReadiness.js +142 -0
  282. package/dist/runtime/portableCredentialAuth.d.ts +6 -0
  283. package/dist/runtime/portableCredentialAuth.d.ts.map +1 -0
  284. package/dist/runtime/portableCredentialAuth.js +70 -0
  285. package/dist/runtime/portableCredentialMaterial.d.ts +8 -0
  286. package/dist/runtime/portableCredentialMaterial.d.ts.map +1 -0
  287. package/dist/runtime/portableCredentialMaterial.js +169 -0
  288. package/dist/runtime/productionAgentTools.d.ts +5 -0
  289. package/dist/runtime/productionAgentTools.d.ts.map +1 -0
  290. package/dist/runtime/productionAgentTools.js +328 -0
  291. package/dist/runtime/runtimeHomeLayout.d.ts +48 -0
  292. package/dist/runtime/runtimeHomeLayout.d.ts.map +1 -0
  293. package/dist/runtime/runtimeHomeLayout.js +84 -0
  294. package/dist/runtime/schedule.d.ts +40 -0
  295. package/dist/runtime/schedule.d.ts.map +1 -0
  296. package/dist/runtime/schedule.js +371 -0
  297. package/dist/runtime/storeCoordination.d.ts +23 -0
  298. package/dist/runtime/storeCoordination.d.ts.map +1 -0
  299. package/dist/runtime/storeCoordination.js +94 -0
  300. package/dist/runtime/toolResultSpill.d.ts +152 -0
  301. package/dist/runtime/toolResultSpill.d.ts.map +1 -0
  302. package/dist/runtime/toolResultSpill.js +351 -0
  303. package/dist/runtime/turnRequestLedger.d.ts +160 -0
  304. package/dist/runtime/turnRequestLedger.d.ts.map +1 -0
  305. package/dist/runtime/turnRequestLedger.js +249 -0
  306. package/dist/runtime/turnUsageLedger.d.ts +143 -0
  307. package/dist/runtime/turnUsageLedger.d.ts.map +1 -0
  308. package/dist/runtime/turnUsageLedger.js +203 -0
  309. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts +17 -0
  310. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts.map +1 -0
  311. package/dist/runtime/wakeAcceptanceProcessIdentity.js +50 -0
  312. package/dist/runtime/wakeAcceptanceReconciliation.d.ts +211 -0
  313. package/dist/runtime/wakeAcceptanceReconciliation.d.ts.map +1 -0
  314. package/dist/runtime/wakeAcceptanceReconciliation.js +289 -0
  315. package/dist/runtime/wakeAcceptanceRecord.d.ts +23 -0
  316. package/dist/runtime/wakeAcceptanceRecord.d.ts.map +1 -0
  317. package/dist/runtime/wakeAcceptanceRecord.js +56 -0
  318. package/dist/runtime/wakeAcceptanceRetention.d.ts +12 -0
  319. package/dist/runtime/wakeAcceptanceRetention.d.ts.map +1 -0
  320. package/dist/runtime/wakeAcceptanceRetention.js +12 -0
  321. package/dist/runtime/wakeAcceptanceStore.d.ts +113 -0
  322. package/dist/runtime/wakeAcceptanceStore.d.ts.map +1 -0
  323. package/dist/runtime/wakeAcceptanceStore.js +558 -0
  324. package/dist/runtime/wakeAcceptanceTypes.d.ts +179 -0
  325. package/dist/runtime/wakeAcceptanceTypes.d.ts.map +1 -0
  326. package/dist/runtime/wakeAcceptanceTypes.js +95 -0
  327. package/dist/runtime/wakeFuse.d.ts +69 -0
  328. package/dist/runtime/wakeFuse.d.ts.map +1 -0
  329. package/dist/runtime/wakeFuse.js +367 -0
  330. package/package.json +20 -9
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,250 @@ 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
+ 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
+
52
299
  By default, the in-process Mneme runtime uses the same path as each agent's
53
300
  `runtimeHomePath`. If you need agents to keep separate Pi/runtime directories but
54
301
  share one memory bank, pass an explicit `memory.runtimeHomePath` in
@@ -98,18 +345,26 @@ upstream-documented dummy `ollama` value.
98
345
 
99
346
  ## Pi E2E
100
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
+
101
357
  The Pi E2E uses the local Codex CLI subscription auth file to seed an ignored Pi
102
358
  `auth.json` under `.runtime/`.
103
359
 
104
360
  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
361
+ (`~/.codex/auth.json` for Pi/Codex; triad additionally needs
106
362
  authenticated `grok` and `agy` CLIs on PATH). They are not part of `npm test`.
107
363
 
108
364
  ```bash
109
365
  npm install
110
366
  npm run e2e:pi-agent
111
367
  npm run e2e:pi-memory-org
112
- npm run e2e:mixed-engine-org
113
368
  npm run e2e:jungian-play-org
114
369
  npm run e2e:jungian-triad-org
115
370
  ```
@@ -141,52 +396,15 @@ speaks through a Pi agent seeded from local Codex subscription auth. All three
141
396
  selves carry the same full archetype set, rotated through the run so every
142
397
  archetype gets consulted.
143
398
 
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.
399
+ ## Docs
169
400
 
170
- This creates:
401
+ Start with `docs/README.md` for the current documentation map:
171
402
 
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
- ```
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.
189
409
 
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.
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
+ };
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Fixed operating contract every broker-launched Grok worker receives through
3
+ * `--system-prompt-override`.
4
+ *
5
+ * The override replaces Grok's ~12k-token coding-agent system prompt and stops
6
+ * cwd `AGENTS.md` injection; the agent's identity and instructions still arrive
7
+ * in the prompt file. It is compiled into the native launcher byte-for-byte
8
+ * (`DBL_GROK_SYSTEM_PROMPT`), pinned by sha256 in the runtime contract
9
+ * manifest, and must stay ASCII without quotes or backslashes so the C literal
10
+ * needs no escaping.
11
+ *
12
+ * Daimon's per-wake tools reach Grok as deferred MCP tools named
13
+ * `daimon__<tool>` (server `[mcp_servers.daimon]`). Naming them lets `use_tool`
14
+ * run directly and saves one `search_tool` round trip per tool (P0: 3 → 2
15
+ * requests).
16
+ */
17
+ /**
18
+ * The atoms of that route, and its single definition.
19
+ *
20
+ * Both texts a Grok worker receives are rendered from them: the pinned system
21
+ * prompt below, and the caller's identity envelope
22
+ * ({@link grokMountedToolNamingRule}, used by `src/runtime/engineDispatcher.ts`).
23
+ * They were worded independently once, and the envelope told the model to call
24
+ * the tools by their bare names - which Grok 1.0.34 refuses outright, before
25
+ * any HTTP: `'moltnet_read' is not a valid MCP tool name. Tool names must be
26
+ * qualified as \`server__tool\`` (local rig, real CLI, real rendered config).
27
+ * There is exactly one valid spelling, so two independently worded naming rules
28
+ * are one rule too many; this is the single definition both render from.
29
+ */
30
+ export declare const DAIMON_GROK_MCP_SERVER: "daimon";
31
+ /** Grok's own name for an MCP tool of that server: exactly what `tool_name` must carry. */
32
+ export declare const DAIMON_GROK_TOOL_PREFIX: "daimon__";
33
+ export declare const grokDaimonToolName: (tool: string) => string;
34
+ /** Grok's two MCP meta-tools, and the argument that names a tool for the first. */
35
+ export declare const GROK_MCP_INVOKE_TOOL: "use_tool";
36
+ export declare const GROK_MCP_SEARCH_TOOL: "search_tool";
37
+ export declare const GROK_MCP_TOOL_NAME_ARGUMENT: "tool_name";
38
+ export declare const DAIMON_GROK_SYSTEM_PROMPT: string;
39
+ /**
40
+ * The same route, stated once for the caller's identity envelope, where a
41
+ * wake's real mounted tools are known.
42
+ *
43
+ * It contributes exactly what the pinned prompt cannot know - the wake's real
44
+ * mounted names - and the one rule that makes them callable. It asserts rather
45
+ * than corrects: one bare catalogue, one prefix rule, one example, and the
46
+ * prefixed form named as the *only* valid form, because that is the CLI's own
47
+ * verdict on a bare name rather than a preference.
48
+ *
49
+ * What it deliberately leaves out is as load bearing. It never claims the
50
+ * agent's own instructions spell a tool wrongly, never offers a shell or CLI
51
+ * route, never repeats the catalogue in prefixed form - and never restates the
52
+ * `search_tool` rule. A Grok worker already reads two authoritative sentences
53
+ * about `search_tool`: the pinned prompt's ("only for a name you do not know")
54
+ * and Grok's own injected notice, which says the model MUST call it before any
55
+ * MCP tool. Observed on the rig: that contradiction is not enforced, and
56
+ * `use_tool` works with no prior `search_tool`. A third wording would only add
57
+ * a voice, so this sentence stays out of that argument entirely.
58
+ */
59
+ export declare const grokMountedToolNamingRule: (mountedToolNames: readonly string[]) => string;
60
+ /** Closed declared-model vocabulary; defaults are `grok-4.6` at `low`. */
61
+ export declare const GROK_BROKER_MODELS: readonly ["grok-4.6", "grok-4.5", "grok-build"];
62
+ export declare const GROK_BROKER_REASONING_EFFORTS: readonly ["low", "medium", "high"];
63
+ /** `--tools` input ids. These are NOT the model-visible names (see below). */
64
+ export declare const GROK_WORKER_TOOL_IDS: readonly ["run_terminal_cmd", "read_file", "grep", "list_dir", "search_tool", "use_tool"];
65
+ /**
66
+ * The exact tool names a lean worker request body must carry.
67
+ *
68
+ * Grok 1.0.34 fails open on an unmappable `--tools` entry and ships all 19
69
+ * tools, so the proxy compares every upstream body against this set.
70
+ */
71
+ export declare const GROK_WORKER_VISIBLE_TOOLS: readonly ["grep", "list_dir", "read_file", "run_terminal_command", "search_tool", "use_tool"];
72
+ /** `--max-turns` backstop compiled into the launcher; per-wake ceilings belong to the broker. */
73
+ export declare const GROK_WORKER_MAX_TURNS: 48;
74
+ //# sourceMappingURL=grokWorkerContract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grokWorkerContract.d.ts","sourceRoot":"","sources":["../../src/contracts/grokWorkerContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,EAAG,QAAiB,CAAC;AACxD,2FAA2F;AAC3F,eAAO,MAAM,uBAAuB,YAAyC,CAAC;AAC9E,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,MAA6C,CAAC;AAChG,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,EAAG,UAAmB,CAAC;AACxD,eAAO,MAAM,oBAAoB,EAAG,aAAsB,CAAC;AAC3D,eAAO,MAAM,2BAA2B,EAAG,WAAoB,CAAC;AAIhE,eAAO,MAAM,yBAAyB,QAO3B,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GAAI,kBAAkB,SAAS,MAAM,EAAE,KAAG,MAM/E,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,iDAAiE,CAAC;AACjG,eAAO,MAAM,6BAA6B,oCAAoD,CAAC;AAE/F,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,2FAA2G,CAAC;AAE7I;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,+FAA+G,CAAC;AAEtJ,iGAAiG;AACjG,eAAO,MAAM,qBAAqB,EAAG,EAAW,CAAC"}