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.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js +1 -3
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.js +2 -17
- package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/kakaotalk/index.d.ts +4 -2
- package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/index.js +2 -1
- package/dist/src/platforms/kakaotalk/index.js.map +1 -1
- package/dist/src/platforms/line/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/auth.js +2 -4
- package/dist/src/platforms/line/commands/auth.js.map +1 -1
- package/dist/src/platforms/slackbot/types.d.ts +4 -0
- package/dist/src/platforms/slackbot/types.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.js +5 -7
- package/dist/src/platforms/telegram/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/commands/auth.d.ts +5 -2
- package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/auth.js +59 -1
- package/dist/src/platforms/webex/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/credential-manager.d.ts +11 -0
- package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/webex/credential-manager.js +37 -0
- package/dist/src/platforms/webex/credential-manager.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/auth.js +2 -4
- package/dist/src/platforms/whatsapp/commands/auth.js.map +1 -1
- package/dist/src/shared/utils/interactive.d.ts +3 -0
- package/dist/src/shared/utils/interactive.d.ts.map +1 -0
- package/dist/src/shared/utils/interactive.js +16 -0
- package/dist/src/shared/utils/interactive.js.map +1 -0
- package/package.json +1 -1
- package/skills/agent-channeltalk/SKILL.md +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-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +1 -1
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-telegrambot/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +32 -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/instagram/commands/auth.ts +1 -4
- package/src/platforms/kakaotalk/commands/auth.ts +2 -18
- package/src/platforms/kakaotalk/index.ts +6 -0
- package/src/platforms/line/commands/auth.ts +2 -5
- package/src/platforms/slackbot/types.ts +16 -0
- package/src/platforms/telegram/commands/auth.ts +5 -8
- package/src/platforms/webex/commands/auth.test.ts +154 -0
- package/src/platforms/webex/commands/auth.ts +102 -3
- package/src/platforms/webex/credential-manager.test.ts +78 -0
- package/src/platforms/webex/credential-manager.ts +59 -0
- package/src/platforms/whatsapp/commands/auth.ts +2 -5
- package/src/shared/utils/interactive.test.ts +55 -0
- 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
|
+
}
|