libretto 0.6.30-experimental-runtime-libretto.1 → 0.6.31
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.
|
@@ -489,13 +489,16 @@ function toPortableRelativePath(args) {
|
|
|
489
489
|
}
|
|
490
490
|
return relPath;
|
|
491
491
|
}
|
|
492
|
+
function isShareableSourceRelPath(relPath) {
|
|
493
|
+
return !relPath.split("/").includes("node_modules");
|
|
494
|
+
}
|
|
492
495
|
function writeShareableSourceFiles(args) {
|
|
493
496
|
const relPaths = [...new Set(args.absSourcePaths.map(
|
|
494
497
|
(absPath) => toPortableRelativePath({
|
|
495
498
|
absPath,
|
|
496
499
|
absSourceDir: args.absSourceDir
|
|
497
500
|
})
|
|
498
|
-
))].sort();
|
|
501
|
+
))].filter(isShareableSourceRelPath).sort();
|
|
499
502
|
for (const relPath of relPaths) {
|
|
500
503
|
const targetPath = join(args.outputDir, ".libretto-share", "source", relPath);
|
|
501
504
|
mkdirSync(dirname(targetPath), { recursive: true });
|
|
@@ -888,7 +891,7 @@ async function writeBundledDeployEntrypoint(args) {
|
|
|
888
891
|
(inputPath) => isAbsolute(inputPath) ? resolve(inputPath) : resolve(args.absSourceDir, inputPath)
|
|
889
892
|
).filter((absPath) => {
|
|
890
893
|
const relPath = relative(args.absSourceDir, absPath);
|
|
891
|
-
return relPath !== "" && !relPath.startsWith("../") && relPath !== ".." && !isAbsolute(relPath);
|
|
894
|
+
return relPath !== "" && !relPath.startsWith("../") && relPath !== ".." && !isAbsolute(relPath) && isShareableSourceRelPath(relPath.replaceAll("\\", "/"));
|
|
892
895
|
});
|
|
893
896
|
return { shareableSourceFiles, workflows };
|
|
894
897
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libretto",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.31",
|
|
4
4
|
"description": "AI-powered browser automation library and CLI built on Playwright",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://libretto.sh",
|
|
@@ -33,21 +33,6 @@
|
|
|
33
33
|
"default": "./dist/index.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"sync:mirrors": "node ../dev-tools/scripts/sync-mirrors.mjs",
|
|
38
|
-
"check:mirrors": "node ../dev-tools/scripts/check-mirrors-sync.mjs",
|
|
39
|
-
"sync-skills": "pnpm run sync:mirrors",
|
|
40
|
-
"check:skills": "pnpm run check:mirrors",
|
|
41
|
-
"build": "tsup --config tsup.config.ts",
|
|
42
|
-
"lint": "lintcn lint --tsconfig tsconfig.json",
|
|
43
|
-
"type-check": "tsc --noEmit",
|
|
44
|
-
"test": "turbo run test:vitest --filter=libretto --log-order=grouped",
|
|
45
|
-
"test:vitest": "vitest run",
|
|
46
|
-
"test:watch": "vitest",
|
|
47
|
-
"cli": "node dist/index.js",
|
|
48
|
-
"generate-changelog": "tsx scripts/generate-changelog.ts",
|
|
49
|
-
"prepack": "pnpm run build"
|
|
50
|
-
},
|
|
51
36
|
"peerDependencies": {
|
|
52
37
|
"@ai-sdk/google": "^3.0.51",
|
|
53
38
|
"@ai-sdk/google-vertex": "^4.0.80"
|
|
@@ -80,11 +65,25 @@
|
|
|
80
65
|
"dependencies": {
|
|
81
66
|
"@ai-sdk/anthropic": "^3.0.66",
|
|
82
67
|
"@ai-sdk/openai": "^3.0.66",
|
|
83
|
-
"affordance": "^0.2.1",
|
|
84
68
|
"ai": "^6.0.116",
|
|
85
69
|
"esbuild": "^0.27.0",
|
|
86
70
|
"playwright": "^1.58.2",
|
|
87
71
|
"tsx": "^4.21.0",
|
|
88
|
-
"zod": "^4.3.6"
|
|
72
|
+
"zod": "^4.3.6",
|
|
73
|
+
"affordance": "^0.2.1"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"sync:mirrors": "node ../dev-tools/scripts/sync-mirrors.mjs",
|
|
77
|
+
"check:mirrors": "node ../dev-tools/scripts/check-mirrors-sync.mjs",
|
|
78
|
+
"sync-skills": "pnpm run sync:mirrors",
|
|
79
|
+
"check:skills": "pnpm run check:mirrors",
|
|
80
|
+
"build": "tsup --config tsup.config.ts",
|
|
81
|
+
"lint": "lintcn lint --tsconfig tsconfig.json",
|
|
82
|
+
"type-check": "tsc --noEmit",
|
|
83
|
+
"test": "turbo run test:vitest --filter=libretto --log-order=grouped",
|
|
84
|
+
"test:vitest": "vitest run",
|
|
85
|
+
"test:watch": "vitest",
|
|
86
|
+
"cli": "node dist/index.js",
|
|
87
|
+
"generate-changelog": "tsx scripts/generate-changelog.ts"
|
|
89
88
|
}
|
|
90
|
-
}
|
|
89
|
+
}
|
package/skills/libretto/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: "Browser automation CLI for building, maintaining, and running brow
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: saffron-health
|
|
7
|
-
version: "0.6.
|
|
7
|
+
version: "0.6.31"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## How Libretto Works
|
|
@@ -58,6 +58,7 @@ Prefer to enter sites at a user-facing URL (homepage, login, etc.) on the first
|
|
|
58
58
|
- Validation requires a successful clean `run` on a fresh, unauthenticated session with confirmation of the actual returned output, not just process success. Use the same headed or headless mode that the workflow run is already using.
|
|
59
59
|
- After validation, always show the user: (1) the output/results from the validation run, and (2) the same command so they can re-run it themselves. Include any `--params`, `--headed`, or `--headless` flags the workflow needs.
|
|
60
60
|
- Treat exploration sessions as disposable unless the user explicitly wants one kept open.
|
|
61
|
+
- Close disposable sessions before your final response once exploration, debugging, or validation is complete. Open browsers keep consuming local or hosted resources.
|
|
61
62
|
- Get explicit user confirmation before mutating actions or replaying network requests that may have side effects.
|
|
62
63
|
- Never run multiple `exec` commands at the same time.
|
|
63
64
|
- If the browser must remain read-only, switch to the `libretto-readonly` skill and use `readonly-exec` instead of `exec`.
|
|
@@ -183,6 +184,7 @@ npx libretto save app.example.com
|
|
|
183
184
|
### `close`
|
|
184
185
|
|
|
185
186
|
- Use `close` when the user is done with the session or an exploration session is no longer helping progress (unless the user asked to keep watching that browser).
|
|
187
|
+
- Prefer closing sessions promptly after successful validation or diagnosis so unused browsers do not keep consuming resources.
|
|
186
188
|
- `close --all` is available for workspace cleanup.
|
|
187
189
|
|
|
188
190
|
```bash
|
|
@@ -4,7 +4,7 @@ description: "Read-only Libretto workflow for diagnosing live browser state with
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: saffron-health
|
|
7
|
-
version: "0.6.
|
|
7
|
+
version: "0.6.31"
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## How Libretto Read-Only Works
|
|
@@ -23,6 +23,7 @@ metadata:
|
|
|
23
23
|
- Prefer `snapshot` first when the visible page state is unclear.
|
|
24
24
|
- Use `readonly-exec` for focused inspection: titles, HTML, locator text, counts, visibility checks, and GET requests.
|
|
25
25
|
- Keep snippets small and purpose-built. Do not run multiple `readonly-exec` commands at the same time.
|
|
26
|
+
- Close disposable sessions before your final response once inspection is complete. Open browsers keep consuming local or hosted resources.
|
|
26
27
|
- End with diagnosis and handoff guidance, not an attempted in-browser repair.
|
|
27
28
|
|
|
28
29
|
## Commands
|
|
@@ -81,7 +82,7 @@ libretto readonly-exec "await scrollBy(0, 500)" --session failed-job-debug
|
|
|
81
82
|
|
|
82
83
|
### `close`
|
|
83
84
|
|
|
84
|
-
- Use `close` when the inspection session is no longer needed.
|
|
85
|
+
- Use `close` when the inspection session is no longer needed, unless the user explicitly asks to keep the browser open.
|
|
85
86
|
|
|
86
87
|
```bash
|
|
87
88
|
libretto close --session failed-job-debug
|
|
@@ -692,6 +692,10 @@ function toPortableRelativePath(args: {
|
|
|
692
692
|
return relPath;
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
+
function isShareableSourceRelPath(relPath: string): boolean {
|
|
696
|
+
return !relPath.split("/").includes("node_modules");
|
|
697
|
+
}
|
|
698
|
+
|
|
695
699
|
function writeShareableSourceFiles(args: {
|
|
696
700
|
absSourceDir: string;
|
|
697
701
|
absSourcePaths: readonly string[];
|
|
@@ -702,7 +706,7 @@ function writeShareableSourceFiles(args: {
|
|
|
702
706
|
absPath,
|
|
703
707
|
absSourceDir: args.absSourceDir,
|
|
704
708
|
}),
|
|
705
|
-
))].sort();
|
|
709
|
+
))].filter(isShareableSourceRelPath).sort();
|
|
706
710
|
|
|
707
711
|
for (const relPath of relPaths) {
|
|
708
712
|
const targetPath = join(args.outputDir, ".libretto-share", "source", relPath);
|
|
@@ -1209,7 +1213,8 @@ async function writeBundledDeployEntrypoint(args: {
|
|
|
1209
1213
|
relPath !== "" &&
|
|
1210
1214
|
!relPath.startsWith("../") &&
|
|
1211
1215
|
relPath !== ".." &&
|
|
1212
|
-
!isAbsolute(relPath)
|
|
1216
|
+
!isAbsolute(relPath) &&
|
|
1217
|
+
isShareableSourceRelPath(relPath.replaceAll("\\", "/"))
|
|
1213
1218
|
);
|
|
1214
1219
|
});
|
|
1215
1220
|
return { shareableSourceFiles, workflows };
|