@sequenceholdings/studio-cli 0.9.22 → 0.9.24

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 (133) hide show
  1. package/README.md +152 -144
  2. package/dist/access/commands.js +3 -5
  3. package/dist/access/principal.js +2 -2
  4. package/dist/access/tier-hosts.js +2 -2
  5. package/dist/agents/commands.d.ts +1 -1
  6. package/dist/agents/commands.js +9 -9
  7. package/dist/agents/scaffold.js +3 -3
  8. package/dist/agents/voice.d.ts +1 -1
  9. package/dist/agents/voice.js +1 -1
  10. package/dist/app/commands.d.ts +2 -2
  11. package/dist/app/commands.js +31 -21
  12. package/dist/app/deploy.d.ts +1 -1
  13. package/dist/app/deploy.js +1 -1
  14. package/dist/app/manifest.d.ts +9 -9
  15. package/dist/app/manifest.js +1 -1
  16. package/dist/app/prepare.js +1 -1
  17. package/dist/app/primitive-scaffold.js +1 -1
  18. package/dist/app/readme.js +6 -6
  19. package/dist/app/scaffold.js +1 -1
  20. package/dist/app/validate.d.ts +1 -1
  21. package/dist/app/workspace-scaffold.js +1 -1
  22. package/dist/artifact/delegate.d.ts +1 -1
  23. package/dist/artifact/delegate.js +43 -3
  24. package/dist/auth-cmds/commands.js +1 -2
  25. package/dist/bin.js +12 -2
  26. package/dist/cli-attribution.d.ts +4 -0
  27. package/dist/cli-attribution.js +25 -3
  28. package/dist/cli-errors.d.ts +9 -1
  29. package/dist/cli-errors.js +20 -9
  30. package/dist/command-contract.d.ts +7 -182
  31. package/dist/command-contract.js +9 -33
  32. package/dist/command-help.d.ts +4 -4
  33. package/dist/command-help.js +24 -24
  34. package/dist/command-telemetry.js +2 -2
  35. package/dist/config-dir.d.ts +8 -0
  36. package/dist/config-dir.js +35 -0
  37. package/dist/config.d.ts +6 -0
  38. package/dist/config.js +15 -3
  39. package/dist/docs/commands.js +9 -4
  40. package/dist/env-registry.d.ts +4 -0
  41. package/dist/env-registry.js +15 -6
  42. package/dist/envs/commands.d.ts +3 -0
  43. package/dist/envs/commands.js +11 -0
  44. package/dist/exit-codes.d.ts +16 -0
  45. package/dist/exit-codes.js +27 -0
  46. package/dist/functions/bundle.d.ts +1 -1
  47. package/dist/functions/commands.js +19 -18
  48. package/dist/functions/manifest.js +1 -1
  49. package/dist/functions/service-account-guidance.d.ts +1 -1
  50. package/dist/functions/service-account-guidance.js +2 -2
  51. package/dist/lifecycle/check.d.ts +13 -0
  52. package/dist/lifecycle/check.js +116 -0
  53. package/dist/lifecycle/commands.d.ts +14 -0
  54. package/dist/lifecycle/commands.js +121 -0
  55. package/dist/lifecycle/plan.d.ts +28 -0
  56. package/dist/lifecycle/plan.js +113 -0
  57. package/dist/lifecycle/rollback.d.ts +7 -0
  58. package/dist/lifecycle/rollback.js +89 -0
  59. package/dist/lifecycle/seq-ci-tools.d.ts +107 -0
  60. package/dist/lifecycle/seq-ci-tools.js +177 -0
  61. package/dist/lifecycle/upgrade.d.ts +3 -0
  62. package/dist/lifecycle/upgrade.js +38 -0
  63. package/dist/machine-output.d.ts +11 -2
  64. package/dist/machine-output.js +32 -10
  65. package/dist/main.d.ts +16 -6
  66. package/dist/main.js +187 -361
  67. package/dist/orgs.d.ts +45 -0
  68. package/dist/orgs.js +106 -0
  69. package/dist/orm/delegate.d.ts +1 -1
  70. package/dist/orm/delegate.js +32 -18
  71. package/dist/orm/deployment-policy.js +1 -2
  72. package/dist/orm/discover.js +6 -8
  73. package/dist/orm/execute.d.ts +1 -1
  74. package/dist/orm/execute.js +5 -6
  75. package/dist/orm/failures.js +2 -2
  76. package/dist/orm/help.d.ts +1 -1
  77. package/dist/orm/help.js +5 -5
  78. package/dist/orm/history.js +1 -2
  79. package/dist/orm/operation-show.js +1 -2
  80. package/dist/orm/version-guard.d.ts +7 -2
  81. package/dist/orm/version-guard.js +12 -7
  82. package/dist/pipeline/codegen.js +2 -2
  83. package/dist/pipeline/commands.js +9 -7
  84. package/dist/pipeline/discovery.d.ts +1 -1
  85. package/dist/pipeline/discovery.js +2 -3
  86. package/dist/pipeline/help.d.ts +1 -1
  87. package/dist/pipeline/help.js +1 -1
  88. package/dist/pipeline/lifecycle.js +1 -1
  89. package/dist/pipeline/stage-secrets.js +4 -4
  90. package/dist/pipeline/templates.js +2 -2
  91. package/dist/pnpm-auto-update.js +3 -3
  92. package/dist/preview.d.ts +1 -1
  93. package/dist/preview.js +1 -1
  94. package/dist/principals/commands.d.ts +1 -1
  95. package/dist/principals/commands.js +13 -14
  96. package/dist/process/commands.js +4 -1
  97. package/dist/process/run-steps.d.ts +2 -2
  98. package/dist/process/runs.js +1 -2
  99. package/dist/registry/commands.d.ts +4 -0
  100. package/dist/registry/commands.js +281 -0
  101. package/dist/registry/help.d.ts +8 -0
  102. package/dist/registry/help.js +64 -0
  103. package/dist/registry/lifecycle-commands.d.ts +3 -0
  104. package/dist/registry/lifecycle-commands.js +60 -0
  105. package/dist/registry/lookup.d.ts +6 -0
  106. package/dist/registry/lookup.js +18 -0
  107. package/dist/registry/runners.d.ts +14 -0
  108. package/dist/registry/runners.js +206 -0
  109. package/dist/registry/spec.d.ts +45 -0
  110. package/dist/registry/spec.js +8 -0
  111. package/dist/repos/commands.js +1 -2
  112. package/dist/repos/github-connect-command.d.ts +10 -1
  113. package/dist/repos/github-connect-command.js +52 -11
  114. package/dist/repos/github-init.d.ts +9 -2
  115. package/dist/repos/github-init.js +18 -2
  116. package/dist/repos/init-repo.js +1 -2
  117. package/dist/run-pinned.d.ts +48 -0
  118. package/dist/run-pinned.js +127 -0
  119. package/dist/sdk-source.d.ts +64 -0
  120. package/dist/sdk-source.js +199 -0
  121. package/dist/secrets/commands.d.ts +1 -1
  122. package/dist/secrets/commands.js +29 -24
  123. package/dist/service-accounts/commands.d.ts +1 -1
  124. package/dist/service-accounts/commands.js +4 -5
  125. package/dist/staged-env.d.ts +14 -0
  126. package/dist/staged-env.js +73 -0
  127. package/dist/storage/commands.js +21 -22
  128. package/dist/templates/catalog.d.ts +4 -4
  129. package/dist/update-check.js +3 -3
  130. package/dist/version-support.d.ts +39 -0
  131. package/dist/version-support.js +71 -0
  132. package/package.json +11 -10
  133. package/release-summary.json +3 -1
