@f5-sales-demo/xcsh 21.29.3 → 21.29.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/xcsh",
4
- "version": "21.29.3",
4
+ "version": "21.29.5",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/f5-sales-demo/xcsh",
7
7
  "author": "Can Boluk",
@@ -63,13 +63,13 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@agentclientprotocol/sdk": "1.4.0",
66
- "@f5-sales-demo/pi-agent-core": "21.29.3",
67
- "@f5-sales-demo/pi-ai": "21.29.3",
68
- "@f5-sales-demo/pi-natives": "21.29.3",
69
- "@f5-sales-demo/pi-resource-management": "21.29.3",
70
- "@f5-sales-demo/pi-tui": "21.29.3",
71
- "@f5-sales-demo/pi-utils": "21.29.3",
72
- "@f5-sales-demo/xcsh-stats": "21.29.3",
66
+ "@f5-sales-demo/pi-agent-core": "21.29.5",
67
+ "@f5-sales-demo/pi-ai": "21.29.5",
68
+ "@f5-sales-demo/pi-natives": "21.29.5",
69
+ "@f5-sales-demo/pi-resource-management": "21.29.5",
70
+ "@f5-sales-demo/pi-tui": "21.29.5",
71
+ "@f5-sales-demo/pi-utils": "21.29.5",
72
+ "@f5-sales-demo/xcsh-stats": "21.29.5",
73
73
  "@mozilla/readability": "^0.6",
74
74
  "@sinclair/typebox": "0.34.52",
75
75
  "@xterm/headless": "^6.0",
@@ -17,17 +17,17 @@ export interface BuildInfo {
17
17
  }
18
18
 
19
19
  export const BUILD_INFO: BuildInfo = {
20
- "version": "21.29.3",
21
- "commit": "15446dd8e4ac725d395e5664e370820113f0c882",
22
- "shortCommit": "15446dd",
20
+ "version": "21.29.5",
21
+ "commit": "e55dafd88cf2bfa6b2b034e303c427706a25de56",
22
+ "shortCommit": "e55dafd",
23
23
  "branch": "main",
24
- "tag": "v21.29.3",
25
- "commitDate": "2026-09-16T19:59:36+00:00",
26
- "buildDate": "2026-09-16T20:54:14.595Z",
24
+ "tag": "v21.29.5",
25
+ "commitDate": "2026-09-17T00:33:12+00:00",
26
+ "buildDate": "2026-09-17T01:17:33.222Z",
27
27
  "dirty": true,
28
28
  "prNumber": "",
29
29
  "repoUrl": "https://github.com/f5-sales-demo/xcsh",
30
30
  "repoSlug": "f5-sales-demo/xcsh",
31
- "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/15446dd8e4ac725d395e5664e370820113f0c882",
32
- "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.29.3"
31
+ "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/e55dafd88cf2bfa6b2b034e303c427706a25de56",
32
+ "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.29.5"
33
33
  };
@@ -35,28 +35,31 @@ export const F5_LOGO_ROWS: readonly string[] = [
35
35
  " (▒▒▒▒▓▓▓▓▓▓▓▓▒▒▒▒)",
36
36
  ];
37
37
 
