@sequenceholdings/studio-cli 0.5.3 → 0.5.5

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 (63) hide show
  1. package/README.md +220 -12
  2. package/dist/agents/bundle.d.ts +8 -0
  3. package/dist/agents/bundle.js +38 -0
  4. package/dist/agents/commands.d.ts +6 -1
  5. package/dist/agents/commands.js +17 -20
  6. package/dist/agents/selection.d.ts +3 -0
  7. package/dist/agents/selection.js +17 -0
  8. package/dist/agents/source.js +2 -1
  9. package/dist/app/adapters.js +2 -1
  10. package/dist/app/application-registration.d.ts +1 -1
  11. package/dist/app/application-registration.js +6 -2
  12. package/dist/app/commands.d.ts +6 -0
  13. package/dist/app/commands.js +13 -4
  14. package/dist/app/primitive-scaffold.js +8 -1
  15. package/dist/app/readme.js +1 -1
  16. package/dist/app/scaffold.js +1 -1
  17. package/dist/artifact/delegate.js +16 -4
  18. package/dist/atlas-client.js +5 -1
  19. package/dist/auth-cmds/commands.d.ts +1 -1
  20. package/dist/auth-cmds/commands.js +3 -0
  21. package/dist/auth.d.ts +2 -1
  22. package/dist/auth.js +16 -0
  23. package/dist/command-contract.d.ts +9 -9
  24. package/dist/command-contract.js +7 -7
  25. package/dist/command-help.d.ts +3 -2
  26. package/dist/command-help.js +31 -3
  27. package/dist/command-input.js +2 -2
  28. package/dist/config.d.ts +5 -0
  29. package/dist/config.js +14 -1
  30. package/dist/env-flags.d.ts +6 -0
  31. package/dist/env-flags.js +9 -0
  32. package/dist/functions/commands.d.ts +5 -2
  33. package/dist/functions/commands.js +36 -10
  34. package/dist/functions/deploy-preflight.js +2 -2
  35. package/dist/functions/manifest.d.ts +43 -29
  36. package/dist/functions/manifest.js +37 -74
  37. package/dist/main.js +43 -3
  38. package/dist/orm/delegate.js +25 -4
  39. package/dist/orm/read.d.ts +54 -0
  40. package/dist/orm/read.js +308 -0
  41. package/dist/pipeline/commands.js +10 -0
  42. package/dist/pipeline/discovery.js +3 -16
  43. package/dist/pipeline/retirement.d.ts +3 -0
  44. package/dist/pipeline/retirement.js +34 -0
  45. package/dist/process/build.js +4 -0
  46. package/dist/process/codegen.js +2 -0
  47. package/dist/process/commands.js +66 -25
  48. package/dist/process/plan-diff.js +1 -0
  49. package/dist/process/runs.d.ts +14 -0
  50. package/dist/process/runs.js +238 -0
  51. package/dist/repos/ci-status.js +28 -0
  52. package/dist/repos/commands.d.ts +2 -2
  53. package/dist/repos/commands.js +11 -4
  54. package/dist/repos/git-credential.d.ts +3 -2
  55. package/dist/repos/git-credential.js +52 -3
  56. package/dist/repos/pulls.d.ts +7 -1
  57. package/dist/repos/pulls.js +162 -22
  58. package/dist/sandbox-auth.d.ts +52 -0
  59. package/dist/sandbox-auth.js +105 -0
  60. package/dist/storage/commands.js +6 -5
  61. package/dist/text-table.d.ts +7 -0
  62. package/dist/text-table.js +16 -0
  63. package/package.json +9 -9
@@ -8,6 +8,12 @@ import type { ParsedArgs } from '../process/commands.js';
8
8
  export declare const APP_INIT_USAGE: string;
9
9
  export declare const APP_ADD_USAGE: string;
10
10
  export declare const APP_DEPLOY_USAGE = "usage:\n seq-studio deploy -e <env> [options]\n\n Deploy the app declared in sequence.app.yml. Versions 2 and 3 use\n depends_on prerequisites; deploy.order optionally orders ready primitives.\n Runs each kind's existing command:\n orm \u2192 seq-studio orm apply <path> -e <env>\n function \u2192 seq-studio functions deploy --dir <path> -e <env> [--yes]\n agent \u2192 seq-studio agents apply --dir <path> -e <env> [--yes], config-only (access stays in Atlas)\n process \u2192 seq-studio process apply --dir <path> -e <env>\n pipeline \u2192 seq-studio pipeline deploy --repo <repo> --ref <ref> -e <env>\n artifact \u2192 seq-studio artifact deploy <path> -e <env>\n\n Options:\n -e, --env <name> target environment (required)\n --dir <path> app root (default: cwd; must contain sequence.app.yml)\n --only <id1,id2> deploy these ids and their prerequisites (v2)\n --yes non-interactive (forwarded to primitive commands)\n --dry-run validate/compile selected sources without deploying (v2)\n --approved-by <sub> recorded caller approval for protected pipeline targets\n --wait-timeout <d> pipeline polling timeout, e.g. 10m or 2h\n\n Examples:\n seq-studio deploy -e staging --yes\n seq-studio deploy -e local --only get-pokemon --yes\n seq-studio deploy --dir ./pokedex -e staging --dry-run\n\n Run from the app root (directory with sequence.app.yml), or pass --dir.\n Version 1 manifests keep their existing ordering and exact --only behavior.\n Pipelines require repo and ref in their manifest entry.\n ORM namespaces require generated code and a reviewed migration ledger:\n seq-studio orm generate <path> && seq-studio orm diff <path>\n Commit generated migrations before the first deployment and schema changes.\n Pipeline preflight reads the remote source and pins its commit; dry-run\n therefore needs network/auth for pipelines. Version 1 dry-run only lists.\n A dry-run never opens a browser login: without a session it skips the\n workspace-binding check and says so. It warns, rather than fails, when the\n artifact source is not committed and clean on main.\n Version 2 writes the result to .sequence/deployments/<environment>.json.\n";
