@fabrika/cli 0.9.0-dev.47 → 0.9.0-dev.49
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/package.json +14 -14
- package/src/control.ts +3 -20
- package/src/data.ts +27 -9
- package/types/src/control.d.ts +1 -1
- package/types/src/data.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabrika/cli",
|
|
3
|
-
"version": "0.9.0-dev.
|
|
3
|
+
"version": "0.9.0-dev.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"jose": "^5.9.0",
|
|
34
34
|
"zod": "^3.25.76",
|
|
35
|
-
"@fabrika/app": "0.9.0-dev.
|
|
36
|
-
"@fabrika/auth-core": "0.9.0-dev.
|
|
37
|
-
"@fabrika/control-contract": "0.9.0-dev.
|
|
38
|
-
"@fabrika/iam-contract": "0.9.0-dev.
|
|
39
|
-
"@fabrika/operations-contract": "0.9.0-dev.
|
|
40
|
-
"@fabrika/provider-contract": "0.9.0-dev.
|
|
41
|
-
"@fabrika/db": "0.9.0-dev.
|
|
42
|
-
"@fabrika/platform": "0.9.0-dev.
|
|
43
|
-
"@fabrika/platform-node": "0.9.0-dev.
|
|
44
|
-
"@fabrika/check": "0.9.0-dev.
|
|
35
|
+
"@fabrika/app": "0.9.0-dev.49",
|
|
36
|
+
"@fabrika/auth-core": "0.9.0-dev.49",
|
|
37
|
+
"@fabrika/control-contract": "0.9.0-dev.49",
|
|
38
|
+
"@fabrika/iam-contract": "0.9.0-dev.49",
|
|
39
|
+
"@fabrika/operations-contract": "0.9.0-dev.49",
|
|
40
|
+
"@fabrika/provider-contract": "0.9.0-dev.49",
|
|
41
|
+
"@fabrika/db": "0.9.0-dev.49",
|
|
42
|
+
"@fabrika/platform": "0.9.0-dev.49",
|
|
43
|
+
"@fabrika/platform-node": "0.9.0-dev.49",
|
|
44
|
+
"@fabrika/check": "0.9.0-dev.49"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@fabrika/builder": "0.9.0-dev.
|
|
48
|
-
"@fabrika/provider-cloudflare": "0.9.0-dev.
|
|
49
|
-
"@fabrika/provider-zerops": "0.9.0-dev.
|
|
47
|
+
"@fabrika/builder": "0.9.0-dev.49",
|
|
48
|
+
"@fabrika/provider-cloudflare": "0.9.0-dev.49",
|
|
49
|
+
"@fabrika/provider-zerops": "0.9.0-dev.49"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@fabrika/builder": {
|
package/src/control.ts
CHANGED
|
@@ -55,7 +55,6 @@ import {
|
|
|
55
55
|
MAX_EXTERNAL_APP_CLIENTS,
|
|
56
56
|
MAX_OAUTH_IDENTITY_ROLES,
|
|
57
57
|
OAUTH_CLIENT_PROVIDERS,
|
|
58
|
-
OAUTH_REGISTRY_NOT_IMPORTED,
|
|
59
58
|
type OAuthClientDto,
|
|
60
59
|
type PutExternalAppRequest,
|
|
61
60
|
type PutOAuthClientRequest,
|
|
@@ -324,8 +323,7 @@ and put back. Removing a client, changing the resource or deleting the applicati
|
|
|
324
323
|
"redirectUris": ["https://claude.ai/api/mcp/auth_callback"] }
|
|
325
324
|
|
|
326
325
|
\`label\` is claude, chatgpt or external. A client of an external application is written only through
|
|
327
|
-
\`external-apps put\`, and \`oauth-clients\` refuses it. \`put\` checks the file before anything is sent.
|
|
328
|
-
deploy of this release has imported the installation's client list, IAM refuses both \`put\`s; deploy, then repeat.
|
|
326
|
+
\`external-apps put\`, and \`oauth-clients\` refuses it. \`put\` checks the file before anything is sent.
|
|
329
327
|
The console registers external applications too, under Access → External applications.
|
|
330
328
|
|
|
331
329
|
Connecting a GitHub source is NOT here and will not be: App creation is a browser flow whose
|
|
@@ -1405,26 +1403,11 @@ const fileArgument = async (flags: Flags): Promise<{ readonly path: string; read
|
|
|
1405
1403
|
return { path, value: await readJsonFile(path) }
|
|
1406
1404
|
}
|
|
1407
1405
|
|
|
1408
|
-
/** Every registry verb names the not-imported refusal's way out: deploy the platform first. */
|
|
1409
|
-
const registryCall = async <T>(call: () => Promise<T>): Promise<T> => {
|
|
1410
|
-
try {
|
|
1411
|
-
return await call()
|
|
1412
|
-
} catch (error) {
|
|
1413
|
-
if (error instanceof RpcError && error.httpStatus === 409 && error.message === OAUTH_REGISTRY_NOT_IMPORTED) {
|
|
1414
|
-
throw new Error(
|
|
1415
|
-
'IAM does not take registry writes yet: a platform deploy of this release has not imported the OAuth client list. '
|
|
1416
|
-
+ 'Run the platform deploy, then repeat this command.',
|
|
1417
|
-
)
|
|
1418
|
-
}
|
|
1419
|
-
throw error
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
1406
|
const runExternalApps = async (verb: string | undefined, flags: Flags, env: Readonly<Record<string, string | undefined>>): Promise<void> => {
|
|
1424
1407
|
if (verb === 'put') {
|
|
1425
1408
|
const { path, value } = await fileArgument(flags)
|
|
1426
1409
|
const request = parseExternalAppFile(value, path)
|
|
1427
|
-
const result = await
|
|
1410
|
+
const result = await iamAdminClient(flags.values.get('iam-url'), env).externalApps.put(request)
|
|
1428
1411
|
emit(flags, result, () => externalAppLine(result))
|
|
1429
1412
|
return
|
|
1430
1413
|
}
|
|
@@ -1453,7 +1436,7 @@ const runOAuthClients = async (verb: string | undefined, flags: Flags, env: Read
|
|
|
1453
1436
|
if (verb === 'put') {
|
|
1454
1437
|
const { path, value } = await fileArgument(flags)
|
|
1455
1438
|
const request = parseOAuthClientFile(value, path)
|
|
1456
|
-
const result = await
|
|
1439
|
+
const result = await iamAdminClient(flags.values.get('iam-url'), env).oauthClients.put(request)
|
|
1457
1440
|
emit(flags, result, () => oauthClientLine(result))
|
|
1458
1441
|
return
|
|
1459
1442
|
}
|
package/src/data.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { RpcError } from '@fabrika/app'
|
|
5
5
|
import {
|
|
6
|
+
OPS_MIGRATION_FAILURES,
|
|
6
7
|
OPS_ROW_COUNT_CAP,
|
|
7
8
|
type OpsContentView,
|
|
8
9
|
type OpsView,
|
|
@@ -10,7 +11,13 @@ import {
|
|
|
10
11
|
parseOpsContentView,
|
|
11
12
|
parseOpsView,
|
|
12
13
|
} from '@fabrika/auth-core'
|
|
13
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
DATA_OPERATION_RESOLUTIONS,
|
|
16
|
+
type DataBackupDto,
|
|
17
|
+
type DataBackupScheduleDto,
|
|
18
|
+
type DataOperationDto,
|
|
19
|
+
startDataOperationInputSchema,
|
|
20
|
+
} from '@fabrika/control-contract'
|
|
14
21
|
import { z } from 'zod'
|
|
15
22
|
import { ApprovalPendingError, connectControl, type ControlClient, directWrite, withoutControlKey } from './control.js'
|
|
16
23
|
|
|
@@ -20,7 +27,7 @@ Usage:
|
|
|
20
27
|
fabrika env inspect <app> <env> [--content] [--json]
|
|
21
28
|
fabrika env maintenance <app> <env> <open|read-only|closed> [--wait] [--json]
|
|
22
29
|
fabrika env operations <app> <env> [--json]
|
|
23
|
-
fabrika env recover <app> <env> <operationId> <resume|open> [--wait] [--json]
|
|
30
|
+
fabrika env recover <app> <env> <operationId> <resume|open|rollback> [--wait] [--json]
|
|
24
31
|
fabrika env backups <app> <env> [--json]
|
|
25
32
|
fabrika env backups schedule <app> <env> [on|off] [--wait] [--json]
|
|
26
33
|
fabrika env restore <app> <env> --at=<time> [--wait] [--json]
|
|
@@ -38,8 +45,10 @@ and needs \`data.content.read\` granted globally.
|
|
|
38
45
|
<id> <kind> <state> <step> <target mode> <generation> <error code> <created at>.
|
|
39
46
|
|
|
40
47
|
\`recover\` fences an environment whose operation is stuck in \`closed\` at a fresh generation, then \`resume\`s that
|
|
41
|
-
operation from its recorded step, or \`open\`s the environment. A failed operation can only be opened past
|
|
42
|
-
\`
|
|
48
|
+
operation from its recorded step, or \`open\`s the environment. A failed operation can only be opened past, or, for a
|
|
49
|
+
failed migration whose data holds nothing of it (\`rollbackAndOpen\` in \`--json\`), rolled back: \`rollback\` fences
|
|
50
|
+
it in \`inspect\`, deploys the last succeeded commit again as a new run, waits until the failed version is gone and
|
|
51
|
+
opens it. It needs \`data.manage\`.
|
|
43
52
|
|
|
44
53
|
\`backups\` lists the environment's consistent backups, newest first, one row each:
|
|
45
54
|
<id> <object> <state> <created at> <size bytes> <parts> <tables> <rehearsal> <rehearsal code> <error code> <expired>
|
|
@@ -93,7 +102,7 @@ const COMMAND_FORMS: Readonly<Record<string, string>> = {
|
|
|
93
102
|
inspect: '<app> <env> [--content] [--json]',
|
|
94
103
|
maintenance: '<app> <env> <open|read-only|closed> [--wait] [--json]',
|
|
95
104
|
operations: '<app> <env> [--json]',
|
|
96
|
-
recover: '<app> <env> <operationId> <resume|open> [--wait] [--json]',
|
|
105
|
+
recover: '<app> <env> <operationId> <resume|open|rollback> [--wait] [--json]',
|
|
97
106
|
backups: '<app> <env> [--json]',
|
|
98
107
|
'backups schedule': '<app> <env> [on|off] [--wait] [--json]',
|
|
99
108
|
restore: '<app> <env> --at=<time> [--wait] [--json]',
|
|
@@ -166,9 +175,19 @@ const dataOperationSchema: z.ZodType<DataOperationDto, z.ZodTypeDef, unknown> =
|
|
|
166
175
|
updatedAt: z.number().int().nonnegative(),
|
|
167
176
|
finishedAt: z.number().int().nonnegative().nullable(),
|
|
168
177
|
recoversOperationId: z.string().uuid().nullable(),
|
|
169
|
-
resolution: z.enum(
|
|
178
|
+
resolution: z.enum(DATA_OPERATION_RESOLUTIONS).nullable(),
|
|
170
179
|
// Absent from a Control before the migration phase.
|
|
171
180
|
runId: z.string().uuid().nullable().default(null),
|
|
181
|
+
// Absent from a Control before the migrating deploy without a read-only window.
|
|
182
|
+
recordsBookmark: z.boolean().default(false),
|
|
183
|
+
migrationFailure: z.enum(OPS_MIGRATION_FAILURES).nullable().default(null),
|
|
184
|
+
revertRunId: z.string().uuid().nullable().default(null),
|
|
185
|
+
candidateRecovered: z.boolean().default(false),
|
|
186
|
+
// Absent from a Control before the in-place rewind.
|
|
187
|
+
rewound: z.boolean().default(false),
|
|
188
|
+
rewindRefusal: z.string().regex(ERROR_CODE).nullable().default(null),
|
|
189
|
+
// Absent from a Control before the roll back and open recovery.
|
|
190
|
+
rollbackAndOpen: z.boolean().default(false),
|
|
172
191
|
})
|
|
173
192
|
|
|
174
193
|
interface Target {
|
|
@@ -241,7 +260,6 @@ const parseSchedule = (value: unknown, target: Target): DataBackupScheduleDto =>
|
|
|
241
260
|
}
|
|
242
261
|
|
|
243
262
|
const MAINTENANCE_MODES = ['open', 'read-only', 'closed'] as const
|
|
244
|
-
const RESOLUTIONS = ['resume', 'open'] as const
|
|
245
263
|
const SCHEDULE_SWITCHES = ['on', 'off'] as const
|
|
246
264
|
|
|
247
265
|
const oneOf = <T extends string>(value: string, allowed: readonly T[]): T | undefined => allowed.find((candidate) => candidate === value)
|
|
@@ -360,8 +378,8 @@ const runOperations = async (args: EnvArgs, env: Environment): Promise<void> =>
|
|
|
360
378
|
|
|
361
379
|
const runRecover = async (args: EnvArgs, env: Environment): Promise<void> => {
|
|
362
380
|
const [appId = '', environment = '', operationId = '', requested = ''] = words('recover', args, 4)
|
|
363
|
-
const resolution = oneOf(requested,
|
|
364
|
-
if (resolution === undefined) throw new Error(`The resolution is resume or
|
|
381
|
+
const resolution = oneOf(requested, DATA_OPERATION_RESOLUTIONS)
|
|
382
|
+
if (resolution === undefined) throw new Error(`The resolution is resume, open or rollback, not "${requested}"`)
|
|
365
383
|
const client = controlClient(args, env)
|
|
366
384
|
const result = await directWrite(client, args, () => client.data.recover({ appId, env: environment, operationId, resolution }))
|
|
367
385
|
if (result === null) return
|
package/types/src/control.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type ApprovalRequestDto } from '@fabrika/control-contract';
|
|
|
3
3
|
import type { AppEnvDto, ControlRpcContract, DeploymentNamespaceDto, JsonValue, PlanDeploymentNamespaceResponse, RunDto } from '@fabrika/control-contract';
|
|
4
4
|
import { type ExternalAppDto, type IamAdminRpcContract, type PutExternalAppRequest, type PutOAuthClientRequest } from '@fabrika/iam-contract';
|
|
5
5
|
import { type ControlOAuthDependencies } from './control-oauth.js';
|
|
6
|
-
declare const USAGE = "fabrika control \u2014 operate the Delivery control plane\n\nUsage:\n fabrika control auth device --preset=<read|deploy|operate|create> [--app=<id>]\n fabrika control key issue --label=<name> --permissions=<a,b,c> --expires-in=<seconds> [--iam-url=<origin>]\n fabrika control apps list\n fabrika control apps get --app=<id>\n fabrika control apps environments list --app=<id>\n fabrika control apps environments put --provider=<name> --app=<id> --env=<name> --manifest=<path>\n [--domain=<host>] [--public-origin=<url>] [--trigger-ref=<ref>] [--namespace=<id>]\n [--cross-origin=<origin> ...] [--kind=standard|dev] [--wait]\n fabrika control apps environments suspend --app=<id> --env=<name> [--wait]\n fabrika control apps environments resume --app=<id> --env=<name> [--wait]\n fabrika control apps variables list --app=<id>\n fabrika control apps variables put --app=<id> --name=<name> --value=<text> [--env=<name>] [--not-secret] [--request] [--wait]\n fabrika control apps variables delete --app=<id> --name=<name> [--env=<name>] [--request] [--wait]\n fabrika control apps secrets list --app=<id>\n fabrika control apps secrets put --app=<id> --name=<name> [--env=<name>] [--request] [--wait] (the value on stdin)\n fabrika control apps secrets delete --app=<id> --name=<name> [--env=<name>] [--request] [--wait]\n fabrika control register --provider=<name> --app=<id> --repo=<url> --env=<name> --manifest=<path>\n [--domain=<host>] [--public-origin=<url>] [--trigger-ref=<ref>]\n [--namespace=<id>] [--installation-id=<n|none>] [--cross-origin=<origin> ...]\n fabrika control namespaces list\n fabrika control namespaces get --namespace=<id>\n fabrika control namespaces plan --namespace=<id> --env=<name> --preset=<cheap|mid|full> [placement]\n fabrika control namespaces create --namespace=<id> --env=<name> --preset=<cheap|mid|full> [placement]\n fabrika control namespaces reconcile --namespace=<id>\n fabrika control namespaces update --namespace=<id> --proxy-source=current\n fabrika control namespaces remove --namespace=<id>\n fabrika control namespaces release-claims --namespace=<id> --app=<id> --env=<name>\n fabrika control deploy --app=<id> --env=<name> [--ref=<ref>] [--wait]\n fabrika control runs list [--app=<id>] [--env=<name>] [--limit=<n>]\n fabrika control runs get --run=<id>\n fabrika control runs log --run=<id>\n fabrika control requests get <id> [--wait]\n fabrika control access request-grant --app=<id> --env=<name> --principal=<id> --role=<role>\n [--scope=<dimension>:<value>] --expires-in=<seconds> [--wait]\n fabrika control access request-key --app=<id> --action=<action> [--action=<action>\u2026] --label=<text>\n --expires-in=<seconds> --wait\n fabrika control external-apps list | get <app> | put --file=<app.json> | delete <app> [--iam-url=<origin>]\n fabrika control oauth-clients list | put --file=<client.json> | delete <client id> [--iam-url=<origin>]\n\n`register` CREATES an app and refuses a second one with the same id. Re-registering a changed\nmanifest \u2014 a new import document, or a new `zerops.yaml` of an app without a contract \u2014 is\n`apps environments put`, which replaces one environment's envelopes and leaves the app row alone. A\ncontract app's deploy registers the `zerops.yaml` of its commit itself.\n\nA manifest that publishes the app through the namespace proxy is routed by HOST, so `--domain` is\nREQUIRED for it \u2014 on `register` and on `apps environments put` alike \u2014 and a registration without one is\nrefused before anything is created. `namespaces get` lists the hosts a `zerops-subdomain` namespace\nserves and which of them are still free; a custom-domain namespace serves the domain you bound to its\nproxy. A manifest with no proxy target needs no domain.\n\n`apps environments suspend` takes an environment offline in an incident, such as a compromised or leaked application.\nBehind a Zerops namespace proxy every request to it answers 503 once the republished proxy is live, which takes the\nminutes of a proxy build; `namespaces get` follows it. A namespace pinned to an older proxy source is refused with the\nre-pin to run first. On Cloudflare the environment's object goes into maintenance `closed`. `resume` restores the\nrouting it had, or on Cloudflare the maintenance mode it was in. Neither stops the application's service, nor\nrevokes a key. Repeating either is a retry.\n\nA variable's value is stored and printed in clear, so `apps variables put` refuses one that looks like a\ncredential (by its name, such as `*_TOKEN` or `*_PASSWORD`, or by its value) and names `apps secrets put` instead.\n`--not-secret` stores it anyway, for a value you have checked is not one. A secret's value is write-only: `apps secrets put`\nreads it from STDIN, never from a flag, so it reaches neither shell history nor a process listing, and\none trailing newline is dropped. No command prints it back; `apps secrets list` shows names, scope and\nstorage only. Generate one in the pipe:\n\n openssl rand -base64 32 | fabrika control apps secrets put --app=<id> --name=<name>\n\n`--public-origin` is where IAM may return a signed-in person: without one, sign-in to the environment is\nrefused. When `register` is given none and the namespace lists `--domain` among its hosts, it sets\n`https://<domain>` and says so on stderr. A custom domain needs the flag.\n\n`--cross-origin` names an origin whose pages may call the environment's cross-origin endpoints (ADR-0022), and\nrepeats: the flags given are the environment's whole list. Each is an exact origin with a literal host\n(`https://app.example.com`; `http://` only for a local one), never the environment's own domain, at most 16.\n`apps environments put` without the flag keeps the stored list, and a lone empty `--cross-origin=` clears it.\nOn Zerops the change reaches the namespace proxy at once; on Cloudflare the next deploy of the environment\napplies it.\n\n`--installation-id` has three states: omitted resolves the installation from the repository owner's\nconnected GitHub App, `none` registers an anonymous PUBLIC repository source, and a number names one\ninstallation outright. With `none`, control reads the repository once without a token and refuses one\nGitHub hides: a private repository needs the GitHub App connected in the console first.\n\n`--trigger-ref` is the git ref whose push deploys the environment; without it the environment deploys only\non `deploy`. A bare name is a branch: `--trigger-ref=deploy/prod` is stored as `refs/heads/deploy/prod`.\nA full ref is kept as given: `refs/heads/<branch>`, `refs/tags/<tag>`, or a `*` glob such as\n`refs/tags/v*`, which deploys every matching tag. A tag always needs the `refs/tags/` form. Each\nenvironment of an app needs its own trigger ref. Branches named `fabrika/\u2026` are reserved for MCP\nworkspaces and are never a trigger ref.\n\n`deploy` of a protected environment with `FABRIKA_CONTROL_KEY` or a device grant is a request a person approves:\n`--ref` names a 40-character commit SHA, by default one merged into the environment's trigger ref (or the default\nbranch), and stderr prints the console link the person opens. `--wait` follows the run until it succeeds or\nfails, approval being one step on the way, and prints its final row; a refusal or an expiry says so on stderr.\n\n`requests get` reads one approval request: a change an agent or a key asked a person to approve, by the id its\ncreation answered. stderr prints the console link while it waits, and why it did not run once it failed, went stale or\nexpired. `--wait` reads it again until it is refused, expired, executed, failed or stale, and prints its final row;\nonce a person decided it, it stops with an error after 15 minutes without an outcome.\n\n`--request` on `apps secrets put|delete` and `apps variables put|delete` does not make the change: it asks a person\nto approve it. Every other verb refuses it. Control stores the request, inert, and stderr prints the console link the person opens; for a secret it\nalso prints the value's fingerprint (the first 8 hex characters of its SHA-256, computed here), which the page shows\nbeside the value's length, so the person can tell it is the value you sent; when Control's answer names another\nfingerprint, the command fails and says to refuse the request. Control seals the value and stores only that. stdout\nprints the request's id, state and link; `--wait` follows it as `requests get --wait` does. Without `--env` the request\nis for every environment of the app, and every protected one judges it. A secret the provider keeps (a Zerops\nenvironment) is requested for one `--env`.\n\n`access request-grant` asks a person to give a principal (this agent's own, or another) one role of an application\nenvironment. It needs `access.request` at the app, the role must be one the environment's approved contract declares,\na membership role takes `--scope` with a value of its dimension, and `--expires-in` is at most 30 days. An IAM\nadministrator of the application approves it at the console link stderr prints; the grant is then theirs, and where\nthe application's grants wait for approval, IAM holds it for a second administrator. An environment that does not gate\nan agent's grants (not protected, or `agent-grants` off) refuses it: there is nothing to approve there. stdout prints\nthe request's id, state and link; `--wait` follows it as `requests get --wait` does.\n\nWithout `--request`, a write by `FABRIKA_CONTROL_KEY` or a device grant on a protected environment meets that\nenvironment's approval policy (ADR-0083): `apps secrets` and `apps variables` are `secrets` and `variables` writes,\n`apps environments put` is a `registry` write, and `apps environments suspend|resume` are `data` writes.\nA category set to `off` applies the write; `refuse` refuses it; `person` does not make the change but stores it as a\nrequest, exactly as `--request` does: stdout prints its id, state and link, stderr the fingerprint of a secret, and the\ncommand exits 75. Hand the person the link; nothing changes until they approve it. `--wait` follows the request\ninstead, and succeeds only when it executed.\n\n`access request-key` asks a person for a key holding exact Control actions at one application (each `--action`, no\nwildcard), for someone other than this agent, expiring in at most 30 days. It needs `access.request` at the app, and\nthe protected environments' `credentialCeiling` decides whether the key may hold actions this agent does not. It\nmakes a key pair in memory, sends only the public key, and prints on stderr the console link and the public key's\nthumbprint, which the page shows: an IAM installation administrator checks it there and approves with a passkey. IAM\nencrypts the key to that public key, and Control hands it out once. `--wait` is required: the private key never leaves\nthis process, so the key cannot be fetched later; the command waits for the decision, fetches the key, decrypts it, and\nprints it once on stdout. A request that issues no key (refused, expired, failed) fails with why.\n\nNamespace placement options, each defaulting to what the preset would choose:\n\n --project=<name> the provider project the namespace owns; on Zerops the default is\n fabrika-<env>-<namespace id>, beside the installation's fabrika-<env>\n --core-package=<LIGHT|SERIOUS> defaults to LIGHT on every environment, `prod` included (ADR-0038).\n SERIOUS is a deliberate choice: a project cannot be downgraded again\n --public-access=<custom-domain|zerops-subdomain>\n --exclusive-app=<id> required by, and only by, the `full` preset\n --postgres-type=<type> the `cheap` preset's shared PostgreSQL; on Zerops postgresql:single@18\n (default) or postgresql:ha@18, which keeps its data through a node loss.\n Fixed once created\n --postgres-profile=<profile> its profile, given together with --postgres-type: oltp-hobby for single,\n oltp-staging (about $11) or oltp-production (about $72) for HA\n\n`namespaces plan` is a preview and changes nothing. It prints one `<path>\\t<value>` row per field of\nthe plan, keyed by its path in `--json`; a multi-line value such as the proxy's descriptor file is shown\nby size only. `namespaces create` commits that exact plan \u2014 the\nsame two steps the console's form takes \u2014 and returns as soon as the placement is recorded: provisioning\nruns behind the control queue and takes minutes, so the state comes back `pending`. Follow it with\n`namespaces get` or `namespaces list`; nothing needs to stay connected. `namespaces remove` frees the id\nof a placement no application is registered in. It deletes nothing at the provider and prints, on stderr,\nthe provider resources it stopped tracking. `namespaces update --proxy-source=current` re-pins a placement's\nproxy to the source this control plane deploys new placements from \u2014 a placement keeps the one it was created\nwith until you do \u2014 and queues the reconcile that rebuilds the proxy from it; a `failed` placement accepts it.\n\n`namespaces release-claims` frees the resource names one app environment holds in a placement, which an\nenvironment or app delete otherwise refuses over. Delete those resources at the provider first: the release\nreads each one back and refuses, naming it, while any still exists. It prints one released key per line.\n\nEvery command accepts --json, which prints the procedure's result verbatim.\n\nThe control origin is not a credential and takes either form:\n\n --url=<origin> FABRIKA_CONTROL_URL\n\nCredentials are read from the ENVIRONMENT ONLY and have no flag, so they cannot reach a CI log or a\nprocess listing. One of:\n\n FABRIKA_CONTROL_KEY a machine `px_` credential for the control app; it wins when both are set\n FABRIKA_CONTROL_CREDENTIAL_HELPER a command with `get` and `store` that holds the refresh token of a\n `control auth device` grant (below)\n\n`auth device` asks IAM for a grant a person approves in the browser (RFC 8628). It prints the page and the\ncode on stderr and waits; the person signs in, checks the code, and picks how long the grant lasts (an hour, a\nday or a week). The grant holds the preset's actions at one application, never more than that person may:\n\n read deploy.read, data.read, operations.read\n deploy read, and deploy.trigger\n operate deploy, secret.manage, app.manage and operations.triage\n create app.manage wherever the person holds it, with no --app: it also changes and deletes apps\n\nThe refresh token goes to the helper and nowhere else: the helper runs as `sh -c '<helper> get|store'`,\nreads `origin=<console origin>` (and, for `store`, `refresh_token=<token>`) on stdin, and `get` prints\n`refresh_token=<token>`, or nothing. Every call then trades it for a short-lived access token, and IAM\nrotates it each time; a lock under $XDG_CACHE_HOME/fabrika (~/.cache/fabrika when unset) serializes that\nbetween processes on this machine. If a refresh's answer is lost, the stored token is spent and the next\ncall says to run `auth device` again.\n\n`key issue` mints that credential and therefore authenticates differently \u2014 it presents the\ninstallation's IAM RPC key as transport authentication and its provisioning key as the ISSUING\ncredential. Every key expires: `--expires-in` is required and at most 2592000 (30 days). Both\ncredentials are read from the environment only:\n\n FABRIKA_IAM_RPC_URL required IAM's PUBLIC origin, or --iam-url\n FABRIKA_IAM_RPC_KEY required the installation's IAM RPC key\n FABRIKA_IAM_PROVISIONING_KEY required the installation's seeded `px_` provisioning key\n FABRIKA_CONTROL_APP_ID optional the control app's IAM id (default `vozka`)\n\nThe PUBLIC origin is the `https://` address the installation answers on \u2014 the one `platform admin`\nand `platform init` print in their closing block, and the value `FABRIKA_IAM_ISSUER` holds on the\ncontrol service. It is NOT the private hostname the services use between themselves: `http://iam:3000`\nresolves inside the provider's project and nowhere else, so from here it only ever fails to connect.\n\n`external-apps` and `oauth-clients` manage the OAuth clients IAM serves (ADR-0089). They call IAM's admin API\nwith two of the variables `key issue` reads, and nothing else: FABRIKA_IAM_RPC_URL (or --iam-url), IAM's PUBLIC origin,\nand FABRIKA_IAM_PROVISIONING_KEY, the bearer. An external application is an application outside this installation that\nsigns people in through IAM; `put` replaces it whole from a file (record, roles and clients) and is idempotent:\n\n {\n \"app\": \"ops-tool\",\n \"name\": \"Ops tool\",\n \"resource\": \"https://ops.example.com\",\n \"roles\": [{ \"key\": \"viewer\", \"name\": \"Viewer\" }],\n \"clients\": [{ \"clientId\": \"https://ops.example.com/oauth/client.json\",\n \"redirectUris\": [\"https://ops.example.com/oauth/callback\"], \"metadataUrl\": null }]\n }\n\n`roles` null or left out: every active user of the installation signs in. `get` prints the same file, ready to edit\nand put back. Removing a client, changing the resource or deleting the application revokes the sign-ins through it.\n`oauth-clients put` writes an MCP authoring client, whose tokens reach the console's /mcp:\n\n { \"clientId\": \"https://claude.ai/oauth/mcp-oauth-client-metadata\", \"label\": \"claude\",\n \"redirectUris\": [\"https://claude.ai/api/mcp/auth_callback\"] }\n\n`label` is claude, chatgpt or external. A client of an external application is written only through\n`external-apps put`, and `oauth-clients` refuses it. `put` checks the file before anything is sent. Until a platform\ndeploy of this release has imported the installation's client list, IAM refuses both `put`s; deploy, then repeat.\nThe console registers external applications too, under Access \u2192 External applications.\n\nConnecting a GitHub source is NOT here and will not be: App creation is a browser flow whose\nauthorization requires a human principal (ADR-0029). Use Settings \u2192 Source in the console.\n";
|
|
6
|
+
declare const USAGE = "fabrika control \u2014 operate the Delivery control plane\n\nUsage:\n fabrika control auth device --preset=<read|deploy|operate|create> [--app=<id>]\n fabrika control key issue --label=<name> --permissions=<a,b,c> --expires-in=<seconds> [--iam-url=<origin>]\n fabrika control apps list\n fabrika control apps get --app=<id>\n fabrika control apps environments list --app=<id>\n fabrika control apps environments put --provider=<name> --app=<id> --env=<name> --manifest=<path>\n [--domain=<host>] [--public-origin=<url>] [--trigger-ref=<ref>] [--namespace=<id>]\n [--cross-origin=<origin> ...] [--kind=standard|dev] [--wait]\n fabrika control apps environments suspend --app=<id> --env=<name> [--wait]\n fabrika control apps environments resume --app=<id> --env=<name> [--wait]\n fabrika control apps variables list --app=<id>\n fabrika control apps variables put --app=<id> --name=<name> --value=<text> [--env=<name>] [--not-secret] [--request] [--wait]\n fabrika control apps variables delete --app=<id> --name=<name> [--env=<name>] [--request] [--wait]\n fabrika control apps secrets list --app=<id>\n fabrika control apps secrets put --app=<id> --name=<name> [--env=<name>] [--request] [--wait] (the value on stdin)\n fabrika control apps secrets delete --app=<id> --name=<name> [--env=<name>] [--request] [--wait]\n fabrika control register --provider=<name> --app=<id> --repo=<url> --env=<name> --manifest=<path>\n [--domain=<host>] [--public-origin=<url>] [--trigger-ref=<ref>]\n [--namespace=<id>] [--installation-id=<n|none>] [--cross-origin=<origin> ...]\n fabrika control namespaces list\n fabrika control namespaces get --namespace=<id>\n fabrika control namespaces plan --namespace=<id> --env=<name> --preset=<cheap|mid|full> [placement]\n fabrika control namespaces create --namespace=<id> --env=<name> --preset=<cheap|mid|full> [placement]\n fabrika control namespaces reconcile --namespace=<id>\n fabrika control namespaces update --namespace=<id> --proxy-source=current\n fabrika control namespaces remove --namespace=<id>\n fabrika control namespaces release-claims --namespace=<id> --app=<id> --env=<name>\n fabrika control deploy --app=<id> --env=<name> [--ref=<ref>] [--wait]\n fabrika control runs list [--app=<id>] [--env=<name>] [--limit=<n>]\n fabrika control runs get --run=<id>\n fabrika control runs log --run=<id>\n fabrika control requests get <id> [--wait]\n fabrika control access request-grant --app=<id> --env=<name> --principal=<id> --role=<role>\n [--scope=<dimension>:<value>] --expires-in=<seconds> [--wait]\n fabrika control access request-key --app=<id> --action=<action> [--action=<action>\u2026] --label=<text>\n --expires-in=<seconds> --wait\n fabrika control external-apps list | get <app> | put --file=<app.json> | delete <app> [--iam-url=<origin>]\n fabrika control oauth-clients list | put --file=<client.json> | delete <client id> [--iam-url=<origin>]\n\n`register` CREATES an app and refuses a second one with the same id. Re-registering a changed\nmanifest \u2014 a new import document, or a new `zerops.yaml` of an app without a contract \u2014 is\n`apps environments put`, which replaces one environment's envelopes and leaves the app row alone. A\ncontract app's deploy registers the `zerops.yaml` of its commit itself.\n\nA manifest that publishes the app through the namespace proxy is routed by HOST, so `--domain` is\nREQUIRED for it \u2014 on `register` and on `apps environments put` alike \u2014 and a registration without one is\nrefused before anything is created. `namespaces get` lists the hosts a `zerops-subdomain` namespace\nserves and which of them are still free; a custom-domain namespace serves the domain you bound to its\nproxy. A manifest with no proxy target needs no domain.\n\n`apps environments suspend` takes an environment offline in an incident, such as a compromised or leaked application.\nBehind a Zerops namespace proxy every request to it answers 503 once the republished proxy is live, which takes the\nminutes of a proxy build; `namespaces get` follows it. A namespace pinned to an older proxy source is refused with the\nre-pin to run first. On Cloudflare the environment's object goes into maintenance `closed`. `resume` restores the\nrouting it had, or on Cloudflare the maintenance mode it was in. Neither stops the application's service, nor\nrevokes a key. Repeating either is a retry.\n\nA variable's value is stored and printed in clear, so `apps variables put` refuses one that looks like a\ncredential (by its name, such as `*_TOKEN` or `*_PASSWORD`, or by its value) and names `apps secrets put` instead.\n`--not-secret` stores it anyway, for a value you have checked is not one. A secret's value is write-only: `apps secrets put`\nreads it from STDIN, never from a flag, so it reaches neither shell history nor a process listing, and\none trailing newline is dropped. No command prints it back; `apps secrets list` shows names, scope and\nstorage only. Generate one in the pipe:\n\n openssl rand -base64 32 | fabrika control apps secrets put --app=<id> --name=<name>\n\n`--public-origin` is where IAM may return a signed-in person: without one, sign-in to the environment is\nrefused. When `register` is given none and the namespace lists `--domain` among its hosts, it sets\n`https://<domain>` and says so on stderr. A custom domain needs the flag.\n\n`--cross-origin` names an origin whose pages may call the environment's cross-origin endpoints (ADR-0022), and\nrepeats: the flags given are the environment's whole list. Each is an exact origin with a literal host\n(`https://app.example.com`; `http://` only for a local one), never the environment's own domain, at most 16.\n`apps environments put` without the flag keeps the stored list, and a lone empty `--cross-origin=` clears it.\nOn Zerops the change reaches the namespace proxy at once; on Cloudflare the next deploy of the environment\napplies it.\n\n`--installation-id` has three states: omitted resolves the installation from the repository owner's\nconnected GitHub App, `none` registers an anonymous PUBLIC repository source, and a number names one\ninstallation outright. With `none`, control reads the repository once without a token and refuses one\nGitHub hides: a private repository needs the GitHub App connected in the console first.\n\n`--trigger-ref` is the git ref whose push deploys the environment; without it the environment deploys only\non `deploy`. A bare name is a branch: `--trigger-ref=deploy/prod` is stored as `refs/heads/deploy/prod`.\nA full ref is kept as given: `refs/heads/<branch>`, `refs/tags/<tag>`, or a `*` glob such as\n`refs/tags/v*`, which deploys every matching tag. A tag always needs the `refs/tags/` form. Each\nenvironment of an app needs its own trigger ref. Branches named `fabrika/\u2026` are reserved for MCP\nworkspaces and are never a trigger ref.\n\n`deploy` of a protected environment with `FABRIKA_CONTROL_KEY` or a device grant is a request a person approves:\n`--ref` names a 40-character commit SHA, by default one merged into the environment's trigger ref (or the default\nbranch), and stderr prints the console link the person opens. `--wait` follows the run until it succeeds or\nfails, approval being one step on the way, and prints its final row; a refusal or an expiry says so on stderr.\n\n`requests get` reads one approval request: a change an agent or a key asked a person to approve, by the id its\ncreation answered. stderr prints the console link while it waits, and why it did not run once it failed, went stale or\nexpired. `--wait` reads it again until it is refused, expired, executed, failed or stale, and prints its final row;\nonce a person decided it, it stops with an error after 15 minutes without an outcome.\n\n`--request` on `apps secrets put|delete` and `apps variables put|delete` does not make the change: it asks a person\nto approve it. Every other verb refuses it. Control stores the request, inert, and stderr prints the console link the person opens; for a secret it\nalso prints the value's fingerprint (the first 8 hex characters of its SHA-256, computed here), which the page shows\nbeside the value's length, so the person can tell it is the value you sent; when Control's answer names another\nfingerprint, the command fails and says to refuse the request. Control seals the value and stores only that. stdout\nprints the request's id, state and link; `--wait` follows it as `requests get --wait` does. Without `--env` the request\nis for every environment of the app, and every protected one judges it. A secret the provider keeps (a Zerops\nenvironment) is requested for one `--env`.\n\n`access request-grant` asks a person to give a principal (this agent's own, or another) one role of an application\nenvironment. It needs `access.request` at the app, the role must be one the environment's approved contract declares,\na membership role takes `--scope` with a value of its dimension, and `--expires-in` is at most 30 days. An IAM\nadministrator of the application approves it at the console link stderr prints; the grant is then theirs, and where\nthe application's grants wait for approval, IAM holds it for a second administrator. An environment that does not gate\nan agent's grants (not protected, or `agent-grants` off) refuses it: there is nothing to approve there. stdout prints\nthe request's id, state and link; `--wait` follows it as `requests get --wait` does.\n\nWithout `--request`, a write by `FABRIKA_CONTROL_KEY` or a device grant on a protected environment meets that\nenvironment's approval policy (ADR-0083): `apps secrets` and `apps variables` are `secrets` and `variables` writes,\n`apps environments put` is a `registry` write, and `apps environments suspend|resume` are `data` writes.\nA category set to `off` applies the write; `refuse` refuses it; `person` does not make the change but stores it as a\nrequest, exactly as `--request` does: stdout prints its id, state and link, stderr the fingerprint of a secret, and the\ncommand exits 75. Hand the person the link; nothing changes until they approve it. `--wait` follows the request\ninstead, and succeeds only when it executed.\n\n`access request-key` asks a person for a key holding exact Control actions at one application (each `--action`, no\nwildcard), for someone other than this agent, expiring in at most 30 days. It needs `access.request` at the app, and\nthe protected environments' `credentialCeiling` decides whether the key may hold actions this agent does not. It\nmakes a key pair in memory, sends only the public key, and prints on stderr the console link and the public key's\nthumbprint, which the page shows: an IAM installation administrator checks it there and approves with a passkey. IAM\nencrypts the key to that public key, and Control hands it out once. `--wait` is required: the private key never leaves\nthis process, so the key cannot be fetched later; the command waits for the decision, fetches the key, decrypts it, and\nprints it once on stdout. A request that issues no key (refused, expired, failed) fails with why.\n\nNamespace placement options, each defaulting to what the preset would choose:\n\n --project=<name> the provider project the namespace owns; on Zerops the default is\n fabrika-<env>-<namespace id>, beside the installation's fabrika-<env>\n --core-package=<LIGHT|SERIOUS> defaults to LIGHT on every environment, `prod` included (ADR-0038).\n SERIOUS is a deliberate choice: a project cannot be downgraded again\n --public-access=<custom-domain|zerops-subdomain>\n --exclusive-app=<id> required by, and only by, the `full` preset\n --postgres-type=<type> the `cheap` preset's shared PostgreSQL; on Zerops postgresql:single@18\n (default) or postgresql:ha@18, which keeps its data through a node loss.\n Fixed once created\n --postgres-profile=<profile> its profile, given together with --postgres-type: oltp-hobby for single,\n oltp-staging (about $11) or oltp-production (about $72) for HA\n\n`namespaces plan` is a preview and changes nothing. It prints one `<path>\\t<value>` row per field of\nthe plan, keyed by its path in `--json`; a multi-line value such as the proxy's descriptor file is shown\nby size only. `namespaces create` commits that exact plan \u2014 the\nsame two steps the console's form takes \u2014 and returns as soon as the placement is recorded: provisioning\nruns behind the control queue and takes minutes, so the state comes back `pending`. Follow it with\n`namespaces get` or `namespaces list`; nothing needs to stay connected. `namespaces remove` frees the id\nof a placement no application is registered in. It deletes nothing at the provider and prints, on stderr,\nthe provider resources it stopped tracking. `namespaces update --proxy-source=current` re-pins a placement's\nproxy to the source this control plane deploys new placements from \u2014 a placement keeps the one it was created\nwith until you do \u2014 and queues the reconcile that rebuilds the proxy from it; a `failed` placement accepts it.\n\n`namespaces release-claims` frees the resource names one app environment holds in a placement, which an\nenvironment or app delete otherwise refuses over. Delete those resources at the provider first: the release\nreads each one back and refuses, naming it, while any still exists. It prints one released key per line.\n\nEvery command accepts --json, which prints the procedure's result verbatim.\n\nThe control origin is not a credential and takes either form:\n\n --url=<origin> FABRIKA_CONTROL_URL\n\nCredentials are read from the ENVIRONMENT ONLY and have no flag, so they cannot reach a CI log or a\nprocess listing. One of:\n\n FABRIKA_CONTROL_KEY a machine `px_` credential for the control app; it wins when both are set\n FABRIKA_CONTROL_CREDENTIAL_HELPER a command with `get` and `store` that holds the refresh token of a\n `control auth device` grant (below)\n\n`auth device` asks IAM for a grant a person approves in the browser (RFC 8628). It prints the page and the\ncode on stderr and waits; the person signs in, checks the code, and picks how long the grant lasts (an hour, a\nday or a week). The grant holds the preset's actions at one application, never more than that person may:\n\n read deploy.read, data.read, operations.read\n deploy read, and deploy.trigger\n operate deploy, secret.manage, app.manage and operations.triage\n create app.manage wherever the person holds it, with no --app: it also changes and deletes apps\n\nThe refresh token goes to the helper and nowhere else: the helper runs as `sh -c '<helper> get|store'`,\nreads `origin=<console origin>` (and, for `store`, `refresh_token=<token>`) on stdin, and `get` prints\n`refresh_token=<token>`, or nothing. Every call then trades it for a short-lived access token, and IAM\nrotates it each time; a lock under $XDG_CACHE_HOME/fabrika (~/.cache/fabrika when unset) serializes that\nbetween processes on this machine. If a refresh's answer is lost, the stored token is spent and the next\ncall says to run `auth device` again.\n\n`key issue` mints that credential and therefore authenticates differently \u2014 it presents the\ninstallation's IAM RPC key as transport authentication and its provisioning key as the ISSUING\ncredential. Every key expires: `--expires-in` is required and at most 2592000 (30 days). Both\ncredentials are read from the environment only:\n\n FABRIKA_IAM_RPC_URL required IAM's PUBLIC origin, or --iam-url\n FABRIKA_IAM_RPC_KEY required the installation's IAM RPC key\n FABRIKA_IAM_PROVISIONING_KEY required the installation's seeded `px_` provisioning key\n FABRIKA_CONTROL_APP_ID optional the control app's IAM id (default `vozka`)\n\nThe PUBLIC origin is the `https://` address the installation answers on \u2014 the one `platform admin`\nand `platform init` print in their closing block, and the value `FABRIKA_IAM_ISSUER` holds on the\ncontrol service. It is NOT the private hostname the services use between themselves: `http://iam:3000`\nresolves inside the provider's project and nowhere else, so from here it only ever fails to connect.\n\n`external-apps` and `oauth-clients` manage the OAuth clients IAM serves (ADR-0089). They call IAM's admin API\nwith two of the variables `key issue` reads, and nothing else: FABRIKA_IAM_RPC_URL (or --iam-url), IAM's PUBLIC origin,\nand FABRIKA_IAM_PROVISIONING_KEY, the bearer. An external application is an application outside this installation that\nsigns people in through IAM; `put` replaces it whole from a file (record, roles and clients) and is idempotent:\n\n {\n \"app\": \"ops-tool\",\n \"name\": \"Ops tool\",\n \"resource\": \"https://ops.example.com\",\n \"roles\": [{ \"key\": \"viewer\", \"name\": \"Viewer\" }],\n \"clients\": [{ \"clientId\": \"https://ops.example.com/oauth/client.json\",\n \"redirectUris\": [\"https://ops.example.com/oauth/callback\"], \"metadataUrl\": null }]\n }\n\n`roles` null or left out: every active user of the installation signs in. `get` prints the same file, ready to edit\nand put back. Removing a client, changing the resource or deleting the application revokes the sign-ins through it.\n`oauth-clients put` writes an MCP authoring client, whose tokens reach the console's /mcp:\n\n { \"clientId\": \"https://claude.ai/oauth/mcp-oauth-client-metadata\", \"label\": \"claude\",\n \"redirectUris\": [\"https://claude.ai/api/mcp/auth_callback\"] }\n\n`label` is claude, chatgpt or external. A client of an external application is written only through\n`external-apps put`, and `oauth-clients` refuses it. `put` checks the file before anything is sent.\nThe console registers external applications too, under Access \u2192 External applications.\n\nConnecting a GitHub source is NOT here and will not be: App creation is a browser flow whose\nauthorization requires a human principal (ADR-0029). Use Settings \u2192 Source in the console.\n";
|
|
7
7
|
interface Flags {
|
|
8
8
|
readonly values: ReadonlyMap<string, string>;
|
|
9
9
|
/** Every value of every option, in order; `values` keeps the last. Only a repeatable option reads it. */
|
package/types/src/data.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const USAGE = "fabrika env \u2014 an application environment's data, through the control plane\n\nUsage:\n fabrika env inspect <app> <env> [--content] [--json]\n fabrika env maintenance <app> <env> <open|read-only|closed> [--wait] [--json]\n fabrika env operations <app> <env> [--json]\n fabrika env recover <app> <env> <operationId> <resume|open> [--wait] [--json]\n fabrika env backups <app> <env> [--json]\n fabrika env backups schedule <app> <env> [on|off] [--wait] [--json]\n fabrika env restore <app> <env> --at=<time> [--wait] [--json]\n\n`inspect` prints the environment's data view: the object's maintenance mode and generation, the database size and\neach table's row count (a count at 100000 reads `100000+`: it is capped), the applied migrations,\nthe scheduler's alarm, each job's last run, file and webhook counts, and when the application last failed to boot.\nIt needs `data.read`. `--content` adds the boot failure's message and stack, which are the application's own text,\nand needs `data.content.read` granted globally.\n\n`maintenance` puts the environment into a mode: `read-only` refuses writes, `closed` refuses every request, and\n`open` serves again. It starts a data operation and prints it; `operations` follows it. It needs `data.manage`.\n\n`operations` lists the environment's data operations, newest first, one row each:\n<id> <kind> <state> <step> <target mode> <generation> <error code> <created at>.\n\n`recover` fences an environment whose operation is stuck in `closed` at a fresh generation, then `resume`s that\noperation from its recorded step, or `open`s the environment. A failed operation can only be opened past. It needs
|
|
1
|
+
declare const USAGE = "fabrika env \u2014 an application environment's data, through the control plane\n\nUsage:\n fabrika env inspect <app> <env> [--content] [--json]\n fabrika env maintenance <app> <env> <open|read-only|closed> [--wait] [--json]\n fabrika env operations <app> <env> [--json]\n fabrika env recover <app> <env> <operationId> <resume|open|rollback> [--wait] [--json]\n fabrika env backups <app> <env> [--json]\n fabrika env backups schedule <app> <env> [on|off] [--wait] [--json]\n fabrika env restore <app> <env> --at=<time> [--wait] [--json]\n\n`inspect` prints the environment's data view: the object's maintenance mode and generation, the database size and\neach table's row count (a count at 100000 reads `100000+`: it is capped), the applied migrations,\nthe scheduler's alarm, each job's last run, file and webhook counts, and when the application last failed to boot.\nIt needs `data.read`. `--content` adds the boot failure's message and stack, which are the application's own text,\nand needs `data.content.read` granted globally.\n\n`maintenance` puts the environment into a mode: `read-only` refuses writes, `closed` refuses every request, and\n`open` serves again. It starts a data operation and prints it; `operations` follows it. It needs `data.manage`.\n\n`operations` lists the environment's data operations, newest first, one row each:\n<id> <kind> <state> <step> <target mode> <generation> <error code> <created at>.\n\n`recover` fences an environment whose operation is stuck in `closed` at a fresh generation, then `resume`s that\noperation from its recorded step, or `open`s the environment. A failed operation can only be opened past, or, for a\nfailed migration whose data holds nothing of it (`rollbackAndOpen` in `--json`), rolled back: `rollback` fences\nit in `inspect`, deploys the last succeeded commit again as a new run, waits until the failed version is gone and\nopens it. It needs `data.manage`.\n\n`backups` lists the environment's consistent backups, newest first, one row each:\n<id> <object> <state> <created at> <size bytes> <parts> <tables> <rehearsal> <rehearsal code> <error code> <expired>\n<pre-migration>.\nA backup counts as `succeeded` only once its rehearsal, an import into a scratch object, passed. One older than 30\ndays is `expired` and never offered for a restore. The last column is `pre-migration` for the backup a migration\ntakes before its deploy, and `-` for any other, such as a daily backup or a restore's. It needs `data.read`.\n\n`backups schedule` prints whether the environment takes a daily backup; `on` or `off` sets it, which needs\n`data.manage`. Turning it off stops the daily backup only: the backup before a migration still runs.\n\n`restore` brings back the environment's data as it was at `--at`, an ISO 8601 time with an offset in the past. It\nis a side restore: the serving object is frozen read-only and backed up, the backup is imported into a new clone\nobject, ordinary traffic is pointed at the clone, which serves the current data from then on, and the original is\nrewound to that time and kept in `inspect`, serving nothing, for inspection. It starts a data operation and prints\nit; `operations` follows it. It needs `data.manage`.\n\nOn a protected environment whose `data` category waits for a person (ADR-0083), a write by a key or an agent does not\napply: Control stores it as an approval request, the request's `<id> <state> <url>` goes to stdout, and the command\nexits 75. Hand the person the link. `--wait` follows the request to its end instead and succeeds only when it executed.\n\nA release of the control plane that does not offer a command answers that it is not available; retrying does not\nchange that. An environment the caller may not see answers `not_found`, as one that does not exist.\n\nstdout carries data only; progress and follow-up commands go to stderr. `--json` prints the result as JSON.\n\nThe control origin takes either form:\n\n --url=<origin> FABRIKA_CONTROL_URL\n\nThe credential is read from the ENVIRONMENT ONLY and has no flag; one of:\n\n FABRIKA_CONTROL_KEY a machine `px_` credential for the control app\n FABRIKA_CONTROL_CREDENTIAL_HELPER the helper a `fabrika control auth device` grant is stored through\n";
|
|
2
2
|
type Environment = Readonly<Record<string, string | undefined>>;
|
|
3
3
|
/** Every control character but tab and line feed: an answer must not drive the operator's terminal. */
|
|
4
4
|
export declare const printable: (text: string) => string;
|