agent-messenger 2.24.1 → 2.26.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/README.md +1 -1
- package/dist/package.json +1 -1
- package/dist/src/platforms/discord/commands/auth.d.ts +4 -0
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js +61 -1
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/index.d.ts +2 -0
- package/dist/src/platforms/discord/index.d.ts.map +1 -1
- package/dist/src/platforms/discord/index.js +1 -0
- package/dist/src/platforms/discord/index.js.map +1 -1
- package/dist/src/platforms/discord/remote-auth.d.ts +42 -0
- package/dist/src/platforms/discord/remote-auth.d.ts.map +1 -0
- package/dist/src/platforms/discord/remote-auth.js +208 -0
- package/dist/src/platforms/discord/remote-auth.js.map +1 -0
- package/dist/src/platforms/webex/client.d.ts +1 -0
- package/dist/src/platforms/webex/client.d.ts.map +1 -1
- package/dist/src/platforms/webex/client.js +17 -1
- package/dist/src/platforms/webex/client.js.map +1 -1
- package/dist/src/platforms/webex/commands/message.d.ts +4 -0
- package/dist/src/platforms/webex/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/message.js +16 -1
- package/dist/src/platforms/webex/commands/message.js.map +1 -1
- package/docs/content/docs/cli/webex.mdx +7 -0
- package/docs/content/docs/sdk/discord.mdx +22 -0
- package/docs/content/docs/sdk/webex.mdx +7 -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 +9 -2
- 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 +6 -1
- package/skills/agent-webexbot/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/discord/commands/auth.ts +81 -1
- package/src/platforms/discord/index.ts +2 -0
- package/src/platforms/discord/remote-auth.test.ts +261 -0
- package/src/platforms/discord/remote-auth.ts +317 -0
- package/src/platforms/webex/client.test.ts +74 -0
- package/src/platforms/webex/client.ts +20 -1
- package/src/platforms/webex/commands/message.test.ts +29 -1
- package/src/platforms/webex/commands/message.ts +18 -0
|
@@ -363,6 +363,23 @@ export class WebexClient {
|
|
|
363
363
|
return normalizeSdkMessage(await this.request<WebexMessage>('POST', '/messages', body))
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
+
async setTyping(roomId: string, typing: boolean = true): Promise<void> {
|
|
367
|
+
if (!this.useInternalAPI) {
|
|
368
|
+
throw new WebexError('Typing indicator requires an extracted or password token with a device URL', 'unsupported')
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const resolvedRoomId = await this.resolveRoomId(roomId)
|
|
372
|
+
const convUuid = this.decodeConvUuid(resolvedRoomId)
|
|
373
|
+
|
|
374
|
+
await this.internalRequest<void>(`/conversations/${convUuid}/status/typing`, {
|
|
375
|
+
method: 'POST',
|
|
376
|
+
body: JSON.stringify({
|
|
377
|
+
conversationId: convUuid,
|
|
378
|
+
eventType: typing ? 'status.start_typing' : 'status.stop_typing',
|
|
379
|
+
}),
|
|
380
|
+
})
|
|
381
|
+
}
|
|
382
|
+
|
|
366
383
|
private get useInternalAPI(): boolean {
|
|
367
384
|
return (this.tokenType === 'extracted' || this.tokenType === 'password') && this.deviceUrl !== null
|
|
368
385
|
}
|
|
@@ -980,7 +997,9 @@ function isTrustedWebexHost(host: string): boolean {
|
|
|
980
997
|
host === 'wbx2.com' ||
|
|
981
998
|
host.endsWith('.wbx2.com') ||
|
|
982
999
|
host === 'ciscospark.com' ||
|
|
983
|
-
host.endsWith('.ciscospark.com')
|
|
1000
|
+
host.endsWith('.ciscospark.com') ||
|
|
1001
|
+
host === 'webexcontent.com' ||
|
|
1002
|
+
host.endsWith('.webexcontent.com')
|
|
984
1003
|
)
|
|
985
1004
|
}
|
|
986
1005
|
|
|
@@ -37,7 +37,7 @@ const mockMessage2 = {
|
|
|
37
37
|
created: '2025-01-29T10:01:00.000Z',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
import { deleteAction, dmAction, editAction, getAction, listAction, sendAction } from './message'
|
|
40
|
+
import { deleteAction, dmAction, editAction, getAction, listAction, sendAction, typingAction } from './message'
|
|
41
41
|
|
|
42
42
|
let mockSendMessage: ReturnType<typeof spyOn>
|
|
43
43
|
let mockSendDirectMessage: ReturnType<typeof spyOn>
|
|
@@ -45,6 +45,7 @@ let mockListMessages: ReturnType<typeof spyOn>
|
|
|
45
45
|
let mockGetMessage: ReturnType<typeof spyOn>
|
|
46
46
|
let mockDeleteMessage: ReturnType<typeof spyOn>
|
|
47
47
|
let mockEditMessage: ReturnType<typeof spyOn>
|
|
48
|
+
let mockSetTyping: ReturnType<typeof spyOn>
|
|
48
49
|
let mockLogin: ReturnType<typeof spyOn>
|
|
49
50
|
let mockDispose: ReturnType<typeof spyOn>
|
|
50
51
|
let consoleLogSpy: ReturnType<typeof spyOn>
|
|
@@ -69,6 +70,7 @@ beforeEach(() => {
|
|
|
69
70
|
mockGetMessage = protoSpy('getMessage').mockResolvedValue(mockMessage)
|
|
70
71
|
mockDeleteMessage = protoSpy('deleteMessage').mockResolvedValue(undefined)
|
|
71
72
|
mockEditMessage = protoSpy('editMessage').mockResolvedValue({ ...mockMessage, text: 'Updated message' })
|
|
73
|
+
mockSetTyping = protoSpy('setTyping').mockResolvedValue(undefined)
|
|
72
74
|
|
|
73
75
|
consoleLogSpy = spyOn(console, 'log').mockImplementation(() => {})
|
|
74
76
|
consoleErrorSpy = spyOn(console, 'error').mockImplementation(() => {})
|
|
@@ -205,3 +207,29 @@ it('passes markdown option to editMessage when --markdown flag is set', async ()
|
|
|
205
207
|
markdown: true,
|
|
206
208
|
})
|
|
207
209
|
})
|
|
210
|
+
|
|
211
|
+
it('calls setTyping with start-typing by default and outputs result', async () => {
|
|
212
|
+
await typingAction('space_456', { pretty: false })
|
|
213
|
+
|
|
214
|
+
expect(mockSetTyping).toHaveBeenCalledWith('space_456', true)
|
|
215
|
+
expect(consoleLogSpy).toHaveBeenCalled()
|
|
216
|
+
const output = JSON.parse(consoleLogSpy.mock.calls[0][0] as string)
|
|
217
|
+
expect(output).toEqual({ spaceId: 'space_456', typing: true })
|
|
218
|
+
expect(mockDispose).toHaveBeenCalled()
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
it('calls setTyping with stop-typing when --stop flag is set', async () => {
|
|
222
|
+
await typingAction('space_456', { stop: true, pretty: false })
|
|
223
|
+
|
|
224
|
+
expect(mockSetTyping).toHaveBeenCalledWith('space_456', false)
|
|
225
|
+
const output = JSON.parse(consoleLogSpy.mock.calls[0][0] as string)
|
|
226
|
+
expect(output).toEqual({ spaceId: 'space_456', typing: false })
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
it('disposes the client when setTyping fails', async () => {
|
|
230
|
+
mockSetTyping.mockRejectedValue(new WebexError('Typing failed', 'unsupported'))
|
|
231
|
+
|
|
232
|
+
await typingAction('space_456', { pretty: false })
|
|
233
|
+
|
|
234
|
+
expect(mockDispose).toHaveBeenCalled()
|
|
235
|
+
})
|
|
@@ -116,6 +116,16 @@ export async function dmAction(
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
export async function typingAction(spaceId: string, options: { stop?: boolean; pretty?: boolean }): Promise<void> {
|
|
120
|
+
try {
|
|
121
|
+
await withWebexClient((client) => client.setTyping(spaceId, !options.stop))
|
|
122
|
+
|
|
123
|
+
console.log(formatOutput({ spaceId, typing: !options.stop }, options.pretty))
|
|
124
|
+
} catch (error) {
|
|
125
|
+
handleError(error as Error)
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
119
129
|
export const messageCommand = new Command('message')
|
|
120
130
|
.description('Message commands')
|
|
121
131
|
.addCommand(
|
|
@@ -174,3 +184,11 @@ export const messageCommand = new Command('message')
|
|
|
174
184
|
.option('--pretty', 'Pretty print JSON output')
|
|
175
185
|
.action(editAction),
|
|
176
186
|
)
|
|
187
|
+
.addCommand(
|
|
188
|
+
new Command('typing')
|
|
189
|
+
.description('Send a typing indicator to a space')
|
|
190
|
+
.argument('<space-id>', 'Space/Room ID')
|
|
191
|
+
.option('--stop', 'Send stop-typing instead of start-typing')
|
|
192
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
193
|
+
.action(typingAction),
|
|
194
|
+
)
|