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.
@@ -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.8"
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,21 @@ function connectHarnessMcp(harnessId, opts) {
10418
10418
  if (!existing.mcpServers) {
10419
10419
  existing.mcpServers = {};
10420
10420
  }
10421
- existing.mcpServers.zam = {
10421
+ const expected = opts.zamPath.endsWith(".js") ? {
10422
+ command: process.execPath,
10423
+ args: [opts.zamPath, "mcp"]
10424
+ } : {
10422
10425
  command: opts.zamPath,
10423
10426
  args: ["mcp"]
10424
10427
  };
10428
+ const current = existing.mcpServers.zam;
10429
+ if (typeof current === "object" && current !== null && !Array.isArray(current)) {
10430
+ const c = current;
10431
+ if (c.command === expected.command && JSON.stringify(c.args) === JSON.stringify(expected.args)) {
10432
+ alreadyConfigured = true;
10433
+ }
10434
+ }
10435
+ existing.mcpServers.zam = expected;
10425
10436
  return JSON.stringify(existing, null, 2);
10426
10437
  };
10427
10438
  if (harnessId === "claude-code") {
@@ -10448,18 +10459,7 @@ function connectHarnessMcp(harnessId, opts) {
10448
10459
  } else if (harnessId === "antigravity") {
10449
10460
  targetPath = join16(opts.home, ".gemini", "config", "mcp_config.json");
10450
10461
  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.";
10451
- let existing = {};
10452
- if (exists(targetPath)) {
10453
- existing = parseMcpJsonConfig(targetPath, read(targetPath));
10454
- }
10455
- if (!existing.mcpServers) {
10456
- existing.mcpServers = {};
10457
- }
10458
- existing.mcpServers.zam = {
10459
- command: opts.zamPath,
10460
- args: ["mcp"]
10461
- };
10462
- content = JSON.stringify(existing, null, 2);
10462
+ content = mergeMcpServersJson(targetPath);
10463
10463
  } else if (harnessId === "opencode") {
10464
10464
  targetPath = join16(opts.home, ".config", "opencode", "opencode.json");
10465
10465
  hint = "OpenCode will load the enabled 'zam' MCP server on next launch.";
@@ -10472,11 +10472,20 @@ function connectHarnessMcp(harnessId, opts) {
10472
10472
  throw new Error(`Cannot update ${targetPath}: mcp must be a JSON object`);
10473
10473
  }
10474
10474
  const servers = mcp ?? {};
10475
- servers.zam = {
10475
+ const cmd = opts.zamPath.endsWith(".js") ? [process.execPath, opts.zamPath, "mcp"] : [opts.zamPath, "mcp"];
10476
+ const expected = {
10476
10477
  type: "local",
10477
- command: [opts.zamPath, "mcp"],
10478
+ command: cmd,
10478
10479
  enabled: true
10479
10480
  };
10481
+ const current = servers.zam;
10482
+ if (typeof current === "object" && current !== null && !Array.isArray(current)) {
10483
+ const c = current;
10484
+ if (c.type === expected.type && c.enabled === expected.enabled && JSON.stringify(c.command) === JSON.stringify(expected.command)) {
10485
+ alreadyConfigured = true;
10486
+ }
10487
+ }
10488
+ servers.zam = expected;
10480
10489
  existing.mcp = servers;
10481
10490
  content = JSON.stringify(existing, null, 2);
10482
10491
  } else if (harnessId === "codex") {
@@ -10490,10 +10499,13 @@ function connectHarnessMcp(harnessId, opts) {
10490
10499
  alreadyConfigured = true;
10491
10500
  content = existingStr;
10492
10501
  } else {
10502
+ const isJs = opts.zamPath.endsWith(".js");
10503
+ const cmdStr = isJs ? JSON.stringify(process.execPath) : JSON.stringify(opts.zamPath);
10504
+ const argsStr = isJs ? `[${JSON.stringify(opts.zamPath)}, "mcp"]` : '["mcp"]';
10493
10505
  const block = `
10494
10506
  [mcp_servers.zam]
10495
- command = ${JSON.stringify(opts.zamPath)}
10496
- args = ["mcp"]
10507
+ command = ${cmdStr}
10508
+ args = ${argsStr}
10497
10509
  default_tools_approval_mode = "approve"
10498
10510
 
10499
10511
  [mcp_servers.zam.tools.zam_review_action]
@@ -10526,7 +10538,7 @@ ${block}` : block;
10526
10538
  throw new Error(`Cannot update ${targetPath}: inputs must be an array`);
10527
10539
  }
10528
10540
  if (!existing.servers) existing.servers = {};
10529
- const expectedServer = { command: opts.zamPath, args: ["mcp"] };
10541
+ const expectedServer = opts.zamPath.endsWith(".js") ? { command: process.execPath, args: [opts.zamPath, "mcp"] } : { command: opts.zamPath, args: ["mcp"] };
10530
10542
  const currentServer = existing.servers.zam;
10531
10543
  alreadyConfigured = Array.isArray(existing.inputs) && typeof currentServer === "object" && currentServer !== null && !Array.isArray(currentServer) && JSON.stringify(currentServer) === JSON.stringify(expectedServer);
10532
10544
  existing.servers.zam = expectedServer;
@@ -10535,12 +10547,14 @@ ${block}` : block;
10535
10547
  } else if (harnessId === "goose") {
10536
10548
  targetPath = join16(opts.home, ".config", "goose", "config.yaml");
10537
10549
  hint = "goose will load the 'zam' extension on next session start. Run 'goose configure' to manage extensions.";
10550
+ const isJs = opts.zamPath.endsWith(".js");
10551
+ const cmdStr = isJs ? process.execPath : opts.zamPath;
10552
+ const argsLines = isJs ? [" args:", ` - ${opts.zamPath}`, " - mcp"] : [" args:", " - mcp"];
10538
10553
  const zamExtension = [
10539
10554
  " zam:",
10540
10555
  " name: ZAM",
10541
- ` cmd: ${opts.zamPath}`,
10542
- " args:",
10543
- " - mcp",
10556
+ ` cmd: ${cmdStr}`,
10557
+ ...argsLines,
10544
10558
  " enabled: true",
10545
10559
  " type: stdio",
10546
10560
  " timeout: 300",
@@ -10582,12 +10596,25 @@ ${zamExtension}
10582
10596
  if (!existing.mcpServers) {
10583
10597
  existing.mcpServers = {};
10584
10598
  }
10585
- existing.mcpServers.zam = {
10599
+ const expected = opts.zamPath.endsWith(".js") ? {
10600
+ type: "local",
10601
+ command: process.execPath,
10602
+ args: [opts.zamPath, "mcp"],
10603
+ tools: ["*"]
10604
+ } : {
10586
10605
  type: "local",
10587
10606
  command: opts.zamPath,
10588
10607
  args: ["mcp"],
10589
10608
  tools: ["*"]
10590
10609
  };
10610
+ const current = existing.mcpServers.zam;
10611
+ if (typeof current === "object" && current !== null && !Array.isArray(current)) {
10612
+ const c = current;
10613
+ 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)) {
10614
+ alreadyConfigured = true;
10615
+ }
10616
+ }
10617
+ existing.mcpServers.zam = expected;
10591
10618
  content = JSON.stringify(existing, null, 2);
10592
10619
  }
10593
10620
  return {
@@ -10864,7 +10891,14 @@ function resolveDeps(deps) {
10864
10891
  home,
10865
10892
  cwd,
10866
10893
  copilotHome,
10867
- findZam: deps.findZam ?? (() => findExecutable("zam")),
10894
+ findZam: deps.findZam ?? (() => {
10895
+ const globalZam = findExecutable("zam");
10896
+ if (globalZam) return globalZam;
10897
+ if (process.argv[1] && process.argv[1].endsWith("index.js")) {
10898
+ return process.argv[1];
10899
+ }
10900
+ return null;
10901
+ }),
10868
10902
  detect: deps.detect ?? (() => detectInstalledConnectHarnesses({ home, copilotHome })),
10869
10903
  connectMcp: deps.connectMcp ?? connectHarnessMcp,
10870
10904
  writeConfig: deps.writeConfig ?? ((path, content) => {
@@ -13298,6 +13332,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13298
13332
  label: "Mathematik 8 (II/III)"
13299
13333
  }
13300
13334
  ],
13335
+ "realschule|8|physik": [
13336
+ {
13337
+ id: "wpfg1",
13338
+ label: "Physik 8 (I)"
13339
+ },
13340
+ {
13341
+ id: "wpfg2-3",
13342
+ label: "Physik 8 (II/III)"
13343
+ }
13344
+ ],
13301
13345
  "realschule|8|sport": [
13302
13346
  {
13303
13347
  id: "basis_sport",
@@ -13318,6 +13362,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13318
13362
  label: "Mathematik 9 (II/III)"
13319
13363
  }
13320
13364
  ],
13365
+ "realschule|9|physik": [
13366
+ {
13367
+ id: "wpfg1",
13368
+ label: "Physik 9 (I)"
13369
+ },
13370
+ {
13371
+ id: "wpfg2-3",
13372
+ label: "Physik 9 (II/III)"
13373
+ }
13374
+ ],
13321
13375
  "realschule|9|sport": [
13322
13376
  {
13323
13377
  id: "basis_sport",
@@ -13338,6 +13392,16 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
13338
13392
  label: "Mathematik 10 (II/III)"
13339
13393
  }
13340
13394
  ],
13395
+ "realschule|10|physik": [
13396
+ {
13397
+ id: "wpfg1",
13398
+ label: "Physik 10 (I)"
13399
+ },
13400
+ {
13401
+ id: "wpfg2-3",
13402
+ label: "Physik 10 (II/III)"
13403
+ }
13404
+ ],
13341
13405
  "realschule|10|sport": [
13342
13406
  {
13343
13407
  id: "basis_sport",
@@ -16350,6 +16414,45 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
16350
16414
  hours: 8
16351
16415
  }
16352
16416
  ],
16417
+ "realschule|8|physik|wpfg1": [
16418
+ {
16419
+ id: "lb1",
16420
+ label: "Mechanik und Energie",
16421
+ hours: 20
16422
+ },
16423
+ {
16424
+ id: "lb2",
16425
+ label: "W\xE4rmelehre",
16426
+ hours: 15
16427
+ },
16428
+ {
16429
+ id: "lb3",
16430
+ label: "Elektrizit\xE4tslehre",
16431
+ hours: 15
16432
+ },
16433
+ {
16434
+ id: "lb4",
16435
+ label: "Wahlbereich: Astronomie oder Akustik",
16436
+ hours: 6
16437
+ }
16438
+ ],
16439
+ "realschule|8|physik|wpfg2-3": [
16440
+ {
16441
+ id: "lb1",
16442
+ label: "Mechanik",
16443
+ hours: 22
16444
+ },
16445
+ {
16446
+ id: "lb2",
16447
+ label: "Optik",
16448
+ hours: 14
16449
+ },
16450
+ {
16451
+ id: "lb3",
16452
+ label: "Magnetismus und Elektrizit\xE4tslehre",
16453
+ hours: 20
16454
+ }
16455
+ ],
16353
16456
  "realschule|8|musik": [
16354
16457
  {
16355
16458
  id: "lb1",
@@ -17114,6 +17217,40 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
17114
17217
  hours: 9
17115
17218
  }
17116
17219
  ],
17220
+ "realschule|9|physik|wpfg1": [
17221
+ {
17222
+ id: "lb1",
17223
+ label: "Mechanik von Fl\xFCssigkeiten und Gasen",
17224
+ hours: 18
17225
+ },
17226
+ {
17227
+ id: "lb2",
17228
+ label: "W\xE4rmelehre",
17229
+ hours: 28
17230
+ },
17231
+ {
17232
+ id: "lb3",
17233
+ label: "Elektrizit\xE4tslehre",
17234
+ hours: 38
17235
+ }
17236
+ ],
17237
+ "realschule|9|physik|wpfg2-3": [
17238
+ {
17239
+ id: "lb1",
17240
+ label: "Mechanik und Energie",
17241
+ hours: 22
17242
+ },
17243
+ {
17244
+ id: "lb2",
17245
+ label: "W\xE4rmelehre",
17246
+ hours: 15
17247
+ },
17248
+ {
17249
+ id: "lb3",
17250
+ label: "Elektrizit\xE4tslehre",
17251
+ hours: 19
17252
+ }
17253
+ ],
17117
17254
  "realschule|9|musik": [
17118
17255
  {
17119
17256
  id: "lb1",
@@ -17772,6 +17909,50 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
17772
17909
  hours: 10
17773
17910
  }
17774
17911
  ],
17912
+ "realschule|10|physik|wpfg1": [
17913
+ {
17914
+ id: "lb1",
17915
+ label: "Mechanik",
17916
+ hours: 17
17917
+ },
17918
+ {
17919
+ id: "lb2",
17920
+ label: "Elektrizit\xE4tslehre",
17921
+ hours: 29
17922
+ },
17923
+ {
17924
+ id: "lb3",
17925
+ label: "Atom- und Kernphysik",
17926
+ hours: 14
17927
+ },
17928
+ {
17929
+ id: "lb4",
17930
+ label: "Energieversorgung",
17931
+ hours: 12
17932
+ }
17933
+ ],
17934
+ "realschule|10|physik|wpfg2-3": [
17935
+ {
17936
+ id: "lb1",
17937
+ label: "Mechanik",
17938
+ hours: 10
17939
+ },
17940
+ {
17941
+ id: "lb2",
17942
+ label: "Elektrizit\xE4tslehre",
17943
+ hours: 19
17944
+ },
17945
+ {
17946
+ id: "lb3",
17947
+ label: "Atom- und Kernphysik",
17948
+ hours: 7
17949
+ },
17950
+ {
17951
+ id: "lb4",
17952
+ label: "Energieversorgung",
17953
+ hours: 12
17954
+ }
17955
+ ],
17775
17956
  "realschule|10|musik": [
17776
17957
  {
17777
17958
  id: "lb1",
@@ -26424,6 +26605,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26424
26605
  "realschule|8|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/kunst/inhalt/fachlehrplaene",
26425
26606
  "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
26607
  "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",
26608
+ "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",
26609
+ "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
26610
  "realschule|8|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/musik/inhalt/fachlehrplaene",
26428
26611
  "realschule|8|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/or/inhalt/fachlehrplaene",
26429
26612
  "realschule|8|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/8/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26450,6 +26633,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26450
26633
  "realschule|9|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/kunst/inhalt/fachlehrplaene",
26451
26634
  "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
26635
  "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",
26636
+ "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",
26637
+ "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
26638
  "realschule|9|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/musik/inhalt/fachlehrplaene",
26454
26639
  "realschule|9|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/or/inhalt/fachlehrplaene",
26455
26640
  "realschule|9|soziallehre": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/9/fach/soziallehre/inhalt/fachlehrplaene",
@@ -26475,6 +26660,8 @@ var LEHRPLANPLUS_BAYERN_MANIFEST = {
26475
26660
  "realschule|10|kunst": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/kunst/inhalt/fachlehrplaene",
26476
26661
  "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
26662
  "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",
26663
+ "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",
26664
+ "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
26665
  "realschule|10|musik": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/musik/inhalt/fachlehrplaene",
26479
26666
  "realschule|10|or": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/or/inhalt/fachlehrplaene",
26480
26667
  "realschule|10|pug": "https://www.lehrplanplus.bayern.de/schulart/realschule/jgs/10/fach/pug/inhalt/fachlehrplaene",