@sequenceholdings/studio-cli 0.9.23 → 0.9.26

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 (157) hide show
  1. package/README.md +166 -146
  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/app-preview/commands.d.ts +7 -0
  23. package/dist/app-preview/commands.js +264 -0
  24. package/dist/app-preview/fingerprint.d.ts +20 -0
  25. package/dist/app-preview/fingerprint.js +32 -0
  26. package/dist/app-preview/install.d.ts +31 -0
  27. package/dist/app-preview/install.js +53 -0
  28. package/dist/app-preview/namespace-probe.d.ts +13 -0
  29. package/dist/app-preview/namespace-probe.js +50 -0
  30. package/dist/app-preview/plan.d.ts +28 -0
  31. package/dist/app-preview/plan.js +41 -0
  32. package/dist/app-preview/run.d.ts +32 -0
  33. package/dist/app-preview/run.js +48 -0
  34. package/dist/app-preview/runners.d.ts +73 -0
  35. package/dist/app-preview/runners.js +226 -0
  36. package/dist/app-preview/secrets.d.ts +48 -0
  37. package/dist/app-preview/secrets.js +104 -0
  38. package/dist/app-preview/target.d.ts +28 -0
  39. package/dist/app-preview/target.js +62 -0
  40. package/dist/artifact/delegate.d.ts +1 -12
  41. package/dist/artifact/delegate.js +43 -124
  42. package/dist/artifact/sandbox.js +1 -1
  43. package/dist/auth-cmds/commands.js +1 -2
  44. package/dist/auth.js +1 -3
  45. package/dist/bin.js +12 -2
  46. package/dist/cli-attribution.d.ts +4 -0
  47. package/dist/cli-attribution.js +25 -3
  48. package/dist/cli-errors.d.ts +9 -1
  49. package/dist/cli-errors.js +20 -9
  50. package/dist/command-contract.d.ts +7 -182
  51. package/dist/command-contract.js +9 -33
  52. package/dist/command-help.d.ts +6 -6
  53. package/dist/command-help.js +31 -27
  54. package/dist/command-telemetry.js +2 -2
  55. package/dist/config-dir.d.ts +8 -0
  56. package/dist/config-dir.js +35 -0
  57. package/dist/config.d.ts +6 -7
  58. package/dist/config.js +15 -15
  59. package/dist/docs/commands.js +9 -4
  60. package/dist/edge-auth-headers.js +1 -18
  61. package/dist/env-registry.d.ts +4 -0
  62. package/dist/env-registry.js +15 -6
  63. package/dist/envs/commands.d.ts +3 -0
  64. package/dist/envs/commands.js +11 -0
  65. package/dist/exit-codes.d.ts +16 -0
  66. package/dist/exit-codes.js +27 -0
  67. package/dist/functions/bundle.d.ts +1 -1
  68. package/dist/functions/commands.d.ts +15 -0
  69. package/dist/functions/commands.js +86 -29
  70. package/dist/functions/manifest.js +1 -1
  71. package/dist/functions/service-account-guidance.d.ts +1 -1
  72. package/dist/functions/service-account-guidance.js +2 -2
  73. package/dist/lifecycle/check.d.ts +13 -0
  74. package/dist/lifecycle/check.js +116 -0
  75. package/dist/lifecycle/commands.d.ts +14 -0
  76. package/dist/lifecycle/commands.js +121 -0
  77. package/dist/lifecycle/plan.d.ts +28 -0
  78. package/dist/lifecycle/plan.js +113 -0
  79. package/dist/lifecycle/rollback.d.ts +7 -0
  80. package/dist/lifecycle/rollback.js +89 -0
  81. package/dist/lifecycle/seq-ci-tools.d.ts +107 -0
  82. package/dist/lifecycle/seq-ci-tools.js +177 -0
  83. package/dist/lifecycle/upgrade.d.ts +3 -0
  84. package/dist/lifecycle/upgrade.js +38 -0
  85. package/dist/machine-output.d.ts +11 -2
  86. package/dist/machine-output.js +32 -10
  87. package/dist/main.d.ts +16 -6
  88. package/dist/main.js +187 -361
  89. package/dist/orgs.d.ts +45 -0
  90. package/dist/orgs.js +106 -0
  91. package/dist/orm/delegate.d.ts +1 -1
  92. package/dist/orm/delegate.js +32 -18
  93. package/dist/orm/deployment-policy.js +1 -2
  94. package/dist/orm/discover.js +6 -8
  95. package/dist/orm/execute.d.ts +1 -1
  96. package/dist/orm/execute.js +5 -6
  97. package/dist/orm/failures.js +2 -2
  98. package/dist/orm/help.d.ts +1 -1
  99. package/dist/orm/help.js +5 -5
  100. package/dist/orm/history.js +1 -2
  101. package/dist/orm/operation-show.js +1 -2
  102. package/dist/orm/version-guard.d.ts +7 -2
  103. package/dist/orm/version-guard.js +12 -7
  104. package/dist/pipeline/codegen.js +2 -2
  105. package/dist/pipeline/commands.js +9 -7
  106. package/dist/pipeline/discovery.d.ts +1 -1
  107. package/dist/pipeline/discovery.js +2 -3
  108. package/dist/pipeline/help.d.ts +1 -1
  109. package/dist/pipeline/help.js +1 -1
  110. package/dist/pipeline/lifecycle.js +1 -1
  111. package/dist/pipeline/stage-secrets.js +4 -4
  112. package/dist/pipeline/templates.js +2 -2
  113. package/dist/pnpm-auto-update.js +3 -3
  114. package/dist/principals/commands.d.ts +1 -1
  115. package/dist/principals/commands.js +13 -14
  116. package/dist/process/commands.js +4 -1
  117. package/dist/process/run-steps.d.ts +2 -2
  118. package/dist/process/runs.js +1 -2
  119. package/dist/registry/commands.d.ts +4 -0
  120. package/dist/registry/commands.js +281 -0
  121. package/dist/registry/help.d.ts +8 -0
  122. package/dist/registry/help.js +64 -0
  123. package/dist/registry/lifecycle-commands.d.ts +3 -0
  124. package/dist/registry/lifecycle-commands.js +67 -0
  125. package/dist/registry/lookup.d.ts +6 -0
  126. package/dist/registry/lookup.js +18 -0
  127. package/dist/registry/runners.d.ts +14 -0
  128. package/dist/registry/runners.js +206 -0
  129. package/dist/registry/spec.d.ts +45 -0
  130. package/dist/registry/spec.js +8 -0
  131. package/dist/repos/commands.d.ts +1 -4
  132. package/dist/repos/commands.js +3 -21
  133. package/dist/repos/github-connect-command.d.ts +10 -1
  134. package/dist/repos/github-connect-command.js +52 -11
  135. package/dist/repos/github-init.d.ts +9 -2
  136. package/dist/repos/github-init.js +18 -2
  137. package/dist/repos/init-repo.js +1 -2
  138. package/dist/run-pinned.d.ts +48 -0
  139. package/dist/run-pinned.js +127 -0
  140. package/dist/sdk-source.d.ts +64 -0
  141. package/dist/sdk-source.js +199 -0
  142. package/dist/secrets/commands.d.ts +1 -1
  143. package/dist/secrets/commands.js +29 -24
  144. package/dist/service-accounts/commands.d.ts +1 -1
  145. package/dist/service-accounts/commands.js +4 -5
  146. package/dist/staged-env.d.ts +14 -0
  147. package/dist/staged-env.js +73 -0
  148. package/dist/storage/commands.js +21 -22
  149. package/dist/templates/catalog.d.ts +5 -5
  150. package/dist/templates/catalog.js +1 -1
  151. package/dist/update-check.js +3 -3
  152. package/dist/version-support.d.ts +39 -0
  153. package/dist/version-support.js +71 -0
  154. package/package.json +11 -10
  155. package/release-summary.json +4 -1
  156. package/dist/preview.d.ts +0 -90
  157. package/dist/preview.js +0 -292
