@sequenceholdings/studio-cli 0.7.2 → 0.9.1

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.
Files changed (89) hide show
  1. package/README.md +414 -55
  2. package/dist/access/commands.d.ts +1 -1
  3. package/dist/access/commands.js +102 -55
  4. package/dist/access/custom-role-hosts.d.ts +3 -0
  5. package/dist/access/custom-role-hosts.js +88 -0
  6. package/dist/access/group-rosters.d.ts +6 -0
  7. package/dist/access/group-rosters.js +33 -0
  8. package/dist/access/host-contract.d.ts +55 -0
  9. package/dist/access/host-contract.js +33 -0
  10. package/dist/access/hosts.d.ts +4 -0
  11. package/dist/access/hosts.js +60 -0
  12. package/dist/access/principal.d.ts +16 -0
  13. package/dist/access/principal.js +36 -0
  14. package/dist/access/roles.d.ts +18 -0
  15. package/dist/access/roles.js +89 -0
  16. package/dist/access/tier-hosts.d.ts +12 -0
  17. package/dist/access/tier-hosts.js +206 -0
  18. package/dist/agents/commands.d.ts +1 -1
  19. package/dist/agents/commands.js +76 -16
  20. package/dist/agents/scaffold.js +8 -3
  21. package/dist/app/commands.js +37 -12
  22. package/dist/app/manifest.d.ts +2 -2
  23. package/dist/app/official-source.d.ts +4 -2
  24. package/dist/app/official-source.js +6 -4
  25. package/dist/app/readme.js +2 -2
  26. package/dist/app/repository-index.d.ts +6 -0
  27. package/dist/app/repository-index.js +2 -2
  28. package/dist/app/workspace-model.js +4 -0
  29. package/dist/app/workspace-scaffold.js +5 -3
  30. package/dist/app/workspace.d.ts +2 -0
  31. package/dist/app/workspace.js +1 -1
  32. package/dist/artifact/delegate.js +26 -3
  33. package/dist/artifact/sandbox.js +2 -1
  34. package/dist/atlas-client.d.ts +15 -8
  35. package/dist/atlas-client.js +140 -64
  36. package/dist/bin.js +9 -1
  37. package/dist/cli-errors.js +4 -0
  38. package/dist/command-contract.d.ts +8 -2
  39. package/dist/command-contract.js +3 -2
  40. package/dist/command-help.d.ts +8 -6
  41. package/dist/command-help.js +65 -14
  42. package/dist/env-flags.d.ts +7 -0
  43. package/dist/env-flags.js +23 -0
  44. package/dist/functions/commands.js +66 -11
  45. package/dist/functions/manifest.d.ts +5 -0
  46. package/dist/functions/manifest.js +44 -23
  47. package/dist/functions/service-account-guidance.d.ts +21 -0
  48. package/dist/functions/service-account-guidance.js +62 -0
  49. package/dist/functions/workspace.d.ts +11 -0
  50. package/dist/functions/workspace.js +52 -0
  51. package/dist/machine-output.d.ts +7 -0
  52. package/dist/machine-output.js +56 -0
  53. package/dist/main.d.ts +2 -1
  54. package/dist/main.js +32 -4
  55. package/dist/orm/delegate.js +49 -6
  56. package/dist/orm/execute.js +11 -5
  57. package/dist/orm/failures.d.ts +32 -0
  58. package/dist/orm/failures.js +75 -0
  59. package/dist/orm/read.js +3 -3
  60. package/dist/orm/version-guard.d.ts +3 -0
  61. package/dist/orm/version-guard.js +63 -0
  62. package/dist/pipeline/commands.js +4 -1
  63. package/dist/principals/commands.d.ts +3 -0
  64. package/dist/principals/commands.js +124 -0
  65. package/dist/process/commands.js +9 -3
  66. package/dist/process/human-input-probe.d.ts +23 -0
  67. package/dist/process/human-input-probe.js +118 -0
  68. package/dist/process/lint.d.ts +2 -0
  69. package/dist/process/lint.js +10 -0
  70. package/dist/process/run-steps.d.ts +112 -0
  71. package/dist/process/run-steps.js +123 -0
  72. package/dist/process/runs.d.ts +4 -3
  73. package/dist/process/runs.js +69 -21
  74. package/dist/release-age.d.ts +1 -1
  75. package/dist/release-age.js +1 -0
  76. package/dist/repos/commands.d.ts +57 -0
  77. package/dist/repos/commands.js +83 -15
  78. package/dist/repos/init-repo.d.ts +45 -0
  79. package/dist/repos/init-repo.js +257 -0
  80. package/dist/repos/primitive-declaration.d.ts +43 -0
  81. package/dist/repos/primitive-declaration.js +212 -0
  82. package/dist/sandbox-unpushed-warning.d.ts +23 -0
  83. package/dist/sandbox-unpushed-warning.js +86 -0
  84. package/dist/service-accounts/commands.js +15 -3
  85. package/dist/templates/commands.d.ts +14 -2
  86. package/dist/templates/commands.js +70 -16
  87. package/dist/templates/process/pnpm-workspace.yaml +1 -0
  88. package/package.json +15 -12
  89. package/templates/process/pnpm-workspace.yaml +1 -0
