pikakit 3.0.4 → 3.7.1
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 +1 -1
- package/bin/lib/commands/install.js +97 -242
- package/package.json +2 -3
- package/lib/agent-cli/bin/agent.js +0 -187
- package/lib/agent-cli/dashboard/dashboard_server.js +0 -312
- package/lib/agent-cli/lib/audit.js +0 -154
- package/lib/agent-cli/lib/audit.test.js +0 -100
- package/lib/agent-cli/lib/auto-learn.js +0 -319
- package/lib/agent-cli/lib/backup.js +0 -138
- package/lib/agent-cli/lib/backup.test.js +0 -78
- package/lib/agent-cli/lib/cognitive-lesson.js +0 -476
- package/lib/agent-cli/lib/completion.js +0 -149
- package/lib/agent-cli/lib/config.js +0 -35
- package/lib/agent-cli/lib/eslint-fix.js +0 -238
- package/lib/agent-cli/lib/evolution-signal.js +0 -215
- package/lib/agent-cli/lib/export.js +0 -86
- package/lib/agent-cli/lib/export.test.js +0 -65
- package/lib/agent-cli/lib/fix.js +0 -337
- package/lib/agent-cli/lib/fix.test.js +0 -80
- package/lib/agent-cli/lib/gemini-export.js +0 -83
- package/lib/agent-cli/lib/generate-registry.js +0 -42
- package/lib/agent-cli/lib/hooks/install-hooks.js +0 -152
- package/lib/agent-cli/lib/hooks/lint-learn.js +0 -172
- package/lib/agent-cli/lib/icons.js +0 -93
- package/lib/agent-cli/lib/ignore.js +0 -116
- package/lib/agent-cli/lib/ignore.test.js +0 -58
- package/lib/agent-cli/lib/init.js +0 -124
- package/lib/agent-cli/lib/knowledge-index.js +0 -326
- package/lib/agent-cli/lib/knowledge-metrics.js +0 -335
- package/lib/agent-cli/lib/knowledge-retention.js +0 -398
- package/lib/agent-cli/lib/knowledge-validator.js +0 -312
- package/lib/agent-cli/lib/learn.js +0 -255
- package/lib/agent-cli/lib/learn.test.js +0 -70
- package/lib/agent-cli/lib/proposals.js +0 -199
- package/lib/agent-cli/lib/proposals.test.js +0 -56
- package/lib/agent-cli/lib/recall.js +0 -835
- package/lib/agent-cli/lib/recall.test.js +0 -107
- package/lib/agent-cli/lib/selfevolution-bridge.js +0 -167
- package/lib/agent-cli/lib/settings.js +0 -203
- package/lib/agent-cli/lib/skill-learn.js +0 -296
- package/lib/agent-cli/lib/stats.js +0 -132
- package/lib/agent-cli/lib/stats.test.js +0 -94
- package/lib/agent-cli/lib/types.js +0 -33
- package/lib/agent-cli/lib/ui/audit-ui.js +0 -146
- package/lib/agent-cli/lib/ui/backup-ui.js +0 -107
- package/lib/agent-cli/lib/ui/clack-helpers.js +0 -317
- package/lib/agent-cli/lib/ui/common.js +0 -83
- package/lib/agent-cli/lib/ui/completion-ui.js +0 -126
- package/lib/agent-cli/lib/ui/custom-select.js +0 -69
- package/lib/agent-cli/lib/ui/dashboard-ui.js +0 -222
- package/lib/agent-cli/lib/ui/evolution-signals-ui.js +0 -107
- package/lib/agent-cli/lib/ui/export-ui.js +0 -94
- package/lib/agent-cli/lib/ui/fix-all-ui.js +0 -191
- package/lib/agent-cli/lib/ui/help-ui.js +0 -49
- package/lib/agent-cli/lib/ui/index.js +0 -199
- package/lib/agent-cli/lib/ui/init-ui.js +0 -56
- package/lib/agent-cli/lib/ui/knowledge-ui.js +0 -55
- package/lib/agent-cli/lib/ui/learn-ui.js +0 -706
- package/lib/agent-cli/lib/ui/lessons-ui.js +0 -148
- package/lib/agent-cli/lib/ui/pretty.js +0 -145
- package/lib/agent-cli/lib/ui/proposals-ui.js +0 -99
- package/lib/agent-cli/lib/ui/recall-ui.js +0 -342
- package/lib/agent-cli/lib/ui/routing-demo.js +0 -79
- package/lib/agent-cli/lib/ui/routing-ui.js +0 -325
- package/lib/agent-cli/lib/ui/settings-ui.js +0 -381
- package/lib/agent-cli/lib/ui/stats-ui.js +0 -123
- package/lib/agent-cli/lib/ui/watch-ui.js +0 -236
- package/lib/agent-cli/lib/watcher.js +0 -181
- package/lib/agent-cli/lib/watcher.test.js +0 -85
- package/lib/agent-cli/src/MIGRATION.md +0 -418
- package/lib/agent-cli/src/README.md +0 -367
- package/lib/agent-cli/src/core/evolution/evolution-signal.js +0 -42
- package/lib/agent-cli/src/core/evolution/index.js +0 -17
- package/lib/agent-cli/src/core/evolution/review-gate.js +0 -40
- package/lib/agent-cli/src/core/evolution/signal-detector.js +0 -137
- package/lib/agent-cli/src/core/evolution/signal-queue.js +0 -79
- package/lib/agent-cli/src/core/evolution/threshold-checker.js +0 -79
- package/lib/agent-cli/src/core/index.js +0 -15
- package/lib/agent-cli/src/core/learning/cognitive-enhancer.js +0 -282
- package/lib/agent-cli/src/core/learning/index.js +0 -12
- package/lib/agent-cli/src/core/learning/lesson-synthesizer.js +0 -83
- package/lib/agent-cli/src/core/scanning/index.js +0 -14
- package/lib/agent-cli/src/data/index.js +0 -13
- package/lib/agent-cli/src/data/repositories/index.js +0 -8
- package/lib/agent-cli/src/data/repositories/lesson-repository.js +0 -130
- package/lib/agent-cli/src/data/repositories/signal-repository.js +0 -119
- package/lib/agent-cli/src/data/storage/index.js +0 -8
- package/lib/agent-cli/src/data/storage/json-storage.js +0 -64
- package/lib/agent-cli/src/data/storage/yaml-storage.js +0 -66
- package/lib/agent-cli/src/infrastructure/index.js +0 -13
- package/lib/agent-cli/src/presentation/formatters/skill-formatter.js +0 -232
- package/lib/agent-cli/src/services/export-service.js +0 -162
- package/lib/agent-cli/src/services/index.js +0 -13
- package/lib/agent-cli/src/services/learning-service.js +0 -99
package/README.md
CHANGED
|
@@ -159,7 +159,7 @@ npx pikakit add pikakit-agent-skills --force
|
|
|
159
159
|
├── WORKFLOW_CHAINS.md # Workflow Patterns
|
|
160
160
|
│
|
|
161
161
|
├── skills/ # 50 Skills
|
|
162
|
-
│ ├──
|
|
162
|
+
│ ├── skill-generator/
|
|
163
163
|
│ ├── react-architect/
|
|
164
164
|
│ ├── typescript-expert/
|
|
165
165
|
│ ├── debug-pro/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* @fileoverview Install command - Interactive skill installation
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ import boxen from "boxen";
|
|
|
12
12
|
import { parseSkillSpec, merkleHash } from "../helpers.js";
|
|
13
13
|
import { parseSkillMdFrontmatter } from "../skills.js";
|
|
14
14
|
import { step, activeStep, stepLine, S, c, fatal, spinner, multiselect, select, confirm, isCancel, cancel } from "../ui.js";
|
|
15
|
-
import { WORKSPACE, GLOBAL_DIR, OFFLINE, GLOBAL
|
|
15
|
+
import { WORKSPACE, GLOBAL_DIR, OFFLINE, GLOBAL } from "../config.js";
|
|
16
16
|
import { installSkill } from "../installer.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -47,90 +47,31 @@ export async function run(spec) {
|
|
|
47
47
|
step("Source: " + c.cyan(url));
|
|
48
48
|
|
|
49
49
|
const s = spinner();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
// --- Repository Caching Logic ---
|
|
53
|
-
const cacheDir = path.join(REPO_CACHE_DIR, org, repo);
|
|
54
|
-
const cacheMetaFile = path.join(cacheDir, ".cache-meta.json");
|
|
55
|
-
let useCache = false;
|
|
56
|
-
let cacheHit = false;
|
|
57
|
-
|
|
58
|
-
// Check if cache exists and is valid
|
|
59
|
-
if (!FORCE_REFRESH && fs.existsSync(cacheDir) && fs.existsSync(cacheMetaFile)) {
|
|
60
|
-
try {
|
|
61
|
-
const meta = JSON.parse(fs.readFileSync(cacheMetaFile, "utf-8"));
|
|
62
|
-
const cacheAge = Date.now() - new Date(meta.timestamp).getTime();
|
|
50
|
+
s.start("Cloning repository");
|
|
63
51
|
|
|
64
|
-
|
|
65
|
-
useCache = true;
|
|
66
|
-
cacheHit = true;
|
|
67
|
-
s.start("Deploying next-generation skills...");
|
|
68
|
-
}
|
|
69
|
-
} catch {
|
|
70
|
-
// Invalid cache, will refresh
|
|
71
|
-
}
|
|
72
|
-
}
|
|
52
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "add-skill-"));
|
|
73
53
|
|
|
74
|
-
|
|
54
|
+
// Retry logic with exponential backoff
|
|
75
55
|
const MAX_RETRIES = 3;
|
|
56
|
+
let lastError = null;
|
|
76
57
|
|
|
77
|
-
|
|
78
|
-
// Fast path: Update cache with git fetch (much faster than clone)
|
|
58
|
+
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
79
59
|
try {
|
|
80
|
-
await execAsync(`git
|
|
81
|
-
await execAsync(`git -C "${
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
await fs.promises.cp(cacheDir, tmp, { recursive: true });
|
|
85
|
-
|
|
86
|
-
// Update cache metadata
|
|
87
|
-
fs.writeFileSync(cacheMetaFile, JSON.stringify({
|
|
88
|
-
timestamp: new Date().toISOString(),
|
|
89
|
-
org, repo, ref: ref || "HEAD"
|
|
90
|
-
}));
|
|
91
|
-
|
|
92
|
-
s.stop("Skills deployed successfully");
|
|
60
|
+
await execAsync(`git clone --depth=1 ${url} "${tmp}"`, { timeout: 60000 });
|
|
61
|
+
if (ref) await execAsync(`git -C "${tmp}" checkout ${ref}`, { timeout: 30000 });
|
|
62
|
+
lastError = null;
|
|
63
|
+
break;
|
|
93
64
|
} catch (err) {
|
|
94
|
-
|
|
95
|
-
useCache = false;
|
|
96
|
-
cacheHit = false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (!useCache) {
|
|
101
|
-
// Fresh clone with retry logic
|
|
102
|
-
s.start(FORCE_REFRESH ? "Force refreshing repository..." : "Deploying next-generation skills...");
|
|
65
|
+
lastError = err;
|
|
103
66
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
lastError = null;
|
|
67
|
+
if (attempt < MAX_RETRIES) {
|
|
68
|
+
const delay = Math.pow(2, attempt) * 1000; // 2s, 4s
|
|
69
|
+
s.message(`Retry ${attempt}/${MAX_RETRIES} in ${delay / 1000}s...`);
|
|
70
|
+
await new Promise(r => setTimeout(r, delay));
|
|
109
71
|
|
|
110
|
-
//
|
|
111
|
-
try {
|
|
112
|
-
|
|
113
|
-
if (fs.existsSync(cacheDir)) fs.rmSync(cacheDir, { recursive: true, force: true });
|
|
114
|
-
await fs.promises.cp(tmp, cacheDir, { recursive: true });
|
|
115
|
-
fs.writeFileSync(path.join(cacheDir, ".cache-meta.json"), JSON.stringify({
|
|
116
|
-
timestamp: new Date().toISOString(),
|
|
117
|
-
org, repo, ref: ref || "HEAD"
|
|
118
|
-
}));
|
|
119
|
-
} catch { /* Cache write failed, non-fatal */ }
|
|
120
|
-
|
|
121
|
-
break;
|
|
122
|
-
} catch (err) {
|
|
123
|
-
lastError = err;
|
|
124
|
-
|
|
125
|
-
if (attempt < MAX_RETRIES) {
|
|
126
|
-
const delay = Math.pow(2, attempt) * 1000; // 2s, 4s
|
|
127
|
-
s.message(`Retry ${attempt}/${MAX_RETRIES} in ${delay / 1000}s...`);
|
|
128
|
-
await new Promise(r => setTimeout(r, delay));
|
|
129
|
-
|
|
130
|
-
// Clean up failed attempt
|
|
131
|
-
try { fs.rmSync(tmp, { recursive: true, force: true }); } catch { }
|
|
132
|
-
fs.mkdirSync(tmp, { recursive: true });
|
|
133
|
-
}
|
|
72
|
+
// Clean up failed attempt
|
|
73
|
+
try { fs.rmSync(tmp, { recursive: true, force: true }); } catch { }
|
|
74
|
+
fs.mkdirSync(tmp, { recursive: true });
|
|
134
75
|
}
|
|
135
76
|
}
|
|
136
77
|
}
|
|
@@ -158,9 +99,7 @@ export async function run(spec) {
|
|
|
158
99
|
return;
|
|
159
100
|
}
|
|
160
101
|
|
|
161
|
-
|
|
162
|
-
s.stop("Skills deployed successfully");
|
|
163
|
-
}
|
|
102
|
+
s.stop("Repository cloned");
|
|
164
103
|
|
|
165
104
|
// Find skills in repo - check multiple possible locations
|
|
166
105
|
const skillsInRepo = [];
|
|
@@ -282,11 +221,11 @@ export async function run(spec) {
|
|
|
282
221
|
return category;
|
|
283
222
|
}
|
|
284
223
|
}
|
|
285
|
-
return "⚙️
|
|
224
|
+
return "⚙️ Backend & Core"; // Default fallback (no "Other" category)
|
|
286
225
|
}
|
|
287
226
|
|
|
288
227
|
// REQUIRED SKILLS - Always installed, not shown in selection
|
|
289
|
-
const REQUIRED_SKILLS = ["
|
|
228
|
+
const REQUIRED_SKILLS = ["skill-generator"];
|
|
290
229
|
|
|
291
230
|
// Filter out required skills from selection list
|
|
292
231
|
const selectableSkills = skillsInRepo.filter(s => !REQUIRED_SKILLS.includes(s.value));
|
|
@@ -337,7 +276,7 @@ export async function run(spec) {
|
|
|
337
276
|
}
|
|
338
277
|
|
|
339
278
|
// Check for required skills and show info
|
|
340
|
-
const CORE_REQUIRED = ["
|
|
279
|
+
const CORE_REQUIRED = ["skill-generator"];
|
|
341
280
|
const installedRequired = selectedSkills.filter(s => CORE_REQUIRED.includes(s));
|
|
342
281
|
|
|
343
282
|
stepLine();
|
|
@@ -566,39 +505,22 @@ export async function run(spec) {
|
|
|
566
505
|
archInstalled = true;
|
|
567
506
|
}
|
|
568
507
|
|
|
569
|
-
// Install knowledge
|
|
508
|
+
// Install knowledge if it exists (required for Agent CLI)
|
|
570
509
|
const knowledgeDir = path.join(baseAgentDir, "knowledge");
|
|
571
|
-
const targetKnowledgeDir = path.join(WORKSPACE, "..", "knowledge");
|
|
510
|
+
const targetKnowledgeDir = path.join(WORKSPACE, "..", "knowledge");
|
|
572
511
|
let knowledgeInstalled = false;
|
|
573
512
|
|
|
574
|
-
console.log(`[Install] === KNOWLEDGE DEBUG ===`);
|
|
575
|
-
console.log(`[Install] baseAgentDir: ${baseAgentDir}`);
|
|
576
|
-
console.log(`[Install] baseAgentDir exists: ${fs.existsSync(baseAgentDir)}`);
|
|
577
|
-
if (fs.existsSync(baseAgentDir)) {
|
|
578
|
-
console.log(`[Install] baseAgentDir contents: ${fs.readdirSync(baseAgentDir).join(', ')}`);
|
|
579
|
-
}
|
|
580
|
-
console.log(`[Install] knowledgeDir: ${knowledgeDir}`);
|
|
581
|
-
console.log(`[Install] knowledgeDir exists: ${fs.existsSync(knowledgeDir)}`);
|
|
582
|
-
console.log(`[Install] targetKnowledgeDir: ${targetKnowledgeDir}`);
|
|
583
|
-
|
|
584
513
|
if (fs.existsSync(knowledgeDir) && !fs.existsSync(targetKnowledgeDir)) {
|
|
585
|
-
// Copy entire knowledge folder recursively (like config/)
|
|
586
514
|
fs.cpSync(knowledgeDir, targetKnowledgeDir, { recursive: true });
|
|
587
|
-
step("Installed knowledge/
|
|
515
|
+
step("Installed knowledge/");
|
|
588
516
|
knowledgeInstalled = true;
|
|
589
517
|
} else if (!fs.existsSync(targetKnowledgeDir)) {
|
|
590
|
-
// Create
|
|
518
|
+
// Create empty knowledge folder for Agent CLI
|
|
591
519
|
fs.mkdirSync(targetKnowledgeDir, { recursive: true });
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
updatedAt: "${new Date().toISOString()}"
|
|
595
|
-
lessons: []
|
|
596
|
-
`;
|
|
597
|
-
fs.writeFileSync(path.join(targetKnowledgeDir, "knowledge.yaml"), defaultKnowledge);
|
|
520
|
+
// Create minimal structure for Agent CLI
|
|
521
|
+
fs.writeFileSync(path.join(targetKnowledgeDir, "lessons-learned.yaml"), "# Lessons learned by AI Agent\nlessons: []\n");
|
|
598
522
|
step("Created knowledge/ (Agent CLI ready)");
|
|
599
523
|
knowledgeInstalled = true;
|
|
600
|
-
} else {
|
|
601
|
-
console.log(`[Install] knowledge/ already exists, skipping`);
|
|
602
524
|
}
|
|
603
525
|
|
|
604
526
|
// Install config/ if it exists (required for skill configuration)
|
|
@@ -693,6 +615,58 @@ lessons: []
|
|
|
693
615
|
ss.stop("Installed .shared/ (ui-ux-pro-max data)");
|
|
694
616
|
}
|
|
695
617
|
|
|
618
|
+
// Install VS Code Extension (PikaKit Skill Generator) if available
|
|
619
|
+
const vsixDir = path.join(tmp, "packages", "pikakit-vscode");
|
|
620
|
+
let extensionInstalled = false;
|
|
621
|
+
|
|
622
|
+
if (fs.existsSync(vsixDir)) {
|
|
623
|
+
stepLine();
|
|
624
|
+
const es = spinner();
|
|
625
|
+
es.start("Installing VS Code Extension");
|
|
626
|
+
|
|
627
|
+
try {
|
|
628
|
+
// Check if VSIX already built
|
|
629
|
+
let vsixPath = null;
|
|
630
|
+
const files = fs.readdirSync(vsixDir);
|
|
631
|
+
const vsixFile = files.find(f => f.endsWith(".vsix"));
|
|
632
|
+
|
|
633
|
+
if (vsixFile) {
|
|
634
|
+
vsixPath = path.join(vsixDir, vsixFile);
|
|
635
|
+
} else {
|
|
636
|
+
// Build VSIX if needed
|
|
637
|
+
es.message("Building extension...");
|
|
638
|
+
await execAsync("npm install", { cwd: vsixDir, timeout: 60000 });
|
|
639
|
+
await execAsync("npm run compile", { cwd: vsixDir, timeout: 30000 });
|
|
640
|
+
await execAsync("npx vsce package --allow-missing-repository -o pikakit.vsix", { cwd: vsixDir, timeout: 30000 });
|
|
641
|
+
vsixPath = path.join(vsixDir, "pikakit.vsix");
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
if (vsixPath && fs.existsSync(vsixPath)) {
|
|
645
|
+
// Try installing to VS Code
|
|
646
|
+
try {
|
|
647
|
+
await execAsync(`code --install-extension "${vsixPath}"`, { timeout: 30000 });
|
|
648
|
+
extensionInstalled = true;
|
|
649
|
+
es.stop("Installed PikaKit VS Code Extension");
|
|
650
|
+
} catch {
|
|
651
|
+
// Try Antigravity extensions folder
|
|
652
|
+
const antigravityExt = path.join(os.homedir(), ".antigravity", "extensions");
|
|
653
|
+
if (fs.existsSync(antigravityExt)) {
|
|
654
|
+
const extDest = path.join(antigravityExt, "pikakit.pikakit-skill-generator-1.0.0");
|
|
655
|
+
fs.mkdirSync(extDest, { recursive: true });
|
|
656
|
+
fs.cpSync(vsixDir, extDest, { recursive: true });
|
|
657
|
+
extensionInstalled = true;
|
|
658
|
+
es.stop("Installed PikaKit Extension to Antigravity");
|
|
659
|
+
} else {
|
|
660
|
+
es.stop(c.yellow("VS Code extension not installed (no IDE detected)"));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
} catch (err) {
|
|
665
|
+
es.stop(c.yellow("VS Code extension skipped"));
|
|
666
|
+
step(c.dim("Install manually: code --install-extension pikakit.vsix"));
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
696
670
|
// Installation complete step
|
|
697
671
|
stepLine();
|
|
698
672
|
step("Installation complete");
|
|
@@ -744,6 +718,11 @@ lessons: []
|
|
|
744
718
|
successContent += `${c.cyan("✓")} ${c.dim(".agent/.shared/ (ui-ux-pro-max data)")}\n`;
|
|
745
719
|
}
|
|
746
720
|
|
|
721
|
+
// VS Code Extension summary
|
|
722
|
+
if (extensionInstalled) {
|
|
723
|
+
successContent += `${c.cyan("✓")} ${c.dim("PikaKit VS Code Extension")}\n`;
|
|
724
|
+
}
|
|
725
|
+
|
|
747
726
|
// Build title
|
|
748
727
|
const parts = [`${selectedSkills.length} skills`];
|
|
749
728
|
if (workflowsInstalled > 0) parts.push(`${workflowsInstalled} workflows`);
|
|
@@ -758,62 +737,25 @@ lessons: []
|
|
|
758
737
|
titleAlignment: "left"
|
|
759
738
|
}).split("\n").map(l => `${c.gray(S.branch)} ${l}`).join("\n"));
|
|
760
739
|
|
|
761
|
-
// === SINGLE-SOURCE ARCHITECTURE ===
|
|
762
|
-
// Copy lib/agent-cli from cloned repo BEFORE deleting tmp
|
|
763
|
-
// This ensures AutoLearn CLI comes from agent-skill-kit repo, not npm
|
|
764
|
-
const agentCliSrc = path.join(tmp, "lib", "agent-cli");
|
|
765
|
-
const agentCliLocalCache = path.join(os.tmpdir(), "pikakit-agent-cli-cache");
|
|
766
|
-
let agentCliAvailable = false;
|
|
767
|
-
|
|
768
|
-
if (fs.existsSync(agentCliSrc)) {
|
|
769
|
-
// Cache lib/agent-cli to temp location before tmp is deleted
|
|
770
|
-
if (fs.existsSync(agentCliLocalCache)) {
|
|
771
|
-
fs.rmSync(agentCliLocalCache, { recursive: true, force: true });
|
|
772
|
-
}
|
|
773
|
-
fs.cpSync(agentCliSrc, agentCliLocalCache, { recursive: true });
|
|
774
|
-
agentCliAvailable = true;
|
|
775
|
-
console.log(`[Install] Cached lib/agent-cli from repo (${fs.readdirSync(agentCliSrc).length} items)`);
|
|
776
|
-
}
|
|
777
|
-
|
|
778
740
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
779
741
|
|
|
780
|
-
// Ask user about AutoLearn installation
|
|
781
|
-
stepLine();
|
|
782
|
-
const installAutoLearn = await confirm({
|
|
783
|
-
message: "Install AutoLearn (enables 'agent' command for learning & self-improvement)?",
|
|
784
|
-
initialValue: true
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
if (isCancel(installAutoLearn)) {
|
|
788
|
-
cancel("Installation cancelled");
|
|
789
|
-
process.exit(0);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
742
|
// Install CLI package
|
|
793
743
|
stepLine();
|
|
794
744
|
const cliSpinner = spinner();
|
|
795
|
-
const cliPackage = "
|
|
745
|
+
const cliPackage = "add-skill-kit";
|
|
796
746
|
|
|
797
747
|
if (isGlobal) {
|
|
798
|
-
|
|
799
|
-
cliSpinner.start(`Installing CLI globally (${cliPackage})`);
|
|
800
|
-
} else {
|
|
801
|
-
cliSpinner.start(`Installing kit CLI globally (${cliPackage})`);
|
|
802
|
-
}
|
|
748
|
+
cliSpinner.start(`Installing kit CLI globally (${cliPackage})`);
|
|
803
749
|
try {
|
|
804
750
|
await execAsync(`npm install -g ${cliPackage}`, { timeout: 120000 });
|
|
805
751
|
cliSpinner.stop("CLI installed globally");
|
|
806
|
-
|
|
807
|
-
step(c.dim("Commands: agent, kit"));
|
|
808
|
-
} else {
|
|
809
|
-
step(c.dim("Command: kit"));
|
|
810
|
-
}
|
|
752
|
+
step(c.dim("Command: kit"));
|
|
811
753
|
} catch (e) {
|
|
812
754
|
cliSpinner.stop(c.yellow("Global CLI installation failed"));
|
|
813
755
|
step(c.dim(`Try running manually: npm i -g ${cliPackage}`));
|
|
814
756
|
}
|
|
815
757
|
} else {
|
|
816
|
-
cliSpinner.start(`Installing
|
|
758
|
+
cliSpinner.start(`Installing kit CLI locally (${cliPackage})`);
|
|
817
759
|
try {
|
|
818
760
|
await execAsync(`npm install -D ${cliPackage}`, { timeout: 120000 });
|
|
819
761
|
cliSpinner.stop("CLI installed locally");
|
|
@@ -825,67 +767,29 @@ lessons: []
|
|
|
825
767
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
826
768
|
pkg.scripts = pkg.scripts || {};
|
|
827
769
|
|
|
828
|
-
// Always add kit script
|
|
829
770
|
if (!pkg.scripts.kit) {
|
|
830
771
|
pkg.scripts.kit = "kit";
|
|
831
772
|
}
|
|
832
773
|
|
|
833
|
-
// Add agent script only if AutoLearn enabled
|
|
834
|
-
if (installAutoLearn && !pkg.scripts.agent) {
|
|
835
|
-
pkg.scripts.agent = "agent";
|
|
836
|
-
}
|
|
837
|
-
|
|
838
774
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
839
|
-
|
|
840
|
-
step(c.green("✓ Added npm scripts: 'agent', 'kit'"));
|
|
841
|
-
} else {
|
|
842
|
-
step(c.green("✓ Added npm script: 'kit'"));
|
|
843
|
-
}
|
|
775
|
+
step(c.green("✓ Added npm script: 'kit'"));
|
|
844
776
|
}
|
|
845
777
|
} catch (scriptErr) {
|
|
846
|
-
step(c.yellow("
|
|
778
|
+
step(c.yellow("⚠ Could not add npm scripts automatically"));
|
|
847
779
|
}
|
|
848
780
|
|
|
849
781
|
// Create wrapper scripts for direct command access (Windows + Unix)
|
|
850
782
|
try {
|
|
851
783
|
const projectRoot = process.cwd();
|
|
852
|
-
const binDir = path.join(projectRoot, "node_modules", ".bin");
|
|
853
784
|
|
|
854
|
-
// Always create kit wrappers
|
|
855
|
-
const kitCmd = `@echo off\nnode "%~dp0node_modules\\
|
|
856
|
-
const kitSh = `#!/bin/sh\nnode "$(dirname "$0")/node_modules/
|
|
785
|
+
// Always create kit wrappers
|
|
786
|
+
const kitCmd = `@echo off\nnode "%~dp0node_modules\\add-skill-kit\\bin\\kit.js" %*`;
|
|
787
|
+
const kitSh = `#!/bin/sh\nnode "$(dirname "$0")/node_modules/add-skill-kit/bin/kit.js" "$@"`;
|
|
857
788
|
fs.writeFileSync(path.join(projectRoot, "kit.cmd"), kitCmd);
|
|
858
789
|
fs.writeFileSync(path.join(projectRoot, "kit"), kitSh, { mode: 0o755 });
|
|
859
790
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
const kitBinCmd = `@echo off\nnode "%~dp0..\\pikakit\\bin\\kit.js" %*`;
|
|
863
|
-
const kitBinSh = `#!/bin/sh\nnode "$(dirname "$0")/../pikakit/bin/kit.js" "$@"`;
|
|
864
|
-
fs.writeFileSync(path.join(binDir, "kit.cmd"), kitBinCmd);
|
|
865
|
-
fs.writeFileSync(path.join(binDir, "kit"), kitBinSh, { mode: 0o755 });
|
|
866
|
-
}
|
|
867
|
-
|
|
868
|
-
if (installAutoLearn) {
|
|
869
|
-
// Create agent wrappers only if AutoLearn enabled
|
|
870
|
-
const agentCmd = `@echo off\nnode "%~dp0node_modules\\pikakit\\lib\\agent-cli\\bin\\agent.js" %*`;
|
|
871
|
-
const agentSh = `#!/bin/sh\nnode "$(dirname "$0")/node_modules/pikakit/lib/agent-cli/bin/agent.js" "$@"`;
|
|
872
|
-
fs.writeFileSync(path.join(projectRoot, "agent.cmd"), agentCmd);
|
|
873
|
-
fs.writeFileSync(path.join(projectRoot, "agent"), agentSh, { mode: 0o755 });
|
|
874
|
-
|
|
875
|
-
// Also create in node_modules/.bin for npx support
|
|
876
|
-
if (fs.existsSync(binDir)) {
|
|
877
|
-
const agentBinCmd = `@echo off\nnode "%~dp0..\\pikakit\\lib\\agent-cli\\bin\\agent.js" %*`;
|
|
878
|
-
const agentBinSh = `#!/bin/sh\nnode "$(dirname "$0")/../pikakit/lib/agent-cli/bin/agent.js" "$@"`;
|
|
879
|
-
fs.writeFileSync(path.join(binDir, "agent.cmd"), agentBinCmd);
|
|
880
|
-
fs.writeFileSync(path.join(binDir, "agent"), agentBinSh, { mode: 0o755 });
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
step(c.green("✔ Created wrapper scripts: agent, kit"));
|
|
884
|
-
step(c.dim("Run: npx agent | npx kit | .\\agent | .\\kit (Windows)"));
|
|
885
|
-
} else {
|
|
886
|
-
step(c.green("✔ Created wrapper script: kit"));
|
|
887
|
-
step(c.dim("Run: npx kit | .\\kit (Windows)"));
|
|
888
|
-
}
|
|
791
|
+
step(c.green(" Created wrapper script: kit"));
|
|
792
|
+
step(c.dim("Run directly: ./kit (Unix) | kit (Windows)"));
|
|
889
793
|
} catch (wrapperErr) {
|
|
890
794
|
step(c.dim("Run: npx kit"));
|
|
891
795
|
}
|
|
@@ -895,35 +799,6 @@ lessons: []
|
|
|
895
799
|
}
|
|
896
800
|
}
|
|
897
801
|
|
|
898
|
-
// === SINGLE-SOURCE: Overwrite lib/agent-cli with version from repo ===
|
|
899
|
-
if (agentCliAvailable && !isGlobal) {
|
|
900
|
-
stepLine();
|
|
901
|
-
const overwriteSpinner = spinner();
|
|
902
|
-
overwriteSpinner.start("Syncing AutoLearn CLI from repo...");
|
|
903
|
-
try {
|
|
904
|
-
const destAgentCli = path.join(process.cwd(), "node_modules", "pikakit", "lib", "agent-cli");
|
|
905
|
-
|
|
906
|
-
// Remove existing lib/agent-cli if exists
|
|
907
|
-
if (fs.existsSync(destAgentCli)) {
|
|
908
|
-
fs.rmSync(destAgentCli, { recursive: true, force: true });
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
// Copy from cached repo version
|
|
912
|
-
fs.mkdirSync(path.dirname(destAgentCli), { recursive: true });
|
|
913
|
-
fs.cpSync(agentCliLocalCache, destAgentCli, { recursive: true });
|
|
914
|
-
|
|
915
|
-
// Cleanup cache
|
|
916
|
-
fs.rmSync(agentCliLocalCache, { recursive: true, force: true });
|
|
917
|
-
|
|
918
|
-
const itemCount = fs.readdirSync(destAgentCli).length;
|
|
919
|
-
overwriteSpinner.stop(`AutoLearn CLI synced from repo (${itemCount} modules)`);
|
|
920
|
-
step(c.green("✓ Single-source: lib/agent-cli from agent-skill-kit"));
|
|
921
|
-
} catch (syncErr) {
|
|
922
|
-
overwriteSpinner.stop(c.yellow("AutoLearn sync skipped (using npm version)"));
|
|
923
|
-
console.log(`[Install] Sync error: ${syncErr.message}`);
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
|
|
927
802
|
// Run npm install to ensure all skill dependencies are available
|
|
928
803
|
stepLine();
|
|
929
804
|
const depsSpinner = spinner();
|
|
@@ -938,26 +813,6 @@ lessons: []
|
|
|
938
813
|
|
|
939
814
|
// Python dependencies no longer needed - all scripts migrated to JS
|
|
940
815
|
|
|
941
|
-
// Final Quick Start Guide
|
|
942
|
-
stepLine();
|
|
943
|
-
console.log(boxen(
|
|
944
|
-
(installAutoLearn ?
|
|
945
|
-
`${c.cyan("🤖 AutoLearn Agent:")}\n` +
|
|
946
|
-
`${c.white("npx agent")} ${c.dim("or")} ${c.white("npm run agent")} ${c.dim("or")} ${c.white(".\\\\agent")}\n` +
|
|
947
|
-
`${c.dim("→ Learning, self-improvement, pattern detection")}\n\n` : "") +
|
|
948
|
-
`${c.cyan("🔧 Kit Commands:")}\n` +
|
|
949
|
-
`${c.white("npx kit")} ${c.dim("or")} ${c.white("npm run kit")} ${c.dim("or")} ${c.white(".\\\\kit")}\n` +
|
|
950
|
-
`${c.dim("→ Skill management, diagnostics, updates")}\n\n` +
|
|
951
|
-
`${c.yellow("Note:")} Windows PowerShell requires ${c.white(".\\\\")} prefix.`,
|
|
952
|
-
{
|
|
953
|
-
padding: 1,
|
|
954
|
-
borderColor: "cyan",
|
|
955
|
-
borderStyle: "round",
|
|
956
|
-
title: c.cyan("⚡ Get Started"),
|
|
957
|
-
titleAlignment: "left"
|
|
958
|
-
}
|
|
959
|
-
).split("\n").map(l => `${c.gray(S.branch)} ${l}`).join("\n"));
|
|
960
|
-
|
|
961
816
|
stepLine();
|
|
962
817
|
console.log(` ${c.cyan("Done!")}`);
|
|
963
818
|
console.log();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pikakit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "Enterprise-grade Agent Skill Manager with Antigravity Skills support, Progressive Disclosure detection, and semantic routing validation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "pikakit <pikakit@gmail.com>",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"bin": {
|
|
17
17
|
"pikakit": "bin/cli.mjs",
|
|
18
|
-
"kit": "bin/kit.js"
|
|
19
|
-
"agent": "lib/agent-cli/bin/agent.js"
|
|
18
|
+
"kit": "bin/kit.js"
|
|
20
19
|
},
|
|
21
20
|
"files": [
|
|
22
21
|
"bin/",
|