feat: integrate cosknow — auto-install kb commands on postinstall
This commit is contained in:
parent
159c400cac
commit
997b83a313
|
|
@ -36,7 +36,8 @@
|
||||||
"dist",
|
"dist",
|
||||||
"scripts/postinstall.cjs",
|
"scripts/postinstall.cjs",
|
||||||
"scripts/run-parallel.mjs",
|
"scripts/run-parallel.mjs",
|
||||||
"scripts/setup-chrome-mcp.mjs"
|
"scripts/setup-chrome-mcp.mjs",
|
||||||
|
"scripts/install-cosknow.mjs"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "bun run build.ts",
|
"build": "bun run build.ts",
|
||||||
|
|
@ -53,7 +54,7 @@
|
||||||
"test": "bun test",
|
"test": "bun test",
|
||||||
"check:unused": "knip-bun",
|
"check:unused": "knip-bun",
|
||||||
"health": "bun run scripts/health-check.ts",
|
"health": "bun run scripts/health-check.ts",
|
||||||
"postinstall": "node scripts/run-parallel.mjs scripts/postinstall.cjs scripts/setup-chrome-mcp.mjs",
|
"postinstall": "node scripts/run-parallel.mjs scripts/postinstall.cjs scripts/setup-chrome-mcp.mjs scripts/install-cosknow.mjs",
|
||||||
"docs:dev": "npx mintlify dev",
|
"docs:dev": "npx mintlify dev",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"rcs": "bun run scripts/rcs.ts"
|
"rcs": "bun run scripts/rcs.ts"
|
||||||
|
|
@ -61,6 +62,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@agentclientprotocol/sdk": "^0.19.0",
|
"@agentclientprotocol/sdk": "^0.19.0",
|
||||||
"@claude-code-best/mcp-chrome-bridge": "^2.0.8",
|
"@claude-code-best/mcp-chrome-bridge": "^2.0.8",
|
||||||
|
"cosknow": "latest",
|
||||||
"ws": "^8.20.0"
|
"ws": "^8.20.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
|
||||||
15
scripts/install-cosknow.mjs
Normal file
15
scripts/install-cosknow.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
let install
|
||||||
|
try {
|
||||||
|
const mod = await import('cosknow')
|
||||||
|
install = mod.install
|
||||||
|
} catch {
|
||||||
|
console.warn('[cosknow] package not available, skipping command installation')
|
||||||
|
process.exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await install({ target: 'claude-commands' })
|
||||||
|
console.log('[cosknow] commands installed to ~/.claude/commands/')
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('[cosknow] install failed (non-fatal):', e.message)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user