tavus-cli 0.16.0__tar.gz → 0.17.0__tar.gz

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 (147) hide show
  1. tavus_cli-0.17.0/.release-please-manifest.json +3 -0
  2. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/CHANGELOG.md +7 -0
  3. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/PKG-INFO +14 -2
  4. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/README.md +13 -1
  5. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/packages/tavus/pyproject.toml +2 -2
  6. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/packages/tavus-mcp/pyproject.toml +2 -2
  7. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/pyproject.toml +1 -1
  8. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/__init__.py +1 -1
  9. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/uv.lock +1 -1
  10. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/package-lock.json +2 -2
  11. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/package.json +1 -1
  12. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/index.ts +5 -0
  13. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/slack-bot.ts +25 -7
  14. tavus_cli-0.17.0/workers/tavus-mcp/src/slack-install.ts +241 -0
  15. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/slack-link-store.ts +6 -1
  16. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/tavus.ts +4 -0
  17. tavus_cli-0.17.0/workers/tavus-mcp/src/version.ts +1 -0
  18. tavus_cli-0.17.0/workers/tavus-mcp/test/slack-install.test.ts +255 -0
  19. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/worker-runtime.ts +13 -4
  20. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/wrangler.jsonc +4 -0
  21. tavus_cli-0.16.0/.release-please-manifest.json +0 -3
  22. tavus_cli-0.16.0/workers/tavus-mcp/src/version.ts +0 -1
  23. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.agents/plugins/marketplace.json +0 -0
  24. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.cursor/BUGBOT.md +0 -0
  25. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.env.example +0 -0
  26. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/review-guidelines.md +0 -0
  27. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/ci.yml +0 -0
  28. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/claude-pr-review.yml +0 -0
  29. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/codex-pr-review.yml +0 -0
  30. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/deploy-cloudflare-worker.yml +0 -0
  31. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/e2e.yml +0 -0
  32. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/pr-reviews.yml +0 -0
  33. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/pypi-cli.yml +0 -0
  34. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/tail-cloudflare-worker.yml +0 -0
  35. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.github/workflows/validate-staging-deployment.yml +0 -0
  36. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/.gitignore +0 -0
  37. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/AGENTS.md +0 -0
  38. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/PROMPT.md +0 -0
  39. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/docs/builder-guidance.md +0 -0
  40. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/docs/chatgpt-plugin.md +0 -0
  41. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/docs/gemini-enterprise/README.md +0 -0
  42. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/docs/gemini-enterprise/listing.md +0 -0
  43. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/docs/gemini-enterprise/test-queries.md +0 -0
  44. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/docs/usage-observability.md +0 -0
  45. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/e2e/conftest.py +0 -0
  46. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/e2e/targets.py +0 -0
  47. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/e2e/test_contract.py +0 -0
  48. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/e2e/test_hosted_auth.py +0 -0
  49. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/e2e/test_live.py +0 -0
  50. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/packages/tavus/README.md +0 -0
  51. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/packages/tavus-mcp/README.md +0 -0
  52. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/plugins/tavus-pal/assets/icon-dark.svg +0 -0
  53. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/plugins/tavus-pal/assets/icon.svg +0 -0
  54. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/plugins/tavus-pal/mcp.json +0 -0
  55. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/plugins/tavus-pal/plugin.json +0 -0
  56. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/release-please-config.json +0 -0
  57. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/scripts/__init__.py +0 -0
  58. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/scripts/build_chatgpt_plugin.py +0 -0
  59. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/scripts/check_release_versions.py +0 -0
  60. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/skills/tavus-agentic-pals/SKILL.md +0 -0
  61. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/skills/tavus-agentic-pals/agents/openai.yaml +0 -0
  62. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/skills/tavus-agentic-pals/references/build-and-verify.md +0 -0
  63. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/skills/tavus-agentic-pals/references/builder-workflow.md +0 -0
  64. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/skills/tavus-agentic-pals/references/chat-mode.md +0 -0
  65. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/skills/tavus-agentic-pals/references/examples.md +0 -0
  66. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/builder_guidance.json +0 -0
  67. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/builder_guidance.py +0 -0
  68. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/cli/__init__.py +0 -0
  69. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/cli/main.py +0 -0
  70. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/__init__.py +0 -0
  71. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/auth/__init__.py +0 -0
  72. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/auth/keyring_store.py +0 -0
  73. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/auth/oauth.py +0 -0
  74. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/auth/session.py +0 -0
  75. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/client/__init__.py +0 -0
  76. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/client/http.py +0 -0
  77. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/daily_transport.py +0 -0
  78. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/env.py +0 -0
  79. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/errors.py +0 -0
  80. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/pal_urls.py +0 -0
  81. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/patch.py +0 -0
  82. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/__init__.py +0 -0
  83. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/build_and_verify.py +0 -0
  84. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/capabilities.py +0 -0
  85. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/carrier_builder.py +0 -0
  86. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/connectors.py +0 -0
  87. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/conversations.py +0 -0
  88. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/deployments.py +0 -0
  89. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/face_studio.py +0 -0
  90. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/knowledge.py +0 -0
  91. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/meetings.py +0 -0
  92. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/options.py +0 -0
  93. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/quickstart.py +0 -0
  94. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/scaffold_embed.py +0 -0
  95. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/templates.py +0 -0
  96. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/recipes/tool_reuse.py +0 -0
  97. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/__init__.py +0 -0
  98. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/deployment.py +0 -0
  99. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/face_studio.py +0 -0
  100. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/file_manifest.py +0 -0
  101. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/guardrail.py +0 -0
  102. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/objective.py +0 -0
  103. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/pal.py +0 -0
  104. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/pronunciation.py +0 -0
  105. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/sdk/schemas/tool.py +0 -0
  106. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/src/tavus_mcp/server.py +0 -0
  107. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/conftest.py +0 -0
  108. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/integration/test_cli.py +0 -0
  109. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/integration/test_client.py +0 -0
  110. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/integration/test_mcp_server.py +0 -0
  111. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/integration/test_oauth.py +0 -0
  112. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_auth.py +0 -0
  113. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_build_and_verify.py +0 -0
  114. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_builder.py +0 -0
  115. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_capabilities.py +0 -0
  116. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_connectors.py +0 -0
  117. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_conversations.py +0 -0
  118. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_daily_transport.py +0 -0
  119. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_deployments.py +0 -0
  120. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_env.py +0 -0
  121. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_guardrail_schema.py +0 -0
  122. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_objective_schema.py +0 -0
  123. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_pal_schema.py +0 -0
  124. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_patch.py +0 -0
  125. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_pronunciation_schema.py +0 -0
  126. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_release_versions.py +0 -0
  127. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_scaffold_embed.py +0 -0
  128. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_tool_reuse.py +0 -0
  129. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/tests/unit/test_tool_schema.py +0 -0
  130. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/.dev.vars.example +0 -0
  131. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/oauth-grant.ts +0 -0
  132. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/oauth-session.ts +0 -0
  133. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/oauth.ts +0 -0
  134. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/slack-tools.ts +0 -0
  135. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/src/slack.ts +0 -0
  136. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/builder-guidance.test.ts +0 -0
  137. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/connectors.test.ts +0 -0
  138. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/conversations.test.ts +0 -0
  139. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/oauth-client-credentials.test.ts +0 -0
  140. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/oauth-session.test.ts +0 -0
  141. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/parity.test.ts +0 -0
  142. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/slack-bot.test.ts +0 -0
  143. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/slack-link.test.ts +0 -0
  144. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/slack-tools.test.ts +0 -0
  145. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/test/tavus.test.ts +0 -0
  146. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/tsconfig.json +0 -0
  147. {tavus_cli-0.16.0 → tavus_cli-0.17.0}/workers/tavus-mcp/vitest.config.ts +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.17.0"
