@open-everywhere/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3606) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +21 -0
  3. package/README.md +67 -0
  4. package/agent/access/access-referenced-link-sets.ts +23 -0
  5. package/agent/access/admin-read-venue.ts +159 -0
  6. package/agent/access/admin-standing.ts +98 -0
  7. package/agent/access/analytics-scope.ts +84 -0
  8. package/agent/access/approval-dedupe.ts +144 -0
  9. package/agent/access/approval-judge.ts +639 -0
  10. package/agent/access/approval-preview.ts +118 -0
  11. package/agent/access/approval-scenarios.ts +48 -0
  12. package/agent/access/approver-chain.ts +779 -0
  13. package/agent/access/audience-floor.ts +270 -0
  14. package/agent/access/aws-output.ts +132 -0
  15. package/agent/access/aws-screen.ts +198 -0
  16. package/agent/access/background-tasks.ts +364 -0
  17. package/agent/access/browser-hosts.ts +151 -0
  18. package/agent/access/browser-toolkit.ts +271 -0
  19. package/agent/access/bundle.ts +716 -0
  20. package/agent/access/capabilities.ts +11 -0
  21. package/agent/access/chat-dm-grant.ts +241 -0
  22. package/agent/access/chat-write-grant.ts +194 -0
  23. package/agent/access/config.ts +132 -0
  24. package/agent/access/connector-content-origin-state.ts +72 -0
  25. package/agent/access/connector-credentials.ts +449 -0
  26. package/agent/access/connector-disclosure.ts +253 -0
  27. package/agent/access/connector-op-gating.ts +224 -0
  28. package/agent/access/connector-scope.ts +302 -0
  29. package/agent/access/consequence.ts +1208 -0
  30. package/agent/access/credential-bindings-codemod.ts +242 -0
  31. package/agent/access/credential-endpoints.ts +279 -0
  32. package/agent/access/credential-grant-ask.ts +115 -0
  33. package/agent/access/credential-grant-broker.ts +359 -0
  34. package/agent/access/credential-grant-card.ts +521 -0
  35. package/agent/access/credential-grant-click.ts +246 -0
  36. package/agent/access/credential-grant-copy.ts +338 -0
  37. package/agent/access/credential-grant-flow.ts +735 -0
  38. package/agent/access/credential-grant-key-shape.ts +59 -0
  39. package/agent/access/credential-grant-notice.ts +219 -0
  40. package/agent/access/credential-grant-owner.ts +23 -0
  41. package/agent/access/credential-grant-reach.ts +81 -0
  42. package/agent/access/credential-grant-resolution.ts +119 -0
  43. package/agent/access/credential-grant-revoke.ts +95 -0
  44. package/agent/access/credential-grant-scope.ts +306 -0
  45. package/agent/access/credential-grant.ts +284 -0
  46. package/agent/access/credentials.ts +159 -0
  47. package/agent/access/dated-read.ts +18 -0
  48. package/agent/access/delegation-flag.ts +12 -0
  49. package/agent/access/delegation-mount.ts +28 -0
  50. package/agent/access/delta.ts +386 -0
  51. package/agent/access/dispatch-origin-signal.ts +133 -0
  52. package/agent/access/domain-credentials.ts +115 -0
  53. package/agent/access/egress-denial-log.ts +111 -0
  54. package/agent/access/egress-denial-poller.ts +239 -0
  55. package/agent/access/egress-status.ts +195 -0
  56. package/agent/access/egress.ts +321 -0
  57. package/agent/access/enforcement.ts +25 -0
  58. package/agent/access/eve-patch-probe-boot.ts +91 -0
  59. package/agent/access/eve-patch-probe.ts +276 -0
  60. package/agent/access/external-policy.ts +209 -0
  61. package/agent/access/extra-hosts.ts +31 -0
  62. package/agent/access/grant-borrow-transport-registry.internal.ts +81 -0
  63. package/agent/access/grant-room-notice-registry.internal.ts +77 -0
  64. package/agent/access/grant-schema-pin.ts +38 -0
  65. package/agent/access/grants-codemod.ts +352 -0
  66. package/agent/access/group-request.ts +76 -0
  67. package/agent/access/halt-state.ts +24 -0
  68. package/agent/access/halt.ts +276 -0
  69. package/agent/access/host-egress.ts +432 -0
  70. package/agent/access/human-only-invariants-manifest.ts +172 -0
  71. package/agent/access/ingestion-binding-manifest.ts +263 -0
  72. package/agent/access/ingestion-route-inventory.generated.ts +58 -0
  73. package/agent/access/instructions.ts +89 -0
  74. package/agent/access/invoker-posture-state.ts +25 -0
  75. package/agent/access/invoker-posture.ts +96 -0
  76. package/agent/access/job-posture.ts +83 -0
  77. package/agent/access/job-session-state.ts +58 -0
  78. package/agent/access/lean-seat-state.ts +45 -0
  79. package/agent/access/lean-seat.ts +83 -0
  80. package/agent/access/lint.ts +638 -0
  81. package/agent/access/live-delegated-tasks.ts +95 -0
  82. package/agent/access/loop-breaker.ts +88 -0
  83. package/agent/access/mcp-call-fence.ts +179 -0
  84. package/agent/access/member-grant.ts +45 -0
  85. package/agent/access/member-plane.ts +212 -0
  86. package/agent/access/native-admin.ts +35 -0
  87. package/agent/access/native-delegation-state.ts +40 -0
  88. package/agent/access/network-access.ts +132 -0
  89. package/agent/access/nullable-optional-fields.ts +184 -0
  90. package/agent/access/overlay-module.ts +70 -0
  91. package/agent/access/own-account-gate-manifest.ts +134 -0
  92. package/agent/access/pane-venue.ts +238 -0
  93. package/agent/access/pending-delegation-signal.ts +282 -0
  94. package/agent/access/permission-evidence.ts +627 -0
  95. package/agent/access/permission-proposal.ts +362 -0
  96. package/agent/access/platform.ts +14 -0
  97. package/agent/access/pre-approval-rules.ts +135 -0
  98. package/agent/access/principal-gate-manifest.ts +830 -0
  99. package/agent/access/provider-selection-check.ts +130 -0
  100. package/agent/access/provider-selection.ts +96 -0
  101. package/agent/access/read-grant.ts +104 -0
  102. package/agent/access/repo-capabilities.ts +74 -0
  103. package/agent/access/request.ts +126 -0
  104. package/agent/access/requester-identity.ts +305 -0
  105. package/agent/access/requester-messages.ts +52 -0
  106. package/agent/access/reserved-hosts.ts +11 -0
  107. package/agent/access/resolver.ts +604 -0
  108. package/agent/access/resource-capabilities.ts +103 -0
  109. package/agent/access/resource-grant-manifest.ts +136 -0
  110. package/agent/access/resource-grant.ts +163 -0
  111. package/agent/access/result-cap.ts +34 -0
  112. package/agent/access/result-reduce-model-arm.ts +94 -0
  113. package/agent/access/result-reduce.ts +104 -0
  114. package/agent/access/roles.ts +106 -0
  115. package/agent/access/scope-key.ts +50 -0
  116. package/agent/access/seat-read-budget.ts +57 -0
  117. package/agent/access/self-host-egress.ts +103 -0
  118. package/agent/access/settlement-dispatch-signal.ts +96 -0
  119. package/agent/access/skill-taint-envelope.ts +94 -0
  120. package/agent/access/source-gate-manifest.ts +148 -0
  121. package/agent/access/source-scoped-mount.ts +27 -0
  122. package/agent/access/subagent-taint.ts +225 -0
  123. package/agent/access/surface-work-grant.ts +91 -0
  124. package/agent/access/taint-enforcement.ts +183 -0
  125. package/agent/access/taint-signal.ts +297 -0
  126. package/agent/access/taint-tiers.ts +168 -0
  127. package/agent/access/task-wake-signal.ts +94 -0
  128. package/agent/access/tenant-admission.ts +191 -0
  129. package/agent/access/untrusted-projection.ts +273 -0
  130. package/agent/access/untrusted.ts +132 -0
  131. package/agent/access/wake-mapping.ts +38 -0
  132. package/agent/access/web-fetch-fence.ts +81 -0
  133. package/agent/access/window-gate-manifest.ts +543 -0
  134. package/agent/access/window-gated.ts +668 -0
  135. package/agent/access/window-routing.ts +23 -0
  136. package/agent/access/work-grant.ts +119 -0
  137. package/agent/access/work-mount-manifest.ts +203 -0
  138. package/agent/access/worker-capabilities.ts +379 -0
  139. package/agent/access/worker-capability-index.generated.ts +189 -0
  140. package/agent/access/worker-continuation.ts +200 -0
  141. package/agent/access/worker-seat-state.ts +25 -0
  142. package/agent/access/worker-seat.ts +54 -0
  143. package/agent/access/worker-toolset-state.ts +65 -0
  144. package/agent/adapter-api.ts +1795 -0
  145. package/agent/analytics/compile.ts +461 -0
  146. package/agent/analytics/execute.ts +166 -0
  147. package/agent/analytics/registry.ts +302 -0
  148. package/agent/approvals/access-request.ts +255 -0
  149. package/agent/approvals/actions.ts +398 -0
  150. package/agent/approvals/agent-create.ts +272 -0
  151. package/agent/approvals/arming-context.ts +26 -0
  152. package/agent/approvals/card-disclosure.ts +53 -0
  153. package/agent/approvals/card-signal.ts +151 -0
  154. package/agent/approvals/card-venue.ts +152 -0
  155. package/agent/approvals/card.ts +121 -0
  156. package/agent/approvals/chat-dm.ts +63 -0
  157. package/agent/approvals/chat-post.ts +60 -0
  158. package/agent/approvals/clicker-floor.ts +106 -0
  159. package/agent/approvals/decision-authority.internal.ts +114 -0
  160. package/agent/approvals/decision-wake.ts +122 -0
  161. package/agent/approvals/domain-exposure.ts +182 -0
  162. package/agent/approvals/eve-response-policy.ts +48 -0
  163. package/agent/approvals/flow.ts +2185 -0
  164. package/agent/approvals/input-response-floor.ts +104 -0
  165. package/agent/approvals/judge-contradiction.ts +156 -0
  166. package/agent/approvals/memory-purge.ts +149 -0
  167. package/agent/approvals/pr-open.ts +172 -0
  168. package/agent/approvals/review-surface.ts +7 -0
  169. package/agent/approvals/routine-cancel.ts +57 -0
  170. package/agent/approvals/routine-create.ts +213 -0
  171. package/agent/approvals/routine-lifecycle.ts +206 -0
  172. package/agent/approvals/routine-permission-offer.ts +131 -0
  173. package/agent/approvals/routine-permission.ts +214 -0
  174. package/agent/approvals/routine-policy.ts +174 -0
  175. package/agent/approvals/scope-label.ts +48 -0
  176. package/agent/approvals/session-checkpoint.ts +80 -0
  177. package/agent/approvals/session-grant.ts +173 -0
  178. package/agent/approvals/skill-create.ts +60 -0
  179. package/agent/approvals/skill-delete.ts +50 -0
  180. package/agent/approvals/taint-disclosure.ts +42 -0
  181. package/agent/approvals/ticket-actions.ts +86 -0
  182. package/agent/approvals/ticket-create.ts +67 -0
  183. package/agent/approvals/types.ts +48 -0
  184. package/agent/approvals/webhook-declare.ts +297 -0
  185. package/agent/approvals/webhook.ts +205 -0
  186. package/agent/audit/action-registry.ts +1094 -0
  187. package/agent/audit/audit.ts +105 -0
  188. package/agent/audit/chain.ts +568 -0
  189. package/agent/audit/tool-action.ts +286 -0
  190. package/agent/audit/window-tool-gate.ts +54 -0
  191. package/agent/audit/worker-toolset.ts +117 -0
  192. package/agent/blob/hosting.ts +180 -0
  193. package/agent/channels/access-request-ledger.ts +139 -0
  194. package/agent/channels/ambient-skip.ts +102 -0
  195. package/agent/channels/answered-container-ledger.ts +76 -0
  196. package/agent/channels/approval-card.ts +454 -0
  197. package/agent/channels/approval-claim-guard.ts +384 -0
  198. package/agent/channels/attachments.ts +243 -0
  199. package/agent/channels/aws-sso-callback.ts +9 -0
  200. package/agent/channels/backscroll-window.ts +145 -0
  201. package/agent/channels/cancel-note.ts +127 -0
  202. package/agent/channels/channel-key.ts +56 -0
  203. package/agent/channels/channel-read.ts +501 -0
  204. package/agent/channels/chat-turn-audit.ts +23 -0
  205. package/agent/channels/closing-prose-drop.ts +53 -0
  206. package/agent/channels/command-registration.ts +165 -0
  207. package/agent/channels/context-render.ts +206 -0
  208. package/agent/channels/control-mcp.ts +44 -0
  209. package/agent/channels/control-read.ts +37 -0
  210. package/agent/channels/credential-intake-page.ts +12 -0
  211. package/agent/channels/delegated-provenance.ts +506 -0
  212. package/agent/channels/dm-audience.ts +346 -0
  213. package/agent/channels/dm-seat.ts +138 -0
  214. package/agent/channels/domain-fingerprint.ts +90 -0
  215. package/agent/channels/egress-spoof.ts +35 -0
  216. package/agent/channels/engaged-wake.ts +158 -0
  217. package/agent/channels/engagement.ts +254 -0
  218. package/agent/channels/entity-actions.ts +186 -0
  219. package/agent/channels/front-queue.ts +78 -0
  220. package/agent/channels/generation-retirement.ts +557 -0
  221. package/agent/channels/halt-per-wake.ts +166 -0
  222. package/agent/channels/memory-claim-guard.ts +425 -0
  223. package/agent/channels/name-drop-wake-audit.ts +162 -0
  224. package/agent/channels/native-wake-retry.ts +62 -0
  225. package/agent/channels/no-reply-signal.ts +49 -0
  226. package/agent/channels/normalized-wake.ts +285 -0
  227. package/agent/channels/oe-oauth-callback.ts +13 -0
  228. package/agent/channels/own-post-ledger.ts +76 -0
  229. package/agent/channels/platform-failure.ts +45 -0
  230. package/agent/channels/policy-pages.ts +15 -0
  231. package/agent/channels/post-arms.ts +321 -0
  232. package/agent/channels/proactive-dm-manifest.ts +113 -0
  233. package/agent/channels/propose-scope.ts +90 -0
  234. package/agent/channels/question-bridge.ts +594 -0
  235. package/agent/channels/rate-limit-retry.ts +355 -0
  236. package/agent/channels/react-signal.ts +26 -0
  237. package/agent/channels/reaction-ingest.ts +221 -0
  238. package/agent/channels/read-author-trust.ts +71 -0
  239. package/agent/channels/read-reach.ts +339 -0
  240. package/agent/channels/read-scope-audit.ts +127 -0
  241. package/agent/channels/read-scope-error.ts +5 -0
  242. package/agent/channels/read-spool.ts +131 -0
  243. package/agent/channels/reply-edit.ts +208 -0
  244. package/agent/channels/reply-fold.ts +517 -0
  245. package/agent/channels/reply-freshness.ts +253 -0
  246. package/agent/channels/reply-post.ts +502 -0
  247. package/agent/channels/reply-provenance.ts +804 -0
  248. package/agent/channels/reply-signal.ts +723 -0
  249. package/agent/channels/request-claim-guard.ts +532 -0
  250. package/agent/channels/runtime-code-fingerprint.generated.ts +10 -0
  251. package/agent/channels/runtime-rotation.ts +224 -0
  252. package/agent/channels/seat-admission.ts +103 -0
  253. package/agent/channels/seat-catch-up.ts +482 -0
  254. package/agent/channels/self-dispatch.ts +349 -0
  255. package/agent/channels/session-park.ts +252 -0
  256. package/agent/channels/session-resume.ts +36 -0
  257. package/agent/channels/session-tail-record.ts +172 -0
  258. package/agent/channels/session-tail.ts +140 -0
  259. package/agent/channels/slack-bridge.ts +125 -0
  260. package/agent/channels/stand-down-silence.ts +110 -0
  261. package/agent/channels/standing-authority.ts +237 -0
  262. package/agent/channels/stranded-seat.ts +155 -0
  263. package/agent/channels/supervisor-complete.ts +141 -0
  264. package/agent/channels/surface-message-ops.ts +217 -0
  265. package/agent/channels/task-wake.ts +528 -0
  266. package/agent/channels/teams-bridge.ts +85 -0
  267. package/agent/channels/test-wake.ts +12 -0
  268. package/agent/channels/thread-ownership.ts +70 -0
  269. package/agent/channels/thread-seat-state.ts +90 -0
  270. package/agent/channels/ticket-create.ts +171 -0
  271. package/agent/channels/transcript-relay.ts +9 -0
  272. package/agent/channels/turn-cancel.ts +431 -0
  273. package/agent/channels/turn-delivery.ts +484 -0
  274. package/agent/channels/turn-registry.ts +117 -0
  275. package/agent/channels/turn-terminal-actions.ts +134 -0
  276. package/agent/channels/unified-redrive.ts +215 -0
  277. package/agent/channels/unified-reply.ts +300 -0
  278. package/agent/channels/unified-supervisor.ts +193 -0
  279. package/agent/channels/unified-window.ts +1075 -0
  280. package/agent/channels/unified.ts +1575 -0
  281. package/agent/channels/wake-accounting.ts +121 -0
  282. package/agent/channels/wake-arm.ts +244 -0
  283. package/agent/channels/wake-container.ts +50 -0
  284. package/agent/channels/wake-envelope.ts +632 -0
  285. package/agent/channels/wake-origin-codec.ts +96 -0
  286. package/agent/channels/wake-origin-codecs.ts +4 -0
  287. package/agent/channels/wake-timing.ts +401 -0
  288. package/agent/channels/webhook-reveal-page.ts +12 -0
  289. package/agent/channels/webhooks.ts +216 -0
  290. package/agent/channels/window-key.ts +439 -0
  291. package/agent/channels/window-sources.ts +88 -0
  292. package/agent/channels/work-destinations.ts +48 -0
  293. package/agent/channels/work-registry.ts +26 -0
  294. package/agent/channels/work-search.ts +92 -0
  295. package/agent/commands/core.ts +737 -0
  296. package/agent/commands/rate.ts +173 -0
  297. package/agent/connections/auth-retry-memo.ts +115 -0
  298. package/agent/connections/aws-exec.ts +52 -0
  299. package/agent/connections/aws-identity.ts +297 -0
  300. package/agent/connections/aws-sso-callback.ts +103 -0
  301. package/agent/connections/aws-sso-identity-binding.ts +115 -0
  302. package/agent/connections/aws-sso-link.ts +40 -0
  303. package/agent/connections/connector-auth.ts +984 -0
  304. package/agent/connections/connector-card.ts +447 -0
  305. package/agent/connections/connector-flags.ts +44 -0
  306. package/agent/connections/connector-offer.ts +241 -0
  307. package/agent/connections/connector-transport.ts +131 -0
  308. package/agent/connections/consent-resume.ts +205 -0
  309. package/agent/connections/grant-mcp-borrow.ts +334 -0
  310. package/agent/connections/grant-mcp-transport.ts +64 -0
  311. package/agent/connections/notion.ts +42 -0
  312. package/agent/connections/oe-oauth-callback.ts +207 -0
  313. package/agent/connections/own-account-ask.ts +302 -0
  314. package/agent/connections/own-account-carriage.ts +99 -0
  315. package/agent/connections/own-account-gate.ts +361 -0
  316. package/agent/connections/own-account-vendors.ts +117 -0
  317. package/agent/connections/user-auth-flow.ts +102 -0
  318. package/agent/contributions.ts +197 -0
  319. package/agent/control/auth.ts +663 -0
  320. package/agent/control/capture-window-read.ts +382 -0
  321. package/agent/control/delivery-history.ts +558 -0
  322. package/agent/control/http.ts +169 -0
  323. package/agent/control/mcp-route.ts +105 -0
  324. package/agent/control/oauth-clients.ts +278 -0
  325. package/agent/control/oauth-resource.ts +200 -0
  326. package/agent/control/oauth-route.ts +397 -0
  327. package/agent/control/oauth-tokens.ts +222 -0
  328. package/agent/control/read-route.ts +841 -0
  329. package/agent/control/server.ts +540 -0
  330. package/agent/control/test-route.ts +527 -0
  331. package/agent/control/transcript-export.ts +197 -0
  332. package/agent/control/transcript-relay.ts +381 -0
  333. package/agent/control/transcript-render.ts +164 -0
  334. package/agent/control/views.ts +1289 -0
  335. package/agent/control/writes.ts +1431 -0
  336. package/agent/credentials/binding-pr.ts +247 -0
  337. package/agent/credentials/config-pr-github.ts +197 -0
  338. package/agent/credentials/config-pr.ts +180 -0
  339. package/agent/credentials/db-broker.ts +270 -0
  340. package/agent/credentials/home.ts +83 -0
  341. package/agent/credentials/intake-page.ts +302 -0
  342. package/agent/credentials/intake.ts +550 -0
  343. package/agent/credentials/kv-vault.ts +180 -0
  344. package/agent/credentials/operator-secrets.ts +396 -0
  345. package/agent/credentials/page-chrome.ts +59 -0
  346. package/agent/credentials/page-token.ts +219 -0
  347. package/agent/credentials/purge.ts +113 -0
  348. package/agent/credentials/ref.ts +151 -0
  349. package/agent/credentials/reserved-refs.ts +76 -0
  350. package/agent/credentials/self-secrets.ts +165 -0
  351. package/agent/credentials/warm.ts +209 -0
  352. package/agent/docs/approver-policy.ts +234 -0
  353. package/agent/docs/capability-map.ts +180 -0
  354. package/agent/docs/counted-claims.ts +433 -0
  355. package/agent/docs/registry.ts +184 -0
  356. package/agent/docs/source-map.ts +174 -0
  357. package/agent/hooks/approval-raised.ts +37 -0
  358. package/agent/hooks/approval-settlement.ts +109 -0
  359. package/agent/hooks/binding-bridge.ts +77 -0
  360. package/agent/hooks/connector-audit.ts +111 -0
  361. package/agent/hooks/egress.ts +694 -0
  362. package/agent/hooks/eve-patch-gate.ts +52 -0
  363. package/agent/hooks/fire-carriage.ts +44 -0
  364. package/agent/hooks/fire-toolset.ts +306 -0
  365. package/agent/hooks/job-posture.ts +82 -0
  366. package/agent/hooks/lean-seat.ts +233 -0
  367. package/agent/hooks/learn.ts +199 -0
  368. package/agent/hooks/link-claim.ts +269 -0
  369. package/agent/hooks/log-flush.ts +32 -0
  370. package/agent/hooks/loop-breaker.ts +17 -0
  371. package/agent/hooks/memory.ts +1250 -0
  372. package/agent/hooks/native-input-audit.ts +41 -0
  373. package/agent/hooks/own-account-ask.ts +172 -0
  374. package/agent/hooks/requester-identity.ts +30 -0
  375. package/agent/hooks/requester-messages.ts +55 -0
  376. package/agent/hooks/routine-outcome.ts +252 -0
  377. package/agent/hooks/routine-silence.ts +38 -0
  378. package/agent/hooks/session-park.ts +48 -0
  379. package/agent/hooks/settlement-flush.ts +173 -0
  380. package/agent/hooks/spawn-taint.ts +1312 -0
  381. package/agent/hooks/spend.ts +368 -0
  382. package/agent/hooks/stall-guard.ts +22 -0
  383. package/agent/hooks/telemetry.ts +90 -0
  384. package/agent/hooks/turn-anchor.ts +682 -0
  385. package/agent/hooks/turn-tally.ts +98 -0
  386. package/agent/hooks/wake-accounting-turn.ts +96 -0
  387. package/agent/hooks/wake-turn-start.ts +44 -0
  388. package/agent/hooks/window-routing.ts +51 -0
  389. package/agent/identity/account-directory.ts +138 -0
  390. package/agent/identity/account-display-name.ts +178 -0
  391. package/agent/identity/author-trust.ts +297 -0
  392. package/agent/identity/binding-bridge.ts +88 -0
  393. package/agent/identity/binding.ts +1308 -0
  394. package/agent/identity/bot-display-name.ts +50 -0
  395. package/agent/identity/bot-name.ts +79 -0
  396. package/agent/identity/capabilities.ts +79 -0
  397. package/agent/identity/delegated-binding.ts +130 -0
  398. package/agent/identity/deployment-identity.ts +105 -0
  399. package/agent/identity/directory-sync.ts +777 -0
  400. package/agent/identity/directory.ts +89 -0
  401. package/agent/identity/display-title.ts +19 -0
  402. package/agent/identity/frozen-surface-binding.internal.ts +83 -0
  403. package/agent/identity/group-sync.ts +169 -0
  404. package/agent/identity/groups-codemod.ts +142 -0
  405. package/agent/identity/groups-delivery.ts +156 -0
  406. package/agent/identity/groups.ts +174 -0
  407. package/agent/identity/link-challenge.ts +147 -0
  408. package/agent/identity/link-consent.ts +216 -0
  409. package/agent/identity/link-flow.ts +380 -0
  410. package/agent/identity/link-initiator.ts +27 -0
  411. package/agent/identity/link-resolve.ts +227 -0
  412. package/agent/identity/link-set-ref.ts +33 -0
  413. package/agent/identity/link-store.ts +889 -0
  414. package/agent/identity/link-tenant-backfill.ts +79 -0
  415. package/agent/identity/link-tenant.ts +54 -0
  416. package/agent/identity/oauth-vault-share.ts +40 -0
  417. package/agent/identity/platform.ts +48 -0
  418. package/agent/identity/principal-key-rules.ts +113 -0
  419. package/agent/identity/principal-key.ts +210 -0
  420. package/agent/identity/principals.ts +354 -0
  421. package/agent/identity/surface-key-grammar.ts +142 -0
  422. package/agent/identity/surface-parity.ts +427 -0
  423. package/agent/identity/trust-preflight.ts +271 -0
  424. package/agent/identity/trust.ts +433 -0
  425. package/agent/identity/wake-trust.ts +217 -0
  426. package/agent/instructions/access.ts +1239 -0
  427. package/agent/instructions/seat-prompt.ts +1286 -0
  428. package/agent/lib/process-registry.ts +52 -0
  429. package/agent/memory/agents-codemod.ts +443 -0
  430. package/agent/memory/connector-memory.ts +137 -0
  431. package/agent/memory/domain.ts +1276 -0
  432. package/agent/memory/dream/candidates.ts +187 -0
  433. package/agent/memory/dream/correction.ts +133 -0
  434. package/agent/memory/dream/judge.ts +174 -0
  435. package/agent/memory/dream/learn.ts +299 -0
  436. package/agent/memory/dream/mode3-cluster.ts +151 -0
  437. package/agent/memory/dream/mode3-last-mile.ts +365 -0
  438. package/agent/memory/dream/mode3.ts +311 -0
  439. package/agent/memory/dream/ops.ts +321 -0
  440. package/agent/memory/dream/proposal.ts +83 -0
  441. package/agent/memory/dream/recurrence.ts +132 -0
  442. package/agent/memory/dream/salience.ts +24 -0
  443. package/agent/memory/dream/skill-proposal-pr.ts +323 -0
  444. package/agent/memory/dream/supersede-apply.ts +94 -0
  445. package/agent/memory/dream/tidy.ts +162 -0
  446. package/agent/memory/graph.ts +178 -0
  447. package/agent/memory/host-owned-files.ts +3 -0
  448. package/agent/memory/layout.ts +85 -0
  449. package/agent/memory/listing.ts +199 -0
  450. package/agent/memory/markdown.ts +211 -0
  451. package/agent/memory/partition.ts +66 -0
  452. package/agent/memory/postgres.ts +497 -0
  453. package/agent/memory/provenance-mark.ts +318 -0
  454. package/agent/memory/provenance.ts +28 -0
  455. package/agent/memory/provider.ts +186 -0
  456. package/agent/memory/purge-redaction.ts +68 -0
  457. package/agent/memory/readonly.ts +57 -0
  458. package/agent/memory/resolve.ts +181 -0
  459. package/agent/memory/root-fence.ts +54 -0
  460. package/agent/memory/sandbox-sync.ts +84 -0
  461. package/agent/memory/selection.ts +120 -0
  462. package/agent/memory/silo.ts +71 -0
  463. package/agent/memory/sqlite.ts +206 -0
  464. package/agent/memory/store.ts +162 -0
  465. package/agent/memory/sync-timing.ts +223 -0
  466. package/agent/memory/wake-delta.ts +239 -0
  467. package/agent/memory/write-evidence.ts +150 -0
  468. package/agent/memory/write-fence.ts +145 -0
  469. package/agent/memory/write-intent.ts +205 -0
  470. package/agent/memory/write-road.ts +159 -0
  471. package/agent/model/ab-test.ts +374 -0
  472. package/agent/model/call-capture.ts +414 -0
  473. package/agent/model/default-model.ts +63 -0
  474. package/agent/model/model-stamp.ts +162 -0
  475. package/agent/model/policy.ts +378 -0
  476. package/agent/model/routing.ts +834 -0
  477. package/agent/model/step-boundary.ts +560 -0
  478. package/agent/model/stream-drop-retry.ts +334 -0
  479. package/agent/model/turn-closeout.ts +299 -0
  480. package/agent/model/turn-state.ts +461 -0
  481. package/agent/model/vision.ts +112 -0
  482. package/agent/observability/ship.ts +394 -0
  483. package/agent/observability/telemetry.ts +819 -0
  484. package/agent/observability/turn-clock.ts +96 -0
  485. package/agent/onboarding/onboarding.ts +98 -0
  486. package/agent/operational/credential-grant-rows.ts +944 -0
  487. package/agent/operational/pglite-client.ts +282 -0
  488. package/agent/operational/post-once.ts +146 -0
  489. package/agent/operational/postgres.ts +5030 -0
  490. package/agent/operational/provider.ts +190 -0
  491. package/agent/operational/sqlite.ts +4007 -0
  492. package/agent/operational/store.ts +2346 -0
  493. package/agent/ops/census.ts +1076 -0
  494. package/agent/ops/probes.ts +69 -0
  495. package/agent/ops/quickstart.ts +296 -0
  496. package/agent/ops/server.ts +485 -0
  497. package/agent/ops/surface-manifest.ts +111 -0
  498. package/agent/ops/two-role.ts +75 -0
  499. package/agent/pages/policy-pages.ts +79 -0
  500. package/agent/plugins/extract.ts +381 -0
  501. package/agent/plugins/parse.ts +122 -0
  502. package/agent/plugins/types.ts +147 -0
  503. package/agent/publish/eve-patch-pack.ts +461 -0
  504. package/agent/review/blast-radius.ts +282 -0
  505. package/agent/review/config-facts.ts +200 -0
  506. package/agent/review/facts-artifact.ts +377 -0
  507. package/agent/review/facts-cloud-status.ts +288 -0
  508. package/agent/review/pr-walkthrough.ts +772 -0
  509. package/agent/review/zip.ts +154 -0
  510. package/agent/roles/role.ts +228 -0
  511. package/agent/routines/bound.ts +262 -0
  512. package/agent/routines/check-in.ts +54 -0
  513. package/agent/routines/collector.ts +497 -0
  514. package/agent/routines/declared-permissions.ts +578 -0
  515. package/agent/routines/disable-notice.ts +181 -0
  516. package/agent/routines/entity-read.ts +305 -0
  517. package/agent/routines/event-authz.ts +268 -0
  518. package/agent/routines/event-match.ts +200 -0
  519. package/agent/routines/event-model.ts +744 -0
  520. package/agent/routines/events.ts +201 -0
  521. package/agent/routines/fire-audit.ts +823 -0
  522. package/agent/routines/fire-auth.ts +280 -0
  523. package/agent/routines/fire-carriage.ts +126 -0
  524. package/agent/routines/fire-creator.ts +86 -0
  525. package/agent/routines/fire-disclosure.ts +233 -0
  526. package/agent/routines/fire-eligibility.ts +280 -0
  527. package/agent/routines/fire-halt.ts +57 -0
  528. package/agent/routines/fire-message.ts +76 -0
  529. package/agent/routines/fire-toolset.ts +179 -0
  530. package/agent/routines/fire-window.ts +604 -0
  531. package/agent/routines/follow-ups.ts +173 -0
  532. package/agent/routines/gate.ts +251 -0
  533. package/agent/routines/github-entity-read.ts +120 -0
  534. package/agent/routines/github-fanout.ts +88 -0
  535. package/agent/routines/github-normalizer.ts +248 -0
  536. package/agent/routines/ingress.ts +855 -0
  537. package/agent/routines/job.ts +140 -0
  538. package/agent/routines/jq-filter.ts +387 -0
  539. package/agent/routines/lifecycle.ts +248 -0
  540. package/agent/routines/match-stamp.ts +131 -0
  541. package/agent/routines/outcome-fold.ts +302 -0
  542. package/agent/routines/partition.ts +27 -0
  543. package/agent/routines/permission-card-wait.ts +281 -0
  544. package/agent/routines/permission-card.ts +496 -0
  545. package/agent/routines/permission-key.ts +54 -0
  546. package/agent/routines/permission-review.ts +318 -0
  547. package/agent/routines/policy.ts +304 -0
  548. package/agent/routines/pre-fire.ts +133 -0
  549. package/agent/routines/provider-events.ts +430 -0
  550. package/agent/routines/report.ts +148 -0
  551. package/agent/routines/routine.ts +949 -0
  552. package/agent/routines/schedule.ts +209 -0
  553. package/agent/routines/scheme-name.ts +96 -0
  554. package/agent/routines/stall.ts +153 -0
  555. package/agent/routines/store.ts +100 -0
  556. package/agent/routines/watch.ts +328 -0
  557. package/agent/sandbox/backend-select.ts +58 -0
  558. package/agent/sandbox/vercel-create.ts +211 -0
  559. package/agent/scaffold/app-root.ts +104 -0
  560. package/agent/scaffold/roster-config.ts +187 -0
  561. package/agent/scaffold/roster-fs.ts +202 -0
  562. package/agent/scaffold/roster-plan.ts +880 -0
  563. package/agent/scaffold/templates.ts +85 -0
  564. package/agent/scaffold/tool-roster-read.ts +79 -0
  565. package/agent/scaffold/tool-roster.ts +214 -0
  566. package/agent/schedules/directory-sync.ts +37 -0
  567. package/agent/schedules/dispatch.ts +798 -0
  568. package/agent/schedules/dream-mode3.ts +311 -0
  569. package/agent/schedules/routine-dispatch.ts +213 -0
  570. package/agent/schedules/tidy.ts +321 -0
  571. package/agent/scm/app.ts +150 -0
  572. package/agent/scm/broker-audit.ts +107 -0
  573. package/agent/scm/broker.ts +130 -0
  574. package/agent/scm/capability-fit.ts +164 -0
  575. package/agent/scm/config-repo-token.ts +44 -0
  576. package/agent/scm/config.ts +37 -0
  577. package/agent/scm/contents.ts +162 -0
  578. package/agent/scm/git.ts +383 -0
  579. package/agent/scm/github-acting-identity.ts +127 -0
  580. package/agent/scm/github-search.ts +144 -0
  581. package/agent/scm/github-work.ts +44 -0
  582. package/agent/scm/installations.ts +155 -0
  583. package/agent/scm/issue-actions.ts +234 -0
  584. package/agent/scm/mint.ts +299 -0
  585. package/agent/scm/pr-activity.ts +130 -0
  586. package/agent/scm/pr-diff.ts +143 -0
  587. package/agent/scm/pr-feedback.ts +335 -0
  588. package/agent/scm/pr-status.ts +299 -0
  589. package/agent/scm/pr-watch.ts +162 -0
  590. package/agent/scm/pr.ts +114 -0
  591. package/agent/scm/provider.ts +46 -0
  592. package/agent/scm/refs.ts +142 -0
  593. package/agent/scm/repo-skills.ts +212 -0
  594. package/agent/scm/types.ts +50 -0
  595. package/agent/scm/write-token.ts +41 -0
  596. package/agent/settings/settings.ts +1525 -0
  597. package/agent/skills/domain-skills.ts +206 -0
  598. package/agent/skills/scoped.ts +172 -0
  599. package/agent/spend/bypass.ts +133 -0
  600. package/agent/spend/caps.ts +361 -0
  601. package/agent/spend/check.ts +164 -0
  602. package/agent/spend/checkpoint.ts +673 -0
  603. package/agent/spend/dm-mask.ts +134 -0
  604. package/agent/spend/ingress-gate.ts +349 -0
  605. package/agent/spend/pricing.ts +584 -0
  606. package/agent/spend/reporting.ts +900 -0
  607. package/agent/spend/sandbox-pricing.ts +53 -0
  608. package/agent/spend/spend.ts +480 -0
  609. package/agent/spend/stack-pricing.ts +205 -0
  610. package/agent/spend/store.ts +263 -0
  611. package/agent/spend/subagent-runs.ts +166 -0
  612. package/agent/spend/usage-events.ts +144 -0
  613. package/agent/stall/bash-hang-guard.ts +326 -0
  614. package/agent/stall/guard.ts +285 -0
  615. package/agent/status/status.ts +128 -0
  616. package/agent/subagents/contracts.ts +147 -0
  617. package/agent/subagents/declared.ts +201 -0
  618. package/agent/testing/driver-allowlist.ts +239 -0
  619. package/agent/tools/add_label.ts +68 -0
  620. package/agent/tools/add_routine_rule.ts +215 -0
  621. package/agent/tools/agent_version.ts +46 -0
  622. package/agent/tools/assign.ts +182 -0
  623. package/agent/tools/aws.ts +175 -0
  624. package/agent/tools/browser_tools.ts +22 -0
  625. package/agent/tools/cancel_routine.ts +133 -0
  626. package/agent/tools/capture_events.ts +54 -0
  627. package/agent/tools/check_pr_status.ts +72 -0
  628. package/agent/tools/checkout_repo.ts +172 -0
  629. package/agent/tools/clear_connector_override.ts +159 -0
  630. package/agent/tools/clear_spend_limit.ts +199 -0
  631. package/agent/tools/complete_job.ts +64 -0
  632. package/agent/tools/complete_thread.ts +134 -0
  633. package/agent/tools/confirm_link.ts +503 -0
  634. package/agent/tools/connector.ts +230 -0
  635. package/agent/tools/create_agent.ts +305 -0
  636. package/agent/tools/create_routine.ts +487 -0
  637. package/agent/tools/create_skill.ts +178 -0
  638. package/agent/tools/create_ticket.ts +187 -0
  639. package/agent/tools/declare_webhook.ts +362 -0
  640. package/agent/tools/delete_skill.ts +135 -0
  641. package/agent/tools/describe_image.ts +302 -0
  642. package/agent/tools/dm_person.ts +203 -0
  643. package/agent/tools/edit_reply.ts +195 -0
  644. package/agent/tools/edit_routine.ts +159 -0
  645. package/agent/tools/enable_routine.ts +162 -0
  646. package/agent/tools/explain_permission.ts +59 -0
  647. package/agent/tools/get_pr_feedback.ts +84 -0
  648. package/agent/tools/grant_tools.ts +443 -0
  649. package/agent/tools/halt.ts +172 -0
  650. package/agent/tools/link_identity.ts +308 -0
  651. package/agent/tools/list_recent_events.ts +58 -0
  652. package/agent/tools/list_repos.ts +24 -0
  653. package/agent/tools/list_routines.ts +152 -0
  654. package/agent/tools/list_skills.ts +38 -0
  655. package/agent/tools/list_webhooks.ts +72 -0
  656. package/agent/tools/memory_admin_list.ts +79 -0
  657. package/agent/tools/memory_admin_read.ts +95 -0
  658. package/agent/tools/message_thread_seat.ts +145 -0
  659. package/agent/tools/no_reply.ts +272 -0
  660. package/agent/tools/open_pull_request.ts +348 -0
  661. package/agent/tools/permission_fit_report.ts +190 -0
  662. package/agent/tools/post_file.ts +416 -0
  663. package/agent/tools/post_message.ts +169 -0
  664. package/agent/tools/post_pr_walkthrough.ts +220 -0
  665. package/agent/tools/purge_memory.ts +361 -0
  666. package/agent/tools/query_analytics.ts +83 -0
  667. package/agent/tools/react.ts +201 -0
  668. package/agent/tools/read_channel.ts +121 -0
  669. package/agent/tools/read_docs.ts +50 -0
  670. package/agent/tools/read_file_upload.ts +190 -0
  671. package/agent/tools/read_routine_transcript.ts +88 -0
  672. package/agent/tools/read_thread.ts +103 -0
  673. package/agent/tools/read_thread_seat.ts +91 -0
  674. package/agent/tools/read_webhook_history.ts +46 -0
  675. package/agent/tools/read_work_channel.ts +109 -0
  676. package/agent/tools/read_work_thread.ts +90 -0
  677. package/agent/tools/record_follow_up.ts +84 -0
  678. package/agent/tools/record_job_state.ts +49 -0
  679. package/agent/tools/record_watch_state.ts +47 -0
  680. package/agent/tools/remove_routine_rule.ts +158 -0
  681. package/agent/tools/reply.ts +757 -0
  682. package/agent/tools/report_run_failed.ts +79 -0
  683. package/agent/tools/request_access.ts +518 -0
  684. package/agent/tools/request_credential_grant.ts +550 -0
  685. package/agent/tools/resume.ts +148 -0
  686. package/agent/tools/revoke_connector.ts +155 -0
  687. package/agent/tools/revoke_credential_grant.ts +108 -0
  688. package/agent/tools/revoke_routine_permissions.ts +81 -0
  689. package/agent/tools/rotate_webhook.ts +185 -0
  690. package/agent/tools/run_routine_now.ts +120 -0
  691. package/agent/tools/sandbox_tools.ts +94 -0
  692. package/agent/tools/search.ts +121 -0
  693. package/agent/tools/session_cost.ts +135 -0
  694. package/agent/tools/set_dm_delivery.ts +115 -0
  695. package/agent/tools/set_spend_limit.ts +529 -0
  696. package/agent/tools/set_state.ts +179 -0
  697. package/agent/tools/spawn_thread_session.ts +223 -0
  698. package/agent/tools/spend_report.ts +440 -0
  699. package/agent/tools/stand_down.ts +260 -0
  700. package/agent/tools/subscribe_pr.ts +253 -0
  701. package/agent/tools/unlink_identity.ts +100 -0
  702. package/agent/tools/update_status.ts +65 -0
  703. package/agent/tools/usage_report.ts +103 -0
  704. package/agent/tools/walk_pr.ts +150 -0
  705. package/agent/webhooks/achievability.ts +235 -0
  706. package/agent/webhooks/capture-window.ts +220 -0
  707. package/agent/webhooks/config.ts +556 -0
  708. package/agent/webhooks/dispatch.ts +418 -0
  709. package/agent/webhooks/gate.ts +392 -0
  710. package/agent/webhooks/handshake-capture.ts +189 -0
  711. package/agent/webhooks/hooks-codemod.ts +266 -0
  712. package/agent/webhooks/oe-standard-webhook.ts +563 -0
  713. package/agent/webhooks/reject-audit.ts +134 -0
  714. package/agent/webhooks/replay-dedupe.ts +183 -0
  715. package/agent/webhooks/reveal-page.ts +507 -0
  716. package/agent/webhooks/secrets.ts +81 -0
  717. package/agent/webhooks/source-vocabulary.ts +333 -0
  718. package/agent/webhooks/verifier.ts +324 -0
  719. package/bin/oe-eve-patch.js +205 -0
  720. package/bin/oe.js +19 -0
  721. package/dist/agent/access/access-referenced-link-sets.d.ts +8 -0
  722. package/dist/agent/access/access-referenced-link-sets.d.ts.map +1 -0
  723. package/dist/agent/access/access-referenced-link-sets.js +20 -0
  724. package/dist/agent/access/access-referenced-link-sets.js.map +1 -0
  725. package/dist/agent/access/admin-read-venue.d.ts +48 -0
  726. package/dist/agent/access/admin-read-venue.d.ts.map +1 -0
  727. package/dist/agent/access/admin-read-venue.js +109 -0
  728. package/dist/agent/access/admin-read-venue.js.map +1 -0
  729. package/dist/agent/access/admin-standing.d.ts +16 -0
  730. package/dist/agent/access/admin-standing.d.ts.map +1 -0
  731. package/dist/agent/access/admin-standing.js +89 -0
  732. package/dist/agent/access/admin-standing.js.map +1 -0
  733. package/dist/agent/access/analytics-scope.d.ts +24 -0
  734. package/dist/agent/access/analytics-scope.d.ts.map +1 -0
  735. package/dist/agent/access/analytics-scope.js +62 -0
  736. package/dist/agent/access/analytics-scope.js.map +1 -0
  737. package/dist/agent/access/approval-dedupe.d.ts +29 -0
  738. package/dist/agent/access/approval-dedupe.d.ts.map +1 -0
  739. package/dist/agent/access/approval-dedupe.js +99 -0
  740. package/dist/agent/access/approval-dedupe.js.map +1 -0
  741. package/dist/agent/access/approval-judge.d.ts +186 -0
  742. package/dist/agent/access/approval-judge.d.ts.map +1 -0
  743. package/dist/agent/access/approval-judge.js +482 -0
  744. package/dist/agent/access/approval-judge.js.map +1 -0
  745. package/dist/agent/access/approval-preview.d.ts +27 -0
  746. package/dist/agent/access/approval-preview.d.ts.map +1 -0
  747. package/dist/agent/access/approval-preview.js +90 -0
  748. package/dist/agent/access/approval-preview.js.map +1 -0
  749. package/dist/agent/access/approval-scenarios.d.ts +18 -0
  750. package/dist/agent/access/approval-scenarios.d.ts.map +1 -0
  751. package/dist/agent/access/approval-scenarios.js +27 -0
  752. package/dist/agent/access/approval-scenarios.js.map +1 -0
  753. package/dist/agent/access/approver-chain.d.ts +210 -0
  754. package/dist/agent/access/approver-chain.d.ts.map +1 -0
  755. package/dist/agent/access/approver-chain.js +585 -0
  756. package/dist/agent/access/approver-chain.js.map +1 -0
  757. package/dist/agent/access/audience-floor.d.ts +69 -0
  758. package/dist/agent/access/audience-floor.d.ts.map +1 -0
  759. package/dist/agent/access/audience-floor.js +189 -0
  760. package/dist/agent/access/audience-floor.js.map +1 -0
  761. package/dist/agent/access/aws-output.d.ts +39 -0
  762. package/dist/agent/access/aws-output.d.ts.map +1 -0
  763. package/dist/agent/access/aws-output.js +94 -0
  764. package/dist/agent/access/aws-output.js.map +1 -0
  765. package/dist/agent/access/aws-screen.d.ts +24 -0
  766. package/dist/agent/access/aws-screen.d.ts.map +1 -0
  767. package/dist/agent/access/aws-screen.js +177 -0
  768. package/dist/agent/access/aws-screen.js.map +1 -0
  769. package/dist/agent/access/background-tasks.d.ts +100 -0
  770. package/dist/agent/access/background-tasks.d.ts.map +1 -0
  771. package/dist/agent/access/background-tasks.js +288 -0
  772. package/dist/agent/access/background-tasks.js.map +1 -0
  773. package/dist/agent/access/browser-hosts.d.ts +37 -0
  774. package/dist/agent/access/browser-hosts.d.ts.map +1 -0
  775. package/dist/agent/access/browser-hosts.js +127 -0
  776. package/dist/agent/access/browser-hosts.js.map +1 -0
  777. package/dist/agent/access/browser-toolkit.d.ts +48 -0
  778. package/dist/agent/access/browser-toolkit.d.ts.map +1 -0
  779. package/dist/agent/access/browser-toolkit.js +240 -0
  780. package/dist/agent/access/browser-toolkit.js.map +1 -0
  781. package/dist/agent/access/bundle.d.ts +239 -0
  782. package/dist/agent/access/bundle.d.ts.map +1 -0
  783. package/dist/agent/access/bundle.js +454 -0
  784. package/dist/agent/access/bundle.js.map +1 -0
  785. package/dist/agent/access/capabilities.d.ts +5 -0
  786. package/dist/agent/access/capabilities.d.ts.map +1 -0
  787. package/dist/agent/access/capabilities.js +9 -0
  788. package/dist/agent/access/capabilities.js.map +1 -0
  789. package/dist/agent/access/chat-dm-grant.d.ts +47 -0
  790. package/dist/agent/access/chat-dm-grant.d.ts.map +1 -0
  791. package/dist/agent/access/chat-dm-grant.js +185 -0
  792. package/dist/agent/access/chat-dm-grant.js.map +1 -0
  793. package/dist/agent/access/chat-write-grant.d.ts +35 -0
  794. package/dist/agent/access/chat-write-grant.d.ts.map +1 -0
  795. package/dist/agent/access/chat-write-grant.js +153 -0
  796. package/dist/agent/access/chat-write-grant.js.map +1 -0
  797. package/dist/agent/access/config.d.ts +117 -0
  798. package/dist/agent/access/config.d.ts.map +1 -0
  799. package/dist/agent/access/config.js +16 -0
  800. package/dist/agent/access/config.js.map +1 -0
  801. package/dist/agent/access/connector-content-origin-state.d.ts +17 -0
  802. package/dist/agent/access/connector-content-origin-state.d.ts.map +1 -0
  803. package/dist/agent/access/connector-content-origin-state.js +73 -0
  804. package/dist/agent/access/connector-content-origin-state.js.map +1 -0
  805. package/dist/agent/access/connector-credentials.d.ts +186 -0
  806. package/dist/agent/access/connector-credentials.d.ts.map +1 -0
  807. package/dist/agent/access/connector-credentials.js +258 -0
  808. package/dist/agent/access/connector-credentials.js.map +1 -0
  809. package/dist/agent/access/connector-disclosure.d.ts +66 -0
  810. package/dist/agent/access/connector-disclosure.d.ts.map +1 -0
  811. package/dist/agent/access/connector-disclosure.js +194 -0
  812. package/dist/agent/access/connector-disclosure.js.map +1 -0
  813. package/dist/agent/access/connector-op-gating.d.ts +32 -0
  814. package/dist/agent/access/connector-op-gating.d.ts.map +1 -0
  815. package/dist/agent/access/connector-op-gating.js +178 -0
  816. package/dist/agent/access/connector-op-gating.js.map +1 -0
  817. package/dist/agent/access/connector-scope.d.ts +42 -0
  818. package/dist/agent/access/connector-scope.d.ts.map +1 -0
  819. package/dist/agent/access/connector-scope.js +258 -0
  820. package/dist/agent/access/connector-scope.js.map +1 -0
  821. package/dist/agent/access/consequence.d.ts +205 -0
  822. package/dist/agent/access/consequence.d.ts.map +1 -0
  823. package/dist/agent/access/consequence.js +816 -0
  824. package/dist/agent/access/consequence.js.map +1 -0
  825. package/dist/agent/access/credential-bindings-codemod.d.ts +63 -0
  826. package/dist/agent/access/credential-bindings-codemod.d.ts.map +1 -0
  827. package/dist/agent/access/credential-bindings-codemod.js +179 -0
  828. package/dist/agent/access/credential-bindings-codemod.js.map +1 -0
  829. package/dist/agent/access/credential-endpoints.d.ts +47 -0
  830. package/dist/agent/access/credential-endpoints.d.ts.map +1 -0
  831. package/dist/agent/access/credential-endpoints.js +211 -0
  832. package/dist/agent/access/credential-endpoints.js.map +1 -0
  833. package/dist/agent/access/credential-grant-ask.d.ts +22 -0
  834. package/dist/agent/access/credential-grant-ask.d.ts.map +1 -0
  835. package/dist/agent/access/credential-grant-ask.js +82 -0
  836. package/dist/agent/access/credential-grant-ask.js.map +1 -0
  837. package/dist/agent/access/credential-grant-broker.d.ts +85 -0
  838. package/dist/agent/access/credential-grant-broker.d.ts.map +1 -0
  839. package/dist/agent/access/credential-grant-broker.js +252 -0
  840. package/dist/agent/access/credential-grant-broker.js.map +1 -0
  841. package/dist/agent/access/credential-grant-card.d.ts +98 -0
  842. package/dist/agent/access/credential-grant-card.d.ts.map +1 -0
  843. package/dist/agent/access/credential-grant-card.js +447 -0
  844. package/dist/agent/access/credential-grant-card.js.map +1 -0
  845. package/dist/agent/access/credential-grant-click.d.ts +43 -0
  846. package/dist/agent/access/credential-grant-click.d.ts.map +1 -0
  847. package/dist/agent/access/credential-grant-click.js +190 -0
  848. package/dist/agent/access/credential-grant-click.js.map +1 -0
  849. package/dist/agent/access/credential-grant-copy.d.ts +135 -0
  850. package/dist/agent/access/credential-grant-copy.d.ts.map +1 -0
  851. package/dist/agent/access/credential-grant-copy.js +276 -0
  852. package/dist/agent/access/credential-grant-copy.js.map +1 -0
  853. package/dist/agent/access/credential-grant-flow.d.ts +174 -0
  854. package/dist/agent/access/credential-grant-flow.d.ts.map +1 -0
  855. package/dist/agent/access/credential-grant-flow.js +503 -0
  856. package/dist/agent/access/credential-grant-flow.js.map +1 -0
  857. package/dist/agent/access/credential-grant-key-shape.d.ts +37 -0
  858. package/dist/agent/access/credential-grant-key-shape.d.ts.map +1 -0
  859. package/dist/agent/access/credential-grant-key-shape.js +51 -0
  860. package/dist/agent/access/credential-grant-key-shape.js.map +1 -0
  861. package/dist/agent/access/credential-grant-notice.d.ts +29 -0
  862. package/dist/agent/access/credential-grant-notice.d.ts.map +1 -0
  863. package/dist/agent/access/credential-grant-notice.js +187 -0
  864. package/dist/agent/access/credential-grant-notice.js.map +1 -0
  865. package/dist/agent/access/credential-grant-owner.d.ts +10 -0
  866. package/dist/agent/access/credential-grant-owner.d.ts.map +1 -0
  867. package/dist/agent/access/credential-grant-owner.js +16 -0
  868. package/dist/agent/access/credential-grant-owner.js.map +1 -0
  869. package/dist/agent/access/credential-grant-reach.d.ts +46 -0
  870. package/dist/agent/access/credential-grant-reach.d.ts.map +1 -0
  871. package/dist/agent/access/credential-grant-reach.js +77 -0
  872. package/dist/agent/access/credential-grant-reach.js.map +1 -0
  873. package/dist/agent/access/credential-grant-resolution.d.ts +30 -0
  874. package/dist/agent/access/credential-grant-resolution.d.ts.map +1 -0
  875. package/dist/agent/access/credential-grant-resolution.js +107 -0
  876. package/dist/agent/access/credential-grant-resolution.js.map +1 -0
  877. package/dist/agent/access/credential-grant-revoke.d.ts +33 -0
  878. package/dist/agent/access/credential-grant-revoke.d.ts.map +1 -0
  879. package/dist/agent/access/credential-grant-revoke.js +62 -0
  880. package/dist/agent/access/credential-grant-revoke.js.map +1 -0
  881. package/dist/agent/access/credential-grant-scope.d.ts +206 -0
  882. package/dist/agent/access/credential-grant-scope.d.ts.map +1 -0
  883. package/dist/agent/access/credential-grant-scope.js +282 -0
  884. package/dist/agent/access/credential-grant-scope.js.map +1 -0
  885. package/dist/agent/access/credential-grant.d.ts +94 -0
  886. package/dist/agent/access/credential-grant.d.ts.map +1 -0
  887. package/dist/agent/access/credential-grant.js +198 -0
  888. package/dist/agent/access/credential-grant.js.map +1 -0
  889. package/dist/agent/access/credentials.d.ts +41 -0
  890. package/dist/agent/access/credentials.d.ts.map +1 -0
  891. package/dist/agent/access/credentials.js +112 -0
  892. package/dist/agent/access/credentials.js.map +1 -0
  893. package/dist/agent/access/dated-read.d.ts +3 -0
  894. package/dist/agent/access/dated-read.d.ts.map +1 -0
  895. package/dist/agent/access/dated-read.js +24 -0
  896. package/dist/agent/access/dated-read.js.map +1 -0
  897. package/dist/agent/access/delegation-flag.d.ts +5 -0
  898. package/dist/agent/access/delegation-flag.d.ts.map +1 -0
  899. package/dist/agent/access/delegation-flag.js +10 -0
  900. package/dist/agent/access/delegation-flag.js.map +1 -0
  901. package/dist/agent/access/delegation-mount.d.ts +6 -0
  902. package/dist/agent/access/delegation-mount.d.ts.map +1 -0
  903. package/dist/agent/access/delegation-mount.js +30 -0
  904. package/dist/agent/access/delegation-mount.js.map +1 -0
  905. package/dist/agent/access/delta.d.ts +103 -0
  906. package/dist/agent/access/delta.d.ts.map +1 -0
  907. package/dist/agent/access/delta.js +267 -0
  908. package/dist/agent/access/delta.js.map +1 -0
  909. package/dist/agent/access/dispatch-origin-signal.d.ts +19 -0
  910. package/dist/agent/access/dispatch-origin-signal.d.ts.map +1 -0
  911. package/dist/agent/access/dispatch-origin-signal.js +130 -0
  912. package/dist/agent/access/dispatch-origin-signal.js.map +1 -0
  913. package/dist/agent/access/domain-credentials.d.ts +32 -0
  914. package/dist/agent/access/domain-credentials.d.ts.map +1 -0
  915. package/dist/agent/access/domain-credentials.js +78 -0
  916. package/dist/agent/access/domain-credentials.js.map +1 -0
  917. package/dist/agent/access/egress-denial-log.d.ts +28 -0
  918. package/dist/agent/access/egress-denial-log.d.ts.map +1 -0
  919. package/dist/agent/access/egress-denial-log.js +96 -0
  920. package/dist/agent/access/egress-denial-log.js.map +1 -0
  921. package/dist/agent/access/egress-denial-poller.d.ts +56 -0
  922. package/dist/agent/access/egress-denial-poller.d.ts.map +1 -0
  923. package/dist/agent/access/egress-denial-poller.js +184 -0
  924. package/dist/agent/access/egress-denial-poller.js.map +1 -0
  925. package/dist/agent/access/egress-status.d.ts +61 -0
  926. package/dist/agent/access/egress-status.d.ts.map +1 -0
  927. package/dist/agent/access/egress-status.js +130 -0
  928. package/dist/agent/access/egress-status.js.map +1 -0
  929. package/dist/agent/access/egress.d.ts +86 -0
  930. package/dist/agent/access/egress.d.ts.map +1 -0
  931. package/dist/agent/access/egress.js +236 -0
  932. package/dist/agent/access/egress.js.map +1 -0
  933. package/dist/agent/access/enforcement.d.ts +8 -0
  934. package/dist/agent/access/enforcement.d.ts.map +1 -0
  935. package/dist/agent/access/enforcement.js +24 -0
  936. package/dist/agent/access/enforcement.js.map +1 -0
  937. package/dist/agent/access/eve-patch-probe-boot.d.ts +2 -0
  938. package/dist/agent/access/eve-patch-probe-boot.d.ts.map +1 -0
  939. package/dist/agent/access/eve-patch-probe-boot.js +91 -0
  940. package/dist/agent/access/eve-patch-probe-boot.js.map +1 -0
  941. package/dist/agent/access/eve-patch-probe.d.ts +57 -0
  942. package/dist/agent/access/eve-patch-probe.d.ts.map +1 -0
  943. package/dist/agent/access/eve-patch-probe.js +225 -0
  944. package/dist/agent/access/eve-patch-probe.js.map +1 -0
  945. package/dist/agent/access/external-policy.d.ts +95 -0
  946. package/dist/agent/access/external-policy.d.ts.map +1 -0
  947. package/dist/agent/access/external-policy.js +154 -0
  948. package/dist/agent/access/external-policy.js.map +1 -0
  949. package/dist/agent/access/extra-hosts.d.ts +10 -0
  950. package/dist/agent/access/extra-hosts.d.ts.map +1 -0
  951. package/dist/agent/access/extra-hosts.js +28 -0
  952. package/dist/agent/access/extra-hosts.js.map +1 -0
  953. package/dist/agent/access/grant-borrow-transport-registry.internal.d.ts +21 -0
  954. package/dist/agent/access/grant-borrow-transport-registry.internal.d.ts.map +1 -0
  955. package/dist/agent/access/grant-borrow-transport-registry.internal.js +63 -0
  956. package/dist/agent/access/grant-borrow-transport-registry.internal.js.map +1 -0
  957. package/dist/agent/access/grant-room-notice-registry.internal.d.ts +20 -0
  958. package/dist/agent/access/grant-room-notice-registry.internal.d.ts.map +1 -0
  959. package/dist/agent/access/grant-room-notice-registry.internal.js +59 -0
  960. package/dist/agent/access/grant-room-notice-registry.internal.js.map +1 -0
  961. package/dist/agent/access/grant-schema-pin.d.ts +15 -0
  962. package/dist/agent/access/grant-schema-pin.d.ts.map +1 -0
  963. package/dist/agent/access/grant-schema-pin.js +29 -0
  964. package/dist/agent/access/grant-schema-pin.js.map +1 -0
  965. package/dist/agent/access/grants-codemod.d.ts +32 -0
  966. package/dist/agent/access/grants-codemod.d.ts.map +1 -0
  967. package/dist/agent/access/grants-codemod.js +306 -0
  968. package/dist/agent/access/grants-codemod.js.map +1 -0
  969. package/dist/agent/access/group-request.d.ts +13 -0
  970. package/dist/agent/access/group-request.d.ts.map +1 -0
  971. package/dist/agent/access/group-request.js +67 -0
  972. package/dist/agent/access/group-request.js.map +1 -0
  973. package/dist/agent/access/halt-state.d.ts +7 -0
  974. package/dist/agent/access/halt-state.d.ts.map +1 -0
  975. package/dist/agent/access/halt-state.js +23 -0
  976. package/dist/agent/access/halt-state.js.map +1 -0
  977. package/dist/agent/access/halt.d.ts +90 -0
  978. package/dist/agent/access/halt.d.ts.map +1 -0
  979. package/dist/agent/access/halt.js +239 -0
  980. package/dist/agent/access/halt.js.map +1 -0
  981. package/dist/agent/access/host-egress.d.ts +71 -0
  982. package/dist/agent/access/host-egress.d.ts.map +1 -0
  983. package/dist/agent/access/host-egress.js +384 -0
  984. package/dist/agent/access/host-egress.js.map +1 -0
  985. package/dist/agent/access/human-only-invariants-manifest.d.ts +20 -0
  986. package/dist/agent/access/human-only-invariants-manifest.d.ts.map +1 -0
  987. package/dist/agent/access/human-only-invariants-manifest.js +144 -0
  988. package/dist/agent/access/human-only-invariants-manifest.js.map +1 -0
  989. package/dist/agent/access/ingestion-binding-manifest.d.ts +41 -0
  990. package/dist/agent/access/ingestion-binding-manifest.d.ts.map +1 -0
  991. package/dist/agent/access/ingestion-binding-manifest.js +214 -0
  992. package/dist/agent/access/ingestion-binding-manifest.js.map +1 -0
  993. package/dist/agent/access/ingestion-route-inventory.generated.d.ts +13 -0
  994. package/dist/agent/access/ingestion-route-inventory.generated.d.ts.map +1 -0
  995. package/dist/agent/access/ingestion-route-inventory.generated.js +46 -0
  996. package/dist/agent/access/ingestion-route-inventory.generated.js.map +1 -0
  997. package/dist/agent/access/instructions.d.ts +5 -0
  998. package/dist/agent/access/instructions.d.ts.map +1 -0
  999. package/dist/agent/access/instructions.js +72 -0
  1000. package/dist/agent/access/instructions.js.map +1 -0
  1001. package/dist/agent/access/invoker-posture-state.d.ts +8 -0
  1002. package/dist/agent/access/invoker-posture-state.d.ts.map +1 -0
  1003. package/dist/agent/access/invoker-posture-state.js +23 -0
  1004. package/dist/agent/access/invoker-posture-state.js.map +1 -0
  1005. package/dist/agent/access/invoker-posture.d.ts +29 -0
  1006. package/dist/agent/access/invoker-posture.d.ts.map +1 -0
  1007. package/dist/agent/access/invoker-posture.js +70 -0
  1008. package/dist/agent/access/invoker-posture.js.map +1 -0
  1009. package/dist/agent/access/job-posture.d.ts +37 -0
  1010. package/dist/agent/access/job-posture.d.ts.map +1 -0
  1011. package/dist/agent/access/job-posture.js +65 -0
  1012. package/dist/agent/access/job-posture.js.map +1 -0
  1013. package/dist/agent/access/job-session-state.d.ts +13 -0
  1014. package/dist/agent/access/job-session-state.d.ts.map +1 -0
  1015. package/dist/agent/access/job-session-state.js +57 -0
  1016. package/dist/agent/access/job-session-state.js.map +1 -0
  1017. package/dist/agent/access/lean-seat-state.d.ts +12 -0
  1018. package/dist/agent/access/lean-seat-state.d.ts.map +1 -0
  1019. package/dist/agent/access/lean-seat-state.js +35 -0
  1020. package/dist/agent/access/lean-seat-state.js.map +1 -0
  1021. package/dist/agent/access/lean-seat.d.ts +25 -0
  1022. package/dist/agent/access/lean-seat.d.ts.map +1 -0
  1023. package/dist/agent/access/lean-seat.js +66 -0
  1024. package/dist/agent/access/lean-seat.js.map +1 -0
  1025. package/dist/agent/access/lint.d.ts +39 -0
  1026. package/dist/agent/access/lint.d.ts.map +1 -0
  1027. package/dist/agent/access/lint.js +556 -0
  1028. package/dist/agent/access/lint.js.map +1 -0
  1029. package/dist/agent/access/live-delegated-tasks.d.ts +20 -0
  1030. package/dist/agent/access/live-delegated-tasks.d.ts.map +1 -0
  1031. package/dist/agent/access/live-delegated-tasks.js +96 -0
  1032. package/dist/agent/access/live-delegated-tasks.js.map +1 -0
  1033. package/dist/agent/access/loop-breaker.d.ts +26 -0
  1034. package/dist/agent/access/loop-breaker.d.ts.map +1 -0
  1035. package/dist/agent/access/loop-breaker.js +77 -0
  1036. package/dist/agent/access/loop-breaker.js.map +1 -0
  1037. package/dist/agent/access/mcp-call-fence.d.ts +19 -0
  1038. package/dist/agent/access/mcp-call-fence.d.ts.map +1 -0
  1039. package/dist/agent/access/mcp-call-fence.js +180 -0
  1040. package/dist/agent/access/mcp-call-fence.js.map +1 -0
  1041. package/dist/agent/access/member-grant.d.ts +16 -0
  1042. package/dist/agent/access/member-grant.d.ts.map +1 -0
  1043. package/dist/agent/access/member-grant.js +34 -0
  1044. package/dist/agent/access/member-grant.js.map +1 -0
  1045. package/dist/agent/access/member-plane.d.ts +91 -0
  1046. package/dist/agent/access/member-plane.d.ts.map +1 -0
  1047. package/dist/agent/access/member-plane.js +114 -0
  1048. package/dist/agent/access/member-plane.js.map +1 -0
  1049. package/dist/agent/access/native-admin.d.ts +13 -0
  1050. package/dist/agent/access/native-admin.d.ts.map +1 -0
  1051. package/dist/agent/access/native-admin.js +23 -0
  1052. package/dist/agent/access/native-admin.js.map +1 -0
  1053. package/dist/agent/access/native-delegation-state.d.ts +16 -0
  1054. package/dist/agent/access/native-delegation-state.d.ts.map +1 -0
  1055. package/dist/agent/access/native-delegation-state.js +26 -0
  1056. package/dist/agent/access/native-delegation-state.js.map +1 -0
  1057. package/dist/agent/access/network-access.d.ts +23 -0
  1058. package/dist/agent/access/network-access.d.ts.map +1 -0
  1059. package/dist/agent/access/network-access.js +108 -0
  1060. package/dist/agent/access/network-access.js.map +1 -0
  1061. package/dist/agent/access/nullable-optional-fields.d.ts +13 -0
  1062. package/dist/agent/access/nullable-optional-fields.d.ts.map +1 -0
  1063. package/dist/agent/access/nullable-optional-fields.js +190 -0
  1064. package/dist/agent/access/nullable-optional-fields.js.map +1 -0
  1065. package/dist/agent/access/overlay-module.d.ts +20 -0
  1066. package/dist/agent/access/overlay-module.d.ts.map +1 -0
  1067. package/dist/agent/access/overlay-module.js +47 -0
  1068. package/dist/agent/access/overlay-module.js.map +1 -0
  1069. package/dist/agent/access/own-account-gate-manifest.d.ts +23 -0
  1070. package/dist/agent/access/own-account-gate-manifest.d.ts.map +1 -0
  1071. package/dist/agent/access/own-account-gate-manifest.js +109 -0
  1072. package/dist/agent/access/own-account-gate-manifest.js.map +1 -0
  1073. package/dist/agent/access/pane-venue.d.ts +58 -0
  1074. package/dist/agent/access/pane-venue.d.ts.map +1 -0
  1075. package/dist/agent/access/pane-venue.js +177 -0
  1076. package/dist/agent/access/pane-venue.js.map +1 -0
  1077. package/dist/agent/access/pending-delegation-signal.d.ts +38 -0
  1078. package/dist/agent/access/pending-delegation-signal.d.ts.map +1 -0
  1079. package/dist/agent/access/pending-delegation-signal.js +268 -0
  1080. package/dist/agent/access/pending-delegation-signal.js.map +1 -0
  1081. package/dist/agent/access/permission-evidence.d.ts +184 -0
  1082. package/dist/agent/access/permission-evidence.d.ts.map +1 -0
  1083. package/dist/agent/access/permission-evidence.js +412 -0
  1084. package/dist/agent/access/permission-evidence.js.map +1 -0
  1085. package/dist/agent/access/permission-proposal.d.ts +33 -0
  1086. package/dist/agent/access/permission-proposal.d.ts.map +1 -0
  1087. package/dist/agent/access/permission-proposal.js +319 -0
  1088. package/dist/agent/access/permission-proposal.js.map +1 -0
  1089. package/dist/agent/access/platform.d.ts +5 -0
  1090. package/dist/agent/access/platform.d.ts.map +1 -0
  1091. package/dist/agent/access/platform.js +15 -0
  1092. package/dist/agent/access/platform.js.map +1 -0
  1093. package/dist/agent/access/pre-approval-rules.d.ts +44 -0
  1094. package/dist/agent/access/pre-approval-rules.d.ts.map +1 -0
  1095. package/dist/agent/access/pre-approval-rules.js +86 -0
  1096. package/dist/agent/access/pre-approval-rules.js.map +1 -0
  1097. package/dist/agent/access/principal-gate-manifest.d.ts +111 -0
  1098. package/dist/agent/access/principal-gate-manifest.d.ts.map +1 -0
  1099. package/dist/agent/access/principal-gate-manifest.js +718 -0
  1100. package/dist/agent/access/principal-gate-manifest.js.map +1 -0
  1101. package/dist/agent/access/provider-selection-check.d.ts +24 -0
  1102. package/dist/agent/access/provider-selection-check.d.ts.map +1 -0
  1103. package/dist/agent/access/provider-selection-check.js +97 -0
  1104. package/dist/agent/access/provider-selection-check.js.map +1 -0
  1105. package/dist/agent/access/provider-selection.d.ts +21 -0
  1106. package/dist/agent/access/provider-selection.d.ts.map +1 -0
  1107. package/dist/agent/access/provider-selection.js +76 -0
  1108. package/dist/agent/access/provider-selection.js.map +1 -0
  1109. package/dist/agent/access/read-grant.d.ts +13 -0
  1110. package/dist/agent/access/read-grant.d.ts.map +1 -0
  1111. package/dist/agent/access/read-grant.js +96 -0
  1112. package/dist/agent/access/read-grant.js.map +1 -0
  1113. package/dist/agent/access/repo-capabilities.d.ts +30 -0
  1114. package/dist/agent/access/repo-capabilities.d.ts.map +1 -0
  1115. package/dist/agent/access/repo-capabilities.js +60 -0
  1116. package/dist/agent/access/repo-capabilities.js.map +1 -0
  1117. package/dist/agent/access/request.d.ts +17 -0
  1118. package/dist/agent/access/request.d.ts.map +1 -0
  1119. package/dist/agent/access/request.js +110 -0
  1120. package/dist/agent/access/request.js.map +1 -0
  1121. package/dist/agent/access/requester-identity.d.ts +82 -0
  1122. package/dist/agent/access/requester-identity.d.ts.map +1 -0
  1123. package/dist/agent/access/requester-identity.js +275 -0
  1124. package/dist/agent/access/requester-identity.js.map +1 -0
  1125. package/dist/agent/access/requester-messages.d.ts +7 -0
  1126. package/dist/agent/access/requester-messages.d.ts.map +1 -0
  1127. package/dist/agent/access/requester-messages.js +45 -0
  1128. package/dist/agent/access/requester-messages.js.map +1 -0
  1129. package/dist/agent/access/reserved-hosts.d.ts +5 -0
  1130. package/dist/agent/access/reserved-hosts.d.ts.map +1 -0
  1131. package/dist/agent/access/reserved-hosts.js +9 -0
  1132. package/dist/agent/access/reserved-hosts.js.map +1 -0
  1133. package/dist/agent/access/resolver.d.ts +120 -0
  1134. package/dist/agent/access/resolver.d.ts.map +1 -0
  1135. package/dist/agent/access/resolver.js +447 -0
  1136. package/dist/agent/access/resolver.js.map +1 -0
  1137. package/dist/agent/access/resource-capabilities.d.ts +37 -0
  1138. package/dist/agent/access/resource-capabilities.d.ts.map +1 -0
  1139. package/dist/agent/access/resource-capabilities.js +77 -0
  1140. package/dist/agent/access/resource-capabilities.js.map +1 -0
  1141. package/dist/agent/access/resource-grant-manifest.d.ts +21 -0
  1142. package/dist/agent/access/resource-grant-manifest.d.ts.map +1 -0
  1143. package/dist/agent/access/resource-grant-manifest.js +93 -0
  1144. package/dist/agent/access/resource-grant-manifest.js.map +1 -0
  1145. package/dist/agent/access/resource-grant.d.ts +33 -0
  1146. package/dist/agent/access/resource-grant.d.ts.map +1 -0
  1147. package/dist/agent/access/resource-grant.js +131 -0
  1148. package/dist/agent/access/resource-grant.js.map +1 -0
  1149. package/dist/agent/access/result-cap.d.ts +11 -0
  1150. package/dist/agent/access/result-cap.d.ts.map +1 -0
  1151. package/dist/agent/access/result-cap.js +31 -0
  1152. package/dist/agent/access/result-cap.js.map +1 -0
  1153. package/dist/agent/access/result-reduce-model-arm.d.ts +25 -0
  1154. package/dist/agent/access/result-reduce-model-arm.d.ts.map +1 -0
  1155. package/dist/agent/access/result-reduce-model-arm.js +73 -0
  1156. package/dist/agent/access/result-reduce-model-arm.js.map +1 -0
  1157. package/dist/agent/access/result-reduce.d.ts +13 -0
  1158. package/dist/agent/access/result-reduce.d.ts.map +1 -0
  1159. package/dist/agent/access/result-reduce.js +86 -0
  1160. package/dist/agent/access/result-reduce.js.map +1 -0
  1161. package/dist/agent/access/roles.d.ts +26 -0
  1162. package/dist/agent/access/roles.d.ts.map +1 -0
  1163. package/dist/agent/access/roles.js +78 -0
  1164. package/dist/agent/access/roles.js.map +1 -0
  1165. package/dist/agent/access/scope-key.d.ts +43 -0
  1166. package/dist/agent/access/scope-key.d.ts.map +1 -0
  1167. package/dist/agent/access/scope-key.js +36 -0
  1168. package/dist/agent/access/scope-key.js.map +1 -0
  1169. package/dist/agent/access/seat-read-budget.d.ts +17 -0
  1170. package/dist/agent/access/seat-read-budget.d.ts.map +1 -0
  1171. package/dist/agent/access/seat-read-budget.js +53 -0
  1172. package/dist/agent/access/seat-read-budget.js.map +1 -0
  1173. package/dist/agent/access/self-host-egress.d.ts +37 -0
  1174. package/dist/agent/access/self-host-egress.d.ts.map +1 -0
  1175. package/dist/agent/access/self-host-egress.js +63 -0
  1176. package/dist/agent/access/self-host-egress.js.map +1 -0
  1177. package/dist/agent/access/settlement-dispatch-signal.d.ts +22 -0
  1178. package/dist/agent/access/settlement-dispatch-signal.d.ts.map +1 -0
  1179. package/dist/agent/access/settlement-dispatch-signal.js +76 -0
  1180. package/dist/agent/access/settlement-dispatch-signal.js.map +1 -0
  1181. package/dist/agent/access/skill-taint-envelope.d.ts +31 -0
  1182. package/dist/agent/access/skill-taint-envelope.d.ts.map +1 -0
  1183. package/dist/agent/access/skill-taint-envelope.js +80 -0
  1184. package/dist/agent/access/skill-taint-envelope.js.map +1 -0
  1185. package/dist/agent/access/source-gate-manifest.d.ts +14 -0
  1186. package/dist/agent/access/source-gate-manifest.d.ts.map +1 -0
  1187. package/dist/agent/access/source-gate-manifest.js +111 -0
  1188. package/dist/agent/access/source-gate-manifest.js.map +1 -0
  1189. package/dist/agent/access/source-scoped-mount.d.ts +7 -0
  1190. package/dist/agent/access/source-scoped-mount.d.ts.map +1 -0
  1191. package/dist/agent/access/source-scoped-mount.js +26 -0
  1192. package/dist/agent/access/source-scoped-mount.js.map +1 -0
  1193. package/dist/agent/access/subagent-taint.d.ts +44 -0
  1194. package/dist/agent/access/subagent-taint.d.ts.map +1 -0
  1195. package/dist/agent/access/subagent-taint.js +175 -0
  1196. package/dist/agent/access/subagent-taint.js.map +1 -0
  1197. package/dist/agent/access/surface-work-grant.d.ts +20 -0
  1198. package/dist/agent/access/surface-work-grant.d.ts.map +1 -0
  1199. package/dist/agent/access/surface-work-grant.js +84 -0
  1200. package/dist/agent/access/surface-work-grant.js.map +1 -0
  1201. package/dist/agent/access/taint-enforcement.d.ts +46 -0
  1202. package/dist/agent/access/taint-enforcement.d.ts.map +1 -0
  1203. package/dist/agent/access/taint-enforcement.js +141 -0
  1204. package/dist/agent/access/taint-enforcement.js.map +1 -0
  1205. package/dist/agent/access/taint-signal.d.ts +100 -0
  1206. package/dist/agent/access/taint-signal.d.ts.map +1 -0
  1207. package/dist/agent/access/taint-signal.js +236 -0
  1208. package/dist/agent/access/taint-signal.js.map +1 -0
  1209. package/dist/agent/access/taint-tiers.d.ts +64 -0
  1210. package/dist/agent/access/taint-tiers.d.ts.map +1 -0
  1211. package/dist/agent/access/taint-tiers.js +93 -0
  1212. package/dist/agent/access/taint-tiers.js.map +1 -0
  1213. package/dist/agent/access/task-wake-signal.d.ts +9 -0
  1214. package/dist/agent/access/task-wake-signal.d.ts.map +1 -0
  1215. package/dist/agent/access/task-wake-signal.js +86 -0
  1216. package/dist/agent/access/task-wake-signal.js.map +1 -0
  1217. package/dist/agent/access/tenant-admission.d.ts +52 -0
  1218. package/dist/agent/access/tenant-admission.d.ts.map +1 -0
  1219. package/dist/agent/access/tenant-admission.js +154 -0
  1220. package/dist/agent/access/tenant-admission.js.map +1 -0
  1221. package/dist/agent/access/untrusted-projection.d.ts +23 -0
  1222. package/dist/agent/access/untrusted-projection.d.ts.map +1 -0
  1223. package/dist/agent/access/untrusted-projection.js +258 -0
  1224. package/dist/agent/access/untrusted-projection.js.map +1 -0
  1225. package/dist/agent/access/untrusted.d.ts +34 -0
  1226. package/dist/agent/access/untrusted.d.ts.map +1 -0
  1227. package/dist/agent/access/untrusted.js +100 -0
  1228. package/dist/agent/access/untrusted.js.map +1 -0
  1229. package/dist/agent/access/wake-mapping.d.ts +22 -0
  1230. package/dist/agent/access/wake-mapping.d.ts.map +1 -0
  1231. package/dist/agent/access/wake-mapping.js +19 -0
  1232. package/dist/agent/access/wake-mapping.js.map +1 -0
  1233. package/dist/agent/access/web-fetch-fence.d.ts +8 -0
  1234. package/dist/agent/access/web-fetch-fence.d.ts.map +1 -0
  1235. package/dist/agent/access/web-fetch-fence.js +55 -0
  1236. package/dist/agent/access/web-fetch-fence.js.map +1 -0
  1237. package/dist/agent/access/window-gate-manifest.d.ts +75 -0
  1238. package/dist/agent/access/window-gate-manifest.d.ts.map +1 -0
  1239. package/dist/agent/access/window-gate-manifest.js +474 -0
  1240. package/dist/agent/access/window-gate-manifest.js.map +1 -0
  1241. package/dist/agent/access/window-gated.d.ts +111 -0
  1242. package/dist/agent/access/window-gated.d.ts.map +1 -0
  1243. package/dist/agent/access/window-gated.js +611 -0
  1244. package/dist/agent/access/window-gated.js.map +1 -0
  1245. package/dist/agent/access/window-routing.d.ts +16 -0
  1246. package/dist/agent/access/window-routing.d.ts.map +1 -0
  1247. package/dist/agent/access/window-routing.js +11 -0
  1248. package/dist/agent/access/window-routing.js.map +1 -0
  1249. package/dist/agent/access/work-grant.d.ts +39 -0
  1250. package/dist/agent/access/work-grant.d.ts.map +1 -0
  1251. package/dist/agent/access/work-grant.js +76 -0
  1252. package/dist/agent/access/work-grant.js.map +1 -0
  1253. package/dist/agent/access/work-mount-manifest.d.ts +21 -0
  1254. package/dist/agent/access/work-mount-manifest.d.ts.map +1 -0
  1255. package/dist/agent/access/work-mount-manifest.js +149 -0
  1256. package/dist/agent/access/work-mount-manifest.js.map +1 -0
  1257. package/dist/agent/access/worker-capabilities.d.ts +60 -0
  1258. package/dist/agent/access/worker-capabilities.d.ts.map +1 -0
  1259. package/dist/agent/access/worker-capabilities.js +318 -0
  1260. package/dist/agent/access/worker-capabilities.js.map +1 -0
  1261. package/dist/agent/access/worker-capability-index.generated.d.ts +7 -0
  1262. package/dist/agent/access/worker-capability-index.generated.d.ts.map +1 -0
  1263. package/dist/agent/access/worker-capability-index.generated.js +188 -0
  1264. package/dist/agent/access/worker-capability-index.generated.js.map +1 -0
  1265. package/dist/agent/access/worker-continuation.d.ts +7 -0
  1266. package/dist/agent/access/worker-continuation.d.ts.map +1 -0
  1267. package/dist/agent/access/worker-continuation.js +180 -0
  1268. package/dist/agent/access/worker-continuation.js.map +1 -0
  1269. package/dist/agent/access/worker-seat-state.d.ts +8 -0
  1270. package/dist/agent/access/worker-seat-state.d.ts.map +1 -0
  1271. package/dist/agent/access/worker-seat-state.js +24 -0
  1272. package/dist/agent/access/worker-seat-state.js.map +1 -0
  1273. package/dist/agent/access/worker-seat.d.ts +23 -0
  1274. package/dist/agent/access/worker-seat.d.ts.map +1 -0
  1275. package/dist/agent/access/worker-seat.js +47 -0
  1276. package/dist/agent/access/worker-seat.js.map +1 -0
  1277. package/dist/agent/access/worker-toolset-state.d.ts +32 -0
  1278. package/dist/agent/access/worker-toolset-state.d.ts.map +1 -0
  1279. package/dist/agent/access/worker-toolset-state.js +40 -0
  1280. package/dist/agent/access/worker-toolset-state.js.map +1 -0
  1281. package/dist/agent/adapter-api.d.ts +416 -0
  1282. package/dist/agent/adapter-api.d.ts.map +1 -0
  1283. package/dist/agent/adapter-api.js +1147 -0
  1284. package/dist/agent/adapter-api.js.map +1 -0
  1285. package/dist/agent/analytics/compile.d.ts +127 -0
  1286. package/dist/agent/analytics/compile.d.ts.map +1 -0
  1287. package/dist/agent/analytics/compile.js +406 -0
  1288. package/dist/agent/analytics/compile.js.map +1 -0
  1289. package/dist/agent/analytics/execute.d.ts +20 -0
  1290. package/dist/agent/analytics/execute.d.ts.map +1 -0
  1291. package/dist/agent/analytics/execute.js +146 -0
  1292. package/dist/agent/analytics/execute.js.map +1 -0
  1293. package/dist/agent/analytics/registry.d.ts +89 -0
  1294. package/dist/agent/analytics/registry.d.ts.map +1 -0
  1295. package/dist/agent/analytics/registry.js +216 -0
  1296. package/dist/agent/analytics/registry.js.map +1 -0
  1297. package/dist/agent/approvals/access-request.d.ts +53 -0
  1298. package/dist/agent/approvals/access-request.d.ts.map +1 -0
  1299. package/dist/agent/approvals/access-request.js +186 -0
  1300. package/dist/agent/approvals/access-request.js.map +1 -0
  1301. package/dist/agent/approvals/actions.d.ts +95 -0
  1302. package/dist/agent/approvals/actions.d.ts.map +1 -0
  1303. package/dist/agent/approvals/actions.js +293 -0
  1304. package/dist/agent/approvals/actions.js.map +1 -0
  1305. package/dist/agent/approvals/agent-create.d.ts +44 -0
  1306. package/dist/agent/approvals/agent-create.d.ts.map +1 -0
  1307. package/dist/agent/approvals/agent-create.js +205 -0
  1308. package/dist/agent/approvals/agent-create.js.map +1 -0
  1309. package/dist/agent/approvals/arming-context.d.ts +13 -0
  1310. package/dist/agent/approvals/arming-context.d.ts.map +1 -0
  1311. package/dist/agent/approvals/arming-context.js +17 -0
  1312. package/dist/agent/approvals/arming-context.js.map +1 -0
  1313. package/dist/agent/approvals/card-disclosure.d.ts +28 -0
  1314. package/dist/agent/approvals/card-disclosure.d.ts.map +1 -0
  1315. package/dist/agent/approvals/card-disclosure.js +31 -0
  1316. package/dist/agent/approvals/card-disclosure.js.map +1 -0
  1317. package/dist/agent/approvals/card-signal.d.ts +41 -0
  1318. package/dist/agent/approvals/card-signal.d.ts.map +1 -0
  1319. package/dist/agent/approvals/card-signal.js +115 -0
  1320. package/dist/agent/approvals/card-signal.js.map +1 -0
  1321. package/dist/agent/approvals/card-venue.d.ts +55 -0
  1322. package/dist/agent/approvals/card-venue.d.ts.map +1 -0
  1323. package/dist/agent/approvals/card-venue.js +106 -0
  1324. package/dist/agent/approvals/card-venue.js.map +1 -0
  1325. package/dist/agent/approvals/card.d.ts +23 -0
  1326. package/dist/agent/approvals/card.d.ts.map +1 -0
  1327. package/dist/agent/approvals/card.js +99 -0
  1328. package/dist/agent/approvals/card.js.map +1 -0
  1329. package/dist/agent/approvals/chat-dm.d.ts +19 -0
  1330. package/dist/agent/approvals/chat-dm.d.ts.map +1 -0
  1331. package/dist/agent/approvals/chat-dm.js +41 -0
  1332. package/dist/agent/approvals/chat-dm.js.map +1 -0
  1333. package/dist/agent/approvals/chat-post.d.ts +15 -0
  1334. package/dist/agent/approvals/chat-post.d.ts.map +1 -0
  1335. package/dist/agent/approvals/chat-post.js +43 -0
  1336. package/dist/agent/approvals/chat-post.js.map +1 -0
  1337. package/dist/agent/approvals/clicker-floor.d.ts +48 -0
  1338. package/dist/agent/approvals/clicker-floor.d.ts.map +1 -0
  1339. package/dist/agent/approvals/clicker-floor.js +58 -0
  1340. package/dist/agent/approvals/clicker-floor.js.map +1 -0
  1341. package/dist/agent/approvals/decision-authority.internal.d.ts +19 -0
  1342. package/dist/agent/approvals/decision-authority.internal.d.ts.map +1 -0
  1343. package/dist/agent/approvals/decision-authority.internal.js +107 -0
  1344. package/dist/agent/approvals/decision-authority.internal.js.map +1 -0
  1345. package/dist/agent/approvals/decision-wake.d.ts +28 -0
  1346. package/dist/agent/approvals/decision-wake.d.ts.map +1 -0
  1347. package/dist/agent/approvals/decision-wake.js +84 -0
  1348. package/dist/agent/approvals/decision-wake.js.map +1 -0
  1349. package/dist/agent/approvals/domain-exposure.d.ts +27 -0
  1350. package/dist/agent/approvals/domain-exposure.d.ts.map +1 -0
  1351. package/dist/agent/approvals/domain-exposure.js +145 -0
  1352. package/dist/agent/approvals/domain-exposure.js.map +1 -0
  1353. package/dist/agent/approvals/eve-response-policy.d.ts +22 -0
  1354. package/dist/agent/approvals/eve-response-policy.d.ts.map +1 -0
  1355. package/dist/agent/approvals/eve-response-policy.js +27 -0
  1356. package/dist/agent/approvals/eve-response-policy.js.map +1 -0
  1357. package/dist/agent/approvals/flow.d.ts +398 -0
  1358. package/dist/agent/approvals/flow.d.ts.map +1 -0
  1359. package/dist/agent/approvals/flow.js +1722 -0
  1360. package/dist/agent/approvals/flow.js.map +1 -0
  1361. package/dist/agent/approvals/input-response-floor.d.ts +47 -0
  1362. package/dist/agent/approvals/input-response-floor.d.ts.map +1 -0
  1363. package/dist/agent/approvals/input-response-floor.js +56 -0
  1364. package/dist/agent/approvals/input-response-floor.js.map +1 -0
  1365. package/dist/agent/approvals/judge-contradiction.d.ts +56 -0
  1366. package/dist/agent/approvals/judge-contradiction.d.ts.map +1 -0
  1367. package/dist/agent/approvals/judge-contradiction.js +90 -0
  1368. package/dist/agent/approvals/judge-contradiction.js.map +1 -0
  1369. package/dist/agent/approvals/memory-purge.d.ts +2 -0
  1370. package/dist/agent/approvals/memory-purge.d.ts.map +1 -0
  1371. package/dist/agent/approvals/memory-purge.js +128 -0
  1372. package/dist/agent/approvals/memory-purge.js.map +1 -0
  1373. package/dist/agent/approvals/pr-open.d.ts +36 -0
  1374. package/dist/agent/approvals/pr-open.d.ts.map +1 -0
  1375. package/dist/agent/approvals/pr-open.js +134 -0
  1376. package/dist/agent/approvals/pr-open.js.map +1 -0
  1377. package/dist/agent/approvals/review-surface.d.ts +3 -0
  1378. package/dist/agent/approvals/review-surface.d.ts.map +1 -0
  1379. package/dist/agent/approvals/review-surface.js +7 -0
  1380. package/dist/agent/approvals/review-surface.js.map +1 -0
  1381. package/dist/agent/approvals/routine-cancel.d.ts +2 -0
  1382. package/dist/agent/approvals/routine-cancel.d.ts.map +1 -0
  1383. package/dist/agent/approvals/routine-cancel.js +39 -0
  1384. package/dist/agent/approvals/routine-cancel.js.map +1 -0
  1385. package/dist/agent/approvals/routine-create.d.ts +38 -0
  1386. package/dist/agent/approvals/routine-create.d.ts.map +1 -0
  1387. package/dist/agent/approvals/routine-create.js +171 -0
  1388. package/dist/agent/approvals/routine-create.js.map +1 -0
  1389. package/dist/agent/approvals/routine-lifecycle.d.ts +2 -0
  1390. package/dist/agent/approvals/routine-lifecycle.d.ts.map +1 -0
  1391. package/dist/agent/approvals/routine-lifecycle.js +135 -0
  1392. package/dist/agent/approvals/routine-lifecycle.js.map +1 -0
  1393. package/dist/agent/approvals/routine-permission-offer.d.ts +35 -0
  1394. package/dist/agent/approvals/routine-permission-offer.d.ts.map +1 -0
  1395. package/dist/agent/approvals/routine-permission-offer.js +90 -0
  1396. package/dist/agent/approvals/routine-permission-offer.js.map +1 -0
  1397. package/dist/agent/approvals/routine-permission.d.ts +51 -0
  1398. package/dist/agent/approvals/routine-permission.d.ts.map +1 -0
  1399. package/dist/agent/approvals/routine-permission.js +173 -0
  1400. package/dist/agent/approvals/routine-permission.js.map +1 -0
  1401. package/dist/agent/approvals/routine-policy.d.ts +2 -0
  1402. package/dist/agent/approvals/routine-policy.d.ts.map +1 -0
  1403. package/dist/agent/approvals/routine-policy.js +133 -0
  1404. package/dist/agent/approvals/routine-policy.js.map +1 -0
  1405. package/dist/agent/approvals/scope-label.d.ts +11 -0
  1406. package/dist/agent/approvals/scope-label.d.ts.map +1 -0
  1407. package/dist/agent/approvals/scope-label.js +43 -0
  1408. package/dist/agent/approvals/scope-label.js.map +1 -0
  1409. package/dist/agent/approvals/session-checkpoint.d.ts +11 -0
  1410. package/dist/agent/approvals/session-checkpoint.d.ts.map +1 -0
  1411. package/dist/agent/approvals/session-checkpoint.js +60 -0
  1412. package/dist/agent/approvals/session-checkpoint.js.map +1 -0
  1413. package/dist/agent/approvals/session-grant.d.ts +46 -0
  1414. package/dist/agent/approvals/session-grant.d.ts.map +1 -0
  1415. package/dist/agent/approvals/session-grant.js +153 -0
  1416. package/dist/agent/approvals/session-grant.js.map +1 -0
  1417. package/dist/agent/approvals/skill-create.d.ts +2 -0
  1418. package/dist/agent/approvals/skill-create.d.ts.map +1 -0
  1419. package/dist/agent/approvals/skill-create.js +42 -0
  1420. package/dist/agent/approvals/skill-create.js.map +1 -0
  1421. package/dist/agent/approvals/skill-delete.d.ts +2 -0
  1422. package/dist/agent/approvals/skill-delete.d.ts.map +1 -0
  1423. package/dist/agent/approvals/skill-delete.js +38 -0
  1424. package/dist/agent/approvals/skill-delete.js.map +1 -0
  1425. package/dist/agent/approvals/taint-disclosure.d.ts +10 -0
  1426. package/dist/agent/approvals/taint-disclosure.d.ts.map +1 -0
  1427. package/dist/agent/approvals/taint-disclosure.js +36 -0
  1428. package/dist/agent/approvals/taint-disclosure.js.map +1 -0
  1429. package/dist/agent/approvals/ticket-actions.d.ts +27 -0
  1430. package/dist/agent/approvals/ticket-actions.d.ts.map +1 -0
  1431. package/dist/agent/approvals/ticket-actions.js +47 -0
  1432. package/dist/agent/approvals/ticket-actions.js.map +1 -0
  1433. package/dist/agent/approvals/ticket-create.d.ts +19 -0
  1434. package/dist/agent/approvals/ticket-create.d.ts.map +1 -0
  1435. package/dist/agent/approvals/ticket-create.js +46 -0
  1436. package/dist/agent/approvals/ticket-create.js.map +1 -0
  1437. package/dist/agent/approvals/types.d.ts +42 -0
  1438. package/dist/agent/approvals/types.d.ts.map +1 -0
  1439. package/dist/agent/approvals/types.js +3 -0
  1440. package/dist/agent/approvals/types.js.map +1 -0
  1441. package/dist/agent/approvals/webhook-declare.d.ts +55 -0
  1442. package/dist/agent/approvals/webhook-declare.d.ts.map +1 -0
  1443. package/dist/agent/approvals/webhook-declare.js +239 -0
  1444. package/dist/agent/approvals/webhook-declare.js.map +1 -0
  1445. package/dist/agent/approvals/webhook.d.ts +25 -0
  1446. package/dist/agent/approvals/webhook.d.ts.map +1 -0
  1447. package/dist/agent/approvals/webhook.js +156 -0
  1448. package/dist/agent/approvals/webhook.js.map +1 -0
  1449. package/dist/agent/audit/action-registry.d.ts +78 -0
  1450. package/dist/agent/audit/action-registry.d.ts.map +1 -0
  1451. package/dist/agent/audit/action-registry.js +996 -0
  1452. package/dist/agent/audit/action-registry.js.map +1 -0
  1453. package/dist/agent/audit/audit.d.ts +32 -0
  1454. package/dist/agent/audit/audit.d.ts.map +1 -0
  1455. package/dist/agent/audit/audit.js +100 -0
  1456. package/dist/agent/audit/audit.js.map +1 -0
  1457. package/dist/agent/audit/chain.d.ts +196 -0
  1458. package/dist/agent/audit/chain.d.ts.map +1 -0
  1459. package/dist/agent/audit/chain.js +462 -0
  1460. package/dist/agent/audit/chain.js.map +1 -0
  1461. package/dist/agent/audit/tool-action.d.ts +26 -0
  1462. package/dist/agent/audit/tool-action.d.ts.map +1 -0
  1463. package/dist/agent/audit/tool-action.js +271 -0
  1464. package/dist/agent/audit/tool-action.js.map +1 -0
  1465. package/dist/agent/audit/window-tool-gate.d.ts +21 -0
  1466. package/dist/agent/audit/window-tool-gate.d.ts.map +1 -0
  1467. package/dist/agent/audit/window-tool-gate.js +40 -0
  1468. package/dist/agent/audit/window-tool-gate.js.map +1 -0
  1469. package/dist/agent/audit/worker-toolset.d.ts +25 -0
  1470. package/dist/agent/audit/worker-toolset.d.ts.map +1 -0
  1471. package/dist/agent/audit/worker-toolset.js +108 -0
  1472. package/dist/agent/audit/worker-toolset.js.map +1 -0
  1473. package/dist/agent/blob/hosting.d.ts +61 -0
  1474. package/dist/agent/blob/hosting.d.ts.map +1 -0
  1475. package/dist/agent/blob/hosting.js +142 -0
  1476. package/dist/agent/blob/hosting.js.map +1 -0
  1477. package/dist/agent/channels/access-request-ledger.d.ts +36 -0
  1478. package/dist/agent/channels/access-request-ledger.d.ts.map +1 -0
  1479. package/dist/agent/channels/access-request-ledger.js +123 -0
  1480. package/dist/agent/channels/access-request-ledger.js.map +1 -0
  1481. package/dist/agent/channels/ambient-skip.d.ts +19 -0
  1482. package/dist/agent/channels/ambient-skip.d.ts.map +1 -0
  1483. package/dist/agent/channels/ambient-skip.js +88 -0
  1484. package/dist/agent/channels/ambient-skip.js.map +1 -0
  1485. package/dist/agent/channels/answered-container-ledger.d.ts +32 -0
  1486. package/dist/agent/channels/answered-container-ledger.d.ts.map +1 -0
  1487. package/dist/agent/channels/answered-container-ledger.js +70 -0
  1488. package/dist/agent/channels/answered-container-ledger.js.map +1 -0
  1489. package/dist/agent/channels/approval-card.d.ts +266 -0
  1490. package/dist/agent/channels/approval-card.d.ts.map +1 -0
  1491. package/dist/agent/channels/approval-card.js +328 -0
  1492. package/dist/agent/channels/approval-card.js.map +1 -0
  1493. package/dist/agent/channels/approval-claim-guard.d.ts +112 -0
  1494. package/dist/agent/channels/approval-claim-guard.d.ts.map +1 -0
  1495. package/dist/agent/channels/approval-claim-guard.js +324 -0
  1496. package/dist/agent/channels/approval-claim-guard.js.map +1 -0
  1497. package/dist/agent/channels/attachments.d.ts +113 -0
  1498. package/dist/agent/channels/attachments.d.ts.map +1 -0
  1499. package/dist/agent/channels/attachments.js +157 -0
  1500. package/dist/agent/channels/attachments.js.map +1 -0
  1501. package/dist/agent/channels/aws-sso-callback.d.ts +3 -0
  1502. package/dist/agent/channels/aws-sso-callback.d.ts.map +1 -0
  1503. package/dist/agent/channels/aws-sso-callback.js +8 -0
  1504. package/dist/agent/channels/aws-sso-callback.js.map +1 -0
  1505. package/dist/agent/channels/backscroll-window.d.ts +76 -0
  1506. package/dist/agent/channels/backscroll-window.d.ts.map +1 -0
  1507. package/dist/agent/channels/backscroll-window.js +106 -0
  1508. package/dist/agent/channels/backscroll-window.js.map +1 -0
  1509. package/dist/agent/channels/cancel-note.d.ts +45 -0
  1510. package/dist/agent/channels/cancel-note.d.ts.map +1 -0
  1511. package/dist/agent/channels/cancel-note.js +99 -0
  1512. package/dist/agent/channels/cancel-note.js.map +1 -0
  1513. package/dist/agent/channels/channel-key.d.ts +19 -0
  1514. package/dist/agent/channels/channel-key.d.ts.map +1 -0
  1515. package/dist/agent/channels/channel-key.js +53 -0
  1516. package/dist/agent/channels/channel-key.js.map +1 -0
  1517. package/dist/agent/channels/channel-read.d.ts +203 -0
  1518. package/dist/agent/channels/channel-read.d.ts.map +1 -0
  1519. package/dist/agent/channels/channel-read.js +294 -0
  1520. package/dist/agent/channels/channel-read.js.map +1 -0
  1521. package/dist/agent/channels/chat-turn-audit.d.ts +9 -0
  1522. package/dist/agent/channels/chat-turn-audit.d.ts.map +1 -0
  1523. package/dist/agent/channels/chat-turn-audit.js +18 -0
  1524. package/dist/agent/channels/chat-turn-audit.js.map +1 -0
  1525. package/dist/agent/channels/closing-prose-drop.d.ts +34 -0
  1526. package/dist/agent/channels/closing-prose-drop.d.ts.map +1 -0
  1527. package/dist/agent/channels/closing-prose-drop.js +29 -0
  1528. package/dist/agent/channels/closing-prose-drop.js.map +1 -0
  1529. package/dist/agent/channels/command-registration.d.ts +62 -0
  1530. package/dist/agent/channels/command-registration.d.ts.map +1 -0
  1531. package/dist/agent/channels/command-registration.js +128 -0
  1532. package/dist/agent/channels/command-registration.js.map +1 -0
  1533. package/dist/agent/channels/context-render.d.ts +111 -0
  1534. package/dist/agent/channels/context-render.d.ts.map +1 -0
  1535. package/dist/agent/channels/context-render.js +148 -0
  1536. package/dist/agent/channels/context-render.js.map +1 -0
  1537. package/dist/agent/channels/control-mcp.d.ts +3 -0
  1538. package/dist/agent/channels/control-mcp.d.ts.map +1 -0
  1539. package/dist/agent/channels/control-mcp.js +35 -0
  1540. package/dist/agent/channels/control-mcp.js.map +1 -0
  1541. package/dist/agent/channels/control-read.d.ts +3 -0
  1542. package/dist/agent/channels/control-read.d.ts.map +1 -0
  1543. package/dist/agent/channels/control-read.js +21 -0
  1544. package/dist/agent/channels/control-read.js.map +1 -0
  1545. package/dist/agent/channels/credential-intake-page.d.ts +3 -0
  1546. package/dist/agent/channels/credential-intake-page.d.ts.map +1 -0
  1547. package/dist/agent/channels/credential-intake-page.js +11 -0
  1548. package/dist/agent/channels/credential-intake-page.js.map +1 -0
  1549. package/dist/agent/channels/delegated-provenance.d.ts +129 -0
  1550. package/dist/agent/channels/delegated-provenance.d.ts.map +1 -0
  1551. package/dist/agent/channels/delegated-provenance.js +418 -0
  1552. package/dist/agent/channels/delegated-provenance.js.map +1 -0
  1553. package/dist/agent/channels/dm-audience.d.ts +157 -0
  1554. package/dist/agent/channels/dm-audience.d.ts.map +1 -0
  1555. package/dist/agent/channels/dm-audience.js +234 -0
  1556. package/dist/agent/channels/dm-audience.js.map +1 -0
  1557. package/dist/agent/channels/dm-seat.d.ts +68 -0
  1558. package/dist/agent/channels/dm-seat.d.ts.map +1 -0
  1559. package/dist/agent/channels/dm-seat.js +87 -0
  1560. package/dist/agent/channels/dm-seat.js.map +1 -0
  1561. package/dist/agent/channels/domain-fingerprint.d.ts +40 -0
  1562. package/dist/agent/channels/domain-fingerprint.d.ts.map +1 -0
  1563. package/dist/agent/channels/domain-fingerprint.js +94 -0
  1564. package/dist/agent/channels/domain-fingerprint.js.map +1 -0
  1565. package/dist/agent/channels/egress-spoof.d.ts +11 -0
  1566. package/dist/agent/channels/egress-spoof.d.ts.map +1 -0
  1567. package/dist/agent/channels/egress-spoof.js +36 -0
  1568. package/dist/agent/channels/egress-spoof.js.map +1 -0
  1569. package/dist/agent/channels/engaged-wake.d.ts +86 -0
  1570. package/dist/agent/channels/engaged-wake.d.ts.map +1 -0
  1571. package/dist/agent/channels/engaged-wake.js +146 -0
  1572. package/dist/agent/channels/engaged-wake.js.map +1 -0
  1573. package/dist/agent/channels/engagement.d.ts +132 -0
  1574. package/dist/agent/channels/engagement.d.ts.map +1 -0
  1575. package/dist/agent/channels/engagement.js +182 -0
  1576. package/dist/agent/channels/engagement.js.map +1 -0
  1577. package/dist/agent/channels/entity-actions.d.ts +80 -0
  1578. package/dist/agent/channels/entity-actions.d.ts.map +1 -0
  1579. package/dist/agent/channels/entity-actions.js +94 -0
  1580. package/dist/agent/channels/entity-actions.js.map +1 -0
  1581. package/dist/agent/channels/front-queue.d.ts +31 -0
  1582. package/dist/agent/channels/front-queue.d.ts.map +1 -0
  1583. package/dist/agent/channels/front-queue.js +86 -0
  1584. package/dist/agent/channels/front-queue.js.map +1 -0
  1585. package/dist/agent/channels/generation-retirement.d.ts +189 -0
  1586. package/dist/agent/channels/generation-retirement.d.ts.map +1 -0
  1587. package/dist/agent/channels/generation-retirement.js +473 -0
  1588. package/dist/agent/channels/generation-retirement.js.map +1 -0
  1589. package/dist/agent/channels/halt-per-wake.d.ts +53 -0
  1590. package/dist/agent/channels/halt-per-wake.d.ts.map +1 -0
  1591. package/dist/agent/channels/halt-per-wake.js +148 -0
  1592. package/dist/agent/channels/halt-per-wake.js.map +1 -0
  1593. package/dist/agent/channels/memory-claim-guard.d.ts +77 -0
  1594. package/dist/agent/channels/memory-claim-guard.d.ts.map +1 -0
  1595. package/dist/agent/channels/memory-claim-guard.js +389 -0
  1596. package/dist/agent/channels/memory-claim-guard.js.map +1 -0
  1597. package/dist/agent/channels/name-drop-wake-audit.d.ts +93 -0
  1598. package/dist/agent/channels/name-drop-wake-audit.d.ts.map +1 -0
  1599. package/dist/agent/channels/name-drop-wake-audit.js +92 -0
  1600. package/dist/agent/channels/name-drop-wake-audit.js.map +1 -0
  1601. package/dist/agent/channels/native-wake-retry.d.ts +16 -0
  1602. package/dist/agent/channels/native-wake-retry.d.ts.map +1 -0
  1603. package/dist/agent/channels/native-wake-retry.js +44 -0
  1604. package/dist/agent/channels/native-wake-retry.js.map +1 -0
  1605. package/dist/agent/channels/no-reply-signal.d.ts +12 -0
  1606. package/dist/agent/channels/no-reply-signal.d.ts.map +1 -0
  1607. package/dist/agent/channels/no-reply-signal.js +37 -0
  1608. package/dist/agent/channels/no-reply-signal.js.map +1 -0
  1609. package/dist/agent/channels/normalized-wake.d.ts +129 -0
  1610. package/dist/agent/channels/normalized-wake.d.ts.map +1 -0
  1611. package/dist/agent/channels/normalized-wake.js +153 -0
  1612. package/dist/agent/channels/normalized-wake.js.map +1 -0
  1613. package/dist/agent/channels/oe-oauth-callback.d.ts +3 -0
  1614. package/dist/agent/channels/oe-oauth-callback.d.ts.map +1 -0
  1615. package/dist/agent/channels/oe-oauth-callback.js +8 -0
  1616. package/dist/agent/channels/oe-oauth-callback.js.map +1 -0
  1617. package/dist/agent/channels/own-post-ledger.d.ts +35 -0
  1618. package/dist/agent/channels/own-post-ledger.d.ts.map +1 -0
  1619. package/dist/agent/channels/own-post-ledger.js +57 -0
  1620. package/dist/agent/channels/own-post-ledger.js.map +1 -0
  1621. package/dist/agent/channels/platform-failure.d.ts +20 -0
  1622. package/dist/agent/channels/platform-failure.d.ts.map +1 -0
  1623. package/dist/agent/channels/platform-failure.js +42 -0
  1624. package/dist/agent/channels/platform-failure.js.map +1 -0
  1625. package/dist/agent/channels/policy-pages.d.ts +3 -0
  1626. package/dist/agent/channels/policy-pages.d.ts.map +1 -0
  1627. package/dist/agent/channels/policy-pages.js +14 -0
  1628. package/dist/agent/channels/policy-pages.js.map +1 -0
  1629. package/dist/agent/channels/post-arms.d.ts +202 -0
  1630. package/dist/agent/channels/post-arms.d.ts.map +1 -0
  1631. package/dist/agent/channels/post-arms.js +146 -0
  1632. package/dist/agent/channels/post-arms.js.map +1 -0
  1633. package/dist/agent/channels/proactive-dm-manifest.d.ts +28 -0
  1634. package/dist/agent/channels/proactive-dm-manifest.d.ts.map +1 -0
  1635. package/dist/agent/channels/proactive-dm-manifest.js +80 -0
  1636. package/dist/agent/channels/proactive-dm-manifest.js.map +1 -0
  1637. package/dist/agent/channels/propose-scope.d.ts +18 -0
  1638. package/dist/agent/channels/propose-scope.d.ts.map +1 -0
  1639. package/dist/agent/channels/propose-scope.js +91 -0
  1640. package/dist/agent/channels/propose-scope.js.map +1 -0
  1641. package/dist/agent/channels/question-bridge.d.ts +291 -0
  1642. package/dist/agent/channels/question-bridge.d.ts.map +1 -0
  1643. package/dist/agent/channels/question-bridge.js +412 -0
  1644. package/dist/agent/channels/question-bridge.js.map +1 -0
  1645. package/dist/agent/channels/rate-limit-retry.d.ts +157 -0
  1646. package/dist/agent/channels/rate-limit-retry.d.ts.map +1 -0
  1647. package/dist/agent/channels/rate-limit-retry.js +256 -0
  1648. package/dist/agent/channels/rate-limit-retry.js.map +1 -0
  1649. package/dist/agent/channels/react-signal.d.ts +5 -0
  1650. package/dist/agent/channels/react-signal.d.ts.map +1 -0
  1651. package/dist/agent/channels/react-signal.js +25 -0
  1652. package/dist/agent/channels/react-signal.js.map +1 -0
  1653. package/dist/agent/channels/reaction-ingest.d.ts +87 -0
  1654. package/dist/agent/channels/reaction-ingest.d.ts.map +1 -0
  1655. package/dist/agent/channels/reaction-ingest.js +138 -0
  1656. package/dist/agent/channels/reaction-ingest.js.map +1 -0
  1657. package/dist/agent/channels/read-author-trust.d.ts +26 -0
  1658. package/dist/agent/channels/read-author-trust.d.ts.map +1 -0
  1659. package/dist/agent/channels/read-author-trust.js +56 -0
  1660. package/dist/agent/channels/read-author-trust.js.map +1 -0
  1661. package/dist/agent/channels/read-reach.d.ts +156 -0
  1662. package/dist/agent/channels/read-reach.d.ts.map +1 -0
  1663. package/dist/agent/channels/read-reach.js +293 -0
  1664. package/dist/agent/channels/read-reach.js.map +1 -0
  1665. package/dist/agent/channels/read-scope-audit.d.ts +39 -0
  1666. package/dist/agent/channels/read-scope-audit.d.ts.map +1 -0
  1667. package/dist/agent/channels/read-scope-audit.js +88 -0
  1668. package/dist/agent/channels/read-scope-audit.js.map +1 -0
  1669. package/dist/agent/channels/read-scope-error.d.ts +4 -0
  1670. package/dist/agent/channels/read-scope-error.d.ts.map +1 -0
  1671. package/dist/agent/channels/read-scope-error.js +6 -0
  1672. package/dist/agent/channels/read-scope-error.js.map +1 -0
  1673. package/dist/agent/channels/read-spool.d.ts +38 -0
  1674. package/dist/agent/channels/read-spool.d.ts.map +1 -0
  1675. package/dist/agent/channels/read-spool.js +97 -0
  1676. package/dist/agent/channels/read-spool.js.map +1 -0
  1677. package/dist/agent/channels/reply-edit.d.ts +47 -0
  1678. package/dist/agent/channels/reply-edit.d.ts.map +1 -0
  1679. package/dist/agent/channels/reply-edit.js +173 -0
  1680. package/dist/agent/channels/reply-edit.js.map +1 -0
  1681. package/dist/agent/channels/reply-fold.d.ts +186 -0
  1682. package/dist/agent/channels/reply-fold.d.ts.map +1 -0
  1683. package/dist/agent/channels/reply-fold.js +427 -0
  1684. package/dist/agent/channels/reply-fold.js.map +1 -0
  1685. package/dist/agent/channels/reply-freshness.d.ts +69 -0
  1686. package/dist/agent/channels/reply-freshness.d.ts.map +1 -0
  1687. package/dist/agent/channels/reply-freshness.js +208 -0
  1688. package/dist/agent/channels/reply-freshness.js.map +1 -0
  1689. package/dist/agent/channels/reply-post.d.ts +176 -0
  1690. package/dist/agent/channels/reply-post.d.ts.map +1 -0
  1691. package/dist/agent/channels/reply-post.js +407 -0
  1692. package/dist/agent/channels/reply-post.js.map +1 -0
  1693. package/dist/agent/channels/reply-provenance.d.ts +172 -0
  1694. package/dist/agent/channels/reply-provenance.d.ts.map +1 -0
  1695. package/dist/agent/channels/reply-provenance.js +662 -0
  1696. package/dist/agent/channels/reply-provenance.js.map +1 -0
  1697. package/dist/agent/channels/reply-signal.d.ts +141 -0
  1698. package/dist/agent/channels/reply-signal.d.ts.map +1 -0
  1699. package/dist/agent/channels/reply-signal.js +554 -0
  1700. package/dist/agent/channels/reply-signal.js.map +1 -0
  1701. package/dist/agent/channels/request-claim-guard.d.ts +91 -0
  1702. package/dist/agent/channels/request-claim-guard.d.ts.map +1 -0
  1703. package/dist/agent/channels/request-claim-guard.js +457 -0
  1704. package/dist/agent/channels/request-claim-guard.js.map +1 -0
  1705. package/dist/agent/channels/runtime-code-fingerprint.generated.d.ts +2 -0
  1706. package/dist/agent/channels/runtime-code-fingerprint.generated.d.ts.map +1 -0
  1707. package/dist/agent/channels/runtime-code-fingerprint.generated.js +9 -0
  1708. package/dist/agent/channels/runtime-code-fingerprint.generated.js.map +1 -0
  1709. package/dist/agent/channels/runtime-rotation.d.ts +98 -0
  1710. package/dist/agent/channels/runtime-rotation.d.ts.map +1 -0
  1711. package/dist/agent/channels/runtime-rotation.js +178 -0
  1712. package/dist/agent/channels/runtime-rotation.js.map +1 -0
  1713. package/dist/agent/channels/seat-admission.d.ts +61 -0
  1714. package/dist/agent/channels/seat-admission.d.ts.map +1 -0
  1715. package/dist/agent/channels/seat-admission.js +64 -0
  1716. package/dist/agent/channels/seat-admission.js.map +1 -0
  1717. package/dist/agent/channels/seat-catch-up.d.ts +240 -0
  1718. package/dist/agent/channels/seat-catch-up.d.ts.map +1 -0
  1719. package/dist/agent/channels/seat-catch-up.js +353 -0
  1720. package/dist/agent/channels/seat-catch-up.js.map +1 -0
  1721. package/dist/agent/channels/self-dispatch.d.ts +89 -0
  1722. package/dist/agent/channels/self-dispatch.d.ts.map +1 -0
  1723. package/dist/agent/channels/self-dispatch.js +310 -0
  1724. package/dist/agent/channels/self-dispatch.js.map +1 -0
  1725. package/dist/agent/channels/session-park.d.ts +120 -0
  1726. package/dist/agent/channels/session-park.d.ts.map +1 -0
  1727. package/dist/agent/channels/session-park.js +170 -0
  1728. package/dist/agent/channels/session-park.js.map +1 -0
  1729. package/dist/agent/channels/session-resume.d.ts +26 -0
  1730. package/dist/agent/channels/session-resume.d.ts.map +1 -0
  1731. package/dist/agent/channels/session-resume.js +34 -0
  1732. package/dist/agent/channels/session-resume.js.map +1 -0
  1733. package/dist/agent/channels/session-tail-record.d.ts +65 -0
  1734. package/dist/agent/channels/session-tail-record.d.ts.map +1 -0
  1735. package/dist/agent/channels/session-tail-record.js +129 -0
  1736. package/dist/agent/channels/session-tail-record.js.map +1 -0
  1737. package/dist/agent/channels/session-tail.d.ts +90 -0
  1738. package/dist/agent/channels/session-tail.d.ts.map +1 -0
  1739. package/dist/agent/channels/session-tail.js +79 -0
  1740. package/dist/agent/channels/session-tail.js.map +1 -0
  1741. package/dist/agent/channels/slack-bridge.d.ts +56 -0
  1742. package/dist/agent/channels/slack-bridge.d.ts.map +1 -0
  1743. package/dist/agent/channels/slack-bridge.js +80 -0
  1744. package/dist/agent/channels/slack-bridge.js.map +1 -0
  1745. package/dist/agent/channels/stand-down-silence.d.ts +49 -0
  1746. package/dist/agent/channels/stand-down-silence.d.ts.map +1 -0
  1747. package/dist/agent/channels/stand-down-silence.js +101 -0
  1748. package/dist/agent/channels/stand-down-silence.js.map +1 -0
  1749. package/dist/agent/channels/standing-authority.d.ts +69 -0
  1750. package/dist/agent/channels/standing-authority.d.ts.map +1 -0
  1751. package/dist/agent/channels/standing-authority.js +205 -0
  1752. package/dist/agent/channels/standing-authority.js.map +1 -0
  1753. package/dist/agent/channels/stranded-seat.d.ts +73 -0
  1754. package/dist/agent/channels/stranded-seat.d.ts.map +1 -0
  1755. package/dist/agent/channels/stranded-seat.js +107 -0
  1756. package/dist/agent/channels/stranded-seat.js.map +1 -0
  1757. package/dist/agent/channels/supervisor-complete.d.ts +61 -0
  1758. package/dist/agent/channels/supervisor-complete.d.ts.map +1 -0
  1759. package/dist/agent/channels/supervisor-complete.js +86 -0
  1760. package/dist/agent/channels/supervisor-complete.js.map +1 -0
  1761. package/dist/agent/channels/surface-message-ops.d.ts +100 -0
  1762. package/dist/agent/channels/surface-message-ops.d.ts.map +1 -0
  1763. package/dist/agent/channels/surface-message-ops.js +156 -0
  1764. package/dist/agent/channels/surface-message-ops.js.map +1 -0
  1765. package/dist/agent/channels/task-wake.d.ts +116 -0
  1766. package/dist/agent/channels/task-wake.d.ts.map +1 -0
  1767. package/dist/agent/channels/task-wake.js +390 -0
  1768. package/dist/agent/channels/task-wake.js.map +1 -0
  1769. package/dist/agent/channels/teams-bridge.d.ts +55 -0
  1770. package/dist/agent/channels/teams-bridge.d.ts.map +1 -0
  1771. package/dist/agent/channels/teams-bridge.js +25 -0
  1772. package/dist/agent/channels/teams-bridge.js.map +1 -0
  1773. package/dist/agent/channels/test-wake.d.ts +3 -0
  1774. package/dist/agent/channels/test-wake.d.ts.map +1 -0
  1775. package/dist/agent/channels/test-wake.js +11 -0
  1776. package/dist/agent/channels/test-wake.js.map +1 -0
  1777. package/dist/agent/channels/thread-ownership.d.ts +38 -0
  1778. package/dist/agent/channels/thread-ownership.d.ts.map +1 -0
  1779. package/dist/agent/channels/thread-ownership.js +53 -0
  1780. package/dist/agent/channels/thread-ownership.js.map +1 -0
  1781. package/dist/agent/channels/thread-seat-state.d.ts +35 -0
  1782. package/dist/agent/channels/thread-seat-state.d.ts.map +1 -0
  1783. package/dist/agent/channels/thread-seat-state.js +64 -0
  1784. package/dist/agent/channels/thread-seat-state.js.map +1 -0
  1785. package/dist/agent/channels/ticket-create.d.ts +77 -0
  1786. package/dist/agent/channels/ticket-create.d.ts.map +1 -0
  1787. package/dist/agent/channels/ticket-create.js +83 -0
  1788. package/dist/agent/channels/ticket-create.js.map +1 -0
  1789. package/dist/agent/channels/transcript-relay.d.ts +3 -0
  1790. package/dist/agent/channels/transcript-relay.d.ts.map +1 -0
  1791. package/dist/agent/channels/transcript-relay.js +8 -0
  1792. package/dist/agent/channels/transcript-relay.js.map +1 -0
  1793. package/dist/agent/channels/turn-cancel.d.ts +188 -0
  1794. package/dist/agent/channels/turn-cancel.d.ts.map +1 -0
  1795. package/dist/agent/channels/turn-cancel.js +310 -0
  1796. package/dist/agent/channels/turn-cancel.js.map +1 -0
  1797. package/dist/agent/channels/turn-delivery.d.ts +213 -0
  1798. package/dist/agent/channels/turn-delivery.d.ts.map +1 -0
  1799. package/dist/agent/channels/turn-delivery.js +384 -0
  1800. package/dist/agent/channels/turn-delivery.js.map +1 -0
  1801. package/dist/agent/channels/turn-registry.d.ts +47 -0
  1802. package/dist/agent/channels/turn-registry.d.ts.map +1 -0
  1803. package/dist/agent/channels/turn-registry.js +93 -0
  1804. package/dist/agent/channels/turn-registry.js.map +1 -0
  1805. package/dist/agent/channels/turn-terminal-actions.d.ts +22 -0
  1806. package/dist/agent/channels/turn-terminal-actions.d.ts.map +1 -0
  1807. package/dist/agent/channels/turn-terminal-actions.js +128 -0
  1808. package/dist/agent/channels/turn-terminal-actions.js.map +1 -0
  1809. package/dist/agent/channels/unified-redrive.d.ts +74 -0
  1810. package/dist/agent/channels/unified-redrive.d.ts.map +1 -0
  1811. package/dist/agent/channels/unified-redrive.js +141 -0
  1812. package/dist/agent/channels/unified-redrive.js.map +1 -0
  1813. package/dist/agent/channels/unified-reply.d.ts +102 -0
  1814. package/dist/agent/channels/unified-reply.d.ts.map +1 -0
  1815. package/dist/agent/channels/unified-reply.js +247 -0
  1816. package/dist/agent/channels/unified-reply.js.map +1 -0
  1817. package/dist/agent/channels/unified-supervisor.d.ts +100 -0
  1818. package/dist/agent/channels/unified-supervisor.d.ts.map +1 -0
  1819. package/dist/agent/channels/unified-supervisor.js +143 -0
  1820. package/dist/agent/channels/unified-supervisor.js.map +1 -0
  1821. package/dist/agent/channels/unified-window.d.ts +550 -0
  1822. package/dist/agent/channels/unified-window.d.ts.map +1 -0
  1823. package/dist/agent/channels/unified-window.js +731 -0
  1824. package/dist/agent/channels/unified-window.js.map +1 -0
  1825. package/dist/agent/channels/unified.d.ts +251 -0
  1826. package/dist/agent/channels/unified.d.ts.map +1 -0
  1827. package/dist/agent/channels/unified.js +1333 -0
  1828. package/dist/agent/channels/unified.js.map +1 -0
  1829. package/dist/agent/channels/wake-accounting.d.ts +57 -0
  1830. package/dist/agent/channels/wake-accounting.d.ts.map +1 -0
  1831. package/dist/agent/channels/wake-accounting.js +87 -0
  1832. package/dist/agent/channels/wake-accounting.js.map +1 -0
  1833. package/dist/agent/channels/wake-arm.d.ts +80 -0
  1834. package/dist/agent/channels/wake-arm.d.ts.map +1 -0
  1835. package/dist/agent/channels/wake-arm.js +173 -0
  1836. package/dist/agent/channels/wake-arm.js.map +1 -0
  1837. package/dist/agent/channels/wake-container.d.ts +27 -0
  1838. package/dist/agent/channels/wake-container.d.ts.map +1 -0
  1839. package/dist/agent/channels/wake-container.js +33 -0
  1840. package/dist/agent/channels/wake-container.js.map +1 -0
  1841. package/dist/agent/channels/wake-envelope.d.ts +252 -0
  1842. package/dist/agent/channels/wake-envelope.d.ts.map +1 -0
  1843. package/dist/agent/channels/wake-envelope.js +364 -0
  1844. package/dist/agent/channels/wake-envelope.js.map +1 -0
  1845. package/dist/agent/channels/wake-origin-codec.d.ts +77 -0
  1846. package/dist/agent/channels/wake-origin-codec.d.ts.map +1 -0
  1847. package/dist/agent/channels/wake-origin-codec.js +21 -0
  1848. package/dist/agent/channels/wake-origin-codec.js.map +1 -0
  1849. package/dist/agent/channels/wake-origin-codecs.d.ts +2 -0
  1850. package/dist/agent/channels/wake-origin-codecs.d.ts.map +1 -0
  1851. package/dist/agent/channels/wake-origin-codecs.js +4 -0
  1852. package/dist/agent/channels/wake-origin-codecs.js.map +1 -0
  1853. package/dist/agent/channels/wake-timing.d.ts +230 -0
  1854. package/dist/agent/channels/wake-timing.d.ts.map +1 -0
  1855. package/dist/agent/channels/wake-timing.js +256 -0
  1856. package/dist/agent/channels/wake-timing.js.map +1 -0
  1857. package/dist/agent/channels/webhook-reveal-page.d.ts +3 -0
  1858. package/dist/agent/channels/webhook-reveal-page.d.ts.map +1 -0
  1859. package/dist/agent/channels/webhook-reveal-page.js +11 -0
  1860. package/dist/agent/channels/webhook-reveal-page.js.map +1 -0
  1861. package/dist/agent/channels/webhooks.d.ts +5 -0
  1862. package/dist/agent/channels/webhooks.d.ts.map +1 -0
  1863. package/dist/agent/channels/webhooks.js +197 -0
  1864. package/dist/agent/channels/webhooks.js.map +1 -0
  1865. package/dist/agent/channels/window-key.d.ts +187 -0
  1866. package/dist/agent/channels/window-key.d.ts.map +1 -0
  1867. package/dist/agent/channels/window-key.js +379 -0
  1868. package/dist/agent/channels/window-key.js.map +1 -0
  1869. package/dist/agent/channels/window-sources.d.ts +17 -0
  1870. package/dist/agent/channels/window-sources.d.ts.map +1 -0
  1871. package/dist/agent/channels/window-sources.js +86 -0
  1872. package/dist/agent/channels/window-sources.js.map +1 -0
  1873. package/dist/agent/channels/work-destinations.d.ts +8 -0
  1874. package/dist/agent/channels/work-destinations.d.ts.map +1 -0
  1875. package/dist/agent/channels/work-destinations.js +45 -0
  1876. package/dist/agent/channels/work-destinations.js.map +1 -0
  1877. package/dist/agent/channels/work-registry.d.ts +13 -0
  1878. package/dist/agent/channels/work-registry.d.ts.map +1 -0
  1879. package/dist/agent/channels/work-registry.js +23 -0
  1880. package/dist/agent/channels/work-registry.js.map +1 -0
  1881. package/dist/agent/channels/work-search.d.ts +52 -0
  1882. package/dist/agent/channels/work-search.d.ts.map +1 -0
  1883. package/dist/agent/channels/work-search.js +54 -0
  1884. package/dist/agent/channels/work-search.js.map +1 -0
  1885. package/dist/agent/commands/core.d.ts +184 -0
  1886. package/dist/agent/commands/core.d.ts.map +1 -0
  1887. package/dist/agent/commands/core.js +541 -0
  1888. package/dist/agent/commands/core.js.map +1 -0
  1889. package/dist/agent/commands/rate.d.ts +55 -0
  1890. package/dist/agent/commands/rate.d.ts.map +1 -0
  1891. package/dist/agent/commands/rate.js +146 -0
  1892. package/dist/agent/commands/rate.js.map +1 -0
  1893. package/dist/agent/connections/auth-retry-memo.d.ts +28 -0
  1894. package/dist/agent/connections/auth-retry-memo.d.ts.map +1 -0
  1895. package/dist/agent/connections/auth-retry-memo.js +109 -0
  1896. package/dist/agent/connections/auth-retry-memo.js.map +1 -0
  1897. package/dist/agent/connections/aws-exec.d.ts +27 -0
  1898. package/dist/agent/connections/aws-exec.d.ts.map +1 -0
  1899. package/dist/agent/connections/aws-exec.js +22 -0
  1900. package/dist/agent/connections/aws-exec.js.map +1 -0
  1901. package/dist/agent/connections/aws-identity.d.ts +138 -0
  1902. package/dist/agent/connections/aws-identity.d.ts.map +1 -0
  1903. package/dist/agent/connections/aws-identity.js +163 -0
  1904. package/dist/agent/connections/aws-identity.js.map +1 -0
  1905. package/dist/agent/connections/aws-sso-callback.d.ts +33 -0
  1906. package/dist/agent/connections/aws-sso-callback.d.ts.map +1 -0
  1907. package/dist/agent/connections/aws-sso-callback.js +68 -0
  1908. package/dist/agent/connections/aws-sso-callback.js.map +1 -0
  1909. package/dist/agent/connections/aws-sso-identity-binding.d.ts +30 -0
  1910. package/dist/agent/connections/aws-sso-identity-binding.d.ts.map +1 -0
  1911. package/dist/agent/connections/aws-sso-identity-binding.js +95 -0
  1912. package/dist/agent/connections/aws-sso-identity-binding.js.map +1 -0
  1913. package/dist/agent/connections/aws-sso-link.d.ts +18 -0
  1914. package/dist/agent/connections/aws-sso-link.d.ts.map +1 -0
  1915. package/dist/agent/connections/aws-sso-link.js +22 -0
  1916. package/dist/agent/connections/aws-sso-link.js.map +1 -0
  1917. package/dist/agent/connections/connector-auth.d.ts +216 -0
  1918. package/dist/agent/connections/connector-auth.d.ts.map +1 -0
  1919. package/dist/agent/connections/connector-auth.js +745 -0
  1920. package/dist/agent/connections/connector-auth.js.map +1 -0
  1921. package/dist/agent/connections/connector-card.d.ts +61 -0
  1922. package/dist/agent/connections/connector-card.d.ts.map +1 -0
  1923. package/dist/agent/connections/connector-card.js +361 -0
  1924. package/dist/agent/connections/connector-card.js.map +1 -0
  1925. package/dist/agent/connections/connector-flags.d.ts +22 -0
  1926. package/dist/agent/connections/connector-flags.d.ts.map +1 -0
  1927. package/dist/agent/connections/connector-flags.js +40 -0
  1928. package/dist/agent/connections/connector-flags.js.map +1 -0
  1929. package/dist/agent/connections/connector-offer.d.ts +122 -0
  1930. package/dist/agent/connections/connector-offer.d.ts.map +1 -0
  1931. package/dist/agent/connections/connector-offer.js +145 -0
  1932. package/dist/agent/connections/connector-offer.js.map +1 -0
  1933. package/dist/agent/connections/connector-transport.d.ts +55 -0
  1934. package/dist/agent/connections/connector-transport.d.ts.map +1 -0
  1935. package/dist/agent/connections/connector-transport.js +80 -0
  1936. package/dist/agent/connections/connector-transport.js.map +1 -0
  1937. package/dist/agent/connections/consent-resume.d.ts +81 -0
  1938. package/dist/agent/connections/consent-resume.d.ts.map +1 -0
  1939. package/dist/agent/connections/consent-resume.js +142 -0
  1940. package/dist/agent/connections/consent-resume.js.map +1 -0
  1941. package/dist/agent/connections/grant-mcp-borrow.d.ts +116 -0
  1942. package/dist/agent/connections/grant-mcp-borrow.d.ts.map +1 -0
  1943. package/dist/agent/connections/grant-mcp-borrow.js +256 -0
  1944. package/dist/agent/connections/grant-mcp-borrow.js.map +1 -0
  1945. package/dist/agent/connections/grant-mcp-transport.d.ts +13 -0
  1946. package/dist/agent/connections/grant-mcp-transport.d.ts.map +1 -0
  1947. package/dist/agent/connections/grant-mcp-transport.js +50 -0
  1948. package/dist/agent/connections/grant-mcp-transport.js.map +1 -0
  1949. package/dist/agent/connections/notion.d.ts +3 -0
  1950. package/dist/agent/connections/notion.d.ts.map +1 -0
  1951. package/dist/agent/connections/notion.js +35 -0
  1952. package/dist/agent/connections/notion.js.map +1 -0
  1953. package/dist/agent/connections/oe-oauth-callback.d.ts +61 -0
  1954. package/dist/agent/connections/oe-oauth-callback.d.ts.map +1 -0
  1955. package/dist/agent/connections/oe-oauth-callback.js +142 -0
  1956. package/dist/agent/connections/oe-oauth-callback.js.map +1 -0
  1957. package/dist/agent/connections/own-account-ask.d.ts +120 -0
  1958. package/dist/agent/connections/own-account-ask.d.ts.map +1 -0
  1959. package/dist/agent/connections/own-account-ask.js +204 -0
  1960. package/dist/agent/connections/own-account-ask.js.map +1 -0
  1961. package/dist/agent/connections/own-account-carriage.d.ts +33 -0
  1962. package/dist/agent/connections/own-account-carriage.d.ts.map +1 -0
  1963. package/dist/agent/connections/own-account-carriage.js +102 -0
  1964. package/dist/agent/connections/own-account-carriage.js.map +1 -0
  1965. package/dist/agent/connections/own-account-gate.d.ts +105 -0
  1966. package/dist/agent/connections/own-account-gate.d.ts.map +1 -0
  1967. package/dist/agent/connections/own-account-gate.js +305 -0
  1968. package/dist/agent/connections/own-account-gate.js.map +1 -0
  1969. package/dist/agent/connections/own-account-vendors.d.ts +40 -0
  1970. package/dist/agent/connections/own-account-vendors.d.ts.map +1 -0
  1971. package/dist/agent/connections/own-account-vendors.js +106 -0
  1972. package/dist/agent/connections/own-account-vendors.js.map +1 -0
  1973. package/dist/agent/connections/user-auth-flow.d.ts +78 -0
  1974. package/dist/agent/connections/user-auth-flow.d.ts.map +1 -0
  1975. package/dist/agent/connections/user-auth-flow.js +41 -0
  1976. package/dist/agent/connections/user-auth-flow.js.map +1 -0
  1977. package/dist/agent/contributions.d.ts +671 -0
  1978. package/dist/agent/contributions.d.ts.map +1 -0
  1979. package/dist/agent/contributions.js +192 -0
  1980. package/dist/agent/contributions.js.map +1 -0
  1981. package/dist/agent/control/auth.d.ts +291 -0
  1982. package/dist/agent/control/auth.d.ts.map +1 -0
  1983. package/dist/agent/control/auth.js +533 -0
  1984. package/dist/agent/control/auth.js.map +1 -0
  1985. package/dist/agent/control/capture-window-read.d.ts +115 -0
  1986. package/dist/agent/control/capture-window-read.d.ts.map +1 -0
  1987. package/dist/agent/control/capture-window-read.js +302 -0
  1988. package/dist/agent/control/capture-window-read.js.map +1 -0
  1989. package/dist/agent/control/delivery-history.d.ts +163 -0
  1990. package/dist/agent/control/delivery-history.d.ts.map +1 -0
  1991. package/dist/agent/control/delivery-history.js +397 -0
  1992. package/dist/agent/control/delivery-history.js.map +1 -0
  1993. package/dist/agent/control/http.d.ts +13 -0
  1994. package/dist/agent/control/http.d.ts.map +1 -0
  1995. package/dist/agent/control/http.js +131 -0
  1996. package/dist/agent/control/http.js.map +1 -0
  1997. package/dist/agent/control/mcp-route.d.ts +13 -0
  1998. package/dist/agent/control/mcp-route.d.ts.map +1 -0
  1999. package/dist/agent/control/mcp-route.js +100 -0
  2000. package/dist/agent/control/mcp-route.js.map +1 -0
  2001. package/dist/agent/control/oauth-clients.d.ts +145 -0
  2002. package/dist/agent/control/oauth-clients.d.ts.map +1 -0
  2003. package/dist/agent/control/oauth-clients.js +229 -0
  2004. package/dist/agent/control/oauth-clients.js.map +1 -0
  2005. package/dist/agent/control/oauth-resource.d.ts +59 -0
  2006. package/dist/agent/control/oauth-resource.d.ts.map +1 -0
  2007. package/dist/agent/control/oauth-resource.js +168 -0
  2008. package/dist/agent/control/oauth-resource.js.map +1 -0
  2009. package/dist/agent/control/oauth-route.d.ts +50 -0
  2010. package/dist/agent/control/oauth-route.d.ts.map +1 -0
  2011. package/dist/agent/control/oauth-route.js +343 -0
  2012. package/dist/agent/control/oauth-route.js.map +1 -0
  2013. package/dist/agent/control/oauth-tokens.d.ts +88 -0
  2014. package/dist/agent/control/oauth-tokens.d.ts.map +1 -0
  2015. package/dist/agent/control/oauth-tokens.js +171 -0
  2016. package/dist/agent/control/oauth-tokens.js.map +1 -0
  2017. package/dist/agent/control/read-route.d.ts +278 -0
  2018. package/dist/agent/control/read-route.d.ts.map +1 -0
  2019. package/dist/agent/control/read-route.js +761 -0
  2020. package/dist/agent/control/read-route.js.map +1 -0
  2021. package/dist/agent/control/server.d.ts +49 -0
  2022. package/dist/agent/control/server.d.ts.map +1 -0
  2023. package/dist/agent/control/server.js +405 -0
  2024. package/dist/agent/control/server.js.map +1 -0
  2025. package/dist/agent/control/test-route.d.ts +85 -0
  2026. package/dist/agent/control/test-route.d.ts.map +1 -0
  2027. package/dist/agent/control/test-route.js +426 -0
  2028. package/dist/agent/control/test-route.js.map +1 -0
  2029. package/dist/agent/control/transcript-export.d.ts +68 -0
  2030. package/dist/agent/control/transcript-export.d.ts.map +1 -0
  2031. package/dist/agent/control/transcript-export.js +145 -0
  2032. package/dist/agent/control/transcript-export.js.map +1 -0
  2033. package/dist/agent/control/transcript-relay.d.ts +104 -0
  2034. package/dist/agent/control/transcript-relay.d.ts.map +1 -0
  2035. package/dist/agent/control/transcript-relay.js +314 -0
  2036. package/dist/agent/control/transcript-relay.js.map +1 -0
  2037. package/dist/agent/control/transcript-render.d.ts +43 -0
  2038. package/dist/agent/control/transcript-render.d.ts.map +1 -0
  2039. package/dist/agent/control/transcript-render.js +142 -0
  2040. package/dist/agent/control/transcript-render.js.map +1 -0
  2041. package/dist/agent/control/views.d.ts +511 -0
  2042. package/dist/agent/control/views.d.ts.map +1 -0
  2043. package/dist/agent/control/views.js +743 -0
  2044. package/dist/agent/control/views.js.map +1 -0
  2045. package/dist/agent/control/writes.d.ts +15 -0
  2046. package/dist/agent/control/writes.d.ts.map +1 -0
  2047. package/dist/agent/control/writes.js +1309 -0
  2048. package/dist/agent/control/writes.js.map +1 -0
  2049. package/dist/agent/credentials/binding-pr.d.ts +51 -0
  2050. package/dist/agent/credentials/binding-pr.d.ts.map +1 -0
  2051. package/dist/agent/credentials/binding-pr.js +178 -0
  2052. package/dist/agent/credentials/binding-pr.js.map +1 -0
  2053. package/dist/agent/credentials/config-pr-github.d.ts +24 -0
  2054. package/dist/agent/credentials/config-pr-github.d.ts.map +1 -0
  2055. package/dist/agent/credentials/config-pr-github.js +160 -0
  2056. package/dist/agent/credentials/config-pr-github.js.map +1 -0
  2057. package/dist/agent/credentials/config-pr.d.ts +148 -0
  2058. package/dist/agent/credentials/config-pr.d.ts.map +1 -0
  2059. package/dist/agent/credentials/config-pr.js +45 -0
  2060. package/dist/agent/credentials/config-pr.js.map +1 -0
  2061. package/dist/agent/credentials/db-broker.d.ts +82 -0
  2062. package/dist/agent/credentials/db-broker.d.ts.map +1 -0
  2063. package/dist/agent/credentials/db-broker.js +231 -0
  2064. package/dist/agent/credentials/db-broker.js.map +1 -0
  2065. package/dist/agent/credentials/home.d.ts +51 -0
  2066. package/dist/agent/credentials/home.d.ts.map +1 -0
  2067. package/dist/agent/credentials/home.js +43 -0
  2068. package/dist/agent/credentials/home.js.map +1 -0
  2069. package/dist/agent/credentials/intake-page.d.ts +54 -0
  2070. package/dist/agent/credentials/intake-page.d.ts.map +1 -0
  2071. package/dist/agent/credentials/intake-page.js +238 -0
  2072. package/dist/agent/credentials/intake-page.js.map +1 -0
  2073. package/dist/agent/credentials/intake.d.ts +147 -0
  2074. package/dist/agent/credentials/intake.d.ts.map +1 -0
  2075. package/dist/agent/credentials/intake.js +404 -0
  2076. package/dist/agent/credentials/intake.js.map +1 -0
  2077. package/dist/agent/credentials/kv-vault.d.ts +69 -0
  2078. package/dist/agent/credentials/kv-vault.d.ts.map +1 -0
  2079. package/dist/agent/credentials/kv-vault.js +121 -0
  2080. package/dist/agent/credentials/kv-vault.js.map +1 -0
  2081. package/dist/agent/credentials/operator-secrets.d.ts +169 -0
  2082. package/dist/agent/credentials/operator-secrets.d.ts.map +1 -0
  2083. package/dist/agent/credentials/operator-secrets.js +316 -0
  2084. package/dist/agent/credentials/operator-secrets.js.map +1 -0
  2085. package/dist/agent/credentials/page-chrome.d.ts +11 -0
  2086. package/dist/agent/credentials/page-chrome.d.ts.map +1 -0
  2087. package/dist/agent/credentials/page-chrome.js +52 -0
  2088. package/dist/agent/credentials/page-chrome.js.map +1 -0
  2089. package/dist/agent/credentials/page-token.d.ts +73 -0
  2090. package/dist/agent/credentials/page-token.d.ts.map +1 -0
  2091. package/dist/agent/credentials/page-token.js +197 -0
  2092. package/dist/agent/credentials/page-token.js.map +1 -0
  2093. package/dist/agent/credentials/purge.d.ts +54 -0
  2094. package/dist/agent/credentials/purge.d.ts.map +1 -0
  2095. package/dist/agent/credentials/purge.js +82 -0
  2096. package/dist/agent/credentials/purge.js.map +1 -0
  2097. package/dist/agent/credentials/ref.d.ts +72 -0
  2098. package/dist/agent/credentials/ref.d.ts.map +1 -0
  2099. package/dist/agent/credentials/ref.js +110 -0
  2100. package/dist/agent/credentials/ref.js.map +1 -0
  2101. package/dist/agent/credentials/reserved-refs.d.ts +31 -0
  2102. package/dist/agent/credentials/reserved-refs.d.ts.map +1 -0
  2103. package/dist/agent/credentials/reserved-refs.js +70 -0
  2104. package/dist/agent/credentials/reserved-refs.js.map +1 -0
  2105. package/dist/agent/credentials/self-secrets.d.ts +24 -0
  2106. package/dist/agent/credentials/self-secrets.d.ts.map +1 -0
  2107. package/dist/agent/credentials/self-secrets.js +138 -0
  2108. package/dist/agent/credentials/self-secrets.js.map +1 -0
  2109. package/dist/agent/credentials/warm.d.ts +77 -0
  2110. package/dist/agent/credentials/warm.d.ts.map +1 -0
  2111. package/dist/agent/credentials/warm.js +136 -0
  2112. package/dist/agent/credentials/warm.js.map +1 -0
  2113. package/dist/agent/docs/approver-policy.d.ts +70 -0
  2114. package/dist/agent/docs/approver-policy.d.ts.map +1 -0
  2115. package/dist/agent/docs/approver-policy.js +193 -0
  2116. package/dist/agent/docs/approver-policy.js.map +1 -0
  2117. package/dist/agent/docs/capability-map.d.ts +69 -0
  2118. package/dist/agent/docs/capability-map.d.ts.map +1 -0
  2119. package/dist/agent/docs/capability-map.js +142 -0
  2120. package/dist/agent/docs/capability-map.js.map +1 -0
  2121. package/dist/agent/docs/counted-claims.d.ts +61 -0
  2122. package/dist/agent/docs/counted-claims.d.ts.map +1 -0
  2123. package/dist/agent/docs/counted-claims.js +363 -0
  2124. package/dist/agent/docs/counted-claims.js.map +1 -0
  2125. package/dist/agent/docs/registry.d.ts +73 -0
  2126. package/dist/agent/docs/registry.d.ts.map +1 -0
  2127. package/dist/agent/docs/registry.js +157 -0
  2128. package/dist/agent/docs/registry.js.map +1 -0
  2129. package/dist/agent/docs/source-map.d.ts +69 -0
  2130. package/dist/agent/docs/source-map.d.ts.map +1 -0
  2131. package/dist/agent/docs/source-map.js +156 -0
  2132. package/dist/agent/docs/source-map.js.map +1 -0
  2133. package/dist/agent/hooks/approval-raised.d.ts +3 -0
  2134. package/dist/agent/hooks/approval-raised.d.ts.map +1 -0
  2135. package/dist/agent/hooks/approval-raised.js +31 -0
  2136. package/dist/agent/hooks/approval-raised.js.map +1 -0
  2137. package/dist/agent/hooks/approval-settlement.d.ts +5 -0
  2138. package/dist/agent/hooks/approval-settlement.d.ts.map +1 -0
  2139. package/dist/agent/hooks/approval-settlement.js +90 -0
  2140. package/dist/agent/hooks/approval-settlement.js.map +1 -0
  2141. package/dist/agent/hooks/binding-bridge.d.ts +3 -0
  2142. package/dist/agent/hooks/binding-bridge.d.ts.map +1 -0
  2143. package/dist/agent/hooks/binding-bridge.js +63 -0
  2144. package/dist/agent/hooks/binding-bridge.js.map +1 -0
  2145. package/dist/agent/hooks/connector-audit.d.ts +3 -0
  2146. package/dist/agent/hooks/connector-audit.d.ts.map +1 -0
  2147. package/dist/agent/hooks/connector-audit.js +103 -0
  2148. package/dist/agent/hooks/connector-audit.js.map +1 -0
  2149. package/dist/agent/hooks/egress.d.ts +150 -0
  2150. package/dist/agent/hooks/egress.d.ts.map +1 -0
  2151. package/dist/agent/hooks/egress.js +546 -0
  2152. package/dist/agent/hooks/egress.js.map +1 -0
  2153. package/dist/agent/hooks/eve-patch-gate.d.ts +3 -0
  2154. package/dist/agent/hooks/eve-patch-gate.d.ts.map +1 -0
  2155. package/dist/agent/hooks/eve-patch-gate.js +51 -0
  2156. package/dist/agent/hooks/eve-patch-gate.js.map +1 -0
  2157. package/dist/agent/hooks/fire-carriage.d.ts +3 -0
  2158. package/dist/agent/hooks/fire-carriage.d.ts.map +1 -0
  2159. package/dist/agent/hooks/fire-carriage.js +32 -0
  2160. package/dist/agent/hooks/fire-carriage.js.map +1 -0
  2161. package/dist/agent/hooks/fire-toolset.d.ts +48 -0
  2162. package/dist/agent/hooks/fire-toolset.d.ts.map +1 -0
  2163. package/dist/agent/hooks/fire-toolset.js +275 -0
  2164. package/dist/agent/hooks/fire-toolset.js.map +1 -0
  2165. package/dist/agent/hooks/job-posture.d.ts +3 -0
  2166. package/dist/agent/hooks/job-posture.d.ts.map +1 -0
  2167. package/dist/agent/hooks/job-posture.js +82 -0
  2168. package/dist/agent/hooks/job-posture.js.map +1 -0
  2169. package/dist/agent/hooks/lean-seat.d.ts +3 -0
  2170. package/dist/agent/hooks/lean-seat.d.ts.map +1 -0
  2171. package/dist/agent/hooks/lean-seat.js +229 -0
  2172. package/dist/agent/hooks/lean-seat.js.map +1 -0
  2173. package/dist/agent/hooks/learn.d.ts +3 -0
  2174. package/dist/agent/hooks/learn.d.ts.map +1 -0
  2175. package/dist/agent/hooks/learn.js +193 -0
  2176. package/dist/agent/hooks/learn.js.map +1 -0
  2177. package/dist/agent/hooks/link-claim.d.ts +63 -0
  2178. package/dist/agent/hooks/link-claim.d.ts.map +1 -0
  2179. package/dist/agent/hooks/link-claim.js +215 -0
  2180. package/dist/agent/hooks/link-claim.js.map +1 -0
  2181. package/dist/agent/hooks/log-flush.d.ts +3 -0
  2182. package/dist/agent/hooks/log-flush.d.ts.map +1 -0
  2183. package/dist/agent/hooks/log-flush.js +28 -0
  2184. package/dist/agent/hooks/log-flush.js.map +1 -0
  2185. package/dist/agent/hooks/loop-breaker.d.ts +3 -0
  2186. package/dist/agent/hooks/loop-breaker.d.ts.map +1 -0
  2187. package/dist/agent/hooks/loop-breaker.js +16 -0
  2188. package/dist/agent/hooks/loop-breaker.js.map +1 -0
  2189. package/dist/agent/hooks/memory.d.ts +112 -0
  2190. package/dist/agent/hooks/memory.d.ts.map +1 -0
  2191. package/dist/agent/hooks/memory.js +1191 -0
  2192. package/dist/agent/hooks/memory.js.map +1 -0
  2193. package/dist/agent/hooks/native-input-audit.d.ts +7 -0
  2194. package/dist/agent/hooks/native-input-audit.d.ts.map +1 -0
  2195. package/dist/agent/hooks/native-input-audit.js +44 -0
  2196. package/dist/agent/hooks/native-input-audit.js.map +1 -0
  2197. package/dist/agent/hooks/own-account-ask.d.ts +52 -0
  2198. package/dist/agent/hooks/own-account-ask.d.ts.map +1 -0
  2199. package/dist/agent/hooks/own-account-ask.js +162 -0
  2200. package/dist/agent/hooks/own-account-ask.js.map +1 -0
  2201. package/dist/agent/hooks/requester-identity.d.ts +3 -0
  2202. package/dist/agent/hooks/requester-identity.d.ts.map +1 -0
  2203. package/dist/agent/hooks/requester-identity.js +24 -0
  2204. package/dist/agent/hooks/requester-identity.js.map +1 -0
  2205. package/dist/agent/hooks/requester-messages.d.ts +9 -0
  2206. package/dist/agent/hooks/requester-messages.d.ts.map +1 -0
  2207. package/dist/agent/hooks/requester-messages.js +57 -0
  2208. package/dist/agent/hooks/requester-messages.js.map +1 -0
  2209. package/dist/agent/hooks/routine-outcome.d.ts +29 -0
  2210. package/dist/agent/hooks/routine-outcome.d.ts.map +1 -0
  2211. package/dist/agent/hooks/routine-outcome.js +211 -0
  2212. package/dist/agent/hooks/routine-outcome.js.map +1 -0
  2213. package/dist/agent/hooks/routine-silence.d.ts +3 -0
  2214. package/dist/agent/hooks/routine-silence.d.ts.map +1 -0
  2215. package/dist/agent/hooks/routine-silence.js +30 -0
  2216. package/dist/agent/hooks/routine-silence.js.map +1 -0
  2217. package/dist/agent/hooks/session-park.d.ts +3 -0
  2218. package/dist/agent/hooks/session-park.d.ts.map +1 -0
  2219. package/dist/agent/hooks/session-park.js +43 -0
  2220. package/dist/agent/hooks/session-park.js.map +1 -0
  2221. package/dist/agent/hooks/settlement-flush.d.ts +45 -0
  2222. package/dist/agent/hooks/settlement-flush.d.ts.map +1 -0
  2223. package/dist/agent/hooks/settlement-flush.js +146 -0
  2224. package/dist/agent/hooks/settlement-flush.js.map +1 -0
  2225. package/dist/agent/hooks/spawn-taint.d.ts +154 -0
  2226. package/dist/agent/hooks/spawn-taint.d.ts.map +1 -0
  2227. package/dist/agent/hooks/spawn-taint.js +1200 -0
  2228. package/dist/agent/hooks/spawn-taint.js.map +1 -0
  2229. package/dist/agent/hooks/spend.d.ts +92 -0
  2230. package/dist/agent/hooks/spend.d.ts.map +1 -0
  2231. package/dist/agent/hooks/spend.js +343 -0
  2232. package/dist/agent/hooks/spend.js.map +1 -0
  2233. package/dist/agent/hooks/stall-guard.d.ts +3 -0
  2234. package/dist/agent/hooks/stall-guard.d.ts.map +1 -0
  2235. package/dist/agent/hooks/stall-guard.js +22 -0
  2236. package/dist/agent/hooks/stall-guard.js.map +1 -0
  2237. package/dist/agent/hooks/telemetry.d.ts +3 -0
  2238. package/dist/agent/hooks/telemetry.d.ts.map +1 -0
  2239. package/dist/agent/hooks/telemetry.js +93 -0
  2240. package/dist/agent/hooks/telemetry.js.map +1 -0
  2241. package/dist/agent/hooks/turn-anchor.d.ts +35 -0
  2242. package/dist/agent/hooks/turn-anchor.d.ts.map +1 -0
  2243. package/dist/agent/hooks/turn-anchor.js +647 -0
  2244. package/dist/agent/hooks/turn-anchor.js.map +1 -0
  2245. package/dist/agent/hooks/turn-tally.d.ts +32 -0
  2246. package/dist/agent/hooks/turn-tally.d.ts.map +1 -0
  2247. package/dist/agent/hooks/turn-tally.js +69 -0
  2248. package/dist/agent/hooks/turn-tally.js.map +1 -0
  2249. package/dist/agent/hooks/wake-accounting-turn.d.ts +8 -0
  2250. package/dist/agent/hooks/wake-accounting-turn.d.ts.map +1 -0
  2251. package/dist/agent/hooks/wake-accounting-turn.js +88 -0
  2252. package/dist/agent/hooks/wake-accounting-turn.js.map +1 -0
  2253. package/dist/agent/hooks/wake-turn-start.d.ts +3 -0
  2254. package/dist/agent/hooks/wake-turn-start.d.ts.map +1 -0
  2255. package/dist/agent/hooks/wake-turn-start.js +44 -0
  2256. package/dist/agent/hooks/wake-turn-start.js.map +1 -0
  2257. package/dist/agent/hooks/window-routing.d.ts +3 -0
  2258. package/dist/agent/hooks/window-routing.d.ts.map +1 -0
  2259. package/dist/agent/hooks/window-routing.js +52 -0
  2260. package/dist/agent/hooks/window-routing.js.map +1 -0
  2261. package/dist/agent/identity/account-directory.d.ts +52 -0
  2262. package/dist/agent/identity/account-directory.d.ts.map +1 -0
  2263. package/dist/agent/identity/account-directory.js +110 -0
  2264. package/dist/agent/identity/account-directory.js.map +1 -0
  2265. package/dist/agent/identity/account-display-name.d.ts +65 -0
  2266. package/dist/agent/identity/account-display-name.d.ts.map +1 -0
  2267. package/dist/agent/identity/account-display-name.js +156 -0
  2268. package/dist/agent/identity/account-display-name.js.map +1 -0
  2269. package/dist/agent/identity/author-trust.d.ts +106 -0
  2270. package/dist/agent/identity/author-trust.d.ts.map +1 -0
  2271. package/dist/agent/identity/author-trust.js +209 -0
  2272. package/dist/agent/identity/author-trust.js.map +1 -0
  2273. package/dist/agent/identity/binding-bridge.d.ts +26 -0
  2274. package/dist/agent/identity/binding-bridge.d.ts.map +1 -0
  2275. package/dist/agent/identity/binding-bridge.js +75 -0
  2276. package/dist/agent/identity/binding-bridge.js.map +1 -0
  2277. package/dist/agent/identity/binding.d.ts +567 -0
  2278. package/dist/agent/identity/binding.d.ts.map +1 -0
  2279. package/dist/agent/identity/binding.js +1050 -0
  2280. package/dist/agent/identity/binding.js.map +1 -0
  2281. package/dist/agent/identity/bot-display-name.d.ts +19 -0
  2282. package/dist/agent/identity/bot-display-name.d.ts.map +1 -0
  2283. package/dist/agent/identity/bot-display-name.js +47 -0
  2284. package/dist/agent/identity/bot-display-name.js.map +1 -0
  2285. package/dist/agent/identity/bot-name.d.ts +39 -0
  2286. package/dist/agent/identity/bot-name.d.ts.map +1 -0
  2287. package/dist/agent/identity/bot-name.js +77 -0
  2288. package/dist/agent/identity/bot-name.js.map +1 -0
  2289. package/dist/agent/identity/capabilities.d.ts +52 -0
  2290. package/dist/agent/identity/capabilities.d.ts.map +1 -0
  2291. package/dist/agent/identity/capabilities.js +39 -0
  2292. package/dist/agent/identity/capabilities.js.map +1 -0
  2293. package/dist/agent/identity/delegated-binding.d.ts +59 -0
  2294. package/dist/agent/identity/delegated-binding.d.ts.map +1 -0
  2295. package/dist/agent/identity/delegated-binding.js +116 -0
  2296. package/dist/agent/identity/delegated-binding.js.map +1 -0
  2297. package/dist/agent/identity/deployment-identity.d.ts +61 -0
  2298. package/dist/agent/identity/deployment-identity.d.ts.map +1 -0
  2299. package/dist/agent/identity/deployment-identity.js +75 -0
  2300. package/dist/agent/identity/deployment-identity.js.map +1 -0
  2301. package/dist/agent/identity/directory-sync.d.ts +195 -0
  2302. package/dist/agent/identity/directory-sync.d.ts.map +1 -0
  2303. package/dist/agent/identity/directory-sync.js +623 -0
  2304. package/dist/agent/identity/directory-sync.js.map +1 -0
  2305. package/dist/agent/identity/directory.d.ts +73 -0
  2306. package/dist/agent/identity/directory.d.ts.map +1 -0
  2307. package/dist/agent/identity/directory.js +19 -0
  2308. package/dist/agent/identity/directory.js.map +1 -0
  2309. package/dist/agent/identity/display-title.d.ts +12 -0
  2310. package/dist/agent/identity/display-title.d.ts.map +1 -0
  2311. package/dist/agent/identity/display-title.js +14 -0
  2312. package/dist/agent/identity/display-title.js.map +1 -0
  2313. package/dist/agent/identity/frozen-surface-binding.internal.d.ts +8 -0
  2314. package/dist/agent/identity/frozen-surface-binding.internal.d.ts.map +1 -0
  2315. package/dist/agent/identity/frozen-surface-binding.internal.js +90 -0
  2316. package/dist/agent/identity/frozen-surface-binding.internal.js.map +1 -0
  2317. package/dist/agent/identity/group-sync.d.ts +77 -0
  2318. package/dist/agent/identity/group-sync.d.ts.map +1 -0
  2319. package/dist/agent/identity/group-sync.js +128 -0
  2320. package/dist/agent/identity/group-sync.js.map +1 -0
  2321. package/dist/agent/identity/groups-codemod.d.ts +52 -0
  2322. package/dist/agent/identity/groups-codemod.d.ts.map +1 -0
  2323. package/dist/agent/identity/groups-codemod.js +129 -0
  2324. package/dist/agent/identity/groups-codemod.js.map +1 -0
  2325. package/dist/agent/identity/groups-delivery.d.ts +56 -0
  2326. package/dist/agent/identity/groups-delivery.d.ts.map +1 -0
  2327. package/dist/agent/identity/groups-delivery.js +116 -0
  2328. package/dist/agent/identity/groups-delivery.js.map +1 -0
  2329. package/dist/agent/identity/groups.d.ts +74 -0
  2330. package/dist/agent/identity/groups.d.ts.map +1 -0
  2331. package/dist/agent/identity/groups.js +124 -0
  2332. package/dist/agent/identity/groups.js.map +1 -0
  2333. package/dist/agent/identity/link-challenge.d.ts +58 -0
  2334. package/dist/agent/identity/link-challenge.d.ts.map +1 -0
  2335. package/dist/agent/identity/link-challenge.js +136 -0
  2336. package/dist/agent/identity/link-challenge.js.map +1 -0
  2337. package/dist/agent/identity/link-consent.d.ts +79 -0
  2338. package/dist/agent/identity/link-consent.d.ts.map +1 -0
  2339. package/dist/agent/identity/link-consent.js +179 -0
  2340. package/dist/agent/identity/link-consent.js.map +1 -0
  2341. package/dist/agent/identity/link-flow.d.ts +260 -0
  2342. package/dist/agent/identity/link-flow.d.ts.map +1 -0
  2343. package/dist/agent/identity/link-flow.js +327 -0
  2344. package/dist/agent/identity/link-flow.js.map +1 -0
  2345. package/dist/agent/identity/link-initiator.d.ts +16 -0
  2346. package/dist/agent/identity/link-initiator.d.ts.map +1 -0
  2347. package/dist/agent/identity/link-initiator.js +25 -0
  2348. package/dist/agent/identity/link-initiator.js.map +1 -0
  2349. package/dist/agent/identity/link-resolve.d.ts +40 -0
  2350. package/dist/agent/identity/link-resolve.d.ts.map +1 -0
  2351. package/dist/agent/identity/link-resolve.js +195 -0
  2352. package/dist/agent/identity/link-resolve.js.map +1 -0
  2353. package/dist/agent/identity/link-set-ref.d.ts +16 -0
  2354. package/dist/agent/identity/link-set-ref.d.ts.map +1 -0
  2355. package/dist/agent/identity/link-set-ref.js +32 -0
  2356. package/dist/agent/identity/link-set-ref.js.map +1 -0
  2357. package/dist/agent/identity/link-store.d.ts +400 -0
  2358. package/dist/agent/identity/link-store.d.ts.map +1 -0
  2359. package/dist/agent/identity/link-store.js +725 -0
  2360. package/dist/agent/identity/link-store.js.map +1 -0
  2361. package/dist/agent/identity/link-tenant-backfill.d.ts +39 -0
  2362. package/dist/agent/identity/link-tenant-backfill.d.ts.map +1 -0
  2363. package/dist/agent/identity/link-tenant-backfill.js +67 -0
  2364. package/dist/agent/identity/link-tenant-backfill.js.map +1 -0
  2365. package/dist/agent/identity/link-tenant.d.ts +28 -0
  2366. package/dist/agent/identity/link-tenant.d.ts.map +1 -0
  2367. package/dist/agent/identity/link-tenant.js +51 -0
  2368. package/dist/agent/identity/link-tenant.js.map +1 -0
  2369. package/dist/agent/identity/oauth-vault-share.d.ts +29 -0
  2370. package/dist/agent/identity/oauth-vault-share.d.ts.map +1 -0
  2371. package/dist/agent/identity/oauth-vault-share.js +36 -0
  2372. package/dist/agent/identity/oauth-vault-share.js.map +1 -0
  2373. package/dist/agent/identity/platform.d.ts +9 -0
  2374. package/dist/agent/identity/platform.d.ts.map +1 -0
  2375. package/dist/agent/identity/platform.js +48 -0
  2376. package/dist/agent/identity/platform.js.map +1 -0
  2377. package/dist/agent/identity/principal-key-rules.d.ts +23 -0
  2378. package/dist/agent/identity/principal-key-rules.d.ts.map +1 -0
  2379. package/dist/agent/identity/principal-key-rules.js +91 -0
  2380. package/dist/agent/identity/principal-key-rules.js.map +1 -0
  2381. package/dist/agent/identity/principal-key.d.ts +92 -0
  2382. package/dist/agent/identity/principal-key.d.ts.map +1 -0
  2383. package/dist/agent/identity/principal-key.js +197 -0
  2384. package/dist/agent/identity/principal-key.js.map +1 -0
  2385. package/dist/agent/identity/principals.d.ts +145 -0
  2386. package/dist/agent/identity/principals.d.ts.map +1 -0
  2387. package/dist/agent/identity/principals.js +303 -0
  2388. package/dist/agent/identity/principals.js.map +1 -0
  2389. package/dist/agent/identity/surface-key-grammar.d.ts +83 -0
  2390. package/dist/agent/identity/surface-key-grammar.d.ts.map +1 -0
  2391. package/dist/agent/identity/surface-key-grammar.js +138 -0
  2392. package/dist/agent/identity/surface-key-grammar.js.map +1 -0
  2393. package/dist/agent/identity/surface-parity.d.ts +274 -0
  2394. package/dist/agent/identity/surface-parity.d.ts.map +1 -0
  2395. package/dist/agent/identity/surface-parity.js +357 -0
  2396. package/dist/agent/identity/surface-parity.js.map +1 -0
  2397. package/dist/agent/identity/trust-preflight.d.ts +83 -0
  2398. package/dist/agent/identity/trust-preflight.d.ts.map +1 -0
  2399. package/dist/agent/identity/trust-preflight.js +196 -0
  2400. package/dist/agent/identity/trust-preflight.js.map +1 -0
  2401. package/dist/agent/identity/trust.d.ts +217 -0
  2402. package/dist/agent/identity/trust.d.ts.map +1 -0
  2403. package/dist/agent/identity/trust.js +300 -0
  2404. package/dist/agent/identity/trust.js.map +1 -0
  2405. package/dist/agent/identity/wake-trust.d.ts +129 -0
  2406. package/dist/agent/identity/wake-trust.d.ts.map +1 -0
  2407. package/dist/agent/identity/wake-trust.js +159 -0
  2408. package/dist/agent/identity/wake-trust.js.map +1 -0
  2409. package/dist/agent/instructions/access.d.ts +252 -0
  2410. package/dist/agent/instructions/access.d.ts.map +1 -0
  2411. package/dist/agent/instructions/access.js +1200 -0
  2412. package/dist/agent/instructions/access.js.map +1 -0
  2413. package/dist/agent/instructions/seat-prompt.d.ts +354 -0
  2414. package/dist/agent/instructions/seat-prompt.d.ts.map +1 -0
  2415. package/dist/agent/instructions/seat-prompt.js +1143 -0
  2416. package/dist/agent/instructions/seat-prompt.js.map +1 -0
  2417. package/dist/agent/lib/process-registry.d.ts +8 -0
  2418. package/dist/agent/lib/process-registry.d.ts.map +1 -0
  2419. package/dist/agent/lib/process-registry.js +53 -0
  2420. package/dist/agent/lib/process-registry.js.map +1 -0
  2421. package/dist/agent/memory/agents-codemod.d.ts +92 -0
  2422. package/dist/agent/memory/agents-codemod.d.ts.map +1 -0
  2423. package/dist/agent/memory/agents-codemod.js +366 -0
  2424. package/dist/agent/memory/agents-codemod.js.map +1 -0
  2425. package/dist/agent/memory/connector-memory.d.ts +54 -0
  2426. package/dist/agent/memory/connector-memory.d.ts.map +1 -0
  2427. package/dist/agent/memory/connector-memory.js +80 -0
  2428. package/dist/agent/memory/connector-memory.js.map +1 -0
  2429. package/dist/agent/memory/domain.d.ts +384 -0
  2430. package/dist/agent/memory/domain.d.ts.map +1 -0
  2431. package/dist/agent/memory/domain.js +911 -0
  2432. package/dist/agent/memory/domain.js.map +1 -0
  2433. package/dist/agent/memory/dream/candidates.d.ts +35 -0
  2434. package/dist/agent/memory/dream/candidates.d.ts.map +1 -0
  2435. package/dist/agent/memory/dream/candidates.js +149 -0
  2436. package/dist/agent/memory/dream/candidates.js.map +1 -0
  2437. package/dist/agent/memory/dream/correction.d.ts +56 -0
  2438. package/dist/agent/memory/dream/correction.d.ts.map +1 -0
  2439. package/dist/agent/memory/dream/correction.js +109 -0
  2440. package/dist/agent/memory/dream/correction.js.map +1 -0
  2441. package/dist/agent/memory/dream/judge.d.ts +47 -0
  2442. package/dist/agent/memory/dream/judge.d.ts.map +1 -0
  2443. package/dist/agent/memory/dream/judge.js +135 -0
  2444. package/dist/agent/memory/dream/judge.js.map +1 -0
  2445. package/dist/agent/memory/dream/learn.d.ts +79 -0
  2446. package/dist/agent/memory/dream/learn.d.ts.map +1 -0
  2447. package/dist/agent/memory/dream/learn.js +243 -0
  2448. package/dist/agent/memory/dream/learn.js.map +1 -0
  2449. package/dist/agent/memory/dream/mode3-cluster.d.ts +37 -0
  2450. package/dist/agent/memory/dream/mode3-cluster.d.ts.map +1 -0
  2451. package/dist/agent/memory/dream/mode3-cluster.js +123 -0
  2452. package/dist/agent/memory/dream/mode3-cluster.js.map +1 -0
  2453. package/dist/agent/memory/dream/mode3-last-mile.d.ts +134 -0
  2454. package/dist/agent/memory/dream/mode3-last-mile.d.ts.map +1 -0
  2455. package/dist/agent/memory/dream/mode3-last-mile.js +262 -0
  2456. package/dist/agent/memory/dream/mode3-last-mile.js.map +1 -0
  2457. package/dist/agent/memory/dream/mode3.d.ts +82 -0
  2458. package/dist/agent/memory/dream/mode3.d.ts.map +1 -0
  2459. package/dist/agent/memory/dream/mode3.js +236 -0
  2460. package/dist/agent/memory/dream/mode3.js.map +1 -0
  2461. package/dist/agent/memory/dream/ops.d.ts +75 -0
  2462. package/dist/agent/memory/dream/ops.d.ts.map +1 -0
  2463. package/dist/agent/memory/dream/ops.js +302 -0
  2464. package/dist/agent/memory/dream/ops.js.map +1 -0
  2465. package/dist/agent/memory/dream/proposal.d.ts +22 -0
  2466. package/dist/agent/memory/dream/proposal.d.ts.map +1 -0
  2467. package/dist/agent/memory/dream/proposal.js +66 -0
  2468. package/dist/agent/memory/dream/proposal.js.map +1 -0
  2469. package/dist/agent/memory/dream/recurrence.d.ts +38 -0
  2470. package/dist/agent/memory/dream/recurrence.d.ts.map +1 -0
  2471. package/dist/agent/memory/dream/recurrence.js +106 -0
  2472. package/dist/agent/memory/dream/recurrence.js.map +1 -0
  2473. package/dist/agent/memory/dream/salience.d.ts +10 -0
  2474. package/dist/agent/memory/dream/salience.d.ts.map +1 -0
  2475. package/dist/agent/memory/dream/salience.js +16 -0
  2476. package/dist/agent/memory/dream/salience.js.map +1 -0
  2477. package/dist/agent/memory/dream/skill-proposal-pr.d.ts +63 -0
  2478. package/dist/agent/memory/dream/skill-proposal-pr.d.ts.map +1 -0
  2479. package/dist/agent/memory/dream/skill-proposal-pr.js +245 -0
  2480. package/dist/agent/memory/dream/skill-proposal-pr.js.map +1 -0
  2481. package/dist/agent/memory/dream/supersede-apply.d.ts +40 -0
  2482. package/dist/agent/memory/dream/supersede-apply.d.ts.map +1 -0
  2483. package/dist/agent/memory/dream/supersede-apply.js +78 -0
  2484. package/dist/agent/memory/dream/supersede-apply.js.map +1 -0
  2485. package/dist/agent/memory/dream/tidy.d.ts +60 -0
  2486. package/dist/agent/memory/dream/tidy.d.ts.map +1 -0
  2487. package/dist/agent/memory/dream/tidy.js +96 -0
  2488. package/dist/agent/memory/dream/tidy.js.map +1 -0
  2489. package/dist/agent/memory/graph.d.ts +46 -0
  2490. package/dist/agent/memory/graph.d.ts.map +1 -0
  2491. package/dist/agent/memory/graph.js +130 -0
  2492. package/dist/agent/memory/graph.js.map +1 -0
  2493. package/dist/agent/memory/host-owned-files.d.ts +2 -0
  2494. package/dist/agent/memory/host-owned-files.d.ts.map +1 -0
  2495. package/dist/agent/memory/host-owned-files.js +4 -0
  2496. package/dist/agent/memory/host-owned-files.js.map +1 -0
  2497. package/dist/agent/memory/layout.d.ts +8 -0
  2498. package/dist/agent/memory/layout.d.ts.map +1 -0
  2499. package/dist/agent/memory/layout.js +77 -0
  2500. package/dist/agent/memory/layout.js.map +1 -0
  2501. package/dist/agent/memory/listing.d.ts +11 -0
  2502. package/dist/agent/memory/listing.d.ts.map +1 -0
  2503. package/dist/agent/memory/listing.js +169 -0
  2504. package/dist/agent/memory/listing.js.map +1 -0
  2505. package/dist/agent/memory/markdown.d.ts +73 -0
  2506. package/dist/agent/memory/markdown.d.ts.map +1 -0
  2507. package/dist/agent/memory/markdown.js +190 -0
  2508. package/dist/agent/memory/markdown.js.map +1 -0
  2509. package/dist/agent/memory/partition.d.ts +34 -0
  2510. package/dist/agent/memory/partition.d.ts.map +1 -0
  2511. package/dist/agent/memory/partition.js +41 -0
  2512. package/dist/agent/memory/partition.js.map +1 -0
  2513. package/dist/agent/memory/postgres.d.ts +73 -0
  2514. package/dist/agent/memory/postgres.d.ts.map +1 -0
  2515. package/dist/agent/memory/postgres.js +411 -0
  2516. package/dist/agent/memory/postgres.js.map +1 -0
  2517. package/dist/agent/memory/provenance-mark.d.ts +77 -0
  2518. package/dist/agent/memory/provenance-mark.d.ts.map +1 -0
  2519. package/dist/agent/memory/provenance-mark.js +276 -0
  2520. package/dist/agent/memory/provenance-mark.js.map +1 -0
  2521. package/dist/agent/memory/provenance.d.ts +8 -0
  2522. package/dist/agent/memory/provenance.d.ts.map +1 -0
  2523. package/dist/agent/memory/provenance.js +25 -0
  2524. package/dist/agent/memory/provenance.js.map +1 -0
  2525. package/dist/agent/memory/provider.d.ts +76 -0
  2526. package/dist/agent/memory/provider.d.ts.map +1 -0
  2527. package/dist/agent/memory/provider.js +96 -0
  2528. package/dist/agent/memory/provider.js.map +1 -0
  2529. package/dist/agent/memory/purge-redaction.d.ts +29 -0
  2530. package/dist/agent/memory/purge-redaction.d.ts.map +1 -0
  2531. package/dist/agent/memory/purge-redaction.js +65 -0
  2532. package/dist/agent/memory/purge-redaction.js.map +1 -0
  2533. package/dist/agent/memory/readonly.d.ts +25 -0
  2534. package/dist/agent/memory/readonly.d.ts.map +1 -0
  2535. package/dist/agent/memory/readonly.js +46 -0
  2536. package/dist/agent/memory/readonly.js.map +1 -0
  2537. package/dist/agent/memory/resolve.d.ts +49 -0
  2538. package/dist/agent/memory/resolve.d.ts.map +1 -0
  2539. package/dist/agent/memory/resolve.js +136 -0
  2540. package/dist/agent/memory/resolve.js.map +1 -0
  2541. package/dist/agent/memory/root-fence.d.ts +24 -0
  2542. package/dist/agent/memory/root-fence.d.ts.map +1 -0
  2543. package/dist/agent/memory/root-fence.js +46 -0
  2544. package/dist/agent/memory/root-fence.js.map +1 -0
  2545. package/dist/agent/memory/sandbox-sync.d.ts +17 -0
  2546. package/dist/agent/memory/sandbox-sync.d.ts.map +1 -0
  2547. package/dist/agent/memory/sandbox-sync.js +61 -0
  2548. package/dist/agent/memory/sandbox-sync.js.map +1 -0
  2549. package/dist/agent/memory/selection.d.ts +29 -0
  2550. package/dist/agent/memory/selection.d.ts.map +1 -0
  2551. package/dist/agent/memory/selection.js +82 -0
  2552. package/dist/agent/memory/selection.js.map +1 -0
  2553. package/dist/agent/memory/silo.d.ts +39 -0
  2554. package/dist/agent/memory/silo.d.ts.map +1 -0
  2555. package/dist/agent/memory/silo.js +36 -0
  2556. package/dist/agent/memory/silo.js.map +1 -0
  2557. package/dist/agent/memory/sqlite.d.ts +4 -0
  2558. package/dist/agent/memory/sqlite.d.ts.map +1 -0
  2559. package/dist/agent/memory/sqlite.js +196 -0
  2560. package/dist/agent/memory/sqlite.js.map +1 -0
  2561. package/dist/agent/memory/store.d.ts +36 -0
  2562. package/dist/agent/memory/store.d.ts.map +1 -0
  2563. package/dist/agent/memory/store.js +144 -0
  2564. package/dist/agent/memory/store.js.map +1 -0
  2565. package/dist/agent/memory/sync-timing.d.ts +83 -0
  2566. package/dist/agent/memory/sync-timing.d.ts.map +1 -0
  2567. package/dist/agent/memory/sync-timing.js +166 -0
  2568. package/dist/agent/memory/sync-timing.js.map +1 -0
  2569. package/dist/agent/memory/wake-delta.d.ts +96 -0
  2570. package/dist/agent/memory/wake-delta.d.ts.map +1 -0
  2571. package/dist/agent/memory/wake-delta.js +176 -0
  2572. package/dist/agent/memory/wake-delta.js.map +1 -0
  2573. package/dist/agent/memory/write-evidence.d.ts +30 -0
  2574. package/dist/agent/memory/write-evidence.d.ts.map +1 -0
  2575. package/dist/agent/memory/write-evidence.js +137 -0
  2576. package/dist/agent/memory/write-evidence.js.map +1 -0
  2577. package/dist/agent/memory/write-fence.d.ts +30 -0
  2578. package/dist/agent/memory/write-fence.d.ts.map +1 -0
  2579. package/dist/agent/memory/write-fence.js +123 -0
  2580. package/dist/agent/memory/write-fence.js.map +1 -0
  2581. package/dist/agent/memory/write-intent.d.ts +72 -0
  2582. package/dist/agent/memory/write-intent.d.ts.map +1 -0
  2583. package/dist/agent/memory/write-intent.js +197 -0
  2584. package/dist/agent/memory/write-intent.js.map +1 -0
  2585. package/dist/agent/memory/write-road.d.ts +60 -0
  2586. package/dist/agent/memory/write-road.d.ts.map +1 -0
  2587. package/dist/agent/memory/write-road.js +96 -0
  2588. package/dist/agent/memory/write-road.js.map +1 -0
  2589. package/dist/agent/model/ab-test.d.ts +132 -0
  2590. package/dist/agent/model/ab-test.d.ts.map +1 -0
  2591. package/dist/agent/model/ab-test.js +321 -0
  2592. package/dist/agent/model/ab-test.js.map +1 -0
  2593. package/dist/agent/model/call-capture.d.ts +140 -0
  2594. package/dist/agent/model/call-capture.d.ts.map +1 -0
  2595. package/dist/agent/model/call-capture.js +374 -0
  2596. package/dist/agent/model/call-capture.js.map +1 -0
  2597. package/dist/agent/model/default-model.d.ts +13 -0
  2598. package/dist/agent/model/default-model.d.ts.map +1 -0
  2599. package/dist/agent/model/default-model.js +58 -0
  2600. package/dist/agent/model/default-model.js.map +1 -0
  2601. package/dist/agent/model/model-stamp.d.ts +41 -0
  2602. package/dist/agent/model/model-stamp.d.ts.map +1 -0
  2603. package/dist/agent/model/model-stamp.js +160 -0
  2604. package/dist/agent/model/model-stamp.js.map +1 -0
  2605. package/dist/agent/model/policy.d.ts +150 -0
  2606. package/dist/agent/model/policy.d.ts.map +1 -0
  2607. package/dist/agent/model/policy.js +309 -0
  2608. package/dist/agent/model/policy.js.map +1 -0
  2609. package/dist/agent/model/routing.d.ts +210 -0
  2610. package/dist/agent/model/routing.d.ts.map +1 -0
  2611. package/dist/agent/model/routing.js +694 -0
  2612. package/dist/agent/model/routing.js.map +1 -0
  2613. package/dist/agent/model/step-boundary.d.ts +163 -0
  2614. package/dist/agent/model/step-boundary.d.ts.map +1 -0
  2615. package/dist/agent/model/step-boundary.js +491 -0
  2616. package/dist/agent/model/step-boundary.js.map +1 -0
  2617. package/dist/agent/model/stream-drop-retry.d.ts +24 -0
  2618. package/dist/agent/model/stream-drop-retry.d.ts.map +1 -0
  2619. package/dist/agent/model/stream-drop-retry.js +316 -0
  2620. package/dist/agent/model/stream-drop-retry.js.map +1 -0
  2621. package/dist/agent/model/turn-closeout.d.ts +61 -0
  2622. package/dist/agent/model/turn-closeout.d.ts.map +1 -0
  2623. package/dist/agent/model/turn-closeout.js +289 -0
  2624. package/dist/agent/model/turn-closeout.js.map +1 -0
  2625. package/dist/agent/model/turn-state.d.ts +119 -0
  2626. package/dist/agent/model/turn-state.d.ts.map +1 -0
  2627. package/dist/agent/model/turn-state.js +423 -0
  2628. package/dist/agent/model/turn-state.js.map +1 -0
  2629. package/dist/agent/model/vision.d.ts +75 -0
  2630. package/dist/agent/model/vision.d.ts.map +1 -0
  2631. package/dist/agent/model/vision.js +39 -0
  2632. package/dist/agent/model/vision.js.map +1 -0
  2633. package/dist/agent/observability/ship.d.ts +87 -0
  2634. package/dist/agent/observability/ship.d.ts.map +1 -0
  2635. package/dist/agent/observability/ship.js +354 -0
  2636. package/dist/agent/observability/ship.js.map +1 -0
  2637. package/dist/agent/observability/telemetry.d.ts +154 -0
  2638. package/dist/agent/observability/telemetry.d.ts.map +1 -0
  2639. package/dist/agent/observability/telemetry.js +764 -0
  2640. package/dist/agent/observability/telemetry.js.map +1 -0
  2641. package/dist/agent/observability/turn-clock.d.ts +41 -0
  2642. package/dist/agent/observability/turn-clock.d.ts.map +1 -0
  2643. package/dist/agent/observability/turn-clock.js +75 -0
  2644. package/dist/agent/observability/turn-clock.js.map +1 -0
  2645. package/dist/agent/onboarding/onboarding.d.ts +30 -0
  2646. package/dist/agent/onboarding/onboarding.d.ts.map +1 -0
  2647. package/dist/agent/onboarding/onboarding.js +94 -0
  2648. package/dist/agent/onboarding/onboarding.js.map +1 -0
  2649. package/dist/agent/operational/credential-grant-rows.d.ts +626 -0
  2650. package/dist/agent/operational/credential-grant-rows.d.ts.map +1 -0
  2651. package/dist/agent/operational/credential-grant-rows.js +634 -0
  2652. package/dist/agent/operational/credential-grant-rows.js.map +1 -0
  2653. package/dist/agent/operational/pglite-client.d.ts +81 -0
  2654. package/dist/agent/operational/pglite-client.d.ts.map +1 -0
  2655. package/dist/agent/operational/pglite-client.js +255 -0
  2656. package/dist/agent/operational/pglite-client.js.map +1 -0
  2657. package/dist/agent/operational/post-once.d.ts +74 -0
  2658. package/dist/agent/operational/post-once.d.ts.map +1 -0
  2659. package/dist/agent/operational/post-once.js +92 -0
  2660. package/dist/agent/operational/post-once.js.map +1 -0
  2661. package/dist/agent/operational/postgres.d.ts +55 -0
  2662. package/dist/agent/operational/postgres.d.ts.map +1 -0
  2663. package/dist/agent/operational/postgres.js +4052 -0
  2664. package/dist/agent/operational/postgres.js.map +1 -0
  2665. package/dist/agent/operational/provider.d.ts +52 -0
  2666. package/dist/agent/operational/provider.d.ts.map +1 -0
  2667. package/dist/agent/operational/provider.js +166 -0
  2668. package/dist/agent/operational/provider.js.map +1 -0
  2669. package/dist/agent/operational/sqlite.d.ts +21 -0
  2670. package/dist/agent/operational/sqlite.d.ts.map +1 -0
  2671. package/dist/agent/operational/sqlite.js +3170 -0
  2672. package/dist/agent/operational/sqlite.js.map +1 -0
  2673. package/dist/agent/operational/store.d.ts +1953 -0
  2674. package/dist/agent/operational/store.d.ts.map +1 -0
  2675. package/dist/agent/operational/store.js +302 -0
  2676. package/dist/agent/operational/store.js.map +1 -0
  2677. package/dist/agent/ops/census.d.ts +411 -0
  2678. package/dist/agent/ops/census.d.ts.map +1 -0
  2679. package/dist/agent/ops/census.js +701 -0
  2680. package/dist/agent/ops/census.js.map +1 -0
  2681. package/dist/agent/ops/probes.d.ts +20 -0
  2682. package/dist/agent/ops/probes.d.ts.map +1 -0
  2683. package/dist/agent/ops/probes.js +59 -0
  2684. package/dist/agent/ops/probes.js.map +1 -0
  2685. package/dist/agent/ops/quickstart.d.ts +53 -0
  2686. package/dist/agent/ops/quickstart.d.ts.map +1 -0
  2687. package/dist/agent/ops/quickstart.js +247 -0
  2688. package/dist/agent/ops/quickstart.js.map +1 -0
  2689. package/dist/agent/ops/server.d.ts +16 -0
  2690. package/dist/agent/ops/server.d.ts.map +1 -0
  2691. package/dist/agent/ops/server.js +414 -0
  2692. package/dist/agent/ops/server.js.map +1 -0
  2693. package/dist/agent/ops/surface-manifest.d.ts +60 -0
  2694. package/dist/agent/ops/surface-manifest.d.ts.map +1 -0
  2695. package/dist/agent/ops/surface-manifest.js +79 -0
  2696. package/dist/agent/ops/surface-manifest.js.map +1 -0
  2697. package/dist/agent/ops/two-role.d.ts +26 -0
  2698. package/dist/agent/ops/two-role.d.ts.map +1 -0
  2699. package/dist/agent/ops/two-role.js +71 -0
  2700. package/dist/agent/ops/two-role.js.map +1 -0
  2701. package/dist/agent/pages/policy-pages.d.ts +14 -0
  2702. package/dist/agent/pages/policy-pages.d.ts.map +1 -0
  2703. package/dist/agent/pages/policy-pages.js +69 -0
  2704. package/dist/agent/pages/policy-pages.js.map +1 -0
  2705. package/dist/agent/plugins/extract.d.ts +31 -0
  2706. package/dist/agent/plugins/extract.d.ts.map +1 -0
  2707. package/dist/agent/plugins/extract.js +328 -0
  2708. package/dist/agent/plugins/extract.js.map +1 -0
  2709. package/dist/agent/plugins/parse.d.ts +3 -0
  2710. package/dist/agent/plugins/parse.d.ts.map +1 -0
  2711. package/dist/agent/plugins/parse.js +112 -0
  2712. package/dist/agent/plugins/parse.js.map +1 -0
  2713. package/dist/agent/plugins/types.d.ts +105 -0
  2714. package/dist/agent/plugins/types.d.ts.map +1 -0
  2715. package/dist/agent/plugins/types.js +30 -0
  2716. package/dist/agent/plugins/types.js.map +1 -0
  2717. package/dist/agent/publish/eve-patch-pack.d.ts +210 -0
  2718. package/dist/agent/publish/eve-patch-pack.d.ts.map +1 -0
  2719. package/dist/agent/publish/eve-patch-pack.js +377 -0
  2720. package/dist/agent/publish/eve-patch-pack.js.map +1 -0
  2721. package/dist/agent/review/blast-radius.d.ts +83 -0
  2722. package/dist/agent/review/blast-radius.d.ts.map +1 -0
  2723. package/dist/agent/review/blast-radius.js +224 -0
  2724. package/dist/agent/review/blast-radius.js.map +1 -0
  2725. package/dist/agent/review/config-facts.d.ts +69 -0
  2726. package/dist/agent/review/config-facts.d.ts.map +1 -0
  2727. package/dist/agent/review/config-facts.js +155 -0
  2728. package/dist/agent/review/config-facts.js.map +1 -0
  2729. package/dist/agent/review/facts-artifact.d.ts +108 -0
  2730. package/dist/agent/review/facts-artifact.d.ts.map +1 -0
  2731. package/dist/agent/review/facts-artifact.js +288 -0
  2732. package/dist/agent/review/facts-artifact.js.map +1 -0
  2733. package/dist/agent/review/facts-cloud-status.d.ts +90 -0
  2734. package/dist/agent/review/facts-cloud-status.d.ts.map +1 -0
  2735. package/dist/agent/review/facts-cloud-status.js +226 -0
  2736. package/dist/agent/review/facts-cloud-status.js.map +1 -0
  2737. package/dist/agent/review/pr-walkthrough.d.ts +134 -0
  2738. package/dist/agent/review/pr-walkthrough.d.ts.map +1 -0
  2739. package/dist/agent/review/pr-walkthrough.js +641 -0
  2740. package/dist/agent/review/pr-walkthrough.js.map +1 -0
  2741. package/dist/agent/review/zip.d.ts +26 -0
  2742. package/dist/agent/review/zip.d.ts.map +1 -0
  2743. package/dist/agent/review/zip.js +147 -0
  2744. package/dist/agent/review/zip.js.map +1 -0
  2745. package/dist/agent/roles/role.d.ts +95 -0
  2746. package/dist/agent/roles/role.d.ts.map +1 -0
  2747. package/dist/agent/roles/role.js +188 -0
  2748. package/dist/agent/roles/role.js.map +1 -0
  2749. package/dist/agent/routines/bound.d.ts +90 -0
  2750. package/dist/agent/routines/bound.d.ts.map +1 -0
  2751. package/dist/agent/routines/bound.js +233 -0
  2752. package/dist/agent/routines/bound.js.map +1 -0
  2753. package/dist/agent/routines/check-in.d.ts +10 -0
  2754. package/dist/agent/routines/check-in.d.ts.map +1 -0
  2755. package/dist/agent/routines/check-in.js +50 -0
  2756. package/dist/agent/routines/check-in.js.map +1 -0
  2757. package/dist/agent/routines/collector.d.ts +214 -0
  2758. package/dist/agent/routines/collector.d.ts.map +1 -0
  2759. package/dist/agent/routines/collector.js +389 -0
  2760. package/dist/agent/routines/collector.js.map +1 -0
  2761. package/dist/agent/routines/declared-permissions.d.ts +302 -0
  2762. package/dist/agent/routines/declared-permissions.d.ts.map +1 -0
  2763. package/dist/agent/routines/declared-permissions.js +548 -0
  2764. package/dist/agent/routines/declared-permissions.js.map +1 -0
  2765. package/dist/agent/routines/disable-notice.d.ts +75 -0
  2766. package/dist/agent/routines/disable-notice.d.ts.map +1 -0
  2767. package/dist/agent/routines/disable-notice.js +152 -0
  2768. package/dist/agent/routines/disable-notice.js.map +1 -0
  2769. package/dist/agent/routines/entity-read.d.ts +177 -0
  2770. package/dist/agent/routines/entity-read.d.ts.map +1 -0
  2771. package/dist/agent/routines/entity-read.js +178 -0
  2772. package/dist/agent/routines/entity-read.js.map +1 -0
  2773. package/dist/agent/routines/event-authz.d.ts +76 -0
  2774. package/dist/agent/routines/event-authz.d.ts.map +1 -0
  2775. package/dist/agent/routines/event-authz.js +229 -0
  2776. package/dist/agent/routines/event-authz.js.map +1 -0
  2777. package/dist/agent/routines/event-match.d.ts +50 -0
  2778. package/dist/agent/routines/event-match.d.ts.map +1 -0
  2779. package/dist/agent/routines/event-match.js +190 -0
  2780. package/dist/agent/routines/event-match.js.map +1 -0
  2781. package/dist/agent/routines/event-model.d.ts +463 -0
  2782. package/dist/agent/routines/event-model.d.ts.map +1 -0
  2783. package/dist/agent/routines/event-model.js +367 -0
  2784. package/dist/agent/routines/event-model.js.map +1 -0
  2785. package/dist/agent/routines/events.d.ts +85 -0
  2786. package/dist/agent/routines/events.d.ts.map +1 -0
  2787. package/dist/agent/routines/events.js +167 -0
  2788. package/dist/agent/routines/events.js.map +1 -0
  2789. package/dist/agent/routines/fire-audit.d.ts +409 -0
  2790. package/dist/agent/routines/fire-audit.d.ts.map +1 -0
  2791. package/dist/agent/routines/fire-audit.js +571 -0
  2792. package/dist/agent/routines/fire-audit.js.map +1 -0
  2793. package/dist/agent/routines/fire-auth.d.ts +114 -0
  2794. package/dist/agent/routines/fire-auth.d.ts.map +1 -0
  2795. package/dist/agent/routines/fire-auth.js +254 -0
  2796. package/dist/agent/routines/fire-auth.js.map +1 -0
  2797. package/dist/agent/routines/fire-carriage.d.ts +37 -0
  2798. package/dist/agent/routines/fire-carriage.d.ts.map +1 -0
  2799. package/dist/agent/routines/fire-carriage.js +115 -0
  2800. package/dist/agent/routines/fire-carriage.js.map +1 -0
  2801. package/dist/agent/routines/fire-creator.d.ts +26 -0
  2802. package/dist/agent/routines/fire-creator.d.ts.map +1 -0
  2803. package/dist/agent/routines/fire-creator.js +78 -0
  2804. package/dist/agent/routines/fire-creator.js.map +1 -0
  2805. package/dist/agent/routines/fire-disclosure.d.ts +70 -0
  2806. package/dist/agent/routines/fire-disclosure.d.ts.map +1 -0
  2807. package/dist/agent/routines/fire-disclosure.js +193 -0
  2808. package/dist/agent/routines/fire-disclosure.js.map +1 -0
  2809. package/dist/agent/routines/fire-eligibility.d.ts +87 -0
  2810. package/dist/agent/routines/fire-eligibility.d.ts.map +1 -0
  2811. package/dist/agent/routines/fire-eligibility.js +220 -0
  2812. package/dist/agent/routines/fire-eligibility.js.map +1 -0
  2813. package/dist/agent/routines/fire-halt.d.ts +16 -0
  2814. package/dist/agent/routines/fire-halt.d.ts.map +1 -0
  2815. package/dist/agent/routines/fire-halt.js +49 -0
  2816. package/dist/agent/routines/fire-halt.js.map +1 -0
  2817. package/dist/agent/routines/fire-message.d.ts +31 -0
  2818. package/dist/agent/routines/fire-message.d.ts.map +1 -0
  2819. package/dist/agent/routines/fire-message.js +51 -0
  2820. package/dist/agent/routines/fire-message.js.map +1 -0
  2821. package/dist/agent/routines/fire-toolset.d.ts +94 -0
  2822. package/dist/agent/routines/fire-toolset.d.ts.map +1 -0
  2823. package/dist/agent/routines/fire-toolset.js +128 -0
  2824. package/dist/agent/routines/fire-toolset.js.map +1 -0
  2825. package/dist/agent/routines/fire-window.d.ts +230 -0
  2826. package/dist/agent/routines/fire-window.d.ts.map +1 -0
  2827. package/dist/agent/routines/fire-window.js +517 -0
  2828. package/dist/agent/routines/fire-window.js.map +1 -0
  2829. package/dist/agent/routines/follow-ups.d.ts +77 -0
  2830. package/dist/agent/routines/follow-ups.d.ts.map +1 -0
  2831. package/dist/agent/routines/follow-ups.js +134 -0
  2832. package/dist/agent/routines/follow-ups.js.map +1 -0
  2833. package/dist/agent/routines/gate.d.ts +133 -0
  2834. package/dist/agent/routines/gate.d.ts.map +1 -0
  2835. package/dist/agent/routines/gate.js +196 -0
  2836. package/dist/agent/routines/gate.js.map +1 -0
  2837. package/dist/agent/routines/github-entity-read.d.ts +26 -0
  2838. package/dist/agent/routines/github-entity-read.d.ts.map +1 -0
  2839. package/dist/agent/routines/github-entity-read.js +107 -0
  2840. package/dist/agent/routines/github-entity-read.js.map +1 -0
  2841. package/dist/agent/routines/github-fanout.d.ts +23 -0
  2842. package/dist/agent/routines/github-fanout.d.ts.map +1 -0
  2843. package/dist/agent/routines/github-fanout.js +67 -0
  2844. package/dist/agent/routines/github-fanout.js.map +1 -0
  2845. package/dist/agent/routines/github-normalizer.d.ts +20 -0
  2846. package/dist/agent/routines/github-normalizer.d.ts.map +1 -0
  2847. package/dist/agent/routines/github-normalizer.js +253 -0
  2848. package/dist/agent/routines/github-normalizer.js.map +1 -0
  2849. package/dist/agent/routines/ingress.d.ts +128 -0
  2850. package/dist/agent/routines/ingress.d.ts.map +1 -0
  2851. package/dist/agent/routines/ingress.js +703 -0
  2852. package/dist/agent/routines/ingress.js.map +1 -0
  2853. package/dist/agent/routines/job.d.ts +49 -0
  2854. package/dist/agent/routines/job.d.ts.map +1 -0
  2855. package/dist/agent/routines/job.js +122 -0
  2856. package/dist/agent/routines/job.js.map +1 -0
  2857. package/dist/agent/routines/jq-filter.d.ts +94 -0
  2858. package/dist/agent/routines/jq-filter.d.ts.map +1 -0
  2859. package/dist/agent/routines/jq-filter.js +322 -0
  2860. package/dist/agent/routines/jq-filter.js.map +1 -0
  2861. package/dist/agent/routines/lifecycle.d.ts +101 -0
  2862. package/dist/agent/routines/lifecycle.d.ts.map +1 -0
  2863. package/dist/agent/routines/lifecycle.js +231 -0
  2864. package/dist/agent/routines/lifecycle.js.map +1 -0
  2865. package/dist/agent/routines/match-stamp.d.ts +26 -0
  2866. package/dist/agent/routines/match-stamp.d.ts.map +1 -0
  2867. package/dist/agent/routines/match-stamp.js +121 -0
  2868. package/dist/agent/routines/match-stamp.js.map +1 -0
  2869. package/dist/agent/routines/outcome-fold.d.ts +115 -0
  2870. package/dist/agent/routines/outcome-fold.d.ts.map +1 -0
  2871. package/dist/agent/routines/outcome-fold.js +244 -0
  2872. package/dist/agent/routines/outcome-fold.js.map +1 -0
  2873. package/dist/agent/routines/partition.d.ts +5 -0
  2874. package/dist/agent/routines/partition.d.ts.map +1 -0
  2875. package/dist/agent/routines/partition.js +24 -0
  2876. package/dist/agent/routines/partition.js.map +1 -0
  2877. package/dist/agent/routines/permission-card-wait.d.ts +150 -0
  2878. package/dist/agent/routines/permission-card-wait.d.ts.map +1 -0
  2879. package/dist/agent/routines/permission-card-wait.js +213 -0
  2880. package/dist/agent/routines/permission-card-wait.js.map +1 -0
  2881. package/dist/agent/routines/permission-card.d.ts +196 -0
  2882. package/dist/agent/routines/permission-card.d.ts.map +1 -0
  2883. package/dist/agent/routines/permission-card.js +397 -0
  2884. package/dist/agent/routines/permission-card.js.map +1 -0
  2885. package/dist/agent/routines/permission-key.d.ts +25 -0
  2886. package/dist/agent/routines/permission-key.d.ts.map +1 -0
  2887. package/dist/agent/routines/permission-key.js +53 -0
  2888. package/dist/agent/routines/permission-key.js.map +1 -0
  2889. package/dist/agent/routines/permission-review.d.ts +108 -0
  2890. package/dist/agent/routines/permission-review.d.ts.map +1 -0
  2891. package/dist/agent/routines/permission-review.js +215 -0
  2892. package/dist/agent/routines/permission-review.js.map +1 -0
  2893. package/dist/agent/routines/policy.d.ts +146 -0
  2894. package/dist/agent/routines/policy.d.ts.map +1 -0
  2895. package/dist/agent/routines/policy.js +241 -0
  2896. package/dist/agent/routines/policy.js.map +1 -0
  2897. package/dist/agent/routines/pre-fire.d.ts +46 -0
  2898. package/dist/agent/routines/pre-fire.d.ts.map +1 -0
  2899. package/dist/agent/routines/pre-fire.js +111 -0
  2900. package/dist/agent/routines/pre-fire.js.map +1 -0
  2901. package/dist/agent/routines/provider-events.d.ts +115 -0
  2902. package/dist/agent/routines/provider-events.d.ts.map +1 -0
  2903. package/dist/agent/routines/provider-events.js +307 -0
  2904. package/dist/agent/routines/provider-events.js.map +1 -0
  2905. package/dist/agent/routines/report.d.ts +33 -0
  2906. package/dist/agent/routines/report.d.ts.map +1 -0
  2907. package/dist/agent/routines/report.js +122 -0
  2908. package/dist/agent/routines/report.js.map +1 -0
  2909. package/dist/agent/routines/routine.d.ts +774 -0
  2910. package/dist/agent/routines/routine.d.ts.map +1 -0
  2911. package/dist/agent/routines/routine.js +385 -0
  2912. package/dist/agent/routines/routine.js.map +1 -0
  2913. package/dist/agent/routines/schedule.d.ts +70 -0
  2914. package/dist/agent/routines/schedule.d.ts.map +1 -0
  2915. package/dist/agent/routines/schedule.js +187 -0
  2916. package/dist/agent/routines/schedule.js.map +1 -0
  2917. package/dist/agent/routines/scheme-name.d.ts +43 -0
  2918. package/dist/agent/routines/scheme-name.d.ts.map +1 -0
  2919. package/dist/agent/routines/scheme-name.js +73 -0
  2920. package/dist/agent/routines/scheme-name.js.map +1 -0
  2921. package/dist/agent/routines/stall.d.ts +46 -0
  2922. package/dist/agent/routines/stall.d.ts.map +1 -0
  2923. package/dist/agent/routines/stall.js +143 -0
  2924. package/dist/agent/routines/stall.js.map +1 -0
  2925. package/dist/agent/routines/store.d.ts +47 -0
  2926. package/dist/agent/routines/store.d.ts.map +1 -0
  2927. package/dist/agent/routines/store.js +82 -0
  2928. package/dist/agent/routines/store.js.map +1 -0
  2929. package/dist/agent/routines/watch.d.ts +134 -0
  2930. package/dist/agent/routines/watch.d.ts.map +1 -0
  2931. package/dist/agent/routines/watch.js +266 -0
  2932. package/dist/agent/routines/watch.js.map +1 -0
  2933. package/dist/agent/sandbox/backend-select.d.ts +19 -0
  2934. package/dist/agent/sandbox/backend-select.d.ts.map +1 -0
  2935. package/dist/agent/sandbox/backend-select.js +46 -0
  2936. package/dist/agent/sandbox/backend-select.js.map +1 -0
  2937. package/dist/agent/sandbox/vercel-create.d.ts +99 -0
  2938. package/dist/agent/sandbox/vercel-create.d.ts.map +1 -0
  2939. package/dist/agent/sandbox/vercel-create.js +151 -0
  2940. package/dist/agent/sandbox/vercel-create.js.map +1 -0
  2941. package/dist/agent/scaffold/app-root.d.ts +18 -0
  2942. package/dist/agent/scaffold/app-root.d.ts.map +1 -0
  2943. package/dist/agent/scaffold/app-root.js +97 -0
  2944. package/dist/agent/scaffold/app-root.js.map +1 -0
  2945. package/dist/agent/scaffold/roster-config.d.ts +130 -0
  2946. package/dist/agent/scaffold/roster-config.d.ts.map +1 -0
  2947. package/dist/agent/scaffold/roster-config.js +46 -0
  2948. package/dist/agent/scaffold/roster-config.js.map +1 -0
  2949. package/dist/agent/scaffold/roster-fs.d.ts +45 -0
  2950. package/dist/agent/scaffold/roster-fs.d.ts.map +1 -0
  2951. package/dist/agent/scaffold/roster-fs.js +195 -0
  2952. package/dist/agent/scaffold/roster-fs.js.map +1 -0
  2953. package/dist/agent/scaffold/roster-plan.d.ts +167 -0
  2954. package/dist/agent/scaffold/roster-plan.d.ts.map +1 -0
  2955. package/dist/agent/scaffold/roster-plan.js +668 -0
  2956. package/dist/agent/scaffold/roster-plan.js.map +1 -0
  2957. package/dist/agent/scaffold/templates.d.ts +13 -0
  2958. package/dist/agent/scaffold/templates.d.ts.map +1 -0
  2959. package/dist/agent/scaffold/templates.js +73 -0
  2960. package/dist/agent/scaffold/templates.js.map +1 -0
  2961. package/dist/agent/scaffold/tool-roster-read.d.ts +24 -0
  2962. package/dist/agent/scaffold/tool-roster-read.d.ts.map +1 -0
  2963. package/dist/agent/scaffold/tool-roster-read.js +68 -0
  2964. package/dist/agent/scaffold/tool-roster-read.js.map +1 -0
  2965. package/dist/agent/scaffold/tool-roster.d.ts +90 -0
  2966. package/dist/agent/scaffold/tool-roster.d.ts.map +1 -0
  2967. package/dist/agent/scaffold/tool-roster.js +128 -0
  2968. package/dist/agent/scaffold/tool-roster.js.map +1 -0
  2969. package/dist/agent/schedules/directory-sync.d.ts +6 -0
  2970. package/dist/agent/schedules/directory-sync.d.ts.map +1 -0
  2971. package/dist/agent/schedules/directory-sync.js +36 -0
  2972. package/dist/agent/schedules/directory-sync.js.map +1 -0
  2973. package/dist/agent/schedules/dispatch.d.ts +34 -0
  2974. package/dist/agent/schedules/dispatch.d.ts.map +1 -0
  2975. package/dist/agent/schedules/dispatch.js +749 -0
  2976. package/dist/agent/schedules/dispatch.js.map +1 -0
  2977. package/dist/agent/schedules/dream-mode3.d.ts +28 -0
  2978. package/dist/agent/schedules/dream-mode3.d.ts.map +1 -0
  2979. package/dist/agent/schedules/dream-mode3.js +261 -0
  2980. package/dist/agent/schedules/dream-mode3.js.map +1 -0
  2981. package/dist/agent/schedules/routine-dispatch.d.ts +125 -0
  2982. package/dist/agent/schedules/routine-dispatch.d.ts.map +1 -0
  2983. package/dist/agent/schedules/routine-dispatch.js +139 -0
  2984. package/dist/agent/schedules/routine-dispatch.js.map +1 -0
  2985. package/dist/agent/schedules/tidy.d.ts +39 -0
  2986. package/dist/agent/schedules/tidy.d.ts.map +1 -0
  2987. package/dist/agent/schedules/tidy.js +292 -0
  2988. package/dist/agent/schedules/tidy.js.map +1 -0
  2989. package/dist/agent/scm/app.d.ts +55 -0
  2990. package/dist/agent/scm/app.d.ts.map +1 -0
  2991. package/dist/agent/scm/app.js +120 -0
  2992. package/dist/agent/scm/app.js.map +1 -0
  2993. package/dist/agent/scm/broker-audit.d.ts +35 -0
  2994. package/dist/agent/scm/broker-audit.d.ts.map +1 -0
  2995. package/dist/agent/scm/broker-audit.js +94 -0
  2996. package/dist/agent/scm/broker-audit.js.map +1 -0
  2997. package/dist/agent/scm/broker.d.ts +56 -0
  2998. package/dist/agent/scm/broker.d.ts.map +1 -0
  2999. package/dist/agent/scm/broker.js +113 -0
  3000. package/dist/agent/scm/broker.js.map +1 -0
  3001. package/dist/agent/scm/capability-fit.d.ts +59 -0
  3002. package/dist/agent/scm/capability-fit.d.ts.map +1 -0
  3003. package/dist/agent/scm/capability-fit.js +122 -0
  3004. package/dist/agent/scm/capability-fit.js.map +1 -0
  3005. package/dist/agent/scm/config-repo-token.d.ts +3 -0
  3006. package/dist/agent/scm/config-repo-token.d.ts.map +1 -0
  3007. package/dist/agent/scm/config-repo-token.js +43 -0
  3008. package/dist/agent/scm/config-repo-token.js.map +1 -0
  3009. package/dist/agent/scm/config.d.ts +3 -0
  3010. package/dist/agent/scm/config.d.ts.map +1 -0
  3011. package/dist/agent/scm/config.js +36 -0
  3012. package/dist/agent/scm/config.js.map +1 -0
  3013. package/dist/agent/scm/contents.d.ts +54 -0
  3014. package/dist/agent/scm/contents.d.ts.map +1 -0
  3015. package/dist/agent/scm/contents.js +117 -0
  3016. package/dist/agent/scm/contents.js.map +1 -0
  3017. package/dist/agent/scm/git.d.ts +157 -0
  3018. package/dist/agent/scm/git.d.ts.map +1 -0
  3019. package/dist/agent/scm/git.js +318 -0
  3020. package/dist/agent/scm/git.js.map +1 -0
  3021. package/dist/agent/scm/github-acting-identity.d.ts +38 -0
  3022. package/dist/agent/scm/github-acting-identity.d.ts.map +1 -0
  3023. package/dist/agent/scm/github-acting-identity.js +121 -0
  3024. package/dist/agent/scm/github-acting-identity.js.map +1 -0
  3025. package/dist/agent/scm/github-search.d.ts +23 -0
  3026. package/dist/agent/scm/github-search.d.ts.map +1 -0
  3027. package/dist/agent/scm/github-search.js +122 -0
  3028. package/dist/agent/scm/github-search.js.map +1 -0
  3029. package/dist/agent/scm/github-work.d.ts +17 -0
  3030. package/dist/agent/scm/github-work.d.ts.map +1 -0
  3031. package/dist/agent/scm/github-work.js +43 -0
  3032. package/dist/agent/scm/github-work.js.map +1 -0
  3033. package/dist/agent/scm/installations.d.ts +46 -0
  3034. package/dist/agent/scm/installations.d.ts.map +1 -0
  3035. package/dist/agent/scm/installations.js +144 -0
  3036. package/dist/agent/scm/installations.js.map +1 -0
  3037. package/dist/agent/scm/issue-actions.d.ts +41 -0
  3038. package/dist/agent/scm/issue-actions.d.ts.map +1 -0
  3039. package/dist/agent/scm/issue-actions.js +173 -0
  3040. package/dist/agent/scm/issue-actions.js.map +1 -0
  3041. package/dist/agent/scm/mint.d.ts +76 -0
  3042. package/dist/agent/scm/mint.d.ts.map +1 -0
  3043. package/dist/agent/scm/mint.js +253 -0
  3044. package/dist/agent/scm/mint.js.map +1 -0
  3045. package/dist/agent/scm/pr-activity.d.ts +50 -0
  3046. package/dist/agent/scm/pr-activity.d.ts.map +1 -0
  3047. package/dist/agent/scm/pr-activity.js +102 -0
  3048. package/dist/agent/scm/pr-activity.js.map +1 -0
  3049. package/dist/agent/scm/pr-diff.d.ts +61 -0
  3050. package/dist/agent/scm/pr-diff.d.ts.map +1 -0
  3051. package/dist/agent/scm/pr-diff.js +104 -0
  3052. package/dist/agent/scm/pr-diff.js.map +1 -0
  3053. package/dist/agent/scm/pr-feedback.d.ts +87 -0
  3054. package/dist/agent/scm/pr-feedback.d.ts.map +1 -0
  3055. package/dist/agent/scm/pr-feedback.js +230 -0
  3056. package/dist/agent/scm/pr-feedback.js.map +1 -0
  3057. package/dist/agent/scm/pr-status.d.ts +120 -0
  3058. package/dist/agent/scm/pr-status.d.ts.map +1 -0
  3059. package/dist/agent/scm/pr-status.js +199 -0
  3060. package/dist/agent/scm/pr-status.js.map +1 -0
  3061. package/dist/agent/scm/pr-watch.d.ts +26 -0
  3062. package/dist/agent/scm/pr-watch.d.ts.map +1 -0
  3063. package/dist/agent/scm/pr-watch.js +165 -0
  3064. package/dist/agent/scm/pr-watch.js.map +1 -0
  3065. package/dist/agent/scm/pr.d.ts +42 -0
  3066. package/dist/agent/scm/pr.d.ts.map +1 -0
  3067. package/dist/agent/scm/pr.js +73 -0
  3068. package/dist/agent/scm/pr.js.map +1 -0
  3069. package/dist/agent/scm/provider.d.ts +13 -0
  3070. package/dist/agent/scm/provider.d.ts.map +1 -0
  3071. package/dist/agent/scm/provider.js +39 -0
  3072. package/dist/agent/scm/provider.js.map +1 -0
  3073. package/dist/agent/scm/refs.d.ts +65 -0
  3074. package/dist/agent/scm/refs.d.ts.map +1 -0
  3075. package/dist/agent/scm/refs.js +89 -0
  3076. package/dist/agent/scm/refs.js.map +1 -0
  3077. package/dist/agent/scm/repo-skills.d.ts +69 -0
  3078. package/dist/agent/scm/repo-skills.d.ts.map +1 -0
  3079. package/dist/agent/scm/repo-skills.js +170 -0
  3080. package/dist/agent/scm/repo-skills.js.map +1 -0
  3081. package/dist/agent/scm/types.d.ts +40 -0
  3082. package/dist/agent/scm/types.d.ts.map +1 -0
  3083. package/dist/agent/scm/types.js +9 -0
  3084. package/dist/agent/scm/types.js.map +1 -0
  3085. package/dist/agent/scm/write-token.d.ts +10 -0
  3086. package/dist/agent/scm/write-token.d.ts.map +1 -0
  3087. package/dist/agent/scm/write-token.js +40 -0
  3088. package/dist/agent/scm/write-token.js.map +1 -0
  3089. package/dist/agent/settings/settings.d.ts +935 -0
  3090. package/dist/agent/settings/settings.d.ts.map +1 -0
  3091. package/dist/agent/settings/settings.js +1104 -0
  3092. package/dist/agent/settings/settings.js.map +1 -0
  3093. package/dist/agent/skills/domain-skills.d.ts +61 -0
  3094. package/dist/agent/skills/domain-skills.d.ts.map +1 -0
  3095. package/dist/agent/skills/domain-skills.js +174 -0
  3096. package/dist/agent/skills/domain-skills.js.map +1 -0
  3097. package/dist/agent/skills/scoped.d.ts +21 -0
  3098. package/dist/agent/skills/scoped.d.ts.map +1 -0
  3099. package/dist/agent/skills/scoped.js +152 -0
  3100. package/dist/agent/skills/scoped.js.map +1 -0
  3101. package/dist/agent/spend/bypass.d.ts +30 -0
  3102. package/dist/agent/spend/bypass.d.ts.map +1 -0
  3103. package/dist/agent/spend/bypass.js +117 -0
  3104. package/dist/agent/spend/bypass.js.map +1 -0
  3105. package/dist/agent/spend/caps.d.ts +173 -0
  3106. package/dist/agent/spend/caps.d.ts.map +1 -0
  3107. package/dist/agent/spend/caps.js +323 -0
  3108. package/dist/agent/spend/caps.js.map +1 -0
  3109. package/dist/agent/spend/check.d.ts +54 -0
  3110. package/dist/agent/spend/check.d.ts.map +1 -0
  3111. package/dist/agent/spend/check.js +157 -0
  3112. package/dist/agent/spend/check.js.map +1 -0
  3113. package/dist/agent/spend/checkpoint.d.ts +158 -0
  3114. package/dist/agent/spend/checkpoint.d.ts.map +1 -0
  3115. package/dist/agent/spend/checkpoint.js +559 -0
  3116. package/dist/agent/spend/checkpoint.js.map +1 -0
  3117. package/dist/agent/spend/dm-mask.d.ts +61 -0
  3118. package/dist/agent/spend/dm-mask.d.ts.map +1 -0
  3119. package/dist/agent/spend/dm-mask.js +113 -0
  3120. package/dist/agent/spend/dm-mask.js.map +1 -0
  3121. package/dist/agent/spend/ingress-gate.d.ts +143 -0
  3122. package/dist/agent/spend/ingress-gate.d.ts.map +1 -0
  3123. package/dist/agent/spend/ingress-gate.js +217 -0
  3124. package/dist/agent/spend/ingress-gate.js.map +1 -0
  3125. package/dist/agent/spend/pricing.d.ts +251 -0
  3126. package/dist/agent/spend/pricing.d.ts.map +1 -0
  3127. package/dist/agent/spend/pricing.js +454 -0
  3128. package/dist/agent/spend/pricing.js.map +1 -0
  3129. package/dist/agent/spend/reporting.d.ts +313 -0
  3130. package/dist/agent/spend/reporting.d.ts.map +1 -0
  3131. package/dist/agent/spend/reporting.js +674 -0
  3132. package/dist/agent/spend/reporting.js.map +1 -0
  3133. package/dist/agent/spend/sandbox-pricing.d.ts +19 -0
  3134. package/dist/agent/spend/sandbox-pricing.d.ts.map +1 -0
  3135. package/dist/agent/spend/sandbox-pricing.js +50 -0
  3136. package/dist/agent/spend/sandbox-pricing.js.map +1 -0
  3137. package/dist/agent/spend/spend.d.ts +283 -0
  3138. package/dist/agent/spend/spend.d.ts.map +1 -0
  3139. package/dist/agent/spend/spend.js +255 -0
  3140. package/dist/agent/spend/spend.js.map +1 -0
  3141. package/dist/agent/spend/stack-pricing.d.ts +94 -0
  3142. package/dist/agent/spend/stack-pricing.d.ts.map +1 -0
  3143. package/dist/agent/spend/stack-pricing.js +123 -0
  3144. package/dist/agent/spend/stack-pricing.js.map +1 -0
  3145. package/dist/agent/spend/store.d.ts +139 -0
  3146. package/dist/agent/spend/store.d.ts.map +1 -0
  3147. package/dist/agent/spend/store.js +180 -0
  3148. package/dist/agent/spend/store.js.map +1 -0
  3149. package/dist/agent/spend/subagent-runs.d.ts +79 -0
  3150. package/dist/agent/spend/subagent-runs.d.ts.map +1 -0
  3151. package/dist/agent/spend/subagent-runs.js +124 -0
  3152. package/dist/agent/spend/subagent-runs.js.map +1 -0
  3153. package/dist/agent/spend/usage-events.d.ts +79 -0
  3154. package/dist/agent/spend/usage-events.d.ts.map +1 -0
  3155. package/dist/agent/spend/usage-events.js +132 -0
  3156. package/dist/agent/spend/usage-events.js.map +1 -0
  3157. package/dist/agent/stall/bash-hang-guard.d.ts +133 -0
  3158. package/dist/agent/stall/bash-hang-guard.d.ts.map +1 -0
  3159. package/dist/agent/stall/bash-hang-guard.js +303 -0
  3160. package/dist/agent/stall/bash-hang-guard.js.map +1 -0
  3161. package/dist/agent/stall/guard.d.ts +68 -0
  3162. package/dist/agent/stall/guard.d.ts.map +1 -0
  3163. package/dist/agent/stall/guard.js +248 -0
  3164. package/dist/agent/stall/guard.js.map +1 -0
  3165. package/dist/agent/status/status.d.ts +32 -0
  3166. package/dist/agent/status/status.d.ts.map +1 -0
  3167. package/dist/agent/status/status.js +116 -0
  3168. package/dist/agent/status/status.js.map +1 -0
  3169. package/dist/agent/subagents/contracts.d.ts +82 -0
  3170. package/dist/agent/subagents/contracts.d.ts.map +1 -0
  3171. package/dist/agent/subagents/contracts.js +114 -0
  3172. package/dist/agent/subagents/contracts.js.map +1 -0
  3173. package/dist/agent/subagents/declared.d.ts +44 -0
  3174. package/dist/agent/subagents/declared.d.ts.map +1 -0
  3175. package/dist/agent/subagents/declared.js +152 -0
  3176. package/dist/agent/subagents/declared.js.map +1 -0
  3177. package/dist/agent/testing/driver-allowlist.d.ts +103 -0
  3178. package/dist/agent/testing/driver-allowlist.d.ts.map +1 -0
  3179. package/dist/agent/testing/driver-allowlist.js +193 -0
  3180. package/dist/agent/testing/driver-allowlist.js.map +1 -0
  3181. package/dist/agent/tools/add_label.d.ts +52 -0
  3182. package/dist/agent/tools/add_label.d.ts.map +1 -0
  3183. package/dist/agent/tools/add_label.js +63 -0
  3184. package/dist/agent/tools/add_label.js.map +1 -0
  3185. package/dist/agent/tools/add_routine_rule.d.ts +38 -0
  3186. package/dist/agent/tools/add_routine_rule.d.ts.map +1 -0
  3187. package/dist/agent/tools/add_routine_rule.js +182 -0
  3188. package/dist/agent/tools/add_routine_rule.js.map +1 -0
  3189. package/dist/agent/tools/agent_version.d.ts +17 -0
  3190. package/dist/agent/tools/agent_version.d.ts.map +1 -0
  3191. package/dist/agent/tools/agent_version.js +38 -0
  3192. package/dist/agent/tools/agent_version.js.map +1 -0
  3193. package/dist/agent/tools/assign.d.ts +74 -0
  3194. package/dist/agent/tools/assign.d.ts.map +1 -0
  3195. package/dist/agent/tools/assign.js +167 -0
  3196. package/dist/agent/tools/assign.js.map +1 -0
  3197. package/dist/agent/tools/aws.d.ts +33 -0
  3198. package/dist/agent/tools/aws.d.ts.map +1 -0
  3199. package/dist/agent/tools/aws.js +164 -0
  3200. package/dist/agent/tools/aws.js.map +1 -0
  3201. package/dist/agent/tools/browser_tools.d.ts +3 -0
  3202. package/dist/agent/tools/browser_tools.d.ts.map +1 -0
  3203. package/dist/agent/tools/browser_tools.js +21 -0
  3204. package/dist/agent/tools/browser_tools.js.map +1 -0
  3205. package/dist/agent/tools/cancel_routine.d.ts +27 -0
  3206. package/dist/agent/tools/cancel_routine.d.ts.map +1 -0
  3207. package/dist/agent/tools/cancel_routine.js +123 -0
  3208. package/dist/agent/tools/cancel_routine.js.map +1 -0
  3209. package/dist/agent/tools/capture_events.d.ts +17 -0
  3210. package/dist/agent/tools/capture_events.d.ts.map +1 -0
  3211. package/dist/agent/tools/capture_events.js +51 -0
  3212. package/dist/agent/tools/capture_events.js.map +1 -0
  3213. package/dist/agent/tools/check_pr_status.d.ts +52 -0
  3214. package/dist/agent/tools/check_pr_status.d.ts.map +1 -0
  3215. package/dist/agent/tools/check_pr_status.js +66 -0
  3216. package/dist/agent/tools/check_pr_status.js.map +1 -0
  3217. package/dist/agent/tools/checkout_repo.d.ts +3 -0
  3218. package/dist/agent/tools/checkout_repo.d.ts.map +1 -0
  3219. package/dist/agent/tools/checkout_repo.js +158 -0
  3220. package/dist/agent/tools/checkout_repo.js.map +1 -0
  3221. package/dist/agent/tools/clear_connector_override.d.ts +48 -0
  3222. package/dist/agent/tools/clear_connector_override.d.ts.map +1 -0
  3223. package/dist/agent/tools/clear_connector_override.js +134 -0
  3224. package/dist/agent/tools/clear_connector_override.js.map +1 -0
  3225. package/dist/agent/tools/clear_spend_limit.d.ts +51 -0
  3226. package/dist/agent/tools/clear_spend_limit.d.ts.map +1 -0
  3227. package/dist/agent/tools/clear_spend_limit.js +162 -0
  3228. package/dist/agent/tools/clear_spend_limit.js.map +1 -0
  3229. package/dist/agent/tools/complete_job.d.ts +15 -0
  3230. package/dist/agent/tools/complete_job.d.ts.map +1 -0
  3231. package/dist/agent/tools/complete_job.js +59 -0
  3232. package/dist/agent/tools/complete_job.js.map +1 -0
  3233. package/dist/agent/tools/complete_thread.d.ts +8 -0
  3234. package/dist/agent/tools/complete_thread.d.ts.map +1 -0
  3235. package/dist/agent/tools/complete_thread.js +125 -0
  3236. package/dist/agent/tools/complete_thread.js.map +1 -0
  3237. package/dist/agent/tools/confirm_link.d.ts +84 -0
  3238. package/dist/agent/tools/confirm_link.d.ts.map +1 -0
  3239. package/dist/agent/tools/confirm_link.js +437 -0
  3240. package/dist/agent/tools/confirm_link.js.map +1 -0
  3241. package/dist/agent/tools/connector.d.ts +34 -0
  3242. package/dist/agent/tools/connector.d.ts.map +1 -0
  3243. package/dist/agent/tools/connector.js +212 -0
  3244. package/dist/agent/tools/connector.js.map +1 -0
  3245. package/dist/agent/tools/create_agent.d.ts +77 -0
  3246. package/dist/agent/tools/create_agent.d.ts.map +1 -0
  3247. package/dist/agent/tools/create_agent.js +261 -0
  3248. package/dist/agent/tools/create_agent.js.map +1 -0
  3249. package/dist/agent/tools/create_routine.d.ts +95 -0
  3250. package/dist/agent/tools/create_routine.d.ts.map +1 -0
  3251. package/dist/agent/tools/create_routine.js +437 -0
  3252. package/dist/agent/tools/create_routine.js.map +1 -0
  3253. package/dist/agent/tools/create_skill.d.ts +3 -0
  3254. package/dist/agent/tools/create_skill.d.ts.map +1 -0
  3255. package/dist/agent/tools/create_skill.js +157 -0
  3256. package/dist/agent/tools/create_skill.js.map +1 -0
  3257. package/dist/agent/tools/create_ticket.d.ts +70 -0
  3258. package/dist/agent/tools/create_ticket.d.ts.map +1 -0
  3259. package/dist/agent/tools/create_ticket.js +171 -0
  3260. package/dist/agent/tools/create_ticket.js.map +1 -0
  3261. package/dist/agent/tools/declare_webhook.d.ts +70 -0
  3262. package/dist/agent/tools/declare_webhook.d.ts.map +1 -0
  3263. package/dist/agent/tools/declare_webhook.js +321 -0
  3264. package/dist/agent/tools/declare_webhook.js.map +1 -0
  3265. package/dist/agent/tools/delete_skill.d.ts +3 -0
  3266. package/dist/agent/tools/delete_skill.d.ts.map +1 -0
  3267. package/dist/agent/tools/delete_skill.js +125 -0
  3268. package/dist/agent/tools/delete_skill.js.map +1 -0
  3269. package/dist/agent/tools/describe_image.d.ts +72 -0
  3270. package/dist/agent/tools/describe_image.d.ts.map +1 -0
  3271. package/dist/agent/tools/describe_image.js +269 -0
  3272. package/dist/agent/tools/describe_image.js.map +1 -0
  3273. package/dist/agent/tools/dm_person.d.ts +43 -0
  3274. package/dist/agent/tools/dm_person.d.ts.map +1 -0
  3275. package/dist/agent/tools/dm_person.js +190 -0
  3276. package/dist/agent/tools/dm_person.js.map +1 -0
  3277. package/dist/agent/tools/edit_reply.d.ts +56 -0
  3278. package/dist/agent/tools/edit_reply.d.ts.map +1 -0
  3279. package/dist/agent/tools/edit_reply.js +169 -0
  3280. package/dist/agent/tools/edit_reply.js.map +1 -0
  3281. package/dist/agent/tools/edit_routine.d.ts +32 -0
  3282. package/dist/agent/tools/edit_routine.d.ts.map +1 -0
  3283. package/dist/agent/tools/edit_routine.js +143 -0
  3284. package/dist/agent/tools/edit_routine.js.map +1 -0
  3285. package/dist/agent/tools/enable_routine.d.ts +30 -0
  3286. package/dist/agent/tools/enable_routine.d.ts.map +1 -0
  3287. package/dist/agent/tools/enable_routine.js +148 -0
  3288. package/dist/agent/tools/enable_routine.js.map +1 -0
  3289. package/dist/agent/tools/explain_permission.d.ts +27 -0
  3290. package/dist/agent/tools/explain_permission.d.ts.map +1 -0
  3291. package/dist/agent/tools/explain_permission.js +51 -0
  3292. package/dist/agent/tools/explain_permission.js.map +1 -0
  3293. package/dist/agent/tools/get_pr_feedback.d.ts +184 -0
  3294. package/dist/agent/tools/get_pr_feedback.d.ts.map +1 -0
  3295. package/dist/agent/tools/get_pr_feedback.js +77 -0
  3296. package/dist/agent/tools/get_pr_feedback.js.map +1 -0
  3297. package/dist/agent/tools/grant_tools.d.ts +27 -0
  3298. package/dist/agent/tools/grant_tools.d.ts.map +1 -0
  3299. package/dist/agent/tools/grant_tools.js +417 -0
  3300. package/dist/agent/tools/grant_tools.js.map +1 -0
  3301. package/dist/agent/tools/halt.d.ts +71 -0
  3302. package/dist/agent/tools/halt.d.ts.map +1 -0
  3303. package/dist/agent/tools/halt.js +157 -0
  3304. package/dist/agent/tools/halt.js.map +1 -0
  3305. package/dist/agent/tools/link_identity.d.ts +48 -0
  3306. package/dist/agent/tools/link_identity.d.ts.map +1 -0
  3307. package/dist/agent/tools/link_identity.js +283 -0
  3308. package/dist/agent/tools/link_identity.js.map +1 -0
  3309. package/dist/agent/tools/list_recent_events.d.ts +19 -0
  3310. package/dist/agent/tools/list_recent_events.d.ts.map +1 -0
  3311. package/dist/agent/tools/list_recent_events.js +55 -0
  3312. package/dist/agent/tools/list_recent_events.js.map +1 -0
  3313. package/dist/agent/tools/list_repos.d.ts +11 -0
  3314. package/dist/agent/tools/list_repos.d.ts.map +1 -0
  3315. package/dist/agent/tools/list_repos.js +22 -0
  3316. package/dist/agent/tools/list_repos.js.map +1 -0
  3317. package/dist/agent/tools/list_routines.d.ts +88 -0
  3318. package/dist/agent/tools/list_routines.d.ts.map +1 -0
  3319. package/dist/agent/tools/list_routines.js +143 -0
  3320. package/dist/agent/tools/list_routines.js.map +1 -0
  3321. package/dist/agent/tools/list_skills.d.ts +21 -0
  3322. package/dist/agent/tools/list_skills.d.ts.map +1 -0
  3323. package/dist/agent/tools/list_skills.js +34 -0
  3324. package/dist/agent/tools/list_skills.js.map +1 -0
  3325. package/dist/agent/tools/list_webhooks.d.ts +27 -0
  3326. package/dist/agent/tools/list_webhooks.d.ts.map +1 -0
  3327. package/dist/agent/tools/list_webhooks.js +66 -0
  3328. package/dist/agent/tools/list_webhooks.js.map +1 -0
  3329. package/dist/agent/tools/memory_admin_list.d.ts +10 -0
  3330. package/dist/agent/tools/memory_admin_list.d.ts.map +1 -0
  3331. package/dist/agent/tools/memory_admin_list.js +72 -0
  3332. package/dist/agent/tools/memory_admin_list.js.map +1 -0
  3333. package/dist/agent/tools/memory_admin_read.d.ts +17 -0
  3334. package/dist/agent/tools/memory_admin_read.d.ts.map +1 -0
  3335. package/dist/agent/tools/memory_admin_read.js +85 -0
  3336. package/dist/agent/tools/memory_admin_read.js.map +1 -0
  3337. package/dist/agent/tools/message_thread_seat.d.ts +7 -0
  3338. package/dist/agent/tools/message_thread_seat.d.ts.map +1 -0
  3339. package/dist/agent/tools/message_thread_seat.js +133 -0
  3340. package/dist/agent/tools/message_thread_seat.js.map +1 -0
  3341. package/dist/agent/tools/no_reply.d.ts +31 -0
  3342. package/dist/agent/tools/no_reply.d.ts.map +1 -0
  3343. package/dist/agent/tools/no_reply.js +251 -0
  3344. package/dist/agent/tools/no_reply.js.map +1 -0
  3345. package/dist/agent/tools/open_pull_request.d.ts +23 -0
  3346. package/dist/agent/tools/open_pull_request.d.ts.map +1 -0
  3347. package/dist/agent/tools/open_pull_request.js +323 -0
  3348. package/dist/agent/tools/open_pull_request.js.map +1 -0
  3349. package/dist/agent/tools/permission_fit_report.d.ts +63 -0
  3350. package/dist/agent/tools/permission_fit_report.d.ts.map +1 -0
  3351. package/dist/agent/tools/permission_fit_report.js +173 -0
  3352. package/dist/agent/tools/permission_fit_report.js.map +1 -0
  3353. package/dist/agent/tools/post_file.d.ts +7 -0
  3354. package/dist/agent/tools/post_file.d.ts.map +1 -0
  3355. package/dist/agent/tools/post_file.js +372 -0
  3356. package/dist/agent/tools/post_file.js.map +1 -0
  3357. package/dist/agent/tools/post_message.d.ts +32 -0
  3358. package/dist/agent/tools/post_message.d.ts.map +1 -0
  3359. package/dist/agent/tools/post_message.js +158 -0
  3360. package/dist/agent/tools/post_message.js.map +1 -0
  3361. package/dist/agent/tools/post_pr_walkthrough.d.ts +126 -0
  3362. package/dist/agent/tools/post_pr_walkthrough.d.ts.map +1 -0
  3363. package/dist/agent/tools/post_pr_walkthrough.js +200 -0
  3364. package/dist/agent/tools/post_pr_walkthrough.js.map +1 -0
  3365. package/dist/agent/tools/purge_memory.d.ts +105 -0
  3366. package/dist/agent/tools/purge_memory.d.ts.map +1 -0
  3367. package/dist/agent/tools/purge_memory.js +271 -0
  3368. package/dist/agent/tools/purge_memory.js.map +1 -0
  3369. package/dist/agent/tools/query_analytics.d.ts +59 -0
  3370. package/dist/agent/tools/query_analytics.d.ts.map +1 -0
  3371. package/dist/agent/tools/query_analytics.js +80 -0
  3372. package/dist/agent/tools/query_analytics.js.map +1 -0
  3373. package/dist/agent/tools/react.d.ts +23 -0
  3374. package/dist/agent/tools/react.d.ts.map +1 -0
  3375. package/dist/agent/tools/react.js +185 -0
  3376. package/dist/agent/tools/react.js.map +1 -0
  3377. package/dist/agent/tools/read_channel.d.ts +28 -0
  3378. package/dist/agent/tools/read_channel.d.ts.map +1 -0
  3379. package/dist/agent/tools/read_channel.js +118 -0
  3380. package/dist/agent/tools/read_channel.js.map +1 -0
  3381. package/dist/agent/tools/read_docs.d.ts +27 -0
  3382. package/dist/agent/tools/read_docs.d.ts.map +1 -0
  3383. package/dist/agent/tools/read_docs.js +43 -0
  3384. package/dist/agent/tools/read_docs.js.map +1 -0
  3385. package/dist/agent/tools/read_file_upload.d.ts +32 -0
  3386. package/dist/agent/tools/read_file_upload.d.ts.map +1 -0
  3387. package/dist/agent/tools/read_file_upload.js +175 -0
  3388. package/dist/agent/tools/read_file_upload.js.map +1 -0
  3389. package/dist/agent/tools/read_routine_transcript.d.ts +31 -0
  3390. package/dist/agent/tools/read_routine_transcript.d.ts.map +1 -0
  3391. package/dist/agent/tools/read_routine_transcript.js +79 -0
  3392. package/dist/agent/tools/read_routine_transcript.js.map +1 -0
  3393. package/dist/agent/tools/read_thread.d.ts +29 -0
  3394. package/dist/agent/tools/read_thread.d.ts.map +1 -0
  3395. package/dist/agent/tools/read_thread.js +100 -0
  3396. package/dist/agent/tools/read_thread.js.map +1 -0
  3397. package/dist/agent/tools/read_thread_seat.d.ts +7 -0
  3398. package/dist/agent/tools/read_thread_seat.d.ts.map +1 -0
  3399. package/dist/agent/tools/read_thread_seat.js +84 -0
  3400. package/dist/agent/tools/read_thread_seat.js.map +1 -0
  3401. package/dist/agent/tools/read_webhook_history.d.ts +17 -0
  3402. package/dist/agent/tools/read_webhook_history.d.ts.map +1 -0
  3403. package/dist/agent/tools/read_webhook_history.js +45 -0
  3404. package/dist/agent/tools/read_webhook_history.js.map +1 -0
  3405. package/dist/agent/tools/read_work_channel.d.ts +26 -0
  3406. package/dist/agent/tools/read_work_channel.d.ts.map +1 -0
  3407. package/dist/agent/tools/read_work_channel.js +108 -0
  3408. package/dist/agent/tools/read_work_channel.js.map +1 -0
  3409. package/dist/agent/tools/read_work_thread.d.ts +27 -0
  3410. package/dist/agent/tools/read_work_thread.d.ts.map +1 -0
  3411. package/dist/agent/tools/read_work_thread.js +89 -0
  3412. package/dist/agent/tools/read_work_thread.js.map +1 -0
  3413. package/dist/agent/tools/record_follow_up.d.ts +19 -0
  3414. package/dist/agent/tools/record_follow_up.d.ts.map +1 -0
  3415. package/dist/agent/tools/record_follow_up.js +74 -0
  3416. package/dist/agent/tools/record_follow_up.js.map +1 -0
  3417. package/dist/agent/tools/record_job_state.d.ts +15 -0
  3418. package/dist/agent/tools/record_job_state.d.ts.map +1 -0
  3419. package/dist/agent/tools/record_job_state.js +47 -0
  3420. package/dist/agent/tools/record_job_state.js.map +1 -0
  3421. package/dist/agent/tools/record_watch_state.d.ts +15 -0
  3422. package/dist/agent/tools/record_watch_state.d.ts.map +1 -0
  3423. package/dist/agent/tools/record_watch_state.js +45 -0
  3424. package/dist/agent/tools/record_watch_state.js.map +1 -0
  3425. package/dist/agent/tools/remove_routine_rule.d.ts +32 -0
  3426. package/dist/agent/tools/remove_routine_rule.d.ts.map +1 -0
  3427. package/dist/agent/tools/remove_routine_rule.js +142 -0
  3428. package/dist/agent/tools/remove_routine_rule.js.map +1 -0
  3429. package/dist/agent/tools/reply.d.ts +73 -0
  3430. package/dist/agent/tools/reply.d.ts.map +1 -0
  3431. package/dist/agent/tools/reply.js +664 -0
  3432. package/dist/agent/tools/reply.js.map +1 -0
  3433. package/dist/agent/tools/report_run_failed.d.ts +17 -0
  3434. package/dist/agent/tools/report_run_failed.d.ts.map +1 -0
  3435. package/dist/agent/tools/report_run_failed.js +71 -0
  3436. package/dist/agent/tools/report_run_failed.js.map +1 -0
  3437. package/dist/agent/tools/request_access.d.ts +118 -0
  3438. package/dist/agent/tools/request_access.d.ts.map +1 -0
  3439. package/dist/agent/tools/request_access.js +408 -0
  3440. package/dist/agent/tools/request_access.js.map +1 -0
  3441. package/dist/agent/tools/request_credential_grant.d.ts +101 -0
  3442. package/dist/agent/tools/request_credential_grant.d.ts.map +1 -0
  3443. package/dist/agent/tools/request_credential_grant.js +525 -0
  3444. package/dist/agent/tools/request_credential_grant.js.map +1 -0
  3445. package/dist/agent/tools/resume.d.ts +27 -0
  3446. package/dist/agent/tools/resume.d.ts.map +1 -0
  3447. package/dist/agent/tools/resume.js +137 -0
  3448. package/dist/agent/tools/resume.js.map +1 -0
  3449. package/dist/agent/tools/revoke_connector.d.ts +52 -0
  3450. package/dist/agent/tools/revoke_connector.d.ts.map +1 -0
  3451. package/dist/agent/tools/revoke_connector.js +129 -0
  3452. package/dist/agent/tools/revoke_connector.js.map +1 -0
  3453. package/dist/agent/tools/revoke_credential_grant.d.ts +12 -0
  3454. package/dist/agent/tools/revoke_credential_grant.d.ts.map +1 -0
  3455. package/dist/agent/tools/revoke_credential_grant.js +97 -0
  3456. package/dist/agent/tools/revoke_credential_grant.js.map +1 -0
  3457. package/dist/agent/tools/revoke_routine_permissions.d.ts +21 -0
  3458. package/dist/agent/tools/revoke_routine_permissions.d.ts.map +1 -0
  3459. package/dist/agent/tools/revoke_routine_permissions.js +72 -0
  3460. package/dist/agent/tools/revoke_routine_permissions.js.map +1 -0
  3461. package/dist/agent/tools/rotate_webhook.d.ts +37 -0
  3462. package/dist/agent/tools/rotate_webhook.d.ts.map +1 -0
  3463. package/dist/agent/tools/rotate_webhook.js +170 -0
  3464. package/dist/agent/tools/rotate_webhook.js.map +1 -0
  3465. package/dist/agent/tools/run_routine_now.d.ts +23 -0
  3466. package/dist/agent/tools/run_routine_now.d.ts.map +1 -0
  3467. package/dist/agent/tools/run_routine_now.js +106 -0
  3468. package/dist/agent/tools/run_routine_now.js.map +1 -0
  3469. package/dist/agent/tools/sandbox_tools.d.ts +11 -0
  3470. package/dist/agent/tools/sandbox_tools.d.ts.map +1 -0
  3471. package/dist/agent/tools/sandbox_tools.js +75 -0
  3472. package/dist/agent/tools/sandbox_tools.js.map +1 -0
  3473. package/dist/agent/tools/search.d.ts +65 -0
  3474. package/dist/agent/tools/search.d.ts.map +1 -0
  3475. package/dist/agent/tools/search.js +114 -0
  3476. package/dist/agent/tools/search.js.map +1 -0
  3477. package/dist/agent/tools/session_cost.d.ts +39 -0
  3478. package/dist/agent/tools/session_cost.d.ts.map +1 -0
  3479. package/dist/agent/tools/session_cost.js +124 -0
  3480. package/dist/agent/tools/session_cost.js.map +1 -0
  3481. package/dist/agent/tools/set_dm_delivery.d.ts +23 -0
  3482. package/dist/agent/tools/set_dm_delivery.d.ts.map +1 -0
  3483. package/dist/agent/tools/set_dm_delivery.js +106 -0
  3484. package/dist/agent/tools/set_dm_delivery.js.map +1 -0
  3485. package/dist/agent/tools/set_spend_limit.d.ts +156 -0
  3486. package/dist/agent/tools/set_spend_limit.d.ts.map +1 -0
  3487. package/dist/agent/tools/set_spend_limit.js +437 -0
  3488. package/dist/agent/tools/set_spend_limit.js.map +1 -0
  3489. package/dist/agent/tools/set_state.d.ts +74 -0
  3490. package/dist/agent/tools/set_state.d.ts.map +1 -0
  3491. package/dist/agent/tools/set_state.js +166 -0
  3492. package/dist/agent/tools/set_state.js.map +1 -0
  3493. package/dist/agent/tools/spawn_thread_session.d.ts +9 -0
  3494. package/dist/agent/tools/spawn_thread_session.d.ts.map +1 -0
  3495. package/dist/agent/tools/spawn_thread_session.js +204 -0
  3496. package/dist/agent/tools/spawn_thread_session.js.map +1 -0
  3497. package/dist/agent/tools/spend_report.d.ts +180 -0
  3498. package/dist/agent/tools/spend_report.d.ts.map +1 -0
  3499. package/dist/agent/tools/spend_report.js +372 -0
  3500. package/dist/agent/tools/spend_report.js.map +1 -0
  3501. package/dist/agent/tools/stand_down.d.ts +91 -0
  3502. package/dist/agent/tools/stand_down.d.ts.map +1 -0
  3503. package/dist/agent/tools/stand_down.js +245 -0
  3504. package/dist/agent/tools/stand_down.js.map +1 -0
  3505. package/dist/agent/tools/subscribe_pr.d.ts +104 -0
  3506. package/dist/agent/tools/subscribe_pr.d.ts.map +1 -0
  3507. package/dist/agent/tools/subscribe_pr.js +213 -0
  3508. package/dist/agent/tools/subscribe_pr.js.map +1 -0
  3509. package/dist/agent/tools/unlink_identity.d.ts +19 -0
  3510. package/dist/agent/tools/unlink_identity.d.ts.map +1 -0
  3511. package/dist/agent/tools/unlink_identity.js +97 -0
  3512. package/dist/agent/tools/unlink_identity.js.map +1 -0
  3513. package/dist/agent/tools/update_status.d.ts +17 -0
  3514. package/dist/agent/tools/update_status.d.ts.map +1 -0
  3515. package/dist/agent/tools/update_status.js +59 -0
  3516. package/dist/agent/tools/update_status.js.map +1 -0
  3517. package/dist/agent/tools/usage_report.d.ts +59 -0
  3518. package/dist/agent/tools/usage_report.d.ts.map +1 -0
  3519. package/dist/agent/tools/usage_report.js +91 -0
  3520. package/dist/agent/tools/usage_report.js.map +1 -0
  3521. package/dist/agent/tools/walk_pr.d.ts +79 -0
  3522. package/dist/agent/tools/walk_pr.d.ts.map +1 -0
  3523. package/dist/agent/tools/walk_pr.js +133 -0
  3524. package/dist/agent/tools/walk_pr.js.map +1 -0
  3525. package/dist/agent/webhooks/achievability.d.ts +80 -0
  3526. package/dist/agent/webhooks/achievability.d.ts.map +1 -0
  3527. package/dist/agent/webhooks/achievability.js +216 -0
  3528. package/dist/agent/webhooks/achievability.js.map +1 -0
  3529. package/dist/agent/webhooks/capture-window.d.ts +86 -0
  3530. package/dist/agent/webhooks/capture-window.d.ts.map +1 -0
  3531. package/dist/agent/webhooks/capture-window.js +194 -0
  3532. package/dist/agent/webhooks/capture-window.js.map +1 -0
  3533. package/dist/agent/webhooks/config.d.ts +326 -0
  3534. package/dist/agent/webhooks/config.d.ts.map +1 -0
  3535. package/dist/agent/webhooks/config.js +280 -0
  3536. package/dist/agent/webhooks/config.js.map +1 -0
  3537. package/dist/agent/webhooks/dispatch.d.ts +103 -0
  3538. package/dist/agent/webhooks/dispatch.d.ts.map +1 -0
  3539. package/dist/agent/webhooks/dispatch.js +358 -0
  3540. package/dist/agent/webhooks/dispatch.js.map +1 -0
  3541. package/dist/agent/webhooks/gate.d.ts +128 -0
  3542. package/dist/agent/webhooks/gate.d.ts.map +1 -0
  3543. package/dist/agent/webhooks/gate.js +296 -0
  3544. package/dist/agent/webhooks/gate.js.map +1 -0
  3545. package/dist/agent/webhooks/handshake-capture.d.ts +66 -0
  3546. package/dist/agent/webhooks/handshake-capture.d.ts.map +1 -0
  3547. package/dist/agent/webhooks/handshake-capture.js +126 -0
  3548. package/dist/agent/webhooks/handshake-capture.js.map +1 -0
  3549. package/dist/agent/webhooks/hooks-codemod.d.ts +73 -0
  3550. package/dist/agent/webhooks/hooks-codemod.d.ts.map +1 -0
  3551. package/dist/agent/webhooks/hooks-codemod.js +231 -0
  3552. package/dist/agent/webhooks/hooks-codemod.js.map +1 -0
  3553. package/dist/agent/webhooks/oe-standard-webhook.d.ts +153 -0
  3554. package/dist/agent/webhooks/oe-standard-webhook.d.ts.map +1 -0
  3555. package/dist/agent/webhooks/oe-standard-webhook.js +498 -0
  3556. package/dist/agent/webhooks/oe-standard-webhook.js.map +1 -0
  3557. package/dist/agent/webhooks/reject-audit.d.ts +40 -0
  3558. package/dist/agent/webhooks/reject-audit.d.ts.map +1 -0
  3559. package/dist/agent/webhooks/reject-audit.js +99 -0
  3560. package/dist/agent/webhooks/reject-audit.js.map +1 -0
  3561. package/dist/agent/webhooks/replay-dedupe.d.ts +58 -0
  3562. package/dist/agent/webhooks/replay-dedupe.d.ts.map +1 -0
  3563. package/dist/agent/webhooks/replay-dedupe.js +159 -0
  3564. package/dist/agent/webhooks/replay-dedupe.js.map +1 -0
  3565. package/dist/agent/webhooks/reveal-page.d.ts +116 -0
  3566. package/dist/agent/webhooks/reveal-page.d.ts.map +1 -0
  3567. package/dist/agent/webhooks/reveal-page.js +443 -0
  3568. package/dist/agent/webhooks/reveal-page.js.map +1 -0
  3569. package/dist/agent/webhooks/secrets.d.ts +17 -0
  3570. package/dist/agent/webhooks/secrets.d.ts.map +1 -0
  3571. package/dist/agent/webhooks/secrets.js +73 -0
  3572. package/dist/agent/webhooks/secrets.js.map +1 -0
  3573. package/dist/agent/webhooks/source-vocabulary.d.ts +131 -0
  3574. package/dist/agent/webhooks/source-vocabulary.d.ts.map +1 -0
  3575. package/dist/agent/webhooks/source-vocabulary.js +315 -0
  3576. package/dist/agent/webhooks/source-vocabulary.js.map +1 -0
  3577. package/dist/agent/webhooks/verifier.d.ts +251 -0
  3578. package/dist/agent/webhooks/verifier.d.ts.map +1 -0
  3579. package/dist/agent/webhooks/verifier.js +109 -0
  3580. package/dist/agent/webhooks/verifier.js.map +1 -0
  3581. package/dist/scripts/operator-store-connect.d.ts +86 -0
  3582. package/dist/scripts/operator-store-connect.d.ts.map +1 -0
  3583. package/dist/scripts/operator-store-connect.js +218 -0
  3584. package/dist/scripts/operator-store-connect.js.map +1 -0
  3585. package/package.json +3397 -0
  3586. package/patches/eve+0.54.3.patch +129 -0
  3587. package/scripts/eve-framework-tools.ts +367 -0
  3588. package/scripts/oe-cli.ts +293 -0
  3589. package/scripts/oe-secret.ts +278 -0
  3590. package/scripts/oe-wrap-untrusted.ts +63 -0
  3591. package/scripts/operator-store-connect.ts +246 -0
  3592. package/templates/subagents/fresh_eyes_review/agent.ts +37 -0
  3593. package/templates/subagents/fresh_eyes_review/hooks/spend.ts +16 -0
  3594. package/templates/subagents/fresh_eyes_review/instructions.md +52 -0
  3595. package/templates/subagents/fresh_eyes_review/tools/ask_question.ts +13 -0
  3596. package/templates/subagents/fresh_eyes_review/tools/bash.ts +13 -0
  3597. package/templates/subagents/fresh_eyes_review/tools/connection_search.ts +52 -0
  3598. package/templates/subagents/fresh_eyes_review/tools/load_skill.ts +13 -0
  3599. package/templates/subagents/fresh_eyes_review/tools/read_file.ts +13 -0
  3600. package/templates/subagents/fresh_eyes_review/tools/task_cancel.ts +20 -0
  3601. package/templates/subagents/fresh_eyes_review/tools/todo.ts +13 -0
  3602. package/templates/subagents/fresh_eyes_review/tools/web_fetch.ts +13 -0
  3603. package/templates/subagents/fresh_eyes_review/tools/web_search.ts +13 -0
  3604. package/templates/subagents/fresh_eyes_review/tools/write_file.ts +13 -0
  3605. package/tsconfig.build.json +24 -0
  3606. package/tsconfig.json +15 -0
@@ -0,0 +1,2185 @@
1
+ // The propose and click halves of the in-chat approvals plane: `requestApproval` freezes the args and posts the code-rendered card, `resolveApprovalClick` is the ONE decide implementation every surface's click funnels through, and `handleApprovalPayload` owns the Slack click end to end and never throws.
2
+ // Deliberately separate from eve's native HITL, which carries no approver policy, no frozen-args card and no audit trail; revisit only if eve's own HITL grows them.
3
+
4
+ import { createHash, randomUUID } from "node:crypto";
5
+ import { getOperationalStore } from "../operational/provider.js";
6
+ import { appendAudit } from "../audit/audit.js";
7
+ import { getConfig } from "../access/config.js";
8
+ import { swallowRoomOp, swallowRoomPost } from "../channels/egress-spoof.js";
9
+ import { admitProviderRegistration } from "../access/provider-selection.js";
10
+ import { criteriaDomain } from "../memory/domain.js";
11
+ import { bridgeSlackForm } from "../channels/slack-bridge.js";
12
+ import { emitTelemetry } from "../observability/telemetry.js";
13
+ import { grainUsesUnifiedWindow, supervisorGrainFor } from "../channels/unified-supervisor.js";
14
+ import { mintWakeId, type UnifiedWakeOrigin } from "../channels/unified-window.js";
15
+ import { dispatchApprovalDecisionWake } from "../channels/unified.js";
16
+ import { postSurfaceText, surfaceMessageOps } from "../channels/surface-message-ops.js";
17
+ import { renderApprovalDecisionMessage, type ApprovalOutcome } from "./decision-wake.js";
18
+ import {
19
+ captureApprovalDecisionAuthority,
20
+ readApprovalDecisionAuthority,
21
+ rememberApprovalDecisionAuthority,
22
+ } from "./decision-authority.internal.js";
23
+ import { actionKind, whereFromScope } from "./actions.js";
24
+ import {
25
+ approvalModeForDomain,
26
+ approversForScopeKey,
27
+ chainAuditDetail,
28
+ preApprovalRulesForScopeKey,
29
+ resolveApproverChain,
30
+ toolForActionKind,
31
+ type ApprovalChainRequest,
32
+ } from "../access/approver-chain.js";
33
+ import { shadowJudgeAuditDetail } from "../access/approval-judge.js";
34
+ import { RESUME_TOOL, TOOL_CONSEQUENCE } from "../access/consequence.js";
35
+ import { haltAuditDetail, haltRefusalMessage, haltScopeFor, resolveHalt, type HaltDeps } from "../access/halt.js";
36
+ import { parseScopeKey, platformOfScopeKey } from "../access/scope-key.js";
37
+ import { tryPrincipalKey } from "../identity/principal-key.js";
38
+ import { checkClickerFloor, clickRoomMatches, clickerFloorRefusalNotice, type ClickerFloorRefusal } from "./clicker-floor.js";
39
+ import { checkCardDisclosure, cardDisclosureRefusalNotice } from "./card-disclosure.js";
40
+ import { pendingCardBlocks, decidedCardBlocks, judgeLiftNoticeBlocks, judgeLiftNoticeText, type RenderedCard } from "./card.js";
41
+ import { contradictJudgeAllow, judgeContradictionNotice, type ContradictJudgeAllowOutcome } from "./judge-contradiction.js";
42
+ import { describeDeclaredPermissionKind, sessionGrantKind } from "./session-grant.js";
43
+ import {
44
+ consumeCardPostedThisTurn,
45
+ markCardPostedThisTurn,
46
+ noteRoutineRunPermissionRefusal,
47
+ peekCardPostedThisTurn,
48
+ } from "./card-signal.js";
49
+ import { withTaintDisclosure } from "./taint-disclosure.js";
50
+ import { withArmingApproval } from "./arming-context.js";
51
+ import { getSettings } from "../settings/settings.js";
52
+ import type { ActionKind, PendingActionRow, PendingStatus } from "./types.js";
53
+ import type { BindableContext } from "../identity/binding.js";
54
+ // The ActionKind registrations below are side-effect imports, placed at this click-path entry point so a click resolves its kind regardless of which propose tool ran first. None of these modules imports flow.ts, so none of them closes a cycle.
55
+ import "./memory-purge.js";
56
+ import "./access-request.js";
57
+ // `memory.remember` is GONE (OPE-389): memory writes are ordinary file edits captured at session end, and their gate is the taint fence plus the destructive-write floor, not a card.
58
+ import "./skill-create.js";
59
+ import "./routine-create.js";
60
+ import "./pr-open.js";
61
+ import "./skill-delete.js";
62
+ import "./routine-cancel.js";
63
+ import "./routine-lifecycle.js";
64
+ import "./routine-policy.js";
65
+ // The webhook kinds are the only ones whose `execute` MINTS a secret, which is why they live behind a code-rendered card and a verified clicker — the model proposes a source and a posture and is never in the mint path.
66
+ import "./webhook.js";
67
+ import "./webhook-declare.js";
68
+ import "./agent-create.js";
69
+ import "./ticket-actions.js";
70
+ import "./ticket-create.js";
71
+ import "./chat-post.js";
72
+ import "./chat-dm.js";
73
+ import "./session-checkpoint.js";
74
+ // The `routine.permission` kind. The NAMED imports are what carries the registration side effect here — a type-only import would drop it.
75
+ import { ROUTINE_PERMISSION_KIND, parseRoutinePermissionArgs, routineCardGenerationState } from "./routine-permission.js";
76
+ import {
77
+ markRoutinePermissionAsked,
78
+ planRoutinePermissionCard,
79
+ routineCardArmedBy,
80
+ routineCardProbe,
81
+ routinePermissionCardPointer,
82
+ routinePermissionRefusalClause,
83
+ type RoutineCardPointer,
84
+ type RoutinePermissionCardState,
85
+ } from "../routines/permission-card.js";
86
+ import { routineCardKeepsStateClause, routineCardWaitBudgetMs, routineCardWaitRefusalClause, waitForRoutineCardDecision } from "../routines/permission-card-wait.js";
87
+ // The refusal-site seam (OPE-1357). This module fills the slot at load; the unattended connector
88
+ // fence reads it. A LEAF import — routine-permission-offer.ts imports nothing at all.
89
+ import {
90
+ registerRoutinePermissionCardOfferer,
91
+ type RoutinePermissionCardOffer,
92
+ type RoutinePermissionCardResult,
93
+ } from "./routine-permission-offer.js";
94
+ import { ROUTINE_PERMISSION_NO_EXPIRY } from "../routines/declared-permissions.js";
95
+ // The per-turn slot, read for the wedge id's turn scope (OPE-1348). A LEAF import — turn-clock.ts
96
+ // imports `eve/context` and nothing else in the tree, so it closes no cycle here either.
97
+ import { readTurnClock } from "../observability/turn-clock.js";
98
+
99
+ /** Every button/action_id this feature owns is prefixed with this — the front route's
100
+ * classify step uses it to decide "ours" vs. "forward to Eve" (e.g. Eve's own `eve_input:`
101
+ * HITL buttons). Also embedded literally (not imported) in card.ts's button `action_id`s —
102
+ * see card.ts's import of this same constant; kept as ONE source of truth. */
103
+ export const OE_APPROVAL_PREFIX = "oe_approval:";
104
+
105
+ /** A minimal structural type for the real/injected Slack `chat.*` client — matches
106
+ * agent/channels/slack-events.ts's `slackForm` signature exactly, so the real one satisfies
107
+ * it with no adapter. */
108
+ type PostFn = (method: string, body: string) => Promise<Record<string, unknown> | undefined>;
109
+
110
+ /** A click decision. `approve_session` approves this proposal AND remembers the granting session, but only on a GRANTABLE kind — exactly one is grantable (`pr.open`); on every other kind the verb degrades to a one-off `approve` and grants nothing. */
111
+ export type ApprovalDecision = "approve" | "reject" | "approve_session" | "contradict";
112
+
113
+ /** Every decision word the click grammar accepts, as one list — the parser's membership test and
114
+ * approvals-test.ts's pin read the same array, so a new verb cannot reach one and miss the other. */
115
+ const APPROVAL_DECISIONS: readonly ApprovalDecision[] = ["approve", "reject", "approve_session", "contradict"];
116
+
117
+ /** Parse an `oe_approval:{decision}:{id}` action_id. Returns null for anything else, including a well-formed-looking id with a garbage decision segment, so a caller can treat "not parseable" as "not ours" without a second check. */
118
+ export function parseApprovalAction(actionId: string): { decision: ApprovalDecision; id: string } | null {
119
+ if (!actionId.startsWith(OE_APPROVAL_PREFIX)) return null;
120
+ const rest = actionId.slice(OE_APPROVAL_PREFIX.length);
121
+ const sep = rest.indexOf(":");
122
+ if (sep < 0) return null;
123
+ const decision = rest.slice(0, sep) as ApprovalDecision;
124
+ const id = rest.slice(sep + 1);
125
+ if (!APPROVAL_DECISIONS.includes(decision) || id.length === 0) return null;
126
+ return { decision, id };
127
+ }
128
+
129
+ /** TTL (hours) for a session-approval memo (OPE-53) — a GC bound, NOT the death mechanism (the memo's
130
+ * session_id embeds the window generation, so a rotation misses it regardless). Declared in
131
+ * `agent/settings/settings.ts`; `defineSettings` refuses a non-positive value at boot. */
132
+ function sessionApprovalTtlHours(): number {
133
+ return getSettings().approvals.sessionTtlHours;
134
+ }
135
+
136
+ /** The bare session/window token frozen into a pr.open pending's args (OPE-53), or undefined when the
137
+ * proposing turn couldn't be identified (⇒ no session skip was ever offered — the memo stays unset).
138
+ * Read generically off the frozen JSON — the click core never imports pr-open's arg shape. */
139
+ function sessionIdFromFrozenArgs(argsJson: string): string | undefined {
140
+ try {
141
+ const parsed = JSON.parse(argsJson) as { sessionId?: unknown };
142
+ return typeof parsed.sessionId === "string" && parsed.sessionId.length > 0 ? parsed.sessionId : undefined;
143
+ } catch {
144
+ return undefined;
145
+ }
146
+ }
147
+
148
+ /** Default TTL (hours) before a pending action lazily expires. Declared in
149
+ * `agent/settings/settings.ts`; `defineSettings` refuses a non-positive value at boot. */
150
+ function approvalTtlHours(): number {
151
+ return getSettings().approvals.ttlHours;
152
+ }
153
+
154
+ /**
155
+ * WHERE the card was, and therefore where the decision was made. An `approval.*` row's own where-columns come from the ASKING scope, and a REDIRECTED card lands in a room that appears nowhere in the scopeKey. Additive detail only — the partition is deliberately untouched.
156
+ * 🔴 A VENUE FIELD ONLY EVER CARRIES A REAL PLATFORM IDENTIFIER: a domain-level or principal-level scopeKey names no room, so those rows leave the two keys ABSENT rather than borrow a pseudo-workspace every audit reader filtering on a workspace would silently absorb.
157
+ */
158
+ export interface DecisionVenueDetail {
159
+ readonly venuePlatform?: string;
160
+ readonly venueWorkspace?: string;
161
+ readonly venueChannel?: string;
162
+ }
163
+
164
+ /** The (platform, workspace, channel) a ROOM key names, or undefined when it names no room —
165
+ * `roomNamespace`'s three-field twin. Same fail-closed grammar read: only the `tenant`/`surface`
166
+ * kinds are rooms; a bare domain name or a `user:` principal key is not one. */
167
+ function venueRoom(key: string | undefined | null): { readonly platform: string; readonly workspace: string; readonly channel?: string } | undefined {
168
+ if (!key) return undefined;
169
+ const parsed = parseScopeKey(key);
170
+ if (parsed.kind === "surface") return { platform: parsed.platform, workspace: parsed.workspace, channel: parsed.surface };
171
+ if (parsed.kind === "tenant") return { platform: parsed.platform, workspace: parsed.workspace };
172
+ return undefined;
173
+ }
174
+
175
+ /**
176
+ * Resolve the venue for one decision. Order is AVAILABILITY, not authority: the mint-frozen `postedTo` (the only rung that can be right for a REDIRECTED card), then the room the click came from, then the asking scope for rows minted before `postedTo` existed.
177
+ * The CHANNEL comes from `channelId` first: that is by construction the channel the card was posted into, whereas a scopeKey can name a FOREIGN surface under an explicit-scope override.
178
+ */
179
+ function venueDetail(
180
+ where: { readonly postedTo?: string | null; readonly channelId?: string | null; readonly scopeKey: string },
181
+ clickSurfaceKey?: string,
182
+ ): DecisionVenueDetail {
183
+ const room = venueRoom(where.postedTo) ?? venueRoom(clickSurfaceKey) ?? venueRoom(where.scopeKey);
184
+ const channel = where.channelId ?? room?.channel;
185
+ return {
186
+ ...(room ? { venuePlatform: room.platform, venueWorkspace: room.workspace } : {}),
187
+ ...(channel ? { venueChannel: channel } : {}),
188
+ };
189
+ }
190
+
191
+ /** The fully-qualified surfaceKey of the surface a card is posted to, frozen at mint. The binding's workspace IS the workspace the card lands in, which is what makes mint-time as authoritative as the click payload's own team/guild id. */
192
+ export function postedToSurfaceKey(binding: { readonly platform: string; readonly workspace: string }, channelId: string): string {
193
+ return `${binding.platform}/${binding.workspace}/${channelId}`;
194
+ }
195
+
196
+ export interface RequestApprovalInput {
197
+ readonly org: string;
198
+ readonly kind: string;
199
+ /** The FROZEN mutation args — validated by the caller against the kind's own arg shape
200
+ * BEFORE calling this (requestApproval only checks the kind is registered). */
201
+ readonly args: unknown;
202
+ readonly scopeKey: string;
203
+ readonly domain?: string | null;
204
+ readonly requestedBy: string;
205
+ readonly channelId: string;
206
+ readonly threadTs?: string | null;
207
+ /** The fully-qualified surfaceKey of the PROPOSING surface the card is posted to, frozen at mint because scopeKey is NOT a workspace source. Absent ⇒ the row freezes NULL and a sweep expiry is audit-only. */
208
+ readonly postedTo?: string | null;
209
+ /**
210
+ * OPTIONAL display-only body lines for the PENDING card, overriding `kind.summarize(args)` — for a kind whose frozen args deliberately REDACT what the approver must still read before clicking (memory.purge freezes only the bullets' hashes).
211
+ * INVARIANT: they must be rendered by CODE from the same source data the args were frozen from, never model text, so the approver still reads exactly what will execute. Never persisted; click-time re-renders use summarize(frozen args).
212
+ */
213
+ readonly summaryLines?: readonly string[];
214
+ /**
215
+ * APPROVER-CHAIN context the caller can see and this function cannot: requestApproval takes no ctx by design (the control plane calls it headless), so the turn's signals are supplied by the propose tool.
216
+ * 🔴 `unattended` IS REQUIRED, and an absent `chain` bag defaults it to `true`: a safety control whose unknown state reads as SAFE is not a control. Derive it with `unattendedOf(ctx)` — lint:principal-gate rule 5 refuses any other spelling. `tainted` stays optional and falls back to the chain's own in-turn signal.
217
+ */
218
+ readonly chain?: {
219
+ readonly unattended: boolean;
220
+ readonly tainted?: boolean;
221
+ };
222
+ /**
223
+ * Mint this pending with NO CLOCK — the far-future sentinel instead of `now + approvals.ttlHours`. A FLAG, NOT A DATE: an arbitrary `expiresAt` would let a propose site mint a row already in the past, whose card posts into the room and whose every click then resolves "expired".
224
+ * 🔴 Nothing expires such a row on a clock, by construction; the routine GENERATION bounds its authority instead, and an ignored card must stay clickable. A SUPERSEDED `routine.permission` card is reaped by the sweep's second pass, which is scoped to that ONE kind — a future kind setting this flag owes the sweep its own reaper.
225
+ */
226
+ readonly noClockExpiry?: true;
227
+ }
228
+
229
+ /** Post the code-rendered card for `row` and resolve to the posted message's platform id, or undefined on ANY failure — implementations must never throw. requestApproval treats undefined as "the card never made it", marks the pending expired and throws its own error. */
230
+ export type CardPoster = (row: PendingActionRow, summaryLines: readonly string[]) => Promise<string | undefined>;
231
+
232
+ // A non-Slack surface owns its own approval-card render and post, registered here from its own bundle — a vendor import cannot cross the bundle boundary.
233
+ // Slack is deliberately NOT registered: an absent poster means the built-in Block Kit render below.
234
+ const CARD_POSTERS = new Map<string, CardPoster>();
235
+
236
+ /** Register (or replace) a platform's approval-card poster. Called once per bundle at boot. */
237
+ export function registerCardPoster(platform: string, poster: CardPoster): void {
238
+ if (!admitProviderRegistration(platform, "approval-card-poster")) return;
239
+ CARD_POSTERS.set(platform, poster);
240
+ }
241
+
242
+ /** The card poster for `platform`, or undefined (Slack, or any unregistered surface → the default
243
+ * render path). The propose tools resolve `{ postCard: cardPosterFor(platform) }` from this. */
244
+ export function cardPosterFor(platform: string | undefined): CardPoster | undefined {
245
+ return platform === undefined ? undefined : CARD_POSTERS.get(platform);
246
+ }
247
+
248
+ /**
249
+ * Post the judge-lift NOTICE into the room the card would have gone to — the room's only trace of an act nobody was asked about, carrying the one "This should not have run" button. That button must carry the `contradict` verb bound to `row.id`, in whatever envelope the surface uses.
250
+ * BEST-EFFORT BY CONTRACT: implementations must never throw. The frozen args have already executed and the audit rows are written, so a failed post must never turn a completed action into a thrown error; nothing consumes a return value.
251
+ */
252
+ export type JudgeLiftNoticePoster = (row: PendingActionRow, summaryLines: readonly string[], outcomeLine: string) => Promise<void>;
253
+
254
+ const JUDGE_LIFT_NOTICE_POSTERS = new Map<string, JudgeLiftNoticePoster>();
255
+
256
+ /** Register (or replace) a platform's judge-lift notice poster. Called once per bundle at boot.
257
+ * Slack is deliberately NOT registered — its notice is the built-in Block Kit render below, the
258
+ * same way it is the built-in renderer for the pending card. */
259
+ export function registerJudgeLiftNoticePoster(platform: string, poster: JudgeLiftNoticePoster): void {
260
+ if (!admitProviderRegistration(platform, "judge-lift-notice-poster")) return;
261
+ JUDGE_LIFT_NOTICE_POSTERS.set(platform, poster);
262
+ }
263
+
264
+ /** The judge-lift notice poster for `platform`, or undefined — Slack (whose notice is the built-in
265
+ * Block Kit render below) and every surface with no component plane, which takes the shared TEXT
266
+ * render instead. A registered poster is the BUTTON arm, never the whole road. */
267
+ export function judgeLiftNoticePosterFor(platform: string | undefined): JudgeLiftNoticePoster | undefined {
268
+ return platform === undefined ? undefined : JUDGE_LIFT_NOTICE_POSTERS.get(platform);
269
+ }
270
+
271
+ /** How the judge-lift notice renders on one surface — the three arms of {@link postJudgeLiftNotice},
272
+ * and the answer {@link judgeLiftNoticeRenderFor} gives. `none` is a room this deployment cannot
273
+ * post into at all. */
274
+ export type JudgeLiftNoticeRender = "poster" | "blocks" | "text" | "none";
275
+
276
+ /**
277
+ * WHICH arm renders the judge-lift notice for `platform`. ONE ROAD, THREE RENDERS (OPE-1854): a bundle's registered poster carries the contradict BUTTON in its own envelope; Slack takes core's built-in Block Kit render; every other surface with a text transport takes the shared plain-text render, which spells the overrule out in words because no button can land there.
278
+ * 🔴 IT IS A CAPABILITY QUESTION, NOT A PLATFORM LIST — the same shape as {@link hasApprovalCardPath}. A surface reaches `none` only by registering no notice poster AND no `SurfaceMessageOps` transport, which is a room nothing can be posted into, and the parity gate reads this so such a silence has to be declared rather than discovered in production.
279
+ */
280
+ export function judgeLiftNoticeRenderFor(platform: string | undefined): JudgeLiftNoticeRender {
281
+ if (platform === undefined) return "none";
282
+ if (JUDGE_LIFT_NOTICE_POSTERS.has(platform)) return "poster";
283
+ if (platform === "slack") return "blocks";
284
+ return surfaceMessageOps(platform) !== undefined ? "text" : "none";
285
+ }
286
+
287
+ /** Does a judge-lifted act leave a trace in a `platform` room at all? The predicate the surface-parity
288
+ * gate probes its `judge-lift-notice` cell with. */
289
+ export function hasJudgeLiftNoticePath(platform: string): boolean {
290
+ return judgeLiftNoticeRenderFor(platform) !== "none";
291
+ }
292
+
293
+ /**
294
+ * THE ONE ROAD the judge-lift notice takes, on every surface. It resolves the render for the frozen platform and posts it, and it NEVER THROWS: the frozen args have already executed and the audit rows are written, so a failed post must never report a completed mutation as a failed tool call.
295
+ * The card's audience-disclosure gate also protects this notice because both renders carry the same code-owned action summary. It suppresses only the notice: the action has already run and keeps its successful result and audit trail.
296
+ * 🔴 The egress-spoof gate runs BEFORE any POST transport, never inside one — a registered poster owns its own vendor call — and OUTSIDE the `try`, because its Vercel refusal is a deploy misconfiguration the best-effort catch must not eat. The price, accepted: on that refusal a completed mutation is reported as a failed tool call and loses its audit row.
297
+ */
298
+ async function postJudgeLiftNotice(
299
+ platform: string | undefined,
300
+ post: PostFn,
301
+ input: { readonly kind: string; readonly scopeKey: string; readonly channelId: string; readonly threadTs?: string | null; readonly postedTo?: string | null },
302
+ row: PendingActionRow,
303
+ summarize: () => readonly string[],
304
+ outcomeLine: string,
305
+ ): Promise<void> {
306
+ const render = judgeLiftNoticeRenderFor(platform);
307
+ if (render === "none") return;
308
+ if (input.postedTo && !(await checkCardDisclosure(input.postedTo)).ok) return;
309
+ if (swallowRoomOp(`a judge-lift notice for "${input.kind}" (${input.scopeKey})`)) return;
310
+ // `try`/`catch`, not `.catch()`: a poster that throws SYNCHRONOUSLY never returns a promise to attach a handler to. The kind's own `summarize` runs INSIDE it for the same reason the post does — the frozen args have already executed, so a throw from either would report a completed mutation as a failed tool call AND skip its `approval.autoapproved` row.
311
+ try {
312
+ const noticeLines = summarize();
313
+ if (render === "poster") await judgeLiftNoticePosterFor(platform)!(row, noticeLines, outcomeLine);
314
+ else if (render === "blocks") await postRenderedCard(post, input.channelId, input.threadTs, judgeLiftNoticeBlocks(row, noticeLines, outcomeLine));
315
+ // `postSurfaceText` is itself fail-soft and logs the transport's own reason with the surface
316
+ // context this frame does not have — the same division of labour the poster arm has.
317
+ // `threadTs` is honoured by the Slack arm and IGNORED by every registered `SurfaceMessageOps`
318
+ // transport, so on those surfaces the notice lands in the container rather than under the
319
+ // proposing message. That is a property of the shared post seam, not of this caller —
320
+ // channels/hooks/turn-anchor.ts's cancel note passes it on the same terms — and the notice is
321
+ // about the room, so the container is the right audience either way.
322
+ else await postSurfaceText(platform!, { channelId: input.channelId, text: judgeLiftNoticeText(row, noticeLines, outcomeLine), threadTs: input.threadTs });
323
+ } catch {
324
+ // Deliberately silent here: each poster logs its own failure with the surface context this
325
+ // frame does not have (discord-flow.ts's `postDiscordCardMessage` names the channel).
326
+ }
327
+ }
328
+
329
+ /**
330
+ * The approver chain LOWERED a gated verb, so nothing was proposed: the frozen args already EXECUTED, and `outcome` is what the kind's own `execute` returned. `resolvedBy` names the chain ELEMENT that produced the verdict and only ever that — a mode lift records itself in `ChainResolution.transforms` instead.
331
+ * 🔴 Do NOT write a discriminator against a closed list of element names: the surface elements are latent today rather than absent, and a caller for either one puts its name here without touching this file.
332
+ */
333
+ export interface AutoApprovedOutcome {
334
+ readonly outcome: string;
335
+ readonly resolvedBy: string;
336
+ /** The HUMAN whose click let this run proceed — set only on the routine permission card's in-window approval, absent on every chain lift. A chain lift is config-reviewed policy acting with nobody present; reporting the second as the first would tell a routine's owner the machine decided something they decided. */
337
+ readonly grantedBy?: string;
338
+ }
339
+
340
+ /** 🔴 It EXTENDS the seam's result rather than being it: `armedBy` is the field that turns this plane's deny into an allow, so it must not reach a refusal site through the registry — the slot's return type carries `clause` alone, and the registration at the foot of this file drops the rest at that boundary. */
341
+ interface RoutinePermissionCardOutcome extends RoutinePermissionCardResult {
342
+ /** The HUMAN whose click let this run proceed — set only when a person approved the card inside
343
+ * the timed wait AND the standing grant row is really written. */
344
+ readonly armedBy?: string;
345
+ /** Did a timed wait really run? The standing advice says an unattended run "cannot wait on an approval card", which is false once this run has just spent the budget doing exactly that — so the advice reads off this rather than off the setting. */
346
+ readonly waited?: boolean;
347
+ }
348
+
349
+ /** What {@link requestApproval} hands back. `autoApproved` present ⇒ NO card exists and the
350
+ * mutation has ALREADY happened; `deduped` ⇒ the LIVE card of an identical earlier proposal. */
351
+ export interface RequestApprovalResult {
352
+ readonly id: string;
353
+ readonly expiresAt: string;
354
+ readonly deduped?: boolean;
355
+ readonly autoApproved?: AutoApprovedOutcome;
356
+ /** Set on the CARD path only, when a person REJECTED a proposal with the same dedup identity within the approval TTL. It is information for the proposer's result and never a block: a second human ask must still mint a card. */
357
+ readonly priorRejection?: PriorRejection;
358
+ }
359
+
360
+ /** The newest reject of the same proposal inside the approval TTL: who rejected it and when. */
361
+ export interface PriorRejection {
362
+ readonly decidedBy: string;
363
+ readonly decidedAt: string;
364
+ }
365
+
366
+ /** The identity an auto-approved WEDGE row records: WHAT was decided, WHERE, WHO asked and WHO
367
+ * decided. Every field is frozen at the decision, so a redelivery of the same step body reproduces
368
+ * all of them. The TURN is added by {@link wedgeActionId} itself. */
369
+ interface WedgeIdentity {
370
+ readonly org: string;
371
+ readonly kind: string;
372
+ readonly scopeKey: string;
373
+ readonly channelId: string;
374
+ readonly threadTs: string | null;
375
+ readonly argsJson: string;
376
+ /** The proposing principal. In the row already; in the identity because two people proposing the
377
+ * identical act must not share one row that names only the first of them. */
378
+ readonly requestedBy: string;
379
+ readonly decidedBy: string;
380
+ }
381
+
382
+ /**
383
+ * The id of an auto-approved wedge row: a digest of the decision it records, SCOPED TO THE TURN that made it. eve re-executes an UNCOMMITTED step body on crash-recovery redelivery and the two executions are byte-identical from inside the step, so both hash the same id here and addPendingActionIfAbsent makes the second write a no-op.
384
+ * 🔴 BOTH halves of the (session, turn) pair are load-bearing: content alone folds every nightly fire into the first night's row, and eve's turn id restarts at 0 in every session. With neither, this mints a fresh id — a duplicate row is noise, a swallowed one is an authorisation missing from the table. It does NOT make a kind's `execute` idempotent.
385
+ */
386
+ function wedgeActionId(identity: WedgeIdentity): string {
387
+ const turn = readTurnClock();
388
+ // BOTH, or neither. A session id with no turn cannot separate two turns of one session; a turn id
389
+ // with no session cannot separate two sessions at the same ordinal, which is the nightly-routine
390
+ // case. Either one missing means this frame has no identity to key on, so it mints instead.
391
+ if (turn === undefined || turn === null || turn.turnId.length === 0 || turn.sessionId.length === 0) return randomUUID();
392
+ // JSON, not a joined string: a separator that can appear inside `argsJson` would let two
393
+ // different decisions produce one material, and a fingerprint that can collide is not one.
394
+ const material = JSON.stringify([turn.sessionId, turn.turnId, identity.org, identity.kind, identity.scopeKey, identity.channelId, identity.threadTs, identity.argsJson, identity.requestedBy, identity.decidedBy]);
395
+ return uuidFromDigest(createHash("sha256").update(material).digest("hex"));
396
+ }
397
+
398
+ /**
399
+ * THE ACTION KIND OF THE LIFT VERB, read from the registry rather than spelled — the ONE kind the click halt arrow exempts, so a halt can never deny its own lift.
400
+ * A bare literal would survive a rename of the verb's registry row: the arrow would exempt a kind no card carries, the chat lift would silently die under the next halt, and a test spelling the same dead literal would stay green. `undefined` when the row is not an action-kind row, which exempts nothing.
401
+ */
402
+ const HALT_LIFT_ACTION_KIND: string | undefined = (() => {
403
+ const via = TOOL_CONSEQUENCE[RESUME_TOOL]?.via;
404
+ return via !== undefined && via.kind === "action-kind" ? via.action : undefined;
405
+ })();
406
+
407
+ /** The frozen args a live-card dedup compares: the row's argsJson with the kind's `proseArgs` dropped. Both sides are built by the same code in the same key order, so the re-serialised strings compare byte for byte. Unparseable or non-object args ride whole. */
408
+ function dedupIdentity(argsJson: string, proseArgs: readonly string[] | undefined): string {
409
+ if (proseArgs === undefined || proseArgs.length === 0) return argsJson;
410
+ let parsed: unknown;
411
+ try {
412
+ parsed = JSON.parse(argsJson);
413
+ } catch {
414
+ return argsJson;
415
+ }
416
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return argsJson;
417
+ return JSON.stringify(Object.fromEntries(Object.entries(parsed as Record<string, unknown>).filter(([k]) => !proseArgs.includes(k))));
418
+ }
419
+
420
+ /** A sha256 digest rendered in the shape every pending-action id carries. Nothing downstream parses a row id, but keeping the shape means no reader has to learn a second one, and ONE renderer serves both derived ids so they cannot drift. */
421
+ function uuidFromDigest(hex: string): string {
422
+ const variant = ((parseInt(hex.slice(16, 17), 16) & 0x3) | 0x8).toString(16);
423
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-8${hex.slice(13, 16)}-${variant}${hex.slice(17, 20)}-${hex.slice(20, 32)}`;
424
+ }
425
+
426
+ /**
427
+ * THE REDELIVERY IDENTITY OF ONE CARDED PROPOSAL — the id a pending takes when its kind declares a VOLATILE arg, so a redelivered step body lands on the card it already minted instead of posting a second one. Undefined when the kind declares none, or when this frame can name no (session, turn). The ordinary dedup matches the frozen argsJson, which a live MEASUREMENT changes between deliveries.
428
+ * 🔴 The (session, turn) pair keeps a genuine RE-ASK out: a redelivery shares both, a later turn does not. THE MEASUREMENT STAYS ON THE ROW — only the key drops it, because the card must still show the coverage measured when the approver was asked.
429
+ */
430
+ function redeliveryActionId(kindDef: Pick<ActionKind, "volatileArgs">, input: RequestApprovalInput): string | undefined {
431
+ const volatileArgs = kindDef.volatileArgs;
432
+ if (volatileArgs === undefined || volatileArgs.length === 0) return undefined;
433
+ const turn = readTurnClock();
434
+ if (turn === undefined || turn === null || turn.turnId.length === 0 || turn.sessionId.length === 0) return undefined;
435
+ // The REQUEST, with the measurements dropped. Built from the same object the caller froze, in the
436
+ // same order, so the two deliveries stringify identically — the property `argsJson` itself relies
437
+ // on. A non-object `args` carries no named field to drop, so it rides whole.
438
+ const args = input.args;
439
+ const stable =
440
+ args !== null && typeof args === "object" && !Array.isArray(args)
441
+ ? Object.fromEntries(Object.entries(args as Record<string, unknown>).filter(([k]) => !volatileArgs.includes(k)))
442
+ : args;
443
+ // JSON, not a joined string — a separator that can appear inside the args would let two different
444
+ // proposals produce one material, and a fingerprint that can collide is not one.
445
+ const material = JSON.stringify([turn.sessionId, turn.turnId, input.org, input.kind, input.scopeKey, input.channelId, input.threadTs ?? null, JSON.stringify(stable ?? null), input.requestedBy]);
446
+ return uuidFromDigest(createHash("sha256").update(material).digest("hex"));
447
+ }
448
+
449
+ /**
450
+ * The propose tools' reply line for the auto-approved branch: one place where the sentence is guaranteed to say the two things the card path's "posted, awaiting a human" would get wrong here — no card exists to wait on, and the action has already run.
451
+ * THE RELAY INSTRUCTION IS LOAD-BEARING: half these tools return an internal-only note on the card path, so with nothing posted anywhere this string is the ONLY report the asker can receive, and it has to ask to be spoken.
452
+ */
453
+ export function autoApprovedNote(what: string, autoApproved: AutoApprovedOutcome): string {
454
+ // A PERSON'S CLICK, not a chain lift (OPE-1290 PR 2). The run was refused, a permission card went
455
+ // into the routine's own room, and someone answered it before the run gave up. There IS a card
456
+ // and a human behind this outcome, so the chain sentence below would be false in both halves.
457
+ if (autoApproved.grantedBy !== undefined) {
458
+ return (
459
+ `done — ${what}: this run was refused, a permission card went to the routine's room, and <@${autoApproved.grantedBy}> approved it while the run was still waiting — ` +
460
+ `so it ran, and every later run of this instruction may do it without asking. ${autoApproved.outcome}. Tell the user.`
461
+ );
462
+ }
463
+ return (
464
+ `done — ${what}: the approver chain auto-approved this (${autoApproved.resolvedBy}), so no card was posted and it has ALREADY run — ` +
465
+ `${autoApproved.outcome}. Tell the user; there is no card for them to see.`
466
+ );
467
+ }
468
+
469
+ export interface RequestApprovalDeps {
470
+ readonly post?: PostFn;
471
+ /** Platform-aware card poster override. Absent → the default Slack Block Kit render+post
472
+ * below, byte-for-byte the original path (approvals-test.ts pins it). Present (e.g. the
473
+ * Discord poster, approvals/discord-flow.ts) → it owns render+post for its surface. */
474
+ readonly postCard?: CardPoster;
475
+ /** The live proposal turn, used only to freeze its already-validated wake authority for a later
476
+ * decision continuation. Headless control-plane proposals omit it. */
477
+ readonly authorityContext?: BindableContext;
478
+ }
479
+
480
+ /** Propose one pending action: validate the kind, freeze `args` as JSON, insert the row, post the code-rendered card, stamp its message ts and audit `approval.requested`. If the card fails to post, the pending is marked expired immediately and this THROWS — a pending nobody can see must never linger silently. */
481
+ export async function requestApproval(
482
+ input: RequestApprovalInput,
483
+ deps: RequestApprovalDeps = {},
484
+ ): Promise<RequestApprovalResult> {
485
+ const kindDef = actionKind(input.kind);
486
+ if (!kindDef) {
487
+ throw new Error(`requestApproval: no registered ActionKind for "${input.kind}"`);
488
+ }
489
+
490
+ // THE APPROVER CHAIN, resolved BEFORE anything is minted or posted, for every TOOL-proposed kind. The NON-TOOL kinds are deliberately not routed through it: they are raised by hooks with their own pinned bars, and carding the spend checkpoint on a tainted unattended run would deny the session the checkpoint exists to pause.
491
+ // Verdicts: deny ⇒ throw; allow ⇒ AUTO-APPROVE (a decided wedge row, plus an `approval.autoapproved` row per execution); ask ⇒ the card path below. Every resolution writes its `approval.chain` row with BOTH verdicts visible.
492
+ const chainTool = toolForActionKind(input.kind);
493
+ if (chainTool !== undefined) {
494
+ // approval-chain: exempt — this IS the site that applies the fail-closed default, and it is the
495
+ // only chain request in the tree built with no turn to read. The optional authority context is
496
+ // used solely to freeze a later decision continuation; this chain still reads no turn posture,
497
+ // so every propose site derives unattendedness and hands it in, which is what rule 5 enforces.
498
+ const chainReq: ApprovalChainRequest = {
499
+ tool: chainTool,
500
+ action: input.kind,
501
+ args: input.args,
502
+ scopeKey: input.scopeKey,
503
+ ...(input.domain != null ? { domain: input.domain } : {}),
504
+ // 🔴 THE JUDGE'S DISARM ADDRESS IS ORG-SCOPED (OPE-1368), and this is the ONLY site that opts
505
+ // into the judge, so this is the only site whose `org` a reader consults. Passing it is what
506
+ // stops one org's `rearm_approval_judge` from cancelling another org's break-glass disarm.
507
+ org: input.org,
508
+ principalId: input.requestedBy,
509
+ // 🔴 FAIL CLOSED: no `chain` bag ⇒ NOBODY IS WATCHING, so a gated verb denies instead of carding into an empty room. The old `?? false` inverted it — a propose site that forgot the line read as "a human is present", the one answer that costs something when it is wrong.
510
+ unattended: input.chain?.unattended ?? true,
511
+ ...(input.chain?.tainted !== undefined ? { tainted: input.chain.tainted } : {}),
512
+ ...(input.domain != null ? { mode: approvalModeForDomain(input.domain) } : {}),
513
+ // 🔴 THE BREAK-GLASS HALT is a runtime SOURCE for the same `mode` stage, resolved here because this is the one site that resolves the chain for a real propose. `resolveHalt` FAILS CLOSED, which is safe precisely because the arrow exempts `resume` by name.
514
+ // The address axes are whatever this proposal can NAME — its surface and tenant from the scopeKey, its domain, the requester's person key — and a domain-less, surface-less proposal is still covered by an ORG-WIDE halt.
515
+ halted: (await resolveHalt(haltScopeFor({ org: input.org, scopeKey: input.scopeKey, domain: input.domain, ...(input.requestedBy !== undefined ? { principalId: input.requestedBy } : {}) }))).halted,
516
+ // OPE-310: a beneficiary-clicker kind's MINT needs a human `decidedBy`; tell the chain so its
517
+ // beneficiary-clicker-floor arrow can refuse to lower it (see approver-chain.ts). The reveal
518
+ // itself goes to the ASKER, not to the decider (OPE-327) — the floor is about who may DECIDE a
519
+ // destructive mint, never about who receives what it mints.
520
+ ...(kindDef.beneficiaryClicker === true ? { beneficiaryClicker: true } : {}),
521
+ };
522
+ // `judge: true` — the propose plane is the ONE caller that opts into the armed judge: a consult here is a real awaited model call whose allow executes frozen args, which is right at a propose and wrong at a simulator. The await is bounded and happens only on a defer-flipped row.
523
+ // `rules` are the scope's admin-authored pre-approval rules, resolved through the same scope seam as the approvers and read only if a consult actually happens.
524
+ const resolution = await resolveApproverChain(chainReq, {
525
+ approvers: approversForScopeKey(input.scopeKey, input.domain ?? undefined),
526
+ rules: preApprovalRulesForScopeKey(input.scopeKey, input.domain ?? undefined),
527
+ judge: true,
528
+ });
529
+ await appendAudit({
530
+ ...whereFromScope(input.org, input.scopeKey),
531
+ principalId: input.requestedBy,
532
+ action: "approval.chain",
533
+ detail: chainAuditDetail(chainReq, resolution),
534
+ }).catch(() => undefined);
535
+
536
+ // One `approval.judge.verdict` row PER CONSULT — the judge's live track record, which the flip review queries and which makes a lift or a deny answerable after the fact. It lands even when the judge deferred, timed out or was skipped by an operator's disarm: a consult that changed nothing is still evidence.
537
+ // 🔴 A FIRST LIVE `verdict: "deny"` DESERVES INDIVIDUAL REVIEW — read its reasoning before trusting the class.
538
+ if (resolution.judge !== undefined) {
539
+ await appendAudit({
540
+ ...whereFromScope(input.org, input.scopeKey),
541
+ principalId: input.requestedBy,
542
+ action: "approval.judge.verdict",
543
+ detail: {
544
+ tool: chainTool,
545
+ action: input.kind,
546
+ mode: "enforce",
547
+ verdict: resolution.judge.verdict,
548
+ enforcedVerdict: resolution.verdict,
549
+ resolvedBy: resolution.resolvedBy,
550
+ // The displaced per-verb default — what this row would have resolved before its flip.
551
+ registryVerdict: resolution.registryVerdict,
552
+ source: resolution.judge.source,
553
+ passes: resolution.judge.passes,
554
+ ...(resolution.judge.pass1 !== undefined ? { pass1: resolution.judge.pass1 } : {}),
555
+ // `ruleId` is present only when the judge cited a rule that really exists in this scope's authored set, so every rule-driven auto-allow is traceable to prose a human deployed. `ruleCitation: "unmatched"` is the fence firing: the judge named a rule that does not exist, and an allow on that basis was degraded to an ask.
556
+ ...(resolution.judge.ruleId !== undefined ? { ruleId: resolution.judge.ruleId } : {}),
557
+ ...(resolution.judge.ruleCitation !== undefined ? { ruleCitation: resolution.judge.ruleCitation } : {}),
558
+ reasoning: resolution.judge.reasoning,
559
+ cacheKey: resolution.judge.cacheKey,
560
+ cacheHit: resolution.judge.cacheHit,
561
+ unattended: chainReq.unattended,
562
+ ...(input.domain != null ? { domain: input.domain } : {}),
563
+ },
564
+ }).catch(() => undefined);
565
+ }
566
+
567
+ // THE SHADOW JUDGE — log-only, and live only when approvals.judgeMode is exactly "shadow" (phase 2's enforcing judge is the `judge: true` above; never both). The resolution is never touched, and every judge failure is swallowed.
568
+ // DETACHED deliberately (measured live 2026-08-08): awaiting it added tens of seconds to every shadow-eligible carded turn and downstream work started missing its budgets. The row is best-effort — a turn that ends first loses it.
569
+ void shadowJudgeAuditDetail(chainReq, resolution)
570
+ .then((shadowDetail) =>
571
+ shadowDetail === undefined
572
+ ? undefined
573
+ : appendAudit({
574
+ ...whereFromScope(input.org, input.scopeKey),
575
+ principalId: input.requestedBy,
576
+ action: "approval.judge.shadow",
577
+ detail: shadowDetail,
578
+ }),
579
+ )
580
+ .catch(() => undefined);
581
+
582
+ if (resolution.verdict === "deny") {
583
+ // The `denied` telemetry is emitted at EACH throw rather than at the top of this branch: the routine permission card's timed wait can end this branch in a LIFT, and a call that emitted `denied` and then `autoapproved` would double-count itself and report a refusal that did not happen.
584
+ const denied = (): void => emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "denied" });
585
+ const reason = resolution.transforms.find((t) => t.to === "deny")?.reason;
586
+ // A JUDGE deny (OPE-318 phase 2) gets its own sentence: it is not config-reviewed policy —
587
+ // it is the armed judge's final verdict on a defer-flipped row, and the honest next step is
588
+ // a human proposing it themselves (or an operator reviewing the row's flip), never a config
589
+ // diff hunt. The audit trail is the `approval.judge.verdict` row written above.
590
+ if (resolution.resolvedBy === "judge") {
591
+ denied();
592
+ throw new Error(
593
+ `"${input.kind}" was DENIED by the approval judge — nothing was proposed and no card was posted. ` +
594
+ `The judge's reasoning is recorded in the audit log (approval.judge.verdict); if this looks wrong, a person can propose the action themselves, and the operator can review this verb's defer flip.`,
595
+ );
596
+ }
597
+ // A tainted UNATTENDED run denies with the same `ask-unattended` reason a plain undeclared-gate fire gets, and the standing advice would be WRONG for it — no standing grant lifts a taint floor. Naming taint lets the model route around it (ask a person, or retry in a clean turn) instead of concluding the tool is unavailable.
598
+ const taintedDeny = resolution.tainted && reason === "ask-unattended";
599
+ // THE ROUTINE PERMISSION CARD. The refusal above still stands by default: the routine's own room learns what its routine wanted, and one click arms the NEXT run. Only a routine fire refused for `ask-unattended`, on a kind a creation card could have declared, reaches the planner at all.
600
+ // With `approvals.routineCardWaitSeconds` armed, this call HOLDS for a bounded window on that card so a person who is around can answer it while the run is still up. It ships 0.
601
+ const card: RoutinePermissionCardOutcome =
602
+ reason === "ask-unattended"
603
+ ? await offerRoutinePermissionCardForProposal(input, { tainted: resolution.tainted, deps })
604
+ : { clause: "" };
605
+ // 🔴 THE ONE PATH THAT LIFTS THIS DENY, and only a HUMAN CLICK reaches it: the wait ran while this run was still up, someone approved the card, and the standing permission row they wrote has been read back — so refusing the call that raised the card would be theatre.
606
+ // The act is attributed to the CLICKER, never to the fire: the wedge row is minted `approved`/`decidedBy: <them>` and `execute` runs under their id, which keeps "who authorised this?" answerable from the row alone.
607
+ if (card.armedBy !== undefined) {
608
+ const store = getOperationalStore();
609
+ const decidedAt = new Date().toISOString();
610
+ const wedgeArgsJson = JSON.stringify(input.args ?? null);
611
+ const wedge: PendingActionRow = {
612
+ // DERIVED, never minted — a redelivery of this step body writes no second row. See
613
+ // {@link wedgeActionId}.
614
+ id: wedgeActionId({
615
+ org: input.org,
616
+ kind: input.kind,
617
+ scopeKey: input.scopeKey,
618
+ channelId: input.channelId,
619
+ threadTs: input.threadTs ?? null,
620
+ argsJson: wedgeArgsJson,
621
+ requestedBy: input.requestedBy,
622
+ decidedBy: card.armedBy,
623
+ }),
624
+ org: input.org,
625
+ kind: input.kind,
626
+ argsJson: wedgeArgsJson,
627
+ scopeKey: input.scopeKey,
628
+ domain: input.domain ?? null,
629
+ requestedBy: input.requestedBy,
630
+ channelId: input.channelId,
631
+ threadTs: input.threadTs ?? null,
632
+ messageTs: null,
633
+ postedTo: input.postedTo ?? null,
634
+ status: "approved",
635
+ createdAt: decidedAt,
636
+ // Its own mint instant, exactly as the chain-lowered wedge above: the row is already
637
+ // terminal, and a live-looking expiry on a decided row is what the click path's
638
+ // contradict branch had to special-case.
639
+ expiresAt: decidedAt,
640
+ decidedBy: card.armedBy,
641
+ decidedAt,
642
+ };
643
+ const minted = await store.addPendingActionIfAbsent(wedge);
644
+ const outcome = await kindDef.execute(input.args, card.armedBy);
645
+ await appendAudit({
646
+ ...whereFromScope(input.org, input.scopeKey),
647
+ principalId: card.armedBy,
648
+ action: "approval.autoapproved",
649
+ // 🔴 THE AUDIT ROW IS PER EXECUTION, THE WEDGE ROW IS PER AUTHORISATION PER (SESSION, TURN). This row is written either way, because dropping it would under-claim an act that really ran. `wedgeRowReused` states ONLY that a row with this id already existed — a redelivery produces that, and so does the same authorisation raised twice in one turn.
650
+ detail: {
651
+ id: wedge.id,
652
+ kind: input.kind,
653
+ scopeKey: input.scopeKey,
654
+ resolvedBy: "routine-permission-card",
655
+ transforms: resolution.transforms.map((t) => t.name),
656
+ ...(minted ? {} : { wedgeRowReused: true }),
657
+ },
658
+ }).catch(() => undefined);
659
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "autoapproved" });
660
+ return { id: wedge.id, expiresAt: wedge.expiresAt, autoApproved: { outcome, resolvedBy: "routine-permission-card", grantedBy: card.armedBy } };
661
+ }
662
+ denied();
663
+ throw new Error(
664
+ `"${input.kind}" was DENIED by the approver chain (${resolution.resolvedBy}${reason !== undefined ? `, ${reason}` : ""}) — ` +
665
+ `nothing was proposed and no card was posted. ${
666
+ taintedDeny
667
+ ? "This turn read external content, so this action needs a person to confirm it — and this run is unattended, so there is nobody to ask. No standing grant lifts that; ask a person to do this, or raise it again in a turn that has not read anything external."
668
+ : reason === "ask-unattended"
669
+ ? card.waited === true
670
+ ? // This run DID wait on a card, so the standing advice's first half would
671
+ // contradict the wait clause appended below it. What survives is the advice
672
+ // that is still true and still actionable.
673
+ "Arm the permission on the routine's creation card, or ask a person to do this."
674
+ : "An unattended run cannot wait on an approval card; arm the permission on the routine's creation card, or ask a person to do this."
675
+ : "This refusal is config-reviewed policy; a config diff to the denying element is the only way to lift it."
676
+ }${card.clause}`,
677
+ );
678
+ }
679
+
680
+ if (resolution.verdict === "allow" && resolution.registryVerdict === "ask") {
681
+ // Config/mode lowered a gated verb: execute the FROZEN args now, with a decided pending row
682
+ // minted for the wedge (status approved, decidedBy `chain:<element>` — never a human's id).
683
+ const store = getOperationalStore();
684
+ const now = new Date();
685
+ const decidedBy = `chain:${resolution.resolvedBy}`;
686
+ const rowArgsJson = JSON.stringify(input.args ?? null);
687
+ const row: PendingActionRow = {
688
+ // DERIVED, never minted — the chain-lowered wedge is redelivered exactly as the
689
+ // routine-permission one is. See {@link wedgeActionId}.
690
+ id: wedgeActionId({
691
+ org: input.org,
692
+ kind: input.kind,
693
+ scopeKey: input.scopeKey,
694
+ channelId: input.channelId,
695
+ threadTs: input.threadTs ?? null,
696
+ argsJson: rowArgsJson,
697
+ requestedBy: input.requestedBy,
698
+ decidedBy,
699
+ }),
700
+ org: input.org,
701
+ kind: input.kind,
702
+ argsJson: rowArgsJson,
703
+ scopeKey: input.scopeKey,
704
+ domain: input.domain ?? null,
705
+ requestedBy: input.requestedBy,
706
+ channelId: input.channelId,
707
+ threadTs: input.threadTs ?? null,
708
+ messageTs: null,
709
+ postedTo: input.postedTo ?? null,
710
+ status: "approved",
711
+ createdAt: now.toISOString(),
712
+ expiresAt: now.toISOString(),
713
+ decidedBy,
714
+ decidedAt: now.toISOString(),
715
+ };
716
+ const minted = await store.addPendingActionIfAbsent(row);
717
+ const outcome = await kindDef.execute(input.args, decidedBy);
718
+ // THE JUDGE-LIFT NOTICE, gated on `resolvedBy === "judge"` (a config or mode lift is reviewed policy a human deployed) and on a frozen `postedTo` (a room is never guessed from the asking scope). {@link postJudgeLiftNotice} is the ONE road from here: it picks the render for that frozen platform and never throws, so every surface this deployment can post into leaves a trace.
719
+ const noticePlatform = resolution.resolvedBy === "judge" ? platformOfScopeKey(input.postedTo) : undefined;
720
+ if (noticePlatform !== undefined) {
721
+ await postJudgeLiftNotice(noticePlatform, deps.post ?? bridgeSlackForm, input, row, () => withTaintDisclosure(input.summaryLines ? [...input.summaryLines] : kindDef.summarize(input.args), input.args), outcome);
722
+ }
723
+ await appendAudit({
724
+ ...whereFromScope(input.org, input.scopeKey),
725
+ principalId: input.requestedBy,
726
+ action: "approval.autoapproved",
727
+ // `wedgeRowReused` on the same terms as the routine-permission wedge above: the row is per
728
+ // authorisation per (session, turn), this audit row is per execution, and the flag states
729
+ // only that a row with this id already existed.
730
+ detail: {
731
+ id: row.id,
732
+ kind: input.kind,
733
+ scopeKey: input.scopeKey,
734
+ resolvedBy: resolution.resolvedBy,
735
+ transforms: resolution.transforms.map((t) => t.name),
736
+ ...(minted ? {} : { wedgeRowReused: true }),
737
+ },
738
+ }).catch(() => undefined);
739
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "autoapproved" });
740
+ return { id: row.id, expiresAt: row.expiresAt, autoApproved: { outcome, resolvedBy: resolution.resolvedBy } };
741
+ }
742
+ // ask (or an allow that matches the registry's own allow — nothing to lower): the card path.
743
+ }
744
+
745
+ // AUDIENCE DISCLOSURE, asked BEFORE the dedup lookup and before any row exists. It runs FIRST on purpose: a dedup hit hands back a LIVE card already sitting in the room, so answering "may this room see this?" with a pointer to it would be wrong, and refusing before any mint leaves no pending to reconcile.
746
+ // Deliberately NOT keyed on the kind's tier — the disclosure happens at POST time and posting never reads the tier. INERT without a `postedTo`: absent ⇒ we cannot ask ⇒ we do not refuse.
747
+ if (input.postedTo) {
748
+ const disclosure = await checkCardDisclosure(input.postedTo);
749
+ if (!disclosure.ok) {
750
+ // Reuses the approval plane's existing refusal action rather than minting a parallel one. No `id`, because no row was created; `at` distinguishes this propose-time refusal from the click-time rows that share the action.
751
+ await appendAudit({
752
+ ...whereFromScope(input.org, input.scopeKey),
753
+ principalId: input.requestedBy,
754
+ action: "approval.denied",
755
+ detail: {
756
+ kind: input.kind,
757
+ scopeKey: input.scopeKey,
758
+ postedTo: input.postedTo,
759
+ ...venueDetail({ postedTo: input.postedTo, channelId: input.channelId, scopeKey: input.scopeKey }),
760
+ reason: disclosure.reason,
761
+ at: "propose",
762
+ },
763
+ }).catch(() => undefined);
764
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "withheld" });
765
+ throw new Error(cardDisclosureRefusalNotice());
766
+ }
767
+ }
768
+
769
+ const post = deps.post ?? bridgeSlackForm;
770
+ const store = getOperationalStore();
771
+
772
+ const now = new Date();
773
+ // A no-clock kind mints the same far-future sentinel its grant rows carry, so the two read alike
774
+ // in the tables — see RequestApprovalInput.noClockExpiry for which kinds, and why.
775
+ const expiresAt = input.noClockExpiry ? ROUTINE_PERMISSION_NO_EXPIRY : new Date(now.getTime() + approvalTtlHours() * 3_600_000).toISOString();
776
+ const argsJson = JSON.stringify(input.args ?? null);
777
+
778
+ // DEDUP: an IDENTICAL action already awaiting a click on this same surface hands back the LIVE card instead of minting a second one. Identity is the FROZEN (kind, scopeKey, channelId, argsJson) tuple, so a different proposed value is a genuinely new proposal with its own card.
779
+ // `listPendingActions` returns only `pending` rows, so a rejected or expired proposal never dedups — a re-propose mints a fresh card. Expiry is SWEEP-based, so the `expiresAt` check is what stops dedup handing back a card whose click would only ever resolve "expired".
780
+ // A kind's `proseArgs` (free text such as a spend `reason`) leave the identity, so the same request in new words still folds onto the live card.
781
+ const nowIso = now.toISOString();
782
+ const identity = dedupIdentity(argsJson, kindDef.proseArgs);
783
+ const dup = (await store.listPendingActions(input.org)).find(
784
+ (r) =>
785
+ r.kind === input.kind &&
786
+ r.scopeKey === input.scopeKey &&
787
+ r.channelId === input.channelId &&
788
+ dedupIdentity(r.argsJson, kindDef.proseArgs) === identity &&
789
+ r.expiresAt > nowIso,
790
+ );
791
+ if (dup) {
792
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "deduped" });
793
+ return { id: dup.id, expiresAt: dup.expiresAt, deduped: true };
794
+ }
795
+
796
+ // THE PRIOR REJECT (OPE-2071). The same dedup identity REJECTED within the approval TTL does not stop this card: the reject text invites a new proposal, and a second human ask must mint one. The result only REPORTS the reject, so a proposer that retries on its own learns the answer it never received. The read is fail-soft because it is information, never a gate.
797
+ const rejectedSince = new Date(now.getTime() - approvalTtlHours() * 3_600_000).toISOString();
798
+ const priorRejection = await findPriorRejection(store, input, kindDef, identity, rejectedSince);
799
+
800
+ // Freeze the proposal's exact host-owned wake before minting anything. A unified proposal whose
801
+ // current wake cannot prove its surface must fail closed before a card can invite a click; a
802
+ // headless/native proposal has no window continuation authority to preserve.
803
+ const decisionAuthority = deps.authorityContext === undefined ? undefined : await captureApprovalDecisionAuthority(deps.authorityContext);
804
+
805
+ // THE REDELIVERY GUARD (OPE-1556) — the second arm of the dedup, and the ONLY one that can see a
806
+ // redelivered proposal whose kind froze a live MEASUREMENT into its args. See
807
+ // {@link redeliveryActionId}: `undefined` for every kind that declares no volatile arg, which is
808
+ // every kind but `spend.set` today, so this is inert for them and they mint exactly as before.
809
+ let id: string = randomUUID();
810
+ const redeliveryId = redeliveryActionId(kindDef, input);
811
+ if (redeliveryId !== undefined) {
812
+ const prior = await store.getPendingAction(input.org, redeliveryId);
813
+ if (prior === null) {
814
+ // Nothing under this identity yet — take it, so a redelivery of THIS step body finds the row
815
+ // it is about to write rather than minting a second card beside it.
816
+ id = redeliveryId;
817
+ } else if (prior.status === "pending" && prior.expiresAt > nowIso) {
818
+ // The redelivery. Hand back the LIVE card, exactly as the args dedup above does — same
819
+ // return shape, same telemetry, so a reader cannot tell which arm caught it and does not
820
+ // need to.
821
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "deduped" });
822
+ return { id: prior.id, expiresAt: prior.expiresAt, deduped: true };
823
+ }
824
+ // Otherwise a TERMINAL row already holds that id — decided, rejected or wall-expired inside this
825
+ // same turn. Minting onto it would be a primary-key throw over a proposal that is genuinely new
826
+ // (the approvals plane must never point a caller at a dead card), so this one mints fresh and
827
+ // simply gets no redelivery guard. `id` keeps its `randomUUID()`.
828
+ }
829
+
830
+ // `let`, not `const`: the conflict branch below re-mints the row under a random id when a
831
+ // concurrent writer already holds the derived one and its row is terminal.
832
+ let row: PendingActionRow = {
833
+ id,
834
+ org: input.org,
835
+ kind: input.kind,
836
+ argsJson,
837
+ scopeKey: input.scopeKey,
838
+ domain: input.domain ?? null,
839
+ requestedBy: input.requestedBy,
840
+ channelId: input.channelId,
841
+ threadTs: input.threadTs ?? null,
842
+ messageTs: null,
843
+ postedTo: input.postedTo ?? null,
844
+ status: "pending",
845
+ createdAt: now.toISOString(),
846
+ expiresAt,
847
+ decidedBy: null,
848
+ decidedAt: null,
849
+ };
850
+
851
+ if (row.id === redeliveryId) {
852
+ // 🔴 A DERIVED ID IS INSERTED WITHOUT CONFLICT, never with a plain INSERT: the read above and this write are not atomic and the id is deterministic, so two proposals sharing one (session, turn) both read null and both insert, and a plain insert would make the loser throw out of a propose that should simply have deduped.
853
+ // The `randomUUID()` path below keeps the plain insert — no other caller can compute that id, so it has no conflict to lose.
854
+ if (!(await store.addPendingActionIfAbsent(row))) {
855
+ const winner = await store.getPendingAction(input.org, row.id);
856
+ if (winner !== null && winner.status === "pending" && winner.expiresAt > nowIso) {
857
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "deduped" });
858
+ return { id: winner.id, expiresAt: winner.expiresAt, deduped: true };
859
+ }
860
+ // The winner is already terminal (decided or wall-expired between the two writes). The
861
+ // approvals plane must never point a caller at a dead card, so this proposal mints a fresh
862
+ // row under a random id instead — the same answer the terminal-row branch above gives.
863
+ const fresh: PendingActionRow = { ...row, id: randomUUID() };
864
+ await store.addPendingAction(fresh);
865
+ row = fresh;
866
+ }
867
+ } else {
868
+ await store.addPendingAction(row);
869
+ }
870
+
871
+ if (decisionAuthority !== undefined) {
872
+ try {
873
+ await rememberApprovalDecisionAuthority(row.org, row.id, row.expiresAt, decisionAuthority);
874
+ } catch (err) {
875
+ await store.decidePendingAction(row.org, row.id, "expired", "system", new Date().toISOString()).catch(() => {});
876
+ await appendAudit({
877
+ ...whereFromScope(row.org, row.scopeKey),
878
+ principalId: row.requestedBy,
879
+ action: "approval.expired",
880
+ detail: { id: row.id, kind: row.kind, cause: "decision_authority_store_failed" },
881
+ }).catch(() => undefined);
882
+ throw new Error(`requestApproval: could not freeze the proposing seat authority; marked expired and did not post a card: ${String(err)}`);
883
+ }
884
+ }
885
+
886
+ // The taint DISCLOSURE line is applied here rather than inside each kind, so no card can be minted without it. A caller-supplied `summaryLines` goes through it too: overriding the render must not be a way to drop the disclosure.
887
+ const summaryLines = withTaintDisclosure(input.summaryLines ? [...input.summaryLines] : kindDef.summarize(input.args), input.args);
888
+
889
+ // LOCAL EVAL SPOOF: swallowing hands back a synthetic ts so the row, the audit and the card signal all run normally. Without it a local-eval target holds no bot token, the post fails, and every gated verb hard-fails under eval.
890
+ // 🔴 THE ORDER IS WHAT MAKES IT COVER EVERY PLATFORM — a registered CardPoster owns its own vendor call, so a gate checked after the branch below would swallow Slack's card and leave every other surface posting for real.
891
+ let messageTs = swallowRoomPost(`an approval-card post for "${input.kind}" (${input.scopeKey})`, "card");
892
+ // WHY the post did not land, when the transport names a reason. A registered CardPoster owns its
893
+ // own vendor call and its contract returns a bare undefined, so that arm has none to report — the
894
+ // honest string below says exactly that rather than inventing one (OPE-1861).
895
+ let postFailure: string | undefined;
896
+ if (messageTs === undefined) {
897
+ // A non-Slack surface owns its own render+post (CardPoster contract: never throws,
898
+ // undefined = failed). Everything after this point is platform-neutral.
899
+ if (deps.postCard) {
900
+ messageTs = await deps.postCard(row, summaryLines);
901
+ if (!messageTs) postFailure = "the surface's own card post did not land and reported no reason";
902
+ } else {
903
+ const posted = await postRenderedCard(post, input.channelId, input.threadTs, pendingCardBlocks(row, summaryLines));
904
+ messageTs = posted.ts;
905
+ postFailure = posted.error;
906
+ }
907
+ }
908
+
909
+ if (!messageTs) {
910
+ // The card never made it to the surface — nobody can see this pending, so it must not
911
+ // linger as an unseeable "pending" forever. Mark it expired (best-effort) and throw.
912
+ await store.decidePendingAction(input.org, row.id, "expired", "system", new Date().toISOString()).catch(() => {});
913
+ // An approval expiring is an ACTION-LIFECYCLE event (audit-wedge WS-3) — a dispatched
914
+ // approval that never resolves owes a terminal row, the same "a row closes a row" principle
915
+ // as the ticketing no_reply rows. Cause distinguishes this failed-post expiry from a TTL sweep.
916
+ await appendAudit({
917
+ ...whereFromScope(input.org, input.scopeKey),
918
+ principalId: input.requestedBy,
919
+ action: "approval.expired",
920
+ detail: { id: row.id, kind: input.kind, cause: "card_post_failed", ...(postFailure ? { reason: postFailure } : {}) },
921
+ });
922
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "failed" });
923
+ // The transport's own refusal reason rides BOTH halves: in the message for a human reader, and
924
+ // as a property for a caller that must classify it (spend/checkpoint.ts) without parsing a
925
+ // sentence that also carries the kind and the scope key. Token-free — see {@link postRenderedCard}.
926
+ const reason = postFailure ?? "the surface refused the post";
927
+ // 🔴 THE ERROR IS BUILT INSIDE THE `throw`, NOT BOUND TO A `const` FIRST. `lint:principal-gate`
928
+ // reads `const <name> = <rhs mentioning requestApproval>` as an ALIAS DECLARATION for the propose
929
+ // function, and then treats every `<name>(` in the file as a propose site — so binding this
930
+ // message to a local turns an unrelated line into a hard security-lint failure (measured on this
931
+ // file). The message must name `requestApproval`, so the binding is what gives way.
932
+ throw Object.assign(
933
+ new Error(`requestApproval: failed to post the approval card for "${input.kind}" (${input.scopeKey}) — ${reason}; marked expired, nothing is awaiting a click.`),
934
+ { [CARD_POST_REASON_KEY]: reason },
935
+ );
936
+ }
937
+
938
+ await store.setPendingActionMessage(input.org, row.id, messageTs);
939
+ // The card is now on the surface — signal channels/slack.ts's message.completed to
940
+ // suppress the model's redundant text reply this turn (Tommy, live: "the card should
941
+ // suffice"). Set ONLY here, after the post is confirmed — never on a refusal/validation
942
+ // path above this function, where the thrown error IS the message the user needs.
943
+ markCardPostedThisTurn();
944
+ await appendAudit({
945
+ ...whereFromScope(input.org, input.scopeKey),
946
+ principalId: input.requestedBy,
947
+ action: "approval.requested",
948
+ detail: { id: row.id, kind: input.kind, scopeKey: input.scopeKey, ...(row.domain ? { domain: row.domain } : {}) },
949
+ });
950
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_requested", "oe.outcome": "ok" });
951
+
952
+ return { id: row.id, expiresAt, ...(priorRejection !== undefined ? { priorRejection } : {}) };
953
+ }
954
+
955
+ /** The newest REJECTED row since `sinceIso` whose dedup identity equals this proposal's: same kind, scopeKey, channelId and non-prose args. Undefined when none matches or the read fails. */
956
+ async function findPriorRejection(
957
+ store: ReturnType<typeof getOperationalStore>,
958
+ input: RequestApprovalInput,
959
+ kindDef: Pick<ActionKind, "proseArgs">,
960
+ identity: string,
961
+ sinceIso: string,
962
+ ): Promise<PriorRejection | undefined> {
963
+ // `.then` first, so a store that throws synchronously is caught like one that rejects.
964
+ const rows = await Promise.resolve()
965
+ .then(() => store.listRejectedActionsSince(input.org, sinceIso))
966
+ .catch(() => [] as readonly PendingActionRow[]);
967
+ const match = rows.find(
968
+ (r) =>
969
+ r.kind === input.kind &&
970
+ r.scopeKey === input.scopeKey &&
971
+ r.channelId === input.channelId &&
972
+ r.decidedBy !== null &&
973
+ r.decidedAt !== null &&
974
+ r.decidedAt >= sinceIso &&
975
+ dedupIdentity(r.argsJson, kindDef.proseArgs) === identity,
976
+ );
977
+ return match === undefined ? undefined : { decidedBy: match.decidedBy as string, decidedAt: match.decidedAt as string };
978
+ }
979
+
980
+ /** The permission key is read back off the proposal's own frozen args (the persisted wire name is `grantKey`), so it names the routine generation the refused act was proposed under. A proposal carrying no routine key is not a fire's, and this plane has nothing to offer it. */
981
+ async function offerRoutinePermissionCardForProposal(
982
+ input: RequestApprovalInput,
983
+ ctx: { readonly tainted: boolean; readonly deps: RequestApprovalDeps },
984
+ ): Promise<RoutinePermissionCardOutcome> {
985
+ const grantKey = sessionIdFromFrozenArgs(JSON.stringify(input.args ?? null));
986
+ if (grantKey === undefined) return { clause: "" };
987
+ return await offerRoutinePermissionCard(
988
+ {
989
+ org: input.org,
990
+ // `pr.open` is both this plane's ActionKind and the grant plane's declaration for it, which is
991
+ // why one field carries both vocabularies — see `declarableRoutinePermission`.
992
+ declaration: input.kind,
993
+ // Carried for the seam's CAPPED path, which this call site never takes — the propose plane
994
+ // does not come through `offerRoutinePermissionCardFor` — but the field is required, and
995
+ // `input.kind` is the same string the planner resolves the kind from below.
996
+ grantKind: input.kind,
997
+ grantKey,
998
+ scopeKey: input.scopeKey,
999
+ domain: input.domain ?? null,
1000
+ requestedBy: input.requestedBy,
1001
+ tainted: ctx.tainted,
1002
+ // THIS plane spends the run's own time on the card: the refused act is a tool call in the
1003
+ // model's turn, so a wait here holds the turn a human can still answer.
1004
+ waitBudgetMs: routineCardWaitBudgetMs(),
1005
+ },
1006
+ ctx.deps,
1007
+ );
1008
+ }
1009
+
1010
+ /**
1011
+ * 🔴 IT CANNOT CHANGE THE REFUSAL: the deny is already decided by the time this runs, every failure inside it is swallowed, and all it can add to the thrown sentence is a clause derived from a row that exists. A courtesy must never turn a clean refusal into a crash.
1012
+ * 🔴 REFUSAL-SITE-AGNOSTIC: the other site that refuses a fire (the unattended connector fence) reaches this through the registry seam rather than by importing it, so neither site gets a behaviour the other does not. The poster is resolved for the ROUTINE's platform, which is often not the refused act's.
1013
+ */
1014
+ async function offerRoutinePermissionCard(
1015
+ offer: RoutinePermissionCardOffer,
1016
+ deps: RequestApprovalDeps,
1017
+ ): Promise<RoutinePermissionCardOutcome> {
1018
+ try {
1019
+ const budgetMs = offer.waitBudgetMs;
1020
+ const grantKey = offer.grantKey;
1021
+ const plan = await planRoutinePermissionCard({
1022
+ org: offer.org,
1023
+ declaration: offer.declaration,
1024
+ grantKey,
1025
+ scopeKey: offer.scopeKey,
1026
+ domain: offer.domain ?? null,
1027
+ requestedBy: offer.requestedBy,
1028
+ tainted: offer.tainted,
1029
+ nowIso: new Date().toISOString(),
1030
+ });
1031
+ if (!plan.card || plan.askedMemoKind === undefined) {
1032
+ // A `live` state is the other state with a card to wait on: an earlier fire posted it and nobody has answered, so this fire re-points at that same card and spends its budget on it. Every other state has no card to wait for, so the refusal is immediate.
1033
+ // The pointer is resolved for the row the planner itself found, never looked up a second time, so the URL and the state can never describe different cards.
1034
+ const at = plan.cardId ? await routinePermissionCardPointer(offer.org, plan.cardId) : {};
1035
+ const clause = routinePermissionRefusalClause(plan.state, false, at.permalink);
1036
+ if (budgetMs <= 0 || plan.cardId === undefined || plan.grantKind === undefined) {
1037
+ noteRunRefusal(plan.state, plan.grantKind, at, plan.cardId !== undefined);
1038
+ return { clause };
1039
+ }
1040
+ const settled = await settleRoutineCardWait(offer.org, { cardId: plan.cardId, grantKey, grantKind: plan.grantKind }, clause, budgetMs);
1041
+ // `true`, and the guard three lines up is why: this branch is reachable only once
1042
+ // `plan.cardId === undefined` has already returned, so a card is known to exist here.
1043
+ return noteUnlessArmed(settled, plan.state, plan.grantKind, at, true);
1044
+ }
1045
+ // The planner resolves the routine's room through the DISPATCH registry, which is wired for more platforms than the CARD registry — without this test the post would fall through to the built-in Slack path and fire a Slack call at a Teams conversation id, on every fire forever (the post fails, so no ask-memo is written, so nothing stops the retry).
1046
+ if (!hasApprovalCardPath(plan.platform ?? "")) return { clause: "" };
1047
+ // 🔴 THE CARD SIGNAL MUST NOT SURVIVE THIS CALL. The surfaces read "a card posted this turn" to SUPPRESS the model's reply, but this turn is being REFUSED, its thrown sentence is the text that still has to reach the room, and the card went to a different room anyway — so the flag is read beforehand and restored.
1048
+ const hadCardSignal = peekCardPostedThisTurn();
1049
+ // A re-entrant requestApproval, and it terminates: `routine.permission` is a
1050
+ // NON_TOOL_ACTION_KIND, so `toolForActionKind` answers undefined, no chain is built for it and
1051
+ // this branch cannot be reached a second time.
1052
+ const poster = cardPosterFor(plan.platform ?? "");
1053
+ let cardId: string | undefined;
1054
+ try {
1055
+ // 🔴 KEEP THE MARKER BELOW ADJACENT TO THE CALL. `principal-gate-lint` anchors the exemption
1056
+ // to the propose site by adjacency, so wrapping the call in an assignment EXPRESSION hides it
1057
+ // and the lint hard-errors (measured on this branch). Hence `const posted` + a second line.
1058
+ // approval-chain: exempt — `routine.permission` is a NON_TOOL_ACTION_KIND (access/consequence.ts),
1059
+ // so `toolForActionKind` answers undefined and this call builds no chain request at all. An
1060
+ // attendedness bag here would be inert AND wrong: the site that raises this card is BY
1061
+ // CONSTRUCTION an unattended fire's refusal, so the unattended arrow would kill the one card
1062
+ // that exists to be read after that run has ended. The ruling for this kind is the
1063
+ // spend-checkpoint precedent (OPE-1290, 2026-08-31): the card blocks nothing and can only mint
1064
+ // a row the declare layer would have accepted.
1065
+ // approval-authority: headless — this unattended routine refusal has no live model turn or wake envelope.
1066
+ const posted = await requestApproval(plan.card, {
1067
+ ...(deps.post ? { post: deps.post } : {}),
1068
+ ...(poster ? { postCard: poster } : {}),
1069
+ });
1070
+ cardId = posted.id;
1071
+ } finally {
1072
+ if (!hadCardSignal) consumeCardPostedThisTurn();
1073
+ }
1074
+ // Only AFTER the post: a memo written first would suppress the card forever if the post failed.
1075
+ await markRoutinePermissionAsked(
1076
+ offer.org,
1077
+ grantKey,
1078
+ plan.askedMemoKind,
1079
+ offer.requestedBy,
1080
+ new Date().toISOString(),
1081
+ );
1082
+ // The pointer is resolved AFTER the post, off the row `setPendingActionMessage` has just
1083
+ // stamped — which is why the same call serves this fire and every later one (OPE-1356).
1084
+ const at = cardId ? await routinePermissionCardPointer(offer.org, cardId) : {};
1085
+ const clause = routinePermissionRefusalClause(plan.state, true, at.permalink);
1086
+ if (budgetMs <= 0 || plan.grantKind === undefined) {
1087
+ noteRunRefusal(plan.state, plan.grantKind, at, cardId !== undefined);
1088
+ return { clause };
1089
+ }
1090
+ const settled = await settleRoutineCardWait(offer.org, { cardId, grantKey, grantKind: plan.grantKind }, clause, budgetMs);
1091
+ return noteUnlessArmed(settled, plan.state, plan.grantKind, at, cardId !== undefined);
1092
+ } catch {
1093
+ // TWO REGIONS REACH HERE, and they leave the world in different states. The ordinary one is a card that did not post: the refusal says nothing about a card, no ask-memo was written, and the next fire tries again.
1094
+ // The `try` also covers the WAIT, which runs after a successful post and after the memo — an escape there returns the same empty clause, so the refusal UNDER-claims rather than inventing a sentence that points at a card.
1095
+ return { clause: "" };
1096
+ }
1097
+ }
1098
+
1099
+ // 🔴 THE SEAM IS FILLED HERE, AT MODULE LOAD, and only here: the connector fence calls the slot rather than this function, because a connection module resolved at eve boot must not drag this module's channel and card graph in. An empty slot answers the empty clause, which is the honest degradation.
1100
+ // 🔴 The CLAUSE is taken and the rest DROPPED at this boundary — rebuilding the answer as `{ clause }` is what makes "the seam cannot widen a refusal" true by construction rather than by a caller's discipline. No injected poster: the card resolves its own from the routine's platform.
1101
+ registerRoutinePermissionCardOfferer(async (offer) => ({ clause: (await offerRoutinePermissionCard(offer, {})).clause }));
1102
+
1103
+ /** 🔴 THE LEDGER IS WRITTEN AFTER THE WAIT, NEVER BEFORE IT: a wait that ends `approved` lets the run proceed, so a loss recorded first would put "this run asked for permissions it does not have" on the report of a run that got the permission and used it. `armedBy` is the one signal that it proceeded. */
1104
+ function noteUnlessArmed(
1105
+ settled: RoutinePermissionCardOutcome,
1106
+ state: RoutinePermissionCardState,
1107
+ grantKind: string | undefined,
1108
+ at: RoutineCardPointer,
1109
+ cardPosted: boolean,
1110
+ ): RoutinePermissionCardOutcome {
1111
+ if (settled.armedBy === undefined) noteRunRefusal(state, grantKind, at, cardPosted);
1112
+ return settled;
1113
+ }
1114
+
1115
+ /**
1116
+ * 🔴 `cardPosted` COMES FROM THE PLANNER, NOT FROM THE POINTER: `routinePermissionCardPointer` returns `{}` on any throw, so deriving it here would report "no card is waiting" about a card sitting in the routine's room — the overclaim that sends an owner to the `edit_routine` bump that destroys it.
1117
+ * The pointer read decides the PERMALINK and nothing else.
1118
+ */
1119
+ function noteRunRefusal(state: RoutinePermissionCardState, grantKind: string | undefined, at: RoutineCardPointer, cardPosted: boolean): void {
1120
+ if (grantKind === undefined) return;
1121
+ noteRoutineRunPermissionRefusal({
1122
+ permission: describeDeclaredPermissionKind(grantKind),
1123
+ // 🔴 THE PERMALINK ONLY, NEVER THE ROOM (OPE-1383). `at.room` is the raw
1124
+ // `platform/workspace/channel` triple off the card's frozen row, and the block that renders this
1125
+ // pointer rides every reply, not just the routine's report post. What a reader needs — that a
1126
+ // card is waiting at all — travels as the boolean instead.
1127
+ card: at.permalink ?? null,
1128
+ cardPosted,
1129
+ // This producer IS the card plane's own consult, so it is never the capped case — the cap
1130
+ // short-circuits in `approvals/routine-permission-offer.ts` before this function is reached.
1131
+ cardCapped: false,
1132
+ // `unreadable` is the ONE state that established nothing about the card. Every other state got
1133
+ // here off a row it read — including `declined`, where "no card" is a fact and worth saying.
1134
+ cardKnown: state !== "unreadable",
1135
+ });
1136
+ }
1137
+
1138
+ /**
1139
+ * THE TIMED WAIT between "a card is on the surface" and the refusal being thrown. 🔴 IT DECIDES NOTHING ABOUT THE CARD: on a deadline it simply stops polling — no CAS, no expiry, no row — because the run's question ("may I do this right now?") and the card's ("may this routine do this at all?") are different questions.
1140
+ * 🔴 An approval is taken ONLY with the grant row in hand: `armedBy` is read back from the row a click writes, so a click that armed nothing cannot let the run proceed.
1141
+ */
1142
+ async function settleRoutineCardWait(
1143
+ org: string,
1144
+ ctx: { readonly cardId: string; readonly grantKey: string; readonly grantKind: string },
1145
+ cardClause: string,
1146
+ budgetMs: number,
1147
+ ): Promise<RoutinePermissionCardOutcome> {
1148
+ const outcome = await waitForRoutineCardDecision(budgetMs, {
1149
+ probe: () => routineCardProbe(org, ctx.cardId, ctx.grantKey, ctx.grantKind),
1150
+ sleep: (ms) => new Promise<void>((resolve) => setTimeout(resolve, ms)),
1151
+ nowMs: () => Date.now(),
1152
+ });
1153
+ emitTelemetry("oe.feature.used", { "oe.feature": "routine_permission_card_wait", "oe.outcome": outcome });
1154
+ if (outcome === "approved") {
1155
+ const armedBy = await routineCardArmedBy(org, ctx.grantKey, ctx.grantKind);
1156
+ // No `armedBy` after an `approved` verdict means the row vanished between the probe and this
1157
+ // read — a revoke landing mid-wait. Fall through to the refusal rather than proceeding on a
1158
+ // permission that is no longer held.
1159
+ if (armedBy !== undefined) return { clause: cardClause, armedBy, waited: true };
1160
+ }
1161
+ // 🔴 THE PRE-WAIT CLAUSE SURVIVES ONLY WHERE IT IS STILL TRUE. It was computed BEFORE the wait and
1162
+ // describes the card at wait start ("nobody has decided it yet"); the wait clause describes it at
1163
+ // wait end. Concatenating both unconditionally puts "nobody has decided it yet" and "a person
1164
+ // declined it" in one paragraph. Only the deadline leaves the card as the first sentence found it.
1165
+ const waitClause = routineCardWaitRefusalClause(outcome, Math.round(budgetMs / 1_000));
1166
+ return { clause: (routineCardKeepsStateClause(outcome) ? cardClause : "") + waitClause, waited: true };
1167
+ }
1168
+
1169
+ /** Platform-aware CardPoster selection: a non-Slack surface's poster is registered by its provider bundle, and Slack registers none so requestApproval's default Block Kit path runs unchanged. Platforms with no card path never get here — {@link hasApprovalCardPath} refuses them at plan time. */
1170
+ export function approvalPostDeps(platform: string, authorityContext?: BindableContext): RequestApprovalDeps {
1171
+ const poster = cardPosterFor(platform);
1172
+ return {
1173
+ ...(poster ? { postCard: poster } : {}),
1174
+ ...(authorityContext ? { authorityContext } : {}),
1175
+ };
1176
+ }
1177
+
1178
+ /**
1179
+ * The surfaces that can render Approve/Reject: Slack (the built-in Block Kit path) plus any platform whose bundle registered a CardPoster.
1180
+ * 🔴 It answers a property of a ROOM, never of a request — for "can this REQUEST work from here", reach for {@link checkApprovalVenue} instead. A surface with no card path is now ROUTED (approvals/card-venue.ts) rather than refused.
1181
+ */
1182
+ export function hasApprovalCardPath(platform: string): boolean {
1183
+ return platform === "slack" || cardPosterFor(platform) !== undefined;
1184
+ }
1185
+
1186
+ /**
1187
+ * Is `row` a spend-cap pending whose level needs ORG-ADMIN approval specifically? Two levels qualify: "domain", because a domain admin is a domain LEAD and not the budget owner, and "user", because a per-person allowance is an act about a NAMED THIRD PARTY who is not in the room the card lands in and has no seat.
1188
+ * The frozen `domain` is independently null on every user-level row, so the domain-admin fallback is unreachable there twice over — a fence a single future edit can open is not a fence. Parse failure reads as "not one of those levels", fail-soft, which can only narrow what this refuses.
1189
+ */
1190
+ export function isOrgAdminOnlySpendCap(row: PendingActionRow): boolean {
1191
+ if (row.kind !== "spend.set" && row.kind !== "spend.clear") return false;
1192
+ try {
1193
+ const args = JSON.parse(row.argsJson) as { level?: unknown };
1194
+ return args.level === "domain" || args.level === "user";
1195
+ } catch {
1196
+ return false;
1197
+ }
1198
+ }
1199
+
1200
+ /**
1201
+ * Standing is checked against the row's FROZEN `domain`, never a domain re-resolved from the current channel — a domain reassignment must not silently change who can decide an already-posted card. A domain-level or USER-level spend cap is ORG-ADMIN ONLY, and the domain-admin fallback never applies to either.
1202
+ * 🔴 FAIL-CLOSED without a clicker platform or tenant: a bare id would otherwise match another platform's — or another workspace's — roster entry that happens to be the same digits, and admin-tier approval is on the other side of this predicate. The `platformAdmin` seam is unaffected.
1203
+ */
1204
+ /** The (platform, tenant) a ROOM key names, or `undefined` when it names no room. One parse for
1205
+ * both halves — a key that yields a platform always yields its workspace too, so the two can never
1206
+ * be sourced from different fallback rungs and end up describing different rooms. */
1207
+ function roomNamespace(scopeKey: string | undefined | null): { readonly platform: string; readonly tenant: string } | undefined {
1208
+ if (!scopeKey) return undefined;
1209
+ const parsed = parseScopeKey(scopeKey);
1210
+ return parsed.kind === "tenant" || parsed.kind === "surface" ? { platform: parsed.platform, tenant: parsed.workspace } : undefined;
1211
+ }
1212
+
1213
+ export function clickerMayDecide(
1214
+ row: PendingActionRow,
1215
+ clickerId: string,
1216
+ clickerPlatform: string | undefined,
1217
+ clickerTenant: string | undefined,
1218
+ ): boolean {
1219
+ if (!clickerPlatform) return false;
1220
+ const domains = getConfig().loadDomains();
1221
+ const key = tryPrincipalKey(clickerPlatform, clickerTenant, clickerId);
1222
+ if (key === undefined) return false;
1223
+ if (criteriaDomain("org", domains)?.admins?.includes(key) === true) return true;
1224
+ if (isOrgAdminOnlySpendCap(row)) return false;
1225
+ if (!row.domain) return false;
1226
+ const explicit = domains.find((d) => d.name === row.domain);
1227
+ return explicit?.admins?.includes(key) === true;
1228
+ }
1229
+
1230
+ /** The subset of Slack's `block_actions` interactivity payload this handler reads. Loosely
1231
+ * typed (see card.ts's SlackBlock note) — this is untrusted-shape wire JSON, probed rather
1232
+ * than assumed. */
1233
+ interface BlockActionsPayload {
1234
+ readonly actions?: readonly { readonly action_id?: unknown; readonly value?: unknown }[];
1235
+ readonly user?: { readonly id?: unknown };
1236
+ readonly channel?: { readonly id?: unknown };
1237
+ readonly message?: { readonly ts?: unknown };
1238
+ /** The workspace the click came from — needed to form the proposing channel's fully-qualified
1239
+ * surfaceKey (`slack/<team>/<channel>`) for the window-domain check. Slack always includes it on
1240
+ * an interactive payload; absent ⇒ the decision wake is skipped (fail-soft). */
1241
+ readonly team?: { readonly id?: unknown };
1242
+ }
1243
+
1244
+ export interface HandleApprovalDeps {
1245
+ readonly post?: PostFn;
1246
+ /** Seam for the cross-thread DECISION WAKE (task #102): injected in tests to capture the dispatch
1247
+ * without a live eve receive. Absent ⇒ the real {@link wakeWindowOnDecision} deps (the live
1248
+ * {@link dispatchApprovalDecisionWake}). */
1249
+ readonly decisionWake?: DecisionWakeDeps;
1250
+ /** OPTIONAL positive per-clicker guest verdict, fed to {@link resolveApprovalClick}'s `clickerIsGuest`. `true`/`false` when the surface can positively classify the clicker, `undefined` when it cannot — `undefined` is ALWAYS inert. Core stays Slack-probe-free, so there is no live default; the Slack front wires one in. */
1251
+ readonly clickerIsGuest?: (userId: string, teamId: string | undefined) => Promise<boolean | undefined>;
1252
+ /** The Slack route's own `waitUntil`, forwarded whole to {@link ResolveApprovalClickInput.waitUntil} — see there for what it governs and what an absent one means. This handler is core, so the front route supplies it rather than this module reaching for a host API. */
1253
+ readonly waitUntil?: (p: Promise<unknown>) => void;
1254
+ }
1255
+
1256
+ async function updateCard(post: PostFn, channelId: string, ts: string | undefined, card: RenderedCard): Promise<void> {
1257
+ if (!ts) return; // no message to update (shouldn't happen once a row has a messageTs) — degrade silently
1258
+ // The shared egress exit (channels/egress-spoof.ts). THIS is the common card rewrite — every
1259
+ // Approve/Reject click lands here, and `ts` comes off the LIVE Slack payload rather than the
1260
+ // `spoof-card-…` synthetic, so without this gate a spoofed run holding a bot token really
1261
+ // rewrites a real card. `updateCardText` below carries the same gate for the rarer copy.
1262
+ if (swallowRoomOp("a slack approval-card rewrite")) return;
1263
+ const body = new URLSearchParams();
1264
+ body.set("channel", channelId);
1265
+ body.set("ts", ts);
1266
+ body.set("text", card.text);
1267
+ body.set("blocks", JSON.stringify(card.blocks));
1268
+ await post("chat.update", body.toString());
1269
+ }
1270
+
1271
+ async function updateCardText(post: PostFn, channelId: string, ts: string | undefined, text: string): Promise<void> {
1272
+ if (!ts) return;
1273
+ // The shared egress exit (channels/egress-spoof.ts) — a card rewrite changes what the room sees,
1274
+ // so it is a room post like any other.
1275
+ if (swallowRoomOp("a slack approval-card rewrite")) return;
1276
+ const body = new URLSearchParams();
1277
+ body.set("channel", channelId);
1278
+ body.set("ts", ts);
1279
+ body.set("text", text);
1280
+ // chat.update KEEPS a message's existing blocks unless new ones are sent — and blocks
1281
+ // take render precedence over text. Replace them with the plain text, or the stale
1282
+ // Approve/Reject buttons would stay visible (and clickable) under the new message.
1283
+ body.set("blocks", JSON.stringify([{ type: "section", text: { type: "mrkdwn", text } }]));
1284
+ await post("chat.update", body.toString());
1285
+ }
1286
+
1287
+ /**
1288
+ * Post ONE code-rendered Block Kit message. `ts` on success; `error` on any failure.
1289
+ * Shared by the pending card and the judge-lift notice so the two cannot drift in how they send
1290
+ * the same shape (`text` is the required plain-text fallback; `blocks` is the render).
1291
+ * 🔴 `error` IS TOKEN-FREE BY CONSTRUCTION, and that is what lets a caller report WHY: it carries
1292
+ * Slack's own `error` enum code and nothing else — no header, no response body, no token — exactly
1293
+ * as channels/surface-message-ops.ts's strict post already does. A caller that discards it leaves
1294
+ * the person who must act on the failure with no reason at all (OPE-1861).
1295
+ */
1296
+ async function postRenderedCard(post: PostFn, channelId: string, threadTs: string | null | undefined, card: RenderedCard): Promise<{ ts?: string; error?: string }> {
1297
+ const body = new URLSearchParams();
1298
+ body.set("channel", channelId);
1299
+ if (threadTs) body.set("thread_ts", threadTs);
1300
+ body.set("text", card.text);
1301
+ body.set("blocks", JSON.stringify(card.blocks));
1302
+ const res = await post("chat.postMessage", body.toString());
1303
+ if (res?.ok === true && typeof res.ts === "string") return { ts: res.ts };
1304
+ // THREE CAUSES, THREE STRINGS. Collapsing them loses the operator's next step: a swallowed network
1305
+ // error read as "no bot token" sends someone to rotate a credential that is fine.
1306
+ if (res && typeof res["error"] === "string") return { error: res["error"] as string };
1307
+ // `res` is undefined when no bot token is configured, or the bridge's own fail-soft form()
1308
+ // swallowed a network error before this point. Those two are genuinely indistinguishable here,
1309
+ // so the string names both rather than picking one.
1310
+ if (!res) return { error: "no bot token is configured, or the request never reached the surface" };
1311
+ return { error: "the surface accepted the post but named no message id" };
1312
+ }
1313
+
1314
+ /** The key {@link cardPostFailureReason} reads. Its own symbol, so the producer and the reader
1315
+ * cannot drift on a string literal. */
1316
+ const CARD_POST_REASON_KEY = "oeCardPostReason";
1317
+
1318
+ /**
1319
+ * The transport's own refusal reason for a failed card post, or undefined when the error is not one.
1320
+ * 🔴 IT IS A PROPERTY, NOT THE MESSAGE. A caller that must tell a person what to do next used to
1321
+ * have only the thrown sentence to read, and that sentence also interpolates the kind and the scope
1322
+ * key — so a room called `404` classified as an unreachable room (OPE-1861). The reason travels
1323
+ * beside the message instead, and the message stays the human-readable half.
1324
+ */
1325
+ export function cardPostFailureReason(err: unknown): string | undefined {
1326
+ if (typeof err !== "object" || err === null) return undefined;
1327
+ const reason = (err as Record<string, unknown>)[CARD_POST_REASON_KEY];
1328
+ return typeof reason === "string" ? reason : undefined;
1329
+ }
1330
+
1331
+ async function postThreadNote(post: PostFn, channelId: string, threadTs: string | undefined, text: string): Promise<void> {
1332
+ // The shared egress exit (channels/egress-spoof.ts) — the click path's refusal notes are room
1333
+ // posts too.
1334
+ if (swallowRoomOp("a slack approval thread note")) return;
1335
+ const body = new URLSearchParams();
1336
+ body.set("channel", channelId);
1337
+ if (threadTs) body.set("thread_ts", threadTs);
1338
+ body.set("text", text);
1339
+ await post("chat.postMessage", body.toString());
1340
+ }
1341
+
1342
+ /**
1343
+ * The decision outcome posted as a NEW message into the pending's anchor thread. The click path otherwise only EDITS the card in place, which the owning session's backscroll never sees — so without this the proposing session sits on stale "already pending" knowledge and re-proposes against a dead card.
1344
+ * A rejected or expired notice must state plainly that NOTHING was applied and a fresh proposal is fine; it must never read as "approved" or auto-retry. `<@id>` is the mention syntax on Slack AND Discord, so one render feeds both.
1345
+ */
1346
+ function decisionNoticeText(summaryLines: string[], outcomeLine: string, clickerId: string, status: PendingStatus): string {
1347
+ const what = summaryLines[0] ?? "the requested change";
1348
+ // A kind whose DECLINE is durable returns a line saying what the decline recorded, and it
1349
+ // REPLACES the "propose again" tail — for that kind the whole point is that nothing will propose
1350
+ // it again. Every other reject passes the literal "rejected" and reads exactly as it always did.
1351
+ if (status === "rejected") {
1352
+ return outcomeLine === "rejected"
1353
+ ? `⛔ Approval REJECTED by <@${clickerId}> — "${what}" was NOT applied. Propose again if it's still needed.`
1354
+ : `⛔ Approval REJECTED by <@${clickerId}> — "${what}" was NOT applied. ${outcomeLine}.`;
1355
+ }
1356
+ if (status === "expired") return `⌛ Approval EXPIRED without a decision — "${what}" was NOT applied. Propose again if it's still needed.`;
1357
+ return `✅ Approval APPROVED by <@${clickerId}> — "${what}": ${outcomeLine}`;
1358
+ }
1359
+
1360
+ /** Re-render a row's summary lines from its own (kind, frozen argsJson) — used whenever the
1361
+ * click path needs to redraw the card without re-deriving args from anywhere else. */
1362
+ function summaryLinesFor(row: PendingActionRow): string[] {
1363
+ const kindDef = actionKind(row.kind);
1364
+ if (!kindDef) return [`(no registered ActionKind for "${row.kind}")`];
1365
+ try {
1366
+ const args = JSON.parse(row.argsJson);
1367
+ // `live: false` — a redraw happens in whatever turn the CLICKER is in, and that turn's taint has
1368
+ // nothing to do with this proposal's. Only the frozen flag speaks here (OPE-307).
1369
+ return withTaintDisclosure(kindDef.summarize(args), args, { live: false });
1370
+ } catch {
1371
+ return ["(failed to render this pending's summary)"];
1372
+ }
1373
+ }
1374
+
1375
+ /** What one decide attempt resolved to — the discriminated result every surface renders in its own idiom. The store mutation, the audit rows and the kind execution have ALREADY happened by the time this returns: a caller only draws UI from it, never decides anything further. */
1376
+ export type ApprovalClickResolution =
1377
+ /** No row for (org, id) — a stale card from before an aged-out sweep, or garbage. */
1378
+ | { readonly outcome: "unknown" }
1379
+ /** Already decided/expired — a stale re-click or a double-click race that lost. Nothing to
1380
+ * do; re-rendering risks clobbering a legitimate decided card with an outdated `row`. */
1381
+ | { readonly outcome: "not-pending" }
1382
+ /** This click's lazy-expiry CAS won: the row is now expired, render the expired card. */
1383
+ | { readonly outcome: "expired"; readonly row: PendingActionRow; readonly summaryLines: string[] }
1384
+ /** The row was past its TTL but someone else's CAS (click or sweep) got there first. */
1385
+ | { readonly outcome: "expired-race" }
1386
+ /** No registered ActionKind for the row's kind — cannot decide (already console.error'd). */
1387
+ | { readonly outcome: "unregistered-kind" }
1388
+ /** Admin-policy kind, clicker has no standing. The row is NOT consumed — it stays
1389
+ * "pending" so a real admin can still act on the same card. */
1390
+ | { readonly outcome: "denied"; readonly row: PendingActionRow }
1391
+ /** The CLICK ITSELF was refused before the policy branch (OPE-185, approvals/clicker-floor.ts):
1392
+ * an observed-guest room, an unattested room on a beneficiary kind, or a click from a room that
1393
+ * isn't the card's. Like "denied", the row is NOT consumed — it stays "pending" so the same card
1394
+ * can still be decided from an internal room. `reason` selects the copy the surface renders. */
1395
+ | { readonly outcome: "clicker-denied"; readonly row: PendingActionRow; readonly reason: ClickerFloorRefusal }
1396
+ /** Someone else's click won the decide CAS first — silent, the winner renders the card. */
1397
+ | { readonly outcome: "lost-race" }
1398
+ /**
1399
+ * A BREAK-GLASS HALT covers the row's frozen address, and the lift's own card is EXEMPT here. 🔴 THE HALT EDITS NO ROW: the pending stays `pending` — no decide CAS, no lazy-expiry CAS, no execute — so the SAME card is clickable again once an admin runs `resume`.
1400
+ * 🔴 THE BOUND ON "STILL CLICKABLE": the TTL SWEEP is not halt-gated, so a halt longer than `approvals.ttlHours` loses the outstanding cards to the sweep anyway and those proposals have to be re-asked. This arrow refuses; it does not preserve.
1401
+ */
1402
+ | { readonly outcome: "halted"; readonly row: PendingActionRow; readonly notice: string }
1403
+ /** Decided (approved — executed, possibly `FAILED: …` — or rejected). `row` carries the
1404
+ * decided status/decidedBy; `outcomeLine` is the executor's outcome line — or, on a reject, the
1405
+ * literal "rejected" unless the kind implements `declined()` (approvals/types.ts), in which case
1406
+ * it is that hook's line and BOTH renderers show it. Audits already appended. */
1407
+ | {
1408
+ readonly outcome: "decided";
1409
+ readonly row: PendingActionRow;
1410
+ readonly summaryLines: string[];
1411
+ readonly outcomeLine: string;
1412
+ /** Whether the kind's `execute` RAN and how it ended — "none" for a reject (nothing runs).
1413
+ * Required, so a new decide return site cannot forget the fact the decision wake needs
1414
+ * (OPE-1097): the resumed seat is told the approved act already ran, in the executor's own
1415
+ * words, and a `FAILED:` prefix on `outcomeLine` is never the thing that decides it. */
1416
+ readonly executed: "ok" | "failed" | "none";
1417
+ }
1418
+ /** A "this should not have run" click on a judge-lift wedge row: NOTHING executes and no row is consumed — the act already happened, and this only records the human's overrule in the audit trail, where it changes nothing automatically. */
1419
+ | {
1420
+ readonly outcome: "contradicted";
1421
+ readonly row: PendingActionRow;
1422
+ readonly summaryLines: string[];
1423
+ readonly contradiction: ContradictJudgeAllowOutcome;
1424
+ };
1425
+
1426
+ export interface ResolveApprovalClickInput {
1427
+ readonly org: string;
1428
+ readonly id: string;
1429
+ readonly decision: ApprovalDecision;
1430
+ readonly clickerId: string;
1431
+ /**
1432
+ * OPTIONAL platform-native admin standing, evaluated against the FROZEN row and OR-ed with the config-as-code roster. Discord passes guild-administrator standing; Slack passes nothing, so its only admin source is the roster.
1433
+ * A predicate rather than a boolean because the standing may depend on the row being decided, and async because the DM-click leg needs I/O. Only evaluated on a roster MISS, so the common case never pays it.
1434
+ */
1435
+ readonly platformAdmin?: (row: PendingActionRow) => boolean | Promise<boolean>;
1436
+ /**
1437
+ * Where the click PHYSICALLY happened, as a fully-qualified `platform/workspace/surface` key, taken from the CLICK and never from the frozen row — an explicit-scope override can freeze a scopeKey naming a foreign workspace.
1438
+ * 🔴 ABSENT ⇒ THE CLICKER GATE DOES NOT RUN AT ALL, deliberately: the headless control plane has no room and no clicker context and is already authorized by its own RBAC. Keying the gate on `platformAdmin` instead would kill that plane, since it asserts `() => true` there.
1439
+ */
1440
+ readonly clickContext?: { readonly surfaceKey: string };
1441
+ /** Notice deps for the session-grant RELEASE, and nothing else on this path: the rows it decides have no platform handler above them, so the release posts their notices itself off each row's own frozen `postedTo`. Absent ⇒ the live posters. The clicked row's OWN feedback is unaffected. */
1442
+ readonly releaseFeedback?: SweepFeedbackDeps;
1443
+ /** The PLATFORM the clicker's id lives in — supplied explicitly by the surface, because a click id is only meaningful inside its own vendor's namespace and nothing else on this input reliably carries it. Absent ⇒ the ROSTER arm of `clickerMayDecide` refuses; `platformAdmin` is unaffected. */
1444
+ readonly clickerPlatform?: string;
1445
+ /** The TENANT the clicker's id was issued by, on a tenant-scoped platform, and ignored by the rest so a provider need not know which those are. Omitted, it falls back to the WORKSPACE segment of the click's own room key. Absent AND underivable on a tenant-scoped platform ⇒ the ROSTER arm refuses. */
1446
+ readonly clickerTenant?: string;
1447
+ /** OPTIONAL positive per-clicker guest verdict — clicker-floor.ts's leg D, supplied by a surface that can positively classify the clicking person. `undefined` (the default) leaves leg D inert, exactly as if the surface had never been asked. */
1448
+ readonly clickerIsGuest?: boolean;
1449
+ /** Injection seam for the HALT arrow below — the same `HaltDeps` shape access/halt.ts gives every other arrow, so a test can drive a halted click without an operational store. Absent ⇒ the live store. */
1450
+ readonly halt?: HaltDeps;
1451
+ /**
1452
+ * The host's "keep this promise alive past the response" hook. It governs the session-grant RELEASE and nothing else: PRESENT ⇒ the release runs OFF the response path, so the interactivity ack is written before any sibling card executes.
1453
+ * ABSENT ⇒ the release is AWAITED, not deferred: on a serverless host a promise with nowhere to live is frozen with the invocation, so a defer with no `waitUntil` would DROP the release rather than defer it.
1454
+ */
1455
+ readonly waitUntil?: (p: Promise<unknown>) => void;
1456
+ }
1457
+
1458
+ /** The ONE refused-click audit row; `reason` is the whole point of it — the admin-standing refusal, the three clicker-floor legs and the break-glass arrow. Best-effort like every other audit here: a refusal is already the safe outcome, so a failed audit write must never become a thrown error the surface has to render. */
1459
+ async function auditClickerDenial(
1460
+ org: string,
1461
+ row: PendingActionRow,
1462
+ clickerId: string,
1463
+ reason: ClickerFloorRefusal | "not-admin" | "halted",
1464
+ /** Pass the click's own room key ONLY where {@link clickRoomMatches} has ALREADY passed. On a `foreign-room` refusal the click came from a room that is provably NOT the card's, so feeding it here would let a legacy row stamp the intruder's room as the venue. */
1465
+ clickSurfaceKey?: string,
1466
+ /** Reason-specific ids and names — today the halt address (`haltAuditDetail`). IDS AND NAMES
1467
+ * ONLY, like every other detail on this row; never free text from a caller. */
1468
+ extraDetail?: Record<string, unknown>,
1469
+ ): Promise<void> {
1470
+ await appendAudit({
1471
+ ...whereFromScope(org, row.scopeKey),
1472
+ principalId: clickerId,
1473
+ action: "approval.denied",
1474
+ // The venue matters MOST on this row (OPE-332): `foreign-room` and `audience-floor` are claims
1475
+ // about a room, and until now the row named the reason without ever naming the room.
1476
+ detail: { id: row.id, kind: row.kind, ...venueDetail(row, clickSurfaceKey), reason, ...extraDetail },
1477
+ }).catch(() => undefined);
1478
+ }
1479
+
1480
+ /** Is this pending's frozen proposal TAINTED? Read generically off the frozen JSON, so the click core never imports one kind's arg shape. Anything unparseable reads as TAINTED — the fail-closed direction, so a proposal whose taint cannot be established never rides another card's session grant. */
1481
+ function taintedFrozenProposal(argsJson: string): boolean {
1482
+ try {
1483
+ return (JSON.parse(argsJson) as { tainted?: unknown }).tainted === true;
1484
+ } catch {
1485
+ return true;
1486
+ }
1487
+ }
1488
+
1489
+ /**
1490
+ * How many sibling cards ONE session grant releases. Each released row runs a real `execute`, so the candidate set is the only thing that bounds the work a single button press does — the cap stops a looping seat or a grown pending set turning one click into an arbitrarily long chain.
1491
+ * 🔴 PAST THE CAP THE EXTRA CARDS ARE LEFT PENDING, NOT DECIDED: they stay clickable, which is the pre-release position and is safe.
1492
+ */
1493
+ export const MAX_SESSION_GRANT_RELEASES = 32;
1494
+
1495
+ /**
1496
+ * RELEASE THE CARDS THE SESSION GRANT ALREADY COVERS. A parent that fans out N workers has all N carded before any click exists, and the frozen args differ, so one "Approve for session" click used to leave N−1 stale cards each still needing its own. A row is released exactly when a FRESH propose of it would now skip its card: same session, same memo kind, not tainted, not halted.
1497
+ * 🔴 NOT RETROACTIVE — only rows still `pending` are touched — and it decides with `approve`, never `approve_session`, so one click writes ONE memo and this cannot recurse. A released row's CARD is not re-rendered; a stale button costs one wasted press, since the CAS has already decided the row. Best-effort throughout.
1498
+ */
1499
+ async function releaseSessionGrantedPendings(input: {
1500
+ readonly sessionId: string;
1501
+ readonly memoKind: string;
1502
+ /** The row the human clicked — never released by its own grant; its click path decides it. */
1503
+ readonly grantedOn: PendingActionRow;
1504
+ /**
1505
+ * The human's OWN click, forwarded whole. 🔴 EVERY RELEASED ROW RUNS THE SAME CLICKER GATE against its OWN room: passing only the clicker id would leave `clickContext` absent, which turns that gate off entirely and would execute a card in a room this member may not act in. A grant spreads a decision; it may not spread reach.
1506
+ * 🔴 The card-audience gate is NOT re-run here, and nothing re-runs it — it is a PROPOSE-time gate every released row already passed when its own card was minted.
1507
+ */
1508
+ readonly click: ResolveApprovalClickInput;
1509
+ }): Promise<readonly string[]> {
1510
+ const org = input.click.org;
1511
+ const released: string[] = [];
1512
+ try {
1513
+ const store = getOperationalStore();
1514
+ // `listPendingActions` is `WHERE status = 'pending'`, which is exactly the set at issue.
1515
+ const matched = (await store.listPendingActions(org)).filter(
1516
+ (r) =>
1517
+ r.id !== input.grantedOn.id &&
1518
+ sessionIdFromFrozenArgs(r.argsJson) === input.sessionId &&
1519
+ sessionGrantKind(r) === input.memoKind &&
1520
+ !taintedFrozenProposal(r.argsJson),
1521
+ );
1522
+ // The cap is read on the CANDIDATE SET, before any row is decided, so it bounds the work rather than the outcome. Both store adapters order `listPendingActions` by `created_at ASC`, so the slice keeps the OLDEST cards — the ones nearest their TTL.
1523
+ const candidates = matched.slice(0, MAX_SESSION_GRANT_RELEASES);
1524
+ if (matched.length > candidates.length) {
1525
+ console.warn(
1526
+ `[open-everywhere:approvals] session-grant release capped at ${String(candidates.length)} of ${String(matched.length)} candidate cards (org=${org}); the rest stay pending and clickable`,
1527
+ );
1528
+ }
1529
+ for (const candidate of candidates) {
1530
+ const halt = await resolveHalt(
1531
+ haltScopeFor({
1532
+ org,
1533
+ scopeKey: candidate.scopeKey,
1534
+ domain: candidate.domain,
1535
+ principalId: candidate.requestedBy,
1536
+ }),
1537
+ ).catch(() => ({ halted: true }) as { readonly halted: boolean });
1538
+ if (halt.halted) continue;
1539
+ // The ordinary approve path, so the release takes the SAME CAS, the same gates, the same
1540
+ // execute and the same `approval.approved` row a human's own click would take.
1541
+ // `approve`, never `approve_session`: one click writes one memo.
1542
+ const outcome = await resolveApprovalClick({ ...input.click, id: candidate.id, decision: "approve" });
1543
+ if (outcome.outcome !== "decided") continue;
1544
+ released.push(candidate.id);
1545
+ // `resolveApprovalClick` does not post, and this call has no platform handler above it, so the release delivers the notice itself off the row's own mint-frozen `postedTo`. Without it a released row would execute in silence, and a released execute that FAILED would exist only in an audit row nobody in the room reads.
1546
+ await rowDecisionFeedback(
1547
+ outcome.row ?? candidate,
1548
+ {
1549
+ summaryLines: outcome.summaryLines ?? summaryLinesFor(candidate),
1550
+ // "approved" is the OUTCOME the room is told, and it is right whether the kind's own
1551
+ // `execute` succeeded or failed — `executed` carries that half, and `outcomeLine` carries its
1552
+ // text, so a released act that failed says so in the room rather than reading as a clean one.
1553
+ outcome: "approved",
1554
+ outcomeLine: outcome.outcomeLine ?? "approved",
1555
+ executed: outcome.executed ?? "none",
1556
+ clickerId: input.click.clickerId,
1557
+ },
1558
+ input.click.releaseFeedback ?? {},
1559
+ ).catch(() => undefined);
1560
+ }
1561
+ // 🔴 A TRUNCATED SET IS AUDITED EVEN WHEN NOTHING WAS RELEASED. The `console.warn` above is a
1562
+ // webhook function's stdout, which does not reach an operator (slack-front.ts records that
1563
+ // measurement), so without this row "why did those cards not move?" has no answer in any durable
1564
+ // store — an operator would read one release row naming N ids and nothing saying a set was cut.
1565
+ const truncated = matched.length > candidates.length;
1566
+ if (released.length > 0 || truncated) {
1567
+ await appendAudit({
1568
+ ...whereFromScope(org, input.grantedOn.scopeKey),
1569
+ principalId: input.click.clickerId,
1570
+ action: SESSION_GRANT_RELEASED_ACTION,
1571
+ detail: {
1572
+ id: input.grantedOn.id,
1573
+ memoKind: input.memoKind,
1574
+ released,
1575
+ ...(truncated ? { candidates: matched.length, cap: MAX_SESSION_GRANT_RELEASES } : {}),
1576
+ },
1577
+ }).catch(() => undefined);
1578
+ }
1579
+ } catch (err) {
1580
+ console.warn(`[open-everywhere:approvals] session-grant release failed (org=${org}): ${err instanceof Error ? err.message : String(err)}`);
1581
+ }
1582
+ return released;
1583
+ }
1584
+
1585
+ /** The audit action naming the cards ONE session grant released — the join between a human's single click and the several actions it decided. Without it an operator sees N `approval.approved` rows attributed to someone who pressed one button, with nothing saying why. */
1586
+ export const SESSION_GRANT_RELEASED_ACTION = "approval.session_grant_released";
1587
+
1588
+ /** Run the release off the response path where the route gave us a hook. 🔴 NEVER THROWS, on either arm: the deferred arm runs after the response has gone, where a rejection would tell nobody anything, and the awaited arm sits in a `finally` whose job is to leave the caller's own resolution untouched. */
1589
+ async function runSessionGrantRelease(tail: () => Promise<unknown>, waitUntil: ((p: Promise<unknown>) => void) | undefined): Promise<void> {
1590
+ const logFailure = (err: unknown): undefined => {
1591
+ console.warn(`[open-everywhere:approvals] session-grant release tail failed: ${err instanceof Error ? err.message : String(err)}`);
1592
+ return undefined;
1593
+ };
1594
+ if (waitUntil === undefined) {
1595
+ await tail().catch(logFailure);
1596
+ return;
1597
+ }
1598
+ const deferred = tail().catch(logFailure);
1599
+ try {
1600
+ waitUntil(deferred);
1601
+ } catch (err) {
1602
+ // A host whose hook REFUSES the registration (an invocation already closing, a wrapper that
1603
+ // rejects late work). Awaiting is the only remaining way the release can happen at all, and it
1604
+ // is the shape a caller with no hook already gets — better a slow ack than a dropped release.
1605
+ logFailure(err);
1606
+ await deferred;
1607
+ }
1608
+ }
1609
+
1610
+ /** The ONE decide implementation: load the row, lazily expire it, check the approver policy, CAS-decide, execute the frozen args and audit the outcome, then report what happened for the surface to render. Throws only on genuinely unexpected failures; platform handlers wrap it in their own fail-soft catch. */
1611
+ export async function resolveApprovalClick(input: ResolveApprovalClickInput): Promise<ApprovalClickResolution> {
1612
+ const store = getOperationalStore();
1613
+ const row = await store.getPendingAction(input.org, input.id);
1614
+
1615
+ if (!row) return { outcome: "unknown" };
1616
+
1617
+ // THE CONTRADICT VERB reads a row that is ALREADY DECIDED, so it must skip the not-pending bail and the lazy-expiry CAS — both exist to protect a LIVE pending, and the wedge row's `expiresAt` is its own mint instant.
1618
+ // It still passes the kind lookup, the clicker gate and the admin-standing check: the row asserts that a person WITH STANDING judged the machine wrong, and without the check anyone could put that assertion in the honest record.
1619
+ const contradicting = input.decision === "contradict";
1620
+ if (!contradicting && row.status !== "pending") return { outcome: "not-pending" };
1621
+
1622
+ // 🔴 THE BREAK-GLASS HALT ARROW AT THE CLICK: a card minted before a halt was still fully clickable during one. It asks about the ROW'S FROZEN ADDRESS, byte-identically to the propose arrow's own question, so a halt that would have stopped this proposal stops its click too. THE LIMIT: the person axis names the REQUESTER, so a user-level halt on the CLICKER alone does not reach this arrow.
1623
+ // 🔴 TWO NARROW EXEMPTIONS: the LIFT VERB, because `resume` mints a card and the chain is where a halt denies — without it no chat lift could reopen the deployment, and the fail-closed arm would make an unreadable halt store unliftable; and CONTRADICT, which runs no `execute`, consumes no row and only records the honest record.
1624
+ if (!contradicting && row.kind !== HALT_LIFT_ACTION_KIND) {
1625
+ const haltState = await resolveHalt(
1626
+ haltScopeFor({
1627
+ org: input.org,
1628
+ scopeKey: row.scopeKey,
1629
+ domain: row.domain,
1630
+ ...(row.requestedBy ? { principalId: row.requestedBy } : {}),
1631
+ }),
1632
+ input.halt ?? {},
1633
+ );
1634
+ if (haltState.halted) {
1635
+ // No `clickSurfaceKey` here: this arrow runs BEFORE `clickRoomMatches`, so the click's own room is still unverified, and feeding it in would let a foreign-room click stamp the INTRUDER's workspace as the venue on a legacy row. The row's own `postedTo`/`scopeKey` answer the venue instead.
1636
+ await auditClickerDenial(input.org, row, input.clickerId, "halted", undefined, haltAuditDetail(haltState));
1637
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_decided", "oe.outcome": "halted" });
1638
+ return { outcome: "halted", row, notice: haltRefusalMessage(haltState, "deciding this request") };
1639
+ }
1640
+ }
1641
+
1642
+ const nowIso = new Date().toISOString();
1643
+ if (!contradicting && Date.parse(row.expiresAt) <= Date.now()) {
1644
+ const cas = await store.decidePendingAction(input.org, row.id, "expired", "system", nowIso);
1645
+ if (!cas) return { outcome: "expired-race" };
1646
+ const expiredRow: PendingActionRow = { ...row, status: "expired", decidedBy: "system", decidedAt: nowIso };
1647
+ // Terminal lifecycle row (audit-wedge WS-3): this late click's CAS just expired the pending —
1648
+ // audit it as an action taken (cause "ttl"), matching the failed-post site above.
1649
+ await appendAudit({
1650
+ ...whereFromScope(input.org, row.scopeKey),
1651
+ principalId: "system",
1652
+ action: "approval.expired",
1653
+ detail: { id: row.id, kind: row.kind, cause: "ttl" },
1654
+ });
1655
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_decided", "oe.outcome": "expired" });
1656
+ return { outcome: "expired", row: expiredRow, summaryLines: summaryLinesFor(expiredRow) };
1657
+ }
1658
+
1659
+ const kindDef = actionKind(row.kind);
1660
+ if (!kindDef) {
1661
+ console.error(`[open-everywhere:approvals] no registered ActionKind for "${row.kind}" (pending ${row.id}) — cannot decide`);
1662
+ return { outcome: "unregistered-kind" };
1663
+ }
1664
+
1665
+ // THE CLICKER GATE (OPE-185) — the only thing between "the transport says this click is real"
1666
+ // and the tier branch below. Runs after the kind lookup (leg B reads the kind's flag) and BEFORE
1667
+ // the policy branch, because a refusal here must never consume the row. Skipped entirely without
1668
+ // a clickContext — see the field doc for why that omission is load-bearing rather than lazy.
1669
+ if (input.clickContext) {
1670
+ const { surfaceKey } = input.clickContext;
1671
+ // Leg C — HARDENING, not a hole-closer. No exploit path was found for its absence; neither
1672
+ // Slack nor Discord lets a non-app principal post components carrying our action_id/custom_id.
1673
+ // Tier-independent on purpose: it is a claim about the click's provenance, not about standing.
1674
+ if (!clickRoomMatches(row, surfaceKey)) {
1675
+ // No `surfaceKey` argument on purpose — see the param doc on auditClickerDenial.
1676
+ await auditClickerDenial(input.org, row, input.clickerId, "foreign-room");
1677
+ return { outcome: "clicker-denied", row, reason: "foreign-room" };
1678
+ }
1679
+ // Legs A, B and D are MEMBER-TIER ONLY: the admin tier does not have this hole, because `clickerMayDecide` already pins the decider to the roster against the row's FROZEN domain.
1680
+ // What the admin tier does share is that the AUDIENCE is unconstrained even when the decider is — a disclosure problem, not a clicker problem, and refusing an admin decision here would cost real availability in externally-shared rooms to close a different hole.
1681
+ if (kindDef.policy === "member") {
1682
+ const verdict = await checkClickerFloor(surfaceKey, {
1683
+ beneficiaryClicker: kindDef.beneficiaryClicker === true,
1684
+ clickerIsGuest: input.clickerIsGuest,
1685
+ });
1686
+ if (!verdict.ok) {
1687
+ await auditClickerDenial(input.org, row, input.clickerId, verdict.reason, surfaceKey);
1688
+ return { outcome: "clicker-denied", row, reason: verdict.reason };
1689
+ }
1690
+ }
1691
+ }
1692
+
1693
+ // The clicker's namespace, best evidence first: what the surface told us, else the room the click came from, else the surface the card was posted into. All three are the SAME platform and workspace by construction — `clickRoomMatches` has already pinned the click to the card's room — so this is a fallback chain over availability, not over authority.
1694
+ const clickerRoom = roomNamespace(input.clickContext?.surfaceKey) ?? roomNamespace(row.postedTo);
1695
+ const clickerPlatform = input.clickerPlatform ?? clickerRoom?.platform;
1696
+ const clickerTenant = input.clickerTenant ?? clickerRoom?.tenant;
1697
+ if (kindDef.policy === "admin" && !clickerMayDecide(row, input.clickerId, clickerPlatform, clickerTenant) && (await input.platformAdmin?.(row)) !== true) {
1698
+ // A refused click is an ACTION-LIFECYCLE event as much as a decided one. `approval.denied` is that row, shared by both refusal families and distinguished by `reason`.
1699
+ await auditClickerDenial(input.org, row, input.clickerId, "not-admin", input.clickContext?.surfaceKey);
1700
+ return { outcome: "denied", row };
1701
+ }
1702
+
1703
+ // The room this decision is being made in (OPE-332), stamped into every audit row below. Resolved
1704
+ // ONCE here so an approve, a reject, a failed execute and the session-grant memo can never
1705
+ // disagree about where the same click happened.
1706
+ const venue = venueDetail(row, input.clickContext?.surfaceKey);
1707
+
1708
+ // Record the overrule and stop: no CAS, no execute, no decision feedback — the wedge row is already terminal and the act already ran. The producer owns the "is this really a judge lift?" test and the per-row de-duplication, so an ordinary approve/reject click can never reach it.
1709
+ if (contradicting) {
1710
+ const res = await contradictJudgeAllow({ org: input.org, id: row.id, principalId: input.clickerId, route: "click", venue });
1711
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_judge_contradicted", "oe.outcome": res.outcome });
1712
+ return { outcome: "contradicted", row, summaryLines: summaryLinesFor(row), contradiction: res.outcome };
1713
+ }
1714
+
1715
+ const status = input.decision === "reject" ? "rejected" : "approved";
1716
+ const cas = await store.decidePendingAction(input.org, row.id, status, input.clickerId, nowIso);
1717
+ if (!cas) return { outcome: "lost-race" }; // someone else's click (or the expiry sweep) won first
1718
+
1719
+ const decidedRow: PendingActionRow = { ...row, status, decidedBy: input.clickerId, decidedAt: nowIso };
1720
+ const summaryLines = summaryLinesFor(decidedRow);
1721
+
1722
+ if (status === "rejected") {
1723
+ await appendAudit({ ...whereFromScope(input.org, row.scopeKey), principalId: input.clickerId, action: "approval.rejected", detail: { id: row.id, kind: row.kind, ...venue } });
1724
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_decided", "oe.outcome": "rejected" });
1725
+ // THE DURABLE DECLINE: only kinds that declare the hook run anything here; for every other kind `outcomeLine` stays the literal "rejected". The row is ALREADY decided above, so a throw here becomes the line the clicker reads and changes nothing else.
1726
+ // 🔴 THE LINE IS SHOWN: a discarded result would leave a clicker believing a decline was remembered when it was not.
1727
+ let outcomeLine = "rejected";
1728
+ if (kindDef.declined) {
1729
+ outcomeLine = await kindDef
1730
+ .declined(JSON.parse(row.argsJson) as unknown, input.clickerId)
1731
+ .catch((err: unknown) => `rejected — ${err instanceof Error ? err.message : String(err)}`);
1732
+ }
1733
+ return { outcome: "decided", row: decidedRow, summaryLines, outcomeLine, executed: "none" };
1734
+ }
1735
+
1736
+ /**
1737
+ * 🔴 THE RELEASE RUNS AFTER THIS ROW'S OWN EXECUTE, in the `finally`. It used to run first, which put the human's own clicked act behind N sibling approve-and-execute cycles — so a click that died mid-release lost the act the button was pressed for, having already CAS-ed its row approved. The MEMO write stays where it is: the member approved the session, not just this call.
1738
+ * 🔴 THE CAS-THEN-EXECUTE ORDER IS NOT INVERTED: executing first would let a released row and a human's own click both run the frozen act. A lost act leaves a decided row an operator can read; a DOUBLE act cannot be taken back. The tail is RESUMABLE instead — every row a killed invocation did not reach is still pending and still clickable.
1739
+ */
1740
+ let releaseTail: (() => Promise<unknown>) | undefined;
1741
+
1742
+ // "Approve for session" remembers the proposing session so later proposals of the SAME grantable kind skip the card. `sessionGrantKind` is the ONE predicate for "is this grantable, and under what memo kind", and it answers null for everything but `pr.open`, so the verb degrades to a one-off approve on every injection gate.
1743
+ // The memo is keyed (org, sessionId, memoKind), so a grant is never read under a kind it was not written for, and it is set BEFORE execute so it persists even if THIS action fails. Best-effort: a memo write failure never fails the decision.
1744
+ if (input.decision === "approve_session") {
1745
+ const memoKind = sessionGrantKind(row);
1746
+ const sessionId = sessionIdFromFrozenArgs(row.argsJson);
1747
+ if (memoKind && sessionId) {
1748
+ const expiresAt = new Date(Date.now() + sessionApprovalTtlHours() * 3_600_000).toISOString();
1749
+ await store.setSessionApproval({ org: input.org, sessionId, kind: memoKind, grantedBy: input.clickerId, createdAt: nowIso, expiresAt }).catch(() => {});
1750
+ await appendAudit({ ...whereFromScope(input.org, row.scopeKey), principalId: input.clickerId, action: "approval.session_granted", detail: { id: row.id, kind: row.kind, memoKind, ...venue } }).catch(() => undefined);
1751
+ // OPE-251: …AND THE CARDS THE GRANT ALREADY COVERS ARE RELEASED, not left stale. See
1752
+ // {@link releaseSessionGrantedPendings}, and the block above for when it runs.
1753
+ releaseTail = () => releaseSessionGrantedPendings({ sessionId, memoKind, grantedOn: row, click: input });
1754
+ }
1755
+ }
1756
+
1757
+ try {
1758
+ const args = JSON.parse(row.argsJson) as unknown;
1759
+ // Publish WHICH CARD is executing for the duration of the write, so a kind whose write is durable evidence can name the approval that armed it — which `decidedBy` alone cannot. Ambient and fail-soft: nothing may authorise on it. This is the ONLY place it may be set, or "armed by this card" stops being true.
1760
+ const outcome = await withArmingApproval({ id: row.id, kind: row.kind }, () => kindDef.execute(args, input.clickerId));
1761
+ await appendAudit({ ...whereFromScope(input.org, row.scopeKey), principalId: input.clickerId, action: "approval.approved", detail: { id: row.id, kind: row.kind, ...venue, outcome } });
1762
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_decided", "oe.outcome": "approved" });
1763
+ return { outcome: "decided", row: decidedRow, summaryLines, outcomeLine: outcome, executed: "ok" };
1764
+ } catch (err) {
1765
+ const message = err instanceof Error ? err.message : String(err);
1766
+ await appendAudit({ ...whereFromScope(input.org, row.scopeKey), principalId: input.clickerId, action: "approval.failed", detail: { id: row.id, kind: row.kind, ...venue, error: message } });
1767
+ emitTelemetry("oe.feature.used", { "oe.feature": "approval_decided", "oe.outcome": "failed" });
1768
+ return { outcome: "decided", row: decidedRow, summaryLines, outcomeLine: `FAILED: ${message}`, executed: "failed" };
1769
+ } finally {
1770
+ // A `finally`, so a FAILED clicked act still releases the siblings: the grant is the human's decision about the SESSION, and whether this one call's `execute` threw says nothing about the other cards it covers. The returned resolution is already computed, and `runSessionGrantRelease` never throws, which is what keeps that true.
1771
+ if (releaseTail) await runSessionGrantRelease(releaseTail, input.waitUntil);
1772
+ }
1773
+ }
1774
+
1775
+ /** Test seams for the sweep's expiry FEEDBACK (task #105) — absent ⇒ the live posters/dispatch. */
1776
+ export interface SweepFeedbackDeps {
1777
+ readonly post?: PostFn;
1778
+ /** Discord notice poster — defaults to {@link postDiscordDecisionNotice}. */
1779
+ readonly discordNotice?: (row: PendingActionRow, text: string) => Promise<unknown>;
1780
+ readonly decisionWake?: DecisionWakeDeps;
1781
+ }
1782
+
1783
+ /** Expiry feedback for ONE swept row — the sweep-side twin of the click paths' feedback calls. See {@link rowDecisionFeedback} for what a null `postedTo`, a platform with no card path, and a transport failure each do. */
1784
+ async function sweepExpiryFeedback(row: PendingActionRow, deps: SweepFeedbackDeps): Promise<void> {
1785
+ await rowDecisionFeedback(row, { summaryLines: summaryLinesFor(row), outcome: "expired", outcomeLine: "expired", executed: "none" }, deps);
1786
+ }
1787
+
1788
+ /**
1789
+ * Deliver ONE row's decision feedback off its own frozen `postedTo` — the shape every caller that holds a decided row but NO click payload needs, so the expiry sweep and the session-grant release cannot derive the poster two different ways.
1790
+ * NULL `postedTo` ⇒ skip silently (a pre-migration row, or a deliberately card-less one); a platform with no approval-card path also skips. No TRANSPORT failure throws; the egress spoof's Vercel refusal is the one exception, contained by each caller's own `try`.
1791
+ */
1792
+ async function rowDecisionFeedback(
1793
+ row: PendingActionRow,
1794
+ what: Pick<DecisionFeedbackInput, "summaryLines" | "outcome" | "outcomeLine" | "executed"> & { readonly clickerId?: string },
1795
+ deps: SweepFeedbackDeps = {},
1796
+ ): Promise<void> {
1797
+ if (!row.postedTo) return;
1798
+ const [platform, workspace] = row.postedTo.split("/");
1799
+ if (!workspace) return;
1800
+ const post = deps.post ?? bridgeSlackForm;
1801
+ const postNotice =
1802
+ platform === "slack"
1803
+ ? (text: string) => postThreadNote(post, row.channelId, row.threadTs ?? row.messageTs ?? undefined, text)
1804
+ : platform === "discord"
1805
+ ? (text: string) => (deps.discordNotice ?? postDiscordDecisionNotice)(row, text)
1806
+ : null;
1807
+ if (!postNotice) return;
1808
+ await deliverDecisionFeedback(
1809
+ {
1810
+ row,
1811
+ ...what,
1812
+ // The mint-frozen workspace segment plays the click payload's team.id/guild_id role.
1813
+ target: platform === "slack" ? slackDecisionWakeTarget(row, workspace) : discordDecisionWakeTarget(row, workspace),
1814
+ postNotice,
1815
+ },
1816
+ deps.decisionWake,
1817
+ );
1818
+ }
1819
+
1820
+ /**
1821
+ * An unclicked pending that ages past its TTL never gets a terminal row on its own, so this CAS-expires each one, audits `approval.expired` (cause "ttl") and feeds the expiry back to the proposing session, which would otherwise keep believing in a dead card. Best-effort per row: a failed CAS, audit or feedback never aborts the sweep.
1822
+ * IT RUNS TWO PASSES: the TTL pass closes every row whose clock ran out, and {@link reapSupersededRoutineCards} closes the rows that HAVE no clock. Both counts are returned together.
1823
+ */
1824
+ export async function sweepExpiredPendings(org: string, now: Date = new Date(), deps: SweepFeedbackDeps = {}): Promise<number> {
1825
+ const store = getOperationalStore();
1826
+ const nowIso = now.toISOString();
1827
+ const expired = await store.listExpiredPendingActions(org, nowIso);
1828
+ let count = 0;
1829
+ for (const row of expired) {
1830
+ try {
1831
+ const won = await store.decidePendingAction(org, row.id, "expired", "system", nowIso);
1832
+ if (!won) continue; // a click's lazy-expiry (or another sweep) won first — it audits its own row
1833
+ await appendAudit({
1834
+ ...whereFromScope(org, row.scopeKey),
1835
+ principalId: "system",
1836
+ action: "approval.expired",
1837
+ detail: { id: row.id, kind: row.kind, cause: "ttl" },
1838
+ });
1839
+ count++;
1840
+ await sweepExpiryFeedback({ ...row, status: "expired", decidedBy: "system", decidedAt: nowIso }, deps);
1841
+ } catch (err) {
1842
+ console.warn(`[open-everywhere:approvals] sweepExpiredPendings: failed to expire ${row.id}: ${String(err)}`);
1843
+ }
1844
+ }
1845
+ return count + (await reapSupersededRoutineCards(org, now, deps));
1846
+ }
1847
+
1848
+ /**
1849
+ * REAP the routine permission cards a later `edit_routine` or delete left unanswerable. Such a row is minted with the far-future sentinel on purpose, so no TTL reaches it and its bound is the GENERATION inside the frozen `grantKey` — without this pass the routine's room keeps a card with live buttons whose every click answers "nothing was armed". The sweep is where it belongs: an edited routine may never fire again, and a deleted one never will.
1850
+ * 🔴 EVERY CARD IT EXPIRES IS ONE A CLICK WOULD REFUSE, and the set is a strict SUBSET: an unreadable routine or an unparseable args blob is left alone, because expiring a live card because one read blinked is the failure the fail-closed posture exists to prevent.
1851
+ */
1852
+ export async function reapSupersededRoutineCards(org: string, now: Date = new Date(), deps: SweepFeedbackDeps = {}): Promise<number> {
1853
+ const store = getOperationalStore();
1854
+ const nowIso = now.toISOString();
1855
+ // `listPendingActions` is `WHERE status = 'pending'`, which is exactly the set at issue: a card a
1856
+ // click or an earlier sweep already decided is terminal and is not this pass's business.
1857
+ const pending = await store.listPendingActions(org).catch(() => [] as readonly PendingActionRow[]);
1858
+ let count = 0;
1859
+ for (const row of pending) {
1860
+ if (row.kind !== ROUTINE_PERMISSION_KIND) continue;
1861
+ const args = parseRoutinePermissionArgs(row.argsJson);
1862
+ if (!args) continue; // fail-closed: a row whose frozen pair cannot be read is never decided here
1863
+ try {
1864
+ const state = await routineCardGenerationState(args);
1865
+ // `current` is a live card. `unreadable` is not a verdict at all — see that function's doc.
1866
+ if (state.state === "current" || state.state === "unreadable") continue;
1867
+ const won = await store.decidePendingAction(org, row.id, "expired", "system", nowIso);
1868
+ if (!won) continue; // a click (or another sweep) won the CAS first — it audits its own row
1869
+ await appendAudit({
1870
+ ...whereFromScope(org, row.scopeKey),
1871
+ principalId: "system",
1872
+ action: "approval.expired",
1873
+ // The cause is NOT "ttl": no clock ran out. An operator reading the trail has to be able to
1874
+ // tell a card that aged out from a card whose question stopped existing.
1875
+ detail: { id: row.id, kind: row.kind, cause: state.state === "gone" ? "routine-deleted" : "routine-superseded", routine: args.routineId },
1876
+ });
1877
+ count++;
1878
+ await sweepExpiryFeedback({ ...row, status: "expired", decidedBy: "system", decidedAt: nowIso }, deps);
1879
+ } catch (err) {
1880
+ console.warn(`[open-everywhere:approvals] reapSupersededRoutineCards: failed to expire ${row.id}: ${String(err)}`);
1881
+ }
1882
+ }
1883
+ return count;
1884
+ }
1885
+
1886
+ // A unified WINDOW session woken by a mention in a DIFFERENT thread never sees the in-thread decision notice — OE's own bot post cannot wake it, and its next wake elsewhere does not backscroll this thread.
1887
+ // Measured live 2026-07-19: an admin rejected a spend card, and a fresh ask in a new thread was answered "just needs an admin to Approve" about the dead card. This wake pushes the decision into the owning session so its belief updates.
1888
+
1889
+ export interface DecisionWakeDeps {
1890
+ /** The dispatch seam — defaults to the live cross-process window dispatch. Injected in tests to
1891
+ * capture the payload without a live eve receive. */
1892
+ readonly dispatch?: typeof dispatchApprovalDecisionWake;
1893
+ readonly now?: () => string;
1894
+ readonly mintWakeId?: () => string;
1895
+ }
1896
+
1897
+ /**
1898
+ * Push a DECIDED/EXPIRED outcome into the PROPOSING window session. No-op unless the proposing surface windows AND a live window session exists — a classic per-thread session backscrolls the in-thread notice on its next human wake, so it needs no push. Best-effort and NEVER throws.
1899
+ * The token is read LIVE off the window's own registry row, so the wake targets the live seat even across a rotation, and the origin is the card's anchor thread.
1900
+ */
1901
+ export async function wakeWindowOnDecision(
1902
+ input: {
1903
+ readonly row: PendingActionRow;
1904
+ readonly outcome: ApprovalOutcome;
1905
+ readonly summaryLine: string;
1906
+ /** The admin who decided — absent for a system (TTL) expiry. */
1907
+ readonly clickerId?: string;
1908
+ /** What the kind's `execute` did, for an APPROVED outcome (OPE-1097) — see
1909
+ * {@link ApprovalDecisionWakeInput.execution}. */
1910
+ readonly execution?: { readonly ran: "ok" | "failed"; readonly line: string };
1911
+ /** The PROPOSING channel's fully-qualified surfaceKey (`platform/workspace/surface`). */
1912
+ readonly surfaceKey: string;
1913
+ readonly origin: UnifiedWakeOrigin;
1914
+ },
1915
+ deps: DecisionWakeDeps = {},
1916
+ ): Promise<boolean> {
1917
+ const dispatch = deps.dispatch ?? dispatchApprovalDecisionWake;
1918
+ const mint = deps.mintWakeId ?? mintWakeId;
1919
+ const nowIso = (deps.now ?? (() => new Date().toISOString()))();
1920
+
1921
+ const authority = await readApprovalDecisionAuthority(input.row.org, input.row.id);
1922
+ const surfaceKey = authority?.surfaceKey ?? input.surfaceKey;
1923
+ const origin = authority?.origin ?? input.origin;
1924
+
1925
+ let domainName: string;
1926
+ let registryKey: string;
1927
+ try {
1928
+ const grain = supervisorGrainFor(surfaceKey, getConfig().loadDomains());
1929
+ if (!grainUsesUnifiedWindow(grain) || grain.domainName === undefined) return false; // classic per-thread — the notice suffices
1930
+ domainName = grain.domainName;
1931
+ registryKey = grain.registryKey;
1932
+ } catch {
1933
+ return false; // config error → skip (fail-soft to today's notice-only behaviour)
1934
+ }
1935
+
1936
+ const store = getOperationalStore();
1937
+ const session = await store.getChannelSession(input.row.org, registryKey).catch(() => null);
1938
+ if (!session) return false; // no live window session to update
1939
+
1940
+ const wakeId = mint();
1941
+ const message = renderApprovalDecisionMessage(
1942
+ {
1943
+ origin,
1944
+ wakeId,
1945
+ summaryLine: input.summaryLine,
1946
+ outcome: input.outcome,
1947
+ ...(input.clickerId ? { clickerId: input.clickerId } : {}),
1948
+ ...(input.execution ? { execution: input.execution } : {}),
1949
+ pendingId: input.row.id,
1950
+ },
1951
+ nowIso,
1952
+ );
1953
+ // The dispatch receives only the proposal-frozen binding/requester. It never sees the decision
1954
+ // actor's auth; the standing-grain default keeps this informational continuation narrow-handed.
1955
+ const delivered = await dispatch({
1956
+ token: session.token,
1957
+ origin,
1958
+ wakeId,
1959
+ message,
1960
+ domain: domainName,
1961
+ ...(authority
1962
+ ? {
1963
+ binding: authority.binding,
1964
+ requester: authority.requester,
1965
+ nonMemberWake: authority.nonMemberWake,
1966
+ }
1967
+ : {}),
1968
+ }).catch(() => false);
1969
+
1970
+ // Lifecycle audit (WS-3 discipline — ids/labels only, never the notice body).
1971
+ await appendAudit({
1972
+ ...whereFromScope(input.row.org, input.row.scopeKey),
1973
+ principalId: input.clickerId ?? "system",
1974
+ action: "approval.decision_wake",
1975
+ detail: { id: input.row.id, kind: input.row.kind, outcome: input.outcome, domain: domainName, delivered, wakeId },
1976
+ }).catch(() => undefined);
1977
+ return delivered;
1978
+ }
1979
+
1980
+ /** The team id comes from the CLICK, which is authoritative for the workspace the card lives in — the frozen scopeKey can name a DIFFERENT workspace under an explicit-scope override, so it must NOT be the workspace source. Null without a team id, and the decision wake is skipped, fail-soft. */
1981
+ function slackDecisionWakeTarget(row: PendingActionRow, teamId: string | undefined): { surfaceKey: string; origin: UnifiedWakeOrigin } | null {
1982
+ if (!teamId) return null;
1983
+ return {
1984
+ surfaceKey: `slack/${teamId}/${row.channelId}`,
1985
+ origin: { platform: "slack", channelId: row.channelId, ...(row.threadTs ? { threadTs: row.threadTs } : {}) },
1986
+ };
1987
+ }
1988
+
1989
+ /**
1990
+ * The Discord analogue: surfaceKey and wake origin from the frozen row plus a guild id, taken from the click's signed interaction or from the mint-frozen `postedTo`, never from the frozen scopeKey.
1991
+ * 🔴 GUILD-ONLY because a decision wake is dispatched into a WINDOW and needs a surfaceKey naming a window-enabled surface. A DM belongs to no domain and no shared window, so there is nothing to name — hence null, not a DM-shaped origin.
1992
+ */
1993
+ export function discordDecisionWakeTarget(row: PendingActionRow, guildId: string | undefined): { surfaceKey: string; origin: UnifiedWakeOrigin } | null {
1994
+ if (!guildId) return null;
1995
+ return {
1996
+ surfaceKey: `discord/${guildId}/${row.channelId}`,
1997
+ origin: { platform: "discord", channelId: row.channelId, guildId, ...(row.messageTs ? { messageId: row.messageTs } : {}) },
1998
+ };
1999
+ }
2000
+
2001
+ /** A FRESH message into the card's own channel, anchored to the card — fresh because the click path's card edit is invisible to backscroll, exactly like Slack's chat.update. Throws on failure; callers reach it only through {@link deliverDecisionFeedback}, which swallows notice failures. */
2002
+ export function postDiscordDecisionNotice(row: PendingActionRow, text: string): Promise<unknown> {
2003
+ const ops = surfaceMessageOps("discord");
2004
+ if (!ops) return Promise.resolve(undefined); // discord transport not registered — no notice (fail-soft)
2005
+ return ops.postText(row.channelId, text, row.messageTs ? { replyToMessageId: row.messageTs } : undefined);
2006
+ }
2007
+
2008
+ export interface DecisionFeedbackInput {
2009
+ /** The DECIDED row (status already flipped — the CAS won before any feedback fires). */
2010
+ readonly row: PendingActionRow;
2011
+ readonly summaryLines: string[];
2012
+ readonly outcome: ApprovalOutcome;
2013
+ /** The executor's outcome line. "expired" for a sweep, and "rejected" for a reject — unless the
2014
+ * kind implements `declined()` (approvals/types.ts), whose line replaces it and IS rendered:
2015
+ * {@link decisionNoticeText} reads it on a rejection too, and drops its "propose again" tail. */
2016
+ readonly outcomeLine: string;
2017
+ /** Whether the kind's `execute` ran (OPE-1097). "none" on every non-approval path — a reject and
2018
+ * an expiry run nothing. Required so a new feedback call site states it rather than inherits a
2019
+ * default: this is what tells the resumed seat the approved act is already done. */
2020
+ readonly executed: "ok" | "failed" | "none";
2021
+ /** The deciding admin — absent for a system (TTL) expiry. */
2022
+ readonly clickerId?: string;
2023
+ /** The wake target, or null to skip the wake (no authoritative workspace id — fail-soft). */
2024
+ readonly target: { surfaceKey: string; origin: UnifiedWakeOrigin } | null;
2025
+ readonly postNotice: (text: string) => Promise<unknown>;
2026
+ }
2027
+
2028
+ /**
2029
+ * The ONE decision-feedback sequence, shared by both click paths and the TTL sweep: post the human-facing notice into the pending's anchor conversation, then push the outcome into the owning window session. BOTH legs are independently best-effort, and no transport failure throws.
2030
+ * 🔴 The NOTICE leg takes the shared egress exit; the WAKE leg deliberately does not, because it puts nothing in a room. The one thing that CAN throw is the spoof's Vercel refusal — a deploy misconfiguration, loud by design, impossible on a deploy that has not set the flag.
2031
+ */
2032
+ export async function deliverDecisionFeedback(input: DecisionFeedbackInput, decisionWake?: DecisionWakeDeps): Promise<void> {
2033
+ if (!swallowRoomOp(`an approval decision notice (${input.outcome})`)) {
2034
+ await input.postNotice(decisionNoticeText(input.summaryLines, input.outcomeLine, input.clickerId ?? "system", input.outcome)).catch(() => undefined);
2035
+ }
2036
+ if (input.target) {
2037
+ await wakeWindowOnDecision(
2038
+ {
2039
+ row: input.row,
2040
+ outcome: input.outcome,
2041
+ summaryLine: input.summaryLines[0] ?? "the requested change",
2042
+ ...(input.clickerId ? { clickerId: input.clickerId } : {}),
2043
+ // The approval RAN the act; the seat did not. Carry the executor's own outcome line into the
2044
+ // wake so the resumed seat can see the work is already done and does not re-issue it
2045
+ // (OPE-1097). Only an approval has one — a reject and an expiry run nothing.
2046
+ ...(input.executed === "none" ? {} : { execution: { ran: input.executed, line: input.outcomeLine } }),
2047
+ surfaceKey: input.target.surfaceKey,
2048
+ origin: input.target.origin,
2049
+ },
2050
+ decisionWake,
2051
+ ).catch(() => undefined);
2052
+ }
2053
+ }
2054
+
2055
+ /**
2056
+ * Handle one parsed Slack `block_actions` payload. Returns false for anything that is not an `oe_approval:` action (the caller forwards those to eve); otherwise it owns the click end to end and NEVER throws — Slack's interactivity endpoint must always get its 200.
2057
+ * 🔴 That includes the egress spoof's Vercel refusal, deliberately: Slack retries a POST that does not answer, so letting it escape would turn one misconfigured deploy into a retry storm. It stays loud at `requestApproval`, which mints no card on such a deploy.
2058
+ */
2059
+ export async function handleApprovalPayload(payload: unknown, deps: HandleApprovalDeps = {}): Promise<boolean> {
2060
+ const p = payload as BlockActionsPayload | null | undefined;
2061
+ const action = p?.actions?.[0];
2062
+ const actionId = typeof action?.action_id === "string" ? action.action_id : undefined;
2063
+ if (actionId === undefined) return false; // not a block_actions click at all, or no action_id
2064
+
2065
+ const parsed = parseApprovalAction(actionId);
2066
+ if (!parsed) return false; // a real click, but not one of ours (e.g. Eve's eve_input:) — forward
2067
+
2068
+ const post = deps.post ?? bridgeSlackForm;
2069
+
2070
+ try {
2071
+ const org = typeof action?.value === "string" ? action.value : undefined;
2072
+ const clickerId = typeof p?.user?.id === "string" ? p.user.id : undefined;
2073
+ const channelId = typeof p?.channel?.id === "string" ? p.channel.id : undefined;
2074
+ const messageTs = typeof p?.message?.ts === "string" ? p.message.ts : undefined;
2075
+ const teamId = typeof p?.team?.id === "string" ? p.team.id : undefined;
2076
+
2077
+ if (!org || !clickerId || !channelId) {
2078
+ console.error(`[open-everywhere:approvals] malformed block_actions payload for "${actionId}" — missing org/user/channel; ignoring the click`);
2079
+ return true; // it WAS ours; fail soft rather than forward a half-understood payload to Eve
2080
+ }
2081
+
2082
+ // Leg D's verdict (OPE-589) — resolved BEFORE the decide call so a positive guest verdict can
2083
+ // never race a lost CAS. `.catch` mirrors every other best-effort probe on this path: a thrown
2084
+ // dep must degrade to "no verdict", never abort the click.
2085
+ const clickerIsGuest = deps.clickerIsGuest ? await deps.clickerIsGuest(clickerId, teamId).catch(() => undefined) : undefined;
2086
+
2087
+ const res = await resolveApprovalClick({
2088
+ org,
2089
+ id: parsed.id,
2090
+ decision: parsed.decision,
2091
+ clickerId,
2092
+ // This handler parses SLACK's block_actions payload, so the clicker id is a Slack member id
2093
+ // — stated rather than derived, so the roster check keeps working on the theoretical
2094
+ // missing-`team.id` path below where there is no surface key to read a platform off.
2095
+ clickerPlatform: "slack",
2096
+ // The room the button was physically pressed in (OPE-185). Slack always carries `team.id` on
2097
+ // an interactive payload; on the theoretical absence we pass NO context rather than guessing a
2098
+ // workspace, which leaves the clicker gate inert — the same fail-soft posture the decision-wake
2099
+ // target already takes with the same missing field, and never a refusal built on a fabricated key.
2100
+ ...(teamId ? { clickContext: { surfaceKey: `slack/${teamId}/${channelId}` } } : {}),
2101
+ ...(clickerIsGuest === undefined ? {} : { clickerIsGuest }),
2102
+ // OPE-1709 — the route's background-work hook, so the session-grant release leaves the
2103
+ // interactivity ack's budget. Absent on a caller that supplies none, which keeps that caller's
2104
+ // awaited shape byte-identical.
2105
+ ...(deps.waitUntil ? { waitUntil: deps.waitUntil } : {}),
2106
+ });
2107
+ switch (res.outcome) {
2108
+ case "unknown":
2109
+ // 🔴 A CONTRADICT click must NEVER rewrite its own message: the judge-lift notice is the room's only record that an act ran with nobody asked, and blanking it because the wedge row has aged out would delete exactly the evidence it exists to keep.
2110
+ if (parsed.decision === "contradict") {
2111
+ await postThreadNote(post, channelId, messageTs, `<@${clickerId}> ${judgeContradictionNotice("unknown")}`);
2112
+ return true;
2113
+ }
2114
+ await updateCardText(post, channelId, messageTs, "This approval request is no longer known (it may have already been decided or has aged out).");
2115
+ return true;
2116
+ case "not-pending":
2117
+ case "expired-race":
2118
+ case "unregistered-kind":
2119
+ case "lost-race":
2120
+ return true; // silent by design — see each resolution's doc above
2121
+ case "expired": {
2122
+ await updateCard(post, channelId, messageTs, decidedCardBlocks(res.row, res.summaryLines, "expired"));
2123
+ // A late-click expiry is a system TTL lapse with no deciding admin, so no `clickerId` rides the feedback.
2124
+ await deliverDecisionFeedback(
2125
+ {
2126
+ row: res.row,
2127
+ summaryLines: res.summaryLines,
2128
+ outcome: "expired",
2129
+ outcomeLine: "expired",
2130
+ executed: "none",
2131
+ target: slackDecisionWakeTarget(res.row, teamId),
2132
+ postNotice: (text) => postThreadNote(post, channelId, res.row.threadTs ?? messageTs, text),
2133
+ },
2134
+ deps.decisionWake,
2135
+ );
2136
+ return true;
2137
+ }
2138
+ case "denied":
2139
+ await postThreadNote(post, channelId, res.row.threadTs ?? messageTs, `<@${clickerId}> only a domain/org admin can decide this request.`);
2140
+ return true;
2141
+ case "clicker-denied":
2142
+ // Same shape as "denied" — an in-thread note, card untouched, row still pending — because
2143
+ // it is the same story from the human's side: your click didn't apply, and the card is
2144
+ // still live for someone who can. The copy is the ONE renderer (clicker-floor.ts) so this
2145
+ // and the Discord ephemeral cannot drift.
2146
+ await postThreadNote(post, channelId, res.row.threadTs ?? messageTs, `<@${clickerId}> ${clickerFloorRefusalNotice(res.reason)}`);
2147
+ return true;
2148
+ case "halted":
2149
+ // Same shape as "denied": an in-thread note, card UNTOUCHED, row still pending — live until the TTL sweep reaps it, since the sweep is not halt-gated. The copy is access/halt.ts's ONE renderer, so a Slack room and a Discord room are told the same thing about the same halt.
2150
+ await postThreadNote(post, channelId, res.row.threadTs ?? messageTs, `<@${clickerId}> ${res.notice}`);
2151
+ return true;
2152
+ case "contradicted": {
2153
+ // The notice card stays as it is — the act it reports still happened, and replacing it
2154
+ // would erase the room's only record of it. The reply is an in-thread line naming what the
2155
+ // click did, so the person who pressed the button can see their overrule landed.
2156
+ await postThreadNote(post, channelId, res.row.threadTs ?? messageTs, `<@${clickerId}> ${judgeContradictionNotice(res.contradiction)}`);
2157
+ return true;
2158
+ }
2159
+ case "decided": {
2160
+ await updateCard(post, channelId, messageTs, decidedCardBlocks(res.row, res.summaryLines, res.outcomeLine));
2161
+ // `res.row.status` is "approved" | "rejected" here — both valid ApprovalOutcome values — and the deciding admin rides as `clickerId`.
2162
+ await deliverDecisionFeedback(
2163
+ {
2164
+ row: res.row,
2165
+ summaryLines: res.summaryLines,
2166
+ outcome: res.row.status as ApprovalOutcome,
2167
+ outcomeLine: res.outcomeLine,
2168
+ executed: res.executed,
2169
+ clickerId,
2170
+ target: slackDecisionWakeTarget(res.row, teamId),
2171
+ postNotice: (text) => postThreadNote(post, channelId, res.row.threadTs ?? messageTs, text),
2172
+ },
2173
+ deps.decisionWake,
2174
+ );
2175
+ return true;
2176
+ }
2177
+ }
2178
+ } catch (err) {
2179
+ // A genuinely unexpected failure (store outage, malformed row, …) after we'd already
2180
+ // established this WAS an oe_approval: click — fail soft, never throw out of this
2181
+ // function; Slack's interactivity endpoint must always get its 200.
2182
+ console.error(`[open-everywhere:approvals] handleApprovalPayload failed softly for "${actionId}": ${String(err)}`);
2183
+ return true;
2184
+ }
2185
+ }