chore: archive AgentDock v1 implementation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Server,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateSet("codex", "claude", "codebuddy", "kimi", "opencode", "qwen", "dsh")]
|
||||
[string]$Tool,
|
||||
|
||||
[string]$Project = ".",
|
||||
|
||||
[string]$Container = "ai-tools",
|
||||
|
||||
[string[]]$ToolArguments
|
||||
)
|
||||
|
||||
function ConvertTo-PosixArgument {
|
||||
param([string]$Value)
|
||||
return "'" + $Value.Replace("'", "'`"'`"'") + "'"
|
||||
}
|
||||
|
||||
if ($Project.StartsWith("/") -or $Project -match "(^|[\\/])\.\.([\\/]|$)") {
|
||||
throw "Project must be a path below /workspace."
|
||||
}
|
||||
|
||||
$remoteArguments = @(
|
||||
"docker", "exec", "-it",
|
||||
"--workdir", "/workspace/$Project",
|
||||
$Container,
|
||||
$Tool
|
||||
) + $ToolArguments
|
||||
|
||||
$remoteCommand = ($remoteArguments | ForEach-Object { ConvertTo-PosixArgument $_ }) -join " "
|
||||
& ssh -tt $Server $remoteCommand
|
||||
exit $LASTEXITCODE
|
||||
Reference in New Issue
Block a user