@xynogen/pix-ssh 0.5.6 → 0.5.8

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 +3 -3
  2. package/src/index.ts +25 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xynogen/pix-ssh",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "Pi tool \u2014 ssh_run: run remote commands over SSH with password/key auth and remote sudo",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -37,8 +37,8 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@xynogen/pix-pretty": "^1.30.0",
41
- "@xynogen/pix-runtime": "^0.13.0"
40
+ "@xynogen/pix-pretty": "^1.32.0",
41
+ "@xynogen/pix-runtime": "^0.14.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "typebox": "*",
package/src/index.ts CHANGED
@@ -404,75 +404,70 @@ export default function (pi: ExtensionAPI): void {
404
404
  ...({ exposure: "deferred" } as const),
405
405
  label: "Run over SSH",
406
406
  description:
407
- "Run a command or transfer files/directories on a REMOTE host over SSH. " +
408
- "For the LOCAL machine use `bash` (or `sudo_run` for local root) instead — do not use ssh_run for local work. " +
409
- "Requires a `host`. Windows/PowerShell shells are best-effort (elevation and PowerShell stream/encoding semantics unsupported). " +
410
- "Set `sudo: true` to run the command as root on the remote machine. " +
411
- 'For transfer, set `action: "file"`, `direction`, `source`, `destination`, and optional `recursive` — ' +
412
- "transfers may overwrite the destination. " +
413
- 'To discover hosts without reading `~/.ssh/config`, use `action: "info"` — omit `host` to list configured aliases, or pass a `host` to get its effective config (no connection). ' +
414
- "Always provide a clear `reason`.",
407
+ "Operate on a REMOTE host over SSH (for the LOCAL machine use `bash`, or `sudo_run` for local root). " +
408
+ "Pick one `action`; each has its own parameters:\n" +
409
+ "- command: run a command. Required: host, command. Optional: sudo (remote POSIX root).\n" +
410
+ "- file: upload/download a file or directory (may overwrite the destination). Required: host, direction, source, destination. Optional: recursive.\n" +
411
+ "- info: read SSH config, no connection. Optional: host (omit = list aliases, set = effective config).\n" +
412
+ "Always set `reason`. Windows/PowerShell remotes are best-effort.",
415
413
  promptSnippet: "Run a remote command, transfer files, or read SSH config over SSH",
416
414
  promptGuidelines: [
417
- 'ssh_run: REMOTE host only — use `bash`/`sudo_run` for the local machine. `host` as `[user@]host[:port]`; `sudo` covers remote POSIX sudo only. For transfer use `action: "file"` with `direction: "upload"|"download"`, `source`, `destination`, optional `recursive` (may overwrite). Use `action: "info"` (no `host` = list aliases, with `host` = its effective config) instead of reading `~/.ssh/config` yourself. Always set `reason`.',
415
+ 'ssh_run: REMOTE host only — use `bash`/`sudo_run` locally. `action` is required: "command" (host, command, sudo?), "file" (host, direction, source, destination, recursive?), "info" (host? — no host = list aliases). `host` is `[user@]host[:port]`. Use "info" instead of reading `~/.ssh/config`. Always set `reason`.',
418
416
  ],
419
417
 
420
418
  renderShell: "self",
421
419
 
422
- // Single Type.Object (root `type: "object"`) rather than Type.Union — a union
420
+ // Single flat Type.Object (root `type: "object"`) rather than Type.Union — a union
423
421
  // serializes to `anyOf` with no root type, which strict OpenAI-compatible
424
- // providers (e.g. DeepSeek) reject with `type: null`. Conditional fields are
425
- // optional and normalized/validated at runtime via normalizeOperation.
422
+ // providers (e.g. DeepSeek) reject with `type: null`. Only `action` is
423
+ // schema-required; per-action fields are tagged in their descriptions and
424
+ // validated at runtime via normalizeOperation.
426
425
  parameters: Type.Object({
427
- action: Type.Optional(
428
- Type.Union([Type.Literal("command"), Type.Literal("file"), Type.Literal("info")], {
429
- description:
430
- '"command" (default) runs a remote command; "file" transfers a file/directory; "info" reports SSH config (no connection) — list configured host aliases, or resolve one host\'s effective config when `host` is given.',
431
- }),
432
- ),
426
+ action: Type.Union([Type.Literal("command"), Type.Literal("file"), Type.Literal("info")], {
427
+ description:
428
+ '"command" runs a remote command, "file" transfers a file/directory, "info" reads SSH config (no connection).',
429
+ }),
433
430
  host: Type.Optional(
434
431
  Type.String({
435
432
  description:
436
- "Remote target as `[user@]host[:port]` (e.g. `deploy@10.0.0.5:2222`). Required for command/file; for info, omit to list all aliases or set it to resolve one host.",
433
+ "`[user@]host[:port]`, e.g. `deploy@10.0.0.5:2222`. REQUIRED for command and file. For info: omit to list aliases, set to resolve one host.",
437
434
  }),
438
435
  ),
436
+ // command
439
437
  command: Type.Optional(
440
438
  Type.String({
441
- description:
442
- 'Command sent to the remote host\'s configured SSH shell. Required when action is "command".',
439
+ description: "[command] REQUIRED. Sent to the remote host's configured SSH shell.",
443
440
  }),
444
441
  ),
445
442
  sudo: Type.Optional(
446
443
  Type.Boolean({
447
- description:
448
- "Run the command as root on the remote host via sudo. Default false. Command action only.",
444
+ description: "[command] Optional, default false. Run as root on the remote via sudo.",
449
445
  }),
450
446
  ),
447
+ // file
451
448
  direction: Type.Optional(
452
449
  Type.Union([Type.Literal("upload"), Type.Literal("download")], {
453
- description: 'Transfer direction. Required when action is "file".',
450
+ description: "[file] REQUIRED. Transfer direction.",
454
451
  }),
455
452
  ),
456
453
  source: Type.Optional(
457
454
  Type.String({
458
- description:
459
- 'Source path (local for upload, remote for download). Required when action is "file".',
455
+ description: "[file] REQUIRED. Local path for upload, remote path for download.",
460
456
  }),
461
457
  ),
462
458
  destination: Type.Optional(
463
459
  Type.String({
464
- description:
465
- 'Destination path (remote for upload, local for download). Required when action is "file".',
460
+ description: "[file] REQUIRED. Remote path for upload, local path for download.",
466
461
  }),
467
462
  ),
468
463
  recursive: Type.Optional(
469
464
  Type.Boolean({
470
- description: "Copy a directory recursively. Default false. File action only.",
465
+ description: "[file] Optional, default false. Copy a directory recursively.",
471
466
  }),
472
467
  ),
473
468
  reason: Type.Optional(
474
469
  Type.String({
475
- description: "Short plain-English explanation of intent, shown to the user.",
470
+ description: "All actions. Short plain-English intent, shown to the user.",
476
471
  }),
477
472
  ),
478
473
  }),