@sequenceholdings/studio-cli 0.9.9 → 0.9.10

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 CHANGED
@@ -911,6 +911,9 @@ compiled to canonical SQL before registration.
911
911
  | `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes. |
912
912
  | `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
913
913
  | `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. |
914
+ | `seq-studio orm deployment-policy <namespace> -e <env> [--json]` | Inspect whether a namespace permits manual deployment or requires its enrolled repository's verified CI deployment. |
915
+ | `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. |
916
+ | `seq-studio orm deployment-policy <namespace> -e <env> --mode manual` | Restore direct, permission-checked deployment; requires namespace Admin. |
914
917
  | `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. |
915
918
  | `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. |
916
919
  | `seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]` | List the namespaces you can read. |
@@ -946,6 +949,17 @@ pnpm exec seq-studio orm apply . -e local
946
949
  pnpm exec seq-studio orm validate .
947
950
  ```
948
951
 
952
+ Existing namespaces remain in manual mode until explicitly enrolled. Automatic
953
+ repository bindings alone do not enable CI-only enforcement. CI-managed namespaces
954
+ reject direct registration, schema apply, and operations-only activation on Atlas,
955
+ including old CLIs and applies queued before enrollment. CI must match the enrolled
956
+ repository, branch, target, authorizer, current deployment intent, and verified build
957
+ output. Removing a repository policy does not silently restore manual mode; an
958
+ administrator must explicitly change the namespace policy. Local generate, validate,
959
+ and plan remain available. Runtime reads and writes keep their existing permissions.
960
+ Deploy this support to Atlas and every ORM apply worker before enrolling namespaces,
961
+ so applies queued before enrollment also run the policy check.
962
+
949
963
  Global ORM commands require a CLI release that declares `drizzle-orm` directly.
950
964
  Older releases can fail during module loading because `drizzle-kit` imports
951
965
  `drizzle-orm` without declaring it. Update the global CLI if you see that error.
@@ -1787,7 +1801,7 @@ successfully. Help does not initialize files, authenticate, or deploy.
1787
1801
  | `seq-studio artifact plan [dir] -e <env>` | `plan [dir] --env <env>` |
1788
1802
  | `seq-studio artifact deploy [dir] -e <env> [--skip-unchanged] [--no-create] [--project <id>]` | `deploy [dir] --env <env>` — `--skip-unchanged` no-ops (before building) when the remote active deployment's `sourceHash` **and** CLI/atlas-ui peer versions already match; `--no-create` errors instead of creating a missing project; `--project <id>` targets a project directly when duplicate slugs make the lookup ambiguous (slug must still match the manifest) |
1789
1803
  | `seq-studio artifact deploy --repo <ns>/<name> --ref <branch> --preview [--key <key>] -e <env>` | Builds any branch, tag, or commit as a preview and prints its link; see "Previews" below. Works for React/HTML and Next.js (`--key` is React/HTML only), and from an agent sandbox |
1790
- | `seq-studio artifact dev [dir] -e <env> [--link <pkgDir>[,<pkgDir>]] [--port <port>] [--local-secrets <bindings.json>] [--bundler turbopack\|webpack]` | React/HTML: rebuild preview on changes. Next.js: local development server and owner-only Atlas tunnel; `--port` selects its loopback port, `--bundler` its bundler (default Turbopack). |
1804
+ | `seq-studio artifact dev [dir] -e <env> [--link <pkgDir>[,<pkgDir>]] [--port <port>] [--secret-source local|hosted|none] [--local-secrets <bindings.json>] [--bundler turbopack\|webpack]` | React/HTML: rebuild preview on changes. Next.js: local development server and owner-only Atlas tunnel; `--port` selects its loopback port, `--bundler` its bundler (default Turbopack). |
1791
1805
  | `seq-studio artifact pull <project-id> -e <env> [--out <dir>]` | `pull <project-id> --env <env> [--out <dir>]` |
1792
1806
  | `seq-studio artifact list -e <env> [--json]` | `list --env <env>` — projects visible on the environment (slug, id, active version, visibility); `--json` emits the response object |
1793
1807
  | `seq-studio artifact show <slug-or-id> -e <env> [--json]` | `show <slug-or-id> --env <env>` — one project's detail incl. active deployment, git provenance, and (for newer deployments) the building `artifact-studio` / force-aliased `atlas-ui` versions; `--json` emits the response object |
@@ -2355,7 +2369,8 @@ targets: []
2355
2369
  ```
