@sequenceholdings/studio-cli 0.9.12 → 0.9.14
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 +21 -7
- package/dist/cli-errors.js +4 -0
- package/dist/command-help.d.ts +4 -4
- package/dist/command-help.js +18 -6
- package/dist/command-telemetry.d.ts +4 -0
- package/dist/command-telemetry.js +22 -3
- package/dist/functions/commands.js +5 -0
- package/dist/main.js +2 -1
- package/dist/orm/apply-source.d.ts +33 -10
- package/dist/orm/apply-source.js +60 -19
- package/dist/orm/delegate.js +25 -16
- package/dist/orm/deployment-policy.js +34 -18
- package/dist/orm/help.d.ts +1 -1
- package/dist/orm/help.js +2 -2
- package/dist/process/commands.js +11 -2
- package/dist/repos/pulls.d.ts +7 -2
- package/dist/repos/pulls.js +23 -3
- package/dist/templates/process/package.json +2 -0
- package/package.json +9 -9
- package/templates/process/package.json +2 -0
package/README.md
CHANGED
|
@@ -915,12 +915,13 @@ compiled to canonical SQL before registration.
|
|
|
915
915
|
| `seq-studio orm generate [dir]` | Generate `schema.graphql`, `operations.manifest.json`, `typePolicies.gen.ts`, `namespace.contract.json`, `sql-operations.gen.ts`, and consumer codegen when `codegen.ts` is present. |
|
|
916
916
|
| `seq-studio orm generate [dir] --migration-export [--check]` | Export `orm.migration.json` after validating the committed ORM migration. Pipeline migration planning recompiles these declarative inputs. `--check` compares against the current source and operations without writing; use it in CI. |
|
|
917
917
|
| `seq-studio orm validate [dir]` | Parse and compile the namespace, then verify its committed migration chain is current. |
|
|
918
|
-
| `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes. |
|
|
918
|
+
| `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes; when available, print the live activation's source and provenance. |
|
|
919
919
|
| `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
|
|
920
|
-
| `seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]` | Author a migration if needed, register/apply the namespace, activate its operation set, publish its declared capabilities, and refresh generated outputs. Waits until the new version is live (prints `live:`; default up to 20m); `--no-wait` returns once queued. |
|
|
921
|
-
| `seq-studio orm history <namespace> -e <env> [--limit N] [--json]` | List every change to the namespace's live schema and operations, newest first, with the actor and the Git Service source. `apply` from a clone of the target environment's Git Service (or `--repo`) sends its commit and package path; Atlas checks it and records `verified`, `ci` or `reported`.
|
|
922
|
-
| `seq-studio orm deployment-policy <namespace> -e <env> [--json]` | Inspect whether a namespace permits manual deployment
|
|
920
|
+
| `seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait] [--unverified-source "<reason>"]` | Author a migration if needed, register/apply the namespace, activate its operation set, publish its declared capabilities, and refresh generated outputs. Waits until the new version is live (prints `live:`; default up to 20m); `--no-wait` returns once queued. |
|
|
921
|
+
| `seq-studio orm history <namespace> -e <env> [--limit N] [--json]` | List every change to the namespace's live schema and operations, newest first, with the actor and the Git Service source. `apply` from a clone of the target environment's Git Service (or `--repo`) sends its commit and package path; Atlas checks it and records `verified`, `ci`, `break_glass` or `reported`. Environments with `ORM_REQUIRE_VERIFIED_SOURCE=1`, and namespaces pinned with `--mode source`, refuse unverified applies; a namespace admin can override with `orm apply --unverified-source "<reason>"`. |
|
|
922
|
+
| `seq-studio orm deployment-policy <namespace> -e <env> [--json]` | Inspect whether a namespace permits manual deployment, requires its enrolled repository's verified CI deployment, or is pinned to a verified source repository, branch and package path. |
|
|
923
923
|
| `seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>` | Explicitly enroll an existing namespace. Requires namespace Admin, repository Admin, and an automatic branch policy already bound to this exact namespace. |
|
|
924
|
+
| `seq-studio orm deployment-policy <namespace> -e <env> --mode source --repo <ns>/<name> --branch <branch> --path <dir>` | Keep direct applies but accept only ones Atlas verifies came from that repository, branch and package directory. Requires namespace Admin and repository Read. |
|
|
924
925
|
| `seq-studio orm deployment-policy <namespace> -e <env> --mode manual` | Restore direct, permission-checked deployment; requires namespace Admin. |
|
|
925
926
|
| `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. |
|
|
926
927
|
| `seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>` | Execute an operation from the checkout's manifest through the installed ORM package, with variables from a JSON object file, as the signed-in caller. |
|
|
@@ -1165,7 +1166,7 @@ datasets before adopting this path for latency-sensitive reads.
|
|
|
1165
1166
|
| `seq-studio process apply --repo <namespace>/<name> [--ref <r>] -e <env> [--only <id1,id2>]` | Same as above, but materializes the source from a platform git-service repo in `processes`, `apps`, or your own namespace. Pinned commit SHA is injected as bundle provenance. Uses your `seq-studio login` (or the target realm's M2M JSON source path for CI) |
|
|
1166
1167
|
| `seq-studio process test [--dir <path>] -e <env> [--offline]` | CI wrapper: lint + plan, non-zero exit on errors or BREAKING diffs; see the offline limitation below |
|
|
1167
1168
|
| `seq-studio process simulate <id> [--dir <path>]` | Isolated child-process walk with stubbed runners and hardened JSONata data-flow mapper evaluation (offline) |
|
|
1168
|
-
| `seq-studio process bundle build [--dir <path>] [-o file.json]` | Build a bundle locally |
|
|
1169
|
+
| `seq-studio process bundle build [--dir <path>] [-o file.json] [-e <env>] [--offline]` | Build a bundle locally; subprocess children from other roots need `-e` to pin, or `--offline` to leave them unpinned for validation |
|
|
1169
1170
|
| `seq-studio process bundle pull <hash> [-e <env>] [-o file.json]` | Fetch a stored bundle |
|
|
1170
1171
|
| `seq-studio process bundle inspect <bundle.json>` | Show a saved bundle's summary |
|
|
1171
1172
|
| `seq-studio process bundle list [-e <env>] [--limit N] [--cursor <hash>]` | List registered bundles (paginated; CLI auto-fetches all pages) |
|
|
@@ -2385,7 +2386,16 @@ seq-studio repos ci show artifacts/my-app -e staging --pr 4
|
|
|
2385
2386
|
```
|
|
2386
2387
|
|
|
2387
2388
|
The generated file selects the platform's native lint, type-check, test and build
|
|
2388
|
-
|
|
2389
|
+
checks for the repository inventory. For lint, type-check and test, repository CI
|
|
2390
|
+
runs the primitive's own `package.json` script of that name (`typecheck` also
|
|
2391
|
+
counts) and falls back to a platform default only when the script is missing;
|
|
2392
|
+
Next.js artifacts have no fallback and must define all three. The build is always
|
|
2393
|
+
the platform build for the primitive's kind, except that a managed function's
|
|
2394
|
+
`build` script runs when present. New ORM namespace, managed-function, Lattice
|
|
2395
|
+
process and React/Vite Artifact Studio scaffolds define `lint`, `type-check` and
|
|
2396
|
+
`test`, so
|
|
2397
|
+
after `pnpm install` you can run `pnpm run lint`, `pnpm run type-check` and
|
|
2398
|
+
`pnpm run test` in the primitive's directory to reproduce those CI phases:
|
|
2389
2399
|
|
|
2390
2400
|
```yaml
|
|
2391
2401
|
schema_version: 2
|
|
@@ -3375,6 +3385,7 @@ seq-studio repos pulls resolve <namespace/name> <number> <root-comment-id> -e <e
|
|
|
3375
3385
|
seq-studio repos pulls unresolve <namespace/name> <number> <root-comment-id> -e <env>
|
|
3376
3386
|
seq-studio repos pulls review <namespace/name> <number> --request-changes --body-file review.md -e <env>
|
|
3377
3387
|
seq-studio repos pulls checks <namespace/name> <number> -e <env>
|
|
3388
|
+
seq-studio repos pulls edit <namespace/name> <number> --title "Build task app v2" --body-file review.md -e <env>
|
|
3378
3389
|
seq-studio repos pulls close <namespace/name> <number> -e <env>
|
|
3379
3390
|
```
|
|
3380
3391
|
|
|
@@ -3395,7 +3406,10 @@ login and require repository read access; the server rejects reply IDs.
|
|
|
3395
3406
|
optional `--body`/`--body-file`, and records the review against the commit the Pull's
|
|
3396
3407
|
branch points at now unless `--commit` names another. `checks` returns one object with the Pull's check
|
|
3397
3408
|
runs, CI plan and runs, and merge gates (mergeability, review, code-owner, and check
|
|
3398
|
-
gates). `
|
|
3409
|
+
gates). `edit` changes an open Pull's title (`--title`) and/or description (`--body` or
|
|
3410
|
+
`--body-file`), needs authorship or repository write, refuses
|
|
3411
|
+
merged and closed Pulls, and prints the updated Pull like `show` (with `url`).
|
|
3412
|
+
`close` needs authorship or repository write and is idempotent.
|
|
3399
3413
|
`repos pull` remains the singular source-snapshot command.
|
|
3400
3414
|
|
|
3401
3415
|
## Agent feedback
|
package/dist/cli-errors.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PlatformError } from '@sequenceholdings/platform';
|
|
2
|
+
import { recordTerminalCommandError } from './command-telemetry.js';
|
|
2
3
|
import { AtlasApiError } from './atlas-client.js';
|
|
3
4
|
export const LOG = '[seq-studio]';
|
|
4
5
|
/** Map common apply failure reasons to clearer copy (original reason is preserved). */
|
|
@@ -84,7 +85,10 @@ export function formatCliError(error) {
|
|
|
84
85
|
}
|
|
85
86
|
return [`${LOG} ${error instanceof Error ? error.message : String(error)}`];
|
|
86
87
|
}
|
|
88
|
+
// Terminal command catches use this before returning a failure exit code.
|
|
89
|
+
// Formatting alone remains side-effect free.
|
|
87
90
|
export function printCliError(error) {
|
|
91
|
+
recordTerminalCommandError(error);
|
|
88
92
|
for (const line of formatCliError(error)) {
|
|
89
93
|
console.error(line);
|
|
90
94
|
}
|
package/dist/command-help.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { PIPELINE_HELP } from './pipeline/help.js';
|
|
2
2
|
/** `--repo` on every init command; shared so the commands describe it identically. */
|
|
3
3
|
export declare const INIT_INTO_REPO_HELP = " Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
4
|
-
export declare const ORM_HISTORY_HELP = "usage:\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n\n Lists every change to the namespace's live schema and operations, newest\n first: when, who, what moved, and the Git Service source. \"verified\" and \"ci\"\n sources were checked by Atlas against the repository; \"reported\" means Atlas\n could not tie the change to a pushed commit on a release branch, with the\n reason when one was claimed. * marks the live activation
|
|
5
|
-
export declare const ORM_DEPLOYMENT_POLICY_HELP = "usage:\n seq-studio orm deployment-policy <namespace> -e <env> [--json]\n seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>\n seq-studio orm deployment-policy <namespace> -e <env> --mode manual\n\n Existing namespaces default to manual deployment. CI mode rejects direct ORM\n registration, schema apply, and operations-only activation on the server;\n only the enrolled repository's verified merge deployment may activate changes.\n Enabling CI mode requires namespace Admin, repository Admin, and an existing\n automatic branch binding to this namespace. Restoring manual mode requires\n namespace Admin. This changes deployment policy; it does not deploy source.\n";
|
|
6
|
-
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\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> [--timeout <duration>] [--no-wait]\n seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci] [--repo <ns>/<name> --branch <branch> --target <target-key>] [--json]\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 Schema commands require the ORM loaded by seq-studio to satisfy the v2\n namespace's package.json @sequenceholdings/orm range before compiling.\n apply waits until the new version is live and serving (default up to 20m), then\n prints \"live:\"; --no-wait returns once the apply is queued.\n CI-managed namespaces reject direct apply; use the enrolled repository's merge\n workflow. deployment-policy reads or
|
|
4
|
+
export declare const ORM_HISTORY_HELP = "usage:\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n\n Lists every change to the namespace's live schema and operations, newest\n first: when, who, what moved, and the Git Service source. \"verified\" and \"ci\"\n sources were checked by Atlas against the repository; \"reported\" means Atlas\n could not tie the change to a pushed commit on a release branch, with the\n reason when one was claimed. \"break_glass\" is an admin override made with\n orm apply --unverified-source \"<reason>\". * marks the live activation.\n History starts with the first apply after the environment recorded it.\n";
|
|
5
|
+
export declare const ORM_DEPLOYMENT_POLICY_HELP = "usage:\n seq-studio orm deployment-policy <namespace> -e <env> [--json]\n seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>\n seq-studio orm deployment-policy <namespace> -e <env> --mode manual\n seq-studio orm deployment-policy <namespace> -e <env> --mode source --repo <ns>/<name> --branch <branch> --path <dir>\n\n Existing namespaces default to manual deployment. CI mode rejects direct ORM\n registration, schema apply, and operations-only activation on the server;\n only the enrolled repository's verified merge deployment may activate changes.\n Enabling CI mode requires namespace Admin, repository Admin, and an existing\n automatic branch binding to this namespace. Restoring manual mode requires\n namespace Admin. This changes deployment policy; it does not deploy source.\n\n Source mode keeps direct applies but accepts only ones Atlas verifies came\n from that repository, branch and package directory (pass --path . for the\n repository root). It requires namespace Admin and repository Read. Namespace\n admins can still apply with --unverified-source \"<reason>\", which is recorded.\n";
|
|
6
|
+
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\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> [--timeout <duration>] [--no-wait] [--unverified-source \"<reason>\"]\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci|source] [--repo <ns>/<name> --branch <branch> (--target <target-key> | --path <dir>)] [--json]\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 Schema commands require the ORM loaded by seq-studio to satisfy the v2\n namespace's package.json @sequenceholdings/orm range before compiling.\n apply waits until the new version is live and serving (default up to 20m), then\n prints \"live:\"; --no-wait returns once the apply is queued.\n CI-managed namespaces reject direct apply; use the enrolled repository's merge\n workflow. Source-pinned namespaces accept only applies Atlas verifies against\n their repository, branch and package path, and an environment can require a\n verified source for every apply. A namespace admin may record an audited\n exception with --unverified-source \"<reason>\". deployment-policy reads or\n explicitly changes this namespace setting.\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\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
7
7
|
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
8
8
|
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";
|
|
9
9
|
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs] [--repo <namespace>/<name>]\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>] [--secret-source local|hosted|none] [--local-secrets <bindings.json>] [--bundler turbopack|webpack]\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 Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\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";
|
|
10
10
|
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> [--repo <ns>/<name>] scaffold manifest, TypeScript handler, and docs pointers;\n --repo scaffolds into a git-service repo (see Init into a repo)\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 (input/output schemas, versions, secrets)\n [--schema] function identity plus input/output JSON Schemas, as JSON (any caller who can see it)\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> [--fn <slug>]\n make a version live\n seq-studio functions rollback [<version>] -e <env> [--fn <slug>]\n redeploy a prior version\n seq-studio functions delete -e <env> [--fn <slug>] [--yes]\n 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 --fn selects a deployed function without a local manifest; otherwise the manifest in --dir (default .) supplies its slug\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 Local deploys record repository-wide gitDirty, including unignored files\n outside --dir. Check git status at the repository root before deploying.\n\n Workspace dependencies are compiled from packages declared in a containing\n sequence.app.yml, within the source repository. Only the selected function is\n deployed: no sibling primitives or Application registration. Shared Node packages\n can set package.json seqStudio.source to a root source entry for clean builds.\n Package build scripts are not run. Local secret paths remain relative to --dir.\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\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
11
|
-
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. Returns once\n the repo resolves by name, so clone can follow\n at once. The init commands take --repo\n <ns>/<name> to create, clone, and scaffold\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|resolve|unresolve|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";
|
|
11
|
+
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. Returns once\n the repo resolves by name, so clone can follow\n at once. The init commands take --repo\n <ns>/<name> to create, clone, and scaffold\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|edit|close|comment|comments|resolve|unresolve|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";
|
|
12
12
|
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 retry <run-id> -e <env> [--run-id <new-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>]]\n [--steps [--node <node-id>] [--full]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start and retry need invoker on the process,\n show and list return only runs you can view, and cancel needs invoker on the\n process.\n start prints the new run's id. Omit --run-id for a fresh id on every start.\n --run-id names exactly one run: repeating it for the same process returns that\n run, whatever its status, instead of starting another. To run a failed run\n again, retry it rather than inventing a new id.\n --version pins a published process version; omitted, the active version runs.\n --metadata-file is a JSON object stored on the run.\n retry (CLI 0.9.0+) starts a new run of a failed, cancelled or timed_out run's\n process version with the same metadata, entity and title, linked to the\n original in its lineage, and prints the new id. Other statuses are refused.\n Like start, a retry waits queued while the process is at its concurrent-run\n limit.\n --run-id on retry names the new run, so repeating the retry returns it.\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. show prints the run's error when it failed.\n show --steps (CLI 0.9.1+) prints each step's status, edge, error, input and\n output, with the same viewer permission as show. Inputs, outputs and errors\n over 2000 characters are cut to a preview; --full prints them whole.\n --node narrows to one node. With --json, --steps returns { run, steps } with\n the same bounds; each step's truncated map names its cut fields and their full\n length. A failure in a node's input mapper happens before its step\n starts, so it shows only as the run's error.\n";
|
|
13
13
|
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 omits SDL, adds active set/schema IDs and ops hash; retry on a mismatch.\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";
|
|
14
14
|
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] delegates to the installed ORM\n package using the directory's operations.manifest.json (default dir: .).\n Updated ORM packages validate the name and kind, then call the active named\n operation. Older packages may still select the manifest hash. Confirm the\n installed package and platform support name selection before upgrading.\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; - or /dev/stdin reads UTF-8 stdin until EOF\n (the checkout form requires an ORM package with stdin support).\n --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";
|
package/dist/command-help.js
CHANGED
|
@@ -20,13 +20,15 @@ export const ORM_HISTORY_HELP = `usage:
|
|
|
20
20
|
first: when, who, what moved, and the Git Service source. "verified" and "ci"
|
|
21
21
|
sources were checked by Atlas against the repository; "reported" means Atlas
|
|
22
22
|
could not tie the change to a pushed commit on a release branch, with the
|
|
23
|
-
reason when one was claimed.
|
|
24
|
-
|
|
23
|
+
reason when one was claimed. "break_glass" is an admin override made with
|
|
24
|
+
orm apply --unverified-source "<reason>". * marks the live activation.
|
|
25
|
+
History starts with the first apply after the environment recorded it.
|
|
25
26
|
`;
|
|
26
27
|
export const ORM_DEPLOYMENT_POLICY_HELP = `usage:
|
|
27
28
|
seq-studio orm deployment-policy <namespace> -e <env> [--json]
|
|
28
29
|
seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>
|
|
29
30
|
seq-studio orm deployment-policy <namespace> -e <env> --mode manual
|
|
31
|
+
seq-studio orm deployment-policy <namespace> -e <env> --mode source --repo <ns>/<name> --branch <branch> --path <dir>
|
|
30
32
|
|
|
31
33
|
Existing namespaces default to manual deployment. CI mode rejects direct ORM
|
|
32
34
|
registration, schema apply, and operations-only activation on the server;
|
|
@@ -34,14 +36,20 @@ export const ORM_DEPLOYMENT_POLICY_HELP = `usage:
|
|
|
34
36
|
Enabling CI mode requires namespace Admin, repository Admin, and an existing
|
|
35
37
|
automatic branch binding to this namespace. Restoring manual mode requires
|
|
36
38
|
namespace Admin. This changes deployment policy; it does not deploy source.
|
|
39
|
+
|
|
40
|
+
Source mode keeps direct applies but accepts only ones Atlas verifies came
|
|
41
|
+
from that repository, branch and package directory (pass --path . for the
|
|
42
|
+
repository root). It requires namespace Admin and repository Read. Namespace
|
|
43
|
+
admins can still apply with --unverified-source "<reason>", which is recorded.
|
|
37
44
|
`;
|
|
38
45
|
export const ORM_HELP = `usage:
|
|
39
46
|
seq-studio orm init <dir> [--repo <ns>/<name>]
|
|
40
47
|
seq-studio orm generate [dir] [--migration-export] [--check]
|
|
41
48
|
seq-studio orm validate [dir]
|
|
42
49
|
seq-studio orm plan [dir] -e <env>
|
|
43
|
-
seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]
|
|
44
|
-
seq-studio orm
|
|
50
|
+
seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait] [--unverified-source "<reason>"]
|
|
51
|
+
seq-studio orm history <namespace> -e <env> [--limit N] [--json]
|
|
52
|
+
seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci|source] [--repo <ns>/<name> --branch <branch> (--target <target-key> | --path <dir>)] [--json]
|
|
45
53
|
seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
|
|
46
54
|
seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
|
|
47
55
|
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
@@ -60,7 +68,11 @@ export const ORM_HELP = `usage:
|
|
|
60
68
|
apply waits until the new version is live and serving (default up to 20m), then
|
|
61
69
|
prints "live:"; --no-wait returns once the apply is queued.
|
|
62
70
|
CI-managed namespaces reject direct apply; use the enrolled repository's merge
|
|
63
|
-
workflow.
|
|
71
|
+
workflow. Source-pinned namespaces accept only applies Atlas verifies against
|
|
72
|
+
their repository, branch and package path, and an environment can require a
|
|
73
|
+
verified source for every apply. A namespace admin may record an audited
|
|
74
|
+
exception with --unverified-source "<reason>". deployment-policy reads or
|
|
75
|
+
explicitly changes this namespace setting.
|
|
64
76
|
namespaces lists what you can read; describe shows its tables and operations.
|
|
65
77
|
Run seq-studio orm describe --help for the output.
|
|
66
78
|
execute <namespace> <operation> runs the deployed version's persisted operation by
|
|
@@ -183,7 +195,7 @@ export const REPOS_USAGE = `usage:
|
|
|
183
195
|
configures login for subsequent git pull/push
|
|
184
196
|
seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]
|
|
185
197
|
materialize the tree at a ref (JSON API)
|
|
186
|
-
seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|resolve|unresolve|review|reviews|checks> [args]
|
|
198
|
+
seq-studio repos pulls <list|show|create|diff|merge|edit|close|comment|comments|resolve|unresolve|review|reviews|checks> [args]
|
|
187
199
|
review requests (see pulls --help)
|
|
188
200
|
seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)
|
|
189
201
|
seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** Preserve only finite metadata when a terminal catch prints an error and returns an exit code.
|
|
2
|
+
* Never call from HTTP retries or recoverable request failures; completion alone emits the event.
|
|
3
|
+
*/
|
|
4
|
+
export declare function recordTerminalCommandError(error: unknown): void;
|
|
1
5
|
/** Called only after the existing auth path has verified the token and target. */
|
|
2
6
|
export declare function recordAuthenticatedCliTarget(baseUrl: string, token: string): void;
|
|
3
7
|
export declare function beginCommandTelemetry(): number;
|
|
@@ -7,6 +7,7 @@ import { edgeAuthHeaders } from './edge-auth-headers.js';
|
|
|
7
7
|
const preferencePath = () => join(homedir(), '.config', 'lattice', 'telemetry.json');
|
|
8
8
|
const targets = new Map();
|
|
9
9
|
let active = false;
|
|
10
|
+
let terminalFailure;
|
|
10
11
|
function commandOutcome(exitCode, error) {
|
|
11
12
|
if (exitCode === 0)
|
|
12
13
|
return 'success';
|
|
@@ -41,6 +42,21 @@ function commandErrorCategory(error, status) {
|
|
|
41
42
|
return 'network';
|
|
42
43
|
return 'unknown';
|
|
43
44
|
}
|
|
45
|
+
function failureMetadata(error) {
|
|
46
|
+
const httpStatus = commandHttpStatus(error);
|
|
47
|
+
return {
|
|
48
|
+
httpStatus,
|
|
49
|
+
errorCategory: commandErrorCategory(error, httpStatus),
|
|
50
|
+
cancelled: error instanceof Error && error.name === 'AbortError',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** Preserve only finite metadata when a terminal catch prints an error and returns an exit code.
|
|
54
|
+
* Never call from HTTP retries or recoverable request failures; completion alone emits the event.
|
|
55
|
+
*/
|
|
56
|
+
export function recordTerminalCommandError(error) {
|
|
57
|
+
if (active)
|
|
58
|
+
terminalFailure = failureMetadata(error);
|
|
59
|
+
}
|
|
44
60
|
/** Called only after the existing auth path has verified the token and target. */
|
|
45
61
|
export function recordAuthenticatedCliTarget(baseUrl, token) {
|
|
46
62
|
if (!active)
|
|
@@ -49,6 +65,7 @@ export function recordAuthenticatedCliTarget(baseUrl, token) {
|
|
|
49
65
|
}
|
|
50
66
|
export function beginCommandTelemetry() {
|
|
51
67
|
targets.clear();
|
|
68
|
+
terminalFailure = undefined;
|
|
52
69
|
active = true;
|
|
53
70
|
return performance.now();
|
|
54
71
|
}
|
|
@@ -69,15 +86,17 @@ export async function setTelemetryEnabled(enabled) {
|
|
|
69
86
|
}
|
|
70
87
|
export async function finishCommandTelemetry(input) {
|
|
71
88
|
active = false;
|
|
89
|
+
const failure = input.error === undefined ? terminalFailure : failureMetadata(input.error);
|
|
90
|
+
terminalFailure = undefined;
|
|
72
91
|
const target = targets.size === 1 ? [...targets][0] : null;
|
|
73
92
|
targets.clear();
|
|
74
93
|
if (!input.command || !target || !(await telemetryEnabled()))
|
|
75
94
|
return;
|
|
76
95
|
const [baseUrl, token] = target;
|
|
77
96
|
const durationMs = Math.max(0, Math.min(86_400_000, Math.round(performance.now() - input.startedAt)));
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
const errorCategory = outcome === 'failure' ?
|
|
97
|
+
const outcome = input.exitCode !== 0 && failure?.cancelled ? 'cancelled' : commandOutcome(input.exitCode, input.error);
|
|
98
|
+
const httpStatus = outcome === 'success' ? undefined : failure?.httpStatus;
|
|
99
|
+
const errorCategory = outcome === 'failure' ? failure?.errorCategory ?? 'unknown' : undefined;
|
|
81
100
|
try {
|
|
82
101
|
await fetch(new URL('/api/platform/cli-command-events', baseUrl), {
|
|
83
102
|
method: 'POST', redirect: 'error', signal: AbortSignal.timeout(1_500),
|
|
@@ -355,8 +355,13 @@ const TEMPLATE_PACKAGE_JSON = (id) => JSON.stringify({
|
|
|
355
355
|
// The deploy worker compiles index.ts -> dist/index.js; `main` points at
|
|
356
356
|
// the compiled output Cloud Functions loads.
|
|
357
357
|
main: 'dist/index.js',
|
|
358
|
+
// Repository CI runs lint, type-check and test as these scripts; without
|
|
359
|
+
// them it substitutes platform defaults a checkout cannot run locally.
|
|
358
360
|
scripts: {
|
|
359
361
|
build: 'tsc',
|
|
362
|
+
lint: 'tsc --noEmit --noUnusedLocals --noUnusedParameters',
|
|
363
|
+
'type-check': 'tsc --noEmit',
|
|
364
|
+
test: 'node --test',
|
|
360
365
|
},
|
|
361
366
|
dependencies: {
|
|
362
367
|
'@google-cloud/functions-framework': '^3.4.0',
|
package/dist/main.js
CHANGED
|
@@ -85,7 +85,7 @@ const PROCESS_USAGE = `usage:
|
|
|
85
85
|
seq-studio process runs start|retry|list|show|cancel [args] -e <env> (see process runs --help)
|
|
86
86
|
seq-studio process test [-e <env>] [--offline]
|
|
87
87
|
seq-studio process simulate <process-id>
|
|
88
|
-
seq-studio process bundle build [-o file.json]
|
|
88
|
+
seq-studio process bundle build [-o file.json] [-e <env>] [--offline]
|
|
89
89
|
seq-studio process bundle pull <hash> [-o file.json] [-e <env>]
|
|
90
90
|
seq-studio process bundle archive <hash> [-e <env>]
|
|
91
91
|
seq-studio process bundle inspect <bundle.json>
|
|
@@ -116,6 +116,7 @@ const SUBCOMMANDS = {
|
|
|
116
116
|
const TELEMETRY_EXCLUDED = new Set(['validate', 'telemetry', 'version', 'capabilities', 'help', 'login', 'logout', 'envs']);
|
|
117
117
|
const TELEMETRY_TOP_LEVEL = new Set(['init', 'add', 'deploy', 'doctor']);
|
|
118
118
|
const TELEMETRY_NESTED = {
|
|
119
|
+
'repos pulls': new Set(['list', 'show', 'create', 'diff', 'merge', 'edit', 'close', 'comment', 'comments', 'resolve', 'unresolve', 'review', 'reviews', 'checks']),
|
|
119
120
|
'process runs': new Set(['start', 'retry', 'list', 'show', 'cancel']),
|
|
120
121
|
'process bundle': new Set(['build', 'pull', 'archive', 'inspect', 'list', 'publish']),
|
|
121
122
|
};
|
|
@@ -25,29 +25,52 @@ export declare function repoOrmApplySource({ targetUrl, token, namespace, name,
|
|
|
25
25
|
commit: string | null;
|
|
26
26
|
path: string | undefined;
|
|
27
27
|
}): Promise<OrmApplySource | null>;
|
|
28
|
-
/**
|
|
29
|
-
export declare
|
|
28
|
+
/** Mirrors `UNVERIFIED_SOURCE_REASON_ENV` in `@sequenceholdings/orm/cli`. */
|
|
29
|
+
export declare const ORM_UNVERIFIED_SOURCE_REASON_ENV = "SEQUENCE_ORM_UNVERIFIED_SOURCE_REASON";
|
|
30
|
+
/** Pull `--unverified-source <reason>` (or `=reason`) off the argv; only `apply` accepts it. */
|
|
31
|
+
export declare function takeUnverifiedSourceFlag({ sub, argv }: {
|
|
32
|
+
sub: string;
|
|
33
|
+
argv: readonly string[];
|
|
34
|
+
}): {
|
|
35
|
+
reason?: string;
|
|
36
|
+
args: string[];
|
|
37
|
+
} | {
|
|
38
|
+
error: string;
|
|
39
|
+
};
|
|
40
|
+
export interface ApplySourceCapabilities {
|
|
41
|
+
/** The target records apply sources; an older Atlas rejects the unknown `source` field. */
|
|
42
|
+
records: boolean;
|
|
43
|
+
/** The target refuses applies whose source it cannot verify. */
|
|
44
|
+
enforced: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function applySourceCapabilities({ targetUrl, token }: {
|
|
30
47
|
targetUrl: string;
|
|
31
48
|
token: string;
|
|
32
|
-
}): Promise<
|
|
49
|
+
}): Promise<ApplySourceCapabilities>;
|
|
33
50
|
/**
|
|
34
|
-
* Hand the apply's Git Service source
|
|
35
|
-
*
|
|
36
|
-
*
|
|
51
|
+
* Hand the apply's Git Service source, and any override reason, to the pinned
|
|
52
|
+
* ORM package, which sends them with the apply. Returns why the apply cannot
|
|
53
|
+
* succeed when the target enforces verified sources and this one plainly will
|
|
54
|
+
* not verify, so the caller stops before registering anything.
|
|
37
55
|
*/
|
|
38
|
-
export declare function exportApplySource({ auth, targetUrl, resolve }: {
|
|
56
|
+
export declare function exportApplySource({ auth, targetUrl, resolve, unverifiedReason, dryRun }: {
|
|
39
57
|
auth: {
|
|
40
58
|
token: string;
|
|
41
59
|
} | null;
|
|
42
60
|
targetUrl: string;
|
|
43
61
|
resolve: () => Promise<OrmApplySource | null>;
|
|
44
|
-
|
|
62
|
+
unverifiedReason?: string;
|
|
63
|
+
/** A rehearsal on a disposable fork activates nothing, so it is never refused for its source. */
|
|
64
|
+
dryRun?: boolean;
|
|
65
|
+
}): Promise<string | null>;
|
|
45
66
|
/** `orm apply <dir>` from a local checkout; every other subcommand sends no source. */
|
|
46
|
-
export declare function exportLocalApplySource({ sub, auth, targetUrl, dir }: {
|
|
67
|
+
export declare function exportLocalApplySource({ sub, auth, targetUrl, dir, unverifiedReason, dryRun }: {
|
|
47
68
|
sub: string;
|
|
48
69
|
auth: {
|
|
49
70
|
token: string;
|
|
50
71
|
} | null;
|
|
51
72
|
targetUrl: string | undefined;
|
|
52
73
|
dir?: string;
|
|
53
|
-
|
|
74
|
+
unverifiedReason?: string;
|
|
75
|
+
dryRun?: boolean;
|
|
76
|
+
}): Promise<string | null>;
|
package/dist/orm/apply-source.js
CHANGED
|
@@ -45,42 +45,83 @@ export async function repoOrmApplySource({ targetUrl, token, namespace, name, co
|
|
|
45
45
|
const repo = await resolveRepo({ baseUrl: targetUrl, token, namespace, name });
|
|
46
46
|
return { repository_id: repo.id, commit, path: path ?? '.', dirty: false };
|
|
47
47
|
}
|
|
48
|
-
/**
|
|
49
|
-
export
|
|
48
|
+
/** Mirrors `UNVERIFIED_SOURCE_REASON_ENV` in `@sequenceholdings/orm/cli`. */
|
|
49
|
+
export const ORM_UNVERIFIED_SOURCE_REASON_ENV = 'SEQUENCE_ORM_UNVERIFIED_SOURCE_REASON';
|
|
50
|
+
const UNVERIFIED_SOURCE_FLAG = '--unverified-source';
|
|
51
|
+
/** Pull `--unverified-source <reason>` (or `=reason`) off the argv; only `apply` accepts it. */
|
|
52
|
+
export function takeUnverifiedSourceFlag({ sub, argv }) {
|
|
53
|
+
const args = [];
|
|
54
|
+
let reason;
|
|
55
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
56
|
+
const arg = argv[index];
|
|
57
|
+
if (arg !== UNVERIFIED_SOURCE_FLAG && !arg.startsWith(`${UNVERIFIED_SOURCE_FLAG}=`)) {
|
|
58
|
+
args.push(arg);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const value = arg === UNVERIFIED_SOURCE_FLAG ? argv[(index += 1)] : arg.slice(UNVERIFIED_SOURCE_FLAG.length + 1);
|
|
62
|
+
if (value === undefined || value.startsWith('-') || value.trim().length < 10) {
|
|
63
|
+
return { error: `${UNVERIFIED_SOURCE_FLAG} needs a reason of at least 10 characters, e.g. ${UNVERIFIED_SOURCE_FLAG} "incident 123 hotfix before merge"` };
|
|
64
|
+
}
|
|
65
|
+
reason = value.trim();
|
|
66
|
+
}
|
|
67
|
+
if (reason !== undefined && sub !== 'apply')
|
|
68
|
+
return { error: `${UNVERIFIED_SOURCE_FLAG} applies only to apply` };
|
|
69
|
+
return reason === undefined ? { args } : { reason, args };
|
|
70
|
+
}
|
|
71
|
+
export async function applySourceCapabilities({ targetUrl, token }) {
|
|
50
72
|
try {
|
|
51
73
|
const response = await fetch(new URL('/api/orm/runtime-capabilities', targetUrl), { headers: { authorization: `Bearer ${token}` } });
|
|
52
74
|
if (!response.ok)
|
|
53
|
-
return false;
|
|
75
|
+
return { records: false, enforced: false };
|
|
54
76
|
const body = await response.json();
|
|
55
|
-
|
|
77
|
+
if (typeof body !== 'object' || body === null)
|
|
78
|
+
return { records: false, enforced: false };
|
|
79
|
+
const records = 'activationSource' in body && body.activationSource === true;
|
|
80
|
+
return { records, enforced: records && 'requireVerifiedSource' in body && body.requireVerifiedSource === true };
|
|
56
81
|
}
|
|
57
82
|
catch {
|
|
58
|
-
return false;
|
|
83
|
+
return { records: false, enforced: false };
|
|
59
84
|
}
|
|
60
85
|
}
|
|
61
86
|
/**
|
|
62
|
-
* Hand the apply's Git Service source
|
|
63
|
-
*
|
|
64
|
-
*
|
|
87
|
+
* Hand the apply's Git Service source, and any override reason, to the pinned
|
|
88
|
+
* ORM package, which sends them with the apply. Returns why the apply cannot
|
|
89
|
+
* succeed when the target enforces verified sources and this one plainly will
|
|
90
|
+
* not verify, so the caller stops before registering anything.
|
|
65
91
|
*/
|
|
66
|
-
export async function exportApplySource({ auth, targetUrl, resolve }) {
|
|
92
|
+
export async function exportApplySource({ auth, targetUrl, resolve, unverifiedReason, dryRun = false }) {
|
|
67
93
|
delete process.env[ORM_SOURCE_ENV];
|
|
68
|
-
|
|
69
|
-
|
|
94
|
+
delete process.env[ORM_UNVERIFIED_SOURCE_REASON_ENV];
|
|
95
|
+
const capabilities = auth ? await applySourceCapabilities({ targetUrl, token: auth.token }) : { records: false, enforced: false };
|
|
96
|
+
if (!capabilities.records)
|
|
97
|
+
return null;
|
|
98
|
+
if (unverifiedReason)
|
|
99
|
+
process.env[ORM_UNVERIFIED_SOURCE_REASON_ENV] = unverifiedReason;
|
|
100
|
+
let source = null;
|
|
70
101
|
try {
|
|
71
|
-
|
|
72
|
-
if (source)
|
|
73
|
-
process.env[ORM_SOURCE_ENV] = JSON.stringify(source);
|
|
74
|
-
else
|
|
75
|
-
console.warn('[seq-studio] apply source unknown (not a clone of this environment\'s Git Service); the activation is recorded as reported');
|
|
102
|
+
source = await resolve();
|
|
76
103
|
}
|
|
77
104
|
catch (error) {
|
|
78
105
|
console.warn(`[seq-studio] could not resolve the apply source: ${error instanceof Error ? error.message : String(error)}`);
|
|
79
106
|
}
|
|
107
|
+
if (source)
|
|
108
|
+
process.env[ORM_SOURCE_ENV] = JSON.stringify(source);
|
|
109
|
+
const problem = !source ? 'is not a clone of this environment\'s Git Service' : source.dirty ? 'has uncommitted changes in the ORM package' : null;
|
|
110
|
+
if (!problem)
|
|
111
|
+
return null;
|
|
112
|
+
if (capabilities.enforced && !unverifiedReason && !dryRun) {
|
|
113
|
+
return `This environment applies ORM changes only from a pushed commit Atlas can verify, and this checkout ${problem}. ` +
|
|
114
|
+
`Commit and push the package (run \`seq-studio orm diff\` first so its migration is committed), then apply again or use --repo. ` +
|
|
115
|
+
`Namespace admins can override with ${UNVERIFIED_SOURCE_FLAG} "<reason>".`;
|
|
116
|
+
}
|
|
117
|
+
if (dryRun)
|
|
118
|
+
return null;
|
|
119
|
+
console.warn(`[seq-studio] this checkout ${problem}; the activation is recorded as ${unverifiedReason ? 'break_glass' : 'reported'}`);
|
|
120
|
+
return null;
|
|
80
121
|
}
|
|
81
122
|
/** `orm apply <dir>` from a local checkout; every other subcommand sends no source. */
|
|
82
|
-
export async function exportLocalApplySource({ sub, auth, targetUrl, dir = '.' }) {
|
|
123
|
+
export async function exportLocalApplySource({ sub, auth, targetUrl, dir = '.', unverifiedReason, dryRun }) {
|
|
83
124
|
if (sub !== 'apply' || !targetUrl)
|
|
84
|
-
return;
|
|
85
|
-
|
|
125
|
+
return null;
|
|
126
|
+
return exportApplySource({ auth, targetUrl, unverifiedReason, dryRun, resolve: async () => localOrmApplySource({ dir, targetUrl }) });
|
|
86
127
|
}
|
package/dist/orm/delegate.js
CHANGED
|
@@ -18,7 +18,7 @@ import { resolveFunctionSourceDir } from '../functions/source-selection.js';
|
|
|
18
18
|
import { warnBeforeHostDeploy } from '../manifest-roles-notice.js';
|
|
19
19
|
import { ORM_DEPLOYMENT_POLICY_HELP, ORM_DISCOVER_HELP, ORM_EXECUTE_HELP, ORM_HELP, ORM_HISTORY_HELP } from '../command-help.js';
|
|
20
20
|
import { ormVersionMismatch, requiresSchemaVersionCheck } from './version-guard.js';
|
|
21
|
-
import { exportApplySource, exportLocalApplySource, repoOrmApplySource } from './apply-source.js';
|
|
21
|
+
import { exportApplySource, exportLocalApplySource, repoOrmApplySource, takeUnverifiedSourceFlag } from './apply-source.js';
|
|
22
22
|
/**
|
|
23
23
|
* ORM subcommands that talk to Atlas — must not silently target `local`.
|
|
24
24
|
* `init`, `generate`, `validate`, `diff`, `migrate-from-yaml`, and `import` are offline.
|
|
@@ -114,7 +114,7 @@ function aliasOrmModuleForRemoteSource(envName) {
|
|
|
114
114
|
// error names the missing module.
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
async function runOrmFromRepo({ sub, selection, auth, targetUrl, ormCli, }) {
|
|
117
|
+
async function runOrmFromRepo({ sub, selection, auth, targetUrl, ormCli, unverifiedReason, }) {
|
|
118
118
|
if (!auth || !targetUrl) {
|
|
119
119
|
console.error('[seq-studio] orm --repo needs a target environment and auth. Pass -e <env> and run `seq-studio login`.');
|
|
120
120
|
return 1;
|
|
@@ -143,11 +143,13 @@ async function runOrmFromRepo({ sub, selection, auth, targetUrl, ormCli, }) {
|
|
|
143
143
|
'committed migrations are out of date — run `seq-studio orm diff` in the repository, commit the migration, and retry.');
|
|
144
144
|
return 1;
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
const refusal = sub === 'apply' ? await exportApplySource({ auth, targetUrl, unverifiedReason, dryRun: selection.rest.includes('--dry-run'), resolve: () => repoOrmApplySource({
|
|
147
|
+
targetUrl, token: auth.token, namespace: selection.spec.namespace, name: selection.spec.name,
|
|
148
|
+
commit: source.provenance.gitCommit, path: selection.path,
|
|
149
|
+
}) }) : null;
|
|
150
|
+
if (refusal) {
|
|
151
|
+
console.error(`[seq-studio] ${refusal}`);
|
|
152
|
+
return 1;
|
|
151
153
|
}
|
|
152
154
|
const args = [dir, ...selection.rest];
|
|
153
155
|
await warnBeforeHostDeploy({ sub, deploySub: 'apply', args, file: 'namespace.yaml' });
|
|
@@ -271,7 +273,12 @@ export async function runOrmCommand(sub, rest) {
|
|
|
271
273
|
}
|
|
272
274
|
if (NATIVE_ORM_SUBS.has(sub))
|
|
273
275
|
return runNativeOrmCommand(sub, rest);
|
|
274
|
-
const
|
|
276
|
+
const unverified = takeUnverifiedSourceFlag({ sub, argv: normalizeShortEnvFlag(rest) });
|
|
277
|
+
if ('error' in unverified) {
|
|
278
|
+
console.error(`[seq-studio] ${unverified.error}`);
|
|
279
|
+
return 1;
|
|
280
|
+
}
|
|
281
|
+
const { reason: unverifiedReason, args: normalized } = unverified;
|
|
275
282
|
const repoInit = sub === 'init' ? await runOrmInitWithRepo(normalized) : null;
|
|
276
283
|
if (repoInit !== null)
|
|
277
284
|
return repoInit;
|
|
@@ -327,15 +334,17 @@ export async function runOrmCommand(sub, rest) {
|
|
|
327
334
|
}
|
|
328
335
|
});
|
|
329
336
|
if (repoSelection)
|
|
330
|
-
return runOrmFromRepo({ sub, selection: repoSelection, auth, targetUrl, ormCli });
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
+
return runOrmFromRepo({ sub, selection: repoSelection, auth, targetUrl, ormCli, unverifiedReason });
|
|
338
|
+
return runLocalOrm({ sub, normalized, auth, targetUrl, unverifiedReason, runCli });
|
|
339
|
+
}
|
|
340
|
+
/** A namespace directory on disk: check its ORM version, attach the apply source, then forward. */
|
|
341
|
+
async function runLocalOrm({ sub, normalized, auth, targetUrl, unverifiedReason, runCli }) {
|
|
342
|
+
const problem = (requiresSchemaVersionCheck(sub) ? await ormVersionMismatch(positionalDir(normalized) ?? '.') : null) ??
|
|
343
|
+
await exportLocalApplySource({ sub, auth, targetUrl, dir: positionalDir(normalized), unverifiedReason, dryRun: normalized.includes('--dry-run') });
|
|
344
|
+
if (problem) {
|
|
345
|
+
console.error(`[seq-studio] ${problem}`);
|
|
346
|
+
return 1;
|
|
337
347
|
}
|
|
338
|
-
await exportLocalApplySource({ sub, auth, targetUrl, dir: positionalDir(normalized) });
|
|
339
348
|
await warnBeforeHostDeploy({ sub, deploySub: 'apply', args: normalized, file: 'namespace.yaml' });
|
|
340
349
|
return runCli([sub, ...normalized]);
|
|
341
350
|
}
|
|
@@ -3,21 +3,37 @@ import { getJson, putJson } from '../atlas-client.js';
|
|
|
3
3
|
import { printCliError } from '../cli-errors.js';
|
|
4
4
|
import { requiredStringFlag, validateCommandInput } from '../command-input.js';
|
|
5
5
|
import { buildContext, clientOptions } from '../functions/commands.js';
|
|
6
|
+
function repository(args) {
|
|
7
|
+
const repo = requiredStringFlag({ args, key: 'repo' }).split('/');
|
|
8
|
+
if (repo.length !== 2 || !repo[0] || !repo[1])
|
|
9
|
+
throw new Error('--repo must be <namespace>/<name>.');
|
|
10
|
+
return { repositoryNamespace: repo[0], repositoryName: repo[1], branch: requiredStringFlag({ args, key: 'branch' }) };
|
|
11
|
+
}
|
|
6
12
|
function selection(args) {
|
|
7
|
-
validateCommandInput({ args, flags: { mode: 'string', repo: 'string', branch: 'string', target: 'string' }, positional: 1 });
|
|
13
|
+
validateCommandInput({ args, flags: { mode: 'string', repo: 'string', branch: 'string', target: 'string', path: 'string' }, positional: 1 });
|
|
8
14
|
const mode = args.flags.mode;
|
|
9
|
-
if (mode !== undefined && mode !== 'manual' && mode !== 'ci')
|
|
10
|
-
throw new Error('--mode must be manual or
|
|
11
|
-
if (mode
|
|
12
|
-
if (['repo', 'branch', 'target'].some(key => args.flags[key] !== undefined))
|
|
13
|
-
throw new Error('--repo, --branch and --
|
|
15
|
+
if (mode !== undefined && mode !== 'manual' && mode !== 'ci' && mode !== 'source')
|
|
16
|
+
throw new Error('--mode must be manual, ci or source.');
|
|
17
|
+
if (mode === undefined || mode === 'manual') {
|
|
18
|
+
if (['repo', 'branch', 'target', 'path'].some(key => args.flags[key] !== undefined))
|
|
19
|
+
throw new Error('--repo, --branch, --target and --path require --mode ci or source.');
|
|
14
20
|
return { mode };
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
if (mode === 'ci') {
|
|
23
|
+
if (args.flags.path !== undefined)
|
|
24
|
+
throw new Error('--path applies only to --mode source.');
|
|
25
|
+
return { mode, ...repository(args), target: requiredStringFlag({ args, key: 'target' }) };
|
|
26
|
+
}
|
|
27
|
+
if (args.flags.target !== undefined)
|
|
28
|
+
throw new Error('--target applies only to --mode ci.');
|
|
29
|
+
return { mode, ...repository(args), path: requiredStringFlag({ args, key: 'path' }) };
|
|
30
|
+
}
|
|
31
|
+
function describe(policy) {
|
|
32
|
+
if (policy.mode === 'manual')
|
|
33
|
+
return 'manual deployment';
|
|
34
|
+
if (policy.mode === 'ci')
|
|
35
|
+
return `CI-managed (${policy.repository_id}, ${policy.branch}, ${policy.target_key})`;
|
|
36
|
+
return `direct applies only from ${policy.branch}:${policy.path === '' ? '.' : policy.path} in ${policy.repository_id}, verified by Atlas`;
|
|
21
37
|
}
|
|
22
38
|
export async function ormDeploymentPolicyCommand(args) {
|
|
23
39
|
try {
|
|
@@ -27,19 +43,19 @@ export async function ormDeploymentPolicyCommand(args) {
|
|
|
27
43
|
let result;
|
|
28
44
|
if (selected.mode === undefined)
|
|
29
45
|
result = await getJson({ ...options, path });
|
|
46
|
+
else if (!('repositoryNamespace' in selected))
|
|
47
|
+
result = await putJson({ ...options, path, body: { mode: 'manual' } });
|
|
30
48
|
else {
|
|
49
|
+
const repositoryId = (await resolveRepo({ ...options, namespace: selected.repositoryNamespace, name: selected.repositoryName })).id;
|
|
31
50
|
const body = selected.mode === 'ci'
|
|
32
|
-
? { mode: 'ci', repository_id:
|
|
33
|
-
|
|
34
|
-
: { mode: 'manual' };
|
|
51
|
+
? { mode: 'ci', repository_id: repositoryId, branch: selected.branch, target_key: selected.target }
|
|
52
|
+
: { mode: 'source', repository_id: repositoryId, branch: selected.branch, path: selected.path };
|
|
35
53
|
result = await putJson({ ...options, path, body });
|
|
36
54
|
}
|
|
37
55
|
if (args.flags.json === true)
|
|
38
56
|
console.log(JSON.stringify(result, null, 2));
|
|
39
|
-
else
|
|
40
|
-
|
|
41
|
-
console.log(`${result.namespace}: ${policy.mode === 'manual' ? 'manual deployment' : `CI-managed (${policy.repository_id}, ${policy.branch}, ${policy.target_key})`}`);
|
|
42
|
-
}
|
|
57
|
+
else
|
|
58
|
+
console.log(`${result.namespace}: ${describe(result.deployment_policy)}`);
|
|
43
59
|
return 0;
|
|
44
60
|
}
|
|
45
61
|
catch (error) {
|
package/dist/orm/help.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ORM_USAGE = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\n scaffold a namespace package (v2: TypeScript schema + GraphQL documents);\n --repo scaffolds into a git-service repo (see Init into a repo below)\n seq-studio orm generate [dir] write schema.graphql + operations.manifest.json + typePolicies.gen.ts (offline; runs consumer codegen when codegen.ts is present)\n seq-studio orm generate [dir] --migration-export [--check]\n export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing\n seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync\n seq-studio orm plan [dir] -e <env> compile definitions and diff against the registry\n seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]\n author the migration, register, apply, and refresh the generated outputs (the everyday command);\n waits until the new version is live (default up to 20m; e.g. --timeout 90s), --no-wait returns once queued\n seq-studio orm plan|apply --repo <ns>/<name> [--path <dir>] [--ref <ref>] -e <env>\n plan/apply a namespace committed to a platform git-service repo (CI deploy-from-git);\n --path selects the namespace directory (default: repo root). A remote apply never\n authors migrations: the committed ledger must already match the definitions.\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n run the deployed version's persisted operation by name as the caller (no checkout)\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n execute from the checkout manifest through the installed ORM package\n both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF\n seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]\n read rows of a deployed v2 namespace as the caller (row-level security applies)\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]\n run read-only SQL against a deployed v2 namespace as the caller\n qualify tables and double-quote mixed-case columns (e.g. SELECT \"loanNumber\" FROM lending.loans)\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n list the namespaces you can read\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci] [--repo <ns>/<name> --branch <branch> --target <target-key>] [--json]\n inspect or explicitly change the namespace's deployment controller\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions\n seq-studio orm diff [dir] write/verify the committed migration standalone (--check is the offline CI gate; --allow-destructive consents; --rebase records a v1 -> v2 conversion)\n seq-studio orm migrate-from-yaml <dir> convert a v1 YAML namespace to the v2 TypeScript format (offline; migrations/ preserved)\n seq-studio orm import [dir] --spec <file> | --table <t> --from <schema.table> --map <target=source,...>\n plan a batched copy from an existing Postgres relation into an owned table (writes a SQL script; no database connection)\n\n Environments: see `seq-studio envs list` (built-in: local; more are\n discovered after you authenticate).\n Authenticate with: seq-studio login\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
1
|
+
export declare const ORM_USAGE = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\n scaffold a namespace package (v2: TypeScript schema + GraphQL documents);\n --repo scaffolds into a git-service repo (see Init into a repo below)\n seq-studio orm generate [dir] write schema.graphql + operations.manifest.json + typePolicies.gen.ts (offline; runs consumer codegen when codegen.ts is present)\n seq-studio orm generate [dir] --migration-export [--check]\n export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing\n seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync\n seq-studio orm plan [dir] -e <env> compile definitions and diff against the registry\n seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait] [--unverified-source \"<reason>\"]\n author the migration, register, apply, and refresh the generated outputs (the everyday command);\n waits until the new version is live (default up to 20m; e.g. --timeout 90s), --no-wait returns once queued\n seq-studio orm plan|apply --repo <ns>/<name> [--path <dir>] [--ref <ref>] -e <env>\n plan/apply a namespace committed to a platform git-service repo (CI deploy-from-git);\n --path selects the namespace directory (default: repo root). A remote apply never\n authors migrations: the committed ledger must already match the definitions.\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n run the deployed version's persisted operation by name as the caller (no checkout)\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n execute from the checkout manifest through the installed ORM package\n both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF\n seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]\n read rows of a deployed v2 namespace as the caller (row-level security applies)\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]\n run read-only SQL against a deployed v2 namespace as the caller\n qualify tables and double-quote mixed-case columns (e.g. SELECT \"loanNumber\" FROM lending.loans)\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n list the namespaces you can read\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci|source] [--repo <ns>/<name> --branch <branch> (--target <target-key> | --path <dir>)] [--json]\n inspect or explicitly change the namespace's deployment controller\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions\n seq-studio orm diff [dir] write/verify the committed migration standalone (--check is the offline CI gate; --allow-destructive consents; --rebase records a v1 -> v2 conversion)\n seq-studio orm migrate-from-yaml <dir> convert a v1 YAML namespace to the v2 TypeScript format (offline; migrations/ preserved)\n seq-studio orm import [dir] --spec <file> | --table <t> --from <schema.table> --map <target=source,...>\n plan a batched copy from an existing Postgres relation into an owned table (writes a SQL script; no database connection)\n\n Environments: see `seq-studio envs list` (built-in: local; more are\n discovered after you authenticate).\n Authenticate with: seq-studio login\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
package/dist/orm/help.js
CHANGED
|
@@ -8,7 +8,7 @@ export const ORM_USAGE = `usage:
|
|
|
8
8
|
export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing
|
|
9
9
|
seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync
|
|
10
10
|
seq-studio orm plan [dir] -e <env> compile definitions and diff against the registry
|
|
11
|
-
seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]
|
|
11
|
+
seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait] [--unverified-source "<reason>"]
|
|
12
12
|
author the migration, register, apply, and refresh the generated outputs (the everyday command);
|
|
13
13
|
waits until the new version is live (default up to 20m; e.g. --timeout 90s), --no-wait returns once queued
|
|
14
14
|
seq-studio orm plan|apply --repo <ns>/<name> [--path <dir>] [--ref <ref>] -e <env>
|
|
@@ -28,7 +28,7 @@ export const ORM_USAGE = `usage:
|
|
|
28
28
|
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
29
29
|
list the namespaces you can read
|
|
30
30
|
seq-studio orm history <namespace> -e <env> [--limit N] [--json]
|
|
31
|
-
seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci] [--repo <ns>/<name> --branch <branch> --target <target-key>] [--json]
|
|
31
|
+
seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci|source] [--repo <ns>/<name> --branch <branch> (--target <target-key> | --path <dir>)] [--json]
|
|
32
32
|
inspect or explicitly change the namespace's deployment controller
|
|
33
33
|
seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]
|
|
34
34
|
show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions
|
package/dist/process/commands.js
CHANGED
|
@@ -220,8 +220,11 @@ async function lintCompiledProcessSource({ compiled, loadAgentSchemaEdgeIdEnum,
|
|
|
220
220
|
warnings: [...compiled.lint.warnings, ...agentLint.warnings, ...limitLint.warnings],
|
|
221
221
|
};
|
|
222
222
|
}
|
|
223
|
+
function isOffline(args) {
|
|
224
|
+
return args.flags.offline === true || args.flags.offline === 'true';
|
|
225
|
+
}
|
|
223
226
|
async function tryBuildAgentLoader(args) {
|
|
224
|
-
if (args
|
|
227
|
+
if (isOffline(args))
|
|
225
228
|
return undefined;
|
|
226
229
|
// Agent loader is only meaningful when we have a target env + token.
|
|
227
230
|
// If either fails to resolve, skip the check; lint will emit a warning
|
|
@@ -250,6 +253,12 @@ async function buildBundleForPublish(args, compiled) {
|
|
|
250
253
|
}
|
|
251
254
|
if (!hasSubprocess)
|
|
252
255
|
return compiled.bundle;
|
|
256
|
+
if (isOffline(args)) {
|
|
257
|
+
// Children in this bundle are already pinned by the SDK; children from
|
|
258
|
+
// other roots keep their unresolved reference, which apply resolves.
|
|
259
|
+
console.log('(subprocess children outside this bundle left unpinned — --offline flag set)');
|
|
260
|
+
return compiled.bundle;
|
|
261
|
+
}
|
|
253
262
|
try {
|
|
254
263
|
const { env, token } = await getEnvAndToken(args);
|
|
255
264
|
const resolveProcessPin = buildResolveProcessPinFromEnv(env, token);
|
|
@@ -345,7 +354,7 @@ export async function testCommand(args) {
|
|
|
345
354
|
}
|
|
346
355
|
console.log(`\nlint ok — ${compiled.bundle.processes.length} process(es) checked, ${lintResult.warnings.length} warning(s)`);
|
|
347
356
|
const bundle = await buildBundleForPublish(args, compiled);
|
|
348
|
-
const offline = args
|
|
357
|
+
const offline = isOffline(args);
|
|
349
358
|
const loadActiveProcess = await tryBuildActiveProcessLoader(args);
|
|
350
359
|
if (!loadActiveProcess) {
|
|
351
360
|
// `process test` is the CI gate — silently skipping the diff would
|
package/dist/repos/pulls.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ParsedArgs } from '../process/commands.js';
|
|
2
|
-
export declare const PULLS_USAGE = "usage:\n seq-studio repos pulls list <ns>/<name> -e <env> [--state open|closed|merged] [--limit N] [--cursor <cursor>]\n seq-studio repos pulls show <ns>/<name> <number> -e <env>\n seq-studio repos pulls create <ns>/<name> --head <branch> --base <branch> --title <title> -e <env> [--body-file <path>]\n seq-studio repos pulls diff <ns>/<name> <number> -e <env> [--max-files N]\n seq-studio repos pulls merge <ns>/<name> <number> -e <env> [--method squash|merge|ff] [--message <text>] [--yes]\n seq-studio repos pulls close <ns>/<name> <number> -e <env>\n seq-studio repos pulls comment <ns>/<name> <number> -e <env> (--body <text> | --body-file <path>)\n [--path <file> --line N [--side LEFT|RIGHT] [--commit <sha>]] [--reply-to <comment-id>]\n seq-studio repos pulls comments <ns>/<name> <number> -e <env> [--limit N] [--cursor <cursor>]\n seq-studio repos pulls resolve <ns>/<name> <number> <root-comment-id> -e <env>\n seq-studio repos pulls unresolve <ns>/<name> <number> <root-comment-id> -e <env>\n seq-studio repos pulls review <ns>/<name> <number> -e <env> (--approve | --request-changes | --comment)\n [--body <text> | --body-file <path>] [--commit <sha>]\n seq-studio repos pulls reviews <ns>/<name> <number> -e <env> [--limit N] [--cursor <cursor>]\n seq-studio repos pulls checks <ns>/<name> <number> -e <env> [--head <sha>]\n\n All results are JSON (--json is accepted). Authenticate: seq-studio login --env <env>.\n create needs repository write; merge needs merge/admin authority and passing server\n review/check policy. There is no policy bypass. Review show and diff before merging.\n Merge operates on the current branch head under server policy. When repository CI\n checks the branch, merge sends the checked head and base revisions; a newer push\n makes the server refuse until checks rerun. Default merge method: squash.\n list returns one page with nextCursor; pass --cursor to continue.\n create, show and list add a web url field to each Pull (<env>/repositories/<ns>/<name>/pull/<n>).\n diff compares live base/head branches for open Pulls, recorded SHAs for terminal\n Pulls, and reports truncated when its file\n limit is reached (default 100, maximum 500).\n close needs to be the Pull's author or have repository write; it is idempotent.\n comment adds a Pull comment; --path and --line anchor it to a diff line (side RIGHT\n and the branch's current commit unless --side/--commit say otherwise), and\n --reply-to answers an existing thread. review records approve, request-changes, or\n comment against the commit the Pull's branch points at now (or --commit). checks prints the check runs,\n CI plan and runs, and merge gates (mergeability, reviews, code owners) in one object.\n resolve and unresolve require repository read access and a root comment UUID from\n comments; the server rejects replies. They return the updated comment as JSON.\n repos pull (singular) materializes files; repos pulls manages review requests.\n";
|
|
2
|
+
export declare const PULLS_USAGE = "usage:\n seq-studio repos pulls list <ns>/<name> -e <env> [--state open|closed|merged] [--limit N] [--cursor <cursor>]\n seq-studio repos pulls show <ns>/<name> <number> -e <env>\n seq-studio repos pulls create <ns>/<name> --head <branch> --base <branch> --title <title> -e <env> [--body-file <path>]\n seq-studio repos pulls diff <ns>/<name> <number> -e <env> [--max-files N]\n seq-studio repos pulls merge <ns>/<name> <number> -e <env> [--method squash|merge|ff] [--message <text>] [--yes]\n seq-studio repos pulls edit <ns>/<name> <number> -e <env> [--title <title>] [--body <text> | --body-file <path>]\n seq-studio repos pulls close <ns>/<name> <number> -e <env>\n seq-studio repos pulls comment <ns>/<name> <number> -e <env> (--body <text> | --body-file <path>)\n [--path <file> --line N [--side LEFT|RIGHT] [--commit <sha>]] [--reply-to <comment-id>]\n seq-studio repos pulls comments <ns>/<name> <number> -e <env> [--limit N] [--cursor <cursor>]\n seq-studio repos pulls resolve <ns>/<name> <number> <root-comment-id> -e <env>\n seq-studio repos pulls unresolve <ns>/<name> <number> <root-comment-id> -e <env>\n seq-studio repos pulls review <ns>/<name> <number> -e <env> (--approve | --request-changes | --comment)\n [--body <text> | --body-file <path>] [--commit <sha>]\n seq-studio repos pulls reviews <ns>/<name> <number> -e <env> [--limit N] [--cursor <cursor>]\n seq-studio repos pulls checks <ns>/<name> <number> -e <env> [--head <sha>]\n\n All results are JSON (--json is accepted). Authenticate: seq-studio login --env <env>.\n create needs repository write; merge needs merge/admin authority and passing server\n review/check policy. There is no policy bypass. Review show and diff before merging.\n Merge operates on the current branch head under server policy. When repository CI\n checks the branch, merge sends the checked head and base revisions; a newer push\n makes the server refuse until checks rerun. Default merge method: squash.\n list returns one page with nextCursor; pass --cursor to continue.\n create, show and list add a web url field to each Pull (<env>/repositories/<ns>/<name>/pull/<n>).\n diff compares live base/head branches for open Pulls, recorded SHAs for terminal\n Pulls, and reports truncated when its file\n limit is reached (default 100, maximum 500).\n edit changes an open Pull's title and/or description (at least one). It needs the\n Pull's author or repository write; merged and closed Pulls cannot be edited. It\n prints the updated Pull like show.\n close needs to be the Pull's author or have repository write; it is idempotent.\n comment adds a Pull comment; --path and --line anchor it to a diff line (side RIGHT\n and the branch's current commit unless --side/--commit say otherwise), and\n --reply-to answers an existing thread. review records approve, request-changes, or\n comment against the commit the Pull's branch points at now (or --commit). checks prints the check runs,\n CI plan and runs, and merge gates (mergeability, reviews, code owners) in one object.\n resolve and unresolve require repository read access and a root comment UUID from\n comments; the server rejects replies. They return the updated comment as JSON.\n repos pull (singular) materializes files; repos pulls manages review requests.\n";
|
|
3
3
|
/** Only the revisions this command needs from GET .../pulls/<n>/ci. */
|
|
4
4
|
interface PullCiStatus {
|
|
5
5
|
plan?: {
|
|
@@ -23,7 +23,7 @@ export declare function pullWebUrl({ baseUrl, repoPath, number }: {
|
|
|
23
23
|
repoPath: string;
|
|
24
24
|
number: number | string;
|
|
25
25
|
}): string;
|
|
26
|
-
/** Adds `url` to a Pull (create), `pullRequest` (show), or each `items` entry (list). */
|
|
26
|
+
/** Adds `url` to a Pull (create), `pullRequest` (show, edit), or each `items` entry (list). */
|
|
27
27
|
export declare function addPullUrls({ action, result, baseUrl, repoPath }: {
|
|
28
28
|
action: string;
|
|
29
29
|
result: unknown;
|
|
@@ -31,6 +31,11 @@ export declare function addPullUrls({ action, result, baseUrl, repoPath }: {
|
|
|
31
31
|
repoPath: string;
|
|
32
32
|
}): unknown;
|
|
33
33
|
export declare function commentBody(args: ParsedArgs): Promise<object>;
|
|
34
|
+
/** PATCH body for edit: a new title and/or description, bounded like the server. */
|
|
35
|
+
export declare function editBody(args: ParsedArgs): Promise<{
|
|
36
|
+
title?: string;
|
|
37
|
+
body?: string;
|
|
38
|
+
}>;
|
|
34
39
|
export declare function reviewInput(args: ParsedArgs): Promise<{
|
|
35
40
|
state: string;
|
|
36
41
|
body?: string;
|
package/dist/repos/pulls.js
CHANGED
|
@@ -12,6 +12,7 @@ export const PULLS_USAGE = `usage:
|
|
|
12
12
|
seq-studio repos pulls create <ns>/<name> --head <branch> --base <branch> --title <title> -e <env> [--body-file <path>]
|
|
13
13
|
seq-studio repos pulls diff <ns>/<name> <number> -e <env> [--max-files N]
|
|
14
14
|
seq-studio repos pulls merge <ns>/<name> <number> -e <env> [--method squash|merge|ff] [--message <text>] [--yes]
|
|
15
|
+
seq-studio repos pulls edit <ns>/<name> <number> -e <env> [--title <title>] [--body <text> | --body-file <path>]
|
|
15
16
|
seq-studio repos pulls close <ns>/<name> <number> -e <env>
|
|
16
17
|
seq-studio repos pulls comment <ns>/<name> <number> -e <env> (--body <text> | --body-file <path>)
|
|
17
18
|
[--path <file> --line N [--side LEFT|RIGHT] [--commit <sha>]] [--reply-to <comment-id>]
|
|
@@ -34,6 +35,9 @@ export const PULLS_USAGE = `usage:
|
|
|
34
35
|
diff compares live base/head branches for open Pulls, recorded SHAs for terminal
|
|
35
36
|
Pulls, and reports truncated when its file
|
|
36
37
|
limit is reached (default 100, maximum 500).
|
|
38
|
+
edit changes an open Pull's title and/or description (at least one). It needs the
|
|
39
|
+
Pull's author or repository write; merged and closed Pulls cannot be edited. It
|
|
40
|
+
prints the updated Pull like show.
|
|
37
41
|
close needs to be the Pull's author or have repository write; it is idempotent.
|
|
38
42
|
comment adds a Pull comment; --path and --line anchor it to a diff line (side RIGHT
|
|
39
43
|
and the branch's current commit unless --side/--commit say otherwise), and
|
|
@@ -70,6 +74,7 @@ function actionFlags(action) {
|
|
|
70
74
|
case 'create': return { head: 'string', base: 'string', title: 'string', 'body-file': 'string' };
|
|
71
75
|
case 'diff': return { 'max-files': 'string' };
|
|
72
76
|
case 'merge': return { method: 'string', message: 'string', yes: 'boolean' };
|
|
77
|
+
case 'edit': return { title: 'string', body: 'string', 'body-file': 'string' };
|
|
73
78
|
case 'close': return {};
|
|
74
79
|
case 'comment': return { body: 'string', 'body-file': 'string', path: 'string', line: 'string', side: 'string', commit: 'string', 'reply-to': 'string' };
|
|
75
80
|
case 'comments':
|
|
@@ -102,7 +107,7 @@ function withPullUrl({ pull, baseUrl, repoPath }) {
|
|
|
102
107
|
return pull;
|
|
103
108
|
return { ...pull, url: pullWebUrl({ baseUrl, repoPath, number }) };
|
|
104
109
|
}
|
|
105
|
-
/** Adds `url` to a Pull (create), `pullRequest` (show), or each `items` entry (list). */
|
|
110
|
+
/** Adds `url` to a Pull (create), `pullRequest` (show, edit), or each `items` entry (list). */
|
|
106
111
|
export function addPullUrls({ action, result, baseUrl, repoPath }) {
|
|
107
112
|
const add = (pull) => withPullUrl({ pull, baseUrl, repoPath });
|
|
108
113
|
const record = result;
|
|
@@ -110,13 +115,14 @@ export function addPullUrls({ action, result, baseUrl, repoPath }) {
|
|
|
110
115
|
return result;
|
|
111
116
|
if (action === 'create')
|
|
112
117
|
return add(record);
|
|
113
|
-
if (action === 'show' && record.pullRequest)
|
|
118
|
+
if ((action === 'show' || action === 'edit') && record.pullRequest)
|
|
114
119
|
return { ...record, pullRequest: add(record.pullRequest) };
|
|
115
120
|
if (action === 'list' && Array.isArray(record.items))
|
|
116
121
|
return { ...record, items: record.items.map(add) };
|
|
117
122
|
return result;
|
|
118
123
|
}
|
|
119
124
|
const MAX_BODY_LENGTH = 65_536;
|
|
125
|
+
const MAX_TITLE_LENGTH = 512;
|
|
120
126
|
const COMMIT_SHA = /^[0-9a-f]{40}$/i;
|
|
121
127
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
122
128
|
const REVIEW_STATES = { approve: 'approved', 'request-changes': 'changes_requested', comment: 'commented' };
|
|
@@ -168,6 +174,16 @@ export async function commentBody(args) {
|
|
|
168
174
|
...(typeof replyTo === 'string' ? { parentId: replyTo } : {}),
|
|
169
175
|
};
|
|
170
176
|
}
|
|
177
|
+
/** PATCH body for edit: a new title and/or description, bounded like the server. */
|
|
178
|
+
export async function editBody(args) {
|
|
179
|
+
const title = args.flags.title;
|
|
180
|
+
if (typeof title === 'string' && title.length > MAX_TITLE_LENGTH)
|
|
181
|
+
throw new Error('--title exceeds 512 characters.');
|
|
182
|
+
const body = await bodyText(args);
|
|
183
|
+
if (title === undefined && body === undefined)
|
|
184
|
+
throw new Error('edit requires --title <title>, --body <text>, or --body-file <path>.');
|
|
185
|
+
return { ...(typeof title === 'string' ? { title } : {}), ...(body !== undefined ? { body } : {}) };
|
|
186
|
+
}
|
|
171
187
|
export async function reviewInput(args) {
|
|
172
188
|
const chosen = Object.keys(REVIEW_STATES).filter((flag) => args.flags[flag] === true);
|
|
173
189
|
if (chosen.length !== 1)
|
|
@@ -230,6 +246,8 @@ async function pullInput({ action, args }) {
|
|
|
230
246
|
return { body: await createBody(args) };
|
|
231
247
|
if (action === 'comment')
|
|
232
248
|
return { body: await commentBody(args) };
|
|
249
|
+
if (action === 'edit')
|
|
250
|
+
return { body: await editBody(args) };
|
|
233
251
|
if (action === 'review')
|
|
234
252
|
return { review: await reviewInput(args) };
|
|
235
253
|
if (action === 'checks')
|
|
@@ -259,6 +277,8 @@ async function reviewActionResult({ action, ctx, path, repoId, input }) {
|
|
|
259
277
|
const options = clientOptions(ctx);
|
|
260
278
|
if (action === 'close')
|
|
261
279
|
return postJson({ ...options, path: `${path}/close` });
|
|
280
|
+
if (action === 'edit')
|
|
281
|
+
return patchJson({ ...options, path, body: input.body });
|
|
262
282
|
if (action === 'checks')
|
|
263
283
|
return pullChecks({ ctx, path, head: input.head });
|
|
264
284
|
if (action === 'resolve' || action === 'unresolve') {
|
|
@@ -294,7 +314,7 @@ async function pullRead({ action, args, ctx, path, state, limit }) {
|
|
|
294
314
|
const listPath = action === 'comments' || action === 'reviews' ? `${path}/${action}` : path;
|
|
295
315
|
return getJson({ ...clientOptions(ctx), path: `${listPath}${query.size ? `?${query}` : ''}` });
|
|
296
316
|
}
|
|
297
|
-
const REVIEW_ACTIONS = new Set(['close', 'comment', 'review', 'checks', 'resolve', 'unresolve']);
|
|
317
|
+
const REVIEW_ACTIONS = new Set(['edit', 'close', 'comment', 'review', 'checks', 'resolve', 'unresolve']);
|
|
298
318
|
export async function reposPullsCommand(input) {
|
|
299
319
|
const [action, ...positional] = input.positional;
|
|
300
320
|
if (!action || wantsHelp({ sub: action, args: input })) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequenceholdings/studio-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.14",
|
|
4
4
|
"description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth whoami`. Includes Auth0 browser login shared with seqapi.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"yaml": "^2.8.4",
|
|
46
46
|
"zod": "4.6.6",
|
|
47
47
|
"@sequenceholdings/agent-spec": "0.1.5",
|
|
48
|
-
"@sequenceholdings/
|
|
49
|
-
"@sequenceholdings/
|
|
50
|
-
"@sequenceholdings/managed-functions": "0.5.9",
|
|
48
|
+
"@sequenceholdings/artifact-studio": "0.11.13",
|
|
49
|
+
"@sequenceholdings/managed-functions": "0.5.10",
|
|
51
50
|
"@sequenceholdings/storage": "0.1.7",
|
|
51
|
+
"@sequenceholdings/lattice": "0.1.8",
|
|
52
52
|
"@sequenceholdings/platform": "0.1.4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@sequenceholdings/
|
|
56
|
-
"@sequenceholdings/
|
|
55
|
+
"@sequenceholdings/pipeline-spec": "0.3.9",
|
|
56
|
+
"@sequenceholdings/orm": "2.9.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
59
|
"@sequenceholdings/orm": {
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@types/node": "^22.0.0",
|
|
69
69
|
"@types/semver": "^7.8.0",
|
|
70
70
|
"typescript": "^5.6.0",
|
|
71
|
-
"vitest": "^4.1.
|
|
72
|
-
"@sequenceholdings/pipeline-spec": "0.3.
|
|
73
|
-
"@sequenceholdings/orm": "2.
|
|
71
|
+
"vitest": "^4.1.12",
|
|
72
|
+
"@sequenceholdings/pipeline-spec": "0.3.9",
|
|
73
|
+
"@sequenceholdings/orm": "2.9.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=20"
|