@decionis/agentsafe 0.6.0 → 0.8.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 (288) hide show
  1. package/README.md +68 -20
  2. package/dist/Cli.js +30 -3
  3. package/dist/Cli.js.map +1 -1
  4. package/dist/Index.d.ts +5 -3
  5. package/dist/Index.d.ts.map +1 -1
  6. package/dist/Index.js +3 -1
  7. package/dist/Index.js.map +1 -1
  8. package/dist/TrustedExecutor.d.ts.map +1 -1
  9. package/dist/TrustedExecutor.js +2 -0
  10. package/dist/TrustedExecutor.js.map +1 -1
  11. package/dist/acceptance/AcceptancePlan.d.ts +109 -0
  12. package/dist/acceptance/AcceptancePlan.d.ts.map +1 -0
  13. package/dist/acceptance/AcceptancePlan.js +128 -0
  14. package/dist/acceptance/AcceptancePlan.js.map +1 -0
  15. package/dist/acceptance/AcceptanceReport.d.ts +596 -0
  16. package/dist/acceptance/AcceptanceReport.d.ts.map +1 -0
  17. package/dist/acceptance/AcceptanceReport.js +361 -0
  18. package/dist/acceptance/AcceptanceReport.js.map +1 -0
  19. package/dist/acceptance/AcceptanceRun.d.ts +118 -0
  20. package/dist/acceptance/AcceptanceRun.d.ts.map +1 -0
  21. package/dist/acceptance/AcceptanceRun.js +419 -0
  22. package/dist/acceptance/AcceptanceRun.js.map +1 -0
  23. package/dist/acceptance/Coverage.d.ts +12 -0
  24. package/dist/acceptance/Coverage.d.ts.map +1 -0
  25. package/dist/acceptance/Coverage.js +48 -0
  26. package/dist/acceptance/Coverage.js.map +1 -0
  27. package/dist/acceptance/OutageDoubles.d.ts +34 -0
  28. package/dist/acceptance/OutageDoubles.d.ts.map +1 -0
  29. package/dist/acceptance/OutageDoubles.js +67 -0
  30. package/dist/acceptance/OutageDoubles.js.map +1 -0
  31. package/dist/acceptance/ZoneProbes.d.ts +368 -0
  32. package/dist/acceptance/ZoneProbes.d.ts.map +1 -0
  33. package/dist/acceptance/ZoneProbes.js +488 -0
  34. package/dist/acceptance/ZoneProbes.js.map +1 -0
  35. package/dist/adapters/JcsDigest.d.ts +6 -5
  36. package/dist/adapters/JcsDigest.d.ts.map +1 -1
  37. package/dist/adapters/JcsDigest.js +9 -8
  38. package/dist/adapters/JcsDigest.js.map +1 -1
  39. package/dist/adapters/mcp/McpGuard.d.ts +32 -3
  40. package/dist/adapters/mcp/McpGuard.d.ts.map +1 -1
  41. package/dist/adapters/mcp/McpGuard.js +29 -5
  42. package/dist/adapters/mcp/McpGuard.js.map +1 -1
  43. package/dist/adapters/mcp/McpIntentBinder.d.ts +18 -3
  44. package/dist/adapters/mcp/McpIntentBinder.d.ts.map +1 -1
  45. package/dist/adapters/mcp/McpIntentBinder.js +48 -1
  46. package/dist/adapters/mcp/McpIntentBinder.js.map +1 -1
  47. package/dist/adapters/mcp/McpInvocation.d.ts +9 -2
  48. package/dist/adapters/mcp/McpInvocation.d.ts.map +1 -1
  49. package/dist/adapters/mcp/McpInvocation.js.map +1 -1
  50. package/dist/cli/Accept.d.ts +9 -0
  51. package/dist/cli/Accept.d.ts.map +1 -0
  52. package/dist/cli/Accept.js +209 -0
  53. package/dist/cli/Accept.js.map +1 -0
  54. package/dist/cli/Actions.d.ts +16 -0
  55. package/dist/cli/Actions.d.ts.map +1 -0
  56. package/dist/cli/Actions.js +194 -0
  57. package/dist/cli/Actions.js.map +1 -0
  58. package/dist/cli/Arguments.d.ts +4 -0
  59. package/dist/cli/Arguments.d.ts.map +1 -1
  60. package/dist/cli/Arguments.js +12 -3
  61. package/dist/cli/Arguments.js.map +1 -1
  62. package/dist/cli/Commands.d.ts +1 -1
  63. package/dist/cli/Commands.d.ts.map +1 -1
  64. package/dist/cli/Commands.js +5 -0
  65. package/dist/cli/Commands.js.map +1 -1
  66. package/dist/cli/ConfigCommand.d.ts.map +1 -1
  67. package/dist/cli/ConfigCommand.js +10 -0
  68. package/dist/cli/ConfigCommand.js.map +1 -1
  69. package/dist/cli/Doctor.d.ts.map +1 -1
  70. package/dist/cli/Doctor.js +67 -1
  71. package/dist/cli/Doctor.js.map +1 -1
  72. package/dist/cli/Help.d.ts.map +1 -1
  73. package/dist/cli/Help.js +18 -1
  74. package/dist/cli/Help.js.map +1 -1
  75. package/dist/cli/Host.d.ts +5 -2
  76. package/dist/cli/Host.d.ts.map +1 -1
  77. package/dist/cli/Host.js +24 -2
  78. package/dist/cli/Host.js.map +1 -1
  79. package/dist/cli/Identity.d.ts +13 -1
  80. package/dist/cli/Identity.d.ts.map +1 -1
  81. package/dist/cli/Identity.js +25 -2
  82. package/dist/cli/Identity.js.map +1 -1
  83. package/dist/cli/Profile.d.ts +24 -0
  84. package/dist/cli/Profile.d.ts.map +1 -0
  85. package/dist/cli/Profile.js +168 -0
  86. package/dist/cli/Profile.js.map +1 -0
  87. package/dist/cli/Records.d.ts +15 -0
  88. package/dist/cli/Records.d.ts.map +1 -0
  89. package/dist/cli/Records.js +205 -0
  90. package/dist/cli/Records.js.map +1 -0
  91. package/dist/cli/Status.d.ts +23 -0
  92. package/dist/cli/Status.d.ts.map +1 -1
  93. package/dist/cli/Status.js +80 -18
  94. package/dist/cli/Status.js.map +1 -1
  95. package/dist/cli/VerifyAcceptance.d.ts +38 -0
  96. package/dist/cli/VerifyAcceptance.d.ts.map +1 -0
  97. package/dist/cli/VerifyAcceptance.js +143 -0
  98. package/dist/cli/VerifyAcceptance.js.map +1 -0
  99. package/dist/config/ConfigKeys.d.ts +2 -2
  100. package/dist/config/ConfigKeys.d.ts.map +1 -1
  101. package/dist/config/ConfigKeys.js +6 -0
  102. package/dist/config/ConfigKeys.js.map +1 -1
  103. package/dist/config/ExecutorConfig.d.ts +35 -1
  104. package/dist/config/ExecutorConfig.d.ts.map +1 -1
  105. package/dist/config/ExecutorConfig.js +53 -1
  106. package/dist/config/ExecutorConfig.js.map +1 -1
  107. package/dist/egress/ZoneHttpClient.d.ts +3 -0
  108. package/dist/egress/ZoneHttpClient.d.ts.map +1 -0
  109. package/dist/egress/ZoneHttpClient.js +72 -0
  110. package/dist/egress/ZoneHttpClient.js.map +1 -0
  111. package/dist/exposure/DecionisExposureLedger.d.ts +44 -0
  112. package/dist/exposure/DecionisExposureLedger.d.ts.map +1 -0
  113. package/dist/exposure/DecionisExposureLedger.js +175 -0
  114. package/dist/exposure/DecionisExposureLedger.js.map +1 -0
  115. package/dist/exposure/ExposureDeclaration.d.ts +68 -0
  116. package/dist/exposure/ExposureDeclaration.d.ts.map +1 -0
  117. package/dist/exposure/ExposureDeclaration.js +83 -0
  118. package/dist/exposure/ExposureDeclaration.js.map +1 -0
  119. package/dist/exposure/ExposureFacts.d.ts +61 -0
  120. package/dist/exposure/ExposureFacts.d.ts.map +1 -0
  121. package/dist/exposure/ExposureFacts.js +201 -0
  122. package/dist/exposure/ExposureFacts.js.map +1 -0
  123. package/dist/exposure/ExposureGate.d.ts +144 -0
  124. package/dist/exposure/ExposureGate.d.ts.map +1 -0
  125. package/dist/exposure/ExposureGate.js +446 -0
  126. package/dist/exposure/ExposureGate.js.map +1 -0
  127. package/dist/exposure/ExposureLedger.d.ts +93 -0
  128. package/dist/exposure/ExposureLedger.d.ts.map +1 -0
  129. package/dist/exposure/ExposureLedger.js +24 -0
  130. package/dist/exposure/ExposureLedger.js.map +1 -0
  131. package/dist/gateway/AttemptStore.d.ts +83 -0
  132. package/dist/gateway/AttemptStore.d.ts.map +1 -0
  133. package/dist/gateway/AttemptStore.js +229 -0
  134. package/dist/gateway/AttemptStore.js.map +1 -0
  135. package/dist/gateway/ForwardHandler.d.ts +50 -6
  136. package/dist/gateway/ForwardHandler.d.ts.map +1 -1
  137. package/dist/gateway/ForwardHandler.js +58 -14
  138. package/dist/gateway/ForwardHandler.js.map +1 -1
  139. package/dist/gateway/Gateway.d.ts +347 -15
  140. package/dist/gateway/Gateway.d.ts.map +1 -1
  141. package/dist/gateway/Gateway.js +1524 -63
  142. package/dist/gateway/Gateway.js.map +1 -1
  143. package/dist/gateway/GatewayConfig.d.ts +295 -0
  144. package/dist/gateway/GatewayConfig.d.ts.map +1 -1
  145. package/dist/gateway/GatewayConfig.js +485 -13
  146. package/dist/gateway/GatewayConfig.js.map +1 -1
  147. package/dist/gateway/GatewayManifest.d.ts +18 -0
  148. package/dist/gateway/GatewayManifest.d.ts.map +1 -0
  149. package/dist/gateway/GatewayManifest.js +42 -0
  150. package/dist/gateway/GatewayManifest.js.map +1 -0
  151. package/dist/gateway/GatewayMetrics.d.ts +12 -4
  152. package/dist/gateway/GatewayMetrics.d.ts.map +1 -1
  153. package/dist/gateway/GatewayMetrics.js +5 -0
  154. package/dist/gateway/GatewayMetrics.js.map +1 -1
  155. package/dist/gateway/GatewayReport.d.ts +39 -2
  156. package/dist/gateway/GatewayReport.d.ts.map +1 -1
  157. package/dist/gateway/GatewayReport.js +14 -0
  158. package/dist/gateway/GatewayReport.js.map +1 -1
  159. package/dist/gateway/HoldStore.d.ts +89 -0
  160. package/dist/gateway/HoldStore.d.ts.map +1 -0
  161. package/dist/gateway/HoldStore.js +280 -0
  162. package/dist/gateway/HoldStore.js.map +1 -0
  163. package/dist/gateway/InterceptedRequest.d.ts +55 -1
  164. package/dist/gateway/InterceptedRequest.d.ts.map +1 -1
  165. package/dist/gateway/InterceptedRequest.js +63 -1
  166. package/dist/gateway/InterceptedRequest.js.map +1 -1
  167. package/dist/gateway/PolicySelector.d.ts +5 -0
  168. package/dist/gateway/PolicySelector.d.ts.map +1 -0
  169. package/dist/gateway/PolicySelector.js +9 -0
  170. package/dist/gateway/PolicySelector.js.map +1 -0
  171. package/dist/gateway/RouteTable.d.ts +72 -7
  172. package/dist/gateway/RouteTable.d.ts.map +1 -1
  173. package/dist/gateway/RouteTable.js +133 -9
  174. package/dist/gateway/RouteTable.js.map +1 -1
  175. package/dist/gateway/ShadowLedger.d.ts +11 -0
  176. package/dist/gateway/ShadowLedger.d.ts.map +1 -1
  177. package/dist/gateway/ShadowLedger.js +11 -0
  178. package/dist/gateway/ShadowLedger.js.map +1 -1
  179. package/dist/gateway/SubjectSessions.d.ts +113 -0
  180. package/dist/gateway/SubjectSessions.d.ts.map +1 -0
  181. package/dist/gateway/SubjectSessions.js +219 -0
  182. package/dist/gateway/SubjectSessions.js.map +1 -0
  183. package/dist/gateway/TargetEffect.d.ts +74 -0
  184. package/dist/gateway/TargetEffect.d.ts.map +1 -0
  185. package/dist/gateway/TargetEffect.js +95 -0
  186. package/dist/gateway/TargetEffect.js.map +1 -0
  187. package/dist/gateway/TargetReader.d.ts +70 -0
  188. package/dist/gateway/TargetReader.d.ts.map +1 -0
  189. package/dist/gateway/TargetReader.js +106 -0
  190. package/dist/gateway/TargetReader.js.map +1 -0
  191. package/dist/gateway/Upstream.d.ts +26 -0
  192. package/dist/gateway/Upstream.d.ts.map +1 -1
  193. package/dist/gateway/Upstream.js +42 -3
  194. package/dist/gateway/Upstream.js.map +1 -1
  195. package/dist/hosted/TenantHost.d.ts +26 -6
  196. package/dist/hosted/TenantHost.d.ts.map +1 -1
  197. package/dist/hosted/TenantHost.js +45 -10
  198. package/dist/hosted/TenantHost.js.map +1 -1
  199. package/dist/hosted/TenantRegistry.d.ts +28 -0
  200. package/dist/hosted/TenantRegistry.d.ts.map +1 -1
  201. package/dist/hosted/TenantRegistry.js +60 -1
  202. package/dist/hosted/TenantRegistry.js.map +1 -1
  203. package/dist/http/GatewayHttpServer.d.ts +7 -0
  204. package/dist/http/GatewayHttpServer.d.ts.map +1 -1
  205. package/dist/http/GatewayHttpServer.js +103 -3
  206. package/dist/http/GatewayHttpServer.js.map +1 -1
  207. package/dist/identity/WorkloadJwtVerifier.d.ts +13 -0
  208. package/dist/identity/WorkloadJwtVerifier.d.ts.map +1 -1
  209. package/dist/identity/WorkloadJwtVerifier.js +40 -8
  210. package/dist/identity/WorkloadJwtVerifier.js.map +1 -1
  211. package/dist/incident/HaltSwitch.d.ts +10 -2
  212. package/dist/incident/HaltSwitch.d.ts.map +1 -1
  213. package/dist/incident/HaltSwitch.js +22 -2
  214. package/dist/incident/HaltSwitch.js.map +1 -1
  215. package/dist/incident/SecurityEvents.d.ts +18 -0
  216. package/dist/incident/SecurityEvents.d.ts.map +1 -1
  217. package/dist/incident/SecurityEvents.js +17 -0
  218. package/dist/incident/SecurityEvents.js.map +1 -1
  219. package/dist/limits/HardLimits.d.ts.map +1 -1
  220. package/dist/limits/HardLimits.js.map +1 -1
  221. package/dist/outcomes/CardOutcomeEvidence.d.ts +56 -0
  222. package/dist/outcomes/CardOutcomeEvidence.d.ts.map +1 -0
  223. package/dist/outcomes/CardOutcomeEvidence.js +211 -0
  224. package/dist/outcomes/CardOutcomeEvidence.js.map +1 -0
  225. package/dist/outcomes/CardOutcomeFact.d.ts +90 -0
  226. package/dist/outcomes/CardOutcomeFact.d.ts.map +1 -0
  227. package/dist/outcomes/CardOutcomeFact.js +76 -0
  228. package/dist/outcomes/CardOutcomeFact.js.map +1 -0
  229. package/dist/outcomes/CardOutcomeLedger.d.ts +26 -0
  230. package/dist/outcomes/CardOutcomeLedger.d.ts.map +1 -0
  231. package/dist/outcomes/CardOutcomeLedger.js +31 -0
  232. package/dist/outcomes/CardOutcomeLedger.js.map +1 -0
  233. package/dist/outcomes/CardOutcomeRecorder.d.ts +35 -0
  234. package/dist/outcomes/CardOutcomeRecorder.d.ts.map +1 -0
  235. package/dist/outcomes/CardOutcomeRecorder.js +84 -0
  236. package/dist/outcomes/CardOutcomeRecorder.js.map +1 -0
  237. package/dist/outcomes/CardOutcomes.d.ts +68 -0
  238. package/dist/outcomes/CardOutcomes.d.ts.map +1 -0
  239. package/dist/outcomes/CardOutcomes.js +191 -0
  240. package/dist/outcomes/CardOutcomes.js.map +1 -0
  241. package/dist/outcomes/CoreOutcomeEvidenceClient.d.ts +54 -0
  242. package/dist/outcomes/CoreOutcomeEvidenceClient.d.ts.map +1 -0
  243. package/dist/outcomes/CoreOutcomeEvidenceClient.js +116 -0
  244. package/dist/outcomes/CoreOutcomeEvidenceClient.js.map +1 -0
  245. package/dist/outcomes/FileCardOutcomeLedger.d.ts +36 -0
  246. package/dist/outcomes/FileCardOutcomeLedger.d.ts.map +1 -0
  247. package/dist/outcomes/FileCardOutcomeLedger.js +152 -0
  248. package/dist/outcomes/FileCardOutcomeLedger.js.map +1 -0
  249. package/dist/outcomes/OutcomeEvidence.d.ts +238 -0
  250. package/dist/outcomes/OutcomeEvidence.d.ts.map +1 -0
  251. package/dist/outcomes/OutcomeEvidence.js +130 -0
  252. package/dist/outcomes/OutcomeEvidence.js.map +1 -0
  253. package/dist/outcomes/OutcomeEvidencePublisher.d.ts +81 -0
  254. package/dist/outcomes/OutcomeEvidencePublisher.d.ts.map +1 -0
  255. package/dist/outcomes/OutcomeEvidencePublisher.js +189 -0
  256. package/dist/outcomes/OutcomeEvidencePublisher.js.map +1 -0
  257. package/dist/outcomes/OutcomeEvidenceStore.d.ts +57 -0
  258. package/dist/outcomes/OutcomeEvidenceStore.d.ts.map +1 -0
  259. package/dist/outcomes/OutcomeEvidenceStore.js +191 -0
  260. package/dist/outcomes/OutcomeEvidenceStore.js.map +1 -0
  261. package/dist/posture/ActionSpaceDrift.d.ts +40 -0
  262. package/dist/posture/ActionSpaceDrift.d.ts.map +1 -0
  263. package/dist/posture/ActionSpaceDrift.js +67 -0
  264. package/dist/posture/ActionSpaceDrift.js.map +1 -0
  265. package/dist/posture/DeploymentFingerprint.d.ts +88 -0
  266. package/dist/posture/DeploymentFingerprint.d.ts.map +1 -0
  267. package/dist/posture/DeploymentFingerprint.js +78 -0
  268. package/dist/posture/DeploymentFingerprint.js.map +1 -0
  269. package/dist/secrets/SecretStore.d.ts +6 -1
  270. package/dist/secrets/SecretStore.d.ts.map +1 -1
  271. package/dist/secrets/SecretStore.js.map +1 -1
  272. package/dist/service/EscalationResolver.d.ts +6 -6
  273. package/dist/service/EscalationResolver.d.ts.map +1 -1
  274. package/dist/service/EscalationResolver.js +8 -4
  275. package/dist/service/EscalationResolver.js.map +1 -1
  276. package/dist/service/Requests.d.ts +6 -0
  277. package/dist/service/Requests.d.ts.map +1 -1
  278. package/dist/service/Requests.js +9 -1
  279. package/dist/service/Requests.js.map +1 -1
  280. package/dist/service/TrustedExecutorService.d.ts +21 -1
  281. package/dist/service/TrustedExecutorService.d.ts.map +1 -1
  282. package/dist/service/TrustedExecutorService.js +54 -13
  283. package/dist/service/TrustedExecutorService.js.map +1 -1
  284. package/dist/verify/VerifyingProvider.d.ts +32 -6
  285. package/dist/verify/VerifyingProvider.d.ts.map +1 -1
  286. package/dist/verify/VerifyingProvider.js +16 -2
  287. package/dist/verify/VerifyingProvider.js.map +1 -1
  288. package/package.json +7 -6
