@yanzc/claude-pro 0.9.0 → 0.9.2

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.
Files changed (57) hide show
  1. package/README.md +342 -320
  2. package/package.json +1 -2
  3. package/src/agent.js +240 -62
  4. package/src/agents.js +3 -2
  5. package/src/api.js +83 -41
  6. package/src/browser/broker.js +367 -0
  7. package/src/browser/cdp.js +114 -0
  8. package/src/browser/render.js +242 -0
  9. package/src/browser/session.js +948 -0
  10. package/src/browser/snapshot.js +212 -0
  11. package/src/cache.js +1 -1
  12. package/src/checkpoints.js +1 -0
  13. package/src/commands.js +177 -71
  14. package/src/compaction.js +75 -0
  15. package/src/config.js +153 -153
  16. package/src/context.js +45 -18
  17. package/src/filestate.js +2 -1
  18. package/src/gateway.js +208 -164
  19. package/src/hooks.js +2 -2
  20. package/src/keepalive.js +1 -1
  21. package/src/main.js +52 -40
  22. package/src/mcp.js +2 -2
  23. package/src/peers.js +1 -10
  24. package/src/print.js +9 -3
  25. package/src/prompt-profiles.js +0 -6
  26. package/src/prompts.js +6 -62
  27. package/src/ratelimit.js +3 -5
  28. package/src/remote.js +26 -10
  29. package/src/restart.js +3 -0
  30. package/src/runtime.js +33 -10
  31. package/src/selfcheck.js +3 -3
  32. package/src/session.js +93 -3
  33. package/src/supervisor.js +10 -1
  34. package/src/tools/bash.js +19 -18
  35. package/src/tools/browser.js +365 -0
  36. package/src/tools/code.js +430 -0
  37. package/src/tools/effort.js +3 -4
  38. package/src/tools/files.js +92 -19
  39. package/src/tools/index.js +6 -0
  40. package/src/tools/notebook.js +11 -4
  41. package/src/tools/processes.js +274 -0
  42. package/src/tools/search.js +104 -21
  43. package/src/tools/web.js +316 -46
  44. package/src/trace.js +0 -4
  45. package/src/ui/ansi.js +92 -13
  46. package/src/ui/dialogs.js +16 -54
  47. package/src/ui/editor.js +231 -34
  48. package/src/ui/markdown.js +1 -2
  49. package/src/ui/render.js +1 -2
  50. package/src/ui/repl.js +246 -119
  51. package/src/ui/screen.js +139 -31
  52. package/src/updater.js +135 -165
  53. package/src/utils/clipboard.js +5 -3
  54. package/src/utils/paths.js +15 -17
  55. package/src/utils/shell.js +75 -21
  56. package/.env.example +0 -29
  57. package/src/verify.js +0 -57
package/src/verify.js DELETED
@@ -1,57 +0,0 @@
1
- // Discover a conservative project verification command when the user has not configured one.
2
-
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
-
6
- function exists(cwd, name) {
7
- try { return fs.statSync(path.join(cwd, name)).isFile(); } catch { return false; }
8
- }
9
-
10
- function directoryExists(cwd, name) {
11
- try { return fs.statSync(path.join(cwd, name)).isDirectory(); } catch { return false; }
12
- }
13
-
14
- function readJson(file) {
15
- try { return JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return null; }
16
- }
17
-
18
- function packageRunner(cwd) {
19
- if (exists(cwd, 'pnpm-lock.yaml')) return 'pnpm';
20
- if (exists(cwd, 'yarn.lock')) return 'yarn';
21
- return 'npm';
22
- }
23
-
24
- function meaningfulTestScript(script) {
25
- if (typeof script !== 'string' || !script.trim()) return false;
26
- // Skip npm init's placeholder because it intentionally exits with an error.
27
- return !/(?:error:\s*)?no test specified/i.test(script);
28
- }
29
-
30
- function packageCommand(cwd) {
31
- const pkg = readJson(path.join(cwd, 'package.json'));
32
- const scripts = pkg?.scripts;
33
- if (!scripts || typeof scripts !== 'object') return null;
34
- const runner = packageRunner(cwd);
35
- if (meaningfulTestScript(scripts.test)) return runner === 'npm' ? 'npm test' : `${runner} test`;
36
- for (const name of ['check', 'verify', 'lint']) {
37
- if (typeof scripts[name] === 'string' && scripts[name].trim()) return `${runner} run ${name}`;
38
- }
39
- return null;
40
- }
41
-
42
- function makefileCommand(cwd) {
43
- if (!exists(cwd, 'Makefile')) return null;
44
- try {
45
- const text = fs.readFileSync(path.join(cwd, 'Makefile'), 'utf8');
46
- return /^(?:\.PHONY\s+)?test\s*(?::|;)/m.test(text) ? 'make test' : null;
47
- } catch { return null; }
48
- }
49
-
50
- export function discoverVerifyCommand(cwd) {
51
- const root = path.resolve(cwd || process.cwd());
52
- return packageCommand(root)
53
- || (exists(root, 'pyproject.toml') && (directoryExists(root, 'tests') || directoryExists(root, 'test')) ? 'python -m pytest -q' : null)
54
- || (exists(root, 'Cargo.toml') ? 'cargo test' : null)
55
- || (exists(root, 'go.mod') ? 'go test ./...' : null)
56
- || makefileCommand(root);
57
- }