@zixt/host 0.0.164 → 0.0.165

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.
Files changed (2) hide show
  1. package/dist/index.js +49 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import { homedir as homedir6 } from "node:os";
28
28
  // package.json
29
29
  var package_default = {
30
30
  name: "@zixt/host",
31
- version: "0.0.164",
31
+ version: "0.0.165",
32
32
  type: "module",
33
33
  exports: {
34
34
  ".": "./src/client.ts",
@@ -33272,6 +33272,18 @@ function createBrowserToolPack(deps) {
33272
33272
  provider: "browser",
33273
33273
  version: 1,
33274
33274
  tools: BROWSER_TOOL_DEFINITIONS,
33275
+ // These narrate their own execution above; the runner's line would be a
33276
+ // duplicate — the customer read "Opened a page in the browser" and then
33277
+ // the same step again as a bare URL (QA-007).
33278
+ narratedTools: [
33279
+ "browser_navigate",
33280
+ "browser_open_tab",
33281
+ "browser_switch_tab",
33282
+ "browser_close_tab",
33283
+ "browser_click",
33284
+ "browser_type",
33285
+ "browser_login"
33286
+ ],
33275
33287
  call,
33276
33288
  currentSignInWall: () => signInWall ? { origin: signInWall.origin } : null,
33277
33289
  async close() {
@@ -43019,7 +43031,8 @@ function createCliRunner(adapter, opts = {}) {
43019
43031
  alwaysLoad: server.alwaysLoad,
43020
43032
  narrated: server.narrated
43021
43033
  }))
43022
- )
43034
+ ),
43035
+ narratedTools: toolPacks.filter((pack) => !pack.mcpServers).flatMap((pack) => [...pack.narratedTools ?? []])
43023
43036
  },
43024
43037
  preparedWorkspace,
43025
43038
  gitDetected,
@@ -43845,8 +43858,8 @@ import { homedir as homedir10 } from "node:os";
43845
43858
  import { dirname as dirname10, join as join23 } from "node:path";
43846
43859
 
43847
43860
  // src/runners/feed-labels.ts
