@openclaw/googlechat 2026.7.2-beta.5 → 2026.7.33

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 (251) hide show
  1. package/README.md +1 -1
  2. package/dist/.setup/actions-DeT_GgtP.mjs +167 -0
  3. package/dist/.setup/approval-auth-CQP5ZS_f.mjs +27 -0
  4. package/dist/{approval-handler.runtime-BJXVLK9y.js → .setup/approval-handler.runtime-DWNRBf9B.mjs} +5 -6
  5. package/dist/{channel-CehfTiWZ.js → .setup/channel-BPjomke4.mjs} +80 -58
  6. package/dist/{channel-base-CC85hRUC.js → .setup/channel-base-DJICAvKH.mjs} +80 -148
  7. package/dist/{channel.adapters-DLatFGZz.js → .setup/channel.adapters-T6wPzrpo.mjs} +164 -379
  8. package/dist/{channel.runtime-Bz0__ttC.js → .setup/channel.runtime-CpT-qT67.mjs} +241 -458
  9. package/dist/.setup/doctor-contract-BcEqUZ4j.mjs +151 -0
  10. package/dist/{runtime-api-Dh0CNVS4.js → .setup/runtime-api-BbVoWRxq.mjs} +7 -3
  11. package/dist/.setup/secret-contract-api-BGDBptmu.mjs +3 -0
  12. package/dist/.setup/secret-contract-lCMHqumt.mjs +99 -0
  13. package/dist/.setup/setup-plugin-api-BgwvQMls.mjs +5 -0
  14. package/dist/.setup/setup-plugin-api-Ce08GSFO.mjs +2 -0
  15. package/dist/api.js +2 -2
  16. package/dist/channel-config-api.js +2 -1
  17. package/dist/channel-plugin-api.js +1 -1
  18. package/dist/directory-contract-api.js +1 -1
  19. package/dist/doctor-contract-api.js +1 -1
  20. package/dist/runtime-api.js +2 -3
  21. package/dist/secret-contract-api.js +1 -1
  22. package/dist/setup-entry.js +3 -2
  23. package/dist/setup-plugin-api.js +1 -4
  24. package/node_modules/gaxios/build/cjs/src/gaxios.js +1 -1
  25. package/node_modules/gaxios/build/cjs/src/gaxios.js.map +1 -1
  26. package/node_modules/gaxios/build/cjs/test/test.getch.js +0 -66
  27. package/node_modules/gaxios/build/cjs/test/test.getch.js.map +1 -1
  28. package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  29. package/node_modules/gaxios/build/esm/src/gaxios.js +1 -1
  30. package/node_modules/gaxios/build/esm/src/gaxios.js.map +1 -1
  31. package/node_modules/gaxios/build/esm/test/test.getch.js +0 -66
  32. package/node_modules/gaxios/build/esm/test/test.getch.js.map +1 -1
  33. package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
  34. package/node_modules/gaxios/package.json +4 -4
  35. package/openclaw.plugin.json +488 -416
  36. package/package.json +24 -81
  37. package/dist/actions-wnreW-IQ.js +0 -76
  38. package/dist/approval-auth-G-OFufNc.js +0 -30
  39. package/dist/config-api-CsD0IFxF.js +0 -3
  40. package/dist/doctor-contract-BpuSvJro.js +0 -115
  41. package/dist/secret-contract-BFYyuE0F.js +0 -88
  42. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/LICENSE +0 -0
  43. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/README.md +0 -0
  44. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/helpers.d.ts +0 -0
  45. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/helpers.d.ts.map +0 -0
  46. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/helpers.js +0 -0
  47. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/helpers.js.map +0 -0
  48. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/index.d.ts +0 -0
  49. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/index.d.ts.map +0 -0
  50. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/index.js +0 -0
  51. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/dist/index.js.map +0 -0
  52. /package/node_modules/{agent-base → gaxios/node_modules/agent-base}/package.json +0 -0
  53. /package/node_modules/{data-uri-to-buffer → gaxios/node_modules/data-uri-to-buffer}/README.md +0 -0
  54. /package/node_modules/{data-uri-to-buffer → gaxios/node_modules/data-uri-to-buffer}/dist/index.d.ts +0 -0
  55. /package/node_modules/{data-uri-to-buffer → gaxios/node_modules/data-uri-to-buffer}/dist/index.js +0 -0
  56. /package/node_modules/{data-uri-to-buffer → gaxios/node_modules/data-uri-to-buffer}/dist/index.js.map +0 -0
  57. /package/node_modules/{data-uri-to-buffer → gaxios/node_modules/data-uri-to-buffer}/package.json +0 -0
  58. /package/node_modules/{data-uri-to-buffer → gaxios/node_modules/data-uri-to-buffer}/src/index.ts +0 -0
  59. /package/node_modules/{debug → gaxios/node_modules/debug}/LICENSE +0 -0
  60. /package/node_modules/{debug → gaxios/node_modules/debug}/README.md +0 -0
  61. /package/node_modules/{debug → gaxios/node_modules/debug}/package.json +0 -0
  62. /package/node_modules/{debug → gaxios/node_modules/debug}/src/browser.js +0 -0
  63. /package/node_modules/{debug → gaxios/node_modules/debug}/src/common.js +0 -0
  64. /package/node_modules/{debug → gaxios/node_modules/debug}/src/index.js +0 -0
  65. /package/node_modules/{debug → gaxios/node_modules/debug}/src/node.js +0 -0
  66. /package/node_modules/{extend → gaxios/node_modules/extend}/.editorconfig +0 -0
  67. /package/node_modules/{extend → gaxios/node_modules/extend}/.eslintrc +0 -0
  68. /package/node_modules/{extend → gaxios/node_modules/extend}/.jscs.json +0 -0
  69. /package/node_modules/{extend → gaxios/node_modules/extend}/.travis.yml +0 -0
  70. /package/node_modules/{extend → gaxios/node_modules/extend}/CHANGELOG.md +0 -0
  71. /package/node_modules/{extend → gaxios/node_modules/extend}/LICENSE +0 -0
  72. /package/node_modules/{extend → gaxios/node_modules/extend}/README.md +0 -0
  73. /package/node_modules/{extend → gaxios/node_modules/extend}/component.json +0 -0
  74. /package/node_modules/{extend → gaxios/node_modules/extend}/index.js +0 -0
  75. /package/node_modules/{extend → gaxios/node_modules/extend}/package.json +0 -0
  76. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/LICENSE +0 -0
  77. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/README.md +0 -0
  78. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/file.d.ts +0 -0
  79. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/file.js +0 -0
  80. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/from.d.ts +0 -0
  81. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/from.js +0 -0
  82. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/index.d.ts +0 -0
  83. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/index.js +0 -0
  84. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/package.json +0 -0
  85. /package/node_modules/{fetch-blob → gaxios/node_modules/fetch-blob}/streams.cjs +0 -0
  86. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/FormData.js +0 -0
  87. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/LICENSE +0 -0
  88. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/README.md +0 -0
  89. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/esm.min.d.ts +0 -0
  90. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/esm.min.js +0 -0
  91. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/formdata-to-blob.js +0 -0
  92. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/formdata.min.js +0 -0
  93. /package/node_modules/{formdata-polyfill → gaxios/node_modules/formdata-polyfill}/package.json +0 -0
  94. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/LICENSE +0 -0
  95. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/README.md +0 -0
  96. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/index.d.ts +0 -0
  97. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/index.d.ts.map +0 -0
  98. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/index.js +0 -0
  99. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/index.js.map +0 -0
  100. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/parse-proxy-response.d.ts +0 -0
  101. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/parse-proxy-response.d.ts.map +0 -0
  102. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/parse-proxy-response.js +0 -0
  103. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/dist/parse-proxy-response.js.map +0 -0
  104. /package/node_modules/{https-proxy-agent → gaxios/node_modules/https-proxy-agent}/package.json +0 -0
  105. /package/node_modules/{ms → gaxios/node_modules/ms}/index.js +0 -0
  106. /package/node_modules/{ms → gaxios/node_modules/ms}/license.md +0 -0
  107. /package/node_modules/{ms → gaxios/node_modules/ms}/package.json +0 -0
  108. /package/node_modules/{ms → gaxios/node_modules/ms}/readme.md +0 -0
  109. /package/node_modules/{node-domexception → gaxios/node_modules/node-domexception}/LICENSE +0 -0
  110. /package/node_modules/{node-domexception → gaxios/node_modules/node-domexception}/index.js +0 -0
  111. /package/node_modules/{node-domexception → gaxios/node_modules/node-domexception}/package.json +0 -0
  112. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/@types/index.d.ts +0 -0
  113. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/LICENSE.md +0 -0
  114. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/README.md +0 -0
  115. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/package.json +0 -0
  116. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/body.js +0 -0
  117. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/errors/abort-error.js +0 -0
  118. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/errors/base.js +0 -0
  119. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/errors/fetch-error.js +0 -0
  120. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/headers.js +0 -0
  121. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/index.js +0 -0
  122. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/request.js +0 -0
  123. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/response.js +0 -0
  124. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/utils/get-search.js +0 -0
  125. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/utils/is-redirect.js +0 -0
  126. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/utils/is.js +0 -0
  127. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/utils/multipart-parser.js +0 -0
  128. /package/node_modules/{node-fetch → gaxios/node_modules/node-fetch}/src/utils/referrer.js +0 -0
  129. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/LICENSE +0 -0
  130. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/README.md +0 -0
  131. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es2018.js +0 -0
  132. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es2018.js.map +0 -0
  133. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es2018.min.js +0 -0
  134. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es2018.min.js.map +0 -0
  135. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es2018.mjs +0 -0
  136. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es2018.mjs.map +0 -0
  137. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es6.js +0 -0
  138. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es6.js.map +0 -0
  139. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es6.min.js +0 -0
  140. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es6.min.js.map +0 -0
  141. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es6.mjs +0 -0
  142. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.es6.mjs.map +0 -0
  143. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.js +0 -0
  144. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.js.map +0 -0
  145. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.min.js +0 -0
  146. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.min.js.map +0 -0
  147. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.mjs +0 -0
  148. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/polyfill.mjs.map +0 -0
  149. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es2018.js +0 -0
  150. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es2018.js.map +0 -0
  151. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es2018.mjs +0 -0
  152. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es2018.mjs.map +0 -0
  153. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es6.js +0 -0
  154. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es6.js.map +0 -0
  155. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es6.mjs +0 -0
  156. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.es6.mjs.map +0 -0
  157. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.js +0 -0
  158. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.js.map +0 -0
  159. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.mjs +0 -0
  160. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/ponyfill.mjs.map +0 -0
  161. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/types/polyfill.d.ts +0 -0
  162. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/types/ponyfill.d.ts +0 -0
  163. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/types/ts3.6/polyfill.d.ts +0 -0
  164. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/types/ts3.6/ponyfill.d.ts +0 -0
  165. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/dist/types/tsdoc-metadata.json +0 -0
  166. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/es2018/package.json +0 -0
  167. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/es6/package.json +0 -0
  168. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/package.json +0 -0
  169. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/ponyfill/es2018/package.json +0 -0
  170. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/ponyfill/es6/package.json +0 -0
  171. /package/node_modules/{web-streams-polyfill → gaxios/node_modules/web-streams-polyfill}/ponyfill/package.json +0 -0
  172. /package/node_modules/{base64-js → google-auth-library/node_modules/base64-js}/LICENSE +0 -0
  173. /package/node_modules/{base64-js → google-auth-library/node_modules/base64-js}/README.md +0 -0
  174. /package/node_modules/{base64-js → google-auth-library/node_modules/base64-js}/base64js.min.js +0 -0
  175. /package/node_modules/{base64-js → google-auth-library/node_modules/base64-js}/index.d.ts +0 -0
  176. /package/node_modules/{base64-js → google-auth-library/node_modules/base64-js}/index.js +0 -0
  177. /package/node_modules/{base64-js → google-auth-library/node_modules/base64-js}/package.json +0 -0
  178. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/CHANGELOG.md +0 -0
  179. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/LICENCE.md +0 -0
  180. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/README.md +0 -0
  181. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/bignumber.d.mts +0 -0
  182. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/bignumber.d.ts +0 -0
  183. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/bignumber.js +0 -0
  184. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/bignumber.mjs +0 -0
  185. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/doc/API.html +0 -0
  186. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/package.json +0 -0
  187. /package/node_modules/{bignumber.js → google-auth-library/node_modules/bignumber.js}/types.d.ts +0 -0
  188. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/.npmignore +0 -0
  189. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/.travis.yml +0 -0
  190. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/LICENSE.txt +0 -0
  191. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/README.md +0 -0
  192. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/index.js +0 -0
  193. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/package.json +0 -0
  194. /package/node_modules/{buffer-equal-constant-time → google-auth-library/node_modules/buffer-equal-constant-time}/test.js +0 -0
  195. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/CODEOWNERS +0 -0
  196. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/LICENSE +0 -0
  197. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/README.md +0 -0
  198. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/package.json +0 -0
  199. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/src/ecdsa-sig-formatter.d.ts +0 -0
  200. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/src/ecdsa-sig-formatter.js +0 -0
  201. /package/node_modules/{ecdsa-sig-formatter → google-auth-library/node_modules/ecdsa-sig-formatter}/src/param-bytes-for-alg.js +0 -0
  202. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/LICENSE +0 -0
  203. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/README.md +0 -0
  204. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/build/src/gcp-residency.d.ts +0 -0
  205. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/build/src/gcp-residency.js +0 -0
  206. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/build/src/gcp-residency.js.map +0 -0
  207. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/build/src/index.d.ts +0 -0
  208. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/build/src/index.js +0 -0
  209. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/build/src/index.js.map +0 -0
  210. /package/node_modules/{gcp-metadata → google-auth-library/node_modules/gcp-metadata}/package.json +0 -0
  211. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/LICENSE +0 -0
  212. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/README.md +0 -0
  213. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/colours.d.ts +0 -0
  214. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/colours.js +0 -0
  215. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/colours.js.map +0 -0
  216. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/index.d.ts +0 -0
  217. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/index.js +0 -0
  218. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/index.js.map +0 -0
  219. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/logging-utils.d.ts +0 -0
  220. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/logging-utils.js +0 -0
  221. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/logging-utils.js.map +0 -0
  222. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/temporal.d.ts +0 -0
  223. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/temporal.js +0 -0
  224. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/build/src/temporal.js.map +0 -0
  225. /package/node_modules/{google-logging-utils → google-auth-library/node_modules/google-logging-utils}/package.json +0 -0
  226. /package/node_modules/{json-bigint → google-auth-library/node_modules/json-bigint}/LICENSE +0 -0
  227. /package/node_modules/{json-bigint → google-auth-library/node_modules/json-bigint}/README.md +0 -0
  228. /package/node_modules/{json-bigint → google-auth-library/node_modules/json-bigint}/index.js +0 -0
  229. /package/node_modules/{json-bigint → google-auth-library/node_modules/json-bigint}/lib/parse.js +0 -0
  230. /package/node_modules/{json-bigint → google-auth-library/node_modules/json-bigint}/lib/stringify.js +0 -0
  231. /package/node_modules/{json-bigint → google-auth-library/node_modules/json-bigint}/package.json +0 -0
  232. /package/node_modules/{jwa → google-auth-library/node_modules/jwa}/LICENSE +0 -0
  233. /package/node_modules/{jwa → google-auth-library/node_modules/jwa}/README.md +0 -0
  234. /package/node_modules/{jwa → google-auth-library/node_modules/jwa}/index.js +0 -0
  235. /package/node_modules/{jwa → google-auth-library/node_modules/jwa}/opslevel.yml +0 -0
  236. /package/node_modules/{jwa → google-auth-library/node_modules/jwa}/package.json +0 -0
  237. /package/node_modules/{jws → google-auth-library/node_modules/jws}/CHANGELOG.md +0 -0
  238. /package/node_modules/{jws → google-auth-library/node_modules/jws}/LICENSE +0 -0
  239. /package/node_modules/{jws → google-auth-library/node_modules/jws}/index.js +0 -0
  240. /package/node_modules/{jws → google-auth-library/node_modules/jws}/lib/data-stream.js +0 -0
  241. /package/node_modules/{jws → google-auth-library/node_modules/jws}/lib/sign-stream.js +0 -0
  242. /package/node_modules/{jws → google-auth-library/node_modules/jws}/lib/tostring.js +0 -0
  243. /package/node_modules/{jws → google-auth-library/node_modules/jws}/lib/verify-stream.js +0 -0
  244. /package/node_modules/{jws → google-auth-library/node_modules/jws}/opslevel.yml +0 -0
  245. /package/node_modules/{jws → google-auth-library/node_modules/jws}/package.json +0 -0
  246. /package/node_modules/{jws → google-auth-library/node_modules/jws}/readme.md +0 -0
  247. /package/node_modules/{safe-buffer → google-auth-library/node_modules/safe-buffer}/LICENSE +0 -0
  248. /package/node_modules/{safe-buffer → google-auth-library/node_modules/safe-buffer}/README.md +0 -0
  249. /package/node_modules/{safe-buffer → google-auth-library/node_modules/safe-buffer}/index.d.ts +0 -0
  250. /package/node_modules/{safe-buffer → google-auth-library/node_modules/safe-buffer}/index.js +0 -0
  251. /package/node_modules/{safe-buffer → google-auth-library/node_modules/safe-buffer}/package.json +0 -0
