@zortexhq/indra-v2.5 0.2.5 → 0.2.7

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 (790) hide show
  1. package/README.md +129 -109
  2. package/dist/cli-run.js +1 -1
  3. package/dist/codex-setup.js +1 -1
  4. package/dist/connector-worker.js +1 -1
  5. package/dist/content-find.js +2 -0
  6. package/dist/ensure-ready.js +1 -0
  7. package/dist/gateway.js +1 -1
  8. package/dist/help-launch.js +1 -1
  9. package/dist/local-cloud-policy.js +1 -1
  10. package/dist/mcp.js +2 -2
  11. package/dist/onboarding.js +1 -1
  12. package/dist/operation-telemetry.js +1 -1
  13. package/dist/profile-upgrade.js +1 -1
  14. package/dist/public-tool.js +1 -0
  15. package/dist/recovery-progress.js +1 -1
  16. package/dist/recovery-text.js +1 -1
  17. package/dist/recovery.js +1 -1
  18. package/dist/resident-ensure-ready.js +1 -0
  19. package/dist/resident-host.js +2 -2
  20. package/dist/resident-jobs.js +1 -1
  21. package/dist/resident-platform.js +1 -1
  22. package/dist/resident-telemetry.js +1 -1
  23. package/dist/source-catalog.js +1 -1
  24. package/dist/startup.js +1 -2
  25. package/dist/supervised-sync.js +1 -1
  26. package/dist/tools.js +1 -1
  27. package/dist/update-cli.js +1 -1
  28. package/dist/web.js +2 -2
  29. package/node_modules/@zortexhq/plugin-auth-core/dist/device-admission.js +2 -2
  30. package/node_modules/@zortexhq/plugin-auth-core/dist/index.js +1 -1
  31. package/node_modules/@zortexhq/plugin-auth-core/package.json +1 -8
  32. package/node_modules/@zortexhq/plugin-auto-connect/dist/api/index.js +1 -1
  33. package/node_modules/@zortexhq/plugin-auto-connect/package.json +0 -3
  34. package/node_modules/@zortexhq/plugin-connector-calendar/dist/actions.js +1 -1
  35. package/node_modules/@zortexhq/plugin-connector-core/dist/api/index.js +1 -1
  36. package/node_modules/@zortexhq/plugin-connector-core/dist/enrollment.js +1 -1
  37. package/node_modules/@zortexhq/plugin-connector-core/dist/hub.js +1 -1
  38. package/node_modules/@zortexhq/plugin-connector-core/package.json +1 -3
  39. package/node_modules/@zortexhq/plugin-connector-fleet/dist/index.js +1 -1
  40. package/node_modules/@zortexhq/plugin-connector-fleet/package.json +1 -4
  41. package/node_modules/@zortexhq/plugin-connector-framework/dist/api/browser-authorization.js +1 -0
  42. package/node_modules/@zortexhq/plugin-connector-framework/dist/api/index.js +1 -1
  43. package/node_modules/@zortexhq/plugin-connector-framework/dist/runner.js +1 -1
  44. package/node_modules/@zortexhq/plugin-connector-framework/package.json +0 -3
  45. package/node_modules/@zortexhq/plugin-connector-level1/dist/additional-sources.js +1 -1
  46. package/node_modules/@zortexhq/plugin-connector-level1/dist/index.js +1 -1
  47. package/node_modules/@zortexhq/plugin-connector-level1/dist/matrix-login.js +1 -1
  48. package/node_modules/@zortexhq/plugin-connector-level1/dist/provisioning.js +1 -1
  49. package/node_modules/@zortexhq/plugin-connector-level1/dist/shallow.js +1 -1
  50. package/node_modules/@zortexhq/plugin-connector-level1/dist/sources.js +1 -1
  51. package/node_modules/@zortexhq/plugin-connector-level1/package.json +1 -4
  52. package/node_modules/@zortexhq/plugin-connector-notion/dist/broker.js +1 -1
  53. package/node_modules/@zortexhq/plugin-connector-notion/dist/index.js +1 -1
  54. package/node_modules/@zortexhq/plugin-connector-notion/dist/provider.js +1 -1
  55. package/node_modules/@zortexhq/plugin-connector-notion/package.json +1 -3
  56. package/node_modules/@zortexhq/plugin-connector-steam/dist/index.js +1 -1
  57. package/node_modules/@zortexhq/plugin-connector-steam/dist/provider.js +1 -1
  58. package/node_modules/@zortexhq/plugin-connector-steam/package.json +1 -3
  59. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-model.js +1 -1
  60. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/connection-panel.js +1 -1
  61. package/node_modules/@zortexhq/plugin-google-auth/dist/index.js +1 -1
  62. package/node_modules/@zortexhq/plugin-google-auth/package.json +1 -3
  63. package/node_modules/@zortexhq/plugin-telemetry/dist/api/telemetry.js +1 -1
  64. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/index.js +1 -1
  65. package/package.json +6 -20
  66. package/profiles/core.yml +0 -18
  67. package/release-provenance.json +27 -93
  68. package/update-manifest.json +362 -4744
  69. package/dist/cloud-action-proof.js +0 -1
  70. package/dist/cloud-device-host.js +0 -1
  71. package/dist/cloud-device-identity.js +0 -1
  72. package/dist/cloud-download-sink.js +0 -1
  73. package/dist/cloud-gmail-actions.js +0 -1
  74. package/dist/cloud-gmail-audit.js +0 -1
  75. package/dist/cloud-gmail-bound-audit-runner.js +0 -1
  76. package/dist/cloud-gmail-bound-epoch.js +0 -1
  77. package/dist/cloud-gmail-bound-identity.js +0 -1
  78. package/dist/cloud-gmail-bound-runner.js +0 -1
  79. package/dist/cloud-gmail-provider.js +0 -1
  80. package/dist/cloud-gmail-rpc.js +0 -1
  81. package/dist/cloud-gmail-sync.js +0 -1
  82. package/node_modules/@zortexhq/plugin-auth-core/dist/cloud-frame.js +0 -1
  83. package/node_modules/@zortexhq/plugin-auth-core/dist/cloud-vault-keyring.js +0 -1
  84. package/node_modules/@zortexhq/plugin-cloud-ai/dist/account.js +0 -1
  85. package/node_modules/@zortexhq/plugin-cloud-ai/dist/adopt.js +0 -1
  86. package/node_modules/@zortexhq/plugin-cloud-ai/dist/index.js +0 -1
  87. package/node_modules/@zortexhq/plugin-cloud-ai/dist/pack.js +0 -1
  88. package/node_modules/@zortexhq/plugin-cloud-ai/dist/publish.js +0 -1
  89. package/node_modules/@zortexhq/plugin-cloud-ai/dist/records.js +0 -1
  90. package/node_modules/@zortexhq/plugin-cloud-ai/package.json +0 -17
  91. package/node_modules/@zortexhq/plugin-cloud-vault/dist/device-trust.js +0 -1
  92. package/node_modules/@zortexhq/plugin-cloud-vault/dist/owner-admission.js +0 -1
  93. package/node_modules/@zortexhq/plugin-cloud-vault/package.json +0 -19
  94. package/node_modules/@zortexhq/plugin-connector-core/dist/api/browser-authorization.js +0 -1
  95. package/node_modules/@zortexhq/plugin-connector-framework/dist/api/original-miner.js +0 -1
  96. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-codec.js +0 -2
  97. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-fs.js +0 -1
  98. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-move-worker.js +0 -1
  99. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-move.js +0 -1
  100. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-posix.js +0 -1
  101. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-public.js +0 -1
  102. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-replay.js +0 -1
  103. package/node_modules/@zortexhq/plugin-connector-framework/dist/checkpoint-store.js +0 -1
  104. package/node_modules/@zortexhq/plugin-connector-framework/dist/chromium-local/chromium-history.js +0 -1
  105. package/node_modules/@zortexhq/plugin-connector-framework/dist/chromium-local/index.js +0 -1
  106. package/node_modules/@zortexhq/plugin-connector-framework/dist/chromium-local/normalize-visit.js +0 -1
  107. package/node_modules/@zortexhq/plugin-connector-framework/dist/connection-health.js +0 -1
  108. package/node_modules/@zortexhq/plugin-connector-framework/dist/connector.js +0 -1
  109. package/node_modules/@zortexhq/plugin-connector-framework/dist/failure-type.js +0 -1
  110. package/node_modules/@zortexhq/plugin-connector-framework/dist/index.js +0 -1
  111. package/node_modules/@zortexhq/plugin-connector-framework/dist/windows-custody.js +0 -1
  112. package/node_modules/@zortexhq/plugin-connector-level1/dist/chatgpt.js +0 -1
  113. package/node_modules/@zortexhq/plugin-connector-level1/dist/signed-in.js +0 -1
  114. package/node_modules/@zortexhq/plugin-connector-social/dist/full-sync.js +0 -1
  115. package/node_modules/@zortexhq/plugin-connector-social/dist/index.js +0 -1
  116. package/node_modules/@zortexhq/plugin-connector-social/dist/provider.js +0 -1
  117. package/node_modules/@zortexhq/plugin-connector-social/dist/sites.js +0 -1
  118. package/node_modules/@zortexhq/plugin-connector-social/package.json +0 -22
  119. package/node_modules/@zortexhq/plugin-connector-steam/dist/browser-session.js +0 -1
  120. package/node_modules/@zortexhq/plugin-connectors/package.json +0 -17
  121. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/attached.js +0 -11
  122. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/browser.js +0 -1
  123. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/decision.js +0 -1
  124. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/extension-transport.js +0 -1
  125. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/feedback.js +0 -1
  126. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/google-oauth-bridge.js +0 -1
  127. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/google-oauth-driver.js +0 -1
  128. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/google-uia-decision.js +0 -1
  129. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/index.js +0 -1
  130. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/microsoft-oauth-bridge.js +0 -1
  131. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/microsoft-oauth-driver.js +0 -1
  132. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/page-inspect.js +0 -6
  133. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/runner.js +0 -1
  134. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/slack-oauth-bridge.js +0 -1
  135. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/slack-oauth-driver.js +0 -1
  136. package/node_modules/@zortexhq/plugin-jev-autopilot/dist/whatsapp-session.js +0 -1
  137. package/node_modules/@zortexhq/plugin-jev-autopilot/extension/manifest.json +0 -9
  138. package/node_modules/@zortexhq/plugin-jev-autopilot/package.json +0 -21
  139. package/node_modules/@zortexhq/plugin-jev-browser-driver/assets/ax-page.js +0 -1
  140. package/node_modules/@zortexhq/plugin-jev-browser-driver/assets/uia-page.ps1 +0 -545
  141. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/approved-control.js +0 -1
  142. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/attached-session.js +0 -8
  143. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/authorization-account-policy.js +0 -1
  144. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/authorization-memory.js +0 -1
  145. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/authorization-planner.js +0 -8
  146. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/authorization-task.js +0 -1
  147. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/browser-actions.js +0 -1
  148. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/browser-task.js +0 -7
  149. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/combined.js +0 -1
  150. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/decision.js +0 -5
  151. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/driver.js +0 -1
  152. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/google-oauth-driver.js +0 -1
  153. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/index.js +0 -1
  154. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/isolated-display.js +0 -1
  155. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/microsoft-oauth-driver.js +0 -1
  156. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/native-session.js +0 -1
  157. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/notion-oauth-driver.js +0 -1
  158. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/observe-log.js +0 -1
  159. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/operational-browser.js +0 -1
  160. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/page-settle.js +0 -1
  161. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/planned-oauth.js +0 -1
  162. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/session-routes.js +0 -1
  163. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/shared-session.js +0 -1
  164. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/site-read.js +0 -1
  165. package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/slack-oauth-driver.js +0 -1
  166. package/node_modules/@zortexhq/plugin-jev-browser-driver/package.json +0 -20
  167. package/node_modules/@zortexhq/plugin-oauth-browser-driver/assets/windows-oauth-background.cs +0 -492
  168. package/node_modules/@zortexhq/plugin-oauth-browser-driver/assets/windows-oauth-guard-x64.build.json +0 -30
  169. package/node_modules/@zortexhq/plugin-oauth-browser-driver/assets/windows-oauth-guard-x64.dll +0 -0
  170. package/node_modules/@zortexhq/plugin-oauth-browser-driver/assets/windows-oauth-guard.c +0 -692
  171. package/node_modules/@zortexhq/plugin-oauth-browser-driver/assets/windows-uia-oauth.ps1 +0 -3840
  172. package/node_modules/@zortexhq/plugin-oauth-browser-driver/dist/api/index.js +0 -1
  173. package/node_modules/@zortexhq/plugin-oauth-browser-driver/dist/driver.js +0 -3
  174. package/node_modules/@zortexhq/plugin-oauth-browser-driver/dist/index.js +0 -1
  175. package/node_modules/@zortexhq/plugin-oauth-browser-driver/package.json +0 -19
  176. package/node_modules/chatgpt-web-mcp/.env.example +0 -30
  177. package/node_modules/chatgpt-web-mcp/CONTRIBUTING.md +0 -65
  178. package/node_modules/chatgpt-web-mcp/LICENSE +0 -21
  179. package/node_modules/chatgpt-web-mcp/README.en.md +0 -149
  180. package/node_modules/chatgpt-web-mcp/README.md +0 -194
  181. package/node_modules/chatgpt-web-mcp/SECURITY.md +0 -37
  182. package/node_modules/chatgpt-web-mcp/node_modules/zod/LICENSE +0 -21
  183. package/node_modules/chatgpt-web-mcp/node_modules/zod/README.md +0 -208
  184. package/node_modules/chatgpt-web-mcp/node_modules/zod/index.cjs +0 -33
  185. package/node_modules/chatgpt-web-mcp/node_modules/zod/index.d.cts +0 -4
  186. package/node_modules/chatgpt-web-mcp/node_modules/zod/index.d.ts +0 -4
  187. package/node_modules/chatgpt-web-mcp/node_modules/zod/index.js +0 -4
  188. package/node_modules/chatgpt-web-mcp/node_modules/zod/package.json +0 -118
  189. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/index.ts +0 -4
  190. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/ZodError.ts +0 -330
  191. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  192. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  193. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  194. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  195. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  196. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  197. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  198. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  199. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  200. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/errors.ts +0 -13
  201. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/external.ts +0 -6
  202. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  203. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  204. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  205. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  206. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  207. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/helpers/util.ts +0 -224
  208. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/index.ts +0 -4
  209. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/locales/en.ts +0 -124
  210. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/standard-schema.ts +0 -113
  211. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  212. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  213. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  214. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  215. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  216. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  217. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  218. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  219. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  220. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  221. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  222. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/complex.test.ts +0 -56
  223. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  224. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  225. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  226. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  227. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  228. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  229. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  230. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  231. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  232. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  233. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/function.test.ts +0 -257
  234. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  235. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  236. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  237. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  238. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  239. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  240. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  241. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  242. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  243. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/nan.test.ts +0 -21
  244. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  245. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  246. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  247. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  248. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  249. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  250. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  251. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  252. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  253. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  254. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  255. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  256. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  257. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  258. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  259. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  260. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  261. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  262. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  263. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  264. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  265. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  266. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  267. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  268. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  269. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  270. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  271. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  272. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v3/types.ts +0 -5136
  273. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/checks.ts +0 -30
  274. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  275. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/compat.ts +0 -66
  276. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/errors.ts +0 -75
  277. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/external.ts +0 -50
  278. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/index.ts +0 -5
  279. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/iso.ts +0 -90
  280. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/parse.ts +0 -33
  281. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/schemas.ts +0 -2054
  282. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  283. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  284. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -210
  285. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  286. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  287. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  288. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  289. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -63
  290. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -252
  291. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  292. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  293. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -352
  294. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  295. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -31
  296. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -296
  297. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -313
  298. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  299. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -619
  300. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  301. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -527
  302. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  303. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -91
  304. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -175
  305. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -268
  306. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  307. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -829
  308. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -34
  309. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -171
  310. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -108
  311. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  312. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -92
  313. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -196
  314. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  315. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  316. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -86
  317. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  318. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -247
  319. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -563
  320. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -123
  321. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -147
  322. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -127
  323. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -81
  324. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -37
  325. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -298
  326. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  327. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  328. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  329. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  330. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -342
  331. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -356
  332. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -532
  333. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -204
  334. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -179
  335. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -57
  336. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -109
  337. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -881
  338. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -66
  339. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -758
  340. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -2314
  341. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -250
  342. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -163
  343. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -94
  344. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  345. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  346. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/api.ts +0 -1594
  347. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/checks.ts +0 -1283
  348. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/config.ts +0 -15
  349. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/core.ts +0 -134
  350. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/doc.ts +0 -44
  351. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/errors.ts +0 -424
  352. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/function.ts +0 -176
  353. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/index.ts +0 -15
  354. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/json-schema.ts +0 -143
  355. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/parse.ts +0 -94
  356. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/regexes.ts +0 -135
  357. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/registries.ts +0 -96
  358. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/schemas.ts +0 -3842
  359. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/standard-schema.ts +0 -64
  360. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  361. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  362. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  363. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  364. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  365. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/to-json-schema.ts +0 -977
  366. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/util.ts +0 -775
  367. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/versions.ts +0 -5
  368. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/core/zsf.ts +0 -323
  369. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/index.ts +0 -4
  370. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ar.ts +0 -125
  371. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/az.ts +0 -121
  372. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/be.ts +0 -184
  373. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ca.ts +0 -127
  374. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/cs.ts +0 -142
  375. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/de.ts +0 -124
  376. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/en.ts +0 -127
  377. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/eo.ts +0 -125
  378. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/es.ts +0 -125
  379. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/fa.ts +0 -134
  380. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/fi.ts +0 -131
  381. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/fr-CA.ts +0 -126
  382. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/fr.ts +0 -124
  383. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/he.ts +0 -125
  384. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/hu.ts +0 -126
  385. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/id.ts +0 -125
  386. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/index.ts +0 -39
  387. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/it.ts +0 -125
  388. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ja.ts +0 -122
  389. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/kh.ts +0 -126
  390. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ko.ts +0 -131
  391. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/mk.ts +0 -127
  392. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ms.ts +0 -124
  393. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/nl.ts +0 -126
  394. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/no.ts +0 -124
  395. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ota.ts +0 -125
  396. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/pl.ts +0 -126
  397. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ps.ts +0 -133
  398. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/pt.ts +0 -123
  399. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ru.ts +0 -184
  400. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/sl.ts +0 -126
  401. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/sv.ts +0 -127
  402. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ta.ts +0 -125
  403. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/th.ts +0 -126
  404. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/tr.ts +0 -121
  405. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ua.ts +0 -126
  406. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/ur.ts +0 -126
  407. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/vi.ts +0 -125
  408. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/zh-CN.ts +0 -123
  409. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/locales/zh-TW.ts +0 -125
  410. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/checks.ts +0 -32
  411. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/coerce.ts +0 -22
  412. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/external.ts +0 -40
  413. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/index.ts +0 -3
  414. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/iso.ts +0 -62
  415. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/parse.ts +0 -1
  416. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/schemas.ts +0 -1579
  417. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  418. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -51
  419. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  420. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  421. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  422. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -43
  423. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -871
  424. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  425. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -185
  426. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  427. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -275
  428. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -299
  429. package/node_modules/chatgpt-web-mcp/node_modules/zod/src/v4-mini/index.ts +0 -1
  430. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/ZodError.cjs +0 -138
  431. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/ZodError.d.cts +0 -164
  432. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/ZodError.d.ts +0 -164
  433. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/ZodError.js +0 -133
  434. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/errors.cjs +0 -17
  435. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/errors.d.cts +0 -5
  436. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/errors.d.ts +0 -5
  437. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/errors.js +0 -9
  438. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/external.cjs +0 -22
  439. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/external.d.cts +0 -6
  440. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/external.d.ts +0 -6
  441. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/external.js +0 -6
  442. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  443. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  444. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  445. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  446. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  447. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  448. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  449. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  450. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  451. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  452. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  453. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  454. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  455. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  456. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  457. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  458. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  459. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  460. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  461. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  462. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/util.cjs +0 -137
  463. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/util.d.cts +0 -85
  464. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/util.d.ts +0 -85
  465. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/helpers/util.js +0 -133
  466. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/index.cjs +0 -33
  467. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/index.d.cts +0 -4
  468. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/index.d.ts +0 -4
  469. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/index.js +0 -4
  470. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/locales/en.cjs +0 -111
  471. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/locales/en.d.cts +0 -3
  472. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/locales/en.d.ts +0 -3
  473. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/locales/en.js +0 -109
  474. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/standard-schema.cjs +0 -2
  475. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/standard-schema.d.cts +0 -102
  476. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/standard-schema.d.ts +0 -102
  477. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/standard-schema.js +0 -1
  478. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/types.cjs +0 -3775
  479. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/types.d.cts +0 -1031
  480. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/types.d.ts +0 -1031
  481. package/node_modules/chatgpt-web-mcp/node_modules/zod/v3/types.js +0 -3693
  482. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/checks.cjs +0 -32
  483. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/checks.d.cts +0 -1
  484. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/checks.d.ts +0 -1
  485. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/checks.js +0 -1
  486. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/coerce.cjs +0 -47
  487. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  488. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  489. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/coerce.js +0 -17
  490. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/compat.cjs +0 -57
  491. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/compat.d.cts +0 -46
  492. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/compat.d.ts +0 -46
  493. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/compat.js +0 -27
  494. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/errors.cjs +0 -67
  495. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/errors.d.cts +0 -30
  496. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/errors.d.ts +0 -30
  497. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/errors.js +0 -41
  498. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/external.cjs +0 -70
  499. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/external.d.cts +0 -13
  500. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/external.d.ts +0 -13
  501. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/external.js +0 -18
  502. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/index.cjs +0 -33
  503. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/index.d.cts +0 -4
  504. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/index.d.ts +0 -4
  505. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/index.js +0 -4
  506. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/iso.cjs +0 -60
  507. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/iso.d.cts +0 -22
  508. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/iso.d.ts +0 -22
  509. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/iso.js +0 -30
  510. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/parse.cjs +0 -32
  511. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/parse.d.cts +0 -23
  512. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/parse.d.ts +0 -23
  513. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/parse.js +0 -6
  514. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/schemas.cjs +0 -1109
  515. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/schemas.d.cts +0 -630
  516. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/schemas.d.ts +0 -630
  517. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/classic/schemas.js +0 -1006
  518. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/api.cjs +0 -1039
  519. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/api.d.cts +0 -284
  520. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/api.d.ts +0 -284
  521. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/api.js +0 -906
  522. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/checks.cjs +0 -591
  523. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/checks.d.cts +0 -278
  524. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/checks.d.ts +0 -278
  525. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/checks.js +0 -565
  526. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/core.cjs +0 -67
  527. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/core.d.cts +0 -49
  528. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/core.d.ts +0 -49
  529. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/core.js +0 -61
  530. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/doc.cjs +0 -39
  531. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/doc.d.cts +0 -14
  532. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/doc.d.ts +0 -14
  533. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/doc.js +0 -35
  534. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/errors.cjs +0 -226
  535. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/errors.d.cts +0 -208
  536. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/errors.d.ts +0 -208
  537. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/errors.js +0 -195
  538. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/function.cjs +0 -102
  539. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/function.d.cts +0 -52
  540. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/function.d.ts +0 -52
  541. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/function.js +0 -75
  542. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/index.cjs +0 -44
  543. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/index.d.cts +0 -15
  544. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/index.d.ts +0 -15
  545. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/index.js +0 -15
  546. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/json-schema.cjs +0 -2
  547. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/json-schema.d.cts +0 -87
  548. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/json-schema.d.ts +0 -87
  549. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/json-schema.js +0 -1
  550. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/parse.cjs +0 -87
  551. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/parse.d.cts +0 -25
  552. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/parse.d.ts +0 -25
  553. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/parse.js +0 -57
  554. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/regexes.cjs +0 -103
  555. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/regexes.d.cts +0 -62
  556. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/regexes.d.ts +0 -62
  557. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/regexes.js +0 -95
  558. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/registries.cjs +0 -56
  559. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/registries.d.cts +0 -35
  560. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/registries.d.ts +0 -35
  561. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/registries.js +0 -51
  562. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/schemas.cjs +0 -1748
  563. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/schemas.d.cts +0 -1041
  564. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/schemas.d.ts +0 -1041
  565. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/schemas.js +0 -1717
  566. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  567. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/standard-schema.d.cts +0 -55
  568. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/standard-schema.d.ts +0 -55
  569. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/standard-schema.js +0 -1
  570. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/to-json-schema.cjs +0 -854
  571. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/to-json-schema.d.cts +0 -88
  572. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/to-json-schema.d.ts +0 -88
  573. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/to-json-schema.js +0 -849
  574. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/util.cjs +0 -539
  575. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/util.d.cts +0 -183
  576. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/util.d.ts +0 -183
  577. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/util.js +0 -493
  578. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/versions.cjs +0 -8
  579. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/versions.d.cts +0 -5
  580. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/versions.d.ts +0 -5
  581. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/core/versions.js +0 -5
  582. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/index.cjs +0 -22
  583. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/index.d.cts +0 -3
  584. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/index.d.ts +0 -3
  585. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/index.js +0 -3
  586. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ar.cjs +0 -142
  587. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ar.d.cts +0 -4
  588. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ar.d.ts +0 -4
  589. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ar.js +0 -116
  590. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/az.cjs +0 -141
  591. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/az.d.cts +0 -4
  592. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/az.d.ts +0 -4
  593. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/az.js +0 -115
  594. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/be.cjs +0 -190
  595. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/be.d.cts +0 -4
  596. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/be.d.ts +0 -4
  597. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/be.js +0 -164
  598. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ca.cjs +0 -144
  599. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ca.d.cts +0 -4
  600. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ca.d.ts +0 -4
  601. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ca.js +0 -118
  602. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/cs.cjs +0 -161
  603. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/cs.d.cts +0 -4
  604. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/cs.d.ts +0 -4
  605. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/cs.js +0 -135
  606. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/de.cjs +0 -142
  607. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/de.d.cts +0 -4
  608. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/de.d.ts +0 -4
  609. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/de.js +0 -116
  610. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/en.cjs +0 -145
  611. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/en.d.cts +0 -5
  612. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/en.d.ts +0 -5
  613. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/en.js +0 -117
  614. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/eo.cjs +0 -144
  615. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/eo.d.cts +0 -5
  616. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/eo.d.ts +0 -5
  617. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/eo.js +0 -116
  618. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/es.cjs +0 -143
  619. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/es.d.cts +0 -4
  620. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/es.d.ts +0 -4
  621. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/es.js +0 -117
  622. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fa.cjs +0 -148
  623. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fa.d.cts +0 -4
  624. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fa.d.ts +0 -4
  625. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fa.js +0 -122
  626. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fi.cjs +0 -148
  627. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fi.d.cts +0 -4
  628. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fi.d.ts +0 -4
  629. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fi.js +0 -122
  630. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr-CA.cjs +0 -143
  631. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr-CA.d.cts +0 -4
  632. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  633. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr-CA.js +0 -117
  634. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr.cjs +0 -142
  635. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr.d.cts +0 -4
  636. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr.d.ts +0 -4
  637. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/fr.js +0 -116
  638. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/he.cjs +0 -143
  639. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/he.d.cts +0 -4
  640. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/he.d.ts +0 -4
  641. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/he.js +0 -117
  642. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/hu.cjs +0 -143
  643. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/hu.d.cts +0 -4
  644. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/hu.d.ts +0 -4
  645. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/hu.js +0 -117
  646. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/id.cjs +0 -142
  647. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/id.d.cts +0 -4
  648. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/id.d.ts +0 -4
  649. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/id.js +0 -116
  650. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/index.cjs +0 -84
  651. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/index.d.cts +0 -39
  652. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/index.d.ts +0 -39
  653. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/index.js +0 -39
  654. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/it.cjs +0 -143
  655. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/it.d.cts +0 -4
  656. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/it.d.ts +0 -4
  657. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/it.js +0 -117
  658. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ja.cjs +0 -141
  659. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ja.d.cts +0 -4
  660. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ja.d.ts +0 -4
  661. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ja.js +0 -115
  662. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/kh.cjs +0 -143
  663. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/kh.d.cts +0 -4
  664. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/kh.d.ts +0 -4
  665. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/kh.js +0 -117
  666. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ko.cjs +0 -147
  667. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ko.d.cts +0 -4
  668. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ko.d.ts +0 -4
  669. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ko.js +0 -121
  670. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/mk.cjs +0 -144
  671. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/mk.d.cts +0 -4
  672. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/mk.d.ts +0 -4
  673. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/mk.js +0 -118
  674. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ms.cjs +0 -142
  675. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ms.d.cts +0 -4
  676. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ms.d.ts +0 -4
  677. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ms.js +0 -116
  678. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/nl.cjs +0 -143
  679. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/nl.d.cts +0 -4
  680. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/nl.d.ts +0 -4
  681. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/nl.js +0 -117
  682. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/no.cjs +0 -142
  683. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/no.d.cts +0 -4
  684. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/no.d.ts +0 -4
  685. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/no.js +0 -116
  686. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ota.cjs +0 -143
  687. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ota.d.cts +0 -4
  688. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ota.d.ts +0 -4
  689. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ota.js +0 -117
  690. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pl.cjs +0 -143
  691. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pl.d.cts +0 -4
  692. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pl.d.ts +0 -4
  693. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pl.js +0 -117
  694. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ps.cjs +0 -148
  695. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ps.d.cts +0 -4
  696. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ps.d.ts +0 -4
  697. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ps.js +0 -122
  698. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pt.cjs +0 -142
  699. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pt.d.cts +0 -4
  700. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pt.d.ts +0 -4
  701. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/pt.js +0 -116
  702. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ru.cjs +0 -190
  703. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ru.d.cts +0 -4
  704. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ru.d.ts +0 -4
  705. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ru.js +0 -164
  706. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sl.cjs +0 -143
  707. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sl.d.cts +0 -4
  708. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sl.d.ts +0 -4
  709. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sl.js +0 -117
  710. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sv.cjs +0 -144
  711. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sv.d.cts +0 -4
  712. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sv.d.ts +0 -4
  713. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/sv.js +0 -118
  714. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ta.cjs +0 -143
  715. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ta.d.cts +0 -4
  716. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ta.d.ts +0 -4
  717. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ta.js +0 -117
  718. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/th.cjs +0 -143
  719. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/th.d.cts +0 -4
  720. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/th.d.ts +0 -4
  721. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/th.js +0 -117
  722. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/tr.cjs +0 -143
  723. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/tr.d.cts +0 -5
  724. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/tr.d.ts +0 -5
  725. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/tr.js +0 -115
  726. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ua.cjs +0 -143
  727. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ua.d.cts +0 -4
  728. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ua.d.ts +0 -4
  729. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ua.js +0 -117
  730. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ur.cjs +0 -143
  731. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ur.d.cts +0 -4
  732. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ur.d.ts +0 -4
  733. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/ur.js +0 -117
  734. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/vi.cjs +0 -142
  735. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/vi.d.cts +0 -4
  736. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/vi.d.ts +0 -4
  737. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/vi.js +0 -116
  738. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-CN.cjs +0 -142
  739. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-CN.d.cts +0 -4
  740. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  741. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-CN.js +0 -116
  742. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-TW.cjs +0 -143
  743. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-TW.d.cts +0 -4
  744. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  745. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/locales/zh-TW.js +0 -117
  746. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/checks.cjs +0 -34
  747. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/checks.d.cts +0 -1
  748. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/checks.d.ts +0 -1
  749. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/checks.js +0 -1
  750. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/coerce.cjs +0 -47
  751. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  752. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  753. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/coerce.js +0 -17
  754. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/external.cjs +0 -62
  755. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/external.d.cts +0 -11
  756. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/external.d.ts +0 -11
  757. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/external.js +0 -13
  758. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/index.cjs +0 -32
  759. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/index.d.cts +0 -3
  760. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/index.d.ts +0 -3
  761. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/index.js +0 -3
  762. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/iso.cjs +0 -60
  763. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/iso.d.cts +0 -22
  764. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/iso.d.ts +0 -22
  765. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/iso.js +0 -30
  766. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/parse.cjs +0 -8
  767. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/parse.d.cts +0 -1
  768. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/parse.d.ts +0 -1
  769. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/parse.js +0 -1
  770. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/schemas.cjs +0 -839
  771. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/schemas.d.cts +0 -356
  772. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/schemas.d.ts +0 -356
  773. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4/mini/schemas.js +0 -732
  774. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4-mini/index.cjs +0 -17
  775. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4-mini/index.d.cts +0 -1
  776. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4-mini/index.d.ts +0 -1
  777. package/node_modules/chatgpt-web-mcp/node_modules/zod/v4-mini/index.js +0 -1
  778. package/node_modules/chatgpt-web-mcp/package.json +0 -50
  779. package/node_modules/chatgpt-web-mcp/scripts/doctor.js +0 -40
  780. package/node_modules/chatgpt-web-mcp/scripts/inspect.js +0 -16
  781. package/node_modules/chatgpt-web-mcp/scripts/login.js +0 -32
  782. package/node_modules/chatgpt-web-mcp/scripts/smoke-mcp.js +0 -26
  783. package/node_modules/chatgpt-web-mcp/src/browser.js +0 -4670
  784. package/node_modules/chatgpt-web-mcp/src/cli.js +0 -27
  785. package/node_modules/chatgpt-web-mcp/src/config.js +0 -210
  786. package/node_modules/chatgpt-web-mcp/src/errors.js +0 -20
  787. package/node_modules/chatgpt-web-mcp/src/index.js +0 -381
  788. package/node_modules/chatgpt-web-mcp/src/login-lifecycle.js +0 -39
  789. package/node_modules/chatgpt-web-mcp/src/selectors.js +0 -151
  790. package/profiles/social-worker.yml +0 -18
