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.
Files changed (65) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/package.json +1 -1
  3. package/dist/src/platforms/channeltalk/cli.js +1 -1
  4. package/dist/src/platforms/channeltalk/cli.js.map +1 -1
  5. package/dist/src/platforms/channeltalk/client.js +1 -1
  6. package/dist/src/platforms/channeltalk/client.js.map +1 -1
  7. package/dist/src/platforms/channeltalk/commands/auth.d.ts +2 -0
  8. package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
  9. package/dist/src/platforms/channeltalk/commands/auth.js +9 -3
  10. package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
  11. package/dist/src/platforms/discord/client.js +1 -1
  12. package/dist/src/platforms/discord/client.js.map +1 -1
  13. package/dist/src/platforms/discord/commands/auth.d.ts +1 -0
  14. package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
  15. package/dist/src/platforms/discord/commands/auth.js +6 -3
  16. package/dist/src/platforms/discord/commands/auth.js.map +1 -1
  17. package/dist/src/platforms/slack/cli.js +1 -1
  18. package/dist/src/platforms/slack/cli.js.map +1 -1
  19. package/dist/src/platforms/slack/client.js +1 -1
  20. package/dist/src/platforms/slack/client.js.map +1 -1
  21. package/dist/src/platforms/slack/commands/auth.d.ts +1 -0
  22. package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -1
  23. package/dist/src/platforms/slack/commands/auth.js +8 -5
  24. package/dist/src/platforms/slack/commands/auth.js.map +1 -1
  25. package/dist/src/platforms/teams/client.js +1 -1
  26. package/dist/src/platforms/teams/client.js.map +1 -1
  27. package/dist/src/platforms/teams/commands/auth.d.ts +1 -0
  28. package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
  29. package/dist/src/platforms/teams/commands/auth.js +12 -7
  30. package/dist/src/platforms/teams/commands/auth.js.map +1 -1
  31. package/package.json +1 -1
  32. package/skills/agent-channeltalk/SKILL.md +3 -3
  33. package/skills/agent-channeltalk/references/authentication.md +3 -3
  34. package/skills/agent-channeltalk/templates/monitor-chat.sh +1 -1
  35. package/skills/agent-channeltalk/templates/post-message.sh +2 -2
  36. package/skills/agent-channeltalk/templates/workspace-summary.sh +1 -1
  37. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  38. package/skills/agent-discord/SKILL.md +1 -1
  39. package/skills/agent-discordbot/SKILL.md +1 -1
  40. package/skills/agent-instagram/SKILL.md +1 -1
  41. package/skills/agent-kakaotalk/SKILL.md +1 -1
  42. package/skills/agent-line/SKILL.md +1 -1
  43. package/skills/agent-slack/SKILL.md +1 -1
  44. package/skills/agent-slack/references/authentication.md +3 -3
  45. package/skills/agent-slackbot/SKILL.md +1 -1
  46. package/skills/agent-teams/SKILL.md +1 -1
  47. package/skills/agent-telegram/SKILL.md +1 -1
  48. package/skills/agent-webex/SKILL.md +1 -1
  49. package/skills/agent-wechatbot/SKILL.md +1 -1
  50. package/skills/agent-whatsapp/SKILL.md +1 -1
  51. package/skills/agent-whatsappbot/SKILL.md +1 -1
  52. package/src/platforms/channeltalk/cli.ts +1 -1
  53. package/src/platforms/channeltalk/client.ts +1 -1
  54. package/src/platforms/channeltalk/commands/auth.test.ts +4 -2
  55. package/src/platforms/channeltalk/commands/auth.ts +11 -3
  56. package/src/platforms/discord/client.ts +1 -1
  57. package/src/platforms/discord/commands/auth.test.ts +5 -0
  58. package/src/platforms/discord/commands/auth.ts +7 -3
  59. package/src/platforms/slack/cli.ts +1 -1
  60. package/src/platforms/slack/client.ts +1 -1
  61. package/src/platforms/slack/commands/auth.test.ts +31 -6
  62. package/src/platforms/slack/commands/auth.ts +9 -5
  63. package/src/platforms/teams/client.ts +1 -1
  64. package/src/platforms/teams/commands/auth.test.ts +5 -0
  65. 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: 'No Discord token found. Make sure Discord desktop app is installed and logged in.',
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 Slack desktop app')
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 is installed and logged in.',
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 { formatCredentialDebug, getExtractionErrorMessage } from '@/platforms/slack/commands/auth'
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
- expect(getExtractionErrorMessage(['missing_cookie'])).toContain('Cookie extraction failed')
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
- expect(getExtractionErrorMessage(['invalid_auth'])).toContain('session has expired')
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
- expect(getExtractionErrorMessage(['invalid_auth', 'missing_cookie'])).toContain('Cookie extraction failed')
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
- expect(getExtractionErrorMessage(['unknown_error'])).toContain('Extracted tokens are invalid')
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
- expect(getExtractionErrorMessage([])).toContain('Extracted tokens are invalid')
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: 'No workspaces found. Make sure Slack desktop app is installed and logged in.',
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. Make sure the Slack desktop app is installed and grant Keychain access when prompted.'
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 Slack desktop app, wait a few seconds, then re-run this command.'
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 Slack desktop app.'
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 is installed and logged in.',
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: 'No Teams token found. Make sure Microsoft Teams desktop app is installed and logged in.',
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 desktop app is running and you are logged in.',
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
- { error: 'All extracted tokens failed validation. Make sure Microsoft Teams is running and logged in.' },
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 desktop app is running and you are logged in.',
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)')