@lexicallayer/cli 0.1.5 → 0.1.6
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/bin/index.js +18 -8
- 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
|
|
105
|
+
const os = require("os");
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
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,13 @@ function wrapAgentWithUserStyle(agentClient) {
|
|
|
126
135
|
|
|
127
136
|
module.exports = { layer, wrapAgentWithUserStyle };
|
|
128
137
|
`;
|
|
129
|
-
|
|
138
|
+
const layerFilePath = path.join(targetDir, "layer.js");
|
|
139
|
+
fs.writeFileSync(layerFilePath, agentLayerCode, "utf-8");
|
|
130
140
|
|
|
131
141
|
console.log(`\n\x1b[35m[LexicalLayer Entegrasyonu Tamamlandı]\x1b[0m`);
|
|
132
|
-
console.log(`📂
|
|
133
|
-
console.log(`\n\x1b[32mAgent
|
|
134
|
-
console.log(`\x1b[36mconst { wrapAgentWithUserStyle } = require("
|
|
142
|
+
console.log(`📂 Agent Katman Dosyanız Hazırlandı: \x1b[33m${layerFilePath}\x1b[0m`);
|
|
143
|
+
console.log(`\n\x1b[32mAgent Kodunuzda Kullanmak İçin Tek Satır:\x1b[0m`);
|
|
144
|
+
console.log(`\x1b[36mconst { wrapAgentWithUserStyle } = require("${layerFilePath.replace(/\\/g, "/")}");\x1b[0m`);
|
|
135
145
|
console.log(`\x1b[36mconst myAgent = wrapAgentWithUserStyle(openai);\x1b[0m\n`);
|
|
136
146
|
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
147
|
process.exit(0);
|
|
@@ -194,7 +204,7 @@ if (command === "calibrate") {
|
|
|
194
204
|
} else if (command === "chat") {
|
|
195
205
|
startChat();
|
|
196
206
|
} else if (command === "--version" || command === "-v") {
|
|
197
|
-
console.log("0.1.
|
|
207
|
+
console.log("0.1.6");
|
|
198
208
|
} else {
|
|
199
209
|
console.log(`
|
|
200
210
|
LexicalLayer CLI
|