@decionis/agentsafe 0.1.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 (436) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +909 -0
  4. package/dist/Cli.d.ts +3 -0
  5. package/dist/Cli.d.ts.map +1 -0
  6. package/dist/Cli.js +150 -0
  7. package/dist/Cli.js.map +1 -0
  8. package/dist/Index.d.ts +104 -0
  9. package/dist/Index.d.ts.map +1 -0
  10. package/dist/Index.js +102 -0
  11. package/dist/Index.js.map +1 -0
  12. package/dist/Serve.d.ts +26 -0
  13. package/dist/Serve.d.ts.map +1 -0
  14. package/dist/Serve.js +143 -0
  15. package/dist/Serve.js.map +1 -0
  16. package/dist/TrustedExecutor.d.ts +66 -0
  17. package/dist/TrustedExecutor.d.ts.map +1 -0
  18. package/dist/TrustedExecutor.js +170 -0
  19. package/dist/TrustedExecutor.js.map +1 -0
  20. package/dist/Version.d.ts +6 -0
  21. package/dist/Version.d.ts.map +1 -0
  22. package/dist/Version.js +21 -0
  23. package/dist/Version.js.map +1 -0
  24. package/dist/adapters/AdapterActionHandler.d.ts +48 -0
  25. package/dist/adapters/AdapterActionHandler.d.ts.map +1 -0
  26. package/dist/adapters/AdapterActionHandler.js +148 -0
  27. package/dist/adapters/AdapterActionHandler.js.map +1 -0
  28. package/dist/adapters/EffectAdapter.d.ts +96 -0
  29. package/dist/adapters/EffectAdapter.d.ts.map +1 -0
  30. package/dist/adapters/EffectAdapter.js +16 -0
  31. package/dist/adapters/EffectAdapter.js.map +1 -0
  32. package/dist/adapters/EffectAwareGrantVerifier.d.ts +30 -0
  33. package/dist/adapters/EffectAwareGrantVerifier.d.ts.map +1 -0
  34. package/dist/adapters/EffectAwareGrantVerifier.js +38 -0
  35. package/dist/adapters/EffectAwareGrantVerifier.js.map +1 -0
  36. package/dist/adapters/EffectComparison.d.ts +20 -0
  37. package/dist/adapters/EffectComparison.d.ts.map +1 -0
  38. package/dist/adapters/EffectComparison.js +48 -0
  39. package/dist/adapters/EffectComparison.js.map +1 -0
  40. package/dist/adapters/EffectEvidenceBuilder.d.ts +60 -0
  41. package/dist/adapters/EffectEvidenceBuilder.d.ts.map +1 -0
  42. package/dist/adapters/EffectEvidenceBuilder.js +127 -0
  43. package/dist/adapters/EffectEvidenceBuilder.js.map +1 -0
  44. package/dist/adapters/EffectEvidenceRegister.d.ts +31 -0
  45. package/dist/adapters/EffectEvidenceRegister.d.ts.map +1 -0
  46. package/dist/adapters/EffectEvidenceRegister.js +21 -0
  47. package/dist/adapters/EffectEvidenceRegister.js.map +1 -0
  48. package/dist/adapters/JcsDigest.d.ts +43 -0
  49. package/dist/adapters/JcsDigest.d.ts.map +1 -0
  50. package/dist/adapters/JcsDigest.js +86 -0
  51. package/dist/adapters/JcsDigest.js.map +1 -0
  52. package/dist/adapters/banking/BankingAction.d.ts +146 -0
  53. package/dist/adapters/banking/BankingAction.d.ts.map +1 -0
  54. package/dist/adapters/banking/BankingAction.js +102 -0
  55. package/dist/adapters/banking/BankingAction.js.map +1 -0
  56. package/dist/adapters/banking/BankingAdapter.d.ts +60 -0
  57. package/dist/adapters/banking/BankingAdapter.d.ts.map +1 -0
  58. package/dist/adapters/banking/BankingAdapter.js +107 -0
  59. package/dist/adapters/banking/BankingAdapter.js.map +1 -0
  60. package/dist/adapters/banking/BankingHandlers.d.ts +24 -0
  61. package/dist/adapters/banking/BankingHandlers.d.ts.map +1 -0
  62. package/dist/adapters/banking/BankingHandlers.js +47 -0
  63. package/dist/adapters/banking/BankingHandlers.js.map +1 -0
  64. package/dist/adapters/banking/BankingIntentBinder.d.ts +47 -0
  65. package/dist/adapters/banking/BankingIntentBinder.d.ts.map +1 -0
  66. package/dist/adapters/banking/BankingIntentBinder.js +64 -0
  67. package/dist/adapters/banking/BankingIntentBinder.js.map +1 -0
  68. package/dist/adapters/banking/CoreBankingHttpAdapter.d.ts +55 -0
  69. package/dist/adapters/banking/CoreBankingHttpAdapter.d.ts.map +1 -0
  70. package/dist/adapters/banking/CoreBankingHttpAdapter.js +248 -0
  71. package/dist/adapters/banking/CoreBankingHttpAdapter.js.map +1 -0
  72. package/dist/adapters/banking/Currency.d.ts +10 -0
  73. package/dist/adapters/banking/Currency.d.ts.map +1 -0
  74. package/dist/adapters/banking/Currency.js +91 -0
  75. package/dist/adapters/banking/Currency.js.map +1 -0
  76. package/dist/adapters/banking/EffectProjections.d.ts +52 -0
  77. package/dist/adapters/banking/EffectProjections.d.ts.map +1 -0
  78. package/dist/adapters/banking/EffectProjections.js +140 -0
  79. package/dist/adapters/banking/EffectProjections.js.map +1 -0
  80. package/dist/adapters/banking/Iban.d.ts +18 -0
  81. package/dist/adapters/banking/Iban.d.ts.map +1 -0
  82. package/dist/adapters/banking/Iban.js +38 -0
  83. package/dist/adapters/banking/Iban.js.map +1 -0
  84. package/dist/adapters/banking/Money.d.ts +32 -0
  85. package/dist/adapters/banking/Money.d.ts.map +1 -0
  86. package/dist/adapters/banking/Money.js +81 -0
  87. package/dist/adapters/banking/Money.js.map +1 -0
  88. package/dist/adapters/banking/ReasonCodes.d.ts +19 -0
  89. package/dist/adapters/banking/ReasonCodes.d.ts.map +1 -0
  90. package/dist/adapters/banking/ReasonCodes.js +35 -0
  91. package/dist/adapters/banking/ReasonCodes.js.map +1 -0
  92. package/dist/audit/ChainJournal.d.ts +38 -0
  93. package/dist/audit/ChainJournal.d.ts.map +1 -0
  94. package/dist/audit/ChainJournal.js +97 -0
  95. package/dist/audit/ChainJournal.js.map +1 -0
  96. package/dist/audit/HashChain.d.ts +39 -0
  97. package/dist/audit/HashChain.d.ts.map +1 -0
  98. package/dist/audit/HashChain.js +63 -0
  99. package/dist/audit/HashChain.js.map +1 -0
  100. package/dist/audit/HashChainedAuditSink.d.ts +22 -0
  101. package/dist/audit/HashChainedAuditSink.d.ts.map +1 -0
  102. package/dist/audit/HashChainedAuditSink.js +26 -0
  103. package/dist/audit/HashChainedAuditSink.js.map +1 -0
  104. package/dist/audit/LineAuditSink.d.ts +19 -0
  105. package/dist/audit/LineAuditSink.d.ts.map +1 -0
  106. package/dist/audit/LineAuditSink.js +35 -0
  107. package/dist/audit/LineAuditSink.js.map +1 -0
  108. package/dist/cli/Arguments.d.ts +26 -0
  109. package/dist/cli/Arguments.d.ts.map +1 -0
  110. package/dist/cli/Arguments.js +66 -0
  111. package/dist/cli/Arguments.js.map +1 -0
  112. package/dist/cli/CliProcess.d.ts +29 -0
  113. package/dist/cli/CliProcess.d.ts.map +1 -0
  114. package/dist/cli/CliProcess.js +78 -0
  115. package/dist/cli/CliProcess.js.map +1 -0
  116. package/dist/cli/Commands.d.ts +8 -0
  117. package/dist/cli/Commands.d.ts.map +1 -0
  118. package/dist/cli/Commands.js +67 -0
  119. package/dist/cli/Commands.js.map +1 -0
  120. package/dist/cli/ConfigCommand.d.ts +7 -0
  121. package/dist/cli/ConfigCommand.d.ts.map +1 -0
  122. package/dist/cli/ConfigCommand.js +77 -0
  123. package/dist/cli/ConfigCommand.js.map +1 -0
  124. package/dist/cli/ConfigFile.d.ts +21 -0
  125. package/dist/cli/ConfigFile.d.ts.map +1 -0
  126. package/dist/cli/ConfigFile.js +57 -0
  127. package/dist/cli/ConfigFile.js.map +1 -0
  128. package/dist/cli/Credentials.d.ts +15 -0
  129. package/dist/cli/Credentials.d.ts.map +1 -0
  130. package/dist/cli/Credentials.js +51 -0
  131. package/dist/cli/Credentials.js.map +1 -0
  132. package/dist/cli/Doctor.d.ts +25 -0
  133. package/dist/cli/Doctor.d.ts.map +1 -0
  134. package/dist/cli/Doctor.js +211 -0
  135. package/dist/cli/Doctor.js.map +1 -0
  136. package/dist/cli/Help.d.ts +3 -0
  137. package/dist/cli/Help.d.ts.map +1 -0
  138. package/dist/cli/Help.js +38 -0
  139. package/dist/cli/Help.js.map +1 -0
  140. package/dist/cli/Init.d.ts +32 -0
  141. package/dist/cli/Init.d.ts.map +1 -0
  142. package/dist/cli/Init.js +163 -0
  143. package/dist/cli/Init.js.map +1 -0
  144. package/dist/cli/Login.d.ts +16 -0
  145. package/dist/cli/Login.d.ts.map +1 -0
  146. package/dist/cli/Login.js +74 -0
  147. package/dist/cli/Login.js.map +1 -0
  148. package/dist/cli/Proxy.d.ts +41 -0
  149. package/dist/cli/Proxy.d.ts.map +1 -0
  150. package/dist/cli/Proxy.js +161 -0
  151. package/dist/cli/Proxy.js.map +1 -0
  152. package/dist/cli/Status.d.ts +7 -0
  153. package/dist/cli/Status.d.ts.map +1 -0
  154. package/dist/cli/Status.js +64 -0
  155. package/dist/cli/Status.js.map +1 -0
  156. package/dist/cli/TestCommand.d.ts +36 -0
  157. package/dist/cli/TestCommand.d.ts.map +1 -0
  158. package/dist/cli/TestCommand.js +173 -0
  159. package/dist/cli/TestCommand.js.map +1 -0
  160. package/dist/config/ConfigKeys.d.ts +10 -0
  161. package/dist/config/ConfigKeys.d.ts.map +1 -0
  162. package/dist/config/ConfigKeys.js +105 -0
  163. package/dist/config/ConfigKeys.js.map +1 -0
  164. package/dist/config/ExecutorConfig.d.ts +254 -0
  165. package/dist/config/ExecutorConfig.d.ts.map +1 -0
  166. package/dist/config/ExecutorConfig.js +637 -0
  167. package/dist/config/ExecutorConfig.js.map +1 -0
  168. package/dist/containment/ContainmentProbe.d.ts +87 -0
  169. package/dist/containment/ContainmentProbe.d.ts.map +1 -0
  170. package/dist/containment/ContainmentProbe.js +103 -0
  171. package/dist/containment/ContainmentProbe.js.map +1 -0
  172. package/dist/credential/CredentialError.d.ts +6 -0
  173. package/dist/credential/CredentialError.d.ts.map +1 -0
  174. package/dist/credential/CredentialError.js +10 -0
  175. package/dist/credential/CredentialError.js.map +1 -0
  176. package/dist/credential/DownstreamCredential.d.ts +38 -0
  177. package/dist/credential/DownstreamCredential.d.ts.map +1 -0
  178. package/dist/credential/DownstreamCredential.js +2 -0
  179. package/dist/credential/DownstreamCredential.js.map +1 -0
  180. package/dist/credential/GrantOf.d.ts +10 -0
  181. package/dist/credential/GrantOf.d.ts.map +1 -0
  182. package/dist/credential/GrantOf.js +16 -0
  183. package/dist/credential/GrantOf.js.map +1 -0
  184. package/dist/credential/PrivateKeyJwtCredential.d.ts +43 -0
  185. package/dist/credential/PrivateKeyJwtCredential.d.ts.map +1 -0
  186. package/dist/credential/PrivateKeyJwtCredential.js +126 -0
  187. package/dist/credential/PrivateKeyJwtCredential.js.map +1 -0
  188. package/dist/credential/SignedRequestCredential.d.ts +112 -0
  189. package/dist/credential/SignedRequestCredential.d.ts.map +1 -0
  190. package/dist/credential/SignedRequestCredential.js +255 -0
  191. package/dist/credential/SignedRequestCredential.js.map +1 -0
  192. package/dist/credential/StaticHeaderCredential.d.ts +16 -0
  193. package/dist/credential/StaticHeaderCredential.d.ts.map +1 -0
  194. package/dist/credential/StaticHeaderCredential.js +21 -0
  195. package/dist/credential/StaticHeaderCredential.js.map +1 -0
  196. package/dist/egress/EgressError.d.ts +13 -0
  197. package/dist/egress/EgressError.d.ts.map +1 -0
  198. package/dist/egress/EgressError.js +16 -0
  199. package/dist/egress/EgressError.js.map +1 -0
  200. package/dist/egress/EgressPolicy.d.ts +55 -0
  201. package/dist/egress/EgressPolicy.d.ts.map +1 -0
  202. package/dist/egress/EgressPolicy.js +137 -0
  203. package/dist/egress/EgressPolicy.js.map +1 -0
  204. package/dist/egress/GlobalFetchLock.d.ts +16 -0
  205. package/dist/egress/GlobalFetchLock.d.ts.map +1 -0
  206. package/dist/egress/GlobalFetchLock.js +34 -0
  207. package/dist/egress/GlobalFetchLock.js.map +1 -0
  208. package/dist/egress/GuardedFetch.d.ts +56 -0
  209. package/dist/egress/GuardedFetch.d.ts.map +1 -0
  210. package/dist/egress/GuardedFetch.js +300 -0
  211. package/dist/egress/GuardedFetch.js.map +1 -0
  212. package/dist/egress/TcpProbe.d.ts +35 -0
  213. package/dist/egress/TcpProbe.d.ts.map +1 -0
  214. package/dist/egress/TcpProbe.js +45 -0
  215. package/dist/egress/TcpProbe.js.map +1 -0
  216. package/dist/gateway/Activation.d.ts +39 -0
  217. package/dist/gateway/Activation.d.ts.map +1 -0
  218. package/dist/gateway/Activation.js +61 -0
  219. package/dist/gateway/Activation.js.map +1 -0
  220. package/dist/gateway/BoundaryTest.d.ts +92 -0
  221. package/dist/gateway/BoundaryTest.d.ts.map +1 -0
  222. package/dist/gateway/BoundaryTest.js +349 -0
  223. package/dist/gateway/BoundaryTest.js.map +1 -0
  224. package/dist/gateway/DemoAuthority.d.ts +41 -0
  225. package/dist/gateway/DemoAuthority.d.ts.map +1 -0
  226. package/dist/gateway/DemoAuthority.js +66 -0
  227. package/dist/gateway/DemoAuthority.js.map +1 -0
  228. package/dist/gateway/ForwardHandler.d.ts +56 -0
  229. package/dist/gateway/ForwardHandler.d.ts.map +1 -0
  230. package/dist/gateway/ForwardHandler.js +111 -0
  231. package/dist/gateway/ForwardHandler.js.map +1 -0
  232. package/dist/gateway/Gateway.d.ts +142 -0
  233. package/dist/gateway/Gateway.d.ts.map +1 -0
  234. package/dist/gateway/Gateway.js +819 -0
  235. package/dist/gateway/Gateway.js.map +1 -0
  236. package/dist/gateway/GatewayConfig.d.ts +237 -0
  237. package/dist/gateway/GatewayConfig.d.ts.map +1 -0
  238. package/dist/gateway/GatewayConfig.js +706 -0
  239. package/dist/gateway/GatewayConfig.js.map +1 -0
  240. package/dist/gateway/GatewayMetrics.d.ts +26 -0
  241. package/dist/gateway/GatewayMetrics.d.ts.map +1 -0
  242. package/dist/gateway/GatewayMetrics.js +28 -0
  243. package/dist/gateway/GatewayMetrics.js.map +1 -0
  244. package/dist/gateway/GatewayReport.d.ts +74 -0
  245. package/dist/gateway/GatewayReport.d.ts.map +1 -0
  246. package/dist/gateway/GatewayReport.js +109 -0
  247. package/dist/gateway/GatewayReport.js.map +1 -0
  248. package/dist/gateway/InterceptedRequest.d.ts +53 -0
  249. package/dist/gateway/InterceptedRequest.d.ts.map +1 -0
  250. package/dist/gateway/InterceptedRequest.js +80 -0
  251. package/dist/gateway/InterceptedRequest.js.map +1 -0
  252. package/dist/gateway/RouteTable.d.ts +28 -0
  253. package/dist/gateway/RouteTable.d.ts.map +1 -0
  254. package/dist/gateway/RouteTable.js +72 -0
  255. package/dist/gateway/RouteTable.js.map +1 -0
  256. package/dist/gateway/Upstream.d.ts +46 -0
  257. package/dist/gateway/Upstream.d.ts.map +1 -0
  258. package/dist/gateway/Upstream.js +158 -0
  259. package/dist/gateway/Upstream.js.map +1 -0
  260. package/dist/handlers/ForwardRequestHandler.d.ts +26 -0
  261. package/dist/handlers/ForwardRequestHandler.d.ts.map +1 -0
  262. package/dist/handlers/ForwardRequestHandler.js +98 -0
  263. package/dist/handlers/ForwardRequestHandler.js.map +1 -0
  264. package/dist/handlers/HandlerRegistration.d.ts +37 -0
  265. package/dist/handlers/HandlerRegistration.d.ts.map +1 -0
  266. package/dist/handlers/HandlerRegistration.js +2 -0
  267. package/dist/handlers/HandlerRegistration.js.map +1 -0
  268. package/dist/handlers/JournaledActionHandler.d.ts +31 -0
  269. package/dist/handlers/JournaledActionHandler.d.ts.map +1 -0
  270. package/dist/handlers/JournaledActionHandler.js +63 -0
  271. package/dist/handlers/JournaledActionHandler.js.map +1 -0
  272. package/dist/http/ExecutorHttpServer.d.ts +33 -0
  273. package/dist/http/ExecutorHttpServer.d.ts.map +1 -0
  274. package/dist/http/ExecutorHttpServer.js +176 -0
  275. package/dist/http/ExecutorHttpServer.js.map +1 -0
  276. package/dist/http/GatewayHttpServer.d.ts +42 -0
  277. package/dist/http/GatewayHttpServer.d.ts.map +1 -0
  278. package/dist/http/GatewayHttpServer.js +195 -0
  279. package/dist/http/GatewayHttpServer.js.map +1 -0
  280. package/dist/http/RecordingTarget.d.ts +18 -0
  281. package/dist/http/RecordingTarget.d.ts.map +1 -0
  282. package/dist/http/RecordingTarget.js +71 -0
  283. package/dist/http/RecordingTarget.js.map +1 -0
  284. package/dist/http/RequestContext.d.ts +17 -0
  285. package/dist/http/RequestContext.d.ts.map +1 -0
  286. package/dist/http/RequestContext.js +19 -0
  287. package/dist/http/RequestContext.js.map +1 -0
  288. package/dist/http/Routes.d.ts +93 -0
  289. package/dist/http/Routes.d.ts.map +1 -0
  290. package/dist/http/Routes.js +46 -0
  291. package/dist/http/Routes.js.map +1 -0
  292. package/dist/http/TlsListener.d.ts +38 -0
  293. package/dist/http/TlsListener.d.ts.map +1 -0
  294. package/dist/http/TlsListener.js +52 -0
  295. package/dist/http/TlsListener.js.map +1 -0
  296. package/dist/identity/Authenticator.d.ts +58 -0
  297. package/dist/identity/Authenticator.d.ts.map +1 -0
  298. package/dist/identity/Authenticator.js +170 -0
  299. package/dist/identity/Authenticator.js.map +1 -0
  300. package/dist/identity/PeerIdentity.d.ts +24 -0
  301. package/dist/identity/PeerIdentity.d.ts.map +1 -0
  302. package/dist/identity/PeerIdentity.js +29 -0
  303. package/dist/identity/PeerIdentity.js.map +1 -0
  304. package/dist/identity/PrincipalRegistry.d.ts +102 -0
  305. package/dist/identity/PrincipalRegistry.d.ts.map +1 -0
  306. package/dist/identity/PrincipalRegistry.js +191 -0
  307. package/dist/identity/PrincipalRegistry.js.map +1 -0
  308. package/dist/identity/PrincipalsFile.d.ts +152 -0
  309. package/dist/identity/PrincipalsFile.d.ts.map +1 -0
  310. package/dist/identity/PrincipalsFile.js +125 -0
  311. package/dist/identity/PrincipalsFile.js.map +1 -0
  312. package/dist/identity/RateLimiter.d.ts +43 -0
  313. package/dist/identity/RateLimiter.d.ts.map +1 -0
  314. package/dist/identity/RateLimiter.js +84 -0
  315. package/dist/identity/RateLimiter.js.map +1 -0
  316. package/dist/identity/SeparationOfDuties.d.ts +11 -0
  317. package/dist/identity/SeparationOfDuties.d.ts.map +1 -0
  318. package/dist/identity/SeparationOfDuties.js +25 -0
  319. package/dist/identity/SeparationOfDuties.js.map +1 -0
  320. package/dist/identity/WorkloadJwtVerifier.d.ts +57 -0
  321. package/dist/identity/WorkloadJwtVerifier.d.ts.map +1 -0
  322. package/dist/identity/WorkloadJwtVerifier.js +145 -0
  323. package/dist/identity/WorkloadJwtVerifier.js.map +1 -0
  324. package/dist/incident/EvidenceExport.d.ts +128 -0
  325. package/dist/incident/EvidenceExport.d.ts.map +1 -0
  326. package/dist/incident/EvidenceExport.js +187 -0
  327. package/dist/incident/EvidenceExport.js.map +1 -0
  328. package/dist/incident/FileProbe.d.ts +22 -0
  329. package/dist/incident/FileProbe.d.ts.map +1 -0
  330. package/dist/incident/FileProbe.js +31 -0
  331. package/dist/incident/FileProbe.js.map +1 -0
  332. package/dist/incident/HaltSwitch.d.ts +95 -0
  333. package/dist/incident/HaltSwitch.d.ts.map +1 -0
  334. package/dist/incident/HaltSwitch.js +171 -0
  335. package/dist/incident/HaltSwitch.js.map +1 -0
  336. package/dist/incident/Metrics.d.ts +71 -0
  337. package/dist/incident/Metrics.d.ts.map +1 -0
  338. package/dist/incident/Metrics.js +146 -0
  339. package/dist/incident/Metrics.js.map +1 -0
  340. package/dist/incident/SecurityEvents.d.ts +182 -0
  341. package/dist/incident/SecurityEvents.d.ts.map +1 -0
  342. package/dist/incident/SecurityEvents.js +167 -0
  343. package/dist/incident/SecurityEvents.js.map +1 -0
  344. package/dist/journal/ExecutionJournal.d.ts +96 -0
  345. package/dist/journal/ExecutionJournal.d.ts.map +1 -0
  346. package/dist/journal/ExecutionJournal.js +100 -0
  347. package/dist/journal/ExecutionJournal.js.map +1 -0
  348. package/dist/journal/FileExecutionJournal.d.ts +38 -0
  349. package/dist/journal/FileExecutionJournal.d.ts.map +1 -0
  350. package/dist/journal/FileExecutionJournal.js +137 -0
  351. package/dist/journal/FileExecutionJournal.js.map +1 -0
  352. package/dist/journal/InMemoryExecutionJournal.d.ts +23 -0
  353. package/dist/journal/InMemoryExecutionJournal.d.ts.map +1 -0
  354. package/dist/journal/InMemoryExecutionJournal.js +47 -0
  355. package/dist/journal/InMemoryExecutionJournal.js.map +1 -0
  356. package/dist/journal/StartupReconciler.d.ts +47 -0
  357. package/dist/journal/StartupReconciler.d.ts.map +1 -0
  358. package/dist/journal/StartupReconciler.js +89 -0
  359. package/dist/journal/StartupReconciler.js.map +1 -0
  360. package/dist/limits/HardLimits.d.ts +63 -0
  361. package/dist/limits/HardLimits.d.ts.map +1 -0
  362. package/dist/limits/HardLimits.js +120 -0
  363. package/dist/limits/HardLimits.js.map +1 -0
  364. package/dist/logging/LineEmitter.d.ts +26 -0
  365. package/dist/logging/LineEmitter.d.ts.map +1 -0
  366. package/dist/logging/LineEmitter.js +36 -0
  367. package/dist/logging/LineEmitter.js.map +1 -0
  368. package/dist/posture/HostPosture.d.ts +60 -0
  369. package/dist/posture/HostPosture.d.ts.map +1 -0
  370. package/dist/posture/HostPosture.js +104 -0
  371. package/dist/posture/HostPosture.js.map +1 -0
  372. package/dist/posture/PostureChecks.d.ts +52 -0
  373. package/dist/posture/PostureChecks.d.ts.map +1 -0
  374. package/dist/posture/PostureChecks.js +172 -0
  375. package/dist/posture/PostureChecks.js.map +1 -0
  376. package/dist/secrets/CompositeSecretStore.d.ts +37 -0
  377. package/dist/secrets/CompositeSecretStore.d.ts.map +1 -0
  378. package/dist/secrets/CompositeSecretStore.js +99 -0
  379. package/dist/secrets/CompositeSecretStore.js.map +1 -0
  380. package/dist/secrets/EnvSecretStore.d.ts +18 -0
  381. package/dist/secrets/EnvSecretStore.d.ts.map +1 -0
  382. package/dist/secrets/EnvSecretStore.js +46 -0
  383. package/dist/secrets/EnvSecretStore.js.map +1 -0
  384. package/dist/secrets/FileSecretStore.d.ts +60 -0
  385. package/dist/secrets/FileSecretStore.d.ts.map +1 -0
  386. package/dist/secrets/FileSecretStore.js +180 -0
  387. package/dist/secrets/FileSecretStore.js.map +1 -0
  388. package/dist/secrets/Redactor.d.ts +32 -0
  389. package/dist/secrets/Redactor.d.ts.map +1 -0
  390. package/dist/secrets/Redactor.js +108 -0
  391. package/dist/secrets/Redactor.js.map +1 -0
  392. package/dist/secrets/SecretHandle.d.ts +34 -0
  393. package/dist/secrets/SecretHandle.d.ts.map +1 -0
  394. package/dist/secrets/SecretHandle.js +71 -0
  395. package/dist/secrets/SecretHandle.js.map +1 -0
  396. package/dist/secrets/SecretStore.d.ts +37 -0
  397. package/dist/secrets/SecretStore.d.ts.map +1 -0
  398. package/dist/secrets/SecretStore.js +12 -0
  399. package/dist/secrets/SecretStore.js.map +1 -0
  400. package/dist/service/AuthorityClients.d.ts +50 -0
  401. package/dist/service/AuthorityClients.d.ts.map +1 -0
  402. package/dist/service/AuthorityClients.js +83 -0
  403. package/dist/service/AuthorityClients.js.map +1 -0
  404. package/dist/service/EscalationResolver.d.ts +97 -0
  405. package/dist/service/EscalationResolver.d.ts.map +1 -0
  406. package/dist/service/EscalationResolver.js +196 -0
  407. package/dist/service/EscalationResolver.js.map +1 -0
  408. package/dist/service/Requests.d.ts +99 -0
  409. package/dist/service/Requests.d.ts.map +1 -0
  410. package/dist/service/Requests.js +42 -0
  411. package/dist/service/Requests.js.map +1 -0
  412. package/dist/service/ServiceError.d.ts +20 -0
  413. package/dist/service/ServiceError.d.ts.map +1 -0
  414. package/dist/service/ServiceError.js +25 -0
  415. package/dist/service/ServiceError.js.map +1 -0
  416. package/dist/service/TrustedExecutorService.d.ts +221 -0
  417. package/dist/service/TrustedExecutorService.d.ts.map +1 -0
  418. package/dist/service/TrustedExecutorService.js +1066 -0
  419. package/dist/service/TrustedExecutorService.js.map +1 -0
  420. package/dist/time/ClockSkewGuard.d.ts +25 -0
  421. package/dist/time/ClockSkewGuard.d.ts.map +1 -0
  422. package/dist/time/ClockSkewGuard.js +35 -0
  423. package/dist/time/ClockSkewGuard.js.map +1 -0
  424. package/dist/time/MonotonicClock.d.ts +35 -0
  425. package/dist/time/MonotonicClock.d.ts.map +1 -0
  426. package/dist/time/MonotonicClock.js +52 -0
  427. package/dist/time/MonotonicClock.js.map +1 -0
  428. package/dist/verify/VerifyAuditChain.d.ts +36 -0
  429. package/dist/verify/VerifyAuditChain.d.ts.map +1 -0
  430. package/dist/verify/VerifyAuditChain.js +109 -0
  431. package/dist/verify/VerifyAuditChain.js.map +1 -0
  432. package/dist/verify/VerifyEvidenceBundle.d.ts +50 -0
  433. package/dist/verify/VerifyEvidenceBundle.d.ts.map +1 -0
  434. package/dist/verify/VerifyEvidenceBundle.js +157 -0
  435. package/dist/verify/VerifyEvidenceBundle.js.map +1 -0
  436. package/package.json +80 -0