@@ -0,0 +1,38 @@
1
+ import { ExitCode, UsageError } from '../exit-codes.js';
2
+ const UPGRADE_USAGE = `usage:
3
+ seq-studio upgrade [--to <major.minor>] [--dir <checkout>] [--check]
4
+
5
+ Pin this repository to the running seq-studio's <major.minor> (or --to), in .seq/github.yml,
6
+ and refresh every file repo init manages to match. --check reports without writing (exit 3
7
+ when anything would change). Renovate opens the same change as a pull request.`;
8
+ export async function runUpgradeCommand(args) {
9
+ if (args.flags.help === true || args.flags.h === true) {
10
+ console.log(UPGRADE_USAGE);
11
+ return ExitCode.Ok;
12
+ }
13
+ const to = args.flags.to;
14
+ if (to !== undefined && (typeof to !== 'string' || !/^\d+\.\d+$/.test(to))) {
15
+ throw new UsageError('--to takes <major.minor>, for example --to 1.4');
16
+ }
17
+ const directory = typeof args.flags.dir === 'string' ? args.flags.dir : '.';
18
+ const { GITHUB_SETTINGS_PATH, initializeGitHubRepository, installedMajorMinor, resolveSettings } = await import('../repos/github-init.js');
19
+ const { repositorySettings } = await import('../orgs.js');
20
+ if (!await repositorySettings(directory)) {
21
+ throw new UsageError('No .seq/github.yml here; set the repository up first with: seq-studio repo init');
22
+ }
23
+ const cli = typeof to === 'string' ? to : installedMajorMinor();
24
+ const settings = await resolveSettings({ directory, cli });
25
+ const check = args.flags.check === true;
26
+ const preview = await initializeGitHubRepository({ directory, settings, write: false });
27
+ if (preview.some(({ path, status }) => path === GITHUB_SETTINGS_PATH && status === 'unmanaged')) {
28
+ throw new UsageError(`${GITHUB_SETTINGS_PATH} is not managed by seq-studio; edit its cli: pin by hand, or rerun seq-studio repo init`);
29
+ }
30
+ const reports = check ? preview : await initializeGitHubRepository({ directory, settings, write: true });
31
+ const changed = reports.filter(({ status }) => status === 'missing' || status === 'stale');
32
+ for (const report of reports)
33
+ console.log(`${report.status.padEnd(9)} ${report.path}`);
34
+ console.log(check
35
+ ? `${changed.length === 0 ? 'Pinned to' : 'Would pin to'} seq-studio ${cli}.`
36
+ : `Pinned to seq-studio ${cli}. Commit the changed files.`);
37
+ return check && changed.length > 0 ? ExitCode.Blocked : ExitCode.Ok;
38
+ }
@@ -1,7 +1,16 @@
1
1
  /** True when the arguments ask for JSON (or JSON Lines) on stdout. */
