@velaro/cli 1.4.238 → 1.4.240
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.
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import { get, post } from '../api.js';
|
|
1
|
+
import { get, post, del } from '../api.js';
|
|
2
2
|
import { runCommand } from '../run.js';
|
|
3
3
|
|
|
4
4
|
// velaro conversation-action: REST actions on a conversation. Mirrors the conversation_action_send_message,
|
|
5
5
|
// conversation_action_resolve, conversation_action_assign and conversation_action_notes MCP tools.
|
|
6
6
|
export const conversationActionCommand = {
|
|
7
7
|
command: 'conversation-action <action> <id>',
|
|
8
|
-
describe: 'send | resolve | assign | notes on a conversation',
|
|
8
|
+
describe: 'send | resolve | assign | notes | transfer | tags | tag-add | tag-remove | transcript on a conversation',
|
|
9
9
|
builder: y => y
|
|
10
|
-
.positional('action', { choices: ['send', 'resolve', 'assign', 'notes'] })
|
|
10
|
+
.positional('action', { choices: ['send', 'resolve', 'assign', 'notes', 'transfer', 'tags', 'tag-add', 'tag-remove', 'transcript'] })
|
|
11
11
|
.positional('id', { type: 'number' })
|
|
12
12
|
.option('text', { type: 'string', describe: 'Message text (send)' })
|
|
13
13
|
.option('agent-id', { type: 'number', describe: 'Agent id (assign, optional for send/resolve)' })
|
|
14
|
-
.option('topic', { type: 'string', describe: 'Topic (resolve)' })
|
|
14
|
+
.option('topic', { type: 'string', describe: 'Topic (resolve)' })
|
|
15
|
+
.option('team-id', { type: 'number', describe: 'Team id (transfer)' })
|
|
16
|
+
.option('tag-id', { type: 'number', describe: 'Tag id (tag-add by id, tag-remove)' })
|
|
17
|
+
.option('name', { type: 'string', describe: 'Tag name (tag-add; created when new)' }),
|
|
15
18
|
handler: runCommand(async argv => {
|
|
16
19
|
const base = `/api/v1/conversations/${argv.id}`;
|
|
17
20
|
let d;
|
|
18
21
|
if (argv.action === 'send') d = await post(`${base}/messages`, { text: argv.text, agentId: argv.agentId });
|
|
19
22
|
else if (argv.action === 'resolve') d = await post(`${base}/resolve`, { topic: argv.topic, agentId: argv.agentId });
|
|
20
23
|
else if (argv.action === 'assign') d = await post(`${base}/assign`, { agentId: argv.agentId });
|
|
24
|
+
else if (argv.action === 'transfer') d = await post(`${base}/transfer`, { teamId: argv.teamId, agentId: argv.agentId });
|
|
25
|
+
else if (argv.action === 'tags') d = await get(`${base}/tags`);
|
|
26
|
+
else if (argv.action === 'tag-add') d = await post(`${base}/tags`, { tagId: argv.tagId, name: argv.name });
|
|
27
|
+
else if (argv.action === 'tag-remove') d = await del(`${base}/tags/${argv.tagId}`);
|
|
28
|
+
else if (argv.action === 'transcript') d = await get(`${base}/transcript`);
|
|
21
29
|
else d = await get(`${base}/notes`);
|
|
22
30
|
console.log(JSON.stringify(d, null, 2));
|
|
23
31
|
}),
|
package/lib/kb-screenshot.js
CHANGED
|
@@ -86,6 +86,18 @@ async function loadPlaywright() {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
// The SPA can bounce through the CIAM "Pick an account" page; choose the signed-in tile (at most 3 hops).
|
|
90
|
+
async function chooseSignedInAccount(page) {
|
|
91
|
+
for (let i = 0; i < 3; i++) {
|
|
92
|
+
if (!/login\.velaro\.com/.test(page.url())) break;
|
|
93
|
+
const tile = page.getByText('Signed in', { exact: true }).first();
|
|
94
|
+
if (!(await tile.isVisible().catch(() => false))) break;
|
|
95
|
+
await tile.click();
|
|
96
|
+
await page.waitForURL((u) => !/login\.velaro\.com/.test(u.toString()), { timeout: 30_000 }).catch(() => {});
|
|
97
|
+
await page.waitForLoadState('networkidle', { timeout: 15_000 }).catch(() => {});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
89
101
|
/**
|
|
90
102
|
* Logs into the given app on staging using the same form-fill steps as
|
|
91
103
|
* e2e/tests/auth.setup.ts, navigates to `route`, optionally clicks a selector,
|
|
@@ -186,7 +198,7 @@ export async function loginAndScreenshot(app, route, outputPath, opts = {}) {
|
|
|
186
198
|
|
|
187
199
|
// Handle "Stay signed in?" prompt — not always shown.
|
|
188
200
|
try {
|
|
189
|
-
await page.getByRole('button', { name:
|
|
201
|
+
await page.getByRole('button', { name: 'Yes', exact: true }).click({ timeout: 15_000 });
|
|
190
202
|
} catch { /* prompt not shown — proceed */ }
|
|
191
203
|
|
|
192
204
|
await page.waitForURL(/velaro\.com/, { timeout: 30_000 });
|
|
@@ -200,6 +212,30 @@ export async function loginAndScreenshot(app, route, outputPath, opts = {}) {
|
|
|
200
212
|
// capture just because the network never goes fully idle.
|
|
201
213
|
});
|
|
202
214
|
|
|
215
|
+
// The SPA can bounce through the CIAM "Pick an account" page; choose the signed-in tile.
|
|
216
|
+
await chooseSignedInAccount(page);
|
|
217
|
+
|
|
218
|
+
// The HTML splash and the app's own loading screen both look "idle" to networkidle;
|
|
219
|
+
// a capture taken then is a picture of the loading screen (seen 2026-11-03 on usage page).
|
|
220
|
+
await page.waitForSelector('#app-splash', { state: 'detached', timeout: 30_000 }).catch(() => {});
|
|
221
|
+
await page.waitForFunction(
|
|
222
|
+
() => !/preparing your workspace|before reacting|loading/i.test(document.body.innerText.slice(0, 400)) && document.querySelectorAll('nav, aside, main').length > 0,
|
|
223
|
+
undefined,
|
|
224
|
+
{ timeout: 30_000 }
|
|
225
|
+
).catch(() => {});
|
|
226
|
+
await page.waitForSelector('.vw-lockup', { state: 'detached', timeout: 60_000 }).catch(() => {});
|
|
227
|
+
await page.waitForTimeout(3000);
|
|
228
|
+
|
|
229
|
+
// Again after the app settles: the SPA can bounce through the CIAM "Pick an account" page; choose the signed-in tile.
|
|
230
|
+
await chooseSignedInAccount(page);
|
|
231
|
+
|
|
232
|
+
await page.waitForFunction(
|
|
233
|
+
() => !/preparing your workspace|before reacting|loading/i.test(document.body.innerText.slice(0, 400)),
|
|
234
|
+
undefined,
|
|
235
|
+
{ timeout: 30_000 }
|
|
236
|
+
).catch(() => {});
|
|
237
|
+
await page.waitForTimeout(1500);
|
|
238
|
+
|
|
203
239
|
let captureTarget = page;
|
|
204
240
|
|
|
205
241
|
if (opts.click) {
|
package/package.json
CHANGED