11
+ /**
12
+ * Hosted Next.js apps deploy only where the deployment runs the Next.js
13
+ * runtime, which not every deployment does yet; the server then refuses with
14
+ * "Next.js applications are not enabled".
15
+ */
16
+ export declare const NEXTJS_RUNTIME_NOTE: string;
11
17
  export declare function runAppInitCommand(args: ParsedArgs): Promise<number>;
12
18
  export declare function runAppAddCommand({ kindArg, args, }: {
13
19
  kindArg: string | undefined;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { basename, resolve } from 'node:path';
8
8
  import { parseDurationMs } from '@sequenceholdings/lattice';
9
- import { REQUIRE_EXPLICIT_ENV_MESSAGE } from '../env-flags.js';
9
+ import { REQUIRE_EXPLICIT_ENV_MESSAGE, explicitOrSandboxEnv } from '../env-flags.js';
10
10
  import { deployApp } from './deploy.js';
11
11
  import { DEFAULT_APP_KINDS, resolveRequestedKinds } from './kinds.js';
12
12
  import { AppPreparationError, prepareScaffoldedApp } from './prepare.js';
@@ -49,12 +49,12 @@ export const APP_INIT_USAGE = `usage:
49
49
  Examples:
50
50
  seq-studio init pokedex
51
51
  seq-studio init . --template nextjs
52
- seq-studio init uw362 # a new app inside an existing repository
52
+ seq-studio init reports # a new app inside an existing repository
53
53
  seq-studio init pokedex --with orm,function,artifact
54
54
  seq-studio init pokedex --with orm,function,artifact --function-name get-pokemon
55
55
  seq-studio init loan-tools --with function --function-name get-loan
56
56
  seq-studio init review-app --with orm,function,agent,process,pipeline,artifact
57
- seq-studio init review-app --template full-stack@1.0.0 -e banksouth-mortgage
57
+ seq-studio init review-app --template full-stack@1.0.0 -e staging
58
58
  `;
59
59
  export const APP_ADD_USAGE = `usage:
60
60
  seq-studio add <kind> <name> [--depends-on <ids>] [--pipeline-type <type>] [--template <t>]
@@ -138,8 +138,17 @@ function artifactTemplateFlag({ flags, kinds }) {
138
138
  throw new Error('--template requires react-vite or nextjs');
139
139
  if (!kinds.includes('artifact'))
140
140
  throw new Error('--template only applies when scaffolding an artifact');
141
+ if (value === 'nextjs')
142
+ console.warn(NEXTJS_RUNTIME_NOTE);
141
143
  return value;
142
144
  }
145
+ /**
146
+ * Hosted Next.js apps deploy only where the deployment runs the Next.js
147
+ * runtime, which not every deployment does yet; the server then refuses with
148
+ * "Next.js applications are not enabled".
149
+ */
150
+ export const NEXTJS_RUNTIME_NOTE = `${LOG} note: a Next.js app deploys only to a deployment with the Next.js runtime turned on. ` +
151
+ 'Check with your administrator before you build on it; react-vite (the default) deploys everywhere.';
143
152
  function printError(error) {
144
153
  const message = error instanceof Error ? error.message : String(error);
145
154
  console.error(`${LOG} ${message}`);
@@ -347,7 +356,7 @@ export async function runAppDeployCommand(args) {
347
356
  return 1;
348
357
  }
349
358
  const waitTimeout = flagString(args.flags, 'wait-timeout');
350
- const env = flagString(args.flags, 'env') ?? flagString(args.flags, 'e');
359
+ const env = explicitOrSandboxEnv(flagString(args.flags, 'env') ?? flagString(args.flags, 'e'));
351
360
  if (!env) {
352
361
  console.error(`${LOG} ${REQUIRE_EXPLICIT_ENV_MESSAGE}`);
353
362
  console.error(APP_DEPLOY_USAGE);
@@ -110,11 +110,18 @@ export async function scaffoldKind({ kind, appRoot, appId, name, pipelineType =
110
110
  await mkdir(absPath, { recursive: true });
111
111
  await scaffoldArtifact({ absPath, appId: name, template: artifactTemplate });
112
112
  break;
113
- case 'agent':
113
+ case 'agent': {
114
114
  if (await agentsInitCommand(parseArgs([absPath])) !== 0) {
115
115
  throw new Error(`agents init failed for ${absPath}`);
116
116
  }
117
+ // Name the scaffolded agent, as a process entry names its process: CI deploys
118
+ // exactly this agent, and the Application lists it as a member by its id.
119
+ const { compileAgentSource } = await import('../agents/source.js');
120
+ const [definition] = (await compileAgentSource({ directory: absPath })).definitions;
121
+ if (definition)
122
+ entry.only = [definition.id];
117
123
  break;
124
+ }
118
125
  case 'process':
119
126
  if (await processInitCommand(parseArgs([absPath])) !== 0) {
120
127
  throw new Error(`process init failed for ${absPath}`);
@@ -219,7 +219,7 @@ function renderImplementSection({ kinds, functionName, appId }) {
219
219
  if (kinds.has('process'))
220
220
  steps.push(`- **Lattice:** edit \`processes/${appId}/${appId}/process.ts\`; run \`seq-studio process lint --dir processes/${appId} --offline\`.`);
221
221
  if (kinds.has('pipeline'))
222
- steps.push(`- **Pipeline:** complete \`pipelines/${appId}/${appId}.stage.yml\` and its source; run \`seq-studio pipeline validate pipelines/${appId}\`. The template is a transformation stage by default; \`--pipeline-type\` selects ingestion or serving. Pipeline deployment uses a platform git-service release unit: set this primitive's \`repo: pipelines/<repository>\` and \`ref\` in \`sequence.app.yml\`, and commit/push its source to that repository before deployment. A serving template also requires a real producing stage.`);
222
+ steps.push(`- **Pipeline:** complete \`pipelines/${appId}/${appId}.stage.yml\` and its source; run \`seq-studio pipeline validate pipelines/${appId}\`. The template is a transformation stage by default; \`--pipeline-type\` selects ingestion or serving. Pipeline deployment uses a platform git-service release unit: set this primitive's \`repo\` (this app's repository, \`<namespace>/<repository>\`) and \`ref\` in \`sequence.app.yml\`, and commit/push its source to that repository before deployment. A serving template also requires a real producing stage.`);
223
223
  if (kinds.has('artifact'))
224
224
  steps.push(`- **UI:** implement \`artifact/src/App.tsx\` with \`@sequenceholdings/atlas-ui\`; declare capabilities and deployment \`targets\` in \`artifact.bundle.yml\`. Scaffolds are private; set sharing intentionally. Validate with \`seq-studio artifact validate artifact\`.`);
225
225
  return steps.join('\n');
@@ -209,7 +209,7 @@ export function printInitNextSteps({ appRoot, manifest, prepared, }) {
209
209
  printOrmPreparation({ primitives: manifest.primitives });
210
210
  }
211
211
  console.log(' Push a branch and open a PR; checks run automatically, and merging to main publishes the app.');
212
- console.log(` No repository yet? seq-studio repos create artifacts/${manifest.app.id} -e <env>, then push this app to it.`);
212
+ console.log(` No repository yet? seq-studio repos create <namespace>/${manifest.app.id} -e <env> (your team's namespace), then push this app to it.`);
213
213
  console.log(' # add another primitive later:');
214
214
  console.log(' seq-studio add function list-types');
215
215
  console.log(' seq-studio add package contracts');
@@ -155,15 +155,27 @@ export async function runArtifactCommand(sub, rest) {
155
155
  const targetUrl = resolved?.url ??
156
156
  process.env['ARTIFACT_STUDIO_BASE_URL']?.trim() ??
157
157
  (authEnvName ? routingConfig.envs[authEnvName]?.url : undefined);
158
- setTokenProvider(({ allowInteractiveLogin }) => allowInteractiveLogin
159
- ? getAccessTokenWithMode({ env: authEnvName, targetUrl })
160
- : tryGetAccessTokenWithMode({
158
+ setTokenProvider(async ({ allowInteractiveLogin }) => artifactCredential(allowInteractiveLogin
159
+ ? await getAccessTokenWithMode({ env: authEnvName, targetUrl })
160
+ : await tryGetAccessTokenWithMode({
161
161
  failClosedForM2m: true,
162
162
  env: authEnvName,
163
163
  targetUrl,
164
- }));
164
+ })));
165
165
  return runArtifactStudio([sub, ...argvForCli]);
166
166
  }
167
+ /**
168
+ * Artifact Studio uses only credentials the CLI obtained itself. `main.ts`
169
+ * refuses artifact commands in sandbox token mode before reaching here; this
170
+ * keeps the rule if the delegate is ever called directly.
171
+ */
172
+ function artifactCredential(auth) {
173
+ if (!auth)
174
+ return null;
175
+ if (auth.authMode === 'sandbox')
176
+ throw new Error('Artifact Studio does not accept sandbox tokens. Authenticate with seq-studio login.');
177
+ return { authMode: auth.authMode, token: auth.token };
178
+ }
167
179
  /**
168
180
  * Strip the seq-studio-only `--pr <number>` and `--env-url <url>` flags from
169
181
  * argv and return the rest (forwarded to artifact-studio) plus the parsed
@@ -7,6 +7,7 @@
7
7
  import { authenticatedRequestUrl } from '@sequenceholdings/artifact-studio/deployment-validation';
8
8
  import { validationDetail } from './validation-detail.js';
9
9
  import { PREVIEW_DOMAIN } from './preview.js';
10
+ import { sandboxBearerFor } from './sandbox-auth.js';
10
11
  const MAX_503_RETRIES = 5;
11
12
  const DEFAULT_RETRY_AFTER_SECONDS = 2;
12
13
  const LOG_PREFIX = '[seq-studio]';
@@ -39,6 +40,9 @@ async function fetchWith503Retry(input, init) {
39
40
  }
40
41
  async function authenticatedFetch({ baseUrl, init = {}, path, token, retry503 = true, }) {
41
42
  const url = authenticatedRequestUrl({ baseUrl, path });
43
+ // Sandbox tokens rotate between requests, so a long command re-reads the file
44
+ // for every call instead of reusing the token it resolved at startup.
45
+ const bearer = (await sandboxBearerFor(baseUrl)) ?? token;
42
46
  const send = retry503 ? fetchWith503Retry : fetch;
43
47
  return send(url, {
44
48
  ...init,
@@ -47,7 +51,7 @@ async function authenticatedFetch({ baseUrl, init = {}, path, token, retry503 =
47
51
  ...previewAccessHeaders(baseUrl),
48
52
  ...cfAccessHeaders(baseUrl),
49
53
  ...init.headers,
50
- Authorization: `Bearer ${token}`,
54
+ Authorization: `Bearer ${bearer}`,
51
55
  },
52
56
  });
53
57
  }
@@ -1,3 +1,3 @@
1
1
  import type { ParsedArgs } from '../process/commands.js';
2
- export declare const AUTH_USAGE = "usage:\n seq-studio auth whoami -e <env> [--json]\n seq-studio auth git-credential --env <env> --url <clone-url> <get|store|erase>\n Git authentication uses seq-studio login. repos clone installs the helper.\n";
2
+ export declare const AUTH_USAGE = "usage:\n seq-studio auth whoami -e <env> [--json]\n seq-studio auth git-credential --env <env> --url <clone-url> <get|store|erase>\n Git authentication uses seq-studio login. repos clone installs the helper.\n In sandbox token mode (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE) the helper\n answers with the sandbox token for git-service repositories on that origin only;\n --env and --url are optional there.\n";
3
3
  export declare function runAuthCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
@@ -6,6 +6,9 @@ export const AUTH_USAGE = `usage:
6
6
  seq-studio auth whoami -e <env> [--json]
7
7
  seq-studio auth git-credential --env <env> --url <clone-url> <get|store|erase>
8
8
  Git authentication uses seq-studio login. repos clone installs the helper.
9
+ In sandbox token mode (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE) the helper
10
+ answers with the sandbox token for git-service repositories on that origin only;
11
+ --env and --url are optional there.
9
12
  `;
10
13
  export async function runAuthCommand(sub, args) {
11
14
  try {
package/dist/auth.d.ts CHANGED
@@ -120,7 +120,8 @@ export declare class UnsafeAuthTargetError extends Error {
120
120
  * that must never sign anyone in as a side effect.
121
121
  */
122
122
  export declare function withoutAutoLogin<T>(fn: () => Promise<T>): Promise<T>;
123
- export type AuthMode = 'm2m' | 'user';
123
+ /** `sandbox`: the caller-scoped bearer Atlas writes into an agent sandbox (see sandbox-auth.ts). */
124
+ export type AuthMode = 'm2m' | 'user' | 'sandbox';
124
125
  export interface ResolvedAccessToken {
125
126
  authMode: AuthMode;
126
127
  token: string;
package/dist/auth.js CHANGED
@@ -5,6 +5,7 @@ import { homedir } from 'node:os';
5
5
  import { join } from 'node:path';
6
6
  import { validateDeploymentAudience, validateDeploymentBaseUrl, } from '@sequenceholdings/artifact-studio/deployment-validation';
7
7
  import { withCrossProcessFileLock } from './file-lock.js';
8
+ import { isSandboxOrigin, readSandboxToken, SandboxAuthError, sandboxTarget } from './sandbox-auth.js';
8
9
  function hasErrorCode(error, code) {
9
10
  return error instanceof Error && Reflect.get(error, 'code') === code;
10
11
  }
@@ -475,7 +476,20 @@ function validateRealmTarget({ realm, targetUrl, }) {
475
476
  `${error instanceof Error ? error.message : String(error)}`, { cause: error });
476
477
  }
477
478
  }