43848
- var SENTENCE_KEYS = ["title", "question", "description", "url", "query"];
43849
- var LOCATOR_KEYS = ["file_path", "path", "pattern", "name"];
43861
+ var SENTENCE_KEYS = ["title", "question", "description", "query"];
43862
+ var LOCATOR_KEYS = ["file_path", "path", "pattern", "name", "url"];
43850
43863
  function capLine(text, max = 100) {
43851
43864
  if (text.length <= max) return text;
43852
43865
  const cut = text.slice(0, max - 1);
@@ -43854,7 +43867,7 @@ function capLine(text, max = 100) {
43854
43867
  return `${(space > max * 0.6 ? cut.slice(0, space) : cut).trimEnd()}\u2026`;
43855
43868
  }
43856
43869
  function tidyPath(text) {
43857
- return text.replace(/[A-Za-z]:[\\/]Users[\\/][^\\/\s"']+/g, "~").replace(/\/(?:home|Users)\/[^\\/\s"']+/g, "~");
43870
+ return text.replace(/\\\\/g, "\\").replace(/[A-Za-z]:[\\/]Users[\\/][^\\/\s"']+/g, "~").replace(/\/(?:home|Users)\/[^\\/\s"']+/g, "~");
43858
43871
  }
43859
43872
  var FILE_SUFFIX = /^(?:js|cjs|mjs|ts|tsx|py|sh|ps1|exe|cmd|bat|json|md|txt)$/i;
43860
43873
  function humanToolName(tool) {
@@ -43978,6 +43991,7 @@ function createCodexAdapter(threadIndexRoot, providerSessionStateRoot2) {
43978
43991
  flags.push("-c", "mcp_servers.zixt.tool_timeout_sec=86400");
43979
43992
  const taken = /* @__PURE__ */ new Set(["zixt"]);
43980
43993
  const narratedServers = /* @__PURE__ */ new Set();
43994
+ const narratedTools = new Set(mcp.narratedTools);
43981
43995
  for (const server of mcp.localServers) {
43982
43996
  const key = serverKeyFor(server.name, taken);
43983
43997
  if (server.narrated) narratedServers.add(key);
@@ -44075,8 +44089,13 @@ ${value}` : value;
44075
44089
  ...runner.effort ? { effort: runner.effort } : {},
44076
44090
  developerInstructions: platformInstructions ?? "",
44077
44091
  onThreadStarted,
44078
- narratedServers
44079
- }) : createCodexStreamParser(onStream, { onThreadStarted, narratedServers });
44092
+ narratedServers,
44093
+ narratedTools
44094
+ }) : createCodexStreamParser(onStream, {
44095
+ onThreadStarted,
44096
+ narratedServers,
44097
+ narratedTools
44098
+ });
44080
44099
  },
44081
44100
  // Only one flip is meaningful: a resume whose rollout vanished starts
44082
44101
  // over. Codex assigns new-session ids itself, so a new session can
@@ -44188,8 +44207,10 @@ function createCodexAppServerParser(onStream, options) {
44188
44207
  }
44189
44208
  if (type === "mcpToolCall") {
44190
44209
  const server = String(item["server"] ?? "mcp");
44210
+ const toolName = String(item["tool"] ?? "tool");
44191
44211
  if (options.narratedServers?.has(server)) return;
44192
- const tool = `${server}.${String(item["tool"] ?? "tool")}`.slice(0, 200);
44212
+ if (server === "zixt" && options.narratedTools?.has(toolName)) return;
44213
+ const tool = `${server}.${toolName}`.slice(0, 200);
44193
44214
  const args = item["arguments"];
44194
44215
  const parameter = (typeof args === "string" ? args : args ? JSON.stringify(args) : "").slice(
44195
44216
  0,
@@ -44413,8 +44434,10 @@ function createCodexStreamParser(onStream, hooks = {}) {
44413
44434
  });
44414
44435
  } else if (phase === "item.started" && itemType === "mcp_tool_call") {
44415
44436
  const server = String(item["server"] ?? "mcp");
44437
+ const toolName = String(item["tool"] ?? "tool");
44416
44438
  if (hooks.narratedServers?.has(server)) return;
44417
- const tool = `${server}.${String(item["tool"] ?? "tool")}`.slice(0, 200);
44439
+ if (server === "zixt" && hooks.narratedTools?.has(toolName)) return;
44440
+ const tool = `${server}.${toolName}`.slice(0, 200);
44418
44441
  const args = item["arguments"];
44419
44442
  const parameter = (typeof args === "string" ? args : args ? JSON.stringify(args) : "").slice(
44420
44443
  0,
@@ -46243,7 +46266,11 @@ function createClaudeCodeAdapter(providerSessionStateRoot2) {
46243
46266
  missingApiKeyMessage: 'Runner auth is set to "API key" but no ANTHROPIC_API_KEY Credential is granted to this Task. Add it in Project settings \u2192 Credentials for the whole Project or selected AI teammates.',
46244
46267
  async prepareRun(input) {
46245
46268
  const liveInput = input.liveInput && input.task.followUps !== void 0;
46246
- const { args: baseArgs, narratedServers } = await buildArgs(
46269
+ const {
46270
+ args: baseArgs,
46271
+ narratedServers,
46272
+ narratedTools
46273
+ } = await buildArgs(
46247
46274
  input.task,
46248
46275
  input.runner,
46249
46276
  input.artifacts,
@@ -46279,7 +46306,11 @@ function createClaudeCodeAdapter(providerSessionStateRoot2) {
46279
46306
  ],
46280
46307
  prompt: buildRunnerPrompt(input.task),
46281
46308
  recoveryPrompt: buildRunnerPrompt(input.task, true),
46282
- createParser: (onStream) => liveInput ? createClaudeLiveParser(onStream, observeRuntime, narratedServers) : createStreamParser(onStream, { onSessionModel: observeRuntime, narratedServers }),
46309
+ createParser: (onStream) => liveInput ? createClaudeLiveParser(onStream, observeRuntime, narratedServers, narratedTools) : createStreamParser(onStream, {
46310
+ onSessionModel: observeRuntime,
46311
+ narratedServers,
46312
+ narratedTools
46313
+ }),
46283
46314
  // Self-heal both directions: a crashed first run leaves a transcript
46284
46315
  // (new → conflict), a lost workspace breaks resume (resume → not
46285
46316
  // found). One flip covers both.
@@ -46356,6 +46387,7 @@ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRo
46356
46387
  const allowedTools = ["mcp__zixt"];
46357
46388
  const taken = /* @__PURE__ */ new Set(["zixt"]);
46358
46389
  const narratedServers = /* @__PURE__ */ new Set();
46390
+ const narratedTools = new Set(mcp.narratedTools);
46359
46391
  for (const server of mcp.localServers) {
46360
46392
  const key = serverKeyFor(server.name, taken);
46361
46393
  if (server.narrated) narratedServers.add(key);
@@ -46379,9 +46411,9 @@ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRo
46379
46411
  "--disallowedTools",
46380
46412
  [...CLAUDE_SESSION_CRON_TOOLS, ...CLAUDE_REINVOCATION_TOOLS].join(",")
46381
46413
  );
46382
- return { args, narratedServers };
46414
+ return { args, narratedServers, narratedTools };
46383
46415
  }
46384
- function createClaudeLiveParser(onStream, onSessionModel, narratedServers) {
46416
+ function createClaudeLiveParser(onStream, onSessionModel, narratedServers, narratedTools) {
46385
46417
  let write = null;
46386
46418
  const acknowledgements = /* @__PURE__ */ new Map();
46387
46419
  const input = (uuid3, text) => `${JSON.stringify({
@@ -46394,6 +46426,7 @@ function createClaudeLiveParser(onStream, onSessionModel, narratedServers) {
46394
46426
  const parser = createStreamParser(onStream, {
46395
46427
  onSessionModel,
46396
46428
  ...narratedServers ? { narratedServers } : {},
46429
+ ...narratedTools ? { narratedTools } : {},
46397
46430
  onUserReplay: (uuid3) => {
46398
46431
  const acknowledge = acknowledgements.get(uuid3);
46399
46432
  if (!acknowledge) return;
@@ -46469,8 +46502,9 @@ function createStreamParser(onStream, hooks = {}) {
46469
46502
  const input = block["input"];
46470
46503
  const target = input?.["description"] ?? input?.["command"] ?? input?.["pattern"] ?? input?.["file_path"] ?? (typeof input?.["question"] === "string" ? input["question"] : void 0) ?? "";
46471
46504
  const tool = String(block["name"]).slice(0, 200);
46472
- const mcpServer = /^mcp__([\w-]+?)__/.exec(tool)?.[1];
46473
- if (mcpServer && hooks.narratedServers?.has(mcpServer)) continue;
46505
+ const mcpParts = /^mcp__([\w-]+?)__([\w-]+)$/.exec(tool);
46506
+ if (mcpParts && hooks.narratedServers?.has(mcpParts[1])) continue;
46507
+ if (mcpParts?.[1] === "zixt" && hooks.narratedTools?.has(mcpParts[2])) continue;
46474
46508
  const parameter = String(target).slice(0, 2e3);
46475
46509
  const localPath = typeof input?.["file_path"] === "string" ? input["file_path"] : null;
46476
46510
  const label = typeof input?.["command"] === "string" && input["command"].trim() ? shellCommandLabel(input["command"]) : toolCallLabel(tool, input ?? {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.164",
3
+ "version": "0.0.165",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",