@zixt/host 0.0.160 → 0.0.161

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 +35 -17
  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.160",
31
+ version: "0.0.161",
32
32
  type: "module",
33
33
  exports: {
34
34
  ".": "./src/client.ts",
@@ -43795,6 +43795,36 @@ import { readFile as readFile13 } from "node:fs/promises";
43795
43795
  import { randomUUID as randomUUID15 } from "node:crypto";
43796
43796
  import { homedir as homedir10 } from "node:os";
43797
43797
  import { dirname as dirname10, join as join23 } from "node:path";
43798
+
43799
+ // src/runners/feed-labels.ts
43800
+ var SUMMARY_KEYS = ["title", "question", "url", "query", "path", "name"];
43801
+ function toolCallLabel(tool, args) {
43802
+ if (args && typeof args === "object" && !Array.isArray(args)) {
43803
+ const record2 = args;
43804
+ for (const key of SUMMARY_KEYS) {
43805
+ const value = record2[key];
43806
+ if (typeof value === "string" && value.trim()) {
43807
+ return `${tool}: ${value.trim().slice(0, 100)}`;
43808
+ }
43809
+ }
43810
+ return tool;
43811
+ }
43812
+ if (typeof args === "string" && args.trim() && args.trim() !== "{}") {
43813
+ return `${tool}: ${args.trim().slice(0, 100)}`;
43814
+ }
43815
+ return tool;
43816
+ }
43817
+ function shellCommandLabel(command) {
43818
+ const trimmed = command.trim();
43819
+ if (!trimmed) return "shell";
43820
+ const quoted = /^"([^"]+)"\s*(.*)$/s.exec(trimmed);
43821
+ const executable = quoted ? quoted[1] : trimmed.split(/\s+/, 1)[0] ?? trimmed;
43822
+ const rest = quoted ? quoted[2] : trimmed.slice(executable.length).trimStart();
43823
+ const basename8 = (executable.split(/[\\/]/).pop() ?? executable).replace(/\.(exe|cmd|bat)$/i, "");
43824
+ return `shell: ${`${basename8}${rest ? ` ${rest}` : ""}`.slice(0, 100)}`;
43825
+ }
43826
+
43827
+ // src/runners/codex.ts
43798
43828
  var CODEX_NOT_FOUND_MESSAGE = "The `codex` CLI was not found on this Machine. Install it (npm install -g @openai/codex) and sign in with `codex login`, or switch the agent to API-key auth.";
43799
43829
  function defaultCodexThreadIndexRoot() {
43800
43830
  return join23(homedir10(), ".zixt", "codex-threads");
@@ -43973,18 +44003,6 @@ function delay2(ms) {
43973
44003
  timer.unref?.();
43974
44004
  });
43975
44005
  }
43976
- function toolCallLabel(tool, args, rawParameter) {
43977
- if (args && typeof args === "object" && !Array.isArray(args)) {
43978
- const record2 = args;
43979
- for (const key of ["title", "question", "url", "query", "path", "name"]) {
43980
- const value = record2[key];
43981
- if (typeof value === "string" && value.trim()) {
43982
- return `${tool}: ${value.trim().slice(0, 100)}`;
43983
- }
43984
- }
43985
- }
43986
- return `${tool}${rawParameter ? `: ${rawParameter.slice(0, 100)}` : ""}`;
43987
- }
43988
44006
  async function reportCodexRuntime(args) {
43989
44007
  const { task, runner, env, command, commandPrefixArgs } = args.input;
43990
44008
  for (let attempt = 0; attempt < RUNTIME_READ_ATTEMPTS; attempt += 1) {
@@ -44070,7 +44088,7 @@ function createCodexAppServerParser(onStream, options) {
44070
44088
  }
44071
44089
  if (type === "commandExecution") {
44072
44090
  const parameter = String(item["command"] ?? "").slice(0, 2e3);
44073
- onStream("action", `shell${parameter ? `: ${parameter.slice(0, 100)}` : ""}`, {
44091
+ onStream("action", shellCommandLabel(parameter), {
44074
44092
  tool: "shell",
44075
44093
  ...parameter ? { parameter } : {},
44076
44094
  ephemeral: true
@@ -44087,7 +44105,7 @@ function createCodexAppServerParser(onStream, options) {
44087
44105
  0,
44088
44106
  2e3
44089
44107
  );
44090
- onStream("action", toolCallLabel(tool, args, parameter), {
44108
+ onStream("action", toolCallLabel(tool, args), {
44091
44109
  tool,
44092
44110
  ...parameter ? { parameter } : {},
44093
44111
  ephemeral: true
@@ -44298,7 +44316,7 @@ function createCodexStreamParser(onStream, hooks = {}) {
44298
44316
  if (typeof item["text"] === "string") onStream("thought", truncateThought(item["text"]));
44299
44317
  } else if (phase === "item.started" && itemType === "command_execution") {
44300
44318
  const parameter = String(item["command"] ?? "").slice(0, 2e3);
44301
- onStream("action", `shell${parameter ? `: ${parameter.slice(0, 100)}` : ""}`, {
44319
+ onStream("action", shellCommandLabel(parameter), {
44302
44320
  tool: "shell",
44303
44321
  ...parameter ? { parameter } : {},
44304
44322
  ephemeral: true
@@ -44313,7 +44331,7 @@ function createCodexStreamParser(onStream, hooks = {}) {
44313
44331
  0,
44314
44332
  2e3
44315
44333
  );
44316
- onStream("action", toolCallLabel(tool, args, parameter), {
44334
+ onStream("action", toolCallLabel(tool, args), {
44317
44335
  tool,
44318
44336
  ...parameter ? { parameter } : {},
44319
44337
  ephemeral: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zixt/host",
3
- "version": "0.0.160",
3
+ "version": "0.0.161",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/client.ts",