@puku/puku-cli 1.2.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/LICENSE +29 -0
- package/README.md +29 -0
- package/bin/import-specifier.mjs +7 -0
- package/bin/openpuku +15 -0
- package/dist/cli.mjs +8826 -0
- package/dist/smart-context/configs/puku-cli/ROUTING-ONLY.md +27 -0
- package/dist/smart-context/hooks/core/formatters.mjs +1 -0
- package/dist/smart-context/hooks/core/mcp-ready.mjs +1 -0
- package/dist/smart-context/hooks/core/routing.mjs +1 -0
- package/dist/smart-context/hooks/core/stdin.mjs +1 -0
- package/dist/smart-context/hooks/core/tool-naming.mjs +1 -0
- package/dist/smart-context/hooks/ensure-deps.mjs +1 -0
- package/dist/smart-context/hooks/posttooluse.mjs +2 -0
- package/dist/smart-context/hooks/precompact.mjs +3 -0
- package/dist/smart-context/hooks/pretooluse.mjs +6 -0
- package/dist/smart-context/hooks/routing-block.mjs +85 -0
- package/dist/smart-context/hooks/session-db.bundle.mjs +57 -0
- package/dist/smart-context/hooks/session-directive.mjs +69 -0
- package/dist/smart-context/hooks/session-extract.bundle.mjs +1 -0
- package/dist/smart-context/hooks/session-helpers.mjs +1 -0
- package/dist/smart-context/hooks/session-loaders.mjs +1 -0
- package/dist/smart-context/hooks/session-snapshot.bundle.mjs +29 -0
- package/dist/smart-context/hooks/sessionstart.mjs +4 -0
- package/dist/smart-context/hooks/suppress-stderr.mjs +1 -0
- package/dist/smart-context/hooks/userpromptsubmit.mjs +2 -0
- package/dist/smart-context/server.bundle.mjs +555 -0
- package/dist/smart-context/start.mjs +7 -0
- package/package.json +148 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as $}from"node:module";var Y=$(import.meta.url);import{execSync as X}from"node:child_process";import{existsSync as K,chmodSync as C,readFileSync as D,writeFileSync as Z,readdirSync as L}from"node:fs";import{dirname as R,resolve as G}from"node:path";import{fileURLToPath as T}from"node:url";import{homedir as U}from"node:os";import"./hooks/ensure-deps.mjs";var z=R(T(import.meta.url)),V=process.cwd();process.chdir(z);if(!process.env.PUKU_PROJECT_DIR)process.env.PUKU_PROJECT_DIR=V;if(!process.env.CONTEXT_MODE_PROJECT_DIR)process.env.CONTEXT_MODE_PROJECT_DIR=process.env.PUKU_PROJECT_DIR;if(process.env.PUKU_CONFIG_DIR&&!process.env.CONTEXT_MODE_CONFIG_DIR)process.env.CONTEXT_MODE_CONFIG_DIR=process.env.PUKU_CONFIG_DIR;var W=z.match(/^(.*[\/\\]plugins[\/\\]cache[\/\\][^\/\\]+[\/\\][^\/\\]+[\/\\])([^\/\\]+)$/);if(W)try{let A=W[1],I=W[2],H=L(A).filter((B)=>/^\d+\.\d+\.\d+/.test(B));if(H.length>1){H.sort((N,O)=>{let J=N.split(".").map(Number),E=O.split(".").map(Number);for(let q=0;q<3;q++)if((J[q]??0)!==(E[q]??0))return(J[q]??0)-(E[q]??0);return 0});let B=H[H.length-1];if(B&&B!==I){let N=G(U(),".puku-cli","plugins","installed_plugins.json"),O=JSON.parse(D(N,"utf-8"));for(let[J,E]of Object.entries(O.plugins||{})){if(!J.toLowerCase().includes("context-mode"))continue;for(let q of E)q.installPath=G(A,B),q.version=B,q.lastUpdated=new Date().toISOString()}Z(N,JSON.stringify(O,null,2)+`
|
|
3
|
+
`,"utf-8")}}}catch{}for(let A of["turndown","turndown-plugin-gfm","@mixmark-io/domino"])if(!K(G(z,"node_modules",A)))try{X(`npm install ${A} --no-package-lock --no-save --silent`,{cwd:z,stdio:"pipe",timeout:120000})}catch{}if(!K(G(z,"cli.bundle.mjs"))&&K(G(z,"build","cli.js"))){let A=G(z,"cli.bundle.mjs");if(Z(A,`#!/usr/bin/env node
|
|
4
|
+
await import("./build/cli.js");
|
|
5
|
+
`),process.platform!=="win32")C(A,493)}{let A=process.stdout.write.bind(process.stdout);process.stdout.write=function(I,H,B){try{let J=(typeof I==="string"?I:I.toString("utf8")).split(`
|
|
6
|
+
`).map((E)=>{if(!E.trim())return E;try{let q=JSON.parse(E);if(q?.result?.serverInfo?.name)q.result.serverInfo.name="smart-context";if(Array.isArray(q?.result?.content)){for(let Q of q.result.content)if(typeof Q?.text==="string")Q.text=Q.text.replace(/^⚠️ context-mode v[^\n]+\n\n/,"")}return JSON.stringify(q)}catch{return E}});return A(J.join(`
|
|
7
|
+
`),H,B)}catch{return A(I,H,B)}}}if(K(G(z,"server.bundle.mjs")))await import("./server.bundle.mjs");else{if(!K(G(z,"node_modules")))try{X("npm install --silent",{cwd:z,stdio:"pipe",timeout:60000})}catch{}if(!K(G(z,"build","server.js")))try{X("npx tsc --silent",{cwd:z,stdio:"pipe",timeout:30000})}catch{}await import("./build/server.js")}
|
package/package.json
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@puku/puku-cli",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Puku CLI — AI coding assistant powered by Puku AI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"puku-cli": "bin/openpuku"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/openpuku",
|
|
11
|
+
"bin/import-specifier.mjs",
|
|
12
|
+
"dist/cli.mjs",
|
|
13
|
+
"dist/smart-context/",
|
|
14
|
+
"!dist/smart-context/node_modules/",
|
|
15
|
+
"!dist/smart-context/package.json",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "bun run scripts/build.ts && rm -rf dist/smart-context && cp -r smart-context dist/smart-context && bun run scripts/minify-smart-context.ts",
|
|
20
|
+
"dev": "bun run build && node dist/cli.mjs",
|
|
21
|
+
"dev:profile": "bun run scripts/provider-launch.ts",
|
|
22
|
+
"dev:profile:fast": "bun run scripts/provider-launch.ts auto --fast --bare",
|
|
23
|
+
"dev:codex": "bun run scripts/provider-launch.ts codex",
|
|
24
|
+
"dev:openai": "bun run scripts/provider-launch.ts openai",
|
|
25
|
+
"dev:gemini": "bun run scripts/provider-launch.ts gemini",
|
|
26
|
+
"dev:ollama": "bun run scripts/provider-launch.ts ollama",
|
|
27
|
+
"dev:ollama:fast": "bun run scripts/provider-launch.ts ollama --fast --bare",
|
|
28
|
+
"dev:atomic-chat": "bun run scripts/provider-launch.ts atomic-chat",
|
|
29
|
+
"profile:init": "bun run scripts/provider-bootstrap.ts",
|
|
30
|
+
"profile:recommend": "bun run scripts/provider-recommend.ts",
|
|
31
|
+
"profile:auto": "bun run scripts/provider-recommend.ts --apply",
|
|
32
|
+
"profile:codex": "bun run profile:init -- --provider codex --model codexplan",
|
|
33
|
+
"profile:fast": "bun run profile:init -- --provider ollama --model llama3.2:3b",
|
|
34
|
+
"profile:code": "bun run profile:init -- --provider ollama --model qwen2.5-coder:7b",
|
|
35
|
+
"dev:fast": "bun run profile:fast && bun run dev:ollama:fast",
|
|
36
|
+
"dev:code": "bun run profile:code && bun run dev:profile",
|
|
37
|
+
"start": "node dist/cli.mjs",
|
|
38
|
+
"test:provider-recommendation": "bun test src/utils/providerRecommendation.test.ts src/utils/providerProfile.test.ts",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"smoke": "bun run build && node dist/cli.mjs --version",
|
|
41
|
+
"verify:privacy": "bun run scripts/verify-no-phone-home.ts",
|
|
42
|
+
"build:verified": "bun run build && bun run verify:privacy",
|
|
43
|
+
"test:provider": "bun test src/services/api/*.test.ts src/utils/context.test.ts",
|
|
44
|
+
"doctor:runtime": "bun run scripts/system-check.ts",
|
|
45
|
+
"doctor:runtime:json": "bun run scripts/system-check.ts --json",
|
|
46
|
+
"doctor:report": "bun run scripts/system-check.ts --out reports/doctor-runtime.json",
|
|
47
|
+
"hardening:check": "bun run smoke && bun run doctor:runtime",
|
|
48
|
+
"hardening:strict": "bun run typecheck && bun run hardening:check",
|
|
49
|
+
"prepack": "npm run build"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@alcalzone/ansi-tokenize": "0.3.0",
|
|
53
|
+
"@anthropic-ai/bedrock-sdk": "0.26.4",
|
|
54
|
+
"@anthropic-ai/foundry-sdk": "0.2.3",
|
|
55
|
+
"@anthropic-ai/sandbox-runtime": "0.0.46",
|
|
56
|
+
"@anthropic-ai/sdk": "0.81.0",
|
|
57
|
+
"@anthropic-ai/vertex-sdk": "0.14.4",
|
|
58
|
+
"@commander-js/extra-typings": "12.1.0",
|
|
59
|
+
"@growthbook/growthbook": "1.6.5",
|
|
60
|
+
"@mendable/firecrawl-js": "4.18.1",
|
|
61
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
62
|
+
"@opentelemetry/api": "1.9.1",
|
|
63
|
+
"@opentelemetry/api-logs": "0.214.0",
|
|
64
|
+
"@opentelemetry/core": "2.6.1",
|
|
65
|
+
"@opentelemetry/exporter-logs-otlp-http": "0.214.0",
|
|
66
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "0.57.2",
|
|
67
|
+
"@opentelemetry/resources": "2.6.1",
|
|
68
|
+
"@opentelemetry/sdk-logs": "0.214.0",
|
|
69
|
+
"@opentelemetry/sdk-metrics": "2.6.1",
|
|
70
|
+
"@opentelemetry/sdk-trace-base": "2.6.1",
|
|
71
|
+
"@opentelemetry/sdk-trace-node": "2.6.1",
|
|
72
|
+
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
73
|
+
"ajv": "8.18.0",
|
|
74
|
+
"auto-bind": "5.0.1",
|
|
75
|
+
"axios": "1.14.0",
|
|
76
|
+
"better-sqlite3": "12.9.0",
|
|
77
|
+
"bidi-js": "1.0.3",
|
|
78
|
+
"chalk": "5.6.2",
|
|
79
|
+
"chokidar": "4.0.3",
|
|
80
|
+
"cli-boxes": "3.0.0",
|
|
81
|
+
"cli-highlight": "2.1.11",
|
|
82
|
+
"code-excerpt": "4.0.0",
|
|
83
|
+
"commander": "12.1.0",
|
|
84
|
+
"diff": "8.0.3",
|
|
85
|
+
"duck-duck-scrape": "^2.2.7",
|
|
86
|
+
"emoji-regex": "10.6.0",
|
|
87
|
+
"env-paths": "3.0.0",
|
|
88
|
+
"execa": "9.6.1",
|
|
89
|
+
"fflate": "0.8.2",
|
|
90
|
+
"figures": "6.1.0",
|
|
91
|
+
"fuse.js": "7.1.0",
|
|
92
|
+
"get-east-asian-width": "1.5.0",
|
|
93
|
+
"google-auth-library": "9.15.1",
|
|
94
|
+
"https-proxy-agent": "7.0.6",
|
|
95
|
+
"ignore": "7.0.5",
|
|
96
|
+
"indent-string": "5.0.0",
|
|
97
|
+
"jsonc-parser": "3.3.1",
|
|
98
|
+
"lodash-es": "4.18.0",
|
|
99
|
+
"lru-cache": "11.2.7",
|
|
100
|
+
"marked": "15.0.12",
|
|
101
|
+
"p-map": "7.0.4",
|
|
102
|
+
"picomatch": "4.0.4",
|
|
103
|
+
"proper-lockfile": "4.1.2",
|
|
104
|
+
"qrcode": "1.5.4",
|
|
105
|
+
"react": "19.2.4",
|
|
106
|
+
"react-compiler-runtime": "1.0.0",
|
|
107
|
+
"react-reconciler": "0.33.0",
|
|
108
|
+
"semver": "7.7.4",
|
|
109
|
+
"sharp": "^0.34.5",
|
|
110
|
+
"shell-quote": "1.8.3",
|
|
111
|
+
"signal-exit": "4.1.0",
|
|
112
|
+
"stack-utils": "2.0.6",
|
|
113
|
+
"strip-ansi": "7.2.0",
|
|
114
|
+
"supports-hyperlinks": "3.2.0",
|
|
115
|
+
"tree-kill": "1.2.2",
|
|
116
|
+
"turndown": "7.2.2",
|
|
117
|
+
"type-fest": "4.41.0",
|
|
118
|
+
"undici": "7.24.6",
|
|
119
|
+
"usehooks-ts": "3.1.1",
|
|
120
|
+
"vscode-languageserver-protocol": "3.17.5",
|
|
121
|
+
"wrap-ansi": "9.0.2",
|
|
122
|
+
"ws": "8.20.0",
|
|
123
|
+
"xss": "1.0.15",
|
|
124
|
+
"yaml": "2.8.3",
|
|
125
|
+
"zod": "3.25.76"
|
|
126
|
+
},
|
|
127
|
+
"devDependencies": {
|
|
128
|
+
"@types/bun": "1.3.11",
|
|
129
|
+
"@types/node": "25.5.0",
|
|
130
|
+
"@types/react": "19.2.14",
|
|
131
|
+
"typescript": "5.9.3"
|
|
132
|
+
},
|
|
133
|
+
"engines": {
|
|
134
|
+
"node": ">=20.0.0"
|
|
135
|
+
},
|
|
136
|
+
"keywords": [
|
|
137
|
+
"puku",
|
|
138
|
+
"puku-ai",
|
|
139
|
+
"ai",
|
|
140
|
+
"cli",
|
|
141
|
+
"agent",
|
|
142
|
+
"coding-assistant"
|
|
143
|
+
],
|
|
144
|
+
"license": "SEE LICENSE FILE",
|
|
145
|
+
"publishConfig": {
|
|
146
|
+
"access": "public"
|
|
147
|
+
}
|
|
148
|
+
}
|