3
+ }
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.17.0](https://github.com/Tavus-Engineering/tavus-mcp/compare/v0.16.0...v0.17.0) (2026-11-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **slack:** let any Slack workspace install the Tavus bot ([#111](https://github.com/Tavus-Engineering/tavus-mcp/issues/111)) ([36b8781](https://github.com/Tavus-Engineering/tavus-mcp/commit/36b87811f401a321cc3485e7d4028f85f2acec6c))
9
+
3
10
  ## [0.16.0](https://github.com/Tavus-Engineering/tavus-mcp/compare/v0.15.0...v0.16.0) (2026-11-04)
4
11
 
5
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tavus-cli
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: Tavus CLI and MCP server for agentic PAL creation and editing.
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: fastmcp>=2.0.0
@@ -110,10 +110,22 @@ Worker rejects anything older than five minutes.
110
110
  - Set the Worker secrets `SLACK_SIGNING_SECRET` (the Slack app's signing secret)
111
111
  and `SLACK_BOT_TOKEN` (the bot token that starts with `xoxb-`). Linking also
112
112
  needs `SLACK_BOT_SECRET` and `MCP_OAUTH_SIGNING_SECRET`, as described above.
113
+ - Other workspaces install the bot at `GET /slack/install`. It sends the
114
+ installer to Slack with the bot scopes, and `GET /slack/install/callback`
115
+ saves that workspace's bot token, encrypted, in `SLACK_LINKS` under
116
+ `install:<team ID>`. The bot posts to a workspace with its saved token. Only
117
+ the workspace named by `SLACK_BOT_TEAM_ID` falls back to `SLACK_BOT_TOKEN`;
118
+ the bot does not reply in any other workspace without a saved token.
119
+ Org-wide Enterprise Grid installs are refused. Set the
120
+ Worker secrets `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET`, add
121
+ `https://mcp.tavus.io/slack/install/callback` to the app's redirect URLs, and
122
+ set the app's direct install URL to `https://mcp.tavus.io/slack/install`.
123
+ The saved token is deleted when Slack sends `app_uninstalled` or
124
+ `tokens_revoked`.
113
125
  - In the Slack app, turn Socket Mode off, set the slash command URL to
114
126
  `https://mcp.tavus.io/slack/commands`, set the Event Subscriptions request URL
115
127
  to `https://mcp.tavus.io/slack/events`, and subscribe to the bot events
116
- `app_mention` and `message.im`. The bot scopes are `commands`,
128
+ `app_mention`, `message.im`, `app_uninstalled` and `tokens_revoked`. The bot scopes are `commands`,
117
129
  `app_mentions:read`, `chat:write` and `im:history`.
118
130
  - Commands: `pals`, `chat <PAL> <message>`, `recent [PAL]`, `transcript <id>`,
119
131
  `link` and `unlink`. A user replies in a chat thread with `@Tavus` to continue
@@ -87,10 +87,22 @@ Worker rejects anything older than five minutes.
87
87
  - Set the Worker secrets `SLACK_SIGNING_SECRET` (the Slack app's signing secret)
88
88
  and `SLACK_BOT_TOKEN` (the bot token that starts with `xoxb-`). Linking also
89
89
  needs `SLACK_BOT_SECRET` and `MCP_OAUTH_SIGNING_SECRET`, as described above.
90
+ - Other workspaces install the bot at `GET /slack/install`. It sends the
91
+ installer to Slack with the bot scopes, and `GET /slack/install/callback`
92
+ saves that workspace's bot token, encrypted, in `SLACK_LINKS` under
93
+ `install:<team ID>`. The bot posts to a workspace with its saved token. Only
94
+ the workspace named by `SLACK_BOT_TEAM_ID` falls back to `SLACK_BOT_TOKEN`;
95
+ the bot does not reply in any other workspace without a saved token.
96
+ Org-wide Enterprise Grid installs are refused. Set the
97
+ Worker secrets `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET`, add
98
+ `https://mcp.tavus.io/slack/install/callback` to the app's redirect URLs, and
99
+ set the app's direct install URL to `https://mcp.tavus.io/slack/install`.
100
+ The saved token is deleted when Slack sends `app_uninstalled` or
101
+ `tokens_revoked`.
90
102
  - In the Slack app, turn Socket Mode off, set the slash command URL to
91
103
  `https://mcp.tavus.io/slack/commands`, set the Event Subscriptions request URL
92
104
  to `https://mcp.tavus.io/slack/events`, and subscribe to the bot events
93
- `app_mention` and `message.im`. The bot scopes are `commands`,
105
+ `app_mention`, `message.im`, `app_uninstalled` and `tokens_revoked`. The bot scopes are `commands`,
94
106
  `app_mentions:read`, `chat:write` and `im:history`.
95
107
  - Commands: `pals`, `chat <PAL> <message>`, `recent [PAL]`, `transcript <id>`,
96
108
  `link` and `unlink`. A user replies in a chat thread with `@Tavus` to continue
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "tavus"
3
- version = "0.16.0" # x-release-please-version
3
+ version = "0.17.0" # x-release-please-version
4
4
  description = "Official alias for tavus-cli, the Tavus CLI and MCP server."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  dependencies = [
8
- "tavus-cli==0.16.0", # x-release-please-version
8
+ "tavus-cli==0.17.0", # x-release-please-version
9
9
  ]
10
10
 
11
11
  [project.urls]
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "tavus-mcp"
3
- version = "0.16.0" # x-release-please-version
3
+ version = "0.17.0" # x-release-please-version
4
4
  description = "Official alias for tavus-cli, which provides the tavus-mcp MCP server."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
7
7
  dependencies = [
8
- "tavus-cli==0.16.0", # x-release-please-version
8
+ "tavus-cli==0.17.0", # x-release-please-version
9
9
  ]
10
10
 
11
11
  [project.urls]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tavus-cli"
3
- version = "0.16.0"
3
+ version = "0.17.0"
4
4
  description = "Tavus CLI and MCP server for agentic PAL creation and editing."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,4 +1,4 @@
1
1
  """Tavus CLI and MCP server package."""
2
2
 
3
3
  __all__ = ["__version__"]
4
- __version__ = "0.16.0" # x-release-please-version
4
+ __version__ = "0.17.0" # x-release-please-version
@@ -1303,7 +1303,7 @@ wheels = [
1303
1303
 
1304
1304
  [[package]]
1305
1305
  name = "tavus-cli"
1306
- version = "0.16.0"
1306
+ version = "0.17.0"
1307
1307
  source = { editable = "." }
1308
1308
  dependencies = [
1309
1309
  { name = "fastmcp" },
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@tavus/tavus-mcp-worker",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@tavus/tavus-mcp-worker",
9
- "version": "0.16.0",
9
+ "version": "0.17.0",
10
10
  "dependencies": {
11
11
  "@modelcontextprotocol/sdk": "^1.29.0",
12
12
  "agents": "^0.12.2",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tavus/tavus-mcp-worker",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -2,6 +2,7 @@ import { createMcpHandler } from "agents/mcp";
2
2
 
3
3
  import { handleOAuthRequest, oauthUnauthorizedHeaders, resolveMcpApiKey } from "./oauth";
4
4
  import { handleSlackBotRequest } from "./slack-bot";
5
+ import { handleSlackInstallRequest } from "./slack-install";
5
6
  import { handleSlackRequest, isSlackBotCredential, isSlackRequest, resolveSlackApiKey } from "./slack";
6
7
  import {
7
8
  authorizationError,
@@ -28,6 +29,10 @@ export default {
28
29
  headers: { "Content-Type": "text/plain; charset=utf-8" },
29
30
  });
30
31
  }
32
+ const slackInstallResponse = await handleSlackInstallRequest(request, env);
33
+ if (slackInstallResponse) {
34
+ return slackInstallResponse;
35
+ }
31
36
  const slackBotResponse = await handleSlackBotRequest(request, env, ctx);
32
37
  if (slackBotResponse) {
33
38
  return slackBotResponse;
@@ -3,6 +3,7 @@ import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
3
3
 
4
4
  import { openPayload, sealPayload, oauthSigningSecret, timingSafeEqual } from "./oauth";
5
5
  import { formatToolHelp, formatToolResult, formatTools, prepareToolRun, type ToolInfo } from "./slack-tools";
6
+ import { removeSlackInstall, slackBotToken, slackInstallUrl } from "./slack-install";
6
7
  import { createLinkUrl, linkedAccount, type SlackIdentity, slackIdentity, unlinkAccount } from "./slack";
7
8
  import { createTavusMcpServer, type Env, replicaHasJoined } from "./tavus";
8
9
 
@@ -138,10 +139,14 @@ async function handleEvent(
138
139
  if (payload?.type === "url_verification" && typeof payload.challenge === "string") {
139
140
  return new Response(payload.challenge, { headers: { "Content-Type": "text/plain" } });
140
141
  }
142
+ const event = (payload?.event ?? {}) as Fields;
143
+ if (payload?.type === "event_callback" && (event.type === "app_uninstalled" || (event.type === "tokens_revoked" && hasBotTokens(event)))) {
144
+ await removeSlackInstall(env, payload.team_id, payload.event_time);
145
+ return new Response(null, { status: 200 });
146
+ }
141
147
  if (request.headers.has("X-Slack-Retry-Num") || payload?.type !== "event_callback") {
142
148
  return new Response(null, { status: 200 });
143
149
  }
144
- const event = (payload.event ?? {}) as Fields;
145
150
  const identity = slackIdentity(payload.team_id, event.user);
146
151
  const channel = typeof event.channel === "string" ? event.channel : "";
147
152
  const text = typeof event.text === "string" ? event.text : "";
@@ -202,7 +207,7 @@ interface EventContext extends Omit<CommandContext, "reply" | "text"> {
202
207
  }
203
208
 
204
209
  async function runEvent(e: EventContext): Promise<void> {
205
- const reply: Reply = (message) => postMessage(e.env, e.channel, message, e.thread).then(() => undefined);
210
+ const reply: Reply = (message) => postMessage(e.env, e.identity.team_id, e.channel, message, e.thread).then(() => undefined);
206
211
  try {
207
212
  const state = e.isReply || !e.isDirectMessage ? await loadChat(e.env, e.identity, e.channel, e.thread) : undefined;
208
213
  if (state) {
@@ -263,7 +268,7 @@ async function runTool(c: CommandContext, call: ToolCaller, name: string, args:
263
268
 
264
269
  async function runToolJob(env: Env, job: ToolJob): Promise<void> {
265
270
  const reply = async (text: string): Promise<void> => {
266
- if (!job.response_url) return void (await postMessage(env, job.channel, text, job.thread));
271
+ if (!job.response_url) return void (await postMessage(env, job.identity.team_id, job.channel, text, job.thread));
267
272
  await fetch(job.response_url, {
268
273
  method: "POST",
269
274
  headers: { "Content-Type": "application/json" },
@@ -295,8 +300,11 @@ async function startChat(c: CommandContext, call: ToolCaller, words: string[]):
295
300
  if (!message) return c.reply("Usage: `/tavus chat <PAL name or ID> <message>`");
296
301
  let thread = c.directThread;
297
302
  if (!thread) {
298
- const posted = await postMessage(c.env, c.channel, `<@${c.identity.user_id}> chat with *${pal.name}*: ${plain(message)}`);
303
+ const posted = await postMessage(c.env, c.identity.team_id, c.channel, `<@${c.identity.user_id}> chat with *${pal.name}*: ${plain(message)}`);
299
304
  if (!posted.ts) {
305
+ if (posted.error === "not_installed") {
306
+ return c.reply(`Tavus isn't fully installed in this workspace. Add it again at ${slackInstallUrl(c.origin)}`);
307
+ }
300
308
  return c.reply(
301
309
  posted.error === "not_in_channel" || posted.error === "channel_not_found"
302
310
  ? "Invite @Tavus to this channel first, or message it directly."
@@ -320,7 +328,7 @@ async function startChat(c: CommandContext, call: ToolCaller, words: string[]):
320
328
 
321
329
  export async function runJob(env: Env, job: SlackJob): Promise<void> {
322
330
  if (job.kind === "tool") return runToolJob(env, job);
323
- const reply = (text: string) => postMessage(env, job.channel, text, job.thread).then(() => undefined);
331
+ const reply = (text: string) => postMessage(env, job.identity.team_id, job.channel, text, job.thread).then(() => undefined);
324
332
  try {
325
333
  if (!job.link_id) throw new AccountChanged();
326
334
  const call = await toolCaller({ env, identity: job.identity, origin: job.origin }, job.link_id);
@@ -511,6 +519,11 @@ async function failureMessage(
511
519
  return isPrivate ? `Something went wrong: ${message.slice(0, 300)}` : "Something went wrong. Try again in a minute.";
512
520
  }
513
521
 
522
+ function hasBotTokens(event: Fields): boolean {
523
+ const tokens = event.tokens as { bot?: unknown } | undefined;
524
+ return Array.isArray(tokens?.bot) && tokens.bot.length > 0;
525
+ }
526
+
514
527
  function isDirectChannel(channel: string): boolean {
515
528
  return channel.startsWith("D");
516
529
  }
@@ -532,11 +545,16 @@ function plain(text: string): string {
532
545
  return text.replace(/<!([a-z]+)[^>]*>/gi, "@$1").replace(/<@([A-Z0-9]+)(\|[^>]*)?>/g, "@$1");
533
546
  }
534
547
 
535
- async function postMessage(env: Env, channel: string, text: string, thread?: string): Promise<{ ts?: string; error?: string }> {
548
+ async function postMessage(env: Env, teamId: string, channel: string, text: string, thread?: string): Promise<{ ts?: string; error?: string }> {
549
+ const token = await slackBotToken(env, teamId);
550
+ if (!token) {
551
+ console.warn("slack_bot_not_installed", { team_id: teamId });
552
+ return { error: "not_installed" };
553
+ }
536
554
  const base = env.SLACK_API_BASE_URL ?? "https://slack.com/api";
537
555
  const response = await fetch(`${base}/chat.postMessage`, {
538
556
  method: "POST",
539
- headers: { "Content-Type": "application/json; charset=utf-8", Authorization: `Bearer ${env.SLACK_BOT_TOKEN ?? ""}` },
557
+ headers: { "Content-Type": "application/json; charset=utf-8", Authorization: `Bearer ${token}` },
540
558
  body: JSON.stringify({ channel, text, unfurl_links: false, unfurl_media: false, ...(thread ? { thread_ts: thread } : {}) }),
541
559
  });
542
560
  const result = (await response.json().catch(() => ({}))) as { ok?: boolean; ts?: string; error?: string };
@@ -0,0 +1,241 @@
1
+ import { isFresh, oauthSigningSecret, openPayload, sealPayload, timingSafeEqual } from "./oauth";
2
+ import type { Env } from "./tavus";
3
+
4
+ const INSTALL_ROUTE = "/slack/install";
5
+ const INSTALL_CALLBACK_ROUTE = "/slack/install/callback";
6
+ const INSTALL_STATE_TTL_SECONDS = 10 * 60;
7
+ const STATE_COOKIE = "tavus_slack_install";
8
+ const BOT_SCOPES = ["app_mentions:read", "chat:write", "commands", "im:history"];
9
+ const TEAM_ID = /^[A-Z0-9]{2,32}$/;
10
+ const MIN_CLIENT_SECRET_LENGTH = 16;
11
+ const CLEAR_STATE_COOKIE = `${STATE_COOKIE}=; Path=/slack/install; Max-Age=0; HttpOnly; Secure; SameSite=Lax`;
12
+ const DOCS_URL = "https://docs.tavus.io/sections/conversational-video-interface/pal/slack-connector";
13
+
14
+ interface InstallState {
15
+ version: 1;
16
+ purpose: "slack_install";
17
+ nonce: string;
18
+ issued_at: number;
19
+ }
20
+
21
+ interface BotInstall {
22
+ bot_token: string;
23
+ installed_at?: number;
24
+ team_name?: string;
25
+ app_id?: string;
26
+ }
27
+
28
+ export async function handleSlackInstallRequest(request: Request, env: Env): Promise<Response | null> {
29
+ const url = new URL(request.url);
30
+ if (url.pathname !== INSTALL_ROUTE && url.pathname !== INSTALL_CALLBACK_ROUTE) return null;
31
+ if (request.method !== "GET") {
32
+ return new Response("Method Not Allowed", { status: 405, headers: { Allow: "GET" } });
33
+ }
34
+ const secret = oauthSigningSecret(env);
35
+ const client = slackClient(env);
36
+ if (!secret || !env.SLACK_LINKS || !client) {
37
+ return page("Installing Tavus in Slack is not set up yet.", 503);
38
+ }
39
+ return url.pathname === INSTALL_ROUTE
40
+ ? startInstall(url, env, secret, client.id)
41
+ : finishInstall(request, url, env, secret, client);
42
+ }
43
+
44
+ export async function slackBotToken(env: Env, teamId: string): Promise<string | undefined> {
45
+ if (!TEAM_ID.test(teamId)) return undefined;
46
+ const secret = oauthSigningSecret(env);
47
+ if (secret && env.SLACK_LINKS) {
48
+ const sealed = await env.SLACK_LINKS.getByName(installName(teamId)).get();
49
+ const install = sealed ? await openPayload<BotInstall>(sealed, secret) : null;
50
+ if (typeof install?.bot_token === "string" && install.bot_token) return install.bot_token;
51
+ }
52
+ const homeToken = env.SLACK_BOT_TOKEN?.trim();
53
+ return homeToken && env.SLACK_BOT_TEAM_ID === teamId ? homeToken : undefined;
54
+ }
55
+
56
+ export async function removeSlackInstall(env: Env, teamId: unknown, eventTime: unknown): Promise<void> {
57
+ if (typeof teamId !== "string" || !TEAM_ID.test(teamId) || !env.SLACK_LINKS) return;
58
+ const store = env.SLACK_LINKS.getByName(installName(teamId));
59
+ const secret = oauthSigningSecret(env);
60
+ const sealed = await store.get();
61
+ if (!sealed) return;
62
+ const install = secret ? await openPayload<BotInstall>(sealed, secret) : null;
63
+ if (typeof eventTime === "number" && typeof install?.installed_at === "number" && eventTime <= install.installed_at) return;
64
+ await store.removeIf(sealed);
65
+ }
66
+
67
+ export function slackInstallUrl(origin: string): string {
68
+ return new URL(INSTALL_ROUTE, origin).href;
69
+ }
70
+
71
+ async function startInstall(url: URL, env: Env, secret: string, clientId: string): Promise<Response> {
72
+ const nonce = randomToken();
73
+ const state = await sealPayload<InstallState>({ version: 1, purpose: "slack_install", nonce, issued_at: now() }, installStateSecret(secret));
74
+ const authorize = new URL(`${slackOAuthBase(env)}/oauth/v2/authorize`);
75
+ authorize.searchParams.set("client_id", clientId);
76
+ authorize.searchParams.set("scope", BOT_SCOPES.join(","));
77
+ authorize.searchParams.set("redirect_uri", new URL(INSTALL_CALLBACK_ROUTE, url.origin).href);
78
+ authorize.searchParams.set("state", state);
79
+ const team = url.searchParams.get("team");
80
+ if (team && TEAM_ID.test(team)) authorize.searchParams.set("team", team);
81
+ return new Response(null, {
82
+ status: 302,
83
+ headers: {
84
+ Location: authorize.href,
85
+ "Set-Cookie": `${STATE_COOKIE}=${nonce}; Path=${INSTALL_ROUTE}; Max-Age=${INSTALL_STATE_TTL_SECONDS}; HttpOnly; Secure; SameSite=Lax`,
86
+ "Cache-Control": "no-store",
87
+ },
88
+ });
89
+ }
90
+
91
+ async function finishInstall(
92
+ request: Request,
93
+ url: URL,
94
+ env: Env,
95
+ secret: string,
96
+ client: { id: string; secret: string },
97
+ ): Promise<Response> {
98
+ if (url.searchParams.get("error")) {
99
+ return page("Tavus was not added to Slack. Use Try again below to start over.", 400, true);
100
+ }
101
+ const code = url.searchParams.get("code");
102
+ const sealedState = url.searchParams.get("state");
103
+ const state = sealedState ? await openPayload<InstallState>(sealedState, installStateSecret(secret)) : null;
104
+ const cookieNonce = readCookie(request, STATE_COOKIE);
105
+ if (
106
+ !code ||
107
+ !state ||
108
+ state.purpose !== "slack_install" ||
109
+ typeof state.nonce !== "string" ||
110
+ !isFresh(state.issued_at, INSTALL_STATE_TTL_SECONDS) ||
111
+ !cookieNonce ||
112
+ !(await timingSafeEqual(state.nonce, cookieNonce))
113
+ ) {
114
+ return page("This install link expired. Use Try again below to start over.", 400, true);
115
+ }
116
+ const response = await fetch(`${slackApiBase(env)}/oauth.v2.access`, {
117
+ method: "POST",
118
+ headers: { "Content-Type": "application/x-www-form-urlencoded" },
119
+ body: new URLSearchParams({
120
+ client_id: client.id,
121
+ client_secret: client.secret,
122
+ code,
123
+ redirect_uri: new URL(INSTALL_CALLBACK_ROUTE, url.origin).href,
124
+ }).toString(),
125
+ }).catch((error: unknown) => {
126
+ console.warn("slack_install_exchange_failed", { error: error instanceof Error ? error.message : String(error) });
127
+ return undefined;
128
+ });
129
+ if (!response) return page("Slack could not be reached. Use Try again below to start over.", 502, true);
130
+ const result = (await response.json().catch(() => ({}))) as {
131
+ ok?: boolean;
132
+ error?: string;
133
+ token_type?: string;
134
+ access_token?: string;
135
+ app_id?: string;
136
+ team?: { id?: string; name?: string } | null;
137
+ enterprise?: { id?: string } | null;
138
+ is_enterprise_install?: boolean;
139
+ };
140
+ if (result.ok && result.is_enterprise_install) {
141
+ console.warn("slack_install_refused", { reason: "enterprise_install", enterprise_id: result.enterprise?.id ?? null });
142
+ if (result.access_token) await revokeToken(env, result.access_token);
143
+ return page("Tavus can't be installed across a whole Enterprise Grid organization yet. Install it in one workspace instead.", 400, true);
144
+ }
145
+ const teamId = result.team?.id;
146
+ if (!result.ok || result.token_type !== "bot" || !result.access_token || !teamId || !TEAM_ID.test(teamId)) {
147
+ console.warn("slack_install_failed", { error: result.error ?? "missing_bot_token", status: response.status });
148
+ return page("Slack did not finish adding Tavus. Use Try again below to start over.", 502, true);
149
+ }
150
+ await env.SLACK_LINKS!.getByName(installName(teamId)).put(
151
+ await sealPayload<BotInstall>({ bot_token: result.access_token, installed_at: now(), team_name: result.team?.name, app_id: result.app_id }, secret),
152
+ );
153
+ console.info("slack_install_saved", { team_id: teamId, enterprise_id: result.enterprise?.id ?? null });
154
+ const openSlack = new URL("https://slack.com/app_redirect");
155
+ if (result.app_id) openSlack.searchParams.set("app", result.app_id);
156
+ openSlack.searchParams.set("team", teamId);
157
+ return installedPage(result.team?.name ?? "your workspace", openSlack.href);
158
+ }
159
+
160
+ async function revokeToken(env: Env, token: string): Promise<void> {
161
+ const response = await fetch(`${slackApiBase(env)}/auth.revoke`, {
162
+ method: "POST",
163
+ headers: { "Content-Type": "application/x-www-form-urlencoded", Authorization: `Bearer ${token}` },
164
+ body: "",
165
+ }).catch(() => undefined);
166
+ const result = (await response?.json().catch(() => ({}))) as { ok?: boolean; error?: string } | undefined;
167
+ if (!result?.ok) console.warn("slack_install_revoke_failed", { error: result?.error ?? "request_failed" });
168
+ }
169
+
170
+ function slackClient(env: Env): { id: string; secret: string } | undefined {
171
+ const id = env.SLACK_CLIENT_ID?.trim();
172
+ const secret = env.SLACK_CLIENT_SECRET?.trim();
173
+ return id && secret && secret.length >= MIN_CLIENT_SECRET_LENGTH ? { id, secret } : undefined;
174
+ }
175
+
176
+ function installStateSecret(secret: string): string {
177
+ return `${secret}:slack-install-state`;
178
+ }
179
+
180
+ function installName(teamId: string): string {
181
+ return `install:${teamId}`;
182
+ }
183
+
184
+ function slackApiBase(env: Env): string {
185
+ return env.SLACK_API_BASE_URL ?? "https://slack.com/api";
186
+ }
187
+
188
+ function slackOAuthBase(env: Env): string {
189
+ return env.SLACK_OAUTH_BASE_URL ?? "https://slack.com";
190
+ }
191
+
192
+ function readCookie(request: Request, name: string): string | undefined {
193
+ for (const part of (request.headers.get("Cookie") ?? "").split(";")) {
194
+ const [key, ...value] = part.trim().split("=");
195
+ if (key === name) return value.join("=");
196
+ }
197
+ return undefined;
198
+ }
199
+
200
+ function randomToken(): string {
201
+ let binary = "";
202
+ for (const byte of crypto.getRandomValues(new Uint8Array(32))) binary += String.fromCharCode(byte);
203
+ return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
204
+ }
205
+
206
+ function now(): number {
207
+ return Math.floor(Date.now() / 1000);
208
+ }
209
+
210
+ function escapeHtml(text: string): string {
211
+ return text.replace(/[&<>"']/g, (char) => `&#${char.charCodeAt(0)};`);
212
+ }
213
+
214
+ function installedPage(teamName: string, openSlackUrl: string): Response {
215
+ return html(
216
+ `<h1>Tavus is in Slack</h1>
217
+ <p>Tavus is now installed in <strong>${escapeHtml(teamName)}</strong>.</p>
218
+ <ol>
219
+ <li>In any channel or in a direct message with Tavus, type <code>/tavus link</code> and sign in to your Tavus account.</li>
220
+ <li>Type <code>/tavus pals</code> to see your PALs, or <code>/tavus help</code> for every command.</li>
221
+ <li>To let your PALs read and post in Slack during conversations, open <a href="https://maker.tavus.io">Tavus</a>, go to <strong>Connectors &amp; Tools</strong>, and connect Slack.</li>
222
+ </ol>
223
+ <p><a href="${escapeHtml(openSlackUrl)}">Open Slack</a> · <a href="${DOCS_URL}">Read the guide</a></p>`,
224
+ 200,
225
+ );
226
+ }
227
+
228
+ function page(message: string, status: number, retry = false): Response {
229
+ const again = retry ? ` <a href="${INSTALL_ROUTE}">Try again</a>.` : "";
230
+ return html(`<h1>Tavus for Slack</h1><p>${escapeHtml(message)}${again}</p><p><a href="${DOCS_URL}">Read the guide</a></p>`, status);
231
+ }
232
+
233
+ function html(body: string, status: number): Response {
234
+ return new Response(
235
+ `<!doctype html><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Tavus for Slack</title><body style="font-family:system-ui;max-width:36rem;margin:4rem auto;padding:0 1rem;line-height:1.5">${body}</body>`,
236
+ {
237
+ status,
238
+ headers: { "Content-Type": "text/html; charset=utf-8", "Cache-Control": "no-store", "Set-Cookie": CLEAR_STATE_COOKIE },
239
+ },
240
+ );
241
+ }
@@ -7,6 +7,7 @@ export interface SlackLinkStoreStub {
7
7
  put(encryptedKey: string): Promise<void>;
8
8
  get(): Promise<string | null>;
9
9
  remove(): Promise<void>;
10
+ removeIf(encryptedKey: string): Promise<void>;
10
11
  run(job: string): Promise<void>;
11
12
  claimTurn(token: string): Promise<boolean>;
12
13
  releaseTurn(token: string): Promise<void>;
@@ -18,7 +19,7 @@ export interface SlackLinkStoreBinding {
18
19
  }
19
20
 
20
21
  // One object per Slack team and user holds the Tavus account key that person linked.
21
- // Other names reuse the same single-slot storage: `chat:` objects remember a chat thread and
22
+ // Other names reuse the same single-slot storage: `install:` objects hold a workspace's bot token, `chat:` objects remember a chat thread and
22
23
  // `job:` objects run one slow chat turn from an alarm, which a request's 30-second background limit would cut off.
23
24
  export class SlackLinkStore extends DurableObject {
24
25
  constructor(ctx: DurableObjectState, env: Cloudflare.Env) {
@@ -73,6 +74,10 @@ export class SlackLinkStore extends DurableObject {
73
74
  this.ctx.storage.sql.exec(`DELETE FROM link`);
74
75
  }
75
76
 
77
+ removeIf(encryptedKey: string): void {
78
+ this.ctx.storage.sql.exec(`DELETE FROM link WHERE encrypted_key = ?`, encryptedKey);
79
+ }
80
+
76
81
  async run(job: string): Promise<void> {
77
82
  await this.ctx.storage.put("job", job);
78
83
  await this.ctx.storage.setAlarm(Date.now());
@@ -53,8 +53,12 @@ export interface Env {
53
53
  SLACK_BOT_SECRET?: string;
54
54
  SLACK_SIGNING_SECRET?: string;
55
55
  SLACK_BOT_TOKEN?: string;
56
+ SLACK_BOT_TEAM_ID?: string;
56
57
  SLACK_REPLICA_WAIT_SECONDS?: string;
57
58
  SLACK_API_BASE_URL?: string;
59
+ SLACK_OAUTH_BASE_URL?: string;
60
+ SLACK_CLIENT_ID?: string;
61
+ SLACK_CLIENT_SECRET?: string;
58
62
  SLACK_LINKS?: SlackLinkStoreBinding;
59
63
  }
60
64
 
@@ -0,0 +1 @@
1
+ export const VERSION = "0.17.0"; // x-release-please-version