kiro-memory 1.2.1 → 1.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiro-memory",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Persistent cross-session memory for Kiro CLI. Automatically tracks context, observations, and summaries across coding sessions.",
5
5
  "keywords": [
6
6
  "kiro",
@@ -1082,10 +1082,11 @@ function createContextKit(config) {
1082
1082
 
1083
1083
  // src/cli/contextkit.ts
1084
1084
  import { execSync } from "child_process";
1085
- import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync2, writeFileSync } from "fs";
1085
+ import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync2, writeFileSync, appendFileSync as appendFileSync2 } from "fs";
1086
1086
  import { join as join3, dirname as dirname2 } from "path";
1087
1087
  import { homedir as homedir3, platform, release } from "os";
1088
1088
  import { fileURLToPath as fileURLToPath2 } from "url";
1089
+ import { createInterface } from "readline";
1089
1090
  var args = process.argv.slice(2);
1090
1091
  var command = args[0];
1091
1092
  var __filename = fileURLToPath2(import.meta.url);
@@ -1201,6 +1202,17 @@ function runEnvironmentChecks() {
1201
1202
  message: "Unable to determine npm prefix"
1202
1203
  });
1203
1204
  }
1205
+ try {
1206
+ const npmPath = execSync("which npm", { encoding: "utf8" }).trim();
1207
+ const npmOnWindows = isWindowsPath(npmPath);
1208
+ checks.push({
1209
+ name: "WSL: npm binary",
1210
+ ok: !npmOnWindows,
1211
+ message: npmOnWindows ? `npm is the Windows version: ${npmPath}` : `Native Linux npm: ${npmPath}`,
1212
+ fix: npmOnWindows ? "Your npm binary is the Windows version running inside WSL.\n This causes EPERM/UNC errors when installing packages.\n Install Node.js (includes npm) natively in WSL:\n curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash\n source ~/.bashrc\n nvm install 22\n Or:\n curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -\n sudo apt-get install -y nodejs" : void 0
1213
+ });
1214
+ } catch {
1215
+ }
1204
1216
  }
1205
1217
  const nodeVersion = parseInt(process.versions.node.split(".")[0]);
