let markBackgrounded: typeofimport("./bash-process-registry.js").markBackgrounded;
let buildExecExitOutcome: typeofimport("./bash-tools.exec-runtime.js").buildExecExitOutcome;
let detectCursorKeyMode: typeofimport("./bash-tools.exec-runtime.js").detectCursorKeyMode;
let emitExecSystemEvent: typeofimport("./bash-tools.exec-runtime.js").emitExecSystemEvent;
let formatExecFailureReason: typeofimport("./bash-tools.exec-runtime.js").formatExecFailureReason;
let resolveExecTarget: typeofimport("./bash-tools.exec-runtime.js").resolveExecTarget;
let runExecProcess: typeofimport("./bash-tools.exec-runtime.js").runExecProcess;
it("last toggle wins when both present", () => { // smkx first, then rmkx - should be normal
expect(detectCursorKeyMode("\x1b[?1h\x1b[?1l")).toBe("normal"); // rmkx first, then smkx - should be application
expect(detectCursorKeyMode("\x1b[?1l\x1b[?1h")).toBe("application"); // Multiple toggles - last one wins
expect(detectCursorKeyMode("\x1b[?1h\x1b[?1l\x1b[?1h")).toBe("application");
});
});
describe("resolveExecTarget", () => {
it("keeps implicit auto on sandbox when a sandbox runtime is available", () => {
expect(
resolveExecTarget({
configuredTarget: "auto",
elevatedRequested: false,
sandboxAvailable: true,
}),
).toMatchObject({
configuredTarget: "auto",
requestedTarget: null,
selectedTarget: "auto",
effectiveHost: "sandbox",
});
});
it("keeps implicit auto on gateway when no sandbox runtime is available", () => {
expect(
resolveExecTarget({
configuredTarget: "auto",
elevatedRequested: false,
sandboxAvailable: false,
}),
).toMatchObject({
configuredTarget: "auto",
requestedTarget: null,
selectedTarget: "auto",
effectiveHost: "gateway",
});
});
it("allows per-call host=gateway override when configured host is auto and no sandbox", () => {
expect(
resolveExecTarget({
configuredTarget: "auto",
requestedTarget: "gateway",
elevatedRequested: false,
sandboxAvailable: false,
}),
).toMatchObject({
configuredTarget: "auto",
requestedTarget: "gateway",
selectedTarget: "gateway",
effectiveHost: "gateway",
});
});
it("rejects per-call host=gateway override from auto when sandbox is available", () => {
expect(() =>
resolveExecTarget({
configuredTarget: "auto",
requestedTarget: "gateway",
elevatedRequested: false,
sandboxAvailable: true,
}),
).toThrow( "exec host not allowed (requested gateway; configured host is auto; set tools.exec.host=gateway to allow this override).",
);
});
it("rejects per-call host=node override from auto when sandbox is available", () => {
expect(() =>
resolveExecTarget({
configuredTarget: "auto",
requestedTarget: "node",
elevatedRequested: false,
sandboxAvailable: true,
}),
).toThrow( "exec host not allowed (requested node; configured host is auto; set tools.exec.host=node to allow this override).",
);
});
it("rejects cross-host override when configured target is a concrete host", () => {
expect(() =>
resolveExecTarget({
configuredTarget: "node",
requestedTarget: "gateway",
elevatedRequested: false,
sandboxAvailable: false,
}),
).toThrow( "exec host not allowed (requested gateway; configured host is node; set tools.exec.host=gateway or auto to allow this override).",
);
});
if (outcome.status !== "failed") { thrownew Error(`Expected timeout to fail, got ${outcome.status}`);
}
expect(outcome).toMatchObject({ failureKind: "overall-timeout", timedOut: true });
expect(outcome.reason).toContain("background=true");
expect(outcome.reason).toContain("Do not rely on shell backgrounding");
});
});
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.16Bemerkung:
(vorverarbeitet am 2026-05-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.