@opengeni/contracts 5.5.0 → 5.5.2-canary.40656248492001

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 (543) hide show
  1. package/dist/agent-authored-durable-text.d.ts +9 -9
  2. package/dist/agent-config.d.ts +148 -37
  3. package/dist/api-key-presets.d.ts +19 -0
  4. package/dist/app-action-catalog-types.d.ts +32 -0
  5. package/dist/app-action-catalog.gen.d.ts +2 -0
  6. package/dist/app-actions.d.ts +91 -0
  7. package/dist/app-actions.js +10130 -0
  8. package/dist/app-actions.js.map +1 -0
  9. package/dist/app-shot.d.ts +55 -0
  10. package/dist/artifact-catalog.d.ts +33 -0
  11. package/dist/artifacts.d.ts +166 -0
  12. package/dist/atlassian-native-retirement.d.ts +16 -0
  13. package/dist/atlassian-native-retirement.js +30 -0
  14. package/dist/atlassian-native-retirement.js.map +1 -0
  15. package/dist/atlassian.js +48 -23
  16. package/dist/automation-templates.d.ts +434 -0
  17. package/dist/automation-templates.js +31 -0
  18. package/dist/automation-templates.js.map +1 -0
  19. package/dist/billing-subscriptions.d.ts +61 -0
  20. package/dist/bots.d.ts +583 -0
  21. package/dist/bundled-skills.d.ts +58 -2
  22. package/dist/canonical-human-identities.js +3 -1
  23. package/dist/child-lifecycle-notice-protocol.d.ts +45 -0
  24. package/dist/chunk-2QKIEAGY.js +396 -0
  25. package/dist/chunk-2QKIEAGY.js.map +1 -0
  26. package/dist/chunk-2WOWEWXV.js +426 -0
  27. package/dist/chunk-2WOWEWXV.js.map +1 -0
  28. package/dist/chunk-2ZIHHL72.js +153 -0
  29. package/dist/chunk-2ZIHHL72.js.map +1 -0
  30. package/dist/chunk-32U6NKQQ.js +389 -0
  31. package/dist/chunk-32U6NKQQ.js.map +1 -0
  32. package/dist/chunk-4YDDHSO2.js +799 -0
  33. package/dist/chunk-4YDDHSO2.js.map +1 -0
  34. package/dist/chunk-56SNIMDO.js +9 -0
  35. package/dist/chunk-56SNIMDO.js.map +1 -0
  36. package/dist/chunk-5RWB6QVL.js +101 -0
  37. package/dist/chunk-5RWB6QVL.js.map +1 -0
  38. package/dist/chunk-5UGUOT3L.js +243 -0
  39. package/dist/chunk-5UGUOT3L.js.map +1 -0
  40. package/dist/chunk-6LAT33BH.js +130 -0
  41. package/dist/chunk-6LAT33BH.js.map +1 -0
  42. package/dist/chunk-7272KVWZ.js +60 -0
  43. package/dist/chunk-7272KVWZ.js.map +1 -0
  44. package/dist/chunk-72QC2GTL.js +36 -0
  45. package/dist/chunk-72QC2GTL.js.map +1 -0
  46. package/dist/chunk-7EQGGZBY.js +105 -0
  47. package/dist/chunk-7EQGGZBY.js.map +1 -0
  48. package/dist/chunk-A3LXWVYU.js +382 -0
  49. package/dist/chunk-A3LXWVYU.js.map +1 -0
  50. package/dist/chunk-AQYDZUJV.js +34 -0
  51. package/dist/chunk-AQYDZUJV.js.map +1 -0
  52. package/dist/chunk-BHCEVVUP.js +93 -0
  53. package/dist/chunk-BHCEVVUP.js.map +1 -0
  54. package/dist/chunk-BMUTAZX5.js +486 -0
  55. package/dist/chunk-BMUTAZX5.js.map +1 -0
  56. package/dist/chunk-DGG6IBBK.js +150 -0
  57. package/dist/chunk-DGG6IBBK.js.map +1 -0
  58. package/dist/{chunk-YBW5JSA3.js → chunk-FBCTUMHI.js} +123 -102
  59. package/dist/chunk-FBCTUMHI.js.map +1 -0
  60. package/dist/chunk-G2KJTFIC.js +97 -0
  61. package/dist/chunk-G2KJTFIC.js.map +1 -0
  62. package/dist/chunk-G4RKARXZ.js +1167 -0
  63. package/dist/chunk-G4RKARXZ.js.map +1 -0
  64. package/dist/chunk-H6UJJIUM.js +350 -0
  65. package/dist/chunk-H6UJJIUM.js.map +1 -0
  66. package/dist/chunk-JOTHDW4H.js +18 -0
  67. package/dist/chunk-JOTHDW4H.js.map +1 -0
  68. package/dist/chunk-L4GUEP7K.js +56480 -0
  69. package/dist/chunk-L4GUEP7K.js.map +1 -0
  70. package/dist/{chunk-SIOU2K4U.js → chunk-LJH2EYGT.js} +23 -23
  71. package/dist/chunk-MTJKSIGA.js +161 -0
  72. package/dist/chunk-MTJKSIGA.js.map +1 -0
  73. package/dist/chunk-MYHMB6GZ.js +202 -0
  74. package/dist/chunk-MYHMB6GZ.js.map +1 -0
  75. package/dist/chunk-PI5VIKJY.js +660 -0
  76. package/dist/chunk-PI5VIKJY.js.map +1 -0
  77. package/dist/{chunk-RIY7GYQS.js → chunk-PTSROVDG.js} +2 -2
  78. package/dist/chunk-PUIUXIOL.js +189 -0
  79. package/dist/chunk-PUIUXIOL.js.map +1 -0
  80. package/dist/chunk-R6VXJIMB.js +19 -0
  81. package/dist/chunk-R6VXJIMB.js.map +1 -0
  82. package/dist/chunk-RLJUNVAM.js +15 -0
  83. package/dist/chunk-RLJUNVAM.js.map +1 -0
  84. package/dist/chunk-RR6APCBK.js +213 -0
  85. package/dist/chunk-RR6APCBK.js.map +1 -0
  86. package/dist/{chunk-TXTQIYCV.js → chunk-RUQ4I6DO.js} +59 -13
  87. package/dist/chunk-RUQ4I6DO.js.map +1 -0
  88. package/dist/{chunk-WYBDERIY.js → chunk-RWEEUDHD.js} +53 -42
  89. package/dist/chunk-RWEEUDHD.js.map +1 -0
  90. package/dist/chunk-S7MSQQL6.js +158 -0
  91. package/dist/chunk-S7MSQQL6.js.map +1 -0
  92. package/dist/{chunk-5Q54VCCH.js → chunk-SHO4YO4B.js} +20 -36
  93. package/dist/chunk-SHO4YO4B.js.map +1 -0
  94. package/dist/{chunk-HHZSZYYF.js → chunk-T3HSWMA5.js} +20 -4
  95. package/dist/chunk-T3HSWMA5.js.map +1 -0
  96. package/dist/{chunk-YRKRZ6OF.js → chunk-TOOJIBJC.js} +2 -2
  97. package/dist/chunk-UCUOTRS6.js +431 -0
  98. package/dist/chunk-UCUOTRS6.js.map +1 -0
  99. package/dist/chunk-UH4K7GP7.js +424 -0
  100. package/dist/chunk-UH4K7GP7.js.map +1 -0
  101. package/dist/chunk-UIZWGPHV.js +120 -0
  102. package/dist/chunk-UIZWGPHV.js.map +1 -0
  103. package/dist/chunk-VLUKBV6Y.js +1170 -0
  104. package/dist/chunk-VLUKBV6Y.js.map +1 -0
  105. package/dist/chunk-W2QQ5Y6K.js +55 -0
  106. package/dist/chunk-W2QQ5Y6K.js.map +1 -0
  107. package/dist/{chunk-Y3KNXVTD.js → chunk-W3NBPR4E.js} +131 -31
  108. package/dist/chunk-W3NBPR4E.js.map +1 -0
  109. package/dist/{chunk-NRMCVHAU.js → chunk-WMGO4HJU.js} +11 -9
  110. package/dist/chunk-WMGO4HJU.js.map +1 -0
  111. package/dist/{chunk-MYBZRDTY.js → chunk-WQI7VNN4.js} +19 -9
  112. package/dist/chunk-WQI7VNN4.js.map +1 -0
  113. package/dist/{chunk-PX3VCKAU.js → chunk-WVCFSOUZ.js} +1 -1
  114. package/dist/{chunk-PX3VCKAU.js.map → chunk-WVCFSOUZ.js.map} +1 -1
  115. package/dist/chunk-XB6GQLBH.js +76 -0
  116. package/dist/chunk-XB6GQLBH.js.map +1 -0
  117. package/dist/{chunk-D2HKF2EF.js → chunk-XP5M3IKT.js} +2 -2
  118. package/dist/{chunk-O77VSFYZ.js → chunk-ZMPU5BWE.js} +12 -2
  119. package/dist/chunk-ZMPU5BWE.js.map +1 -0
  120. package/dist/{chunk-3SIZGL3O.js → chunk-ZYVEJFNU.js} +22 -18
  121. package/dist/chunk-ZYVEJFNU.js.map +1 -0
  122. package/dist/claude-provider-account-authority.d.ts +18 -0
  123. package/dist/claude-subscription-oauth.d.ts +25 -0
  124. package/dist/claude-subscription-usage.d.ts +95 -1
  125. package/dist/client-error-report.d.ts +154 -8
  126. package/dist/client-error-report.js +157 -2
  127. package/dist/client-error-report.js.map +1 -1
  128. package/dist/code-search.d.ts +1 -1
  129. package/dist/code-search.js.map +1 -1
  130. package/dist/codex-provider-account-authority.js +23 -12
  131. package/dist/codex-provider-account-authority.js.map +1 -1
  132. package/dist/company-profile.d.ts +144 -0
  133. package/dist/connect.d.ts +38 -0
  134. package/dist/connect.js +244 -164
  135. package/dist/connect.js.map +1 -1
  136. package/dist/connection-account-label.d.ts +2 -0
  137. package/dist/connection-account-label.js +34 -0
  138. package/dist/connection-account-label.js.map +1 -0
  139. package/dist/connection-authority.js +49 -24
  140. package/dist/connector-attachments.js +3 -1
  141. package/dist/connector-destinations.js +3 -1
  142. package/dist/connector-tool-permissions.d.ts +68 -4
  143. package/dist/credential-profiles.d.ts +166 -0
  144. package/dist/cua-desktop-tools.d.ts +19 -0
  145. package/dist/define-schema.d.ts +8 -0
  146. package/dist/desktop-app.d.ts +28 -0
  147. package/dist/direct-model-provider.d.ts +38 -0
  148. package/dist/document-artifact-commands.js +2 -2
  149. package/dist/document-artifact-query.js +2 -2
  150. package/dist/editable-artifact-binary.d.ts +7 -0
  151. package/dist/editable-artifact-causal-frontier.js +2 -2
  152. package/dist/editable-artifact-codec-registry.js +7 -7
  153. package/dist/editable-artifact-committed-transaction.js +4 -2
  154. package/dist/editable-artifact-live.js +8 -8
  155. package/dist/editable-artifact-serialized-commit.js +9 -9
  156. package/dist/editable-artifact-versions.d.ts +7 -1
  157. package/dist/editable-artifact-versions.js +1 -1
  158. package/dist/editable-artifacts.js +49 -43
  159. package/dist/event-preview.d.ts +22 -0
  160. package/dist/event-triggers.d.ts +1253 -0
  161. package/dist/event-triggers.js +148 -0
  162. package/dist/event-triggers.js.map +1 -0
  163. package/dist/external-identities.d.ts +34 -0
  164. package/dist/external-identities.js +4 -2
  165. package/dist/feedback.d.ts +181 -0
  166. package/dist/file-access.d.ts +23 -0
  167. package/dist/first-party-tool-authorization.d.ts +852 -0
  168. package/dist/github-repository-contracts.js +64 -43
  169. package/dist/github-repository-contracts.js.map +1 -1
  170. package/dist/google-drive-native-retirement.d.ts +12 -0
  171. package/dist/google-drive-native-retirement.js +20 -0
  172. package/dist/google-drive-native-retirement.js.map +1 -0
  173. package/dist/google-drive.d.ts +1 -1
  174. package/dist/google-drive.js +323 -239
  175. package/dist/google-drive.js.map +1 -1
  176. package/dist/host-mcp-bindings.js +250 -198
  177. package/dist/host-mcp-bindings.js.map +1 -1
  178. package/dist/index.d.ts +29072 -20593
  179. package/dist/index.js +2432 -366
  180. package/dist/inference-residency.d.ts +22 -0
  181. package/dist/insights-usage.d.ts +948 -0
  182. package/dist/insights-usage.js +608 -0
  183. package/dist/insights-usage.js.map +1 -0
  184. package/dist/integration-capability-id.d.ts +8 -0
  185. package/dist/interaction-action-deadline.d.ts +48 -0
  186. package/dist/interaction-driver-diagnostic.d.ts +28 -0
  187. package/dist/interaction.d.ts +2126 -881
  188. package/dist/knowledge-entries.d.ts +38 -0
  189. package/dist/knowledge-preparation.d.ts +4 -0
  190. package/dist/learning-refusal.d.ts +43 -0
  191. package/dist/learning-refusal.js +49 -0
  192. package/dist/learning-refusal.js.map +1 -0
  193. package/dist/managed-auth-session-sets.d.ts +1 -0
  194. package/dist/managed-auth-session-sets.js +207 -146
  195. package/dist/managed-auth-session-sets.js.map +1 -1
  196. package/dist/managed-sign-in-methods.d.ts +96 -0
  197. package/dist/managed-sign-in-methods.js +157 -35
  198. package/dist/managed-sign-in-methods.js.map +1 -1
  199. package/dist/mcp-structured-content.d.ts +25 -0
  200. package/dist/message-time-zone.d.ts +38 -0
  201. package/dist/message-time-zone.js +19 -0
  202. package/dist/message-time-zone.js.map +1 -0
  203. package/dist/modal-native-proof-v2.d.ts +587 -0
  204. package/dist/modal-native-proof-v2.js +39 -0
  205. package/dist/modal-native-proof-v2.js.map +1 -0
  206. package/dist/model-account-choice.d.ts +237 -0
  207. package/dist/model-account-settings.d.ts +422 -0
  208. package/dist/model-availability.d.ts +15 -0
  209. package/dist/model-connection-access.d.ts +13 -0
  210. package/dist/model-context-inspector.d.ts +8 -0
  211. package/dist/model-display.d.ts +43 -0
  212. package/dist/model-display.js +17 -0
  213. package/dist/model-display.js.map +1 -0
  214. package/dist/model-picker-order.js.map +1 -1
  215. package/dist/model-residency.d.ts +304 -0
  216. package/dist/organization-access.d.ts +416 -0
  217. package/dist/organization-access.js +40 -0
  218. package/dist/organization-access.js.map +1 -0
  219. package/dist/organization-integration-policy.d.ts +18 -0
  220. package/dist/organization-membership-lifecycle.d.ts +66 -0
  221. package/dist/organization-model-usage.d.ts +146 -0
  222. package/dist/organization-model-usage.js +87 -0
  223. package/dist/organization-model-usage.js.map +1 -0
  224. package/dist/organization-recovery.js +3 -1
  225. package/dist/organization-usage.d.ts +12 -0
  226. package/dist/passkey-only-account.d.ts +14 -0
  227. package/dist/passkey-only-account.js +13 -0
  228. package/dist/passkey-only-account.js.map +1 -0
  229. package/dist/permissions.d.ts +19 -0
  230. package/dist/personal-github.js +220 -148
  231. package/dist/personal-github.js.map +1 -1
  232. package/dist/personal-integration-setup.d.ts +81 -0
  233. package/dist/personal-integration-setup.js +42 -0
  234. package/dist/personal-integration-setup.js.map +1 -0
  235. package/dist/prepared-mcp-setup.d.ts +54 -0
  236. package/dist/prepared-mcp-setup.js +13 -0
  237. package/dist/prepared-mcp-setup.js.map +1 -0
  238. package/dist/presentation-artifact-commands.js +2 -2
  239. package/dist/presentation-artifact-query.js +2 -2
  240. package/dist/primitives.d.ts +18 -0
  241. package/dist/product-analytics.d.ts +27 -10
  242. package/dist/product-lifecycle-facts.d.ts +26 -3
  243. package/dist/prompt-cache-diagnostics.d.ts +92 -0
  244. package/dist/recordings.d.ts +1371 -0
  245. package/dist/remember.d.ts +98 -2
  246. package/dist/retained-output.d.ts +4 -2
  247. package/dist/sandbox-file-artifacts.d.ts +19 -2
  248. package/dist/sandbox-provider-command.d.ts +5 -44
  249. package/dist/sandbox-recovery.d.ts +139 -8
  250. package/dist/secret-generator.d.ts +44 -0
  251. package/dist/secret-mask-strings.d.ts +32 -0
  252. package/dist/secret-references.d.ts +90 -0
  253. package/dist/secret-resolution.d.ts +143 -0
  254. package/dist/secret-shape-masking.d.ts +52 -0
  255. package/dist/secret-shape-masking.js +19 -0
  256. package/dist/secret-shape-masking.js.map +1 -0
  257. package/dist/secret-totp.d.ts +41 -0
  258. package/dist/secret-use-approval-question.d.ts +11 -0
  259. package/dist/secret-use-approval-question.js +11 -0
  260. package/dist/secret-use-approval-question.js.map +1 -0
  261. package/dist/secret-use-approvals.d.ts +106 -0
  262. package/dist/secret-value-masking.d.ts +299 -0
  263. package/dist/secret-value-masking.js +62 -0
  264. package/dist/secret-value-masking.js.map +1 -0
  265. package/dist/secret-value.d.ts +19 -0
  266. package/dist/session-history-import.d.ts +444 -8
  267. package/dist/session-history.d.ts +111 -0
  268. package/dist/session-history.js +35 -0
  269. package/dist/session-history.js.map +1 -0
  270. package/dist/session-list-entries.d.ts +8 -0
  271. package/dist/session-list-entries.js +61 -0
  272. package/dist/session-list-entries.js.map +1 -0
  273. package/dist/session-mcp-projections.d.ts +13 -1
  274. package/dist/session-mcp-tool-permissions.d.ts +62 -0
  275. package/dist/session-target.d.ts +18 -0
  276. package/dist/session-titles.d.ts +8 -0
  277. package/dist/session-titles.js +5 -1
  278. package/dist/session-usage-limit-refusal.d.ts +34 -0
  279. package/dist/session-usage-limit-refusal.js +15 -0
  280. package/dist/session-usage-limit-refusal.js.map +1 -0
  281. package/dist/session-usage-limits.d.ts +127 -0
  282. package/dist/session-usage-limits.js +43 -0
  283. package/dist/session-usage-limits.js.map +1 -0
  284. package/dist/site-data.d.ts +286 -0
  285. package/dist/site-operations.d.ts +39 -0
  286. package/dist/site-publishing.d.ts +813 -0
  287. package/dist/site-session-http.d.ts +103 -4
  288. package/dist/site-session-http.js +27 -1
  289. package/dist/site-sql.d.ts +425 -0
  290. package/dist/skills.d.ts +38 -0
  291. package/dist/slack-bot-scopes.d.ts +9 -7
  292. package/dist/slack-bot-scopes.js +6 -3
  293. package/dist/slack-rest-mcp.d.ts +36 -0
  294. package/dist/slack-rest-mcp.js +25 -0
  295. package/dist/slack-rest-mcp.js.map +1 -0
  296. package/dist/spreadsheet-artifact-commands.d.ts +14 -1
  297. package/dist/spreadsheet-artifact-commands.js +9 -2
  298. package/dist/spreadsheet-artifact-query.d.ts +13 -6
  299. package/dist/spreadsheet-artifact-query.js +4 -3
  300. package/dist/subscription-account-actions.d.ts +83 -0
  301. package/dist/subscription-account-pools.d.ts +326 -0
  302. package/dist/subscription-personal-authority-v2.d.ts +28 -0
  303. package/dist/subscription-personal-authority-v2.js +13 -0
  304. package/dist/subscription-personal-authority-v2.js.map +1 -0
  305. package/dist/subscription-plans.d.ts +38 -0
  306. package/dist/subscription-usage-pool.d.ts +89 -0
  307. package/dist/tool-action-review.d.ts +141 -0
  308. package/dist/tool-catalog.d.ts +479 -0
  309. package/dist/tool-policy.d.ts +5 -0
  310. package/dist/tool-review-presentation.d.ts +29 -0
  311. package/dist/tool-review-presentation.js +21 -0
  312. package/dist/tool-review-presentation.js.map +1 -0
  313. package/dist/turn-serving-policy.d.ts +223 -0
  314. package/dist/usage-allowances.d.ts +30 -0
  315. package/dist/usage-allowances.js +5 -1
  316. package/dist/values.d.ts +11 -0
  317. package/dist/values.js +19 -0
  318. package/dist/values.js.map +1 -0
  319. package/dist/vault-provider-wire.d.ts +907 -0
  320. package/dist/vault-provider-wire.js +74 -0
  321. package/dist/vault-provider-wire.js.map +1 -0
  322. package/dist/vaults.d.ts +2185 -0
  323. package/dist/video-generation.d.ts +75 -0
  324. package/dist/video-generation.js +8 -1
  325. package/dist/workspace-control-event.d.ts +18 -0
  326. package/dist/workspace-control-event.js +18 -0
  327. package/dist/workspace-control-event.js.map +1 -0
  328. package/dist/workspace-governance-context.d.ts +18 -0
  329. package/dist/workspace-integration-wire.d.ts +1 -1
  330. package/dist/workspace-integration-wire.js +1 -1
  331. package/dist/workspace-integrations.d.ts +212 -12
  332. package/dist/xai-provider-account-authority.js +3 -1
  333. package/package.json +121 -4
  334. package/src/agent-authored-durable-text.ts +14 -11
  335. package/src/agent-config.ts +382 -203
  336. package/src/agent-instruction-changes.ts +94 -74
  337. package/src/agent-learning.ts +94 -66
  338. package/src/agent-topology.ts +58 -52
  339. package/src/api-key-presets.ts +28 -0
  340. package/src/app-action-catalog-types.ts +32 -0
  341. package/src/app-action-catalog.gen.ts +9905 -0
  342. package/src/app-actions.ts +365 -0
  343. package/src/app-shot.ts +176 -0
  344. package/src/artifact-catalog.ts +81 -46
  345. package/src/artifacts.ts +360 -227
  346. package/src/atlassian-native-retirement.ts +33 -0
  347. package/src/atlassian.ts +136 -108
  348. package/src/automation-templates.ts +201 -0
  349. package/src/billing-subscriptions.ts +48 -0
  350. package/src/bots.ts +238 -0
  351. package/src/bundled-skills.ts +79 -22
  352. package/src/canonical-human-identities.ts +65 -62
  353. package/src/child-lifecycle-notice-protocol.gen.json +1310 -0
  354. package/src/child-lifecycle-notice-protocol.ts +224 -0
  355. package/src/claude-provider-account-authority.ts +12 -0
  356. package/src/claude-subscription-oauth.ts +61 -19
  357. package/src/claude-subscription-usage.ts +64 -35
  358. package/src/client-error-report.ts +344 -9
  359. package/src/code-search.ts +1 -1
  360. package/src/codex-provider-account-authority.ts +22 -16
  361. package/src/company-brain-governed-writes.ts +265 -244
  362. package/src/company-brain.ts +165 -154
  363. package/src/company-profile.ts +362 -297
  364. package/src/connect.ts +222 -173
  365. package/src/connection-account-label.ts +45 -0
  366. package/src/connection-authority.ts +172 -152
  367. package/src/connector-attachments.ts +139 -123
  368. package/src/connector-destinations.ts +48 -43
  369. package/src/connector-tool-permissions.ts +104 -46
  370. package/src/credential-profiles.ts +161 -0
  371. package/src/cua-desktop-tools.gen.json +6722 -0
  372. package/src/cua-desktop-tools.linux.gen.json +6798 -0
  373. package/src/cua-desktop-tools.ts +42 -0
  374. package/src/cua-desktop-tools.windows.gen.json +6739 -0
  375. package/src/define-schema.ts +10 -0
  376. package/src/desktop-app.ts +50 -0
  377. package/src/direct-model-provider.ts +112 -0
  378. package/src/editable-artifact-binary.ts +29 -8
  379. package/src/editable-artifact-committed-transaction.ts +19 -18
  380. package/src/editable-artifact-serialized-commit.ts +8 -2
  381. package/src/editable-artifact-versions.ts +7 -1
  382. package/src/event-preview.ts +53 -3
  383. package/src/event-triggers.ts +891 -0
  384. package/src/external-identities.ts +239 -195
  385. package/src/feedback.ts +125 -30
  386. package/src/file-access.ts +26 -0
  387. package/src/first-party-tool-authorization.ts +383 -0
  388. package/src/github-repository-contracts.ts +78 -64
  389. package/src/google-drive-native-retirement.ts +20 -0
  390. package/src/google-drive.ts +286 -234
  391. package/src/governed-learning-activation.ts +159 -137
  392. package/src/governed-learning-evaluator.ts +141 -133
  393. package/src/host-mcp-bindings.ts +244 -221
  394. package/src/image-generation.ts +105 -95
  395. package/src/index.ts +13928 -9899
  396. package/src/inference-residency.ts +36 -0
  397. package/src/insights-usage.ts +774 -0
  398. package/src/integration-capability-id.ts +16 -0
  399. package/src/interaction-action-deadline.ts +143 -0
  400. package/src/interaction-driver-diagnostic.ts +89 -0
  401. package/src/interaction.ts +3527 -2427
  402. package/src/knowledge-entries.ts +386 -299
  403. package/src/knowledge-preparation.ts +49 -41
  404. package/src/knowledge.ts +242 -213
  405. package/src/learning-refusal.ts +90 -0
  406. package/src/managed-auth-session-sets.ts +180 -133
  407. package/src/managed-sign-in-methods.ts +156 -34
  408. package/src/mcp-oauth.ts +58 -46
  409. package/src/mcp-receipts.ts +199 -194
  410. package/src/mcp-structured-content.ts +81 -0
  411. package/src/memory-slack-delivery.ts +172 -142
  412. package/src/message-time-zone.ts +109 -0
  413. package/src/modal-native-proof-v2.ts +430 -0
  414. package/src/model-account-choice.ts +178 -0
  415. package/src/model-account-settings.ts +210 -0
  416. package/src/model-availability.ts +22 -0
  417. package/src/model-connection-access.ts +62 -14
  418. package/src/model-context-inspector.ts +130 -109
  419. package/src/model-display.ts +221 -0
  420. package/src/model-picker-order.ts +1 -1
  421. package/src/model-residency.ts +535 -0
  422. package/src/organization-access.ts +216 -0
  423. package/src/organization-integration-policy.ts +47 -28
  424. package/src/organization-membership-lifecycle.ts +558 -384
  425. package/src/organization-model-usage.ts +82 -0
  426. package/src/organization-recovery.ts +148 -135
  427. package/src/organization-usage.ts +84 -52
  428. package/src/passkey-only-account.ts +29 -0
  429. package/src/permissions.ts +94 -52
  430. package/src/personal-github.ts +211 -171
  431. package/src/personal-integration-setup.ts +150 -0
  432. package/src/preference-registry.ts +319 -263
  433. package/src/prepared-mcp-setup.ts +190 -0
  434. package/src/primitives.ts +22 -0
  435. package/src/product-analytics.ts +40 -15
  436. package/src/product-lifecycle-facts.ts +50 -20
  437. package/src/prompt-cache-diagnostics.ts +212 -0
  438. package/src/recordings.ts +1153 -0
  439. package/src/remember.ts +184 -172
  440. package/src/retained-output.ts +181 -168
  441. package/src/sandbox-file-artifacts.ts +78 -57
  442. package/src/sandbox-provider-command.ts +55 -72
  443. package/src/sandbox-recovery.ts +163 -77
  444. package/src/scoped-knowledge.ts +62 -43
  445. package/src/secret-generator.ts +156 -0
  446. package/src/secret-mask-strings.ts +175 -0
  447. package/src/secret-references.ts +414 -0
  448. package/src/secret-resolution.ts +322 -0
  449. package/src/secret-shape-masking.ts +573 -0
  450. package/src/secret-totp.ts +188 -0
  451. package/src/secret-use-approval-question.ts +22 -0
  452. package/src/secret-use-approvals.ts +219 -0
  453. package/src/secret-value-masking.ts +1283 -0
  454. package/src/secret-value.ts +22 -0
  455. package/src/session-goal-reports.ts +55 -49
  456. package/src/session-history-import.ts +84 -68
  457. package/src/session-history.ts +197 -0
  458. package/src/session-list-entries.ts +106 -0
  459. package/src/session-mcp-projections.ts +21 -3
  460. package/src/session-mcp-tool-permissions.ts +109 -0
  461. package/src/session-message-search.ts +46 -38
  462. package/src/session-target.ts +58 -0
  463. package/src/session-titles.ts +40 -4
  464. package/src/session-topology-primitives.ts +20 -12
  465. package/src/session-usage-limit-refusal.ts +101 -0
  466. package/src/session-usage-limits.ts +169 -0
  467. package/src/signup-attribution.ts +20 -15
  468. package/src/site-data.ts +337 -0
  469. package/src/site-operations.ts +154 -0
  470. package/src/site-publishing.ts +903 -0
  471. package/src/site-session-http.ts +344 -16
  472. package/src/site-sql.ts +1120 -0
  473. package/src/skill-use.ts +18 -17
  474. package/src/skills.ts +105 -50
  475. package/src/slack-bot-scopes.ts +18 -35
  476. package/src/slack-rest-mcp.ts +222 -0
  477. package/src/slack-task-policy.ts +97 -73
  478. package/src/spreadsheet-artifact-commands.ts +74 -13
  479. package/src/spreadsheet-artifact-query.ts +188 -50
  480. package/src/subscription-account-actions.ts +103 -0
  481. package/src/subscription-account-pools.ts +74 -0
  482. package/src/subscription-personal-authority-v2.ts +69 -0
  483. package/src/subscription-plans.ts +51 -0
  484. package/src/subscription-usage-pool.ts +44 -0
  485. package/src/task-notes.ts +70 -68
  486. package/src/tool-action-review.ts +271 -0
  487. package/src/tool-catalog.ts +694 -379
  488. package/src/tool-policy.ts +82 -0
  489. package/src/tool-result-spill.ts +13 -9
  490. package/src/tool-review-presentation.ts +643 -0
  491. package/src/turn-serving-policy.ts +167 -0
  492. package/src/usage-allowances.ts +212 -136
  493. package/src/values.ts +25 -0
  494. package/src/vault-provider-wire.ts +580 -0
  495. package/src/vaults.ts +1296 -0
  496. package/src/video-generation.ts +430 -361
  497. package/src/work-claims.ts +183 -166
  498. package/src/workspace-control-event.ts +134 -0
  499. package/src/workspace-governance-context.ts +63 -0
  500. package/src/workspace-instruction-policies.ts +346 -279
  501. package/src/workspace-integration-wire.ts +10 -0
  502. package/src/workspace-integrations.ts +488 -398
  503. package/src/workspace-learning-administration.ts +58 -44
  504. package/src/workspace-learning-policy.ts +126 -99
  505. package/src/workspace-state.ts +239 -220
  506. package/src/xai-provider-account-authority.ts +23 -17
  507. package/dist/chunk-3SIZGL3O.js.map +0 -1
  508. package/dist/chunk-566IFOVP.js +0 -26133
  509. package/dist/chunk-566IFOVP.js.map +0 -1
  510. package/dist/chunk-5IXYF6XN.js +0 -728
  511. package/dist/chunk-5IXYF6XN.js.map +0 -1
  512. package/dist/chunk-5Q54VCCH.js.map +0 -1
  513. package/dist/chunk-BCS7WHCK.js +0 -139
  514. package/dist/chunk-BCS7WHCK.js.map +0 -1
  515. package/dist/chunk-EK7NDGFR.js +0 -128
  516. package/dist/chunk-EK7NDGFR.js.map +0 -1
  517. package/dist/chunk-GRG7PHWQ.js +0 -25
  518. package/dist/chunk-GRG7PHWQ.js.map +0 -1
  519. package/dist/chunk-HHZSZYYF.js.map +0 -1
  520. package/dist/chunk-ICDZGUX2.js +0 -186
  521. package/dist/chunk-ICDZGUX2.js.map +0 -1
  522. package/dist/chunk-JUFK3T4Q.js +0 -80
  523. package/dist/chunk-JUFK3T4Q.js.map +0 -1
  524. package/dist/chunk-MYBZRDTY.js.map +0 -1
  525. package/dist/chunk-NRMCVHAU.js.map +0 -1
  526. package/dist/chunk-O77VSFYZ.js.map +0 -1
  527. package/dist/chunk-P3HLDT77.js +0 -59
  528. package/dist/chunk-P3HLDT77.js.map +0 -1
  529. package/dist/chunk-TXTQIYCV.js.map +0 -1
  530. package/dist/chunk-WYBDERIY.js.map +0 -1
  531. package/dist/chunk-Y3KNXVTD.js.map +0 -1
  532. package/dist/chunk-YBW5JSA3.js.map +0 -1
  533. package/dist/chunk-YRXAWWCU.js +0 -45
  534. package/dist/chunk-YRXAWWCU.js.map +0 -1
  535. package/dist/chunk-YWMOIZ6A.js +0 -185
  536. package/dist/chunk-YWMOIZ6A.js.map +0 -1
  537. package/dist/site-request-headers.test.d.ts +0 -1
  538. package/dist/transcription-recordings.d.ts +0 -300
  539. package/src/transcription-recordings.ts +0 -169
  540. /package/dist/{chunk-SIOU2K4U.js.map → chunk-LJH2EYGT.js.map} +0 -0
  541. /package/dist/{chunk-RIY7GYQS.js.map → chunk-PTSROVDG.js.map} +0 -0
  542. /package/dist/{chunk-YRKRZ6OF.js.map → chunk-TOOJIBJC.js.map} +0 -0
  543. /package/dist/{chunk-D2HKF2EF.js.map → chunk-XP5M3IKT.js.map} +0 -0
