@panda-agent/panda-cli 0.1.12

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/package.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "name": "@panda-agent/panda-cli",
3
+ "version": "0.1.12",
4
+ "private": false,
5
+ "description": "Panda CLI (Ink). pandacli;cwd 为工作区默认。发版前 npm run release:pack(含 panda-ink + bundle;rg 由 optional @panda-agent/ripgrep-* 或 PATH)。",
6
+ "type": "module",
7
+ "bin": {
8
+ "panda": "bin/pandacli.mjs",
9
+ "pandacli": "bin/pandacli.mjs"
10
+ },
11
+ "files": [
12
+ "bin/pandacli.mjs",
13
+ "dist/panda-cli-ink.bundle.mjs",
14
+ "scripts/dedupe-react-for-cli.mjs",
15
+ "vendor/panda-ink/package.json",
16
+ "vendor/panda-ink/dist/index.js",
17
+ "vendor/panda-ink/dist/devtools-*.js"
18
+ ],
19
+ "engines": {
20
+ "node": ">=20"
21
+ },
22
+ "scripts": {
23
+ "sync:version": "node ./scripts/sync-version-from-product.mjs",
24
+ "vendor:panda-ink": "node ./scripts/vendor-panda-ink.mjs",
25
+ "vendor:rg": "node ./scripts/vendor-rg.mjs",
26
+ "rg:platform:build": "node ./scripts/build-rg-platform-packages.mjs",
27
+ "rg:platform:build:clean": "node ./scripts/build-rg-platform-packages.mjs --clean",
28
+ "rg:platform:publish:dry-run": "node ./scripts/publish-rg-platform-packages.mjs --dry-run",
29
+ "rg:platform:publish": "node ./scripts/publish-rg-platform-packages.mjs",
30
+ "verify:pack-contents": "node ./scripts/verify-pack-contents.mjs",
31
+ "release:pack": "npm run sync:version && npm run vendor:panda-ink && npm run build && npm run verify:pack-contents && npm pack",
32
+ "pack": "bash ./scripts/pack-release.sh",
33
+ "pack:fat": "bash ./scripts/pack-fat-release.sh",
34
+ "pack:install": "bash ./scripts/pack-install-global.sh",
35
+ "verify:global-install": "bash ./scripts/verify-global-install.sh",
36
+ "prepublishOnly": "npm run sync:version && npm run vendor:panda-ink && npm run build && npm run verify:pack-contents",
37
+ "build": "node ./scripts/dedupe-react-for-cli.mjs && node ./scripts/build-cli-bundle.mjs",
38
+ "predev": "node ./scripts/ensure-vendored-panda-ink.mjs && npm run build",
39
+ "dev": "npm run predev && npm run start",
40
+ "start": "node ./scripts/dedupe-react-for-cli.mjs && node --max-old-space-size=16384 ./dist/panda-cli-ink.bundle.mjs",
41
+ "build:cli-bundle": "npm run build",
42
+ "prestart:cli-ink": "npm run predev",
43
+ "start:cli-ink": "npm run start"
44
+ },
45
+ "dependencies": {
46
+ "@alcalzone/ansi-tokenize": "^0.3.0",
47
+ "@anthropic-ai/sdk": "^0.71.2",
48
+ "@modelcontextprotocol/sdk": "^1.29.0",
49
+ "@napi-rs/keyring": "^1.2.0",
50
+ "auto-bind": "^5.0.1",
51
+ "better-sqlite3": "^12.9.0",
52
+ "bidi-js": "^1.0.3",
53
+ "chalk": "^5.4.1",
54
+ "cli-boxes": "^3.0.0",
55
+ "code-excerpt": "^4.0.0",
56
+ "diff": "^8.0.3",
57
+ "emoji-regex": "^10.4.0",
58
+ "execa": "^9.5.2",
59
+ "figures": "^6.1.0",
60
+ "fuse.js": "^7.3.0",
61
+ "get-east-asian-width": "^1.5.0",
62
+ "highlight.js": "^11.11.1",
63
+ "ignore": "^7.0.5",
64
+ "indent-string": "^5.0.0",
65
+ "lodash-es": "^4.17.21",
66
+ "lru-cache": "^11.3.3",
67
+ "ollama": "^0.5.18",
68
+ "openai": "^6.16.0",
69
+ "panda-ink": "file:./vendor/panda-ink",
70
+ "playwright-core": "^1.59.1",
71
+ "react": "^19.2.0",
72
+ "react-dom": "^19.2.0",
73
+ "react-reconciler": "^0.33.0",
74
+ "semver": "^7.7.1",
75
+ "shell-quote": "^1.8.3",
76
+ "signal-exit": "^4.1.0",
77
+ "stack-utils": "^2.0.6",
78
+ "string-width": "^7.2.0",
79
+ "strip-ansi": "^7.1.0",
80
+ "supports-hyperlinks": "^3.1.0",
81
+ "turndown": "^7.2.0",
82
+ "type-fest": "^4.37.0",
83
+ "undici": "^7.9.0",
84
+ "usehooks-ts": "^3.1.1",
85
+ "widest-line": "^5.0.0",
86
+ "wrap-ansi": "^9.0.0",
87
+ "zod": "^4.3.6",
88
+ "zustand": "^5.0.12"
89
+ },
90
+ "devDependencies": {
91
+ "esbuild": "^0.27.2"
92
+ },
93
+ "optionalDependencies": {
94
+ "@napi-rs/keyring-darwin-arm64": "1.2.0",
95
+ "@napi-rs/keyring-darwin-x64": "1.2.0",
96
+ "@napi-rs/keyring-freebsd-x64": "1.2.0",
97
+ "@napi-rs/keyring-linux-arm-gnueabihf": "1.2.0",
98
+ "@napi-rs/keyring-linux-arm64-gnu": "1.2.0",
99
+ "@napi-rs/keyring-linux-arm64-musl": "1.2.0",
100
+ "@napi-rs/keyring-linux-riscv64-gnu": "1.2.0",
101
+ "@napi-rs/keyring-linux-x64-gnu": "1.2.0",
102
+ "@napi-rs/keyring-linux-x64-musl": "1.2.0",
103
+ "@napi-rs/keyring-win32-arm64-msvc": "1.2.0",
104
+ "@napi-rs/keyring-win32-ia32-msvc": "1.2.0",
105
+ "@napi-rs/keyring-win32-x64-msvc": "1.2.0",
106
+ "@panda-agent/ripgrep-darwin-arm64": "15.0.1",
107
+ "@panda-agent/ripgrep-darwin-x64": "15.0.1",
108
+ "@panda-agent/ripgrep-linux-arm64": "15.0.1",
109
+ "@panda-agent/ripgrep-linux-x64": "15.0.1",
110
+ "@panda-agent/ripgrep-win32-arm64": "15.0.1",
111
+ "@panda-agent/ripgrep-win32-x64": "15.0.1"
112
+ }
113
+ }
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * 删除嵌套的 react、react-dom,避免与「唯一一份」React 并存导致 Ink hooks 失效。
4
+ * - 在 vscode 仓库内开发(../src/vs/panda 存在):可删本包内 react,解析到 vscode 根 node_modules。
5
+ * - npm 全局安装后:不能删本包 node_modules/react,否则 bundle 的 external import 无法解析。
6
+ * vendor/panda-ink 下的嵌套副本始终可删(若有),统一到上层 node_modules。
7
+ */
8
+ import { existsSync, rmSync } from 'node:fs';
9
+ import { dirname, join } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+
12
+ const cli = dirname(dirname(fileURLToPath(import.meta.url)));
13
+ const vendoredInk = join(cli, 'vendor', 'panda-ink');
14
+ const parentOfCli = join(cli, '..');
15
+ const isVscodeMonorepoLayout =
16
+ existsSync(join(parentOfCli, 'src', 'vs', 'panda')) &&
17
+ existsSync(join(parentOfCli, 'package.json'));
18
+
19
+ const bases = [vendoredInk];
20
+ if (isVscodeMonorepoLayout) {
21
+ bases.unshift(cli);
22
+ }
23
+
24
+ for (const rel of ['node_modules/react', 'node_modules/react-dom']) {
25
+ for (const base of bases) {
26
+ const p = join(base, rel);
27
+ if (existsSync(p)) rmSync(p, { recursive: true, force: true });
28
+ }
29
+ }
@@ -0,0 +1,9 @@
1
+ function e() {
2
+ }
3
+ function n(o) {
4
+ console.debug("[DevTools]", o);
5
+ }
6
+ export {
7
+ e as initDevTools,
8
+ n as logDevTools
9
+ };