2356
2370
 
2357
2371
  Atlas discovers the file on the pull request's head or base and runs checks on
2358
- PR creation and updates to its head or base. Repository CI and deployment jobs
2372
+ PR creation and updates to its head. A base change is re-verified at merge, and
2373
+ only a delta reaching control files or target inputs queues a recheck. Repository CI and deployment jobs
2359
2374
  use Buildkite, including for local destinations. Next.js resources may explicitly
2360
2375
  select Modal for compilation. Each run uses the platform
2361
2376
  image defaults; no image digest or manual branch-policy setup is
@@ -3058,10 +3073,31 @@ the normal local Atlas authorization and lifecycle, with a dedicated development
3058
3073
  GCS bucket. The standalone `functions dev` harness does not mint storage delegation.
3059
3074
 
3060
3075
 
3061
- ### Local Next.js server secrets
3076
+ ### Next.js server secrets in `artifact dev`
3077
+
3078
+ `artifact dev` always runs your Next.js server on your machine, with a scrubbed
3079
+ environment: no Atlas, cloud, or Doppler credentials reach it. `-e` selects the
3080
+ control plane (sessions, permissions, the preview tunnel), not where the code
3081
+ runs. Hosted servers come only from `artifact deploy --preview` or an official
3082
+ deploy, which mount secrets themselves.
3083
+
3084
+ Choose where declared `server.secrets` values come from with `--secret-source`:
3085
+
3086
+ | `--secret-source` | Default when | Reads | Authority |
3087
+ | --- | --- | --- | --- |
3088
+ | `local` | `-e local` (a loopback Atlas) | The local Atlas's personal store | Project write, editor on each local secret |
3089
+ | `hosted` | never (explicit only) | The selected hosted Atlas, at the manifest's exact pinned `version` | Project write, editor on each secret, a staging deployment |
3090
+ | `none` | any hosted `-e` | Nothing; `artifact dev` lists the declared names it skipped | None |
3091
+
3092
+ Only declared `server.secrets` entries are injected, and only into the Next
3093
+ server process. They never become `NEXT_PUBLIC_*` or build variables, and they are
3094
+ never written to session metadata, runtime files, or logs. Your server code must
3095
+ keep them out of responses. Values are read once when `artifact dev` starts.
3096
+
3097
+ #### Local store (`-e local`)
3062
3098
 
3063
3099
  With local Atlas running on a personal `dev-*` Lakebase branch, create a managed
3064
- secret and set its value through the local Secrets store:
3100
+ secret and set its value in the local Secrets store:
3065
3101
 
3066
3102
  ```sh
3067
3103
  seq-studio secrets create PROVIDER_KEY -e local
@@ -3069,7 +3105,6 @@ seq-studio secrets set PROVIDER_KEY --from-file /private/path/provider-key -e lo
3069
3105
  seq-studio artifact dev ./web -e local
3070
3106
  ```
3071
3107
 
3072
- Only declared `server.secrets` entries are injected into the Next server child.
3073
3108
  A `secret_name` declaration defaults to that registry name; a `secret_id`
3074
3109
  declaration defaults locally to the declared environment name. Local development
3075
3110
  uses the local default value, independently of the hosted ID/version pin.
@@ -3084,17 +3119,48 @@ To use a different local name, pass `--local-secrets ./local-secret-bindings.jso
3084
3119
  { "APP_PROVIDER_KEY": "MY_DEV_PROVIDER_KEY" }
3085
3120
  ```
3086
3121
 
3087
- The file contains names only. The developer needs project write access, an owned
3088
- active session, and managed-secret editor (or higher) permission. Use-only secret
3089
- permission cannot export values. Only single-value secrets stored in this Atlas
3090
- workspace are accepted; hosted values and values from another checkout are
3091
- rejected, even when their metadata came from a database clone. Hosted Atlas
3092
- sessions never export secrets to the local CLI. The flag requires a loopback
3093
- Atlas URL, including local environments discovered on another port.
3122
+ The file contains names only. Use-only secret permission cannot export values.
3123
+ Only single-value secrets stored in this Atlas workspace are accepted; hosted
3124
+ values and values from another checkout are rejected, even when their metadata
3125
+ came from a database clone. The local source requires a loopback Atlas URL,
3126
+ including local environments discovered on another port.
3127
+
3128
+ #### Hosted source (a staging environment)
3094
3129
 
