Skip to content

Commit 36482e9

Browse files
authored
feat(agent): publish orchestration CLI primitives
* fix(sandbox): expiry warning, destroyed-not-paused guidance, surface boot last_error, 1h examples Addresses teammate bug report: warn when sandbox <5min remaining; clearer SANDBOX_NOT_RUNNING/destroyed messaging; surface metadata.last_error.reason on create --wait failures; recommend --timeout 1h for app-building. * feat(cli): add miosa auth project-auth enable/disable/status commands Adds `miosa auth project-auth status|enable|disable` subcommands so developers can manage built-in per-resource auth from the CLI. Mirrors the POST /api/v1/project-auth/enable|disable and GET /api/v1/project-auth/status REST endpoints. * feat(agent): expose runtime orchestration commands * feat(agent): support async group dispatch * chore(release): bump cli to 1.0.76 * feat(agent): add group event CLI * feat(agent): publish orchestration CLI primitives
1 parent 1ec649d commit 36482e9

23 files changed

Lines changed: 3865 additions & 104 deletions

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@miosa/cli",
3-
"version": "1.0.67",
3+
"version": "1.0.78",
44
"description": "MIOSA platform CLI — projects, sandboxes, deploys, databases, more",
55
"type": "module",
66
"bin": {

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bin/miosa.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ const commandModules = [
167167
"../commands/computers.js",
168168
"../commands/snapshot.js",
169169
"../commands/sandbox.js",
170+
"../commands/agent-run-groups.js",
171+
"../commands/agent-runs.js",
172+
"../commands/agent-runtime-profiles.js",
173+
"../commands/runtime-env.js",
170174
"../commands/connect.js",
171175
"../commands/ssh.js",
172176
"../commands/exec.js",

src/client.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,49 @@ export class MiosaClient {
138138
return this.get<T>(path);
139139
}
140140

141+
/** Generic binary GET for file/artifact download routes. */
142+
async apiGetBinary(path: string): Promise<Buffer> {
143+
let res: Dispatcher.ResponseData;
144+
try {
145+
res = await request(this.url(path), {
146+
method: "GET",
147+
headers: this.headers(),
148+
});
149+
} catch (err) {
150+
throw new NetworkError(
151+
`Network error: ${err instanceof Error ? err.message : String(err)}`,
152+
"Check your connection and endpoint: miosa status",
153+
);
154+
}
155+
if (res.statusCode >= 400) return this.parseError(res, "GET", path);
156+
const chunks: Buffer[] = [];
157+
for await (const chunk of res.body) {
158+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
159+
}
160+
return Buffer.concat(chunks);
161+
}
162+
163+
/** Generic SSE GET for command groups that stream API events. */
164+
async apiStream(path: string): Promise<Dispatcher.ResponseData> {
165+
let res: Dispatcher.ResponseData;
166+
try {
167+
res = await request(this.url(path), {
168+
method: "GET",
169+
headers: {
170+
...this.headers(),
171+
Accept: "text/event-stream",
172+
},
173+
});
174+
} catch (err) {
175+
throw new NetworkError(
176+
`Network error: ${err instanceof Error ? err.message : String(err)}`,
177+
"Check your connection and endpoint: miosa status",
178+
);
179+
}
180+
if (res.statusCode >= 400) return this.parseError(res, "GET", path);
181+
return res;
182+
}
183+
141184
/** Generic POST for command groups that map directly to stable API routes. */
142185
async apiPost<T>(path: string, body?: unknown): Promise<T> {
143186
return this.post<T>(path, body);

0 commit comments

Comments
 (0)