479
+ async function sandboxAccessToken(targetUrl) {
480
+ const sandbox = sandboxTarget();
481
+ if (!sandbox)
482
+ return null;
483
+ if (targetUrl && !isSandboxOrigin({ target: sandbox, url: targetUrl })) {
484
+ throw new UnsafeAuthTargetError(`Refusing to send the sandbox token to ${targetUrl}: sandbox token mode only targets ${sandbox.baseUrl}.`);
485
+ }
486
+ return { authMode: 'sandbox', token: await readSandboxToken(sandbox) };
487
+ }
478
488
  export async function getAccessTokenWithMode(options) {
489
+ // Sandbox token mode replaces every other source, before any realm lookup.
490
+ const sandbox = await sandboxAccessToken(options?.targetUrl);
491
+ if (sandbox)
492
+ return sandbox;
479
493
  const realm = await realmForEnv(options?.env, { targetUrl: options?.targetUrl });
480
494
  if (options?.targetUrl)
481
495
  validateRealmTarget({ realm, targetUrl: options.targetUrl });
@@ -539,6 +553,8 @@ export async function tryGetAccessTokenWithMode(options) {
539
553
  throw err;
540
554
  if (err instanceof AuthTokenStoreError)
541
555
  throw err;
556
+ if (err instanceof SandboxAuthError)
557
+ throw err;
542
558
  if (options?.failClosedForM2m) {
543
559
  // Do not replace an invalid tenant registration with the Sequence realm:
544
560
  // that could hide a rejected discovery token host or inspect the wrong
@@ -2,19 +2,19 @@
2
2
  export declare const COMMAND_CONTRACT: readonly [{
3
3
  readonly name: "init";
4
4
  readonly description: "Scaffold an app workspace or use a published template";
5
- readonly lifecycle: "internal";
5
+ readonly lifecycle: "preview";
6
6
  readonly access: "mixed";
7
7
  readonly subcommands: readonly [];
8
8
  }, {
9
9
  readonly name: "add";
10
10
  readonly description: "Add a primitive to an app workspace";
11
- readonly lifecycle: "internal";
11
+ readonly lifecycle: "preview";
12
12
  readonly access: "offline";
13
13
  readonly subcommands: readonly [];
14
14
  }, {
15
15
  readonly name: "deploy";
16
16
  readonly description: "Deploy an app workspace";
17
- readonly lifecycle: "internal";
17
+ readonly lifecycle: "preview";
18
18
  readonly access: "authenticated";
19
19
  readonly subcommands: readonly [];
20
20
  }, {
@@ -22,7 +22,7 @@ export declare const COMMAND_CONTRACT: readonly [{
22
22
  readonly description: "Build and operate Lattice processes";
23
23
  readonly lifecycle: "preview";
24
24
  readonly access: "mixed";
25
- readonly subcommands: readonly ["init", "lint", "plan", "apply", "test", "simulate", "bundle", "promote", "pull", "safety-baseline"];
25
+ readonly subcommands: readonly ["init", "lint", "plan", "apply", "test", "simulate", "bundle", "promote", "pull", "runs", "safety-baseline"];
26
26
  }, {
27
27
  readonly name: "artifact";
28
28
  readonly description: "Build and operate Artifact Studio apps";
@@ -40,7 +40,7 @@ export declare const COMMAND_CONTRACT: readonly [{
40
40
  readonly description: "Validate and deploy typed agent definitions";
41
41
  readonly lifecycle: "preview";
42
42
  readonly access: "mixed";
43
- readonly subcommands: readonly ["init", "validate", "plan", "apply", "list", "show"];
43
+ readonly subcommands: readonly ["init", "validate", "bundle", "plan", "apply", "list", "show"];
44
44
  }, {
45
45
  readonly name: "secrets";
46
46
  readonly description: "Manage organization-owned secrets";
@@ -76,7 +76,7 @@ export declare const COMMAND_CONTRACT: readonly [{
76
76
  readonly description: "Author and operate ORM namespaces";
77
77
  readonly lifecycle: "preview";
78
78
  readonly access: "mixed";
79
- readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "diff", "migrate-from-yaml", "import"];
79
+ readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "read", "sql", "diff", "migrate-from-yaml", "import"];
80
80
  }, {
81
81
  readonly name: "envs";
82
82
  readonly description: "Manage CLI environments";
@@ -115,10 +115,10 @@ export declare const COMMAND_CONTRACT: readonly [{
115
115
  readonly subcommands: readonly [];
116
116
  }, {
117
117
  readonly name: "storage";
118
- readonly description: "Manage platform storage";
119
- readonly lifecycle: "blocked";
118
+ readonly description: "Manage Workspaces V2 file storage";
119
+ readonly lifecycle: "preview";
120
120
  readonly access: "authenticated";
121
- readonly subcommands: readonly ["init", "validate", "apply", "list", "show", "mkdir", "upload", "download", "access", "trash", "restore", "purge", "operations", "abort", "delete"];
121
+ readonly subcommands: readonly ["init", "validate", "apply", "list", "show", "mkdir", "upload", "import", "uploads", "reconcile", "download", "access", "trash", "restore", "purge", "operations", "abort", "delete"];
122
122
  }, {
123
123
  readonly name: "access";
124
124
  readonly description: "Manage runtime resource access";
@@ -1,25 +1,25 @@
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: 'internal', access: 'mixed', subcommands: [] },
4
- { name: 'add', description: 'Add a primitive to an app workspace', lifecycle: 'internal', access: 'offline', subcommands: [] },
5
- { name: 'deploy', description: 'Deploy an app workspace', lifecycle: 'internal', access: 'authenticated', subcommands: [] },
6
- { name: 'process', description: 'Build and operate Lattice processes', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'lint', 'plan', 'apply', 'test', 'simulate', 'bundle', 'promote', 'pull', 'safety-baseline'] },
3
+ { name: 'init', description: 'Scaffold an app workspace or use a published template', lifecycle: 'preview', access: 'mixed', subcommands: [] },
4
+ { name: 'add', description: 'Add a primitive to an app workspace', lifecycle: 'preview', access: 'offline', subcommands: [] },
5
+ { name: 'deploy', description: 'Deploy an app workspace', lifecycle: 'preview', access: 'authenticated', subcommands: [] },
6
+ { name: 'process', description: 'Build and operate Lattice processes', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'lint', 'plan', 'apply', 'test', 'simulate', 'bundle', 'promote', 'pull', 'runs', 'safety-baseline'] },
7
7
  { name: 'artifact', description: 'Build and operate Artifact Studio apps', lifecycle: 'stable', access: 'mixed', subcommands: ['init', 'whoami', 'link', 'env', 'status', 'list', 'show', 'validate', 'build', 'plan', 'deploy', 'dev', 'promote', 'pull', 'rollback'] },
8
8
  { name: 'functions', description: 'Build and operate Managed Functions', lifecycle: 'stable', access: 'authenticated', subcommands: ['init', 'build', 'deploy', 'list', 'show', 'limits', 'invoke', 'logs', 'promote', 'rollback', 'delete'] },
9
- { name: 'agents', description: 'Validate and deploy typed agent definitions', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'validate', 'plan', 'apply', 'list', 'show'] },
9
+ { name: 'agents', description: 'Validate and deploy typed agent definitions', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'validate', 'bundle', 'plan', 'apply', 'list', 'show'] },
10
10
  { name: 'secrets', description: 'Manage organization-owned secrets', lifecycle: 'stable', access: 'authenticated', subcommands: ['create', 'set', 'list', 'attach', 'detach', 'apply'] },
11
11
  { name: 'repos', description: 'Manage repositories and native CI; ci init is offline', lifecycle: 'stable', access: 'mixed', subcommands: ['list', 'namespaces', 'show', 'create', 'clone', 'pull', 'pulls', 'delete', 'ci'] },
12
12
  { name: 'templates', description: 'Publish, synchronize, and list repository templates', lifecycle: 'internal', access: 'mixed', subcommands: ['publish', 'sync', 'list'] },
13
13
  { name: 'pipeline', description: 'Discover and operate Data Pipelines', lifecycle: 'preview', access: 'staff', subcommands: ['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'run-now', 'promote', 'rollback'] },
14
14
  { name: 'auth', description: 'Manage Git authentication', lifecycle: 'stable', access: 'authenticated', subcommands: ['whoami', 'git-credential', 'pat'] },
15
- { name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'diff', 'migrate-from-yaml', 'import'] },
15
+ { name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
16
16
  { name: 'envs', description: 'Manage CLI environments', lifecycle: 'stable', access: 'mixed', subcommands: ['add', 'list'] },
17
17
  { name: 'login', description: 'Authenticate with Sequence', lifecycle: 'stable', access: 'public', subcommands: [] },
18
18
  { name: 'logout', description: 'Remove cached user tokens', lifecycle: 'stable', access: 'public', subcommands: [] },
19
19
  { name: 'doctor', description: 'Diagnose CLI configuration and access', lifecycle: 'stable', access: 'mixed', subcommands: [] },
20
20
  { name: 'version', description: 'Print the installed CLI version', lifecycle: 'stable', access: 'offline', subcommands: [] },
21
21
  { name: 'help', description: 'Show command help', lifecycle: 'stable', access: 'offline', subcommands: [] },
22
- { name: 'storage', description: 'Manage platform storage', lifecycle: 'blocked', access: 'authenticated', subcommands: ['init', 'validate', 'apply', 'list', 'show', 'mkdir', 'upload', 'download', 'access', 'trash', 'restore', 'purge', 'operations', 'abort', 'delete'] },
22
+ { name: 'storage', description: 'Manage Workspaces V2 file storage', lifecycle: 'preview', access: 'authenticated', subcommands: ['init', 'validate', 'apply', 'list', 'show', 'mkdir', 'upload', 'import', 'uploads', 'reconcile', 'download', 'access', 'trash', 'restore', 'purge', 'operations', 'abort', 'delete'] },
23
23
  { name: 'access', description: 'Manage runtime resource access', lifecycle: 'preview', access: 'authenticated', subcommands: ['definitions', 'list', 'grant', 'revoke', 'resolve'] },
24
24
  { name: 'service-accounts', description: 'Manage runtime service accounts', lifecycle: 'preview', access: 'authenticated', subcommands: ['list', 'show', 'create'] },
25
25
  { name: 'capabilities', description: 'Print the supported CLI command surface', lifecycle: 'blocked', access: 'offline', subcommands: [] },
@@ -1,9 +1,10 @@
1
1
  /** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
2
- export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n";
2
+ export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n";
3
3
  export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n";
4
4
  export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
5
5
  export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a function shell without deploying\n seq-studio functions deploy -e <env> [-m msg] preflight deployed capabilities, then upload and deploy\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP using your seq-studio login\n and repository read access. No PAT is needed. Headless M2M builds use JSON\n materialize and accept only platform-managed --repo sources. Use --env to\n select the same environment for source and deployment.\n";
6
- export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci 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";
6
+ export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
7
+ export declare const PROCESS_RUNS_USAGE = "usage:\n seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]\n [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]\n seq-studio process runs list -e <env> [--process <id>] [--status <status>]\n [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]\n seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start needs invoker on the process, show and\n list return only runs you can view, and cancel needs invoker on the process.\n --version pins a published process version; omitted, the active version runs.\n --run-id makes start idempotent: repeating it for the same process returns the\n existing run instead of starting another. --metadata-file is a JSON object\n stored on the run.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out.\n";
7
8
  export declare function staticHelp({ namespace, sub }: {
8
9
  namespace: string;
9
10
  sub?: string;
@@ -6,12 +6,17 @@ export const ORM_HELP = `usage:
6
6
  seq-studio orm plan [dir] -e <env>
7
7
  seq-studio orm apply [dir] -e <env>
8
8
  seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
9
+ seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]
10
+ seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]
9
11
  seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]
10
12
  seq-studio orm migrate-from-yaml <dir>
11
13
  seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>
12
14
 
13
15
  -e/--env is required for commands that contact Atlas. Use seq-studio envs list
14
16
  to discover environments and seq-studio login to authenticate.
17
+ read and sql query a v2 namespace as you through its built-in read-only SQL.
18
+ sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).
19
+ Run seq-studio orm read --help for the filter grammar, parameters, and output formats.
15
20
  `;
16
21
  export const ARTIFACT_HELP = `usage:
17
22
  seq-studio artifact init <dir> [--template react-vite|nextjs]
@@ -115,7 +120,8 @@ export const REPOS_USAGE = `usage:
115
120
  configures login for subsequent git pull/push
116
121
  seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]
117
122
  materialize the tree at a ref (JSON API)
118
- seq-studio repos pulls <list|show|create|diff|merge> [args] review requests (see pulls --help)
123
+ seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]
124
+ review requests (see pulls --help)
119
125
  seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)
120
126
  seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults
121
127
  seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs
@@ -139,10 +145,30 @@ export const REPOS_USAGE = `usage:
139
145
  Authenticate JSON API calls with: seq-studio login
140
146
  Authenticate git clone/push with: seq-studio login --env <env>
141
147
  `;
148
+ export const PROCESS_RUNS_USAGE = `usage:
149
+ seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]
150
+ [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]
151
+ seq-studio process runs list -e <env> [--process <id>] [--status <status>]
152
+ [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]
153
+ seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]
154
+ seq-studio process runs cancel <run-id> -e <env> [--json]
155
+
156
+ Runs start and are read as you: start needs invoker on the process, show and
157
+ list return only runs you can view, and cancel needs invoker on the process.
158
+ --version pins a published process version; omitted, the active version runs.
159
+ --run-id makes start idempotent: repeating it for the same process returns the
160
+ existing run instead of starting another. --metadata-file is a JSON object
161
+ stored on the run.
162
+ list returns the newest runs first, up to --limit (default 50, max 500); the run
163
+ API has no cursor, so narrow with filters to reach older runs.
164
+ --status: pending, running, completed, failed, cancelled, timed_out.
165
+ show --wait polls until the run finishes (default timeout 600s); the run keeps
166
+ going if the wait times out.
167
+ `;
142
168
  export function staticHelp({ namespace, sub }) {
143
169
  if (namespace === 'artifact')
144
170
  return ARTIFACT_HELP;
145
- if (namespace === 'orm')
171
+ if (namespace === 'orm' && sub !== 'read' && sub !== 'sql')
146
172
  return ORM_HELP;
147
173
  if (namespace === 'pipeline')
148
174
  return PIPELINE_HELP;
@@ -153,8 +179,10 @@ export function staticHelp({ namespace, sub }) {
153
179
  if (namespace === 'doctor') {
154
180
  return `usage: seq-studio doctor [-e <env>] [--json] [--offline]\n\nDiagnose config, auth, local service availability, CLI/SDK resolution, and deployment access. --offline reads local metadata without discovery or HTTP requests. Help is available offline.\n`;
155
181
  }
182
+ if (namespace === 'process' && sub === 'runs')
183
+ return PROCESS_RUNS_USAGE;
156
184
  if (namespace === 'process' && (!sub || sub === 'help' || sub === '--help' || sub === '-h')) {
157
- return `usage: seq-studio process <init|lint|plan|apply|promote|pull|test|simulate|bundle> [args]\n\nHelp is available offline.\n`;
185
+ return `usage: seq-studio process <init|lint|plan|apply|promote|pull|runs|test|simulate|bundle> [args]\n\nHelp is available offline.\n`;
158
186
  }
159
187
  return undefined;
160
188
  }
@@ -1,4 +1,4 @@
1
- import { REQUIRE_EXPLICIT_ENV_MESSAGE } from './env-flags.js';
1
+ import { REQUIRE_EXPLICIT_ENV_MESSAGE, explicitOrSandboxEnv } from './env-flags.js';
2
2
  /** Validate before authentication: a typo must never silently widen a mutation. */
3
3
  export function validateCommandInput({ args, flags, positional, }) {
4
4
  const allowed = { ...flags, env: 'string', e: 'string', json: 'boolean' };
@@ -16,7 +16,7 @@ export function validateCommandInput({ args, flags, positional, }) {
16
16
  .filter((value) => typeof value === 'string');
17
17
  if (new Set(envs).size > 1)
18
18
  throw new Error('Specify only one environment per command.');
19
- if (envs.length === 0)
19
+ if (envs.length === 0 && !explicitOrSandboxEnv(undefined))
20
20
  throw new Error(REQUIRE_EXPLICIT_ENV_MESSAGE);
21
21
  if (args.positional.length !== positional) {
22
22
  throw new Error(`Expected ${positional} positional argument(s). See --help.`);
package/dist/config.d.ts CHANGED
@@ -75,3 +75,8 @@ export declare function addSharedLoginEnvironment({ name, baseUrl: rawBaseUrl, f
75
75
  export declare function resolveConfiguredEnv({ requested, }: {
76
76
  requested?: string;
77
77
  }): Promise<ResolvedEnv>;
78
+ /**
79
+ * In sandbox token mode the deployment comes from SEQ_STUDIO_BASE_URL and any
80
+ * `-e` value is ignored: the sandbox can reach no other origin.
81
+ */
82
+ export declare function resolveSandboxEnv(): ResolvedEnv | null;
package/dist/config.js CHANGED
@@ -9,6 +9,7 @@ import { validateDeploymentBaseUrl } from '@sequenceholdings/artifact-studio/dep
9
9
  import { isSequenceAuthEnvName, isSharedLoginDeploymentName, usesSharedSequenceLogin } from './auth.js';
10
10
  import { fetchDeploymentLogin, readRegisteredEnvironmentUrls } from './env-registry.js';
11
11
  import { resolvePreviewFromSlug } from './preview.js';
12
+ import { SANDBOX_ENV_NAME, sandboxTarget } from './sandbox-auth.js';
12
13
  /**
13
14
  * `--env preview:<branch-or-slug>` targets a per-PR Vercel preview deployment
14
15
  * without a config.toml entry. The slug after the prefix is run through the
@@ -187,6 +188,9 @@ export function manualEnvConfigHint() {
187
188
  * the configured envs when the name does not resolve.
188
189
  */
189
190
  export function resolveEnv({ config, requested, }) {
191
+ const sandbox = resolveSandboxEnv();
192
+ if (sandbox)
193
+ return sandbox;
190
194
  const name = requested ?? config.defaultEnv;
191
195
  if (name.startsWith(PREVIEW_ENV_PREFIX)) {
192
196
  const { slug, url } = resolvePreviewFromSlug(name.slice(PREVIEW_ENV_PREFIX.length));
@@ -239,5 +243,14 @@ export async function addSharedLoginEnvironment({ name, baseUrl: rawBaseUrl, fet
239
243
  }
240
244
  /** Resolve `--env <name>` against the config on disk. */
241
245
  export async function resolveConfiguredEnv({ requested, }) {
242
- return resolveEnv({ config: await readConfig(), requested });
246
+ // Checked before readConfig so a sandbox never reads ~/.config or the registry.
247
+ return resolveSandboxEnv() ?? resolveEnv({ config: await readConfig(), requested });
248
+ }
249
+ /**
250
+ * In sandbox token mode the deployment comes from SEQ_STUDIO_BASE_URL and any
251
+ * `-e` value is ignored: the sandbox can reach no other origin.
252
+ */
253
+ export function resolveSandboxEnv() {
254
+ const sandbox = sandboxTarget();
255
+ return sandbox ? { name: SANDBOX_ENV_NAME, url: sandbox.baseUrl } : null;
243
256
  }
@@ -8,3 +8,9 @@ export declare const REQUIRE_EXPLICIT_ENV_MESSAGE = "You must specify an environ
8
8
  export declare function normalizeShortEnvFlag(argv: readonly string[]): string[];
9
9
  /** Only valid AFTER normalizeShortEnvFlag — recognizes the two-token form. */
10
10
  export declare function readEnvFromArgv(rest: readonly string[]): string | undefined;
11
+ /**
12
+ * The environment a network command targets: the explicit `-e` value, or the
13
+ * sandbox in sandbox token mode, where SEQ_STUDIO_BASE_URL already names the
14
+ * deployment and `-e` is optional (and ignored).
15
+ */
16
+ export declare function explicitOrSandboxEnv(requested: string | undefined): string | undefined;
package/dist/env-flags.js CHANGED
@@ -3,6 +3,7 @@
3
3
  * CLIs only recognize the two-token `--env <value>` form, so every `-e value`
4
4
  * / `-e=value` / `--env=value` spelling is rewritten before forwarding.
5
5
  */
6
+ import { SANDBOX_ENV_NAME, isSandboxTokenMode } from './sandbox-auth.js';
6
7
  /** Shared copy for network commands that must not silently fall back to `local`. */
7
8
  export const REQUIRE_EXPLICIT_ENV_MESSAGE = 'You must specify an environment you have access to with `-e <env>`. Run `seq-studio envs list` to see available environments.';
8
9
  export function normalizeShortEnvFlag(argv) {
@@ -47,3 +48,11 @@ export function readEnvFromArgv(rest) {
47
48
  }
48
49
  return undefined;
49
50
  }
51
+ /**
52
+ * The environment a network command targets: the explicit `-e` value, or the
53
+ * sandbox in sandbox token mode, where SEQ_STUDIO_BASE_URL already names the
54
+ * deployment and `-e` is optional (and ignored).
55
+ */
56
+ export function explicitOrSandboxEnv(requested) {
57
+ return isSandboxTokenMode() ? SANDBOX_ENV_NAME : requested;
58
+ }
@@ -11,6 +11,7 @@ export interface FunctionSummary {
11
11
  description: string | null;
12
12
  runtime: string;
13
13
  activeVersionId?: string | null;
14
+ immutableRelease?: boolean;
14
15
  deployed: boolean;
15
16
  secretsNeedDeploy?: boolean;
16
17
  currentUserAccess: string | null;
@@ -62,19 +63,21 @@ export declare function resolveOrRegisterFunction({ ctx, slug, title, descriptio
62
63
  created: boolean;
63
64
  }>;
64
65
  export declare function functionsRegisterCommand(args: ParsedArgs): Promise<number>;
65
- export declare function predictNextVersion(latest: string | undefined): string;
66
+ export declare function predictNextVersion(versions: readonly string[]): string;
66
67
  /** Prompt on the TTY with echo suppressed — secret values are never displayed. */
67
68
  export declare function promptHidden(question: string): Promise<string>;
68
69
  export declare function printError(error: unknown): void;
69
70
  export declare function functionsInitCommand(args: ParsedArgs): Promise<number>;
70
71
  export declare function functionsBuildCommand(args: ParsedArgs): Promise<number>;
71
72
  export declare function functionsDeployCommand(args: ParsedArgs): Promise<number>;
72
- export declare function pollVersion({ ctx, functionId, versionId, egressNote, }: {
73
+ export declare function pollVersion({ ctx, functionId, versionId, egressNote, immutableRelease, }: {
73
74
  ctx: CommandContext;
74
75
  functionId: string;
75
76
  versionId: string;
76
77
  /** Print the egress-propagation hint once the version is live. */
77
78
  egressNote?: boolean;
79
+ /** Require platform-recorded immutable activation rather than authored YAML alone. */
80
+ immutableRelease?: boolean;
78
81
  }): Promise<number>;
79
82
  export declare function functionsListCommand(args: ParsedArgs): Promise<number>;
80
83
  export declare function functionsShowCommand(args: ParsedArgs): Promise<number>;