@@ -1 +1 @@
1
- import{isPromise}from"node:util/types";import{startOperationalStep,usageOutcome}from"@zortexhq/plugin-telemetry/api";const object=value=>!!value&&typeof value==="object"&&!Array.isArray(value);const connector=(operationId,action,source)=>({phase:"connector",action,...operationId?{operationId}:{},...typeof source==="string"?{source}:{}});const configure=source=>()=>connector("resident.configure","execute",source);const runtime=(operationId,action)=>({phase:"runtime",action,...operationId?{operationId}:{}});const metadata={localCloud:args=>runtime("resident.local_cloud",object(args[0])&&args[0].action==="grants"?"status":"cancel"),gateway:args=>({phase:"tool",action:"execute",operationId:object(args[0])&&args[0].operation==="actions"?"tool.actions":"tool.manage"}),check:args=>connector("resident.check","observe",args[0]),read:args=>connector("connector.read","read",args[0]),sync:args=>connector("connector.sync","execute",args[0]),invoke:args=>connector("connector.invoke","invoke",object(args[0])?args[0].source:void 0),connect:args=>connector("resident.connect","connect",args[0]),connectJob:()=>connector("resident.connect_job","status"),cancelConnect:()=>connector("resident.cancel_connect","cancel"),startup:()=>runtime("resident.startup","execute"),pauseAutomation:()=>runtime("resident.pause_automation","cancel"),resumeBackgroundSync:()=>runtime("resident.resume_sync","execute"),configureFreshRSS:configure("freshrss"),configureMiniflux:configure("miniflux"),configureMattermost:configure("mattermost"),configureWallabag:configure("wallabag"),configureCalcom:configure("calcom"),configureWakatime:configure("wakatime"),configureZulip:configure("zulip"),configureGoogleChat:configure("google-chat"),configureGoogleContacts:configure("google-contacts"),configureZendesk:configure("zendesk"),configureSalesforce:configure("salesforce"),configureBox:configure("box"),configureFront:configure("front"),configureHubSpot:configure("hubspot"),configureZoom:configure("zoom"),configureDropbox:configure("dropbox"),configureDiscord:configure("discord"),configureProtonMail:configure("proton-mail"),configureJoplin:configure("joplin"),configureThunderbird:configure("thunderbird"),configureNextcloud:configure("nextcloud"),configureFigma:configure("figma"),configureSmartsheet:configure("smartsheet"),configureFreshdesk:configure("freshdesk"),configureCopyQ:configure("copyq"),configureWeChat:configure("wechat"),configureOwnTracks:configure("owntracks"),configureZotero:configure("zotero"),connectManual:args=>connector("resident.connect_manual","connect",args[0]),reconnectSaved:args=>({...connector("resident.reconnect","connect",args[0]),selection:"saved"}),connectReadwiseMcpWrite:()=>connector("resident.connect_write","connect","readwise"),connectGmailWrite:()=>connector("resident.connect_write","connect","gmail"),connectReauthorize:args=>connector("resident.reauthorize","connect",args[0]),connectRecovery:args=>({...connector("resident.recover","connect",args[0]),selection:"recovery"}),connectAutomatic:args=>connector("resident.connect_automatic","connect",args[0]),connectorStatus:()=>connector("connector.status","status"),connectorRead:args=>connector("connector.read","read",args[0]),connectorCheck:args=>connector("resident.check","observe",args[0]),configureNativeFiles:args=>connector("resident.configure","execute",object(args[0])?args[0].source:void 0)};function signalFor(name,args){const index=name==="startup"?0:["gateway","check","invoke","reconnectSaved","connectorRead","connectorCheck","configureJoplin","connectGmailWrite","connectReadwiseMcpWrite"].includes(name)?1:["read","connect","connectManual","connectReauthorize","connectRecovery","connectAutomatic"].includes(name)?2:void 0;const value=name==="sync"&&object(args[2])?args[2].signal:index===void 0?void 0:args[index];return value instanceof AbortSignal?value:void 0}export function traceResidentControl(metrics,input,run,options={}){let enabled=false;try{enabled=metrics?.()?.isEnabled?.()===true}catch{}if(!enabled)return run();const step=startOperationalStep(metrics,input);const cancelled=()=>{try{return options.signal?.()?.aborted===true}catch{return false}};const finish=result=>{try{if(cancelled()){step.finish({state:"cancelled"});return}if(options.plainResult){step.finish({state:"completed"});return}if(!object(result)||!("ok"in result||"err"in result||"empty"in result)){step.finish({state:"unknown"});return}const value=object(result.ok)?result.ok:void 0,state=value?.state??(object(value?.status)?value.status.state:value?.status);if(["pending","queued","running","waiting","waiting-user","needs-user","needs_user","needs_you","AUTH_BLOCKED"].includes(String(state))){step.mark({state:"waiting"});step.finish({state:"unknown"});return}const outcome=usageOutcome(result);step.finish({state:outcome==="cancelled"?"cancelled":["fault","auth-blocked","invalid"].includes(outcome)?"failed":outcome==="unknown"?"unknown":"completed"})}catch{step.finish({state:"unknown"})}};const failed=()=>step.finish({state:cancelled()?"cancelled":"failed",errorCategory:"unknown"});return step.run(()=>{try{const result=run();if(isPromise(result))return result.then(value=>{finish(value);return value},error=>{failed();throw error});finish(result);return result}catch(error){failed();throw error}})}export function observeResidentHandlers(handlers){const observed={...handlers};for(const name of Object.keys(metadata)){const handler=handlers[name];if(!handler)continue;const wrapped=(...args)=>traceResidentControl(handlers.telemetry,()=>metadata[name](args),()=>Reflect.apply(handler,handlers,args),{signal:()=>signalFor(name,args)});Object.assign(observed,{[name]:wrapped})}return observed}
1
+ import{isPromise}from"node:util/types";import{startOperationalStep,usageOutcome}from"@zortexhq/plugin-telemetry/api";const object=value=>!!value&&typeof value==="object"&&!Array.isArray(value);const connector=(operationId,action,source)=>({phase:"connector",action,...operationId?{operationId}:{},...typeof source==="string"?{source}:{}});const configure=source=>()=>connector("resident.configure","execute",source);const runtime=(operationId,action)=>({phase:"runtime",action,...operationId?{operationId}:{}});const metadata={localCloud:args=>runtime("resident.local_cloud",object(args[0])&&args[0].action==="grants"?"status":"cancel"),gateway:args=>{const operation=object(args[0])&&typeof args[0].operation==="string"?args[0].operation:"unknown";const ids={search:"tool.search",actions:"tool.actions",action:"tool.action",manage:"tool.manage",instruction:"tool.instruction",handbook:"tool.handbook"};return{phase:"tool",action:"execute",operationId:ids[operation]??"unknown"}},ensureReady:args=>connector("resident.check","observe",args[0]),check:args=>connector("resident.check","observe",args[0]),read:args=>connector("connector.read","read",args[0]),sync:args=>connector("connector.sync","execute",args[0]),invoke:args=>connector("connector.invoke","invoke",object(args[0])?args[0].source:void 0),connect:args=>connector("resident.connect","connect",args[0]),connectJob:()=>connector("resident.connect_job","status"),cancelConnect:()=>connector("resident.cancel_connect","cancel"),pauseAutomation:()=>runtime("resident.pause_automation","cancel"),resumeBackgroundSync:()=>runtime("resident.resume_sync","execute"),configureFreshRSS:configure("freshrss"),configureMiniflux:configure("miniflux"),configureMattermost:configure("mattermost"),configureWallabag:configure("wallabag"),configureCalcom:configure("calcom"),configureWakatime:configure("wakatime"),configureZulip:configure("zulip"),configureGoogleChat:configure("google-chat"),configureGoogleContacts:configure("google-contacts"),configureZendesk:configure("zendesk"),configureSalesforce:configure("salesforce"),configureBox:configure("box"),configureFront:configure("front"),configureHubSpot:configure("hubspot"),configureZoom:configure("zoom"),configureDropbox:configure("dropbox"),configureDiscord:configure("discord"),configureProtonMail:configure("proton-mail"),configureJoplin:configure("joplin"),configureThunderbird:configure("thunderbird"),configureNextcloud:configure("nextcloud"),configureFigma:configure("figma"),configureSmartsheet:configure("smartsheet"),configureFreshdesk:configure("freshdesk"),configureCopyQ:configure("copyq"),configureWeChat:configure("wechat"),configureOwnTracks:configure("owntracks"),configureZotero:configure("zotero"),connectManual:args=>connector("resident.connect_manual","connect",args[0]),reconnectSaved:args=>({...connector("resident.reconnect","connect",args[0]),selection:"saved"}),connectReadwiseMcpWrite:()=>connector("resident.connect_write","connect","readwise"),connectGmailWrite:()=>connector("resident.connect_write","connect","gmail"),connectReauthorize:args=>connector("resident.reauthorize","connect",args[0]),connectRecovery:args=>({...connector("resident.recover","connect",args[0]),selection:"recovery"}),connectAutomatic:args=>connector("resident.connect_automatic","connect",args[0]),connectorStatus:()=>connector("connector.status","status"),connectorRead:args=>connector("connector.read","read",args[0]),connectorCheck:args=>connector("resident.check","observe",args[0]),configureNativeFiles:args=>connector("resident.configure","execute",object(args[0])?args[0].source:void 0)};function signalFor(name,args){const index=["gateway","ensureReady","check","invoke","reconnectSaved","connectorRead","connectorCheck","configureJoplin","connectGmailWrite","connectReadwiseMcpWrite"].includes(name)?1:["read","connect","connectManual","connectReauthorize","connectRecovery","connectAutomatic"].includes(name)?2:void 0;const value=name==="sync"&&object(args[2])?args[2].signal:index===void 0?void 0:args[index];return value instanceof AbortSignal?value:void 0}export function traceResidentControl(metrics,input,run,options={}){let enabled=false;try{enabled=metrics?.()?.isEnabled?.()===true}catch{}if(!enabled)return run();const step=startOperationalStep(metrics,input);const cancelled=()=>{try{return options.signal?.()?.aborted===true}catch{return false}};const finish=result=>{try{if(cancelled()){step.finish({state:"cancelled"});return}if(options.plainResult){step.finish({state:"completed"});return}if(!object(result)||!("ok"in result||"err"in result||"empty"in result)){step.finish({state:"unknown"});return}const value=object(result.ok)?result.ok:void 0,state=value?.state??(object(value?.status)?value.status.state:value?.status);if(["pending","queued","running","waiting","waiting-user","needs-user","needs_user","needs_you","AUTH_BLOCKED"].includes(String(state))){step.mark({state:"waiting"});step.finish({state:"unknown"});return}const outcome=usageOutcome(result);step.finish({state:outcome==="cancelled"?"cancelled":["fault","auth-blocked","invalid"].includes(outcome)?"failed":outcome==="unknown"?"unknown":"completed"})}catch{step.finish({state:"unknown"})}};const failed=()=>step.finish({state:cancelled()?"cancelled":"failed",errorCategory:"unknown"});return step.run(()=>{try{const result=run();if(isPromise(result))return result.then(value=>{finish(value);return value},error=>{failed();throw error});finish(result);return result}catch(error){failed();throw error}})}export function observeResidentHandlers(handlers){const observed={...handlers};for(const name of Object.keys(metadata)){const handler=handlers[name];if(!handler)continue;const wrapped=(...args)=>traceResidentControl(handlers.telemetry,()=>metadata[name](args),()=>Reflect.apply(handler,handlers,args),{signal:()=>signalFor(name,args)});Object.assign(observed,{[name]:wrapped})}return observed}
@@ -1 +1 @@
1
- export const HELP_CATALOG=[["solidworks","SOLIDWORKS"],["lattics","Lattics"],["jetbrains","JetBrains IDE projects"],["eclipse","Eclipse IDE"],["multisim","NI Multisim"],["stm32cubemx","STM32CubeMX"],["plecs","PLECS"],["visual-studio","Visual Studio solutions"],["modelsim","ModelSim exported waveforms"],["quartus","Intel Quartus"],["simulink","Simulink"],["jianying","Jianying Pro"],["epic-games-launcher","Epic Games Launcher manifests"],["ryujinx","Ryujinx play history"],["modrinth","Modrinth App"],["powerpoint","Microsoft PowerPoint presentations"],["ti-ccs","TI Code Composer Studio C2000"],["pscad","PSCAD projects"],["adobe-photoshop","Adobe Photoshop PSD"],["autocad","AutoCAD DXF"],["microsoft-word","Microsoft Word documents"],["microsoft-excel","Microsoft Excel workbooks"],["local-git","Local Git history"],["vscode-local-history","VS Code Local History"],["libreoffice","LibreOffice recent documents"],["adobe-acrobat","Adobe Acrobat recent PDFs"],["adobe-camera-raw","Adobe Camera Raw photo adjustments"],["adobe-media-encoder","Adobe Media Encoder encoding preferences"],["ansys-electronics-desktop","Ansys Electronics Desktop"],["adobe-premiere-pro","Adobe Premiere Pro"],["packet-tracer","Cisco Packet Tracer"],["qt-designer","Qt Designer"],["windows-event-viewer","Windows Event Viewer (System)"],["windows-task-scheduler","Windows Task Scheduler (Defrag)"],["wsl","WSL distributions"],["docker-desktop","Docker Desktop images"],["ollama","Ollama"],["hearthstone-deck-tracker","Hearthstone Deck Tracker"],["visio","Microsoft Visio diagrams"],["matlab","MATLAB workspace variables"],["adobe-illustrator","Adobe Illustrator artwork"],["minecraft-java","Minecraft Java worlds"],["ni-tdms","NI TDMS"],["jupyter","Jupyter Notebook"],["activitywatch","activitywatch"],["airtable","airtable"],["apple-music","Apple Music"],["apple-notes","Apple Notes"],["apple-reminders","Apple Reminders"],["appstore","App Store"],["asana","asana"],["basecamp","basecamp"],["box","box"],["calcom","Cal.com"],["calendly","calendly"],["canva","canva"],["chatgpt","ChatGPT"],["clickup","clickup"],["cloudflare","cloudflare"],["coda","coda"],["computer-files","\u96FB\u8166\u6A94\u6848"],["confluence","confluence"],["copyq","CopyQ"],["dingtalk","DingTalk / \u91D8\u91D8"],["discord","discord"],["dropbox","dropbox"],["facebook","facebook"],["fastmail","fastmail"],["figma","figma"],["freshdesk","freshdesk"],["freshrss","FreshRSS"],["front","front"],["ghost","ghost"],["github","GitHub"],["gitlab","GitLab"],["gmail","Gmail"],["google-calendar","Google Calendar"],["google-chat","Google Chat"],["google-chrome","Google Chrome"],["google-contacts","Google Contacts"],["google-drive","Google Drive"],["google-tasks","Google Tasks"],["harvest","harvest"],["hubspot","hubspot"],["imessage","iMessage"],["immich","immich"],["instagram","instagram"],["intercom","intercom"],["jira","jira"],["joplin","joplin"],["karakeep","karakeep"],["lark","Lark / \u98DB\u66F8"],["linear","linear"],["linkedin","LinkedIn"],["local-audio","\u672C\u6A5F\u97F3\u8A0A"],["logseq","logseq"],["mac-apt","Mac \u6D3B\u52D5\u7D00\u9304 / mac_apt"],["macos-contacts","macOS Contacts"],["matrix","matrix"],["mattermost","mattermost"],["microsoft-edge","Microsoft Edge"],["microsoft-planner","Microsoft Planner"],["microsoft-todo","Microsoft To Do"],["miniflux","miniflux"],["miro","miro"],["monday","monday"],["netease-mail","\u7DB2\u6613\u90F5\u7BB1"],["nextcloud","nextcloud"],["notebooklm","notebooklm"],["notion","notion"],["obsidian","obsidian"],["onedrive","onedrive"],["onenote","onenote"],["openrouter","openrouter"],["outlook","outlook"],["owntracks","OwnTracks"],["pipedrive","pipedrive"],["posthog","PostHog"],["proton-mail","proton-mail"],["railway","railway"],["raindrop","Raindrop"],["readwise","readwise"],["reddit","reddit"],["rednote","\u5C0F\u7D05\u66F8 / RedNote"],["salesforce","salesforce"],["sentry","sentry"],["sharepoint","sharepoint"],["shopify","shopify"],["slack","slack"],["smartsheet","smartsheet"],["spotify","spotify"],["steam","steam"],["stripe","stripe"],["supabase","supabase"],["teams","teams"],["telegram","telegram"],["thunderbird","thunderbird"],["ticktick","ticktick"],["tiktok","TikTok"],["todoist","todoist"],["toggl","Toggl Track"],["trello","trello"],["wakatime","wakatime"],["wallabag","wallabag"],["webflow","webflow"],["wechat","WeChat"],["whatsapp-web","WhatsApp Web"],["wordpress","wordpress"],["wrike","wrike"],["x","X / Twitter"],["youtube","YouTube"],["zendesk","zendesk"],["zoom","zoom"],["zotero","zotero"],["zulip","zulip"]];export function canonicalSource(source){return{"notion-l1":"notion","microsoft-teams":"teams"}[source]??source}
1
+ export const HELP_CATALOG=[["solidworks","SOLIDWORKS"],["lattics","Lattics"],["jetbrains","JetBrains IDE projects"],["eclipse","Eclipse IDE"],["multisim","NI Multisim"],["stm32cubemx","STM32CubeMX"],["plecs","PLECS"],["visual-studio","Visual Studio solutions"],["modelsim","ModelSim exported waveforms"],["quartus","Intel Quartus"],["simulink","Simulink"],["jianying","Jianying Pro"],["epic-games-launcher","Epic Games Launcher manifests"],["ryujinx","Ryujinx play history"],["modrinth","Modrinth App"],["powerpoint","Microsoft PowerPoint presentations"],["ti-ccs","TI Code Composer Studio C2000"],["pscad","PSCAD projects"],["adobe-photoshop","Adobe Photoshop PSD"],["autocad","AutoCAD DXF"],["microsoft-word","Microsoft Word documents"],["microsoft-excel","Microsoft Excel workbooks"],["local-git","Local Git history"],["vscode-local-history","VS Code Local History"],["libreoffice","LibreOffice recent documents"],["adobe-acrobat","Adobe Acrobat recent PDFs"],["adobe-camera-raw","Adobe Camera Raw photo adjustments"],["adobe-media-encoder","Adobe Media Encoder encoding preferences"],["ansys-electronics-desktop","Ansys Electronics Desktop"],["adobe-premiere-pro","Adobe Premiere Pro"],["packet-tracer","Cisco Packet Tracer"],["qt-designer","Qt Designer"],["windows-event-viewer","Windows Event Viewer (System)"],["windows-task-scheduler","Windows Task Scheduler (Defrag)"],["wsl","WSL distributions"],["docker-desktop","Docker Desktop images"],["ollama","Ollama"],["hearthstone-deck-tracker","Hearthstone Deck Tracker"],["visio","Microsoft Visio diagrams"],["matlab","MATLAB workspace variables"],["adobe-illustrator","Adobe Illustrator artwork"],["minecraft-java","Minecraft Java worlds"],["ni-tdms","NI TDMS"],["jupyter","Jupyter Notebook"],["activitywatch","activitywatch"],["airtable","airtable"],["apple-music","Apple Music"],["apple-notes","Apple Notes"],["apple-reminders","Apple Reminders"],["appstore","App Store"],["asana","asana"],["basecamp","basecamp"],["box","box"],["calcom","Cal.com"],["calendly","calendly"],["canva","canva"],["clickup","clickup"],["cloudflare","cloudflare"],["coda","coda"],["computer-files","\u96FB\u8166\u6A94\u6848"],["confluence","confluence"],["copyq","CopyQ"],["dingtalk","DingTalk / \u91D8\u91D8"],["discord","discord"],["dropbox","dropbox"],["facebook","facebook"],["fastmail","fastmail"],["figma","figma"],["freshdesk","freshdesk"],["freshrss","FreshRSS"],["front","front"],["ghost","ghost"],["github","GitHub"],["gitlab","GitLab"],["gmail","Gmail"],["google-calendar","Google Calendar"],["google-chat","Google Chat"],["google-chrome","Google Chrome"],["google-contacts","Google Contacts"],["google-drive","Google Drive"],["google-tasks","Google Tasks"],["harvest","harvest"],["hubspot","hubspot"],["imessage","iMessage"],["immich","immich"],["instagram","instagram"],["intercom","intercom"],["jira","jira"],["joplin","joplin"],["karakeep","karakeep"],["lark","Lark / \u98DB\u66F8"],["linear","linear"],["linkedin","LinkedIn"],["local-audio","\u672C\u6A5F\u97F3\u8A0A"],["logseq","logseq"],["mac-apt","Mac \u6D3B\u52D5\u7D00\u9304 / mac_apt"],["macos-contacts","macOS Contacts"],["matrix","matrix"],["mattermost","mattermost"],["microsoft-edge","Microsoft Edge"],["microsoft-planner","Microsoft Planner"],["microsoft-todo","Microsoft To Do"],["miniflux","miniflux"],["miro","miro"],["monday","monday"],["netease-mail","\u7DB2\u6613\u90F5\u7BB1"],["nextcloud","nextcloud"],["notebooklm","notebooklm"],["notion","notion"],["obsidian","obsidian"],["onedrive","onedrive"],["onenote","onenote"],["openrouter","openrouter"],["outlook","outlook"],["owntracks","OwnTracks"],["pipedrive","pipedrive"],["posthog","PostHog"],["proton-mail","proton-mail"],["railway","railway"],["raindrop","Raindrop"],["readwise","readwise"],["reddit","reddit"],["rednote","\u5C0F\u7D05\u66F8 / RedNote"],["salesforce","salesforce"],["sentry","sentry"],["sharepoint","sharepoint"],["shopify","shopify"],["slack","slack"],["smartsheet","smartsheet"],["spotify","spotify"],["steam","steam"],["stripe","stripe"],["supabase","supabase"],["teams","teams"],["telegram","telegram"],["thunderbird","thunderbird"],["ticktick","ticktick"],["tiktok","TikTok"],["todoist","todoist"],["toggl","Toggl Track"],["trello","trello"],["wakatime","wakatime"],["wallabag","wallabag"],["webflow","webflow"],["wechat","WeChat"],["whatsapp-web","WhatsApp Web"],["wordpress","wordpress"],["wrike","wrike"],["x","X / Twitter"],["youtube","YouTube"],["zendesk","zendesk"],["zoom","zoom"],["zotero","zotero"],["zulip","zulip"]];export function canonicalSource(source){return{"notion-l1":"notion","microsoft-teams":"teams"}[source]??source}
package/dist/startup.js CHANGED
@@ -1,2 +1 @@
1
- import{AUTOMATIC_ATTEMPTS,isTransientAutomatic}from"@zortexhq/plugin-auto-connect/api";import{createTraceRecorder,withStartupFeedbackFlow,startOperationalRun,startOperationalStep,operationalReason}from"@zortexhq/plugin-telemetry/api";import{configureNativeLevel1}from"./native-level1-setup.js";import{readRecoveryEvidence,readConnectionTimes,readinessTime,readinessAfterConnection}from"./recovery-evidence.js";import{randomUUID}from"node:crypto";import{setTimeout as delay}from"node:timers/promises";import{runningProductVersion}from"./update-telemetry.js";export const STARTUP_REQUEST_ID="initial-connect-v1";export const STARTUP_SOURCES=["google-chrome","microsoft-edge","gmail","google-drive","google-calendar","youtube","notion","slack","outlook","x","instagram","linkedin","whatsapp-web"];export const STARTUP_EXTRA_SOURCES=["steam","reddit","spotify","stripe","openrouter","netease-mail","shopify","calendly","activitywatch","cua"];export function startupSourceIds(installed){const ids=new Set(installed.map(row=>row.source));return[...new Set([...STARTUP_SOURCES,...STARTUP_EXTRA_SOURCES,...ids])].filter(source=>ids.has(source))}const MAX_FLEET_SOURCES=50;const sources=[...STARTUP_SOURCES,...STARTUP_EXTRA_SOURCES];const prioritizedSources=new Set(sources);const MAX_STARTUP_HISTORY=1e4;const startupRequestId=attempt=>attempt===0?STARTUP_REQUEST_ID:`${STARTUP_REQUEST_ID}-retry-${attempt}`;function selectedStartupSources(raw=process.env.ZORTEX_AUTO_CONNECT_SOURCES){if(raw===void 0||raw.trim()==="")return void 0;const values=raw.split(",").map(value=>value.trim());if(!values.length||values.some(value=>!/^[a-z][a-z0-9._-]{0,95}$/i.test(value)))throw Error("Invalid ZORTEX_AUTO_CONNECT_SOURCES.");return new Set(values)}export function isStartupRequestId(value){if(value===STARTUP_REQUEST_ID)return true;if(typeof value!=="string"||!value.startsWith(`${STARTUP_REQUEST_ID}-retry-`))return false;const attempt=Number(value.slice(`${STARTUP_REQUEST_ID}-retry-`.length));return Number.isSafeInteger(attempt)&&attempt>0&&attempt<MAX_STARTUP_HISTORY&&value===startupRequestId(attempt)}export function startupHistory(fleet){const receipts=[];let latest=fleet.receipt(STARTUP_REQUEST_ID);for(let attempt=0;attempt<MAX_STARTUP_HISTORY;attempt++){const result=attempt===0?latest:fleet.receipt(startupRequestId(attempt));if(!("ok"in result)){if(!("err"in result)||result.err.code!=="not_found")latest=result;break}latest=result;receipts.push(result.ok);if(result.ok.state==="running")break}if(receipts.length===MAX_STARTUP_HISTORY&&receipts.at(-1)?.state!=="running")latest={err:{code:"resource_exhausted",layer:"plugin",retryability:"non-retryable",message:"Startup receipt history requires explicit maintenance."}};return{latest,receipts}}export function latestStartupReceipt(fleet){return startupHistory(fleet).latest}export function selectStartupBatch(states,receipts,recoveredCompleted=new Set,recoveredFailed=new Set,connectionTimes=new Map){const latest=new Map;const connected=new Set(states.filter(row=>row.state==="connected").map(row=>row.source));const current=(receipt,row)=>{const time=readinessTime(row.progress?.endedAt)??readinessTime(receipt.endedAt);return time===void 0&&row.state!=="completed"||readinessAfterConnection(time,connected.has(row.source)?connectionTimes.get(row.source):void 0)};for(const receipt of receipts)for(const row of receipt.sources)if(current(receipt,row))latest.set(row.source,row);const completed=new Set([...latest.values()].filter(row=>row.state==="completed"&&connected.has(row.source)&&(Number.isSafeInteger(row.returned)&&row.returned>=0||row.readiness?.basis==="actions"&&Number.isSafeInteger(row.readiness.actions)&&row.readiness.actions>0)).map(row=>row.source));for(const source of recoveredCompleted)completed.add(source);for(const source of recoveredFailed)completed.delete(source);const attempts=new Map;for(const receipt of receipts)for(const source of new Set(receipt.sources.filter(row=>current(receipt,row)).map(row=>row.source)))attempts.set(source,(attempts.get(source)??0)+1);const eligible=new Set(states.filter(row=>row.state!=="unavailable"&&row.source!=="chrome-history"&&(prioritizedSources.has(row.source)||row.actions===true)).map(row=>row.source));const installed=[...new Set([...sources,...eligible])].filter(source=>eligible.has(source)&&!completed.has(source));installed.sort((a,b)=>Number(attempts.has(a))-Number(attempts.has(b))||Number(!connected.has(a))-Number(!connected.has(b)));return installed.slice(0,MAX_FLEET_SOURCES)}const hosts=new WeakMap;export function startInitialConnections(ctx,options={}){const enabled=options.enabled??!/^(0|false|off|no)$/i.test((process.env.ZORTEX_AUTO_CONNECT??"").trim());const existing=hosts.get(ctx);if(enabled&&existing)return existing;const lifetime=new AbortController;const runPass=resumeSource=>{const stop=new AbortController;const feedbackId=randomUUID(),startedAt=new Date().toISOString();let feedbackStarted=false,failed=false;let operational;const posthog=ctx.get("zortexPostHog");let feedbackQueue=Promise.resolve();let feedbackRoster,feedbackStart;const observe=async phase=>{if(!posthog)return;const task=feedbackQueue.then(async()=>{const{readOnboardingReport,onboardingCounts}=await import("./onboarding.js");const capture=async()=>{const signal=AbortSignal.timeout(750),statuses=await ctx.get("zortexConnectorHub")?.status({signal});if(!statuses||!("ok"in statuses))return;const installed=new Set([...statuses.ok.map(row=>row.source),...(ctx.get("zortexLevel1Connectors")?.pending??[]).map(row=>row.source)]);const selected=selectedStartupSources(),report=await readOnboardingReport(ctx,{enabled,signal});if(signal.aborted||report.state==="unavailable"||report.state==="cancelled")return;return report.sources.filter(row=>row.source!=="chrome-history"&&installed.has(row.source)&&(!selected||selected.has(row.source))&&(resumeSource===void 0||row.source===resumeSource))};let snapshotTimer;const snapshot=await Promise.race([capture().catch(()=>void 0),new Promise(resolve=>{snapshotTimer=setTimeout(()=>resolve(void 0),750)})]);clearTimeout(snapshotTimer);feedbackRoster??=snapshot?.map(row=>row.source)??[];const rows=feedbackRoster.map(source=>snapshot?.find(row=>row.source===source)??{source,connection:"unknown",read:"unknown"});const counts=onboardingCounts(rows),pending2=counts.setupRequired+counts.waiting+counts.needsUser+counts.notAttempted;const platform=["darwin","win32","linux"].includes(process.platform)?process.platform:"other";feedbackStart??={id:feedbackId,phase:"started",startedAt,observedAt:startedAt,version:await runningProductVersion??"unknown",platform,scope:resumeSource===void 0?"initial":"resume",requested:counts.total,connected:counts.ready,pending:pending2,failed:counts.failed+counts.unavailable,userActionRequired:counts.needsUser};await posthog.recordOnboardingAttempt(feedbackStart);if(phase==="started")return;const final=failed||!snapshot?"failed":counts.total>0&&counts.ready===counts.total?"completed":pending2>0?"blocked":"failed";await posthog.recordOnboardingAttempt({...feedbackStart,phase:final,observedAt:new Date(Math.max(Date.now(),Date.parse(startedAt))).toISOString(),connected:counts.ready,pending:pending2,failed:counts.failed+counts.unavailable,userActionRequired:counts.needsUser,durationMs:Math.max(0,Math.min(864e5,Date.now()-Date.parse(startedAt)))})});feedbackQueue=task.catch(()=>{});let timer;try{await Promise.race([feedbackQueue,new Promise(resolve=>{timer=setTimeout(resolve,1e3)})])}finally{clearTimeout(timer)}};const close=()=>stop.abort();lifetime.signal.addEventListener("abort",close,{once:true});if(lifetime.signal.aborted)close();return(async()=>{if(!enabled||stop.signal.aborted)return;let cancel=()=>{};const cancelled=new Promise(resolve=>{cancel=resolve;stop.signal.addEventListener("abort",cancel,{once:true})});try{await Promise.race([ctx.get("loader")?.await(),cancelled])}finally{stop.signal.removeEventListener("abort",cancel)}if(stop.signal.aborted)return;operational=startOperationalRun(()=>ctx.get("zortexTelemetry"),{runId:feedbackId,source:"autopilot",phase:"onboarding",action:"execute",...resumeSource===void 0?{}:{selection:"recovery"},trigger:resumeSource===void 0?"automatic_startup":"recovery"});return operational.run(async()=>{feedbackStarted=true;await observe("started");const selected=selectedStartupSources();const nativeSources=["google-chrome","microsoft-edge","activitywatch"].filter(source=>(resumeSource===void 0||resumeSource===source)&&(!selected||selected.has(source)));const loader=ctx.get("loader"),vault=ctx.get("zortexVaultStore");const prepareNative=options.prepareNative??(loader&&vault?sources2=>configureNativeLevel1(ctx,{sources:sources2}):void 0);if(prepareNative)for(const source of nativeSources){if(stop.signal.aborted)return;try{await prepareNative([source])}catch{process.stderr.write(`indra: native setup source=${source} did not complete; continuing other sources.
2
- `)}}if(stop.signal.aborted)return;const fleet=ctx.get("indraFleet"),hub=ctx.get("zortexConnectorHub");if(!fleet||!hub)return;let{latest:prior,receipts}=startupHistory(fleet);if(!("ok"in prior)&&(!("err"in prior)||prior.err.code!=="not_found"))throw Error("Startup receipt unavailable.");if("ok"in prior&&prior.ok.state==="running")return prior;const states=await hub.status({signal:stop.signal});if(stop.signal.aborted)return;if(!("ok"in states))throw Error("Source status unavailable.");const connectedSources=new Set(states.ok.filter(row=>row.state==="connected").map(row=>row.source));const connectionTimes=await readConnectionTimes(ctx,[...connectedSources]);if(stop.signal.aborted)return;const latestAttemptTimes=new Map;for(const receipt of receipts)for(const row of receipt.sources){const time=readinessTime(row.progress?.endedAt)??readinessTime(receipt.endedAt);if(time!==void 0)latestAttemptTimes.set(row.source,Math.max(time,latestAttemptTimes.get(row.source)??-Infinity))}const recoveredCompleted=new Set,recoveredFailed=new Set;for(const[source,saved]of readRecoveryEvidence(ctx,states.ok.map(row=>row.source))){const time=readinessTime(saved.updatedAt);if(time!==void 0&&(latestAttemptTimes.get(source)??-Infinity)>time)continue;if(!(time===void 0&&saved.read==="failed")&&!readinessAfterConnection(time,connectionTimes.get(source)))continue;if(saved.read==="failed")recoveredFailed.add(source);else if(connectedSources.has(source))recoveredCompleted.add(source)}const attempted=new Set;let previousAttempt=-1;let result;while(!stop.signal.aborted){const batch=selectStartupBatch(states.ok.filter(row=>!attempted.has(row.source)&&(!selected||selected.has(row.source))&&(resumeSource===void 0||row.source===resumeSource&&row.state==="connected")),receipts,recoveredCompleted,recoveredFailed,connectionTimes);if(!batch.length)return result??("ok"in prior?prior:void 0);const stateBySource=new Map(states.ok.map(row=>[row.source,row]));batch.sort((a,b)=>Number(stateBySource.get(a)?.state!=="connected"&&stateBySource.get(a)?.auth!=="none")-Number(stateBySource.get(b)?.state!=="connected"&&stateBySource.get(b)?.auth!=="none"));if(receipts.length<=previousAttempt)throw Error("Startup receipt did not advance.");if(!options.connect)throw Error("resident_connect_port_required");previousAttempt=receipts.length;const attemptId=startupRequestId(receipts.length);result=await fleet.run({requestId:attemptId,sources:batch,connect:false,read:{limit:1}},{signal:stop.signal,origin:"startup",mode:"readiness",retention:"transient",stopOnPrepareFailure:false,prepare:async(source,signal)=>{const selection=startOperationalStep(()=>ctx.get("zortexTelemetry"),{source,phase:"onboarding",action:"source_selection",selection:resumeSource!==void 0?"recovery":selected?"requested":"default_roster",trigger:resumeSource===void 0?"automatic_startup":"recovery"});selection.finish({state:"completed"});return selection.run(async()=>{if(connectedSources.has(source))return{ok:void 0};for(let attempt=0;attempt<AUTOMATIC_ATTEMPTS;attempt++){const requestId=`${attemptId}:connect:${source}${attempt?`:attempt-${attempt+1}`:""}`;const connection=startOperationalStep(()=>ctx.get("zortexTelemetry"),{source,phase:"onboarding",action:"connect",attempt:attempt+1,trigger:resumeSource===void 0?"automatic_startup":"recovery"});let connected;try{connected=await connection.run(()=>options.connect(source,requestId,signal,{automatic:true}));while("ok"in connected&&connected.ok.state==="waiting-user"&&connected.ok.automationActive&&options.job){await delay(100,void 0,{signal});connected=await options.job(requestId,signal)}if("ok"in connected&&connected.ok.state==="waiting-user")connection.mark({state:"waiting",reason:operationalReason(connected.ok.error?.code??"login_required")});connection.finish({state:"ok"in connected&&connected.ok.state==="connected"?"completed":signal.aborted||"ok"in connected&&connected.ok.state==="cancelled"?"cancelled":"ok"in connected&&connected.ok.state==="waiting-user"?"unknown":"failed",..."ok"in connected&&connected.ok.state==="connected"?{}:{reason:operationalReason("err"in connected?connected.err.code:connected.ok.error?.code)}})}catch{connection.finish({state:signal.aborted?"cancelled":"failed",reason:signal.aborted?"cancelled":"provider_failure"});return{err:{code:signal.aborted?"aborted":"unavailable",message:"Source authorization did not complete."}}}if("ok"in connected&&connected.ok.state==="connected")return{ok:void 0,connectionState:"connected",newlyConnected:true};if(!signal.aborted){const refreshed=await hub.status({signal});if("ok"in refreshed&&refreshed.ok.some(row=>row.source===source&&row.state==="connected"))return{ok:void 0,connectionState:"connected",newlyConnected:true}}const code="err"in connected?connected.err.code:connected.ok.error?.code??(connected.ok.state==="cancelled"?"aborted":connected.ok.state==="waiting-user"?"login_required":"unavailable");if("ok"in connected&&connected.ok.state==="waiting-user")return{err:{code,message:"The existing source authorization remains available for continuation."}};if(signal.aborted||attempt+1>=AUTOMATIC_ATTEMPTS||!isTransientAutomatic(code))return{err:{code,message:"Source authorization did not complete."}}}return{err:{code:"unavailable",message:"Source authorization did not complete."}}})}});if(!("ok"in result)||result.ok.state==="running"||result.ok.state==="cancelled")return result;const observed=result.ok.sources.filter(row=>batch.includes(row.source));if(!observed.length)throw Error("Startup receipt made no source progress.");for(const row of observed)attempted.add(row.source);({latest:prior,receipts}=startupHistory(fleet));if(!("ok"in prior)&&(!("err"in prior)||prior.err.code!=="not_found"))throw Error("Startup receipt unavailable.");if("ok"in prior&&prior.ok.state==="running")return prior}return result})})().then(result=>{if(stop.signal.aborted)operational?.finish({state:"cancelled",reason:"cancelled"});else if(result&&"ok"in result)operational?.finish({state:result.ok.state==="completed"?"completed":result.ok.state==="cancelled"?"cancelled":result.ok.state==="running"?"unknown":"failed"});else operational?.finish({state:feedbackStarted?"unknown":"cancelled",...feedbackStarted?{}:{reason:"cancelled"}});return result}).catch(async()=>{failed=true;operational?.finish({state:"failed",reason:"job_unavailable"});process.stderr.write("indra: initial connection pass could not complete; inspect startup status.\n");await withStartupFeedbackFlow("other",()=>createTraceRecorder(()=>ctx.get("zortexTelemetry"),"other").step("startup_failed","failed",{reason:"job_unavailable"}))}).finally(async()=>{lifetime.signal.removeEventListener("abort",close);if(feedbackStarted)await observe("terminal")})};let tail=runPass();const pending=new Map;const handle={get done(){return tail},wait(options2={}){const timeoutMs=options2.timeoutMs??3e4;if(!Number.isSafeInteger(timeoutMs)||timeoutMs<1||timeoutMs>3e4)return Promise.resolve({err:{code:"invalid_argument"}});if(options2.signal?.aborted)return Promise.resolve({err:{code:"aborted"}});return new Promise(resolve=>{let finished=false;const finish=value=>{if(finished)return;finished=true;clearTimeout(timer);options2.signal?.removeEventListener("abort",cancel);resolve(value)};const cancel=()=>finish({err:{code:"aborted"}}),timer=setTimeout(()=>finish({ok:{state:"running"}}),timeoutMs);options2.signal?.addEventListener("abort",cancel,{once:true});void(async()=>{let current,result;do{current=tail;result=await current}while(current!==tail);finish(result)})().catch(()=>finish({err:{code:"unavailable"}}))})},resume(source){if(!enabled||lifetime.signal.aborted||typeof source!=="string"||!/^[a-z][a-z0-9._-]{0,95}$/i.test(source))return Promise.resolve();const queued=pending.get(source);if(queued)return queued;const task=tail.then(()=>runPass(source));pending.set(source,task);tail=task;void task.then(()=>pending.delete(source),()=>pending.delete(source));return task},async close(){lifetime.abort();await tail;if(hosts.get(ctx)===handle)hosts.delete(ctx)}};if(enabled)hosts.set(ctx,handle);return handle}
1
+ export const STARTUP_REQUEST_ID="initial-connect-v1";export const STARTUP_SOURCES=["google-chrome","microsoft-edge","gmail","google-drive","google-calendar","youtube","notion","slack","outlook","x","instagram","linkedin","whatsapp-web"];export const STARTUP_EXTRA_SOURCES=["steam","reddit","spotify","stripe","openrouter","netease-mail","shopify","calendly","activitywatch","cua"];export function startupSourceIds(installed){const ids=new Set(installed.map(row=>row.source));return[...new Set([...STARTUP_SOURCES,...STARTUP_EXTRA_SOURCES,...ids])].filter(source=>ids.has(source))}const MAX_STARTUP_HISTORY=1e4;const startupRequestId=attempt=>attempt===0?STARTUP_REQUEST_ID:`${STARTUP_REQUEST_ID}-retry-${attempt}`;export function isStartupRequestId(value){if(value===STARTUP_REQUEST_ID)return true;if(typeof value!=="string"||!value.startsWith(`${STARTUP_REQUEST_ID}-retry-`))return false;const attempt=Number(value.slice(`${STARTUP_REQUEST_ID}-retry-`.length));return Number.isSafeInteger(attempt)&&attempt>0&&attempt<MAX_STARTUP_HISTORY&&value===startupRequestId(attempt)}export function startupHistory(fleet){const receipts=[];let latest=fleet.receipt(STARTUP_REQUEST_ID);for(let attempt=0;attempt<MAX_STARTUP_HISTORY;attempt++){const result=attempt===0?latest:fleet.receipt(startupRequestId(attempt));if(!("ok"in result)){if(!("err"in result)||result.err.code!=="not_found")latest=result;break}latest=result;receipts.push(result.ok);if(result.ok.state==="running")break}if(receipts.length===MAX_STARTUP_HISTORY&&receipts.at(-1)?.state!=="running")latest={err:{code:"resource_exhausted",layer:"plugin",retryability:"non-retryable",message:"Startup receipt history requires explicit maintenance."}};return{latest,receipts}}export function latestStartupReceipt(fleet){return startupHistory(fleet).latest}
@@ -1 +1 @@
1
- import{isBrowserSource,locateBrowserProfile}from"@zortexhq/plugin-connector-chrome-history";import{Original}from"@zortexhq/plugin-connector-framework/api";import{join,resolve}from"node:path";import{createHash}from"node:crypto";import{fileURLToPath}from"node:url";import{createTraceRecorder,withFeedbackFlow}from"@zortexhq/plugin-telemetry/api";import{createSyncObservation}from"./operational-observation.js";const error=(code,message,layer="connector")=>Original.errResult({code,layer,retryability:"non-retryable",message});async function executeChrome(ctx,root,requestId,observation,options={}){const access=ctx.get("zortexLocalSourceAccess"),supervisor=ctx.get("zortexConnectorSupervisor"),journal=ctx.get("zortexConnectorProcessJournal");if(!access||!supervisor||!journal)return error("failed_precondition","Original synchronization services are unavailable.","kernel");const selected=access.resolve("chrome-history");if(!Original.isOk(selected))return selected;let outcome;try{outcome=await supervisor.execute({requestId,stateDir:join(root,"sync-state","chrome-history",selected.ok.grant.id),argv:[process.execPath,fileURLToPath(new URL("./connector-worker.js",import.meta.url)),resolve(root),fileURLToPath(new URL("../profiles/chrome-worker.yml",import.meta.url)),"chrome-history"],cwd:resolve(root),env:{ZORTEX_SELECTED_LOCAL_SOURCE_DIRECTORY:selected.ok.location}},options)}catch{return error("failed_precondition","Connector service did not admit or execute this request.","kernel")}let business;try{business=journal.readBusiness(outcome.runId)}catch(fault){await observation.admitted(outcome,null);throw fault}await observation.admitted(outcome,business);if(!outcome.cleanupConfirmed)return error("failed_precondition","Process cleanup remains unverified.");if(outcome.phase==="cancelled")return error("aborted","Connector sync was cancelled.");if(outcome.phase==="timed-out")return error("deadline_exceeded","Connector sync exceeded its execution budget.");if(!business||business.source!=="chrome-history")return error("data_loss","Worker has no committed source business receipt.");if(!Original.isOk(business.result))return business.result;if(business.result.ok.error!==void 0){const fault=Original.validateStructuredError(business.result.ok.error);return Original.isOk(fault)?Original.errResult(fault.ok):error("data_loss","Invalid structured worker error.")}if(outcome.phase!=="completed"||business.result.ok.runFailed===true||business.result.ok.stopped===true||business.result.ok.state!=="IDLE")return error("unavailable","Connector worker did not complete the source operation.");return Original.ok({...business.result.ok,executionId:outcome.runId,codeVersion:business.codeVersion})}const WORKERS={gmail:{provider:"google",profile:"google-worker.yml"},"google-drive":{provider:"google",profile:"google-worker.yml"},"google-calendar":{provider:"google",profile:"google-worker.yml"},youtube:{provider:"google",profile:"google-worker.yml"},slack:{provider:"slack",profile:"account-worker.yml"},outlook:{provider:"microsoft",profile:"account-worker.yml"},x:{provider:"x",profile:"social-worker.yml"},instagram:{provider:"instagram",profile:"social-worker.yml"},"google-chrome":{provider:"local",profile:"browser-worker.yml"},"microsoft-edge":{provider:"local",profile:"browser-worker.yml"}};export const WORKER_SYNC_SOURCES=Object.keys(WORKERS);export const isWorkerSyncSource=source=>typeof source==="string"&&Object.hasOwn(WORKERS,source);const browserLocator=source=>{const root=source==="google-chrome"?process.env.INDRA_CHROME_READ_ROOT??process.env.ZORTEX_CHROME_HISTORY_ROOT:process.env.INDRA_EDGE_READ_ROOT??process.env.ZORTEX_EDGE_HISTORY_ROOT;return root?{root}:{}};export function browserReady(source){return WORKERS[source].provider==="local"&&isBrowserSource(source)&&Original.isOk(locateBrowserProfile(source,browserLocator(source)))}const SOURCE_PLUGIN={x:"social",instagram:"social"};export function sourceActive(ctx,source){const id="indra-source-"+(SOURCE_PLUGIN[source]??source),row=[...ctx.loader.entries()].find(entry=>entry.options.id===id);return!!row&&!row.disabled&&row.fiber?.state===2}const SYNC_HARD_LIMIT_MS=6e5,SYNC_BUDGET_MS=54e4;async function executeWorkerSource(ctx,root,source,requestId,observation,options={}){const vault=ctx.get("zortexVaultStore"),supervisor=ctx.get("zortexConnectorSupervisor"),journal=ctx.get("zortexConnectorProcessJournal");if(!vault||!supervisor||!journal)return error("failed_precondition","Source sync services are unavailable.","kernel");const worker=WORKERS[source];let key,browserRoot;if(worker.provider==="local"){if(!isBrowserSource(source))return error("invalid_argument","Unknown browser source.");const found=locateBrowserProfile(source,browserLocator(source));if(!Original.isOk(found))return found;browserRoot=found.ok.userDataDir;key=createHash("sha256").update(JSON.stringify({source,account:"local"})).digest("hex").slice(0,32)}else if(options.bindingId){const selected=await vault.bindingCustody.resolve({kind:"binding",bindingId:options.bindingId});if(!Original.isOk(selected))return selected;if(selected.ok.kind!=="resolved")return error("failed_precondition","Select one connected account binding before full sync.","auth");const binding=selected.ok.binding;if(binding.identity.source!==source||binding.state!=="connected"||binding.provider!==worker.provider)return error("unauthenticated","Connect and verify this account before full sync.","auth");const grant=await vault.bindingCustody.grantForBinding(binding.id,"L1",binding.provider);if(!Original.isOk(grant))return grant;if(!grant.ok||grant.ok.state!=="active"||options.grantId&&grant.ok.id!==options.grantId||options.scopeEpoch!==void 0&&grant.ok.scopeEpoch!==options.scopeEpoch)return error("permission_denied","Selected account authority changed before full sync.","auth");key=createHash("sha256").update(JSON.stringify({source,binding:binding.id,account:binding.identity.subject,epoch:binding.updatedAt,grant:grant.ok.id,scopeEpoch:grant.ok.scopeEpoch})).digest("hex").slice(0,32);options={...options,bindingId:binding.id,grantId:grant.ok.id,scopeEpoch:grant.ok.scopeEpoch}}else{const selected=await vault.connection(source);if(!Original.isOk(selected))return selected;const connection=selected.ok,account=connection?.accountId??connection?.account;if(!connection||connection.state!=="connected"||connection.provider!==worker.provider||!account||!connection.updatedAt)return error("unauthenticated","Connect and verify this account before full sync.","auth");key=createHash("sha256").update(JSON.stringify({source,account,epoch:connection.updatedAt})).digest("hex").slice(0,32)}let outcome;try{outcome=await supervisor.execute({requestId,stateDir:join(root,"sync-state",source,key),argv:[process.execPath,fileURLToPath(new URL("./connector-worker.js",import.meta.url)),resolve(root),fileURLToPath(new URL("../profiles/"+worker.profile,import.meta.url)),source],cwd:resolve(root),env:{ZORTEX_PROCESS_CODE_VERSION:"indra-v2/"+source+"@0.1.0+full-sync",...worker.provider==="local"?{ZORTEX_BROWSER_SOURCE:source,ZORTEX_BROWSER_READ_ROOT:browserRoot}:{},...options.bindingId?{ZORTEX_SELECTED_BINDING_ID:options.bindingId}:{},...options.grantId?{ZORTEX_SELECTED_GRANT_ID:options.grantId}:{},...options.scopeEpoch!==void 0?{ZORTEX_SELECTED_SCOPE_EPOCH:String(options.scopeEpoch)}:{},ZORTEX_SYNC_BUDGET_MS:String(SYNC_BUDGET_MS)}},{...options.signal?{signal:options.signal}:{},runMs:SYNC_HARD_LIMIT_MS})}catch{return Original.errResult({code:"resource_exhausted",layer:"kernel",retryability:"transient",message:"Another sync of this source is running, or its previous worker was not confirmed stopped; try again later."})}let receipt;try{receipt=journal.readBusiness(outcome.runId)}catch(fault){await observation.admitted(outcome,null,options.bindingId);throw fault}await observation.admitted(outcome,receipt,options.bindingId);if(!outcome.cleanupConfirmed)return error("failed_precondition","Process cleanup remains unverified.","kernel");if(outcome.phase==="cancelled")return error("aborted","Sync was cancelled.");if(outcome.phase==="timed-out")return error("deadline_exceeded","Sync reached its execution limit; the next run resumes from the saved cursor.");if(!receipt||receipt.source!==source)return error("data_loss","Sync worker has no committed source business receipt.");if(!Original.isOk(receipt.result))return receipt.result;if(receipt.result.ok.error!==void 0){const fault=Original.validateStructuredError(receipt.result.ok.error);return Original.isOk(fault)?Original.errResult(fault.ok):error("data_loss","Invalid sync worker error.")}if(receipt.result.ok.ran===false&&receipt.result.ok.state==="RETRY_WAIT"&&typeof receipt.result.ok.skipped==="string")return Original.errResult({code:"unavailable",layer:"connector",retryability:"transient",message:`Sync is waiting to retry after an earlier provider failure; run it again later (${receipt.result.ok.skipped.slice(0,300)}).`});if(outcome.phase!=="completed"||receipt.result.ok.runFailed===true)return error("unavailable","Sync worker did not finish its source operation.");return Original.ok({...receipt.result.ok,executionId:outcome.runId,codeVersion:receipt.codeVersion,complete:receipt.result.ok.state==="IDLE"&&receipt.result.ok.stopped!==true})}async function observeSync(ctx,source,requestId,action){const run=()=>withFeedbackFlow(source,async()=>{const observation=createSyncObservation(ctx,source,requestId);const trace=createTraceRecorder(()=>ctx.get("zortexTelemetry"),source);await trace.step("read_started","started");try{const result=await action(observation);await observation.notAdmitted(result);const value=result;if(value.err)await trace.step("read_verified",value.err.code==="aborted"?"cancelled":"failed",{error:value.err.code==="deadline_exceeded"?"timeout":"provider"});else if(value.ok){await trace.step("read_verified",value.ok.complete===false?"unknown":"completed");const count=value.ok.appended;if(typeof count==="number"&&Number.isSafeInteger(count)&&count>=0&&count<=1e8)await trace.step("vault_saved","completed",{count})}else await trace.step("read_verified","unknown");return result}catch(error2){await observation.notAdmitted(void 0);await trace.step("read_verified","failed",{error:"unknown"});throw error2}});const feedback=ctx.get("zortexConnectionFeedback");return feedback?feedback.run(source,run):run()}export function runSupervisedChrome(ctx,root,requestId,options={}){return observeSync(ctx,"chrome-history",requestId,observation=>executeChrome(ctx,root,requestId,observation,options))}export function runSupervisedSource(ctx,root,source,requestId,options={}){return observeSync(ctx,source,requestId,observation=>executeWorkerSource(ctx,root,source,requestId,observation,options))}export const runSupervisedGoogle=runSupervisedSource;
1
+ import{isBrowserSource,locateBrowserProfile}from"@zortexhq/plugin-connector-chrome-history";import{Original}from"@zortexhq/plugin-connector-framework/api";import{join,resolve}from"node:path";import{createHash}from"node:crypto";import{fileURLToPath}from"node:url";import{createTraceRecorder,withFeedbackFlow}from"@zortexhq/plugin-telemetry/api";import{createSyncObservation}from"./operational-observation.js";const error=(code,message,layer="connector")=>Original.errResult({code,layer,retryability:"non-retryable",message});async function executeChrome(ctx,root,requestId,observation,options={}){const access=ctx.get("zortexLocalSourceAccess"),supervisor=ctx.get("zortexConnectorSupervisor"),journal=ctx.get("zortexConnectorProcessJournal");if(!access||!supervisor||!journal)return error("failed_precondition","Original synchronization services are unavailable.","kernel");const selected=access.resolve("chrome-history");if(!Original.isOk(selected))return selected;let outcome;try{outcome=await supervisor.execute({requestId,stateDir:join(root,"sync-state","chrome-history",selected.ok.grant.id),argv:[process.execPath,fileURLToPath(new URL("./connector-worker.js",import.meta.url)),resolve(root),fileURLToPath(new URL("../profiles/chrome-worker.yml",import.meta.url)),"chrome-history"],cwd:resolve(root),env:{ZORTEX_SELECTED_LOCAL_SOURCE_DIRECTORY:selected.ok.location}},options)}catch{return error("failed_precondition","Connector service did not admit or execute this request.","kernel")}let business;try{business=journal.readBusiness(outcome.runId)}catch(fault){await observation.admitted(outcome,null);throw fault}await observation.admitted(outcome,business);if(!outcome.cleanupConfirmed)return error("failed_precondition","Process cleanup remains unverified.");if(outcome.phase==="cancelled")return error("aborted","Connector sync was cancelled.");if(outcome.phase==="timed-out")return error("deadline_exceeded","Connector sync exceeded its execution budget.");if(!business||business.source!=="chrome-history")return error("data_loss","Worker has no committed source business receipt.");if(!Original.isOk(business.result))return business.result;if(business.result.ok.error!==void 0){const fault=Original.validateStructuredError(business.result.ok.error);return Original.isOk(fault)?Original.errResult(fault.ok):error("data_loss","Invalid structured worker error.")}if(outcome.phase!=="completed"||business.result.ok.runFailed===true||business.result.ok.stopped===true||business.result.ok.state!=="IDLE")return error("unavailable","Connector worker did not complete the source operation.");return Original.ok({...business.result.ok,executionId:outcome.runId,codeVersion:business.codeVersion})}const WORKERS={gmail:{provider:"google",profile:"google-worker.yml"},"google-drive":{provider:"google",profile:"google-worker.yml"},"google-calendar":{provider:"google",profile:"google-worker.yml"},youtube:{provider:"google",profile:"google-worker.yml"},slack:{provider:"slack",profile:"account-worker.yml"},outlook:{provider:"microsoft",profile:"account-worker.yml"},"google-chrome":{provider:"local",profile:"browser-worker.yml"},"microsoft-edge":{provider:"local",profile:"browser-worker.yml"}};export const WORKER_SYNC_SOURCES=Object.keys(WORKERS);export const isWorkerSyncSource=source=>typeof source==="string"&&Object.hasOwn(WORKERS,source);const browserLocator=source=>{const root=source==="google-chrome"?process.env.INDRA_CHROME_READ_ROOT??process.env.ZORTEX_CHROME_HISTORY_ROOT:process.env.INDRA_EDGE_READ_ROOT??process.env.ZORTEX_EDGE_HISTORY_ROOT;return root?{root}:{}};export function browserReady(source){return WORKERS[source].provider==="local"&&isBrowserSource(source)&&Original.isOk(locateBrowserProfile(source,browserLocator(source)))}export function sourceActive(ctx,source){const id="indra-source-"+source,row=[...ctx.loader.entries()].find(entry=>entry.options.id===id);return!!row&&!row.disabled&&row.fiber?.state===2}const SYNC_HARD_LIMIT_MS=6e5,SYNC_BUDGET_MS=54e4;async function executeWorkerSource(ctx,root,source,requestId,observation,options={}){const vault=ctx.get("zortexVaultStore"),supervisor=ctx.get("zortexConnectorSupervisor"),journal=ctx.get("zortexConnectorProcessJournal");if(!vault||!supervisor||!journal)return error("failed_precondition","Source sync services are unavailable.","kernel");const worker=WORKERS[source];let key,browserRoot;if(worker.provider==="local"){if(!isBrowserSource(source))return error("invalid_argument","Unknown browser source.");const found=locateBrowserProfile(source,browserLocator(source));if(!Original.isOk(found))return found;browserRoot=found.ok.userDataDir;key=createHash("sha256").update(JSON.stringify({source,account:"local"})).digest("hex").slice(0,32)}else if(options.bindingId){const selected=await vault.bindingCustody.resolve({kind:"binding",bindingId:options.bindingId});if(!Original.isOk(selected))return selected;if(selected.ok.kind!=="resolved")return error("failed_precondition","Select one connected account binding before full sync.","auth");const binding=selected.ok.binding;if(binding.identity.source!==source||binding.state!=="connected"||binding.provider!==worker.provider)return error("unauthenticated","Connect and verify this account before full sync.","auth");const grant=await vault.bindingCustody.grantForBinding(binding.id,"L1",binding.provider);if(!Original.isOk(grant))return grant;if(!grant.ok||grant.ok.state!=="active"||options.grantId&&grant.ok.id!==options.grantId||options.scopeEpoch!==void 0&&grant.ok.scopeEpoch!==options.scopeEpoch)return error("permission_denied","Selected account authority changed before full sync.","auth");key=createHash("sha256").update(JSON.stringify({source,binding:binding.id,account:binding.identity.subject,epoch:binding.updatedAt,grant:grant.ok.id,scopeEpoch:grant.ok.scopeEpoch})).digest("hex").slice(0,32);options={...options,bindingId:binding.id,grantId:grant.ok.id,scopeEpoch:grant.ok.scopeEpoch}}else{const selected=await vault.connection(source);if(!Original.isOk(selected))return selected;const connection=selected.ok,account=connection?.accountId??connection?.account;if(!connection||connection.state!=="connected"||connection.provider!==worker.provider||!account||!connection.updatedAt)return error("unauthenticated","Connect and verify this account before full sync.","auth");key=createHash("sha256").update(JSON.stringify({source,account,epoch:connection.updatedAt})).digest("hex").slice(0,32)}let outcome;try{outcome=await supervisor.execute({requestId,stateDir:join(root,"sync-state",source,key),argv:[process.execPath,fileURLToPath(new URL("./connector-worker.js",import.meta.url)),resolve(root),fileURLToPath(new URL("../profiles/"+worker.profile,import.meta.url)),source],cwd:resolve(root),env:{ZORTEX_PROCESS_CODE_VERSION:"indra-v2/"+source+"@0.1.0+full-sync",...worker.provider==="local"?{ZORTEX_BROWSER_SOURCE:source,ZORTEX_BROWSER_READ_ROOT:browserRoot}:{},...options.bindingId?{ZORTEX_SELECTED_BINDING_ID:options.bindingId}:{},...options.grantId?{ZORTEX_SELECTED_GRANT_ID:options.grantId}:{},...options.scopeEpoch!==void 0?{ZORTEX_SELECTED_SCOPE_EPOCH:String(options.scopeEpoch)}:{},ZORTEX_SYNC_BUDGET_MS:String(SYNC_BUDGET_MS)}},{...options.signal?{signal:options.signal}:{},runMs:SYNC_HARD_LIMIT_MS})}catch{return Original.errResult({code:"resource_exhausted",layer:"kernel",retryability:"transient",message:"Another sync of this source is running, or its previous worker was not confirmed stopped; try again later."})}let receipt;try{receipt=journal.readBusiness(outcome.runId)}catch(fault){await observation.admitted(outcome,null,options.bindingId);throw fault}await observation.admitted(outcome,receipt,options.bindingId);if(!outcome.cleanupConfirmed)return error("failed_precondition","Process cleanup remains unverified.","kernel");if(outcome.phase==="cancelled")return error("aborted","Sync was cancelled.");if(outcome.phase==="timed-out")return error("deadline_exceeded","Sync reached its execution limit; the next run resumes from the saved cursor.");if(!receipt||receipt.source!==source)return error("data_loss","Sync worker has no committed source business receipt.");if(!Original.isOk(receipt.result))return receipt.result;if(receipt.result.ok.error!==void 0){const fault=Original.validateStructuredError(receipt.result.ok.error);return Original.isOk(fault)?Original.errResult(fault.ok):error("data_loss","Invalid sync worker error.")}if(receipt.result.ok.ran===false&&receipt.result.ok.state==="RETRY_WAIT"&&typeof receipt.result.ok.skipped==="string")return Original.errResult({code:"unavailable",layer:"connector",retryability:"transient",message:`Sync is waiting to retry after an earlier provider failure; run it again later (${receipt.result.ok.skipped.slice(0,300)}).`});if(outcome.phase!=="completed"||receipt.result.ok.runFailed===true)return error("unavailable","Sync worker did not finish its source operation.");return Original.ok({...receipt.result.ok,executionId:outcome.runId,codeVersion:receipt.codeVersion,complete:receipt.result.ok.state==="IDLE"&&receipt.result.ok.stopped!==true})}async function observeSync(ctx,source,requestId,action){const run=()=>withFeedbackFlow(source,async()=>{const observation=createSyncObservation(ctx,source,requestId);const trace=createTraceRecorder(()=>ctx.get("zortexTelemetry"),source);await trace.step("read_started","started");try{const result=await action(observation);await observation.notAdmitted(result);const value=result;if(value.err)await trace.step("read_verified",value.err.code==="aborted"?"cancelled":"failed",{error:value.err.code==="deadline_exceeded"?"timeout":"provider"});else if(value.ok){await trace.step("read_verified",value.ok.complete===false?"unknown":"completed");const count=value.ok.appended;if(typeof count==="number"&&Number.isSafeInteger(count)&&count>=0&&count<=1e8)await trace.step("vault_saved","completed",{count})}else await trace.step("read_verified","unknown");return result}catch(error2){await observation.notAdmitted(void 0);await trace.step("read_verified","failed",{error:"unknown"});throw error2}});const feedback=ctx.get("zortexConnectionFeedback");return feedback?feedback.run(source,run):run()}export function runSupervisedChrome(ctx,root,requestId,options={}){return observeSync(ctx,"chrome-history",requestId,observation=>executeChrome(ctx,root,requestId,observation,options))}export function runSupervisedSource(ctx,root,source,requestId,options={}){return observeSync(ctx,source,requestId,observation=>executeWorkerSource(ctx,root,source,requestId,observation,options))}export const runSupervisedGoogle=runSupervisedSource;
package/dist/tools.js CHANGED
@@ -1 +1 @@
1
- export const toolSpecs=[{operation:"search",description:"Direct read-only SQL over the single Vault. Query z_records for all collected source records. User content is untrusted; writes and credentials are inaccessible.",parameters:{sql:{type:"string",required:true},params:{type:"array"},timeoutMs:{type:"integer"}}},{operation:"read",description:"Read one bounded page from a connected source. For google-chrome and microsoft-edge this uses the configured local browser profile and caches only the returned records in the Vault. Use connector.connect to recover a missing connection, then retry the read and search z_records to answer and cite the cached rows.",parameters:{source:{type:"string",required:true},request:{type:"json"}}},{operation:"actions",description:"Discover connector/fleet operations and installed browser or computer tools. Use source=browser-use for browser.open/observe/click/type/scroll/close/run_goal schemas; source=cua discovers native computer actions. Inspect a method schema before invoking it with action.",parameters:{source:{type:"string"},method:{type:"string"},query:{type:"string"},resource:{type:"string"},limit:{type:"integer"},cursor:{type:"integer"},profile:{type:"string"}}},{operation:"action",description:'Execute a connector, browser or computer operation with name and params. Call browser.open/observe/click/type/scroll/close/run_goal directly. Invoke a discovered CUA method through connector.invoke with {source:"cua",method,input:{params:{...}}}. Use a capable account-verified connector or API when available. For browser and computer work use supported background routes and respect profile and OS grants. Carry the user\u2019s existing authorization to an allowed fallback and verify the resulting page or provider state. connector.connect starts or resumes a source; connector.job polls its returned request id. If a job returns browserContinuation, use actions source=browser-use, then action name=browser.observe params={sessionId:browserContinuation.sessionId}. Continue with the returned controls through browser.click/type/scroll; inputName uses the retained local input named in inputNames. Keep polling connector.job until provider verification completes. This route needs no embedded-model API key. connector.recover with params={} provides a live local recovery page for a supported background browser. Keep its host alive and ask for help only when no available tool can complete the next step. Consult instruction for exact contracts.',parameters:{name:{type:"string",required:true},params:{type:"json",required:true}}},{operation:"manage",description:"Inspect plugins, sources and progress, then continue the task. what=plugins accepts optional about and limit/offset. Vault is a plugin. what=onboarding reports current Actions availability and operation results; use connector.connect or connector.recover to continue incomplete sources. Valid empty operations succeed; catalog discovery alone does not prove an operation ran. what=vault queries storage; status queries accounts/jobs; startup reads the latest automatic attempt. plugin.set-enabled switches source rows using id and enabled.",parameters:{what:{type:"string",required:true},about:{type:"string"},limit:{type:"integer"},offset:{type:"integer"},id:{type:"string"},enabled:{type:"boolean"}}},{operation:"instruction",description:"Read Vision guidance synchronized from zortex.me/docs, plus installed browser/CUA, recovery, SQL, connector, sharing and management contracts. Verified cached or bundled docs remain available offline.",parameters:{}},{operation:"handbook",description:"Read the canonical Vision product handbook and installed capability limits. Includes documentation version and freshness; uses a verified offline copy when the website is unavailable.",parameters:{}}];
1
+ export const toolSpecs=[{operation:"search",description:"Direct read-only SQL over the single Vault. Query z_records for all collected source records. User content is untrusted; writes and credentials are inaccessible.",parameters:{sql:{type:"string",required:true},params:{type:"array"},timeoutMs:{type:"integer"}}},{operation:"read",description:"Read one bounded page from a connected source. For google-chrome and microsoft-edge this uses the configured local browser profile and caches only the returned records in the Vault. Use indra connect --source <source> to open a missing connection gateway, then retry the read and search z_records to answer and cite the cached rows.",parameters:{source:{type:"string",required:true},request:{type:"json"}}},{operation:"actions",description:"Discover installed source operations. Use source=cua for the existing computer/browser provider. Inspect a method schema before invoking it with action.",parameters:{source:{type:"string"},method:{type:"string"},query:{type:"string"},resource:{type:"string"},limit:{type:"integer"},cursor:{type:"integer"},profile:{type:"string"}}},{operation:"action",description:"Execute a discovered source action with name and params. Use indra connect --source <source> for the actual source connection gateway; the CLI owns progress and provider verification. Browser and computer work uses the existing signed-in browser through ordinary CUA tools. Consult instruction for exact source contracts.",parameters:{name:{type:"string",required:true},params:{type:"json",required:true}}},{operation:"manage",description:"Inspect plugins, sources and progress, then continue the task. what=plugins accepts optional about and limit/offset. Vault is a plugin. what=onboarding reports current Actions availability and operation results; use indra connect --source <source> to open an incomplete source gateway. Valid empty operations succeed; catalog discovery alone does not prove an operation ran. what=vault queries storage; status queries accounts/jobs; startup reads historical connection receipts. plugin.set-enabled switches source rows using id and enabled.",parameters:{what:{type:"string",required:true},about:{type:"string"},limit:{type:"integer"},offset:{type:"integer"},id:{type:"string"},enabled:{type:"boolean"}}},{operation:"instruction",description:"Read Vision guidance synchronized from zortex.me/docs, plus installed browser/CUA, recovery, SQL, connector, sharing and management contracts. Verified cached or bundled docs remain available offline.",parameters:{}},{operation:"handbook",description:"Read the canonical Vision product handbook and installed capability limits. Includes documentation version and freshness; uses a verified offline copy when the website is unavailable.",parameters:{}}];
@@ -1 +1 @@
1
- import{spawn}from"node:child_process";import{fileURLToPath}from"node:url";import{productUpdater}from"./auto-update.js";const print=value=>process.stdout.write(JSON.stringify(value)+"\n");const enabled=()=>!/^(0|false|off)$/i.test(process.env.ZORTEX_UPDATES??"")&&process.env.ZORTEX_FEEDBACK_TRAFFIC_CLASS!=="internal_test";export async function bootstrapProductCli(argv){if(process.env.ZORTEX_UPDATE_VERIFY!=="1")await productUpdater.recover();const args=[...argv];const root=args.indexOf("--root");if(root>=0)args.splice(root,2);if(args[0]==="update"){const operation=args[1]??"check";if(operation==="--help"||operation==="help"){print({usage:"zortex update [check | apply --version <exact-version> --confirmation-token <token>]",incremental:"check returns the current release offer without downloading payloads. When the target manifest is readable, the offer also reports expectedDownloadBytes and expectedChangedFiles, the product-file delta the apply will download. apply installs its verified changed files without a confirmation prompt. Changed public dependencies are prepared separately with npm."});return true}if(operation==="check"&&args.length<=2){const result=await productUpdater.check({force:true});print(result);return true}if(operation==="apply"){const remaining=args.slice(2).filter(value=>value!=="--yes");const take=name=>{const at=remaining.indexOf(name);if(at<0)return void 0;const value=remaining[at+1];if(!value||value.startsWith("--"))throw Error("Missing "+name);remaining.splice(at,2);return value};const version=take("--version"),confirmationToken=take("--confirmation-token");if(!version||!confirmationToken||remaining.length)throw Error("Update requires --version and --confirmation-token from update check.");print(await productUpdater.apply({version,confirmationToken}));return true}throw Error("Use zortex update --help.")}if(enabled()&&!args.includes("mcp")&&!args.includes("--version")&&!args.includes("-v")){const worker=spawn(process.execPath,[fileURLToPath(new URL("./update-check.js",import.meta.url))],{stdio:"ignore",detached:true,windowsHide:true,env:process.env});worker.on("error",()=>{});worker.unref()}return false}
1
+ import{spawn}from"node:child_process";import{fileURLToPath}from"node:url";import{productUpdater}from"./auto-update.js";const print=value=>process.stdout.write(JSON.stringify(value)+"\n");const enabled=()=>!/^(0|false|off)$/i.test(process.env.ZORTEX_UPDATES??"")&&process.env.ZORTEX_FEEDBACK_TRAFFIC_CLASS!=="internal_test";export async function bootstrapProductCli(argv){if(process.env.ZORTEX_UPDATE_VERIFY!=="1")await productUpdater.recover();const args=[...argv];const root=args.indexOf("--root");if(root>=0)args.splice(root,2);if(args[0]==="update"){const operation=args[1]??"check";if(operation==="--help"||operation==="help"){print({usage:"zortex update [check | apply --version <exact-version> --confirmation-token <token>]",incremental:"check returns the current release offer without downloading payloads. When the target manifest is readable, the offer also reports expectedDownloadBytes and expectedChangedFiles, the product-file delta the apply will download. apply installs its verified changed files without a confirmation prompt. Changed public dependencies are prepared separately with npm."});return true}if(operation==="check"&&args.length<=2){const result=await productUpdater.check({force:true});print(result);return true}if(operation==="apply"){const remaining=args.slice(2).filter(value=>value!=="--yes");const take=name=>{const at=remaining.indexOf(name);if(at<0)return void 0;const value=remaining[at+1];if(!value||value.startsWith("--"))throw Error("Missing "+name);remaining.splice(at,2);return value};const version=take("--version"),confirmationToken=take("--confirmation-token");if(!version||!confirmationToken||remaining.length)throw Error("Update requires --version and --confirmation-token from update check.");print(await productUpdater.apply({version,confirmationToken}));return true}throw Error("Use zortex update --help.")}if(enabled()&&!args.includes("mcp")&&!args.includes("--version")&&!args.includes("-v")&&!args.includes("--help")&&!args.includes("-h")&&!args.includes("help")&&args.length>0){const worker=spawn(process.execPath,[fileURLToPath(new URL("./update-check.js",import.meta.url))],{stdio:"ignore",detached:true,windowsHide:true,env:process.env});worker.on("error",()=>{});worker.unref()}return false}
package/dist/web.js CHANGED
@@ -1,2 +1,2 @@
1
- import{validateJoplinResult}from"./joplin-selection.js";import{lstat,readFile}from"node:fs/promises";import{isAbsolute,resolve}from"node:path";import*as galaxy from"@zortexhq/plugin-galaxy-ui";import{openConnectionUrl}from"@zortexhq/plugin-connector-core/browser";import{openProduct}from"./profile.js";import{readPublicActionProgress}from"./public-action-progress.js";import{provideAutoSync}from"./auto-sync.js";import{chooseWebPort}from"./web-port.js";import{residentStatus,startResident,residentInitialConnections,residentConnect,residentConnectRecovery,residentConnectReauthorize,residentConnectReadwiseMcpWrite,residentConnectGmailWrite,residentConnectManual,residentReconnectSaved,residentConnectJob,residentCancelConnect,residentConnectorStatus,residentConfigureNativeFiles,residentConfigureZotero,residentConfigureOwnTracks,residentConfigureZoom,residentConfigureBox,residentConfigureFront,residentConfigureHubSpot,residentConfigureGoogleContacts,residentConfigureGoogleChat,residentConfigureSalesforce,residentConfigureZendesk,residentConfigureDropbox,residentConfigureDiscord,residentConfigureProtonMail,residentConfigureJoplin,residentConfigureThunderbird,residentConfigureWeChat,residentConfigureCopyQ,residentConfigureFreshdesk,residentConfigureFigma,residentConfigureSmartsheet,residentConfigureNextcloud,residentConfigureZulip,residentConfigureFreshRSS,residentConfigureMiniflux,residentConfigureMattermost,residentConfigureWallabag,residentConfigureCalcom,residentConfigureWakatime,residentGatewayCall,residentCheck,residentRead}from"./resident-platform.js";import{fileURLToPath}from"node:url";import{HELP_CATALOG}from"./source-catalog.js";import{startGuidedRecovery,validateNativeFileResult}from"./recovery.js";import{mergedRecoveryProgress}from"./recovery-progress.js";import{sourceSupport,recoverySetupFlags}from"./recovery-support.js";export const WEB_USAGE="Use indra web --root <absolute directory> [--port 8781] [--no-open].";const entrypoint=fileURLToPath(new URL("./cli.js",import.meta.url));export function parseWebArgs(argv){let root,port=8781,portChosen=false,noOpen=false;for(let i=0;i<argv.length;i++){const arg=argv[i];if(arg==="--root"){if(root||!argv[i+1])throw Error("Pass one --root.");root=argv[++i]}else if(arg==="--port"){const value=argv[++i];if(!value||!/^\d{1,5}$/.test(value)||Number(value)>65535)throw Error("Port must be 0-65535.");port=Number(value);portChosen=true}else if(arg==="--no-open")noOpen=true;else throw Error(WEB_USAGE)}if(!root||!isAbsolute(root))throw Error("An explicit absolute data root is required.");return{root:resolve(root),port,portChosen,noOpen}}export async function launchWeb(argv){const options=parseWebArgs(argv);const productVersion=JSON.parse(await readFile(new URL("../package.json",import.meta.url),"utf8")).version;if(await lstat(options.root).then(stat=>stat.isSymbolicLink(),error=>{if(error.code==="ENOENT")return false;throw error}))throw Error("Product root cannot be a link.");const chosen=await chooseWebPort(options.port,options.portChosen);const app=await openProduct(options.root);const stop=new AbortController;let finishing;let connectionSession;let openingConnections;let closing=false;const residentReport=async()=>{const result=await residentGatewayCall(options.root,{operation:"manage",args:{what:"onboarding"}},stop.signal);if(!("ok"in result))throw Error("The background connection report is unavailable.");return result.ok};const authorization={reconnectSaved:(source,signal)=>residentReconnectSaved(options.root,source,signal),check:(source,signal)=>residentCheck(options.root,source,signal),status:signal=>residentConnectorStatus(options.root,signal),read:(source,request,signal)=>residentRead(options.root,source,request,signal),connect:async(source,requestId,signal,settings)=>{await startResident(options.root,entrypoint);return settings?.gmailWrite?residentConnectGmailWrite(options.root,requestId,signal):settings?.readwiseMcpWrite?residentConnectReadwiseMcpWrite(options.root,requestId,signal):settings?.selectAccount?residentConnectRecovery(options.root,source,requestId,signal):settings?.reauthorize?residentConnectReauthorize(options.root,source,requestId,signal):settings?.manualPresentation==="return-url"?residentConnectManual(options.root,source,requestId,signal):residentConnect(options.root,source,requestId,signal,{automatic:false})},job:async(requestId,signal)=>{await startResident(options.root,entrypoint);return residentConnectJob(options.root,requestId,signal)},cancel:(requestId,generation,challengeRef)=>residentCancelConnect(options.root,requestId,generation,challengeRef),configureWeChat:async(port,signal)=>validateNativeFileResult("wechat",await residentConfigureWeChat(options.root,port,signal)),configureJoplin:async(selection,signal)=>validateJoplinResult(await residentConfigureJoplin(options.root,selection,signal)),configureThunderbird:async(port,signal)=>validateNativeFileResult("thunderbird",await residentConfigureThunderbird(options.root,port,signal)),configureDiscord:async(selection,signal)=>validateNativeFileResult("discord",await residentConfigureDiscord(options.root,selection,signal)),configureProtonMail:async(port,signal)=>validateNativeFileResult("proton-mail",await residentConfigureProtonMail(options.root,port,signal)),configureZulip:async(selection,signal)=>validateNativeFileResult("zulip",await residentConfigureZulip(options.root,selection,signal)),configureFreshRSS:async(selection,signal)=>validateNativeFileResult("freshrss",await residentConfigureFreshRSS(options.root,selection,signal)),configureMiniflux:async(selection,signal)=>validateNativeFileResult("miniflux",await residentConfigureMiniflux(options.root,selection,signal)),configureMattermost:async(selection,signal)=>validateNativeFileResult("mattermost",await residentConfigureMattermost(options.root,selection,signal)),configureWallabag:async(selection,signal)=>validateNativeFileResult("wallabag",await residentConfigureWallabag(options.root,selection,signal)),configureCalcom:async(selection,signal)=>validateNativeFileResult("calcom",await residentConfigureCalcom(options.root,selection,signal)),configureWakatime:async(selection,signal)=>validateNativeFileResult("wakatime",await residentConfigureWakatime(options.root,selection,signal)),configureNextcloud:async(instanceUrl,signal)=>validateNativeFileResult("nextcloud",await residentConfigureNextcloud(options.root,instanceUrl,signal)),configureZoom:async(selection,signal)=>validateNativeFileResult("zoom",await residentConfigureZoom(options.root,selection,signal)),configureBox:async(selection,signal)=>validateNativeFileResult("box",await residentConfigureBox(options.root,selection,signal)),configureFront:async(selection,signal)=>validateNativeFileResult("front",await residentConfigureFront(options.root,selection,signal)),configureHubSpot:async(selection,signal)=>validateNativeFileResult("hubspot",await residentConfigureHubSpot(options.root,selection,signal)),configureGoogleContacts:async(selection,signal)=>validateNativeFileResult("google-contacts",await residentConfigureGoogleContacts(options.root,selection,signal)),configureGoogleChat:async(selection,signal)=>validateNativeFileResult("google-chat",await residentConfigureGoogleChat(options.root,selection,signal)),configureSalesforce:async(selection,signal)=>validateNativeFileResult("salesforce",await residentConfigureSalesforce(options.root,selection,signal)),configureZendesk:async(selection,signal)=>validateNativeFileResult("zendesk",await residentConfigureZendesk(options.root,selection,signal)),configureDropbox:async(selection,signal)=>validateNativeFileResult("dropbox",await residentConfigureDropbox(options.root,selection,signal)),configureFigma:async(mode,signal)=>validateNativeFileResult("figma",await residentConfigureFigma(options.root,mode,signal)),configureSmartsheet:async(region,signal)=>validateNativeFileResult("smartsheet",await residentConfigureSmartsheet(options.root,region,signal)),configureFreshdesk:async(subdomain,signal)=>validateNativeFileResult("freshdesk",await residentConfigureFreshdesk(options.root,subdomain,signal)),configureCopyQ:async(executable,session,signal)=>validateNativeFileResult("copyq",await residentConfigureCopyQ(options.root,executable,session,signal)),configureOwnTracks:async(port,signal)=>validateNativeFileResult("owntracks",await residentConfigureOwnTracks(options.root,port,signal)),configureZotero:async(libraryId,libraryType,signal)=>validateNativeFileResult("zotero",await residentConfigureZotero(options.root,libraryId,libraryType,signal)),configureNativeFiles:async(source,roots,signal)=>validateNativeFileResult(source,await residentConfigureNativeFiles(options.root,source,roots,signal))};const connectionRequest=async(input,signal)=>{if(!connectionSession||connectionSession.snapshot().state==="closed"){openingConnections??=residentReport().then(report=>startGuidedRecovery(app.context,{sources:report.sources,authorization}));try{connectionSession=await openingConnections}finally{openingConnections=void 0}}return connectionSession.request(input,signal)};try{await startResident(options.root,entrypoint);const startup={done:residentInitialConnections(options.root,stop.signal)};void startup.done.catch(()=>{});provideAutoSync(app.context,options.root,{residentStatus:async()=>{const value=(await residentStatus(options.root)).autoSync;return Array.isArray(value)?value:[]}});const page=app.context.plugin(galaxy,{productVersion,port:chosen.port,connectionRequest,directorySources:HELP_CATALOG.map(([source])=>source),sourceProgress:async()=>mergedRecoveryProgress(app.context),sourceSupport:async()=>{const result=await authorization.status(stop.signal);if(!("ok"in result))throw Error("Resident connector support unavailable");const listed=new Set(result.ok.map(row=>row.source));const states=[...result.ok,...(result.pending??[]).filter(row=>!listed.has(row.source)).map(row=>({source:row.source,state:"unavailable",registration:"deferred"}))];for(const row of states)listed.add(row.source);return[...states.map(row=>sourceSupport({...row,connection:row.state,...result.pending?.find(item=>item.source===row.source)?.reason?{setupReason:result.pending.find(item=>item.source===row.source).reason}:{}},Object.keys(recoverySetupFlags(row.source,authorization)).length>0)),...HELP_CATALOG.filter(([source])=>!listed.has(source)&&!(source==="teams"&&listed.has("microsoft-teams"))).map(([source])=>sourceSupport({source,catalogOnly:true},false))]},connectionStatus:async()=>{const result=await authorization.status(stop.signal);if(!("ok"in result))throw Error("Resident connector status unavailable");const report=await residentReport().catch(()=>null);const reads=new Map((report?.sources??[]).filter(row=>row.connection==="connected"&&!row.errorCode&&(row.availability==="read"||row.availability==="actions")&&row.operation==="succeeded"&&Number.isSafeInteger(row.returned)&&row.returned>=0&&(row.returned>0?row.read==="first-record":row.read==="empty")).map(row=>[row.source,row.returned]));const publicReads=new Map(readPublicActionProgress(app.context).map(item=>[item.source,item]));return result.ok.map(row=>{const publicRead=publicReads.get(row.source);return{...row,...row.state==="connected"&&reads.has(row.source)?{readEvidence:{state:"succeeded",returned:reads.get(row.source)}}:{},...publicRead?{publicRead}:{}}})}});await page.await();if(page.state!==2)throw Error("The Galaxy page did not start.");const{url,port}=app.context.zortexGalaxyPage;let opened=false;if(!options.noOpen)try{await openConnectionUrl(url);opened=true}catch{}process.stdout.write(JSON.stringify({port,version:productVersion,url,opened,...chosen.moved?{notice:`Port ${options.port} is used by another program, possibly an older Zortex window, so this version opened on port ${port}.`}:{}})+"\n");process.stdout.write(`zortex web: ${url}
2
- `);finishing=(async()=>{await startup.done;if(closing)return;const report=await residentReport();if(!closing)process.stdout.write(JSON.stringify({onboarding:report})+"\n")})().catch(()=>{if(!closing)process.stderr.write("indra: startup results unavailable; refresh Apps to retry.\n")});await new Promise(done=>{const stop2=()=>{process.removeListener("SIGINT",stop2);process.removeListener("SIGTERM",stop2);done()};process.once("SIGINT",stop2);process.once("SIGTERM",stop2)})}finally{closing=true;stop.abort();try{await finishing;await openingConnections?.catch(()=>void 0);await connectionSession?.close();await app.context.get("zortexConnectorHub")?.settleObservations?.({closing:true});const sent=await app.context.get("zortexPostHog")?.flush({wait:true});if(sent&&"err"in sent)process.stderr.write("indra feedback: delivery pending; retained for the next run.\n")}finally{await app.close()}}}
1
+ import{validateJoplinResult}from"./joplin-selection.js";import{lstat,readFile}from"node:fs/promises";import{isAbsolute,resolve}from"node:path";import*as galaxy from"@zortexhq/plugin-galaxy-ui";import{openConnectionUrl}from"@zortexhq/plugin-connector-core/browser";import{openProduct}from"./profile.js";import{readPublicActionProgress}from"./public-action-progress.js";import{provideAutoSync}from"./auto-sync.js";import{chooseWebPort}from"./web-port.js";import{residentStatus,startResident,residentConnect,residentConnectRecovery,residentConnectReauthorize,residentConnectReadwiseMcpWrite,residentConnectGmailWrite,residentConnectManual,residentReconnectSaved,residentConnectJob,residentCancelConnect,residentConnectorStatus,residentConfigureNativeFiles,residentConfigureZotero,residentConfigureOwnTracks,residentConfigureZoom,residentConfigureBox,residentConfigureFront,residentConfigureHubSpot,residentConfigureGoogleContacts,residentConfigureGoogleChat,residentConfigureSalesforce,residentConfigureZendesk,residentConfigureDropbox,residentConfigureDiscord,residentConfigureProtonMail,residentConfigureJoplin,residentConfigureThunderbird,residentConfigureWeChat,residentConfigureCopyQ,residentConfigureFreshdesk,residentConfigureFigma,residentConfigureSmartsheet,residentConfigureNextcloud,residentConfigureZulip,residentConfigureFreshRSS,residentConfigureMiniflux,residentConfigureMattermost,residentConfigureWallabag,residentConfigureCalcom,residentConfigureWakatime,residentGatewayCall,residentCheck,residentRead}from"./resident-platform.js";import{fileURLToPath}from"node:url";import{HELP_CATALOG}from"./source-catalog.js";import{startGuidedRecovery,validateNativeFileResult}from"./recovery.js";import{mergedRecoveryProgress}from"./recovery-progress.js";import{sourceSupport,recoverySetupFlags}from"./recovery-support.js";export const WEB_USAGE="Use indra web --root <absolute directory> [--port 8781] [--no-open].";const entrypoint=fileURLToPath(new URL("./cli.js",import.meta.url));export function parseWebArgs(argv){let root,port=8781,portChosen=false,noOpen=false;for(let i=0;i<argv.length;i++){const arg=argv[i];if(arg==="--root"){if(root||!argv[i+1])throw Error("Pass one --root.");root=argv[++i]}else if(arg==="--port"){const value=argv[++i];if(!value||!/^\d{1,5}$/.test(value)||Number(value)>65535)throw Error("Port must be 0-65535.");port=Number(value);portChosen=true}else if(arg==="--no-open")noOpen=true;else throw Error(WEB_USAGE)}if(!root||!isAbsolute(root))throw Error("An explicit absolute data root is required.");return{root:resolve(root),port,portChosen,noOpen}}export async function launchWeb(argv){const options=parseWebArgs(argv);const productVersion=JSON.parse(await readFile(new URL("../package.json",import.meta.url),"utf8")).version;if(await lstat(options.root).then(stat=>stat.isSymbolicLink(),error=>{if(error.code==="ENOENT")return false;throw error}))throw Error("Product root cannot be a link.");const chosen=await chooseWebPort(options.port,options.portChosen);const app=await openProduct(options.root);const stop=new AbortController;let connectionSession;let openingConnections;const residentReport=async()=>{const result=await residentGatewayCall(options.root,{operation:"manage",args:{what:"onboarding"}},stop.signal);if(!("ok"in result))throw Error("The background connection report is unavailable.");return result.ok};const authorization={reconnectSaved:(source,signal)=>residentReconnectSaved(options.root,source,signal),check:(source,signal)=>residentCheck(options.root,source,signal),status:signal=>residentConnectorStatus(options.root,signal),read:(source,request,signal)=>residentRead(options.root,source,request,signal),connect:async(source,requestId,signal,settings)=>{await startResident(options.root,entrypoint);return settings?.gmailWrite?residentConnectGmailWrite(options.root,requestId,signal):settings?.readwiseMcpWrite?residentConnectReadwiseMcpWrite(options.root,requestId,signal):settings?.selectAccount?residentConnectRecovery(options.root,source,requestId,signal):settings?.reauthorize?residentConnectReauthorize(options.root,source,requestId,signal):settings?.manualPresentation==="return-url"?residentConnectManual(options.root,source,requestId,signal):residentConnect(options.root,source,requestId,signal,{automatic:false})},job:async(requestId,signal)=>{await startResident(options.root,entrypoint);return residentConnectJob(options.root,requestId,signal)},cancel:(requestId,generation,challengeRef)=>residentCancelConnect(options.root,requestId,generation,challengeRef),configureWeChat:async(port,signal)=>validateNativeFileResult("wechat",await residentConfigureWeChat(options.root,port,signal)),configureJoplin:async(selection,signal)=>validateJoplinResult(await residentConfigureJoplin(options.root,selection,signal)),configureThunderbird:async(port,signal)=>validateNativeFileResult("thunderbird",await residentConfigureThunderbird(options.root,port,signal)),configureDiscord:async(selection,signal)=>validateNativeFileResult("discord",await residentConfigureDiscord(options.root,selection,signal)),configureProtonMail:async(port,signal)=>validateNativeFileResult("proton-mail",await residentConfigureProtonMail(options.root,port,signal)),configureZulip:async(selection,signal)=>validateNativeFileResult("zulip",await residentConfigureZulip(options.root,selection,signal)),configureFreshRSS:async(selection,signal)=>validateNativeFileResult("freshrss",await residentConfigureFreshRSS(options.root,selection,signal)),configureMiniflux:async(selection,signal)=>validateNativeFileResult("miniflux",await residentConfigureMiniflux(options.root,selection,signal)),configureMattermost:async(selection,signal)=>validateNativeFileResult("mattermost",await residentConfigureMattermost(options.root,selection,signal)),configureWallabag:async(selection,signal)=>validateNativeFileResult("wallabag",await residentConfigureWallabag(options.root,selection,signal)),configureCalcom:async(selection,signal)=>validateNativeFileResult("calcom",await residentConfigureCalcom(options.root,selection,signal)),configureWakatime:async(selection,signal)=>validateNativeFileResult("wakatime",await residentConfigureWakatime(options.root,selection,signal)),configureNextcloud:async(instanceUrl,signal)=>validateNativeFileResult("nextcloud",await residentConfigureNextcloud(options.root,instanceUrl,signal)),configureZoom:async(selection,signal)=>validateNativeFileResult("zoom",await residentConfigureZoom(options.root,selection,signal)),configureBox:async(selection,signal)=>validateNativeFileResult("box",await residentConfigureBox(options.root,selection,signal)),configureFront:async(selection,signal)=>validateNativeFileResult("front",await residentConfigureFront(options.root,selection,signal)),configureHubSpot:async(selection,signal)=>validateNativeFileResult("hubspot",await residentConfigureHubSpot(options.root,selection,signal)),configureGoogleContacts:async(selection,signal)=>validateNativeFileResult("google-contacts",await residentConfigureGoogleContacts(options.root,selection,signal)),configureGoogleChat:async(selection,signal)=>validateNativeFileResult("google-chat",await residentConfigureGoogleChat(options.root,selection,signal)),configureSalesforce:async(selection,signal)=>validateNativeFileResult("salesforce",await residentConfigureSalesforce(options.root,selection,signal)),configureZendesk:async(selection,signal)=>validateNativeFileResult("zendesk",await residentConfigureZendesk(options.root,selection,signal)),configureDropbox:async(selection,signal)=>validateNativeFileResult("dropbox",await residentConfigureDropbox(options.root,selection,signal)),configureFigma:async(mode,signal)=>validateNativeFileResult("figma",await residentConfigureFigma(options.root,mode,signal)),configureSmartsheet:async(region,signal)=>validateNativeFileResult("smartsheet",await residentConfigureSmartsheet(options.root,region,signal)),configureFreshdesk:async(subdomain,signal)=>validateNativeFileResult("freshdesk",await residentConfigureFreshdesk(options.root,subdomain,signal)),configureCopyQ:async(executable,session,signal)=>validateNativeFileResult("copyq",await residentConfigureCopyQ(options.root,executable,session,signal)),configureOwnTracks:async(port,signal)=>validateNativeFileResult("owntracks",await residentConfigureOwnTracks(options.root,port,signal)),configureZotero:async(libraryId,libraryType,signal)=>validateNativeFileResult("zotero",await residentConfigureZotero(options.root,libraryId,libraryType,signal)),configureNativeFiles:async(source,roots,signal)=>validateNativeFileResult(source,await residentConfigureNativeFiles(options.root,source,roots,signal))};const connectionRequest=async(input,signal)=>{if(!connectionSession||connectionSession.snapshot().state==="closed"){openingConnections??=residentReport().then(report=>startGuidedRecovery(app.context,{sources:report.sources,authorization}));try{connectionSession=await openingConnections}finally{openingConnections=void 0}}return connectionSession.request(input,signal)};try{await startResident(options.root,entrypoint);provideAutoSync(app.context,options.root,{residentStatus:async()=>{const value=(await residentStatus(options.root)).autoSync;return Array.isArray(value)?value:[]}});const page=app.context.plugin(galaxy,{productVersion,port:chosen.port,connectionRequest,directorySources:HELP_CATALOG.map(([source])=>source),sourceProgress:async()=>mergedRecoveryProgress(app.context),sourceSupport:async()=>{const result=await authorization.status(stop.signal);if(!("ok"in result))throw Error("Resident connector support unavailable");const listed=new Set(result.ok.map(row=>row.source));const states=[...result.ok,...(result.pending??[]).filter(row=>!listed.has(row.source)).map(row=>({source:row.source,state:"unavailable",registration:"deferred"}))];for(const row of states)listed.add(row.source);return[...states.map(row=>sourceSupport({...row,connection:row.state,...result.pending?.find(item=>item.source===row.source)?.reason?{setupReason:result.pending.find(item=>item.source===row.source).reason}:{}},Object.keys(recoverySetupFlags(row.source,authorization)).length>0)),...HELP_CATALOG.filter(([source])=>!listed.has(source)&&!(source==="teams"&&listed.has("microsoft-teams"))).map(([source])=>sourceSupport({source,catalogOnly:true},false))]},connectionStatus:async()=>{const result=await authorization.status(stop.signal);if(!("ok"in result))throw Error("Resident connector status unavailable");const report=await residentReport().catch(()=>null);const reads=new Map((report?.sources??[]).filter(row=>row.connection==="connected"&&!row.errorCode&&(row.availability==="read"||row.availability==="actions")&&row.operation==="succeeded"&&Number.isSafeInteger(row.returned)&&row.returned>=0&&(row.returned>0?row.read==="first-record":row.read==="empty")).map(row=>[row.source,row.returned]));const publicReads=new Map(readPublicActionProgress(app.context).map(item=>[item.source,item]));return result.ok.map(row=>{const publicRead=publicReads.get(row.source);return{...row,...row.state==="connected"&&reads.has(row.source)?{readEvidence:{state:"succeeded",returned:reads.get(row.source)}}:{},...publicRead?{publicRead}:{}}})}});await page.await();if(page.state!==2)throw Error("The Galaxy page did not start.");const{url,port}=app.context.zortexGalaxyPage;let opened=false;if(!options.noOpen)try{await openConnectionUrl(url);opened=true}catch{}process.stdout.write(JSON.stringify({port,version:productVersion,url,opened,...chosen.moved?{notice:`Port ${options.port} is used by another program, possibly an older Zortex window, so this version opened on port ${port}.`}:{}})+"\n");process.stdout.write(`zortex web: ${url}
2
+ `);await new Promise(done=>{const stop2=()=>{process.removeListener("SIGINT",stop2);process.removeListener("SIGTERM",stop2);done()};process.once("SIGINT",stop2);process.once("SIGTERM",stop2)})}finally{stop.abort();try{await openingConnections?.catch(()=>void 0);await connectionSession?.close();await app.context.get("zortexConnectorHub")?.settleObservations?.({closing:true});const sent=await app.context.get("zortexPostHog")?.flush({wait:true});if(sent&&"err"in sent)process.stderr.write("indra feedback: delivery pending; retained for the next run.\n")}finally{await app.close()}}}
@@ -1,8 +1,8 @@
1
- import sodium from"libsodium-wrappers";import{createHash,createPrivateKey,createPublicKey,randomBytes,sign as signBytes}from"node:crypto";import{Original}from"@zortexhq/plugin-connector-framework/api";import{deviceAdmissionPayload}from"@zortexhq/plugin-cloud-vault/owner-admission";import{deviceTrustPayload}from"@zortexhq/plugin-cloud-vault/device-trust";const{isOk}=Original;const DEFAULT_TTL_MS=2*60*1e3,MAX_TTL_MS=5*60*1e3;const PKCS8_ED25519_PREFIX=Buffer.from("302e020100300506032b657004220420","hex");const uuid=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;const hostname=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function deviceKey(keyStore){if(!keyStore||typeof keyStore!=="object"||typeof keyStore.getMasterKey!=="function"||typeof keyStore.ensureMasterKey!=="function")throw Error("INVALID_KEYSTORE");if(keyStore.kind==="file-double")throw Error("PLAINTEXT_KEYSTORE_REFUSED");const result=keyStore.kind==="windows-dpapi"?keyStore.ensureMasterKey():keyStore.getMasterKey();if(!isOk(result))throw Error("LOCKED");let seed,der;try{seed=sodium.crypto_kdf_derive_from_key(32,0,"ZDEVADM1",result.ok);der=Buffer.concat([PKCS8_ED25519_PREFIX,seed]);return createPrivateKey({key:der,format:"der",type:"pkcs8"})}finally{sodium.memzero(result.ok);if(seed)sodium.memzero(seed);der?.fill(0)}}export async function createDeviceAdmissionSigner(keyStore){await sodium.ready;const privateKey=deviceKey(keyStore);const spki=createPublicKey(privateKey).export({format:"der",type:"spki"});const publicKey=spki.toString("base64url"),deviceId=createHash("sha256").update(spki).digest("hex").slice(0,32);return{enrollment(){return{deviceId,publicKey}},registrationProof(accountId){if(typeof accountId!=="string"||!uuid.test(accountId))throw Error("INVALID_DEVICE_REGISTRATION");const rawKey=createPublicKey(privateKey).export({format:"jwk"}).x;const payload=Buffer.from(`zortex-device-registration/v1
1
+ import sodium from"libsodium-wrappers";import{createHash,createPrivateKey,createPublicKey,sign as signBytes}from"node:crypto";import{Original}from"@zortexhq/plugin-connector-framework/api";const{isOk}=Original;const PKCS8_ED25519_PREFIX=Buffer.from("302e020100300506032b657004220420","hex");const uuid=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;const hostname=/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function deviceKey(keyStore){if(!keyStore||typeof keyStore!=="object"||typeof keyStore.getMasterKey!=="function"||typeof keyStore.ensureMasterKey!=="function")throw Error("INVALID_KEYSTORE");if(keyStore.kind==="file-double")throw Error("PLAINTEXT_KEYSTORE_REFUSED");const result=keyStore.kind==="windows-dpapi"?keyStore.ensureMasterKey():keyStore.getMasterKey();if(!isOk(result))throw Error("LOCKED");let seed,der;try{seed=sodium.crypto_kdf_derive_from_key(32,0,"ZDEVADM1",result.ok);der=Buffer.concat([PKCS8_ED25519_PREFIX,seed]);return createPrivateKey({key:der,format:"der",type:"pkcs8"})}finally{sodium.memzero(result.ok);if(seed)sodium.memzero(seed);der?.fill(0)}}export async function createDeviceAdmissionSigner(keyStore){await sodium.ready;const privateKey=deviceKey(keyStore);const spki=createPublicKey(privateKey).export({format:"der",type:"spki"});const publicKey=spki.toString("base64url"),deviceId=createHash("sha256").update(spki).digest("hex").slice(0,32);return{enrollment(){return{deviceId,publicKey}},registrationProof(accountId){if(typeof accountId!=="string"||!uuid.test(accountId))throw Error("INVALID_DEVICE_REGISTRATION");const rawKey=createPublicKey(privateKey).export({format:"jwk"}).x;const payload=Buffer.from(`zortex-device-registration/v1
2
2
  ${accountId}
3
3
  ${rawKey}
4
4
  `);return{publicKey:rawKey,signature:signBytes(null,payload,privateKey).toString("base64url")}},relayLease(registeredDeviceId,deviceHostname,ttlSeconds=1800){if(typeof registeredDeviceId!=="string"||!uuid.test(registeredDeviceId)||typeof deviceHostname!=="string"||!hostname.test(deviceHostname)||!deviceHostname.startsWith(registeredDeviceId+".")||!Number.isSafeInteger(ttlSeconds)||ttlSeconds<1||ttlSeconds>3600)throw Error("INVALID_RELAY_LEASE");const expires=String(Math.floor(Date.now()/1e3)+ttlSeconds);const payload=Buffer.from(`zortex-relay-lease/v1
5
5
  ${registeredDeviceId}
6
6
  ${deviceHostname}
7
7
  ${expires}
8
- `);return{deviceId:registeredDeviceId,expires,signature:signBytes(null,payload,privateKey).toString("base64url")}},sign(subject,options={}){const ttlMs=options.ttlMs??DEFAULT_TTL_MS;if(!Number.isSafeInteger(ttlMs)||ttlMs<1||ttlMs>MAX_TTL_MS)throw Error("INVALID_ADMISSION_WINDOW");const now=Date.now(),grant={deviceId,issuedAt:new Date(now).toISOString(),expiresAt:new Date(now+ttlMs).toISOString(),nonce:randomBytes(16).toString("hex")};const payload=deviceAdmissionPayload(subject,grant);return{grant,signature:signBytes(null,payload,privateKey).toString("base64url")}},signTrustChange(tenant,change){return signBytes(null,deviceTrustPayload(tenant,change),privateKey).toString("base64url")}}}
8
+ `);return{deviceId:registeredDeviceId,expires,signature:signBytes(null,payload,privateKey).toString("base64url")}}}}
@@ -1 +1 @@
1
- export*from"./broker.js";export*from"./lifecycle.js";export*from"./vault.js";export*from"./events.js";export*from"./policy.js";export*from"./driver.js";export*from"./redaction.js";export*from"./errors.js";export*from"./cells.js";export{CloudVaultKeyring}from"./cloud-vault-keyring.js";export{waitForLoopbackShutdown}from"./loopback-host.js";export{serve as serveLoopback}from"./loopback-host.js";export{apply,createOriginalAuth,name,inject}from"./runtime.js";export{NETEASE_IMAP_READ_POLICY,NETEASE_IMAP_PROVIDER_POLICY}from"./imap-policy.js";export{createSystemKeyStore,WindowsDpapiKeyStore}from"./system-key-store.js";export{createNodeControlAuth}from"./node-control.js";
1
+ export*from"./broker.js";export*from"./lifecycle.js";export*from"./vault.js";export*from"./events.js";export*from"./policy.js";export*from"./driver.js";export*from"./redaction.js";export*from"./errors.js";export*from"./cells.js";export{waitForLoopbackShutdown}from"./loopback-host.js";export{serve as serveLoopback}from"./loopback-host.js";export{apply,createOriginalAuth,name,inject}from"./runtime.js";export{NETEASE_IMAP_READ_POLICY,NETEASE_IMAP_PROVIDER_POLICY}from"./imap-policy.js";export{createSystemKeyStore,WindowsDpapiKeyStore}from"./system-key-store.js";export{createNodeControlAuth}from"./node-control.js";
@@ -12,15 +12,9 @@
12
12
  "./loopback": {
13
13
  "default": "./dist/loopback-host.js"
14
14
  },