2
2
  export declare function requestsMachineOutput(argv: readonly string[]): boolean;
3
+ /**
4
+ * Put `"schema": "<command>@1"` first in a JSON object document. Arrays and
5
+ * objects that already carry a `schema` key are printed unchanged.
6
+ */
7
+ export declare function withSchema(text: string, value: unknown, schema: string): string;
3
8
  /**
4
9
  * Route non-JSON console.log / console.info output to stderr until the
5
- * returned restore function runs.
10
+ * returned restore function runs. With `schema`, single-document JSON objects
11
+ * also gain their schema name.
6
12
  */
7
- export declare function guardMachineOutput(): () => void;
13
+ export declare function guardMachineOutput({ schema, argv }?: {
14
+ schema?: string;
15
+ argv?: readonly string[];
16
+ }): () => void;
@@ -24,28 +24,50 @@ export function requestsMachineOutput(argv) {
24
24
  }
25
25
  return false;
26
26
  }
27
- function isJsonText(text) {
27
+ function parseJson(text) {
28
28
  if (text.trim() === '')
29
- return false;
29
+ return { ok: false };
30
30
  try {
31
- JSON.parse(text);
32
- return true;
31
+ return { ok: true, value: JSON.parse(text) };
33
32
  }
34
33
  catch {
35
- return false;
34
+ return { ok: false };
36
35
  }
37
36
  }
37
+ /** True for `--jsonl`, whose lines are stream items rather than one document. */
38
+ function requestsJsonLines(argv) {
39
+ return argv.some((arg) => arg === '--jsonl' || (arg.startsWith('--jsonl=') && arg !== '--jsonl=false'));
40
+ }
41
+ function indentOf(text) {
42
+ const match = /\n( +)\S/.exec(text);
43
+ return match?.[1]?.length ?? 0;
44
+ }
45
+ /**
46
+ * Put `"schema": "<command>@1"` first in a JSON object document. Arrays and
47
+ * objects that already carry a `schema` key are printed unchanged.
48
+ */
49
+ export function withSchema(text, value, schema) {
50
+ if (typeof value !== 'object' || value === null || Array.isArray(value) || 'schema' in value)
51
+ return text;
52
+ return JSON.stringify({ schema: `${schema}@1`, ...value }, null, indentOf(text) || undefined);
53
+ }
38
54
  /**
39
55
  * Route non-JSON console.log / console.info output to stderr until the
40
- * returned restore function runs.
56
+ * returned restore function runs. With `schema`, single-document JSON objects
57
+ * also gain their schema name.
41
58
  */
42
- export function guardMachineOutput() {
59
+ export function guardMachineOutput({ schema, argv = process.argv.slice(2) } = {}) {
43
60
  const { log, info } = console;
61
+ const tagSchema = schema !== undefined && !requestsJsonLines(argv);
44
62
  const route = (write) => (...args) => {
45
- if (isJsonText(format(...args)))
46
- write(...args);
47
- else
63
+ const text = format(...args);
64
+ const parsed = parseJson(text);
65
+ if (!parsed.ok)
48
66
  console.error(...args);
67
+ else if (tagSchema && args.length === 1 && typeof args[0] === 'string')
68
+ write(withSchema(text, parsed.value, schema));
69
+ else
70
+ write(...args);
49
71
  };
50
72
  console.log = route(log);
51
73
  console.info = route(info);
package/dist/main.d.ts CHANGED
@@ -7,24 +7,34 @@
7
7
  * seq-studio deploy deploy all primitives from sequence.app.yml
8
8
  * seq-studio process <sub> manage Lattice processes
9
9
  * seq-studio artifact <sub> manage Artifact Studio apps
10
- * seq-studio functions <sub> manage Managed Functions
11
- * seq-studio agents <sub> manage typed agent definitions
12
- * seq-studio secrets <sub> manage org-owned Managed Secrets
10
+ * seq-studio function <sub> manage Managed Functions
11
+ * seq-studio agent <sub> manage typed agent definitions
12
+ * seq-studio secret <sub> manage org-owned Managed Secrets
13
13
  * seq-studio repos <sub> manage platform git-service repos
14
14
  * seq-studio templates <sub> publish and synchronize Git-backed templates
15
15
  * seq-studio pipeline <sub> discover, query, author and operate Data Pipelines
16
16
  * seq-studio auth <sub> manage Git authentication
17
17
  * seq-studio docs <sub> search and read the environment's developer docs
18
18
  * seq-studio feedback submit submit agent feedback
19
- * seq-studio service-accounts <sub> provision runtime identities
19
+ * seq-studio service-account <sub> provision runtime identities
20
20
  * seq-studio access <sub> manage resource access on every primitive
21
- * seq-studio principals <sub> find users, groups and service accounts to grant
21
+ * seq-studio principal <sub> find users, groups and service accounts to grant
22
22
  * seq-studio envs <sub> add/list environments
23
23
  * seq-studio login authenticate interactively with Auth0
24
24
  * seq-studio logout remove cached user tokens
25
25
  * seq-studio doctor check token + env + writer gate
26
26
  * seq-studio help show usage
27
27
  */
28
- /** Only command words from the router; never operands, flags, paths, or arguments. */
28
+ /** Only command words from the router; never operands, flags, paths, or arguments. Always the current spelling. */
29
29
  export declare function commandTelemetryName(argv: string[]): string | null;
30
30
  export declare function run(argv?: string[]): Promise<number>;
31
+ /** The command words that name a JSON document's schema, e.g. `repo status`. Always the current spelling. */
32
+ export declare function schemaName(argv: string[]): string | undefined;
33
+ /**
34
+ * `--break-glass "<reason>"` on any command: removed from argv so no command's own parser sees it. An empty or
35
+ * missing reason is a usage error.
36
+ */
37
+ export declare function takeBreakGlass(argv: string[]): {
38
+ argv: string[];
39
+ breakGlass?: string | Error;
40
+ };