zam-core 0.10.6 → 0.10.7

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,17 @@ function connectHarnessMcp(harnessId, opts) {
7480
7480
  if (!existing.mcpServers) {
7481
7481
  existing.mcpServers = {};
7482
7482
  }
7483
- existing.mcpServers.zam = {
7484
- command: opts.zamPath,
7485
- args: ["mcp"]
7486
- };
7483
+ if (opts.zamPath.endsWith(".js")) {
7484
+ existing.mcpServers.zam = {
7485
+ command: process.execPath,
7486
+ args: [opts.zamPath, "mcp"]
7487
+ };
7488
+ } else {
7489
+ existing.mcpServers.zam = {
7490
+ command: opts.zamPath,
7491
+ args: ["mcp"]
7492
+ };
7493
+ }
7487
7494
  return JSON.stringify(existing, null, 2);
7488
7495
  };
7489
7496
  if (harnessId === "claude-code") {
@@ -7517,10 +7524,17 @@ function connectHarnessMcp(harnessId, opts) {
7517
7524
  if (!existing.mcpServers) {
7518
7525
  existing.mcpServers = {};
7519
7526
  }
7520
- existing.mcpServers.zam = {
7521
- command: opts.zamPath,
7522
- args: ["mcp"]
7523
- };
7527
+ if (opts.zamPath.endsWith(".js")) {
7528
+ existing.mcpServers.zam = {
7529
+ command: process.execPath,
7530
+ args: [opts.zamPath, "mcp"]
7531
+ };
7532
+ } else {
7533
+ existing.mcpServers.zam = {
7534
+ command: opts.zamPath,
7535
+ args: ["mcp"]
7536
+ };
7537
+ }
7524
7538
  content = JSON.stringify(existing, null, 2);
7525
7539
  } else if (harnessId === "opencode") {
7526
7540
  targetPath = join12(opts.home, ".config", "opencode", "opencode.json");
@@ -7534,9 +7548,10 @@ function connectHarnessMcp(harnessId, opts) {
7534
7548
  throw new Error(`Cannot update ${targetPath}: mcp must be a JSON object`);
7535
7549
  }
7536
7550
  const servers = mcp ?? {};
7551
+ const cmd = opts.zamPath.endsWith(".js") ? [process.execPath, opts.zamPath, "mcp"] : [opts.zamPath, "mcp"];
7537
7552
  servers.zam = {
7538
7553
  type: "local",
7539
- command: [opts.zamPath, "mcp"],
7554
+ command: cmd,
7540
7555
  enabled: true
7541
7556
  };
7542
7557
  existing.mcp = servers;
@@ -7552,10 +7567,13 @@ function connectHarnessMcp(harnessId, opts) {
7552
7567
  alreadyConfigured = true;
7553
7568
  content = existingStr;
7554
7569
  } else {
7570
+ const isJs = opts.zamPath.endsWith(".js");
7571
+ const cmdStr = isJs ? JSON.stringify(process.execPath) : JSON.stringify(opts.zamPath);
7572
+ const argsStr = isJs ? `[${JSON.stringify(opts.zamPath)}, "mcp"]` : '["mcp"]';
7555
7573
  const block = `
7556
7574
  [mcp_servers.zam]
7557
- command = ${JSON.stringify(opts.zamPath)}
7558
- args = ["mcp"]
7575
+ command = ${cmdStr}
7576
+ args = ${argsStr}
7559
7577
  default_tools_approval_mode = "approve"
7560
7578
 
7561
7579
  [mcp_servers.zam.tools.zam_review_action]
@@ -7588,7 +7606,7 @@ ${block}` : block;
7588
7606
  throw new Error(`Cannot update ${targetPath}: inputs must be an array`);
7589
7607
  }
7590
7608
  if (!existing.servers) existing.servers = {};
7591
- const expectedServer = { command: opts.zamPath, args: ["mcp"] };
7609
+ const expectedServer = opts.zamPath.endsWith(".js") ? { command: process.execPath, args: [opts.zamPath, "mcp"] } : { command: opts.zamPath, args: ["mcp"] };
7592
7610
  const currentServer = existing.servers.zam;
7593
7611
  alreadyConfigured = Array.isArray(existing.inputs) && typeof currentServer === "object" && currentServer !== null && !Array.isArray(currentServer) && JSON.stringify(currentServer) === JSON.stringify(expectedServer);
7594
7612
  existing.servers.zam = expectedServer;
@@ -7597,12 +7615,14 @@ ${block}` : block;
7597
7615
  } else if (harnessId === "goose") {
7598
7616
  targetPath = join12(opts.home, ".config", "goose", "config.yaml");
7599
7617
  hint = "goose will load the 'zam' extension on next session start. Run 'goose configure' to manage extensions.";
7618
+ const isJs = opts.zamPath.endsWith(".js");
7619
+ const cmdStr = isJs ? process.execPath : opts.zamPath;
7620
+ const argsLines = isJs ? [" args:", ` - ${opts.zamPath}`, " - mcp"] : [" args:", " - mcp"];
7600
7621
  const zamExtension = [
7601
7622
  " zam:",
7602
7623
  " name: ZAM",
7603
- ` cmd: ${opts.zamPath}`,
7604
- " args:",
7605
- " - mcp",
7624
+ ` cmd: ${cmdStr}`,
7625
+ ...argsLines,
7606
7626
  " enabled: true",
7607
7627
  " type: stdio",
7608
7628
  " timeout: 300",
@@ -7644,12 +7664,21 @@ ${zamExtension}
7644
7664
  if (!existing.mcpServers) {
7645
7665
  existing.mcpServers = {};
7646
7666
  }
7647
- existing.mcpServers.zam = {
7648
- type: "local",
7649
- command: opts.zamPath,
7650
- args: ["mcp"],
7651
- tools: ["*"]
7652
- };
7667
+ if (opts.zamPath.endsWith(".js")) {
7668
+ existing.mcpServers.zam = {
7669
+ type: "local",
7670
+ command: process.execPath,
7671
+ args: [opts.zamPath, "mcp"],
7672
+ tools: ["*"]
7673
+ };
7674
+ } else {
7675
+ existing.mcpServers.zam = {
7676
+ type: "local",
7677
+ command: opts.zamPath,
7678
+ args: ["mcp"],
7679
+ tools: ["*"]
7680
+ };
7681
+ }
7653
7682
  content = JSON.stringify(existing, null, 2);
7654
7683
  }
7655
7684
  return {
@@ -7926,7 +7955,14 @@ function resolveDeps(deps) {
7926
7955
  home,
7927
7956
  cwd,
7928
7957
  copilotHome,
7929
- findZam: deps.findZam ?? (() => findExecutable("zam")),
7958
+ findZam: deps.findZam ?? (() => {
7959
+ const globalZam = findExecutable("zam");
7960
+ if (globalZam) return globalZam;
7961
+ if (process.argv[1] && process.argv[1].endsWith("index.js")) {
7962
+ return process.argv[1];
7963
+ }
7964
+ return null;
7965
+ }),
7930
7966
  detect: deps.detect ?? (() => detectInstalledConnectHarnesses({ home, copilotHome })),
7931
7967
  connectMcp: deps.connectMcp ?? connectHarnessMcp,
7932
7968
  writeConfig: deps.writeConfig ?? ((path, content) => {
@@ -10015,7 +10051,7 @@ async function readWebLink(url) {
10015
10051
  redirect: "manual",
10016
10052
  signal: controller.signal,
10017
10053
  headers: {
10018
- "User-Agent": "ZAM-Content-Studio/0.10.6"
10054
+ "User-Agent": "ZAM-Content-Studio/0.10.7"
10019
10055
  }
10020
10056
  });
10021
10057
  if (res.status >= 300 && res.status < 400) {
@@ -13569,6 +13605,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13569
13605
  label: "Mathematik 8 (II/III)"
13570
13606
  }
13571
13607
  ],
13608
+ "realschule|8|physik": [
13609
+ {
13610
+ id: "wpfg1",
13611
+ label: "Physik 8 (I)"
13612
+ },
13613
+ {
13614
+ id: "wpfg2-3",
13615
+ label: "Physik 8 (II/III)"
13616
+ }
13617
+ ],
13572
13618
  "realschule|8|sport": [
13573
13619
  {
13574
13620
  id: "basis_sport",
@@ -13589,6 +13635,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13589
13635
  label: "Mathematik 9 (II/III)"
13590
13636
  }
13591
13637
  ],
13638
+ "realschule|9|physik": [
13639
+ {
13640
+ id: "wpfg1",
13641
+ label: "Physik 9 (I)"
13642
+ },
13643
+ {
13644
+ id: "wpfg2-3",
13645
+ label: "Physik 9 (II/III)"
13646
+ }
13647
+ ],
13592
13648
  "realschule|9|sport": [
13593
13649
  {
13594
13650
  id: "basis_sport",
@@ -13609,6 +13665,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13609
13665
  label: "Mathematik 10 (II/III)"
13610
13666
  }
13611
13667
  ],
13668
+ "realschule|10|physik": [
13669
+ {
13670
+ id: "wpfg1",
13671
+ label: "Physik 10 (I)"
13672
+ },
13673
+ {
13674
+ id: "wpfg2-3",
13675
+ label: "Physik 10 (II/III)"
13676
+ }
13677
+ ],
13612
13678
  "realschule|10|sport": [
13613
13679
  {
13614
13680
  id: "basis_sport",
@@ -16621,6 +16687,45 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
16621
16687
  hours: 8
16622
16688
  }
16623
16689
  ],
16690
+ "realschule|8|physik|wpfg1": [
16691
+ {
16692
+ id: "lb1",
16693
+ label: "Mechanik und Energie",
16694
+ hours: 20
16695
+ },
16696
+ {
16697
+ id: "lb2",
16698
+ label: "W\xE4rmelehre",
16699
+ hours: 15
16700
+ },
16701
+ {
16702
+ id: "lb3",
16703
+ label: "Elektrizit\xE4tslehre",
16704
+ hours: 15
16705
+ },
16706
+ {
16707
+ id: "lb4",
16708
+ label: "Wahlbereich: Astronomie oder Akustik",
16709
+ hours: 6
16710
+ }
16711
+ ],
16712
+ "realschule|8|physik|wpfg2-3": [
16713
+ {
16714
+ id: "lb1",
16715
+ label: "Mechanik",
16716
+ hours: 22
16717
+ },
16718
+ {
16719
+ id: "lb2",
16720
+ label: "Optik",
16721
+ hours: 14
16722
+ },
16723
+ {
16724
+ id: "lb3",
16725
+ label: "Magnetismus und Elektrizit\xE4tslehre",
16726
+ hours: 20
16727
+ }
16728
+ ],
16624
16729
  "realschule|8|musik": [
16625
16730
  {
16626
16731
  id: "lb1",
@@ -17385,6 +17490,40 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
17385
17490
  hours: 9
17386
17491
  }
17387
17492
  ],
17493
+ "realschule|9|physik|wpfg1": [
17494
+ {
17495
+ id: "lb1",
17496
+ label: "Mechanik von Fl\xFCssigkeiten und Gasen",
17497
+ hours: 18
17498
+ },
17499
+ {
17500
+ id: "lb2",
17501
+ label: "W\xE4rmelehre",
17502
+ hours: 28
17503
+ },
17504
+ {
17505
+ id: "lb3",
17506
+ label: "Elektrizit\xE4tslehre",
17507
+ hours: 38
17508
+ }
17509
+ ],
17510
+ "realschule|9|physik|wpfg2-3": [
17511
+ {
17512
+ id: "lb1",
17513
+ label: "Mechanik und Energie",
17514
+ hours: 22
17515
+ },
17516
+ {
17517
+ id: "lb2",
17518
+ label: "W\xE4rmelehre",
17519
+ hours: 15
17520
+ },
17521
+ {
17522
+ id: "lb3",
17523
+ label: "Elektrizit\xE4tslehre",
17524
+ hours: 19
17525
+ }
17526
+ ],
17388
17527
  "realschule|9|musik": [
17389
17528
  {
17390
17529
  id: "lb1",
@@ -18043,6 +18182,50 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
18043
18182
  hours: 10
18044
18183
  }
18045
18184
  ],
18185
+ "realschule|10|physik|wpfg1": [
18186
+ {
18187
+ id: "lb1",
18188
+ label: "Mechanik",
18189
+ hours: 17
18190
+ },
18191
+ {
18192
+ id: "lb2",
18193
+ label: "Elektrizit\xE4tslehre",
18194
+ hours: 29
18195
+ },
18196
+ {
18197
+ id: "lb3",
18198
+ label: "Atom- und Kernphysik",
18199
+ hours: 14
18200
+ },
18201
+ {
18202
+ id: "lb4",
18203
+ label: "Energieversorgung",
18204
+ hours: 12
18205
+ }
18206
+ ],
18207
+ "realschule|10|physik|wpfg2-3": [
18208
+ {
18209
+ id: "lb1",
18210
+ label: "Mechanik",
18211
+ hours: 10
18212
+ },
18213
+ {
18214
+ id: "lb2",
18215
+ label: "Elektrizit\xE4tslehre",
18216
+ hours: 19
18217
+ },
18218
+ {
18219
+ id: "lb3",
18220
+ label: "Atom- und Kernphysik",
18221
+ hours: 7
18222
+ },
18223
+ {
18224
+ id: "lb4",
18225
+ label: "Energieversorgung",
18226
+ hours: 12
18227
+ }
18228
+ ],
18046
18229
  "realschule|10|musik": [
18047
18230
  {
18048
18231
  id: "lb1",
@@ -26695,6 +26878,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26695
26878
  "realschule|8|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/kunst/inhalt/fachlehrplaene",
26696
26879
  "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
26880
  "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",
26881
+ "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",
26882
+ "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
26883
  "realschule|8|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/musik/inhalt/fachlehrplaene",
26699
26884
  "realschule|8|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/or/inhalt/fachlehrplaene",
26700
26885
  "realschule|8|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26721,6 +26906,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26721
26906
  "realschule|9|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/kunst/inhalt/fachlehrplaene",
26722
26907
  "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
26908
  "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",
26909
+ "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",
26910
+ "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
26911
  "realschule|9|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/musik/inhalt/fachlehrplaene",
26725
26912
  "realschule|9|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/or/inhalt/fachlehrplaene",
26726
26913
  "realschule|9|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26746,6 +26933,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26746
26933
  "realschule|10|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/kunst/inhalt/fachlehrplaene",
26747
26934
  "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
26935
  "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",
26936
+ "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",
26937
+ "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
26938
  "realschule|10|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/musik/inhalt/fachlehrplaene",
26750
26939
  "realschule|10|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/or/inhalt/fachlehrplaene",
26751
26940
  "realschule|10|pug": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/pug/inhalt/fachlehrplaene",