@xynogen/pix-ssh 0.2.4 → 0.2.6

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/package.json +2 -2
  2. package/src/index.ts +8 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-ssh",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Pi tool — ssh_run: run remote commands over SSH with password/key auth and remote sudo",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "typebox": "^1.1.38",
40
40
  "@xynogen/pix-pretty": "^1.16.0",
41
- "@xynogen/pix-runtime": "^0.7.0"
41
+ "@xynogen/pix-runtime": "^0.8.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@earendil-works/pi-coding-agent": "*",
package/src/index.ts CHANGED
@@ -41,9 +41,10 @@ import {
41
41
  renderCollapsedToolRow,
42
42
  renderToolError,
43
43
  ruleFrame,
44
+ sectionRule,
44
45
  termW,
45
46
  } from "@xynogen/pix-pretty/utils";
46
- import { withAgentBlock } from "@xynogen/pix-runtime";
47
+ import { getUnattendedMode, withAgentBlock } from "@xynogen/pix-runtime";
47
48
  import { type CollapseState, tickCollapse } from "@xynogen/pix-runtime/collapse";
48
49
  import { Type } from "typebox";
49
50
  import {
@@ -284,9 +285,9 @@ export default function (pi: ExtensionAPI): void {
284
285
  const key = cacheKey(effectiveSpec);
285
286
  const creds = credCache.get(key) ?? {};
286
287
 
287
- const g = globalThis as { __pixAfk?: boolean; __pixYolo?: boolean };
288
- const yolo = g.__pixYolo === true;
289
- if (g.__pixAfk === true && !yolo) {
288
+ const mode = getUnattendedMode(pi.events);
289
+ const yolo = mode === "yolo";
290
+ if (mode === "afk") {
290
291
  return {
291
292
  content: [{ type: "text", text: "ssh_run denied immediately — AFK mode is active." }],
292
293
  details: makeDetails(command, host, sudo, reason, {
@@ -536,7 +537,7 @@ export default function (pi: ExtensionAPI): void {
536
537
  const prefix = args.sudo ? "sudo " : "";
537
538
  text.setText(
538
539
  fillToolBackground(
539
- `${theme.fg("toolTitle", theme.bold("ssh"))} ${theme.fg("dim", host)} ${theme.fg("accent", prefix + command)}`,
540
+ `${theme.fg("toolTitle", theme.bold("ssh"))} ${theme.fg("dim", host)} ${theme.fg("muted", prefix + command)}`,
540
541
  ),
541
542
  );
542
543
  return text;
@@ -624,8 +625,9 @@ export default function (pi: ExtensionAPI): void {
624
625
  lineCount > maxShow ? [`${FG_DIM} … ${lineCount - maxShow} more lines${RST}`] : [];
625
626
  const statusKey = code === null ? "dim" : code === 0 ? "success" : "error";
626
627
  const paint = (s: string) => theme.fg(statusKey, s);
628
+ const sw = Math.max(8, termW() - 4); // section-rule width inside the 2-space indent
627
629
  const out = ruleFrame(
628
- show.map((line) => ` ${line}`),
630
+ show.map((line) => ` ${sectionRule(line, theme, sw) ?? line}`),
629
631
  footer,
630
632
  termW(),
631
633
  paint,