spawnfile 0.1.14 → 0.1.17

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 (546) hide show
  1. package/README.md +60 -159
  2. package/dist/audit/checksShared.d.ts +1 -1
  3. package/dist/auth/importers.d.ts +10 -0
  4. package/dist/auth/importers.js +29 -4
  5. package/dist/auth/index.d.ts +2 -0
  6. package/dist/auth/index.js +1 -0
  7. package/dist/auth/paths.d.ts +1 -1
  8. package/dist/auth/profileStore.js +9 -9
  9. package/dist/auth/targetSecretSourceFsIdentity.d.ts +40 -0
  10. package/dist/auth/targetSecretSourceFsIdentity.js +42 -0
  11. package/dist/auth/targetSecretSourceFsPublish.d.ts +2 -0
  12. package/dist/auth/targetSecretSourceFsPublish.js +3 -1
  13. package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +2 -1
  14. package/dist/auth/targetSecretSourceFsPublishImmutable.js +104 -71
  15. package/dist/auth/targetSecretSourceFsRead.js +5 -14
  16. package/dist/auth/trainingAuth.d.ts +21 -0
  17. package/dist/auth/trainingAuth.js +86 -0
  18. package/dist/auth/types.d.ts +1 -1
  19. package/dist/cli/authCommands.d.ts +1 -1
  20. package/dist/cli/authCommands.js +9 -0
  21. package/dist/cli/canaryCutoverCommand.d.ts +2 -0
  22. package/dist/cli/canaryCutoverCommand.js +30 -0
  23. package/dist/cli/capabilitiesCommand.d.ts +3 -0
  24. package/dist/cli/capabilitiesCommand.js +12 -0
  25. package/dist/cli/capabilitiesReceipt.d.ts +56 -0
  26. package/dist/cli/capabilitiesReceipt.js +56 -0
  27. package/dist/cli/compileBuildCommands.js +13 -0
  28. package/dist/cli/composedLifecycleContractSet.d.ts +21 -0
  29. package/dist/cli/composedLifecycleContractSet.js +204 -0
  30. package/dist/cli/devCommands.js +2 -0
  31. package/dist/cli/downCommand.js +19 -8
  32. package/dist/cli/evidenceExportHelperCommand.d.ts +13 -0
  33. package/dist/cli/evidenceExportHelperCommand.js +51 -0
  34. package/dist/cli/index.js +12 -3
  35. package/dist/cli/lifecycleMachine.d.ts +7 -1
  36. package/dist/cli/lifecycleMachine.js +2 -2
  37. package/dist/cli/paideiaDelegation.d.ts +17 -0
  38. package/dist/cli/paideiaDelegation.js +210 -0
  39. package/dist/cli/paideiaSupervisor.d.ts +17 -0
  40. package/dist/cli/paideiaSupervisor.js +48 -0
  41. package/dist/cli/productStateCloneCommand.d.ts +2 -0
  42. package/dist/cli/productStateCloneCommand.js +34 -0
  43. package/dist/cli/runCli.d.ts +13 -3
  44. package/dist/cli/runCli.js +37 -9
  45. package/dist/cli/targetCommands.d.ts +4 -7
  46. package/dist/cli/targetCommands.js +16 -46
  47. package/dist/cli/targetConfigPreparedPlan.d.ts +3 -0
  48. package/dist/cli/targetConfigPreparedPlan.js +74 -0
  49. package/dist/cli/targetConfigResolver.d.ts +3 -0
  50. package/dist/cli/targetConfigResolver.js +111 -0
  51. package/dist/cli/targetConfigResolverCommand.d.ts +6 -0
  52. package/dist/cli/targetConfigResolverCommand.js +43 -0
  53. package/dist/cli/targetConfigResolverContracts.d.ts +56 -0
  54. package/dist/cli/targetConfigResolverContracts.js +30 -0
  55. package/dist/cli/targetConfigResolverDocker.d.ts +4 -0
  56. package/dist/cli/targetConfigResolverDocker.js +47 -0
  57. package/dist/cli/targetConfigResolverValidation.d.ts +10 -0
  58. package/dist/cli/targetConfigResolverValidation.js +94 -0
  59. package/dist/cli/targetDefaultAuthorities.d.ts +2 -0
  60. package/dist/cli/targetDefaultAuthorities.js +3 -0
  61. package/dist/cli/targetDefaultConfig.d.ts +7 -0
  62. package/dist/cli/targetDefaultConfig.js +22 -5
  63. package/dist/cli/targetDefaultConfigStdin.js +7 -1
  64. package/dist/cli/targetDefaultHandlerFactory.js +23 -2
  65. package/dist/cli/targetDefaultHandlers.d.ts +2 -2
  66. package/dist/cli/targetProductionCommands.d.ts +5 -0
  67. package/dist/cli/targetProductionCommands.js +45 -0
  68. package/dist/cli/trainCommand.d.ts +3 -0
  69. package/dist/cli/trainCommand.js +61 -0
  70. package/dist/cli/upCommand.js +35 -6
  71. package/dist/cli/upLifecycleRecovery.d.ts +2 -2
  72. package/dist/cli/upLifecycleRecovery.js +188 -44
  73. package/dist/cli/usageCommand.d.ts +40 -0
  74. package/dist/cli/usageCommand.js +284 -0
  75. package/dist/cli/usageCommandLive.d.ts +84 -0
  76. package/dist/cli/usageCommandLive.js +95 -0
  77. package/dist/cli/usageDeploymentSource.d.ts +9 -0
  78. package/dist/cli/usageDeploymentSource.js +22 -0
  79. package/dist/cli/workspaceResourceMigrationCommand.d.ts +8 -0
  80. package/dist/cli/workspaceResourceMigrationCommand.js +36 -0
  81. package/dist/compiler/buildCompilePlanTeams.d.ts +1 -1
  82. package/dist/compiler/buildCompilePlanTeams.js +6 -1
  83. package/dist/compiler/compilePlanHelpers.js +3 -0
  84. package/dist/compiler/compileProject.d.ts +2 -0
  85. package/dist/compiler/compileProject.js +5 -1
  86. package/dist/compiler/compileProjectSupport.js +9 -0
  87. package/dist/compiler/containerArtifacts.d.ts +3 -1
  88. package/dist/compiler/containerArtifacts.js +92 -40
  89. package/dist/compiler/containerArtifactsPlans.d.ts +1 -1
  90. package/dist/compiler/containerArtifactsPlans.js +24 -7
  91. package/dist/compiler/containerArtifactsRender.d.ts +2 -1
  92. package/dist/compiler/containerArtifactsRender.js +91 -58
  93. package/dist/compiler/containerArtifactsTypes.d.ts +8 -0
  94. package/dist/compiler/containerBackedMountRender.d.ts +56 -0
  95. package/dist/compiler/containerBackedMountRender.js +101 -0
  96. package/dist/compiler/containerDaimonBrokerRender.d.ts +112 -0
  97. package/dist/compiler/containerDaimonBrokerRender.js +191 -0
  98. package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +38 -0
  99. package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +108 -0
  100. package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +172 -0
  101. package/dist/compiler/containerDaimonGrokWorkerRender.js +268 -0
  102. package/dist/compiler/containerDaimonOwnershipGuardRender.d.ts +12 -0
  103. package/dist/compiler/containerDaimonOwnershipGuardRender.js +191 -0
  104. package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +24 -0
  105. package/dist/compiler/containerDaimonUidEntrypointRender.js +297 -0
  106. package/dist/compiler/containerEntrypointRender.d.ts +7 -0
  107. package/dist/compiler/containerEntrypointRender.js +28 -22
  108. package/dist/compiler/containerPersistentMounts.d.ts +30 -0
  109. package/dist/compiler/containerPersistentMounts.js +66 -0
  110. package/dist/compiler/containerReadinessPaths.d.ts +1 -0
  111. package/dist/compiler/containerReadinessPaths.js +1 -0
  112. package/dist/compiler/containerRuntimeLinkMaterializer.d.ts +2 -0
  113. package/dist/compiler/containerRuntimeLinkMaterializer.js +12 -0
  114. package/dist/compiler/containerRuntimeReadinessRender.d.ts +7 -0
  115. package/dist/compiler/containerRuntimeReadinessRender.js +40 -0
  116. package/dist/compiler/containerStateOwnershipRender.d.ts +4 -0
  117. package/dist/compiler/containerStateOwnershipRender.js +75 -0
  118. package/dist/compiler/containerTargetResources.d.ts +22 -1
  119. package/dist/compiler/containerTargetResources.js +94 -2
  120. package/dist/compiler/containerVolumeBootstrap.d.ts +3 -0
  121. package/dist/compiler/containerVolumeBootstrap.js +3 -0
  122. package/dist/compiler/containerWorkspaceResourceRender.js +49 -1
  123. package/dist/compiler/daimonTelemetryArtifacts.d.ts +2 -2
  124. package/dist/compiler/daimonTelemetryArtifacts.js +5 -10
  125. package/dist/compiler/deploymentLineage.d.ts +40 -0
  126. package/dist/compiler/deploymentLineage.js +50 -0
  127. package/dist/compiler/index.d.ts +3 -0
  128. package/dist/compiler/index.js +3 -0
  129. package/dist/compiler/initProject.d.ts +2 -0
  130. package/dist/compiler/initProject.js +39 -1
  131. package/dist/compiler/localMoltnetAuthority.d.ts +64 -0
  132. package/dist/compiler/localMoltnetAuthority.js +177 -0
  133. package/dist/compiler/memoryArtifacts.d.ts +1 -1
  134. package/dist/compiler/memoryArtifacts.js +108 -32
  135. package/dist/compiler/modelEnv.d.ts +5 -0
  136. package/dist/compiler/modelEnv.js +8 -2
  137. package/dist/compiler/moltnetArtifactPaths.d.ts +17 -12
  138. package/dist/compiler/moltnetArtifactPaths.js +17 -15
  139. package/dist/compiler/moltnetArtifactTypes.d.ts +10 -0
  140. package/dist/compiler/moltnetArtifacts.d.ts +1 -1
  141. package/dist/compiler/moltnetArtifacts.js +52 -12
  142. package/dist/compiler/moltnetBinaries.d.ts +16 -4
  143. package/dist/compiler/moltnetBinaries.js +46 -6
  144. package/dist/compiler/moltnetClientConfig.js +1 -1
  145. package/dist/compiler/moltnetConfigLowering.d.ts +3 -1
  146. package/dist/compiler/moltnetConfigLowering.js +30 -6
  147. package/dist/compiler/moltnetNodeConfig.js +1 -1
  148. package/dist/compiler/moltnetReleaseAuthority.d.ts +24 -1
  149. package/dist/compiler/moltnetReleaseAuthority.js +33 -4
  150. package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -1
  151. package/dist/compiler/moltnetRepresentativeResolution.js +2 -2
  152. package/dist/compiler/moltnetResolution.js +9 -15
  153. package/dist/compiler/moltnetRoomMemberships.js +20 -5
  154. package/dist/compiler/moltnetRoomPolicyCompatibility.d.ts +1 -1
  155. package/dist/compiler/moltnetRoomPolicyCompatibility.js +3 -1
  156. package/dist/compiler/moltnetRuntimeConfig.d.ts +1 -1
  157. package/dist/compiler/moltnetRuntimeConfig.js +22 -2
  158. package/dist/compiler/moltnetServerPlans.js +19 -0
  159. package/dist/compiler/organizationExternalParticipants.d.ts +3 -0
  160. package/dist/compiler/organizationExternalParticipants.js +176 -0
  161. package/dist/compiler/organizationIdentity.d.ts +3 -9
  162. package/dist/compiler/organizationIdentity.js +37 -270
  163. package/dist/compiler/organizationIdentityGraph.d.ts +15 -0
  164. package/dist/compiler/organizationIdentityGraph.js +115 -0
  165. package/dist/compiler/organizationReadyEvidence.d.ts +8 -0
  166. package/dist/compiler/organizationReadyEvidence.js +23 -3
  167. package/dist/compiler/runProject.d.ts +4 -2
  168. package/dist/compiler/runProject.js +32 -6
  169. package/dist/compiler/runProjectAuth.d.ts +3 -1
  170. package/dist/compiler/runProjectAuth.js +19 -3
  171. package/dist/compiler/runProjectDaimonCodexDocker.d.ts +3 -0
  172. package/dist/compiler/runProjectDaimonCodexDocker.js +36 -0
  173. package/dist/compiler/runProjectDocker.d.ts +8 -4
  174. package/dist/compiler/runProjectDocker.js +43 -18
  175. package/dist/compiler/runProjectDockerDaimonGuards.d.ts +15 -0
  176. package/dist/compiler/runProjectDockerDaimonGuards.js +122 -0
  177. package/dist/compiler/runProjectDockerReservation.d.ts +3 -0
  178. package/dist/compiler/runProjectDockerReservation.js +118 -0
  179. package/dist/compiler/runProjectLifecycle.js +1 -1
  180. package/dist/compiler/training/broker/declaration.d.ts +45 -0
  181. package/dist/compiler/training/broker/declaration.js +55 -0
  182. package/dist/compiler/training/broker/entrypoint.d.ts +39 -0
  183. package/dist/compiler/training/broker/entrypoint.js +111 -0
  184. package/dist/compiler/training/broker/index.d.ts +10 -0
  185. package/dist/compiler/training/broker/index.js +10 -0
  186. package/dist/compiler/training/broker/main.d.ts +2 -0
  187. package/dist/compiler/training/broker/main.js +14 -0
  188. package/dist/compiler/training/broker/paths.d.ts +196 -0
  189. package/dist/compiler/training/broker/paths.js +241 -0
  190. package/dist/compiler/training/broker/processes.d.ts +42 -0
  191. package/dist/compiler/training/broker/processes.js +99 -0
  192. package/dist/compiler/training/broker/projection.d.ts +51 -0
  193. package/dist/compiler/training/broker/projection.js +76 -0
  194. package/dist/compiler/training/broker/provisioning.d.ts +87 -0
  195. package/dist/compiler/training/broker/provisioning.js +213 -0
  196. package/dist/compiler/training/broker/receipt.d.ts +77 -0
  197. package/dist/compiler/training/broker/receipt.js +110 -0
  198. package/dist/compiler/training/broker/registration.d.ts +41 -0
  199. package/dist/compiler/training/broker/registration.js +102 -0
  200. package/dist/compiler/training/broker/runtime.d.ts +25 -0
  201. package/dist/compiler/training/broker/runtime.js +173 -0
  202. package/dist/compiler/training/broker/seccompRoutes.d.ts +31 -0
  203. package/dist/compiler/training/broker/seccompRoutes.js +36 -0
  204. package/dist/compiler/training/broker/supervisor.d.ts +109 -0
  205. package/dist/compiler/training/broker/supervisor.js +173 -0
  206. package/dist/compiler/training/container/contract.d.ts +31 -0
  207. package/dist/compiler/training/container/contract.js +33 -0
  208. package/dist/compiler/training/container/index.d.ts +4 -0
  209. package/dist/compiler/training/container/index.js +2 -0
  210. package/dist/compiler/training/container/launch.d.ts +18 -0
  211. package/dist/compiler/training/container/launch.js +173 -0
  212. package/dist/compiler/training/container/prepare.d.ts +8 -0
  213. package/dist/compiler/training/container/prepare.js +80 -0
  214. package/dist/compiler/training/container/process.d.ts +14 -0
  215. package/dist/compiler/training/container/process.js +70 -0
  216. package/dist/compiler/training/container/security.d.ts +36 -0
  217. package/dist/compiler/training/container/security.js +58 -0
  218. package/dist/compiler/training/context.d.ts +7 -0
  219. package/dist/compiler/training/context.js +93 -0
  220. package/dist/compiler/training/contract.d.ts +142 -0
  221. package/dist/compiler/training/contract.js +34 -0
  222. package/dist/compiler/training/index.d.ts +4 -0
  223. package/dist/compiler/training/index.js +3 -0
  224. package/dist/compiler/training/preparation/assets/Dockerfile +98 -0
  225. package/dist/compiler/training/preparation/assets/package-lock.json +3787 -0
  226. package/dist/compiler/training/preparation/broker.d.ts +21 -0
  227. package/dist/compiler/training/preparation/broker.js +43 -0
  228. package/dist/compiler/training/preparation/contextModes.d.ts +12 -0
  229. package/dist/compiler/training/preparation/contextModes.js +38 -0
  230. package/dist/compiler/training/preparation/contract.d.ts +182 -0
  231. package/dist/compiler/training/preparation/contract.js +94 -0
  232. package/dist/compiler/training/preparation/copyAssets.d.ts +1 -0
  233. package/dist/compiler/training/preparation/copyAssets.js +8 -0
  234. package/dist/compiler/training/preparation/daimonParent.d.ts +42 -0
  235. package/dist/compiler/training/preparation/daimonParent.js +114 -0
  236. package/dist/compiler/training/preparation/files.d.ts +25 -0
  237. package/dist/compiler/training/preparation/files.js +85 -0
  238. package/dist/compiler/training/preparation/image.d.ts +28 -0
  239. package/dist/compiler/training/preparation/image.js +102 -0
  240. package/dist/compiler/training/preparation/index.d.ts +3 -0
  241. package/dist/compiler/training/preparation/index.js +2 -0
  242. package/dist/compiler/training/preparation/inputs.d.ts +23 -0
  243. package/dist/compiler/training/preparation/inputs.js +93 -0
  244. package/dist/compiler/training/preparation/prepare.d.ts +33 -0
  245. package/dist/compiler/training/preparation/prepare.js +186 -0
  246. package/dist/compiler/training/preparation/scratch.d.ts +19 -0
  247. package/dist/compiler/training/preparation/scratch.js +48 -0
  248. package/dist/compiler/training/repair/compatibility.d.ts +11 -0
  249. package/dist/compiler/training/repair/compatibility.js +34 -0
  250. package/dist/compiler/training/repair/contract.d.ts +506 -0
  251. package/dist/compiler/training/repair/contract.js +31 -0
  252. package/dist/compiler/training/repair/index.d.ts +3 -0
  253. package/dist/compiler/training/repair/index.js +3 -0
  254. package/dist/compiler/training/repair/prepare.d.ts +230 -0
  255. package/dist/compiler/training/repair/prepare.js +74 -0
  256. package/dist/compiler/training/repair/witness.d.ts +203 -0
  257. package/dist/compiler/training/repair/witness.js +42 -0
  258. package/dist/compiler/types.d.ts +2 -0
  259. package/dist/compiler/upProject.d.ts +26 -1
  260. package/dist/compiler/upProject.js +117 -178
  261. package/dist/compiler/upProjectHandoff.d.ts +62 -0
  262. package/dist/compiler/upProjectHandoff.js +204 -0
  263. package/dist/compiler/upReceipt.js +49 -4
  264. package/dist/compiler/updateProjectModels.js +1 -0
  265. package/dist/compiler/view/types.d.ts +1 -1
  266. package/dist/compiler/workspaceBundleArtifacts.d.ts +3 -0
  267. package/dist/compiler/workspaceBundleArtifacts.js +106 -0
  268. package/dist/compiler/workspaceResources.d.ts +4 -1
  269. package/dist/compiler/workspaceResources.js +12 -7
  270. package/dist/deployment/artifactsExportPlan.js +51 -1
  271. package/dist/deployment/canaryCutover.d.ts +42 -0
  272. package/dist/deployment/canaryCutover.js +140 -0
  273. package/dist/deployment/candidateDiagnostics.d.ts +15 -0
  274. package/dist/deployment/candidateDiagnostics.js +90 -0
  275. package/dist/deployment/dockerLogs.js +4 -1
  276. package/dist/deployment/dockerManager.js +9 -3
  277. package/dist/deployment/dockerProbeGateway.d.ts +17 -0
  278. package/dist/deployment/dockerProbeGateway.js +17 -2
  279. package/dist/deployment/downDeployment.d.ts +5 -0
  280. package/dist/deployment/downDeployment.js +109 -8
  281. package/dist/deployment/downReceiptTypes.d.ts +17 -2
  282. package/dist/deployment/downReceiptTypes.js +17 -2
  283. package/dist/deployment/index.d.ts +4 -0
  284. package/dist/deployment/index.js +4 -0
  285. package/dist/deployment/lifecycleCompletionContracts.d.ts +66 -0
  286. package/dist/deployment/lifecycleCompletionContracts.js +34 -0
  287. package/dist/deployment/lifecycleCompletionPaths.d.ts +4 -1
  288. package/dist/deployment/lifecycleCompletionPaths.js +3 -0
  289. package/dist/deployment/lifecycleCompletionPublication.d.ts +2 -0
  290. package/dist/deployment/lifecycleCompletionPublication.js +18 -4
  291. package/dist/deployment/lifecycleCompletionStore.d.ts +1 -1
  292. package/dist/deployment/lifecycleCompletionStore.js +7 -7
  293. package/dist/deployment/lifecycleUpRecords.d.ts +11 -0
  294. package/dist/deployment/lifecycleUpRecords.js +127 -0
  295. package/dist/deployment/native/AGENTS.md +11 -0
  296. package/dist/deployment/native/rename-noreplace-arm64 +0 -0
  297. package/dist/deployment/native/rename-noreplace-arm64.provenance.json +1 -0
  298. package/dist/deployment/native/rename-noreplace-x64 +0 -0
  299. package/dist/deployment/native/rename-noreplace-x64.provenance.json +1 -0
  300. package/dist/deployment/noReplaceActivation.d.ts +17 -0
  301. package/dist/deployment/noReplaceActivation.js +50 -0
  302. package/dist/deployment/organizationHandoffAuthorityFsBudget.d.ts +110 -0
  303. package/dist/deployment/organizationHandoffAuthorityFsBudget.js +156 -0
  304. package/dist/deployment/organizationHandoffAuthorityFsClient.js +82 -27
  305. package/dist/deployment/organizationHandoffAuthorityFsElection.d.ts +21 -0
  306. package/dist/deployment/organizationHandoffAuthorityFsElection.js +57 -0
  307. package/dist/deployment/organizationHandoffAuthorityFsWorker.js +254 -108
  308. package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.d.ts +1 -0
  309. package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.js +16 -0
  310. package/dist/deployment/organizationHandoffAuthorityStore.js +14 -7
  311. package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +2 -2
  312. package/dist/deployment/organizationHandoffAuthorityTypes.js +2 -1
  313. package/dist/deployment/organizationReady.d.ts +2 -0
  314. package/dist/deployment/organizationReady.js +36 -4
  315. package/dist/deployment/productStateClone.d.ts +43 -0
  316. package/dist/deployment/productStateClone.js +319 -0
  317. package/dist/deployment/upLifecycleRecoveryState.d.ts +23 -0
  318. package/dist/deployment/upLifecycleRecoveryState.js +12 -0
  319. package/dist/deployment/upReceiptTypes.d.ts +32 -6
  320. package/dist/deployment/upReceiptTypes.js +29 -2
  321. package/dist/deployment/workspaceResourceMigration.d.ts +55 -0
  322. package/dist/deployment/workspaceResourceMigration.js +315 -0
  323. package/dist/dev/project.d.ts +7 -0
  324. package/dist/dev/project.js +9 -0
  325. package/dist/distribution/consumeImage.d.ts +2 -0
  326. package/dist/distribution/consumeImage.js +98 -73
  327. package/dist/distribution/consumeImageDaimonDocker.d.ts +3 -0
  328. package/dist/distribution/consumeImageDaimonDocker.js +45 -0
  329. package/dist/distribution/consumeImageLifecycle.d.ts +17 -0
  330. package/dist/distribution/consumeImageLifecycle.js +231 -0
  331. package/dist/distribution/consumeImageSupport.d.ts +12 -0
  332. package/dist/distribution/consumeImageSupport.js +15 -0
  333. package/dist/distribution/distributionReportSchema.d.ts +11 -1
  334. package/dist/distribution/distributionReportSchema.js +15 -2
  335. package/dist/distribution/dockerRunner.d.ts +6 -1
  336. package/dist/distribution/dockerRunner.js +31 -4
  337. package/dist/distribution/imageRuntimeAuth.d.ts +9 -1
  338. package/dist/distribution/imageRuntimeAuth.js +70 -1
  339. package/dist/distribution/index.d.ts +1 -1
  340. package/dist/distribution/index.js +1 -1
  341. package/dist/distribution/preflight.js +5 -1
  342. package/dist/distribution/types.d.ts +14 -1
  343. package/dist/distribution/types.js +3 -0
  344. package/dist/evidenceExportHelper/boundedExecutor.d.ts +3 -0
  345. package/dist/evidenceExportHelper/boundedExecutor.js +33 -0
  346. package/dist/evidenceExportHelper/helperProgram.mjs +156 -0
  347. package/dist/evidenceExportHelper/index.d.ts +4 -0
  348. package/dist/evidenceExportHelper/index.js +4 -0
  349. package/dist/evidenceExportHelper/preparedAuthority.d.ts +64 -0
  350. package/dist/evidenceExportHelper/preparedAuthority.js +228 -0
  351. package/dist/evidenceExportHelper/preparedBuilder.d.ts +10 -0
  352. package/dist/evidenceExportHelper/preparedBuilder.js +183 -0
  353. package/dist/evidenceExportHelper/preparedBuilderTypes.d.ts +19 -0
  354. package/dist/evidenceExportHelper/preparedBuilderTypes.js +1 -0
  355. package/dist/evidenceExportHelper/recipe.d.ts +7 -0
  356. package/dist/evidenceExportHelper/recipe.js +83 -0
  357. package/dist/filesystem/io.d.ts +2 -0
  358. package/dist/filesystem/io.js +16 -1
  359. package/dist/manifest/executionSchemas.d.ts +27 -0
  360. package/dist/manifest/executionSchemas.js +21 -2
  361. package/dist/manifest/mcpSchemas.d.ts +1 -0
  362. package/dist/manifest/mcpSchemas.js +3 -0
  363. package/dist/manifest/renderSpawnfileNetworks.js +11 -0
  364. package/dist/manifest/renderSpawnfileWorkspace.js +5 -0
  365. package/dist/manifest/scheduleSchemas.d.ts +3 -1
  366. package/dist/manifest/scheduleSchemas.js +91 -5
  367. package/dist/manifest/schemas.d.ts +237 -12
  368. package/dist/manifest/schemas.js +5 -2
  369. package/dist/manifest/teamNetworkAccessSchemas.d.ts +5 -1
  370. package/dist/manifest/teamNetworkAccessSchemas.js +11 -0
  371. package/dist/manifest/teamNetworkAuthSchemas.d.ts +1 -1
  372. package/dist/manifest/teamNetworkSchemas.d.ts +17 -3
  373. package/dist/manifest/teamNetworkSchemas.js +19 -1
  374. package/dist/manifest/teamNetworkServerSchemas.d.ts +8 -3
  375. package/dist/manifest/teamNetworkServerSchemas.js +18 -2
  376. package/dist/manifest/workspaceSchemas.d.ts +16 -0
  377. package/dist/manifest/workspaceSchemas.js +11 -0
  378. package/dist/report/types.d.ts +34 -4
  379. package/dist/runtime/common.d.ts +28 -1
  380. package/dist/runtime/common.js +33 -3
  381. package/dist/runtime/container.js +49 -33
  382. package/dist/runtime/daimon/adapter.d.ts +14 -0
  383. package/dist/runtime/daimon/adapter.js +243 -0
  384. package/dist/runtime/daimon/attention.d.ts +8 -0
  385. package/dist/runtime/daimon/attention.js +32 -0
  386. package/dist/runtime/daimon/config.d.ts +25 -0
  387. package/dist/runtime/daimon/config.js +272 -0
  388. package/dist/runtime/daimon/contractManifest.d.ts +295 -0
  389. package/dist/runtime/daimon/contractManifest.js +319 -0
  390. package/dist/runtime/daimon/grokModel.d.ts +19 -0
  391. package/dist/runtime/daimon/grokModel.js +33 -0
  392. package/dist/runtime/daimon/grokWorkerConfigBytes.d.ts +26 -0
  393. package/dist/runtime/daimon/grokWorkerConfigBytes.js +36 -0
  394. package/dist/runtime/daimon/grokWorkerContract.d.ts +22 -0
  395. package/dist/runtime/daimon/grokWorkerContract.js +48 -0
  396. package/dist/runtime/daimon/memory.d.ts +57 -0
  397. package/dist/runtime/daimon/memory.js +125 -0
  398. package/dist/runtime/daimon/runAuth.d.ts +51 -0
  399. package/dist/runtime/daimon/runAuth.js +279 -0
  400. package/dist/runtime/daimon/runtimeIdentity.d.ts +22 -0
  401. package/dist/runtime/daimon/runtimeIdentity.js +22 -0
  402. package/dist/runtime/daimon/scheduleAuthority.d.ts +3 -0
  403. package/dist/runtime/daimon/scheduleAuthority.js +17 -0
  404. package/dist/runtime/index.d.ts +4 -0
  405. package/dist/runtime/index.js +4 -0
  406. package/dist/runtime/install.d.ts +3 -0
  407. package/dist/runtime/install.js +3 -0
  408. package/dist/runtime/localDaimonAuthority.d.ts +11 -0
  409. package/dist/runtime/localDaimonAuthority.js +77 -0
  410. package/dist/runtime/mnemeMcp.d.ts +13 -0
  411. package/dist/runtime/mnemeMcp.js +26 -0
  412. package/dist/runtime/openclaw/adapter.js +2 -2
  413. package/dist/runtime/pi/adapter.d.ts +0 -1
  414. package/dist/runtime/pi/adapter.js +2 -6
  415. package/dist/runtime/pi/appCliSource.js +1 -1
  416. package/dist/runtime/pi/appScheduleSource.js +6 -2
  417. package/dist/runtime/pi/appTemplateTypes.d.ts +1 -1
  418. package/dist/runtime/picoclaw/adapter.js +2 -2
  419. package/dist/runtime/registry.d.ts +3 -0
  420. package/dist/runtime/registry.js +19 -2
  421. package/dist/runtime/scheduleUtils.d.ts +1 -0
  422. package/dist/runtime/scheduleUtils.js +5 -1
  423. package/dist/runtime/types.d.ts +25 -0
  424. package/dist/runtime/usageLedger.d.ts +158 -0
  425. package/dist/runtime/usageLedger.js +269 -0
  426. package/dist/runtime/usageLedgerRead.d.ts +48 -0
  427. package/dist/runtime/usageLedgerRead.js +102 -0
  428. package/dist/runtime/usageRequestLedger.d.ts +42 -0
  429. package/dist/runtime/usageRequestLedger.js +72 -0
  430. package/dist/shared/daimonCodexDocker.d.ts +32 -0
  431. package/dist/shared/daimonCodexDocker.js +120 -0
  432. package/dist/shared/daimonGrokSeccompProfile.d.ts +10 -0
  433. package/dist/shared/daimonGrokSeccompProfile.js +11 -0
  434. package/dist/shared/index.d.ts +2 -0
  435. package/dist/shared/index.js +2 -0
  436. package/dist/shared/types.d.ts +1 -1
  437. package/dist/shared/volumeNames.d.ts +6 -0
  438. package/dist/shared/volumeNames.js +14 -0
  439. package/dist/target/dockerArtifactsProvider.js +34 -7
  440. package/dist/target/dockerBaseImage.d.ts +2 -0
  441. package/dist/target/dockerBaseImage.js +11 -0
  442. package/dist/target/dockerCommandExecutor.d.ts +11 -0
  443. package/dist/target/dockerCommandExecutor.js +53 -2
  444. package/dist/target/dockerCommandExecutorCore.d.ts +2 -1
  445. package/dist/target/dockerCommandExecutorCore.js +4 -2
  446. package/dist/target/dockerPublicArtifactSnapshot.d.ts +3 -3
  447. package/dist/target/dockerPublicArtifactSnapshot.js +17 -33
  448. package/dist/target/dockerTarget.d.ts +1 -0
  449. package/dist/target/dockerTargetBinding.d.ts +1 -2
  450. package/dist/target/dockerTargetBinding.js +2 -3
  451. package/dist/target/dockerTargetExecFile.d.ts +19 -0
  452. package/dist/target/dockerTargetExecFile.js +194 -0
  453. package/dist/target/dockerWorldServiceProvider.d.ts +4 -0
  454. package/dist/target/dockerWorldServiceProvider.js +13 -1
  455. package/dist/target/evidenceExport.d.ts +3 -1
  456. package/dist/target/evidenceExport.js +12 -3
  457. package/dist/target/evidenceExportOperationsTestKit.js +3 -3
  458. package/dist/target/evidenceExportProvider.d.ts +2 -0
  459. package/dist/target/evidenceExportProvider.js +15 -5
  460. package/dist/target/publicArtifactSnapshot.d.ts +31 -0
  461. package/dist/target/publicArtifactSnapshot.js +37 -3
  462. package/examples/README.md +45 -0
  463. package/examples/agent-with-subagents/AGENTS.md +3 -0
  464. package/examples/agent-with-subagents/Spawnfile +30 -0
  465. package/examples/agent-with-subagents/subagents/critic/AGENTS.md +3 -0
  466. package/examples/agent-with-subagents/subagents/critic/Spawnfile +15 -0
  467. package/examples/agent-with-subagents/subagents/researcher/AGENTS.md +3 -0
  468. package/examples/agent-with-subagents/subagents/researcher/Spawnfile +17 -0
  469. package/examples/daimon-org/Spawnfile +68 -0
  470. package/examples/daimon-org/TEAM.md +4 -0
  471. package/examples/daimon-org/agents/mapper/AGENTS.md +4 -0
  472. package/examples/daimon-org/agents/mapper/Spawnfile +37 -0
  473. package/examples/daimon-org/shared/skills/file-note/SKILL.md +9 -0
  474. package/examples/daimon-org/teams/review/Spawnfile +53 -0
  475. package/examples/daimon-org/teams/review/agents/reviewer/AGENTS.md +4 -0
  476. package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +37 -0
  477. package/examples/daimon-public-host/AGENTS.md +3 -0
  478. package/examples/daimon-public-host/Spawnfile +21 -0
  479. package/examples/distribution-org/Spawnfile +43 -0
  480. package/examples/distribution-org/TEAM.md +4 -0
  481. package/examples/distribution-org/agents/coordinator/AGENTS.md +1 -0
  482. package/examples/distribution-org/agents/coordinator/Spawnfile +20 -0
  483. package/examples/distribution-org/agents/researcher/AGENTS.md +1 -0
  484. package/examples/distribution-org/agents/researcher/Spawnfile +20 -0
  485. package/examples/jungian-daimon-org/Spawnfile +41 -0
  486. package/examples/jungian-daimon-org/TEAM.md +21 -0
  487. package/examples/jungian-daimon-org/teams/luna/Spawnfile +47 -0
  488. package/examples/jungian-daimon-org/teams/luna/TEAM.md +4 -0
  489. package/examples/jungian-daimon-org/teams/luna/agents/animus/AGENTS.md +10 -0
  490. package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +33 -0
  491. package/examples/jungian-daimon-org/teams/luna/agents/representative/AGENTS.md +21 -0
  492. package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +30 -0
  493. package/examples/jungian-daimon-org/teams/luna/agents/shadow/AGENTS.md +10 -0
  494. package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +33 -0
  495. package/examples/jungian-daimon-org/teams/selene/Spawnfile +47 -0
  496. package/examples/jungian-daimon-org/teams/selene/TEAM.md +4 -0
  497. package/examples/jungian-daimon-org/teams/selene/agents/animus/AGENTS.md +10 -0
  498. package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +33 -0
  499. package/examples/jungian-daimon-org/teams/selene/agents/representative/AGENTS.md +19 -0
  500. package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +33 -0
  501. package/examples/jungian-daimon-org/teams/selene/agents/shadow/AGENTS.md +10 -0
  502. package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +30 -0
  503. package/examples/mixed-runtime-org/Spawnfile +71 -0
  504. package/examples/mixed-runtime-org/TEAM.md +8 -0
  505. package/examples/mixed-runtime-org/agents/analyst/AGENTS.md +8 -0
  506. package/examples/mixed-runtime-org/agents/analyst/Spawnfile +27 -0
  507. package/examples/mixed-runtime-org/agents/conductor/AGENTS.md +8 -0
  508. package/examples/mixed-runtime-org/agents/conductor/Spawnfile +27 -0
  509. package/examples/mixed-runtime-org/agents/localist/AGENTS.md +7 -0
  510. package/examples/mixed-runtime-org/agents/localist/Spawnfile +50 -0
  511. package/examples/moltnet-team-chat/Spawnfile +43 -0
  512. package/examples/moltnet-team-chat/TEAM.md +5 -0
  513. package/examples/moltnet-team-chat/agents/coordinator/AGENTS.md +9 -0
  514. package/examples/moltnet-team-chat/agents/coordinator/Spawnfile +26 -0
  515. package/examples/moltnet-team-chat/teams/analysis/Spawnfile +23 -0
  516. package/examples/moltnet-team-chat/teams/analysis/TEAM.md +3 -0
  517. package/examples/moltnet-team-chat/teams/analysis/agents/observer/AGENTS.md +5 -0
  518. package/examples/moltnet-team-chat/teams/analysis/agents/observer/Spawnfile +19 -0
  519. package/examples/moltnet-team-chat/teams/analysis/agents/representative/AGENTS.md +5 -0
  520. package/examples/moltnet-team-chat/teams/analysis/agents/representative/Spawnfile +19 -0
  521. package/examples/moltnet-team-chat/teams/field/Spawnfile +41 -0
  522. package/examples/moltnet-team-chat/teams/field/TEAM.md +3 -0
  523. package/examples/moltnet-team-chat/teams/field/agents/observer/AGENTS.md +5 -0
  524. package/examples/moltnet-team-chat/teams/field/agents/observer/Spawnfile +26 -0
  525. package/examples/moltnet-team-chat/teams/field/agents/representative/AGENTS.md +11 -0
  526. package/examples/moltnet-team-chat/teams/field/agents/representative/Spawnfile +26 -0
  527. package/examples/single-agent/AGENTS.md +3 -0
  528. package/examples/single-agent/HEARTBEAT.md +3 -0
  529. package/examples/single-agent/IDENTITY.md +3 -0
  530. package/examples/single-agent/MEMORY.md +3 -0
  531. package/examples/single-agent/SOUL.md +3 -0
  532. package/examples/single-agent/Spawnfile +41 -0
  533. package/examples/single-agent/skills/web_search/SKILL.md +6 -0
  534. package/moltnet-releases.json +5 -4
  535. package/package.json +36 -9
  536. package/runtimes.yaml +5 -2
  537. package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +0 -13
  538. package/dist/cli/targetWorldClockCrossProcess.test-helper.js +0 -109
  539. package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +0 -8
  540. package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +0 -60
  541. package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +0 -8
  542. package/dist/deployment/simfileFixtureBoundary.test-helper.js +0 -103
  543. package/dist/ownership/simfileRunOperatorInputs.d.ts +0 -103
  544. package/dist/ownership/simfileRunOperatorInputs.js +0 -139
  545. package/dist/target/cleanupRunDocker.test-helper.d.ts +0 -67
  546. package/dist/target/cleanupRunDocker.test-helper.js +0 -238
