@xynogen/pix-ssh 0.5.6 → 0.5.7
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 +1 -1
- package/src/index.ts +25 -30
package/package.json
CHANGED
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
|
-
"
|
|
408
|
-
"
|
|
409
|
-
"
|
|
410
|
-
"
|
|
411
|
-
|
|
412
|
-
"
|
|
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`
|
|
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`.
|
|
425
|
-
//
|
|
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.
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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
|
-
"
|
|
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:
|
|
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: "
|
|
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
|
|
470
|
+
description: "All actions. Short plain-English intent, shown to the user.",
|
|
476
471
|
}),
|
|
477
472
|
),
|
|
478
473
|
}),
|