agent-messenger 2.23.0 → 2.23.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 (123) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/package.json +1 -1
  3. package/dist/src/platforms/webex/client.d.ts +18 -0
  4. package/dist/src/platforms/webex/client.d.ts.map +1 -1
  5. package/dist/src/platforms/webex/client.js +178 -37
  6. package/dist/src/platforms/webex/client.js.map +1 -1
  7. package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
  8. package/dist/src/platforms/webex/commands/auth.js +10 -6
  9. package/dist/src/platforms/webex/commands/auth.js.map +1 -1
  10. package/dist/src/platforms/webex/commands/member.d.ts.map +1 -1
  11. package/dist/src/platforms/webex/commands/member.js +3 -0
  12. package/dist/src/platforms/webex/commands/member.js.map +1 -1
  13. package/dist/src/platforms/webex/commands/message.d.ts.map +1 -1
  14. package/dist/src/platforms/webex/commands/message.js +3 -0
  15. package/dist/src/platforms/webex/commands/message.js.map +1 -1
  16. package/dist/src/platforms/webex/commands/snapshot.d.ts.map +1 -1
  17. package/dist/src/platforms/webex/commands/snapshot.js +3 -1
  18. package/dist/src/platforms/webex/commands/snapshot.js.map +1 -1
  19. package/dist/src/platforms/webex/commands/space.d.ts.map +1 -1
  20. package/dist/src/platforms/webex/commands/space.js +5 -0
  21. package/dist/src/platforms/webex/commands/space.js.map +1 -1
  22. package/dist/src/platforms/webex/commands/whoami.d.ts.map +1 -1
  23. package/dist/src/platforms/webex/commands/whoami.js +3 -0
  24. package/dist/src/platforms/webex/commands/whoami.js.map +1 -1
  25. package/dist/src/platforms/webex/id-normalizer.d.ts +7 -0
  26. package/dist/src/platforms/webex/id-normalizer.d.ts.map +1 -1
  27. package/dist/src/platforms/webex/id-normalizer.js +16 -0
  28. package/dist/src/platforms/webex/id-normalizer.js.map +1 -1
  29. package/dist/src/platforms/webex/index.d.ts +4 -2
  30. package/dist/src/platforms/webex/index.d.ts.map +1 -1
  31. package/dist/src/platforms/webex/index.js +2 -1
  32. package/dist/src/platforms/webex/index.js.map +1 -1
  33. package/dist/src/platforms/webexbot/client.d.ts +0 -4
  34. package/dist/src/platforms/webexbot/client.d.ts.map +1 -1
  35. package/dist/src/platforms/webexbot/client.js +8 -65
  36. package/dist/src/platforms/webexbot/client.js.map +1 -1
  37. package/dist/src/platforms/webexbot/commands/file.d.ts +2 -0
  38. package/dist/src/platforms/webexbot/commands/file.d.ts.map +1 -1
  39. package/dist/src/platforms/webexbot/commands/file.js +3 -0
  40. package/dist/src/platforms/webexbot/commands/file.js.map +1 -1
  41. package/dist/src/platforms/webexbot/commands/member.d.ts +2 -0
  42. package/dist/src/platforms/webexbot/commands/member.d.ts.map +1 -1
  43. package/dist/src/platforms/webexbot/commands/member.js +3 -0
  44. package/dist/src/platforms/webexbot/commands/member.js.map +1 -1
  45. package/dist/src/platforms/webexbot/commands/message.d.ts +4 -0
  46. package/dist/src/platforms/webexbot/commands/message.d.ts.map +1 -1
  47. package/dist/src/platforms/webexbot/commands/message.js +7 -0
  48. package/dist/src/platforms/webexbot/commands/message.js.map +1 -1
  49. package/dist/src/platforms/webexbot/commands/snapshot.d.ts +2 -0
  50. package/dist/src/platforms/webexbot/commands/snapshot.d.ts.map +1 -1
  51. package/dist/src/platforms/webexbot/commands/snapshot.js +10 -2
  52. package/dist/src/platforms/webexbot/commands/snapshot.js.map +1 -1
  53. package/dist/src/platforms/webexbot/commands/space.d.ts +4 -0
  54. package/dist/src/platforms/webexbot/commands/space.d.ts.map +1 -1
  55. package/dist/src/platforms/webexbot/commands/space.js +5 -0
  56. package/dist/src/platforms/webexbot/commands/space.js.map +1 -1
  57. package/dist/src/platforms/webexbot/commands/user.d.ts +3 -0
  58. package/dist/src/platforms/webexbot/commands/user.d.ts.map +1 -1
  59. package/dist/src/platforms/webexbot/commands/user.js +4 -0
  60. package/dist/src/platforms/webexbot/commands/user.js.map +1 -1
  61. package/dist/src/platforms/webexbot/commands/whoami.d.ts +2 -0
  62. package/dist/src/platforms/webexbot/commands/whoami.d.ts.map +1 -1
  63. package/dist/src/platforms/webexbot/commands/whoami.js +3 -0
  64. package/dist/src/platforms/webexbot/commands/whoami.js.map +1 -1
  65. package/dist/src/platforms/webexbot/index.d.ts +2 -2
  66. package/dist/src/platforms/webexbot/index.d.ts.map +1 -1
  67. package/dist/src/platforms/webexbot/index.js +1 -1
  68. package/dist/src/platforms/webexbot/index.js.map +1 -1
  69. package/dist/src/tui/adapters/types.d.ts +3 -0
  70. package/dist/src/tui/adapters/types.d.ts.map +1 -1
  71. package/dist/src/tui/adapters/webex-adapter.d.ts.map +1 -1
  72. package/dist/src/tui/adapters/webex-adapter.js +4 -0
  73. package/dist/src/tui/adapters/webex-adapter.js.map +1 -1
  74. package/docs/content/docs/cli/webex.mdx +2 -2
  75. package/package.json +1 -1
  76. package/skills/agent-channeltalk/SKILL.md +1 -1
  77. package/skills/agent-channeltalkbot/SKILL.md +1 -1
  78. package/skills/agent-discord/SKILL.md +1 -1
  79. package/skills/agent-discordbot/SKILL.md +1 -1
  80. package/skills/agent-instagram/SKILL.md +1 -1
  81. package/skills/agent-kakaotalk/SKILL.md +1 -1
  82. package/skills/agent-line/SKILL.md +1 -1
  83. package/skills/agent-slack/SKILL.md +1 -1
  84. package/skills/agent-slackbot/SKILL.md +1 -1
  85. package/skills/agent-teams/SKILL.md +1 -1
  86. package/skills/agent-telegram/SKILL.md +1 -1
  87. package/skills/agent-telegrambot/SKILL.md +1 -1
  88. package/skills/agent-webex/SKILL.md +3 -3
  89. package/skills/agent-webexbot/SKILL.md +2 -2
  90. package/skills/agent-webexbot/references/common-patterns.md +1 -1
  91. package/skills/agent-wechatbot/SKILL.md +1 -1
  92. package/skills/agent-whatsapp/SKILL.md +1 -1
  93. package/skills/agent-whatsappbot/SKILL.md +1 -1
  94. package/src/platforms/webex/client.test.ts +94 -6
  95. package/src/platforms/webex/client.ts +194 -32
  96. package/src/platforms/webex/commands/auth.test.ts +3 -1
  97. package/src/platforms/webex/commands/auth.ts +12 -7
  98. package/src/platforms/webex/commands/member.test.ts +18 -8
  99. package/src/platforms/webex/commands/member.ts +3 -0
  100. package/src/platforms/webex/commands/message.test.ts +31 -23
  101. package/src/platforms/webex/commands/message.ts +3 -0
  102. package/src/platforms/webex/commands/snapshot.test.ts +18 -10
  103. package/src/platforms/webex/commands/snapshot.ts +3 -1
  104. package/src/platforms/webex/commands/space.test.ts +36 -17
  105. package/src/platforms/webex/commands/space.ts +5 -0
  106. package/src/platforms/webex/commands/whoami.test.ts +14 -6
  107. package/src/platforms/webex/commands/whoami.ts +3 -0
  108. package/src/platforms/webex/id-normalizer.test.ts +37 -0
  109. package/src/platforms/webex/id-normalizer.ts +21 -0
  110. package/src/platforms/webex/index.test.ts +4 -0
  111. package/src/platforms/webex/index.ts +4 -2
  112. package/src/platforms/webexbot/client.ts +8 -74
  113. package/src/platforms/webexbot/commands/file.ts +5 -0
  114. package/src/platforms/webexbot/commands/member.ts +5 -0
  115. package/src/platforms/webexbot/commands/message.ts +11 -0
  116. package/src/platforms/webexbot/commands/snapshot.ts +12 -2
  117. package/src/platforms/webexbot/commands/space.ts +9 -0
  118. package/src/platforms/webexbot/commands/user.test.ts +11 -5
  119. package/src/platforms/webexbot/commands/user.ts +7 -0
  120. package/src/platforms/webexbot/commands/whoami.ts +5 -0
  121. package/src/platforms/webexbot/index.ts +2 -2
  122. package/src/tui/adapters/types.ts +3 -0
  123. package/src/tui/adapters/webex-adapter.ts +4 -0
