@lexicallayer/cli 0.1.5 → 0.1.7

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 (2) hide show
  1. package/bin/index.js +57 -8
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -102,10 +102,19 @@ async function calibrate() {
102
102
  // Generate a ready-to-use Agent Layer file directly in the developer's project
103
103
  const fs = require("fs");
104
104
  const path = require("path");
105
- const targetDir = path.join(process.cwd(), ".lexicallayer");
105
+ const os = require("os");
106
106
 
107
- if (!fs.existsSync(targetDir)) {
108
- fs.mkdirSync(targetDir, { recursive: true });
107
+ let targetDir = path.join(process.cwd(), ".lexicallayer");
108
+ try {
109
+ if (!fs.existsSync(targetDir)) {
110
+ fs.mkdirSync(targetDir, { recursive: true });
111
+ }
112
+ } catch {
113
+ // If running in System32 or restricted directory, fallback to user home directory
114
+ targetDir = path.join(os.homedir(), ".lexicallayer");
115
+ if (!fs.existsSync(targetDir)) {
116
+ fs.mkdirSync(targetDir, { recursive: true });
117
+ }
109
118
  }
110
119
 
111
120
  const agentLayerCode = `// Otomatik Üretilen LexicalLayer Agent Katmanı
@@ -126,12 +135,52 @@ function wrapAgentWithUserStyle(agentClient) {
126
135
 
127
136
  module.exports = { layer, wrapAgentWithUserStyle };
128
137
  `;
129
- fs.writeFileSync(path.join(targetDir, "layer.js"), agentLayerCode, "utf-8");
138
+ // 1. Generate Agent Layer JS File
139
+ const layerFilePath = path.join(targetDir, "layer.js");
140
+ fs.writeFileSync(layerFilePath, agentLayerCode, "utf-8");
141
+
142
+ // 2. AUTOMATIC SKILL INSTALLATION: Directly install to user's AI Skills directory (.gemini, .cursor, .claude)
143
+ const skillMarkdown = `---
144
+ name: lexicallayer-steered-agent
145
+ description: LexicalLayer ile kalibre edilmiş kullanıcı ağırlıklarını (Rank-16 LoRA ve Residual Steering) AI asistanının zihnine ve yanıt motoruna entegre eden resmi katman becerisi. Kullanıcının otantik üslubu, karar mantığı ve jargon filtresiyle çalışır.
146
+ ---
147
+
148
+ # LexicalLayer Steered Representation Layer
149
+
150
+ Bu beceri aktif olduğunda AI asistanı, kullanıcının LexicalLayer Studio üzerinden kalibre ettiği ve onayladığı **\`${adapterFile}\`** ağırlıklarını doğrudan kendi düşünce ve yanıt zincirine entegre eder.
151
+
152
+ ## Aktif Ağırlık Kuralları:
153
+ 1. **Sentetik Klişeler ve Slop Kesinlikle Yasaktır:**
154
+ - Asla "günümüzün hızla evrilen dinamik ekosisteminde", "inovasyon yolculuğu", "mihenk taşı", "titizlikle dokumak", "sinerji" gibi yapay zeka klişeleri kullanılmaz.
155
+ 2. **Kullanıcının Otantik Üslup Katmanı:**
156
+ - Sistemler ve kodlar doğrudan çalışmalı.
157
+ - Fazla soyutlama, gereksiz wrapper ve dolaylı laf kalabalığı yerine sonuca odaklanılır.
158
+ - Karmaşık mimariler basit, temiz ve zarif arayüzlerle yönetilir.
159
+ 3. **Eylem ve Görev İcrası:**
160
+ - Kullanıcı bir e-posta, kod parçası veya mimari istediğinde nutuk çekilmez; doğrudan kullanıcının kendi sesinden, onun üslubuyla ve doğrudan sonuca yönelik şekilde yazılır.
161
+ `;
162
+
163
+ // Universal skill destinations for any machine (Antigravity, Cursor, Claude)
164
+ const skillPaths = [
165
+ path.join(os.homedir(), ".gemini", "config", "plugins", "lexicallayer-plugin", "skills", "lexicallayer"),
166
+ path.join(os.homedir(), ".cursor", "skills", "lexicallayer"),
167
+ path.join(os.homedir(), ".claude", "skills", "lexicallayer")
168
+ ];
169
+
170
+ skillPaths.forEach(sp => {
171
+ try {
172
+ fs.mkdirSync(sp, { recursive: true });
173
+ fs.writeFileSync(path.join(sp, "SKILL.md"), skillMarkdown, "utf-8");
174
+ } catch {
175
+ // Ignore if directory doesn't exist
176
+ }
177
+ });
130
178
 
131
179
  console.log(`\n\x1b[35m[LexicalLayer Entegrasyonu Tamamlandı]\x1b[0m`);
132
- console.log(`📂 Projenize katman dosyası eklendi: \x1b[33m.lexicallayer/layer.js\x1b[0m`);
133
- console.log(`\n\x1b[32mAgent'ınızda Kullanmak İçin Tek Satır:\x1b[0m`);
134
- console.log(`\x1b[36mconst { wrapAgentWithUserStyle } = require("./.lexicallayer/layer");\x1b[0m`);
180
+ console.log(`📂 Agent Katman Dosyası: \x1b[33m${layerFilePath}\x1b[0m`);
181
+ console.log(`🧠 AI Skills Becerisi: \x1b[32mOtomatik Olarak Asistan Yeteneklerine (Skills) Eklendi!\x1b[0m`);
182
+ console.log(`\n\x1b[32mAgent Kodunuzda Kullanmak İçin Tek Satır:\x1b[0m`);
183
+ console.log(`\x1b[36mconst { wrapAgentWithUserStyle } = require("${layerFilePath.replace(/\\/g, "/")}");\x1b[0m`);
135
184
  console.log(`\x1b[36mconst myAgent = wrapAgentWithUserStyle(openai);\x1b[0m\n`);
136
185
  log("\x1b[32mAgent'ınız artık kullanıcının özgün üslubu ve ağırlıkları ile çalışmaya hazır!\x1b[0m");
137
186
  process.exit(0);
@@ -194,7 +243,7 @@ if (command === "calibrate") {
194
243
  } else if (command === "chat") {
195
244
  startChat();
196
245
  } else if (command === "--version" || command === "-v") {
197
- console.log("0.1.4");
246
+ console.log("0.1.7");
198
247
  } else {
199
248
  console.log(`
200
249
  LexicalLayer CLI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexicallayer/cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "LexicalLayer CLI - Representation engineering and authentic weight calibration for AI agents",
5
5
  "main": "bin/index.js",
6
6
  "bin": {