@@ -1,2 +1,2 @@
1
1
  /** Offline help: keep this module free of authentication and runtime SDK imports. */
2
- 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 For local validation, run from the pipeline tooling/app directory:\n pnpm add --save-dev @sequenceholdings/studio-cli @sequenceholdings/pipeline-spec\n pnpm exec seq-studio pipeline validate .\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 seq-studio pipeline retire --repo <release-unit> -e <env> [--target <id>] [--stages <slugs>] [--json]\n preview the whole pipeline, or comma-separated stages omitted from its\n latest published source collection. Approve the same scope with\n --plan-hash <hash> --yes. Deletes supported execution resources and archives\n stages; retains data and history. Live synced-table configurations block.\n Inspect with --retirement-id <id>; resume a stopped failure with\n --retirement-id <id> --resume --yes (omit --stages; the scope is immutable).\n Requires a human pipeline administrator and staff destructive-operation access.\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";
2
+ 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 show <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 For local validation, run from the pipeline tooling/app directory:\n pnpm add --save-dev @sequenceholdings/studio-cli @sequenceholdings/pipeline-spec\n pnpm exec seq-studio pipeline validate .\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 seq-studio pipeline retire --repo <release-unit> -e <env> [--target <id>] [--stages <slugs>] [--json]\n preview the whole pipeline, or comma-separated stages omitted from its\n latest published source collection. Approve the same scope with\n --plan-hash <hash> --yes. Deletes supported execution resources and archives\n stages; retains data and history. Live synced-table configurations block.\n Inspect with --retirement-id <id>; resume a stopped failure with\n --retirement-id <id> --resume --yes (omit --stages; the scope is immutable).\n Requires a human pipeline administrator and staff destructive-operation access.\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,7 +5,7 @@ export const PIPELINE_HELP = `usage:
5
5
  seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]
6
6
  list asset declarations, including assets that may not be deployed
7
7
  seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]
8
- seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]
8
+ seq-studio pipeline show <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]
9
9
  seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]
10
10
  seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]
11
11
  seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...
@@ -452,7 +452,7 @@ export async function pipelineRunNowCommand(args) {
452
452
  const stage = flagString(args.flags, 'stage');
453
453
  const repo = flagString(args.flags, 'repo');
454
454
  if (!stage) {
455
- console.error('usage: seq-studio pipeline run-now --stage <slug> -e <env> [--repo <namespace>/<slug>] [--json]');
455
+ console.error('usage: seq-studio pipeline run --stage <slug> -e <env> [--repo <namespace>/<slug>] [--json]');
456
456
  return 1;
457
457
  }
458
458
  const { env, token } = await envAndToken(args);
@@ -1,7 +1,7 @@
1
1
  import { deleteJson, getJson, postJson } from '../atlas-client.js';
2
2
  /**
3
3
  * Managed secrets attached to Managed Pipelines stages — the pipelines side of
4
- * `seq-studio secrets attach --fn`. A stage declares `source.credential:
4
+ * `seq-studio secret attach --fn`. A stage declares `source.credential:
5
5
  * <symbolic>` in its spec; an attachment binds that credential, for one deploy
6
6
  * target, to a managed secret. Deploy copies the secret's version into the
7
7
  * stage's Databricks scope and the job reads it with
