@capgo/cli 8.86.0 → 8.87.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": "8.86.0",
4
+ "version": "8.87.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -120,7 +120,7 @@
120
120
  "test:app-add-exists": "bun test/test-app-add-exists.mjs",
121
121
  "test:app-add-getting-started": "bun test/test-app-add-getting-started.mjs",
122
122
  "test:app-list-output-text": "bun test/test-app-list-output-text.mjs",
123
- "test:app-todo": "bun test/test-app-todo.mjs",
123
+ "test:app-todo": "bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs",
124
124
  "test:doctor-analytics": "bun test/test-doctor-analytics.mjs",
125
125
  "test:posthog-exception": "bun test/test-posthog-exception.mjs",
126
126
  "test:cli-recovery": "bun test/test-cli-recovery.mjs",
@@ -0,0 +1,26 @@
1
+ export declare const BUILDER_STEP_IDS: {
2
+ readonly ios: readonly ["start_setup", "choose_destination", "connect_app_store", "prepare_certificate", "prepare_profile", "successful_cloud_build"];
3
+ readonly android: readonly ["start_setup", "prepare_keystore", "connect_google_play", "successful_cloud_build"];
4
+ };
5
+ export type BuilderChecklistPlatform = keyof typeof BUILDER_STEP_IDS;
6
+ export type BuilderChecklistStatus = 'pending' | 'done' | 'skipped' | 'warning';
7
+ export declare function onboardingRecord(value: unknown): Record<string, unknown>;
8
+ export declare function getBuilderOnlySetup(value: unknown): Record<string, unknown> | null;
9
+ export declare function getBuilderOnlyChecklist(value: unknown): {
10
+ version: number;
11
+ path: "builder";
12
+ selectedPlatform: "android" | "ios" | undefined;
13
+ steps: {
14
+ id: string;
15
+ stepId: "start_setup" | "choose_destination" | "connect_app_store" | "prepare_certificate" | "prepare_profile" | "successful_cloud_build" | "prepare_keystore" | "connect_google_play";
16
+ platform: "android" | "ios";
17
+ title: string;
18
+ status: BuilderChecklistStatus;
19
+ at: string | undefined;
20
+ annotation: string | undefined;
21
+ annotationType: string | undefined;
22
+ }[];
23
+ } | null;
24
+ export declare function formatBuilderOnlyChecklist(appId: string, checklist: NonNullable<ReturnType<typeof getBuilderOnlyChecklist>>, options?: {
25
+ color?: boolean;
26
+ }): string;
@@ -7,12 +7,28 @@ export interface AppTodoProgress {
7
7
  export declare const TODO_BACKGROUND_WAIT_MS = 10000;
8
8
  export declare function waitForTodoBackgroundChecks(checks: readonly Promise<void>[], onCountdown?: (remainingSeconds: number) => void, timeoutMs?: number): Promise<boolean>;
9
9
  export declare function getAppTodoSteps(progress: AppTodoProgress): {
10
+ version: number;
11
+ path: "builder";
12
+ selectedPlatform: "android" | "ios" | undefined;
13
+ steps: {
14
+ id: string;
15
+ stepId: "start_setup" | "choose_destination" | "connect_app_store" | "prepare_certificate" | "prepare_profile" | "successful_cloud_build" | "prepare_keystore" | "connect_google_play";
16
+ platform: "android" | "ios";
17
+ title: string;
18
+ status: import("./builder-checklist").BuilderChecklistStatus;
19
+ at: string | undefined;
20
+ annotation: string | undefined;
21
+ annotationType: string | undefined;
22
+ }[];
23
+ } | {
10
24
  version: number;
11
25
  steps: {
12
26
  id: "login_cli_mcp" | "add_channel" | "add_updater" | "add_code" | "add_encryption" | "select_platform" | "build_project" | "run_device" | "add_code_change" | "upload_bundle" | "test_update" | "completion" | "add_app";
13
27
  title: string;
14
28
  status: "done" | "skipped" | "pending";
15
29
  }[];
30
+ path: "ota";
31
+ selectedPlatform: undefined;
16
32
  };
17
33
  export declare function formatAppTodoList(appId: string, progress: AppTodoProgress, options?: {
18
34
  color?: boolean;
@@ -1,6 +1,8 @@
1
1
  import type { BuilderProjectPrompts } from './project-selection.js';
2
2
  export interface OnboardingBuilderOptions {
3
3
  analytics?: boolean;
4
+ /** Exact app selected by a caller handing off an assigned Builder checklist. */
5
+ appId?: string;
4
6
  apikey?: string;
5
7
  platform?: string;
6
8
  supaHost?: string;
@@ -14,7 +14,7 @@ export interface BuilderAppSelectionGateProps {
14
14
  cols: number;
15
15
  rows: number;
16
16
  footer?: ReactNode;
17
- onSelected: (appId: string) => void;
17
+ onSelected: (appId: string) => void | Promise<void>;
18
18
  onSwitchKey: () => void;
19
19
  onCancel: () => void;
20
20
  onEvent?: (event: AppSelectionEvent) => void;
@@ -39,6 +39,7 @@ export interface OnboardingShellProps {
39
39
  journeyId: string;
40
40
  /** Pre-resolved platform (--platform flag or the single existing native dir); skips the picker. */
41
41
  initialPlatform?: Platform;
42
+ resolveChecklistPlatform?: (apikey: string, appId: string) => Promise<string | undefined>;
42
43
  /**
43
44
  * Set when a newer @capgo/cli is published. Drives the self-update prompt
44
45
  * shown as the FIRST wizard screen (before platform selection / auto-load).
@@ -0,0 +1,60 @@
1
+ import type { OnboardingBuilderOptions } from '../build/onboarding/command';
2
+ import { invokeCapgoCliApi } from '../utils';
3
+ type SetupOptions = {
4
+ apikey: string;
5
+ } & Pick<OnboardingBuilderOptions, 'supaHost' | 'supaAnon' | 'analytics'>;
6
+ export declare function readBuilderOnlyAssignment(appId: string, options: SetupOptions, request?: typeof invokeCapgoCliApi): Promise<{
7
+ version: number;
8
+ path: "builder";
9
+ selectedPlatform: "android" | "ios" | undefined;
10
+ steps: {
11
+ id: string;
12
+ stepId: "start_setup" | "choose_destination" | "connect_app_store" | "prepare_certificate" | "prepare_profile" | "successful_cloud_build" | "prepare_keystore" | "connect_google_play";
13
+ platform: "android" | "ios";
14
+ title: string;
15
+ status: import("../app/builder-checklist").BuilderChecklistStatus;
16
+ at: string | undefined;
17
+ annotation: string | undefined;
18
+ annotationType: string | undefined;
19
+ }[];
20
+ } | null>;
21
+ export declare function readBuilderOnlyInitAssignment(appId: string, options: SetupOptions, request?: typeof invokeCapgoCliApi, warn?: (message: string) => void): Promise<{
22
+ version: number;
23
+ path: "builder";
24
+ selectedPlatform: "android" | "ios" | undefined;
25
+ steps: {
26
+ id: string;
27
+ stepId: "start_setup" | "choose_destination" | "connect_app_store" | "prepare_certificate" | "prepare_profile" | "successful_cloud_build" | "prepare_keystore" | "connect_google_play";
28
+ platform: "android" | "ios";
29
+ title: string;
30
+ status: import("../app/builder-checklist").BuilderChecklistStatus;
31
+ at: string | undefined;
32
+ annotation: string | undefined;
33
+ annotationType: string | undefined;
34
+ }[];
35
+ } | null>;
36
+ export declare function tryBuilderOnlyInit(appId: string | undefined, options: SetupOptions, dependencies?: {
37
+ request?: typeof invokeCapgoCliApi;
38
+ warn?: (message: string) => void;
39
+ beforeLaunch?: () => Promise<void>;
40
+ launch?: (options: OnboardingBuilderOptions) => Promise<void>;
41
+ }): Promise<boolean>;
42
+ export declare function resolveBuilderChecklistPlatform(appId: string, options: SetupOptions, explicitPlatform: string | undefined, inferredPlatform: OnboardingBuilderOptions['platform'], request?: typeof invokeCapgoCliApi): Promise<{
43
+ platform: string | undefined;
44
+ checklist: {
45
+ version: number;
46
+ path: "builder";
47
+ selectedPlatform: "android" | "ios" | undefined;
48
+ steps: {
49
+ id: string;
50
+ stepId: "start_setup" | "choose_destination" | "connect_app_store" | "prepare_certificate" | "prepare_profile" | "successful_cloud_build" | "prepare_keystore" | "connect_google_play";
51
+ platform: "android" | "ios";
52
+ title: string;
53
+ status: import("../app/builder-checklist").BuilderChecklistStatus;
54
+ at: string | undefined;
55
+ annotation: string | undefined;
56
+ annotationType: string | undefined;
57
+ }[];
58
+ } | null;
59
+ }>;
60
+ export {};
@@ -111,5 +111,5 @@ export declare function getPhysicalIosRunTargets(targets: CapacitorRunTarget[]):
111
111
  export declare function getSimulatorIosRunTargets(targets: CapacitorRunTarget[]): CapacitorRunTarget[];
112
112
  export declare function resolveRunDeviceCommand(cancelHandler: RunDeviceCancelHandler, pm: PackageManagerInfo, platformName: PlatformChoice, projectDir?: string): Promise<RunDeviceStepOutcome>;
113
113
  export declare function normalizeRunDevicePlatform(platformName: string): PlatformChoice;
114
- export declare function initApp(apikeyCommand: string, appId: string, options: SuperOptions): Promise<never>;
114
+ export declare function initApp(apikeyCommand: string, appId: string, options: SuperOptions): Promise<undefined>;
115
115
  export {};
package/dist/src/sdk.js CHANGED
@@ -1,4 +1,4 @@
1
- import{createRequire as XP0}from"node:module";var module={exports:{}};var aC0=Object.create;var{getPrototypeOf:sC0,defineProperty:D3,getOwnPropertyNames:Fm}=Object;var GR=Object.prototype.hasOwnProperty;function WR($){return this[$]}var M0=($,D,Q)=>{var X=Fm(D);for(let J of X)if(!GR.call($,J)&&J!=="default")D3($,J,{get:WR.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!GR.call(Q,J)&&J!=="default")D3(Q,J,{get:WR.bind(D,J),enumerable:!0});return Q}},eC0,$P0,f$=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?eC0??=new WeakMap:$P0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?aC0(sC0($)):{};let Z=D||!$||!$.__esModule?D3(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Fm($))if(!GR.call(Z,F))D3(Z,F,{get:WR.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var j=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var DP0=($)=>$;function QP0($,D){this[$]=DP0.bind(null,D)}var ND=($,D)=>{for(var Q in D)D3($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:QP0.bind(D,Q)})};var o=($,D)=>()=>($&&(D=$($=0)),D);var X0=XP0(import.meta.url);var J6;var A8=o(()=>{J6={name:"@capgo/cli",type:"module",version:"8.86.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var J0;var V$=o(()=>{J0=class J0 extends Error{context;constructor($,D){super($);this.name="CliUserError",this.context=D}}});import{platform as YP0}from"node:os";import{version as ZP0}from"node:process";function WP0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Gm($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function qP0($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function UR($,D){if(D===void 0||D===null){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(!WP0(D)){if(qR.has($.toLowerCase()))throw new J0(qP0($));throw new J0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function t$($){let D={capgo_api:FP0,"x-cli-version":J6.version,"x-cli-command":GP0,"x-cli-node":ZP0,"x-cli-os":YP0()};if($)for(let[Q,X]of Object.entries($))D[Q]=UR(Q,X);return D}var FP0="2025-10-01",GP0="",qR;var L4=o(()=>{A8();V$();qR=new Set(["authorization","capgkey","x-capgo-log-token"])});var Wm,qm=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Um=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var Hm=o(()=>{Wm=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var UP0,HP0,Km,KP0,zm,zP0,OP0,VP0,Om=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?Om(J,VP0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,W=Q.emojiWidth??2,q=2,U=Q.regularWidth??1,H=Q.wideWidth??2,K=[[zP0,U],[UP0,0],[HP0,F],[KP0,G],[zm,W],[Km,H]],z=0,O=0,V=$.length,N=0,w=!1,M=V,L=Math.max(0,X-Y),B=0,R=0,_=0,v=0;$:while(!0){if(R>B||O>=V&&O>z){let E=$.slice(B,R)||$.slice(z,O);N=0;for(let y of E.replaceAll(OP0,"")){let x=y.codePointAt(0)||0;if(qm(x))v=2;else if(Um(x))v=H;else v=U;if(_+v>L)M=Math.min(M,Math.max(B,z)+N);if(_+v>X){w=!0;break $}N+=y.length,_+=v}B=R=0}if(O>=V)break $;for(let E=0,y=K.length;E<y;E++){let[x,d]=K[E];if(x.lastIndex=O,x.test($)){if(N=x===Km?Wm($.slice(O,x.lastIndex)):x===zm?1:x.lastIndex-O,v=N*d,_+v>L)M=Math.min(M,O+Math.floor((L-_)/d));if(_+v>X){w=!0;break $}_+=v,B=z,R=O,O=z=x.lastIndex;continue $}}O+=1}return{width:w?L:_,index:w?M:V,truncated:w,ellipsed:w&&X>=Y}},Vm;var Mm=o(()=>{Hm();UP0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,HP0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Km=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,KP0=/\t{1,1000}/y,zm=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,zP0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,OP0=/\p{M}+/gu,VP0={limit:1/0,ellipsis:""},Vm=Om});var MP0,LP0=($,D={})=>{return Vm($,MP0,D).width},D9;var HR=o(()=>{Mm();MP0={limit:1/0,ellipsis:"",ellipsisWidth:0},D9=LP0});function t5($,D,Q){return String($).normalize().split(jP0).map((X)=>RP0(X,D,Q)).join(`
1
+ import{createRequire as XP0}from"node:module";var module={exports:{}};var aC0=Object.create;var{getPrototypeOf:sC0,defineProperty:D3,getOwnPropertyNames:Fm}=Object;var GR=Object.prototype.hasOwnProperty;function WR($){return this[$]}var M0=($,D,Q)=>{var X=Fm(D);for(let J of X)if(!GR.call($,J)&&J!=="default")D3($,J,{get:WR.bind(D,J),enumerable:!0});if(Q){for(let J of X)if(!GR.call(Q,J)&&J!=="default")D3(Q,J,{get:WR.bind(D,J),enumerable:!0});return Q}},eC0,$P0,f$=($,D,Q)=>{var X=$!=null&&typeof $==="object";if(X){var J=D?eC0??=new WeakMap:$P0??=new WeakMap,Y=J.get($);if(Y)return Y}Q=$!=null?aC0(sC0($)):{};let Z=D||!$||!$.__esModule?D3(Q,"default",{value:$,enumerable:!0}):Q;for(let F of Fm($))if(!GR.call(Z,F))D3(Z,F,{get:WR.bind($,F),enumerable:!0});if(X)J.set($,Z);return Z};var j=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var DP0=($)=>$;function QP0($,D){this[$]=DP0.bind(null,D)}var ND=($,D)=>{for(var Q in D)D3($,Q,{get:D[Q],enumerable:!0,configurable:!0,set:QP0.bind(D,Q)})};var o=($,D)=>()=>($&&(D=$($=0)),D);var X0=XP0(import.meta.url);var J6;var A8=o(()=>{J6={name:"@capgo/cli",type:"module",version:"8.87.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:capgo-app-id-prompt":"bun test/test-capgo-app-id-prompt.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs && bun test/test-android-select-guard.mjs","test:android-keystore-action":"bun test/test-android-keystore-action.mjs","test:android-google-play-action":"bun test/test-android-google-play-action.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:bundle-pages":"bun test test/test-bundle-pages.test.ts","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-certificate-action":"bun test/test-ios-certificate-action.mjs","test:ios-profile-action":"bun test/test-ios-profile-action.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun scripts/run-test-suite.ts","test:run":"bun scripts/run-test-suite.ts","test:serial":"bun run build && bun scripts/run-test-suite.ts --serial","test:suite":"bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:capgo-app-id-prompt && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:android-keystore-action && bun run test:android-google-play-action && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && bun run test:settings-parity && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-app-selection && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-certificate-action && bun run test:ios-profile-action && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-app-selection":"bun test/test-builder-app-selection.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:settings-parity":"bun test/test-settings-parity.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.5.4"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@sinonjs/fake-timers":"15.4.0","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var J0;var V$=o(()=>{J0=class J0 extends Error{context;constructor($,D){super($);this.name="CliUserError",this.context=D}}});import{platform as YP0}from"node:os";import{version as ZP0}from"node:process";function WP0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function Gm($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function qP0($){if($.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if($.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function UR($,D){if(D===void 0||D===null){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(qR.has($.toLowerCase()))throw new J0(Gm($));throw new J0(`HTTP header "${$}" is missing or invalid.`)}if(!WP0(D)){if(qR.has($.toLowerCase()))throw new J0(qP0($));throw new J0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function t$($){let D={capgo_api:FP0,"x-cli-version":J6.version,"x-cli-command":GP0,"x-cli-node":ZP0,"x-cli-os":YP0()};if($)for(let[Q,X]of Object.entries($))D[Q]=UR(Q,X);return D}var FP0="2025-10-01",GP0="",qR;var L4=o(()=>{A8();V$();qR=new Set(["authorization","capgkey","x-capgo-log-token"])});var Wm,qm=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Um=($)=>{return $===8987||$===9001||$>=12272&&$<=12287||$>=12289&&$<=12350||$>=12441&&$<=12543||$>=12549&&$<=12591||$>=12593&&$<=12686||$>=12688&&$<=12771||$>=12783&&$<=12830||$>=12832&&$<=12871||$>=12880&&$<=19903||$>=65040&&$<=65049||$>=65072&&$<=65106||$>=65108&&$<=65126||$>=65128&&$<=65131||$>=127488&&$<=127490||$>=127504&&$<=127547||$>=127552&&$<=127560||$>=131072&&$<=196605||$>=196608&&$<=262141};var Hm=o(()=>{Wm=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let Q=0;$.lastIndex=0;while($.test(D))Q+=1;return D.length-Q}})()});var UP0,HP0,Km,KP0,zm,zP0,OP0,VP0,Om=($,D={},Q={})=>{let X=D.limit??1/0,J=D.ellipsis??"",Y=D?.ellipsisWidth??(J?Om(J,VP0,Q).width:0),Z=0,F=Q.controlWidth??0,G=Q.tabWidth??8,W=Q.emojiWidth??2,q=2,U=Q.regularWidth??1,H=Q.wideWidth??2,K=[[zP0,U],[UP0,0],[HP0,F],[KP0,G],[zm,W],[Km,H]],z=0,O=0,V=$.length,N=0,w=!1,M=V,L=Math.max(0,X-Y),B=0,R=0,_=0,v=0;$:while(!0){if(R>B||O>=V&&O>z){let E=$.slice(B,R)||$.slice(z,O);N=0;for(let y of E.replaceAll(OP0,"")){let x=y.codePointAt(0)||0;if(qm(x))v=2;else if(Um(x))v=H;else v=U;if(_+v>L)M=Math.min(M,Math.max(B,z)+N);if(_+v>X){w=!0;break $}N+=y.length,_+=v}B=R=0}if(O>=V)break $;for(let E=0,y=K.length;E<y;E++){let[x,d]=K[E];if(x.lastIndex=O,x.test($)){if(N=x===Km?Wm($.slice(O,x.lastIndex)):x===zm?1:x.lastIndex-O,v=N*d,_+v>L)M=Math.min(M,O+Math.floor((L-_)/d));if(_+v>X){w=!0;break $}_+=v,B=z,R=O,O=z=x.lastIndex;continue $}}O+=1}return{width:w?L:_,index:w?M:V,truncated:w,ellipsed:w&&X>=Y}},Vm;var Mm=o(()=>{Hm();UP0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,HP0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Km=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,KP0=/\t{1,1000}/y,zm=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,zP0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,OP0=/\p{M}+/gu,VP0={limit:1/0,ellipsis:""},Vm=Om});var MP0,LP0=($,D={})=>{return Vm($,MP0,D).width},D9;var HR=o(()=>{Mm();MP0={limit:1/0,ellipsis:"",ellipsisWidth:0},D9=LP0});function t5($,D,Q){return String($).normalize().split(jP0).map((X)=>RP0(X,D,Q)).join(`
2
2
  `)}var AK="\x1B",Rm="›",NP0=39,zR="\x07",jm="[",BP0="]",Em="m",OR,Lm,Nm=($)=>{if($>=30&&$<=37)return 39;if($>=90&&$<=97)return 39;if($>=40&&$<=47)return 49;if($>=100&&$<=107)return 49;if($===1||$===2)return 22;if($===3)return 23;if($===4)return 24;if($===7)return 27;if($===8)return 28;if($===9)return 29;if($===0)return 0;return},Bm=($)=>`${AK}${jm}${$}${Em}`,wm=($)=>`${AK}${OR}${$}${zR}`,KR=($,D,Q)=>{let X=D[Symbol.iterator](),J=!1,Y=!1,Z=$.at(-1),F=Z===void 0?0:D9(Z),G=X.next(),W=X.next(),q=0;while(!G.done){let U=G.value,H=D9(U);if(F+H<=Q)$[$.length-1]+=U;else $.push(U),F=0;if(U===AK||U===Rm)J=!0,Y=D.startsWith(OR,q+1);if(J){if(Y){if(U===zR)J=!1,Y=!1}else if(U===Em)J=!1}else if(F+=H,F===Q&&!W.done)$.push(""),F=0;G=W,W=X.next(),q+=U.length}if(Z=$.at(-1),!F&&Z!==void 0&&Z.length&&$.length>1)$[$.length-2]+=$.pop()},wP0=($)=>{let D=$.split(" "),Q=D.length;while(Q){if(D9(D[Q-1]))break;Q--}if(Q===D.length)return $;return D.slice(0,Q).join(" ")+D.slice(Q).join("")},RP0=($,D,Q={})=>{if(Q.trim!==!1&&$.trim()==="")return"";let X="",J,Y,Z=$.split(" "),F=[""],G=0;for(let U=0;U<Z.length;U++){let H=Z[U];if(Q.trim!==!1){let z=F.at(-1)??"",O=z.trimStart();if(z.length!==O.length)F[F.length-1]=O,G=D9(O)}if(U!==0){if(G>=D&&(Q.wordWrap===!1||Q.trim===!1))F.push(""),G=0;if(G||Q.trim===!1)F[F.length-1]+=" ",G++}let K=D9(H);if(Q.hard&&K>D){let z=D-G,O=1+Math.floor((K-z-1)/D);if(Math.floor((K-1)/D)<O)F.push("");KR(F,H,D),G=D9(F.at(-1)??"");continue}if(G+K>D&&G&&K){if(Q.wordWrap===!1&&G<D){KR(F,H,D),G=D9(F.at(-1)??"");continue}F.push(""),G=0}if(G+K>D&&Q.wordWrap===!1){KR(F,H,D),G=D9(F.at(-1)??"");continue}F[F.length-1]+=H,G+=K}if(Q.trim!==!1)F=F.map((U)=>wP0(U));let W=F.join(`
3
3
  `),q=!1;for(let U=0;U<W.length;U++){let H=W[U];if(X+=H,!q){if(q=H>="\uD800"&&H<="\uDBFF",q)continue}else q=!1;if(H===AK||H===Rm){Lm.lastIndex=U+1;let z=Lm.exec(W)?.groups;if(z?.code!==void 0){let O=Number.parseFloat(z.code);J=O===NP0?void 0:O}else if(z?.uri!==void 0)Y=z.uri.length===0?void 0:z.uri}if(W[U+1]===`
4
4
  `){if(Y)X+=wm("");let K=J?Nm(J):void 0;if(J&&K)X+=Bm(K)}else if(H===`