zam-core 0.10.2 → 0.10.3

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.
@@ -6810,7 +6810,7 @@ var init_kernel = __esm({
6810
6810
  // src/cli/commands/mcp.ts
6811
6811
  init_kernel();
6812
6812
  import { existsSync as existsSync17, readFileSync as readFileSync15 } from "fs";
6813
- import { dirname as dirname7, join as join20 } from "path";
6813
+ import { dirname as dirname8, join as join21 } from "path";
6814
6814
  import { fileURLToPath as fileURLToPath4 } from "url";
6815
6815
  import {
6816
6816
  RESOURCE_MIME_TYPE,
@@ -9438,15 +9438,76 @@ async function updateCheck(params) {
9438
9438
  });
9439
9439
  }
9440
9440
 
9441
+ // src/cli/ui-intent.ts
9442
+ import { mkdir, readFile, rename, writeFile } from "fs/promises";
9443
+ import { homedir as homedir9 } from "os";
9444
+ import { dirname as dirname6, join as join14 } from "path";
9445
+ import { ulid as ulid9 } from "ulid";
9446
+ function getUiIntentPath(home = homedir9()) {
9447
+ return join14(home, ".zam", "ui-intent.json");
9448
+ }
9449
+ function getUiHostRegistrationPath(home = homedir9()) {
9450
+ return join14(home, ".zam", "vscode-host.json");
9451
+ }
9452
+ function compactStringInput(input) {
9453
+ return Object.fromEntries(
9454
+ Object.entries(input).filter(
9455
+ (entry) => typeof entry[1] === "string"
9456
+ )
9457
+ );
9458
+ }
9459
+ async function writeUiIntent(app, input = {}, opts = {}) {
9460
+ const path = opts.path ?? process.env.ZAM_UI_INTENT_PATH ?? getUiIntentPath();
9461
+ const id = opts.id ?? ulid9();
9462
+ const intent = {
9463
+ version: 1,
9464
+ id,
9465
+ app,
9466
+ input: compactStringInput(input),
9467
+ createdAt: (opts.now ?? (() => /* @__PURE__ */ new Date()))().toISOString()
9468
+ };
9469
+ const tempPath = join14(dirname6(path), `.ui-intent-${process.pid}-${id}.tmp`);
9470
+ await mkdir(dirname6(path), { recursive: true });
9471
+ await writeFile(tempPath, `${JSON.stringify(intent, null, 2)}
9472
+ `, "utf8");
9473
+ await rename(tempPath, path);
9474
+ return intent;
9475
+ }
9476
+ async function publishUiIntent(app, input = {}, opts = {}) {
9477
+ try {
9478
+ if (process.env.ZAM_DISABLE_UI_INTENT === "1") return void 0;
9479
+ const explicitPath = opts.path ?? process.env.ZAM_UI_INTENT_PATH;
9480
+ if (explicitPath) {
9481
+ return await writeUiIntent(app, input, { ...opts, path: explicitPath });
9482
+ }
9483
+ const now = (opts.now ?? (() => /* @__PURE__ */ new Date()))();
9484
+ const registrationPath = opts.hostRegistrationPath ?? getUiHostRegistrationPath();
9485
+ const registration = JSON.parse(
9486
+ await readFile(registrationPath, "utf8")
9487
+ );
9488
+ const updatedAt = Date.parse(registration.updatedAt ?? "");
9489
+ if (registration.version !== 1 || typeof registration.intentPath !== "string" || !Number.isFinite(updatedAt) || now.getTime() - updatedAt > 15e3) {
9490
+ return void 0;
9491
+ }
9492
+ return await writeUiIntent(app, input, {
9493
+ ...opts,
9494
+ path: registration.intentPath,
9495
+ now: () => now
9496
+ });
9497
+ } catch {
9498
+ return void 0;
9499
+ }
9500
+ }
9501
+
9441
9502
  // src/cli/commands/bridge.ts
9442
9503
  init_kernel();
9443
9504
  import { execFileSync as execFileSync3 } from "child_process";
9444
9505
  import { randomBytes as randomBytes2 } from "crypto";
9445
9506
  import { existsSync as existsSync16, readdirSync as readdirSync2, readFileSync as readFileSync14, rmSync as rmSync3 } from "fs";
9446
- import { homedir as homedir10, tmpdir as tmpdir3 } from "os";
9447
- import { join as join19, resolve as resolve4 } from "path";
9507
+ import { homedir as homedir11, tmpdir as tmpdir3 } from "os";
9508
+ import { join as join20, resolve as resolve4 } from "path";
9448
9509
  import { Command } from "commander";
9449
- import { ulid as ulid9 } from "ulid";
9510
+ import { ulid as ulid10 } from "ulid";
9450
9511
 
9451
9512
  // src/cli/adapters/source-reader.ts
9452
9513
  import dns from "dns";
@@ -9589,8 +9650,8 @@ async function readImageOCR(db, imagePath) {
9589
9650
  // src/cli/agent-harness.ts
9590
9651
  import { spawn as spawn2 } from "child_process";
9591
9652
  import { existsSync as existsSync14, readFileSync as readFileSync11 } from "fs";
9592
- import { homedir as homedir9 } from "os";
9593
- import { join as join15 } from "path";
9653
+ import { homedir as homedir10 } from "os";
9654
+ import { join as join16 } from "path";
9594
9655
 
9595
9656
  // src/cli/terminal-open.ts
9596
9657
  import { execFileSync as execFileSync2, execSync as execSync4 } from "child_process";
@@ -9602,7 +9663,7 @@ import {
9602
9663
  writeFileSync as writeFileSync7
9603
9664
  } from "fs";
9604
9665
  import { tmpdir } from "os";
9605
- import { basename as basename3, delimiter, extname, isAbsolute, join as join14 } from "path";
9666
+ import { basename as basename3, delimiter, extname, isAbsolute, join as join15 } from "path";
9606
9667
  function isPowerShellShell(shell) {
9607
9668
  return shell === "pwsh" || shell === "powershell";
9608
9669
  }
@@ -9675,7 +9736,7 @@ function findExecutable(command) {
9675
9736
  const pathEntries = (process.env.PATH ?? "").split(delimiter).map((entry) => entry.trim()).filter(Boolean);
9676
9737
  for (const entry of pathEntries) {
9677
9738
  for (const name of windowsExecutableNames(normalized)) {
9678
- const candidate = join14(entry, name);
9739
+ const candidate = join15(entry, name);
9679
9740
  if (executableExists(candidate)) matches.push(candidate);
9680
9741
  }
9681
9742
  }
@@ -9713,7 +9774,7 @@ end tell` : `tell application "Terminal"
9713
9774
  activate
9714
9775
  do script "${escaped}"
9715
9776
  end tell`;
9716
- const tmpFile = join14(tmpdir(), `zam-terminal-${label}.scpt`);
9777
+ const tmpFile = join15(tmpdir(), `zam-terminal-${label}.scpt`);
9717
9778
  try {
9718
9779
  writeFileSync7(tmpFile, appleScript);
9719
9780
  execSync4(`osascript ${JSON.stringify(tmpFile)}`, { stdio: "ignore" });
@@ -9794,6 +9855,18 @@ function openTerminalWindow(opts) {
9794
9855
  }
9795
9856
 
9796
9857
  // src/cli/agent-harness.ts
9858
+ var ANTIGRAVITY_IDE_CANDIDATE_PATHS = {
9859
+ darwin: [
9860
+ join16(
9861
+ homedir10(),
9862
+ ".antigravity-ide",
9863
+ "antigravity-ide",
9864
+ "bin",
9865
+ "antigravity-ide"
9866
+ ),
9867
+ "/Applications/Antigravity IDE.app/Contents/Resources/app/bin/antigravity-ide"
9868
+ ]
9869
+ };
9797
9870
  var AGENT_HARNESSES = [
9798
9871
  { id: "claude-code", label: "Claude Code", kind: "cli", command: "claude" },
9799
9872
  { id: "codex", label: "Codex", kind: "cli", command: "codex" },
@@ -9805,7 +9878,7 @@ var AGENT_HARNESSES = [
9805
9878
  command: "cursor",
9806
9879
  candidatePaths: {
9807
9880
  win32: [
9808
- join15(homedir9(), "AppData", "Local", "Programs", "cursor", "Cursor.exe")
9881
+ join16(homedir10(), "AppData", "Local", "Programs", "cursor", "Cursor.exe")
9809
9882
  ],
9810
9883
  darwin: ["/Applications/Cursor.app/Contents/MacOS/Cursor"]
9811
9884
  }
@@ -9815,19 +9888,41 @@ var AGENT_HARNESSES = [
9815
9888
  id: "antigravity",
9816
9889
  label: "Antigravity",
9817
9890
  kind: "app",
9818
- command: "antigravity"
9891
+ command: "antigravity",
9892
+ candidatePaths: {
9893
+ darwin: [
9894
+ ...ANTIGRAVITY_IDE_CANDIDATE_PATHS.darwin ?? [],
9895
+ "/Applications/Antigravity.app/Contents/MacOS/Antigravity"
9896
+ ]
9897
+ }
9819
9898
  },
9820
9899
  { id: "goose", label: "goose", kind: "cli", command: "goose" }
9821
9900
  ];
9822
9901
  function getHarness(id) {
9823
9902
  return AGENT_HARNESSES.find((h) => h.id === id);
9824
9903
  }
9904
+ function resolveAntigravityIdeExecutable(deps = {}) {
9905
+ const find = deps.find ?? findExecutable;
9906
+ const exists = deps.exists ?? existsSync14;
9907
+ const platform = deps.platform ?? process.platform;
9908
+ const found = find("antigravity-ide");
9909
+ if (found) return found;
9910
+ return ANTIGRAVITY_IDE_CANDIDATE_PATHS[platform]?.find((path) => exists(path)) ?? null;
9911
+ }
9825
9912
  function resolveHarnessExecutable(harness, overrideCommand, deps = {}) {
9826
9913
  const find = deps.find ?? findExecutable;
9827
9914
  const exists = deps.exists ?? existsSync14;
9828
9915
  const platform = deps.platform ?? process.platform;
9829
9916
  const found = find(overrideCommand || harness.command);
9830
9917
  if (found) return found;
9918
+ if (!overrideCommand && harness.id === "antigravity") {
9919
+ const foundIde = resolveAntigravityIdeExecutable({
9920
+ find,
9921
+ exists,
9922
+ platform
9923
+ });
9924
+ if (foundIde) return foundIde;
9925
+ }
9831
9926
  if (harness.kind === "app") {
9832
9927
  for (const candidate of harness.candidatePaths?.[platform] ?? []) {
9833
9928
  if (exists(candidate)) return candidate;
@@ -12540,7 +12635,7 @@ init_kernel();
12540
12635
  import { randomBytes } from "crypto";
12541
12636
  import { readFileSync as readFileSync12 } from "fs";
12542
12637
  import { tmpdir as tmpdir2 } from "os";
12543
- import { basename as basename4, join as join16 } from "path";
12638
+ import { basename as basename4, join as join17 } from "path";
12544
12639
  var LANGUAGE_NAMES2 = {
12545
12640
  en: "English",
12546
12641
  de: "German",
@@ -12578,7 +12673,7 @@ async function observeUiSnapshotViaLLM(db, input) {
12578
12673
  if (isVideo) {
12579
12674
  const { mkdirSync: mkdirSync12, readdirSync: readdirSync3, rmSync: rmSync4 } = await import("fs");
12580
12675
  const { execSync: execSync5 } = await import("child_process");
12581
- const tempDir = join16(
12676
+ const tempDir = join17(
12582
12677
  tmpdir2(),
12583
12678
  `zam-frames-${randomBytes(4).toString("hex")}`
12584
12679
  );
@@ -12611,7 +12706,7 @@ async function observeUiSnapshotViaLLM(db, input) {
12611
12706
  }
12612
12707
  }
12613
12708
  for (const file of sampledFiles) {
12614
- const bytes = readFileSync12(join16(tempDir, file));
12709
+ const bytes = readFileSync12(join17(tempDir, file));
12615
12710
  imageUrls.push(`data:image/png;base64,${bytes.toString("base64")}`);
12616
12711
  }
12617
12712
  } finally {
@@ -13096,27 +13191,27 @@ import {
13096
13191
  symlinkSync,
13097
13192
  writeFileSync as writeFileSync8
13098
13193
  } from "fs";
13099
- import { basename as basename5, dirname as dirname6, join as join17 } from "path";
13194
+ import { basename as basename5, dirname as dirname7, join as join18 } from "path";
13100
13195
  import { fileURLToPath as fileURLToPath3 } from "url";
13101
13196
  var packageRoot = [
13102
13197
  fileURLToPath3(new URL("../..", import.meta.url)),
13103
13198
  fileURLToPath3(new URL("../../..", import.meta.url))
13104
- ].find((candidate) => existsSync15(join17(candidate, "package.json"))) ?? fileURLToPath3(new URL("../..", import.meta.url));
13199
+ ].find((candidate) => existsSync15(join18(candidate, "package.json"))) ?? fileURLToPath3(new URL("../..", import.meta.url));
13105
13200
  var ALL_SETUP_AGENTS = ["claude", "copilot", "codex", "agent"];
13106
13201
  var SKILL_PAIRS = [
13107
13202
  {
13108
- from: join17(packageRoot, ".claude", "skills", "zam", "SKILL.md"),
13109
- to: join17(".claude", "skills", "zam", "SKILL.md"),
13203
+ from: join18(packageRoot, ".claude", "skills", "zam", "SKILL.md"),
13204
+ to: join18(".claude", "skills", "zam", "SKILL.md"),
13110
13205
  agents: ["claude", "copilot"]
13111
13206
  },
13112
13207
  {
13113
- from: join17(packageRoot, ".agent", "skills", "zam", "SKILL.md"),
13114
- to: join17(".agent", "skills", "zam", "SKILL.md"),
13208
+ from: join18(packageRoot, ".agent", "skills", "zam", "SKILL.md"),
13209
+ to: join18(".agent", "skills", "zam", "SKILL.md"),
13115
13210
  agents: ["agent"]
13116
13211
  },
13117
13212
  {
13118
- from: join17(packageRoot, ".agents", "skills", "zam", "SKILL.md"),
13119
- to: join17(".agents", "skills", "zam", "SKILL.md"),
13213
+ from: join18(packageRoot, ".agents", "skills", "zam", "SKILL.md"),
13214
+ to: join18(".agents", "skills", "zam", "SKILL.md"),
13120
13215
  agents: ["codex"]
13121
13216
  }
13122
13217
  ];
@@ -13176,7 +13271,7 @@ function linkPointsTo(sourceDir, destinationDir) {
13176
13271
  function isZamSkillCopy(destinationDir) {
13177
13272
  try {
13178
13273
  if (!lstatSync(destinationDir).isDirectory()) return false;
13179
- const skillFile = join17(destinationDir, "SKILL.md");
13274
+ const skillFile = join18(destinationDir, "SKILL.md");
13180
13275
  if (!existsSync15(skillFile)) return false;
13181
13276
  return /^name:\s*zam\s*$/m.test(readFileSync13(skillFile, "utf8"));
13182
13277
  } catch {
@@ -13201,9 +13296,9 @@ function wireSkills(cwd = process.cwd(), agents = parseSetupAgents(), opts = {})
13201
13296
  };
13202
13297
  for (const { from, to, agents: pairAgents } of SKILL_PAIRS) {
13203
13298
  if (!pairAgents.some((agent) => agents.has(agent))) continue;
13204
- const sourceDir = dirname6(from);
13205
- const destinationDir = dirname6(join17(cwd, to));
13206
- const label = dirname6(to);
13299
+ const sourceDir = dirname7(from);
13300
+ const destinationDir = dirname7(join18(cwd, to));
13301
+ const label = dirname7(to);
13207
13302
  const state = classifySkillDestination(sourceDir, destinationDir);
13208
13303
  if (state === "source-missing") {
13209
13304
  if (!opts.quiet) {
@@ -13260,7 +13355,7 @@ function wireSkills(cwd = process.cwd(), agents = parseSetupAgents(), opts = {})
13260
13355
  if (destinationExists) {
13261
13356
  rmSync2(destinationDir, { recursive: true, force: true });
13262
13357
  }
13263
- mkdirSync10(dirname6(destinationDir), { recursive: true });
13358
+ mkdirSync10(dirname7(destinationDir), { recursive: true });
13264
13359
  symlinkSync(
13265
13360
  sourceDir,
13266
13361
  destinationDir,
@@ -13276,8 +13371,8 @@ function inspectSkillLinks(cwd = process.cwd(), agents = parseSetupAgents()) {
13276
13371
  const results = [];
13277
13372
  for (const { from, to, agents: pairAgents } of SKILL_PAIRS) {
13278
13373
  if (!pairAgents.some((agent) => agents.has(agent))) continue;
13279
- const sourceDir = dirname6(from);
13280
- const destinationDir = dirname6(join17(cwd, to));
13374
+ const sourceDir = dirname7(from);
13375
+ const destinationDir = dirname7(join18(cwd, to));
13281
13376
  results.push({
13282
13377
  agents: pairAgents,
13283
13378
  source: sourceDir,
@@ -13322,12 +13417,12 @@ async function resolveUser(opts, db, resolveOpts) {
13322
13417
 
13323
13418
  // src/cli/workspaces/backup.ts
13324
13419
  import { mkdirSync as mkdirSync11 } from "fs";
13325
- import { join as join18 } from "path";
13420
+ import { join as join19 } from "path";
13326
13421
  async function backupDatabaseTo(db, targetDir) {
13327
- const backupDir = join18(targetDir, "zam-backups");
13422
+ const backupDir = join19(targetDir, "zam-backups");
13328
13423
  mkdirSync11(backupDir, { recursive: true });
13329
13424
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
13330
- const dest = join18(backupDir, `zam-${stamp}.db`);
13425
+ const dest = join19(backupDir, `zam-${stamp}.db`);
13331
13426
  await db.exec(`VACUUM INTO '${dest.replace(/'/g, "''")}'`);
13332
13427
  return dest;
13333
13428
  }
