@sequenceholdings/studio-cli 0.4.5 → 0.4.6
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 +9 -1
- package/dist/command-help.d.ts +2 -0
- package/dist/command-help.js +89 -0
- package/dist/functions/commands.d.ts +0 -1
- package/dist/functions/commands.js +1 -47
- package/dist/functions/deploy-preflight.d.ts +1 -1
- package/dist/functions/deploy-preflight.js +2 -1
- package/dist/functions/manifest.d.ts +3 -0
- package/dist/functions/manifest.js +27 -17
- package/dist/repos/commands.d.ts +0 -1
- package/dist/repos/commands.js +1 -38
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -21,9 +21,11 @@ seq-studio doctor
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
> **Note:** all network commands require a Sequence platform account with the
|
|
24
|
-
> appropriate permissions. Without one,
|
|
24
|
+
> appropriate permissions. Without one, the offline commands
|
|
25
25
|
> (`init`, `lint`, `simulate`, `build`, `bundle inspect`, `agents init`,
|
|
26
26
|
> `agents validate`, offline `agents plan`, `pipeline init`, `pipeline validate`) work.
|
|
27
|
+
> Repo and function command help is also available without an account; for
|
|
28
|
+
> example, `seq-studio repos create --help` and `seq-studio functions invoke --help`.
|
|
27
29
|
> Sequence-internal contributors: see `INTERNAL.md` in the monorepo for
|
|
28
30
|
> rollout SOPs, preview environments, and publishing docs.
|
|
29
31
|
|
|
@@ -901,6 +903,9 @@ seq-studio process lint --dir my-processes --offline # finds both processes
|
|
|
901
903
|
|
|
902
904
|
## Managed Function commands
|
|
903
905
|
|
|
906
|
+
Add `--help` to a function command to read its usage offline, without an
|
|
907
|
+
environment, credentials, or `managed-function.yml`.
|
|
908
|
+
|
|
904
909
|
| Command | What it does |
|
|
905
910
|
|---------|--------------|
|
|
906
911
|
| `seq-studio functions init <dir>` | Scaffold one standalone TypeScript managed function |
|
|
@@ -1501,6 +1506,9 @@ The raw token is printed **once** on create.
|
|
|
1501
1506
|
|
|
1502
1507
|
## Repos commands
|
|
1503
1508
|
|
|
1509
|
+
Add `--help` to a repo command to read its usage offline, without an
|
|
1510
|
+
environment or credentials.
|
|
1511
|
+
|
|
1504
1512
|
`repos create` creates the hosted repository; it does not configure Git in your
|
|
1505
1513
|
current folder. For a new local checkout, use `repos clone` with `ATLAS_GIT_PAT`
|
|
1506
1514
|
and `--full` to get `origin`, branch tracking, and complete history for your
|
package/dist/command-help.d.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
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";
|
|
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
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 deployed capabilities, then upload and deploy\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 and require a repo:read git\n PAT in ATLAS_GIT_PAT (`seq-studio auth pat create --scopes repo:read`, or\n Atlas \u2192 Settings \u2192 Tokens). Headless M2M builds use JSON materialize and\n accept only platform-managed --repo sources. Interactive builds also need\n --env + seq-studio login to resolve the repo and deploy.\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 smart-HTTP when ATLAS_GIT_PAT is set;\n otherwise JSON materialize (<ns>/<name>)\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] 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 show <ns>/<name> -e <env> [--ref r] preview discovered CI checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> reserved (refuses write until sandboxed runner)\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] reserved (refuses write until sandboxed runner)\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone prefers real git clone (PAT via askpass \u2014 never written into the remote\n URL). --transport auto (default) uses Git when ATLAS_GIT_PAT is set and JSON\n materialization otherwise; --transport git requires a repo:read PAT; --transport\n json ignores ATLAS_GIT_PAT and uses the signed-in Atlas identity (<ns>/<name>\n only; no .git directory). Authentication failures explain this retry path.\n JSON materialization requires repo read access and prints how to create a PAT.\n PAT without Auth0 login: use --id from Repositories \u2192 Clone\n (or --url with the environment's canonical HTTPS origin).\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: ATLAS_GIT_PAT (from Atlas Settings \u2192 Tokens)\n";
|
|
5
7
|
export declare function staticHelp({ namespace, sub }: {
|
|
6
8
|
namespace: string;
|
|
7
9
|
sub?: string;
|
package/dist/command-help.js
CHANGED
|
@@ -54,6 +54,91 @@ export const PIPELINE_HELP = `usage:
|
|
|
54
54
|
--target chooses a logical target when the environment has more than one.
|
|
55
55
|
Help is available offline.
|
|
56
56
|
`;
|
|
57
|
+
export const FUNCTIONS_USAGE = `usage:
|
|
58
|
+
seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers
|
|
59
|
+
seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)
|
|
60
|
+
seq-studio functions register -e <env> [--dir d] register a function shell without deploying
|
|
61
|
+
seq-studio functions deploy -e <env> [-m msg] preflight deployed capabilities, then upload and deploy
|
|
62
|
+
seq-studio functions list -e <env> [--match-local] functions visible on the environment
|
|
63
|
+
seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)
|
|
64
|
+
seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy
|
|
65
|
+
[--fn slug] also show effective runtime limits (requires -e)
|
|
66
|
+
seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context
|
|
67
|
+
seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]
|
|
68
|
+
invoke a function and print its response
|
|
69
|
+
seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)
|
|
70
|
+
seq-studio functions promote <version> -e <env> make a version live
|
|
71
|
+
seq-studio functions rollback [<version>] -e <env> redeploy a prior version
|
|
72
|
+
seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime
|
|
73
|
+
(version history is retained)
|
|
74
|
+
|
|
75
|
+
Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) · --fn <slug> · --dir <path>
|
|
76
|
+
--path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo
|
|
77
|
+
--from-env-file <path> (default: .env) source file for secret values
|
|
78
|
+
--no-wait · --yes
|
|
79
|
+
--no-provision (deploy) update-only: error instead of registering a new
|
|
80
|
+
shell, writing secret values, or attaching secrets (CI sweep)
|
|
81
|
+
|
|
82
|
+
Local Atlas builds and runs deployed functions on this computer, including teardown.
|
|
83
|
+
"functions dev" runs a standalone handler without Atlas registration.
|
|
84
|
+
|
|
85
|
+
Configure per-function CPU and concurrency in managed-function.yml under limits.
|
|
86
|
+
Run "functions limits" for valid settings; redeploy to apply manifest changes.
|
|
87
|
+
Invocation rates are shared across Atlas replicas; 429 includes Retry-After.
|
|
88
|
+
If the shared rate limiter is unavailable, invocation fails closed with 503.
|
|
89
|
+
|
|
90
|
+
Source for build/deploy: a local --dir (default .), a platform git-service
|
|
91
|
+
repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects
|
|
92
|
+
a function directory within a remote repo; omit it for the existing root-manifest
|
|
93
|
+
layout. --ref selects a branch/tag/commit (default: the repo's default branch).
|
|
94
|
+
Remote sources record the pinned commit as provenance (never dirty) and NEVER
|
|
95
|
+
read a repo-committed .env for secret values — provision secrets server-side
|
|
96
|
+
or pass a local --from-env-file (resolved against your cwd).
|
|
97
|
+
|
|
98
|
+
Interactive --repo builds clone over smart-HTTP and require a repo:read git
|
|
99
|
+
PAT in ATLAS_GIT_PAT (\`seq-studio auth pat create --scopes repo:read\`, or
|
|
100
|
+
Atlas → Settings → Tokens). Headless M2M builds use JSON materialize and
|
|
101
|
+
accept only platform-managed --repo sources. Interactive builds also need
|
|
102
|
+
--env + seq-studio login to resolve the repo and deploy.
|
|
103
|
+
`;
|
|
104
|
+
export const REPOS_USAGE = `usage:
|
|
105
|
+
seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment
|
|
106
|
+
seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces
|
|
107
|
+
seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)
|
|
108
|
+
seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]
|
|
109
|
+
create a repo seeded with a README; --git-backend
|
|
110
|
+
walgit creates it empty (for pushing existing
|
|
111
|
+
history); needs namespace write
|
|
112
|
+
seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]
|
|
113
|
+
seq-studio repos clone --url <https://…/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]
|
|
114
|
+
seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]
|
|
115
|
+
smart-HTTP when ATLAS_GIT_PAT is set;
|
|
116
|
+
otherwise JSON materialize (<ns>/<name>)
|
|
117
|
+
seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]
|
|
118
|
+
materialize the tree at a ref (JSON API)
|
|
119
|
+
seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)
|
|
120
|
+
seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)
|
|
121
|
+
seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview discovered CI checks
|
|
122
|
+
seq-studio repos ci require <ns>/<name> --check <name> -e <env> reserved (refuses write until sandboxed runner)
|
|
123
|
+
seq-studio repos ci import <ns>/<name> -e <env> [--ref r] reserved (refuses write until sandboxed runner)
|
|
124
|
+
|
|
125
|
+
Flags: -e/--env <env> (required; see: seq-studio envs list)
|
|
126
|
+
|
|
127
|
+
clone prefers real git clone (PAT via askpass — never written into the remote
|
|
128
|
+
URL). --transport auto (default) uses Git when ATLAS_GIT_PAT is set and JSON
|
|
129
|
+
materialization otherwise; --transport git requires a repo:read PAT; --transport
|
|
130
|
+
json ignores ATLAS_GIT_PAT and uses the signed-in Atlas identity (<ns>/<name>
|
|
131
|
+
only; no .git directory). Authentication failures explain this retry path.
|
|
132
|
+
JSON materialization requires repo read access and prints how to create a PAT.
|
|
133
|
+
PAT without Auth0 login: use --id from Repositories → Clone
|
|
134
|
+
(or --url with the environment's canonical HTTPS origin).
|
|
135
|
+
--ref accepts a branch, tag, or commit SHA (SHA → full clone, then checkout).
|
|
136
|
+
Branch and tag clones are shallow (--depth 1). Pass --full for history.
|
|
137
|
+
--output selects the clone directory (--out remains an alias).
|
|
138
|
+
|
|
139
|
+
Authenticate JSON API calls with: seq-studio login
|
|
140
|
+
Authenticate git clone/push with: ATLAS_GIT_PAT (from Atlas Settings → Tokens)
|
|
141
|
+
`;
|
|
57
142
|
export function staticHelp({ namespace, sub }) {
|
|
58
143
|
if (namespace === 'artifact')
|
|
59
144
|
return ARTIFACT_HELP;
|
|
@@ -61,6 +146,10 @@ export function staticHelp({ namespace, sub }) {
|
|
|
61
146
|
return ORM_HELP;
|
|
62
147
|
if (namespace === 'pipeline')
|
|
63
148
|
return PIPELINE_HELP;
|
|
149
|
+
if (namespace === 'functions')
|
|
150
|
+
return FUNCTIONS_USAGE;
|
|
151
|
+
if (namespace === 'repos' && sub !== 'pulls' && sub !== 'ci')
|
|
152
|
+
return REPOS_USAGE;
|
|
64
153
|
if (namespace === 'doctor') {
|
|
65
154
|
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`;
|
|
66
155
|
}
|
|
@@ -93,5 +93,4 @@ export declare function functionsRollbackCommand(args: ParsedArgs): Promise<numb
|
|
|
93
93
|
/** Minimal dotenv parser — KEY=VALUE lines, quotes stripped, comments skipped. */
|
|
94
94
|
export declare function parseDotenv(content: string): Record<string, string>;
|
|
95
95
|
export declare function functionsDeleteCommand(args: ParsedArgs): Promise<number>;
|
|
96
|
-
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 deployed capabilities, then upload and deploy\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 and require a repo:read git\n PAT in ATLAS_GIT_PAT (`seq-studio auth pat create --scopes repo:read`, or\n Atlas \u2192 Settings \u2192 Tokens). Headless M2M builds use JSON materialize and\n accept only platform-managed --repo sources. Interactive builds also need\n --env + seq-studio login to resolve the repo and deploy.\n";
|
|
97
96
|
export declare function runFunctionsCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FUNCTIONS_USAGE } from '../command-help.js';
|
|
1
2
|
import { execFile } from 'node:child_process';
|
|
2
3
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
3
4
|
import { existsSync } from 'node:fs';
|
|
@@ -1165,53 +1166,6 @@ export async function functionsDeleteCommand(args) {
|
|
|
1165
1166
|
// ---------------------------------------------------------------------------
|
|
1166
1167
|
// dispatcher
|
|
1167
1168
|
// ---------------------------------------------------------------------------
|
|
1168
|
-
export const FUNCTIONS_USAGE = `usage:
|
|
1169
|
-
seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers
|
|
1170
|
-
seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)
|
|
1171
|
-
seq-studio functions register -e <env> [--dir d] register a function shell without deploying
|
|
1172
|
-
seq-studio functions deploy -e <env> [-m msg] preflight deployed capabilities, then upload and deploy
|
|
1173
|
-
seq-studio functions list -e <env> [--match-local] functions visible on the environment
|
|
1174
|
-
seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)
|
|
1175
|
-
seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy
|
|
1176
|
-
[--fn slug] also show effective runtime limits (requires -e)
|
|
1177
|
-
seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context
|
|
1178
|
-
seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]
|
|
1179
|
-
invoke a function and print its response
|
|
1180
|
-
seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)
|
|
1181
|
-
seq-studio functions promote <version> -e <env> make a version live
|
|
1182
|
-
seq-studio functions rollback [<version>] -e <env> redeploy a prior version
|
|
1183
|
-
seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime
|
|
1184
|
-
(version history is retained)
|
|
1185
|
-
|
|
1186
|
-
Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) · --fn <slug> · --dir <path>
|
|
1187
|
-
--path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo
|
|
1188
|
-
--from-env-file <path> (default: .env) source file for secret values
|
|
1189
|
-
--no-wait · --yes
|
|
1190
|
-
--no-provision (deploy) update-only: error instead of registering a new
|
|
1191
|
-
shell, writing secret values, or attaching secrets (CI sweep)
|
|
1192
|
-
|
|
1193
|
-
Local Atlas builds and runs deployed functions on this computer, including teardown.
|
|
1194
|
-
"functions dev" runs a standalone handler without Atlas registration.
|
|
1195
|
-
|
|
1196
|
-
Configure per-function CPU and concurrency in managed-function.yml under limits.
|
|
1197
|
-
Run "functions limits" for valid settings; redeploy to apply manifest changes.
|
|
1198
|
-
Invocation rates are shared across Atlas replicas; 429 includes Retry-After.
|
|
1199
|
-
If the shared rate limiter is unavailable, invocation fails closed with 503.
|
|
1200
|
-
|
|
1201
|
-
Source for build/deploy: a local --dir (default .), a platform git-service
|
|
1202
|
-
repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects
|
|
1203
|
-
a function directory within a remote repo; omit it for the existing root-manifest
|
|
1204
|
-
layout. --ref selects a branch/tag/commit (default: the repo's default branch).
|
|
1205
|
-
Remote sources record the pinned commit as provenance (never dirty) and NEVER
|
|
1206
|
-
read a repo-committed .env for secret values — provision secrets server-side
|
|
1207
|
-
or pass a local --from-env-file (resolved against your cwd).
|
|
1208
|
-
|
|
1209
|
-
Interactive --repo builds clone over smart-HTTP and require a repo:read git
|
|
1210
|
-
PAT in ATLAS_GIT_PAT (\`seq-studio auth pat create --scopes repo:read\`, or
|
|
1211
|
-
Atlas → Settings → Tokens). Headless M2M builds use JSON materialize and
|
|
1212
|
-
accept only platform-managed --repo sources. Interactive builds also need
|
|
1213
|
-
--env + seq-studio login to resolve the repo and deploy.
|
|
1214
|
-
`;
|
|
1215
1169
|
export async function runFunctionsCommand(sub, args) {
|
|
1216
1170
|
try {
|
|
1217
1171
|
switch (sub) {
|
|
@@ -12,7 +12,7 @@ export declare function preflightBeforeUpload({ client, rootDir, manifest, cliVe
|
|
|
12
12
|
manifest: PreflightManifest;
|
|
13
13
|
cliVersion: string;
|
|
14
14
|
}): Promise<PreflightIssue[]>;
|
|
15
|
-
/** Offline
|
|
15
|
+
/** Offline schema and tooling checks; deployment feature support is checked before upload. */
|
|
16
16
|
export declare function localSdkPreflight({ rootDir, manifest, cliVersion, }: {
|
|
17
17
|
rootDir: string;
|
|
18
18
|
manifest: PreflightManifest;
|
|
@@ -25,12 +25,13 @@ export async function preflightBeforeUpload({ client, rootDir, manifest, cliVers
|
|
|
25
25
|
sdkVersion: await declaredSdkVersion(rootDir),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
/** Offline
|
|
28
|
+
/** Offline schema and tooling checks; deployment feature support is checked before upload. */
|
|
29
29
|
export async function localSdkPreflight({ rootDir, manifest, cliVersion, }) {
|
|
30
30
|
return preflightManagedFunction({
|
|
31
31
|
manifest,
|
|
32
32
|
limits: null,
|
|
33
33
|
capabilities: null,
|
|
34
|
+
checkDeployment: false,
|
|
34
35
|
cliVersion,
|
|
35
36
|
sdkVersion: await declaredSdkVersion(rootDir),
|
|
36
37
|
});
|
|
@@ -133,6 +133,9 @@ export declare const managedFunctionManifestSchema: z.ZodObject<{
|
|
|
133
133
|
editor: "editor";
|
|
134
134
|
admin: "admin";
|
|
135
135
|
}>>>;
|
|
136
|
+
processes: z.ZodOptional<z.ZodObject<{
|
|
137
|
+
read: z.ZodArray<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>>;
|
|
136
139
|
roles: z.ZodOptional<z.ZodObject<{
|
|
137
140
|
definitions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
138
141
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { storageScopesSchema, readStorageScopes } from '@sequenceholdings/storage';
|
|
2
2
|
import { postgresEgressError } from './egress-postgres.js';
|
|
3
3
|
import { cacheManifestSchema, managedFunctionWorkloadLimitsSchema } from '@sequenceholdings/managed-functions/config';
|
|
4
|
+
import { functionProcessReadScopesSchema } from '@sequenceholdings/managed-functions/config';
|
|
4
5
|
import { isIP } from 'node:net';
|
|
5
6
|
import { z } from 'zod';
|
|
6
7
|
import { ontologyContractSchema } from '@sequenceholdings/orm/canonical';
|
|
@@ -592,6 +593,23 @@ const invocationIpRangeSchema = z
|
|
|
592
593
|
});
|
|
593
594
|
}
|
|
594
595
|
});
|
|
596
|
+
function refineServiceAccountAttachment({ requiresServiceAccount, serviceAccount, ctx }) {
|
|
597
|
+
if (requiresServiceAccount && serviceAccount === undefined) {
|
|
598
|
+
ctx.addIssue({
|
|
599
|
+
code: 'custom',
|
|
600
|
+
message: 'Data, storage or process capabilities require a top-level service_account — the platform service ' +
|
|
601
|
+
'account this function acts as for service access (the deployer needs the actor role on it)',
|
|
602
|
+
path: ['service_account'],
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
if (!requiresServiceAccount && serviceAccount !== undefined) {
|
|
606
|
+
ctx.addIssue({
|
|
607
|
+
code: 'custom',
|
|
608
|
+
message: 'service_account requires capabilities.data or capabilities.storage or capabilities.processes',
|
|
609
|
+
path: ['service_account'],
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
}
|
|
595
613
|
export const managedFunctionManifestSchema = z.object({
|
|
596
614
|
ontology: ontologyContractSchema.optional(),
|
|
597
615
|
cache: cacheManifestSchema.optional(),
|
|
@@ -649,8 +667,8 @@ export const managedFunctionManifestSchema = z.object({
|
|
|
649
667
|
})
|
|
650
668
|
.default([]),
|
|
651
669
|
/**
|
|
652
|
-
* The platform service account available for explicit service-mode data or
|
|
653
|
-
* (slug or id). Required whenever data or
|
|
670
|
+
* The platform service account available for explicit service-mode data, storage or process access
|
|
671
|
+
* (slug or id). Required whenever data, storage or process capabilities are declared,
|
|
654
672
|
* rejected otherwise. Resolved and authorized server-side at activation —
|
|
655
673
|
* the deploy actor must hold `actor` on the account when the attachment
|
|
656
674
|
* changes. Mirrors atlas/src/server/services/managed-functions/manifest.ts.
|
|
@@ -673,6 +691,7 @@ export const managedFunctionManifestSchema = z.object({
|
|
|
673
691
|
*/
|
|
674
692
|
capabilities: z.object({
|
|
675
693
|
storage: storageScopesSchema.optional(),
|
|
694
|
+
processes: functionProcessReadScopesSchema.optional(),
|
|
676
695
|
roles: customRolesBlockSchema.optional(),
|
|
677
696
|
uses: capabilityPinsSchema,
|
|
678
697
|
gates: capabilityGatesSchema,
|
|
@@ -774,21 +793,12 @@ export const managedFunctionManifestSchema = z.object({
|
|
|
774
793
|
// action, operation, or raw query — the same rule the server's floor
|
|
775
794
|
// reconciliation uses (readManifestDataNamespaces).
|
|
776
795
|
const reachesData = Object.keys(readStorageScopes(manifest)).length > 0 || Object.values(manifest.capabilities.data).some((block) => block.tables.length > 0 || block.actions.length > 0 || block.operations.length > 0 || block.query);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
if (!reachesData && manifest.service_account !== undefined) {
|
|
786
|
-
ctx.addIssue({
|
|
787
|
-
code: 'custom',
|
|
788
|
-
message: 'service_account requires capabilities.data or capabilities.storage',
|
|
789
|
-
path: ['service_account'],
|
|
790
|
-
});
|
|
791
|
-
}
|
|
796
|
+
const reachesProcesses = (manifest.capabilities.processes?.read.length ?? 0) > 0;
|
|
797
|
+
refineServiceAccountAttachment({
|
|
798
|
+
requiresServiceAccount: reachesData || reachesProcesses,
|
|
799
|
+
serviceAccount: manifest.service_account,
|
|
800
|
+
ctx,
|
|
801
|
+
});
|
|
792
802
|
});
|
|
793
803
|
export function manifestSecretNames(value) {
|
|
794
804
|
return value.secrets.flatMap((entry) => typeof entry === 'string'
|
package/dist/repos/commands.d.ts
CHANGED
|
@@ -115,6 +115,5 @@ export declare function reposCiRequireCommand(args: ParsedArgs): Promise<number>
|
|
|
115
115
|
export declare function reposCiImportCommand(args: ParsedArgs): Promise<number>;
|
|
116
116
|
export declare function reposCiCommand(args: ParsedArgs): Promise<number>;
|
|
117
117
|
export declare function reposDeleteCommand(args: ParsedArgs): Promise<number>;
|
|
118
|
-
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 smart-HTTP when ATLAS_GIT_PAT is set;\n otherwise JSON materialize (<ns>/<name>)\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] 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 show <ns>/<name> -e <env> [--ref r] preview discovered CI checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> reserved (refuses write until sandboxed runner)\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] reserved (refuses write until sandboxed runner)\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone prefers real git clone (PAT via askpass \u2014 never written into the remote\n URL). --transport auto (default) uses Git when ATLAS_GIT_PAT is set and JSON\n materialization otherwise; --transport git requires a repo:read PAT; --transport\n json ignores ATLAS_GIT_PAT and uses the signed-in Atlas identity (<ns>/<name>\n only; no .git directory). Authentication failures explain this retry path.\n JSON materialization requires repo read access and prints how to create a PAT.\n PAT without Auth0 login: use --id from Repositories \u2192 Clone\n (or --url with the environment's canonical HTTPS origin).\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: ATLAS_GIT_PAT (from Atlas Settings \u2192 Tokens)\n";
|
|
119
118
|
export declare function runReposCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
|
|
120
119
|
export {};
|
package/dist/repos/commands.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { REPOS_USAGE } from '../command-help.js';
|
|
1
2
|
/**
|
|
2
3
|
* `seq-studio repos <sub>` — basic management of platform git-service repos
|
|
3
4
|
* over the JSON API.
|
|
@@ -819,44 +820,6 @@ export async function reposDeleteCommand(args) {
|
|
|
819
820
|
// ---------------------------------------------------------------------------
|
|
820
821
|
// Router
|
|
821
822
|
// ---------------------------------------------------------------------------
|
|
822
|
-
export const REPOS_USAGE = `usage:
|
|
823
|
-
seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment
|
|
824
|
-
seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces
|
|
825
|
-
seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)
|
|
826
|
-
seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]
|
|
827
|
-
create a repo seeded with a README; --git-backend
|
|
828
|
-
walgit creates it empty (for pushing existing
|
|
829
|
-
history); needs namespace write
|
|
830
|
-
seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]
|
|
831
|
-
seq-studio repos clone --url <https://…/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]
|
|
832
|
-
seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]
|
|
833
|
-
smart-HTTP when ATLAS_GIT_PAT is set;
|
|
834
|
-
otherwise JSON materialize (<ns>/<name>)
|
|
835
|
-
seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]
|
|
836
|
-
materialize the tree at a ref (JSON API)
|
|
837
|
-
seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)
|
|
838
|
-
seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)
|
|
839
|
-
seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview discovered CI checks
|
|
840
|
-
seq-studio repos ci require <ns>/<name> --check <name> -e <env> reserved (refuses write until sandboxed runner)
|
|
841
|
-
seq-studio repos ci import <ns>/<name> -e <env> [--ref r] reserved (refuses write until sandboxed runner)
|
|
842
|
-
|
|
843
|
-
Flags: -e/--env <env> (required; see: seq-studio envs list)
|
|
844
|
-
|
|
845
|
-
clone prefers real git clone (PAT via askpass — never written into the remote
|
|
846
|
-
URL). --transport auto (default) uses Git when ATLAS_GIT_PAT is set and JSON
|
|
847
|
-
materialization otherwise; --transport git requires a repo:read PAT; --transport
|
|
848
|
-
json ignores ATLAS_GIT_PAT and uses the signed-in Atlas identity (<ns>/<name>
|
|
849
|
-
only; no .git directory). Authentication failures explain this retry path.
|
|
850
|
-
JSON materialization requires repo read access and prints how to create a PAT.
|
|
851
|
-
PAT without Auth0 login: use --id from Repositories → Clone
|
|
852
|
-
(or --url with the environment's canonical HTTPS origin).
|
|
853
|
-
--ref accepts a branch, tag, or commit SHA (SHA → full clone, then checkout).
|
|
854
|
-
Branch and tag clones are shallow (--depth 1). Pass --full for history.
|
|
855
|
-
--output selects the clone directory (--out remains an alias).
|
|
856
|
-
|
|
857
|
-
Authenticate JSON API calls with: seq-studio login
|
|
858
|
-
Authenticate git clone/push with: ATLAS_GIT_PAT (from Atlas Settings → Tokens)
|
|
859
|
-
`;
|
|
860
823
|
export async function runReposCommand(sub, args) {
|
|
861
824
|
try {
|
|
862
825
|
switch (sub) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequenceholdings/studio-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
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 pat`. Includes Auth0 browser login shared with seqapi.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"tsx": "^4.20.3",
|
|
43
43
|
"zod": "^4.1.13",
|
|
44
44
|
"@sequenceholdings/lattice": "0.1.5",
|
|
45
|
+
"@sequenceholdings/artifact-studio": "0.6.6",
|
|
45
46
|
"@sequenceholdings/agent-spec": "0.1.3",
|
|
46
47
|
"@sequenceholdings/storage": "0.1.1",
|
|
47
|
-
"@sequenceholdings/
|
|
48
|
-
"@sequenceholdings/managed-functions": "0.3.4"
|
|
48
|
+
"@sequenceholdings/managed-functions": "0.3.5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@sequenceholdings/orm": "2.5.0",
|