3095
- Values are passed explicitly to the Next child, never to public build variables,
3096
- logs, or persisted runtime/session metadata. Restart `artifact dev` after rotation
3097
- or a local binding change. App server code must keep secrets out of responses.
3130
+ To test against a hosted integration, such as a provider's UAT credential, read
3131
+ the same secret versions a hosted preview would mount, without copying values:
3132
+
3133
+ ```sh
3134
+ seq-studio envs list # find your staging environment's name
3135
+ seq-studio login -e <staging-env>
3136
+ seq-studio artifact dev ./web -e <staging-env> --secret-source hosted
3137
+ ```
3138
+
3139
+ The hosted Atlas checks, on every start: your project write access and active
3140
+ session; managed-secret **editor** (or higher) on each declared secret, the same
3141
+ authority `deploy --preview` needs to attach it; that each secret is a
3142
+ single-value secret in this deployment's registry; and that the pinned `version`
3143
+ is recorded and enabled. Use-only (`user`) permission lets a hosted runtime
3144
+ consume a secret but never exports it to your machine. Hosted values are available only from
3145
+ staging deployments, and `--secret-source hosted` always needs an explicit `-e`,
3146
+ so a default environment never supplies a production credential. Use dedicated
3147
+ staging test secrets. Each release is audited with secret names, IDs, and
3148
+ versions, never values. `--local-secrets` does not apply: hosted values follow
3149
+ `server.secrets` exactly.
3150
+
3151
+ #### Rotation and restarts
3152
+
3153
+ Values are read once, when `artifact dev` starts. Automatic Next.js restarts
3154
+ (dependency changes, crashes) reuse them.
3155
+
3156
+ - **Local:** after `secrets set`, stop and restart `artifact dev`.
3157
+ - **Hosted:** bindings are pinned. Set the new value, update `version` in
3158
+ `artifact.bundle.yml` (`artifact dev` stops and asks you to restart), and
3159
+ start it again. A disabled or destroyed pinned version fails at start with the
3160
+ secret's name and version.
3161
+ - Revoking the session in Atlas, or losing project write access, stops
3162
+ `artifact dev`. Removing secret permission takes effect at the next start: a
3163
+ running server keeps the values it received until it stops.
3098
3164
 
3099
3165
 
3100
3166
  ## Composed applications (0.4.0)
@@ -28,7 +28,7 @@ const ARTIFACT_USAGE = `usage:
28
28
  seq-studio artifact build [dir | --repo <ns>/<name> | --git-url <url>] [--ref <ref>] [--path <dir>] [--source-env <env>] [--out file.json]
29
29
  seq-studio artifact plan [dir | --repo <ns>/<name> | --git-url <url>] [--ref <ref>] [--path <dir>] [--source-env <env>] -e <env>
30
30
  seq-studio artifact deploy [dir | --repo <ns>/<name> | --git-url <url>] [--ref <ref>] [--path <dir>] [--source-env <env>] -e <env> [--skip-unchanged] [--no-create] [--project <id>]
31
- seq-studio artifact dev [dir] -e <env> [--once] [--key default] [--link <pkgDir>[,<pkgDir>]] [--port <port>] [--local-secrets <bindings.json>] [--bundler turbopack|webpack]
31
+ seq-studio artifact dev [dir] -e <env> [--once] [--key default] [--link <pkgDir>[,<pkgDir>]] [--port <port>] [--secret-source local|hosted|none] [--local-secrets <bindings.json>] [--bundler turbopack|webpack]
32
32
  seq-studio artifact pull <project-id> -e <env> --out <dir>
33
33
  seq-studio artifact promote <deployment-id> -e <env>
34
34
  seq-studio artifact rollback <deployment-id> -e <env>
@@ -66,9 +66,13 @@ const ARTIFACT_USAGE = `usage:
66
66
  with a Git Service origin on the selected source environment also works.
67
67
  Use pnpm build for a local production-build check. --once is static-only;
68
68
  --port selects the local Next loopback port.
69
- Local Next sessions inject declared server secrets from local Atlas's private
70
- store. --local-secrets maps environment names to local secret names (JSON,
71
- never values). Restart artifact dev after changing a local secret.
69
+ dev always runs Next on this machine; --secret-source picks where declared
70
+ server.secrets come from. local (default for -e local): local Atlas's private
71
+ store. hosted: the selected hosted Atlas at the pinned versions; needs an
72
+ explicit -e, managed-secret editor on each secret, and a staging deployment.
73
+ none (default for hosted environments): inject nothing. --local-secrets maps
74
+ environment names to local secret names (JSON, never values; local only).
75
+ Values are read once: restart artifact dev after changing a value or pin.
72
76
  dev uses Turbopack unless the Next config has a custom webpack function and no turbopack config; opt out