@@ -0,0 +1,93 @@
1
+ /**
2
+ * The exposure ledger the gateway records money releases against: the
3
+ * organisation's cumulative limits, read from its active policy, and a
4
+ * reservation per limit that is settled once the payment happened and
5
+ * released when it did not. Decionis keeps it (DecionisExposureLedger); a
6
+ * deployment may supply its own through the same interface.
7
+ */
8
+ /** One cumulative limit, as much of it as the gateway needs to decide whether it applies. */
9
+ export interface ExposureLimit {
10
+ readonly key: string;
11
+ /** `refund`, `price_drop`, `discount`, `payment_release` or `sequence`. */
12
+ readonly kind: string;
13
+ /** Whose total it caps: `vendor`, `customer`, `sku`, `agent` or `org`. */
14
+ readonly subject: string;
15
+ readonly onExceed: "HOLD" | "ESCALATE";
16
+ /** The action types it covers, its defaults already applied by the ledger. */
17
+ readonly actionTypes: readonly string[];
18
+ /** The actor types it is limited to; absent, every actor. */
19
+ readonly actorTypes?: readonly string[];
20
+ /** A sequence limit's segregation-of-duties steps. */
21
+ readonly steps?: readonly string[];
22
+ /** An amount limit's caps, in integer minor units per currency. */
23
+ readonly caps?: readonly {
24
+ readonly currency: string;
25
+ readonly maxAmount: number;
26
+ }[];
27
+ }
28
+ /** One subject's current use of an amount limit, per currency, in integer minor units. */
29
+ export interface ExposureSubjectUsage {
30
+ readonly currency: string;
31
+ readonly used: number;
32
+ }
33
+ /** `CommerceExposureReserveSchema`: what one reservation states. Subjects arrive as digests only. */
34
+ export interface ExposureReservationRequest {
35
+ readonly subject: {
36
+ readonly kind: string;
37
+ readonly id_digest?: string;
38
+ };
39
+ readonly amount: number;
40
+ readonly currency: string;
41
+ readonly action_type: string;
42
+ readonly reservation_key: string;
43
+ readonly request_digest: string;
44
+ readonly occurred_at: string;
45
+ readonly source: {
46
+ readonly platform?: string;
47
+ readonly channel?: string;
48
+ readonly record_id?: string;
49
+ };
50
+ readonly actor?: {
51
+ readonly kind: "agent";
52
+ readonly id_digest: string;
53
+ };
54
+ readonly step?: string;
55
+ }
56
+ export type ExposureDecision = "PROCEED" | "HOLD" | "ESCALATE";
57
+ /** The ledger's answer to one reservation. */
58
+ export interface ExposureAnswer {
59
+ readonly decision: ExposureDecision;
60
+ readonly reasonCode: string;
61
+ /** Present for a `PROCEED` that counts; null when the limit did not apply, or refused. */
62
+ readonly reservationId: string | null;
63
+ /** The same reservation_key was already reserved: this is the earlier reservation, not a new draw. */
64
+ readonly replayed: boolean;
65
+ }
66
+ /**
67
+ * The ledger could not be asked, or its answer could not be read: a stable
68
+ * code, never the response body. `retryable` is true only where asking again
69
+ * cannot double-count: a transport failure or a server error, retried under
70
+ * the same reservation_key.
71
+ */
72
+ export declare class ExposureUnavailable extends Error {
73
+ readonly code: string;
74
+ readonly retryable: boolean;
75
+ constructor(code: string, retryable: boolean);
76
+ }
77
+ export interface ExposureLedger {
78
+ /** The organisation's limits under its active policy; none when it has no policy. */
79
+ limits(): Promise<readonly ExposureLimit[]>;
80
+ reserve(limitKey: string, request: ExposureReservationRequest): Promise<ExposureAnswer>;
81
+ /** The payment happened: for `amount` minor units when given, else for the amount reserved. */
82
+ settle(limitKey: string, reservationId: string, amount?: number): Promise<void>;
83
+ /** The payment did not happen: the reservation stops counting. */
84
+ release(limitKey: string, reservationId: string): Promise<void>;
85
+ /**
86
+ * Read-only: one subject's usage of every amount limit that counts its kind (or the whole
87
+ * organisation), by limit key; null for a limit it does not apply to. What a gateway in shadow
88
+ * asks instead of reserving. Optional: a ledger without it is previewed by reserving and
89
+ * releasing at once.
90
+ */
91
+ subjectUsage?(kind: string, idDigest: string): Promise<ReadonlyMap<string, readonly ExposureSubjectUsage[] | null>>;
92
+ }
93
+ //# sourceMappingURL=ExposureLedger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExposureLedger.d.ts","sourceRoot":"","sources":["../../src/exposure/ExposureLedger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6FAA6F;AAC7F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,sDAAsD;IACtD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,mEAAmE;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACtF;AAED,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qGAAqG;AACrG,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;I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AM,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACxF,+FAA+F;IAC/F,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF,kEAAkE;IAClE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;;;;OAKG;IACH,YAAY,CAAC,CACX,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;CACzE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The exposure ledger the gateway records money releases against: the
3
+ * organisation's cumulative limits, read from its active policy, and a
4
+ * reservation per limit that is settled once the payment happened and
5
+ * released when it did not. Decionis keeps it (DecionisExposureLedger); a
6
+ * deployment may supply its own through the same interface.
7
+ */
8
+ /**
9
+ * The ledger could not be asked, or its answer could not be read: a stable
10
+ * code, never the response body. `retryable` is true only where asking again
11
+ * cannot double-count: a transport failure or a server error, retried under
12
+ * the same reservation_key.
13
+ */
14
+ export class ExposureUnavailable extends Error {
15
+ code;
16
+ retryable;
17
+ constructor(code, retryable) {
18
+ super(code);
19
+ this.code = code;
20
+ this.retryable = retryable;
21
+ this.name = "ExposureUnavailable";
22
+ }
23
+ }
24
+ //# sourceMappingURL=ExposureLedger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExposureLedger.js","sourceRoot":"","sources":["../../src/exposure/ExposureLedger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwDH;;;;;GAKG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAE1B;IACA;IAFlB,YACkB,IAAY,EACZ,SAAkB;QAElC,KAAK,CAAC,IAAI,CAAC,CAAC;QAHI,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAS;QAGlC,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * One governed attempt whose outcome nobody knows: the upstream answered 5xx
3
+ * or nothing after the request was sent. Kept by the client's
4
+ * `Idempotency-Key`, so a retry with that key can be linked to it, and a
5
+ * different request under that key refused.
6
+ */
7
+ export interface IndeterminateAttempt {
8
+ /** `retryDigest` of the request: what the key promised. */
9
+ readonly requestDigest: string;
10
+ readonly intentId: string;
11
+ readonly decisionId: string | null;
12
+ readonly dossierId: string | null;
13
+ /**
14
+ * The exposure reservation key the attempt drew under, when its route
15
+ * releases money: a retry reserves under it, so what the attempt kept is
16
+ * ended with the retry's outcome rather than drawn a second time.
17
+ */
18
+ readonly reservationKey?: string;
19
+ readonly recordedAt: string;
20
+ readonly expiresAt: number;
21
+ }
22
+ /**
23
+ * Where a gateway remembers its INDETERMINATE attempts, by the client's
24
+ * idempotency key, within one tenant. Nothing else is kept: no body, no
25
+ * header, and the key itself only as the name it is found by.
26
+ */
27
+ export interface AttemptStore {
28
+ /** False when the store is full or cannot write: the attempt is not remembered. */
29
+ record(idempotencyKey: string, attempt: IndeterminateAttempt): boolean;
30
+ /** The live record under a key; an expired or unreadable one is removed and is absent. */
31
+ find(idempotencyKey: string): IndeterminateAttempt | undefined;
32
+ /** Forgets the record under a key, only if it is for this request. */
33
+ forget(idempotencyKey: string, requestDigest: string): void;
34
+ close(): void;
35
+ }
36
+ /** How long an INDETERMINATE attempt is remembered: a day, well inside the hold store's seven-day ceiling. */
37
+ export declare const ATTEMPT_TTL_MS: number;
38
+ /** The most INDETERMINATE attempts one gateway remembers. */
39
+ export declare const MAX_ATTEMPTS = 1000;
40
+ /** In this process's memory: lost on restart, and seen only by this replica. */
41
+ export declare class MemoryAttemptStore implements AttemptStore {
42
+ private readonly clock;
43
+ private readonly attempts;
44
+ constructor(clock: () => number);
45
+ record(idempotencyKey: string, attempt: IndeterminateAttempt): boolean;
46
+ find(idempotencyKey: string): IndeterminateAttempt | undefined;
47
+ forget(idempotencyKey: string, requestDigest: string): void;
48
+ close(): void;
49
+ private sweep;
50
+ }
51
+ /** The subdirectory of the hold directory the records live in. */
52
+ export declare const ATTEMPT_DIRECTORY = "attempts";
53
+ /**
54
+ * INDETERMINATE attempts as files beside the durable holds, in the same
55
+ * custody: the directory every replica mounts and the hold key. Each file is
56
+ * sealed with AES-256-GCM under the hold key, its associated data the tenant
57
+ * and the idempotency key, so a file copied to another tenant, or renamed to
58
+ * another key, does not open. A file is named by an HMAC of the tenant and
59
+ * the key under a name key derived from the hold key, so the directory says
60
+ * nothing about the keys clients sent. A record is replaced by a rename, so a
61
+ * reader on any replica sees a whole record or none.
62
+ */
63
+ export declare class FileAttemptStore implements AttemptStore {
64
+ private readonly scope;
65
+ private readonly clock;
66
+ private readonly key;
67
+ private readonly nameKey;
68
+ private readonly dir;
69
+ constructor(holdDir: string, keyFile: string, scope: string, clock: () => number);
70
+ record(idempotencyKey: string, attempt: IndeterminateAttempt): boolean;
71
+ find(idempotencyKey: string): IndeterminateAttempt | undefined;
72
+ forget(idempotencyKey: string, requestDigest: string): void;
73
+ close(): void;
74
+ /** Removes expired records and orphaned temporary files; returns how many are live. */
75
+ sweep(): number;
76
+ private unseal;
77
+ private aad;
78
+ private path;
79
+ private static exists;
80
+ private static expiresAt;
81
+ private static olderThan;
82
+ }
83
+ //# sourceMappingURL=AttemptStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttemptStore.d.ts","sourceRoot":"","sources":["../../src/gateway/AttemptStore.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ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,gBAAiB,YAAW,YAAY;IAQjD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IARxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;gBAG3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACE,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,MAAM;IAa/B,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO;IA+BtE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAgB9D,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI;IAM3D,KAAK,IAAI,IAAI;IAIpB,uFAAuF;IAChF,KAAK,IAAI,MAAM;IA0BtB,OAAO,CAAC,MAAM;IAuBd,OAAO,CAAC,GAAG;IAOX,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,MAAM,CAAC,MAAM;IASrB,OAAO,CAAC,MAAM,CAAC,SAAS;IAWxB,OAAO,CAAC,MAAM,CAAC,SAAS;CAOzB"}
@@ -0,0 +1,229 @@
1
+ import { createCipheriv, createDecipheriv, createHmac, hkdfSync, randomBytes } from "node:crypto";
2
+ import { closeSync, fsyncSync, mkdirSync, openSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeSync, } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { FileHoldStore, HoldStoreError } from "./HoldStore.js";
5
+ /** How long an INDETERMINATE attempt is remembered: a day, well inside the hold store's seven-day ceiling. */
6
+ export const ATTEMPT_TTL_MS = 24 * 60 * 60 * 1_000;
7
+ /** The most INDETERMINATE attempts one gateway remembers. */
8
+ export const MAX_ATTEMPTS = 1_000;
9
+ /** In this process's memory: lost on restart, and seen only by this replica. */
10
+ export class MemoryAttemptStore {
11
+ clock;
12
+ attempts = new Map();
13
+ constructor(clock) {
14
+ this.clock = clock;
15
+ }
16
+ record(idempotencyKey, attempt) {
17
+ this.sweep();
18
+ if (!this.attempts.has(idempotencyKey) && this.attempts.size >= MAX_ATTEMPTS)
19
+ return false;
20
+ this.attempts.set(idempotencyKey, attempt);
21
+ return true;
22
+ }
23
+ find(idempotencyKey) {
24
+ const attempt = this.attempts.get(idempotencyKey);
25
+ if (attempt === undefined)
26
+ return undefined;
27
+ if (attempt.expiresAt > this.clock())
28
+ return attempt;
29
+ this.attempts.delete(idempotencyKey);
30
+ return undefined;
31
+ }
32
+ forget(idempotencyKey, requestDigest) {
33
+ if (this.attempts.get(idempotencyKey)?.requestDigest === requestDigest) {
34
+ this.attempts.delete(idempotencyKey);
35
+ }
36
+ }
37
+ close() {
38
+ this.attempts.clear();
39
+ }
40
+ sweep() {
41
+ const now = this.clock();
42
+ for (const [key, attempt] of this.attempts) {
43
+ if (attempt.expiresAt <= now)
44
+ this.attempts.delete(key);
45
+ }
46
+ }
47
+ }
48
+ const FORMAT = "agentsafe.attempt/1";
49
+ const SUFFIX = ".attempt";
50
+ const TEMPORARY = ".tmp";
51
+ /** A half-written file older than this is an orphan a sweep removes. */
52
+ const ORPHAN_MS = 10 * 60_000;
53
+ /** The subdirectory of the hold directory the records live in. */
54
+ export const ATTEMPT_DIRECTORY = "attempts";
55
+ /**
56
+ * INDETERMINATE attempts as files beside the durable holds, in the same
57
+ * custody: the directory every replica mounts and the hold key. Each file is
58
+ * sealed with AES-256-GCM under the hold key, its associated data the tenant
59
+ * and the idempotency key, so a file copied to another tenant, or renamed to
60
+ * another key, does not open. A file is named by an HMAC of the tenant and
61
+ * the key under a name key derived from the hold key, so the directory says
62
+ * nothing about the keys clients sent. A record is replaced by a rename, so a
63
+ * reader on any replica sees a whole record or none.
64
+ */
65
+ export class FileAttemptStore {
66
+ scope;
67
+ clock;
68
+ key;
69
+ nameKey;
70
+ dir;
71
+ constructor(holdDir, keyFile, scope, clock) {
72
+ this.scope = scope;
73
+ this.clock = clock;
74
+ this.key = FileHoldStore.readKey(keyFile);
75
+ this.nameKey = Buffer.from(hkdfSync("sha256", this.key, Buffer.alloc(0), FORMAT, 32));
76
+ this.dir = join(holdDir, ATTEMPT_DIRECTORY);
77
+ try {
78
+ mkdirSync(this.dir, { recursive: true, mode: 0o700 });
79
+ statSync(this.dir);
80
+ }
81
+ catch {
82
+ throw new HoldStoreError("HOLD_DIR_UNUSABLE");
83
+ }
84
+ }
85
+ record(idempotencyKey, attempt) {
86
+ const path = this.path(idempotencyKey);
87
+ if (this.sweep() >= MAX_ATTEMPTS && !FileAttemptStore.exists(path))
88
+ return false;
89
+ const iv = randomBytes(12);
90
+ const cipher = createCipheriv("aes-256-gcm", this.key, iv);
91
+ cipher.setAAD(this.aad(idempotencyKey, attempt.expiresAt));
92
+ const data = Buffer.concat([cipher.update(JSON.stringify(attempt), "utf8"), cipher.final()]);
93
+ const sealed = {
94
+ format: FORMAT,
95
+ expiresAt: attempt.expiresAt,
96
+ iv: iv.toString("base64url"),
97
+ tag: cipher.getAuthTag().toString("base64url"),
98
+ data: data.toString("base64url"),
99
+ };
100
+ const temporary = `${path}.${randomBytes(6).toString("hex")}${TEMPORARY}`;
101
+ try {
102
+ const fd = openSync(temporary, "wx", 0o600);
103
+ try {
104
+ writeSync(fd, JSON.stringify(sealed));
105
+ fsyncSync(fd);
106
+ }
107
+ finally {
108
+ closeSync(fd);
109
+ }
110
+ renameSync(temporary, path);
111
+ return true;
112
+ }
113
+ catch {
114
+ rmSync(temporary, { force: true });
115
+ return false;
116
+ }
117
+ }
118
+ find(idempotencyKey) {
119
+ const path = this.path(idempotencyKey);
120
+ let sealed;
121
+ try {
122
+ sealed = JSON.parse(readFileSync(path, "utf8"));
123
+ }
124
+ catch {
125
+ return undefined;
126
+ }
127
+ const attempt = this.unseal(idempotencyKey, sealed);
128
+ if (attempt === null || attempt.expiresAt <= this.clock()) {
129
+ rmSync(path, { force: true });
130
+ return undefined;
131
+ }
132
+ return attempt;
133
+ }
134
+ forget(idempotencyKey, requestDigest) {
135
+ if (this.find(idempotencyKey)?.requestDigest === requestDigest) {
136
+ rmSync(this.path(idempotencyKey), { force: true });
137
+ }
138
+ }
139
+ close() {
140
+ // The records are the next process's to read.
141
+ }
142
+ /** Removes expired records and orphaned temporary files; returns how many are live. */
143
+ sweep() {
144
+ const now = this.clock();
145
+ let live = 0;
146
+ let names;
147
+ try {
148
+ names = readdirSync(this.dir);
149
+ }
150
+ catch {
151
+ return 0;
152
+ }
153
+ for (const name of names) {
154
+ const path = join(this.dir, name);
155
+ if (name.endsWith(TEMPORARY)) {
156
+ if (FileAttemptStore.olderThan(path, now - ORPHAN_MS))
157
+ rmSync(path, { force: true });
158
+ continue;
159
+ }
160
+ if (!name.endsWith(SUFFIX))
161
+ continue;
162
+ const expiresAt = FileAttemptStore.expiresAt(path);
163
+ if (expiresAt === null || expiresAt <= now) {
164
+ rmSync(path, { force: true });
165
+ continue;
166
+ }
167
+ live += 1;
168
+ }
169
+ return live;
170
+ }
171
+ unseal(idempotencyKey, sealed) {
172
+ if (sealed?.format !== FORMAT || typeof sealed.expiresAt !== "number")
173
+ return null;
174
+ try {
175
+ const decipher = createDecipheriv("aes-256-gcm", this.key, Buffer.from(sealed.iv, "base64url"));
176
+ decipher.setAAD(this.aad(idempotencyKey, sealed.expiresAt));
177
+ decipher.setAuthTag(Buffer.from(sealed.tag, "base64url"));
178
+ const plain = Buffer.concat([
179
+ decipher.update(Buffer.from(sealed.data, "base64url")),
180
+ decipher.final(),
181
+ ]).toString("utf8");
182
+ const attempt = JSON.parse(plain);
183
+ return attempt.expiresAt === sealed.expiresAt && typeof attempt.requestDigest === "string"
184
+ ? attempt
185
+ : null;
186
+ }
187
+ catch {
188
+ return null;
189
+ }
190
+ }
191
+ aad(idempotencyKey, expiresAt) {
192
+ return Buffer.from(`${FORMAT}\u0000${this.scope}\u0000${idempotencyKey}\u0000${expiresAt}`, "utf8");
193
+ }
194
+ path(idempotencyKey) {
195
+ const name = createHmac("sha256", this.nameKey)
196
+ .update(`${this.scope}\u0000${idempotencyKey}`, "utf8")
197
+ .digest("hex");
198
+ return join(this.dir, `${name}${SUFFIX}`);
199
+ }
200
+ static exists(path) {
201
+ try {
202
+ statSync(path);
203
+ return true;
204
+ }
205
+ catch {
206
+ return false;
207
+ }
208
+ }
209
+ static expiresAt(path) {
210
+ try {
211
+ const sealed = JSON.parse(readFileSync(path, "utf8"));
212
+ return sealed.format === FORMAT && typeof sealed.expiresAt === "number"
213
+ ? sealed.expiresAt
214
+ : null;
215
+ }
216
+ catch {
217
+ return null;
218
+ }
219
+ }
220
+ static olderThan(path, cutoff) {
221
+ try {
222
+ return statSync(path).mtimeMs < cutoff;
223
+ }
224
+ catch {
225
+ return false;
226
+ }
227
+ }
228
+ }
229
+ //# sourceMappingURL=AttemptStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttemptStore.js","sourceRoot":"","sources":["../../src/gateway/AttemptStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClG,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAuC/D,8GAA8G;AAC9G,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;AACnD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC,gFAAgF;AAChF,MAAM,OAAO,kBAAkB;IAGO;IA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AG,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC;IAEO,MAAM,CAAC,MAAM,CAAC,IAAY;QAChC,IAAI,CAAC;YACH,QAAQ,CAAC,IAAI,CAAC,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,IAAY;QACnC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAoB,CAAC;YACzE,OAAO,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ;gBACrE,CAAC,CAAC,MAAM,CAAC,SAAS;gBAClB,CAAC,CAAC,IAAI,CAAC;QACX,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,IAAY,EAAE,MAAc;QACnD,IAAI,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
- import { type ActionHandler, type ActionRegistry } from "@decionis/agent-safe-pipeline";
3
- import { type HttpActionParameters, type InterceptedRequest } from "./InterceptedRequest.js";
2
+ import { type ActionHandler, type ActionRegistry, type VerifiedAuthorization } from "@decionis/agent-safe-pipeline";
3
+ import { type HttpActionParameters, type HttpFactsParameters, type InterceptedRequest } from "./InterceptedRequest.js";
4
4
  import type { Upstream, UpstreamResult } from "./Upstream.js";
