@miosa/cli 1.0.62 → 1.0.64
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/README.md +20 -0
- package/dist/bin/miosa.js +1 -0
- package/dist/bin/miosa.js.map +1 -1
- package/dist/commands/capabilities.d.ts.map +1 -1
- package/dist/commands/capabilities.js +79 -8
- package/dist/commands/capabilities.js.map +1 -1
- package/dist/commands/connectors.js +1 -1
- package/dist/commands/{machines.d.ts → devices.d.ts} +1 -1
- package/dist/commands/devices.d.ts.map +1 -0
- package/dist/commands/devices.js +283 -0
- package/dist/commands/devices.js.map +1 -0
- package/dist/commands/sandbox.d.ts.map +1 -1
- package/dist/commands/sandbox.js +37 -6
- package/dist/commands/sandbox.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/machines.d.ts.map +0 -1
- package/dist/commands/machines.js +0 -29
- package/dist/commands/machines.js.map +0 -1
- package/dist/miosa-linux-x64 +0 -0
package/dist/commands/sandbox.js
CHANGED
|
@@ -362,11 +362,12 @@ export function register(program) {
|
|
|
362
362
|
}));
|
|
363
363
|
registerSandboxConnectorCommands(sandbox);
|
|
364
364
|
// prompt — invoke an in-Sandbox AI agent CLI (mirrors `box prompt`).
|
|
365
|
-
// Implemented as
|
|
365
|
+
// Implemented as sandbox exec so agents work inside the remote filesystem.
|
|
366
366
|
sandbox
|
|
367
367
|
.command("prompt <sandbox-id> <instruction...>")
|
|
368
|
-
.description("Run an in-Sandbox AI agent
|
|
369
|
-
.option("--provider <name>", "
|
|
368
|
+
.description("Run an in-Sandbox AI agent runtime with the given instruction")
|
|
369
|
+
.option("--provider <name>", "Agent runtime: claude (default), claude-code, codex, pi, hermes, osa, custom")
|
|
370
|
+
.option("--runtime-command <command>", "Executable command for --provider custom, e.g. 'hermes-agent run'")
|
|
370
371
|
.option("--model <name>", "Provider-specific model name")
|
|
371
372
|
.option("--connector <uid>", "MIOSA Connect connector UID to preflight before running the agent")
|
|
372
373
|
.option("--preflight", "Verify the Sandbox has the requested provider connector before exec")
|
|
@@ -375,8 +376,9 @@ export function register(program) {
|
|
|
375
376
|
.option("--json", "Output as JSON")
|
|
376
377
|
.action((id, words, opts) => runAction(async () => {
|
|
377
378
|
const provider = opts.provider ?? "claude";
|
|
378
|
-
const
|
|
379
|
-
if (!
|
|
379
|
+
const runtimeCommand = runtimeCommandForProvider(provider, opts.runtimeCommand);
|
|
380
|
+
if (!runtimeCommand) {
|
|
381
|
+
const allowedProviders = supportedPromptProviders();
|
|
380
382
|
throw new Error(`Unsupported provider "${provider}". Use: ${allowedProviders.join(", ")}`);
|
|
381
383
|
}
|
|
382
384
|
if (opts.connector || opts.preflight) {
|
|
@@ -391,7 +393,7 @@ export function register(program) {
|
|
|
391
393
|
const modelFlag = opts.model
|
|
392
394
|
? ` --model ${`'${opts.model.replace(/'/g, "'\\''")}'`}`
|
|
393
395
|
: "";
|
|
394
|
-
const command = commandInCwd(`${
|
|
396
|
+
const command = commandInCwd(`${runtimeCommand}${modelFlag} ${shellQuote(instruction)}`, opts.cwd);
|
|
395
397
|
const body = { command };
|
|
396
398
|
if (opts.cwd) {
|
|
397
399
|
body["cwd"] = opts.cwd;
|
|
@@ -3027,6 +3029,35 @@ function commandInCwd(command, cwd) {
|
|
|
3027
3029
|
return command;
|
|
3028
3030
|
return `cd ${shellQuote(cwd)} && ${command}`;
|
|
3029
3031
|
}
|
|
3032
|
+
function supportedPromptProviders() {
|
|
3033
|
+
return [
|
|
3034
|
+
"claude",
|
|
3035
|
+
"claude-code",
|
|
3036
|
+
"codex",
|
|
3037
|
+
"pi",
|
|
3038
|
+
"hermes",
|
|
3039
|
+
"osa",
|
|
3040
|
+
"custom",
|
|
3041
|
+
];
|
|
3042
|
+
}
|
|
3043
|
+
function runtimeCommandForProvider(provider, runtimeCommand) {
|
|
3044
|
+
const normalized = provider.trim().toLowerCase();
|
|
3045
|
+
if (normalized === "custom") {
|
|
3046
|
+
if (!runtimeCommand?.trim()) {
|
|
3047
|
+
throw new Error("--provider custom requires --runtime-command, e.g. --runtime-command 'hermes-agent run'");
|
|
3048
|
+
}
|
|
3049
|
+
return runtimeCommand.trim();
|
|
3050
|
+
}
|
|
3051
|
+
const builtIns = {
|
|
3052
|
+
claude: "claude",
|
|
3053
|
+
"claude-code": "claude",
|
|
3054
|
+
codex: "codex",
|
|
3055
|
+
pi: "pi",
|
|
3056
|
+
hermes: "hermes",
|
|
3057
|
+
osa: "osa",
|
|
3058
|
+
};
|
|
3059
|
+
return builtIns[normalized] ?? null;
|
|
3060
|
+
}
|
|
3030
3061
|
function backgroundCommand(command) {
|
|
3031
3062
|
if (!command.trim())
|
|
3032
3063
|
return command;
|