slack-term 1.37.0 → 1.37.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slack-term",
3
- "version": "1.37.0",
3
+ "version": "1.37.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/snomiao/slack-term.git"
package/ts/profiles.ts CHANGED
@@ -268,10 +268,16 @@ export function resolveToken(workspaceFlag?: string): string {
268
268
  // Bot tokens in shell env or .env files must not shadow workspace profiles.
269
269
  const legacyEnvToken = process.env.SLACK_BOT_TOKEN ?? process.env.SLACK_MCP_XOXP_TOKEN;
270
270
  if (legacyEnvToken && names.length === 0) return legacyEnvToken;
271
- if (legacyEnvToken && names.length > 0) {
271
+ // A bot token (xoxb-) belongs in SLACK_BOT_TOKEN: it is how `slack ask` / --as-bot send, and
272
+ // ~/.config/slack-cli/.env is its documented home. It never stands in for the user token, so it is
273
+ // no conflict; warn only about a *user* token parked in the legacy variables.
274
+ const legacyUserToken = [process.env.SLACK_BOT_TOKEN, process.env.SLACK_MCP_XOXP_TOKEN].find(
275
+ (t) => t && !t.startsWith("xoxb-"),
276
+ );
277
+ if (legacyUserToken && names.length > 0) {
272
278
  // Warn only when the token differs from what's in .env.local (same value = not a real conflict)
273
279
  const envFileToken = walkDirEnv(process.cwd(), ["SLACK_BOT_TOKEN", "SLACK_MCP_XOXP_TOKEN"]);
274
- if (legacyEnvToken !== envFileToken) {
280
+ if (legacyUserToken !== envFileToken) {
275
281
  if (!(globalThis as Record<string, unknown>).__slackEnvWarnShown) {
276
282
  (globalThis as Record<string, unknown>).__slackEnvWarnShown = true;
277
283
  console.error(