oblien 2.3.2 → 2.4.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 +1 -0
- package/dist/billing.d.ts +14 -10
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +17 -9
- package/dist/billing.js.map +1 -1
- package/dist/cli/commands/desktop.d.ts.map +1 -1
- package/dist/cli/commands/desktop.js +6 -2
- package/dist/cli/commands/desktop.js.map +1 -1
- package/dist/cli/commands/lifecycle.d.ts.map +1 -1
- package/dist/cli/commands/lifecycle.js +22 -0
- package/dist/cli/commands/lifecycle.js.map +1 -1
- package/dist/cli/commands/workspaces.d.ts.map +1 -1
- package/dist/cli/commands/workspaces.js +3 -0
- package/dist/cli/commands/workspaces.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/namespace.d.ts +6 -6
- package/dist/namespace.js +6 -6
- package/dist/resources/desktop.d.ts +10 -0
- package/dist/resources/desktop.d.ts.map +1 -1
- package/dist/resources/desktop.js +8 -0
- package/dist/resources/desktop.js.map +1 -1
- package/dist/resources/images.d.ts +44 -1
- package/dist/resources/images.d.ts.map +1 -1
- package/dist/resources/images.js.map +1 -1
- package/dist/resources/lifecycle.d.ts +11 -2
- package/dist/resources/lifecycle.d.ts.map +1 -1
- package/dist/resources/lifecycle.js +7 -2
- package/dist/resources/lifecycle.js.map +1 -1
- package/dist/types/billing.d.ts +48 -9
- package/dist/types/billing.d.ts.map +1 -1
- package/dist/types/billing.js +2 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/workspace-resources.d.ts +13 -0
- package/dist/types/workspace-resources.d.ts.map +1 -1
- package/dist/types/workspace.d.ts +7 -3
- package/dist/types/workspace.d.ts.map +1 -1
- package/docs/billing.md +123 -2
- package/docs/on-demand.md +43 -0
- package/docs/workspace-limit-report.md +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Sleep and wake on request
|
|
2
|
+
|
|
3
|
+
Automatic sleep is opt-in for permanent workspaces with memory snapshot support. It covers every exposed HTTP port URL and connected custom domain for that workspace.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import Oblien from 'oblien';
|
|
7
|
+
|
|
8
|
+
const client = new Oblien({
|
|
9
|
+
clientId: process.env.OBLIEN_CLIENT_ID,
|
|
10
|
+
clientSecret: process.env.OBLIEN_CLIENT_SECRET,
|
|
11
|
+
});
|
|
12
|
+
const ws = client.workspace('YOUR_WORKSPACE_ID');
|
|
13
|
+
|
|
14
|
+
// Start your app on 0.0.0.0:3000, then publish it.
|
|
15
|
+
const port = await ws.publicAccess.expose({ port: 3000 });
|
|
16
|
+
await ws.lifecycle.setIdle({ suspend_after: '15m' });
|
|
17
|
+
console.log(port);
|
|
18
|
+
|
|
19
|
+
// Read the policy/capability or disable automatic sleep.
|
|
20
|
+
console.log(await ws.lifecycle.get());
|
|
21
|
+
await ws.lifecycle.setIdle(null);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Creation accepts the same policy under `config.idle`:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
const workspace = await client.workspaces.create({
|
|
28
|
+
image: 'oblien/node:24', mode: 'permanent',
|
|
29
|
+
config: { idle: { suspend_after: '15m' } },
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`suspend_after` accepts seconds or a duration string, with a minimum of 120 seconds. The default `stop_after: 0` keeps saved RAM until wake. An optional retention time of at least one hour discards saved RAM after that long asleep; files remain, but the next wake cold-boots. For example `{ suspend_after: '15m', stop_after: '72h' }` requires an app that starts at boot.
|
|
34
|
+
|
|
35
|
+
The API coalesces concurrent wake/restore attempts across workers, ports and aliases. The edge waits for the requested application port and forwards each request after readiness. If startup exceeds its wait budget, it returns 503 with `Retry-After: 1`; wake continues. Retry with a deadline/backoff and use application idempotency keys for writes.
|
|
36
|
+
|
|
37
|
+
Requests and streams through the HTTP edge keep the workspace awake. For background jobs, direct TCP, SSH or runtime work, call `ws.lifecycle.ping()` periodically within the idle timeout or disable automatic sleep. External connections can expire during hibernation and need application-level reconnection.
|
|
38
|
+
|
|
39
|
+
While this policy is enabled, an existing public route can wake a stopped workspace too. `ws.lifecycle.setIdle(null)` disables automatic sleep and public wake; explicit Restore/Resume remains available. Revoke public ports/disconnect domains to remove public access entirely. Nested KVM workspaces currently reject automatic sleep because Firecracker cannot preserve their nested VM state.
|
|
40
|
+
|
|
41
|
+
CLI: `oblien lifecycle idle WORKSPACE_ID --after 15m`, optionally `--stop-after 72h`; disable with `--disable`.
|
|
42
|
+
|
|
43
|
+
See [the hosted guide](https://oblien.com/docs/workspace/on-demand) for dashboard setup and operational details.
|
|
@@ -29,6 +29,12 @@ Verification: `npm test` passes all 19 SDK tests, including
|
|
|
29
29
|
`tests/http-errors.test.mjs` for legacy 200, current 409, uppercase error-only codes,
|
|
30
30
|
403/500 JSON responses, and successful asynchronous creation.
|
|
31
31
|
|
|
32
|
+
The 2026-09-17 live account/namespace billing canary also verified that a second
|
|
33
|
+
workspace in a namespace capped at one workspace returns HTTP 409 with
|
|
34
|
+
`NAMESPACE_LIMIT_REACHED`, through the SDK. See the API repository's
|
|
35
|
+
`docs/ACCOUNT_WORKSPACE_BILLING_FIX_20260917.md` for that run and the broader
|
|
36
|
+
190-check API regression suite.
|
|
37
|
+
|
|
32
38
|
This report and patch are recorded in the SDK repository for maintainers. No external
|
|
33
39
|
issue or team message has been sent from this environment. The public npm version
|
|
34
40
|
checked during this work is 2.3.0; these SDK changes require the next SDK release.
|