@sequenceholdings/studio-cli 0.7.2 → 0.9.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 +351 -49
- package/dist/access/commands.d.ts +1 -1
- package/dist/access/commands.js +102 -55
- package/dist/access/custom-role-hosts.d.ts +3 -0
- package/dist/access/custom-role-hosts.js +88 -0
- package/dist/access/group-rosters.d.ts +6 -0
- package/dist/access/group-rosters.js +33 -0
- package/dist/access/host-contract.d.ts +55 -0
- package/dist/access/host-contract.js +33 -0
- package/dist/access/hosts.d.ts +4 -0
- package/dist/access/hosts.js +60 -0
- package/dist/access/principal.d.ts +16 -0
- package/dist/access/principal.js +36 -0
- package/dist/access/roles.d.ts +18 -0
- package/dist/access/roles.js +89 -0
- package/dist/access/tier-hosts.d.ts +12 -0
- package/dist/access/tier-hosts.js +206 -0
- package/dist/agents/commands.d.ts +1 -1
- package/dist/agents/commands.js +76 -16
- package/dist/agents/scaffold.js +8 -3
- package/dist/app/commands.js +37 -12
- package/dist/app/manifest.d.ts +2 -2
- package/dist/app/official-source.d.ts +4 -2
- package/dist/app/official-source.js +6 -4
- package/dist/app/readme.js +2 -2
- package/dist/app/workspace-model.js +4 -0
- package/dist/app/workspace-scaffold.js +5 -3
- package/dist/app/workspace.d.ts +2 -0
- package/dist/app/workspace.js +1 -1
- package/dist/artifact/delegate.js +26 -3
- package/dist/artifact/sandbox.js +2 -1
- package/dist/atlas-client.d.ts +15 -8
- package/dist/atlas-client.js +140 -64
- package/dist/bin.js +9 -1
- package/dist/cli-errors.js +4 -0
- package/dist/command-contract.d.ts +8 -2
- package/dist/command-contract.js +3 -2
- package/dist/command-help.d.ts +8 -6
- package/dist/command-help.js +50 -12
- package/dist/env-flags.d.ts +7 -0
- package/dist/env-flags.js +23 -0
- package/dist/functions/commands.js +66 -11
- package/dist/functions/manifest.d.ts +5 -0
- package/dist/functions/manifest.js +44 -23
- package/dist/functions/service-account-guidance.d.ts +21 -0
- package/dist/functions/service-account-guidance.js +62 -0
- package/dist/functions/workspace.d.ts +11 -0
- package/dist/functions/workspace.js +52 -0
- package/dist/main.d.ts +2 -1
- package/dist/main.js +12 -3
- package/dist/orm/delegate.js +49 -6
- package/dist/orm/execute.js +11 -5
- package/dist/orm/failures.d.ts +32 -0
- package/dist/orm/failures.js +75 -0
- package/dist/orm/read.js +3 -3
- package/dist/orm/version-guard.d.ts +3 -0
- package/dist/orm/version-guard.js +63 -0
- package/dist/pipeline/commands.js +4 -1
- package/dist/principals/commands.d.ts +3 -0
- package/dist/principals/commands.js +124 -0
- package/dist/process/runs.d.ts +4 -3
- package/dist/process/runs.js +52 -10
- package/dist/release-age.d.ts +1 -1
- package/dist/release-age.js +1 -0
- package/dist/repos/commands.d.ts +44 -0
- package/dist/repos/commands.js +55 -15
- package/dist/repos/init-repo.d.ts +45 -0
- package/dist/repos/init-repo.js +257 -0
- package/dist/sandbox-unpushed-warning.d.ts +23 -0
- package/dist/sandbox-unpushed-warning.js +86 -0
- package/dist/service-accounts/commands.js +15 -3
- package/dist/templates/commands.d.ts +14 -2
- package/dist/templates/commands.js +70 -16
- package/dist/templates/process/pnpm-workspace.yaml +1 -0
- package/package.json +14 -11
- package/templates/process/pnpm-workspace.yaml +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Machine-readable summary of the CLI surface, kept independent of command implementations. */
|
|
2
2
|
export declare const COMMAND_CONTRACT: readonly [{
|
|
3
3
|
readonly name: "init";
|
|
4
|
-
readonly description: "Scaffold an app workspace or use a published template";
|
|
4
|
+
readonly description: "Scaffold an app workspace or use a published template; --repo scaffolds into a git-service repo";
|
|
5
5
|
readonly lifecycle: "preview";
|
|
6
6
|
readonly access: "mixed";
|
|
7
7
|
readonly subcommands: readonly [];
|
|
@@ -133,10 +133,16 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
133
133
|
readonly subcommands: readonly ["init", "validate", "apply", "list", "show", "mkdir", "upload", "import", "uploads", "reconcile", "download", "access", "trash", "restore", "purge", "operations", "abort", "delete"];
|
|
134
134
|
}, {
|
|
135
135
|
readonly name: "access";
|
|
136
|
-
readonly description: "Manage
|
|
136
|
+
readonly description: "Manage resource access on every primitive";
|
|
137
137
|
readonly lifecycle: "preview";
|
|
138
138
|
readonly access: "authenticated";
|
|
139
139
|
readonly subcommands: readonly ["definitions", "list", "grant", "revoke", "resolve"];
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "principals";
|
|
142
|
+
readonly description: "Find users, groups, and service accounts to grant";
|
|
143
|
+
readonly lifecycle: "preview";
|
|
144
|
+
readonly access: "authenticated";
|
|
145
|
+
readonly subcommands: readonly ["search", "users", "groups"];
|
|
140
146
|
}, {
|
|
141
147
|
readonly name: "service-accounts";
|
|
142
148
|
readonly description: "Manage runtime service accounts";
|
package/dist/command-contract.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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: 'preview', access: 'mixed', subcommands: [] },
|
|
3
|
+
{ name: 'init', description: 'Scaffold an app workspace or use a published template; --repo scaffolds into a git-service repo', lifecycle: 'preview', access: 'mixed', subcommands: [] },
|
|
4
4
|
{ name: 'add', description: 'Add a primitive to an app workspace', lifecycle: 'preview', access: 'offline', subcommands: [] },
|
|
5
5
|
{ name: 'validate', description: 'Validate an app manifest, graph, paths, and members offline', lifecycle: 'preview', access: 'offline', subcommands: [] },
|
|
6
6
|
{ name: 'deploy', description: 'Deploy an app workspace', lifecycle: 'preview', access: 'authenticated', subcommands: [] },
|
|
@@ -22,7 +22,8 @@ export const COMMAND_CONTRACT = [
|
|
|
22
22
|
{ name: 'version', description: 'Print the installed CLI version', lifecycle: 'stable', access: 'offline', subcommands: [] },
|
|
23
23
|
{ name: 'help', description: 'Show command help', lifecycle: 'stable', access: 'offline', subcommands: [] },
|
|
24
24
|
{ 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'] },
|
|
25
|
-
{ name: 'access', description: 'Manage
|
|
25
|
+
{ name: 'access', description: 'Manage resource access on every primitive', lifecycle: 'preview', access: 'authenticated', subcommands: ['definitions', 'list', 'grant', 'revoke', 'resolve'] },
|
|
26
|
+
{ name: 'principals', description: 'Find users, groups, and service accounts to grant', lifecycle: 'preview', access: 'authenticated', subcommands: ['search', 'users', 'groups'] },
|
|
26
27
|
{ name: 'service-accounts', description: 'Manage runtime service accounts', lifecycle: 'preview', access: 'authenticated', subcommands: ['list', 'show', 'create'] },
|
|
27
28
|
{ name: 'capabilities', description: 'Print the supported CLI command surface', lifecycle: 'blocked', access: 'offline', subcommands: [] },
|
|
28
29
|
];
|
package/dist/command-help.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
|
|
2
|
-
|
|
2
|
+
/** `--repo` on every init command; shared so the commands describe it identically. */
|
|
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";
|
|
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";
|
|
3
5
|
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
4
6
|
export declare const ARTIFACT_SANDBOX_HELP = " In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
5
|
-
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
6
|
-
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>\n [--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]\n For an existing target release unit, source-env selects a separately\n authenticated canonical repository from banksouth, staging, or production.\n Source identity must be adopted and belong to the destination tenant.\n Registered OpCo source origins are not supported yet. The target verifies\n and snapshots source before planning; no target repository is created.\n Not compatible with --dir, existing IDs, or coordinated migrations.\n Rollback uses retained snapshots; historical source commits can be re-planned\n explicitly with deploy --ref <sha> --source-env <env>.\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
7
|
-
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir>
|
|
8
|
-
export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos identity <ns>/<name> -e <env> [--write --dir .] show/install the server-issued identity receipt\n --adopt --write --yes admin-only legacy binding; commit the receipt via PR\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
|
|
9
|
-
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
|
|
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>]\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\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 PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>\n [--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]\n For an existing target release unit, source-env selects a separately\n authenticated canonical repository from banksouth, staging, or production.\n Source identity must be adopted and belong to the destination tenant.\n Registered OpCo source origins are not supported yet. The target verifies\n and snapshots source before planning; no target repository is created.\n Reviewed pipeline.config.yml source_paths can select runtime files and\n directories, retaining pipeline metadata, release identity and size limits.\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";
|
|
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 (versions, secrets)\n [--json] [--version id|name] reader-gated release provenance\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n 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";
|
|
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. The init\n commands take --repo <ns>/<name> to create,\n clone, and scaffold in one step\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";
|
|
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>]] [--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.\n";
|
|
10
12
|
export declare const ORM_DISCOVER_HELP = "usage:\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n seq-studio orm operation show <namespace> <name> -e <env> [--json]\n\n Find the ORM data you can read, then query it with orm read or orm sql.\n namespaces lists only namespaces you can read, ordered by name: format (v2 or\n v1), table and persisted-operation counts. It pages with --limit (default 50)\n and --offset; the total and the next page go to stderr.\n describe <namespace> lists its tables and views and the persisted operations\n it serves, with what each requires and the variables it declares (name: type,\n ! when required). --operations prints only the operations, ready for\n orm execute <namespace> <operation>. describe <namespace> <table> lists the\n table's columns (types, nullability, keys), enum values, links, actions, and\n the persisted operations that write it. Column names are the ones orm read and\n orm sql accept.\n A namespace you cannot read reports not found, the same as a missing one.\n --json prints the full description (describe omits the generated GraphQL SDL).\n operation show prints one active persisted operation's registered GraphQL\n document; --json includes its hash, declared variables, and requirements.\n Missing and unreadable operations both report not found.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
|
11
13
|
export declare const ORM_EXECUTE_HELP = "usage:\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n\n Run one persisted operation as you. The server applies the operation's\n required capability or role and the namespace's row policies.\n By name: execute <namespace> <operation> looks the operation up in the\n namespace's deployed version and runs it. No checkout is needed, so it runs\n what is deployed even when a local clone is behind. List what you can run:\n seq-studio orm describe <namespace> --operations\n From a checkout: execute <operation> [dir] runs the operation as hashed in the\n namespace directory's operations.manifest.json (default dir: .). If the\n deployed version hashes it differently, execute prints both hashes and the\n by-name command instead of a bare 404.\n The form is chosen by the second argument: an existing directory means a\n checkout; otherwise it is <namespace> <operation>.\n --variables-file takes a JSON object. --var <name>=<value> (repeatable, by\n name only) sets one variable and wins over the file: numbers and booleans\n parse by the declared type, lists, filter inputs and jsonb take JSON, and other\n types take the text as is. Use the file for null.\n Output is the JSON response: {\"data\": ...}.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
|
12
14
|
export declare function staticHelp({ namespace, sub }: {
|
package/dist/command-help.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
|
|
2
|
+
/** `--repo` on every init command; shared so the commands describe it identically. */
|
|
3
|
+
export const INIT_INTO_REPO_HELP = ` Init into a repo: --repo <ns>/<name> on an init command creates that platform
|
|
4
|
+
git-service repo if missing (same name rules as repos create), then clones it
|
|
5
|
+
into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets
|
|
6
|
+
it as that checkout's origin (a different existing origin is refused). It
|
|
7
|
+
needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the
|
|
8
|
+
command prints the git add, commit, and push to run.
|
|
9
|
+
`;
|
|
2
10
|
export const ORM_HELP = `usage:
|
|
3
|
-
seq-studio orm init <dir>
|
|
11
|
+
seq-studio orm init <dir> [--repo <ns>/<name>]
|
|
4
12
|
seq-studio orm generate [dir] [--migration-export] [--check]
|
|
5
13
|
seq-studio orm validate [dir]
|
|
6
14
|
seq-studio orm plan [dir] -e <env>
|
|
7
|
-
seq-studio orm apply [dir] -e <env>
|
|
15
|
+
seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]
|
|
8
16
|
seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
|
|
9
17
|
seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
|
|
10
18
|
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
@@ -18,6 +26,10 @@ export const ORM_HELP = `usage:
|
|
|
18
26
|
|
|
19
27
|
-e/--env is required for commands that contact Atlas. Use seq-studio envs list
|
|
20
28
|
to discover environments and seq-studio login to authenticate.
|
|
29
|
+
Schema commands require the ORM loaded by seq-studio to satisfy the v2
|
|
30
|
+
namespace's package.json @sequenceholdings/orm range before compiling.
|
|
31
|
+
apply waits until the new version is live and serving (default up to 20m), then
|
|
32
|
+
prints "live:"; --no-wait returns once the apply is queued.
|
|
21
33
|
namespaces lists what you can read; describe shows its tables and operations.
|
|
22
34
|
Run seq-studio orm describe --help for the output.
|
|
23
35
|
execute <namespace> <operation> runs the deployed version's persisted operation by
|
|
@@ -25,7 +37,8 @@ export const ORM_HELP = `usage:
|
|
|
25
37
|
read and sql query a v2 namespace as you through its built-in read-only SQL.
|
|
26
38
|
sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).
|
|
27
39
|
Run seq-studio orm read --help for the filter grammar, parameters, and output formats.
|
|
28
|
-
|
|
40
|
+
|
|
41
|
+
${INIT_INTO_REPO_HELP}`;
|
|
29
42
|
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
30
43
|
export const ARTIFACT_SANDBOX_HELP = ` In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan
|
|
31
44
|
and deploy take --repo: push the app to a Git Service repository and deploy
|
|
@@ -36,7 +49,7 @@ export const ARTIFACT_SANDBOX_HELP = ` In an agent sandbox (SEQ_STUDIO_BASE_URL
|
|
|
36
49
|
unavailable there, and -e is ignored.
|
|
37
50
|
`;
|
|
38
51
|
export const ARTIFACT_HELP = `usage:
|
|
39
|
-
seq-studio artifact init <dir> [--template react-vite|nextjs]
|
|
52
|
+
seq-studio artifact init <dir> [--template react-vite|nextjs] [--repo <namespace>/<name>]
|
|
40
53
|
seq-studio artifact whoami -e <env>
|
|
41
54
|
seq-studio artifact link [dir] -e <env> [--project <id>]
|
|
42
55
|
seq-studio artifact env list|use <env>
|
|
@@ -55,6 +68,7 @@ export const ARTIFACT_HELP = `usage:
|
|
|
55
68
|
deployment workflows have different source and approval rules; see the public
|
|
56
69
|
CLI README.
|
|
57
70
|
|
|
71
|
+
${INIT_INTO_REPO_HELP}
|
|
58
72
|
${ARTIFACT_SANDBOX_HELP}`;
|
|
59
73
|
export const PIPELINE_HELP = `usage:
|
|
60
74
|
seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]
|
|
@@ -73,6 +87,8 @@ export const PIPELINE_HELP = `usage:
|
|
|
73
87
|
Source identity must be adopted and belong to the destination tenant.
|
|
74
88
|
Registered OpCo source origins are not supported yet. The target verifies
|
|
75
89
|
and snapshots source before planning; no target repository is created.
|
|
90
|
+
Reviewed pipeline.config.yml source_paths can select runtime files and
|
|
91
|
+
directories, retaining pipeline metadata, release identity and size limits.
|
|
76
92
|
Not compatible with --dir, existing IDs, or coordinated migrations.
|
|
77
93
|
Rollback uses retained snapshots; historical source commits can be re-planned
|
|
78
94
|
explicitly with deploy --ref <sha> --source-env <env>.
|
|
@@ -88,7 +104,8 @@ export const PIPELINE_HELP = `usage:
|
|
|
88
104
|
Help is available offline.
|
|
89
105
|
`;
|
|
90
106
|
export const FUNCTIONS_USAGE = `usage:
|
|
91
|
-
seq-studio functions init <dir>
|
|
107
|
+
seq-studio functions init <dir> [--repo <ns>/<name>] scaffold manifest, TypeScript handler, and docs pointers;
|
|
108
|
+
--repo scaffolds into a git-service repo (see Init into a repo)
|
|
92
109
|
seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)
|
|
93
110
|
seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy
|
|
94
111
|
seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress
|
|
@@ -128,12 +145,21 @@ export const FUNCTIONS_USAGE = `usage:
|
|
|
128
145
|
Remote sources record the pinned commit as provenance (never dirty) and NEVER
|
|
129
146
|
read a repo-committed .env for secret values — provision secrets server-side
|
|
130
147
|
or pass a local --from-env-file (resolved against your cwd).
|
|
148
|
+
Local deploys record repository-wide gitDirty, including unignored files
|
|
149
|
+
outside --dir. Check git status at the repository root before deploying.
|
|
150
|
+
|
|
151
|
+
Workspace dependencies are compiled from packages declared in a containing
|
|
152
|
+
sequence.app.yml, within the source repository. Only the selected function is
|
|
153
|
+
deployed: no sibling primitives or Application registration. Shared Node packages
|
|
154
|
+
can set package.json seqStudio.source to a root source entry for clean builds.
|
|
155
|
+
Package build scripts are not run. Local secret paths remain relative to --dir.
|
|
131
156
|
|
|
132
157
|
Interactive --repo builds clone over smart-HTTP using your seq-studio login
|
|
133
158
|
and repository read access. No PAT is needed. Headless M2M builds use JSON
|
|
134
159
|
materialize and accept only platform-managed --repo sources. Use --env to
|
|
135
160
|
select the same environment for source and deployment.
|
|
136
|
-
|
|
161
|
+
|
|
162
|
+
${INIT_INTO_REPO_HELP}`;
|
|
137
163
|
export const REPOS_USAGE = `usage:
|
|
138
164
|
seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment
|
|
139
165
|
seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces
|
|
@@ -143,7 +169,9 @@ export const REPOS_USAGE = `usage:
|
|
|
143
169
|
seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]
|
|
144
170
|
create a repo seeded with a README; --git-backend
|
|
145
171
|
walgit creates it empty (for pushing existing
|
|
146
|
-
history); needs namespace write
|
|
172
|
+
history); needs namespace write. The init
|
|
173
|
+
commands take --repo <ns>/<name> to create,
|
|
174
|
+
clone, and scaffold in one step
|
|
147
175
|
seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]
|
|
148
176
|
seq-studio repos clone --url <https://…/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]
|
|
149
177
|
seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]
|
|
@@ -179,17 +207,27 @@ export const REPOS_USAGE = `usage:
|
|
|
179
207
|
export const PROCESS_RUNS_USAGE = `usage:
|
|
180
208
|
seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]
|
|
181
209
|
[--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]
|
|
210
|
+
seq-studio process runs retry <run-id> -e <env> [--run-id <new-id>] [--json]
|
|
182
211
|
seq-studio process runs list -e <env> [--process <id>] [--status <status>]
|
|
183
212
|
[--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]
|
|
184
213
|
seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]
|
|
185
214
|
seq-studio process runs cancel <run-id> -e <env> [--json]
|
|
186
215
|
|
|
187
|
-
Runs start and are read as you: start
|
|
188
|
-
list return only runs you can view, and cancel needs invoker on the
|
|
216
|
+
Runs start and are read as you: start and retry need invoker on the process,
|
|
217
|
+
show and list return only runs you can view, and cancel needs invoker on the
|
|
218
|
+
process.
|
|
219
|
+
start prints the new run's id. Omit --run-id for a fresh id on every start.
|
|
220
|
+
--run-id names exactly one run: repeating it for the same process returns that
|
|
221
|
+
run, whatever its status, instead of starting another. To run a failed run
|
|
222
|
+
again, retry it rather than inventing a new id.
|
|
189
223
|
--version pins a published process version; omitted, the active version runs.
|
|
190
|
-
--
|
|
191
|
-
|
|
192
|
-
|
|
224
|
+
--metadata-file is a JSON object stored on the run.
|
|
225
|
+
retry (CLI 0.9.0+) starts a new run of a failed, cancelled or timed_out run's
|
|
226
|
+
process version with the same metadata, entity and title, linked to the
|
|
227
|
+
original in its lineage, and prints the new id. Other statuses are refused.
|
|
228
|
+
Like start, a retry waits queued while the process is at its concurrent-run
|
|
229
|
+
limit.
|
|
230
|
+
--run-id on retry names the new run, so repeating the retry returns it.
|
|
193
231
|
list returns the newest runs first, up to --limit (default 50, max 500); the run
|
|
194
232
|
API has no cursor, so narrow with filters to reach older runs.
|
|
195
233
|
--status: pending, running, completed, failed, cancelled, timed_out.
|
package/dist/env-flags.d.ts
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
/** Shared copy for network commands that must not silently fall back to `local`. */
|
|
7
7
|
export declare 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
8
|
export declare function normalizeShortEnvFlag(argv: readonly string[]): string[];
|
|
9
|
+
/**
|
|
10
|
+
* argv without any environment flag, in every spelling (`-e x`, `-e=x`,
|
|
11
|
+
* `--env x`, `--env=x`, or a valueless one). For an offline step delegated
|
|
12
|
+
* after seq-studio already used the environment, e.g. the scaffold of
|
|
13
|
+
* `init --repo`, whose package parser rejects an unknown `--env`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function withoutEnvFlag(argv: readonly string[]): string[];
|
|
9
16
|
/** Only valid AFTER normalizeShortEnvFlag — recognizes the two-token form. */
|
|
10
17
|
export declare function readEnvFromArgv(rest: readonly string[]): string | undefined;
|
|
11
18
|
/**
|
package/dist/env-flags.js
CHANGED
|
@@ -34,6 +34,29 @@ export function normalizeShortEnvFlag(argv) {
|
|
|
34
34
|
}
|
|
35
35
|
return out;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* argv without any environment flag, in every spelling (`-e x`, `-e=x`,
|
|
39
|
+
* `--env x`, `--env=x`, or a valueless one). For an offline step delegated
|
|
40
|
+
* after seq-studio already used the environment, e.g. the scaffold of
|
|
41
|
+
* `init --repo`, whose package parser rejects an unknown `--env`.
|
|
42
|
+
*/
|
|
43
|
+
export function withoutEnvFlag(argv) {
|
|
44
|
+
const normalized = normalizeShortEnvFlag(argv);
|
|
45
|
+
const out = [];
|
|
46
|
+
for (let i = 0; i < normalized.length; i++) {
|
|
47
|
+
const arg = normalized[i];
|
|
48
|
+
if (arg === undefined)
|
|
49
|
+
continue;
|
|
50
|
+
if (arg === '--env') {
|
|
51
|
+
const next = normalized[i + 1];
|
|
52
|
+
if (next !== undefined && !next.startsWith('-'))
|
|
53
|
+
i += 1;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
out.push(arg);
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
37
60
|
/** Only valid AFTER normalizeShortEnvFlag — recognizes the two-token form. */
|
|
38
61
|
export function readEnvFromArgv(rest) {
|
|
39
62
|
for (let i = 0; i < rest.length; i++) {
|
|
@@ -20,17 +20,23 @@ import { REQUIRE_EXPLICIT_ENV_MESSAGE, explicitOrSandboxEnv } from '../env-flags
|
|
|
20
20
|
import { confirmYes } from '../prompt.js';
|
|
21
21
|
import { writeScaffoldGuidance } from '../scaffold-guidance.js';
|
|
22
22
|
import { collectBundleFiles, isDirectory, validateLocalBundle, } from './bundle.js';
|
|
23
|
-
import { managedFunctionManifestSchema, MF_MANIFEST_FILENAME, manifestEgressHosts, manifestEgressIpRanges, manifestSecretNames, } from './manifest.js';
|
|
23
|
+
import { managedFunctionManifestSchema, missingServiceAccountMessage, MF_MANIFEST_FILENAME, manifestEgressHosts, manifestEgressIpRanges, manifestSecretNames, } from './manifest.js';
|
|
24
|
+
import { missingServiceAccountGuidance, missingServiceAccountRequirements } from './service-account-guidance.js';
|
|
24
25
|
import { buildEgressPreviewLines, egressPropagationNote, formatEgressSummary, printFunctionEgressHosts, } from './egress-preview.js';
|
|
25
26
|
import { resolveArtifactSource, } from '@sequenceholdings/artifact-studio/source-resolver';
|
|
26
27
|
import { buildSecretPreviewLines, classifySecrets, } from './secret-reconcile.js';
|
|
27
28
|
import { parseFunctionsSourceSelection, resolveFunctionSourceDir } from './source-selection.js';
|
|
29
|
+
import { prepareFunctionWorkspace } from './workspace.js';
|
|
28
30
|
export { parseFunctionsSourceSelection, parseFunctionsSourceSpec, resolveFunctionSourceDir, } from './source-selection.js';
|
|
29
31
|
import { warnOnManifestRoles } from '../manifest-roles-notice.js';
|
|
30
32
|
const execFileAsync = promisify(execFile);
|
|
31
33
|
export const LOG = '[seq-studio]';
|
|
32
34
|
const POLL_INTERVAL_MS = 5_000;
|
|
33
35
|
const POLL_TIMEOUT_MS = 20 * 60 * 1000;
|
|
36
|
+
// The invoke route can spend two startup windows plus readiness retries before
|
|
37
|
+
// a one-hour execution. Outlast its maximum 4,190-second client budget while
|
|
38
|
+
// retaining a finite deadline; ordinary metadata requests keep their default.
|
|
39
|
+
const FUNCTION_INVOKE_TIMEOUT_MS = 70 * 60 * 1000;
|
|
34
40
|
const DEPLOY_PROGRESS_STAGES = new Set([
|
|
35
41
|
'prepare', 'build', 'identity', 'subnet', 'cache', 'secrets',
|
|
36
42
|
'publish', 'egress', 'readiness', 'activate', 'revoke',
|
|
@@ -277,6 +283,23 @@ limits:
|
|
|
277
283
|
# allowed_ip_ranges:
|
|
278
284
|
# - 203.0.113.0/24
|
|
279
285
|
|
|
286
|
+
# ORM data access: the namespace's read tables/views and persisted mutation
|
|
287
|
+
# names. Call operations by name with createFunctionOrmExecutor from
|
|
288
|
+
# @sequenceholdings/managed-functions/orm (no operations.manifest.json copy).
|
|
289
|
+
# Data access on behalf of the caller needs no service account. To also act as
|
|
290
|
+
# the function itself (createFunctionServiceOrmExecutor, Lattice runs), name a
|
|
291
|
+
# service_account you hold the actor role on (seq-studio service-accounts list |
|
|
292
|
+
# create): the account then acts in every namespace, or only in the ones you
|
|
293
|
+
# mark service: true. service: true requires a service_account.
|
|
294
|
+
# capabilities:
|
|
295
|
+
# data:
|
|
296
|
+
# my_namespace:
|
|
297
|
+
# tables: [my_table]
|
|
298
|
+
# operations: [UpdateMyTable]
|
|
299
|
+
# query: false
|
|
300
|
+
# # service: true # limit the account to the marked namespaces
|
|
301
|
+
# service_account: <account-id-or-slug>
|
|
302
|
+
|
|
280
303
|
# Env-var names the function expects (UPPER_SNAKE_CASE). Values are read
|
|
281
304
|
# from a local .env file at deploy time — they are never committed or bundled.
|
|
282
305
|
secrets: []
|
|
@@ -380,9 +403,13 @@ registry=https://libraries.cgr.dev/javascript/
|
|
|
380
403
|
export async function functionsInitCommand(args) {
|
|
381
404
|
const target = args.positional[0];
|
|
382
405
|
if (!target) {
|
|
383
|
-
console.error('usage: seq-studio functions init <dir>');
|
|
406
|
+
console.error('usage: seq-studio functions init <dir> [--repo <ns>/<name> -e <env>]');
|
|
384
407
|
return 1;
|
|
385
408
|
}
|
|
409
|
+
if (args.flags.repo !== undefined) {
|
|
410
|
+
const { runInitWithRepo, withoutRepoFlag } = await import('../repos/init-repo.js');
|
|
411
|
+
return runInitWithRepo({ args, target, scaffold: () => functionsInitCommand(withoutRepoFlag(args)) });
|
|
412
|
+
}
|
|
386
413
|
const dir = resolve(target);
|
|
387
414
|
// Derive the slug from the resolved directory name so `init .` and
|
|
388
415
|
// trailing-slash paths work (the raw argument would yield an empty id).
|
|
@@ -428,7 +455,13 @@ export async function functionsBuildCommand(args) {
|
|
|
428
455
|
const source = await resolveArtifactSource(spec, remote);
|
|
429
456
|
try {
|
|
430
457
|
const dir = await resolveFunctionSourceDir({ repoDir: source.dir, path });
|
|
431
|
-
|
|
458
|
+
const prepared = await prepareFunctionWorkspace({ dir, ...(spec.kind === 'local' ? {} : { repoDir: source.dir }) });
|
|
459
|
+
try {
|
|
460
|
+
return await buildFromResolvedSource({ spec, source: { ...source, dir: prepared.dir } });
|
|
461
|
+
}
|
|
462
|
+
finally {
|
|
463
|
+
await prepared.cleanup();
|
|
464
|
+
}
|
|
432
465
|
}
|
|
433
466
|
finally {
|
|
434
467
|
await source.cleanup();
|
|
@@ -511,15 +544,36 @@ export async function functionsDeployCommand(args) {
|
|
|
511
544
|
try {
|
|
512
545
|
const dir = await resolveFunctionSourceDir({ repoDir: source.dir, path });
|
|
513
546
|
await warnOnManifestRoles({ dir, file: 'managed-function.yml', kind: 'host' });
|
|
514
|
-
|
|
547
|
+
const provenance = spec.kind === 'local' ? await gitMetadata(dir) : source.provenance;
|
|
548
|
+
const prepared = await prepareFunctionWorkspace({ dir, ...(spec.kind === 'local' ? {} : { repoDir: source.dir }) });
|
|
549
|
+
try {
|
|
550
|
+
return await deployFromResolvedSource({ args, spec, ctx, originalDir: dir, source: { ...source, dir: prepared.dir, provenance } });
|
|
551
|
+
}
|
|
552
|
+
finally {
|
|
553
|
+
await prepared.cleanup();
|
|
554
|
+
}
|
|
515
555
|
}
|
|
516
556
|
finally {
|
|
517
557
|
await source.cleanup();
|
|
518
558
|
}
|
|
519
559
|
}
|
|
520
|
-
async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, }) {
|
|
560
|
+
async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, originalDir, }) {
|
|
521
561
|
const dir = source.dir;
|
|
522
|
-
|
|
562
|
+
let manifest;
|
|
563
|
+
try {
|
|
564
|
+
manifest = await readSourceManifest(dir, spec);
|
|
565
|
+
}
|
|
566
|
+
catch (error) {
|
|
567
|
+
// A function that needs a service account and names none: say what this
|
|
568
|
+
// caller can do about it (create one, or attach one they already act as).
|
|
569
|
+
const requirements = missingServiceAccountRequirements(error);
|
|
570
|
+
if (!requirements)
|
|
571
|
+
throw error;
|
|
572
|
+
const ctx = earlyCtx ?? await buildContext(args).catch(() => null);
|
|
573
|
+
const guidance = ctx ? await missingServiceAccountGuidance({ client: clientOptions(ctx), requirements }) : null;
|
|
574
|
+
console.error(`${LOG} ${guidance ?? missingServiceAccountMessage(requirements)}`);
|
|
575
|
+
return 1;
|
|
576
|
+
}
|
|
523
577
|
const { files, excludedEnvFiles } = await collectBundleFiles(dir);
|
|
524
578
|
for (const excluded of excludedEnvFiles) {
|
|
525
579
|
console.warn(`${LOG} excluded ${excluded} — dotenv files never enter bundles`);
|
|
@@ -542,9 +596,9 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
542
596
|
const envFilePath = envFileFlag
|
|
543
597
|
? isAbsolute(envFileFlag)
|
|
544
598
|
? envFileFlag
|
|
545
|
-
: resolve(spec.kind === 'local' ?
|
|
599
|
+
: resolve(spec.kind === 'local' ? originalDir : process.cwd(), envFileFlag)
|
|
546
600
|
: spec.kind === 'local'
|
|
547
|
-
? join(
|
|
601
|
+
? join(originalDir, '.env')
|
|
548
602
|
: null;
|
|
549
603
|
let envValues = {};
|
|
550
604
|
if (envFileFlag) {
|
|
@@ -607,7 +661,7 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
607
661
|
null;
|
|
608
662
|
// Local deploys record best-effort working-tree provenance; remote sources
|
|
609
663
|
// carry the resolver's pinned commit (gitCommit = resolved SHA, never dirty).
|
|
610
|
-
const git =
|
|
664
|
+
const git = source.provenance;
|
|
611
665
|
// Classify each declared secret so the deploy preview and reconcile step
|
|
612
666
|
// know exactly what action to take for each one.
|
|
613
667
|
let classification = null;
|
|
@@ -686,7 +740,7 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
686
740
|
if (deployMessage)
|
|
687
741
|
preview.push(`${LOG} message: ${deployMessage}`);
|
|
688
742
|
if (git.gitCommit) {
|
|
689
|
-
preview.push(`${LOG} git: ${git.gitBranch ?? '?'}@${git.gitCommit.slice(0, 8)}${git.gitDirty ? ' (dirty)' : ''}`);
|
|
743
|
+
preview.push(`${LOG} git: ${git.gitBranch ?? '?'}@${git.gitCommit.slice(0, 8)}${git.gitDirty ? ' (repository dirty)' : ''}`);
|
|
690
744
|
}
|
|
691
745
|
if (classification) {
|
|
692
746
|
preview.push(...(classification.secrets.length === 0 && manifest.secrets.length > 0
|
|
@@ -779,7 +833,7 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
|
|
|
779
833
|
}
|
|
780
834
|
}
|
|
781
835
|
if (git.gitDirty) {
|
|
782
|
-
console.warn(`${LOG} working tree is dirty — recording gitDirty=true on this version`);
|
|
836
|
+
console.warn(`${LOG} repository working tree is dirty (not limited to the function source directory) — recording gitDirty=true on this version`);
|
|
783
837
|
}
|
|
784
838
|
console.log(`${LOG} uploading bundle (${files.length} files) to ${ctx.env.name}…`);
|
|
785
839
|
let version;
|
|
@@ -1169,6 +1223,7 @@ export async function functionsInvokeCommand(args) {
|
|
|
1169
1223
|
path: `/api/managed-functions/${fn.id}/invoke`,
|
|
1170
1224
|
body: payload,
|
|
1171
1225
|
headers: { 'X-Invocation-Source': 'cli' },
|
|
1226
|
+
timeoutMs: FUNCTION_INVOKE_TIMEOUT_MS,
|
|
1172
1227
|
});
|
|
1173
1228
|
const rendered = formatInvokeBody(result.body, result.contentType);
|
|
1174
1229
|
process.stdout.write(rendered.endsWith('\n') ? rendered : `${rendered}\n`);
|
|
@@ -50,6 +50,10 @@ export declare function manifestEgressIpRanges(entries: readonly string[]): stri
|
|
|
50
50
|
* bypass the matcher and are capped separately (per-function route count).
|
|
51
51
|
*/
|
|
52
52
|
export declare function egressBudgetError(entries: string[]): string | null;
|
|
53
|
+
/** Issue param that marks the missing-account refusal, so deploy can add caller-specific guidance. */
|
|
54
|
+
export declare const SERVICE_ACCOUNT_REQUIRED = "SERVICE_ACCOUNT_REQUIRED";
|
|
55
|
+
/** The refusal for a manifest that needs a service account and names none, without caller-specific guidance. */
|
|
56
|
+
export declare function missingServiceAccountMessage(requirements: readonly string[]): string;
|
|
53
57
|
export declare const managedFunctionManifestSchema: z.ZodObject<{
|
|
54
58
|
ontology: z.ZodOptional<z.ZodObject<{
|
|
55
59
|
version: z.ZodLiteral<1>;
|
|
@@ -179,6 +183,7 @@ export declare const managedFunctionManifestSchema: z.ZodObject<{
|
|
|
179
183
|
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
180
184
|
operations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
181
185
|
query: z.ZodDefault<z.ZodBoolean>;
|
|
186
|
+
service: z.ZodOptional<z.ZodBoolean>;
|
|
182
187
|
}, z.core.$strip>>>;
|
|
183
188
|
}, z.core.$strip>>;
|
|
184
189
|
}, z.core.$strip>;
|
|
@@ -564,19 +564,28 @@ const invocationIpRangeSchema = z
|
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
});
|
|
567
|
-
|
|
568
|
-
|
|
567
|
+
/** Issue param that marks the missing-account refusal, so deploy can add caller-specific guidance. */
|
|
568
|
+
export const SERVICE_ACCOUNT_REQUIRED = 'SERVICE_ACCOUNT_REQUIRED';
|
|
569
|
+
/** The refusal for a manifest that needs a service account and names none, without caller-specific guidance. */
|
|
570
|
+
export function missingServiceAccountMessage(requirements) {
|
|
571
|
+
return `This function acts as itself, not as its caller, for ${requirements.join(', ')}, so managed-function.yml must name ` +
|
|
572
|
+
'a service_account. Create one with `seq-studio service-accounts create <slug> --display-name "<name>"` (needs Can create ' +
|
|
573
|
+
'on Service Accounts) or use an existing account you hold the actor role on, then add `service_account: <slug>`. ' +
|
|
574
|
+
'Data access on behalf of the caller alone (capabilities.data without service: true) needs no account.';
|
|
575
|
+
}
|
|
576
|
+
function refineServiceAccountAttachment({ requirements, acceptsServiceAccount, serviceAccount, ctx }) {
|
|
577
|
+
if (requirements.length > 0 && serviceAccount === undefined) {
|
|
569
578
|
ctx.addIssue({
|
|
570
579
|
code: 'custom',
|
|
571
|
-
message:
|
|
572
|
-
'account this function acts as for service access (the deployer needs the actor role on it)',
|
|
580
|
+
message: missingServiceAccountMessage(requirements),
|
|
573
581
|
path: ['service_account'],
|
|
582
|
+
params: { code: SERVICE_ACCOUNT_REQUIRED, requirements: [...requirements] },
|
|
574
583
|
});
|
|
575
584
|
}
|
|
576
|
-
if (!
|
|
585
|
+
if (!acceptsServiceAccount && serviceAccount !== undefined) {
|
|
577
586
|
ctx.addIssue({
|
|
578
587
|
code: 'custom',
|
|
579
|
-
message: 'service_account requires at least one declared service access capability',
|
|
588
|
+
message: 'service_account requires at least one declared service access capability or data namespace',
|
|
580
589
|
path: ['service_account'],
|
|
581
590
|
});
|
|
582
591
|
}
|
|
@@ -705,6 +714,14 @@ export const managedFunctionManifestSchema = z.object({
|
|
|
705
714
|
.max(64)
|
|
706
715
|
.default([]),
|
|
707
716
|
query: z.boolean().default(false),
|
|
717
|
+
/**
|
|
718
|
+
* Act AS the function's attached service account in this namespace
|
|
719
|
+
* (`createFunctionServiceOrmExecutor`, system-runner invocations),
|
|
720
|
+
* not only on behalf of the caller; requires `service_account`.
|
|
721
|
+
* Marking any namespace narrows the account to the marked ones;
|
|
722
|
+
* with none marked, a named account acts in every declared namespace.
|
|
723
|
+
*/
|
|
724
|
+
service: z.boolean().optional(),
|
|
708
725
|
}))
|
|
709
726
|
.default({}),
|
|
710
727
|
}).default({ uses: [], gates: [], data: {} }),
|
|
@@ -747,24 +764,28 @@ export const managedFunctionManifestSchema = z.object({
|
|
|
747
764
|
}
|
|
748
765
|
// A namespace is "reached" when its block declares at least one table,
|
|
749
766
|
// action, operation, or raw query — the same rule the server's floor
|
|
750
|
-
// reconciliation uses (readManifestDataNamespaces).
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
const
|
|
754
|
-
|
|
755
|
-
|
|
767
|
+
// reconciliation uses (readManifestDataNamespaces). Reaching data on behalf
|
|
768
|
+
// of the caller needs no account; `service: true` asks to act as the function.
|
|
769
|
+
const reachedData = Object.entries(manifest.capabilities.data).filter(([, block]) => block.tables.length > 0 || block.actions.length > 0 || block.operations.length > 0 || block.query);
|
|
770
|
+
const requirements = [
|
|
771
|
+
...reachedData.filter(([, block]) => block.service === true).map(([namespace]) => `capabilities.data.${namespace}.service`),
|
|
772
|
+
...[
|
|
773
|
+
['capabilities.storage', Object.keys(readStorageScopes(manifest)).length > 0],
|
|
774
|
+
['capabilities.processes.read', (manifest.capabilities.processes?.read.length ?? 0) > 0],
|
|
775
|
+
['capabilities.agents.read', (manifest.capabilities.agents?.read?.length ?? 0) > 0],
|
|
776
|
+
['capabilities.agents.evidence', (manifest.capabilities.agents?.evidence?.length ?? 0) > 0],
|
|
777
|
+
['capabilities.workflows.read', (manifest.capabilities.workflows?.read?.length ?? 0) > 0],
|
|
778
|
+
['capabilities.workflows.evidence', (manifest.capabilities.workflows?.evidence?.length ?? 0) > 0],
|
|
779
|
+
['capabilities.monitoring.producers', (manifest.capabilities.monitoring?.producers.length ?? 0) > 0],
|
|
780
|
+
['capabilities.lattice.context', manifest.capabilities.lattice?.context === true],
|
|
781
|
+
['capabilities.invocation.identity', manifest.capabilities.invocation?.identity === true],
|
|
782
|
+
['capabilities.directory.resolve', (manifest.capabilities.directory?.resolve?.length ?? 0) > 0],
|
|
783
|
+
['capabilities.abrigo.read', (manifest.capabilities.abrigo?.read.length ?? 0) > 0],
|
|
784
|
+
].filter(([, present]) => present).map(([path]) => path),
|
|
785
|
+
];
|
|
756
786
|
refineServiceAccountAttachment({
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
reachesProcesses,
|
|
760
|
-
reachesAgents,
|
|
761
|
-
reachesWorkflows,
|
|
762
|
-
(manifest.capabilities.abrigo?.read.length ?? 0) > 0,
|
|
763
|
-
receivesLatticeContext,
|
|
764
|
-
manifest.capabilities.invocation?.identity === true,
|
|
765
|
-
(manifest.capabilities.directory?.resolve?.length ?? 0) > 0,
|
|
766
|
-
(manifest.capabilities.monitoring?.producers.length ?? 0) > 0,
|
|
767
|
-
].includes(true),
|
|
787
|
+
requirements,
|
|
788
|
+
acceptsServiceAccount: requirements.length > 0 || reachedData.length > 0,
|
|
768
789
|
serviceAccount: manifest.service_account,
|
|
769
790
|
ctx,
|
|
770
791
|
});
|