5
5
  /** The parameters an HTTP action carries; anything else the registry refuses before a grant is spent. */
6
6
  export declare const HttpActionParametersSchema: z.ZodObject<{
@@ -13,7 +13,45 @@ export declare const HttpActionParametersSchema: z.ZodObject<{
13
13
  path: z.ZodString;
14
14
  query: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
15
15
  body: z.ZodOptional<z.ZodType<import("@decionis/agent-safe-pipeline").JsonValue, unknown, z.core.$ZodTypeInternals<import("@decionis/agent-safe-pipeline").JsonValue, unknown>>>;
16
+ policy_id: z.ZodOptional<z.ZodString>;
17
+ policy_version: z.ZodOptional<z.ZodString>;
16
18
  }, z.core.$strict>;
19
+ /** A facts-only HTTP action's parameters: the profile operation and its template, nothing more. */
20
+ export declare const HttpFactsParametersSchema: z.ZodObject<{
21
+ method: z.ZodEnum<{
22
+ POST: "POST";
23
+ PUT: "PUT";
24
+ PATCH: "PATCH";
25
+ DELETE: "DELETE";
26
+ }>;
27
+ operation: z.ZodString;
28
+ path_template: z.ZodString;
29
+ }, z.core.$strict>;
30
+ /** Either shape; a facts-only one is told apart by its `operation`. */
31
+ export type HttpParameters = HttpActionParameters | HttpFactsParameters;
32
+ /** What the registry admits an HTTP action's parameters against: either shape, nothing else. */
33
+ export declare const HttpParametersSchema: z.ZodType<HttpParameters>;
34
+ /**
35
+ * The header a write carries the target version its intent bound in, as a
36
+ * verifying hop sets it after checking an attestation: an upstream that takes
37
+ * writes only through the gateway's credential, and honours it, refuses a
38
+ * write whose target has moved since the decision.
39
+ */
40
+ export declare const EXPECTED_STATE_VERSION_HEADER = "x-agent-safe-expected-state-version";
41
+ /**
42
+ * Told when the upstream answered a forwarded write with a `2xx`, after the
43
+ * point of no return and before the attempt is finalized, so what it does
44
+ * rides on the finalization. It never throws.
45
+ */
46
+ export type Landed = (authorization: VerifiedAuthorization) => Promise<void>;
47
+ /**
48
+ * Asked after the grant is claimed and the bytes are checked, immediately
49
+ * before the point of no return: a last check of the gateway's own (a
50
+ * payment's cumulative limits) that refuses by throwing a
51
+ * `PreDispatchRefusal`, so nothing is sent and the attempt is finalized as
52
+ * not executed.
53
+ */
54
+ export type BeforeDispatch = (authorization: VerifiedAuthorization) => Promise<void>;
17
55
  /** What the handler leaves behind for the relay, whichever way the attempt ended. */
18
56
  export interface ForwardOutcome {
19
57
  readonly response: UpstreamResult | null;
@@ -23,6 +61,8 @@ export interface ForwardOutcome {
23
61
  interface Held {
24
62
  readonly request: InterceptedRequest;
25
63
  readonly extraHeaders: Readonly<Record<string, string>>;
64
+ readonly landed: Landed | null;
65
+ readonly before: BeforeDispatch | null;
26
66
  outcome: ForwardOutcome;
27
67
  }
28
68
  /**
@@ -32,7 +72,7 @@ interface Held {
32
72
  */
33
73
  export declare class RequestHolder {
34
74
  private readonly held;
35
- hold(intentId: string, request: InterceptedRequest, extraHeaders: Readonly<Record<string, string>>): void;
75
+ hold(intentId: string, request: InterceptedRequest, extraHeaders: Readonly<Record<string, string>>, landed?: Landed | null, before?: BeforeDispatch | null): void;
36
76
  /** @internal */
37
77
  get(intentId: string): Held | undefined;
38
78
  /** The outcome the handler recorded, and the end of the hold. */
@@ -47,10 +87,14 @@ export declare class RequestHolder {
47
87
  * changed between the two is a failure before dispatch, not an execution.
48
88
  * The upstream's status is the attempt's outcome: `2xx` and `3xx` commit,
49
89
  * `4xx` is the provider's own refusal, `5xx` and a lost connection are
50
- * unknown.
90
+ * unknown. A facts-only intent carries no path to compare: the held request
91
+ * is bound by its keyed digest instead, which covers the same bytes. When
92
+ * the intent bound its target's version, the write says so to the upstream,
93
+ * and a `2xx` is handed to whoever held the request before the runner
94
+ * finalizes the attempt.
51
95
  */
52
- export declare function httpForwardHandler(upstream: Upstream, holder: RequestHolder): ActionHandler<HttpActionParameters, UpstreamResult>;
96
+ export declare function httpForwardHandler(upstream: Upstream, holder: RequestHolder, digestKey: Uint8Array): ActionHandler<HttpParameters, UpstreamResult>;
53
97
  /** Registers the one handler under every name the route table can produce, then seals. */
54
- export declare function registerHttpActions(registry: ActionRegistry, actions: readonly string[], handler: ActionHandler<HttpActionParameters, UpstreamResult>): ActionRegistry;
98
+ export declare function registerHttpActions(registry: ActionRegistry, actions: readonly string[], handler: ActionHandler<HttpParameters, UpstreamResult>): ActionRegistry;
55
99
  export {};
56
100
  //# sourceMappingURL=ForwardHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ForwardHandler.d.ts","sourceRoot":"","sources":["../../src/gateway/ForwardHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE9D,yGAAyG;AACzG,eAAO,MAAM,0BAA0B;;;;;;;;;;kBAKrC,CAAC;AAEH,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IACzC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EACd,kBAAkB,GAAG,gBAAgB,GAAG,WAAW,GAAG,oBAAoB,GAAG,IAAI,CAAC;CACrF;AAUD,UAAU,IAAI;IACZ,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxD,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA2B;IAEzC,IAAI,CACT,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,kBAAkB,EAC3B,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC7C,IAAI;IAIP,gBAAgB;IACT,GAAG,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