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.
@@ -9913,7 +9913,7 @@ async function readWebLink(url) {
9913
9913
  redirect: "manual",
9914
9914
  signal: controller.signal,
9915
9915
  headers: {
9916
- "User-Agent": "ZAM-Content-Studio/0.10.6"
9916
+ "User-Agent": "ZAM-Content-Studio/0.10.7"
9917
9917
  }
9918
9918
  });
9919
9919
  if (res.status >= 300 && res.status < 400) {
@@ -10368,7 +10368,7 @@ function detectInstalledConnectHarnesses(options = {}) {
10368
10368
  ]) || find("antigravity-ide")) {
10369
10369
  detected.push("antigravity");
10370
10370
  }
10371
- const claudeDesktopPath = platform === "darwin" ? "/Applications/Claude.app" : platform === "win32" ? join16(home, "AppData", "Local", "AnthropicClaude") : join16(home, ".config", "Claude");
10371
+ const claudeDesktopPath = platform === "darwin" ? "/Applications/Claude.app" : platform === "win32" ? exists(join16(home, "AppData", "Local", "AnthropicClaude")) ? join16(home, "AppData", "Local", "AnthropicClaude") : exists(join16(home, "AppData", "Local", "Claude")) ? join16(home, "AppData", "Local", "Claude") : join16(home, "AppData", "Roaming", "Claude") : join16(home, ".config", "Claude");
10372
10372
  if (exists(claudeDesktopPath)) detected.push("claude-desktop");
10373
10373
  return detected;
10374
10374
  }
@@ -10418,10 +10418,17 @@ function connectHarnessMcp(harnessId, opts) {
10418
10418
  if (!existing.mcpServers) {
10419
10419
  existing.mcpServers = {};
10420
10420
  }
10421
- existing.mcpServers.zam = {
10422
- command: opts.zamPath,
10423
- args: ["mcp"]
10424
- };
10421
+ if (opts.zamPath.endsWith(".js")) {
10422
+ existing.mcpServers.zam = {
10423
+ command: process.execPath,
10424
+ args: [opts.zamPath, "mcp"]
10425
+ };
10426
+ } else {
10427
+ existing.mcpServers.zam = {
10428
+ command: opts.zamPath,
10429
+ args: ["mcp"]
10430
+ };
10431
+ }
10425
10432
  return JSON.stringify(existing, null, 2);
10426
10433
  };