@@ -13458,7 +13553,7 @@ bridgeCommand.command("workspace-info").description("Report the workspace dir, i
13458
13553
  activeWorkspace,
13459
13554
  workspaceDir: activeWorkspace.path,
13460
13555
  defaultWorkspaceDir: defaultWorkspaceDir(),
13461
- dataDir: join19(homedir10(), ".zam")
13556
+ dataDir: join20(homedir11(), ".zam")
13462
13557
  });
13463
13558
  });
13464
13559
  });
@@ -13501,7 +13596,7 @@ bridgeCommand.command("workspace-list").description("List configured ZAM workspa
13501
13596
  activeWorkspace,
13502
13597
  workspaceDir: activeWorkspace.path,
13503
13598
  defaultWorkspaceDir: defaultWorkspaceDir(),
13504
- dataDir: join19(homedir10(), ".zam"),
13599
+ dataDir: join20(homedir11(), ".zam"),
13505
13600
  linkHealth: buildWorkspaceLinkHealth(workspaces)
13506
13601
  });
13507
13602
  });
@@ -13656,7 +13751,7 @@ bridgeCommand.command("agent-open").description("Launch an agent harness in the
13656
13751
  jsonError(`Workspace is not configured: ${opts.workspace}`);
13657
13752
  }
13658
13753
  const activeWorkspace = await ensureActiveWorkspace(db);
