jevway 0.1.2 → 0.3.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/README.md +227 -149
- package/SETUP.md +212 -0
- package/dist/browser/downloads.js +103 -0
- package/dist/browser/frames.js +21 -1
- package/dist/browser/snapshot.js +53 -0
- package/dist/browser/tab.js +59 -10
- package/dist/cli/daemon-call.js +78 -0
- package/dist/cli/dispatch.js +76 -0
- package/dist/cli/flags.js +152 -0
- package/dist/cli/help.js +46 -0
- package/dist/cli/inbox-command.js +199 -0
- package/dist/cli/journey-command.js +162 -0
- package/dist/cli/look-command.js +54 -0
- package/dist/cli/main.js +64 -0
- package/dist/cli/output.js +27 -0
- package/dist/cli/run-command.js +221 -0
- package/dist/cli/session-commands.js +132 -0
- package/dist/daemon/client.js +175 -0
- package/dist/daemon/paths.js +35 -0
- package/dist/daemon/protocol.js +28 -0
- package/dist/daemon/server.js +339 -0
- package/dist/inbox/inbox-file.js +43 -0
- package/dist/inbox/inbox-registry.js +33 -0
- package/dist/inbox/inbox.js +127 -0
- package/dist/inbox/mail-api.js +52 -0
- package/dist/inbox/message.js +34 -0
- package/dist/jev/replay.js +7 -3
- package/dist/jev/retry.js +29 -0
- package/dist/jev/secrets.js +4 -3
- package/dist/journeys/journey-doc.js +2 -1
- package/dist/journeys/journey-session.js +14 -3
- package/dist/journeys/render-viewer.js +163 -150
- package/dist/mcp/inbox-tools.js +82 -0
- package/dist/mcp/instructions.js +27 -0
- package/dist/mcp/journey-tools.js +117 -0
- package/dist/mcp/results.js +53 -0
- package/dist/mcp/server.js +57 -0
- package/dist/mcp/task-tools.js +213 -0
- package/dist/mcp.js +10 -337
- package/dist/notify/desktop.js +40 -0
- package/dist/notify/person-messages.js +50 -0
- package/dist/output/layout.js +86 -0
- package/dist/output/manifest.js +86 -0
- package/dist/output/run-folder.js +80 -0
- package/dist/recording/describe-step.js +69 -0
- package/dist/{task → recording}/recording-page.js +164 -18
- package/dist/{task → recording}/recording.js +33 -91
- package/dist/recording/run-page.js +155 -0
- package/dist/session/session-service.js +213 -0
- package/dist/setup/atomic-write.js +13 -0
- package/dist/setup/clients.js +180 -0
- package/dist/setup/command-output.js +15 -0
- package/dist/setup/doctor-command.js +16 -7
- package/dist/setup/doctor.js +17 -2
- package/dist/setup/env-file.js +22 -0
- package/dist/setup/setup-command.js +104 -0
- package/dist/setup/setup-wizard.js +216 -0
- package/dist/setup/skill-command.js +124 -0
- package/dist/setup/terminal-prompter.js +51 -0
- package/dist/setup/unified-diff.js +69 -0
- package/dist/task/ask-user.js +182 -0
- package/dist/task/downloads.js +63 -0
- package/dist/task/person-wait.js +104 -0
- package/dist/task/present.js +111 -0
- package/dist/task/run-task.js +332 -32
- package/dist/task/start-task.js +70 -11
- package/dist/task/totp.js +124 -0
- package/dist/task/upload-files.js +237 -5
- package/package.json +10 -8
- package/skill/jevway/SKILL.md +54 -15
- package/skill/jevway-inbox/SKILL.md +61 -0
- package/skill/jevway-inbox/scripts/inbox.mjs +209 -0
- package/INSTALL-FOR-AGENTS.md +0 -138
- package/dist/cli.js +0 -112
package/dist/cli.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { parseArgs } from 'node:util';
|
|
3
|
-
import { runDoctor } from './setup/doctor-command.js';
|
|
4
|
-
import { loadEnvFile } from './setup/env-file.js';
|
|
5
|
-
import { CHECKS } from './task/checks.js';
|
|
6
|
-
import { createRunner } from './task/start-task.js';
|
|
7
|
-
const USAGE = `jevway --goal "<outcome>" (--url <url> | --tab <url part>) [options]
|
|
8
|
-
jevway doctor [--plan] [--live] check the setup (key, browser, Node, ffmpeg); --help for more
|
|
9
|
-
|
|
10
|
-
--values '{"city":"Lisbon"}' text values Jev may type
|
|
11
|
-
--secret-keys token,otp keys of --values that are secrets: Jev sees the key only, output shows [secret:<key>]
|
|
12
|
-
--files '{"avatar":"/abs/me.png"}' files Jev may upload (absolute paths; Jev sees names, never paths)
|
|
13
|
-
--done-when "<evidence>" visible evidence of success
|
|
14
|
-
--checks '[{"type":"url_contains","text":"/issues/"}]' facts checked by code on the final page
|
|
15
|
-
--browser auto|launch|launch-headless|http://127.0.0.1:9222 (default: auto, or $JEVWAY_BROWSER)
|
|
16
|
-
--model jev|pplx-decider|clef-omni|clef|clef-flash|gpt-6-luna decision model (default: jev, or $JEVWAY_MODEL)
|
|
17
|
-
--screenshots off|fallback|always marked screenshots, vision models only (default: per model, or $JEVWAY_SCREENSHOTS)
|
|
18
|
-
--max-steps 40
|
|
19
|
-
--allowed-hosts a.com,*.b.com hosts the run may be on (narrows $JEVWAY_ALLOWED_HOSTS); leaving them ends it blocked
|
|
20
|
-
--blocked-hosts ads.com hosts it must never be on (adds to $JEVWAY_BLOCKED_HOSTS)
|
|
21
|
-
--max-seconds 300 time budget; past it the run ends step_budget (Ctrl-C ends it blocked)
|
|
22
|
-
--keep-open leave the tabs open (auto/remote browsers), including any the run's clicks opened
|
|
23
|
-
--allow-coordinate-clicks click a boxed control the DOM never reported (canvas, iframe); Jev 1.14 direct only
|
|
24
|
-
--record <dir> sharp screenshot before every action + final page, summary.json, index.html
|
|
25
|
-
|
|
26
|
-
Prints one JSON summary. Exit code 0 only when status is "done".
|
|
27
|
-
Needs TYPESAFE_API_KEY (Jev only) or OPENROUTER_API_KEY (every model), from the environment or ~/.config/jevway/env.`;
|
|
28
|
-
// Keys and JEVWAY_* settings the environment lacks come from ~/.config/jevway/env.
|
|
29
|
-
const fromEnvFile = loadEnvFile();
|
|
30
|
-
if (process.argv[2] === 'doctor')
|
|
31
|
-
process.exit(await runDoctor(process.argv.slice(3), fromEnvFile));
|
|
32
|
-
const { values: args } = parseArgs({
|
|
33
|
-
options: {
|
|
34
|
-
goal: { type: 'string' },
|
|
35
|
-
url: { type: 'string' },
|
|
36
|
-
tab: { type: 'string' },
|
|
37
|
-
values: { type: 'string' },
|
|
38
|
-
'secret-keys': { type: 'string' },
|
|
39
|
-
files: { type: 'string' },
|
|
40
|
-
'done-when': { type: 'string' },
|
|
41
|
-
checks: { type: 'string' },
|
|
42
|
-
browser: { type: 'string' },
|
|
43
|
-
model: { type: 'string' },
|
|
44
|
-
screenshots: { type: 'string' },
|
|
45
|
-
'max-steps': { type: 'string' },
|
|
46
|
-
'max-seconds': { type: 'string' },
|
|
47
|
-
'allowed-hosts': { type: 'string' },
|
|
48
|
-
'blocked-hosts': { type: 'string' },
|
|
49
|
-
'keep-open': { type: 'boolean' },
|
|
50
|
-
'allow-coordinate-clicks': { type: 'boolean' },
|
|
51
|
-
record: { type: 'string' },
|
|
52
|
-
help: { type: 'boolean', short: 'h' },
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
if (args.help || !args.goal || !(args.url || args.tab)) {
|
|
56
|
-
console.error(USAGE);
|
|
57
|
-
process.exit(args.help ? 0 : 2);
|
|
58
|
-
}
|
|
59
|
-
// Malformed checks, like model or key problems, are usage errors: report them before any browser starts.
|
|
60
|
-
let checks;
|
|
61
|
-
try {
|
|
62
|
-
checks = args.checks ? CHECKS.parse(JSON.parse(args.checks)) : undefined;
|
|
63
|
-
}
|
|
64
|
-
catch (error) {
|
|
65
|
-
console.error(`jevway: --checks: ${error.message}`);
|
|
66
|
-
process.exit(2);
|
|
67
|
-
}
|
|
68
|
-
let runner;
|
|
69
|
-
try {
|
|
70
|
-
runner = createRunner(args.browser ?? process.env.JEVWAY_BROWSER ?? 'auto', {
|
|
71
|
-
model: args.model,
|
|
72
|
-
screenshots: args.screenshots,
|
|
73
|
-
});
|
|
74
|
-
runner.requireKey();
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
console.error(`jevway: ${error.message}`);
|
|
78
|
-
process.exit(2);
|
|
79
|
-
}
|
|
80
|
-
try {
|
|
81
|
-
const task = await runner.start({
|
|
82
|
-
goal: args.goal,
|
|
83
|
-
url: args.url,
|
|
84
|
-
tab: args.tab,
|
|
85
|
-
values: args.values ? JSON.parse(args.values) : undefined,
|
|
86
|
-
secretKeys: args['secret-keys']?.split(',').map((key) => key.trim()).filter(Boolean),
|
|
87
|
-
files: args.files ? JSON.parse(args.files) : undefined,
|
|
88
|
-
doneWhen: args['done-when'],
|
|
89
|
-
checks,
|
|
90
|
-
maxSteps: args['max-steps'] ? Number(args['max-steps']) : undefined,
|
|
91
|
-
maxSeconds: args['max-seconds'] ? Number(args['max-seconds']) : undefined,
|
|
92
|
-
allowedHosts: args['allowed-hosts']?.split(','),
|
|
93
|
-
blockedHosts: args['blocked-hosts']?.split(','),
|
|
94
|
-
allowCoordinateClicks: args['allow-coordinate-clicks'],
|
|
95
|
-
recordDir: args.record,
|
|
96
|
-
});
|
|
97
|
-
// Ctrl-C stops the run at its next check (an action under way finishes), so the summary still prints and the tab closes.
|
|
98
|
-
const cancel = new AbortController();
|
|
99
|
-
process.once('SIGINT', () => cancel.abort());
|
|
100
|
-
const summary = await task.run({ signal: cancel.signal });
|
|
101
|
-
if (!args['keep-open'])
|
|
102
|
-
await task.closeTabs({ keepFirst: !args.url });
|
|
103
|
-
console.log(JSON.stringify(summary, null, 2));
|
|
104
|
-
process.exitCode = summary.status === 'done' ? 0 : 1;
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
console.error(`jevway: ${error.message}`);
|
|
108
|
-
process.exitCode = 1;
|
|
109
|
-
}
|
|
110
|
-
finally {
|
|
111
|
-
await runner.close();
|
|
112
|
-
}
|