38
+ const FULL_LOGO_MIN_WIDTH = 50;
39
+ const FULL_LOGO_CANVAS_WIDTH = 46;
40
+ const MAX_FRAME_WIDTH = 52;
41
+ const blankRow = { content: "", selected: false } as const;
42
+
38
43
  export class WelcomeComponent implements Component {
39
- constructor(
40
- private readonly version: string,
41
- private readonly terminalRows: () => number = () => process.stdout.rows || 24,
42
- ) {}
44
+ constructor(private readonly version: string) {}
43
45
  invalidate(): void {}
44
46
 
45
47
  render(termWidth: number): string[] {
46
- if (termWidth < 4) return [];
47
- const width = Math.min(52, termWidth);
48
- const budget = Math.max(4, Math.floor(this.terminalRows() / 2));
49
- const fullLogo = F5_LOGO_ROWS.length + 6 <= budget && selectorFrameContentWidth(width) >= 46;
50
- return selectorFrame(
51
- width,
52
- budget,
53
- `${APP_NAME} v${this.version}`,
54
- "",
55
- [],
56
- fullLogo ? F5_LOGO_ROWS.map(line => this.#f5ColorLine(line)) : [theme.bold(theme.fg("accent", "F5"))],
57
- [],
58
- [],
59
- );
48
+ if (termWidth < 5) return [];
49
+ const width = Math.min(MAX_FRAME_WIDTH, termWidth);
50
+ const contentWidth = selectorFrameContentWidth(width);
51
+ const fullLogo = termWidth >= FULL_LOGO_MIN_WIDTH;
52
+ const logo = fullLogo
53
+ ? F5_LOGO_ROWS.map(line => this.#centerInCanvas(this.#f5ColorLine(line), FULL_LOGO_CANVAS_WIDTH, contentWidth))
54
+ : [this.#centerInCanvas(theme.bold(theme.fg("accent", "F5")), 2, contentWidth)];
55
+ const body = [blankRow, ...logo, blankRow];
56
+ return selectorFrame(width, body.length + 4, `${APP_NAME} v${this.version}`, "", [], body, [], []);
57
+ }
58
+
59
+ #centerInCanvas(value: string, canvasWidth: number, contentWidth: number): string {
60
+ const left = Math.floor((contentWidth - canvasWidth) / 2);
61
+ const right = contentWidth - canvasWidth - left;
62
+ return `${" ".repeat(Math.max(0, left))}${value}${" ".repeat(Math.max(0, right))}`;
60
63
  }
61
64
 
62
65
  #f5ColorLine(line: string): string {
@@ -398,7 +398,7 @@ export class InteractiveMode implements InteractiveModeContext {
398
398
  );
399
399
 
400
400
  if (!startupQuiet) {
401
- this.#welcomeComponent = new WelcomeComponent(this.#version, () => this.ui.terminal.rows);
401
+ this.#welcomeComponent = new WelcomeComponent(this.#version);
402
402
  this.ui.addChild(new Spacer(1));
403
403
  this.ui.addChild(this.#welcomeComponent);
404
404
  this.ui.addChild(new Spacer(1));
@@ -22,7 +22,13 @@ export class RemoteProcesses {
22
22
  for (const process of processes.values()) process.kill();
23
23
  }
24
24
  }
25
- call(client: string, identity: string, method: string, params: Record<string, unknown>): Promise<unknown> {
25
+ call(
26
+ client: string,
27
+ identity: string,
28
+ method: string,
29
+ params: Record<string, unknown>,
30
+ additionalAllowedCwd?: string,
31
+ ): Promise<unknown> {
26
32
  const key = JSON.stringify([client, identity]);
27
33
  const signature = JSON.stringify({ method, params });
28
34
  const previous = this.#requests.get(key);
@@ -32,11 +38,16 @@ export class RemoteProcesses {
32
38
  : Promise.reject(new ProtocolError(-32600, "Request identity reused with different input"));
33
39
  if (this.#requests.size >= 4096)
34
40
  return Promise.reject(new ProtocolError(-32000, "Process request limit reached"));
35
- const result = this.#execute(client, method, params);
41
+ const result = this.#execute(client, method, params, additionalAllowedCwd);
36
42
  this.#requests.set(key, { signature, result });
37
43
  return result;
38
44
  }
39
- async #execute(client: string, method: string, p: Record<string, unknown>): Promise<unknown> {
45
+ async #execute(
46
+ client: string,
47
+ method: string,
48
+ p: Record<string, unknown>,
49
+ additionalAllowedCwd?: string,
50
+ ): Promise<unknown> {
40
51
  if (typeof p.processHandle !== "string" || !p.processHandle || p.processHandle.length > 256)
41
52
  throw new ProtocolError(-32602, "Invalid process handle");
42
53
  const handle = p.processHandle;
@@ -72,7 +83,11 @@ export class RemoteProcesses {
72
83
  }
73
84
  if (method !== "process/spawn") throw new ProtocolError(-32601, "Unsupported process operation");
74
85
  if (p.tty === true || p.size != null) throw new ProtocolError(-32602, "Remote PTY processes are not supported");
75
- if (typeof p.cwd !== "string" || !isAbsolute(p.cwd) || !this.allowedCwd(p.cwd))
86
+ if (
87
+ typeof p.cwd !== "string" ||
88
+ !isAbsolute(p.cwd) ||
89
+ (!this.allowedCwd(p.cwd) && p.cwd !== additionalAllowedCwd)
90
+ )
76
91
  throw new ProtocolError(-32602, "Process working directory must match a live terminal");
77
92
  if (
78
93
  !Array.isArray(p.command) ||
@@ -485,9 +485,13 @@ export class RemoteRouter {
485
485
  this.registerManagedSession(threadId, endpoint);
486
486
  return coldResume;
487
487
  }
488
- async #processParams(method: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {
489
- if (method !== "process/spawn" || params.cwd !== "/") return params;
488
+ async #processParams(
489
+ method: string,
490
+ params: Record<string, unknown>,
491
+ ): Promise<{ params: Record<string, unknown>; additionalAllowedCwd?: string }> {
492
+ if (method !== "process/spawn" || params.cwd !== "/") return { params };
490
493
  let isolated = params;
494
+ let additionalAllowedCwd: string | undefined;
491
495
  const command = params.command;
492
496
  if (
493
497
  Array.isArray(command) &&
@@ -526,14 +530,18 @@ export class RemoteRouter {
526
530
  }
527
531
  }
528
532
  if (!workspace) throw new ProtocolError(-32000, "xcsh workspace limit reached");
529
- isolated = { ...params, command: ["/usr/bin/printf", "%s", workspace] };
533
+ isolated = { ...params, cwd: workspace, command: ["/usr/bin/printf", "%s", workspace] };
534
+ additionalAllowedCwd = workspace;
530
535
  }
531
- if (this.#visibleSessions().some(session => session.thread.cwd === "/")) return isolated;
536
+ if (additionalAllowedCwd) return { params: isolated, additionalAllowedCwd };
537
+ if (this.#visibleSessions().some(session => session.thread.cwd === "/")) return { params: isolated };
532
538
  // Blank-chat clients use root as a placeholder before choosing a workspace.
533
539
  // Map only that placeholder to the exposed primary. The phone's known blank-chat
534
540
  // bootstrap is also confined to xcsh's documents namespace instead of Codex's.
535
541
  const cwd = this.#currentSession()?.thread.cwd;
536
- return typeof cwd === "string" && isAbsolute(cwd) && normalize(cwd) === cwd ? { ...isolated, cwd } : isolated;
542
+ return {
543
+ params: typeof cwd === "string" && isAbsolute(cwd) && normalize(cwd) === cwd ? { ...isolated, cwd } : isolated,
544
+ };
537
545
  }
538
546
  #defer(client: string, event: Notification): void {
539
547
  setTimeout(() => this.#emit(client, event), 0);
@@ -698,14 +706,17 @@ export class RemoteRouter {
698
706
  }
699
707
  case "process/spawn":
700
708
  case "process/kill":
701
- case "process/writeStdin":
709
+ case "process/writeStdin": {
710
+ const processRequest = await this.#processParams(request.method, params);
702
711
  result = await this.#processes.call(
703
712
  client,
704
713
  JSON.stringify(id),
705
714
  request.method,
706
- await this.#processParams(request.method, params),
715
+ processRequest.params,
716
+ processRequest.additionalAllowedCwd,
707
717
  );
708
718
  break;
719
+ }
709
720
  case "config/read": {
710
721
  const matching =
711
722
  params.cwd == null