73
77
  with --bundler webpack or ARTIFACT_NEXT_DEV_BUNDLER=webpack.
74
78
  Deploy validates the selected targets.<environment>.url and declared storage
@@ -88,7 +88,7 @@ export declare const COMMAND_CONTRACT: readonly [{
88
88
  readonly description: "Author and operate ORM namespaces";
89
89
  readonly lifecycle: "preview";
90
90
  readonly access: "mixed";
91
- readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "namespaces", "describe", "read", "sql", "diff", "migrate-from-yaml", "import"];
91
+ readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "deployment-policy", "execute", "namespaces", "describe", "read", "sql", "diff", "migrate-from-yaml", "import"];
92
92
  }, {
93
93
  readonly name: "envs";
94
94
  readonly description: "Manage CLI environments";
@@ -14,7 +14,7 @@ export const COMMAND_CONTRACT = [
14
14
  { name: 'pipeline', description: 'Discover and operate Data Pipelines', lifecycle: 'preview', access: 'staff', subcommands: ['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'retire', 'run-now', 'promote', 'rollback'] },
15
15
  { name: 'feedback', description: 'Submit agent feedback', lifecycle: 'preview', access: 'authenticated', subcommands: ['submit'] },
16
16
  { name: 'auth', description: 'Manage Git authentication', lifecycle: 'stable', access: 'authenticated', subcommands: ['whoami', 'git-credential', 'pat'] },
17
- { name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
17
+ { name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'deployment-policy', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
18
18
  { name: 'envs', description: 'Manage CLI environments', lifecycle: 'stable', access: 'mixed', subcommands: ['add', 'list'] },
19
19
  { name: 'login', description: 'Authenticate with Sequence', lifecycle: 'stable', access: 'public', subcommands: [] },
20
20
  { name: 'logout', description: 'Remove cached user tokens', lifecycle: 'stable', access: 'public', subcommands: [] },
@@ -1,10 +1,11 @@
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_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 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 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";
4
+ 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";
5
+ 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 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";
5
6
  /** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
6
7
  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";
7
- 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>] [--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";
8
+ 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";
8
9
  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> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n 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";
9
10
  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";
10
11
  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,12 +13,25 @@ export const INIT_INTO_REPO_HELP = ` Init into a repo: --repo <ns>/<name> on an
13
13
  .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside
14
14
  a declared application is not declared; add it to that app with seq-studio add.
15
15
  `;
16
+ export const ORM_DEPLOYMENT_POLICY_HELP = `usage:
17
+ seq-studio orm deployment-policy <namespace> -e <env> [--json]
18
+ seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>
19
+ seq-studio orm deployment-policy <namespace> -e <env> --mode manual
20
+
21
+ Existing namespaces default to manual deployment. CI mode rejects direct ORM
22
+ registration, schema apply, and operations-only activation on the server;
23
+ only the enrolled repository's verified merge deployment may activate changes.
24
+ Enabling CI mode requires namespace Admin, repository Admin, and an existing
25
+ automatic branch binding to this namespace. Restoring manual mode requires
26
+ namespace Admin. This changes deployment policy; it does not deploy source.
27
+ `;
16
28
  export const ORM_HELP = `usage:
17
29
  seq-studio orm init <dir> [--repo <ns>/<name>]
18
30
  seq-studio orm generate [dir] [--migration-export] [--check]
19
31
  seq-studio orm validate [dir]
20
32
  seq-studio orm plan [dir] -e <env>
21
33
  seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]
34
+ seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci] [--repo <ns>/<name> --branch <branch> --target <target-key>] [--json]
22
35
  seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
23
36
  seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
24
37
  seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
@@ -36,6 +49,8 @@ export const ORM_HELP = `usage:
36
49
  namespace's package.json @sequenceholdings/orm range before compiling.
37
50
  apply waits until the new version is live and serving (default up to 20m), then
38
51
  prints "live:"; --no-wait returns once the apply is queued.
52
+ CI-managed namespaces reject direct apply; use the enrolled repository's merge
53
+ workflow. deployment-policy reads or explicitly changes this namespace setting.
39
54
  namespaces lists what you can read; describe shows its tables and operations.
40
55
  Run seq-studio orm describe --help for the output.
41
56
  execute <namespace> <operation> runs the deployed version's persisted operation by
@@ -64,7 +79,7 @@ export const ARTIFACT_HELP = `usage:
64
79
  seq-studio artifact show <slug-or-id> -e <env> [--json]
65
80
  seq-studio artifact validate [dir]
66
81
  seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>
67
- seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>] [--local-secrets <bindings.json>] [--bundler turbopack|webpack]
82
+ 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]
68
83
  seq-studio artifact pull <project-id> -e <env> --out <dir>
69
84
  seq-studio artifact promote|rollback <deployment-id> -e <env>
70
85
 
@@ -268,6 +283,8 @@ export const ORM_EXECUTE_HELP = `usage:
268
283
  `;
269
284
  /** read and sql print their own grammar help from the delegate. */
270
285
  function ormHelp(sub) {
286
+ if (sub === 'deployment-policy')
287
+ return ORM_DEPLOYMENT_POLICY_HELP;
271
288
  if (sub === 'namespaces' || sub === 'describe')
272
289
  return ORM_DISCOVER_HELP;
273
290
  if (sub === 'execute')
package/dist/main.js CHANGED
@@ -48,7 +48,7 @@ const TOP_LEVEL_USAGE = `usage:
48
48
  seq-studio pipeline <sub> [args] list | assets | search | describe | schema | sample | query | init | validate | repin-orm | codegen | plan | adopt | unbind | retire | deploy | status | migrate | promote | rollback | run-now
49
49
  seq-studio auth <sub> [args] whoami | git-credential
50
50
  seq-studio feedback submit --file report.json [-e <env>] [--json]
51
- seq-studio orm <sub> [args] init | generate | validate | plan | apply | execute | read | sql | diff | migrate-from-yaml | import
51
+ seq-studio orm <sub> [args] init | generate | validate | plan | apply | deployment-policy | execute | read | sql | diff | migrate-from-yaml | import
52
52
  seq-studio service-accounts <sub> list | show | create (requires provisioning authority)
53
53
  seq-studio access <sub> definitions | list | grant | revoke | resolve
54
54
  seq-studio principals <sub> search | users search | groups list | groups show
@@ -108,7 +108,7 @@ const SUBCOMMANDS = {
108
108
  principals: new Set(['search', 'users', 'groups']),
109
109
  auth: new Set(['whoami', 'git-credential', 'pat']),
110
110
  feedback: new Set(['submit']),
111
- orm: new Set(['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import']),
111
+ orm: new Set(['init', 'generate', 'validate', 'plan', 'apply', 'deployment-policy', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import']),
112
112
  pipeline: new Set(['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'repin-orm', 'codegen', 'adopt', 'unbind', 'retire', 'plan', 'deploy', 'status', 'migrate', 'promote', 'rollback', 'run-now']),
113
113
  envs: new Set(['add', 'list']),
114
114
  };
@@ -6,6 +6,7 @@
6
6
  * SEQUENCE_ORM_BASE_URL, share the seqapi token, forward argv.
7
7
  */
8
8
  import { fileURLToPath } from 'node:url';
9
+ import { ORM_USAGE } from './help.js';
9
10
  import { parseArgs } from '../argv.js';
10
11
  import { parseSourceSpec, resolveArtifactSource, } from '@sequenceholdings/artifact-studio/source-resolver';
11
12
  import { getAccessToken, tryGetAccessTokenWithMode } from '../auth.js';
@@ -15,7 +16,7 @@ import { explicitOrSandboxEnv, normalizeShortEnvFlag, readEnvFromArgv, withoutEn
15
16
  import { REQUIRE_EXPLICIT_ENV_MESSAGE } from '../env-flags.js';
16
17
  import { resolveFunctionSourceDir } from '../functions/source-selection.js';
17
18
  import { warnBeforeHostDeploy } from '../manifest-roles-notice.js';
18
- import { INIT_INTO_REPO_HELP, ORM_DISCOVER_HELP, ORM_EXECUTE_HELP, ORM_HELP } from '../command-help.js';
19
+ import { ORM_DEPLOYMENT_POLICY_HELP, ORM_DISCOVER_HELP, ORM_EXECUTE_HELP, ORM_HELP } from '../command-help.js';
19
20
  import { ormVersionMismatch, requiresSchemaVersionCheck } from './version-guard.js';
20
21
  /**
21
22
  * ORM subcommands that talk to Atlas — must not silently target `local`.
@@ -24,45 +25,6 @@ import { ormVersionMismatch, requiresSchemaVersionCheck } from './version-guard.
24
25
  const ORM_NETWORK_SUBS = new Set(['plan', 'apply', 'execute']);
25
26
  /** Subcommands that may read their namespace from a git-service repo (`--repo`). */
26
27
  const ORM_REPO_SUBS = new Set(['plan', 'apply']);
27
- const ORM_USAGE = `usage:
28
- seq-studio orm init <dir> [--repo <ns>/<name>]
29
- scaffold a namespace package (v2: TypeScript schema + GraphQL documents);
30
- --repo scaffolds into a git-service repo (see Init into a repo below)
31
- seq-studio orm generate [dir] write schema.graphql + operations.manifest.json + typePolicies.gen.ts (offline; runs consumer codegen when codegen.ts is present)
32
- seq-studio orm generate [dir] --migration-export [--check]
33
- export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing
34
- seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync
35
- seq-studio orm plan [dir] -e <env> compile definitions and diff against the registry
36
- seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]
37
- author the migration, register, apply, and refresh the generated outputs (the everyday command);
38
- waits until the new version is live (default up to 20m; e.g. --timeout 90s), --no-wait returns once queued
39
- seq-studio orm plan|apply --repo <ns>/<name> [--path <dir>] [--ref <ref>] -e <env>
40
- plan/apply a namespace committed to a platform git-service repo (CI deploy-from-git);
41
- --path selects the namespace directory (default: repo root). A remote apply never
42
- authors migrations: the committed ledger must already match the definitions.
43
- seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
44
- run the deployed version's persisted operation by name as the caller (no checkout)
45
- seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
46
- execute from the checkout manifest through the installed ORM package
47
- both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF
48
- seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]
49
- read rows of a deployed v2 namespace as the caller (row-level security applies)
50
- seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]
51
- run read-only SQL against a deployed v2 namespace as the caller
52
- seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
53
- list the namespaces you can read
54
- seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]
55
- show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions
56
- 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)
57
- seq-studio orm migrate-from-yaml <dir> convert a v1 YAML namespace to the v2 TypeScript format (offline; migrations/ preserved)
58
- seq-studio orm import [dir] --spec <file> | --table <t> --from <schema.table> --map <target=source,...>
59
- plan a batched copy from an existing Postgres relation into an owned table (writes a SQL script; no database connection)
60
-
61
- Environments: see \`seq-studio envs list\` (built-in: local; more are
62
- discovered after you authenticate).
63
- Authenticate with: seq-studio login
64
-
65
- ${INIT_INTO_REPO_HELP}`;
66
28
  /**
67
29
  * Classify an ERR_MODULE_NOT_FOUND from importing `@sequenceholdings/orm/cli`:
68
30
  * is the orm package itself absent, or is it present but a dependency (e.g.
@@ -221,9 +183,17 @@ export function formatOrmDependencyFailure(message) {
221
183
  * CLI: discovery reads Atlas's registry, and ad-hoc reads go through the ORM
222
184
  * client. None of them needs a namespace directory.
223
185
  */
224
- const NATIVE_ORM_SUBS = new Set(['namespaces', 'describe', 'operation', 'read', 'sql']);
186
+ const NATIVE_ORM_SUBS = new Set(['namespaces', 'describe', 'operation', 'read', 'sql', 'deployment-policy']);
225
187
  async function runNativeOrmCommand(sub, rest) {
226
188
  const help = rest.includes('--help') || rest.includes('-h');
189
+ if (sub === 'deployment-policy') {
190
+ if (help) {
191
+ console.log(ORM_DEPLOYMENT_POLICY_HELP);
192
+ return 0;
193
+ }
194
+ const { ormDeploymentPolicyCommand } = await import('./deployment-policy.js');
195
+ return ormDeploymentPolicyCommand(parseArgs(rest));
196
+ }
227
197
  if (sub === 'namespaces' || sub === 'describe' || sub === 'operation') {
228
198
  if (help) {
229
199
  console.log(ORM_DISCOVER_HELP);
@@ -0,0 +1,2 @@
1
+ import type { ParsedArgs } from '../argv.js';
2
+ export declare function ormDeploymentPolicyCommand(args: ParsedArgs): Promise<number>;
@@ -0,0 +1,49 @@
1
+ import { resolveRepo } from '@sequenceholdings/artifact-studio/git-service-client';
2
+ import { getJson, putJson } from '../atlas-client.js';
3
+ import { printCliError } from '../cli-errors.js';
4
+ import { requiredStringFlag, validateCommandInput } from '../command-input.js';
5
+ import { buildContext, clientOptions } from '../functions/commands.js';
6
+ function selection(args) {
7
+ validateCommandInput({ args, flags: { mode: 'string', repo: 'string', branch: 'string', target: 'string' }, positional: 1 });
8
+ const mode = args.flags.mode;
9
+ if (mode !== undefined && mode !== 'manual' && mode !== 'ci')
10
+ throw new Error('--mode must be manual or ci.');
11
+ if (mode !== 'ci') {
12
+ if (['repo', 'branch', 'target'].some(key => args.flags[key] !== undefined))
13
+ throw new Error('--repo, --branch and --target require --mode ci.');
14
+ return { mode };
15
+ }
16
+ const repo = requiredStringFlag({ args, key: 'repo' }).split('/');
17
+ if (repo.length !== 2 || !repo[0] || !repo[1])
18
+ throw new Error('--repo must be <namespace>/<name>.');
19
+ return { mode, repositoryNamespace: repo[0], repositoryName: repo[1],
20
+ branch: requiredStringFlag({ args, key: 'branch' }), target: requiredStringFlag({ args, key: 'target' }) };
21
+ }
22
+ export async function ormDeploymentPolicyCommand(args) {
23
+ try {
24
+ const selected = selection(args);
25
+ const options = clientOptions(await buildContext(args));
26
+ const path = `/api/orm/namespaces/${encodeURIComponent(args.positional[0])}/deployment-policy`;
27
+ let result;
28
+ if (selected.mode === undefined)
29
+ result = await getJson({ ...options, path });
30
+ else {
31
+ const body = selected.mode === 'ci'
32
+ ? { mode: 'ci', repository_id: (await resolveRepo({ ...options, namespace: selected.repositoryNamespace, name: selected.repositoryName })).id,
33
+ branch: selected.branch, target_key: selected.target }
34
+ : { mode: 'manual' };
35
+ result = await putJson({ ...options, path, body });
36
+ }
37
+ if (args.flags.json === true)
38
+ console.log(JSON.stringify(result, null, 2));
39
+ else {
40
+ const policy = result.deployment_policy;
41
+ console.log(`${result.namespace}: ${policy.mode === 'manual' ? 'manual deployment' : `CI-managed (${policy.repository_id}, ${policy.branch}, ${policy.target_key})`}`);
42
+ }
43
+ return 0;
44
+ }
45
+ catch (error) {
46
+ printCliError(error);
47
+ return 1;
48
+ }
49
+ }
@@ -0,0 +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 seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n list the namespaces you can read\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";
@@ -0,0 +1,42 @@
1
+ import { INIT_INTO_REPO_HELP } from '../command-help.js';
2
+ export const ORM_USAGE = `usage:
3
+ seq-studio orm init <dir> [--repo <ns>/<name>]
4
+ scaffold a namespace package (v2: TypeScript schema + GraphQL documents);
5
+ --repo scaffolds into a git-service repo (see Init into a repo below)
6
+ seq-studio orm generate [dir] write schema.graphql + operations.manifest.json + typePolicies.gen.ts (offline; runs consumer codegen when codegen.ts is present)
7
+ seq-studio orm generate [dir] --migration-export [--check]
8
+ export reviewed ORM inputs for a coordinated pipeline migration; --check verifies without writing
9
+ seq-studio orm validate [dir] parse + validate definitions and verify committed migrations are in sync
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]
12
+ author the migration, register, apply, and refresh the generated outputs (the everyday command);
13
+ waits until the new version is live (default up to 20m; e.g. --timeout 90s), --no-wait returns once queued
14
+ seq-studio orm plan|apply --repo <ns>/<name> [--path <dir>] [--ref <ref>] -e <env>
15
+ plan/apply a namespace committed to a platform git-service repo (CI deploy-from-git);
16
+ --path selects the namespace directory (default: repo root). A remote apply never
17
+ authors migrations: the committed ledger must already match the definitions.
18
+ seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
19
+ run the deployed version's persisted operation by name as the caller (no checkout)
20
+ seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
21
+ execute from the checkout manifest through the installed ORM package
22
+ both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF
23
+ seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]
24
+ read rows of a deployed v2 namespace as the caller (row-level security applies)
25
+ seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]
26
+ run read-only SQL against a deployed v2 namespace as the caller
27
+ seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
28
+ list the namespaces you can read
29
+ seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci] [--repo <ns>/<name> --branch <branch> --target <target-key>] [--json]
30
+ inspect or explicitly change the namespace's deployment controller
31
+ seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]
32
+ show a namespace's tables, views, and persisted operations (with variables), or one table's columns and actions
33
+ 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)
34
+ seq-studio orm migrate-from-yaml <dir> convert a v1 YAML namespace to the v2 TypeScript format (offline; migrations/ preserved)
35
+ seq-studio orm import [dir] --spec <file> | --table <t> --from <schema.table> --map <target=source,...>
36
+ plan a batched copy from an existing Postgres relation into an owned table (writes a SQL script; no database connection)
37
+
38
+ Environments: see \`seq-studio envs list\` (built-in: local; more are
39
+ discovered after you authenticate).
40
+ Authenticate with: seq-studio login
41
+
42
+ ${INIT_INTO_REPO_HELP}`;
@@ -293,6 +293,11 @@ function serializeNodeMetadata(node) {
293
293
  }
294
294
  case 'subprocess': {
295
295
  const subprocess = node;
296
+ // Child title/entity mappers serialize only when authored, so existing
297
+ // bundles keep their hashes.
298
+ const childMappers = {};
299
+ serializeMapperSlot(childMappers, 'child_title_mapper', subprocess.child_title);
300
+ serializeMapperSlot(childMappers, 'child_entity_mapper', subprocess.child_entity);
296
301
  const smeta = {
297
302
  process_id: subprocess.process,
298
303
  version: subprocess.version ?? '',
@@ -304,6 +309,7 @@ function serializeNodeMetadata(node) {
304
309
  ...(subprocess.supervisor_retry !== undefined
305
310
  ? { supervisor_retry: serializeRetryConfig(subprocess.supervisor_retry) }
306
311
  : {}),
312
+ ...childMappers,
307
313
  };
308
314
  const meta = { subprocess: smeta };
309
315
  serializeMapperSlot(meta, 'input_mapper', subprocess.input);
@@ -171,6 +171,8 @@ function emitNode(node, ctx) {
171
171
  : null,
172
172
  bindings(m.bindings),
173
173
  mapper('input', m.input_mapper_source, m.input_mapper_expr, ctx),
174
+ mapper('child_title', sub.child_title_mapper_source, sub.child_title_mapper_expr, ctx),
175
+ mapper('child_entity', sub.child_entity_mapper_source, sub.child_entity_mapper_expr, ctx),
174
176
  requiredMapper('output', sub.output_mapper_source, sub.output_mapper_expr, ctx, `subprocess node "${node.id}"`),
175
177
  tail,
176
178
  ]);
@@ -241,6 +241,10 @@ const SUBPROCESS_BEHAVIORAL_FIELDS = [
241
241
  'on_child_error',
242
242
  'output_mapper_source',
243
243
  'output_mapper_expr',
244
+ 'child_title_mapper_source',
245
+ 'child_title_mapper_expr',
246
+ 'child_entity_mapper_source',
247
+ 'child_entity_mapper_expr',
244
248
  'supervisor_retry',
245
249
  ];
246
250
  function diffNode(a, b) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
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": {
@@ -43,17 +43,17 @@
43
43
  "smol-toml": "^1.9.0",
44
44
  "tsx": "^4.20.3",
45
45
  "yaml": "^2.8.4",
46
- "zod": "^4.1.13",
46
+ "zod": "4.6.6",
47
47
  "@sequenceholdings/agent-spec": "0.1.5",
48
- "@sequenceholdings/artifact-studio": "0.11.9",
49
- "@sequenceholdings/lattice": "0.1.8",
48
+ "@sequenceholdings/artifact-studio": "0.11.10",
50
49
  "@sequenceholdings/managed-functions": "0.5.8",
51
50
  "@sequenceholdings/storage": "0.1.6",
51
+ "@sequenceholdings/lattice": "0.1.8",
52
52
  "@sequenceholdings/platform": "0.1.3"
53
53
  },
54
54
  "peerDependencies": {
55
- "@sequenceholdings/orm": "2.8.5",
56
- "@sequenceholdings/pipeline-spec": "0.3.6"
55
+ "@sequenceholdings/pipeline-spec": "0.3.6",
56
+ "@sequenceholdings/orm": "2.8.5"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@sequenceholdings/orm": {