@@ -135,7 +135,7 @@ export async function reconcileStageCredentials({ client, repo, stageIds, deploy
135
135
  continue;
136
136
  }
137
137
  if (secret.valueType === 'key_value') {
138
- result.unresolved.push({ ...credential, reason: `${credential.managedSecretName} is a key/value set; attach a selected entry with seq-studio secrets attach ${credential.managedSecretName} --stage ${credential.stage.slug} --credential ${credential.symbolic} --entry KEY` });
138
+ result.unresolved.push({ ...credential, reason: `${credential.managedSecretName} is a key/value set; attach a selected entry with seq-studio secret attach ${credential.managedSecretName} --stage ${credential.stage.slug} --credential ${credential.symbolic} --entry KEY` });
139
139
  continue;
140
140
  }
141
141
  await attachSecretToStage({
@@ -164,7 +164,7 @@ export function printReconcileResult({ result, deployTarget }) {
164
164
  }
165
165
  for (const { stage, symbolic, managedSecretName, reason } of result.unresolved) {
166
166
  console.error(`${LOG} ${stage.slug}: credential ${symbolic} has nothing attached for ${deployTarget} — ${reason}. ` +
167
- `Create it (seq-studio secrets create ${managedSecretName}, then secrets set), or attach another: ` +
168
- `seq-studio secrets attach <NAME> --stage ${stage.slug} --credential ${symbolic} --target ${deployTarget}`);
167
+ `Create it (seq-studio secret create ${managedSecretName}, then secrets set), or attach another: ` +
168
+ `seq-studio secret attach <NAME> --stage ${stage.slug} --credential ${symbolic} --target ${deployTarget}`);
169
169
  }
170
170
  }
@@ -35,7 +35,7 @@ runtime: databricks
35
35
  # source_schema: raw
36
36
  # databricks runtime pulls from an external system (symbolic refs, never secrets).
37
37
  # Secure-by-default: declare a credential for authenticated APIs. Attach a
38
- # managed secret to it per deploy target (seq-studio secrets attach <NAME>
38
+ # managed secret to it per deploy target (seq-studio secret attach <NAME>
39
39
  # --stage <stage>, or plan/deploy attaches MY_SOURCE_CREDENTIAL by convention)
40
40
  # and read it in code with pipeline_runtime.get_credential("my_source_credential").
41
41
  # For genuinely keyless / public sources, omit credential entirely (do not
@@ -168,7 +168,7 @@ const INGESTION_ENTRYPOINT_STUB = `# Databricks notebook source
168
168
  Fetch from the source and land raw batches under \`landing(<feed>)\`; the
169
169
  platform materializes bronze. Never hardcode a credential: the spec's
170
170
  \`source.credential\` is attached to a managed secret per deploy target
171
- (\`seq-studio secrets attach <NAME> --stage {{name}}\`, or automatically by
171
+ (\`seq-studio secret attach <NAME> --stage {{name}}\`, or automatically by
172
172
  \`seq-studio pipeline plan|deploy\` when a secret named after it exists), and
173
173
  read here with \`get_credential\`.
174
174
  """
@@ -1,13 +1,13 @@
1
+ import { cliConfigDir } from './config-dir.js';
1
2
  import { spawnSync } from 'node:child_process';
2
3
  import { realpathSync, readFileSync } from 'node:fs';
3
4
  import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
4
- import { homedir } from 'node:os';
5
5
  import { dirname, join } from 'node:path';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { gt, lt, prerelease, valid } from 'semver';
8
8
  const PACKAGE = '@sequenceholdings/studio-cli';
9
9
  const PACKAGE_PATH = join('@sequenceholdings', 'studio-cli');
10
- function trackPath() { return join(homedir(), '.config', 'lattice', 'update-track.json'); }
10
+ function trackPath() { return join(cliConfigDir(), 'update-track.json'); }
11
11
  function installedPackageRoot() {
12
12
  return dirname(dirname(fileURLToPath(import.meta.url)));
13
13
  }
@@ -124,7 +124,7 @@ export async function maybeUpgradeGlobalPnpm(available, expectedTrack) {
124
124
  summary = value;
125
125
  }
126
126
  catch { /* An update notice can omit the summary. */ }
127
- const notices = join(homedir(), '.config', 'lattice');
127
+ const notices = cliConfigDir();
128
128
  await mkdir(notices, { recursive: true });
129
129
  const temporary = join(notices, `update-installed.${process.pid}.tmp`);
130
130
  await writeFile(temporary, JSON.stringify({ from: previous, to: available, summary }) + '\n', { mode: 0o600 });
package/dist/preview.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Lets an engineer target a specific PR's Vercel preview deployment
5
5
  * (`https://studio-atlas-git-<slug>.preview.seqholdings.com`) WITHOUT
6
- * hand-editing `~/.config/lattice/config.toml`. See
6
+ * hand-editing `~/.config/seq-studio/config.toml`. See
7
7
  * `docs/preview-environments.md` for the full lifecycle.
8
8
  *
9
9
  * SLUG ALGORITHM — must stay byte-for-byte in sync with the other
package/dist/preview.js CHANGED
@@ -5,7 +5,7 @@ import { promisify } from 'node:util';
5
5
  *
6
6
  * Lets an engineer target a specific PR's Vercel preview deployment
7
7
  * (`https://studio-atlas-git-<slug>.preview.seqholdings.com`) WITHOUT
8
- * hand-editing `~/.config/lattice/config.toml`. See
8
+ * hand-editing `~/.config/seq-studio/config.toml`. See
9
9
  * `docs/preview-environments.md` for the full lifecycle.
10
10
  *
11
11
  * SLUG ALGORITHM — must stay byte-for-byte in sync with the other
@@ -1,3 +1,3 @@
1
1
  import type { ParsedArgs } from '../process/commands.js';
2
- export declare const PRINCIPALS_USAGE = "usage:\n seq-studio principals search <query> -e <env> [--types user,group,service-account,organization] [--limit <n>]\n seq-studio principals users search <query> -e <env> [--limit <n>]\n seq-studio principals groups list -e <env> [--search <query>] [--limit <n>] [--page <n>]\n seq-studio principals groups show <group-id> -e <env> [--limit <n>] [--offset <n>]\n seq-studio principals groups create <name> -e <env> [--description <text>] [--request-id <uuid>]\n seq-studio principals groups members add <group-id> -e <env> --principal-id <user-sub> [--principal-id <user-sub> ...]\n seq-studio principals groups members remove <group-id> -e <env> --principal-id <user-sub>\n\n Find the people, groups, service accounts and organizations YOU may grant\n access to, with the exact ids seq-studio access grant takes. Results are JSON;\n each principal carries \"grant\": { \"principalType\", \"principalId\" }.\n Queries need at least 2 characters. search defaults to user,group,service-account.\n\n You see exactly what the Atlas pickers show you, never more:\n people: active users in your organization (Sequence operators: everyone);\n groups: groups you belong to (platform admins: every group), never deleted ones;\n service accounts: accounts you hold actor on; organizations: your own tenant.\n groups show lists a visible group's active members, paged (default 50 per\n page); a group you can't see is reported as not found.\n Create makes a local group with you as admin. It prints its request UUID\n before sending; reuse --request-id <uuid> to safely retry an uncertain result.\n Member IDs are the authenticated subjects returned by users search, not\n emails or directory row IDs. Add accepts 1\u201350 IDs, leaves existing roles\n unchanged, and rejects disabled or out-of-tenant users. Managing members\n requires permission to administer a CLI-created group in your tenant.\n Remove revokes one member and refuses to\n remove the last group admin. Members may always leave their own group.\n Mutation receipts are JSON.\n Authenticate: seq-studio login --env <env> (agent sandbox tokens work too).\n";
2
+ export declare const PRINCIPALS_USAGE = "usage:\n seq-studio principal search <query> -e <env> [--types user,group,service-account,organization] [--limit <n>]\n seq-studio principal users search <query> -e <env> [--limit <n>]\n seq-studio principal groups list -e <env> [--search <query>] [--limit <n>] [--page <n>]\n seq-studio principal groups show <group-id> -e <env> [--limit <n>] [--offset <n>]\n seq-studio principal groups create <name> -e <env> [--description <text>] [--request-id <uuid>]\n seq-studio principal groups members add <group-id> -e <env> --principal-id <user-sub> [--principal-id <user-sub> ...]\n seq-studio principal groups members remove <group-id> -e <env> --principal-id <user-sub>\n\n Find the people, groups, service accounts and organizations YOU may grant\n access to, with the exact ids seq-studio access grant takes. Results are JSON;\n each principal carries \"grant\": { \"principalType\", \"principalId\" }.\n Queries need at least 2 characters. search defaults to user,group,service-account.\n\n You see exactly what the Atlas pickers show you, never more:\n people: active users in your organization (Sequence operators: everyone);\n groups: groups you belong to (platform admins: every group), never deleted ones;\n service accounts: accounts you hold actor on; organizations: your own tenant.\n groups show lists a visible group's active members, paged (default 50 per\n page); a group you can't see is reported as not found.\n Create makes a local group with you as admin. It prints its request UUID\n before sending; reuse --request-id <uuid> to safely retry an uncertain result.\n Member IDs are the authenticated subjects returned by users search, not\n emails or directory row IDs. Add accepts 1\u201350 IDs, leaves existing roles\n unchanged, and rejects disabled or out-of-tenant users. Managing members\n requires permission to administer a CLI-created group in your tenant.\n Remove revokes one member and refuses to\n remove the last group admin. Members may always leave their own group.\n Mutation receipts are JSON.\n Authenticate: seq-studio login --env <env> (agent sandbox tokens work too).\n";
3
3
  export declare function runPrincipalsCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
@@ -5,13 +5,13 @@ import { requiredStringFlag, validateCommandInput, wantsHelp } from '../command-
5
5
  import { buildContext, clientOptions } from '../functions/commands.js';
6
6
  const SEARCH_TYPES = ['user', 'group', 'service-account', 'organization'];
7
7
  export const PRINCIPALS_USAGE = `usage:
8
- seq-studio principals search <query> -e <env> [--types user,group,service-account,organization] [--limit <n>]
9
- seq-studio principals users search <query> -e <env> [--limit <n>]
10
- seq-studio principals groups list -e <env> [--search <query>] [--limit <n>] [--page <n>]
11
- seq-studio principals groups show <group-id> -e <env> [--limit <n>] [--offset <n>]
12
- seq-studio principals groups create <name> -e <env> [--description <text>] [--request-id <uuid>]
13
- seq-studio principals groups members add <group-id> -e <env> --principal-id <user-sub> [--principal-id <user-sub> ...]
14
- seq-studio principals groups members remove <group-id> -e <env> --principal-id <user-sub>
8
+ seq-studio principal search <query> -e <env> [--types user,group,service-account,organization] [--limit <n>]
9
+ seq-studio principal users search <query> -e <env> [--limit <n>]
10
+ seq-studio principal groups list -e <env> [--search <query>] [--limit <n>] [--page <n>]
11
+ seq-studio principal groups show <group-id> -e <env> [--limit <n>] [--offset <n>]
12
+ seq-studio principal groups create <name> -e <env> [--description <text>] [--request-id <uuid>]
13
+ seq-studio principal groups members add <group-id> -e <env> --principal-id <user-sub> [--principal-id <user-sub> ...]
14
+ seq-studio principal groups members remove <group-id> -e <env> --principal-id <user-sub>
15
15
 
16
16
  Find the people, groups, service accounts and organizations YOU may grant
17
17
  access to, with the exact ids seq-studio access grant takes. Results are JSON;
@@ -84,7 +84,7 @@ function requestPath(sub, args) {
84
84
  const [action, target] = [args.positional[0], args.positional[1]];
85
85
  if (sub === 'users') {
86
86
  if (action !== 'search')
87
- throw new Error('Usage: seq-studio principals users search <query> -e <env>');
87
+ throw new Error('Usage: seq-studio principal users search <query> -e <env>');
88
88
  validateCommandInput({ args, flags: { limit: 'string' }, positional: 2 });
89
89
  return { path: `/api/authz/principals/search${query({ q: searchQuery(args, 1), types: 'user', limit: numberFlag(args, 'limit') })}`, shape: 'principals' };
90
90
  }
@@ -96,12 +96,12 @@ function requestPath(sub, args) {
96
96
  if (sub === 'groups' && action === 'show') {
97
97
  validateCommandInput({ args, flags: { limit: 'string', offset: 'string' }, positional: 2 });
98
98
  if (!target?.trim())
99
- throw new Error('A group id is required. Find it with seq-studio principals groups list.');
99
+ throw new Error('A group id is required. Find it with seq-studio principal groups list.');
100
100
  return { path: `/api/authz/principals/groups/${encodeURIComponent(target.trim())}${query({ limit: numberFlag(args, 'limit'), offset: numberFlag(args, 'offset') })}`, shape: 'group' };
101
101
  }
102
102
  if (sub === 'groups')
103
- throw new Error('Usage: seq-studio principals groups list|show -e <env>');
104
- throw new Error(`Unknown principals command: ${sub}. See: seq-studio principals --help`);
103
+ throw new Error('Usage: seq-studio principal groups list|show -e <env>');
104
+ throw new Error(`Unknown principals command: ${sub}. See: seq-studio principal --help`);
105
105
  }
106
106
  function present(shape, body) {
107
107
  const record = body;
@@ -147,7 +147,7 @@ async function mutateGroup(args) {
147
147
  ? requestJsonOnce({ ...clientOptions(ctx), path, method: 'POST', body: { principalIds: ids } })
148
148
  : requestJsonOnce({ ...clientOptions(ctx), path: `${path}/${encodeURIComponent(ids[0])}`, method: 'DELETE' });
149
149
  }
150
- throw new Error('Usage: seq-studio principals groups create|members add|members remove. See: seq-studio principals --help');
150
+ throw new Error('Usage: seq-studio principal groups create|members add|members remove. See: seq-studio principal --help');
151
151
  }
152
152
  export async function runPrincipalsCommand(sub, args) {
153
153
  if (!sub || wantsHelp({ sub, args })) {
@@ -166,7 +166,6 @@ export async function runPrincipalsCommand(sub, args) {
166
166
  return 0;
167
167
  }
168
168
  catch (error) {
169
- printCliError(error);
170
- return 1;
169
+ return printCliError(error);
171
170
  }
172
171
  }
@@ -1009,11 +1009,14 @@ export async function doctorCommand(args) {
1009
1009
  };
1010
1010
  const config = await readConfig().catch(() => null);
1011
1011
  if (!config) {
1012
- lines.push('config: FAIL — could not read ~/.config/lattice/config.toml');
1012
+ lines.push('config: FAIL — could not read ~/.config/seq-studio/config.toml');
1013
1013
  ok = false;
1014
1014
  }
1015
1015
  else {
1016
1016
  lines.push(`config: ok — default_env=${config.defaultEnv}, envs=${Object.keys(config.envs).join(',')}`);
1017
+ const { pinStatusLine } = await import('../version-support.js');
1018
+ lines.push(pinStatusLine({ pin: await (await import('../orgs.js')).repositoryCliPin() }));
1019
+ lines.push(...await (await import('../sdk-source.js')).sdkSourceLines());
1017
1020
  }
1018
1021
  const requested = typeof args.flags.env === 'string' ? args.flags.env : undefined;
1019
1022
  let sandbox = null;
@@ -94,11 +94,11 @@ export declare function runWithSteps<TRun extends {
94
94
  options: StepOptions;
95
95
  }): {
96
96
  run: TRun & {
97
- truncated: Partial<Record<"state" | "output", {
97
+ truncated: Partial<Record<"output" | "state", {
98
98
  chars: number;
99
99
  }>>;
100
- state: unknown;
101
100
  output: unknown;
101
+ state: unknown;
102
102
  };
103
103
  steps: StepDetail[];
104
104
  };
@@ -280,7 +280,6 @@ export async function processRunsCommand(args, deps = {}) {
280
280
  });
281
281
  }
282
282
  catch (error) {
283
- printCliError(error);
284
- return 1;
283
+ return printCliError(error);
285
284
  }
286
285
  }
@@ -0,0 +1,4 @@
1
+ import { type CommandSpec } from './spec.js';
2
+ export type { Access, CommandGroup, CommandSpec, Lifecycle, Subcommand } from './spec.js';
3
+ export { findCommand, findSubcommand, knowsSubcommand } from './lookup.js';
4
+ export declare const COMMANDS: readonly CommandSpec[];
@@ -0,0 +1,281 @@
1
+ /**
2
+ * The one list of seq-studio commands. Routing, typo checks, telemetry names and
3
+ * `capabilities` are all derived from it, so a command cannot be routable but
4
+ * missing from one of them.
5
+ *
6
+ * Keep this module free of static imports of command implementations: every
7
+ * `run` loads its implementation lazily, so `capabilities` and offline help
8
+ * never pull in optional SDKs or Atlas clients.
9
+ */
10
+ import { LIFECYCLE_COMMANDS } from './lifecycle-commands.js';
11
+ import { parse, present, subs } from './spec.js';
12
+ export { findCommand, findSubcommand, knowsSubcommand } from './lookup.js';
13
+ export const COMMANDS = [
14
+ {
15
+ name: 'init',
16
+ group: 'lifecycle', usage: 'init <dir> [options] scaffold an app or use a published template',
17
+ description: 'Scaffold an app workspace or use a published template; --repo scaffolds into a git-service repo',
18
+ lifecycle: 'preview', access: 'mixed', subcommands: [], checkSubcommands: false, telemetry: 'command',
19
+ run: async ({ sub, rest }) => (await import('../app/commands.js')).runAppInitCommand(await parse(present([sub, ...rest]))),
20
+ },
21
+ {
22
+ name: 'add',
23
+ group: 'lifecycle', usage: 'add <kind> <name> add a primitive to the current app monorepo',
24
+ description: 'Add a primitive to an app workspace',
25
+ lifecycle: 'preview', access: 'offline', subcommands: [], checkSubcommands: false, telemetry: 'command',
26
+ run: async ({ sub, rest }) => (await import('../app/commands.js')).runAppAddCommand({ kindArg: sub, args: await parse(rest) }),
27
+ },
28
+ {
29
+ name: 'validate',
30
+ group: 'lifecycle', usage: 'validate [--dir <path>] validate an app manifest offline',
31
+ description: 'Validate an app manifest, graph, paths, and members offline',
32
+ lifecycle: 'preview', access: 'offline', subcommands: [], checkSubcommands: false, telemetry: 'never',
33
+ run: async ({ sub, rest }) => (await import('../app/commands.js')).runAppValidateCommand(await parse(present([sub, ...rest]))),
34
+ }, ...LIFECYCLE_COMMANDS,
35
+ {
36
+ name: 'process',
37
+ group: 'primitive', usage: 'process <sub> [args] validate | plan | apply | runs | test | simulate | bundle | init',
38
+ description: 'Build and operate Lattice processes',
39
+ lifecycle: 'preview', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
40
+ subcommands: [
41
+ { name: 'validate', renamedFrom: ['lint'], implementation: 'lint' },
42
+ ...subs(['init', 'plan', 'apply', 'test', 'simulate']),
43
+ { name: 'bundle', nested: ['build', 'pull', 'archive', 'inspect', 'list', 'publish'] },
44
+ ...subs(['promote', 'pull']),
45
+ { name: 'runs', nested: ['start', 'retry', 'list', 'show', 'cancel'] },
46
+ ...subs(['safety-baseline']),
47
+ ],
48
+ run: async ({ sub, rest }) => (await import('./runners.js')).runProcessNamespace({ sub, rest }),
49
+ },
50
+ {
51
+ name: 'artifact',
52
+ group: 'primitive', usage: 'artifact <sub> [args] init | whoami | link | env | status | list | show | validate | build | plan | deploy | dev | promote | pull | rollback',
53
+ description: 'Build and operate Artifact Studio apps',
54
+ lifecycle: 'stable', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
55
+ subcommands: subs(['init', 'whoami', 'link', 'env', 'status', 'list', 'show', 'validate', 'build', 'plan', 'deploy', 'dev', 'promote', 'pull', 'rollback'], ['login', 'logout', 'content-readers']),
56
+ run: async ({ sub, rest }) => {
57
+ // Lazy: the published artifact-studio CLI runs at module load.
58
+ const { runArtifactCommand } = await import('../artifact/delegate.js');
59
+ if (sub === 'init')
60
+ return (await import('../repos/primitive-declaration.js')).runStandaloneInit({ kind: 'artifact', argv: rest, defaultDir: '.', run: () => runArtifactCommand(sub, rest) });
61
+ return runArtifactCommand(sub, rest);
62
+ },
63
+ },
64
+ {
65
+ name: 'function',
66
+ renamedFrom: ['functions'],
67
+ group: 'primitive', usage: 'function <sub> [args] init | build | deploy | list | show | limits | run | logs | promote | rollback | delete',
68
+ description: 'Build and operate Managed Functions',
69
+ lifecycle: 'stable', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
70
+ subcommands: [...subs(['init', 'build', 'register', 'deploy', 'list', 'show', 'limits', 'logs', 'promote', 'rollback', 'delete'], ['dev']), { name: 'run', renamedFrom: ['invoke'], implementation: 'invoke' }],
71
+ run: async ({ sub, rest }) => {
72
+ const { runFunctionsCommand } = await import('../functions/commands.js');
73
+ if (sub === 'init')
74
+ return (await import('../repos/primitive-declaration.js')).runStandaloneInit({ kind: 'function', argv: rest, run: async () => runFunctionsCommand(sub, await parse(rest)) });
75
+ return runFunctionsCommand(sub, await parse(rest));
76
+ },
77
+ },
78
+ {
79
+ name: 'agent',
80
+ renamedFrom: ['agents'],
81
+ group: 'primitive', usage: 'agent <sub> [args] init | validate | bundle | plan | apply | list | show',
82
+ description: 'Validate and deploy typed agent definitions',
83
+ lifecycle: 'preview', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
84
+ subcommands: subs(['init', 'validate', 'bundle', 'plan', 'apply', 'list', 'show'], ['voice']),
85
+ run: async ({ sub, rest }) => (await import('../agents/commands.js')).runAgentsCommand(sub, await parse(rest)),
86
+ },
87
+ {
88
+ name: 'secret',
89
+ renamedFrom: ['secrets'],
90
+ group: 'platform', usage: 'secret <sub> [args] create | set | list | attach | detach | apply',
91
+ description: 'Manage organization-owned secrets',
92
+ lifecycle: 'stable', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
93
+ subcommands: subs(['create', 'set', 'list', 'attach', 'detach', 'apply'], ['versions', 'set-default', 'pin']),
94
+ run: async ({ sub, rest }) => (await import('../secrets/commands.js')).runSecretsCommand(sub, await parse(rest)),
95
+ },
96
+ {
97
+ name: 'repos',
98
+ group: 'platform', usage: 'repos <sub> [args] list | namespaces | show | identity | create | clone | pull | pulls | delete | ci',
99
+ description: 'Manage repositories and native CI; ci init is offline',
100
+ lifecycle: 'stable', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
101
+ subcommands: [
102
+ ...subs(['list', 'namespaces', 'show', 'identity', 'create', 'clone', 'attach-login', 'pull']),
103
+ { name: 'pulls', nested: ['list', 'show', 'create', 'diff', 'merge', 'edit', 'close', 'comment', 'comments', 'resolve', 'unresolve', 'review', 'reviews', 'checks'] },
104
+ ...subs(['delete', 'ci']),
105
+ ],
106
+ run: async ({ sub, rest }) => (await import('../repos/commands.js')).runReposCommand(sub, await parse(rest)),
107
+ },
108
+ {
109
+ name: 'templates',
110
+ group: 'platform', usage: 'templates <sub> [args] publish | sync | list',
111
+ internal: true,
112
+ description: 'Publish, synchronize, and list repository templates',
113
+ lifecycle: 'internal', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
114
+ subcommands: subs(['publish', 'sync', 'list']),
115
+ run: async ({ sub, rest }) => (await import('../templates/commands.js')).runTemplatesCommand(sub, await parse(rest)),
116
+ },
117
+ {
118
+ name: 'pipeline',
119
+ group: 'primitive', usage: 'pipeline <sub> [args] list | assets | search | show | schema | sample | query | init | validate | plan | adopt | unbind | retire | deploy | status | migrate | promote | rollback | run',
120
+ description: 'Discover and operate Data Pipelines',
121
+ lifecycle: 'preview', access: 'staff', checkSubcommands: true, telemetry: 'subcommand',
122
+ subcommands: [...subs(['list', 'assets', 'search', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'retire', 'promote', 'rollback']),
123
+ { name: 'show', renamedFrom: ['describe'], implementation: 'describe' },
124
+ { name: 'run', renamedFrom: ['run-now'], implementation: 'run-now' },
125
+ { name: 'build', renamedFrom: ['codegen'], implementation: 'codegen', listed: false }],
126
+ // Lazy: keeps doctor and process from loading the optional pipeline-spec peer.
127
+ run: async ({ sub, rest }) => (await import('../pipeline/commands.js')).runPipelineCommand(sub, await parse(rest)),
128
+ },
129
+ {
130
+ name: 'docs',
131
+ group: 'platform', usage: 'docs <sub> -e <env> search <query> | read <slug> | list (read before guessing commands)',
132
+ description: 'Search and read the environment\'s developer documentation',
133
+ lifecycle: 'preview', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
134
+ subcommands: subs(['search', 'read', 'list']),
135
+ run: async ({ sub, rest }) => (await import('../docs/commands.js')).runDocsCommand(sub, await parse(rest)),
136
+ },
137
+ {
138
+ name: 'feedback',
139
+ group: 'platform', usage: 'feedback submit --file report.json [-e <env>] [--json]',
140
+ description: 'Submit agent feedback',
141
+ lifecycle: 'preview', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
142
+ subcommands: subs(['submit']),
143
+ run: async ({ sub, rest }) => (await import('../feedback/commands.js')).runFeedbackCommand(sub, await parse(rest)),
144
+ },
145
+ {
146
+ name: 'auth',
147
+ group: 'platform', usage: 'auth <sub> [args] whoami | git-credential',
148
+ description: 'Manage Git authentication',
149
+ lifecycle: 'stable', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
150
+ subcommands: subs(['whoami', 'git-credential', 'pat']),
151
+ run: async ({ sub, rest }) => (await import('../auth-cmds/commands.js')).runAuthCommand(sub, await parse(rest)),
152
+ },
153
+ {
154
+ name: 'orm',
155
+ group: 'primitive', usage: 'orm <sub> [args] init | build | validate | plan | apply | deployment-policy | run | read | sql | diff | migrate-from-yaml | import | operation',
156
+ description: 'Author and operate ORM namespaces',
157
+ lifecycle: 'preview', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
158
+ subcommands: [...subs(['init', 'validate', 'plan', 'apply', 'history', 'deployment-policy', 'namespaces', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import', 'operation']),
159
+ { name: 'build', renamedFrom: ['generate'], implementation: 'generate' },
160
+ { name: 'show', renamedFrom: ['describe'], implementation: 'describe' },
161
+ { name: 'run', renamedFrom: ['execute'], implementation: 'execute' }],
162
+ run: async ({ sub, rest }) => {
163
+ const { runOrmCommand } = await import('../orm/delegate.js');
164
+ if (sub === 'init')
165
+ return (await import('../repos/primitive-declaration.js')).runStandaloneInit({ kind: 'orm', argv: rest, run: () => runOrmCommand(sub, rest) });
166
+ return runOrmCommand(sub, rest);
167
+ },
168
+ },
169
+ {
170
+ name: 'envs',
171
+ group: 'cli', usage: 'envs <sub> add | list environments',
172
+ description: 'Manage CLI environments',
173
+ lifecycle: 'stable', access: 'mixed', checkSubcommands: true, telemetry: 'never',
174
+ subcommands: subs(['add', 'list']),
175
+ run: async ({ sub, rest }) => (await import('../envs/commands.js')).runEnvsCommand(sub, rest),
176
+ },
177
+ {
178
+ name: 'login',
179
+ group: 'cli', usage: 'login [<org> | <url>] authenticate in the browser (or --env <name>)',
180
+ description: 'Authenticate with Sequence',
181
+ lifecycle: 'stable', access: 'public', subcommands: [], checkSubcommands: false, telemetry: 'never',
182
+ run: async ({ sub, rest }) => (await import('./runners.js')).runSessionCommand({ args: present([sub, ...rest]), command: 'login' }),
183
+ },
184
+ {
185
+ name: 'logout',
186
+ group: 'cli', usage: "logout [--env <name>] remove one realm's cached user tokens",
187
+ description: 'Remove cached user tokens',
188
+ lifecycle: 'stable', access: 'public', subcommands: [], checkSubcommands: false, telemetry: 'never',
189
+ run: async ({ sub, rest }) => (await import('./runners.js')).runSessionCommand({ args: present([sub, ...rest]), command: 'logout' }),
190
+ },
191
+ {
192
+ name: 'doctor',
193
+ group: 'cli', usage: 'doctor [-e <env>] [--json] [--offline] diagnose config, auth, toolchain, and writer gate',
194
+ description: 'Diagnose CLI configuration and access',
195
+ lifecycle: 'stable', access: 'mixed', subcommands: [], checkSubcommands: false, telemetry: 'command',
196
+ run: async ({ sub, rest }) => (await import('../process/commands.js')).doctorCommand(await parse(present([sub, ...rest]))),
197
+ },
198
+ {
199
+ name: 'telemetry',
200
+ group: 'cli', usage: 'telemetry enable|disable|status control authenticated command metrics',
201
+ description: 'Control authenticated command telemetry',
202
+ lifecycle: 'preview', access: 'offline', subcommands: subs(['enable', 'disable', 'status']), checkSubcommands: false, telemetry: 'never',
203
+ run: async ({ sub, rest }) => (await import('./runners.js')).runTelemetryCommand({ sub, rest }),
204
+ },
205
+ {
206
+ name: 'updater',
207
+ group: 'cli', usage: 'updater status | track latest|next control global pnpm auto-updates',
208
+ description: 'Control global pnpm CLI updates',
209
+ lifecycle: 'preview', access: 'offline', checkSubcommands: true, telemetry: 'never',
210
+ subcommands: subs(['status', 'track']),
211
+ run: async ({ sub, rest }) => (await import('../pnpm-auto-update.js')).updaterCommand(present([sub, ...rest])),
212
+ },
213
+ {
214
+ name: 'upgrade',
215
+ group: 'cli', usage: 'upgrade [--to <major.minor>] pin this repository to a seq-studio version',
216
+ description: "Move this repository's seq-studio version pin",
217
+ lifecycle: 'preview', access: 'offline', subcommands: [], checkSubcommands: false, telemetry: 'never',
218
+ run: async ({ sub, rest }) => (await import('../lifecycle/upgrade.js')).runUpgradeCommand(await parse(present([sub, ...rest]))),
219
+ },
220
+ {
221
+ name: 'version',
222
+ group: 'cli', usage: 'version print the installed version',
223
+ aliases: ['--version', '-v'],
224
+ description: 'Print the installed CLI version',
225
+ lifecycle: 'stable', access: 'offline', subcommands: [], checkSubcommands: false, telemetry: 'never',
226
+ run: async () => {
227
+ console.log((await import('../update-check.js')).currentVersion());
228
+ return 0;
229
+ },
230
+ },
231
+ {
232
+ name: 'help',
233
+ group: 'cli', usage: "help [<command>] show this message, or a command's help",
234
+ description: 'Show command help',
235
+ lifecycle: 'stable', access: 'offline', subcommands: [], checkSubcommands: false, telemetry: 'never',
236
+ // `help` is answered by the router before dispatch.
237
+ run: async () => 0,
238
+ },
239
+ {
240
+ name: 'workspace',
241
+ renamedFrom: ['storage'],
242
+ group: 'primitive', usage: 'workspace <sub> [args] init | validate | apply | list | show | mkdir | upload | download | access | trash | restore | purge | operations | abort | delete | source | sync | snapshots',
243
+ description: 'Manage Workspaces V2 file storage',
244
+ lifecycle: 'preview', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
245
+ subcommands: subs(['init', 'validate', 'apply', 'list', 'show', 'mkdir', 'upload', 'import', 'uploads', 'reconcile', 'download', 'access', 'trash', 'restore', 'purge', 'operations', 'abort', 'delete', 'source', 'sync', 'snapshots']),
246
+ run: async ({ sub, rest }) => (await import('../storage/commands.js')).runStorageCommand(sub, await parse(rest)),
247
+ },
248
+ {
249
+ name: 'access',
250
+ group: 'platform', usage: 'access <sub> definitions | list | grant | revoke | resolve',
251
+ description: 'Manage resource access on every primitive',
252
+ lifecycle: 'preview', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
253
+ subcommands: subs(['definitions', 'list', 'grant', 'revoke', 'resolve'], ['roles']),
254
+ run: async ({ sub, rest }) => (await import('../access/commands.js')).runAccessCommand(sub, await parse(rest)),
255
+ },
256
+ {
257
+ name: 'principal',
258
+ renamedFrom: ['principals'],
259
+ group: 'platform', usage: 'principal <sub> search | users search | groups list/show/create/members',
260
+ description: 'Find principals and manage local groups',
261
+ lifecycle: 'preview', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
262
+ subcommands: subs(['search', 'users', 'groups']),
263
+ run: async ({ sub, rest }) => (await import('../principals/commands.js')).runPrincipalsCommand(sub, await parse(rest)),
264
+ },
265
+ {
266
+ name: 'service-account',
267
+ renamedFrom: ['service-accounts'],
268
+ group: 'platform', usage: 'service-account <sub> list | show | create (requires provisioning authority)',
269
+ description: 'Manage runtime service accounts',
270
+ lifecycle: 'preview', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
271
+ subcommands: subs(['list', 'show', 'create']),
272
+ run: async ({ sub, rest }) => (await import('../service-accounts/commands.js')).runServiceAccountsCommand(sub, await parse(rest)),
273
+ },
274
+ {
275
+ name: 'capabilities',
276
+ group: 'cli', usage: 'capabilities [--json] describe command availability and access',
277
+ description: 'Print the supported CLI command surface',
278
+ lifecycle: 'blocked', access: 'offline', subcommands: [], checkSubcommands: false, telemetry: 'never',
279
+ run: async ({ sub, rest }) => (await import('./runners.js')).runCapabilities(present([sub, ...rest])),
280
+ },
281
+ ];
@@ -0,0 +1,8 @@
1
+ export declare function showsInternal(env?: NodeJS.ProcessEnv): boolean;
2
+ export declare function renderTopLevelHelp({ internal }?: {
3
+ internal?: boolean;
4
+ }): string;
5
+ /** The closest candidate within two edits, or a candidate the word is a prefix of. */
6
+ export declare function suggest(word: string, candidates: readonly string[]): string | undefined;
7
+ /** Visible names a user could have meant at the top level. */
8
+ export declare function topLevelNames(internal?: boolean): string[];
@@ -0,0 +1,64 @@
1
+ /** Top-level help and did-you-mean, generated from the command registry. */
2
+ import { COMMANDS } from './commands.js';
3
+ const GROUP_TITLES = {
4
+ lifecycle: 'Apps and repositories',
5
+ primitive: 'Primitives',
6
+ platform: 'Platform',
7
+ cli: 'This CLI',
8
+ };
9
+ const FOOTER = `
10
+ Authenticate with: seq-studio login
11
+ init, orm init, functions init, artifact init, and agents init take
12
+ --repo <ns>/<name> to scaffold straight into a git-service repo; commit and push from there.
13
+ In an agent sandbox, SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE select the
14
+ deployment and token instead (no login; -e optional).
15
+ --json writes only JSON to stdout (status lines go to stderr); objects carry
16
+ "schema": "<command>@<n>". Exit codes: 0 ok, 1 failed, 2 usage, 3 blocked, 4 auth.
17
+ Built-in env: local. Add your organization's deployment with
18
+ \`seq-studio envs add <name> <url>\`; custom entries live in ~/.config/seq-studio/config.toml.
19
+ If this CLI cannot complete a documented step, read that environment's docs
20
+ before trying another tool. \`seq-studio envs list\` prints each environment URL.
21
+ Docs: seq-studio docs search <query> -e <env>, or <url>/docs. Feedback guide: <url>/docs/raw/seq-studio/feedback.md.
22
+ `;
23
+ export function showsInternal(env = process.env) {
24
+ return env.SEQ_STUDIO_INTERNAL === '1';
25
+ }
26
+ function visible(command, internal) {
27
+ return internal || (!command.internal && command.lifecycle !== 'internal');
28
+ }
29
+ export function renderTopLevelHelp({ internal = showsInternal() } = {}) {
30
+ const lines = ['usage: seq-studio <command> [<subcommand>] [flags]'];
31
+ for (const group of Object.keys(GROUP_TITLES)) {
32
+ const commands = COMMANDS.filter((command) => command.group === group && visible(command, internal));
33
+ if (commands.length === 0)
34
+ continue;
35
+ lines.push('', `${GROUP_TITLES[group]}:`, ...commands.map((command) => ` seq-studio ${command.usage}`));
36
+ }
37
+ return `${lines.join('\n')}\n${FOOTER}`;
38
+ }
39
+ function editDistance(a, b) {
40
+ let previous = Array.from({ length: b.length + 1 }, (_, index) => index);
41
+ for (let i = 1; i <= a.length; i++) {
42
+ const current = [i];
43
+ for (let j = 1; j <= b.length; j++) {
44
+ const substitution = (previous[j - 1] ?? 0) + (a[i - 1] === b[j - 1] ? 0 : 1);
45
+ current.push(Math.min((previous[j] ?? 0) + 1, (current[j - 1] ?? 0) + 1, substitution));
46
+ }
47
+ previous = current;
48
+ }
49
+ return previous[b.length] ?? 0;
50
+ }
51
+ /** The closest candidate within two edits, or a candidate the word is a prefix of. */
52
+ export function suggest(word, candidates) {
53
+ let best;
54
+ for (const candidate of candidates) {
55
+ const distance = candidate.startsWith(word) && word.length >= 3 ? 1 : editDistance(word, candidate);
56
+ if (distance <= 2 && (!best || distance < best.distance))
57
+ best = { candidate, distance };
58
+ }
59
+ return best?.candidate;
60
+ }
61
+ /** Visible names a user could have meant at the top level. */
62
+ export function topLevelNames(internal = showsInternal()) {
63
+ return COMMANDS.filter((command) => visible(command, internal)).flatMap(({ name, aliases }) => [name, ...(aliases ?? [])]);
64
+ }
@@ -0,0 +1,3 @@
1
+ /** Repository and app lifecycle commands: repo, apply, status, affected, check. Spread into COMMANDS. */
2
+ import { type CommandSpec } from './spec.js';
3
+ export declare const LIFECYCLE_COMMANDS: readonly CommandSpec[];