10427
10434
  if (harnessId === "claude-code") {
@@ -10455,10 +10462,17 @@ function connectHarnessMcp(harnessId, opts) {
10455
10462
  if (!existing.mcpServers) {
10456
10463
  existing.mcpServers = {};
10457
10464
  }
10458
- existing.mcpServers.zam = {
10459
- command: opts.zamPath,
10460
- args: ["mcp"]
10461
- };
10465
+ if (opts.zamPath.endsWith(".js")) {
10466
+ existing.mcpServers.zam = {
10467
+ command: process.execPath,
10468
+ args: [opts.zamPath, "mcp"]
10469
+ };
10470
+ } else {
10471
+ existing.mcpServers.zam = {
10472
+ command: opts.zamPath,
10473
+ args: ["mcp"]
10474
+ };
10475
+ }
10462
10476
  content = JSON.stringify(existing, null, 2);
10463
10477
  } else if (harnessId === "opencode") {
10464
10478
  targetPath = join16(opts.home, ".config", "opencode", "opencode.json");
@@ -10472,9 +10486,10 @@ function connectHarnessMcp(harnessId, opts) {
10472
10486
  throw new Error(`Cannot update ${targetPath}: mcp must be a JSON object`);
10473
10487
  }
10474
10488
  const servers = mcp ?? {};
10489
+ const cmd = opts.zamPath.endsWith(".js") ? [process.execPath, opts.zamPath, "mcp"] : [opts.zamPath, "mcp"];
10475
10490
  servers.zam = {
10476
10491
  type: "local",
10477
- command: [opts.zamPath, "mcp"],
10492
+ command: cmd,
10478
10493
  enabled: true
10479
10494
  };
10480
10495
  existing.mcp = servers;
@@ -10490,10 +10505,13 @@ function connectHarnessMcp(harnessId, opts) {
10490
10505
  alreadyConfigured = true;
10491
10506
  content = existingStr;
10492
10507
  } else {
10508
+ const isJs = opts.zamPath.endsWith(".js");
10509
+ const cmdStr = isJs ? JSON.stringify(process.execPath) : JSON.stringify(opts.zamPath);
10510
+ const argsStr = isJs ? `[${JSON.stringify(opts.zamPath)}, "mcp"]` : '["mcp"]';
10493
10511
  const block = `
10494
10512
  [mcp_servers.zam]
10495
- command = ${JSON.stringify(opts.zamPath)}
10496
- args = ["mcp"]
10513
+ command = ${cmdStr}
10514
+ args = ${argsStr}
10497
10515
  default_tools_approval_mode = "approve"
10498
10516
 
10499
10517
  [mcp_servers.zam.tools.zam_review_action]
@@ -10526,7 +10544,7 @@ ${block}` : block;
10526
10544
  throw new Error(`Cannot update ${targetPath}: inputs must be an array`);
10527
10545
  }
10528
10546
  if (!existing.servers) existing.servers = {};
10529
- const expectedServer = { command: opts.zamPath, args: ["mcp"] };
10547
+ const expectedServer = opts.zamPath.endsWith(".js") ? { command: process.execPath, args: [opts.zamPath, "mcp"] } : { command: opts.zamPath, args: ["mcp"] };
10530
10548
  const currentServer = existing.servers.zam;
10531
10549
  alreadyConfigured = Array.isArray(existing.inputs) && typeof currentServer === "object" && currentServer !== null && !Array.isArray(currentServer) && JSON.stringify(currentServer) === JSON.stringify(expectedServer);
10532
10550
  existing.servers.zam = expectedServer;
@@ -10535,12 +10553,14 @@ ${block}` : block;
10535
10553
  } else if (harnessId === "goose") {
10536
10554
  targetPath = join16(opts.home, ".config", "goose", "config.yaml");
10537
10555
  hint = "goose will load the 'zam' extension on next session start. Run 'goose configure' to manage extensions.";
10556
+ const isJs = opts.zamPath.endsWith(".js");
10557
+ const cmdStr = isJs ? process.execPath : opts.zamPath;
10558
+ const argsLines = isJs ? [" args:", ` - ${opts.zamPath}`, " - mcp"] : [" args:", " - mcp"];
10538
10559
  const zamExtension = [
10539
10560
  " zam:",
10540
10561
  " name: ZAM",
10541
- ` cmd: ${opts.zamPath}`,
10542
- " args:",
10543
- " - mcp",
10562
+ ` cmd: ${cmdStr}`,
10563
+ ...argsLines,
10544
10564
  " enabled: true",
10545
10565
  " type: stdio",
10546
10566
  " timeout: 300",
@@ -10582,12 +10602,21 @@ ${zamExtension}
10582
10602
  if (!existing.mcpServers) {
10583
10603
  existing.mcpServers = {};
10584
10604
  }
10585
- existing.mcpServers.zam = {
10586
- type: "local",
10587
- command: opts.zamPath,
10588
- args: ["mcp"],
10589
- tools: ["*"]
10590
- };
10605
+ if (opts.zamPath.endsWith(".js")) {
10606
+ existing.mcpServers.zam = {
10607
+ type: "local",
10608
+ command: process.execPath,
10609
+ args: [opts.zamPath, "mcp"],
10610
+ tools: ["*"]
10611
+ };
10612
+ } else {
10613
+ existing.mcpServers.zam = {
10614
+ type: "local",
10615
+ command: opts.zamPath,
10616
+ args: ["mcp"],
10617
+ tools: ["*"]
10618
+ };
10619
+ }
10591
10620
  content = JSON.stringify(existing, null, 2);
10592
10621
  }
10593
10622
  return {
@@ -10864,7 +10893,14 @@ function resolveDeps(deps) {
10864
10893
  home,
10865
10894
  cwd,
10866
10895
  copilotHome,
10867
- findZam: deps.findZam ?? (() => findExecutable("zam")),
10896
+ findZam: deps.findZam ?? (() => {
10897
+ const globalZam = findExecutable("zam");
10898
+ if (globalZam) return globalZam;
10899
+ if (process.argv[1] && process.argv[1].endsWith("index.js")) {
10900
+ return process.argv[1];
10901
+ }
10902
+ return null;
10903
+ }),
10868
10904
  detect: deps.detect ?? (() => detectInstalledConnectHarnesses({ home, copilotHome })),
10869
10905
  connectMcp: deps.connectMcp ?? connectHarnessMcp,
10870
10906
  writeConfig: deps.writeConfig ?? ((path, content) => {
@@ -13298,6 +13334,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13298
13334
  label: "Mathematik 8 (II/III)"
13299
13335
  }
13300
13336
  ],
13337
+ "realschule|8|physik": [
13338
+ {
13339
+ id: "wpfg1",
13340
+ label: "Physik 8 (I)"
13341
+ },
13342
+ {
13343
+ id: "wpfg2-3",
13344
+ label: "Physik 8 (II/III)"
13345
+ }
13346
+ ],
13301
13347
  "realschule|8|sport": [
13302
13348
  {
13303
13349
  id: "basis_sport",
@@ -13318,6 +13364,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13318
13364
  label: "Mathematik 9 (II/III)"
13319
13365
  }
13320
13366
  ],
13367
+ "realschule|9|physik": [
13368
+ {
13369
+ id: "wpfg1",
13370
+ label: "Physik 9 (I)"
13371
+ },
13372
+ {
13373
+ id: "wpfg2-3",
13374
+ label: "Physik 9 (II/III)"
13375
+ }
13376
+ ],
13321
13377
  "realschule|9|sport": [
13322
13378
  {
13323
13379
  id: "basis_sport",
@@ -13338,6 +13394,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13338
13394
  label: "Mathematik 10 (II/III)"
13339
13395
  }
13340
13396
  ],
13397
+ "realschule|10|physik": [
13398
+ {
13399
+ id: "wpfg1",
13400
+ label: "Physik 10 (I)"
13401
+ },
13402
+ {
13403
+ id: "wpfg2-3",
13404
+ label: "Physik 10 (II/III)"
13405
+ }
13406
+ ],
13341
13407
  "realschule|10|sport": [
13342
13408
  {
13343
13409
  id: "basis_sport",
@@ -16350,6 +16416,45 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
16350
16416
  hours: 8
16351
16417
  }
16352
16418
  ],
16419
+ "realschule|8|physik|wpfg1": [
16420
+ {
16421
+ id: "lb1",
16422
+ label: "Mechanik und Energie",
16423
+ hours: 20
16424
+ },
16425
+ {
16426
+ id: "lb2",
16427
+ label: "W\xE4rmelehre",
16428
+ hours: 15
16429
+ },
16430
+ {
16431
+ id: "lb3",
16432
+ label: "Elektrizit\xE4tslehre",
16433
+ hours: 15
16434
+ },
16435
+ {
16436
+ id: "lb4",
16437
+ label: "Wahlbereich: Astronomie oder Akustik",
16438
+ hours: 6
16439
+ }
16440
+ ],
16441
+ "realschule|8|physik|wpfg2-3": [
16442
+ {
16443
+ id: "lb1",
16444
+ label: "Mechanik",
16445
+ hours: 22
16446
+ },
16447
+ {
16448
+ id: "lb2",
16449
+ label: "Optik",
16450
+ hours: 14
16451
+ },
16452
+ {
16453
+ id: "lb3",
16454
+ label: "Magnetismus und Elektrizit\xE4tslehre",
16455
+ hours: 20
16456
+ }
16457
+ ],
16353
16458
  "realschule|8|musik": [
16354
16459
  {
16355
16460
  id: "lb1",
@@ -17114,6 +17219,40 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
17114
17219
  hours: 9
17115
17220
  }
17116
17221
  ],
17222
+ "realschule|9|physik|wpfg1": [
17223
+ {
17224
+ id: "lb1",
17225
+ label: "Mechanik von Fl\xFCssigkeiten und Gasen",
17226
+ hours: 18
17227
+ },
17228
+ {
17229
+ id: "lb2",
17230
+ label: "W\xE4rmelehre",
17231
+ hours: 28
17232
+ },
17233
+ {
17234
+ id: "lb3",
17235
+ label: "Elektrizit\xE4tslehre",
17236
+ hours: 38
17237
+ }
17238
+ ],
17239
+ "realschule|9|physik|wpfg2-3": [
17240
+ {
17241
+ id: "lb1",
17242
+ label: "Mechanik und Energie",
17243
+ hours: 22
17244
+ },
17245
+ {
17246
+ id: "lb2",
17247
+ label: "W\xE4rmelehre",
17248
+ hours: 15
17249
+ },
17250
+ {
17251
+ id: "lb3",
17252
+ label: "Elektrizit\xE4tslehre",
17253
+ hours: 19
17254
+ }
17255
+ ],
17117
17256
  "realschule|9|musik": [
17118
17257
  {
17119
17258
  id: "lb1",
@@ -17772,6 +17911,50 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
17772
17911
  hours: 10
17773
17912
  }
17774
17913
  ],
17914
+ "realschule|10|physik|wpfg1": [
17915
+ {
17916
+ id: "lb1",
17917
+ label: "Mechanik",
17918
+ hours: 17
17919
+ },
17920
+ {
17921
+ id: "lb2",
17922
+ label: "Elektrizit\xE4tslehre",
17923
+ hours: 29
17924
+ },
17925
+ {
17926
+ id: "lb3",
17927
+ label: "Atom- und Kernphysik",
17928
+ hours: 14
17929
+ },
17930
+ {
17931
+ id: "lb4",
17932
+ label: "Energieversorgung",
17933
+ hours: 12
17934
+ }
17935
+ ],
17936
+ "realschule|10|physik|wpfg2-3": [
17937
+ {
17938
+ id: "lb1",
17939
+ label: "Mechanik",
17940
+ hours: 10
17941
+ },
17942
+ {
17943
+ id: "lb2",
17944
+ label: "Elektrizit\xE4tslehre",
17945
+ hours: 19
17946
+ },
17947
+ {
17948
+ id: "lb3",
17949
+ label: "Atom- und Kernphysik",
17950
+ hours: 7
17951
+ },
17952
+ {
17953
+ id: "lb4",
17954
+ label: "Energieversorgung",
17955
+ hours: 12
17956
+ }
17957
+ ],
17775
17958
  "realschule|10|musik": [
17776
17959
  {
17777
17960
  id: "lb1",
@@ -26424,6 +26607,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26424
26607
  "realschule|8|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/kunst/inhalt/fachlehrplaene",
26425
26608
  "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",
26426
26609
  "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",
26610
+ "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",
26611
+ "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",
26427
26612
  "realschule|8|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/musik/inhalt/fachlehrplaene",
26428
26613
  "realschule|8|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/or/inhalt/fachlehrplaene",
26429
26614
  "realschule|8|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26450,6 +26635,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26450
26635
  "realschule|9|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/kunst/inhalt/fachlehrplaene",
26451
26636
  "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",
26452
26637
  "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",
26638
+ "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",
26639
+ "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",
26453
26640
  "realschule|9|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/musik/inhalt/fachlehrplaene",
26454
26641
  "realschule|9|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/or/inhalt/fachlehrplaene",
26455
26642
  "realschule|9|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26475,6 +26662,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26475
26662
  "realschule|10|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/kunst/inhalt/fachlehrplaene",
26476
26663
  "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",
26477
26664
  "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",
26665
+ "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",
26666
+ "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",
26478
26667
  "realschule|10|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/musik/inhalt/fachlehrplaene",
26479
26668
  "realschule|10|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/or/inhalt/fachlehrplaene",
26480
26669
  "realschule|10|pug": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/pug/inhalt/fachlehrplaene",