@@ -0,0 +1,99 @@
1
+ import { z } from "zod";
2
+ import { type CapturedIntent, type ExecutionRecoveryReference } from "@decionis/agent-safe-pipeline";
3
+ import type { ExecutorMode } from "../config/ExecutorConfig.js";
4
+ import type { EscalationHandoff } from "./EscalationResolver.js";
5
+ /**
6
+ * What the caller sends. `proposal` is the agent's part and nothing else:
7
+ * tenant, actor, downstream target and credentials come from the executor's
8
+ * own configuration, and a request that tries to supply them is refused by
9
+ * the strict schema. The idempotency key and correlation id are the caller's,
10
+ * derived from its own record of the work, never from the model.
11
+ */
12
+ export declare const ProposalRequestSchema: z.ZodObject<{
13
+ proposal: z.ZodObject<{
14
+ action: z.ZodString;
15
+ target: z.ZodString;
16
+ parameters: z.ZodOptional<z.ZodType<import("@decionis/agent-safe-pipeline").JsonObject, unknown, z.core.$ZodTypeInternals<import("@decionis/agent-safe-pipeline").JsonObject, unknown>>>;
17
+ }, z.core.$strict>;
18
+ idempotency_key: z.ZodString;
19
+ correlation_id: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strict>;
21
+ export type ProposalRequest = z.infer<typeof ProposalRequestSchema>;
22
+ /** The recovery reference the executor returned, presented back verbatim with the intent. */
23
+ export declare const ReconciliationRequestSchema: z.ZodObject<{
24
+ intent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
25
+ reference: z.ZodObject<{
26
+ version: z.ZodLiteral<"agent-safe.recovery/1">;
27
+ decisionId: z.ZodString;
28
+ dossierId: z.ZodString;
29
+ grantId: z.ZodString;
30
+ intentHash: z.ZodString;
31
+ expiresAt: z.ZodString;
32
+ idempotencyKey: z.ZodString;
33
+ }, z.core.$strict>;
34
+ }, z.core.$strict>;
35
+ export type ReconciliationRequest = z.infer<typeof ReconciliationRequestSchema>;
36
+ /**
37
+ * An operator's reason for stopping or resuming the executor. It is written
38
+ * to the security stream verbatim, so it is bounded and it is the
39
+ * operator's own words: nothing from a proposal ever reaches it.
40
+ */
41
+ export declare const HaltRequestSchema: z.ZodObject<{
42
+ reason: z.ZodString;
43
+ }, z.core.$strict>;
44
+ export declare const ResumeRequestSchema: z.ZodObject<{
45
+ reason: z.ZodString;
46
+ }, z.core.$strict>;
47
+ export type HaltRequest = z.infer<typeof HaltRequestSchema>;
48
+ /** The consumed binding, as evidence. The token itself never leaves the process. */
49
+ export interface AuthorizationBinding {
50
+ readonly decision_id: string;
51
+ readonly dossier_id: string;
52
+ readonly grant_id: string;
53
+ readonly expires_at: string;
54
+ }
55
+ export interface ActionResponse {
56
+ readonly mode: ExecutorMode;
57
+ readonly intent_id: string;
58
+ readonly intent_hash: string;
59
+ readonly verdict: "ALLOW" | "ESCALATE" | "BLOCK" | null;
60
+ readonly decision_id: string | null;
61
+ readonly dossier_id: string | null;
62
+ readonly reason_codes: readonly string[];
63
+ readonly fail_closed: boolean;
64
+ /**
65
+ * Shadow: the observation status. Enforcement: the executor outcome, or
66
+ * `ESCALATE_PENDING` while a person has yet to answer.
67
+ */
68
+ readonly outcome: string;
69
+ readonly executed: boolean | null;
70
+ readonly authorization: AuthorizationBinding | null;
71
+ readonly finalization: "RECORDED" | "PENDING" | "UNSUPPORTED" | null;
72
+ readonly result: unknown;
73
+ /**
74
+ * What the adapter observed about the effect, for an action family that has
75
+ * an effect plane: statuses, digests and the projected fields that differ.
76
+ * Null for an action with no adapter, and never a provider body, a
77
+ * parameter, or a credential.
78
+ */
79
+ readonly effect: Readonly<Record<string, unknown>> | null;
80
+ /** Present only for `UNKNOWN_AFTER_DISPATCH`: what to present to reconcile. */
81
+ readonly recovery: {
82
+ readonly intent: CapturedIntent["intent"];
83
+ readonly reference: ExecutionRecoveryReference;
84
+ } | null;
85
+ /** Present while an escalation is open: what to present to resume. */
86
+ readonly escalation: EscalationHandoff | null;
87
+ }
88
+ export interface ReconciliationResponse {
89
+ readonly intent_id: string;
90
+ readonly intent_hash: string;
91
+ readonly outcome: string;
92
+ readonly executed: boolean | null;
93
+ readonly recovered: boolean;
94
+ readonly reason_codes: readonly string[];
95
+ readonly authorization: AuthorizationBinding | null;
96
+ readonly result: unknown;
97
+ readonly effect: Readonly<Record<string, unknown>> | null;
98
+ }
99
+ //# sourceMappingURL=Requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Requests.d.ts","sourceRoot":"","sources":["../../src/service/Requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAIjE;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;kBAQhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B;;;;;;;;;;;kBAWtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;kBAE5B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;kBAAoB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,oFAAoF;AACpF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,C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rC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CAC3D"}
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ import { JsonObjectSchema, } from "@decionis/agent-safe-pipeline";
3
+ const identifier = z.string().trim().min(1).max(200);
4
+ /**
5
+ * What the caller sends. `proposal` is the agent's part and nothing else:
6
+ * tenant, actor, downstream target and credentials come from the executor's
7
+ * own configuration, and a request that tries to supply them is refused by
8
+ * the strict schema. The idempotency key and correlation id are the caller's,
9
+ * derived from its own record of the work, never from the model.
10
+ */
11
+ export const ProposalRequestSchema = z.strictObject({
12
+ proposal: z.strictObject({
13
+ action: z.string().trim().min(1).max(120),
14
+ target: z.string().trim().min(1).max(500),
15
+ parameters: JsonObjectSchema.optional(),
16
+ }),
17
+ idempotency_key: z.string().trim().min(1).max(180),
18
+ correlation_id: identifier.optional(),
19
+ });
20
+ /** The recovery reference the executor returned, presented back verbatim with the intent. */
21
+ export const ReconciliationRequestSchema = z.strictObject({
22
+ intent: z.record(z.string(), z.unknown()),
23
+ reference: z.strictObject({
24
+ version: z.literal("agent-safe.recovery/1"),
25
+ decisionId: identifier,
26
+ dossierId: identifier,
27
+ grantId: identifier,
28
+ intentHash: z.string().regex(/^sha256:[0-9a-f]{64}$/),
29
+ expiresAt: z.string().datetime(),
30
+ idempotencyKey: z.string().trim().min(1).max(180),
31
+ }),
32
+ });
33
+ /**
34
+ * An operator's reason for stopping or resuming the executor. It is written
35
+ * to the security stream verbatim, so it is bounded and it is the
36
+ * operator's own words: nothing from a proposal ever reaches it.
37
+ */
38
+ export const HaltRequestSchema = z.strictObject({
39
+ reason: z.string().trim().min(1).max(200),
40
+ });
41
+ export const ResumeRequestSchema = HaltRequestSchema;
42
+ //# sourceMappingURL=Requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Requests.js","sourceRoot":"","sources":["../../src/service/Requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,gBAAgB,GAGjB,MAAM,+BAA+B,CAAC;AAIvC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD,QAAQ,EAAE,CAAC,CAAC,YAAY,CAAC;QACvB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QACzC,UAAU,EAAE,gBAAgB,CAAC,QAAQ,EAAE;KACxC,CAAC;IACF,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAClD,cAAc,EAAE,UAAU,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC;AAIH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IACzC,SAAS,EAAE,CAAC,CAAC,YAAY,CAAC;QACxB,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;QAC3C,UAAU,EAAE,UAAU;QACtB,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC;QACrD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;KAClD,CAAC;CACH,CAAC,CAAC;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A refusal the service meant: a status and a stable code, nothing echoed.
3
+ * A refusal that the caller is expected to act on rather than merely read,
4
+ * a halt above all, carries the answer in the shape the caller already
5
+ * parses and the seconds after which retrying is sensible.
6
+ */
7
+ export declare class ServiceError extends Error {
8
+ readonly status: number;
9
+ readonly code: string;
10
+ /** The body to answer with, when `{ code }` is not enough. */
11
+ readonly body?: unknown | undefined;
12
+ /** Seconds; becomes `Retry-After` when present. */
13
+ readonly retryAfterSeconds?: number | undefined;
14
+ constructor(status: number, code: string,
15
+ /** The body to answer with, when `{ code }` is not enough. */
16
+ body?: unknown | undefined,
17
+ /** Seconds; becomes `Retry-After` when present. */
18
+ retryAfterSeconds?: number | undefined);
19
+ }
20
+ //# sourceMappingURL=ServiceError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServiceError.d.ts","sourceRoot":"","sources":["../../src/service/ServiceError.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,KAAK;aAEnB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;IAC5B,8DAA8D;aAC9C,IAAI,CAAC,EAAE,OAAO;IAC9B,mDAAmD;aACnC,iBAAiB,CAAC,EAAE,MAAM;gBAL1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM;IAC5B,8DAA8D;IAC9C,IAAI,CAAC,EAAE,OAAO,YAAA;IAC9B,mDAAmD;IACnC,iBAAiB,CAAC,EAAE,MAAM,YAAA;CAK7C"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * A refusal the service meant: a status and a stable code, nothing echoed.
3
+ * A refusal that the caller is expected to act on rather than merely read,
4
+ * a halt above all, carries the answer in the shape the caller already
5
+ * parses and the seconds after which retrying is sensible.
6
+ */
7
+ export class ServiceError extends Error {
8
+ status;
9
+ code;
10
+ body;
11
+ retryAfterSeconds;
12
+ constructor(status, code,
13
+ /** The body to answer with, when `{ code }` is not enough. */
14
+ body,
15
+ /** Seconds; becomes `Retry-After` when present. */
16
+ retryAfterSeconds) {
17
+ super(code);
18
+ this.status = status;
19
+ this.code = code;
20
+ this.body = body;
21
+ this.retryAfterSeconds = retryAfterSeconds;
22
+ this.name = "ServiceError";
23
+ }
24
+ }
25
+ //# sourceMappingURL=ServiceError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServiceError.js","sourceRoot":"","sources":["../../src/service/ServiceError.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAEnB;IACA;IAEA;IAEA;IANlB,YACkB,MAAc,EACd,IAAY;IAC5B,8DAA8D;IAC9C,IAAc;IAC9B,mDAAmD;IACnC,iBAA0B;QAE1C,KAAK,CAAC,IAAI,CAAC,CAAC;QAPI,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QAEZ,SAAI,GAAJ,IAAI,CAAU;QAEd,sBAAiB,GAAjB,iBAAiB,CAAS;QAG1C,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF"}
@@ -0,0 +1,221 @@
1
+ import { HashChain } from "../audit/HashChain.js";
2
+ import type { LineWriter } from "../audit/LineAuditSink.js";
3
+ import type { EscalationMode, ExecutorConfig, ExecutorMode } from "../config/ExecutorConfig.js";
4
+ import { HaltSwitch, type HaltState } from "../incident/HaltSwitch.js";
5
+ import type { ExecutionJournal } from "../journal/ExecutionJournal.js";
6
+ import { type RecoveryReport } from "../journal/StartupReconciler.js";
7
+ import { type AddressResolver } from "../egress/GuardedFetch.js";
8
+ import type { FetchLike, HandlerRegistration } from "../handlers/HandlerRegistration.js";
9
+ import { PrincipalRegistry, type Principal } from "../identity/PrincipalRegistry.js";
10
+ import { WorkloadJwtVerifier } from "../identity/WorkloadJwtVerifier.js";
11
+ import { type ExecutorMetrics } from "../incident/Metrics.js";
12
+ import { SecurityEvents } from "../incident/SecurityEvents.js";
13
+ import { type EvidenceBundle } from "../incident/EvidenceExport.js";
14
+ import type { PostureState } from "../posture/HostPosture.js";
15
+ import type { ReloadReport, SecretStore } from "../secrets/SecretStore.js";
16
+ import { type EscalationDependencies } from "./EscalationResolver.js";
17
+ import { type ActionResponse, type ReconciliationResponse } from "./Requests.js";
18
+ export interface ServiceDependencies extends Omit<EscalationDependencies, "fetch"> {
19
+ /** Where audit lines go; stdout in the process, an array in the proof. */
20
+ readonly emit?: LineWriter;
21
+ /** The transport under the guard; `node:https` when absent. An injected one is still policy-checked. */
22
+ readonly fetch?: FetchLike;
23
+ /** Name resolution for the guard; the system resolver when absent. */
24
+ readonly resolve?: AddressResolver;
25
+ /** Reads a CA bundle the configuration names; the filesystem when absent. */
26
+ readonly readFile?: (path: string) => string;
27
+ /** Where security events go; stderr in the process. */
28
+ readonly security?: SecurityEvents;
29
+ /** Whether a posture drift is standing; an enforcement request is refused while it is. */
30
+ readonly posture?: PostureState;
31
+ /** The evidence chain to link audit lines on; a fresh one from genesis when absent. */
32
+ readonly chain?: HashChain;
33
+ readonly metrics?: ExecutorMetrics;
34
+ /** The principals, when trusted startup code built them; the file or the legacy caller otherwise. */
35
+ readonly principals?: PrincipalRegistry;
36
+ /** Where attempts are journaled; the configured directory unless one is given. */
37
+ readonly journal?: ExecutionJournal;
38
+ /** The stop; one is built from the configuration unless a test hands in its own. */
39
+ readonly halt?: HaltSwitch;
40
+ readonly clock?: () => number;
41
+ }
42
+ /** What `/v1/control/status` reports: identifiers, counts, and heads, never a value. */
43
+ export interface ExecutorStatus {
44
+ readonly status: "ready";
45
+ readonly mode: ExecutorMode;
46
+ readonly escalation: EscalationMode;
47
+ readonly actions: readonly string[];
48
+ readonly posture: {
49
+ readonly degraded: boolean;
50
+ };
51
+ readonly principals: {
52
+ readonly mode: "PRINCIPALS" | "LEGACY";
53
+ readonly count: number;
54
+ };
55
+ readonly evidence: {
56
+ readonly seq: number;
57
+ readonly hash: string;
58
+ };
59
+ readonly secrets: readonly string[];
60
+ readonly halt: HaltState;
61
+ readonly attempts: {
62
+ readonly open: number;
63
+ readonly unknown: number;
64
+ };
65
+ readonly limits: {
66
+ readonly currencies: readonly string[];
67
+ readonly windowSeconds: number | null;
68
+ } | null;
69
+ }
70
+ /** What `/ready` answers, and whether it is ready at all. */
71
+ export interface Readiness {
72
+ readonly ready: boolean;
73
+ readonly body: Readonly<Record<string, unknown>>;
74
+ }
75
+ export declare class TrustedExecutorService {
76
+ private readonly config;
77
+ private readonly secrets;
78
+ private readonly capture;
79
+ private readonly registry;
80
+ private readonly registered;
81
+ private readonly clients;
82
+ private readonly posture;
83
+ private readonly egress;
84
+ /** Where an incident's evidence is written, when the configuration names a directory. */
85
+ private readonly evidence;
86
+ /** The security stream this service writes to; a test drives the halt through it. */
87
+ readonly events: SecurityEvents;
88
+ private readonly chain;
89
+ readonly metrics: ExecutorMetrics;
90
+ readonly principals: PrincipalRegistry;
91
+ /** The workload token verifier, when the configuration names a JWKS; the door uses it. */
92
+ readonly jwt: WorkloadJwtVerifier | null;
93
+ private readonly credential;
94
+ private readonly audit;
95
+ private readonly journal;
96
+ readonly haltSwitch: HaltSwitch;
97
+ private readonly limits;
98
+ private readonly unsubscribeMetrics;
99
+ private readonly hasher;
100
+ private recovery;
101
+ private constructor();
102
+ /**
103
+ * Wires the boundary. `handlers` is the adopter's seam: it registers what
104
+ * this process can run, and the registry is sealed the moment it returns.
105
+ * Every credential is read from `secrets` at the moment of use.
106
+ */
107
+ static create(config: ExecutorConfig, secrets: SecretStore, handlers: HandlerRegistration, dependencies?: ServiceDependencies): TrustedExecutorService;
108
+ /** The credential the configuration's kind names, over the secret store and the guarded fetch. */
109
+ private static credential;
110
+ private static jwtVerifier;
111
+ /** The principals file, or the legacy caller; either way checked against what this process runs. */
112
+ private static principals;
113
+ get mode(): ExecutorMode;
114
+ get escalationMode(): EscalationMode;
115
+ /** The actions this process can run, for `/ready`. */
116
+ get actions(): readonly string[];
117
+ /** Stops following credential rotation and closes every outbound connection; the service answers nothing new after this. */
118
+ close(): void;
119
+ /** Identifiers, counts and heads for an operator; never a value. */
120
+ status(caller?: Principal): ExecutorStatus;
121
+ /**
122
+ * What the last process left open, resolved before this one takes a
123
+ * request. Read-only: the provider is asked what it did, never told to do
124
+ * it again.
125
+ */
126
+ recover(): Promise<RecoveryReport>;
127
+ /**
128
+ * Readiness, which is not liveness: a halted executor is alive and
129
+ * deliberately not ready, and so is one that still does not know how an
130
+ * attempt ended when the deployment asked to wait for that.
131
+ */
132
+ readiness(): Readiness;
133
+ /** Stops the executor taking new work, on an operator's word and with a reason. */
134
+ halt(input: unknown, caller?: Principal): HaltState;
135
+ /** Lets work through again; refused while the cause of the halt still stands. */
136
+ resumeWork(input: unknown, caller?: Principal): HaltState;
137
+ /** The attempts this process does not know the outcome of: identifiers and states only. */
138
+ openAttempts(caller?: Principal): {
139
+ readonly attempts: RecoveryReport["attempts"];
140
+ readonly unknown: number;
141
+ };
142
+ /** Re-reads every secret file now, on an operator's word; the report names files, never values. */
143
+ reloadSecrets(caller?: Principal): Promise<ReloadReport>;
144
+ metricsText(caller?: Principal): string;
145
+ propose(input: unknown, caller?: Principal): Promise<ActionResponse>;
146
+ private enforceAfterPosture;
147
+ /** The stop, checked after the intent is captured and before any authority is asked. */
148
+ private assertNotHalted;
149
+ /** The refusal itself is evidence: the same shape the executor uses for a blocked run. */
150
+ private recordRefusal;
151
+ /** The host's own ceilings, before the authority is asked and again before the run. */
152
+ private assertWithinLimits;
153
+ reconcile(input: unknown, caller?: Principal): Promise<ReconciliationResponse>;
154
+ /**
155
+ * Resumes an open escalation. One bounded lookup: if the person has
156
+ * answered, the authority evaluates the exact intent again and an `ALLOW`
157
+ * executes once; if not, the state comes back to be presented later. An
158
+ * intent past its lifetime is refused before anything is asked.
159
+ */
160
+ resume(input: unknown, caller?: Principal): Promise<ActionResponse>;
161
+ /**
162
+ * The attempt, on disk, before the executor may run it. A journal that
163
+ * cannot take the record refuses the proposal rather than executing
164
+ * something no one could reconcile afterwards; with
165
+ * `EXECUTOR_JOURNAL_REQUIRED=false`, outside production, the refusal is
166
+ * downgraded to an event so a developer can run without a volume.
167
+ */
168
+ private openAttempt;
169
+ /**
170
+ * How the attempt ended, so the next start does not have to ask the
171
+ * provider. An outcome that is unknown is exactly what must not be closed:
172
+ * the attempt stays open, and the next start, or a caller's own
173
+ * reconciliation, resolves it by reading the provider.
174
+ */
175
+ private closeAttempt;
176
+ /** A standing posture drift refuses new enforcement work; nothing that has started is touched. */
177
+ private assertPosture;
178
+ /** The proposer a call is made as: the caller the door authenticated, or the legacy caller when the service is used directly. */
179
+ private proposer;
180
+ private operator;
181
+ /** An intent presented back must be the caller's own: same principal, tenant, and actor. */
182
+ private assertOwn;
183
+ private captureIntent;
184
+ /**
185
+ * The banking binder. Every disagreement between what the caller said over
186
+ * the transport and what the canonical action says is a refusal before the
187
+ * authority is asked, so a mismatch costs no dossier and no grant.
188
+ */
189
+ private bindBanking;
190
+ /**
191
+ * The two digests a banking intent is bound to, taken from the profile's
192
+ * own arithmetic. This reaches nothing: `prepare` is pure, which is why
193
+ * the transport it is handed refuses to be used.
194
+ */
195
+ private bankingDigests;
196
+ /**
197
+ * What the adapter observed, for the response and for the stream. An
198
+ * observation that does not match what was authorised is the institution's
199
+ * exception: it is named in the evidence, counted, and by default it stops
200
+ * the executor, because the next proposal would otherwise be made against
201
+ * a state nobody has reconciled.
202
+ */
203
+ private effect;
204
+ /** The reason codes an effect block contributes to the response. */
205
+ private static effectReasons;
206
+ /** An intent the caller presents back, re-hashed rather than trusted. */
207
+ private presented;
208
+ private observe;
209
+ private enforce;
210
+ private response;
211
+ /** A resumption that produced no new decision: still held, or refused. */
212
+ private held;
213
+ /**
214
+ * The bundle: what this process can say about an incident, written where an
215
+ * operator can pick it up. Only an operator holding the `evidence` scope
216
+ * may ask, and the reason they give travels with it.
217
+ */
218
+ exportEvidence(input: unknown, caller?: Principal): Promise<EvidenceBundle>;
219
+ private static binding;
220
+ }
221
+ //# sourceMappingURL=TrustedExecutorService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrustedExecutorService.d.ts","sourceRoot":"","sources":["../../src/service/TrustedExecutorService.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChG,OAAO,EAAE,UAAU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