@zixt/host 0.0.163 → 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.
- package/dist/index.js +85 -16
- 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.165",
|
|
32
32
|
type: "module",
|
|
33
33
|
exports: {
|
|
34
34
|
".": "./src/client.ts",
|
|
@@ -14672,6 +14672,8 @@ var ID_PREFIXES = {
|
|
|
14672
14672
|
conversationEvent: "cve",
|
|
14673
14673
|
/** One human-confirmed integration action prepared by the Manager. */
|
|
14674
14674
|
managerIntegrationAction: "mia",
|
|
14675
|
+
/** One human-confirmed destructive cleanup prepared by the Manager (MG-16). */
|
|
14676
|
+
managerDestructiveAction: "mda",
|
|
14675
14677
|
/** One Manager-prepared secure Credential entry card (MG-17). */
|
|
14676
14678
|
managerCredentialRequest: "mcr",
|
|
14677
14679
|
/** One Manager-prepared generic API setup or invocation card (MG-20). */
|
|
@@ -14774,6 +14776,10 @@ var ManagerIntegrationActionId = idSchema(
|
|
|
14774
14776
|
ID_PREFIXES.managerIntegrationAction,
|
|
14775
14777
|
"Manager integration action id"
|
|
14776
14778
|
);
|
|
14779
|
+
var ManagerDestructiveActionId = idSchema(
|
|
14780
|
+
ID_PREFIXES.managerDestructiveAction,
|
|
14781
|
+
"Manager destructive action id"
|
|
14782
|
+
);
|
|
14777
14783
|
var ManagerCredentialRequestId = idSchema(
|
|
14778
14784
|
ID_PREFIXES.managerCredentialRequest,
|
|
14779
14785
|
"Manager credential request id"
|
|
@@ -20363,6 +20369,8 @@ var ConversationEventProjection = external_exports.discriminatedUnion("kind", [
|
|
|
20363
20369
|
agentId: AgentId.nullable(),
|
|
20364
20370
|
/** Present only for a confirmation card; OAuth authority never appears here. */
|
|
20365
20371
|
integrationActionId: ManagerIntegrationActionId.nullable().optional(),
|
|
20372
|
+
/** Present only for a permanent-deletion confirmation card (MG-16). */
|
|
20373
|
+
destructiveActionId: ManagerDestructiveActionId.nullable().optional(),
|
|
20366
20374
|
/** Present only for a secure Credential entry card; never a value (MG-17). */
|
|
20367
20375
|
credentialRequestId: ManagerCredentialRequestId.nullable().optional(),
|
|
20368
20376
|
/** Present only for a generic API setup/invocation card; never credentials (MG-20). */
|
|
@@ -20458,6 +20466,33 @@ var ManagerIntegrationActionResponse = external_exports.object({
|
|
|
20458
20466
|
action: ManagerIntegrationActionProjection,
|
|
20459
20467
|
oauth: ManagerIntegrationOAuthStart.nullable()
|
|
20460
20468
|
}).strict();
|
|
20469
|
+
var ManagerDestructiveActionStatus = external_exports.enum([
|
|
20470
|
+
"awaiting_confirmation",
|
|
20471
|
+
"working",
|
|
20472
|
+
"completed",
|
|
20473
|
+
"cancelled",
|
|
20474
|
+
"failed",
|
|
20475
|
+
"expired"
|
|
20476
|
+
]);
|
|
20477
|
+
var ManagerDestructiveActionProjection = external_exports.object({
|
|
20478
|
+
id: ManagerDestructiveActionId,
|
|
20479
|
+
conversationId: ConversationId,
|
|
20480
|
+
status: ManagerDestructiveActionStatus,
|
|
20481
|
+
title: external_exports.string().min(1).max(200),
|
|
20482
|
+
/** The exact inventory of what Confirm destroys, one line per item. */
|
|
20483
|
+
description: external_exports.string().min(1).max(4e3),
|
|
20484
|
+
/**
|
|
20485
|
+
* Rises whenever the Manager adds to the card. Confirmation binds to the
|
|
20486
|
+
* revision the person read, so an inventory that grew after they looked
|
|
20487
|
+
* authorizes nothing (GR-3).
|
|
20488
|
+
*/
|
|
20489
|
+
revision: external_exports.number().int().min(1),
|
|
20490
|
+
confirmLabel: external_exports.string().min(1).max(100),
|
|
20491
|
+
outcome: external_exports.string().max(2e3).nullable(),
|
|
20492
|
+
createdAt: external_exports.string(),
|
|
20493
|
+
expiresAt: external_exports.string()
|
|
20494
|
+
}).strict();
|
|
20495
|
+
var ConfirmManagerDestructiveActionRequest = external_exports.object({ requestId: external_exports.string().uuid(), revision: external_exports.number().int().min(1) }).strict();
|
|
20461
20496
|
var ManagerEmailSetupPrefill = external_exports.object({
|
|
20462
20497
|
/** Connection name as it will appear under Integrations. */
|
|
20463
20498
|
name: external_exports.string().min(1).max(120).optional(),
|
|
@@ -28045,7 +28080,7 @@ function probeFailureText(err) {
|
|
|
28045
28080
|
const cause = err instanceof Error ? err.cause : void 0;
|
|
28046
28081
|
const code = cause && typeof cause === "object" && "code" in cause && typeof cause.code === "string" ? cause.code : cause instanceof Error && cause.message ? cause.message : "";
|
|
28047
28082
|
const reason = code === "ENOTFOUND" || code === "EAI_AGAIN" ? "the server address could not be found" : code === "ECONNREFUSED" ? "nothing is listening at that address" : code === "ETIMEDOUT" || code === "UND_ERR_CONNECT_TIMEOUT" ? "the server did not answer in time" : /certificate|TLS|SSL/i.test(code) ? "the secure connection could not be established" : "the server could not be reached";
|
|
28048
|
-
return `The Machine could not connect: ${reason}
|
|
28083
|
+
return `The Machine could not connect: ${reason}. Check the URL and that the server is running${code ? ` (${code})` : ""}`;
|
|
28049
28084
|
}
|
|
28050
28085
|
|
|
28051
28086
|
// src/updater.ts
|
|
@@ -33237,6 +33272,18 @@ function createBrowserToolPack(deps) {
|
|
|
33237
33272
|
provider: "browser",
|
|
33238
33273
|
version: 1,
|
|
33239
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
|
+
],
|
|
33240
33287
|
call,
|
|
33241
33288
|
currentSignInWall: () => signInWall ? { origin: signInWall.origin } : null,
|
|
33242
33289
|
async close() {
|
|
@@ -42984,7 +43031,8 @@ function createCliRunner(adapter, opts = {}) {
|
|
|
42984
43031
|
alwaysLoad: server.alwaysLoad,
|
|
42985
43032
|
narrated: server.narrated
|
|
42986
43033
|
}))
|
|
42987
|
-
)
|
|
43034
|
+
),
|
|
43035
|
+
narratedTools: toolPacks.filter((pack) => !pack.mcpServers).flatMap((pack) => [...pack.narratedTools ?? []])
|
|
42988
43036
|
},
|
|
42989
43037
|
preparedWorkspace,
|
|
42990
43038
|
gitDetected,
|
|
@@ -43810,8 +43858,8 @@ import { homedir as homedir10 } from "node:os";
|
|
|
43810
43858
|
import { dirname as dirname10, join as join23 } from "node:path";
|
|
43811
43859
|
|
|
43812
43860
|
// src/runners/feed-labels.ts
|
|
43813
|
-
var SENTENCE_KEYS = ["title", "question", "description", "
|
|
43814
|
-
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"];
|
|
43815
43863
|
function capLine(text, max = 100) {
|
|
43816
43864
|
if (text.length <= max) return text;
|
|
43817
43865
|
const cut = text.slice(0, max - 1);
|
|
@@ -43819,7 +43867,7 @@ function capLine(text, max = 100) {
|
|
|
43819
43867
|
return `${(space > max * 0.6 ? cut.slice(0, space) : cut).trimEnd()}\u2026`;
|
|
43820
43868
|
}
|
|
43821
43869
|
function tidyPath(text) {
|
|
43822
|
-
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, "~");
|
|
43823
43871
|
}
|
|
43824
43872
|
var FILE_SUFFIX = /^(?:js|cjs|mjs|ts|tsx|py|sh|ps1|exe|cmd|bat|json|md|txt)$/i;
|
|
43825
43873
|
function humanToolName(tool) {
|
|
@@ -43943,6 +43991,7 @@ function createCodexAdapter(threadIndexRoot, providerSessionStateRoot2) {
|
|
|
43943
43991
|
flags.push("-c", "mcp_servers.zixt.tool_timeout_sec=86400");
|
|
43944
43992
|
const taken = /* @__PURE__ */ new Set(["zixt"]);
|
|
43945
43993
|
const narratedServers = /* @__PURE__ */ new Set();
|
|
43994
|
+
const narratedTools = new Set(mcp.narratedTools);
|
|
43946
43995
|
for (const server of mcp.localServers) {
|
|
43947
43996
|
const key = serverKeyFor(server.name, taken);
|
|
43948
43997
|
if (server.narrated) narratedServers.add(key);
|
|
@@ -44040,8 +44089,13 @@ ${value}` : value;
|
|
|
44040
44089
|
...runner.effort ? { effort: runner.effort } : {},
|
|
44041
44090
|
developerInstructions: platformInstructions ?? "",
|
|
44042
44091
|
onThreadStarted,
|
|
44043
|
-
narratedServers
|
|
44044
|
-
|
|
44092
|
+
narratedServers,
|
|
44093
|
+
narratedTools
|
|
44094
|
+
}) : createCodexStreamParser(onStream, {
|
|
44095
|
+
onThreadStarted,
|
|
44096
|
+
narratedServers,
|
|
44097
|
+
narratedTools
|
|
44098
|
+
});
|
|
44045
44099
|
},
|
|
44046
44100
|
// Only one flip is meaningful: a resume whose rollout vanished starts
|
|
44047
44101
|
// over. Codex assigns new-session ids itself, so a new session can
|
|
@@ -44153,8 +44207,10 @@ function createCodexAppServerParser(onStream, options) {
|
|
|
44153
44207
|
}
|
|
44154
44208
|
if (type === "mcpToolCall") {
|
|
44155
44209
|
const server = String(item["server"] ?? "mcp");
|
|
44210
|
+
const toolName = String(item["tool"] ?? "tool");
|
|
44156
44211
|
if (options.narratedServers?.has(server)) return;
|
|
44157
|
-
|
|
44212
|
+
if (server === "zixt" && options.narratedTools?.has(toolName)) return;
|
|
44213
|
+
const tool = `${server}.${toolName}`.slice(0, 200);
|
|
44158
44214
|
const args = item["arguments"];
|
|
44159
44215
|
const parameter = (typeof args === "string" ? args : args ? JSON.stringify(args) : "").slice(
|
|
44160
44216
|
0,
|
|
@@ -44378,8 +44434,10 @@ function createCodexStreamParser(onStream, hooks = {}) {
|
|
|
44378
44434
|
});
|
|
44379
44435
|
} else if (phase === "item.started" && itemType === "mcp_tool_call") {
|
|
44380
44436
|
const server = String(item["server"] ?? "mcp");
|
|
44437
|
+
const toolName = String(item["tool"] ?? "tool");
|
|
44381
44438
|
if (hooks.narratedServers?.has(server)) return;
|
|
44382
|
-
|
|
44439
|
+
if (server === "zixt" && hooks.narratedTools?.has(toolName)) return;
|
|
44440
|
+
const tool = `${server}.${toolName}`.slice(0, 200);
|
|
44383
44441
|
const args = item["arguments"];
|
|
44384
44442
|
const parameter = (typeof args === "string" ? args : args ? JSON.stringify(args) : "").slice(
|
|
44385
44443
|
0,
|
|
@@ -46208,7 +46266,11 @@ function createClaudeCodeAdapter(providerSessionStateRoot2) {
|
|
|
46208
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.',
|
|
46209
46267
|
async prepareRun(input) {
|
|
46210
46268
|
const liveInput = input.liveInput && input.task.followUps !== void 0;
|
|
46211
|
-
const {
|
|
46269
|
+
const {
|
|
46270
|
+
args: baseArgs,
|
|
46271
|
+
narratedServers,
|
|
46272
|
+
narratedTools
|
|
46273
|
+
} = await buildArgs(
|
|
46212
46274
|
input.task,
|
|
46213
46275
|
input.runner,
|
|
46214
46276
|
input.artifacts,
|
|
@@ -46244,7 +46306,11 @@ function createClaudeCodeAdapter(providerSessionStateRoot2) {
|
|
|
46244
46306
|
],
|
|
46245
46307
|
prompt: buildRunnerPrompt(input.task),
|
|
46246
46308
|
recoveryPrompt: buildRunnerPrompt(input.task, true),
|
|
46247
|
-
createParser: (onStream) => liveInput ? createClaudeLiveParser(onStream, observeRuntime, narratedServers) : createStreamParser(onStream, {
|
|
46309
|
+
createParser: (onStream) => liveInput ? createClaudeLiveParser(onStream, observeRuntime, narratedServers, narratedTools) : createStreamParser(onStream, {
|
|
46310
|
+
onSessionModel: observeRuntime,
|
|
46311
|
+
narratedServers,
|
|
46312
|
+
narratedTools
|
|
46313
|
+
}),
|
|
46248
46314
|
// Self-heal both directions: a crashed first run leaves a transcript
|
|
46249
46315
|
// (new → conflict), a lost workspace breaks resume (resume → not
|
|
46250
46316
|
// found). One flip covers both.
|
|
@@ -46321,6 +46387,7 @@ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRo
|
|
|
46321
46387
|
const allowedTools = ["mcp__zixt"];
|
|
46322
46388
|
const taken = /* @__PURE__ */ new Set(["zixt"]);
|
|
46323
46389
|
const narratedServers = /* @__PURE__ */ new Set();
|
|
46390
|
+
const narratedTools = new Set(mcp.narratedTools);
|
|
46324
46391
|
for (const server of mcp.localServers) {
|
|
46325
46392
|
const key = serverKeyFor(server.name, taken);
|
|
46326
46393
|
if (server.narrated) narratedServers.add(key);
|
|
@@ -46344,9 +46411,9 @@ async function buildArgs(task, runner, artifacts, mcp, preparedWorkspace, taskRo
|
|
|
46344
46411
|
"--disallowedTools",
|
|
46345
46412
|
[...CLAUDE_SESSION_CRON_TOOLS, ...CLAUDE_REINVOCATION_TOOLS].join(",")
|
|
46346
46413
|
);
|
|
46347
|
-
return { args, narratedServers };
|
|
46414
|
+
return { args, narratedServers, narratedTools };
|
|
46348
46415
|
}
|
|
46349
|
-
function createClaudeLiveParser(onStream, onSessionModel, narratedServers) {
|
|
46416
|
+
function createClaudeLiveParser(onStream, onSessionModel, narratedServers, narratedTools) {
|
|
46350
46417
|
let write = null;
|
|
46351
46418
|
const acknowledgements = /* @__PURE__ */ new Map();
|
|
46352
46419
|
const input = (uuid3, text) => `${JSON.stringify({
|
|
@@ -46359,6 +46426,7 @@ function createClaudeLiveParser(onStream, onSessionModel, narratedServers) {
|
|
|
46359
46426
|
const parser = createStreamParser(onStream, {
|
|
46360
46427
|
onSessionModel,
|
|
46361
46428
|
...narratedServers ? { narratedServers } : {},
|
|
46429
|
+
...narratedTools ? { narratedTools } : {},
|
|
46362
46430
|
onUserReplay: (uuid3) => {
|
|
46363
46431
|
const acknowledge = acknowledgements.get(uuid3);
|
|
46364
46432
|
if (!acknowledge) return;
|
|
@@ -46434,8 +46502,9 @@ function createStreamParser(onStream, hooks = {}) {
|
|
|
46434
46502
|
const input = block["input"];
|
|
46435
46503
|
const target = input?.["description"] ?? input?.["command"] ?? input?.["pattern"] ?? input?.["file_path"] ?? (typeof input?.["question"] === "string" ? input["question"] : void 0) ?? "";
|
|
46436
46504
|
const tool = String(block["name"]).slice(0, 200);
|
|
46437
|
-
const
|
|
46438
|
-
if (
|
|
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;
|
|
46439
46508
|
const parameter = String(target).slice(0, 2e3);
|
|
46440
46509
|
const localPath = typeof input?.["file_path"] === "string" ? input["file_path"] : null;
|
|
46441
46510
|
const label = typeof input?.["command"] === "string" && input["command"].trim() ? shellCommandLabel(input["command"]) : toolCallLabel(tool, input ?? {});
|