libretto 0.6.14 → 0.6.15
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/dist/cli/commands/auth.js +19 -0
- package/dist/cli/commands/execution.js +1 -1
- package/dist/cli/core/providers/kernel.js +3 -3
- package/package.json +1 -1
- package/skills/libretto/SKILL.md +1 -1
- package/skills/libretto-readonly/SKILL.md +1 -1
- package/src/cli/commands/auth.ts +22 -0
- package/src/cli/commands/execution.ts +1 -1
- package/src/cli/core/providers/kernel.ts +4 -3
|
@@ -215,6 +215,23 @@ const loginCommand = SimpleCLI.command({
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
|
+
const forgotPasswordCommand = SimpleCLI.command({
|
|
219
|
+
description: "Send a password reset email"
|
|
220
|
+
}).input(SimpleCLI.input({ positionals: [], named: {} })).handle(async () => {
|
|
221
|
+
const apiUrl = resolveHostedApiUrl();
|
|
222
|
+
const email = await prompt("Email:");
|
|
223
|
+
const result = await orpcCall({
|
|
224
|
+
apiUrl,
|
|
225
|
+
path: "/v1/auth/requestPasswordReset",
|
|
226
|
+
input: { email },
|
|
227
|
+
unauthenticated: true
|
|
228
|
+
});
|
|
229
|
+
if (result.status === "not_found") {
|
|
230
|
+
console.log(`No Libretto account exists for ${email}.`);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
console.log(`Password reset link sent to ${email}.`);
|
|
234
|
+
});
|
|
218
235
|
const logoutCommand = SimpleCLI.command({
|
|
219
236
|
description: "Clear local libretto credentials"
|
|
220
237
|
}).handle(async () => {
|
|
@@ -498,6 +515,7 @@ const authCommands = SimpleCLI.group({
|
|
|
498
515
|
routes: {
|
|
499
516
|
signup: signupCommand,
|
|
500
517
|
login: loginCommand,
|
|
518
|
+
"forgot-password": forgotPasswordCommand,
|
|
501
519
|
logout: logoutCommand,
|
|
502
520
|
invite: inviteCommand,
|
|
503
521
|
"accept-invite": acceptInviteCommand,
|
|
@@ -518,6 +536,7 @@ export {
|
|
|
518
536
|
apiKeyListCommand,
|
|
519
537
|
apiKeyRevokeCommand,
|
|
520
538
|
authCommands,
|
|
539
|
+
forgotPasswordCommand,
|
|
521
540
|
inviteCommand,
|
|
522
541
|
loginCommand,
|
|
523
542
|
logoutCommand,
|
|
@@ -601,7 +601,7 @@ const readonlyExecCommand = SimpleCLI.command({
|
|
|
601
601
|
mode: "readonly-exec"
|
|
602
602
|
});
|
|
603
603
|
});
|
|
604
|
-
const runUsage = `Usage: ${librettoCommand("run <integrationFile> [--params <json> | --params-file <path>] [--tsconfig <path>] [--headed|--headless] [--read-only|--write-access] [--no-visualize] [--stay-open-on-success] [--viewport WxH]")}`;
|
|
604
|
+
const runUsage = `Usage: ${librettoCommand("run <integrationFile> [--params <json> | --params-file <path>] [--tsconfig <path>] [--headed|--headless] [--read-only|--write-access] [--no-visualize] [--stay-open-on-success] [--viewport WxH] [--provider <provider>]")}`;
|
|
605
605
|
const runInput = SimpleCLI.input({
|
|
606
606
|
positionals: [
|
|
607
607
|
SimpleCLI.positional("integrationFile", z.string().optional(), {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
const KERNEL_API_ENDPOINT = "https://api.onkernel.com";
|
|
1
2
|
function createKernelProvider() {
|
|
2
3
|
const apiKey = process.env.KERNEL_API_KEY;
|
|
3
4
|
if (!apiKey)
|
|
4
5
|
throw new Error("KERNEL_API_KEY is required for Kernel provider.");
|
|
5
|
-
const endpoint = process.env.KERNEL_ENDPOINT ?? "https://api.onkernel.com";
|
|
6
6
|
return {
|
|
7
7
|
async createSession() {
|
|
8
|
-
const resp = await fetch(`${
|
|
8
|
+
const resp = await fetch(`${KERNEL_API_ENDPOINT}/browsers`, {
|
|
9
9
|
method: "POST",
|
|
10
10
|
headers: {
|
|
11
11
|
Authorization: `Bearer ${apiKey}`,
|
|
@@ -28,7 +28,7 @@ function createKernelProvider() {
|
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
async closeSession(sessionId) {
|
|
31
|
-
const resp = await fetch(`${
|
|
31
|
+
const resp = await fetch(`${KERNEL_API_ENDPOINT}/browsers/${sessionId}`, {
|
|
32
32
|
method: "DELETE",
|
|
33
33
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
34
34
|
});
|
package/package.json
CHANGED
package/skills/libretto/SKILL.md
CHANGED
package/src/cli/commands/auth.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* libretto cloud auth signup
|
|
5
5
|
* libretto cloud auth login
|
|
6
|
+
* libretto cloud auth forgot-password
|
|
6
7
|
* libretto cloud auth logout
|
|
7
8
|
* libretto cloud auth invite <email> [--role member|admin|owner]
|
|
8
9
|
* libretto cloud auth accept-invite <tenantSlug> <invitationId>
|
|
@@ -367,6 +368,26 @@ export const loginCommand = SimpleCLI.command({
|
|
|
367
368
|
}
|
|
368
369
|
});
|
|
369
370
|
|
|
371
|
+
export const forgotPasswordCommand = SimpleCLI.command({
|
|
372
|
+
description: "Send a password reset email",
|
|
373
|
+
})
|
|
374
|
+
.input(SimpleCLI.input({ positionals: [], named: {} }))
|
|
375
|
+
.handle(async () => {
|
|
376
|
+
const apiUrl = resolveHostedApiUrl();
|
|
377
|
+
const email = await prompt("Email:");
|
|
378
|
+
const result = await orpcCall<{ status: "sent" | "not_found" }>({
|
|
379
|
+
apiUrl,
|
|
380
|
+
path: "/v1/auth/requestPasswordReset",
|
|
381
|
+
input: { email },
|
|
382
|
+
unauthenticated: true,
|
|
383
|
+
});
|
|
384
|
+
if (result.status === "not_found") {
|
|
385
|
+
console.log(`No Libretto account exists for ${email}.`);
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
console.log(`Password reset link sent to ${email}.`);
|
|
389
|
+
});
|
|
390
|
+
|
|
370
391
|
// ---------------------------------------------------------------------------
|
|
371
392
|
// logout
|
|
372
393
|
// ---------------------------------------------------------------------------
|
|
@@ -762,6 +783,7 @@ export const authCommands = SimpleCLI.group({
|
|
|
762
783
|
routes: {
|
|
763
784
|
signup: signupCommand,
|
|
764
785
|
login: loginCommand,
|
|
786
|
+
"forgot-password": forgotPasswordCommand,
|
|
765
787
|
logout: logoutCommand,
|
|
766
788
|
invite: inviteCommand,
|
|
767
789
|
"accept-invite": acceptInviteCommand,
|
|
@@ -765,7 +765,7 @@ export const readonlyExecCommand = SimpleCLI.command({
|
|
|
765
765
|
});
|
|
766
766
|
});
|
|
767
767
|
|
|
768
|
-
const runUsage = `Usage: ${librettoCommand("run <integrationFile> [--params <json> | --params-file <path>] [--tsconfig <path>] [--headed|--headless] [--read-only|--write-access] [--no-visualize] [--stay-open-on-success] [--viewport WxH]")}`;
|
|
768
|
+
const runUsage = `Usage: ${librettoCommand("run <integrationFile> [--params <json> | --params-file <path>] [--tsconfig <path>] [--headed|--headless] [--read-only|--write-access] [--no-visualize] [--stay-open-on-success] [--viewport WxH] [--provider <provider>]")}`;
|
|
769
769
|
|
|
770
770
|
export const runInput = SimpleCLI.input({
|
|
771
771
|
positionals: [
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { ProviderApi } from "./types.js";
|
|
2
2
|
|
|
3
|
+
const KERNEL_API_ENDPOINT = "https://api.onkernel.com";
|
|
4
|
+
|
|
3
5
|
export function createKernelProvider(): ProviderApi {
|
|
4
6
|
const apiKey = process.env.KERNEL_API_KEY;
|
|
5
7
|
if (!apiKey)
|
|
6
8
|
throw new Error("KERNEL_API_KEY is required for Kernel provider.");
|
|
7
|
-
const endpoint = process.env.KERNEL_ENDPOINT ?? "https://api.onkernel.com";
|
|
8
9
|
|
|
9
10
|
return {
|
|
10
11
|
async createSession() {
|
|
11
|
-
const resp = await fetch(`${
|
|
12
|
+
const resp = await fetch(`${KERNEL_API_ENDPOINT}/browsers`, {
|
|
12
13
|
method: "POST",
|
|
13
14
|
headers: {
|
|
14
15
|
Authorization: `Bearer ${apiKey}`,
|
|
@@ -34,7 +35,7 @@ export function createKernelProvider(): ProviderApi {
|
|
|
34
35
|
};
|
|
35
36
|
},
|
|
36
37
|
async closeSession(sessionId) {
|
|
37
|
-
const resp = await fetch(`${
|
|
38
|
+
const resp = await fetch(`${KERNEL_API_ENDPOINT}/browsers/${sessionId}`, {
|
|
38
39
|
method: "DELETE",
|
|
39
40
|
headers: { Authorization: `Bearer ${apiKey}` },
|
|
40
41
|
});
|