1206
1218
  checks.push({
@@ -1260,6 +1272,21 @@ function printChecks(checks) {
1260
1272
  console.log("");
1261
1273
  return { hasErrors };
1262
1274
  }
1275
+ function askUser(question) {
1276
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
1277
+ return new Promise((resolve) => {
1278
+ rl.question(question, (answer) => {
1279
+ rl.close();
1280
+ resolve(answer.trim().toLowerCase());
1281
+ });
1282
+ });
1283
+ }
1284
+ function detectShellRc() {
1285
+ const shell = process.env.SHELL || "/bin/bash";
1286
+ if (shell.includes("zsh")) return { name: "zsh", rcFile: join3(homedir3(), ".zshrc") };
1287
+ if (shell.includes("fish")) return { name: "fish", rcFile: join3(homedir3(), ".config/fish/config.fish") };
1288
+ return { name: "bash", rcFile: join3(homedir3(), ".bashrc") };
1289
+ }
1263
1290
  async function installKiro() {
1264
1291
  console.log("\n=== Kiro Memory - Installation ===\n");
1265
1292
  console.log("[1/3] Running environment checks...");
@@ -1303,14 +1330,56 @@ async function installKiro() {
1303
1330
  writeFileSync(steeringDestPath, STEERING_CONTENT, "utf8");
1304
1331
  console.log(` \u2192 Steering: ${steeringDestPath}`);
1305
1332
  console.log(` \u2192 Data dir: ${dataDir}`);
1306
- console.log("\n[3/3] Installation complete!\n");
1307
- console.log("To use Kiro with persistent memory:");
1308
- console.log(" kiro-cli --agent contextkit-memory\n");
1309
- console.log("To create a permanent alias:");
1310
- console.log(` echo 'alias kiro="kiro-cli --agent contextkit-memory"' >> ~/.bashrc`);
1311
- console.log(" source ~/.bashrc\n");
1312
- console.log("The worker starts automatically when a Kiro session begins.");
1313
- console.log(`Web dashboard: http://localhost:3001
1333
+ console.log("\n[3/3] Shell alias setup\n");
1334
+ const { name: shellName, rcFile } = detectShellRc();
1335
+ const aliasLine = 'alias kiro="kiro-cli --agent contextkit-memory"';
1336
+ let aliasAlreadySet = false;
1337
+ if (existsSync3(rcFile)) {
1338
+ const rcContent = readFileSync2(rcFile, "utf8");
1339
+ aliasAlreadySet = rcContent.includes("alias kiro=") && rcContent.includes("contextkit-memory");
1340
+ }
1341
+ if (aliasAlreadySet) {
1342
+ console.log(` \x1B[32m\u2713\x1B[0m Alias already configured in ${rcFile}`);
1343
+ } else {
1344
+ console.log(" \x1B[36m\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\x1B[0m");
1345
+ console.log(" \x1B[36m\u2502\x1B[0m Without an alias, you must type every time: \x1B[36m\u2502\x1B[0m");
1346
+ console.log(" \x1B[36m\u2502\x1B[0m \x1B[2mkiro-cli --agent contextkit-memory\x1B[0m \x1B[36m\u2502\x1B[0m");
1347
+ console.log(" \x1B[36m\u2502\x1B[0m \x1B[36m\u2502\x1B[0m");
1348
+ console.log(" \x1B[36m\u2502\x1B[0m With the alias, just type: \x1B[36m\u2502\x1B[0m");
1349
+ console.log(" \x1B[36m\u2502\x1B[0m \x1B[1m\x1B[32mkiro\x1B[0m \x1B[36m\u2502\x1B[0m");
1350
+ console.log(" \x1B[36m\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\x1B[0m");
1351
+ console.log("");
1352
+ const answer = await askUser(` Add alias to ${rcFile}? [Y/n] `);
1353
+ if (answer === "" || answer === "y" || answer === "yes") {
1354
+ try {
1355
+ appendFileSync2(rcFile, `
1356
+ # Kiro Memory \u2014 persistent memory alias
1357
+ ${aliasLine}
1358
+ `);
1359
+ console.log(`
1360
+ \x1B[32m\u2713\x1B[0m Alias added to ${rcFile}`);
1361
+ console.log(` \x1B[33m\u2192\x1B[0m Run \x1B[1msource ${rcFile}\x1B[0m or open a new terminal to activate it.`);
1362
+ } catch (err) {
1363
+ console.log(`
1364
+ \x1B[31m\u2717\x1B[0m Could not write to ${rcFile}: ${err.message}`);
1365
+ console.log(` \x1B[33m\u2192\x1B[0m Add manually: ${aliasLine}`);
1366
+ }
1367
+ } else {
1368
+ console.log(`
1369
+ Skipped. You can add it manually later:`);
1370
+ console.log(` echo '${aliasLine}' >> ${rcFile}`);
1371
+ }
1372
+ }
1373
+ console.log("\n\x1B[32m\u2550\u2550\u2550 Installation complete! \u2550\u2550\u2550\x1B[0m\n");
1374
+ console.log(" Start Kiro with memory:");
1375
+ if (aliasAlreadySet) {
1376
+ console.log(" \x1B[1mkiro\x1B[0m");
1377
+ } else {
1378
+ console.log(" \x1B[1mkiro-cli --agent contextkit-memory\x1B[0m");
1379
+ }
1380
+ console.log("");
1381
+ console.log(" The worker starts automatically when a Kiro session begins.");
1382
+ console.log(` Web dashboard: \x1B[4mhttp://localhost:3001\x1B[0m
1314
1383
  `);
1315
1384
  }
1316
1385
  async function runDoctor() {