15
- "./cloud-frame": {
16
- "default": "./dist/cloud-frame.js"
17
- },
18
15
  "./device-admission": {
19
16
  "default": "./dist/device-admission.js"
20
17
  },
21
- "./cloud-vault": {
22
- "default": "./dist/cloud-vault-keyring.js"
23
- },
24
18
  "./api/*": {
25
19
  "default": "./dist/api/*.js"
26
20
  },
@@ -30,8 +24,7 @@
30
24
  },
31
25
  "dependencies": {
32
26
  "@zortexhq/plugin-vault-sqlite": "0.1.0",
33
- "@zortexhq/plugin-connector-framework": "0.1.0",
34
- "@zortexhq/plugin-cloud-vault": "0.1.0"
27
+ "@zortexhq/plugin-connector-framework": "0.1.0"
35
28
  },
36
29
  "zortex": {
37
30
  "role": "plugin",
@@ -1 +1 @@
1
- export*from"./job-contract.js";export*from"./durable-dispatcher.js";export const AUTOMATIC_ERRORS=Object.freeze({automatic_authorization_unavailable:"The connection attempt did not complete. Inspect the current source state, repair the reported cause and continue connecting.",automatic_authorization_unsupported:"This source has no dedicated automatic driver. Continue on its connection page with the available browser or computer tools.",browser_driver_unavailable:"The authorization browser driver is unavailable on this installation.",browser_agent_continuation:"Continue the existing browser session with its observe, click, type and scroll actions. The provider transaction remains active and will verify the connection.",browser_session_limit:"Browser sessions are at capacity. Finish and close existing retained browser sessions with the available browser actions, then retry the remaining sources. The current provider transaction remains active.",model_unavailable:"The configured browser decision model is unavailable; no browser was opened.",browser_authorization_required:"The browser session was not attached. Reconnect the available browser and continue the active transaction.",authorization_user_required:"The provider transaction is incomplete. Continue its current page with the available browser or computer tools.",browser_human_required:"The provider returned a sign-in or verification challenge. Continue with available tools; request help only for a step those tools cannot complete.",shared_browser_unavailable:"The browser session could not start. Recover the browser connection and continue.",browser_popup_blocked:"An additional browser page interrupted the attempt. Follow the active transaction into that page and continue.",browser_dialog_blocked:"A browser dialog interrupted the attempt. Handle the dialog with the available browser or computer tools and continue.",browser_file_chooser_blocked:"A file chooser interrupted the attempt. Complete the requested file selection with the available computer tools and continue.",browser_origin_blocked:"The browser destination is outside this transaction. Inspect the current destination and resume the matching provider transaction.",browser_callback_blocked:"The callback does not match the active transaction. Inspect the current job before starting a replacement transaction.",isolated_display_unavailable:"An independently owned test display could not be established.",isolated_display_ownership_unconfirmed:"Ownership of the isolated test display could not be confirmed.",isolated_display_lost:"The isolated test display stopped. Restore the display after its previous process has exited and continue.",credentials_required:"This source needs a credential that is not available to the current connection. Check the configured credential source before requesting missing input.",authorization_callback_missing:"The browser finished but no verified callback arrived. Check the current job and resume connecting.",authorization_cleanup_pending:"The authorization browser has not confirmed cleanup. Do not retry until its owned process has stopped.",authorization_timeout:"Authorization validation exceeded its deadline. Check the connection state before trying again.",authorization_cancelled:"Authorization was cancelled before validation completed.",login_required:"Continue the source sign-in with the available browser or computer tools.",multiple_accounts:"Use the account indicated by the task or saved source binding and continue connecting.",notion_login_required:"Continue the Notion sign-in with the available browser or computer tools.",notion_page_selection_required:"Select the Notion pages needed for the task on the current connection page and continue.",admin_approval_required:"This account requires its administrator to approve the requested access.",background_renderer_unresolved:"Chrome did not expose the authorization page in the background. The browser driver needs recovery.",browser_renderer_unavailable:"Chrome did not expose the connection page through browser accessibility. Recover the browser or use the available computer tools.",background_browser_session_unavailable:"The background Chrome authorization session could not be opened.",page_accessibility_unavailable:"The authorization page could not be read through browser accessibility.",browser_session_unavailable:"The authorization browser session is unavailable.",jev_unavailable:"The Jev authorization driver is unavailable.",ui_drift:"The authorization page has changed and could not be completed automatically.",requested_account_row_unavailable:"The requested account row was not found. Inspect the current account page and continue with the requested account.",requested_account_chooser_not_shown:"The provider did not show the requested account chooser. Recover the account-selection page and continue.",requested_account_not_selected:"The selected account does not match the requested account. Continue account selection and verify its identity.",youtube_requested_account_identity_unavailable:"The YouTube account identity could not be verified. Inspect the current account and continue verification.",google_unverified_app:"Google returned an application review page. Inspect the provider page and continue the requested connection where supported.",helper_unavailable:"The browser authorization helper could not start. Check that the installed helper is available before retrying.",helper_timeout:"The browser helper exceeded its deadline. Inspect the current job, then continue once the helper has exited.",model_budget_exhausted:"The browser reached its model-call limit for this attempt. Continue within the remaining connection retry budget."});export function automaticReason(value){return typeof value==="string"?/^([a-z_]{1,64})(?:\s|$)/.exec(value)?.[1]:void 0}export function automaticError(reason,fallback="automatic_authorization_unavailable"){const raw=automaticReason(reason);const parsed=raw==="notion_user_selection"?"notion_page_selection_required":raw;const code=parsed&&Object.hasOwn(AUTOMATIC_ERRORS,parsed)?parsed:Object.hasOwn(AUTOMATIC_ERRORS,fallback)?fallback:"automatic_authorization_unavailable";return{code,message:AUTOMATIC_ERRORS[code]}}export function startDriver(driver,request,signal){try{return driver?.start(request,signal)}catch{return void 0}}export async function awaitAutomaticAuthorization({driven,settled,pending,deadlineMs,signal,callbackGraceMs=5e3,unavailableCode="browser_driver_unavailable"}){if(!driven?.launched)return{code:unavailableCode};let deadline,detach=()=>{};const interrupted=new Promise(resolve=>{const budget=Number.isFinite(deadlineMs)?Math.max(1,Math.min(2147483647,deadlineMs)):1;deadline=setTimeout(()=>resolve({kind:"timeout"}),budget);const cancel=()=>resolve({kind:"cancelled"});if(signal?.aborted)cancel();else if(signal){signal.addEventListener("abort",cancel,{once:true});detach=()=>signal.removeEventListener("abort",cancel)}});const interruptionCode=value=>value.kind==="timeout"?"authorization_timeout":"authorization_cancelled";try{const ended=await Promise.race([driven.outcome.then(outcome2=>({kind:"driver",outcome:outcome2}),()=>({kind:"driver_rejected"})),interrupted]);if(ended.kind!=="driver")return{code:"authorization_cleanup_pending",cleanupPending:true};const outcome=ended.outcome;const code=outcome.state==="completed"?"authorization_callback_missing":automaticError(outcome.reason??outcome.state).code;if(outcome.state==="completed"){let grace;try{const delivered=await Promise.race([settled.then(()=>({kind:"settled"})),interrupted,new Promise(resolve=>{grace=setTimeout(()=>resolve({kind:"grace"}),Math.max(1,Math.min(deadlineMs,callbackGraceMs)))})]);if(delivered.kind==="timeout"||delivered.kind==="cancelled")return{code:interruptionCode(delivered),outcome}}finally{if(grace)clearTimeout(grace)}}const validated=await Promise.race([Promise.resolve(pending()).then(()=>({kind:"validated"}),()=>({kind:"validated"})),settled.then(()=>({kind:"settled"})),interrupted]);if(validated.kind==="timeout"||validated.kind==="cancelled")return{code:interruptionCode(validated),outcome};return{code,outcome}}finally{if(deadline)clearTimeout(deadline);detach()}}const TRANSIENT=new Set(["ui_drift","page_accessibility_unavailable","browser_renderer_unavailable","background_renderer_unresolved","background_browser_session_unavailable","browser_session_unavailable","authorization_callback_missing","helper_timeout","login_required","multiple_accounts","notion_login_required","notion_page_selection_required","notion_user_selection","browser_authorization_required","authorization_user_required","browser_human_required","shared_browser_unavailable","browser_popup_blocked","browser_dialog_blocked","browser_file_chooser_blocked","isolated_display_lost","requested_account_row_unavailable","requested_account_chooser_not_shown","requested_account_not_selected","youtube_requested_account_identity_unavailable","google_unverified_app","model_budget_exhausted"]);export function isTransientAutomatic(code){return typeof code==="string"&&TRANSIENT.has(code)}export const AUTOMATIC_ATTEMPTS=2;export const AUTOMATIC_AUTHORIZATION_LIMIT_MS=36e4;export const AUTOMATIC_SETTLEMENT_RESERVE_MS=3e4;export function automaticDeadline(timeoutMs,automatic,limitMs=AUTOMATIC_AUTHORIZATION_LIMIT_MS){return automatic?Math.min(timeoutMs,limitMs):timeoutMs}export function automaticDriverDeadline(timeoutMs,automatic,limitMs=AUTOMATIC_AUTHORIZATION_LIMIT_MS,settlementReserveMs=AUTOMATIC_SETTLEMENT_RESERVE_MS){const total=automaticDeadline(timeoutMs,automatic,limitMs);if(!automatic)return total;const reserve=Math.min(settlementReserveMs,Math.floor(total/4));return Math.max(1,total-reserve)}export const SIGNED_IN_BROWSER_CREDENTIAL=Object.freeze({accessToken:"chrome-session",clientId:"signed-in-browser",expiresAt:0,scopes:["read"]});export function isSignedInBrowserCredential(credential){return credential?.clientId===SIGNED_IN_BROWSER_CREDENTIAL.clientId}export async function readSignedInPage(driver,request,signal){if(!driver?.readSite)return void 0;let outcome;for(let attempt=0;attempt<2&&!signal.aborted;attempt++){let started;try{started=driver.readSite(request,signal)}catch{return void 0}if(!started.launched)return void 0;try{outcome=await started.outcome}catch{outcome={state:"failed",reason:"helper_unavailable"}}if(outcome.state!=="ui_drift"||automaticReason(outcome.reason)!=="page_accessibility_unavailable")break}return outcome}
1
+ export*from"./job-contract.js";export*from"./durable-dispatcher.js";
@@ -7,9 +7,6 @@
7
7
  "default": "./dist/api/index.js"
8
8
  }
