agent-messenger 2.16.0 → 2.18.0

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/instagram/commands/auth.d.ts.map +1 -1
  4. package/dist/src/platforms/instagram/commands/auth.js +1 -3
  5. package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
  6. package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -1
  7. package/dist/src/platforms/kakaotalk/commands/auth.js +2 -17
  8. package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
  9. package/dist/src/platforms/kakaotalk/index.d.ts +4 -2
  10. package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
  11. package/dist/src/platforms/kakaotalk/index.js +2 -1
  12. package/dist/src/platforms/kakaotalk/index.js.map +1 -1
  13. package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
  14. package/dist/src/platforms/line/commands/auth.js +2 -4
  15. package/dist/src/platforms/line/commands/auth.js.map +1 -1
  16. package/dist/src/platforms/slackbot/types.d.ts +4 -0
  17. package/dist/src/platforms/slackbot/types.d.ts.map +1 -1
  18. package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -1
  19. package/dist/src/platforms/telegram/commands/auth.js +5 -7
  20. package/dist/src/platforms/telegram/commands/auth.js.map +1 -1
  21. package/dist/src/platforms/webex/commands/auth.d.ts +5 -2
  22. package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
  23. package/dist/src/platforms/webex/commands/auth.js +59 -1
  24. package/dist/src/platforms/webex/commands/auth.js.map +1 -1
  25. package/dist/src/platforms/webex/credential-manager.d.ts +11 -0
  26. package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -1
  27. package/dist/src/platforms/webex/credential-manager.js +37 -0
  28. package/dist/src/platforms/webex/credential-manager.js.map +1 -1
  29. package/dist/src/platforms/whatsapp/commands/auth.d.ts.map +1 -1
  30. package/dist/src/platforms/whatsapp/commands/auth.js +2 -4
  31. package/dist/src/platforms/whatsapp/commands/auth.js.map +1 -1
  32. package/dist/src/shared/utils/interactive.d.ts +3 -0
  33. package/dist/src/shared/utils/interactive.d.ts.map +1 -0
  34. package/dist/src/shared/utils/interactive.js +16 -0
  35. package/dist/src/shared/utils/interactive.js.map +1 -0
  36. package/package.json +1 -1
  37. package/skills/agent-channeltalk/SKILL.md +1 -1
  38. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  39. package/skills/agent-discord/SKILL.md +1 -1
  40. package/skills/agent-discordbot/SKILL.md +1 -1
  41. package/skills/agent-instagram/SKILL.md +1 -1
  42. package/skills/agent-kakaotalk/SKILL.md +1 -1
  43. package/skills/agent-line/SKILL.md +1 -1
  44. package/skills/agent-slack/SKILL.md +1 -1
  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-telegrambot/SKILL.md +1 -1
  49. package/skills/agent-webex/SKILL.md +32 -1
  50. package/skills/agent-wechatbot/SKILL.md +1 -1
  51. package/skills/agent-whatsapp/SKILL.md +1 -1
  52. package/skills/agent-whatsappbot/SKILL.md +1 -1
  53. package/src/platforms/instagram/commands/auth.ts +1 -4
  54. package/src/platforms/kakaotalk/commands/auth.ts +2 -18
  55. package/src/platforms/kakaotalk/index.ts +6 -0
  56. package/src/platforms/line/commands/auth.ts +2 -5
  57. package/src/platforms/slackbot/types.ts +16 -0
  58. package/src/platforms/telegram/commands/auth.ts +5 -8
  59. package/src/platforms/webex/commands/auth.test.ts +154 -0
  60. package/src/platforms/webex/commands/auth.ts +102 -3
  61. package/src/platforms/webex/credential-manager.test.ts +78 -0
  62. package/src/platforms/webex/credential-manager.ts +59 -0
  63. package/src/platforms/whatsapp/commands/auth.ts +2 -5
  64. package/src/shared/utils/interactive.test.ts +55 -0
  65. package/src/shared/utils/interactive.ts +15 -0
@@ -0,0 +1,55 @@
1
+ import { afterEach, beforeEach, describe, expect, it } from 'bun:test'
2
+
3
+ import { hasTTY, isInteractive } from './interactive'
4
+
5
+ describe('isInteractive', () => {
6
+ let originalStdinTTY: boolean | undefined
7
+ let originalStdoutTTY: boolean | undefined
8
+
9
+ beforeEach(() => {
10
+ originalStdinTTY = process.stdin.isTTY
11
+ originalStdoutTTY = process.stdout.isTTY
12
+ })
13
+
14
+ afterEach(() => {
15
+ Object.defineProperty(process.stdin, 'isTTY', { value: originalStdinTTY, writable: true, configurable: true })
16
+ Object.defineProperty(process.stdout, 'isTTY', { value: originalStdoutTTY, writable: true, configurable: true })
17
+ })
18
+
19
+ function setTTY(stdin: boolean | undefined, stdout: boolean | undefined): void {
20
+ Object.defineProperty(process.stdin, 'isTTY', { value: stdin, writable: true, configurable: true })
21
+ Object.defineProperty(process.stdout, 'isTTY', { value: stdout, writable: true, configurable: true })
22
+ }
23
+
24
+ it('returns true when both stdin and stdout are TTY', () => {
25
+ setTTY(true, true)
26
+ expect(isInteractive()).toBe(true)
27
+ })
28
+
29
+ it('returns false when stdin is not a TTY (piped input)', () => {
30
+ setTTY(undefined, true)
31
+ expect(isInteractive()).toBe(false)
32
+ })
33
+
34
+ it('returns false when stdout is not a TTY (piped output)', () => {
35
+ setTTY(true, undefined)
36
+ expect(isInteractive()).toBe(false)
37
+ })
38
+
39
+ it('returns false when neither is a TTY', () => {
40
+ setTTY(undefined, undefined)
41
+ expect(isInteractive()).toBe(false)
42
+ })
43
+
44
+ it('returns false when stdin/stdout isTTY is explicitly false', () => {
45
+ setTTY(false, false)
46
+ expect(isInteractive()).toBe(false)
47
+ })
48
+ })
49
+
50
+ describe('hasTTY', () => {
51
+ it('returns a boolean reflecting whether a controlling TTY can be opened', () => {
52
+ const result = hasTTY()
53
+ expect(typeof result).toBe('boolean')
54
+ })
55
+ })
@@ -0,0 +1,15 @@
1
+ export function isInteractive(): boolean {
2
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY)
3
+ }
4
+
5
+ export function hasTTY(): boolean {
6
+ try {
7
+ const { openSync, closeSync } = require('node:fs') as typeof import('node:fs')
8
+ const ttyDevice = process.platform === 'win32' ? 'CONIN$' : '/dev/tty'
9
+ const fd = openSync(ttyDevice, 'r')
10
+ closeSync(fd)
11
+ return true
12
+ } catch {
13
+ return false
14
+ }
15
+ }