@capgo/cli 7.117.2 → 7.119.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.
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.117.2",
4
+ "version": "7.119.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -0,0 +1,39 @@
1
+ export type BuilderCtaSurface = 'skip' | 'ci-ad' | 'prompt-onboarding' | 'prompt-build';
2
+ export type BuilderCtaAction = 'continue' | 'launch-onboarding' | 'launch-build';
3
+ export interface BuilderCtaContext {
4
+ incompatible: boolean;
5
+ interactive: boolean;
6
+ hasCredentials: boolean;
7
+ }
8
+ /**
9
+ * Pure decision: which Builder CTA surface (if any) to show for this upload.
10
+ * - `skip`: do nothing (compatible bundle).
11
+ * - `ci-ad`: non-interactive — print a one-off ad, never prompt.
12
+ * - `prompt-onboarding` / `prompt-build`: interactive prompt, branched on
13
+ * whether the app already has build credentials.
14
+ */
15
+ export declare function decideBuilderCtaSurface(ctx: BuilderCtaContext): BuilderCtaSurface;
16
+ export declare function printBuilderCiAd(hasCredentials: boolean): void;
17
+ /** Confirm-prompt seam (`@clack/prompts` `confirm` satisfies it); injectable for tests. */
18
+ export type BuilderConfirm = (opts: {
19
+ message: string;
20
+ initialValue?: boolean;
21
+ }) => Promise<boolean | symbol>;
22
+ export interface MaybePromptBuilderCtaParams {
23
+ incompatible: boolean;
24
+ interactive: boolean;
25
+ /** Whether the app already has saved build credentials (resolved by the caller). */
26
+ hasCredentials: boolean;
27
+ appId: string;
28
+ orgId: string;
29
+ apikey: string;
30
+ incompatibleCount: number;
31
+ /** Injectable for tests; defaults to the `@clack/prompts` confirm prompt. */
32
+ confirm?: BuilderConfirm;
33
+ }
34
+ /**
35
+ * Surface the Capgo Builder CTA for an incompatible upload and return the action
36
+ * the caller should take. Never throws; telemetry and prompt failures degrade to
37
+ * `continue` so the upload is never blocked by the CTA.
38
+ */
39
+ export declare function maybePromptBuilderCta(params: MaybePromptBuilderCtaParams): Promise<BuilderCtaAction>;
@@ -0,0 +1,8 @@
1
+ import type { OptionsUpload } from './upload_interface';
2
+ /**
3
+ * `bundle upload` command handler. Uploads the bundle, then — when the bundle is
4
+ * incompatible and the user opted into Capgo Builder — launches the Ink-based
5
+ * build flow. Kept out of `upload.ts` so the programmatic SDK bundle (which
6
+ * imports `uploadBundleInternal`) never statically pulls in `ink`.
7
+ */
8
+ export declare function handleBundleUploadCommand(appId: string, options: OptionsUpload): Promise<void>;
@@ -15,4 +15,5 @@ export declare function uploadBundle(appid: string, options: OptionsUpload): Pro
15
15
  storageProvider?: string | undefined;
16
16
  skipped?: boolean | undefined;
17
17
  reason?: string | undefined;
18
+ builderAction?: "launch-onboarding" | "launch-build" | undefined;
18
19
  }>;
@@ -84,6 +84,10 @@ export declare const uploadBundleResultSchema: z.ZodObject<{
84
84
  storageProvider: z.ZodOptional<z.ZodString>;
85
85
  skipped: z.ZodOptional<z.ZodBoolean>;
86
86
  reason: z.ZodOptional<z.ZodString>;
87
+ builderAction: z.ZodOptional<z.ZodEnum<{
88
+ "launch-onboarding": "launch-onboarding";
89
+ "launch-build": "launch-build";
90
+ }>>;
87
91
  }, z.core.$strip>;
88
92
  export type UploadBundleResult = z.infer<typeof uploadBundleResultSchema>;
89
93
  export declare const bundleZipOptionsSchema: z.ZodObject<{