@zixt/host 0.0.161 → 0.0.162
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.
- package/dist/index.js +12 -5
- 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.
|
|
31
|
+
version: "0.0.162",
|
|
32
32
|
type: "module",
|
|
33
33
|
exports: {
|
|
34
34
|
".": "./src/client.ts",
|
|
@@ -43797,11 +43797,18 @@ import { homedir as homedir10 } from "node:os";
|
|
|
43797
43797
|
import { dirname as dirname10, join as join23 } from "node:path";
|
|
43798
43798
|
|
|
43799
43799
|
// src/runners/feed-labels.ts
|
|
43800
|
-
var
|
|
43800
|
+
var SENTENCE_KEYS = ["title", "question", "description", "url", "query"];
|
|
43801
|
+
var LOCATOR_KEYS = ["file_path", "path", "pattern", "name"];
|
|
43801
43802
|
function toolCallLabel(tool, args) {
|
|
43802
43803
|
if (args && typeof args === "object" && !Array.isArray(args)) {
|
|
43803
43804
|
const record2 = args;
|
|
43804
|
-
for (const key of
|
|
43805
|
+
for (const key of SENTENCE_KEYS) {
|
|
43806
|
+
const value = record2[key];
|
|
43807
|
+
if (typeof value === "string" && value.trim()) {
|
|
43808
|
+
return value.trim().slice(0, 100);
|
|
43809
|
+
}
|
|
43810
|
+
}
|
|
43811
|
+
for (const key of LOCATOR_KEYS) {
|
|
43805
43812
|
const value = record2[key];
|
|
43806
43813
|
if (typeof value === "string" && value.trim()) {
|
|
43807
43814
|
return `${tool}: ${value.trim().slice(0, 100)}`;
|
|
@@ -46367,9 +46374,9 @@ function createStreamParser(onStream, hooks = {}) {
|
|
|
46367
46374
|
const target = input?.["description"] ?? input?.["command"] ?? input?.["pattern"] ?? input?.["file_path"] ?? (typeof input?.["question"] === "string" ? input["question"] : void 0) ?? "";
|
|
46368
46375
|
const tool = String(block["name"]).slice(0, 200);
|
|
46369
46376
|
const parameter = String(target).slice(0, 2e3);
|
|
46370
|
-
const shortParameter = parameter.slice(0, 100);
|
|
46371
46377
|
const localPath = typeof input?.["file_path"] === "string" ? input["file_path"] : null;
|
|
46372
|
-
|
|
46378
|
+
const label = typeof input?.["command"] === "string" && input["command"].trim() ? shellCommandLabel(input["command"]) : toolCallLabel(tool, input ?? {});
|
|
46379
|
+
onStream("action", label, {
|
|
46373
46380
|
tool,
|
|
46374
46381
|
...parameter ? { parameter } : {},
|
|
46375
46382
|
ephemeral: true,
|