libretto 0.3.0 → 0.3.1
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/README.md +41 -125
- package/dist/cli/cli.js +298 -0
- package/dist/cli/commands/ai.js +21 -0
- package/dist/cli/commands/browser.js +82 -0
- package/dist/cli/commands/execution.js +490 -0
- package/dist/cli/commands/init.js +166 -0
- package/dist/cli/commands/logs.js +93 -0
- package/dist/cli/commands/snapshot.js +106 -0
- package/dist/cli/core/ai-config.js +149 -0
- package/dist/cli/core/browser.js +652 -0
- package/dist/cli/core/context.js +117 -0
- package/dist/cli/core/pause-signals.js +29 -0
- package/dist/cli/core/session-telemetry.js +491 -0
- package/dist/cli/core/session.js +183 -0
- package/dist/cli/core/snapshot-analyzer.js +492 -0
- package/dist/cli/core/telemetry.js +362 -0
- package/dist/cli/index.js +13 -0
- package/dist/cli/workers/run-integration-runtime.js +234 -0
- package/dist/cli/workers/run-integration-worker-protocol.js +12 -0
- package/dist/cli/workers/run-integration-worker.js +67 -0
- package/dist/index.cjs +144 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +114 -0
- package/dist/runtime/download/download.cjs +70 -0
- package/dist/runtime/download/download.d.cts +35 -0
- package/dist/runtime/download/download.d.ts +35 -0
- package/dist/runtime/download/download.js +45 -0
- package/dist/runtime/download/index.cjs +30 -0
- package/dist/runtime/download/index.d.cts +3 -0
- package/dist/runtime/download/index.d.ts +3 -0
- package/dist/runtime/download/index.js +8 -0
- package/dist/runtime/extract/extract.cjs +88 -0
- package/dist/runtime/extract/extract.d.cts +23 -0
- package/dist/runtime/extract/extract.d.ts +23 -0
- package/dist/runtime/extract/extract.js +64 -0
- package/dist/runtime/extract/index.cjs +28 -0
- package/dist/runtime/extract/index.d.cts +5 -0
- package/dist/runtime/extract/index.d.ts +5 -0
- package/dist/runtime/extract/index.js +4 -0
- package/dist/runtime/network/index.cjs +28 -0
- package/dist/runtime/network/index.d.cts +4 -0
- package/dist/runtime/network/index.d.ts +4 -0
- package/dist/runtime/network/index.js +6 -0
- package/dist/runtime/network/network.cjs +91 -0
- package/dist/runtime/network/network.d.cts +28 -0
- package/dist/runtime/network/network.d.ts +28 -0
- package/dist/runtime/network/network.js +67 -0
- package/dist/runtime/recovery/agent.cjs +223 -0
- package/dist/runtime/recovery/agent.d.cts +13 -0
- package/dist/runtime/recovery/agent.d.ts +13 -0
- package/dist/runtime/recovery/agent.js +199 -0
- package/dist/runtime/recovery/errors.cjs +124 -0
- package/dist/runtime/recovery/errors.d.cts +31 -0
- package/dist/runtime/recovery/errors.d.ts +31 -0
- package/dist/runtime/recovery/errors.js +100 -0
- package/dist/runtime/recovery/index.cjs +34 -0
- package/dist/runtime/recovery/index.d.cts +7 -0
- package/dist/runtime/recovery/index.d.ts +7 -0
- package/dist/runtime/recovery/index.js +10 -0
- package/dist/runtime/recovery/recovery.cjs +55 -0
- package/dist/runtime/recovery/recovery.d.cts +12 -0
- package/dist/runtime/recovery/recovery.d.ts +12 -0
- package/dist/runtime/recovery/recovery.js +31 -0
- package/dist/shared/config/config.cjs +44 -0
- package/dist/shared/config/config.d.cts +10 -0
- package/dist/shared/config/config.d.ts +10 -0
- package/dist/shared/config/config.js +18 -0
- package/dist/shared/config/index.cjs +32 -0
- package/dist/shared/config/index.d.cts +1 -0
- package/dist/shared/config/index.d.ts +1 -0
- package/dist/shared/config/index.js +10 -0
- package/dist/shared/debug/index.cjs +30 -0
- package/dist/shared/debug/index.d.cts +1 -0
- package/dist/shared/debug/index.d.ts +1 -0
- package/dist/shared/debug/index.js +5 -0
- package/dist/shared/debug/pause.cjs +90 -0
- package/dist/shared/debug/pause.d.cts +16 -0
- package/dist/shared/debug/pause.d.ts +16 -0
- package/dist/shared/debug/pause.js +55 -0
- package/dist/shared/instrumentation/errors.cjs +81 -0
- package/dist/shared/instrumentation/errors.d.cts +12 -0
- package/dist/shared/instrumentation/errors.d.ts +12 -0
- package/dist/shared/instrumentation/errors.js +57 -0
- package/dist/shared/instrumentation/index.cjs +35 -0
- package/dist/shared/instrumentation/index.d.cts +6 -0
- package/dist/shared/instrumentation/index.d.ts +6 -0
- package/dist/shared/instrumentation/index.js +12 -0
- package/dist/shared/instrumentation/instrument.cjs +206 -0
- package/dist/shared/instrumentation/instrument.d.cts +32 -0
- package/dist/shared/instrumentation/instrument.d.ts +32 -0
- package/dist/shared/instrumentation/instrument.js +190 -0
- package/dist/shared/llm/ai-sdk-adapter.cjs +67 -0
- package/dist/shared/llm/ai-sdk-adapter.d.cts +22 -0
- package/dist/shared/llm/ai-sdk-adapter.d.ts +22 -0
- package/dist/shared/llm/ai-sdk-adapter.js +43 -0
- package/dist/shared/llm/client.cjs +139 -0
- package/dist/shared/llm/client.d.cts +6 -0
- package/dist/shared/llm/client.d.ts +6 -0
- package/dist/shared/llm/client.js +115 -0
- package/dist/shared/llm/index.cjs +31 -0
- package/dist/shared/llm/index.d.cts +5 -0
- package/dist/shared/llm/index.d.ts +5 -0
- package/dist/shared/llm/index.js +6 -0
- package/dist/shared/llm/types.cjs +16 -0
- package/dist/shared/llm/types.d.cts +66 -0
- package/dist/shared/llm/types.d.ts +66 -0
- package/dist/shared/llm/types.js +0 -0
- package/dist/shared/logger/index.cjs +37 -0
- package/dist/shared/logger/index.d.cts +2 -0
- package/dist/shared/logger/index.d.ts +2 -0
- package/dist/shared/logger/index.js +13 -0
- package/dist/shared/logger/logger.cjs +232 -0
- package/dist/shared/logger/logger.d.cts +86 -0
- package/dist/shared/logger/logger.d.ts +86 -0
- package/dist/shared/logger/logger.js +207 -0
- package/dist/shared/logger/sinks.cjs +160 -0
- package/dist/shared/logger/sinks.d.cts +9 -0
- package/dist/shared/logger/sinks.d.ts +9 -0
- package/dist/shared/logger/sinks.js +124 -0
- package/dist/shared/paths/paths.cjs +104 -0
- package/dist/shared/paths/paths.d.cts +10 -0
- package/dist/shared/paths/paths.d.ts +10 -0
- package/dist/shared/paths/paths.js +73 -0
- package/dist/shared/run/api.cjs +28 -0
- package/dist/shared/run/api.d.cts +2 -0
- package/dist/shared/run/api.d.ts +2 -0
- package/dist/shared/run/api.js +4 -0
- package/dist/shared/run/browser.cjs +98 -0
- package/dist/shared/run/browser.d.cts +22 -0
- package/dist/shared/run/browser.d.ts +22 -0
- package/dist/shared/run/browser.js +74 -0
- package/dist/shared/state/index.cjs +38 -0
- package/dist/shared/state/index.d.cts +2 -0
- package/dist/shared/state/index.d.ts +2 -0
- package/dist/shared/state/index.js +16 -0
- package/dist/shared/state/session-state.cjs +85 -0
- package/dist/shared/state/session-state.d.cts +34 -0
- package/dist/shared/state/session-state.d.ts +34 -0
- package/dist/shared/state/session-state.js +56 -0
- package/dist/shared/visualization/ghost-cursor.cjs +174 -0
- package/dist/shared/visualization/ghost-cursor.d.cts +37 -0
- package/dist/shared/visualization/ghost-cursor.d.ts +37 -0
- package/dist/shared/visualization/ghost-cursor.js +145 -0
- package/dist/shared/visualization/highlight.cjs +134 -0
- package/dist/shared/visualization/highlight.d.cts +22 -0
- package/dist/shared/visualization/highlight.d.ts +22 -0
- package/dist/shared/visualization/highlight.js +108 -0
- package/dist/shared/visualization/index.cjs +45 -0
- package/dist/shared/visualization/index.d.cts +3 -0
- package/dist/shared/visualization/index.d.ts +3 -0
- package/dist/shared/visualization/index.js +24 -0
- package/dist/shared/workflow/workflow.cjs +47 -0
- package/dist/shared/workflow/workflow.d.cts +21 -0
- package/dist/shared/workflow/workflow.d.ts +21 -0
- package/dist/shared/workflow/workflow.js +21 -0
- package/package.json +11 -70
- package/bin/libretto.mjs +0 -18
- package/scripts/postinstall.mjs +0 -48
- /package/{skill → .agents/skills/libretto}/SKILL.md +0 -0
- /package/{skill → .agents/skills/libretto}/code-generation-rules.md +0 -0
- /package/{skill → .agents/skills/libretto}/integration-approach-selection.md +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libretto",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "AI-powered browser automation library and CLI built on Playwright",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,79 +13,17 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|
|
16
|
-
"
|
|
17
|
-
"scripts",
|
|
18
|
-
"skill"
|
|
16
|
+
".agents/skills/libretto"
|
|
19
17
|
],
|
|
20
18
|
"bin": {
|
|
21
|
-
"libretto": "./
|
|
22
|
-
"libretto-cli": "./
|
|
19
|
+
"libretto": "./dist/cli/index.js",
|
|
20
|
+
"libretto-cli": "./dist/cli/index.js"
|
|
23
21
|
},
|
|
24
22
|
"exports": {
|
|
25
23
|
".": {
|
|
26
24
|
"types": "./dist/index.d.ts",
|
|
27
25
|
"import": "./dist/index.js",
|
|
28
26
|
"require": "./dist/index.cjs"
|
|
29
|
-
},
|
|
30
|
-
"./logger": {
|
|
31
|
-
"types": "./dist/shared/logger/index.d.ts",
|
|
32
|
-
"import": "./dist/shared/logger/index.js",
|
|
33
|
-
"require": "./dist/shared/logger/index.cjs"
|
|
34
|
-
},
|
|
35
|
-
"./recovery": {
|
|
36
|
-
"types": "./dist/runtime/recovery/index.d.ts",
|
|
37
|
-
"import": "./dist/runtime/recovery/index.js",
|
|
38
|
-
"require": "./dist/runtime/recovery/index.cjs"
|
|
39
|
-
},
|
|
40
|
-
"./extract": {
|
|
41
|
-
"types": "./dist/runtime/extract/index.d.ts",
|
|
42
|
-
"import": "./dist/runtime/extract/index.js",
|
|
43
|
-
"require": "./dist/runtime/extract/index.cjs"
|
|
44
|
-
},
|
|
45
|
-
"./network": {
|
|
46
|
-
"types": "./dist/runtime/network/index.d.ts",
|
|
47
|
-
"import": "./dist/runtime/network/index.js",
|
|
48
|
-
"require": "./dist/runtime/network/index.cjs"
|
|
49
|
-
},
|
|
50
|
-
"./download": {
|
|
51
|
-
"types": "./dist/runtime/download/index.d.ts",
|
|
52
|
-
"import": "./dist/runtime/download/index.js",
|
|
53
|
-
"require": "./dist/runtime/download/index.cjs"
|
|
54
|
-
},
|
|
55
|
-
"./debug": {
|
|
56
|
-
"types": "./dist/shared/debug/index.d.ts",
|
|
57
|
-
"import": "./dist/shared/debug/index.js",
|
|
58
|
-
"require": "./dist/shared/debug/index.cjs"
|
|
59
|
-
},
|
|
60
|
-
"./config": {
|
|
61
|
-
"types": "./dist/shared/config/index.d.ts",
|
|
62
|
-
"import": "./dist/shared/config/index.js",
|
|
63
|
-
"require": "./dist/shared/config/index.cjs"
|
|
64
|
-
},
|
|
65
|
-
"./instrumentation": {
|
|
66
|
-
"types": "./dist/shared/instrumentation/index.d.ts",
|
|
67
|
-
"import": "./dist/shared/instrumentation/index.js",
|
|
68
|
-
"require": "./dist/shared/instrumentation/index.cjs"
|
|
69
|
-
},
|
|
70
|
-
"./visualization": {
|
|
71
|
-
"types": "./dist/shared/visualization/index.d.ts",
|
|
72
|
-
"import": "./dist/shared/visualization/index.js",
|
|
73
|
-
"require": "./dist/shared/visualization/index.cjs"
|
|
74
|
-
},
|
|
75
|
-
"./llm": {
|
|
76
|
-
"types": "./dist/shared/llm/index.d.ts",
|
|
77
|
-
"import": "./dist/shared/llm/index.js",
|
|
78
|
-
"require": "./dist/shared/llm/index.cjs"
|
|
79
|
-
},
|
|
80
|
-
"./state": {
|
|
81
|
-
"types": "./dist/shared/state/index.d.ts",
|
|
82
|
-
"import": "./dist/shared/state/index.js",
|
|
83
|
-
"require": "./dist/shared/state/index.cjs"
|
|
84
|
-
},
|
|
85
|
-
"./run": {
|
|
86
|
-
"types": "./dist/shared/run/api.d.ts",
|
|
87
|
-
"import": "./dist/shared/run/api.js",
|
|
88
|
-
"require": "./dist/shared/run/api.cjs"
|
|
89
27
|
}
|
|
90
28
|
},
|
|
91
29
|
"peerDependencies": {
|
|
@@ -106,6 +44,7 @@
|
|
|
106
44
|
}
|
|
107
45
|
},
|
|
108
46
|
"devDependencies": {
|
|
47
|
+
"@anthropic-ai/claude-agent-sdk": "^0.2.73",
|
|
109
48
|
"@ai-sdk/anthropic": "^3.0.53",
|
|
110
49
|
"@ai-sdk/google-vertex": "^4.0.72",
|
|
111
50
|
"@ai-sdk/openai": "^3.0.39",
|
|
@@ -113,7 +52,6 @@
|
|
|
113
52
|
"@types/yargs": "^17.0.33",
|
|
114
53
|
"openai": "^6.27.0",
|
|
115
54
|
"tsup": "^8.0.0",
|
|
116
|
-
"tsx": "^4.19.2",
|
|
117
55
|
"typescript": "^5.7.0",
|
|
118
56
|
"vitest": "^4.0.18",
|
|
119
57
|
"zod": "^3.25.0"
|
|
@@ -121,16 +59,19 @@
|
|
|
121
59
|
"dependencies": {
|
|
122
60
|
"ai": "^6.0.110",
|
|
123
61
|
"playwright": "^1.52.0",
|
|
62
|
+
"tsx": "^4.19.2",
|
|
124
63
|
"yargs": "^17.7.2"
|
|
125
64
|
},
|
|
126
65
|
"scripts": {
|
|
127
|
-
"postinstall": "
|
|
66
|
+
"postinstall": "npx playwright install chromium",
|
|
128
67
|
"build": "pnpm run build:runtime && pnpm run build:cli",
|
|
129
68
|
"build:runtime": "tsup --config tsup.config.ts",
|
|
130
69
|
"build:cli": "tsup --config tsup.cli.config.ts",
|
|
131
70
|
"type-check": "tsc --noEmit",
|
|
132
|
-
"dev": "tsx src/cli/index.ts",
|
|
133
71
|
"test": "pnpm run build && vitest run",
|
|
134
|
-
"
|
|
72
|
+
"eval": "pnpm run build && vitest run --config vitest.evals.config.ts",
|
|
73
|
+
"benchmark": "pnpm run build && tsx benchmarks/run.ts",
|
|
74
|
+
"test:watch": "vitest",
|
|
75
|
+
"cli": "node dist/index.js"
|
|
135
76
|
}
|
|
136
77
|
}
|
package/bin/libretto.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { execSync } from "node:child_process";
|
|
6
|
-
|
|
7
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
const cliRoot = join(__dirname, "..");
|
|
9
|
-
const distEntry = join(cliRoot, "dist", "cli", "index.js");
|
|
10
|
-
|
|
11
|
-
if (!existsSync(distEntry)) {
|
|
12
|
-
// Build from the libretto monorepo root (builds core then CLI in order)
|
|
13
|
-
const monorepoRoot = join(cliRoot, "..", "..");
|
|
14
|
-
console.error("[libretto] dist not found, building...");
|
|
15
|
-
execSync("pnpm build", { cwd: monorepoRoot, stdio: "inherit" });
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
await import(distEntry);
|
package/scripts/postinstall.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { cpSync, existsSync, lstatSync, mkdirSync } from "node:fs";
|
|
2
|
-
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
function isDirectory(path) {
|
|
6
|
-
if (!existsSync(path)) return false;
|
|
7
|
-
return lstatSync(path).isDirectory();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function log(message) {
|
|
11
|
-
console.log(`[libretto postinstall] ${message}`);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function main() {
|
|
15
|
-
const packageDir = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
16
|
-
const initCwd = process.env.INIT_CWD ? resolve(process.env.INIT_CWD) : null;
|
|
17
|
-
const installRoot = initCwd ?? process.cwd();
|
|
18
|
-
|
|
19
|
-
const sourceSkillDir = join(packageDir, "skill");
|
|
20
|
-
if (!isDirectory(sourceSkillDir)) {
|
|
21
|
-
log(`Skipped: source skill directory not found at "${sourceSkillDir}".`);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const targets = [
|
|
26
|
-
join(installRoot, ".agents", "skills"),
|
|
27
|
-
join(installRoot, ".claude", "skills"),
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
for (const skillsRoot of targets) {
|
|
31
|
-
if (!isDirectory(skillsRoot)) {
|
|
32
|
-
log(`Skipped: "${skillsRoot}" does not exist.`);
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const destinationSkillDir = join(skillsRoot, "libretto");
|
|
37
|
-
mkdirSync(destinationSkillDir, { recursive: true });
|
|
38
|
-
cpSync(sourceSkillDir, destinationSkillDir, { recursive: true, force: true });
|
|
39
|
-
log(`Synced skill "libretto" to "${skillsRoot}/libretto".`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
main();
|
|
45
|
-
} catch (error) {
|
|
46
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
47
|
-
console.warn(`[libretto postinstall] Warning: ${message}`);
|
|
48
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|