13659
- const workspace = opts.dir ? existsSync16(opts.dir) ? opts.dir : homedir10() : existingWorkspaceDirOrHome(configuredWorkspace ?? activeWorkspace);
13754
+ const workspace = opts.dir ? existsSync16(opts.dir) ? opts.dir : homedir11() : existingWorkspaceDirOrHome(configuredWorkspace ?? activeWorkspace);
13660
13755
  launchHarness(harness, {
13661
13756
  executable,
13662
13757
  workspace,
@@ -14028,7 +14123,7 @@ bridgeCommand.command("discover-skills").description(
14028
14123
  "20"
14029
14124
  ).action(async (opts) => {
14030
14125
  try {
14031
- const monitorDir = join19(homedir10(), ".zam", "monitor");
14126
+ const monitorDir = join20(homedir11(), ".zam", "monitor");
14032
14127
  let files;
14033
14128
  try {
14034
14129
  files = readdirSync2(monitorDir).filter((f) => f.endsWith(".jsonl"));
@@ -14041,7 +14136,7 @@ bridgeCommand.command("discover-skills").description(
14041
14136
  return;
14042
14137
  }
14043
14138
  const limit = Number(opts.limit);
14044
- const sorted = files.map((f) => ({ name: f, path: join19(monitorDir, f) })).sort((a, b) => b.name.localeCompare(a.name)).slice(0, limit);
14139
+ const sorted = files.map((f) => ({ name: f, path: join20(monitorDir, f) })).sort((a, b) => b.name.localeCompare(a.name)).slice(0, limit);
14045
14140
  const sessionCommands = /* @__PURE__ */ new Map();
14046
14141
  for (const file of sorted) {
14047
14142
  const sessionId = file.name.replace(".jsonl", "");
@@ -14543,7 +14638,7 @@ bridgeCommand.command("capture-ui").description("Capture a screenshot for agent-
14543
14638
  return;
14544
14639
  }
14545
14640
  }
14546
- const outputPath = opts.image ?? opts.output ?? join19(tmpdir3(), `zam-capture-${randomBytes2(4).toString("hex")}.png`);
14641
+ const outputPath = opts.image ?? opts.output ?? join20(tmpdir3(), `zam-capture-${randomBytes2(4).toString("hex")}.png`);
14547
14642
  const captureResult = isProvided ? { method: "provided", target: null } : captureScreenshot(outputPath, opts.hwnd, opts.processName);
14548
14643
  if (!isProvided) {
14549
14644
  const post = decidePostCapture(policy, {
@@ -14598,9 +14693,9 @@ bridgeCommand.command("start-recording").description("Start screen recording in
14598
14693
  return;
14599
14694
  }
14600
14695
  const sessionId = opts.session;
14601
- const statePath = join19(tmpdir3(), `zam-recording-${sessionId}.json`);
14696
+ const statePath = join20(tmpdir3(), `zam-recording-${sessionId}.json`);
14602
14697
  const defaultExt = platform === "win32" ? ".mkv" : ".mov";
14603
- const outputPath = opts.output ?? join19(tmpdir3(), `zam-recording-${sessionId}${defaultExt}`);
14698
+ const outputPath = opts.output ?? join20(tmpdir3(), `zam-recording-${sessionId}${defaultExt}`);
14604
14699
  const { existsSync: existsSync18, writeFileSync: writeFileSync9, openSync, closeSync } = await import("fs");
14605
14700
  if (existsSync18(statePath)) {
14606
14701
  jsonOut({
@@ -14610,7 +14705,7 @@ bridgeCommand.command("start-recording").description("Start screen recording in
14610
14705
  });
14611
14706
  return;
14612
14707
  }
14613
- const logPath = join19(tmpdir3(), `zam-recording-${sessionId}.log`);
14708
+ const logPath = join20(tmpdir3(), `zam-recording-${sessionId}.log`);
14614
14709
  let logFd;
14615
14710
  try {
14616
14711
  logFd = openSync(logPath, "w");
@@ -14692,7 +14787,7 @@ bridgeCommand.command("stop-recording").description(
14692
14787
  return;
14693
14788
  }
14694
14789
  const sessionId = opts.session;
14695
- const statePath = join19(tmpdir3(), `zam-recording-${sessionId}.json`);
14790
+ const statePath = join20(tmpdir3(), `zam-recording-${sessionId}.json`);
14696
14791
  const { existsSync: existsSync18, readFileSync: readFileSync16, rmSync: rmSync4 } = await import("fs");
14697
14792
  if (!existsSync18(statePath)) {
14698
14793
  jsonOut({
@@ -15757,7 +15852,7 @@ bridgeCommand.command("personal-source-import").description(
15757
15852
  } else {
15758
15853
  throw new Error(`Invalid source type: ${opts.type}`);
15759
15854
  }
15760
- const sourceId = ulid9();
15855
+ const sourceId = ulid10();
15761
15856
  await db.prepare(
15762
15857
  `INSERT INTO sources (id, type, uri, content)
15763
15858
  VALUES (?, ?, ?, ?)
@@ -15976,7 +16071,7 @@ bridgeCommand.command("curriculum-extract-topics").description(
15976
16071
  }
15977
16072
  }
15978
16073
  const pageCleanedText = cleanHtml(rawHtml);
15979
- const sourceId = ulid9();
16074
+ const sourceId = ulid10();
15980
16075
  await db.prepare(
15981
16076
  `INSERT INTO sources (id, type, uri, content)
15982
16077
  VALUES (?, 'web', ?, ?)
@@ -16241,10 +16336,10 @@ bridgeCommand.command("serve").description("Start the persistent JSON-RPC stdin/
16241
16336
  });
16242
16337
 
16243
16338
  // src/cli/commands/mcp.ts
16244
- var __dirname = dirname7(fileURLToPath4(import.meta.url));
16245
- var pkgPath = join20(__dirname, "..", "..", "package.json");
16339
+ var __dirname = dirname8(fileURLToPath4(import.meta.url));
16340
+ var pkgPath = join21(__dirname, "..", "..", "package.json");
16246
16341
  if (!existsSync17(pkgPath)) {
16247
- pkgPath = join20(__dirname, "..", "..", "..", "package.json");
16342
+ pkgPath = join21(__dirname, "..", "..", "..", "package.json");
16248
16343
  }
16249
16344
  var pkg = JSON.parse(readFileSync15(pkgPath, "utf-8"));
16250
16345
  var STUDIO_RESOURCE_URI = "ui://zam/studio";
@@ -16271,9 +16366,9 @@ var STUDIO_BRIDGE_ALLOWED_COMMANDS = /* @__PURE__ */ new Set([
16271
16366
  function loadPanelHtml(fileName, placeholderTitle) {
16272
16367
  const candidates = [
16273
16368
  // dist/cli/commands/mcp.js → dist/ui/
16274
- join20(__dirname, "..", "..", "ui", fileName),
16369
+ join21(__dirname, "..", "..", "ui", fileName),
16275
16370
  // src/cli/commands/mcp.ts via tsx → <repo>/dist/ui/
16276
- join20(__dirname, "..", "..", "..", "dist", "ui", fileName)
16371
+ join21(__dirname, "..", "..", "..", "dist", "ui", fileName)
16277
16372
  ];
16278
16373
  for (const candidate of candidates) {
16279
16374
  if (existsSync17(candidate)) {
@@ -16672,7 +16767,7 @@ function createMcpServer(db) {
16672
16767
  "zam_open_studio",
16673
16768
  {
16674
16769
  title: "ZAM Studio",
16675
- description: "Open the ZAM Studio panel (content editor, knowledge graph, settings) inline",
16770
+ description: "Open the legacy all-in-one ZAM Studio panel for standalone onboarding and content curation. Agent harness workflows should use the focused Recall, Graph, and Settings apps instead.",
16676
16771
  inputSchema: {},
16677
16772
  annotations: {
16678
16773
  ...commonAnnotations,
@@ -16727,6 +16822,7 @@ function createMcpServer(db) {
16727
16822
  wrapHandler(
16728
16823
  async ({ user, domain }) => {
16729
16824
  const userId = await getUserId(user).catch(() => null);
16825
+ await publishUiIntent("recall", { user, domain });
16730
16826
  return {
16731
16827
  recall: "zam",
16732
16828
  version: pkg.version,
@@ -16771,6 +16867,7 @@ function createMcpServer(db) {
16771
16867
  },
16772
16868
  wrapHandler(async ({ focus, user }) => {
16773
16869
  const userId = await getUserId(user).catch(() => null);
16870
+ await publishUiIntent("graph", { user, focus });
16774
16871
  return {
16775
16872
  graph: "zam",
16776
16873
  focus: focus ?? null,
@@ -16812,6 +16909,7 @@ function createMcpServer(db) {
16812
16909
  },
16813
16910
  wrapHandler(async ({ user }) => {
16814
16911
  const userId = await getUserId(user).catch(() => null);
16912
+ await publishUiIntent("settings", { user });
16815
16913
  return {
16816
16914
  settings: "zam",
16817
16915
  version: pkg.version,