@@ -0,0 +1,799 @@
1
+ import {
2
+ retainedOutputUnavailable,
3
+ validateRetainedOutputEvidence
4
+ } from "./chunk-UH4K7GP7.js";
5
+
6
+ // src/event-preview.ts
7
+ var SESSION_EVENT_PAYLOAD_MAX_BYTES = 64 * 1024;
8
+ var TOOL_CALL_OUTPUT_EVENT_MAX_BYTES = 256 * 1024;
9
+ var TOOL_CALL_OUTPUT_EVENT_STRING_BYTES = 64 * 1024;
10
+ var TARGET_PAYLOAD_BYTES = 60 * 1024;
11
+ var DEFAULT_STRING_BYTES = 8 * 1024;
12
+ var RETRY_STRING_BYTES = 1024;
13
+ var DEFAULT_ARRAY_ENTRIES = 40;
14
+ var RETRY_ARRAY_ENTRIES = 12;
15
+ var DEFAULT_OBJECT_FIELDS = 80;
16
+ var RETRY_OBJECT_FIELDS = 32;
17
+ var MAX_PREVIEW_DEPTH = 12;
18
+ var MAX_PREVIEW_NODES = 512;
19
+ var MAX_MEASUREMENT_NODES = 2048;
20
+ var MAX_MEASUREMENT_DEPTH = 64;
21
+ var MAX_DETAIL_RECORDS = 24;
22
+ var APPROX_BYTES_PER_TOKEN = 4;
23
+ var encoder = new TextEncoder();
24
+ var IDENTITY_FIELDS = /* @__PURE__ */ new Set([
25
+ "id",
26
+ "callId",
27
+ "call_id",
28
+ "name",
29
+ "toolName",
30
+ "type",
31
+ "status",
32
+ "code",
33
+ "isError",
34
+ "stream",
35
+ "commandId",
36
+ "sequence"
37
+ ]);
38
+ function sessionEventJsonBytes(value) {
39
+ return encoder.encode(stringifyForBoundary(value)).byteLength;
40
+ }
41
+ function measureSessionEventJson(value) {
42
+ return measureJsonBytes(value);
43
+ }
44
+ function approximateSessionEventTokens(bytes) {
45
+ return Math.ceil(Math.max(0, bytes) / APPROX_BYTES_PER_TOKEN);
46
+ }
47
+ function sessionEventMediaPreview(mediaType, inlineBytes) {
48
+ return {
49
+ type: "media_preview",
50
+ mediaType: mediaType || "application/octet-stream",
51
+ inlineBytes: inlineBytes === null ? null : Math.max(0, Math.floor(Number.isFinite(inlineBytes) ? inlineBytes : 0)),
52
+ fullOutputAvailable: false,
53
+ preview: "Inline media omitted from the audit timeline; source bytes were not retained."
54
+ };
55
+ }
56
+ function sessionEventMediaPreviewFromDataUrl(value) {
57
+ const match = /^data:([^;,]+)(?:;[^,]*)?;base64,/i.exec(value);
58
+ if (!match) return null;
59
+ const encodedLength = Math.max(0, value.length - match[0].length);
60
+ const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
61
+ return sessionEventMediaPreview(
62
+ match[1] ?? "application/octet-stream",
63
+ Math.max(0, Math.floor(encodedLength * 3 / 4) - padding)
64
+ );
65
+ }
66
+ function sessionEventPayloadTruncation(payload) {
67
+ if (!isPlainRecord(payload)) return null;
68
+ const value = payload.truncation;
69
+ if (!isPlainRecord(value) || value.truncated !== true) return null;
70
+ return value;
71
+ }
72
+ function boundSessionEventPayload(payload, options = {}) {
73
+ const maxBytes = Math.max(1024, Math.floor(options.maxBytes ?? SESSION_EVENT_PAYLOAD_MAX_BYTES));
74
+ const surface = options.surface ?? "durable_audit";
75
+ const customStringBytes = options.stringBytes === void 0 ? null : Math.max(RETRY_STRING_BYTES, Math.floor(options.stringBytes));
76
+ const stringBytes = customStringBytes ?? DEFAULT_STRING_BYTES;
77
+ const retryStringBytes = customStringBytes === null ? RETRY_STRING_BYTES : Math.max(RETRY_STRING_BYTES, Math.floor(customStringBytes / 8));
78
+ const targetBytes = customStringBytes === null ? Math.min(maxBytes, TARGET_PAYLOAD_BYTES) : maxBytes;
79
+ const fullEvidence = validateRetainedOutputEvidence(options.fullEvidence) ?? retainedOutputUnavailable();
80
+ const originalMeasurement = measureJsonBytes(payload);
81
+ const originalBytes = originalMeasurement.bytes;
82
+ let state = previewState(stringBytes, DEFAULT_ARRAY_ENTRIES, DEFAULT_OBJECT_FIELDS);
83
+ let preview = previewValue(payload, state, "$", 0);
84
+ if (!state.changed && originalBytes !== null && originalBytes <= maxBytes) {
85
+ return payload;
86
+ }
87
+ let reason = payloadTruncationReason(originalMeasurement, state);
88
+ let bounded = attachTruncation(
89
+ preview,
90
+ boundaryMetadata(surface, reason, originalBytes, state, fullEvidence)
91
+ );
92
+ if (sessionEventJsonBytes(bounded) > targetBytes) {
93
+ state = previewState(retryStringBytes, RETRY_ARRAY_ENTRIES, RETRY_OBJECT_FIELDS);
94
+ preview = previewValue(payload, state, "$", 0);
95
+ reason = payloadTruncationReason(originalMeasurement, state);
96
+ bounded = attachTruncation(
97
+ preview,
98
+ boundaryMetadata(surface, reason, originalBytes, state, fullEvidence)
99
+ );
100
+ }
101
+ if (sessionEventJsonBytes(bounded) > maxBytes) {
102
+ const identity = identityPreview(payload);
103
+ state.changed = true;
104
+ recordDetail(state, {
105
+ path: "$",
106
+ kind: "object",
107
+ ...originalBytes === null ? {} : { originalBytes }
108
+ });
109
+ bounded = attachTruncation(
110
+ {
111
+ ...identity,
112
+ preview: "[event payload omitted: bounded audit preview exceeded the storage envelope]"
113
+ },
114
+ boundaryMetadata(surface, reason, originalBytes, state, fullEvidence)
115
+ );
116
+ }
117
+ settleDeliveredSizes(bounded, maxBytes);
118
+ return bounded;
119
+ }
120
+ function boundSessionEventPayloadForWrite(type, payload) {
121
+ if (type !== "agent.toolCall.output") return payload;
122
+ let bytes;
123
+ try {
124
+ bytes = sessionEventJsonBytes(payload);
125
+ } catch {
126
+ bytes = null;
127
+ }
128
+ if (bytes !== null && bytes <= TOOL_CALL_OUTPUT_EVENT_MAX_BYTES) return payload;
129
+ return boundSessionEventPayload(payload, {
130
+ surface: "durable_audit",
131
+ maxBytes: TOOL_CALL_OUTPUT_EVENT_MAX_BYTES,
132
+ stringBytes: TOOL_CALL_OUTPUT_EVENT_STRING_BYTES
133
+ });
134
+ }
135
+ function previewState(stringBytes, arrayEntries, objectFields) {
136
+ return {
137
+ changed: false,
138
+ sawMedia: false,
139
+ details: [],
140
+ stringBytes,
141
+ arrayEntries,
142
+ objectFields,
143
+ remainingNodes: MAX_PREVIEW_NODES
144
+ };
145
+ }
146
+ function payloadTruncationReason(measurement, state) {
147
+ if (state.sawMedia) return "inline_media_not_retained";
148
+ return measurement.bytes === null ? measurement.reason : "payload_bytes_exceeded";
149
+ }
150
+ function previewValue(value, state, path, depth) {
151
+ if (state.remainingNodes <= 0) {
152
+ state.changed = true;
153
+ recordDetail(state, { path, kind: "budget" });
154
+ return "[nested value omitted at audit preview traversal boundary]";
155
+ }
156
+ state.remainingNodes -= 1;
157
+ if (typeof value === "string") {
158
+ const media = inlineMediaFact(value);
159
+ if (media) {
160
+ state.changed = true;
161
+ state.sawMedia = true;
162
+ recordDetail(state, {
163
+ path,
164
+ kind: "media",
165
+ originalBytes: utf8Bytes(value),
166
+ deliveredBytes: sessionEventJsonBytes(media),
167
+ mediaType: media.mediaType
168
+ });
169
+ return media;
170
+ }
171
+ const originalBytes = utf8Bytes(value);
172
+ if (originalBytes <= state.stringBytes) return value;
173
+ state.changed = true;
174
+ const delivered = truncateUtf8Middle(value, state.stringBytes, originalBytes);
175
+ recordDetail(state, {
176
+ path,
177
+ kind: "string",
178
+ originalBytes,
179
+ deliveredBytes: utf8Bytes(delivered)
180
+ });
181
+ return delivered;
182
+ }
183
+ if (typeof value === "bigint" || typeof value === "function" || typeof value === "symbol") {
184
+ state.changed = true;
185
+ recordDetail(state, { path, kind: "unserializable" });
186
+ return `[${typeof value} value omitted at audit serialization boundary]`;
187
+ }
188
+ if (value === null || typeof value !== "object") return value;
189
+ const binary = binaryFact(value);
190
+ if (binary) {
191
+ state.changed = true;
192
+ recordDetail(state, {
193
+ path,
194
+ kind: "binary",
195
+ originalBytes: binary.originalBytes,
196
+ deliveredBytes: sessionEventJsonBytes(binary.preview)
197
+ });
198
+ return binary.preview;
199
+ }
200
+ if (depth >= MAX_PREVIEW_DEPTH) {
201
+ state.changed = true;
202
+ recordDetail(state, { path, kind: "depth" });
203
+ return "[nested value omitted at audit preview depth boundary]";
204
+ }
205
+ if (Array.isArray(value)) {
206
+ const keep = Math.max(2, state.arrayEntries);
207
+ if (value.length <= keep) {
208
+ return Array.from(
209
+ { length: value.length },
210
+ (_, index) => previewArrayEntry(value, index, state, path, depth)
211
+ );
212
+ }
213
+ state.changed = true;
214
+ const head = Math.ceil(keep / 2);
215
+ const tail = Math.floor(keep / 2);
216
+ const omitted2 = value.length - head - tail;
217
+ recordDetail(state, { path, kind: "array", omittedEntries: omitted2 });
218
+ return [
219
+ ...Array.from(
220
+ { length: head },
221
+ (_, index) => previewArrayEntry(value, index, state, path, depth)
222
+ ),
223
+ { omittedEntries: omitted2, preview: "[middle array entries omitted]" },
224
+ ...Array.from(
225
+ { length: tail },
226
+ (_, index) => previewArrayEntry(value, value.length - tail + index, state, path, depth)
227
+ )
228
+ ];
229
+ }
230
+ if (value instanceof Date) {
231
+ if (!hasCanonicalDateSerialization(value)) {
232
+ state.changed = true;
233
+ recordDetail(state, { path, kind: "unserializable" });
234
+ return "[Date value with custom serialization omitted at audit boundary]";
235
+ }
236
+ try {
237
+ const epoch = Date.prototype.getTime.call(value);
238
+ return Number.isFinite(epoch) ? Date.prototype.toISOString.call(value) : null;
239
+ } catch {
240
+ state.changed = true;
241
+ recordDetail(state, { path, kind: "unserializable" });
242
+ return "[Date value omitted at audit serialization boundary]";
243
+ }
244
+ }
245
+ const record = value;
246
+ const { entries, omitted, accessorKeys } = selectObjectEntries(record, state.objectFields);
247
+ for (const key of accessorKeys) {
248
+ state.changed = true;
249
+ recordDetail(state, {
250
+ path: `${path}.${key}`,
251
+ kind: "unserializable"
252
+ });
253
+ }
254
+ if (omitted) {
255
+ state.changed = true;
256
+ recordDetail(state, {
257
+ path,
258
+ kind: "object",
259
+ // Counting every remaining field would defeat the traversal bound. `null`
260
+ // is deliberate: at least one field was omitted, but its exact count is
261
+ // unknown because the source was not fully enumerated.
262
+ omittedEntries: null
263
+ });
264
+ }
265
+ const out = {};
266
+ for (const [key, entry] of entries) {
267
+ out[key] = previewValue(entry, state, `${path}.${key}`, depth + 1);
268
+ }
269
+ if (omitted) {
270
+ out.omittedFields = "additional fields omitted; exact count not measured";
271
+ }
272
+ return out;
273
+ }
274
+ function previewArrayEntry(value, index, state, path, depth) {
275
+ let descriptor;
276
+ try {
277
+ descriptor = Object.getOwnPropertyDescriptor(value, String(index));
278
+ } catch {
279
+ state.changed = true;
280
+ recordDetail(state, { path: `${path}[${index}]`, kind: "unserializable" });
281
+ return "[array element omitted at audit serialization boundary]";
282
+ }
283
+ if (descriptor && !("value" in descriptor)) {
284
+ state.changed = true;
285
+ recordDetail(state, { path: `${path}[${index}]`, kind: "unserializable" });
286
+ return "[array accessor value omitted at audit serialization boundary]";
287
+ }
288
+ return previewValue(
289
+ descriptor && "value" in descriptor ? descriptor.value : void 0,
290
+ state,
291
+ `${path}[${index}]`,
292
+ depth + 1
293
+ );
294
+ }
295
+ function selectObjectEntries(record, maxFields) {
296
+ const entries = [];
297
+ const selected = /* @__PURE__ */ new Set();
298
+ const accessorKeys = [];
299
+ const select = (key) => {
300
+ const descriptor = Object.getOwnPropertyDescriptor(record, key);
301
+ if (!descriptor?.enumerable) return false;
302
+ selected.add(key);
303
+ if ("value" in descriptor) {
304
+ entries.push([key, descriptor.value]);
305
+ } else {
306
+ entries.push([key, "[accessor value omitted at audit serialization boundary]"]);
307
+ accessorKeys.push(key);
308
+ }
309
+ return true;
310
+ };
311
+ try {
312
+ for (const key of IDENTITY_FIELDS) {
313
+ if (entries.length >= maxFields) break;
314
+ select(key);
315
+ }
316
+ for (const key in record) {
317
+ if (!Object.prototype.hasOwnProperty.call(record, key) || selected.has(key)) continue;
318
+ if (entries.length >= maxFields) {
319
+ return { entries, omitted: true, accessorKeys };
320
+ }
321
+ select(key);
322
+ }
323
+ } catch {
324
+ return { entries, omitted: true, accessorKeys };
325
+ }
326
+ return { entries, omitted: false, accessorKeys };
327
+ }
328
+ function attachTruncation(preview, truncation) {
329
+ if (isPlainRecord(preview)) {
330
+ return { ...preview, truncation };
331
+ }
332
+ return { value: preview, truncation };
333
+ }
334
+ function boundaryMetadata(surface, reason, originalBytes, state, fullEvidence) {
335
+ return {
336
+ truncated: true,
337
+ surface,
338
+ reason,
339
+ originalBytes,
340
+ deliveredBytes: 0,
341
+ omittedBytes: originalBytes,
342
+ estimatedOriginalTokens: originalBytes === null ? null : approximateSessionEventTokens(originalBytes),
343
+ estimatedDeliveredTokens: 0,
344
+ fullEvidence,
345
+ details: state.details
346
+ };
347
+ }
348
+ function settleDeliveredSizes(payload, maxBytes) {
349
+ const truncation = payload.truncation;
350
+ convergeDeliveredSizes(payload, truncation);
351
+ if (sessionEventJsonBytes(payload) > maxBytes) {
352
+ payload.preview = "[event payload omitted at audit byte boundary]";
353
+ for (const key of Object.keys(payload)) {
354
+ if (key !== "preview" && key !== "truncation" && IDENTITY_FIELDS.has(key) === false) {
355
+ delete payload[key];
356
+ }
357
+ }
358
+ truncation.details = truncation.details.slice(0, 4);
359
+ convergeDeliveredSizes(payload, truncation);
360
+ }
361
+ }
362
+ function convergeDeliveredSizes(payload, truncation) {
363
+ for (let attempt = 0; attempt < 16; attempt += 1) {
364
+ const deliveredBytes = sessionEventJsonBytes(payload);
365
+ const omittedBytes = truncation.originalBytes === null ? null : Math.max(0, truncation.originalBytes - deliveredBytes);
366
+ const estimatedDeliveredTokens = approximateSessionEventTokens(deliveredBytes);
367
+ if (truncation.deliveredBytes === deliveredBytes && truncation.omittedBytes === omittedBytes && truncation.estimatedDeliveredTokens === estimatedDeliveredTokens) {
368
+ return;
369
+ }
370
+ truncation.deliveredBytes = deliveredBytes;
371
+ truncation.omittedBytes = omittedBytes;
372
+ truncation.estimatedDeliveredTokens = estimatedDeliveredTokens;
373
+ }
374
+ throw new RangeError("Session event byte accounting did not converge");
375
+ }
376
+ function recordDetail(state, detail) {
377
+ if (state.details.length < MAX_DETAIL_RECORDS) state.details.push(detail);
378
+ }
379
+ function identityPreview(value) {
380
+ if (!isPlainRecord(value)) return {};
381
+ const out = {};
382
+ for (const key of IDENTITY_FIELDS) {
383
+ let field;
384
+ try {
385
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
386
+ if (!descriptor?.enumerable || !("value" in descriptor)) continue;
387
+ field = descriptor.value;
388
+ } catch {
389
+ continue;
390
+ }
391
+ if (typeof field === "string") {
392
+ out[key] = truncateUtf8Middle(field, 256, utf8Bytes(field));
393
+ } else if (typeof field === "number" || typeof field === "boolean" || field === null) {
394
+ out[key] = field;
395
+ }
396
+ }
397
+ return out;
398
+ }
399
+ function inlineMediaFact(value) {
400
+ return sessionEventMediaPreviewFromDataUrl(value);
401
+ }
402
+ function binaryFact(value) {
403
+ if (ArrayBuffer.isView(value)) {
404
+ return {
405
+ originalBytes: value.byteLength,
406
+ preview: {
407
+ type: "binary_preview",
408
+ byteLength: value.byteLength,
409
+ fullOutputAvailable: false,
410
+ preview: "Inline binary value omitted from the audit timeline; bytes were not retained."
411
+ }
412
+ };
413
+ }
414
+ if (value instanceof ArrayBuffer) {
415
+ return {
416
+ originalBytes: value.byteLength,
417
+ preview: {
418
+ type: "binary_preview",
419
+ byteLength: value.byteLength,
420
+ fullOutputAvailable: false,
421
+ preview: "Inline binary value omitted from the audit timeline; bytes were not retained."
422
+ }
423
+ };
424
+ }
425
+ return null;
426
+ }
427
+ function truncateUtf8Middle(value, maxBytes, knownBytes = utf8Bytes(value)) {
428
+ if (knownBytes <= maxBytes) return value;
429
+ let omittedBytes = Math.max(0, knownBytes - maxBytes);
430
+ for (let attempt = 0; attempt < 4; attempt += 1) {
431
+ const marker2 = `\u2026[${omittedBytes} bytes omitted]\u2026`;
432
+ const contentBudget2 = Math.max(0, maxBytes - utf8Bytes(marker2));
433
+ if (contentBudget2 === 0) return marker2;
434
+ const left2 = utf8Prefix(value, Math.floor(contentBudget2 / 2));
435
+ const right2 = utf8Suffix(value, contentBudget2 - left2.bytes);
436
+ const exactOmittedBytes = Math.max(0, knownBytes - left2.bytes - right2.bytes);
437
+ if (exactOmittedBytes === omittedBytes) {
438
+ return `${value.slice(0, left2.end)}${marker2}${value.slice(right2.start)}`;
439
+ }
440
+ omittedBytes = exactOmittedBytes;
441
+ }
442
+ const marker = `\u2026[${omittedBytes} bytes omitted]\u2026`;
443
+ const contentBudget = Math.max(0, maxBytes - utf8Bytes(marker));
444
+ const left = utf8Prefix(value, Math.floor(contentBudget / 2));
445
+ const right = utf8Suffix(value, contentBudget - left.bytes);
446
+ return `${value.slice(0, left.end)}${marker}${value.slice(right.start)}`;
447
+ }
448
+ function utf8Prefix(value, maxBytes) {
449
+ let end = 0;
450
+ let bytes = 0;
451
+ while (end < value.length) {
452
+ const unit = utf8UnitAt(value, end);
453
+ if (bytes + unit.bytes > maxBytes) break;
454
+ bytes += unit.bytes;
455
+ end += unit.codeUnits;
456
+ }
457
+ return { end, bytes };
458
+ }
459
+ function utf8Suffix(value, maxBytes) {
460
+ let start = value.length;
461
+ let bytes = 0;
462
+ while (start > 0) {
463
+ const unit = utf8UnitBefore(value, start);
464
+ if (bytes + unit.bytes > maxBytes) break;
465
+ bytes += unit.bytes;
466
+ start -= unit.codeUnits;
467
+ }
468
+ return { start, bytes };
469
+ }
470
+ function utf8UnitAt(value, index) {
471
+ const code = value.charCodeAt(index);
472
+ if (code <= 127) return { codeUnits: 1, bytes: 1 };
473
+ if (code <= 2047) return { codeUnits: 1, bytes: 2 };
474
+ if (code >= 55296 && code <= 56319) {
475
+ const next = index + 1 < value.length ? value.charCodeAt(index + 1) : 0;
476
+ if (next >= 56320 && next <= 57343) {
477
+ return { codeUnits: 2, bytes: 4 };
478
+ }
479
+ }
480
+ return { codeUnits: 1, bytes: 3 };
481
+ }
482
+ function utf8UnitBefore(value, end) {
483
+ const code = value.charCodeAt(end - 1);
484
+ if (code >= 56320 && code <= 57343 && end >= 2) {
485
+ const previous = value.charCodeAt(end - 2);
486
+ if (previous >= 55296 && previous <= 56319) {
487
+ return { codeUnits: 2, bytes: 4 };
488
+ }
489
+ }
490
+ if (code <= 127) return { codeUnits: 1, bytes: 1 };
491
+ if (code <= 2047) return { codeUnits: 1, bytes: 2 };
492
+ return { codeUnits: 1, bytes: 3 };
493
+ }
494
+ function utf8Bytes(value) {
495
+ let bytes = 0;
496
+ for (let index = 0; index < value.length; ) {
497
+ const unit = utf8UnitAt(value, index);
498
+ bytes += unit.bytes;
499
+ index += unit.codeUnits;
500
+ }
501
+ return bytes;
502
+ }
503
+ function measureJsonBytes(value) {
504
+ const state = {
505
+ remainingNodes: MAX_MEASUREMENT_NODES,
506
+ seen: /* @__PURE__ */ new WeakSet(),
507
+ failureReason: null
508
+ };
509
+ try {
510
+ const bytes = measureJsonValue(value, state, "top", 0);
511
+ return bytes === null ? {
512
+ bytes: null,
513
+ reason: state.failureReason ?? "payload_measurement_bounded"
514
+ } : { bytes, reason: null };
515
+ } catch {
516
+ return { bytes: null, reason: "payload_measurement_bounded" };
517
+ }
518
+ }
519
+ function measureJsonValue(value, state, position, depth) {
520
+ if (state.remainingNodes <= 0 || depth > MAX_MEASUREMENT_DEPTH) {
521
+ return failJsonMeasurement(state, "payload_measurement_bounded");
522
+ }
523
+ state.remainingNodes -= 1;
524
+ if (value === null) return 4;
525
+ if (typeof value === "string") return jsonStringBytes(value);
526
+ if (typeof value === "boolean") return value ? 4 : 5;
527
+ if (typeof value === "number") {
528
+ const serialized = JSON.stringify(value);
529
+ return serialized === void 0 ? null : serialized.length;
530
+ }
531
+ if (typeof value === "undefined" || typeof value === "function" || typeof value === "symbol") {
532
+ return position === "array" ? 4 : failJsonMeasurement(state, "payload_not_serializable");
533
+ }
534
+ if (typeof value === "bigint") {
535
+ return failJsonMeasurement(state, "payload_not_serializable");
536
+ }
537
+ if (typeof value !== "object") {
538
+ return failJsonMeasurement(state, "payload_not_serializable");
539
+ }
540
+ if (value instanceof Date) {
541
+ if (!hasCanonicalDateSerialization(value)) {
542
+ return failJsonMeasurement(state, "payload_measurement_bounded");
543
+ }
544
+ try {
545
+ const epoch = Date.prototype.getTime.call(value);
546
+ return Number.isFinite(epoch) ? jsonStringBytes(Date.prototype.toISOString.call(value)) : 4;
547
+ } catch {
548
+ return failJsonMeasurement(state, "payload_not_serializable");
549
+ }
550
+ }
551
+ if (ArrayBuffer.isView(value) || value instanceof ArrayBuffer) {
552
+ return failJsonMeasurement(state, "payload_measurement_bounded");
553
+ }
554
+ if (state.seen.has(value)) {
555
+ return failJsonMeasurement(state, "payload_not_serializable");
556
+ }
557
+ state.seen.add(value);
558
+ try {
559
+ if (Array.isArray(value)) {
560
+ if (Object.getPrototypeOf(value) !== Array.prototype) {
561
+ return failJsonMeasurement(state, "payload_measurement_bounded");
562
+ }
563
+ const toJson2 = Object.getOwnPropertyDescriptor(value, "toJSON");
564
+ if (toJson2 && ("get" in toJson2 || typeof toJson2.value === "function")) {
565
+ return failJsonMeasurement(state, "payload_measurement_bounded");
566
+ }
567
+ if (value.length > state.remainingNodes) {
568
+ return failJsonMeasurement(state, "payload_measurement_bounded");
569
+ }
570
+ let bytes2 = 2;
571
+ for (let index = 0; index < value.length; index += 1) {
572
+ if (index > 0) bytes2 += 1;
573
+ const descriptor = Object.getOwnPropertyDescriptor(value, String(index));
574
+ if (descriptor && !("value" in descriptor)) {
575
+ return failJsonMeasurement(state, "payload_measurement_bounded");
576
+ }
577
+ const entry = descriptor && "value" in descriptor ? descriptor.value : void 0;
578
+ const measured = measureJsonValue(entry, state, "array", depth + 1);
579
+ if (measured === null) return null;
580
+ bytes2 += measured;
581
+ }
582
+ return bytes2;
583
+ }
584
+ const prototype = Object.getPrototypeOf(value);
585
+ if (prototype !== Object.prototype && prototype !== null) {
586
+ return failJsonMeasurement(state, "payload_measurement_bounded");
587
+ }
588
+ const toJson = Object.getOwnPropertyDescriptor(value, "toJSON");
589
+ if (toJson && ("get" in toJson || typeof toJson.value === "function")) {
590
+ return failJsonMeasurement(state, "payload_measurement_bounded");
591
+ }
592
+ let bytes = 2;
593
+ let fields = 0;
594
+ try {
595
+ for (const key in value) {
596
+ if (!Object.prototype.hasOwnProperty.call(value, key)) continue;
597
+ if (state.remainingNodes <= 0) {
598
+ return failJsonMeasurement(state, "payload_measurement_bounded");
599
+ }
600
+ state.remainingNodes -= 1;
601
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
602
+ if (!descriptor || !("value" in descriptor)) {
603
+ return failJsonMeasurement(state, "payload_measurement_bounded");
604
+ }
605
+ const entry = descriptor.value;
606
+ if (typeof entry === "undefined" || typeof entry === "function" || typeof entry === "symbol") {
607
+ continue;
608
+ }
609
+ const measured = measureJsonValue(entry, state, "object", depth + 1);
610
+ if (measured === null) return null;
611
+ if (fields > 0) bytes += 1;
612
+ bytes += jsonStringBytes(key) + 1 + measured;
613
+ fields += 1;
614
+ }
615
+ } catch {
616
+ return null;
617
+ }
618
+ return bytes;
619
+ } finally {
620
+ state.seen.delete(value);
621
+ }
622
+ }
623
+ function hasCanonicalDateSerialization(value) {
624
+ try {
625
+ if (Object.getPrototypeOf(value) !== Date.prototype) return false;
626
+ return Object.getOwnPropertyDescriptor(value, "toJSON") === void 0;
627
+ } catch {
628
+ return false;
629
+ }
630
+ }
631
+ function failJsonMeasurement(state, reason) {
632
+ state.failureReason ??= reason;
633
+ return null;
634
+ }
635
+ function jsonStringBytes(value) {
636
+ let bytes = 2;
637
+ for (let index = 0; index < value.length; index += 1) {
638
+ const code = value.charCodeAt(index);
639
+ if (code === 34 || code === 92 || code === 8 || code === 9 || code === 10 || code === 12 || code === 13) {
640
+ bytes += 2;
641
+ } else if (code <= 31) {
642
+ bytes += 6;
643
+ } else if (code <= 127) {
644
+ bytes += 1;
645
+ } else if (code <= 2047) {
646
+ bytes += 2;
647
+ } else if (code >= 55296 && code <= 56319) {
648
+ const next = index + 1 < value.length ? value.charCodeAt(index + 1) : 0;
649
+ if (next >= 56320 && next <= 57343) {
650
+ bytes += 4;
651
+ index += 1;
652
+ } else {
653
+ bytes += 6;
654
+ }
655
+ } else if (code >= 56320 && code <= 57343) {
656
+ bytes += 6;
657
+ } else {
658
+ bytes += 3;
659
+ }
660
+ }
661
+ return bytes;
662
+ }
663
+ function serializeForBoundary(value) {
664
+ try {
665
+ const serialized = JSON.stringify(value);
666
+ return {
667
+ value: serialized === void 0 ? "null" : serialized,
668
+ serializable: serialized !== void 0
669
+ };
670
+ } catch {
671
+ return {
672
+ value: JSON.stringify("[unserializable event payload omitted]"),
673
+ serializable: false
674
+ };
675
+ }
676
+ }
677
+ function stringifyForBoundary(value) {
678
+ return serializeForBoundary(value).value;
679
+ }
680
+ function isPlainRecord(value) {
681
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
682
+ }
683
+
684
+ // src/workspace-control-event.ts
685
+ var WORKSPACE_CONTROL_REASON_MAX_BYTES = 8 * 1024;
686
+ var WORKSPACE_CONTROL_ACTOR_MAX_BYTES = 1024;
687
+ var WORKSPACE_CONTROL_EVENT_MAX_BYTES = 16 * 1024;
688
+ function workspaceControlUtf8Bytes(value) {
689
+ return new TextEncoder().encode(value).byteLength;
690
+ }
691
+ function boundWorkspaceControlEvent(event, options = {}) {
692
+ const existingFields = new Map(
693
+ (event.truncation?.fields ?? []).map((field) => [field.field, field])
694
+ );
695
+ const reason = event.reason === null ? null : boundWorkspaceControlText(event.reason, WORKSPACE_CONTROL_REASON_MAX_BYTES);
696
+ const actor = boundWorkspaceControlText(event.actor, WORKSPACE_CONTROL_ACTOR_MAX_BYTES);
697
+ const reasonBytes = reason === null ? 0 : workspaceControlUtf8Bytes(reason);
698
+ const actorBytes = workspaceControlUtf8Bytes(actor);
699
+ const reasonOriginalBytes = event.reason === null ? null : Math.max(
700
+ workspaceControlUtf8Bytes(event.reason),
701
+ normalizedWorkspaceControlOriginalBytes(options.reasonOriginalBytes),
702
+ existingFields.get("reason")?.originalBytes ?? 0
703
+ );
704
+ const actorOriginalBytes = Math.max(
705
+ workspaceControlUtf8Bytes(event.actor),
706
+ normalizedWorkspaceControlOriginalBytes(options.actorOriginalBytes),
707
+ existingFields.get("actor")?.originalBytes ?? 0
708
+ );
709
+ const fields = [];
710
+ if (reasonOriginalBytes !== null && reasonOriginalBytes > reasonBytes) {
711
+ fields.push({
712
+ field: "reason",
713
+ originalBytes: reasonOriginalBytes,
714
+ deliveredBytes: reasonBytes,
715
+ omittedBytes: reasonOriginalBytes - reasonBytes
716
+ });
717
+ }
718
+ if (actorOriginalBytes > actorBytes) {
719
+ fields.push({
720
+ field: "actor",
721
+ originalBytes: actorOriginalBytes,
722
+ deliveredBytes: actorBytes,
723
+ omittedBytes: actorOriginalBytes - actorBytes
724
+ });
725
+ }
726
+ if (fields.length === 0 && event.truncation == null) {
727
+ if (sessionEventJsonBytes(event) > WORKSPACE_CONTROL_EVENT_MAX_BYTES) {
728
+ throw new RangeError("Workspace control event exceeds its bounded envelope");
729
+ }
730
+ return event;
731
+ }
732
+ const truncation = {
733
+ truncated: true,
734
+ surface: event.truncation?.surface ?? options.surface ?? "durable_control",
735
+ deliveredBytes: 0,
736
+ fields,
737
+ fullEvidence: { available: false, reason: "not_retained" }
738
+ };
739
+ const bounded = {
740
+ ...event,
741
+ reason,
742
+ actor,
743
+ truncation
744
+ };
745
+ settleWorkspaceControlDeliveredBytes(bounded, truncation);
746
+ const deliveredBytes = sessionEventJsonBytes(bounded);
747
+ if (deliveredBytes > WORKSPACE_CONTROL_EVENT_MAX_BYTES) {
748
+ throw new RangeError(
749
+ `Bounded workspace control event exceeds its final envelope (${deliveredBytes} > ${WORKSPACE_CONTROL_EVENT_MAX_BYTES} bytes)`
750
+ );
751
+ }
752
+ return bounded;
753
+ }
754
+ function boundWorkspaceControlText(value, maxBytes) {
755
+ const encoder2 = new TextEncoder();
756
+ const decoder = new TextDecoder();
757
+ const bytes = encoder2.encode(value);
758
+ if (bytes.byteLength <= maxBytes) return value;
759
+ const marker = "\u2026[truncated]";
760
+ const prefixBudget = Math.max(0, maxBytes - encoder2.encode(marker).byteLength);
761
+ let prefixEnd = Math.min(prefixBudget, bytes.byteLength);
762
+ while (prefixEnd > 0 && prefixEnd < bytes.byteLength && (bytes[prefixEnd] & 192) === 128) {
763
+ prefixEnd -= 1;
764
+ }
765
+ return `${decoder.decode(bytes.subarray(0, prefixEnd))}${marker}`;
766
+ }
767
+ function normalizedWorkspaceControlOriginalBytes(value) {
768
+ return value === null || value === void 0 || !Number.isFinite(value) ? 0 : Math.max(0, Math.floor(value));
769
+ }
770
+ function settleWorkspaceControlDeliveredBytes(event, truncation) {
771
+ for (let attempt = 0; attempt < 16; attempt += 1) {
772
+ const deliveredBytes2 = sessionEventJsonBytes(event);
773
+ if (truncation.deliveredBytes === deliveredBytes2) return;
774
+ truncation.deliveredBytes = deliveredBytes2;
775
+ }
776
+ const deliveredBytes = sessionEventJsonBytes(event);
777
+ if (truncation.deliveredBytes !== deliveredBytes) {
778
+ throw new RangeError("Workspace control event byte accounting did not converge");
779
+ }
780
+ }
781
+
782
+ export {
783
+ SESSION_EVENT_PAYLOAD_MAX_BYTES,
784
+ TOOL_CALL_OUTPUT_EVENT_MAX_BYTES,
785
+ sessionEventJsonBytes,
786
+ measureSessionEventJson,
787
+ approximateSessionEventTokens,
788
+ sessionEventMediaPreview,
789
+ sessionEventMediaPreviewFromDataUrl,
790
+ sessionEventPayloadTruncation,
791
+ boundSessionEventPayload,
792
+ boundSessionEventPayloadForWrite,
793
+ WORKSPACE_CONTROL_REASON_MAX_BYTES,
794
+ WORKSPACE_CONTROL_ACTOR_MAX_BYTES,
795
+ WORKSPACE_CONTROL_EVENT_MAX_BYTES,
796
+ workspaceControlUtf8Bytes,
797
+ boundWorkspaceControlEvent
798
+ };
799
+ //# sourceMappingURL=chunk-4YDDHSO2.js.map