@sequenceholdings/studio-cli 0.9.26 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ export declare const COMMAND_CONTRACT: {
4
4
  lifecycle: import("./registry/spec.js").Lifecycle;
5
5
  access: import("./registry/spec.js").Access;
6
6
  subcommands: string[];
7
+ deprecated: string[];
7
8
  }[];
8
9
  export declare function renderCapabilities({ json }?: {
9
10
  json?: boolean;
@@ -1,19 +1,23 @@
1
1
  /** Machine-readable summary of the CLI surface, derived from the command registry. */
2
2
  import { COMMANDS } from './registry/commands.js';
3
- export const COMMAND_CONTRACT = COMMANDS.map(({ name, description, lifecycle, access, subcommands }) => ({
3
+ export const COMMAND_CONTRACT = COMMANDS.map(({ name, description, lifecycle, access, subcommands, deprecated: commandDeprecated }) => ({
4
4
  name,
5
5
  description,
6
6
  lifecycle,
7
7
  access,
8
8
  subcommands: subcommands.filter(({ listed }) => listed !== false).map((sub) => sub.name),
9
+ deprecated: subcommands
10
+ .filter(({ listed, deprecated }) => listed !== false && (commandDeprecated !== undefined || deprecated !== undefined))
11
+ .map((sub) => sub.name),
9
12
  }));
10
13
  export function renderCapabilities({ json = false } = {}) {
11
- const commands = COMMAND_CONTRACT.map(({ name, description, lifecycle, access, subcommands }) => ({
14
+ const commands = COMMAND_CONTRACT.map(({ name, description, lifecycle, access, subcommands, deprecated }) => ({
12
15
  name,
13
16
  description,
14
17
  lifecycle,
15
18
  access,
16
19
  subcommands: [...subcommands],
20
+ ...(deprecated.length ? { deprecated: [...deprecated] } : {}),
17
21
  }));
18
22
  if (json)
19
23
  return JSON.stringify({ version: 1, commands }, null, 2);
@@ -6,11 +6,12 @@ export declare function requestsMachineOutput(argv: readonly string[]): boolean;
6
6
  */
7
7
  export declare function withSchema(text: string, value: unknown, schema: string): string;
8
8
  /**
9
- * Route non-JSON console.log / console.info output to stderr until the
10
- * returned restore function runs. With `schema`, single-document JSON objects
11
- * also gain their schema name.
9
+ * Tag every single-document JSON object a command prints with its schema name, and, with `routeText` (set for
10
+ * `--json` / `--jsonl`), send non-JSON console.log / console.info output to stderr. Both last until the returned
11
+ * restore function runs. `--jsonl` lines are stream items, so they are never tagged.
12
12
  */
13
- export declare function guardMachineOutput({ schema, argv }?: {
13
+ export declare function guardMachineOutput({ schema, argv, routeText }?: {
14
14
  schema?: string;
15
15
  argv?: readonly string[];
16
+ routeText?: boolean;
16
17
  }): () => void;
@@ -52,18 +52,18 @@ export function withSchema(text, value, schema) {
52
52
  return JSON.stringify({ schema: `${schema}@1`, ...value }, null, indentOf(text) || undefined);
53
53
  }
54
54
  /**
55
- * Route non-JSON console.log / console.info output to stderr until the
56
- * returned restore function runs. With `schema`, single-document JSON objects
57
- * also gain their schema name.
55
+ * Tag every single-document JSON object a command prints with its schema name, and, with `routeText` (set for
56
+ * `--json` / `--jsonl`), send non-JSON console.log / console.info output to stderr. Both last until the returned
57
+ * restore function runs. `--jsonl` lines are stream items, so they are never tagged.
58
58
  */
59
- export function guardMachineOutput({ schema, argv = process.argv.slice(2) } = {}) {
59
+ export function guardMachineOutput({ schema, argv = process.argv.slice(2), routeText = true } = {}) {
60
60
  const { log, info } = console;
61
61
  const tagSchema = schema !== undefined && !requestsJsonLines(argv);
62
62
  const route = (write) => (...args) => {
63
63
  const text = format(...args);
64
64
  const parsed = parseJson(text);
65
65
  if (!parsed.ok)
66
- console.error(...args);
66
+ (routeText ? console.error : write)(...args);
67
67
  else if (tagSchema && args.length === 1 && typeof args[0] === 'string')
68
68
  write(withSchema(text, parsed.value, schema));
69
69
  else
package/dist/main.js CHANGED
@@ -56,9 +56,8 @@ export function commandTelemetryName(argv) {
56
56
  return argv[2] && subcommand.nested.includes(argv[2]) ? `${command.name} ${subcommand.name} ${argv[2]}` : null;
57
57
  }
58
58
  export async function run(argv = process.argv.slice(2)) {
59
- if (!requestsMachineOutput(argv))
60
- return dispatch(argv);
61
- const restore = guardMachineOutput({ schema: schemaName(argv), argv });
59
+ // Every JSON object a command prints names its schema; only --json / --jsonl also keep text off stdout.
60
+ const restore = guardMachineOutput({ schema: schemaName(argv), argv, routeText: requestsMachineOutput(argv) });
62
61
  try {
63
62
  return await dispatch(argv);
64
63
  }
@@ -105,6 +104,7 @@ async function dispatch(rawArgv) {
105
104
  }
106
105
  const subcommand = sub && command.checkSubcommands ? findSubcommand(command, sub) : undefined;
107
106
  noteRenamed({ command, namespace, subcommand, sub });
107
+ noteDeprecated({ command, subcommand, args: [sub, ...rest] });
108
108
  // Implementations still read their original words; the registry maps current spellings to them.
109
109
  const implementationSub = subcommand?.implementation ?? sub;
110
110
  if (hasHelpFlag(sub, rest)) {
@@ -168,6 +168,21 @@ function noteRenamed({ command, namespace, subcommand, sub }) {
168
168
  const after = [command.name, subcommand?.name].filter(Boolean).join(' ');
169
169
  console.error(`note: seq-studio ${before} is now seq-studio ${after}`);
170
170
  }
171
+ // On pipeline and secret commands --repo names a pipeline's release unit, which outlives git-service; elsewhere it
172
+ // names a git-service repository to read source from.
173
+ const RELEASE_UNIT_REPO_COMMANDS = new Set(['pipeline', 'secret']);
174
+ const REPO_SOURCE_REPLACEMENT = 'Run from a checkout of the code, or let CI deploy it from GitHub.';
175
+ /** Deprecated commands, subcommands and git-service `--repo` sources keep working until 2.0 and say what replaces them. */
176
+ function noteDeprecated({ command, subcommand, args }) {
177
+ const note = (what, replacement) => console.error(`note: ${what} is deprecated and will be removed in seq-studio 2.0. ${replacement}`);
178
+ if (command.deprecated)
179
+ note(`seq-studio ${command.name}`, command.deprecated);
180
+ else if (subcommand?.deprecated)
181
+ note(`seq-studio ${command.name} ${subcommand.name}`, subcommand.deprecated);
182
+ if (!RELEASE_UNIT_REPO_COMMANDS.has(command.name) && args.some((arg) => arg === '--repo' || arg?.startsWith('--repo='))) {
183
+ note('--repo <namespace>/<name> (source from git-service)', REPO_SOURCE_REPLACEMENT);
184
+ }
185
+ }
171
186
  function unknownCommand(word) {
172
187
  console.error(`error unknown command: ${word}`);
173
188
  const match = suggest(word, topLevelNames());
@@ -8,7 +8,13 @@
8
8
  * never pull in optional SDKs or Atlas clients.
9
9
  */
10
10
  import { LIFECYCLE_COMMANDS } from './lifecycle-commands.js';
11
- import { parse, present, subs } from './spec.js';
11
+ import { deprecate, parse, present, subs } from './spec.js';
12
+ /** Printed when a deprecated `promote` runs: the release branch takes over making a version live. */
13
+ const PROMOTE_REPLACEMENT = 'In a repository that deploys from GitHub, merge to the dev branch and run Promote in GitHub instead; seq-studio repo init sets it up.';
14
+ const SECRET_BINDING_REPLACEMENTS = {
15
+ attach: "List the secret under secrets: in the function's managed-function.yml and run seq-studio function deploy, which attaches it. Pipeline stage attachments have no manifest form yet and keep working.",
16
+ apply: "seq-studio function deploy sets and attaches the secrets its managed-function.yml lists, from the .env beside it.",
17
+ };
12
18
  export { findCommand, findSubcommand, knowsSubcommand } from './lookup.js';
13
19
  export const COMMANDS = [
14
20
  {
@@ -41,7 +47,7 @@ export const COMMANDS = [
41
47
  { name: 'validate', renamedFrom: ['lint'], implementation: 'lint' },
42
48
  ...subs(['init', 'plan', 'apply', 'test', 'simulate']),
43
49
  { name: 'bundle', nested: ['build', 'pull', 'archive', 'inspect', 'list', 'publish'] },
44
- ...subs(['promote', 'pull']),
50
+ ...deprecate(subs(['promote', 'pull']), { promote: PROMOTE_REPLACEMENT }),
45
51
  { name: 'runs', nested: ['start', 'retry', 'list', 'show', 'cancel'] },
46
52
  ...subs(['safety-baseline']),
47
53
  ],
@@ -52,7 +58,7 @@ export const COMMANDS = [
52
58
  group: 'primitive', usage: 'artifact <sub> [args] init | whoami | link | env | status | list | show | validate | build | plan | deploy | dev | promote | pull | rollback',
53
59
  description: 'Build and operate Artifact Studio apps',
54
60
  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']),
61
+ subcommands: deprecate(subs(['init', 'whoami', 'link', 'env', 'status', 'list', 'show', 'validate', 'build', 'plan', 'deploy', 'dev', 'promote', 'pull', 'rollback'], ['login', 'logout', 'content-readers']), { promote: PROMOTE_REPLACEMENT }),
56
62
  run: async ({ sub, rest }) => {
57
63
  // Lazy: the published artifact-studio CLI runs at module load.
58
64
  const { runArtifactCommand } = await import('../artifact/delegate.js');
@@ -67,7 +73,10 @@ export const COMMANDS = [
67
73
  group: 'primitive', usage: 'function <sub> [args] init | build | deploy | list | show | limits | run | logs | promote | rollback | delete',
68
74
  description: 'Build and operate Managed Functions',
69
75
  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' }],
76
+ subcommands: [
77
+ ...deprecate(subs(['init', 'build', 'register', 'deploy', 'list', 'show', 'limits', 'logs', 'promote', 'rollback', 'delete'], ['dev']), { promote: PROMOTE_REPLACEMENT }),
78
+ { name: 'run', renamedFrom: ['invoke'], implementation: 'invoke' },
79
+ ],
71
80
  run: async ({ sub, rest }) => {
72
81
  const { runFunctionsCommand } = await import('../functions/commands.js');
73
82
  if (sub === 'init')
@@ -90,11 +99,12 @@ export const COMMANDS = [
90
99
  group: 'platform', usage: 'secret <sub> [args] create | set | list | attach | detach | apply',
91
100
  description: 'Manage organization-owned secrets',
92
101
  lifecycle: 'stable', access: 'authenticated', checkSubcommands: true, telemetry: 'subcommand',
93
- subcommands: subs(['create', 'set', 'list', 'attach', 'detach', 'apply'], ['versions', 'set-default', 'pin']),
102
+ subcommands: deprecate(subs(['create', 'set', 'list', 'attach', 'detach', 'apply'], ['versions', 'set-default', 'pin']), SECRET_BINDING_REPLACEMENTS),
94
103
  run: async ({ sub, rest }) => (await import('../secrets/commands.js')).runSecretsCommand(sub, await parse(rest)),
95
104
  },
96
105
  {
97
106
  name: 'repos',
107
+ deprecated: 'Repositories live on GitHub: use git and gh, and set one up with seq-studio repo init.',
98
108
  group: 'platform', usage: 'repos <sub> [args] list | namespaces | show | identity | create | clone | pull | pulls | delete | ci',
99
109
  description: 'Manage repositories and native CI; ci init is offline',
100
110
  lifecycle: 'stable', access: 'mixed', checkSubcommands: true, telemetry: 'subcommand',
@@ -119,7 +129,7 @@ export const COMMANDS = [
119
129
  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
130
  description: 'Discover and operate Data Pipelines',
121
131
  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']),
132
+ subcommands: [...deprecate(subs(['list', 'assets', 'search', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'retire', 'promote', 'rollback']), { promote: PROMOTE_REPLACEMENT }),
123
133
  { name: 'show', renamedFrom: ['describe'], implementation: 'describe' },
124
134
  { name: 'run', renamedFrom: ['run-now'], implementation: 'run-now' },
125
135
  { name: 'build', renamedFrom: ['codegen'], implementation: 'codegen', listed: false }],
@@ -12,6 +12,8 @@ export interface Subcommand {
12
12
  listed?: boolean;
13
13
  /** Third-level words recorded in telemetry, e.g. `process runs start`. */
14
14
  nested?: readonly string[];
15
+ /** Still works until 2.0, with this replacement printed on every run. */
16
+ deprecated?: string;
15
17
  }
16
18
  export type CommandGroup = 'lifecycle' | 'primitive' | 'platform' | 'cli';
17
19
  export interface CommandSpec {
@@ -23,6 +25,8 @@ export interface CommandSpec {
23
25
  usage: string;
24
26
  /** Hidden from help unless SEQ_STUDIO_INTERNAL=1. */
25
27
  internal?: boolean;
28
+ /** Still works until 2.0, with this replacement printed on every run. */
29
+ deprecated?: string;
26
30
  aliases?: readonly string[];
27
31
  description: string;
28
32
  lifecycle: Lifecycle;
@@ -41,5 +45,7 @@ export interface CommandSpec {
41
45
  }) => Promise<number>;
42
46
  }
43
47
  export declare const subs: (names: readonly string[], unlisted?: readonly string[]) => Subcommand[];
48
+ /** Mark subcommands as deprecated, each with the replacement printed when it runs. */
49
+ export declare const deprecate: (subcommands: readonly Subcommand[], replacements: Readonly<Record<string, string>>) => Subcommand[];
44
50
  export declare const present: (values: Array<string | undefined>) => string[];
45
51
  export declare function parse(argv: string[]): Promise<ParsedArgs>;
@@ -2,6 +2,8 @@ export const subs = (names, unlisted = []) => [
2
2
  ...names.map((name) => ({ name })),
3
3
  ...unlisted.map((name) => ({ name, listed: false })),
4
4
  ];
5
+ /** Mark subcommands as deprecated, each with the replacement printed when it runs. */
6
+ export const deprecate = (subcommands, replacements) => subcommands.map((sub) => (replacements[sub.name] ? { ...sub, deprecated: replacements[sub.name] } : sub));
5
7
  export const present = (values) => values.filter((value) => Boolean(value));
6
8
  export async function parse(argv) {
7
9
  return (await import('../argv.js')).parseArgs(argv);
@@ -147,7 +147,7 @@ async function connect(args) {
147
147
  ...(promotedBuildsFrom ? { promotedBuildsFrom } : {}), ...(laptopDeploys ? { laptopDeploys } : {})
148
148
  } });
149
149
  if (args.flags.json === true) {
150
- process.stdout.write(`${JSON.stringify({ repository, githubRepositoryId: id, connections, ...images }, null, 2)}\n`);
150
+ console.log(JSON.stringify({ repository, githubRepositoryId: id, connections, ...images }, null, 2));
151
151
  return 0;
152
152
  }
153
153
  process.stdout.write(`Connected ${repository} on ${ctx.env.name}: ${branch} deploys to ${stage}, with seq-ci ${settings.seq_ci}'s images.\n`);
@@ -209,7 +209,7 @@ async function status(args) {
209
209
  const query = new URLSearchParams({ githubRepositoryId: id, limit: flag(args, 'limit') ?? '10', ...(flag(args, 'stage') ? { stage: stageOf(args) } : {}) });
210
210
  const page = await getJson({ ...clientOptions(ctx), path: `/api/ci/github/releases?${query}` });
211
211
  if (args.flags.json === true) {
212
- process.stdout.write(`${JSON.stringify(page, null, 2)}\n`);
212
+ console.log(JSON.stringify(page, null, 2));
213
213
  return 0;
214
214
  }
215
215
  if (!page.releases.length) {
@@ -257,7 +257,7 @@ async function bind(args) {
257
257
  if ('needContent' in result)
258
258
  throw new Error('Atlas still lacks planner files after they were sent');
259
259
  if (args.flags.json === true) {
260
- process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
260
+ console.log(JSON.stringify(result, null, 2));
261
261
  return 0;
262
262
  }
263
263
  const verb = result.saved ? 'Bound' : 'Would bind';
@@ -87,7 +87,7 @@ export async function runRepoInitCommand(args) {
87
87
  const repository = originRepository(directory);
88
88
  const commands = repository ? githubSettingsCommands({ repository, settings }) : [];
89
89
  if (args.flags.json === true) {
90
- process.stdout.write(`${JSON.stringify({ settings, repository, files: reports, githubCommands: commands.map((command) => command.slice(0, -1)) }, null, 2)}\n`);
90
+ console.log(JSON.stringify({ settings, repository, files: reports, githubCommands: commands.map((command) => command.slice(0, -1)) }, null, 2));
91
91
  }
92
92
  else {
93
93
  process.stdout.write(`${check ? 'Checking' : 'Initialized'} ${repository ?? directory} for org ${settings.org} (dev ${settings.branches.dev}, release ${settings.branches.release}, seq-ci ${settings.seq_ci}, pull-request builds ${settings.pull_request_builds})\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.9.26",
3
+ "version": "1.0.0",
4
4
  "description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth whoami`. Includes Auth0 browser login shared with seqapi.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -46,15 +46,15 @@
46
46
  "yaml": "^2.8.4",
47
47
  "zod": "4.6.6",
48
48
  "@sequenceholdings/agent-spec": "0.1.6",
49
- "@sequenceholdings/artifact-studio": "0.11.22",
50
49
  "@sequenceholdings/lattice": "0.1.9",
51
- "@sequenceholdings/managed-functions": "0.5.15",
50
+ "@sequenceholdings/storage": "0.1.8",
52
51
  "@sequenceholdings/platform": "0.1.5",
53
- "@sequenceholdings/storage": "0.1.8"
52
+ "@sequenceholdings/managed-functions": "0.5.16",
53
+ "@sequenceholdings/artifact-studio": "0.11.23"
54
54
  },
55
55
  "peerDependencies": {
56
- "@sequenceholdings/orm": "2.12.0",
57
- "@sequenceholdings/pipeline-spec": "0.3.14"
56
+ "@sequenceholdings/orm": "2.12.1",
57
+ "@sequenceholdings/pipeline-spec": "0.3.15"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@sequenceholdings/orm": {
@@ -70,8 +70,8 @@
70
70
  "@types/semver": "^7.8.0",
71
71
  "typescript": "^5.6.0",
72
72
  "vitest": "^4.1.12",
73
- "@sequenceholdings/pipeline-spec": "0.3.14",
74
- "@sequenceholdings/orm": "2.12.0"
73
+ "@sequenceholdings/orm": "2.12.1",
74
+ "@sequenceholdings/pipeline-spec": "0.3.15"
75
75
  },
76
76
  "engines": {
77
77
  "node": ">=20"
@@ -9,5 +9,7 @@
9
9
  "0.9.23": "ORM plans now accept retained table and column rename hints when previewing a fresh schema. Includes ORM 2.11.1 and updated dependent packages; incremental migrations retain rename-source validation.",
10
10
  "0.9.24": "Artifact builds now use Atlas UI 4.0.0 and its DatePicker and DateRangePicker controls. Legacy public date field exports are removed.",
11
11
  "0.9.25": "function deploy --adopt, on a local Atlas running on a personal development database branch, takes over a function that a database copy brought from another runtime, so it deploys and runs there under its own slug.",
12
- "0.9.26": "Includes ORM 2.12.0: resolved tables can set rows: { keys: 'indexed' } so a policy or link filter that probes them by key reaches every source's index instead of rebuilding the view per probed row. Atlas checks that only the generated view reads its key relations."
12
+ "0.9.26": "Includes ORM 2.12.0: resolved tables can set rows: { keys: 'indexed' } so a policy or link filter that probes them by key reaches every source's index instead of rebuilding the view per probed row. Atlas checks that only the generated view reads its key relations.",
13
+ "0.9.27": "Includes ORM 2.12.1: orm generate --migration-export writes compact JSON, so namespaces with many operations stay under the export size limit, and committed migration chain links carry their reviewed destructive flag, which repository CI reads as consent to apply that data loss.",
14
+ "1.0.0": "seq-studio 1.0: commands, flags, exit codes and JSON output are now stable. Old spellings still work. promote, secret attach and apply, repos, and --repo from git-service are deprecated: each prints its replacement and is removed in 2.0."
13
15
  }