memorix 0.3.3 → 0.3.4

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/cli/index.js CHANGED
@@ -2319,8 +2319,10 @@ var init_engine2 = __esm({
2319
2319
  }
2320
2320
  /**
2321
2321
  * Migrate workspace configs to a target agent format.
2322
+ * @param items — optional list of specific item names (MCP servers / skills) to sync.
2323
+ * When provided, only matching items are included. Omit to sync all.
2322
2324
  */
2323
- async migrate(target) {
2325
+ async migrate(target, items) {
2324
2326
  const scan = await this.scan();
2325
2327
  const result = {
2326
2328
  mcpServers: { scanned: [], generated: [] },
@@ -2328,11 +2330,14 @@ var init_engine2 = __esm({
2328
2330
  rules: { scanned: 0, generated: 0 },
2329
2331
  skills: { scanned: [], conflicts: [], copied: [], skipped: [] }
2330
2332
  };
2333
+ const itemFilter = items && items.length > 0 ? new Set(items.map((i) => i.toLowerCase())) : null;
2331
2334
  const allServers = /* @__PURE__ */ new Map();
2332
2335
  for (const servers of Object.values(scan.mcpConfigs)) {
2333
2336
  for (const s of servers) {
2334
2337
  if (!allServers.has(s.name)) {
2335
- allServers.set(s.name, s);
2338
+ if (!itemFilter || itemFilter.has(s.name.toLowerCase())) {
2339
+ allServers.set(s.name, s);
2340
+ }
2336
2341
  }
2337
2342
  }
2338
2343
  }
@@ -2363,7 +2368,7 @@ var init_engine2 = __esm({
2363
2368
  }
2364
2369
  } catch {
2365
2370
  }
2366
- result.skills.scanned = scan.skills;
2371
+ result.skills.scanned = itemFilter ? scan.skills.filter((sk) => itemFilter.has(sk.name.toLowerCase())) : scan.skills;
2367
2372
  result.skills.conflicts = scan.skillConflicts;
2368
2373
  return result;
2369
2374
  }
@@ -2486,8 +2491,8 @@ var init_engine2 = __esm({
2486
2491
  * - Auto-rollback on any failure
2487
2492
  * - Returns backup paths for manual rollback if needed
2488
2493
  */
2489
- async apply(target) {
2490
- const syncResult = await this.migrate(target);
2494
+ async apply(target, items) {
2495
+ const syncResult = await this.migrate(target, items);
2491
2496
  const applier = new WorkspaceSyncApplier();
2492
2497
  const filesToWrite = [
2493
2498
  ...syncResult.mcpServers.generated,
@@ -3535,10 +3540,11 @@ Entity: ${entityName} | Type: ${type} | Project: ${project.id}${enrichment}`
3535
3540
  description: 'Migrate your entire workspace environment between AI agents. Syncs MCP server configs, workflows, rules, and skills. Action "scan": detect all workspace configs. Action "migrate": generate configs for target agent (preview only). Action "apply": migrate AND write configs to disk with backup/rollback.',
3536
3541
  inputSchema: {
3537
3542
  action: z.enum(["scan", "migrate", "apply"]).describe('Action: "scan" to detect configs, "migrate" to preview, "apply" to write to disk'),
3538
- target: z.enum(AGENT_TARGETS).optional().describe("Target agent for migration (required for migrate)")
3543
+ target: z.enum(AGENT_TARGETS).optional().describe("Target agent for migration (required for migrate)"),
3544
+ items: z.array(z.string()).optional().describe('Selective sync: list specific MCP server or skill names to sync (e.g. ["figma-remote-mcp-server", "create-subagent"]). Omit to sync all.')
3539
3545
  }
3540
3546
  },
3541
- async ({ action, target }) => {
3547
+ async ({ action, target, items }) => {
3542
3548
  const engine = new WorkspaceSyncEngine(project.rootPath);
3543
3549
  if (action === "scan") {
3544
3550
  const scan = await engine.scan();
@@ -3587,13 +3593,13 @@ Entity: ${entityName} | Type: ${type} | Project: ${project.id}${enrichment}`
3587
3593
  };
3588
3594
  }
3589
3595
  if (action === "apply") {
3590
- const applyResult = await engine.apply(target);
3596
+ const applyResult = await engine.apply(target, items);
3591
3597
  return {
3592
3598
  content: [{ type: "text", text: applyResult.migrationSummary }],
3593
3599
  ...applyResult.success ? {} : { isError: true }
3594
3600
  };
3595
3601
  }
3596
- const result = await engine.migrate(target);
3602
+ const result = await engine.migrate(target, items);
3597
3603
  const lines = [
3598
3604
  `## Workspace Migration \u2192 ${target}`,
3599
3605
  ""