@sanity/runtime-cli 14.13.3 → 15.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.
Files changed (65) hide show
  1. package/README.md +215 -118
  2. package/dist/actions/blueprints/blueprint.js +13 -11
  3. package/dist/actions/blueprints/logs.d.ts +2 -1
  4. package/dist/actions/blueprints/logs.js +4 -5
  5. package/dist/actions/blueprints/resources.js +1 -0
  6. package/dist/actions/blueprints/stacks.d.ts +3 -1
  7. package/dist/actions/blueprints/stacks.js +11 -2
  8. package/dist/actions/functions/test.js +1 -1
  9. package/dist/actions/sanity/access.d.ts +38 -0
  10. package/dist/actions/sanity/access.js +23 -0
  11. package/dist/actions/sanity/projects.d.ts +1 -1
  12. package/dist/baseCommands.d.ts +2 -0
  13. package/dist/baseCommands.js +8 -5
  14. package/dist/commands/blueprints/add.js +1 -1
  15. package/dist/commands/blueprints/deploy.d.ts +2 -0
  16. package/dist/commands/blueprints/deploy.js +6 -2
  17. package/dist/commands/blueprints/destroy.js +0 -2
  18. package/dist/commands/blueprints/info.d.ts +1 -0
  19. package/dist/commands/blueprints/info.js +3 -1
  20. package/dist/commands/blueprints/init.js +2 -0
  21. package/dist/commands/blueprints/logs.d.ts +5 -0
  22. package/dist/commands/blueprints/logs.js +26 -3
  23. package/dist/commands/blueprints/mint-deploy-token.d.ts +14 -0
  24. package/dist/commands/blueprints/mint-deploy-token.js +47 -0
  25. package/dist/commands/blueprints/plan.d.ts +2 -0
  26. package/dist/commands/blueprints/plan.js +8 -2
  27. package/dist/commands/blueprints/promote.d.ts +2 -1
  28. package/dist/commands/blueprints/promote.js +7 -2
  29. package/dist/commands/blueprints/stacks.js +1 -1
  30. package/dist/commands/functions/add.js +1 -1
  31. package/dist/cores/blueprints/config.js +34 -34
  32. package/dist/cores/blueprints/doctor.js +7 -7
  33. package/dist/cores/blueprints/init.js +99 -76
  34. package/dist/cores/blueprints/logs.d.ts +3 -0
  35. package/dist/cores/blueprints/logs.js +15 -9
  36. package/dist/cores/blueprints/mint-deploy-token.d.ts +15 -0
  37. package/dist/cores/blueprints/mint-deploy-token.js +111 -0
  38. package/dist/cores/blueprints/promote.d.ts +1 -0
  39. package/dist/cores/blueprints/promote.js +25 -4
  40. package/dist/cores/functions/add.js +4 -5
  41. package/dist/cores/index.d.ts +1 -2
  42. package/dist/cores/index.js +1 -3
  43. package/dist/index.d.ts +0 -18
  44. package/dist/index.js +0 -20
  45. package/dist/utils/clipboard.d.ts +14 -0
  46. package/dist/utils/clipboard.js +73 -0
  47. package/dist/utils/display/errors.d.ts +5 -1
  48. package/dist/utils/display/prompt.d.ts +55 -15
  49. package/dist/utils/display/prompt.js +271 -45
  50. package/oclif.manifest.json +320 -18
  51. package/package.json +21 -67
  52. package/dist/actions/blueprints/index.d.ts +0 -16
  53. package/dist/actions/blueprints/index.js +0 -10
  54. package/dist/actions/functions/index.d.ts +0 -4
  55. package/dist/actions/functions/index.js +0 -4
  56. package/dist/actions/sanity/index.d.ts +0 -1
  57. package/dist/actions/sanity/index.js +0 -1
  58. package/dist/cores/blueprints/index.d.ts +0 -20
  59. package/dist/cores/blueprints/index.js +0 -10
  60. package/dist/cores/functions/index.d.ts +0 -16
  61. package/dist/cores/functions/index.js +0 -8
  62. package/dist/utils/display/index.d.ts +0 -5
  63. package/dist/utils/display/index.js +0 -5
  64. package/dist/utils/index.d.ts +0 -8
  65. package/dist/utils/index.js +0 -8
@@ -3,6 +3,7 @@ export interface BlueprintPromoteOptions extends DeployedBlueprintConfig {
3
3
  flags: {
4
4
  force?: boolean;
5
5
  verbose?: boolean;
6
+ 'new-stack-name'?: string;
6
7
  };
7
8
  }
