@rikalabs/akter-cli 0.1.0-alpha.3 → 0.1.0-alpha.5
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/CHANGELOG.md +12 -0
- package/dist/cloud-api/auth.d.ts +7 -4
- package/dist/cloud-api/billing.d.ts +17 -52
- package/dist/cloud-api/contract.d.ts +876 -876
- package/dist/cloud-api/groups/billing.d.ts +4 -13
- package/dist/cloud-api/groups/projects.d.ts +15 -6
- package/dist/cloud-api/index.d.ts +1 -1
- package/dist/cloud-api/index.js +9 -17
- package/dist/cloud-api/projects.d.ts +11 -6
- package/dist/cloud-api/runtime.d.ts +1 -1
- package/dist/inspector-client.js +1 -1
- package/dist/main.js +74 -51
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.5 (2026-10-09)
|
|
4
|
+
|
|
5
|
+
- Releases with the matching alpha.5 framework, which adds the supported four-session `Database.postgres({ url, preset: "low-connection" })` preset. CLI behavior and the bundled `@rikalabs/akter-cli/cloud-api` contract are unchanged from alpha.4.
|
|
6
|
+
|
|
7
|
+
## 0.1.0-alpha.4 (2026-10-09)
|
|
8
|
+
|
|
9
|
+
- **Breaking cloud contract:** every environment uses customer Postgres through `DATABASE_URL`. `Environment.database`, when reported, is `{ source: "customer", state: "missing" | "reachable" | "unreachable", latency, latencyWarning, runnerCap }`. Latency is nullable p50 milliseconds; runner cap is a nullable integer. The managed source and provisioning, ready, read-only and failed states are removed.
|
|
10
|
+
- **Breaking billing contract:** base subscription plus compute unit-hours only. Removes storage allowances, caps, overage prices, meters, samples, per-project storage usage and managed database features. `QuotaExceeded.cap` is now `compute`, `connections` or `spend`; storage is no longer a quota. All types remain derived from Effect schemas at `@rikalabs/akter-cli/cloud-api`.
|
|
11
|
+
- `akter env list` prints names and update times without a `managed` marker. After a deployment reaches `live`, `akter deploy` confirms success and reads the database report, printing its latency warning and non-null runner cap, including zero, only for the completed rollout. A p50 above 5 ms warns without refusing the deployment; unknown measurements stay unknown. Failed or superseded diagnostic reads warn without changing the successful exit status.
|
|
12
|
+
- `akter deploy` keeps following a rollout through a brief control-plane outage. Transport failures, typed `Unavailable` (503) answers without a known `reason` and unreadable 5xx answers such as a proxy's 502 are retried with the delays `logs --follow` uses (1, 2, 4, then 8 seconds), and six consecutive failed reads stop it as before. Refusals, including an ended session, are never retried.
|
|
13
|
+
- The cloud API contract's `Authentication` middleware declares `Unavailable` (503) alongside `Unauthorized` and `Forbidden`, so every endpoint, including `/api/me`, decodes a session-store outage as a typed `Unavailable`. `akter whoami` then reports a temporary outage (exit 1) instead of an unreachable control plane (exit 2), and never asks you to log in again. This is additive for `/cloud-api` consumers; a server may now fail authentication with `Unavailable`.
|
|
14
|
+
|
|
3
15
|
## 0.1.0-alpha.3 (2026-10-08)
|
|
4
16
|
|
|
5
17
|
The first CLI release, versioned with `@rikalabs/akter` on the `alpha` and `latest` dist-tags. This includes the unpublished alpha.2 draft and the final launch contract.
|
package/dist/cloud-api/auth.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Schema } from "effect";
|
|
2
2
|
import { HttpApiMiddleware, HttpApiSecurity } from "effect/http-api";
|
|
3
|
-
import { Forbidden, Unauthorized } from "./errors.ts";
|
|
3
|
+
import { Forbidden, Unauthorized, Unavailable } from "./errors.ts";
|
|
4
4
|
/** The cookie that carries the Better Auth session token over plain HTTP. */
|
|
5
5
|
export declare const sessionCookieName = "better-auth.session_token";
|
|
6
6
|
/** The same cookie as Better Auth names it when served over HTTPS. */
|
|
@@ -46,7 +46,7 @@ export declare class CurrentIdentity extends CurrentIdentity_base {
|
|
|
46
46
|
declare const Authentication_base: HttpApiMiddleware.ServiceClass<Authentication, "@akter/cloud-api/Authentication", {
|
|
47
47
|
requires: never;
|
|
48
48
|
provides: CurrentIdentity;
|
|
49
|
-
error: readonly [typeof Unauthorized, typeof Forbidden];
|
|
49
|
+
error: readonly [typeof Unauthorized, typeof Forbidden, typeof Unavailable];
|
|
50
50
|
clientError: never;
|
|
51
51
|
requiredForClient: false;
|
|
52
52
|
security: {
|
|
@@ -60,14 +60,17 @@ declare const Authentication_base: HttpApiMiddleware.ServiceClass<Authentication
|
|
|
60
60
|
readonly secureSession: HttpApiSecurity.ApiKey;
|
|
61
61
|
readonly apiKey: HttpApiSecurity.ApiKey;
|
|
62
62
|
readonly bearer: HttpApiSecurity.Http;
|
|
63
|
-
}, CurrentIdentity, readonly [typeof Unauthorized, typeof Forbidden], never>>;
|
|
63
|
+
}, CurrentIdentity, readonly [typeof Unauthorized, typeof Forbidden, typeof Unavailable], never>>;
|
|
64
64
|
/**
|
|
65
65
|
* Resolves who is calling. The server implements one handler per security
|
|
66
66
|
* scheme and fails `Unauthorized` when a scheme's credential is missing or
|
|
67
67
|
* invalid; the first scheme that succeeds provides `CurrentIdentity`. A cookie
|
|
68
68
|
* browser client sends credentials automatically, so no client implementation
|
|
69
69
|
* is required. `bearer` carries the session token a CLI receives from Better
|
|
70
|
-
* Auth's device authorization grant.
|
|
70
|
+
* Auth's device authorization grant. A credential the server cannot check
|
|
71
|
+
* because its session store is down fails `Unavailable`, never
|
|
72
|
+
* `Unauthorized`, so every endpoint's client can tell an outage from a
|
|
73
|
+
* session that ended.
|
|
71
74
|
*
|
|
72
75
|
* @effect-expect-leaking HttpServerRequest | ParsedSearchParams | RouteContext
|
|
73
76
|
*/
|
|
@@ -48,16 +48,13 @@ export type SpendLimit = typeof SpendLimit.Type;
|
|
|
48
48
|
* reported, discriminated by `cap`. `limit` is null when the cap does not
|
|
49
49
|
* apply. `atCap` means usage has reached the limit; `refusing` means the edge
|
|
50
50
|
* would refuse the next new command, or for `connections` the next new
|
|
51
|
-
* connection
|
|
52
|
-
* read-only: writes fail and reads still work. `reason` is `unbound` when the
|
|
51
|
+
* connection. `reason` is `unbound` when the
|
|
53
52
|
* edge refuses everything because the organization has no billing account;
|
|
54
53
|
* such caps have no limit.
|
|
55
54
|
*
|
|
56
55
|
* `limit` and `used` are cents for `spend`, open connections for
|
|
57
56
|
* `connections`, compute unit-hours used in the current billing period for
|
|
58
|
-
* `compute
|
|
59
|
-
* managed database storage, where `used` is the latest pooled sample. A
|
|
60
|
-
* database the customer brings never counts toward it.
|
|
57
|
+
* `compute`. Customer database storage is not metered, capped or billed.
|
|
61
58
|
*/
|
|
62
59
|
export declare const CapState: Schema.Struct<{
|
|
63
60
|
readonly limit: Schema.NullOr<Schema.Finite>;
|
|
@@ -65,7 +62,7 @@ export declare const CapState: Schema.Struct<{
|
|
|
65
62
|
readonly atCap: Schema.Boolean;
|
|
66
63
|
readonly refusing: Schema.Boolean;
|
|
67
64
|
readonly reason: Schema.optionalKey<Schema.Literal<"unbound">>;
|
|
68
|
-
readonly cap: Schema.Literals<readonly ["spend", "connections", "compute"
|
|
65
|
+
readonly cap: Schema.Literals<readonly ["spend", "connections", "compute"]>;
|
|
69
66
|
}>;
|
|
70
67
|
export type CapState = typeof CapState.Type;
|
|
71
68
|
/**
|
|
@@ -104,7 +101,7 @@ export declare const BillingSummary: Schema.Struct<{
|
|
|
104
101
|
readonly atCap: Schema.Boolean;
|
|
105
102
|
readonly refusing: Schema.Boolean;
|
|
106
103
|
readonly reason: Schema.optionalKey<Schema.Literal<"unbound">>;
|
|
107
|
-
readonly cap: Schema.Literals<readonly ["spend", "connections", "compute"
|
|
104
|
+
readonly cap: Schema.Literals<readonly ["spend", "connections", "compute"]>;
|
|
108
105
|
}>>>;
|
|
109
106
|
}>;
|
|
110
107
|
export type BillingSummary = typeof BillingSummary.Type;
|
|
@@ -141,11 +138,10 @@ export declare const HostedSession: Schema.Struct<{
|
|
|
141
138
|
export type HostedSession = typeof HostedSession.Type;
|
|
142
139
|
/**
|
|
143
140
|
* What a plan offers, derived from the pricing configuration: billed compute
|
|
144
|
-
* overage, a hard compute cap,
|
|
145
|
-
*
|
|
146
|
-
* bought through checkout.
|
|
141
|
+
* overage, a hard compute cap, customer Postgres on every plan, and a paid
|
|
142
|
+
* subscription bought through checkout.
|
|
147
143
|
*/
|
|
148
|
-
export declare const PlanFeature: Schema.Literals<readonly ["compute-overage", "compute-cap", "
|
|
144
|
+
export declare const PlanFeature: Schema.Literals<readonly ["compute-overage", "compute-cap", "byo-database", "checkout"]>;
|
|
149
145
|
export type PlanFeature = typeof PlanFeature.Type;
|
|
150
146
|
/**
|
|
151
147
|
* One tier of the pricing configuration. `allowances.computeUnitHours` is the
|
|
@@ -154,12 +150,7 @@ export type PlanFeature = typeof PlanFeature.Type;
|
|
|
154
150
|
* `overage.computeCentsPerUnitHour`). A machine size's hour bills the compute
|
|
155
151
|
* unit-hours `PlanCatalog.computeSizes` gives it.
|
|
156
152
|
*
|
|
157
|
-
*
|
|
158
|
-
* plan, in decimal gigabytes, pooled across the organization's managed
|
|
159
|
-
* environment databases. `allowances.storageGbCap` is its hard stop, past
|
|
160
|
-
* which those databases are read-only, and is null when overage is billed
|
|
161
|
-
* instead at `overage.storageCentsPerGbMonth`. A provisional tier's prices
|
|
162
|
-
* are not yet published.
|
|
153
|
+
* A provisional tier's prices are not yet published.
|
|
163
154
|
*/
|
|
164
155
|
export declare const CatalogPlan: Schema.Struct<{
|
|
165
156
|
readonly id: Schema.Literals<readonly ["free", "pro", "team", "enterprise"]>;
|
|
@@ -169,15 +160,12 @@ export declare const CatalogPlan: Schema.Struct<{
|
|
|
169
160
|
readonly allowances: Schema.Struct<{
|
|
170
161
|
readonly computeUnitHours: Schema.Finite;
|
|
171
162
|
readonly computeUnitHourCap: Schema.NullOr<Schema.Finite>;
|
|
172
|
-
readonly storageGb: Schema.Finite;
|
|
173
|
-
readonly storageGbCap: Schema.NullOr<Schema.Finite>;
|
|
174
163
|
readonly concurrentConnections: Schema.Int;
|
|
175
164
|
}>;
|
|
176
165
|
readonly overage: Schema.Struct<{
|
|
177
166
|
readonly computeCentsPerUnitHour: Schema.Finite;
|
|
178
|
-
readonly storageCentsPerGbMonth: Schema.Finite;
|
|
179
167
|
}>;
|
|
180
|
-
readonly features: Schema.$Array<Schema.Literals<readonly ["compute-overage", "compute-cap", "
|
|
168
|
+
readonly features: Schema.$Array<Schema.Literals<readonly ["compute-overage", "compute-cap", "byo-database", "checkout"]>>;
|
|
181
169
|
readonly provisional: Schema.Boolean;
|
|
182
170
|
}>;
|
|
183
171
|
export type CatalogPlan = typeof CatalogPlan.Type;
|
|
@@ -207,15 +195,12 @@ export declare const PlanCatalog: Schema.Struct<{
|
|
|
207
195
|
readonly allowances: Schema.Struct<{
|
|
208
196
|
readonly computeUnitHours: Schema.Finite;
|
|
209
197
|
readonly computeUnitHourCap: Schema.NullOr<Schema.Finite>;
|
|
210
|
-
readonly storageGb: Schema.Finite;
|
|
211
|
-
readonly storageGbCap: Schema.NullOr<Schema.Finite>;
|
|
212
198
|
readonly concurrentConnections: Schema.Int;
|
|
213
199
|
}>;
|
|
214
200
|
readonly overage: Schema.Struct<{
|
|
215
201
|
readonly computeCentsPerUnitHour: Schema.Finite;
|
|
216
|
-
readonly storageCentsPerGbMonth: Schema.Finite;
|
|
217
202
|
}>;
|
|
218
|
-
readonly features: Schema.$Array<Schema.Literals<readonly ["compute-overage", "compute-cap", "
|
|
203
|
+
readonly features: Schema.$Array<Schema.Literals<readonly ["compute-overage", "compute-cap", "byo-database", "checkout"]>>;
|
|
219
204
|
readonly provisional: Schema.Boolean;
|
|
220
205
|
}>>;
|
|
221
206
|
readonly computeSizes: Schema.$Array<Schema.Struct<{
|
|
@@ -230,13 +215,12 @@ export type PlanCatalog = typeof PlanCatalog.Type;
|
|
|
230
215
|
/**
|
|
231
216
|
* `runnerHours` is measured in compute unit-hours (see `ComputeUsage`), not
|
|
232
217
|
* machine hours; raw machine hours are reported per machine size in
|
|
233
|
-
* `ComputeUsage.machineHours`.
|
|
234
|
-
* database storage over the period in decimal gigabytes, billed per GB-month.
|
|
218
|
+
* `ComputeUsage.machineHours`.
|
|
235
219
|
*/
|
|
236
|
-
export declare const UsageMeterName: Schema.
|
|
220
|
+
export declare const UsageMeterName: Schema.Literal<"runnerHours">;
|
|
237
221
|
export type UsageMeterName = typeof UsageMeterName.Type;
|
|
238
222
|
export declare const UsageMeter: Schema.Struct<{
|
|
239
|
-
readonly meter: Schema.
|
|
223
|
+
readonly meter: Schema.Literal<"runnerHours">;
|
|
240
224
|
readonly used: Schema.Finite;
|
|
241
225
|
readonly included: Schema.Finite;
|
|
242
226
|
readonly overage: Schema.Finite;
|
|
@@ -246,12 +230,10 @@ export type UsageMeter = typeof UsageMeter.Type;
|
|
|
246
230
|
/**
|
|
247
231
|
* The published rules usage is priced by, sent with every usage report.
|
|
248
232
|
* `computeCentsPerUnitHour` prices compute unit-hours beyond the plan's
|
|
249
|
-
* allowance and
|
|
250
|
-
* beyond it; each is 0 where the plan bills no overage.
|
|
233
|
+
* allowance and is 0 where the plan bills no overage.
|
|
251
234
|
*/
|
|
252
235
|
export declare const UsagePricing: Schema.Struct<{
|
|
253
236
|
readonly computeCentsPerUnitHour: Schema.Finite;
|
|
254
|
-
readonly storageCentsPerGbMonth: Schema.Finite;
|
|
255
237
|
readonly provisional: Schema.optionalKey<Schema.Boolean>;
|
|
256
238
|
}>;
|
|
257
239
|
export type UsagePricing = typeof UsagePricing.Type;
|
|
@@ -269,42 +251,27 @@ export declare const ComputeUsage: Schema.Struct<{
|
|
|
269
251
|
readonly computeUnitHours: Schema.Finite;
|
|
270
252
|
}>;
|
|
271
253
|
export type ComputeUsage = typeof ComputeUsage.Type;
|
|
272
|
-
/**
|
|
273
|
-
* The organization's latest pooled managed database storage: the sum of the
|
|
274
|
-
* sampled bytes of its managed environment databases, and when it was
|
|
275
|
-
* sampled. A database the customer brings is excluded.
|
|
276
|
-
*/
|
|
277
|
-
export declare const StorageSample: Schema.Struct<{
|
|
278
|
-
readonly bytes: Schema.Finite;
|
|
279
|
-
readonly sampledAt: Schema.DateTimeUtc;
|
|
280
|
-
}>;
|
|
281
|
-
export type StorageSample = typeof StorageSample.Type;
|
|
282
254
|
/**
|
|
283
255
|
* `caps` describe now whatever `period` is reported. A project's
|
|
284
256
|
* `computeUnitHours` is its compute for the period and `compute` breaks it
|
|
285
|
-
* down by environment and machine size
|
|
286
|
-
* databases' storage for the period.
|
|
257
|
+
* down by environment and machine size.
|
|
287
258
|
*/
|
|
288
259
|
export declare const Usage: Schema.Struct<{
|
|
289
260
|
readonly period: Schema.String;
|
|
290
261
|
readonly meters: Schema.$Array<Schema.Struct<{
|
|
291
|
-
readonly meter: Schema.
|
|
262
|
+
readonly meter: Schema.Literal<"runnerHours">;
|
|
292
263
|
readonly used: Schema.Finite;
|
|
293
264
|
readonly included: Schema.Finite;
|
|
294
265
|
readonly overage: Schema.Finite;
|
|
295
266
|
readonly overageCostCents: Schema.Finite;
|
|
296
267
|
}>>;
|
|
297
|
-
readonly latestStorageSample: Schema.NullOr<Schema.Struct<{
|
|
298
|
-
readonly bytes: Schema.Finite;
|
|
299
|
-
readonly sampledAt: Schema.DateTimeUtc;
|
|
300
|
-
}>>;
|
|
301
268
|
readonly caps: Schema.$Array<Schema.Struct<{
|
|
302
269
|
readonly limit: Schema.NullOr<Schema.Finite>;
|
|
303
270
|
readonly used: Schema.Finite;
|
|
304
271
|
readonly atCap: Schema.Boolean;
|
|
305
272
|
readonly refusing: Schema.Boolean;
|
|
306
273
|
readonly reason: Schema.optionalKey<Schema.Literal<"unbound">>;
|
|
307
|
-
readonly cap: Schema.Literals<readonly ["spend", "connections", "compute"
|
|
274
|
+
readonly cap: Schema.Literals<readonly ["spend", "connections", "compute"]>;
|
|
308
275
|
}>>;
|
|
309
276
|
readonly byProject: Schema.$Array<Schema.Struct<{
|
|
310
277
|
readonly projectId: Schema.brand<Schema.String, "ProjectId">;
|
|
@@ -318,12 +285,10 @@ export declare const Usage: Schema.Struct<{
|
|
|
318
285
|
readonly machineHours: Schema.Finite;
|
|
319
286
|
readonly computeUnitHours: Schema.Finite;
|
|
320
287
|
}>>;
|
|
321
|
-
readonly storageGbMonths: Schema.Finite;
|
|
322
288
|
readonly estimatedCostCents: Schema.Finite;
|
|
323
289
|
}>>;
|
|
324
290
|
readonly pricing: Schema.Struct<{
|
|
325
291
|
readonly computeCentsPerUnitHour: Schema.Finite;
|
|
326
|
-
readonly storageCentsPerGbMonth: Schema.Finite;
|
|
327
292
|
readonly provisional: Schema.optionalKey<Schema.Boolean>;
|
|
328
293
|
}>;
|
|
329
294
|
}>;
|