@@ -2,13 +2,16 @@ import { Command } from 'commander'
2
2
 
3
3
  import { cliOutput } from '@/shared/utils/cli-output'
4
4
 
5
+ import { toRef } from '../../webex/id-normalizer'
5
6
  import type { BotOption } from './shared'
6
7
  import { getClient } from './shared'
7
8
 
8
9
  interface MemberResult {
9
10
  members?: Array<{
10
11
  id: string
12
+ ref: string
11
13
  personId: string
14
+ personRef: string
12
15
  personEmail: string
13
16
  personDisplayName: string
14
17
  isModerator: boolean
@@ -26,7 +29,9 @@ export async function listAction(space: string, options: BotOption & { max?: str
26
29
  return {
27
30
  members: members.map((m) => ({
28
31
  id: m.id,
32
+ ref: toRef(m.id),
29
33
  personId: m.personId,
34
+ personRef: toRef(m.personId),
30
35
  personEmail: m.personEmail,
31
36
  personDisplayName: m.personDisplayName,
32
37
  isModerator: m.isModerator,
@@ -2,13 +2,16 @@ import { Command } from 'commander'
2
2
 
3
3
  import { cliOutput } from '@/shared/utils/cli-output'
4
4
 
5
+ import { toRef } from '../../webex/id-normalizer'
5
6
  import type { WebexMessage } from '../../webex/types'
6
7
  import type { BotOption } from './shared'
7
8
  import { getClient } from './shared'
8
9
 
9
10
  interface MessageResult {
10
11
  id?: string
12
+ ref?: string
11
13
  roomId?: string
14
+ roomRef?: string
12
15
  text?: string
13
16
  markdown?: string
14
17
  html?: string
@@ -16,7 +19,9 @@ interface MessageResult {
16
19
  created?: string
17
20
  messages?: Array<{
18
21
  id: string
22
+ ref: string
19
23
  roomId: string
24
+ roomRef: string
20
25
  text?: string
21
26
  personEmail: string
22
27
  created: string
@@ -28,7 +33,9 @@ interface MessageResult {
28
33
  function formatMessage(message: WebexMessage): MessageResult {
29
34
  return {
30
35
  id: message.id,
36
+ ref: toRef(message.id),
31
37
  roomId: message.roomId,
38
+ roomRef: toRef(message.roomId),
32
39
  text: message.text,
33
40
  markdown: message.markdown,
34
41
  html: message.html,
@@ -81,7 +88,9 @@ export async function repliesAction(
81
88
  return {
82
89
  messages: messages.map((msg) => ({
83
90
  id: msg.id,
91
+ ref: toRef(msg.id),
84
92
  roomId: msg.roomId,
93
+ roomRef: toRef(msg.roomId),
85
94
  text: msg.text,
86
95
  personEmail: msg.personEmail,
87
96
  created: msg.created,
@@ -116,7 +125,9 @@ export async function listAction(space: string, options: BotOption & { max?: str
116
125
  return {
117
126
  messages: messages.map((msg) => ({
118
127
  id: msg.id,
128
+ ref: toRef(msg.id),
119
129
  roomId: msg.roomId,
130
+ roomRef: toRef(msg.roomId),
120
131
  text: msg.text,
121
132
  personEmail: msg.personEmail,
122
133
  created: msg.created,
@@ -2,17 +2,20 @@ import { Command } from 'commander'
2
2
 
3
3
  import { cliOutput } from '@/shared/utils/cli-output'
4
4
 
5
+ import { toRef } from '../../webex/id-normalizer'
5
6
  import type { BotOption } from './shared'
6
7
  import { getClient } from './shared'
7
8
 
8
9
  interface SnapshotResult {
9
10
  bot?: {
10
11
  id: string
12
+ ref: string
11
13
  displayName: string
12
14
  emails: string[]
13
15
  }
14
16
  spaces?: Array<{
15
17
  id: string
18
+ ref: string
16
19
  title: string
17
20
  type?: 'group' | 'direct'
18
21
  lastActivity?: string
@@ -31,12 +34,19 @@ export async function snapshotAction(options: BotOption & { full?: boolean; max?
31
34
  const result: SnapshotResult = {
32
35
  bot: {
33
36
  id: me.id,
37
+ ref: toRef(me.id),
34
38
  displayName: me.displayName,
35
39
  emails: me.emails,
36
40
  },
37
41
  spaces: options.full
38
- ? spaces.map((s) => ({ id: s.id, title: s.title, type: s.type, lastActivity: s.lastActivity }))
39
- : spaces.map((s) => ({ id: s.id, title: s.title })),
42
+ ? spaces.map((s) => ({
43
+ id: s.id,
44
+ ref: toRef(s.id),
45
+ title: s.title,
46
+ type: s.type,
47
+ lastActivity: s.lastActivity,
48
+ }))
49
+ : spaces.map((s) => ({ id: s.id, ref: toRef(s.id), title: s.title })),
40
50
  }
41
51
 
42
52
  if (!options.full) {
@@ -2,20 +2,25 @@ import { Command } from 'commander'
2
2
 
3
3
  import { cliOutput } from '@/shared/utils/cli-output'
4
4
 
5
+ import { toRef } from '../../webex/id-normalizer'
5
6
  import type { BotOption } from './shared'
6
7
  import { getClient } from './shared'
7
8
 
8
9
  interface SpaceResult {
9
10
  id?: string
11
+ ref?: string
10
12
  title?: string
11
13
  type?: 'group' | 'direct'
12
14
  isLocked?: boolean
13
15
  teamId?: string | null
16
+ teamRef?: string | null
14
17
  lastActivity?: string
15
18
  created?: string
16
19
  creatorId?: string
20
+ creatorRef?: string
17
21
  spaces?: Array<{
18
22
  id: string
23
+ ref: string
19
24
  title: string
20
25
  type: 'group' | 'direct'
21
26
  lastActivity: string
@@ -33,6 +38,7 @@ export async function listAction(options: BotOption & { max?: string; type?: str
33
38
  return {
34
39
  spaces: spaces.map((s) => ({
35
40
  id: s.id,
41
+ ref: toRef(s.id),
36
42
  title: s.title,
37
43
  type: s.type,
38
44
  lastActivity: s.lastActivity,
@@ -50,13 +56,16 @@ export async function infoAction(spaceId: string, options: BotOption): Promise<S
50
56
  const space = await client.getSpace(spaceId)
51
57
  return {
52
58
  id: space.id,
59
+ ref: toRef(space.id),
53
60
  title: space.title,
54
61
  type: space.type,
55
62
  isLocked: space.isLocked,
56
63
  teamId: space.teamId || null,
64
+ teamRef: space.teamId ? toRef(space.teamId) : null,
57
65
  lastActivity: space.lastActivity,
58
66
  created: space.created,
59
67
  creatorId: space.creatorId,
68
+ creatorRef: toRef(space.creatorId),
60
69
  }
61
70
  } catch (error) {
62
71
  return { error: (error as Error).message }
@@ -4,13 +4,17 @@ import { mkdir } from 'node:fs/promises'
4
4
  import { tmpdir } from 'node:os'
5
5
  import { join } from 'node:path'
6
6
 
7
+ const restId = (type: string, ref: string) => Buffer.from(`ciscospark://us/${type}/${ref}`).toString('base64url')
8
+ const personId = restId('PEOPLE', 'p1')
9
+ const orgId = restId('ORGANIZATION', 'o1')
10
+
7
11
  const mockListPeople = mock(() =>
8
12
  Promise.resolve([
9
13
  {
10
- id: 'p1',
14
+ id: personId,
11
15
  emails: ['alice@example.com'],
12
16
  displayName: 'Alice',
13
- orgId: 'o1',
17
+ orgId,
14
18
  type: 'person' as const,
15
19
  created: '',
16
20
  },
@@ -19,10 +23,10 @@ const mockListPeople = mock(() =>
19
23
 
20
24
  const mockGetPerson = mock(() =>
21
25
  Promise.resolve({
22
- id: 'p1',
26
+ id: personId,
23
27
  emails: ['alice@example.com'],
24
28
  displayName: 'Alice',
25
- orgId: 'o1',
29
+ orgId,
26
30
  type: 'person' as const,
27
31
  created: '2024-01-01T00:00:00Z',
28
32
  }),
@@ -65,13 +69,15 @@ describe('webexbot user commands', () => {
65
69
 
66
70
  expect(result.users).toHaveLength(1)
67
71
  expect(result.users?.[0].displayName).toBe('Alice')
72
+ expect(result.users?.[0].ref).toBe('p1')
68
73
  expect(mockListPeople).toHaveBeenCalled()
69
74
  })
70
75
 
71
76
  it('gets a person by id', async () => {
72
77
  const result = await infoAction('p1', { _credManager: manager })
73
78
 
74
- expect(result.id).toBe('p1')
79
+ expect(result.id).toBe(personId)
80
+ expect(result.ref).toBe('p1')
75
81
  expect(result.displayName).toBe('Alice')
76
82
  })
77
83
  })
@@ -2,12 +2,14 @@ import { Command } from 'commander'
2
2
 
3
3
  import { cliOutput } from '@/shared/utils/cli-output'
4
4
 
5
+ import { toRef } from '../../webex/id-normalizer'
5
6
  import type { WebexPerson } from '../../webex/types'
6
7
  import type { BotOption } from './shared'
7
8
  import { getClient } from './shared'
8
9
 
9
10
  interface UserResult {
10
11
  id?: string
12
+ ref?: string
11
13
  emails?: string[]
12
14
  displayName?: string
13
15
  nickName?: string
@@ -15,10 +17,12 @@ interface UserResult {
15
17
  lastName?: string
16
18
  avatar?: string
17
19
  orgId?: string
20
+ orgRef?: string
18
21
  type?: 'person' | 'bot'
19
22
  created?: string
20
23
  users?: Array<{
21
24
  id: string
25
+ ref: string
22
26
  emails: string[]
23
27
  displayName: string
24
28
  type: 'person' | 'bot'
@@ -29,6 +33,7 @@ interface UserResult {
29
33
  function formatPerson(person: WebexPerson): UserResult {
30
34
  return {
31
35
  id: person.id,
36
+ ref: toRef(person.id),
32
37
  emails: person.emails,
33
38
  displayName: person.displayName,
34
39
  nickName: person.nickName,
@@ -36,6 +41,7 @@ function formatPerson(person: WebexPerson): UserResult {
36
41
  lastName: person.lastName,
37
42
  avatar: person.avatar,
38
43
  orgId: person.orgId,
44
+ orgRef: toRef(person.orgId),
39
45
  type: person.type,
40
46
  created: person.created,
41
47
  }
@@ -52,6 +58,7 @@ export async function listAction(
52
58
  return {
53
59
  users: people.map((p) => ({
54
60
  id: p.id,
61
+ ref: toRef(p.id),
55
62
  emails: p.emails,
56
63
  displayName: p.displayName,
57
64
  type: p.type,
@@ -2,15 +2,18 @@ import { Command } from 'commander'
2
2
 
3
3
  import { cliOutput } from '@/shared/utils/cli-output'
4
4
 
5
+ import { toRef } from '../../webex/id-normalizer'
5
6
  import type { BotOption } from './shared'
6
7
  import { getClient } from './shared'
7
8
 
8
9
  interface WhoamiResult {
9
10
  id?: string
11
+ ref?: string
10
12
  emails?: string[]
11
13
  displayName?: string
12
14
  avatar?: string
13
15
  orgId?: string
16
+ orgRef?: string
14
17
  type?: 'person' | 'bot'
15
18
  created?: string
16
19
  error?: string
@@ -22,10 +25,12 @@ export async function whoamiAction(options: BotOption): Promise<WhoamiResult> {
22
25
  const info = await client.testAuth()
23
26
  return {
24
27
  id: info.id,
28
+ ref: toRef(info.id),
25
29
  emails: info.emails,
26
30
  displayName: info.displayName,
27
31
  avatar: info.avatar,
28
32
  orgId: info.orgId,
33
+ orgRef: toRef(info.orgId),
29
34
  type: info.type,
30
35
  created: info.created,
31
36
  }
@@ -1,7 +1,7 @@
1
1
  export { WebexBotClient } from './client'
2
2
  export { WebexBotCredentialManager } from './credential-manager'
3
- export { fromRestId, toRestId } from '../webex/id-normalizer'
4
- export type { WebexRestIdType } from '../webex/id-normalizer'
3
+ export { decodeWebexId, fromRestId, toRef, toRestId } from '../webex/id-normalizer'
4
+ export type { DecodedWebexId, WebexRestIdType } from '../webex/id-normalizer'
5
5
  export { WebexBotListener } from './listener'
6
6
  export type { WebexBotListenerOptions } from './listener'
7
7
  export type { WebexBotConfig, WebexBotCredentials, WebexBotEntry, WebexBotListenerEventMap } from './types'
@@ -1,12 +1,15 @@
1
1
  export interface UnifiedChannel {
2
2
  id: string
3
+ ref?: string
3
4
  name: string
4
5
  parentId?: string
5
6
  }
6
7
 
7
8
  export interface UnifiedMessage {
8
9
  id: string
10
+ ref?: string
9
11
  channelId: string
12
+ channelRef?: string
10
13
  author: string
11
14
  content: string
12
15
  timestamp: string
@@ -3,6 +3,7 @@ import { exec } from 'node:child_process'
3
3
  import { getWebexAppCredentials } from '@/platforms/webex/app-config'
4
4
  import { WebexClient } from '@/platforms/webex/client'
5
5
  import { WebexCredentialManager } from '@/platforms/webex/credential-manager'
6
+ import { toRef } from '@/platforms/webex/id-normalizer'
6
7
 
7
8
  import type { AuthHint, AuthIO, PlatformAdapter, UnifiedChannel, UnifiedMessage } from './types'
8
9
 
@@ -25,6 +26,7 @@ export class WebexAdapter implements PlatformAdapter {
25
26
  const spaces = await this.client!.listSpaces()
26
27
  return spaces.map((space) => ({
27
28
  id: space.id,
29
+ ref: toRef(space.id),
28
30
  name: space.title,
29
31
  }))
30
32
  }
@@ -35,7 +37,9 @@ export class WebexAdapter implements PlatformAdapter {
35
37
  return messages
36
38
  .map((msg) => ({
37
39
  id: msg.id,
40
+ ref: toRef(msg.id),
38
41
  channelId: msg.roomId,
42
+ channelRef: toRef(msg.roomId),
39
43
  author: msg.personEmail,
40
44
  content: msg.text ?? '',
41
45
  timestamp: msg.created,