@parmana/shared 0.0.0-stage → 2.0.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 (433) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +16 -2
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/config/ApiKeyEntry.d.ts +97 -0
  6. package/dist/config/ApiKeyEntry.d.ts.map +1 -0
  7. package/dist/config/ApiKeyEntry.js +2 -0
  8. package/dist/config/ApiKeyEntry.js.map +1 -0
  9. package/dist/config/Config.d.ts +227 -0
  10. package/dist/config/Config.d.ts.map +1 -0
  11. package/dist/config/Config.js +172 -0
  12. package/dist/config/Config.js.map +1 -0
  13. package/dist/config/ConfigLoader.d.ts +5 -0
  14. package/dist/config/ConfigLoader.d.ts.map +1 -0
  15. package/dist/config/ConfigLoader.js +8 -0
  16. package/dist/config/ConfigLoader.js.map +1 -0
  17. package/dist/config/ConfigUtils.d.ts +6 -0
  18. package/dist/config/ConfigUtils.d.ts.map +1 -0
  19. package/dist/config/ConfigUtils.js +8 -0
  20. package/dist/config/ConfigUtils.js.map +1 -0
  21. package/dist/config/ConfigValidation.d.ts +30 -0
  22. package/dist/config/ConfigValidation.d.ts.map +1 -0
  23. package/dist/config/ConfigValidation.js +191 -0
  24. package/dist/config/ConfigValidation.js.map +1 -0
  25. package/dist/config/CryptoAlgorithms.d.ts +38 -0
  26. package/dist/config/CryptoAlgorithms.d.ts.map +1 -0
  27. package/dist/config/CryptoAlgorithms.js +38 -0
  28. package/dist/config/CryptoAlgorithms.js.map +1 -0
  29. package/dist/config/Doctor.d.ts +46 -0
  30. package/dist/config/Doctor.d.ts.map +1 -0
  31. package/dist/config/Doctor.js +781 -0
  32. package/dist/config/Doctor.js.map +1 -0
  33. package/dist/config/KeyProviders.d.ts +9 -0
  34. package/dist/config/KeyProviders.d.ts.map +1 -0
  35. package/dist/config/KeyProviders.js +8 -0
  36. package/dist/config/KeyProviders.js.map +1 -0
  37. package/dist/config/SecretsProviders.d.ts +6 -0
  38. package/dist/config/SecretsProviders.d.ts.map +1 -0
  39. package/dist/config/SecretsProviders.js +5 -0
  40. package/dist/config/SecretsProviders.js.map +1 -0
  41. package/dist/config/StorageProviders.d.ts +18 -0
  42. package/dist/config/StorageProviders.d.ts.map +1 -0
  43. package/dist/config/StorageProviders.js +20 -0
  44. package/dist/config/StorageProviders.js.map +1 -0
  45. package/dist/config/TrustProfiles.d.ts +5 -0
  46. package/dist/config/TrustProfiles.d.ts.map +1 -0
  47. package/dist/config/TrustProfiles.js +4 -0
  48. package/dist/config/TrustProfiles.js.map +1 -0
  49. package/dist/config/index.d.ts +12 -0
  50. package/dist/config/index.d.ts.map +1 -0
  51. package/dist/config/index.js +12 -0
  52. package/dist/config/index.js.map +1 -0
  53. package/dist/domain/approval-artifact.d.ts +136 -0
  54. package/dist/domain/approval-artifact.d.ts.map +1 -0
  55. package/dist/domain/approval-artifact.js +2 -0
  56. package/dist/domain/approval-artifact.js.map +1 -0
  57. package/dist/domain/approval-issuer.d.ts +52 -0
  58. package/dist/domain/approval-issuer.d.ts.map +1 -0
  59. package/dist/domain/approval-issuer.js +2 -0
  60. package/dist/domain/approval-issuer.js.map +1 -0
  61. package/dist/domain/authority-grant.d.ts +54 -0
  62. package/dist/domain/authority-grant.d.ts.map +1 -0
  63. package/dist/domain/authority-grant.js +2 -0
  64. package/dist/domain/authority-grant.js.map +1 -0
  65. package/dist/domain/authority.d.ts +42 -0
  66. package/dist/domain/authority.d.ts.map +1 -0
  67. package/dist/domain/authority.js +11 -0
  68. package/dist/domain/authority.js.map +1 -0
  69. package/dist/domain/authorization.d.ts +54 -0
  70. package/dist/domain/authorization.d.ts.map +1 -0
  71. package/dist/domain/authorization.js +2 -0
  72. package/dist/domain/authorization.js.map +1 -0
  73. package/dist/domain/business-signal-source.d.ts +52 -0
  74. package/dist/domain/business-signal-source.d.ts.map +1 -0
  75. package/dist/domain/business-signal-source.js +2 -0
  76. package/dist/domain/business-signal-source.js.map +1 -0
  77. package/dist/domain/business-transaction.d.ts +99 -0
  78. package/dist/domain/business-transaction.d.ts.map +1 -0
  79. package/dist/domain/business-transaction.js +16 -0
  80. package/dist/domain/business-transaction.js.map +1 -0
  81. package/dist/domain/business-validation.d.ts +177 -0
  82. package/dist/domain/business-validation.d.ts.map +1 -0
  83. package/dist/domain/business-validation.js +60 -0
  84. package/dist/domain/business-validation.js.map +1 -0
  85. package/dist/domain/challenge-record.d.ts +181 -0
  86. package/dist/domain/challenge-record.d.ts.map +1 -0
  87. package/dist/domain/challenge-record.js +2 -0
  88. package/dist/domain/challenge-record.js.map +1 -0
  89. package/dist/domain/decision.d.ts +97 -0
  90. package/dist/domain/decision.d.ts.map +1 -0
  91. package/dist/domain/decision.js +9 -0
  92. package/dist/domain/decision.js.map +1 -0
  93. package/dist/domain/evidence-anchor.d.ts +54 -0
  94. package/dist/domain/evidence-anchor.d.ts.map +1 -0
  95. package/dist/domain/evidence-anchor.js +2 -0
  96. package/dist/domain/evidence-anchor.js.map +1 -0
  97. package/dist/domain/executable-content.d.ts +45 -0
  98. package/dist/domain/executable-content.d.ts.map +1 -0
  99. package/dist/domain/executable-content.js +39 -0
  100. package/dist/domain/executable-content.js.map +1 -0
  101. package/dist/domain/execution-audit-event.d.ts +65 -0
  102. package/dist/domain/execution-audit-event.d.ts.map +1 -0
  103. package/dist/domain/execution-audit-event.js +2 -0
  104. package/dist/domain/execution-audit-event.js.map +1 -0
  105. package/dist/domain/execution-authorization.d.ts +224 -0
  106. package/dist/domain/execution-authorization.d.ts.map +1 -0
  107. package/dist/domain/execution-authorization.js +2 -0
  108. package/dist/domain/execution-authorization.js.map +1 -0
  109. package/dist/domain/execution-evidence.d.ts +38 -0
  110. package/dist/domain/execution-evidence.d.ts.map +1 -0
  111. package/dist/domain/execution-evidence.js +2 -0
  112. package/dist/domain/execution-evidence.js.map +1 -0
  113. package/dist/domain/execution-intent.d.ts +92 -0
  114. package/dist/domain/execution-intent.d.ts.map +1 -0
  115. package/dist/domain/execution-intent.js +2 -0
  116. package/dist/domain/execution-intent.js.map +1 -0
  117. package/dist/domain/execution-metadata.d.ts +8 -0
  118. package/dist/domain/execution-metadata.d.ts.map +1 -0
  119. package/dist/domain/execution-metadata.js +2 -0
  120. package/dist/domain/execution-metadata.js.map +1 -0
  121. package/dist/domain/execution-outcome-store.d.ts +49 -0
  122. package/dist/domain/execution-outcome-store.d.ts.map +1 -0
  123. package/dist/domain/execution-outcome-store.js +10 -0
  124. package/dist/domain/execution-outcome-store.js.map +1 -0
  125. package/dist/domain/execution-result.d.ts +49 -0
  126. package/dist/domain/execution-result.d.ts.map +1 -0
  127. package/dist/domain/execution-result.js +2 -0
  128. package/dist/domain/execution-result.js.map +1 -0
  129. package/dist/domain/execution-trust-record.d.ts +142 -0
  130. package/dist/domain/execution-trust-record.d.ts.map +1 -0
  131. package/dist/domain/execution-trust-record.js +2 -0
  132. package/dist/domain/execution-trust-record.js.map +1 -0
  133. package/dist/domain/execution.d.ts +108 -0
  134. package/dist/domain/execution.d.ts.map +1 -0
  135. package/dist/domain/execution.js +18 -0
  136. package/dist/domain/execution.js.map +1 -0
  137. package/dist/domain/external-connector.d.ts +68 -0
  138. package/dist/domain/external-connector.d.ts.map +1 -0
  139. package/dist/domain/external-connector.js +2 -0
  140. package/dist/domain/external-connector.js.map +1 -0
  141. package/dist/domain/index.d.ts +37 -0
  142. package/dist/domain/index.d.ts.map +1 -0
  143. package/dist/domain/index.js +37 -0
  144. package/dist/domain/index.js.map +1 -0
  145. package/dist/domain/intent.d.ts +66 -0
  146. package/dist/domain/intent.d.ts.map +1 -0
  147. package/dist/domain/intent.js +2 -0
  148. package/dist/domain/intent.js.map +1 -0
  149. package/dist/domain/metadata.d.ts +53 -0
  150. package/dist/domain/metadata.d.ts.map +1 -0
  151. package/dist/domain/metadata.js +11 -0
  152. package/dist/domain/metadata.js.map +1 -0
  153. package/dist/domain/override.d.ts +39 -0
  154. package/dist/domain/override.d.ts.map +1 -0
  155. package/dist/domain/override.js +2 -0
  156. package/dist/domain/override.js.map +1 -0
  157. package/dist/domain/pending-policy-change.d.ts +109 -0
  158. package/dist/domain/pending-policy-change.d.ts.map +1 -0
  159. package/dist/domain/pending-policy-change.js +12 -0
  160. package/dist/domain/pending-policy-change.js.map +1 -0
  161. package/dist/domain/policy-change-approval-record.d.ts +81 -0
  162. package/dist/domain/policy-change-approval-record.d.ts.map +1 -0
  163. package/dist/domain/policy-change-approval-record.js +2 -0
  164. package/dist/domain/policy-change-approval-record.js.map +1 -0
  165. package/dist/domain/policy-change-step-up-authorization.d.ts +97 -0
  166. package/dist/domain/policy-change-step-up-authorization.d.ts.map +1 -0
  167. package/dist/domain/policy-change-step-up-authorization.js +2 -0
  168. package/dist/domain/policy-change-step-up-authorization.js.map +1 -0
  169. package/dist/domain/policy-reference.d.ts +58 -0
  170. package/dist/domain/policy-reference.d.ts.map +1 -0
  171. package/dist/domain/policy-reference.js +2 -0
  172. package/dist/domain/policy-reference.js.map +1 -0
  173. package/dist/domain/receipt.d.ts +72 -0
  174. package/dist/domain/receipt.d.ts.map +1 -0
  175. package/dist/domain/receipt.js +2 -0
  176. package/dist/domain/receipt.js.map +1 -0
  177. package/dist/domain/refusal-record.d.ts +110 -0
  178. package/dist/domain/refusal-record.d.ts.map +1 -0
  179. package/dist/domain/refusal-record.js +2 -0
  180. package/dist/domain/refusal-record.js.map +1 -0
  181. package/dist/domain/release-approval.d.ts +14 -0
  182. package/dist/domain/release-approval.d.ts.map +1 -0
  183. package/dist/domain/release-approval.js +2 -0
  184. package/dist/domain/release-approval.js.map +1 -0
  185. package/dist/domain/signals.d.ts +10 -0
  186. package/dist/domain/signals.d.ts.map +1 -0
  187. package/dist/domain/signals.js +2 -0
  188. package/dist/domain/signals.js.map +1 -0
  189. package/dist/domain/signature-entry.d.ts +23 -0
  190. package/dist/domain/signature-entry.d.ts.map +1 -0
  191. package/dist/domain/signature-entry.js +2 -0
  192. package/dist/domain/signature-entry.js.map +1 -0
  193. package/dist/domain/signature.d.ts +26 -0
  194. package/dist/domain/signature.d.ts.map +1 -0
  195. package/dist/domain/signature.js +2 -0
  196. package/dist/domain/signature.js.map +1 -0
  197. package/dist/domain/unsigned-execution-trust-record.d.ts +7 -0
  198. package/dist/domain/unsigned-execution-trust-record.d.ts.map +1 -0
  199. package/dist/domain/unsigned-execution-trust-record.js +2 -0
  200. package/dist/domain/unsigned-execution-trust-record.js.map +1 -0
  201. package/dist/domain/verification.d.ts +48 -0
  202. package/dist/domain/verification.d.ts.map +1 -0
  203. package/dist/domain/verification.js +9 -0
  204. package/dist/domain/verification.js.map +1 -0
  205. package/dist/errors/approval-issuer-change-not-found-error.d.ts +9 -0
  206. package/dist/errors/approval-issuer-change-not-found-error.d.ts.map +1 -0
  207. package/dist/errors/approval-issuer-change-not-found-error.js +11 -0
  208. package/dist/errors/approval-issuer-change-not-found-error.js.map +1 -0
  209. package/dist/errors/authority-grant-change-not-found-error.d.ts +9 -0
  210. package/dist/errors/authority-grant-change-not-found-error.d.ts.map +1 -0
  211. package/dist/errors/authority-grant-change-not-found-error.js +11 -0
  212. package/dist/errors/authority-grant-change-not-found-error.js.map +1 -0
  213. package/dist/errors/authority-required-error.d.ts +5 -0
  214. package/dist/errors/authority-required-error.d.ts.map +1 -0
  215. package/dist/errors/authority-required-error.js +7 -0
  216. package/dist/errors/authority-required-error.js.map +1 -0
  217. package/dist/errors/authorization-no-longer-valid-error.d.ts +19 -0
  218. package/dist/errors/authorization-no-longer-valid-error.d.ts.map +1 -0
  219. package/dist/errors/authorization-no-longer-valid-error.js +23 -0
  220. package/dist/errors/authorization-no-longer-valid-error.js.map +1 -0
  221. package/dist/errors/authorization-required-error.d.ts +5 -0
  222. package/dist/errors/authorization-required-error.d.ts.map +1 -0
  223. package/dist/errors/authorization-required-error.js +7 -0
  224. package/dist/errors/authorization-required-error.js.map +1 -0
  225. package/dist/errors/business-signal-source-change-not-found-error.d.ts +9 -0
  226. package/dist/errors/business-signal-source-change-not-found-error.d.ts.map +1 -0
  227. package/dist/errors/business-signal-source-change-not-found-error.js +11 -0
  228. package/dist/errors/business-signal-source-change-not-found-error.js.map +1 -0
  229. package/dist/errors/business-transaction-not-found-error.d.ts +5 -0
  230. package/dist/errors/business-transaction-not-found-error.d.ts.map +1 -0
  231. package/dist/errors/business-transaction-not-found-error.js +7 -0
  232. package/dist/errors/business-transaction-not-found-error.js.map +1 -0
  233. package/dist/errors/challenge-record-not-found-error.d.ts +9 -0
  234. package/dist/errors/challenge-record-not-found-error.d.ts.map +1 -0
  235. package/dist/errors/challenge-record-not-found-error.js +11 -0
  236. package/dist/errors/challenge-record-not-found-error.js.map +1 -0
  237. package/dist/errors/conflict-error.d.ts +5 -0
  238. package/dist/errors/conflict-error.d.ts.map +1 -0
  239. package/dist/errors/conflict-error.js +7 -0
  240. package/dist/errors/conflict-error.js.map +1 -0
  241. package/dist/errors/connector-not-registered-error.d.ts +21 -0
  242. package/dist/errors/connector-not-registered-error.d.ts.map +1 -0
  243. package/dist/errors/connector-not-registered-error.js +24 -0
  244. package/dist/errors/connector-not-registered-error.js.map +1 -0
  245. package/dist/errors/decision-not-approved-error.d.ts +5 -0
  246. package/dist/errors/decision-not-approved-error.d.ts.map +1 -0
  247. package/dist/errors/decision-not-approved-error.js +7 -0
  248. package/dist/errors/decision-not-approved-error.js.map +1 -0
  249. package/dist/errors/duplicate-business-transaction-error.d.ts +26 -0
  250. package/dist/errors/duplicate-business-transaction-error.d.ts.map +1 -0
  251. package/dist/errors/duplicate-business-transaction-error.js +28 -0
  252. package/dist/errors/duplicate-business-transaction-error.js.map +1 -0
  253. package/dist/errors/external-connector-change-not-found-error.d.ts +9 -0
  254. package/dist/errors/external-connector-change-not-found-error.d.ts.map +1 -0
  255. package/dist/errors/external-connector-change-not-found-error.js +11 -0
  256. package/dist/errors/external-connector-change-not-found-error.js.map +1 -0
  257. package/dist/errors/forbidden-error.d.ts +5 -0
  258. package/dist/errors/forbidden-error.d.ts.map +1 -0
  259. package/dist/errors/forbidden-error.js +7 -0
  260. package/dist/errors/forbidden-error.js.map +1 -0
  261. package/dist/errors/index.d.ts +30 -0
  262. package/dist/errors/index.d.ts.map +1 -0
  263. package/dist/errors/index.js +30 -0
  264. package/dist/errors/index.js.map +1 -0
  265. package/dist/errors/intent-required-error.d.ts +5 -0
  266. package/dist/errors/intent-required-error.d.ts.map +1 -0
  267. package/dist/errors/intent-required-error.js +7 -0
  268. package/dist/errors/intent-required-error.js.map +1 -0
  269. package/dist/errors/non-human-caller-denied-error.d.ts +10 -0
  270. package/dist/errors/non-human-caller-denied-error.d.ts.map +1 -0
  271. package/dist/errors/non-human-caller-denied-error.js +12 -0
  272. package/dist/errors/non-human-caller-denied-error.js.map +1 -0
  273. package/dist/errors/nonce-already-consumed-error.d.ts +26 -0
  274. package/dist/errors/nonce-already-consumed-error.d.ts.map +1 -0
  275. package/dist/errors/nonce-already-consumed-error.js +29 -0
  276. package/dist/errors/nonce-already-consumed-error.js.map +1 -0
  277. package/dist/errors/outcome-unknown-error.d.ts +15 -0
  278. package/dist/errors/outcome-unknown-error.d.ts.map +1 -0
  279. package/dist/errors/outcome-unknown-error.js +19 -0
  280. package/dist/errors/outcome-unknown-error.js.map +1 -0
  281. package/dist/errors/override-not-allowed-error.d.ts +5 -0
  282. package/dist/errors/override-not-allowed-error.d.ts.map +1 -0
  283. package/dist/errors/override-not-allowed-error.js +7 -0
  284. package/dist/errors/override-not-allowed-error.js.map +1 -0
  285. package/dist/errors/parmana-error.d.ts +15 -0
  286. package/dist/errors/parmana-error.d.ts.map +1 -0
  287. package/dist/errors/parmana-error.js +21 -0
  288. package/dist/errors/parmana-error.js.map +1 -0
  289. package/dist/errors/pending-policy-change-not-found-error.d.ts +9 -0
  290. package/dist/errors/pending-policy-change-not-found-error.d.ts.map +1 -0
  291. package/dist/errors/pending-policy-change-not-found-error.js +11 -0
  292. package/dist/errors/pending-policy-change-not-found-error.js.map +1 -0
  293. package/dist/errors/policy-not-found-error.d.ts +5 -0
  294. package/dist/errors/policy-not-found-error.d.ts.map +1 -0
  295. package/dist/errors/policy-not-found-error.js +7 -0
  296. package/dist/errors/policy-not-found-error.js.map +1 -0
  297. package/dist/errors/receipt-generation-error.d.ts +5 -0
  298. package/dist/errors/receipt-generation-error.d.ts.map +1 -0
  299. package/dist/errors/receipt-generation-error.js +7 -0
  300. package/dist/errors/receipt-generation-error.js.map +1 -0
  301. package/dist/errors/same-actor-cannot-approve-own-change-error.d.ts +12 -0
  302. package/dist/errors/same-actor-cannot-approve-own-change-error.d.ts.map +1 -0
  303. package/dist/errors/same-actor-cannot-approve-own-change-error.js +15 -0
  304. package/dist/errors/same-actor-cannot-approve-own-change-error.js.map +1 -0
  305. package/dist/errors/step-up-authorization-invalid-error.d.ts +25 -0
  306. package/dist/errors/step-up-authorization-invalid-error.d.ts.map +1 -0
  307. package/dist/errors/step-up-authorization-invalid-error.js +28 -0
  308. package/dist/errors/step-up-authorization-invalid-error.js.map +1 -0
  309. package/dist/errors/trust-chain-validation-error.d.ts +5 -0
  310. package/dist/errors/trust-chain-validation-error.d.ts.map +1 -0
  311. package/dist/errors/trust-chain-validation-error.js +7 -0
  312. package/dist/errors/trust-chain-validation-error.js.map +1 -0
  313. package/dist/errors/unauthorized-error.d.ts +5 -0
  314. package/dist/errors/unauthorized-error.d.ts.map +1 -0
  315. package/dist/errors/unauthorized-error.js +7 -0
  316. package/dist/errors/unauthorized-error.js.map +1 -0
  317. package/dist/errors/validation-error.d.ts +5 -0
  318. package/dist/errors/validation-error.d.ts.map +1 -0
  319. package/dist/errors/validation-error.js +7 -0
  320. package/dist/errors/validation-error.js.map +1 -0
  321. package/dist/errors/verification-failed-error.d.ts +5 -0
  322. package/dist/errors/verification-failed-error.d.ts.map +1 -0
  323. package/dist/errors/verification-failed-error.js +7 -0
  324. package/dist/errors/verification-failed-error.js.map +1 -0
  325. package/dist/gateway/GatewayAuthentication.d.ts +8 -0
  326. package/dist/gateway/GatewayAuthentication.d.ts.map +1 -0
  327. package/dist/gateway/GatewayAuthentication.js +2 -0
  328. package/dist/gateway/GatewayAuthentication.js.map +1 -0
  329. package/dist/gateway/GatewayAuthenticationClaims.d.ts +10 -0
  330. package/dist/gateway/GatewayAuthenticationClaims.d.ts.map +1 -0
  331. package/dist/gateway/GatewayAuthenticationClaims.js +2 -0
  332. package/dist/gateway/GatewayAuthenticationClaims.js.map +1 -0
  333. package/dist/gateway/GatewayAuthenticationPayload.d.ts +15 -0
  334. package/dist/gateway/GatewayAuthenticationPayload.d.ts.map +1 -0
  335. package/dist/gateway/GatewayAuthenticationPayload.js +2 -0
  336. package/dist/gateway/GatewayAuthenticationPayload.js.map +1 -0
  337. package/dist/gateway/SignedGatewayAuthentication.d.ts +9 -0
  338. package/dist/gateway/SignedGatewayAuthentication.d.ts.map +1 -0
  339. package/dist/gateway/SignedGatewayAuthentication.js +2 -0
  340. package/dist/gateway/SignedGatewayAuthentication.js.map +1 -0
  341. package/dist/gateway/index.d.ts +4 -0
  342. package/dist/gateway/index.d.ts.map +1 -0
  343. package/dist/gateway/index.js +4 -0
  344. package/dist/gateway/index.js.map +1 -0
  345. package/dist/index.d.ts +19 -0
  346. package/dist/index.d.ts.map +1 -0
  347. package/dist/index.js +19 -0
  348. package/dist/index.js.map +1 -0
  349. package/dist/logging/Logger.d.ts +65 -0
  350. package/dist/logging/Logger.d.ts.map +1 -0
  351. package/dist/logging/Logger.js +97 -0
  352. package/dist/logging/Logger.js.map +1 -0
  353. package/dist/network/externalEndpointAddress.d.ts +48 -0
  354. package/dist/network/externalEndpointAddress.d.ts.map +1 -0
  355. package/dist/network/externalEndpointAddress.js +147 -0
  356. package/dist/network/externalEndpointAddress.js.map +1 -0
  357. package/dist/repositories/approval-issuer-repository.d.ts +31 -0
  358. package/dist/repositories/approval-issuer-repository.d.ts.map +1 -0
  359. package/dist/repositories/approval-issuer-repository.js +2 -0
  360. package/dist/repositories/approval-issuer-repository.js.map +1 -0
  361. package/dist/repositories/authority-grant-repository.d.ts +22 -0
  362. package/dist/repositories/authority-grant-repository.d.ts.map +1 -0
  363. package/dist/repositories/authority-grant-repository.js +2 -0
  364. package/dist/repositories/authority-grant-repository.js.map +1 -0
  365. package/dist/repositories/business-signal-source-repository.d.ts +17 -0
  366. package/dist/repositories/business-signal-source-repository.d.ts.map +1 -0
  367. package/dist/repositories/business-signal-source-repository.js +2 -0
  368. package/dist/repositories/business-signal-source-repository.js.map +1 -0
  369. package/dist/repositories/business-transaction-repository.d.ts +34 -0
  370. package/dist/repositories/business-transaction-repository.d.ts.map +1 -0
  371. package/dist/repositories/business-transaction-repository.js +2 -0
  372. package/dist/repositories/business-transaction-repository.js.map +1 -0
  373. package/dist/repositories/caller-key-revocation-repository.d.ts +26 -0
  374. package/dist/repositories/caller-key-revocation-repository.d.ts.map +1 -0
  375. package/dist/repositories/caller-key-revocation-repository.js +2 -0
  376. package/dist/repositories/caller-key-revocation-repository.js.map +1 -0
  377. package/dist/repositories/challenge-record-repository.d.ts +67 -0
  378. package/dist/repositories/challenge-record-repository.d.ts.map +1 -0
  379. package/dist/repositories/challenge-record-repository.js +76 -0
  380. package/dist/repositories/challenge-record-repository.js.map +1 -0
  381. package/dist/repositories/execution-intent-repository.d.ts +38 -0
  382. package/dist/repositories/execution-intent-repository.d.ts.map +1 -0
  383. package/dist/repositories/execution-intent-repository.js +2 -0
  384. package/dist/repositories/execution-intent-repository.js.map +1 -0
  385. package/dist/repositories/execution-trust-record-repository.d.ts +62 -0
  386. package/dist/repositories/execution-trust-record-repository.d.ts.map +1 -0
  387. package/dist/repositories/execution-trust-record-repository.js +2 -0
  388. package/dist/repositories/execution-trust-record-repository.js.map +1 -0
  389. package/dist/repositories/external-connector-repository.d.ts +37 -0
  390. package/dist/repositories/external-connector-repository.d.ts.map +1 -0
  391. package/dist/repositories/external-connector-repository.js +2 -0
  392. package/dist/repositories/external-connector-repository.js.map +1 -0
  393. package/dist/repositories/handbook-download-lead-repository.d.ts +18 -0
  394. package/dist/repositories/handbook-download-lead-repository.d.ts.map +1 -0
  395. package/dist/repositories/handbook-download-lead-repository.js +2 -0
  396. package/dist/repositories/handbook-download-lead-repository.js.map +1 -0
  397. package/dist/repositories/inbound-decision-repository.d.ts +72 -0
  398. package/dist/repositories/inbound-decision-repository.d.ts.map +1 -0
  399. package/dist/repositories/inbound-decision-repository.js +10 -0
  400. package/dist/repositories/inbound-decision-repository.js.map +1 -0
  401. package/dist/repositories/inbound-outcome-repository.d.ts +23 -0
  402. package/dist/repositories/inbound-outcome-repository.d.ts.map +1 -0
  403. package/dist/repositories/inbound-outcome-repository.js +2 -0
  404. package/dist/repositories/inbound-outcome-repository.js.map +1 -0
  405. package/dist/repositories/index.d.ts +17 -0
  406. package/dist/repositories/index.d.ts.map +1 -0
  407. package/dist/repositories/index.js +17 -0
  408. package/dist/repositories/index.js.map +1 -0
  409. package/dist/repositories/pending-policy-change-repository.d.ts +72 -0
  410. package/dist/repositories/pending-policy-change-repository.d.ts.map +1 -0
  411. package/dist/repositories/pending-policy-change-repository.js +46 -0
  412. package/dist/repositories/pending-policy-change-repository.js.map +1 -0
  413. package/dist/repositories/policy-change-approval-record-repository.d.ts +39 -0
  414. package/dist/repositories/policy-change-approval-record-repository.d.ts.map +1 -0
  415. package/dist/repositories/policy-change-approval-record-repository.js +2 -0
  416. package/dist/repositories/policy-change-approval-record-repository.js.map +1 -0
  417. package/dist/repositories/policy-repository.d.ts +15 -0
  418. package/dist/repositories/policy-repository.d.ts.map +1 -0
  419. package/dist/repositories/policy-repository.js +2 -0
  420. package/dist/repositories/policy-repository.js.map +1 -0
  421. package/dist/repositories/refusal-record-repository.d.ts +13 -0
  422. package/dist/repositories/refusal-record-repository.d.ts.map +1 -0
  423. package/dist/repositories/refusal-record-repository.js +2 -0
  424. package/dist/repositories/refusal-record-repository.js.map +1 -0
  425. package/dist/types/Json.d.ts +7 -0
  426. package/dist/types/Json.d.ts.map +1 -0
  427. package/dist/types/Json.js +2 -0
  428. package/dist/types/Json.js.map +1 -0
  429. package/dist/utils/normalize-policy.d.ts +16 -0
  430. package/dist/utils/normalize-policy.d.ts.map +1 -0
  431. package/dist/utils/normalize-policy.js +10 -0
  432. package/dist/utils/normalize-policy.js.map +1 -0
  433. package/package.json +39 -4
