@zarel-ai/sdk 0.6.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 (375) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +412 -0
  3. package/dist/_internal/auth-headers.d.ts +19 -0
  4. package/dist/_internal/auth-headers.d.ts.map +1 -0
  5. package/dist/_internal/auth-headers.js +30 -0
  6. package/dist/_internal/auth-headers.js.map +1 -0
  7. package/dist/_internal/confirmation.d.ts +24 -0
  8. package/dist/_internal/confirmation.d.ts.map +1 -0
  9. package/dist/_internal/confirmation.js +54 -0
  10. package/dist/_internal/confirmation.js.map +1 -0
  11. package/dist/_internal/event-iterator.d.ts +18 -0
  12. package/dist/_internal/event-iterator.d.ts.map +1 -0
  13. package/dist/_internal/event-iterator.js +151 -0
  14. package/dist/_internal/event-iterator.js.map +1 -0
  15. package/dist/_internal/fetch-client.d.ts +141 -0
  16. package/dist/_internal/fetch-client.d.ts.map +1 -0
  17. package/dist/_internal/fetch-client.js +471 -0
  18. package/dist/_internal/fetch-client.js.map +1 -0
  19. package/dist/_internal/interceptors.d.ts +40 -0
  20. package/dist/_internal/interceptors.d.ts.map +1 -0
  21. package/dist/_internal/interceptors.js +28 -0
  22. package/dist/_internal/interceptors.js.map +1 -0
  23. package/dist/_internal/mcp.d.ts +11 -0
  24. package/dist/_internal/mcp.d.ts.map +1 -0
  25. package/dist/_internal/mcp.js +79 -0
  26. package/dist/_internal/mcp.js.map +1 -0
  27. package/dist/_internal/pagination.d.ts +71 -0
  28. package/dist/_internal/pagination.d.ts.map +1 -0
  29. package/dist/_internal/pagination.js +130 -0
  30. package/dist/_internal/pagination.js.map +1 -0
  31. package/dist/_internal/require-token.d.ts +17 -0
  32. package/dist/_internal/require-token.d.ts.map +1 -0
  33. package/dist/_internal/require-token.js +25 -0
  34. package/dist/_internal/require-token.js.map +1 -0
  35. package/dist/_internal/retry-after.d.ts +2 -0
  36. package/dist/_internal/retry-after.d.ts.map +1 -0
  37. package/dist/_internal/retry-after.js +34 -0
  38. package/dist/_internal/retry-after.js.map +1 -0
  39. package/dist/_internal/sse-client.d.ts +43 -0
  40. package/dist/_internal/sse-client.d.ts.map +1 -0
  41. package/dist/_internal/sse-client.js +250 -0
  42. package/dist/_internal/sse-client.js.map +1 -0
  43. package/dist/_internal/version.d.ts +5 -0
  44. package/dist/_internal/version.d.ts.map +1 -0
  45. package/dist/_internal/version.js +12 -0
  46. package/dist/_internal/version.js.map +1 -0
  47. package/dist/client.d.ts +74 -0
  48. package/dist/client.d.ts.map +1 -0
  49. package/dist/client.js +86 -0
  50. package/dist/client.js.map +1 -0
  51. package/dist/contract/_singleton.d.ts +18 -0
  52. package/dist/contract/_singleton.d.ts.map +1 -0
  53. package/dist/contract/_singleton.js +27 -0
  54. package/dist/contract/_singleton.js.map +1 -0
  55. package/dist/contract/actions.d.ts +18 -0
  56. package/dist/contract/actions.d.ts.map +1 -0
  57. package/dist/contract/actions.js +36 -0
  58. package/dist/contract/actions.js.map +1 -0
  59. package/dist/contract/assistant.d.ts +65 -0
  60. package/dist/contract/assistant.d.ts.map +1 -0
  61. package/dist/contract/assistant.js +44 -0
  62. package/dist/contract/assistant.js.map +1 -0
  63. package/dist/contract/batch.d.ts +27 -0
  64. package/dist/contract/batch.d.ts.map +1 -0
  65. package/dist/contract/batch.js +20 -0
  66. package/dist/contract/batch.js.map +1 -0
  67. package/dist/contract/capabilities.d.ts +21 -0
  68. package/dist/contract/capabilities.d.ts.map +1 -0
  69. package/dist/contract/capabilities.js +31 -0
  70. package/dist/contract/capabilities.js.map +1 -0
  71. package/dist/contract/constraints.d.ts +21 -0
  72. package/dist/contract/constraints.d.ts.map +1 -0
  73. package/dist/contract/constraints.js +31 -0
  74. package/dist/contract/constraints.js.map +1 -0
  75. package/dist/contract/events.d.ts +33 -0
  76. package/dist/contract/events.d.ts.map +1 -0
  77. package/dist/contract/events.js +56 -0
  78. package/dist/contract/events.js.map +1 -0
  79. package/dist/contract/flows.d.ts +44 -0
  80. package/dist/contract/flows.d.ts.map +1 -0
  81. package/dist/contract/flows.js +109 -0
  82. package/dist/contract/flows.js.map +1 -0
  83. package/dist/contract/governance.d.ts +6 -0
  84. package/dist/contract/governance.d.ts.map +1 -0
  85. package/dist/contract/governance.js +17 -0
  86. package/dist/contract/governance.js.map +1 -0
  87. package/dist/contract/index.d.ts +137 -0
  88. package/dist/contract/index.d.ts.map +1 -0
  89. package/dist/contract/index.js +177 -0
  90. package/dist/contract/index.js.map +1 -0
  91. package/dist/contract/metadata.d.ts +26 -0
  92. package/dist/contract/metadata.d.ts.map +1 -0
  93. package/dist/contract/metadata.js +25 -0
  94. package/dist/contract/metadata.js.map +1 -0
  95. package/dist/contract/process-model.d.ts +31 -0
  96. package/dist/contract/process-model.d.ts.map +1 -0
  97. package/dist/contract/process-model.js +51 -0
  98. package/dist/contract/process-model.js.map +1 -0
  99. package/dist/contract/roots/channels.d.ts +27 -0
  100. package/dist/contract/roots/channels.d.ts.map +1 -0
  101. package/dist/contract/roots/channels.js +53 -0
  102. package/dist/contract/roots/channels.js.map +1 -0
  103. package/dist/contract/roots/events.d.ts +7 -0
  104. package/dist/contract/roots/events.d.ts.map +1 -0
  105. package/dist/contract/roots/events.js +19 -0
  106. package/dist/contract/roots/events.js.map +1 -0
  107. package/dist/contract/roots/index.d.ts +15 -0
  108. package/dist/contract/roots/index.d.ts.map +1 -0
  109. package/dist/contract/roots/index.js +38 -0
  110. package/dist/contract/roots/index.js.map +1 -0
  111. package/dist/contract/roots/mcp-servers.d.ts +46 -0
  112. package/dist/contract/roots/mcp-servers.d.ts.map +1 -0
  113. package/dist/contract/roots/mcp-servers.js +68 -0
  114. package/dist/contract/roots/mcp-servers.js.map +1 -0
  115. package/dist/contract/roots/profiles.d.ts +18 -0
  116. package/dist/contract/roots/profiles.d.ts.map +1 -0
  117. package/dist/contract/roots/profiles.js +31 -0
  118. package/dist/contract/roots/profiles.js.map +1 -0
  119. package/dist/contract/roots/timezone.d.ts +10 -0
  120. package/dist/contract/roots/timezone.d.ts.map +1 -0
  121. package/dist/contract/roots/timezone.js +19 -0
  122. package/dist/contract/roots/timezone.js.map +1 -0
  123. package/dist/contract/roots/treatment.d.ts +11 -0
  124. package/dist/contract/roots/treatment.d.ts.map +1 -0
  125. package/dist/contract/roots/treatment.js +37 -0
  126. package/dist/contract/roots/treatment.js.map +1 -0
  127. package/dist/contract/roots/vocabulary.d.ts +18 -0
  128. package/dist/contract/roots/vocabulary.d.ts.map +1 -0
  129. package/dist/contract/roots/vocabulary.js +31 -0
  130. package/dist/contract/roots/vocabulary.js.map +1 -0
  131. package/dist/contract/schemas.d.ts +18 -0
  132. package/dist/contract/schemas.d.ts.map +1 -0
  133. package/dist/contract/schemas.js +31 -0
  134. package/dist/contract/schemas.js.map +1 -0
  135. package/dist/contract/skills.d.ts +20 -0
  136. package/dist/contract/skills.d.ts.map +1 -0
  137. package/dist/contract/skills.js +36 -0
  138. package/dist/contract/skills.js.map +1 -0
  139. package/dist/errors.d.ts +65 -0
  140. package/dist/errors.d.ts.map +1 -0
  141. package/dist/errors.js +80 -0
  142. package/dist/errors.js.map +1 -0
  143. package/dist/generated/contract.d.ts +7688 -0
  144. package/dist/generated/contract.d.ts.map +1 -0
  145. package/dist/generated/contract.js +7 -0
  146. package/dist/generated/contract.js.map +1 -0
  147. package/dist/generated/index.d.ts +41 -0
  148. package/dist/generated/index.d.ts.map +1 -0
  149. package/dist/generated/index.js +3 -0
  150. package/dist/generated/index.js.map +1 -0
  151. package/dist/generated/runtime.d.ts +4020 -0
  152. package/dist/generated/runtime.d.ts.map +1 -0
  153. package/dist/generated/runtime.js +7 -0
  154. package/dist/generated/runtime.js.map +1 -0
  155. package/dist/generated/unwrap-map.d.ts +989 -0
  156. package/dist/generated/unwrap-map.d.ts.map +1 -0
  157. package/dist/generated/unwrap-map.js +344 -0
  158. package/dist/generated/unwrap-map.js.map +1 -0
  159. package/dist/index.d.ts +38 -0
  160. package/dist/index.d.ts.map +1 -0
  161. package/dist/index.js +27 -0
  162. package/dist/index.js.map +1 -0
  163. package/dist/resources/actions.d.ts +33 -0
  164. package/dist/resources/actions.d.ts.map +1 -0
  165. package/dist/resources/actions.js +52 -0
  166. package/dist/resources/actions.js.map +1 -0
  167. package/dist/resources/audit.d.ts +52 -0
  168. package/dist/resources/audit.d.ts.map +1 -0
  169. package/dist/resources/audit.js +86 -0
  170. package/dist/resources/audit.js.map +1 -0
  171. package/dist/resources/authorization-ceiling.d.ts +25 -0
  172. package/dist/resources/authorization-ceiling.d.ts.map +1 -0
  173. package/dist/resources/authorization-ceiling.js +26 -0
  174. package/dist/resources/authorization-ceiling.js.map +1 -0
  175. package/dist/resources/authorization-operation-ids.d.ts +15 -0
  176. package/dist/resources/authorization-operation-ids.d.ts.map +1 -0
  177. package/dist/resources/authorization-operation-ids.js +31 -0
  178. package/dist/resources/authorization-operation-ids.js.map +1 -0
  179. package/dist/resources/authorization.d.ts +60 -0
  180. package/dist/resources/authorization.d.ts.map +1 -0
  181. package/dist/resources/authorization.js +51 -0
  182. package/dist/resources/authorization.js.map +1 -0
  183. package/dist/resources/authorizations.d.ts +38 -0
  184. package/dist/resources/authorizations.d.ts.map +1 -0
  185. package/dist/resources/authorizations.js +19 -0
  186. package/dist/resources/authorizations.js.map +1 -0
  187. package/dist/resources/channels.d.ts +36 -0
  188. package/dist/resources/channels.d.ts.map +1 -0
  189. package/dist/resources/channels.js +61 -0
  190. package/dist/resources/channels.js.map +1 -0
  191. package/dist/resources/contracts.d.ts +46 -0
  192. package/dist/resources/contracts.d.ts.map +1 -0
  193. package/dist/resources/contracts.js +86 -0
  194. package/dist/resources/contracts.js.map +1 -0
  195. package/dist/resources/conversation-sessions.d.ts +62 -0
  196. package/dist/resources/conversation-sessions.d.ts.map +1 -0
  197. package/dist/resources/conversation-sessions.js +48 -0
  198. package/dist/resources/conversation-sessions.js.map +1 -0
  199. package/dist/resources/conversation.d.ts +48 -0
  200. package/dist/resources/conversation.d.ts.map +1 -0
  201. package/dist/resources/conversation.js +104 -0
  202. package/dist/resources/conversation.js.map +1 -0
  203. package/dist/resources/embedding-credentials.d.ts +60 -0
  204. package/dist/resources/embedding-credentials.d.ts.map +1 -0
  205. package/dist/resources/embedding-credentials.js +53 -0
  206. package/dist/resources/embedding-credentials.js.map +1 -0
  207. package/dist/resources/entities.d.ts +66 -0
  208. package/dist/resources/entities.d.ts.map +1 -0
  209. package/dist/resources/entities.js +106 -0
  210. package/dist/resources/entities.js.map +1 -0
  211. package/dist/resources/events.d.ts +45 -0
  212. package/dist/resources/events.d.ts.map +1 -0
  213. package/dist/resources/events.js +71 -0
  214. package/dist/resources/events.js.map +1 -0
  215. package/dist/resources/flows.d.ts +45 -0
  216. package/dist/resources/flows.d.ts.map +1 -0
  217. package/dist/resources/flows.js +82 -0
  218. package/dist/resources/flows.js.map +1 -0
  219. package/dist/resources/imports.d.ts +8 -0
  220. package/dist/resources/imports.d.ts.map +1 -0
  221. package/dist/resources/imports.js +14 -0
  222. package/dist/resources/imports.js.map +1 -0
  223. package/dist/resources/index.d.ts +24 -0
  224. package/dist/resources/index.d.ts.map +1 -0
  225. package/dist/resources/index.js +41 -0
  226. package/dist/resources/index.js.map +1 -0
  227. package/dist/resources/llm-credentials.d.ts +47 -0
  228. package/dist/resources/llm-credentials.d.ts.map +1 -0
  229. package/dist/resources/llm-credentials.js +46 -0
  230. package/dist/resources/llm-credentials.js.map +1 -0
  231. package/dist/resources/llm-services.d.ts +46 -0
  232. package/dist/resources/llm-services.d.ts.map +1 -0
  233. package/dist/resources/llm-services.js +41 -0
  234. package/dist/resources/llm-services.js.map +1 -0
  235. package/dist/resources/mcp.d.ts +8 -0
  236. package/dist/resources/mcp.d.ts.map +1 -0
  237. package/dist/resources/mcp.js +25 -0
  238. package/dist/resources/mcp.js.map +1 -0
  239. package/dist/resources/receipts.d.ts +25 -0
  240. package/dist/resources/receipts.d.ts.map +1 -0
  241. package/dist/resources/receipts.js +54 -0
  242. package/dist/resources/receipts.js.map +1 -0
  243. package/dist/resources/records.d.ts +51 -0
  244. package/dist/resources/records.d.ts.map +1 -0
  245. package/dist/resources/records.js +103 -0
  246. package/dist/resources/records.js.map +1 -0
  247. package/dist/resources/role-assignments.d.ts +27 -0
  248. package/dist/resources/role-assignments.d.ts.map +1 -0
  249. package/dist/resources/role-assignments.js +40 -0
  250. package/dist/resources/role-assignments.js.map +1 -0
  251. package/dist/resources/roles.d.ts +39 -0
  252. package/dist/resources/roles.d.ts.map +1 -0
  253. package/dist/resources/roles.js +42 -0
  254. package/dist/resources/roles.js.map +1 -0
  255. package/dist/resources/runtime-entities.d.ts +23 -0
  256. package/dist/resources/runtime-entities.d.ts.map +1 -0
  257. package/dist/resources/runtime-entities.js +29 -0
  258. package/dist/resources/runtime-entities.js.map +1 -0
  259. package/dist/resources/state-machine.d.ts +45 -0
  260. package/dist/resources/state-machine.d.ts.map +1 -0
  261. package/dist/resources/state-machine.js +86 -0
  262. package/dist/resources/state-machine.js.map +1 -0
  263. package/dist/resources/system.d.ts +12 -0
  264. package/dist/resources/system.d.ts.map +1 -0
  265. package/dist/resources/system.js +26 -0
  266. package/dist/resources/system.js.map +1 -0
  267. package/dist/resources/tools.d.ts +22 -0
  268. package/dist/resources/tools.d.ts.map +1 -0
  269. package/dist/resources/tools.js +33 -0
  270. package/dist/resources/tools.js.map +1 -0
  271. package/dist/resources/traces.d.ts +65 -0
  272. package/dist/resources/traces.d.ts.map +1 -0
  273. package/dist/resources/traces.js +97 -0
  274. package/dist/resources/traces.js.map +1 -0
  275. package/dist/runtime/index.d.ts +128 -0
  276. package/dist/runtime/index.d.ts.map +1 -0
  277. package/dist/runtime/index.js +210 -0
  278. package/dist/runtime/index.js.map +1 -0
  279. package/dist/types/actions.d.ts +32 -0
  280. package/dist/types/actions.d.ts.map +1 -0
  281. package/dist/types/actions.js +9 -0
  282. package/dist/types/actions.js.map +1 -0
  283. package/dist/types/audit.d.ts +65 -0
  284. package/dist/types/audit.d.ts.map +1 -0
  285. package/dist/types/audit.js +14 -0
  286. package/dist/types/audit.js.map +1 -0
  287. package/dist/types/channels.d.ts +37 -0
  288. package/dist/types/channels.d.ts.map +1 -0
  289. package/dist/types/channels.js +6 -0
  290. package/dist/types/channels.js.map +1 -0
  291. package/dist/types/confirmation.d.ts +53 -0
  292. package/dist/types/confirmation.d.ts.map +1 -0
  293. package/dist/types/confirmation.js +17 -0
  294. package/dist/types/confirmation.js.map +1 -0
  295. package/dist/types/contracts.d.ts +194 -0
  296. package/dist/types/contracts.d.ts.map +1 -0
  297. package/dist/types/contracts.js +10 -0
  298. package/dist/types/contracts.js.map +1 -0
  299. package/dist/types/conversation-sessions.d.ts +58 -0
  300. package/dist/types/conversation-sessions.d.ts.map +1 -0
  301. package/dist/types/conversation-sessions.js +6 -0
  302. package/dist/types/conversation-sessions.js.map +1 -0
  303. package/dist/types/conversation.d.ts +96 -0
  304. package/dist/types/conversation.d.ts.map +1 -0
  305. package/dist/types/conversation.js +3 -0
  306. package/dist/types/conversation.js.map +1 -0
  307. package/dist/types/entities.d.ts +22 -0
  308. package/dist/types/entities.d.ts.map +1 -0
  309. package/dist/types/entities.js +4 -0
  310. package/dist/types/entities.js.map +1 -0
  311. package/dist/types/events-stream.d.ts +82 -0
  312. package/dist/types/events-stream.d.ts.map +1 -0
  313. package/dist/types/events-stream.js +65 -0
  314. package/dist/types/events-stream.js.map +1 -0
  315. package/dist/types/flows-contract.d.ts +8 -0
  316. package/dist/types/flows-contract.d.ts.map +1 -0
  317. package/dist/types/flows-contract.js +7 -0
  318. package/dist/types/flows-contract.js.map +1 -0
  319. package/dist/types/flows.d.ts +66 -0
  320. package/dist/types/flows.d.ts.map +1 -0
  321. package/dist/types/flows.js +25 -0
  322. package/dist/types/flows.js.map +1 -0
  323. package/dist/types/imports.d.ts +57 -0
  324. package/dist/types/imports.d.ts.map +1 -0
  325. package/dist/types/imports.js +3 -0
  326. package/dist/types/imports.js.map +1 -0
  327. package/dist/types/index.d.ts +17 -0
  328. package/dist/types/index.d.ts.map +1 -0
  329. package/dist/types/index.js +3 -0
  330. package/dist/types/index.js.map +1 -0
  331. package/dist/types/locale.d.ts +24 -0
  332. package/dist/types/locale.d.ts.map +1 -0
  333. package/dist/types/locale.js +17 -0
  334. package/dist/types/locale.js.map +1 -0
  335. package/dist/types/mcp.d.ts +28 -0
  336. package/dist/types/mcp.d.ts.map +1 -0
  337. package/dist/types/mcp.js +12 -0
  338. package/dist/types/mcp.js.map +1 -0
  339. package/dist/types/platform.d.ts +51 -0
  340. package/dist/types/platform.d.ts.map +1 -0
  341. package/dist/types/platform.js +4 -0
  342. package/dist/types/platform.js.map +1 -0
  343. package/dist/types/receipt.d.ts +79 -0
  344. package/dist/types/receipt.d.ts.map +1 -0
  345. package/dist/types/receipt.js +15 -0
  346. package/dist/types/receipt.js.map +1 -0
  347. package/dist/types/records.d.ts +45 -0
  348. package/dist/types/records.d.ts.map +1 -0
  349. package/dist/types/records.js +4 -0
  350. package/dist/types/records.js.map +1 -0
  351. package/dist/types/spec.d.ts +6 -0
  352. package/dist/types/spec.d.ts.map +1 -0
  353. package/dist/types/spec.js +3 -0
  354. package/dist/types/spec.js.map +1 -0
  355. package/dist/types/state-machine.d.ts +100 -0
  356. package/dist/types/state-machine.d.ts.map +1 -0
  357. package/dist/types/state-machine.js +9 -0
  358. package/dist/types/state-machine.js.map +1 -0
  359. package/dist/types/system.d.ts +28 -0
  360. package/dist/types/system.d.ts.map +1 -0
  361. package/dist/types/system.js +3 -0
  362. package/dist/types/system.js.map +1 -0
  363. package/dist/types/tools.d.ts +188 -0
  364. package/dist/types/tools.d.ts.map +1 -0
  365. package/dist/types/tools.js +22 -0
  366. package/dist/types/tools.js.map +1 -0
  367. package/dist/types/traces.d.ts +77 -0
  368. package/dist/types/traces.d.ts.map +1 -0
  369. package/dist/types/traces.js +11 -0
  370. package/dist/types/traces.js.map +1 -0
  371. package/dist/types/workflows.d.ts +42 -0
  372. package/dist/types/workflows.d.ts.map +1 -0
  373. package/dist/types/workflows.js +11 -0
  374. package/dist/types/workflows.js.map +1 -0
  375. package/package.json +103 -0
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuditResource = void 0;
4
+ const pagination_1 = require("../_internal/pagination");
5
+ /**
6
+ * Audit tamper-evidence resource (ADR-0108).
7
+ *
8
+ * client.audit.evidence(log) → GET /runtime/audit/{log}/evidence
9
+ * client.audit.evidence(log, {from,to}) → …?from=&to= (bounded slice)
10
+ *
11
+ * Downloads a signed evidence bundle (the event hash-chain + covering signed
12
+ * checkpoints + any external RFC 3161 TSA anchors over them, ADR-0115, + a signed
13
+ * manifest) for offline verification with `zarel verify`. Mirrors
14
+ * `traces.bundle()` — the body is a binary `application/gzip` stream, so it
15
+ * returns a generic `ArrayBuffer` the caller writes to disk. The anchors ride
16
+ * INSIDE the bundle: no SDK-call change — verify them offline with `--tsa-roots`.
17
+ */
18
+ class AuditResource {
19
+ client;
20
+ constructor(client) {
21
+ this.client = client;
22
+ }
23
+ list(log, params, options) {
24
+ const path = `/runtime/audit/${encodeURIComponent(log)}`;
25
+ const buildQuery = (cursor, limit) => {
26
+ const query = {};
27
+ if (params?.from !== undefined)
28
+ query.from = params.from;
29
+ if (params?.to !== undefined)
30
+ query.to = params.to;
31
+ if (params?.entity !== undefined)
32
+ query.entity = params.entity;
33
+ if (params?.field !== undefined)
34
+ query.field = params.field;
35
+ if (params?.bindingMode !== undefined)
36
+ query.binding_mode = params.bindingMode;
37
+ if (params?.category !== undefined)
38
+ query.category = params.category;
39
+ if (params?.reason !== undefined)
40
+ query.reason = params.reason;
41
+ if (params?.verdict !== undefined)
42
+ query.verdict = params.verdict;
43
+ if (limit !== undefined)
44
+ query.limit = limit;
45
+ if (cursor !== undefined)
46
+ query.cursor = cursor;
47
+ return query;
48
+ };
49
+ const signal = options?.signal;
50
+ const fetchPage = (p) => this.client.get(path, buildQuery(p.cursor, p.limit), {
51
+ operationId: 'listAuditLog',
52
+ ...(signal ? { signal } : {}),
53
+ });
54
+ return new pagination_1.PagePromise(fetchPage, (0, pagination_1.cursorBased)((page) => page.items, (page) => page.next_cursor), {
55
+ ...(params?.limit !== undefined ? { limit: params.limit } : {}),
56
+ ...(params?.cursor !== undefined ? { cursor: params.cursor } : {}),
57
+ });
58
+ }
59
+ async evidence(log, range) {
60
+ const qs = [];
61
+ if (range?.from !== undefined)
62
+ qs.push(`from=${encodeURIComponent(String(range.from))}`);
63
+ if (range?.to !== undefined)
64
+ qs.push(`to=${encodeURIComponent(String(range.to))}`);
65
+ const query = qs.length > 0 ? `?${qs.join('&')}` : '';
66
+ const path = `/runtime/audit/${encodeURIComponent(log)}/evidence${query}`;
67
+ const client = this.client;
68
+ if (client !== null
69
+ && typeof client === 'object'
70
+ && 'fetchRaw' in client
71
+ && typeof client.fetchRaw === 'function') {
72
+ const fetchRaw = client.fetchRaw;
73
+ const res = await fetchRaw(path);
74
+ if (!res.ok) {
75
+ throw new Error(`Audit evidence download failed (status ${res.status})`);
76
+ }
77
+ return res.arrayBuffer();
78
+ }
79
+ const got = await this.client.get(path, undefined, { operationId: 'getAuditEvidenceBundle' });
80
+ if (got instanceof ArrayBuffer)
81
+ return got;
82
+ throw new Error('FetchClient does not support binary downloads — wire `fetchRaw(path)` on your custom client.');
83
+ }
84
+ }
85
+ exports.AuditResource = AuditResource;
86
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/resources/audit.ts"],"names":[],"mappings":";;;AACA,wDAAoF;AA0BpF;;;;;;;;;;;;GAYG;AACH,MAAa,aAAa;IACc;IAApC,YAAoC,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAyBpD,IAAI,CACP,GAAoB,EACpB,MAA2B,EAC3B,OAAkC;QAElC,MAAM,IAAI,GAAG,kBAAkB,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,UAAU,GAAG,C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AkB,kBAAkB,CAAC,GAAG,CAAC,YAAY,KAAK,EAAE,CAAC;QAC1E,MAAM,MAAM,GAAY,IAAI,CAAC,MAAM,CAAC;QACpC,IACI,MAAM,KAAK,IAAI;eACZ,OAAO,MAAM,KAAK,QAAQ;eAC1B,UAAU,IAAI,MAAM;eACpB,OAAQ,MAAgC,CAAC,QAAQ,KAAK,UAAU,EACrE,CAAC;YACC,MAAM,QAAQ,GAAI,MAAyD,CAAC,QAAQ,CAAC;YACrF,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;YACjC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,0CAA0C,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;YAC7E,CAAC;YACD,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAU,IAAI,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC,CAAC;QACvG,IAAI,GAAG,YAAY,WAAW;YAAE,OAAO,GAAG,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,8FAA8F,CAAC,CAAC;IACpH,CAAC;CACJ;AAxFD,sCAwFC"}
@@ -0,0 +1,25 @@
1
+ import type { FetchClient } from '../_internal/fetch-client';
2
+ export type EnvelopeGrantKind = 'section' | 'system';
3
+ export interface EnvelopeGrant {
4
+ readonly kind: EnvelopeGrantKind;
5
+ /** Section name for kind='section'; null for kind='system'. */
6
+ readonly target: string | null;
7
+ readonly action: string;
8
+ /** Bounds only (S5b-a, system grants) — not part of grant identity. */
9
+ readonly conditions?: unknown;
10
+ }
11
+ export interface OwnerCeilingEnvelope {
12
+ readonly ownerRoleNames: ReadonlyArray<string>;
13
+ readonly grants: ReadonlyArray<EnvelopeGrant>;
14
+ }
15
+ export declare class AuthorizationCeilingResource {
16
+ private readonly client;
17
+ constructor(client: FetchClient);
18
+ /**
19
+ * GET /contract/authorizations/ceiling — the tenant's owner/ceiling envelope.
20
+ * This endpoint returns the BARE `{ownerRoleNames, grants}` body (no
21
+ * {success,data} wrapper), so it opts out of the transport unwrap (G1).
22
+ */
23
+ get(): Promise<OwnerCeilingEnvelope>;
24
+ }
25
+ //# sourceMappingURL=authorization-ceiling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-ceiling.d.ts","sourceRoot":"","sources":["../../src/resources/authorization-ceiling.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACjD;AAED,qBAAa,4BAA4B;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;OAIG;IACG,GAAG,IAAI,OAAO,CAAC,oBAAoB,CAAC;CAO7C"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ // Sub-spec C — owner/ceiling envelope introspection (ADR-0102 §6).
3
+ //
4
+ // Read-only mirror of `GET /contract/authorizations/ceiling`. The envelope is
5
+ // the platform-seeded owner role names + the contract-section/system grants they
6
+ // hold — the ceiling against which the dashboard derives owner-row locks and
7
+ // cat-① "beyond-ceiling" cells. Derived server-side by `DbOwnerEnvelopeReader`;
8
+ // the SDK only reads it.
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AuthorizationCeilingResource = void 0;
11
+ class AuthorizationCeilingResource {
12
+ client;
13
+ constructor(client) {
14
+ this.client = client;
15
+ }
16
+ /**
17
+ * GET /contract/authorizations/ceiling — the tenant's owner/ceiling envelope.
18
+ * This endpoint returns the BARE `{ownerRoleNames, grants}` body (no
19
+ * {success,data} wrapper), so it opts out of the transport unwrap (G1).
20
+ */
21
+ async get() {
22
+ return this.client.get('/contract/authorizations/ceiling', undefined, { operationId: 'getAuthorizationCeiling' });
23
+ }
24
+ }
25
+ exports.AuthorizationCeilingResource = AuthorizationCeilingResource;
26
+ //# sourceMappingURL=authorization-ceiling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-ceiling.js","sourceRoot":"","sources":["../../src/resources/authorization-ceiling.ts"],"names":[],"mappings":";AAAA,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF,6EAA6E;AAC7E,gFAAgF;AAChF,yBAAyB;;;AAoBzB,MAAa,4BAA4B;IACR;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;OAIG;IACH,KAAK,CAAC,GAAG;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAClB,kCAAkC,EAClC,SAAS,EACT,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAC7C,CAAC;IACN,CAAC;CACJ;AAfD,oEAeC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The operationId suffix for an on-path — mirrors the OpenAPI generator exactly.
3
+ *
4
+ * ADR-0109 A1 makes the operationId the SINGLE unwrap authority, so every call
5
+ * must name its operation. The SDK carries zero runtime dependencies, so it
6
+ * cannot import the canonical derivation from `@zarel-ai/contract`; it mirrors
7
+ * it here instead, and `authorization-operation-ids.test.ts` asserts every
8
+ * derived id exists in the GENERATED unwrap map, so the mirror cannot drift
9
+ * silently.
10
+ *
11
+ * Dynamic families are SINGULAR (`OnFlow`, not `OnFlows`) because the config
12
+ * section `flows` and the per-flow grant `flows/{name}` would otherwise collide.
13
+ */
14
+ export declare function authorizationOperationSuffix(onPath: string): string;
15
+ //# sourceMappingURL=authorization-operation-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-operation-ids.d.ts","sourceRoot":"","sources":["../../src/resources/authorization-operation-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAUnE"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.authorizationOperationSuffix = authorizationOperationSuffix;
4
+ /**
5
+ * The operationId suffix for an on-path — mirrors the OpenAPI generator exactly.
6
+ *
7
+ * ADR-0109 A1 makes the operationId the SINGLE unwrap authority, so every call
8
+ * must name its operation. The SDK carries zero runtime dependencies, so it
9
+ * cannot import the canonical derivation from `@zarel-ai/contract`; it mirrors
10
+ * it here instead, and `authorization-operation-ids.test.ts` asserts every
11
+ * derived id exists in the GENERATED unwrap map, so the mirror cannot drift
12
+ * silently.
13
+ *
14
+ * Dynamic families are SINGULAR (`OnFlow`, not `OnFlows`) because the config
15
+ * section `flows` and the per-flow grant `flows/{name}` would otherwise collide.
16
+ */
17
+ function authorizationOperationSuffix(onPath) {
18
+ if (onPath.startsWith('records/'))
19
+ return 'OnRecord';
20
+ if (onPath.startsWith('flows/'))
21
+ return 'OnFlow';
22
+ if (onPath.startsWith('llm/services/'))
23
+ return 'OnLlmService';
24
+ const pascal = onPath
25
+ .split(/[^a-zA-Z0-9]+/)
26
+ .filter(Boolean)
27
+ .map((w) => w[0].toUpperCase() + w.slice(1))
28
+ .join('');
29
+ return `On${pascal}`;
30
+ }
31
+ //# sourceMappingURL=authorization-operation-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization-operation-ids.js","sourceRoot":"","sources":["../../src/resources/authorization-operation-ids.ts"],"names":[],"mappings":";;AAaA,oEAUC;AAvBD;;;;;;;;;;;;GAYG;AACH,SAAgB,4BAA4B,CAAC,MAAc;IACvD,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,UAAU,CAAC;IACrD,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IACjD,IAAI,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC;QAAE,OAAO,cAAc,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM;SAChB,KAAK,CAAC,eAAe,CAAC;SACtB,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC5C,IAAI,CAAC,EAAE,CAAC,CAAC;IACd,OAAO,KAAK,MAAM,EAAE,CAAC;AACzB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { type FetchClient } from '../_internal/fetch-client';
2
+ import type { LocaleOptions } from '../types/locale';
3
+ /**
4
+ * The authorization surface — spec `20260722-185941-authz-structural-keys`, T034.
5
+ *
6
+ * Replaces `contract-policies`, `entity-policies`, `flow-policies` and
7
+ * `authorization-llm-services`. Those four existed only because the HTTP surface
8
+ * was partitioned by plane and by family; the surface is now one path-addressed
9
+ * resource, so the SDK is one resource too.
10
+ *
11
+ * `encodeURIComponent` on the on-path is GONE. There is nothing to encode: the
12
+ * on-path travels as real path segments (ADR-0077 P2). Encoding it was the bug —
13
+ * nginx decodes `%2F` before the router sees it, so `channels` was
14
+ * unreachable end-to-end. `{role}` is still encoded: it is a single segment and
15
+ * a user-supplied value.
16
+ */
17
+ /** A grant statement: a bare action, or one attenuated by `fields` / `scope` / `when`. */
18
+ export type AuthorizationStatement = string | Readonly<Record<string, {
19
+ readonly fields?: ReadonlyArray<string>;
20
+ readonly scope?: ReadonlyArray<'contract' | 'runtime'>;
21
+ readonly when?: Readonly<Record<string, unknown>>;
22
+ }>>;
23
+ /** The permissions a role holds on one on-path — the addressable unit. */
24
+ export interface AuthorizationGrant {
25
+ /** e.g. `entities`, `channels`, `records/orders`, `llm/services/primary`. */
26
+ readonly on: string;
27
+ readonly actions: ReadonlyArray<AuthorizationStatement>;
28
+ }
29
+ /** A role's complete grant set. */
30
+ export interface RoleAuthorization {
31
+ readonly role: string;
32
+ readonly grants: ReadonlyArray<AuthorizationGrant>;
33
+ }
34
+ /**
35
+ * Authorization grants, addressed the way the contract declares them:
36
+ * `/contract/authorization/{role}/<on-path>`.
37
+ */
38
+ export declare class AuthorizationResource {
39
+ private readonly client;
40
+ constructor(client: FetchClient);
41
+ private base;
42
+ /** The on-path is a PATH, not a value to encode — that is the whole point. */
43
+ private item;
44
+ private op;
45
+ /** Every grant a role holds, in canonical order. */
46
+ list(role: string, options?: LocaleOptions): Promise<RoleAuthorization>;
47
+ /** Read one grant. */
48
+ get(role: string, onPath: string, options?: LocaleOptions): Promise<AuthorizationGrant>;
49
+ /** Create a grant. Rejects with 409 when one already exists on that on-path — use {@link put} to replace. */
50
+ create(role: string, grant: AuthorizationGrant): Promise<AuthorizationGrant>;
51
+ /** Create or replace a grant. Idempotent. */
52
+ put(role: string, onPath: string, actions: ReadonlyArray<AuthorizationStatement>): Promise<AuthorizationGrant>;
53
+ /** Merge actions into an existing grant — adds or re-attenuates, never drops. */
54
+ patch(role: string, onPath: string, actions: ReadonlyArray<AuthorizationStatement>): Promise<AuthorizationGrant>;
55
+ /** Remove a grant entirely. */
56
+ del(role: string, onPath: string): Promise<{
57
+ readonly message: string;
58
+ }>;
59
+ }
60
+ //# sourceMappingURL=authorization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../src/resources/auth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AM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQ7F,6GAA6G;IACvG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIlF,6CAA6C;IACvC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMpH,iFAAiF;IAC3E,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMtH,+BAA+B;IACzB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAKjF"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthorizationResource = void 0;
4
+ const fetch_client_1 = require("../_internal/fetch-client");
5
+ const authorization_operation_ids_1 = require("./authorization-operation-ids");
6
+ /**
7
+ * Authorization grants, addressed the way the contract declares them:
8
+ * `/contract/authorization/{role}/<on-path>`.
9
+ */
10
+ class AuthorizationResource {
11
+ client;
12
+ constructor(client) {
13
+ this.client = client;
14
+ }
15
+ base(role) {
16
+ return `/contract/authorization/${encodeURIComponent(role)}`;
17
+ }
18
+ /** The on-path is a PATH, not a value to encode — that is the whole point. */
19
+ item(role, onPath) {
20
+ return `${this.base(role)}/${onPath}`;
21
+ }
22
+ op(verb, onPath) {
23
+ return `${verb}Grant${(0, authorization_operation_ids_1.authorizationOperationSuffix)(onPath)}`;
24
+ }
25
+ /** Every grant a role holds, in canonical order. */
26
+ async list(role, options) {
27
+ return this.client.get(this.base(role), (0, fetch_client_1.localeQueryOrUndefined)(options), { operationId: 'listRoleGrants' });
28
+ }
29
+ /** Read one grant. */
30
+ async get(role, onPath, options) {
31
+ return this.client.get(this.item(role, onPath), (0, fetch_client_1.localeQueryOrUndefined)(options), { operationId: this.op('get', onPath) });
32
+ }
33
+ /** Create a grant. Rejects with 409 when one already exists on that on-path — use {@link put} to replace. */
34
+ async create(role, grant) {
35
+ return this.client.post(this.base(role), grant, { operationId: 'createRoleGrant' });
36
+ }
37
+ /** Create or replace a grant. Idempotent. */
38
+ async put(role, onPath, actions) {
39
+ return this.client.put(this.item(role, onPath), { actions }, { operationId: this.op('put', onPath) });
40
+ }
41
+ /** Merge actions into an existing grant — adds or re-attenuates, never drops. */
42
+ async patch(role, onPath, actions) {
43
+ return this.client.patch(this.item(role, onPath), { actions }, { operationId: this.op('patch', onPath) });
44
+ }
45
+ /** Remove a grant entirely. */
46
+ async del(role, onPath) {
47
+ return this.client.del(this.item(role, onPath), { operationId: this.op('delete', onPath) });
48
+ }
49
+ }
50
+ exports.AuthorizationResource = AuthorizationResource;
51
+ //# sourceMappingURL=authorization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../src/resources/authorization.ts"],"names":[],"mappings":";;;AAAA,4DAAqF;AAErF,+EAA6E;AAuC7E;;;GAGG;AACH,MAAa,qBAAqB;IACD;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAE5C,IAAI,CAAC,IAAY;QACrB,OAAO,2BAA2B,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;IACjE,CAAC;IAED,8EAA8E;IACtE,IAAI,CAAC,IAAY,EAAE,MAAc;QACrC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC;IAC1C,CAAC;IAEO,EAAE,CAAC,IAAwC,EAAE,MAAc;QAC/D,OAAO,GAAG,IAAI,QAAQ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I,CAAC,MAAM,CAAC,KAAK,CACpB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAClF,CAAC;IACN,CAAC;IAED,+BAA+B;IAC/B,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,MAAc;QAClC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAClB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CACtE,CAAC;IACN,CAAC;CACJ;AA3DD,sDA2DC"}
@@ -0,0 +1,38 @@
1
+ import type { FetchClient } from '../_internal/fetch-client';
2
+ export interface EntityPermissionEntry {
3
+ readonly entity: string;
4
+ readonly actions: ReadonlyArray<string>;
5
+ /**
6
+ * The scope the write floor will enforce, per reported action. `full` reaches every row;
7
+ * `owner` reaches only rows the caller owns.
8
+ *
9
+ * An owner-scoped action used to be ABSENT from `actions` entirely — the endpoint derived
10
+ * its answer from a policy read filtered by role name, and `owner` is a pseudo-role no role
11
+ * list contains. Callers gating an affordance on `actions.includes(...)` were therefore
12
+ * under-told, and should now gate the ROW-level affordance on this too.
13
+ */
14
+ readonly scope_by_action: Readonly<Record<string, 'full' | 'owner'>>;
15
+ /**
16
+ * Per-action writable field restriction, ON A ROW THE CALLER OWNS — the widest set any
17
+ * single row admits. **Absent = all fields**; it never means none.
18
+ */
19
+ readonly fields_by_action: Readonly<Record<string, ReadonlyArray<string> | null>>;
20
+ }
21
+ export interface EffectiveAuthorizationsResponse {
22
+ readonly tenant_name: string;
23
+ readonly user_name: string;
24
+ readonly user_roles: ReadonlyArray<string>;
25
+ readonly admin_sections: ReadonlyArray<string>;
26
+ readonly system_actions: ReadonlyArray<string>;
27
+ readonly entity_permissions: ReadonlyArray<EntityPermissionEntry>;
28
+ }
29
+ export declare class AuthorizationsResource {
30
+ private readonly client;
31
+ constructor(client: FetchClient);
32
+ /**
33
+ * GET /runtime/authorizations/effective — what the authorization engine
34
+ * decides for the CALLING actor (self-scope; no actor parameter exists).
35
+ */
36
+ effective(): Promise<EffectiveAuthorizationsResponse>;
37
+ }
38
+ //# sourceMappingURL=authorizations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorizations.d.ts","sourceRoot":"","sources":["../../src/resources/authorizations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IACrE;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;CACrF;AAED,MAAM,WAAW,+BAA+B;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;CACrE;AAED,qBAAa,sBAAsB;IACnB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;OAGG;IACG,SAAS,IAAI,OAAO,CAAC,+BAA+B,CAAC;CAG9D"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // ADR-0102 §6 (S3b) — self-scoped effective-authorizations introspection.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AuthorizationsResource = void 0;
5
+ class AuthorizationsResource {
6
+ client;
7
+ constructor(client) {
8
+ this.client = client;
9
+ }
10
+ /**
11
+ * GET /runtime/authorizations/effective — what the authorization engine
12
+ * decides for the CALLING actor (self-scope; no actor parameter exists).
13
+ */
14
+ async effective() {
15
+ return this.client.get('/runtime/authorizations/effective', undefined, { operationId: 'runtimeEffectiveAuthorizations' });
16
+ }
17
+ }
18
+ exports.AuthorizationsResource = AuthorizationsResource;
19
+ //# sourceMappingURL=authorizations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authorizations.js","sourceRoot":"","sources":["../../src/resources/authorizations.ts"],"names":[],"mappings":";AAAA,0EAA0E;;;AAiC1E,MAAa,sBAAsB;IACF;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;OAGG;IACH,KAAK,CAAC,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAkC,mCAAmC,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC,CAAC;IAC/J,CAAC;CACJ;AAVD,wDAUC"}
@@ -0,0 +1,36 @@
1
+ import { type FetchClient } from '../_internal/fetch-client';
2
+ import type { EventStreamHandle, EventStreamOptions } from '../types/events-stream';
3
+ import type { MintPartyTokenRequest, PartyToken, ChannelDirectiveContent, ChannelSendResult, ChannelDirectiveStreamEvent } from '../types/channels';
4
+ /**
5
+ * ADR-0133 §B.4 decision 5 — the four channel operations the channel-ingress
6
+ * credential grants: mint / subscribe / fetch(=claim) / report. The client MUST be
7
+ * configured with a `channel`-class credential as its runtime token; these are the
8
+ * ONLY routes that accept it (asymmetric acceptance). QI-002: this is the closed
9
+ * SDK duplex surface `@zarel-ai/channels` is allowed to import.
10
+ */
11
+ export declare class ChannelsResource {
12
+ private readonly client;
13
+ constructor(client: FetchClient);
14
+ /** Mint a short-TTL anonymous party token bound to (credential channel, party_ref). */
15
+ mint(request: MintPartyTokenRequest): Promise<PartyToken>;
16
+ /**
17
+ * fetch(=claim): take the delivery lease AND read the reply body. The lease is keyed
18
+ * by the credential; re-fetch by the holder refreshes it, a foreign live lease is 409.
19
+ */
20
+ fetch(directiveId: string): Promise<ChannelDirectiveContent>;
21
+ /** report(=ack): terminal send-result + lease release. */
22
+ report(directiveId: string, result: ChannelSendResult): Promise<{
23
+ status: string;
24
+ }>;
25
+ /**
26
+ * subscribe: open the SSE stream of new directives for the credential's own channel
27
+ * (server-side filtered, QI-006). `onDirective` fires per `channel.directive_created`
28
+ * frame with the directive id to fetch. Returns a teardown handle. Uses the SDK's
29
+ * dep-free reconnecting SSE client (ADR-0109) — no runtime deps added.
30
+ */
31
+ subscribe(onDirective: (event: ChannelDirectiveStreamEvent) => void, options?: EventStreamOptions & {
32
+ onError?: (err: unknown) => void;
33
+ onOpen?: () => void;
34
+ }): EventStreamHandle;
35
+ }
36
+ //# sourceMappingURL=channels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/resources/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EACR,qBAAqB,EACrB,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC9B,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,qBAAa,gBAAgB;IACb,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,uFAAuF;IACjF,IAAI,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC;IAI/D;;;OAGG;IACG,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAQlE,0DAA0D;IACpD,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAQzF;;;;;OAKG;IACH,SAAS,CACL,WAAW,EAAE,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI,EACzD,OAAO,GAAE,kBAAkB,GAAG;QAAE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;KAAO,GAC7F,iBAAiB;CAwBvB"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChannelsResource = void 0;
4
+ /**
5
+ * ADR-0133 §B.4 decision 5 — the four channel operations the channel-ingress
6
+ * credential grants: mint / subscribe / fetch(=claim) / report. The client MUST be
7
+ * configured with a `channel`-class credential as its runtime token; these are the
8
+ * ONLY routes that accept it (asymmetric acceptance). QI-002: this is the closed
9
+ * SDK duplex surface `@zarel-ai/channels` is allowed to import.
10
+ */
11
+ class ChannelsResource {
12
+ client;
13
+ constructor(client) {
14
+ this.client = client;
15
+ }
16
+ /** Mint a short-TTL anonymous party token bound to (credential channel, party_ref). */
17
+ async mint(request) {
18
+ return this.client.post('/runtime/channels/mint', request, { operationId: 'runtimeChannelsMint' });
19
+ }
20
+ /**
21
+ * fetch(=claim): take the delivery lease AND read the reply body. The lease is keyed
22
+ * by the credential; re-fetch by the holder refreshes it, a foreign live lease is 409.
23
+ */
24
+ async fetch(directiveId) {
25
+ return this.client.get(`/runtime/channels/directives/${encodeURIComponent(directiveId)}/content`, undefined, { operationId: 'runtimeChannelsFetch' });
26
+ }
27
+ /** report(=ack): terminal send-result + lease release. */
28
+ async report(directiveId, result) {
29
+ return this.client.post(`/runtime/channels/directives/${encodeURIComponent(directiveId)}/send-result`, result, { operationId: 'runtimeChannelsReport' });
30
+ }
31
+ /**
32
+ * subscribe: open the SSE stream of new directives for the credential's own channel
33
+ * (server-side filtered, QI-006). `onDirective` fires per `channel.directive_created`
34
+ * frame with the directive id to fetch. Returns a teardown handle. Uses the SDK's
35
+ * dep-free reconnecting SSE client (ADR-0109) — no runtime deps added.
36
+ */
37
+ subscribe(onDirective, options = {}) {
38
+ return this.client.openEventStream('/runtime/channels/directives/stream', {
39
+ onEvent: (event) => {
40
+ if (event.event !== 'channel.directive_created')
41
+ return;
42
+ let data;
43
+ try {
44
+ data = typeof event.data === 'string'
45
+ ? JSON.parse(event.data)
46
+ : event.data;
47
+ }
48
+ catch {
49
+ return; // malformed frame — drop, never throw into onEvent
50
+ }
51
+ if (data && typeof data.directive_id === 'string') {
52
+ onDirective({ directive_id: data.directive_id });
53
+ }
54
+ },
55
+ ...(options.onError ? { onError: options.onError } : {}),
56
+ ...(options.onOpen ? { onOpen: options.onOpen } : {}),
57
+ }, options);
58
+ }
59
+ }
60
+ exports.ChannelsResource = ChannelsResource;
61
+ //# sourceMappingURL=channels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/resources/channels.ts"],"names":[],"mappings":";;;AAUA;;;;;;GAMG;AACH,MAAa,gBAAgB;IACI;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,uFAAuF;IACvF,KAAK,CAAC,IAAI,CAAC,OAA8B;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAa,wBAAwB,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACnH,CAAC;IAED;;;OAGG;IACH,KAAK,C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,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,EACD,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AA9DD,4CA8DC"}
@@ -0,0 +1,46 @@
1
+ import { type FetchClient } from '../_internal/fetch-client';
2
+ import type { SpecDiff, SpecPublishRequest, SpecPublishResponse, SpecDiffRequest, SpecApplyRequest, SpecApplyResponse, SpecSnapshotV1Response, SpecDryRunSubmitRequest, SpecDryRunSubmitResponse, SpecDryRunJob } from '../types/spec';
3
+ import type { LocaleOptions } from '../types/locale';
4
+ /**
5
+ * Spec resource (spec-051 US2; renamed from ContractsResource).
6
+ *
7
+ * Canonical surface (URLs are bare canonical paths per ADR-0077 D14'):
8
+ * - publish(req) → POST /contract/spec/publish
9
+ * - diff(req) → POST /contract/spec/diff
10
+ * - apply(req) → POST /contract/spec/apply
11
+ * - snapshot() → GET /contract/spec/snapshot
12
+ * - dryRun(req) → POST /contract/spec/dry-run
13
+ * - dryRunReport() → GET /contract/spec/dry-run/:id
14
+ * - dryRunCancel() → DELETE /contract/spec/dry-run/:id
15
+ */
16
+ export declare class SpecResource {
17
+ private readonly client;
18
+ constructor(client: FetchClient);
19
+ publish(request: SpecPublishRequest): Promise<SpecPublishResponse>;
20
+ diff(request: SpecDiffRequest): Promise<SpecDiff>;
21
+ apply(request: SpecApplyRequest): Promise<SpecApplyResponse>;
22
+ snapshot(options?: LocaleOptions): Promise<SpecSnapshotV1Response>;
23
+ /** GET /contract/spec/snapshot/locale-coverage — i18n coverage report for the published snapshot. */
24
+ snapshotLocaleCoverage(options?: LocaleOptions): Promise<Record<string, unknown>>;
25
+ /**
26
+ * GET /contract/spec/snapshot/semantic-diff — semantic diff between two published
27
+ * contract versions. `from`/`to` are REQUIRED (contract versions, ≥ 1).
28
+ */
29
+ snapshotSemanticDiff(input: {
30
+ from: number;
31
+ to: number;
32
+ } & LocaleOptions): Promise<Record<string, unknown>>;
33
+ /**
34
+ * Submit an async dry-run.
35
+ */
36
+ dryRun(request: SpecDryRunSubmitRequest): Promise<SpecDryRunSubmitResponse>;
37
+ /**
38
+ * Poll the dry-run job for status / report.
39
+ */
40
+ dryRunReport(reportId: string, options?: LocaleOptions): Promise<SpecDryRunJob>;
41
+ /**
42
+ * Cancel a queued / running dry-run job.
43
+ */
44
+ dryRunCancel(reportId: string): Promise<void>;
45
+ }
46
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/resources/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAA0B,MAAM,2BAA2B,CAAC;AACrF,OAAO,KAAK,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAY;IACF,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,OAAO,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIlE,IAAI,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIjD,KAAK,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI5D,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAsB/E,qGAAqG;IACxF,sBAAsB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAQ9F;;;OAGG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