agent-messenger 2.20.5 → 2.22.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 +8 -5
- package/dist/package.json +9 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +3 -0
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/webex/client.d.ts +19 -0
- package/dist/src/platforms/webex/client.d.ts.map +1 -1
- package/dist/src/platforms/webex/client.js +81 -1
- package/dist/src/platforms/webex/client.js.map +1 -1
- package/dist/src/platforms/webexbot/cli.d.ts +5 -0
- package/dist/src/platforms/webexbot/cli.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/cli.js +33 -0
- package/dist/src/platforms/webexbot/cli.js.map +1 -0
- package/dist/src/platforms/webexbot/client.d.ts +61 -0
- package/dist/src/platforms/webexbot/client.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/client.js +80 -0
- package/dist/src/platforms/webexbot/client.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/auth.d.ts +28 -0
- package/dist/src/platforms/webexbot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/auth.js +166 -0
- package/dist/src/platforms/webexbot/commands/auth.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/file.d.ts +22 -0
- package/dist/src/platforms/webexbot/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/file.js +64 -0
- package/dist/src/platforms/webexbot/commands/file.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/index.d.ts +10 -0
- package/dist/src/platforms/webexbot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/index.js +10 -0
- package/dist/src/platforms/webexbot/commands/index.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/listen.d.ts +12 -0
- package/dist/src/platforms/webexbot/commands/listen.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/listen.js +85 -0
- package/dist/src/platforms/webexbot/commands/listen.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/member.d.ts +19 -0
- package/dist/src/platforms/webexbot/commands/member.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/member.js +33 -0
- package/dist/src/platforms/webexbot/commands/member.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/message.d.ts +44 -0
- package/dist/src/platforms/webexbot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/message.js +193 -0
- package/dist/src/platforms/webexbot/commands/message.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/shared.d.ts +9 -0
- package/dist/src/platforms/webexbot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/shared.js +13 -0
- package/dist/src/platforms/webexbot/commands/shared.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/snapshot.d.ts +24 -0
- package/dist/src/platforms/webexbot/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/snapshot.js +37 -0
- package/dist/src/platforms/webexbot/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/space.d.ts +28 -0
- package/dist/src/platforms/webexbot/commands/space.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/space.js +61 -0
- package/dist/src/platforms/webexbot/commands/space.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/user.d.ts +30 -0
- package/dist/src/platforms/webexbot/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/user.js +66 -0
- package/dist/src/platforms/webexbot/commands/user.js.map +1 -0
- package/dist/src/platforms/webexbot/commands/whoami.d.ts +16 -0
- package/dist/src/platforms/webexbot/commands/whoami.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/commands/whoami.js +29 -0
- package/dist/src/platforms/webexbot/commands/whoami.js.map +1 -0
- package/dist/src/platforms/webexbot/credential-manager.d.ts +17 -0
- package/dist/src/platforms/webexbot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/credential-manager.js +120 -0
- package/dist/src/platforms/webexbot/credential-manager.js.map +1 -0
- package/dist/src/platforms/webexbot/index.d.ts +9 -0
- package/dist/src/platforms/webexbot/index.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/index.js +6 -0
- package/dist/src/platforms/webexbot/index.js.map +1 -0
- package/dist/src/platforms/webexbot/listener.d.ts +44 -0
- package/dist/src/platforms/webexbot/listener.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/listener.js +214 -0
- package/dist/src/platforms/webexbot/listener.js.map +1 -0
- package/dist/src/platforms/webexbot/types.d.ts +60 -0
- package/dist/src/platforms/webexbot/types.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/types.js +28 -0
- package/dist/src/platforms/webexbot/types.js.map +1 -0
- package/dist/src/platforms/webexbot/wdm-discovery.d.ts +4 -0
- package/dist/src/platforms/webexbot/wdm-discovery.d.ts.map +1 -0
- package/dist/src/platforms/webexbot/wdm-discovery.js +36 -0
- package/dist/src/platforms/webexbot/wdm-discovery.js.map +1 -0
- package/docs/content/docs/cli/meta.json +1 -0
- package/docs/content/docs/cli/webexbot.mdx +292 -0
- package/docs/content/docs/sdk/meta.json +1 -0
- package/docs/content/docs/sdk/webexbot.mdx +342 -0
- package/docs/src/app/page.tsx +115 -19
- package/package.json +9 -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 +1 -1
- package/skills/agent-webexbot/SKILL.md +414 -0
- package/skills/agent-webexbot/references/authentication.md +225 -0
- package/skills/agent-webexbot/references/common-patterns.md +708 -0
- 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/cli.ts +4 -0
- package/src/platforms/webex/client.test.ts +10 -0
- package/src/platforms/webex/client.ts +97 -3
- package/src/platforms/webex/typings/webex-message-handler.d.ts +360 -29
- package/src/platforms/webexbot/cli.ts +48 -0
- package/src/platforms/webexbot/client.test.ts +198 -0
- package/src/platforms/webexbot/client.ts +113 -0
- package/src/platforms/webexbot/commands/auth.test.ts +185 -0
- package/src/platforms/webexbot/commands/auth.ts +210 -0
- package/src/platforms/webexbot/commands/file.ts +104 -0
- package/src/platforms/webexbot/commands/index.ts +9 -0
- package/src/platforms/webexbot/commands/listen.test.ts +20 -0
- package/src/platforms/webexbot/commands/listen.ts +104 -0
- package/src/platforms/webexbot/commands/member.ts +51 -0
- package/src/platforms/webexbot/commands/message.ts +263 -0
- package/src/platforms/webexbot/commands/shared.ts +22 -0
- package/src/platforms/webexbot/commands/snapshot.ts +60 -0
- package/src/platforms/webexbot/commands/space.ts +88 -0
- package/src/platforms/webexbot/commands/user.test.ts +77 -0
- package/src/platforms/webexbot/commands/user.ts +98 -0
- package/src/platforms/webexbot/commands/whoami.ts +43 -0
- package/src/platforms/webexbot/credential-manager.test.ts +182 -0
- package/src/platforms/webexbot/credential-manager.ts +149 -0
- package/src/platforms/webexbot/index.ts +8 -0
- package/src/platforms/webexbot/listener.test.ts +234 -0
- package/src/platforms/webexbot/listener.ts +255 -0
- package/src/platforms/webexbot/types.test.ts +87 -0
- package/src/platforms/webexbot/types.ts +72 -0
- package/src/platforms/webexbot/wdm-discovery.test.ts +97 -0
- package/src/platforms/webexbot/wdm-discovery.ts +43 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { cliOutput } from '../../../shared/utils/cli-output.js';
|
|
3
|
+
import { getClient } from './shared.js';
|
|
4
|
+
function formatMessage(message) {
|
|
5
|
+
return {
|
|
6
|
+
id: message.id,
|
|
7
|
+
roomId: message.roomId,
|
|
8
|
+
text: message.text,
|
|
9
|
+
markdown: message.markdown,
|
|
10
|
+
html: message.html,
|
|
11
|
+
personEmail: message.personEmail,
|
|
12
|
+
created: message.created,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export async function sendAction(space, text, options) {
|
|
16
|
+
try {
|
|
17
|
+
const client = await getClient(options);
|
|
18
|
+
const message = await client.sendMessage(space, text, { markdown: options.markdown, parentId: options.parent });
|
|
19
|
+
return formatMessage(message);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return { error: error.message };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export async function replyAction(space, parentId, text, options) {
|
|
26
|
+
try {
|
|
27
|
+
const client = await getClient(options);
|
|
28
|
+
const message = await client.sendMessage(space, text, { markdown: options.markdown, parentId });
|
|
29
|
+
return formatMessage(message);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return { error: error.message };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function repliesAction(space, parentId, options) {
|
|
36
|
+
try {
|
|
37
|
+
const client = await getClient(options);
|
|
38
|
+
const max = options.max ? parseInt(options.max, 10) : 50;
|
|
39
|
+
const messages = await client.listReplies(space, parentId, { max });
|
|
40
|
+
return {
|
|
41
|
+
messages: messages.map((msg) => ({
|
|
42
|
+
id: msg.id,
|
|
43
|
+
roomId: msg.roomId,
|
|
44
|
+
text: msg.text,
|
|
45
|
+
personEmail: msg.personEmail,
|
|
46
|
+
created: msg.created,
|
|
47
|
+
})),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return { error: error.message };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export async function dmAction(email, text, options) {
|
|
55
|
+
try {
|
|
56
|
+
const client = await getClient(options);
|
|
57
|
+
const message = await client.sendDirectMessage(email, text, { markdown: options.markdown });
|
|
58
|
+
return formatMessage(message);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
return { error: error.message };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export async function listAction(space, options) {
|
|
65
|
+
try {
|
|
66
|
+
const client = await getClient(options);
|
|
67
|
+
const max = options.max ? parseInt(options.max, 10) : 50;
|
|
68
|
+
const messages = await client.listMessages(space, { max });
|
|
69
|
+
return {
|
|
70
|
+
messages: messages.map((msg) => ({
|
|
71
|
+
id: msg.id,
|
|
72
|
+
roomId: msg.roomId,
|
|
73
|
+
text: msg.text,
|
|
74
|
+
personEmail: msg.personEmail,
|
|
75
|
+
created: msg.created,
|
|
76
|
+
})),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return { error: error.message };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export async function getAction(messageId, options) {
|
|
84
|
+
try {
|
|
85
|
+
const client = await getClient(options);
|
|
86
|
+
const message = await client.getMessage(messageId);
|
|
87
|
+
return formatMessage(message);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
return { error: error.message };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export async function deleteAction(messageId, options) {
|
|
94
|
+
try {
|
|
95
|
+
const client = await getClient(options);
|
|
96
|
+
await client.deleteMessage(messageId);
|
|
97
|
+
return { deleted: messageId };
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return { error: error.message };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export async function editAction(messageId, space, text, options) {
|
|
104
|
+
try {
|
|
105
|
+
const client = await getClient(options);
|
|
106
|
+
const message = await client.editMessage(messageId, space, text, { markdown: options.markdown });
|
|
107
|
+
return formatMessage(message);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return { error: error.message };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export const messageCommand = new Command('message')
|
|
114
|
+
.description('Message commands')
|
|
115
|
+
.addCommand(new Command('send')
|
|
116
|
+
.description('Send a message to a space')
|
|
117
|
+
.argument('<space>', 'Space/Room ID')
|
|
118
|
+
.argument('<text>', 'Message text')
|
|
119
|
+
.option('--markdown', 'Send as markdown')
|
|
120
|
+
.option('--parent <id>', 'Reply within a thread (parent message ID)')
|
|
121
|
+
.option('--bot <id>', 'Use specific bot')
|
|
122
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
123
|
+
.action(async (space, text, opts) => {
|
|
124
|
+
cliOutput(await sendAction(space, text, opts), opts.pretty);
|
|
125
|
+
}))
|
|
126
|
+
.addCommand(new Command('reply')
|
|
127
|
+
.description('Reply to a message in a thread')
|
|
128
|
+
.argument('<space>', 'Space/Room ID')
|
|
129
|
+
.argument('<parent>', 'Parent message ID')
|
|
130
|
+
.argument('<text>', 'Reply text')
|
|
131
|
+
.option('--markdown', 'Send as markdown')
|
|
132
|
+
.option('--bot <id>', 'Use specific bot')
|
|
133
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
134
|
+
.action(async (space, parent, text, opts) => {
|
|
135
|
+
cliOutput(await replyAction(space, parent, text, opts), opts.pretty);
|
|
136
|
+
}))
|
|
137
|
+
.addCommand(new Command('replies')
|
|
138
|
+
.description('List replies in a thread')
|
|
139
|
+
.argument('<space>', 'Space/Room ID')
|
|
140
|
+
.argument('<parent>', 'Parent message ID')
|
|
141
|
+
.option('--max <n>', 'Number of replies to fetch', '50')
|
|
142
|
+
.option('--bot <id>', 'Use specific bot')
|
|
143
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
144
|
+
.action(async (space, parent, opts) => {
|
|
145
|
+
cliOutput(await repliesAction(space, parent, opts), opts.pretty);
|
|
146
|
+
}))
|
|
147
|
+
.addCommand(new Command('dm')
|
|
148
|
+
.description('Send a direct message by recipient email')
|
|
149
|
+
.argument('<email>', 'Recipient email address')
|
|
150
|
+
.argument('<text>', 'Message text')
|
|
151
|
+
.option('--markdown', 'Send as markdown')
|
|
152
|
+
.option('--bot <id>', 'Use specific bot')
|
|
153
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
154
|
+
.action(async (email, text, opts) => {
|
|
155
|
+
cliOutput(await dmAction(email, text, opts), opts.pretty);
|
|
156
|
+
}))
|
|
157
|
+
.addCommand(new Command('list')
|
|
158
|
+
.description('List messages in a space')
|
|
159
|
+
.argument('<space>', 'Space/Room ID')
|
|
160
|
+
.option('--max <n>', 'Number of messages to fetch', '50')
|
|
161
|
+
.option('--bot <id>', 'Use specific bot')
|
|
162
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
163
|
+
.action(async (space, opts) => {
|
|
164
|
+
cliOutput(await listAction(space, opts), opts.pretty);
|
|
165
|
+
}))
|
|
166
|
+
.addCommand(new Command('get')
|
|
167
|
+
.description('Get a single message')
|
|
168
|
+
.argument('<id>', 'Message ID')
|
|
169
|
+
.option('--bot <id>', 'Use specific bot')
|
|
170
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
171
|
+
.action(async (messageId, opts) => {
|
|
172
|
+
cliOutput(await getAction(messageId, opts), opts.pretty);
|
|
173
|
+
}))
|
|
174
|
+
.addCommand(new Command('delete')
|
|
175
|
+
.description('Delete a message')
|
|
176
|
+
.argument('<id>', 'Message ID')
|
|
177
|
+
.option('--bot <id>', 'Use specific bot')
|
|
178
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
179
|
+
.action(async (messageId, opts) => {
|
|
180
|
+
cliOutput(await deleteAction(messageId, opts), opts.pretty);
|
|
181
|
+
}))
|
|
182
|
+
.addCommand(new Command('edit')
|
|
183
|
+
.description('Edit a message')
|
|
184
|
+
.argument('<id>', 'Message ID')
|
|
185
|
+
.argument('<space>', 'Space/Room ID')
|
|
186
|
+
.argument('<text>', 'New message text')
|
|
187
|
+
.option('--markdown', 'Send as markdown')
|
|
188
|
+
.option('--bot <id>', 'Use specific bot')
|
|
189
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
190
|
+
.action(async (messageId, space, text, opts) => {
|
|
191
|
+
cliOutput(await editAction(messageId, space, text, opts), opts.pretty);
|
|
192
|
+
}));
|
|
193
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAIrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAqBpC,SAAS,aAAa,CAAC,OAAqB;IAC1C,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAA;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,KAAa,EACb,IAAY,EACZ,OAA4D;IAE5D,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;QAE/G,OAAO,aAAa,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAA;IAC5C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AAC;KAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;KAC9B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;KACpC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;KACtC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,KAAa,EAAE,IAAY,EAAE,IAAwC,EAAE,EAAE;IACzG,SAAS,CAAC,MAAM,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AACxE,CAAC,CAAC,CACL,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WebexBotClient } from '../client.js';
|
|
2
|
+
import { WebexBotCredentialManager } from '../credential-manager.js';
|
|
3
|
+
export interface BotOption {
|
|
4
|
+
bot?: string;
|
|
5
|
+
pretty?: boolean;
|
|
6
|
+
_credManager?: WebexBotCredentialManager;
|
|
7
|
+
}
|
|
8
|
+
export declare function getClient(options: BotOption): Promise<WebexBotClient>;
|
|
9
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/shared.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,yBAAyB,CAAA;CACzC;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAU3E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
2
|
+
import { WebexBotClient } from '../client.js';
|
|
3
|
+
import { WebexBotCredentialManager } from '../credential-manager.js';
|
|
4
|
+
export async function getClient(options) {
|
|
5
|
+
const credManager = options._credManager ?? new WebexBotCredentialManager();
|
|
6
|
+
const creds = await credManager.getCredentials(options.bot);
|
|
7
|
+
if (!creds) {
|
|
8
|
+
console.log(formatOutput({ error: 'No credentials. Run "auth set <token>" first.' }, options.pretty));
|
|
9
|
+
process.exit(1);
|
|
10
|
+
}
|
|
11
|
+
return new WebexBotClient().login({ token: creds.token });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQjE,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAkB;IAChD,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,IAAI,IAAI,yBAAyB,EAAE,CAAA;IAC3E,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAE3D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,+CAA+C,EAAE,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;QACrG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,OAAO,IAAI,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAA;AAC3D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { BotOption } from './shared.js';
|
|
3
|
+
interface SnapshotResult {
|
|
4
|
+
bot?: {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
emails: string[];
|
|
8
|
+
};
|
|
9
|
+
spaces?: Array<{
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
type?: 'group' | 'direct';
|
|
13
|
+
lastActivity?: string;
|
|
14
|
+
}>;
|
|
15
|
+
hint?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function snapshotAction(options: BotOption & {
|
|
19
|
+
full?: boolean;
|
|
20
|
+
max?: string;
|
|
21
|
+
}): Promise<SnapshotResult>;
|
|
22
|
+
export declare const snapshotCommand: Command;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,UAAU,cAAc;IACtB,GAAG,CAAC,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,MAAM,EAAE,CAAA;KACjB,CAAA;IACD,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;QACzB,YAAY,CAAC,EAAE,MAAM,CAAA;KACtB,CAAC,CAAA;IACF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,cAAc,CAAC,OAAO,EAAE,SAAS,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CA0BnH;AAED,eAAO,MAAM,eAAe,SAQxB,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { cliOutput } from '../../../shared/utils/cli-output.js';
|
|
3
|
+
import { getClient } from './shared.js';
|
|
4
|
+
export async function snapshotAction(options) {
|
|
5
|
+
try {
|
|
6
|
+
const client = await getClient(options);
|
|
7
|
+
const max = options.max ? parseInt(options.max, 10) : 100;
|
|
8
|
+
const [me, spaces] = await Promise.all([client.testAuth(), client.listSpaces({ max })]);
|
|
9
|
+
const result = {
|
|
10
|
+
bot: {
|
|
11
|
+
id: me.id,
|
|
12
|
+
displayName: me.displayName,
|
|
13
|
+
emails: me.emails,
|
|
14
|
+
},
|
|
15
|
+
spaces: options.full
|
|
16
|
+
? spaces.map((s) => ({ id: s.id, title: s.title, type: s.type, lastActivity: s.lastActivity }))
|
|
17
|
+
: spaces.map((s) => ({ id: s.id, title: s.title })),
|
|
18
|
+
};
|
|
19
|
+
if (!options.full) {
|
|
20
|
+
result.hint = "Use 'message list <space>' for messages, 'space info <space>' for details.";
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
return { error: error.message };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export const snapshotCommand = new Command('snapshot')
|
|
29
|
+
.description('Workspace overview for AI agents (brief by default, --full for details)')
|
|
30
|
+
.option('--full', 'Include full space details')
|
|
31
|
+
.option('--max <n>', 'Number of spaces to retrieve', '100')
|
|
32
|
+
.option('--bot <id>', 'Use specific bot')
|
|
33
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
34
|
+
.action(async (opts) => {
|
|
35
|
+
cliOutput(await snapshotAction(opts), opts.pretty);
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAkBpC,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAqD;IACxF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;QAEzD,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;QAEvF,MAAM,MAAM,GAAmB;YAC7B,GAAG,EAAE;gBACH,EAAE,EAAE,EAAE,CAAC,EAAE;gBACT,WAAW,EAAE,EAAE,CAAC,WAAW;gBAC3B,MAAM,EAAE,EAAE,CAAC,MAAM;aAClB;YACD,MAAM,EAAE,OAAO,CAAC,IAAI;gBAClB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;gBAC/F,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;SACtD,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,GAAG,4EAA4E,CAAA;QAC5F,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAA;IAC5C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;KACnD,WAAW,CAAC,yEAAyE,CAAC;KACtF,MAAM,CAAC,QAAQ,EAAE,4BAA4B,CAAC;KAC9C,MAAM,CAAC,WAAW,EAAE,8BAA8B,EAAE,KAAK,CAAC;KAC1D,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,IAAkD,EAAE,EAAE;IACnE,SAAS,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { BotOption } from './shared.js';
|
|
3
|
+
interface SpaceResult {
|
|
4
|
+
id?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
type?: 'group' | 'direct';
|
|
7
|
+
isLocked?: boolean;
|
|
8
|
+
teamId?: string | null;
|
|
9
|
+
lastActivity?: string;
|
|
10
|
+
created?: string;
|
|
11
|
+
creatorId?: string;
|
|
12
|
+
spaces?: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
type: 'group' | 'direct';
|
|
16
|
+
lastActivity: string;
|
|
17
|
+
created: string;
|
|
18
|
+
}>;
|
|
19
|
+
error?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function listAction(options: BotOption & {
|
|
22
|
+
max?: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
}): Promise<SpaceResult>;
|
|
25
|
+
export declare function infoAction(spaceId: string, options: BotOption): Promise<SpaceResult>;
|
|
26
|
+
export declare const spaceCommand: Command;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,UAAU,WAAW;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAA;QACxB,YAAY,EAAE,MAAM,CAAA;QACpB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAC,CAAA;IACF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,SAAS,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAkB3G;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAiB1F;AAED,eAAO,MAAM,YAAY,SAsBtB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { cliOutput } from '../../../shared/utils/cli-output.js';
|
|
3
|
+
import { getClient } from './shared.js';
|
|
4
|
+
export async function listAction(options) {
|
|
5
|
+
try {
|
|
6
|
+
const client = await getClient(options);
|
|
7
|
+
const max = options.max ? parseInt(options.max, 10) : 50;
|
|
8
|
+
const spaces = await client.listSpaces({ type: options.type, max });
|
|
9
|
+
return {
|
|
10
|
+
spaces: spaces.map((s) => ({
|
|
11
|
+
id: s.id,
|
|
12
|
+
title: s.title,
|
|
13
|
+
type: s.type,
|
|
14
|
+
lastActivity: s.lastActivity,
|
|
15
|
+
created: s.created,
|
|
16
|
+
})),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
return { error: error.message };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export async function infoAction(spaceId, options) {
|
|
24
|
+
try {
|
|
25
|
+
const client = await getClient(options);
|
|
26
|
+
const space = await client.getSpace(spaceId);
|
|
27
|
+
return {
|
|
28
|
+
id: space.id,
|
|
29
|
+
title: space.title,
|
|
30
|
+
type: space.type,
|
|
31
|
+
isLocked: space.isLocked,
|
|
32
|
+
teamId: space.teamId || null,
|
|
33
|
+
lastActivity: space.lastActivity,
|
|
34
|
+
created: space.created,
|
|
35
|
+
creatorId: space.creatorId,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return { error: error.message };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const spaceCommand = new Command('space')
|
|
43
|
+
.description('Space commands')
|
|
44
|
+
.addCommand(new Command('list')
|
|
45
|
+
.description('List spaces')
|
|
46
|
+
.option('--max <n>', 'Number of spaces to retrieve', '50')
|
|
47
|
+
.option('--type <type>', 'Filter by type (group or direct)')
|
|
48
|
+
.option('--bot <id>', 'Use specific bot')
|
|
49
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
50
|
+
.action(async (opts) => {
|
|
51
|
+
cliOutput(await listAction(opts), opts.pretty);
|
|
52
|
+
}))
|
|
53
|
+
.addCommand(new Command('info')
|
|
54
|
+
.description('Get space details')
|
|
55
|
+
.argument('<id>', 'Space ID')
|
|
56
|
+
.option('--bot <id>', 'Use specific bot')
|
|
57
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
58
|
+
.action(async (spaceId, opts) => {
|
|
59
|
+
cliOutput(await infoAction(spaceId, opts), opts.pretty);
|
|
60
|
+
}));
|
|
61
|
+
//# sourceMappingURL=space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.js","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAqBpC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAoD;IACnF,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QACxD,MAAM,MAAM,GAAG,MAAM,MA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C,OAAO,CAAC;KAC7C,WAAW,CAAC,gBAAgB,CAAC;KAC7B,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,aAAa,CAAC;KAC1B,MAAM,CAAC,WAAW,EAAE,8BAA8B,EAAE,IAAI,CAAC;KACzD,MAAM,CAAC,eAAe,EAAE,kCAAkC,CAAC;KAC3D,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,IAAiD,EAAE,EAAE;IAClE,SAAS,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AAChD,CAAC,CAAC,CACL;KACA,UAAU,CACT,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,mBAAmB,CAAC;KAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;KAC5B,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC;KACxC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,IAAe,EAAE,EAAE;IACjD,SAAS,CAAC,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AACzD,CAAC,CAAC,CACL,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { BotOption } from './shared.js';
|
|
3
|
+
interface UserResult {
|
|
4
|
+
id?: string;
|
|
5
|
+
emails?: string[];
|
|
6
|
+
displayName?: string;
|
|
7
|
+
nickName?: string;
|
|
8
|
+
firstName?: string;
|
|
9
|
+
lastName?: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
orgId?: string;
|
|
12
|
+
type?: 'person' | 'bot';
|
|
13
|
+
created?: string;
|
|
14
|
+
users?: Array<{
|
|
15
|
+
id: string;
|
|
16
|
+
emails: string[];
|
|
17
|
+
displayName: string;
|
|
18
|
+
type: 'person' | 'bot';
|
|
19
|
+
}>;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function listAction(options: BotOption & {
|
|
23
|
+
email?: string;
|
|
24
|
+
displayName?: string;
|
|
25
|
+
max?: string;
|
|
26
|
+
}): Promise<UserResult>;
|
|
27
|
+
export declare function infoAction(personId: string, options: BotOption): Promise<UserResult>;
|
|
28
|
+
export declare const userCommand: Command;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,UAAU,UAAU;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAA;QACV,MAAM,EAAE,MAAM,EAAE,CAAA;QAChB,WAAW,EAAE,MAAM,CAAA;QACnB,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAA;KACvB,CAAC,CAAA;IACF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAiBD,wBAAsB,UAAU,CAC9B,OAAO,EAAE,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1E,OAAO,CAAC,UAAU,CAAC,CAiBrB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAQ1F;AAED,eAAO,MAAM,WAAW,SAuBrB,CAAA"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { cliOutput } from '../../../shared/utils/cli-output.js';
|
|
3
|
+
import { getClient } from './shared.js';
|
|
4
|
+
function formatPerson(person) {
|
|
5
|
+
return {
|
|
6
|
+
id: person.id,
|
|
7
|
+
emails: person.emails,
|
|
8
|
+
displayName: person.displayName,
|
|
9
|
+
nickName: person.nickName,
|
|
10
|
+
firstName: person.firstName,
|
|
11
|
+
lastName: person.lastName,
|
|
12
|
+
avatar: person.avatar,
|
|
13
|
+
orgId: person.orgId,
|
|
14
|
+
type: person.type,
|
|
15
|
+
created: person.created,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export async function listAction(options) {
|
|
19
|
+
try {
|
|
20
|
+
const client = await getClient(options);
|
|
21
|
+
const max = options.max ? parseInt(options.max, 10) : undefined;
|
|
22
|
+
const people = await client.listPeople({ email: options.email, displayName: options.displayName, max });
|
|
23
|
+
return {
|
|
24
|
+
users: people.map((p) => ({
|
|
25
|
+
id: p.id,
|
|
26
|
+
emails: p.emails,
|
|
27
|
+
displayName: p.displayName,
|
|
28
|
+
type: p.type,
|
|
29
|
+
})),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return { error: error.message };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export async function infoAction(personId, options) {
|
|
37
|
+
try {
|
|
38
|
+
const client = await getClient(options);
|
|
39
|
+
const person = await client.getPerson(personId);
|
|
40
|
+
return formatPerson(person);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return { error: error.message };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const userCommand = new Command('user')
|
|
47
|
+
.description('User commands')
|
|
48
|
+
.addCommand(new Command('list')
|
|
49
|
+
.description('Search people by email or display name')
|
|
50
|
+
.option('--email <email>', 'Filter by exact email')
|
|
51
|
+
.option('--display-name <name>', 'Filter by display name prefix')
|
|
52
|
+
.option('--max <n>', 'Number of users to retrieve')
|
|
53
|
+
.option('--bot <id>', 'Use specific bot')
|
|
54
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
55
|
+
.action(async (opts) => {
|
|
56
|
+
cliOutput(await listAction(opts), opts.pretty);
|
|
57
|
+
}))
|
|
58
|
+
.addCommand(new Command('info')
|
|
59
|
+
.description('Get details for a person')
|
|
60
|
+
.argument('<id>', 'Person ID')
|
|
61
|
+
.option('--bot <id>', 'Use specific bot')
|
|
62
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
63
|
+
.action(async (personId, opts) => {
|
|
64
|
+
cliOutput(await infoAction(personId, opts), opts.pretty);
|
|
65
|
+
}));
|
|
66
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAIrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAsBpC,SAAS,YAAY,CAAC,MAAmB;IACvC,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,MAAM,CAAC,WAA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+1,16 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import type { BotOption } from './shared.js';
|
|
3
|
+
interface WhoamiResult {
|
|
4
|
+
id?: string;
|
|
5
|
+
emails?: string[];
|
|
6
|
+
displayName?: string;
|
|
7
|
+
avatar?: string;
|
|
8
|
+
orgId?: string;
|
|
9
|
+
type?: 'person' | 'bot';
|
|
10
|
+
created?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function whoamiAction(options: BotOption): Promise<WhoamiResult>;
|
|
14
|
+
export declare const whoamiCommand: Command;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=whoami.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAGzC,UAAU,YAAY;IACpB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAgB5E;AAED,eAAO,MAAM,aAAa,SAMtB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { cliOutput } from '../../../shared/utils/cli-output.js';
|
|
3
|
+
import { getClient } from './shared.js';
|
|
4
|
+
export async function whoamiAction(options) {
|
|
5
|
+
try {
|
|
6
|
+
const client = await getClient(options);
|
|
7
|
+
const info = await client.testAuth();
|
|
8
|
+
return {
|
|
9
|
+
id: info.id,
|
|
10
|
+
emails: info.emails,
|
|
11
|
+
displayName: info.displayName,
|
|
12
|
+
avatar: info.avatar,
|
|
13
|
+
orgId: info.orgId,
|
|
14
|
+
type: info.type,
|
|
15
|
+
created: info.created,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return { error: error.message };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export const whoamiCommand = new Command('whoami')
|
|
23
|
+
.description('Show current authenticated bot')
|
|
24
|
+
.option('--bot <id>', 'Bot ID to use')
|
|
25
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
26
|
+
.action(async (opts) => {
|
|
27
|
+
cliOutput(await whoamiAction(opts), opts.pretty);
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=whoami.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../../../../src/platforms/webexbot/commands/whoami.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAapC,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAAkB;IACnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;QACvC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAA;QACpC,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAA;IAC5C,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KAC/C,WAAW,CAAC,gCAAgC,CAAC;KAC7C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC;KACrC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,KAAK,EAAE,IAAe,EAAE,EAAE;IAChC,SAAS,CAAC,MAAM,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { WebexBotConfig, WebexBotCredentials } from './types.js';
|
|
2
|
+
export declare class WebexBotCredentialManager {
|
|
3
|
+
private configDir;
|
|
4
|
+
private credentialsPath;
|
|
5
|
+
constructor(configDir?: string);
|
|
6
|
+
load(): Promise<WebexBotConfig>;
|
|
7
|
+
save(config: WebexBotConfig): Promise<void>;
|
|
8
|
+
getCredentials(botId?: string): Promise<WebexBotCredentials | null>;
|
|
9
|
+
setCredentials(creds: WebexBotCredentials): Promise<void>;
|
|
10
|
+
removeBot(botId: string): Promise<boolean>;
|
|
11
|
+
setCurrent(botId: string): Promise<boolean>;
|
|
12
|
+
listAll(): Promise<Array<WebexBotCredentials & {
|
|
13
|
+
is_current: boolean;
|
|
14
|
+
}>>;
|
|
15
|
+
clearCredentials(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=credential-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../../../src/platforms/webexbot/credential-manager.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGlE,qBAAa,yBAAyB;IACpC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,eAAe,CAAQ;gBAEnB,SAAS,CAAC,EAAE,MAAM;IAKxB,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC;IAqB/B,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAM3C,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAqCnE,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBzD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB1C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe3C,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,mBAAmB,GAAG;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAgBxE,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;CAGxC"}
|