8
9
  export declare function blueprintPromoteCore(options: BlueprintPromoteOptions): Promise<CoreResult>;
@@ -4,10 +4,23 @@ import { promoteStack } from '../../actions/blueprints/stacks.js';
4
4
  import { niceId } from '../../utils/display/presenters.js';
5
5
  export async function blueprintPromoteCore(options) {
6
6
  const { bin = 'sanity', log, stackId, auth, flags, deployedStack, blueprint } = options;
7
+ const newStackName = flags['new-stack-name'];
8
+ if (newStackName && deployedStack.scopeType === 'organization') {
9
+ return {
10
+ success: false,
11
+ error: '--new-stack-name can only be used when promoting a project-scoped Stack to organization scope.',
12
+ suggestions: [
13
+ `Stack "${deployedStack.name}" ${niceId(deployedStack.id)} is already org-scoped.`,
14
+ ],
15
+ };
16
+ }
7
17
  let message = `"${deployedStack.name}" ${niceId(deployedStack.id)}`;
8
18
  if (deployedStack.scopeType === 'organization') {
9
19
  message = `Stack ${message} is already org-scoped. Promote again?`;
10
20
  }
21
+ else if (newStackName) {
22
+ message = `Promote Stack ${message} from project to organization scope and rename to "${newStackName}"? You will need admin access to your organization.`;
23
+ }
11
24
  else {
12
25
  message = `Promote Stack ${message} from project to organization scope? You will need admin access to your organization.`;
13
26
  }
@@ -19,10 +32,18 @@ export async function blueprintPromoteCore(options) {
19
32
  }
20
33
  try {
21
34
  const spinner = log.ora('Promoting Stack...').start();
22
- const { ok, error, stack } = await promoteStack({ stackId, auth, logger: log });
35
+ const { ok, error, stack, response } = await promoteStack({
36
+ stackId,
37
+ auth,
38
+ logger: log,
39
+ name: newStackName,
40
+ });
23
41
  if (!ok) {
24
42
  spinner.fail('Failed to promote Stack');
25
43
  const suggestions = [];
44
+ if (response?.status === 409) {
45
+ suggestions.push('A Stack with this name already exists in the target organization. Use --new-stack-name <name> to rename while promoting.');
46
+ }
26
47
  if (error && /access|permission|forbidden/i.test(error)) {
27
48
  suggestions.push('Verify you have organization admin access.');
28
49
  }
@@ -38,14 +59,14 @@ export async function blueprintPromoteCore(options) {
38
59
  organizationId: stack.scopeId,
39
60
  projectId: null,
40
61
  });
41
- log('Blueprint configuration updated');
62
+ log('Blueprint config updated (.sanity/blueprint.config.json)');
42
63
  }
43
64
  catch {
44
65
  return {
45
66
  success: false,
46
- error: 'Stack promoted successfully but failed to update local Blueprint configuration. No config file found.',
67
+ error: 'Stack promoted, but could not update Blueprint config (.sanity/blueprint.config.json).',
47
68
  suggestions: [
48
- `Run \`npx ${bin} blueprints config --edit\` to update your local configuration.`,
69
+ `Run \`npx ${bin} blueprints config --edit\` to update your Blueprint config manually.`,
49
70
  ],
50
71
  };
51
72
  }
@@ -5,9 +5,7 @@ import { checkbox, confirm, input, select } from '@inquirer/prompts';
5
5
  import { highlight } from 'cardinal';
6
6
  import { createFunctionResource } from '../../actions/blueprints/resources.js';
7
7
  import { verifyExampleExists, writeExample } from '../../actions/sanity/examples.js';
8
- import { EVENT_DOCUMENT_CREATE, EVENT_DOCUMENT_DELETE, EVENT_DOCUMENT_UPDATE, EVENT_MEDIA_LIBRARY_ASSET_CREATE, EVENT_MEDIA_LIBRARY_ASSET_DELETE, EVENT_MEDIA_LIBRARY_ASSET_UPDATE, EVENT_SYNC_TAG_INVALIDATE,
9
- // EVENT_SCHEDULED,
10
- FUNCTION_TYPES, LABEL_DOCUMENT_CREATE, LABEL_DOCUMENT_DELETE, LABEL_DOCUMENT_UPDATE, LABEL_MEDIA_LIBRARY_ASSET_CREATE, LABEL_MEDIA_LIBRARY_ASSET_DELETE, LABEL_MEDIA_LIBRARY_ASSET_UPDATE, LABEL_SCHEDULED, LABEL_SYNC_TAG_INVALIDATE, MAP_EVENT_TO_FUNCTION_TYPE, SANITY_FUNCTION_DOCUMENT, SANITY_FUNCTION_MEDIA_LIBRARY_ASSET, SANITY_FUNCTION_SCHEDULED, SANITY_FUNCTION_SYNC_TAG_INVALIDATE, } from '../../constants.js';
8
+ import { EVENT_DOCUMENT_CREATE, EVENT_DOCUMENT_DELETE, EVENT_DOCUMENT_UPDATE, EVENT_MEDIA_LIBRARY_ASSET_CREATE, EVENT_MEDIA_LIBRARY_ASSET_DELETE, EVENT_MEDIA_LIBRARY_ASSET_UPDATE, EVENT_SCHEDULED, EVENT_SYNC_TAG_INVALIDATE, FUNCTION_TYPES, LABEL_DOCUMENT_CREATE, LABEL_DOCUMENT_DELETE, LABEL_DOCUMENT_UPDATE, LABEL_MEDIA_LIBRARY_ASSET_CREATE, LABEL_MEDIA_LIBRARY_ASSET_DELETE, LABEL_MEDIA_LIBRARY_ASSET_UPDATE, LABEL_SCHEDULED, LABEL_SYNC_TAG_INVALIDATE, MAP_EVENT_TO_FUNCTION_TYPE, SANITY_FUNCTION_DOCUMENT, SANITY_FUNCTION_MEDIA_LIBRARY_ASSET, SANITY_FUNCTION_SCHEDULED, SANITY_FUNCTION_SYNC_TAG_INVALIDATE, } from '../../constants.js';
11
9
  import { check, indent, warn } from '../../utils/display/presenters.js';
12
10
  import { styleText } from '../../utils/style-text.js';
13
11
  import { validateFunctionName } from '../../utils/validate/resource.js';
@@ -152,7 +150,8 @@ export async function functionAddCore(options) {
152
150
  if (fnTypes.length === 0) {
153
151
  throw new Error('At least one function type must be provided.');
154
152
  }
155
- if (!fnTypes.every((evt) => FUNCTION_TYPES.includes(evt))) {
153
+ const validTypes = new Set(FUNCTION_TYPES);
154
+ if (!fnTypes.every((evt) => validTypes.has(evt))) {
156
155
  throw new Error(`Invalid function type. Must be one of: ${FUNCTION_TYPES.join(', ').trim()}`);
157
156
  }
158
157
  const eventSources = new Set(fnTypes.map((t) => t.substring(0, t.lastIndexOf('-'))));
@@ -241,8 +240,8 @@ async function promptForFunctionType() {
241
240
  { name: LABEL_MEDIA_LIBRARY_ASSET_CREATE, value: EVENT_MEDIA_LIBRARY_ASSET_CREATE },
242
241
  { name: LABEL_MEDIA_LIBRARY_ASSET_UPDATE, value: EVENT_MEDIA_LIBRARY_ASSET_UPDATE },
243
242
  { name: LABEL_MEDIA_LIBRARY_ASSET_DELETE, value: EVENT_MEDIA_LIBRARY_ASSET_DELETE },
243
+ { name: LABEL_SCHEDULED, value: EVENT_SCHEDULED },
244
244
  { name: LABEL_SYNC_TAG_INVALIDATE, value: EVENT_SYNC_TAG_INVALIDATE },
245
- // {name: LABEL_SCHEDULED, value: EVENT_SCHEDULED},
246
245
  ],
247
246
  validate(choices) {
248
247
  if (choices.length === 0) {
@@ -1,8 +1,6 @@
1
1
  import { type ReadBlueprintResult } from '../actions/blueprints/blueprint.js';
2
2
  import type { Logger } from '../utils/logger.js';
3
3
  import type { AuthParams, Result, ScopeType, Stack } from '../utils/types.js';
4
- export * as blueprintsCores from './blueprints/index.js';
5
- export * as functionsCores from './functions/index.js';
6
4
  export interface CoreConfig {
7
5
  /** The CLI binary name. */
8
6
  bin: string;
@@ -67,3 +65,4 @@ export declare function initDeployedBlueprintConfig(config: Partial<BlueprintCon
67
65
  validateToken?: boolean;
68
66
  stackOverride?: string;
69
67
  }): Promise<Result<DeployedBlueprintConfig>>;
68
+ export {};
@@ -2,8 +2,6 @@ import { readLocalBlueprint } from '../actions/blueprints/blueprint.js';
2
2
  import { getStack, resolveStackIdByNameOrId } from '../actions/blueprints/stacks.js';
3
3
  import { presentBlueprintParserErrors } from '../utils/display/errors.js';
4
4
  import { validTokenOrErrorMessage } from '../utils/validated-token.js';
5
- export * as blueprintsCores from './blueprints/index.js';
6
- export * as functionsCores from './functions/index.js';
7
5
  export async function initBlueprintConfig({ bin, log, token, validateResources = false, validateToken = true, blueprintPath, }) {
8
6
  let checkedToken = token;
9
7
  if (!token || (token && validateToken)) {
@@ -19,7 +17,7 @@ export async function initBlueprintConfig({ bin, log, token, validateResources =
19
17
  const blueprint = await readLocalBlueprint(log, { resources: validateResources }, blueprintPath);
20
18
  if (blueprint.errors.length > 0) {
21
19
  log(presentBlueprintParserErrors(blueprint.errors));
22
- return { ok: false, error: 'Blueprint file contains errors.' };
20
+ return { ok: false, error: 'Blueprint manifest contains errors.' };
23
21
  }
24
22
  return {
25
23
  ok: true,
package/dist/index.d.ts CHANGED
@@ -1,19 +1 @@
1
1
  export { run } from '@oclif/core';
2
- export { default as BlueprintsAddCommand } from './commands/blueprints/add.js';
3
- export { default as BlueprintsConfigCommand } from './commands/blueprints/config.js';
4
- export { default as BlueprintsDeployCommand } from './commands/blueprints/deploy.js';
5
- export { default as BlueprintsDestroyCommand } from './commands/blueprints/destroy.js';
6
- export { default as BlueprintsDoctorCommand } from './commands/blueprints/doctor.js';
7
- export { default as BlueprintsInfoCommand } from './commands/blueprints/info.js';
8
- export { default as BlueprintsInitCommand } from './commands/blueprints/init.js';
9
- export { default as BlueprintsLogsCommand } from './commands/blueprints/logs.js';
10
- export { default as BlueprintsPlanCommand } from './commands/blueprints/plan.js';
11
- export { default as BlueprintsPromoteCommand } from './commands/blueprints/promote.js';
12
- export { default as BlueprintsStacksCommand } from './commands/blueprints/stacks.js';
13
- export { default as FunctionsAddCommand } from './commands/functions/add.js';
14
- export { default as FunctionsDevCommand } from './commands/functions/dev.js';
15
- export { default as FunctionsEnvAddCommand } from './commands/functions/env/add.js';
16
- export { default as FunctionsEnvListCommand } from './commands/functions/env/list.js';
17
- export { default as FunctionsEnvRemoveCommand } from './commands/functions/env/remove.js';
18
- export { default as FunctionsLogsCommand } from './commands/functions/logs.js';
19
- export { default as FunctionsTestCommand } from './commands/functions/test.js';
package/dist/index.js CHANGED
@@ -1,21 +1 @@
1
1
  export { run } from '@oclif/core';
2
- // Blueprints command classes
3
- export { default as BlueprintsAddCommand } from './commands/blueprints/add.js';
4
- export { default as BlueprintsConfigCommand } from './commands/blueprints/config.js';
5
- export { default as BlueprintsDeployCommand } from './commands/blueprints/deploy.js';
6
- export { default as BlueprintsDestroyCommand } from './commands/blueprints/destroy.js';
7
- export { default as BlueprintsDoctorCommand } from './commands/blueprints/doctor.js';
8
- export { default as BlueprintsInfoCommand } from './commands/blueprints/info.js';
9
- export { default as BlueprintsInitCommand } from './commands/blueprints/init.js';
10
- export { default as BlueprintsLogsCommand } from './commands/blueprints/logs.js';
11
- export { default as BlueprintsPlanCommand } from './commands/blueprints/plan.js';
12
- export { default as BlueprintsPromoteCommand } from './commands/blueprints/promote.js';
13
- export { default as BlueprintsStacksCommand } from './commands/blueprints/stacks.js';
14
- // Functions command classes
15
- export { default as FunctionsAddCommand } from './commands/functions/add.js';
16
- export { default as FunctionsDevCommand } from './commands/functions/dev.js';
17
- export { default as FunctionsEnvAddCommand } from './commands/functions/env/add.js';
18
- export { default as FunctionsEnvListCommand } from './commands/functions/env/list.js';
19
- export { default as FunctionsEnvRemoveCommand } from './commands/functions/env/remove.js';
20
- export { default as FunctionsLogsCommand } from './commands/functions/logs.js';
21
- export { default as FunctionsTestCommand } from './commands/functions/test.js';
@@ -0,0 +1,14 @@
1
+ interface CopyTool {
2
+ cmd: string;
3
+ args: string[];
4
+ }
5
+ export declare class ClipboardUnavailableError extends Error {
6
+ code: string;
7
+ triedTools: string[];
8
+ constructor(message: string, triedTools?: string[]);
9
+ }
10
+ /** Candidate copy tools for the current OS, in fallback order. */
11
+ export declare function pickCopyTools(): CopyTool[];
12
+ /** @throws {ClipboardUnavailableError} when no usable clipboard tool is available. */
13
+ export declare function write(text: string): Promise<void>;
14
+ export {};
@@ -0,0 +1,73 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { env, platform } from 'node:process';
3
+ export class ClipboardUnavailableError extends Error {
4
+ code = 'CLIPBOARD_UNAVAILABLE';
5
+ triedTools;
6
+ constructor(message, triedTools = []) {
7
+ super(message);
8
+ this.name = 'ClipboardUnavailableError';
9
+ this.triedTools = triedTools;
10
+ }
11
+ }
12
+ /** Candidate copy tools for the current OS, in fallback order. */
13
+ export function pickCopyTools() {
14
+ if (platform === 'darwin')
15
+ return [{ cmd: 'pbcopy', args: [] }];
16
+ if (platform === 'win32')
17
+ return [{ cmd: 'clip', args: [] }];
18
+ const tools = [];
19
+ if (env.WAYLAND_DISPLAY)
20
+ tools.push({ cmd: 'wl-copy', args: [] });
21
+ if (env.DISPLAY) {
22
+ tools.push({ cmd: 'xclip', args: ['-selection', 'clipboard'] });
23
+ tools.push({ cmd: 'xsel', args: ['--clipboard', '--input'] });
24
+ }
25
+ if (env.WSL_DISTRO_NAME)
26
+ tools.push({ cmd: 'clip.exe', args: [] });
27
+ return tools;
28
+ }
29
+ function tryWrite(tool, text) {
30
+ return new Promise((resolve, reject) => {
31
+ let child;
32
+ try {
33
+ child = spawn(tool.cmd, tool.args, { stdio: ['pipe', 'ignore', 'pipe'] });
34
+ }
35
+ catch (err) {
36
+ reject(err instanceof Error ? err : new Error(String(err)));
37
+ return;
38
+ }
39
+ let stderr = '';
40
+ child.on('error', reject);
41
+ child.stderr?.on('data', (chunk) => {
42
+ stderr += chunk.toString();
43
+ });
44
+ child.on('close', (code) => {
45
+ if (code === 0) {
46
+ resolve();
47
+ return;
48
+ }
49
+ reject(new Error(`${tool.cmd} exited with code ${code}: ${stderr.trim()}`));
50
+ });
51
+ child.stdin?.end(text, 'utf8');
52
+ });
53
+ }
54
+ /** @throws {ClipboardUnavailableError} when no usable clipboard tool is available. */
55
+ export async function write(text) {
56
+ const tools = pickCopyTools();
57
+ if (tools.length === 0) {
58
+ throw new ClipboardUnavailableError(`No clipboard tool available for platform "${platform}".`, []);
59
+ }
60
+ const triedTools = tools.map((t) => t.cmd);
61
+ let lastErr;
62
+ for (const tool of tools) {
63
+ try {
64
+ await tryWrite(tool, text);
65
+ return;
66
+ }
67
+ catch (err) {
68
+ lastErr = err;
69
+ }
70
+ }
71
+ const message = lastErr instanceof Error ? lastErr.message : String(lastErr);
72
+ throw new ClipboardUnavailableError(`Clipboard write failed. Tools tried: ${triedTools.join(', ')}. Last error: ${message}`, triedTools);
73
+ }
@@ -1,4 +1,8 @@
1
- import type { BlueprintIssue } from '../../actions/blueprints/index.js';
2
1
  import type { BlueprintParserError } from '../types.js';
2
+ export type BlueprintIssue = {
3
+ code: 'NO_STACK_ID' | 'NO_SCOPE_TYPE' | 'NO_SCOPE_ID' | 'NO_STACK' | 'PARSE_ERROR';
4
+ message: string;
5
+ errors?: BlueprintParserError[];
6
+ };
3
7
  export declare function presentBlueprintIssues(issues: BlueprintIssue[]): string;
4
8
  export declare function presentBlueprintParserErrors(errors: BlueprintParserError[]): string;
@@ -1,33 +1,73 @@
1
+ import type { Project } from '../../actions/sanity/projects.js';
1
2
  import type { Logger } from '../logger.js';
3
+ import type { ScopeType } from '../types.js';
4
+ export declare const BACK: unique symbol;
5
+ export type Back = typeof BACK;
2
6
  export declare function promptForBlueprintType(): Promise<string>;
3
7
  /**
4
- * Prompt the user for a Project after selecting an Organization.
5
- * @param token - The Sanity API token
6
- * @returns The selected project, with the projectId and displayName
7
- * @throws {Error} If the user does not have any projects or if the API call fails
8
+ * Fetches organizations and prompts the user to pick one (if multiple).
9
+ * Returns the selected organization along with its projects.
8
10
  */
9
- export declare function promptForProject({ token, knownOrganizationId, knownProjectId, logger, }: {
11
+ export declare function promptForOrganization({ token, knownOrganizationId, logger, allowBack, }: {
10
12
  token: string;
11
13
  knownOrganizationId?: string;
12
- knownProjectId?: string;
13
14
  logger: Logger;
15
+ allowBack?: boolean;
16
+ }): Promise<{
17
+ organization: {
18
+ id: string;
19
+ name: string;
20
+ };
21
+ projects: Project[];
22
+ wasPrompted: boolean;
23
+ } | Back>;
24
+ /**
25
+ * Asks the user whether to scope a Blueprint to an organization or a project.
26
+ */
27
+ export declare function promptForScope({ allowBack, hasProjects, }?: {
28
+ allowBack?: boolean;
29
+ hasProjects?: boolean;
30
+ }): Promise<ScopeType | Back>;
31
+ /**
32
+ * Prompts the user to pick a project from a pre-fetched list of projects.
33
+ * Use after promptForOrganization when the user chose project scope.
34
+ */
35
+ export declare function promptForProjectInOrg({ projects, knownProjectId, logger, allowBack, }: {
36
+ projects: Project[];
37
+ knownProjectId?: string;
38
+ logger?: Logger;
39
+ allowBack?: boolean;
14
40
  }): Promise<{
15
41
  projectId: string;
16
42
  displayName: string;
17
- }>;
43
+ } | Back>;
18
44
  /**
19
- * Prompt the user for a Stack ID after selecting a Project.
20
- * Can be used to create a new Stack or select an existing one.
21
- * @param projectId - The ID of the Project
22
- * @param token - The Sanity API token
23
- * @returns The selected Stack ID
24
- * @throws {Error} If the user does not have any Stacks or if the API call fails
45
+ * Prompt the user for a Stack after scope has been determined.
46
+ * Can create a new Stack or select an existing one.
25
47
  */
26
- export declare function promptForStack({ projectId, token, logger, }: {
27
- projectId: string;
48
+ export declare function promptForStack({ scopeType, scopeId, token, logger, allowBack, }: {
49
+ scopeType: ScopeType;
50
+ scopeId: string;
28
51
  token: string;
29
52
  logger: Logger;
53
+ allowBack?: boolean;
30
54
  }): Promise<{
31
55
  stackId: string;
32
56
  name: string;
57
+ } | Back>;
58
+ /**
59
+ * Full wizard: Organization -> Scope -> Project (if project-scoped) -> Stack.
60
+ * Supports back-navigation between steps.
61
+ */
62
+ export declare function runScopeAndStackWizard({ token, knownOrganizationId, knownProjectId, logger, }: {
63
+ token: string;
64
+ knownOrganizationId?: string;
65
+ knownProjectId?: string;
66
+ logger: Logger;
67
+ }): Promise<{
68
+ scopeType: ScopeType;
69
+ scopeId: string;
70
+ displayName: string;
71
+ stackId: string;
72
+ stackName: string;
33
73
  }>;