memorix 0.7.1 → 0.7.3

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/dist/index.js CHANGED
@@ -1246,7 +1246,7 @@ var engine_exports = {};
1246
1246
  __export(engine_exports, {
1247
1247
  SkillsEngine: () => SkillsEngine
1248
1248
  });
1249
- import { existsSync as existsSync5, readFileSync as readFileSync3, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync2 } from "fs";
1249
+ import { existsSync as existsSync5, readFileSync as readFileSync4, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3, readdirSync as readdirSync2 } from "fs";
1250
1250
  import { join as join11 } from "path";
1251
1251
  import { homedir as homedir10 } from "os";
1252
1252
  var SKILLS_DIRS, SKILL_WORTHY_TYPES, MIN_OBS_FOR_SKILL, MIN_SCORE_FOR_SKILL, SkillsEngine;
@@ -1305,7 +1305,7 @@ var init_engine = __esm({
1305
1305
  const skillMd = join11(skillsRoot, name, "SKILL.md");
1306
1306
  if (!existsSync5(skillMd)) continue;
1307
1307
  try {
1308
- const content = readFileSync3(skillMd, "utf-8");
1308
+ const content = readFileSync4(skillMd, "utf-8");
1309
1309
  const description = this.parseDescription(content);
1310
1310
  skills.push({
1311
1311
  name,
@@ -2403,7 +2403,7 @@ async function compactDetail(ids) {
2403
2403
  // src/project/detector.ts
2404
2404
  init_esm_shims();
2405
2405
  import { execSync } from "child_process";
2406
- import { existsSync } from "fs";
2406
+ import { existsSync, readFileSync } from "fs";
2407
2407
  import os2 from "os";
2408
2408
  import path3 from "path";
2409
2409
  function detectProject(cwd) {
@@ -2499,24 +2499,43 @@ function findPackageRoot(cwd) {
2499
2499
  }
2500
2500
  function getGitRoot(cwd) {
2501
2501
  try {
2502
- const root = execSync("git rev-parse --show-toplevel", {
2502
+ const root = execSync("git -c safe.directory=* rev-parse --show-toplevel", {
2503
2503
  cwd,
2504
2504
  encoding: "utf-8",
2505
2505
  stdio: ["pipe", "pipe", "pipe"]
2506
2506
  }).trim();
2507
2507
  return root || null;
2508
2508
  } catch {
2509
+ let dir = path3.resolve(cwd);
2510
+ const fsRoot = path3.parse(dir).root;
2511
+ while (dir !== fsRoot) {
2512
+ if (existsSync(path3.join(dir, ".git"))) return dir;
2513
+ dir = path3.dirname(dir);
2514
+ }
2509
2515
  return null;
2510
2516
  }
2511
2517
  }
2512
2518
  function getGitRemote(cwd) {
2513
2519
  try {
2514
- const remote = execSync("git remote get-url origin", {
2520
+ const remote = execSync("git -c safe.directory=* remote get-url origin", {
2515
2521
  cwd,
2516
2522
  encoding: "utf-8",
2517
2523
  stdio: ["pipe", "pipe", "pipe"]
2518
2524
  }).trim();
2519
2525
  return remote || null;
2526
+ } catch {
2527
+ return readGitConfigRemote(cwd);
2528
+ }
2529
+ }
2530
+ function readGitConfigRemote(cwd) {
2531
+ try {
2532
+ const configPath = path3.join(cwd, ".git", "config");
2533
+ if (!existsSync(configPath)) return null;
2534
+ const content = readFileSync(configPath, "utf-8");
2535
+ const remoteMatch = content.match(/\[remote\s+"origin"\]([\s\S]*?)(?=\n\[|$)/);
2536
+ if (!remoteMatch) return null;
2537
+ const urlMatch = remoteMatch[1].match(/^\s*url\s*=\s*(.+)$/m);
2538
+ return urlMatch ? urlMatch[1].trim() : null;
2520
2539
  } catch {
2521
2540
  return null;
2522
2541
  }
@@ -3235,7 +3254,7 @@ var RulesSyncer = class {
3235
3254
 
3236
3255
  // src/workspace/engine.ts
3237
3256
  init_esm_shims();
3238
- import { readFileSync as readFileSync2, readdirSync, existsSync as existsSync4, cpSync, mkdirSync as mkdirSync2 } from "fs";
3257
+ import { readFileSync as readFileSync3, readdirSync, existsSync as existsSync4, cpSync, mkdirSync as mkdirSync2 } from "fs";
3239
3258
  import { join as join9 } from "path";
3240
3259
  import { homedir as homedir8 } from "os";
3241
3260
 
@@ -3539,7 +3558,7 @@ var ClaudeCodeMCPAdapter = class {
3539
3558
  init_esm_shims();
3540
3559
  import { homedir as homedir5 } from "os";
3541
3560
  import { join as join5 } from "path";
3542
- import { existsSync as existsSync2, readFileSync } from "fs";
3561
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
3543
3562
  var CopilotMCPAdapter = class {
3544
3563
  source = "copilot";
3545
3564
  parse(content) {
@@ -3583,7 +3602,7 @@ var CopilotMCPAdapter = class {
3583
3602
  let existing = {};
3584
3603
  if (existsSync2(configPath)) {
3585
3604
  try {
3586
- existing = JSON.parse(readFileSync(configPath, "utf-8"));
3605
+ existing = JSON.parse(readFileSync2(configPath, "utf-8"));
3587
3606
  } catch {
3588
3607
  }
3589
3608
  }
@@ -3978,7 +3997,7 @@ var WorkspaceSyncEngine = class _WorkspaceSyncEngine {
3978
3997
  for (const path7 of [configPath, globalPath]) {
3979
3998
  if (existsSync4(path7)) {
3980
3999
  try {
3981
- const content = readFileSync2(path7, "utf-8");
4000
+ const content = readFileSync3(path7, "utf-8");
3982
4001
  const servers = adapter.parse(content);
3983
4002
  if (servers.length > 0) {
3984
4003
  mcpConfigs[target] = servers;
@@ -4095,7 +4114,7 @@ var WorkspaceSyncEngine = class _WorkspaceSyncEngine {
4095
4114
  if (!existsSync4(skillMd)) continue;
4096
4115
  let description = "";
4097
4116
  try {
4098
- const content = readFileSync2(skillMd, "utf-8");
4117
+ const content = readFileSync3(skillMd, "utf-8");
4099
4118
  const match = content.match(/^---[\s\S]*?description:\s*["']?(.+?)["']?\s*$/m);
4100
4119
  if (match) description = match[1];
4101
4120
  } catch {
@@ -4162,7 +4181,7 @@ var WorkspaceSyncEngine = class _WorkspaceSyncEngine {
4162
4181
  const files = readdirSync(wfDir).filter((f) => f.endsWith(".md"));
4163
4182
  for (const file of files) {
4164
4183
  try {
4165
- const content = readFileSync2(join9(wfDir, file), "utf-8");
4184
+ const content = readFileSync3(join9(wfDir, file), "utf-8");
4166
4185
  workflows.push(this.workflowSyncer.parseWindsurfWorkflow(file, content));
4167
4186
  } catch {
4168
4187
  }
@@ -4739,12 +4758,12 @@ Entity: ${entityName} | Type: ${type} | Project: ${project.id}${enrichment}`
4739
4758
  };
4740
4759
  }
4741
4760
  );
4742
- const RULE_SOURCES = ["cursor", "claude-code", "codex", "windsurf", "antigravity", "copilot"];
4761
+ const RULE_SOURCES = ["cursor", "claude-code", "codex", "windsurf", "antigravity", "copilot", "kiro"];
4743
4762
  server.registerTool(
4744
4763
  "memorix_rules_sync",
4745
4764
  {
4746
4765
  title: "Rules Sync",
4747
- description: "Scan project for agent rule files (Cursor, Claude Code, Codex, Windsurf, Antigravity, Copilot), deduplicate, detect conflicts, and optionally generate rules for a target agent format. Without target: returns sync status report. With target: generates converted rule files.",
4766
+ description: "Scan project for agent rule files (Cursor, Claude Code, Codex, Windsurf, Antigravity, Copilot, Kiro), deduplicate, detect conflicts, and optionally generate rules for a target agent format. Without target: returns sync status report. With target: generates converted rule files.",
4748
4767
  inputSchema: {
4749
4768
  action: z.enum(["status", "generate"]).describe('Action: "status" for report, "generate" to produce target files'),
4750
4769
  target: z.enum(RULE_SOURCES).optional().describe("Target agent format for generation (required when action=generate)")
@@ -4794,7 +4813,7 @@ Entity: ${entityName} | Type: ${type} | Project: ${project.id}${enrichment}`
4794
4813
  };
4795
4814
  }
4796
4815
  );
4797
- const AGENT_TARGETS = ["windsurf", "cursor", "claude-code", "codex", "copilot", "antigravity"];
4816
+ const AGENT_TARGETS = ["windsurf", "cursor", "claude-code", "codex", "copilot", "antigravity", "kiro"];
4798
4817
  server.registerTool(
4799
4818
  "memorix_workspace_sync",
4800
4819
  {