9
9
  },
10
- "dependencies": {
11
- "@zortexhq/plugin-oauth-browser-driver": "0.1.0"
12
- },
13
10
  "zortex": {
14
11
  "role": "plugin"
15
12
  }
@@ -1 +1 @@
1
- import{businessError,ok}from"@zortexhq/plugin-connector-framework/api";const SOURCE="google-calendar",API="https://www.googleapis.com/calendar/v3";const fail=(code,message)=>businessError(code,message,"plugin");const id={type:"string",minLength:1,maxLength:1024};const binding={type:"string",pattern:"^binding_[A-Za-z0-9_-]+$",maxLength:200};const job={type:"string",format:"uuid"};const methods=[{name:"calendar.authorization.prepare",description:"Start full Google Calendar authorization through the shared background browser flow without opening or focusing a browser. Returns the authorization job for polling.",httpMethod:"POST",effect:"write",inputSchema:{type:"object",properties:{},additionalProperties:false}},{name:"calendar.authorization.status",description:"Read the state of one prepared Google Calendar authorization job.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{jobId:job},required:["jobId"],additionalProperties:false}},{name:"calendar.accounts",description:"List every installed Google Calendar account binding and its granted scopes. Returns public account metadata only.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{},additionalProperties:false}},{name:"calendar.calendars.list",description:"List calendars for one exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,maxResults:{type:"integer",minimum:1,maximum:250},pageToken:id},required:["bindingId"],additionalProperties:false}},{name:"calendar.acl.list",description:"List access-control rules for one calendar and exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,maxResults:{type:"integer",minimum:1,maximum:250},pageToken:id},required:["bindingId","calendarId"],additionalProperties:false}},{name:"calendar.acl.get",description:"Get one access-control rule from one calendar and exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,ruleId:id},required:["bindingId","calendarId","ruleId"],additionalProperties:false}},{name:"calendar.events.list",description:"List events from one calendar and exact installed account. singleEvents expands recurring series so individual exceptions can be discovered and updated.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,timeMin:{type:"string",format:"date-time"},timeMax:{type:"string",format:"date-time"},query:{type:"string",maxLength:1e3},singleEvents:{type:"boolean"},showDeleted:{type:"boolean"},maxResults:{type:"integer",minimum:1,maximum:250},pageToken:id},required:["bindingId","calendarId"],additionalProperties:false}},{name:"calendar.events.get",description:"Get one event from one exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id},required:["bindingId","calendarId","eventId"],additionalProperties:false}},{name:"calendar.events.create",description:"Create one event using a previously reviewed event body. Google Calendar write consent must already exist.",httpMethod:"POST",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,event:{type:"object",minProperties:1,maxProperties:64}},required:["bindingId","calendarId","event"],additionalProperties:false}},{name:"calendar.events.update",description:"Replace one event using a previously reviewed event body. Google Calendar write consent must already exist.",httpMethod:"PUT",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id,event:{type:"object",minProperties:1,maxProperties:64}},required:["bindingId","calendarId","eventId","event"],additionalProperties:false}},{name:"calendar.events.respond",description:"Respond as the selected installed account to an event invitation on that account's calendar. The account must be a non-organizer attendee.",httpMethod:"PATCH",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id,responseStatus:{type:"string",enum:["needsAction","declined","tentative","accepted"]}},required:["bindingId","calendarId","eventId","responseStatus"],additionalProperties:false}},{name:"calendar.events.delete",description:"Delete one event through the reviewed Calendar Action.",httpMethod:"DELETE",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id},required:["bindingId","calendarId","eventId"],additionalProperties:false}}];function params(input){if(input.body!==void 0||input.media!==void 0)throw Error("calendar_actions_take_params_only");return input.params}function segment(value){if(typeof value!=="string"||!value||value.length>1024)throw Error("invalid_calendar_identifier");return encodeURIComponent(value)}function query(base,p,fields){const url=new URL(base);for(const[key,name]of Object.entries(fields)){const value=p[key];if(value!==void 0)url.searchParams.set(name,String(value))}return url.href}function body(value){const encoded=JSON.stringify(value);if(!value||typeof value!=="object"||Array.isArray(value)||encoded.length>2e6)throw Error("invalid_calendar_event");return encoded}async function request(auth,bindingId,url,method="GET",event,signal){if(typeof bindingId!=="string"||!bindingId)return fail("invalid_argument","An exact Calendar bindingId is required.");const response=await auth.requestRaw(SOURCE,url,{bindingId,method,...event===void 0?{}:{body:body(event),contentType:"application/json"},...signal?{signal}:{}});if(!("ok"in response))return response;if(response.ok.status===204)return ok({status:204,deleted:true});let parsed;try{parsed=response.ok.body?JSON.parse(response.ok.body):{}}catch{return fail("data_loss","Google Calendar returned malformed JSON.")}if(response.ok.status<200||response.ok.status>=300){const message=parsed&&typeof parsed==="object"&&"error"in parsed?JSON.stringify(parsed.error).slice(0,1e3):"Google Calendar rejected the request.";return fail(response.ok.status===401?"failed_precondition":response.ok.status===403?"permission_denied":response.ok.status===404||response.ok.status===410?"not_found":"unavailable",message)}return ok(parsed)}export function createCalendarActions(auth){return{catalog(){return ok({source:SOURCE,total:methods.length,methods:methods.map(({inputSchema:_,...row})=>({...row,level:1}))})},method(name){const row=methods.find(method=>method.name===name);return row?ok({...structuredClone(row),level:1}):fail("not_found",`Google Calendar has no action ${String(name).slice(0,100)}.`)},async invoke(name,input,options){try{const p=params(input),bindingId=p.bindingId;if(name==="calendar.authorization.prepare")return auth.connect(SOURCE,{automatic:true});if(name==="calendar.authorization.status"){if(typeof p.jobId!=="string"||!p.jobId)return fail("invalid_argument","An authorization jobId is required.");return auth.job(p.jobId)}if(name==="calendar.accounts")return auth.accounts(SOURCE);if(name==="calendar.calendars.list")return request(auth,bindingId,query(`${API}/users/me/calendarList`,p,{maxResults:"maxResults",pageToken:"pageToken"}),"GET",void 0,options?.signal);if(name==="calendar.acl.list")return request(auth,bindingId,query(`${API}/calendars/${segment(p.calendarId)}/acl`,p,{maxResults:"maxResults",pageToken:"pageToken"}),"GET",void 0,options?.signal);if(name==="calendar.acl.get")return request(auth,bindingId,`${API}/calendars/${segment(p.calendarId)}/acl/${segment(p.ruleId)}`,"GET",void 0,options?.signal);const root=`${API}/calendars/${segment(p.calendarId)}/events`;if(name==="calendar.events.list")return request(auth,bindingId,query(root,p,{timeMin:"timeMin",timeMax:"timeMax",query:"q",singleEvents:"singleEvents",showDeleted:"showDeleted",maxResults:"maxResults",pageToken:"pageToken"}),"GET",void 0,options?.signal);if(name==="calendar.events.get")return request(auth,bindingId,`${root}/${segment(p.eventId)}`,"GET",void 0,options?.signal);if(name==="calendar.events.create")return request(auth,bindingId,query(root,{supportsAttachments:true},{supportsAttachments:"supportsAttachments"}),"POST",p.event,options?.signal);if(name==="calendar.events.update")return request(auth,bindingId,query(`${root}/${segment(p.eventId)}`,{supportsAttachments:true},{supportsAttachments:"supportsAttachments"}),"PUT",p.event,options?.signal);if(name==="calendar.events.respond"){const current=await request(auth,bindingId,`${root}/${segment(p.eventId)}`,"GET",void 0,options?.signal);if(!("ok"in current))return current;const event=current.ok;const attendee=Array.isArray(event.attendees)?event.attendees.find(row=>row.self===true):void 0;if(!attendee||attendee.organizer===true||typeof attendee.email!=="string")return fail("failed_precondition","The selected Calendar account is not a non-organizer attendee of this event.");const attendees=event.attendees.map(row=>row===attendee?{...row,responseStatus:p.responseStatus}:row);return request(auth,bindingId,query(`${root}/${segment(p.eventId)}`,{sendUpdates:"none"},{sendUpdates:"sendUpdates"}),"PATCH",{attendees},options?.signal)}if(name==="calendar.events.delete")return request(auth,bindingId,`${root}/${segment(p.eventId)}`,"DELETE",void 0,options?.signal);return fail("not_found",`Google Calendar has no action ${String(name).slice(0,100)}.`)}catch(error){const message=error instanceof Error?error.message:"calendar_action_failed";return fail(options?.signal?.aborted?"aborted":message.startsWith("invalid_")?"invalid_argument":"unavailable",message)}}}}
1
+ import{businessError,ok}from"@zortexhq/plugin-connector-framework/api";const SOURCE="google-calendar",API="https://www.googleapis.com/calendar/v3";const fail=(code,message)=>businessError(code,message,"plugin");const id={type:"string",minLength:1,maxLength:1024};const binding={type:"string",pattern:"^binding_[A-Za-z0-9_-]+$",maxLength:200};const job={type:"string",format:"uuid"};const methods=[{name:"calendar.authorization.prepare",description:"Prepare the full Google Calendar authorization URL and its pending callback job for the calling agent to complete.",httpMethod:"POST",effect:"write",inputSchema:{type:"object",properties:{},additionalProperties:false}},{name:"calendar.authorization.status",description:"Read the state of one prepared Google Calendar authorization job.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{jobId:job},required:["jobId"],additionalProperties:false}},{name:"calendar.accounts",description:"List every installed Google Calendar account binding and its granted scopes. Returns public account metadata only.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{},additionalProperties:false}},{name:"calendar.calendars.list",description:"List calendars for one exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,maxResults:{type:"integer",minimum:1,maximum:250},pageToken:id},required:["bindingId"],additionalProperties:false}},{name:"calendar.acl.list",description:"List access-control rules for one calendar and exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,maxResults:{type:"integer",minimum:1,maximum:250},pageToken:id},required:["bindingId","calendarId"],additionalProperties:false}},{name:"calendar.acl.get",description:"Get one access-control rule from one calendar and exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,ruleId:id},required:["bindingId","calendarId","ruleId"],additionalProperties:false}},{name:"calendar.events.list",description:"List events from one calendar and exact installed account. singleEvents expands recurring series so individual exceptions can be discovered and updated.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,timeMin:{type:"string",format:"date-time"},timeMax:{type:"string",format:"date-time"},query:{type:"string",maxLength:1e3},singleEvents:{type:"boolean"},showDeleted:{type:"boolean"},maxResults:{type:"integer",minimum:1,maximum:250},pageToken:id},required:["bindingId","calendarId"],additionalProperties:false}},{name:"calendar.events.get",description:"Get one event from one exact installed account.",httpMethod:"GET",effect:"read",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id},required:["bindingId","calendarId","eventId"],additionalProperties:false}},{name:"calendar.events.create",description:"Create one event using a previously reviewed event body. Google Calendar write consent must already exist.",httpMethod:"POST",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,event:{type:"object",minProperties:1,maxProperties:64}},required:["bindingId","calendarId","event"],additionalProperties:false}},{name:"calendar.events.update",description:"Replace one event using a previously reviewed event body. Google Calendar write consent must already exist.",httpMethod:"PUT",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id,event:{type:"object",minProperties:1,maxProperties:64}},required:["bindingId","calendarId","eventId","event"],additionalProperties:false}},{name:"calendar.events.respond",description:"Respond as the selected installed account to an event invitation on that account's calendar. The account must be a non-organizer attendee.",httpMethod:"PATCH",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id,responseStatus:{type:"string",enum:["needsAction","declined","tentative","accepted"]}},required:["bindingId","calendarId","eventId","responseStatus"],additionalProperties:false}},{name:"calendar.events.delete",description:"Delete one event through the reviewed Calendar Action.",httpMethod:"DELETE",effect:"write",inputSchema:{type:"object",properties:{bindingId:binding,calendarId:id,eventId:id},required:["bindingId","calendarId","eventId"],additionalProperties:false}}];function params(input){if(input.body!==void 0||input.media!==void 0)throw Error("calendar_actions_take_params_only");return input.params}function segment(value){if(typeof value!=="string"||!value||value.length>1024)throw Error("invalid_calendar_identifier");return encodeURIComponent(value)}function query(base,p,fields){const url=new URL(base);for(const[key,name]of Object.entries(fields)){const value=p[key];if(value!==void 0)url.searchParams.set(name,String(value))}return url.href}function body(value){const encoded=JSON.stringify(value);if(!value||typeof value!=="object"||Array.isArray(value)||encoded.length>2e6)throw Error("invalid_calendar_event");return encoded}async function request(auth,bindingId,url,method="GET",event,signal){if(typeof bindingId!=="string"||!bindingId)return fail("invalid_argument","An exact Calendar bindingId is required.");const response=await auth.requestRaw(SOURCE,url,{bindingId,method,...event===void 0?{}:{body:body(event),contentType:"application/json"},...signal?{signal}:{}});if(!("ok"in response))return response;if(response.ok.status===204)return ok({status:204,deleted:true});let parsed;try{parsed=response.ok.body?JSON.parse(response.ok.body):{}}catch{return fail("data_loss","Google Calendar returned malformed JSON.")}if(response.ok.status<200||response.ok.status>=300){const message=parsed&&typeof parsed==="object"&&"error"in parsed?JSON.stringify(parsed.error).slice(0,1e3):"Google Calendar rejected the request.";return fail(response.ok.status===401?"failed_precondition":response.ok.status===403?"permission_denied":response.ok.status===404||response.ok.status===410?"not_found":"unavailable",message)}return ok(parsed)}export function createCalendarActions(auth){return{catalog(){return ok({source:SOURCE,total:methods.length,methods:methods.map(({inputSchema:_,...row})=>({...row,level:1}))})},method(name){const row=methods.find(method=>method.name===name);return row?ok({...structuredClone(row),level:1}):fail("not_found",`Google Calendar has no action ${String(name).slice(0,100)}.`)},async invoke(name,input,options){try{const p=params(input),bindingId=p.bindingId;if(name==="calendar.authorization.prepare")return auth.connect(SOURCE,{automatic:false,manualPresentation:"return-url",...options?.signal?{signal:options.signal}:{}});if(name==="calendar.authorization.status"){if(typeof p.jobId!=="string"||!p.jobId)return fail("invalid_argument","An authorization jobId is required.");return auth.job(p.jobId)}if(name==="calendar.accounts")return auth.accounts(SOURCE);if(name==="calendar.calendars.list")return request(auth,bindingId,query(`${API}/users/me/calendarList`,p,{maxResults:"maxResults",pageToken:"pageToken"}),"GET",void 0,options?.signal);if(name==="calendar.acl.list")return request(auth,bindingId,query(`${API}/calendars/${segment(p.calendarId)}/acl`,p,{maxResults:"maxResults",pageToken:"pageToken"}),"GET",void 0,options?.signal);if(name==="calendar.acl.get")return request(auth,bindingId,`${API}/calendars/${segment(p.calendarId)}/acl/${segment(p.ruleId)}`,"GET",void 0,options?.signal);const root=`${API}/calendars/${segment(p.calendarId)}/events`;if(name==="calendar.events.list")return request(auth,bindingId,query(root,p,{timeMin:"timeMin",timeMax:"timeMax",query:"q",singleEvents:"singleEvents",showDeleted:"showDeleted",maxResults:"maxResults",pageToken:"pageToken"}),"GET",void 0,options?.signal);if(name==="calendar.events.get")return request(auth,bindingId,`${root}/${segment(p.eventId)}`,"GET",void 0,options?.signal);if(name==="calendar.events.create")return request(auth,bindingId,query(root,{supportsAttachments:true},{supportsAttachments:"supportsAttachments"}),"POST",p.event,options?.signal);if(name==="calendar.events.update")return request(auth,bindingId,query(`${root}/${segment(p.eventId)}`,{supportsAttachments:true},{supportsAttachments:"supportsAttachments"}),"PUT",p.event,options?.signal);if(name==="calendar.events.respond"){const current=await request(auth,bindingId,`${root}/${segment(p.eventId)}`,"GET",void 0,options?.signal);if(!("ok"in current))return current;const event=current.ok;const attendee=Array.isArray(event.attendees)?event.attendees.find(row=>row.self===true):void 0;if(!attendee||attendee.organizer===true||typeof attendee.email!=="string")return fail("failed_precondition","The selected Calendar account is not a non-organizer attendee of this event.");const attendees=event.attendees.map(row=>row===attendee?{...row,responseStatus:p.responseStatus}:row);return request(auth,bindingId,query(`${root}/${segment(p.eventId)}`,{sendUpdates:"none"},{sendUpdates:"sendUpdates"}),"PATCH",{attendees},options?.signal)}if(name==="calendar.events.delete")return request(auth,bindingId,`${root}/${segment(p.eventId)}`,"DELETE",void 0,options?.signal);return fail("not_found",`Google Calendar has no action ${String(name).slice(0,100)}.`)}catch(error){const message=error instanceof Error?error.message:"calendar_action_failed";return fail(options?.signal?.aborted?"aborted":message.startsWith("invalid_")?"invalid_argument":"unavailable",message)}}}}
@@ -1 +1 @@
1
- export*from"./connections.js";export*from"./connection-feedback.js";export*from"./wait-authorization.js";export*from"./connector-utils.js";export*from"./connector-v3.js";export*from"./connectors.js";export*from"./local-read-custody.js";export*from"./selected-account.js";export{isTransientConnectorAction,withTransientConnectorAction}from"../transient-action-context.js";export{currentNativePrincipal,saveNativeReadPermission}from"../native-principal.js";export{createPinnedLoopbackHttp}from"../transport.js";export{continueAuthorizationWithBrowser}from"./browser-authorization.js";
1
+ export*from"./connections.js";export*from"./connection-feedback.js";export*from"./wait-authorization.js";export*from"./connector-utils.js";export*from"./connector-v3.js";export*from"./connectors.js";export*from"./local-read-custody.js";export*from"./selected-account.js";export{isTransientConnectorAction,withTransientConnectorAction}from"../transient-action-context.js";export{currentNativePrincipal,saveNativeReadPermission}from"../native-principal.js";export{createPinnedLoopbackHttp}from"../transport.js";