@sequenceholdings/studio-cli 0.7.0 → 0.7.2
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 +68 -8
- package/dist/app/commands.d.ts +3 -1
- package/dist/app/commands.js +51 -0
- package/dist/app/validate.d.ts +16 -0
- package/dist/app/validate.js +40 -0
- package/dist/atlas-client.d.ts +2 -0
- package/dist/atlas-client.js +8 -0
- package/dist/bin.js +2 -1
- package/dist/cli-errors.js +8 -3
- package/dist/command-contract.d.ts +6 -0
- package/dist/command-contract.js +1 -0
- package/dist/command-help.d.ts +4 -3
- package/dist/command-help.js +39 -3
- package/dist/functions/commands.d.ts +4 -0
- package/dist/functions/commands.js +61 -0
- package/dist/main.js +5 -0
- package/dist/orm/delegate.d.ts +1 -0
- package/dist/orm/delegate.js +40 -14
- package/dist/orm/discover-schema.d.ts +98 -0
- package/dist/orm/discover-schema.js +32 -0
- package/dist/orm/discover.js +28 -3
- package/dist/orm/execute.d.ts +33 -0
- package/dist/orm/execute.js +208 -0
- package/dist/orm/operation-show.d.ts +2 -0
- package/dist/orm/operation-show.js +35 -0
- package/dist/orm/read.js +2 -2
- package/dist/transient-503.d.ts +4 -0
- package/dist/transient-503.js +25 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ inspect `truncated` and pagination metadata where present.
|
|
|
56
56
|
# In a process or artifact repo (devDependency, using pnpm — see below):
|
|
57
57
|
pnpm add -D @sequenceholdings/studio-cli @sequenceholdings/lattice
|
|
58
58
|
|
|
59
|
-
# Or globally
|
|
59
|
+
# Or globally:
|
|
60
60
|
pnpm add -g @sequenceholdings/studio-cli
|
|
61
61
|
```
|
|
62
62
|
|
|
@@ -248,8 +248,15 @@ locations, dependencies, and deployment selection.
|
|
|
248
248
|
| `seq-studio init <dir> [--with <kinds>] [--skip-install]` | Scaffold a version 3 app, root pnpm workspace, shared package, README, and selected primitives; by default creates ORM, function, process, and artifact primitives, installs dependencies, and authors the first ORM migration |
|
|
249
249
|
| `seq-studio add <kind> <name> [--depends-on <ids>] [--template <t>]` | Add any primitive, including additional ORM namespaces and UIs |
|
|
250
250
|
| `seq-studio add package <name>` | Add a shared TypeScript package to the manifest and pnpm workspace |
|
|
251
|
+
| `seq-studio validate [--dir <path>] [--json]` | Offline check of the app manifest, dependency graph, contained primitive directories, and resolved member refs |
|
|
251
252
|
| `seq-studio deploy -e <env> [--yes] [--only id1,id2] [--dry-run]` | Validate and deploy the selected app graph, including prerequisites |
|
|
252
253
|
|
|
254
|
+
`seq-studio validate` works before a legacy repository is adopted: it needs no
|
|
255
|
+
login or environment and lists existing members such as process refs. It does
|
|
256
|
+
not verify that remote members exist or that primitive-specific source can
|
|
257
|
+
deploy. `seq-studio deploy --dry-run` still requires the repository identity
|
|
258
|
+
receipt and performs its existing deployment preflight.
|
|
259
|
+
|
|
253
260
|
`init` accepts `orm`, `workspace`, `function`, `agent`, `process`, `pipeline`, and `artifact` as
|
|
254
261
|
a comma-separated `--with` list or boolean flags (`--agent --process`). With no
|
|
255
262
|
kind flags it scaffolds `orm,function,process,artifact`. Repository CI/CD
|
|
@@ -847,9 +854,11 @@ compiled to canonical SQL before registration.
|
|
|
847
854
|
| `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes. |
|
|
848
855
|
| `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
|
|
849
856
|
| `seq-studio orm apply [dir] -e <env>` | Author a migration if needed, register/apply the namespace, activate its operation set, publish roles/capabilities, and refresh generated outputs. |
|
|
850
|
-
| `seq-studio orm execute <operation> [
|
|
857
|
+
| `seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...` | Execute the deployed version's persisted operation by name, as the signed-in caller. Needs no checkout. |
|
|
858
|
+
| `seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>` | Execute one named persisted operation as hashed in this checkout's `operations.manifest.json`, with variables from a JSON object file, as the signed-in caller. |
|
|
851
859
|
| `seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]` | List the namespaces you can read. |
|
|
852
|
-
| `seq-studio orm describe <namespace> [<table>] -e <env> [--json]` | Show a namespace's tables, views, and persisted operations, or one table's columns, actions, and the operations that write it. |
|
|
860
|
+
| `seq-studio orm describe <namespace> [<table> \| --operations] -e <env> [--json]` | Show a namespace's tables, views, and persisted operations (with their variables), only its operations, or one table's columns, actions, and the operations that write it. |
|
|
861
|
+
| `seq-studio orm operation show <namespace> <name> -e <env> [--json]` | Show the active persisted operation's registered GraphQL document; JSON also includes its hash and declared variables. Requires namespace read access. |
|
|
853
862
|
| `seq-studio orm read <namespace> <table> -e <env> [--where …] [--select …] [--order …] [--limit N] [--offset N] [--json\|--jsonl]` | Read rows of a deployed v2 namespace's table as the caller. |
|
|
854
863
|
| `seq-studio orm sql <namespace> --query <sql> \| --file <path> -e <env> [--param …] [--json\|--jsonl]` | Run read-only SQL against a deployed v2 namespace as the caller. |
|
|
855
864
|
| `seq-studio orm migrate-from-yaml <dir>` | Convert a legacy YAML namespace to TypeScript authoring while preserving its committed migrations. |
|
|
@@ -873,8 +882,9 @@ pnpm exec seq-studio orm apply . -e local
|
|
|
873
882
|
pnpm exec seq-studio orm validate .
|
|
874
883
|
```
|
|
875
884
|
|
|
876
|
-
|
|
877
|
-
|
|
885
|
+
Global ORM commands require a CLI release that declares `drizzle-orm` directly.
|
|
886
|
+
Older releases can fail during module loading because `drizzle-kit` imports
|
|
887
|
+
`drizzle-orm` without declaring it. Update the global CLI if you see that error.
|
|
878
888
|
|
|
879
889
|
`apply --dry-run` rehearses a migration against a disposable branch copy of
|
|
880
890
|
the target environment's data. `apply --no-create` is the CI guard that refuses
|
|
@@ -899,7 +909,9 @@ read-only.
|
|
|
899
909
|
seq-studio orm namespaces -e <env> # NAMESPACE FORMAT TABLES OPERATIONS DESCRIPTION
|
|
900
910
|
seq-studio orm namespaces -e <env> --limit 20 --offset 20 --json
|
|
901
911
|
seq-studio orm describe lending -e <env> # tables, views, persisted operations
|
|
912
|
+
seq-studio orm describe lending --operations -e <env> # operations, requirements, variables
|
|
902
913
|
seq-studio orm describe lending loans -e <env> # columns, enum values, links, actions
|
|
914
|
+
seq-studio orm operation show lending ListLoans -e <env> --json # active document and hash
|
|
903
915
|
```
|
|
904
916
|
|
|
905
917
|
- `namespaces` lists only namespaces you can read, ordered by name, with their
|
|
@@ -913,6 +925,35 @@ seq-studio orm describe lending loans -e <env> # columns, enum values, links
|
|
|
913
925
|
primary key or unique), the values of its enums, its links and actions, and
|
|
914
926
|
the persisted operations that write it. The column names are the ones `read`
|
|
915
927
|
and `sql` accept.
|
|
928
|
+
- Each persisted operation lists the variables it declares as `name: type`, with
|
|
929
|
+
`!` when required and `= value` for a default. `--operations` prints only the
|
|
930
|
+
operations.
|
|
931
|
+
- `operation show` reads one active operation through the namespace reader gate.
|
|
932
|
+
Without `--json` it prints the registered GraphQL document. `--json` includes
|
|
933
|
+
the document, hash, variables, and requirements for contract review. Missing
|
|
934
|
+
and unreadable operations return the same not-found result. It does not run
|
|
935
|
+
the operation or read rows.
|
|
936
|
+
|
|
937
|
+
### Running a deployed operation (`orm execute <namespace> <operation>`)
|
|
938
|
+
|
|
939
|
+
```bash
|
|
940
|
+
seq-studio orm execute lending ListLoans -e <env> --var officer=<uuid> --var limit=5
|
|
941
|
+
seq-studio orm execute lending ListLoans -e <env> --variables-file variables.json
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
The by-name form looks the operation up in the namespace's deployed version and
|
|
945
|
+
runs it as you, so it needs no checkout and runs what is deployed even when a
|
|
946
|
+
local clone is behind. `--var <name>=<value>` (repeatable) sets one variable
|
|
947
|
+
over the file: numbers and booleans parse by the declared type, lists, filter
|
|
948
|
+
inputs, and `jsonb` take JSON, and other types take the text as is. Use the file
|
|
949
|
+
for `null`. An unknown name lists the deployed operations, and an input error
|
|
950
|
+
lists the operation's variables.
|
|
951
|
+
|
|
952
|
+
The checkout form, `orm execute <operation> [dir]`, sends the hash from that
|
|
953
|
+
directory's `operations.manifest.json`. When the deployed version hashes the
|
|
954
|
+
operation differently, it prints the local hash, the deployed hash, the deployed
|
|
955
|
+
version, and the by-name command to run instead. The second argument picks the
|
|
956
|
+
form: an existing directory means a checkout.
|
|
916
957
|
- A namespace you cannot read reports not found, the same as one that does not
|
|
917
958
|
exist. `--json` prints the full description, including read and write
|
|
918
959
|
policies, but not the generated GraphQL SDL.
|
|
@@ -1142,6 +1183,7 @@ functions cannot opt in retroactively. The default remains mutable. See the
|
|
|
1142
1183
|
| `seq-studio functions deploy --dir <dir> -e <env>` | Preview secrets and deploy a local function |
|
|
1143
1184
|
| `seq-studio functions build --repo managed-functions/<name> [--path <dir>] -e <env>` | Materialize and validate a function from the platform Git Service |
|
|
1144
1185
|
| `seq-studio functions deploy --repo managed-functions/<name> [--path <dir>] -e <env>` | Materialize and deploy a function from the platform Git Service |
|
|
1186
|
+
| `seq-studio functions show --fn <slug> -e <env> --json [--version <id-or-name>]` | Inspect reader-gated active release provenance and optionally select an exact submitted version |
|
|
1145
1187
|
| `seq-studio functions limits [-e <env>] [--json] [--fn <slug>]` | Inspect fleet, runtime, cache, and bundle defaults/caps; optionally inspect one function's effective runtime limits |
|
|
1146
1188
|
| `seq-studio functions invoke --fn <slug> -e <env> [--data <json> \| --data @<file> \| --stdin]` | Invoke a deployed function and print its response body |
|
|
1147
1189
|
|
|
@@ -1149,6 +1191,17 @@ functions cannot opt in retroactively. The default remains mutable. See the
|
|
|
1149
1191
|
that function. Versions named by repository CI, such as `ci-abc`, do not reset
|
|
1150
1192
|
the sequence. A function with no numbered versions starts at `v1`.
|
|
1151
1193
|
|
|
1194
|
+
After an upload is accepted, `functions show --fn <slug> -e <env> --json` returns
|
|
1195
|
+
the server's `activeVersionId`, `immutableRelease`, exact active version, and
|
|
1196
|
+
version history with status, Git revision and dirty bit, and source digest.
|
|
1197
|
+
Use `--version <id-or-name>` to include `selectedVersion` for a submitted
|
|
1198
|
+
release, even while another version is active. Missing provenance on older
|
|
1199
|
+
version records appears as `null`; an environment that does not expose release
|
|
1200
|
+
identity fails the inspection. Reader access is required. If a deploy poll
|
|
1201
|
+
loses transport after upload acceptance, inspect the accepted version's status
|
|
1202
|
+
and compare its ID with `activeVersionId` before deciding what to do next.
|
|
1203
|
+
Do not resubmit the deployment solely because its poll disconnected.
|
|
1204
|
+
|
|
1152
1205
|
To select an existing secret version before the first deployment, declare its
|
|
1153
1206
|
name in `managed-function.yml`, then register and pin before uploading code:
|
|
1154
1207
|
|
|
@@ -1898,11 +1951,18 @@ New repositories created on identity-capable Atlas releases contain a committed
|
|
|
1898
1951
|
|
|
1899
1952
|
The platform owns `identity`. Tenant ownership comes from the hosting
|
|
1900
1953
|
deployment, not the creator's organization, repository name, remote URL, or
|
|
1901
|
-
editable file. Renaming a repository does not change its ID.
|
|
1902
|
-
production share a tenant; this file intentionally does not
|
|
1954
|
+
editable file. Renaming a repository does not change its ID. A tenant's staging
|
|
1955
|
+
and production deployments share a tenant; this file intentionally does not
|
|
1956
|
+
select an environment.
|
|
1903
1957
|
Separate hosted repositories still have distinct IDs: copying this file does
|
|
1904
1958
|
not register a mirror or authorize promotion.
|
|
1905
1959
|
|
|
1960
|
+
Environment names alone are not tenant identities; the platform resolves the
|
|
1961
|
+
owner from the hosting deployment configuration. Correcting a deployment's
|
|
1962
|
+
owner mapping does not rewrite identities already issued to repositories; an
|
|
1963
|
+
old mismatched receipt still fails deployment admission and needs explicit
|
|
1964
|
+
platform reconciliation, not a hand-edited receipt or a cross-tenant exception.
|
|
1965
|
+
|
|
1906
1966
|
`metadata` is an extensible JSON object for non-secret annotations (for example,
|
|
1907
1967
|
`{"example.com": {"team": "engineering"}}`). Prefer namespaced keys for tools.
|
|
1908
1968
|
It is never an authorization or deployment-routing input. The whole file is
|
|
@@ -2808,4 +2868,4 @@ load the page or the installed feedback skill.
|
|
|
2808
2868
|
|
|
2809
2869
|
### Planned verified service policy support
|
|
2810
2870
|
|
|
2811
|
-
The unpublished Studio CLI 0.7.0 release chain carries ORM 2.7.
|
|
2871
|
+
The unpublished Studio CLI 0.7.0 release chain carries ORM 2.7.1. Namespace policies using `servicePrincipal()` require the matching deployed IR v6 runtime. Before registration, `orm apply` checks authenticated target protocol support and refuses an unavailable or older runtime. Artifact Studio 0.10.1, Managed Functions 0.4.5 and Pipeline Spec 0.3.0 remain awaiting publication in this same chain; package versions alone do not prove rollout. The existing `workspace:*` consumer dependencies resolve to ORM 2.7.1 when the reviewed chain is packed.
|
package/dist/app/commands.d.ts
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
import type { ParsedArgs } from '../process/commands.js';
|
|
8
8
|
export declare const APP_INIT_USAGE: string;
|
|
9
9
|
export declare const APP_ADD_USAGE: string;
|
|
10
|
-
export declare const APP_DEPLOY_USAGE = "usage:\n seq-studio deploy -e <env> [options]\n\n Requires a platform repository clone with an adopted identity and a matching\n .seq/identity.json committed on the selected server. Checked before any\n primitive runs, including --dry-run; there is no legacy bypass.\n\n Deploy the app declared in sequence.app.yml. Versions 2 and 3 use\n depends_on prerequisites; deploy.order optionally orders ready primitives.\n Runs each kind's existing command:\n orm \u2192 seq-studio orm apply <path> -e <env>\n function \u2192 seq-studio functions deploy --dir <path> -e <env> [--yes]\n agent \u2192 seq-studio agents apply --dir <path> -e <env> [--yes], config-only (access stays in Atlas)\n process \u2192 seq-studio process apply --dir <path> -e <env>\n pipeline \u2192 seq-studio pipeline deploy --repo <repo> --ref <ref> -e <env>\n artifact \u2192 seq-studio artifact deploy <path> -e <env>\n\n Options:\n -e, --env <name> target environment (required)\n --dir <path> app root (default: cwd; must contain sequence.app.yml)\n --only <id1,id2> deploy these ids and their prerequisites (v2)\n --yes non-interactive (forwarded to primitive commands)\n --dry-run validate/compile selected sources without deploying (v2)\n --approved-by <sub> recorded caller approval for protected pipeline targets\n --wait-timeout <d> pipeline polling timeout, e.g. 10m or 2h\n\n Examples:\n seq-studio deploy -e staging --yes\n seq-studio deploy -e local --only get-pokemon --yes\n seq-studio deploy --dir ./pokedex -e staging --dry-run\n\n Run from the app root (directory with sequence.app.yml), or pass --dir.\n Version 1 manifests keep their existing ordering and exact --only behavior.\n Pipelines require repo and ref in their manifest entry.\n ORM namespaces require generated code and a reviewed migration ledger:\n seq-studio orm generate <path> && seq-studio orm diff <path>\n Commit generated migrations before the first deployment and schema changes.\n Repository admission reads the remote receipt at HEAD; all dry-runs need\n network/auth. Version 1 dry-run only lists after that check.\n A dry-run never opens a browser login: sign in beforehand. It warns,\n rather than fails, when the\n artifact source is not committed and clean on main.\n Version 2 writes the result to .sequence/deployments/<environment>.json.\n";
|
|
10
|
+
export declare const APP_DEPLOY_USAGE = "usage:\n seq-studio deploy -e <env> [options]\n\n Requires a platform repository clone with an adopted identity and a matching\n .seq/identity.json committed on the selected server. Checked before any\n primitive runs, including --dry-run; there is no legacy bypass.\n\n Deploy the app declared in sequence.app.yml. Versions 2 and 3 use\n depends_on prerequisites; deploy.order optionally orders ready primitives.\n Runs each kind's existing command:\n orm \u2192 seq-studio orm apply <path> -e <env>\n function \u2192 seq-studio functions deploy --dir <path> -e <env> [--yes]\n agent \u2192 seq-studio agents apply --dir <path> -e <env> [--yes], config-only (access stays in Atlas)\n process \u2192 seq-studio process apply --dir <path> -e <env>\n pipeline \u2192 seq-studio pipeline deploy --repo <repo> --ref <ref> -e <env>\n artifact \u2192 seq-studio artifact deploy <path> -e <env>\n\n Options:\n -e, --env <name> target environment (required)\n --dir <path> app root (default: cwd; must contain sequence.app.yml)\n --only <id1,id2> deploy these ids and their prerequisites (v2)\n --yes non-interactive (forwarded to primitive commands)\n --dry-run validate/compile selected sources without deploying (v2)\n --approved-by <sub> recorded caller approval for protected pipeline targets\n --wait-timeout <d> pipeline polling timeout, e.g. 10m or 2h\n\n Examples:\n seq-studio deploy -e staging --yes\n seq-studio deploy -e local --only get-pokemon --yes\n seq-studio deploy --dir ./pokedex -e staging --dry-run\n\n Run from the app root (directory with sequence.app.yml), or pass --dir.\n Version 1 manifests keep their existing ordering and exact --only behavior.\n Pipelines require repo and ref in their manifest entry.\n ORM namespaces require generated code and a reviewed migration ledger:\n seq-studio orm generate <path> && seq-studio orm diff <path>\n Commit generated migrations before the first deployment and schema changes.\n Repository admission reads the remote receipt at HEAD; all dry-runs need\n network/auth. Version 1 dry-run only lists after that check.\n For offline manifest, graph, path, and member checks before adoption, use\n `seq-studio validate`.\n A dry-run never opens a browser login: sign in beforehand. It warns,\n rather than fails, when the\n artifact source is not committed and clean on main.\n Version 2 writes the result to .sequence/deployments/<environment>.json.\n";
|
|
11
|
+
export declare const APP_VALIDATE_USAGE = "usage:\n seq-studio validate [--dir <path>] [--json]\n\n Validate sequence.app.yml, its dependency graph, and primitive directories\n locally. List resolved Application members, including existing process refs.\n No environment, login, repository adoption, or network access is required.\n This checks local structure only; it does not validate remote member existence,\n primitive-specific source, or authorize deployment. Deploy still requires a\n matching repository identity receipt.\n\n Options:\n --dir <path> app root (default: cwd)\n --json print structured validation result\n";
|
|
12
|
+
export declare function runAppValidateCommand(args: ParsedArgs): Promise<number>;
|
|
11
13
|
/**
|
|
12
14
|
* Hosted Next.js apps deploy only where the deployment runs the Next.js
|
|
13
15
|
* runtime, which not every deployment does yet; the server then refuses with
|
package/dist/app/commands.js
CHANGED
|
@@ -8,6 +8,7 @@ import { basename, resolve } from 'node:path';
|
|
|
8
8
|
import { parseDurationMs } from '@sequenceholdings/lattice';
|
|
9
9
|
import { REQUIRE_EXPLICIT_ENV_MESSAGE, explicitOrSandboxEnv } from '../env-flags.js';
|
|
10
10
|
import { deployApp } from './deploy.js';
|
|
11
|
+
import { validateAppLocal } from './validate.js';
|
|
11
12
|
import { DEFAULT_APP_KINDS, resolveRequestedKinds } from './kinds.js';
|
|
12
13
|
import { AppPreparationError, prepareScaffoldedApp } from './prepare.js';
|
|
13
14
|
import { planRepositoryDeclaration, REPOSITORY_INDEX_PATH, writeRepositoryDeclaration } from './repository-index.js';
|
|
@@ -121,11 +122,61 @@ export const APP_DEPLOY_USAGE = `usage:
|
|
|
121
122
|
Commit generated migrations before the first deployment and schema changes.
|
|
122
123
|
Repository admission reads the remote receipt at HEAD; all dry-runs need
|
|
123
124
|
network/auth. Version 1 dry-run only lists after that check.
|
|
125
|
+
For offline manifest, graph, path, and member checks before adoption, use
|
|
126
|
+
\`seq-studio validate\`.
|
|
124
127
|
A dry-run never opens a browser login: sign in beforehand. It warns,
|
|
125
128
|
rather than fails, when the
|
|
126
129
|
artifact source is not committed and clean on main.
|
|
127
130
|
Version 2 writes the result to .sequence/deployments/<environment>.json.
|
|
128
131
|
`;
|
|
132
|
+
export const APP_VALIDATE_USAGE = `usage:
|
|
133
|
+
seq-studio validate [--dir <path>] [--json]
|
|
134
|
+
|
|
135
|
+
Validate sequence.app.yml, its dependency graph, and primitive directories
|
|
136
|
+
locally. List resolved Application members, including existing process refs.
|
|
137
|
+
No environment, login, repository adoption, or network access is required.
|
|
138
|
+
This checks local structure only; it does not validate remote member existence,
|
|
139
|
+
primitive-specific source, or authorize deployment. Deploy still requires a
|
|
140
|
+
matching repository identity receipt.
|
|
141
|
+
|
|
142
|
+
Options:
|
|
143
|
+
--dir <path> app root (default: cwd)
|
|
144
|
+
--json print structured validation result
|
|
145
|
+
`;
|
|
146
|
+
export async function runAppValidateCommand(args) {
|
|
147
|
+
if (args.flags.help === true || args.flags.h === true) {
|
|
148
|
+
console.log(APP_VALIDATE_USAGE);
|
|
149
|
+
return 0;
|
|
150
|
+
}
|
|
151
|
+
try {
|
|
152
|
+
if (args.positional.length > 0)
|
|
153
|
+
throw new Error('unexpected arguments; use --dir for the app root');
|
|
154
|
+
for (const [flag, value] of Object.entries(args.flags)) {
|
|
155
|
+
if (flag === 'dir' && typeof value === 'string' && value.trim())
|
|
156
|
+
continue;
|
|
157
|
+
if (flag === 'json' && value === true)
|
|
158
|
+
continue;
|
|
159
|
+
throw new Error(flag === 'dir' ? '--dir requires a value' : `unknown option --${flag}`);
|
|
160
|
+
}
|
|
161
|
+
const result = await validateAppLocal({ rootDir: resolve(flagString(args.flags, 'dir') ?? process.cwd()) });
|
|
162
|
+
if (args.flags.json === true) {
|
|
163
|
+
console.log(JSON.stringify(result, null, 2));
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
console.log(`${LOG} app "${result.app}" manifest valid (${result.primitives.length} primitive(s), ${result.members.length} member(s))`);
|
|
167
|
+
for (const entry of result.primitives)
|
|
168
|
+
console.log(`${LOG} - ${entry.kind} ${entry.id} (${entry.path})`);
|
|
169
|
+
for (const member of result.members)
|
|
170
|
+
console.log(`${LOG} - member ${member.kind} ${member.id} -> ${member.ref}`);
|
|
171
|
+
console.log(`${LOG} local validation only; deployment still requires repository admission`);
|
|
172
|
+
}
|
|
173
|
+
return 0;
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
printError(error);
|
|
177
|
+
return 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
129
180
|
function pipelineTypeFlag(flags) {
|
|
130
181
|
const value = flags['pipeline-type'];
|
|
131
182
|
if (value === undefined)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function validateAppLocal({ rootDir }: {
|
|
2
|
+
rootDir: string;
|
|
3
|
+
}): Promise<{
|
|
4
|
+
app: string;
|
|
5
|
+
schemaVersion: 1 | 2 | 3;
|
|
6
|
+
primitives: {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: "function" | "process" | "artifact" | "pipeline" | "orm" | "agent" | "workspace";
|
|
9
|
+
path: string;
|
|
10
|
+
}[];
|
|
11
|
+
members: {
|
|
12
|
+
id: string;
|
|
13
|
+
kind: string;
|
|
14
|
+
ref: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Local app manifest, graph, path, and member checks without deployment admission. */
|
|
2
|
+
import { stat } from 'node:fs/promises';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
import { buildApplicationDeployBody } from './application-registration.js';
|
|
5
|
+
import { resolveDeployEntries } from './deploy.js';
|
|
6
|
+
import { loadAppManifest } from './manifest.js';
|
|
7
|
+
import { resolveContainedPrimitivePath } from './paths.js';
|
|
8
|
+
export async function validateAppLocal({ rootDir }) {
|
|
9
|
+
const root = resolve(rootDir);
|
|
10
|
+
const manifest = await loadAppManifest(root);
|
|
11
|
+
const entries = resolveDeployEntries({ manifest });
|
|
12
|
+
for (const entry of entries) {
|
|
13
|
+
const path = await resolveContainedPrimitivePath({ rootDir: root, entryPath: entry.path });
|
|
14
|
+
let info;
|
|
15
|
+
try {
|
|
16
|
+
info = await stat(path);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error.code === 'ENOENT') {
|
|
20
|
+
throw new Error(`sequence.app.yml: primitive "${entry.id}" directory does not exist: ${entry.path}`);
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
if (!info.isDirectory()) {
|
|
25
|
+
throw new Error(`sequence.app.yml: primitive "${entry.id}" path is not a directory: ${entry.path}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
app: manifest.app.id,
|
|
30
|
+
schemaVersion: manifest.schema_version,
|
|
31
|
+
primitives: entries.map(({ id, kind, path }) => ({ id, kind, path })),
|
|
32
|
+
// Use the same local member projection as Application registration. The
|
|
33
|
+
// server's "lattice" member kind is called "process" in the CLI.
|
|
34
|
+
members: buildApplicationDeployBody(manifest).members.map(({ key, kind, ref }) => ({
|
|
35
|
+
id: key,
|
|
36
|
+
kind: kind === 'lattice' ? 'process' : kind,
|
|
37
|
+
ref,
|
|
38
|
+
})),
|
|
39
|
+
};
|
|
40
|
+
}
|
package/dist/atlas-client.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export declare class AtlasApiError extends Error {
|
|
|
22
22
|
readonly name = "AtlasApiError";
|
|
23
23
|
retryAfterSeconds: number | null;
|
|
24
24
|
constructor(status: number, message: string, path: string, statusText?: string, body?: unknown);
|
|
25
|
+
/** The structured `error.code` (or top-level `code`) Atlas sent, if any. */
|
|
26
|
+
get code(): string | null;
|
|
25
27
|
}
|
|
26
28
|
/** Bounded single attempt for commands whose uncertain result must be reconciled by the caller. */
|
|
27
29
|
export declare function requestJsonOnce({ baseUrl, token, path, method, body, }: ClientOptions & {
|
package/dist/atlas-client.js
CHANGED
|
@@ -8,6 +8,7 @@ import { authenticatedRequestUrl } from '@sequenceholdings/artifact-studio/deplo
|
|
|
8
8
|
import { validationDetail } from './validation-detail.js';
|
|
9
9
|
import { PREVIEW_DOMAIN } from './preview.js';
|
|
10
10
|
import { sandboxBearerFor } from './sandbox-auth.js';
|
|
11
|
+
import { errorCode, isTransient503 } from './transient-503.js';
|
|
11
12
|
const MAX_503_RETRIES = 5;
|
|
12
13
|
const DEFAULT_RETRY_AFTER_SECONDS = 2;
|
|
13
14
|
const LOG_PREFIX = '[seq-studio]';
|
|
@@ -26,6 +27,10 @@ export class AtlasApiError extends Error {
|
|
|
26
27
|
this.statusText = statusText;
|
|
27
28
|
this.body = body;
|
|
28
29
|
}
|
|
30
|
+
/** The structured `error.code` (or top-level `code`) Atlas sent, if any. */
|
|
31
|
+
get code() {
|
|
32
|
+
return errorCode(this.body);
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
35
|
async function fetchWith503Retry(input, init) {
|
|
31
36
|
let attempt = 0;
|
|
@@ -33,6 +38,9 @@ async function fetchWith503Retry(input, init) {
|
|
|
33
38
|
const response = await fetch(input, init);
|
|
34
39
|
if (response.status !== 503 || attempt >= MAX_503_RETRIES)
|
|
35
40
|
return response;
|
|
41
|
+
const body = parseErrorBody(await response.clone().text(), response.headers.get('content-type') ?? '');
|
|
42
|
+
if (!isTransient503(body))
|
|
43
|
+
return response;
|
|
36
44
|
const retryAfter = Number(response.headers.get('Retry-After')) || DEFAULT_RETRY_AFTER_SECONDS;
|
|
37
45
|
attempt += 1;
|
|
38
46
|
console.warn(`${LOG_PREFIX} backend warming up (503); retrying in ${retryAfter}s (attempt ${attempt}/${MAX_503_RETRIES})`);
|
package/dist/bin.js
CHANGED
|
@@ -15,6 +15,7 @@ const doctorOffline = argv[0] === 'doctor' && (() => {
|
|
|
15
15
|
const value = parseArgs(argv.slice(1)).flags.offline;
|
|
16
16
|
return value === true || value === 'true';
|
|
17
17
|
})();
|
|
18
|
+
const isOfflineCommand = argv[0] === 'validate' || doctorOffline;
|
|
18
19
|
run(argv)
|
|
19
20
|
.catch((error) => {
|
|
20
21
|
console.error(error instanceof Error ? error.message : error);
|
|
@@ -23,7 +24,7 @@ run(argv)
|
|
|
23
24
|
// The update notice runs after the command so it never delays real output,
|
|
24
25
|
// and it is best-effort (never throws, never changes the exit code).
|
|
25
26
|
.then(async (code) => {
|
|
26
|
-
if (!isHelpOrDiscovery && !
|
|
27
|
+
if (!isHelpOrDiscovery && !isOfflineCommand && !(argv[0] === 'auth' && argv[1] === 'git-credential')) {
|
|
27
28
|
const { maybeNotifyUpdate } = await import('./update-check.js');
|
|
28
29
|
await maybeNotifyUpdate();
|
|
29
30
|
}
|
package/dist/cli-errors.js
CHANGED
|
@@ -34,6 +34,12 @@ export function clarifyApplyFailureReason(reason) {
|
|
|
34
34
|
}
|
|
35
35
|
return reason;
|
|
36
36
|
}
|
|
37
|
+
function nextStepFor503(error) {
|
|
38
|
+
if (error.code === 'storage_configuration') {
|
|
39
|
+
return 'Next step: this Atlas has no storage bucket configured. For a local Atlas, restart it with `make dev-all` from `atlas/` (it provisions dev storage); for a deployed environment, ask its operator to configure storage.';
|
|
40
|
+
}
|
|
41
|
+
return 'Next step: wait a few seconds and retry (backend may still be warming up).';
|
|
42
|
+
}
|
|
37
43
|
function nextStepForAtlasError(error) {
|
|
38
44
|
const msg = error.message.toLowerCase();
|
|
39
45
|
if (error.status === 401) {
|
|
@@ -53,9 +59,8 @@ function nextStepForAtlasError(error) {
|
|
|
53
59
|
return 'Next step: reduce the request size and retry; pipeline query accepts up to 10,000 SQL characters.';
|
|
54
60
|
return 'Next step: run `seq-studio functions build` and reduce bundle size or dependencies.';
|
|
55
61
|
}
|
|
56
|
-
if (error.status === 503)
|
|
57
|
-
return
|
|
58
|
-
}
|
|
62
|
+
if (error.status === 503)
|
|
63
|
+
return nextStepFor503(error);
|
|
59
64
|
if (error.status === 524 || msg.includes('timeout') || msg.includes('timed out')) {
|
|
60
65
|
if (error.path.startsWith('/api/data-pipelines/'))
|
|
61
66
|
return 'Next step: retry the read; if it persists, confirm the environment and backend availability.';
|
|
@@ -11,6 +11,12 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
11
11
|
readonly lifecycle: "preview";
|
|
12
12
|
readonly access: "offline";
|
|
13
13
|
readonly subcommands: readonly [];
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "validate";
|
|
16
|
+
readonly description: "Validate an app manifest, graph, paths, and members offline";
|
|
17
|
+
readonly lifecycle: "preview";
|
|
18
|
+
readonly access: "offline";
|
|
19
|
+
readonly subcommands: readonly [];
|
|
14
20
|
}, {
|
|
15
21
|
readonly name: "deploy";
|
|
16
22
|
readonly description: "Deploy an app workspace";
|
package/dist/command-contract.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export const COMMAND_CONTRACT = [
|
|
3
3
|
{ name: 'init', description: 'Scaffold an app workspace or use a published template', lifecycle: 'preview', access: 'mixed', subcommands: [] },
|
|
4
4
|
{ name: 'add', description: 'Add a primitive to an app workspace', lifecycle: 'preview', access: 'offline', subcommands: [] },
|
|
5
|
+
{ name: 'validate', description: 'Validate an app manifest, graph, paths, and members offline', lifecycle: 'preview', access: 'offline', subcommands: [] },
|
|
5
6
|
{ name: 'deploy', description: 'Deploy an app workspace', lifecycle: 'preview', access: 'authenticated', subcommands: [] },
|
|
6
7
|
{ name: 'process', description: 'Build and operate Lattice processes', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'lint', 'plan', 'apply', 'test', 'simulate', 'bundle', 'promote', 'pull', 'runs', 'safety-baseline'] },
|
|
7
8
|
{ name: 'artifact', description: 'Build and operate Artifact Studio apps', lifecycle: 'stable', access: 'mixed', subcommands: ['init', 'whoami', 'link', 'env', 'status', 'list', 'show', 'validate', 'build', 'plan', 'deploy', 'dev', 'promote', 'pull', 'rollback'] },
|
package/dist/command-help.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
|
|
2
|
-
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table>] -e <env> [--json]\n seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n namespaces lists what you can read; describe shows its tables and operations.\n Run seq-studio orm describe --help for the output.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n";
|
|
2
|
+
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n seq-studio orm operation show <namespace> <name> -e <env> [--json]\n seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n namespaces lists what you can read; describe shows its tables and operations.\n Run seq-studio orm describe --help for the output.\n execute <namespace> <operation> runs the deployed version's persisted operation by\n name, with no checkout. Run seq-studio orm execute --help for both forms.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n";
|
|
3
3
|
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
4
4
|
export declare const ARTIFACT_SANDBOX_HELP = " In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
5
5
|
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
6
6
|
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>\n [--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]\n For an existing target release unit, source-env selects a separately\n authenticated canonical repository from banksouth, staging, or production.\n Source identity must be adopted and belong to the destination tenant.\n Registered OpCo source origins are not supported yet. The target verifies\n and snapshots source before planning; no target repository is created.\n Not compatible with --dir, existing IDs, or coordinated migrations.\n Rollback uses retained snapshots; historical source commits can be re-planned\n explicitly with deploy --ref <sha> --source-env <env>.\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
7
|
-
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy\n seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP using your seq-studio login\n and repository read access. No PAT is needed. Headless M2M builds use JSON\n materialize and accept only platform-managed --repo sources. Use --env to\n select the same environment for source and deployment.\n";
|
|
7
|
+
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy\n seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n [--json] [--version id|name] reader-gated release provenance\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP using your seq-studio login\n and repository read access. No PAT is needed. Headless M2M builds use JSON\n materialize and accept only platform-managed --repo sources. Use --env to\n select the same environment for source and deployment.\n";
|
|
8
8
|
export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos identity <ns>/<name> -e <env> [--write --dir .] show/install the server-issued identity receipt\n --adopt --write --yes admin-only legacy binding; commit the receipt via PR\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
|
|
9
9
|
export declare const PROCESS_RUNS_USAGE = "usage:\n seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]\n [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]\n seq-studio process runs list -e <env> [--process <id>] [--status <status>]\n [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]\n seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start needs invoker on the process, show and\n list return only runs you can view, and cancel needs invoker on the process.\n --version pins a published process version; omitted, the active version runs.\n --run-id makes start idempotent: repeating it for the same process returns the\n existing run instead of starting another. --metadata-file is a JSON object\n stored on the run.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out.\n";
|
|
10
|
-
export declare const ORM_DISCOVER_HELP = "usage:\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table>] -e <env> [--json]\n\n Find the ORM data you can read, then query it with orm read or orm sql.\n namespaces lists only namespaces you can read, ordered by name: format (v2 or\n v1), table and persisted-operation counts. It pages with --limit (default 50)\n and --offset; the total and the next page go to stderr.\n describe <namespace> lists its tables and views and the persisted operations\n it serves, with what each requires. describe <namespace> <table> lists the\n table's columns (types, nullability, keys), enum values, links, actions, and\n the persisted operations that write it. Column names are the ones orm read and\n orm sql accept.\n A namespace you cannot read reports not found, the same as a missing one.\n --json prints the full description (describe omits the generated GraphQL SDL).\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
|
10
|
+
export declare const ORM_DISCOVER_HELP = "usage:\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n seq-studio orm operation show <namespace> <name> -e <env> [--json]\n\n Find the ORM data you can read, then query it with orm read or orm sql.\n namespaces lists only namespaces you can read, ordered by name: format (v2 or\n v1), table and persisted-operation counts. It pages with --limit (default 50)\n and --offset; the total and the next page go to stderr.\n describe <namespace> lists its tables and views and the persisted operations\n it serves, with what each requires and the variables it declares (name: type,\n ! when required). --operations prints only the operations, ready for\n orm execute <namespace> <operation>. describe <namespace> <table> lists the\n table's columns (types, nullability, keys), enum values, links, actions, and\n the persisted operations that write it. Column names are the ones orm read and\n orm sql accept.\n A namespace you cannot read reports not found, the same as a missing one.\n --json prints the full description (describe omits the generated GraphQL SDL).\n operation show prints one active persisted operation's registered GraphQL\n document; --json includes its hash, declared variables, and requirements.\n Missing and unreadable operations both report not found.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
|
11
|
+
export declare const ORM_EXECUTE_HELP = "usage:\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n\n Run one persisted operation as you. The server applies the operation's\n required capability or role and the namespace's row policies.\n By name: execute <namespace> <operation> looks the operation up in the\n namespace's deployed version and runs it. No checkout is needed, so it runs\n what is deployed even when a local clone is behind. List what you can run:\n seq-studio orm describe <namespace> --operations\n From a checkout: execute <operation> [dir] runs the operation as hashed in the\n namespace directory's operations.manifest.json (default dir: .). If the\n deployed version hashes it differently, execute prints both hashes and the\n by-name command instead of a bare 404.\n The form is chosen by the second argument: an existing directory means a\n checkout; otherwise it is <namespace> <operation>.\n --variables-file takes a JSON object. --var <name>=<value> (repeatable, by\n name only) sets one variable and wins over the file: numbers and booleans\n parse by the declared type, lists, filter inputs and jsonb take JSON, and other\n types take the text as is. Use the file for null.\n Output is the JSON response: {\"data\": ...}.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
|
11
12
|
export declare function staticHelp({ namespace, sub }: {
|
|
12
13
|
namespace: string;
|
|
13
14
|
sub?: string;
|
package/dist/command-help.js
CHANGED
|
@@ -5,9 +5,11 @@ export const ORM_HELP = `usage:
|
|
|
5
5
|
seq-studio orm validate [dir]
|
|
6
6
|
seq-studio orm plan [dir] -e <env>
|
|
7
7
|
seq-studio orm apply [dir] -e <env>
|
|
8
|
+
seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
|
|
8
9
|
seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
|
|
9
10
|
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
10
|
-
seq-studio orm describe <namespace> [<table>] -e <env> [--json]
|
|
11
|
+
seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]
|
|
12
|
+
seq-studio orm operation show <namespace> <name> -e <env> [--json]
|
|
11
13
|
seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]
|
|
12
14
|
seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]
|
|
13
15
|
seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]
|
|
@@ -18,6 +20,8 @@ export const ORM_HELP = `usage:
|
|
|
18
20
|
to discover environments and seq-studio login to authenticate.
|
|
19
21
|
namespaces lists what you can read; describe shows its tables and operations.
|
|
20
22
|
Run seq-studio orm describe --help for the output.
|
|
23
|
+
execute <namespace> <operation> runs the deployed version's persisted operation by
|
|
24
|
+
name, with no checkout. Run seq-studio orm execute --help for both forms.
|
|
21
25
|
read and sql query a v2 namespace as you through its built-in read-only SQL.
|
|
22
26
|
sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).
|
|
23
27
|
Run seq-studio orm read --help for the filter grammar, parameters, and output formats.
|
|
@@ -90,6 +94,7 @@ export const FUNCTIONS_USAGE = `usage:
|
|
|
90
94
|
seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress
|
|
91
95
|
seq-studio functions list -e <env> [--match-local] functions visible on the environment
|
|
92
96
|
seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)
|
|
97
|
+
[--json] [--version id|name] reader-gated release provenance
|
|
93
98
|
seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy
|
|
94
99
|
[--fn slug] also show effective runtime limits (requires -e)
|
|
95
100
|
seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context
|
|
@@ -193,25 +198,56 @@ export const PROCESS_RUNS_USAGE = `usage:
|
|
|
193
198
|
`;
|
|
194
199
|
export const ORM_DISCOVER_HELP = `usage:
|
|
195
200
|
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
196
|
-
seq-studio orm describe <namespace> [<table>] -e <env> [--json]
|
|
201
|
+
seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]
|
|
202
|
+
seq-studio orm operation show <namespace> <name> -e <env> [--json]
|
|
197
203
|
|
|
198
204
|
Find the ORM data you can read, then query it with orm read or orm sql.
|
|
199
205
|
namespaces lists only namespaces you can read, ordered by name: format (v2 or
|
|
200
206
|
v1), table and persisted-operation counts. It pages with --limit (default 50)
|
|
201
207
|
and --offset; the total and the next page go to stderr.
|
|
202
208
|
describe <namespace> lists its tables and views and the persisted operations
|
|
203
|
-
it serves, with what each requires
|
|
209
|
+
it serves, with what each requires and the variables it declares (name: type,
|
|
210
|
+
! when required). --operations prints only the operations, ready for
|
|
211
|
+
orm execute <namespace> <operation>. describe <namespace> <table> lists the
|
|
204
212
|
table's columns (types, nullability, keys), enum values, links, actions, and
|
|
205
213
|
the persisted operations that write it. Column names are the ones orm read and
|
|
206
214
|
orm sql accept.
|
|
207
215
|
A namespace you cannot read reports not found, the same as a missing one.
|
|
208
216
|
--json prints the full description (describe omits the generated GraphQL SDL).
|
|
217
|
+
operation show prints one active persisted operation's registered GraphQL
|
|
218
|
+
document; --json includes its hash, declared variables, and requirements.
|
|
219
|
+
Missing and unreadable operations both report not found.
|
|
220
|
+
In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.
|
|
221
|
+
`;
|
|
222
|
+
export const ORM_EXECUTE_HELP = `usage:
|
|
223
|
+
seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
|
|
224
|
+
seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
|
|
225
|
+
|
|
226
|
+
Run one persisted operation as you. The server applies the operation's
|
|
227
|
+
required capability or role and the namespace's row policies.
|
|
228
|
+
By name: execute <namespace> <operation> looks the operation up in the
|
|
229
|
+
namespace's deployed version and runs it. No checkout is needed, so it runs
|
|
230
|
+
what is deployed even when a local clone is behind. List what you can run:
|
|
231
|
+
seq-studio orm describe <namespace> --operations
|
|
232
|
+
From a checkout: execute <operation> [dir] runs the operation as hashed in the
|
|
233
|
+
namespace directory's operations.manifest.json (default dir: .). If the
|
|
234
|
+
deployed version hashes it differently, execute prints both hashes and the
|
|
235
|
+
by-name command instead of a bare 404.
|
|
236
|
+
The form is chosen by the second argument: an existing directory means a
|
|
237
|
+
checkout; otherwise it is <namespace> <operation>.
|
|
238
|
+
--variables-file takes a JSON object. --var <name>=<value> (repeatable, by
|
|
239
|
+
name only) sets one variable and wins over the file: numbers and booleans
|
|
240
|
+
parse by the declared type, lists, filter inputs and jsonb take JSON, and other
|
|
241
|
+
types take the text as is. Use the file for null.
|
|
242
|
+
Output is the JSON response: {"data": ...}.
|
|
209
243
|
In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.
|
|
210
244
|
`;
|
|
211
245
|
/** read and sql print their own grammar help from the delegate. */
|
|
212
246
|
function ormHelp(sub) {
|
|
213
247
|
if (sub === 'namespaces' || sub === 'describe')
|
|
214
248
|
return ORM_DISCOVER_HELP;
|
|
249
|
+
if (sub === 'execute')
|
|
250
|
+
return ORM_EXECUTE_HELP;
|
|
215
251
|
return sub === 'read' || sub === 'sql' ? undefined : ORM_HELP;
|
|
216
252
|
}
|
|
217
253
|
export function staticHelp({ namespace, sub }) {
|
|
@@ -27,9 +27,13 @@ export interface VersionSummary {
|
|
|
27
27
|
id: string;
|
|
28
28
|
functionId: string;
|
|
29
29
|
version: string;
|
|
30
|
+
sourceHash?: string | null;
|
|
30
31
|
status: string;
|
|
31
32
|
statusDetail: string | null;
|
|
32
33
|
deployMessage: string | null;
|
|
34
|
+
gitCommit?: string | null;
|
|
35
|
+
gitBranch?: string | null;
|
|
36
|
+
gitDirty?: boolean | null;
|
|
33
37
|
createdAt: string;
|
|
34
38
|
deployedAt: string | null;
|
|
35
39
|
isActive: boolean;
|