@@ -0,0 +1,92 @@
1
+ import { Signature } from "./signature.js";
2
+ /**
3
+ * Execution Intent (ADR-0012).
4
+ *
5
+ * A signed statement, made and persisted BEFORE an action is released to a
6
+ * connector, of exactly what is about to be released. It exists so that an
7
+ * action that was released always has signed evidence behind it, even when the
8
+ * Execution Trust Record cannot be produced afterwards (docs/internal/VERIFICATION-GAPS.md
9
+ * G-52 and G-53).
10
+ *
11
+ * What is signed is deliberately limited to facts that exist before release:
12
+ * it never contains the execution result, and it never contains the raw
13
+ * intent parameters (those are bound by `businessTransactionHash`, taken from
14
+ * the signed authorization, so the intent can be checked against the
15
+ * authorization without repeating potentially sensitive values).
16
+ *
17
+ * This is a separate record from the Execution Trust Record. The Trust Record
18
+ * keeps its format and keeps verifying offline exactly as before.
19
+ */
20
+ export interface ExecutionIntent {
21
+ readonly intentId: string;
22
+ readonly businessTransactionId: string;
23
+ readonly decisionId: string;
24
+ readonly authorizationId: string;
25
+ readonly policyName: string;
26
+ readonly policyVersion: string;
27
+ readonly policyContentHash?: string;
28
+ readonly signalsHash?: string;
29
+ /**
30
+ * Hash of the executable content, copied from the signed authorization
31
+ * payload. It binds this intent to the exact action, target and
32
+ * parameters that were authorized.
33
+ */
34
+ readonly businessTransactionHash: string;
35
+ readonly action: string;
36
+ readonly target: string;
37
+ readonly submittedBy?: string;
38
+ readonly grantedCapability?: string;
39
+ readonly createdAt: Date;
40
+ readonly intentHash: string;
41
+ readonly signature: Signature;
42
+ }
43
+ /**
44
+ * Lifecycle of an intent. This is operational state kept next to the signed
45
+ * intent, NOT part of what is signed, so it can change after signing.
46
+ *
47
+ * - PREPARED: the intent is signed and stored. The action may or may not have
48
+ * been released. An intent that stays here is the "released or not, the
49
+ * outcome is unrecorded" case and must be reconciled with the connector.
50
+ * - RELEASED: the release stage returned and the execution context was saved,
51
+ * so the Trust Record can be rebuilt from it.
52
+ * - FINALIZED: a signed Execution Trust Record exists for this transaction.
53
+ * - ERRORED: the release stage raised an error. The action may still have been
54
+ * executed, so the outcome is unknown and must be reconciled.
55
+ * - RESOLVED: a verified human reconciled a PREPARED or ERRORED intent at the
56
+ * connector and closed it, recording what they found (`resolution`) and a
57
+ * note. The resolution is an attributed operator statement stored in this
58
+ * unsigned status. It is NOT tamper evident, and it is not a Trust Record.
59
+ */
60
+ export type ExecutionIntentState = "PREPARED" | "RELEASED" | "FINALIZED" | "ERRORED" | "RESOLVED";
61
+ /**
62
+ * What an operator established at the connector when closing an intent that
63
+ * has no Trust Record: the action did not run, or it did run.
64
+ */
65
+ export type ExecutionIntentResolution = "NOT_EXECUTED" | "EXECUTED";
66
+ export type ExecutionIntentFinalizationMode = "INLINE" | "REPAIRED";
67
+ export interface ExecutionIntentStatus {
68
+ readonly state: ExecutionIntentState;
69
+ readonly releasedAt?: Date;
70
+ readonly finalizedAt?: Date;
71
+ readonly finalizationMode?: ExecutionIntentFinalizationMode;
72
+ readonly trustRecordId?: string;
73
+ readonly failureReason?: string;
74
+ readonly resolvedAt?: Date;
75
+ readonly resolvedBy?: string;
76
+ readonly resolution?: ExecutionIntentResolution;
77
+ readonly resolutionNote?: string;
78
+ }
79
+ /**
80
+ * An intent as stored: the signed record, its operational status, and the
81
+ * saved execution context used to rebuild the Trust Record when finalization
82
+ * failed. `releasedContext` is present only in state RELEASED. It is deleted
83
+ * when the intent becomes FINALIZED, because the Trust Record then holds the
84
+ * same information and keeping a second copy of the execution context serves
85
+ * no purpose.
86
+ */
87
+ export interface StoredExecutionIntent {
88
+ readonly intent: ExecutionIntent;
89
+ readonly status: ExecutionIntentStatus;
90
+ readonly releasedContext?: unknown;
91
+ }
92
+ //# sourceMappingURL=execution-intent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-intent.d.ts","sourceRo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AoB,CAAC;IAErC,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAE3B,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAE5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,+BAA+B,CAAC;IAE5D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEhC,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;IAE3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,UAAU,CAAC,EAAE,yBAAyB,CAAC;IAEhD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IAEjC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAEvC,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACpC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=execution-intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-intent.js","sourceRoot":"","sources":["../../src/domain/execution-intent.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Execution-specific metadata.
3
+ *
4
+ * Used by execution adapters and runtime
5
+ * implementations.
6
+ */
7
+ export type ExecutionMetadata = Readonly<Record<string, unknown>>;
8
+ //# sourceMappingURL=execution-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-metadata.d.ts","sourceRoot":"","sources":["../../src/domain/execution-metadata.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=execution-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-metadata.js","sourceRoot":"","sources":["../../src/domain/execution-metadata.ts"],"names":[],"mappings":""}
@@ -0,0 +1,49 @@
1
+ import type { ExecutionResult } from "./execution-result.js";
2
+ /**
3
+ * What is recorded about one authorization's execution, keyed by its nonce.
4
+ *
5
+ * - `in_flight`: the nonce was consumed and the connector was (or may have
6
+ * been) called, but no result was recorded. The effect may or may not have
7
+ * happened. A retry must not execute again and must not assume either way.
8
+ * - `completed`: the connector returned. A retry returns this result without
9
+ * calling the connector again.
10
+ */
11
+ export type ExecutionOutcome = {
12
+ readonly status: "in_flight";
13
+ } | {
14
+ readonly status: "completed";
15
+ readonly result: ExecutionResult;
16
+ };
17
+ /**
18
+ * Records the outcome of each authorization so a retry after a lost response
19
+ * can recover it instead of being refused with no information.
20
+ *
21
+ * Gap G-125 (docs/internal/VERIFICATION-GAPS.md). Single use (the nonce) still decides
22
+ * whether an authorization may execute. This store records what happened
23
+ * when it did.
24
+ *
25
+ * Implementations must make `begin` atomic: the first caller for a nonce gets
26
+ * `true`, every later caller gets `false`, even under concurrent calls. A
27
+ * nonce with no row is treated as unknown by callers.
28
+ */
29
+ export interface ExecutionOutcomeStore {
30
+ /**
31
+ * Creates an `in_flight` row for the nonce unless one already exists.
32
+ * Returns true if this call created it.
33
+ */
34
+ begin(nonce: string, expiresAt: string): Promise<boolean>;
35
+ /**
36
+ * Records the connector's result for a nonce whose row is `in_flight`.
37
+ * Throws if no in-flight row exists, so a missing record is never silent.
38
+ */
39
+ complete(nonce: string, result: ExecutionResult): Promise<void>;
40
+ /** Returns the recorded outcome, or undefined when none is recorded. */
41
+ get(nonce: string): Promise<ExecutionOutcome | undefined>;
42
+ }
43
+ /**
44
+ * Restores an ExecutionResult read back from storage. A stored result is JSON,
45
+ * so `executedAt` comes back as a string. Every store uses this so a replayed
46
+ * result has the same shape whichever store recorded it.
47
+ */
48
+ export declare function reviveExecutionResult(raw: unknown): ExecutionResult;
49
+ //# sourceMappingURL=execution-outcome-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-outcome-store.d.ts","sourceRoot":"","sources":["../../src/domain/execution-outcome-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAAE,GAChC;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC;AAEvE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1D;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE,wEAAwE;IACxE,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;CAC3D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CAInE"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Restores an ExecutionResult read back from storage. A stored result is JSON,
3
+ * so `executedAt` comes back as a string. Every store uses this so a replayed
4
+ * result has the same shape whichever store recorded it.
5
+ */
6
+ export function reviveExecutionResult(raw) {
7
+ const result = raw;
8
+ return { ...result, executedAt: new Date(result.executedAt) };
9
+ }
10
+ //# sourceMappingURL=execution-outcome-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-outcome-store.js","sourceRoot":"","sources":["../../src/domain/execution-outcome-store.ts"],"names":[],"mappings":"AA4CA;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAChD,MAAM,MAAM,GAAG,GAAsB,CAAC;IAEtC,OAAO,EAAE,GAAG,MAAM,EAAE,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;AAChE,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Execution Result
3
+ *
4
+ * Result returned by an Enterprise Execution System
5
+ * after attempting to execute a Parmana-authorized
6
+ * Business Transaction.
7
+ *
8
+ * Parmana converts an ExecutionResult into immutable
9
+ * ExecutionEvidence for storage in the Execution
10
+ * Trust Record.
11
+ */
12
+ export interface ExecutionResult {
13
+ /**
14
+ * Business Transaction that was executed.
15
+ */
16
+ readonly businessTransactionId: string;
17
+ /**
18
+ * Action that was executed.
19
+ */
20
+ readonly action: string;
21
+ /**
22
+ * Target on which the action was executed.
23
+ */
24
+ readonly target: string;
25
+ /**
26
+ * Parameters actually supplied to the
27
+ * Enterprise Execution System.
28
+ */
29
+ readonly parameters: Readonly<Record<string, unknown>>;
30
+ /**
31
+ * Whether execution succeeded.
32
+ */
33
+ readonly success: boolean;
34
+ /**
35
+ * Enterprise execution timestamp.
36
+ */
37
+ readonly executedAt: Date;
38
+ /**
39
+ * Optional execution-system-specific metadata.
40
+ *
41
+ * Examples:
42
+ * - ERP transaction ID
43
+ * - Payment reference
44
+ * - CRM record ID
45
+ * - Deployment ID
46
+ */
47
+ readonly metadata?: Readonly<Record<string, unknown>>;
48
+ }
49
+ //# sourceMappingURL=execution-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-result.d.ts","sourceRoot":"","sources":["../../src/domain/execution-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvD;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAE1B;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=execution-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-result.js","sourceRoot":"","sources":["../../src/domain/execution-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,142 @@
1
+ import { BusinessTransaction } from "./business-transaction.js";
2
+ import { Execution } from "./execution.js";
3
+ import { Override } from "./override.js";
4
+ import { Verification } from "./verification.js";
5
+ import { Receipt } from "./receipt.js";
6
+ import { Signature } from "./signature.js";
7
+ import { SignatureEntry } from "./signature-entry.js";
8
+ import { SignedExecutionAuthorization } from "./execution-authorization.js";
9
+ import { EvidenceAnchor } from "./evidence-anchor.js";
10
+ /**
11
+ * Parmana Trust Core
12
+ *
13
+ * Execution Trust Record
14
+ *
15
+ * Canonical immutable record representing everything
16
+ * Parmana knows about a Business Transaction.
17
+ *
18
+ * The Execution Trust Record is the authoritative
19
+ * source for replay, verification, audit, and
20
+ * receipt generation.
21
+ */
22
+ export interface ExecutionTrustRecord {
23
+ /**
24
+ * Unique Execution Trust Record identifier.
25
+ */
26
+ readonly trustRecordId: string;
27
+ /**
28
+ * Business Transaction identifier.
29
+ */
30
+ readonly businessTransactionId: string;
31
+ /**
32
+ * Canonical Business Transaction.
33
+ */
34
+ readonly transaction: BusinessTransaction;
35
+ /**
36
+ * Optional Override history.
37
+ *
38
+ * Business rules currently allow a single accepted
39
+ * Override, but the history is modeled as an array
40
+ * to preserve append-only evolution.
41
+ */
42
+ readonly overrides: readonly Override[];
43
+ /**
44
+ * Execution history.
45
+ *
46
+ * Multiple Executions may exist for long-running
47
+ * workflows, retries, or future execution models.
48
+ */
49
+ readonly executions: readonly Execution[];
50
+ /**
51
+ * Verification history.
52
+ *
53
+ * Every verification produces a new immutable
54
+ * Verification artifact.
55
+ */
56
+ readonly verifications: readonly Verification[];
57
+ /**
58
+ * Receipt history.
59
+ *
60
+ * Receipts are immutable cryptographic attestations
61
+ * of Execution Trust Record state.
62
+ */
63
+ readonly receipts: readonly Receipt[];
64
+ /**
65
+ * The Signed Execution Authorization the Execution Gateway accepted
66
+ * for this transaction -- the exact nonce, expiry, businessTransaction/
67
+ * policy/signals hashes, and signature ExecutionGateway.verify()
68
+ * checked before dispatching to a connector.
69
+ *
70
+ * Absent for any Trust Record built before this field existed, or
71
+ * for a transaction that never reached execution (e.g. a policy
72
+ * rejection, which never produces an authorization at all). Absent
73
+ * is not a defect: it means "no authorization exists for this
74
+ * record," not "one exists but wasn't captured." A present value is
75
+ * included in the canonical hash/signature (see
76
+ * VerificationCrypto.canonicalRecord()) so a loaded record's
77
+ * authorization cannot be swapped or stripped without invalidating
78
+ * trustRecordHash/signature -- verified independently of the
79
+ * authorization's own embedded signature, which an auditor can also
80
+ * check on its own terms via AuthorizationVerifier (@parmana/crypto).
81
+ */
82
+ readonly authorization?: SignedExecutionAuthorization;
83
+ /**
84
+ * Canonical hash of the Execution Trust Record.
85
+ *
86
+ * Computed over the canonical serialized form of
87
+ * this aggregate.
88
+ */
89
+ readonly trustRecordHash: string;
90
+ /**
91
+ * Cryptographic signature over the canonical
92
+ * Execution Trust Record.
93
+ *
94
+ * This proves the Trust Record was produced by
95
+ * Parmana and has not been modified since signing.
96
+ */
97
+ readonly signature: Signature;
98
+ /**
99
+ * Envelope schema version (Hybrid Signature Support milestone,
100
+ * Phase A). Absent means schema v1: exactly today's shape,
101
+ * `signature` is the sole cryptographic attestation. Present and
102
+ * >= 2 means `signatures` (below) was populated at signing time and
103
+ * MUST be independently verified in full -- see
104
+ * HybridSignatureProvider (@parmana/crypto). Optional rather than
105
+ * defaulted so every pre-existing construction site (including
106
+ * historical records already in storage) keeps compiling and
107
+ * verifying unchanged; readers MUST treat an absent value as v1.
108
+ */
109
+ readonly schemaVersion?: number;
110
+ /**
111
+ * Additional signatures over this record, one per algorithm,
112
+ * produced only when CRYPTO_MODE=hybrid was active at signing time.
113
+ * `signature` above remains the authoritative single-algorithm
114
+ * attestation (unchanged, always present); this array is additive
115
+ * proof that a second, independent algorithm also signed the same
116
+ * content. A verifier that finds this array non-empty MUST require
117
+ * every entry to verify -- a missing or malformed entry is a
118
+ * rejection, never a silent fallback to `signature` alone.
119
+ */
120
+ readonly signatures?: readonly SignatureEntry[];
121
+ /**
122
+ * UTC timestamp when the Execution Trust Record
123
+ * was first created.
124
+ */
125
+ readonly createdAt: Date;
126
+ /**
127
+ * UTC timestamp when the Execution Trust Record
128
+ * was last extended with a new immutable artifact.
129
+ */
130
+ readonly updatedAt: Date;
131
+ /**
132
+ * Explicit binding artifact linking policy-governance provenance
133
+ * (transaction.policy.contentHash/governanceAnchor, G-24/G-45) to
134
+ * what a connector actually did (executions[].evidence.attributes.connector,
135
+ * G-46) -- see EvidenceAnchor's own doc comment
136
+ * (docs/internal/VERIFICATION-GAPS.md G-45's residual "Record 3 is outside
137
+ * all three [policy-governance] mechanisms" note). Absent on a
138
+ * Trust Record built before this field existed.
139
+ */
140
+ readonly evidenceAnchor?: EvidenceAnchor;
141
+ }
142
+ //# sourceMappingURL=execution-trust-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-trust-record.d.ts","sourceRoot":"","sources":["../../src/domain/execution-trust-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,SAAS,E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SAAS,cAAc,EAAE,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IAEzB;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=execution-trust-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-trust-record.js","sourceRoot":"","sources":["../../src/domain/execution-trust-record.ts"],"names":[],"mappings":""}
@@ -0,0 +1,108 @@
1
+ import { Decision } from "./decision.js";
2
+ import { ExecutionEvidence } from "./execution-evidence.js";
3
+ import { ExecutionMetadata } from "./execution-metadata.js";
4
+ import type { Signature } from "./signature.js";
5
+ /**
6
+ * Parmana Trust Core
7
+ *
8
+ * Execution
9
+ *
10
+ * Records what actually happened while processing a
11
+ * Business Transaction.
12
+ *
13
+ * Every Execution records exactly one immutable
14
+ * Decision produced by deterministic Policy
15
+ * evaluation.
16
+ *
17
+ * Executions are immutable trust artifacts and
18
+ * become part of the Execution Trust Record.
19
+ */
20
+ export interface Execution {
21
+ /**
22
+ * Unique Execution identifier.
23
+ */
24
+ readonly executionId: string;
25
+ /**
26
+ * Business Transaction to which this Execution belongs.
27
+ */
28
+ readonly businessTransactionId: string;
29
+ /**
30
+ * Immutable Decision produced by this Execution.
31
+ *
32
+ * The Decision is generated by evaluating the
33
+ * referenced Policy against the supplied runtime
34
+ * signals.
35
+ */
36
+ readonly decision: Decision;
37
+ /**
38
+ * Execution lifecycle state.
39
+ */
40
+ readonly status: ExecutionStatus;
41
+ /**
42
+ * Execution mode.
43
+ */
44
+ readonly mode: ExecutionMode;
45
+ /**
46
+ * UTC timestamp when execution started.
47
+ */
48
+ readonly startedAt: Date;
49
+ /**
50
+ * UTC timestamp when execution completed.
51
+ *
52
+ * Present only for terminal executions.
53
+ */
54
+ readonly completedAt?: Date;
55
+ /**
56
+ * Immutable execution evidence.
57
+ */
58
+ readonly evidence?: ExecutionEvidence;
59
+ /**
60
+ * Execution-specific metadata.
61
+ */
62
+ readonly metadata?: ExecutionMetadata;
63
+ /**
64
+ * chainHash of the chain predecessor -- the prior Execution
65
+ * belonging to the same businessTransactionId -- or null for the
66
+ * first Execution in that transaction's chain. Fixed once, at this
67
+ * Execution's first creation; unlike chainHash/chainSignature, it
68
+ * does not change across this row's own lifecycle transitions
69
+ * (see ExecutionChainCrypto in @parmana/crypto).
70
+ *
71
+ * Optional so every pre-existing construction site and historical
72
+ * row (written before this field existed) keeps compiling and
73
+ * verifying unchanged -- an absent value means "not chain-
74
+ * protected," not "broken chain."
75
+ */
76
+ readonly previousChainHash?: string | null;
77
+ /**
78
+ * Signed hash of this Execution's own canonical content plus
79
+ * previousChainHash. Recomputed on every legitimate mutation of
80
+ * this row (attachEvidence/complete/fail), since those change what
81
+ * this hash covers.
82
+ */
83
+ readonly chainHash?: string;
84
+ /**
85
+ * Digital signature over the same canonical content chainHash was
86
+ * computed from. Signed with Parmana's own signing key, so an
87
+ * actor with database write access but not the private key cannot
88
+ * forge a replacement chainHash/chainSignature pair -- see
89
+ * ExecutionChainCrypto.
90
+ */
91
+ readonly chainSignature?: Signature;
92
+ }
93
+ /**
94
+ * Canonical execution lifecycle.
95
+ */
96
+ export declare enum ExecutionStatus {
97
+ PROCESSING = "PROCESSING",
98
+ COMPLETED = "COMPLETED",
99
+ FAILED = "FAILED"
100
+ }
101
+ /**
102
+ * Execution mode.
103
+ */
104
+ export declare enum ExecutionMode {
105
+ SYNC = "SYNC",
106
+ ASYNC = "ASYNC"
107
+ }
108
+ //# sourceMappingURL=execution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/domain/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,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ionStatus["PROCESSING"] = "PROCESSING";
7
+ ExecutionStatus["COMPLETED"] = "COMPLETED";
8
+ ExecutionStatus["FAILED"] = "FAILED";
9
+ })(ExecutionStatus || (ExecutionStatus = {}));
10
+ /**
11
+ * Execution mode.
12
+ */
13
+ export var ExecutionMode;
14
+ (function (ExecutionMode) {
15
+ ExecutionMode["SYNC"] = "SYNC";
16
+ ExecutionMode["ASYNC"] = "ASYNC";
17
+ })(ExecutionMode || (ExecutionMode = {}));
18
+ //# sourceMappingURL=execution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/domain/execution.ts"],"names":[],"mappings":"AAyGA;;GAEG;AACH,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,4CAAyB,CAAA;IAEzB,0CAAuB,CAAA;IAEvB,oCAAiB,CAAA;AACnB,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,8BAAa,CAAA;IAEb,gCAAe,CAAA;AACjB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
@@ -0,0 +1,68 @@
1
+ import type { PendingPolicyChangeStatus } from "./pending-policy-change.js";
2
+ /**
3
+ * An external connector (ADR-0013): a capability bound to an HTTPS
4
+ * endpoint an operator runs, and to the policy that governs it,
5
+ * registered through maker checker (external-connectors.ts) instead of
6
+ * a deploy. When a request for the capability is approved, Parmana
7
+ * releases it to the endpoint as a signed release.
8
+ */
9
+ export interface ExternalConnectorRegistration {
10
+ /**
11
+ * The changeId of the approved register change that created it. Its
12
+ * proposedBy and resolvedBy say who asked and who approved.
13
+ */
14
+ readonly registrationId: string;
15
+ /**
16
+ * namespace:verb, never in a built in connector's namespace.
17
+ */
18
+ readonly capability: string;
19
+ /**
20
+ * https only, a public host. Also the audience of every release to it.
21
+ */
22
+ readonly endpointUrl: string;
23
+ /**
24
+ * The name of the policy that governs the capability. The version in
25
+ * effect is decided by policy governance, as for every policy.
26
+ */
27
+ readonly policy: string;
28
+ /**
29
+ * The only parameter names Parmana forwards. A request with any other
30
+ * parameter is refused before release.
31
+ */
32
+ readonly allowedParameters: readonly string[];
33
+ readonly timeoutMs: number;
34
+ /**
35
+ * One active registration per capability. Nothing is deleted.
36
+ */
37
+ readonly status: "active" | "revoked";
38
+ readonly registeredAt: Date;
39
+ readonly revokedByChangeId?: string;
40
+ readonly revokedAt?: Date;
41
+ }
42
+ export type ExternalConnectorChangeAction = "register" | "revoke";
43
+ /**
44
+ * A proposal to register or revoke an external connector, and its
45
+ * resolution. One person proposes; a different person approves or
46
+ * rejects it with a step up signature. Only an approved change touches
47
+ * external_connectors.
48
+ */
49
+ export interface ExternalConnectorChange {
50
+ readonly changeId: string;
51
+ readonly action: ExternalConnectorChangeAction;
52
+ readonly capability: string;
53
+ /**
54
+ * Required to register, absent to revoke.
55
+ */
56
+ readonly endpointUrl?: string;
57
+ readonly policy?: string;
58
+ readonly allowedParameters?: readonly string[];
59
+ readonly timeoutMs?: number;
60
+ readonly reason: string;
61
+ readonly proposedBy: string;
62
+ readonly proposedAt: Date;
63
+ readonly status: PendingPolicyChangeStatus;
64
+ readonly resolvedBy?: string;
65
+ readonly resolvedAt?: Date;
66
+ readonly rejectionReason?: string;
67
+ }
68
+ //# sourceMappingURL=external-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"external-connector.d.ts","sourceRoot":"","sources":["../../src/domain/external-connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;;OAGG;I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