@capgo/cli 8.97.3 → 8.98.1
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/README.md +121 -1
- package/dist/index.js +939 -910
- package/dist/notify-app-ready-worker.js +4 -4
- package/dist/onboarding-worker.js +4 -4
- package/dist/package.json +4 -2
- package/dist/src/analytics/opt-out.d.ts +1 -0
- package/dist/src/build/archive.d.ts +54 -0
- package/dist/src/build/credentials-remote.d.ts +55 -0
- package/dist/src/build/request.d.ts +6 -30
- package/dist/src/build/zip-command.d.ts +10 -0
- package/dist/src/bundle/delta-pack.d.ts +45 -0
- package/dist/src/bundle/partial.d.ts +8 -1
- package/dist/src/bundle/upload-artifact.d.ts +51 -0
- package/dist/src/mcp/tool-schemas.d.ts +1 -0
- package/dist/src/schemas/build.d.ts +41 -0
- package/dist/src/schemas/bundle.d.ts +49 -1
- package/dist/src/schemas/sdk.d.ts +23 -1
- package/dist/src/sdk.d.ts +10 -2
- package/dist/src/sdk.js +381 -379
- package/dist/src/shared/json-stdout.d.ts +6 -0
- package/dist/updater-installed-worker.js +4 -4
- package/package.json +4 -2
- package/skills/native-builds/SKILL.md +22 -0
- package/skills/release-management/SKILL.md +15 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run `fn` while every ambient stdout write (clack logs, dependency output) is
|
|
3
|
+
* routed to stderr, so a `--json` command can print exactly one JSON document
|
|
4
|
+
* on stdout afterwards.
|
|
5
|
+
*/
|
|
6
|
+
export declare function withStdoutOnStderr<T>(fn: () => Promise<T>): Promise<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as DP}from"node:module";var pT=Object.create;var{getPrototypeOf:rT,defineProperty:V2,getOwnPropertyNames:pW,getOwnPropertyDescriptor:oT}=Object,rW=Object.prototype.hasOwnProperty;function oW(D){return this[D]}var tT,aT,r$=(D,$,F)=>{var U=D!=null&&typeof D==="object";if(U){var I=$?tT??=new WeakMap:aT??=new WeakMap,J=I.get(D);if(J)return J}F=D!=null?pT(rT(D)):{};let X=$||!D||!D.__esModule?V2(F,"default",{value:D,enumerable:!0}):F;for(let Q of pW(D))if(!rW.call(X,Q))V2(X,Q,{get:oW.bind(D,Q),enumerable:!0});if(U)I.set(D,X);return X},f0=(D)=>{var $=(cW??=new WeakMap).get(D),F;if($)return $;if($=V2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var U of pW(D))if(!rW.call($,U))V2($,U,{get:oW.bind(D,U),enumerable:!(F=oT(D,U))||F.enumerable})}return cW.set(D,$),$},cW,P=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var eT=(D)=>D;function sT(D,$){this[D]=eT.bind(null,$)}var tD=(D,$)=>{for(var F in $)V2(D,F,{get:$[F],enumerable:!0,configurable:!0,set:sT.bind($,F)})};var S=(D,$)=>()=>(D&&($=D(D=0)),$);var e6D=(D)=>Promise.all(D),o=DP(import.meta.url);var o$;var T1=S(()=>{o$={name:"@capgo/cli",type:"module",version:"8.97.3",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:key-create-mode":"bun test/test-key-create-mode.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:bundle-single-requests":"bun test test/test-bundle-single-requests.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-command-execution":"bun test/test-init-command-execution.mjs","test:init-upload-recovery":"bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-ota-checklist":"bun test/test-init-ota-checklist.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:key-create-mode && 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:bundle-single-requests && 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-command-execution && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:init-ota-checklist && 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:retryable-capgo-api-error && 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:retryable-capgo-api-error":"bun test/test-retryable-capgo-api-error.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:plan-validation":"bun test/test-plan-validation.mjs && bun test ./test/test-direct-offer-plan.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 ./test/test-init-completion-notice.mjs && bun test ./test/test-builder-setup-notice.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/cross-spawn":"^6.0.6","@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","cross-spawn":"^7.0.6",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 z0=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 FP}from"node:os";import{version as IP}from"node:process";function eW(D){aW=D}function JP(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function tW(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 XP(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 aI(D,$){if($===void 0||$===null){if(tI.has(D.toLowerCase()))throw new uD(tW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(tI.has(D.toLowerCase()))throw new uD(tW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(!JP($)){if(tI.has(D.toLowerCase()))throw new uD(XP(D));throw new uD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function I0(D){let $={capgo_api:UP,"x-cli-version":o$.version,"x-cli-command":aW,"x-cli-node":IP,"x-cli-os":FP()};if(D)for(let[F,U]of Object.entries(D))$[F]=aI(F,U);return $}var UP="2025-10-01",aW="",tI;var C3=S(()=>{T1();z0();tI=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as M$}from"fs";var A2=(D=".",$="unknown")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(M$(F)||M$(U))return"bun";if(M$(I)||M$(J))return"pnpm";if(M$(X))return"yarn";if(M$(Q)||M$(Y))return"npm";return $},_3=(D=A2(),$=!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"}},sW=(D=".",$="npx")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(M$(F)||M$(U))return"bunx";if(M$(I)||M$(J))return"pnpm exec";if(M$(X))return"yarn dlx";if(M$(Q)||M$(Y))return"npx";return $};var Du=()=>{};var $u,Fu=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},Iu=(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 Uu=S(()=>{$u=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let F=0;D.lastIndex=0;while(D.test($))F+=1;return $.length-F}})()});var QP,YP,Ju,BP,Xu,qP,KP,EP,Qu=(D,$={},F={})=>{let U=$.limit??1/0,I=$.ellipsis??"",J=$?.ellipsisWidth??(I?Qu(I,EP,F).width:0),X=0,Q=F.controlWidth??0,Y=F.tabWidth??8,B=F.emojiWidth??2,q=2,K=F.regularWidth??1,W=F.wideWidth??2,u=[[qP,K],[QP,0],[YP,Q],[BP,Y],[Xu,B],[Ju,W]],E=0,G=0,L=D.length,z=0,O=!1,N=L,Z=Math.max(0,U-J),A=0,M=0,b=0,n=0;D:while(!0){if(M>A||G>=L&&G>E){let _=D.slice(A,M)||D.slice(E,G);z=0;for(let m of _.replaceAll(KP,"")){let y=m.codePointAt(0)||0;if(Fu(y))n=2;else if(Iu(y))n=W;else n=K;if(b+n>Z)N=Math.min(N,Math.max(A,E)+z);if(b+n>U){O=!0;break D}z+=m.length,b+=n}A=M=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===Ju?$u(D.slice(G,y.lastIndex)):y===Xu?1:y.lastIndex-G,n=z*DD,b+n>Z)N=Math.min(N,G+Math.floor((Z-b)/DD));if(b+n>U){O=!0;break D}b+=n,A=E,M=G,G=E=y.lastIndex;continue D}}G+=1}return{width:O?Z:b,index:O?N:L,truncated:O,ellipsed:O&&U>=J}},Yu;var Bu=S(()=>{Uu();QP=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,YP=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ju=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,BP=/\t{1,1000}/y,Xu=/[\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,qP=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,KP=/\p{M}+/gu,EP={limit:1/0,ellipsis:""},Yu=Qu});var WP,uP=(D,$={})=>{return Yu(D,WP,$).width},E$;var eI=S(()=>{Bu();WP={limit:1/0,ellipsis:"",ellipsisWidth:0},E$=uP});function w0(D,$,F){return String(D).normalize().split(OP).map((U)=>HP(U,$,F)).join(`
|
|
1
|
+
import{createRequire as DP}from"node:module";var pT=Object.create;var{getPrototypeOf:rT,defineProperty:V2,getOwnPropertyNames:pW,getOwnPropertyDescriptor:oT}=Object,rW=Object.prototype.hasOwnProperty;function oW(D){return this[D]}var tT,aT,r$=(D,$,F)=>{var U=D!=null&&typeof D==="object";if(U){var I=$?tT??=new WeakMap:aT??=new WeakMap,J=I.get(D);if(J)return J}F=D!=null?pT(rT(D)):{};let X=$||!D||!D.__esModule?V2(F,"default",{value:D,enumerable:!0}):F;for(let Q of pW(D))if(!rW.call(X,Q))V2(X,Q,{get:oW.bind(D,Q),enumerable:!0});if(U)I.set(D,X);return X},f0=(D)=>{var $=(cW??=new WeakMap).get(D),F;if($)return $;if($=V2({},"__esModule",{value:!0}),D&&typeof D==="object"||typeof D==="function"){for(var U of pW(D))if(!rW.call($,U))V2($,U,{get:oW.bind(D,U),enumerable:!(F=oT(D,U))||F.enumerable})}return cW.set(D,$),$},cW,P=(D,$)=>()=>($||D(($={exports:{}}).exports,$),$.exports);var eT=(D)=>D;function sT(D,$){this[D]=eT.bind(null,$)}var tD=(D,$)=>{for(var F in $)V2(D,F,{get:$[F],enumerable:!0,configurable:!0,set:sT.bind($,F)})};var S=(D,$)=>()=>(D&&($=D(D=0)),$);var e6D=(D)=>Promise.all(D),o=DP(import.meta.url);var o$;var T1=S(()=>{o$={name:"@capgo/cli",type:"module",version:"8.98.1",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:key-create-mode":"bun test/test-key-create-mode.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:offline-packers":"bun test/test-offline-packers.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:bundle-single-requests":"bun test test/test-bundle-single-requests.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:no-redirect-error":"bun test/test-no-redirect-error.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-command-execution":"bun test/test-init-command-execution.mjs","test:init-upload-recovery":"bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-ota-checklist":"bun test/test-init-ota-checklist.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:key-create-mode && 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:offline-packers && 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:bundle-single-requests && 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:no-redirect-error && 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-command-execution && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:init-ota-checklist && 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:retryable-capgo-api-error && 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:retryable-capgo-api-error":"bun test/test-retryable-capgo-api-error.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:plan-validation":"bun test/test-plan-validation.mjs && bun test ./test/test-direct-offer-plan.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 ./test/test-init-completion-notice.mjs && bun test ./test/test-builder-setup-notice.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/cross-spawn":"^6.0.6","@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","cross-spawn":"^7.0.6",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 z0=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 FP}from"node:os";import{version as IP}from"node:process";function eW(D){aW=D}function JP(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function tW(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 XP(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 aI(D,$){if($===void 0||$===null){if(tI.has(D.toLowerCase()))throw new uD(tW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(tI.has(D.toLowerCase()))throw new uD(tW(D));throw new uD(`HTTP header "${D}" is missing or invalid.`)}if(!JP($)){if(tI.has(D.toLowerCase()))throw new uD(XP(D));throw new uD(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function I0(D){let $={capgo_api:UP,"x-cli-version":o$.version,"x-cli-command":aW,"x-cli-node":IP,"x-cli-os":FP()};if(D)for(let[F,U]of Object.entries(D))$[F]=aI(F,U);return $}var UP="2025-10-01",aW="",tI;var C3=S(()=>{T1();z0();tI=new Set(["authorization","capgkey","x-capgo-log-token"])});import{existsSync as M$}from"fs";var A2=(D=".",$="unknown")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(M$(F)||M$(U))return"bun";if(M$(I)||M$(J))return"pnpm";if(M$(X))return"yarn";if(M$(Q)||M$(Y))return"npm";return $},_3=(D=A2(),$=!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"}},sW=(D=".",$="npx")=>{let F=`${D}/bun.lockb`,U=`${D}/bun.lock`,I=`${D}/pnpm-lock.yaml`,J=`${D}/shrinkwrap.yaml`,X=`${D}/yarn.lock`,Q=`${D}/package-lock.json`,Y=`${D}/npm-shrinkwrap.json`;if(M$(F)||M$(U))return"bunx";if(M$(I)||M$(J))return"pnpm exec";if(M$(X))return"yarn dlx";if(M$(Q)||M$(Y))return"npx";return $};var Du=()=>{};var $u,Fu=(D)=>{return D===12288||D>=65281&&D<=65376||D>=65504&&D<=65510},Iu=(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 Uu=S(()=>{$u=(()=>{let D=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return($)=>{let F=0;D.lastIndex=0;while(D.test($))F+=1;return $.length-F}})()});var QP,YP,Ju,BP,Xu,qP,KP,EP,Qu=(D,$={},F={})=>{let U=$.limit??1/0,I=$.ellipsis??"",J=$?.ellipsisWidth??(I?Qu(I,EP,F).width:0),X=0,Q=F.controlWidth??0,Y=F.tabWidth??8,B=F.emojiWidth??2,q=2,K=F.regularWidth??1,W=F.wideWidth??2,u=[[qP,K],[QP,0],[YP,Q],[BP,Y],[Xu,B],[Ju,W]],E=0,G=0,L=D.length,z=0,O=!1,N=L,Z=Math.max(0,U-J),A=0,M=0,b=0,n=0;D:while(!0){if(M>A||G>=L&&G>E){let _=D.slice(A,M)||D.slice(E,G);z=0;for(let m of _.replaceAll(KP,"")){let y=m.codePointAt(0)||0;if(Fu(y))n=2;else if(Iu(y))n=W;else n=K;if(b+n>Z)N=Math.min(N,Math.max(A,E)+z);if(b+n>U){O=!0;break D}z+=m.length,b+=n}A=M=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===Ju?$u(D.slice(G,y.lastIndex)):y===Xu?1:y.lastIndex-G,n=z*DD,b+n>Z)N=Math.min(N,G+Math.floor((Z-b)/DD));if(b+n>U){O=!0;break D}b+=n,A=E,M=G,G=E=y.lastIndex;continue D}}G+=1}return{width:O?Z:b,index:O?N:L,truncated:O,ellipsed:O&&U>=J}},Yu;var Bu=S(()=>{Uu();QP=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,YP=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ju=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,BP=/\t{1,1000}/y,Xu=/[\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,qP=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,KP=/\p{M}+/gu,EP={limit:1/0,ellipsis:""},Yu=Qu});var WP,uP=(D,$={})=>{return Yu(D,WP,$).width},E$;var eI=S(()=>{Bu();WP={limit:1/0,ellipsis:"",ellipsisWidth:0},E$=uP});function w0(D,$,F){return String(D).normalize().split(OP).map((U)=>HP(U,$,F)).join(`
|
|
2
2
|
`)}var k3="\x1B",uu="",GP=39,D7="\x07",Gu="[",NP="]",Nu="m",$7,qu,Ku=(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},Eu=(D)=>`${k3}${Gu}${D}${Nu}`,Wu=(D)=>`${k3}${$7}${D}${D7}`,sI=(D,$,F)=>{let U=$[Symbol.iterator](),I=!1,J=!1,X=D.at(-1),Q=X===void 0?0:E$(X),Y=U.next(),B=U.next(),q=0;while(!Y.done){let K=Y.value,W=E$(K);if(Q+W<=F)D[D.length-1]+=K;else D.push(K),Q=0;if(K===k3||K===uu)I=!0,J=$.startsWith($7,q+1);if(I){if(J){if(K===D7)I=!1,J=!1}else if(K===Nu)I=!1}else if(Q+=W,Q===F&&!B.done)D.push(""),Q=0;Y=B,B=U.next(),q+=K.length}if(X=D.at(-1),!Q&&X!==void 0&&X.length&&D.length>1)D[D.length-2]+=D.pop()},LP=(D)=>{let $=D.split(" "),F=$.length;while(F){if(E$($[F-1]))break;F--}if(F===$.length)return D;return $.slice(0,F).join(" ")+$.slice(F).join("")},HP=(D,$,F={})=>{if(F.trim!==!1&&D.trim()==="")return"";let U="",I,J,X=D.split(" "),Q=[""],Y=0;for(let K=0;K<X.length;K++){let W=X[K];if(F.trim!==!1){let E=Q.at(-1)??"",G=E.trimStart();if(E.length!==G.length)Q[Q.length-1]=G,Y=E$(G)}if(K!==0){if(Y>=$&&(F.wordWrap===!1||F.trim===!1))Q.push(""),Y=0;if(Y||F.trim===!1)Q[Q.length-1]+=" ",Y++}let u=E$(W);if(F.hard&&u>$){let E=$-Y,G=1+Math.floor((u-E-1)/$);if(Math.floor((u-1)/$)<G)Q.push("");sI(Q,W,$),Y=E$(Q.at(-1)??"");continue}if(Y+u>$&&Y&&u){if(F.wordWrap===!1&&Y<$){sI(Q,W,$),Y=E$(Q.at(-1)??"");continue}Q.push(""),Y=0}if(Y+u>$&&F.wordWrap===!1){sI(Q,W,$),Y=E$(Q.at(-1)??"");continue}Q[Q.length-1]+=W,Y+=u}if(F.trim!==!1)Q=Q.map((K)=>LP(K));let B=Q.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===k3||W===uu){qu.lastIndex=K+1;let E=qu.exec(B)?.groups;if(E?.code!==void 0){let G=Number.parseFloat(E.code);I=G===GP?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+=Wu("");let u=I?Ku(I):void 0;if(I&&u)U+=Eu(u)}else if(W===`
|
|
@@ -256,11 +256,11 @@ tell application "System Events" to get value of property list item "CFBundleNam
|
|
|
256
256
|
`)}function VQD(D){return[`Bundle upload timed out after ${Math.round(D/1000)}s.`,"The standard upload has to finish the whole transfer within this window and does not retry, so a large bundle or a slow connection can trip it.","What you can do:","1. Retry with the resumable upload, which uploads in chunks and retries automatically: npx @capgo/cli@latest bundle upload --tus","2. Or raise the limit for the standard upload: npx @capgo/cli@latest bundle upload --timeout <milliseconds>"].join(`
|
|
257
257
|
`)}function nD(D){if(!D)return"Unknown error";if(XW(D).isSecurityPolicyError)return Ab(D);let F=D;if(typeof D==="string")return D;if(D instanceof Error){let U=F.message||F.cause?.message||F.stack||D.name,I=F.cause?.name,J=U.toLowerCase();if(J.includes("fetch failed")||J.includes("failed to fetch")||J.includes("connect timeout")||J.includes("network")||I?.startsWith("UND_ERR"))return`Network error: ${U}${F.code?` (code ${F.code})`:""}. Check your network connection and API endpoint availability.`;let X=F.status||F.statusCode;return[U,F.code?`Code: ${F.code}`:void 0,X?`Status: ${X}`:void 0].filter(Boolean).join(" | ")||D.name}if(F.message){let U=[F.message,F.code?`Code: ${F.code}`:void 0,F.status||F.statusCode?`Status: ${F.status||F.statusCode}`:void 0].filter(Boolean).join(" | "),I=F.message.toLowerCase();if(I.includes("fetch failed")||I.includes("failed to fetch")||F.error==="Failed to fetch")return`Network error: ${U}. Check your network connection and API endpoint availability.`;if(F.details||F.hint||F.error)return`${U}${U?" | ":""}${F.error?typeof F.error==="string"?F.error:F.error.message??"":""}${F.details?`Details: ${F.details}`:""}${F.hint?`Hint: ${F.hint}`:""}`.trim();return U}if(typeof F.error==="string"&&F.error.length>0)return F.error;if(F.error&&typeof F.error==="object"&&typeof F.error.message==="string"&&F.error.message.length>0)return F.error.message;return`
|
|
258
258
|
${jT.default.render(D)}`}function bW(D){if(typeof D!=="string"&&typeof D!=="number")return;return _I(String(D)).slice(0,VT)}function J6D(D){if(typeof D==="string")return _I(D).slice(0,VT);if(!D||typeof D!=="object")return String(D);let $=D,F=bW($.name),U=bW($.message),I=F&&U?`${F}: ${U}`:U||F||Object.prototype.toString.call(D),J=[["code",$.code],["errno",$.errno],["syscall",$.syscall],["address",$.address],["port",$.port]].map(([X,Q])=>{let Y=bW(Q);return Y?`${X}=${Y}`:void 0}).filter(Boolean);return`${I}${J.length>0?` (${J.join(", ")})`:""}`}function RQD(D){let $=[],F=new Set,U=0,I=(J,X,Q)=>{if(U>=U6D)return;if(J&&typeof J==="object"){if(F.has(J))return;F.add(J)}U++;let Y=" ".repeat(Q);if($.push(`${Y}${X}${J6D(J)}`),!J||typeof J!=="object")return;let B=J,q=[B.causingError,B.cause].filter((K,W,u)=>K!==void 0&&K!==null&&u.indexOf(K)===W);for(let K of q)I(K,"Caused by: ",Q+1);if(Array.isArray(B.errors))B.errors.forEach((K,W)=>{I(K,`Contained error ${W+1}: `,Q+1)})};return I(D,"",0),_I($.join(`
|
|
259
|
-
`))}function SQD({silent:D=!1,stdinIsTTY:$=!!ZT.isTTY,stdoutIsTTY:F=!!MT.isTTY,ci:U=yW.isCI}={}){return!D&&$&&F&&!U}function X6D(D={}){let $=D.ci??yW.isCI,F=D.stdinIsTTY??!!ZT.isTTY,U=D.stdoutIsTTY??!!MT.isTTY,I=D.platform??zT(),J="display"in D?D.display:Z6.DISPLAY;if($||!F||!U)return!1;if(I==="linux"&&!J)return!1;return!0}async function bQD(D){if(!X6D())return;try{await(await Promise.resolve().then(() => ($T(),DT))).default(D)}catch($){if($?.code==="ENOENT")return}}function TQD(D){return DX(D)||$X(D)}function x0(D){if(DX(D))return ij(D);else if($X(D))return dj(D);return D}function AT(D=x0($$()),$=void 0){let F=$?.split(",")[0],U=F??ED(D,P$);if(!QD(U)){let J=F?`Package.json at ${U} does not exist`:`No package.json found at ${U}. Run this command from your project root (the folder that contains package.json), or pass --package-json <path> to point at it (for example in a monorepo).`;throw c.error(J),Error(J)}let I=dD(U);return JSON.parse(I)}function PQD(D=x0($$()),$=void 0){return AT(D,$).scripts}function CQD(D=x0($$()),$=void 0){return AT(D,$).version??""}function Q6D(D){let $=D.replace("^","").replace("~","");if(k2($))try{let F=a$($);return w7(F)}catch{return $}return $}async function _QD(D,$=$$(),F){let U=F?F.split(",").map((X)=>X.trim()).filter(Boolean):[],I=[],J=(X)=>{let Q=CD(X);if(!I.includes(Q))I.push(Q)};for(let X of U){let Q=CD($,X);if(QD(Q))J(g0(Q))}J(CD($)),J($$());for(let X of I)try{let Q=`${D}/package.json`,{createRequire:Y}=await import("node:module"),q=Y(ED(X,"package.json")).resolve(Q),K=JSON.parse(dD(q,"utf-8"));if(K.version)return K.version}catch{}for(let X of I){let Q=X,Y=b1.parse(Q).root;while(Q!==Y){let B=ED(Q,"node_modules",D,P$);if(QD(B))try{let K=JSON.parse(dD(B,"utf-8"));if(K.version)return K.version}catch{}let q=g0(Q);if(q===Q)break;Q=q}}if(D==="@capgo/capacitor-updater"){let X=null,Q=ED($,"ios","App","Podfile");if(QD(Q))try{let B=dD(Q,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(B?.[1])X=CD(ED($,"ios","App",B[1]))}catch{}if(!X){let Y=ED($,"android","capacitor.settings.gradle");if(QD(Y))try{let q=dD(Y,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(q?.[1])X=CD(ED($,"android",q[1])).replace(/\/android$/,"")}catch{}}if(X){let Y=ED(X,P$);if(QD(Y))try{let B=JSON.parse(dD(Y,"utf-8"));if(B.version)return B.version}catch{}}}try{let X=F?F.split(",").map((B)=>B.trim()).filter(Boolean).join(","):F,Y=(await rI($,X)).get(D);if(Y)return Y}catch{}return null}async function rI(D=x0($$()),$=void 0){let F=$?.split(",").map((J)=>J.trim()).filter(Boolean);if(F??=[ED(D,P$)],F){for(let J of F)if(!QD(J)){let X=`Package.json at ${J} does not exist`;throw c.error(X),Error(X)}}let U=new Map,{createRequire:I}=await import("node:module");for(let J of F){let X=dD(J),Q=JSON.parse(X),Y=g0(J),B=(q,K)=>{try{let G=I(ED(Y,"package.json")).resolve(`${q}/package.json`),L=JSON.parse(dD(G,"utf-8"));if(L.version)return L.version}catch{}let W=Y,u=b1.parse(W).root;while(W!==u){let E=ED(W,"node_modules",q,P$);if(QD(E))try{let L=JSON.parse(dD(E,"utf-8"));if(L.version)return L.version}catch{}let G=g0(W);if(G===W)break;W=G}return Q6D(K)};for(let q in Q.dependencies)U.set(q,B(q,Q.dependencies[q]));for(let q in Q.devDependencies)U.set(q,B(q,Q.devDependencies[q]))}return U}async function Y6D(D=x0($$()),$=void 0){let F=$?.split(",").map((I)=>I.trim()).filter(Boolean);if(F??=[ED(D,P$)],F){for(let I of F)if(!QD(I)){let J=`Package.json at ${I} does not exist`;throw c.error(J),Error(J)}}let U=new Map;for(let I of F){let J=dD(I),X=JSON.parse(J);for(let Q in X.dependencies??{})if(typeof X.dependencies[Q]==="string")U.set(Q,X.dependencies[Q]);for(let Q in X.devDependencies??{})if(typeof X.devDependencies[Q]==="string")U.set(Q,X.devDependencies[Q])}return U}function B6D(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&QD(D.path)}async function RT(D,$=!1){let F=q6D;try{let U=await D();if(!B6D(U)){if(!$)c.error(F);throw new uD(F)}return U}catch(U){if(U instanceof uD)throw U;let I=nD(U);if(!$)c.error(`${F}: ${I}`);throw new uD(F,{cause:I})}}function tU(D=!1){return RT(BX,D)}function K6D(D=!1){return RT(qX,D)}async function E6D(D,$){let F=await K6D();if(F?.config)F.config.plugins??={},F.config.plugins.extConfig??={},F.config.plugins[D]??={},F.config.plugins[D]={...F.config.plugins[D],...$},await KX(D,F);return F}async function kQD(D){return E6D("CapacitorUpdater",D)}function uT(D,$){if(typeof $!=="string"||!$.trim())return;try{return S1($)}catch(F){throw new uD(`Invalid ${D} in capacitor config: ${F instanceof Error?F.message:String(F)}`)}}async function G4(D=!1){let $;try{$=await tU(D)}catch{return GT({host:WT,hostWeb:lI,hostFilesApi:CW,hostApi:_W})}let F=uT("localApi",$?.config?.plugins?.CapacitorUpdater?.localApi),U=uT("localApiFiles",$?.config?.plugins?.CapacitorUpdater?.localApiFiles),I={host:$?.config?.plugins?.CapacitorUpdater?.localHost||WT,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||lI,hostFilesApi:U??F??CW,hostApi:F??_W};if(!F&&$?.config?.plugins?.CapacitorUpdater?.localSupa&&!mW().apiHost&&!kW("CAPGO_API_HOST"))throw new uD("`localSupa` in capacitor.config is no longer supported. Set `localApi` to your Capgo API URL instead.");return GT(I)}function TT(D){return{apiHost:D.apiHost?S1(D.apiHost):void 0,filesHost:D.filesHost?S1(D.filesHost):void 0}}function mW(){return bT.getStore()??ST}function gQD(D){ST=TT(D)}function W6D(D,$){return bT.run(TT(D),$)}function kW(D){let $=Z6[D]?.trim();return $?S1($):void 0}function GT(D){let $=mW(),F=$.apiHost??kW("CAPGO_API_HOST"),U=$.filesHost??($.apiHost?void 0:kW("CAPGO_FILES_HOST"));if(F)D.hostApi=F,D.hostFilesApi=F;if(U)D.hostFilesApi=U;return D}function NT(D){return typeof D==="object"&&D!==null}function u6D(D){if(!NT(D))return!1;let $=D.capacitor;if(NT($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function G6D(D){if(QD(ED(D,"plugin.xml")))return!0;let $=ED(D,P$);if(!QD($))return!1;try{return u6D(JSON.parse(dD($,"utf-8")))}catch{return!1}}function CT(D,$){if($)return $;return D===_W||D===CW?L6D():void 0}async function _T(D=!1,$,F){let U=(B)=>{let q={...B};return Gz(q,void 0,D),q},I=await G4(D),J=I.hostApi,X=LT.get(J);if(X)return U(X);let Q=TW.get(J);if(!$&&Q)return Q.then(U);let Y=(async()=>{try{let B=CT(J,F),q=await fetch(`${J}/private/config`,{...$?{signal:$}:{},redirect:"
|
|
260
|
-
`)[0].trim()}async function fQD(D){let $=await Y$(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let F=D instanceof Error?D.message:String(D??"");if(F.includes("CHANNEL_ZIP_REQUIRED"))return HT(F,"CHANNEL_ZIP_REQUIRED");if(F.includes("CHANNEL_DELTA_REQUIRED"))return HT(F,"CHANNEL_DELTA_REQUIRED");return null}function S1(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw new uD("Capgo API host must use HTTPS");let F=$.hostname==="localhost"||$.hostname==="127.0.0.1"||$.hostname==="[::1]";if($.protocol==="http:"&&!F)throw new uD("Capgo API host must use HTTPS (HTTP is only allowed for localhost)");if($.username||$.password)throw new uD("Capgo API host must not include credentials");if($.search||$.hash)throw new uD("Capgo API host must not include query parameters or fragments");return`${$.origin}${J6($.pathname)}`}async function hW(D,$=!0,F){let U=await G4($),I=D?S1(D):U.hostApi,J=F?S1(F):D&&I!==U.hostApi?I:U.hostFilesApi;return{apiHost:I,filesHost:J}}async function O6(D){let $=await Y$(D);if($){let F=N6D($);if(F)return F}return nD(D)}async function TD(D,$){let F=($.method??"POST").toUpperCase(),U=await hW($.apiHost),I=$.useFilesHost?U.filesHost:U.apiHost,J=`${J6(I)}/${D.replace(/^\//,"")}`,X=$.instrument!==!1&&Jz()?Qz(D.replace(/^\//,"")):fetch;try{let Q=await X(J,{method:F,redirect:"error",headers:I0({"Content-Type":"application/json",Authorization:$.apikey,capgkey:$.apikey,...$.apiVersion?{capgo_api:$.apiVersion}:{}}),body:F==="GET"||F==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!Q.ok)return{data:null,error:new W4(Q)};return{data:(Q.headers.get("content-type")??"").includes("application/json")?await Q.json().catch(()=>null):await Q.text().catch(()=>null),error:null}}catch(Q){return{data:null,error:Q instanceof Error?Q:Error(String(Q))}}}async function nQD(D,$=!0){return(await hW(D?.apiHost,$)).apiHost}async function yQD(D,$,F=!1,U,I){let J=aI("capgkey",D),X=async()=>{await _T(F,U,J);let B=await hW(void 0,F);if($&&!F)c.info(`Using custom Capgo API ${B.apiHost}`);return{apikey:J,...B}};if(!$&&!I)return X();let Q=mW(),Y=$?S1($):Q.apiHost;return W6D({apiHost:Y,filesHost:I??(Y===Q.apiHost?Q.filesHost:void 0)},X)}async function mQD(D,$,F={}){let{data:U,error:I}=await TD(`private/cli/members/2fa-status?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F.apiHost});if(I)throw I;return U??[]}async function hQD(D,$,F={}){let{data:U,error:I}=await TD(`private/cli/members/password-policy?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F.apiHost});if(I)throw I;return U??[]}function cI(D){try{if(!QD(D))return;return dD(D,"utf8").trim()||void 0}catch{return}}function L6D(){let D=Z6.CAPGO_TOKEN?.trim();if(D)return D;let $=cI(`${OT()}/.capgo`);if($)return $;return cI(".capgo")}function Sz(D=!1,$=(F)=>c.info(F)){let F=Z6.CAPGO_TOKEN?.trim();if(F){if(!D)$("Use CAPGO_TOKEN environment variable");return F}let I=`${OT()}/.capgo`,J=cI(I);if(J){if(!D)$(`Use global API key ${I}`)}else if(I=".capgo",J=cI(I),J&&!D)$(`Use local API key ${I}`);if(!J){let Q=`No Capgo API key found. Run \`${BV()}\` first, then retry this command.`;throw c.error(Q),new uD(Q)}return J}async function*iW(D){let $=await j2(D,{withFileTypes:!0});for(let F of $){let U=CD(D,F.name);if(F.isDirectory()&&!F.name.startsWith(".")&&!F.name.startsWith("node_modules")&&!F.name.startsWith("dist"))yield*iW(U);else yield U}}function iQD(D){let F=(D.endsWith(".br")?D.slice(0,-3):D).split(".").pop()?.toLowerCase()||"";return{html:"text/html",htm:"text/html",js:"application/javascript",mjs:"application/javascript",cjs:"application/javascript",css:"text/css",json:"application/json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",mp4:"video/mp4",webm:"video/webm",xml:"application/xml",txt:"text/plain",md:"text/markdown",pdf:"application/pdf",wasm:"application/wasm",map:"application/json"}[F]||"application/octet-stream"}function w6(D,$){return`${D}-${$?"ts":"js"}`}function v6(D,$){if(!$)c.info(`Found ${D} project`)}function H6D(D){if(QD(CD(D,"angular.json")))return"angular";if(QD(CD(D,"nuxt.config.js"))||QD(CD(D,"nuxt.config.ts")))return"nuxtjs";if(QD(CD(D,"next.config.js"))||QD(CD(D,"next.config.mjs"))||QD(CD(D,"next.config.ts")))return"nextjs";if(QD(CD(D,"svelte.config.js"))||QD(CD(D,"svelte.config.ts")))return"sveltekit";if(QD(CD(D,"vue.config.js"))||QD(CD(D,"vue.config.ts")))return"vue"}function kT(D){if(D.get("@angular/core"))return"angular";if(D.get("nuxt"))return"nuxtjs";if(D.get("next"))return"nextjs";if(D.get("@sveltejs/kit"))return"sveltekit";if(D.get("svelte"))return"svelte";if(D.get("vue"))return"vue";if(D.get("react"))return"react"}async function O6D(D,$){let F=QD(CD(D,"tsconfig.json")),U=H6D(D);if(U)return v6(U,$),w6(U,F);let I=CD(D,P$);if(!QD(I))return;let J=await rI(void 0,I),X=kT(J);if(!X)return;return v6(X,$),w6(X,F)}function PW(D,$){if(!$)return;let F=CD($);if(!D.includes(F))D.push(F)}function z6D(D){let $=D,F=b1.parse($).root;while(!0){if(QD(CD($,P$)))return $;if($===F)return;let U=g0($);if(U===$)return;$=U}}function w6D(D){let $=[],F=D?.split(",").map((U)=>U.trim()).filter(Boolean)[0];if(F)PW($,g0(CD(F)));return PW($,z6D($$())),PW($,x0($$())),$}async function dQD(D){let $=$$(),F=!1,U=D?.quiet??!1;for(let J of w6D(D?.packageJsonPath)){let X=await O6D(J,U);if(X)return X}let I=CD($,"tsconfig.json");if(QD(I))F=!0;for await(let J of iW($)){if(J.includes("angular.json"))return v6("angular",U),w6("angular",F);if(J.includes("nuxt.config.js")||J.includes("nuxt.config.ts"))return v6("nuxtjs",U),w6("nuxtjs",F);if(J.includes("next.config.js")||J.includes("next.config.mjs")||J.includes("next.config.ts"))return v6("nextjs",U),w6("nextjs",F);if(J.includes("svelte.config.js")||J.includes("svelte.config.ts"))return v6("sveltekit",U),w6("sveltekit",F);if(J.includes("vue.config.js")||J.includes("vue.config.ts"))return v6("vue",U),w6("vue",F);if(J.includes(P$)){let X=g0(J),Q=await rI(X),Y=kT(Q);if(Y)return v6(Y,U),w6(Y,F)}}return"unknown"}function lQD(D,$,F=$$()){if(D==="angular-js"||D==="angular-ts")return $?"src/main.ts":"src/main.js";if(D==="nextjs-js"||D==="nextjs-ts")return $?"src/app/layout.tsx":"src/app/layout.js";if(D==="svelte-js"||D==="svelte-ts")return $?"src/main.ts":"src/main.js";if(D==="vue-js"||D==="vue-ts")return $?"src/main.ts":"src/main.js";if(D==="react-js"||D==="react-ts"){let U=$?"src/main.tsx":"src/main.js",I=$?"src/index.tsx":"src/index.js";if(QD(CD(F,U)))return U;return I}return null}async function cQD(D){let $=D.replace(/-(?:ts|js)$/,"");if($==="angular")return c.info("Angular project detected"),"build";if($==="nuxtjs")return c.info("Nuxtjs project detected"),"generate";if($==="nextjs"){if(c.info("Nextjs project detected"),c.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),c.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),!await y0({message:"Do you want to continue?"}))throw c.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}if($==="sveltekit"){if(c.info("Sveltekit project detected"),c.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),c.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adapter"),!await y0({message:"Do you want to continue?"}))throw c.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}return"build"}async function pQD(D=!1,$=$$()){let F=/(main|index)\.(ts|tsx|js|jsx)$/,U="",I=CD($),J=I.split("/").length;for await(let X of iW(I))if(X.split("/").length-J<=2&&F.test(X)){if(U=X,!D)c.info(`Found main file here ${X}`);break}return U}async function rQD(D,$,F,U){let I={app_id:$,name:F,version:0};try{let J=await TD("files/upload_link",{apikey:D,body:I,useFilesHost:!0,apiHost:U?.apiHost});if(J.error){if(J.error instanceof W4){let X=await J.error.context.json().catch(()=>({}));c.error(`Upload URL error: ${X.status||JSON.stringify(X)}`)}else c.error(`Cannot get upload url: ${J.error.message}`);return""}return J.data?.url??""}catch(J){c.error(`Cannot get upload url ${nD(J)}`)}return""}async function*gT(D){let $=j2(D,{withFileTypes:!0});for(let F of $){let U=ED(D,F.name);if(F.isDirectory())yield*gT(U);else yield U}}function eQD(D,$="5.10.0",F="6.25.0",U="7.25.0"){if(D.major===5&&V6(D,a$($)))return!0;if(D.major===6&&V6(D,a$(F)))return!0;if(D.major===7&&V6(D,a$(U)))return!0;return!1}async function sQD(D){let $=[],F=[".DS_Store",".git",".gitignore","node_modules","package-lock.json","tsconfig.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json"];for await(let U of gT(D)){if(F.some((Q)=>U.includes(Q))){c.info(`Ignoring file ${U}, please ensure you have only required files in your dist folder`);continue}let I=dD(U);if(I.length===0){c.info(`Ignoring empty file ${U}, please ensure you have only required files in your dist folder`);continue}let J=await cj(I,"sha256"),X=wT(D,U);if(X.startsWith("/"))X=X.substring(1);$.push({file:X,hash:J})}return $}async function DYD(D){if(zT()==="win32")return Z6D(D);else return v6D(D)}function v6D(D){let $=new nW.default;return $.addLocalFolder(D),$.toBuffer()}async function Z6D(D){c.info("Zipping file windows mode");let $=new nW.default,F=(U,I)=>{let J=j2(U);for(let X of J){let Q=ED(U,X),Y=o0D(Q);if(Y.isFile()){let B=dD(Q);$.addFile(ED(I,X).split(vT).join("/"),B)}else if(Y.isDirectory())F(Q,ED(I,X))}};return F(D,""),$.toBuffer()}function M6D(D){let $=xW();return`App ${D} does not exist, run first \`${$.runner} @capgo/cli app add ${D}\` to create it`}function j6D(D){let F=D?.originalResponse?.getBody?.(),U=D instanceof Error?D.message:String(D??"");return`${F??""} ${U}`.includes("app_not_found")}async function $YD(D,$,F,U,I,J,X,Q){return new Promise((Y,B)=>{pF(D,{channel:"app",event:"App TUS upload",org_id:F,tracking_version:2,tags:{"app-id":U}}),new pI.Upload($,{endpoint:`${X.hostFilesApi}/files/upload/attachments/`,chunkSize:Q,retryDelays:[...F6D],metadataForPartialUploads:{filename:`orgs/${F}/apps/${U}/${I}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${F}/apps/${U}/${I}.zip`,filetype:"application/zip"},headers:I0({Authorization:D}),onError(K){if(c.error(`Error uploading bundle: ${K.message}`),j6D(K)){B(Error(M6D(U)));return}if(K instanceof pI.DetailedError){let W=K.originalResponse?.getBody(),u=K.originalResponse?.getStatus(),E=K.originalRequest?.getURL(),G=(()=>{try{let L=JSON.parse(W||'{"error": "unknown error"}');return L.status||L.error||L.message||"unknown error"}catch{return W||K.message}})();B(Error(`TUS upload failed (status ${u??"unknown"}, url ${E??"unknown"}): ${G}`))}else B(Error(`TUS upload failed: ${K.message||K.toString()}`))},onProgress(K,W){let u=(K/W*100).toFixed(2);J.message(`Uploaded ${u}%`)},async onSuccess(){await pF(D,{channel:"app",event:"App TUS done",org_id:F,tracking_version:2,tags:{"app-id":U}}).catch(),Y(!0)}}).start()})}async function FYD(D,$,F,U){let J=await TD("private/delete_failed_version",{apikey:D,method:"DELETE",body:{app_id:$,name:F},apiHost:U?.apiHost});if(J.error){if(J.error instanceof W4){let X=await J.error.context.json().catch(()=>({}));throw Error(X.status||X.message||JSON.stringify(X))}throw Error(J.error.message)}}async function IYD(D,$,F,U,I){let J={app_id:$,name:F,manifest:U},X=await cF(()=>TD("private/set_manifest",{apikey:D,body:J,apiHost:I?.apiHost}));if(X.error){if(X.error instanceof W4){let Q=await X.error.context.json().catch(()=>({}));throw Error(Q.error||Q.status||Q.message||JSON.stringify(Q))}throw Error(X.error.message)}}async function pF(D,$,F,U,I,J){let X=Date.now();if((j8(Z6.CAPGO_DISABLE_TELEMETRY)||j8(Z6.CAPGO_DISABLE_POSTHOG))&&!$.notifyConsole)return;try{let Y={};try{Y=$z()}catch(E){if(F)c.error(`Failed to enrich event tags, sending caller tags only: ${nD(E)}`)}let B={...$,nonPersonTags:{...Y,...$.nonPersonTags??{}}};if(F)c.info(`Get remove config: for ${$.event}`);let q=I??(await _T(!0,U)).hostApi;if(F)c.info(`Sending analytics event: ${JSON.stringify(B)}`);let K=new AbortController,W=setTimeout(()=>K.abort(),1e4),u=U?typeof AbortSignal.any==="function"?AbortSignal.any([K.signal,U]):U:K.signal;try{E0("telemetry request started");let E=await fetch(`${J6(q)}/private/events`,{method:"POST",body:JSON.stringify(B),headers:I0({"Content-Type":"application/json",capgkey:D}),signal:u,redirect:J});if(E0("telemetry response received",{duration_ms:Date.now()-X,status:E.status}),clearTimeout(W),!E.ok)throw Error(`HTTP error! status: ${E.status}`);let G=await E.json();if(G.error&&F)c.error(`Failed to send analytics event: ${G.error}`)}finally{clearTimeout(W)}}catch(Y){if(E0("telemetry request failed",{duration_ms:Date.now()-X,error:b5(Y)}),F)c.error("Failed to send Stats event details:"),c.error(nD(Y))}}function V6D(D){if(c.error(`
|
|
259
|
+
`))}function SQD({silent:D=!1,stdinIsTTY:$=!!ZT.isTTY,stdoutIsTTY:F=!!MT.isTTY,ci:U=yW.isCI}={}){return!D&&$&&F&&!U}function X6D(D={}){let $=D.ci??yW.isCI,F=D.stdinIsTTY??!!ZT.isTTY,U=D.stdoutIsTTY??!!MT.isTTY,I=D.platform??zT(),J="display"in D?D.display:Z6.DISPLAY;if($||!F||!U)return!1;if(I==="linux"&&!J)return!1;return!0}async function bQD(D){if(!X6D())return;try{await(await Promise.resolve().then(() => ($T(),DT))).default(D)}catch($){if($?.code==="ENOENT")return}}function TQD(D){return DX(D)||$X(D)}function x0(D){if(DX(D))return ij(D);else if($X(D))return dj(D);return D}function AT(D=x0($$()),$=void 0){let F=$?.split(",")[0],U=F??ED(D,P$);if(!QD(U)){let J=F?`Package.json at ${U} does not exist`:`No package.json found at ${U}. Run this command from your project root (the folder that contains package.json), or pass --package-json <path> to point at it (for example in a monorepo).`;throw c.error(J),Error(J)}let I=dD(U);return JSON.parse(I)}function PQD(D=x0($$()),$=void 0){return AT(D,$).scripts}function CQD(D=x0($$()),$=void 0){return AT(D,$).version??""}function Q6D(D){let $=D.replace("^","").replace("~","");if(k2($))try{let F=a$($);return w7(F)}catch{return $}return $}async function _QD(D,$=$$(),F){let U=F?F.split(",").map((X)=>X.trim()).filter(Boolean):[],I=[],J=(X)=>{let Q=CD(X);if(!I.includes(Q))I.push(Q)};for(let X of U){let Q=CD($,X);if(QD(Q))J(g0(Q))}J(CD($)),J($$());for(let X of I)try{let Q=`${D}/package.json`,{createRequire:Y}=await import("node:module"),q=Y(ED(X,"package.json")).resolve(Q),K=JSON.parse(dD(q,"utf-8"));if(K.version)return K.version}catch{}for(let X of I){let Q=X,Y=b1.parse(Q).root;while(Q!==Y){let B=ED(Q,"node_modules",D,P$);if(QD(B))try{let K=JSON.parse(dD(B,"utf-8"));if(K.version)return K.version}catch{}let q=g0(Q);if(q===Q)break;Q=q}}if(D==="@capgo/capacitor-updater"){let X=null,Q=ED($,"ios","App","Podfile");if(QD(Q))try{let B=dD(Q,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(B?.[1])X=CD(ED($,"ios","App",B[1]))}catch{}if(!X){let Y=ED($,"android","capacitor.settings.gradle");if(QD(Y))try{let q=dD(Y,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(q?.[1])X=CD(ED($,"android",q[1])).replace(/\/android$/,"")}catch{}}if(X){let Y=ED(X,P$);if(QD(Y))try{let B=JSON.parse(dD(Y,"utf-8"));if(B.version)return B.version}catch{}}}try{let X=F?F.split(",").map((B)=>B.trim()).filter(Boolean).join(","):F,Y=(await rI($,X)).get(D);if(Y)return Y}catch{}return null}async function rI(D=x0($$()),$=void 0){let F=$?.split(",").map((J)=>J.trim()).filter(Boolean);if(F??=[ED(D,P$)],F){for(let J of F)if(!QD(J)){let X=`Package.json at ${J} does not exist`;throw c.error(X),Error(X)}}let U=new Map,{createRequire:I}=await import("node:module");for(let J of F){let X=dD(J),Q=JSON.parse(X),Y=g0(J),B=(q,K)=>{try{let G=I(ED(Y,"package.json")).resolve(`${q}/package.json`),L=JSON.parse(dD(G,"utf-8"));if(L.version)return L.version}catch{}let W=Y,u=b1.parse(W).root;while(W!==u){let E=ED(W,"node_modules",q,P$);if(QD(E))try{let L=JSON.parse(dD(E,"utf-8"));if(L.version)return L.version}catch{}let G=g0(W);if(G===W)break;W=G}return Q6D(K)};for(let q in Q.dependencies)U.set(q,B(q,Q.dependencies[q]));for(let q in Q.devDependencies)U.set(q,B(q,Q.devDependencies[q]))}return U}async function Y6D(D=x0($$()),$=void 0){let F=$?.split(",").map((I)=>I.trim()).filter(Boolean);if(F??=[ED(D,P$)],F){for(let I of F)if(!QD(I)){let J=`Package.json at ${I} does not exist`;throw c.error(J),Error(J)}}let U=new Map;for(let I of F){let J=dD(I),X=JSON.parse(J);for(let Q in X.dependencies??{})if(typeof X.dependencies[Q]==="string")U.set(Q,X.dependencies[Q]);for(let Q in X.devDependencies??{})if(typeof X.devDependencies[Q]==="string")U.set(Q,X.devDependencies[Q])}return U}function B6D(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&QD(D.path)}async function RT(D,$=!1){let F=q6D;try{let U=await D();if(!B6D(U)){if(!$)c.error(F);throw new uD(F)}return U}catch(U){if(U instanceof uD)throw U;let I=nD(U);if(!$)c.error(`${F}: ${I}`);throw new uD(F,{cause:I})}}function tU(D=!1){return RT(BX,D)}function K6D(D=!1){return RT(qX,D)}async function E6D(D,$){let F=await K6D();if(F?.config)F.config.plugins??={},F.config.plugins.extConfig??={},F.config.plugins[D]??={},F.config.plugins[D]={...F.config.plugins[D],...$},await KX(D,F);return F}async function kQD(D){return E6D("CapacitorUpdater",D)}function uT(D,$){if(typeof $!=="string"||!$.trim())return;try{return S1($)}catch(F){throw new uD(`Invalid ${D} in capacitor config: ${F instanceof Error?F.message:String(F)}`)}}async function G4(D=!1){let $;try{$=await tU(D)}catch{return GT({host:WT,hostWeb:lI,hostFilesApi:CW,hostApi:_W})}let F=uT("localApi",$?.config?.plugins?.CapacitorUpdater?.localApi),U=uT("localApiFiles",$?.config?.plugins?.CapacitorUpdater?.localApiFiles),I={host:$?.config?.plugins?.CapacitorUpdater?.localHost||WT,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||lI,hostFilesApi:U??F??CW,hostApi:F??_W};if(!F&&$?.config?.plugins?.CapacitorUpdater?.localSupa&&!mW().apiHost&&!kW("CAPGO_API_HOST"))throw new uD("`localSupa` in capacitor.config is no longer supported. Set `localApi` to your Capgo API URL instead.");return GT(I)}function TT(D){return{apiHost:D.apiHost?S1(D.apiHost):void 0,filesHost:D.filesHost?S1(D.filesHost):void 0}}function mW(){return bT.getStore()??ST}function gQD(D){ST=TT(D)}function W6D(D,$){return bT.run(TT(D),$)}function kW(D){let $=Z6[D]?.trim();return $?S1($):void 0}function GT(D){let $=mW(),F=$.apiHost??kW("CAPGO_API_HOST"),U=$.filesHost??($.apiHost?void 0:kW("CAPGO_FILES_HOST"));if(F)D.hostApi=F,D.hostFilesApi=F;if(U)D.hostFilesApi=U;return D}function NT(D){return typeof D==="object"&&D!==null}function u6D(D){if(!NT(D))return!1;let $=D.capacitor;if(NT($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function G6D(D){if(QD(ED(D,"plugin.xml")))return!0;let $=ED(D,P$);if(!QD($))return!1;try{return u6D(JSON.parse(dD($,"utf-8")))}catch{return!1}}function CT(D,$){if($)return $;return D===_W||D===CW?L6D():void 0}async function _T(D=!1,$,F){let U=(B)=>{let q={...B};return Gz(q,void 0,D),q},I=await G4(D),J=I.hostApi,X=LT.get(J);if(X)return U(X);let Q=TW.get(J);if(!$&&Q)return Q.then(U);let Y=(async()=>{try{let B=CT(J,F),q=await fetch(`${J}/private/config`,{...$?{signal:$}:{},redirect:"manual",headers:I0(B?{capgkey:B}:void 0)});if(!q.ok)throw Error(`HTTP error! status: ${q.status}`);let W={...await q.json(),...I};return LT.set(J,W),{...W}}catch{if(!D)c.info(`Local config ${nD(I)}`);return{...I}}finally{if(!$)TW.delete(J)}})();if(!$)TW.set(J,Y);return Y.then(U)}async function xQD(D){let $=await G4();try{let F=CT($.hostFilesApi,D),U=await fetch(`${$.hostFilesApi}/files/config`,{redirect:"manual",headers:I0(F?{capgkey:F}:void 0)});if(!U.ok)throw Error(`HTTP error! status: ${U.status}`);return await U.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:D6D,maxChunkSize:$6D,alertUploadSize:s0D}}}function N6D(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function HT(D,$){let F=D.indexOf($);if(F<0)return D;return D.slice(F+$.length).replace(/^:\s*/,"").split(`
|
|
260
|
+
`)[0].trim()}async function fQD(D){let $=await Y$(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let F=D instanceof Error?D.message:String(D??"");if(F.includes("CHANNEL_ZIP_REQUIRED"))return HT(F,"CHANNEL_ZIP_REQUIRED");if(F.includes("CHANNEL_DELTA_REQUIRED"))return HT(F,"CHANNEL_DELTA_REQUIRED");return null}function S1(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw new uD("Capgo API host must use HTTPS");let F=$.hostname==="localhost"||$.hostname==="127.0.0.1"||$.hostname==="[::1]";if($.protocol==="http:"&&!F)throw new uD("Capgo API host must use HTTPS (HTTP is only allowed for localhost)");if($.username||$.password)throw new uD("Capgo API host must not include credentials");if($.search||$.hash)throw new uD("Capgo API host must not include query parameters or fragments");return`${$.origin}${J6($.pathname)}`}async function hW(D,$=!0,F){let U=await G4($),I=D?S1(D):U.hostApi,J=F?S1(F):D&&I!==U.hostApi?I:U.hostFilesApi;return{apiHost:I,filesHost:J}}async function O6(D){let $=await Y$(D);if($){let F=N6D($);if(F)return F}return nD(D)}async function TD(D,$){let F=($.method??"POST").toUpperCase(),U=await hW($.apiHost),I=$.useFilesHost?U.filesHost:U.apiHost,J=`${J6(I)}/${D.replace(/^\//,"")}`,X=$.instrument!==!1&&Jz()?Qz(D.replace(/^\//,"")):fetch;try{let Q=await X(J,{method:F,redirect:"manual",headers:I0({"Content-Type":"application/json",Authorization:$.apikey,capgkey:$.apikey,...$.apiVersion?{capgo_api:$.apiVersion}:{}}),body:F==="GET"||F==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!Q.ok)return{data:null,error:new W4(Q)};return{data:(Q.headers.get("content-type")??"").includes("application/json")?await Q.json().catch(()=>null):await Q.text().catch(()=>null),error:null}}catch(Q){return{data:null,error:Q instanceof Error?Q:Error(String(Q))}}}async function nQD(D,$=!0){return(await hW(D?.apiHost,$)).apiHost}async function yQD(D,$,F=!1,U,I){let J=aI("capgkey",D),X=async()=>{await _T(F,U,J);let B=await hW(void 0,F);if($&&!F)c.info(`Using custom Capgo API ${B.apiHost}`);return{apikey:J,...B}};if(!$&&!I)return X();let Q=mW(),Y=$?S1($):Q.apiHost;return W6D({apiHost:Y,filesHost:I??(Y===Q.apiHost?Q.filesHost:void 0)},X)}async function mQD(D,$,F={}){let{data:U,error:I}=await TD(`private/cli/members/2fa-status?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F.apiHost});if(I)throw I;return U??[]}async function hQD(D,$,F={}){let{data:U,error:I}=await TD(`private/cli/members/password-policy?org_id=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F.apiHost});if(I)throw I;return U??[]}function cI(D){try{if(!QD(D))return;return dD(D,"utf8").trim()||void 0}catch{return}}function L6D(){let D=Z6.CAPGO_TOKEN?.trim();if(D)return D;let $=cI(`${OT()}/.capgo`);if($)return $;return cI(".capgo")}function Sz(D=!1,$=(F)=>c.info(F)){let F=Z6.CAPGO_TOKEN?.trim();if(F){if(!D)$("Use CAPGO_TOKEN environment variable");return F}let I=`${OT()}/.capgo`,J=cI(I);if(J){if(!D)$(`Use global API key ${I}`)}else if(I=".capgo",J=cI(I),J&&!D)$(`Use local API key ${I}`);if(!J){let Q=`No Capgo API key found. Run \`${BV()}\` first, then retry this command.`;throw c.error(Q),new uD(Q)}return J}async function*iW(D){let $=await j2(D,{withFileTypes:!0});for(let F of $){let U=CD(D,F.name);if(F.isDirectory()&&!F.name.startsWith(".")&&!F.name.startsWith("node_modules")&&!F.name.startsWith("dist"))yield*iW(U);else yield U}}function iQD(D){let F=(D.endsWith(".br")?D.slice(0,-3):D).split(".").pop()?.toLowerCase()||"";return{html:"text/html",htm:"text/html",js:"application/javascript",mjs:"application/javascript",cjs:"application/javascript",css:"text/css",json:"application/json",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",avif:"image/avif",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf",eot:"application/vnd.ms-fontobject",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",mp4:"video/mp4",webm:"video/webm",xml:"application/xml",txt:"text/plain",md:"text/markdown",pdf:"application/pdf",wasm:"application/wasm",map:"application/json"}[F]||"application/octet-stream"}function w6(D,$){return`${D}-${$?"ts":"js"}`}function v6(D,$){if(!$)c.info(`Found ${D} project`)}function H6D(D){if(QD(CD(D,"angular.json")))return"angular";if(QD(CD(D,"nuxt.config.js"))||QD(CD(D,"nuxt.config.ts")))return"nuxtjs";if(QD(CD(D,"next.config.js"))||QD(CD(D,"next.config.mjs"))||QD(CD(D,"next.config.ts")))return"nextjs";if(QD(CD(D,"svelte.config.js"))||QD(CD(D,"svelte.config.ts")))return"sveltekit";if(QD(CD(D,"vue.config.js"))||QD(CD(D,"vue.config.ts")))return"vue"}function kT(D){if(D.get("@angular/core"))return"angular";if(D.get("nuxt"))return"nuxtjs";if(D.get("next"))return"nextjs";if(D.get("@sveltejs/kit"))return"sveltekit";if(D.get("svelte"))return"svelte";if(D.get("vue"))return"vue";if(D.get("react"))return"react"}async function O6D(D,$){let F=QD(CD(D,"tsconfig.json")),U=H6D(D);if(U)return v6(U,$),w6(U,F);let I=CD(D,P$);if(!QD(I))return;let J=await rI(void 0,I),X=kT(J);if(!X)return;return v6(X,$),w6(X,F)}function PW(D,$){if(!$)return;let F=CD($);if(!D.includes(F))D.push(F)}function z6D(D){let $=D,F=b1.parse($).root;while(!0){if(QD(CD($,P$)))return $;if($===F)return;let U=g0($);if(U===$)return;$=U}}function w6D(D){let $=[],F=D?.split(",").map((U)=>U.trim()).filter(Boolean)[0];if(F)PW($,g0(CD(F)));return PW($,z6D($$())),PW($,x0($$())),$}async function dQD(D){let $=$$(),F=!1,U=D?.quiet??!1;for(let J of w6D(D?.packageJsonPath)){let X=await O6D(J,U);if(X)return X}let I=CD($,"tsconfig.json");if(QD(I))F=!0;for await(let J of iW($)){if(J.includes("angular.json"))return v6("angular",U),w6("angular",F);if(J.includes("nuxt.config.js")||J.includes("nuxt.config.ts"))return v6("nuxtjs",U),w6("nuxtjs",F);if(J.includes("next.config.js")||J.includes("next.config.mjs")||J.includes("next.config.ts"))return v6("nextjs",U),w6("nextjs",F);if(J.includes("svelte.config.js")||J.includes("svelte.config.ts"))return v6("sveltekit",U),w6("sveltekit",F);if(J.includes("vue.config.js")||J.includes("vue.config.ts"))return v6("vue",U),w6("vue",F);if(J.includes(P$)){let X=g0(J),Q=await rI(X),Y=kT(Q);if(Y)return v6(Y,U),w6(Y,F)}}return"unknown"}function lQD(D,$,F=$$()){if(D==="angular-js"||D==="angular-ts")return $?"src/main.ts":"src/main.js";if(D==="nextjs-js"||D==="nextjs-ts")return $?"src/app/layout.tsx":"src/app/layout.js";if(D==="svelte-js"||D==="svelte-ts")return $?"src/main.ts":"src/main.js";if(D==="vue-js"||D==="vue-ts")return $?"src/main.ts":"src/main.js";if(D==="react-js"||D==="react-ts"){let U=$?"src/main.tsx":"src/main.js",I=$?"src/index.tsx":"src/index.js";if(QD(CD(F,U)))return U;return I}return null}async function cQD(D){let $=D.replace(/-(?:ts|js)$/,"");if($==="angular")return c.info("Angular project detected"),"build";if($==="nuxtjs")return c.info("Nuxtjs project detected"),"generate";if($==="nextjs"){if(c.info("Nextjs project detected"),c.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),c.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),!await y0({message:"Do you want to continue?"}))throw c.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}if($==="sveltekit"){if(c.info("Sveltekit project detected"),c.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),c.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adapter"),!await y0({message:"Do you want to continue?"}))throw c.error("Build command selection aborted by user"),Error("Build command selection aborted by user");return"build"}return"build"}async function pQD(D=!1,$=$$()){let F=/(main|index)\.(ts|tsx|js|jsx)$/,U="",I=CD($),J=I.split("/").length;for await(let X of iW(I))if(X.split("/").length-J<=2&&F.test(X)){if(U=X,!D)c.info(`Found main file here ${X}`);break}return U}async function rQD(D,$,F,U){let I={app_id:$,name:F,version:0};try{let J=await TD("files/upload_link",{apikey:D,body:I,useFilesHost:!0,apiHost:U?.apiHost});if(J.error){if(J.error instanceof W4){let X=await J.error.context.json().catch(()=>({}));c.error(`Upload URL error: ${X.status||JSON.stringify(X)}`)}else c.error(`Cannot get upload url: ${J.error.message}`);return""}return J.data?.url??""}catch(J){c.error(`Cannot get upload url ${nD(J)}`)}return""}async function*gT(D){let $=j2(D,{withFileTypes:!0});for(let F of $){let U=ED(D,F.name);if(F.isDirectory())yield*gT(U);else yield U}}function eQD(D,$="5.10.0",F="6.25.0",U="7.25.0"){if(D.major===5&&V6(D,a$($)))return!0;if(D.major===6&&V6(D,a$(F)))return!0;if(D.major===7&&V6(D,a$(U)))return!0;return!1}async function sQD(D){let $=[],F=[".DS_Store",".git",".gitignore","node_modules","package-lock.json","tsconfig.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json","tsconfig.app.json","tsconfig.spec.json"];for await(let U of gT(D)){if(F.some((Q)=>U.includes(Q))){c.info(`Ignoring file ${U}, please ensure you have only required files in your dist folder`);continue}let I=dD(U);if(I.length===0){c.info(`Ignoring empty file ${U}, please ensure you have only required files in your dist folder`);continue}let J=await cj(I,"sha256"),X=wT(D,U);if(X.startsWith("/"))X=X.substring(1);$.push({file:X,hash:J})}return $}async function DYD(D){if(zT()==="win32")return Z6D(D);else return v6D(D)}function v6D(D){let $=new nW.default;return $.addLocalFolder(D),$.toBuffer()}async function Z6D(D){c.info("Zipping file windows mode");let $=new nW.default,F=(U,I)=>{let J=j2(U);for(let X of J){let Q=ED(U,X),Y=o0D(Q);if(Y.isFile()){let B=dD(Q);$.addFile(ED(I,X).split(vT).join("/"),B)}else if(Y.isDirectory())F(Q,ED(I,X))}};return F(D,""),$.toBuffer()}function M6D(D){let $=xW();return`App ${D} does not exist, run first \`${$.runner} @capgo/cli app add ${D}\` to create it`}function j6D(D){let F=D?.originalResponse?.getBody?.(),U=D instanceof Error?D.message:String(D??"");return`${F??""} ${U}`.includes("app_not_found")}async function $YD(D,$,F,U,I,J,X,Q){return new Promise((Y,B)=>{pF(D,{channel:"app",event:"App TUS upload",org_id:F,tracking_version:2,tags:{"app-id":U}}),new pI.Upload($,{endpoint:`${X.hostFilesApi}/files/upload/attachments/`,chunkSize:Q,retryDelays:[...F6D],metadataForPartialUploads:{filename:`orgs/${F}/apps/${U}/${I}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${F}/apps/${U}/${I}.zip`,filetype:"application/zip"},headers:I0({Authorization:D}),onError(K){if(c.error(`Error uploading bundle: ${K.message}`),j6D(K)){B(Error(M6D(U)));return}if(K instanceof pI.DetailedError){let W=K.originalResponse?.getBody(),u=K.originalResponse?.getStatus(),E=K.originalRequest?.getURL(),G=(()=>{try{let L=JSON.parse(W||'{"error": "unknown error"}');return L.status||L.error||L.message||"unknown error"}catch{return W||K.message}})();B(Error(`TUS upload failed (status ${u??"unknown"}, url ${E??"unknown"}): ${G}`))}else B(Error(`TUS upload failed: ${K.message||K.toString()}`))},onProgress(K,W){let u=(K/W*100).toFixed(2);J.message(`Uploaded ${u}%`)},async onSuccess(){await pF(D,{channel:"app",event:"App TUS done",org_id:F,tracking_version:2,tags:{"app-id":U}}).catch(),Y(!0)}}).start()})}async function FYD(D,$,F,U){let J=await TD("private/delete_failed_version",{apikey:D,method:"DELETE",body:{app_id:$,name:F},apiHost:U?.apiHost});if(J.error){if(J.error instanceof W4){let X=await J.error.context.json().catch(()=>({}));throw Error(X.status||X.message||JSON.stringify(X))}throw Error(J.error.message)}}async function IYD(D,$,F,U,I){let J={app_id:$,name:F,manifest:U},X=await cF(()=>TD("private/set_manifest",{apikey:D,body:J,apiHost:I?.apiHost}));if(X.error){if(X.error instanceof W4){let Q=await X.error.context.json().catch(()=>({}));throw Error(Q.error||Q.status||Q.message||JSON.stringify(Q))}throw Error(X.error.message)}}async function pF(D,$,F,U,I,J){let X=Date.now();if((j8(Z6.CAPGO_DISABLE_TELEMETRY)||j8(Z6.CAPGO_DISABLE_POSTHOG))&&!$.notifyConsole)return;try{let Y={};try{Y=$z()}catch(E){if(F)c.error(`Failed to enrich event tags, sending caller tags only: ${nD(E)}`)}let B={...$,nonPersonTags:{...Y,...$.nonPersonTags??{}}};if(F)c.info(`Get remove config: for ${$.event}`);let q=I??(await _T(!0,U)).hostApi;if(F)c.info(`Sending analytics event: ${JSON.stringify(B)}`);let K=new AbortController,W=setTimeout(()=>K.abort(),1e4),u=U?typeof AbortSignal.any==="function"?AbortSignal.any([K.signal,U]):U:K.signal;try{E0("telemetry request started");let E=await fetch(`${J6(q)}/private/events`,{method:"POST",body:JSON.stringify(B),headers:I0({"Content-Type":"application/json",capgkey:D}),signal:u,redirect:J});if(E0("telemetry response received",{duration_ms:Date.now()-X,status:E.status}),clearTimeout(W),!E.ok)throw Error(`HTTP error! status: ${E.status}`);let G=await E.json();if(G.error&&F)c.error(`Failed to send analytics event: ${G.error}`)}finally{clearTimeout(W)}}catch(Y){if(E0("telemetry request failed",{duration_ms:Date.now()-X,error:b5(Y)}),F)c.error("Failed to send Stats event details:"),c.error(nD(Y))}}function V6D(D){if(c.error(`
|
|
261
261
|
\uD83D\uDD10 Access Denied: Two-Factor Authentication Required`),c.error("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"),D)c.error(`
|
|
262
262
|
The organization "${D}" requires all members to have 2FA enabled.`);else c.error(`
|
|
263
263
|
This organization requires all members to have 2FA enabled.`);throw c.error(`
|
|
264
264
|
To regain access:`),c.error(` 1. Go to ${e0D("/settings/account")}`),c.error(" 2. Enable Two-Factor Authentication on your account"),c.error(" 3. Try your command again"),c.error(`
|
|
265
265
|
For more information, visit: https://capgo.app/docs/webapp/2fa-enforcement/
|
|
266
|
-
`),Error("2FA required for this organization")}async function z6(D,$,F={}){let U=(F.method??"GET").toUpperCase(),I=F.query?new URLSearchParams(Object.entries(F.query).filter((X)=>typeof X[1]==="string"&&X[1].length>0)).toString():"",J=I?`${$}?${I}`:$;return TD(J,{apikey:D.apikey,method:U,body:U==="GET"||U==="HEAD"?void 0:F.body,apiHost:F.useFilesHost?D.filesHost??D.apiHost:D.apiHost,useFilesHost:F.useFilesHost&&!D.filesHost,signal:F.signal})}async function A6D(D,$={},F){let U=F?`private/cli/organizations?permission=${encodeURIComponent(F)}`:"private/cli/organizations",{data:I,error:J}=await TD(U,{apikey:D,method:"GET",body:void 0,apiHost:$.apiHost});if(J)throw Error(`Cannot get the list of organizations: ${nD(J)}`,{cause:J});return I??[]}async function UYD(D,$,F={}){let{data:U,error:I}=await TD(`organization?orgId=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F.apiHost});if(I||!U?.name)throw Error(`Cannot get organization details: ${nD(I)}`,{cause:I});return U}async function R6D(D,$,F,U={}){let I;try{I=await A6D($,{apiHost:U.apiHost??D.apiHost},F)}catch(X){throw c.error("Cannot get the list of organizations - exiting"),c.error(nD(X)),X}if(I.length===0)throw c.error("Could not get organization please create an organization first"),Error("No organizations available");let J=I.filter((X)=>X.allowed===!0);if(J.length===0)throw c.error(`Could not find organization with permission: ${F}`),Error("Could not find organization with required permission");return{allOrganizations:I,allowedOrganizations:J}}async function JYD(D,$,F){let{allOrganizations:U,allowedOrganizations:I}=await R6D(D,$,F),J=I.length>1?await _u({message:"Please pick the organization that you want to insert to",options:I.map((Y)=>{let B=Y.enforcing_2fa&&!Y["2fa_has_access"]?" ⚠️ (2FA required)":"";return{value:Y.gid,label:`${Y.name}${B}`}})}):I[0].gid;if(M6(J))throw c.warn("Canceled organization selection, exiting"),new uD("Organization selection cancelled");let X=J,Q=U.find((Y)=>Y.gid===X);if(Q.enforcing_2fa&&!Q["2fa_has_access"])V6D(Q.name);return c.info(`Using the organization "${Q.name}" as the app owner`),Q}async function XYD(D,$,F=!1,U={}){let I={apiHost:U.apiHost??D.apiHost},{data:J,error:X}=await TD("private/cli/identity",{apikey:$,method:"GET",body:void 0,apiHost:I.apiHost}),Q=(J?.userId||"").toString();if(X){if(!F)c.error(nD(X));throw X}if(!Q){if(!F)c.error("Capgo authentication failed: invalid Capgo API key or insufficient Capgo permissions.");throw Object.assign(Error("Capgo authentication failed: invalid Capgo API key or insufficient Capgo permissions."),{status:401})}return Q}async function S6D(D,$,F={}){let{data:U,error:I}=await z6(D,"private/cli/permissions",{method:"POST",body:{permissions:$,org_id:F.orgId??void 0,app_id:F.appId??void 0,channel_id:F.channelId??void 0}});if(I)throw Error(`Cannot check permissions ${$.join(", ")}: ${await O6(I)}`,{cause:I});return Object.fromEntries($.map((J)=>[J,U?.permissions?.[J]===!0]))}async function b6D(D,$,F,U={},I=!1){try{return(await S6D(D,[F],U))[F]===!0}catch(J){if(!I)c.error(`Cannot check permission ${F}`),c.error(nD(J));throw J}}async function QYD(D,$,F,U={},I={}){if(await b6D(D,$,F,U))return;let X=I.message||`Insufficient permissions for ${F}`;if(!I.silent)c.error(X);throw new uD(`Insufficient permissions for ${F}`,{permissionKey:F,...U})}async function bz(D,$,F){let{data:U,error:I}=await TD(`app/${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F?.apiHost});if(!U?.owner_org||I){let J=nD(I);throw c.error(`Cannot get organization id for app id ${$}: ${J}`),new uD("Cannot get organization id for app",{appId:$,cause:J})}return U.owner_org}function ET(D){return new Date(D||"").toLocaleString()}function xW(){if(gW)return{pm:R1,command:M2,installCommand:`${R1} ${M2}`,runner:dI};let D=x0($$());return R1=A2(D,"npm"),M2=_3(R1),gW=!0,dI=sW(D),{pm:R1,command:M2,installCommand:`${R1} ${M2}`,runner:dI}}function YYD(D){R1=D.pm,M2=D.command,dI=D.runner,gW=!0}function T6D(D,$){return{summary:`Best fix: recreate and sync ${$==="ios"?"iOS":"Android"} with this one-line command.`,command:`rm -rf ${$} && ${D} cap add ${$} && ${D} cap sync ${$}`}}function xT(D){return j2(D,{withFileTypes:!0}).flatMap((U)=>{let I=ED(D,U.name);if(U.isDirectory())return xT(I);else return I.split(`node_modules${vT}`)[1]||I})}function fT(D){if(!QD(D))return[];try{return j2(D,{withFileTypes:!0}).flatMap((U)=>{let I=ED(D,U.name);if(U.isDirectory())return fT(I);else return I})}catch{return[]}}function P6D(D,$){let F=[];if($==="ios"){try{let J=j2(D);for(let X of J)if(X.endsWith(".podspec"))F.push(ED(D,X))}catch{}let U=ED(D,"Package.swift"),I=ED(D,"ios","Package.swift");if(QD(U))F.push(U);if(QD(I))F.push(I)}else if($==="android"){let U=ED(D,"android"),I=ED(U,"build.gradle"),J=ED(U,"build.gradle.kts");if(QD(I))F.push(I);if(QD(J))F.push(J)}return F}async function C6D(D){let $=ED(D,"ios"),F=ED(D,"android"),U=async(X,Q)=>{let Y=QD(X)?fT(X).filter((u)=>PT.test(u)):[],B=P6D(D,Q),q=[...Y,...B].sort((u,E)=>u.localeCompare(E));if(q.length===0)return;let{createHash:K}=await import("node:crypto"),W=K("sha256");for(let u of q)try{let E=wT(D,u);W.update(E);let G=dD(u);W.update(G)}catch{}return W.digest("hex")},[I,J]=await Promise.all([U($,"ios"),U(F,"android")]);return{ios_checksum:I,android_checksum:J}}function _6D(D){let $=[],F=D,U=b1.parse(F).root;while(!0){if($.push(ED(F,"node_modules")),F===U)break;let I=g0(F);if(I===F)break;F=I}return $}async function k6D(D,$){let F=$?$.split(",").map((K)=>K.trim()).filter(Boolean):[],U;try{U=await rI("",D)}catch(K){throw c.error("Invalid package.json, JSON parsing failed"),c.error(`json parse error: ${nD(K)}`),K instanceof Error?K:Error("Invalid package.json")}let I=D?D.split(",")[0].trim():void 0,J=!I?x0($$()):b1.resolve(I).replace(P$,"");if(!U)throw c.error("Missing dependencies section in package.json"),Error("Missing dependencies section in package.json");for(let[K,W]of Object.entries(U))if(typeof W!=="string")throw c.error(`Invalid dependency ${K}: ${W}, expected string, got ${typeof W}`),Error(`Invalid dependency ${K}: expected string version`);let X=F.length===0?_6D($$()):F;if(!X.some((K)=>QD(K))){let K=A2(J,"npm"),W=_3(K);throw c.error(`Missing node_modules folder at ${X.join(", ")}, please run ${K} ${W}`),Error("Missing node_modules folder")}let Y=!1,B=await Y6D(x0($$()),D),q=await Promise.all(Array.from(U.entries()).map(async([K,W])=>{let u=!1,E=!1,G=W,L=B.get(K)??W,z;for(let Z of X){let A=ED(Z,K);if(QD(A)){u=!0,z=A;try{let M=ED(A,P$);if(QD(M)){let b=JSON.parse(dD(M,"utf-8"));if(b.version)G=b.version}}catch{}if(!G6D(A))continue;try{if(xT(A).some((b)=>PT.test(b))){E=!0;break}}catch(M){throw c.error(`Error reading node_modules files for ${K} package in ${Z}`),c.error(nD(M)),M instanceof Error?M:Error(`Error reading node_modules files for ${K}`)}}}if(!u){Y=!0;let Z=A2(J,"npm"),A=_3(Z);return c.error(`Missing dependency ${K}, please run ${Z} ${A}`),{name:K,version:G,requested_version:L}}let O,N;if(E&&z){let Z=await C6D(z);O=Z.ios_checksum,N=Z.android_checksum}return{name:K,version:G,requested_version:L,native:E,ios_checksum:O,android_checksum:N}}));if(Y||q.some((K)=>K.native===void 0))throw c.error("Missing dependencies or invalid dependencies"),c.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),Error("Missing dependencies or invalid dependencies");return q}async function nT(D,$,F,U={}){let{fetchChannelCompatibilityContext:I}=await Promise.resolve().then(() => (RW(),QT)),J=await I({apikey:D,...U},$,F);if(!J?.version)return fW([]);return fW(J.version.native_packages??[])}async function BYD(D,$,F,U={}){let I=new URLSearchParams({app_id:$,channel:F}),{data:J,error:X}=await TD(`channel/current-bundle?${I.toString()}`,{apikey:D,method:"GET",body:void 0,apiHost:U.apiHost});if(X||!J?.bundle_name)return null;if(J.checksum!==void 0)return J.checksum;let{fetchBundleVersionRow:Q}=await Promise.resolve().then(() => (KT(),qT));return(await Q(D,$,J.bundle_name,U))?.checksum??null}function fW(D){if(!D)throw c.error("Error parsing native packages, perhaps the metadata does not exist in Capgo?"),Error("Error parsing native packages");for(let F of D){let U=JW(wb,F);if(!U.success){let I=U.error.issues.map((J)=>`${(J.path??[]).join(".")}: ${J.message}`).join(", ");throw c.error(`Invalid remote native package data: ${I}`),Error(`Invalid remote native package data: ${I}`)}}return new Map(D.map((F)=>[F.name,F]))}function Tz(D,$){return D||$?.plugins?.CapacitorUpdater?.appId||$?.appId}function g6D(D){let $=[];if(!D.localVersion)return{compatible:!0,reasons:[],message:"Package only exists on remote (will be removed)"};if(!D.remoteVersion)return $.push("new_plugin"),{compatible:!1,reasons:$,message:"New native plugin added (requires app store update)"};let F=!1;try{let K=o3(D.localVersion),W=o3(D.remoteVersion);F=tu(K,W)}catch{F=!1}if(!F)$.push("version_mismatch");if(D.localRequestedVersion&&D.remoteRequestedVersion&&D.localRequestedVersion.trim()!==D.remoteRequestedVersion.trim())$.push("requested_version_changed");let U=(K)=>typeof K==="string"&&K.trim().length>0,I=U(D.localIosChecksum)&&U(D.remoteIosChecksum)&&D.localIosChecksum!==D.remoteIosChecksum,J=U(D.localAndroidChecksum)&&U(D.remoteAndroidChecksum)&&D.localAndroidChecksum!==D.remoteAndroidChecksum;if(I&&J)$.push("both_platforms_changed");else if(I)$.push("ios_code_changed");else if(J)$.push("android_code_changed");let X=U(D.localIosChecksum)!==U(D.remoteIosChecksum),Q=U(D.localAndroidChecksum)!==U(D.remoteAndroidChecksum);if(X||Q)$.push("platform_checksum_metadata_changed");let Y=[],B=(K)=>K!=="requested_version_changed";for(let K of $)switch(K){case"version_mismatch":Y.push(`version changed: ${D.remoteVersion} → ${D.localVersion}`);break;case"requested_version_changed":Y.push(`requested version changed: ${D.remoteRequestedVersion??"unknown"} → ${D.localRequestedVersion??"unknown"}`);break;case"ios_code_changed":Y.push("iOS native code changed");break;case"android_code_changed":Y.push("Android native code changed");break;case"both_platforms_changed":Y.push("iOS and Android native code changed");break;case"platform_checksum_metadata_changed":Y.push("iOS/Android checksum metadata appeared or disappeared (may be Capgo CLI change — verify native code)");break;case"new_plugin":Y.push("new plugin (requires app store update)");break;case"removed_plugin":Y.push("plugin removed");break}if(!$.some(B))return{compatible:!0,reasons:$,message:Y.length>0?Y.join(", "):"Compatible"};return{compatible:!1,reasons:$,message:Y.join(", ")}}function qYD(D){return g6D(D).compatible}async function KYD(D,$,F,U,I,J={},X){let Q=await k6D(U,I),Y=X?fW(X):await nT(D,$,F,J),B=Q.filter((K)=>!!K.native).map((K)=>{let W=Y.get(K.name);if(W)return{name:K.name,localVersion:K.version,localRequestedVersion:K.requested_version,remoteVersion:W.version,remoteRequestedVersion:W.requested_version,localIosChecksum:K.ios_checksum,remoteIosChecksum:W.ios_checksum,localAndroidChecksum:K.android_checksum,remoteAndroidChecksum:W.android_checksum};return{name:K.name,localVersion:K.version,localRequestedVersion:K.requested_version,remoteVersion:void 0,localIosChecksum:K.ios_checksum,localAndroidChecksum:K.android_checksum}}),q=[...Y].filter(([K])=>!Q.some((W)=>W.name===K)).map(([K,W])=>({name:K,localVersion:void 0,remoteVersion:W.version,remoteRequestedVersion:W.requested_version,remoteIosChecksum:W.ios_checksum,remoteAndroidChecksum:W.android_checksum}));return B.push(...q),{finalCompatibility:B,localDependencies:Q}}async function EYD(D,$,F,U,I={}){let J=await nT(D,$,F,I),X=U.map((Y)=>{let B=J.get(Y.name);if(B)return{name:Y.name,localVersion:Y.version,localRequestedVersion:Y.requested_version,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,localIosChecksum:Y.ios_checksum,remoteIosChecksum:B.ios_checksum,localAndroidChecksum:Y.android_checksum,remoteAndroidChecksum:B.android_checksum};return{name:Y.name,localVersion:Y.version,localRequestedVersion:Y.requested_version,remoteVersion:void 0,localIosChecksum:Y.ios_checksum,localAndroidChecksum:Y.android_checksum}}),Q=[...J].filter(([Y])=>!U.some((B)=>B.name===Y)).map(([Y,B])=>({name:Y,localVersion:void 0,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,remoteIosChecksum:B.ios_checksum,remoteAndroidChecksum:B.android_checksum}));return X.push(...Q),{finalCompatibility:X,localDependencies:U}}function yT(D){if(!QD(D))return null;try{return JSON.parse(dD(D,"utf-8"))}catch{return null}}function iI(D){if(!D)return!1;return/@capgo\/capacitor-updater|CapgoCapacitorUpdater|CapacitorUpdaterPlugin/.test(D)}function x6D(D){let $=yT(D);if(!$)return!1;let F=$.packageClassList;return Array.isArray(F)&&F.includes("CapacitorUpdaterPlugin")}function f6D(D,$){if(!$)return ED(D,P$);return b1.isAbsolute($)?$:CD(D,$)}function n6D(D=$$(),$){let F=f6D(D,$),U=b1.basename(F)===P$?g0(F):F,I=[ED(U,"ios","App"),ED(D,"ios","App")].find((M)=>QD(M));if(!I)return{shouldCheck:!1,valid:!0,details:[]};let J=yT(F),X={...J?.dependencies,...J?.devDependencies,...J?.optionalDependencies},Q=Object.hasOwn(X,"@capgo/capacitor-updater"),Y=[U,D].some((M)=>QD(ED(M,"node_modules","@capgo","capacitor-updater"))),B=ED(I,"Podfile"),q=ED(I,"CapApp-SPM","Package.swift"),K=QD(B)?dD(B,"utf-8"):void 0,W=QD(q)?dD(q,"utf-8"):void 0,u=iI(K)||iI(W),E=ED(I,"Podfile.lock"),G=ED(I,"App","capacitor.plugins.json"),L=ED(I,"App","capacitor.config.json"),z=QD(E)?dD(E,"utf-8"):void 0,O=QD(G)?dD(G,"utf-8"):void 0,N=iI(z)||iI(O)||x6D(L);if(!(Q||Y||u||N))return{shouldCheck:!1,valid:!0,details:[]};let A=[];if(!u)A.push(`Missing @capgo/capacitor-updater in iOS dependency files (${B} or ${q})`);if(!N)A.push(`Missing @capgo/capacitor-updater in iOS native project outputs (${E}, ${G}, or ${L})`);return{shouldCheck:!0,valid:u&&N,details:A}}function y6D(D,$,F){if(!D.shouldCheck||D.valid)return;let U=T6D($,"ios");F?.(),c.error("Capgo iOS dependency sync verification failed.");for(let I of D.details)c.error(I);throw c.error("Stop here to avoid testing on a broken native iOS project."),c.warn(U.summary),c.info(U.command),new uD(GX)}async function WYD(D,$,F,U){let I=await y0({message:"Would you like to sync your project with Capacitor now? This is recommended to ensure encrypted updates work properly."});if(M6(I)){if(D&&$&&F)await u4("onboarding-v2",$,F,"canceled");throw c.warn("Canceled Capacitor sync"),new uD("Capacitor sync cancelled")}if(I){let J=xW(),X=m0();X.start("Running the command...");let Q;try{await new Promise((Y,B)=>{let q=r0D(J.runner,["cap","sync"],{stdio:"pipe"});q.on("close",(K)=>{if(K===0)Y();else B(Error(`Command failed with exit code ${K}`))}),q.on("error",(K)=>{B(K)})})}catch(Y){Q=Y,c.error(`Failed to run Capacitor sync: ${Y}`),c.warn(`Please run "${J.runner} cap sync" manually to ensure encrypted updates work properly`)}if(U?.validateIosUpdater)y6D(n6D($$(),U.packageJsonPath),J.runner,()=>X.stop("iOS sync check failed ❌"));if(Q){X.stop("Error");return}X.stop("Capacitor sync completed ✅")}else{let J=xW();c.warn("⚠️ Important: If you upload encrypted bundles without syncing, updates will fail!"),c.info(`Remember to run "${J.runner} cap sync" before uploading encrypted bundles`)}}var nW,yW,jT,pI,c,t0D=".capgo_key",a0D=".capgo_key_v2",wQD,vQD,WT="https://capgo.app",CW="https://files.capgo.app",_W="https://api.capgo.app",lI="https://console.capgo.app",ZQD=120000,s0D=20971520,D6D=1073741824,$6D=103809024,F6D,I6D=1e4,jQD="BundleUploadTimeoutError",P$="package.json",AQD,U6D=12,VT=2000,q6D="No capacitor config file found, run `cap init` first",ST,bT,PT,LT,TW,oQD="5.10.0",tQD="6.25.0",aQD="7.0.30",gW=!1,R1="npm",M2="install",dI="npx";var N4=S(()=>{Du();Z0();V7();C3();Fz();Yz();Bz();pU();Nz();Rz();_z();FX();pj();$V();EX();YV();qV();vb();Mb();z0();jb();Rb();nW=r$(mG(),1),yW=r$(C7(),1),jT=r$(ZN(),1),pI=r$(tO(),1);c={error:(D)=>hI("error",D),info:(D)=>hI("info",D),success:(D)=>hI("success",D),warn:(D)=>hI("warn",D)},wQD=`${t0D}.pub`,vQD=`${a0D}.pub`;F6D=[0,1000,3000,5000,1e4];AQD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i;ST={},bT=new p0D;PT=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;LT=new Map,TW=new Map});import{exit as t6D}from"node:process";import{workerData as a6D}from"node:worker_threads";C3();N4();EX();import{parentPort as mT}from"node:worker_threads";async function hT(D,$){let{project:F,apiHost:U,apikey:I,command:J,attemptId:X}=D;eW(J);let Q=(u,E,G={})=>{mT?.postMessage({type:"onboarding-analytics",payload:{channel:$.channel,event:u,tracking_version:2,timestamp:new Date(E),tags:{app_id:F.appId},nonPersonTags:{attempt_id:X,command_path:J,...G}}})},Y=Date.now();Q("scan_started",Y);let B=Y,q="error",K="not_attempted",W;try{if(E0("local scan started",{scan:$.step}),q=$.scan(F),B=Date.now(),E0("local scan finished",{scan:$.step,result:q,duration_ms:B-Y}),q!=="found")return;K="failed";let u=Date.now();E0("step update started",{scan:$.step});let E=await fetch(`${J6(U)}/app/${encodeURIComponent(F.appId)}`,{method:"PUT",headers:I0({"Content-Type":"application/json",Authorization:I,capgkey:I}),body:JSON.stringify({onboarding:{steps:{[$.step]:{status:"done"}}}}),redirect:"error"});if(E0("step update finished",{scan:$.step,status:E.status,duration_ms:Date.now()-u}),W=E.status,K=E.ok?"success":"rejected",E.ok)mT?.postMessage({type:"onboarding-step",step:$.step});await E.body?.cancel()}catch(u){throw E0("local check failed",{scan:$.step,error:b5(u)}),u}finally{if(q==="error")B=Date.now();Q("scan_ended",B,{result:q,duration_ms:B-Y,todo_report_status:K,...W===void 0?{}:{todo_report_http_status:W}})}}import{join as o6D}from"node:path";import{existsSync as iT,readFileSync as dW}from"node:fs";import{createRequire as m6D}from"node:module";import{dirname as lW,join as h6D}from"node:path";import i6D from"node:process";var d6D="@capgo/capacitor-updater",l6D="@capacitor/splash-screen";function c6D(D){if(!iT(D))return null;try{return JSON.parse(dW(D,"utf-8"))}catch{return null}}function p6D(D,$){let F=c6D(D);if(!F)return{version:null,section:null};let U=["dependencies","devDependencies","optionalDependencies"];for(let I of U){let J=F[I];if(!J||!Object.hasOwn(J,$))continue;let X=J[$];return{version:typeof X==="string"?X:String(X),section:I}}return{version:null,section:null}}function r6D(D,$){let U=lW(D);while(!0){let I=h6D(U,"node_modules",$,"package.json");if(iT(I))try{let X=JSON.parse(dW(I,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}let J=lW(U);if(J===U)break;U=J}if(!i6D.versions.pnp)return null;try{let J=m6D(D).resolve(`${$}/package.json`),X=JSON.parse(dW(J,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}return null}function dT(D,$){let F=lW(D),U=p6D(D,$),I=r6D(D,$),J=[];if(!U.version)J.push(`Missing ${$} in ${D}`);if(!I)J.push(`Cannot resolve ${$} from ${F}/node_modules`);return{packageJsonPath:D,projectDir:F,declaredVersion:U.version,declaredIn:U.section,installedVersion:I,ready:J.length===0,details:J}}function lT(D){return dT(D,d6D)}function jYD(D){return dT(D,l6D)}function cT(D){return lT(o6D(D.dir,"package.json")).ready?"found":"not_found"}hT(a6D,{channel:"updater-installed",step:"add_updater",scan:cT}).catch(()=>{}).finally(()=>t6D(0));
|
|
266
|
+
`),Error("2FA required for this organization")}async function z6(D,$,F={}){let U=(F.method??"GET").toUpperCase(),I=F.query?new URLSearchParams(Object.entries(F.query).filter((X)=>typeof X[1]==="string"&&X[1].length>0)).toString():"",J=I?`${$}?${I}`:$;return TD(J,{apikey:D.apikey,method:U,body:U==="GET"||U==="HEAD"?void 0:F.body,apiHost:F.useFilesHost?D.filesHost??D.apiHost:D.apiHost,useFilesHost:F.useFilesHost&&!D.filesHost,signal:F.signal})}async function A6D(D,$={},F){let U=F?`private/cli/organizations?permission=${encodeURIComponent(F)}`:"private/cli/organizations",{data:I,error:J}=await TD(U,{apikey:D,method:"GET",body:void 0,apiHost:$.apiHost});if(J)throw Error(`Cannot get the list of organizations: ${nD(J)}`,{cause:J});return I??[]}async function UYD(D,$,F={}){let{data:U,error:I}=await TD(`organization?orgId=${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F.apiHost});if(I||!U?.name)throw Error(`Cannot get organization details: ${nD(I)}`,{cause:I});return U}async function R6D(D,$,F,U={}){let I;try{I=await A6D($,{apiHost:U.apiHost??D.apiHost},F)}catch(X){throw c.error("Cannot get the list of organizations - exiting"),c.error(nD(X)),X}if(I.length===0)throw c.error("Could not get organization please create an organization first"),Error("No organizations available");let J=I.filter((X)=>X.allowed===!0);if(J.length===0)throw c.error(`Could not find organization with permission: ${F}`),Error("Could not find organization with required permission");return{allOrganizations:I,allowedOrganizations:J}}async function JYD(D,$,F){let{allOrganizations:U,allowedOrganizations:I}=await R6D(D,$,F),J=I.length>1?await _u({message:"Please pick the organization that you want to insert to",options:I.map((Y)=>{let B=Y.enforcing_2fa&&!Y["2fa_has_access"]?" ⚠️ (2FA required)":"";return{value:Y.gid,label:`${Y.name}${B}`}})}):I[0].gid;if(M6(J))throw c.warn("Canceled organization selection, exiting"),new uD("Organization selection cancelled");let X=J,Q=U.find((Y)=>Y.gid===X);if(Q.enforcing_2fa&&!Q["2fa_has_access"])V6D(Q.name);return c.info(`Using the organization "${Q.name}" as the app owner`),Q}async function XYD(D,$,F=!1,U={}){let I={apiHost:U.apiHost??D.apiHost},{data:J,error:X}=await TD("private/cli/identity",{apikey:$,method:"GET",body:void 0,apiHost:I.apiHost}),Q=(J?.userId||"").toString();if(X){if(!F)c.error(nD(X));throw X}if(!Q){if(!F)c.error("Capgo authentication failed: invalid Capgo API key or insufficient Capgo permissions.");throw Object.assign(Error("Capgo authentication failed: invalid Capgo API key or insufficient Capgo permissions."),{status:401})}return Q}async function S6D(D,$,F={}){let{data:U,error:I}=await z6(D,"private/cli/permissions",{method:"POST",body:{permissions:$,org_id:F.orgId??void 0,app_id:F.appId??void 0,channel_id:F.channelId??void 0}});if(I)throw Error(`Cannot check permissions ${$.join(", ")}: ${await O6(I)}`,{cause:I});return Object.fromEntries($.map((J)=>[J,U?.permissions?.[J]===!0]))}async function b6D(D,$,F,U={},I=!1){try{return(await S6D(D,[F],U))[F]===!0}catch(J){if(!I)c.error(`Cannot check permission ${F}`),c.error(nD(J));throw J}}async function QYD(D,$,F,U={},I={}){if(await b6D(D,$,F,U))return;let X=I.message||`Insufficient permissions for ${F}`;if(!I.silent)c.error(X);throw new uD(`Insufficient permissions for ${F}`,{permissionKey:F,...U})}async function bz(D,$,F){let{data:U,error:I}=await TD(`app/${encodeURIComponent($)}`,{apikey:D,method:"GET",body:void 0,apiHost:F?.apiHost});if(!U?.owner_org||I){let J=nD(I);throw c.error(`Cannot get organization id for app id ${$}: ${J}`),new uD("Cannot get organization id for app",{appId:$,cause:J})}return U.owner_org}function ET(D){return new Date(D||"").toLocaleString()}function xW(){if(gW)return{pm:R1,command:M2,installCommand:`${R1} ${M2}`,runner:dI};let D=x0($$());return R1=A2(D,"npm"),M2=_3(R1),gW=!0,dI=sW(D),{pm:R1,command:M2,installCommand:`${R1} ${M2}`,runner:dI}}function YYD(D){R1=D.pm,M2=D.command,dI=D.runner,gW=!0}function T6D(D,$){return{summary:`Best fix: recreate and sync ${$==="ios"?"iOS":"Android"} with this one-line command.`,command:`rm -rf ${$} && ${D} cap add ${$} && ${D} cap sync ${$}`}}function xT(D){return j2(D,{withFileTypes:!0}).flatMap((U)=>{let I=ED(D,U.name);if(U.isDirectory())return xT(I);else return I.split(`node_modules${vT}`)[1]||I})}function fT(D){if(!QD(D))return[];try{return j2(D,{withFileTypes:!0}).flatMap((U)=>{let I=ED(D,U.name);if(U.isDirectory())return fT(I);else return I})}catch{return[]}}function P6D(D,$){let F=[];if($==="ios"){try{let J=j2(D);for(let X of J)if(X.endsWith(".podspec"))F.push(ED(D,X))}catch{}let U=ED(D,"Package.swift"),I=ED(D,"ios","Package.swift");if(QD(U))F.push(U);if(QD(I))F.push(I)}else if($==="android"){let U=ED(D,"android"),I=ED(U,"build.gradle"),J=ED(U,"build.gradle.kts");if(QD(I))F.push(I);if(QD(J))F.push(J)}return F}async function C6D(D){let $=ED(D,"ios"),F=ED(D,"android"),U=async(X,Q)=>{let Y=QD(X)?fT(X).filter((u)=>PT.test(u)):[],B=P6D(D,Q),q=[...Y,...B].sort((u,E)=>u.localeCompare(E));if(q.length===0)return;let{createHash:K}=await import("node:crypto"),W=K("sha256");for(let u of q)try{let E=wT(D,u);W.update(E);let G=dD(u);W.update(G)}catch{}return W.digest("hex")},[I,J]=await Promise.all([U($,"ios"),U(F,"android")]);return{ios_checksum:I,android_checksum:J}}function _6D(D){let $=[],F=D,U=b1.parse(F).root;while(!0){if($.push(ED(F,"node_modules")),F===U)break;let I=g0(F);if(I===F)break;F=I}return $}async function k6D(D,$){let F=$?$.split(",").map((K)=>K.trim()).filter(Boolean):[],U;try{U=await rI("",D)}catch(K){throw c.error("Invalid package.json, JSON parsing failed"),c.error(`json parse error: ${nD(K)}`),K instanceof Error?K:Error("Invalid package.json")}let I=D?D.split(",")[0].trim():void 0,J=!I?x0($$()):b1.resolve(I).replace(P$,"");if(!U)throw c.error("Missing dependencies section in package.json"),Error("Missing dependencies section in package.json");for(let[K,W]of Object.entries(U))if(typeof W!=="string")throw c.error(`Invalid dependency ${K}: ${W}, expected string, got ${typeof W}`),Error(`Invalid dependency ${K}: expected string version`);let X=F.length===0?_6D($$()):F;if(!X.some((K)=>QD(K))){let K=A2(J,"npm"),W=_3(K);throw c.error(`Missing node_modules folder at ${X.join(", ")}, please run ${K} ${W}`),Error("Missing node_modules folder")}let Y=!1,B=await Y6D(x0($$()),D),q=await Promise.all(Array.from(U.entries()).map(async([K,W])=>{let u=!1,E=!1,G=W,L=B.get(K)??W,z;for(let Z of X){let A=ED(Z,K);if(QD(A)){u=!0,z=A;try{let M=ED(A,P$);if(QD(M)){let b=JSON.parse(dD(M,"utf-8"));if(b.version)G=b.version}}catch{}if(!G6D(A))continue;try{if(xT(A).some((b)=>PT.test(b))){E=!0;break}}catch(M){throw c.error(`Error reading node_modules files for ${K} package in ${Z}`),c.error(nD(M)),M instanceof Error?M:Error(`Error reading node_modules files for ${K}`)}}}if(!u){Y=!0;let Z=A2(J,"npm"),A=_3(Z);return c.error(`Missing dependency ${K}, please run ${Z} ${A}`),{name:K,version:G,requested_version:L}}let O,N;if(E&&z){let Z=await C6D(z);O=Z.ios_checksum,N=Z.android_checksum}return{name:K,version:G,requested_version:L,native:E,ios_checksum:O,android_checksum:N}}));if(Y||q.some((K)=>K.native===void 0))throw c.error("Missing dependencies or invalid dependencies"),c.error("If you use monorepo, workspace or any special package manager you can use the --package-json [path,] and --node-modules [path,] options to make the command work properly"),Error("Missing dependencies or invalid dependencies");return q}async function nT(D,$,F,U={}){let{fetchChannelCompatibilityContext:I}=await Promise.resolve().then(() => (RW(),QT)),J=await I({apikey:D,...U},$,F);if(!J?.version)return fW([]);return fW(J.version.native_packages??[])}async function BYD(D,$,F,U={}){let I=new URLSearchParams({app_id:$,channel:F}),{data:J,error:X}=await TD(`channel/current-bundle?${I.toString()}`,{apikey:D,method:"GET",body:void 0,apiHost:U.apiHost});if(X||!J?.bundle_name)return null;if(J.checksum!==void 0)return J.checksum;let{fetchBundleVersionRow:Q}=await Promise.resolve().then(() => (KT(),qT));return(await Q(D,$,J.bundle_name,U))?.checksum??null}function fW(D){if(!D)throw c.error("Error parsing native packages, perhaps the metadata does not exist in Capgo?"),Error("Error parsing native packages");for(let F of D){let U=JW(wb,F);if(!U.success){let I=U.error.issues.map((J)=>`${(J.path??[]).join(".")}: ${J.message}`).join(", ");throw c.error(`Invalid remote native package data: ${I}`),Error(`Invalid remote native package data: ${I}`)}}return new Map(D.map((F)=>[F.name,F]))}function Tz(D,$){return D||$?.plugins?.CapacitorUpdater?.appId||$?.appId}function g6D(D){let $=[];if(!D.localVersion)return{compatible:!0,reasons:[],message:"Package only exists on remote (will be removed)"};if(!D.remoteVersion)return $.push("new_plugin"),{compatible:!1,reasons:$,message:"New native plugin added (requires app store update)"};let F=!1;try{let K=o3(D.localVersion),W=o3(D.remoteVersion);F=tu(K,W)}catch{F=!1}if(!F)$.push("version_mismatch");if(D.localRequestedVersion&&D.remoteRequestedVersion&&D.localRequestedVersion.trim()!==D.remoteRequestedVersion.trim())$.push("requested_version_changed");let U=(K)=>typeof K==="string"&&K.trim().length>0,I=U(D.localIosChecksum)&&U(D.remoteIosChecksum)&&D.localIosChecksum!==D.remoteIosChecksum,J=U(D.localAndroidChecksum)&&U(D.remoteAndroidChecksum)&&D.localAndroidChecksum!==D.remoteAndroidChecksum;if(I&&J)$.push("both_platforms_changed");else if(I)$.push("ios_code_changed");else if(J)$.push("android_code_changed");let X=U(D.localIosChecksum)!==U(D.remoteIosChecksum),Q=U(D.localAndroidChecksum)!==U(D.remoteAndroidChecksum);if(X||Q)$.push("platform_checksum_metadata_changed");let Y=[],B=(K)=>K!=="requested_version_changed";for(let K of $)switch(K){case"version_mismatch":Y.push(`version changed: ${D.remoteVersion} → ${D.localVersion}`);break;case"requested_version_changed":Y.push(`requested version changed: ${D.remoteRequestedVersion??"unknown"} → ${D.localRequestedVersion??"unknown"}`);break;case"ios_code_changed":Y.push("iOS native code changed");break;case"android_code_changed":Y.push("Android native code changed");break;case"both_platforms_changed":Y.push("iOS and Android native code changed");break;case"platform_checksum_metadata_changed":Y.push("iOS/Android checksum metadata appeared or disappeared (may be Capgo CLI change — verify native code)");break;case"new_plugin":Y.push("new plugin (requires app store update)");break;case"removed_plugin":Y.push("plugin removed");break}if(!$.some(B))return{compatible:!0,reasons:$,message:Y.length>0?Y.join(", "):"Compatible"};return{compatible:!1,reasons:$,message:Y.join(", ")}}function qYD(D){return g6D(D).compatible}async function KYD(D,$,F,U,I,J={},X){let Q=await k6D(U,I),Y=X?fW(X):await nT(D,$,F,J),B=Q.filter((K)=>!!K.native).map((K)=>{let W=Y.get(K.name);if(W)return{name:K.name,localVersion:K.version,localRequestedVersion:K.requested_version,remoteVersion:W.version,remoteRequestedVersion:W.requested_version,localIosChecksum:K.ios_checksum,remoteIosChecksum:W.ios_checksum,localAndroidChecksum:K.android_checksum,remoteAndroidChecksum:W.android_checksum};return{name:K.name,localVersion:K.version,localRequestedVersion:K.requested_version,remoteVersion:void 0,localIosChecksum:K.ios_checksum,localAndroidChecksum:K.android_checksum}}),q=[...Y].filter(([K])=>!Q.some((W)=>W.name===K)).map(([K,W])=>({name:K,localVersion:void 0,remoteVersion:W.version,remoteRequestedVersion:W.requested_version,remoteIosChecksum:W.ios_checksum,remoteAndroidChecksum:W.android_checksum}));return B.push(...q),{finalCompatibility:B,localDependencies:Q}}async function EYD(D,$,F,U,I={}){let J=await nT(D,$,F,I),X=U.map((Y)=>{let B=J.get(Y.name);if(B)return{name:Y.name,localVersion:Y.version,localRequestedVersion:Y.requested_version,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,localIosChecksum:Y.ios_checksum,remoteIosChecksum:B.ios_checksum,localAndroidChecksum:Y.android_checksum,remoteAndroidChecksum:B.android_checksum};return{name:Y.name,localVersion:Y.version,localRequestedVersion:Y.requested_version,remoteVersion:void 0,localIosChecksum:Y.ios_checksum,localAndroidChecksum:Y.android_checksum}}),Q=[...J].filter(([Y])=>!U.some((B)=>B.name===Y)).map(([Y,B])=>({name:Y,localVersion:void 0,remoteVersion:B.version,remoteRequestedVersion:B.requested_version,remoteIosChecksum:B.ios_checksum,remoteAndroidChecksum:B.android_checksum}));return X.push(...Q),{finalCompatibility:X,localDependencies:U}}function yT(D){if(!QD(D))return null;try{return JSON.parse(dD(D,"utf-8"))}catch{return null}}function iI(D){if(!D)return!1;return/@capgo\/capacitor-updater|CapgoCapacitorUpdater|CapacitorUpdaterPlugin/.test(D)}function x6D(D){let $=yT(D);if(!$)return!1;let F=$.packageClassList;return Array.isArray(F)&&F.includes("CapacitorUpdaterPlugin")}function f6D(D,$){if(!$)return ED(D,P$);return b1.isAbsolute($)?$:CD(D,$)}function n6D(D=$$(),$){let F=f6D(D,$),U=b1.basename(F)===P$?g0(F):F,I=[ED(U,"ios","App"),ED(D,"ios","App")].find((M)=>QD(M));if(!I)return{shouldCheck:!1,valid:!0,details:[]};let J=yT(F),X={...J?.dependencies,...J?.devDependencies,...J?.optionalDependencies},Q=Object.hasOwn(X,"@capgo/capacitor-updater"),Y=[U,D].some((M)=>QD(ED(M,"node_modules","@capgo","capacitor-updater"))),B=ED(I,"Podfile"),q=ED(I,"CapApp-SPM","Package.swift"),K=QD(B)?dD(B,"utf-8"):void 0,W=QD(q)?dD(q,"utf-8"):void 0,u=iI(K)||iI(W),E=ED(I,"Podfile.lock"),G=ED(I,"App","capacitor.plugins.json"),L=ED(I,"App","capacitor.config.json"),z=QD(E)?dD(E,"utf-8"):void 0,O=QD(G)?dD(G,"utf-8"):void 0,N=iI(z)||iI(O)||x6D(L);if(!(Q||Y||u||N))return{shouldCheck:!1,valid:!0,details:[]};let A=[];if(!u)A.push(`Missing @capgo/capacitor-updater in iOS dependency files (${B} or ${q})`);if(!N)A.push(`Missing @capgo/capacitor-updater in iOS native project outputs (${E}, ${G}, or ${L})`);return{shouldCheck:!0,valid:u&&N,details:A}}function y6D(D,$,F){if(!D.shouldCheck||D.valid)return;let U=T6D($,"ios");F?.(),c.error("Capgo iOS dependency sync verification failed.");for(let I of D.details)c.error(I);throw c.error("Stop here to avoid testing on a broken native iOS project."),c.warn(U.summary),c.info(U.command),new uD(GX)}async function WYD(D,$,F,U){let I=await y0({message:"Would you like to sync your project with Capacitor now? This is recommended to ensure encrypted updates work properly."});if(M6(I)){if(D&&$&&F)await u4("onboarding-v2",$,F,"canceled");throw c.warn("Canceled Capacitor sync"),new uD("Capacitor sync cancelled")}if(I){let J=xW(),X=m0();X.start("Running the command...");let Q;try{await new Promise((Y,B)=>{let q=r0D(J.runner,["cap","sync"],{stdio:"pipe"});q.on("close",(K)=>{if(K===0)Y();else B(Error(`Command failed with exit code ${K}`))}),q.on("error",(K)=>{B(K)})})}catch(Y){Q=Y,c.error(`Failed to run Capacitor sync: ${Y}`),c.warn(`Please run "${J.runner} cap sync" manually to ensure encrypted updates work properly`)}if(U?.validateIosUpdater)y6D(n6D($$(),U.packageJsonPath),J.runner,()=>X.stop("iOS sync check failed ❌"));if(Q){X.stop("Error");return}X.stop("Capacitor sync completed ✅")}else{let J=xW();c.warn("⚠️ Important: If you upload encrypted bundles without syncing, updates will fail!"),c.info(`Remember to run "${J.runner} cap sync" before uploading encrypted bundles`)}}var nW,yW,jT,pI,c,t0D=".capgo_key",a0D=".capgo_key_v2",wQD,vQD,WT="https://capgo.app",CW="https://files.capgo.app",_W="https://api.capgo.app",lI="https://console.capgo.app",ZQD=120000,s0D=20971520,D6D=1073741824,$6D=103809024,F6D,I6D=1e4,jQD="BundleUploadTimeoutError",P$="package.json",AQD,U6D=12,VT=2000,q6D="No capacitor config file found, run `cap init` first",ST,bT,PT,LT,TW,oQD="5.10.0",tQD="6.25.0",aQD="7.0.30",gW=!1,R1="npm",M2="install",dI="npx";var N4=S(()=>{Du();Z0();V7();C3();Fz();Yz();Bz();pU();Nz();Rz();_z();FX();pj();$V();EX();YV();qV();vb();Mb();z0();jb();Rb();nW=r$(mG(),1),yW=r$(C7(),1),jT=r$(ZN(),1),pI=r$(tO(),1);c={error:(D)=>hI("error",D),info:(D)=>hI("info",D),success:(D)=>hI("success",D),warn:(D)=>hI("warn",D)},wQD=`${t0D}.pub`,vQD=`${a0D}.pub`;F6D=[0,1000,3000,5000,1e4];AQD=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i;ST={},bT=new p0D;PT=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;LT=new Map,TW=new Map});import{exit as t6D}from"node:process";import{workerData as a6D}from"node:worker_threads";C3();N4();EX();import{parentPort as mT}from"node:worker_threads";async function hT(D,$){let{project:F,apiHost:U,apikey:I,command:J,attemptId:X}=D;eW(J);let Q=(u,E,G={})=>{mT?.postMessage({type:"onboarding-analytics",payload:{channel:$.channel,event:u,tracking_version:2,timestamp:new Date(E),tags:{app_id:F.appId},nonPersonTags:{attempt_id:X,command_path:J,...G}}})},Y=Date.now();Q("scan_started",Y);let B=Y,q="error",K="not_attempted",W;try{if(E0("local scan started",{scan:$.step}),q=$.scan(F),B=Date.now(),E0("local scan finished",{scan:$.step,result:q,duration_ms:B-Y}),q!=="found")return;K="failed";let u=Date.now();E0("step update started",{scan:$.step});let E=await fetch(`${J6(U)}/app/${encodeURIComponent(F.appId)}`,{method:"PUT",headers:I0({"Content-Type":"application/json",Authorization:I,capgkey:I}),body:JSON.stringify({onboarding:{steps:{[$.step]:{status:"done"}}}}),redirect:"manual"});if(E0("step update finished",{scan:$.step,status:E.status,duration_ms:Date.now()-u}),W=E.status,K=E.ok?"success":"rejected",E.ok)mT?.postMessage({type:"onboarding-step",step:$.step});await E.body?.cancel()}catch(u){throw E0("local check failed",{scan:$.step,error:b5(u)}),u}finally{if(q==="error")B=Date.now();Q("scan_ended",B,{result:q,duration_ms:B-Y,todo_report_status:K,...W===void 0?{}:{todo_report_http_status:W}})}}import{join as o6D}from"node:path";import{existsSync as iT,readFileSync as dW}from"node:fs";import{createRequire as m6D}from"node:module";import{dirname as lW,join as h6D}from"node:path";import i6D from"node:process";var d6D="@capgo/capacitor-updater",l6D="@capacitor/splash-screen";function c6D(D){if(!iT(D))return null;try{return JSON.parse(dW(D,"utf-8"))}catch{return null}}function p6D(D,$){let F=c6D(D);if(!F)return{version:null,section:null};let U=["dependencies","devDependencies","optionalDependencies"];for(let I of U){let J=F[I];if(!J||!Object.hasOwn(J,$))continue;let X=J[$];return{version:typeof X==="string"?X:String(X),section:I}}return{version:null,section:null}}function r6D(D,$){let U=lW(D);while(!0){let I=h6D(U,"node_modules",$,"package.json");if(iT(I))try{let X=JSON.parse(dW(I,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}let J=lW(U);if(J===U)break;U=J}if(!i6D.versions.pnp)return null;try{let J=m6D(D).resolve(`${$}/package.json`),X=JSON.parse(dW(J,"utf-8"));if(typeof X.version==="string")return X.version}catch{return null}return null}function dT(D,$){let F=lW(D),U=p6D(D,$),I=r6D(D,$),J=[];if(!U.version)J.push(`Missing ${$} in ${D}`);if(!I)J.push(`Cannot resolve ${$} from ${F}/node_modules`);return{packageJsonPath:D,projectDir:F,declaredVersion:U.version,declaredIn:U.section,installedVersion:I,ready:J.length===0,details:J}}function lT(D){return dT(D,d6D)}function jYD(D){return dT(D,l6D)}function cT(D){return lT(o6D(D.dir,"package.json")).ready?"found":"not_found"}hT(a6D,{channel:"updater-installed",step:"add_updater",scan:cT}).catch(()=>{}).finally(()=>t6D(0));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.98.1",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"test:credentials-validation": "bun test/test-credentials-validation.mjs",
|
|
83
83
|
"test:android-service-account-validation": "bun test/test-android-service-account-validation.mjs",
|
|
84
84
|
"test:build-zip-filter": "bun test/test-build-zip-filter.mjs",
|
|
85
|
+
"test:offline-packers": "bun test/test-offline-packers.mjs",
|
|
85
86
|
"test:checksum": "bun test/test-checksum-algorithm.mjs",
|
|
86
87
|
"test:build-needed": "bun test/test-build-needed.mjs",
|
|
87
88
|
"test:cli-help": "bun test/test-cli-help.mjs",
|
|
@@ -129,6 +130,7 @@
|
|
|
129
130
|
"test:cli-recovery": "bun test/test-cli-recovery.mjs",
|
|
130
131
|
"test:create-capgo-client": "bun test/test-create-capgo-client.mjs",
|
|
131
132
|
"test:no-supabase-sdk": "bun test/test-no-supabase-sdk.mjs",
|
|
133
|
+
"test:no-redirect-error": "bun test/test-no-redirect-error.mjs",
|
|
132
134
|
"test:onboarding-recovery": "bun test/test-onboarding-recovery.mjs",
|
|
133
135
|
"test:onboarding-progress": "bun test/test-onboarding-progress.mjs",
|
|
134
136
|
"test:onboarding-run-targets": "bun test/test-onboarding-run-targets.mjs",
|
|
@@ -199,7 +201,7 @@
|
|
|
199
201
|
"test": "bun run build && bun scripts/run-test-suite.ts",
|
|
200
202
|
"test:run": "bun scripts/run-test-suite.ts",
|
|
201
203
|
"test:serial": "bun run build && bun scripts/run-test-suite.ts --serial",
|
|
202
|
-
"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:key-create-mode && 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:bundle-single-requests && 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-command-execution && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:init-ota-checklist && 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:retryable-capgo-api-error && 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",
|
|
204
|
+
"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:key-create-mode && 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:offline-packers && 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:bundle-single-requests && 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:no-redirect-error && 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-command-execution && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:init-ota-checklist && 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:retryable-capgo-api-error && 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",
|
|
203
205
|
"test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
|
|
204
206
|
"test:builder-project-discovery": "bun test/test-builder-project-discovery.mjs",
|
|
205
207
|
"test:builder-app-selection": "bun test/test-builder-app-selection.mjs",
|
|
@@ -165,6 +165,14 @@ interface BuildLogger {
|
|
|
165
165
|
- RC: `npx @capgo/cli@latest build request com.example.app --platform ios --cache-key rc`
|
|
166
166
|
- PROD: `npx @capgo/cli@latest build request com.example.app --platform ios --cache-key prod`
|
|
167
167
|
|
|
168
|
+
### `build zip [appId]`
|
|
169
|
+
|
|
170
|
+
- Example: `npx @capgo/cli@latest build zip com.example.app --platform ios --json`
|
|
171
|
+
- Writes the exact native project archive `build request` uploads (same file filter, path rewriting, `--sync-ios-version` / `--sync-android-version`, config resolution) without uploading it. Use it when an agent uploads the archive through a Capgo MCP signed URL.
|
|
172
|
+
- Offline: no API key, no calls to Capgo.
|
|
173
|
+
- JSON output: `app_id`, `platform`, `filename`, `size_bytes`, `sha256`, optional `ios_dependency_manager` (`cocoapods` or `spm`), and `build_options` (non-secret options derived from the project: `platform`, `iosSourceDir`/`iosAppDir`/`iosProjectDir` or `androidSourceDir`/`androidAppDir`/`androidProjectDir`).
|
|
174
|
+
- Options: `--platform <platform>`, `--path <path>`, `--node-modules <nodeModules>`, `--sync-ios-version`, `--sync-android-version`, `--output <file>` (default `<appId>_<platform>_native.zip`), `-j, --json`.
|
|
175
|
+
|
|
168
176
|
## Local credential management
|
|
169
177
|
|
|
170
178
|
Credentials are stored locally, either globally in `~/.capgo-credentials/credentials.json` or locally in `.capgo-credentials.json`.
|
|
@@ -250,6 +258,20 @@ npx @capgo/cli@latest build credentials save --platform android \
|
|
|
250
258
|
- `--platform <platform>`
|
|
251
259
|
- `--local`
|
|
252
260
|
|
|
261
|
+
### `build credentials push` / `remote-status` / `remote-delete`
|
|
262
|
+
|
|
263
|
+
Store the locally saved credentials for one platform on Capgo, encrypted (AES-256-GCM, bound to the app and platform), so builds can use them without sending secrets each time (for example from the hosted Capgo MCP). Writing or deleting requires app settings permission (app admin), and so does building with them (`build request --use-stored-credentials` or the MCP `capgo_request_build`), because build scripts can read the secrets; reading the summary requires native build permission. Env names that load code into every build (`NODE_OPTIONS`, `JAVA_TOOL_OPTIONS`, `GRADLE_OPTS`, `LD_PRELOAD`, `DYLD_*`, `PATH`, ...) cannot be stored; pass them per build with `--build-env`. Only key names and non-secret facts (iOS distribution, team id, provisioning profile names and expiry, what is still missing) are ever shown.
|
|
264
|
+
|
|
265
|
+
- Examples:
|
|
266
|
+
- `npx @capgo/cli@latest build credentials push com.example.app --platform ios`
|
|
267
|
+
- `npx @capgo/cli@latest build credentials push --platform android --mode merge`
|
|
268
|
+
- `npx @capgo/cli@latest build credentials remote-status com.example.app`
|
|
269
|
+
- `npx @capgo/cli@latest build credentials remote-delete com.example.app --platform ios --yes`
|
|
270
|
+
- `push` options: `--platform <platform>` (required), `--mode replace|merge` (default `replace`), `--local`, `--global`, `-a, --apikey`, `--api-host`
|
|
271
|
+
- `remote-status` options: `--platform <platform>`, `-a, --apikey`, `--api-host`
|
|
272
|
+
- `remote-delete` options: `--platform <platform>` (required), `-y, --yes`, `-a, --apikey`, `--api-host`
|
|
273
|
+
- Agents with a shell can also upload a credentials file without the secrets entering the chat: `POST /build/credentials/upload-url` returns a 10-minute `PUT` URL that accepts the raw `credentials.json` file.
|
|
274
|
+
|
|
253
275
|
### `build credentials update`
|
|
254
276
|
|
|
255
277
|
- Use to update specific credential fields without re-entering all data.
|
|
@@ -144,17 +144,30 @@ Use this skill for OTA update workflows in Capgo Cloud.
|
|
|
144
144
|
### `bundle zip [appId]`
|
|
145
145
|
|
|
146
146
|
- Example: `npx @capgo/cli@latest bundle zip com.example.app --path ./dist`
|
|
147
|
+
- Offline packer example (for signed-URL uploads through the Capgo MCP): `npx @capgo/cli@latest bundle zip com.example.app --for-upload --delta-pack ./delta.zip --json`
|
|
147
148
|
- Notes:
|
|
148
149
|
- Produces a checksum for encryption workflows.
|
|
149
|
-
- Use `--json` for machine-readable output.
|
|
150
|
+
- Use `--json` for machine-readable output (JSON on stdout, logs on stderr).
|
|
151
|
+
- Works offline: no API key, no calls to Capgo (no analytics either).
|
|
152
|
+
- `--for-upload` produces exactly what `bundle upload` would send: same zip, checksum algorithm, v2 encryption (`.capgo_key_v2` by default, `--key-v2`, `--key-data-v2`, `--no-key`), and adds `session_key`, `key_id`, `native_packages` to the JSON. Without it, the zip is never encrypted (keeps the `bundle zip` then `bundle encrypt` flow).
|
|
153
|
+
- `--delta-pack <file>` (implies `--for-upload`) also writes a STORE zip with `capgo-delta-manifest.json` (`protocol_version`, `file_hash_format`, `delta_encryption`, `entries[]` with `file_name`, `file_hash`, `compression` = `none` or `brotli`, `uploaded_bytes_sha256`, `uploaded_bytes_size`, `pack_path`) and the uploaded bytes under `files/<id>`.
|
|
154
|
+
- JSON keys: `bundle`, `filename`, `checksum`, `app_id`, `updater_version`, `checksum_algorithm`, `size_bytes`, `cli_version`; with `--for-upload`: `encryption_method`, `session_key`, `key_id`, `native_packages`; with `--delta-pack`: `delta_pack`, `delta_pack_entries`, `delta_file_hash_format`, `delta_encryption`.
|
|
150
155
|
- Key options:
|
|
151
156
|
- `-p, --path <path>`
|
|
152
157
|
- `-b, --bundle <bundle>`
|
|
153
158
|
- `-n, --name <name>`
|
|
154
159
|
- `-j, --json`
|
|
155
160
|
- `--no-code-check`
|
|
156
|
-
- `--key-v2`
|
|
161
|
+
- `--key-v2 [key]`
|
|
162
|
+
- `--key-data-v2 <keyDataV2>`
|
|
163
|
+
- `--no-key`
|
|
164
|
+
- `--for-upload`
|
|
165
|
+
- `--delta-pack <file>`
|
|
166
|
+
- `--encrypt-delta`
|
|
167
|
+
- `--disable-brotli`
|
|
168
|
+
- `--force-crc32-checksum`
|
|
157
169
|
- `--package-json <packageJson>`
|
|
170
|
+
- `--node-modules <nodeModules>`
|
|
158
171
|
|
|
159
172
|
### `bundle encrypt [zipPath] [checksum]`
|
|
160
173
|
|