agent-messenger 2.6.1 → 2.6.2
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/.claude-plugin/plugin.json +1 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/channeltalk/cli.js +1 -1
- package/dist/src/platforms/channeltalk/cli.js.map +1 -1
- package/dist/src/platforms/channeltalk/client.js +1 -1
- package/dist/src/platforms/channeltalk/client.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts +2 -0
- package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.js +9 -3
- package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/client.js +1 -1
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.d.ts +1 -0
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js +6 -3
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/cli.js +1 -1
- package/dist/src/platforms/slack/cli.js.map +1 -1
- package/dist/src/platforms/slack/client.js +1 -1
- package/dist/src/platforms/slack/client.js.map +1 -1
- package/dist/src/platforms/slack/commands/auth.d.ts +1 -0
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/auth.js +8 -5
- package/dist/src/platforms/slack/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/client.js +1 -1
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts +1 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +12 -7
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/package.json +1 -1
- package/skills/agent-channeltalk/SKILL.md +3 -3
- package/skills/agent-channeltalk/references/authentication.md +3 -3
- package/skills/agent-channeltalk/templates/monitor-chat.sh +1 -1
- package/skills/agent-channeltalk/templates/post-message.sh +2 -2
- package/skills/agent-channeltalk/templates/workspace-summary.sh +1 -1
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +1 -1
- package/skills/agent-slack/references/authentication.md +3 -3
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +1 -1
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/channeltalk/cli.ts +1 -1
- package/src/platforms/channeltalk/client.ts +1 -1
- package/src/platforms/channeltalk/commands/auth.test.ts +4 -2
- package/src/platforms/channeltalk/commands/auth.ts +11 -3
- package/src/platforms/discord/client.ts +1 -1
- package/src/platforms/discord/commands/auth.test.ts +5 -0
- package/src/platforms/discord/commands/auth.ts +7 -3
- package/src/platforms/slack/cli.ts +1 -1
- package/src/platforms/slack/client.ts +1 -1
- package/src/platforms/slack/commands/auth.test.ts +31 -6
- package/src/platforms/slack/commands/auth.ts +9 -5
- package/src/platforms/teams/client.ts +1 -1
- package/src/platforms/teams/commands/auth.test.ts +5 -0
- package/src/platforms/teams/commands/auth.ts +14 -7
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
|
|
2
2
|
|
|
3
|
+
import { getNoDiscordTokenFoundMessage } from './auth'
|
|
3
4
|
import { DiscordClient } from '../client'
|
|
4
5
|
import { DiscordCredentialManager } from '../credential-manager'
|
|
5
6
|
import { DiscordTokenExtractor } from '../token-extractor'
|
|
@@ -82,3 +83,7 @@ test('status: returns auth state', async () => {
|
|
|
82
83
|
expect(config.token).toBeNull()
|
|
83
84
|
expect(config.current_server).toBeNull()
|
|
84
85
|
})
|
|
86
|
+
|
|
87
|
+
test('no-token message mentions desktop app and browser fallback', () => {
|
|
88
|
+
expect(getNoDiscordTokenFoundMessage()).toContain('desktop app or a supported Chromium browser')
|
|
89
|
+
})
|
|
@@ -39,7 +39,7 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
39
39
|
console.log(
|
|
40
40
|
formatOutput(
|
|
41
41
|
{
|
|
42
|
-
error:
|
|
42
|
+
error: getNoDiscordTokenFoundMessage(),
|
|
43
43
|
hint: options.debug ? undefined : 'Run with --debug for more info.',
|
|
44
44
|
},
|
|
45
45
|
options.pretty,
|
|
@@ -121,7 +121,7 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
121
121
|
formatOutput(
|
|
122
122
|
{
|
|
123
123
|
error: 'No usable Discord token found. Tokens may be expired or have no servers.',
|
|
124
|
-
hint: 'Make sure Discord is logged in and you are a member of at least one server.',
|
|
124
|
+
hint: 'Make sure Discord is logged in to the desktop app or a supported Chromium browser, and that you are a member of at least one server.',
|
|
125
125
|
},
|
|
126
126
|
options.pretty,
|
|
127
127
|
),
|
|
@@ -184,11 +184,15 @@ export async function statusAction(options: { pretty?: boolean }): Promise<void>
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
+
export function getNoDiscordTokenFoundMessage(): string {
|
|
188
|
+
return 'No Discord token found. Make sure Discord is logged in to the desktop app or a supported Chromium browser.'
|
|
189
|
+
}
|
|
190
|
+
|
|
187
191
|
export const authCommand = new Command('auth')
|
|
188
192
|
.description('Authentication commands')
|
|
189
193
|
.addCommand(
|
|
190
194
|
new Command('extract')
|
|
191
|
-
.description('Extract token from Discord desktop app')
|
|
195
|
+
.description('Extract token from Discord desktop app or a supported Chromium browser')
|
|
192
196
|
.option('--pretty', 'Pretty print JSON output')
|
|
193
197
|
.option('--debug', 'Show debug output for troubleshooting')
|
|
194
198
|
.action(extractAction),
|
|
@@ -40,7 +40,7 @@ const program = new Command()
|
|
|
40
40
|
|
|
41
41
|
program
|
|
42
42
|
.name('agent-slack')
|
|
43
|
-
.description('CLI tool for Slack communication with token extraction from
|
|
43
|
+
.description('CLI tool for Slack communication with token extraction from the desktop app or a supported Chromium browser')
|
|
44
44
|
.version(pkg.version)
|
|
45
45
|
.option('--workspace <id>', 'Use specific workspace')
|
|
46
46
|
|
|
@@ -62,7 +62,7 @@ export class SlackClient {
|
|
|
62
62
|
const workspace = await credManager.getWorkspace()
|
|
63
63
|
if (!workspace) {
|
|
64
64
|
throw new SlackError(
|
|
65
|
-
'No workspace credentials found. Make sure Slack desktop app
|
|
65
|
+
'No workspace credentials found. Make sure Slack is logged in in the desktop app or a supported Chromium browser.',
|
|
66
66
|
'no_credentials',
|
|
67
67
|
)
|
|
68
68
|
}
|
|
@@ -3,7 +3,11 @@ import { mkdirSync, rmSync } from 'node:fs'
|
|
|
3
3
|
import { homedir } from 'node:os'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
formatCredentialDebug,
|
|
8
|
+
getExtractionErrorMessage,
|
|
9
|
+
getNoWorkspacesFoundMessage,
|
|
10
|
+
} from '@/platforms/slack/commands/auth'
|
|
7
11
|
import { CredentialManager } from '@/platforms/slack/credential-manager'
|
|
8
12
|
import { type ExtractedWorkspace, TokenExtractor } from '@/platforms/slack/token-extractor'
|
|
9
13
|
|
|
@@ -402,23 +406,44 @@ describe('formatCredentialDebug', () => {
|
|
|
402
406
|
|
|
403
407
|
describe('getExtractionErrorMessage', () => {
|
|
404
408
|
test('returns cookie failure message for missing_cookie', () => {
|
|
405
|
-
|
|
409
|
+
const message = getExtractionErrorMessage(['missing_cookie'])
|
|
410
|
+
|
|
411
|
+
expect(message).toContain('Cookie extraction failed')
|
|
412
|
+
expect(message).toContain('desktop app or a supported Chromium browser')
|
|
406
413
|
})
|
|
407
414
|
|
|
408
415
|
test('returns session expired message for invalid_auth', () => {
|
|
409
|
-
|
|
416
|
+
const message = getExtractionErrorMessage(['invalid_auth'])
|
|
417
|
+
|
|
418
|
+
expect(message).toContain('session has expired')
|
|
419
|
+
expect(message).toContain('desktop app or a supported Chromium browser')
|
|
410
420
|
})
|
|
411
421
|
|
|
412
422
|
test('prioritizes missing_cookie over invalid_auth', () => {
|
|
413
|
-
|
|
423
|
+
const message = getExtractionErrorMessage(['invalid_auth', 'missing_cookie'])
|
|
424
|
+
|
|
425
|
+
expect(message).toContain('Cookie extraction failed')
|
|
426
|
+
expect(message).toContain('desktop app or a supported Chromium browser')
|
|
414
427
|
})
|
|
415
428
|
|
|
416
429
|
test('returns generic message for unknown error codes', () => {
|
|
417
|
-
|
|
430
|
+
const message = getExtractionErrorMessage(['unknown_error'])
|
|
431
|
+
|
|
432
|
+
expect(message).toContain('Extracted tokens are invalid')
|
|
433
|
+
expect(message).toContain('desktop app or a supported Chromium browser')
|
|
418
434
|
})
|
|
419
435
|
|
|
420
436
|
test('returns generic message for empty failure list', () => {
|
|
421
|
-
|
|
437
|
+
const message = getExtractionErrorMessage([])
|
|
438
|
+
|
|
439
|
+
expect(message).toContain('Extracted tokens are invalid')
|
|
440
|
+
expect(message).toContain('desktop app or a supported Chromium browser')
|
|
441
|
+
})
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
describe('getNoWorkspacesFoundMessage', () => {
|
|
445
|
+
test('mentions desktop app and browser fallback', () => {
|
|
446
|
+
expect(getNoWorkspacesFoundMessage()).toContain('desktop app or a supported Chromium browser')
|
|
422
447
|
})
|
|
423
448
|
})
|
|
424
449
|
|
|
@@ -61,7 +61,7 @@ async function extractAction(options: {
|
|
|
61
61
|
console.log(
|
|
62
62
|
formatOutput(
|
|
63
63
|
{
|
|
64
|
-
error:
|
|
64
|
+
error: getNoWorkspacesFoundMessage(),
|
|
65
65
|
hint: options.debug ? undefined : 'Run with --debug for more info.',
|
|
66
66
|
},
|
|
67
67
|
options.pretty,
|
|
@@ -227,19 +227,23 @@ async function statusAction(options: { pretty?: boolean }): Promise<void> {
|
|
|
227
227
|
|
|
228
228
|
export function getExtractionErrorMessage(failureReasons: string[]): string {
|
|
229
229
|
if (failureReasons.includes('missing_cookie')) {
|
|
230
|
-
return 'Cookie extraction failed.
|
|
230
|
+
return 'Cookie extraction failed. Grant Keychain access when prompted, and make sure you are signed into Slack in the desktop app or a supported Chromium browser.'
|
|
231
231
|
}
|
|
232
232
|
if (failureReasons.includes('invalid_auth')) {
|
|
233
|
-
return 'Slack session has expired. Sign into the
|
|
233
|
+
return 'Slack session has expired. Sign into Slack in the desktop app or a supported Chromium browser, wait a few seconds, then re-run this command.'
|
|
234
234
|
}
|
|
235
|
-
return 'Extracted tokens are invalid. Make sure you are logged into the
|
|
235
|
+
return 'Extracted tokens are invalid. Make sure you are logged into Slack in the desktop app or a supported Chromium browser.'
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function getNoWorkspacesFoundMessage(): string {
|
|
239
|
+
return 'No workspaces found. Make sure you are logged into Slack in the desktop app or a supported Chromium browser.'
|
|
236
240
|
}
|
|
237
241
|
|
|
238
242
|
export const authCommand = new Command('auth')
|
|
239
243
|
.description('Authentication commands')
|
|
240
244
|
.addCommand(
|
|
241
245
|
new Command('extract')
|
|
242
|
-
.description('Extract tokens from Slack desktop app')
|
|
246
|
+
.description('Extract tokens from Slack desktop app or a supported Chromium browser')
|
|
243
247
|
.option('--pretty', 'Pretty print JSON output')
|
|
244
248
|
.option('--debug', 'Show debug output for troubleshooting')
|
|
245
249
|
.option('--unsafely-show-secrets', 'Show full token and cookie values in debug output')
|
|
@@ -39,7 +39,7 @@ export class TeamsClient {
|
|
|
39
39
|
const creds = await credManager.getTokenWithExpiry()
|
|
40
40
|
if (!creds) {
|
|
41
41
|
throw new TeamsError(
|
|
42
|
-
'No Teams credentials found. Make sure Microsoft Teams desktop app
|
|
42
|
+
'No Teams credentials found. Make sure Microsoft Teams is logged in via the desktop app or a supported Chromium browser.',
|
|
43
43
|
'no_credentials',
|
|
44
44
|
)
|
|
45
45
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { afterEach, beforeEach, expect, spyOn, test } from 'bun:test'
|
|
2
2
|
|
|
3
|
+
import { getNoTeamsTokenFoundMessage } from './auth'
|
|
3
4
|
import { TeamsClient } from '../client'
|
|
4
5
|
import { TeamsCredentialManager } from '../credential-manager'
|
|
5
6
|
import { TeamsTokenExtractor } from '../token-extractor'
|
|
@@ -89,3 +90,7 @@ test('status: checks token expiry', async () => {
|
|
|
89
90
|
const isExpired = await credManager.isTokenExpired()
|
|
90
91
|
expect(isExpired).toBe(false)
|
|
91
92
|
})
|
|
93
|
+
|
|
94
|
+
test('no-token message mentions desktop app and browser fallback', () => {
|
|
95
|
+
expect(getNoTeamsTokenFoundMessage()).toContain('desktop app or a supported Chromium browser')
|
|
96
|
+
})
|
|
@@ -45,7 +45,7 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
45
45
|
console.log(
|
|
46
46
|
formatOutput(
|
|
47
47
|
{
|
|
48
|
-
error:
|
|
48
|
+
error: getNoTeamsTokenFoundMessage(),
|
|
49
49
|
hint: 'Run with --token <token> to manually provide a token, or --debug for more info.',
|
|
50
50
|
},
|
|
51
51
|
options.pretty,
|
|
@@ -116,8 +116,8 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
116
116
|
{
|
|
117
117
|
error: `Token validation failed: ${errorMessage}`,
|
|
118
118
|
hint: is401
|
|
119
|
-
? 'Token expired. Open Microsoft Teams, send a message to refresh your session, then run "auth extract" again.'
|
|
120
|
-
: 'Make sure Microsoft Teams
|
|
119
|
+
? 'Token expired. Open Microsoft Teams in the desktop app or a supported Chromium browser, send a message to refresh your session, then run "auth extract" again.'
|
|
120
|
+
: 'Make sure Microsoft Teams is running and you are logged in via the desktop app or a supported Chromium browser.',
|
|
121
121
|
},
|
|
122
122
|
options.pretty,
|
|
123
123
|
),
|
|
@@ -130,7 +130,10 @@ export async function extractAction(options: { pretty?: boolean; debug?: boolean
|
|
|
130
130
|
if (Object.keys(config.accounts).length === 0) {
|
|
131
131
|
console.log(
|
|
132
132
|
formatOutput(
|
|
133
|
-
{
|
|
133
|
+
{
|
|
134
|
+
error:
|
|
135
|
+
'All extracted tokens failed validation. Make sure Microsoft Teams is running and you are logged in via the desktop app or a supported Chromium browser.',
|
|
136
|
+
},
|
|
134
137
|
options.pretty,
|
|
135
138
|
),
|
|
136
139
|
)
|
|
@@ -229,8 +232,8 @@ async function extractManualToken(token: string, options: { pretty?: boolean; de
|
|
|
229
232
|
{
|
|
230
233
|
error: `Token validation failed: ${errorMessage}`,
|
|
231
234
|
hint: is401
|
|
232
|
-
? 'Token expired. Open Microsoft Teams, send a message to refresh your session, then run "auth extract" again.'
|
|
233
|
-
: 'Make sure Microsoft Teams
|
|
235
|
+
? 'Token expired. Open Microsoft Teams in the desktop app or a supported Chromium browser, send a message to refresh your session, then run "auth extract" again.'
|
|
236
|
+
: 'Make sure Microsoft Teams is running and you are logged in via the desktop app or a supported Chromium browser.',
|
|
234
237
|
},
|
|
235
238
|
options.pretty,
|
|
236
239
|
),
|
|
@@ -239,6 +242,10 @@ async function extractManualToken(token: string, options: { pretty?: boolean; de
|
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
|
|
245
|
+
export function getNoTeamsTokenFoundMessage(): string {
|
|
246
|
+
return 'No Teams token found. Make sure you are logged in to Microsoft Teams via the desktop app or a supported Chromium browser.'
|
|
247
|
+
}
|
|
248
|
+
|
|
242
249
|
export async function logoutAction(options: { pretty?: boolean }): Promise<void> {
|
|
243
250
|
try {
|
|
244
251
|
const credManager = new TeamsCredentialManager()
|
|
@@ -361,7 +368,7 @@ export const authCommand = new Command('auth')
|
|
|
361
368
|
.description('Authentication commands')
|
|
362
369
|
.addCommand(
|
|
363
370
|
new Command('extract')
|
|
364
|
-
.description('Extract token from Microsoft Teams desktop app')
|
|
371
|
+
.description('Extract token from Microsoft Teams desktop app or a supported Chromium browser')
|
|
365
372
|
.option('--pretty', 'Pretty print JSON output')
|
|
366
373
|
.option('--debug', 'Show debug output for troubleshooting')
|
|
367
374
|
.option('--token <token>', 'Manually provide a token (bypasses auto-extraction)')
|