package/dist/bin.js CHANGED
@@ -24,10 +24,18 @@ run(argv)
24
24
  // The update notice runs after the command so it never delays real output,
25
25
  // and it is best-effort (never throws, never changes the exit code).
26
26
  .then(async (code) => {
27
- if (!isHelpOrDiscovery && !isOfflineCommand && !(argv[0] === 'auth' && argv[1] === 'git-credential')) {
27
+ const isGitCredential = argv[0] === 'auth' && argv[1] === 'git-credential';
28
+ if (!isHelpOrDiscovery && !isOfflineCommand && !isGitCredential) {
28
29
  const { maybeNotifyUpdate } = await import('./update-check.js');
29
30
  await maybeNotifyUpdate();
30
31
  }
32
+ // Sandbox token mode only: a stderr reminder when the cwd's checkout holds
33
+ // work that is not pushed. Never during a git push's own credential call.
34
+ if (!isGitCredential) {
35
+ await import('./sandbox-unpushed-warning.js')
36
+ .then(({ warnUnpushedSandboxWork }) => warnUnpushedSandboxWork())
37
+ .catch(() => undefined);
38
+ }
31
39
  // Forced exit discards queued stdout/stderr when callers pipe large JSON
32
40
  // responses. Let Node drain pending writes before exiting with this status.
33
41
  process.exitCode = code;
@@ -1,3 +1,4 @@
1
+ import { PlatformError } from '@sequenceholdings/platform';
1
2
  import { AtlasApiError } from './atlas-client.js';
2
3
  export const LOG = '[seq-studio]';
3
4
  /** Map common apply failure reasons to clearer copy (original reason is preserved). */
@@ -69,6 +70,9 @@ function nextStepForAtlasError(error) {
69
70
  return null;
70
71
  }
71
72
  export function formatCliError(error) {
73
+ // Shared domain clients retain the CLI's existing status/path guidance.
74
+ if (error instanceof PlatformError)
75
+ return formatCliError(new AtlasApiError(error.status, error.message, error.path ?? '', '', { code: error.code }));
72
76
  if (error instanceof AtlasApiError) {
73
77
  const lines = [`${LOG} ${error.status}${error.statusText ? ` ${error.statusText}` : ''}: ${error.message}`];
74
78
  if (error.path)
@@ -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 runtime resource access";
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";
@@ -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 runtime resource access', lifecycle: 'preview', access: 'authenticated', subcommands: ['definitions', 'list', 'grant', 'revoke', 'resolve'] },
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
  ];
@@ -1,12 +1,14 @@
1
1
  /** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
2
- export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <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 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";
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 In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
4
+ export declare const ORM_HELP = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n seq-studio orm operation show <namespace> <name> -e <env> [--json]\n seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n Schema commands require the ORM loaded by seq-studio to satisfy the v2\n namespace's package.json @sequenceholdings/orm range before compiling.\n apply waits until the new version is live and serving (default up to 20m), then\n prints \"live:\"; --no-wait returns once the apply is queued.\n namespaces lists what you can read; describe shows its tables and operations.\n Run seq-studio orm describe --help for the output.\n execute <namespace> <operation> runs the deployed version's persisted operation by\n name, with no checkout. Run seq-studio orm execute --help for both forms.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
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> 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 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\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";
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 needs invoker on the process, show and\n list return only runs you can view, and cancel needs invoker on the process.\n --version pins a published process version; omitted, the active version runs.\n --run-id makes start idempotent: repeating it for the same process returns the\n existing run instead of starting another. --metadata-file is a JSON object\n stored on the run.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out.\n";
7
+ 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 In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
8
+ export declare const 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 In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
10
+ export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos identity <ns>/<name> -e <env> [--write --dir .] show/install the server-issued identity receipt\n --adopt --write --yes admin-only legacy binding; commit the receipt via PR\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write. Returns once\n the repo resolves by name, so clone can follow\n at once. The init commands take --repo\n <ns>/<name> to create, clone, and scaffold\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|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>]]\n [--steps [--node <node-id>] [--full]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start and retry need invoker on the process,\n show and list return only runs you can view, and cancel needs invoker on the\n process.\n start prints the new run's id. Omit --run-id for a fresh id on every start.\n --run-id names exactly one run: repeating it for the same process returns that\n run, whatever its status, instead of starting another. To run a failed run\n again, retry it rather than inventing a new id.\n --version pins a published process version; omitted, the active version runs.\n --metadata-file is a JSON object stored on the run.\n retry (CLI 0.9.0+) starts a new run of a failed, cancelled or timed_out run's\n process version with the same metadata, entity and title, linked to the\n original in its lineage, and prints the new id. Other statuses are refused.\n Like start, a retry waits queued while the process is at its concurrent-run\n limit.\n --run-id on retry names the new run, so repeating the retry returns it.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out. show prints the run's error when it failed.\n show --steps (CLI 0.9.1+) prints each step's status, edge, error, input and\n output, with the same viewer permission as show. Inputs, outputs and errors\n over 2000 characters are cut to a preview; --full prints them whole.\n --node narrows to one node. With --json, --steps returns { run, steps } with\n the same bounds; each step's truncated map names its cut fields and their full\n length. A failure in a node's input mapper happens before its step\n starts, so it shows only as the run's error.\n";
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 }: {
@@ -1,10 +1,22 @@
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
+ In a git-service checkout (with or without --repo), orm init, functions init
10
+ and artifact init also declare the scaffold under resources in
11
+ .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside
12
+ a declared application is not declared; add it to that app with seq-studio add.
13
+ `;
2
14
  export const ORM_HELP = `usage:
3
- seq-studio orm init <dir>
15
+ seq-studio orm init <dir> [--repo <ns>/<name>]
4
16
  seq-studio orm generate [dir] [--migration-export] [--check]
5
17
  seq-studio orm validate [dir]
6
18
  seq-studio orm plan [dir] -e <env>
7
- seq-studio orm apply [dir] -e <env>
19
+ seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]
8
20
  seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
9
21
  seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
10
22
  seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
@@ -18,6 +30,10 @@ export const ORM_HELP = `usage:
18
30
 
19
31
  -e/--env is required for commands that contact Atlas. Use seq-studio envs list
20
32
  to discover environments and seq-studio login to authenticate.
33
+ Schema commands require the ORM loaded by seq-studio to satisfy the v2
34
+ namespace's package.json @sequenceholdings/orm range before compiling.
35
+ apply waits until the new version is live and serving (default up to 20m), then
36
+ prints "live:"; --no-wait returns once the apply is queued.
21
37
  namespaces lists what you can read; describe shows its tables and operations.
22
38
  Run seq-studio orm describe --help for the output.
23
39
  execute <namespace> <operation> runs the deployed version's persisted operation by
@@ -25,7 +41,8 @@ export const ORM_HELP = `usage:
25
41
  read and sql query a v2 namespace as you through its built-in read-only SQL.
26
42
  sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).
27
43
  Run seq-studio orm read --help for the filter grammar, parameters, and output formats.
28
- `;
44
+
45
+ ${INIT_INTO_REPO_HELP}`;
29
46
  /** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
30
47
  export const ARTIFACT_SANDBOX_HELP = ` In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan
31
48
  and deploy take --repo: push the app to a Git Service repository and deploy
@@ -36,7 +53,7 @@ export const ARTIFACT_SANDBOX_HELP = ` In an agent sandbox (SEQ_STUDIO_BASE_URL
36
53
  unavailable there, and -e is ignored.
37
54
  `;
38
55
  export const ARTIFACT_HELP = `usage:
39
- seq-studio artifact init <dir> [--template react-vite|nextjs]
56
+ seq-studio artifact init <dir> [--template react-vite|nextjs] [--repo <namespace>/<name>]
40
57
  seq-studio artifact whoami -e <env>
41
58
  seq-studio artifact link [dir] -e <env> [--project <id>]
42
59
  seq-studio artifact env list|use <env>
@@ -55,6 +72,7 @@ export const ARTIFACT_HELP = `usage:
55
72
  deployment workflows have different source and approval rules; see the public
56
73
  CLI README.
57
74
 
75
+ ${INIT_INTO_REPO_HELP}
58
76
  ${ARTIFACT_SANDBOX_HELP}`;
59
77
  export const PIPELINE_HELP = `usage:
60
78
  seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]
@@ -73,6 +91,8 @@ export const PIPELINE_HELP = `usage:
73
91
  Source identity must be adopted and belong to the destination tenant.
74
92
  Registered OpCo source origins are not supported yet. The target verifies
75
93
  and snapshots source before planning; no target repository is created.
94
+ Reviewed pipeline.config.yml source_paths can select runtime files and
95
+ directories, retaining pipeline metadata, release identity and size limits.
76
96
  Not compatible with --dir, existing IDs, or coordinated migrations.
77
97
  Rollback uses retained snapshots; historical source commits can be re-planned
78
98
  explicitly with deploy --ref <sha> --source-env <env>.
@@ -88,7 +108,8 @@ export const PIPELINE_HELP = `usage:
88
108
  Help is available offline.
89
109
  `;
90
110
  export const FUNCTIONS_USAGE = `usage:
91
- seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers
111
+ seq-studio functions init <dir> [--repo <ns>/<name>] scaffold manifest, TypeScript handler, and docs pointers;
112
+ --repo scaffolds into a git-service repo (see Init into a repo)
92
113
  seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)
93
114
  seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy
94
115
  seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress
@@ -128,12 +149,21 @@ export const FUNCTIONS_USAGE = `usage:
128
149
  Remote sources record the pinned commit as provenance (never dirty) and NEVER
129
150
  read a repo-committed .env for secret values — provision secrets server-side
130
151
  or pass a local --from-env-file (resolved against your cwd).
152
+ Local deploys record repository-wide gitDirty, including unignored files
153
+ outside --dir. Check git status at the repository root before deploying.
154
+
155
+ Workspace dependencies are compiled from packages declared in a containing
156
+ sequence.app.yml, within the source repository. Only the selected function is
157
+ deployed: no sibling primitives or Application registration. Shared Node packages
158
+ can set package.json seqStudio.source to a root source entry for clean builds.
159
+ Package build scripts are not run. Local secret paths remain relative to --dir.
131
160
 
132
161
  Interactive --repo builds clone over smart-HTTP using your seq-studio login
133
162
  and repository read access. No PAT is needed. Headless M2M builds use JSON
134
163
  materialize and accept only platform-managed --repo sources. Use --env to
135
164
  select the same environment for source and deployment.
136
- `;
165
+
166
+ ${INIT_INTO_REPO_HELP}`;
137
167
  export const REPOS_USAGE = `usage:
138
168
  seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment
139
169
  seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces
@@ -143,7 +173,10 @@ export const REPOS_USAGE = `usage:
143
173
  seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]
144
174
  create a repo seeded with a README; --git-backend
145
175
  walgit creates it empty (for pushing existing
146
- history); needs namespace write
176
+ history); needs namespace write. Returns once
177
+ the repo resolves by name, so clone can follow
178
+ at once. The init commands take --repo
179
+ <ns>/<name> to create, clone, and scaffold
147
180
  seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]
148
181
  seq-studio repos clone --url <https://…/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]
149
182
  seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]
@@ -179,22 +212,40 @@ export const REPOS_USAGE = `usage:
179
212
  export const PROCESS_RUNS_USAGE = `usage:
180
213
  seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]
181
214
  [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]
215
+ seq-studio process runs retry <run-id> -e <env> [--run-id <new-id>] [--json]
182
216
  seq-studio process runs list -e <env> [--process <id>] [--status <status>]
183
217
  [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]
184
- seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]
218
+ seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]]
219
+ [--steps [--node <node-id>] [--full]] [--json]
185
220
  seq-studio process runs cancel <run-id> -e <env> [--json]
186
221
 
187
- Runs start and are read as you: start needs invoker on the process, show and
188
- list return only runs you can view, and cancel needs invoker on the process.
222
+ Runs start and are read as you: start and retry need invoker on the process,
223
+ show and list return only runs you can view, and cancel needs invoker on the
224
+ process.
225
+ start prints the new run's id. Omit --run-id for a fresh id on every start.
226
+ --run-id names exactly one run: repeating it for the same process returns that
227
+ run, whatever its status, instead of starting another. To run a failed run
228
+ again, retry it rather than inventing a new id.
189
229
  --version pins a published process version; omitted, the active version runs.
190
- --run-id makes start idempotent: repeating it for the same process returns the
191
- existing run instead of starting another. --metadata-file is a JSON object
192
- stored on the run.
230
+ --metadata-file is a JSON object stored on the run.
231
+ retry (CLI 0.9.0+) starts a new run of a failed, cancelled or timed_out run's
232
+ process version with the same metadata, entity and title, linked to the
233
+ original in its lineage, and prints the new id. Other statuses are refused.
234
+ Like start, a retry waits queued while the process is at its concurrent-run
235
+ limit.
236
+ --run-id on retry names the new run, so repeating the retry returns it.
193
237
  list returns the newest runs first, up to --limit (default 50, max 500); the run
194
238
  API has no cursor, so narrow with filters to reach older runs.
195
239
  --status: pending, running, completed, failed, cancelled, timed_out.
196
240
  show --wait polls until the run finishes (default timeout 600s); the run keeps
197
- going if the wait times out.
241
+ going if the wait times out. show prints the run's error when it failed.
242
+ show --steps (CLI 0.9.1+) prints each step's status, edge, error, input and
243
+ output, with the same viewer permission as show. Inputs, outputs and errors
244
+ over 2000 characters are cut to a preview; --full prints them whole.
245
+ --node narrows to one node. With --json, --steps returns { run, steps } with
246
+ the same bounds; each step's truncated map names its cut fields and their full
247
+ length. A failure in a node's input mapper happens before its step
248
+ starts, so it shows only as the run's error.
198
249
  `;
199
250
  export const ORM_DISCOVER_HELP = `usage:
200
251
  seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
@@ -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
- return await buildFromResolvedSource({ spec, source: { ...source, dir } });
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
- return await deployFromResolvedSource({ args, spec, ctx, source: { ...source, dir } });
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
- const manifest = await readSourceManifest(dir, spec);
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' ? dir : process.cwd(), envFileFlag)
599
+ : resolve(spec.kind === 'local' ? originalDir : process.cwd(), envFileFlag)
546
600
  : spec.kind === 'local'
547
- ? join(dir, '.env')
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 = spec.kind === 'local' ? await gitMetadata(dir) : source.provenance;
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>;