@@ -0,0 +1,295 @@
1
+ export declare const DAIMON_CONTRACT_MANIFEST_VERSION: "noopolis.daimon.runtime-contract-manifest.v3";
2
+ export declare const DAIMON_CONTRACT_MANIFEST_SHA256: "sha256:c672ed47e4a01a75f1482ea6e4b6ecb28205aab344741a10cad8783f5501b6c4";
3
+ export declare const DAIMON_CONTRACT_MANIFEST_FILE = "contract-manifest.json";
4
+ export declare const DAIMON_CONTRACT_MANIFEST_DIGEST_FILE = "contract-manifest.sha256";
5
+ export declare const DAIMON_RUNTIME_HOME_ROOT = "/var/lib/spawnfile/instances/daimon";
6
+ export declare const DAIMON_ENGINE_KINDS: readonly ["agy", "codex", "grok"];
7
+ export declare const DAIMON_ORGANIZATION_RUNTIME_CONFIG_VERSIONS: readonly ["noopolis.daimon.organization-runtime.v1", "noopolis.daimon.organization-runtime.v2"];
8
+ export declare const DAIMON_ENGINE_CREDENTIALS: {
9
+ readonly codex: {
10
+ readonly destinationRelativePath: ".codex/auth.json";
11
+ readonly directoryMode: 448;
12
+ readonly fileMode: 384;
13
+ readonly sourceRelativePath: ".daimon-inbound/codex-auth";
14
+ readonly sourceSlot: "codex-auth";
15
+ };
16
+ };
17
+ export declare const DAIMON_GROK_SUBSCRIPTION_REALM: {
18
+ readonly agentCredentialRelativePath: ".grok/auth.json";
19
+ readonly bootstrapMountPath: "/var/lib/spawnfile/daimon/grok-bootstrap-auth";
20
+ readonly bootstrapSourceSlot: "grok-auth";
21
+ readonly directoryMode: 448;
22
+ readonly durableMountPath: "/var/lib/spawnfile/daimon/grok-subscription-realm";
23
+ readonly fileMode: 384;
24
+ readonly maxCredentialBytes: number;
25
+ };
26
+ export declare const DAIMON_GROK_BROKER_MODELS: readonly ["grok-4.6", "grok-4.5", "grok-build"];
27
+ export declare const DAIMON_GROK_BROKER_REASONING_EFFORTS: readonly ["low", "medium", "high"];
28
+ export type DaimonGrokBrokerModel = typeof DAIMON_GROK_BROKER_MODELS[number];
29
+ export type DaimonGrokBrokerReasoningEffort = typeof DAIMON_GROK_BROKER_REASONING_EFFORTS[number];
30
+ /**
31
+ * Byte mirror of Daimon's `GROK_ENGINE_BROKER` (daimon
32
+ * `src/contracts/runtimeContractManifest.ts`), attested key-for-key against the
33
+ * vendored `contract-manifest.json` by `parseDaimonContractManifest`.
34
+ */
35
+ export declare const DAIMON_GROK_ENGINE_BROKER: {
36
+ readonly nativeAbiVersion: 2;
37
+ readonly nativeExecutablePath: "/opt/daimon/bin/daimon-engine-broker";
38
+ readonly grokExecutablePath: "/usr/local/bin/grok";
39
+ readonly registrationPath: "/etc/daimon-engine-broker/registrations.bin";
40
+ readonly credentialHomePath: "/var/lib/spawnfile/daimon/grok-subscription-realm";
41
+ readonly turnStorePath: "/var/lib/spawnfile/daimon/grok-subscription-realm/turns";
42
+ readonly controlSocketPath: "/run/daimon-engine-broker/control.sock";
43
+ readonly backendSocketPath: "/run/daimon-engine-broker/backend.sock";
44
+ readonly launcherSocketPath: "/run/daimon-engine-broker/launcher.sock";
45
+ readonly serviceConfigPath: "/etc/daimon-engine-broker/service.json";
46
+ readonly providerProxy: {
47
+ readonly host: "127.0.0.1";
48
+ readonly port: 43123;
49
+ };
50
+ readonly mcpFacade: {
51
+ readonly host: "127.0.0.1";
52
+ readonly port: 43124;
53
+ readonly path: "/mcp";
54
+ };
55
+ readonly identities: {
56
+ readonly organizationUid: 2000;
57
+ readonly brokerUid: 2100;
58
+ readonly firstWorkerUid: 2200;
59
+ };
60
+ readonly grokCliVersion: "1.0.34";
61
+ readonly grokCliBuild: "3736acbc8658";
62
+ readonly grokCliArtifacts: {
63
+ readonly arm64: {
64
+ readonly url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-aarch64";
65
+ readonly sha256: "39ab87666877d64ef3a40aa60fbe0c3b6a6acd7001b78fe60e2c76bb6cfc4a94";
66
+ readonly bytes: 136090504;
67
+ };
68
+ readonly x64: {
69
+ readonly url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-x86_64";
70
+ readonly sha256: "be5905e107d2b8b5f3c142d21ecfe4c8fd32a913d2fd551b788707930c4dc80d";
71
+ readonly bytes: 163035648;
72
+ };
73
+ };
74
+ readonly worker: {
75
+ readonly modelId: "daimon-broker-grok";
76
+ readonly models: readonly ["grok-4.6", "grok-4.5", "grok-build"];
77
+ readonly reasoningEfforts: readonly ["low", "medium", "high"];
78
+ readonly defaultModel: "grok-4.6";
79
+ readonly defaultReasoningEffort: "low";
80
+ readonly toolIds: readonly ["run_terminal_cmd", "read_file", "grep", "list_dir", "search_tool", "use_tool"];
81
+ readonly visibleTools: readonly ["grep", "list_dir", "read_file", "run_terminal_command", "search_tool", "use_tool"];
82
+ readonly maxTurns: 48;
83
+ readonly systemPromptSha256: "2c31c0085a54a4efbf9c0cf0b8124c56e47f38691b7f0c7fa233a74abaa8ddf8";
84
+ readonly configSha256: {
85
+ readonly "grok-4.6": {
86
+ readonly low: "ab58499ac32678097c146479896f2b8a8e2b0e39aea22dc0a60b6227e370538e";
87
+ readonly medium: "df1a5cc84346e7f6bf6090492fbd19faaefb42953e3bb2e8c6cbc0572242403f";
88
+ readonly high: "65b0212564fb74042b1503d293fb8d3620276033264c0efade2a539ca09218e3";
89
+ };
90
+ readonly "grok-4.5": {
91
+ readonly low: "8247127c3625ff7c5d8d527a53596b89ec6557a821ac46cfd00bd122b90daff6";
92
+ readonly medium: "59288cee61297bb8c002097061a48f77b09d310754187a253ee089f7172a9155";
93
+ readonly high: "c63c3387ce92d94ec3f690abfe98942afcd7c9e17ff84816bbe751f340ab251f";
94
+ };
95
+ readonly "grok-build": {
96
+ readonly low: "fb343f2809903f26d21681470943235031f946e99085542fd89555eb7782cbb5";
97
+ readonly medium: "8a587ef75c90eab70d19b24583e60051d6fba9d90c558839fdbb15588b4cc656";
98
+ readonly high: "a23724e00d670caee185ba7690d2daa868173e53905cf446f5329666f01ab4e3";
99
+ };
100
+ };
101
+ readonly home: {
102
+ readonly directory: {
103
+ readonly uid: 0;
104
+ readonly group: "worker";
105
+ readonly mode: 1017;
106
+ };
107
+ readonly sessionsDirectory: {
108
+ readonly relativePath: "sessions";
109
+ readonly uid: 0;
110
+ readonly group: "worker";
111
+ readonly mode: 1017;
112
+ };
113
+ readonly readOnlyFiles: {
114
+ readonly names: readonly ["config.toml", "managed_config.toml", "requirements.toml", "sandbox.toml", "trusted_folders.toml"];
115
+ readonly uid: 0;
116
+ readonly gid: 0;
117
+ readonly mode: 292;
118
+ };
119
+ readonly sandboxEvents: {
120
+ readonly relativePath: "sessions/sandbox-events.jsonl";
121
+ readonly owner: "worker";
122
+ readonly group: "broker";
123
+ readonly mode: 416;
124
+ };
125
+ readonly privateTmp: {
126
+ readonly relativeToWorkerHome: "tmp";
127
+ readonly owner: "worker";
128
+ readonly mode: 448;
129
+ };
130
+ readonly sharedTmp: {
131
+ readonly paths: readonly ["/tmp", "/var/tmp"];
132
+ readonly uid: 0;
133
+ readonly maxGroupExclusive: 2200;
134
+ readonly otherMode: 4;
135
+ readonly mode: 1020;
136
+ };
137
+ readonly organizationRuntimeHome: {
138
+ readonly owner: "organization";
139
+ readonly group: "worker";
140
+ readonly mode: 456;
141
+ };
142
+ readonly spillDirectory: {
143
+ readonly relativeToRuntimeHome: "tool-output";
144
+ readonly owner: "organization";
145
+ readonly group: "worker";
146
+ readonly mode: 1512;
147
+ readonly fileMode: 416;
148
+ };
149
+ };
150
+ };
151
+ readonly bounds: {
152
+ readonly promptBytes: 65536;
153
+ readonly capabilityBytes: 4096;
154
+ readonly capabilityBundleBytes: 8196;
155
+ readonly outputBytes: 262144;
156
+ };
157
+ readonly controlProtocolVersion: "noopolis.daimon.engine-broker.v2";
158
+ readonly turnRecordVersions: readonly ["noopolis.daimon.engine-broker-turn.v1", "noopolis.daimon.engine-broker-turn.v2"];
159
+ readonly serviceConfigVersions: readonly ["noopolis.daimon.engine-broker-service.v1", "noopolis.daimon.engine-broker-service.v2"];
160
+ readonly turnLimits: {
161
+ readonly keys: readonly ["maxRequests", "maxTokens", "timeoutMs"];
162
+ readonly v1Defaults: {
163
+ readonly maxRequests: 32;
164
+ readonly maxTokens: 300000;
165
+ readonly timeoutMs: 240000;
166
+ };
167
+ readonly bounds: {
168
+ readonly maxRequests: readonly [1, 48];
169
+ readonly maxTokens: readonly [1, 10000000];
170
+ readonly timeoutMs: readonly [1000, 3600000];
171
+ };
172
+ readonly limitReasons: readonly ["tokens", "requests", "timeout", "none"];
173
+ readonly wakeMayOnlyLower: true;
174
+ readonly tokenCeilingOvershoot: "at-most-one-request";
175
+ readonly maxInFlightRequests: 1;
176
+ readonly requestUsageMaxTokens: 500000;
177
+ readonly missingUsageEstimate: {
178
+ readonly inputBytesPerToken: 2;
179
+ readonly outputTokens: 4096;
180
+ };
181
+ };
182
+ readonly wakeLimitEnvironment: {
183
+ readonly timeoutMs: "DAIMON_ENGINE_WAKE_TIMEOUT_MS";
184
+ readonly maxTokens: "DAIMON_ENGINE_WAKE_TOKEN_CEILING";
185
+ };
186
+ readonly projectionVersion: "noopolis.daimon.grok-broker-projection.v1";
187
+ readonly slotPreflightVersion: "noopolis.daimon.grok-slot-preflight.v2";
188
+ readonly inferenceGrants: {
189
+ readonly requestKinds: readonly ["request_inference_grant", "release_inference_grant"];
190
+ readonly purposes: readonly ["judge", "optimizer"];
191
+ readonly tokenPrefix: "inference_";
192
+ readonly ttlMs: 600000;
193
+ readonly limits: {
194
+ readonly maxRequests: 64;
195
+ readonly maxTokens: 2000000;
196
+ };
197
+ readonly maxLiveGrants: 8;
198
+ readonly maxInFlightRequestsPerGrant: 1;
199
+ readonly bodyMembers: readonly ["messages", "model", "reasoning_effort", "response_format", "stream", "stream_options"];
200
+ readonly messageRoles: readonly ["system", "user", "assistant"];
201
+ readonly failureCodes: readonly ["auth_stale", "grant_limit", "invalid_request", "unavailable"];
202
+ readonly ledgerVersion: "noopolis.daimon.inference-usage.v1";
203
+ readonly ledgerDedupeKey: readonly ["grant", "request"];
204
+ readonly client: {
205
+ readonly modelId: "daimon-inference-grok";
206
+ readonly envKey: "DAIMON_INFERENCE_GRANT";
207
+ readonly configSha256: {
208
+ readonly "grok-4.6": {
209
+ readonly low: "79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f";
210
+ readonly medium: "6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8";
211
+ readonly high: "5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac";
212
+ };
213
+ readonly "grok-4.5": {
214
+ readonly low: "a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74";
215
+ readonly medium: "1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9";
216
+ readonly high: "ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2";
217
+ };
218
+ readonly "grok-build": {
219
+ readonly low: "ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1";
220
+ readonly medium: "01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d";
221
+ readonly high: "98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c";
222
+ };
223
+ };
224
+ };
225
+ };
226
+ readonly artifacts: {
227
+ readonly sourceSha256: "dd39aacfece496cc6528f6acdb4f1066a848a0fb5b0961f5c70b0ba00440dc24";
228
+ readonly x64Sha256: "67e3624d3198e9c59e1ffafa4eca7c895dfe265d5b8bb0614cb547b68b8b93a7";
229
+ readonly arm64Sha256: "c07d22225ff968bc289e5ddf0981cdd5d64040eee6e3ea45da7d03e1439dea98";
230
+ };
231
+ };
232
+ /**
233
+ * Where the Daimon broker writes its per-turn usage ledger, and what this
234
+ * compiler provisions. Deliberately kept out of `DAIMON_GROK_ENGINE_BROKER`:
235
+ * that object's canonical bytes are digest-pinned and attested against the
236
+ * runtime image at compile time, so a new key there would make every pinned
237
+ * image fail to attest. Mirrors `TURN_USAGE_LEDGER` in
238
+ * `daimon/src/runtime/turnUsageLedger.ts`.
239
+ */
240
+ export declare const DAIMON_GROK_TURN_USAGE_LEDGER: {
241
+ readonly version: "noopolis.daimon.turn-usage.v1";
242
+ readonly directoryPath: "/var/lib/spawnfile/daimon/usage";
243
+ readonly filePath: "/var/lib/spawnfile/daimon/usage/usage.jsonl";
244
+ readonly rotatedFilePath: "/var/lib/spawnfile/daimon/usage/usage.jsonl.1";
245
+ readonly directoryMode: 488;
246
+ readonly fileMode: 416;
247
+ /**
248
+ * Mirrors `TURN_USAGE_ROTATE_BYTES` in `daimon/src/runtime/turnUsageLedger.ts`
249
+ * (Spawnfile must not import from `daimon/`, so this is the Spawnfile-side
250
+ * copy of the same agreed number). It is a LOWER bound on the size of a
251
+ * rotated generation, not an upper one: the broker rotates on the append
252
+ * *after* the file reaches this size, so `usage.jsonl.1` is always at least
253
+ * this large and the line that crossed the bound overshoots it. Anything
254
+ * sizing a read of one generation must therefore leave headroom above this
255
+ * number rather than matching it (see
256
+ * `DEFAULT_DOCKER_PROBE_MAX_BUFFER_BYTES`).
257
+ */
258
+ readonly rotateBytes: number;
259
+ };
260
+ export declare const DAIMON_AGY_SUBSCRIPTION_REALM: {
261
+ readonly directoryMode: 448;
262
+ readonly durableMountPath: "/var/lib/spawnfile/daimon/agy-subscription-realm";
263
+ readonly fileMode: 384;
264
+ readonly maxUnlockBytes: 4096;
265
+ readonly unlockMountPath: "/var/lib/spawnfile/daimon/agy-unlock-secret";
266
+ readonly unlockSourceSlot: "agy-unlock-secret";
267
+ };
268
+ export type DaimonEngine = typeof DAIMON_ENGINE_KINDS[number];
269
+ export type DaimonPortableEngine = keyof typeof DAIMON_ENGINE_CREDENTIALS;
270
+ type DaimonCredentialMaterial = (typeof DAIMON_ENGINE_CREDENTIALS)[DaimonPortableEngine];
271
+ export interface DaimonContractManifest {
272
+ readonly agySubscriptionRealm: typeof DAIMON_AGY_SUBSCRIPTION_REALM;
273
+ readonly consumedConfigFields: readonly string[];
274
+ readonly engineCredentialMaterial: Readonly<Record<DaimonPortableEngine, DaimonCredentialMaterial>>;
275
+ readonly grokSubscriptionRealm: typeof DAIMON_GROK_SUBSCRIPTION_REALM;
276
+ readonly grokEngineBroker: typeof DAIMON_GROK_ENGINE_BROKER;
277
+ readonly supportedEngineKinds: readonly DaimonEngine[];
278
+ readonly wakeAcceptanceTypes: readonly ["manual", "message", "schedule", "external"];
279
+ readonly deliverySemantics: Readonly<{
280
+ activeDeliveryIdempotency: "unbounded-until-terminal";
281
+ terminalReceiptHorizon: 2_048;
282
+ recovery: "at-least-once-with-stable-wake-id";
283
+ concurrentSameAgentTurns: false;
284
+ externalEffectsExactlyOnce: false;
285
+ }>;
286
+ readonly version: typeof DAIMON_CONTRACT_MANIFEST_VERSION;
287
+ }
288
+ export interface VerifiedDaimonContractManifest {
289
+ readonly digest: `sha256:${string}`;
290
+ readonly manifest: DaimonContractManifest;
291
+ }
292
+ export declare const parseDaimonContractManifest: (raw: unknown) => DaimonContractManifest;
293
+ export declare const assertDaimonRuntimeHome: (candidate: string) => string;
294
+ export declare const readVerifiedDaimonContractManifest: (runtimeRoot: string) => Promise<VerifiedDaimonContractManifest>;
295
+ export {};
@@ -0,0 +1,319 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFile } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { SpawnfileError } from "../../shared/index.js";
5
+ export const DAIMON_CONTRACT_MANIFEST_VERSION = "noopolis.daimon.runtime-contract-manifest.v3";
6
+ export const DAIMON_CONTRACT_MANIFEST_SHA256 = "sha256:c672ed47e4a01a75f1482ea6e4b6ecb28205aab344741a10cad8783f5501b6c4";
7
+ export const DAIMON_CONTRACT_MANIFEST_FILE = "contract-manifest.json";
8
+ export const DAIMON_CONTRACT_MANIFEST_DIGEST_FILE = "contract-manifest.sha256";
9
+ export const DAIMON_RUNTIME_HOME_ROOT = "/var/lib/spawnfile/instances/daimon";
10
+ export const DAIMON_ENGINE_KINDS = ["agy", "codex", "grok"];
11
+ export const DAIMON_ORGANIZATION_RUNTIME_CONFIG_VERSIONS = ["noopolis.daimon.organization-runtime.v1", "noopolis.daimon.organization-runtime.v2"];
12
+ export const DAIMON_ENGINE_CREDENTIALS = {
13
+ codex: {
14
+ destinationRelativePath: ".codex/auth.json",
15
+ directoryMode: 0o700,
16
+ fileMode: 0o600,
17
+ sourceRelativePath: ".daimon-inbound/codex-auth",
18
+ sourceSlot: "codex-auth"
19
+ },
20
+ };
21
+ export const DAIMON_GROK_SUBSCRIPTION_REALM = {
22
+ agentCredentialRelativePath: ".grok/auth.json",
23
+ bootstrapMountPath: "/var/lib/spawnfile/daimon/grok-bootstrap-auth",
24
+ bootstrapSourceSlot: "grok-auth",
25
+ directoryMode: 0o700,
26
+ durableMountPath: "/var/lib/spawnfile/daimon/grok-subscription-realm",
27
+ fileMode: 0o600,
28
+ maxCredentialBytes: 64 * 1024
29
+ };
30
+ export const DAIMON_GROK_BROKER_MODELS = ["grok-4.6", "grok-4.5", "grok-build"];
31
+ export const DAIMON_GROK_BROKER_REASONING_EFFORTS = ["low", "medium", "high"];
32
+ /**
33
+ * Byte mirror of Daimon's `GROK_ENGINE_BROKER` (daimon
34
+ * `src/contracts/runtimeContractManifest.ts`), attested key-for-key against the
35
+ * vendored `contract-manifest.json` by `parseDaimonContractManifest`.
36
+ */
37
+ export const DAIMON_GROK_ENGINE_BROKER = {
38
+ nativeAbiVersion: 2,
39
+ nativeExecutablePath: "/opt/daimon/bin/daimon-engine-broker",
40
+ grokExecutablePath: "/usr/local/bin/grok",
41
+ registrationPath: "/etc/daimon-engine-broker/registrations.bin",
42
+ credentialHomePath: "/var/lib/spawnfile/daimon/grok-subscription-realm",
43
+ turnStorePath: "/var/lib/spawnfile/daimon/grok-subscription-realm/turns",
44
+ controlSocketPath: "/run/daimon-engine-broker/control.sock",
45
+ backendSocketPath: "/run/daimon-engine-broker/backend.sock",
46
+ launcherSocketPath: "/run/daimon-engine-broker/launcher.sock",
47
+ serviceConfigPath: "/etc/daimon-engine-broker/service.json",
48
+ providerProxy: { host: "127.0.0.1", port: 43_123 },
49
+ mcpFacade: { host: "127.0.0.1", port: 43_124, path: "/mcp" },
50
+ identities: { organizationUid: 2_000, brokerUid: 2_100, firstWorkerUid: 2_200 },
51
+ grokCliVersion: "1.0.34",
52
+ grokCliBuild: "3736acbc8658",
53
+ grokCliArtifacts: {
54
+ arm64: { url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-aarch64", sha256: "39ab87666877d64ef3a40aa60fbe0c3b6a6acd7001b78fe60e2c76bb6cfc4a94", bytes: 136_090_504 },
55
+ x64: { url: "https://storage.googleapis.com/grok-build-public-artifacts/cli/grok-1.0.34-linux-x86_64", sha256: "be5905e107d2b8b5f3c142d21ecfe4c8fd32a913d2fd551b788707930c4dc80d", bytes: 163_035_648 }
56
+ },
57
+ worker: {
58
+ modelId: "daimon-broker-grok",
59
+ models: DAIMON_GROK_BROKER_MODELS,
60
+ reasoningEfforts: DAIMON_GROK_BROKER_REASONING_EFFORTS,
61
+ defaultModel: "grok-4.6",
62
+ defaultReasoningEffort: "low",
63
+ toolIds: ["run_terminal_cmd", "read_file", "grep", "list_dir", "search_tool", "use_tool"],
64
+ visibleTools: ["grep", "list_dir", "read_file", "run_terminal_command", "search_tool", "use_tool"],
65
+ maxTurns: 48,
66
+ systemPromptSha256: "2c31c0085a54a4efbf9c0cf0b8124c56e47f38691b7f0c7fa233a74abaa8ddf8",
67
+ configSha256: {
68
+ "grok-4.6": { low: "ab58499ac32678097c146479896f2b8a8e2b0e39aea22dc0a60b6227e370538e", medium: "df1a5cc84346e7f6bf6090492fbd19faaefb42953e3bb2e8c6cbc0572242403f", high: "65b0212564fb74042b1503d293fb8d3620276033264c0efade2a539ca09218e3" },
69
+ "grok-4.5": { low: "8247127c3625ff7c5d8d527a53596b89ec6557a821ac46cfd00bd122b90daff6", medium: "59288cee61297bb8c002097061a48f77b09d310754187a253ee089f7172a9155", high: "c63c3387ce92d94ec3f690abfe98942afcd7c9e17ff84816bbe751f340ab251f" },
70
+ "grok-build": { low: "fb343f2809903f26d21681470943235031f946e99085542fd89555eb7782cbb5", medium: "8a587ef75c90eab70d19b24583e60051d6fba9d90c558839fdbb15588b4cc656", high: "a23724e00d670caee185ba7690d2daa868173e53905cf446f5329666f01ab4e3" }
71
+ },
72
+ home: {
73
+ directory: { uid: 0, group: "worker", mode: 0o1771 },
74
+ sessionsDirectory: { relativePath: "sessions", uid: 0, group: "worker", mode: 0o1771 },
75
+ readOnlyFiles: { names: ["config.toml", "managed_config.toml", "requirements.toml", "sandbox.toml", "trusted_folders.toml"], uid: 0, gid: 0, mode: 0o444 },
76
+ sandboxEvents: { relativePath: "sessions/sandbox-events.jsonl", owner: "worker", group: "broker", mode: 0o640 },
77
+ privateTmp: { relativeToWorkerHome: "tmp", owner: "worker", mode: 0o700 },
78
+ sharedTmp: { paths: ["/tmp", "/var/tmp"], uid: 0, maxGroupExclusive: 2_200, otherMode: 0o4, mode: 0o1774 },
79
+ organizationRuntimeHome: { owner: "organization", group: "worker", mode: 0o710 },
80
+ spillDirectory: { relativeToRuntimeHome: "tool-output", owner: "organization", group: "worker", mode: 0o2750, fileMode: 0o640 }
81
+ }
82
+ },
83
+ bounds: { promptBytes: 65_536, capabilityBytes: 4_096, capabilityBundleBytes: 8_196, outputBytes: 262_144 },
84
+ controlProtocolVersion: "noopolis.daimon.engine-broker.v2",
85
+ turnRecordVersions: ["noopolis.daimon.engine-broker-turn.v1", "noopolis.daimon.engine-broker-turn.v2"],
86
+ serviceConfigVersions: ["noopolis.daimon.engine-broker-service.v1", "noopolis.daimon.engine-broker-service.v2"],
87
+ turnLimits: {
88
+ keys: ["maxRequests", "maxTokens", "timeoutMs"],
89
+ v1Defaults: { maxRequests: 32, maxTokens: 300_000, timeoutMs: 240_000 },
90
+ bounds: { maxRequests: [1, 48], maxTokens: [1, 10_000_000], timeoutMs: [1_000, 3_600_000] },
91
+ limitReasons: ["tokens", "requests", "timeout", "none"],
92
+ wakeMayOnlyLower: true,
93
+ tokenCeilingOvershoot: "at-most-one-request",
94
+ maxInFlightRequests: 1,
95
+ requestUsageMaxTokens: 500_000,
96
+ missingUsageEstimate: { inputBytesPerToken: 2, outputTokens: 4_096 }
97
+ },
98
+ wakeLimitEnvironment: { timeoutMs: "DAIMON_ENGINE_WAKE_TIMEOUT_MS", maxTokens: "DAIMON_ENGINE_WAKE_TOKEN_CEILING" },
99
+ projectionVersion: "noopolis.daimon.grok-broker-projection.v1",
100
+ slotPreflightVersion: "noopolis.daimon.grok-slot-preflight.v2",
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
+ bodyMembers: ["messages", "model", "reasoning_effort", "response_format", "stream", "stream_options"],
110
+ messageRoles: ["system", "user", "assistant"],
111
+ failureCodes: ["auth_stale", "grant_limit", "invalid_request", "unavailable"],
112
+ ledgerVersion: "noopolis.daimon.inference-usage.v1",
113
+ ledgerDedupeKey: ["grant", "request"],
114
+ client: {
115
+ modelId: "daimon-inference-grok",
116
+ envKey: "DAIMON_INFERENCE_GRANT",
117
+ configSha256: {
118
+ "grok-4.6": { low: "79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f", medium: "6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8", high: "5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac" },
119
+ "grok-4.5": { low: "a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74", medium: "1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9", high: "ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2" },
120
+ "grok-build": { low: "ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1", medium: "01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d", high: "98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c" }
121
+ }
122
+ }
123
+ },
124
+ artifacts: {
125
+ sourceSha256: "dd39aacfece496cc6528f6acdb4f1066a848a0fb5b0961f5c70b0ba00440dc24",
126
+ x64Sha256: "67e3624d3198e9c59e1ffafa4eca7c895dfe265d5b8bb0614cb547b68b8b93a7",
127
+ arm64Sha256: "c07d22225ff968bc289e5ddf0981cdd5d64040eee6e3ea45da7d03e1439dea98"
128
+ }
129
+ };
130
+ /**
131
+ * Where the Daimon broker writes its per-turn usage ledger, and what this
132
+ * compiler provisions. Deliberately kept out of `DAIMON_GROK_ENGINE_BROKER`:
133
+ * that object's canonical bytes are digest-pinned and attested against the
134
+ * runtime image at compile time, so a new key there would make every pinned
135
+ * image fail to attest. Mirrors `TURN_USAGE_LEDGER` in
136
+ * `daimon/src/runtime/turnUsageLedger.ts`.
137
+ */
138
+ export const DAIMON_GROK_TURN_USAGE_LEDGER = {
139
+ version: "noopolis.daimon.turn-usage.v1",
140
+ directoryPath: "/var/lib/spawnfile/daimon/usage",
141
+ filePath: "/var/lib/spawnfile/daimon/usage/usage.jsonl",
142
+ rotatedFilePath: "/var/lib/spawnfile/daimon/usage/usage.jsonl.1",
143
+ directoryMode: 0o750,
144
+ fileMode: 0o640,
145
+ /**
146
+ * Mirrors `TURN_USAGE_ROTATE_BYTES` in `daimon/src/runtime/turnUsageLedger.ts`
147
+ * (Spawnfile must not import from `daimon/`, so this is the Spawnfile-side
148
+ * copy of the same agreed number). It is a LOWER bound on the size of a
149
+ * rotated generation, not an upper one: the broker rotates on the append
150
+ * *after* the file reaches this size, so `usage.jsonl.1` is always at least
151
+ * this large and the line that crossed the bound overshoots it. Anything
152
+ * sizing a read of one generation must therefore leave headroom above this
153
+ * number rather than matching it (see
154
+ * `DEFAULT_DOCKER_PROBE_MAX_BUFFER_BYTES`).
155
+ */
156
+ rotateBytes: 64 * 1024 * 1024
157
+ };
158
+ export const DAIMON_AGY_SUBSCRIPTION_REALM = {
159
+ directoryMode: 0o700,
160
+ durableMountPath: "/var/lib/spawnfile/daimon/agy-subscription-realm",
161
+ fileMode: 0o600,
162
+ maxUnlockBytes: 4_096,
163
+ unlockMountPath: "/var/lib/spawnfile/daimon/agy-unlock-secret",
164
+ unlockSourceSlot: "agy-unlock-secret"
165
+ };
166
+ const SHA256 = /^[a-f0-9]{64}$/u;
167
+ const expectedConfigFields = [
168
+ "version", "host.bindHost", "host.port", "host.controlTokenEnv", "agents[].id",
169
+ "agents[].name", "agents[].instructions", "agents[].workspacePath",
170
+ "agents[].runtimeHomePath", "agents[].engine.kind", "agents[].engine.model",
171
+ "agents[].engine.reasoningEffort", "agents[].engine.codexSandbox", "agents[].schedule.kind",
172
+ "agents[].schedule.interval_ms", "agents[].schedule.cron",
173
+ "agents[].schedule.timezone", "agents[].schedule.prompt",
174
+ "agents[].schedule.jitter_seconds",
175
+ "agents[].mcp", "agents[].moltnet", "agents[].memory", "agents[].attention"
176
+ ];
177
+ const exactKeys = (value, keys) => Object.keys(value).sort().join("\0") === [...keys].sort().join("\0");
178
+ const fail = (message) => {
179
+ throw new SpawnfileError("runtime_error", `Daimon runtime contract manifest ${message}`);
180
+ };
181
+ const asRecord = (value, label) => {
182
+ if (!value || typeof value !== "object" || Array.isArray(value))
183
+ fail(`${label} must be an object`);
184
+ return value;
185
+ };
186
+ const canonicalJson = (value) => {
187
+ if (value === null || typeof value === "boolean" || typeof value === "number" || typeof value === "string") {
188
+ return JSON.stringify(value);
189
+ }
190
+ if (Array.isArray(value))
191
+ return `[${value.map(canonicalJson).join(",")}]`;
192
+ const record = asRecord(value, "JSON value");
193
+ return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(",")}}`;
194
+ };
195
+ const matchesCredentialMaterial = (value, expected) => {
196
+ const material = asRecord(value, "engine credential material");
197
+ return exactKeys(material, ["destinationRelativePath", "directoryMode", "fileMode", "sourceRelativePath", "sourceSlot"])
198
+ && material.destinationRelativePath === expected.destinationRelativePath
199
+ && material.directoryMode === expected.directoryMode
200
+ && material.fileMode === expected.fileMode
201
+ && material.sourceRelativePath === expected.sourceRelativePath
202
+ && material.sourceSlot === expected.sourceSlot;
203
+ };
204
+ const matchesAgyRealm = (value) => {
205
+ const realm = asRecord(value, "AGY subscription realm");
206
+ return exactKeys(realm, [
207
+ "directoryMode", "durableMountPath", "fileMode", "maxUnlockBytes",
208
+ "unlockMountPath", "unlockSourceSlot"
209
+ ])
210
+ && Object.entries(DAIMON_AGY_SUBSCRIPTION_REALM)
211
+ .every(([name, expected]) => realm[name] === expected);
212
+ };
213
+ const matchesGrokRealm = (value) => {
214
+ const realm = asRecord(value, "Grok subscription realm");
215
+ return exactKeys(realm, [
216
+ "agentCredentialRelativePath", "bootstrapMountPath", "bootstrapSourceSlot",
217
+ "directoryMode", "durableMountPath", "fileMode", "maxCredentialBytes"
218
+ ]) && Object.entries(DAIMON_GROK_SUBSCRIPTION_REALM)
219
+ .every(([name, expected]) => realm[name] === expected);
220
+ };
221
+ const matchesGrokEngineBroker = (value) => {
222
+ const broker = asRecord(value, "Grok engine broker");
223
+ if (!exactKeys(broker, Object.keys(DAIMON_GROK_ENGINE_BROKER)))
224
+ return false;
225
+ return canonicalJson(broker) === canonicalJson(DAIMON_GROK_ENGINE_BROKER);
226
+ };
227
+ export const parseDaimonContractManifest = (raw) => {
228
+ const root = asRecord(raw, "root");
229
+ if (root.version !== DAIMON_CONTRACT_MANIFEST_VERSION ||
230
+ !Array.isArray(root.supportedEngineKinds) ||
231
+ root.supportedEngineKinds.join("\0") !== "agy\0codex\0grok" ||
232
+ !Array.isArray(root.consumedConfigFields) ||
233
+ root.consumedConfigFields.join("\0") !== expectedConfigFields.join("\0") ||
234
+ !Array.isArray(root.wakeAcceptanceTypes) ||
235
+ root.wakeAcceptanceTypes.join("\0") !== "manual\0message\0schedule\0external")
236
+ return fail("has an unsupported version or configuration contract");
237
+ const v2 = asRecord(root.organizationRuntimeConfigV2Schema, "organizationRuntimeConfigV2Schema");
238
+ const v2Properties = asRecord(v2.properties, "organizationRuntimeConfigV2Schema.properties");
239
+ const v2Agents = asRecord(v2Properties.agents, "organizationRuntimeConfigV2Schema.properties.agents");
240
+ const v2Agent = asRecord(v2Agents.items, "organizationRuntimeConfigV2Schema.properties.agents.items");
241
+ const v2AgentProperties = asRecord(v2Agent.properties, "organizationRuntimeConfigV2Schema.properties.agents.items.properties");
242
+ const schedule = asRecord(v2AgentProperties.schedule, "organizationRuntimeConfigV2Schema schedule");
243
+ if (v2.$id !== "noopolis.daimon.organization-runtime.v2" || !Array.isArray(schedule.oneOf) || schedule.oneOf.length !== 3)
244
+ return fail("does not attest the organization runtime v2 schedule contract");
245
+ const semantics = asRecord(root.deliverySemantics, "deliverySemantics");
246
+ if (!exactKeys(semantics, ["activeDeliveryIdempotency", "terminalReceiptHorizon", "recovery", "concurrentSameAgentTurns", "externalEffectsExactlyOnce"]) ||
247
+ semantics.activeDeliveryIdempotency !== "unbounded-until-terminal" || semantics.terminalReceiptHorizon !== 2_048 ||
248
+ semantics.recovery !== "at-least-once-with-stable-wake-id" || semantics.concurrentSameAgentTurns !== false || semantics.externalEffectsExactlyOnce !== false)
249
+ return fail("has unsupported delivery semantics");
250
+ const materials = asRecord(root.engineCredentialMaterial, "engineCredentialMaterial");
251
+ if (!exactKeys(materials, ["codex"]))
252
+ return fail("has unsupported credential material");
253
+ for (const engine of ["codex"]) {
254
+ if (!matchesCredentialMaterial(materials[engine], DAIMON_ENGINE_CREDENTIALS[engine])) {
255
+ return fail(`has unsafe ${engine} credential material`);
256
+ }
257
+ }
258
+ if (!matchesAgyRealm(root.agySubscriptionRealm)) {
259
+ return fail("has unsafe AGY subscription realm material");
260
+ }
261
+ if (!matchesGrokRealm(root.grokSubscriptionRealm)) {
262
+ return fail("has unsafe Grok subscription realm material");
263
+ }
264
+ if (!matchesGrokEngineBroker(root.grokEngineBroker)) {
265
+ return fail("has unsafe Grok engine broker material");
266
+ }
267
+ return Object.freeze({
268
+ agySubscriptionRealm: Object.freeze({ ...DAIMON_AGY_SUBSCRIPTION_REALM }),
269
+ consumedConfigFields: Object.freeze([...expectedConfigFields]),
270
+ engineCredentialMaterial: Object.freeze({ ...DAIMON_ENGINE_CREDENTIALS }),
271
+ grokSubscriptionRealm: Object.freeze({ ...DAIMON_GROK_SUBSCRIPTION_REALM }),
272
+ grokEngineBroker: Object.freeze({ ...DAIMON_GROK_ENGINE_BROKER }),
273
+ supportedEngineKinds: Object.freeze([...DAIMON_ENGINE_KINDS]),
274
+ wakeAcceptanceTypes: Object.freeze(["manual", "message", "schedule", "external"]),
275
+ deliverySemantics: Object.freeze({
276
+ activeDeliveryIdempotency: "unbounded-until-terminal", terminalReceiptHorizon: 2_048,
277
+ recovery: "at-least-once-with-stable-wake-id", concurrentSameAgentTurns: false, externalEffectsExactlyOnce: false
278
+ }),
279
+ version: DAIMON_CONTRACT_MANIFEST_VERSION
280
+ });
281
+ };
282
+ export const assertDaimonRuntimeHome = (candidate) => {
283
+ if (!path.posix.isAbsolute(candidate))
284
+ fail("runtime home must be an absolute POSIX path");
285
+ const normalized = path.posix.normalize(candidate);
286
+ const relative = path.posix.relative(DAIMON_RUNTIME_HOME_ROOT, normalized);
287
+ if (!relative || relative === ".." || relative.startsWith("../") || path.posix.isAbsolute(relative)) {
288
+ fail("runtime home escapes the caller-owned Daimon root");
289
+ }
290
+ return normalized;
291
+ };
292
+ export const readVerifiedDaimonContractManifest = async (runtimeRoot) => {
293
+ const manifestPath = path.join(runtimeRoot, DAIMON_CONTRACT_MANIFEST_FILE);
294
+ const digestPath = path.join(runtimeRoot, DAIMON_CONTRACT_MANIFEST_DIGEST_FILE);
295
+ let bytes;
296
+ let sidecar;
297
+ try {
298
+ [bytes, sidecar] = await Promise.all([readFile(manifestPath), readFile(digestPath, "utf8")]);
299
+ }
300
+ catch {
301
+ return fail("is missing its packaged bytes or digest sidecar");
302
+ }
303
+ const source = bytes.toString("utf8");
304
+ if (!source.endsWith("\n") || source.includes("\r"))
305
+ return fail("is not canonical UTF-8 JSON");
306
+ let parsed;
307
+ try {
308
+ parsed = JSON.parse(source);
309
+ }
310
+ catch {
311
+ return fail("is not valid JSON");
312
+ }
313
+ if (`${canonicalJson(parsed)}\n` !== source)
314
+ return fail("is not canonical JSON");
315
+ const digest = createHash("sha256").update(bytes).digest("hex");
316
+ if (sidecar !== `sha256:${digest}\n` || !SHA256.test(digest))
317
+ return fail("digest sidecar does not match its bytes");
318
+ return Object.freeze({ digest: `sha256:${digest}`, manifest: parseDaimonContractManifest(parsed) });
319
+ };
@@ -0,0 +1,19 @@
1
+ import type { ResolvedAgentNode } from "../../compiler/types.js";
2
+ import { type DaimonGrokBrokerModel, type DaimonGrokBrokerReasoningEffort } from "./contractManifest.js";
3
+ export interface DaimonGrokModel {
4
+ model: DaimonGrokBrokerModel;
5
+ reasoningEffort: DaimonGrokBrokerReasoningEffort;
6
+ }
7
+ /**
8
+ * The declared model of one brokered Daimon Grok agent.
9
+ *
10
+ * Every Grok agent runs through Daimon's engine broker, whose worker
11
+ * `config.toml` bytes are pinned per model x effort and whose provider proxy
12
+ * refuses any request body carrying another pair. Nothing may be inherited: Grok
13
+ * 1.0.34 silently drops an effort a model does not declare and its catalog
14
+ * default for `grok-4.6` is `high`, so the declaration is required in full —
15
+ * `execution.model.primary` with `provider: xai`, a name from Daimon's closed
16
+ * list, a target-level `auth.method: grok`, and `reasoning_effort` — and there
17
+ * is exactly one model (no fallback, no legacy model-level auth).
18
+ */
19
+ export declare const resolveDaimonGrokModel: (node: ResolvedAgentNode) => DaimonGrokModel;