@capgo/cli 8.90.2 → 8.91.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/src/sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as EA0}from"node:module";var module={exports:{}};var KA0=Object.create;var{getPrototypeOf:HA0,defineProperty:kB,getOwnPropertyNames:OA0}=Object;var zA0=Object.prototype.hasOwnProperty;function VA0($){return this[$]}var LA0,NA0,r$=($,D,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var X=D?LA0??=new WeakMap:NA0??=new WeakMap,Y=X.get($);if(Y)return Y}J=$!=null?KA0(HA0($)):{};let F=D||!$||!$.__esModule?kB(J,"default",{value:$,enumerable:!0}):J;for(let Z of OA0($))if(!zA0.call(F,Z))kB(F,Z,{get:VA0.bind($,Z),enumerable:!0});if(Q)X.set($,F);return F};var R=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var MA0=($)=>$;function BA0($,D){this[$]=MA0.bind(null,D)}var tD=($,D)=>{for(var J in D)kB($,J,{get:D[J],enumerable:!0,configurable:!0,set:BA0.bind(D,J)})};var r=($,D)=>()=>($&&(D=$($=0)),D);var J0=EA0(import.meta.url);var r1;var G8=r(()=>{r1={name:"@capgo/cli",type:"module",version:"8.90.2",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",typecheck:"tsc --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:bundle-soft-delete":"bun test/test-bundle-soft-delete.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:api-perf":"bun test/test-api-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-host-fields":"bun test/test-mcp-host-fields.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":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.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-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 && bun test/test-auth-session-bad-key.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 && bun test/test-build-env.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: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-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:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && 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-host-fields && 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 && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && 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:support && 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: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-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:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","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-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":"bun test/test-support.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","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: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","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.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","@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":"npm:typescript@7.1.0-beta","@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 Q0;var W$=r(()=>{Q0=class Q0 extends Error{context;constructor($,D,J){super($,J!==void 0?{cause:J}:void 0);this.name="CliUserError",this.context=D}}});import{platform as RA0}from"node:os";import{version as AA0}from"node:process";function IA0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function qh($){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 PA0($){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 configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function uB($,D){if(D===void 0||D===null){if(xB.has($.toLowerCase()))throw new Q0(qh($));throw new Q0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(xB.has($.toLowerCase()))throw new Q0(qh($));throw new Q0(`HTTP header "${$}" is missing or invalid.`)}if(!IA0(D)){if(xB.has($.toLowerCase()))throw new Q0(PA0($));throw new Q0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function n$($){let D={capgo_api:jA0,"x-cli-version":r1.version,"x-cli-command":TA0,"x-cli-node":AA0,"x-cli-os":RA0()};if($)for(let[J,Q]of Object.entries($))D[J]=uB(J,Q);return D}var jA0="2025-10-01",TA0="",xB;var J4=r(()=>{G8();W$();xB=new Set(["authorization","capgkey","x-capgo-log-token"])});var Wh,Kh=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Hh=($)=>{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 Oh=r(()=>{Wh=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let J=0;$.lastIndex=0;while($.test(D))J+=1;return D.length-J}})()});var SA0,CA0,zh,_A0,Vh,vA0,kA0,xA0,Lh=($,D={},J={})=>{let Q=D.limit??1/0,X=D.ellipsis??"",Y=D?.ellipsisWidth??(X?Lh(X,xA0,J).width:0),F=0,Z=J.controlWidth??0,U=J.tabWidth??8,G=J.emojiWidth??2,q=2,W=J.regularWidth??1,K=J.wideWidth??2,H=[[vA0,W],[SA0,0],[CA0,Z],[_A0,U],[Vh,G],[zh,K]],O=0,z=0,V=$.length,B=0,E=!1,L=V,N=Math.max(0,Q-Y),M=0,w=0,v=0,_=0;$:while(!0){if(w>M||z>=V&&z>O){let A=$.slice(M,w)||$.slice(O,z);B=0;for(let x of A.replaceAll(kA0,"")){let k=x.codePointAt(0)||0;if(Kh(k))_=2;else if(Hh(k))_=K;else _=W;if(v+_>N)L=Math.min(L,Math.max(M,O)+B);if(v+_>Q){E=!0;break $}B+=x.length,v+=_}M=w=0}if(z>=V)break $;for(let A=0,x=H.length;A<x;A++){let[k,c]=H[A];if(k.lastIndex=z,k.test($)){if(B=k===zh?Wh($.slice(z,k.lastIndex)):k===Vh?1:k.lastIndex-z,_=B*c,v+_>N)L=Math.min(L,z+Math.floor((N-v)/c));if(v+_>Q){E=!0;break $}v+=_,M=O,w=z,z=O=k.lastIndex;continue $}}z+=1}return{width:E?N:v,index:E?L:V,truncated:E,ellipsed:E&&Q>=Y}},Nh;var Mh=r(()=>{Oh();SA0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,CA0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,zh=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,_A0=/\t{1,1000}/y,Vh=/[\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,vA0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,kA0=/\p{M}+/gu,xA0={limit:1/0,ellipsis:""},Nh=Lh});var uA0,fA0=($,D={})=>{return Nh($,uA0,D).width},y8;var fB=r(()=>{Mh();uA0={limit:1/0,ellipsis:"",ellipsisWidth:0},y8=fA0});function j5($,D,J){return String($).normalize().split(mA0).map((Q)=>gA0(Q,D,J)).join(`
|
|
1
|
+
import{createRequire as EA0}from"node:module";var module={exports:{}};var KA0=Object.create;var{getPrototypeOf:HA0,defineProperty:kB,getOwnPropertyNames:OA0}=Object;var zA0=Object.prototype.hasOwnProperty;function VA0($){return this[$]}var LA0,NA0,r$=($,D,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var X=D?LA0??=new WeakMap:NA0??=new WeakMap,Y=X.get($);if(Y)return Y}J=$!=null?KA0(HA0($)):{};let F=D||!$||!$.__esModule?kB(J,"default",{value:$,enumerable:!0}):J;for(let Z of OA0($))if(!zA0.call(F,Z))kB(F,Z,{get:VA0.bind($,Z),enumerable:!0});if(Q)X.set($,F);return F};var R=($,D)=>()=>(D||$((D={exports:{}}).exports,D),D.exports);var MA0=($)=>$;function BA0($,D){this[$]=MA0.bind(null,D)}var tD=($,D)=>{for(var J in D)kB($,J,{get:D[J],enumerable:!0,configurable:!0,set:BA0.bind(D,J)})};var r=($,D)=>()=>($&&(D=$($=0)),D);var J0=EA0(import.meta.url);var r1;var G8=r(()=>{r1={name:"@capgo/cli",type:"module",version:"8.91.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",typecheck:"tsc --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:bundle-soft-delete":"bun test/test-bundle-soft-delete.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:api-perf":"bun test/test-api-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-host-fields":"bun test/test-mcp-host-fields.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":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.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-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 && bun test/test-auth-session-bad-key.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 && bun test/test-build-env.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: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-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:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && 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-host-fields && 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 && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && 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:support && 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: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-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:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","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-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":"bun test/test-support.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","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: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","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.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","@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":"npm:typescript@7.1.0-beta","@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 Q0;var W$=r(()=>{Q0=class Q0 extends Error{context;constructor($,D,J){super($,J!==void 0?{cause:J}:void 0);this.name="CliUserError",this.context=D}}});import{platform as RA0}from"node:os";import{version as AA0}from"node:process";function IA0($){for(let D=0;D<$.length;D++)if($.charCodeAt(D)>255)return!1;return!0}function qh($){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 PA0($){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 configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function uB($,D){if(D===void 0||D===null){if(xB.has($.toLowerCase()))throw new Q0(qh($));throw new Q0(`HTTP header "${$}" is missing or invalid.`)}if(typeof D!=="string"){if(xB.has($.toLowerCase()))throw new Q0(qh($));throw new Q0(`HTTP header "${$}" is missing or invalid.`)}if(!IA0(D)){if(xB.has($.toLowerCase()))throw new Q0(PA0($));throw new Q0(`HTTP header "${$}" contains invalid characters (only ASCII is allowed).`)}return D}function n$($){let D={capgo_api:jA0,"x-cli-version":r1.version,"x-cli-command":TA0,"x-cli-node":AA0,"x-cli-os":RA0()};if($)for(let[J,Q]of Object.entries($))D[J]=uB(J,Q);return D}var jA0="2025-10-01",TA0="",xB;var J4=r(()=>{G8();W$();xB=new Set(["authorization","capgkey","x-capgo-log-token"])});var Wh,Kh=($)=>{return $===12288||$>=65281&&$<=65376||$>=65504&&$<=65510},Hh=($)=>{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 Oh=r(()=>{Wh=(()=>{let $=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return(D)=>{let J=0;$.lastIndex=0;while($.test(D))J+=1;return D.length-J}})()});var SA0,CA0,zh,_A0,Vh,vA0,kA0,xA0,Lh=($,D={},J={})=>{let Q=D.limit??1/0,X=D.ellipsis??"",Y=D?.ellipsisWidth??(X?Lh(X,xA0,J).width:0),F=0,Z=J.controlWidth??0,U=J.tabWidth??8,G=J.emojiWidth??2,q=2,W=J.regularWidth??1,K=J.wideWidth??2,H=[[vA0,W],[SA0,0],[CA0,Z],[_A0,U],[Vh,G],[zh,K]],O=0,z=0,V=$.length,B=0,E=!1,L=V,N=Math.max(0,Q-Y),M=0,w=0,v=0,_=0;$:while(!0){if(w>M||z>=V&&z>O){let A=$.slice(M,w)||$.slice(O,z);B=0;for(let x of A.replaceAll(kA0,"")){let k=x.codePointAt(0)||0;if(Kh(k))_=2;else if(Hh(k))_=K;else _=W;if(v+_>N)L=Math.min(L,Math.max(M,O)+B);if(v+_>Q){E=!0;break $}B+=x.length,v+=_}M=w=0}if(z>=V)break $;for(let A=0,x=H.length;A<x;A++){let[k,c]=H[A];if(k.lastIndex=z,k.test($)){if(B=k===zh?Wh($.slice(z,k.lastIndex)):k===Vh?1:k.lastIndex-z,_=B*c,v+_>N)L=Math.min(L,z+Math.floor((N-v)/c));if(v+_>Q){E=!0;break $}v+=_,M=O,w=z,z=O=k.lastIndex;continue $}}z+=1}return{width:E?N:v,index:E?L:V,truncated:E,ellipsed:E&&Q>=Y}},Nh;var Mh=r(()=>{Oh();SA0=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,CA0=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,zh=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,_A0=/\t{1,1000}/y,Vh=/[\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,vA0=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,kA0=/\p{M}+/gu,xA0={limit:1/0,ellipsis:""},Nh=Lh});var uA0,fA0=($,D={})=>{return Nh($,uA0,D).width},y8;var fB=r(()=>{Mh();uA0={limit:1/0,ellipsis:"",ellipsisWidth:0},y8=fA0});function j5($,D,J){return String($).normalize().split(mA0).map((Q)=>gA0(Q,D,J)).join(`
|
|
2
2
|
`)}var OK="\x1B",Ah="",yA0=39,bB="\x07",jh="[",bA0="]",Th="m",hB,Bh,Eh=($)=>{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},wh=($)=>`${OK}${jh}${$}${Th}`,Rh=($)=>`${OK}${hB}${$}${bB}`,yB=($,D,J)=>{let Q=D[Symbol.iterator](),X=!1,Y=!1,F=$.at(-1),Z=F===void 0?0:y8(F),U=Q.next(),G=Q.next(),q=0;while(!U.done){let W=U.value,K=y8(W);if(Z+K<=J)$[$.length-1]+=W;else $.push(W),Z=0;if(W===OK||W===Ah)X=!0,Y=D.startsWith(hB,q+1);if(X){if(Y){if(W===bB)X=!1,Y=!1}else if(W===Th)X=!1}else if(Z+=K,Z===J&&!G.done)$.push(""),Z=0;U=G,G=Q.next(),q+=W.length}if(F=$.at(-1),!Z&&F!==void 0&&F.length&&$.length>1)$[$.length-2]+=$.pop()},hA0=($)=>{let D=$.split(" "),J=D.length;while(J){if(y8(D[J-1]))break;J--}if(J===D.length)return $;return D.slice(0,J).join(" ")+D.slice(J).join("")},gA0=($,D,J={})=>{if(J.trim!==!1&&$.trim()==="")return"";let Q="",X,Y,F=$.split(" "),Z=[""],U=0;for(let W=0;W<F.length;W++){let K=F[W];if(J.trim!==!1){let O=Z.at(-1)??"",z=O.trimStart();if(O.length!==z.length)Z[Z.length-1]=z,U=y8(z)}if(W!==0){if(U>=D&&(J.wordWrap===!1||J.trim===!1))Z.push(""),U=0;if(U||J.trim===!1)Z[Z.length-1]+=" ",U++}let H=y8(K);if(J.hard&&H>D){let O=D-U,z=1+Math.floor((H-O-1)/D);if(Math.floor((H-1)/D)<z)Z.push("");yB(Z,K,D),U=y8(Z.at(-1)??"");continue}if(U+H>D&&U&&H){if(J.wordWrap===!1&&U<D){yB(Z,K,D),U=y8(Z.at(-1)??"");continue}Z.push(""),U=0}if(U+H>D&&J.wordWrap===!1){yB(Z,K,D),U=y8(Z.at(-1)??"");continue}Z[Z.length-1]+=K,U+=H}if(J.trim!==!1)Z=Z.map((W)=>hA0(W));let G=Z.join(`
|
|
3
3
|
`),q=!1;for(let W=0;W<G.length;W++){let K=G[W];if(Q+=K,!q){if(q=K>="\uD800"&&K<="\uDBFF",q)continue}else q=!1;if(K===OK||K===Ah){Bh.lastIndex=W+1;let O=Bh.exec(G)?.groups;if(O?.code!==void 0){let z=Number.parseFloat(O.code);X=z===yA0?void 0:z}else if(O?.uri!==void 0)Y=O.uri.length===0?void 0:O.uri}if(G[W+1]===`
|
|
4
4
|
`){if(Y)Q+=Rh("");let H=X?Eh(X):void 0;if(X&&H)Q+=wh(H)}else if(K===`
|
|
@@ -675,7 +675,7 @@ PS: You can ignore this check with "--ignore-checksum-check"`),Error("Cannot upl
|
|
|
675
675
|
`);W=S}let x=Math.floor((W?.byteLength??0)/1024/1024),k=Math.floor(Y/1024/1024);if(W?.byteLength>Y)J$(`The bundle size is ${x} Mb, this is greater than the maximum upload length ${k} Mb, please reduce the size of your bundle`);else if(W?.byteLength>F)if(!NT$(D)){if(D.verbose)p.info("[Verbose] Skipping 'App Too Large' event (zip is not sent)")}else{if(p.warn(`WARNING !!
|
|
676
676
|
The bundle size is ${x} Mb, this may take a while to download for users
|
|
677
677
|
`),p.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
678
|
-
`),D.verbose)p.info("[Verbose] Bundle size details:"),p.info(` - Actual size: ${x} MB (${W?.byteLength} bytes)`),p.info(` - Alert threshold: ${Math.floor(F/1024/1024)} MB`),p.info(` - Maximum allowed: ${k} MB`),p.info("[Verbose] Sending 'App Too Large' event to analytics...");if(await a0(J,{channel:"app-error",event:"App Too Large",org_id:Q,tracking_version:2,tags:{"app-id":X,size_mb:x}},D.verbose),D.verbose)p.info("[Verbose] Event sent successfully")}else if(D.verbose)p.info(`[Verbose] Bundle size OK: ${x} MB (under ${Math.floor(F/1024/1024)} MB alert threshold)`);if(D.verbose)p.info("[Verbose] Bundle preparation complete, returning bundle data");return{zipped:W,ivSessionKey:U,sessionKey:G,checksum:q,encryptionMethod:K,finalKeyData:H,keyId:O}}async function wT$($,D,J,Q,X,Y,F,Z){let U=d1().spinner();U.start("Uploading Bundle");let G=performance.now(),q=!1;if(F.verbose)p.info("[Verbose] uploadBundleToCapgoCloud called:"),p.info(` - Bundle size: ${Math.floor(Y.byteLength/1024)} KB`),p.info(` - App ID: ${J}`),p.info(` - Bundle version: ${Q}`),p.info(` - Chunk size: ${Math.floor(Z/1024/1024)} MB`);if(F.dryUpload){if(U.stop(`Dry run, bundle not uploaded
|
|
678
|
+
`),D.verbose)p.info("[Verbose] Bundle size details:"),p.info(` - Actual size: ${x} MB (${W?.byteLength} bytes)`),p.info(` - Alert threshold: ${Math.floor(F/1024/1024)} MB`),p.info(` - Maximum allowed: ${k} MB`),p.info("[Verbose] Sending 'App Too Large' event to analytics...");if(await a0(J,{channel:"app-error",event:"App Too Large",org_id:Q,tracking_version:2,tags:{"app-id":X,size_mb:x,recommended_size_mb:Math.floor(F/1024/1024)}},D.verbose),D.verbose)p.info("[Verbose] Event sent successfully")}else if(D.verbose)p.info(`[Verbose] Bundle size OK: ${x} MB (under ${Math.floor(F/1024/1024)} MB alert threshold)`);if(D.verbose)p.info("[Verbose] Bundle preparation complete, returning bundle data");return{zipped:W,ivSessionKey:U,sessionKey:G,checksum:q,encryptionMethod:K,finalKeyData:H,keyId:O}}async function wT$($,D,J,Q,X,Y,F,Z){let U=d1().spinner();U.start("Uploading Bundle");let G=performance.now(),q=!1;if(F.verbose)p.info("[Verbose] uploadBundleToCapgoCloud called:"),p.info(` - Bundle size: ${Math.floor(Y.byteLength/1024)} KB`),p.info(` - App ID: ${J}`),p.info(` - Bundle version: ${Q}`),p.info(` - Chunk size: ${Math.floor(Z/1024/1024)} MB`);if(F.dryUpload){if(U.stop(`Dry run, bundle not uploaded
|
|
679
679
|
Bundle uploaded \uD83D\uDCAA in 0 seconds`),F.verbose)p.info("[Verbose] Dry upload mode - skipping actual upload");return}try{let H=await Y4();if(F.verbose)p.info("[Verbose] Local config retrieved for upload");if(F.multipart!==void 0&&F.multipart||F.tus!==void 0&&F.tus){if(F.multipart)p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead");else p.info("Uploading bundle with TUS protocol");if(F.verbose)p.info("[Verbose] Starting TUS resumable upload..."),p.info(` - Host: ${H.hostWeb}`),p.info(` - Chunk size: ${Math.floor(Z/1024/1024)} MB`);if(await tY0($,Y,X,J,Q,U,H,Z),q=!0,F.verbose)p.info("[Verbose] TUS upload completed, updating database with R2 path...");let O=`orgs/${X}/apps/${J}/${Q}.zip`;try{await dV($,{app_id:J,name:Q,r2_path:O},{apikey:$,apiHost:F.apiHost})}catch(z){if(p.error(`Cannot finish TUS upload ${Z0(z)}`),F.verbose)p.info(`[Verbose] Bundle record update failed: ${Z0(z)}`);throw Error("Cannot finish TUS upload")}if(F.verbose)p.info(`[Verbose] Bundle record updated with R2 path: ${O}`)}else{if(F.verbose)p.info("[Verbose] Using standard upload (non-TUS), getting presigned URL...");let O=await rY0($,J,Q,F);if(!O){if(p.error("Cannot get upload url"),F.verbose)p.info("[Verbose] Failed to retrieve presigned upload URL from database");throw Error("Cannot get upload url")}let z=F.timeout||fY0;if(F.verbose)p.info("[Verbose] Presigned URL obtained, uploading via HTTP PUT..."),p.info(` - Timeout: ${z}ms`),p.info(" - Retry attempts: 0 (standard upload does not retry, use --tus for resumable retries)"),p.info(" - Content-Type: application/zip");let V=new AbortController,B=setTimeout(()=>V.abort(),z);try{let E=await fetch(O,{method:"PUT",body:Y,headers:{"Content-Type":"application/zip"},signal:V.signal});if(!E.ok)throw Error(`HTTP error! status: ${E.status}`)}catch(E){if(V.signal.aborted||E?.name==="AbortError"){let L=Error(yY0(z));throw L.name=Xk,L}throw E}finally{clearTimeout(B)}if(F.verbose)p.info("[Verbose] HTTP PUT upload completed successfully")}}catch(H){let z=((performance.now()-G)/1000).toFixed(2);if(U.error(`Failed to upload bundle ( after ${z} seconds)`),F.verbose)p.info(`[Verbose] Upload failed after ${z} seconds`),p.info(`[Verbose] Error type: ${H instanceof Error?"Error":typeof H}`);if(H instanceof Error&&H.name===Xk)p.error(H.message);else if(H instanceof Error&&H.message.includes("HTTP error"))try{let V=H.message.match(/status: (\d+)/),B=V?V[1]:"unknown";p.error(`Upload failed with status ${B}: ${H.message}`)}catch{p.error(`Upload failed: ${H.message}`)}else{if(F.verbose)p.info(`[Verbose] Non-HTTP error: ${Z0(H)}`);if(!F.tus)p.error(`Cannot upload bundle ( try again with --tus option) ${Z0(H)}`);else p.error(`Cannot upload bundle please contact support if the issue persists ${Z0(H)}`)}if(F.verbose)p.info("[Verbose] Cleaning up failed version from database...");try{if(await PF($,J,Q,F),F.verbose)p.info("[Verbose] Failed version cleaned up")}catch(V){p.error(`Cleanup of the incomplete version failed (${Z0(V)}); delete bundle ${Q} manually before retrying.`)}throw H instanceof Error?H:Error(String(H))}let K=((performance.now()-G)/1000).toFixed(2);if(U.stop(`Bundle uploaded \uD83D\uDCAA in (${K} seconds)`),F.verbose)p.info("[Verbose] Upload successful:"),p.info(` - Upload time: ${K} seconds`),p.info(` - Upload method: ${q?"TUS (resumable)":"Standard HTTP PUT"}`),p.info(` - Bundle size: ${Math.floor(Y.byteLength/1024)} KB`),p.info("[Verbose] Sending performance event...");if(await a0($,{channel:"performance",event:q?"TUS upload zip performance":"Upload zip performance",org_id:X,tracking_version:2,tags:{"app-id":J,time:K}},F.verbose),F.verbose)p.info("[Verbose] Performance event sent successfully")}function RT$($){if($.rollout==null&&$.rolloutPercentageBps==null)return;if($.rolloutPercentageBps!=null)return $.rolloutPercentageBps;return Math.round(($.rollout??0)*100)}function tw0($){return`${Number(($/100).toFixed(2))}%`}async function DR0($,D,J,Q){let X=await Xq($,D,J,{...Q,includeDeleted:!0});if(!X?.id)J$("Cannot get version id, cannot set channel");return X.id}async function AT$($,D,J,Q){return!!await Xq($,D,J,{...Q,includeDeleted:!0})}async function jT$($,D,J){try{return(await gV({apikey:$,apiHost:J?.apiHost},D))?.name??null}catch(Q){return p.warn(`Cannot fetch latest remote version ${Z0(Q)}`),null}}async function aw0($,D,J,Q,X,Y){let F=J;for(let Z=0;Z<100;Z++){if(!await AT$($,D,F,Y)){if(F!==X)p.info(`\uD83D\uDD22 Auto-bumped (${Q}) version from ${X} to ${F}`);return F}F=OB(F,Q)}J$(`Could not find a free ${Q}-bumped version after 100 attempts (started from ${X})`)}async function TT$($,D,J,Q,X,Y){let F=J[0],U=(await JR0($,D,F,Y))?.name??null;if(U)p.info(`\uD83D\uDCE6 Auto-bump base from channel ${F}: ${U}`);else if(U=await jT$($,D,Y),U)p.info(`\uD83D\uDCE6 Auto-bump base from latest remote app version: ${U}`);if(!U)return p.info(`ℹ️ No remote versions found for auto-bump, keeping local version ${Q}`),aw0($,D,Q,X,Q,Y);let G=OB(U,X);return aw0($,D,G,X,U,Y)}async function JR0($,D,J,Q){let X=new URLSearchParams({app_id:D,channel:J,page:"0"}),{data:Y,error:F}=await S0(`channel?${X.toString()}`,{apikey:$,method:"GET",body:void 0,apiHost:Q?.apiHost});if(F)return p.error(`Cannot delete linked bundle on upload ${Z0(F)}`),null;let U=(Array.isArray(Y)?Y[0]:Y)?.version;if(!U?.id||!U.name)return p.warn("No linked bundle found in the channel you are trying to upload to"),null;if(U.deleted)return p.warn("The linked bundle is already deleted"),null;return{id:U.id,name:U.name,deleted:U.deleted??!1}}async function IT$($,D,J,Q){if(!D)return;let{error:X}=await S0("bundle",{apikey:$,method:"DELETE",body:{app_id:J,version:D.name},apiHost:Q?.apiHost});if(X){p.error(`Cannot delete linked bundle on upload ${Z0(X)}`);return}p.info(`Linked bundle ${D.name} deleted`)}async function ib($,D,J,Q=!0,X){let Y;try{Y=await G9({apikey:$,apiHost:X?.apiHost},D,J)}catch(U){if(Q)J$(`Cannot check channel ${J}: ${Z0(U)}`);return null}let F=Y.find((U)=>U.name===J);if(!F?.id)return null;let Z=F.version??null;return{id:F.id,public:F.public??!1,version:Z,rollout_version:F.rollout_version??null,rollout_enabled:F.rollout_enabled??!1,rollout_percentage_bps:F.rollout_percentage_bps??null}}async function PT$($,D,J,Q,X=!1,Y,F=!1,Z){let U=new Map,G=Y!=null||F;for(let q of new Set(Q)){let W=await ib(D,J,q,!0,Z);if(W){if(U.set(q,W),!await A6($,D,"channel.promote_bundle",{appId:J,channelId:W.id}))J$("Cannot set channel because this API key lacks channel.promote_bundle for the target channel");if(X||G){if(!await A6($,D,"channel.update_settings",{appId:J,channelId:W.id}))J$(X?"Cannot enable device self-assign because this API key lacks channel.update_settings":"Cannot set rollout because this API key lacks channel.update_settings for the target channel")}if(G&&!W.version)J$(`Cannot set rollout, channel ${q} needs a stable bundle before using progressive rollout`);if(F&&W.rollout_version==null)J$(`Cannot advance rollout, channel ${q} has no rollout target to promote to stable`);if(F&&Y==null&&!((W.rollout_percentage_bps??0)>0))J$(`Cannot advance rollout, channel ${q} has no rollout percentage to reuse. Pass --rollout or --rollout-percentage-bps`);continue}if(G)J$(`Cannot set rollout, channel ${q} must already exist with a stable bundle`);if(!await A6($,D,"app.create_channel",{appId:J}))J$("Cannot create target channel because this API key lacks app.create_channel");U.set(q,null)}return U}async function pb($){let D=$?.context;if(D?.json)try{return JSON.stringify(await D.json())}catch{}return Z0($)}async function sw0($,D,J,Q,X,Y,F){let{error:Z}=await S0("bundle",{apikey:$,method:"PUT",body:{app_id:D,version_id:J,channel_id:Q.id},apiHost:F?.apiHost});if(Z)await wB(Z,async()=>`Cannot set channel because this API key does not have the required RBAC permission. ${await pb(Z)}`);let U=`${X.hostWeb}/app/${D}/channel/${Q.id}`;if(Q.rollout_enabled&&Q.rollout_version!=null)p.warn("This channel has an active progressive rollout. Linking this bundle as the stable version resets that rollout, so devices receive the new bundle instead of the previous rollout target.");else if(Q.public)p.info("Your update is now available in your public channel \uD83C\uDF89");else p.info(`Link device to this bundle to try it: ${U}`);if(Y)p.info(`Bundle url: ${U}`);return!0}async function ST$($,D,J,Q,X,Y,F,Z,U,G,q=!1,W,K){let H=G!==null&&await A6($,D,"channel.promote_bundle",{appId:Z,channelId:G.id}),O=G===null&&await A6($,D,"app.create_channel",{appId:Z});if(G&&!H){if(q)J$("Cannot set channel because this API key lacks channel.promote_bundle for the target channel");return p.warn("Cannot set channel because this API key lacks channel.promote_bundle for the target channel"),!1}if(G&&H){let V=await DR0(D,Z,Q,K);if(W){if(!await A6($,D,"channel.update_settings",{appId:Z,channelId:G.id}))return p.warn("Cannot enable device self-assign because this API key lacks channel.update_settings"),sw0(D,Z,V,G,U,J,K)}if(!W)return sw0(D,Z,V,G,U,J,K);let{error:B,data:E}=await S0("channel",{apikey:D,method:"POST",body:{app_id:Z,channel:X,version:Q,allow_device_self_set:!0},apiHost:K?.apiHost});if(B)await wB(B,()=>`Cannot set channel because this API key does not have the required RBAC permission. ${Z0(B)}`);let L=Number(E?.id??G.id);if(Number.isSafeInteger(L)){let N=`${U.hostWeb}/app/${Z}/channel/${L}`;if(G.rollout_enabled&&G.rollout_version!=null)p.warn("This channel has an active progressive rollout. Linking this bundle as the stable version resets that rollout, so devices receive the new bundle instead of the previous rollout target.");else if(E?.public??G.public)p.info("Your update is now available in your public channel \uD83C\uDF89");else p.info(`Link device to this bundle to try it: ${N}`);if(J)p.info(`Bundle url: ${N}`)}return!0}if(O){let{error:V,data:B}=await S0("channel",{apikey:D,method:"POST",body:{app_id:Z,channel:X,version:Q,...W?{allow_device_self_set:!0}:{}},apiHost:K?.apiHost});if(V)await wB(V,async()=>`Cannot create channel and set its bundle because this API key does not have the required RBAC permission. ${await pb(V)}`);let E=B,L=Number(E?.id),N=E?.public===!0;if(!Number.isSafeInteger(L)||typeof E?.public!=="boolean"){let w=await ib(D,Z,X,!1,K),v=Number(w?.id);if(!Number.isSafeInteger(v)){if(!Number.isSafeInteger(L))return p.info("Your update is now available \uD83C\uDF89"),!0}else L=v,N=w?.public===!0}let M=`${U.hostWeb}/app/${Z}/channel/${L}`;if(N)p.info("Your update is now available in your public channel \uD83C\uDF89");else p.info(`Link device to this bundle to try it: ${M}`);if(J)p.info(`Bundle url: ${M}`);return!0}let z="Cannot create target channel because this API key lacks app.create_channel";if(q)J$(z);return p.warn(z),!1}async function CT$($,D,J,Q,X,Y,F,Z,U,G,q,W,K=!1){if(!Z)J$(`Cannot set rollout, channel ${X} must already exist with a stable bundle`);if(!Z.version)J$(`Cannot set rollout, channel ${X} needs a stable bundle before using progressive rollout`);if(K&&Z.rollout_version==null)J$(`Cannot advance rollout, channel ${X} has no rollout target to promote to stable`);let H=await DR0(D,Y,Q,W),[O,z]=await Promise.all([A6($,D,"channel.promote_bundle",{appId:Y,channelId:Z.id}),A6($,D,"channel.update_settings",{appId:Y,channelId:Z.id})]);if(!O)J$("Cannot set rollout because this API key lacks channel.promote_bundle for the target channel");if(!z)J$("Cannot set rollout because this API key lacks channel.update_settings for the target channel");let V=Z.rollout_version===H&&U>0,{error:B}=await S0("channel",{apikey:D,method:"POST",body:{app_id:Y,channel:X,rolloutVersion:Q,rolloutPercentageBps:U,rolloutEnabled:U>0,...K?{advanceRollout:!0}:{},...V?{rolloutPaused:!1}:{},...G!=null?{rolloutCacheTtlSeconds:G}:{},...q?{allow_device_self_set:!0}:{}},apiHost:W?.apiHost});if(B)await wB(B,async()=>`Cannot set rollout in channel ${await pb(B)}`);let E=`${F.hostWeb}/app/${Y}/channel/${Z.id}`;if(K)p.info(`Promoted the previous rollout to stable on ${X} and set @${Q} as the new rollout target (${tw0(U)})`);else p.info(`Set ${Y} channel ${X} rollout target to @${Q} (${tw0(U)})`);if(J)p.info(`Bundle url: ${E}`);return!0}async function _T$($,D,J,Q){let{error:X,data:Y}=await S0(`app/${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:Q?.apiHost});if(X||!Y?.default_upload_channel)throw Error(`Cannot find default upload channel: ${Z0(X)}. You can set it here: ${J}/app/${$}/info`);return Y.default_upload_channel}async function rb($,D,J=!1,Q){return xn(Q,()=>vT$($,D,J))}async function vT$($,D,J){if(!J)d1().intro(`Uploading with CLI version ${r1.version}`);let Q,X=BQ(),Y=LT$(D);if(await a$(d1()),D.verbose)p.info("[Verbose] Starting upload process with options:"),p.info(` - API key: ${D.apikey?"provided":"from saved key"}`),p.info(` - Path: ${D.path||"from capacitor config"}`),p.info(` - Channel: ${D.channel||"from default upload channel"}`),p.info(` - Bundle: ${D.bundle||"auto-detected"}`),p.info(` - External: ${D.external||"false"}`),p.info(` - Encryption: ${D.keyV2||D.keyDataV2?"v2":D.key===!1?"disabled":"auto"}`),p.info(` - Upload method: ${D.tus?"TUS":D.zip?"ZIP":"auto"}`),p.info(` - Delta updates: ${D.delta||D.partial?"enabled":"disabled"}`);let F=UT$(D);if(D.verbose)p.info("[Verbose] API key retrieved successfully");let Z=await rw0(D,{appId:$});if(D.verbose)p.info(k9(D.mode)?`[Verbose] Cordova project config resolved (webDir: ${Z.config.webDir})`:"[Verbose] Capacitor config loaded successfully");D.userRequestedDelta??=!!(D.partial||D.delta||D.partialOnly||D.deltaOnly);let U=WE0(Z?.config?.plugins?.CapacitorUpdater),G=mD({silent:J});if(U&&D.delta===void 0){if(G){p.info("\uD83D\uDCA1 Instant updates are enabled in your config"),p.info(" Delta updates send only changed files instead of the full bundle");let V0=await C$({message:"Enable delta updates for this upload? (Recommended with instant updates)",initialValue:!0});if(!n0(V0)&&V0){if(D.delta=!0,D.verbose)p.info("[Verbose] Delta updates auto-enabled due to instant update configuration")}}else if(!J){if(D.delta!==!1){if(D.delta=!0,D.verbose)p.info("[Verbose] Delta updates auto-enabled in CI/CD mode due to instant update configuration")}}}let q=await nY0(F);if(D.verbose)p.info("[Verbose] Remote file config retrieved:"),p.info(` - Max upload length: ${Math.floor(q.maxUploadLength/1024/1024)} MB`),p.info(` - Alert upload size: ${Math.floor(q.alertUploadSize/1024/1024)} MB`),p.info(` - TUS upload: ${q.TUSUpload?"enabled":"disabled"}`),p.info(` - TUS upload forced: ${q.TUSUploadForced?"yes":"no"}`),p.info(` - Delta upload: ${q.partialUpload?"enabled":"disabled"}`),p.info(` - Max chunk size: ${Math.floor(q.maxChunkSize/1024/1024)} MB`);let{appid:W,path:K}=await GT$($,D,Z.config,G);if(D.verbose)p.info(`[Verbose] App ID: ${W}, Build path: ${K}`);if(DK(D.autoBump)&&D.bundle)J$("Cannot use --bundle (-b) and --auto-bump together. Omit --bundle to auto-increment from the latest remote version.");let H=await ZT$(Z.config,D);if(D.verbose)p.info(`[Verbose] Bundle version: ${H}`);let O=D.external?"external":"r2-direct",z="none";if(await qT$(D,K,G),D.verbose)p.info("[Verbose] Code check passed (notifyAppReady found and index.html present)");let V=await Y4();if(D.verbose)p.info(`[Verbose] Local config loaded: host=${V.hostWeb}`);let B=await Q$(F,D.apiHost,!1,void 0,D.filesHost);if(D.verbose)p.info("[Verbose] Capgo API client created successfully");let E=await R8(B,{appId:W,permission:"app.upload_bundle",plan:"upload",cliVersion:r1.version},{silent:J,permissionDeniedMessage:`Insufficient permissions for app ${W}. Required RBAC permission for this action: app.upload_bundle.`});if(D.verbose)p.info("[Verbose] Preflight passed: app exists, app.upload_bundle granted, storage plan valid");let L=E?.userId??await FD(B,F);if(D.verbose)p.info(`[Verbose] User verified successfully, user_id: ${L}`);let N=mb(D.channel);if(D.channel!==void 0&&N.length===0)J$("Missing channel name, pass one channel or a comma-separated list with --channel");let M=N.length>0?null:await _T$(W,F,V.hostWeb,D),w=N.length>0?N:mb(M||"production");if(w.length===0)J$("Cannot resolve target channel");let v=GU(w),_=w,A=RT$(D);if(D.verbose)p.info(`[Verbose] Target channel${w.length>1?"s":""}: ${v}`);let x=E?.orgId??await BD(F,W,{apiHost:D.apiHost});if(D.verbose)p.info(`[Verbose] Organization ID: ${x}`);let k=DK(D.autoBump);if(k){let V0;if(k==="ai"){let I0=await zE0({client:B,appid:W,channels:w,path:K,apikey:F,options:{apiHost:D.apiHost}});p.info(`\uD83E\uDD16 AI auto-bump chose ${I0.level}: ${I0.reason}`),V0=I0.level}else V0=k;if(D.verbose)p.info(`[Verbose] Resolving auto-bump (${V0}) version from channel/app remote versions...`);if(H=await TT$(F,W,w,H,V0,D),D.verbose)p.info(`[Verbose] Bundle version after auto-bump: ${H}`)}if(D.autoSetBundle){if(k9(D.mode))p.warn("--auto-set-bundle is not supported in Cordova mode (no capacitor.config to update)");else if(await mY0({version:H}),D.verbose)p.info(`[Verbose] Auto-set bundle version in ${Z.path}`)}if(p.info(`Upload ${W}@${H} started from path "${K}" to Capgo cloud`),D.verbose)p.info(`[Verbose] Checking if version ${H} already exists...`);let c=await KT$(F,W,H,D.versionExistsOk,G,D);if(D.verbose)p.info(`[Verbose] Version exists check: ${c?typeof c==="string"?`retry with ${c}`:"yes (skipping)":"no (continuing)"}`);if(c===!0)return{success:!0,appId:W,skipped:!0,reason:"VERSION_EXISTS",bundle:H,checksum:null,encryptionMethod:z,storageProvider:O};if(typeof c==="string")return p.info(`Retrying upload with new version: ${c}`),rb($,{...D,bundle:c,autoBump:void 0},J);if(D.external&&!D.external.startsWith("https://"))J$(`External link should should start with "https://" current is "${D.external}"`);let l=null,a="",h;if(!D.external){if(D.verbose)p.info(`[Verbose] Preparing bundle file from path: ${K}`);let V0=Z.config?.plugins?.CapacitorUpdater?.publicKey;if(h=await ET$(K,D,F,x,W,q.maxUploadLength,q.alertUploadSize,V0),Q=h.sessionKey,l=h.zipped,z=h.encryptionMethod,a=h.finalKeyData,D.verbose)p.info("[Verbose] Bundle prepared:"),p.info(` - Size: ${Math.floor((h.zipped?.byteLength??0)/1024)} KB`),p.info(` - Checksum: ${h.checksum}`),p.info(` - Encryption: ${h.encryptionMethod}`),p.info(` - IV Session Key: ${h.ivSessionKey?"present":"none"}`),p.info(` - Key ID: ${h.keyId||"none"}`);if(!D.ignoreChecksumCheck&&A==null&&!D.rolloutAdvance){if(D.verbose)p.info("[Verbose] Checking for duplicate checksum...");if(_=await OT$(F,W,w,h.checksum,D),D.verbose)p.info("[Verbose] Checksum is unique or already satisfied across target channels")}}let I=GU(_);if(D.verbose)p.info(`[Verbose] Checking compatibility with channel${_.length>1?"s":""} ${I}...`);let S=[];for(let V0 of _){let I0=await WT$(F,X,D,V0,W,H,x);S.push({channel:V0,...I0})}let u=S.find((V0)=>V0.nativePackages)?.nativePackages,g=HT$(S),d=S.filter((V0)=>V0.compatibility.result==="incompatible"),m=d.length>0,U0=d.reduce((V0,I0)=>Math.max(V0,I0.incompatibleCount),0),s=GU(d.map((V0)=>V0.channel)),F0=()=>{let V0=s||I;t0({channel:"bundle",event:"Bundle Upload Blocked",apikey:D.apikey,appId:W,orgId:x,tags:{reason:"incompatible",channel:V0,channel_name:V0,channel_names:V0,channel_count:d.length||_.length,incompatible_count:U0,interactive:G}});let O$=`Upload aborted: bundle is incompatible with ${d.length===1?"channel":"channels"} "${V0}" (${U0} native package(s) changed). A native build / app-store update is required. Run a native build with Capgo Builder (https://capgo.app/docs/cli/cloud-build/), or remove --fail-on-incompatible to upload anyway.`;throw p.error(O$),new ew0(O$)};if(m&&!J&&!D.acceptIncompatible){if(D.failOnIncompatible&&!G)F0();let V0=await dL(W)!==null,I0=await NE0({incompatible:m,interactive:G,hasCredentials:V0,appId:W,orgId:x,apikey:F,incompatibleCount:U0});if(I0==="abort")lb();if(I0!=="continue")return{success:!0,appId:W,skipped:!0,reason:"NATIVE_BUILD",builderAction:I0,bundle:H,checksum:null,encryptionMethod:z,storageProvider:O};if(VE0({incompatible:m,failOnIncompatible:!!D.failOnIncompatible,interactive:G,builderAction:I0}))F0()}else if(m&&D.acceptIncompatible&&!J)p.warn("Proceeding because --accept-incompatible was set. The incompatible-bundle crash warning will not be emailed.");if(D.verbose)p.info("[Verbose] Compatibility check completed:"),p.info(` - Native packages: ${u?u.length:0}`),p.info(` - Min update version: ${g||"none"}`);if(D.deleteLinkedBundleOnUpload)p.warn(`Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the target channel${_.length>1?"s":""}: ${I}.`),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option.");let E0=_.length>0,Y0=E0?await PT$(B,F,W,_,!!D.selfAssign,A,!!D.rolloutAdvance,D):new Map,M0={name:H,app_id:W,session_key:D.external?D.ivSessionKey:h?.ivSessionKey,external_url:D.external,storage_provider:O,min_update_version:g,native_packages:u,owner_org:x,user_id:L,checksum:D.external?D.encryptedChecksum:h?.checksum,link:D.link||null,comment:D.comment||null,key_id:h?.keyId||void 0,cli_version:r1.version};if(D.external){if(D.verbose)p.info(`[Verbose] Using external URL: ${D.external}`);if(await a0(F,{channel:"app",event:"App external",org_id:x,tracking_version:2,tags:{"app-id":W}},D.verbose),D.verbose)p.info("[Verbose] External bundle configured:"),p.info(` - URL: ${D.external}`),p.info(` - IV Session Key: ${D.ivSessionKey?"provided":"none"}`),p.info(` - Encrypted Checksum: ${D.encryptedChecksum?"provided":"none"}`)}if(D.zip){if(D.tus=!1,D.verbose)p.info("[Verbose] Upload method: ZIP (explicitly set via --zip)")}else if(!q.TUSUpload||D.external){if(D.tus=!1,D.verbose)p.info("[Verbose] Upload method: Standard (TUS not available or external URL)")}else if(D.tus=D.tus||q.TUSUploadForced,D.verbose)p.info(`[Verbose] Upload method: ${D.tus?"TUS (resumable)":"Standard"}`);if(!q.partialUpload||D.external){if(D.delta=!1,D.verbose&&D.external)p.info("[Verbose] Delta updates disabled (not available with external URLs)")}else if(D.delta=D.delta||D.partial||D.deltaOnly||D.partialOnly||q.partialUploadForced,D.verbose)p.info(`[Verbose] Delta updates: ${D.delta?"enabled":"disabled"}`);if(D.encryptDelta=D.encryptDelta||D.encryptPartial,D.encryptDelta&&z!=="v2")J$("You cannot encrypt the delta update if you are not using the v2 encryption method");let Z$="5.30.0",q0="6.30.0",d0="7.30.0",C=!1;if(D.delta&&z==="v2"&&!D.encryptDelta){let V0=J1(cb()),I0=await R6("@capgo/capacitor-updater",V0,D.packageJson),O$;try{O$=I0?o$(I0):void 0}catch{O$=void 0}if(I0&&O$&&VE(O$,o$("6.14.4"))){if(p.info(`Auto-enabling delta update encryption for updater version ${O$} (>= 6.14.4)`),D.verbose)p.info("[Verbose] Delta encryption auto-enabled for updater >= 6.14.4");D.encryptDelta=!0}}if(D.delta&&(D.encryptDelta||z==="v2")){let V0=J1(cb()),I0=await R6("@capgo/capacitor-updater",V0,D.packageJson),O$;try{O$=I0?o$(I0):void 0}catch{O$=void 0}if(I0&&O$){if(C=!f4(O$,Z$,q0,d0),D.verbose&&C)p.info(`[Verbose] Using hex checksum format for updater version ${O$}`)}}if(D.verbose&&D.delta)p.info("[Verbose] Preparing delta update manifest...");let P=D.delta?await dw0(K,F,x,W,D.encryptDelta?z:"none",a,C):[],o=M0.session_key&&D.encryptDelta&&Q?{sessionKey:Q,ivSessionKey:M0.session_key}:void 0,n=!!(D.delta&&!D.dryUpload&&!Y),z0=AE0(!!D.userRequestedDelta,nb(D));if(n&&P.length===0){if(D.userRequestedDelta)J$("Cannot request a manifest upload for an empty manifest");p.warn("Delta upload was auto-enabled, but the generated manifest is empty; continuing with ZIP-only upload"),D.delta=!1}let e0;if(n&&D.delta)try{e0=await nw0(P,K,o,D)}catch(V0){if(!z0||!(V0 instanceof UU))throw V0;p.warn(`${V0.message} Continuing with ZIP-only upload.`),D.delta=!1}if(D.verbose&&D.delta)p.info(`[Verbose] Delta manifest prepared with ${P.length} files`);if(D.delta&&P.length>Gq)J$(tV(P.length));if(D.verbose)p.info("[Verbose] Creating version record in database...");let w$=await db(F,M0,"add",D);if(D.verbose)p.info("[Verbose] Version record created successfully");let t$;if(e0){let V0=RE0(!!o,C);try{t$=await IE0(F,{protocol_version:wE0,version_id:w$,delta_encryption:{enabled:!!o},manifest_upload_auto_enabled:z0,file_hash_format:V0,entries:e0},D)}catch(I0){if(z0)p.warn(`Cannot authorize manifest upload; continuing with ZIP-only upload. ${Z0(I0)}`),D.delta=!1;else{try{await PF(F,W,H,D)}catch(O$){J$(`Cannot authorize manifest upload ${Z0(I0)}. Cleanup of the incomplete version also failed (${Z0(O$)}); delete bundle ${H} manually before retrying.`)}J$(`Cannot authorize manifest upload ${Z0(I0)}`)}}}if(D.dryUpload){if(D.verbose)p.info("[Verbose] Dry upload mode: skipping bundle publishing and channel assignment");if(!J)d1().outro("Dry upload saved bundle metadata without uploading files or updating channels");return{success:!0,appId:W,bundle:H,checksum:M0.checksum??null,encryptionMethod:z,sessionKey:Q?Q.toString("base64"):void 0,ivSessionKey:typeof M0.session_key==="string"?M0.session_key:void 0,storageProvider:M0.storage_provider,reason:"DRY_UPLOAD"}}if(D.tusChunkSize&&D.tusChunkSize>q.maxChunkSize)p.error(`Chunk size ${D.tusChunkSize} is greater than the maximum chunk size ${q.maxChunkSize}, using the maximum chunk size`),D.tusChunkSize=q.maxChunkSize;else if(!D.tusChunkSize)D.tusChunkSize=q.maxChunkSize;if(D.verbose)p.info(`[Verbose] TUS chunk size: ${Math.floor(D.tusChunkSize/1024/1024)} MB`);if(l&&Y){let{s3Region:V0,s3Apikey:I0,s3Apisecret:O$,s3BucketName:T1,s3Endpoint:Z8,s3Port:Y$,s3SSL:u1}=Y;if(p.info("Uploading to S3"),D.verbose)p.info("[Verbose] S3 configuration:"),p.info(` - Endpoint: ${Z8}`),p.info(` - Region: ${V0}`),p.info(` - Bucket: ${T1}`),p.info(` - Port: ${Y$}`),p.info(` - SSL: ${u1?"enabled":"disabled"}`);let _D=`${u1?"https":"http"}://${Z8}${Y$?`:${Y$}`:""}`,qX=new QB({endPoint:Z8,region:V0,port:Y$,pathStyle:!0,bucket:T1,accessKey:I0,secretKey:O$}),f8=`${W}-${H}`,U8=encodeURIComponent(f8);if(D.verbose)p.info(`[Verbose] Uploading to S3 as: ${f8}`);try{await qX.putObject(f8,Uint8Array.from(l)),M0.external_url=`${_D}/${U8}`,M0.storage_provider="external",await db(F,M0,"update",D)}catch(WX){try{await PF(F,W,H,D)}catch(F7){J$(`Cannot upload bundle to S3 ${Z0(WX)}. Cleanup of the incomplete version also failed (${Z0(F7)}); delete bundle ${H} manually before retrying.`)}J$(`Cannot upload bundle to S3 ${Z0(WX)}`)}if(D.verbose)p.info(`[Verbose] S3 upload complete, external URL: ${M0.external_url}`)}else if(l){if(nb(D)){if(D.verbose)p.info("[Verbose] Starting full bundle upload to Capgo Cloud...");await wT$(F,B,W,H,x,l,D,D.tusChunkSize)}else if(D.verbose)p.info("[Verbose] Skipping full bundle upload (delta-only mode)");let V0=null;try{if(D.dryUpload){if(D.delta=!1,D.verbose)p.info("[Verbose] Dry upload mode: skipping delta upload")}if(D.verbose&&D.delta)p.info("[Verbose] Starting delta file upload..."),p.info(` - Manifest entries: ${P.length}`),p.info(` - Encryption: ${o?"enabled":"disabled"}`);if(D.delta){if(!t$)J$("Cannot upload delta files without manifest upload authorization");V0=await iw0(F,P,K,W,x,o,D,t$)}if(D.verbose&&V0)p.info(`[Verbose] Delta upload complete with ${V0.length} files`)}catch(I0){if(I0 instanceof X7)if(yw0(I0,z0)==="manifest")p.warn(I0.message),V0=null;else{let T1=I0.scope==="all"?I0:new X7("all",I0.backendMessage,I0.requestId);try{await PF(F,W,H,D)}catch(Z8){p.error(`Cleanup of the incomplete version failed (${Z0(Z8)}); delete bundle ${H} manually before retrying.`)}throw T1}else if(D.userRequestedDelta)throw I0;else if(p.info(`Failed to upload delta files to capgo cloud. Error: ${Z0(I0)}. This is not a critical error, the bundle has been uploaded without the delta files`),D.verbose)p.info(`[Verbose] Delta upload error details: ${Z0(I0)}`)}if(V0?.length){if(D.verbose)p.info(`[Verbose] Writing ${V0.length} manifest rows via set_manifest...`);try{await aY0(F,W,H,V0,D)}catch(I0){try{await PF(F,W,H,D)}catch(O$){J$(`Cannot set bundle manifest ${Z0(I0)}. Cleanup of the incomplete version also failed (${Z0(O$)}); delete bundle ${H} manually before retrying.`)}J$(`Cannot set bundle manifest ${Z0(I0)}`)}if(D.verbose)p.info("[Verbose] Manifest rows written (sizes filled by backend from R2)")}if(M0.storage_provider="r2",M0.manifest=null,D.verbose)p.info("[Verbose] Updating version record with storage provider...");if(await ME0({apikey:F,appId:W,bundle:H,apiHost:D.apiHost,reporter:d1()},async()=>{await db(F,M0,"update",D)}),D.verbose)p.info("[Verbose] Version record updated successfully")}let G0=await A6(B,F,"bundle.delete",{appId:W});if(D.verbose)p.info("[Verbose] Permissions:"),p.info(" - app.upload_bundle: yes"),p.info(` - bundle.delete: ${G0?"yes":"no"}`),p.info(" - channel permissions: checked per target channel");let U$=D.deleteLinkedBundleOnUpload&&G0,G$=U$?await Promise.all(_.map(async(V0)=>({channel:V0,version:await JR0(F,W,V0,D)}))):[];if(D.deleteLinkedBundleOnUpload&&!U$)p.warn("Cannot delete linked bundle on upload because this API key lacks bundle.delete");let p1=new Set(_).size,h$=new Set;for(let V0 of _){if(D.verbose)p.info(`[Verbose] Setting bundle ${H} to channel ${V0}...`);let I0=Y0.has(V0)?Y0.get(V0)??null:await ib(F,W,V0,!0,D),O$=D.rolloutAdvance||A!=null,T1=I0?.rollout_percentage_bps,Z8=A??T1??0;if(D.rolloutAdvance&&A==null&&!((T1??0)>0))J$(`Cannot advance rollout, channel ${V0} has no rollout percentage to reuse. Pass --rollout or --rollout-percentage-bps`);let Y$=O$?await CT$(B,F,!!D.bundleUrl,H,V0,W,V,I0,Z8,D.rolloutCacheTtlSeconds,D.selfAssign,D,!!D.rolloutAdvance):await ST$(B,F,!!D.bundleUrl,H,V0,L,x,W,V,I0,E0,D.selfAssign,D);if(Y$)h$.add(V0);if(D.verbose)p.info(`[Verbose] Channel ${V0} ${Y$?"updated successfully":"was not updated"}`)}if(U$){let V0=new Set;for(let I0 of G$){if(!h$.has(I0.channel))continue;if(!I0.version||V0.has(I0.version.id))continue;if(D.verbose)p.info(`[Verbose] Deleting previously linked bundle in channel ${I0.channel}...`);await IT$(F,I0.version,W,D),V0.add(I0.version.id)}}if(h$.size===0)p.warn("Cannot set channel because this API key lacks the required RBAC permission");if(E0&&h$.size!==p1)J$("Cannot complete upload because one or more target channels were not updated");if(D.verbose)p.info("[Verbose] Sending upload event...");await a0(F,{channel:"app",event:"App Uploaded",org_id:x,tracking_version:2,tags:{"app-id":W,bundle:H}},D.verbose),await a0(F,{channel:"app",event:"Bundle Uploaded",org_id:x,tracking_version:2,tags:{"app-id":W,bundle:H},notifyConsole:!0}).catch(()=>{});for(let V0 of S){if(V0.compatibility.result!=="incompatible")continue;t0({channel:"bundle",event:"Bundle Incompatible",apikey:F,appId:W,orgId:x,tags:{source:"upload",channel:V0.channel,channel_name:V0.channel,channel_overwritten:h$.has(V0.channel),version_new_name:H,...V0.compatibility.versionOldId?{version_old_id:V0.compatibility.versionOldId}:{},...V0.compatibility.versionOldName?{version_old_name:V0.compatibility.versionOldName}:{},...D.acceptIncompatible?{incompatibility_accepted:!0}:{}}})}let w0={success:!0,appId:W,bundle:H,updatedChannels:Array.from(h$),checksum:M0.checksum??null,encryptionMethod:z,sessionKey:Q?Q.toString("base64"):void 0,ivSessionKey:typeof M0.session_key==="string"?M0.session_key:void 0,storageProvider:M0.storage_provider};if(D.verbose)p.info("[Verbose] Upload completed successfully:"),p.info(` - Bundle: ${w0.bundle}`),p.info(` - Checksum: ${w0.checksum}`),p.info(` - Encryption: ${w0.encryptionMethod}`),p.info(` - Storage: ${w0.storageProvider}`);if(G&&!w0.skipped){let V0=D.showReplicationProgress;if(V0===void 0)V0=await $E0({preferenceKey:"uploadShowReplicationProgress",message:"Show Capgo global replication progress for this upload so you can confirm rollout in all regions?",initialValue:!1,rememberMessage:"Remember this replication progress preference for future uploads on this machine?"});if(V0)await qE0({title:"Replicating your bundle in all regions to guarantee fast updates.",completeMessage:"Replication complete. Your update is now globally available.",interactive:G})}if(!J&&!w0.skipped)d1().outro("Time to share your update to the world \uD83C\uDF0D");return w0}r0();g8();C1();xD();p3();f0();import{randomUUID as iT$}from"node:crypto";import{existsSync as qR0,writeFileSync as pT$}from"node:fs";import{cwd as rT$}from"node:process";import{existsSync as QR0,readFileSync as ob}from"node:fs";import{createRequire as kT$}from"node:module";import{dirname as tb,join as xT$}from"node:path";import uT$ from"node:process";var ZK="@capgo/capacitor-updater";function fT$($){if(!QR0($))return null;try{return JSON.parse(ob($,"utf-8"))}catch{return null}}function yT$($,D){let J=fT$($);if(!J)return{version:null,section:null};let Q=["dependencies","devDependencies","optionalDependencies"];for(let X of Q){let Y=J[X];if(!Y||!Object.hasOwn(Y,D))continue;let F=Y[D];return{version:typeof F==="string"?F:String(F),section:X}}return{version:null,section:null}}function bT$($,D){let Q=tb($);while(!0){let X=xT$(Q,"node_modules",D,"package.json");if(QR0(X))try{let F=JSON.parse(ob(X,"utf-8"));if(typeof F.version==="string")return F.version}catch{return null}let Y=tb(Q);if(Y===Q)break;Q=Y}if(!uT$.versions.pnp)return null;try{let Y=kT$($).resolve(`${D}/package.json`),F=JSON.parse(ob(Y,"utf-8"));if(typeof F.version==="string")return F.version}catch{return null}return null}function hT$($,D){let J=tb($),Q=yT$($,D),X=bT$($,D),Y=[];if(!Q.version)Y.push(`Missing ${D} in ${$}`);if(!X)Y.push(`Cannot resolve ${D} from ${J}/node_modules`);return{packageJsonPath:$,projectDir:J,declaredVersion:Q.version,declaredIn:Q.section,installedVersion:X,ready:Y.length===0,details:Y}}function qU($){return hT$($,ZK)}r0();import{spawnSync as gT$}from"node:child_process";import{existsSync as YR0,statSync as mT$}from"node:fs";import{dirname as dT$,join as cT$,resolve as FR0}from"node:path";import{cwd as XR0}from"node:process";f0();function ab($){return`0.0.1-beta.local-${$}`}function sb($){let D=J1(XR0()),J=JU($);if(J?.length)for(let Q of J)for(let X of[XR0(),D]){let Y=FR0(X,Q);if(YR0(Y))return Y}return cT$(D,"package.json")}function lT$($){return $?.trim()||"latest"}function nT$($,D,J){let Q=`${ZK}@${D}`,X=$.installCommand.split(/\s+/).filter(Boolean),Y=X[0];if(!Y)return null;if(!J?.trim())switch($.pm){case"yarn":return{command:"yarn",args:["add",Q]};case"bun":return{command:"bun",args:["add",Q]};case"pnpm":return{command:"pnpm",args:["add",Q]};default:return{command:Y,args:[...X.slice(1),Q]}}if($.pm==="yarn"||$.pm==="bun")return{command:Y,args:X.slice(1)};return{command:Y,args:[...X.slice(1),"--force",Q]}}async function ZR0($,D){T.warn(`Bundle version "${$}" is not valid semver (https://semver.org/).`);let J=await C$({message:`Use local fallback version ${D} instead?`,initialValue:!0});if(n0(J)||!J)return null;return T.info(`Using bundle version ${D}`),D}async function UR0($){let D=await Z6({message:$,validate:(J)=>{let Q=J?.trim();if(!Q)return"Value is required";let X=FR0(Q);if(!YR0(X))return`Path does not exist: ${X}`;if(!mT$(X).isDirectory())return`Path is not a directory: ${X}`}});if(n0(D))return null;return D.trim()}async function GR0($){let D=sb($),J=qU(D);if(J.ready)return!0;T.warn(`Cannot find ${ZK} in node_modules.`);let Q=await C$({message:`Install ${ZK} now?`,initialValue:!0});if(n0(Q)||!Q)return!1;let X=BQ(),Y=lT$(J.declaredVersion),F=nT$(X,Y,J.declaredVersion);if(!F)return!1;if(gT$(F.command,F.args,{cwd:dT$(D),stdio:"inherit",shell:!1}).status!==0)return!1;return qU(D).ready}W$();var oT$=20;function tT$($){console.log(JSON.stringify($,null,2))}function WU($){console.error(Z0($))}function aT$($){if($.context?.message)WU({error:$.message,message:$.context.message});else WU({error:$.message})}async function WR0($,D,J=!1){let{json:Q}=D,{bundle:X,path:Y}=D,F=!Q&&!J;try{if(F)await a$();let Z=await K$(),U=mD({silent:Q||J}),G=await XB({explicitAppId:$,config:Z?.config,packageJsonPaths:JU(D.packageJson),interactive:U,json:Q}),q=iT$().split("-")[0],W=EJ("",D.packageJson);if(X=X||W||ab(q),F)y0(`Zipping ${G??"app"}@${X}`);if(X&&!EQ.test(X)){if(U){let A=await ZR0(X,ab(q));if(A)X=A}if(!EQ.test(X)){let A=`Your bundle name ${X}, is not valid it should follow semver convention : https://semver.org/`;if(!J)if(Q)WU({error:"invalid_semver"});else T.error(A);throw Error("Invalid bundle version format")}}if(Y=Y||Z?.config?.webDir,!Y&&U){let A=await UR0("Enter the path to your built web assets (webDir):");if(A)Y=A}if(!G||!X||!Y){if(!J)if(Q)WU({error:"missing_argument"});else T.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project");throw Error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project")}if(!qR0(Y)){let A=`Path ${Y} does not exist, build your app first, or provide a valid path`;throw Q?new Q0("path_not_found",{message:A}):new Q0(A)}if(F)T.info(`Started from path "${Y}"`);if(D.codeCheck!==!1&&!D.ignoreNotifyAppReady){if(!F8(Y,"notifyAppReady"))if(U){if(await HB({webDir:Y,interactive:U,json:Q})!=="skipped"&&!F8(Y,"notifyAppReady"))throw new Q0("notifyAppReady() is missing in build folder")}else throw Q?new Q0("notifyAppReady_not_in_source_code",{message:KB(Y)}):new Q0(KB(Y));if(!QU(Y)){if(!J)if(Q)WU({error:"index_html_not_found"});else T.error(`index.html is missing in the root folder of ${Y}`);throw Error("index.html is missing in root folder")}}let H=await UL(Y);if(F)T.info(`Zipped ${H.byteLength} bytes`);let O=F?f1():null;if(O)O.start("Calculating checksum");let z=J1(rT$()),V=sb(D.packageJson),B=qU(V);if(!B.ready&&U&&await GR0(D.packageJson))B=qU(V);if(!B.ready){if(!J)T.warn("Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager");throw Error("Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager")}let E=await R6("@capgo/capacitor-updater",z,D.packageJson),L=!1,N;try{N=E?o$(E):void 0}catch{N=void 0}if(N)L=!f4(N,void 0,void 0,"7.0.0");else if(E==="link:@capgo/capacitor-updater"){if(!J)T.warn("Using local @capgo/capacitor-updater. Assuming v7");L=!0}let M=await DJ(H,D.keyV2||qR0(Q6)||L?"sha256":"crc32");if(O)O.stop(`Checksum ${L?"SHA256":"CRC32"}: ${M}`);let w=Math.floor(H.byteLength/1024/1024);if(w>oT$&&F)T.warn(`WARNING !!
|
|
680
680
|
The bundle size is ${w} Mb, this may take a while to download for users
|
|
681
681
|
`),T.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as hT}from"node:module";var kT=Object.create;var{getPrototypeOf:gT,defineProperty:A2,getOwnPropertyNames:nW,getOwnPropertyDescriptor:xT}=Object,yW=Object.prototype.hasOwnProperty;function mW(D){return this[D]}var fT,nT,r$=(D,$,F)=>{var U=D!=null&&typeof D==="object";if(U){var I=$?fT??=new WeakMap:nT??=new WeakMap,J=I.get(D);if(J)return J}F=D!=null?kT(gT(D)):{};let X=$||!D||!D.__esModule?A2(F,"default",{value:D,enumerable:!0}):F;for(let Y of nW(D))if(!yW.call(X,Y))A2(X,Y,{get:mW.bind(D,Y),enumerable:!0});if(U)I.set(D,X);return X},g0=(D)=>{var $=(fW??=new WeakMap).get(D),F;if($)return $;if($=A2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var U of nW(D))if(!yW.call($,U))A2($,U,{get:mW.bind(D,U),enumerable:!(F=xT(D,U))||F.enumerable})}return fW.set(D,$),$},fW,P=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var yT=(D)=>D;function mT(D,$){this[D]=yT.bind(null,$)}var tD=(D,$)=>{for(var F in $)A2(D,F,{get:$[F],enumerable:!0,configurable:!0,set:mT.bind($,F)})};var S=(D,$)=>()=>(D&&($=D(D=0)),$);var Z6D=(D)=>Promise.all(D),o=hT(import.meta.url);var o$;var S1=S(()=>{o$={name:"@capgo/cli",type:"module",version:"8.90.2",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",typecheck:"tsc --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:bundle-soft-delete":"bun test/test-bundle-soft-delete.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:api-perf":"bun test/test-api-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-host-fields":"bun test/test-mcp-host-fields.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":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.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-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 && bun test/test-auth-session-bad-key.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 && bun test/test-build-env.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: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-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:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && 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-host-fields && 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 && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && 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:support && 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: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-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:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","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-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":"bun test/test-support.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","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: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","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.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","@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":"npm:typescript@7.1.0-beta","@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 uD;var O0=S(()=>{uD=class uD extends Error{context;constructor(D,$,F){super(D,F!==void 0?{cause:F}:void 0);this.name="CliUserError",this.context=$}}});import{platform as dT}from"node:os";import{version as lT}from"node:process";function dW(D){iW=D}function pT(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function hW(D){if(D.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 rT(D){if(D.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(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function rI(D,$){if($===void 0||$===null){if(pI.has(D.toLowerCase()))throw new uD(hW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(pI.has(D.toLowerCase()))throw new uD(hW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(!pT($)){if(pI.has(D.toLowerCase()))throw new uD(rT(D));throw new uD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function I0(D){let $={capgo_api:cT,"x-cli-version":o$.version,"x-cli-command":iW,"x-cli-node":lT,"x-cli-os":dT()};if(D)for(let[F,U]of Object.entries(D))$[F]=rI(F,U);return $}var cT="2025-10-01",iW="",pI;var _3=S(()=>{S1();O0();pI=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as Z$}from"fs";var V2=(D=".",$="unknown")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Y=`${D}/package-lock.json`,Q=`${D}/npm-shrinkwrap.json`;if(Z$(F)||Z$(U))return"bun";if(Z$(I)||Z$(J))return"pnpm";if(Z$(X))return"yarn";if(Z$(Y)||Z$(Q))return"npm";return $},k3=(D=V2(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},lW=(D=".",$="npx")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Y=`${D}/package-lock.json`,Q=`${D}/npm-shrinkwrap.json`;if(Z$(F)||Z$(U))return"bunx";if(Z$(I)||Z$(J))return"pnpm exec";if(Z$(X))return"yarn dlx";if(Z$(Y)||Z$(Q))return"npx";return $};var cW=()=>{};var pW,rW=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},oW=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var tW=S(()=>{pW=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let F=0;D.lastIndex=0;while(D.test($))F+=1;return $.length-F}})()});var oT,tT,aW,aT,eW,eT,sT,DP,sW=(D,$={},F={})=>{let U=$.limit??1/0,I=$.ellipsis??"",J=$?.ellipsisWidth??(I?sW(I,DP,F).width:0),X=0,Y=F.controlWidth??0,Q=F.tabWidth??8,B=F.emojiWidth??2,q=2,K=F.regularWidth??1,W=F.wideWidth??2,u=[[eT,K],[oT,0],[tT,Y],[aT,Q],[eW,B],[aW,W]],E=0,G=0,L=D.length,z=0,H=!1,N=L,M=Math.max(0,U-J),V=0,Z=0,b=0,n=0;D:while(!0){if(Z>V||G>=L&&G>E){let _=D.slice(V,Z)||D.slice(E,G);z=0;for(let m of _.replaceAll(sT,"")){let y=m.codePointAt(0)||0;if(rW(y))n=2;else if(oW(y))n=W;else n=K;if(b+n>M)N=Math.min(N,Math.max(V,E)+z);if(b+n>U){H=!0;break D}z+=m.length,b+=n}V=Z=0}if(G>=L)break D;for(let _=0,m=u.length;_<m;_++){let[y,DD]=u[_];if(y.lastIndex=G,y.test(D)){if(z=y===aW?pW(D.slice(G,y.lastIndex)):y===eW?1:y.lastIndex-G,n=z*DD,b+n>M)N=Math.min(N,G+Math.floor((M-b)/DD));if(b+n>U){H=!0;break D}b+=n,V=E,Z=G,G=E=y.lastIndex;continue D}}G+=1}return{width:H?M:b,index:H?N:L,truncated:H,ellipsed:H&&U>=J}},Du;var $u=S(()=>{tW();oT=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,tT=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,aW=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,aT=/\t{1,1000}/y,eW=/[\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,eT=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,sT=/\p{M}+/gu,DP={limit:1/0,ellipsis:""},Du=sW});var $P,FP=(D,$={})=>{return Du(D,$P,$).width},K$;var oI=S(()=>{$u();$P={limit:1/0,ellipsis:"",ellipsisWidth:0},K$=FP});function H0(D,$,F){return String(D).normalize().split(YP).map((U)=>XP(U,$,F)).join(`
|
|
1
|
+
import{createRequire as hT}from"node:module";var kT=Object.create;var{getPrototypeOf:gT,defineProperty:A2,getOwnPropertyNames:nW,getOwnPropertyDescriptor:xT}=Object,yW=Object.prototype.hasOwnProperty;function mW(D){return this[D]}var fT,nT,r$=(D,$,F)=>{var U=D!=null&&typeof D==="object";if(U){var I=$?fT??=new WeakMap:nT??=new WeakMap,J=I.get(D);if(J)return J}F=D!=null?kT(gT(D)):{};let X=$||!D||!D.__esModule?A2(F,"default",{value:D,enumerable:!0}):F;for(let Y of nW(D))if(!yW.call(X,Y))A2(X,Y,{get:mW.bind(D,Y),enumerable:!0});if(U)I.set(D,X);return X},g0=(D)=>{var $=(fW??=new WeakMap).get(D),F;if($)return $;if($=A2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var U of nW(D))if(!yW.call($,U))A2($,U,{get:mW.bind(D,U),enumerable:!(F=xT(D,U))||F.enumerable})}return fW.set(D,$),$},fW,P=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var yT=(D)=>D;function mT(D,$){this[D]=yT.bind(null,$)}var tD=(D,$)=>{for(var F in $)A2(D,F,{get:$[F],enumerable:!0,configurable:!0,set:mT.bind($,F)})};var S=(D,$)=>()=>(D&&($=D(D=0)),$);var Z6D=(D)=>Promise.all(D),o=hT(import.meta.url);var o$;var S1=S(()=>{o$={name:"@capgo/cli",type:"module",version:"8.91.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",typecheck:"tsc --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:bundle-soft-delete":"bun test/test-bundle-soft-delete.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:api-perf":"bun test/test-api-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-host-fields":"bun test/test-mcp-host-fields.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":"bun test/test-app-list.mjs","test:app-todo":"bun test/test-app-todo.mjs && bun test/test-builder-only-checklist.mjs && bun test/test-builder-only-setup.mjs && bun test/test-app-todo-lists.mjs && bun test/test-app-todo-tabs.mjs && bun test/test-app-todo-command.mjs && node test/test-app-todo-interactive.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-capgo-client":"bun test/test-create-capgo-client.mjs","test:no-supabase-sdk":"bun test/test-no-supabase-sdk.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-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 && bun test/test-auth-session-bad-key.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 && bun test/test-build-env.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: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-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:api-perf && bun run test:preview-qr && bun run test:bundle-pages && bun run test:app-set-options && 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-host-fields && 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 && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-capgo-client && bun run test:bundle-soft-delete && bun run test:no-supabase-sdk && 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:support && 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: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-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:plan-validation && bun run test:setup-notices && bun run test:settings-parity && bun run test:init-browser-login && bun run test:android-onboarding-units && bun run test:build-credentials-units && bun run test:onboarding-generators && bun run test:mcp-onboarding","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-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":"bun test/test-support.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","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: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","test:init-browser-login":"bun test test/init/","test:android-onboarding-units":"bun test/test-android-gradle.mjs && bun test/test-android-keystore.mjs && bun test/test-android-oauth.mjs && bun test/test-android-play.mjs && bun test/test-android-tui-sequencing.mjs","test:build-credentials-units":"bun test/test-credentials-migration.mjs && bun test/test-provisioning-map-validation.mjs && bun test/test-mobileprovision-parser.mjs","test:onboarding-generators":"bun test/test-diff-utils.mjs && bun test/test-workflow-generator.mjs","test:mcp-onboarding":"bun test/test-mcp-onboarding.mjs","test:setup-notices":"bun test ./test/test-setup-notices.mjs ./test/test-setup-progress-request.mjs ./test/test-setup-notice-background.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","@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":"npm:typescript@7.1.0-beta","@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 uD;var O0=S(()=>{uD=class uD extends Error{context;constructor(D,$,F){super(D,F!==void 0?{cause:F}:void 0);this.name="CliUserError",this.context=$}}});import{platform as dT}from"node:os";import{version as lT}from"node:process";function dW(D){iW=D}function pT(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function hW(D){if(D.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 rT(D){if(D.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(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function rI(D,$){if($===void 0||$===null){if(pI.has(D.toLowerCase()))throw new uD(hW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(pI.has(D.toLowerCase()))throw new uD(hW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(!pT($)){if(pI.has(D.toLowerCase()))throw new uD(rT(D));throw new uD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function I0(D){let $={capgo_api:cT,"x-cli-version":o$.version,"x-cli-command":iW,"x-cli-node":lT,"x-cli-os":dT()};if(D)for(let[F,U]of Object.entries(D))$[F]=rI(F,U);return $}var cT="2025-10-01",iW="",pI;var _3=S(()=>{S1();O0();pI=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as Z$}from"fs";var V2=(D=".",$="unknown")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Y=`${D}/package-lock.json`,Q=`${D}/npm-shrinkwrap.json`;if(Z$(F)||Z$(U))return"bun";if(Z$(I)||Z$(J))return"pnpm";if(Z$(X))return"yarn";if(Z$(Y)||Z$(Q))return"npm";return $},k3=(D=V2(),$=!1)=>{switch(D){case"bun":return $?"bun install":"install";case"pnpm":return $?"pnpm install":"install";case"yarn":return $?"yarn install":"install";case"npm":return $?"npm install":"install";case"unknown":return $?"unknown unknown":"unknown";default:return $?"npm install":"install"}},lW=(D=".",$="npx")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Y=`${D}/package-lock.json`,Q=`${D}/npm-shrinkwrap.json`;if(Z$(F)||Z$(U))return"bunx";if(Z$(I)||Z$(J))return"pnpm exec";if(Z$(X))return"yarn dlx";if(Z$(Y)||Z$(Q))return"npx";return $};var cW=()=>{};var pW,rW=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},oW=(D)=>{return D===8987||D===9001||D>=12272&&D<=12287||D>=12289&&D<=12350||D>=12441&&D<=12543||D>=12549&&D<=12591||D>=12593&&D<=12686||D>=12688&&D<=12771||D>=12783&&D<=12830||D>=12832&&D<=12871||D>=12880&&D<=19903||D>=65040&&D<=65049||D>=65072&&D<=65106||D>=65108&&D<=65126||D>=65128&&D<=65131||D>=127488&&D<=127490||D>=127504&&D<=127547||D>=127552&&D<=127560||D>=131072&&D<=196605||D>=196608&&D<=262141};var tW=S(()=>{pW=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let F=0;D.lastIndex=0;while(D.test($))F+=1;return $.length-F}})()});var oT,tT,aW,aT,eW,eT,sT,DP,sW=(D,$={},F={})=>{let U=$.limit??1/0,I=$.ellipsis??"",J=$?.ellipsisWidth??(I?sW(I,DP,F).width:0),X=0,Y=F.controlWidth??0,Q=F.tabWidth??8,B=F.emojiWidth??2,q=2,K=F.regularWidth??1,W=F.wideWidth??2,u=[[eT,K],[oT,0],[tT,Y],[aT,Q],[eW,B],[aW,W]],E=0,G=0,L=D.length,z=0,H=!1,N=L,M=Math.max(0,U-J),V=0,Z=0,b=0,n=0;D:while(!0){if(Z>V||G>=L&&G>E){let _=D.slice(V,Z)||D.slice(E,G);z=0;for(let m of _.replaceAll(sT,"")){let y=m.codePointAt(0)||0;if(rW(y))n=2;else if(oW(y))n=W;else n=K;if(b+n>M)N=Math.min(N,Math.max(V,E)+z);if(b+n>U){H=!0;break D}z+=m.length,b+=n}V=Z=0}if(G>=L)break D;for(let _=0,m=u.length;_<m;_++){let[y,DD]=u[_];if(y.lastIndex=G,y.test(D)){if(z=y===aW?pW(D.slice(G,y.lastIndex)):y===eW?1:y.lastIndex-G,n=z*DD,b+n>M)N=Math.min(N,G+Math.floor((M-b)/DD));if(b+n>U){H=!0;break D}b+=n,V=E,Z=G,G=E=y.lastIndex;continue D}}G+=1}return{width:H?M:b,index:H?N:L,truncated:H,ellipsed:H&&U>=J}},Du;var $u=S(()=>{tW();oT=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,tT=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,aW=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,aT=/\t{1,1000}/y,eW=/[\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,eT=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,sT=/\p{M}+/gu,DP={limit:1/0,ellipsis:""},Du=sW});var $P,FP=(D,$={})=>{return Du(D,$P,$).width},K$;var oI=S(()=>{$u();$P={limit:1/0,ellipsis:"",ellipsisWidth:0},K$=FP});function H0(D,$,F){return String(D).normalize().split(YP).map((U)=>XP(U,$,F)).join(`
|
|
2
2
|
`)}var g3="\x1B",Xu="",IP=39,aI="\x07",Yu="[",UP="]",Qu="m",eI,Fu,Iu=(D)=>{if(D>=30&&D<=37)return 39;if(D>=90&&D<=97)return 39;if(D>=40&&D<=47)return 49;if(D>=100&&D<=107)return 49;if(D===1||D===2)return 22;if(D===3)return 23;if(D===4)return 24;if(D===7)return 27;if(D===8)return 28;if(D===9)return 29;if(D===0)return 0;return},Uu=(D)=>`${g3}${Yu}${D}${Qu}`,Ju=(D)=>`${g3}${eI}${D}${aI}`,tI=(D,$,F)=>{let U=$[Symbol.iterator](),I=!1,J=!1,X=D.at(-1),Y=X===void 0?0:K$(X),Q=U.next(),B=U.next(),q=0;while(!Q.done){let K=Q.value,W=K$(K);if(Y+W<=F)D[D.length-1]+=K;else D.push(K),Y=0;if(K===g3||K===Xu)I=!0,J=$.startsWith(eI,q+1);if(I){if(J){if(K===aI)I=!1,J=!1}else if(K===Qu)I=!1}else if(Y+=W,Y===F&&!B.done)D.push(""),Y=0;Q=B,B=U.next(),q+=K.length}if(X=D.at(-1),!Y&&X!==void 0&&X.length&&D.length>1)D[D.length-2]+=D.pop()},JP=(D)=>{let $=D.split(" "),F=$.length;while(F){if(K$($[F-1]))break;F--}if(F===$.length)return D;return $.slice(0,F).join(" ")+$.slice(F).join("")},XP=(D,$,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let U="",I,J,X=D.split(" "),Y=[""],Q=0;for(let K=0;K<X.length;K++){let W=X[K];if(F.trim!==!1){let E=Y.at(-1)??"",G=E.trimStart();if(E.length!==G.length)Y[Y.length-1]=G,Q=K$(G)}if(K!==0){if(Q>=$&&(F.wordWrap===!1||F.trim===!1))Y.push(""),Q=0;if(Q||F.trim===!1)Y[Y.length-1]+=" ",Q++}let u=K$(W);if(F.hard&&u>$){let E=$-Q,G=1+Math.floor((u-E-1)/$);if(Math.floor((u-1)/$)<G)Y.push("");tI(Y,W,$),Q=K$(Y.at(-1)??"");continue}if(Q+u>$&&Q&&u){if(F.wordWrap===!1&&Q<$){tI(Y,W,$),Q=K$(Y.at(-1)??"");continue}Y.push(""),Q=0}if(Q+u>$&&F.wordWrap===!1){tI(Y,W,$),Q=K$(Y.at(-1)??"");continue}Y[Y.length-1]+=W,Q+=u}if(F.trim!==!1)Y=Y.map((K)=>JP(K));let B=Y.join(`
|
|
3
3
|
`),q=!1;for(let K=0;K<B.length;K++){let W=B[K];if(U+=W,!q){if(q=W>="\uD800"&&W<="\uDBFF",q)continue}else q=!1;if(W===g3||W===Xu){Fu.lastIndex=K+1;let E=Fu.exec(B)?.groups;if(E?.code!==void 0){let G=Number.parseFloat(E.code);I=G===IP?void 0:G}else if(E?.uri!==void 0)J=E.uri.length===0?void 0:E.uri}if(B[K+1]===`
|
|
4
4
|
`){if(J)U+=Ju("");let u=I?Iu(I):void 0;if(I&&u)U+=Uu(u)}else if(W===`
|