@miosa/cli 0.2.0
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 +327 -0
- package/dist/bin/miosa.d.ts +3 -0
- package/dist/bin/miosa.d.ts.map +1 -0
- package/dist/bin/miosa.js +139 -0
- package/dist/bin/miosa.js.map +1 -0
- package/dist/client.d.ts +74 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +523 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/agent.d.ts +18 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +468 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/alerts.d.ts +3 -0
- package/dist/commands/alerts.d.ts.map +1 -0
- package/dist/commands/alerts.js +41 -0
- package/dist/commands/alerts.js.map +1 -0
- package/dist/commands/api-keys.d.ts +3 -0
- package/dist/commands/api-keys.d.ts.map +1 -0
- package/dist/commands/api-keys.js +119 -0
- package/dist/commands/api-keys.js.map +1 -0
- package/dist/commands/api-resource.d.ts +20 -0
- package/dist/commands/api-resource.d.ts.map +1 -0
- package/dist/commands/api-resource.js +120 -0
- package/dist/commands/api-resource.js.map +1 -0
- package/dist/commands/apps.d.ts +3 -0
- package/dist/commands/apps.d.ts.map +1 -0
- package/dist/commands/apps.js +218 -0
- package/dist/commands/apps.js.map +1 -0
- package/dist/commands/audit.d.ts +3 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +25 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +363 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/backups.d.ts +3 -0
- package/dist/commands/backups.d.ts.map +1 -0
- package/dist/commands/backups.js +23 -0
- package/dist/commands/backups.js.map +1 -0
- package/dist/commands/checkpoints.d.ts +3 -0
- package/dist/commands/checkpoints.d.ts.map +1 -0
- package/dist/commands/checkpoints.js +33 -0
- package/dist/commands/checkpoints.js.map +1 -0
- package/dist/commands/computers.d.ts +3 -0
- package/dist/commands/computers.d.ts.map +1 -0
- package/dist/commands/computers.js +118 -0
- package/dist/commands/computers.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +114 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/connect.d.ts +3 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +96 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/containers.d.ts +3 -0
- package/dist/commands/containers.d.ts.map +1 -0
- package/dist/commands/containers.js +20 -0
- package/dist/commands/containers.js.map +1 -0
- package/dist/commands/cp.d.ts +3 -0
- package/dist/commands/cp.d.ts.map +1 -0
- package/dist/commands/cp.js +102 -0
- package/dist/commands/cp.js.map +1 -0
- package/dist/commands/cron.d.ts +3 -0
- package/dist/commands/cron.d.ts.map +1 -0
- package/dist/commands/cron.js +65 -0
- package/dist/commands/cron.js.map +1 -0
- package/dist/commands/databases.d.ts +3 -0
- package/dist/commands/databases.d.ts.map +1 -0
- package/dist/commands/databases.js +222 -0
- package/dist/commands/databases.js.map +1 -0
- package/dist/commands/db.d.ts +3 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +174 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/deploy.d.ts +3 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +579 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/desktop.d.ts +3 -0
- package/dist/commands/desktop.d.ts.map +1 -0
- package/dist/commands/desktop.js +276 -0
- package/dist/commands/desktop.js.map +1 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +246 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +241 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/domains.d.ts +3 -0
- package/dist/commands/domains.d.ts.map +1 -0
- package/dist/commands/domains.js +31 -0
- package/dist/commands/domains.js.map +1 -0
- package/dist/commands/enterprise-util.d.ts +37 -0
- package/dist/commands/enterprise-util.d.ts.map +1 -0
- package/dist/commands/enterprise-util.js +185 -0
- package/dist/commands/enterprise-util.js.map +1 -0
- package/dist/commands/exec.d.ts +3 -0
- package/dist/commands/exec.d.ts.map +1 -0
- package/dist/commands/exec.js +68 -0
- package/dist/commands/exec.js.map +1 -0
- package/dist/commands/functions.d.ts +3 -0
- package/dist/commands/functions.d.ts.map +1 -0
- package/dist/commands/functions.js +47 -0
- package/dist/commands/functions.js.map +1 -0
- package/dist/commands/gha-runners.d.ts +3 -0
- package/dist/commands/gha-runners.d.ts.map +1 -0
- package/dist/commands/gha-runners.js +33 -0
- package/dist/commands/gha-runners.js.map +1 -0
- package/dist/commands/groups.d.ts +3 -0
- package/dist/commands/groups.d.ts.map +1 -0
- package/dist/commands/groups.js +38 -0
- package/dist/commands/groups.js.map +1 -0
- package/dist/commands/host.d.ts +3 -0
- package/dist/commands/host.d.ts.map +1 -0
- package/dist/commands/host.js +74 -0
- package/dist/commands/host.js.map +1 -0
- package/dist/commands/hosts.d.ts +3 -0
- package/dist/commands/hosts.d.ts.map +1 -0
- package/dist/commands/hosts.js +90 -0
- package/dist/commands/hosts.js.map +1 -0
- package/dist/commands/link.d.ts +8 -0
- package/dist/commands/link.d.ts.map +1 -0
- package/dist/commands/link.js +124 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +172 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +17 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/logs.d.ts +3 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +94 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/ls.d.ts +3 -0
- package/dist/commands/ls.d.ts.map +1 -0
- package/dist/commands/ls.js +67 -0
- package/dist/commands/ls.js.map +1 -0
- package/dist/commands/machines.d.ts +3 -0
- package/dist/commands/machines.d.ts.map +1 -0
- package/dist/commands/machines.js +29 -0
- package/dist/commands/machines.js.map +1 -0
- package/dist/commands/mcp.d.ts +21 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +1021 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/meshes.d.ts +3 -0
- package/dist/commands/meshes.d.ts.map +1 -0
- package/dist/commands/meshes.js +27 -0
- package/dist/commands/meshes.js.map +1 -0
- package/dist/commands/network-policy.d.ts +3 -0
- package/dist/commands/network-policy.d.ts.map +1 -0
- package/dist/commands/network-policy.js +40 -0
- package/dist/commands/network-policy.js.map +1 -0
- package/dist/commands/project.d.ts +4 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +25 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/pull.d.ts +3 -0
- package/dist/commands/pull.d.ts.map +1 -0
- package/dist/commands/pull.js +155 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/regions.d.ts +3 -0
- package/dist/commands/regions.d.ts.map +1 -0
- package/dist/commands/regions.js +67 -0
- package/dist/commands/regions.js.map +1 -0
- package/dist/commands/releases.d.ts +3 -0
- package/dist/commands/releases.d.ts.map +1 -0
- package/dist/commands/releases.js +176 -0
- package/dist/commands/releases.js.map +1 -0
- package/dist/commands/rm.d.ts +3 -0
- package/dist/commands/rm.d.ts.map +1 -0
- package/dist/commands/rm.js +42 -0
- package/dist/commands/rm.js.map +1 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +131 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/sandbox.d.ts +3 -0
- package/dist/commands/sandbox.d.ts.map +1 -0
- package/dist/commands/sandbox.js +352 -0
- package/dist/commands/sandbox.js.map +1 -0
- package/dist/commands/schedules.d.ts +3 -0
- package/dist/commands/schedules.d.ts.map +1 -0
- package/dist/commands/schedules.js +37 -0
- package/dist/commands/schedules.js.map +1 -0
- package/dist/commands/secrets.d.ts +3 -0
- package/dist/commands/secrets.d.ts.map +1 -0
- package/dist/commands/secrets.js +194 -0
- package/dist/commands/secrets.js.map +1 -0
- package/dist/commands/services.d.ts +3 -0
- package/dist/commands/services.d.ts.map +1 -0
- package/dist/commands/services.js +70 -0
- package/dist/commands/services.js.map +1 -0
- package/dist/commands/shell.d.ts +16 -0
- package/dist/commands/shell.d.ts.map +1 -0
- package/dist/commands/shell.js +527 -0
- package/dist/commands/shell.js.map +1 -0
- package/dist/commands/snapshot.d.ts +10 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +181 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/ssh.d.ts +3 -0
- package/dist/commands/ssh.d.ts.map +1 -0
- package/dist/commands/ssh.js +37 -0
- package/dist/commands/ssh.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +300 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/storage.d.ts +3 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +180 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/tenant.d.ts +3 -0
- package/dist/commands/tenant.d.ts.map +1 -0
- package/dist/commands/tenant.js +87 -0
- package/dist/commands/tenant.js.map +1 -0
- package/dist/commands/tunnel.d.ts +3 -0
- package/dist/commands/tunnel.d.ts.map +1 -0
- package/dist/commands/tunnel.js +418 -0
- package/dist/commands/tunnel.js.map +1 -0
- package/dist/commands/up.d.ts +14 -0
- package/dist/commands/up.d.ts.map +1 -0
- package/dist/commands/up.js +703 -0
- package/dist/commands/up.js.map +1 -0
- package/dist/commands/util.d.ts +19 -0
- package/dist/commands/util.d.ts.map +1 -0
- package/dist/commands/util.js +116 -0
- package/dist/commands/util.js.map +1 -0
- package/dist/commands/volumes.d.ts +3 -0
- package/dist/commands/volumes.d.ts.map +1 -0
- package/dist/commands/volumes.js +196 -0
- package/dist/commands/volumes.js.map +1 -0
- package/dist/commands/watch.d.ts +3 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +398 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/commands/webhooks.d.ts +3 -0
- package/dist/commands/webhooks.d.ts.map +1 -0
- package/dist/commands/webhooks.js +23 -0
- package/dist/commands/webhooks.js.map +1 -0
- package/dist/commands/whoami.d.ts +3 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +84 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/commands/workspaces.d.ts +3 -0
- package/dist/commands/workspaces.d.ts.map +1 -0
- package/dist/commands/workspaces.js +87 -0
- package/dist/commands/workspaces.js.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +129 -0
- package/dist/config.js.map +1 -0
- package/dist/errors.d.ts +22 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +62 -0
- package/dist/errors.js.map +1 -0
- package/dist/framework-detector.d.ts +22 -0
- package/dist/framework-detector.d.ts.map +1 -0
- package/dist/framework-detector.js +373 -0
- package/dist/framework-detector.js.map +1 -0
- package/dist/pty/raw-mode.d.ts +7 -0
- package/dist/pty/raw-mode.d.ts.map +1 -0
- package/dist/pty/raw-mode.js +22 -0
- package/dist/pty/raw-mode.js.map +1 -0
- package/dist/pty/ws-pty-client.d.ts +12 -0
- package/dist/pty/ws-pty-client.d.ts.map +1 -0
- package/dist/pty/ws-pty-client.js +69 -0
- package/dist/pty/ws-pty-client.js.map +1 -0
- package/dist/types.d.ts +326 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/progress.d.ts +10 -0
- package/dist/ui/progress.d.ts.map +1 -0
- package/dist/ui/progress.js +36 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/spinner.d.ts +4 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +7 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/table.d.ts +8 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +46 -0
- package/dist/ui/table.js.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# @miosa/cli
|
|
2
|
+
|
|
3
|
+
The official MIOSA command-line interface. Deploy apps and manage OpenComputers hosts from your shell.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g @miosa/cli
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Deploy — 60 seconds to first deploy
|
|
10
|
+
|
|
11
|
+
Point the CLI at any repo and it handles the rest: framework detection, build wiring, GitHub webhook setup, and live log streaming.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
$ cd ~/my-project
|
|
15
|
+
$ miosa login
|
|
16
|
+
$ miosa deploy
|
|
17
|
+
|
|
18
|
+
Detected: Next.js 15 (confidence 95%)
|
|
19
|
+
Repo: https://github.com/me/my-project
|
|
20
|
+
Branch: main
|
|
21
|
+
|
|
22
|
+
? Deployment name: my-project
|
|
23
|
+
? Branch to deploy: main
|
|
24
|
+
? Build command: npm run build
|
|
25
|
+
? Run command: npm start
|
|
26
|
+
? Create deployment? Yes
|
|
27
|
+
|
|
28
|
+
Deployment "my-project" created (slug: my-project-x7k2)
|
|
29
|
+
Saved .miosa.json
|
|
30
|
+
|
|
31
|
+
ACTION REQUIRED — GitHub Webhook
|
|
32
|
+
The webhook secret below is shown ONCE. Store it now.
|
|
33
|
+
|
|
34
|
+
Webhook URL: https://api.miosa.ai/api/v1/integrations/github/webhook
|
|
35
|
+
Content type: application/json
|
|
36
|
+
Secret: a3f8b2c1d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9
|
|
37
|
+
Events: push
|
|
38
|
+
|
|
39
|
+
Add this at: https://github.com/me/my-project/settings/hooks/new
|
|
40
|
+
|
|
41
|
+
Initial build queued
|
|
42
|
+
|
|
43
|
+
Build log:
|
|
44
|
+
────────────────────────────────────────────────────────────
|
|
45
|
+
> npm run build
|
|
46
|
+
> next build
|
|
47
|
+
✓ Compiled successfully
|
|
48
|
+
────────────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
Deployed
|
|
51
|
+
|
|
52
|
+
URL: https://my-project-x7k2.me.miosa.app
|
|
53
|
+
|
|
54
|
+
Next steps:
|
|
55
|
+
miosa deploy logs — tail logs
|
|
56
|
+
miosa deploy domain add example.com — add custom domain
|
|
57
|
+
miosa deploy env set KEY=VALUE — set env var
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
On subsequent runs from the same directory, `miosa deploy` reads `.miosa.json` and skips all prompts — just queues a rebuild and streams logs.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Trigger a rebuild any time
|
|
64
|
+
miosa deploy
|
|
65
|
+
|
|
66
|
+
# Or explicitly
|
|
67
|
+
miosa deploy redeploy
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Deploy sub-commands
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
miosa deploy list # All deployments for this tenant
|
|
74
|
+
miosa deploy logs [id] # Tail live build logs
|
|
75
|
+
miosa deploy redeploy [id] # Manual rebuild
|
|
76
|
+
miosa deploy env set KEY=VALUE [--id id] # Set env var
|
|
77
|
+
miosa deploy env list [id] # Show env vars (masked)
|
|
78
|
+
miosa deploy domain add example.com [id] # Add custom domain
|
|
79
|
+
miosa deploy destroy [id] # Tear down deployment
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Supported frameworks (auto-detected)
|
|
83
|
+
|
|
84
|
+
| Framework | Detection | Build | Run |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
| Next.js | `next` in package.json | `npm run build` | `npm start` |
|
|
87
|
+
| SvelteKit | `@sveltejs/kit` in package.json | `npm run build` | `node build` |
|
|
88
|
+
| Vite + React | `vite` + `react` in package.json | `npm run build` | `npx serve dist` |
|
|
89
|
+
| Phoenix (Elixir) | `mix.exs` with `:phoenix` | `mix release` | `_build/prod/rel/.../bin/... start` |
|
|
90
|
+
| Django | `manage.py` + `requirements.txt` | `pip install` + `collectstatic` | `gunicorn` |
|
|
91
|
+
| Flask | `requirements.txt` with flask | `pip install` | `gunicorn app:app` |
|
|
92
|
+
| Ruby on Rails | `Gemfile` + `config/application.rb` | `bundle install` | `rails server` |
|
|
93
|
+
| Go | `go.mod` | `go build -o app .` | `./app` |
|
|
94
|
+
| Rust | `Cargo.toml` | `cargo build --release` | `./target/release/<name>` |
|
|
95
|
+
| Static HTML | `index.html` (no build system) | — | `npx serve .` |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## OpenComputers hosts
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Authenticate
|
|
103
|
+
miosa login
|
|
104
|
+
|
|
105
|
+
# List your hosts
|
|
106
|
+
miosa hosts
|
|
107
|
+
|
|
108
|
+
# Open an interactive terminal
|
|
109
|
+
miosa ssh my-mac
|
|
110
|
+
|
|
111
|
+
# Run a command
|
|
112
|
+
miosa exec my-mac "npm test"
|
|
113
|
+
|
|
114
|
+
# Upload a file
|
|
115
|
+
miosa cp ./build.tar.gz my-mac:/tmp/
|
|
116
|
+
|
|
117
|
+
# Expose a port publicly
|
|
118
|
+
miosa tunnel open my-mac --port 3000
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Configuration
|
|
122
|
+
|
|
123
|
+
Config is stored at `~/.miosa/config.json`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"endpoint": "https://api.miosa.ai",
|
|
128
|
+
"api_key": "msk_u_...",
|
|
129
|
+
"default_host": null
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Precedence: CLI flags > environment variables > config file > interactive prompt.
|
|
134
|
+
|
|
135
|
+
**Environment variables:**
|
|
136
|
+
|
|
137
|
+
| Variable | Description |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `MIOSA_API_KEY` | API key (overrides config file) |
|
|
140
|
+
| `MIOSA_ENDPOINT` | API endpoint (overrides config file) |
|
|
141
|
+
| `MIOSA_DEBUG` | Set to any value to enable debug output |
|
|
142
|
+
|
|
143
|
+
## Commands
|
|
144
|
+
|
|
145
|
+
### `miosa deploy [sub-command]`
|
|
146
|
+
|
|
147
|
+
Deploy a GitHub repo. See the [Deploy section](#deploy--60-seconds-to-first-deploy) above for the full flow.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
miosa deploy # First deploy or redeploy from .miosa.json
|
|
151
|
+
miosa deploy list [--json] # List all deployments
|
|
152
|
+
miosa deploy logs [id] # Tail live build logs
|
|
153
|
+
miosa deploy redeploy [id] [--no-follow] # Manual rebuild
|
|
154
|
+
miosa deploy env set KEY=VALUE [--id id] # Set env var
|
|
155
|
+
miosa deploy env list [id] # Show env vars (masked)
|
|
156
|
+
miosa deploy domain add <domain> [id] # Add custom domain
|
|
157
|
+
miosa deploy destroy [id] [-f] # Tear down deployment
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### `miosa login [--api-key key]`
|
|
161
|
+
|
|
162
|
+
Authenticate with your MIOSA API key. If no key is provided, you'll be prompted interactively.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
miosa login
|
|
166
|
+
miosa login --api-key msk_u_yourkey
|
|
167
|
+
echo "msk_u_yourkey" | miosa login # non-TTY / CI
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### `miosa logout`
|
|
171
|
+
|
|
172
|
+
Remove the stored API key.
|
|
173
|
+
|
|
174
|
+
### `miosa hosts [--json]`
|
|
175
|
+
|
|
176
|
+
List all registered hosts.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
miosa hosts
|
|
180
|
+
miosa hosts --json | jq '.[].name'
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### `miosa host <name-or-id> [--json]`
|
|
184
|
+
|
|
185
|
+
Show details for a specific host including live telemetry.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
miosa host my-mac
|
|
189
|
+
miosa host abc12345
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### `miosa connect [name]`
|
|
193
|
+
|
|
194
|
+
Register a new host interactively. Prints the install command and waits for the host to come online.
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
miosa connect
|
|
198
|
+
miosa connect my-new-server
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### `miosa ssh <host> [--cmd "..."]`
|
|
202
|
+
|
|
203
|
+
Open an interactive PTY terminal session on a host.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
miosa ssh my-mac
|
|
207
|
+
miosa ssh my-mac --cmd "ls -la"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### `miosa exec <host> <cmd> [args...] [--cwd dir] [--env KEY=VAL] [--timeout 30s]`
|
|
211
|
+
|
|
212
|
+
Run a command non-interactively and stream output. Exits with the remote exit code.
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
miosa exec my-mac npm test
|
|
216
|
+
miosa exec my-mac ls -- -la /tmp
|
|
217
|
+
miosa exec my-mac env --env NODE_ENV=production --env PORT=3000
|
|
218
|
+
miosa exec my-mac make build --cwd /home/user/project --timeout 10m
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### `miosa cp <src> <dst>`
|
|
222
|
+
|
|
223
|
+
Copy files between local and remote. Use `host:/path` for remote paths.
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Upload
|
|
227
|
+
miosa cp ./local.txt my-mac:/tmp/
|
|
228
|
+
miosa cp -r ./dist my-mac:/var/www/
|
|
229
|
+
|
|
230
|
+
# Download
|
|
231
|
+
miosa cp my-mac:/var/log/app.log ./
|
|
232
|
+
miosa cp my-mac:/home/user/report.pdf ~/Downloads/
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### `miosa ls <host>:<path> [-a] [-l]`
|
|
236
|
+
|
|
237
|
+
List files on a host.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
miosa ls my-mac:/tmp
|
|
241
|
+
miosa ls my-mac:/home/user -la
|
|
242
|
+
miosa ls my-mac:/ -a
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### `miosa rm <host>:<path> [-r] [-f]`
|
|
246
|
+
|
|
247
|
+
Remove a file or directory on a host. Prompts for confirmation unless `-f`.
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
miosa rm my-mac:/tmp/old-build.tar.gz
|
|
251
|
+
miosa rm -rf my-mac:/tmp/build-artifacts
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### `miosa tunnel open <host> --port <n> [--name slug] [--watch]`
|
|
255
|
+
|
|
256
|
+
Expose a port on a host publicly.
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
miosa tunnel open my-mac --port 3000
|
|
260
|
+
miosa tunnel open my-mac --port 8080 --name my-app --watch
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### `miosa tunnel list <host>`
|
|
264
|
+
|
|
265
|
+
List active tunnels on a host.
|
|
266
|
+
|
|
267
|
+
### `miosa tunnel close <host> <slug>`
|
|
268
|
+
|
|
269
|
+
Close (revoke) a tunnel.
|
|
270
|
+
|
|
271
|
+
### `miosa agent <host> "<task>" [--model] [--steps] [--timeout]`
|
|
272
|
+
|
|
273
|
+
Dispatch an AI agent task. Streams thoughts, tool calls, and results live.
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
miosa agent my-mac "run the test suite and fix any failing tests"
|
|
277
|
+
miosa agent my-mac "update all npm dependencies" --steps 20
|
|
278
|
+
miosa agent my-mac "optimize the database queries" --model nemotron-3-super
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### `miosa watch <host>`
|
|
282
|
+
|
|
283
|
+
Stream live telemetry and events from a host.
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
miosa watch my-mac
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### `miosa status`
|
|
290
|
+
|
|
291
|
+
Show current auth, endpoint, tenant info, credits, and host count.
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
miosa status
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Exit codes
|
|
298
|
+
|
|
299
|
+
| Code | Meaning |
|
|
300
|
+
|---|---|
|
|
301
|
+
| 0 | Success |
|
|
302
|
+
| 1 | User error (bad args, not found, etc.) |
|
|
303
|
+
| 2 | Network error |
|
|
304
|
+
| 3 | Authentication error |
|
|
305
|
+
| 4 | Server error |
|
|
306
|
+
|
|
307
|
+
## Troubleshooting
|
|
308
|
+
|
|
309
|
+
**"No API key configured"** — Run `miosa login`.
|
|
310
|
+
|
|
311
|
+
**"Host not found"** — Check `miosa hosts` for the correct name or ID.
|
|
312
|
+
|
|
313
|
+
**"Insufficient credits"** — Top up at https://miosa.ai/billing.
|
|
314
|
+
|
|
315
|
+
**Network errors** — Check your connection. Use `MIOSA_DEBUG=1 miosa <cmd>` for stack traces.
|
|
316
|
+
|
|
317
|
+
**Custom endpoint** — `MIOSA_ENDPOINT=https://your-instance.ai miosa hosts`
|
|
318
|
+
|
|
319
|
+
## Links
|
|
320
|
+
|
|
321
|
+
- Documentation: https://docs.miosa.ai/cli
|
|
322
|
+
- Platform: https://miosa.ai
|
|
323
|
+
- Support: support@miosa.ai
|
|
324
|
+
|
|
325
|
+
## License
|
|
326
|
+
|
|
327
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miosa.d.ts","sourceRoot":"","sources":["../../src/bin/miosa.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
import { MiosaError } from "../errors.js";
|
|
8
|
+
// Dynamically read version from package.json so it stays in sync
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "../../package.json"), "utf8"));
|
|
11
|
+
const program = new Command();
|
|
12
|
+
program
|
|
13
|
+
.name("miosa")
|
|
14
|
+
.description("MIOSA CLI — application module infrastructure for the Optimal System. Manage Computers, Sandboxes, and OpenComputers hosts from your shell.")
|
|
15
|
+
.version(pkg.version, "-v, --version")
|
|
16
|
+
.addHelpText("after", `
|
|
17
|
+
Examples:
|
|
18
|
+
miosa login Authenticate (opens browser)
|
|
19
|
+
miosa login --api-key msk_u_... Authenticate with an API key
|
|
20
|
+
miosa login --stdin Pipe an API key: echo 'msk_...' | miosa login --stdin
|
|
21
|
+
miosa whoami Show current auth state (instant, cached)
|
|
22
|
+
miosa whoami --refresh Force live refresh of identity
|
|
23
|
+
miosa config ls List all config keys
|
|
24
|
+
miosa config set region us-nyc Set a config value
|
|
25
|
+
miosa doctor Diagnose CLI, auth, and toolchain
|
|
26
|
+
miosa computers list List all Computers
|
|
27
|
+
miosa computers vnc <id> Open a Computer's VNC viewer
|
|
28
|
+
miosa sandbox list List all Sandboxes
|
|
29
|
+
miosa sandbox exec <id> --data '{"cmd":"…"}' Run a command in a Sandbox
|
|
30
|
+
miosa hosts List all OpenComputers hosts
|
|
31
|
+
miosa ssh my-mac Interactive terminal on a host
|
|
32
|
+
miosa exec my-mac "npm test" Run a command and stream output
|
|
33
|
+
miosa cp ./file.txt my-mac:/tmp/ Upload a file
|
|
34
|
+
miosa tunnel open my-mac --port 3000 Expose a port publicly
|
|
35
|
+
miosa agent my-mac "run the tests" Dispatch an AI agent task
|
|
36
|
+
miosa watch my-dev-box Stream real-time events from a Computer
|
|
37
|
+
miosa watch my-dev-box --filter exec,desktop Watch only exec and desktop events
|
|
38
|
+
miosa watch my-dev-box --json Machine-readable event stream (one JSON/line)
|
|
39
|
+
miosa up Smart launch (auto-detects context)
|
|
40
|
+
miosa up --computer --os ubuntu Create a desktop computer
|
|
41
|
+
miosa up --sandbox --image python-3.12 Create a sandbox
|
|
42
|
+
miosa deploy Deploy a GitHub repo (60s)
|
|
43
|
+
miosa status Show auth and account info
|
|
44
|
+
|
|
45
|
+
Documentation: https://miosa.ai/docs/cli/
|
|
46
|
+
`);
|
|
47
|
+
// Dynamically import and register all command modules
|
|
48
|
+
const commandModules = [
|
|
49
|
+
"../commands/auth.js",
|
|
50
|
+
"../commands/login.js",
|
|
51
|
+
"../commands/logout.js",
|
|
52
|
+
"../commands/whoami.js",
|
|
53
|
+
"../commands/config.js",
|
|
54
|
+
"../commands/doctor.js",
|
|
55
|
+
"../commands/hosts.js",
|
|
56
|
+
"../commands/host.js",
|
|
57
|
+
"../commands/computers.js",
|
|
58
|
+
"../commands/snapshot.js",
|
|
59
|
+
"../commands/sandbox.js",
|
|
60
|
+
"../commands/connect.js",
|
|
61
|
+
"../commands/ssh.js",
|
|
62
|
+
"../commands/exec.js",
|
|
63
|
+
"../commands/cp.js",
|
|
64
|
+
"../commands/ls.js",
|
|
65
|
+
"../commands/rm.js",
|
|
66
|
+
"../commands/tunnel.js",
|
|
67
|
+
"../commands/agent.js",
|
|
68
|
+
"../commands/watch.js",
|
|
69
|
+
"../commands/status.js",
|
|
70
|
+
"../commands/up.js",
|
|
71
|
+
"../commands/deploy.js",
|
|
72
|
+
"../commands/apps.js",
|
|
73
|
+
"../commands/logs.js",
|
|
74
|
+
"../commands/releases.js",
|
|
75
|
+
"../commands/secrets.js",
|
|
76
|
+
"../commands/volumes.js",
|
|
77
|
+
"../commands/regions.js",
|
|
78
|
+
"../commands/groups.js",
|
|
79
|
+
"../commands/meshes.js",
|
|
80
|
+
"../commands/schedules.js",
|
|
81
|
+
"../commands/alerts.js",
|
|
82
|
+
"../commands/audit.js",
|
|
83
|
+
"../commands/webhooks.js",
|
|
84
|
+
"../commands/gha-runners.js",
|
|
85
|
+
"../commands/backups.js",
|
|
86
|
+
"../commands/workspaces.js",
|
|
87
|
+
"../commands/services.js",
|
|
88
|
+
"../commands/containers.js",
|
|
89
|
+
"../commands/functions.js",
|
|
90
|
+
"../commands/cron.js",
|
|
91
|
+
"../commands/shell.js",
|
|
92
|
+
"../commands/mcp.js",
|
|
93
|
+
"../commands/link.js",
|
|
94
|
+
"../commands/pull.js",
|
|
95
|
+
"../commands/dev.js",
|
|
96
|
+
"../commands/run.js",
|
|
97
|
+
"../commands/tenant.js",
|
|
98
|
+
"../commands/db.js",
|
|
99
|
+
];
|
|
100
|
+
async function main() {
|
|
101
|
+
// Register all commands
|
|
102
|
+
for (const mod of commandModules) {
|
|
103
|
+
const m = (await import(mod));
|
|
104
|
+
m.register(program);
|
|
105
|
+
}
|
|
106
|
+
// Global error handler — catches unhandled MiosaErrors thrown outside command actions
|
|
107
|
+
process.on("uncaughtException", (err) => {
|
|
108
|
+
if (err instanceof MiosaError) {
|
|
109
|
+
console.error(chalk.red(`Error: ${err.message}`));
|
|
110
|
+
if (err.hint)
|
|
111
|
+
console.error(chalk.dim(` Hint: ${err.hint}`));
|
|
112
|
+
process.exit(err.exitCode);
|
|
113
|
+
}
|
|
114
|
+
console.error(chalk.red(`Fatal: ${err.message}`));
|
|
115
|
+
if (process.env["MIOSA_DEBUG"])
|
|
116
|
+
console.error(err.stack);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
});
|
|
119
|
+
process.on("unhandledRejection", (reason) => {
|
|
120
|
+
if (reason instanceof MiosaError) {
|
|
121
|
+
console.error(chalk.red(`Error: ${reason.message}`));
|
|
122
|
+
if (reason.hint)
|
|
123
|
+
console.error(chalk.dim(` Hint: ${reason.hint}`));
|
|
124
|
+
process.exit(reason.exitCode);
|
|
125
|
+
}
|
|
126
|
+
const msg = reason instanceof Error ? reason.message : String(reason);
|
|
127
|
+
console.error(chalk.red(`Fatal: ${msg}`));
|
|
128
|
+
if (process.env["MIOSA_DEBUG"] && reason instanceof Error)
|
|
129
|
+
console.error(reason.stack);
|
|
130
|
+
process.exit(1);
|
|
131
|
+
});
|
|
132
|
+
await program.parseAsync(process.argv);
|
|
133
|
+
}
|
|
134
|
+
main().catch((err) => {
|
|
135
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
136
|
+
console.error(chalk.red(`Fatal: ${msg}`));
|
|
137
|
+
process.exit(1);
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=miosa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miosa.js","sourceRoot":"","sources":["../../src/bin/miosa.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,iEAAiE;AACjE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,CACrC,CAAC;AAEzB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAA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ACtE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;QAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,MAAM,YAAY,KAAK;YACvD,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type Dispatcher } from "undici";
|
|
2
|
+
import type { AgentDispatchParams, BuildId, ComputerId, ComputerFsEntry, ComputerStatResult, CreateDeploymentParams, Deployment, DeploymentBuild, DeploymentId, EnvVarPreview, FsEntry, Host, HostId, Job, JobCreateParams, MiosaConfig, SseEvent, Tenant, TerminalTicket, Tunnel, TunnelCreateParams, TunnelSlug } from "./types.js";
|
|
3
|
+
export declare class MiosaClient {
|
|
4
|
+
private readonly endpoint;
|
|
5
|
+
private readonly apiKey;
|
|
6
|
+
constructor(config: MiosaConfig);
|
|
7
|
+
private headers;
|
|
8
|
+
private url;
|
|
9
|
+
private parseError;
|
|
10
|
+
private get;
|
|
11
|
+
private post;
|
|
12
|
+
private delete;
|
|
13
|
+
/** Generic GET for command groups that map directly to stable API routes. */
|
|
14
|
+
apiGet<T>(path: string): Promise<T>;
|
|
15
|
+
/** Generic POST for command groups that map directly to stable API routes. */
|
|
16
|
+
apiPost<T>(path: string, body?: unknown): Promise<T>;
|
|
17
|
+
/** Generic PUT for command groups that map directly to stable API routes. */
|
|
18
|
+
apiPut<T>(path: string, body?: unknown): Promise<T>;
|
|
19
|
+
/** Generic PATCH for command groups that map directly to stable API routes. */
|
|
20
|
+
apiPatch<T>(path: string, body?: unknown): Promise<T>;
|
|
21
|
+
/** Generic DELETE for command groups that map directly to stable API routes. */
|
|
22
|
+
apiDelete<T>(path: string): Promise<T>;
|
|
23
|
+
getTenant(): Promise<Tenant>;
|
|
24
|
+
listHosts(): Promise<Host[]>;
|
|
25
|
+
getHost(idOrName: string): Promise<Host>;
|
|
26
|
+
createHost(params: {
|
|
27
|
+
name: string;
|
|
28
|
+
platform?: string;
|
|
29
|
+
}): Promise<Host>;
|
|
30
|
+
getTerminalTicket(hostId: HostId): Promise<TerminalTicket>;
|
|
31
|
+
createJob(hostId: HostId, params: JobCreateParams): Promise<Job>;
|
|
32
|
+
/** Returns a raw Response for SSE streaming */
|
|
33
|
+
streamJob(hostId: HostId, params: JobCreateParams): Promise<Dispatcher.ResponseData>;
|
|
34
|
+
listFs(hostId: HostId, path: string): Promise<FsEntry[]>;
|
|
35
|
+
downloadFile(hostId: HostId, remotePath: string): Promise<Dispatcher.ResponseData>;
|
|
36
|
+
uploadFile(hostId: HostId, remotePath: string, data: Buffer, filename: string): Promise<void>;
|
|
37
|
+
deleteFs(hostId: HostId, path: string, recursive: boolean): Promise<void>;
|
|
38
|
+
computerListFiles(computerId: ComputerId, remotePath: string): Promise<ComputerFsEntry[]>;
|
|
39
|
+
computerWriteFile(computerId: ComputerId, remotePath: string, content: Buffer | string): Promise<void>;
|
|
40
|
+
computerDownloadFile(computerId: ComputerId, remotePath: string): Promise<Dispatcher.ResponseData>;
|
|
41
|
+
computerUploadFile(computerId: ComputerId, remotePath: string, data: Buffer, filename: string): Promise<void>;
|
|
42
|
+
computerMkdir(computerId: ComputerId, remotePath: string): Promise<void>;
|
|
43
|
+
computerDeleteFile(computerId: ComputerId, remotePath: string): Promise<void>;
|
|
44
|
+
computerStat(computerId: ComputerId, remotePath: string): Promise<ComputerStatResult>;
|
|
45
|
+
computerExec(computerId: ComputerId, command: string, opts?: {
|
|
46
|
+
language?: "shell" | "python";
|
|
47
|
+
}): Promise<Dispatcher.ResponseData>;
|
|
48
|
+
listTunnels(hostId: HostId): Promise<Tunnel[]>;
|
|
49
|
+
createTunnel(hostId: HostId, params: TunnelCreateParams): Promise<Tunnel>;
|
|
50
|
+
closeTunnel(hostId: HostId, slug: TunnelSlug): Promise<void>;
|
|
51
|
+
dispatchAgent(hostId: HostId, params: AgentDispatchParams): Promise<Dispatcher.ResponseData>;
|
|
52
|
+
listDeployments(): Promise<Deployment[]>;
|
|
53
|
+
getDeployment(id: DeploymentId): Promise<Deployment>;
|
|
54
|
+
createDeployment(params: CreateDeploymentParams): Promise<{
|
|
55
|
+
data: Deployment;
|
|
56
|
+
webhook_secret: string;
|
|
57
|
+
}>;
|
|
58
|
+
deleteDeployment(id: DeploymentId): Promise<{
|
|
59
|
+
id: string;
|
|
60
|
+
deleted: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
redeployDeployment(id: DeploymentId): Promise<DeploymentBuild>;
|
|
63
|
+
listBuilds(id: DeploymentId): Promise<DeploymentBuild[]>;
|
|
64
|
+
getBuild(id: DeploymentId, bid: BuildId): Promise<DeploymentBuild>;
|
|
65
|
+
/** Returns a raw SSE Response for deployment log streaming */
|
|
66
|
+
streamDeploymentLogs(id: DeploymentId): Promise<Dispatcher.ResponseData>;
|
|
67
|
+
getDeploymentEnv(id: DeploymentId): Promise<EnvVarPreview[]>;
|
|
68
|
+
setDeploymentEnv(id: DeploymentId, env: Record<string, string>): Promise<EnvVarPreview[]>;
|
|
69
|
+
watchEvents(hostId: HostId): Promise<Dispatcher.ResponseData>;
|
|
70
|
+
/** Open an SSE event stream for a Computer (Firecracker microVM). */
|
|
71
|
+
watchComputerEvents(computerId: ComputerId): Promise<Dispatcher.ResponseData>;
|
|
72
|
+
}
|
|
73
|
+
export declare function parseSse(body: Dispatcher.ResponseData["body"]): AsyncGenerator<SseEvent>;
|
|
74
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EAEnB,OAAO,EACP,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,OAAO,EACP,IAAI,EACJ,MAAM,EACN,GAAG,EACH,eAAe,EACf,WAAW,EACX,QAAQ,EACR,MAAM,EACN,cAAc,EACd,MAAM,EACN,kBAAkB,EAClB,UAAU,EACX,MAAM,YAAY,CAAC;AAGpB,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,MAAM,EAAE,WAAW;IAW/B,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,GAAG;YAIG,UAAU;YAWV,GAAG;YAiBH,IAAI;YAkBJ,MAAM;IAiBpB,6EAA6E;IACvE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIzC,8EAA8E;IACxE,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAI1D,6EAA6E;IACvE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OA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