@@ -1,75 +1,15 @@
1
- import { A as releaseGoogleChatApprovalCardBinding, C as claimGoogleChatApprovalCardBinding, D as readGoogleChatApprovalActionToken, E as getGoogleChatApprovalCardBinding, _ as probeGoogleChat, b as verifyGoogleChatRequest, c as buildGoogleChatGroupPolicyScope, g as downloadGoogleChatMedia, h as deleteGoogleChatMessage, l as isGoogleChatGroupSpace, v as sendGoogleChatMessage, w as completeGoogleChatApprovalCardBinding, y as updateGoogleChatMessage } from "./channel.adapters-DLatFGZz.js";
2
- import { C as resolveWebhookPath, E as warnMissingProviderGroupPolicyFallbackOnce, O as getGoogleChatRuntime, b as resolveAllowlistProviderRuntimeGroupPolicy, c as createChannelPairingController, f as isDangerousNameMatchingEnabled, n as GROUP_POLICY_BLOCKED_LABEL, x as resolveDefaultGroupPolicy } from "./runtime-api-Dh0CNVS4.js";
3
- import { n as googleChatApprovalAuth } from "./approval-auth-G-OFufNc.js";
1
+ import { A as readGoogleChatApprovalActionToken, C as verifyGoogleChatRequest, D as completeGoogleChatApprovalCardBinding, E as claimGoogleChatApprovalCardBinding, N as releaseGoogleChatApprovalCardBinding, S as uploadGoogleChatAttachment, _ as downloadGoogleChatMedia, b as sendGoogleChatMessage, c as isGoogleChatGroupSpace, h as deleteGoogleChatMessage, k as getGoogleChatApprovalCardBinding, x as updateGoogleChatMessage, y as probeGoogleChat } from "./channel.adapters-T6wPzrpo.mjs";
2
+ import { E as resolveDefaultGroupPolicy, M as warnMissingProviderGroupPolicyFallbackOnce, O as resolveInboundRouteEnvelopeBuilderWithRuntime, P as getGoogleChatRuntime, k as resolveWebhookPath, m as isDangerousNameMatchingEnabled, n as GROUP_POLICY_BLOCKED_LABEL, u as createChannelPairingController, w as resolveAllowlistProviderRuntimeGroupPolicy } from "./runtime-api-BbVoWRxq.mjs";
3
+ import { n as googleChatApprovalAuth } from "./approval-auth-CQP5ZS_f.mjs";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
6
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
7
- import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
8
- import { createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
9
- import { recordChannelBotPairLoopAndCheckSuppression, resolveChannelInboundRouteEnvelope, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
6
+ import { recordChannelBotPairLoopAndCheckSuppression } from "openclaw/plugin-sdk/channel-inbound";
10
7
  import { WEBHOOK_RATE_LIMIT_DEFAULTS, createFixedWindowRateLimiter, normalizeWebhookPath, resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
11
8
  import { registerWebhookTargetWithPluginRoute, resolveWebhookTargetWithAuthOrReject, withResolvedWebhookRequestPipeline } from "openclaw/plugin-sdk/webhook-targets";
12
- import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject, runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
9
+ import { createWebhookInFlightLimiter, readJsonWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
13
10
  import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
14
11
  import { channelIngressRoutes, createChannelIngressResolver, defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
15
- import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
16
- //#region extensions/googlechat/src/approval-terminal-card.ts
17
- const GOOGLECHAT_APPROVAL_CARD_ID = "openclaw-approval";
18
- const MAX_TEXT_PARAGRAPH_CHARS = 1800;
19
- function escapeGoogleChatText(text) {
20
- return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
21
- }
22
- function truncateText(text) {
23
- return text.length <= MAX_TEXT_PARAGRAPH_CHARS ? text : `${truncateUtf16Safe(text, MAX_TEXT_PARAGRAPH_CHARS - 3)}...`;
24
- }
25
- function formatApprovalId(value) {
26
- return JSON.stringify(value).slice(1, -1);
27
- }
28
- function formatCanonicalOutcome(approval) {
29
- switch (approval.status) {
30
- case "allowed": return approval.decision === "allow-always" ? "Allowed always" : "Allowed once";
31
- case "denied": return "Denied";
32
- case "expired": return "Expired";
33
- case "cancelled": return "Cancelled";
34
- }
35
- return "Unavailable";
36
- }
37
- function buildSubjectSection(presentation) {
38
- if (presentation.kind === "exec") return {
39
- header: "Command",
40
- widgets: [{ textParagraph: { text: escapeGoogleChatText(truncateText(presentation.commandPreview ?? presentation.commandText)) } }]
41
- };
42
- const description = presentation.description.trim();
43
- return {
44
- header: "Request",
45
- widgets: [{ textParagraph: { text: truncateText(`<b>${escapeGoogleChatText(presentation.title)}</b>${description ? `<br>${escapeGoogleChatText(description)}` : ""}`) } }]
46
- };
47
- }
48
- /** Render the canonical first-answer result without retaining any actionable buttons. */
49
- function buildGoogleChatCanonicalApprovalTerminalCards(result) {
50
- const { approval } = result;
51
- const kindLabel = approval.presentation.kind === "plugin" ? "Plugin" : "Exec";
52
- const detailLines = [
53
- `<b>Approval ID:</b> ${escapeGoogleChatText(formatApprovalId(approval.id))}`,
54
- `<b>Status:</b> ${escapeGoogleChatText(approval.status)}`,
55
- ...approval.status === "allowed" || approval.status === "denied" ? [`<b>Decision:</b> ${escapeGoogleChatText(approval.decision)}`] : [],
56
- `<b>Reason:</b> ${escapeGoogleChatText(approval.reason)}`
57
- ];
58
- return [{
59
- cardId: GOOGLECHAT_APPROVAL_CARD_ID,
60
- card: {
61
- header: {
62
- title: `${kindLabel} Approval: ${formatCanonicalOutcome(approval)}`,
63
- subtitle: result.applied ? "Resolved by this action" : "Already resolved"
64
- },
65
- sections: [buildSubjectSection(approval.presentation), {
66
- header: "Details",
67
- widgets: [{ textParagraph: { text: truncateText(detailLines.join("<br>")) } }]
68
- }]
69
- }
70
- }];
71
- }
72
- //#endregion
12
+ import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
73
13
  //#region extensions/googlechat/src/approval-card-click.ts
74
14
  function logIgnored(target, message) {
75
15
  target.runtime.log?.(`[${target.account.accountId}] googlechat approval ignored: ${message}`);
@@ -120,29 +60,21 @@ async function maybeHandleGoogleChatApprovalCardClick(params) {
120
60
  return true;
121
61
  }
122
62
  const consumed = claim.binding;
123
- let result;
124
63
  try {
125
- result = await resolveApprovalOverGateway({
64
+ await resolveApprovalOverGateway({
126
65
  cfg: params.target.config,
127
66
  approvalId: consumed.approvalId,
128
- approvalKind: consumed.approvalKind,
129
67
  decision: consumed.decision,
130
68
  senderId: actor,
69
+ allowPluginFallback: consumed.approvalKind === "exec",
131
70
  clientDisplayName: `Google Chat approval (${actor?.trim() || "unknown"})`
132
71
  });
133
- await updateGoogleChatMessage({
134
- account: params.target.account,
135
- messageName: consumed.messageName,
136
- cardsV2: buildGoogleChatCanonicalApprovalTerminalCards(result)
137
- });
138
72
  } catch (error) {
139
73
  releaseGoogleChatApprovalCardBinding(token);
140
74
  throw error;
141
75
  }
142
76
  completeGoogleChatApprovalCardBinding(token);
143
- const outcome = result.applied ? "resolved" : "already resolved";
144
- const decision = "decision" in result.approval ? result.approval.decision : "none";
145
- params.target.runtime.log?.(`[${params.target.account.accountId}] googlechat approval ${outcome} id=${consumed.approvalId} status=${result.approval.status} decision=${decision} sender=${actor || "unknown"}`);
77
+ params.target.runtime.log?.(`[${params.target.account.accountId}] googlechat approval resolved id=${consumed.approvalId} decision=${consumed.decision} sender=${actor || "unknown"}`);
146
78
  return true;
147
79
  }
148
80
  //#endregion
@@ -180,7 +112,7 @@ const googleChatIngressIdentity = defineStableChannelIngressIdentity({
180
112
  isWildcardEntry: (entry) => normalizeEntryValue(entry) === "*",
181
113
  resolveEntryId: ({ entryIndex, fieldKey }) => fieldKey === "stableId" ? `entry-${entryIndex + 1}:user` : `entry-${entryIndex + 1}:${fieldKey}`
182
114
  });
183
- function resolveGoogleChatGroupConfig(params) {
115
+ function resolveGroupConfig(params) {
184
116
  const { groupId, groupName, groups } = params;
185
117
  const entries = groups ?? {};
186
118
  const keys = Object.keys(entries);
@@ -189,21 +121,14 @@ function resolveGoogleChatGroupConfig(params) {
189
121
  allowlistConfigured: false,
190
122
  deprecatedNameMatch: false
191
123
  };
192
- const { "*": fallback, ...scopes } = entries;
193
- const scope = buildGoogleChatGroupPolicyScope({
194
- tree: {
195
- defaults: fallback,
196
- scopes
197
- },
198
- groupId
199
- });
200
- const entry = scope.matchKey ? entries[scope.matchKey] : void 0;
124
+ const entry = entries[groupId];
201
125
  const normalizedGroupName = normalizeLowercaseStringOrEmpty(groupName ?? "");
202
126
  const deprecatedNameMatch = !entry && Boolean(groupName && keys.some((key) => {
203
127
  const trimmed = key.trim();
204
128
  if (!trimmed || trimmed === "*" || /^spaces\//i.test(trimmed)) return false;
205
129
  return trimmed === groupName || normalizeLowercaseStringOrEmpty(trimmed) === normalizedGroupName;
206
130
  }));
131
+ const fallback = entries["*"];
207
132
  return {
208
133
  entry: deprecatedNameMatch ? void 0 : entry ?? fallback,
209
134
  allowlistConfigured: true,
@@ -266,7 +191,7 @@ async function applyGoogleChatInboundAccessPolicy(params) {
266
191
  log: logVerbose
267
192
  });
268
193
  warnMutableGroupKeysConfigured(logVerbose, account.config.groups ?? void 0);
269
- const groupConfigResolved = resolveGoogleChatGroupConfig({
194
+ const groupConfigResolved = resolveGroupConfig({
270
195
  groupId: spaceId,
271
196
  groupName: space.displayName ?? null,
272
197
  groups: account.config.groups ?? void 0
@@ -274,8 +199,8 @@ async function applyGoogleChatInboundAccessPolicy(params) {
274
199
  const groupEntry = groupConfigResolved.entry;
275
200
  const groupUsers = groupEntry?.users ?? account.config.groupAllowFrom ?? [];
276
201
  let effectiveWasMentioned;
277
- const dmPolicy = account.config.dmPolicy ?? "pairing";
278
- const rawConfigAllowFrom = normalizeStringEntries(account.config.allowFrom);
202
+ const dmPolicy = account.config.dm?.policy ?? "pairing";
203
+ const rawConfigAllowFrom = normalizeStringEntries(account.config.dm?.allowFrom);
279
204
  const shouldComputeAuth = core.channel.commands.shouldComputeCommandAuthorized(rawBody, config);
280
205
  const groupActivation = (() => {
281
206
  if (!isGroup) return;
@@ -432,29 +357,138 @@ async function applyGoogleChatInboundAccessPolicy(params) {
432
357
  //#endregion
433
358
  //#region extensions/googlechat/src/monitor-durable.ts
434
359
  function resolveGoogleChatDurableReplyOptions(params) {
435
- if (params.infoKind !== "final" || params.hasTypingMessage) return false;
360
+ if (params.infoKind !== "final" || params.typingMessageName) return false;
436
361
  const threadId = params.payload.replyToId?.trim() || void 0;
437
- if (!threadId) return {
438
- to: params.spaceId,
439
- replyToId: null
440
- };
441
362
  return {
442
363
  to: params.spaceId,
443
- replyToId: threadId,
444
- threadId
364
+ ...threadId ? {
365
+ replyToId: threadId,
366
+ threadId
367
+ } : {}
445
368
  };
446
369
  }
447
370
  //#endregion
448
- //#region extensions/googlechat/src/monitor-event.ts
449
- var GoogleChatEventPayloadError = class extends Error {
450
- constructor(message = "invalid payload") {
451
- super(message);
452
- this.name = "GoogleChatEventPayloadError";
371
+ //#region extensions/googlechat/src/monitor-reply-delivery.ts
372
+ async function deliverGoogleChatReply(params) {
373
+ const { payload, account, spaceId, runtime, core, config, statusSink } = params;
374
+ let typingMessageName = params.typingMessageName;
375
+ const reply = resolveSendableOutboundReplyParts(payload);
376
+ const mediaCount = reply.mediaCount;
377
+ const hasMedia = reply.hasMedia;
378
+ const text = reply.text;
379
+ let firstTextChunk = true;
380
+ let suppressCaption = false;
381
+ if (hasMedia && typingMessageName) try {
382
+ await deleteGoogleChatMessage({
383
+ account,
384
+ messageName: typingMessageName
385
+ });
386
+ typingMessageName = void 0;
387
+ } catch (err) {
388
+ runtime.error?.(`Google Chat typing cleanup failed: ${String(err)}`);
389
+ if (typingMessageName) {
390
+ const fallbackText = reply.hasText ? text : mediaCount > 1 ? "Sent attachments." : "Sent attachment.";
391
+ try {
392
+ await updateGoogleChatMessage({
393
+ account,
394
+ messageName: typingMessageName,
395
+ text: fallbackText
396
+ });
397
+ suppressCaption = Boolean(text.trim());
398
+ } catch (updateErr) {
399
+ runtime.error?.(`Google Chat typing update failed: ${String(updateErr)}`);
400
+ typingMessageName = void 0;
401
+ }
402
+ }
453
403
  }
454
- };
455
- function isRecord$2(value) {
456
- return typeof value === "object" && value !== null && !Array.isArray(value);
404
+ const chunkLimit = account.config.textChunkLimit ?? 4e3;
405
+ const chunkMode = core.channel.text.resolveChunkMode(config, "googlechat", account.accountId);
406
+ const sendTextMessage = async (chunk) => {
407
+ await sendGoogleChatMessage({
408
+ account,
409
+ space: spaceId,
410
+ text: chunk,
411
+ thread: payload.replyToId
412
+ });
413
+ };
414
+ await deliverTextOrMediaReply({
415
+ payload,
416
+ text: suppressCaption ? "" : reply.text,
417
+ chunkText: (value) => core.channel.text.chunkMarkdownTextWithMode(value, chunkLimit, chunkMode),
418
+ sendText: async (chunk) => {
419
+ try {
420
+ if (firstTextChunk && typingMessageName) await updateGoogleChatMessage({
421
+ account,
422
+ messageName: typingMessageName,
423
+ text: chunk
424
+ });
425
+ else await sendTextMessage(chunk);
426
+ firstTextChunk = false;
427
+ statusSink?.({ lastOutboundAt: Date.now() });
428
+ } catch (err) {
429
+ runtime.error?.(`Google Chat message send failed: ${String(err)}`);
430
+ if (firstTextChunk && typingMessageName) {
431
+ typingMessageName = void 0;
432
+ try {
433
+ await sendTextMessage(chunk);
434
+ statusSink?.({ lastOutboundAt: Date.now() });
435
+ } catch (fallbackErr) {
436
+ runtime.error?.(`Google Chat message fallback send failed: ${String(fallbackErr)}`);
437
+ } finally {
438
+ firstTextChunk = false;
439
+ }
440
+ }
441
+ }
442
+ },
443
+ sendMedia: async ({ mediaUrl, caption }) => {
444
+ try {
445
+ const loaded = await core.channel.media.readRemoteMediaBuffer({
446
+ url: mediaUrl,
447
+ maxBytes: (account.config.mediaMaxMb ?? 20) * 1024 * 1024
448
+ });
449
+ const upload = await uploadAttachmentForReply({
450
+ account,
451
+ spaceId,
452
+ buffer: loaded.buffer,
453
+ contentType: loaded.contentType,
454
+ filename: loaded.fileName ?? "attachment"
455
+ });
456
+ if (!upload.attachmentUploadToken) throw new Error("missing attachment upload token");
457
+ await sendGoogleChatMessage({
458
+ account,
459
+ space: spaceId,
460
+ text: caption,
461
+ thread: payload.replyToId,
462
+ attachments: [{
463
+ attachmentUploadToken: upload.attachmentUploadToken,
464
+ contentName: loaded.fileName
465
+ }]
466
+ });
467
+ statusSink?.({ lastOutboundAt: Date.now() });
468
+ } catch (err) {
469
+ runtime.error?.(`Google Chat attachment send failed: ${String(err)}`);
470
+ }
471
+ }
472
+ });
473
+ }
474
+ async function uploadAttachmentForReply(params) {
475
+ const { account, spaceId, buffer, contentType, filename } = params;
476
+ return await uploadGoogleChatAttachment({
477
+ account,
478
+ space: spaceId,
479
+ filename,
480
+ buffer,
481
+ contentType
482
+ });
483
+ }
484
+ //#endregion
485
+ //#region extensions/googlechat/src/monitor-webhook.ts
486
+ function extractBearerToken(header) {
487
+ const authHeader = Array.isArray(header) ? typeof header[0] === "string" ? header[0] : "" : typeof header === "string" ? header : "";
488
+ return normalizeLowercaseStringOrEmpty(authHeader).startsWith("bearer ") ? authHeader.slice(7).trim() : "";
457
489
  }
490
+ const ADD_ON_PREAUTH_MAX_BYTES = 16384;
491
+ const ADD_ON_PREAUTH_TIMEOUT_MS = 3e3;
458
492
  function recordParamsToActionParameters(params) {
459
493
  if (!params) return;
460
494
  const entries = Object.entries(params).filter((entry) => typeof entry[1] === "string").map(([key, value]) => ({
@@ -463,25 +497,29 @@ function recordParamsToActionParameters(params) {
463
497
  }));
464
498
  return entries.length > 0 ? entries : void 0;
465
499
  }
466
- /** Normalize only at authenticated dispatch; durable admission stores the untouched envelope. */
467
- function parseGoogleChatInboundPayload(raw) {
468
- if (!isRecord$2(raw)) throw new GoogleChatEventPayloadError();
500
+ function parseGoogleChatInboundPayload(raw, res) {
501
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
502
+ res.statusCode = 400;
503
+ res.end("invalid payload");
504
+ return { ok: false };
505
+ }
469
506
  let eventPayload = raw;
470
507
  let addOnBearerToken = "";
471
508
  const rawObj = raw;
472
509
  if (rawObj.commonEventObject?.hostApp === "CHAT") addOnBearerToken = typeof rawObj.authorizationEventObject?.systemIdToken === "string" ? rawObj.authorizationEventObject.systemIdToken.trim() : "";
473
- const chat = rawObj.chat;
474
- const messagePayload = chat?.messagePayload;
475
- if (rawObj.commonEventObject?.hostApp === "CHAT" && chat && messagePayload) eventPayload = {
476
- type: "MESSAGE",
477
- space: messagePayload.space,
478
- message: messagePayload.message,
479
- user: chat.user,
480
- eventTime: chat.eventTime
481
- };
482
- else if (rawObj.commonEventObject?.hostApp === "CHAT") {
483
- const chatPayload = rawObj.chat;
484
- const buttonClickedPayload = chatPayload?.buttonClickedPayload;
510
+ if (rawObj.commonEventObject?.hostApp === "CHAT" && rawObj.chat?.messagePayload) {
511
+ const chat = rawObj.chat;
512
+ const messagePayload = chat.messagePayload;
513
+ eventPayload = {
514
+ type: "MESSAGE",
515
+ space: messagePayload?.space,
516
+ message: messagePayload?.message,
517
+ user: chat.user,
518
+ eventTime: chat.eventTime
519
+ };
520
+ } else if (rawObj.commonEventObject?.hostApp === "CHAT") {
521
+ const chat = rawObj.chat;
522
+ const buttonClickedPayload = chat?.buttonClickedPayload;
485
523
  if (buttonClickedPayload) {
486
524
  const invokedFunction = rawObj.commonEventObject.invokedFunction;
487
525
  const actionParameters = recordParamsToActionParameters(rawObj.commonEventObject.parameters);
@@ -489,8 +527,8 @@ function parseGoogleChatInboundPayload(raw) {
489
527
  type: "CARD_CLICKED",
490
528
  space: buttonClickedPayload.space,
491
529
  message: buttonClickedPayload.message,
492
- user: buttonClickedPayload.user ?? chatPayload?.user,
493
- eventTime: chatPayload?.eventTime,
530
+ user: buttonClickedPayload.user ?? chat.user,
531
+ eventTime: chat.eventTime,
494
532
  action: buttonClickedPayload.action ?? {
495
533
  ...typeof invokedFunction === "string" ? { actionMethodName: invokedFunction } : {},
496
534
  ...actionParameters ? { parameters: actionParameters } : {}
@@ -503,249 +541,33 @@ function parseGoogleChatInboundPayload(raw) {
503
541
  }
504
542
  }
505
543
  const event = eventPayload;
506
- const eventType = event.type ?? event.eventType;
507
- if (typeof eventType !== "string" || !isRecord$2(event.space)) throw new GoogleChatEventPayloadError();
508
- if (eventType === "MESSAGE") {
509
- if (!isRecord$2(event.message) || !event.space?.name?.trim() || !event.message?.name?.trim()) throw new GoogleChatEventPayloadError();
510
- } else if (eventType === "CARD_CLICKED" && !isRecord$2(event.user)) throw new GoogleChatEventPayloadError();
511
- return {
512
- event,
513
- addOnBearerToken
514
- };
515
- }
516
- //#endregion
517
- //#region extensions/googlechat/src/monitor-ingress.ts
518
- const GOOGLECHAT_INGRESS_PAYLOAD_VERSION = 1;
519
- const GOOGLECHAT_INGRESS_POLL_INTERVAL_MS = 500;
520
- const GOOGLECHAT_INGRESS_PRUNE_INTERVAL_MS = 3600 * 1e3;
521
- const GOOGLECHAT_INGRESS_MAX_CONCURRENT_DELIVERIES = 8;
522
- const GOOGLECHAT_INGRESS_COMPLETED_TTL_MS = 720 * 60 * 60 * 1e3;
523
- const GOOGLECHAT_INGRESS_COMPLETED_MAX_ENTRIES = 2e4;
524
- const GOOGLECHAT_INGRESS_FAILED_TTL_MS = 720 * 60 * 60 * 1e3;
525
- const GOOGLECHAT_INGRESS_FAILED_MAX_ENTRIES = 2e4;
526
- var GoogleChatIngressPermanentError = class extends Error {
527
- constructor(reason, message, options) {
528
- super(message, options);
529
- this.reason = reason;
530
- this.name = "GoogleChatIngressPermanentError";
531
- }
532
- };
533
- function isRecord$1(value) {
534
- return typeof value === "object" && value !== null && !Array.isArray(value);
535
- }
536
- function requiredString(value, field) {
537
- if (typeof value === "string" && value.trim()) return value.trim();
538
- throw new GoogleChatIngressPermanentError("invalid-event", `Google Chat MESSAGE event is missing ${field}.`);
539
- }
540
- function inspectGoogleChatIngressEvent(raw) {
541
- if (!isRecord$1(raw)) throw new GoogleChatIngressPermanentError("invalid-event", "Google Chat webhook envelope must be an object.");
542
- const commonEventObject = isRecord$1(raw.commonEventObject) ? raw.commonEventObject : null;
543
- const chat = isRecord$1(raw.chat) ? raw.chat : null;
544
- const isAddOn = commonEventObject?.hostApp === "CHAT";
545
- let eventType = raw.type ?? raw.eventType;
546
- let space = isRecord$1(raw.space) ? raw.space : null;
547
- let message = isRecord$1(raw.message) ? raw.message : null;
548
- if (isAddOn) {
549
- const messagePayload = isRecord$1(chat?.messagePayload) ? chat.messagePayload : null;
550
- if (!messagePayload) return null;
551
- eventType = "MESSAGE";
552
- space = isRecord$1(messagePayload.space) ? messagePayload.space : null;
553
- message = isRecord$1(messagePayload.message) ? messagePayload.message : null;
554
- }
555
- if (eventType !== "MESSAGE") return null;
556
- const spaceName = requiredString(space?.name, "space.name");
557
- return {
558
- eventId: requiredString(message?.name, "message.name"),
559
- laneKey: `space:${spaceName}`
560
- };
561
- }
562
- function deserializeGoogleChatIngressEvent(rawEvent, claimedId) {
563
- let raw;
564
- try {
565
- raw = JSON.parse(rawEvent);
566
- } catch (error) {
567
- throw new GoogleChatIngressPermanentError("invalid-event", `Google Chat ingress row ${claimedId} contains invalid JSON.`, { cause: error });
568
- }
569
- return raw;
570
- }
571
- function normalizeClaimedGoogleChatEvent(raw, claimedId) {
572
- try {
573
- const parsed = parseGoogleChatInboundPayload(raw);
574
- if ((parsed.event.type ?? parsed.event.eventType) !== "MESSAGE") throw new GoogleChatEventPayloadError();
575
- return parsed.event;
576
- } catch (error) {
577
- throw new GoogleChatIngressPermanentError("invalid-event", `Google Chat ingress row ${claimedId} cannot be normalized.`, { cause: error });
578
- }
579
- }
580
- function resolveGoogleChatIngressNonRetryableFailure(error) {
581
- for (const candidate of collectErrorGraphCandidates(error, (current) => [current.cause])) {
582
- if (candidate instanceof GoogleChatIngressPermanentError) return {
583
- reason: candidate.reason,
584
- message: candidate.message
585
- };
586
- const message = formatErrorMessage(candidate);
587
- if (/Google Chat API 401\b/.test(message) || /^(?:Missing Google Chat access token|Google Chat (?:credentials|service account)\b|(?:Failed to load|Invalid) Google Chat service account\b)/.test(message)) return {
588
- reason: "googlechat-auth",
589
- message
590
- };
544
+ const eventType = event.type ?? eventPayload.eventType;
545
+ if (typeof eventType !== "string") {
546
+ res.statusCode = 400;
547
+ res.end("invalid payload");
548
+ return { ok: false };
591
549
  }
592
- return null;
593
- }
594
- function createGoogleChatIngressMonitor(options) {
595
- const serializeForIngress = (rawEvent) => {
596
- if (!isRecord$1(rawEvent)) throw new GoogleChatIngressPermanentError("invalid-event", "Google Chat webhook envelope must be an object.");
597
- const durableEvent = { ...rawEvent };
598
- delete durableEvent.authorizationEventObject;
599
- const serialized = JSON.stringify(durableEvent);
600
- if (typeof serialized !== "string") throw new GoogleChatIngressPermanentError("invalid-event", "Google Chat webhook envelope cannot be serialized.");
601
- return serialized;
602
- };
603
- const monitor = createChannelIngressMonitor({
604
- queue: options.queue ?? (() => getGoogleChatRuntime().state.openChannelIngressQueue({ accountId: options.accountId })),
605
- inspect: (rawEvent) => inspectGoogleChatIngressEvent(rawEvent),
606
- payload: {
607
- storage: "raw-event",
608
- version: GOOGLECHAT_INGRESS_PAYLOAD_VERSION,
609
- serialize: serializeForIngress,
610
- deserialize: (rawEvent, { claim }) => deserializeGoogleChatIngressEvent(rawEvent, claim.id),
611
- createClaimError: (kind, claim) => new GoogleChatIngressPermanentError("invalid-event", kind === "invalid-version" ? `Google Chat ingress row ${claim.id} has an invalid payload.` : `Google Chat ingress row ${claim.id} has invalid message identity.`)
612
- },
613
- deliver: (rawEvent, lifecycle, claim) => options.dispatch(normalizeClaimedGoogleChatEvent(rawEvent, claim.id), lifecycle),
614
- pollIntervalMs: options.pollIntervalMs ?? GOOGLECHAT_INGRESS_POLL_INTERVAL_MS,
615
- retention: {
616
- pruneIntervalMs: GOOGLECHAT_INGRESS_PRUNE_INTERVAL_MS,
617
- completedTtlMs: GOOGLECHAT_INGRESS_COMPLETED_TTL_MS,
618
- completedMaxEntries: GOOGLECHAT_INGRESS_COMPLETED_MAX_ENTRIES,
619
- failedTtlMs: GOOGLECHAT_INGRESS_FAILED_TTL_MS,
620
- failedMaxEntries: GOOGLECHAT_INGRESS_FAILED_MAX_ENTRIES
621
- },
622
- drain: {
623
- resolveNonRetryableFailure: resolveGoogleChatIngressNonRetryableFailure,
624
- startLimit: GOOGLECHAT_INGRESS_MAX_CONCURRENT_DELIVERIES,
625
- ...options.adoptionStallTimeoutMs === void 0 ? {} : { adoptionStallTimeoutMs: options.adoptionStallTimeoutMs },
626
- onLog: (message) => options.runtime.error?.(`googlechat: ${message}`)
627
- },
628
- ...options.abortSignal ? { abortSignal: options.abortSignal } : {},
629
- admissionMode: "while-running",
630
- createStoppedError: () => /* @__PURE__ */ new Error("Google Chat ingress is stopped."),
631
- onError: (error) => options.runtime.error?.(`googlechat ingress drain failed: ${formatErrorMessage(error)}`)
632
- });
633
- return {
634
- receive: async (rawEvent) => {
635
- if (!monitor.isRunning()) throw new Error("Google Chat ingress is stopped.");
636
- let facts;
637
- try {
638
- facts = inspectGoogleChatIngressEvent(rawEvent);
639
- } catch (error) {
640
- if (error instanceof GoogleChatIngressPermanentError) return {
641
- kind: "invalid",
642
- message: error.message
643
- };
644
- throw error;
645
- }
646
- if (!facts) return { kind: "ignored" };
647
- await monitor.admit(rawEvent, { facts });
648
- return { kind: "durable" };
649
- },
650
- start: monitor.start,
651
- stop: monitor.stop,
652
- waitForIdle: monitor.waitForIdle
653
- };
654
- }
655
- //#endregion
656
- //#region extensions/googlechat/src/monitor-reply-delivery.ts
657
- async function deliverGoogleChatReply(params) {
658
- const { payload, account, spaceId, runtime, core, config, statusSink } = params;
659
- let typingMessage = params.typingMessage;
660
- const replyThreadName = payload.replyToId?.trim() || void 0;
661
- const typingMessageThreadName = typingMessage?.thread?.trim() || void 0;
662
- const reply = resolveSendableOutboundReplyParts(payload);
663
- const text = reply.text;
664
- let firstTextChunk = true;
665
- if (typingMessage && typingMessageThreadName !== replyThreadName) {
666
- try {
667
- await deleteGoogleChatMessage({
668
- account,
669
- messageName: typingMessage.name
670
- });
671
- } catch (err) {
672
- runtime.error?.(`Google Chat typing cleanup failed: ${String(err)}`);
673
- }
674
- typingMessage = void 0;
550
+ if (!event.space || typeof event.space !== "object" || Array.isArray(event.space)) {
551
+ res.statusCode = 400;
552
+ res.end("invalid payload");
553
+ return { ok: false };
675
554
  }
676
- if (reply.hasMedia) runtime.error?.("Google Chat outbound attachments require user OAuth and are not supported by this service-account channel; sending text fallback only.");
677
- if (reply.hasMedia && !reply.hasText) {
678
- try {
679
- if (typingMessage) await deleteGoogleChatMessage({
680
- account,
681
- messageName: typingMessage.name
682
- });
683
- } catch (err) {
684
- runtime.error?.(`Google Chat typing cleanup failed: ${String(err)}`);
555
+ if (eventType === "MESSAGE") {
556
+ if (!event.message || typeof event.message !== "object" || Array.isArray(event.message)) {
557
+ res.statusCode = 400;
558
+ res.end("invalid payload");
559
+ return { ok: false };
685
560
  }
686
- throw new Error("Google Chat outbound attachments require user OAuth and no text fallback is available.");
687
- }
688
- const chunkLimit = account.config.textChunkLimit ?? 4e3;
689
- const chunkMode = core.channel.text.resolveChunkMode(config, "googlechat", account.accountId);
690
- const sendTextMessage = async (chunk) => {
691
- await sendGoogleChatMessage({
692
- account,
693
- space: spaceId,
694
- text: chunk,
695
- thread: replyThreadName
696
- });
697
- };
698
- const chunks = core.channel.text.chunkMarkdownTextWithMode(text, chunkLimit, chunkMode);
699
- for (const chunk of chunks) {
700
- if (!chunk) continue;
701
- try {
702
- if (firstTextChunk && typingMessage) await updateGoogleChatMessage({
703
- account,
704
- messageName: typingMessage.name,
705
- text: chunk
706
- });
707
- else await sendTextMessage(chunk);
708
- firstTextChunk = false;
709
- statusSink?.({ lastOutboundAt: Date.now() });
710
- } catch (err) {
711
- runtime.error?.(`Google Chat message send failed: ${String(err)}`);
712
- if (firstTextChunk && typingMessage) {
713
- typingMessage = void 0;
714
- try {
715
- await sendTextMessage(chunk);
716
- statusSink?.({ lastOutboundAt: Date.now() });
717
- } catch (fallbackErr) {
718
- runtime.error?.(`Google Chat message fallback send failed: ${String(fallbackErr)}`);
719
- } finally {
720
- firstTextChunk = false;
721
- }
722
- }
561
+ } else if (eventType === "CARD_CLICKED") {
562
+ if (!event.user || typeof event.user !== "object" || Array.isArray(event.user)) {
563
+ res.statusCode = 400;
564
+ res.end("invalid payload");
565
+ return { ok: false };
723
566
  }
724
567
  }
725
- }
726
- //#endregion
727
- //#region extensions/googlechat/src/monitor-webhook.ts
728
- function extractBearerToken(header) {
729
- const authHeader = Array.isArray(header) ? typeof header[0] === "string" ? header[0] : "" : typeof header === "string" ? header : "";
730
- return normalizeLowercaseStringOrEmpty(authHeader).startsWith("bearer ") ? authHeader.slice(7).trim() : "";
731
- }
732
- const ADD_ON_PREAUTH_MAX_BYTES = 16 * 1024;
733
- const ADD_ON_PREAUTH_TIMEOUT_MS = 3e3;
734
- function isRecord(value) {
735
- return typeof value === "object" && value !== null && !Array.isArray(value);
736
- }
737
- function parseGoogleChatInboundPayloadOrReject(raw, res) {
738
- if (!isRecord(raw)) {
739
- res.statusCode = 400;
740
- res.end("invalid payload");
741
- return null;
742
- }
743
- const commonEventObject = isRecord(raw.commonEventObject) ? raw.commonEventObject : null;
744
- const authorizationEventObject = isRecord(raw.authorizationEventObject) ? raw.authorizationEventObject : null;
745
- let addOnBearerToken = "";
746
- if (commonEventObject?.hostApp === "CHAT" && typeof authorizationEventObject?.systemIdToken === "string") addOnBearerToken = authorizationEventObject.systemIdToken.trim();
747
568
  return {
748
- raw,
569
+ ok: true,
570
+ event,
749
571
  addOnBearerToken
750
572
  };
751
573
  }
@@ -815,7 +637,7 @@ function createGoogleChatWebhookRequestHandler(params) {
815
637
  handle: async ({ targets }) => {
816
638
  const headerBearer = extractBearerToken(req.headers.authorization);
817
639
  let selectedTarget;
818
- let parsedInbound;
640
+ let parsedEvent;
819
641
  const readAndParseEvent = async (profile) => {
820
642
  const body = await readJsonWebhookBodyOrReject({
821
643
  req,
@@ -829,7 +651,8 @@ function createGoogleChatWebhookRequestHandler(params) {
829
651
  invalidJsonMessage: "invalid payload"
830
652
  });
831
653
  if (!body.ok) return null;
832
- return parseGoogleChatInboundPayloadOrReject(body.value, res);
654
+ const parsed = parseGoogleChatInboundPayload(body.value, res);
655
+ return parsed.ok ? parsed : null;
833
656
  };
834
657
  if (headerBearer) {
835
658
  selectedTarget = await resolveGoogleChatWebhookTargetWithAuthOrReject({
@@ -840,11 +663,11 @@ function createGoogleChatWebhookRequestHandler(params) {
840
663
  if (!selectedTarget) return true;
841
664
  const parsed = await readAndParseEvent("post-auth");
842
665
  if (!parsed) return true;
843
- parsedInbound = parsed;
666
+ parsedEvent = parsed.event;
844
667
  } else {
845
668
  const parsed = await readAndParseEvent("pre-auth");
846
669
  if (!parsed) return true;
847
- parsedInbound = parsed;
670
+ parsedEvent = parsed.event;
848
671
  if (!parsed.addOnBearerToken) {
849
672
  logGoogleChatWebhookAuthRejectedForTargets(targets, "missing token");
850
673
  res.statusCode = 401;
@@ -858,39 +681,16 @@ function createGoogleChatWebhookRequestHandler(params) {
858
681
  });
859
682
  if (!selectedTarget) return true;
860
683
  }
861
- if (!selectedTarget || !parsedInbound) {
684
+ if (!selectedTarget || !parsedEvent) {
862
685
  res.statusCode = 401;
863
686
  res.end("unauthorized");
864
687
  return true;
865
688
  }
866
689
  const dispatchTarget = selectedTarget;
867
690
  dispatchTarget.statusSink?.({ lastInboundAt: Date.now() });
868
- try {
869
- const admission = await dispatchTarget.ingress.receive(parsedInbound.raw);
870
- if (admission.kind === "invalid") {
871
- res.statusCode = 400;
872
- res.end("invalid payload");
873
- return true;
874
- }
875
- if (admission.kind === "ignored") {
876
- let event;
877
- try {
878
- event = parseGoogleChatInboundPayload(parsedInbound.raw).event;
879
- } catch {
880
- res.statusCode = 400;
881
- res.end("invalid payload");
882
- return true;
883
- }
884
- runDetachedWebhookWork(() => params.processEvent(event, dispatchTarget)).catch((err) => {
885
- dispatchTarget.runtime.error?.(`[${dispatchTarget.account.accountId}] Google Chat webhook failed: ${String(err)}`);
886
- });
887
- }
888
- } catch (error) {
889
- dispatchTarget.runtime.error?.(`[${dispatchTarget.account.accountId}] Google Chat durable admission failed: ${String(error)}`);
890
- res.statusCode = 503;
891
- res.end("failed to persist event");
892
- return true;
893
- }
691
+ params.processEvent(parsedEvent, dispatchTarget).catch((err) => {
692
+ dispatchTarget.runtime.error?.(`[${dispatchTarget.account.accountId}] Google Chat webhook failed: ${String(err)}`);
693
+ });
894
694
  res.statusCode = 200;
895
695
  res.setHeader("Content-Type", "application/json");
896
696
  res.end("{}");
@@ -982,7 +782,7 @@ function shouldSuppressGoogleChatBotLoop(params) {
982
782
  logVerbose(params.core, params.runtime, `skip bot-to-bot loop in ${params.botLoopProtection.conversationId}`);
983
783
  return true;
984
784
  }
985
- async function processGoogleChatEvent(event, target, turnAdoptionLifecycle) {
785
+ async function processGoogleChatEvent(event, target) {
986
786
  const eventType = event.type ?? event.eventType;
987
787
  if (eventType === "CARD_CLICKED") {
988
788
  await maybeHandleGoogleChatApprovalCardClick({
@@ -1000,8 +800,7 @@ async function processGoogleChatEvent(event, target, turnAdoptionLifecycle) {
1000
800
  runtime: target.runtime,
1001
801
  core: target.core,
1002
802
  statusSink: target.statusSink,
1003
- mediaMaxMb: target.mediaMaxMb,
1004
- turnAdoptionLifecycle
803
+ mediaMaxMb: target.mediaMaxMb
1005
804
  });
1006
805
  }
1007
806
  /**
@@ -1018,7 +817,7 @@ function resolveBotDisplayName(params) {
1018
817
  return "OpenClaw";
1019
818
  }
1020
819
  async function processMessageWithPipeline(params) {
1021
- const { event, account, config, runtime, core, statusSink, mediaMaxMb, turnAdoptionLifecycle } = params;
820
+ const { event, account, config, runtime, core, statusSink, mediaMaxMb } = params;
1022
821
  const space = event.space;
1023
822
  const message = event.message;
1024
823
  if (!space || !message) return;
@@ -1044,8 +843,9 @@ async function processMessageWithPipeline(params) {
1044
843
  }
1045
844
  const messageText = (message.argumentText ?? message.text ?? "").trim();
1046
845
  const attachments = message.attachment ?? [];
1047
- const rawBody = messageText;
1048
- if (!rawBody && attachments.length === 0) return;
846
+ const hasMedia = attachments.length > 0;
847
+ const rawBody = messageText || (hasMedia ? "<media:attachment>" : "");
848
+ if (!rawBody) return;
1049
849
  const access = await applyGoogleChatInboundAccessPolicy({
1050
850
  account,
1051
851
  config,
@@ -1080,29 +880,30 @@ async function processMessageWithPipeline(params) {
1080
880
  core,
1081
881
  runtime
1082
882
  })) return;
1083
- const { route, buildEnvelope } = resolveChannelInboundRouteEnvelope({
883
+ const { route, buildEnvelope } = resolveInboundRouteEnvelopeBuilderWithRuntime({
1084
884
  cfg: config,
1085
885
  channel: "googlechat",
1086
886
  accountId: account.accountId,
1087
887
  peer: {
1088
888
  kind: isGroup ? "group" : "direct",
1089
889
  id: spaceId
1090
- }
890
+ },
891
+ runtime: core.channel,
892
+ sessionStore: config.session?.store
1091
893
  });
1092
- const mediaInputs = attachments.map((attachment) => ({ contentType: attachment.contentType }));
1093
- const first = attachments.at(0);
1094
- if (first) {
894
+ let mediaPath;
895
+ let mediaType;
896
+ if (attachments.length > 0) {
897
+ const first = attachments[0];
1095
898
  const attachmentData = await downloadAttachment(first, account, mediaMaxMb, core);
1096
- if (attachmentData) mediaInputs[0] = {
1097
- path: attachmentData.path,
1098
- url: attachmentData.path,
1099
- contentType: attachmentData.contentType ?? first.contentType
1100
- };
899
+ if (attachmentData) {
900
+ mediaPath = attachmentData.path;
901
+ mediaType = attachmentData.contentType;
902
+ }
1101
903
  }
1102
- const media = toInboundMediaFacts(mediaInputs);
1103
904
  const fromLabel = isGroup ? space.displayName || `space:${spaceId}` : senderName || `user:${senderId}`;
1104
905
  const timestampMs = resolveGoogleChatTimestampMs(event.eventTime);
1105
- const body = buildEnvelope({
906
+ const { storePath, body } = buildEnvelope({
1106
907
  channel: "Google Chat",
1107
908
  from: fromLabel,
1108
909
  timestamp: timestampMs,
@@ -1129,7 +930,6 @@ async function processMessageWithPipeline(params) {
1129
930
  },
1130
931
  route: {
1131
932
  agentId: route.agentId,
1132
- dmScope: route.dmScope,
1133
933
  accountId: route.accountId,
1134
934
  routeSessionKey: route.sessionKey
1135
935
  },
@@ -1145,7 +945,11 @@ async function processMessageWithPipeline(params) {
1145
945
  rawBody,
1146
946
  commandBody: rawBody
1147
947
  },
1148
- media: media.length > 0 ? media : void 0,
948
+ media: mediaPath || mediaType ? [{
949
+ path: mediaPath,
950
+ url: mediaPath,
951
+ contentType: mediaType
952
+ }] : void 0,
1149
953
  supplemental: { groupSystemPrompt: isGroup ? groupSystemPrompt : void 0 },
1150
954
  extra: {
1151
955
  ChatType: isGroup ? "channel" : "direct",
@@ -1160,23 +964,19 @@ async function processMessageWithPipeline(params) {
1160
964
  runtime.error?.(`[${account.accountId}] typingIndicator="reaction" requires user OAuth (not supported with service account). Falling back to "message" mode.`);
1161
965
  typingIndicator = "message";
1162
966
  }
1163
- let typingMessage;
1164
- const typingMessageThreadName = account.config.replyToMode && account.config.replyToMode !== "off" ? replyThreadName : void 0;
967
+ let typingMessageName;
1165
968
  if (typingIndicator === "message") try {
1166
- const result = await sendGoogleChatMessage({
969
+ const botName = resolveBotDisplayName({
970
+ accountName: account.config.name,
971
+ agentId: route.agentId,
972
+ config
973
+ });
974
+ typingMessageName = (await sendGoogleChatMessage({
1167
975
  account,
1168
976
  space: spaceId,
1169
- text: `_${resolveBotDisplayName({
1170
- accountName: account.config.name,
1171
- agentId: route.agentId,
1172
- config
1173
- })} is typing..._`,
1174
- thread: typingMessageThreadName
1175
- });
1176
- if (result?.messageName) typingMessage = {
1177
- name: result.messageName,
1178
- thread: typingMessageThreadName
1179
- };
977
+ text: `_${botName} is typing..._`,
978
+ thread: replyThreadName
979
+ }))?.messageName;
1180
980
  } catch (err) {
1181
981
  runtime.error?.(`Failed sending typing message: ${String(err)}`);
1182
982
  }
@@ -1184,7 +984,6 @@ async function processMessageWithPipeline(params) {
1184
984
  channel: "googlechat",
1185
985
  accountId: route.accountId,
1186
986
  raw: message,
1187
- ...turnAdoptionLifecycle ? { turnAdoptionLifecycle } : {},
1188
987
  adapter: {
1189
988
  ingest: () => ({
1190
989
  id: message.name ?? spaceId,
@@ -1198,17 +997,18 @@ async function processMessageWithPipeline(params) {
1198
997
  cfg: config,
1199
998
  channel: "googlechat",
1200
999
  accountId: route.accountId,
1201
- route: {
1202
- agentId: route.agentId,
1203
- sessionKey: route.sessionKey
1204
- },
1000
+ agentId: route.agentId,
1001
+ routeSessionKey: route.sessionKey,
1002
+ storePath,
1205
1003
  ctxPayload,
1004
+ recordInboundSession: core.channel.session.recordInboundSession,
1005
+ dispatchReplyWithBufferedBlockDispatcher: core.channel.reply.dispatchReplyWithBufferedBlockDispatcher,
1206
1006
  delivery: {
1207
1007
  durable: (payload, info) => resolveGoogleChatDurableReplyOptions({
1208
1008
  payload,
1209
1009
  infoKind: info.kind,
1210
1010
  spaceId,
1211
- hasTypingMessage: Boolean(typingMessage)
1011
+ typingMessageName
1212
1012
  }),
1213
1013
  deliver: async (payload) => {
1214
1014
  await deliverGoogleChatReply({
@@ -1219,9 +1019,9 @@ async function processMessageWithPipeline(params) {
1219
1019
  core,
1220
1020
  config,
1221
1021
  statusSink,
1222
- typingMessage
1022
+ typingMessageName
1223
1023
  });
1224
- typingMessage = void 0;
1024
+ typingMessageName = void 0;
1225
1025
  },
1226
1026
  onDelivered: () => {
1227
1027
  statusSink?.({ lastOutboundAt: Date.now() });
@@ -1253,7 +1053,7 @@ async function downloadAttachment(attachment, account, mediaMaxMb, core) {
1253
1053
  contentType: saved.contentType
1254
1054
  };
1255
1055
  }
1256
- async function monitorGoogleChatProvider(options) {
1056
+ function monitorGoogleChatProvider(options) {
1257
1057
  const core = getGoogleChatRuntime();
1258
1058
  const webhookPath = resolveWebhookPath({
1259
1059
  webhookPath: options.webhookPath,
@@ -1262,7 +1062,7 @@ async function monitorGoogleChatProvider(options) {
1262
1062
  });
1263
1063
  if (!webhookPath) {
1264
1064
  options.runtime.error?.(`[${options.account.accountId}] invalid webhook path`);
1265
- return async () => {};
1065
+ return () => {};
1266
1066
  }
1267
1067
  const audienceType = normalizeAudienceType(options.account.config.audienceType);
1268
1068
  const audience = options.account.config.audience?.trim();
@@ -1273,15 +1073,7 @@ async function monitorGoogleChatProvider(options) {
1273
1073
  appPrincipal: options.account.config.appPrincipal,
1274
1074
  log: options.runtime.log
1275
1075
  });
1276
- const ingress = createGoogleChatIngressMonitor({
1277
- accountId: options.account.accountId,
1278
- runtime: options.runtime,
1279
- abortSignal: options.abortSignal,
1280
- dispatch: async (event, lifecycle) => {
1281
- await processGoogleChatEvent(event, target, lifecycle);
1282
- }
1283
- });
1284
- const target = {
1076
+ const unregisterTarget = registerGoogleChatWebhookTarget({
1285
1077
  account: options.account,
1286
1078
  config: options.config,
1287
1079
  runtime: options.runtime,
@@ -1290,24 +1082,14 @@ async function monitorGoogleChatProvider(options) {
1290
1082
  audienceType,
1291
1083
  audience,
1292
1084
  statusSink: options.statusSink,
1293
- mediaMaxMb,
1294
- ingress
1295
- };
1296
- ingress.start();
1297
- let unregisterTarget;
1298
- try {
1299
- unregisterTarget = registerGoogleChatWebhookTarget(target);
1300
- } catch (error) {
1301
- await ingress.stop();
1302
- throw error;
1303
- }
1304
- return async () => {
1305
- unregisterTarget?.();
1306
- await ingress.stop();
1085
+ mediaMaxMb
1086
+ });
1087
+ return () => {
1088
+ unregisterTarget();
1307
1089
  };
1308
1090
  }
1309
1091
  async function startGoogleChatMonitor(params) {
1310
- return await monitorGoogleChatProvider(params);
1092
+ return monitorGoogleChatProvider(params);
1311
1093
  }
1312
1094
  function resolveGoogleChatWebhookPath(params) {
1313
1095
  return resolveWebhookPath({
@@ -1321,6 +1103,7 @@ function resolveGoogleChatWebhookPath(params) {
1321
1103
  const googleChatChannelRuntime = {
1322
1104
  probeGoogleChat,
1323
1105
  sendGoogleChatMessage,
1106
+ uploadGoogleChatAttachment,
1324
1107
  resolveGoogleChatWebhookPath,
1325
1108
  startGoogleChatMonitor
1326
1109
  };