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/dist/cli.js +92 -92
- package/package.json +1 -1
- package/ts/profiles.ts +8 -2
package/package.json
CHANGED
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
|
-
|
|
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 (
|
|
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(
|