zam-core 0.10.6 → 0.10.8

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/app.js CHANGED
@@ -7430,7 +7430,7 @@ function detectInstalledConnectHarnesses(options = {}) {
7430
7430
  ]) || find("antigravity-ide")) {
7431
7431
  detected.push("antigravity");
7432
7432
  }
7433
- const claudeDesktopPath = platform === "darwin" ? "/Applications/Claude.app" : platform === "win32" ? join12(home, "AppData", "Local", "AnthropicClaude") : join12(home, ".config", "Claude");
7433
+ const claudeDesktopPath = platform === "darwin" ? "/Applications/Claude.app" : platform === "win32" ? exists(join12(home, "AppData", "Local", "AnthropicClaude")) ? join12(home, "AppData", "Local", "AnthropicClaude") : exists(join12(home, "AppData", "Local", "Claude")) ? join12(home, "AppData", "Local", "Claude") : join12(home, "AppData", "Roaming", "Claude") : join12(home, ".config", "Claude");
7434
7434
  if (exists(claudeDesktopPath)) detected.push("claude-desktop");
7435
7435
  return detected;
7436
7436
  }
@@ -7480,10 +7480,21 @@ function connectHarnessMcp(harnessId, opts) {
7480
7480
  if (!existing.mcpServers) {
7481
7481
  existing.mcpServers = {};
7482
7482
  }
7483
- existing.mcpServers.zam = {
7483
+ const expected = opts.zamPath.endsWith(".js") ? {
7484
+ command: process.execPath,
7485
+ args: [opts.zamPath, "mcp"]
7486
+ } : {
7484
7487
  command: opts.zamPath,
7485
7488
  args: ["mcp"]
7486
7489
  };
7490
+ const current = existing.mcpServers.zam;
7491
+ if (typeof current === "object" && current !== null && !Array.isArray(current)) {
7492
+ const c = current;
7493
+ if (c.command === expected.command && JSON.stringify(c.args) === JSON.stringify(expected.args)) {
7494
+ alreadyConfigured = true;
7495
+ }
7496
+ }
7497
+ existing.mcpServers.zam = expected;
7487
7498
  return JSON.stringify(existing, null, 2);
7488
7499
  };
7489
7500
  if (harnessId === "claude-code") {
@@ -7510,18 +7521,7 @@ function connectHarnessMcp(harnessId, opts) {
7510
7521
  } else if (harnessId === "antigravity") {
7511
7522
  targetPath = join12(opts.home, ".gemini", "config", "mcp_config.json");
7512
7523
  hint = "Shared config read by Antigravity CLI and IDE (2.0+); older IDE builds read ~/.gemini/antigravity/mcp_config.json instead. Refresh Installed MCP Servers; the first tool call may still require approval.";
7513
- let existing = {};
7514
- if (exists(targetPath)) {
7515
- existing = parseMcpJsonConfig(targetPath, read(targetPath));
7516
- }
7517
- if (!existing.mcpServers) {
7518
- existing.mcpServers = {};
7519
- }
7520
- existing.mcpServers.zam = {
7521
- command: opts.zamPath,
7522
- args: ["mcp"]
7523
- };
7524
- content = JSON.stringify(existing, null, 2);
7524
+ content = mergeMcpServersJson(targetPath);
7525
7525
  } else if (harnessId === "opencode") {
7526
7526
  targetPath = join12(opts.home, ".config", "opencode", "opencode.json");
7527
7527
  hint = "OpenCode will load the enabled 'zam' MCP server on next launch.";
@@ -7534,11 +7534,20 @@ function connectHarnessMcp(harnessId, opts) {
7534
7534
  throw new Error(`Cannot update ${targetPath}: mcp must be a JSON object`);
7535
7535
  }
7536
7536
  const servers = mcp ?? {};
7537
- servers.zam = {
7537
+ const cmd = opts.zamPath.endsWith(".js") ? [process.execPath, opts.zamPath, "mcp"] : [opts.zamPath, "mcp"];
7538
+ const expected = {
7538
7539
  type: "local",
7539
- command: [opts.zamPath, "mcp"],
7540
+ command: cmd,
7540
7541
  enabled: true
7541
7542
  };
7543
+ const current = servers.zam;
7544
+ if (typeof current === "object" && current !== null && !Array.isArray(current)) {
7545
+ const c = current;
7546
+ if (c.type === expected.type && c.enabled === expected.enabled && JSON.stringify(c.command) === JSON.stringify(expected.command)) {
7547
+ alreadyConfigured = true;
7548
+ }
7549
+ }
7550
+ servers.zam = expected;
7542
7551
  existing.mcp = servers;
7543
7552
  content = JSON.stringify(existing, null, 2);
7544
7553
  } else if (harnessId === "codex") {
@@ -7552,10 +7561,13 @@ function connectHarnessMcp(harnessId, opts) {
7552
7561
  alreadyConfigured = true;
7553
7562
  content = existingStr;
7554
7563
  } else {
7564
+ const isJs = opts.zamPath.endsWith(".js");
7565
+ const cmdStr = isJs ? JSON.stringify(process.execPath) : JSON.stringify(opts.zamPath);
7566
+ const argsStr = isJs ? `[${JSON.stringify(opts.zamPath)}, "mcp"]` : '["mcp"]';
7555
7567
  const block = `
7556
7568
  [mcp_servers.zam]
7557
- command = ${JSON.stringify(opts.zamPath)}
7558
- args = ["mcp"]
7569
+ command = ${cmdStr}
7570
+ args = ${argsStr}
7559
7571
  default_tools_approval_mode = "approve"
7560
7572
 
7561
7573
  [mcp_servers.zam.tools.zam_review_action]
@@ -7588,7 +7600,7 @@ ${block}` : block;
7588
7600
  throw new Error(`Cannot update ${targetPath}: inputs must be an array`);
7589
7601
  }
7590
7602
  if (!existing.servers) existing.servers = {};
7591
- const expectedServer = { command: opts.zamPath, args: ["mcp"] };
7603
+ const expectedServer = opts.zamPath.endsWith(".js") ? { command: process.execPath, args: [opts.zamPath, "mcp"] } : { command: opts.zamPath, args: ["mcp"] };
7592
7604
  const currentServer = existing.servers.zam;
7593
7605
  alreadyConfigured = Array.isArray(existing.inputs) && typeof currentServer === "object" && currentServer !== null && !Array.isArray(currentServer) && JSON.stringify(currentServer) === JSON.stringify(expectedServer);
7594
7606
  existing.servers.zam = expectedServer;
@@ -7597,12 +7609,14 @@ ${block}` : block;
7597
7609
  } else if (harnessId === "goose") {
7598
7610
  targetPath = join12(opts.home, ".config", "goose", "config.yaml");
7599
7611
  hint = "goose will load the 'zam' extension on next session start. Run 'goose configure' to manage extensions.";
7612
+ const isJs = opts.zamPath.endsWith(".js");
7613
+ const cmdStr = isJs ? process.execPath : opts.zamPath;
7614
+ const argsLines = isJs ? [" args:", ` - ${opts.zamPath}`, " - mcp"] : [" args:", " - mcp"];
7600
7615
  const zamExtension = [
7601
7616
  " zam:",
7602
7617
  " name: ZAM",
7603
- ` cmd: ${opts.zamPath}`,
7604
- " args:",
7605
- " - mcp",
7618
+ ` cmd: ${cmdStr}`,
7619
+ ...argsLines,
7606
7620
  " enabled: true",
7607
7621
  " type: stdio",
7608
7622
  " timeout: 300",
@@ -7644,12 +7658,25 @@ ${zamExtension}
7644
7658
  if (!existing.mcpServers) {
7645
7659
  existing.mcpServers = {};
7646
7660
  }
7647
- existing.mcpServers.zam = {
7661
+ const expected = opts.zamPath.endsWith(".js") ? {
7662
+ type: "local",
7663
+ command: process.execPath,
7664
+ args: [opts.zamPath, "mcp"],
7665
+ tools: ["*"]
7666
+ } : {
7648
7667
  type: "local",
7649
7668
  command: opts.zamPath,
7650
7669
  args: ["mcp"],
7651
7670
  tools: ["*"]
7652
7671
  };
7672
+ const current = existing.mcpServers.zam;
7673
+ if (typeof current === "object" && current !== null && !Array.isArray(current)) {
7674
+ const c = current;
7675
+ if (c.type === expected.type && c.command === expected.command && JSON.stringify(c.args) === JSON.stringify(expected.args) && JSON.stringify(c.tools) === JSON.stringify(expected.tools)) {
7676
+ alreadyConfigured = true;
7677
+ }
7678
+ }
7679
+ existing.mcpServers.zam = expected;
7653
7680
  content = JSON.stringify(existing, null, 2);
7654
7681
  }
7655
7682
  return {
@@ -7926,7 +7953,14 @@ function resolveDeps(deps) {
7926
7953
  home,
7927
7954
  cwd,
7928
7955
  copilotHome,
7929
- findZam: deps.findZam ?? (() => findExecutable("zam")),
7956
+ findZam: deps.findZam ?? (() => {
7957
+ const globalZam = findExecutable("zam");
7958
+ if (globalZam) return globalZam;
7959
+ if (process.argv[1] && process.argv[1].endsWith("index.js")) {
7960
+ return process.argv[1];
7961
+ }
7962
+ return null;
7963
+ }),
7930
7964
  detect: deps.detect ?? (() => detectInstalledConnectHarnesses({ home, copilotHome })),
7931
7965
  connectMcp: deps.connectMcp ?? connectHarnessMcp,
7932
7966
  writeConfig: deps.writeConfig ?? ((path, content) => {
@@ -10015,7 +10049,7 @@ async function readWebLink(url) {
10015
10049
  redirect: "manual",
10016
10050
  signal: controller.signal,
10017
10051
  headers: {
10018
- "User-Agent": "ZAM-Content-Studio/0.10.6"
10052
+ "User-Agent": "ZAM-Content-Studio/0.10.8"
10019
10053
  }
10020
10054
  });
10021
10055
  if (res.status >= 300 && res.status < 400) {
@@ -13569,6 +13603,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13569
13603
  label: "Mathematik 8 (II/III)"
13570
13604
  }
13571
13605
  ],
13606
+ "realschule|8|physik": [
13607
+ {
13608
+ id: "wpfg1",
13609
+ label: "Physik 8 (I)"
13610
+ },
13611
+ {
13612
+ id: "wpfg2-3",
13613
+ label: "Physik 8 (II/III)"
13614
+ }
13615
+ ],
13572
13616
  "realschule|8|sport": [
13573
13617
  {
13574
13618
  id: "basis_sport",
@@ -13589,6 +13633,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13589
13633
  label: "Mathematik 9 (II/III)"
13590
13634
  }
13591
13635
  ],
13636
+ "realschule|9|physik": [
13637
+ {
13638
+ id: "wpfg1",
13639
+ label: "Physik 9 (I)"
13640
+ },
13641
+ {
13642
+ id: "wpfg2-3",
13643
+ label: "Physik 9 (II/III)"
13644
+ }
13645
+ ],
13592
13646
  "realschule|9|sport": [
13593
13647
  {
13594
13648
  id: "basis_sport",
@@ -13609,6 +13663,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13609
13663
  label: "Mathematik 10 (II/III)"
13610
13664
  }
13611
13665
  ],
13666
+ "realschule|10|physik": [
13667
+ {
13668
+ id: "wpfg1",
13669
+ label: "Physik 10 (I)"
13670
+ },
13671
+ {
13672
+ id: "wpfg2-3",
13673
+ label: "Physik 10 (II/III)"
13674
+ }
13675
+ ],
13612
13676
  "realschule|10|sport": [
13613
13677
  {
13614
13678
  id: "basis_sport",
@@ -16621,6 +16685,45 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
16621
16685
  hours: 8
16622
16686
  }
16623
16687
  ],
16688
+ "realschule|8|physik|wpfg1": [
16689
+ {
16690
+ id: "lb1",
16691
+ label: "Mechanik und Energie",
16692
+ hours: 20
16693
+ },
16694
+ {
16695
+ id: "lb2",
16696
+ label: "W\xE4rmelehre",
16697
+ hours: 15
16698
+ },
16699
+ {
16700
+ id: "lb3",
16701
+ label: "Elektrizit\xE4tslehre",
16702
+ hours: 15
16703
+ },
16704
+ {
16705
+ id: "lb4",
16706
+ label: "Wahlbereich: Astronomie oder Akustik",
16707
+ hours: 6
16708
+ }
16709
+ ],
16710
+ "realschule|8|physik|wpfg2-3": [
16711
+ {
16712
+ id: "lb1",
16713
+ label: "Mechanik",
16714
+ hours: 22
16715
+ },
16716
+ {
16717
+ id: "lb2",
16718
+ label: "Optik",
16719
+ hours: 14
16720
+ },
16721
+ {
16722
+ id: "lb3",
16723
+ label: "Magnetismus und Elektrizit\xE4tslehre",
16724
+ hours: 20
16725
+ }
16726
+ ],
16624
16727
  "realschule|8|musik": [
16625
16728
  {
16626
16729
  id: "lb1",
@@ -17385,6 +17488,40 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
17385
17488
  hours: 9
17386
17489
  }
17387
17490
  ],
17491
+ "realschule|9|physik|wpfg1": [
17492
+ {
17493
+ id: "lb1",
17494
+ label: "Mechanik von Fl\xFCssigkeiten und Gasen",
17495
+ hours: 18
17496
+ },
17497
+ {
17498
+ id: "lb2",
17499
+ label: "W\xE4rmelehre",
17500
+ hours: 28
17501
+ },
17502
+ {
17503
+ id: "lb3",
17504
+ label: "Elektrizit\xE4tslehre",
17505
+ hours: 38
17506
+ }
17507
+ ],
17508
+ "realschule|9|physik|wpfg2-3": [
17509
+ {
17510
+ id: "lb1",
17511
+ label: "Mechanik und Energie",
17512
+ hours: 22
17513
+ },
17514
+ {
17515
+ id: "lb2",
17516
+ label: "W\xE4rmelehre",
17517
+ hours: 15
17518
+ },
17519
+ {
17520
+ id: "lb3",
17521
+ label: "Elektrizit\xE4tslehre",
17522
+ hours: 19
17523
+ }
17524
+ ],
17388
17525
  "realschule|9|musik": [
17389
17526
  {
17390
17527
  id: "lb1",
@@ -18043,6 +18180,50 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
18043
18180
  hours: 10
18044
18181
  }
18045
18182
  ],
18183
+ "realschule|10|physik|wpfg1": [
18184
+ {
18185
+ id: "lb1",
18186
+ label: "Mechanik",
18187
+ hours: 17
18188
+ },
18189
+ {
18190
+ id: "lb2",
18191
+ label: "Elektrizit\xE4tslehre",
18192
+ hours: 29
18193
+ },
18194
+ {
18195
+ id: "lb3",
18196
+ label: "Atom- und Kernphysik",
18197
+ hours: 14
18198
+ },
18199
+ {
18200
+ id: "lb4",
18201
+ label: "Energieversorgung",
18202
+ hours: 12
18203
+ }
18204
+ ],
18205
+ "realschule|10|physik|wpfg2-3": [
18206
+ {
18207
+ id: "lb1",
18208
+ label: "Mechanik",
18209
+ hours: 10
18210
+ },
18211
+ {
18212
+ id: "lb2",
18213
+ label: "Elektrizit\xE4tslehre",
18214
+ hours: 19
18215
+ },
18216
+ {
18217
+ id: "lb3",
18218
+ label: "Atom- und Kernphysik",
18219
+ hours: 7
18220
+ },
18221
+ {
18222
+ id: "lb4",
18223
+ label: "Energieversorgung",
18224
+ hours: 12
18225
+ }
18226
+ ],
18046
18227
  "realschule|10|musik": [
18047
18228
  {
18048
18229
  id: "lb1",
@@ -26695,6 +26876,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26695
26876
  "realschule|8|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/kunst/inhalt/fachlehrplaene",
26696
26877
  "realschule|8|mathematik|wpfg1": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/mathematik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=mathematik&wt_2=fach&w_jgs=8&wt_3=jgs&w_auspraegung=wpfg1",
26697
26878
  "realschule|8|mathematik|wpfg2-3": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/mathematik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=mathematik&wt_2=fach&w_jgs=8&wt_3=jgs&w_auspraegung=wpfg2-3",
26879
+ "realschule|8|physik|wpfg1": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/physik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=physik&wt_2=fach&w_jgs=8&wt_3=jgs&w_auspraegung=wpfg1",
26880
+ "realschule|8|physik|wpfg2-3": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/physik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=physik&wt_2=fach&w_jgs=8&wt_3=jgs&w_auspraegung=wpfg2-3",
26698
26881
  "realschule|8|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/musik/inhalt/fachlehrplaene",
26699
26882
  "realschule|8|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/or/inhalt/fachlehrplaene",
26700
26883
  "realschule|8|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26721,6 +26904,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26721
26904
  "realschule|9|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/kunst/inhalt/fachlehrplaene",
26722
26905
  "realschule|9|mathematik|wpfg1": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/mathematik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=mathematik&wt_2=fach&w_jgs=9&wt_3=jgs&w_auspraegung=wpfg1",
26723
26906
  "realschule|9|mathematik|wpfg2-3": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/mathematik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=mathematik&wt_2=fach&w_jgs=9&wt_3=jgs&w_auspraegung=wpfg2-3",
26907
+ "realschule|9|physik|wpfg1": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/physik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=physik&wt_2=fach&w_jgs=9&wt_3=jgs&w_auspraegung=wpfg1",
26908
+ "realschule|9|physik|wpfg2-3": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/physik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=physik&wt_2=fach&w_jgs=9&wt_3=jgs&w_auspraegung=wpfg2-3",
26724
26909
  "realschule|9|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/musik/inhalt/fachlehrplaene",
26725
26910
  "realschule|9|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/or/inhalt/fachlehrplaene",
26726
26911
  "realschule|9|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26746,6 +26931,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26746
26931
  "realschule|10|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/kunst/inhalt/fachlehrplaene",
26747
26932
  "realschule|10|mathematik|wpfg1": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/mathematik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=mathematik&wt_2=fach&w_jgs=10&wt_3=jgs&w_auspraegung=wpfg1",
26748
26933
  "realschule|10|mathematik|wpfg2-3": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/mathematik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=mathematik&wt_2=fach&w_jgs=10&wt_3=jgs&w_auspraegung=wpfg2-3",
26934
+ "realschule|10|physik|wpfg1": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/physik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=physik&wt_2=fach&w_jgs=10&wt_3=jgs&w_auspraegung=wpfg1",
26935
+ "realschule|10|physik|wpfg2-3": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/physik/inhalt/fachlehrplaene?w_schulart=realschule&wt_1=schulart&w_fach=physik&wt_2=fach&w_jgs=10&wt_3=jgs&w_auspraegung=wpfg2-3",
26749
26936
  "realschule|10|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/musik/inhalt/fachlehrplaene",
26750
26937
  "realschule|10|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/or/inhalt/fachlehrplaene",
26751
26938
  "realschule|10|pug": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/pug/inhalt/fachlehrplaene",