@clipboard-health/groundcrew 4.3.3 → 4.3.4
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.
|
@@ -188,7 +188,7 @@ function buildUnwrappedHostLaunchCommand(arguments_) {
|
|
|
188
188
|
* strips them); they're `unset` on the host after setup and not passed to the
|
|
189
189
|
* agent wrap. The host keeps `cd`, the prompt read, and a temporary
|
|
190
190
|
* command-named shim so Safehouse can select the intended agent profile while
|
|
191
|
-
* the actual agent command remains `sh -
|
|
191
|
+
* the actual agent command remains `sh -c`.
|
|
192
192
|
*/
|
|
193
193
|
function buildSafehouseLaunchCommand(arguments_) {
|
|
194
194
|
const promptDir = dirname(arguments_.promptFile);
|
|
@@ -207,16 +207,16 @@ function buildSafehouseLaunchCommand(arguments_) {
|
|
|
207
207
|
if (arguments_.secretsFile !== undefined) {
|
|
208
208
|
lines.push(sourceSecretsLine(arguments_.secretsFile));
|
|
209
209
|
}
|
|
210
|
-
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `${safehouseWrapper} ${envPassFlag}sh -
|
|
210
|
+
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `${safehouseWrapper} ${envPassFlag}sh -c ${shellSingleQuote(setupCommand)}`);
|
|
211
211
|
if (arguments_.secretsFile !== undefined) {
|
|
212
212
|
lines.push(unsetSecretsLine());
|
|
213
213
|
}
|
|
214
214
|
lines.push(`_safehouse_shim_dir=$(mktemp -d "\${TMPDIR:-/tmp}/groundcrew-safehouse-XXXXXX")`, `trap 'rm -rf "$_safehouse_shim_dir"' EXIT`, `_safehouse_shim="$_safehouse_shim_dir/${safehouseCommandName}"`, `ln -s /bin/sh "$_safehouse_shim"`,
|
|
215
215
|
// Safehouse selects an agent profile from the wrapped command's basename.
|
|
216
|
-
// Running the real launch chain as `sh -
|
|
216
|
+
// Running the real launch chain as `sh -c` would make it see `sh`, so use
|
|
217
217
|
// an agent-named symlink to /bin/sh. This preserves per-agent profile
|
|
218
218
|
// selection without enabling every agent profile.
|
|
219
|
-
`${safehouseWrapper} "$_safehouse_shim" -
|
|
219
|
+
`${safehouseWrapper} "$_safehouse_shim" -c ${shellSingleQuote(agentCommand)} sh "$_p"; _safehouse_status=$?; rm -rf "$_safehouse_shim_dir"; trap - EXIT; exit "$_safehouse_status"`);
|
|
220
220
|
return lines.join(" && ");
|
|
221
221
|
}
|
|
222
222
|
function buildSdxLaunchCommand(arguments_) {
|
|
@@ -248,6 +248,6 @@ function buildSdxLaunchCommand(arguments_) {
|
|
|
248
248
|
if (arguments_.secretsFile !== undefined) {
|
|
249
249
|
lines.push(sourceSecretsLine(arguments_.secretsFile));
|
|
250
250
|
}
|
|
251
|
-
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `exec sbx exec -it ${sbxEnvironmentFlags}-w ${shellSingleQuote(arguments_.worktreeDir)} ${shellSingleQuote(arguments_.sandboxName)} sh -
|
|
251
|
+
lines.push(`_p=$(cat ${shellSingleQuote(arguments_.promptFile)})`, `rm -rf ${shellSingleQuote(promptDir)}`, `exec sbx exec -it ${sbxEnvironmentFlags}-w ${shellSingleQuote(arguments_.worktreeDir)} ${shellSingleQuote(arguments_.sandboxName)} sh -c ${shellSingleQuote(innerCommand)} sh "$_p"`);
|
|
252
252
|
return lines.join(" && ");
|
|
253
253
|
}
|
package/package.json
CHANGED