@noopolis/daimon 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. package/README.md +307 -45
  2. package/dist/contracts/attentionContract.d.ts +117 -0
  3. package/dist/contracts/attentionContract.d.ts.map +1 -0
  4. package/dist/contracts/attentionContract.js +14 -0
  5. package/dist/contracts/canonicalJson.d.ts +3 -0
  6. package/dist/contracts/canonicalJson.d.ts.map +1 -0
  7. package/dist/contracts/canonicalJson.js +54 -0
  8. package/dist/contracts/grokWorkerContract.d.ts +74 -0
  9. package/dist/contracts/grokWorkerContract.d.ts.map +1 -0
  10. package/dist/contracts/grokWorkerContract.js +88 -0
  11. package/dist/contracts/organizationRuntimeContract.d.ts +765 -0
  12. package/dist/contracts/organizationRuntimeContract.d.ts.map +1 -0
  13. package/dist/contracts/organizationRuntimeContract.js +121 -0
  14. package/dist/contracts/runtimeContractManifest.d.ts +1615 -0
  15. package/dist/contracts/runtimeContractManifest.d.ts.map +1 -0
  16. package/dist/contracts/runtimeContractManifest.js +181 -0
  17. package/dist/core/credentialRedaction.d.ts +4 -0
  18. package/dist/core/credentialRedaction.d.ts.map +1 -0
  19. package/dist/core/credentialRedaction.js +28 -0
  20. package/dist/core/siblingBuildFreshness.d.ts +21 -0
  21. package/dist/core/siblingBuildFreshness.d.ts.map +1 -0
  22. package/dist/core/siblingBuildFreshness.js +25 -0
  23. package/dist/core/types.d.ts +10 -1
  24. package/dist/core/types.d.ts.map +1 -1
  25. package/dist/examples/exampleCausalId.d.ts +3 -0
  26. package/dist/examples/exampleCausalId.d.ts.map +1 -0
  27. package/dist/examples/exampleCausalId.js +8 -0
  28. package/dist/examples/jungian-play-org.js +3 -2
  29. package/dist/examples/jungian-triad-org.js +3 -2
  30. package/dist/examples/jungianPlayAgent.d.ts +1 -1
  31. package/dist/examples/jungianPlayAgent.d.ts.map +1 -1
  32. package/dist/examples/jungianPlayAgent.js +1 -1
  33. package/dist/examples/jungianProfiles.d.ts +1 -1
  34. package/dist/examples/jungianProfiles.d.ts.map +1 -1
  35. package/dist/examples/jungianTriadProfiles.d.ts +1 -1
  36. package/dist/examples/jungianTriadProfiles.d.ts.map +1 -1
  37. package/dist/examples/pi-agent.js +3 -2
  38. package/dist/examples/pi-memory-org.js +6 -5
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +1 -0
  42. package/dist/mcp/toolServer.d.ts +31 -0
  43. package/dist/mcp/toolServer.d.ts.map +1 -0
  44. package/dist/mcp/toolServer.js +145 -0
  45. package/dist/observability/causalEvents.d.ts +118 -0
  46. package/dist/observability/causalEvents.d.ts.map +1 -0
  47. package/dist/observability/causalEvents.js +223 -0
  48. package/dist/observability/controlCausal.d.ts +117 -0
  49. package/dist/observability/controlCausal.d.ts.map +1 -0
  50. package/dist/observability/controlCausal.js +107 -0
  51. package/dist/observability/emitCausalFixture.d.ts +25 -0
  52. package/dist/observability/emitCausalFixture.d.ts.map +1 -0
  53. package/dist/observability/emitCausalFixture.js +98 -0
  54. package/dist/observability/index.d.ts +2 -0
  55. package/dist/observability/index.d.ts.map +1 -1
  56. package/dist/observability/index.js +2 -0
  57. package/dist/observability/orgObserver.d.ts.map +1 -1
  58. package/dist/observability/orgObserver.js +3 -3
  59. package/dist/pi/agyHeadlessResult.d.ts +60 -0
  60. package/dist/pi/agyHeadlessResult.d.ts.map +1 -0
  61. package/dist/pi/agyHeadlessResult.js +95 -0
  62. package/dist/pi/cliChildOutput.d.ts +67 -0
  63. package/dist/pi/cliChildOutput.d.ts.map +1 -0
  64. package/dist/pi/cliChildOutput.js +269 -0
  65. package/dist/pi/cliEngineRun.d.ts +16 -0
  66. package/dist/pi/cliEngineRun.d.ts.map +1 -0
  67. package/dist/pi/cliEngineRun.js +27 -0
  68. package/dist/pi/cliEngineSpawn.d.ts +55 -0
  69. package/dist/pi/cliEngineSpawn.d.ts.map +1 -0
  70. package/dist/pi/cliEngineSpawn.js +164 -0
  71. package/dist/pi/cliEnvironment.d.ts +12 -0
  72. package/dist/pi/cliEnvironment.d.ts.map +1 -0
  73. package/dist/pi/cliEnvironment.js +32 -0
  74. package/dist/pi/cliMcpRegistration.d.ts +61 -0
  75. package/dist/pi/cliMcpRegistration.d.ts.map +1 -0
  76. package/dist/pi/cliMcpRegistration.js +75 -0
  77. package/dist/pi/cliProcess.d.ts +7 -0
  78. package/dist/pi/cliProcess.d.ts.map +1 -0
  79. package/dist/pi/cliProcess.js +132 -0
  80. package/dist/pi/cliSession.d.ts +106 -0
  81. package/dist/pi/cliSession.d.ts.map +1 -0
  82. package/dist/pi/cliSession.js +379 -0
  83. package/dist/pi/cliTurnMetering.d.ts +60 -0
  84. package/dist/pi/cliTurnMetering.d.ts.map +1 -0
  85. package/dist/pi/cliTurnMetering.js +60 -0
  86. package/dist/pi/codexFilesystemRules.d.ts +3 -0
  87. package/dist/pi/codexFilesystemRules.d.ts.map +1 -0
  88. package/dist/pi/codexFilesystemRules.js +28 -0
  89. package/dist/pi/codexHeadlessResult.d.ts +68 -0
  90. package/dist/pi/codexHeadlessResult.d.ts.map +1 -0
  91. package/dist/pi/codexHeadlessResult.js +122 -0
  92. package/dist/pi/codexRolloutUsage.d.ts +95 -0
  93. package/dist/pi/codexRolloutUsage.d.ts.map +1 -0
  94. package/dist/pi/codexRolloutUsage.js +221 -0
  95. package/dist/pi/engineWakeLimits.d.ts +39 -0
  96. package/dist/pi/engineWakeLimits.d.ts.map +1 -0
  97. package/dist/pi/engineWakeLimits.js +55 -0
  98. package/dist/pi/grokHeadlessResult.d.ts +36 -0
  99. package/dist/pi/grokHeadlessResult.d.ts.map +1 -0
  100. package/dist/pi/grokHeadlessResult.js +118 -0
  101. package/dist/pi/grokHomeMcpRegistration.d.ts +21 -0
  102. package/dist/pi/grokHomeMcpRegistration.d.ts.map +1 -0
  103. package/dist/pi/grokHomeMcpRegistration.js +57 -0
  104. package/dist/pi/grokSandbox.d.ts +11 -0
  105. package/dist/pi/grokSandbox.d.ts.map +1 -0
  106. package/dist/pi/grokSandbox.js +216 -0
  107. package/dist/pi/grokStreamUsage.d.ts +31 -0
  108. package/dist/pi/grokStreamUsage.d.ts.map +1 -0
  109. package/dist/pi/grokStreamUsage.js +51 -0
  110. package/dist/pi/index.d.ts +5 -0
  111. package/dist/pi/index.d.ts.map +1 -1
  112. package/dist/pi/index.js +5 -0
  113. package/dist/pi/memoryTools.d.ts +55 -1
  114. package/dist/pi/memoryTools.d.ts.map +1 -1
  115. package/dist/pi/memoryTools.js +144 -24
  116. package/dist/pi/modelRegistry.d.ts +13 -0
  117. package/dist/pi/modelRegistry.d.ts.map +1 -0
  118. package/dist/pi/modelRegistry.js +19 -0
  119. package/dist/pi/piAgentHandle.d.ts +46 -0
  120. package/dist/pi/piAgentHandle.d.ts.map +1 -0
  121. package/dist/pi/piAgentHandle.js +351 -0
  122. package/dist/pi/piAgentWakeSupport.d.ts +103 -0
  123. package/dist/pi/piAgentWakeSupport.d.ts.map +1 -0
  124. package/dist/pi/piAgentWakeSupport.js +151 -0
  125. package/dist/pi/piHarness.d.ts +40 -5
  126. package/dist/pi/piHarness.d.ts.map +1 -1
  127. package/dist/pi/piHarness.js +151 -256
  128. package/dist/pi/prompts.d.ts +10 -0
  129. package/dist/pi/prompts.d.ts.map +1 -0
  130. package/dist/pi/prompts.js +63 -0
  131. package/dist/pi/rawTrainingCapture.d.ts +59 -0
  132. package/dist/pi/rawTrainingCapture.d.ts.map +1 -0
  133. package/dist/pi/rawTrainingCapture.js +175 -0
  134. package/dist/pi/turnCausal.d.ts +73 -0
  135. package/dist/pi/turnCausal.d.ts.map +1 -0
  136. package/dist/pi/turnCausal.js +75 -0
  137. package/dist/pi/turnTrace.d.ts +128 -0
  138. package/dist/pi/turnTrace.d.ts.map +1 -0
  139. package/dist/pi/turnTrace.js +138 -0
  140. package/dist/pi/wakeAcceptance.d.ts +49 -0
  141. package/dist/pi/wakeAcceptance.d.ts.map +1 -0
  142. package/dist/pi/wakeAcceptance.js +281 -0
  143. package/dist/pi/wakeAcceptanceFs.d.ts +44 -0
  144. package/dist/pi/wakeAcceptanceFs.d.ts.map +1 -0
  145. package/dist/pi/wakeAcceptanceFs.js +318 -0
  146. package/dist/pi/wakeAcceptanceSchema.d.ts +75 -0
  147. package/dist/pi/wakeAcceptanceSchema.d.ts.map +1 -0
  148. package/dist/pi/wakeAcceptanceSchema.js +265 -0
  149. package/dist/pi/wakeModes.d.ts +9 -0
  150. package/dist/pi/wakeModes.d.ts.map +1 -0
  151. package/dist/pi/wakeModes.js +19 -0
  152. package/dist/pi/worldNudge.d.ts +22 -0
  153. package/dist/pi/worldNudge.d.ts.map +1 -0
  154. package/dist/pi/worldNudge.js +62 -0
  155. package/dist/pi/worldToolProtocol.d.ts +13 -0
  156. package/dist/pi/worldToolProtocol.d.ts.map +1 -0
  157. package/dist/pi/worldToolProtocol.js +49 -0
  158. package/dist/pi/worldTools.d.ts +32 -0
  159. package/dist/pi/worldTools.d.ts.map +1 -0
  160. package/dist/pi/worldTools.js +373 -0
  161. package/dist/pi/worldTrajectory.d.ts +52 -0
  162. package/dist/pi/worldTrajectory.d.ts.map +1 -0
  163. package/dist/pi/worldTrajectory.js +131 -0
  164. package/dist/runtime/agySubscriptionBootstrap.d.ts +16 -0
  165. package/dist/runtime/agySubscriptionBootstrap.d.ts.map +1 -0
  166. package/dist/runtime/agySubscriptionBootstrap.js +80 -0
  167. package/dist/runtime/agySubscriptionRealm.d.ts +38 -0
  168. package/dist/runtime/agySubscriptionRealm.d.ts.map +1 -0
  169. package/dist/runtime/agySubscriptionRealm.js +242 -0
  170. package/dist/runtime/attention.d.ts +21 -0
  171. package/dist/runtime/attention.d.ts.map +1 -0
  172. package/dist/runtime/attention.js +36 -0
  173. package/dist/runtime/attentionDispatcher.d.ts +66 -0
  174. package/dist/runtime/attentionDispatcher.d.ts.map +1 -0
  175. package/dist/runtime/attentionDispatcher.js +271 -0
  176. package/dist/runtime/cli.d.ts +7 -0
  177. package/dist/runtime/cli.d.ts.map +1 -0
  178. package/dist/runtime/cli.js +251 -0
  179. package/dist/runtime/codexSandboxProjection.d.ts +17 -0
  180. package/dist/runtime/codexSandboxProjection.d.ts.map +1 -0
  181. package/dist/runtime/codexSandboxProjection.js +40 -0
  182. package/dist/runtime/contract-manifest.json +1 -0
  183. package/dist/runtime/contract-manifest.sha256 +1 -0
  184. package/dist/runtime/contractManifest.d.ts +8 -0
  185. package/dist/runtime/contractManifest.d.ts.map +1 -0
  186. package/dist/runtime/contractManifest.js +4 -0
  187. package/dist/runtime/engineBrokerCapabilities.d.ts +30 -0
  188. package/dist/runtime/engineBrokerCapabilities.d.ts.map +1 -0
  189. package/dist/runtime/engineBrokerCapabilities.js +59 -0
  190. package/dist/runtime/engineBrokerControlClient.d.ts +44 -0
  191. package/dist/runtime/engineBrokerControlClient.d.ts.map +1 -0
  192. package/dist/runtime/engineBrokerControlClient.js +132 -0
  193. package/dist/runtime/engineBrokerCredentialJournal.d.ts +10 -0
  194. package/dist/runtime/engineBrokerCredentialJournal.d.ts.map +1 -0
  195. package/dist/runtime/engineBrokerCredentialJournal.js +17 -0
  196. package/dist/runtime/engineBrokerInferenceProtocol.d.ts +52 -0
  197. package/dist/runtime/engineBrokerInferenceProtocol.d.ts.map +1 -0
  198. package/dist/runtime/engineBrokerInferenceProtocol.js +65 -0
  199. package/dist/runtime/engineBrokerMcpCallLog.d.ts +160 -0
  200. package/dist/runtime/engineBrokerMcpCallLog.d.ts.map +1 -0
  201. package/dist/runtime/engineBrokerMcpCallLog.js +219 -0
  202. package/dist/runtime/engineBrokerMcpFacade.d.ts +56 -0
  203. package/dist/runtime/engineBrokerMcpFacade.d.ts.map +1 -0
  204. package/dist/runtime/engineBrokerMcpFacade.js +343 -0
  205. package/dist/runtime/engineBrokerNativeClient.d.ts +52 -0
  206. package/dist/runtime/engineBrokerNativeClient.d.ts.map +1 -0
  207. package/dist/runtime/engineBrokerNativeClient.js +151 -0
  208. package/dist/runtime/engineBrokerProtocol.d.ts +135 -0
  209. package/dist/runtime/engineBrokerProtocol.d.ts.map +1 -0
  210. package/dist/runtime/engineBrokerProtocol.js +274 -0
  211. package/dist/runtime/engineBrokerSealLedger.d.ts +70 -0
  212. package/dist/runtime/engineBrokerSealLedger.d.ts.map +1 -0
  213. package/dist/runtime/engineBrokerSealLedger.js +123 -0
  214. package/dist/runtime/engineBrokerService.d.ts +37 -0
  215. package/dist/runtime/engineBrokerService.d.ts.map +1 -0
  216. package/dist/runtime/engineBrokerService.js +138 -0
  217. package/dist/runtime/engineBrokerServiceCli.d.ts +5 -0
  218. package/dist/runtime/engineBrokerServiceCli.d.ts.map +1 -0
  219. package/dist/runtime/engineBrokerServiceCli.js +32 -0
  220. package/dist/runtime/engineBrokerServiceConfig.d.ts +50 -0
  221. package/dist/runtime/engineBrokerServiceConfig.d.ts.map +1 -0
  222. package/dist/runtime/engineBrokerServiceConfig.js +92 -0
  223. package/dist/runtime/engineBrokerSingleflight.d.ts +13 -0
  224. package/dist/runtime/engineBrokerSingleflight.d.ts.map +1 -0
  225. package/dist/runtime/engineBrokerSingleflight.js +24 -0
  226. package/dist/runtime/engineBrokerTurnAccounting.d.ts +76 -0
  227. package/dist/runtime/engineBrokerTurnAccounting.d.ts.map +1 -0
  228. package/dist/runtime/engineBrokerTurnAccounting.js +108 -0
  229. package/dist/runtime/engineBrokerTurnRegistry.d.ts +57 -0
  230. package/dist/runtime/engineBrokerTurnRegistry.d.ts.map +1 -0
  231. package/dist/runtime/engineBrokerTurnRegistry.js +158 -0
  232. package/dist/runtime/engineDispatcher.d.ts +36 -0
  233. package/dist/runtime/engineDispatcher.d.ts.map +1 -0
  234. package/dist/runtime/engineDispatcher.js +216 -0
  235. package/dist/runtime/engineReadiness.d.ts +23 -0
  236. package/dist/runtime/engineReadiness.d.ts.map +1 -0
  237. package/dist/runtime/engineReadiness.js +222 -0
  238. package/dist/runtime/grokAuthenticationError.d.ts +8 -0
  239. package/dist/runtime/grokAuthenticationError.d.ts.map +1 -0
  240. package/dist/runtime/grokAuthenticationError.js +20 -0
  241. package/dist/runtime/grokBrokerCredentialAuthority.d.ts +22 -0
  242. package/dist/runtime/grokBrokerCredentialAuthority.d.ts.map +1 -0
  243. package/dist/runtime/grokBrokerCredentialAuthority.js +124 -0
  244. package/dist/runtime/grokBrokerCredentialReader.d.ts +5 -0
  245. package/dist/runtime/grokBrokerCredentialReader.d.ts.map +1 -0
  246. package/dist/runtime/grokBrokerCredentialReader.js +37 -0
  247. package/dist/runtime/grokBrokerModelPolicy.d.ts +23 -0
  248. package/dist/runtime/grokBrokerModelPolicy.d.ts.map +1 -0
  249. package/dist/runtime/grokBrokerModelPolicy.js +28 -0
  250. package/dist/runtime/grokBrokerProjection.d.ts +106 -0
  251. package/dist/runtime/grokBrokerProjection.d.ts.map +1 -0
  252. package/dist/runtime/grokBrokerProjection.js +94 -0
  253. package/dist/runtime/grokBrokerProxy.d.ts +55 -0
  254. package/dist/runtime/grokBrokerProxy.d.ts.map +1 -0
  255. package/dist/runtime/grokBrokerProxy.js +262 -0
  256. package/dist/runtime/grokBrokerProxyRequest.d.ts +30 -0
  257. package/dist/runtime/grokBrokerProxyRequest.d.ts.map +1 -0
  258. package/dist/runtime/grokBrokerProxyRequest.js +74 -0
  259. package/dist/runtime/grokBrokerRealmLease.d.ts +4 -0
  260. package/dist/runtime/grokBrokerRealmLease.d.ts.map +1 -0
  261. package/dist/runtime/grokBrokerRealmLease.js +33 -0
  262. package/dist/runtime/grokBrokerRefresh.d.ts +2 -0
  263. package/dist/runtime/grokBrokerRefresh.d.ts.map +1 -0
  264. package/dist/runtime/grokBrokerRefresh.js +15 -0
  265. package/dist/runtime/grokBrokerTurnMeter.d.ts +128 -0
  266. package/dist/runtime/grokBrokerTurnMeter.d.ts.map +1 -0
  267. package/dist/runtime/grokBrokerTurnMeter.js +251 -0
  268. package/dist/runtime/grokBrokerWorkerConfig.d.ts +86 -0
  269. package/dist/runtime/grokBrokerWorkerConfig.d.ts.map +1 -0
  270. package/dist/runtime/grokBrokerWorkerConfig.js +135 -0
  271. package/dist/runtime/grokEngineBroker.d.ts +48 -0
  272. package/dist/runtime/grokEngineBroker.d.ts.map +1 -0
  273. package/dist/runtime/grokEngineBroker.js +114 -0
  274. package/dist/runtime/grokEngineBrokerLedger.d.ts +52 -0
  275. package/dist/runtime/grokEngineBrokerLedger.d.ts.map +1 -0
  276. package/dist/runtime/grokEngineBrokerLedger.js +114 -0
  277. package/dist/runtime/grokEngineBrokerMetering.d.ts +51 -0
  278. package/dist/runtime/grokEngineBrokerMetering.d.ts.map +1 -0
  279. package/dist/runtime/grokEngineBrokerMetering.js +34 -0
  280. package/dist/runtime/grokEngineBrokerTurn.d.ts +58 -0
  281. package/dist/runtime/grokEngineBrokerTurn.d.ts.map +1 -0
  282. package/dist/runtime/grokEngineBrokerTurn.js +165 -0
  283. package/dist/runtime/grokInferenceClientConfig.d.ts +41 -0
  284. package/dist/runtime/grokInferenceClientConfig.d.ts.map +1 -0
  285. package/dist/runtime/grokInferenceClientConfig.js +62 -0
  286. package/dist/runtime/grokInferenceGrants.d.ts +77 -0
  287. package/dist/runtime/grokInferenceGrants.d.ts.map +1 -0
  288. package/dist/runtime/grokInferenceGrants.js +116 -0
  289. package/dist/runtime/grokInferenceProxy.d.ts +29 -0
  290. package/dist/runtime/grokInferenceProxy.d.ts.map +1 -0
  291. package/dist/runtime/grokInferenceProxy.js +82 -0
  292. package/dist/runtime/grokInferenceProxyRequest.d.ts +23 -0
  293. package/dist/runtime/grokInferenceProxyRequest.d.ts.map +1 -0
  294. package/dist/runtime/grokInferenceProxyRequest.js +63 -0
  295. package/dist/runtime/grokSlotPreflightReceipt.d.ts +70 -0
  296. package/dist/runtime/grokSlotPreflightReceipt.d.ts.map +1 -0
  297. package/dist/runtime/grokSlotPreflightReceipt.js +101 -0
  298. package/dist/runtime/grokSubscriptionRealm.d.ts +4 -0
  299. package/dist/runtime/grokSubscriptionRealm.d.ts.map +1 -0
  300. package/dist/runtime/grokSubscriptionRealm.js +435 -0
  301. package/dist/runtime/grokSubscriptionRealmTypes.d.ts +26 -0
  302. package/dist/runtime/grokSubscriptionRealmTypes.d.ts.map +1 -0
  303. package/dist/runtime/grokSubscriptionRealmTypes.js +1 -0
  304. package/dist/runtime/grokWorkerAttestation.d.ts +170 -0
  305. package/dist/runtime/grokWorkerAttestation.d.ts.map +1 -0
  306. package/dist/runtime/grokWorkerAttestation.js +266 -0
  307. package/dist/runtime/grokWorkerDenyPlacement.d.ts +80 -0
  308. package/dist/runtime/grokWorkerDenyPlacement.d.ts.map +1 -0
  309. package/dist/runtime/grokWorkerDenyPlacement.js +128 -0
  310. package/dist/runtime/grokWorkerHomeAttestation.d.ts +30 -0
  311. package/dist/runtime/grokWorkerHomeAttestation.d.ts.map +1 -0
  312. package/dist/runtime/grokWorkerHomeAttestation.js +69 -0
  313. package/dist/runtime/grokWorkerSandboxProfile.d.ts +27 -0
  314. package/dist/runtime/grokWorkerSandboxProfile.d.ts.map +1 -0
  315. package/dist/runtime/grokWorkerSandboxProfile.js +44 -0
  316. package/dist/runtime/grokWorkerTmpAttestation.d.ts +55 -0
  317. package/dist/runtime/grokWorkerTmpAttestation.d.ts.map +1 -0
  318. package/dist/runtime/grokWorkerTmpAttestation.js +63 -0
  319. package/dist/runtime/index.d.ts +26 -0
  320. package/dist/runtime/index.d.ts.map +1 -0
  321. package/dist/runtime/index.js +23 -0
  322. package/dist/runtime/inferenceUsageLedger.d.ts +38 -0
  323. package/dist/runtime/inferenceUsageLedger.d.ts.map +1 -0
  324. package/dist/runtime/inferenceUsageLedger.js +53 -0
  325. package/dist/runtime/mcpToolResult.d.ts +127 -0
  326. package/dist/runtime/mcpToolResult.d.ts.map +1 -0
  327. package/dist/runtime/mcpToolResult.js +214 -0
  328. package/dist/runtime/moltnetMachineRead.d.ts +97 -0
  329. package/dist/runtime/moltnetMachineRead.d.ts.map +1 -0
  330. package/dist/runtime/moltnetMachineRead.js +183 -0
  331. package/dist/runtime/native/daimon-engine-broker +0 -0
  332. package/dist/runtime/organizationRuntime.d.ts +165 -0
  333. package/dist/runtime/organizationRuntime.d.ts.map +1 -0
  334. package/dist/runtime/organizationRuntime.js +3 -0
  335. package/dist/runtime/organizationRuntimeControl.d.ts +42 -0
  336. package/dist/runtime/organizationRuntimeControl.d.ts.map +1 -0
  337. package/dist/runtime/organizationRuntimeControl.js +235 -0
  338. package/dist/runtime/organizationRuntimeHost.d.ts +19 -0
  339. package/dist/runtime/organizationRuntimeHost.d.ts.map +1 -0
  340. package/dist/runtime/organizationRuntimeHost.js +359 -0
  341. package/dist/runtime/organizationRuntimeParsing.d.ts +6 -0
  342. package/dist/runtime/organizationRuntimeParsing.d.ts.map +1 -0
  343. package/dist/runtime/organizationRuntimeParsing.js +370 -0
  344. package/dist/runtime/organizationRuntimeReadiness.d.ts +12 -0
  345. package/dist/runtime/organizationRuntimeReadiness.d.ts.map +1 -0
  346. package/dist/runtime/organizationRuntimeReadiness.js +59 -0
  347. package/dist/runtime/physicalReadiness.d.ts +47 -0
  348. package/dist/runtime/physicalReadiness.d.ts.map +1 -0
  349. package/dist/runtime/physicalReadiness.js +142 -0
  350. package/dist/runtime/portableCredentialAuth.d.ts +6 -0
  351. package/dist/runtime/portableCredentialAuth.d.ts.map +1 -0
  352. package/dist/runtime/portableCredentialAuth.js +70 -0
  353. package/dist/runtime/portableCredentialMaterial.d.ts +8 -0
  354. package/dist/runtime/portableCredentialMaterial.d.ts.map +1 -0
  355. package/dist/runtime/portableCredentialMaterial.js +169 -0
  356. package/dist/runtime/productionAgentTools.d.ts +5 -0
  357. package/dist/runtime/productionAgentTools.d.ts.map +1 -0
  358. package/dist/runtime/productionAgentTools.js +328 -0
  359. package/dist/runtime/runtimeHomeLayout.d.ts +48 -0
  360. package/dist/runtime/runtimeHomeLayout.d.ts.map +1 -0
  361. package/dist/runtime/runtimeHomeLayout.js +84 -0
  362. package/dist/runtime/schedule.d.ts +40 -0
  363. package/dist/runtime/schedule.d.ts.map +1 -0
  364. package/dist/runtime/schedule.js +371 -0
  365. package/dist/runtime/storeCoordination.d.ts +23 -0
  366. package/dist/runtime/storeCoordination.d.ts.map +1 -0
  367. package/dist/runtime/storeCoordination.js +94 -0
  368. package/dist/runtime/toolResultSpill.d.ts +152 -0
  369. package/dist/runtime/toolResultSpill.d.ts.map +1 -0
  370. package/dist/runtime/toolResultSpill.js +351 -0
  371. package/dist/runtime/turnRequestLedger.d.ts +160 -0
  372. package/dist/runtime/turnRequestLedger.d.ts.map +1 -0
  373. package/dist/runtime/turnRequestLedger.js +249 -0
  374. package/dist/runtime/turnUsageLedger.d.ts +143 -0
  375. package/dist/runtime/turnUsageLedger.d.ts.map +1 -0
  376. package/dist/runtime/turnUsageLedger.js +203 -0
  377. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts +17 -0
  378. package/dist/runtime/wakeAcceptanceProcessIdentity.d.ts.map +1 -0
  379. package/dist/runtime/wakeAcceptanceProcessIdentity.js +50 -0
  380. package/dist/runtime/wakeAcceptanceReconciliation.d.ts +211 -0
  381. package/dist/runtime/wakeAcceptanceReconciliation.d.ts.map +1 -0
  382. package/dist/runtime/wakeAcceptanceReconciliation.js +289 -0
  383. package/dist/runtime/wakeAcceptanceRecord.d.ts +23 -0
  384. package/dist/runtime/wakeAcceptanceRecord.d.ts.map +1 -0
  385. package/dist/runtime/wakeAcceptanceRecord.js +56 -0
  386. package/dist/runtime/wakeAcceptanceRetention.d.ts +12 -0
  387. package/dist/runtime/wakeAcceptanceRetention.d.ts.map +1 -0
  388. package/dist/runtime/wakeAcceptanceRetention.js +12 -0
  389. package/dist/runtime/wakeAcceptanceStore.d.ts +113 -0
  390. package/dist/runtime/wakeAcceptanceStore.d.ts.map +1 -0
  391. package/dist/runtime/wakeAcceptanceStore.js +558 -0
  392. package/dist/runtime/wakeAcceptanceTypes.d.ts +179 -0
  393. package/dist/runtime/wakeAcceptanceTypes.d.ts.map +1 -0
  394. package/dist/runtime/wakeAcceptanceTypes.js +95 -0
  395. package/dist/runtime/wakeFuse.d.ts +69 -0
  396. package/dist/runtime/wakeFuse.d.ts.map +1 -0
  397. package/dist/runtime/wakeFuse.js +367 -0
  398. package/package.json +25 -17
  399. package/dist/examples/mixed-engine-org.d.ts +0 -2
  400. package/dist/examples/mixed-engine-org.d.ts.map +0 -1
  401. package/dist/examples/mixed-engine-org.js +0 -351
  402. package/dist/examples/mixedEngineCli.d.ts +0 -15
  403. package/dist/examples/mixedEngineCli.d.ts.map +0 -1
  404. package/dist/examples/mixedEngineCli.js +0 -174
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeContractManifest.d.ts","sourceRoot":"","sources":["../../src/contracts/runtimeContractManifest.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,iCAAiC,EAAG,8CAAuD,CAAC;AACzG,eAAO,MAAM,wCAAwC,EAAG,kDAA2D,CAAC;AACpH,eAAO,MAAM,0BAA0B;;;;;;;;CAE7B,CAAC;AACX,eAAO,MAAM,uBAAuB;;;;;;;;CAQ1B,CAAC;AACX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoHrB,CAAC;AACX,eAAO,MAAM,sBAAsB;;;;;;;CAOzB,CAAC;AASX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC5B,CAAC"}
@@ -0,0 +1,181 @@
1
+ import { WORK_AVAILABILITY_SCHEMA, WORK_BLOCKED_SCHEMA } from "./attentionContract.js";
2
+ import { GROK_BROKER_MODELS, GROK_BROKER_REASONING_EFFORTS, GROK_WORKER_MAX_TURNS, GROK_WORKER_TOOL_IDS, GROK_WORKER_VISIBLE_TOOLS } from "./grokWorkerContract.js";
3
+ import { ORGANIZATION_RUNTIME_CONFIG_SCHEMA, ORGANIZATION_RUNTIME_CONFIG_V2_SCHEMA, ORGANIZATION_RUNTIME_MAX_AGENTS, ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS } from "./organizationRuntimeContract.js";
4
+ export const RUNTIME_CONTRACT_MANIFEST_VERSION = "noopolis.daimon.runtime-contract-manifest.v3";
5
+ export const ORGANIZATION_RUNTIME_ACTIVITY_V2_VERSION = "noopolis.daimon.organization-runtime-activity.v2";
6
+ export const ENGINE_CREDENTIAL_MATERIAL = {
7
+ codex: { sourceSlot: "codex-auth", sourceRelativePath: ".daimon-inbound/codex-auth", destinationRelativePath: ".codex/auth.json", directoryMode: 0o700, fileMode: 0o600 }
8
+ };
9
+ export const GROK_SUBSCRIPTION_REALM = {
10
+ agentCredentialRelativePath: ".grok/auth.json",
11
+ bootstrapMountPath: "/var/lib/spawnfile/daimon/grok-bootstrap-auth",
12
+ bootstrapSourceSlot: "grok-auth",
13
+ directoryMode: 0o700,
14
+ durableMountPath: "/var/lib/spawnfile/daimon/grok-subscription-realm",
15
+ fileMode: 0o600,
16
+ maxCredentialBytes: 64 * 1024
17
+ };
18
+ export const GROK_ENGINE_BROKER = {
19
+ nativeAbiVersion: 2,
20
+ nativeExecutablePath: "/opt/daimon/bin/daimon-engine-broker",
21
+ grokExecutablePath: "/usr/local/bin/grok",
22
+ registrationPath: "/etc/daimon-engine-broker/registrations.bin",
23
+ credentialHomePath: "/var/lib/spawnfile/daimon/grok-subscription-realm",
24
+ turnStorePath: "/var/lib/spawnfile/daimon/grok-subscription-realm/turns",
25
+ controlSocketPath: "/run/daimon-engine-broker/control.sock",
26
+ backendSocketPath: "/run/daimon-engine-broker/backend.sock",
27
+ launcherSocketPath: "/run/daimon-engine-broker/launcher.sock",
28
+ serviceConfigPath: "/etc/daimon-engine-broker/service.json",
29
+ providerProxy: { host: "127.0.0.1", port: 43_123 },
30
+ mcpFacade: { host: "127.0.0.1", port: 43_124, path: "/mcp" },
31
+ identities: { organizationUid: 2_000, brokerUid: 2_100, firstWorkerUid: 2_200 },
32
+ grokCliVersion: "1.0.34",
33
+ grokCliBuild: "3736acbc8658",
34
+ grokCliArtifacts: {
35
+ arm64: { url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-aarch64", sha256: "39ab87666877d64ef3a40aa60fbe0c3b6a6acd7001b78fe60e2c76bb6cfc4a94", bytes: 136_090_504 },
36
+ x64: { url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-x86_64", sha256: "be5905e107d2b8b5f3c142d21ecfe4c8fd32a913d2fd551b788707930c4dc80d", bytes: 163_035_648 }
37
+ },
38
+ worker: {
39
+ modelId: "daimon-broker-grok",
40
+ models: GROK_BROKER_MODELS,
41
+ reasoningEfforts: GROK_BROKER_REASONING_EFFORTS,
42
+ defaultModel: "grok-4.6",
43
+ defaultReasoningEffort: "low",
44
+ toolIds: GROK_WORKER_TOOL_IDS,
45
+ visibleTools: GROK_WORKER_VISIBLE_TOOLS,
46
+ maxTurns: GROK_WORKER_MAX_TURNS,
47
+ systemPromptSha256: "2c31c0085a54a4efbf9c0cf0b8124c56e47f38691b7f0c7fa233a74abaa8ddf8",
48
+ // sha256 of `renderGrokBrokerWorkerConfig({ model, reasoningEffort })`, the only accepted config.toml bytes.
49
+ configSha256: {
50
+ "grok-4.6": { low: "ab58499ac32678097c146479896f2b8a8e2b0e39aea22dc0a60b6227e370538e", medium: "df1a5cc84346e7f6bf6090492fbd19faaefb42953e3bb2e8c6cbc0572242403f", high: "65b0212564fb74042b1503d293fb8d3620276033264c0efade2a539ca09218e3" },
51
+ "grok-4.5": { low: "8247127c3625ff7c5d8d527a53596b89ec6557a821ac46cfd00bd122b90daff6", medium: "59288cee61297bb8c002097061a48f77b09d310754187a253ee089f7172a9155", high: "c63c3387ce92d94ec3f690abfe98942afcd7c9e17ff84816bbe751f340ab251f" },
52
+ "grok-build": { low: "fb343f2809903f26d21681470943235031f946e99085542fd89555eb7782cbb5", medium: "8a587ef75c90eab70d19b24583e60051d6fba9d90c558839fdbb15588b4cc656", high: "a23724e00d670caee185ba7690d2daa868173e53905cf446f5329666f01ab4e3" }
53
+ },
54
+ // Worker `GROK_HOME` layout the broker attests before every turn. The home and
55
+ // its `sessions/` directory are root-owned, worker-group writable and sticky so
56
+ // Grok can create its own state but never replace a root-owned file.
57
+ home: {
58
+ directory: { uid: 0, group: "worker", mode: 0o1771 },
59
+ sessionsDirectory: { relativePath: "sessions", uid: 0, group: "worker", mode: 0o1771 },
60
+ readOnlyFiles: { names: ["config.toml", "managed_config.toml", "requirements.toml", "sandbox.toml", "trusted_folders.toml"], uid: 0, gid: 0, mode: 0o444 },
61
+ sandboxEvents: { relativePath: "sessions/sandbox-events.jsonl", owner: "worker", group: "broker", mode: 0o640 },
62
+ // The launcher exports TMPDIR=<worker home>/tmp; Grok's strict profile grants TMPDIR read-write.
63
+ privateTmp: { relativeToWorkerHome: "tmp", owner: "worker", mode: 0o700 },
64
+ // Strict also grants shared /tmp and /var/tmp read-write and refuses to start if either is
65
+ // denied, so the deployment keeps them from every worker by mode: root-owned, a non-worker
66
+ // group (< 2200), others read-only (Grok needs to open the directory) and no search/write.
67
+ sharedTmp: { paths: ["/tmp", "/var/tmp"], uid: 0, maxGroupExclusive: 2_200, otherMode: 0o4, mode: 0o1774 },
68
+ // The organization runtime home of a brokered Grok agent: traverse-only for the
69
+ // worker group so the worker can reach `tool-output/` and nothing else (no group
70
+ // read, no group write, no world bits; `physicalReadiness.ts` refuses anything else).
71
+ organizationRuntimeHome: { owner: "organization", group: "worker", mode: 0o710 },
72
+ // Spilled tool output the worker reads with read_file: setgid directory in the worker's group,
73
+ // files written 0640 by the runtime, never other-readable.
74
+ spillDirectory: { relativeToRuntimeHome: "tool-output", owner: "organization", group: "worker", mode: 0o2750, fileMode: 0o640 }
75
+ }
76
+ },
77
+ bounds: { promptBytes: 65_536, capabilityBytes: 4_096, capabilityBundleBytes: 8_196, outputBytes: 262_144 },
78
+ // Accounting and limits (P2). The broker is the single sealed usage writer.
79
+ controlProtocolVersion: "noopolis.daimon.engine-broker.v2",
80
+ turnRecordVersions: ["noopolis.daimon.engine-broker-turn.v1", "noopolis.daimon.engine-broker-turn.v2"],
81
+ serviceConfigVersions: ["noopolis.daimon.engine-broker-service.v1", "noopolis.daimon.engine-broker-service.v2"],
82
+ turnLimits: {
83
+ keys: ["maxRequests", "maxTokens", "timeoutMs"],
84
+ v1Defaults: { maxRequests: 32, maxTokens: 300_000, timeoutMs: 240_000 },
85
+ bounds: { maxRequests: [1, GROK_WORKER_MAX_TURNS], maxTokens: [1, 10_000_000], timeoutMs: [1_000, 3_600_000] },
86
+ limitReasons: ["tokens", "requests", "timeout", "none"],
87
+ wakeMayOnlyLower: true,
88
+ tokenCeilingOvershoot: "at-most-one-request",
89
+ maxInFlightRequests: 1,
90
+ // A per-request usage block above this is implausible (beyond the model
91
+ // context window) and treated as invalid rather than added to any total.
92
+ requestUsageMaxTokens: 500_000,
93
+ // A request whose response carries no valid usage is charged this estimate.
94
+ missingUsageEstimate: { inputBytesPerToken: 2, outputTokens: 4_096 }
95
+ },
96
+ wakeLimitEnvironment: { timeoutMs: "DAIMON_ENGINE_WAKE_TIMEOUT_MS", maxTokens: "DAIMON_ENGINE_WAKE_TOKEN_CEILING" },
97
+ // Evaluator inference grants (P2c). Judges and the optimizer (organization uid
98
+ // only, over the control socket) borrow the broker's Grok credential through
99
+ // the provider proxy; they never hold it, and their spend never reaches the
100
+ // subject usage ledger or wake fuse.
101
+ inferenceGrants: {
102
+ requestKinds: ["request_inference_grant", "release_inference_grant"],
103
+ purposes: ["judge", "optimizer"],
104
+ tokenPrefix: "inference_",
105
+ ttlMs: 600_000,
106
+ limits: { maxRequests: 64, maxTokens: 2_000_000 },
107
+ maxLiveGrants: 8,
108
+ maxInFlightRequestsPerGrant: 1,
109
+ // Top-level request members Grok 1.0.34 sends for a Paideia judge/optimizer call
110
+ // (live stub capture); `tools` and `tool_choice` are refused outright.
111
+ bodyMembers: ["messages", "model", "reasoning_effort", "response_format", "stream", "stream_options"],
112
+ messageRoles: ["system", "user", "assistant"],
113
+ failureCodes: ["auth_stale", "grant_limit", "invalid_request", "unavailable"],
114
+ ledgerVersion: "noopolis.daimon.inference-usage.v1",
115
+ ledgerDedupeKey: ["grant", "request"],
116
+ client: {
117
+ modelId: "daimon-inference-grok",
118
+ envKey: "DAIMON_INFERENCE_GRANT",
119
+ // sha256 of `renderGrokInferenceClientConfig` for the production proxy base URL and this env key.
120
+ configSha256: {
121
+ "grok-4.6": { low: "79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f", medium: "6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8", high: "5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac" },
122
+ "grok-4.5": { low: "a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74", medium: "1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9", high: "ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2" },
123
+ "grok-build": { low: "ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1", medium: "01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d", high: "98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c" }
124
+ }
125
+ }
126
+ },
127
+ projectionVersion: "noopolis.daimon.grok-broker-projection.v1",
128
+ slotPreflightVersion: "noopolis.daimon.grok-slot-preflight.v2",
129
+ artifacts: {
130
+ sourceSha256: "dd39aacfece496cc6528f6acdb4f1066a848a0fb5b0961f5c70b0ba00440dc24",
131
+ x64Sha256: "67e3624d3198e9c59e1ffafa4eca7c895dfe265d5b8bb0614cb547b68b8b93a7",
132
+ arm64Sha256: "c07d22225ff968bc289e5ddf0981cdd5d64040eee6e3ea45da7d03e1439dea98"
133
+ }
134
+ };
135
+ export const AGY_SUBSCRIPTION_REALM = {
136
+ durableMountPath: "/var/lib/spawnfile/daimon/agy-subscription-realm",
137
+ unlockMountPath: "/var/lib/spawnfile/daimon/agy-unlock-secret",
138
+ unlockSourceSlot: "agy-unlock-secret",
139
+ directoryMode: 0o700,
140
+ fileMode: 0o600,
141
+ maxUnlockBytes: 4_096
142
+ };
143
+ const text = { type: "string", minLength: 1, maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS, pattern: "\\S" };
144
+ const boundedText = { type: "string", maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS };
145
+ const timestamp = { type: "string", format: "date-time", pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$" };
146
+ const wakeEvent = { type: "object", additionalProperties: false, required: ["version", "id", "kind", "text", "occurredAt"], properties: { version: { const: "noopolis.daimon.wake.v1" }, id: text, kind: { enum: ["manual", "message", "schedule", "external"] }, text: boundedText, occurredAt: timestamp } };
147
+ const wakeResultBase = { version: { const: "noopolis.daimon.wake-result.v1" }, agentId: text, wakeId: text };
148
+ const activityItem = { type: "object", additionalProperties: false, required: ["id", "agentId", "kind", "occurredAt"], properties: { id: { type: "string", format: "uuid", pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" }, agentId: text, wakeId: text, kind: { enum: ["wake_started", "wake_completed", "wake_rejected", "wake_aborted", "agent_stopped"] }, occurredAt: timestamp } };
149
+ export const RUNTIME_CONTRACT_MANIFEST = {
150
+ version: RUNTIME_CONTRACT_MANIFEST_VERSION,
151
+ consumedConfigFields: ["version", "host.bindHost", "host.port", "host.controlTokenEnv", "agents[].id", "agents[].name", "agents[].instructions", "agents[].workspacePath", "agents[].runtimeHomePath", "agents[].engine.kind", "agents[].engine.model", "agents[].engine.reasoningEffort", "agents[].engine.codexSandbox", "agents[].schedule.kind", "agents[].schedule.interval_ms", "agents[].schedule.cron", "agents[].schedule.timezone", "agents[].schedule.prompt", "agents[].schedule.jitter_seconds", "agents[].mcp", "agents[].moltnet", "agents[].memory", "agents[].attention"],
152
+ organizationRuntimeConfigSchema: ORGANIZATION_RUNTIME_CONFIG_SCHEMA,
153
+ organizationRuntimeConfigV2Schema: ORGANIZATION_RUNTIME_CONFIG_V2_SCHEMA,
154
+ wakeAcceptanceTypes: ["manual", "message", "schedule", "external"],
155
+ deliverySemantics: {
156
+ activeDeliveryIdempotency: "unbounded-until-terminal",
157
+ terminalReceiptHorizon: 2_048,
158
+ recovery: "at-least-once-with-stable-wake-id",
159
+ concurrentSameAgentTurns: false,
160
+ externalEffectsExactlyOnce: false
161
+ },
162
+ attention: { enabledBy: "agents[].attention", defaultMaxBatchMessages: 8, defaultMaxBatchBytes: 12000, idleDispatch: "immediate", busyDispatch: "bounded-pending-message-batch", completion: "explicit-per-delivery", unhandled: "deferred-until-new-input", accounting: "execution-start-reservations" },
163
+ workAvailabilityResponseSchema: WORK_AVAILABILITY_SCHEMA,
164
+ workBlockedSchema: WORK_BLOCKED_SCHEMA,
165
+ supportedEngineKinds: ["agy", "codex", "grok"],
166
+ engineCredentialMaterial: ENGINE_CREDENTIAL_MATERIAL,
167
+ grokSubscriptionRealm: GROK_SUBSCRIPTION_REALM,
168
+ grokEngineBroker: GROK_ENGINE_BROKER,
169
+ agySubscriptionRealm: AGY_SUBSCRIPTION_REALM,
170
+ wakeRequestSchema: { type: "object", additionalProperties: false, required: ["agentId", "event"], properties: { agentId: text, event: wakeEvent } },
171
+ wakeResultSchema: { oneOf: [
172
+ { type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "text", "durationMs"], properties: { ...wakeResultBase, status: { const: "completed" }, text: boundedText, durationMs: { type: "integer", minimum: 0 } } },
173
+ { type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { ...wakeResultBase, status: { const: "rejected" }, code: { enum: ["unauthorized", "unknown_agent", "queue_full", "durable_inbox_required"] } } },
174
+ { type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { version: { const: "noopolis.daimon.wake-result.v1" }, status: { const: "rejected" }, agentId: { type: "string", maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS }, wakeId: { type: "string", maxLength: ORGANIZATION_RUNTIME_MAX_STRING_CODEPOINTS }, code: { const: "invalid_request" } } },
175
+ { type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { ...wakeResultBase, status: { const: "stopped" }, code: { enum: ["host_stopping", "host_stopped", "queued_wake_stopped", "active_wake_aborted"] } } },
176
+ { type: "object", additionalProperties: false, required: ["version", "status", "agentId", "wakeId", "code"], properties: { ...wakeResultBase, status: { const: "failed" }, code: { const: "engine_failed" } } }
177
+ ] },
178
+ healthResponseSchema: { type: "object", additionalProperties: false, required: ["version", "state", "agents"], properties: { version: { const: "noopolis.daimon.organization-runtime-health.v1" }, state: { enum: ["starting", "running", "stopping", "stopped"] }, agents: { type: "array", maxItems: ORGANIZATION_RUNTIME_MAX_AGENTS, items: { type: "object", additionalProperties: false, required: ["agentId", "state"], properties: { agentId: text, state: { enum: ["starting", "running", "stopping", "stopped", "idle", "failed"] } } } } } },
179
+ activityResponseSchema: { type: "object", additionalProperties: false, required: ["version", "items"], properties: { version: { const: "noopolis.daimon.organization-runtime-activity.v1" }, items: { type: "array", maxItems: 100, items: activityItem }, nextCursor: { type: "string", minLength: 1, maxLength: 16, pattern: "^(0|[1-9][0-9]{0,15})$" } } },
180
+ activityV2ResponseSchema: { type: "object", additionalProperties: false, required: ["version", "items"], properties: { version: { const: ORGANIZATION_RUNTIME_ACTIVITY_V2_VERSION }, state: { enum: ["running", "stopped"] }, executions: { type: "array", maxItems: ORGANIZATION_RUNTIME_MAX_AGENTS, items: { type: "object", additionalProperties: false, required: ["agent_id", "execution_id", "state", "delivery_ids"], properties: { agent_id: text, execution_id: { type: "string" }, state: { const: "running" }, delivery_ids: { type: "array", maxItems: 32, items: text } } } }, items: { type: "array", maxItems: 2_112, items: { type: "object", additionalProperties: false, required: ["version", "acceptance_id", "agent_id", "delivery_id", "request_digest", "state", "accepted_at", "updated_at", "active"], properties: { version: { const: "noopolis.daimon.wake-receipt-status.v2" }, acceptance_id: { type: "string" }, agent_id: text, delivery_id: text, request_digest: { type: "string" }, state: { enum: ["accepted", "running", "completed", "failed", "stopped"] }, accepted_at: timestamp, updated_at: timestamp, active: { type: "boolean" }, execution_id: { type: "string" }, deferred: { type: "boolean" }, text: { type: "string", maxLength: 16384 }, queue_position: { type: "integer", minimum: 1 }, code: { enum: ["engine_failed", "host_stopped", "host_stopping", "queued_wake_stopped", "active_wake_aborted", "queue_full", "unknown_agent"] } } } } } }
181
+ };
@@ -0,0 +1,4 @@
1
+ /** Redacts provider credentials before text crosses any reply or diagnostic boundary. */
2
+ export declare function redactCredentialText(value: unknown, exactSecrets?: readonly string[], maxBytes?: number): string;
3
+ export declare function redactCredentialError(error: unknown, exactSecrets?: readonly string[], maxBytes?: number): Error;
4
+ //# sourceMappingURL=credentialRedaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentialRedaction.d.ts","sourceRoot":"","sources":["../../src/core/credentialRedaction.ts"],"names":[],"mappings":"AASA,yFAAyF;AACzF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAAS,MAAM,EAAO,EACpC,QAAQ,GAAE,MAA0B,GACnC,MAAM,CAoBR;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,GAAE,SAAS,MAAM,EAAO,EACpC,QAAQ,GAAE,MAA0B,GACnC,KAAK,CAEP"}
@@ -0,0 +1,28 @@
1
+ const DEFAULT_MAX_BYTES = 16_384;
2
+ const truncateUtf8 = (value, maxBytes) => {
3
+ if (Buffer.byteLength(value, "utf8") <= maxBytes)
4
+ return value;
5
+ let result = Buffer.from(value, "utf8").subarray(0, maxBytes).toString("utf8");
6
+ while (result.endsWith("\uFFFD"))
7
+ result = result.slice(0, -1);
8
+ return result;
9
+ };
10
+ /** Redacts provider credentials before text crosses any reply or diagnostic boundary. */
11
+ export function redactCredentialText(value, exactSecrets = [], maxBytes = DEFAULT_MAX_BYTES) {
12
+ let result = String(value);
13
+ for (const secret of [...new Set(exactSecrets.filter((entry) => entry.length > 0))]
14
+ .sort((left, right) => right.length - left.length)) {
15
+ result = result.split(secret).join("[REDACTED]");
16
+ }
17
+ result = result
18
+ .replace(/\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/giu, "Bearer [REDACTED]")
19
+ .replace(/\bmagt_v1_[A-Za-z0-9_-]{16,}\b/gu, "[REDACTED]")
20
+ .replace(/\b(?:sk|sk-proj|xai)-[A-Za-z0-9_-]{20,}\b/gu, "[REDACTED]")
21
+ .replace(/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/gu, "[REDACTED]")
22
+ .replace(/("(?:api[_-]?key|authorization|client[_-]?secret|credential|key|password|secret|(?:access|refresh|id)[_-]?token|token)"\s*:\s*")([^"\\]*(?:\\.[^"\\]*)*)(")/giu, "$1[REDACTED]$3")
23
+ .replace(/\b(api[_-]?key|authorization|client[_-]?secret|credential|password|secret|(?:access|refresh|id)[_-]?token|token)\b(\s*[:=]\s*)(["']?)[^\s"',&]{8,}\3/giu, "$1$2[REDACTED]");
24
+ return truncateUtf8(result, maxBytes);
25
+ }
26
+ export function redactCredentialError(error, exactSecrets = [], maxBytes = DEFAULT_MAX_BYTES) {
27
+ return new Error(redactCredentialText(error instanceof Error ? error.message : error, exactSecrets, maxBytes));
28
+ }
@@ -0,0 +1,21 @@
1
+ export type SiblingFileFact = {
2
+ path: string;
3
+ mtimeMs: number;
4
+ };
5
+ export type SiblingBuildFacts = {
6
+ packageName: string;
7
+ packageDirectory: string;
8
+ hasSourceDirectory: boolean;
9
+ sourceFiles: SiblingFileFact[];
10
+ outputFiles: SiblingFileFact[];
11
+ };
12
+ export type SiblingBuildFreshness = {
13
+ packageName: string;
14
+ linked: boolean;
15
+ sourcesScanned: number;
16
+ outputsScanned: number;
17
+ ok: boolean;
18
+ message?: string;
19
+ };
20
+ export declare function checkSiblingBuildFreshness(facts: SiblingBuildFacts): SiblingBuildFreshness;
21
+ //# sourceMappingURL=siblingBuildFreshness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"siblingBuildFreshness.d.ts","sourceRoot":"","sources":["../../src/core/siblingBuildFreshness.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,iBAAiB,GAAG,qBAAqB,CA2B1F"}
@@ -0,0 +1,25 @@
1
+ const excludedSource = /(?:\.test\.ts|\.test-helper\.ts|\.d\.ts)$/u;
2
+ export function checkSiblingBuildFreshness(facts) {
3
+ if (!facts.hasSourceDirectory) {
4
+ return { packageName: facts.packageName, linked: false, sourcesScanned: 0, outputsScanned: 0, ok: true };
5
+ }
6
+ const sourceFiles = facts.sourceFiles.filter(({ path }) => !excludedSource.test(path));
7
+ const outputFiles = facts.outputFiles.filter(({ path }) => path.endsWith(".js"));
8
+ const command = `run "npm run build" in ${facts.packageDirectory}`;
9
+ if (sourceFiles.length === 0) {
10
+ return failure(facts.packageName, sourceFiles.length, outputFiles.length, `linked package ${facts.packageName} scanned zero source files; ${command}`);
11
+ }
12
+ if (outputFiles.length === 0) {
13
+ return failure(facts.packageName, sourceFiles.length, outputFiles.length, `linked package ${facts.packageName} has no emitted JavaScript; ${command}`);
14
+ }
15
+ const newestSource = sourceFiles.reduce((newest, file) => file.mtimeMs > newest.mtimeMs ? file : newest);
16
+ const oldestOutput = outputFiles.reduce((oldest, file) => file.mtimeMs < oldest.mtimeMs ? file : oldest);
17
+ if (newestSource.mtimeMs > oldestOutput.mtimeMs) {
18
+ return failure(facts.packageName, sourceFiles.length, outputFiles.length, `linked package ${facts.packageName} is stale: newest source ${newestSource.path} (${newestSource.mtimeMs}) `
19
+ + `is newer than oldest output ${oldestOutput.path} (${oldestOutput.mtimeMs}); ${command}`);
20
+ }
21
+ return { packageName: facts.packageName, linked: true, sourcesScanned: sourceFiles.length, outputsScanned: outputFiles.length, ok: true };
22
+ }
23
+ function failure(packageName, sourcesScanned, outputsScanned, message) {
24
+ return { packageName, linked: true, sourcesScanned, outputsScanned, ok: false, message };
25
+ }
@@ -20,9 +20,15 @@ export interface HarnessModelSpec {
20
20
  name: string;
21
21
  provider: string;
22
22
  }
23
+ export interface WakeDeliveryMetadata {
24
+ eventId: string;
25
+ sender: string;
26
+ target: string;
27
+ contextId: string;
28
+ }
23
29
  export interface WakeEvent {
24
30
  id: string;
25
- kind: "manual" | "message" | "schedule";
31
+ kind: "manual" | "message" | "schedule" | "dream";
26
32
  from?: string;
27
33
  text: string;
28
34
  context?: {
@@ -35,6 +41,9 @@ export interface WakeEvent {
35
41
  pairPeers?: string[];
36
42
  artifactPaths?: string[];
37
43
  };
44
+ delivery?: WakeDeliveryMetadata;
45
+ /** Exact transport body retained outside the runtime-enriched model prompt. */
46
+ transportText?: string;
38
47
  }
39
48
  export interface WakeResult {
40
49
  agentId: AgentId;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,WAAW,GAAG,QAAQ,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;KACtD,CAAC;IACF,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE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,MAAM,EAAE,CAAC;KAC1B,CAAC;IACF,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,IAAI,WAAW,CAAC;IACtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CAC1D"}
@@ -0,0 +1,3 @@
1
+ /** Namespaces caller-authored example wakes for the shared causal contract. */
2
+ export declare const exampleCausalId: (localId: string) => string;
3
+ //# sourceMappingURL=exampleCausalId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exampleCausalId.d.ts","sourceRoot":"","sources":["../../src/examples/exampleCausalId.ts"],"names":[],"mappings":"AAEA,+EAA+E;AAC/E,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,KAAG,MAKjD,CAAC"}
@@ -0,0 +1,8 @@
1
+ const LOCAL_CAUSAL_ID = /^[a-z0-9][a-z0-9._-]{0,255}$/u;
2
+ /** Namespaces caller-authored example wakes for the shared causal contract. */
3
+ export const exampleCausalId = (localId) => {
4
+ if (!LOCAL_CAUSAL_ID.test(localId)) {
5
+ throw new Error("Daimon example causal id must be a bounded local id");
6
+ }
7
+ return `daimon:${localId}`;
8
+ };
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  import { JsonlMemoryStore } from "@noopolis/mneme";
5
5
  import { OrgObserver } from "../observability/index.js";
6
6
  import { beatsFor, defaultDialogueTurns, selectVoicesForBeat } from "./jungianConversationPlan.js";
7
+ import { exampleCausalId } from "./exampleCausalId.js";
7
8
  import { JungianVoice, runLimited } from "./jungianPlayAgent.js";
8
9
  import { jungianSelves, playScenario } from "./jungianProfiles.js";
9
10
  import { JungianTrace, parseInnerUsed, parseSpeakLine } from "./jungianTrace.js";
@@ -132,7 +133,7 @@ const runCouncil = async (self, eventId, focus, transcript, voices) => {
132
133
  console.log(`\n== ${self.profile.name} inner council: ${focus} ==`);
133
134
  const turns = await runLimited(voices, councilConcurrency, async (voice) => {
134
135
  const event = {
135
- id: `${eventId}-${voice.config.id}`,
136
+ id: exampleCausalId(`${eventId}-${voice.config.id}`),
136
137
  kind: "manual",
137
138
  context: roomContext,
138
139
  text: councilPrompt(self.profile, focus, transcript)
@@ -155,7 +156,7 @@ const runCouncil = async (self, eventId, focus, transcript, voices) => {
155
156
  };
156
157
  const runRepresentative = async (self, eventId, focus, transcript, counsel) => {
157
158
  const event = {
158
- id: eventId,
159
+ id: exampleCausalId(eventId),
159
160
  kind: "manual",
160
161
  context: roomContext,
161
162
  text: representativePrompt(self.profile, focus, transcript, counsel)
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  import { JsonlMemoryStore } from "@noopolis/mneme";
5
5
  import { OrgObserver } from "../observability/index.js";
6
6
  import { PiHarnessAdapter } from "../pi/piHarness.js";
7
+ import { exampleCausalId } from "./exampleCausalId.js";
7
8
  import { JungianPiRepresentative, seedPiCodexAuth } from "./jungianPiRepresentative.js";
8
9
  import { JungianVoice, runLimited } from "./jungianPlayAgent.js";
9
10
  import { JungianTrace, parseInnerUsed, parseSpeakLine } from "./jungianTrace.js";
@@ -134,7 +135,7 @@ const runCouncil = async (self, eventBase, focus, transcript, voices) => {
134
135
  console.log(`\n== ${self.profile.name} inner counsel ==`);
135
136
  return runLimited(voices, 2, async (voice) => {
136
137
  const event = {
137
- id: `${eventBase}-council-${voice.config.id}`,
138
+ id: exampleCausalId(`${eventBase}-council-${voice.config.id}`),
138
139
  kind: "manual",
139
140
  context: roomContext,
140
141
  text: councilPrompt(self.profile, focus, transcript)
@@ -171,7 +172,7 @@ const assertUsedCounsel = (self, eventId, output, counsel) => {
171
172
  };
172
173
  const runRepresentative = async (self, eventBase, focus, transcript, counsel) => {
173
174
  const event = {
174
- id: `${eventBase}-speaks`,
175
+ id: exampleCausalId(`${eventBase}-speaks`),
175
176
  kind: "manual",
176
177
  context: roomContext,
177
178
  text: representativePrompt(self.profile, focus, transcript, counsel)
@@ -1,6 +1,6 @@
1
1
  import type { WakeEvent } from "../core/types.js";
2
2
  import type { MemoryRecallAudit } from "@noopolis/mneme";
3
- import { type EngineKind, type EngineRunResult } from "./mixedEngineCli.js";
3
+ import { type CliEngineKind as EngineKind, type EngineRunResult } from "../pi/cliSession.js";
4
4
  export interface JungianVoiceConfig {
5
5
  archetype?: string;
6
6
  engine: EngineKind;
@@ -1 +1 @@
1
- {"version":3,"file":"jungianPlayAgent.d.ts","sourceRoot":"","sources":["../../src/examples/jungianPlayAgent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAqB,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE/F,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,EA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C,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,EAAE,CAYb,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { mkdir, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { createMemoryRuntime } from "@noopolis/mneme";
4
- import { runEngineDetailed } from "./mixedEngineCli.js";
4
+ import { runEngineDetailed } from "../pi/cliSession.js";
5
5
  const maxMemoryChars = 2200;
6
6
  const truncate = (text, maxChars) => text.length <= maxChars ? text : `${text.slice(0, maxChars).trim()}\n[truncated]`;
7
7
  const memorySections = (turnPrompt) => truncate(turnPrompt, maxMemoryChars);
@@ -1,4 +1,4 @@
1
- import type { EngineKind } from "./mixedEngineCli.js";
1
+ import type { CliEngineKind as EngineKind } from "../pi/cliSession.js";
2
2
  export interface JungianArchetypeProfile {
3
3
  agenda: string;
4
4
  archetype: string;
@@ -1 +1 @@
1
- {"version":3,"file":"jungianProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,uBAAuB,EAAE,CAAC;CACnC;AA+JD,eAAO,MAAM,aAAa,EAAE,kBAAkB,EAiC7C,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAMxB,CAAC"}
1
+ {"version":3,"file":"jungianProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,uBAAuB,EAAE,CAAC;CACnC;AA+JD,eAAO,MAAM,aAAa,EAAE,kBAAkB,EAiC7C,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAMxB,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { EngineKind } from "./mixedEngineCli.js";
1
+ import type { CliEngineKind as EngineKind } from "../pi/cliSession.js";
2
2
  export type RepresentativeEngine = EngineKind | "pi";
3
3
  export interface TriadArchetypeProfile {
4
4
  agenda: string;
@@ -1 +1 @@
1
- {"version":3,"file":"jungianTriadProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianTriadProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,IAAI,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAsDD,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAqCzC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAMzB,CAAC"}
1
+ {"version":3,"file":"jungianTriadProfiles.d.ts","sourceRoot":"","sources":["../../src/examples/jungianTriadProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEvE,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,IAAI,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAsDD,eAAO,MAAM,WAAW,EAAE,gBAAgB,EAqCzC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;CAMzB,CAAC"}
@@ -3,6 +3,7 @@ import path from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { seedPiOpenAICodexAuthFromCodex } from "../pi/auth.js";
5
5
  import { PiHarnessAdapter } from "../pi/piHarness.js";
6
+ import { exampleCausalId } from "./exampleCausalId.js";
6
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
8
  const daimonRoot = path.resolve(__dirname, "../..");
8
9
  const runtimeRoot = path.join(daimonRoot, ".runtime", "pi-agent");
@@ -66,7 +67,7 @@ const run = async () => {
66
67
  try {
67
68
  console.log("started", JSON.stringify([mapper.status(), reviewer.status()], null, 2));
68
69
  const mapped = await mapper.wake({
69
- id: "wake-mapper-1",
70
+ id: exampleCausalId("wake-mapper-1"),
70
71
  kind: "manual",
71
72
  from: "caller",
72
73
  text: [
@@ -78,7 +79,7 @@ const run = async () => {
78
79
  });
79
80
  console.log("mapper", JSON.stringify(mapped, null, 2));
80
81
  const reviewed = await reviewer.wake({
81
- id: "wake-reviewer-1",
82
+ id: exampleCausalId("wake-reviewer-1"),
82
83
  kind: "message",
83
84
  from: "mapper",
84
85
  text: [
@@ -4,6 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  import { JsonlMemoryStore } from "@noopolis/mneme";
5
5
  import { seedPiOpenAICodexAuthFromCodex } from "../pi/auth.js";
6
6
  import { PiHarnessAdapter } from "../pi/piHarness.js";
7
+ import { exampleCausalId } from "./exampleCausalId.js";
7
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
8
9
  const daimonRoot = path.resolve(__dirname, "../..");
9
10
  const runtimeRoot = path.join(daimonRoot, ".runtime", "pi-memory-org");
@@ -92,7 +93,7 @@ const seedPrivateMemories = async (handles) => {
92
93
  console.log("\n== Private seed phase ==");
93
94
  for (const agent of demoAgents) {
94
95
  const result = await handles.get(agent.id)?.wake({
95
- id: `seed-${agent.id}`,
96
+ id: exampleCausalId(`seed-${agent.id}`),
96
97
  kind: "manual",
97
98
  text: [
98
99
  "Private memory seed.",
@@ -107,7 +108,7 @@ const runRoomConversation = async (handles) => {
107
108
  console.log("\n== Room recall phase ==");
108
109
  const transcript = [];
109
110
  const atlas = await wake(handles.get("atlas"), {
110
- id: "room-atlas-1",
111
+ id: exampleCausalId("room-atlas-1"),
111
112
  kind: "manual",
112
113
  context: roomContext,
113
114
  text: [
@@ -121,7 +122,7 @@ const runRoomConversation = async (handles) => {
121
122
  assertIncludes("atlas room reply", atlas.text, "ATLAS_BLUE_17");
122
123
  transcript.push(`atlas: ${atlas.text}`);
123
124
  const oracle = await wake(handles.get("oracle"), {
124
- id: "room-oracle-1",
125
+ id: exampleCausalId("room-oracle-1"),
125
126
  kind: "manual",
126
127
  context: roomContext,
127
128
  text: [
@@ -135,7 +136,7 @@ const runRoomConversation = async (handles) => {
135
136
  assertIncludes("oracle room reply", oracle.text, "ATLAS_BLUE_17");
136
137
  transcript.push(`oracle: ${oracle.text}`);
137
138
  const keeper = await wake(handles.get("keeper"), {
138
- id: "room-keeper-1",
139
+ id: exampleCausalId("room-keeper-1"),
139
140
  kind: "manual",
140
141
  context: roomContext,
141
142
  text: [
@@ -162,7 +163,7 @@ const verifyFreshSessionRecall = async (adapter, previousKeeper) => {
162
163
  const keeper = await startAgent(adapter, demoAgents.find((agent) => agent.id === "keeper"));
163
164
  try {
164
165
  const event = {
165
- id: "room-keeper-2",
166
+ id: exampleCausalId("room-keeper-2"),
166
167
  kind: "manual",
167
168
  context: roomContext,
168
169
  text: [
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./core/types.js";
2
2
  export * from "./observability/index.js";
3
+ export * from "./mcp/toolServer.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./core/types.js";
2
2
  export * from "./observability/index.js";
3
+ export * from "./mcp/toolServer.js";
@@ -0,0 +1,31 @@
1
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2
+ import type { ToolDefinition } from "@earendil-works/pi-coding-agent";
3
+ export declare class McpToolTurnLimitError extends Error {
4
+ constructor(maxToolTurns: number);
5
+ }
6
+ export declare class McpWakeDeadlineError extends Error {
7
+ constructor();
8
+ }
9
+ /**
10
+ * A non-standard request AGY issues during its MCP handshake.
11
+ *
12
+ * Captured live from `agy --print … --output-format stream-json`, the client
13
+ * sends `initialize`, `notifications/initialized`, **`server/discover`**,
14
+ * `tools/list`, `tools/call`. `server/discover` is not in the MCP
15
+ * specification, and the throwaway probe that proved AGY's headless tool
16
+ * calling answered it with `{}`. Codex and Grok never send it.
17
+ *
18
+ * This server answers it the same way that working probe did, rather than the
19
+ * SDK default of `MethodNotFound`, because a refusal here is the one observable
20
+ * difference between this server and the one AGY is known to work against, and
21
+ * the cost of being wrong is that every AGY agent silently loses every tool.
22
+ * The allowance is exactly this one method: any other unknown method still gets
23
+ * `MethodNotFound`, so a genuine protocol mistake is never hidden.
24
+ */
25
+ export declare const AGY_SERVER_DISCOVER_METHOD: "server/discover";
26
+ export interface PiToolMcpServerOptions {
27
+ readonly maxToolTurns?: number;
28
+ readonly wakeDeadline?: number;
29
+ }
30
+ export declare const createPiToolMcpServer: (tools: ToolDefinition[], options: PiToolMcpServerOptions) => Server;
31
+ //# sourceMappingURL=toolServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolServer.d.ts","sourceRoot":"","sources":["../../src/mcp/toolServer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAYnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,qBAAa,qBAAsB,SAAQ,KAAK;gBAC3B,YAAY,EAAE,MAAM;CAIxC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B,EAAG,iBAA0B,CAAC;AAErE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAyDD,eAAO,MAAM,qBAAqB,GAChC,OAAO,cAAc,EAAE,EACvB,SAAS,sBAAsB,KAC9B,MAgEF,CAAC"}