@sequenceholdings/studio-cli 0.5.4 → 0.6.0
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 +226 -7
- package/dist/agents/source.js +2 -1
- package/dist/app/adapters.js +2 -1
- package/dist/app/commands.js +4 -4
- package/dist/artifact/delegate.js +32 -12
- package/dist/atlas-client.d.ts +2 -1
- package/dist/atlas-client.js +7 -3
- package/dist/auth-cmds/commands.d.ts +1 -1
- package/dist/auth-cmds/commands.js +3 -0
- package/dist/auth.d.ts +2 -1
- package/dist/auth.js +16 -0
- package/dist/command-contract.d.ts +8 -8
- package/dist/command-contract.js +6 -6
- package/dist/command-help.d.ts +5 -4
- package/dist/command-help.js +41 -4
- package/dist/command-input.js +2 -2
- package/dist/config.d.ts +5 -0
- package/dist/config.js +14 -1
- package/dist/env-flags.d.ts +6 -0
- package/dist/env-flags.js +9 -0
- package/dist/functions/commands.d.ts +4 -1
- package/dist/functions/commands.js +63 -5
- package/dist/functions/deploy-preflight.js +2 -2
- package/dist/functions/manifest.d.ts +43 -29
- package/dist/functions/manifest.js +37 -74
- package/dist/main.js +42 -2
- package/dist/orm/delegate.js +25 -4
- package/dist/orm/read.d.ts +54 -0
- package/dist/orm/read.js +308 -0
- package/dist/pipeline/commands.js +30 -5
- package/dist/pipeline/discovery.js +3 -16
- package/dist/pipeline/lifecycle.js +37 -6
- package/dist/pipeline/retirement.d.ts +3 -0
- package/dist/pipeline/retirement.js +34 -0
- package/dist/pipeline/source.d.ts +21 -0
- package/dist/pipeline/source.js +76 -0
- package/dist/process/build.js +4 -0
- package/dist/process/codegen.js +2 -0
- package/dist/process/commands.js +57 -18
- package/dist/process/plan-diff.js +1 -0
- package/dist/process/runs.d.ts +14 -0
- package/dist/process/runs.js +238 -0
- package/dist/repos/ci-status.js +28 -0
- package/dist/repos/commands.js +11 -1
- package/dist/repos/git-credential.d.ts +3 -2
- package/dist/repos/git-credential.js +52 -3
- package/dist/repos/pulls.d.ts +7 -1
- package/dist/repos/pulls.js +162 -22
- package/dist/sandbox-auth.d.ts +52 -0
- package/dist/sandbox-auth.js +105 -0
- package/dist/storage/commands.js +6 -5
- package/dist/text-table.d.ts +7 -0
- package/dist/text-table.js +16 -0
- package/package.json +9 -9
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
export declare const COMMAND_CONTRACT: readonly [{
|
|
3
3
|
readonly name: "init";
|
|
4
4
|
readonly description: "Scaffold an app workspace or use a published template";
|
|
5
|
-
readonly lifecycle: "
|
|
5
|
+
readonly lifecycle: "preview";
|
|
6
6
|
readonly access: "mixed";
|
|
7
7
|
readonly subcommands: readonly [];
|
|
8
8
|
}, {
|
|
9
9
|
readonly name: "add";
|
|
10
10
|
readonly description: "Add a primitive to an app workspace";
|
|
11
|
-
readonly lifecycle: "
|
|
11
|
+
readonly lifecycle: "preview";
|
|
12
12
|
readonly access: "offline";
|
|
13
13
|
readonly subcommands: readonly [];
|
|
14
14
|
}, {
|
|
15
15
|
readonly name: "deploy";
|
|
16
16
|
readonly description: "Deploy an app workspace";
|
|
17
|
-
readonly lifecycle: "
|
|
17
|
+
readonly lifecycle: "preview";
|
|
18
18
|
readonly access: "authenticated";
|
|
19
19
|
readonly subcommands: readonly [];
|
|
20
20
|
}, {
|
|
@@ -22,7 +22,7 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
22
22
|
readonly description: "Build and operate Lattice processes";
|
|
23
23
|
readonly lifecycle: "preview";
|
|
24
24
|
readonly access: "mixed";
|
|
25
|
-
readonly subcommands: readonly ["init", "lint", "plan", "apply", "test", "simulate", "bundle", "promote", "pull", "safety-baseline"];
|
|
25
|
+
readonly subcommands: readonly ["init", "lint", "plan", "apply", "test", "simulate", "bundle", "promote", "pull", "runs", "safety-baseline"];
|
|
26
26
|
}, {
|
|
27
27
|
readonly name: "artifact";
|
|
28
28
|
readonly description: "Build and operate Artifact Studio apps";
|
|
@@ -76,7 +76,7 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
76
76
|
readonly description: "Author and operate ORM namespaces";
|
|
77
77
|
readonly lifecycle: "preview";
|
|
78
78
|
readonly access: "mixed";
|
|
79
|
-
readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "diff", "migrate-from-yaml", "import"];
|
|
79
|
+
readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "read", "sql", "diff", "migrate-from-yaml", "import"];
|
|
80
80
|
}, {
|
|
81
81
|
readonly name: "envs";
|
|
82
82
|
readonly description: "Manage CLI environments";
|
|
@@ -115,10 +115,10 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
115
115
|
readonly subcommands: readonly [];
|
|
116
116
|
}, {
|
|
117
117
|
readonly name: "storage";
|
|
118
|
-
readonly description: "Manage
|
|
119
|
-
readonly lifecycle: "
|
|
118
|
+
readonly description: "Manage Workspaces V2 file storage";
|
|
119
|
+
readonly lifecycle: "preview";
|
|
120
120
|
readonly access: "authenticated";
|
|
121
|
-
readonly subcommands: readonly ["init", "validate", "apply", "list", "show", "mkdir", "upload", "download", "access", "trash", "restore", "purge", "operations", "abort", "delete"];
|
|
121
|
+
readonly subcommands: readonly ["init", "validate", "apply", "list", "show", "mkdir", "upload", "import", "uploads", "reconcile", "download", "access", "trash", "restore", "purge", "operations", "abort", "delete"];
|
|
122
122
|
}, {
|
|
123
123
|
readonly name: "access";
|
|
124
124
|
readonly description: "Manage runtime resource access";
|
package/dist/command-contract.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** Machine-readable summary of the CLI surface, kept independent of command implementations. */
|
|
2
2
|
export const COMMAND_CONTRACT = [
|
|
3
|
-
{ name: 'init', description: 'Scaffold an app workspace or use a published template', lifecycle: '
|
|
4
|
-
{ name: 'add', description: 'Add a primitive to an app workspace', lifecycle: '
|
|
5
|
-
{ name: 'deploy', description: 'Deploy an app workspace', lifecycle: '
|
|
6
|
-
{ name: 'process', description: 'Build and operate Lattice processes', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'lint', 'plan', 'apply', 'test', 'simulate', 'bundle', 'promote', 'pull', 'safety-baseline'] },
|
|
3
|
+
{ name: 'init', description: 'Scaffold an app workspace or use a published template', lifecycle: 'preview', access: 'mixed', subcommands: [] },
|
|
4
|
+
{ name: 'add', description: 'Add a primitive to an app workspace', lifecycle: 'preview', access: 'offline', subcommands: [] },
|
|
5
|
+
{ name: 'deploy', description: 'Deploy an app workspace', lifecycle: 'preview', access: 'authenticated', subcommands: [] },
|
|
6
|
+
{ name: 'process', description: 'Build and operate Lattice processes', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'lint', 'plan', 'apply', 'test', 'simulate', 'bundle', 'promote', 'pull', 'runs', 'safety-baseline'] },
|
|
7
7
|
{ name: 'artifact', description: 'Build and operate Artifact Studio apps', lifecycle: 'stable', access: 'mixed', subcommands: ['init', 'whoami', 'link', 'env', 'status', 'list', 'show', 'validate', 'build', 'plan', 'deploy', 'dev', 'promote', 'pull', 'rollback'] },
|
|
8
8
|
{ name: 'functions', description: 'Build and operate Managed Functions', lifecycle: 'stable', access: 'authenticated', subcommands: ['init', 'build', 'deploy', 'list', 'show', 'limits', 'invoke', 'logs', 'promote', 'rollback', 'delete'] },
|
|
9
9
|
{ name: 'agents', description: 'Validate and deploy typed agent definitions', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'validate', 'bundle', 'plan', 'apply', 'list', 'show'] },
|
|
@@ -12,14 +12,14 @@ export const COMMAND_CONTRACT = [
|
|
|
12
12
|
{ name: 'templates', description: 'Publish, synchronize, and list repository templates', lifecycle: 'internal', access: 'mixed', subcommands: ['publish', 'sync', 'list'] },
|
|
13
13
|
{ 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', 'run-now', 'promote', 'rollback'] },
|
|
14
14
|
{ name: 'auth', description: 'Manage Git authentication', lifecycle: 'stable', access: 'authenticated', subcommands: ['whoami', 'git-credential', 'pat'] },
|
|
15
|
-
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'diff', 'migrate-from-yaml', 'import'] },
|
|
15
|
+
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
|
|
16
16
|
{ name: 'envs', description: 'Manage CLI environments', lifecycle: 'stable', access: 'mixed', subcommands: ['add', 'list'] },
|
|
17
17
|
{ name: 'login', description: 'Authenticate with Sequence', lifecycle: 'stable', access: 'public', subcommands: [] },
|
|
18
18
|
{ name: 'logout', description: 'Remove cached user tokens', lifecycle: 'stable', access: 'public', subcommands: [] },
|
|
19
19
|
{ name: 'doctor', description: 'Diagnose CLI configuration and access', lifecycle: 'stable', access: 'mixed', subcommands: [] },
|
|
20
20
|
{ name: 'version', description: 'Print the installed CLI version', lifecycle: 'stable', access: 'offline', subcommands: [] },
|
|
21
21
|
{ name: 'help', description: 'Show command help', lifecycle: 'stable', access: 'offline', subcommands: [] },
|
|
22
|
-
{ name: 'storage', description: 'Manage
|
|
22
|
+
{ name: 'storage', description: 'Manage Workspaces V2 file storage', lifecycle: 'preview', access: 'authenticated', subcommands: ['init', 'validate', 'apply', 'list', 'show', 'mkdir', 'upload', 'import', 'uploads', 'reconcile', 'download', 'access', 'trash', 'restore', 'purge', 'operations', 'abort', 'delete'] },
|
|
23
23
|
{ name: 'access', description: 'Manage runtime resource access', lifecycle: 'preview', access: 'authenticated', subcommands: ['definitions', 'list', 'grant', 'revoke', 'resolve'] },
|
|
24
24
|
{ name: 'service-accounts', description: 'Manage runtime service accounts', lifecycle: 'preview', access: 'authenticated', subcommands: ['list', 'show', 'create'] },
|
|
25
25
|
{ name: 'capabilities', description: 'Print the supported CLI command surface', lifecycle: 'blocked', access: 'offline', subcommands: [] },
|
package/dist/command-help.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
|
|
2
|
-
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm 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";
|
|
2
|
+
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm 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 read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n";
|
|
3
3
|
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n";
|
|
4
|
-
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
5
|
-
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a function shell without deploying\n seq-studio functions deploy -e <env> [-m msg] preflight
|
|
6
|
-
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 create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge> [args]
|
|
4
|
+
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>\n [--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]\n For an existing target release unit, source-env selects a separately\n authenticated canonical repository from banksouth, staging, or production.\n Registered OpCo source origins are not supported yet. The target verifies\n and snapshots source before planning; no target repository is created.\n Not compatible with --dir, existing IDs, or coordinated migrations.\n Rollback uses retained snapshots; historical source commits can be re-planned\n explicitly with deploy --ref <sha> --source-env <env>.\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
5
|
+
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a function shell without deploying\n seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP using your seq-studio login\n and repository read access. No PAT is needed. Headless M2M builds use JSON\n materialize and accept only platform-managed --repo sources. Use --env to\n select the same environment for source and deployment.\n";
|
|
6
|
+
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 create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
|
|
7
|
+
export declare const PROCESS_RUNS_USAGE = "usage:\n seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]\n [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]\n seq-studio process runs list -e <env> [--process <id>] [--status <status>]\n [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]\n seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start needs invoker on the process, show and\n list return only runs you can view, and cancel needs invoker on the process.\n --version pins a published process version; omitted, the active version runs.\n --run-id makes start idempotent: repeating it for the same process returns the\n existing run instead of starting another. --metadata-file is a JSON object\n stored on the run.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out.\n";
|
|
7
8
|
export declare function staticHelp({ namespace, sub }: {
|
|
8
9
|
namespace: string;
|
|
9
10
|
sub?: string;
|
package/dist/command-help.js
CHANGED
|
@@ -6,12 +6,17 @@ export const ORM_HELP = `usage:
|
|
|
6
6
|
seq-studio orm plan [dir] -e <env>
|
|
7
7
|
seq-studio orm apply [dir] -e <env>
|
|
8
8
|
seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
|
|
9
|
+
seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]
|
|
10
|
+
seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]
|
|
9
11
|
seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]
|
|
10
12
|
seq-studio orm migrate-from-yaml <dir>
|
|
11
13
|
seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>
|
|
12
14
|
|
|
13
15
|
-e/--env is required for commands that contact Atlas. Use seq-studio envs list
|
|
14
16
|
to discover environments and seq-studio login to authenticate.
|
|
17
|
+
read and sql query a v2 namespace as you through its built-in read-only SQL.
|
|
18
|
+
sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).
|
|
19
|
+
Run seq-studio orm read --help for the filter grammar, parameters, and output formats.
|
|
15
20
|
`;
|
|
16
21
|
export const ARTIFACT_HELP = `usage:
|
|
17
22
|
seq-studio artifact init <dir> [--template react-vite|nextjs]
|
|
@@ -43,6 +48,15 @@ export const PIPELINE_HELP = `usage:
|
|
|
43
48
|
seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]
|
|
44
49
|
seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]
|
|
45
50
|
seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...
|
|
51
|
+
seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>
|
|
52
|
+
[--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]
|
|
53
|
+
For an existing target release unit, source-env selects a separately
|
|
54
|
+
authenticated canonical repository from banksouth, staging, or production.
|
|
55
|
+
Registered OpCo source origins are not supported yet. The target verifies
|
|
56
|
+
and snapshots source before planning; no target repository is created.
|
|
57
|
+
Not compatible with --dir, existing IDs, or coordinated migrations.
|
|
58
|
+
Rollback uses retained snapshots; historical source commits can be re-planned
|
|
59
|
+
explicitly with deploy --ref <sha> --source-env <env>.
|
|
46
60
|
seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]
|
|
47
61
|
poll an existing durable plan without enqueueing or attaching credentials
|
|
48
62
|
Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now
|
|
@@ -58,7 +72,7 @@ export const FUNCTIONS_USAGE = `usage:
|
|
|
58
72
|
seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers
|
|
59
73
|
seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)
|
|
60
74
|
seq-studio functions register -e <env> [--dir d] register a function shell without deploying
|
|
61
|
-
seq-studio functions deploy -e <env> [-m msg] preflight
|
|
75
|
+
seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress
|
|
62
76
|
seq-studio functions list -e <env> [--match-local] functions visible on the environment
|
|
63
77
|
seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)
|
|
64
78
|
seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy
|
|
@@ -115,7 +129,8 @@ export const REPOS_USAGE = `usage:
|
|
|
115
129
|
configures login for subsequent git pull/push
|
|
116
130
|
seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]
|
|
117
131
|
materialize the tree at a ref (JSON API)
|
|
118
|
-
seq-studio repos pulls <list|show|create|diff|merge> [args]
|
|
132
|
+
seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]
|
|
133
|
+
review requests (see pulls --help)
|
|
119
134
|
seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)
|
|
120
135
|
seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults
|
|
121
136
|
seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs
|
|
@@ -139,10 +154,30 @@ export const REPOS_USAGE = `usage:
|
|
|
139
154
|
Authenticate JSON API calls with: seq-studio login
|
|
140
155
|
Authenticate git clone/push with: seq-studio login --env <env>
|
|
141
156
|
`;
|
|
157
|
+
export const PROCESS_RUNS_USAGE = `usage:
|
|
158
|
+
seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]
|
|
159
|
+
[--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]
|
|
160
|
+
seq-studio process runs list -e <env> [--process <id>] [--status <status>]
|
|
161
|
+
[--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]
|
|
162
|
+
seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]
|
|
163
|
+
seq-studio process runs cancel <run-id> -e <env> [--json]
|
|
164
|
+
|
|
165
|
+
Runs start and are read as you: start needs invoker on the process, show and
|
|
166
|
+
list return only runs you can view, and cancel needs invoker on the process.
|
|
167
|
+
--version pins a published process version; omitted, the active version runs.
|
|
168
|
+
--run-id makes start idempotent: repeating it for the same process returns the
|
|
169
|
+
existing run instead of starting another. --metadata-file is a JSON object
|
|
170
|
+
stored on the run.
|
|
171
|
+
list returns the newest runs first, up to --limit (default 50, max 500); the run
|
|
172
|
+
API has no cursor, so narrow with filters to reach older runs.
|
|
173
|
+
--status: pending, running, completed, failed, cancelled, timed_out.
|
|
174
|
+
show --wait polls until the run finishes (default timeout 600s); the run keeps
|
|
175
|
+
going if the wait times out.
|
|
176
|
+
`;
|
|
142
177
|
export function staticHelp({ namespace, sub }) {
|
|
143
178
|
if (namespace === 'artifact')
|
|
144
179
|
return ARTIFACT_HELP;
|
|
145
|
-
if (namespace === 'orm')
|
|
180
|
+
if (namespace === 'orm' && sub !== 'read' && sub !== 'sql')
|
|
146
181
|
return ORM_HELP;
|
|
147
182
|
if (namespace === 'pipeline')
|
|
148
183
|
return PIPELINE_HELP;
|
|
@@ -153,8 +188,10 @@ export function staticHelp({ namespace, sub }) {
|
|
|
153
188
|
if (namespace === 'doctor') {
|
|
154
189
|
return `usage: seq-studio doctor [-e <env>] [--json] [--offline]\n\nDiagnose config, auth, local service availability, CLI/SDK resolution, and deployment access. --offline reads local metadata without discovery or HTTP requests. Help is available offline.\n`;
|
|
155
190
|
}
|
|
191
|
+
if (namespace === 'process' && sub === 'runs')
|
|
192
|
+
return PROCESS_RUNS_USAGE;
|
|
156
193
|
if (namespace === 'process' && (!sub || sub === 'help' || sub === '--help' || sub === '-h')) {
|
|
157
|
-
return `usage: seq-studio process <init|lint|plan|apply|promote|pull|test|simulate|bundle> [args]\n\nHelp is available offline.\n`;
|
|
194
|
+
return `usage: seq-studio process <init|lint|plan|apply|promote|pull|runs|test|simulate|bundle> [args]\n\nHelp is available offline.\n`;
|
|
158
195
|
}
|
|
159
196
|
return undefined;
|
|
160
197
|
}
|
package/dist/command-input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { REQUIRE_EXPLICIT_ENV_MESSAGE } from './env-flags.js';
|
|
1
|
+
import { REQUIRE_EXPLICIT_ENV_MESSAGE, explicitOrSandboxEnv } from './env-flags.js';
|
|
2
2
|
/** Validate before authentication: a typo must never silently widen a mutation. */
|
|
3
3
|
export function validateCommandInput({ args, flags, positional, }) {
|
|
4
4
|
const allowed = { ...flags, env: 'string', e: 'string', json: 'boolean' };
|
|
@@ -16,7 +16,7 @@ export function validateCommandInput({ args, flags, positional, }) {
|
|
|
16
16
|
.filter((value) => typeof value === 'string');
|
|
17
17
|
if (new Set(envs).size > 1)
|
|
18
18
|
throw new Error('Specify only one environment per command.');
|
|
19
|
-
if (envs.length === 0)
|
|
19
|
+
if (envs.length === 0 && !explicitOrSandboxEnv(undefined))
|
|
20
20
|
throw new Error(REQUIRE_EXPLICIT_ENV_MESSAGE);
|
|
21
21
|
if (args.positional.length !== positional) {
|
|
22
22
|
throw new Error(`Expected ${positional} positional argument(s). See --help.`);
|
package/dist/config.d.ts
CHANGED
|
@@ -75,3 +75,8 @@ export declare function addSharedLoginEnvironment({ name, baseUrl: rawBaseUrl, f
|
|
|
75
75
|
export declare function resolveConfiguredEnv({ requested, }: {
|
|
76
76
|
requested?: string;
|
|
77
77
|
}): Promise<ResolvedEnv>;
|
|
78
|
+
/**
|
|
79
|
+
* In sandbox token mode the deployment comes from SEQ_STUDIO_BASE_URL and any
|
|
80
|
+
* `-e` value is ignored: the sandbox can reach no other origin.
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolveSandboxEnv(): ResolvedEnv | null;
|
package/dist/config.js
CHANGED
|
@@ -9,6 +9,7 @@ import { validateDeploymentBaseUrl } from '@sequenceholdings/artifact-studio/dep
|
|
|
9
9
|
import { isSequenceAuthEnvName, isSharedLoginDeploymentName, usesSharedSequenceLogin } from './auth.js';
|
|
10
10
|
import { fetchDeploymentLogin, readRegisteredEnvironmentUrls } from './env-registry.js';
|
|
11
11
|
import { resolvePreviewFromSlug } from './preview.js';
|
|
12
|
+
import { SANDBOX_ENV_NAME, sandboxTarget } from './sandbox-auth.js';
|
|
12
13
|
/**
|
|
13
14
|
* `--env preview:<branch-or-slug>` targets a per-PR Vercel preview deployment
|
|
14
15
|
* without a config.toml entry. The slug after the prefix is run through the
|
|
@@ -187,6 +188,9 @@ export function manualEnvConfigHint() {
|
|
|
187
188
|
* the configured envs when the name does not resolve.
|
|
188
189
|
*/
|
|
189
190
|
export function resolveEnv({ config, requested, }) {
|
|
191
|
+
const sandbox = resolveSandboxEnv();
|
|
192
|
+
if (sandbox)
|
|
193
|
+
return sandbox;
|
|
190
194
|
const name = requested ?? config.defaultEnv;
|
|
191
195
|
if (name.startsWith(PREVIEW_ENV_PREFIX)) {
|
|
192
196
|
const { slug, url } = resolvePreviewFromSlug(name.slice(PREVIEW_ENV_PREFIX.length));
|
|
@@ -239,5 +243,14 @@ export async function addSharedLoginEnvironment({ name, baseUrl: rawBaseUrl, fet
|
|
|
239
243
|
}
|
|
240
244
|
/** Resolve `--env <name>` against the config on disk. */
|
|
241
245
|
export async function resolveConfiguredEnv({ requested, }) {
|
|
242
|
-
|
|
246
|
+
// Checked before readConfig so a sandbox never reads ~/.config or the registry.
|
|
247
|
+
return resolveSandboxEnv() ?? resolveEnv({ config: await readConfig(), requested });
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* In sandbox token mode the deployment comes from SEQ_STUDIO_BASE_URL and any
|
|
251
|
+
* `-e` value is ignored: the sandbox can reach no other origin.
|
|
252
|
+
*/
|
|
253
|
+
export function resolveSandboxEnv() {
|
|
254
|
+
const sandbox = sandboxTarget();
|
|
255
|
+
return sandbox ? { name: SANDBOX_ENV_NAME, url: sandbox.baseUrl } : null;
|
|
243
256
|
}
|
package/dist/env-flags.d.ts
CHANGED
|
@@ -8,3 +8,9 @@ export declare const REQUIRE_EXPLICIT_ENV_MESSAGE = "You must specify an environ
|
|
|
8
8
|
export declare function normalizeShortEnvFlag(argv: readonly string[]): string[];
|
|
9
9
|
/** Only valid AFTER normalizeShortEnvFlag — recognizes the two-token form. */
|
|
10
10
|
export declare function readEnvFromArgv(rest: readonly string[]): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The environment a network command targets: the explicit `-e` value, or the
|
|
13
|
+
* sandbox in sandbox token mode, where SEQ_STUDIO_BASE_URL already names the
|
|
14
|
+
* deployment and `-e` is optional (and ignored).
|
|
15
|
+
*/
|
|
16
|
+
export declare function explicitOrSandboxEnv(requested: string | undefined): string | undefined;
|
package/dist/env-flags.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* CLIs only recognize the two-token `--env <value>` form, so every `-e value`
|
|
4
4
|
* / `-e=value` / `--env=value` spelling is rewritten before forwarding.
|
|
5
5
|
*/
|
|
6
|
+
import { SANDBOX_ENV_NAME, isSandboxTokenMode } from './sandbox-auth.js';
|
|
6
7
|
/** Shared copy for network commands that must not silently fall back to `local`. */
|
|
7
8
|
export const REQUIRE_EXPLICIT_ENV_MESSAGE = 'You must specify an environment you have access to with `-e <env>`. Run `seq-studio envs list` to see available environments.';
|
|
8
9
|
export function normalizeShortEnvFlag(argv) {
|
|
@@ -47,3 +48,11 @@ export function readEnvFromArgv(rest) {
|
|
|
47
48
|
}
|
|
48
49
|
return undefined;
|
|
49
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* The environment a network command targets: the explicit `-e` value, or the
|
|
53
|
+
* sandbox in sandbox token mode, where SEQ_STUDIO_BASE_URL already names the
|
|
54
|
+
* deployment and `-e` is optional (and ignored).
|
|
55
|
+
*/
|
|
56
|
+
export function explicitOrSandboxEnv(requested) {
|
|
57
|
+
return isSandboxTokenMode() ? SANDBOX_ENV_NAME : requested;
|
|
58
|
+
}
|
|
@@ -11,6 +11,7 @@ export interface FunctionSummary {
|
|
|
11
11
|
description: string | null;
|
|
12
12
|
runtime: string;
|
|
13
13
|
activeVersionId?: string | null;
|
|
14
|
+
immutableRelease?: boolean;
|
|
14
15
|
deployed: boolean;
|
|
15
16
|
secretsNeedDeploy?: boolean;
|
|
16
17
|
currentUserAccess: string | null;
|
|
@@ -69,12 +70,14 @@ export declare function printError(error: unknown): void;
|
|
|
69
70
|
export declare function functionsInitCommand(args: ParsedArgs): Promise<number>;
|
|
70
71
|
export declare function functionsBuildCommand(args: ParsedArgs): Promise<number>;
|
|
71
72
|
export declare function functionsDeployCommand(args: ParsedArgs): Promise<number>;
|
|
72
|
-
export declare function pollVersion({ ctx, functionId, versionId, egressNote, }: {
|
|
73
|
+
export declare function pollVersion({ ctx, functionId, versionId, egressNote, immutableRelease, }: {
|
|
73
74
|
ctx: CommandContext;
|
|
74
75
|
functionId: string;
|
|
75
76
|
versionId: string;
|
|
76
77
|
/** Print the egress-propagation hint once the version is live. */
|
|
77
78
|
egressNote?: boolean;
|
|
79
|
+
/** Require platform-recorded immutable activation rather than authored YAML alone. */
|
|
80
|
+
immutableRelease?: boolean;
|
|
78
81
|
}): Promise<number>;
|
|
79
82
|
export declare function functionsListCommand(args: ParsedArgs): Promise<number>;
|
|
80
83
|
export declare function functionsShowCommand(args: ParsedArgs): Promise<number>;
|
|
@@ -9,12 +9,13 @@ import { Writable } from 'node:stream';
|
|
|
9
9
|
import { load as parseYaml } from 'js-yaml';
|
|
10
10
|
import { MANAGED_FUNCTION_LIMITS, MF_LIMITS_DEFAULTS } from '@sequenceholdings/managed-functions/config';
|
|
11
11
|
import { getAccessTokenWithMode, tryGetAccessTokenWithMode } from '../auth.js';
|
|
12
|
+
import { sourceAuthMode } from '../sandbox-auth.js';
|
|
12
13
|
import { resolveConfiguredEnv } from '../config.js';
|
|
13
14
|
import { AtlasApiError, deleteJson, getJson, postJson, postJsonResponse, } from '../atlas-client.js';
|
|
14
15
|
import { clarifyApplyFailureReason, printCliError } from '../cli-errors.js';
|
|
15
16
|
import { currentVersion } from '../update-check.js';
|
|
16
17
|
import { localSdkPreflight, preflightBeforeUpload, reportPreflight } from './deploy-preflight.js';
|
|
17
|
-
import { REQUIRE_EXPLICIT_ENV_MESSAGE } from '../env-flags.js';
|
|
18
|
+
import { REQUIRE_EXPLICIT_ENV_MESSAGE, explicitOrSandboxEnv } from '../env-flags.js';
|
|
18
19
|
import { confirmYes } from '../prompt.js';
|
|
19
20
|
import { writeScaffoldGuidance } from '../scaffold-guidance.js';
|
|
20
21
|
import { collectBundleFiles, isDirectory, validateLocalBundle, } from './bundle.js';
|
|
@@ -29,11 +30,29 @@ const execFileAsync = promisify(execFile);
|
|
|
29
30
|
export const LOG = '[seq-studio]';
|
|
30
31
|
const POLL_INTERVAL_MS = 5_000;
|
|
31
32
|
const POLL_TIMEOUT_MS = 20 * 60 * 1000;
|
|
33
|
+
const DEPLOY_PROGRESS_STAGES = new Set([
|
|
34
|
+
'prepare', 'build', 'identity', 'subnet', 'cache', 'secrets',
|
|
35
|
+
'publish', 'egress', 'readiness', 'activate', 'revoke',
|
|
36
|
+
]);
|
|
37
|
+
/** Only print known lifecycle fields for the version this poller is waiting on. */
|
|
38
|
+
function lifecycleProgress(lifecycle, versionId) {
|
|
39
|
+
if (lifecycle.desiredVersionId !== versionId || lifecycle.operation?.kind !== 'deploy')
|
|
40
|
+
return null;
|
|
41
|
+
const stage = lifecycle.stage;
|
|
42
|
+
if (!stage || !DEPLOY_PROGRESS_STAGES.has(stage))
|
|
43
|
+
return null;
|
|
44
|
+
const recovery = lifecycle.status === 'failed'
|
|
45
|
+
? lifecycle.operation.status === 'queued' || lifecycle.operation.status === 'running'
|
|
46
|
+
? ' — recovery in progress'
|
|
47
|
+
: ' — recovery stopped'
|
|
48
|
+
: '';
|
|
49
|
+
return `${LOG} lifecycle stage: ${stage}${recovery}`;
|
|
50
|
+
}
|
|
32
51
|
export function flagBool(flags, ...keys) {
|
|
33
52
|
return keys.some((key) => flags[key] === true || flags[key] === 'true');
|
|
34
53
|
}
|
|
35
54
|
export function requestedEnvironment(args) {
|
|
36
|
-
return ((typeof args.flags.env === 'string' ? args.flags.env : undefined) ??
|
|
55
|
+
return explicitOrSandboxEnv((typeof args.flags.env === 'string' ? args.flags.env : undefined) ??
|
|
37
56
|
(typeof args.flags.e === 'string' ? args.flags.e : undefined));
|
|
38
57
|
}
|
|
39
58
|
/**
|
|
@@ -58,7 +77,7 @@ export function clientOptions(ctx) {
|
|
|
58
77
|
}
|
|
59
78
|
function sourceClientOptions(ctx) {
|
|
60
79
|
return {
|
|
61
|
-
...(ctx.authMode ? { authMode: ctx.authMode } : {}),
|
|
80
|
+
...(ctx.authMode ? { authMode: sourceAuthMode(ctx.authMode) } : {}),
|
|
62
81
|
...clientOptions(ctx),
|
|
63
82
|
};
|
|
64
83
|
}
|
|
@@ -71,7 +90,7 @@ async function buildSourceOptions({ args, spec, }) {
|
|
|
71
90
|
failClosedForM2m: true,
|
|
72
91
|
env: requestedEnvironment(args),
|
|
73
92
|
});
|
|
74
|
-
return auth ? { authMode: auth.authMode } : {};
|
|
93
|
+
return auth ? { authMode: sourceAuthMode(auth.authMode) } : {};
|
|
75
94
|
}
|
|
76
95
|
return {};
|
|
77
96
|
}
|
|
@@ -540,6 +559,14 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
540
559
|
path: `/api/managed-functions?slug=${encodeURIComponent(slug)}`,
|
|
541
560
|
});
|
|
542
561
|
const existingShell = functions.find((f) => f.slug === slug) ?? null;
|
|
562
|
+
if (existingShell?.immutableRelease === true) {
|
|
563
|
+
console.error(`${LOG} this function is an immutable release. Create a new function ID; this identity cannot be redeployed.`);
|
|
564
|
+
return 1;
|
|
565
|
+
}
|
|
566
|
+
if (manifest.function.immutable_release === true && existingShell?.activeVersionId) {
|
|
567
|
+
console.error(`${LOG} immutable release opt-in must precede first activation. Create a new function ID.`);
|
|
568
|
+
return 1;
|
|
569
|
+
}
|
|
543
570
|
const shellAction = existingShell
|
|
544
571
|
? `existing shell on ${ctx.env.name}`
|
|
545
572
|
: `will register new shell on ${ctx.env.name}`;
|
|
@@ -755,6 +782,11 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
755
782
|
}
|
|
756
783
|
catch (error) {
|
|
757
784
|
if (error instanceof AtlasApiError && error.status === 409) {
|
|
785
|
+
if (typeof error.body === 'object' && error.body !== null &&
|
|
786
|
+
Reflect.get(error.body, 'code') === 'IMMUTABLE_FUNCTION_RELEASE') {
|
|
787
|
+
console.error(`${LOG} ${error.message}`);
|
|
788
|
+
return 1;
|
|
789
|
+
}
|
|
758
790
|
console.error(`${LOG} version ${nextVersion} already exists — another deploy may have raced. Re-run deploy to allocate the next version.`);
|
|
759
791
|
return 1;
|
|
760
792
|
}
|
|
@@ -772,13 +804,15 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
772
804
|
ctx,
|
|
773
805
|
functionId: fn.id,
|
|
774
806
|
versionId: version.id,
|
|
807
|
+
immutableRelease: manifest.function.immutable_release === true,
|
|
775
808
|
egressNote: manifestEgressHosts(manifest.egress).length > 0 ||
|
|
776
809
|
manifestEgressIpRanges(manifest.egress).length > 0,
|
|
777
810
|
});
|
|
778
811
|
}
|
|
779
|
-
export async function pollVersion({ ctx, functionId, versionId, egressNote = false, }) {
|
|
812
|
+
export async function pollVersion({ ctx, functionId, versionId, egressNote = false, immutableRelease = false, }) {
|
|
780
813
|
const deadline = Date.now() + POLL_TIMEOUT_MS;
|
|
781
814
|
let lastStatus = '';
|
|
815
|
+
let lastProgress = '';
|
|
782
816
|
for (;;) {
|
|
783
817
|
const { version } = await getJson({
|
|
784
818
|
...clientOptions(ctx),
|
|
@@ -788,7 +822,31 @@ export async function pollVersion({ ctx, functionId, versionId, egressNote = fal
|
|
|
788
822
|
lastStatus = version.status;
|
|
789
823
|
console.log(`${LOG} status: ${version.status}`);
|
|
790
824
|
}
|
|
825
|
+
if (version.status === 'building') {
|
|
826
|
+
try {
|
|
827
|
+
const lifecycle = await getJson({
|
|
828
|
+
...clientOptions(ctx),
|
|
829
|
+
path: `/api/managed-functions/${functionId}/lifecycle`,
|
|
830
|
+
});
|
|
831
|
+
const progress = lifecycleProgress(lifecycle, versionId);
|
|
832
|
+
if (progress && progress !== lastProgress) {
|
|
833
|
+
lastProgress = progress;
|
|
834
|
+
console.log(progress);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
catch {
|
|
838
|
+
// Lifecycle status may be unavailable to this caller or older Atlas.
|
|
839
|
+
// The version endpoint remains authoritative for deploy completion.
|
|
840
|
+
}
|
|
841
|
+
}
|
|
791
842
|
if (version.status === 'deployed') {
|
|
843
|
+
if (immutableRelease) {
|
|
844
|
+
const detail = await getFunctionDetail(ctx, functionId);
|
|
845
|
+
if (detail?.function.immutableRelease !== true || detail.function.activeVersionId !== versionId) {
|
|
846
|
+
console.error(`${LOG} the platform did not confirm immutable activation of this exact version. Verify the full runtime rollout before using this release; an already active mutable identity needs a new function ID.`);
|
|
847
|
+
return 1;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
792
850
|
console.log(`${LOG} ✓ ${version.version} is live`);
|
|
793
851
|
if (egressNote) {
|
|
794
852
|
console.log(egressPropagationNote(LOG));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import { parseDeployedPolicy, preflightManagedFunction,
|
|
3
|
+
import { parseDeployedPolicy, preflightManagedFunction, sdkSpecFromPackageJson, } from '@sequenceholdings/managed-functions/config';
|
|
4
4
|
import { AtlasApiError, getJson } from '../atlas-client.js';
|
|
5
5
|
import { LOG } from '../cli-errors.js';
|
|
6
6
|
/**
|
|
@@ -46,7 +46,7 @@ export function reportPreflight(issues) {
|
|
|
46
46
|
}
|
|
47
47
|
async function declaredSdkVersion(rootDir) {
|
|
48
48
|
try {
|
|
49
|
-
return
|
|
49
|
+
return sdkSpecFromPackageJson(await readFile(join(rootDir, 'package.json'), 'utf8'));
|
|
50
50
|
}
|
|
51
51
|
catch (error) {
|
|
52
52
|
if (isMissingFile(error))
|